import{b as d,c as H}from"./chunk-4MUEJ55U.js";import{D as v,E as x,V as g,W as B}from"./chunk-INYFUTXB.js";import{Ga as S,Ha as R,Kg as h,Lg as W,Wj as f,Xj as k,a as p,b as E}from"./chunk-2GUKPKKM.js";import{a as i,b as w,g as m,h as G}from"./chunk-CUIDVWNH.js";import{Da as u,La as A}from"./chunk-5YPL7P3G.js";import{b as o,c as U}from"./chunk-IBUDDWQO.js";import{J as c,Sd as T,ka as a,oa as O,ta as l,x as r,ya as s}from"./chunk-XJKQ67XR.js";import{e as b}from"./chunk-SZAW6ZBW.js";var $,J=b(()=>{O();E();w();W();R();H();T();k();A();U();x();B();G();$=(()=>{class n extends p{constructor(e,t,P,y,C,I,j){super(j,I),this.assetService=e,this.messageService=t,this.translator=P,this.serverInformationService=y,this.settingsCache=new d(C)}getSettings(e=!1){return this.settingsCache.getCache(e,this.getSettingsInternal()).pipe(r(t=>new S(JSON.parse(JSON.stringify(t)))))}setSettings(e){return this.settingsCache.invalidateCache(),this.assetService.SavePamGlobalSettings(e).pipe(a(t=>this.handleSaveApiResult(t)),a(t=>this.sendToastOnSuccess(t)),r(t=>t.result===i.Success))}getUsagePoliciesSettings(){return this.assetService.GetPamUsagePolicies().pipe(c(e=>e.result===i.Success),r(e=>this.returnWhenSuccessful(e,()=>new h(e.data))))}setUsagePoliciesSettings(e){return this.settingsCache.invalidateCache(),this.assetService.SavePamUsagePolicies(e).pipe(a(t=>this.handleSaveApiResult(t)),a(t=>this.updateServerInfoOnSuccess(t)),a(t=>this.sendToastOnSuccess(t)),r(t=>t.result===i.Success))}getSettingsInternal(){return this.assetService.GetPamGlobalSettings().pipe(c(e=>e.result===i.Success),r(e=>this.returnWhenSuccessful(e,()=>new S(e.data))))}updateServerInfoOnSuccess(e){e.result===i.Success&&this.serverInformationService.update()}sendToastOnSuccess(e){e.result===i.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translator.translate("lblSavedSuccessfully"),detail:this.translator.translate("TheDataHasBeenSuccessfullySaved")})}static{this.\u0275fac=function(t){return new(t||n)(s(f),s(u),s(o),s(v),s(g),s(m),s(o))}}static{this.\u0275prov=l({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})()});export{$ as a,J as b};
