import{d as h}from"./chunk-7EAWKBIV.js";import{$b as n,I as p,Zb as M,_b as v}from"./chunk-ATD4AEXQ.js";import{Kc as d,Qc as f,Ua as l,ca as o,da as u,fa as i}from"./chunk-BXH3QC5E.js";var F=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=l({type:e});static \u0275inj=u({imports:[d]})}return e})();var g=(()=>{class e{restService;constructor(t){this.restService=t}getModulesForBussinesUnit(t){let r=new f;return r=r.append("businessUnitID",t),this.restService.get(p.MODULES,r)}static \u0275fac=function(r){return new(r||e)(i(h))};static \u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var j=(()=>{class e{modulesService;constructor(t){this.modulesService=t}getModulesForBussinesUnit(t){return this.modulesService.getModulesForBussinesUnit(t)}static \u0275fac=function(r){return new(r||e)(i(g))};static \u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var m=(()=>{class e{modulesFacade;modulesList;constructor(t){this.modulesFacade=t}loadModules(t){return n.isNullOrUndefined(this.modulesList)?new Promise((r,c)=>{this.modulesFacade.getModulesForBussinesUnit(t).subscribe({next:s=>{this.modulesList=s,r(s)},error:s=>{c(s)}})}):this.modulesList}hasModule(t){if(n.isNullOrUndefined(this.modulesList))return!1;let r=this.modulesList.find(c=>c.name===t);return!n.isNullOrUndefined(r)&&r.expireDate>M.getCurrentDateAsNumber()}clearModulesList(){this.modulesList=null}static \u0275fac=function(r){return new(r||e)(i(j))};static \u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var b=(()=>{class e{modulesManager;constructor(t){this.modulesManager=t}resolve(){return this.modulesManager.loadModules(v.getBusinessUnit().id)}static \u0275fac=function(r){return new(r||e)(i(m))};static \u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{m as a,b,F as c};
