import{j as e,b9 as L,s as f,bS as W,bT as h,bU as I,o as a,t as o,A as P,bV as A,S as p,bW as B,b3 as E,L as R,B as T,p as z,G as i}from"./vendor-BuNhBR-q.js";import{c as V,f as g,C as b,P as q,i as M,l as G}from"./index-DzxWaMzc.js";import{u as H}from"./UseMounted-CVT6XmWo.js";const j=f("span")(({theme:r})=>({borderRadius:3,width:19,height:19,marginLeft:"4px",boxShadow:r.palette.mode==="dark"?"0 0 0 1px rgb(16 22 26 / 40%)":"inset 0 0 0 1px rgba(0,0,0,.2)",backgroundColor:r.palette.mode==="dark"?"rgba(0,0,0,0.4)":"",".Mui-focusVisible &":{outline:"0px auto rgba(19, 124, 189, 0.6)",outlineOffset:2},"input:hover ~ &":{backgroundColor:(r.palette.mode==="dark",r.palette.primary)},"input:disabled ~ &":{boxShadow:"none",background:r.palette.mode==="dark"?"rgba(57,75,89,.5)":"rgba(206,217,224,.5)"}})),U=f(j)({boxShadow:"none",width:19,height:19,"&:before":{display:"block",width:19,height:19,backgroundImage:`url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E")`,content:'""'}});function D(r){return e.jsx(L,{disableRipple:!0,color:r.color?r.color:"default",checkedIcon:e.jsx(U,{sx:{backgroundColor:r.color?`${r.color}.main`:"primary.main"}}),icon:e.jsx(j,{}),inputProps:{"aria-label":"Checkbox demo"},...r})}const Y=({title:r,subtitle:w,subtext:C})=>{const n=H(),{signin:k}=V(),y=W().shape({email:h().email("Email is invalid").required("Email is required"),password:h().min(6,"Password must be at least 6 characters").required("Password is required")}),l=I({initialValues:{email:"",password:"",submit:null},validationSchema:y,onSubmit:async(m,{setErrors:F,setStatus:u,setSubmitting:x})=>{try{await k(m.email,m.password),n.current&&(u({success:!0}),x(!0))}catch(S){n.current&&(u({success:!1}),F({submit:S.message}),x(!1))}}}),{errors:s,touched:t,handleSubmit:v,isSubmitting:d,getFieldProps:c}=l;return e.jsxs(e.Fragment,{children:[r?e.jsx(a,{fontWeight:"700",variant:"h3",mb:1,children:r}):null,C,s.submit&&e.jsx(o,{mt:2,children:e.jsx(P,{severity:"error",children:s.submit})}),e.jsx(A,{value:l,children:e.jsxs(o,{component:"form",onSubmit:v,children:[e.jsxs(p,{children:[e.jsxs(o,{children:[e.jsx(g,{htmlFor:"email",children:"Email Address"}),e.jsx(b,{id:"email",variant:"outlined",fullWidth:!0,...c("email"),error:!!(t.email&&s.email),helperText:t.email&&s.email})]}),e.jsxs(o,{children:[e.jsx(g,{htmlFor:"password",children:"Password"}),e.jsx(b,{id:"password",type:"password",variant:"outlined",fullWidth:!0,...c("password"),error:!!(t.password&&s.password),helperText:t.password&&s.password})]}),e.jsxs(p,{justifyContent:"space-between",direction:"row",alignItems:"center",my:2,children:[e.jsx(B,{children:e.jsx(E,{control:e.jsx(D,{defaultChecked:!0}),label:"Remember this Device",sx:{"& .MuiFormControlLabel-label":{fontWeight:400}}})}),e.jsx(a,{component:R,to:"/auth/forgotpassword",fontWeight:"500",sx:{textDecoration:"none",color:"#000000",fontWeight:500},children:"Forgot Password ?"})]})]}),e.jsx(o,{children:e.jsx(T,{variant:"contained",size:"large",fullWidth:!0,type:"submit",disabled:d,sx:{backgroundColor:"#3385FF",color:"white",fontSize:"15px","&:hover":{backgroundColor:"gray"},py:1.4,fontWeight:"600",textTransform:"none"},children:d?e.jsx(z,{size:22,color:"inherit"}):"Sign In"})})]})}),w]})},J=()=>e.jsx(q,{title:"Login",description:"this is Login page",children:e.jsxs(i,{container:!0,spacing:0,sx:{minHeight:"100vh",overflowX:"hidden",backgroundColor:"#ffffff",boxSizing:"border-box"},children:[e.jsx(i,{item:!0,xs:12,md:6,sx:{backgroundColor:"#00265C",display:{xs:"none",md:"flex"},justifyContent:"center",alignItems:"center",p:4},children:e.jsx(o,{component:"img",src:M,alt:"Login Illustration",sx:{width:"100%",maxWidth:380,height:"auto"}})}),e.jsx(i,{item:!0,xs:12,md:6,display:"flex",justifyContent:"center",alignItems:"center",children:e.jsxs(o,{sx:{width:"100%",maxWidth:500,px:{xs:3,sm:4,md:6},py:{xs:6,md:0},animation:"fadeInUp 0.6s ease-out","@keyframes fadeInUp":{from:{opacity:0,transform:"translateY(10px)"},to:{opacity:1,transform:"translateY(0)"}}},children:[e.jsx(o,{sx:{mb:4,textAlign:"center"},children:e.jsx(o,{component:"img",src:G,alt:"Veerayee HR",sx:{width:"100%",maxWidth:200,mx:"auto",display:"block"}})}),e.jsx(a,{variant:"h6",sx:{mb:4,fontWeight:500,color:"#000000",textAlign:"center"},children:"VHR Compliance Suite"}),e.jsx(Y,{title:null})]})})]})});export{J as default};
