"use strict";(self.webpackChunkinitial_setup_wizard=self.webpackChunkinitial_setup_wizard||[]).push([[996],{7996:(Y,x,i)=>{i.r(x),i.d(x,{TrialActivationModule:()=>H});var P=i(6895),C=i(269),w=i(1086),f=i(1709),y=i(537),u=i(2868),O=i(7221),M=i(2777),l=i(6154),T=i(1737),L=i(5529),t=i(6738),b=i(5419),d=i(5812);let v=(()=>{class n{constructor(e,o,g,p,h){this.whmapi=e,this.locale=o,this.window=g,this.page=p,this.router=h,this._verificationFailureRegex=/^X::EmailNotVerified/,this.throwWhmApiError=(0,u.b)(r=>{if(r.failed)throw r.errors[0]}),this.handleError=r=>(0,O.K)(c=>(this.errorSub.next(r),(0,T._)(c))),this.handleVerificationError=r=>(0,u.b)(c=>{if(this._verificationFailureRegex.test(c.data.type))throw r&&r(),c.data.type}),this.getLoginURL=()=>{const r=new l.r(l.N.JsonApi,{method:"get_login_url",arguments:[{name:"provider",value:"cPStore"},{name:"url_after_login",value:this.returnURL}]});return this.whmapi.post(r)},this.validateToken=r=>{const c=this.locale.maketext("The system failed to authenticate. Please try again"),m=new l.r(l.N.JsonApi,{method:"validate_login_token",arguments:[{name:"provider",value:"cPStore"},{name:"url_after_login",value:this.returnURL},{name:"login_token",value:r}]});return this.whmapi.post(m).pipe(this.throwWhmApiError,this.handleError(c),(0,u.b)(_=>{this.access_token=_.data[0].access_token,this.refresh_token=_.data[0].refresh_token}))},this.acquireTrialLicense=(r={})=>{let c,m=this.locale.maketext("The system could not activate the trial license.");const _=new l.r(l.N.JsonApi,{method:"purchase_a_trial",arguments:[{name:"provider",value:"cPStore"},{name:"login_token",value:this.access_token},{name:"checkout_args",value:r}],config:{json:!0}});return r.verification_code?m=this.locale.maketext("The verification code was incorrect. Please try again."):c=()=>this.router.navigate(["trial-activation","email-verification"]),this.whmapi.post(_).pipe(this.handleVerificationError(c),this.throwWhmApiError,this.handleError(m))},this.updateLicense=()=>{const c=this.locale.maketext("The system failed to update the license on your cPanel [output,amp] WHM server. [output,url,_1,Fix License File Errors]",this.window.location.protocol+this.window.location.hostname+this.page.cp_security_token+"../../scripts10/license_error"),m=new l.r(l.N.JsonApi,{method:"run_cpkeyclt",arguments:[{name:"force",value:"1"}]});return this.whmapi.post(m).pipe(this.throwWhmApiError,this.handleError(c))},this.errorSub=new L.xQ,this.errormsg$=this.errorSub.asObservable()}get returnURL(){return this.window.location.protocol+"//"+this.window.location.host+this.window.location.pathname}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(b.A4),t.LFG(C.g),t.LFG(Window),t.LFG(M.q),t.LFG(d.F0))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function A(n,a){if(1&n&&(t.TgZ(0,"div",7),t._UZ(1,"cp-icon",8)(2,"div",9),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("innerHTML",e.error,t.oJD)}}function Z(n,a){if(1&n&&(t.ynx(0),t._UZ(1,"p",10)(2,"p",10),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("innerHTML",e.locale.maketext("Log in to the cPanel Store using your existing store credentials to [output,strong,activate your Free Trial license]."),t.oJD),t.xp6(1),t.Q6J("innerHTML",e.locale.maketext("If you do not already have a cPanel Store account, you can create one using the [output,strong,Create Account] link on the cPanel Store Login page."),t.oJD)}}function k(n,a){if(1&n&&t._UZ(0,"p",10),2&n){const e=t.oxw();t.Q6J("innerHTML",e.locale.maketext("Thank you for authenticating your cPanel Store account. We are activating your new 15-day free trial license which will let you use [asis,cPanel amp() WHM] with no limitations."),t.oJD)}}let J=(()=>{class n extends M.h{constructor(e,o,g,p){super(e),this.locale=e,this.window=o,this.router=g,this.store=p,this.continueLabel=this.locale.maketext("Log in to cPanel Store"),this.canContinue=!0,this.activating=!1;let h=new URLSearchParams(o.location.search);this.code=h.get("code"),this.store.errormsg$.subscribe(r=>{this.error=r})}next(){this.loading=!0,this.store.getLoginURL().subscribe(({data:e})=>this.window.location.href=e)}cancel(){this.window.location.href="/logout"}ngOnInit(){!this.code||(this.activating=!0,this.loading=!0,this.store.validateToken(this.code).pipe((0,f.zg)(()=>this.store.acquireTrialLicense({send_verification:1})),(0,f.zg)(this.store.updateLicense),(0,y.x)(()=>this.loading=!1),(0,u.b)(()=>this.router.navigate(["trial-activation","success"])),(0,O.K)(()=>(0,w.of)([]))).subscribe())}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.g),t.Y36(Window),t.Y36(d.F0),t.Y36(v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["isw-trial-activation"]],features:[t.qOj],decls:9,vars:5,consts:[[1,"container","text-center"],[3,"src"],[1,"text-container"],["class","cp-alert cp-alert-error",4,"ngIf"],[1,"heading"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[1,"cp-alert","cp-alert-error"],["name","information-fill","size","xl",1,"cp-alert__icon"],[1,"cp-alert__message",3,"innerHTML"],[3,"innerHTML"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"img",1),t.TgZ(2,"div",2),t.YNc(3,A,3,1,"div",3),t.qZA(),t.TgZ(4,"h1",4),t._uU(5),t.qZA(),t.TgZ(6,"div",2),t.YNc(7,Z,3,2,"ng-container",5),t.YNc(8,k,1,1,"p",6),t.qZA()()),2&e&&(t.xp6(1),t.Q6J("src",o.window.MagicRevision+"assets/undraw_sandglass.svg",t.LSH),t.xp6(2),t.Q6J("ngIf",o.error),t.xp6(2),t.hij(" ",o.locale.maketext("Get Started with a Free cPanel Trial!")," "),t.xp6(2),t.Q6J("ngIf",!o.activating),t.xp6(1),t.Q6J("ngIf",o.activating))},directives:[P.O5],styles:[".heading[_ngcontent-%COMP%]{color:var(--cp-primary-action-color);font-weight:700}.text-container[_ngcontent-%COMP%]{max-width:30em;margin:auto;font-weight:300;color:var(--bs-gray-800)}html[dir=ltr][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%]{text-align:left}html[dir=rtl][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%]{text-align:right}.centered-container[_ngcontent-%COMP%]{height:calc(100vh - 9em);display:flex;align-items:center;justify-content:center}"]}),n})(),S=(()=>{class n extends M.h{constructor(e,o,g){super(e),this.locale=e,this.window=o,this.router=g,this.continueLabel=this.locale.maketext("Server Setup"),this.canContinue=!0}next(){this.router.navigate(["server-setup"])}cancel(){this.window.location.href="/logout"}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.g),t.Y36(Window),t.Y36(d.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["isw-success"]],features:[t.qOj],decls:7,vars:4,consts:[[1,"container","text-center","mt-5"],[3,"src"],[1,"heading"],[1,"text-container"],[3,"innerHTML"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"img",1),t.TgZ(2,"h3",2),t._uU(3),t.qZA(),t.TgZ(4,"div",3),t._UZ(5,"p",4)(6,"p",4),t.qZA()()),2&e&&(t.xp6(1),t.Q6J("src",o.window.MagicRevision+"assets/undraw_launch.svg",t.LSH),t.xp6(2),t.hij(" ",o.locale.maketext("15-day free Trial License Activated")," "),t.xp6(2),t.Q6J("innerHTML",o.locale.maketext("We successfully activated your trial license. You should be able to use [asis,cPanel amp() WHM] with no limitations for the next 15 days."),t.oJD),t.xp6(1),t.Q6J("innerHTML",o.locale.maketext("Make sure to upgrade your license within 15 days to continue using [asis,cPanel amp() WHM] on your server."),t.oJD))},styles:[".text-container[_ngcontent-%COMP%]{max-width:30em;margin:auto;font-weight:300;color:var(--bs-gray-800)}html[dir=ltr][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%]{text-align:left}html[dir=rtl][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%]{text-align:right}.centered-container[_ngcontent-%COMP%]{height:calc(100vh - 9em);display:flex;align-items:center;justify-content:center}.heading[_ngcontent-%COMP%]{color:var(--cp-primary-action-color);font-weight:700}"]}),n})();var s=i(4719);function U(n,a){if(1&n&&(t.TgZ(0,"div",12),t._UZ(1,"cp-icon",13)(2,"div",14),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("innerHTML",e.error,t.oJD)}}function E(n,a){if(1&n&&(t.TgZ(0,"div",15),t._UZ(1,"i",16),t._uU(2),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("You must enter a verification code.")," ")}}const F=[{path:"",component:J},{path:"success",component:S},{path:"email-verification",component:(()=>{class n extends M.h{constructor(e,o,g,p,h){super(e),this.locale=e,this.window=o,this.store=g,this.router=p,this.continueLabel=this.locale.maketext("Verify My Email"),this.form=h.group({verification_code:h.control("",[s.kI.required])}),this.form.controls.verification_code.statusChanges.subscribe(r=>this.canContinue="VALID"===r),this.store.errormsg$.subscribe(r=>{this.error=r})}ngOnInit(){}next(){this.form.markAllAsTouched(),!this.form.invalid&&(this.loading=!0,this.store.acquireTrialLicense({verification_code:this.form.controls.verification_code.value}).pipe((0,f.zg)(this.store.updateLicense),(0,u.b)(e=>this.router.navigate(["trial-activation","success"])),(0,O.K)(()=>(0,w.of)([]))).subscribe())}cancel(){this.window.location.href="/logout"}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.g),t.Y36(Window),t.Y36(v),t.Y36(d.F0),t.Y36(s.qu))},n.\u0275cmp=t.Xpm({type:n,selectors:[["isw-email-verification"]],features:[t.qOj],decls:16,vars:8,consts:[[1,"container","text-center","mt-5"],[3,"src"],[1,"text-container"],["class","cp-alert cp-alert-error",4,"ngIf"],[1,"heading"],[3,"innerHTML"],[3,"formGroup","ngSubmit"],[1,"form-group"],["for","email"],["formControlName","verification_code","id","verification-code","type","text"],["class","invalid-feedback",4,"ngIf"],["type","submit",1,"sr-only"],[1,"cp-alert","cp-alert-error"],["name","information-fill","size","xl",1,"cp-alert__icon"],[1,"cp-alert__message",3,"innerHTML"],[1,"invalid-feedback"],["aria-hidden","true",1,"ri-error-warning-line"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"img",1),t.TgZ(2,"div",2),t.YNc(3,U,3,1,"div",3),t.qZA(),t.TgZ(4,"h3",4),t._uU(5),t.qZA(),t.TgZ(6,"div",2),t._UZ(7,"p",5),t.TgZ(8,"form",6),t.NdJ("ngSubmit",function(){return o.next()}),t.TgZ(9,"div",7)(10,"label",8),t._uU(11),t.qZA(),t._UZ(12,"input",9),t.YNc(13,E,3,1,"div",10),t.qZA(),t.TgZ(14,"button",11),t._uU(15),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("src",o.window.MagicRevision+"assets/undraw_subscriber.svg",t.LSH),t.xp6(2),t.Q6J("ngIf",o.error),t.xp6(2),t.hij(" ",o.locale.maketext("Verify Email Address to Activate Free Trial")," "),t.xp6(2),t.Q6J("innerHTML",o.locale.maketext("The cPanel Store sent a verification code to [output,strong,_1]. Check your inbox. If you don\u2019t see it, you may need to check your spam folder.","john.doe@example.com"),t.oJD),t.xp6(1),t.Q6J("formGroup",o.form),t.xp6(3),t.Oqu(o.locale.maketext("Verification Code")),t.xp6(2),t.Q6J("ngIf",o.form.controls.verification_code.invalid&&o.form.controls.verification_code.touched),t.xp6(2),t.Oqu(o.continueLabel))},directives:[P.O5,s._Y,s.JL,s.sg,s.Fj,s.JJ,s.u],styles:["img[_ngcontent-%COMP%]{max-height:280px}.form-group[_ngcontent-%COMP%]{width:100%;font-size:.9em}html[dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%]{text-align:left}html[dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%]{text-align:right}.form-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{margin:var(--cp-spacer-2) 0}.form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-weight:400}html[dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{float:right}html[dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{float:left}.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;width:100%;border-radius:var(--cp-spacer-1);border:1px solid var(--bs-gray-400);padding:var(--cp-spacer-2)}.form-group[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{width:100%;flex-wrap:nowrap;margin:var(--cp-spacer-2) 0}.form-group[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .btn.btn-outline-secondary[_ngcontent-%COMP%]{background-color:var(--bs-gray-300)}.form-group[_ngcontent-%COMP%] .optional[_ngcontent-%COMP%]{color:var(--bs-gray-600);font-weight:300}.form-group[_ngcontent-%COMP%] .help-text[_ngcontent-%COMP%]{display:block;color:var(--bs-gray-600);font-weight:lighter}.text-container[_ngcontent-%COMP%]{max-width:30em;margin:auto;font-weight:300;color:var(--bs-gray-800)}html[dir=ltr][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%]{text-align:left}html[dir=rtl][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .text-container[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .text-container[_ngcontent-%COMP%]{text-align:right}.centered-container[_ngcontent-%COMP%]{height:calc(100vh - 9em);display:flex;align-items:center;justify-content:center}.heading[_ngcontent-%COMP%]{color:var(--cp-primary-action-color);font-weight:700}.invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),n})()}];let H=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[v],imports:[[P.ez,d.Bz.forChild(F),s.UX]]}),n})()}}]);