(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[162],{5120:(e,t,r)=>{Promise.resolve().then(r.bind(r,5138))},5138:(e,t,r)=>{"use strict";r.d(t,{ForgotPassword:()=>d});var o=r(5155);r(2115);var a=r(63),s=r(5279),l=r(2800),n=r(8018);let d=()=>{let e=(0,a.useRouter)(),{form:t,handleChangeField:r}=s.J.useFormField({email:""});return(0,o.jsx)(n.d.MotionWrapper,{children:(0,o.jsxs)(n.d.SafeAreaView,{children:[(0,o.jsx)(n.d.Header,{showGoBack:!0,title:"Forgot Password"}),(0,o.jsxs)("main",{style:{marginTop:l.A.sizes.headerHeight,padding:20,width:"100%"},children:[(0,o.jsx)("p",{style:{marginBottom:25,maxWidth:302,lineHeight:1.5,color:l.A.colors.textColor},children:"Please enter your email address. You will receive a link to create a new password via email."}),(0,o.jsx)(n.d.Input,{placeholder:"Email Address",containerStyle:{marginBottom:20},value:t.email,onClickAction:()=>r("email","Email Address")}),(0,o.jsx)(n.d.Button,{label:"Send",onClickAction:()=>e.push(l.A.routes.newPassword)})]})]})})}},5279:(e,t,r)=>{"use strict";r.d(t,{J:()=>n});var o=r(5125),a=r(2115);let s="https://george-fx.github.io/yummer-api/",l={GET_OFFERS:"".concat(s,"offers.json"),GET_DISHES:"".concat(s,"dishes.json"),GET_PROMOCODES:"".concat(s,"promocodes.json")},n={useGetDish:e=>{let[t,r]=(0,a.useState)(null),[s,n]=(0,a.useState)(!0),d=async()=>{n(!0);try{var t;let a=await o.A.get(l.GET_DISHES),s=(null!=(t=a.data.dishes)?t:a.data).find(t=>t.id===e);return r(s||null),n(!1),s}catch(e){throw n(!1),console.error("Error fetching dishes:",e),e}};return(0,a.useEffect)(()=>{d()},[e]),{dish:t,isLoading:s}},useFormField:e=>{let[t,r]=(0,a.useState)(e);return{form:t,setForm:r,handleChangeField:(e,o)=>{let a=window.prompt("Enter your ".concat(o),t[e]);null!==a&&r(t=>({...t,[e]:a}))}}},useGetDishes:()=>{let[e,t]=(0,a.useState)([]),[r,s]=(0,a.useState)(!0),n=async()=>{s(!0);try{let e=await o.A.get(l.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{s(!1)}};return(0,a.useEffect)(()=>{n()},[]),{dishes:e,loading:r}},useBodyColor:e=>{(0,a.useEffect)(()=>{let t=document.body.style.backgroundColor;return document.body.style.backgroundColor=e,()=>{document.body.style.backgroundColor=t}},[e])},useGetOffers:()=>{let[e,t]=(0,a.useState)([]),[r,s]=(0,a.useState)(!0),n=async()=>{s(!0);try{let e=await o.A.get(l.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{s(!1)}};return(0,a.useEffect)(()=>{n()},[]),{offers:e,loading:r}},useThemeColor:e=>{(0,a.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,a.useState)([]),[r,s]=(0,a.useState)(!0),n=async()=>{s(!0);try{let e=await o.A.get(l.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{s(!1)}};return(0,a.useEffect)(()=>{n()},[]),{promocodes:e,loading:r}}}}},e=>{e.O(0,[171,385,125,406,18,441,315,358],()=>e(e.s=5120)),_N_E=e.O()}]);