1import{u as x,r as a,s as i,j as e,L as w,t as n}from"./index-dt5w-xvv.js";function g(){const p=x(),[c,o]=a.useState(!1),[r,m]=a.useState(""),[d,h]=a.useState(""),[u,l]=a.useState(!1);a.useEffect(()=>{const{data:t}=i.auth.onAuthStateChange(s=>{(s==="PASSWORD_RECOVERY"||s==="SIGNED_IN")&&o(!0)});return i.auth.getSession().then(({data:s})=>{s.session&&o(!0)}),()=>t.subscription.unsubscribe()},[]);const b=async t=>{if(t.preventDefault(),r.length<8){n.error("Password must be at least 8 characters.");return}if(r!==d){n.error("Passwords don't match.");return}l(!0);const{error:s}=await i.auth.updateUser({password:r});if(l(!1),s){n.error(s.message);return}n.success("Password updated. Signing you inâ¦"),p({to:"/admin"})};return e.jsx("main",{className:"min-h-screen bg-brand-black flex items-center justify-center px-6",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx(w,{to:"/login",className:"block text-center mb-12 text-xs font-black uppercase tracking-[0.3em] text-white/40 hover:text-white",children:"â Back to sign in"}),e.jsxs("div",{className:"glass rounded-card p-10 border border-white/10",children:[e.jsx("h1",{className:"text-4xl font-black tracking-tighter mb-2",children:"Set a new password"}),e.jsx("p",{className:"text-white/40 text-sm mb-8",children:c?"Choose a strong password (min 8 characters).":"Verifying reset linkâ¦"}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black uppercase tracking-widest text-white/50",children:"New password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:r,onChange:t=>m(t.target.value),className:"mt-2 w-full bg-white/5 border border-white/10 rounded-card px-4 py-3 focus:outline-none focus:border-accent-cyan"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-black uppercase tracking-widest text-white/50",children:"Confirm password"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:d,onChange:t=>h(t.target.value),className:"mt-2 w-full bg-white/5 border border-white/10 rounded-card px-4 py-3 focus:outline-none focus:border-accent-cyan"})]}),e.jsx("button",{type:"submit",disabled:u||!c,className:"w-full bg-accent-cyan text-brand-black font-black uppercase tracking-widest text-sm py-4 rounded-pill hover:opacity-90 disabled:opacity-50",children:u?"Updating...":"Update password"})]})]})]})})}export{g as component};
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.