import{a as G,b as E}from"./chunk-VOLZZ3JP.js";import{T as b,U as R,V as y,W as B}from"./chunk-INYFUTXB.js";import{$a as $,Qf as c,Rf as l,Ua as v,Va as k,Wa as I,Wj as L,Xa as F,Xj as M,_a as f}from"./chunk-2GUKPKKM.js";import{g as P,h as A}from"./chunk-CUIDVWNH.js";import{b as p,c as D}from"./chunk-IBUDDWQO.js";import{J as S,Sd as x,ia as a,ka as g,oa as j,ta as h,x as o,ya as m}from"./chunk-XJKQ67XR.js";import{e as C}from"./chunk-SZAW6ZBW.js";var s,U=C(()=>{s=function(i){return i[i.Custom=0]="Custom",i[i.Inherited=1]="Inherited",i[i.None=2]="None",i[i.Default=3]="Default",i[i.List=4]="List",i[i.SystemSettings=5]="SystemSettings",i}(s||{})});var V,H=C(()=>{$();j();E();k();F();l();U();x();D();A();B();R();M();V=(()=>{class i extends G{constructor(t,r,n,u,e){super(t,r,n),this.dataSourceSettingsService=u,this.assetServices=e}getPasswordConfigurations(t=!1){return this.getCache(t,this.getPasswordConfigurationsInternal())}savePasswordConfiguration(t){return this.assetServices.SavePasswordConfiguration(t)}updatePasswordConfiguration(t){return this.assetServices.UpdatePasswordConfiguration(t)}deletePasswordConfiguration(t){return this.assetServices.DeletePasswordConfiguration(t)}getConnectionPasswordConfiguration(t,r){return this.assetServices.GetConnectionPasswordConfiguration(t,r).pipe(g(n=>this.handleGetApiResult(n)),S(n=>!!n))}defaultPasswordConfiguration(){return new f({upperCaseMin:1,digitsMin:1,underlineMin:1,specialCharMin:1,highAnsiMin:1,lowerCaseMin:1,minusMin:1,spaceMin:1,bracketsMin:1,customCharactersMin:1})}getFromPasswordValidationViewModel$(t){return this.getPasswordConfigurations().pipe(a(this.destroyed$),o(r=>{if(t.templateType===s.List&&c.isGuid(t.templateId))return r.find(e=>e.id===t.templateId);let n=this.dataSourceSettingsService.dataSourceSettingsSnapshot.defaultPasswordTemplate;if(t.templateType===s.SystemSettings&&c.isGuid(n))return r.find(e=>e.id===n);let u=new v({id:t.templateId,minimumLengthCount:t.minimumLength,minimumLowerCaseCount:t.minimumLowercase,minimumUpperCaseCount:t.minimumUppercase,minimumNumericCount:t.minimumNumeric,minimumSymbolCount:t.minimumSymbol});return new f({id:t.templateId,complexity:u,mode:I.Default,length:t.minimumLength,includeLowerCase:t.isMinimumLowercase,lowerCaseMin:t.minimumLowercase,includeUpperCase:t.isMinimumUppercase,upperCaseMin:t.minimumUppercase,includeDigits:t.isMinimumNumeric,digitsMin:t.minimumNumeric,includeSpecialChar:t.isMinimumSymbol,specialCharMin:t.minimumSymbol})}))}fillPasswordValidationViewModelFromTemplate(t){let r=null;t.templateType===s.List&&c.isGuid(t.templateId)&&(r=t.templateId);let n=this.dataSourceSettingsService.dataSourceSettingsSnapshot.defaultPasswordTemplate;t.templateType===s.SystemSettings&&c.isGuid(n)&&(r=n),r&&this.getPasswordConfigurations().pipe(a(this.destroyed$)).subscribe(u=>{let e=u?.find(N=>N.id===r);e&&(t.isMinimumLength=e.length>0,t.minimumLength=e.length,t.isMinimumLowercase=e.lowerCaseMin>0,t.minimumLowercase=e.lowerCaseMin,t.isMinimumUppercase=e.upperCaseMin>0,t.minimumUppercase=e.upperCaseMin,t.isMinimumNumeric=e.digitsMin>0,t.minimumNumeric=e.digitsMin,t.isMinimumSymbol=e.specialCharMin>0,t.minimumSymbol=e.specialCharMin)})}getPasswordConfigurationsInternal(){return this.assetServices.GetPasswordConfigurations().pipe(g(t=>this.handleGetApiResult(t)),o(t=>this.returnWhenSuccessful(t,()=>t.data.map(r=>new f(r)))))}static{this.\u0275fac=function(r){return new(r||i)(m(p),m(P),m(y),m(b),m(L))}}static{this.\u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{s as a,U as b,V as c,H as d};
