1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9811],{59987:function(e,t,n){n.d(t,{s:function(){return x}});var r=n(85893),s=n(25675),l=n.n(s),a=n(67294),o=n(26628),i=n(55276),c=n(80006);let d=e=>!/^\s*(?:javascript|data|vbscript):/i.test(e),u="web_responsive";function x(e){var t;let{autoplay:n=!0}=e,s=function(){let[e,t]=(0,a.useState)(void 0);return(0,a.useEffect)(()=>{let e=window.matchMedia("(max-width: 639.98px)");t(e.matches);let n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}(),x=(0,o.v9)(e=>e.menu.banners),m=(0,o.v9)(e=>e.menu.menuLoading),[h,p]=(0,a.useState)(0),f=(0,a.useRef)(),g=s?u:"web",v=(x||[]).filter(e=>{var t;return e.type===i.E.BANNER&&!!(null===(t=e.pictures[0])||void 0===t?void 0:t.url)}),b=v.filter(e=>e.category===g),y=b.length>0?b:v,j=y.length,w=j>0?h%j:0,C=(0,a.useCallback)(e=>{p((e%j+j)%j)},[j]);if((0,a.useEffect)(()=>{if(n&&!(j<=1))return f.current=setInterval(()=>{p(e=>(e+1)%j)},4e3),()=>clearInterval(f.current)},[n,j]),m&&0===j)return(0,r.jsx)("div",{className:"px-4 pt-2",children:(0,r.jsx)(c.Od,{className:"aspect-[3/2] w-full sm:aspect-[24/7]",rounded:"lg"})});if(void 0===s||0===j)return null;let k=s&&(null===(t=y[0])||void 0===t?void 0:t.category)===u?"aspect-[3/2]":"aspect-[24/7]";return(0,r.jsxs)("div",{className:"relative overflow-hidden",role:"region","aria-label":"Banners promocionales",children:[(0,r.jsx)("div",{className:"flex transition-transform duration-300 ease-out",style:{transform:"translateX(-".concat(100*w,"%)")},children:y.map((e,t)=>{let n=e.pictures[0],s=e.url&&d(e.url)?()=>{window.location.href=e.url}:void 0,a=n.url;return(0,r.jsx)("div",{className:"w-full shrink-0",children:(0,r.jsx)("button",{type:"button",onClick:s,disabled:!s,className:"relative block w-full overflow-hidden ".concat(k),children:(0,r.jsx)(l(),{src:a,alt:e.name||"Banner ".concat(t+1),fill:!0,className:"object-contain",sizes:"(max-width: 1280px) 100vw, 1280px",quality:90,priority:0===t})})},e.id)})}),j>1&&(0,r.jsx)("div",{className:"absolute bottom-0 inset-x-0 flex justify-center gap-0.5",children:y.map((e,t)=>(0,r.jsx)("button",{type:"button",onClick:()=>C(t),className:"flex h-11 w-6 items-end justify-center pb-2","aria-label":"Banner ".concat(t+1),children:(0,r.jsx)("span",{className:"block h-2 rounded-full transition-all ".concat(t===w?"w-6 !bg-surface":"w-2 !bg-surface/50")})},e.id))})]})}},26264:function(e,t,n){n.d(t,{OS:function(){return a},iW:function(){return o}});var r=n(85893),s=n(67294);let l=(0,s.createContext)(null);function a(){return(0,s.useContext)(l)}function o(e){let{children:t}=e,[n,a]=(0,s.useState)([]),[o,i]=(0,s.useState)(null),[c,d]=(0,s.useState)(null),u=(0,s.useCallback)(e=>{null==c||c(e)},[c]),x=(0,s.useCallback)(e=>{d(()=>e)},[]);return(0,r.jsx)(l.Provider,{value:{categories:n,activeCategoryId:o,onCategoryClick:u,setCategories:a,setActiveCategoryId:i,setOnCategoryClick:x},children:t})}},79811:function(e,t,n){n.d(t,{o:function(){return z}});var r=n(85893);n(519);var s=n(26982),l=n(67294),a=n(49089),o=n(26628),i=n(80006),c=n(79819),d=n(84029),u=n(81044),x=n(4122),m=n(59987);function h(e){let{categories:t,activeCategoryId:n,onCategoryClick:s,searchQuery:a,onSearchChange:o}=e,c=(0,l.useRef)(null),d=(0,l.useRef)(new Map),u=(0,l.useRef)(null),[x,m]=(0,l.useState)(!1),[h,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(x||!n||!c.current)return;let e=c.current,t=d.current.get(n);if(!t)return;let r=e.getBoundingClientRect(),s=t.getBoundingClientRect(),l=s.left-r.left+e.scrollLeft+s.width/2,a=l-e.clientWidth/2;e.scrollTo({left:a,behavior:"smooth"})},[n,x]);let f=(0,l.useCallback)(e=>{m(!0),s(e),setTimeout(()=>m(!1),800)},[s]);return 0===t.length?null:(0,r.jsx)("div",{"data-category-nav":!0,className:"sticky top-[56px] z-category-nav border-b border-catbar-divider bg-catbar-bg lg:hidden",children:(0,r.jsx)("div",{className:"mx-auto flex max-w-app items-center gap-2 px-4 pb-2.5 pt-4",children:h?(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-full border border-line bg-surface-subtle px-3 py-1.5",children:[(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-content-subtle",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,r.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,r.jsx)("input",{ref:u,type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"Buscar producto...","aria-label":"Buscar productos",className:"min-w-0 flex-1 bg-transparent text-sm text-content outline-none placeholder:text-content-subtle"}),a&&(0,r.jsx)("button",{type:"button",onClick:()=>o(""),className:"shrink-0 text-content-subtle hover:text-content-tertiary",children:(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,r.jsx)("button",{type:"button",onClick:()=>{p(!1),o("")},className:"shrink-0 text-sm font-medium text-catbar-text hover:opacity-80",children:"Cancelar"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:c,className:"scrollbar-hide flex min-w-0 flex-1 flex-nowrap gap-2 overflow-x-auto",style:{scrollSnapType:"x mandatory"},children:t.map(e=>(0,r.jsx)("div",{ref:t=>{t&&d.current.set(e.id,t)},className:"shrink-0",style:{scrollSnapAlign:"center"},children:(0,r.jsx)(i.Af,{active:n===e.id,onClick:()=>f(e.id),className:"font-category",children:e.name})},e.id))}),(0,r.jsx)("button",{type:"button",onClick:()=>{p(!0),setTimeout(()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.focus()},150)},className:"shrink-0 rounded-full p-2 text-catbar-text transition-colors hover:bg-catbar-text/10","aria-label":"Buscar productos",children:(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,r.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})})]})})})}function p(e){let{categories:t,activeCategoryId:n,onCategoryClick:s,searchQuery:a,onSearchChange:o}=e,i=(0,l.useRef)(null),c=(0,l.useRef)(null),d=(0,l.useRef)(new Map);return((0,l.useEffect)(()=>
1{if(!n)return;let e=c.current,t=d.current.get(n);if(!e||!t)return;let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.top<r.top+8?e.scrollTo({top:e.scrollTop+s.top-r.top-8,behavior:"smooth"}):s.bottom>r.bottom-8&&e.scrollTo({top:e.scrollTop+s.bottom-r.bottom+8,behavior:"smooth"})},[n]),0!==t.length||a)?(0,r.jsxs)("nav",{className:"sticky top-[72px] hidden max-h-[calc(100vh-88px)] w-60 shrink-0 flex-col self-start rounded-lg bg-catbar-bg p-3 lg:flex",children:[(0,r.jsxs)("div",{className:"mb-3 flex shrink-0 items-center justify-between",children:[(0,r.jsx)("p",{className:"text-sm font-semibold uppercase tracking-wide text-catbar-text-muted",children:"Categor\xedas"}),(0,r.jsx)("span",{className:"rounded-full bg-surface-muted px-2 py-0.5 text-xs font-medium text-content-muted",children:t.length})]}),(0,r.jsxs)("div",{className:"mb-3 flex shrink-0 items-center gap-2 rounded-lg border border-line bg-surface-subtle px-2.5 py-2",children:[(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-content-subtle",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,r.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,r.jsx)("input",{ref:i,type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"Buscar producto...",className:"min-w-0 flex-1 bg-transparent text-sm text-content-secondary outline-none placeholder:text-content-subtle"}),a&&(0,r.jsx)("button",{type:"button",onClick:()=>{var e;o(""),null===(e=i.current)||void 0===e||e.focus()},className:"shrink-0 text-content-subtle hover:text-content-tertiary",children:(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,r.jsxs)("ul",{ref:c,className:"scrollbar-hide min-h-0 flex-1 space-y-0.5 overflow-y-auto",children:[t.map(e=>{let t=n===e.id;return(0,r.jsx)("li",{ref:t=>{t?d.current.set(e.id,t):d.current.delete(e.id)},children:(0,r.jsxs)("button",{type:"button",onClick:()=>s(e.id),className:"group flex w-full items-center justify-between rounded-lg px-3 py-2.5 text-left text-base transition-colors ".concat(t?"!bg-catbar-active font-semibold text-catbar-active-text":"text-catbar-text hover:bg-catbar-text/5"),children:[(0,r.jsx)("span",{className:"truncate font-category",children:e.name}),(0,r.jsx)("span",{className:"ml-2 shrink-0 text-xs tabular-nums ".concat(t?"text-catbar-active-text/70":"text-catbar-text-muted group-hover:text-catbar-text"),children:e.products.length})]})},e.id)}),0===t.length&&a&&(0,r.jsx)("li",{className:"px-3 py-4 text-center text-sm text-content-subtle",children:"Sin resultados"})]})]}):null}var f=n(26264);n(71020);var g=n(27484),v=n.n(g),b=n(18672),y=n(4376),j=n(5190),w=n(22131),C=n(75704),k=n(22696),N=n(51942),M=n(79345),S=n(67921),P=n(63253);let T={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6},E={green:{dot:"bg-success",text:"text-success"},amber:{dot:"bg-warning",text:"text-warning"},blue:{dot:"bg-info",text:"text-info"},red:{dot:"bg-error",text:"text-error-strong"},gray:{dot:"bg-surface-strong",text:"text-menuheader-text-muted"}};function Z(e){let{status:t,onClick:n}=e,s=E[t.color]||E.gray,l="none"!==t.clickAction;return(0,r.jsxs)(l?"button":"span",{type:l?"button":void 0,onClick:l?n:void 0,"data-testid":"store-status-badge","data-status-color":t.color,className:"flex shrink-0 items-center gap-1.5 ".concat(l?"min-h-[44px] -my-1.5 px-2":"py-1.5"),children:[(0,r.jsx)("span",{className:"inline-block h-2 w-2 rounded-full ".concat(s.dot)}),(0,r.jsx)("span",{className:"text-sm font-medium ".concat(l?"underline underline-offset-2":""," ").concat(s.text),children:t.label})]})}function L(){let e=(0,o.I0)(),[t,n]=(0,l.useState)(!1),[a,i]=(0,l.useState)(!1);(0,l.useEffect)(()=>{n(!0)},[]);let c=(0,o.v9)(e=>e.core.settings),{currentSubsidiary:d,dispatchType:u}=(0,o.v9)(e=>e.searchStore),x=(0,o.v9)(e=>{var t;return null===(t=e.menu)||void 0===t?void 0:t.isPreview}),m=(0,C.Y)(),h=(0,j._)(),{hasAvailableSlots:p}=(0,w.h)(),f=!!(null==d?void 0:d.futureOrdersEnabled),g=f&&p,v=(null==d?void 0:d.businessHours)||[],b=t?(0,M.hM)(v,u):null,S=t&&m.isOpenNow&&!!b;return(0,r.jsxs)("div",{className:"mx-[calc(50%-50vw)] bg-menuheader-bg px-4 pb-3 pt-2 md:px-10 lg:pt-3 xl:px-0",children:[(0,r.jsxs)("div",{className:"mx-auto max-w-app",children:[t&&h.hasMismatch&&(0,r.jsxs)("div",{"data-testid":"coverage-mismatch-banner",className:"mb-3 rounded-xl border border-warning/30 bg-warning-soft px-4 py-3",children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-warning-strong",children:s.ZP.t("V2Coverage:mismatchTitle")}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-warning-strong",children:h.outOfCoverage?s.ZP.t("V2Coverage:outOfCoverageBody"):s.ZP.t("V2Coverage:mismatchBody")}),(0,r.jsx)("button",{type:"button","data-testid":"coverage-mismatch-cta",onClick:()=>e(P.ZP.openModal(y.ee.DELIVERY_OR_PICKUP)),className:"mt-2 text-xs font-semibold text-warning-strong underline underline-offset-2",children:s.ZP.t("V2Coverage:changeAddressOrStore")})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("h1",{className:"font-title text-lg font-bold text-menuheader-text md:text-xl",children:x?c.commerceName||s.ZP.t("V2Menu:menuTitle"):(null==d?void 0:d.name)||c.commerceName||s.ZP.t("V2Menu:menuTitle")}),t&&d&&!x&&(0,r.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[d.textAddress&&(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1 text-sm text-menuheader-text-muted",children:[(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 256 256",fill:"currentColor","aria-hidden":"true",className:"shrink-0",children:(0,r.jsx)("path",{d:"M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z"})}),(0,r.jsx)("span",{className:"truncate",children:(0,N.c)(d.textAddress)})]}
1),"scheduled"!==m.kind&&"no-store"!==m.kind&&(0,r.jsx)(Z,{status:m,onClick:()=>{"schedule"===m.clickAction?g&&e(P.ZP.openModal(y.ee.FUTURE_ORDER)):"hours"===m.clickAction&&i(!0)}})]})]}),(0,r.jsx)(k.m,{})]}),t&&d&&!x&&(0,r.jsx)(I,{open:a,onClose:()=>i(!1),storeName:d.name,storeAddress:(0,N.c)(d.textAddress),latitude:d.latitude,longitude:d.longitude,businessHours:v,isOpen:S,todayHours:b})]})}function I(e){var t;let{open:n,onClose:a,storeName:o,storeAddress:c,latitude:d,longitude:u,businessHours:x,isOpen:m,todayHours:h}=e,p=function(e){let t=new Set(e.map(e=>e.dispatchMethod)),n=t.has(b.CK.PICKUP)||t.has("both"),r=t.has(b.CK.DELIVERY)||t.has("both"),l=[];return n&&l.push({key:b.CK.PICKUP,label:s.ZP.t("DispatchMethodModal:pickUp")}),r&&l.push({key:b.CK.DELIVERY,label:s.ZP.t("DispatchMethodModal:delivery")}),l}(x),[f,g]=(0,l.useState)((null===(t=p[0])||void 0===t?void 0:t.key)||"");(0,l.useEffect)(()=>{if(n&&p.length>0){var e,t;g(null!==(t=null===(e=p[0])||void 0===e?void 0:e.key)&&void 0!==t?t:"")}},[n]);let y=x.filter(e=>e.dispatchMethod===f||"both"===e.dispatchMethod).sort((e,t)=>{var n,r,s,l;let a=(null!==(s=T[null===(n=e.day)||void 0===n?void 0:n.toLowerCase()])&&void 0!==s?s:7)-(null!==(l=T[null===(r=t.day)||void 0===r?void 0:r.toLowerCase()])&&void 0!==l?l:7);return 0!==a?a:e.openingTime.localeCompare(t.openingTime)}),j=y.reduce((e,t)=>{var n,r;let s=null===(n=t.day)||void 0===n?void 0:n.toLowerCase();if(s){let n=null!==(r=e.get(s))&&void 0!==r?r:[];n.push(t),e.set(s,n)}return e},new Map),w=d&&u?"https://maps.googleapis.com/maps/api/staticmap?center=".concat(d,",").concat(u,"&zoom=15&size=640x200&scale=2&markers=color:red%7C").concat(d,",").concat(u,"&key=").concat("AIzaSyCog-DSUAvTeLmHQGiV50_TAeQu8W1dM0Q"):null;return(0,r.jsx)(i.u_,{open:n,onClose:a,title:o,maxWidth:"sm",fullHeight:!0,footer:(0,r.jsx)("button",{type:"button",onClick:a,className:"w-full rounded-xl !bg-primary py-3 text-base font-semibold text-content-inverse transition-opacity hover:opacity-90",children:s.ZP.t("V2Common:done")}),children:(0,r.jsxs)("div",{className:"space-y-4",children:[w&&(0,r.jsx)("a",{href:"https://www.google.com/maps/search/?api=1&query=".concat(d,",").concat(u),target:"_blank",rel:"noopener noreferrer",className:"block overflow-hidden rounded-xl",children:(0,r.jsx)("img",{src:w,alt:s.ZP.t("V2Menu:storeMap",{storeName:o}),className:"h-40 w-full object-cover"})}),(0,r.jsxs)("div",{children:[c&&(0,r.jsx)("p",{className:"text-sm text-content-secondary",children:c}),(0,r.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"inline-block h-2 w-2 rounded-full ".concat(m?"bg-success":"bg-error")}),(0,r.jsxs)("span",{className:"text-sm font-medium ".concat(m?"text-success":"text-error-strong"),children:[m?s.ZP.t("V2Menu:openNow"):s.ZP.t("V2Menu:closed"),h&&" \xb7 ".concat((0,S.m)(h.openingTime)," - ").concat((0,S.m)(h.closingTime))]})]})]}),(0,r.jsx)("hr",{className:"border-line-subtle"}),p.length>1&&(0,r.jsx)("div",{className:"flex gap-4 border-b border-line-subtle",children:p.map(e=>{let t=f===e.key,n=e.key===b.CK.PICKUP;return(0,r.jsxs)("button",{type:"button",onClick:()=>g(e.key),className:"flex items-center gap-1.5 pb-2 text-sm font-semibold transition-colors ".concat(t?"border-b-2 border-content text-content":"text-content-subtle hover:text-content-tertiary"),children:[n?(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0 ".concat(t?"fill-content":"fill-content-subtle"),children:(0,r.jsx)("path",{d:"M15.1001 5.76L14.4001 3.51333C14.2535 2.91333 13.7335 2.5 13.1268 2.5H3.8668C3.2668 2.5 2.74013 2.92 2.60013 3.51333L1.90013 5.76C1.59346 7.07333 2.4668 7.83333 2.50013 7.87333V13.1667C2.50013 13.9 3.10013 14.5 3.83346 14.5H13.1668C13.9001 14.5 14.5001 13.9 14.5001 13.1667V7.87333C15.2468 7.12667 15.2268 6.26667 15.1001 5.76ZM9.1668 3.83333H10.4735L10.8335 6.18C10.8935 6.65333 10.5735 7.16667 9.98013 7.16667C9.53347 7.16667 9.1668 6.77333 9.1668 6.29333V3.83333ZM4.79347 6.40667C4.74013 6.84 4.39347 7.16667 3.9868 7.16667C3.3668 7.16667 3.0868 6.52 3.19346 6.07333L3.8668 3.83333H5.18013L4.79347 6.40667ZM7.83347 6.29333C7.83347 6.77333 7.4668 7.16667 6.97347 7.16667C6.47347 7.16667 6.1068 6.7 6.16013 6.18L6.5268 3.83333H7.83347V6.29333ZM13.0135 7.16667C12.6068 7.16667 12.2535 6.84 12.2068 6.40667L11.8201 3.83333L13.1068 3.82667L13.8068 6.07333C13.9135 6.52 13.6401 7.16667 13.0135 7.16667Z"})}):(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 17 17",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0 ".concat(t?"fill-content":"fill-content-subtle"),children:[(0,r.jsx)("path",{d:"M12.6668 5.16671C12.6668 4.43337 12.0668 3.83337 11.3335 3.83337H10.0002C9.6335 3.83337 9.3335 4.13337 9.3335 4.50004C9.3335 4.86671 9.6335 5.16671 10.0002 5.16671H11.3335V6.93337L9.0135 9.83337H6.66683V7.16671C6.66683 6.80004 6.36683 6.50004 6.00016 6.50004H4.00016C2.52683 6.50004 1.3335 7.69337 1.3335 9.16671V10.5C1.3335 10.8667 1.6335 11.1667 2.00016 11.1667H2.66683C2.66683 12.2734 3.56016 13.1667 4.66683 13.1667C5.7735 13.1667 6.66683 12.2734 6.66683 11.1667H9.0135C9.42016 11.1667 9.80016 10.98 10.
10535 10.6667L12.3735 7.76671C12.5668 7.52671 12.6668 7.23337 12.6668 6.93337V5.16671ZM4.66683 11.8334C4.30016 11.8334 4.00016 11.5334 4.00016 11.1667H5.3335C5.3335 11.5334 5.0335 11.8334 4.66683 11.8334Z"}),(0,r.jsx)("path",{d:"M4.00016 4.5H6.00016C6.36683 4.5 6.66683 4.8 6.66683 5.16667C6.66683 5.53333 6.36683 5.83333 6.00016 5.83333H4.00016C3.6335 5.83333 3.3335 5.53333 3.3335 5.16667C3.3335 4.8 3.6335 4.5 4.00016 4.5Z"}),(0,r.jsx)("path",{d:"M12.667 9.16675C11.5603 9.16675 10.667 10.0601 10.667 11.1667C10.667 12.2734 11.5603 13.1667 12.667 13.1667C13.7737 13.1667 14.667 12.2734 14.667 11.1667C14.667 10.0601 13.7737 9.16675 12.667 9.16675ZM12.667 11.8334C12.3003 11.8334 12.0003 11.5334 12.0003 11.1667C12.0003 10.8001 12.3003 10.5001 12.667 10.5001C13.0337 10.5001 13.3337 10.8001 13.3337 11.1667C13.3337 11.5334 13.0337 11.8334 12.667 11.8334Z"})]}),e.label]},e.key)})}),(0,r.jsx)("div",{children:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>{let t=j.get(e),n=v()().day(),l=T[e]===n,a=s.ZP.t("V2Days:".concat(e));return(0,r.jsxs)("div",{className:"flex items-center justify-between rounded-lg border-b border-line-subtle px-2 py-2.5 text-sm last:border-b-0 ".concat(l?"bg-surface-subtle font-semibold text-content":"text-content-tertiary"),children:[(0,r.jsx)("span",{children:a}),(null==t?void 0:t.length)?(0,r.jsx)("div",{className:"flex flex-col items-end gap-2",children:t.map(e=>(0,r.jsx)("span",{children:"".concat((0,S.m)(e.openingTime)," - ").concat((0,S.m)(e.closingTime))},e.id))}):(0,r.jsx)("span",{children:s.ZP.t("V2Menu:closed")})]},e)})})]})})}var R=n(9643),V=n(25675),B=n.n(V),A=n(1412),O=n(44674),H=n(29821);function D(e){let{product:t,onClick:n}=e,l=(0,H.H)(t.productId),a=t.hasOptions?s.ZP.t("CategoryItem:seeOptions"):(0,O.T4)(t.discountPrice),o=t.foodTypes.reduce((e,t)=>e+String(s.ZP.t("ProductTags:".concat(t))).length,0),c=t.label&&"ribbon"!==t.labelType?t.label:null,d=t.label&&"ribbon"===t.labelType?t.label:null;return(0,r.jsxs)("div",{role:"button",tabIndex:t.disabled?-1:0,"data-testid":"product-card-".concat(t.priceId),onClick:t.disabled?void 0:n,onKeyDown:e=>{t.disabled||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n())},"aria-disabled":t.disabled||void 0,className:"relative flex w-full cursor-pointer gap-x-3 overflow-hidden rounded-[var(--v2-card-radius)] bg-card-bg px-3 py-2 text-left outline outline-1 outline-line md:h-full md:gap-x-0 md:p-0 ".concat(t.disabled?"pointer-events-none opacity-50":""),children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-y-1 py-3 md:items-start md:p-4 lg:gap-y-2",children:[c&&(0,r.jsx)(i.yU,{label:c,labelType:t.labelType,className:"absolute left-0 top-0 z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,r.jsx)("h3",{className:"line-clamp-2 font-title text-base font-bold text-card-text md:text-lg ".concat(c?"mt-4":""),children:t.name}),(0,r.jsxs)("div",{className:"flex items-center gap-x-1.5",children:[(0,r.jsx)("span",{className:"text-base font-semibold text-card-price",children:a}),t.hasDiscount&&(0,r.jsx)("span",{className:"text-sm text-card-text-subtle line-through",children:(0,O.T4)(t.price)})]})]}),t.description&&(0,r.jsx)("p",{className:"line-clamp-2 text-sm text-card-text-muted lg:line-clamp-3",children:t.description}),t.foodTypes.length>0&&(0,r.jsx)(A.Z,{foodTypes:t.foodTypes,showLabel:o<=16}),!t.stockStatus.hasStock&&t.stockStatus.reservable&&(0,r.jsx)(i.Ct,{variant:"warning",children:s.ZP.t("ModifierGroup:outOfStockUntil")}),!t.stockStatus.hasStock&&!t.stockStatus.reservable&&(0,r.jsx)(i.Ct,{variant:"error",children:s.ZP.t("ModifierGroup:outOfStock")})]}),(0,r.jsxs)("div",{className:"relative flex aspect-square w-[120px] shrink-0 justify-end md:h-full md:w-auto",children:[d&&(0,r.jsx)("div",{className:"absolute right-0 top-[-2px] z-10",children:(0,r.jsx)(i.yU,{label:d,labelType:t.labelType})}),t.imageUrl?(0,r.jsx)("div",{className:"relative h-full w-full overflow-hidden rounded-[var(--v2-card-radius)] md:rounded-none md:rounded-r-[var(--v2-card-radius)]",children:(0,r.jsx)(B(),{src:t.imageUrl,alt:t.name,fill:!0,className:"object-cover",sizes:"(max-width: 768px) 120px, 180px"})}):(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center overflow-hidden rounded-[var(--v2-card-radius)] bg-card-text/5 md:rounded-none md:rounded-r-[var(--v2-card-radius)]",children:(0,r.jsxs)("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-card-text/20",children:[(0,r.jsx)("path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2"}),(0,r.jsx)("path",{d:"M7 2v20"}
1),(0,r.jsx)("path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7"})]})}),!t.disabled&&!t.stockStatus.reservable&&(l>0?(0,r.jsx)("div",{"data-testid":"product-card-".concat(t.priceId,"-counter"),"aria-label":"En carrito: ".concat(l),className:"absolute bottom-2 right-2 flex h-9 min-w-[2.25rem] items-center justify-center rounded-xl !bg-secondary px-2 text-sm font-semibold text-[color:var(--brand-secondary-text)] shadow-sm",children:l}):(0,r.jsx)("button",{type:"button","aria-label":"Agregar al carrito",className:"absolute bottom-2 right-2 flex items-center justify-center rounded-xl !bg-secondary p-2 shadow-sm hover:opacity-90",children:(0,r.jsx)("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 256 256",fill:"currentColor",className:"text-[color:var(--brand-secondary-text)]",children:(0,r.jsx)("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"})})}))]})]})}function U(e){let{categories:t,onProductClick:n,onVisibleCategoryChange:s}=e,a=(0,l.useRef)(new Map),o=(0,l.useRef)(new Map);return(0,l.useEffect)(()=>{o.current.clear();let e=new IntersectionObserver(e=>{e.forEach(e=>{let t=Number(e.target.getAttribute("data-category-id"));t&&o.current.set(t,e.isIntersecting)});let n=window.scrollY+window.innerHeight>=document.documentElement.scrollHeight-2,r=t[t.length-1];if(n&&r){s(r.id);return}let l=t.find(e=>!0===o.current.get(e.id));l&&s(l.id)},{rootMargin:"-".concat(120,"px 0px -60% 0px"),threshold:0});return a.current.forEach(t=>e.observe(t)),()=>e.disconnect()},[t,s]),(0,r.jsx)("div",{className:"space-y-6 py-4",children:t.map(e=>(0,r.jsxs)("section",{ref:t=>{t&&a.current.set(e.id,t)},"data-category-id":e.id,id:"category-".concat(e.slug),children:[(0,r.jsx)("h2",{className:"font-title mb-4 text-xl font-bold text-page-text",children:e.name}),(0,r.jsx)("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-2 md:auto-rows-[9.5rem] md:gap-3 lg:auto-rows-[12.5rem] lg:gap-4",children:e.products.map(t=>(0,r.jsx)(D,{product:t,onClick:()=>n(t.rawPrice,e.name)},t.priceId))})]},e.id))})}var _=n(15640);function K(e){let{priceGroups:t,selectedId:n}=e,s=(0,o.I0)();if(0===t.length)return null;let l=[...t].sort((e,t)=>e.position-t.position);return(0,r.jsx)("div",{className:"bg-catbar-bg px-4 py-2",children:(0,r.jsx)("div",{className:"scrollbar-hide mx-auto flex max-w-app gap-2 overflow-x-auto",children:l.map(e=>(0,r.jsx)(i.Af,{active:String(e.id)===n,onClick:()=>s(x.default.setSelectedPriceGroupId(String(e.id))),children:e.name},e.id))})})}function W(){return(0,r.jsx)("div",{className:"space-y-8 py-4",children:[1,2,3].map(e=>(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(i.Od,{className:"h-7 w-40"}),(0,r.jsx)("div",{className:"flex flex-col divide-y divide-line md:grid md:grid-cols-2 md:auto-rows-[9.5rem] md:gap-3 md:divide-y-0 lg:auto-rows-[12.5rem] lg:gap-4",children:[1,2,3,4].map(e=>(0,r.jsxs)("div",{className:"flex w-full gap-x-3 py-2 md:h-full md:gap-x-0 md:overflow-hidden md:rounded-xl md:outline md:outline-1 md:outline-line md:py-0",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-y-2 py-3 md:p-4",children:[(0,r.jsx)(i.Od,{className:"h-5 w-3/4"}),(0,r.jsx)(i.Od,{className:"h-4 w-20"}),(0,r.jsx)(i.Od,{className:"h-4 w-full"}),(0,r.jsx)(i.Od,{className:"hidden h-4 w-2/3 lg:block"})]}),(0,r.jsx)(i.Od,{className:"aspect-square w-[120px] shrink-0 md:h-full md:w-auto",rounded:"lg"})]},e))})]},e))})}function z(){var e,t;let{categories:n,loading:i,isSplitMenu:g,priceGroups:v,selectedPriceGroupId:b}=(0,c.pC)(),y=(0,o.I0)(),j=(0,c.Ir)(),w=(0,c.OV)(),[C,k]=(0,l.useState)(null),[N,M]=(0,l.useState)(""),S=(0,o.v9)(e=>{var t;return null===(t=e.searchStore.currentSubsidiary)||void 0===t?void 0:t.menuId}),P=(0,u.Z)(N.trim(),800),T=(0,o.v9)(e=>{var t;let n=null===(t=e.menu)||void 0===t?void 0:t.searchResults;return Array.isArray(n)?n:[]}),E=(0,o.v9)(t=>{var n;return null!==(e=null===(n=t.menu)||void 0===n?void 0:n.searchResultsQuery)&&void 0!==e?e:null}),Z=(0,o.v9)(e=>{var n;return null!==(t=null===(n=e.menu)||void 0===n?void 0:n.searchRequestedQuery)&&void 0!==t?t:null}),I=(0,o.v9)(e=>e.menu.searchResultsLoading),V=(0,o.v9)(e=>e.menu.priceGroupMenusById),B=(0,o.v9)(e=>e.menu.menusByPriceGroupId),A=(0,o.v9)(e=>e.menu.loadingMenuByGroup);(0,l.useEffect)(()=>
1{if(!g||!S||P.length<2)return;let e=(E||"").trim(),t=(Z||"").trim();e!==P&&t!==P&&y(x.default.searchPrices(S,P))},[y,g,S,P,E,Z]);let O=(0,l.useMemo)(()=>{if(!g||P.length<2)return[];let e=(0,_.sg)(P);return v.filter(t=>(null==t?void 0:t.name)&&(0,_.sg)(t.name).includes(e)).map(e=>String(e.id))},[g,P,v]);(0,l.useEffect)(()=>{0!==O.length&&O.forEach(e=>{y(x.default.getPriceGroupMenu(e))})},[y,O]);let H=(0,l.useMemo)(()=>{if(0===O.length)return{loading:!1,categories:[]};let e=O.some(e=>{let t=V[e]||B[e];return!t||!0===A[e]});if(e)return{loading:!0,categories:[]};let t=O.flatMap(e=>{let t=V[e]||B[e];return Array.isArray(t)?t:[]});return{loading:!1,categories:(0,d.le)(t,w)}},[O,V,B,A,w]),{loading:D,categories:z}=H,G=g&&P.length>=2&&(I||(E||"").trim()!==P||D),q=(0,l.useRef)();(0,l.useEffect)(()=>{clearTimeout(q.current);let e=N.trim();return e.length>=2&&(q.current=setTimeout(()=>{a.ZP.gtag("event","search",{search_term:e})},500)),()=>clearTimeout(q.current)},[N]);let Q=(0,l.useMemo)(()=>{let e=(0,_.sg)(N.trim());return e?g?P.length<2?n:G?null:(0,_.Z7)({productResults:T,matchedCategories:z,productsLabel:s.ZP.t("V2Menu:searchResults",{defaultValue:"Resultados"})}):(0,_.gl)(n,N):n},[n,N,P,g,G,T,z]),Y=(0,l.useCallback)((e,t)=>{j.open(e,t),!g||(null==e?void 0:e.product)||y(x.default.getPrice(e.id))},[j,g,y]),F=(0,l.useRef)(!1),X=(0,l.useRef)(),J=(0,l.useCallback)(()=>{F.current=!1},[]),$=(0,l.useCallback)(e=>{let t=document.querySelector('[data-category-id="'.concat(e,'"]'));if(!t)return;k(e),F.current=!0,clearTimeout(X.current),X.current=setTimeout(J,800),"onscrollend"in window&&(window.removeEventListener("scrollend",J),window.addEventListener("scrollend",J,{once:!0}));let n=t.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:n,behavior:"smooth"})},[J]),ee=(0,l.useCallback)(e=>{F.current||k(e)},[]);(0,l.useEffect)(()=>()=>{clearTimeout(X.current),window.removeEventListener("scrollend",J)},[J]),(0,l.useEffect)(()=>{if(i||0===n.length)return;let e=window.location.hash.slice(1);if(!e)return;let t=document.getElementById(e);if(!t)return;let r=t.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:r,behavior:"smooth"})},[i,n.length]);let et=(0,f.OS)(),en=n.length;return(0,l.useEffect)(()=>{null==et||et.setCategories(n)},[en]),(0,l.useEffect)(()=>{null==et||et.setActiveCategoryId(C)},[C]),(0,l.useEffect)(()=>{null==et||et.setOnCategoryClick($)},[$]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L,{}),(0,r.jsx)(m.s,{}),g&&(0,r.jsx)(K,{priceGroups:v,selectedId:b}),(0,r.jsx)(h,{categories:n,activeCategoryId:C,onCategoryClick:$,searchQuery:N,onSearchChange:M}),(0,r.jsxs)("div",{className:"mt-6 flex gap-6 px-4 lg:px-6",children:[(0,r.jsx)(p,{categories:null!=Q?Q:n,activeCategoryId:C,onCategoryClick:$,searchQuery:N,onSearchChange:M}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(i||null===Q)&&(0,r.jsx)(W,{}),!i&&null!==Q&&0===Q.length&&(0,r.jsx)("div",{className:"flex flex-col items-center justify-center px-4 py-16 text-center",children:(0,r.jsx)("p",{className:"text-content-muted",children:N?s.ZP.t("V2Menu:noSearchResults",{query:N}):s.ZP.t("V2Menu:noProducts")})}),!i&&null!==Q&&Q.length>0&&(0,r.jsx)(U,{categories:Q,onProductClick:Y,onVisibleCategoryChange:ee})]})]}),(0,r.jsx)(R.e,{detail:j})]})}},15640:function(e,t,n){n.d(t,{Z7:function(){return l},gl:function(){return a},sg:function(){return r}});let r=e=>e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");function s(e){var t,n,r;return{priceId:e.id,productId:e.id,name:e.productName,description:"",price:null!==(t=e.price)&&void 0!==t?t:0,discountPrice:null!==(n=e.price)&&void 0!==n?n:0,hasDiscount:!1,hasOptions:(null!==(r=e.price)&&void 0!==r?r:0)===0,imageUrl:e.pictureUrl,hasModifiers:!1,disabled:!1,stock:!0,hidden:!1,foodTypes:[],label:null,labelType:null,rawPrice:e,stockStatus:{hasStock:!0,isAvailable:!0,reservable:!1,backToStockDate:null,availableOnDaysString:""}}}function l(e){let{productResults:t,matchedCategories:n,productsLabel:r}=e,l=new Set;n.forEach(e=>e.products.forEach(e=>l.add(e.priceId)));let a=t.filter(e=>!!(e&&e.id&&e.productName)).filter(e=>!l.has(e.id)).map(s),o=[...n];return a.length>0&&o.push({id:-1,name:r,slug:"search-results",products:a}),o}function a(e,t){let n=r(t.trim());return n?e.map(e=>r(e.name).includes(n)?e:{...e,products:e.products.filter(e=>r(e.name).includes(n)||e.description&&r(e.description).includes(n))}).filter(e=>e.products.length>0):e}}}]);
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.