1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[314],{79019:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/settings/phone",function(){return r(6774)}])},44316:function(e,n,r){"use strict";r.d(n,{Z:function(){return c}});var i=r(85893),t=r(40645),o=r.n(t),a=r(45697),s=r.n(a);let l="form {\n display: flex;\n flex-flow: column nowrap;\n gap: 1rem;\n}";function c(e){let{className:n,onSubmit:r,children:t,styles:a="",useDefaultStyling:s=!0}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("form",{onSubmit:r,autoComplete:"off",className:o().dynamic([["e1379c394ee0fa70",[s?l:"",a]]])+" "+"".concat(null!=n?n:""),children:t}),(0,i.jsx)(o(),{id:"e1379c394ee0fa70",dynamic:[s?l:"",a],children:"".concat(s?l:"","\n ").concat(a,"\n ")})]})}c.propTypes={className:s().string,onSubmit:s().func.isRequired,children:s().node.isRequired,styles:s().string,useDefaultStyling:s().bool}},26793:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var i=r(85893),t=r(40645),o=r.n(t),a=r(29579),s=r(67628),l=r(45697),c=r.n(l);function u(e){let{id:n,register:r,children:t,rules:l={},errorMessage:c="",...u}=e;return(0,i.jsxs)("span",{className:"jsx-25ecb5617c9368c7",children:[(0,i.jsxs)(s.Z,{htmlFor:n,"data-qa":"".concat(n,"-label"),className:"checkboxLabel",children:[(0,i.jsx)("input",{id:n,type:"checkbox",...r(n,l),...u,className:"jsx-25ecb5617c9368c7 "+(u&&null!=u.className&&u.className||"")}),t]}),!!c&&(0,i.jsx)(a.Z,{children:c}),(0,i.jsx)(o(),{id:"25ecb5617c9368c7",children:".checkboxLabel,input.jsx-25ecb5617c9368c7{cursor:pointer}.checkboxLabel{display:block;padding-left:32px;text-indent:-29px;margin-bottom:8px}input.jsx-25ecb5617c9368c7{width:18px;height:18px;accent-color:var(--color-primary);margin-right:1ch;vertical-align:middle}input.jsx-25ecb5617c9368c7:disabled+label.jsx-25ecb5617c9368c7 .labelText.jsx-25ecb5617c9368c7{color:var(--gray-600)}"})]})}u.propTypes={id:c().string.isRequired,register:c().any.isRequired,rules:c().object,children:c().node,type:c().string,errorMessage:c().string}},6774:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSG:function(){return M},default:function(){return q}});var i=r(85893),t=r(40645),o=r.n(t),a=r(67294),s=r(43287),l=r(4162),c=r(51607),u=r(73775),d=r(80289),m=r(1761),p=r(50319),h=r(24414),b=r(87536),f=r(93108),x=r(28897),g=r(19364),v=r(44316);let N=e=>{if(!e)return"";let n=e.replace(/\D/g,"");return 10===n.length?"".concat(n.slice(0,3),"-").concat(n.slice(3,6),"-").concat(n.slice(6)):e},j=e=>{if(!e||e.length<4)return e;let n=e.replace(/\D/g,"");return"***-***-".concat(n.slice(-4))};var y=r(61922);function S(e){var n;let{phoneNumber:r,confirmSMSVerificationCode:t,setErrorMessage:a,errorMessage:s,sendSMSVerificationCode:l,emailAddress:c,confirmSMSVerificationCodeLoading:u}=e,{handleSubmit:d,register:m,formState:{errors:p,isValid:h},setValue:S,getValues:C}=(0,b.cI)({defaultValues:{verificationCode:""}});return(0,i.jsxs)("div",{className:"jsx-2df4e4186f7679f6 layout",children:[(0,i.jsx)("h1",{"data-qa":"verifyPhoneNumberTitle",className:"jsx-2df4e4186f7679f6 h4 marginTop--0",children:"Verify Phone Number"}),(0,i.jsxs)("p",{"data-qa":"verifyPhoneNumberMessage",className:"jsx-2df4e4186f7679f6",children:["A verification code has been sent to ",j(r),"."]}),(0,i.jsxs)(v.Z,{onSubmit:d(e=>{let{verificationCode:n}=e;a(""),t({variables:{input:{phoneNumber:N(r),emailAddress:c,confirmationCode:n}}})}),className:"submitVerificationCodeForm",children:[(0,i.jsx)(x.Z,{label:"Enter Verification Code",id:"verificationCode",register:m,rules:{required:"Verification code is required.",pattern:{value:/^\d{6}$/,message:"Verification code must be a 6-digit number."}},onBlur:()=>(0,g.h)("verificationCode",C,S),errorMessage:(null==p?void 0:null===(n=p.verificationCode)||void 0===n?void 0:n.message)||s}),(0,i.jsx)("div",{className:"jsx-2df4e4186f7679f6 resendPhoneNumberButtonContainer",children:(0,i.jsx)(f.z,{type:"button",variant:"link",name:"resendPhoneNumberButton","data-qa":"resendPhoneNumberButton",className:"resendPhoneNumberButton",isDisabled:u,onClick:()=>{a(""),l({variables:{input:{phoneNumber:N(r),emailAddress:c}}})},children:"Resend code"})}),(0,i.jsx)("div",{className:"jsx-2df4e4186f7679f6 buttonContainer",children:(0,i.jsx)(f.z,{name:"verifySMSCodeButton",type:"submit",variant:"primary",size:"md","data-qa":"verifySMSCodeButton",className:"verifySMSCodeButton",isLoading:u,spinner:(0,i.jsx)(y.ZP,{spotSize:10}),isDisabled:u||!h,children:"Submit Code"})})]}),(0,i.jsx)(o(),{id:"2df4e4186f7679f6",children:".resendPhoneNumberButtonContainer.jsx-2df4e4186f7679f6{margin-top:-14px;margin-bottom:-2px}"})]})}var C=r(94373),w=r(26793);let E=/^\(\d{3}\) \d{3}-\d{4}$/;function P(e){var n;
1let{title:r,description:t,subDescription:o=null,defaultValue:s="",formatOnChange:l,onSubmit:c,setErrorMessage:u,errorMessage:d,loadingStates:m=[],consentText:p=null,inputLabelText:h="Phone Number",buttonLabel:N="Save and Send Code",infoText:j=null}=e,[S,C]=(0,a.useState)(!1),[P,T]=(0,a.useState)(!0),{handleSubmit:k,register:M,formState:{errors:q,isValid:V},setValue:B,getValues:Z}=(0,b.cI)({defaultValues:{phoneNumber:s}});return(0,i.jsxs)("div",{className:"layout",children:[(0,i.jsx)("h1",{"data-qa":"updatePhoneNumberFormTitle",className:"h4 marginTop--0",children:r}),t&&(0,i.jsxs)("p",{children:[t,o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("br",{}),(0,i.jsx)("span",{"data-qa":"subDescription",children:o})]})]}),(0,i.jsxs)(v.Z,{onSubmit:k(e=>{u(""),c(e.phoneNumber)}),className:"genericUpdatePhoneNumberForm",children:[(0,i.jsx)(x.Z,{label:h,"data-qa":"phoneNumberInput",id:"phoneNumber",type:"tel",register:M,rules:{required:"Phone number is required.",pattern:{value:E,message:"Must be a valid US phone number (XXX) XXX-XXXX."}},onBlur:()=>(0,g.h)("phoneNumber",Z,B),errorMessage:(null==q?void 0:null===(n=q.phoneNumber)||void 0===n?void 0:n.message)||d,onChange:e=>{let n=l(e.target.value);E.test(n)?(B("phoneNumber",n,{shouldValidate:!0}),C(!1)):(B("phoneNumber",n),C(!0))}}),j&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("span",{className:"textUnderInput","data-qa":"infoText",children:j})}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{className:"textUnderInput","data-qa":"consentText",children:p}),(0,i.jsx)("div",{className:"signupCheckboxContainer",children:(0,i.jsx)(w.Z,{id:"smsConsent",register:M,checked:P,className:"signupCheckbox",onChange:()=>T(!P),children:"Sign me up to receive Text Notifications (SMS)"})})]}),(0,i.jsx)("div",{className:"buttonContainer",children:(0,i.jsx)(f.z,{type:"submit",variant:"primary",size:"md",spinner:(0,i.jsx)(y.ZP,{spotSize:10}),className:"phoneNumberButton",isLoading:m.some(Boolean),"data-qa":"formSubmitButton",isDisabled:m.some(Boolean)||!V||S||p&&!P,children:N})})]})]})}var T=r(53658);let k={CodeMismatchException:"The verification code you entered is incorrect.",MaxRetryReachException:"You have reached the maximum number of attempts. Please click `Resend code` to receive a new code and try again.",PhoneNumberExistVerifiedException:"That phone number is already verified for this account."};var M=!0;function q(e){let{page:n}=e,{isSignedIn:r,telephone:t,emailAddress:b}=(0,s.SE)(),[f,x]=(0,a.useState)(""),[g,v]=(0,a.useState)(""),[y,w]=(0,a.useState)(!1),[E,M]=(0,a.useState)(!1),q=t&&"phoneNumber"in t?t.phoneNumber:void 0,V=null==t?void 0:t.verified,B=t&&(null==t?void 0:t.phoneNumber),[Z,{loading:_}]=(0,p.D)(h.bi,{onCompleted:()=>{x(q),w(!0)},onError:e=>{var n;return v(null==e?void 0:null===(n=e.graphQLErrors[0])||void 0===n?void 0:n.message)}}),[D,{loading:L}]=(0,p.D)(h.yA,{onCompleted:()=>{x(q),w(!1),M(!0)},onError:e=>{let n=null==e?void 0:e.graphQLErrors[0];v(((null==n?void 0:n.errorType)?k[n.errorType]||n.message:"Error confirming verification code.")||"Error confirming verification code.")},refetchQueries:[{query:T.x}]}),[z,{loading:X}]=(0,p.D)(h.rJ,{onCompleted:e=>{var n,r;x((null==e?void 0:null===(r=e.updatePhoneNumber)||void 0===r?void 0:null===(n=r.telephone)||void 0===n?void 0:n.phoneNumber)||q),w(!0)},onError:e=>{let n=null==e?void 0:e.graphQLErrors[0];v((null==n?void 0:n.errorType)?k[n.errorType]||n.message:"Error updating phone number.")},refetchQueries:[{query:T.x}]});if(!r)return(0,l.Eu)(),null;let F=e=>{let n=e.replace(/\D/g,""),r=n;return n.length>6?r="(".concat(n.slice(0,3),") ").concat(n.slice(3,6),"-").concat(n.slice(6,10)):n.length>3?r="(".concat(n.slice(0,3),") ").concat(n.slice(3)):n.length>0&&(r="(".concat(n.slice(0,3))),r},R=e=>{z({variables:{input:{phoneNumber:N(e)}}})},U="Current number: ".concat(j(q)),A="Stay informed about your loved one's page and receive helpful resources directly to your mobile phone. Your phone number will only be used for account-related purposes. We will never sell or use it for marketing. Text STOP to unsubscribe to account-related messages. Message and data rates may apply.";return(0,i.jsx)(u.fc,{value:{page:n},children:(0,i.jsx)(d.Z,{children:(0,i.jsx)(c.Z,{nav:(0,i.jsx)(m.S,{}),children:(0,i.jsxs)(i.Fragment,{children:[E&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{"data-qa":"successTitle",className:"jsx-27fe217c2d858869 h4 marginTop--0",children:"Success"}),(0,i.jsxs)(C.Z,{"data-qa":"successMessage",children:["Your phone number ",N(f)," has been verified."]})]}),y&&(0,i.jsx)(S,{phoneNumber:f,confirmSMSVerificationCode:D,setErrorMessage:v,errorMessage:g,sendSMSVerificationCode:Z,emailAddress:b,confirmSMSVerificationCodeLoading:L}),q&&!V&&!y&&!E&&(0,i.jsx)(P,{title:"Verify Phone Number",description:"Your current phone number is unverified. Please confirm the phone number below and submit to receive the verification code.",defaultValue:F(q),formatOnChange:F,onSubmit:e=>{let n=N(e);N(q)!==n?z({variables:{input:{phoneNumber:n}}}):Z({variables:{input:{phoneNumber:n,emailAddress:b}}})},setErrorMessage:v,errorMessage:g,loadingStates:[X,_],consentText:A}),q&&V&&!y&&!E&&(0,i.jsx)(P,{title:"Update Phone Number",description:"Enter your new number and we will send a verification code.",subDescription:U,defaultValue:"",inputLabelText:"Enter New Phone Number",formatOnChange:F,onSubmit:R,setErrorMessage:v,errorMessage:g,loadingStates:[X],infoText:"Your phone number will only be used for profile-related purposes."}),!B&&!y&&!E&&(0,i.jsx)(P,{title:"Add Phone Number",description:"Enter your phone number and we will send a verification code.",defaultValue:"",inputLabelText:"Enter Phone Number",formatOnChange:F,onSubmit:R,setErrorMessage:v,errorMessage:g,loadingStates:[X],consentText:A}),(0,i.jsx)(o(),{id:"27fe217c2d858869",children:".layout{max-width:440px!important;margin:0 auto}.genericUpdatePhoneNumberForm{margin-top:-10px}form label{font-weight:500;font-size:16px}.phoneNumberButton{min-width:220px}
1.textUnderInput{font-size:14px;margin-top:-2px;margin-bottom:2px}.signupCheckboxContainer{margin-top:10px;margin-bottom:10px}.buttonContainer{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;width:44%}"})]})})})})}},86566:function(e,n,r){"use strict";r.d(n,{Z:function(){return t}});var i=r(67294);function t(e,n,r){if(r&&!Array.isArray(r))throw Error("When passing effectDependencies into useKeystroke it must be an array.");(0,i.useEffect)(()=>{let r=r=>{!r.repeat&&[].concat(e).includes(r.key)&&n(r)};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}},[e,n,...null!=r?r:[]])}}},function(e){e.O(0,[7536,1445,639,4319,2888,9774,179],function(){return e(e.s=79019)}),_N_E=e.O()}]);
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.