import{Wj as l,Xj as b,s as h,t as K}from"./chunk-GDJMZZ4C.js";import{g as p,h as y}from"./chunk-V3J5YJ3L.js";import{Da as n,La as f}from"./chunk-2XIOYYFS.js";import{b as u,c as v}from"./chunk-YTY7HHO3.js";import{Rd as S,ka as r,na as A,sa as o,x as a,xa as c}from"./chunk-4HFZZ7HS.js";import{e as m}from"./chunk-SZAW6ZBW.js";var E,T=m(()=>{A();K();S();v();y();b();f();E=(()=>{class i extends h{constructor(e,t,s,d){super(e,t),this.assetService=s,this.messageService=d}generateApiKey(){return this.assetService.GenerateApiKey().pipe(r(e=>this.handleGetApiResult(e)),r(e=>this.executeBasedOnResult(e,()=>this.showToast("success","lblSuccess","YourApiKeyWasGenerated"),()=>this.showToast("error","lblError","AnUnexpectedErrorOccuredContactYourAdmin"))),a(e=>this.returnWhenSuccessful(e,()=>e.data)))}deleteApiKey(e){return this.assetService.DeleteApiKey(e).pipe(r(t=>this.handleGetApiResult(t)),r(t=>this.executeBasedOnResult(t,()=>this.showToast("success","lblSuccess","YourApiKeyWasDeleted"),()=>this.showToast("error","lblError","AnUnexpectedErrorOccuredContactYourAdmin"))),a(t=>this.returnWhenSuccessful(t,()=>!0)))}updateApiKey(e,t){return this.assetService.UpdateApiKey(e,t).pipe(r(s=>this.handleGetApiResult(s)),a(s=>this.returnWhenSuccessful(s,()=>s)))}listApiKeys(){return this.assetService.ListApiKeys().pipe(r(e=>this.handleGetApiResult(e)),a(e=>this.returnWhenSuccessful(e,()=>e.data)))}showToast(e,t,s){this.messageService.add({key:"globalToast",severity:e,summary:this.translatorService.translate(t),detail:this.translatorService.translate(s)})}static{this.\u0275fac=function(t){return new(t||i)(c(u),c(p),c(l),c(n))}}static{this.\u0275prov=o({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{E as a,T as b};
