(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4665],{4771:function(e,t,s){Promise.resolve().then(s.bind(s,22479))},98998:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(87461).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},51930:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(87461).Z)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]])},37841:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(87461).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},18994:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(87461).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},51652:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(87461).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},90684:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(87461).Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},47907:function(e,t,s){"use strict";var r=s(15313);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},22479:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var r=s(3827),a=s(64090),n=s(71126),i=s(47907),l=s(8792),c=s(18994),o=s(98998),d=s(90684),u=s(51652),x=s(51930),h=s(37841),m=s(71774),f=s(49079);function p(){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,r.jsx)(c.Z,{className:"h-8 w-8 animate-spin text-indigo-400"})}),children:(0,r.jsx)(y,{})})}function y(){let e=(0,i.useRouter)(),{t}=(0,m.Z)(),s=(0,i.useSearchParams)().get("callbackUrl")||"/dashboard",[p,y]=(0,a.useState)(""),[g,b]=(0,a.useState)(""),[j,w]=(0,a.useState)(!1),[v,N]=(0,a.useState)(""),[k,Z]=(0,a.useState)(!1),C=async t=>{t.preventDefault(),N(""),Z(!0);let r=await (0,n.signIn)("credentials",{email:p,password:g,redirect:!1});(null==r?void 0:r.error)?(N(r.error),Z(!1)):(e.push(s),e.refresh())};return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-8",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:t("welcomeBack")}),(0,r.jsx)("p",{className:"text-gray-400",children:t("signInToAccount")})]}),v&&(0,r.jsxs)("div",{className:"flex items-center gap-3 p-4 mb-6 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,r.jsx)(o.Z,{className:"h-4 w-4 shrink-0"}),v]}),(0,r.jsxs)("form",{onSubmit:C,className:"space-y-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("email")}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(d.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,r.jsx)("input",{type:"email",placeholder:"you@example.com",value:p,onChange:e=>y(e.target.value),required:!0,className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl pl-10 pr-4 py-3 text-sm placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/60 focus:bg-white/[0.06] transition-all"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-300",children:t("password")}),(0,r.jsx)(l.default,{href:"/forgot-password",className:"text-xs text-indigo-400 hover:text-indigo-300 transition-colors",children:"نسيت كلمة المرور؟"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(u.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,r.jsx)("input",{type:j?"text":"password",placeholder:"••••••••",value:g,onChange:e=>b(e.target.value),required:!0,className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl pl-10 pr-11 py-3 text-sm placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/60 focus:bg-white/[0.06] transition-all"}),(0,r.jsx)("button",{type:"button",onClick:()=>w(!j),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 transition-colors",children:j?(0,r.jsx)(x.Z,{className:"h-4 w-4"}):(0,r.jsx)(h.Z,{className:"h-4 w-4"})})]})]}),(0,r.jsxs)("button",{type:"submit",disabled:k,className:"w-full bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 disabled:opacity-60 disabled:cursor-not-allowed text-white font-semibold py-3 px-6 rounded-xl transition-all duration-200 flex items-center justify-center gap-2 shadow-lg shadow-indigo-500/20 mt-2",children:[k?(0,r.jsx)(c.Z,{className:"h-4 w-4 animate-spin"}):null,t(k?"signingIn":"signIn")]})]}),"true"===f.env.NEXT_PUBLIC_GOOGLE_ENABLED&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative my-6",children:[(0,r.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,r.jsx)("div",{className:"w-full border-t border-white/[0.06]"})}),(0,r.jsx)("div",{className:"relative flex justify-center",children:(0,r.jsx)("span",{className:"bg-[#0a0a14] px-4 text-xs text-gray-600 uppercase tracking-widest",children:t("or")})})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>(0,n.signIn)("google",{callbackUrl:s}),className:"w-full flex items-center justify-center gap-3 bg-white/[0.04] hover:bg-white/[0.07] border border-white/[0.08] text-gray-300 font-medium py-3 px-6 rounded-xl transition-all duration-200",children:[(0,r.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),(0,r.jsx)("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),(0,r.jsx)("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),(0,r.jsx)("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),t("continueWithGoogle")]})]}),(0,r.jsxs)("p",{className:"text-center text-sm text-gray-500 mt-8",children:[t("dontHaveAccount")," ",(0,r.jsx)(l.default,{href:"/register",className:"text-indigo-400 hover:text-indigo-300 font-medium transition-colors",children:t("signUp")})]})]})}}},function(e){e.O(0,[2807,1126,1774,2971,8069,1744],function(){return e(e.s=4771)}),_N_E=e.O()}]);