1import{j as e,A as s}from"./index-Jy9skXX7.js";import{u as t,b as r}from"./vendor-D5QAFWVd.js";import{M as a,F as o}from"./navbar-fDka6hDJ.js";import{j as n}from"./index-DSf4RUbB.js";import"./axios-y8YDp0XI.js";import"./pos-Bg0NhokT.js";import"./ui-DDOa_cLv.js";const l=()=>{const l=t(),[i,d]=r.useState(""),[c,m]=r.useState(!1),[x,u]=r.useState(""),[b,f]=r.useState(""),[p,g]=r.useState(!1);return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx(a,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center px-4 py-12 bg-[#f7faf9]",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("button",{onClick:()=>l("/login"),className:"flex items-center gap-2 text-[#01bfa5] hover:text-[#018f7b] transition-colors duration-200 mb-8",children:[e.jsx(n,{})," Back to Login"]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-md p-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-brand mb-2 text-center",children:"Forgot Password?"}),e.jsx("p",{className:"text-[#4a6e6a] text-center mb-8",children:"Enter your email address and we'll send you instructions to reset your password."}),p&&x?e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 mb-6",children:[e.jsx("p",{className:"text-green-700 font-semibold text-center",children:x}),e.jsx("p",{className:"text-green-600 text-center text-sm mt-2",children:"Redirecting to login..."})]}):e.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),i){m(!0),f(""),u("");try{await s.forgotPassword(i);u("If an account exists with this email, you will receive password reset instructions shortly."),g(!0),d(""),setTimeout(()=>{l("/login")},3e3)}catch(t){f(t.message||"An error occurred. Please try again.")}finally{m(!1)}}else f("Please enter your email address")},className:"space-y-6",children:[e.jsxs("label",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[#01574C] font-semibold",children:"Email Address"}),e.jsx("input",{type:"email",name:"email",value:i,onChange:e=>{d(e.target.value),f(""),u("")},required:!0,disabled:c,placeholder:"Enter your email",className:"p-3 border border-gray-300 rounded-lg focus:outline-none focus:border-[#01bfa5] focus:ring-2 focus:ring-[rgba(1,191,165,0.2)] transition-all duration-200 "+(c?"opacity-50 cursor-not-allowed":"")})]}),b&&e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:e.jsx("p",{className:"text-red-700 text-sm",children:b})}),e.jsx("button",{type:"submit",disabled:c,className:"w-full bg-[#01bfa5] text-white py-3 px-6 rounded-lg font-semibold transition-all duration-200 hover:bg-[#018f7b] hover:-translate-y-1 "+(c?"opacity-50 cursor-not-allowed":""),children:c?"Sending...":"Send Reset Link"})]}),e.jsx("div",{className:"mt-8 pt-8 border-t border-gray-200",children:e.jsxs("p",{className:"text-[#4a6e6a] text-center text-sm",children:["Remember your password?"," ",e.jsx("button",{onClick:()=>l("/login"),className:"text-[#01bfa5] hover:text-[#018f7b] font-semibold transition-colors duration-200",children:"Sign In"})]})})]})]})}),e.jsx(o,{})]})};export{l as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.