1import{r as o,d as w,j as s,P as x,T as c,S as g,k as j,e as P,G as b,g as f,p as S,B as C,l as v,b as T,C as U,H as y}from"./main-M4yddEHv.js";import"./site-BkAyI5ju.js";const B=({code:t})=>{const[r,d]=o.useState(null),[i,n]=o.useState("green"),[u,p]=o.useTransition(),a=w({initialValues:{code:t,password:""},validate:{code:e=>e.length<6?"Code should include at least 6 characters":null,password:e=>e.length<6?"Password should include at least 6 characters":null}}),m=(e,h)=>{p(async()=>{const l=await v(e,h);l.status===0?(d("Password updated successfully"),n("green")):(d(l.message),n("red"))})};return s.jsxs(x,{radius:"md",p:"xl",withBorder:!0,children:[s.jsx(c,{size:"lg",fw:500,children:"Update password"}),s.jsxs("form",{onSubmit:a.onSubmit(e=>{m(e.code,e.password)}),children:[s.jsxs(g,{children:[s.jsx(j,{required:!0,label:"Password",placeholder:"Your new password",value:a.values.password,onChange:e=>a.setFieldValue("password",e.currentTarget.value),error:a.errors.password&&"Password should include at least 6 characters",radius:"md",mt:"md"}),s.jsx(P,{disabled:!0,label:"Code",value:a.values.code,error:a.errors.code&&"Invalid code",radius:"md",mt:"md"}),r&&s.jsx(c,{c:i,mt:"sm",children:r})]}),s.jsxs(b,{justify:"space-between",mt:"xl",children:[s.jsx(f,{component:"a",c:"dimmed",href:S.login.getHref(),size:"xs",children:"Back to the login page"}),s.jsx(C,{type:"submit",radius:"xl",loading:u,loaderProps:{type:"dots"},children:"Update password"})]})]})]})},z=()=>{const[t]=T(),r=t.get("code");return s.jsxs(U,{size:"xs",children:[s.jsx(y,{title:"Update Password",description:"Update Password"}),s.jsx(B,{code:r||""})]})};export{z as UpdatePasswordRoute};
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.