1import{j as s}from"./editor-BhGk7_S1.js";import{b as c}from"./leaflet-DcfcX7a_.js";import{u as f,d as R,t as a,b as j,A as i,f as b}from"./index-BjIHAQhU.js";import{B as m}from"./button-CK76V7Lo.js";import{I as u}from"./input-BtSXPsMX.js";import{L as p}from"./label-DwWfObJM.js";import{C as v,a as N,b as C,c as y,d as L}from"./card-CaSmhJ1l.js";import"./mapbox-BPFQ-Sfv.js";import"./trpc-DqtxhgQo.js";import"./dialog-DDbhAKMR.js";import"./index-CmmlU_cv.js";import"./x-rm1_-8OE.js";function _(){const{t:e}=f(),[,r]=R(),[w,x]=c.useState(""),[o,h]=c.useState(""),[d,P]=c.useState("");c.useEffect(()=>{const l=new URLSearchParams(window.location.search).get("token");l?x(l):(a.error(e("auth.invalidToken")),setTimeout(()=>r("/"),3e3))},[e,r]);const n=j.auth.resetPassword.useMutation({onSuccess:()=>{a.success(e("auth.passwordResetSuccess")),setTimeout(()=>r("/"),2e3)},onError:t=>{a.error(t.message||e("auth.invalidToken"))}}),g=t=>{if(t.preventDefault(),o!==d){a.error(e("auth.passwordMismatch"));return}if(o.length<8){a.error("Password must be at least 8 characters");return}n.mutate({token:w,newPassword:o})};return s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:61",className:"min-h-screen flex flex-col items-center justify-center bg-gradient-to-b from-gray-900 via-blue-900 to-gray-900 p-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:63",className:"mb-8 text-center",children:[s.jsx("img",{"data-loc":"client/src/pages/ResetPassword.tsx:64",src:b,alt:i,className:"h-16 mx-auto mb-4"}),s.jsx("h1",{"data-loc":"client/src/pages/ResetPassword.tsx:65",className:"text-2xl font-bold text-white",children:i})]}),s.jsxs(v,{"data-loc":"client/src/pages/ResetPassword.tsx:68",className:"w-full max-w-md",children:[s.jsxs(N,{"data-loc":"client/src/pages/ResetPassword.tsx:69",children:[s.jsx(C,{"data-loc":"client/src/pages/ResetPassword.tsx:70",children:e("auth.resetPassword")}),s.jsx(y,{"data-loc":"client/src/pages/ResetPassword.tsx:71",children:e("auth.newPassword")})]}),s.jsx(L,{"data-loc":"client/src/pages/ResetPassword.tsx:75",children:s.jsxs("form",{"data-loc":"client/src/pages/ResetPassword.tsx:76",onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:77",className:"space-y-2",children:[s.jsx(p,{"data-loc":"client/src/pages/ResetPassword.tsx:78",htmlFor:"new-password",children:e("auth.newPassword")}),s.jsx(u,{"data-loc":"client/src/pages/ResetPassword.tsx:79",id:"new-password",type:"password",value:o,onChange:t=>h(t.target.value),required:!0,minLength:8,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),s.jsxs("div",{"data-loc":"client/src/pages/ResetPassword.tsx:90",className:"space-y-2",children:[s.jsx(p,{"data-loc":"client/src/pages/ResetPassword.tsx:91",htmlFor:"confirm-password",children:e("auth.confirmPassword")}),s.jsx(u,{"data-loc":"client/src/pages/ResetPassword.tsx:92",id:"confirm-password",type:"password",value:d,onChange:t=>P(t.target.value),required:!0,minLength:8,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"}),s.jsx("p",{"data-loc":"client/src/pages/ResetPassword.tsx:101",className:"text-xs text-muted-foreground",children:"At least 8 characters"})]}),s.jsx(m,{"data-loc":"client/src/pages/ResetPassword.tsx:104",type:"submit",className:"w-full",disabled:n.isPending,children:n.isPending?e("auth.resettingPassword"):e("auth.resetPasswordButton")}),s.jsx(m,{"data-loc":"client/src/pages/ResetPassword.tsx:112",type:"button",variant:"outline",className:"w-full",onClick:()=>r("/"),children:e("common.cancel")})]})})]})]})}export{_ 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.