Viewing File: /usr/local/cpanel/base/frontend/jupiter/account-preferences/main.bd1855b2b402ac60.js

"use strict";(self.webpackChunkaccount_preferences=self.webpackChunkaccount_preferences||[]).push([[792],{1366:(k,B,c)=>{var T=c(345),o=c(5737),g=c(6381),v=c(7410),x=function(n){return n.ChangeLanguage="change_language",n.ChangePassword="change_password",n.ConsentPrivacy="consent_privacy",n.ContactInformation="contact_information",n.ContactPreferences="contact_preferences",n.PushNotifications="push_notifications",n.SystemNotifications="system_notifications",n}(x||{}),t=c(3953);class p{}var h=c(177),S=c(1413),F=c(6977),C=c(6697),b=c(980),a=c(9417),I=c(6354),f=c(3280),u=c(6802),D=c(2584),w=c(3658);let V=(()=>{class n{constructor(e){this.http=e}get(){return this.http.post(new f.V({namespace:"Personalization",method:"get",arguments:[new u.e("names",["common-alertList"])],config:{json:!0}})).pipe((0,I.T)(e=>{const i=e.data.personalization["common-alertList"];return i.success=(0,D.G)(i.success),i.value=JSON.parse(i.value),e}))}set(e){return this.http.post(new f.V({namespace:"Personalization",method:"set",arguments:[new u.e("personalization",e)],config:{json:!0}})).pipe((0,I.T)(i=>i))}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(w.dF))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),X=(()=>{class n{constructor(e,i,s,r,d){this.locale=e,this.analyticsBuilder=i,this.personalizationService=s,this.page=r,this.el=d,this.notificationEvent=new t.bkB,this.createBtn={id:"saveConsentBtn",type:"submit",buttonState:o.w.enabled},this.stop$=new S.B}ngOnInit(){this.consentAndPrivacyForm=this.analyticsBuilder.group({analyticsCheckControl:[this.getAnalyticsConsent(this.page?.analytics_info?.analytics)]}),this.consentAndPrivacyForm.valueChanges.pipe((0,F.Q)(this.stop$)).subscribe(()=>{this.createBtn.buttonState=this.consentAndPrivacyForm.valid?o.w.enabled:o.w.disabled})}getAnalyticsConsent(e){return"on"===e}saveAnalyticsPreferences(){this.createBtn.buttonState=o.w.loading;const e={analytics:this.consentAndPrivacyForm.controls.analyticsCheckControl.value?"on":"off"};this.personalizationService.set(e).pipe((0,C.s)(1),(0,b.j)(()=>this.createBtn.buttonState=o.w.enabled)).subscribe({next:i=>{if(JSON.parse(i?.data?.personalization.analytics?.success)){"on"==e?.analytics?this.triggerConsentSavedEvent(!0):this.triggerConsentSavedEvent(),this.position=JSON.parse(this.page?.systemNotification||null)?.position;const r=this.locale.maketext("Successfully updated the Consent and Privacy Preferences.");this.notificationEvent.emit({notificationMessage:r,notificationType:o._n.success})}else this.handleError()},error:i=>this.handleError()})}handleError(){const e=this.locale.maketext("Unable to update the Consent and Privacy Preferences.");this.notificationEvent.emit({notificationMessage:e,notificationType:o._n.error})}triggerConsentSavedEvent(e=!1){const i=new CustomEvent("consentPrivacySaved",{bubbles:!0,detail:{analytics:e}});this.el.nativeElement.dispatchEvent(i)}ngOnDestroy(){this.stop$?.next(),this.stop$?.complete()}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(g.h),t.rXU(a.ze),t.rXU(V),t.rXU(p),t.rXU(t.aKT))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-consent-privacy"]],outputs:{notificationEvent:"notificationEvent"},features:[t.Jv_([o.JE])],decls:14,vars:8,consts:[[1,"mb-5"],["id","consentAndPrivacyForm","name","consentAndPrivacyForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-bar-chart-grouped-line","me-2"],[1,"card-title"],["data-testid","analyticsPageDescription",3,"innerHTML"],[1,"form-check","mb-4"],["data-testid","analyticsCheckbox","type","checkbox","formControlName","analyticsCheckControl","name","analyticsCheck","id","analyticsCheck",1,"form-check-input"],["for","analyticsCheck","data-testid","analyticsCheckboxLabel",3,"innerHTML"],["data-testid","analyticsSaveBtn",1,"mt-4",3,"id","type","buttonState"]],template:function(i,s){1&i&&(t.j41(0,"div",0)(1,"form",1),t.bIt("ngSubmit",function(){return s.saveAnalyticsPreferences()}),t.j41(2,"div",2)(3,"div",3)(4,"div",4),t.nrm(5,"i",5),t.j41(6,"h5",6),t.EFF(7),t.k0s()(),t.nrm(8,"p",7),t.j41(9,"div",8),t.nrm(10,"input",9)(11,"label",10),t.k0s(),t.j41(12,"cp-button",11),t.EFF(13),t.k0s()()()()()),2&i&&(t.R7$(),t.Y8G("formGroup",s.consentAndPrivacyForm),t.R7$(6),t.SpI(" ",s.locale.maketext("Consent and Privacy[comment,title]")," "),t.R7$(),t.Y8G("innerHTML",s.locale.maketext("WebPros International, LLC d.b.a cPanel is asking for your consent to participate in user activity tracking using third-party software for the purpose of understanding the performance of Webpros products. Information will be used pursuant to the [output,url,_1,cPanel and WHM Privacy Policy,title,cPanel and WHM Privacy Policy,data-testid,_2,target,_3,class,_4] and may be shared internally within the Webpros group.","https://go.cpanel.net/privacy","privacy-policy","privacy-policy","external-link"),t.npT),t.R7$(3),t.Y8G("innerHTML",s.locale.maketext("Allow tracking: By checking this box, you agree that we may collect your usage statistics. [output,url,_1,Learn more here,title,cPanel Analytics Documentation,class,_2,target,_3,id,_4,data-testid,_5].","https://go.cpanel.net/analytics","external-link","analytics","learnLink","learnAnalyticsLink"),t.npT),t.R7$(),t.Y8G("id",s.createBtn.id)("type",s.createBtn.type)("buttonState",s.createBtn.buttonState),t.R7$(),t.JRh(s.locale.maketext("Save Changes")))},dependencies:[a.qT,a.Zm,a.BC,a.cb,a.j4,a.JD,o.Qp],styles:[".red-color[_ngcontent-%COMP%]{color:#dc3545}"]})}return n})();var E=c(6799);const O=n=>({"data-testid":"systemNotificationSelectInput",autocomplete:"off","aria-label":n});let W=(()=>{class n{constructor(e,i,s,r){this.analyticsBuilder=e,this.personalizationService=i,this.locale=s,this.page=r,this.notificationEvent=new t.bkB,this.notificationListPositions=Object.values(o.Rk).map(d=>({name:d,value:d})),this.createBtn={id:"saveSystemNotificationsBtn",type:"submit",buttonState:o.w.enabled},this.stop$=new S.B}ngOnInit(){const e=JSON.parse(this.page?.systemNotification||null)?.position||o.Rk.topRight;this.systemNotificationForm=this.analyticsBuilder.group({notificationTypesControl:[{name:e,value:e},[a.k0.required]]}),this.systemNotificationForm.valueChanges.pipe((0,F.Q)(this.stop$)).subscribe(()=>{this.createBtn.buttonState=this.systemNotificationForm.valid?o.w.enabled:o.w.disabled})}saveNotifications(){this.createBtn.buttonState=o.w.loading;const e={"common-alertList":JSON.stringify({position:this.systemNotificationForm.controls.notificationTypesControl?.value?.value})};this.personalizationService.set(e).pipe((0,C.s)(1),(0,b.j)(()=>this.createBtn.buttonState=o.w.enabled)).subscribe({next:i=>{const s=i?.data?.personalization["common-alertList"];if(this.position=JSON.parse(s?.value)?.position,s?.success){const r=this.locale.maketext("Successfully updated the system notification to \u201c[_1]\u201d.",this.position);this.page.systemNotification=JSON.stringify({position:this.systemNotificationForm.controls.notificationTypesControl?.value?.value}),this.notificationEvent.emit({notificationMessage:r,notificationType:o._n.success})}else this.handleError()},error:i=>this.handleError()})}handleError(){const e=this.locale.maketext("Unable to update the system notification to \u201c[_1]\u201d.",this.position);this.notificationEvent.emit({notificationMessage:e,notificationType:o._n.error})}ngOnDestroy(){this.stop$.next(),this.stop$.complete()}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(a.ze),t.rXU(V),t.rXU(g.h),t.rXU(p))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-system-notifications"]],outputs:{notificationEvent:"notificationEvent"},decls:12,vars:12,consts:[["id","systemNotificationForm","name","systemNotificationForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-notification-line","me-2"],[1,"card-title"],["data-testid","systemNotificationPageDescription",3,"innerHTML"],[1,"mb-5"],["data-testid","systemNotificationSelect","formControlName","notificationTypesControl","bindLabel","name",3,"placeholder","items","inputAttrs"],["data-testid","systemNotificationSaveButton",1,"mt-2",3,"id","type","buttonState"]],template:function(i,s){1&i&&(t.j41(0,"form",0),t.bIt("ngSubmit",function(){return s.saveNotifications()}),t.j41(1,"div",1)(2,"div",2)(3,"div",3),t.nrm(4,"i",4),t.j41(5,"h5",5),t.EFF(6),t.k0s()(),t.nrm(7,"p",6),t.j41(8,"div",7),t.nrm(9,"ng-select",8),t.k0s(),t.j41(10,"cp-button",9),t.EFF(11),t.k0s()()()()),2&i&&(t.Y8G("formGroup",s.systemNotificationForm),t.R7$(6),t.SpI(" ",s.locale.maketext("System Notifications")," "),t.R7$(),t.Y8G("innerHTML",s.locale.maketext("System notifications show you errors, warnings, and success messages. Select the interface location in the dropdown to set where you want to see system notifications. For more information about system notifications, visit the [output,url,_1,documentation,title,documentation,class,_2,target,_3,id,_4,data-testid,_5].","https://docs.cpanel.net/cpanel/preferences/account-preferences/","external-link","notification","learnLink","learnNotificationLink"),t.npT),t.R7$(2),t.Y8G("placeholder",s.locale.maketext("Select notification type[comment,label]"))("items",s.notificationListPositions)("inputAttrs",t.eq3(10,O,s.locale.maketext("Select notification type[comment,label]"))),t.R7$(),t.Y8G("id",s.createBtn.id)("type",s.createBtn.type)("buttonState",s.createBtn.buttonState),t.R7$(),t.JRh(s.locale.maketext("Save Changes")))},dependencies:[a.qT,a.BC,a.cb,a.j4,a.JD,o.Qp,E.vr]})}return n})(),Q=(()=>{class n{constructor(e,i){this.http=e,this.locale=i,this.currentLocale=this.locale.getCurrentLocale()?.replace(/_/g,"-")}setLocale(e){const i=new f.V({namespace:"Locale",method:"set_locale",arguments:[new u.e("locale",e)]});return this.http.post(i)}fetchAvailableLocaleProps(){const e=new f.V({namespace:"Locale",method:"list_locales"});return this.http.post(e).pipe((0,I.T)(i=>{const s=this.transformLanguageData(i.data);return this.sortLanguageDataByName(s)}))}transformLanguageData(e){return e.map(i=>({...i,descriptive_name:`${i.name} (${i.local_name})`}))}sortLanguageDataByName(e){return e.sort((i,s)=>i.name.localeCompare(s.name,this.currentLocale))}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(w.dF),t.KVO(g.h))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const J=n=>({"data-testid":"changeLanguageSelectInput",autocomplete:"off","aria-label":n});function U(n,l){1&n&&t.EFF(0),2&n&&t.SpI(" ",l.item.name," ")}function H(n,l){if(1&n&&(t.j41(0,"div",15),t.EFF(1),t.k0s()),2&n){const e=l.item;t.Y8G("lang",e.locale),t.R7$(),t.Lme(" ",e.name," (",e.local_name,") ")}}let z=(()=>{class n{constructor(e,i,s,r){this.locale=e,this.page=i,this.changeLanguageFormBuilder=s,this.changeLanguageService=r,this.notificationEvent=new t.bkB,this.buttonState=o.w.enabled,this.availableLocaleProps$=this.changeLanguageService.fetchAvailableLocaleProps(),this.successConfig={notificationMessage:this.locale.maketext("You have changed your language preferences."),notificationType:o._n.success},this.errorConfig={notificationMessage:this.locale.maketext("The system encountered an error while changing the language."),notificationType:o._n.error},this.localeProps={locale:this.locale.getCurrentLocale()||"",name:this.page.localeFullName||""}}ngOnInit(){this.changeLanguageForm=this.changeLanguageFormBuilder.group({languageTypesControl:[this.localeProps.name,a.k0.required]})}onSaveLocale(){const i=this.changeLanguageForm.get("languageTypesControl").value.locale??this.localeProps.locale;this.buttonState=o.w.loading,this.changeLanguageService.setLocale(i).pipe((0,C.s)(1),(0,b.j)(()=>this.buttonState=o.w.enabled)).subscribe({next:s=>this.notifyUser(s),error:()=>this.notifyUser()})}onSelectLocale(e){this.localeProps=e}notifyUser(e=null){this.notificationEvent.emit(e?.success?this.successConfig:this.errorConfig)}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(g.h),t.rXU(p),t.rXU(a.ze),t.rXU(Q))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-change-language"]],outputs:{notificationEvent:"notificationEvent"},decls:22,vars:16,consts:[["id","changeLanguageForm","name","changeLanguageForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-translate","me-2"],[1,"card-title"],["data-testid","changeLanguagePageDescription"],[1,"mb-5"],[1,"mb-2"],[1,"text-muted","me-1"],[3,"innerHTML"],["data-testid","changeLanguageSelect","formControlName","languageTypesControl","bindLabel","descriptive_name","bindValue","name",3,"change","placeholder","items","clearable","inputAttrs"],["ng-label-tmp",""],["ng-option-tmp","","ng-label-tmp",""],["data-testid","changeLanguageSaveButton","id","changeLanguageSaveButton","type","submit",1,"mt-2",3,"buttonState"],[1,"ng-option-label",3,"lang"]],template:function(i,s){1&i&&(t.j41(0,"form",0),t.bIt("ngSubmit",function(){return s.onSaveLocale()}),t.j41(1,"div",1)(2,"div",2)(3,"div",3),t.nrm(4,"i",4),t.j41(5,"h5",5),t.EFF(6),t.k0s()(),t.j41(7,"p",6),t.EFF(8),t.k0s(),t.j41(9,"div",7)(10,"h6"),t.EFF(11),t.k0s(),t.j41(12,"p",8)(13,"span",9),t.EFF(14),t.k0s(),t.nrm(15,"span",10),t.k0s(),t.j41(16,"ng-select",11),t.nI1(17,"async"),t.bIt("change",function(d){return s.onSelectLocale(d)}),t.DNE(18,U,1,1,"ng-template",12)(19,H,2,3,"ng-template",13),t.k0s()(),t.j41(20,"cp-button",14),t.EFF(21),t.k0s()()()()),2&i&&(t.Y8G("formGroup",s.changeLanguageForm),t.R7$(6),t.SpI(" ",s.locale.maketext("Change Language")," "),t.R7$(2),t.SpI(" ",s.locale.maketext("Set your preferred language.")," "),t.R7$(3),t.JRh(s.locale.maketext("Language")),t.R7$(3),t.JRh(s.locale.maketext("Don\u2019t see your language of choice?")),t.R7$(),t.Y8G("innerHTML",s.locale.maketext("[output,url,_1,Submit a request to our roadmap,title,_2,target,_3,data-testid,_4,class,external-link].","https://go.cpanel.net/roadmap","cPanel & WHM Roadmap","requestNewLanguage","requestNewLanguageLink"),t.npT),t.R7$(),t.Y8G("placeholder",s.locale.maketext("Select language[comment,label]"))("items",t.bMT(17,12,s.availableLocaleProps$))("clearable",!1)("inputAttrs",t.eq3(14,J,s.locale.maketext("Select language[comment,label]"))),t.R7$(4),t.Y8G("buttonState",s.buttonState),t.R7$(),t.JRh(s.locale.maketext("Save Changes")))},dependencies:[a.qT,a.BC,a.cb,a.j4,a.JD,o.Qp,E.vr,E.Uq,E.ZZ,h.Jj]})}return n})();var A=c(7673),R=function(n){return n.PrimaryEmail="email",n.SecondaryEmail="second_email",n.PushBulletAccessToken="pushbullet_access_token",n}(R||{});let q=(()=>{class n{constructor(){this.page=(0,t.WQX)(p),this.http=(0,t.WQX)(w.dF),this.primaryEmail=(0,t.vPA)(this.getEmailValue(R.PrimaryEmail)),this.secondaryEmail=(0,t.vPA)(this.getEmailValue(R.SecondaryEmail))}sendRequest(e){const{newEmails:i,previousEmails:s}=e;return i.length||s.length?!i.length&&s.length?this.removeEmailAddress(e):i.length&&!s.length?this.addEmailAddress(e):i.length&&s.length?this.updateEmailAddress(e):(0,A.of)(null):(0,A.of)(null)}updateContactEmails(e){const i={newEmails:[e.primaryEmailControl,e.secondaryEmailControl].filter(Boolean),previousEmails:[this.primaryEmail(),this.secondaryEmail()].filter(Boolean),password:e.passwordControl};return this.sendRequest(i)}updateEmailAddress(e){const i=new f.V({namespace:"ContactInformation",method:"set_email_addresses",arguments:[...e.newEmails.map(s=>new u.e("address",s)),...e.previousEmails.map(s=>new u.e("old_address",s)),new u.e("password",e.password)]});return this.http.post(i)}addEmailAddress(e){const i=new f.V({namespace:"ContactInformation",method:"set_email_addresses",arguments:[...e.newEmails.map(s=>new u.e("address",s)),new u.e("password",e.password)]});return this.http.post(i)}removeEmailAddress(e){const i=new f.V({namespace:"ContactInformation",method:"unset_email_addresses",arguments:[...e.previousEmails.map(s=>new u.e("old_address",s)),new u.e("password",e.password)]});return this.http.post(i)}updateLocalEmails(e){const i=[e.primaryEmailControl,e.secondaryEmailControl].filter(Boolean);this.primaryEmail.set(i[0]||""),this.secondaryEmail.set(i[1]||"")}getEmailValue(e){return this.page.contactInfo.find(i=>i.name===e)?.value||""}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var K=c(510),$=c(9079);let N=(()=>{class n{constructor(){this.notificationEvent=(0,t.CGW)()}sendNotification(e,i){this.notificationEvent.emit({notificationMessage:i,notificationType:e})}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275dir=t.FsC({type:n,outputs:{notificationEvent:"notificationEvent"}})}return n})();const Z=n=>({"ng-form-validated":n});let tt=(()=>{class n extends N{constructor(){super(),this.contactInformationService=(0,t.WQX)(q),this.locale=(0,t.WQX)(g.h),this.formBuilder=(0,t.WQX)(a.ok),this.page=(0,t.WQX)(p),this.emailForm=this.initializeForm(),this.isFormSubmitted=(0,t.vPA)(!1),this.isFormInvalid=(0,t.vPA)(!0),this.primaryEmailControl=this.emailForm.get("primaryEmailControl"),this.secondaryEmailControl=this.emailForm.get("secondaryEmailControl"),this.passwordControl=this.emailForm.get("passwordControl"),this.currentPrimaryEmailControlValue=(0,$.ot)(this.getEmailControlValue$(this.primaryEmailControl)),this.currentSecondaryEmailControlValue=(0,$.ot)(this.getEmailControlValue$(this.secondaryEmailControl)),this.contactInformationSaveButton=(0,t.EWP)(()=>this.isFormSubmitted()?o.w.loading:o.w.enabled),this.isPasswordVisible=(0,t.vPA)(!1),this.passwordVisibilityTogglerClass=(0,t.EWP)(()=>this.isPasswordVisible()?"ri-eye-line":"ri-eye-off-line"),this.passwordFieldType=(0,t.EWP)(()=>this.isPasswordVisible()?"text":"password"),this.primaryEmailChanged=(0,t.EWP)(()=>this.currentPrimaryEmailControlValue()!==this.contactInformationService.primaryEmail()),this.secondaryEmailChanged=(0,t.EWP)(()=>this.currentSecondaryEmailControlValue()!==this.contactInformationService.secondaryEmail()),this.canSubmitForm=(0,t.EWP)(()=>!this.isFormInvalid()&&(this.primaryEmailChanged()||this.secondaryEmailChanged())),this.successMessage=this.locale.maketext("You have successfully updated your contact information."),this.errorMessage=this.locale.maketext("The system encountered an error while updating the contact information."),this.emailsNotChangedMessage=this.locale.maketext("No changes detected. Modify an email before saving."),(0,t.QZP)(()=>this.togglePasswordDisability()),this.updateFormStatus()}saveContactInformation(){if(!this.primaryEmailChanged()&&!this.secondaryEmailChanged()&&this.sendNotification(o._n.information,this.emailsNotChangedMessage),!this.canSubmitForm())return;this.isFormSubmitted.set(!0);const e=this.emailForm.getRawValue();this.contactInformationService.updateContactEmails(e).pipe((0,C.s)(1),(0,b.j)(()=>this.isFormSubmitted.set(!1))).subscribe({next:i=>{i?.success?(this.contactInformationService.updateLocalEmails(e),this.passwordControl.reset(),this.sendNotification(o._n.success,this.successMessage)):i?.messages[0].message.includes("password")&&this.passwordControl.setErrors({incorrectPassword:{message:this.locale.maketext("The password you entered was incorrect.")}})},error:()=>{this.sendNotification(o._n.error,this.errorMessage)}})}togglePasswordVisibility(){this.isPasswordVisible.update(e=>!e)}cancelContactInformation(e){e.preventDefault(),this.emailForm.reset({primaryEmailControl:this.contactInformationService.primaryEmail(),secondaryEmailControl:this.contactInformationService.secondaryEmail()})}initializeForm(){return new a.gE({primaryEmailControl:new a.MJ(this.contactInformationService.primaryEmail(),{validators:[v.ln.required(),v.sr.validateEmail()]}),secondaryEmailControl:new a.MJ(this.contactInformationService.secondaryEmail(),{validators:[v.sr.validateEmail()]}),passwordControl:new a.MJ("",{validators:[v.ln.required()]})})}getEmailControlValue$(e){return e.valueChanges.pipe((0,K.Z)(e.value))}togglePasswordDisability(){this.primaryEmailChanged()||this.secondaryEmailChanged()?this.passwordControl.enable():(this.passwordControl.reset(),this.passwordControl.disable())}updateFormStatus(){this.emailForm.statusChanges.subscribe(()=>this.isFormInvalid.set(this.emailForm.invalid))}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-contact-information"]],features:[t.Vt3],decls:25,vars:21,consts:[[1,"mb-5"],["id","contactInformationForm","name","contactInformationForm",3,"reset","ngSubmit","formGroup","ngClass"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-account-circle-line","me-2"],[1,"card-title"],["data-testid","contactInformationPageDescription",3,"innerHTML"],["labelFor","primaryEmailInput","id","primaryEmailField",1,"mb-5",3,"labelText","control","isRequired"],["input-content","",1,"input-group"],["formControlName","primaryEmailControl","type","text","id","primaryEmailInput","data-testid","primaryEmailInput",1,"form-control"],["labelFor","secondaryEmailInput","id","primaryEmailField",1,"mb-5",3,"labelText","control"],["formControlName","secondaryEmailControl","type","text","id","secondaryEmailInput","data-testid","secondaryEmailInput",1,"form-control"],["labelFor","passwordInput","id","passwordField",3,"isRequired","labelText","control"],["formControlName","passwordControl","id","passwordInput","data-testid","passwordInput",1,"form-control",3,"type"],["data-testid","passwordVisibilityButton","id","passwordVisibilityButton","type","button",1,"input-group-text","btn","btn-outline-primary",3,"click","disabled"],[3,"ngClass"],["data-testid","contactInformationSaveButton","id","contactInformationSaveButton","type","submit",1,"mt-4",3,"buttonState"],["type","reset",1,"btn","btn-link"],["data-testid","contactInformationCancelButton","id","contactInformationCancelButton",1,"btn-link"]],template:function(i,s){1&i&&(t.j41(0,"div",0)(1,"form",1),t.bIt("reset",function(d){return s.cancelContactInformation(d)})("ngSubmit",function(){return s.saveContactInformation()}),t.j41(2,"div",2)(3,"div",3)(4,"div",4),t.nrm(5,"i",5),t.j41(6,"h5",6),t.EFF(7),t.k0s()(),t.nrm(8,"p",7),t.j41(9,"cp-form-field",8)(10,"div",9),t.nrm(11,"input",10),t.k0s()(),t.j41(12,"cp-form-field",11)(13,"div",9),t.nrm(14,"input",12),t.k0s()(),t.j41(15,"cp-form-field",13)(16,"div",9),t.nrm(17,"input",14),t.j41(18,"button",15),t.bIt("click",function(){return s.togglePasswordVisibility()}),t.nrm(19,"i",16),t.k0s()()(),t.j41(20,"cp-button",17),t.EFF(21),t.k0s(),t.j41(22,"button",18)(23,"a",19),t.EFF(24),t.k0s()()()()()()),2&i&&(t.R7$(),t.Y8G("formGroup",s.emailForm)("ngClass",t.eq3(19,Z,s.emailForm.dirty)),t.R7$(6),t.SpI(" ",s.locale.maketext("Contact Information[comment,title]")," "),t.R7$(),t.Y8G("innerHTML",s.locale.maketext("Enter an email address to receive account notifications and password reset confirmations. We recommend using email addresses from different servers to avoid delivery issues if your mailbox reaches its limit."),t.npT),t.R7$(),t.Y8G("labelText",s.locale.maketext("Primary Email Address"))("control",s.primaryEmailControl)("isRequired",!0),t.R7$(3),t.Y8G("labelText",s.locale.maketext("Secondary Email Address"))("control",s.secondaryEmailControl),t.R7$(3),t.Y8G("isRequired",!0)("labelText",s.locale.maketext("Account Password"))("control",s.passwordControl),t.R7$(2),t.Y8G("type",s.passwordFieldType()),t.R7$(),t.Y8G("disabled",s.passwordControl.disabled),t.BMQ("aria-label",s.locale.maketext("Show or hide password[comment,label]")),t.R7$(),t.Y8G("ngClass",s.passwordVisibilityTogglerClass()),t.R7$(),t.Y8G("buttonState",s.contactInformationSaveButton()),t.R7$(),t.JRh(s.locale.maketext("Save Changes")),t.R7$(3),t.JRh(s.locale.maketext("Cancel")))},dependencies:[h.YU,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,o.Qp,o.KS],styles:["[_nghost-%COMP%]   .btn[_ngcontent-%COMP%]{min-width:auto}"]})}return n})(),et=(()=>{class n{constructor(){this.http=(0,t.WQX)(w.dF)}updatePushNotificationsToken(e){return this.http.post(new f.V({namespace:"ContactInformation",method:"set_pushbullet_access_token",arguments:[new u.e("pushbullet_access_token",e)]}))}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var j=c(534);let st=(()=>{class n extends N{constructor(){super(...arguments),this.locale=(0,t.WQX)(g.h),this.page=(0,t.WQX)(p),this.formBuilder=(0,t.WQX)(a.ok),this.pushNotificationsService=(0,t.WQX)(et),this.localized=function nt(n){return{successMessage:n.maketext("You have successfully updated the Pushbullet token."),errorMessage:n.maketext("The system encountered an error while updating the Pushbullet token."),tokenNotChangedMessage:n.maketext("No changes detected. Modify the Pushbullet token before saving."),showTokenValueLabel:n.maketext("Show Pushbullet token[comment,label]"),hideTokenValueLabel:n.maketext("Hide Pushbullet token[comment,label]"),formTitle:n.maketext("Push Notifications"),formDescription:n.maketext("Add your access token for Pushbullet."),pushbulletTokenFieldLabel:n.maketext("Access Token"),formSubmitButtonText:n.maketext("Save Changes"),togglePushbulletTokenVisibilityLabel:n.maketext("Show or hide Pushbullet token[comment,label]")}}(this.locale),this.currentTokenValue=this.getPushbulletTokenValue(),this.pushNotificationsForm=this.getPushbulletFormGroup(),this.pushbulletTokenField=this.pushNotificationsForm.get("pushbulletToken"),this.submitButtonState=(0,t.vPA)(o.w.enabled),this.isTokenVisible=(0,t.vPA)(!1),this.destroySubject$=new S.B,this.tokenVisibilityTogglerClass=(0,t.EWP)(()=>this.isTokenVisible()?"ri-eye-line":"ri-eye-off-line"),this.tokenVisibilityTogglerLabel=(0,t.EWP)(()=>this.isTokenVisible()?this.localized.hideTokenValueLabel:this.localized.showTokenValueLabel),this.tokenFieldType=(0,t.EWP)(()=>this.isTokenVisible()?"text":"password")}submitPushNotificationsForm(){if(!this.isTokenValueChanged())return this.sendNotification(o._n.information,this.localized.tokenNotChangedMessage);this.submitButtonState.set(o.w.loading),this.pushNotificationsService.updatePushNotificationsToken(this.pushbulletTokenField.value).pipe((0,F.Q)(this.destroySubject$),(0,b.j)(()=>this.submitButtonState.set(o.w.enabled))).subscribe({next:e=>{e?.success?(this.currentTokenValue=this.pushbulletTokenField.value,this.sendNotification(o._n.success,this.localized.successMessage)):this.sendNotification(o._n.error,this.localized.errorMessage)},error:()=>{this.sendNotification(o._n.error,this.localized.errorMessage)}})}toggleTokenVisibility(){this.isTokenVisible.update(e=>!e)}ngOnDestroy(){this.destroySubject$.next(!0),this.destroySubject$.complete()}getPushbulletFormGroup(){return this.formBuilder.group({pushbulletToken:this.currentTokenValue})}getPushbulletTokenValue(){return(this.page?.contactInfo||[]).find(({name:e})=>e===R.PushBulletAccessToken)?.value||""}isTokenValueChanged(){return this.pushbulletTokenField.value!==this.currentTokenValue}static#t=this.\u0275fac=(()=>{let e;return function(s){return(e||(e=t.xGo(n)))(s||n)}})();static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-push-notifications"]],features:[t.Vt3],decls:16,vars:12,consts:[[1,"mb-5"],["id","pushNotificationsForm","name","pushNotificationsForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"card-title"],["data-testid","pushNotificationsFormDescription"],["labelFor","pushbulletTokenInput","id","pushbulletTokenInputControl","data-testid","pushbulletTokenInputControl",3,"isRequired","labelText","control"],["input-content","",1,"input-group"],["formControlName","pushbulletToken","id","pushbulletTokenInput","data-testid","pushbulletTokenInput","autocomplete","off",1,"form-control",3,"type"],["data-testid","pushbulletTokenVisibilityButton","id","pushbulletTokenVisibilityButton","type","button",1,"input-group-text","btn","btn-outline-primary","token-visibility-toggler",3,"click","tooltip"],[3,"ngClass"],["data-testid","pushNotificationsSaveButton","id","pushNotificationsSaveButton","type","submit",1,"mt-4",3,"buttonState"]],template:function(i,s){1&i&&(t.j41(0,"div",0)(1,"form",1),t.bIt("ngSubmit",function(){return s.submitPushNotificationsForm()}),t.j41(2,"div",2)(3,"div",3)(4,"h5",4),t.EFF(5),t.k0s(),t.j41(6,"p",5),t.EFF(7),t.k0s(),t.j41(8,"div",0)(9,"cp-form-field",6)(10,"div",7),t.nrm(11,"input",8),t.j41(12,"button",9),t.bIt("click",function(){return s.toggleTokenVisibility()}),t.nrm(13,"i",10),t.k0s()()()(),t.j41(14,"cp-button",11),t.EFF(15),t.k0s()()()()()),2&i&&(t.R7$(),t.Y8G("formGroup",s.pushNotificationsForm),t.R7$(4),t.SpI(" ",s.localized.formTitle," "),t.R7$(2),t.SpI(" ",s.localized.formDescription," "),t.R7$(2),t.Y8G("isRequired",!1)("labelText",s.localized.pushbulletTokenFieldLabel)("control",s.pushbulletTokenField),t.R7$(2),t.Y8G("type",s.tokenFieldType()),t.R7$(),t.Y8G("tooltip",s.tokenVisibilityTogglerLabel()),t.BMQ("aria-label",s.localized.togglePushbulletTokenVisibilityLabel),t.R7$(),t.Y8G("ngClass",s.tokenVisibilityTogglerClass()),t.R7$(),t.Y8G("buttonState",s.submitButtonState()),t.R7$(),t.SpI("",s.localized.formSubmitButtonText," "))},dependencies:[h.YU,j.dg,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,o.Qp,o.KS],styles:[".token-visibility-toggler[_ngcontent-%COMP%]{min-width:auto}"]})}return n})();var m=function(n){return n.Disable="disable",n.All="all",n.FailWarnDefer="failWarnDefer",n.CertFailures="certFailures",n}(m||{});const L=["notify_autossl_expiry","notify_autossl_expiry_coverage","notify_autossl_renewal_coverage","notify_autossl_renewal_coverage_reduced"];let it=(()=>{class n{constructor(){this.http=(0,t.WQX)(w.dF),this.page=(0,t.WQX)(p),this.preferences=(0,t.vPA)(this.page.contactPreferences),this.autoSslOptions=(0,t.EWP)(()=>this.configureAutoSslOptions())}updateContactPreferences(e){return this.http.post(new f.V({namespace:"ContactInformation",method:"set_notification_preferences",arguments:[new u.e("preferences",e)],config:{json:!0}}))}mapToApiPayload(e){const i={};for(const[s,r]of Object.entries(e))"autosslNotifications"!==s&&(i[s]=r?1:0);if(this.autoSslOptions().canDisplaySslFormSection){const s=e.autosslNotifications,r=[m.All,m.FailWarnDefer,m.CertFailures].includes(s)?1:0;L.forEach(d=>i[d]=r),i.notify_autossl_renewal=s===m.All?1:0,i.notify_autossl_renewal_uncovered_domains=s===m.All||s===m.FailWarnDefer?1:0}return i}configureAutoSslOptions(){const e=this.preferences(),i=new Set(e.map(_=>_.name)),s=new Set(L),r=i.has("notify_autossl_renewal"),d=i.has("notify_autossl_renewal_uncovered_domains"),P=e.some(_=>s.has(_.name));let y=m.Disable;for(const{name:_,enabled:G}of e)"notify_autossl_renewal"===_&&G&&(y=m.All),"notify_autossl_renewal_uncovered_domains"===_&&G&&y!==m.All&&(y=m.FailWarnDefer),s.has(_)&&G&&y!==m.All&&y!==m.FailWarnDefer&&(y=m.CertFailures);return{canSetAllNotifications:r,canSetFailuresAndDeferralsNotifications:d,canSetFailures:P,initialPreset:y,canDisplaySslFormSection:r||d||P}}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const ot=n=>({"ng-form-validated":n});function at(n,l){if(1&n&&(t.j41(0,"span",21),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.SpI("(",e.infotext,")")}}function rt(n,l){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",18),t.j41(2,"label",19)(3,"span"),t.EFF(4),t.k0s(),t.DNE(5,at,2,1,"span",20),t.k0s()()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Y8G("formControlName",e.name)("id",e.name+"_checkbox"),t.BMQ("data-testid",e.name+"_checkbox"),t.R7$(),t.Y8G("for",e.name+"_checkbox"),t.R7$(2),t.JRh(e.descp),t.R7$(),t.Y8G("ngIf",e.infotext.length)}}function ct(n,l){if(1&n&&(t.j41(0,"span",21),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.SpI("(",e.infotext,")")}}function lt(n,l){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",18),t.j41(2,"label",19)(3,"span"),t.EFF(4),t.k0s(),t.DNE(5,ct,2,1,"span",20),t.k0s()()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Y8G("formControlName",e.name)("id",e.name+"_checkbox"),t.BMQ("data-testid",e.name+"_checkbox"),t.R7$(),t.Y8G("for",e.name+"_checkbox"),t.R7$(2),t.JRh(e.descp),t.R7$(),t.Y8G("ngIf",e.infotext.length)}}function dt(n,l){if(1&n&&(t.j41(0,"div",22),t.DNE(1,lt,6,6,"div",15),t.k0s()),2&n){const e=l.$implicit,i=t.XpG().$implicit;t.R7$(),t.Y8G("ngIf",e.onchangeparent===i.name)}}function ut(n,l){if(1&n&&(t.qex(0),t.DNE(1,rt,6,6,"div",15)(2,dt,2,1,"div",16),t.bVm()),2&n){const e=l.$implicit,i=t.XpG(2);t.R7$(),t.Y8G("ngIf",!e.onchangeparent.length),t.R7$(),t.Y8G("ngForOf",i.preferences())}}function mt(n,l){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",25),t.j41(2,"label",26),t.EFF(3),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(),t.Y8G("value",e.autoSslPreset.All),t.R7$(2),t.SpI(" ",e.locale.maketext("All [asis,AutoSSL] events: failures, deferrals, and successful installations.")," ")}}function pt(n,l){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",27),t.j41(2,"label",28),t.EFF(3),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(),t.Y8G("value",e.autoSslPreset.FailWarnDefer),t.R7$(2),t.SpI(" ",e.locale.maketext("[asis,AutoSSL] failures and deferrals only. (default)")," ")}}function ht(n,l){if(1&n&&(t.j41(0,"div",23)(1,"h5",24),t.EFF(2),t.k0s(),t.DNE(3,mt,4,2,"div",15)(4,pt,4,2,"div",15),t.k0s()),2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.locale.maketext("[asis,AutoSSL] Notifications")," "),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canSetAllNotifications),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canSetFailuresAndDeferralsNotifications)}}function ft(n,l){if(1&n&&(t.qex(0),t.j41(1,"div",17),t.nrm(2,"input",29),t.j41(3,"label",30),t.EFF(4),t.k0s()(),t.j41(5,"div",17),t.nrm(6,"input",31),t.j41(7,"label",32),t.EFF(8),t.k0s()(),t.bVm()),2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("value",e.autoSslPreset.CertFailures),t.R7$(2),t.SpI(" ",e.locale.maketext("[asis,AutoSSL] failures only.")," "),t.R7$(2),t.Y8G("value",e.autoSslPreset.Disable),t.R7$(2),t.SpI(" ",e.locale.maketext("Disable [asis,AutoSSL] event notifications.")," ")}}function gt(n,l){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"form",2),t.bIt("ngSubmit",function(){t.eBV(e);const s=t.XpG();return t.Njj(s.saveContactPreferences())}),t.j41(2,"div",3)(3,"div",4)(4,"div",5),t.nrm(5,"i",6),t.j41(6,"h5",7),t.EFF(7),t.k0s()(),t.j41(8,"div",8)(9,"p",9),t.EFF(10),t.k0s(),t.DNE(11,ut,3,2,"ng-container",10)(12,ht,5,3,"div",11)(13,ft,9,4,"ng-container",12),t.k0s(),t.j41(14,"div",13)(15,"cp-button",14),t.EFF(16),t.k0s()()()()()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("formGroup",e.contactPreferencesForm)("ngClass",t.eq3(9,ot,e.contactPreferencesForm.dirty)),t.R7$(6),t.SpI(" ",e.locale.maketext("Contact Preferences")," "),t.R7$(3),t.SpI(" ",e.locale.maketext("Select which notifications you would like to receive by email. Notify me when:")," "),t.R7$(),t.Y8G("ngForOf",e.preferences()),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canDisplaySslFormSection),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canSetFailures),t.R7$(2),t.Y8G("buttonState",e.submitButtonState()),t.R7$(),t.JRh(e.locale.maketext("Save Changes"))}}let vt=(()=>{class n extends N{constructor(){super(...arguments),this.service=(0,t.WQX)(it),this.fb=(0,t.WQX)(a.ok),this.destroy$=new S.B,this.locale=(0,t.WQX)(g.h),this.autoSslPreset=m,this.initialFormData={},this.preferences=this.service.preferences,this.autoSslOptions=this.service.autoSslOptions,this.isSubmitted=(0,t.vPA)(!1),this.isInvalid=(0,t.vPA)(!1),this.submitButtonState=(0,t.EWP)(()=>this.isSubmitted()?o.w.loading:o.w.enabled),this.successMessage=this.locale.maketext("You have successfully updated your contact preferences."),this.errorMessage=this.locale.maketext("The system encountered an error while updating the contact preferences."),this.noChangesMessage=this.locale.maketext("No changes detected. Modify preferences before saving.")}ngOnInit(){this.setupForm()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}saveContactPreferences(){if(this.isSubmitted()||this.isInvalid())return;const e=this.contactPreferencesForm.getRawValue(),i=this.service.mapToApiPayload(e);if(JSON.stringify(e)===JSON.stringify(this.initialFormData))return this.sendNotification(o._n.information,this.noChangesMessage);this.isSubmitted.set(!0),this.service.updateContactPreferences(i).pipe((0,b.j)(()=>this.isSubmitted.set(!1))).subscribe({next:s=>{this.sendNotification(s.status?o._n.success:o._n.error,s.status?this.successMessage:this.errorMessage),s.status&&(this.initialFormData=this.contactPreferencesForm.getRawValue())},error:()=>{this.sendNotification(o._n.error,this.errorMessage)}})}setupForm(){const e={},{initialPreset:i,canDisplaySslFormSection:s}=this.autoSslOptions();this.preferences().forEach(r=>{e[r.name]=new a.MJ(!!r.enabled)}),s&&(e.autosslNotifications=new a.MJ(i)),this.contactPreferencesForm=this.fb.group(e),this.initialFormData=this.contactPreferencesForm.getRawValue(),this.setupParentChild(this.contactPreferencesForm,this.preferences()),this.contactPreferencesForm.statusChanges.pipe((0,F.Q)(this.destroy$)).subscribe(()=>{this.isInvalid.set(this.contactPreferencesForm.invalid)})}setupParentChild(e,i){i.forEach(s=>{if(!s.onchangeparent)return;const r=e.get(s.onchangeparent),d=e.get(s.name);!r||!d||(r.value||d.disable({emitEvent:!1}),r.valueChanges.pipe((0,F.Q)(this.destroy$)).subscribe(P=>{P?d.enable({emitEvent:!1}):(d.disable({emitEvent:!1}),d.setValue(!1,{emitEvent:!1}))}))})}static#t=this.\u0275fac=(()=>{let e;return function(s){return(e||(e=t.xGo(n)))(s||n)}})();static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-contact-preferences"]],features:[t.Vt3],decls:1,vars:1,consts:[["class","mb-5",4,"ngIf"],[1,"mb-5"],["id","contactPreferencesForm","name","contactPreferencesForm",3,"ngSubmit","formGroup","ngClass"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-mail-line","me-2"],[1,"card-title"],[1,"mt-3","mb-4"],[1,"mb-4"],[4,"ngFor","ngForOf"],["class","form-group",4,"ngIf"],[4,"ngIf"],[1,"mt-4"],["data-testid","contactPreferencesSaveButton","id","contactPreferencesSaveButton","type","submit",1,"me-2",3,"buttonState"],["class","form-check mb-3",4,"ngIf"],["class","ms-6",4,"ngFor","ngForOf"],[1,"form-check","mb-3"],["type","checkbox",1,"form-check-input",3,"formControlName","id"],[1,"form-check-label",3,"for"],["class","ms-1",4,"ngIf"],[1,"ms-1"],[1,"ms-6"],[1,"form-group"],[1,"mt-6","mb-3"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsAll_radio","data-testid","autosslNotificationsAll_radio",1,"form-check-input",3,"value"],["for","notify_autossl_renewal_radio",1,"form-check-label"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsFailsAndDeferrals_radio","data-testid","autosslNotificationsFailsAndDeferrals_radio",1,"form-check-input",3,"value"],["for","autosslNotificationsFailsAndDeferrals_radio",1,"form-check-label"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsFailsOnly_radio","data-testid","autosslNotificationsFailsOnly_radio",1,"form-check-input",3,"value"],["for","autosslNotificationsFailsOnly_radio",1,"form-check-label"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsDisabled_radio","data-testid","autosslNotificationsDisabled_radio",1,"form-check-input",3,"value"],["for","autosslNotificationsDisabled_radio",1,"form-check-label"]],template:function(i,s){1&i&&t.DNE(0,gt,17,11,"div",0),2&i&&t.Y8G("ngIf",s.contactPreferencesForm)},dependencies:[h.YU,h.Sq,h.bT,a.qT,a.me,a.Zm,a.Fm,a.BC,a.cb,a.j4,a.JD,o.Qp],styles:[".form-check[_ngcontent-%COMP%]{margin-bottom:.75rem}.form-text[_ngcontent-%COMP%]{font-size:.85rem;margin-top:.25rem;color:var(--bs-gray-600)}h6[_ngcontent-%COMP%]{font-weight:600}"]})}return n})(),bt=(()=>{class n{constructor(){this.http=(0,t.WQX)(w.dF),this.page=(0,t.WQX)(p)}sendChangeRequest(e){const i=[new u.e("newpass",e.newPassword),new u.e("oldpass",e.currentPassword)];this.page.features.webdisk&&i.push(new u.e("enabledigest",e.digestAuth?1:0));const s=new f.V({namespace:"Users",method:"change_password",arguments:i});return this.http.post(s)}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Y=c(1584);const yt=["captureBlur"];function _t(n,l){if(1&n&&(t.j41(0,"div",18),t.nrm(1,"input",19),t.j41(2,"cp-form-label",20),t.EFF(3),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.Y8G("labelText",e.locale.maketext("Enable Digest Authentication"))("showInfoBlock",!1),t.R7$(),t.SpI(" ",e.locale.maketext("[asis,Windows Vista\xae], [asis,Windows\xae 7], [asis,Windows\xae 8] and [asis,Windows\xae 10] require digest authentication support to be enabled in order to access your [asis,Web Disk] over a clear text/unencrypted connection. If the server has an SSL certificate signed by a recognized certificate authority and you are able to make an SSL connection over port 2078, you do not need to enable this.")," ")}}let Ct=(()=>{class n extends N{constructor(){super(),this.destroyRef=(0,t.WQX)(t.abz),this.locale=(0,t.WQX)(g.h),this.page=(0,t.WQX)(p),this.el=(0,t.WQX)(t.aKT),this.changePasswordService=(0,t.WQX)(bt),this.nonNullableFormBuilder=(0,t.WQX)(a.Qk),this.changePasswordForm=this.nonNullableFormBuilder.group({currentPassword:["",[v.ln.required()]],newPassword:["",[v.ln.required()]],digestAuth:[!!this.page.webdav_hasdigest]}),this.currentPasswordControl=this.changePasswordForm.controls.currentPassword,this.newPasswordControl=this.changePasswordForm.controls.newPassword,this.successMessage=this.locale.maketext("You have successfully updated your password. The system will redirect you to login in [numf,5] seconds."),this.errorMessage=this.locale.maketext("The system encountered an error while updating your password."),this.badPassErrorMessage=this.locale.maketext("The password that you entered is incorrect. Try again."),this.samePassErrorMessage=this.locale.maketext("You cannot reuse the old password."),this.showPassword=this.locale.maketext("Show password."),this.hidePassword=this.locale.maketext("Hide password."),this.isFormSubmitted=new S.B,this.isRequired=!0,this.showAllHelp=!0,this.isStrengthValidationRequired=!0,this.changePasswordSaveButton=o.w.enabled,this.isPasswordVisible=(0,t.vPA)(!1),this.currentPasswordVisibilityClass=(0,t.EWP)(()=>this.isPasswordVisible()?"ri-eye-line":"ri-eye-off-line"),this.currentPasswordFieldType=(0,t.EWP)(()=>this.isPasswordVisible()?"text":"password"),this.showOrHidePasswordTooltip=(0,t.EWP)(()=>this.isPasswordVisible()?this.hidePassword:this.showPassword),this.onBlurHandler=e=>{e.stopPropagation(),this.newPasswordControl.markAsTouched()},this.onFocusHandler=e=>{"newPassword-generate-password-btn"===e.target.id?this.el.nativeElement.querySelector(".currentStrengthText")?.classList.remove("hidden"):this.checkForOverlap()}}checkForOverlap(){const i=this.el.nativeElement.querySelector("#newPasswordField_validationContainer")?.getBoundingClientRect().width>0,s=this.el.nativeElement.querySelector(".currentStrengthText");i||""===this.newPasswordControl.value?s?.classList.add("hidden"):s?.classList.remove("hidden")}ngOnInit(){const e=this.captureBlur.nativeElement;e.addEventListener("blur",this.onBlurHandler,!0),e.addEventListener("focus",this.onFocusHandler,!0)}cancelChangedPasswordAndDigest(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();const i=this.newPasswordControl.validator;this.newPasswordControl.clearValidators(),this.newPasswordControl.updateValueAndValidity(),this.newPasswordControl.addValidators(i||(()=>null))}toggleCurrentPasswordVisibility(){this.isPasswordVisible.update(e=>!e)}saveChangedPasswordAndDigest(){if(this.changePasswordSaveButton=o.w.loading,this.changePasswordForm.invalid)return void(0,Y.O)(500).pipe((0,C.s)(1)).subscribe(()=>{this.changePasswordForm.markAllAsTouched(),this.sendError(),this.changePasswordSaveButton=o.w.enabled});const e=this.changePasswordForm.getRawValue();this.changePasswordService.sendChangeRequest(e).pipe((0,$.pQ)(this.destroyRef),(0,b.j)(()=>this.changePasswordSaveButton=o.w.enabled)).subscribe({next:i=>{i?.success?this.sendSuccess():this.sendError(i)},error:()=>{this.sendError()}})}sendSuccess(){this.sendNotification(o._n.success,this.successMessage),(0,Y.O)(5e3).pipe((0,C.s)(1)).subscribe(()=>{location.pathname="logout"}),this.currentPasswordControl.reset(),this.newPasswordControl.reset()}sendError(e){const i=e?.messages[0]?.message??"";i.toLowerCase().includes(this.badPassErrorMessage.toLowerCase())?this.currentPasswordControl.setErrors({incorrectPassword:{message:this.badPassErrorMessage}}):i.toLowerCase().includes(this.samePassErrorMessage.toLowerCase())?this.newPasswordControl.setErrors({samePassword:{message:this.samePassErrorMessage}}):this.sendNotification(o._n.error,this.errorMessage)}ngOnDestroy(){const e=this.captureBlur.nativeElement;e.removeEventListener("blur",this.onBlurHandler,!0),e.removeEventListener("focus",this.onFocusHandler,!0)}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-change-password"]],viewQuery:function(i,s){if(1&i&&t.GBs(yt,7),2&i){let r;t.mGM(r=t.lsd())&&(s.captureBlur=r.first)}},features:[t.Vt3],decls:25,vars:24,consts:[["captureBlur",""],["data-testid","changePasswordForm","name","changePasswordForm",3,"ngSubmit","reset","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-lock-2-line","me-2"],[1,"card-title"],["data-testid","changePasswordDescription",3,"innerHTML"],["labelFor","accountPasswordInput","id","accountPasswordField","data-testid","accountPasswordField",3,"isRequired","labelText","control"],["input-content","",1,"input-group"],["formControlName","currentPassword","id","accountPasswordInput","data-testid","accountPasswordInput",1,"form-control",3,"type"],["data-testid","passwordVisibilityButton","type","button",1,"input-group-text","btn","btn-outline-primary",3,"click","tooltip"],[3,"ngClass"],["id","newPasswordField","data-testid","newPasswordField","labelFor","newPassword-password-input",3,"isRequired","labelText","control"],["input-content","","id","newPassword","data-testid","newPassword",3,"requiresStrengthValidation","requiredStrength","isFormSubmitted","isRequired","controlName","passwordFormGroup"],["class","form-check mb-4",4,"ngIf"],["data-testid","changePasswordSaveButton","id","changePasswordSaveButton","type","submit",1,"mt-4",3,"buttonState"],["type","reset","data-testid","changePasswordCancelButton",1,"btn","btn-link"],[1,"form-check","mb-4"],["type","checkbox","id","authInCheckbox","data-testid","authInCheckbox","formControlName","digestAuth","input-content","",1,"form-check-input"],["id","authInLabel","data-testid","authInLabel","for","authInCheckbox",1,"form-check-label",3,"labelText","showInfoBlock"]],template:function(i,s){if(1&i){const r=t.RV6();t.j41(0,"form",1),t.bIt("ngSubmit",function(){return t.eBV(r),t.Njj(s.saveChangedPasswordAndDigest())})("reset",function(P){return t.eBV(r),t.Njj(s.cancelChangedPasswordAndDigest(P))}),t.j41(1,"div",2)(2,"div",3)(3,"div",4),t.nrm(4,"i",5),t.j41(5,"h5",6),t.EFF(6),t.k0s()(),t.nrm(7,"div",7),t.j41(8,"p")(9,"strong"),t.EFF(10),t.k0s()(),t.j41(11,"cp-form-field",8)(12,"div",9),t.nrm(13,"input",10),t.j41(14,"button",11),t.bIt("click",function(){return t.eBV(r),t.Njj(s.toggleCurrentPasswordVisibility())}),t.nrm(15,"i",12),t.k0s()()(),t.j41(16,"div",null,0)(18,"cp-form-field",13),t.nrm(19,"cp-password",14),t.k0s()(),t.DNE(20,_t,4,3,"div",15),t.j41(21,"cp-button",16),t.EFF(22),t.k0s(),t.j41(23,"button",17),t.EFF(24),t.k0s()()()()}2&i&&(t.Y8G("formGroup",s.changePasswordForm),t.R7$(6),t.SpI(" ",s.locale.maketext("Change Password")," "),t.R7$(),t.Y8G("innerHTML",s.locale.maketext("Change your account password below. Password strength is important in web hosting. We strongly recommend using the Password Generator to create your password. For tips to keep your password safe, read our [output,url,_1,documentation,title,Change Password Documentation,class,_2].","https://go.cpanel.net/account-password","external-link"),t.npT),t.R7$(3),t.JRh(s.locale.maketext("Note: If you change your current password, you will end your session.")),t.R7$(),t.Y8G("isRequired",!0)("labelText",s.locale.maketext("Account Password"))("control",s.currentPasswordControl),t.R7$(2),t.Y8G("type",s.currentPasswordFieldType()),t.R7$(),t.Y8G("tooltip",s.showOrHidePasswordTooltip()),t.BMQ("aria-label",s.locale.maketext("Show or hide password[comment,label]")),t.R7$(),t.Y8G("ngClass",s.currentPasswordVisibilityClass()),t.R7$(3),t.Y8G("isRequired",s.isStrengthValidationRequired)("labelText",s.locale.maketext("New Password"))("control",s.newPasswordControl),t.R7$(),t.Y8G("requiresStrengthValidation",s.isStrengthValidationRequired)("requiredStrength",60)("isFormSubmitted",s.isFormSubmitted)("isRequired",s.isRequired)("controlName","newPassword")("passwordFormGroup",s.changePasswordForm),t.R7$(),t.Y8G("ngIf",s.page.features.webdisk),t.R7$(),t.Y8G("buttonState",s.changePasswordSaveButton),t.R7$(),t.JRh(s.locale.maketext("Save Password")),t.R7$(2),t.SpI(" ",s.locale.maketext("Cancel")," "))},dependencies:[h.YU,h.bT,j.dg,a.qT,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,o.Qp,o.KS,o.n8,o.Wp],styles:["[_nghost-%COMP%]   .btn[_ngcontent-%COMP%]{min-width:auto}[_nghost-%COMP%]     .hidden{display:none}"]})}return n})(),wt=(()=>{class n{onSubmit(){const e=`cpanel-account_preferences-set-${this.sectionName}_clicked`;window.mixpanel?.track(e,{transport:"sendBeacon"})}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275dir=t.FsC({type:n,selectors:[["","cpAcctPrefAnalytics",""]],hostBindings:function(i,s){1&i&&t.bIt("submit",function(){return s.onSubmit()})},inputs:{sectionName:[0,"cpAcctPrefAnalytics","sectionName"]}})}return n})();function Pt(n,l){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-acct-pref-consent-privacy",5),t.bIt("notificationEvent",function(s){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(s))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ConsentPrivacy)}}function kt(n,l){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-acct-pref-contact-information",5),t.bIt("notificationEvent",function(s){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(s))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ContactInformation)}}function St(n,l){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-acct-pref-contact-preferences",5),t.bIt("notificationEvent",function(s){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(s))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ContactPreferences)}}function Ft(n,l){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"cp-acct-pref-change-language",5),t.bIt("notificationEvent",function(s){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(s))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ChangeLanguage)}}function Et(n,l){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"cp-acct-pref-push-notifications",5),t.bIt("notificationEvent",function(s){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(s))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.PushNotifications)}}function Tt(n,l){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"cp-acct-pref-change-password",5),t.bIt("notificationEvent",function(s){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(s))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ChangePassword)}}function Rt(n,l){if(1&n&&(t.j41(0,"div"),t.nrm(1,"cp-notification-list",7),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.Y8G("position",e.position)}}let Nt=(()=>{class n{constructor(e,i,s){this.locale=e,this.notificationService=i,this.page=s,this.title="account-preferences",this.analyticsEvent=x,v.uv.locale=this.locale}sendNotification(e){switch(this.position=JSON.parse(this.page?.systemNotification||null)?.position||o.Rk.topRight,e.notificationType){case o._n.success:this.notificationService.success(e.notificationMessage);break;case o._n.error:this.notificationService.error(e.notificationMessage);break;case o._n.information:this.notificationService.info(e.notificationMessage)}}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(g.h),t.rXU(o.JE),t.rXU(p))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-root"]],decls:16,vars:9,consts:[[1,"row"],["id","cpanel",1,"mt-4"],[1,"col-md-6"],[4,"ngIf"],[1,"mb-4"],[3,"notificationEvent","cpAcctPrefAnalytics"],["class","mb-4",4,"ngIf"],[3,"position"]],template:function(i,s){1&i&&(t.j41(0,"div",0)(1,"h6"),t.EFF(2),t.k0s()(),t.j41(3,"div",1)(4,"div",0)(5,"div",2),t.DNE(6,Pt,2,1,"div",3)(7,kt,2,1,"div",3)(8,St,2,1,"div",3),t.k0s(),t.j41(9,"div",2)(10,"div",4)(11,"cp-acct-pref-system-notifications",5),t.bIt("notificationEvent",function(d){return s.sendNotification(d)}),t.k0s()(),t.DNE(12,Ft,2,1,"div",6)(13,Et,2,1,"div",6)(14,Tt,2,1,"div",6),t.k0s()(),t.DNE(15,Rt,2,1,"div",3),t.k0s()),2&i&&(t.R7$(2),t.JRh(s.locale.maketext("Update your settings for cPanel.")),t.R7$(4),t.Y8G("ngIf",s.page.features.isUserAnalyticsRequiredByLeika),t.R7$(),t.Y8G("ngIf",s.page.features.updatecontact||s.page.features.updatenotificationprefs),t.R7$(),t.Y8G("ngIf",s.page.features.updatenotificationprefs),t.R7$(3),t.Y8G("cpAcctPrefAnalytics",s.analyticsEvent.SystemNotifications),t.R7$(),t.Y8G("ngIf",s.page.features.setlang),t.R7$(),t.Y8G("ngIf",s.page.features.updatecontact),t.R7$(),t.Y8G("ngIf",s.page.features.password),t.R7$(),t.Y8G("ngIf",!!s.position))},dependencies:[h.bT,o.bR,X,W,z,tt,st,vt,Ct,wt],styles:[".card{background-color:#fff}"]})}return n})();var It=c(8658),$t=c(4580),jt=c(5992),Gt=c(3824),Bt=c(8580),xt=c(779),Vt=c(3400),At=c(9966),Lt=c(7820),Yt=c(3816),Mt=c(728),M=c(1562);let Dt=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n,bootstrap:[Nt]});static#n=this.\u0275inj=t.G2t({providers:[{provide:p,useValue:window.PAGE},{provide:h.kB,deps:[p],useFactory:e=>e.pageURL},{provide:Window,useValue:window},(0,M.$R)((0,M.Sx)())],imports:[T.Bb,It.B,Yt.jr.forRoot(),$t.h6.forRoot(),jt.G.forRoot(),Bt.zE.forRoot(),xt.Q_.forRoot(),j.Ss.forRoot(),At.k0.forRoot(),Lt.Hq.forRoot(),Vt.x6.forRoot(),Gt.YN.forRoot(),h.MD,a.X1,o.tm,a.YN,Mt.wb,o.nx,o.zJ,E.MQ,o.CF,o.LT,o.Ou,o.H7,o.rY,o.E4]})}return n})();T.sG().bootstrapModule(Dt).catch(n=>console.error(n))}},k=>{k.O(0,[128,996,538],()=>k(k.s=1366)),k.O()}]);
Back to Directory