module.exports=[738783,(a,b,c)=>{"use strict";b.exports=a.r(342602).vendored["react-ssr"].ReactServerDOMTurbopackClient},876971,a=>{"use strict";let b=(0,a.i(170106).default)("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);a.s(["Ticket",()=>b],876971)},73570,a=>{"use strict";let b=(0,a.i(170106).default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["AlertTriangle",()=>b],73570)},793482,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(695245),e=a.i(159501),f=a.i(336570),g=a.i(73570),h=a.i(596221),i=a.i(876971),j=a.i(56025),k=a.i(699570),l=a.i(591119),m=a.i(441921),n=a.i(866718),o=a.i(238246),p=a.i(50944),q=a.i(83490);let r=f.z.object({email:f.z.string().email("Please enter a valid email address."),password:f.z.string().min(1,"Password is required.")});function s(){let{user:a,isLoading:f,login:s}=(0,j.useAuth)(),t=(0,p.useRouter)(),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(null);(0,c.useEffect)(()=>{!f&&a&&t.push("/admin/bookings")},[a,f,t]);let y=(0,d.useForm)({resolver:(0,e.zodResolver)(r),defaultValues:{email:"",password:""}}),z=async a=>{v(!0),x(null);try{let b=await q.default.post("https://arcedea.losenviskas.com/laravel-backend/public/api/login",a);console.log("Login response from server:",b.data);let{access_token:c,user:d}=b.data;await s(c,d),t.replace("/admin/bookings")}catch(b){if(console.error("Login failed:",b),q.default.isAxiosError(b)&&b.response){if(403===b.response.status)return void t.push(`/resend-verification?email=${a.email}`);x(b.response.data.message||"An unknown error occurred.")}else x("An unknown error occurred. Please check your connection.")}finally{v(!1)}};return f||a?(0,b.jsx)("div",{className:"flex h-screen w-full items-center justify-center bg-muted/40",children:(0,b.jsx)(h.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}):(0,b.jsxs)("div",{className:"flex min-h-screen items-center justify-center bg-muted/40 p-4",children:[(0,b.jsxs)(o.default,{href:"/",className:"absolute left-8 top-8 py-2 px-4 rounded-lg no-underline text-foreground bg-muted-foreground/10 flex items-center gap-2 text-sm",children:[(0,b.jsxs)("svg",{className:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,b.jsx)("path",{d:"M19 12H5"})]}),"Back to Home"]}),(0,b.jsxs)(l.Card,{className:"w-full max-w-sm",children:[(0,b.jsxs)(l.CardHeader,{className:"text-center",children:[(0,b.jsx)("div",{className:"mx-auto bg-primary text-primary-foreground rounded-full w-16 h-16 flex items-center justify-center mb-4",children:(0,b.jsx)(i.Ticket,{className:"w-8 h-8"})}),(0,b.jsx)(l.CardTitle,{className:"text-2xl",children:"Admin Login"}),(0,b.jsx)(l.CardDescription,{children:"Enter your credentials to access the dashboard."})]}),(0,b.jsxs)(l.CardContent,{children:[w&&(0,b.jsxs)("div",{className:"mb-4 bg-destructive/15 p-3 rounded-md flex items-center gap-x-2 text-sm text-destructive",children:[(0,b.jsx)(g.AlertTriangle,{className:"h-4 w-4"}),(0,b.jsx)("p",{children:w})]}),(0,b.jsx)(m.Form,{...y,children:(0,b.jsxs)("form",{onSubmit:y.handleSubmit(z),className:"space-y-4",children:[(0,b.jsx)(m.FormField,{control:y.control,name:"email",render:({field:a})=>(0,b.jsxs)(m.FormItem,{children:[(0,b.jsx)(m.FormLabel,{children:"Email Address"}),(0,b.jsx)(m.FormControl,{children:(0,b.jsx)(n.Input,{placeholder:"admin@example.com",...a})}),(0,b.jsx)(m.FormMessage,{})]})}),(0,b.jsx)(m.FormField,{control:y.control,name:"password",render:({field:a})=>(0,b.jsxs)(m.FormItem,{children:[(0,b.jsx)(m.FormLabel,{children:"Password"}),(0,b.jsx)(m.FormControl,{children:(0,b.jsx)(n.Input,{type:"password",placeholder:"••••••••",...a})}),(0,b.jsx)(m.FormMessage,{})]})}),(0,b.jsxs)(k.Button,{type:"submit",disabled:u,className:"w-full",children:[u?(0,b.jsx)(h.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Sign In"]})]})}),(0,b.jsxs)("p",{className:"mt-4 text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",(0,b.jsx)(o.default,{href:"/signup",className:"underline hover:text-primary",children:"Sign Up"})]}),(0,b.jsx)("p",{className:"mt-2 text-center text-sm text-muted-foreground",children:(0,b.jsx)(o.default,{href:"/forgot-password",className:"underline hover:text-primary",children:"Forgot Password?"})})]})]})]})}a.s(["default",()=>s])}];

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