import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{at as t,ct as n}from"./vendor-primevue-DYf-ECwY.js";import"./vendor-firebase-yTFzdAQf.js";import{A as r,F as i,Ht as a,I as o,Lt as s,O as c,Ot as l,R as u,_t as d,b as f,et as p,j as m,k as h,o as g}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-D1_ndkJp.js";import"./useFeatureFlags-CHGLLgJ4.js";import"./api-CDBLxNna.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-vwiX_KSk.js";import{n as _}from"./vendor-i18n-CpHGo1Sd.js";import"./i18n-Dg3QvWTL.js";import"./vendor-reka-ui-Dfvl2gA8.js";import{t as v}from"./Button-BOHBs1GV.js";import{Cr as y}from"./dialogService-dIcYqMOB.js";import"./systemStatsStore-4wRyVqfZ.js";import{t as b}from"./_plugin-vue_export-helper-D8rLfeal.js";import"./userStore-Ctrt23xJ.js";import"./useErrorHandling-BMNIAgkQ.js";import"./vendor-tiptap-F_4ky0lj.js";import"./Popover-cEFhN-pL.js";import"./markdownRendererUtil-DO0bU-vH.js";import"./useExternalLink-Dl87dnPK.js";var x={class:`flex h-full items-center justify-center p-8`},S={class:`max-w-[100vw] p-2 lg:w-96`},C={class:`mb-8 flex flex-col gap-4`},w={class:`my-0 text-xl leading-normal font-medium`},T={class:`my-0 text-base text-muted`},E={class:`flex flex-col gap-2`},D={class:`mb-2 text-base font-medium opacity-80`,for:`reset-email`},O={key:0,class:`text-red-500`},k={class:`flex flex-col gap-4`},A={class:`mt-5 text-sm text-gray-600`},j=b(u({__name:`CloudForgotPasswordView`,setup(e){let{t:u}=_(),b=g(),j=y(),M=l(``),N=l(!1),P=l(``),F=l(``),navigateToLogin=()=>{b.push({name:`cloud-login`})},handleSubmit=async()=>{if(!M.value){P.value=u(`cloudForgotPassword_emailRequired`);return}N.value=!0,P.value=``,F.value=``;try{await j.sendPasswordReset(M.value),F.value=u(`cloudForgotPassword_passwordResetSent`),setTimeout(()=>{navigateToLogin()},3e3)}catch(e){console.error(`Password reset error:`,e),P.value=u(`cloudForgotPassword_passwordResetError`)}finally{N.value=!1}};return(e,l)=>(p(),m(`div`,x,[c(`div`,S,[c(`div`,C,[c(`h1`,w,a(s(u)(`cloudForgotPassword_title`)),1),c(`p`,T,a(s(u)(`cloudForgotPassword_instructions`)),1)]),c(`form`,{class:`flex flex-col gap-6`,onSubmit:f(handleSubmit,[`prevent`])},[c(`div`,E,[c(`label`,D,a(s(u)(`cloudForgotPassword_emailLabel`)),1),o(s(t),{id:`reset-email`,modelValue:M.value,"onUpdate:modelValue":l[0]||=e=>M.value=e,type:`email`,placeholder:s(u)(`cloudForgotPassword_emailPlaceholder`),class:`h-10`,invalid:!!P.value&&!M.value,autocomplete:`email`,required:``},null,8,[`modelValue`,`placeholder`,`invalid`]),P.value?(p(),m(`small`,O,a(P.value),1)):r(``,!0)]),F.value?(p(),h(s(n),{key:0,severity:`success`},{default:d(()=>[i(a(F.value),1)]),_:1})):r(``,!0),c(`div`,k,[o(v,{type:`submit`,loading:N.value,disabled:!M.value||N.value,class:`h-10 font-medium text-white`},{default:d(()=>[i(a(s(u)(`cloudForgotPassword_sendResetLink`)),1)]),_:1},8,[`loading`,`disabled`]),o(v,{type:`button`,variant:`secondary`,class:`h-10 bg-[#2d2e32]`,onClick:navigateToLogin},{default:d(()=>[i(a(s(u)(`cloudForgotPassword_backToLogin`)),1)]),_:1})])],32),c(`p`,A,a(s(u)(`cloudForgotPassword_didntReceiveEmail`)),1)])]))}}),[[`__scopeId`,`data-v-127dc072`]]);export{j as default};
//# sourceMappingURL=CloudForgotPasswordView-Ch382Kw7.js.map