import{a as v,b as I}from"./chunk-VOLZZ3JP.js";import{V as S,W as j}from"./chunk-INYFUTXB.js";import{Wj as u,Xj as P}from"./chunk-2GUKPKKM.js";import{g as h,h as N}from"./chunk-CUIDVWNH.js";import{Da as f,La as y}from"./chunk-5YPL7P3G.js";import{b as l,c as b}from"./chunk-IBUDDWQO.js";import{Sd as o,ka as r,oa as g,ta as c,x as s,ya as a,za as n}from"./chunk-XJKQ67XR.js";import{e as d}from"./chunk-SZAW6ZBW.js";var D,T=d(()=>{o();P();g();I();o();b();N();j();y();D=(()=>{class i extends v{constructor(e,t,m,p){super(e,t,m),this.messageService=p,this.assetService=n(u)}hasNotificationPreferences(){return this.getNotificationPreferences().pipe(s(e=>(e.notifications||[]).length>0))}getNotificationPreferences(e=!1){return this.getCache(e,this.getNotificationPreferencesInternal()).pipe(s(t=>t[0]))}saveNotificationPreferences(e){return this.assetService.SaveNotificationPreferences(e).pipe(r(t=>this.handleSaveApiResult(t)),r(t=>this.notifyWhenSuccessful(t)),r(()=>this.invalidateCache()),s(t=>this.isSuccessful(t)))}getNotificationPreferencesInternal(){return this.assetService.GetNotificationPreferences().pipe(r(e=>this.handleGetApiResult(e)),s(e=>this.returnWhenSuccessful(e,()=>[e.data])))}notifyWhenSuccessful(e){this.isSuccessful(e)?this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("lblSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")}):this.messageService.add({key:"globalToast",severity:"error",summary:this.translatorService.translate("UnableToSave"),detail:this.translatorService.translate("lbl")})}static{this.\u0275fac=function(t){return new(t||i)(a(l),a(h),a(S),a(f))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{D as a,T as b};
