1import{r as a,j as s}from"./vendor-BMTqjksT.js";import{u as S,t as F,a as E,k as m,B as l,g as n,S as B,b as q,C as I,c as L,d as O,e as T,f as A,L as g,I as h,D as G,l as H,m as M,n as Y,o as U,p as J,j as f,q as K,i as z}from"./index-C0VezhcQ.js";import{E as Q}from"./eye-off-Cf0vp_LU.js";import{E as V}from"./eye-DVSAdHcm.js";import"./trpc-c2OaEmLI.js";import"./d3-ngNJxV2x.js";function es(){const[,P]=S(),y=F.useUtils(),j=E(),d=new URLSearchParams(j).get("token")??"",[r,R]=a.useState(""),[i,b]=a.useState(""),[c,N]=a.useState(!1),[o,x]=a.useState(!1),[v,p]=a.useState(!1),[u,t]=a.useState(null);if(!d)return s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:37",className:"min-h-screen bg-background flex items-center justify-center px-4 py-12",children:s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:38",className:"w-full max-w-md text-center",children:[s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:39",className:"flex justify-center mb-4",children:s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:40",className:"w-14 h-14 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(m,{"data-loc":"client/src/pages/ResetPassword.tsx:41",className:"w-7 h-7 text-destructive"})})}),s.jsx("h1",{"data-loc":"client/src/pages/ResetPassword.tsx:44",className:"text-2xl font-bold mb-2",style:{fontFamily:"'Playfair Display', 'Playfair Display Fallback', Georgia, serif"},children:"Invalid reset link"}),s.jsx("p",{"data-loc":"client/src/pages/ResetPassword.tsx:47",className:"text-muted-foreground mb-6",children:"This password reset link is missing or malformed. Please request a new one."}),s.jsx(l,{"data-loc":"client/src/pages/ResetPassword.tsx:50",asChild:!0,children:s.jsx(n,{"data-loc":"client/src/pages/ResetPassword.tsx:51",href:"/forgot-password/",children:"Request new link"})})]})});const k=async e=>{if(e.preventDefault(),t(null),r.length<8){t("Password must be at least 8 characters");return}if(r!==i){t("Passwords do not match");return}x(!0);try{const w=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d,password:r})}),D=await w.json();if(!w.ok){t(D.error||"Failed to reset password");return}await y.auth.me.invalidate(),p(!0)}catch{t("Network error. Please try again.")}finally{x(!1)}},C=()=>{p(!1),z.success("You are now signed in with your new password."),P("/portal")};return s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-loc":"client/src/pages/ResetPassword.tsx:102",title:"Set a New Password â National Bankruptcy Advocates",description:"Create a new secure password for your National Bankruptcy Advocates attorney account. This link expires after 24 hours.",canonical:"https://bankruptcylawyersin.com/reset-password",noIndex:!0}),s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:108",className:"min-h-screen bg-background flex items-center justify-center px-4 py-12",children:s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:109",className:"w-full max-w-md",children:[s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:111",className:"flex justify-center mb-8",children:s.jsxs(n,{"data-loc":"client/src/pages/ResetPassword.tsx:112",href:"/",className:"flex items-center gap-2 text-foreground hover:opacity-80 transition-opacity",children:[s.jsx(q,{"data-loc":"client/src/pages/ResetPassword.tsx:113",className:"w-7 h-7 text-accent"}),s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:114",children:[s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:115",className:"font-black text-base leading-none tracking-tight",style:{fontFamily:"'Playfair Display', 'Playfair Display Fallback', Georgia, serif"},children:"National Bankruptcy"}),s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:118",className:"text-[10px] tracking-[0.15em] uppercase text-muted-foreground font-medium",children:"Advocates"})]})]})}),s.jsxs(I,{"data-loc":"client/src/pages/ResetPassword.tsx:125",className:"border-border/50 shadow-lg",children:[s.jsxs(L,{"data-loc":"client/src/pages/ResetPassword.tsx:126",className:"text-center pb-4",children:[s.jsx(O,{"data-loc":"client/src/pages/ResetPassword.tsx:127",className:"text-2xl font-bold",style:{fontFamily:"'Playfair Display', 'Playfair Display Fallback', Georgia, serif"},children:"Choose a new password"}),s.jsx(T,{"data-loc":"client/src/pages/ResetPassword.tsx:130",className:"text-base mt-2",children:"Enter a new password for your account. Mu
1st be at least 8 characters."})]}),s.jsx(A,{"data-loc":"client/src/pages/ResetPassword.tsx:135",className:"pt-2",children:s.jsxs("form",{"data-loc":"client/src/pages/ResetPassword.tsx:136",onSubmit:k,className:"space-y-5",children:[s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:137",className:"space-y-2",children:[s.jsx(g,{"data-loc":"client/src/pages/ResetPassword.tsx:138",htmlFor:"password",children:"New password"}),s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:139",className:"relative",children:[s.jsx(h,{"data-loc":"client/src/pages/ResetPassword.tsx:140",id:"password",type:c?"text":"password",placeholder:"At least 8 characters",value:r,onChange:e=>R(e.target.value),autoComplete:"new-password",autoFocus:!0,required:!0,disabled:o,className:"pr-10"}),s.jsx("button",{"data-loc":"client/src/pages/ResetPassword.tsx:152",type:"button",onClick:()=>N(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c?s.jsx(Q,{"data-loc":"client/src/pages/ResetPassword.tsx:158",className:"w-4 h-4"}):s.jsx(V,{"data-loc":"client/src/pages/ResetPassword.tsx:158",className:"w-4 h-4"})})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:163",className:"space-y-2",children:[s.jsx(g,{"data-loc":"client/src/pages/ResetPassword.tsx:164",htmlFor:"confirmPassword",children:"Confirm new password"}),s.jsx(h,{"data-loc":"client/src/pages/ResetPassword.tsx:165",id:"confirmPassword",type:c?"text":"password",placeholder:"Repeat your new password",value:i,onChange:e=>b(e.target.value),autoComplete:"new-password",required:!0,disabled:o})]}),u&&s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:178",className:"flex items-start gap-2 text-sm text-destructive bg-destructive/10 border border-destructive/20 rounded-md px-3 py-2",children:[s.jsx(m,{"data-loc":"client/src/pages/ResetPassword.tsx:179",className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsx("span",{"data-loc":"client/src/pages/ResetPassword.tsx:180",children:u})]}),s.jsx(l,{"data-loc":"client/src/pages/ResetPassword.tsx:184",type:"submit",className:"w-full bg-accent hover:bg-accent/90 text-accent-foreground font-semibold",disabled:o,children:o?"Resetting...":"Reset password"}),s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:192",className:"text-center",children:s.jsx(n,{"data-loc":"client/src/pages/ResetPassword.tsx:193",href:"/sign-in/",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Back to sign in"})})]})})]})]})}),s.jsx(G,{"data-loc":"client/src/pages/ResetPassword.tsx:204",open:v,onOpenChange:()=>{},children:s.jsxs(H,{"data-loc":"client/src/pages/ResetPassword.tsx:205",className:"sm:max-w-md text-center",onPointerDownOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[s.jsxs(M,{"data-loc":"client/src/pages/ResetPassword.tsx:210",className:"items-center gap-4",children:[s.jsx("div",{"data-loc":"client/src/pages/ResetPassword.tsx:211",className:"w-16 h-16 rounded-full bg-accent/10 flex items-center justify-center mx-auto",children:s.jsx(Y,{"data-loc":"client/src/pages/ResetPassword.tsx:212",className:"w-8 h-8 text-accent"})}),s.jsx(U,{"data-loc":"client/src/pages/ResetPassword.tsx:214",className:"text-2xl font-bold text-center",style:{fontFamily:"'Playfair Display', 'Playfair Display Fallback', Georgia, serif"},children:"Password successfully reset"}),s.jsxs(J,{"data-loc":"client/src/pages/ResetPassword.tsx:217",className:"text-center text-base space-y-2",children:[s.jsx("span",{"data-loc":"client/src/pages/ResetPassword.tsx:218",className:"block",children:"Your password has been updated and you are now signed in to your account."}),s.jsx("span",{"data-loc":"client/src/pages/ResetPassword.tsx:221",className:"block text-sm text-muted-foreground",children:"For your security, any other active sessions using your old password have been invalidated. If you did not request this change, please contact support immediately."})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:228",className:"flex flex-col gap-2 mt-2",children:[s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:229",className:"flex items-center gap-2 text-sm text-muted-foreground bg-muted/50 rounded-md px-4 py-3",children:[s.jsx(f,{"data-loc":"client/src/pages/ResetPassword.tsx:230",className:"w-4 h-4 text-accent flex-shrink-0"}),s.jsx("span",{"data-loc":"client/src/pages/ResetPassword.tsx:231",children:"Password updated successfully"})]}),s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:233",className:"flex items-center gap-2 text-sm text-muted-foreground bg-muted/50 rounded-md px-4 py-3",children:[s.jsx(f,{"data-loc":"client/src/pages/ResetPassword.tsx:234",className:"w-4 h-4 text-accent flex-shrink-0"}),s.jsx("span",{"data-loc":"client/src/pages/ResetPassword.tsx:235",children:"You are now signed in"})]})]}),s.jsx(K,{"data-loc":"client/src/pages/ResetPassword.tsx:239",className:"mt-4",children:s.jsx(l,{"data-loc":"client/src/pages/ResetPassword.tsx:240",onClick:C,className:"w-full bg-accent hover:bg-accent/90 text-accent-foreground font-semibold",children:"Continue to my portal"})})]})})]})}export{es 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.