import{r as l,j as t,H as W,F as Y}from"./app-Ajql0Lt4.js";import{q as _,u as D,c as Z,B as ee,r as te}from"./createLucideIcon-B_iAwCmA.js";import{I as q}from"./input-error-Drp3HhtP.js";import{T as B}from"./text-link-D6DcgXYJ.js";import{c as re,P as oe,u as se,a as A,b as ne}from"./index-CS1SDu2T.js";import{u as ae}from"./index-BXKH1Xq5.js";import{P as R}from"./index-em-EQZzp.js";import{C as ie}from"./check-D1N7nvmG.js";import{I as T}from"./input-B0_NTiRR.js";import{L as P}from"./label-D8DO87nw.js";import{A as ce}from"./auth-layout-BA0f4QcD.js";import{r as de}from"./index-BPJbFReo.js";import{L as le}from"./loader-circle-C6-iW413.js";import"./app-B4XVefei.js";import"./app-logo-icon-B9D8MR-Y.js";import"./index-B6hfytYC.js";const d=e=>({url:d.url(e),method:"get"});d.definition={methods:["get","head"],url:"/login"};d.url=e=>d.definition.url+_(e);d.get=e=>({url:d.url(e),method:"get"});d.head=e=>({url:d.url(e),method:"head"});const S=e=>({action:d.url(e),method:"get"});S.get=e=>({action:d.url(e),method:"get"});S.head=e=>({action:d.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"HEAD",...e?.query??e?.mergeQuery??{}}}),method:"get"});d.form=S;const p=e=>({url:p.url(e),method:"post"});p.definition={methods:["post"],url:"/login"};p.url=e=>p.definition.url+_(e);p.post=e=>({url:p.url(e),method:"post"});const H=e=>({action:p.url(e),method:"post"});H.post=e=>({action:p.url(e),method:"post"});p.form=H;const f=e=>({url:f.url(e),method:"post"});f.definition={methods:["post"],url:"/logout"};f.url=e=>f.definition.url+_(e);f.post=e=>({url:f.url(e),method:"post"});const M=e=>({action:f.url(e),method:"post"});M.post=e=>({action:f.url(e),method:"post"});f.form=M;const ue={store:p};var w="Checkbox",[me,Le]=re(w),[pe,F]=me(w);function he(e){const{__scopeCheckbox:o,checked:s,children:a,defaultChecked:i,disabled:r,form:x,name:b,onCheckedChange:u,required:k,value:C="on",internal_do_not_use_render:m}=e,[h,y]=se({prop:s,defaultProp:i??!1,onChange:u,caller:w}),[v,j]=l.useState(null),[I,n]=l.useState(null),c=l.useRef(!1),E=v?!!x||!!v.closest("form"):!0,N={checked:h,disabled:r,setChecked:y,control:v,setControl:j,name:b,form:x,value:C,hasConsumerStoppedPropagationRef:c,required:k,defaultChecked:g(i)?!1:i,isFormControl:E,bubbleInput:I,setBubbleInput:n};return t.jsx(pe,{scope:o,...N,children:fe(m)?m(N):a})}var O="CheckboxTrigger",z=l.forwardRef(({__scopeCheckbox:e,onKeyDown:o,onClick:s,...a},i)=>{const{control:r,value:x,disabled:b,checked:u,required:k,setControl:C,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:y,bubbleInput:v}=F(O,e),j=D(i,C),I=l.useRef(u);return l.useEffect(()=>{const n=r?.form;if(n){const c=()=>m(I.current);return n.addEventListener("reset",c),()=>n.removeEventListener("reset",c)}},[r,m]),t.jsx(R.button,{type:"button",role:"checkbox","aria-checked":g(u)?"mixed":u,"aria-required":k,"data-state":$(u),"data-disabled":b?"":void 0,disabled:b,value:x,...a,ref:j,onKeyDown:A(o,n=>{n.key==="Enter"&&n.preventDefault()}),onClick:A(s,n=>{m(c=>g(c)?!0:!c),v&&y&&(h.current=n.isPropagationStopped(),h.current||n.stopPropagation())})})});z.displayName=O;var Q=l.forwardRef((e,o)=>{const{__scopeCheckbox:s,name:a,checked:i,defaultChecked:r,required:x,disabled:b,value:u,onCheckedChange:k,form:C,...m}=e;return t.jsx(he,{__scopeCheckbox:s,checked:i,defaultChecked:r,disabled:b,required:x,onCheckedChange:k,name:a,form:C,value:u,internal_do_not_use_render:({isFormControl:h})=>t.jsxs(t.Fragment,{children:[t.jsx(z,{...m,ref:o,__scopeCheckbox:s}),h&&t.jsx(X,{__scopeCheckbox:s})]})})});Q.displayName=w;var G="CheckboxIndicator",K=l.forwardRef((e,o)=>{const{__scopeCheckbox:s,forceMount:a,...i}=e,r=F(G,s);return t.jsx(oe,{present:a||g(r.checked)||r.checked===!0,children:t.jsx(R.span,{"data-state":$(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:o,style:{pointerEvents:"none",...e.style}})})});K.displayName=G;var U="CheckboxBubbleInput",X=l.forwardRef(({__scopeCheckbox:e,...o},s)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:r,defaultChecked:x,required:b,disabled:u,name:k,value:C,form:m,bubbleInput:h,setBubbleInput:y}=F(U,e),v=D(s,y),j=ae(r),I=ne(a);l.useEffect(()=>{const c=h;if(!c)return;const E=window.HTMLInputElement.prototype,L=Object.getOwnPropertyDescriptor(E,"checked").set,J=!i.current;if(j!==r&&L){const V=new Event("click",{bubbles:J});c.indeterminate=g(r),L.call(c,g(r)?!1:r),c.dispatchEvent(V)}},[h,j,r,i]);const n=l.useRef(g(r)?!1:r);return t.jsx(R.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??n.current,required:b,disabled:u,name:k,value:C,form:m,...o,tabIndex:-1,ref:v,style:{...o.style,...I,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});X.displayName=U;function fe(e){return typeof e=="function"}function g(e){return e==="indeterminate"}function $(e){return g(e)?"indeterminate":e?"checked":"unchecked"}function xe({className:e,...o}){return t.jsx(Q,{"data-slot":"checkbox",className:Z("peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...o,children:t.jsx(K,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:t.jsx(ie,{className:"size-3.5"})})})}function qe({status:e,canResetPassword:o}){return t.jsxs(ce,{title:"Log in to your account",description:"Enter your email and password below to log in",children:[t.jsx(W,{title:"Log in"}),t.jsx(Y,{...ue.store.form(),resetOnSuccess:["password"],className:"flex flex-col gap-6",children:({processing:s,errors:a})=>t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-6",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(P,{htmlFor:"email",children:"Email address"}),t.jsx(T,{id:"email",type:"email",name:"email",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"email",placeholder:"email@example.com"}),t.jsx(q,{message:a.email})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx(P,{htmlFor:"password",children:"Password"}),o&&t.jsx(B,{href:de(),className:"ml-auto text-sm",tabIndex:5,children:"Forgot password?"})]}),t.jsx(T,{id:"password",type:"password",name:"password",required:!0,tabIndex:2,autoComplete:"current-password",placeholder:"Password"}),t.jsx(q,{message:a.password})]}),t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(xe,{id:"remember",name:"remember",tabIndex:3}),t.jsx(P,{htmlFor:"remember",children:"Remember me"})]}),t.jsxs(ee,{type:"submit",className:"mt-4 w-full",tabIndex:4,disabled:s,"data-test":"login-button",children:[s&&t.jsx(le,{className:"h-4 w-4 animate-spin"}),"Log in"]})]}),t.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",t.jsx(B,{href:te(),tabIndex:5,children:"Sign up"})]})]})}),e&&t.jsx("div",{className:"mb-4 text-center text-sm font-medium text-green-600",children:e})]})}export{qe as default};