PageSourceSearch

https://fastfeastt.netlify.app/_next/static/chunks/fce1f951ad900bb2.js

js fastfeastt.netlify.app collected 2026-10-03 10:44:30 UTC 11,874 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24564,e=>{"use strict";e.s(["default",()=>s]);var r=e.i(43476),t=e.i(71645),a=e.i(38325);function s(){let[e,s]=(0,t.useState)(!1),o=async()=>{if((await a.default.fire({title:"Create Demo Users?",html:'\n        <p>This will create 15 demo users (3 for each role) in your database.</p>\n        <p>Existing demo users will be skipped.</p>\n        <p class="mt-3 text-sm">Roles: user, rider, restaurant, moderator, admin</p>\n      ',icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, create them!"})).isConfirmed){s(!0);try{let e=await fetch("/api/create-demo-users",{method:"POST",headers:{"Content-Type":"application/json"}}),r=await e.json();e.ok?a.default.fire({title:"Demo Users Created!",html:'\n            <p>15 demo users have been created successfully.</p>\n            <p class="mt-3">You can now log in with these accounts:</p>\n            <div class="text-left mt-3">\n              <p><strong>User:</strong> [email protected] / demo-user-1</p>\n              <p><strong>Rider:</strong> [email protected] / demo-rider-1</p>\n              <p><strong>Restaurant:</strong> [email protected] / demo-restaurant-1</p>\n              <p><strong>Moderator:</strong> [email protected] / demo-moderator-1</p>\n              <p><strong>Admin:</strong> [email protected] / demo-admin-1</p>\n            </div>\n            <p class="mt-3 text-sm">OTP verification is disabled for all demo users.</p>\n          ',icon:"success",width:"600px"}):a.default.fire("Error",r.error||"Failed to create demo users","error")}catch(e){a.default.fire("Error","An error occurred while creating demo users","error")}finally{s(!1)}}};return(0,r.jsx)("button",{onClick:o,disabled:e,className:"py-2 px-4 bg-gradient-to-r from-purple-500 to-purple-600 text-white font-semibold rounded-md disabled:opacity-50 disabled:cursor-not-allowed mt-4",children:e?"Creating...":"Create Demo Users"})}},26396,e=>{"use strict";e.s(["default",()=>m],26396);var r=e.i(43476),t=e.i(71645),a=e.i(18566),s=e.i(17255),o=e.i(22016),l=e.i(13811),i=e.i(77711),n=e.i(30955),d=e.i(38325);function c(e){let{email:a,onClose:o}=e,[i,n]=(0,t.useState)(Array(6).fill("")),[c,m]=(0,t.useState)(!1),[u,x]=(0,t.useState)(!1),[g,f]=(0,t.useState)(!0),[h,p]=(0,t.useState)(30),y=(0,t.useRef)([]);(0,t.useEffect)(()=>{let e;return g&&(e=setInterval(()=>{p(r=>r<=1?(clearInterval(e),f(!1),0):r-1)},1e3)),()=>clearInterval(e)},[g]);let b=async()=>{let e=i.join("");if(6!==e.length)return void d.default.fire("Error","Please enter the 6-digit OTP code","error");m(!0);try{let t=await (0,s.signIn)("credentials",{redirect:!1,email:a,password:"dummy",otp:e,skipOtp:!0});if((null==t?void 0:t.ok)||(null==t?void 0:t.url))d.default.fire("Success","OTP verified successfully! Logging you in...","success"),o(),window.location.href="/";else{var r;d.default.fire("Error",(null==t?void 0:t.error)||"Invalid OTP code. Please try again.","error"),n(Array(6).fill("")),null==(r=y.current[0])||r.focus()}}catch(e){d.default.fire("Error","An unexpected error occurred. Please try again.","error")}finally{m(!1)}},w=async()=>{x(!0),f(!0),p(30);try{var e;let r=await fetch("/api/resend-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a})}),t=await r.json();if(!r.ok)throw Error(t.message||"Failed to resend OTP");d.default.fire("Success","OTP has been resent to your email!","success"),n(Array(6).fill("")),null==(e=y.current[0])||e.focus()}catch(e){d.default.fire("Error",e.message||"Failed to resend OTP. Please try again.","error"),f(!1)}finally{x(!1)}};return(0,r.jsx)("div",{className:"fixed inset-0 flex items-center justify-center bg-black/50 z-50",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-2xl shadow-xl w-full max-w-md text-center relative mx-4",children:[(0,r.jsx)(l.AiOutlineClose,{className:"absolute top-4 right-4 cursor-pointer text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors",size:22,onClick:o}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Verify Your Account"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mb-1",children:"Enter the 6-digit code sent to"}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-6",children:a}),(0,r.jsx)("div",{className:"flex justify-center gap-2 mb-6",children:i.map((e,t)=>(0,r.jsx)("input",{type:"text",value:e,maxLength:1,ref:e=>y.current[t]=e,onChange:e=>((e,r)=>{if(/^[0-9]?$/.test(e)){let t=[...i];t[r]=e,n(t),e&&r<5&&y.current[r+1].focus()}})(e.target.value,t),onKeyDown:e=>{"Backspace"===e.key&&!i[t]&&t>0&&y.current[t-1].focus()},className:"w-12 h-12 text-center border border-gray-300 dark:border-gray-600 rounded-lg text-lg font-semibold dark:bg-gray-700 dark:text-white focus:outline-none focus:ring-2 focus:ring-orange-500 transition-all",disabled:c},t))}),(0,r.jsx)("button",{onClick:b,disabled:c||6!==i.join("").length,className:"w-full py-3 rounded-lg bg-orange-500 text-white font-medium hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors mb-4",children:c?(0,r.jsxs)("span",{className:"flex items-center justify-center",children:[(0,r.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Verifying..."]}):"Verify OTP"}),(0,r.jsxs)("p",{className:"text-sm text-gray-500",children:["Didn't receive the code?"," ",(0,r.jsx)("button",{onClick:g||u?void 0:w,disabled:g||u,className:"font-semibold ".concat(g||u?"text-gray-400 cursor-not-allowed":"text-orange-500 hover:underline transition-colors"),children:u?"Sending...":"Resend OTP"})," ",g&&!u&&(0,r.jsxs)("span",{className:"text-gray-400",children:["(",h,"s)"]}
1)]})]})})}function m(){let[e,m]=(0,t.useState)({email:"",password:""}),[u,x]=(0,t.useState)(!1),[g,f]=(0,t.useState)(!1),[h,p]=(0,t.useState)(!1),[y,b]=(0,t.useState)(!1),[w,j]=(0,t.useState)("");(0,a.useRouter)();let v=e=>{m({email:e.email,password:e.password})},k=r=>m({...e,[r.target.name]:r.target.value}),N=async r=>{r.preventDefault(),f(!0);try{let r=await (0,s.signIn)("credentials",{redirect:!1,email:e.email,password:e.password});(null==r?void 0:r.error)==="OTP_REQUIRED"?(d.default.fire("OTP Sent","Check your email for the code","info"),j(e.email),b(!0)):(null==r?void 0:r.ok)?(d.default.fire("Success","Logged in successfully","success"),window.location.href="/"):d.default.fire("Error",(null==r?void 0:r.error)||"Login failed","error")}catch(e){d.default.fire("Error","Server error","error")}finally{f(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-gray-700 p-8 rounded-2xl shadow-2xl w-full max-w-md 
1space-y-6 transform transition duration-300 hover:scale-[1.02]",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-center text-gray-900 dark:text-white",children:"Welcome Back"}),(0,r.jsx)("p",{className:"text-center text-gray-500 dark:text-gray-400",children:"Log In to Explore the World of Food"}),(0,r.jsxs)("form",{onSubmit:N,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-200",children:"Email"}),(0,r.jsx)("input",{type:"email",name:"email",value:e.email,onChange:k,required:!0,placeholder:"Email",className:"mt-1 block w-full px-4 py-2 border rounded-md shadow-sm bg-white text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:text-white"})]}),(0,r.jsxs)("div",{className:"relative mt-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-1",children:"Password"}),(0,r.jsx)("input",{type:u?"text":"password",name:"password",value:e.password,onChange:k,required:!0,placeholder:"Password",className:"mt-1 block w-full px-4 py-2 border rounded-md shadow-sm bg-white text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-10"}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 pr-3 pt-5 flex items-center cursor-pointer text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",onClick:()=>x(!u),children:u?(0,r.jsx)(l.AiOutlineEyeInvisible,{size:25}):(0,r.jsx)(l.AiOutlineEye,{size:25})})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center mt-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:h,onChange:()=>p(!h),className:"h-4 w-4 text-orange-600 border-gray-300 rounded"}),(0,r.jsx)("label",{className:"ml-2 text-sm text-gray-600 dark:text-gray-300",children:"Remember me"})]}),(0,r.jsx)(o.default,{href:"/forgot-password",className:"text-sm text-blue-600 hover:underline",children:"Forgot password?"})]}),(0,r.jsx)("div",{className:"flex gap-3 w-full justify-around",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("button",{onClick:()=>v({email:"[email protected]",password:"demo-moderator-1"}),className:"bg-amber-200 text-gray-600 py-2 px-4 cursor-pointer",children:"Login as Admin"}),(0,r.jsx)("button",{onClick:()=>v({email:"[email protected]",password:"demo-restaurantOwner-3"}),className:"bg-amber-200 text-gray-600 py-2 px-4 cursor-pointer",children:"Login as Restaurant Owner"}),(0,r.jsx)("button",{onClick:()=>v({email:"[email protected]",password:"demo-rider-2"}),className:"bg-amber-200 text-gray-600 py-2 px-4 cursor-pointer",children:"Login as Rider"}),(0,r.jsx)("button",{onClick:()=>v({email:"[email protected]",password:"demo-user-3"}),className:"bg-amber-200 text-gray-600 py-2 px-4 cursor-pointer",children:"Login as User"})]})}),(0,r.jsx)("button",{type:"submit",disabled:g,className:"w-full py-2 px-4 bg-gradient-to-r from-orange-500 to-orange-600 text-white font-semibold rounded-md disabled:opacity-50 disabled:cursor-not-allowed",children:g?"Logging in...":"Log In"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4 my-6",children:[(0,r.jsx)("div",{className:"flex-grow border-t border-gray-300 dark:border-gray-600"}),(0,r.jsx)("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"or"}),(0,r.jsx)("div",{className:"flex-grow border-t border-gray-300 dark:border-gray-600"})]}),(0,r.jsxs)("button",{onClick:()=>(0,s.signIn)("google",{callbackUrl:"/"}),className:"w-full flex text-gray-800 dark:text-gray-200 items-center justify-center gap-2 px-4 py-2 rounded-xl border border-gray-300  hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800  transition-colors shadow-sm font-medium",children:[(0,r.jsx)(i.FcGoogle,{className:"text-xl"})," Continue with Google"]}),(0,r.jsxs)("button",{onClick:()=>(0,s.signIn)("github",{callbackUrl:"/"}),className:"w-full flex text-gray-800 dark:text-gray-200 items-center justify-center gap-2 px-4 py-2 rounded-xl border border-gray-300  hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800  transition-colors shadow-sm font-medium",children:[(0,r.jsx)(n.FaGithub,{className:"text-xl"}),(0,r.jsx)("span",{children:"Continue with GitHub"})]}),(0,r.jsxs)("p",{className:"text-center text-gray-500 dark:text-gray-400 text-sm",children:["Don't have an account?"," ",(0,r.jsx)(o.default,{href:"/register",className:"text-blue-600 hover:underline",children:"Sign up here"})]})]})}),y&&(0,r.jsx)(c,{email:w,onClose:()=>b(!1)})]})}e.i(24564)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.