1import{aT as X,aU as G,a3 as Y,ao as d,ap as L,af as S,ag as Z,aM as $,am as J,ah as e,A as K,g as t,i as B,B as y,s as k,U as Q,al as ee,Y as oe,Z as re,ae,a as x}from"./index-DGw_ow-Q.js";import{g as se,B as te}from"./branding-bFJqHdEq.js";import"./vendor-XDCjal2T.js";const ne=5e3,ie=a=>a?`/firm/${encodeURIComponent(a)}/login`:"/login",le=(a,i)=>{if(typeof a!="string")return i;const o=a.trim();if(!o.startsWith("/")||o.startsWith("//"))return i;const u=o.split(/[?#]/,1)[0],v=i.split(/[?#]/,1)[0];return u===v?o:i},ue=()=>{const a=X(),i=G(),o=Y(a.pathname,a.search),u=a.state,v=u?.email||"",A=le(u?.returnTo,ie(o)),[l,g]=d.useState(()=>L(o)),b=l?.logo_uri?.trim()||"",E=b&&S(b)?b:"",I=l?.logo_mark_uri?.trim()||"",P=I&&S(I)?I:"",j=l?.background_uri?.trim()||"",T=j&&S(j)?j:"",C=l?.landing_color?.trim()||"",_=C&&Z(C)?C:"",U=l?.introduction?.trim()||void 0,[p,N]=d.useState(v),[D,F]=d.useState(1),[s,M]=$.useMessage(),[R,h]=d.useState(!1),[O,c]=d.useState(()=>!!o&&!L(o));d.useEffect(()=>{if(!o){g(null),c(!1);return}let r=!0;const n=L(o);n?(g(n),c(!1)):(g(null),c(!0));const w=window.setTimeout(()=>{r&&c(!1)},ne);return se(o).then(m=>{r&&(g(m),m&&J(o,m))}).finally(()=>{window.clearTimeout(w),r&&c(!1)}),()=>{r=!1,window.clearTimeout(w)}},[o]);const f=()=>{i(A,{state:{email:p}})},V=async r=>{h(!0);try{await oe({email:r.email}),s.success("If the email address is registered, check your inbox for the next sign-in step."),N(r.email),F(2)}catch{s.error("An unexpected error occurred, please try again later or contact our support")}finally{h(!1)}},W=async r=>{h(!0);try{await re({email:p,confirmation_code:r.confirmation_code,password:r.password}),s.success("Password reset successfully, please login with your new password"),f()}catch(n){if(ae(n))switch(n.code){case x.INVALID_CODE:s.error("The confirmation code is invalid");break;case x.CODE_EXPIRED:s.error("The confirmation code has expired");break;case x.INVALID_PASSWORD:s.error("The new password is invalid");break;case x.USER_NOT_FOUND:s.error("The email address is not registered");break;default:s.error("Unknown auth error occurred, please contact our support")}else s.error("An unexpected error occurred, please try again later or contact our support")}finally{h(!1)}};return O?e.jsx(te,{className:"advisor-login-branding-loading",label:"Loading sign-in"}):e.jsx(K,{showProgress:!1,logoSrc:E||void 0,logoFallbackSrc:P||void 0,logoAlt:l?.name||"Logo",brandColor:_||void 0,heroImageSrc:T||void 0,heroTitle:U,children:e.jsxs("div",{className:"advisor-signup-form-block advisor-login-form-block login",children:[e.jsxs("div",{className:"advisor-signup-copy",children:[e.jsx("h1",{children:"Reset your password"}),e.jsx("p",{children:"Enter the email tied to your advisor portal account."})]}),M,D===1?e.jsxs(t,{name:"forgetPassword",layout:"vertical",initialValues:{email:p},onFinish:V,children:[e.jsx(t.Item,{label:"Email",name:"email",rules:[{required:!0,message:"Please input your email!"},{type:"email",message:"Please input a valid email!"}],children:e.jsx(B,{className:"custom-disabled-input",placeholder:"Email",disabled:!!p})}),e.jsx(t.Item,{children:e.jsx(y,{type:"primary",htmlType:"submit",loading:R,style:{width:"100%",color:"#000"},children:"Send Reset Code"})}),e.jsx(t.Item,{children:e.jsx(y,{type:"link",onClick:f,children:"Back to Login"})})]}):e.jsxs(t,{name:"confirmReset",layout:"vertical",initialValues:{confirmation_code:""},onFinish:W,autoComplete:"off",children:[e.jsx(k.Paragraph,{style:{marginBottom:16,fontSize:13},children:"Check your email. If your account was already confirmed, you'll receive a 6-digit confirmation code â enter it below with a new password."}),e.jsxs(k.Paragraph,{style:{marginBottom:16,fontSize:13},children:["If your account has not yet been confirmed, you'll instead receive a new temporary password."," ",e.jsx(k.Link,{onClick:f,children:"Sign in with your temporary password"}),"."]}),e.jsx(t.Item,{label:"Confirmation Code",name:"confirmation_code",rules:Q,children:e.jsx(B,{placeholder:"Enter confirmation code",autoComplete:"off",maxLength:6})}),e.jsx(t.Item,{label:"New Password",name:"password",rules:[{required:!0,message:"Please input your new password!"},...ee],children:e.jsx(B.Password,{placeholder:"Enter new password",autoComplete:"new-password"})}),e.jsx(t.Item,{shouldUpdate:!0,children:({getFieldsError:r,getFieldsValue:n})=>{const{confirmation_code:w,password:m}=n(),H=r().some(({errors:z})=>z.length>0),q=!w||!m;return e.jsx(y,{type:"primary",htmlType:"submit",loading:R,disabled:H||q,style:{width:"100%",color:"#000"},children:"Reset Password"})}}),e.jsx(t.Item,{children:e.jsx(y,{type:"link",onClick:f,children:"Back to Login"})})]})]})})};export{ue as default}; 2//# sourceMappingURL=reset-password-B_T5bOUk.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.