(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[502],{2752:(e,t,r)=>{"use strict";r.d(t,{SignIn:()=>u});var o=r(5155);r(2115);var s=r(2619),n=r.n(s),a=r(63),l=r(5279),i=r(9994),c=r(2800),d=r(8018);let u=()=>{let e=(0,a.useRouter)(),{form:t,handleChangeField:r}=l.J.useFormField({email:"",password:""});return(0,o.jsx)(d.d.MotionWrapper,{children:(0,o.jsxs)(d.d.SafeAreaView,{children:[(0,o.jsx)(d.d.Header,{title:"Sign In",showGoBack:!0}),(0,o.jsxs)("main",{style:{marginTop:c.A.sizes.headerHeight,paddingLeft:20,paddingRight:20,overflowY:"auto",height:"100%",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,o.jsx)("h1",{style:{...c.A.typography.h1,textTransform:"capitalize",marginBottom:40,color:c.A.colors.titlesColor},children:"Sign in"}),(0,o.jsx)(d.d.Input,{containerStyle:{marginBottom:30},placeholder:"kristinwatson@mail.com",value:t.email,label:"Email",onClickAction:()=>r("email","email"),isValid:t.email.length>0&&t.email.includes("@"),rightIcon:t.email?(0,o.jsx)(i.J.CheckSvg,{}):(0,o.jsx)(o.Fragment,{})}),(0,o.jsx)(d.d.Input,{containerStyle:{marginBottom:20},placeholder:"**********",value:t.password,label:"Password",onClickAction:()=>r("password","password"),isValid:t.password.length>0&&t.password.length>=6,rightIcon:(0,o.jsx)(i.J.EyeOffSvg,{})}),(0,o.jsx)("div",{style:{...c.A.flex.rowCenterBetween,marginBottom:30,width:"100%",justifyContent:"flex-end"},children:(0,o.jsx)(n(),{href:c.A.routes.forgotPassword,style:{color:c.A.colors.mainColor2},children:"Forgot your password?"})}),(0,o.jsx)(d.d.Button,{label:"Sign in",onClickAction:()=>void e.push(c.A.routes.home),containerStyle:{marginBottom:20}}),(0,o.jsx)("div",{style:{marginBottom:"14%"},children:(0,o.jsxs)("span",{style:{color:c.A.colors.textColor},children:["Don’t have an account?"," ",(0,o.jsx)("span",{style:{color:c.A.colors.mainColor2},children:(0,o.jsx)(n(),{href:c.A.routes.signUp,children:"Sign up."})})]})}),(0,o.jsxs)("div",{style:{...c.A.flex.rowAlignCenterCenter,gap:15},children:[(0,o.jsx)(n(),{href:c.A.routes.home,children:(0,o.jsx)(i.J.FacebookSvg,{})}),(0,o.jsx)(n(),{href:c.A.routes.home,children:(0,o.jsx)(i.J.TwitterSvg,{})}),(0,o.jsx)(n(),{href:c.A.routes.home,children:(0,o.jsx)(i.J.GoogleSvg,{})})]})]})]})})}},5279:(e,t,r)=>{"use strict";r.d(t,{J:()=>l});var o=r(5125),s=r(2115);let n="https://george-fx.github.io/yummer-api/",a={GET_OFFERS:"".concat(n,"offers.json"),GET_DISHES:"".concat(n,"dishes.json"),GET_PROMOCODES:"".concat(n,"promocodes.json")},l={useGetDish:e=>{let[t,r]=(0,s.useState)(null),[n,l]=(0,s.useState)(!0),i=async()=>{l(!0);try{var t;let s=await o.A.get(a.GET_DISHES),n=(null!=(t=s.data.dishes)?t:s.data).find(t=>t.id===e);return r(n||null),l(!1),n}catch(e){throw l(!1),console.error("Error fetching dishes:",e),e}};return(0,s.useEffect)(()=>{i()},[e]),{dish:t,isLoading:n}},useFormField:e=>{let[t,r]=(0,s.useState)(e);return{form:t,setForm:r,handleChangeField:(e,o)=>{let s=window.prompt("Enter your ".concat(o),t[e]);null!==s&&r(t=>({...t,[e]:s}))}}},useGetDishes:()=>{let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!0),l=async()=>{n(!0);try{let e=await o.A.get(a.GET_DISHES);if(!e.data)throw Error("No data in response");let r=e.data.dishes||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{n(!1)}};return(0,s.useEffect)(()=>{l()},[]),{dishes:e,loading:r}},useBodyColor:e=>{(0,s.useEffect)(()=>{let t=document.body.style.backgroundColor;return document.body.style.backgroundColor=e,()=>{document.body.style.backgroundColor=t}},[e])},useGetOffers:()=>{let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!0),l=async()=>{n(!0);try{let e=await o.A.get(a.GET_OFFERS);if(!e.data)throw Error("No data in response");let r=e.data.offers||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{n(!1)}};return(0,s.useEffect)(()=>{l()},[]),{offers:e,loading:r}},useThemeColor:e=>{(0,s.useEffect)(()=>{let t=document.querySelector('meta[name="theme-color"]');t||((t=document.createElement("meta")).setAttribute("name","theme-color"),document.head.appendChild(t));let r=t.getAttribute("content");return t.setAttribute("content",e),()=>{r&&t.setAttribute("content",r)}},[e])},useGetPromocodes:()=>{let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!0),l=async()=>{n(!0);try{let e=await o.A.get(a.GET_PROMOCODES);if(!e.data)throw Error("No data in response");let r=e.data.promocodes||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{n(!1)}};return(0,s.useEffect)(()=>{l()},[]),{promocodes:e,loading:r}}}},6828:(e,t,r)=>{Promise.resolve().then(r.bind(r,2752))}},e=>{e.O(0,[171,385,125,406,18,441,315,358],()=>e(e.s=6828)),_N_E=e.O()}]);