1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5819],{355:e=>{e.exports={map:"stock-map-mobile-container_map__zNQKU",closeButton:"stock-map-mobile-container_closeButton__FoqLQ",closeButton__mobile:"stock-map-mobile-container_closeButton__mobile__H6Q4J",center:"stock-map-mobile-container_center__pScsb",zoom:"stock-map-mobile-container_zoom__w8Eux",zoomIn:"stock-map-mobile-container_zoomIn__J54hA",zoomOut:"stock-map-mobile-container_zoomOut__B0oKD",markerPopUp:"stock-map-mobile-container_markerPopUp__HKKFb",loggedIn:"stock-map-mobile-container_loggedIn__hmDkn"}},2356:e=>{e.exports={fullHeight:"stock-google-map-mobile_fullHeight__GXhDd",halfHeight:"stock-google-map-mobile_halfHeight__Ms26_",map:"stock-google-map-mobile_map__m7K2I",title:"stock-google-map-mobile_title__DJkA8"}},23119:(e,t,o)=>{"use strict";o.r(t),o.d(t,{__N_SSP:()=>ec,default:()=>ep,getProductId:()=>ed});var a=o(60004),i=o(10983),s=o(43207),r=o(7976),n=o(68915),l=o(58946),c=o(27945),d=o(20),p=o(10468),m=o(20655),u=o(76162),k=o(17480),_=o(23345),v=o(22951),g=o(89641),h=o.n(g),b=o(82726),x=o(44908),j=o(61688),f=o(62740),I=o(8280),y=o(45062),N=o(88088),S=o(35695),z=o(58590),C=o(45927),M=o(5185),$=o(86263),w=o(52322),A=o(82979),P=o(62184),B=o.n(P),O=o(60072);let E=({className:e,store:t,isSelected:o=!1,onClose:a})=>{let[i]=(0,s.B)(),{twelve_hours_notation:n}=(0,r.rD)(),l=(0,w.PK)(n),{isLockerOnly:c,hasLocalLocker:d,facility:p,seeOnMapHref:m,selectCtaLabel:u}=(0,C.k)(t),k=(0,w.e$)(t,l)||i("header.storesDrawer.open.closedToday"),_=(0,w.e$)(c?t:t.localLocker,l)||i("header.storesDrawer.open.closedToday"),{updateCartFacility:v}=(0,M.n)({facilityId:p?.facilityId,facilityName:p?.name}),{sendClickShopInThisStoreCtaGtmTag:g}=(0,z.UU)();return(0,O.jsxs)("div",{className:(0,S.A)(B().container,e),id:"gmap-popup","data-testid":"stock-map-marker-pop-up",children:[o&&(0,O.jsx)(y.v,{size:"m","data-testid":"map-marker-pop-up-is-selected",children:i("header.storesDrawer.selectedStore")}),a&&(0,O.jsx)(b.$,{variant:"ghost",icon:"cross",className:B().close,size:"s",onClick:a,floating:!0,"data-testid":"close-button",children:null}),(0,O.jsx)($.w,{className:B().title,variant:"underlined",href:(0,A.vP)(p),"data-testid":"map-marker-pop-up-title",children:(0,O.jsx)(N.E,{size:"body-3",children:t.name})}),(0,O.jsx)("div",{children:(0,O.jsx)(N.E,{size:"body-2","data-testid":"map-marker-pop-up-address",children:`${t.address.addressLine1}, ${t.address.postalCode} ${t.address.city}`})}),p?.openingHours&&(0,O.jsxs)("div",{className:B().open,children:[!c&&(0,O.jsxs)(N.E,{size:"body-1",color:"subtlest","data-testid":"map-marker-pop-up-store-open",children:[(0,O.jsx)("b",{children:i("header.storesDrawer.store")})," ",k]}),(c||d)&&(0,O.jsxs)(N.E,{size:"body-1",color:"subtlest","data-testid":"map-marker-pop-up-locker-open",children:[(0,O.jsx)("b",{children:i("header.storesDrawer.locker")})," ",_]})]}),(0,O.jsxs)("div",{className:B().actions,children:[(0,O.jsxs)("div",{className:B().icons,children:[p?.contactInfo?.phoneNumber&&(0,O.jsx)($.w,{variant:"ghost",icon:"phone",size:"s",href:`tel:${p?.contactInfo?.phoneNumber}`,"data-testid":"map-marker-pop-up-phone",title:i("store.call")}),(0,O.jsx)($.w,{variant:"ghost",icon:"direction",href:m,target:"_blank",size:"s","data-testid":"map-marker-pop-up-directions",title:i("store.directionTitle")})]}),(0,O.jsxs)("div",{className:B().links,children:[(0,O.jsx)($.w,{className:B().link,color:"secondary",href:(0,A.vP)(p),variant:"underlined","data-testid":"map-marker-pop-up-store-details",children:(0,O.jsx)(N.E,{size:"body-1",children:i("store.seeDetails")})}),!o&&(0,O.jsx)(b.$,{className:B().link,"data-testid":"map-marker-pop-up-shop-in-store",onClick:()=>{g(),v()},variant:"underlined","data-cs-capture":!0,children:(0,O.jsx)(N.E,{size:"body-1",children:i(u)})})]})]})]})};var D=o(73648),U=o.n(D);let H=({dataTestId:e,isSelected:t=!1,isActive:o=!1,value:a})=>{let i=Number(a);return(0,O.jsxs)("div",{className:U().container,"data-testid":e,children:[(0,O.jsx)("div",{className:(0,S.A)(U().bubble,o?U().active:Number.isNaN(i)?U().unknown:i>0?U().hasStock:U().noStock,{[U().selected]:t}),children:(0,O.jsx)(N.E,{size:t?"body-3":"body-1",children:a})}),(0,O.jsx)("div",{className:(0,S.A)(U().dot,o&&U().active)})]})},L=({store:e,defaultStore:t,activeStore:o,value:a})=>{let i=JSON.stringify({lat:e.location.latitude,lng:e.location.longitude})===JSON.stringify({lat:t?.location?.latitude,lng:t?.location?.longitude}),s=e.facilityId===o;return(0,O.jsx)(H,{isActive:s,isSelected:i,dataTestId:`marker-${i?"selected-":""}${s?"active-":""}${e?.facilityId}`,value:a})};var F=o(66051),R=o(31893),J=o(83948);let K=(e,t,o)=>{let a=t?.deliveryIndicator?.deliveryIndicators?.find(t=>t.facilityId===e);return a?.pickup?.quantity?.toString()||o},T=({advancedMarker:e})=>{let{googleMap:t,deliveryIndicators:o,stores:i,activeStore:r,setActiveStore:n,defaultStore:c,centerMarker:d}=(0,l.v)(),[p]=(0,s.B)(),m=(0,a.useCallback)(e=>{e?.facilityId!==r&&(n?.(e?.facilityId),d?.({lat:e.location.latitude,lng:e.location.longitude}))},[r]);return(0,a.useEffect)(()=>{i.length&&(0,F.j)([...i,c?.data],t)},[i]),(0,O.jsx)(O.Fragment,{children:i.map(a=>(0,O.jsxs)(R.J,{position:{lat:a.location.latitude,lng:a.location.longitude},map:t,advancedMarker:e,onClick:()=>m(a),children:[(0,O.jsx)(J.F,{showPopUp:r&&a?.facilityId===r,map:t,onClose:()=>n(null),children:(0,O.jsx)(E,{store:a,isSelected:c?.data?.facilityId===a?.facilityId})}),(0,O.jsx)(L,{store:a,defaultStore:c?.data,activeStore:r,value:K(a?.facilityId,o,p("stockMap.pinValueUnknown"))})]},`${a?.facilityId}-key`))})},Z=()=>{let{0:e,1:t}=(0,a.useState)(),{googleMap:o,setGoogleMap:i}=(0,l.v)();return(0,O.jsx)(I.R,{setGoogleMap:i,setAdvancedMarker:t,children:o&&(0,O.jsx)(T,{advancedMarker:e})})},V=({googleMap:e,stores:t,centerMarker:o,advancedMarker:i,activeStore:r,setActiveStore:n})=>{let{defaultStore:c,setIsMobileMarkerActive:d,deliveryIndicators:p}=(0,l.v)(),[m]=(0,s.B)();return(0,a.useEffect)(()=>{t.length&&(0,F.j)([...t,c?.data],e)},[t]),(0,O.jsx)(O.Fragment,{children:t.map(t=>(0,O.jsx)(R.J,{position:{lat:t.location.latitude,lng:t.location.longitude},map:e,advancedMarker:i,onClick:()=>{o?.({lat:t.location.latitude,lng:t.location.longitude}),n(t?.facilityId),d(!0)},children:(0,O.jsx)(L,{store:t,defaultStore:c?.data,activeStore:r,value:K(t?.facilityId,p,m("stockMap.pinValueUnknown"))})},`${t?.facilityId}-key`))})};var G=o(2356),X=o.n(G);let q=()=>{let{stores:e,googleMap:t,setGoogleMap:o,activeStore:i,setActiveStore:s,isMobileMarkerActive:r,centerMarker:n}=(0,l.v)(),{0:c,1:d}=(0,a.useState)();return(0,O.jsx)(I.R,{setGoogleMap:o,setAdvancedMarker:d,className:(0,S.A)(X().map,r?X().fullHeight:X().halfHeight),children:t&&(0,O.jsx)(V,{googleMap:t,stores:e,centerMarker:n,advancedMarker:c,activeStore:i,setActiveStore:s})})};var Q=o(68434),W=o.n(Q);let Y=({isMobile:e=!1})=>{let{google_maps_api_key:t}=(0,r.rD)();return(0,O.jsx)(j.Wrapper,{apiKey:t,render:()=>(0,O.jsx)("div",{className:W().loading,children:(0,O.jsx)(f.y,{size:"l","data-testid":"loading-map"})}),version:"beta",libraries:["places","marker"],children:e?(0,O.jsx)(q,{}):(0,O.jsx)(Z,{})})};var ee=o(26693),et=o.n(ee);let eo=()=>{let[e]=(0,s.B)(),{getCurrentPosition:t,zoomIn:o,zoomOut:a}=(0,l.v)(),{back:r}=(0,i.useRouter)();return(0,O.jsxs)("div",{className:et().map,children:[(0,O.jsx)(Y,{}),(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"cross",className:et().closeButton,onClick:r,floating:!0,"data-testid":"close-button",children:e("common.close")}),(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"cross",className:et().closeButton__mobile,onClick:r,floating:!0,"data-testid":"close-button-mobile",title:e("common.close"),rounded:!0}),(0,O.jsxs)("div",{className:et().zoom,children:[(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"plus",className:et().zoomIn,onClick:o,floating:!0,"data-testid":"zoom-in-button",title:e("storeMap.ariaLabel.zoomIn")}),(0,O.jsx)(x.c,{variant:"minor"}),(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"minus",className:et().zoomOut,onClick:a,floating:!0,"data-testid":"zoom-out-button",title:e("storeMap.ariaLabel.zoomOut")})]}),(0,O.jsx)(b.$,{icon:"location",title:e("storeMap.ariaLabel.location"),className:et().center,variant:"primary-inverse",floating:!0,onClick:()=>t(!0),"data-testid":"location-button"})]})};var ea=o(355),ei=o.n(ea);let es=({isActive:e,setIsActive:t})=>{let[o]=(0,s.B)(),{getCurrentPosition:r,zoomIn:c,zoomOut:d,stores:p,defaultStore:m,activeStore:u,setActiveStore:k,isMobileMarkerActive:_,setIsMobileMarkerActive:v}=(0,l.v)(),{back:g}=(0,i.useRouter)(),{isLoggedIn:h}=(0,n.Z2)(),j=(0,a.useMemo)(()=>p?.find(e=>e.facilityId===u),[p,u]);(0,a.useEffect)(()=>{t(_)},[_,t]);let f=(0,a.useCallback)(()=>{v(!1),k(null)},[k,v]);return(0,O.jsxs)("div",{className:ei().map,children:[(0,O.jsx)(Y,{isMobile:!0}),j&&(0,O.jsx)(E,{className:(0,S.A)(ei().markerPopUp,h&&ei().loggedIn),store:j,onClose:()=>k(null),isSelected:u===m?.data?.facilityId}),(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"cross",className:ei().closeButton,onClick:g,floating:!0,"data-testid":"close-button",children:o("common.close")}),e?(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"arrow-left",className:ei().closeButton__mobile,onClick:f,floating:!0,"data-testid":"back-button-mobile",title:o("common.back"),rounded:!0}):(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"cross",className:ei().closeButton__mobile,onClick:g,floating:!0,"data-testid":"close-button-mobile",title:o("common.close"),rounded:!0}),(0,O.jsxs)("div",{className:ei().zoom,children:[(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"plus",className:ei().zoomIn,onClick:c,floating:!0,"data-testid":"zoom-in-button",title:o("storeMap.ariaLabel.zoomIn")}),(0,O.jsx)(x.c,{variant:"minor"}),(0,O.jsx)(b.$,{variant:"primary-inverse",icon:"minus",className:ei().zoomOut,onClick:d,floating:!0,"data-testid":"zoom-out-button",title:o("storeMap.ariaLabel.zoomOut")})]}),(0,O.jsx)(b.$,{icon:"location",title:o("storeMap.ariaLabel.location"),className:ei().center,variant:"primary-inverse",floating:!0,onClick:()=>r(!0),"data-testid":"location-button"})]})},er=({isDesktop:e=!1,product:t})=>{let{0:o,1:i}=(0,a.useState)(!1),{0:s,1:r}=(0,a.useState)(!1),{centerMarker:n,getCurrentPosition:c,setActiveStore:d,defaultStore:p,stores:m,deliveryIndicators:g,nextResultSetCount:b,currentPage:x,isStockAvailableOnly:j,loading:f,setCurrentPage:I,getStoreStock:y,handleSearchAddress:N,setIsStockAvailableOnly:S,setCurrentProductId:z}=(0,l.v)(),C=t?.orderingDetail&&`${t?.orderingDetail?.quantitySteps} ${(0,u.Y8)(t?.orderingDetail?.contentUnit)}`;return(0,a.useEffect)(()=>{r(e)},[e]),(0,a.useEffect)(()=>{z(t?.productId)},[t]),(0,O.jsx)(k.Mg,{productDocList:[{productId:t?.productId}],productViewPage:v.WF.STOCK_LOCATOR,children:s?(0,O.jsxs)("div",{className:h().container,"data-testid":"stock-locator-page","data-cs-capture":!0,children:[(0,O.jsx)(eo,{}),(0,O.jsx)(_.F,{productId:t?.productId,productIdentifier:t?.identifier,productImageUrl:t?.productImage,stockIndicator:t?.identifier?.stockIndicator,unit:C,centerMarker:n,getCurrentPosition:c,setActiveStore:d,defaultStore:p,stores:m,deliveryIndicators:g,nextResultSetCount:b,currentPage:x,isStockAvailableOnly:j,loading:f,setCurrentPage:I,getStoreStock:y,handleSearchAddress:N,setIsStockAvailableOnly:S})]}):(0,O.jsxs)("div",{className:h().container,"data-testid":"stock-locator-page-mobile","data-cs-capture":!0,children:[(0,O.jsx)(es,{isActive:o,setIsActive:i}),!o&&(0,O.jsx)(_.F,{productId:t?.productId,productIdentifier:t?.identifier,productImageUrl:t?.productImage,stockIndicator:t?.identifier?.stockIndicator,centerMarker:n,getCurrentPosition:c,setActiveStore:d,defaultStore:p,stores:m,deliveryIndicators:g,nextResultSetCount:b,currentPage:x,isStockAvailableOnly:j,loading:f,setCurrentPage:I,getStoreStock:y,handleSearchAddress:N,setIsStockAvailableOnly:S,isFullHeight:!0})]})})};var en=o(36617),el=o(52035),ec=!0;let ed=e=>Array.isArray(e)?e[0]:e,ep=()=>{let[e]=(0,s.B)(),{isFlagEnabled:t}=(0,r.h)(),{query:o}=(0,i.useRouter)(),{isLoggedIn:a}=(0,n.Z2)(),u=d.U.up("md"),k=ed(o.id),{data:_,loading:v}=(0,en.Pd)({variables:{productId:k,withAssets:!0},skip:!a||!k}),g=_?.getProduct?.products[0],h=!g&&!v;return t(p.G6)&&a&&!h&&k?(0,O.jsx)(m.r,{title:`${e("stockLocator.title")}
1`,noPadding:!0,children:(0,O.jsx)(l.C,{fetchStoresHook:c.O,productId:k,children:(0,O.jsx)(er,{product:g,isDesktop:u})})}):(0,O.jsx)(el.default,{statusCode:404})}},26693:e=>{e.exports={map:"stock-map-container_map__R_7Jg",closeButton:"stock-map-container_closeButton__sh0hb",closeButton__mobile:"stock-map-container_closeButton__mobile__Cj6GH",center:"stock-map-container_center__y4KtD",zoom:"stock-map-container_zoom__PCoLo",zoomIn:"stock-map-container_zoomIn__ICVjM",zoomOut:"stock-map-container_zoomOut__PrGro"}},34085:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/stock-locator",function(){return o(23119)}])},62184:e=>{e.exports={container:"stock-marker-pop-up_container__ivZWP",title:"stock-marker-pop-up_title__fUJTV",open:"stock-marker-pop-up_open__vq7gI",close:"stock-marker-pop-up_close__wMlNp",actions:"stock-marker-pop-up_actions__xe1Ok",link:"stock-marker-pop-up_link__2rE1b",icons:"stock-marker-pop-up_icons__3rmEA",links:"stock-marker-pop-up_links__hHXFp",stock:"stock-marker-pop-up_stock___evrl"}},68434:e=>{e.exports={loading:"stock-map_loading__ZRVuW"}},73648:e=>{e.exports={container:"stock-marker_container__3v_1w",dot:"stock-marker_dot___ZenF",active:"stock-marker_active__9ZgnM",bubble:"stock-marker_bubble__xOZHf",hasStock:"stock-marker_hasStock__eU08Q",noStock:"stock-marker_noStock__X8R3Z",selected:"stock-marker_selected__N9B1i"}},89641:e=>{e.exports={container:"stock-locator-container_container__wVzpB"}}},e=>{e.O(0,[6617,4125,636,6593,8792],()=>e(e.s=34085)),_N_E=e.O()}]);
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.