import{b as P,a as S,r as N,c as y,e as F,j as e,F as k,S as I,A as B,T as a,R as h,I as x,f as p,g as u,h as R,z as A,o as C,H as K,D as T,C as _,B as b,E as H,G as L,s as z}from"./index.8bbf4759.js";import{P as M}from"./paths.3971dbe6.js";import{P as W}from"./Page.70299ecd.js";var s="/var/www/aso.linksehat.dev/frontend/hospital-portal/src/sections/auth/forget-password/ForgetPasswordForm.tsx";function G({token:o}){const t=P(),n=S(),[l,v]=N.exports.useState(!1),[m,w]=N.exports.useState(!1),g=y().shape({}),d=F({resolver:C(g)}),{handleSubmit:j,setError:D,formState:{errors:c,isSubmitting:E}}=d,V=async f=>{try{await A.post("/forget-password",{...f,token:o}),console.log(f),await new Promise(i=>setTimeout(i,500)),t.current&&n("/auth/login",{replace:!0})}catch(i){console.log(i.response.data),t.current&&D("afterSubmit",{...i,message:i.response.data.message})}};return e.exports.jsxDEV(k,{methods:d,onSubmit:j(V),children:e.exports.jsxDEV(I,{spacing:3,children:[!!c.afterSubmit&&e.exports.jsxDEV(B,{severity:"error",children:c.afterSubmit.message},void 0,!1,{fileName:s,lineNumber:70,columnNumber:34},this),e.exports.jsxDEV(a,{children:"Kata Sandi Baru"},void 0,!1,{fileName:s,lineNumber:71,columnNumber:9},this),e.exports.jsxDEV(h,{name:"new_password",label:"Kata Sandi Baru",type:l?"text":"password",InputProps:{endAdornment:e.exports.jsxDEV(x,{position:"end",children:e.exports.jsxDEV(p,{onClick:()=>v(!l),edge:"end",children:e.exports.jsxDEV(u,{icon:l?"eva:eye-fill":"eva:eye-off-fill"},void 0,!1,{fileName:s,lineNumber:80,columnNumber:19},this)},void 0,!1,{fileName:s,lineNumber:79,columnNumber:17},this)},void 0,!1,{fileName:s,lineNumber:78,columnNumber:15},this)}},void 0,!1,{fileName:s,lineNumber:72,columnNumber:9},this),e.exports.jsxDEV(a,{children:"Konfirmasi Kata Sandi "},void 0,!1,{fileName:s,lineNumber:86,columnNumber:9},this),e.exports.jsxDEV(h,{name:"confirm_new_password",label:"Konfirmasi Kata Sandi",type:m?"text":"password",InputProps:{endAdornment:e.exports.jsxDEV(x,{position:"end",children:e.exports.jsxDEV(p,{onClick:()=>w(!m),edge:"end",children:e.exports.jsxDEV(u,{icon:m?"eva:eye-fill":"eva:eye-off-fill"},void 0,!1,{fileName:s,lineNumber:98,columnNumber:19},this)},void 0,!1,{fileName:s,lineNumber:94,columnNumber:17},this)},void 0,!1,{fileName:s,lineNumber:93,columnNumber:15},this)}},void 0,!1,{fileName:s,lineNumber:87,columnNumber:9},this),e.exports.jsxDEV(R,{fullWidth:!0,size:"large",type:"submit",variant:"contained",loading:E,children:"Reset Password"},void 0,!1,{fileName:s,lineNumber:105,columnNumber:9},this)]},void 0,!0,{fileName:s,lineNumber:69,columnNumber:7},this)},void 0,!1,{fileName:s,lineNumber:68,columnNumber:5},this)}var r="/var/www/aso.linksehat.dev/frontend/hospital-portal/src/pages/auth/ForgetPassword.tsx";const O=z("div")(({theme:o})=>({display:"flex",height:"100%",alignItems:"center",padding:o.spacing(12,0)}));function J(){const[o,t]=K(),n=o.get("token");return e.exports.jsxDEV(W,{title:"Verify",sx:{height:1},children:e.exports.jsxDEV(O,{children:[e.exports.jsxDEV(T,{},void 0,!1,{fileName:r,lineNumber:34,columnNumber:9},this),e.exports.jsxDEV(_,{children:e.exports.jsxDEV(b,{sx:{maxWidth:480,mx:"auto"},children:[e.exports.jsxDEV(H,{size:"small",component:L,to:M.login,startIcon:e.exports.jsxDEV(u,{icon:"eva:arrow-ios-back-fill",width:20,height:20},void 0,!1,{fileName:r,lineNumber:42,columnNumber:26},this),sx:{mb:3},children:"Back"},void 0,!1,{fileName:r,lineNumber:38,columnNumber:13},this),e.exports.jsxDEV(a,{variant:"h3",paragraph:!0},void 0,!1,{fileName:r,lineNumber:48,columnNumber:13},this),e.exports.jsxDEV(a,{sx:{color:"text.secondary"},children:"Please enter your new password."},void 0,!1,{fileName:r,lineNumber:49,columnNumber:13},this),e.exports.jsxDEV(b,{sx:{mt:5,mb:3},children:e.exports.jsxDEV(G,{token:n},void 0,!1,{fileName:r,lineNumber:54,columnNumber:15},this)},void 0,!1,{fileName:r,lineNumber:53,columnNumber:13},this)]},void 0,!0,{fileName:r,lineNumber:37,columnNumber:11},this)},void 0,!1,{fileName:r,lineNumber:36,columnNumber:9},this)]},void 0,!0,{fileName:r,lineNumber:33,columnNumber:7},this)},void 0,!1,{fileName:r,lineNumber:32,columnNumber:5},this)}export{J as default};
