"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),f=require("react-i18next"),b=require("react-router-dom"),t=require("lucide-react"),d=require("./index-CVOA4qIe.js");function v(){const{t:r}=f.useTranslation("auth"),[a,m]=s.useState(""),[o,i]=s.useState(!1),[c,n]=s.useState(null),[x,u]=s.useState(!1),g=async l=>{l.preventDefault(),n(null),i(!0);try{await d.authApi.forgotPassword(a),u(!0)}catch(h){n(h?.message||r("common:error"))}finally{i(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[var(--bg-primary)] p-8",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("div",{className:"flex justify-end mb-8",children:e.jsx(d.ThemeSwitcher,{})}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] rounded-2xl shadow-xl p-8",children:[x?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-[var(--success-bg)] rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(t.CheckCircle2,{className:"w-10 h-10 text-[var(--success-text)]"})}),e.jsx("h2",{className:"text-xl font-semibold text-[var(--text-primary)] mb-2",children:r("forgotPasswordPage.successTitle")}),e.jsx("p",{className:"text-[var(--text-secondary)] mb-6",children:r("forgotPasswordPage.successMessage",{email:a})}),e.jsx("p",{className:"text-sm text-[var(--text-tertiary)]",children:r("forgotPasswordPage.checkSpam")})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[var(--info-bg)] rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(t.Mail,{className:"w-8 h-8 text-[var(--info-text)]"})}),e.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)] mb-2",children:r("forgotPasswordPage.pageTitle")}),e.jsx("p",{className:"text-[var(--text-secondary)]",children:r("forgotPasswordPage.description")})]}),c&&e.jsxs("div",{className:"mb-6 p-4 bg-[var(--error-bg)] border border-[var(--error-border)] rounded-lg flex items-start gap-3",children:[e.jsx(t.AlertCircle,{className:"w-5 h-5 text-[var(--error-text)] flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-[var(--error-text)]",children:c})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-[var(--text-secondary)] mb-2",children:r("forgotPasswordPage.email")}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(t.Mail,{className:"h-5 w-5 text-[var(--text-tertiary)]"})}),e.jsx("input",{id:"email",type:"email",value:a,onChange:l=>m(l.target.value),className:"block w-full pl-10 pr-3 py-2.5 border border-[var(--border-color)] rounded-lg bg-[var(--bg-card)] text-[var(--text-primary)] placeholder-[var(--text-tertiary)] focus:ring-2 focus:ring-[var(--info-border)] focus:border-transparent",placeholder:r("forgotPasswordPage.emailPlaceholder"),required:!0,autoComplete:"email",disabled:o})]})]}),e.jsx("button",{type:"submit",disabled:o,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-lg font-medium hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 transition-all",children:o?e.jsxs(e.Fragment,{children:[e.jsx(t.Loader2,{className:"h-5 w-5 animate-spin"}),r("forgotPasswordPage.submitting")]}):r("forgotPasswordPage.submitButton")})]})]}),e.jsx("div",{className:"mt-6 pt-6 border-t border-[var(--border-color)]",children:e.jsxs(b.Link,{to:"/login",className:"flex items-center justify-center gap-2 text-sm text-[var(--text-secondary)] hover:text-[var(--info-text)] transition-colors",children:[e.jsx(t.ArrowLeft,{className:"w-4 h-4"}),r("forgotPasswordPage.backToLogin")]})})]})]})})}exports.ForgotPasswordPage=v;
//# sourceMappingURL=ForgotPasswordPage-DGmxpGC_.js.map
