import{c as I,va as j}from"./chunk-T3QOFN7N.js";import{_f as b,ag as $,rf as R}from"./chunk-UJH7VVYJ.js";import{G as f,N as h,Oa as s,Sa as g,Ua as p,V as v,Vc as D,X as M,Xa as x,_c as d,d as l,da as r,db as S,ha as C,ja as n,pc as y}from"./chunk-AERFJGGZ.js";import"./chunk-KG2AOBAM.js";import{a as m,b as u}from"./chunk-4KQZYG2V.js";function w(e,t){if(e&1&&x(0,"app-html-editor",1),e&2){let c=S();p("dataSource",c.dataSource)("editable",c.editable)}}var N=(()=>{let t=class{constructor(i,o,a){this.contextService=i,this.activatedRoute=o,this.userService=a,this.apiRoute="/api/Visualization",this.appContext={},this.componentDestroyed$=new l}ngOnInit(){this.activatedRoute.params.pipe(v(i=>this.setContext(i)),f(()=>this.userService.isDatabaseAdmin(this.appContext).pipe(h())),M(this.componentDestroyed$)).subscribe(i=>{this.editable=i,this.dataSource={getHtmlFilePath:`${this.apiRoute}/${this.appContext.server}/${this.appContext.cluster}`,postHtmlFilePath:`${this.apiRoute}/${this.appContext.server}/${this.appContext.cluster}`}})}ngOnDestroy(){this.componentDestroyed$.next(!0),this.componentDestroyed$.complete()}setContext(i){return this.appContext=u(m({},i),{clusterMode:R.Visualization}),this.contextService.setContext(this.appContext)}},e=t;return(()=>{t.\u0275fac=function(o){return new(o||t)(s($),s(D),s(b))}})(),(()=>{t.\u0275cmp=C({type:t,selectors:[["app-visualization"]],decls:1,vars:1,consts:[[3,"dataSource","editable",4,"ngIf"],[3,"dataSource","editable"]],template:function(o,a){o&1&&g(0,w,1,2,"app-html-editor",0),o&2&&p("ngIf",a.dataSource)},dependencies:[y,I]})})(),e})();var J=[{path:"",component:N},{path:"reports",loadChildren:()=>import("./report-designer.module-6XRJKOLM.js").then(e=>e.ReportDesignerModule)},{path:"dashboards",loadChildren:()=>import("./dashboard-control.module-UQ3LGQH7.js").then(e=>e.DashboardControlModule)},{path:"**",redirectTo:"",pathMatch:"full"}],V=(()=>{let t=class{},e=t;return(()=>{t.\u0275fac=function(o){return new(o||t)}})(),(()=>{t.\u0275mod=n({type:t})})(),(()=>{t.\u0275inj=r({imports:[d.forChild(J),d]})})(),e})();var tt=(()=>{let t=class{},e=t;return(()=>{t.\u0275fac=function(o){return new(o||t)}})(),(()=>{t.\u0275mod=n({type:t})})(),(()=>{t.\u0275inj=r({imports:[V,j]})})(),e})();export{tt as VisualizationModule};
