(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[287],{4811:(e,t,r)=>{Promise.resolve().then(r.bind(r,8600))},5279:(e,t,r)=>{"use strict";r.d(t,{J:()=>i});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")},i={useGetDish:e=>{let[t,r]=(0,a.useState)(null),[s,i]=(0,a.useState)(!0),n=async()=>{i(!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),i(!1),s}catch(e){throw i(!1),console.error("Error fetching dishes:",e),e}};return(0,a.useEffect)(()=>{n()},[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),i=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)(()=>{i()},[]),{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),i=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)(()=>{i()},[]),{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),i=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)(()=>{i()},[]),{promocodes:e,loading:r}}}},8600:(e,t,r)=>{"use strict";r.d(t,{EditProfile:()=>d});var o=r(5155);r(2115);var a=r(63),s=r(5279),l=r(9994),i=r(2800),n=r(8018);let d=()=>{let e=(0,a.useRouter)(),{form:t,handleChangeField:r}=s.J.useFormField({fullName:"",phone:"",dateOfBirth:"",gender:"",address:""});return(0,o.jsx)(n.d.MotionWrapper,{children:(0,o.jsxs)(n.d.SafeAreaView,{children:[(0,o.jsx)(n.d.Header,{showGoBack:!0,title:"Edit Profile"}),(0,o.jsxs)("main",{style:{marginTop:i.A.sizes.headerHeight,padding:20},children:[(0,o.jsxs)("div",{style:{width:100,height:100,borderRadius:"50%",display:"block",margin:"0 auto",marginBottom:40,position:"relative"},children:[(0,o.jsx)("img",{src:"https://george-fx.github.io/yummer-data/avatars/01.jpg",alt:"User Avatar",style:{width:"100%",height:"100%",borderRadius:"50%"}}),(0,o.jsx)("div",{style:{position:"absolute",bottom:0,right:0,backgroundColor:i.A.colors.mainColor2,width:30,height:30,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:(0,o.jsx)(l.J.ProfileEditSvg,{})})]}),(0,o.jsxs)("ul",{style:{...i.A.flex.flexColumn,gap:30,marginBottom:30},children:[(0,o.jsx)("li",{children:(0,o.jsx)(n.d.Input,{label:"Name",placeholder:"Kristin Watson",value:t.fullName,onClickAction:()=>r("fullName","Full Name")})}),(0,o.jsx)("li",{children:(0,o.jsx)(n.d.Input,{label:"Email",placeholder:"kristinwatson@mail.com",value:t.phone,onClickAction:()=>r("phone","Phone Number")})}),(0,o.jsx)("li",{children:(0,o.jsx)(n.d.Input,{label:"Phone Number",placeholder:"Enter date of birth",value:t.dateOfBirth,onClickAction:()=>r("dateOfBirth","Date of Birth")})}),(0,o.jsx)("li",{children:(0,o.jsx)(n.d.Input,{label:"Location",placeholder:"Chicago, USA",value:t.address,onClickAction:()=>r("address","Location")})})]}),(0,o.jsx)(n.d.Button,{label:"save changes",onClickAction:()=>{e.push(i.A.routes.profile)}})]})]})})}}},e=>{e.O(0,[171,385,125,406,18,441,315,358],()=>e(e.s=4811)),_N_E=e.O()}]);