import{i as k,T as y,k as h,e as f,b as t,u as e,w as n,F as x,o as u,Z as V,t as i,f as p,a as o,c as v,g as _,q as B,l as L}from"./app-WJL2kJBE.js";import{J as $}from"./AuthenticationCard-DsL5pTVv.js";import{_ as q}from"./AuthenticationCardLogo-DfLTNru8.js";import{L as F}from"./LoadingButton-H6RtHB1p.js";import{_ as w}from"./Input-C4-VG2dv.js";import{_ as N}from"./Checkbox-WeIDo5uG.js";import{_ as g}from"./Label-CBaaVbfI.js";import{_ as C}from"./ValidationErrors-Bh9Wy7Xq.js";const E={key:0,class:"mb-4 font-medium text-sm text-green-600"},P={class:"mt-4"},R={class:"block mt-4"},S={class:"inline-flex items-center"},U={class:"ml-2 text-sm text-gray-600"},I={class:"flex items-center justify-end mt-4"},G={__name:"Login",props:{canResetPassword:Boolean,status:String,demo:Boolean},setup(l){const{t:m}=k({}),c=l,s=y({email:c.demo?"admin@tecdiary.com":"",password:c.demo?"password":"",remember:!1});h(()=>{document.getElementById("app-loading").style.display="none"});const b=()=>{s.transform(d=>({...d,remember:s.remember?"on":""})).post(route("login"),{onFinish:()=>s.reset("password")})};return(d,a)=>(u(),f(x,null,[t(e(V),{title:e(m)("Log in")},null,8,["title"]),t($,null,{logo:n(()=>[t(q)]),default:n(()=>[t(C,{class:"mb-4"}),l.status?(u(),f("div",E,i(l.status),1)):p("",!0),o("form",{onSubmit:L(b,["prevent"])},[o("div",null,[t(g,{for:"email",value:"Email"}),t(w,{id:"email",modelValue:e(s).email,"onUpdate:modelValue":a[0]||(a[0]=r=>e(s).email=r),type:"email",class:"mt-1 block w-full",required:"",autofocus:""},null,8,["modelValue"])]),o("div",P,[t(g,{for:"password",value:"Password"}),t(w,{id:"password",modelValue:e(s).password,"onUpdate:modelValue":a[1]||(a[1]=r=>e(s).password=r),type:"password",class:"mt-1 block w-full",required:"",autocomplete:"current-password"},null,8,["modelValue"])]),o("div",R,[o("label",S,[t(N,{checked:e(s).remember,"onUpdate:checked":a[2]||(a[2]=r=>e(s).remember=r),name:"remember"},null,8,["checked"]),o("span",U,i(e(m)("Remember me")),1)])]),o("div",I,[l.canResetPassword?(u(),v(e(B),{key:0,href:d.route("password.request"),class:"underline text-sm link"},{default:n(()=>[_(i(e(m)("Forgot your password?")),1)]),_:1},8,["href"])):p("",!0),t(F,{class:"ml-4",loading:e(s).processing},{default:n(()=>[_(i(e(m)("Log in")),1)]),_:1},8,["loading"])])],32)]),_:1})],64))}};export{G as default};
