1import{z as B,r as a,k as I,m as L,j as e,C as T,T as i,U as b,I as l,V as F,F as x,B as k,L as j,n as g,X as M,A as w}from"./index-wnr683Hh.js";const E="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.9167%206.25016L14.8334%208.16683C14.9892%208.31952%2015.1986%208.40504%2015.4167%208.40504C15.6349%208.40504%2015.8443%208.31952%2016.0001%208.16683L17.7501%206.41683C17.9028%206.26105%2017.9883%206.05162%2017.9883%205.8335C17.9883%205.61537%2017.9028%205.40594%2017.7501%205.25016L15.8334%203.3335'%20stroke='%2390A1B9'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.5%201.6665L9.5%209.6665'%20stroke='%2390A1B9'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.25008%2017.5002C8.78139%2017.5002%2010.8334%2015.4481%2010.8334%2012.9168C10.8334%2010.3855%208.78139%208.3335%206.25008%208.3335C3.71878%208.3335%201.66675%2010.3855%201.66675%2012.9168C1.66675%2015.4481%203.71878%2017.5002%206.25008%2017.5002Z'%20stroke='%2390A1B9'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function G(){const{register:c,handleSubmit:m,formState:{errors:d},setValue:p}=B(),[t,f]=a.useState(!1),[o,n]=a.useState(!1),[y,N]=a.useState(""),[C,S]=a.useState(""),u=I(),{t:s}=L();a.useEffect(()=>{t&&p("token","")},[t,p]);const v=async r=>{N(r.email),n(!0),(await w.forgotPassword(r.email)).code===200&&(g.toastMessage(s("login.forgot.successEmailSent"),"info",{containerId:"forgotPassword"}),f(!0)),n(!1)},P=async r=>{n(!0);const h={token:r.token,new_password:C,email:y};(await w.resetPassword(h)).code===200&&(g.toastMessage(s("info.3006"),"info",{containerId:"forgotPassword"}),u("/login")),n(!1)};return e.jsx("div",{className:"auth-form-style",children:e.jsxs(T,{style:{width:"100%"},className:"col-md-6",children:[t&&e.jsxs("button",{type:"button",className:"forgot-step-back",onClick:()=>f(!1),disabled:o,children:["â ",s("login.forgot.back")]}),e.jsx("h1",{className:"login-card-title",children:s("login.title.forgot-password")}),e.jsx("p",{className:"login-card-sub",children:s(t?"login.forgot.resetDescription":"login.forgot.description")}),t?e.jsxs(i,{onSubmit:m(P),children:[e.jsxs(i.Group,{children:[e.jsx(b,{className:"label-style",label:s("login.forgot.resetTokenLabel")}),e.jsxs(l,{className:"signin-input-group",children:[e.jsx(l.Text,{className:"icon-type",children:e.jsx("img",{src:E,alt:""})}),e.jsx(x,{...c("token",{required:!0}),className:"signin-input",id:"token",name:"token",type:"text",required:!0,autoComplete:"off",placeholder:s("login.forgot.resetTokenPlaceholder")})]}),e.jsx("small",{className:"font-light",children:d&&g.getFormErrorMessage(d,"token","Token ")}),e.jsx(M,{label:s("login.forgot.newPasswordLabel"),placeHolder:s("login.forgot.newPasswordPlaceholder"),variant:"white",showPasswordStrength:!1,setPassword:S,register:c,errors:d})]}),e.jsx(k,{className:"submit-button-style",variant:"primary",type:"submit",disabled:o,children:o?e.jsx(j,{text:s("login.forgot.resetButton")}):s("login.forgot.resetButton")}),e.jsxs("button",{type:"button",className:"forgot-back-link",onClick:()=>u("/login"),children:["â ",s("login.forgot.backToSignIn")]})]}):e.jsxs(i,{onSubmit:m(v),children:[e.jsxs(i.Group,{children:[e.jsx(b,{className:"label-style",label:s("form.labels.email")}),e.jsxs(l,{className:"signin-input-group",children:[e.jsx(l.Text,{className:"icon-type",id:"basic-addon1",children:e.jsx("img",{src:F,alt:""})}),e.jsx(x,{...c("email",{required:!0}),placeholder:"[email protected]","aria-label":"email","aria-describedby":"basic-addon1",type:"email",required:!0,className:"signin-input"})]})]}),e.jsx(k,{className:"submit-button-style",variant:"primary",type:"submit",disabled:o,children:o?e.jsx(j,{text:s("login.forgot.sendButton")}):s("login.forgot.sendButton")}),e.jsxs("button",{type:"button",className:"forgot-back-link",onClick:()=>u("/login"),children:["â ",s("login.forgot.backToSignIn")]})]})]})})}export{G 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.