import{_ as E}from"./CNIrc0EA.js";import{_ as C}from"./DuhDFJjj.js";import{A as j}from"./AmaTRG5a.js";import{z as B,j as n,k as v,l as M,c as u,b as s,f as c,t as i,e as N,G as D,I as T,m as o,D as _,H as q,w as z,E as A,o as d,J as H,M as I}from"./Bgmy51Qv.js";import{u as R}from"./7pZkuj9N.js";import{u as U}from"./LR-3m_fG.js";const F={class:"mb-30 mb-sm-15"},G={class:"input-wrapper"},J={class:"icon-input"},L=["placeholder"],P={key:0,class:"error"},K={key:1,class:"error"},O={class:"dply-felx j-right mt-15"},oe={__name:"forgot-password",setup(Q){const h=B(),{setErrors:g}=h,y=R(),{setRequest:$}=y,e=n(""),p=n(""),r=n(!1),l=n(!1),{isValidEmail:S,isValidLength:w}=U(),m=v(()=>e.value&&!S(e.value));v(()=>p.value&&!w(p.value));const V=async()=>{if(r.value=!1,!e.value||m.value)return r.value=!0,!1;l.value=!0,await $({params:{email:e.value},api:"forgotPassword"})&&I(`/verify-code?email=${e.value}`),l.value=!1};return M(()=>{g()}),(t,a)=>{const b=E,k=C,x=j;return d(),u("form",{onSubmit:a[1]||(a[1]=A(f=>V(),["prevent"])),class:_([{"has-error":o(r)},"login-form"])},[s("h4",F,i(t.$t("profile.sendCode")),1),c(b),s("div",G,[s("div",J,[a[2]||(a[2]=s("i",{class:"icon email-icon"}," ",-1)),D(s("input",{type:"text",placeholder:t.$t("fSale.email"),"onUpdate:modelValue":a[0]||(a[0]=f=>q(e)?e.value=f:null),class:_({invalid:!o(e)||o(m)})},null,10,L),[[T,o(e),void 0,{trim:!0}]])]),!o(e)&&o(r)?(d(),u("span",P,i(t.$t("category.req",{type:t.$t("fSale.email")})),1)):o(m)&&o(r)?(d(),u("span",K,i(t.$t("user.isValid",{type:t.$t("fSale.email")})),1)):N("",!0)]),s("div",O,[c(k,{to:"/login",class:"link"},{default:z(()=>[H(i(t.$t("profile.ltya")),1)]),_:1})]),c(x,{class:"mt-20 primary-btn","fetching-data":o(l),"loading-text":t.$t("profile.se"),text:t.$t("profile.svc"),"activate-btn":!0},null,8,["fetching-data","loading-text","text"])],34)}}};export{oe as default};
