1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1040],{13137:(e,r,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[locale]/users/change-password",function(){return n(51918)}])},14352:(e,r,n)=>{"use strict";n.d(r,{s:()=>c});var s=n(44033),t=n(28613),i=n(36893),a=n(34751),o=n(37146);function l(e,r){[...r].reverse().forEach(n=>{let s=e.getVariant(n);s&&(0,i.U)(e,s),e.variantChildren&&e.variantChildren.forEach(e=>{l(e,r)})})}function d(){let e=!1,r=new Set,n={subscribe:e=>(r.add(e),()=>void r.delete(e)),start(n,s){(0,o.V)(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");let t=[];return r.forEach(e=>{t.push((0,a._)(e,n,{transitionOverride:s}))}),Promise.all(t)},set:n=>((0,o.V)(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),r.forEach(e=>{var r,s;r=e,Array.isArray(s=n)?l(r,s):"string"==typeof s?l(r,[s]):(0,i.U)(r,s)})),stop(){r.forEach(e=>{e.values.forEach(e=>e.stop())})},mount:()=>(e=!0,()=>{e=!1,n.stop()})};return n}let c=function(){let e=(0,s.M)(d);return(0,t.E)(e.mount,[]),e}},27636:(e,r,n)=>{"use strict";n.d(r,{Z:()=>i});var s=n(55729);let t=n(79945).Ay.div.withConfig({displayName:"center__StyledCenterContainer",componentId:"p-ui__sc-398lf7-0"})(["display:flex;align-items:center;flex-direction:column;flex:1;max-width:71.8rem;width:100%;"]);function i({children:e}){return s.createElement(t,null,e)}},37212:(e,r,n)=>{"use strict";n.d(r,{Xb:()=>l,m0:()=>o,mU:()=>a});var s=n(62968),t=n(74214);let i=navigator.userAgent||navigator.vendor;function a(){return/iphone/i.test(i)||(0,s.vs)(i)}function o(){return/android/i.test(i)||(0,t.f1)(i)}function l(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i)||a()||o()}},49052:(e,r,n)=>{"use strict";function s(e,r,n){return!e||void 0===r||e[n]||r}function t(e,r,n,t){return e[r]&&s(n,t,r)?"error":"none"}function i(e){return r=>t(e.errors,r,e.touchedFields,e.isSubmitted)}function a(e,r,n,s){if(e)for(let n of r){let r=e[n];if(r&&r.message)return r.message}return"error"===n&&s||null}function o(e,r){let n=e.errors[r];if(n?.message&&s(e.touchedFields,e.isSubmitted,r))return"string"==typeof n.message?n.message:void 0}n.d(r,{FV:()=>i,f1:()=>a,hG:()=>o,wK:()=>t})},51918:(e,r,n)=>{"use strict";n.r(r),n.d(r,{__N_SSP:()=>k,default:()=>C});var s=n(6029),t=n(55729),i=n(78128),a=n(27636),o=n(36689),l=n(88239),d=n(69018),c=n(52251),u=n(70499),h=n(40561),f=n(51595),m=n(1909),w=n(58655),g=n(45269),p=n(80200),x=n(97952),v=n(87798),j=n(46128),b=n(49052);function _({onSubmitted:e,status:r,changePasswordError:n}){let{register:t,handleSubmit:i,formState:{errors:a},watch:l}=(0,m.mN)({mode:"onSubmit"}),d=(0,f.c)("change-password"),c=(0,f.c)("edit"),u=t("newPassword",{minLength:{value:6,message:"minLength"}}),h=t("confirmNewPassword",{validate:e=>e===l("newPassword")||"confirmPassword"});return(0,s.jsxs)(w.M,{onSubmit:e?i(e):void 0,children:[(0,s.jsx)(g.K,{children:(0,s.jsx)(y,{errors:a,status:r,changePasswordError:n})}),(0,s.jsxs)(o.S,{size:"larger",children:[(0,s.jsx)(p.K,{children:(0,s.jsx)(x.y,{label:d("new-password-label"),validationStatus:(0,b.wK)(a,"newPassword"),message:a.newPassword?.message||c("password-placeholder"),...u})}),(0,s.jsx)(p.K,{children:(0,s.jsx)(x.y,{label:d("confirm-new-password-label"),validationStatus:(0,b.wK)(a,"confirmNewPassword"),message:a.confirmNewPassword?.message,...h})})]}),(0,s.jsx)(o.S,{size:"larger",children:(0,s.jsx)(v.$,{type:"primary",submit:!0,children:d("change-password-button")})})]})}function y({errors:e,status:r,changePasswordError:n}){let t=(0,f.c)("change-password"),i=(0,f.c)("forms"),a=e=>(0,s.jsx)(j.E,{href:"/reset-password",children:e});if(e?.newPassword?.message)return(0,s.jsx)(s.Fragment,{children:i("error-minimum",{label:t("new-password-label"),num:6})});if(e?.confirmNewPassword?.message)return(0,s.jsx)(s.Fragment,{children:i("error-confirm",{label:t("new-password-label")})});if("error"===r)switch(n){case"token_invalid":return(0,s.jsx)(s.Fragment,{children:t.rich("invalid-token-error",{link:a})});case"token_expired":return(0,s.jsx)(s.Fragment,{children:t.rich("expired-token-error",{link:a})});default:return(0,s.jsx)(s.Fragment,{children:t.rich("invalid-error",{link:a})})}return null}var E=n(37212);function S({onChangePasswordChanged:e,changePasswordError:r,status:n="idle"}){let t=(0,f.c)("change-password");return(0,s.jsxs)(a.Z,{children:[(0,s.jsx)(o.S,{size:"smallest",children:(0,s.jsx)(l.M,{children:t("change-password-title")})}),(0,s.jsx)(d.f,{children:"success"===n?(0,s.jsxs)(o.S,{size:"larger",children:[(0,s.jsx)(c.f,{children:t("change-password-success")}),(0,E.mU)()?(0,s.jsx)(o.S,{children:(0,s.jsx)(u.v,{type:"primary",href:"fitbod://",children:t("open-fitbod")})}):null,(0,s.jsx)(o.S,{children:(0,s.jsx)(j.E,{href:"/login",children:t("back-login")})})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(o.S,{size:"smallest",children:(0,s.jsx)(h.X,{isLoading:"loading"===n,children:(0,s.jsx)(_,{onSubmitted:e,changePasswordError:r,status:n})})})})})]})}var P=n(81278),k=!0;function C(){let{query:e}=(0,P.useRouter)(),{execute:r,error:n,status:a}=function(e){let r=(0,i.aq)(),[n,s]=(0,t.useState)("idle"),[a,o]=(0,t.useState)("");return{execute:(0,t.useCallback)(async({newPassword:n})=>{s("loading");try{await r.users.completeResetPassword({token:e,password:n}),s("success")}catch(r){s("error");let e=r.details?.errorCode;
1["token_invalid","token_expired","invalid"].includes(e)?o(e):o("invalid")}},[s,o,e,r]),status:n,error:a}}(e.token||"");return(0,s.jsx)(S,{onChangePasswordChanged:r,changePasswordError:n,status:a})}},69018:(e,r,n)=>{"use strict";n.d(r,{f:()=>i});var s=n(55729);let t=n(79945).Ay.div.withConfig({displayName:"content-width__StyledContentWidthContainer",componentId:"p-ui__sc-1sloijk-0"})(["width:100%;max-width:34.3rem;margin:0 auto;"]);function i({children:e}){return s.createElement(t,null,e)}},97952:(e,r,n)=>{"use strict";n.d(r,{y:()=>i});var s=n(55729),t=n(7378);let i=s.forwardRef(function(e,r){return s.createElement(t.k,{ref:r,...e,type:"password"})})}},e=>{e.O(0,[1909,2005,636,6593,8792],()=>e(e.s=13137)),_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.