import"../chunks/DsnmJJEf.js";import{p as xe,t as _,a as d,b as ge,i as Te,c as T,d as a,$ as Ne,r as s,s as o,g as m,h,l as V,e as Oe,f as C,j as c}from"../chunks/Dyk1ealw.js";import{d as Ee,a as Ae,s as v,e as he}from"../chunks/DEEYSJdk.js";import{i as g}from"../chunks/cYAxD0tk.js";import{h as De,s as Ie}from"../chunks/BGzpdNMV.js";import{s as H,r as Re,t as D}from"../chunks/CDBVw774.js";import{b as Me}from"../chunks/CfwjHbh5.js";import{i}from"../chunks/CVq-Ik9t.js";import{b as Se}from"../chunks/DXU0JJLc.js";import{f as ye}from"../chunks/DibDeWsm.js";import{B as Ge}from"../chunks/CqOTUmYS.js";import{D as Fe}from"../chunks/BG_D_W2D.js";import{B as Xe,t as W}from"../chunks/C7KHiE1N.js";import{S as we,M as Le}from"../chunks/Bce1U4cK.js";import{M as q}from"../chunks/BHKWdjFe.js";import{L as ke}from"../chunks/BkBShXgg.js";var Be=T('<p class="text-xs text-red-500"> </p>'),J=T("<!> ",1),Ce=T('<form class="space-y-4 px-6 py-5" novalidate=""><div class="space-y-1.5"><label for="email" class="text-[0.8125rem] font-medium text-foreground"> </label> <div class="flex rounded-md shadow-sm"><span class="inline-flex items-center rounded-l-md border border-r-0 border-input bg-muted px-3 text-muted-foreground"><!></span> <input id="email" type="email" autocomplete="email"/></div> <!></div> <!></form>'),ze=T('<div class="px-6 py-5 text-center text-[0.8125rem] text-muted-foreground"> </div>'),$e=T('<div class="flex min-h-screen items-center justify-center bg-background p-4"><button type="button" class="absolute top-4 right-4 inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button> <div class="w-full max-w-sm"><div class="mb-8 flex flex-col items-center text-center"><div class="mb-4"><!></div> <h1 class="text-2xl font-semibold tracking-tight text-foreground"> </h1> <p class="mt-1 text-[0.8125rem] text-muted-foreground"><!></p></div> <div class="rounded-lg border border-border bg-card shadow-sm"><!> <div class="border-t border-border px-6 py-3"><a class="flex items-center justify-center gap-1.5 text-[0.75rem] font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </a></div></div></div></div>');function st(Q,Y){xe(Y,!0);let I=h(""),u=h(!1),R=h(!1),N=h(!1);async function Z(e){e.preventDefault(),c(N,!1);const t=m(I).trim();if(!t||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)){c(N,!0);return}c(u,!0);try{const r=await ye(t);c(R,!0),D.success(r.message??"Reset email sent")}catch(r){if(r&&typeof r=="object"&&"status"in r){const n=r;n.status===429?D.error(n.message||"Too many reset requests. Try again later."):D.error(n.message||"Unable to send reset email")}else D.error(i.t("ADMIN_NEXT.FORGOT.UNABLE_TO_CONNECT_TO_SERVER"))}finally{c(u,!1)}}var M=$e();De("71rv0w",e=>{Te(t=>{Ne.title=t??""},[()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD_GRAV_ADMIN")])});var p=a(M),ee=a(p);{var te=e=>{we(e,{size:16})},re=e=>{Le(e,{size:16})};g(ee,e=>{W.isDark?e(te):e(re,-1)})}s(p);var z=o(p,2),S=a(z),y=a(S),ae=a(y);Xe(ae,{size:"login"}),s(y);var G=o(y,2),se=a(G,!0);s(G);var $=o(G,2),oe=a($);{var ie=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.CHECK_INBOX")]),d(e,t)},ne=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.SUBTITLE")]),d(e,t)};g(oe,e=>{m(R)?e(ie):e(ne,-1)})}s($),s(S);var j=o(S,2),K=a(j);{var le=e=>{var t=Ce(),r=a(t),n=a(r),ve=a(n,!0);s(n);var X=o(n,2),w=a(X),_e=a(w);q(_e,{size:13}),s(w);var O=o(w,2);Re(O),s(X);var fe=o(X,2);{var ce=l=>{var E=Be(),A=a(E,!0);s(E),_(L=>v(A,L),[()=>i.t("ADMIN_NEXT.FORGOT.ENTER_A_VALID_EMAIL_ADDRESS")]),d(l,E)};g(fe,l=>{m(N)&&l(ce)})}s(r);var ue=o(r,2);Ge(ue,{type:"submit",class:"w-full",get disabled(){return m(u)},children:(l,E)=>{var A=Oe(),L=C(A);{var pe=f=>{var b=J(),x=C(b);ke(x,{size:15,class:"animate-spin"});var k=o(x);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SENDING")]),d(f,b)},be=f=>{var b=J(),x=C(b);q(x,{size:15});var k=o(x);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SEND_RESET_LINK")]),d(f,b)};g(L,f=>{m(u)?f(pe):f(be,-1)})}d(l,A)},$$slots:{default:!0}}),s(t),_(l=>{v(ve,l),Ie(O,1,`flex h-9 w-full rounded-r-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring
									${m(N)?"border-red-500 ring-1 ring-red-500/30 animate-[shake_0.3s_ease-in-out]":"border-input"}`),O.disabled=m(u)},[()=>i.t("ADMIN_NEXT.FORGOT.EMAIL_ADDRESS")]),he("submit",t,Z),Me(O,()=>m(I),l=>c(I,l)),d(e,t)},de=e=>{var t=ze(),r=a(t,!0);s(t),_(n=>v(r,n),[()=>i.t("ADMIN_NEXT.FORGOT.IF_AN_ACCOUNT_EXISTS_FOR_THAT_EMAIL_A")]),d(e,t)};g(K,e=>{m(R)?e(de,-1):e(le)})}var P=o(K,2),F=a(P),U=a(F);Fe(U,{name:"arrow-back",size:12});var me=o(U);s(F),s(P),s(j),s(z),s(M),_((e,t,r)=>{H(p,"aria-label",e),v(se,t),H(F,"href",`${Se??""}/login`),v(me,` ${r??""}`)},[()=>i.t("ADMIN_NEXT.TOGGLE_DARK_MODE"),()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD"),()=>i.t("ADMIN_NEXT.FORGOT.BACK_TO_SIGN_IN")]),Ae("click",p,()=>W.toggleColorMode()),d(Q,M),ge()}Ee(["click"]);export{st as component};
