import{a as d,b,g as f,h as z}from"./chunk-EQERU65S.js";import{j as l,s as p}from"./chunk-KADRYNDC.js";import{b as h,c as y}from"./chunk-IOINCEV4.js";import{Gd as g,J as c,g as n,h as o,ia as r,ka as a,ma as v,na as S,sa as u,xa as s}from"./chunk-JSJB5BKT.js";import{e as m}from"./chunk-SZAW6ZBW.js";var R,A=m(()=>{v();S();b();g();p();y();z();R=(()=>{class i{constructor(e,t,C){this.messageService=e,this.translatorService=t,this.authenticationConfigurationService=C,this.destroyed$=new n,this.azureConfiguration=new o(new d),this.azureConfiguration$=this.azureConfiguration.asObservable()}ngOnDestroy(){this.destroyed$.next()}fetchAzureConfiguration(){this.authenticationConfigurationService.getAzureAuthenticationConfiguration().pipe(r(this.destroyed$),a(e=>e.useClientIdForCache=e.usersRolesCacheClientId?.length>0)).subscribe(e=>this.azureConfiguration.next(e))}save(e){return e.useClientIdForCache||(e.usersRolesCacheClientId=null),this.authenticationConfigurationService.saveAzureAuthenticationConfiguration(e).pipe(r(this.destroyed$),c(t=>t),a(()=>this.fetchAzureConfiguration()))}testConnection(e){e.useClientIdForCache||(e.usersRolesCacheClientId=null),this.authenticationConfigurationService.testAzureSync(e).pipe(r(this.destroyed$)).subscribe(t=>{t?this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("Success"),detail:this.translatorService.translate("ConnectedSuccessfully")}):this.messageService.add({key:"globalToast",severity:"error",summary:this.translatorService.translate("Failed"),detail:this.translatorService.translate("ConnectionFailed")})})}static{this.\u0275fac=function(t){return new(t||i)(s(l),s(h),s(f))}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{R as a,A as b};
