import{c as N,d as m,bG as z,bN as O,bO as R,r as x,ao as W,bP as D,bQ as H,bL as F,u as p,j as t,m as b,B as f,bR as V,a5 as w,b as C,e as Q,i as q,bS as G,aA as J,bT as U,R as E,ag as X,a2 as Y,bU as _,bV as k,a3 as y,bW as v,bX as j,bJ as L}from"./index-gATdONBG.js";var g=(s=>(s.customization="Order Customization",s))(g||{});const le=()=>{const s=N(),a=m(z),[r,n]=O();let e="",o="";r.forEach((c,u)=>{u.toLowerCase()==="productid"?e=c:u.toLowerCase()==="dialog"&&(o=c)});const l=m(R(e));x.useEffect(()=>{a||l&&Object.keys(g).includes(o)&&g[o]===g.customization&&(s(W(l)),s(D({productId:e})).then(()=>{s(H(!0))}).catch(c=>{}))},[o,s,e,a,l,n])},K=s=>{const[a,r]=x.useState(null),n=F(["app-header","sticky-menu-header"]);return x.useEffect(()=>{const e=()=>{const o=s.find(l=>{const c=document.getElementById(l);if(c){const u=c.getBoundingClientRect();return u.top+(u.height-n)>0}return!1});if(document.documentElement.scrollHeight-document.documentElement.clientHeight===window.scrollY){r("drinks");return}o&&r(o)};return window.addEventListener("resize",e),window.addEventListener("scroll",e),setTimeout(()=>{e()},200),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e)}},[s]),a},Z=({className:s=""})=>{const{t:a}=p("components/back-to-top");return t.jsx("div",{className:b("flex justify-end",s),children:t.jsxs(f,{variant:"link",onClick:V,"aria-label":"scroll-to-top-button",className:"flex items-center",children:[t.jsx(w,{className:"rotate-180"}),a("label")]})})},ce=Z,ee=({className:s=""})=>{const{t:a}=p("components/delivery-store"),r=N(),n=C(),e=m(Q),o=()=>{e?r(U(!0)):n(E.Address)};return q?null:t.jsxs(f,{className:b("flex w-full items-center justify-center gap-x-2 overflow-hidden rounded-lg border-0 bg-green px-6 py-1.5",s),"aria-label":"store-change-button",variant:"link",onClick:o,children:[t.jsx(G,{}),t.jsx("p",{className:"flex items-center gap-x-2 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-white",children:e?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a("store",{store:e.name})}),t.jsx(J,{fill:"white"})]}):a("noStore")})]})},re=ee,te=({children:s,className:a=""})=>t.jsx("p",{className:b("text-2xl font-semibold text-dark-charcoal",a),children:s}),se=({items:s,currentSection:a})=>{var S;const{t:r}=p("globals"),[n,e]=x.useState("leftmost"),o=x.useRef(null),l=(S=o.current)==null?void 0:S.scrollWidth,c=o.current,u=()=>{v(c,0),e(j(c))},B=()=>{v(c,l),e(j(c))},P=()=>{e(j(c))},M=(i,d)=>{const h=i.target;h.classList.add("clicked-menu"),T(h),L(d.id)},T=i=>{const d=o.current;if(d){const h=d.clientWidth,I=i.offsetLeft,$=i.clientWidth,A=Math.max(I-(h-$)/2,0);v(d,Math.round(A))}};return t.jsxs("div",{className:"relative flex h-[65px] items-center after:absolute",children:[k(c)&&t.jsx(f,{variant:"icon",className:"hidden p-0 md:block","aria-label":"scroll-left-button",onClick:u,disabled:n==="leftmost",children:t.jsx(w,{className:"text rotate-90",color:n==="leftmost"?"#BEBEBE":"#219653"})}),t.jsx("div",{id:"scrollspy",ref:o,onScroll:P,className:"flex h-full flex-1 select-none overflow-x-auto scroll-smooth whitespace-nowrap scrollbar-hide",children:s.map((i,d)=>t.jsx(y,{id:`menu-item-${i.id}`,"data-test-id":`menu-item-${d}`,"data-seq":d,className:b("flex h-full items-center border-b-[3px] border-transparent px-4 text-sm font-semibold text-dark-charcoal hover:text-green ",a===i.id&&"active-menu"),to:i.path,onClick:h=>M(h,i),children:r(i.label)},d))}),k(c)&&t.jsx(f,{onClick:B,variant:"icon",className:"hidden p-0 md:block","aria-label":"scroll-right-button",disabled:n==="rightmost",children:t.jsx(w,{className:"-rotate-90",color:n==="rightmost"?"#BEBEBE":"#219653"})})]})},oe=({items:s})=>{const{t:a}=p("globals"),r=C(),n=(e,o)=>{L(o.id)};return t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"mx-4 my-5 flex flex-row items-center justify-between",children:[t.jsx(te,{children:a("navLink.menu")}),t.jsx(f,{onClick:()=>r(E.Menu),variant:"link","aria-label":"view-all",className:"uppercase",children:a("button.viewAll")})]}),t.jsx("div",{className:"flex w-full gap-x-2 overflow-x-scroll px-4 scrollbar-hide",children:s.map((e,o)=>t.jsxs(y,{"data-test-id":`category-${e.id}`,className:"flex min-w-[70px] flex-col gap-y-1",to:e.path,onClick:l=>n(l,e),children:[t.jsx("div",{className:"w-full rounded bg-white px-1 py-4",children:t.jsx("img",{src:e.thumbnailSrc,width:"70",height:"56",loading:"lazy",alt:`${a(e.label)}`,className:"mx-auto h-14 object-contain"})}),t.jsx("p",{className:"text-center text-xs font-semibold text-dark-charcoal",children:a(e.label)},o)]},o))})]})},ae=({simple:s=!0})=>{const a=X("md"),{menuCategories:r}=m(Y),n=m(_),e=r.filter(l=>n.includes(l.id)&&l.active),o=K(e.map(l=>l.id));return e.length>0&&t.jsx(t.Fragment,{children:a||s?t.jsx(se,{items:e,currentSection:o}):t.jsx(oe,{items:e,currentSection:o})})},ie=ae;export{ce as B,re as D,te as S,ie as a,K as b,le as u};