import{d as v}from"./chunk-MANB3PJC.js";import{F as p,sc as h,tc as M,uc as n}from"./chunk-CBXQYRPM.js";import{Bc as d,Ec as f,ca as o,da as u,fa as i,la as l}from"./chunk-LVXYIJUI.js";var I=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=l({type:e})}static{this.\u0275inj=u({imports:[d]})}}return e})();var g=(()=>{class e{constructor(t){this.restService=t}getModulesForBussinesUnit(t){let r=new f;return r=r.append("businessUnitID",t),this.restService.get(p.MODULES,r)}static{this.\u0275fac=function(r){return new(r||e)(i(v))}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var j=(()=>{class e{constructor(t){this.modulesService=t}getModulesForBussinesUnit(t){return this.modulesService.getModulesForBussinesUnit(t)}static{this.\u0275fac=function(r){return new(r||e)(i(g))}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var m=(()=>{class e{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>h.getCurrentDateAsNumber()}clearModulesList(){this.modulesList=null}static{this.\u0275fac=function(r){return new(r||e)(i(j))}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var S=(()=>{class e{constructor(t){this.modulesManager=t}resolve(){return this.modulesManager.loadModules(M.getBusinessUnit().id)}static{this.\u0275fac=function(r){return new(r||e)(i(m))}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{m as a,S as b,I as c};
