var w=(c,l,t)=>new Promise((i,s)=>{var d=e=>{try{u(t.next(e))}catch(m){s(m)}},r=e=>{try{u(t.throw(e))}catch(m){s(m)}},u=e=>e.done?i(e.value):Promise.resolve(e.value).then(d,r);u((t=t.apply(c,l)).next())});import{b7 as B,b0 as P,a$ as n,b1 as v,b8 as V}from"./bootstrap-CQ5rTwfJ.js";import{T as $}from"./auth-title-Bfr0kZso.js";import{a4 as _,T as C,J as S,av as x,ab as k,x as p,aD as F,ac as b,a8 as T,ai as g,aj as h,a7 as o,aV as y,P as N,aa as A}from"../jse/index-index-Q2B3Lnp0.js";const D=_({name:"ForgetPassword",__name:"forget-password",props:{formSchema:{},loading:{type:Boolean,default:!1},loginPath:{default:"/auth/login"},title:{default:""},subTitle:{default:""},submitButtonText:{default:""}},emits:["submit"],setup(c,{expose:l,emit:t}){const i=c,s=t,[d,r]=B(C({commonConfig:{hideLabel:!0,hideRequiredMark:!0},schema:S(()=>i.formSchema),showDefaultActions:!1})),u=P();function e(){return w(this,null,function*(){const{valid:a}=yield r.validate(),f=yield r.getValues();a&&s("submit",f)})}function m(){u.push(i.loginPath)}return l({getFormApi:()=>r}),(a,f)=>(k(),x("div",null,[p($,null,{desc:b(()=>[T(a.$slots,"subTitle",{},()=>[g(h(a.subTitle||o(n)("authentication.forgetPasswordSubtitle")),1)])]),default:b(()=>[T(a.$slots,"title",{},()=>[g(h(a.title||o(n)("authentication.forgetPassword"))+" 🤦🏻‍♂️ ",1)])]),_:3}),p(o(d)),F("div",null,[p(o(v),{class:y([{"cursor-wait":a.loading},"mt-2 w-full"]),"aria-label":"submit",onClick:e},{default:b(()=>[T(a.$slots,"submitButtonText",{},()=>[g(h(a.submitButtonText||o(n)("authentication.sendResetLink")),1)])]),_:3},8,["class"]),p(o(v),{class:"mt-4 w-full",variant:"outline",onClick:f[0]||(f[0]=L=>m())},{default:b(()=>[g(h(o(n)("common.back")),1)]),_:1})])]))}}),z=_({name:"ForgetPassword",__name:"forget-password",setup(c){const l=N(!1),t=S(()=>[{component:"VbenInput",componentProps:{placeholder:"example@example.com"},fieldName:"email",label:n("authentication.email"),rules:V().min(1,{message:n("authentication.emailTip")}).email(n("authentication.emailValidErrorTip"))}]);function i(s){console.log("reset email:",s)}return(s,d)=>(k(),A(o(D),{"form-schema":t.value,loading:l.value,onSubmit:i},null,8,["form-schema","loading"]))}});export{z as default};
