1import{Y as k,cc as T,D as n,z as x,ee as _,x as U,R as A,eh as D,G as s,T as N,H as y,U as L,aa as q,ab as B,fp as F,hL as c,J as R,em as $,hM as H,as as M}from"./index-BuKyKLFj.js";import{R as Y}from"./recaptcha-7GW7223w.js";import{P as z}from"./PasswordInput-CZk3oqxs.js";import{u as O}from"./useComponentLog-D6gfCGk9.js";import{A as G}from"./index-BBcuTcSd.js";import"./arrow-backward-Dh-4CpSy.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"[email protected]"};var e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="67b489ab-e823-4f37-b0a1-bf92eeaf58d0",r._sentryDebugIdIdentifier="sentry-dbid-67b489ab-e823-4f37-b0a1-bf92eeaf58d0")}catch{}})();const Z=()=>{O("ResetPassword");const r=k(),e=T.getQueryParams(),[a,f]=n.useState(""),[w,i]=n.useState(!1),[m,p]=n.useState(""),[h,P]=n.useState(!1),[E,b]=n.useState(!1),S=x(o=>o.ui),g=x(_),{brand:d}=S||{},l=U(),j=!!parseInt(e.isnew,10),v=new Y("password_reset");n.useEffect(()=>{if(!e.username||!e.code){l({type:A,payload:{url:"user.signin"}});return}g&&D()},[l,e.code,e.username,g]);const I=async o=>{if(o.preventDefault(),p(""),i(!1),P(!0),b(!1),!c(a,d).valid){i(!0);return}if(!v){b(!0);return}try{const t=await v.getToken(),u=await H({username:e.username,code:e.code,password:a,firstName:void 0,reCaptchaToken:t});l(M("Password Reset",{user_id:u._id,email:u.username})),window.location.href=`/user/signin?username=${encodeURIComponent(e.username)}&isnew=${j}&resetSuccess=true`}catch(t){console.error(t),f("");const u=typeof t=="object"&&t!==null&&"errorCode"in t?t.errorCode:void 0;p(u==="40003"?"invalidated":"expired")}},C=()=>{if(a.length&&!c(a,d).valid){i(!0);return}i(!1)};return s.jsxs(G,{children:[s.jsx(N,{as:"h1",size:"xxlarge","data-test":"passwordPageTitle",children:"Reset Password"}),E&&s.jsx(y,{extraClassName:"mt-4",title:"Unable to Reset Password",description:"An error occurred. Please try again.",variant:"error"}),e.username?s.jsx(L,{variant:"field-label",weight:"bold",className:"auth-email-label","data-test":"userMail",children:decodeURIComponent(e.username)}):s.jsx("div",{}),m&&s.jsx(y,{extraClassName:"mt-4",title:m==="invalidated"?"Link invalidated by another reset request":"Reset link expired",description:m==="invalidated"?`Check your email for the most recent reset link, or <a data-test="alertLink" class="link" href='/user/password?username=${encodeURIComponent(e.username)}'>request a new one</a>.`:`Your password request has expired. Please perform a <a data-test="alertLink" class="link" href='/user/password?username=${encodeURIComponent(e.username)}'>new password request</a>.`,variant:"error"}),s.jsxs("form",{className:"auth-form",onSubmit:I,children:[s.jsxs(q,{children:[s.jsx(B,{htmlFor:"password",children:"New Password"}),s.jsx(z,{required:!0,id:"password",name:"password","data-test":"password",disabled:h,value:a,onBlur:C,onChange:o=>{f(o.target.value)},"aria-invalid":w}),w&&s.jsx(F,{children:c(a,d).message})]}),s.jsx("div",{className:"buttons-wrapper",children:s.jsx(R,{"data-test":"resetPasswordSubmit",disabled:!a||!c(a,d).valid||h,stretch:!0,type:"submit",children:"Reset Password"})})]}),s.jsx("form",{onSubmit:()=>{l({type:$,payload:{params:{username:e.username}}}),r("/user/signin")},children:s.jsx(R,{type:"submit",stretch:!0,variant:"text",children:"Back to Sign In"})})]})};export{Z as default}; 2//# sourceMappingURL=index-D-hqvogC.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.