1import{u as C,t as e,h as r,l as v,n as b,af as z,a as R,b as F,j as t,i as d,x as S,I as h,B as k}from"./index-DooN5l6I.js";import{u as I,t as L,z as c}from"./index-DTTme6Fz.js";import{u as M,c as _}from"./useAuthQueryClient-CFc8NFw1.js";const E=()=>{const{invalidatePasswordConfirmation:s}=M();return C({mutationFn:async o=>await _(o),onSuccess:s})},q=r.section` 2 height: 100vh; 3 width: 100vw; 4 display: flex; 5 flex-direction: column; 6 align-items: center; 7 justify-content: center; 8 background: ${e.colors.neutral[50]}; 9`,A=r.h1` 10 font-size: ${e.fonts.size.heading3}; 11 font-weight: ${e.fonts.weight.normal}; 12 line-height: 24px; 13 letter-spacing: -0.4px; 14 color: ${e.colors.grey[900]}; 15`,B=r.span` 16 font-size: ${e.fonts.size.body3}; 17 font-weight: ${e.fonts.weight.lighter}; 18 line-height: 18px; 19 letter-spacing: -0.32px; 20`,N=r.form` 21 width: 100%; 22`,T=r.div` 23 display: flex; 24 flex-direction: column; 25 align-items: center; 26 width: 80vw; 27 max-width: 500px; 28 padding: ${e.space.xl} ${e.space.xl3}; 29 background-color: ${e.colors.neutral[0]}; 30 border-radius: ${e.radius.md}; 31 box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1); 32`;r.span` 33 padding-left: ${e.space.xs}; 34 color: #e74c3c; 35 font-size: 0.85rem; 36`;const V=s=>c.object({newPassword:c.string().min(1,s("validation.required")).min(6,s("validation.minLength")),newPasswordConfirmation:c.string().min(1,s("validation.required")).min(6,s("validation.minLength"))}).refine(o=>o.newPassword===o.newPasswordConfirmation,{path:["newPasswordConfirmation"],message:s("validation.passwordsMustMatch")}),l=S(),D=()=>{const{t:s}=b("passwordReset"),{id:o,token:f}=z({strict:!1}),x=R(),a=F(),{mutateAsync:P,isPending:y}=E(),{register:w,handleSubmit:$,watch:i,formState:{errors:m}}=I({resolver:L(V(s))}),j=async p=>{var u,g;try{const n=await P({token:f,reset_id:o,new_password:p.newPassword,new_password_confirmation:p.newPasswordConfirmation});n.status===200||n.status===201||n.status===202?(a.success(s("passwordChangedSuccess")),x.navigate({to:"/?login=open"})):(u=n.data)!=null&&u.detail&&((g=n.data)==null?void 0:g.detail.length)>0?a.error(n.data.detail[0].msg):a.error(s("serverError"))}catch{a.error(s("serverError"))}};return t.jsx(q,{children:t.jsx(T,{children:t.jsxs(d,{$col:!0,$align:"center",$gap:e.space.lg,style:{width:"100%"},children:[typeof l=="string"?t.jsx("img",{src:l,alt:"Company logo",className:"logo",style:{width:"140px"}}):t.jsx(l,{style:{width:"140px"}}),t.jsxs(d,{$col:!0,$gap:e.space.xs2,style:{width:"100%"},children:[t.jsx(A,{children:s("title")}),t.jsx(B,{children:s("description")})]}),t.jsx(N,{onSubmit:$(j),children:t.jsxs(d,{$col:!0,$gap:e.space.md,children:[t.jsx(h,{type:"password",label:s("newPassword"),hasValue:!!i("newPassword")&&i("newPassword")!=="",errorInfo:m.newPassword,...w("newPassword")}),t.jsx(h,{type:"password",label:s("confirmPassword"),hasValue:!!i("newPasswordConfirmation")&&i("newPasswordConfirmation")!=="",errorInfo:m.newPasswordConfirmation,...w("newPasswordConfirmation")}),t.jsx(k,{pendoId:"confirm-password-submit",type:"submit",variant:"primary",size:"large",text:s("save"),isLoading:y})]})})]})})})},J=v("/login/password-reset/reset/$id/token/$token")({component:D});export{J as Route};
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.