@shopgate/engage 7.23.11-beta.2 → 7.24.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/cart/components/CartItem/CartItemProductLayout.js +1 -1
  2. package/cart/components/CartItem/CartItemProductProvider.js +2 -2
  3. package/core/helpers/index.js +1 -1
  4. package/locations/action-creators/selectLocation.js +2 -1
  5. package/locations/actions/fetchLocations.js +1 -1
  6. package/locations/components/StockInfo/StockInfo.js +2 -2
  7. package/locations/components/StockInfo/StockInfoInventory.js +2 -2
  8. package/locations/components/StoreDetails/components/FindMoreStores.js +4 -0
  9. package/locations/components/StoreDetails/components/GetDirectionsButton.js +7 -0
  10. package/locations/components/StoreDetails/components/StoreDetails.js +5 -0
  11. package/locations/components/StoreDetails/components/StoreFinderMap.js +11 -0
  12. package/locations/components/StoreDetails/components/StoreFinderMap.style.js +1 -0
  13. package/locations/components/StoreDetails/components/StoreLocationMap.js +4 -0
  14. package/locations/components/StoreDetails/components/StoresNearby.js +4 -0
  15. package/locations/components/StoreDetails/components/StoresNearbyListItem.js +9 -0
  16. package/locations/components/StoreDetails/index.js +4 -0
  17. package/locations/components/StoreFinder/StoreFinder.js +3 -3
  18. package/locations/components/StoreFinder/StoreFinder.style.js +1 -2
  19. package/locations/components/StoreFinder/StoreFinderLocation.js +2 -2
  20. package/locations/components/StoreFinder/StoreFinderLocation.style.js +1 -1
  21. package/locations/components/StoreFinder/StoreFinderLocationHeader.js +2 -2
  22. package/locations/components/StoreFinder/StoreFinderLocationHeader.style.js +1 -1
  23. package/locations/components/StoreFinder/StoreFinderLocations.style.js +1 -2
  24. package/locations/components/StoreFinder/StoreFinderSearch.style.js +1 -1
  25. package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +2 -2
  26. package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +8 -0
  27. package/locations/components/StoreList/Store.style.js +1 -1
  28. package/locations/components/StoreList/StoreAddress.js +2 -2
  29. package/locations/components/StoreList/StoreAddressShort.js +1 -1
  30. package/locations/components/StoreList/StoreCard.js +2 -2
  31. package/locations/components/StoreList/StoreDistance.js +1 -1
  32. package/locations/components/StoreList/StoreSelectLocationButton.js +1 -1
  33. package/locations/components/index.js +1 -1
  34. package/locations/constants/index.js +3 -1
  35. package/locations/constants/routes.js +1 -1
  36. package/locations/locations.streams.js +1 -1
  37. package/locations/providers/StoreDetailsContext.js +1 -0
  38. package/locations/providers/StoreDetailsProvider.js +4 -0
  39. package/locations/providers/StoreFinderProvider.js +4 -4
  40. package/locations/providers/index.js +1 -1
  41. package/locations/selectors/index.js +7 -2
  42. package/locations/subscriptions.js +3 -3
  43. package/package.json +10 -10
  44. package/styles/reset/root.js +1 -2
  45. package/cart/components/CartItem/CartItemProductProviderLegacy.js +0 -22
  46. package/locations/components/StoreFinder/StoreFinderLocationDetailsWide.js +0 -3
  47. package/locations/components/StoreFinder/StoreFinderLocationDetailsWide.style.js +0 -1
  48. package/locations/components/StoreFinder/StoreFinderMap.js +0 -4
  49. package/locations/components/StoreFinder/StoreFinderMap.style.js +0 -2
  50. package/locations/components/StoreFinder/StoreFinderStoresNear.js +0 -3
  51. package/locations/components/StoreFinder/StoreFinderStoresNear.style.js +0 -1
@@ -3,4 +3,4 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
3
3
  * @returns {JSX}
4
4
  */export function CartItemProductLayout(){// Added with PWA 6 - CCP-2372
5
5
  var _useWidgetSettings=useWidgetSettings('@shopgate/engage/components/TaxDisclaimer'),show=_useWidgetSettings.show;// use widget setting if set to true/false, otherwise use market logic
6
- var showDisclaimer=typeof show==='boolean'?show:showTaxDisclaimer;var _useCartItem=useCartItem(),registerFulfillmentAction=_useCartItem.registerFulfillmentAction,isOrderDetails=_useCartItem.isOrderDetails,isCheckoutConfirmation=_useCartItem.isCheckoutConfirmation;var context=useCartItemProduct();var cartItem=context.cartItem,product=context.product,currency=context.currency,editMode=context.editMode,handleUpdate=context.handleUpdate,handleRemove=context.handleRemove,toggleEditMode=context.toggleEditMode,isEditable=context.isEditable;var portalProps=useMemo(function(){return _extends({context:{type:context.type,cartItemId:context.cartItemId,product:context.product}},context,{isOrderDetails:isOrderDetails,isCheckoutConfirmation:isCheckoutConfirmation,quantity:cartItem.quantity,handleDelete:handleRemove});},[cartItem.quantity,context,handleRemove,isCheckoutConfirmation,isOrderDetails]);var isActive=!isOrderDetails?true:getLineItemActiveStatus(cartItem===null||cartItem===void 0?void 0:cartItem.status,cartItem===null||cartItem===void 0?void 0:cartItem.subStatus);var showLineItemPromotions=useMemo(function(){if(isOrderDetails||isCheckoutConfirmation){return false;}return((cartItem===null||cartItem===void 0?void 0:cartItem.appliedPromotions)||[]).length>0;},[cartItem,isCheckoutConfirmation,isOrderDetails]);return React.createElement(React.Fragment,null,React.createElement(Grid,{className:classNames(styles.item,_defineProperty({},styles.itemInactive,!isActive))},React.createElement(Grid.Item,{className:styles.content,grow:1},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(TextLink,{href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_LINK,portalProps:portalProps},React.createElement(CartItemProductTitle,{value:product.name}))),React.createElement(Grid,{className:styles.info},React.createElement(Grid.Item,{grow:1,className:styles.properties},React.createElement(SurroundPortals,{portalName:CART_ITEM_PROPERTIES,portalProps:portalProps},React.createElement(ProductProperties,{properties:product.properties,lineClamp:2})),isOrderDetails&&React.createElement(CartItemProductOrderDetails,null)),React.createElement(Grid.Item,{grow:1,className:styles.price},isOrderDetails&&React.createElement(I18n.Text,{string:"cart.subtotal",className:styles.orderDetailsSubtotalLabel}),!showLineItemPromotions&&React.createElement(React.Fragment,null,React.createElement(CartItemProductPriceList,{isSubtotal:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo}))),showDisclaimer&&React.createElement(Grid.Item,{className:styles.disclaimerSpacer,grow:0,shrink:0})),showLineItemPromotions&&React.createElement(Grid,{className:classNames(styles.info,styles.promotionLine)},React.createElement(Grid.Item,null),React.createElement(Grid.Item,{className:styles.promotionLineItem},React.createElement(CartItemProductPriceList,{isSubtotal:true,showLabels:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(Grid.Item,{className:styles.leftColumn},React.createElement("div",{className:styles.image,"aria-hidden":true},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(Link,{tagName:"a",href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_IMAGE,portalProps:portalProps},React.createElement(ProductImage,{src:product.featuredImageBaseUrl||product.featuredImageUrl})))),!isOrderDetails&&React.createElement(SurroundPortals,{portalName:CART_ITEM_QUANTITY_PICKER,portalProps:portalProps},React.createElement(CartItemQuantityPicker,{unit:product.unit,hasCatchWeight:product.hasCatchWeight,quantity:cartItem.quantity,editMode:editMode,onChange:handleUpdate,onToggleEditMode:toggleEditMode,disabled:!isEditable})))),React.createElement(CartItemProductChangeLocation,{cartItem:cartItem,registerAction:registerFulfillmentAction}),React.createElement(CartChangeFulfillmentMethod,{cartItem:cartItem,registerAction:registerFulfillmentAction}));}
6
+ var showDisclaimer=typeof show==='boolean'?show:showTaxDisclaimer;var _useCartItem=useCartItem(),registerFulfillmentAction=_useCartItem.registerFulfillmentAction,isOrderDetails=_useCartItem.isOrderDetails,isCheckoutConfirmation=_useCartItem.isCheckoutConfirmation;var context=useCartItemProduct();var cartItem=context.cartItem,product=context.product,currency=context.currency,editMode=context.editMode,handleUpdate=context.handleUpdate,toggleEditMode=context.toggleEditMode,isEditable=context.isEditable;var portalProps=useMemo(function(){return _extends({},context,{isOrderDetails:isOrderDetails,isCheckoutConfirmation:isCheckoutConfirmation,quantity:cartItem.quantity});},[cartItem.quantity,context,isCheckoutConfirmation,isOrderDetails]);var isActive=!isOrderDetails?true:getLineItemActiveStatus(cartItem===null||cartItem===void 0?void 0:cartItem.status,cartItem===null||cartItem===void 0?void 0:cartItem.subStatus);var showLineItemPromotions=useMemo(function(){if(isOrderDetails||isCheckoutConfirmation){return false;}return((cartItem===null||cartItem===void 0?void 0:cartItem.appliedPromotions)||[]).length>0;},[cartItem,isCheckoutConfirmation,isOrderDetails]);return React.createElement(React.Fragment,null,React.createElement(Grid,{className:classNames(styles.item,_defineProperty({},styles.itemInactive,!isActive))},React.createElement(Grid.Item,{className:styles.content,grow:1},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(TextLink,{href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_LINK,portalProps:portalProps},React.createElement(CartItemProductTitle,{value:product.name}))),React.createElement(Grid,{className:styles.info},React.createElement(Grid.Item,{grow:1,className:styles.properties},React.createElement(SurroundPortals,{portalName:CART_ITEM_PROPERTIES,portalProps:portalProps},React.createElement(ProductProperties,{properties:product.properties,lineClamp:2})),isOrderDetails&&React.createElement(CartItemProductOrderDetails,null)),React.createElement(Grid.Item,{grow:1,className:styles.price},isOrderDetails&&React.createElement(I18n.Text,{string:"cart.subtotal",className:styles.orderDetailsSubtotalLabel}),!showLineItemPromotions&&React.createElement(React.Fragment,null,React.createElement(CartItemProductPriceList,{isSubtotal:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo}))),showDisclaimer&&React.createElement(Grid.Item,{className:styles.disclaimerSpacer,grow:0,shrink:0})),showLineItemPromotions&&React.createElement(Grid,{className:classNames(styles.info,styles.promotionLine)},React.createElement(Grid.Item,null),React.createElement(Grid.Item,{className:styles.promotionLineItem},React.createElement(CartItemProductPriceList,{isSubtotal:true,showLabels:true}),React.createElement(PriceInfo,{product:product,currency:currency,className:styles.priceInfo})))),React.createElement(Grid.Item,{className:styles.leftColumn},React.createElement("div",{className:styles.image,"aria-hidden":true},React.createElement(ConditionalWrapper,{condition:isEditable,wrapper:function wrapper(children){return React.createElement(Link,{tagName:"a",href:"".concat(ITEM_PATH,"/").concat(bin2hex(product.id))},children);}},React.createElement(SurroundPortals,{portalName:CART_ITEM_IMAGE,portalProps:portalProps},React.createElement(ProductImage,{src:product.featuredImageBaseUrl||product.featuredImageUrl})))),!isOrderDetails&&React.createElement(SurroundPortals,{portalName:CART_ITEM_QUANTITY_PICKER,portalProps:portalProps},React.createElement(CartItemQuantityPicker,{unit:product.unit,hasCatchWeight:product.hasCatchWeight,quantity:cartItem.quantity,editMode:editMode,onChange:handleUpdate,onToggleEditMode:toggleEditMode,disabled:!isEditable})))),React.createElement(CartItemProductChangeLocation,{cartItem:cartItem,registerAction:registerFulfillmentAction}),React.createElement(CartChangeFulfillmentMethod,{cartItem:cartItem,registerAction:registerFulfillmentAction}));}
@@ -1,4 +1,4 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useMemo,useCallback,useState,useRef}from'react';import{getAbsoluteHeight}from'@shopgate/pwa-common/helpers/dom';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{CART_ITEM_TYPE_PRODUCT}from'@shopgate/pwa-common-commerce/cart/constants';import{CART_INPUT_AUTO_SCROLL_DELAY}from"../../cart.constants";import Context from"./CartItemProductProvider.context";import connect from"./CartItemProductProvider.connector";import CartItemProductProviderLegacy from"./CartItemProductProviderLegacy";var variables=themeConfig.variables;/**
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useMemo,useCallback,useState,useRef}from'react';import{getAbsoluteHeight}from'@shopgate/pwa-common/helpers/dom';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{CART_ITEM_TYPE_PRODUCT}from'@shopgate/pwa-common-commerce/cart/constants';import{CART_INPUT_AUTO_SCROLL_DELAY}from"../../cart.constants";import Context from"./CartItemProductProvider.context";import connect from"./CartItemProductProvider.connector";var variables=themeConfig.variables;/**
2
2
  * The CartItemProduct Provider
3
3
  * @param {Object} props The component props.
4
4
  * @returns {JSX}
@@ -9,4 +9,4 @@ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimi
9
9
  *
10
10
  * This should not happen on iOS devices, since their web views behave different.
11
11
  */setTimeout(function(){var yOffset=-(window.innerHeight/2)+getAbsoluteHeight(cartItemRef.current)+variables.paymentBar.height;if(cartItemRef.current){cartItemRef.current.scrollIntoView({behavior:'smooth',yOffset:yOffset});}},CART_INPUT_AUTO_SCROLL_DELAY);}// Give the keyboard some time to slide out after blur, before further actions are taken.
12
- setTimeout(function(){if(onFocus){onFocus(isEnabled);}},isEnabled?300:0);setEditMode(isEnabled);},[isAndroid,onFocus]);var value=useMemo(function(){return{type:CART_ITEM_TYPE_PRODUCT,currency:currencyOverride||currency,product:product,messages:messages,handleRemove:handleRemove,handleUpdate:handleUpdate,cartItemRef:cartItemRef,toggleEditMode:toggleEditMode,editMode:editMode,isEditable:isEditable,cartItemId:id,cartItem:{id:id,product:product,status:status,subStatus:subStatus,quantity:quantity,orderedQuantity:orderedQuantity,fulfillment:fulfillment,unitPromoAmount:unitPromoAmount,unitDiscountAmount:unitDiscountAmount,price:price,promoAmount:promoAmount,discountAmount:discountAmount,extendedPrice:extendedPrice,appliedPromotions:appliedPromotions}};},[currency,currencyOverride,editMode,fulfillment,handleRemove,handleUpdate,id,isEditable,messages,product,status,subStatus,quantity,orderedQuantity,toggleEditMode,unitPromoAmount,unitDiscountAmount,price,promoAmount,discountAmount,extendedPrice,appliedPromotions]);return React.createElement(Context.Provider,{value:value},React.createElement(CartItemProductProviderLegacy,null,children));};CartItemProductProvider.defaultProps={children:null,isEditable:true,onFocus:function onFocus(){},currencyOverride:null};export default connect(CartItemProductProvider);
12
+ setTimeout(function(){if(onFocus){onFocus(isEnabled);}},isEnabled?300:0);setEditMode(isEnabled);},[isAndroid,onFocus]);var value=useMemo(function(){return{type:CART_ITEM_TYPE_PRODUCT,currency:currencyOverride||currency,product:product,messages:messages,handleRemove:handleRemove,handleUpdate:handleUpdate,cartItemRef:cartItemRef,toggleEditMode:toggleEditMode,editMode:editMode,isEditable:isEditable,cartItem:{id:id,product:product,status:status,subStatus:subStatus,quantity:quantity,orderedQuantity:orderedQuantity,fulfillment:fulfillment,unitPromoAmount:unitPromoAmount,unitDiscountAmount:unitDiscountAmount,price:price,promoAmount:promoAmount,discountAmount:discountAmount,extendedPrice:extendedPrice,appliedPromotions:appliedPromotions}};},[currency,currencyOverride,editMode,fulfillment,handleRemove,handleUpdate,id,isEditable,messages,product,status,subStatus,quantity,orderedQuantity,toggleEditMode,unitPromoAmount,unitDiscountAmount,price,promoAmount,discountAmount,extendedPrice,appliedPromotions]);return React.createElement(Context.Provider,{value:value},children);};CartItemProductProvider.defaultProps={children:null,isEditable:true,onFocus:function onFocus(){},currencyOverride:null};export default connect(CartItemProductProvider);
@@ -1,5 +1,5 @@
1
1
  /** @module core */import{getCurrentRoute as getCurrentRouteHelper,router,history,parseQueryStringToObject,parseObjectToQueryString}from'@shopgate/pwa-common/helpers/router';export*from"./environment";export*from"./appFeatures";export*from"./appPermissions";export*from"./baseUrl";export*from"./bridge";export{isBeta}from"../config/isBeta";export{getFullImageSource}from"./getFullImageSource";export{getImageFormat}from"./getImageFormat";export{i18n,getWeekDaysOrder}from"./i18n";export{updateLegacyNavigationBar}from"./updateLegacyNavigationBar";export{default as nl2br}from"./nl2br";export*from"./string";export{isIOSTheme}from"./isIOSTheme";export{isTouchDevice}from"./isTouchDevice";export{generateGoogleMapsDirectionsUrl}from"./googleMaps";export{useScrollContainer}from"./scrollContainer";export{getDeviceTypeForCms}from"./deviceType";export*from"./featureFlag";// --------------- CORE --------------- //
2
- export{logger,ajaxUrl,hasSGJavaScriptBridge,useBrowserConnector,hasWebBridgeCore,logDeprecationMessage}from'@shopgate/pwa-core/helpers';export{default as logGroup}from'@shopgate/pwa-core/helpers/logGroup';export*from'@shopgate/pwa-core/helpers/version';export*from'@shopgate/pwa-common/helpers/data';export*from'@shopgate/pwa-common/helpers/date';export*from'@shopgate/pwa-common/helpers/dom';export{env,isDev,isProd,isRemote,isStaging,isWindows}from'@shopgate/pwa-common/helpers/environment';export{default as decodeHTML}from'@shopgate/pwa-common/helpers/html/decodeHTML';export*from'@shopgate/pwa-common/helpers/html/handleDOM';export{default as parseHTML}from'@shopgate/pwa-common/helpers/html/parseHTML';export{default as getTranslator}from'@shopgate/pwa-common/helpers/i18n/getTranslator';export{default as getPriceFormatter}from'@shopgate/pwa-common/helpers/i18n/getPriceFormatter';export{default as getDateFormatter}from'@shopgate/pwa-common/helpers/i18n/getDateFormatter';export{default as getTimeFormatter}from'@shopgate/pwa-common/helpers/i18n/getTimeFormatter';export{default as getNumberFormatter}from'@shopgate/pwa-common/helpers/i18n/getNumberFormatter';export*from'@shopgate/pwa-common/helpers/legacy';// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature.
2
+ export{logger,ajaxUrl,hasSGJavaScriptBridge,useBrowserConnector,hasWebBridgeCore,logDeprecationMessage}from'@shopgate/pwa-core/helpers';export{default as logGroup}from'@shopgate/pwa-core/helpers/logGroup';export*from'@shopgate/pwa-core/helpers/version';export*from'@shopgate/pwa-common/helpers/data';export*from'@shopgate/pwa-common/helpers/date';export*from'@shopgate/pwa-common/helpers/dom';export{env,isDev,isProd,isRemote,isStaging}from'@shopgate/pwa-common/helpers/environment';export{default as decodeHTML}from'@shopgate/pwa-common/helpers/html/decodeHTML';export*from'@shopgate/pwa-common/helpers/html/handleDOM';export{default as parseHTML}from'@shopgate/pwa-common/helpers/html/parseHTML';export{default as getTranslator}from'@shopgate/pwa-common/helpers/i18n/getTranslator';export{default as getPriceFormatter}from'@shopgate/pwa-common/helpers/i18n/getPriceFormatter';export{default as getDateFormatter}from'@shopgate/pwa-common/helpers/i18n/getDateFormatter';export{default as getTimeFormatter}from'@shopgate/pwa-common/helpers/i18n/getTimeFormatter';export{default as getNumberFormatter}from'@shopgate/pwa-common/helpers/i18n/getNumberFormatter';export*from'@shopgate/pwa-common/helpers/legacy';// TODO: Can only be exported once the theme uses it. causes issues with the custom routes feature.
3
3
  /*
4
4
  export { default as portalCollection } from '@shopgate/pwa-common/helpers/portals/portalCollection';
5
5
  export { default as routePortals } from '@shopgate/pwa-common/helpers/portals/routePortals';
@@ -1,5 +1,6 @@
1
1
  import{SELECT_LOCATION}from"../constants";/**
2
2
  * Creates the dispatched SELECT_LOCATION action object.
3
3
  * @param {Object} location The location data to store for the use.
4
+ * @param {boolean} showToast Whether to show a toast message.
4
5
  * @returns {Object}
5
- */var selectLocation=function selectLocation(location){return{type:SELECT_LOCATION,location:location};};export default selectLocation;
6
+ */var selectLocation=function selectLocation(location,showToast){return{type:SELECT_LOCATION,location:location,showToast:showToast};};export default selectLocation;
@@ -16,4 +16,4 @@ import{logger}from'@shopgate/pwa-core/helpers';import PipelineRequest from'@shop
16
16
  * @param {boolean} [params.enableInLocationFinder=false] When set to `true` only locations are
17
17
  * returned which are enabled for the location finder.
18
18
  * @returns {Function} A redux thunk.
19
- */function fetchLocations(params){return function(dispatch){dispatch(requestLocations(params));var filters={countryCode:params.countryCode};if(params.geolocation){filters.longitude=params.geolocation.longitude;filters.latitude=params.geolocation.latitude;}if(params.postalCode){filters.postalCode=params.postalCode;}if(params.enableInLocationFinder){filters.enableInLocationFinder=params.enableInLocationFinder;}if(params.radius){filters.radius=params.radius;}if(params.codes){filters.codes=params.codes;}var request=new PipelineRequest(SHOPGATE_STOREFRONT_GET_LOCATIONS).setInput(filters).dispatch();request.then(function(result){dispatch(receiveLocations(filters,result.locations));})["catch"](function(error){logger.error(error);dispatch(errorLocations(params,error));});return request;};}/** @mixes {MutableFunction} */export default mutable(fetchLocations);
19
+ */function fetchLocations(params){return function(dispatch){dispatch(requestLocations(params));var filters={countryCode:params.countryCode};if(params.geolocation){filters.longitude=params.geolocation.longitude;filters.latitude=params.geolocation.latitude;}if(params.postalCode){filters.postalCode=params.postalCode;}if(params.enableInLocationFinder){filters.enableInLocationFinder=params.enableInLocationFinder;}if(params.radius){filters.radius=params.radius;}if(params.codes){filters.codes=params.codes;}if(params.limit){filters.limit=params.limit;}if(params.offset){filters.offset=params.offset;}var request=new PipelineRequest(SHOPGATE_STOREFRONT_GET_LOCATIONS).setInput(filters).dispatch();request.then(function(result){dispatch(receiveLocations(filters,result.locations));})["catch"](function(error){logger.error(error);dispatch(errorLocations(params,error));});return request;};}/** @mixes {MutableFunction} */export default mutable(fetchLocations);
@@ -1,8 +1,8 @@
1
- import*as React from'react';import{css}from'glamor';import{connect}from'react-redux';import classNames from'classnames';import defaultsDeep from'lodash/defaultsDeep';import{makeGetLocationInventory}from"../../selectors";import{getThemeSettings}from"../../../core";import{SurroundPortals}from"../../../components";import{PRODUCT_LOCATION_STOCK_INFO}from"../../constants";import{getAvailabilitySettings}from"../../helpers";import defaultSettings from"./StockInfo.defaultSettings";import{StockInfoInventory}from"./StockInfoInventory";/**
1
+ import*as React from'react';import{css}from'glamor';import{connect}from'react-redux';import classNames from'classnames';import defaultsDeep from'lodash/defaultsDeep';import PropTypes from'prop-types';import{makeGetLocationInventory}from"../../selectors";import{getThemeSettings}from"../../../core";import{SurroundPortals}from"../../../components";import{PRODUCT_LOCATION_STOCK_INFO}from"../../constants";import{getAvailabilitySettings}from"../../helpers";import defaultSettings from"./StockInfo.defaultSettings";import{StockInfoInventory}from"./StockInfoInventory";/**
2
2
  * Creates a mapper for redux.
3
3
  * @returns {Function}
4
4
  */var makeMapStateToProps=function makeMapStateToProps(){var getInventory=makeGetLocationInventory(function(_,props){var _props$location;return(_props$location=props.location)===null||_props$location===void 0?void 0:_props$location.code;},function(_,props){var _props$product;return props.productId||((_props$product=props.product)===null||_props$product===void 0?void 0:_props$product.id);});return function(state,props){return{inventory:getInventory(state,props)};};};/**
5
5
  * Renders visible stock information based on the given location.
6
6
  * @param {Object} props The component props.
7
7
  * @return {JSX}
8
- */var StockInfoUnwrapped=function StockInfoUnwrapped(_ref){var location=_ref.location,inventory=_ref.inventory,className=_ref.className;var _ref2=getThemeSettings('product')||{},locationStockInfo=_ref2.locationStockInfo;var settings=defaultsDeep(locationStockInfo,defaultSettings);var _getAvailabilitySetti=getAvailabilitySettings(settings,location,inventory),_getAvailabilitySetti2=_getAvailabilitySetti.availabilityText,availabilityText=_getAvailabilitySetti2===void 0?'':_getAvailabilitySetti2,_getAvailabilitySetti3=_getAvailabilitySetti.availabilityTextColor,availabilityTextColor=_getAvailabilitySetti3===void 0?'inherit':_getAvailabilitySetti3,_getAvailabilitySetti4=_getAvailabilitySetti.comingSoon,comingSoon=_getAvailabilitySetti4===void 0?false:_getAvailabilitySetti4;var defaultClassName=css({color:availabilityTextColor,fontSize:'0.75rem',margin:0,':not(:empty) ~ *':{marginLeft:14}}).toString();var portalProps=React.useMemo(function(){return{location:location,inventory:inventory,comingSoon:comingSoon,settings:settings,className:className,availabilityText:availabilityText,availabilityTextColor:availabilityTextColor};},[availabilityText,availabilityTextColor,className,comingSoon,inventory,location,settings]);return React.createElement(SurroundPortals,{portalName:PRODUCT_LOCATION_STOCK_INFO,portalProps:portalProps},React.createElement("span",{className:classNames(defaultClassName,css(className).toString())},React.createElement(StockInfoInventory,{availabilityText:availabilityText,comingSoon:comingSoon,location:location,inventory:inventory,maxNumberVisible:settings.maxNumberOfVisibleInventory,aboveMaxExtension:settings.aboveMaxExtension})));};StockInfoUnwrapped.defaultProps={className:null};export var StockInfo=connect(makeMapStateToProps)(StockInfoUnwrapped);
8
+ */var StockInfoUnwrapped=function StockInfoUnwrapped(_ref){var location=_ref.location,inventory=_ref.inventory,className=_ref.className;var _ref2=getThemeSettings('product')||{},locationStockInfo=_ref2.locationStockInfo;var settings=defaultsDeep(locationStockInfo,defaultSettings);var _getAvailabilitySetti=getAvailabilitySettings(settings,location,inventory),_getAvailabilitySetti2=_getAvailabilitySetti.availabilityText,availabilityText=_getAvailabilitySetti2===void 0?'':_getAvailabilitySetti2,_getAvailabilitySetti3=_getAvailabilitySetti.availabilityTextColor,availabilityTextColor=_getAvailabilitySetti3===void 0?'inherit':_getAvailabilitySetti3,_getAvailabilitySetti4=_getAvailabilitySetti.comingSoon,comingSoon=_getAvailabilitySetti4===void 0?false:_getAvailabilitySetti4;var defaultClassName=css({color:availabilityTextColor,fontSize:'0.75rem',margin:0,':not(:empty) ~ *':{marginLeft:14}}).toString();var portalProps=React.useMemo(function(){return{location:location,inventory:inventory,comingSoon:comingSoon,settings:settings,className:className,availabilityText:availabilityText,availabilityTextColor:availabilityTextColor};},[availabilityText,availabilityTextColor,className,comingSoon,inventory,location,settings]);return React.createElement(SurroundPortals,{portalName:PRODUCT_LOCATION_STOCK_INFO,portalProps:portalProps},React.createElement("span",{className:classNames(defaultClassName,css(className).toString())},React.createElement(StockInfoInventory,{availabilityText:availabilityText,comingSoon:comingSoon,location:location,inventory:inventory,maxNumberVisible:settings.maxNumberOfVisibleInventory,aboveMaxExtension:settings.aboveMaxExtension})));};StockInfoUnwrapped.defaultProps={className:null,inventory:null};export var StockInfo=connect(makeMapStateToProps)(StockInfoUnwrapped);
@@ -1,4 +1,4 @@
1
- import*as React from'react';import{I18n}from"../../../components";/**
1
+ import*as React from'react';import PropTypes from'prop-types';import{I18n}from"../../../components";/**
2
2
  * Renders the inventory given by the location into a given translation string.
3
3
  * @param {Object} props The component props.
4
4
  * @param {string} props.availabilityText The translation string to use.
@@ -6,4 +6,4 @@ import*as React from'react';import{I18n}from"../../../components";/**
6
6
  * @param {number|undefined} props.maxNumberVisible The component props.
7
7
  * @param {string} props.aboveMaxExtension The component props.
8
8
  * @return {JSX}
9
- */export function StockInfoInventory(props){var availabilityText=props.availabilityText,comingSoon=props.comingSoon,location=props.location,inventory=props.inventory,maxNumberVisible=props.maxNumberVisible,aboveMaxExtension=props.aboveMaxExtension;var visibleInventory=React.useMemo(function(){if(!location||!inventory){return null;}if(inventory.visible!==null&&inventory.visible>maxNumberVisible){return"".concat(maxNumberVisible).concat(aboveMaxExtension);}return inventory.visible;},[aboveMaxExtension,inventory,location,maxNumberVisible]);if((!location||!availabilityText||!inventory)&&!comingSoon){return null;}return React.createElement(I18n.Text,{string:availabilityText,params:{visibleInventory:visibleInventory}});}StockInfoInventory.defaultProps={comingSoon:false};
9
+ */export function StockInfoInventory(props){var availabilityText=props.availabilityText,comingSoon=props.comingSoon,location=props.location,inventory=props.inventory,maxNumberVisible=props.maxNumberVisible,aboveMaxExtension=props.aboveMaxExtension;var visibleInventory=React.useMemo(function(){if(!location||!inventory){return null;}if(inventory.visible!==null&&inventory.visible>maxNumberVisible){return"".concat(maxNumberVisible).concat(aboveMaxExtension);}return inventory.visible;},[aboveMaxExtension,inventory,location,maxNumberVisible]);if((!location||!availabilityText||!inventory)&&!comingSoon){return null;}return React.createElement(I18n.Text,{string:availabilityText,params:{visibleInventory:visibleInventory}});}StockInfoInventory.defaultProps={comingSoon:false,inventory:null};
@@ -0,0 +1,4 @@
1
+ import React from'react';import{css}from'glamor';import{i18n}from'@shopgate/engage/core/helpers';import{MagnifierIcon,LocatorIcon,Link}from'@shopgate/engage/components';import{themeColors}from'@shopgate/pwa-common/helpers/config';import classNames from'classnames';import{STORE_FINDER_PATTERN}from"../../../constants";var styles={container:css({margin:'16px 0px'}),title:css({fontSize:'20px',fontWeight:'500',color:'var(--color-primary)',marginBottom:'8px'}),inputCell:css({gridArea:'input'}),inputContainer:css({position:'relative',background:themeColors.light,border:"1px solid ".concat(themeColors.shade7),borderRadius:4,display:'flex',alignItems:'center',width:'100%'}),inputIcon:css({padding:0,margin:'0 8px',color:themeColors.shade9,fontSize:'1.23rem',flexShrink:0,outline:0}),input:css({margin:'3px 0',width:'100%',lineHeight:'28px',outline:'none',verticalAlign:'middle',WebkitAppearance:'none'}),inputOverlay:css({position:'absolute',height:'100%',width:'100%'})};/**
2
+ * Find more stores component.
3
+ * @returns {JSX}
4
+ * */var FindMoreStores=function FindMoreStores(){return React.createElement("div",{className:styles.container},React.createElement("div",{className:styles.title},i18n.text('location.findMoreStores')),React.createElement("div",{className:styles.inputCell},React.createElement("div",{className:styles.inputContainer},React.createElement("span",{className:styles.inputIcon,"aria-hidden":true},React.createElement(MagnifierIcon,null)),React.createElement("input",{name:"postalCode",className:styles.input,disabled:true,type:"search",autoComplete:"off",autoCorrect:"off",placeholder:""}),React.createElement("div",{className:styles.inputIcon},React.createElement(LocatorIcon,null)),React.createElement(Link,{href:STORE_FINDER_PATTERN,className:classNames(styles.inputOverlay)},React.createElement("div",null)))));};export default FindMoreStores;
@@ -0,0 +1,7 @@
1
+ import React,{useMemo}from'react';import{css}from'glamor';import{historyPush}from'@shopgate/pwa-common/actions/router';import PropTypes from'prop-types';import{Button}from'@shopgate/engage/components';import{generateGoogleMapsDirectionsUrl,i18n}from'@shopgate/engage/core';import{useDispatch}from'react-redux';var styles={container:css({}),buttonText:css({color:'var(--color-primary)'})};/**
2
+ * @param {Object} props The component props
3
+ * @param {Object} props.address The address object.
4
+ * @returns {JSX}
5
+ */var GetDirectionsButton=function GetDirectionsButton(_ref){var address=_ref.address;var dispatch=useDispatch();var url=useMemo(function(){return address&&generateGoogleMapsDirectionsUrl(address);},[address]);/**
6
+ * Handles the button click.
7
+ */var handleClick=function handleClick(){dispatch(historyPush({pathname:url,state:{target:'_blank'}}));};return React.createElement("div",{className:styles.container},React.createElement(Button,{onClick:handleClick,role:"button",type:"plain"},React.createElement("span",{className:styles.buttonText},i18n.text('location.getDirections'))));};GetDirectionsButton.defaultProps={address:null};export default GetDirectionsButton;
@@ -0,0 +1,5 @@
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{useContext,useMemo}from'react';import{css}from'glamor';import{LocationIcon,Button,Link,ConditionalWrapper}from'@shopgate/engage/components';import{getWeekDaysOrder}from'@shopgate/engage/core';import{i18n}from'@shopgate/engage/core/helpers';import classNames from'classnames';import moment from'moment';import{StoreDetailsContext}from"../../../providers/StoreDetailsContext";import GetDirectionsButton from"./GetDirectionsButton";var styles={headerWrapper:css({display:'flex'}),headerIcon:css({color:'var(--color-primary)',fontSize:20,alignContent:'center',marginRight:4}),header:css({color:'var(--color-primary)',fontWeight:'600',fontSize:20}),locationName:css({fontSize:20,fontWeight:'600',marginBottom:8}),locationRow:css({display:'flex',gap:8,flexWrap:'wrap'}),locationColumn:css({flex:1,minWidth:'200px'}),storeHoursColumn:css({flex:1,minWidth:'250px',maxWidth:'400px'}),storeHours:css({fontSize:17,fontWeight:'600'}),storeHoursLine:css({display:'flex',flexDirection:'row',justifyContent:'space-between'}),storeHoursWeekday:css({textAlign:'left'}),bold:css({fontWeight:'600'}),storeHoursOpeningTime:css({textAlign:'right'}),phone:css({fontSize:17,fontWeight:'600'}),phoneNumber:css({textDecoration:'underline'}),makeMyStoreButton:css({color:'var(--color-primary)'}),comingSoon:css({fontStyle:'italic'}),buttonRow:css({display:'flex',alignItems:'center',gap:'8px 30px',flexWrap:'wrap',margin:'8px 0'})};/**
2
+ * Store details component.
3
+ * @returns {JSX}
4
+ */var StoreDetails=function StoreDetails(){var _useContext=useContext(StoreDetailsContext),selectLocation=_useContext.selectLocation,routeLocation=_useContext.routeLocation,isRouteLocationPreferred=_useContext.isRouteLocationPreferred;var _ref=routeLocation||{},_ref$address=_ref.address,address=_ref$address===void 0?{}:_ref$address,_ref$operationHours=_ref.operationHours,operationHours=_ref$operationHours===void 0?{}:_ref$operationHours,isComingSoon=_ref.isComingSoon;var currentDay=moment().format('ddd').toLowerCase();// Check if there are any opening hours to hide the section if not
5
+ var hasOpeningHours=useMemo(function(){return Object.keys(operationHours).length>0&&Object.values(operationHours).some(function(value){return value&&typeof value==='string'&&value.length>0;});},[operationHours]);if(!routeLocation){return null;}return React.createElement("div",null,React.createElement(ConditionalWrapper,{condition:!isRouteLocationPreferred,wrapper:function wrapper(children){return React.createElement(Button,{onClick:function onClick(){return selectLocation(routeLocation,true);},role:"button",type:"plain"},children);}},React.createElement("div",{className:styles.headerWrapper},React.createElement("div",{className:styles.headerIcon},React.createElement(LocationIcon,{className:styles.icon,size:20})),React.createElement("div",{className:styles.header},isRouteLocationPreferred?i18n.text('location.myStore'):i18n.text('location.makeMyStore')))),React.createElement("div",{className:styles.locationName},routeLocation.name),React.createElement("div",{className:styles.locationRow},React.createElement("div",{className:styles.locationColumn},React.createElement("div",null,address===null||address===void 0?void 0:address.street),(address===null||address===void 0?void 0:address.street2)&&address.street2!==''&&React.createElement("div",null,address.street2),(address===null||address===void 0?void 0:address.street3)&&address.street3!==''&&React.createElement("div",null,address.street3),(address===null||address===void 0?void 0:address.street4)&&address.street4!==''&&React.createElement("div",null,address.street4),React.createElement("div",null,i18n.text('locations.address',address)),React.createElement("div",{className:styles.buttonRow},React.createElement(GetDirectionsButton,{address:address}),!isComingSoon&&!isRouteLocationPreferred&&React.createElement(Button,{onClick:function onClick(){return selectLocation(routeLocation,true);},role:"button",type:"plain",className:classNames(styles.makeMyStoreButton)},React.createElement("span",null,i18n.text('location.makeMyStore'))),isComingSoon&&React.createElement("div",{className:styles.comingSoon},i18n.text('location.comingSoon'))),(address===null||address===void 0?void 0:address.phoneNumber)&&React.createElement(React.Fragment,null,React.createElement("div",{className:styles.phone},"".concat(i18n.text('location.phone'),": ")),React.createElement("div",{className:styles.phoneNumber},React.createElement(Link,{href:"tel:".concat(address.phoneNumber),className:classNames(styles.phoneNumber),target:"_blank"},address.phoneNumber)))),hasOpeningHours&&React.createElement("div",{className:styles.storeHoursColumn},React.createElement("div",{className:styles.storeHours},"".concat(i18n.text('location.storeHours'),":")),getWeekDaysOrder().map(function(weekDay){if(!operationHours[weekDay]){return null;}return React.createElement("div",{className:styles.storeHoursLine,key:weekDay},React.createElement("div",{className:classNames(styles.storeHoursWeekday,_defineProperty({},styles.bold,weekDay===currentDay))},"".concat(i18n.text("locations.".concat(weekDay)),":")),React.createElement("div",{className:classNames(styles.storeHoursOpeningTime,_defineProperty({},styles.bold,weekDay===currentDay))},operationHours[weekDay]));}))));};export default StoreDetails;
@@ -0,0 +1,11 @@
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useCallback,useMemo,useContext}from'react';import{Circle,MapContainer,Marker,TileLayer}from'react-leaflet';import{GestureHandling}from'leaflet-gesture-handling';import"../../../assets/leaflet.css";import'leaflet-gesture-handling/dist/leaflet-gesture-handling.css';import Leaflet from'leaflet';import{renderToString}from'react-dom/server';import MapMarkerIcon from'@shopgate/pwa-ui-shared/icons/MapMarkerIcon';import{container,markerSelected}from"./StoreFinderMap.style";import{MAP_RADIUS_KM}from"../../../constants";import{StoreDetailsContext}from"../../../providers/StoreDetailsContext";Leaflet.Map.addInitHook('addHandler','gestureHandling',GestureHandling);/**
2
+ * @returns {JSX.Element}
3
+ */var StoreFinderMap=function StoreFinderMap(){var _useContext=useContext(StoreDetailsContext),routeLocation=_useContext.routeLocation;var iconHTML=useMemo(function(){return renderToString(React.createElement(MapMarkerIcon,null));},[]);var markerIconSelected=useMemo(function(){return Leaflet.divIcon({html:iconHTML,className:markerSelected,iconSize:[40,40]});},[iconHTML]);var _ref=routeLocation||{},code=_ref.code,latitude=_ref.latitude,longitude=_ref.longitude;var viewport=useMemo(function(){if(!latitude||!longitude){return null;}return[latitude,longitude];},[latitude,longitude]);/**
4
+ * Enables touch and gestures on the map
5
+ * @param {Object} map available parameters for the map
6
+ */var handleMapCreated=function handleMapCreated(map){map.gestureHandling.enable();if(Leaflet.Browser.mobile){map.touchZoom.enable();}};/**
7
+ * Creates coordinates for a bounding box around a center point
8
+ * @param {Array} center The center point
9
+ * @param {number} distanceInMeter The distance in meters
10
+ * @returns {Array} The bounds
11
+ */var createBounds=useCallback(function(_ref2,distanceInMeter){var _ref3=_slicedToArray(_ref2,2),lat=_ref3[0],lng=_ref3[1];var EARTH_RADIUS_KM=6371;var distanceInKm=distanceInMeter/1000;var distanceToBoundaryInKm=distanceInKm/2;var latInRadians=lat*(Math.PI/180);var deltaLat=distanceToBoundaryInKm/EARTH_RADIUS_KM*(180/Math.PI);var deltaLng=distanceToBoundaryInKm/EARTH_RADIUS_KM*(180/Math.PI)/Math.cos(latInRadians);return[[lat-deltaLat,lng-deltaLng],[lat+deltaLat,lng+deltaLng]];},[]);var radiusinMeters=MAP_RADIUS_KM*1000;var bounds=useMemo(function(){if(!viewport||!MAP_RADIUS_KM){return null;}return createBounds(viewport,radiusinMeters);},[createBounds,radiusinMeters,viewport]);var debug=false;if(!routeLocation){return null;}return React.createElement("div",{className:container,"aria-hidden":true},React.createElement(MapContainer,{center:viewport,bounds:bounds,className:container,whenCreated:handleMapCreated},debug&&React.createElement(Circle,{center:viewport,radius:radiusinMeters,color:"blue"}),React.createElement(TileLayer,{attribution:"&copy <a href=\"https://osm.org/copyright\">OpenStreetMap</a> contributors",url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),React.createElement(Marker,{key:code,icon:markerIconSelected,position:[latitude,longitude]})));};export default StoreFinderMap;
@@ -0,0 +1 @@
1
+ import{css}from'glamor';import{themeColors}from'@shopgate/pwa-common/helpers/config';export var container=css({height:'100%',width:'100%'});export var markerSelected=css({' svg':{height:40,width:40,fontSize:'1.5rem',color:"var(--color-primary, ".concat(themeColors.primary,")")}}).toString();
@@ -0,0 +1,4 @@
1
+ import React,{useRef}from'react';import{css}from'glamor';import StoreFinderMap from"./StoreFinderMap";import{StoreFinderProvider}from"../../../providers";var styles={container:css({maxHeight:'400px',height:'400px',width:'100%',marginTop:'10px',marginBottom:'10px'}).toString()};/**
2
+ * Store location map component.
3
+ * @returns {JSX.Element}
4
+ */var StoreLocationMap=function StoreLocationMap(){var storeListRef=useRef(null);return React.createElement(StoreFinderProvider,{storeListRef:storeListRef},React.createElement("div",{className:styles.container},React.createElement(StoreFinderMap,null)));};export default StoreLocationMap;
@@ -0,0 +1,4 @@
1
+ import React,{useContext}from'react';import{css}from'glamor';import{i18n}from'@shopgate/engage/core/helpers';import StoresNearbyListItem from"./StoresNearbyListItem";import{StoreDetailsContext}from"../../../providers/StoreDetailsContext";var styles={title:css({fontSize:20,fontWeight:'600',marginBottom:12}),table:css({width:'100%'})};/**
2
+ * Show stores nearby selected location
3
+ * @returns {JSX}
4
+ */var StoresNearby=function StoresNearby(){var _useContext=useContext(StoreDetailsContext),nearbyLocations=_useContext.nearbyLocations;return React.createElement("div",null,React.createElement("div",{className:styles.title},i18n.text('location.storesNearby')),nearbyLocations.length>0&&React.createElement("table",{className:styles.table},React.createElement("tbody",null,nearbyLocations.map(function(location){return React.createElement(StoresNearbyListItem,{location:location,key:location.code});}))),nearbyLocations.length===0&&React.createElement("div",null,i18n.text('location.noStoresNearby')));};export default StoresNearby;
@@ -0,0 +1,9 @@
1
+ import React,{useContext}from'react';import{useDispatch}from'react-redux';import PropTypes from'prop-types';import{css}from'glamor';import{Button}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core/helpers';import{historyPush}from'@shopgate/engage/core';import formatDistance from"../../../helpers/formatDistance";import{STORE_DETAILS_PATH}from"../../../constants";import{StoreDetailsContext}from"../../../providers/StoreDetailsContext";var styles={locationRow:css({borderBottom:'1px solid #e8e8e8',borderTop:'1px solid #e8e8e8'}),distance:css({textWrapMode:'nowrap',alignContent:'center',verticalAlign:'middle',fontWeight:'500'}),makeMyStore:css({textWrapMode:'nowrap',alignContent:'center',verticalAlign:'middle'}),makeMyStoreButtonText:css({color:'var(--color-primary)'}),storeInfo:css({textWrapMode:'nowrap',alignContent:'center',verticalAlign:'middle'}),storeInfoButtonText:css({color:'var(--color-primary)'}),name:css({textAlign:'start'}),cellContainer:css({padding:'8px',textAlign:'end'}),cell:css({verticalAlign:'middle'}),buttonContainer:css({display:'flex',gap:'4px 16px',flexWrap:'wrap',justifyContent:'flex-end'}),comingSoon:css({})};/**
2
+ * Shows a location in a row
3
+ * @param {Object} props Props
4
+ * @param {Object} props.location Location
5
+ * @returns {JSX}
6
+ */var StoresNearbyListItem=function StoresNearbyListItem(_ref){var location=_ref.location;var dispatch=useDispatch();var _useContext=useContext(StoreDetailsContext),preferredLocation=_useContext.preferredLocation,selectLocation=_useContext.selectLocation;var name=location.name,distance=location.distance,unitSystem=location.unitSystem,code=location.code,isComingSoon=location.isComingSoon;var isPreferredLocation=preferredLocation&&preferredLocation.code===code;/**
7
+ * Opens the store details page
8
+ * @param {string} locationCode Location code
9
+ */var openStoreDetails=function openStoreDetails(locationCode){dispatch(historyPush({pathname:"".concat(STORE_DETAILS_PATH,"/").concat(locationCode)}));};return React.createElement("tr",{className:styles.locationRow},React.createElement("td",{className:styles.cell},React.createElement("div",{className:styles.cellContainer},React.createElement("div",{className:styles.name},name))),React.createElement("td",{className:styles.cell},React.createElement("div",{className:styles.cellContainer},React.createElement("div",{className:styles.distance},formatDistance(distance||0,unitSystem==='imperial')))),React.createElement("td",{className:styles.cell},React.createElement("div",{className:styles.cellContainer},React.createElement("div",{className:styles.buttonContainer},!isPreferredLocation&&React.createElement("div",{className:styles.makeMyStore},!isComingSoon&&!isPreferredLocation&&React.createElement(Button,{onClick:function onClick(){return selectLocation(location,true);},role:"button",type:"plain"},React.createElement("div",{className:styles.makeMyStoreButtonText},i18n.text('location.makeMyStore'))),isComingSoon&&React.createElement("div",{className:styles.comingSoon},i18n.text('location.comingSoon'))),React.createElement("div",{className:styles.storeInfo},React.createElement(Button,{role:"button",type:"plain",onClick:function onClick(){return openStoreDetails(code);}},React.createElement("div",{className:styles.storeInfoButtonText},i18n.text('locations.details'))))))));};export default StoresNearbyListItem;
@@ -0,0 +1,4 @@
1
+ import React from'react';import{css}from'glamor';import{themeConfig}from'@shopgate/engage';import StoreDetails from"./components/StoreDetails";import StoreLocationMap from"./components/StoreLocationMap";import StoresNearby from"./components/StoresNearby";import FindMoreStores from"./components/FindMoreStores";import{StoreDetailsProvider}from"../../providers";var styles={page:css({padding:"".concat(themeConfig.variables.gap.small,"px ").concat(themeConfig.variables.gap.big,"px")}).toString()};/**
2
+ * @param {Object} props .
3
+ * @returns {JSX}
4
+ */var StoreDetailsContent=function StoreDetailsContent(){return React.createElement(StoreDetailsProvider,null,React.createElement("div",{className:styles.page},React.createElement(StoreDetails,null),React.createElement(StoreLocationMap,null),React.createElement(StoresNearby,null),React.createElement(FindMoreStores,null)));};export default StoreDetailsContent;
@@ -1,3 +1,3 @@
1
- import React,{useRef}from'react';import{hot}from'react-hot-loader/root';import{ResponsiveContainer}from'@shopgate/engage/components';import{StoreFinderProvider}from"../../providers";import StoreFinderSearch from"./StoreFinderSearch";import StoreFinderMap from"./StoreFinderMap";import StoreFinderLocations from"./StoreFinderLocations";import StoreFinderLocationDetailsWide from"./StoreFinderLocationDetailsWide";import StoreFinderStoresNear from"./StoreFinderStoresNear";import{container,storeSearch,storeList,storeDetails,storeDetailsMap}from"./StoreFinder.style";/**
2
- * @returns {JSX}
3
- */var StoreFinder=function StoreFinder(){var storeListRef=useRef(null);return React.createElement(StoreFinderProvider,{storeListRef:storeListRef},React.createElement("div",{className:container},React.createElement("div",{className:storeSearch},React.createElement(StoreFinderSearch,null),React.createElement(ResponsiveContainer,{breakpoint:">sm",webOnly:true},React.createElement(StoreFinderStoresNear,null))),React.createElement("div",{className:storeDetailsMap},React.createElement(StoreFinderMap,null)),React.createElement("div",{className:storeDetails},React.createElement(StoreFinderLocationDetailsWide,null)),React.createElement("div",{className:storeList},React.createElement(StoreFinderLocations,{ref:storeListRef}))));};export default hot(StoreFinder);
1
+ import React,{useRef}from'react';import{hot}from'react-hot-loader/root';import{StoreFinderProvider}from"../../providers";import StoreFinderSearch from"./StoreFinderSearch";import StoreFinderLocations from"./StoreFinderLocations";import{container,storeSearch,storeList}from"./StoreFinder.style";/**
2
+ * @returns {JSX.Element}
3
+ */var StoreFinder=function StoreFinder(){var storeListRef=useRef(null);return React.createElement(StoreFinderProvider,{storeListRef:storeListRef},React.createElement("div",{className:container},React.createElement("div",{className:storeSearch},React.createElement(StoreFinderSearch,null)),React.createElement("div",{className:storeList},React.createElement(StoreFinderLocations,{ref:storeListRef}))));};export default hot(StoreFinder);
@@ -1,2 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var container=css(_defineProperty({display:'grid',gridTemplateColumns:'350px 1fr',gridTemplateRows:'auto 200px 1fr 1fr',gridTemplateAreas:"\n \"search map\"\n \"store-list map\"\n \"store-list store-details\"\n \"store-list store-details\"\n ",height:'calc(100vh - var(--app-bar-height))'},responsiveMediaQuery('<=sm',{appAlways:true}),{gridTemplateColumns:'1fr',gridTemplateRows:'auto 1fr',gridTemplateAreas:'"search" "store-list"',// height: '100vh',
2
- height:'inherit'}));export var storeSearch=css({gridArea:'search',padding:"".concat(variables.gap.big,"px 4px 0 4px"),' select':{color:'var(--color-text-medium-emphasis)'}});export var storeList=css(_defineProperty({gridArea:'store-list',width:'100%',overflow:'hidden'},responsiveMediaQuery('<=sm',{appAlways:true}),{width:'100%'}));export var storeDetailsMap=css(_defineProperty({gridArea:'map',paddingBottom:variables.gap.big},responsiveMediaQuery('>sm',{webOnly:true}),{paddingRight:variables.gap.big,paddingTop:variables.gap.big,paddingBottom:0}));export var storeDetails=css(_defineProperty({gridArea:'store-details',paddingRight:variables.gap.big,paddingTop:variables.gap.big},responsiveMediaQuery('<=sm',{appAlways:true}),{display:'none'}));
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var container=css({display:'grid',gridTemplateColumns:'1fr',gridTemplateRows:'auto 1fr',gridTemplateAreas:'"search" "store-list"',height:'inherit'});export var storeSearch=css({gridArea:'search',padding:"".concat(variables.gap.big,"px 4px 0 4px"),' select':{color:'var(--color-text-medium-emphasis)'}});export var storeList=css({gridArea:'store-list',width:'100%',overflow:'hidden',padding:'0 12px 8px 12px'});
@@ -1,3 +1,3 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{useContext,useMemo}from'react';import classNames from'classnames';import{ResponsiveContainer}from'@shopgate/engage/components';import{StoreContext}from"./Store.context";import{StoreFinderContext}from"../../locations.context";import StoreFinderLocationHeader from"./StoreFinderLocationHeader";import StoreFinderLocationDetails from"./StoreFinderLocationDetails";import StoreFinderGetDirectionsButton from"./StoreFinderGetDirectionsButton";import{container,selected,directionsButton}from"./StoreFinderLocation.style";import{StoreFinderSelectLocationButton}from"./StoreFinderSelectLocationButton";/**
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{useContext,useMemo}from'react';import classNames from'classnames';import{StoreContext}from"./Store.context";import{StoreFinderContext}from"../../locations.context";import StoreFinderLocationHeader from"./StoreFinderLocationHeader";import{container,selected}from"./StoreFinderLocation.style";import{StoreFinderSelectLocationButton}from"./StoreFinderSelectLocationButton";import StoreFinderStoreInfoButton from"./StoreFinderStoreInfoButton";/**
2
2
  * @returns {JSX}
3
- */var StoreFinderLocation=function StoreFinderLocation(){var store=useContext(StoreContext);var _useContext=useContext(StoreFinderContext),selectedLocation=_useContext.selectedLocation;var isSelected=useMemo(function(){var _ref=selectedLocation||{},code=_ref.code;return store.code===code;},[selectedLocation,store.code]);return React.createElement("div",{className:classNames(container,_defineProperty({},selected,isSelected)),"data-location-code":store.code},React.createElement(StoreFinderLocationHeader,null),React.createElement(ResponsiveContainer,{breakpoint:"<=sm",appAlways:true},React.createElement(StoreFinderLocationDetails,null),React.createElement(StoreFinderSelectLocationButton,null),React.createElement(StoreFinderGetDirectionsButton,{address:store.address,className:directionsButton})));};export default StoreFinderLocation;
3
+ */var StoreFinderLocation=function StoreFinderLocation(){var store=useContext(StoreContext);var _useContext=useContext(StoreFinderContext),selectedLocation=_useContext.selectedLocation;var isSelected=useMemo(function(){var _ref=selectedLocation||{},code=_ref.code;return store.code===code;},[selectedLocation,store.code]);return React.createElement("div",{className:classNames(container,_defineProperty({},selected,isSelected)),"data-location-code":store.code},React.createElement(StoreFinderLocationHeader,null),React.createElement(StoreFinderSelectLocationButton,null),React.createElement(StoreFinderStoreInfoButton,null));};export default StoreFinderLocation;
@@ -1 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';var colors=themeConfig.colors,variables=themeConfig.variables;export var container=css({}).toString();export var selected=css(_defineProperty({boxShadow:"0 0 0 2px var(--color-primary, ".concat(colors.primary,")"),borderRadius:3},responsiveMediaQuery('<=sm',{appAlways:true}),{boxShadow:'none'})).toString();export var directionsButton=css({padding:"0 ".concat(variables.gap.big,"px ").concat(variables.gap.big,"px")}).toString();
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var container=css({}).toString();export var selected=css({}).toString();export var directionsButton=css({padding:"0 ".concat(variables.gap.big,"px ").concat(variables.gap.big,"px")}).toString();
@@ -1,3 +1,3 @@
1
- import React,{useContext,useCallback}from'react';import{Grid,ResponsiveContainer}from'@shopgate/engage/components';import{StoreContext}from"./Store.context";import{StoreFinderContext}from"../../locations.context";import{StoreDistance}from"../StoreList/StoreDistance";import{StoreHoursToday}from"../StoreList/StoreHoursToday";import{StoreAddress}from"../StoreList/StoreAddress";import StoreFinderLocationHeaderPhoneNumber from"./StoreFinderLocationHeaderPhoneNumber";import{container,storeName,storeDistance,storeHoursToday,clickable}from"./StoreFinderLocationHeader.style";/**
1
+ import React,{useContext,useMemo}from'react';import{Grid,LocationIcon}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core/helpers';import{StoreContext}from"./Store.context";import{StoreFinderContext}from"../../locations.context";import{StoreDistance}from"../StoreList/StoreDistance";import{StoreHoursToday}from"../StoreList/StoreHoursToday";import{StoreAddress}from"../StoreList/StoreAddress";import StoreFinderLocationHeaderPhoneNumber from"./StoreFinderLocationHeaderPhoneNumber";import{container,storeName,storeDistance,storeHoursToday,clickable,storeNameWrapper,myStore,myStoreIcon,myStoreWrapper}from"./StoreFinderLocationHeader.style";/**
2
2
  * @returns {JSX}
3
- */var StoreFinderLocationHeader=function StoreFinderLocationHeader(){var store=useContext(StoreContext);var name=store.name,distance=store.distance,unitSystem=store.unitSystem,operationHours=store.operationHours,address=store.address;var _useContext=useContext(StoreFinderContext),changeLocation=_useContext.changeLocation;var handleClick=useCallback(function(){changeLocation(store);},[changeLocation,store]);return React.createElement("div",{className:container},React.createElement("div",{className:clickable,role:"button",tabIndex:"0",onClick:handleClick,onKeyDown:handleClick},React.createElement(Grid,null,React.createElement(Grid.Item,{grow:1,className:storeName},name),React.createElement(Grid.Item,{className:storeDistance},React.createElement(StoreDistance,{distance:distance,unitSystem:unitSystem}))),React.createElement(ResponsiveContainer,{breakpoint:">sm",webOnly:true},React.createElement("div",{className:storeHoursToday},React.createElement(StoreHoursToday,{hours:operationHours,longLabel:true})),React.createElement(StoreAddress,{address:address,pure:true})),React.createElement(ResponsiveContainer,{breakpoint:"<=sm",appAlways:true},React.createElement("div",{className:storeHoursToday},React.createElement(StoreHoursToday,{hours:operationHours})),React.createElement(StoreAddress,{address:address}))),React.createElement(ResponsiveContainer,{breakpoint:"<=sm",appAlways:true},React.createElement(StoreFinderLocationHeaderPhoneNumber,{phone:address.phoneNumber})));};export default StoreFinderLocationHeader;
3
+ */var StoreFinderLocationHeader=function StoreFinderLocationHeader(){var store=useContext(StoreContext);var name=store.name,distance=store.distance,unitSystem=store.unitSystem,operationHours=store.operationHours,address=store.address;var _useContext=useContext(StoreFinderContext),selectedLocation=_useContext.selectedLocation;var isSelectedLocation=useMemo(function(){return(selectedLocation===null||selectedLocation===void 0?void 0:selectedLocation.code)===(store===null||store===void 0?void 0:store.code);},[selectedLocation,store]);return React.createElement("div",{className:container},React.createElement("div",{className:clickable},React.createElement(Grid,null,React.createElement(Grid.Item,{grow:1},React.createElement("div",{className:storeNameWrapper},React.createElement("div",{className:storeName},name),isSelectedLocation&&React.createElement("div",{className:myStoreWrapper},React.createElement("div",{className:myStoreIcon},React.createElement(LocationIcon,{size:20})),React.createElement("div",{className:myStore},i18n.text('location.myStore'))))),React.createElement(Grid.Item,{className:storeDistance},React.createElement(StoreDistance,{distance:distance,unitSystem:unitSystem}))),React.createElement("div",{className:storeHoursToday},React.createElement(StoreHoursToday,{hours:operationHours})),React.createElement(StoreAddress,{address:address})),React.createElement(StoreFinderLocationHeaderPhoneNumber,{phone:address.phoneNumber}));};export default StoreFinderLocationHeader;
@@ -1 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';var variables=themeConfig.variables;export var container=css(_defineProperty({padding:variables.gap.big,display:'flex',flexDirection:'column',color:'var(--color-text-low-emphasis)',' > *':{margin:0},' > *:not(:last-child)':{paddingBottom:variables.gap.small},' svg':{color:'var(--color-text-low-emphasis)'},' li':{paddingTop:0},' a':{color:'var(--color-primary)',textDecoration:'underline'}},responsiveMediaQuery('<=sm',{appAlways:true}),{fontSize:'0.875rem',lineHeight:'1.5rem',' > *:not(:last-child)':{paddingBottom:variables.gap.xsmall,paddingTop:0}})).toString();export var clickable=css(_defineProperty({cursor:'pointer',' > *:not(:last-child)':{paddingBottom:variables.gap.small},' > *':{margin:0,paddingTop:0}},responsiveMediaQuery('<=sm',{appAlways:true}),{' > *:not(:last-child)':{paddingBottom:variables.gap.xsmall,paddingTop:0}})).toString();export var storeName=css(_defineProperty({fontSize:'1rem',fontWeight:500,color:'var(--color-text-high-emphasis)'},responsiveMediaQuery('>sm',{webOnly:true}),{fontSize:'1.125rem',lineHeight:'1.5rem'})).toString();export var storeDistance=css({lineHeight:'1.65rem',paddingLeft:variables.gap.small}).toString();export var storeHoursToday=css({' > *':{color:'var(--color-text-low-emphasis)'}}).toString();
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var container=css({padding:variables.gap.big,display:'flex',flexDirection:'column',color:'var(--color-text-low-emphasis)',' > *':{margin:0},' svg':{color:'var(--color-text-low-emphasis)'},' li':{paddingTop:0},' a':{color:'var(--color-primary)',textDecoration:'underline'},fontSize:'0.875rem',lineHeight:'1.5rem',' > *:not(:last-child)':{paddingBottom:variables.gap.xsmall,paddingTop:0}}).toString();export var clickable=css({' > *':{margin:0,paddingTop:0},' > *:not(:last-child)':{paddingBottom:variables.gap.xsmall,paddingTop:0}}).toString();export var storeName=css({fontSize:'1rem',fontWeight:500,color:'var(--color-text-high-emphasis)'}).toString();export var myStoreWrapper=css({display:'flex',alignItems:'center'}).toString();export var myStore=css({color:'var(--color-primary)',fontSize:'1rem',fontWeight:500}).toString();export var myStoreIcon=css({' svg':{color:'var(--color-primary)'},marginRight:'4px'}).toString();export var storeNameWrapper=css({flexWrap:'wrap',display:'flex',gap:'2px 12px'});export var storeDistance=css({lineHeight:'1.65rem',paddingLeft:variables.gap.small}).toString();export var storeHoursToday=css({' > *':{color:'var(--color-text-low-emphasis)'}}).toString();
@@ -1,2 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;var gapM=variables.gap.small+variables.gap.xsmall;export var container=css(_defineProperty({borderTop:"1px solid ".concat(colors.shade7),overflowY:'scroll',WebkitOverflowScrolling:'touch',height:'100%'},responsiveMediaQuery('<=sm',{appAlways:true}),{paddingTop:2,borderTop:'none',overflowY:'unset',WebkitOverflowScrolling:'unset'// overflowY: 'initial',
2
- }));export var cardList=css(_defineProperty({padding:variables.gap.big},responsiveMediaQuery('<=sm',{appAlways:true}),{paddingTop:0})).toString();export var card=css({background:colors.light,border:"1px solid ".concat(colors.shade7),boxSizing:'border-box',boxShadow:'0px 1px 2px rgba(0, 0, 0, 0.25)',borderRadius:3,':not(:last-child)':{marginBottom:gapM}}).toString();
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;var gapM=variables.gap.small+variables.gap.xsmall;export var container=css({paddingTop:2,borderTop:'none',overflowY:'unset',WebkitOverflowScrolling:'unset'});export var cardList=css({paddingTop:0}).toString();export var card=css({background:colors.light,border:"1px solid ".concat(colors.shade7),boxSizing:'border-box',boxShadow:'0px 1px 2px rgba(0, 0, 0, 0.25)',borderRadius:3,':not(:last-child)':{marginBottom:gapM}}).toString();
@@ -1 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{themeVariables}from'@shopgate/pwa-common/helpers/config';export var container=css(_defineProperty({},responsiveMediaQuery('<=sm',{appAlways:true}),{paddingBottom:themeVariables.gap.small}));
1
+ import{css}from'glamor';import{themeVariables}from'@shopgate/pwa-common/helpers/config';export var container=css({paddingBottom:themeVariables.gap.small});
@@ -1,5 +1,5 @@
1
- import React,{useCallback,useContext}from'react';import{RippleButton}from'@shopgate/engage/components';import{StoreContext}from"./Store.context";import{i18n}from"../../../core";import{StoreFinderContext}from"../../locations.context";import{selectLocationButton,selectLocationButtonWrapper}from"../StoreList/Store.style";/**
1
+ import React,{useCallback,useContext,useMemo}from'react';import{RippleButton}from'@shopgate/engage/components';import{StoreContext}from"./Store.context";import{i18n}from"../../../core";import{StoreFinderContext}from"../../locations.context";import{selectLocationButton,selectLocationButtonWrapper}from"../StoreList/Store.style";/**
2
2
  * The StoreFinderSelectLocationButton component.
3
3
  * Renders if route query.selectLocation param is passed
4
4
  * @returns {JSX.Element}
5
- */export var StoreFinderSelectLocationButton=function StoreFinderSelectLocationButton(){var store=useContext(StoreContext);var _useContext=useContext(StoreFinderContext),selectLocation=_useContext.selectLocation,isLoading=_useContext.isLoading;var handleClick=useCallback(function(e){e.stopPropagation();selectLocation(store);},[selectLocation,store]);return React.createElement("div",{className:selectLocationButtonWrapper},React.createElement(RippleButton,{onClick:handleClick,className:selectLocationButton.toString(),disabled:isLoading||(store===null||store===void 0?void 0:store.isComingSoon)},i18n.text('locations.select_location')));};
5
+ */export var StoreFinderSelectLocationButton=function StoreFinderSelectLocationButton(){var store=useContext(StoreContext);var _useContext=useContext(StoreFinderContext),selectLocation=_useContext.selectLocation,isLoading=_useContext.isLoading,selectedLocation=_useContext.selectedLocation;var handleClick=useCallback(function(e){e.stopPropagation();selectLocation(store);},[selectLocation,store]);var isSelected=useMemo(function(){return(selectedLocation===null||selectedLocation===void 0?void 0:selectedLocation.code)===(store===null||store===void 0?void 0:store.code);},[selectedLocation,store]);return React.createElement("div",{className:selectLocationButtonWrapper},React.createElement(RippleButton,{onClick:handleClick,className:selectLocationButton.toString(),disabled:isLoading||(store===null||store===void 0?void 0:store.isComingSoon)||isSelected},i18n.text((store===null||store===void 0?void 0:store.isComingSoon)?'location.comingSoon':'locations.select_location')));};
@@ -0,0 +1,8 @@
1
+ import React,{useCallback,useContext}from'react';import classNames from'classnames';import PropTypes from'prop-types';import{RippleButton}from'@shopgate/engage/components';import{historyPush}from'@shopgate/engage/core';import{connect}from'react-redux';import{css}from'glamor';import{themeColors,themeVariables}from'@shopgate/pwa-common/helpers/config';import{StoreContext}from"./Store.context";import{i18n}from"../../../core";import{StoreFinderContext}from"../../locations.context";import{STORE_DETAILS_PATH}from"../../constants";var gap=themeVariables.gap;var styles={showStoreInfoButton:css({width:'100%',fontSize:'.875rem !important',':not(:disabled)':{background:"var(--color-primary, ".concat(themeColors.primary,")!important"),color:"var(--color-primary-contrast, ".concat(themeColors.primaryContrast,")!important")}}),showStoreInfoButtonWrapper:css({padding:"0 ".concat(gap.big,"px ").concat(gap.small,"px ").concat(gap.big,"px")})};/**
2
+ * @param {Function} dispatch The dispatch function.
3
+ * @returns {Object}
4
+ */var mapDispatchToProps=function mapDispatchToProps(dispatch){return{openStoreDetail:function openStoreDetail(code){return dispatch(historyPush({pathname:"".concat(STORE_DETAILS_PATH,"/").concat(code)}));}};};/**
5
+ * The StoreFinderStoreInfoButton component.
6
+ * @param {Function} openStoreDetail The openStoreDetail function.
7
+ * @returns {JSX}
8
+ */var StoreFinderStoreInfoButton=function StoreFinderStoreInfoButton(_ref){var openStoreDetail=_ref.openStoreDetail;var store=useContext(StoreContext);var _useContext=useContext(StoreFinderContext),isLoading=_useContext.isLoading;var handleClick=useCallback(function(e){e.stopPropagation();openStoreDetail(store===null||store===void 0?void 0:store.code);},[openStoreDetail,store]);return React.createElement("div",{className:styles.showStoreInfoButtonWrapper},React.createElement(RippleButton,{onClick:handleClick,className:classNames(styles.showStoreInfoButton),disabled:isLoading},i18n.text('locations.store_info')));};export default connect(null,mapDispatchToProps)(StoreFinderStoreInfoButton);
@@ -1 +1 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeVariables,themeColors}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';var gap=themeVariables.gap;var baseCardPadding="".concat(gap.small,"px ").concat(gap.big,"px");var gapM=gap.small+gap.xsmall;export var stores=css(_defineProperty({background:"var(--color-background-accent, ".concat(themeColors.background,")"),padding:"".concat(gapM,"px ").concat(gapM,"px ").concat(gap.big,"px"),fontSize:'0.875rem'},responsiveMediaQuery('<=sm'),{boxShadow:'inset rgba(0, 0, 0, .117647) 0 1px 6px, inset rgba(0, 0, 0, .117647) 0 1px 4px'})).toString();export var storeCard=css({background:themeColors.light,marginBottom:gapM,':last-of-type':{marginBottom:0},border:"1px solid ".concat(themeColors.shade7),boxSizing:'border-box',boxShadow:'0px 1px 2px rgba(0, 0, 0, 0.25)',borderRadius:'0px 0px 3px 3px'}).toString();export var storeCardPlaceholder=css({margin:'10px 0',height:36}).toString();export var storeHeader=css({cursor:'pointer',padding:"".concat(baseCardPadding," ").concat(gap.xsmall,"px")}).toString();export var disabled=css({cursor:'not-allowed'}).toString();export var storeName=css({fontSize:'1rem',fontWeight:500}).toString();export var storeDistance=css(_defineProperty({whiteSpace:'nowrap',color:"var(--color-text-medium-emphasis, ".concat(themeColors.gray,")")},responsiveMediaQuery('>sm',{webOnly:true}),{fontSize:'0.875rem'})).toString();export var storeDetailsBody=css({padding:baseCardPadding,borderTop:"1px solid ".concat(themeColors.shade7)}).toString();export var storeDetailsAccordion=css({justifyContent:'space-between'}).toString();export var storeHoursToday=css({color:"var(--color-text-low-emphasis, ".concat(themeColors.gray,")")}).toString();export var address=css({display:'flex',flexFlow:'row nowrap',color:"var(--color-text-low-emphasis, ".concat(themeColors.gray,")"),marginBottom:4}).toString();export var addressIcon=css({color:themeColors.shade7,fontSize:'1.4rem',padding:"".concat(gap.xsmall,"px ").concat(gap.big,"px 0 0")}).toString();export var detailsIcon=css({color:themeColors.shade3,fontSize:'1.4rem',padding:"".concat(gap.xsmall,"px ").concat(gap.big,"px 0 0")}).toString();export var detailsIconLinked=css({color:'var(--color-primary)'}).toString();export var detailsLine=css({marginTop:gapM}).toString();export var details=css({paddingTop:gap.xsmall}).toString();export var openingHours=css({display:'table',color:'var(--color-text-low-emphasis)'}).toString();export var openingHoursRow=css({display:'table-row'}).toString();export var openingHoursDay=css({display:'table-cell',paddingRight:gap.big}).toString();export var detailsPrimary=css({color:"var(--color-primary, ".concat(themeColors.primary,")"),lineHeight:'1.375rem'}).toString();export var detailsSecondary=css({color:"var(--color-text-medium-emphasis, ".concat(themeColors.shade3,")"),fontSize:'0.75rem'}).toString();export var selectLocationButtonWrapper=css(_defineProperty({padding:"0 ".concat(gap.big,"px ").concat(gap.small,"px ").concat(gap.big,"px")},responsiveMediaQuery('>=sm',{webOnly:true}),{padding:"0 0 ".concat(gap.small,"px 0")}));export var stockInfoContainer=css({marginTop:8,':empty':{display:'none'}});export var selectLocationButton=css({width:'100%',fontSize:'.875rem !important',':not(:disabled)':{background:"var(--color-primary, ".concat(themeColors.primary,")!important"),color:"var(--color-primary-contrast, ".concat(themeColors.primaryContrast,")!important")}});
1
+ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeVariables,themeColors}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';var gap=themeVariables.gap;var baseCardPadding="".concat(gap.small,"px ").concat(gap.big,"px");var gapM=gap.small+gap.xsmall;export var stores=css({background:"var(--color-background-accent, ".concat(themeColors.background,")"),padding:"".concat(gapM,"px ").concat(gapM,"px ").concat(gap.big,"px"),fontSize:'0.875rem',boxShadow:'inset rgba(0, 0, 0, .117647) 0 1px 6px, inset rgba(0, 0, 0, .117647) 0 1px 4px'}).toString();export var storeCard=css({background:themeColors.light,marginBottom:gapM,':last-of-type':{marginBottom:0},border:"1px solid ".concat(themeColors.shade7),boxSizing:'border-box',boxShadow:'0px 1px 2px rgba(0, 0, 0, 0.25)',borderRadius:'0px 0px 3px 3px'}).toString();export var storeCardPlaceholder=css({margin:'10px 0',height:36}).toString();export var storeHeader=css({cursor:'pointer',padding:"".concat(baseCardPadding," ").concat(gap.xsmall,"px")}).toString();export var disabled=css({cursor:'not-allowed'}).toString();export var storeName=css({fontSize:'1rem',fontWeight:500}).toString();export var storeDistance=css(_defineProperty({whiteSpace:'nowrap',color:"var(--color-text-medium-emphasis, ".concat(themeColors.gray,")")},responsiveMediaQuery('>sm',{webOnly:true}),{fontSize:'0.875rem'})).toString();export var storeDetailsBody=css({padding:baseCardPadding,borderTop:"1px solid ".concat(themeColors.shade7)}).toString();export var storeDetailsAccordion=css({justifyContent:'space-between'}).toString();export var storeHoursToday=css({color:"var(--color-text-low-emphasis, ".concat(themeColors.gray,")")}).toString();export var address=css({display:'flex',flexFlow:'row nowrap',color:"var(--color-text-low-emphasis, ".concat(themeColors.gray,")"),marginBottom:4}).toString();export var addressIcon=css({color:themeColors.shade7,fontSize:'1.4rem',padding:"".concat(gap.xsmall,"px ").concat(gap.big,"px 0 0")}).toString();export var detailsIcon=css({color:themeColors.shade3,fontSize:'1.4rem',padding:"".concat(gap.xsmall,"px ").concat(gap.big,"px 0 0")}).toString();export var detailsIconLinked=css({color:'var(--color-primary)'}).toString();export var detailsLine=css({marginTop:gapM}).toString();export var details=css({paddingTop:gap.xsmall}).toString();export var openingHours=css({display:'table',color:'var(--color-text-low-emphasis)'}).toString();export var openingHoursRow=css({display:'table-row'}).toString();export var openingHoursDay=css({display:'table-cell',paddingRight:gap.big}).toString();export var detailsPrimary=css({color:"var(--color-primary, ".concat(themeColors.primary,")"),lineHeight:'1.375rem'}).toString();export var detailsSecondary=css({color:"var(--color-text-medium-emphasis, ".concat(themeColors.shade3,")"),fontSize:'0.75rem'}).toString();export var selectLocationButtonWrapper=css({padding:"0 ".concat(gap.big,"px ").concat(gap.small,"px ").concat(gap.big,"px")});export var stockInfoContainer=css({marginTop:8,':empty':{display:'none'}});export var selectLocationButton=css({width:'100%',fontSize:'.875rem !important',':not(:disabled)':{background:"var(--color-primary, ".concat(themeColors.primary,")!important"),color:"var(--color-primary-contrast, ".concat(themeColors.primaryContrast,")!important")}});
@@ -1,5 +1,5 @@
1
- import*as React from'react';import{ResponsiveContainer}from'@shopgate/engage/components';import{StoreContext}from"./Store.context";import{FulfillmentContext}from"../../locations.context";import{StockInfo}from"../StockInfo";import{LocationIcon}from"../../../components";import{i18n}from"../../../core";import{address as container,addressIcon,stockInfoContainer}from"./Store.style";/**
1
+ import*as React from'react';import PropTypes from'prop-types';import{StoreContext}from"./Store.context";import{FulfillmentContext}from"../../locations.context";import{StockInfo}from"../StockInfo";import{LocationIcon}from"../../../components";import{i18n}from"../../../core";import{address as container,addressIcon,stockInfoContainer}from"./Store.style";/**
2
2
  * Renders the pickup location's address information.
3
3
  * @param {Object} props The component props.
4
4
  * @returns {JSX}
5
- */export function StoreAddress(_ref){var address=_ref.address,pure=_ref.pure;var store=React.useContext(StoreContext);var _React$useContext=React.useContext(FulfillmentContext),product=_React$useContext.product;if(!address){return null;}var addressContent=React.createElement("div",null,React.createElement("div",{"data-test-id":"street"},address.street),address.street2&&address.street2!==''&&React.createElement("div",{"data-test-id":"street2"},address.street2),address.street3&&address.street3!==''&&React.createElement("div",{"data-test-id":"street3"},address.street3),address.street4&&address.street4!==''&&React.createElement("div",{"data-test-id":"street4"},address.street4),i18n.text('locations.address',address));if(pure){return addressContent;}return React.createElement("div",{className:container},React.createElement("div",{className:addressIcon},React.createElement(LocationIcon,null)),React.createElement("div",null,addressContent,React.createElement(ResponsiveContainer,{breakpoint:"<sm",appAlways:true},React.createElement("div",{className:stockInfoContainer},React.createElement(StockInfo,{location:store,product:product,showStoreName:false})))));}StoreAddress.defaultProps={address:null,pure:false};
5
+ */export function StoreAddress(_ref){var address=_ref.address,pure=_ref.pure;var store=React.useContext(StoreContext);var _React$useContext=React.useContext(FulfillmentContext),product=_React$useContext.product;if(!address){return null;}var addressContent=React.createElement("div",null,React.createElement("div",{"data-test-id":"street"},address.street),address.street2&&address.street2!==''&&React.createElement("div",{"data-test-id":"street2"},address.street2),address.street3&&address.street3!==''&&React.createElement("div",{"data-test-id":"street3"},address.street3),address.street4&&address.street4!==''&&React.createElement("div",{"data-test-id":"street4"},address.street4),i18n.text('locations.address',address));if(pure){return addressContent;}return React.createElement("div",{className:container},React.createElement("div",{className:addressIcon},React.createElement(LocationIcon,null)),React.createElement("div",null,addressContent,product&&React.createElement("div",{className:stockInfoContainer},React.createElement(StockInfo,{location:store,product:product,showStoreName:false}))));}StoreAddress.defaultProps={address:null,pure:false};
@@ -1,4 +1,4 @@
1
- import React,{Fragment,useMemo}from'react';import{i18n,generateGoogleMapsDirectionsUrl}from'@shopgate/engage/core';import{LocationIcon,Link,Ellipsis,I18n}from'@shopgate/engage//components';import{StoreDetailsLine}from"./StoreDetailsLine";import{detailsPrimary,detailsSecondary}from"./Store.style";/**
1
+ import React,{Fragment,useMemo}from'react';import{i18n,generateGoogleMapsDirectionsUrl}from'@shopgate/engage/core';import{LocationIcon,Link,Ellipsis,I18n}from'@shopgate/engage//components';import PropTypes from'prop-types';import{StoreDetailsLine}from"./StoreDetailsLine";import{detailsPrimary,detailsSecondary}from"./Store.style";/**
2
2
  * Renders the pickup location's address information.
3
3
  * @param {Object} props The component props.
4
4
  * @returns {JSX}
@@ -1,4 +1,4 @@
1
- import React,{useContext,Fragment}from'react';import{ResponsiveContainer}from'@shopgate/engage/components';import{StoreContext}from"./Store.context";import{StoreHeader}from"./StoreHeader";import{StoreDetails}from"./StoreDetails";import{StoreSelectLocationButton}from"./StoreSelectLocationButton";/**
1
+ import React,{useContext,Fragment}from'react';import{StoreContext}from"./Store.context";import{StoreHeader}from"./StoreHeader";import{StoreDetails}from"./StoreDetails";import{StoreSelectLocationButton}from"./StoreSelectLocationButton";/**
2
2
  * Renders the store's card.
3
3
  * @returns {JSX}
4
- */export function StoreCard(){var store=useContext(StoreContext);if(!store||!store.address){return null;}return React.createElement(Fragment,null,React.createElement(StoreHeader,null),React.createElement(StoreDetails,null),React.createElement(ResponsiveContainer,{breakpoint:"<sm",appAlways:true},React.createElement(StoreSelectLocationButton,null)));}
4
+ */export function StoreCard(){var store=useContext(StoreContext);if(!store||!store.address){return null;}return React.createElement(Fragment,null,React.createElement(StoreHeader,null),React.createElement(StoreDetails,null),React.createElement(StoreSelectLocationButton,null));}
@@ -1,4 +1,4 @@
1
- import React from'react';import formatDistance from"../../helpers/formatDistance";import{storeDistance}from"./Store.style";export var UNIT_SYSTEM_METRIC='metric';export var UNIT_SYSTEM_IMPERIAL='imperial';/**
1
+ import React from'react';import PropTypes from'prop-types';import formatDistance from"../../helpers/formatDistance";import{storeDistance}from"./Store.style";export var UNIT_SYSTEM_METRIC='metric';export var UNIT_SYSTEM_IMPERIAL='imperial';/**
2
2
  * Renders a single store distance.
3
3
  * @param {Object} props The component props.
4
4
  * @returns {JSX}
@@ -1,4 +1,4 @@
1
1
  import React,{useContext,useCallback}from'react';import{RippleButton}from'@shopgate/engage/components';import PropTypes from'prop-types';import{isProductAvailable}from"../../helpers";import{StoreContext}from"./Store.context";import{i18n,useWidgetSettings}from"../../../core";import{FulfillmentContext}from"../../locations.context";import{selectLocationButton,selectLocationButtonWrapper}from"./Store.style";import connect from"./StoreListSearch.connector";/**
2
2
  * The StoreSelectLocationButton component.
3
3
  * @returns {JSX.Element}
4
- */var StoreSelectLocationButton=function StoreSelectLocationButton(_ref){var setPostalCode=_ref.setPostalCode;var store=useContext(StoreContext);var _ref2=useWidgetSettings('@shopgate/engage/locations')||{},_ref2$setUserSearchZi=_ref2.setUserSearchZipLocationFromSelection,setUserSearchZipLocationFromSelection=_ref2$setUserSearchZi===void 0?true:_ref2$setUserSearchZi;var _useContext=useContext(FulfillmentContext),selectLocation=_useContext.selectLocation,noInventory=_useContext.noInventory,isLoading=_useContext.isLoading,product=_useContext.product;var isAvailable=isProductAvailable(store,store===null||store===void 0?void 0:store.inventory);var handleClick=useCallback(function(e){e.stopPropagation();if(noInventory||isAvailable){if(setUserSearchZipLocationFromSelection){setPostalCode(store.address.postalCode,product===null||product===void 0?void 0:product.id);}selectLocation(store);}},[isAvailable,noInventory,product,selectLocation,setPostalCode,setUserSearchZipLocationFromSelection,store]);return React.createElement("div",{className:selectLocationButtonWrapper},React.createElement(RippleButton,{onClick:handleClick,className:selectLocationButton.toString(),disabled:isLoading||(store===null||store===void 0?void 0:store.isComingSoon)||!noInventory&&!isAvailable},i18n.text('locations.select_location')));};var connectedStoreSelectLocationButton=connect(StoreSelectLocationButton);export{connectedStoreSelectLocationButton as StoreSelectLocationButton};
4
+ */var StoreSelectLocationButton=function StoreSelectLocationButton(_ref){var setPostalCode=_ref.setPostalCode;var store=useContext(StoreContext);var _ref2=useWidgetSettings('@shopgate/engage/locations')||{},_ref2$setUserSearchZi=_ref2.setUserSearchZipLocationFromSelection,setUserSearchZipLocationFromSelection=_ref2$setUserSearchZi===void 0?true:_ref2$setUserSearchZi;var _useContext=useContext(FulfillmentContext),selectLocation=_useContext.selectLocation,noInventory=_useContext.noInventory,isLoading=_useContext.isLoading,product=_useContext.product;var isAvailable=isProductAvailable(store,store===null||store===void 0?void 0:store.inventory);var handleClick=useCallback(function(e){e.stopPropagation();if(noInventory||isAvailable){if(setUserSearchZipLocationFromSelection){setPostalCode(store.address.postalCode,product===null||product===void 0?void 0:product.id);}selectLocation(store);}},[isAvailable,noInventory,product,selectLocation,setPostalCode,setUserSearchZipLocationFromSelection,store]);return React.createElement("div",{className:selectLocationButtonWrapper},React.createElement(RippleButton,{onClick:handleClick,className:selectLocationButton.toString(),disabled:isLoading||(store===null||store===void 0?void 0:store.isComingSoon)||!noInventory&&!isAvailable},i18n.text((store===null||store===void 0?void 0:store.isComingSoon)?'location.comingSoon':'locations.select_location')));};var connectedStoreSelectLocationButton=connect(StoreSelectLocationButton);export{connectedStoreSelectLocationButton as StoreSelectLocationButton};
@@ -1 +1 @@
1
- export{FulfillmentSelector}from"./FulfillmentSelector";export{FulfillmentSheet}from"./FulfillmentSheet";export{FulfillmentPathSelector}from"./FulfillmentPathSelector";export{StoreList,StoreOpeningHours,StorePhoneNumber,StoreAddress}from"./StoreList";export{CartItemProductChangeLocation,CartChangeFulfillmentMethod,CartContextMenuItemChangeLocation,CartContextMenuItemChangeFulfillment,CartContextMenuChangeFulfillment}from"./Cart";export{GlobalLocationSelector}from"./GlobalLocationSelector";export{GlobalLocationSwitcher}from"./GlobalLocationSwitcher";export{FulfillmentSlotSwitcher}from"./FulfillmentSlotSwitcher";export{StoreFinder}from"./StoreFinder";export{StockInfo}from"./StockInfo";export{default as StockInfoLists}from"./StockInfoLists";
1
+ export{FulfillmentSelector}from"./FulfillmentSelector";export{FulfillmentSheet}from"./FulfillmentSheet";export{FulfillmentPathSelector}from"./FulfillmentPathSelector";export{StoreList,StoreOpeningHours,StorePhoneNumber,StoreAddress}from"./StoreList";export{CartItemProductChangeLocation,CartChangeFulfillmentMethod,CartContextMenuItemChangeLocation,CartContextMenuItemChangeFulfillment,CartContextMenuChangeFulfillment}from"./Cart";export{GlobalLocationSelector}from"./GlobalLocationSelector";export{GlobalLocationSwitcher}from"./GlobalLocationSwitcher";export{FulfillmentSlotSwitcher}from"./FulfillmentSlotSwitcher";export{StoreFinder}from"./StoreFinder";export{StockInfo}from"./StockInfo";export{default as StockInfoLists}from"./StockInfoLists";export{default as StoreDetails}from"./StoreDetails";
@@ -2,4 +2,6 @@
2
2
  export{REQUEST_LOCATIONS,RECEIVE_LOCATIONS,ERROR_LOCATIONS,REQUEST_PRODUCT_INVENTORIES,RECEIVE_PRODUCT_INVENTORIES,ERROR_PRODUCT_INVENTORIES,REQUEST_INVENTORIES,RECEIVE_INVENTORIES,ERROR_INVENTORIES,SELECT_LOCATION,SELECT_GLOBAL_LOCATION,STORE_FORM_INPUT,STORE_FULFILLMENT_METHOD,SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,SET_USER_GEOLOCATION,SET_STORE_FINDER_SEARCH_RADIUS,REQUEST_PRODUCT_LOCATIONS,RECEIVE_PRODUCT_LOCATIONS,ERROR_PRODUCT_LOCATIONS,SUBMIT_RESERVATION_REQUEST,SUBMIT_RESERVATION_SUCCESS,SUBMIT_RESERVATION_ERROR,FETCH_FULFILLMENT_SLOTS_ERROR,FETCH_FULFILLMENT_SLOTS_SUCCESS,PROVIDE_PRODUCT_ALTERNATIVE_LOCATION}from"./ActionTypes";// PIPELINES
3
3
  export{SHOPGATE_STOREFRONT_GET_PRODUCT_LOCATIONS,SHOPGATE_STOREFRONT_CREATE_ORDER,SHOPGATE_STOREFRONT_GET_LOCATIONS,SHOPGATE_STOREFRONT_GET_PRODUCT_INVENTORIES,SHOPGATE_STOREFRONT_GET_INVENTORIES}from"./Pipelines";// PORTALS
4
4
  export{PRODUCT_FULFILLMENT_SELECTOR,PRODUCT_LOCATION_STOCK_INFO}from"./Portals";export var DIRECT_SHIP='directShip';export var DIRECT_SHIP_LABEL='locations.fulfillment.direct_ship';export var IN_STORE_PICKUP_BOPIS='inStorePickupBOPIS';export var IN_STORE_PICKUP_BOPIS_LABEL='locations.fulfillment.bopis';export var IN_STORE_PICKUP_ROPIS='inStorePickupROPIS';export var IN_STORE_PICKUP_ROPIS_LABEL='locations.fulfillment.ropis';export var ROPIS='ROPIS';export var BOPIS='BOPIS';export var QUICK_RESERVE='quickReserve';export var MULTI_LINE_RESERVE='multiLineReserve';export var SORT_CLOSEST_LOCATION='closestLocation';export var SORT_CLOSEST_LOCATION_WITH_INVENTORY='closestLocationWithInventory';export var DEFAULT_ROPE_FULFILLMENT_METHOD='defaultRopeFulfillmentMethod';export var USER_SEARCH_GEOLOCATION_LIFETIME=3e5;// 5 minutes for geolocation expire
5
- export{STAGE_SELECT_STORE,STAGE_RESERVE_FORM,STAGE_RESPONSE_SUCCESS,STAGE_RESPONSE_ERROR,STAGE_FULFILLMENT_METHOD}from"./Stages";export{STORE_FINDER_PATTERN}from"./routes";
5
+ export var NEARBY_LOCATIONS_LIMIT=8;// 25 miles in km
6
+ export var NEARBY_LOCATIONS_RADIUS=25*1.60934;// 10 miles in km
7
+ export var MAP_RADIUS_KM=10*1.60934;export{STAGE_SELECT_STORE,STAGE_RESERVE_FORM,STAGE_RESPONSE_SUCCESS,STAGE_RESPONSE_ERROR,STAGE_FULFILLMENT_METHOD}from"./Stages";export{STORE_FINDER_PATTERN,STORE_DETAILS_PATTERN,STORE_DETAILS_PATH}from"./routes";
@@ -1 +1 @@
1
- export var STORE_FINDER_PATTERN='/storefinder';
1
+ export var STORE_FINDER_PATTERN='/storefinder';export var STORE_DETAILS_PATH='/store-details';export var STORE_DETAILS_PATTERN='/store-details/:code';
@@ -1 +1 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{main$}from'@shopgate/pwa-common/streams';import{Observable}from'rxjs/Observable';import{cartReceived$}from'@shopgate/pwa-common-commerce/cart/streams';import{makeGetRoutePattern,getCurrentState,getCurrentRoute}from'@shopgate/pwa-common/selectors/router';import{routeWillEnter$}from'@shopgate/pwa-common/streams/router';import{ITEM_PATTERN}from'@shopgate/pwa-common-commerce/product/constants';import{getProductDataById}from'@shopgate/pwa-common-commerce/product/selectors/product';import{SEARCH_PATTERN}from'@shopgate/pwa-common-commerce/search/constants';import{CATEGORY_PATTERN}from'@shopgate/pwa-common-commerce/category/constants';import{FAVORITES_PATH}from'@shopgate/pwa-common-commerce/favorites/constants';import{SUBMIT_RESERVATION_SUCCESS,RECEIVE_PRODUCT_LOCATIONS,RECEIVE_LOCATIONS,SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,SET_STORE_FINDER_SEARCH_RADIUS,SELECT_GLOBAL_LOCATION,STORE_FINDER_PATTERN,PROVIDE_PRODUCT_ALTERNATIVE_LOCATION,SELECT_LOCATION}from"./constants";import{RECEIVE_ORDER_DETAILS}from"../orders/constants";import{WISH_LIST_PATH}from"../account/constants";export var submitReservationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUBMIT_RESERVATION_SUCCESS;});export var receiveProductLocations$=main$.filter(function(_ref2){var action=_ref2.action;return action.type===RECEIVE_PRODUCT_LOCATIONS;});export var receiveOrderDetails$=main$.filter(function(_ref3){var action=_ref3.action;return action.type===RECEIVE_ORDER_DETAILS;});export var cartReceivedWithROPE$=cartReceived$.filter(function(_ref4){var _ref4$action$cart=_ref4.action.cart,_ref4$action$cart2=_ref4$action$cart===void 0?{}:_ref4$action$cart,_ref4$action$cart2$ca=_ref4$action$cart2.cartItems,cartItems=_ref4$action$cart2$ca===void 0?[]:_ref4$action$cart2$ca;return cartItems.some(function(item){var _item$fulfillment,_item$fulfillment$loc;return item===null||item===void 0?void 0:(_item$fulfillment=item.fulfillment)===null||_item$fulfillment===void 0?void 0:(_item$fulfillment$loc=_item$fulfillment.location)===null||_item$fulfillment$loc===void 0?void 0:_item$fulfillment$loc.code;});});export var userSearchChanged$=main$.filter(function(_ref5){var action=_ref5.action;return action.type===SET_USER_SEARCH_COUNTRY_CODE||action.type===SET_USER_SEARCH_POSTAL_CODE||action.type===SET_USER_SEARCH_GEOLOCATION||action.type===SET_STORE_FINDER_SEARCH_RADIUS;});export var fulfillmentLocationsReceivedFromProduct$=receiveProductLocations$.switchMap(function(data){var locations=data.action.locations;var locationCodes=locations.map(function(_ref6){var code=_ref6.code;return code;});return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceivedFromCart$=cartReceivedWithROPE$.switchMap(function(data){var _data$action$cart=data.action.cart,_data$action$cart2=_data$action$cart===void 0?{}:_data$action$cart,_data$action$cart2$ca=_data$action$cart2.cartItems,cartItems=_data$action$cart2$ca===void 0?[]:_data$action$cart2$ca;var locationCodes=cartItems.map(function(item){var _item$fulfillment2,_item$fulfillment2$lo;return item===null||item===void 0?void 0:(_item$fulfillment2=item.fulfillment)===null||_item$fulfillment2===void 0?void 0:(_item$fulfillment2$lo=_item$fulfillment2.location)===null||_item$fulfillment2$lo===void 0?void 0:_item$fulfillment2$lo.code;}).filter(Boolean);locationCodes=Array.from(new Set(locationCodes));return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceivedFromOrder$=receiveOrderDetails$.filter(function(_ref7){var _ref7$action$order=_ref7.action.order,_ref7$action$order2=_ref7$action$order===void 0?{}:_ref7$action$order,_ref7$action$order2$l=_ref7$action$order2.lineItems,lineItems=_ref7$action$order2$l===void 0?[]:_ref7$action$order2$l;return lineItems.some(function(item){return item.fulfillmentLocationCode;});}).switchMap(function(data){var _data$action$order=data.action.order,_data$action$order2=_data$action$order===void 0?{}:_data$action$order,_data$action$order2$l=_data$action$order2.lineItems,lineItems=_data$action$order2$l===void 0?[]:_data$action$order2$l;var locationCodes=lineItems.map(function(item){return item===null||item===void 0?void 0:item.fulfillmentLocationCode;}).filter(Boolean);locationCodes=Array.from(new Set(locationCodes));return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceived$=fulfillmentLocationsReceivedFromCart$.merge(fulfillmentLocationsReceivedFromOrder$).merge(fulfillmentLocationsReceivedFromProduct$);export var preferredLocationDidUpdateGlobal$=main$.filter(function(_ref8){var action=_ref8.action;return action.type===SELECT_GLOBAL_LOCATION;});export var preferredLocationDidUpdateGlobalOnWishlist$=preferredLocationDidUpdateGlobal$.filter(function(_ref9){var getState=_ref9.getState;var _getCurrentRoute=getCurrentRoute(getState()),pattern=_getCurrentRoute.pattern;return pattern===FAVORITES_PATH||pattern===WISH_LIST_PATH;});export var preferredLocationDidUpdateGlobalOnSearch$=preferredLocationDidUpdateGlobal$.filter(function(_ref10){var getState=_ref10.getState;var _getCurrentRoute2=getCurrentRoute(getState()),pattern=_getCurrentRoute2.pattern;return pattern===SEARCH_PATTERN;});export var preferredLocationDidUpdateGlobalNotOnSearch$=preferredLocationDidUpdateGlobal$.filter(function(_ref11){var getState=_ref11.getState;var _getCurrentRoute3=getCurrentRoute(getState()),pattern=_getCurrentRoute3.pattern;return pattern!==SEARCH_PATTERN;});export var preferredLocationDidUpdateGlobalOnCategory$=preferredLocationDidUpdateGlobal$.filter(function(_ref12){var getState=_ref12.getState;var _getCurrentRoute4=getCurrentRoute(getState()),pattern=_getCurrentRoute4.pattern;return pattern===CATEGORY_PATTERN;});export var preferredLocationDidUpdateGlobalNotOnCategory$=preferredLocationDidUpdateGlobal$.filter(function(_ref13){var getState=_ref13.getState;var _getCurrentRoute5=getCurrentRoute(getState()),pattern=_getCurrentRoute5.pattern;return pattern!==CATEGORY_PATTERN;});export var preferredLocationDidUpdate$=main$.filter(function(_ref14){var action=_ref14.action;return action.type===SELECT_LOCATION;});export var storeFinderWillEnter$=routeWillEnter$.filter(function(_ref15){var action=_ref15.action;return action.route.pattern===STORE_FINDER_PATTERN;});export var receiveLocations$=main$.filter(function(_ref16){var action=_ref16.action;return action.type===RECEIVE_LOCATIONS;});export var provideAlternativeLocation$=main$.filter(function(_ref17){var action=_ref17.action;return action.type===PROVIDE_PRODUCT_ALTERNATIVE_LOCATION;});export var preferredLocationDidUpdateOnPDP$=preferredLocationDidUpdateGlobal$.filter(function(_ref18){var getState=_ref18.getState;var getRoutePattern=makeGetRoutePattern();var routePattern=getRoutePattern(getState());return routePattern===ITEM_PATTERN;}).switchMap(function(_ref19){var dispatch=_ref19.dispatch,getState=_ref19.getState,action=_ref19.action;var state=getState();var _getCurrentState=getCurrentState(state),productId=_getCurrentState.productId;var productData=getProductDataById(state,{productId:productId});return Observable.of({action:_extends({},action,{productData:productData}),dispatch:dispatch,getState:getState});});
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{main$}from'@shopgate/pwa-common/streams';import{Observable}from'rxjs/Observable';import{cartReceived$}from'@shopgate/pwa-common-commerce/cart/streams';import{makeGetRoutePattern,getCurrentState,getCurrentRoute}from'@shopgate/pwa-common/selectors/router';import{routeWillEnter$}from'@shopgate/pwa-common/streams/router';import{ITEM_PATTERN}from'@shopgate/pwa-common-commerce/product/constants';import{getProductDataById}from'@shopgate/pwa-common-commerce/product/selectors/product';import{SEARCH_PATTERN}from'@shopgate/pwa-common-commerce/search/constants';import{CATEGORY_PATTERN}from'@shopgate/pwa-common-commerce/category/constants';import{FAVORITES_PATH}from'@shopgate/pwa-common-commerce/favorites/constants';import{SUBMIT_RESERVATION_SUCCESS,RECEIVE_PRODUCT_LOCATIONS,RECEIVE_LOCATIONS,SET_USER_SEARCH_COUNTRY_CODE,SET_USER_SEARCH_POSTAL_CODE,SET_USER_SEARCH_GEOLOCATION,SET_STORE_FINDER_SEARCH_RADIUS,SELECT_GLOBAL_LOCATION,STORE_FINDER_PATTERN,PROVIDE_PRODUCT_ALTERNATIVE_LOCATION,SELECT_LOCATION,STORE_DETAILS_PATTERN}from"./constants";import{RECEIVE_ORDER_DETAILS}from"../orders/constants";import{WISH_LIST_PATH}from"../account/constants";export var submitReservationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUBMIT_RESERVATION_SUCCESS;});export var receiveProductLocations$=main$.filter(function(_ref2){var action=_ref2.action;return action.type===RECEIVE_PRODUCT_LOCATIONS;});export var receiveOrderDetails$=main$.filter(function(_ref3){var action=_ref3.action;return action.type===RECEIVE_ORDER_DETAILS;});export var cartReceivedWithROPE$=cartReceived$.filter(function(_ref4){var _ref4$action$cart=_ref4.action.cart,_ref4$action$cart2=_ref4$action$cart===void 0?{}:_ref4$action$cart,_ref4$action$cart2$ca=_ref4$action$cart2.cartItems,cartItems=_ref4$action$cart2$ca===void 0?[]:_ref4$action$cart2$ca;return cartItems.some(function(item){var _item$fulfillment,_item$fulfillment$loc;return item===null||item===void 0?void 0:(_item$fulfillment=item.fulfillment)===null||_item$fulfillment===void 0?void 0:(_item$fulfillment$loc=_item$fulfillment.location)===null||_item$fulfillment$loc===void 0?void 0:_item$fulfillment$loc.code;});});export var userSearchChanged$=main$.filter(function(_ref5){var action=_ref5.action;return action.type===SET_USER_SEARCH_COUNTRY_CODE||action.type===SET_USER_SEARCH_POSTAL_CODE||action.type===SET_USER_SEARCH_GEOLOCATION||action.type===SET_STORE_FINDER_SEARCH_RADIUS;});export var fulfillmentLocationsReceivedFromProduct$=receiveProductLocations$.switchMap(function(data){var locations=data.action.locations;var locationCodes=locations.map(function(_ref6){var code=_ref6.code;return code;});return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceivedFromCart$=cartReceivedWithROPE$.switchMap(function(data){var _data$action$cart=data.action.cart,_data$action$cart2=_data$action$cart===void 0?{}:_data$action$cart,_data$action$cart2$ca=_data$action$cart2.cartItems,cartItems=_data$action$cart2$ca===void 0?[]:_data$action$cart2$ca;var locationCodes=cartItems.map(function(item){var _item$fulfillment2,_item$fulfillment2$lo;return item===null||item===void 0?void 0:(_item$fulfillment2=item.fulfillment)===null||_item$fulfillment2===void 0?void 0:(_item$fulfillment2$lo=_item$fulfillment2.location)===null||_item$fulfillment2$lo===void 0?void 0:_item$fulfillment2$lo.code;}).filter(Boolean);locationCodes=Array.from(new Set(locationCodes));return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceivedFromOrder$=receiveOrderDetails$.filter(function(_ref7){var _ref7$action$order=_ref7.action.order,_ref7$action$order2=_ref7$action$order===void 0?{}:_ref7$action$order,_ref7$action$order2$l=_ref7$action$order2.lineItems,lineItems=_ref7$action$order2$l===void 0?[]:_ref7$action$order2$l;return lineItems.some(function(item){return item.fulfillmentLocationCode;});}).switchMap(function(data){var _data$action$order=data.action.order,_data$action$order2=_data$action$order===void 0?{}:_data$action$order,_data$action$order2$l=_data$action$order2.lineItems,lineItems=_data$action$order2$l===void 0?[]:_data$action$order2$l;var locationCodes=lineItems.map(function(item){return item===null||item===void 0?void 0:item.fulfillmentLocationCode;}).filter(Boolean);locationCodes=Array.from(new Set(locationCodes));return Observable.of(_extends({},data,{locationCodes:locationCodes}));});export var fulfillmentLocationsReceived$=fulfillmentLocationsReceivedFromCart$.merge(fulfillmentLocationsReceivedFromOrder$).merge(fulfillmentLocationsReceivedFromProduct$);export var preferredLocationDidUpdateGlobal$=main$.filter(function(_ref8){var action=_ref8.action;return action.type===SELECT_GLOBAL_LOCATION;});export var preferredLocationDidUpdateGlobalOnWishlist$=preferredLocationDidUpdateGlobal$.filter(function(_ref9){var getState=_ref9.getState;var _getCurrentRoute=getCurrentRoute(getState()),pattern=_getCurrentRoute.pattern;return pattern===FAVORITES_PATH||pattern===WISH_LIST_PATH;});export var preferredLocationDidUpdateGlobalOnSearch$=preferredLocationDidUpdateGlobal$.filter(function(_ref10){var getState=_ref10.getState;var _getCurrentRoute2=getCurrentRoute(getState()),pattern=_getCurrentRoute2.pattern;return pattern===SEARCH_PATTERN;});export var preferredLocationDidUpdateGlobalNotOnSearch$=preferredLocationDidUpdateGlobal$.filter(function(_ref11){var getState=_ref11.getState;var _getCurrentRoute3=getCurrentRoute(getState()),pattern=_getCurrentRoute3.pattern;return pattern!==SEARCH_PATTERN;});export var preferredLocationDidUpdateGlobalOnCategory$=preferredLocationDidUpdateGlobal$.filter(function(_ref12){var getState=_ref12.getState;var _getCurrentRoute4=getCurrentRoute(getState()),pattern=_getCurrentRoute4.pattern;return pattern===CATEGORY_PATTERN;});export var preferredLocationDidUpdateGlobalNotOnCategory$=preferredLocationDidUpdateGlobal$.filter(function(_ref13){var getState=_ref13.getState;var _getCurrentRoute5=getCurrentRoute(getState()),pattern=_getCurrentRoute5.pattern;return pattern!==CATEGORY_PATTERN;});export var preferredLocationDidUpdate$=main$.filter(function(_ref14){var action=_ref14.action;return action.type===SELECT_LOCATION;});export var storeFinderWillEnter$=routeWillEnter$.filter(function(_ref15){var action=_ref15.action;return action.route.pattern===STORE_FINDER_PATTERN;});export var receiveLocations$=main$.filter(function(_ref16){var action=_ref16.action;return action.type===RECEIVE_LOCATIONS;});export var provideAlternativeLocation$=main$.filter(function(_ref17){var action=_ref17.action;return action.type===PROVIDE_PRODUCT_ALTERNATIVE_LOCATION;});export var preferredLocationDidUpdateOnPDP$=preferredLocationDidUpdateGlobal$.filter(function(_ref18){var getState=_ref18.getState;var getRoutePattern=makeGetRoutePattern();var routePattern=getRoutePattern(getState());return routePattern===ITEM_PATTERN;}).switchMap(function(_ref19){var dispatch=_ref19.dispatch,getState=_ref19.getState,action=_ref19.action;var state=getState();var _getCurrentState=getCurrentState(state),productId=_getCurrentState.productId;var productData=getProductDataById(state,{productId:productId});return Observable.of({action:_extends({},action,{productData:productData}),dispatch:dispatch,getState:getState});});export var storeDetailPageWillEnter$=routeWillEnter$.filter(function(_ref20){var action=_ref20.action;return action.route.pattern===STORE_DETAILS_PATTERN;});
@@ -0,0 +1 @@
1
+ import{createContext}from'react';export var StoreDetailsContext=createContext({});
@@ -0,0 +1,4 @@
1
+ import React,{useMemo,useCallback}from'react';import{useSelector}from'react-redux';import PropTypes from'prop-types';import{useRoute}from'@shopgate/engage/core/hooks';import{getPreferredLocation,makeGetLocation,makeGetNearbyLocationsByLocationCode}from"../selectors";import connect from"./StoreFinder.connector";import{StoreDetailsContext}from"./StoreDetailsContext";/**
2
+ * @param {Object} props The component props
3
+ * @returns {JSX}
4
+ */var StoreDetailsProvider=function StoreDetailsProvider(_ref){var children=_ref.children,selectGlobalLocation=_ref.selectGlobalLocation,selectLocation=_ref.selectLocation;var _useRoute=useRoute(),locationCode=_useRoute.params.code;var getLocation=useMemo(function(){return makeGetLocation(function(){return locationCode;});},[locationCode]);var routeLocation=useSelector(getLocation);var preferredLocation=useSelector(getPreferredLocation);var isRouteLocationPreferred=useMemo(function(){return preferredLocation&&routeLocation&&preferredLocation.code===routeLocation.code;},[preferredLocation,routeLocation]);var getNearbyLocations=useMemo(function(){return makeGetNearbyLocationsByLocationCode(locationCode);},[locationCode]);var nearbyLocations=useSelector(getNearbyLocations);var selectLocationCb=useCallback(function(location){selectLocation(location,true);selectGlobalLocation(location);},[selectLocation,selectGlobalLocation]);var value=useMemo(function(){return{preferredLocation:preferredLocation,routeLocation:routeLocation,nearbyLocations:nearbyLocations,isRouteLocationPreferred:isRouteLocationPreferred,selectLocation:selectLocationCb};},[isRouteLocationPreferred,nearbyLocations,preferredLocation,routeLocation,selectLocationCb]);return React.createElement(StoreDetailsContext.Provider,{value:value},children);};StoreDetailsProvider.defaultProps={children:null};export default connect(StoreDetailsProvider);
@@ -1,7 +1,7 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useMemo,useState,useCallback,useEffect}from'react';import PropTypes from'prop-types';import{LoadingProvider}from'@shopgate/pwa-common/providers';import{STORE_FINDER_PATTERN}from"../constants";import{StoreFinderContext}from"../locations.context";import connect from"./StoreFinder.connector";import{useNavigation}from"../../core";/**
1
+ import React,{useMemo,useCallback}from'react';import PropTypes from'prop-types';import{useSelector}from'react-redux';import{LoadingProvider}from'@shopgate/pwa-common/providers';import{getPreferredLocation}from"../selectors";import{STORE_FINDER_PATTERN}from"../constants";import{StoreFinderContext}from"../locations.context";import connect from"./StoreFinder.connector";import{useNavigation}from"../../core";/**
2
2
  * @param {Object} props The component props
3
3
  * @returns {JSX}
4
- */var StoreFinderProvider=function StoreFinderProvider(_ref){var children=_ref.children,locations=_ref.locations,isFetching=_ref.isFetching,shopSettings=_ref.shopSettings,userSearch=_ref.userSearch,storeFinderSearch=_ref.storeFinderSearch,storeListRef=_ref.storeListRef,selectGlobalLocation=_ref.selectGlobalLocation,selectLocation=_ref.selectLocation;var _useNavigation=useNavigation(),pop=_useNavigation.pop;var _useState=useState(null),_useState2=_slicedToArray(_useState,2),selectedLocation=_useState2[0],setSelectedLocation=_useState2[1];var _useState3=useState(null),_useState4=_slicedToArray(_useState3,2),locationsHash=_useState4[0],setLocationsHash=_useState4[1];var changeLocation=useCallback(function(location){var scrollIntoView=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;setSelectedLocation(location);if(scrollIntoView&&storeListRef.current){var container=storeListRef.current;var element=container.querySelector("[data-location-code=\"".concat(location.code,"\"]"));var scrollParams={top:element.parentNode.offsetTop-container.offsetTop-10,behavior:'smooth'};var _getComputedStyle2=getComputedStyle(container),overflowY=_getComputedStyle2.overflowY;if(overflowY==='scroll'){container.scroll(scrollParams);}else{window.scroll(scrollParams);}}},[storeListRef]);var selectLocationCb=useCallback(function(location){setSelectedLocation(location);selectLocation(location);selectGlobalLocation(location);// Back navigation
5
- pop();},[selectLocation,selectGlobalLocation,pop]);useEffect(function(){var hash=JSON.stringify(locations.map(function(_ref2){var code=_ref2.code;return code;}));if(hash!==locationsHash){setLocationsHash(hash);changeLocation(locations[0]);}});/**
4
+ */var StoreFinderProvider=function StoreFinderProvider(_ref){var children=_ref.children,locations=_ref.locations,isFetching=_ref.isFetching,shopSettings=_ref.shopSettings,userSearch=_ref.userSearch,storeFinderSearch=_ref.storeFinderSearch,selectGlobalLocation=_ref.selectGlobalLocation,selectLocation=_ref.selectLocation;var _useNavigation=useNavigation(),pop=_useNavigation.pop;var selectedLocation=useSelector(getPreferredLocation);var selectLocationCb=useCallback(function(location){selectLocation(location,true);selectGlobalLocation(location);// Back navigation
5
+ pop();},[selectLocation,selectGlobalLocation,pop]);/**
6
6
  * @param {bool} loading
7
- */var setIsLoading=useCallback(function(loading){if(loading){LoadingProvider.setLoading(STORE_FINDER_PATTERN);return;}LoadingProvider.unsetLoading(STORE_FINDER_PATTERN);},[]);var value=useMemo(function(){return{locations:locations,selectedLocation:selectedLocation,changeLocation:changeLocation,selectLocation:selectLocationCb,isFetching:isFetching,shopSettings:shopSettings,userSearch:userSearch,storeFinderSearch:storeFinderSearch,setIsLoading:setIsLoading};},[isFetching,locations,changeLocation,selectLocationCb,selectedLocation,shopSettings,storeFinderSearch,userSearch,setIsLoading]);return React.createElement(StoreFinderContext.Provider,{value:value},children);};StoreFinderProvider.defaultProps={children:null,locations:[],storeListRef:null,isFetching:false,shopSettings:null,userSearch:null,storeFinderSearch:null};export default connect(StoreFinderProvider);
7
+ */var setIsLoading=useCallback(function(loading){if(loading){LoadingProvider.setLoading(STORE_FINDER_PATTERN);return;}LoadingProvider.unsetLoading(STORE_FINDER_PATTERN);},[]);var value=useMemo(function(){return{locations:locations,selectedLocation:selectedLocation,selectLocation:selectLocationCb,isFetching:isFetching,shopSettings:shopSettings,userSearch:userSearch,storeFinderSearch:storeFinderSearch,setIsLoading:setIsLoading};},[isFetching,locations,selectLocationCb,selectedLocation,shopSettings,storeFinderSearch,userSearch,setIsLoading]);return React.createElement(StoreFinderContext.Provider,{value:value},children);};StoreFinderProvider.defaultProps={children:null,locations:[],isFetching:false,shopSettings:null,userSearch:null,storeFinderSearch:null};export default connect(StoreFinderProvider);
@@ -1 +1 @@
1
- export{default as FulfillmentProvider,openSheet}from"./FulfillmentProvider";export{default as StoreFinderProvider}from"./StoreFinderProvider";
1
+ export{default as FulfillmentProvider,openSheet}from"./FulfillmentProvider";export{default as StoreFinderProvider}from"./StoreFinderProvider";export{default as StoreDetailsProvider}from"./StoreDetailsProvider";
@@ -1,4 +1,4 @@
1
- var _excluded=["geolocation"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{createSelector}from'reselect';import pickBy from'lodash/pickBy';import{getUserData,getExternalCustomerNumber,getUserId}from'@shopgate/engage/user';import{generateSortedHash}from'@shopgate/pwa-common/helpers/redux/generateSortedHash';import{getProduct}from'@shopgate/engage/product/selectors/product';import{getCurrentRoute}from'@shopgate/pwa-common/selectors/router';import{getIsLocationBasedShopping,makeUseLocationFulfillmentMethods}from'@shopgate/engage/core/selectors';import{makeGetEnabledFulfillmentMethods}from"../../core/config";import{makeIsProductActive,makeIsBaseProductActive}from"../../product/selectors/product";import{isProductAvailable}from"../helpers/productInventory";import{DIRECT_SHIP}from"../constants";/**
1
+ var _excluded=["geolocation"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{createSelector}from'reselect';import pickBy from'lodash/pickBy';import{getExternalCustomerNumber,getUserData,getUserId}from'@shopgate/engage/user';import{generateSortedHash}from'@shopgate/pwa-common/helpers/redux/generateSortedHash';import{getProduct}from'@shopgate/engage/product/selectors/product';import{getCurrentRoute}from'@shopgate/pwa-common/selectors/router';import{getIsLocationBasedShopping,makeUseLocationFulfillmentMethods}from'@shopgate/engage/core/selectors';import{makeGetEnabledFulfillmentMethods}from"../../core/config";import{makeIsProductActive,makeIsBaseProductActive}from"../../product/selectors/product";import{isProductAvailable}from"../helpers/productInventory";import{DIRECT_SHIP,NEARBY_LOCATIONS_LIMIT,NEARBY_LOCATIONS_RADIUS}from"../constants";/**
2
2
  * Selector to retrieve a product's fulfillment methods.
3
3
  * @returns {Function}
4
4
  */export var getProductFulfillmentMethods=createSelector(getProduct,function(product){if(!product||!product.fulfillmentMethods||product.fulfillmentMethods.length===0){return null;}return product.fulfillmentMethods;});/**
@@ -137,4 +137,9 @@ if(!method){try{var available=getProductFulfillmentMethods(state,props);return(a
137
137
  */export var getProductAlternativeLocationParams=createSelector(getUserGeolocation,getUserSearch,getPreferredLocation,function(userGeolocation,userSearch,preferredLocation){if(!userSearch){return null;}var params={countryCode:userSearch.countryCode};if(userGeolocation){params.geolocation=userGeolocation;}else if(userSearch.geolocation){params.geolocation=userSearch.geolocation;}else if(userSearch.postalCode){params.postalCode=userSearch.postalCode;}else if(preferredLocation){params.geolocation={latitude:preferredLocation.latitude,longitude:preferredLocation.longitude};}return params;});/**
138
138
  * @param {Function} getParams get params for fetch locations.
139
139
  * @returns {Array}
140
- */export var getProductAlternativeLocations=createSelector(function(_,props){return props.productId;},function(_,props){return props.params;},getLocationsStorage,getProductAlternativeLocationParams,function(productId,propsParams,storage,alternativeParams){if(!alternativeParams){return null;}var fetchParams=_extends({productCode:productId},alternativeParams,{},propsParams);if(fetchParams.geolocation){fetchParams.latitude=fetchParams.geolocation.latitude;fetchParams.longitude=fetchParams.geolocation.longitude;delete fetchParams.geolocation;}var sortedHash=generateSortedHash(fetchParams);var codes=storage.locationsByFilter[sortedHash];if(!codes){return null;}return codes.map(function(code){return storage.locationsByCode[code];}).map(function(location){var pair=generateSortedHash({productCode:productId,locationCode:location.code});var productInventory=storage.inventoriesByCodePair[pair]||{};if(!productInventory.isAvailable){return null;}return _extends({},location,{productInventory:productInventory});}).filter(Boolean);});
140
+ */export var getProductAlternativeLocations=createSelector(function(_,props){return props.productId;},function(_,props){return props.params;},getLocationsStorage,getProductAlternativeLocationParams,function(productId,propsParams,storage,alternativeParams){if(!alternativeParams){return null;}var fetchParams=_extends({productCode:productId},alternativeParams,{},propsParams);if(fetchParams.geolocation){fetchParams.latitude=fetchParams.geolocation.latitude;fetchParams.longitude=fetchParams.geolocation.longitude;delete fetchParams.geolocation;}var sortedHash=generateSortedHash(fetchParams);var codes=storage.locationsByFilter[sortedHash];if(!codes){return null;}return codes.map(function(code){return storage.locationsByCode[code];}).map(function(location){var pair=generateSortedHash({productCode:productId,locationCode:location.code});var productInventory=storage.inventoriesByCodePair[pair]||{};if(!productInventory.isAvailable){return null;}return _extends({},location,{productInventory:productInventory});}).filter(Boolean);});/**
141
+ * Creates a selector that retrieves nearby locations for a location referenced by a location code.
142
+ * @param {string} locationCode Location code.
143
+ * @returns {Function}
144
+ */export var makeGetNearbyLocationsByLocationCode=function makeGetNearbyLocationsByLocationCode(locationCode){var getFilteredLocationsForRoute=makeGetFilteredLocations(function(state){var routeLocation=makeGetLocation(function(){return locationCode;})(state);return{latitude:routeLocation===null||routeLocation===void 0?void 0:routeLocation.latitude,longitude:routeLocation===null||routeLocation===void 0?void 0:routeLocation.longitude,limit:NEARBY_LOCATIONS_LIMIT,radius:NEARBY_LOCATIONS_RADIUS};});return createSelector(getFilteredLocationsForRoute,function(locations){// remove current location from nearby locations
145
+ var filteredLocations=locations.filter(function(location){return location.code!==locationCode;});return filteredLocations;});};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{getProductsResult,productIsReady$,productsReceived$,productsReceivedCached$,RECEIVE_PRODUCTS_CACHED,variantDidChange$}from'@shopgate/engage/product';import{cartReceived$,fetchCart,cartDidEnter$,getCartItems}from'@shopgate/engage/cart';import{userDidLogin$}from'@shopgate/engage/user';import{appDidStart$,routeWillEnter$,UIEvents,getCurrentRoute,hex2bin,getThemeSettings,getCurrentSearchQuery,appWillInit$,appInitialization}from'@shopgate/engage/core';import{receiveFavoritesWhileVisible$}from'@shopgate/pwa-common-commerce/favorites/streams';import{getFavoritesProductsIds,isFetching}from'@shopgate/pwa-common-commerce/favorites/selectors';import{categoryDidBackEnter$}from'@shopgate/pwa-common-commerce/category/streams';import{searchDidBackEntered$}from'@shopgate/pwa-common-commerce/search/streams';import{hasNewServices}from'@shopgate/engage/core/helpers';import{cookieConsentInitialized$}from'@shopgate/engage/tracking/streams';import{getUserSearch,getStoreFinderSearch,getPreferredLocation,getIsPending,getProductAlternativeLocationParams,getProductAlternativeLocations}from"./selectors";import{fetchDefaultLocation,fetchLocations,fetchProductLocations,sendDefaultLocationCode,setPending,setUserGeolocation}from"./actions";import{setShowInventoryInLists,showInventoryInLists}from"./helpers";import fetchInventories from"./actions/fetchInventories";import{EVENT_SET_OPEN}from"./providers/FulfillmentProvider";import fetchProductInventories from"./actions/fetchProductInventories";import{submitReservationSuccess$,userSearchChanged$,storeFinderWillEnter$,preferredLocationDidUpdateOnPDP$,provideAlternativeLocation$,preferredLocationDidUpdateGlobalOnWishlist$,preferredLocationDidUpdate$}from"./locations.streams";import selectLocation from"./action-creators/selectLocation";import{SET_STORE_FINDER_SEARCH_RADIUS}from"./constants";import selectGlobalLocation from"./action-creators/selectGlobalLocation";var initialLocationsResolve;var initialLocationsReject;var initialLocationsPromise=new Promise(function(resolve,reject){initialLocationsResolve=resolve;initialLocationsReject=reject;});/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{getProductsResult,productIsReady$,productsReceived$,productsReceivedCached$,RECEIVE_PRODUCTS_CACHED,variantDidChange$}from'@shopgate/engage/product';import{ToastProvider,appDidStart$,routeWillEnter$,UIEvents,getCurrentRoute,hex2bin,getThemeSettings,getCurrentSearchQuery,i18n,appWillInit$,appInitialization}from'@shopgate/engage/core';import{cartReceived$,fetchCart,cartDidEnter$,getCartItems}from'@shopgate/engage/cart';import{userDidLogin$}from'@shopgate/engage/user';import{receiveFavoritesWhileVisible$}from'@shopgate/pwa-common-commerce/favorites/streams';import{getFavoritesProductsIds,isFetching}from'@shopgate/pwa-common-commerce/favorites/selectors';import{categoryDidBackEnter$}from'@shopgate/pwa-common-commerce/category/streams';import{searchDidBackEntered$}from'@shopgate/pwa-common-commerce/search/streams';import{hasNewServices}from'@shopgate/engage/core/helpers';import{cookieConsentInitialized$}from'@shopgate/engage/tracking/streams';import{getUserSearch,getStoreFinderSearch,getPreferredLocation,getIsPending,getProductAlternativeLocationParams,getProductAlternativeLocations,makeGetLocation}from"./selectors";import{fetchDefaultLocation,fetchLocations,fetchProductLocations,sendDefaultLocationCode,setPending,setUserGeolocation}from"./actions";import{setShowInventoryInLists,showInventoryInLists}from"./helpers";import fetchInventories from"./actions/fetchInventories";import{EVENT_SET_OPEN}from"./providers/FulfillmentProvider";import fetchProductInventories from"./actions/fetchProductInventories";import{submitReservationSuccess$,userSearchChanged$,storeFinderWillEnter$,preferredLocationDidUpdate$,preferredLocationDidUpdateOnPDP$,provideAlternativeLocation$,preferredLocationDidUpdateGlobalOnWishlist$,storeDetailPageWillEnter$}from"./locations.streams";import selectLocation from"./action-creators/selectLocation";import{NEARBY_LOCATIONS_RADIUS,SET_STORE_FINDER_SEARCH_RADIUS,NEARBY_LOCATIONS_LIMIT}from"./constants";import selectGlobalLocation from"./action-creators/selectGlobalLocation";var initialLocationsResolve;var initialLocationsReject;var initialLocationsPromise=new Promise(function(resolve,reject){initialLocationsResolve=resolve;initialLocationsReject=reject;});/**
2
2
  * Sets a location once the location has been validated.
3
3
  * @param {string} locationCode Location code
4
4
  * @param {Function} dispatch Redux dispatch function
@@ -6,7 +6,7 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){
6
6
  */var setLocationOnceAvailable=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(locationCode,dispatch){var _ref3,initialLocations;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return initialLocationsPromise;case 3:_ref3=_context.sent;initialLocations=_ref3.locations;if(initialLocations.some(function(l){return l.code===locationCode;})){_context.next=7;break;}return _context.abrupt("return");case 7:dispatch(selectLocation({code:locationCode}));requestAnimationFrame(function(){dispatch(setPending(false));});_context.next=13;break;case 11:_context.prev=11;_context.t0=_context["catch"](0);case 13:case"end":return _context.stop();}},_callee,null,[[0,11]]);}));return function setLocationOnceAvailable(_x,_x2){return _ref.apply(this,arguments);};}();/**
7
7
  * Locations subscriptions.
8
8
  * @param {Function} subscribe The subscribe function.
9
- */function locationsSubscriber(subscribe){subscribe(appWillInit$,function(){appInitialization.set('location',/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4){var dispatch;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:dispatch=_ref4.dispatch;if(!hasNewServices()){_context2.next=4;break;}_context2.next=4;return dispatch(fetchDefaultLocation());case 4:case"end":return _context2.stop();}},_callee2);}));return function(_x3){return _ref5.apply(this,arguments);};}());});subscribe(preferredLocationDidUpdate$,function(_ref6){var dispatch=_ref6.dispatch,getState=_ref6.getState;var preferredLocation=getPreferredLocation(getState());if(preferredLocation){dispatch(sendDefaultLocationCode(preferredLocation.code));}});subscribe(cookieConsentInitialized$,/*#__PURE__*/function(){var _ref8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref7){var dispatch,getState,userSearch,_ref10,locations,preferredLocation,code,hasLocation,_ref12,preferredLocationDefault,locationToPreselect;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:dispatch=_ref7.dispatch,getState=_ref7.getState;if(hasNewServices()){_context3.next=3;break;}return _context3.abrupt("return");case 3:// Fetch merchants locations.
9
+ */function locationsSubscriber(subscribe){subscribe(appWillInit$,function(){appInitialization.set('location',/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4){var dispatch;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:dispatch=_ref4.dispatch;if(!hasNewServices()){_context2.next=4;break;}_context2.next=4;return dispatch(fetchDefaultLocation());case 4:case"end":return _context2.stop();}},_callee2);}));return function(_x3){return _ref5.apply(this,arguments);};}());});subscribe(preferredLocationDidUpdate$,function(_ref6){var dispatch=_ref6.dispatch,getState=_ref6.getState,action=_ref6.action,events=_ref6.events;var preferredLocation=getPreferredLocation(getState());if(preferredLocation){dispatch(sendDefaultLocationCode(preferredLocation.code));}var _action$location=action.location,location=_action$location===void 0?{}:_action$location,showToast=action.showToast;if(showToast){events.emit(ToastProvider.ADD,{id:'location.changed',message:i18n.text('location.preferredLocationChanged',{storeName:location===null||location===void 0?void 0:location.name})});}});subscribe(cookieConsentInitialized$,/*#__PURE__*/function(){var _ref8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref7){var dispatch,getState,userSearch,_ref10,locations,preferredLocation,code,hasLocation,_ref12,preferredLocationDefault,locationToPreselect;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:dispatch=_ref7.dispatch,getState=_ref7.getState;if(hasNewServices()){_context3.next=3;break;}return _context3.abrupt("return");case 3:// Fetch merchants locations.
10
10
  userSearch=getUserSearch(getState());_context3.prev=4;_context3.next=7;return dispatch(fetchLocations(userSearch));case 7:_ref10=_context3.sent;locations=_ref10.locations;preferredLocation=getPreferredLocation(getState());if(!preferredLocation){_context3.next=16;break;}code=preferredLocation.code;// Check if the preferred location is included within the fetched locations
11
11
  hasLocation=!!locations.find(function(location){return location.code===code;});if(hasLocation){_context3.next=16;break;}_context3.next=16;return dispatch(fetchLocations({codes:[code]}));case 16:// Preset preferredLocation if configured
12
12
  _ref12=getThemeSettings('@shopgate/engage/locations')||{},preferredLocationDefault=_ref12.preferredLocationDefault;if(preferredLocationDefault){// check if there is already a preferredLocation for the user, if not set one
@@ -24,4 +24,4 @@ userSearch=getUserSearch(state);storeFinderSearch=getStoreFinderSearch(state);_c
24
24
  * Provide alternative location on PDP when preferred location is out of stock
25
25
  */subscribe(alternative$,/*#__PURE__*/function(){var _ref23=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref22){var action,dispatch,getState,state,alternativeLocations,productId,params,alternativeParams,fetchParams;return _regeneratorRuntime.wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:action=_ref22.action,dispatch=_ref22.dispatch,getState=_ref22.getState;_context7.next=3;return dispatch(setUserGeolocation({silent:true}));case 3:// Get new state with geolocation
26
26
  state=getState();alternativeLocations=getProductAlternativeLocations(state,action);if(!alternativeLocations){_context7.next=7;break;}return _context7.abrupt("return");case 7:productId=action.productId,params=action.params;alternativeParams=getProductAlternativeLocationParams(state);fetchParams=_extends({},alternativeParams,{},params);if(fetchParams.geolocation||fetchParams.postalCode){dispatch(fetchProductLocations(productId,fetchParams));}case 11:case"end":return _context7.stop();}},_callee7);}));return function(_x8){return _ref23.apply(this,arguments);};}());subscribe(categoryDidBackEnter$.merge(searchDidBackEntered$),function(_ref24){var _getProductsResult;var action=_ref24.action,dispatch=_ref24.dispatch,getState=_ref24.getState;var state=getState();if(!showInventoryInLists(state)){return;}var categoryId=action.route.params.categoryId;var query=getCurrentSearchQuery(state);var products=(_getProductsResult=getProductsResult(state,{categoryId:hex2bin(categoryId),searchPhrase:query}))===null||_getProductsResult===void 0?void 0:_getProductsResult.products;if(!products||!products.length){return;}var productCodes=products.map(function(_ref25){var id=_ref25.id;return id;});dispatch(fetchInventories(productCodes));});subscribe(productsReceived$.merge(productsReceivedCached$),function(_ref26){var action=_ref26.action,dispatch=_ref26.dispatch,getState=_ref26.getState;if(!showInventoryInLists(getState())){return;}if(!action.products||!action.products.length||(action===null||action===void 0?void 0:action.fetchInventory)===false){return;}var productCodes=action.type!==RECEIVE_PRODUCTS_CACHED?action.products.map(function(_ref27){var id=_ref27.id;return id;}):action.products;dispatch(fetchInventories(productCodes));});subscribe(receiveFavoritesWhileVisible$.merge(preferredLocationDidUpdateGlobalOnWishlist$),function(_ref28){var dispatch=_ref28.dispatch,getState=_ref28.getState;var state=getState();if(!showInventoryInLists(state)||isFetching(getState())){return;}var productIds=getFavoritesProductsIds(state);if(!productIds||!productIds.length){return;}dispatch(fetchInventories(productIds));});subscribe(appDidStart$,function(_ref29){var getState=_ref29.getState;// enable inventory in product lists for some users
27
- setShowInventoryInLists(getState());});}export default locationsSubscriber;
27
+ setShowInventoryInLists(getState());});subscribe(storeDetailPageWillEnter$,/*#__PURE__*/function(){var _ref31=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref30){var dispatch,getState,route,getLocation,location;return _regeneratorRuntime.wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:dispatch=_ref30.dispatch,getState=_ref30.getState;route=getCurrentRoute(getState());getLocation=makeGetLocation(function(){return route.params.code;});location=getLocation(getState());_context8.next=6;return dispatch(fetchLocations({geolocation:{longitude:location.longitude,latitude:location.latitude},limit:NEARBY_LOCATIONS_LIMIT,radius:NEARBY_LOCATIONS_RADIUS}));case 6:case"end":return _context8.stop();}},_callee8);}));return function(_x9){return _ref31.apply(this,arguments);};}());}export default locationsSubscriber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.23.11-beta.2",
3
+ "version": "7.24.0-beta.1",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -16,12 +16,12 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@shopgate/native-modules": "1.0.0-beta.18",
19
- "@shopgate/pwa-common": "7.23.11-beta.2",
20
- "@shopgate/pwa-common-commerce": "7.23.11-beta.2",
21
- "@shopgate/pwa-core": "7.23.11-beta.2",
22
- "@shopgate/pwa-ui-ios": "7.23.11-beta.2",
23
- "@shopgate/pwa-ui-material": "7.23.11-beta.2",
24
- "@shopgate/pwa-ui-shared": "7.23.11-beta.2",
19
+ "@shopgate/pwa-common": "7.24.0-beta.1",
20
+ "@shopgate/pwa-common-commerce": "7.24.0-beta.1",
21
+ "@shopgate/pwa-core": "7.24.0-beta.1",
22
+ "@shopgate/pwa-ui-ios": "7.24.0-beta.1",
23
+ "@shopgate/pwa-ui-material": "7.24.0-beta.1",
24
+ "@shopgate/pwa-ui-shared": "7.24.0-beta.1",
25
25
  "@stripe/react-stripe-js": "^1.16.5",
26
26
  "@stripe/stripe-js": "^1.3.1",
27
27
  "@virtuous/conductor": "~2.5.0",
@@ -30,12 +30,12 @@
30
30
  "color": "^3.1.2",
31
31
  "immer": "^8.0.1",
32
32
  "intersection-observer": "^0.6.0",
33
- "leaflet": "^1.6.0",
34
- "leaflet-gesture-handling": "^1.1.8",
33
+ "leaflet": "^1.8.0",
34
+ "leaflet-gesture-handling": "^1.2.2",
35
35
  "lodash": "^4.17.11",
36
36
  "moment": "^2.27.0",
37
37
  "react-helmet": "^5.1.3",
38
- "react-leaflet": "^2.7.0",
38
+ "react-leaflet": "^3.2.5",
39
39
  "react-phone-number-input": "^3.2.16",
40
40
  "react-player": "1.11.0",
41
41
  "react-portal": "^3.1.0",
@@ -1,3 +1,2 @@
1
- var _typography$family;import{css}from'glamor';import{useScrollContainer,hasWebBridge,isIOSTheme,isWindows,isDev}from'@shopgate/engage/core/helpers';import{themeConfig}from'@shopgate/engage';var typography=themeConfig.typography;var iosThemeActive=isIOSTheme();css.global('*, *:before, *:after',{boxSizing:'border-box'});css.global('*',{touchAction:'manipulation'});css.global('::-moz-focus-inner',{border:0});css.global('html, body',{WebkitTapHighlightColor:'transparent',width:'100%',height:'100%'});css.global('html',{overflow:useScrollContainer()?'hidden':'inherit',MozOsxFontSmoothing:'grayscale',WebkitFontSmoothing:'antialiased',MsTextSizeAdjust:'100%',WebkitTextSizeAdjust:'100%',minHeight:'100%'});// Include Roboto font on Windows in dev mode on iOS theme, so that developers see nice fonts.
2
- var fontSuffix=isDev&&iosThemeActive&&isWindows&&!((_typography$family=typography.family)!==null&&_typography$family!==void 0?_typography$family:'').includes('Roboto')?', Roboto':'';css.global('body',{font:"".concat(typography.rootSize,"px/").concat(typography.lineHeight," ").concat(typography.family).concat(fontSuffix),overflow:'auto',margin:0,WebkitOverflowScrolling:'touch',WebkitUserSelect:hasWebBridge()?'inherit':'none',userSelect:hasWebBridge()?'inherit':'none',color:'var(--color-text-high-emphasis)'});css.global('[data-pattern]',{height:'100% !important'});css.global('html, body',{backgroundColor:'var(--page-background-color)'});if(hasWebBridge()&&!iosThemeActive){css.insert("@media(min-width: 600px) {\n html, body {\n background-color: var(--color-background-gutter-body, var(--page-background-color))\n }\n }");}// since iOS 15 button has a default color of blue rgb(0, 122, 255);
1
+ import{css}from'glamor';import{useScrollContainer,hasWebBridge,isIOSTheme}from'@shopgate/engage/core';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var typography=themeConfig.typography;var iosThemeActive=isIOSTheme();css.global('*, *:before, *:after',{boxSizing:'border-box'});css.global('*',{touchAction:'manipulation'});css.global('::-moz-focus-inner',{border:0});css.global('html, body',{WebkitTapHighlightColor:'transparent',width:'100%',height:'100%'});css.global('html',{overflow:useScrollContainer()?'hidden':'inherit',MozOsxFontSmoothing:'grayscale',WebkitFontSmoothing:'antialiased',MsTextSizeAdjust:'100%',WebkitTextSizeAdjust:'100%',minHeight:'100%'});css.global('body',{font:"".concat(typography.rootSize,"px/").concat(typography.lineHeight," ").concat(typography.family),overflow:'auto',margin:0,WebkitOverflowScrolling:'touch',WebkitUserSelect:hasWebBridge()?'inherit':'none',userSelect:hasWebBridge()?'inherit':'none',color:'var(--color-text-high-emphasis)'});css.global('[data-pattern]',{height:'100% !important'});css.global('html, body',{backgroundColor:'var(--page-background-color)'});if(hasWebBridge()&&!iosThemeActive){css.insert("@media(min-width: 600px) {\n html, body {\n background-color: var(--color-background-gutter-body, var(--page-background-color))\n }\n }");}// since iOS 15 button has a default color of blue rgb(0, 122, 255);
3
2
  css.global('button',{color:'inherit'});
@@ -1,22 +0,0 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}import React from'react';import PropTypes from'prop-types';import{CART_ITEM_TYPE_PRODUCT}from'@shopgate/engage/cart';import{useCartItemProduct}from"./CartItem.hooks";/**
2
- * Provides legacy context for CartItemProduct component and its children.
3
- * Within PWA7 the context was refactored to the new context API. To keep compatibility with
4
- * older extensions, this provider is used to provide the legacy context.
5
- *
6
- * Should be removed when PWA 7 is deployed to all of the shops and affected extensions can be
7
- * updated without the need to support older PWA versions.
8
- */var LegacyProvider=/*#__PURE__*/function(_React$Component){/**
9
- * @param {Object} props The component props.
10
- */function LegacyProvider(props){var _this2;_classCallCheck(this,LegacyProvider);_this2=_callSuper(this,LegacyProvider,[props]);_this2.state={cartItemId:props.cartItemId,product:props.product};return _this2;}/**
11
- * @param {Object} nextProps Next props
12
- * @param {*} prevState Prev state
13
- * @returns {Object|null}
14
- */_inherits(LegacyProvider,_React$Component);return _createClass(LegacyProvider,[{key:"getChildContext",value:/**
15
- * @returns {Object}
16
- */function getChildContext(){return{type:CART_ITEM_TYPE_PRODUCT,cartItemId:this.state.cartItemId,product:this.state.product};}/**
17
- * @returns {JSX.Element}
18
- */},{key:"render",value:function render(){return this.props.children;}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){if(nextProps.cartItemId!==prevState.cartItemId||nextProps.product!==prevState.product){return{cartItemId:nextProps.cartItemId,product:nextProps.product};}return null;}}]);}(React.Component);LegacyProvider.childContextTypes={type:PropTypes.string,cartItemId:PropTypes.string,product:PropTypes.shape()};/**
19
- * Bridges the CartItemProductContext value to the legacy CartItemProduct context.
20
- * @param {Object} props The component props.
21
- * @returns {JSX.Element}
22
- */var CartItemProductProviderLegacy=function CartItemProductProviderLegacy(_ref){var children=_ref.children;var _useCartItemProduct=useCartItemProduct(),cartItemId=_useCartItemProduct.cartItemId,product=_useCartItemProduct.product;return React.createElement(LegacyProvider,{cartItemId:cartItemId,product:product},children);};export default CartItemProductProviderLegacy;
@@ -1,3 +0,0 @@
1
- import _isEmpty from"lodash/isEmpty";import _every from"lodash/every";import React,{Fragment,useMemo,useContext}from'react';import{Grid,I18n}from'@shopgate/engage/components';import{StoreFinderContext}from"../../locations.context";import{StoreAddress}from"../StoreList/StoreAddress";import{StoreOpeningHours}from"../StoreList/StoreOpeningHours";import{StoreHoursToday}from"../StoreList/StoreHoursToday";import{StoreDistance}from"../StoreList/StoreDistance";import StoreFinderGetDirectionsButton from"./StoreFinderGetDirectionsButton";import StoreFinderLocationHeaderPhoneNumber from"./StoreFinderLocationHeaderPhoneNumber";import{container,headingLine,storeName,storeHours,storeDistance,storeDetailsLine,storeAddress,storePhoneNumber,storeOpeningHours,directionButton}from"./StoreFinderLocationDetailsWide.style";import{StoreFinderSelectLocationButton}from"./StoreFinderSelectLocationButton";import{StoreContext}from"./Store.context";/**
2
- * @returns {JSX}
3
- */var StoreFinderLocationDetailsWide=function StoreFinderLocationDetailsWide(){var _useContext=useContext(StoreFinderContext),location=_useContext.selectedLocation,locations=_useContext.locations;var hasOperationHours=useMemo(function(){var _ref=location||{},operationHours=_ref.operationHours;return operationHours&&!_every(operationHours,_isEmpty);},[location]);if(!location||locations.length===0){return null;}return React.createElement(StoreContext.Provider,{value:location},React.createElement("div",{className:container},React.createElement(Grid,{className:headingLine},React.createElement(Grid.Item,{grow:1},React.createElement("div",{className:storeName},location.name),React.createElement("div",{className:storeHours},React.createElement(StoreHoursToday,{hours:location.operationHours,longLabel:true}))),React.createElement(Grid.Item,null,React.createElement("div",{className:storeDistance},React.createElement(StoreDistance,{distance:location.distance,unitSystem:location.unitSystem})),React.createElement(StoreFinderSelectLocationButton,null),React.createElement(StoreFinderGetDirectionsButton,{address:location.address,className:directionButton}))),React.createElement(Grid,{className:storeDetailsLine},React.createElement(Grid.Item,null,React.createElement("div",{className:storeAddress},React.createElement(StoreAddress,{pure:true,address:location.address})),location.address.phoneNumber&&React.createElement("div",{className:storePhoneNumber},React.createElement(I18n.Text,{string:"locations.phone"}),': ',React.createElement(StoreFinderLocationHeaderPhoneNumber,{phone:location.address.phoneNumber,pure:true}))),React.createElement(Grid.Item,{className:storeOpeningHours},hasOperationHours&&React.createElement(Fragment,null,React.createElement(I18n.Text,{string:"locations.store_hours"}),':',React.createElement(StoreOpeningHours,{pure:true,hours:location.operationHours}))))));};export default StoreFinderLocationDetailsWide;
@@ -1 +0,0 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors,variables=themeConfig.variables;export var container=css({background:colors.light,border:"1px solid ".concat(colors.shade7),boxSizing:'border-box',boxShadow:'0px 1px 2px rgba(0, 0, 0, 0.25)',borderRadius:3,padding:variables.gap.big}).toString();var linePadding={paddingBottom:variables.gap.big};export var headingLine=css(_extends({},linePadding,{fontWeight:500,fontSize:'1.125rem',lineHeight:'1.5rem'})).toString();export var storeName=css({paddingBottom:variables.gap.small});export var storeDistance=css({textAlign:'right',':not(:empty)':{paddingBottom:variables.gap.small},' > *':{fontWeight:500,fontSize:'1.125rem',lineHeight:'1.5rem'}}).toString();export var storeHours=css({' > *':{color:'var(--color-text-medium-emphasis)',fontWeight:'normal'}}).toString();export var directionButton=css({minWidth:220}).toString();export var storeDetailsLine=css(_extends({},linePadding,{color:'var(--color-text-medium-emphasis)',justifyContent:'space-between'})).toString();export var storeAddress=css(_extends({},linePadding,{paddingRight:variables.gap.big,fontSize:'1.125rem',lineHeight:'1.5rem'})).toString();export var storePhoneNumber=css({fontSize:'1rem',' a':{color:'var(--color-primary)',textDecoration:'underline'}}).toString();export var storeOpeningHours=css({paddingRight:variables.gap.big,' > *':{color:'var(--color-text-medium-emphasis)'}}).toString();
@@ -1,4 +0,0 @@
1
- import React,{useContext,useMemo,useCallback}from'react';import PropTypes from'prop-types';import"../../assets/leaflet.css";import'leaflet-gesture-handling/dist/leaflet-gesture-handling.css';import Leaflet from'leaflet';import{GestureHandling}from'leaflet-gesture-handling';import{Map,Marker,TileLayer}from'react-leaflet';import{renderToString}from'react-dom/server';import MapMarkerIcon from'@shopgate/pwa-ui-shared/icons/MapMarkerIcon';import{StoreFinderContext}from"../../locations.context";import{container,marker,markerSelected,userPosition as userPositionStyle}from"./StoreFinderMap.style";Leaflet.Map.addInitHook('addHandler','gestureHandling',GestureHandling);/**
2
- * @param {Object} props The component props
3
- * @returns {JSX}
4
- */var StoreFinderMap=function StoreFinderMap(_ref){var showUserPosition=_ref.showUserPosition;var _useContext=useContext(StoreFinderContext),locations=_useContext.locations,selectedLocation=_useContext.selectedLocation,changeLocation=_useContext.changeLocation,userSearch=_useContext.userSearch;var iconHTML=useMemo(function(){return renderToString(React.createElement(MapMarkerIcon,null));},[]);var makerIcon=useMemo(function(){return Leaflet.divIcon({html:iconHTML,className:marker,iconSize:[40,40]});},[iconHTML]);var markerIconSelected=useMemo(function(){return Leaflet.divIcon({html:iconHTML,className:markerSelected,iconSize:[40,40]});},[iconHTML]);var userPositionIcon=useMemo(function(){return Leaflet.divIcon({html:'<div/>',className:userPositionStyle,iconSize:[20,20]});},[]);var positions=useMemo(function(){return locations.map(function(location){var code=location.code,latitude=location.latitude,longitude=location.longitude;var _ref2=selectedLocation||{},selectedCode=_ref2.code;var icon=selectedCode===code?markerIconSelected:makerIcon;return{code:code,location:location,icon:icon,position:[latitude,longitude]};});},[locations,makerIcon,markerIconSelected,selectedLocation]);var userPosition=useMemo(function(){var geolocation=userSearch.geolocation;if(!geolocation||!showUserPosition){return null;}var latitude=geolocation.latitude,longitude=geolocation.longitude;return{icon:userPositionIcon,position:[latitude,longitude]};},[showUserPosition,userPositionIcon,userSearch]);var viewport=useMemo(function(){var _ref3=selectedLocation||locations[0]||{},latitude=_ref3.latitude,longitude=_ref3.longitude;if(!latitude||!longitude){return(userPosition===null||userPosition===void 0?void 0:userPosition.position)||null;}return[latitude,longitude];},[locations,selectedLocation,userPosition]);var onMarkerClick=useCallback(function(event,location){changeLocation(location,true);},[changeLocation]);return React.createElement("div",{className:container},React.createElement(Map,{center:viewport,zoom:15,className:container,gestureHandling:Leaflet.Browser.mobile,touchZoom:true},React.createElement(TileLayer,{attribution:"&copy <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors",url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),positions.map(function(_ref4){var position=_ref4.position,code=_ref4.code,location=_ref4.location,icon=_ref4.icon;return React.createElement(Marker,{key:code,icon:icon,position:position,onclick:function onclick(e){onMarkerClick(e,location);}});}),userPosition&&React.createElement(Marker,{key:"user-position",icon:userPosition.icon,position:userPosition.position})));};StoreFinderMap.defaultProps={showUserPosition:true};export default StoreFinderMap;
@@ -1,2 +0,0 @@
1
- function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{themeColors}from'@shopgate/pwa-common/helpers/config';export var container=css(_defineProperty(_defineProperty({height:'100%',width:'100%'},responsiveMediaQuery('>sm',{appAlways:true}),{borderRadius:3,overflow:'hidden'}),responsiveMediaQuery('<=sm',{appAlways:true}),{// position: 'fixed',
2
- zIndex:10,maxHeight:200}));export var marker=css({' svg':{height:40,width:40,fontSize:'1.5rem',color:"var(--color-text-medium-emphasis, ".concat(themeColors.shade9,")")}}).toString();export var markerSelected=css({' svg':{height:40,width:40,fontSize:'1.5rem',color:"var(--color-primary, ".concat(themeColors.primary,")")}}).toString();var pulseAnimation=css.keyframes({'0%':{boxShadow:'0 0 0 0px rgba(0, 0, 0, 0.2)'},'100%':{boxShadow:'0 0 0 10px rgba(0, 0, 0, 0)'}});export var userPosition=css({' div':{background:'var(--color-secondary)',border:'3px solid #fff',borderRadius:25,height:20,width:20,animation:"".concat(pulseAnimation," 2s infinite")}}).toString();
@@ -1,3 +0,0 @@
1
- import React,{useContext,useMemo}from'react';import{i18n}from'@shopgate/engage/core';import{StoreFinderContext}from"../../locations.context";import{container}from"./StoreFinderStoresNear.style";/**
2
- * @returns {JSX}
3
- */var StoreFinderStoresNear=function StoreFinderStoresNear(){var _useContext=useContext(StoreFinderContext),userSearch=_useContext.userSearch,locations=_useContext.locations;var hasZipCode=!!(userSearch===null||userSearch===void 0?void 0:userSearch.postalCode);var hasGeolocation=!!(userSearch===null||userSearch===void 0?void 0:userSearch.geolocation);var text=useMemo(function(){if(hasZipCode){return i18n.text('locations.stores_near.zip_code',{zipCode:userSearch.postalCode});}if(hasGeolocation){return i18n.text('locations.stores_near.location');}return'';},[hasGeolocation,hasZipCode,userSearch.postalCode]);if(!hasZipCode&&!hasGeolocation||locations.length===0){return React.createElement("div",{className:container});}return React.createElement("div",{className:container},text);};export default StoreFinderStoresNear;
@@ -1 +0,0 @@
1
- import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var container=css({fontSize:'1.125rem',fontWeight:500,color:'var(--color-text-high-emphasis)',padding:"0 ".concat(variables.gap.big,"px ").concat(variables.gap.small,"px ").concat(variables.gap.big,"px")});