var M=Object.defineProperty,j=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(a,e,t)=>e in a?M(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,B=(a,e)=>{for(var t in e||(e={}))N.call(e,t)&&b(a,t,e[t]);if(h)for(var t of h(e))C.call(e,t)&&b(a,t,e[t]);return a},$=(a,e)=>j(a,G(e));import{J as D,G as L,a0 as T,B as y,k as U,L as k,M as A,Q as E,T as F,r as u,o as c,e as p,f as m,w as v,u as r,t as _,h as J,i as P,U as Q}from"./vendor.d12b5734.js";import{u as R}from"./auth.c88ceb4c.js";import"./main.465728e1.js";const z=["onSubmit"],H={key:0},K={key:1},O={class:"mt-4 mb-4 text-sm"},ee={setup(a){const e=R(),{t}=D(),S=L(),l=T({email:"",company:""}),f=y(!1),n=y(!1),V=U(()=>({email:{required:k.withMessage(t("validation.required"),A),email:k.withMessage(t("validation.email_incorrect"),E)}})),o=F(V,l);function w(i){if(o.value.$touch(),o.value.$invalid)return!0;n.value=!0;let s=$(B({},l),{company:S.params.company});e.forgotPassword(s).then(d=>{n.value=!1}).catch(d=>{n.value=!1}),f.value=!0}return(i,s)=>{const d=u("BaseInput"),I=u("BaseInputGroup"),q=u("BaseButton"),x=u("router-link");return c(),p("form",{id:"loginForm",onSubmit:Q(w,["prevent"])},[m(I,{error:r(o).email.$error&&r(o).email.$errors[0].$message,label:i.$t("login.enter_email"),class:"mb-4",required:""},{default:v(()=>[m(d,{modelValue:r(l).email,"onUpdate:modelValue":s[0]||(s[0]=g=>r(l).email=g),type:"email",name:"email",invalid:r(o).email.$error,onInput:s[1]||(s[1]=g=>r(o).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),m(q,{loading:n.value,disabled:n.value,type:"submit",variant:"primary"},{default:v(()=>[f.value?(c(),p("div",K,_(i.$t("validation.not_yet")),1)):(c(),p("div",H,_(i.$t("validation.send_reset_link")),1))]),_:1},8,["loading","disabled"]),J("div",O,[m(x,{to:"login",class:"text-sm text-primary-400 hover:text-gray-700"},{default:v(()=>[P(_(i.$t("general.back_to_login")),1)]),_:1})])],40,z)}}};export{ee as default};
