import{a as l,b as B}from"./chunk-7PFZXDIW.js";import{a as E,b as D}from"./chunk-DJ546A6R.js";import{D as g,E as x}from"./chunk-I7GW4F3B.js";import{c as p,d as k}from"./chunk-RWCAFOHA.js";import{Gk as d,Hk as w,of as v,pf as R}from"./chunk-BPZQKZKD.js";import{a as o,b}from"./chunk-6B6CBPYV.js";import{Da as S,La as I}from"./chunk-5E3JCGAH.js";import{b as f,c as A}from"./chunk-YBNTOQCK.js";import{O as c,Sa as T,be as j,ka as n,ta as h,x as a,xa as r}from"./chunk-WL5U2YIT.js";import{e as C}from"./chunk-ADEKKGI2.js";var P,G=C(()=>{T();b();R();B();D();j();A();k();x();w();I();P=(()=>{let i=class i extends E{constructor(t,e,s,u,y){super(t,e,s),this.assetServices=u,this.messageService=y}getEmailConfiguration(t=!1){let e=this.assetServices.GetEmailConfiguration().pipe(c(s=>this.handleCatchError(s,l)),n(s=>this.handleGetApiResult(s)),a(s=>this.isSuccessful(s)?[new v(s.data)]:[]));return this.getCache(t,e).pipe(a(s=>s[0]))}saveEmailConfiguration(t){return this.assetServices.SaveEmailConfiguration(t).pipe(c(e=>this.handleCatchError(e,l)),n(e=>this.sendToastOnSuccess(e)),n(()=>this.invalidateCache()),a(e=>this.handleSaveApiResult(e)))}testEmailConfiguration(t){return this.assetServices.TestEmailConfiguration(t).pipe(c(e=>this.handleCatchError(e,l)),a(e=>this.sendToastAfterTest(e)))}sendToastOnSuccess(t){t.result===o.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("lblSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")})}sendToastAfterTest(t){let e=t.result===o.Success?"success":"error",s=t.result===o.Success?"EmailSent":"ErrorSendingEmail",u=t.result===o.Success?"":t.errorMessage;this.messageService.add({key:"globalToast",severity:e,summary:this.translatorService.translate(s),detail:u})}};i.\u0275fac=function(e){return new(e||i)(r(f),r(p),r(g),r(d),r(S))},i.\u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"});let m=i;return m})()});export{P as a,G as b};
