import{a as v,b as T}from"./chunk-DJ546A6R.js";import{D as m,E as I}from"./chunk-I7GW4F3B.js";import{c as u,d as N}from"./chunk-RWCAFOHA.js";import{Gk as S,Hk as P}from"./chunk-BPZQKZKD.js";import{Da as h,La as j}from"./chunk-5E3JCGAH.js";import{b as f,c as b}from"./chunk-YBNTOQCK.js";import{Sa as y,be as l,ka as r,ta as n,x as s,xa as a,ya as o}from"./chunk-WL5U2YIT.js";import{e as g}from"./chunk-ADEKKGI2.js";var E,A=g(()=>{l();P();y();T();l();b();N();I();j();E=(()=>{let i=class i extends v{constructor(e,t,p,d){super(e,t,p),this.messageService=d,this.assetService=o(S)}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")})}};i.\u0275fac=function(t){return new(t||i)(a(f),a(u),a(m),a(h))},i.\u0275prov=n({token:i,factory:i.\u0275fac,providedIn:"root"});let c=i;return c})()});export{E as a,A as b};
