import {Q,o}from'./chunk-ByVgdL4M.js';import {I as Ie,G as Ge$1}from'./chunk-Ctuz9302.js';import {J,a6 as pi,a5 as fh,ae as x,h4 as ks,dt as Mr,U as RN,i as S,aV as ut,aw as fa,c as tS,b2 as v,aB as ce,bE as ff,bI,a8 as x$1,ai as o$1,w as wo,bc as I$1,f as QT,X as _z,h5 as h4,h6 as Ms,dO as W1,e1 as j1,d3 as Rg,bg as lt,b_ as iH,bh as at,c0 as XN,bi as et,c1 as Tc,u as R,bp as QC,br as ZC,bu as dy,bk as i_,a0 as ks$1,e5 as Gu,z as vM,a3 as Py,a2 as Uu,e6 as zu,a1 as Ny,bl as dv,bB as oT,co as E_,bz as f_,a4 as Sy,A as Iw,cg as J_,F as EM,bq as uv,bC as sT,bm as Bp,bo as $p,bn as Z_}from'./main-WUGO6e7n.js';import {a as ae,j as je}from'./chunk-DlWKzM8X.js';import {I,N}from'./chunk-BIZgrEE0.js';import {L,k}from'./chunk-D2CgDHjp.js';import {l,h as h$1}from'./chunk-D-s0qb_B.js';import'./chunk-c1RFL71F.js';import'./chunk-BadIw3lc.js';import'./chunk-4Rs3CU3G.js';import'./chunk-DATJc-cZ.js';import'./chunk-22oEX_gu.js';function Ae(n,_e){if(n&1){let i=i_();ks$1(0,"dvl-page-wrapper-v2",1),Gu(1,2),ks$1(2,"dvl-button",3),vM(3,"translate"),Py("onClick",function(){Bp(i);let t=f_();return $p(t.submitForm())}),Uu(),zu(),ks$1(4,"form",4,0),Ny(6,"p-message",5),vM(7,"translate"),Ny(8,"sd-message-summary",6),ks$1(9,"div",7)(10,"dvl-checkbox",8),vM(11,"translate"),dv("ngModelChange",function(t){Bp(i);let d=f_();return Z_(d.configuration.isApprovalSecureMessageEnabled,t)||(d.configuration.isApprovalSecureMessageEnabled=t),$p(t)}),Uu(),oT(),Uu(),ks$1(12,"div",7)(13,"dvl-checkbox",9),vM(14,"translate"),vM(15,"translate"),dv("ngModelChange",function(t){Bp(i);let d=f_();return Z_(d.configuration.isApprovalEmailEnabled,t)||(d.configuration.isApprovalEmailEnabled=t),$p(t)}),Uu(),oT(),Uu()()();}if(n&2){let i=E_(5),e=f_();Sy("titlePage",e.titleHeader),Iw(2),Sy("dvlTooltip",J_(EM(3,21,"lblSave")))("disableWithoutAdminPermission",e.AdministrativePermission.ServerSettingsApprovalsEdit)("disabled",!e.isDirty),Iw(2),Sy("disableWithoutAdminPermission",e.AdministrativePermission.ServerSettingsAdvancedEdit)("readonlyContainer",true),Iw(2),Sy("text",J_(EM(7,23,"lblApprovalInformation"))),Iw(2),Sy("messages",e.errorSummaryMessages),Iw(2),Sy("label",J_(EM(11,25,"lblSecureMessage")))("sdAddToForm",i),uv("ngModel",e.configuration.isApprovalSecureMessageEnabled),sT(),Iw(3),Sy("label",J_(EM(14,27,"lblApprovalEmailWithApprovalLink")))("pTooltip",J_(EM(15,29,"lblApprovalEmailMustBeEnabled")))("disabled",!e.configuration.isEmailEnabled)("sdAddToForm",i),uv("ngModel",e.configuration.isApprovalEmailEnabled),sT();}}var Ge,Se=J(()=>{Q();pi();fh();x();Ie();ks();I();Mr();RN();S();ut();l();fa();L();tS();ae();v();ks();Mr();ut();Ge=(()=>{class n extends o{constructor(i,e){super(),this.configurationService=i,this.longOperationIndicatorService=e,this.titleHeader=[{title:"lblAdministration"},{title:"lblServerSettings",link:"/administration/server-settings"},{title:"lblApproval"}],this.AdministrativePermission=ce,this.tabTitle="lblApproval";}ngOnInit(){super.ngOnInit(),this.getEmailConfiguration();}getEmailConfiguration(){this.longOperationIndicatorService.showIndicator(),this.configurationService.getApprovalConfiguration().pipe(ff(this.destroyed$),bI(()=>this.longOperationIndicatorService.hideIndicator())).subscribe(i=>this.configuration=i);}save(){return new x$1(i=>{this.configurationService.updateApproval(this.configuration).pipe(ff(this.destroyed$)).subscribe(e=>{e.result===o$1.Success?(this.getEmailConfiguration(),i.next(!0),i.complete()):(this.showError(this.translatorService.translate("lblApprovalSaveError")),i.next(!1),i.complete());});})}static{this.\u0275fac=function(e){return new(e||n)(wo(je),wo(I$1))};}static{this.\u0275cmp=QT({type:n,selectors:[["dvls-approval-configuration"]],features:[dy],decls:1,vars:1,consts:[["currentForm","ngForm"],[3,"titlePage"],["header-right",""],["variant","icon","showDelay","500","tooltipPosition","left","icon","di dvl-icon-save",3,"onClick","disableWithoutAdminPermission","disabled","dvlTooltip"],["autocomplete","off","novalidate","",3,"disableWithoutAdminPermission","readonlyContainer"],["severity","info",3,"text"],[3,"messages"],[1,"form-group"],["binary","true","name","enableSecureMessage",3,"ngModelChange","label","sdAddToForm","ngModel"],["binary","true","name","enableEmailDisabled",3,"ngModelChange","label","disabled","sdAddToForm","pTooltip","ngModel"]],template:function(e,t){e&1&&QC(0,Ae,16,31,"dvl-page-wrapper-v2",1),e&2&&ZC(t.configuration?0:-1);},dependencies:[Ge$1,_z,h4,Ms,N,W1,j1,Rg,lt,iH,at,XN,et,Tc,h$1,k,R],encapsulation:2,changeDetection:1});}}return n})();});Se();export{Ge as ApprovalConfigurationComponent};