import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{$n as n,Cr as r,Nn as i,Qn as a,Rr as o,Un as s,Xr as c,Zn as l,_n as u,ai as d,an as f,ar as p,er as m,ir as h,on as g,sr as _,ui as v,vn as y}from"./vendor-primevue-D50rA9nL.js";import{ln as b,ot as x,sn as S,st as C}from"./vendor-other-BnH5nyVX.js";import{n as w,t as T}from"./Button-DzMg17Os.js";import{Oo as E,ko as D}from"./dialogService-Cr3DyAja.js";import{n as O,t as k}from"./_plugin-vue_export-helper-Ckv1EJQX.js";var A,j,M,N,P,F,I,L,R,z,B,V=t((()=>{i(),f(),u(),x(),S(),w(),E(),A={class:`flex h-full items-center justify-center p-8`},j={class:`max-w-[100vw] p-2 lg:w-96`},M={class:`mb-8 flex flex-col gap-4`},N={class:`my-0 text-xl leading-normal font-medium`},P={class:`my-0 text-base text-muted`},F={class:`flex flex-col gap-2`},I={class:`mb-2 text-base font-medium opacity-80`,for:`reset-email`},L={key:0,class:`text-red-500`},R={class:`flex flex-col gap-4`},z={class:`mt-5 text-sm text-gray-600`},B=_({__name:`CloudForgotPasswordView`,setup(e){let{t}=C(),i=b(),u=D(),f=c(``),_=c(!1),x=c(``),S=c(``),navigateToLogin=()=>{i.push({name:`cloud-login`})},handleSubmit=async()=>{if(!f.value){x.value=t(`cloudForgotPassword_emailRequired`);return}_.value=!0,x.value=``,S.value=``;try{await u.sendPasswordReset(f.value),S.value=t(`cloudForgotPassword_passwordResetSent`),setTimeout(()=>{navigateToLogin()},3e3)}catch(e){console.error(`Password reset error:`,e),x.value=t(`cloudForgotPassword_passwordResetError`)}finally{_.value=!1}};return(e,i)=>(r(),m(`div`,A,[l(`div`,j,[l(`div`,M,[l(`h1`,N,v(d(t)(`cloudForgotPassword_title`)),1),l(`p`,P,v(d(t)(`cloudForgotPassword_instructions`)),1)]),l(`form`,{class:`flex flex-col gap-6`,onSubmit:s(handleSubmit,[`prevent`])},[l(`div`,F,[l(`label`,I,v(d(t)(`cloudForgotPassword_emailLabel`)),1),p(d(g),{id:`reset-email`,modelValue:f.value,"onUpdate:modelValue":i[0]||=e=>f.value=e,type:`email`,placeholder:d(t)(`cloudForgotPassword_emailPlaceholder`),class:`h-10`,invalid:!!x.value&&!f.value,autocomplete:`email`,required:``},null,8,[`modelValue`,`placeholder`,`invalid`]),x.value?(r(),m(`small`,L,v(x.value),1)):n(``,!0)]),S.value?(r(),a(d(y),{key:0,severity:`success`},{default:o(()=>[h(v(S.value),1)]),_:1})):n(``,!0),l(`div`,R,[p(T,{type:`submit`,loading:_.value,disabled:!f.value||_.value,class:`h-10 font-medium text-white`},{default:o(()=>[h(v(d(t)(`cloudForgotPassword_sendResetLink`)),1)]),_:1},8,[`loading`,`disabled`]),p(T,{type:`button`,variant:`secondary`,class:`h-10 bg-[#2d2e32]`,onClick:navigateToLogin},{default:o(()=>[h(v(d(t)(`cloudForgotPassword_backToLogin`)),1)]),_:1})])],32),l(`p`,z,v(d(t)(`cloudForgotPassword_didntReceiveEmail`)),1)])]))}})})),H=t((()=>{})),U;t((()=>{V(),V(),H(),O(),U=k(B,[[`__scopeId`,`data-v-127dc072`]])}))();export{U as default};
//# sourceMappingURL=CloudForgotPasswordView-DeWIzy5F.js.map