import{b as d,c as H}from"./chunk-F2AVZVRZ.js";import{B as v,C as x,P as g,Q as B}from"./chunk-ANSWGJBN.js";import{Aj as f,Bj as k,Ua as S,Va as R,s as p,t as E,ug as h,vg as W}from"./chunk-XBRJZCAD.js";import{a as i,b as w,g as m,h as G}from"./chunk-AIHAZUSZ.js";import{j as u,s as A}from"./chunk-KADRYNDC.js";import{b as o,c as U}from"./chunk-IOINCEV4.js";import{Gd as T,J as c,ka as a,na as O,sa as l,x as r,xa as s}from"./chunk-JSJB5BKT.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("gbSavedSuccessfully"),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};
