2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
var ge=Object.defineProperty,Ce=Object.defineProperties;var xe=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var K=(e,t,o)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,U=(e,t)=>{for(var o in t||(t={}))Q.call(t,o)&&K(e,o,t[o]);if(H)for(var o of H(t))X.call(t,o)&&K(e,o,t[o]);return e},T=(e,t)=>Ce(e,xe(t));var Y=(e,t)=>{var o={};for(var n in e)Q.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&H)for(var n of H(e))t.indexOf(n)<0&&X.call(e,n)&&(o[n]=e[n]);return o};import{g as N,a as O,s as y,B as ke,_ as i,r as I,b as j,u as ve,c as ne,d as q,j as p,e as a,f as ae,h as $,i as D,k as ye,l as we,m as se,n as Pe,T as L,o as Se,p as Ie,q as Fe,C as Re,t as re,v as Be,w as Le,x as $e,y as Z,z as ze,F as He,S as A,A as ee,R as te,I as Ue,D as Ee,E as Me,L as ie,G as le,H as Te,J as _e,K as oe,M as Ae,N as Ne,O as Oe,P as je,Q as qe,U as De}from"./index.de6e8fe5.js";import{P as We}from"./Page.080e4607.js";import{C as Ve}from"./Card.f5620e98.js";function Ge(e){return N("PrivateSwitchBase",e)}O("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Je=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Ke=e=>{const{classes:t,checked:o,disabled:n,edge:s}=e,r={root:["root",o&&"checked",n&&"disabled",s&&`edge${$(s)}`],input:["input"]};return q(r,Ge,t)},Qe=y(ke)(({ownerState:e})=>i({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),Xe=y("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Ye=I.exports.forwardRef(function(t,o){const{autoFocus:n,checked:s,checkedIcon:r,className:m,defaultChecked:f,disabled:w,disableFocusRipple:l=!1,edge:g=!1,icon:C,id:c,inputProps:d,inputRef:h,name:u,onBlur:x,onChange:P,onFocus:k,readOnly:F,required:ce,tabIndex:de,type:z,value:W}=t,ue=j(t,Je),[V,pe]=ve({controlled:s,default:Boolean(f),name:"SwitchBase",state:"checked"}),v=ne(),me=b=>{k&&k(b),v&&v.onFocus&&v.onFocus(b)},he=b=>{x&&x(b),v&&v.onBlur&&v.onBlur(b)},fe=b=>{if(b.nativeEvent.defaultPrevented)return;const J=b.target.checked;pe(J),P&&P(b,J)};let B=w;v&&typeof B=="undefined"&&(B=v.disabled);const be=z==="checkbox"||z==="radio",M=i({},t,{checked:V,disabled:B,disableFocusRipple:l,edge:g}),G=Ke(M);return p(Qe,i({component:"span",className:ae(G.root,m),centerRipple:!0,focusRipple:!l,disabled:B,tabIndex:null,role:void 0,onFocus:me,onBlur:he,ownerState:M,ref:o},ue,{children:[a(Xe,i({autoFocus:n,checked:s,defaultChecked:f,className:G.input,disabled:B,id:be&&c,name:u,onChange:fe,readOnly:F,ref:h,required:ce,ownerState:M,tabIndex:de,type:z},z==="checkbox"&&W===void 0?{}:{value:W},d)),V?r:C]}))});var Ze=Ye,et=D(a("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),tt=D(a("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),ot=D(a("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function nt(e){return N("MuiCheckbox",e)}const at=O("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary"]);var _=at;const st=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size"],rt=e=>{const{classes:t,indeterminate:o,color:n}=e,s={root:["root",o&&"indeterminate",`color${$(n)}`]},r=q(s,nt,t);return i({},t,r)},it=y(Ze,{shouldForwardProp:e=>ye(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.indeterminate&&t.indeterminate,o.color!=="default"&&t[`color${$(o.color)}`]]}})(({theme:e,ownerState:t})=>i({color:e.palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:we(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${_.checked}, &.${_.indeterminate}`]:{color:e.palette[t.color].main},[`&.${_.disabled}`]:{color:e.palette.action.disabled}})),lt=a(tt,{}),ct=a(et,{}),dt=a(ot,{}),ut=I.exports.forwardRef(function(t,o){var n,s;const r=se({props:t,name:"MuiCheckbox"}),{checkedIcon:m=lt,color:f="primary",icon:w=ct,indeterminate:l=!1,indeterminateIcon:g=dt,inputProps:C,size:c="medium"}=r,d=j(r,st),h=l?g:w,u=l?g:m,x=i({},r,{color:f,indeterminate:l,size:c}),P=rt(x);return a(it,i({type:"checkbox",inputProps:i({"data-indeterminate":l},C),icon:I.exports.cloneElement(h,{fontSize:(n=h.props.fontSize)!=null?n:c}),checkedIcon:I.exports.cloneElement(u,{fontSize:(s=u.props.fontSize)!=null?s:c}),ownerState:x,ref:o},d,{classes:P}))});var pt=ut;function mt(e){return N("MuiFormControlLabel",e)}const ht=O("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error"]);var E=ht;const ft=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","value"],bt=e=>{const{classes:t,disabled:o,labelPlacement:n,error:s}=e,r={root:["root",o&&"disabled",`labelPlacement${$(n)}`,s&&"error"],label:["label",o&&"disabled"]};return q(r,mt,t)},gt=y("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${E.label}`]:t.label},t.root,t[`labelPlacement${$(o.labelPlacement)}`]]}})(({theme:e,ownerState:t})=>i({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${E.disabled}`]:{cursor:"default"}},t.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},t.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},t.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${E.label}`]:{[`&.${E.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),Ct=I.exports.forwardRef(function(t,o){const n=se({props:t,name:"MuiFormControlLabel"}),{className:s,componentsProps:r={},control:m,disabled:f,disableTypography:w,label:l,labelPlacement:g="end"}=n,C=j(n,ft),c=ne();let d=f;typeof d=="undefined"&&typeof m.props.disabled!="undefined"&&(d=m.props.disabled),typeof d=="undefined"&&c&&(d=c.disabled);const h={disabled:d};["checked","name","onChange","value","inputRef"].forEach(F=>{typeof m.props[F]=="undefined"&&typeof n[F]!="undefined"&&(h[F]=n[F])});const u=Pe({props:n,muiFormControl:c,states:["error"]}),x=i({},n,{disabled:d,labelPlacement:g,error:u.error}),P=bt(x);let k=l;return k!=null&&k.type!==L&&!w&&(k=a(L,i({component:"span",className:P.label},r.typography,{children:k}))),p(gt,i({className:ae(P.root,s),ownerState:x,ref:o},C,{children:[I.exports.cloneElement(m,h),k]}))});var xt=Ct;function kt(e){return e.charAt(0).toUpperCase()+e.substr(1)}function vt(e){return kt(e.toLowerCase())}function yt(e,t){return t===void 0&&(t={}),Se(e,Ie({delimiter:" ",transform:vt},t))}function wt(o){var n=o,{name:e}=n,t=Y(n,["name"]);const{control:s}=Fe();return a(xt,U({control:a(Re,{name:e,control:s,render:({field:r})=>a(pt,T(U({},r),{checked:r.value}))})},t))}function R(e,t){return`${e}${t}`}const S="/auth",Pt={root:S,login:R(S,"/login"),register:R(S,"/register"),loginUnprotected:R(S,"/login-unprotected"),registerUnprotected:R(S,"/register-unprotected"),verify:R(S,"/verify"),resetPassword:R(S,"/reset-password")};function St(){const{login:e}=re(),t=Be(),o=Le(),[n,s]=I.exports.useState(!1),r=$e().shape({email:Z().email("Email must be a valid email address").required("Email is required"),password:Z().required("Password is required")}),m={email:"admin@linksehat.dev",password:"password",remember:!0},f=ze({resolver:_e(r),defaultValues:m}),{reset:w,setError:l,handleSubmit:g,formState:{errors:C,isSubmitting:c}}=f;return p(He,{methods:f,onSubmit:g(async h=>{try{const u=await e(h.email,h.password);t("/dashboard")}catch(u){console.error(u),w(),o.current&&l("afterSubmit",T(U({},u),{message:u.data.message}))}}),children:[p(A,{spacing:3,children:[a(ee,{severity:"primary",children:"Email : admin@linksehat.dev & Password : password"}),!!C.afterSubmit&&a(ee,{severity:"error",children:C.afterSubmit.message}),a(te,{name:"email",label:"Email address"}),a(te,{name:"password",label:"Password",type:n?"text":"password",InputProps:{endAdornment:a(Ue,{position:"end",children:a(Ee,{onClick:()=>s(!n),edge:"end",children:a(Me,{icon:n?"eva:eye-fill":"eva:eye-off-fill"})})})}})]}),p(A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{my:2},children:[a(wt,{name:"remember",label:"Remember me"}),a(ie,{component:le,variant:"subtitle2",to:Pt.resetPassword,children:"Forgot password?"})]}),a(Te,{fullWidth:!0,size:"large",type:"submit",variant:"contained",loading:c,children:"Login"})]})}const It=y("div")(({theme:e})=>({[e.breakpoints.up("md")]:{display:"flex"}})),Ft=y("header")(({theme:e})=>({top:0,zIndex:9,lineHeight:0,width:"100%",display:"flex",alignItems:"center",position:"absolute",padding:e.spacing(3),justifyContent:"space-between",[e.breakpoints.up("md")]:{alignItems:"flex-start",padding:e.spacing(7,5,0,7)}}));y(Ve)(({theme:e})=>({width:"100%",maxWidth:464,display:"flex",flexDirection:"column",justifyContent:"center",margin:e.spacing(2,0,2,2)}));const Rt=y("div")(({theme:e})=>({maxWidth:480,margin:"auto",display:"flex",minHeight:"100vh",flexDirection:"column",justifyContent:"center",padding:e.spacing(12,0)}));function Ht(){const{method:e}=re(),t=oe("up","sm");return oe("up","md"),a(We,{title:"Login",children:p(It,{children:[p(Ft,{children:[a(Ae,{sx:{width:150,height:150}}),t&&p(L,{variant:"body2",sx:{mt:{md:-2}},children:["Has problem with your account? ","",a(ie,{variant:"subtitle2",component:le,to:"#",onClick:o=>{window.location.href="mailto:admin@linksehat.com",o.preventDefault()},children:"Contact Us"})]})]}),a(Ne,{maxWidth:"sm",children:p(Rt,{children:[p(A,{direction:"row",alignItems:"center",sx:{mb:5},children:[p(Oe,{sx:{flexGrow:1},children:[a(L,{variant:"h4",gutterBottom:!0,children:"Sign in to LinkSehat"}),a(L,{sx:{color:"text.secondary"},children:"Enter your details below."})]}),a(je,{title:yt(e),placement:"right",children:a(qe,{children:a(De,{disabledEffect:!0,src:`https://minimal-assets-api.vercel.app/assets/icons/auth/ic_${e}.png`,sx:{width:32,height:32}})})})]}),a(St,{}),!1]})})]})})}export{Ht as default};
|