1import{aH as P,u as _,b as I,i as R,L as i,o as F,U as N,ae as h,W as v,f as k,g as w,k as a,w as l,h as t,n as o,t as q,q as m,N as B,x as M,y as U,B as $,C as E,z as L,aJ as W,ao as z,aD as H}from"./Be4KCvjK.js";import{u as O}from"./D8cr0kC4.js";import"./BSLv_VzT.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new r.Error().stack;f&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[f]="85c6dde9-9ec2-4b5c-92ed-02c46a09a694",r._sentryDebugIdIdentifier="sentry-dbid-85c6dde9-9ec2-4b5c-92ed-02c46a09a694")}catch{}})();const j={key:"success"},J={class:"mb-8"},Q={class:"text-subtitleText font-weight-bold"},G={key:"form"},Z={__name:"forgot-password",setup(r){const{brandName:f}=P();O({title:"Forgot Password",description:`Reset your ${f.value} client area password to regain access to your account.`,indexable:!0});const g=_(),{$apiFetch:C}=I(),T=R("showSnackbar"),V=R("isBackgroundReady",i(!1)),x=i(null),S=i(null),d=i(""),u=i(!1),p=i(!1),y=i(!1);F(()=>{g.query.email&&(d.value=decodeURIComponent(String(g.query.email)));const s=()=>{V.value?setTimeout(()=>{h(()=>{y.value=!0})},150):setTimeout(s,50)};s(),N(y,e=>{e&&h(()=>S.value?.focus())},{once:!0})});const A=async()=>{if((await x.value?.validate())?.valid){u.value=!0;try{const e=await C("/api/auth/reset-password",{method:"POST",body:{email:d.value}});if(e.result==="success"){p.value=!0;try{const{trackEvent:n,EVENTS:c}=H();n(c.AUTH_PASSWORD_RESET_REQUESTED,{})}catch{}}else T?.(e.message||"Password reset failed. Please try again.","error")}catch(e){const n=e?.data?.statusMessage||e?.statusMessage||e?.message||"Password reset failed. Please try again.";T?.(n,"error")}finally{u.value=!1}}};return(s,e)=>{const n=v("AuthButton"),c=v("AuthButtonSub"),D=v("AuthTextField");return k(),w("div",{class:z(["auth-page-container",{"is-ready":t(y)}])},[a(W,{mode:"out-in",class:"auth-page-component-container"},{default:l(()=>[t(p)?(k(),w("div",j,[o("div",J,[e[4]||(e[4]=o("h1",{class:"text-h5 text-md-h4 text-loginTitle mb-2"},"ð§ Check your email",-1)),o("span",Q,q(t(d)),1)]),e[7]||(e[7]=o("p",{class:"text-subtitleText text-body-2 mb-6"},"We've sent password reset instructions to your email address. Please check your inbox and follow the link to reset your password.",-1)),e[8]||(e[8]=o("p",{class:"text-subtitleText text-body-2 opacity-70 mb-8"},"Didn't receive it? Check your spam folder or request a new link below.",-1)),a(n,{onClick:e[0]||(e[0]=b=>p.value=!1),"data-testid":"resend-btn"},{default:l(()=>[...e[5]||(e[5]=[m(" Send again ",-1)])]),_:1}),a(c,{class:"mt-5","data-testid":"back-to-login-btn",onClick:e[1]||(e[1]=b=>("navigateTo"in s?s.navigateTo:t(B))("/login"))},{default:l(()=>[...e[6]||(e[6]=[m(" Back to Login ",-1)])]),_:1})])):(k(),w("div",G,[e[12]||(e[12]=o("div",{class:"mb-8"},[o("h1",{class:"text-h5 text-md-h4 text-loginTitle mb-2"},"ð Forgot Password"),o("span",{class:"text-subtitleText"},"Enter your email to receive a reset link")],-1)),a(M,{ref_key:"formRef",ref:x,onSubmit:U(A,["prevent"])},{default:l(()=>[a($,null,{default:l(()=>[...e[9]||(e[9]=[m("Email",-1)])]),_:1}),a(D,{ref_key:"emailInputRef",ref:S,modelValue:t(d),"onUpdate:modelValue":e[2]||(e[2]=b=>L(d)?d.value=b:null),"data-testid":"email-input",type:"email",placeholder:"Enter your email",name:"email",autocomplete:"email",rules:[t(E).emailrequired,t(E).emailRules],disabled:t(u)},null,8,["modelValue","rules","disabled"]),a(n,{class:"mt-6","data-testid":"submit-btn",type:"submit",loading:t(u)},{default:l(()=>[...e[10]||(e[10]=[m(" Send reset link ",-1)])]),_:1},8,["loading"])]),_:1},512),a(c,{class:"mt-5","data-testid":"back-to-login-btn",onClick:e[3]||(e[3]=b=>("navigateTo"in s?s.navigateTo:t(B))("/login")),disabled:t(u)},{default:l(()=>[...e[11]||(e[11]=[m(" Back to Login ",-1)])]),_:1},8,["disabled"])]))]),_:1})],2)}}};export{Z as default};
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.