import{c as R,la as $}from"./chunk-QO5S5KE6.js";import{$c as I,bd as j,sc as b}from"./chunk-HLN442RE.js";import{G as l,N as h,Na as a,Ra as g,Ta as s,Tc as D,V as M,Wa as C,X as v,Yc as c,cb as S,d as f,da as n,ha as x,ja as r,oc as y}from"./chunk-J6V2RHPS.js";import"./chunk-CLKATWRW.js";import{a as m,b as u}from"./chunk-Y6TIJFHU.js";function J(e,t){if(e&1&&C(0,"app-html-editor",1),e&2){let d=S();s("dataSource",d.dataSource)("editable",d.editable)}}var w=(()=>{let t=class{constructor(o,i,p){this.contextService=o,this.activatedRoute=i,this.userService=p,this.appContext={},this.componentDestroyed$=new f}ngOnInit(){this.activatedRoute.params.pipe(M(o=>this.setContext(o)),l(()=>this.userService.isDatabaseAdmin(this.appContext).pipe(h())),v(this.componentDestroyed$)).subscribe(o=>{this.editable=o,this.dataSource={getHtmlFilePath:`/api/Maintenance/${this.appContext.server}/${this.appContext.cluster}`,postHtmlFilePath:`/api/Maintenance/${this.appContext.server}/${this.appContext.cluster}`}})}setContext(o){return this.appContext=u(m({},o),{clusterMode:b.Maintenance}),this.contextService.setContext(this.appContext)}ngOnDestroy(){this.componentDestroyed$.next(!0),this.componentDestroyed$.complete()}},e=t;return(()=>{t.\u0275fac=function(i){return new(i||t)(a(j),a(D),a(I))}})(),(()=>{t.\u0275cmp=x({type:t,selectors:[["app-maintenance"]],decls:1,vars:1,consts:[[3,"dataSource","editable",4,"ngIf"],[3,"dataSource","editable"]],template:function(i,p){i&1&&g(0,J,1,2,"app-html-editor",0),i&2&&s("ngIf",p.dataSource)},dependencies:[y,R]})})(),e})();var H=[{path:"",component:w},{path:"**",redirectTo:"",pathMatch:"full"}],F=(()=>{let t=class{},e=t;return(()=>{t.\u0275fac=function(i){return new(i||t)}})(),(()=>{t.\u0275mod=r({type:t})})(),(()=>{t.\u0275inj=n({imports:[c.forChild(H),c]})})(),e})();var tt=(()=>{let t=class{},e=t;return(()=>{t.\u0275fac=function(i){return new(i||t)}})(),(()=>{t.\u0275mod=r({type:t})})(),(()=>{t.\u0275inj=n({imports:[F,$]})})(),e})();export{tt as MaintenanceModule};
