module.exports=[33354,(a,b,c)=>{"use strict";c._=function(a){return a&&a.__esModule?a:{default:a}}},39296,a=>{"use strict";let b=(0,a.i(64831).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);a.s(["Eye",0,b],39296)},77064,a=>{"use strict";let b=(0,a.i(64831).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);a.s(["EyeOff",0,b],77064)},4038,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(39296),e=a.i(77064),f=a.i(760),g=a.i(73541);a.s(["PasswordInput",0,function({className:a,...h}){let[i,j]=c.useState(!1);return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(g.Input,{type:i?"text":"password",className:(0,f.cn)("pr-9",a),...h}),(0,b.jsx)("button",{type:"button",onClick:()=>j(a=>!a),className:"absolute right-0 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center text-foreground/40 transition-colors hover:text-foreground/70","aria-label":i?"Hide password":"Show password","aria-pressed":i,children:i?(0,b.jsx)(e.EyeOff,{className:"size-4"}):(0,b.jsx)(d.Eye,{className:"size-4"})})]})}])},84110,a=>{"use strict";var b=a.i(20517);a.s(["authApi",0,{login:(a,c,d)=>b.apiClient.post("/auth/login",{email:a,password:c,remember:d},{skipAuth:!0}),register:a=>b.apiClient.post("/auth/register",a,{skipAuth:!0}),forgotPassword:a=>b.apiClient.post("/auth/forgot-password",{email:a},{skipAuth:!0}),resetPassword:(a,c)=>b.apiClient.post("/auth/reset-password",{token:a,password:c},{skipAuth:!0}),changePassword:(a,c)=>b.apiClient.post("/auth/change-password",{currentPassword:a,newPassword:c})}])},18580,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(97546),g=a.i(75160);let h=(0,a.i(64831).default)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]);var i=a.i(58547),j=a.i(73541),k=a.i(4038),l=a.i(39524),m=a.i(68106),n=a.i(760),o=a.i(84110),p=a.i(20517);let q={parent:"/parent",student:"/student"};a.s(["LoginForm",0,function(){let a=(0,d.useRouter)(),[r,s]=(0,c.useState)("parent"),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(null),D=async b=>{b.preventDefault(),C(null),A(!0);try{let{user:b,accessToken:c,refreshToken:d}=(await o.authApi.login(t,v,x)).data;if("parent"!==b.role&&"student"!==b.role)return void C("This account isn't a parent or student account.");(0,p.storeTokens)(c,d),a.push(q[b.role])}catch(a){C(a instanceof p.ApiClientError?a.message:"Something went wrong. Please try again.")}finally{A(!1)}};return(0,b.jsxs)("form",{onSubmit:D,className:"space-y-5",children:[(0,b.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-full bg-muted p-1",children:["parent","student"].map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>s(a),className:(0,n.cn)("rounded-full py-2 text-sm font-semibold capitalize transition-colors",r===a?"bg-card text-primary shadow-sm":"text-foreground/60 hover:text-primary"),children:a},a))}),B&&(0,b.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[(0,b.jsx)(f.AlertCircle,{className:"mt-0.5 size-4 shrink-0"}),(0,b.jsx)("span",{children:B})]}),(0,b.jsxs)("div",{className:"grid gap-2",children:[(0,b.jsx)(i.Label,{htmlFor:"email",children:"Email"}),(0,b.jsx)(j.Input,{id:"email",type:"email",value:t,onChange:a=>u(a.target.value),placeholder:"you@email.com",autoComplete:"username",required:!0})]}),(0,b.jsxs)("div",{className:"grid gap-2",children:[(0,b.jsx)(i.Label,{htmlFor:"password",children:"Password"}),(0,b.jsx)(k.PasswordInput,{id:"password",value:v,onChange:a=>w(a.target.value),placeholder:"••••••••",autoComplete:"current-password",required:!0})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2 text-foreground/60",children:[(0,b.jsx)(m.Checkbox,{checked:x,onCheckedChange:a=>y(!0===a)}),"Remember me"]}),(0,b.jsx)(e.default,{href:"/forgot-password",className:"font-semibold text-primary hover:underline",children:"Forgot password?"})]}),(0,b.jsx)(l.Button,{type:"submit",disabled:z,size:"lg",className:"w-full rounded-full bg-accent text-accent-foreground hover:bg-accent/90",children:z?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"})," Signing in..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h,{className:"size-4"})," Sign In as ","parent"===r?"Parent":"Student"]})})]})}],18580)}];

//# sourceMappingURL=_18bo6de._.js.map