(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10204,e=>{"use strict";var s=e.i(43476),t=e.i(71645),r=e.i(75157);let i=t.forwardRef(({className:e,...t},i)=>(0,s.jsx)("label",{ref:i,className:(0,r.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));i.displayName="Label",e.s(["Label",()=>i])},94542,e=>{"use strict";var s=e.i(43476),t=e.i(71645),r=e.i(18566),i=e.i(70330),a=e.i(19455),n=e.i(93479),l=e.i(10204),d=e.i(15288),c=e.i(85149),u=e.i(87543),o=e.i(9165);function m(){let e=(0,u.useAppConfigStore)(u.selectAppName),m=(0,i.useAuthStore)(i.selectLogin),h=(0,i.useAuthStore)(i.selectLoading),p=(0,i.useAuthStore)(i.selectIsAuthenticated),x=(0,i.useAuthStore)(i.selectAuthDisabled),g=(0,r.useRouter)(),f=(0,r.useSearchParams)().get("reason")===c.LOGIN_REASON_SESSION_EXPIRED,[b,j]=(0,t.useState)(""),[v,S]=(0,t.useState)(""),[y,N]=(0,t.useState)(null),[C,w]=(0,t.useState)(!1);async function A(e){e.preventDefault(),N(null),w(!0);try{let e=await m(b,v);g.push(e)}catch(e){e instanceof o.ApiError?N(e.message||"Login failed"):N("Login failed")}finally{w(!1)}}return((0,t.useEffect)(()=>{!h&&(x||p)&&g.replace(c.ROUTES.HOME)},[h,x,p,g]),h)?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[50vh]",children:(0,s.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Checking authentication..."})}):x||p?null:(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:(0,s.jsxs)(d.Card,{className:"w-full max-w-md",children:[(0,s.jsxs)(d.CardHeader,{children:[(0,s.jsx)(d.CardTitle,{children:"Sign in"}),(0,s.jsxs)(d.CardDescription,{children:["Sign in to ",e," with your credentials."]})]}),(0,s.jsxs)(d.CardContent,{children:[(0,s.jsxs)("form",{onSubmit:A,className:"space-y-4",children:[f&&(0,s.jsx)("div",{className:"rounded-md bg-muted border border-border px-3 py-2 text-sm text-muted-foreground",children:"Your session expired. Please sign in again."}),y&&(0,s.jsx)("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 px-3 py-2 text-sm text-destructive",children:y}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(l.Label,{htmlFor:"username",children:"Username"}),(0,s.jsx)(n.Input,{id:"username",type:"text",autoComplete:"username",value:b,onChange:e=>j(e.target.value),required:!0,disabled:C})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(l.Label,{htmlFor:"password",children:"Password"}),(0,s.jsx)(n.Input,{id:"password",type:"password",autoComplete:"current-password",value:v,onChange:e=>S(e.target.value),required:!0,disabled:C})]}),(0,s.jsx)(a.Button,{type:"submit",className:"w-full",disabled:C,children:C?"Signing in...":"Sign in"})]}),(0,s.jsx)("p",{className:"mt-4 text-center text-sm text-muted-foreground",children:"Use initial credentials from environment or pycharter.cfg for development."})]})]})})}e.s(["default",()=>m])}]);