1"use strict";(self.webpackChunkFusion=self.webpackChunkFusion||[]).push([[98872],{17751:(e,t,i)=>{i.d(t,{A:()=>r});var o=i(79193),n=i(90417);const r=e=>{let{ref:t,scrollDelay:i,scrollIntoViewOptions:r={behavior:"smooth",block:"start"}}=e;return{scrollIntoView:(0,n.useCallback)((()=>{let e;const n=t?.current;if(n){if(o.A&&n){const t=n.getBoundingClientRect().top,l=o.A.innerHeight;t>=0&&t<=l||(i?e=setTimeout((()=>{n.scrollIntoView(r)}),i):n.scrollIntoView(r))}return()=>clearTimeout(e)}}),[t,i,r])}}},18876:(e,t,i)=>{i.d(t,{M:()=>s});var o=i(53518),n=i(41967),r=i(40014);const l=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",gap:t.sizing.scale300,marginTop:t.sizing.scale200}})),s=e=>{let{tags:t}=e;return t?(0,r.Y)(l,{children:t.map(((e,t)=>(0,r.Y)(o.A,{tag:e},`tag-${t}`)))}):null}},27985:(e,t,i)=>{i.d(t,{A:()=>r});var o=i(87731),n=i(77692);const r=e=>{const t=(0,o.A)();return(0,n.vv)(t,e.currencyCode,e.value,e.options)}},37556:(e,t,i)=>{i.d(t,{G:()=>Y,I:()=>v});var o=i(91443),n=i(41967),r=i(65714),l=i(73569),s=i(11862),a=i(61052),d=i(40014);const c=(0,n.I4)("div",{height:"100vh",position:"relative"}),u=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{margin:`${t.sizing.scale300} ${t.sizing.scale600} ${t.sizing.scale600} ${t.sizing.scale600}`,display:"flex",flexDirection:"column",gap:t.sizing.scale300}})),h=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{margin:`${t.sizing.scale800} ${t.sizing.scale600}`,display:"flex",flexDirection:"column",gap:t.sizing.scale300}})),p=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",flexDirection:"row",gap:t.sizing.scale300,overflow:"hidden"}})),g=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{border:`3px solid ${t.colors.borderOpaque}`,padding:t.sizing.scale600,borderRadius:t.borders.radius400,display:"flex",flexDirection:"column",gap:t.sizing.scale300}})),m=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",flexDirection:"column",gap:t.sizing.scale300}})),b=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{border:`3px solid ${t.colors.borderOpaque}`,padding:`${t.sizing.scale600} ${t.sizing.scale700}`,borderRadius:t.borders.radius400,display:"flex",gap:t.sizing.scale600,alignItems:"center"}})),f=(0,n.I4)("div",(e=>{let{$theme:t,$isSticky:i=!0}=e;return{boxShadow:i?t.shadows.floatingButton:"none",position:i?"absolute":"inherit",bottom:0,width:"100%"}})),x=(0,n.I4)("div",{display:"flex",flexDirection:"column",gap:"2px"}),y=(0,n.I4)("div",(e=>{let{$theme:t}=e;return{padding:`${t.sizing.scale500} ${t.sizing.scale600}`}})),S=()=>(0,d.FD)(g,{children:[(0,d.Y)(o.A,{height:"20px",width:"124px",animation:!0}),(0,d.Y)(o.A,{height:"20px",width:"124px",animation:!0})]}),w=()=>(0,d.FD)(b,{children:[(0,d.FD)(x,{children:[(0,d.Y)(o.A,{height:"20px",width:"72px",animation:!0}),(0,d.Y)(o.A,{height:"20px",width:"184px",animation:!0}),(0,d.Y)(o.A,{height:"20px",width:"167px",animation:!0}),(0,d.Y)(o.A,{height:"20px",width:"55px",animation:!0})]}),(0,d.Y)(o.A,{width:a.JN,height:a.oC,overrides:{Root:{style:{borderRadius:"50%"}}}})]}),v=e=>{let{showHeader:t=!1}=e;return(0,d.FD)(m,{children:[t?(0,d.Y)(o.A,{height:"28px",animation:!0}):null,(0,d.FD)(p,{children:[(0,d.Y)(w,{}),(0,d.Y)(w,{})]})]})},Y=()=>(0,d.FD)(c,{children:[(0,d.Y)(o.A,{height:"211px"}),(0,d.FD)(u,{children:[(0,d.Y)(o.A,{height:"24px",animation:!0}),(0,d.Y)(o.A,{height:"24px",width:"174px",animation:!0}),(0,d.Y)(o.A,{height:"24px",width:"58px",animation:!0})]}),(0,d.FD)(h,{children:[(0,d.Y)(o.A,{height:"28px",animation:!0}),(0,d.FD)(p,{children:[(0,d.Y)(S,{}),(0,d.Y)(S,{}),(0,d.Y)(S,{})]})]}),(0,d.Y)(y,{children:(0,d.Y)(v,{showHeader:!0})}),(0,d.Y)(f,{$isSticky:!1,children:(0,d.Y)(r.$n,{size:l.SK.large,disabled:!0,overrides:{BaseButton:{style:e=>{let{$theme:t}=e;return{margin:t.sizing.scale600,width:"calc(100% - 32px)"}}}},children:(0,d.Y)(s.H,{id:"shared.add_to_cart"})})})]})},42590:(e,t,i)=>{i.d(t,{A:()=>Fe});var o=i(90417),n=i(45292),r=i(91156),l=i(29328),s=i("__fusion__95b4ba69e5"),a=i(41967),d=i(2693),c=i(60331),u=i(43316),h=i(18876),p=i(40014);const g="48px",m=g,b=(0,a.I4)("div",(e=>{let{$theme:t,$selected:i,$width:o,$imagePosition:n}=e;return{height:"120px",boxSizing:"border-box",display:"grid",gridTemplateColumns:"left"===n?"auto 1fr":"1fr auto",columnGap:t.sizing.scale600,...o?{minWidth:`${o}`}:{},...o?{maxWidth:`${o}`}:{},justifyContent:"flex-start",alignItems:"center",padding:i?"16px":"17px",border:`${i?"3px":"2px"}
1 solid ${i?t.colors.borderSelected:t.colors.borderOpaque}`,borderRadius:"8px",cursor:"pointer",overflow:"hidden"}})),f=(0,a.I4)(u.A,(e=>{let{$theme:t}=e;return{flex:"0 0 auto",height:g,width:m,objectFit:"cover",border:`1px solid ${t.colors.borderOpaque}`,borderRadius:g}})),x=(0,a.I4)("div",{flex:"1 1 auto",display:"flex",flexDirection:"column",justifyContent:"center",overflow:"hidden"}),y=(0,a.I4)("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",overflow:"hidden"}),S=(0,a.I4)("div",(e=>{let{$couldHaveTwolines:t=!1}=e;return{flex:"1 1 165px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t?{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}:{}}})),w=(0,a.I4)("div",{flex:"0 0 auto",whiteSpace:"nowrap"}),v=o.forwardRef(((e,t)=>{let{storeWithProducts:i,selected:o,width:n,onClick:r,showPrice:l=!0}=e;const{storeUuid:s,leadingImageUrl:a,leadingTitle:u,trailingTitle:g,leadingLabel1:m,trailingLabel1:v,leadingLabel2:Y,tags:_}=i,$=0===_?.length,I=g?"left":"right";return(0,p.FD)(b,{ref:t,$selected:o,$width:n,$imagePosition:I,onClick:()=>r(s||""),"data-testid":"canonical-item-compact-store-selector-option",children:["left"===I?(0,p.Y)(f,{src:a||""}):null,(0,p.FD)(x,{children:[(0,p.FD)(y,{children:[l||o?(0,p.Y)(S,{$couldHaveTwolines:$,children:(0,p.Y)(c.Ay,{text:u,whiteSpace:$?"normal":"nowrap"})}):null,g&&(l||o)?(0,p.FD)(p.FK,{children:[(0,p.Y)(d.VX,{}),(0,p.Y)(w,{children:(0,p.Y)(c.Ay,{text:g})})]}):null]}),(0,p.FD)(y,{children:[m?(0,p.Y)(S,{$couldHaveTwolines:$,children:(0,p.Y)(c.Ay,{text:m,whiteSpace:$?"normal":"nowrap"})}):null,v?(0,p.FD)(p.FK,{children:[(0,p.Y)(d.VX,{}),(0,p.Y)(w,{children:(0,p.Y)(c.Ay,{text:v})})]}):null]}),(0,p.Y)(y,{children:Y?(0,p.Y)(S,{children:(0,p.Y)(c.Ay,{text:Y})}):null}),_?(0,p.Y)(y,{children:(0,p.Y)(h.M,{tags:_})}):null]}),"right"===I?(0,p.Y)(f,{src:a||""}):null]})}));v.displayName="CanonicalItemCompactStoreSelectorOption";const Y=v;var _=i(42378),$=i(31725),I=i(42076),C=i(58963),A=i(60082),k=i(93720),D=i(12424),P=i(45509),L=i(86457),F=i(70102),z=i(89831),U=i(57078),R=i(39332);const E=(0,a.I4)("div",(()=>({display:"flex",flexDirection:"column"})));(0,a.I4)("div",(e=>{let{$theme:t}=e;return{...t.typography.HeadingXSmall,color:t.colors.contentPrimary,whiteSpace:"pre-wrap"}})).displayName="StoreCountHeading";const M=(0,a.I4)("div",(e=>{let{$theme:t,$hasScrollControllers:i=!1}=e;return{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none","::-webkit-scrollbar":{display:"none"},...i&&{paddingLeft:t.sizing.scale800}}})),T=(0,a.I4)("a",(e=>{let{$theme:t}=e;return{...t.typography.LabelMedium,color:t.colors.contentPrimary,textDecoration:"none",textAlign:"center",cursor:"pointer",whiteSpace:"nowrap",display:"flex",flexDirection:"column",alignItems:"center",minWidth:t.sizing.scale2400,aspectRatio:"1:1"}}));T.displayName="ShowMore";const W=(0,a.I4)("div",(e=>{let{$theme:t}=e;return{marginBottom:t.sizing.scale300}})),B=(0,a.I4)("span",(e=>{let{$theme:t}=e;return{paddingTop:t.sizing.scale500}})),O=(0,a.I4)("div",{position:"relative"}),N=(0,a.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:t.sizing.scale100,marginBottom:t.sizing.scale600}})),H=(0,a.I4)("span",(e=>{let{$theme:t}=e;return{...t.typography.LabelMedium,color:t.colors.contentPrimary}})),q=(0,a.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:t.sizing.scale300,paddingRight:t.sizing.scale300,height:t.sizing.scale800,backgroundColor:t.colors.backgroundAccentLight,borderRadius:t.borders.radius200}})),j=(0,a.I4)("span",(e=>{let{$theme:t}=e;return{...t.typography.LabelSmall,color:t.colors.contentAccent}})),Q=e=>{let{defaultSelectedStoreUuid:t,storesWithProducts:i=[],isMobile:l,onSelectStore:a,onExpandList:d,expandListLabel:u,title:h,showHeader:g=!0,tooltip:m,isInCart:b=!1,showPrice:f=!0,isPdpCanonicalUIEnabled:x=!1}=e;const y=(0,r.Ay)(),S=(0,n.c)(),[w,v]=s.useState(null),{containerRef:Q,getPageProps:V,isPreviousPageDisabled:K,isNextPageDisabled:X,handlePageChange:G,lastPageRef:J}=(0,L.A)({scrollOffset:-228,thresholdRatio:x?.9:.5}),Z=(0,z.wA)(),ee=i.findIndex((e=>e.storeUuid===t));(0,F.A)({containerRef:Q,selectedIndex:ee,deps:[t]});const te=(0,$.A)("enable_canonical_pdp_split_cart_tooltip");(0,o.useEffect)((()=>{m&&te&&y("eats:split_cart_nudge_prompt_shown")}),[m,te,y]);const ie=(0,R.A)(v,200),oe=s.useMemo((()=>i.find((e=>e.tags?.some((e=>"FASTEST"===e.identifier))))),[i]),ne=s.useMemo((()=>
1{if(!oe?.leadingLabel2?.richTextElements)return null;const e=oe.leadingLabel2.richTextElements.find((e=>"text"===e.type&&"text"in e&&(e.text?.text?.text?.includes("min")||e.text?.text?.text?.match(/\d{1,2}:\d{2}\s*(AM|PM)/i))));return e&&"text"in e&&e.text?.text?.text?e.text.text.text.replace(/^\s*â¢\s*/,""):null}),[oe]),re={onMouseEnter:()=>{i.length>1&&ie(!0)},onMouseLeave:()=>{ie(!1)}};return 0===i.length?null:(0,p.FD)(E,{...x?{}:re,children:[x&&ne?(0,p.Y)(N,{children:(0,p.FD)(p.FK,{children:[(0,p.Y)(H,{children:S("canonical_item.store_selector.available_stores")}),(0,p.Y)(q,{children:(0,p.Y)(j,{children:S("canonical_item.store_selector.fastest_delivery",{time:ne})})})]})}):null,g&&!x?(0,p.Y)(W,{children:(0,p.Y)(c.Ay,{text:h})}):null,te&&!x&&m?(0,p.Y)(I.l,{kind:C.Nd.info,overrides:{Root:{style:e=>{let{$theme:t}=e;return{marginLeft:0,marginRight:0,backgroundColor:t.colors.backgroundSecondary}}}},children:(0,p.Y)(c.Ay,{text:m})}):null,(0,p.Y)("div",{children:(0,p.Y)(A.A,{isMobile:l,placement:l?k.El.topLeft:k.El.left,shouldShowTooltip:!b&&!x,children:(0,p.FD)(O,{children:[l?null:(0,p.Y)(P.e,{shouldShowControllers:x||w,handlePageChange:G,isPreviousPageDisabled:K,isNextPageDisabled:X,isPdpCanonicalUIEnabled:x}),(0,p.FD)(M,{ref:Q,$hasScrollControllers:!l&&!x,children:[i.map(((e,o)=>(0,p.Y)("div",{onClick:()=>{Z((0,U.Sc)(Q.current?.scrollLeft||0)),a(e,o)},...V(o,x&&d?i.length+1:i.length),children:(0,p.Y)(Y,{storeWithProducts:e,selected:e.storeUuid===t,onClick:D.A,width:1===i.length?"100%":"280px",showPrice:f})},e.storeUuid))),d?(0,p.Y)("div",{ref:x?J:void 0,children:(0,p.FD)(T,{onClick:d,role:"button",children:[(0,p.Y)(_.A,{}),(0,p.Y)(B,{children:u})]})}):null]})]})})})]})};Q.displayName="CanonicalItemHorizontalStoreSelector";const V=Q;var K=i(44580),X=i(17751),G=i(65714),J=i(73385),Z=i(57866),ee=i(86471);const te=(0,a.I4)("div",{display:"flex",flexDirection:"column"});(0,a.I4)("a",(e=>{let{$theme:t}=e;return{...t.typography.LabelMedium,color:t.colors.contentPrimary,textDecoration:"none",textAlign:"center",cursor:"pointer"}})).displayName="ShowMore";const ie=e=>{let{defaultSelectedStoreUuid:t,storesWithProducts:i=[],isMobile:n,onSelectStore:l,onExpandList:a,expandListLabel:d,title:u,showHeader:h=!0,tooltip:g,showPrice:m=!0}=e;const b=s.useRef(null),f=s.useRef(null),{scrollIntoView:x}=(0,X.A)({ref:b,scrollDelay:0,scrollIntoViewOptions:{behavior:"smooth",block:"center",inline:"center"}}),y=(0,r.Ay)(),{shouldShowTooltip:S}=(0,J.A)(),w=(0,$.A)("enable_canonical_pdp_split_cart_tooltip");return(0,o.useEffect)((()=>{g&&w&&y("eats:split_cart_nudge_prompt_shown")}),[g,w,y]),s.useEffect((()=>{f.current!==b.current&&(x(),f.current=b.current)}),[x]),0===i.length?null:(0,p.FD)(te,{"data-testid":ee.E.productDetailsStoreSelectorModalDialog,children:[h?(0,p.Y)(c.Ay,{text:u}):null,(0,p.Y)(K.Ay,{$height:8}),w&&g?(0,p.Y)(I.l,{kind:C.Nd.info,overrides:{Root:{style:e=>{let{$theme:t}=e;return{marginLeft:0,marginRight:0,backgroundColor:t.colors.backgroundSecondary}}}},children:(0,p.Y)(c.Ay,{text:g})}):null,i.map(((e,i)=>(0,p.FD)("div",{onClick:()=>l(e,i),children:[0===i?null:(0,p.Y)(K.Ay,{$height:8}),(0,p.Y)(Z.A,{condition:0===i&&S,wrapper:t=>(0,p.Y)(A.A,{placement:k.El.left,isMobile:n,children:t},`store-${e.storeUuid}`),children:(0,p.Y)(Y,{storeWithProducts:e,selected:e.storeUuid===t,onClick:D.A,ref:e.storeUuid===t?b:void 0,showPrice:m})},i)]},`store-${e.storeUuid}`))),a?(0,p.FD)(p.FK,{children:[(0,p.Y)(K.Ay,{$height:6}),(0,p.Y)(G.$n,{kind:G.Nd.monochromatic,onClick:a,children:d})]}):(0,p.Y)(K.Ay,{$height:4})]})};ie.displayName="CanonicalItemCompactStoreSelector";const oe=ie;var ne=i(11862),re=i(59782),le=i(1335),se=i(89846),ae=i(49720),de=i(23429),ce=i(46252),ue=i(12615);const he=e=>{let{storesWithProducts:t=[],defaultSelectedStoreUuid:i,onSelectStore:n,onExpandList:l,expandListLabel:s,onClose:a,title:d,showPrice:u=!0}=e;const[h,g]=o.useState(null);if(null===h){const e=t.some((e=>e.storeUuid===i))?i:t[0]?.storeUuid;e&&g(e)}const m=o.useCallback((e=>{e.storeUuid&&g(e.storeUuid)}),[]),b=(0,r.Ay)(),f=(0,ue.A)(),x=o.useCallback((()=>{const e=t.findIndex((e=>e.storeUuid===h)),i=t[e];i&&n(i,e),b("eats:canonical_product_details_merchant_selector_done_selection_click",{storeUuid:h??void 0,hasAddress:Boolean(f)}),b("eats:store_selector_select_store",{store_uuid:h??""}),a()}),[f,b,a,n,h,t]);return(0,p.FD)(re.aF,{onClose:a,children:[(0,p.Y)(le.rQ,{isExpanded:!0,leftButton:(0,p.Y)(se.J,{onClick:a}),title:(0,p.Y)(c.Ay,{text:d})}),(0,p.Y)(ae.c,{$removeMarginTop:!0,children:(0,p.Y)(oe,{isMobile:!1,storesWithProducts:t,maxStoresInitiallyDisplayed:t.length,defaultSelectedStoreUuid:h,showHeader:!1,onSelectStore:m,onExpandList:l,expandListLabel:s,title:d,showPrice:u})}),(0,p.Y)(de.j,{children:(0,p.Y)(ce.j,{onClick:x,children:(0,p.Y)(ne.H,{id:"shared.done"})})})]})};var pe=i(80452),ge=i(31300);const me=(0,a._F)(pe.dY,(e=>{let{$theme:t}=e;return{background:"white",padding:t.sizing.scale600,position:"sticky",top:0}})),be=(0,a.I4)("footer",(e=>{let{$theme:t}=e;return{background:"white",padding:t.sizing.scale600,position:"sticky",bottom:0,boxShadow:t.lighting.deepBelow}})),fe=e=>{let{storesWithProducts:t=[],defaultSelectedStoreUuid:i,onSelectStore:n,onExpandList:l,expandListLabel:s,onClose:a,title:d,showPrice:u=!0}=e;const[h,g]=o.useState(null);if(null===h){const e=t.some((e=>e.storeUuid===i))?i:t[0]?.storeUuid;e&&g(e)}const m=o.useCallback((e=>{e.storeUuid&&g(e.storeUuid)}),[]),b=(0,r.Ay)(),f=(0,ue.A)(),x=o.useCallback((()=>{const e=t.findIndex((e=>e.storeUuid===h)),i=t[e];i&&n(i,e),b("eats:canonical_product_details_merchant_selector_done_selection_click",{storeUuid:h??void 0,hasAddress:Boolean(f)}),b("eats:store_selector_select_store",{store_uuid:h??""}),a()}),[a,n,h,b,t,f]);return(0,p.FD)(pe.Xn,{onClose:a,children:[(0,p.Y)(me,{children:(0,p.Y)(c.Ay,{text:d})}),(0,p.Y)(pe.qo,{children:(0,p.Y)(oe,{isMobile:!0,storesWithProducts:t,maxStoresInitiallyDisplayed:t.length,defaultSelectedStoreUuid:h,onExpandList:l,expandListLabel:s,onSelectStore:m,showHeader:!1,title:d,showPrice:u})}),(0,p.Y)(be,{children:(0,p.Y)(ge.A,{onClick:x,children:(0,p.Y)(ne.H,{id:"shared.done"})})})]})};var xe=i(77644);const ye=(0,a.I4)(u.A,(e=>{let{$theme:t}=e;return{flex:"0 0 auto",height:"40px",width:"40px",objectFit:"cover",border:`1px solid ${t.colors.borderOpaque}`,borderRadius:"40px;"}})),Se=(0,a.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",alignItems:"center",gap:t.sizing.scale600,height:t.sizing.scale1200,justifyContent:"space-between",cursor:"pointer"}})),we=(0,a.I4)("div",(e=>{let{$theme:t}=e;return{width:"100%",display:"flex",flexDirection:"column",gap:t.sizing.scale100,overflow:"hidden",...t.typography.LabelMedium}})),ve=(0,a.I4)("p",(e=>{let{$theme:t}=e;return{color:t.colors.contentSecondary,...t.typography.ParagraphSmall}})),Ye=(0,a.I4)("p",(e=>{let{$theme:t}=e;return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t.typography.LabelMedium}})),_e=(0,a.I4)("div",{display:"flex"}),$e=(0,a.I4)(xe.A,(e=>{let{$theme:t}=e;return{color:t.colors.contentStateDisabled}})),Ie=e=>{let{selectedStore:t,onOpenPopup:i,hiddenStores:o}=e;const r=(0,n.c)(),l=`${o&&o>1?r("canonical_item.store_selector.compare_at_x_store",{count:o}):r("canonical_item.store_selector.compare_at_1_store")}`;return(0,p.FD)(Se,{onClick:i,"data-testid":ee.E.productDetailsStoreSelectorDropdownButton,children:[(0,p.Y)(ye,{src:t.leadingImageUrl||"","data-testid":ee.E.productDetailsStoreSelectorDropdownStoreLogo}),(0,p.FD)(we,{children:[(0,p.Y)(Ye,{"data-testid":ee.E.productDetailsStoreSelectorDropdownTitle,children:t.merchantName}),(0,p.Y)(ve,{children:o&&o>0?l:null})]}),(0,p.Y)(_e,{children:(0,p.Y)($e,{size:24})})]})};
1var Ce=i(81464),Ae=i(18768),ke=i(93617),De=i(84167);const Pe=[],Le=(e,t,i)=>{const o=e.findIndex((e=>e.storeUuid===t)),n=o>=0?e[o]:null;return o<i||!n?e.slice(0,i):[n,...e].slice(0,i)},Fe=e=>{let{expansionMode:t="show_more",displayType:i="vertical",title:s,...a}=e;const{storesWithProducts:d=Pe,maxStoresInitiallyDisplayed:c=3,showMoreIncrement:u=6,isMobile:h,productUuid:g,onSelectStore:m,onSelectStoreFromPopup:b,tooltip:f,defaultSelectedStoreUuid:x,isInCart:y=!1,setIsGoogleAdsExpeditedFlow:S,prevAddressedRef:w,isStoreSelectorModalOpen:v,setIsStoreSelectorModalOpen:Y}=a,_=(0,r.Ay)(),I=(0,n.c)(),{canonicalItemStoreUuid:C,setCanonicalItemStoreUuid:A,menuItem:k,isSwitchingStores:D,isCanonicalProduct:P}=(0,l.Wr)(),{isCanonicalPdp:L,isCanonicalPdpExpeditedFlow:F}=(0,Ae.A)(P),z="horizontal"===i&&(L||F),U=o.useMemo((()=>z&&0!==d.length?(e=>[...e].sort(((e,t)=>{const i=e.tags?.some((e=>"FASTEST"===e.identifier))??!1,o=t.tags?.some((e=>"FASTEST"===e.identifier))??!1;return i&&!o?-1:!i&&o?1:0})))(d):[...d]),[d,z]),R=o.useMemo((()=>x||(z&&U.length>0&&U[0]?.storeUuid||"")),[z,U,x]),E=o.useRef(!1);o.useEffect((()=>{F&&C&&(E.current=!0)}),[F,C]),o.useEffect((()=>{z&&!E.current&&R&&(E.current=!0,A(R))}),[z,R,A]);const[M,T]=o.useState(c),W=U.length-M,B=Math.min(W,u),O=o.useRef(0),[N,H]=o.useState(!1),q=v??N,j=Y??H,Q=(0,ue.A)(),K=(0,ke.Ss)(Q),X=(0,De.Fo)();o.useEffect((()=>{if(!F||D||!K)return;const e="true"===X.get("google_ads_expedited_flow");!K||w?.current&&!e||(w&&(w.current=!0),e&&(X.remove("google_ads_expedited_flow"),X.remove("google_ads_address_entry_source")),j(!0),S?.(!0),_("eats:store_selector_impression"))}),[D,F,K,S,j,w,X,_]);const G="show_more"===t?I("show_x_more",{count:B}):I("canonical_item.store_selector.see_all"),J=o.useMemo((()=>Le(U,C,M)),[C,M,U]),[Z,ee]=o.useState(J);J!==Z&&ee(J);const te=U.length===Z.length,ie=o.useCallback((e=>{const t=Le(U,e.storeUuid,M);ee(t)}),[U,M]),ne=o.useCallback(((e,t)=>{A(e.storeUuid),_("eats:merchant_selected_in_product_page",{productDetails:{canonicalPDP:{canonicalProductUuid:String(g||""),selectedMerchant:e,selectedMerchantIndex:t}}})}),[_,g,A]),re=o.useCallback(((e,t)=>{ne(e,t),ie(e)}),[ne,ie]),le=b??m??re,se=o.useCallback((()=>{const e=M+B,{title:t,uuid:i}=k?.data||{};O.current=O.current+1,T(e),_("eats:product_details_merchant_selector_see_more_clicked",{productDetails:{itemName:t,itemUuid:i,canonicalPDP:{numberOfMerchantsVisible:e,totalNumberOfMerchants:U.length,totalNumberOfClicks:O.current}}})}),[_,M,k?.data,B,U.length]),ae=o.useCallback((()=>{const e=U?.map((e=>e.storeUuid))?.filter(Boolean);_("eats:canonical_product_details_merchant_selector_expanded_click",{storeUuids:e,hasAddress:Boolean(Q)}),j(!0),S?.(!1)}),[U,_,Q,S,j]),de=o.useCallback((()=>j(!1)),[j]),ce="show_more"===t?se:ae,pe=o.useMemo((()=>U.find((e=>e.storeUuid===C))??U[0]),[C,U]),ge="horizontal"===i?V:oe,me=h?fe:he,be=!(0,$.A)("canonical_pdp_show_prices_on_merchant_selector")||y,xe=(0,Ce.A)({eventName:"eats:canonical_product_details_merchant_selector_impression",eventPayload:{storeUuid:pe?.storeUuid??void 0,hasAddress:Boolean(Q)}});return(0,p.FD)("span",{ref:xe,children:["dropdown"===i?pe?(0,p.Y)(Ie,{selectedStore:pe,hiddenStores:W,onOpenPopup:ae}):null:(0,p.Y)(ge,{...a,defaultSelectedStoreUuid:y?x:C,storesWithProducts:z?U:Z,onSelectStore:m??ne,onExpandList:te&&!z?null:ce,expandListLabel:te&&!z?null:G,title:s,tooltip:f,isInCart:y,showPrice:be,isPdpCanonicalUIEnabled:z}),q?(0,p.Y)(me,{...a,storesWithProducts:U,defaultSelectedStoreUuid:y?x:C,onSelectStore:le,onClose:de,title:s,showPrice:be}):null]})}},45509:(e,t,i)=>{i.d(t,{e:()=>p});var o=i("__fusion__95b4ba69e5"),n=i(42378),r=i(72929),l=i(39182),s=i(65714),a=i(73569),d=i(41967),c=i(40014);const u=(0,d.I4)("div",(e=>{let{$theme:t,$position:i}=e;return{position:"absolute",[i]:0,top:0,height:"100%",display:"flex",alignItems:"center",background:`linear-gradient(to ${"left"===i?"right":"left"}, ${t.colors.backgroundPrimary} 10%, rgba(255, 255, 255, 0) 90%)`,zIndex:l.IQ.cover,pointerEvents:"none",..."left"===i?{paddingRight:t.sizing.scale600}:{paddingLeft:t.sizing.scale600}}})),h=e=>{let{position:t,disabled:i,onClick:o,Icon:n,isPdpCanonicalUIEnabled:r,buttonOverrides:l,ariaLabel:d}=e;const h=(0,c.Y)(s.$n,{kind:r?s.Nd.secondary:s.Nd.tertiary,shape:a.IW.circle,size:a.SK.compact,disabled:i,"aria-label":d,overrides:{BaseButton:{style:e=>{let{$theme:i}=e;return l(t,i)}}},onClick:o,children:(0,c.Y)(n,{})});return r?(0,c.Y)(u,{$position:t,children:h}):h},p=e=>{let{shouldShowControllers:t=null,handlePageChange:i,isNextPageDisabled:s,isPreviousPageDisabled:a,isPdpCanonicalUIEnabled:d=!1}=e;const u=o.useCallback(((e,i)=>function(e,t,i,o,n){let r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const s="left"===e&&t||"right"===e&&i;return{...r?{pointerEvents:"all"}:{position:"absolute",[e]:n.sizing.scale400,top:n.sizing.scale1000,backgroundColor:n.colors.backgroundPrimary,boxShadow:n.shadows.floatingButton},zIndex:l.IQ.cover,opacity:o?s&&!r?0:1:0,...null===o||s&&!r?{}:{animationDuration:"0.3s",animationTimingFunction:"ease-in-out",animationName:{"0%":{opacity:o?0:1},"100%":{opacity:o?1:0}}}}}(e,a,s,t,i,d)),[s,a,t,d]);return(0,c.FD)(c.FK,{children:[!(d&&s)&&(0,c.Y)(h,{position:"right",onClick:()=>i("forward"),Icon:n.A,isPdpCanonicalUIEnabled:d,buttonOverrides:u,ariaLabel:"Scroll forward",disabled:!d&&s}),!(d&&a)&&(0,c.Y)(h,{position:"left",onClick:()=>i("back"),Icon:r.A,isPdpCanonicalUIEnabled:d,buttonOverrides:u,ariaLabel:"Scroll back",disabled:!d&&a})]})}},60082:(e,t,i)=>{i.d(t,{A:()=>g});var o=i(90417),n=i(54960),r=i(41967),l=i(2693),s=i(76614),a=i(11862),d=i(73385),c=i(40014);const u=(0,r.I4)("div",{flexDirection:"column",maxWidth:"328px",fontSize:"14px",fontWeight:"500",lineHeight:"16px"}),h=(0,r.I4)("div",{display:"flex",flexDirection:"column",justifyContent:"center"}),p=e=>{let{children:t,isMobile:i,placement:r,shouldShowTooltip:p=!0}=e;const{shouldShowTooltip:g}=(0,d.A)(),[m,b]=(0,o.useState)(p);(0,o.useEffect)((()=>{p&&b(g)}),[p,g]);const f=()=>{b(!1)};return(0,c.Y)(n.A,{isOpen:m,placement:r,returnFocus:!1,autoFocus:!1,onClickOutside:f,ignoreBoundary:!0,overrides:{Body:{style:e=>{let{$theme:t}=e;return{backgroundColor:t.colors.backgroundInversePrimary,outline:"none",borderTopLeftRadius:t.borders.radius300,borderTopRightRadius:t.borders.radius300,borderBottomRightRadius:t.borders.radius300,borderBottomLeftRadius:t.borders.radius300,maxWidth:i?"270px":"392px"}}},Arrow:{style:e=>{let{$theme:t}=e;return{backgroundColor:t.colors.backgroundInversePrimary}}},Inner:{style:e=>{let{$theme:t}=e;return{outline:"none",backgroundColor:t.colors.backgroundInversePrimary,color:t.colors.contentInversePrimary,borderTopLeftRadius:t.borders.radius300,borderTopRightRadius:t.borders.radius300,borderBottomRightRadius:t.borders.radius300,borderBottomLeftRadius:t.borders.radius300,display:"flex",flexDirection:"row",paddingLeft:t.sizing.scale600,paddingRight:t.sizing.scale600,paddingTop:t.sizing.scale600,paddingBottom:t.sizing.scale600}}}},showArrow:!0,content:()=>(0,c.FD)(c.FK,{children:[(0,c.Y)(u,{children:(0,c.Y)(a.H,{id:"storeSelector.tooltipText"})}),(0,c.Y)(l.Ay,{$width:"12px"}),(0,c.Y)(h,{children:(0,c.Y)(s.A,{onClick:f,iconSize:"15px"})})]}),children:t})};
1p.displayName="CanonicalItemStoreSelectorTooltip";const g=p},61052:(e,t,i)=>{i.d(t,{Ay:()=>y,JN:()=>c,oC:()=>u});var o=i(90417),n=i(2693),r=i(60331),l=i(43316),s=i(41967),a=i(18876),d=i(40014);const c="48px",u=c,h=(0,s.I4)("div",(e=>{let{$theme:t,$selected:i}=e;return{boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"16px",border:`3px solid ${i?t.colors.borderSelected:"transparent"}`,borderRadius:"8px",cursor:"pointer"}})),p=(0,s.I4)(l.A,(e=>{let{$theme:t}=e;return{flex:"0 0 auto",height:c,width:u,objectFit:"cover",border:`1px solid ${t.colors.borderOpaque}`,borderRadius:c}})),g=(0,s.I4)("div",{flex:"1 1 auto",display:"flex",flexDirection:"column",justifyContent:"center"}),m=(0,s.I4)("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"}),b=(0,s.I4)("div",{flex:"1 1 auto",textOverflow:"ellipsis",whiteSpace:"nowrap"}),f=(0,s.I4)("div",{flex:"0 0 auto",whiteSpace:"nowrap"}),x=(e,t)=>{const{storeWithProducts:i,selected:o,onClick:l}=e,{storeUuid:s,leadingImageUrl:c,leadingTitle:u,trailingTitle:x,leadingLabel1:y,leadingLabel2:S,leadingLabel3:w,trailingLabel1:v,tags:Y}=i;return(0,d.FD)(h,{$selected:o,onClick:()=>l(s||""),ref:t,"data-testid":"canonical-item-store-selector-option",children:[(0,d.Y)(p,{src:c||""}),(0,d.Y)(n.Wp,{}),(0,d.FD)(g,{children:[(0,d.FD)(m,{children:[(0,d.Y)(b,{children:(0,d.Y)(r.Ay,{text:u})}),x?(0,d.FD)(d.FK,{children:[(0,d.Y)(n.VX,{}),(0,d.Y)(f,{children:(0,d.Y)(r.Ay,{text:x})})]}):null]}),(0,d.FD)(m,{children:[y?(0,d.Y)(b,{children:(0,d.Y)(r.Ay,{text:y})}):null,v?(0,d.FD)(d.FK,{children:[(0,d.Y)(n.VX,{}),(0,d.Y)(f,{children:(0,d.Y)(r.Ay,{text:v})})]}):null]}),(0,d.Y)(m,{children:S?(0,d.Y)(b,{children:(0,d.Y)(r.Ay,{text:S})}):null}),(0,d.Y)(m,{children:w?(0,d.Y)(b,{children:(0,d.Y)(r.Ay,{text:w})}):null}),Y?(0,d.Y)(m,{children:(0,d.Y)(a.M,{tags:Y})}):null]})]})};x.displayName="CanonicalItemStoreSelectorOption";const y=o.forwardRef(x)},70102:(e,t,i)=>{i.d(t,{A:()=>s});var o=i(90417),n=i(41158);const r=function(e,t,i,o){const r=e.scrollLeft,l=t-r,s=performance.now(),a=t=>{const d=Math.min((t-s)/i,1);e.scrollLeft=r+l*o(d),d<1&&(0,n.A)(a)};(0,n.A)(a)};const l=function(e,t,i,o){return e=>{const i=1-e;return 3*i*i*e*t+3*i*e*e*o+e*e*e}}(0,1,0,1),s=e=>{let{containerRef:t,selectedIndex:i,childSelector:n,deps:s=[]}=e;(0,o.useLayoutEffect)((()=>{const e=t.current;if(e&&i>=0){const t=n?e.querySelector(n):e.children[i];if(t instanceof HTMLElement){const i=e.offsetWidth,o=t.offsetLeft,n=t.offsetWidth;r(e,o-i/2+n/2,500,l)}}}),[i,...s])}},73385:(e,t,i)=>{i.d(t,{A:()=>s});var o=i(90417),n=i(21499),r=i(41046),l=i(31725);const s=()=>{const e=(0,l.A)("canonical_product_store_selector_v2_enabled")?"uev2.store-selector-tooltip-v2":"uev2.store-selector-tooltip",[t,i]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const t=(0,n.bu)(e),o=(0,r.A)(t)||t.show;i(o),o&&setTimeout((()=>{(0,n.Vv)(e,{show:!1})}),300)}),[e]),{shouldShowTooltip:t}}},78103:(e,t,i)=>{i.d(t,{A:()=>z});var o=i("__fusion__95b4ba69e5"),n=i(90417),r=i(45292),l=i(41967),s=i(11873),a=i(24530),d=i(47916),c=i(7139),u=i(31725),h=i(17503),p=i(14337),g=i(35508),m=i(86668),b=i(63515),f=i(91156),x=i(40014);const y=e=>`${e}px`,S="100ms",w=36,v=y(w),Y=(e,t)=>!e||!t||t<w?w:t+8,_=(e,t)=>-(60-Y(e,t)/2),$=(0,l.I4)("div",(e=>{let{$theme:t,disabled:i,$isSecondary:o,$isClosed:n,$hasQuantity:r,$quantityWidth:l}=e;return{position:"relative",width:y(n?Y(r,l):120),height:y(36),transition:`width ${S} linear`,borderRadius:t.borders.pillButtonBorderRadius,overflow:"hidden",background:t.colors.buttonPrimaryFill,color:t.colors.buttonPrimaryText,cursor:"auto",...o&&{background:t.colors.buttonSecondaryFill,color:t.colors.buttonSecondaryText},...i&&{...(0,a.A)(t)}}})),I=(0,l.I4)("div",(e=>{let{$isClosed:t,$hasQuantity:i,$quantityWidth:o}=e;return{position:"absolute",right:i&&t?y(_(i,o)):0,transition:`right ${S} linear`,width:y(120),display:"flex",justifyContent:"space-between",alignItems:"center"}})),C=(0,l.I4)("button",(e=>{let{$theme:t,$isSecondary:i,$isClosed:o,$hasQuantity:n,$quantityWidth:r}=e;return{...(0,s.A)({$theme:t,radius:"pillButtonBorderRadius"}),width:v,minWidth:v,height:v,minHeight:v,padding:0,display:"flex",justifyContent:"center",alignItems:"center",background:"transparent","@media (hover: hover)":{":hover":{background:i?t.colors.buttonSecondaryHover:t.colors.contentTertiary}},":active":{background:i?t.colors.buttonSecondaryHover:t.colors.contentTertiary},":disabled":{color:t.colors.contentStateDisabled,fill:t.colors.disabled,background:"transparent"},...o&&{width:y(Y(n,r)),minWidth:y(Y(n,r)),height:y(w),minHeight:y(w),margin:0,...Boolean(r)&&{padding:"0 4px"}}}})),A=(0,l.I4)("div",(e=>{let{$theme:t}=e;return{position:"absolute",left:"50%",transform:"translateX(-50%)",...t.typography.LabelLarge,display:"flex",justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",textAlign:"center"}})),k=(0,l.I4)("div",(e=>{let{$theme:t}=e;return{...t.typography.LabelSmall,textWrap:"nowrap"}})),D=(0,l.I4)("div",(e=>{let{$theme:t}=e;return{display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:y(88),backgroundColor:t.colors.backgroundSecondary,borderRadius:t.sizing.scale700}})),P=e=>(0,x.Y)(b.A,{kind:"secondary",size:"compact",shape:"circle",onClick:e.onClick,overrides:{BaseButton:{style:e=>{let{$theme:t}=e;return{backgroundColor:t.colors.backgroundSecondary,":hover":{backgroundColor:t.colors.backgroundSecondary}}}}},...e,children:e.children}),L=e=>{const t=(0,r.c)();return(0,x.Y)(P,{disabled:e.isDisabled||e.getQuantityLimit()!==d.o.BELOW_LIMIT,onClick:e.onPlus,"aria-label":t("shared.increment"),"data-testid":"item-stepper-inc","data-test":"item-stepper-inc",children:(0,x.Y)(m.A,{name:"PlusSmallFilled",size:20})})},F=e=>{let{type:t="primary",isClosable:i=!1,isDisabled:s=!1,item:a,storeUuid:b,quantity:y,updateQuantity:S,isRemovable:w=!0,overrideQuantityConstraints:v,overridingMeasurementType:Y,analyticsLabel:_,isPdpCanonicalUIEnabled:F=!1}=e;const[,z]=(0,l.c6)(),U=g.R9.from(y),R=(0,d.A)({item:a,storeUuid:b,cartQuantity:U.toInt(),overrideQuantityConstraints:v}),E=(0,r.c)(),M="secondary"===t,T="primary"===t,W=(0,u.A)("price_items_by_weight")&&(0,c.dN)(a,Y),B=(0,c.ES)(a,v),O=W&&B.minimumQuantity||1,N=g.R9.from(y).lte(O),H=(0,f.Ay)(),q=o.useRef(!1),j=(0,n.useMemo)((()=>
1W?`${U.toFloat()} ${(0,c.$v)(a)||""}`:U.toFloat()),[U,W,a]);(0,n.useEffect)((()=>{q.current&&H("eats:item_quantity_update",{quantity:U.toFloat(),analyticsLabel:_}),q.current=!1}),[_,U,H]);const[Q,V]=(0,n.useState)(!1),K=i&&!Q,X=(0,n.useCallback)((()=>{S(p.n_.decrement),q.current=!0,i&&N&&V(!1)}),[i,N,S]),G=(0,n.useCallback)((()=>{i&&V(!0)}),[i]),J=(0,n.useCallback)((()=>{S(p.n_.increment),q.current=!0}),[S]),[Z,ee]=(0,n.useState)(0),te=(0,n.useRef)(null);(0,n.useEffect)((()=>{j&&te.current?.clientWidth&&ee(te.current.clientWidth)}),[j]);const ie=(0,n.useRef)(null);(0,h.A)(ie,(()=>{V(!1)}),i&&Q);const oe=s||(w?U.isLt(O):U.isLte(O));if(T&&!y)return(0,x.Y)(L,{isDisabled:s,getQuantityLimit:R,onPlus:J});if(M||T&&Boolean(y)){let e=s;return F&&(e||=U.isLte(1)),(0,x.FD)(D,{"data-test":"item-stepper",style:F?{borderRadius:z.sizing.scale900,width:"124px",height:"56px"}:void 0,children:[(0,x.Y)(P,{disabled:e,onClick:X,"aria-label":E("shared.decrement"),"data-test":"item-stepper-dec",children:U.isGt(O)||!w?(0,x.Y)(m.A,{name:"MinusSmallFilled",size:20}):N?(0,x.Y)(m.A,{name:"TrashCanOutlined",size:16}):null}),(0,x.Y)(k,{ref:te,"data-testid":"item-stepper-quantity",children:j}),(0,x.Y)(L,{isDisabled:s,getQuantityLimit:R,onPlus:J})]})}return(0,x.Y)($,{ref:ie,disabled:s,$isSecondary:M,$isClosed:K,$hasQuantity:Boolean(y),$quantityWidth:Z,"data-test":"item-stepper",children:(0,x.FD)(I,{$isClosed:K,$hasQuantity:Boolean(y),$quantityWidth:Z,children:[(0,x.Y)(C,{disabled:oe,$isSecondary:M,$isClosed:K,onClick:X,"aria-label":E("shared.decrement"),"data-test":"item-stepper-dec",children:U.isGt(O)||!w?(0,x.Y)(m.A,{name:"MinusSmallFilled",size:20}):N?(0,x.Y)(m.A,{name:"TrashCanFilled",size:16}):null}),(0,x.Y)(C,{disabled:s||R()!==d.o.BELOW_LIMIT,$isSecondary:M,$isClosed:K,onClick:J,"aria-label":E("shared.increment"),"data-test":"item-stepper-inc",children:(0,x.Y)(m.A,{name:"PlusSmallFilled",size:20})}),(0,x.Y)(A,{"data-testid":"item-stepper-quantity",children:K&&y?(0,x.Y)(C,{disabled:s,$isSecondary:M,$isClosed:K,$hasQuantity:Boolean(y),$quantityWidth:Z,onClick:G,children:(0,x.Y)("div",{ref:te,children:j})}):(0,x.Y)("div",{ref:te,children:j})})]})})},z=o.memo(F)}}]); 2//# sourceMappingURL=https://sourcemaps.uberinternal.com/raw/web-eats-v2/client-98872-ecc1ebbf64c449e9.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.