1import S from"./YfLF_Wmu.js";import{S as E,O as F,ac as T,n as I,k as C,a9 as g,D as _,e as o,w,c as l,h as b,f as r,a as p,x as P,V as R,t as k,H as v,_ as V,F as A}from"./fB1wvp6C.js";import{S as N}from"./71tlqSt7.js";import"./DRaTxIxX.js";import"./CtUEcEPs.js";import"./Dz7_dfTi.js";import"./ZhWAdK_X.js";const D={name:"ResetPassword",components:{AppProgressSpinner:F,Field:E,SignUpFormWrapper:N},setup(){const{$api:t}=I();return{client:t}},data(){return{userEmail:"",isFormSent:!1,isSubmitting:!1,waitingTimer:0,timerId:null}},computed:{maskedEmail(){const t=this.userEmail||this.route.query.email;return this.maskEmail(t)}},methods:{async sendForm(){if(!this.isSubmitting){this.isSubmitting=!0;try{await this.client.authBaseApi.basicAuthControllerPasswordReset({passwordResetDto:{email:this.userEmail}}),this.isFormSent=!0,this.startTimer()}catch(t){t.response.status===429?this.$toast.add({severity:"error",summary:"Error",detail:"Too many attempts. Please try again in few minutes.",life:5e3}):this.$toast.add({severity:"error",summary:"Error",detail:t.response.data.message[0],life:5e3})}finally{this.isSubmitting=!1}}},async resendEmail(){try{this.startTimer()}catch(t){t.response.status===429?this.$toast.add({severity:"error",summary:"Error",detail:"Too many attempts. Please try again in few minutes.",life:5e3}):this.$toast.add({severity:"error",summary:"Error",detail:t.response.data.message[0],life:5e3})}},onResendClick(){console.log("resend click",this.userEmail),this.resendEmail()},checkEmail(){},maskEmail(t,{start:e=3,end:m=2,maskChar:d="*"}={}){if(!t||typeof t!="string")return t;const s=t.indexOf("@");if(s===-1)return t;const i=t.slice(0,s),c=t.slice(s+1);if(i.length<=e+m){const h=i.slice(0,1),n=d.repeat(Math.max(1,i.length-1));return`${h}${n}@${c}`}const u=i.slice(0,e),f=i.slice(i.length-m),x=d.repeat(Math.max(1,i.length-e-m));return`${u}${x}${f}@${c}`},startTimer(){this.waitingTimer=60,this.timerId&&clearInterval(this.timerId),this.timerId=T(()=>{this.waitingTimer>0?this.waitingTimer--:(clearInterval(this.timerId),this.timerId=null)},1e3)}}},B={key:0,class:"flex flex-col gap-[56px]"},U={key:0,class:"p-error"},W={class:"flex flex-col gap-[12px] justify-center"},j=["disabled"],q={class:"flex flex-col gap-1 align-center"},z={class:"flex flex-col gap-1 align-center justify-center"},H={key:0,class:"mt-[4px] text-muted text-center"};function L(t,e,m,d,s,i){const c=S,u=g("AppProgressSpinner"),f=V,x=g("Field"),h=g("SignUpFormWrapper");return o(),_(h,{title:s.isFormSent?"Help is on the way.":"Reset your password",subtitle:s.isFormSent?null:"We'll send you a link that you can use to change your password securely.",description:"No worries, weâll send you reset instructions."},{default:w(()=>[s.isFormSent?(o(),l(A,{key:1},[e[6]||(e[6]=r("div",{class:"flex flex-col gap-[8px]"},[r("p",{class:"font-normal text-[16px] text-primary"},"Check your email for instructions to reset your password. If you donât see an email within a few minutes, please check your spam or promotions folder. ")],-1)),r("div",q,[r("div",z,[e[5]||(e[5]=r("p",{class:"text-primary text-[14px] text-center"},"Didnât receive the email?",-1)),s.waitingTimer===0?(o(),l("button",{key:0,class:"text-[14px] text-link text-sm bg-inherit border-none p-0 m-0 hover:cursor-pointer disabled:cursor-not-allowed",onClick:e[2]||(e[2]=(...n)=>i.onResendClick&&i.onResendClick(...n))},"Resend email")):p("",!0)]),s.waitingTimer?(o(),l("p",H," Resend email (available in "+k(s.waitingTimer)+" seconds) ",1)):p("",!0)])],64)):(o(),l("div",B,[b(x,{name:"email",rules:"email|required"},{default:w(({field:n,errorMessage:a})=>[r("div",null,[r("label",{for:"email2",class:P(["block text-gray-900 font-medium mb-2",{"p-error":a}])},"Email",2),b(c,R({id:"email2",modelValue:s.userEmail,"onUpdate:modelValue":e[0]||(e[0]=y=>s.userEmail=y),type:"text",class:"w-full p-3 h-[48px] rounded-[8px]",placeholder:"Email"},n,{class:{"p-invalid":a}}),null,16,["modelValue","class"]),a?(o(),l("small",U,k(a),1)):p("",!0)]),r("div",W,[r("button",{class:"max-w-[432px] w-[100%] h-[48px] bg-primary text-white font-semibold px-4 py-3 rounded-lg border border-light shadow-[0_0_0_4px_#09D0D91A] hover:bg-primary hover:opacity-80 transition disabled:opacity-50 flex items-center justify-center gap-[8px]",disabled:!n.value||!!a||s.isSubmitting,onClick:e[1]||(e[1]=(...y)=>i.sendForm&&i.sendForm(...y))},[e[3]||(e[3]=v(" Reset Password ",-1)),s.isSubmitting?(o(),_(u,{key:0,size:16,color:"currentColor"})):p("",!0)],8,j),b(f,{to:"/",class:"w-full text-link text-[14px] font-semibold text-center bg-inherit"},{default:w(()=>[...e[4]||(e[4]=[v(" Log in ",-1)])]),_:1})])]),_:1})]))]),_:1},8,["title","subtitle"])}const Y=C(D,[["render",L],["__scopeId","data-v-47c7cb8e"]]);export{Y 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.