import{z as y,y as P,r as N,A as S,E as F,w as e,F as I,S as k,G as R,T as i,R as x,I as h,H as p,J as u,M as A,a0 as B,N as K,a3 as T,a1 as _,Q as C,U as b,a2 as H,K as L,s as z}from"./index.93207066.js";import{P as M}from"./paths.3971dbe6.js";import{P as U}from"./Page.54724e9a.js";var s="/var/www/aso/frontend/hospital-portal/src/sections/auth/forget-password/ForgetPasswordForm.tsx";function W({token:o}){const t=y(),n=P(),[l,v]=N.exports.useState(!1),[m,w]=N.exports.useState(!1),g=S().shape({}),d=F({resolver:K(g)}),{handleSubmit:j,setError:E,formState:{errors:c,isSubmitting:D}}=d,V=async f=>{try{await B.post("/forget-password",{...f,token:o}),console.log(f),await new Promise(a=>setTimeout(a,500)),t.current&&n("/auth/login",{replace:!0})}catch(a){console.log(a.response.data),t.current&&E("afterSubmit",{...a,message:a.response.data.message})}};return e.exports.jsxDEV(I,{methods:d,onSubmit:j(V),children:e.exports.jsxDEV(k,{spacing:3,children:[!!c.afterSubmit&&e.exports.jsxDEV(R,{severity:"error",children:c.afterSubmit.message},void 0,!1,{fileName:s,lineNumber:70,columnNumber:34},this),e.exports.jsxDEV(i,{children:"Kata Sandi Baru"},void 0,!1,{fileName:s,lineNumber:71,columnNumber:9},this),e.exports.jsxDEV(x,{name:"new_password",label:"Kata Sandi Baru",type:l?"text":"password",InputProps:{endAdornment:e.exports.jsxDEV(h,{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(i,{children:"Konfirmasi Kata Sandi "},void 0,!1,{fileName:s,lineNumber:86,columnNumber:9},this),e.exports.jsxDEV(x,{name:"confirm_new_password",label:"Konfirmasi Kata Sandi",type:m?"text":"password",InputProps:{endAdornment:e.exports.jsxDEV(h,{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(A,{fullWidth:!0,size:"large",type:"submit",variant:"contained",loading:D,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/frontend/hospital-portal/src/pages/auth/ForgetPassword.tsx";const G=z("div")(({theme:o})=>({display:"flex",height:"100%",alignItems:"center",padding:o.spacing(12,0)}));function $(){const[o,t]=T(),n=o.get("token");return e.exports.jsxDEV(U,{title:"Verify",sx:{height:1},children:e.exports.jsxDEV(G,{children:[e.exports.jsxDEV(_,{},void 0,!1,{fileName:r,lineNumber:34,columnNumber:9},this),e.exports.jsxDEV(C,{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(i,{variant:"h3",paragraph:!0},void 0,!1,{fileName:r,lineNumber:48,columnNumber:13},this),e.exports.jsxDEV(i,{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(W,{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{$ as default};
