1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2943],{2933:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var l=r(14232);function i(e,t){let r=(0,l.useRef)(t),i=(0,l.useRef)(!1);(0,l.useEffect)(()=>{r.current=t},[t]);let a=!!t;(0,l.useEffect)(()=>{let t=e.current;if(!t||!a||i.current)return;let l=null,o=new IntersectionObserver(e=>{let[t]=e;if((null==t?void 0:t.isIntersecting)&&t.intersectionRatio>=.5){if(l)return;l=setTimeout(()=>{var e;i.current||(i.current=!0,null==(e=r.current)||e.call(r),o.disconnect())},1e3)}else l&&(clearTimeout(l),l=null)},{threshold:[.5]});return o.observe(t),()=>{l&&clearTimeout(l),o.disconnect()}},[e,a])}},4113:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/flavors",function(){return r(79035)}])},6818:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(37876);let i=e=>(0,l.jsx)("svg",{width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,l.jsx)("path",{d:"M8.99916 16.1249C8.91083 16.1249 8.82246 16.1065 8.73996 16.069C8.46746 15.9449 2.05417 12.9707 1.02583 7.67405C0.628333 5.62489 1.0275 3.62571 2.09334 2.32737C2.95584 1.27571 4.1958 0.716528 5.67997 0.709028C5.68747 0.709028 5.69497 0.709028 5.70163 0.709028C7.39497 0.709028 8.42751 1.67322 8.99835 2.49405C9.57168 1.66989 10.6125 0.701528 12.3166 0.709028C13.8016 0.716528 15.0425 1.27571 15.9058 2.32737C16.97 3.62488 17.3683 5.62403 16.9699 7.67487C15.9433 12.9715 9.52913 15.9466 9.25663 16.0699C9.17579 16.1066 9.08749 16.1249 8.99916 16.1249ZM5.70082 1.95821C5.69582 1.95821 5.69168 1.95821 5.68668 1.95821C4.57168 1.96321 3.68837 2.35403 3.06003 3.11987C2.22753 4.13403 1.92668 5.74738 2.25335 7.43571C3.04918 11.539 7.82666 14.2057 8.99916 14.804C10.1717 14.2057 14.9492 11.539 15.7442 7.43571C16.0725 5.74655 15.7717 4.1332 14.9408 3.11987C14.3125 2.35487 13.4291 1.96486 12.3116 1.95903C12.3066 1.95903 12.3017 1.95903 12.2975 1.95903C10.3208 1.95903 9.62004 3.93988 9.59171 4.02405C9.50504 4.27655 9.26664 4.44819 8.99997 4.44819C8.99831 4.44819 8.99745 4.44819 8.99662 4.44819C8.72912 4.44736 8.4908 4.27654 8.4058 4.02237C8.3783 3.93904 7.67665 1.95821 5.70082 1.95821Z",fill:"currentColor"})})},79035:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSG:()=>z,default:()=>F});var l=r(37876),i=r(15039),a=r.n(i),o=r(89033),n=r(14232),s=r(626),c=r(66497),d=r(69936),u=r(89099),p=r(85426),h=r(20596),x=r(12099),f=r(86596),v=r(54587),m=r.n(v),g=r(48230),y=r.n(g),w=r(84702),_=r(6818),b=r(63318),C=r(94409),j=r(2933),N=r(74866);let k=(0,n.memo)(function(e){let{flavor:t,moduleName:r,trackingIndex:i,className:s,priority:c,titleAs:u="h3",onToggleFavorite:p,isFavorite:h=!1,favoritePending:x=!1,useFlavorColor:f=!1,onOrder:v,onViewed:g}=e,{t:k}=(0,o.Bd)(),{trackEvent:A}=(0,C.j)(),{trackSeoInteraction:I}=(0,b.Wx)(),P=(0,n.useRef)(null),{cookieId:z,slug:F,name:T,nameWithoutPartner:B,description:D}=t,E=T||B||"",M=t.newAerialImage||t.aerialImage,O="/profiles/".concat(F),R=f?t.backgroundColor:null,S=p?null:t.featuredPartnerLogo,L=(0,n.useMemo)(()=>g?()=>g(z):void 0,[g,z]);return(0,j.B)(P,L),(0,l.jsxs)("div",{ref:P,className:a()("group relative flex flex-col items-center gap-[10px]",s),children:[(0,l.jsxs)("div",{style:R?{backgroundColor:R}:void 0,className:a()("relative w-full rounded-[32px] p-[4px]",R?"border border-transparent":"border border-grey-5 bg-secondary-nilla-bean"),children:[(0,l.jsx)("div",{className:"relative aspect-square w-full overflow-hidden rounded-[20px]",children:M?(0,l.jsx)(m(),{src:M,width:520,height:520,priority:c,sizes:"(min-width: 1024px) 17vw, (min-width: 768px) 29vw, 45vw",alt:E||k("home:product_image"),className:"size-full object-cover"}):null}),S?(0,l.jsx)("div",{className:"pointer-events-none absolute right-[8px] top-[8px] h-[78px] w-[117px]",children:(0,l.jsx)(m(),{src:S,width:234,height:156,alt:t.featuredPartner||k("home:featured_partner_logo"),className:"size-full object-contain"})}):null,p?(0,l.jsx)("button",{type:"button","aria-pressed":h,"aria-label":k(h?"home:favorited":"home:add_to_favorites"),disabled:x,onClick:()=>p(z),className:a()("absolute right-[12px] top-[12px] z-10 flex size-9 items-center justify-center rounded-full","border border-grey-5 bg-white","transition-opacity disabled:opacity-50",N.PR),children:h?(0,l.jsx)(w.A,{className:"size-5"}):(0,l.jsx)(_.A,{className:"size-5"})}):null,v?(0,l.jsx)("div",{className:a()("absolute bottom-0 left-0 z-10 flex w-full p-[6px]","transition-opacity duration-200","lg:pointer-events-none lg:opacity-0","lg:group-hover:pointer-events-auto lg:group-hover:opacity-100","lg:group-focus-within:
1pointer-events-auto lg:group-focus-within:opacity-100"),children:(0,l.jsx)("button",{type:"button",onClick:()=>v(z),className:a()("flex min-h-[40px] flex-1 items-center justify-center rounded-full bg-black px-[25px] py-[12px]","text-white",N.PR),children:(0,l.jsx)(d.A,{variant:"lineItem",className:"whitespace-nowrap capitalize",children:k("home:order")})})}):null]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-[4px] text-center",children:[(0,l.jsx)(d.A,{as:u,variant:"title2",children:(0,l.jsx)(y(),{href:O,onClick:()=>{A("dessert_tapped",void 0,{index:i,dessert_id:z}),I("menu_profile_click",{module_name:r,dessert_id:z,dessert_slug:F,index:i,destination_path:O})},...N.yS,className:"after:absolute after:inset-0 after:content-['']",children:E})}),D?(0,l.jsx)(d.A,{variant:"body2",children:D}):null]})]})});function A(e){let{flavors:t,moduleName:r,priorityCount:i=5,indexOffset:o=0,className:n,titleAs:s,onToggleFavorite:c,isFavorite:d,isFavoritePending:u,useFlavorColor:p,onOrder:h,onViewed:x}=e,f=t.filter(e=>!!e.slug);return f.length?(0,l.jsx)("ul",{className:a()("grid list-none grid-cols-2 gap-x-4 gap-y-10 p-0","md:grid-cols-3 md:gap-x-6 lg:grid-cols-5 lg:gap-x-[39px] lg:gap-y-[78px]",n),children:f.map((e,t)=>(0,l.jsx)("li",{className:"[contain-intrinsic-size:auto_420px] [content-visibility:auto]",children:(0,l.jsx)(k,{flavor:e,moduleName:r,trackingIndex:o+t,priority:t<i,titleAs:s,onToggleFavorite:c,isFavorite:null==d?void 0:d(e.cookieId),favoritePending:null==u?void 0:u(e.cookieId),useFlavorColor:p,onOrder:h,onViewed:x})},e.cookieId))}):null}var I=r(55020);let P=e=>e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"").toLowerCase();var z=!0;function F(e){let{flavors:t}=e,{t:r}
1=(0,o.Bd)(),[i,v]=(0,n.useState)(""),{isFavorite:m,isPending:g,toggleFavorite:y}=(()=>{let e=(0,u.useRouter)(),t=(0,f.Y)(),{customer:r,openSignIn:l}=(0,p.L)(),i=null==r?void 0:r.userId,[a,o]=(0,n.useState)({}),[s,c]=(0,n.useState)([]),[d,v]=(0,n.useState)(i);d!==i&&(v(i),o({}),c([]));let{data:m,refetch:g}=(0,x.YT)(h.MMD,{skip:!i,fetchPolicy:"cache-and-network"}),[y]=(0,x.bO)(h.G0d),[w]=(0,x.bO)(h.btE),_=(0,n.useMemo)(()=>{var e,t,r;return new Set((null!=(r=null==m||null==(t=m.publicCookies)||null==(e=t.featuredFlavorDirectory)?void 0:e.flavors)?r:[]).filter(e=>!!e.notification).map(e=>e.cookieId))},[m]),b=(0,n.useCallback)(e=>{var t;return null!=(t=a[e])?t:_.has(e)},[a,_]),C=(0,n.useCallback)(e=>s.includes(e),[s]),j=(0,n.useCallback)(async r=>{if(t.medium(),!i)return void l({next:e.asPath});let a=!b(r);o(e=>({...e,[r]:a})),c(e=>[...e,r]);try{let e=a?y:w;await e({variables:{menuItemId:r}})}catch(e){console.error({error:e,msg:"Failed to update flavor favorite",cookieId:r}),o(e=>({...e,[r]:!a})),c(e=>e.filter(e=>e!==r));return}try{await g()}catch(e){console.error({error:e,msg:"Failed to refresh flavor favorites",cookieId:r})}finally{c(e=>e.filter(e=>e!==r))}},[y,t,b,l,g,w,e.asPath,i]);return{isFavorite:b,isPending:C,toggleFavorite:j}})(),w=(0,n.useDeferredValue)(i),_=(0,n.useMemo)(()=>((e,t)=>{let r=P(t).split(/\s+/).filter(Boolean);return r.length?e.filter(e=>{let t,l=P([(t=e).name,t.nameWithoutPartner,t.description].filter(Boolean).join(" "));return r.every(e=>l.includes(e))}):e})(t,w),[t,w]),b=(0,n.useCallback)(e=>{y(e)},[y]),C=t.length>0,j=!!w.trim();return(0,l.jsxs)("div",{className:a()("mx-auto flex w-full max-w-8xl flex-col gap-y-[30px] overflow-x-clip px-4 py-6","md:gap-y-[50px] md:px-[30px] md:py-[100px]"),children:[(0,l.jsxs)("div",{className:"flex flex-col gap-y-[10px] text-center",children:[(0,l.jsx)(d.A,{as:"h1",variant:"display3",children:r("home:flavor_directory_title")}),(0,l.jsx)(d.A,{variant:"body1",children:r("home:flavor_directory_subtitle")})]}),C?(0,l.jsxs)("div",{className:"flex flex-col items-center gap-y-[10px]",children:[(0,l.jsx)(c.A,{className:"max-w-[420px]",type:"search",label:r("home:flavor_directory_search_label"),value:i,onChange:e=>v(e.target.value),contentLeft:(0,l.jsx)(s.A,{className:"text-grey-20 relative size-5"})}),(0,l.jsx)("div",{"aria-live":"polite",className:"min-h-[20px]",children:j?(0,l.jsx)(d.A,{variant:"body2",children:r("home:flavor_directory_showing",{shown:_.length,total:t.length})}):null})]}):null,_.length?(0,l.jsx)(A,{flavors:_,moduleName:"flavor_directory",titleAs:"h2",onToggleFavorite:b,isFavorite:m,isFavoritePending:g}):(0,l.jsx)(d.A,{variant:"body1",className:"text-center",children:C?r("home:flavor_directory_no_results",{search:w.trim()}):r("home:flavor_directory_unavailable")})]})}let T=e=>{let{children:t,canonicalUrl:r,structuredData:i}=e,{t:a}=(0,o.Bd)("home");return(0,l.jsx)(I.A,{overrideOpenGraphTitle:a("home:flavor_directory_seo_title"),overrideOpenGraphDescription:a("home:flavor_directory_seo_description"),canonicalUrl:r,structuredData:i,seoPageType:"flavor_directory",children:t})};F.getLayout=(e,t)=>(0,l.jsx)(T,{canonicalUrl:null==t?void 0:t.canonicalUrl,structuredData:null==t?void 0:t.structuredData,children:e})},84702:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var l=r(37876);let i=e=>(0,l.jsx)("svg",{width:"16",height:"15",viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:(0,l.jsx)("path",{d:"M15.3584 6.55489C14.3809 11.5966 8.00008 14.5007 8.00008 14.5007C8.00008 14.5007 1.6192 11.5966 0.640871 6.55489C0.0408708 3.46155 1.35175 0.349864 4.68425 0.334031C7.16675 0.322364 8.00008 2.82401 8.00008 2.82401C8.00008 2.82401 8.83344 0.321531 11.3151 0.334031C14.6551 0.349864 15.9584 3.46239 15.3584 6.55489Z",fill:"currentColor"})})}},e=>{e.O(0,[4e3,9555,1221,5020,636,6593,8792],()=>e(e.s=4113)),_N_E=e.O()}]); 2//# sourceMappingURL=flavors-a72989009bada61e.js.map
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.