import{B as b,C,P as A,Q as k}from"./chunk-ANSWGJBN.js";import{Aj as L,Bj as R,s as v,t as y}from"./chunk-XBRJZCAD.js";import{g as d,h as j}from"./chunk-AIHAZUSZ.js";import{a as x,b as S,c as F}from"./chunk-IOINCEV4.js";import{Gd as m,Rb as l,ia as f,ka as i,na as P,sa as h,x as s,xa as a}from"./chunk-JSJB5BKT.js";import{e as p,h as U}from"./chunk-SZAW6ZBW.js";var g,I=p(()=>{m();g=(()=>{class r{transform(e,t){if(t)return e;let n=e.indexOf("-"),o=e.length,c=e.substring(0,n);for(let u=n;u<o;u++)e[u]==="-"?c+="-":c+="X";return c}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275pipe=l({name:"obfuscateSerial",type:r,pure:!0})}}return r})()});var D,$,G=p(()=>{P();y();D=U(x());I();m();R();k();C();j();F();$=(()=>{class r extends v{constructor(e,t,n,o,c){super(c,o),this.assetServices=e,this.currentUserService=t,this.serverInfoService=n,this.subscribeToServerInformationChange()}getLicenses(){return this.assetServices.GetLicenses().pipe(i(e=>this.handleGetApiResult(e)),s(e=>this.returnWhenSuccessful(e,()=>e.data)))}getLicenseUsers(e){return this.assetServices.GetLicenseUsers(e).pipe(i(t=>this.handleGetApiResult(t)),s(t=>this.returnWhenSuccessful(t,()=>t.data)))}obfuscateSerial(e){return new g().transform(e)}getProductExpiration(e){if(e.endDate===null)return"";let t=(0,D.default)(e.endDate).format(this.currentUserService.displayDateFormat),n=e.isSubscription||e.isModuleOnly?"lblValidUntilX":"lblFreeUpgradeUntilX";return this.translatorService.translate(n,t)}getProductName(e){return e.productDescription}getExpirationColor(e){return e.isExpired?"#FF1A1A":e.expiringSoon?"#FFDA23":"inherit"}saveLicenses(e){return this.assetServices.SaveLicenses(e).pipe(i(t=>this.handleSaveApiResult(t)),s(t=>this.isSuccessful(t)))}deleteLicense(e){return this.assetServices.DeleteLicense(e).pipe(i(t=>this.handleDeleteApiResult(t)),s(t=>this.isSuccessful(t)),i(t=>this.reloadAccessInformation(t)))}deleteLicensePackage(e){return this.assetServices.DeleteLicensePackage(e).pipe(i(t=>this.handleDeleteApiResult(t)),s(t=>this.isSuccessful(t)),i(t=>this.reloadAccessInformation(t)))}decodeLicense(e){return this.assetServices.DecodeLicense(e)}refreshLicense(e){return this.assetServices.RefreshLicense(e)}importLicense(e){return this.assetServices.ImportLicense(e)}saveLicenseUsers(e){return this.assetServices.SaveLicenseAssignments(e).pipe(i(t=>this.handleSaveApiResult(t)),s(t=>this.isSuccessful(t)))}reloadAccessInformation(e){e&&this.serverInfoService.update().then(()=>this.currentUserService.refreshAccessInformations())}subscribeToServerInformationChange(){this.serverInfoService.serverInformationChange.pipe(f(this.destroyed$)).subscribe(e=>{this.hasValidPamLicense=e.hasValidPamLicense})}static{this.\u0275fac=function(t){return new(t||r)(a(L),a(A),a(b),a(d),a(S))}}static{this.\u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})()});export{g as a,I as b,$ as c,G as d};
