1import{b as v,r as t,j as e,L as N}from"./react-D6Y9hML7.js";import{a as l,L as S}from"./index-we3y_myF.js";import{A as k}from"./AuroraHero-CA7sppbc.js";import{I as h}from"./InputGroup-BuN6twLv.js";import{m as C}from"./motion-BeFgxJ7d.js";import{E}from"./eye-off-CjzymW5a.js";import{E as A}from"./eye-OqI3FrGK.js";import"./supabase-CI_V8wt2.js";import"./useQuery-DtTYXR9K.js";import"./LogoMark-DeHCpl4c.js";function U(){const x=v(),[i,f]=t.useState(""),[c,w]=t.useState(""),[n,g]=t.useState(!1),[b,d]=t.useState(!1),[u,a]=t.useState(""),[p,m]=t.useState(!1);t.useEffect(()=>{let s=!1;l.auth.getSession().then(({data:o})=>{s||(o.session?d(!0):a("This reset link has expired or has already been used. Ask for a new one."))});const{data:r}=l.auth.onAuthStateChange((o,j)=>{!s&&j&&(d(!0),a(""))});return()=>{var o;s=!0,(o=r==null?void 0:r.subscription)==null||o.unsubscribe()}},[]);const y=async s=>{if(s.preventDefault(),a(""),i.length<8){a("Password must be at least 8 characters.");return}if(i!==c){a("Those two passwords do not match.");return}m(!0);const{error:r}=await l.auth.updateUser({password:i});if(m(!1),r){a(r.message);return}x("/onboarding",{replace:!0})};return e.jsxs("main",{className:"font-sans flex min-h-screen w-full flex-col lg:flex-row bg-black text-white antialiased p-2 lg:h-screen lg:overflow-hidden lg:p-4",children:[e.jsx(k,{heading:"Set a new password",subtitle:"Then you are straight back in."}),e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center py-12 lg:py-6 px-4 sm:px-12 lg:px-16 xl:px-24 overflow-y-auto",children:e.jsxs(C.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.8,ease:"easeOut"},className:"w-full max-w-xl space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-3xl font-medium tracking-tight",children:"New password"}),e.jsx("p",{className:"text-white/40 text-sm",children:"At least 8 characters."})]}),u&&e.jsx("p",{className:"text-sm text-red-400",children:u}),e.jsxs("form",{onSubmit:y,className:"space-y-5",children:[e.jsx(h,{label:"New password",type:n?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:i,onChange:s=>f(s.target.value),autoComplete:"new-password",required:!0,children:e.jsx("button",{type:"button",onClick:()=>g(s=>!s),className:"absolute right-0.5 top-1/2 flex h-11 w-11 -translate-y-1/2 items-center justify-center text-white/40 hover:text-white","aria-label":n?"Hide password":"Show password",children:n?e.jsx(E,{className:"w-4 h-4"}):e.jsx(A,{className:"w-4 h-4"})})}),e.jsx(h,{label:"Confirm password",type:n?"text":"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:c,onChange:s=>w(s.target.value),autoComplete:"new-password",required:!0}),e.jsxs("button",{type:"submit",disabled:p||!b,className:"w-full h-14 bg-white text-black font-semibold rounded-xl transition hover:bg-white/90 active:scale-[0.98] disabled:opacity-50 flex items-center justify-center gap-2",children:[p&&e.jsx(S,{className:"w-4 h-4 animate-spin"}),"Save password"]})]}),e.jsx("p",{className:"text-sm text-white/40",children:e.jsx(N,{to:"/forgot-password",className:"text-white hover:underline",children:"Send a new link"})})]})})]})}export{U 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.