1"use strict";(self.webpackChunkroot=self.webpackChunkroot||[]).push([[139],{51660:(e,t,a)=>{a.r(t),a.d(t,{CreateAccountPage:()=>i,CreateAccountPageContext:()=>l,default:()=>o});var s=a(4301),r=a(38126),n=a(77668),c=a(96540);const i=({id:e})=>((0,c.useEffect)((()=>{((0,n.A)(window.navigator).apple.tablet||(0,n.A)(window.navigator).apple.phone)&&function(){const e=document.querySelector("meta[name=viewport]");if(null!==e){let t=e.getAttribute("content");const a=/maximum\-scale=[0-9\.]+/g;t=a.test(t)?t.replace(a,"maximum-scale=1.0"):[t,"maximum-scale=1.0"].join(", "),e.setAttribute("content",t)}}()}),[]),c.createElement(r.A,null,c.createElement(s.A,{zoneName:"Content",contentId:e}))),o={component:i,definition:{hasEditableUrlSegment:!0,hasEditableTitle:!0,pageType:"System"}},l="CreateAccountPage"},98058:(e,t,a)=>{a.r(t),a.d(t,{createAccountStyles:()=>B,default:()=>L});var s=a(17126),r=a(28701),n=a(87446),c=a(31374),i=a(61696),o=a(62872),l=a(28887),u=a(97994),d=a(16643),m=a(73380),A=a(87406),p=a(94266),g=a(24881),w=a(88055),b=a.n(w);const h=[async e=>{const{value:t}=(0,g.vs)(e.getState());if(e.currentUserIsGuest=(0,l.VM)(e.getState()),e.currentUserIsGuest){if(!t)throw new Error("The cart is not loaded. Try reloading the page.");if(t.lineCount>0){const e=b()(t);e.unassignCart=!0,await(0,m.iH)({cart:e})}}},async e=>{e.currentUserIsGuest&&(await(0,A.ME)(),e.dispatch({type:"Context/DeleteSession"}))},e=>{e.apiParameter={account:Object.assign({},e.parameter)}},async e=>{(0,A.Gr)(),e.apiResult=await(0,d.F7)(e.apiParameter),(0,A.UW)()},e=>{e.currentUserIsGuest&&(e.apiResult.successful&&"Activated"===e.apiResult.result.activationStatus||e.dispatch((0,p.Ay)({isSessionUpdate:!0})))},e=>{var t,a;e.apiResult.successful||((0,n.bz)(e),null===(a=(t=e.parameter).onError)||void 0===a||a.call(t,e.apiResult.errorMessage))},e=>{var t,a;e.apiResult.successful&&((0,n.a1)(e),null===(a=(t=e.parameter).onSuccess)||void 0===a||a.call(t,e.apiResult.result))}],v=(0,n.u3)(h,"AddAccount");var y=a(45507),E=a(4411);function f(e){var t,a;const s=(0,E.ez)(e),r=null===(t=(0,y.U)(e,"ChangeCustomerPage"))||void 0===t?void 0:t.url,n=null===(a=(0,y.U)(e,"OrderConfirmationPage"))||void 0===a?void 0:a.url,c=n&&s&&s.indexOf(n)>-1;return s===r||c?(0,y.sv)(e):s}var C=a(73746),I=a(98066),S=a(2804),j=a(66549),O=a(38816),G=a(41481),x=a(41118),R=a(98021),P=a(5030),T=a(22406),q=a(53492),_=a(39881),N=a(23573),U=a(76895),H=a(96540),k=a(71468),M=a(73802);const F={addAccount:v,signIn:u.Ay,validatePassword:i.Ay,validateReCaptcha:(0,n.O2)(o.Ay)},B={centeringWrapper:{css:M.AH`display:flex;height:300px;justify-content:center;align-items:center;`},userGridItem:{width:[12,12,6,6,6],css:M.AH`flex-direction:column;${({theme:e})=>(0,N.Ay)(e,[null,null,M.AH` 2 padding-left: 100px; 3 `],"min")}`},userGridContainer:{css:M.AH`${({theme:e})=>(0,N.Ay)(e,[null,null,M.AH` 4 max-width: 300px; 5 `],"min")}`},emailGridItem:{width:12},userNameGridItem:{width:12},passwordGridItem:{width:12},confirmPasswordGridItem:{width:12},subscriptionGridItem:{width:12},submitErrorGridItem:{width:12},submitErrorTitle:{color:"danger"},reCaptchaGridItem:{width:12},submitGridItem:{width:12,css:M.AH`justify-content:flex-end;`},requirementsGridItem:{width:[12,12,6,6,6],css:M.AH`flex-direction:column;${({theme:e})=>(0,N.Ay)(e,[null,null,M.AH` 6 padding-left: 50px; 7 `],"min")}`},passwordRequirementsGridContainer:{gap:5},passwordRequirementsGridItem:{width:12},requirementsTitle:{variant:"h4",as:"h2"},activationInstructionGridItem:{width:[12,12,6,6,6],css:M.AH`flex-direction:column;${({theme:e})=>(0,N.Ay)(e,[null,null,M.AH` 8 padding-left: 50px; 9 `],"min")}`},activationSuccessWrapper:{css:M.AH`display:flex;flex-direction:column;${({theme:e})=>(0,N.Ay)(e,[null,null,null,M.AH` 10 width: 50%; 11 `],"min")}`},activationSuccessTitleText:{variant:"h3"},activationSuccessHomeButton:{css:M.AH`align-self:flex-end;`}},$=B,D=(0,s.v)("form"),L={component:(0,k.Ng)((e=>({accountSettings:(0,l.SB)(e).accountSettings,returnUrl:f(e),homePageUrl:(0,y.sv)(e),reCaptchaEnabledForCreateAccount:(0,l.SB)(e).websiteSettings.reCaptchaEnabledForCreateAccount})),F)((0,U.$k)((({addAccount:e,signIn:t,validatePassword:a,validateReCaptcha:n,accountSettings:i,returnUrl:o,history:l,homePageUrl:u,reCaptchaEnabledForCreateAccount:d})=>{const m=(0,c.Ay)("CreateNewAccountInfo_UserName_Required"),A=(0,c.Ay)("CreateNewAccountInfo_EmailAddress_Required"),p=(0,c.Ay)("CreateNewAccountInfo_EmailAddress_ValidEmail"),[g,w]=(0,H.useState)(""),[b,h]=(0,H.useState)(""),[v,y]=(0,H.useState)(i.useEmailAsUserName?"":m),[E,f]=(0,H.useState)(""),[N,U]=(0,H.useState)(""),[k,M]=(0,H.useState)(""),[F,B]=(0,H.useState)(""),[L,W]=(0,H.useState)(""),[z,V]=(0,H.useState)(!1),[J,K]=(0,H.useState)(!1),[Q,X]=(0,H.useState)(!1),[Y,Z]=(0,H.useState)(!1),[ee,te]=(0,H.useState)(!1),[ae,se]=(0,H.useState)(!1),[re,ne]=(0,H.useState)(A),ce=(0,H.useContext)(q.Ay),ie=H.createRef(),{passwordMinimumLength:oe,passwordRequiresUppercase:le,passwordRequiresSpecialCharacter:ue,passwordRequiresLowercase:de,passwordRequiresDigit:me,useEmailAsUserName:Ae,requireActivateAccount:pe}=i,ge=(e,t)=>
11{const a=e!==t?(0,c.Ay)("CreateNewAccountInfo_PasswordCombination_DoesNotMatch"):"";return W(a),!a},we=()=>!(re||k||L||v),be=e=>{f(""),ce.addToast({body:(0,C.Ay)("Account created successfully!"),messageType:"success"}),"Activated"===(null==e?void 0:e.activationStatus)?setTimeout((()=>{t({userName:Ae?g:b,password:N,rememberMe:!1,returnUrl:o})}),500):se(!0)};if(ae)return H.createElement(s.A,Object.assign({},$.activationSuccessWrapper),H.createElement(_.A,Object.assign({as:"h2"},$.activationSuccessTitleText),(0,C.Ay)("Check your email")),H.createElement(_.A,Object.assign({},$.activationSuccessMessageText),(0,c.Ay)("CreateNewAccountInfo_AccountActivation_SuccessMessage")),H.createElement(S.Ay,Object.assign({},$.activationSuccessHomeButton,{onClick:()=>{l.push(u)},"data-test-selector":"createAccount_BackToHomePage"}),(0,C.Ay)("Home")));const he=we();return H.createElement(D,Object.assign({},$.form,{onSubmit:async t=>{t.preventDefault(),Y||Z(!0),we()&&await n({location:"CreateAccount",recaptchaRef:ie})&&(te(!0),e({email:g,userName:b,password:N,isSubscribed:Q,onSuccess:be,onError:e=>{f(e),te(!1)},onComplete(e){var t,a,s,r;(null===(t=e.apiResult)||void 0===t?void 0:t.successful)?null===(a=this.onSuccess)||void 0===a||a.call(this,e.apiResult.result):(null===(s=e.apiResult)||void 0===s?void 0:s.errorMessage)&&(null===(r=this.onError)||void 0===r||r.call(this,e.apiResult.errorMessage))}}))},noValidate:!0}),H.createElement(G.Ay,Object.assign({},$.mainGridContainer),H.createElement(x.A,Object.assign({},$.userGridItem),H.createElement(G.Ay,Object.assign({},$.userGridContainer),H.createElement(x.A,Object.assign({},$.emailGridItem),H.createElement(T.A,Object.assign({},$.emailTextField,{type:"email",label:(0,C.Ay)("Email Address"),onChange:e=>(e=>{const t=e?(0,r.A)(e)?"":p:A;ne(t),w(e)})(e.currentTarget.value),value:g,"data-test-selector":"createAccount_email",maxLength:256,required:!0,error:Y&&re}))),!Ae&&H.createElement(x.A,Object.assign({},$.userNameGridItem),H.createElement(T.A,Object.assign({},$.userNameTextField,{label:(0,C.Ay)("User Name"),value:b,"data-test-selector":"createAccount_userName",onChange:e=>{return(e=>{y(e||Ae?"":m)})(t=e.currentTarget.value),void h(t);var t},error:Y&&v,maxLength:256,required:!0}))),!pe&&H.createElement(H.Fragment,null,H.createElement(x.A,Object.assign({},$.passwordGridItem),H.createElement(T.A,Object.assign({id:"password"},$.passwordTextField,{type:z?void 0:"password",label:(0,C.Ay)("Password"),value:N,onChange:e=>{return t=e.currentTarget.value,ge(t,F),a({password:t,onComplete:e=>{M(e)}}),void U(t);var t},error:Y&&k,iconProps:Object.assign(Object.assign({},$.passwordIcon),{src:z?P.default:R.default}),iconClickableProps:{onClick:()=>{V(!z)},type:"button"},clickableText:N,"data-test-selector":"createAccount_password",required:!0}))),H.createElement(x.A,Object.assign({},$.confirmPasswordGridItem),H.createElement(T.A,Object.assign({id:"confirm-password"},$.confirmPasswordTextField,{type:J?void 0:"password",label:(0,C.Ay)("Confirm Password"),value:F,onChange:e=>{return t=e.currentTarget.value,B(t),void ge(N,t);var t},error:Y&&L,iconProps:Object.assign(Object.assign({},$.confirmPasswordIcon),{src:J?P.default:R.default}),iconClickableProps:{onClick:()=>{K(!J)},type:"button"},clickableText:F,"data-test-selector":"createAccount_confirmPassword",required:!0})))),H.createElement(x.A,Object.assign({},$.subscriptionGridItem),H.createElement(O.A,null,H.createElement(j.Ay,{onChange:(e,t)=>
11X(t),checked:Q,"data-test-selector":"createAccount_Subscription"},(0,c.Ay)("SignIn_Sign_Up_Newsletter")))),E&&H.createElement(x.A,Object.assign({"data-test-selector":"createAccount_ErrorMessage"},$.submitErrorGridItem),H.createElement(_.A,Object.assign({},$.submitErrorTitle),E)),d&&H.createElement(x.A,Object.assign({},$.reCaptchaGridItem),H.createElement(I.A,{recaptchaRef:ie,location:"CreateAccount"})),H.createElement(x.A,Object.assign({},$.submitGridItem),H.createElement(S.Ay,Object.assign({},$.submitButton,{type:"submit",disabled:ee||Y&&!he,"data-test-selector":"createAccount_createButton"}),(0,C.Ay)("Create"))))),pe?H.createElement(x.A,Object.assign({},$.activationInstructionGridItem),H.createElement(_.A,Object.assign({},$.activationInstructionText,{"data-test-selector":"createAccount_AccountActivation_Instruction"}),(0,c.Ay)("CreateNewAccountInfo_AccountActivation_Instruction"))):H.createElement(x.A,Object.assign({},$.requirementsGridItem),H.createElement(_.A,Object.assign({},$.requirementsTitle,{"data-test-selector":"createAccount_passwordRequirements"}),(0,C.Ay)("Password Requirements")),H.createElement(G.Ay,Object.assign({},$.passwordRequirementsGridContainer),H.createElement(x.A,Object.assign({},$.passwordRequirementsGridItem),(0,C.Ay)("Password must be at least {0} characters long",oe.toString())),me&&H.createElement(x.A,Object.assign({},$.passwordRequirementsGridItem),(0,C.Ay)("Password must include at least one number")),de&&H.createElement(x.A,Object.assign({},$.passwordRequirementsGridItem),(0,C.Ay)("Password must include at least one lowercase character")),le&&H.createElement(x.A,Object.assign({},$.passwordRequirementsGridItem),(0,C.Ay)("Password must include at least one uppercase character")),ue&&H.createElement(x.A,Object.assign({},$.passwordRequirementsGridItem),(0,C.Ay)("Password must include at least one non alphanumeric character"))))))}))),definition:{allowedContexts:["CreateAccountPage"],group:"Create Account"}}}}]); 12//# sourceMappingURL=createaccountChunk_aa70e772d893c3031086.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.