@shopgate/engage 7.12.7-beta.1 → 7.20.0-beta.10

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 (504) hide show
  1. package/a11y/components/Section/index.js +2 -2
  2. package/a11y/components/VisuallyHidden/index.js +8 -0
  3. package/a11y/components/index.js +1 -0
  4. package/a11y/constants/index.js +1 -0
  5. package/a11y/helpers/index.js +1 -0
  6. package/a11y/index.js +1 -4
  7. package/account/actions/addContacts.js +2 -2
  8. package/account/actions/deleteContact.js +2 -2
  9. package/account/actions/deleteCustomer.js +2 -2
  10. package/account/actions/fetchContacts.js +2 -2
  11. package/account/actions/fetchCustomer.js +2 -2
  12. package/account/actions/updateContact.js +2 -2
  13. package/account/actions/updateCustomer.js +2 -2
  14. package/account/components/Account/Account.js +1 -1
  15. package/account/components/Account/Account.style.js +1 -1
  16. package/account/components/Profile/Profile.provider.js +3 -3
  17. package/account/components/ProfileContact/ProfileContact.js +1 -1
  18. package/account/reducers/index.js +1 -1
  19. package/app-rating/action-creators/appStart.js +3 -3
  20. package/app-rating/action-creators/ordersPlaced.js +3 -3
  21. package/app-rating/action-creators/popup.js +4 -4
  22. package/app-rating/action-creators/timer.js +3 -3
  23. package/app-rating/actions/showModal.js +6 -6
  24. package/app-rating/constants/index.js +2 -2
  25. package/app-rating/reducers/index.js +2 -2
  26. package/app-rating/subscriptions/index.js +4 -4
  27. package/back-in-stock/actions/index.js +14 -0
  28. package/back-in-stock/components/BackInStockButton/connector.js +1 -0
  29. package/back-in-stock/components/BackInStockButton/index.js +14 -0
  30. package/back-in-stock/components/BackInStockButton/style.js +1 -0
  31. package/back-in-stock/components/CharacteristicsButton/connector.js +3 -0
  32. package/back-in-stock/components/CharacteristicsButton/index.js +8 -0
  33. package/back-in-stock/components/ProductInfoBackInStockButton/connector.js +3 -0
  34. package/back-in-stock/components/ProductInfoBackInStockButton/index.js +10 -0
  35. package/back-in-stock/components/Subscriptions/components/List/index.js +4 -0
  36. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +7 -0
  37. package/back-in-stock/components/Subscriptions/index.js +4 -0
  38. package/back-in-stock/components/index.js +1 -0
  39. package/back-in-stock/constants/Actions.js +1 -0
  40. package/back-in-stock/constants/Common.js +1 -0
  41. package/back-in-stock/constants/Pipelines.js +1 -0
  42. package/back-in-stock/constants/Portals.js +9 -0
  43. package/back-in-stock/constants/index.js +1 -0
  44. package/back-in-stock/hooks/index.js +4 -0
  45. package/back-in-stock/providers/BackInStockSubscriptionsProvider.connector.js +7 -0
  46. package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -0
  47. package/back-in-stock/providers/index.js +1 -0
  48. package/back-in-stock/reducers/index.js +5 -0
  49. package/back-in-stock/selectors/index.js +43 -0
  50. package/back-in-stock/streams/index.js +1 -0
  51. package/back-in-stock/subscriptions/index.js +11 -0
  52. package/cart/cart.helpers.js +9 -2
  53. package/cart/components/CartItem/CartItemCoupon.js +10 -6
  54. package/cart/components/CartItem/CartItemCouponCode.js +2 -2
  55. package/cart/components/CartItem/CartItemCouponDelete.js +1 -1
  56. package/cart/components/CartItem/CartItemCouponFreeShipping.js +1 -1
  57. package/cart/components/CartItem/CartItemCouponIcon.js +2 -2
  58. package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -1
  59. package/cart/components/CartItem/CartItemCouponTitle.js +2 -2
  60. package/cart/components/CartItem/CartItemProductLayout.js +4 -2
  61. package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -1
  62. package/cart/components/CartItem/CartItemProductTitle.js +2 -2
  63. package/cart/components/CartItem/CartItemQuantityPicker.js +26 -14
  64. package/cart/components/CartItem/CartItemSubstitution.js +1 -1
  65. package/cart/components/CartItems/CartItemCardReservation.js +1 -1
  66. package/cart/components/CartItems/CartItemGroupReservation.js +1 -1
  67. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -1
  68. package/cart/components/PaymentBar/PaymentBar.js +1 -1
  69. package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -1
  70. package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +1 -1
  71. package/cart/index.js +3 -2
  72. package/cart/streams/index.js +1 -0
  73. package/category/actions/index.js +1 -0
  74. package/category/components/CategoryList/index.js +7 -0
  75. package/category/components/CategoryList/style.js +1 -0
  76. package/category/components/index.js +1 -1
  77. package/category/constants/index.js +1 -0
  78. package/category/helpers/index.js +1 -0
  79. package/category/index.js +1 -6
  80. package/category/selectors/index.js +2 -0
  81. package/category/streams/index.js +1 -1
  82. package/checkout/actions/errorCheckout.js +1 -1
  83. package/checkout/actions/fetchCheckoutOrder.js +1 -1
  84. package/checkout/actions/fetchPaymentMethods.js +1 -1
  85. package/checkout/actions/initializeCheckout.js +1 -1
  86. package/checkout/actions/prepareCheckout.js +2 -2
  87. package/checkout/actions/submitCheckoutOrder.js +1 -1
  88. package/checkout/actions/updateCheckoutOrder.js +1 -1
  89. package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +1 -1
  90. package/checkout/components/Checkout/CheckoutSectionMessages.js +1 -1
  91. package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +1 -1
  92. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +1 -1
  93. package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +1 -1
  94. package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +1 -1
  95. package/checkout/components/ShippingMethods/ShippingMethods.js +4 -4
  96. package/checkout/components/index.js +1 -1
  97. package/checkout/constants/index.js +1 -1
  98. package/checkout/index.js +3 -4
  99. package/checkout/paymentMethods/index.js +2 -2
  100. package/checkout/paymentMethods/paypal/PaypalButtonApp.js +1 -1
  101. package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +1 -1
  102. package/checkout/paymentMethods/paypal/PaypalPayButton.js +1 -1
  103. package/checkout/paymentMethods/paypal/PaypalProvider.js +1 -1
  104. package/checkout/paymentMethods/stripe/StripeButton.js +2 -2
  105. package/checkout/paymentMethods/stripe/StripeCreditCard.js +3 -3
  106. package/checkout/paymentMethods/stripe/StripeProvider.js +8 -8
  107. package/checkout/paymentMethods/stripe/sdk.js +3 -2
  108. package/checkout/providers/AddressBookProvider.js +1 -1
  109. package/checkout/providers/CheckoutProvider.js +8 -8
  110. package/components/ChipLayout/index.js +38 -0
  111. package/components/ChipLayout/spec.js +5 -0
  112. package/components/ChipLayout/style.js +5 -0
  113. package/components/ConditionalWrapper/ConditionalWrapper.js +7 -2
  114. package/components/Footer/Footer.js +7 -7
  115. package/components/Form/Builder/Builder.js +50 -29
  116. package/components/Form/Builder/ElementCheckbox.js +1 -1
  117. package/components/Form/Builder/ElementMultiSelect.js +1 -1
  118. package/components/Form/Builder/ElementPhoneNumber.js +3 -3
  119. package/components/Form/Builder/ElementRadio.js +1 -1
  120. package/components/Form/Builder/ElementSelect.js +1 -1
  121. package/components/Form/Builder/ElementText.js +3 -3
  122. package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
  123. package/components/Form/Builder/classes/ActionListener.js +73 -16
  124. package/components/Form/Builder/helpers/buildFormElements.js +2 -2
  125. package/components/Form/Form.js +8 -5
  126. package/components/IntersectionVisibility/index.js +14 -7
  127. package/components/Logo/connector.js +4 -0
  128. package/components/Logo/index.js +4 -0
  129. package/components/Logo/spec.js +1 -0
  130. package/components/Logo/style.js +1 -0
  131. package/components/Menu/components/Position/index.js +5 -5
  132. package/components/Menu/index.js +9 -9
  133. package/components/MessageBar/MessageBar.js +1 -1
  134. package/components/MessageBar/index.js +1 -1
  135. package/components/NavigationHandler/index.js +4 -4
  136. package/components/NavigationHandler/spec.js +1 -1
  137. package/components/Picker/components/Button/index.js +1 -1
  138. package/components/Picker/components/List/index.js +2 -2
  139. package/components/Picker/components/Modal/index.js +7 -7
  140. package/components/Picker/index.js +18 -9
  141. package/components/PickerUtilize/components/Button/index.js +5 -0
  142. package/components/PickerUtilize/components/Button/style.js +1 -0
  143. package/components/PickerUtilize/index.js +17 -0
  144. package/components/PickerUtilize/spec.js +1 -0
  145. package/components/PickerUtilize/style.js +1 -0
  146. package/components/QuantityInput/QuantityInput.js +5 -4
  147. package/components/Radio/Radio.js +1 -1
  148. package/components/RadioCard/RadioCard.js +1 -1
  149. package/components/RangeSlider/components/Handle/index.js +1 -1
  150. package/components/RangeSlider/index.js +36 -24
  151. package/components/ResponsiveContainer/ResponsiveContainer.js +2 -6
  152. package/components/ResponsiveContainer/breakpoints.js +2 -1
  153. package/components/ResponsiveContainer/hooks.js +20 -0
  154. package/components/ScrollHeader/index.js +2 -2
  155. package/components/ScrollHeader/style.js +1 -1
  156. package/components/SheetList/components/Item/index.js +5 -5
  157. package/components/SheetList/index.js +4 -4
  158. package/components/SideNavigation/SideNavigationCategories.connector.js +2 -2
  159. package/components/SnackBarContainer/index.js +5 -0
  160. package/components/Switch/index.js +12 -0
  161. package/components/Switch/style.js +1 -0
  162. package/components/Tabs/components/TabIndicator.js +2 -2
  163. package/components/Tabs/components/Tabs.js +1 -1
  164. package/components/TimeBoundary/index.js +8 -6
  165. package/components/VideoPlayer/index.js +9 -6
  166. package/components/View/components/Above/index.js +1 -1
  167. package/components/View/components/Below/index.js +1 -1
  168. package/components/View/components/Content/index.js +18 -11
  169. package/components/View/index.js +1 -1
  170. package/components/View/provider.js +22 -5
  171. package/components/index.js +2 -2
  172. package/core/action-creators/app.js +5 -0
  173. package/core/action-creators/appPermissions.js +9 -0
  174. package/core/action-creators/index.js +1 -1
  175. package/core/actions/getGeolocation.js +2 -2
  176. package/core/actions/grantAppTrackingTransparencyPermission.js +6 -0
  177. package/core/actions/grantCameraPermissions.js +1 -1
  178. package/core/actions/grantGeolocationPermissions.js +1 -1
  179. package/core/actions/grantPermissions.js +13 -6
  180. package/core/actions/grantPushPermissions.js +22 -0
  181. package/core/actions/index.js +7 -0
  182. package/core/actions/requestAppPermission.js +12 -0
  183. package/core/actions/requestAppPermissionStatus.js +12 -0
  184. package/core/classes/GeolocationRequest.js +2 -3
  185. package/core/classes/GeolocationRequestApp.js +6 -6
  186. package/core/classes/GeolocationRequestBrowser.js +2 -2
  187. package/core/classes/index.js +1 -0
  188. package/core/collections/AppInitialization.js +49 -0
  189. package/core/collections/index.js +1 -0
  190. package/core/commands/analyticsSetConsent.js +11 -0
  191. package/core/commands/index.js +1 -0
  192. package/core/config/ThemeConfigResolver.js +2 -2
  193. package/core/config/config.action-creators.js +1 -1
  194. package/core/config/config.actions.js +1 -1
  195. package/core/config/config.reducers.js +1 -1
  196. package/core/config/config.subscriptions.js +2 -2
  197. package/core/config/index.js +1 -1
  198. package/core/constants/actionTypes.js +1 -0
  199. package/core/constants/appFeatures.js +1 -0
  200. package/core/constants/index.js +6 -1
  201. package/core/contexts/index.js +1 -0
  202. package/core/helpers/appFeatures.js +15 -0
  203. package/core/helpers/appPermissions.js +43 -6
  204. package/core/helpers/baseUrl.js +14 -0
  205. package/core/helpers/environment.js +4 -0
  206. package/core/helpers/getFullImageSource.js +1 -1
  207. package/core/helpers/i18n.js +5 -3
  208. package/core/helpers/index.js +7 -0
  209. package/core/hocs/index.js +1 -0
  210. package/core/hocs/withCurrentProduct.js +6 -6
  211. package/core/hocs/withTheme.js +2 -2
  212. package/core/hooks/index.js +1 -0
  213. package/core/hooks/useAsyncMemo.js +1 -1
  214. package/core/hooks/useFormState.js +1 -1
  215. package/core/hooks/useScrollTo.js +1 -1
  216. package/core/hooks/useTheme.js +2 -2
  217. package/core/index.js +5 -52
  218. package/core/initialization/index.js +4 -2
  219. package/core/providers/AppProvider.js +10 -8
  220. package/core/providers/index.js +1 -0
  221. package/core/reducers/app.js +6 -0
  222. package/core/reducers/index.js +1 -1
  223. package/core/reducers/merchantSettings.js +1 -1
  224. package/core/reducers/shopSettings.js +1 -1
  225. package/core/selectors/app.js +9 -0
  226. package/core/selectors/index.js +6 -1
  227. package/core/streams/app.js +8 -0
  228. package/core/streams/appPermissions.js +19 -0
  229. package/core/streams/index.js +4 -0
  230. package/core/subscriptions/app.js +7 -0
  231. package/favorites/components/Item/Item.js +7 -7
  232. package/favorites/components/List/List.js +18 -7
  233. package/favorites/components/List/ListAccordionLabel.js +4 -0
  234. package/favorites/components/List/ListContent.js +8 -0
  235. package/favorites/components/List/ListItemWrapper.js +6 -0
  236. package/favorites/components/List/styles.js +1 -0
  237. package/favorites/components/Lists/Lists.js +5 -5
  238. package/favorites/components/Lists/ListsModal.js +3 -2
  239. package/favorites/constants/index.js +1 -0
  240. package/filter/actions/index.js +1 -0
  241. package/filter/components/PriceSlider/index.js +9 -9
  242. package/filter/components/PriceSlider/style.js +1 -3
  243. package/filter/components/index.js +1 -0
  244. package/filter/constants/index.js +1 -1
  245. package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +9 -0
  246. package/filter/helpers/buildInitialFilters.js +1 -1
  247. package/filter/helpers/buildUpdatedFilters.js +1 -1
  248. package/filter/helpers/index.js +1 -0
  249. package/filter/helpers/translateFilterLabel.js +6 -0
  250. package/filter/index.js +2 -7
  251. package/filter/providers/SortProvider.helpers.js +1 -1
  252. package/filter/selectors/index.js +1 -1
  253. package/filter/streams/index.js +1 -0
  254. package/i18n/locale/cs-cz/countries.json +255 -0
  255. package/i18n/locale/de-de/countries.json +26 -28
  256. package/i18n/locale/el-gr/countries.json +255 -0
  257. package/i18n/locale/en-us/countries.json +12 -14
  258. package/i18n/locale/es-es/countries.json +65 -67
  259. package/i18n/locale/fi-fi/countries.json +255 -0
  260. package/i18n/locale/fr-fr/countries.json +85 -87
  261. package/i18n/locale/hu-hu/countries.json +255 -0
  262. package/i18n/locale/it-it/countries.json +11 -13
  263. package/i18n/locale/nl-nl/countries.json +42 -44
  264. package/i18n/locale/pl-pl/countries.json +255 -0
  265. package/i18n/locale/pt-pt/countries.json +128 -130
  266. package/i18n/locale/ro-ro/countries.json +255 -0
  267. package/i18n/locale/sv-se/countries.json +255 -0
  268. package/locations/action-creators/receiveInventories.js +3 -5
  269. package/locations/actions/fetchFulfillmentSlots.js +1 -1
  270. package/locations/actions/fetchProductLocations.js +2 -2
  271. package/locations/actions/setUserGeolocation.js +1 -1
  272. package/locations/actions/setUserSearchGeolocation.js +1 -1
  273. package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +1 -1
  274. package/locations/components/FulfillmentPath/FulfillmentPath.js +1 -1
  275. package/locations/components/FulfillmentPath/FulfillmentPathItem.js +2 -2
  276. package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +2 -2
  277. package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +1 -1
  278. package/locations/components/FulfillmentSheet/FulfillmentSheet.js +2 -2
  279. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +1 -1
  280. package/locations/components/ReserveForm/ReserveForm.js +1 -1
  281. package/locations/components/ReserveForm/ReserveFormPhone.js +1 -1
  282. package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -1
  283. package/locations/components/StoreFinder/StoreFinderMap.style.js +2 -2
  284. package/locations/components/StoreList/StoreListSearch.js +5 -3
  285. package/locations/locations.streams.js +1 -1
  286. package/locations/providers/FulfillmentProvider.js +4 -4
  287. package/locations/providers/StoreFinderProvider.js +1 -1
  288. package/locations/reducers/storage.js +3 -3
  289. package/locations/selectors/index.js +2 -2
  290. package/locations/subscriptions.js +13 -13
  291. package/login/components/ForgotPassword/ForgotPassword.js +1 -1
  292. package/orders/actions/cancelOrder.js +1 -1
  293. package/orders/actions/fetchOrderDetails.js +1 -1
  294. package/orders/constants/status.js +2 -2
  295. package/orders/index.js +1 -1
  296. package/orders/providers/OrderDetailsPrivateProvider.js +1 -1
  297. package/orders/providers/OrderDetailsProvider.js +3 -3
  298. package/package.json +8 -8
  299. package/page/actions/index.js +1 -0
  300. package/page/components/index.js +1 -0
  301. package/page/constants/index.js +1 -0
  302. package/page/index.js +2 -4
  303. package/page/selectors/index.js +7 -0
  304. package/product/collections/index.js +1 -0
  305. package/product/components/Availability/Availability.connector.js +4 -5
  306. package/product/components/Availability/Availability.js +3 -3
  307. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +20 -0
  308. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +10 -0
  309. package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -0
  310. package/product/components/Characteristics/Characteristic/index.js +18 -0
  311. package/product/components/Characteristics/Characteristic/style.js +1 -0
  312. package/product/components/Characteristics/Swatch/index.js +12 -0
  313. package/product/components/Characteristics/Swatch/style.js +1 -0
  314. package/product/components/Characteristics/index.js +12 -0
  315. package/product/components/Characteristics/transition.js +1 -0
  316. package/product/components/Description/index.js +2 -2
  317. package/product/components/EffectivityDates/helpers.js +3 -3
  318. package/product/components/EffectivityDates/index.js +1 -1
  319. package/product/components/Header/PriceStriked/connector.js +9 -0
  320. package/product/components/Header/PriceStriked/index.js +5 -0
  321. package/product/components/Header/PriceStriked/style.js +1 -0
  322. package/product/components/Header/Shipping/components/Label/index.js +6 -0
  323. package/product/components/Header/Shipping/components/Label/style.js +1 -0
  324. package/product/components/Header/Shipping/connector.js +9 -0
  325. package/product/components/Header/Shipping/index.js +5 -0
  326. package/product/components/Header/Shipping/mock.js +1 -0
  327. package/product/components/Header/Shipping/spec.js +5 -0
  328. package/product/components/Header/Shipping/style.js +1 -0
  329. package/product/components/Header/Tiers/components/Tier/index.js +6 -0
  330. package/product/components/Header/Tiers/components/Tier/spec.js +1 -0
  331. package/product/components/Header/Tiers/connector.js +10 -0
  332. package/product/components/Header/Tiers/index.js +5 -0
  333. package/product/components/Header/Tiers/spec.js +1 -0
  334. package/product/components/Header/Tiers/style.js +1 -0
  335. package/product/components/Header/index.js +1 -0
  336. package/product/components/MapPriceHint/index.js +1 -1
  337. package/product/components/Media/FeaturedMedia.js +1 -1
  338. package/product/components/MediaSlider/index.js +1 -1
  339. package/product/components/Options/components/Content/connector.js +10 -0
  340. package/product/components/Options/components/Content/index.js +16 -0
  341. package/product/components/Options/components/Content/spec.js +2 -0
  342. package/product/components/Options/components/Option/index.js +4 -0
  343. package/product/components/Options/components/TextOption/components/OptionInfo/index.js +9 -0
  344. package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -0
  345. package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -0
  346. package/product/components/Options/components/TextOption/index.js +22 -0
  347. package/product/components/Options/components/TextOption/style.js +1 -0
  348. package/product/components/Options/index.js +5 -0
  349. package/product/components/OrderQuantityHint/index.js +3 -2
  350. package/product/components/OrderQuantityHint/style.js +1 -1
  351. package/product/components/PriceDifference/index.js +1 -1
  352. package/product/components/ProductCard/index.js +2 -2
  353. package/product/components/ProductCharacteristics/helpers/index.js +1 -1
  354. package/product/components/ProductCharacteristics/index.js +28 -12
  355. package/product/components/ProductDiscountBadge/spec.js +1 -1
  356. package/product/components/ProductGridPrice/index.js +2 -2
  357. package/product/components/ProductImage/index.js +15 -12
  358. package/product/components/ProductList/components/Item/index.js +5 -0
  359. package/product/components/ProductList/components/Item/style.js +2 -0
  360. package/product/components/ProductList/components/Iterator/index.js +5 -0
  361. package/product/components/ProductList/components/Iterator/style.js +1 -0
  362. package/product/components/ProductList/components/Layout/index.js +5 -0
  363. package/product/components/ProductList/components/Layout/style.js +1 -0
  364. package/product/components/ProductList/index.js +5 -0
  365. package/product/components/ProductProperties/Content.js +1 -1
  366. package/product/components/ProductProperties/GroupedProperties.js +1 -1
  367. package/product/components/ProductProperties/ListsHTML.js +1 -1
  368. package/product/components/ProductProperties/ProductProperties.js +1 -1
  369. package/product/components/ProductProperties/RowHTML.js +1 -1
  370. package/product/components/ProductProperties/Wrapper.js +1 -1
  371. package/product/components/ProductProperties/style.js +1 -1
  372. package/product/components/ProductSlider/index.js +4 -0
  373. package/product/components/ProductSlider/spec.js +1 -0
  374. package/product/components/ProductSlider/style.js +1 -0
  375. package/product/components/QuantityPicker/hooks.js +5 -0
  376. package/product/components/QuantityPicker/index.js +2 -2
  377. package/product/components/Rating/connector.js +9 -0
  378. package/product/components/Rating/index.js +7 -0
  379. package/product/components/Rating/mock.js +5 -0
  380. package/product/components/Rating/spec.js +5 -0
  381. package/product/components/Rating/style.js +1 -0
  382. package/product/components/Swatch/SwatchContent.js +1 -1
  383. package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -2
  384. package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -2
  385. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +6 -3
  386. package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +7 -0
  387. package/product/components/UnitQuantityPicker/index.js +1 -1
  388. package/product/components/index.js +1 -0
  389. package/product/constants/index.js +1 -1
  390. package/product/contexts/index.js +1 -0
  391. package/product/helpers/index.js +2 -2
  392. package/product/helpers/redirects.js +1 -1
  393. package/product/hocs/index.js +1 -0
  394. package/product/hooks/index.js +1 -0
  395. package/product/index.js +4 -11
  396. package/product/providers/Product/connector.js +5 -0
  397. package/product/providers/Product/index.js +4 -0
  398. package/product/providers/index.js +1 -0
  399. package/product/selectors/product.js +24 -3
  400. package/product/selectors/variants.js +2 -2
  401. package/product/streams/index.js +1 -0
  402. package/push-opt-in/action-creators/index.js +1 -0
  403. package/push-opt-in/action-creators/optInTrigger.js +23 -0
  404. package/push-opt-in/action-creators/pushOptIn.js +7 -0
  405. package/push-opt-in/actions/index.js +1 -0
  406. package/push-opt-in/actions/pushOptInModal.js +8 -0
  407. package/push-opt-in/components/PushOptInModal/connector.js +9 -0
  408. package/push-opt-in/components/PushOptInModal/index.js +9 -0
  409. package/push-opt-in/components/PushOptInModal/push-opt-in.svg +62 -0
  410. package/push-opt-in/components/PushOptInModal/style.js +1 -0
  411. package/push-opt-in/components/index.js +1 -0
  412. package/push-opt-in/constants/index.js +1 -0
  413. package/push-opt-in/constants/optInModal.js +1 -0
  414. package/push-opt-in/constants/optInTrigger.js +1 -0
  415. package/push-opt-in/reducers/index.js +1 -0
  416. package/push-opt-in/reducers/optInModal.js +6 -0
  417. package/push-opt-in/reducers/optInTrigger.js +6 -0
  418. package/push-opt-in/selectors/index.js +1 -0
  419. package/push-opt-in/selectors/optInModal.js +8 -0
  420. package/push-opt-in/selectors/optInTrigger.js +5 -0
  421. package/push-opt-in/subscriptions/index.js +1 -0
  422. package/push-opt-in/subscriptions/optInTrigger.js +12 -0
  423. package/registration/components/index.js +1 -0
  424. package/registration/index.js +1 -1
  425. package/registration/providers/GuestRegistrationProvider.actions.js +2 -2
  426. package/registration/providers/GuestRegistrationProvider.js +3 -3
  427. package/registration/providers/RegistrationProvider.actions.js +3 -3
  428. package/registration/providers/RegistrationProvider.js +2 -2
  429. package/registration/subscriptions/index.js +1 -1
  430. package/reviews/actions/index.js +1 -0
  431. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +1 -1
  432. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -2
  433. package/reviews/components/Reviews/components/List/index.js +3 -3
  434. package/reviews/components/Reviews/components/List/spec.js +1 -1
  435. package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
  436. package/reviews/components/Reviews/components/RatingCount/style.js +1 -2
  437. package/reviews/components/Reviews/components/ReviewsInfo/index.js +1 -2
  438. package/reviews/components/Reviews/spec.js +1 -1
  439. package/reviews/components/index.js +1 -0
  440. package/reviews/constants/index.js +1 -0
  441. package/reviews/index.js +3 -7
  442. package/reviews/selectors/index.js +1 -0
  443. package/reviews/streams/index.js +1 -0
  444. package/scanner/action-creators/index.js +1 -0
  445. package/scanner/actions/index.js +1 -0
  446. package/scanner/classes/index.js +1 -0
  447. package/scanner/constants/index.js +1 -0
  448. package/scanner/helpers/index.js +1 -0
  449. package/scanner/index.js +1 -6
  450. package/scanner/streams/index.js +1 -0
  451. package/search/actions/index.js +1 -0
  452. package/search/constants/index.js +1 -0
  453. package/search/helpers/index.js +1 -0
  454. package/search/index.js +1 -6
  455. package/search/selectors/index.js +1 -0
  456. package/search/streams/index.js +1 -0
  457. package/styles/helpers/index.js +1 -0
  458. package/styles/helpers/initCSSCustomProperties.js +3 -3
  459. package/styles/helpers/loadCustomStyles.js +2 -2
  460. package/styles/helpers/setPageBackgroundColor.js +2 -1
  461. package/styles/helpers/setPageContentWidth.js +2 -1
  462. package/styles/index.js +1 -1
  463. package/tracking/action-creators/cookieConsent.js +24 -0
  464. package/tracking/action-creators/index.js +1 -4
  465. package/tracking/actions/cookieConsent.js +21 -0
  466. package/tracking/actions/index.js +1 -0
  467. package/tracking/components/CookieConsentModal/connector.js +6 -0
  468. package/tracking/components/CookieConsentModal/index.js +9 -0
  469. package/tracking/components/CookieConsentModal/style.js +1 -0
  470. package/tracking/components/CookieConsentModal/tracking-opt-in.svg +18 -0
  471. package/tracking/components/PrivacySettings/connector.js +6 -0
  472. package/tracking/components/PrivacySettings/index.js +4 -0
  473. package/tracking/components/PrivacySettings/style.js +1 -0
  474. package/tracking/components/index.js +1 -1
  475. package/tracking/constants/index.js +1 -1
  476. package/tracking/reducers/cookieConsentModal.js +6 -0
  477. package/tracking/reducers/cookieSettings.js +6 -0
  478. package/tracking/reducers/index.js +1 -0
  479. package/tracking/selectors/cookieConsent.js +35 -0
  480. package/tracking/selectors/index.js +1 -4
  481. package/tracking/streams/cookieConsent.js +46 -0
  482. package/tracking/streams/index.js +1 -1
  483. package/tracking/subscriptions/analytics.js +11 -0
  484. package/tracking/subscriptions/cookieConsent.js +13 -0
  485. package/tracking/subscriptions/index.js +1 -4
  486. package/components/MessageBar/MessageBar.types.js +0 -0
  487. package/components/MessageBar/style.js +0 -1
  488. package/i18n/locale/ru-ru/countries.json +0 -251
  489. package/product/components/Availability/Availability.types.js +0 -1
  490. package/product/components/QuantityPicker/helpers.js +0 -5
  491. package/tracking/components/CookieConsent/CookieConsent.connector.js +0 -4
  492. package/tracking/components/CookieConsent/CookieConsent.js +0 -4
  493. package/tracking/components/CookieConsent/CookieConsentButtons.js +0 -3
  494. package/tracking/components/CookieConsent/CookieConsentCheckboxes.js +0 -3
  495. package/tracking/components/CookieConsent/CookieConsentContent.js +0 -4
  496. package/tracking/components/CookieConsent/CookieConsentMessage.js +0 -4
  497. package/tracking/components/CookieConsent/index.js +0 -1
  498. package/tracking/helpers/index.js +0 -7
  499. package/tracking/hooks/index.js +0 -4
  500. package/tracking/index.js +0 -1
  501. package/tracking/providers/CookieConsentProvider.connector.js +0 -4
  502. package/tracking/providers/CookieConsentProvider.js +0 -8
  503. /package/{tracking/providers/CookieConsentProvider.context.js → back-in-stock/providers/BackInStockSubscriptionsProvider.context.js} +0 -0
  504. /package/page/{NotFound.js → components/NotFound.js} +0 -0
@@ -1,4 +1,4 @@
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);}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;}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;}import React,{useRef,useState,useMemo,useLayoutEffect}from'react';import PropTypes from'prop-types';import kebabCase from'lodash/kebabCase';import{I18n}from'@shopgate/engage/components';/**
1
+ var _excluded=["title","titleParams","children"];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 _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;}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;}import React,{useRef,useState,useMemo,useLayoutEffect}from'react';import PropTypes from'prop-types';import kebabCase from'lodash/kebabCase';import{I18n}from'@shopgate/engage/components';/**
2
2
  * Checks the section ref has suitable child nodes.
3
3
  * @param {Object} ref A React ref.
4
4
  * @param {string} headlineId The ID of the section headline.
@@ -14,4 +14,4 @@ var childNodes=[].filter.call(ref.current.childNodes,function(el){return el.getA
14
14
  * @param {Object} [props.className=null] A class name for the section.
15
15
  * @param {NodeList} [props.children=null] Component children.
16
16
  * @returns {JSX}
17
- */function Section(props){var title=props.title,titleParams=props.titleParams,children=props.children,className=props.className,rest=_objectWithoutProperties(props,["title","titleParams","children","className"]);var contentRef=useRef(null);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasContent=_useState2[0],setHasContent=_useState2[1];var id=useMemo(function(){return kebabCase(title);},[title]);var observer=useMemo(function(){return new MutationObserver(function(){setHasContent(hasChildNodes(contentRef,id));});},[contentRef,id]);useLayoutEffect(function(){setHasContent(hasChildNodes(contentRef,id));observer.observe(contentRef.current,{childList:true});return function(){observer.disconnect();};},[contentRef,id,observer]);if(!hasContent){return React.createElement("section",_extends({},rest,{ref:contentRef}),children);}return React.createElement("section",_extends({},rest,{ref:contentRef,"aria-labelledby":id}),React.createElement("h2",{id:id,hidden:true},React.createElement(I18n.Text,{string:title,params:titleParams})),children);}Section.defaultProps={children:null,className:null,titleParams:{}};export default Section;
17
+ */function Section(props){var title=props.title,titleParams=props.titleParams,children=props.children,rest=_objectWithoutProperties(props,_excluded);var contentRef=useRef(null);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasContent=_useState2[0],setHasContent=_useState2[1];var id=useMemo(function(){return kebabCase(title);},[title]);var observer=useMemo(function(){return new MutationObserver(function(){setHasContent(hasChildNodes(contentRef,id));});},[contentRef,id]);useLayoutEffect(function(){setHasContent(hasChildNodes(contentRef,id));observer.observe(contentRef.current,{childList:true});return function(){observer.disconnect();};},[contentRef,id,observer]);if(!hasContent){return React.createElement("section",_extends({},rest,{ref:contentRef}),children);}return React.createElement("section",_extends({},rest,{ref:contentRef,"aria-labelledby":id}),React.createElement("h2",{id:id,hidden:true},React.createElement(I18n.Text,{string:title,params:titleParams})),children);}Section.defaultProps={children:null,className:'',titleParams:{}};export default Section;
@@ -0,0 +1,8 @@
1
+ import React from'react';import PropTypes from'prop-types';import{css}from'glamor';var styles={root:css({position:'absolute !important',height:'1px',width:'1px',overflow:'hidden',clip:'rect(1px, 1px, 1px, 1px)',whiteSpace:'nowrap'})};/**
2
+ * This component surrounds its children with a wrapper that takes care that they are not visible
3
+ * on the screen, but still accessible by a screen reader.
4
+ * @param {Object} props The component props
5
+ * @param {Object} [props.tag='span'] The tag to be used for the component
6
+ * @param {Object} props.children Component children
7
+ * @returns {JSX.Element}
8
+ */var VisuallyHidden=function VisuallyHidden(_ref){var _ref$tag=_ref.tag,tag=_ref$tag===void 0?'span':_ref$tag,children=_ref.children;return React.createElement(tag,{className:styles.root},children);};VisuallyHidden.defaultProps={tag:'span'};export default VisuallyHidden;
@@ -0,0 +1 @@
1
+ export{default as LiveMessage}from"./LiveMessage";export{default as LiveMessenger}from"./LiveMessenger";export{default as Navigation}from"./Navigation";export{default as Section}from"./Section";export{default as VisuallyHidden}from"./VisuallyHidden";
@@ -0,0 +1 @@
1
+ export*from"../components/LiveMessenger/constants";
@@ -0,0 +1 @@
1
+ export*from"../components/LiveMessenger/helpers";
package/a11y/index.js CHANGED
@@ -1,4 +1 @@
1
- /** @module a11y */ // Components
2
- export{default as LiveMessage}from"./components/LiveMessage";export{default as LiveMessenger}from"./components/LiveMessenger";export{default as Navigation}from"./components/Navigation";export{default as Section}from"./components/Section";// Helpers
3
- export*from"./components/LiveMessenger/helpers";// Constants
4
- export*from"./components/LiveMessenger/constants";
1
+ /** @module a11y */export*from"./components";export*from"./constants";export*from"./helpers";
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{ADD_CUSTOMER_CONTACT,ADD_CUSTOMER_CONTACT_SUCCESS,ADD_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
- */export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:ADD_CUSTOMER_CONTACT,contacts:contacts});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.addContacts').setTrusted().setInput({contacts:contacts}).dispatch();case 4:response=_context.sent;dispatch({type:ADD_CUSTOMER_CONTACT_SUCCESS,contacts:contacts});_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:ADD_CUSTOMER_CONTACT_ERROR,contacts:contacts,error:_context.t0});throw _context.t0;case 12:return _context.abrupt("return",response);case 13:case"end":return _context.stop();}}},_callee,null,[[1,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
4
+ */export var addCustomerContacts=function addCustomerContacts(_ref){var contacts=_ref.contacts;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var response;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:ADD_CUSTOMER_CONTACT,contacts:contacts});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.addContacts').setTrusted().setInput({contacts:contacts}).dispatch();case 4:response=_context.sent;dispatch({type:ADD_CUSTOMER_CONTACT_SUCCESS,contacts:contacts});_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:ADD_CUSTOMER_CONTACT_ERROR,contacts:contacts,error:_context.t0});throw _context.t0;case 12:return _context.abrupt("return",response);case 13:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{DELETE_CUSTOMER_CONTACT,DELETE_CUSTOMER_CONTACT_SUCCESS,DELETE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @param {Object} contactId Contact
4
4
  * @returns {Function}
5
- */export var deleteCustomerContact=function deleteCustomerContact(contactId){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER_CONTACT});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteContact').setInput({contactId:contactId}).setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_CONTACT_ERROR,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
5
+ */export var deleteCustomerContact=function deleteCustomerContact(contactId){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER_CONTACT});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteContact').setInput({contactId:contactId}).setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_CONTACT_ERROR,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{successLogout}from'@shopgate/pwa-common/action-creators/user';import{DELETE_CUSTOMER,DELETE_CUSTOMER_SUCCESS,DELETE_CUSTOMER_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
- */export var deleteCustomer=function deleteCustomer(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteCustomer').setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_SUCCESS});dispatch(successLogout(false));_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 12:case"end":return _context.stop();}}},_callee,null,[[1,8]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
4
+ */export var deleteCustomer=function deleteCustomer(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:DELETE_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.deleteCustomer').setTrusted().dispatch();case 4:dispatch({type:DELETE_CUSTOMER_SUCCESS});dispatch(successLogout(false));_context.next=12;break;case 8:_context.prev=8;_context.t0=_context["catch"](1);dispatch({type:DELETE_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 12:case"end":return _context.stop();}},_callee,null,[[1,8]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
- */export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref2,contacts;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER_CONTACTS});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getContacts').setTrusted().dispatch();case 4:_ref2=_context.sent;contacts=_ref2.contacts;dispatch({type:FETCH_CUSTOMER_CONTACTS_SUCCESS,contacts:contacts});return _context.abrupt("return",contacts);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_CONTACTS_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
4
+ */export var fetchCustomerContacts=function fetchCustomerContacts(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,contacts;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER_CONTACTS});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getContacts').setTrusted().dispatch();case 4:_ref3=_context.sent;contacts=_ref3.contacts;dispatch({type:FETCH_CUSTOMER_CONTACTS_SUCCESS,contacts:contacts});return _context.abrupt("return",contacts);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_CONTACTS_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{FETCH_CUSTOMER,FETCH_CUSTOMER_ERROR,FETCH_CUSTOMER_SUCCESS}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
- */export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref2,customer;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getCustomer').setTrusted().dispatch();case 4:_ref2=_context.sent;customer=_ref2.customer;dispatch({type:FETCH_CUSTOMER_SUCCESS,customer:customer});return _context.abrupt("return",customer);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
4
+ */export var fetchCustomerData=function fetchCustomerData(){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref3,customer;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:FETCH_CUSTOMER});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.getCustomer').setTrusted().dispatch();case 4:_ref3=_context.sent;customer=_ref3.customer;dispatch({type:FETCH_CUSTOMER_SUCCESS,customer:customer});return _context.abrupt("return",customer);case 10:_context.prev=10;_context.t0=_context["catch"](1);dispatch({type:FETCH_CUSTOMER_ERROR,error:_context.t0});throw _context.t0;case 14:case"end":return _context.stop();}},_callee,null,[[1,10]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER_CONTACT,UPDATE_CUSTOMER_CONTACT_SUCCESS,UPDATE_CUSTOMER_CONTACT_ERROR}from"../constants/actions";/**
2
2
  * Starts entering the checkout process for the customer.
3
3
  * @returns {Function}
4
- */export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER_CONTACT,contactId:contactId,contact:contact});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateContact').setTrusted().setInput({contactId:contactId,contact:contact}).dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_CONTACT_ERROR,contactId:contactId,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}}},_callee,null,[[1,7]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
4
+ */export var updateCustomerContact=function updateCustomerContact(_ref){var contactId=_ref.contactId,contact=_ref.contact;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER_CONTACT,contactId:contactId,contact:contact});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateContact').setTrusted().setInput({contactId:contactId,contact:contact}).dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_CONTACT_SUCCESS,contactId:contactId});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_CONTACT_ERROR,contactId:contactId,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref2.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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{PipelineRequest}from'@shopgate/engage/core/classes';import{UPDATE_CUSTOMER,UPDATE_CUSTOMER_SUCCESS,UPDATE_CUSTOMER_ERROR}from"../constants/actions";/**
2
2
  * @param {Object} customer Customer
3
3
  * @returns {Function}
4
- */export var updateCustomerData=function updateCustomerData(customer){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER,customer:customer});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateCustomer').setInput({customer:customer}).setTrusted().dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_SUCCESS,customer:customer});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_ERROR,customer:customer,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
4
+ */export var updateCustomerData=function updateCustomerData(customer){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch({type:UPDATE_CUSTOMER,customer:customer});_context.prev=1;_context.next=4;return new PipelineRequest('shopgate.customer.updateCustomer').setInput({customer:customer}).setTrusted().dispatch();case 4:dispatch({type:UPDATE_CUSTOMER_SUCCESS,customer:customer});_context.next=11;break;case 7:_context.prev=7;_context.t0=_context["catch"](1);dispatch({type:UPDATE_CUSTOMER_ERROR,customer:customer,error:_context.t0});throw _context.t0;case 11:case"end":return _context.stop();}},_callee,null,[[1,7]]);}));return function(_x){return _ref.apply(this,arguments);};}());};
@@ -1,4 +1,4 @@
1
1
  import React from'react';import PropTypes from'prop-types';import{hot}from'react-hot-loader/root';import I18n from'@shopgate/pwa-common/components/I18n';import appConfig from'@shopgate/pwa-common/helpers/config';import{i18n,useRoute}from'@shopgate/engage/core';import OrderHistory from"../../../orders/components/OrderHistory";import OrderHistoryProvider from"../../../orders/providers/OrderHistoryProvider";import{Tabs,Tab,TabPanel}from"../../../components/Tabs";import{tabs,title,tabPanel}from"./Account.style";import{ResponsiveContainer}from"../../../components";import Lists from"../../../favorites/components/Lists";import connect from"./Account.connector";import{TabContext}from"../../../components/Tabs/TabContext";import Profile from"../Profile";/**
2
2
  * The Tabs components
3
3
  * @returns {JSX}
4
- */var Account=function Account(_ref){var historyReplace=_ref.historyReplace;var _useRoute=useRoute(),_useRoute$params$tab=_useRoute.params.tab,tab=_useRoute$params$tab===void 0?'profile':_useRoute$params$tab;return React.createElement(React.Fragment,null,React.createElement(TabContext,{value:tab},React.createElement("div",{className:tabs},React.createElement(ResponsiveContainer,{webOnly:true,breakpoint:">xs"},React.createElement("div",{className:title},React.createElement(I18n.Text,{string:"titles.your_account"}))),React.createElement(Tabs,{indicatorColor:"primary",textColor:"primary",onChange:function onChange(event,newValue){return historyReplace({pathname:"/account/".concat(newValue)});},"aria-label":"disabled tabs example"},React.createElement(Tab,{value:"profile",label:i18n.text('titles.profile')}),React.createElement(Tab,{value:"orders",label:i18n.text('titles.order_history')}),appConfig.hasFavorites?React.createElement(Tab,{value:"wish-list",label:i18n.text('titles.wish_list')}):null)),React.createElement(TabPanel,{className:tabPanel,value:"profile"},React.createElement(Profile,null)),React.createElement(TabPanel,{className:tabPanel,value:"orders"},React.createElement(OrderHistoryProvider,null,React.createElement(OrderHistory,null))),appConfig.hasFavorites?React.createElement(TabPanel,{className:tabPanel,value:"wish-list"},React.createElement(Lists,null)):null));};export default hot(connect(Account));
4
+ */var Account=function Account(_ref){var historyReplace=_ref.historyReplace;var _useRoute=useRoute(),_useRoute$params$tab=_useRoute.params.tab,tab=_useRoute$params$tab===void 0?'profile':_useRoute$params$tab;return React.createElement(React.Fragment,null,React.createElement(TabContext,{value:tab},React.createElement("div",{className:tabs},React.createElement(ResponsiveContainer,{webOnly:true,breakpoint:">xs"},React.createElement("div",{className:title},React.createElement(I18n.Text,{string:"titles.your_account"}))),React.createElement(Tabs,{indicatorColor:"primary",textColor:"primary",onChange:function onChange(event,newValue){return historyReplace({pathname:"/account/".concat(newValue)});},"aria-label":"disabled tabs example"},React.createElement(Tab,{value:"profile",label:i18n.text('titles.profile')}),React.createElement(Tab,{value:"orders",label:i18n.text('titles.order_history')}),appConfig.hasFavorites?React.createElement(Tab,{value:"wish-list",label:i18n.text('titles.favorites')}):null)),React.createElement(TabPanel,{className:tabPanel,value:"profile"},React.createElement(Profile,null)),React.createElement(TabPanel,{className:tabPanel,value:"orders"},React.createElement(OrderHistoryProvider,null,React.createElement(OrderHistory,null))),appConfig.hasFavorites?React.createElement(TabPanel,{className:tabPanel,value:"wish-list"},React.createElement(Lists,null)):null));};export default hot(connect(Account));
@@ -1 +1 @@
1
- var _css;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 title=css({fontSize:'1.5rem',padding:variables.gap.big}).toString();export var tabs=css((_css={width:'100%',top:0},_defineProperty(_css,responsiveMediaQuery('>xs',{webOnly:true}),{top:64}),_defineProperty(_css,responsiveMediaQuery('<=xs',{webOnly:true}),{top:56}),_defineProperty(_css,"position",'sticky'),_defineProperty(_css,"background",'rgb(255, 255, 255)'),_defineProperty(_css,"boxShadow",'2px 1px 6px rgba(0, 0, 0, 0.118), 2px 1px 4px rgba(0, 0, 0, 0.118)'),_defineProperty(_css,"zIndex",100),_css)).toString();export var tabPanel=css({padding:variables.gap.small}).toString();
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 title=css({fontSize:'1.5rem',padding:variables.gap.big}).toString();export var tabs=css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({width:'100%',top:0},responsiveMediaQuery('>xs',{webOnly:true}),{top:64}),responsiveMediaQuery('<=xs',{webOnly:true}),{top:56}),"position",'sticky'),"background",'rgb(255, 255, 255)'),"boxShadow",'2px 1px 6px rgba(0, 0, 0, 0.118), 2px 1px 4px rgba(0, 0, 0, 0.118)'),"zIndex",100)).toString();export var tabPanel=css({padding:variables.gap.small}).toString();
@@ -11,12 +11,12 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
11
11
  */var ProfileProvider=function ProfileProvider(_ref){var fetchContacts=_ref.fetchContacts,deleteContact=_ref.deleteContact,fetchCustomer=_ref.fetchCustomer,updateCustomer=_ref.updateCustomer,deleteCustomer=_ref.deleteCustomer,push=_ref.push,showDialog=_ref.showDialog,contacts=_ref.contacts,customer=_ref.customer,merchantCustomerAttributes=_ref.merchantCustomerAttributes,children=_ref.children,shopSettings=_ref.shopSettings,userLocation=_ref.userLocation,formContainerRef=_ref.formContainerRef;// Route
12
12
  var _useRoute=useRoute(),pathname=_useRoute.pathname;var _useAddressBook=useAddressBook(),isCheckout=_useAddressBook.isCheckout,type=_useAddressBook.type,deleteContactFromOrder=_useAddressBook.deleteContactFromOrder;var _useState=useState(null),_useState2=_slicedToArray(_useState,2),requestErrors=_useState2[0],setRequestErrors=_useState2[1];// Default state.
13
13
  var defaultState=useMemo(function(){return customer?_extends({},customer,{marketingOptIn:customer.settings.marketingOptIn||false},extractDefaultValues(customer.attributes)):null;},[customer]);// Saving the form.
14
- var saveForm=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var attributes,validationErrors,code,errors,converted,_converted$validation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);attributes=extractAttributes(merchantCustomerAttributes,values);_context.prev=2;_context.next=5;return updateCustomer(_extends({firstName:values.firstName},values.middleName?{middleName:values.middleName}:{},{lastName:values.lastName,emailAddress:values.emailAddress,settings:{marketingOptIn:values.marketingOptIn},attributes:attributes}));case 5:_context.next=7;return fetchCustomer();case 7:UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.success',message:'account.profile.form.success'});_context.next=15;break;case 10:_context.prev=10;_context.t0=_context["catch"](2);code=_context.t0.code,errors=_context.t0.errors;if(code===EVALIDATION){converted=convertPipelineValidationErrors(errors,attributes);if((converted===null||converted===void 0?void 0:converted.validation)&&Object.keys(converted.validation).length>0){validationErrors=converted===null||converted===void 0?void 0:(_converted$validation=converted.validation)===null||_converted$validation===void 0?void 0:_converted$validation.attributes;}}UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.error',message:'account.profile.form.error'});case 15:setRequestErrors(validationErrors||null);LoadingProvider.unsetLoading(pathname);case 17:case"end":return _context.stop();}}},_callee,null,[[2,10]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[fetchCustomer,merchantCustomerAttributes,pathname,updateCustomer]);// Hold profile form state.
14
+ var saveForm=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var attributes,validationErrors,code,errors,converted,_converted$validation;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);attributes=extractAttributes(merchantCustomerAttributes,values);_context.prev=2;_context.next=5;return updateCustomer(_extends({firstName:values.firstName},values.middleName?{middleName:values.middleName}:{},{lastName:values.lastName,emailAddress:values.emailAddress,settings:{marketingOptIn:values.marketingOptIn},attributes:attributes}));case 5:_context.next=7;return fetchCustomer();case 7:UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.success',message:'account.profile.form.success'});_context.next=15;break;case 10:_context.prev=10;_context.t0=_context["catch"](2);code=_context.t0.code,errors=_context.t0.errors;if(code===EVALIDATION){converted=convertPipelineValidationErrors(errors,attributes);if((converted===null||converted===void 0?void 0:converted.validation)&&Object.keys(converted.validation).length>0){validationErrors=converted===null||converted===void 0?void 0:(_converted$validation=converted.validation)===null||_converted$validation===void 0?void 0:_converted$validation.attributes;}}UIEvents.emit(ToastProvider.ADD,{id:'account.profile.form.error',message:'account.profile.form.error'});case 15:setRequestErrors(validationErrors||null);LoadingProvider.unsetLoading(pathname);case 17:case"end":return _context.stop();}},_callee,null,[[2,10]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[fetchCustomer,merchantCustomerAttributes,pathname,updateCustomer]);// Hold profile form state.
15
15
  var constraints=useMemo(function(){return createConstraints(merchantCustomerAttributes);},[merchantCustomerAttributes]);var formState=useForm(defaultState,saveForm,constraints,formContainerRef,120);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||requestErrors||{});},[formState.validationErrors,requestErrors]);useEffect(function(){formState.scrollToError();// eslint-disable-next-line react-hooks/exhaustive-deps
16
16
  },[formState.scrollToError,requestErrors]);/**
17
17
  * Executes callback with confirmation beforehand.
18
18
  * @param {string} message String
19
- */var confirmation=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message){var confirmed;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.next=2;return showDialog({title:i18n.text('account.profile.confirm.title'),message:i18n.text(message),confirm:i18n.text('account.profile.confirm.confirm')});case 2:confirmed=_context2.sent;return _context2.abrupt("return",!!confirmed);case 4:case"end":return _context2.stop();}}},_callee2);}));return function confirmation(_x2){return _ref3.apply(this,arguments);};}();// Deletes a contact.
20
- /* eslint-disable react-hooks/exhaustive-deps */var deleteContactWrapper=useCallback(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(contactId){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.next=2;return confirmation('account.profile.confirm.messageContact');case 2:if(_context3.sent){_context3.next=4;break;}return _context3.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context3.prev=5;_context3.next=8;return deleteContact(contactId);case 8:_context3.next=10;return fetchContacts();case 10:if(!deleteContactFromOrder){_context3.next=13;break;}_context3.next=13;return deleteContactFromOrder(contactId);case 13:_context3.next=17;break;case 15:_context3.prev=15;_context3.t0=_context3["catch"](5);case 17:LoadingProvider.unsetLoading(pathname);case 18:case"end":return _context3.stop();}}},_callee3,null,[[5,15]]);}));return function(_x3){return _ref4.apply(this,arguments);};}(),[deleteContact,fetchContacts,pathname]);var deleteCustomerWrapper=useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.next=2;return confirmation('account.profile.confirm.messageCustomer');case 2:if(_context4.sent){_context4.next=4;break;}return _context4.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context4.prev=5;_context4.next=8;return deleteCustomer();case 8:_context4.next=12;break;case 10:_context4.prev=10;_context4.t0=_context4["catch"](5);case 12:LoadingProvider.unsetLoading(pathname);case 13:case"end":return _context4.stop();}}},_callee4,null,[[5,10]]);})),[deleteContact,fetchContacts,pathname]);/* eslint-enable react-hooks/exhaustive-deps */var editContact=useCallback(function(contact){var editPathname=isCheckout?"".concat(CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN).replace(':type',type):PROFILE_ADDRESS_PATH;push({pathname:editPathname,state:{contact:contact}});},[isCheckout,push,type]);// Store context value.
19
+ */var confirmation=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(message){var confirmed;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return showDialog({title:i18n.text('account.profile.confirm.title'),message:i18n.text(message),confirm:i18n.text('account.profile.confirm.confirm')});case 2:confirmed=_context2.sent;return _context2.abrupt("return",!!confirmed);case 4:case"end":return _context2.stop();}},_callee2);}));return function confirmation(_x2){return _ref3.apply(this,arguments);};}();// Deletes a contact.
20
+ /* eslint-disable react-hooks/exhaustive-deps */var deleteContactWrapper=useCallback(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(contactId){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return confirmation('account.profile.confirm.messageContact');case 2:if(_context3.sent){_context3.next=4;break;}return _context3.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context3.prev=5;_context3.next=8;return deleteContact(contactId);case 8:_context3.next=10;return fetchContacts();case 10:if(!deleteContactFromOrder){_context3.next=13;break;}_context3.next=13;return deleteContactFromOrder(contactId);case 13:_context3.next=17;break;case 15:_context3.prev=15;_context3.t0=_context3["catch"](5);case 17:LoadingProvider.unsetLoading(pathname);case 18:case"end":return _context3.stop();}},_callee3,null,[[5,15]]);}));return function(_x3){return _ref4.apply(this,arguments);};}(),[deleteContact,fetchContacts,pathname]);var deleteCustomerWrapper=useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return confirmation('account.profile.confirm.messageCustomer');case 2:if(_context4.sent){_context4.next=4;break;}return _context4.abrupt("return");case 4:LoadingProvider.setLoading(pathname);_context4.prev=5;_context4.next=8;return deleteCustomer();case 8:_context4.next=12;break;case 10:_context4.prev=10;_context4.t0=_context4["catch"](5);case 12:LoadingProvider.unsetLoading(pathname);case 13:case"end":return _context4.stop();}},_callee4,null,[[5,10]]);})),[deleteContact,fetchContacts,pathname]);/* eslint-enable react-hooks/exhaustive-deps */var editContact=useCallback(function(contact){var editPathname=isCheckout?"".concat(CHECKOUT_ADDRESS_BOOK_CONTACT_PATTERN).replace(':type',type):PROFILE_ADDRESS_PATH;push({pathname:editPathname,state:{contact:contact}});},[isCheckout,push,type]);// Store context value.
21
21
  var contextValue=useMemo(function(){return{contacts:contacts,validationErrors:validationErrors,merchantCustomerAttributes:merchantCustomerAttributes,customer:defaultState,isCheckout:isCheckout,supportedCountries:shopSettings.supportedCountries,countrySortOrder:shopSettings.countrySortOrder,userLocation:userLocation,formState:formState,saveForm:formState.handleSubmit,editContact:editContact,deleteContact:deleteContactWrapper,deleteCustomer:deleteCustomerWrapper};},[userLocation,shopSettings.supportedCountries,shopSettings.countrySortOrder,contacts,merchantCustomerAttributes,isCheckout,defaultState,deleteContactWrapper,deleteCustomerWrapper,editContact,formState,validationErrors]);// Fetch all required data for the profile page.
22
22
  useEffect(function(){fetchContacts();fetchCustomer();},[fetchContacts,fetchCustomer]);if(!customer){return null;}return React.createElement(ProfileContext.Provider,{value:contextValue},children);};ProfileProvider.defaultProps={customer:null,formContainerRef:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileProvider);
@@ -10,4 +10,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToAr
10
10
  */var ProfileContact=function ProfileContact(_ref){var shopSettings=_ref.shopSettings,userLocation=_ref.userLocation,addContact=_ref.addContact,updateContact=_ref.updateContact,pop=_ref.pop,customer=_ref.customer,numberOfAddressLines=_ref.numberOfAddressLines;var _useAddressBook=useAddressBook(),updateOrderWithContact=_useAddressBook.updateOrderWithContact,type=_useAddressBook.type,isCheckout=_useAddressBook.isCheckout;var formContainerRef=useRef(null);var _useRoute=useRoute(),pathname=_useRoute.pathname,_useRoute$state$conta=_useRoute.state.contact,contact=_useRoute$state$conta===void 0?{}:_useRoute$state$conta;var addressLines=useMemo(function(){/**
11
11
  * Determine the number of address fields with a value. Customers are supposed to edit their
12
12
  * old addresses after the numberOfAddressLines shop setting was changed.
13
- */var addressLinesInContact=Object.keys(contact).reduce(function(acc,key){if(key.startsWith('address')&&contact[key]){return parseInt(key.charAt(key.length-1),10);}return acc;},0);return Math.max(numberOfAddressLines,addressLinesInContact);},[contact,numberOfAddressLines]);var formConfig=useMemo(function(){return generateFormConfig({supportedCountries:shopSettings===null||shopSettings===void 0?void 0:shopSettings.supportedCountries,countrySortOrder:shopSettings===null||shopSettings===void 0?void 0:shopSettings.countrySortOrder,userLocation:userLocation,isCheckout:isCheckout,type:type,numberOfAddressLines:addressLines});},[addressLines,isCheckout,shopSettings,type,userLocation]);var constraints=useMemo(function(){return generateConstraints(isCheckout);},[isCheckout]);var handleSubmit=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var contactId,finalValues,fieldsUpdated,_ref3,_ref3$contactIds;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);contactId=contact.id;finalValues=_extends({},values,{},isCheckout&&!(contact===null||contact===void 0?void 0:contact.emailAddress)?{emailAddress:customer===null||customer===void 0?void 0:customer.emailAddress}:{});fieldsUpdated=Object.keys(values).filter(function(key){return!['isDefaultBilling','isDefaultShipping'].includes(key);}).some(function(key){return values[key]!==contact[key];});_context.prev=4;if(!(contact===null||contact===void 0?void 0:contact.id)){_context.next=10;break;}_context.next=8;return updateContact(contact.id,finalValues);case 8:_context.next=15;break;case 10:_context.next=12;return addContact(finalValues);case 12:_ref3=_context.sent;_ref3$contactIds=_slicedToArray(_ref3.contactIds,1);contactId=_ref3$contactIds[0];case 15:if(!(updateOrderWithContact&&fieldsUpdated)){_context.next=19;break;}_context.next=18;return updateOrderWithContact(contactId);case 18:return _context.abrupt("return");case 19:pop();_context.next=24;break;case 22:_context.prev=22;_context.t0=_context["catch"](4);case 24:LoadingProvider.unsetLoading(pathname);case 25:case"end":return _context.stop();}}},_callee,null,[[4,22]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addContact,contact,customer,isCheckout,pathname,pop,updateContact,updateOrderWithContact]);var formState=useFormState(contact,handleSubmit,constraints,formContainerRef);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||{});},[formState.validationErrors]);/* eslint-disable react-hooks/exhaustive-deps */var handleUpdate=useCallback(function(values){formState.setValues(values);},[formState.setValues]);/* eslint-enable react-hooks/exhaustive-deps */return React.createElement("div",{className:styles.root,ref:formContainerRef},React.createElement(FormBuilder,{name:"ProfileAddressForm",className:styles.form,config:formConfig,defaults:contact,validationErrors:validationErrors,handleUpdate:handleUpdate}),React.createElement("div",{className:styles.actions},React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"primary",onClick:formState.handleSubmit},i18n.text('account.profile.form.save'))));};ProfileContact.defaultProps={customer:null,numberOfAddressLines:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileContact);
13
+ */var addressLinesInContact=Object.keys(contact).reduce(function(acc,key){if(key.startsWith('address')&&contact[key]){return parseInt(key.charAt(key.length-1),10);}return acc;},0);return Math.max(numberOfAddressLines,addressLinesInContact);},[contact,numberOfAddressLines]);var formConfig=useMemo(function(){return generateFormConfig({supportedCountries:shopSettings===null||shopSettings===void 0?void 0:shopSettings.supportedCountries,countrySortOrder:shopSettings===null||shopSettings===void 0?void 0:shopSettings.countrySortOrder,userLocation:userLocation,isCheckout:isCheckout,type:type,numberOfAddressLines:addressLines});},[addressLines,isCheckout,shopSettings,type,userLocation]);var constraints=useMemo(function(){return generateConstraints(isCheckout);},[isCheckout]);var handleSubmit=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values){var contactId,finalValues,fieldsUpdated,_ref3,_ref3$contactIds;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:LoadingProvider.setLoading(pathname);contactId=contact.id;finalValues=_extends({},values,{},isCheckout&&!(contact===null||contact===void 0?void 0:contact.emailAddress)?{emailAddress:customer===null||customer===void 0?void 0:customer.emailAddress}:{});fieldsUpdated=Object.keys(values).filter(function(key){return!['isDefaultBilling','isDefaultShipping'].includes(key);}).some(function(key){return values[key]!==contact[key];});_context.prev=4;if(!(contact===null||contact===void 0?void 0:contact.id)){_context.next=10;break;}_context.next=8;return updateContact(contact.id,finalValues);case 8:_context.next=15;break;case 10:_context.next=12;return addContact(finalValues);case 12:_ref3=_context.sent;_ref3$contactIds=_slicedToArray(_ref3.contactIds,1);contactId=_ref3$contactIds[0];case 15:if(!(updateOrderWithContact&&fieldsUpdated)){_context.next=19;break;}_context.next=18;return updateOrderWithContact(contactId);case 18:return _context.abrupt("return");case 19:pop();_context.next=24;break;case 22:_context.prev=22;_context.t0=_context["catch"](4);case 24:LoadingProvider.unsetLoading(pathname);case 25:case"end":return _context.stop();}},_callee,null,[[4,22]]);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addContact,contact,customer,isCheckout,pathname,pop,updateContact,updateOrderWithContact]);var formState=useFormState(contact,handleSubmit,constraints,formContainerRef);var validationErrors=useMemo(function(){return convertValidationErrors(formState.validationErrors||{});},[formState.validationErrors]);/* eslint-disable react-hooks/exhaustive-deps */var handleUpdate=useCallback(function(values){formState.setValues(values);},[formState.setValues]);/* eslint-enable react-hooks/exhaustive-deps */return React.createElement("div",{className:styles.root,ref:formContainerRef},React.createElement(FormBuilder,{name:"ProfileAddressForm",className:styles.form,config:formConfig,defaults:contact,validationErrors:validationErrors,handleUpdate:handleUpdate}),React.createElement("div",{className:styles.actions},React.createElement(RippleButton,{className:styles.button,rippleClassName:styles.ripple,type:"primary",onClick:formState.handleSubmit},i18n.text('account.profile.form.save'))));};ProfileContact.defaultProps={customer:null,numberOfAddressLines:null};export default connect(mapStateToProps,mapDispatchToProps)(ProfileContact);
@@ -1,4 +1,4 @@
1
- import{produce}from'immer';import{SUCCESS_LOGOUT}from'@shopgate/pwa-common/constants/ActionTypes';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR,FETCH_CUSTOMER,FETCH_CUSTOMER_SUCCESS,FETCH_CUSTOMER_ERROR}from"../constants/actions";var initialState={customer:{isFetching:false,data:null},contacts:{isFetching:false,items:[]}};/**
1
+ import{produce}from'immer';import{SUCCESS_LOGOUT}from'@shopgate/engage/core/constants';import{FETCH_CUSTOMER_CONTACTS,FETCH_CUSTOMER_CONTACTS_SUCCESS,FETCH_CUSTOMER_CONTACTS_ERROR,FETCH_CUSTOMER,FETCH_CUSTOMER_SUCCESS,FETCH_CUSTOMER_ERROR}from"../constants/actions";var initialState={customer:{isFetching:false,data:null},contacts:{isFetching:false,items:[]}};/**
2
2
  * The reducer for all checkout related state.
3
3
  * @param {Object} state The application state.
4
4
  * @param {Object} action The redux action.
@@ -1,7 +1,7 @@
1
- import{RESET_APP_START_COUNT,INCREASE_APP_START_COUNT}from"../constants";/**
1
+ import{APP_RATING_RESET_APP_START_COUNT,APP_RATING_INCREASE_APP_START_COUNT}from"../constants";/**
2
2
  * Increment the app start count
3
3
  * @return {Object} The dispatched action object.
4
- */export var increaseAppStartCount=function increaseAppStartCount(){return{type:INCREASE_APP_START_COUNT};};/**
4
+ */export var increaseAppStartCount=function increaseAppStartCount(){return{type:APP_RATING_INCREASE_APP_START_COUNT};};/**
5
5
  * Reset the app start count, and increment reset counts
6
6
  * @return {Object} The dispatched action object.
7
- */export var resetAppStartCount=function resetAppStartCount(){return{type:RESET_APP_START_COUNT};};
7
+ */export var resetAppStartCount=function resetAppStartCount(){return{type:APP_RATING_RESET_APP_START_COUNT};};
@@ -1,7 +1,7 @@
1
- import{RESET_ORDERS_PLACED_COUNT,INCREASE_ORDERS_PLACED_COUNT}from"../constants";/**
1
+ import{APP_RATING_RESET_ORDERS_PLACED_COUNT,APP_RATING_INCREASE_ORDERS_PLACED_COUNT}from"../constants";/**
2
2
  * Increment the orders placed count
3
3
  * @return {Object} The dispatched action object.
4
- */export var increaseOrdersPlacedCount=function increaseOrdersPlacedCount(){return{type:INCREASE_ORDERS_PLACED_COUNT};};/**
4
+ */export var increaseOrdersPlacedCount=function increaseOrdersPlacedCount(){return{type:APP_RATING_INCREASE_ORDERS_PLACED_COUNT};};/**
5
5
  * Reset the orders placed count, and increment reset counts
6
6
  * @return {Object} The dispatched action object.
7
- */export var resetOrdersPlacedCount=function resetOrdersPlacedCount(){return{type:RESET_ORDERS_PLACED_COUNT};};
7
+ */export var resetOrdersPlacedCount=function resetOrdersPlacedCount(){return{type:APP_RATING_RESET_ORDERS_PLACED_COUNT};};
@@ -1,11 +1,11 @@
1
- import{INCREASE_REJECTION_COUNT,SET_ALREADY_RATED,SET_LAST_POPUP_TIMESTAMP}from"../constants";/**
1
+ import{APP_RATING_INCREASE_REJECTION_COUNT,APP_RATING_SET_ALREADY_RATED,APP_RATING_SET_LAST_POPUP_TIMESTAMP}from"../constants";/**
2
2
  * Sets the last popup timestamp
3
3
  * @return {Object} The dispatched action object.
4
- */export var setLastPopupTimestamp=function setLastPopupTimestamp(){return{type:SET_LAST_POPUP_TIMESTAMP};};/**
4
+ */export var setLastPopupTimestamp=function setLastPopupTimestamp(){return{type:APP_RATING_SET_LAST_POPUP_TIMESTAMP};};/**
5
5
  * Sets the last popup timestamp
6
6
  * @return {Object} The dispatched action object.
7
- */export var increaseRejectionCount=function increaseRejectionCount(){return{type:INCREASE_REJECTION_COUNT};};/**
7
+ */export var increaseRejectionCount=function increaseRejectionCount(){return{type:APP_RATING_INCREASE_REJECTION_COUNT};};/**
8
8
  * Sets the last popup timestamp
9
9
  * @param {boolean} to the value to set the rated status
10
10
  * @return {Object} The dispatched action object.
11
- */export var setAlreadyRated=function setAlreadyRated(to){return{type:SET_ALREADY_RATED,to:to};};
11
+ */export var setAlreadyRated=function setAlreadyRated(to){return{type:APP_RATING_SET_ALREADY_RATED,to:to};};
@@ -1,7 +1,7 @@
1
- import{SET_TIMER_START_TIME,INCREASE_TIMER_REPEATS}from"../constants";/**
1
+ import{APP_RATING_SET_TIMER_START_TIME,APP_RATING_INCREASE_TIMER_REPEATS}from"../constants";/**
2
2
  * Reset the orders placed count, and increment reset counts
3
3
  * @return {Object} The dispatched action object.
4
- */export var resetTimerState=function resetTimerState(){return{type:INCREASE_TIMER_REPEATS};};/**
4
+ */export var resetTimerState=function resetTimerState(){return{type:APP_RATING_INCREASE_TIMER_REPEATS};};/**
5
5
  * Sets the timer start time
6
6
  * @return {Object} The dispatched action object.
7
- */export var setTimerStartTime=function setTimerStartTime(){return{type:SET_TIMER_START_TIME};};
7
+ */export var setTimerStartTime=function setTimerStartTime(){return{type:APP_RATING_SET_TIMER_START_TIME};};
@@ -1,19 +1,19 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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);});};}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 showModalAction from'@shopgate/pwa-common/actions/modal/showModal';import{getPlatform}from'@shopgate/pwa-common/selectors/client';import{historyPush}from'@shopgate/pwa-common/actions/router';import appConfig from'@shopgate/pwa-common/helpers/config';import{track}from'@shopgate/pwa-tracking/helpers';import{increaseRejectionCount,setAlreadyRated,setLastPopupTimestamp}from"../action-creators/popup";import{generateReviewLink}from"../helpers";import{TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";var _appConfig$appRating=appConfig.appRating,bundleId=_appConfig$appRating.bundleId,minDaysBetweenPopups=_appConfig$appRating.minDaysBetweenPopups,askForFeedback=_appConfig$appRating.askForFeedback,feedbackLink=_appConfig$appRating.feedbackLink;/**
2
- * to handle the user redirection
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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);});};}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 showModalAction from'@shopgate/pwa-common/actions/modal/showModal';import{getPlatform}from'@shopgate/pwa-common/selectors/client';import{historyPush}from'@shopgate/pwa-common/actions/router';import appConfig from'@shopgate/pwa-common/helpers/config';import{track}from'@shopgate/pwa-tracking/helpers';import{increaseRejectionCount,setAlreadyRated,setLastPopupTimestamp}from"../action-creators/popup";import{generateReviewLink}from"../helpers";import{APP_RATING_TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";var _appConfig$appRating=appConfig.appRating,bundleId=_appConfig$appRating.bundleId,minDaysBetweenPopups=_appConfig$appRating.minDaysBetweenPopups,askForFeedback=_appConfig$appRating.askForFeedback,feedbackLink=_appConfig$appRating.feedbackLink;/**
2
+ * to handle the modal confirmation
3
3
  * @param {string} url the url to redirect to
4
4
  * @param {boolean | null} setRated the url to redirect to
5
5
  * @return {(function(*, *): void)|*}
6
- */function redirectTo(url){var setRated=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function(dispatch){if(!url){return;}if(setRated){dispatch(setAlreadyRated(setRated));}dispatch(historyPush(_extends({pathname:url},setRated&&{target:'_blank'})));};}/**
6
+ */function redirectTo(url){var setRated=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return function(dispatch){if(!url){return;}if(setRated){dispatch(setAlreadyRated(setRated));}dispatch(historyPush(_extends({pathname:url},setRated&&{state:{target:'_blank'}})));};}/**
7
7
  * shows the actual modal
8
8
  * @param {Function} resetAction the reset action function
9
9
  * @param {Function} increaseAction the function to increase the appropriate counter
10
10
  * @param {boolean} mustShow if the modal must be shown
11
11
  * @param {boolean} hasRepeats if the counters has repeats
12
12
  * @return {(function(*, *): void)|*}
13
- */export function showModal(resetAction,increaseAction,mustShow,hasRepeats){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var state,platform,reviewLink,appRatingState,isMinDaysBetweenPopupsElapsed,firstModalConfirmed,userGivesFeedback;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:state=getState();platform=getPlatform(state);reviewLink=generateReviewLink(bundleId[platform],platform);// no review link for current platform found -> don't show modal
14
- if(reviewLink){_context.next=5;break;}return _context.abrupt("return");case 5:if(!mustShow&&hasRepeats&&increaseAction){dispatch(increaseAction());}if(mustShow&&hasRepeats){_context.next=8;break;}return _context.abrupt("return");case 8:appRatingState=getAppRatingState(state);isMinDaysBetweenPopupsElapsed=Date.now()-appRatingState.lastPopupAt>=minDaysBetweenPopups*TIMER_TIMESPAN;if(isMinDaysBetweenPopupsElapsed){_context.next=12;break;}return _context.abrupt("return");case 12:dispatch(resetAction());dispatch(setLastPopupTimestamp());_context.next=16;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.message'}));case 16:firstModalConfirmed=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision',eventLabel:firstModalConfirmed?'yes':'no'},state);// user touched yes and we
13
+ */export function showModal(resetAction,increaseAction,mustShow,hasRepeats){return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch,getState){var state,platform,reviewLink,appRatingState,isMinDaysBetweenPopupsElapsed,firstModalConfirmed,userGivesFeedback;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:state=getState();platform=getPlatform(state);reviewLink=generateReviewLink(bundleId[platform],platform);// no review link for current platform found -> don't show modal
14
+ if(reviewLink){_context.next=5;break;}return _context.abrupt("return");case 5:if(!mustShow&&hasRepeats&&increaseAction){dispatch(increaseAction());}if(mustShow&&hasRepeats){_context.next=8;break;}return _context.abrupt("return");case 8:appRatingState=getAppRatingState(state);isMinDaysBetweenPopupsElapsed=Date.now()-appRatingState.lastPopupAt>=minDaysBetweenPopups*APP_RATING_TIMER_TIMESPAN;if(isMinDaysBetweenPopupsElapsed){_context.next=12;break;}return _context.abrupt("return");case 12:dispatch(resetAction());dispatch(setLastPopupTimestamp());_context.next=16;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.message'}));case 16:firstModalConfirmed=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision',eventLabel:firstModalConfirmed?'yes':'no'},state);// user touched yes and we
15
15
  // redirect to store
16
16
  if(!firstModalConfirmed){_context.next=21;break;}dispatch(redirectTo(reviewLink,true));return _context.abrupt("return");case 21:// user doesn't want to rate
17
17
  dispatch(increaseRejectionCount());// we approve for rejection
18
18
  if(!askForFeedback){_context.next=29;break;}_context.next=25;return dispatch(showModalAction({confirm:'appRating.yes',dismiss:'appRating.no',title:'appRating.title',message:'appRating.rejectionApprovalMessage'}));case 25:userGivesFeedback=_context.sent;track('customEvent',{eventCategory:'appReviewPrompt',eventAction:'decision_feedback',eventLabel:userGivesFeedback?'yes':'no'},state);// user now wants to rate our app! yay :D
19
- if(userGivesFeedback){dispatch(redirectTo(feedbackLink));}return _context.abrupt("return");case 29:dispatch(redirectTo(feedbackLink));case 30:case"end":return _context.stop();}}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}
19
+ if(userGivesFeedback){dispatch(redirectTo(feedbackLink));}return _context.abrupt("return");case 29:dispatch(redirectTo(feedbackLink));case 30:case"end":return _context.stop();}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}
@@ -1,2 +1,2 @@
1
- export var INCREASE_APP_START_COUNT='INCREASE_APP_START_COUNT';export var RESET_APP_START_COUNT='RESET_APP_START_COUNT';export var RESET_APP_START_STATE='RESET_APP_START_STATE';export var INCREASE_ORDERS_PLACED_COUNT='INCREASE_ORDERS_PLACED_COUNT';export var RESET_ORDERS_PLACED_COUNT='RESET_ORDERS_PLACED_COUNT';export var RESET_ORDERS_PLACED_STATE='RESET_ORDERS_PLACED_STATE';export var INCREASE_TIMER_REPEATS='INCREASE_TIMER_REPEATS';export var SET_TIMER_START_TIME='SET_TIMER_START_TIME';export var SET_LAST_POPUP_TIMESTAMP='SET_LAST_POPUP_TIMESTAMP';export var INCREASE_REJECTION_COUNT='INCREASE_REJECTION_COUNT';export var SET_ALREADY_RATED='SET_ALREADY_RATED';// currently the timespan is set to a day
2
- export var TIMER_TIMESPAN=1000*60*60*24;
1
+ export var APP_RATING_INCREASE_APP_START_COUNT='APP_RATING_INCREASE_APP_START_COUNT';export var APP_RATING_RESET_APP_START_COUNT='APP_RATING_RESET_APP_START_COUNT';export var APP_RATING_RESET_APP_START_STATE='APP_RATING_RESET_APP_START_STATE';export var APP_RATING_INCREASE_ORDERS_PLACED_COUNT='APP_RATING_INCREASE_ORDERS_PLACED_COUNT';export var APP_RATING_RESET_ORDERS_PLACED_COUNT='APP_RATING_RESET_ORDERS_PLACED_COUNT';export var APP_RATING_RESET_ORDERS_PLACED_STATE='APP_RATING_RESET_ORDERS_PLACED_STATE';export var APP_RATING_INCREASE_TIMER_REPEATS='APP_RATING_INCREASE_TIMER_REPEATS';export var APP_RATING_SET_TIMER_START_TIME='APP_RATING_SET_TIMER_START_TIME';export var APP_RATING_SET_LAST_POPUP_TIMESTAMP='APP_RATING_SET_LAST_POPUP_TIMESTAMP';export var APP_RATING_INCREASE_REJECTION_COUNT='APP_RATING_INCREASE_REJECTION_COUNT';export var APP_RATING_SET_ALREADY_RATED='APP_RATING_SET_ALREADY_RATED';// currently the timespan is set to a day
2
+ export var APP_RATING_TIMER_TIMESPAN=1000*60*60*24;
@@ -1,6 +1,6 @@
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{INCREASE_APP_START_COUNT,RESET_APP_START_STATE,RESET_APP_START_COUNT,INCREASE_ORDERS_PLACED_COUNT,RESET_ORDERS_PLACED_COUNT,RESET_ORDERS_PLACED_STATE,INCREASE_TIMER_REPEATS,SET_TIMER_START_TIME,SET_LAST_POPUP_TIMESTAMP,INCREASE_REJECTION_COUNT,SET_ALREADY_RATED}from"../constants";var defaultState={appStartCount:0,appStartResetCount:0,ordersPlacedCount:0,ordersPlacedResetCount:0,timerRepeatsCount:0,timerStartTimestamp:null,lastPopupAt:null,rejectionCount:0,alreadyRated:false};/**
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{APP_RATING_INCREASE_APP_START_COUNT,APP_RATING_RESET_APP_START_STATE,APP_RATING_RESET_APP_START_COUNT,APP_RATING_INCREASE_ORDERS_PLACED_COUNT,APP_RATING_RESET_ORDERS_PLACED_COUNT,APP_RATING_RESET_ORDERS_PLACED_STATE,APP_RATING_INCREASE_TIMER_REPEATS,APP_RATING_SET_TIMER_START_TIME,APP_RATING_SET_LAST_POPUP_TIMESTAMP,APP_RATING_INCREASE_REJECTION_COUNT,APP_RATING_SET_ALREADY_RATED}from"../constants";var defaultState={appStartCount:0,appStartResetCount:0,ordersPlacedCount:0,ordersPlacedResetCount:0,timerRepeatsCount:0,timerStartTimestamp:null,lastPopupAt:null,rejectionCount:0,alreadyRated:false};/**
2
2
  * Stores all the app rating states.
3
3
  * @param {Object} [state] The current state.
4
4
  * @param {Object} action The action object.
5
5
  * @return {Object} The new state.
6
- */export default(function(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case INCREASE_APP_START_COUNT:{return _extends({},state,{appStartCount:state.appStartCount+1});}case RESET_APP_START_COUNT:{return _extends({},state,{appStartCount:0,appStartResetCount:state.appStartResetCount+1});}case RESET_APP_START_STATE:{return _extends({},state,{appStartCount:0,appStartResetCount:0});}case INCREASE_ORDERS_PLACED_COUNT:{return _extends({},state,{ordersPlacedCount:state.ordersPlacedCount+1});}case RESET_ORDERS_PLACED_COUNT:{return _extends({},state,{ordersPlacedCount:0,ordersPlacedResetCount:state.ordersPlacedResetCount+1});}case RESET_ORDERS_PLACED_STATE:{return _extends({},state,{ordersPlacedCount:0,ordersPlacedResetCount:0});}case INCREASE_TIMER_REPEATS:{return _extends({},state,{timerRepeatsCount:state.timerRepeatsCount+1});}case SET_TIMER_START_TIME:{return _extends({},state,{timerStartTimestamp:Date.now()});}case SET_LAST_POPUP_TIMESTAMP:{return _extends({},state,{lastPopupAt:Date.now()});}case INCREASE_REJECTION_COUNT:{return _extends({},state,{rejectionCount:state.rejectionCount+1});}case SET_ALREADY_RATED:{return _extends({},state,{alreadyRated:action.to});}default:return state;}});
6
+ */export default(function(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case APP_RATING_INCREASE_APP_START_COUNT:{return _extends({},state,{appStartCount:state.appStartCount+1});}case APP_RATING_RESET_APP_START_COUNT:{return _extends({},state,{appStartCount:0,appStartResetCount:state.appStartResetCount+1});}case APP_RATING_RESET_APP_START_STATE:{return _extends({},state,{appStartCount:0,appStartResetCount:0});}case APP_RATING_INCREASE_ORDERS_PLACED_COUNT:{return _extends({},state,{ordersPlacedCount:state.ordersPlacedCount+1});}case APP_RATING_RESET_ORDERS_PLACED_COUNT:{return _extends({},state,{ordersPlacedCount:0,ordersPlacedResetCount:state.ordersPlacedResetCount+1});}case APP_RATING_RESET_ORDERS_PLACED_STATE:{return _extends({},state,{ordersPlacedCount:0,ordersPlacedResetCount:0});}case APP_RATING_INCREASE_TIMER_REPEATS:{return _extends({},state,{timerRepeatsCount:state.timerRepeatsCount+1});}case APP_RATING_SET_TIMER_START_TIME:{return _extends({},state,{timerStartTimestamp:Date.now()});}case APP_RATING_SET_LAST_POPUP_TIMESTAMP:{return _extends({},state,{lastPopupAt:Date.now()});}case APP_RATING_INCREASE_REJECTION_COUNT:{return _extends({},state,{rejectionCount:state.rejectionCount+1});}case APP_RATING_SET_ALREADY_RATED:{return _extends({},state,{alreadyRated:action.to});}default:return state;}});
@@ -1,18 +1,18 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";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 appConfig from'@shopgate/pwa-common/helpers/config';import{appDidStart$}from'@shopgate/pwa-common/streams/app';import{checkoutSuccess$}from'@shopgate/engage/checkout/streams';import event from'@shopgate/pwa-core/classes/Event';import{hasWebBridge}from'@shopgate/engage/core';import{increaseAppStartCount,resetAppStartCount}from"../action-creators/appStart";import{increaseOrdersPlacedCount,resetOrdersPlacedCount}from"../action-creators/ordersPlaced";import{resetTimerState,setTimerStartTime}from"../action-creators/timer";import{TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";import{showModal}from"../actions/showModal";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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 appConfig from'@shopgate/pwa-common/helpers/config';import{appDidStart$}from'@shopgate/pwa-common/streams/app';import{checkoutSuccess$}from'@shopgate/engage/checkout/streams';import event from'@shopgate/pwa-core/classes/Event';import{hasWebBridge}from'@shopgate/engage/core';import{increaseAppStartCount,resetAppStartCount}from"../action-creators/appStart";import{increaseOrdersPlacedCount,resetOrdersPlacedCount}from"../action-creators/ordersPlaced";import{resetTimerState,setTimerStartTime}from"../action-creators/timer";import{APP_RATING_TIMER_TIMESPAN}from"../constants";import{getAppRatingState}from"../selectors/appRating";import{showModal}from"../actions/showModal";/**
2
2
  * App rating subscriptions
3
3
  * @param {Function} subscribe The subscribe function
4
4
  */export default function appRating(subscribe){if(!hasWebBridge){return;}var _appConfig$appRating=appConfig.appRating,appStarts=_appConfig$appRating.appStarts,ordersPlaced=_appConfig$appRating.ordersPlaced,timeInterval=_appConfig$appRating.timeInterval,rejectionMaxCount=_appConfig$appRating.rejectionMaxCount,bundleId=_appConfig$appRating.bundleId;// even subscriber to handle app start ratings
5
5
  // and also time interval ratings
6
- subscribe(appDidStart$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,state,mustShowModal,hasRepeats,resetAction,increaseAction;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;if(!(!bundleId||!bundleId.android||!bundleId.ios)){_context.next=3;break;}return _context.abrupt("return");case 3:// every time the app starts
6
+ subscribe(appDidStart$,/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,state,mustShowModal,hasRepeats,resetAction,increaseAction;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;if(!(!bundleId||!bundleId.android||!bundleId.ios)){_context.next=3;break;}return _context.abrupt("return");case 3:// every time the app starts
7
7
  // we increase the start count
8
8
  dispatch(increaseAppStartCount());state=getAppRatingState(getState());// if the user has already rated the app
9
9
  // we'll cancel the operations as we
10
10
  // don't have to show the modal once more
11
11
  if(!state.alreadyRated){_context.next=7;break;}return _context.abrupt("return");case 7:if(!(state.rejectionCount>=rejectionMaxCount)){_context.next=9;break;}return _context.abrupt("return");case 9:// initiate the first start time
12
- if(state.timerStartTimestamp===null){dispatch(setTimerStartTime());}mustShowModal=false;hasRepeats=false;resetAction=null;increaseAction=null;if(Number(timeInterval.value)>0&&Number(state.timerStartTimestamp)>0&&Date.now()-state.timerStartTimestamp>=timeInterval.value*TIMER_TIMESPAN){mustShowModal=true;hasRepeats=timeInterval.repeats===null||state.timerRepeatsCount<=timeInterval.repeats;resetAction=resetTimerState;// since the time is elapsed
12
+ if(state.timerStartTimestamp===null){dispatch(setTimerStartTime());}mustShowModal=false;hasRepeats=false;resetAction=null;increaseAction=null;if(timeInterval&&Number(timeInterval.value)>0&&Number(state.timerStartTimestamp)>0&&Date.now()-state.timerStartTimestamp>=timeInterval.value*APP_RATING_TIMER_TIMESPAN){mustShowModal=true;hasRepeats=timeInterval.repeats===null||state.timerRepeatsCount<=timeInterval.repeats;resetAction=resetTimerState;// since the time is elapsed
13
13
  // we reset the starting time
14
14
  increaseAction=setTimerStartTime;}else if(appStarts){mustShowModal=Number(appStarts.value)>0&&state.appStartCount>=appStarts.value;hasRepeats=appStarts.repeats===null||state.appStartResetCount<=appStarts.repeats;resetAction=resetAppStartCount;increaseAction=null;}// the actual show modal logic
15
- dispatch(showModal(resetAction,increaseAction,mustShowModal,hasRepeats));case 16:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());/**
15
+ dispatch(showModal(resetAction,increaseAction,mustShowModal,hasRepeats));case 16:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());/**
16
16
  * Handle checkout success logic
17
17
  * @param {Function} dispatch dispatch
18
18
  * @param {Function} getState getState
@@ -0,0 +1,14 @@
1
+ import{PipelineRequest}from'@shopgate/engage/core/classes';import{SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION,SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS,ADD_BACK_IN_STOCK_SUBSCRIPTION,ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR,ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,REMOVE_BACK_IN_STOCK_SUBSCRIPTION,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR,REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS}from'@shopgate/engage/back-in-stock/constants';/**
2
+ * Fetch Back in Stock Subscriptions
3
+ * @returns {Function}
4
+ */export var fetchBackInStockSubscriptions=function fetchBackInStockSubscriptions(){return function(dispatch){dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS});var request=new PipelineRequest(SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS).setInput({limit:100,filters:{status:{$in:['active','triggered']}}}).setRetries(0).dispatch();request.then(function(_ref){var subscriptions=_ref.subscriptions;dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR,error:error});});return request;};};/**
5
+ * Add a Back in Stock Subscription
6
+ * @param {Object} props Props.
7
+ * @param {string} props.productId The product for which the subscription should be added
8
+ * @returns {Function}
9
+ */export var addBackInStockSubscription=function addBackInStockSubscription(_ref2){var productId=_ref2.productId;return function(dispatch){dispatch({type:ADD_BACK_IN_STOCK_SUBSCRIPTION});var request=new PipelineRequest(SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION).setInput({productCode:productId}).setRetries(0).dispatch();request.then(function(_ref3){var subscriptions=_ref3.subscriptions;dispatch({type:ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR,error:error});});return request;};};/**
10
+ * Remove a Back in Stock Subscription
11
+ * @param {Object} props Props.
12
+ * @param {string} props.subscriptionCode The subscription which should be deleted
13
+ * @returns {Function}
14
+ */export var removeBackInStockSubscription=function removeBackInStockSubscription(_ref4){var subscriptionCode=_ref4.subscriptionCode;return function(dispatch){dispatch({type:REMOVE_BACK_IN_STOCK_SUBSCRIPTION});var request=new PipelineRequest(SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION).setInput({subscriptionCode:subscriptionCode}).setRetries(0).dispatch();request.then(function(_ref5){var subscriptions=_ref5.subscriptions;dispatch({type:REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS,subscriptions:subscriptions});})["catch"](function(error){dispatch({type:REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR,error:error});});return request;};};
@@ -0,0 +1 @@
1
+ import{connect}from'react-redux';import{addBackInStockSubscription}from'@shopgate/engage/back-in-stock/actions';import grantPushPermissions from'@shopgate/engage/core/actions/grantPushPermissions';var mapDispatchToProps={addBackInStockSubscription:addBackInStockSubscription,grantPushPermissions:grantPushPermissions};export default connect(null,mapDispatchToProps);
@@ -0,0 +1,14 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";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;}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 React,{useCallback}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{themeConfig}from'@shopgate/engage';import{Link,CheckedIcon,Button,NotificationIcon}from'@shopgate/engage/components';import{BACK_IN_STOCK_PATTERN}from'@shopgate/engage/back-in-stock/constants';import{i18n}from'@shopgate/engage/core';import styles from"./style";import connect from"./connector";var colors=themeConfig.colors;/**
2
+ * This component renders a button to subscribe a product or a hint
3
+ * that the product is already subscribed
4
+ * @param {Object} props The component props
5
+ * @param {boolean} props.isLinkToBackInStockEnabled Whether the link to the back in
6
+ * stock page is active
7
+ * @param {boolean} props.stopPropagation Stop event propagation
8
+ * @param {string} props.productId The product id
9
+ * @param {Object} props.subscription The subscription
10
+ * @param {Function} props.addBackInStockSubscription Add product to back in stock list
11
+ * @param {Function} props.grantPushPermissions Request / Set push permission
12
+ * @return {JSX.Element}
13
+ */var BackInStockButton=function BackInStockButton(_ref){var productId=_ref.productId,_ref$isLinkToBackInSt=_ref.isLinkToBackInStockEnabled,isLinkToBackInStockEnabled=_ref$isLinkToBackInSt===void 0?false:_ref$isLinkToBackInSt,subscription=_ref.subscription,_ref$stopPropagation=_ref.stopPropagation,stopPropagation=_ref$stopPropagation===void 0?false:_ref$stopPropagation,addBackInStockSubscription=_ref.addBackInStockSubscription,grantPushPermissions=_ref.grantPushPermissions,alignRight=_ref.alignRight,showAsButton=_ref.showAsButton;var handleClick=useCallback(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event){var allowed;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(stopPropagation){event.stopPropagation();}_context.next=3;return grantPushPermissions({useRationaleModal:true,useSettingsModal:true,rationaleModal:{message:'back_in_stock.rationale.message',confirm:'back_in_stock.rationale.confirm',dismiss:'common.cancel'}});case 3:allowed=_context.sent;if(allowed){addBackInStockSubscription({productId:productId});}case 5:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}(),[addBackInStockSubscription,grantPushPermissions,productId,stopPropagation]);if((subscription===null||subscription===void 0?void 0:subscription.status)==='active'){return React.createElement(Link,{href:BACK_IN_STOCK_PATTERN,disabled:!isLinkToBackInStockEnabled,className:classNames(styles.backInStockMessageContainer,_defineProperty({},styles.rightAligned,alignRight)),tag:"span"},React.createElement(CheckedIcon,{color:colors.success,className:alignRight?styles.icon:classNames(styles.iconCentered,styles.icon)}),React.createElement("span",{className:styles.backInStockMessage},i18n.text('back_in_stock.we_will_remind_you')));}if(showAsButton){return React.createElement(Button,{type:"primary",tabIndex:0,onClick:handleClick,className:styles.button},React.createElement("span",{className:styles.buttonText},i18n.text('back_in_stock.get_notified')));}return(// eslint-disable-next-line jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events
14
+ React.createElement("a",{role:"button",tabIndex:0,onClick:handleClick,className:classNames(styles.button,_defineProperty({},styles.rightAligned,alignRight))},React.createElement(NotificationIcon,{color:colors.primary,className:styles.icon}),React.createElement("span",{className:styles.buttonText},i18n.text('back_in_stock.get_notified'))));};BackInStockButton.defaultProps={stopPropagation:false,isLinkToBackInStockEnabled:false,showAsButton:false,alignRight:false,subscription:null,productId:null};export default connect(BackInStockButton);
@@ -0,0 +1 @@
1
+ import{css}from'glamor';import{themeConfig}from'@shopgate/engage';export default{button:css({lineHeight:'16.5px',color:themeConfig.colors.warning,width:'100%'}).toString(),buttonContent:css({display:'flex',alignItems:'center'}).toString(),backInStockMessageContainer:css({lineHeight:'16.5px',display:'flex',alignItems:'center',width:'auto'}).toString(),rightAligned:css({display:'inline-block',textAlign:'right'}).toString(),backInStockMessage:css({verticalAlign:'middle',fontSize:'0.875rem'}).toString(),buttonText:css({fontSize:'0.875rem'}).toString(),icon:css({marginRight:4,marginTop:-1,verticalAlign:'middle',flexShrink:0,alignSelf:'flex-start',display:'inline-flex'}).toString(),iconCentered:css({alignSelf:'center',marginLeft:'-2px',marginRight:'8px'}).toString()};
@@ -0,0 +1,3 @@
1
+ import{connect}from'react-redux';import{getIsBackInStockEnabled,makeGetSubscriptionByCharacteristics}from'@shopgate/engage/back-in-stock/selectors';import{makeGetProductByCharacteristics}from'@shopgate/engage/product';/**
2
+ * @return {Object} The extended component props.
3
+ */var makeMapStateToProps=function makeMapStateToProps(){var getProductByCharacteristics=makeGetProductByCharacteristics({strict:true});var getSubscriptionByCharacteristics=makeGetSubscriptionByCharacteristics();return function(state,props){var variant=getProductByCharacteristics(state,props)||{};return{variant:variant,subscription:getSubscriptionByCharacteristics(state,props),isBackInStockEnabled:getIsBackInStockEnabled(state,props)};};};export default connect(makeMapStateToProps);
@@ -0,0 +1,8 @@
1
+ import React from'react';import PropTypes from'prop-types';import{BackInStockButton}from'@shopgate/engage/back-in-stock/components';import{withCurrentProduct}from'@shopgate/engage/core';import connect from"./connector";/**
2
+ * The CharacteristicsButton component.
3
+ * @param {Object} props The component props.
4
+ * @param {boolean} props.isBackInStockEnabled Whether the back in stock feature is enabled
5
+ * @param {Object} props.variant The variant for this entry
6
+ * @param {Object} props.subscription The subscription
7
+ * @return {JSX}
8
+ */var CharacteristicsButton=function CharacteristicsButton(_ref){var _variant$stock,_variant$stock2;var isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,variant=_ref.variant;var productIsNotAVariant=!variant;var featureIsNotEnabled=!isBackInStockEnabled;var productIsNotAvailable=(variant===null||variant===void 0?void 0:(_variant$stock=variant.stock)===null||_variant$stock===void 0?void 0:_variant$stock.quantity)===0&&(variant===null||variant===void 0?void 0:(_variant$stock2=variant.stock)===null||_variant$stock2===void 0?void 0:_variant$stock2.ignoreQuantity)===false;if(productIsNotAVariant||featureIsNotEnabled||!productIsNotAvailable)return null;return React.createElement(BackInStockButton,{subscription:subscription,stopPropagation:true,productId:variant.id,alignRight:true});};CharacteristicsButton.defaultProps={variant:{},subscription:null};export default withCurrentProduct(connect(CharacteristicsButton));
@@ -0,0 +1,3 @@
1
+ import{connect}from'react-redux';import{getIsBackInStockEnabled,makeGetSubscriptionByProduct}from'@shopgate/engage/back-in-stock/selectors';import{getProduct}from'@shopgate/engage/product';/**
2
+ * @return {Object} The extended component props.
3
+ */var makeMapStateToProps=function makeMapStateToProps(){var getSubscriptionByProduct=makeGetSubscriptionByProduct({status:'active'});return function(state,props){return{subscription:getSubscriptionByProduct(state,props),isBackInStockEnabled:getIsBackInStockEnabled(state,props),product:getProduct(state,props)};};};export default connect(makeMapStateToProps);
@@ -0,0 +1,10 @@
1
+ import React,{Fragment}from'react';import PropTypes from'prop-types';import{SurroundPortals}from'@shopgate/engage/components';import{PRODUCT_BACK_IN_STOCK}from'@shopgate/engage/back-in-stock/constants';import{BackInStockButton}from'@shopgate/engage/back-in-stock/components';import{withCurrentProduct}from'@shopgate/engage/core';import connect from"./connector";/**
2
+ * The ProductInfoBackInStockButton component.
3
+ * @param {Object} props The component props.
4
+ * @param {boolean} props.isBackInStockEnabled Whether the back in stock feature is enabled
5
+ * @param {string} props.productId The product id
6
+ * @param {string} props.variantId The variant id
7
+ * @param {Object} props.product The product
8
+ * @param {Object} props.subscription The subscription
9
+ * @return {JSX.Element}
10
+ */var ProductInfoBackInStockButton=function ProductInfoBackInStockButton(_ref){var _product$stock,_product$stock2;var productId=_ref.productId,variantId=_ref.variantId,isBackInStockEnabled=_ref.isBackInStockEnabled,subscription=_ref.subscription,product=_ref.product;var productIsAVariant=(product===null||product===void 0?void 0:product.type)!=='parent'&&(product===null||product===void 0?void 0:product.type)!==null;var productIsNotAvailable=(product===null||product===void 0?void 0:(_product$stock=product.stock)===null||_product$stock===void 0?void 0:_product$stock.quantity)===0&&(product===null||product===void 0?void 0:(_product$stock2=product.stock)===null||_product$stock2===void 0?void 0:_product$stock2.ignoreQuantity)===false;var showBackInStockButton=productIsAVariant&&productIsNotAvailable&&isBackInStockEnabled;return React.createElement(Fragment,null,React.createElement(SurroundPortals,{portalName:PRODUCT_BACK_IN_STOCK,portalProps:{showBackInStockButton:showBackInStockButton}},showBackInStockButton&&React.createElement(BackInStockButton,{showAsButton:true,subscription:subscription,isLinkToBackInStockEnabled:true,productId:variantId!==null&&variantId!==void 0?variantId:productId})));};ProductInfoBackInStockButton.defaultProps={subscription:null,variantId:null,product:null};export default withCurrentProduct(connect(ProductInfoBackInStockButton));
@@ -0,0 +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,{useCallback}from'react';import{css}from'glamor';import{LoadingIndicator,Accordion,Card}from'@shopgate/engage/components';import{i18n}from'@shopgate/engage/core';import{useBackInStockSubscriptions}from'@shopgate/engage/back-in-stock/hooks';import Subscription from"../Subscription";var styles={root:css({margin:'8px 8px 10px'}).toString(),divider:css({height:1,width:'calc(100% + 32px)',backgroundColor:'rgb(234, 234, 234)',marginLeft:-16,marginRight:-16,marginBottom:16}).toString(),emptyText:css({marginBottom:16}).toString()};/**
2
+ * The Back In Stock Subscriptions List.
3
+ * @returns {JSX}
4
+ */var List=function List(){var _useBackInStockSubscr=useBackInStockSubscriptions(),isInitial=_useBackInStockSubscr.isInitial,groupedSubscriptions=_useBackInStockSubscr.groupedSubscriptions;var _renderLabel=useCallback(function(groupKey){return React.createElement("div",null,i18n.text("back_in_stock.list_states.".concat(groupKey)));},[]);return React.createElement("div",null,Object.entries(groupedSubscriptions).map(function(_ref){var _ref2=_slicedToArray(_ref,2),groupKey=_ref2[0],filteredSubscriptions=_ref2[1];return React.createElement(Card,{className:styles.root,key:groupKey},React.createElement(Accordion,{className:"",openWithChevron:true,renderLabel:function renderLabel(){return _renderLabel(groupKey);},chevronPosition:"left",startOpened:true},React.createElement("div",{className:styles.divider}),isInitial?React.createElement(LoadingIndicator,null):null,!isInitial&&filteredSubscriptions.length===0?React.createElement("div",{className:styles.emptyText},i18n.text('back_in_stock.empty_list_reminder')):null,!isInitial&&filteredSubscriptions.map(function(subscription,index){return React.createElement("div",{key:subscription.subscriptionCode},React.createElement(Subscription,{subscription:subscription,productId:subscription.productCode,key:subscription.subscriptionCode,group:groupKey}),index===filteredSubscriptions.length-1?null:React.createElement("div",{className:styles.divider}));})));}));};export default List;
@@ -0,0 +1,7 @@
1
+ import React from'react';import{css}from'glamor';import{Link,Ripple,PriceInfo,CrossIcon,PriceStriked,Price,Availability}from'@shopgate/engage/components';import{getProductRoute,ProductImage}from'@shopgate/engage/product';import PropTypes from'prop-types';import classNames from'classnames';import{themeConfig}from'@shopgate/engage';import{BackInStockButton}from'@shopgate/engage/back-in-stock/components';import{getThemeSettings,i18n}from'@shopgate/engage/core';import{useBackInStockSubscriptions}from'@shopgate/engage/back-in-stock/hooks';var variables=themeConfig.variables;var styles={root:css({display:'flex',position:'relative',marginBottom:16}).toString(),imageContainer:css({flex:0.4,maxWidth:170,minWidth:70,paddingRight:'8px'}).toString(),infoContainer:css({flex:1}).toString(),infoContainerRow:css({display:'flex',justifyContent:'space-between'}).toString(),baseContainerRow:css({flexDirection:'column',display:'flex',marginTop:'8px'}).toString(),priceContainerRow:css({flexDirection:'column',display:'flex',alignItems:'end',marginTop:'8px'}).toString(),priceContainer:css({minWidth:100}).toString(),priceInfo:css({wordBreak:'break-word',fontSize:'0.875rem',lineHeight:'0.875rem',color:'var(--color-text-low-emphasis)',padding:"".concat(variables.gap.xsmall,"px 0"),textAlign:'right'}).toString(),titleContainer:css({}).toString(),title:css({fontSize:17,fontWeight:600,flexWrap:'wrap',overflowWrap:'anywhere'}).toString(),removeContainer:css({minWidth:'30px'}).toString(),availabilityText:css({fontSize:'0.875rem',marginBottom:'4px'}).toString(),characteristicText:css({fontSize:'0.875rem'}).toString(),ripple:css({minWidth:'17px'}).toString()};/**
2
+ * Renders on single Back in Stock subscription
3
+ * @param {Object} props Props.
4
+ * @param {string} props.subscription The subscription which should be rendered
5
+ * @returns {JSX}
6
+ */var Subscription=function Subscription(_ref){var _product$price,_product$price2,_product$price3,_product$price4,_product$characterist,_product$availability,_product$availability2;var subscription=_ref.subscription;var subscriptionCode=subscription.subscriptionCode,product=subscription.product,productCode=subscription.productCode;var _useBackInStockSubscr=useBackInStockSubscriptions(),removeBackInStockSubscription=_useBackInStockSubscr.removeBackInStockSubscription;var _ref2=getThemeSettings('AppImages')||{},gridResolutions=_ref2.ListImage;var currency=((_product$price=product.price)===null||_product$price===void 0?void 0:_product$price.currency)||'EUR';var defaultPrice=((_product$price2=product.price)===null||_product$price2===void 0?void 0:_product$price2.unitPrice)||0;var specialPrice=(_product$price3=product.price)===null||_product$price3===void 0?void 0:_product$price3.unitPriceStriked;var hasStrikePrice=((_product$price4=product.price)===null||_product$price4===void 0?void 0:_product$price4.discount)>0;var productLink=getProductRoute(product.id);return React.createElement("div",{className:styles.root},React.createElement(Link,{className:styles.imageContainer,component:"div",href:productLink,"aria-hidden":true},React.createElement(ProductImage,{src:product.featuredImageBaseUrl,resolutions:gridResolutions})),React.createElement("div",{className:styles.infoContainer},React.createElement("div",{className:styles.infoContainerRow},React.createElement(Link,{href:productLink,tag:"span",className:styles.titleContainer},React.createElement("span",{className:styles.title// eslint-disable-next-line react/no-danger
7
+ ,dangerouslySetInnerHTML:{__html:"".concat(product.name)}})),React.createElement("div",{className:styles.removeContainer},React.createElement("button",{onClick:function onClick(){return removeBackInStockSubscription({subscriptionCode:subscriptionCode});},type:"button","aria-label":i18n.text('favorites.remove')},React.createElement(Ripple,{className:styles.ripple},React.createElement(CrossIcon,null))))),React.createElement("div",{className:classNames(styles.baseContainerRow)},product===null||product===void 0?void 0:(_product$characterist=product.characteristics)===null||_product$characterist===void 0?void 0:_product$characterist.map(function(_ref3){var label=_ref3.label,value=_ref3.value;return React.createElement("div",{key:label+value,className:styles.characteristicText},label,': ',value);}),React.createElement(Availability,{text:product===null||product===void 0?void 0:(_product$availability=product.availability)===null||_product$availability===void 0?void 0:_product$availability.text,state:product===null||product===void 0?void 0:(_product$availability2=product.availability)===null||_product$availability2===void 0?void 0:_product$availability2.state,showWhenAvailable:false,className:styles.availabilityText}),(subscription===null||subscription===void 0?void 0:subscription.status)==='active'&&React.createElement(BackInStockButton,{subscription:subscription,productId:productCode})),React.createElement("div",{className:styles.priceContainerRow},hasStrikePrice?React.createElement(PriceStriked,{value:specialPrice,currency:currency}):null,React.createElement(Price,{currency:currency,discounted:hasStrikePrice,unitPrice:defaultPrice}),!!product.price.info&&React.createElement(PriceInfo,{text:product.price.info,className:styles.priceInfo}))));};export default Subscription;
@@ -0,0 +1,4 @@
1
+ import React from'react';import{BackInStockSubscriptionsProvider}from'@shopgate/engage/back-in-stock/providers';import List from"./components/List";/**
2
+ * The Back in Stock Subscriptions component.
3
+ * @returns {JSX}
4
+ */var Subscriptions=function Subscriptions(){return React.createElement(BackInStockSubscriptionsProvider,null,React.createElement(List,null));};export default Subscriptions;
@@ -0,0 +1 @@
1
+ export{default as BackInStockButton}from"./BackInStockButton";export{default as BackInStockReminders}from"./Subscriptions";export{default as ProductInfoBackInStockButton}from"./ProductInfoBackInStockButton";export{default as CharacteristicsButton}from"./CharacteristicsButton";
@@ -0,0 +1 @@
1
+ export var FETCH_BACK_IN_STOCK_SUBSCRIPTIONS='FETCH_BACK_IN_STOCK_SUBSCRIPTIONS';export var FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS='FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_SUCCESS';export var FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR='FETCH_BACK_IN_STOCK_SUBSCRIPTIONS_ERROR';export var ADD_BACK_IN_STOCK_SUBSCRIPTION='ADD_BACK_IN_STOCK_SUBSCRIPTION';export var ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS='ADD_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS';export var ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR='ADD_BACK_IN_STOCK_SUBSCRIPTION_ERROR';export var REMOVE_BACK_IN_STOCK_SUBSCRIPTION='REMOVE_BACK_IN_STOCK_SUBSCRIPTION';export var REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS='REMOVE_BACK_IN_STOCK_SUBSCRIPTION_SUCCESS';export var REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR='REMOVE_BACK_IN_STOCK_SUBSCRIPTION_ERROR';
@@ -0,0 +1 @@
1
+ export var BACK_IN_STOCK_PATTERN='/back-in-stock';
@@ -0,0 +1 @@
1
+ export var SHOPGATE_USER_GET_BACK_IN_STOCK_SUBSCRIPTIONS='shopgate.user.getBackInStockSubscriptions';export var SHOPGATE_USER_ADD_BACK_IN_STOCK_SUBSCRIPTION='shopgate.user.addBackInStockSubscription';export var SHOPGATE_USER_DELETE_BACK_IN_STOCK_SUBSCRIPTION='shopgate.user.removeBackInStockSubscription';