import"../chunks/DsnmJJEf.js";import{p as xe,t as _,a as n,b as be,k as ge,d as a,c,$ as Te,r as s,s as o,g as m,i as h,l as V,e as Ne,f as C,j as u}from"../chunks/BfUaJvxP.js";import{d as Oe,a as Ee,s as v,e as Ae}from"../chunks/Bci9YmGs.js";import{i as T}from"../chunks/C8yDvkQM.js";import{h as he,s as De}from"../chunks/VWvGCFra.js";import{s as H,r as Ie,B as Re,t as D}from"../chunks/CuIpA3jY.js";import{b as Me}from"../chunks/CH92E1A-.js";import{i}from"../chunks/CF1ujZlL.js";import{b as Se}from"../chunks/DlhQF7fG.js";import{f as ye}from"../chunks/B5TnUz9r.js";import{B as Ge,t as W}from"../chunks/B8gPun0s.js";import{A as Fe}from"../chunks/Cdd5krRs.js";import{S as Xe,M as we}from"../chunks/DEpIk0Jk.js";import{M as q}from"../chunks/td54cmD_.js";import{L as Le}from"../chunks/BeSnoT4y.js";var ke=c('<p class="text-xs text-red-500"> </p>'),Be=c("<!> ",1),Ce=c("<!> ",1),ze=c('<form class="space-y-4 px-6 py-5" novalidate=""><div class="space-y-1.5"><label for="email" class="text-[13px] 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>'),$e=c('<div class="px-6 py-5 text-center text-[13px] text-muted-foreground"> </div>'),je=c('<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-[13px] 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-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </a></div></div></div></div>');function st(J,Q){xe(Q,!0);let I=h(""),p=h(!1),R=h(!1),N=h(!1);async function Y(e){e.preventDefault(),u(N,!1);const t=m(I).trim();if(!t||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)){u(N,!0);return}u(p,!0);try{const r=await ye(t);u(R,!0),D.success(r.message??"Reset email sent")}catch(r){if(r&&typeof r=="object"&&"status"in r){const l=r;l.status===429?D.error(l.message||"Too many reset requests. Try again later."):D.error(l.message||"Unable to send reset email")}else D.error(i.t("ADMIN_NEXT.FORGOT.UNABLE_TO_CONNECT_TO_SERVER"))}finally{u(p,!1)}}var M=je();he("71rv0w",e=>{ge(t=>{Te.title=t??""},[()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD_GRAV_ADMIN")])});var x=a(M),Z=a(x);{var ee=e=>{Xe(e,{size:16})},te=e=>{we(e,{size:16})};T(Z,e=>{W.isDark?e(ee):e(te,-1)})}s(x);var z=o(x,2),S=a(z),y=a(S),re=a(y);Ge(re,{size:"login"}),s(y);var G=o(y,2),ae=a(G,!0);s(G);var $=o(G,2),se=a($);{var oe=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.CHECK_INBOX")]),n(e,t)},ie=e=>{var t=V();_(r=>v(t,r),[()=>i.t("ADMIN_NEXT.FORGOT.SUBTITLE")]),n(e,t)};T(se,e=>{m(R)?e(oe):e(ie,-1)})}s($),s(S);var j=o(S,2),K=a(j);{var le=e=>{var t=ze(),r=a(t),l=a(r),me=a(l,!0);s(l);var X=o(l,2),w=a(X),ve=a(w);q(ve,{size:13}),s(w);var O=o(w,2);Ie(O),s(X);var _e=o(X,2);{var fe=d=>{var E=ke(),A=a(E,!0);s(E),_(L=>v(A,L),[()=>i.t("ADMIN_NEXT.FORGOT.ENTER_A_VALID_EMAIL_ADDRESS")]),n(d,E)};T(_e,d=>{m(N)&&d(fe)})}s(r);var ue=o(r,2);Re(ue,{type:"submit",class:"w-full",get disabled(){return m(p)},children:(d,E)=>{var A=Ne(),L=C(A);{var ce=f=>{var b=Be(),g=C(b);Le(g,{size:15,class:"animate-spin"});var k=o(g);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SENDING")]),n(f,b)},pe=f=>{var b=Ce(),g=C(b);q(g,{size:15});var k=o(g);_(B=>v(k,` ${B??""}`),[()=>i.t("ADMIN_NEXT.FORGOT.SEND_RESET_LINK")]),n(f,b)};T(L,f=>{m(p)?f(ce):f(pe,-1)})}n(d,A)},$$slots:{default:!0}}),s(t),_(d=>{v(me,d),De(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(p)},[()=>i.t("ADMIN_NEXT.FORGOT.EMAIL_ADDRESS")]),Ae("submit",t,Y),Me(O,()=>m(I),d=>u(I,d)),n(e,t)},de=e=>{var t=$e(),r=a(t,!0);s(t),_(l=>v(r,l),[()=>i.t("ADMIN_NEXT.FORGOT.IF_AN_ACCOUNT_EXISTS_FOR_THAT_EMAIL_A")]),n(e,t)};T(K,e=>{m(R)?e(de,-1):e(le)})}var P=o(K,2),F=a(P),U=a(F);Fe(U,{size:12});var ne=o(U);s(F),s(P),s(j),s(z),s(M),_((e,t,r)=>{H(x,"aria-label",e),v(ae,t),H(F,"href",`${Se??""}/login`),v(ne,` ${r??""}`)},[()=>i.t("ADMIN_NEXT.TOGGLE_DARK_MODE"),()=>i.t("ADMIN_NEXT.FORGOT.FORGOT_PASSWORD"),()=>i.t("ADMIN_NEXT.FORGOT.BACK_TO_SIGN_IN")]),Ee("click",x,()=>W.toggleColorMode()),n(J,M),be()}Oe(["click"]);export{st as component};
