import{b as y,c as J}from"./chunk-YVVVIZWY.js";import{D as d,E as H}from"./chunk-I7GW4F3B.js";import{a as h,b as R,m as g,n as B}from"./chunk-SM7EQ7ST.js";import{c as p,d as E}from"./chunk-RWCAFOHA.js";import{Gk as v,Hk as x,Ma as l,Na as W,oh as f,ph as k}from"./chunk-BPZQKZKD.js";import{a as r,b as U}from"./chunk-6B6CBPYV.js";import{Da as m,La as G}from"./chunk-5E3JCGAH.js";import{b as S,c as w}from"./chunk-YBNTOQCK.js";import{J as o,Sa as T,be as A,ka as n,ta as u,x as a,xa as s}from"./chunk-WL5U2YIT.js";import{e as O}from"./chunk-ADEKKGI2.js";var _,N=O(()=>{T();R();U();k();W();J();A();x();G();w();B();H();E();_=(()=>{let i=class i extends h{constructor(e,t,C,I,P,j,b){super(b,j),this.assetService=e,this.messageService=t,this.translator=C,this.serverInformationService=I,this.settingsCache=new y(P)}getSettings(e=!1){return this.settingsCache.getCache(e,this.getSettingsInternal()).pipe(a(t=>new l(JSON.parse(JSON.stringify(t)))))}setSettings(e){return this.settingsCache.invalidateCache(),this.assetService.SavePamGlobalSettings(e).pipe(n(t=>this.handleSaveApiResult(t)),n(t=>this.sendToastOnSuccess(t)),a(t=>t.result===r.Success))}getUsagePoliciesSettings(){return this.assetService.GetPamUsagePolicies().pipe(o(e=>e.result===r.Success),a(e=>this.returnWhenSuccessful(e,()=>new f(e.data))))}setUsagePoliciesSettings(e){return this.settingsCache.invalidateCache(),this.assetService.SavePamUsagePolicies(e).pipe(n(t=>this.handleSaveApiResult(t)),n(t=>this.updateServerInfoOnSuccess(t)),n(t=>this.sendToastOnSuccess(t)),a(t=>t.result===r.Success))}getSettingsInternal(){return this.assetService.GetPamGlobalSettings().pipe(o(e=>e.result===r.Success),a(e=>this.returnWhenSuccessful(e,()=>new l(e.data))))}updateServerInfoOnSuccess(e){e.result===r.Success&&this.serverInformationService.update()}sendToastOnSuccess(e){e.result===r.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translator.translate("lblSavedSuccessfully"),detail:this.translator.translate("TheDataHasBeenSuccessfullySaved")})}};i.\u0275fac=function(t){return new(t||i)(s(v),s(m),s(S),s(g),s(d),s(p),s(S))},i.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"});let c=i;return c})()});export{_ as a,N as b};
