import{g as h}from"./chunk-QO3I7KTG.js";import{e as p}from"./chunk-VA2ZAQUO.js";import{G as i,_ as a,ea as c,g as n,ja as o,p as s}from"./chunk-F5OOQG77.js";var j=(()=>{class r{constructor(t,e){this.http=t,this.apiService=e,this.constants={},this.constantsLoadedSubject=new n(!1),this.fetchConstants().subscribe()}fetchConstants(){return this.constantsLoadedSubject.value?s(this.constants):this.apiService.portalProperties().pipe(a(t=>{Object.keys(t.body.portalProperties.componentsProperties).forEach(e=>{this.constants[e]=t.body.portalProperties.componentsProperties[e]}),this.constantsLoadedSubject.next(!0)}),i(this.handleError("fetchConstants")))}getConstant(t){return this.constants[t]}areConstantsLoaded(){return this.constantsLoadedSubject.asObservable()}clearConstants(){this.constants={},this.constantsLoadedSubject.next(!1)}handleError(t="operation",e){return d=>(console.error(`${t} failed: ${d.message}`),s(e))}static{this.\u0275fac=function(e){return new(e||r)(o(p),o(h))}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{j as a};
