import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{lt as t,rt as n}from"./vendor-primevue-DxVRNMbC.js";import"./vendor-firebase-CdLSXhbt.js";import{A as r,Dt as i,F as a,I as o,It as s,O as c,R as l,Vt as u,b as d,et as f,gt as p,j as m,k as h,o as g}from"./vendor-vue-core-X6q-rGJs.js";import"./vendor-other-CyG3qq8S.js";import"./useFeatureFlags-CxRWjdi1.js";import"./api-DQLKc1Xa.js";import"./vendor-markdown-Cola12Wc.js";import"./colorUtil-Cth7eqhK.js";import{n as _}from"./vendor-i18n-B5g6Drzm.js";import"./i18n-DjV_9lZM.js";import"./vendor-reka-ui-CHPbCe4i.js";import{t as v}from"./Button-C7dWyQyS.js";import{vn as y}from"./dialogService-Cqui0UMO.js";import"./systemStatsStore-D9aNY5gT.js";import"./useErrorHandling-BFB8eSj5.js";import{t as b}from"./_plugin-vue_export-helper-fSAtQzP-.js";import"./dialogStore-CXD5Bcfy.js";import"./useCopyToClipboard-C74olorb.js";import"./vendor-tiptap-BXSIIPYY.js";import"./markdownRendererUtil-Bm7Umh6C.js";import"./useExternalLink-Cc30SNi3.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(l({__name:`CloudForgotPasswordView`,setup(e){let{t:l}=_(),b=g(),j=y(),M=i(``),N=i(!1),P=i(``),F=i(``),navigateToLogin=()=>{b.push({name:`cloud-login`})},handleSubmit=async()=>{if(!M.value){P.value=l(`cloudForgotPassword_emailRequired`);return}N.value=!0,P.value=``,F.value=``;try{await j.sendPasswordReset(M.value),F.value=l(`cloudForgotPassword_passwordResetSent`),setTimeout(()=>{navigateToLogin()},3e3)}catch(e){console.error(`Password reset error:`,e),P.value=l(`cloudForgotPassword_passwordResetError`)}finally{N.value=!1}};return(e,i)=>(f(),m(`div`,x,[c(`div`,S,[c(`div`,C,[c(`h1`,w,u(s(l)(`cloudForgotPassword_title`)),1),c(`p`,T,u(s(l)(`cloudForgotPassword_instructions`)),1)]),c(`form`,{class:`flex flex-col gap-6`,onSubmit:d(handleSubmit,[`prevent`])},[c(`div`,E,[c(`label`,D,u(s(l)(`cloudForgotPassword_emailLabel`)),1),o(s(n),{id:`reset-email`,modelValue:M.value,"onUpdate:modelValue":i[0]||=e=>M.value=e,type:`email`,placeholder:s(l)(`cloudForgotPassword_emailPlaceholder`),class:`h-10`,invalid:!!P.value&&!M.value,autocomplete:`email`,required:``},null,8,[`modelValue`,`placeholder`,`invalid`]),P.value?(f(),m(`small`,O,u(P.value),1)):r(``,!0)]),F.value?(f(),h(s(t),{key:0,severity:`success`},{default:p(()=>[a(u(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:p(()=>[a(u(s(l)(`cloudForgotPassword_sendResetLink`)),1)]),_:1},8,[`loading`,`disabled`]),o(v,{type:`button`,variant:`secondary`,class:`h-10 bg-[#2d2e32]`,onClick:navigateToLogin},{default:p(()=>[a(u(s(l)(`cloudForgotPassword_backToLogin`)),1)]),_:1})])],32),c(`p`,A,u(s(l)(`cloudForgotPassword_didntReceiveEmail`)),1)])]))}}),[[`__scopeId`,`data-v-127dc072`]]);export{j as default};
//# sourceMappingURL=CloudForgotPasswordView-B7NgAXNq.js.map