1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6128],{22437:(e,t,a)=>{"use strict";a.d(t,{Toaster:()=>Toaster});var l=a(9100),s=a(55778),n=a(78451);const Toaster=e=>{let{...t}=e;const[{themes:{theme:a}}]=(0,s.p)();return(0,l.jsx)(n.l$,{theme:a,position:"bottom-center",className:"toaster group",toastOptions:{className:"!sm:-translate-x-1/2",classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg w-full mx-auto !left-1/2 !-translate-x-[45%] !sm:-translate-x-1/2",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})}},22926:(e,t,a)=>{"use strict";a.d(t,{default:()=>__WEBPACK_DEFAULT_EXPORT__});var l=a(9100),s=a(27010),n=a(1233),r=a(16597),i=a(33675),o=(a(47552),a(55778));const __WEBPACK_DEFAULT_EXPORT__=()=>{var e,t;const a=(0,i.useRouter)(),d=(0,i.usePathname)(),[{app:{cartInfo:c}}]=(0,o.p)();if(d.includes("/cart"))return(0,l.jsx)(l.Fragment,{});var u;const m=null!==(u=null==c||null===(t=c.data)||void 0===t||null===(e=t.cartItems)||void 0===e?void 0:e.reduce((e,t)=>e+((null==t?void 0:t.quantity)||0),0))&&void 0!==u?u:0,x=window.innerWidth<768;return(0,l.jsx)(s.$n,{onClick:()=>a.push("/cart"),className:(0,n.cn)("text-white fixed z-50 flex h-14 w-14 items-center justify-center rounded-xl bg-primary-500 shadow-lg transition-all hover:scale-105 hover:bg-primary-600 active:scale-95",x?"bottom-24 right-6":"bottom-6 right-6"),"aria-label":"viewCart",children:(0,l.jsxs)("div",{className:"relative",children:[m>0&&(0,l.jsx)("span",{className:"absolute bottom-2 left-2 flex h-5 w-5 items-center justify-center rounded-full bg-white-500 text-xs !text-primary-500",children:m}),(0,l.jsx)(r.A,{size:24,color:"white",className:"scale-[1.6]"})]})})}},25706:(e,t,a)=>{"use strict";a.d(t,{Header:()=>Header});var l=a(9100),s=a(79058),n=a(33873);const r=[{label:"home",href:"/"},{label:"meals",href:"/meals"},{label:"branches",href:"/our-branches"},{label:"about",href:"/about-us"},{label:"hiring",href:"https://www.laffahjob.com/form",target:"_blank"},{label:"activity",href:"/activitys"},{label:"contact",href:"/contact"},{label:"spices",href:"https://laffahspices.com/"}];var i=a(1233),o=a(85859),d=a(78996),c=a(60821),u=a(74310),m=a.n(u),x=a(33675),h=a(47552),p=a(19257),f=a(23250),v=a(84682),g=a(55778);const LocaleSelect=()=>{const[{updateLanguageAction:e}]=(0,v.Dn)(),t=(0,c.useTranslations)("locale"),a=(0,c.useLocale)(),[{language:{dir:s}}]=(0,g.p)();return(0,l.jsxs)(n.AM,{children:[(0,l.jsxs)(n.Wv,{dir:s,className:(0,i.cn)("flex items-center gap-2 text-white-500"),children:[(0,l.jsx)(f.r,{className:(0,i.cn)("text-white-500 max-md:hidden")}),(0,l.jsx)("span",{className:(0,i.cn)("title-lang text-white-500"),children:t(a)})]}),(0,l.jsx)(n.hl,{className:"z-[999999] mt-2 max-w-32 translate-x-4 overflow-hidden border-0 bg-background-paper p-1",align:"start",children:p.DT.locales.map(a=>(0,l.jsx)("div",{className:"cursor-pointer p-1 hover:bg-primary-500 hover:text-white-500",onClick:()=>function(t){e(t),window.location.reload()}(a),children:t(a)},a))})]})};var b=a(95292),w=a(55550),j=a(52447),N=a(49109);const ToggleTheme=()=>{const[{themes:e}]=(0,g.p)(),{theme:t}=e,[{updateThemeAction:a}]=(0,N.Xl)();return(0,l.jsx)("div",{style:{direction:"ltr"},children:(0,l.jsx)(b.bL,{className:(0,i.cn)("focus-visible:ring-ring focus-visible:ring-offset-background peer flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent !bg-primary-700 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"),checked:"dark"===t,onClick:()=>a("dark"===t?"light":"dark"),"aria-label":"toggle theme",children:(0,l.jsx)(b.zi,{className:(0,i.cn)("pointer-events-none block h-5 w-5 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0","dark"===t?"!bg-[#FD3035]":"!bg-white-500"),children:"dark"===t?(0,l.jsx)(w.A,{className:"h-5 w-5 text-white-500","aria-hidden":"true"}):(0,l.jsx)(j.A,{className:"h-5 w-5 text-[#FFC857]","aria-hidden":"true"})})})})};var y=a(19044),C=a(27010),k=a(93179),T=a(3293),I=a(9756),A=a(59665);const components_OutsideCloser=e=>{const t=(0,h.useRef)(null);var a;return(0,h.useEffect)(()=>{function handleClickOutside(a){e.disableOutsideClick||(null==t?void 0:t.current)&&!t.current.contains(a.target)&&e.onClose(a)}return e.open?document.addEventListener("mousedown",handleClickOutside):document.removeEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[e.open,e.disableOutsideClick]),(0,l.jsx)("div",{onClick:t=>(null==e?void 0:e.onClick)&&e.onClick(t,e.params),style:null!==(a=e.style)&&void 0!==a?a:{},className:e.className,ref:t,children:e.children})},O=(0,h.memo)(e=>{let{open:t,setOpen:a,title:s,body:n,className:r,containerClassname:i,bodyClassName:o,footer:d,footerClassName:c,place:u="top",hideHeader:m,overlayClassName:x,onClose:p=()=>{},onClickOutside:f=()=>{},additionalComponent:v,hideCloseButton:g=!1,insidePopup:b=!1}=e;const[w,j]=(0,h.useState)(null);return(0,h.useEffect)(()=>{j(document.getElementById("modal-root"))},[]),(0,h.useEffect)(()=>{b||(document.body.style.overflow=t?"hidden":"auto")},[t]),w&&(0,A.createPortal)((0,l.jsx)("div",{className:(0,y.QP)("fixed start-0 top-0 z-[100] h-full w-full overflow-x-hidden bg-neutral-600/50 px-[15px] dark:bg-black-300/50",t?"visible":"invisible","center"===u&&"flex flex-col justify-center",x),children:(0,l.jsxs)(components_OutsideCloser,{open:t,onClose:f,className:(0,y.QP)("h-full max-h-[450px] w-full overflow-hidden rounded-xl duration-500 ease-out sm:max-w-[750px]","right"===u?"absolute max-h-screen rounded-none sm:max-w-md":"sm:m-3 sm:mx-auto","right"===u?t?"transition-all ltr:right-0 rtl:left-0":"transition-all ltr:-right-full rtl:-left-full":"","top"===u?t?"opacity-100 transition-all sm:mt-7":"-mt-10 opacity-0 sm:mt-0":"","center"===u?t?"opacity-100 transition-all sm:mt-3":"-mt-10 opacity-0 sm:-mt-4":"",r),children:[t&&(0,l.jsxs)("div",{open:t,onClose:f,className:(0,y.QP)("flex max-h-full min-h-full flex-col gap-6 rounded-lg bg-white-300 dark:bg-black-900","right"===u?"rounded-r-none":"",i),children:[!m&&(0,l.jsxs)("div",{className:"flex items-center justify-between bg-white-300 dark:bg-black-900",children:[(0,l.jsx)("h6",{className:"text-2xl font-medium text-neutral-900 dark:text-white-300",children:s}),!g&&(0,l.jsxs)("button",{type:"button",onClick:()=>{p(),a(!1)},className:"size-[40px] rounded-lg bg-neutral-100",children:[(0,l.jsx)("span",{className:"sr-only",children:"Close"}),(0,l.jsx)("i",{className:"ti ti-x dark:text-white text-danger-300 flex items-center justify-center text-[20px]"})]})]}),(0,l.jsx)("div",{className:(0,y.QP)("overflow-y-auto pr-1","right"===u&&"flex flex-grow",o),children:n}),d&&(0,l.jsx)("div",{className:(0,y.QP)("right"===u&&"mt-auto",c),children:d})]}),v&&(0,l.jsx)("div",{className:"mb-1 mt-4 w-full rounded-lg bg-transparent",children:(0,l.jsx)("div",{className:"bg-white rounded-lg",children:v})})]})}),w)});var S,P=a(69941),E=a(56562),_=a(20778),D=a(61126);const F=null!==(S=a(44321).env.NEXT_PUBLIC_ECOMMERCE_SERVICE_URL)&&void 0!==S?S:"ecommerce-v2";var L=a(77094),z=a(47240);const CityField=e=>{let{selectedCity:t,setSelectedCity:a,cities:s=[],error:n}=e;const r=(0,c.useTranslations)();return(0,l.jsx)(_.I,{value:t,onValueChange:e=>{a(e)},items:null==s?void 0:s.map(e=>{var t;return{value:e.id,label:null!==(t=e.name)&&void 0!==t?t:"Other"}}),label:r("select-city"),placeholder:r("select-city"),error:n})},BranchField=e=>{let{value:t,onValueChange:a,city:s="",error:n,branches:r=[]}=e;const i=(0,c.useTranslations)();return(0,l.jsx)(_.I,{value:t,onValueChange:e=>{null==a||a(r,e)},items:r.map(e=>({value:e.id,label:e.name.defaultTranslation})),label:i("select-branch"),placeholder:i("select-branch"),error:n})};var R=a(27241),M=a(40658),q=a(93132),W=a(47613),Q=a(79941);function EmptyCartWarningModal(e){let{open:t,setOpen:a,onAcceptDeleteC
1art:s}=e;const[n,r]=(0,h.useState)(!1),[{app:{cartInfo:i}}]=(0,g.p)(),[{removeDeliveryInfoAction:o}]=(0,P.Us)(),d=window.innerWidth<768,u=(()=>{const e=(0,M.jE)();return(0,M.n_)({mutationFn:()=>(0,R.a_)(),onSuccess:()=>{e.invalidateQueries({queryKey:["cart"]})}})})(),m=(0,c.useTranslations)("header"),x=(0,h.useCallback)(async()=>{try{var e,t;const l=null!==(t=null==i||null===(e=i.data)||void 0===e?void 0:e.cartItems)&&void 0!==t?t:[];r(!0),l.length>0&&await u.mutateAsync(),a(!1),o(),null==s||s(),r(!1)}catch(l){}},[i,u]),p=(0,h.useCallback)(()=>{a(!1)},[]);return(0,l.jsx)(Q.st,{open:t,onOpenChange:e=>{a(e)},children:(0,l.jsxs)(Q.lW,{className:"mx-auto w-full max-w-md",side:d?"bottom":"center",style:{zIndex:9999999},children:[(0,l.jsxs)(Q.T9,{children:[(0,l.jsx)(Q.aL,{className:"text-center text-foreground",children:m("cart-warning-title")}),(0,l.jsx)(Q.i3,{})]}),(0,l.jsxs)("div",{className:"px-6 py-4",children:[(0,l.jsx)("p",{className:"mb-6 text-center text-gray-600 dark:text-gray-400",children:m("cart-warning-message")}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)(C.$n,{variant:"outlined",onClick:p,className:"flex-1",children:m("cancel")}),(0,l.jsx)(C.$n,{onClick:x,className:"flex-1",isLoading:n,children:m("continue")})]})]})]})})}var B=a(61038),U=a(92868);let $;Promise.all([a.e(8783),a.e(9947)]).then(a.t.bind(a,72250,23)).then(e=>{$=e.LatLng});const V=(0,z.default)(()=>Promise.all([a.e(5475),a.e(8783),a.e(9947),a.e(7217)]).then(a.bind(a,67217)),{loadableGenerated:{webpack:()=>[67217]},ssr:!1}),SelectBranchModal=e=>{let{orderType:t,setOrderType:a}=e;const[s,n]=(0,h.useState)(!1),r=(0,c.useTranslations)(),i=(0,M.jE)(),[{auth:o,language:{dir:d},app:{locationModalOpen:u,deliveryInfo:m,cartInfo:x}}]=(0,g.p)(),[{updateLocationModalOpenAction:p,updateDeliveryInfoAction:f}]=(0,P.Us)(),[v,b]=(0,h.useState)(null),[w,j]=(0,h.useState)([0,0]),[N,y]=(0,h.useState)(!1),[k,T]=(0,h.useState)(!1),[I,A]=(0,h.useState)({streetName:"",buildingName:"",apartmentNumber:"",notes:"",isDefault:!1}),{data:S}=(0,M.pw)({queryKey:["countries"],queryFn:()=>(0,R.oj)()}),E=(0,h.useMemo)(()=>!!(I.streetName&&I.buildingName&&I.apartmentNumber),[I]),handleContinue=async e=>{if(console.log({addressFormData:e}),T(!0),null==v?void 0:v.branchId){if("new-address"===v.addressId){var t,a;const n=await(0,q.Rt)(null!==(t=w[0])&&void 0!==t?t:0,null!==(a=w[1])&&void 0!==a?a:0);let r="";if(n){const e=(0,q.B4)(n.country,S?S.map(e=>({id:e.name,name:e.name})):[]);e&&(r=e.name)}
1try{var l;const t=[];r&&t.push(r),(null==n?void 0:n.city)&&t.push(n.city),(null==e?void 0:e.streetName)&&t.push("Street ".concat(e.streetName)),(null==e?void 0:e.buildingName)&&t.push("Building ".concat(e.buildingName)),(null==e?void 0:e.apartmentNumber)&&t.push("Apartment ".concat(e.apartmentNumber)),(null==e?void 0:e.notes)&&t.push(e.notes);const a=t.join(", ");console.log({addressLine1:a});const s=await(0,W.NG)({name:{en:"".concat(r," - ").concat(null==n?void 0:n.city," - ").concat((null==e?void 0:e.streetName)||(null==n?void 0:n.area)),ar:"".concat(r," - ").concat(null==n?void 0:n.city," - ").concat((null==e?void 0:e.streetName)||(null==n?void 0:n.area))},location:{coordinates:[w[1],w[0]],type:"Point"},country:r,city:null==n?void 0:n.city,area:(null==e?void 0:e.streetName)||(null==n?void 0:n.area),type:"building",street:(null==e?void 0:e.streetName)||" ",addressLine1:a,phone:" ",isDefault:(null==e?void 0:e.isDefault)||!1});i.invalidateQueries({queryKey:["addresses",null===(l=o.userInformation)||void 0===l?void 0:l._id]}),f({...v,addressId:s.id}),b(null),p(!1)}catch(s){}}else console.log({deliveryInfoTemp:v}),f(v),b(null),p(!1);T(!1)}};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(O,{hideHeader:!0,open:u,place:"center",className:"h-fit max-h-[90vh]",containerClassname:"p-0",setOpen:e=>p("function"==typeof e?e(u):e),body:(0,l.jsx)(ModalBody,{orderType:t,setOrderType:a,deliveryInfoTemp:v,setDeliveryInfoTemp:b,selectedCoordinates:w,setSelectedCoordinates:j,setLoadingLocation:y,showCartWarning:s,setShowCartWarning:n,handleContinue,addressForm:I,setAddressForm:A}),footer:(0,l.jsxs)("div",{dir:d,className:"mb-2 flex items-center justify-center gap-3",children:[(null==m?void 0:m.branchId)&&(0,l.jsx)(C.$n,{variant:"danger",onClick:()=>{p(!1),b(null),A({streetName:"",buildingName:"",apartmentNumber:"",notes:"",isDefault:!1})},className:"w-auto min-w-[250px]",disabled:k,children:r("cancel")}),(0,l.jsx)(C.$n,{variant:"danger",onClick:()=>{var e,t;(null!==(t=null==x||null===(e=x.data)||void 0===e?void 0:e.cartItems)&&void 0!==t?t:[]).length>0&&(null==m?void 0:m.branchId)&&(null==v?void 0:v.branchId)!==(null==m?void 0:m.branchId)?n(!0):handleContinue(I)},className:"w-auto min-w-[250px]",disabled:!(null==v?void 0:v.branchId)||N||k||"delivery"===t&&"new-address"===(null==v?void 0:v.addressId)&&!E,isLoading:k,children:r("continue")})]})})})};function ModalBody(e){let{orderType:t,setOrderType:a,deliveryInfoTemp:s,setDeliveryInfoTemp:n,setSelectedCoordinates:r,setLoadingLocation:i,showCartWarning:o,setShowCartWarning:d,handleContinue:u,addressForm:m,setAddressForm:x}=e;var p,f;const[{language:{dir:v},app:{addresses:b}}]=(0,g.p)(),w=(0,c.useTranslations)(),j=(0,c.useTranslations)("cart"),N=(0,c.useTranslations)("profile"),C=window.innerWidth<768,[k,T]=(0,h.useState)(null),[I,A]=(0,h.useState)(),[O,S]=(0,h.useState)(),[P,z]=(0,h.useState)([]),[q,W]=(0,h.useState)();console.log({addressForm:m});const{data:Q}=(0,M.pw)({queryKey:["cities"],queryFn:()=>(0,R.i6)()}),changeMarkerPosition=async(e,a)=>{var l,s;i(!0),r([null!==(l=e.lat)&&void 0!==l?l:0,null!==(s=e.lng)&&void 0!==s?s:0]);try{const l=await(async e=>{let{lat:t,lng:a}=e;var l;return null!==(l=(await D.S.get("".concat(F,"/branches/by-location"),{params:{lat:t,lng:a}})).data)&&void 0!==l?l:{}})({lng:e.lng,lat:e.lat});var o,d,c,u,m,x,h,p,f;l&&l.id?(n({orderType:t,deliveryCost:null!==(m=null===(d=l.zones[0])||void 0===d||null===(o=d.deliveryFee)||void 0===o?void 0:o.value)&&void 0!==m?m:0,minOrderAmount:null!==(x=null===(c=l.zones[0])||void 0===c?void 0:c.minOrderAmount)&&void 0!==x?x:0,address:null!==(h=l.countryIso3)&&void 0!==h?h:"",sellerId:l.id,coordinates:null!==(p=l.coordinates)&&void 0!==p?p:[],zoneId:null===(u=l.zones[0])||void 0===u?void 0:u.zoneId,currencyCode:l.baseCurrencyCode,branchName:{en:l.name.en,ar:l.name.ar,defaultTranslation:l.name.defaultTranslation},addressId:null!==(f=null!=a?a:q)&&void 0!==f?f:"",branchId:l.id}),T(null)):(n(null),T("NO_BRANCH_FOUND"))}catch(g){var v;n(null),404===(null==g||null===(v=g.response)||void 0===v?void 0:v.status)?T("NO_BRANCH_FOUND"):T("UNKNOWN_ERROR")}i(!1)};var K,H,G;return(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)(E.tU,{value:t,onValueChange:e=>{a(e),n(null)},className:"w-full",children:[(0,l.jsxs)(E.j7,{className:(0,y.QP)("flex h-12 w-full justify-between bg-transparent p-0","ltr"===v?"flex-row":"flex-row-reverse"),children:[(0,l.jsx)(E.Xi,{className:"relative h-10 w-full bg-transparent text-gray-500 after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:bg-gray-300 after:transition-colors after:duration-200 data-[state=active]:bg-transparent data-[state=active]:text-primary-500 data-[state=active]:shadow-none data-[state=active]:after:bg-primary-500 md:text-lg",value:"delivery",children:w("delivery")}),(0,l.jsx)(E.Xi,{className:"relative h-10 w-full bg-transparent text-gray-500 after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:bg-gray-300 after:transition-colors after:duration-200 data-[state=active]:bg-transparent data-[state=active]:text-primary-500 data-[state=active]:shadow-none data-[state=active]:after:bg-primary-500 md:text-lg",value:"pickup",children:w("pickup")})]}),(0,l.jsxs)(E.av,{value:"delivery",className:"w-full",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-3 text-sm font-medium text-foreground",children:[(0,l.jsx)("div",{className:"flex items-center justify-center gap-2",children:(0,l.jsx)(_.I,{selectTriggerClassName:"min-w-[150px]",placeholder:w("selectAddress"),items:[...null!==(K=null==b?void 0:b.map(e=>{var t;return{value:null==e?void 0:e.id,label:null!==(t=null==e?void 0:e.name.defaultTranslation)&&void 0!==t?t:""}}))&&void 0!==K?K:[],{value:"new-address",label:w("newAddress")}],value:q,onValueChange:e=>{if(W(e),x({streetName:"",buildingName:"",apartmentNumber:"",notes:"",isDefault:!1}),"new-address"!==e){var t;const a=null==b?void 0:b.find(t=>
1t.id===e),l=null==a||null===(t=a.location)||void 0===t?void 0:t.coordinates;l&&changeMarkerPosition(new $(l[1],l[0]),e)}}})}),(0,l.jsxs)("div",{className:(0,y.QP)("flex items-center gap-1","ltr"===v?"flex-row":"flex-row-reverse"),children:[(0,l.jsx)("p",{children:w("delivery-cost")}),s&&(null==s?void 0:s.branchId)?(0,l.jsxs)("span",{className:(0,y.QP)("flex items-center gap-1","ltr"===v?"flex-row":"flex-row-reverse"),children:[(0,l.jsx)("span",{children:null!==(H=null==s?void 0:s.deliveryCost)&&void 0!==H?H:0}),(0,l.jsx)("span",{children:null!==(G=null==s?void 0:s.currencyCode)&&void 0!==G?G:0})]}):(0,l.jsx)("span",{children:"/"})]}),(0,l.jsxs)("div",{className:(0,y.QP)("flex items-center gap-1","ltr"===v?"flex-row":"flex-row-reverse"),children:[(0,l.jsx)("p",{children:w("min-order-amount")}),s&&(null==s?void 0:s.branchId)?(0,l.jsxs)("span",{className:(0,y.QP)("flex items-center gap-1","ltr"===v?"flex-row":"flex-row-reverse"),children:[(0,l.jsx)("span",{children:s.minOrderAmount}),(0,l.jsx)("span",{children:s.currencyCode})]}):(0,l.jsx)("span",{children:"/"})]}),(0,l.jsxs)("p",{children:[w("branch")," ",(null==s||null===(p=s.branchName)||void 0===p?void 0:p.defaultTranslation)||(null==s||null===(f=s.branchName)||void 0===f?void 0:f.en)]})]}),(0,l.jsxs)("div",{className:"w-full",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center",children:["NO_BRANCH_FOUND"===k&&(0,l.jsx)(L.o,{variant:"subtitle1",className:"mb-2 text-center text-primary-500",children:w("not-found")}),"UNKNOWN_ERROR"===k&&(0,l.jsx)(L.o,{variant:"subtitle1",className:"mb-2 text-center text-primary-500",children:w("delivery-not-available")})]}),"new-address"===q&&(0,l.jsx)(V,{onChangeMarkerPosition:changeMarkerPosition,...C&&{height:"300px"}}),"new-address"===q&&(null==s?void 0:s.branchId)&&(0,l.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,l.jsx)("div",{className:"text-lg font-medium text-foreground",children:j("profile.completeAddressInfo")}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(B.s,{label:j("StreetName"),placeholder:j("StreetName"),value:m.streetName,onChange:e=>x(t=>({...t,streetName:e.target.value})),required:!0}),(0,l.jsx)(B.s,{label:j("buildingName"),placeholder:j("buildingName"),value:m.buildingName,onChange:e=>x(t=>({...t,buildingName:e.target.value})),required:!0}),(0,l.jsx)(B.s,{label:N("apartmentNumber"),placeholder:N("apartmentNumber"),value:m.apartmentNumber,onChange:e=>x(t=>({...t,apartmentNumber:e.target.value})),required:!0}),(0,l.jsx)(B.s,{label:N("otherDetails"),placeholder:N("otherDetails"),value:m.notes,onChange:e=>x(t=>({...t,notes:e.target.value}))}),(0,l.jsx)(U.x,{onCheckedChange:e=>{x(t=>({...t,isDefault:e}))},checked:m.isDefault,label:N("setAsDefaultAddress"),containerClassName:"items-center"})]})]})]})]}),(0,l.jsxs)(E.av,{value:"pickup",className:"flex w-full flex-col gap-4",children:[(0,l.jsx)(CityField,{selectedCity:I,setSelectedCity:async e=>{A(e);const t=null==Q?void 0:Q.find(t=>t.id===e);if(t)try{const e=null==t?void 0:t.branches;z(e),O&&!e.some(e=>e.id===O)&&(S(void 0),n(null))}catch(a){z([])}},cities:null!=Q?Q:[]}),(0,l.jsx)(BranchField,{value:O,onValueChange:(e,a)=>{(e=>{const a=P.find(t=>t.id===e);a&&(S(e),n({orderType:t,deliveryCost:0,minOrderAmount:0,address:"",sellerId:a.id,coordinates:[],zoneId:"",currencyCode:a.baseCurrencyCode,branchName:{en:a.name.en,ar:a.name.ar,defaultTranslation:a.name.defaultTranslation},branchId:a.id,addressId:""}))})(a)},city:I,branches:P})]})]}),(0,l.jsx)(EmptyCartWarningModal,{open:o,setOpen:d,onAcceptDeleteCart:()=>{u(m)}})]})}const DeliveryButtons=()=>{const e=(0,c.useTranslations)("header"),[t,a]=(0,h.useState)("delivery"),[{language:{dir:s},app:{deliveryInfo:n}}]=(0,g.p)(),[{updateLocationModalOpenAction:r}]=(0,P.Us)(),i=(0,h.useCallback)((e,t)=>{t.preventDefault(),a(e),r(!0)},[]);return(0,l.jsxs)("div",{className:"flex w-full gap-2 px-2 md:px-5 lg:w-auto",children:[(0,l.jsx)(SelectBranchModal,{orderType:t,setOrderType:a}),(0,l.jsx)(C.$n,{dir:s,type:"button",variant:"gradient",className:"group relative flex min-w-0 max-w-full flex-1 items-center justify-center overflow-hidden p-1 text-sm max-md:max-w-8 md:min-w-[120px] md:flex-initial md:px-3 md:py-2.5 lg:min-w-[140px]",onClick:e=>i("delivery",e),children:(0,l.jsxs)("div",{className:"flex min-w-0 max-w-full items-center gap-2",children:[(0,l.jsx)(I.A,{size:20,className:"flex-shrink-0"}),(0,l.jsx)("span",{className:"min-w-0 max-w-full truncate text-xs font-medium max-md:hidden sm:text-sm",children:e("delivery")})]})}),(0,l.jsx)(C.$n,{dir:s,type:"button",variant:"olive",className:"group relative flex min-w-0 max-w-full flex-1 items-center justify-center overflow-hidden p-1 text-sm max-md:max-w-8 md:min-w-[120px] md:flex-initial md:px-3 md:py-2.5 lg:min-w-[140px]",onClick:e=>i("pickup",e),children:(0,l.jsxs)("div",{className:"flex min-w-0 max-w-full items-center gap-2",children:[(0,l.jsx)(T.A,{size:20,className:"flex-shrink-0"}),(0,l.jsx)("span",{className:"min-w-0 max-w-full truncate text-xs font-medium max-md:hidden sm:text-sm",children:e("pickup")})]})}),(0,l.jsx)(k.Bc,{children:(0,l.jsxs)(k.m_,{children:[(0,l.jsx)(k.k$,{asChild:!0,children:(0,l.jsx)("div",{className:"group relative flex h-9 w-fit min-w-0 max-w-[120px] flex-1 items-center justify-center overflow-hidden truncate rounded-md bg-primary-500 px-3 py-2.5 text-sm hover:bg-primary-500 min-[500px]:max-w-[220px] md:min-w-[120px] md:max-w-[140px] md:flex-initial lg:min-w-[140px]",children:(0,l.jsx)("div",{className:"flex min-w-0 max-w-full items-center gap-2 truncate",children:(0,l.jsxs)("span",{className:"min-w-0 max-w-full truncate text-xs font-medium !text-[#FFF] sm:text-sm",children:[(null==n?void 0:n.orderType)?e("".concat(null==n?void 0:n.orderType,"2")):"",": ",null==n?void 0:n.branchName.defaultTranslation]})})})}),(0,l.jsx)(k.ZI,{side:"bottom",className:"z-[9999999] bg-white-300 dark:bg-black-300",children:(0,l.jsxs)("p",{children:[(null==n?void 0:n.orderType)?e("".concat(null==n?void 0:n.orderType,"2")):"",":"," ",null==n?void 0:n.branchName.defaultTranslation]})})]})})]})};var K=a(23786),H=a(50697),G=a(11185),X=a(78710),Y=a(15271),Z=a(78004);const J="justify-start group flex w-full cursor-pointer items-center gap-2 p-2 transition-all duration-300 hover:bg-primary-500 ",ee="text-foreground transition-all duration-300 group-hover:text-white-500",te="text-primary-600 group-hover:text-white-500 transition-all duration-300",HeaderMenu=e=>{let{closeMenu:t,closeSidebar:a}=e;const s=(0,c.useTranslations)("header"),[{language:{dir:n},auth:{isGuest:r,isAuthenticated:i}}]=(0,g.p)(),o=(0,x.usePathname)(),u=(0,x.useRouter)(),h=i&&!r;return(0,l.jsxs)("div",{dir:n,className:"flex w-full select-none flex-col gap-2 overflow-hidden bg-white-500 dark:bg-black-900",children:[!
1o.includes("login")&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(m(),{href:"/profile?tab=account",onClick:()=>{t(),null==a||a()},className:J,children:[(0,l.jsx)(d.A,{className:te}),(0,l.jsx)(L.o,{dir:n,variant:"caption-bold",className:ee,children:s("the-account")})]}),(0,l.jsxs)(m(),{href:"/profile?tab=myOrders",onClick:()=>{t(),null==a||a()},className:J,children:[(0,l.jsx)(H.A,{className:te}),(0,l.jsx)(L.o,{dir:n,variant:"caption-bold",className:ee,children:s("my-orders")})]}),(0,l.jsxs)(m(),{href:"/profile?tab=favorite",onClick:()=>{t(),null==a||a()},className:J,children:[(0,l.jsx)(G.A,{className:te}),(0,l.jsx)(L.o,{dir:n,variant:"caption-bold",className:ee,children:s("the-wishlist")})]})]}),h?(0,l.jsxs)("button",{type:"button",dir:n,className:J,onClick:()=>{Z.A.remove(K.q.TOKEN),Z.A.remove(K.q.DELIVERY_INFO),Z.A.remove(K.q.USER_INFORMATION),Z.A.remove(K.q.COUPON_CODE),t(),null==a||a(),window.location.reload()},children:[(0,l.jsx)(Y.A,{className:te}),(0,l.jsx)(L.o,{dir:n,variant:"caption-bold",className:ee,children:s("logout")})]}):(0,l.jsxs)("button",{type:"button",dir:n,className:J,onClick:()=>{t(),null==a||a(),u.push("/auth/login")},children:[(0,l.jsx)(X.A,{className:te}),(0,l.jsx)(L.o,{dir:n,variant:"caption-bold",className:ee,children:s("login")})]})]})};var ae=a(72874);const le="transition-all duration-500",se=(0,i.cn)("text-white-500 cursor-pointer",le),Header=()=>{var e,t;const[{app:{cartInfo:a}}]=(0,g.p)(),{scrollDirection:u}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{threshold:t=100,debounceMs:a=10}=e,[l,s]=(0,h.useState)(null),[n,r]=(0,h.useState)(!1),[i,o]=(0,h.useState)(0);return(0,h.useEffect)(()=>{let e;const onScroll=l=>{clearTimeout(e),e=setTimeout(()=>{var e;const a=(null===(e=l.target.scrollingElement)||void 0===e?void 0:e.scrollTop)||window.scrollY;a>i&&Math.abs(a-i)>5?s("down"):a<i&&Math.abs(a-i)>5&&s("up"),r(a>t),o(a)},a)};return document.addEventListener("scroll",onScroll,{passive:!0}),()=>{document.removeEventListener("scroll",onScroll),clearTimeout(e)}},[i,t,a]),{scrollDirection:l,isScrolled:n,scrollY:i}}({threshold:100}),p=window.innerWidth<768,f=(0,c.useTranslations)("header"),v=(0,x.usePathname)(),[b,w]=(0,h.useState)(!1),j=(0,c.useLocale)();var N;const C=null!==(N=null==a||null===(t=a.data)||void 0===t||null===(e=t.cartItems)||void 0===e?void 0:e.reduce((e,t)=>e+((null==t?void 0:t.quantity)||0),0))&&void 0!==N?N:0,k=(0,h.useMemo)(()=>(0,i.cn)("max-sm:text-[10px] max-md:text-xs text-button text-white-500 nav-link text-[16px] font-[400] hover:text-white-700",le),[]);return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("nav",{className:(0,i.cn)("navbar group fixed left-0 right-0 top-0 z-40 select-none pb-3 backdrop-blur-sm bg-primary-500 will-change-transform","h-[".concat(128,"px]"),le,"down"===u?"-translate-y-full":"translate-y-0"),children:[(0,l.jsx)("div",{children:(0,l.jsxs)(s.Container,{className:"relative flex h-[60px] items-center justify-between !bg-transparent px-2 md:px-10",children:[(0,l.jsx)(DeliveryButtons,{}),(0,l.jsx)("div",{className:"left-0 top-0 z-[-1] flex w-full max-md:hidden min-[1200px]:absolute min-[1200px]:justify-center",children:(0,l.jsx)(m(),{href:"/",className:"shrink-0",children:(0,l.jsx)(ae.default,{className:"h-[60px] shrink-0",src:"/logo.svg",alt:"Logo",width:60,height:60,priority:!p,loading:p?"lazy":"eager"})})}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)(LocaleSelect,{}),(0,l.jsx)(ToggleTheme,{}),(0,l.jsxs)(m(),{href:"/cart",className:"relative max-md:hidden",children:[(0,l.jsx)(o.A,{className:(0,i.cn)(se)}),C>0&&(0,l.jsx)("span",{className:"absolute -right-2 -top-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary-500 text-xs !text-white-500",children:C})]}),(0,l.jsxs)(n.AM,{open:b,onOpenChange:w,children:[(0,l.jsx)(n.Wv,{asChild:!0,children:(0,l.jsx)(d.A,{className:(0,i.cn)(se),onClick:()=>w(!0)})}),(0,l.jsx)(n.hl,{className:"!absolute ".concat("ar"===j?"!left-[0px]":"!right-[10px]"," !z-[999999] mt-2 max-w-40 overflow-hidden border-0 bg-background-paper p-0"),align:"start",children:(0,l.jsx)(HeaderMenu,{closeMenu:()=>w(!1)})})]})]})]})}),(0,l.jsx)("hr",{className:(0,y.QP)("border-primary-400/20")}),(0,l.jsx)("div",{className:(0,y.QP)("flex items-center justify-center gap-3 px-2 pt-3 md:container sm:group-hover:gap-7 md:mx-auto md:gap-5 md:group-hover:gap-10",le),children:r.map(e=>(0,l.jsx)(m(),{href:e.href,className:(0,i.cn)(k,v&&v.endsWith(e.href)&&(0,i.cn)("font-extrabold !text-white-700")),target:e.target,children:f(e.label)},e.label))})]})})}},57808:(e,t,a)=>{Promise.resolve().then(a.bind(a,90768)),Promise.resolve().then(a.bind(a,86703)),Promise.resolve().then(a.bind(a,22926)),Promise.resolve().then(a.bind(a,97355)),Promise.resolve().then(a.bind(a,25706)),Promise.resolve().then(a.bind(a,22437)),Promise.resolve().then(a.bind(a,55778))},97355:(e,t,a)=>{"use strict";a.d(t,{Footer:()=>Footer});var l=a(9100),s=a(47552),n=a(60821),r=a(74310),i=a.n(r),o=a(72874),d=a(33675),c=a(86897),u=a(78451),m=a(27010);const x=[{label:"terms",href:"/terms"},{label:"hiring",href:"https://www.laffahjob.com/form",target:"_blank"},{label:"about_us",href:"/about-us"},{label:"activities",href:"/activitys"},{label:"branches",href:"/branches"},{label:"meals",href:"/meals"}],h=["/auth/login","/auth/register","/auth/reset-password"],Footer=()=>{var e,t,a,r,p,f;const v=(0,n.useTranslations)("footer"),g=(0,n.useLocale)(),{data:b}
1=(0,c.o7)(),w=(0,c.nb)(),[j,N]=(0,s.useState)(""),y=(0,d.usePathname)();return y&&h.includes(y)?null:(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(o.default,{src:"/images/au-home.png",alt:"om-home.png",fill:!0,className:"absolute left-0 top-[0px] z-[1] h-full w-full rotate-180 object-cover",loading:"lazy"}),(0,l.jsx)(o.default,{src:"/logo.svg",alt:"footer logo",width:130,height:130,className:"absolute left-1/2 top-0 z-[2] -mt-[80px] -translate-x-1/2",loading:"lazy"}),(0,l.jsx)("div",{className:"relative mx-1 overflow-hidden rounded-t-[80px] border-2 border-b-0 border-primary-500 px-4 py-9 sm:px-8 sm:py-20 md:rounded-t-[250px] md:py-12",children:(0,l.jsxs)("div",{className:"relative z-[2] flex flex-col items-center gap-2 md:gap-4",children:[(0,l.jsx)("p",{className:"text-[25px] font-[400] text-foreground md:text-[30px]",children:null===(t="en"===g?null==b||null===(a=b.contents[0])||void 0===a?void 0:a.footerTitle:null==b||null===(r=b.contents[0])||void 0===r?void 0:r.footerTitleAr)||void 0===t||null===(e=t.split(" "))||void 0===e?void 0:e.map((e,t)=>1===t?(0,l.jsx)("span",{className:"mx-1 font-[400] text-primary-500",children:e},t):(0,l.jsx)("span",{className:"mx-1",children:e},t))}),(0,l.jsx)("p",{className:"text-foreground/70",children:"en"===g?null==b||null===(p=b.contents[0])||void 0===p?void 0:p.subFooterTitle:null==b||null===(f=b.contents[0])||void 0===f?void 0:f.subFooterTitleAr}),(0,l.jsxs)("form",{className:"flex min-h-10 w-full max-w-[500px] rounded-md bg-[#aaaaaa] px-2 py-1",onSubmit:e=>{e.preventDefault(),w.mutateAsync(j).then(()=>{u.oR.success(v("subscribe.success")),N("")}).catch(()=>{u.oR.error(v("subscribe.error"))})},children:[(0,l.jsx)("input",{type:"email",placeholder:v("subscribe.email_placeholder"),className:"!text-white flex-1 border-none bg-transparent outline-none placeholder:text-sm placeholder:text-white-500",value:j,onChange:e=>N(e.target.value),required:!0}),(0,l.jsx)("button",{type:"submit",className:"text-md bg-primary-500 px-[50px] py-1 text-white-500",disabled:w.isPending,children:v("subscribe.button")})]}),(0,l.jsx)("ul",{className:"mt-2 flex flex-wrap justify-center gap-5 md:gap-10",children:null==x?void 0:x.map(e=>(0,l.jsx)("li",{className:"text-subtitle2 text-black-500 hover:text-primary-500 dark:text-white-500 hover:dark:text-primary-500",children:(0,l.jsx)(i(),{href:e.href,target:e.target,className:"text-[14px] font-[500] md:text-[18px]",children:v(e.label)})},e.label))}),(0,l.jsxs)("div",{className:"mt-[15px] flex w-full max-w-4xl flex-col items-center justify-center gap-4 px-2 sm:flex-row sm:gap-10",children:[(0,l.jsx)("p",{className:"max-w-xs text-center text-xl font-bold text-black-500 dark:text-white-500 sm:text-xl",children:v("download_app_description")}),(0,l.jsxs)("div",{className:"flex w-full flex-row gap-4 md:w-auto",children:[(0,l.jsx)(i(),{href:"https://play.google.com/store/apps/details?id=com.laffahrestaurants.app",children:(0,l.jsxs)(m.$n,{className:"flex h-[50px] w-full items-center gap-4 !p-2 sm:w-[165px]",children:[(0,l.jsxs)("div",{className:"flex flex-col items-end justify-start",children:[(0,l.jsx)("p",{className:"text-white text-xs uppercase",children:"Get it on"}),(0,l.jsx)("p",{className:"text-white -mt-1 text-base font-medium",children:"Google Play"})]}),(0,l.jsx)(o.default,{alt:"apple",src:"/images/Playstore.webp",width:20,height:24})]})}),(0,l.jsx)(i(),{href:"https://apps.apple.com/us/app/laffah-restaurant/id6470158669",children:(0,l.jsxs)(m.$n,{className:"flex h-[50px] w-full items-center gap-4 !p-2 sm:w-[165px]",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,l.jsx)("p",{className:"text-white text-xs uppercase",children:"Download on"}),(0,l.jsx)("p",{className:"text-white -mt-1 text-xl font-medium",children:"App Store"})]}),(0,l.jsx)(o.default,{alt:"apple",src:"/images/Apple.webp",width:24,height:24})]})})]})]})]})})]})}}},e=>{e.O(0,[1024,2123,6434,9638,871,8338,5903,2529,9074,1457,8755,4433,5121,9976,3929,1614,9075,8991,4704,3727,8133,901,8559,2894,1991,6161,2162,9291,9136,7279,6886,5155,5703,8146,1799,1981,7832,6088,5029,4296,8007,27,7358],()=>e(e.s=57808));var t=e.O();_N_E=t}]);
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.