@faststore/core 2.2.9 → 2.2.11

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 (160) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +9 -9
  3. package/package.json +4 -4
  4. package/src/components/sections/ProductShelf/section.module.scss +0 -8
  5. package/src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx +3 -3
  6. package/src/components/ui/Carousel/Carousel.tsx +12 -5
  7. package/src/components/ui/ProductShelf/ProductShelf.tsx +8 -1
  8. package/.next/BUILD_ID +0 -1
  9. package/.next/build-manifest.json +0 -126
  10. package/.next/cache/.tsbuildinfo +0 -1
  11. package/.next/cache/config.json +0 -7
  12. package/.next/cache/eslint/.cache_1gneedd +0 -1
  13. package/.next/cache/next-server.js.nft.json +0 -1
  14. package/.next/cache/webpack/client-production/0.pack +0 -0
  15. package/.next/cache/webpack/client-production/index.pack +0 -0
  16. package/.next/cache/webpack/server-production/0.pack +0 -0
  17. package/.next/cache/webpack/server-production/index.pack +0 -0
  18. package/.next/export-marker.json +0 -1
  19. package/.next/images-manifest.json +0 -1
  20. package/.next/next-server.js.nft.json +0 -1
  21. package/.next/package.json +0 -1
  22. package/.next/prerender-manifest.json +0 -1
  23. package/.next/react-loadable-manifest.json +0 -47
  24. package/.next/required-server-files.json +0 -1
  25. package/.next/routes-manifest.json +0 -1
  26. package/.next/server/chunks/117.js +0 -430
  27. package/.next/server/chunks/177.js +0 -120
  28. package/.next/server/chunks/183.js +0 -121
  29. package/.next/server/chunks/184.js +0 -61
  30. package/.next/server/chunks/289.js +0 -240
  31. package/.next/server/chunks/312.js +0 -678
  32. package/.next/server/chunks/350.js +0 -200
  33. package/.next/server/chunks/386.js +0 -200
  34. package/.next/server/chunks/390.js +0 -550
  35. package/.next/server/chunks/398.js +0 -610
  36. package/.next/server/chunks/52.js +0 -4007
  37. package/.next/server/chunks/53.js +0 -61
  38. package/.next/server/chunks/574.js +0 -145
  39. package/.next/server/chunks/576.js +0 -121
  40. package/.next/server/chunks/585.js +0 -640
  41. package/.next/server/chunks/676.js +0 -32
  42. package/.next/server/chunks/693.js +0 -58
  43. package/.next/server/chunks/732.js +0 -1880
  44. package/.next/server/chunks/74.js +0 -3964
  45. package/.next/server/chunks/779.js +0 -58
  46. package/.next/server/chunks/817.js +0 -4007
  47. package/.next/server/chunks/825.js +0 -4074
  48. package/.next/server/chunks/854.js +0 -72
  49. package/.next/server/chunks/859.js +0 -959
  50. package/.next/server/chunks/863.js +0 -111
  51. package/.next/server/chunks/979.js +0 -1292
  52. package/.next/server/chunks/98.js +0 -163
  53. package/.next/server/chunks/988.js +0 -211
  54. package/.next/server/chunks/font-manifest.json +0 -1
  55. package/.next/server/font-manifest.json +0 -1
  56. package/.next/server/middleware-build-manifest.js +0 -1
  57. package/.next/server/middleware-manifest.json +0 -6
  58. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  59. package/.next/server/pages/404.js +0 -391
  60. package/.next/server/pages/404.js.nft.json +0 -1
  61. package/.next/server/pages/500.js +0 -395
  62. package/.next/server/pages/500.js.nft.json +0 -1
  63. package/.next/server/pages/[...slug].js +0 -1084
  64. package/.next/server/pages/[...slug].js.nft.json +0 -1
  65. package/.next/server/pages/[slug]/p.js +0 -2274
  66. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  67. package/.next/server/pages/_app.js +0 -287
  68. package/.next/server/pages/_app.js.nft.json +0 -1
  69. package/.next/server/pages/_document.js +0 -365
  70. package/.next/server/pages/_document.js.nft.json +0 -1
  71. package/.next/server/pages/_error.js +0 -164
  72. package/.next/server/pages/_error.js.nft.json +0 -1
  73. package/.next/server/pages/account.js +0 -370
  74. package/.next/server/pages/account.js.nft.json +0 -1
  75. package/.next/server/pages/api/graphql.js +0 -464
  76. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  77. package/.next/server/pages/api/health/live.js +0 -31
  78. package/.next/server/pages/api/health/live.js.nft.json +0 -1
  79. package/.next/server/pages/api/health/ready.js +0 -31
  80. package/.next/server/pages/api/health/ready.js.nft.json +0 -1
  81. package/.next/server/pages/api/preview.js +0 -137
  82. package/.next/server/pages/api/preview.js.nft.json +0 -1
  83. package/.next/server/pages/checkout.js +0 -370
  84. package/.next/server/pages/checkout.js.nft.json +0 -1
  85. package/.next/server/pages/en-US/404.html +0 -81
  86. package/.next/server/pages/en-US/404.json +0 -1
  87. package/.next/server/pages/en-US/500.html +0 -81
  88. package/.next/server/pages/en-US/500.json +0 -1
  89. package/.next/server/pages/en-US/account.html +0 -81
  90. package/.next/server/pages/en-US/account.json +0 -1
  91. package/.next/server/pages/en-US/checkout.html +0 -81
  92. package/.next/server/pages/en-US/checkout.json +0 -1
  93. package/.next/server/pages/en-US/login.html +0 -81
  94. package/.next/server/pages/en-US/login.json +0 -1
  95. package/.next/server/pages/en-US/s.html +0 -81
  96. package/.next/server/pages/en-US/s.json +0 -1
  97. package/.next/server/pages/en-US.html +0 -90
  98. package/.next/server/pages/en-US.json +0 -1
  99. package/.next/server/pages/index.js +0 -439
  100. package/.next/server/pages/index.js.nft.json +0 -1
  101. package/.next/server/pages/login.js +0 -382
  102. package/.next/server/pages/login.js.nft.json +0 -1
  103. package/.next/server/pages/s.js +0 -555
  104. package/.next/server/pages/s.js.nft.json +0 -1
  105. package/.next/server/pages-manifest.json +0 -18
  106. package/.next/server/webpack-api-runtime.js +0 -229
  107. package/.next/server/webpack-runtime.js +0 -229
  108. package/.next/static/NaTRwyQZyZDoWO4cjK1rg/_buildManifest.js +0 -1
  109. package/.next/static/NaTRwyQZyZDoWO4cjK1rg/_ssgManifest.js +0 -1
  110. package/.next/static/chunks/251.1c79f06f2a2814b1.js +0 -1
  111. package/.next/static/chunks/386.d01e0db26c523f0f.js +0 -1
  112. package/.next/static/chunks/400-7ce14b0f942135d1.js +0 -1
  113. package/.next/static/chunks/520-5a9ae7339f19a163.js +0 -1
  114. package/.next/static/chunks/574.70612be06fd1365f.js +0 -1
  115. package/.next/static/chunks/585.4c5d40fc6a72a611.js +0 -1
  116. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  117. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  118. package/.next/static/chunks/742-e32d18d91fe6f08b.js +0 -1
  119. package/.next/static/chunks/783-3e062af27686427b.js +0 -1
  120. package/.next/static/chunks/800.ee4f8b9622001e8c.js +0 -1
  121. package/.next/static/chunks/98.40c7e17d9de4eb8f.js +0 -1
  122. package/.next/static/chunks/988.afda042dd9ba11d1.js +0 -1
  123. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  124. package/.next/static/chunks/main-e4e873ee741162eb.js +0 -1
  125. package/.next/static/chunks/pages/404-d186c22d910fecbb.js +0 -1
  126. package/.next/static/chunks/pages/500-c6f28e1de16c5aab.js +0 -1
  127. package/.next/static/chunks/pages/[...slug]-c7c8e53be9021135.js +0 -1
  128. package/.next/static/chunks/pages/[slug]/p-4441e76801e44b50.js +0 -1
  129. package/.next/static/chunks/pages/_app-48d56037a2534a44.js +0 -1
  130. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  131. package/.next/static/chunks/pages/account-46edcd73944d7924.js +0 -1
  132. package/.next/static/chunks/pages/checkout-49faa1acf04be10c.js +0 -1
  133. package/.next/static/chunks/pages/index-5088cf4fabfe4812.js +0 -1
  134. package/.next/static/chunks/pages/login-e944d38d65d2eea5.js +0 -1
  135. package/.next/static/chunks/pages/s-b8b561b006b5056f.js +0 -1
  136. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  137. package/.next/static/chunks/webpack-743ed70fcff99e29.js +0 -1
  138. package/.next/static/css/527e334fa69cf40a.css +0 -1
  139. package/.next/static/css/5d1f64b61ea581f4.css +0 -1
  140. package/.next/static/css/6a7fdc5a21fbead5.css +0 -1
  141. package/.next/static/css/6e1a7434f061d0ef.css +0 -1
  142. package/.next/static/css/723835bce380750d.css +0 -1
  143. package/.next/static/css/8f93a4630936c20b.css +0 -1
  144. package/.next/static/css/9f79fa103f49bca1.css +0 -1
  145. package/.next/static/css/a2eefb25a4608343.css +0 -1
  146. package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
  147. package/.next/static/css/df588bb98c0b0ca6.css +0 -1
  148. package/.next/static/css/fd27ecc37832aa54.css +0 -1
  149. package/.next/trace +0 -77
  150. package/public/~partytown/debug/partytown-atomics.js +0 -556
  151. package/public/~partytown/debug/partytown-media.js +0 -374
  152. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  153. package/public/~partytown/debug/partytown-sw.js +0 -59
  154. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  155. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  156. package/public/~partytown/debug/partytown.js +0 -72
  157. package/public/~partytown/partytown-atomics.js +0 -2
  158. package/public/~partytown/partytown-media.js +0 -2
  159. package/public/~partytown/partytown-sw.js +0 -2
  160. package/public/~partytown/partytown.js +0 -2
@@ -1,2274 +0,0 @@
1
- (() => {
2
- var exports = {};
3
- exports.id = 103;
4
- exports.ids = [103];
5
- exports.modules = {
6
-
7
- /***/ 2951:
8
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
9
-
10
- "use strict";
11
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
12
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
14
- /* harmony export */ });
15
- /* harmony import */ var src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7599);
16
- /* harmony import */ var src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8170);
17
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3271);
18
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5411);
19
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_2__);
20
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
21
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
22
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__]);
23
- src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
- function BannerNewsletter({
32
- banner,
33
- newsletter
34
- }) {
35
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Section__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
36
- className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_2___default().section)} section-banner-newsletter`,
37
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
38
- "data-fs-banner-text-newsletter": true,
39
- "data-fs-content": "banner-newsletter",
40
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
41
- title: banner.title,
42
- caption: banner.caption,
43
- link: banner?.link,
44
- variant: banner.variant,
45
- colorVariant: banner.colorVariant
46
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
47
- title: newsletter.title,
48
- description: newsletter.description,
49
- icon: newsletter.icon,
50
- privacyPolicy: newsletter.privacyPolicy,
51
- emailInputLabel: newsletter.emailInputLabel,
52
- displayNameInput: newsletter.displayNameInput,
53
- nameInputLabel: newsletter.nameInputLabel,
54
- subscribeButtonLabel: newsletter.subscribeButtonLabel,
55
- toastSubscribe: newsletter.toastSubscribe,
56
- toastSubscribeError: newsletter.toastSubscribeError,
57
- card: newsletter.card
58
- })]
59
- })
60
- });
61
- }
62
-
63
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerNewsletter);
64
- __webpack_async_result__();
65
- } catch(e) { __webpack_async_result__(e); } });
66
-
67
- /***/ }),
68
-
69
- /***/ 994:
70
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
71
-
72
- "use strict";
73
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
74
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
75
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
76
- /* harmony export */ });
77
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
78
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
79
- /* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7691);
80
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
81
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
82
- /* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5953);
83
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6627);
84
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__);
85
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3271);
86
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(997);
87
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
88
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__]);
89
- src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- const CrossSellingShelf = ({
99
- numberOfItems,
100
- title,
101
- kind
102
- }) => {
103
- const {
104
- ref,
105
- inView
106
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
107
- const context = (0,src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__/* .usePDP */ .al)();
108
- const productGroupID = context?.data?.product?.isVariantOf?.productGroupID;
109
- const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
110
- key: kind,
111
- value: productGroupID
112
- }], [kind, productGroupID]);
113
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_Section__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
114
- className: `${(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default().section)} section-product-shelf layout__section`,
115
- ref: ref,
116
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
117
- inView: inView,
118
- numberOfItems: numberOfItems,
119
- title: title,
120
- selectedFacets: selectedFacets
121
- })
122
- });
123
- };
124
-
125
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CrossSellingShelf);
126
- __webpack_async_result__();
127
- } catch(e) { __webpack_async_result__(e); } });
128
-
129
- /***/ }),
130
-
131
- /***/ 2694:
132
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
133
-
134
- "use strict";
135
-
136
- // EXPORTS
137
- __webpack_require__.d(__webpack_exports__, {
138
- "Z": () => (/* binding */ ProductDetails_ProductDetails)
139
- });
140
-
141
- // UNUSED EXPORTS: fragment
142
-
143
- // EXTERNAL MODULE: external "react"
144
- var external_react_ = __webpack_require__(6689);
145
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
146
- // EXTERNAL MODULE: ../sdk/dist/analytics/sendAnalyticsEvent.js
147
- var sendAnalyticsEvent = __webpack_require__(1072);
148
- // EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
149
- var useFormattedPrice = __webpack_require__(5346);
150
- // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
151
- var session = __webpack_require__(7295);
152
- // EXTERNAL MODULE: ./src/components/sections/Section/Section.tsx
153
- var Section = __webpack_require__(3271);
154
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/Accordion.js
155
- var Accordion = __webpack_require__(1516);
156
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionItem.js
157
- var AccordionItem = __webpack_require__(783);
158
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionButton.js
159
- var AccordionButton = __webpack_require__(7734);
160
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionPanel.js
161
- var AccordionPanel = __webpack_require__(5208);
162
- // EXTERNAL MODULE: external "react/jsx-runtime"
163
- var jsx_runtime_ = __webpack_require__(997);
164
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDescription/ProductDescription.tsx
165
-
166
-
167
-
168
-
169
-
170
- function ProductDescription({
171
- descriptionData,
172
- initiallyExpanded = 'first'
173
- }) {
174
- /**
175
- * Maps 'initiallyExpanded' prop values to indices
176
- */
177
- const INITIALLY_EXPANDED_MAP = (0,external_react_.useMemo)(() => ({
178
- none: [],
179
- first: [0],
180
- all: [0, 1, 2, 3]
181
- }), []);
182
- const {
183
- 0: indices,
184
- 1: setIndices
185
- } = (0,external_react_.useState)(new Set(INITIALLY_EXPANDED_MAP[initiallyExpanded]));
186
-
187
- const onChange = index => {
188
- setIndices(currentIndices => {
189
- const newIndices = new Set(currentIndices);
190
-
191
- if (currentIndices.has(index)) {
192
- newIndices.delete(index);
193
- } else {
194
- newIndices.add(index);
195
- }
196
-
197
- return newIndices;
198
- });
199
- };
200
-
201
- return /*#__PURE__*/jsx_runtime_.jsx("section", {
202
- "data-fs-product-description": true,
203
- children: /*#__PURE__*/jsx_runtime_.jsx(Accordion/* default */.Z, {
204
- indices: indices,
205
- onChange: onChange,
206
- "aria-label": "Product Details Content",
207
- children: descriptionData.map(({
208
- title,
209
- content
210
- }, index) => /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
211
- as: "article",
212
- index: index,
213
- prefixId: "product-description",
214
- "data-fs-product-details-description": true,
215
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
216
- children: title
217
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
218
- children: /*#__PURE__*/jsx_runtime_.jsx("div", {
219
- // Applies display: contents through FastStore UI
220
- "data-fs-product-details-description-content": true // The content is already sanitized by FastStore API
221
- ,
222
- dangerouslySetInnerHTML: {
223
- __html: content
224
- }
225
- })
226
- })]
227
- }, String(index)))
228
- })
229
- });
230
- }
231
-
232
- /* harmony default export */ const ProductDescription_ProductDescription = (ProductDescription);
233
- // EXTERNAL MODULE: ../components/dist/esm/hooks/UIProvider.js
234
- var UIProvider = __webpack_require__(6652);
235
- // EXTERNAL MODULE: ./src/sdk/cart/index.ts + 1 modules
236
- var cart = __webpack_require__(6073);
237
- ;// CONCATENATED MODULE: ./src/sdk/cart/useBuyButton.ts
238
-
239
-
240
-
241
-
242
-
243
- const useBuyButton = item => {
244
- const {
245
- openCart
246
- } = (0,UIProvider/* useUI */.l)();
247
- const {
248
- currency: {
249
- code
250
- }
251
- } = (0,session/* useSession */.kP)();
252
- const onClick = (0,external_react_.useCallback)(e => {
253
- e.preventDefault();
254
-
255
- if (!item) {
256
- return;
257
- }
258
-
259
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
260
- name: 'add_to_cart',
261
- params: {
262
- currency: code,
263
- // TODO: In the future, we can explore more robust ways of
264
- // calculating the value (gift items, discounts, etc.).
265
- value: item.price * item.quantity,
266
- items: [{
267
- item_id: item.itemOffered.isVariantOf.productGroupID,
268
- item_name: item.itemOffered.isVariantOf.name,
269
- item_brand: item.itemOffered.brand.name,
270
- item_variant: item.itemOffered.sku,
271
- quantity: item.quantity,
272
- price: item.price,
273
- discount: item.listPrice - item.price,
274
- currency: code,
275
- item_variant_name: item.itemOffered.name,
276
- product_reference_id: item.itemOffered.gtin
277
- }]
278
- }
279
- });
280
- cart/* cartStore.addItem */.i8.addItem(item);
281
- openCart();
282
- }, [code, item, openCart]);
283
- return {
284
- onClick,
285
- 'data-testid': 'buy-button',
286
- 'data-sku': item?.itemOffered.sku,
287
- 'data-seller': item?.seller.identifier
288
- };
289
- };
290
- // EXTERNAL MODULE: ./node_modules/next/link.js
291
- var next_link = __webpack_require__(1664);
292
- var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
293
- // EXTERNAL MODULE: ./src/components/ui/Image/Image.tsx + 1 modules
294
- var Image = __webpack_require__(5731);
295
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Rating/Rating.js
296
- var Rating = __webpack_require__(3024);
297
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/ProductTitle/ProductTitle.js
298
-
299
-
300
- const ProductTitle = (0,external_react_.forwardRef)(function ProductTitle({ title, label, refTag = 'Ref.: ', refNumber, testId = 'fs-product-title', ratingValue, ...otherProps }, ref) {
301
- return (external_react_default().createElement("header", { ref: ref, "data-fs-product-title": true, "data-testid": testId, ...otherProps },
302
- external_react_default().createElement("div", { "data-fs-product-title-header": true },
303
- title,
304
- !!label && label),
305
- (refNumber || ratingValue) && (external_react_default().createElement("div", { "data-fs-product-title-addendum": true },
306
- ratingValue && external_react_default().createElement(Rating/* default */.Z, { value: ratingValue }),
307
- refNumber && (external_react_default().createElement((external_react_default()).Fragment, null,
308
- refTag,
309
- " ",
310
- refNumber))))));
311
- });
312
- /* harmony default export */ const ProductTitle_ProductTitle = (ProductTitle);
313
- //# sourceMappingURL=ProductTitle.js.map
314
- // EXTERNAL MODULE: ../components/dist/esm/molecules/DiscountBadge/DiscountBadge.js + 1 modules
315
- var DiscountBadge = __webpack_require__(2946);
316
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Button/Button.js
317
- var Button = __webpack_require__(3339);
318
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/BuyButton/BuyButton.js
319
-
320
-
321
- function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
322
- return (external_react_default().createElement(Button/* default */.Z, { "data-fs-buy-button": true, icon: icon, iconPosition: "left", "data-testid": testId, ...otherProps }, children));
323
- }
324
- /* harmony default export */ const BuyButton_BuyButton = (BuyButton);
325
- //# sourceMappingURL=BuyButton.js.map
326
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
327
- var Icon = __webpack_require__(2614);
328
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Price/Price.js
329
- var Price = __webpack_require__(9767);
330
- // EXTERNAL MODULE: ../components/dist/esm/molecules/QuantitySelector/QuantitySelector.js
331
- var QuantitySelector = __webpack_require__(6693);
332
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Label/Label.js
333
- var Label = __webpack_require__(1953);
334
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Link/Link.js
335
- var Link = __webpack_require__(4272);
336
- // EXTERNAL MODULE: ../components/dist/esm/atoms/SROnly/SROnly.js
337
- var SROnly = __webpack_require__(5450);
338
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useDefineVariant.js
339
-
340
- const getImageName = (src) => {
341
- const sourcePath = new URL(src).pathname;
342
- const imageName = sourcePath.split('/').slice(-1)[0];
343
- return imageName;
344
- };
345
- const useDefineVariant = (options, variant) => (0,external_react_.useMemo)(() => {
346
- if (variant)
347
- return variant;
348
- const allOptionsHaveHexColor = options.every((option) => option.hexColor);
349
- if (allOptionsHaveHexColor) {
350
- return 'color';
351
- }
352
- const firstImageName = options[0]?.src && getImageName(options[0].src);
353
- const areSourcesEqualsOrNull = options.every((option) => {
354
- if (!option.src) {
355
- return true;
356
- }
357
- const optionImageName = getImageName(option.src);
358
- return optionImageName === firstImageName;
359
- });
360
- if (!areSourcesEqualsOrNull) {
361
- return 'image';
362
- }
363
- return 'label';
364
- }, [options, variant]);
365
- //# sourceMappingURL=useDefineVariant.js.map
366
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useSkuSlug.js
367
-
368
- function getSkuSlug(slugsMap, selectedVariations, dominantVariation) {
369
- const slugsMapKey = Object.entries(selectedVariations).flat().join('-');
370
- if (slugsMapKey in slugsMap) {
371
- return slugsMap[slugsMapKey];
372
- }
373
- const possibleVariants = Object.keys(slugsMap);
374
- const firstVariationForDominantValue = possibleVariants.find((slug) => slug.includes(`${dominantVariation}-${selectedVariations[dominantVariation]}`));
375
- return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]];
376
- }
377
- const useSkuSlug = (activeVariations, slugsMap, skuPropertyName, getItemHrefProp) => {
378
- const getItemHref = (0,external_react_.useCallback)((option) => {
379
- if (getItemHrefProp)
380
- return { getItemHrefProp };
381
- const currentItemHref = `/${getSkuSlug(slugsMap, {
382
- ...activeVariations,
383
- [skuPropertyName]: option.value,
384
- }, skuPropertyName)}/p`;
385
- return currentItemHref;
386
- }, [activeVariations, getItemHrefProp, slugsMap, skuPropertyName]);
387
- return { getItemHref };
388
- };
389
- //# sourceMappingURL=useSkuSlug.js.map
390
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/SkuSelector.js
391
-
392
-
393
-
394
-
395
- // TODO: Change by ImageComponent when it be right
396
- const ImageComponentFallback = ({ src, alt, ...otherProps }) => external_react_default().createElement("img", { src: src, alt: alt, ...otherProps });
397
- const SkuSelector = (0,external_react_.forwardRef)(function SkuSelector({ availableVariations, skuPropertyName, testId, activeVariations, linkProps, slugsMap, getItemHref: getItemHrefProp, ImageComponent = ImageComponentFallback, variant: variantProp, ...otherProps }, ref) {
398
- const activeSelectorValue = activeVariations[skuPropertyName];
399
- const options = availableVariations[skuPropertyName];
400
- const variant = useDefineVariant(options, variantProp);
401
- const { getItemHref } = useSkuSlug(activeVariations, slugsMap, skuPropertyName, getItemHrefProp);
402
- return (external_react_default().createElement("div", { ref: ref, "data-fs-sku-selector": true, "data-testid": testId, "data-fs-sku-selector-variant": variant, ...otherProps },
403
- skuPropertyName && (external_react_default().createElement(Label/* default */.Z, { "data-fs-sku-selector-title": true },
404
- skuPropertyName,
405
- ": ",
406
- external_react_default().createElement("strong", null, activeSelectorValue))),
407
- external_react_default().createElement("ul", { "data-fs-sku-selector-list": true }, options.map((option, index) => {
408
- return (external_react_default().createElement("li", { key: String(index), title: option.label, "data-fs-sku-selector-option": true, "data-fs-sku-selector-disabled": option.disabled, "data-fs-sku-selector-checked": option.value === activeVariations[skuPropertyName] },
409
- external_react_default().createElement(Link/* default */.Z, { "data-fs-sku-selector-option-link": true, href: getItemHref(option), ...linkProps },
410
- external_react_default().createElement(SROnly/* default */.Z, { text: option.label })),
411
- variant === 'label' && external_react_default().createElement("span", null, option.value),
412
- variant === 'image' && ImageComponent && (external_react_default().createElement("span", null,
413
- external_react_default().createElement(ImageComponent, { src: option.src ?? '', alt: option.alt ?? '', "data-fs-sku-selector-option-image": true }))),
414
- variant === 'color' && (external_react_default().createElement("span", null,
415
- external_react_default().createElement("div", { "data-fs-sku-selector-option-color": true, title: option.value, style: {
416
- '--data-fs-sku-selector-option-color-bkg-color': option.hexColor,
417
- } })))));
418
- }))));
419
- });
420
- /* harmony default export */ const SkuSelector_SkuSelector = (SkuSelector);
421
- //# sourceMappingURL=SkuSelector.js.map
422
- // EXTERNAL MODULE: ../components/dist/esm/molecules/InputField/InputField.js
423
- var InputField = __webpack_require__(3779);
424
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/Table.js
425
-
426
- const Table = (0,external_react_.forwardRef)(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
427
- return (external_react_default().createElement("div", { "data-fs-table": true },
428
- external_react_default().createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
429
- });
430
- /* harmony default export */ const Table_Table = (Table);
431
- //# sourceMappingURL=Table.js.map
432
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableBody.js
433
-
434
- const TableBody = (0,external_react_.forwardRef)(function TableBody({ children, testId = 'fs-table-body', ...otherProps }, ref) {
435
- return (external_react_default().createElement("tbody", { ref: ref, "data-testid": testId, "data-fs-table-body": true, ...otherProps }, children));
436
- });
437
- /* harmony default export */ const Table_TableBody = (TableBody);
438
- //# sourceMappingURL=TableBody.js.map
439
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableRow.js
440
-
441
- const TableRow = (0,external_react_.forwardRef)(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
442
- return (external_react_default().createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
443
- });
444
- /* harmony default export */ const Table_TableRow = (TableRow);
445
- //# sourceMappingURL=TableRow.js.map
446
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableCell.js
447
-
448
- const TableCell = (0,external_react_.forwardRef)(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
449
- const Cell = variant === 'header' ? 'th' : 'td';
450
- return (external_react_default().createElement(Cell, { ref: ref, "data-fs-table-cell": variant, "data-fs-table-cell-align": align, "data-testid": testId, scope: scope, ...otherProps }, children));
451
- });
452
- /* harmony default export */ const Table_TableCell = (TableCell);
453
- //# sourceMappingURL=TableCell.js.map
454
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ShippingSimulation/ShippingSimulation.js
455
-
456
-
457
- function ShippingSimulation({ testId = 'fs-shipping-simulation', formatter, title = 'Shipping', inputLabel = 'Postal Code', optionsLabel = 'Shipping options', idkPostalCodeLinkProps, onInput, onSubmit, onClear, location, options = [], displayClearButton = false, errorMessage, postalCode, ...otherProps }) {
458
- const hasShippingOptions = !!options && options.length > 0;
459
- return (external_react_default().createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
460
- external_react_default().createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
461
- external_react_default().createElement(InputField/* default */.Z, { actionable: true, error: errorMessage, id: `${testId}-input-field`, label: inputLabel, value: postalCode, onInput: (event) => onInput?.(event), onSubmit: () => onSubmit?.(), onClear: () => onClear?.(), displayClearButton: displayClearButton }),
462
- external_react_default().createElement(Link/* default */.Z, { href: "/", "data-fs-shipping-simulation-link": true, size: "small", ...idkPostalCodeLinkProps }, idkPostalCodeLinkProps?.children ?? (external_react_default().createElement((external_react_default()).Fragment, null,
463
- "I don't know my Postal Code",
464
- external_react_default().createElement(Icon/* default */.Z, { name: "ArrowSquareOut", width: 20, height: 20 })))),
465
- hasShippingOptions && (external_react_default().createElement((external_react_default()).Fragment, null,
466
- external_react_default().createElement("header", { "data-fs-shipping-simulation-header": true },
467
- external_react_default().createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
468
- external_react_default().createElement("p", { "data-fs-shipping-simulation-location": true }, location)),
469
- external_react_default().createElement(Table_Table, null,
470
- external_react_default().createElement(Table_TableBody, null, options.map((option) => (external_react_default().createElement(Table_TableRow, { key: option.carrier },
471
- external_react_default().createElement(Table_TableCell, { align: "left" }, option.carrier),
472
- external_react_default().createElement(Table_TableCell, null, option.localizedEstimates),
473
- external_react_default().createElement(Table_TableCell, { align: "right" }, option.price && (external_react_default().createElement(Price/* default */.Z, { formatter: formatter, value: option.price, SRText: "price" }))))))))))));
474
- }
475
- /* harmony default export */ const ShippingSimulation_ShippingSimulation = (ShippingSimulation);
476
- //# sourceMappingURL=ShippingSimulation.js.map
477
- // EXTERNAL MODULE: external "react-intersection-observer"
478
- var external_react_intersection_observer_ = __webpack_require__(9785);
479
- // EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
480
- var IconButton = __webpack_require__(7041);
481
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallerySelector.js
482
-
483
-
484
-
485
- const SCROLL_MARGIN_VALUE = 400;
486
- const moveScroll = (container, value) => {
487
- if (container) {
488
- if (container.scrollHeight > container.clientHeight) {
489
- // TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
490
- container.style.overflow = 'auto';
491
- window.requestAnimationFrame(() => container.scrollTo({ top: value, behavior: 'smooth' }));
492
- setTimeout(() => (container.style.overflow = 'hidden'), 2000);
493
- }
494
- else {
495
- container.scrollLeft += value;
496
- }
497
- }
498
- };
499
- const hasScroll = (container) => {
500
- if (container) {
501
- return (container.scrollHeight > container.clientHeight ||
502
- container.scrollWidth > container.clientWidth);
503
- }
504
- return false;
505
- };
506
- function ImageGallerySelector({ images, onSelect, ImageComponent, currentImageIdx, testId = 'fs-image-gallery-selector', 'aria-label': ariaLabel = 'Product Images', navigationButtonLeftAriaLabel = 'Backward slide image selector', navigationButtonRightAriaLabel = 'Forward slide image selector', }) {
507
- const elementsRef = (0,external_react_.useRef)(null);
508
- const elementHasScroll = hasScroll(elementsRef.current);
509
- const [firstImageInView, setFirstImageInView] = (0,external_react_.useState)(true);
510
- const [lastImageInView, setLastImageInView] = (0,external_react_.useState)(true);
511
- const inViewChange = (0,external_react_.useCallback)((idx, inView) => {
512
- idx === 0 && setFirstImageInView(inView);
513
- idx === images.length - 1 && setLastImageInView(inView);
514
- }, [images.length]);
515
- return (external_react_default().createElement("section", { "data-fs-image-gallery-selector": true, "data-testid": testId, "aria-label": ariaLabel },
516
- elementHasScroll && !firstImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
517
- external_react_default().createElement(IconButton/* default */.Z, { "data-fs-image-gallery-selector-control-button": true, "aria-label": navigationButtonLeftAriaLabel, icon: external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft" }), onClick: () => moveScroll(elementsRef.current, -SCROLL_MARGIN_VALUE) }))),
518
- external_react_default().createElement("div", { "data-fs-image-gallery-selector-elements": true, ref: elementsRef }, images.map((image, idx) => {
519
- return (external_react_default().createElement(external_react_intersection_observer_.InView, { key: idx, onChange: (inView) => inViewChange(idx, inView) },
520
- external_react_default().createElement(Button/* default */.Z, { key: idx, "aria-label": `${image.alternateName} - Image ${idx + 1} of ${images.length}`, onClick: () => onSelect(idx), "data-fs-image-gallery-selector-thumbnail": idx === currentImageIdx ? 'selected' : 'true' },
521
- external_react_default().createElement(ImageComponent, { url: image.url ?? '', loading: idx === 0 ? 'eager' : 'lazy', alternateName: image.alternateName ?? '' }))));
522
- })),
523
- elementHasScroll && !lastImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
524
- external_react_default().createElement(IconButton/* default */.Z, { "data-fs-image-gallery-selector-control-button": true, "aria-label": navigationButtonRightAriaLabel, icon: external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft" }), onClick: () => moveScroll(elementsRef.current, +SCROLL_MARGIN_VALUE) })))));
525
- }
526
- /* harmony default export */ const ImageGallery_ImageGallerySelector = (ImageGallerySelector);
527
- //# sourceMappingURL=ImageGallerySelector.js.map
528
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallery.js
529
-
530
-
531
- const ImageGallery = (0,external_react_.forwardRef)(function ImageGallery({ images, children, ImageComponent, selectedImageIdx, imagePosition = 'center', setSelectedImageIdx, testId = 'fs-image-gallery', ...otherProps }, ref) {
532
- const hasSelector = images.length > 1;
533
- return (external_react_default().createElement("section", { ref: ref, "data-fs-image-gallery": hasSelector ? 'with-selector' : 'without-selector', "data-fs-image-gallery-position": imagePosition, "data-testid": testId, ...otherProps },
534
- children,
535
- hasSelector && (external_react_default().createElement(ImageGallery_ImageGallerySelector, { images: images, onSelect: setSelectedImageIdx, currentImageIdx: selectedImageIdx, ImageComponent: ImageComponent }))));
536
- });
537
- /* harmony default export */ const ImageGallery_ImageGallery = (ImageGallery);
538
- //# sourceMappingURL=ImageGallery.js.map
539
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGalleryViewer.js
540
-
541
- const ImageGalleryViewer = ({ children, }) => {
542
- return external_react_default().createElement((external_react_default()).Fragment, null, children);
543
- };
544
- /* harmony default export */ const ImageGallery_ImageGalleryViewer = (ImageGalleryViewer);
545
- //# sourceMappingURL=ImageGalleryViewer.js.map
546
- // EXTERNAL MODULE: external "next/router"
547
- var router_ = __webpack_require__(1853);
548
- ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/ImageGallery.tsx
549
- const _excluded = ["images", "imagePosition"];
550
-
551
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
552
-
553
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
554
-
555
- 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; }
556
-
557
- 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; }
558
-
559
- 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; }
560
-
561
-
562
-
563
-
564
-
565
-
566
- const ImageComponent = ({
567
- url,
568
- alternateName
569
- }) => {
570
- return /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGalleryImage.Component, {
571
- src: url,
572
- alt: alternateName,
573
- width: 68,
574
- height: 68
575
- });
576
- };
577
-
578
- const ImageGallery_ImageGallery_ImageGallery = _ref => {
579
- let {
580
- images,
581
- imagePosition
582
- } = _ref,
583
- otherProps = _objectWithoutProperties(_ref, _excluded);
584
-
585
- const {
586
- 0: selectedImageIdx,
587
- 1: setSelectedImageIdx
588
- } = (0,external_react_.useState)(0);
589
- const currentImage = images[selectedImageIdx] ?? images[0];
590
- const dynamicRoute = (0,router_.useRouter)().asPath;
591
- (0,external_react_.useEffect)(() => setSelectedImageIdx(0), [dynamicRoute]);
592
- return /*#__PURE__*/jsx_runtime_.jsx(Overrides_ImageGallery.Component, _objectSpread(_objectSpread(_objectSpread({}, Overrides_ImageGallery.props), {}, {
593
- images: images,
594
- ImageComponent: ImageComponent,
595
- selectedImageIdx: selectedImageIdx,
596
- setSelectedImageIdx: setSelectedImageIdx,
597
- imagePosition: imagePosition ?? Overrides_ImageGallery.props.imagePosition
598
- }, otherProps), {}, {
599
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides_ImageGalleryViewer.Component, _objectSpread(_objectSpread({}, Overrides_ImageGalleryViewer.props), {}, {
600
- children: /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGalleryImage.Component, _objectSpread(_objectSpread({
601
- sizes: "(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw",
602
- width: 691,
603
- height: 691 * (3 / 4),
604
- loading: "eager"
605
- }, __experimentalImageGalleryImage.props), {}, {
606
- src: currentImage.url,
607
- alt: currentImage.alternateName
608
- }))
609
- }))
610
- }));
611
- };
612
-
613
- /* harmony default export */ const ui_ImageGallery_ImageGallery = (ImageGallery_ImageGallery_ImageGallery);
614
- // EXTERNAL MODULE: ./src/sdk/graphql/request.ts
615
- var request = __webpack_require__(180);
616
- ;// CONCATENATED MODULE: ./src/sdk/shipping/index.ts
617
-
618
- const query = "ClientShippingSimulationQuery";
619
- const getShippingSimulation = async ({
620
- items,
621
- postalCode,
622
- country
623
- }) => {
624
- const data = await (0,request/* request */.W)(query, {
625
- items,
626
- postalCode,
627
- country
628
- });
629
- return data;
630
- };
631
- /* harmony default export */ const shipping = (getShippingSimulation);
632
- ;// CONCATENATED MODULE: ./src/sdk/shipping/useShippingSimulation.ts
633
- function useShippingSimulation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
634
-
635
- function useShippingSimulation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? useShippingSimulation_ownKeys(Object(source), !0).forEach(function (key) { useShippingSimulation_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : useShippingSimulation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
636
-
637
- function useShippingSimulation_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; }
638
-
639
-
640
-
641
-
642
-
643
- const createEmptySimulation = () => ({
644
- input: {
645
- postalCode: '',
646
- displayClearButton: false,
647
- errorMessage: ''
648
- },
649
- shippingSimulation: undefined
650
- });
651
-
652
- const reducer = (state, action) => {
653
- const {
654
- type
655
- } = action;
656
-
657
- switch (type) {
658
- case 'clear':
659
- {
660
- return createEmptySimulation();
661
- }
662
-
663
- case 'update':
664
- {
665
- const {
666
- payload
667
- } = action;
668
- return {
669
- input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload.input),
670
- shippingSimulation: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.shippingSimulation), payload.shippingSimulation)
671
- };
672
- }
673
-
674
- case 'onInput':
675
- {
676
- const {
677
- payload
678
- } = action;
679
- return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
680
- input: useShippingSimulation_objectSpread({}, payload)
681
- });
682
- }
683
-
684
- case 'onError':
685
- {
686
- const {
687
- payload
688
- } = action;
689
- return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
690
- input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload)
691
- });
692
- }
693
-
694
- default:
695
- throw new Error(`Action ${type} not implemented`);
696
- }
697
- };
698
-
699
- const useShippingSimulation = shippingItem => {
700
- const {
701
- 0: {
702
- input,
703
- shippingSimulation
704
- },
705
- 1: dispatch
706
- } = (0,external_react_.useReducer)(reducer, null, createEmptySimulation);
707
- const {
708
- country,
709
- postalCode: sessionPostalCode
710
- } = (0,session/* useSession */.kP)();
711
- const {
712
- postalCode: shippingPostalCode
713
- } = input;
714
- const shippingPostalCodeRef = (0,external_react_.useRef)(shippingPostalCode);
715
- (0,external_react_.useEffect)(() => {
716
- const shouldFetch = sessionPostalCode && !shippingPostalCodeRef.current;
717
-
718
- if (!shouldFetch) {
719
- return;
720
- } // Use sessionPostalCode if there is no shippingPostalCode
721
-
722
-
723
- async function fetchShipping() {
724
- const data = await shipping({
725
- country,
726
- postalCode: sessionPostalCode ?? '',
727
- items: [shippingItem]
728
- });
729
- const shippingSimulation = data.shipping;
730
- dispatch({
731
- type: 'update',
732
- payload: {
733
- input: {
734
- postalCode: sessionPostalCode ?? '',
735
- displayClearButton: true,
736
- errorMessage: ''
737
- },
738
- shippingSimulation
739
- }
740
- });
741
- }
742
-
743
- fetchShipping();
744
- }, [country, sessionPostalCode, shippingItem]);
745
- const handleSubmit = (0,external_react_.useCallback)(async () => {
746
- try {
747
- const data = await shipping({
748
- country,
749
- postalCode: shippingPostalCode ?? '',
750
- items: [shippingItem]
751
- });
752
- const shippingSimulation = data.shipping;
753
- dispatch({
754
- type: 'update',
755
- payload: {
756
- input: {
757
- displayClearButton: true,
758
- errorMessage: ''
759
- },
760
- shippingSimulation
761
- }
762
- });
763
- } catch (error) {
764
- dispatch({
765
- type: 'onError',
766
- payload: {
767
- displayClearButton: true,
768
- errorMessage: 'You entered an invalid Postal Code'
769
- }
770
- });
771
- }
772
- }, [country, shippingItem, shippingPostalCode]);
773
- const handleOnInput = (0,external_react_.useCallback)(e => {
774
- const currentValue = e.currentTarget.value;
775
-
776
- if (currentValue) {
777
- dispatch({
778
- type: 'onInput',
779
- payload: {
780
- postalCode: currentValue,
781
- displayClearButton: false,
782
- errorMessage: ''
783
- }
784
- });
785
- } else {
786
- dispatch({
787
- type: 'clear'
788
- });
789
- }
790
- }, []);
791
- return {
792
- input,
793
- shippingSimulation,
794
- handleOnClear: () => {
795
- dispatch({
796
- type: 'clear'
797
- });
798
- },
799
- handleSubmit,
800
- handleOnInput
801
- };
802
- };
803
- ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/ShippingSimulation.tsx
804
- const ShippingSimulation_excluded = ["productShippingInfo", "formatter", "inputLabel", "title", "idkPostalCodeLinkProps"];
805
-
806
- function ShippingSimulation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
807
-
808
- function ShippingSimulation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ShippingSimulation_ownKeys(Object(source), !0).forEach(function (key) { ShippingSimulation_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ShippingSimulation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
809
-
810
- function ShippingSimulation_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; }
811
-
812
- function ShippingSimulation_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ShippingSimulation_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; }
813
-
814
- function ShippingSimulation_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; }
815
-
816
-
817
-
818
-
819
- function ShippingSimulation_ShippingSimulation_ShippingSimulation(_ref) {
820
- let {
821
- productShippingInfo,
822
- formatter,
823
- inputLabel,
824
- title,
825
- idkPostalCodeLinkProps
826
- } = _ref,
827
- otherProps = ShippingSimulation_objectWithoutProperties(_ref, ShippingSimulation_excluded);
828
-
829
- const {
830
- input,
831
- shippingSimulation,
832
- handleSubmit,
833
- handleOnInput,
834
- handleOnClear
835
- } = useShippingSimulation(productShippingInfo);
836
- const {
837
- postalCode,
838
- displayClearButton,
839
- errorMessage
840
- } = input;
841
- const location = [shippingSimulation?.address?.neighborhood, shippingSimulation?.address?.city].filter(Boolean).join(' / ') ?? '';
842
- const options = shippingSimulation?.logisticsInfo?.[0]?.slas ?? [];
843
- return /*#__PURE__*/jsx_runtime_.jsx(Overrides_ShippingSimulation.Component, ShippingSimulation_objectSpread({
844
- formatter: formatter,
845
- onInput: handleOnInput,
846
- onSubmit: handleSubmit,
847
- onClear: handleOnClear,
848
- location: location,
849
- options: options,
850
- address: shippingSimulation?.address,
851
- displayClearButton: displayClearButton,
852
- errorMessage: errorMessage,
853
- postalCode: postalCode,
854
- inputLabel: inputLabel,
855
- title: title,
856
- idkPostalCodeLinkProps: idkPostalCodeLinkProps
857
- }, otherProps));
858
- }
859
- ;// CONCATENATED MODULE: ./src/components/product/NotAvailableButton/NotAvailableButton.tsx
860
- // TODO: Remove this component when <OutOfStock /> is ready to use
861
-
862
-
863
-
864
- function NotAvailableButton({
865
- children
866
- }) {
867
- return /*#__PURE__*/jsx_runtime_.jsx(Button/* default */.Z, {
868
- variant: "primary",
869
- disabled: true,
870
- "data-fs-buy-button": true,
871
- children: children
872
- });
873
- }
874
-
875
- /* harmony default export */ const NotAvailableButton_NotAvailableButton = (NotAvailableButton);
876
- // EXTERNAL MODULE: ./src/utils/overrides.ts
877
- var overrides = __webpack_require__(9104);
878
- ;// CONCATENATED MODULE: ./src/customizations/src/components/overrides/ProductDetails.tsx
879
- // This is an example of how it can be used on the starter.
880
- const SECTION = 'ProductDetails';
881
- const override = {
882
- section: SECTION
883
- };
884
-
885
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/Overrides.tsx
886
-
887
-
888
-
889
-
890
-
891
-
892
-
893
- const {
894
- ProductTitle: Overrides_ProductTitle,
895
- DiscountBadge: Overrides_DiscountBadge,
896
- BuyButton: Overrides_BuyButton,
897
- Icon: Overrides_Icon,
898
- Price: Overrides_Price,
899
- QuantitySelector: Overrides_QuantitySelector,
900
- SkuSelector: Overrides_SkuSelector,
901
- ShippingSimulation: Overrides_ShippingSimulation,
902
- ImageGallery: Overrides_ImageGallery,
903
- ImageGalleryViewer: Overrides_ImageGalleryViewer,
904
- __experimentalImageGalleryImage,
905
- __experimentalImageGallery,
906
- __experimentalShippingSimulation,
907
- __experimentalNotAvailableButton
908
- } = (0,overrides/* getSectionOverrides */.f)({
909
- ProductTitle: ProductTitle_ProductTitle,
910
- DiscountBadge: DiscountBadge/* default */.Z,
911
- BuyButton: BuyButton_BuyButton,
912
- Icon: Icon/* default */.Z,
913
- Price: Price/* default */.Z,
914
- QuantitySelector: QuantitySelector/* default */.Z,
915
- SkuSelector: SkuSelector_SkuSelector,
916
- ShippingSimulation: ShippingSimulation_ShippingSimulation,
917
- ImageGallery: ImageGallery_ImageGallery,
918
- ImageGalleryViewer: ImageGallery_ImageGalleryViewer,
919
- __experimentalImageGalleryImage: Image/* default */.Z,
920
- __experimentalImageGallery: ui_ImageGallery_ImageGallery,
921
- __experimentalShippingSimulation: ShippingSimulation_ShippingSimulation_ShippingSimulation,
922
- __experimentalNotAvailableButton: NotAvailableButton_NotAvailableButton
923
- }, override);
924
-
925
- ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/Selectors.tsx
926
- const Selectors_excluded = ["src", "alt"],
927
- _excluded2 = ["slugsMap", "activeVariations", "availableVariations"];
928
-
929
- function Selectors_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
930
-
931
- function Selectors_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Selectors_ownKeys(Object(source), !0).forEach(function (key) { Selectors_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Selectors_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
932
-
933
- function Selectors_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; }
934
-
935
- function Selectors_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Selectors_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; }
936
-
937
- function Selectors_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; }
938
-
939
-
940
-
941
-
942
-
943
-
944
-
945
- const Selectors_ImageComponent = _ref => {
946
- let {
947
- src,
948
- alt
949
- } = _ref,
950
- otherProps = Selectors_objectWithoutProperties(_ref, Selectors_excluded);
951
-
952
- return /*#__PURE__*/jsx_runtime_.jsx(Image/* default */.Z, Selectors_objectSpread({
953
- src: src,
954
- alt: alt,
955
- width: 34,
956
- height: 34
957
- }, otherProps));
958
- };
959
-
960
- function Selectors(_ref2) {
961
- let {
962
- slugsMap,
963
- activeVariations,
964
- availableVariations
965
- } = _ref2,
966
- otherProps = Selectors_objectWithoutProperties(_ref2, _excluded2);
967
-
968
- return /*#__PURE__*/jsx_runtime_.jsx("section", Selectors_objectSpread(Selectors_objectSpread({}, otherProps), {}, {
969
- children: availableVariations && Object.keys(availableVariations).map(skuVariant => /*#__PURE__*/(0,external_react_.createElement)(Overrides_SkuSelector.Component, Selectors_objectSpread(Selectors_objectSpread({
970
- ImageComponent: Selectors_ImageComponent
971
- }, Overrides_SkuSelector.props), {}, {
972
- key: skuVariant,
973
- skuPropertyName: skuVariant,
974
- availableVariations: availableVariations,
975
- activeVariations: activeVariations,
976
- slugsMap: slugsMap,
977
- linkProps: Selectors_objectSpread(Selectors_objectSpread({}, Overrides_SkuSelector.props.linkProps ?? {}), {}, {
978
- as: Overrides_SkuSelector.props.linkProps?.as ?? (link_default()),
979
- legacyBehavior: Overrides_SkuSelector.props.linkProps?.legacyBehavior ?? false
980
- })
981
- })))
982
- }));
983
- }
984
-
985
- /* harmony default export */ const SkuSelector_Selectors = (Selectors);
986
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx
987
-
988
-
989
- function AddToCartLoadingSkeleton() {
990
- return (
991
- /*#__PURE__*/
992
- // Generated via https://skeletonreact.com/.
993
- (0,jsx_runtime_.jsxs)("svg", {
994
- role: "img",
995
- width: "100%",
996
- height: "48",
997
- "aria-labelledby": "loading-aria",
998
- viewBox: "0 0 112 48",
999
- preserveAspectRatio: "none",
1000
- children: [/*#__PURE__*/jsx_runtime_.jsx("title", {
1001
- id: "loading-aria",
1002
- children: "Loading..."
1003
- }), /*#__PURE__*/jsx_runtime_.jsx("rect", {
1004
- x: "0",
1005
- y: "0",
1006
- width: "100%",
1007
- height: "100%",
1008
- clipPath: "url(#clip-path)",
1009
- style: {
1010
- fill: 'url("#fill")'
1011
- }
1012
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
1013
- children: [/*#__PURE__*/jsx_runtime_.jsx("clipPath", {
1014
- id: "clip-path",
1015
- children: /*#__PURE__*/jsx_runtime_.jsx("rect", {
1016
- x: "0",
1017
- y: "0",
1018
- rx: "2",
1019
- ry: "2",
1020
- width: "112",
1021
- height: "48"
1022
- })
1023
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
1024
- id: "fill",
1025
- children: [/*#__PURE__*/jsx_runtime_.jsx("stop", {
1026
- offset: "0.599964",
1027
- stopColor: "#f3f3f3",
1028
- stopOpacity: "1",
1029
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1030
- attributeName: "offset",
1031
- values: "-2; -2; 1",
1032
- keyTimes: "0; 0.25; 1",
1033
- dur: "2s",
1034
- repeatCount: "indefinite"
1035
- })
1036
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1037
- offset: "1.59996",
1038
- stopColor: "#ecebeb",
1039
- stopOpacity: "1",
1040
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1041
- attributeName: "offset",
1042
- values: "-1; -1; 2",
1043
- keyTimes: "0; 0.25; 1",
1044
- dur: "2s",
1045
- repeatCount: "indefinite"
1046
- })
1047
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1048
- offset: "2.59996",
1049
- stopColor: "#f3f3f3",
1050
- stopOpacity: "1",
1051
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1052
- attributeName: "offset",
1053
- values: "0; 0; 3",
1054
- keyTimes: "0; 0.25; 1",
1055
- dur: "2s",
1056
- repeatCount: "indefinite"
1057
- })
1058
- })]
1059
- })]
1060
- })]
1061
- })
1062
- );
1063
- }
1064
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/ProductDetailsSettings.tsx
1065
- function ProductDetailsSettings_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1066
-
1067
- function ProductDetailsSettings_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ProductDetailsSettings_ownKeys(Object(source), !0).forEach(function (key) { ProductDetailsSettings_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ProductDetailsSettings_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1068
-
1069
- function ProductDetailsSettings_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; }
1070
-
1071
-
1072
-
1073
-
1074
-
1075
-
1076
-
1077
-
1078
-
1079
-
1080
-
1081
- function ProductDetailsSettings({
1082
- product,
1083
- buyButtonTitle,
1084
- isValidating,
1085
- quantity,
1086
- setQuantity,
1087
- buyButtonIcon: {
1088
- icon: buyButtonIconName = Overrides_Icon.props.name,
1089
- alt: buyButtonIconAlt = Overrides_Icon.props["aria-label"]
1090
- },
1091
- notAvailableButtonTitle
1092
- }) {
1093
- const {
1094
- id,
1095
- sku,
1096
- gtin,
1097
- name: variantName,
1098
- brand,
1099
- isVariantOf,
1100
- isVariantOf: {
1101
- skuVariants
1102
- },
1103
- image: productImages,
1104
- additionalProperty,
1105
- offers: {
1106
- lowPrice,
1107
- offers: [{
1108
- availability,
1109
- price,
1110
- listPrice,
1111
- seller
1112
- }]
1113
- }
1114
- } = product;
1115
- const buyProps = useBuyButton({
1116
- id,
1117
- price,
1118
- listPrice,
1119
- seller,
1120
- quantity,
1121
- itemOffered: {
1122
- sku,
1123
- name: variantName,
1124
- gtin,
1125
- image: productImages,
1126
- brand,
1127
- isVariantOf,
1128
- additionalProperty
1129
- }
1130
- });
1131
- const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
1132
- const shouldShowDiscountedPrice = (0,external_react_.useMemo)(() => lowPrice !== listPrice, [lowPrice, listPrice]);
1133
-
1134
- const AddToCartButton = () => {
1135
- return outOfStock ?
1136
- /*#__PURE__*/
1137
- // TODO: Adds <OutOfStock /> when component is ready to use
1138
- jsx_runtime_.jsx(__experimentalNotAvailableButton.Component, {
1139
- children: notAvailableButtonTitle
1140
- }) : /*#__PURE__*/jsx_runtime_.jsx(Overrides_BuyButton.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Overrides_BuyButton.props), {}, {
1141
- icon: /*#__PURE__*/jsx_runtime_.jsx(Overrides_Icon.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Overrides_Icon.props), {}, {
1142
- name: buyButtonIconName,
1143
- "aria-label": buyButtonIconAlt
1144
- }))
1145
- }, buyProps), {}, {
1146
- children: buyButtonTitle || 'Add to Cart'
1147
- }));
1148
- };
1149
-
1150
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1151
- children: [!outOfStock && /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1152
- "data-fs-product-details-values": true,
1153
- children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
1154
- "data-fs-product-details-prices": true,
1155
- children: shouldShowDiscountedPrice ? /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1156
- children: [/*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1157
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1158
- testId: "list-price",
1159
- variant: "listing",
1160
- SRText: "Original price:"
1161
- }, Overrides_Price.props), {}, {
1162
- // Dynamic props shouldn't be overridable
1163
- // This decision can be reviewed later if needed
1164
- value: listPrice,
1165
- "data-value": listPrice
1166
- })), /*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1167
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1168
- testId: "price",
1169
- variant: "spot",
1170
- className: "text__lead",
1171
- SRText: "Sale Price:"
1172
- }, Overrides_Price.props), {}, {
1173
- // Dynamic props shouldn't be overridable
1174
- // This decision can be reviewed later if needed
1175
- value: lowPrice,
1176
- "data-value": lowPrice
1177
- }))]
1178
- }) : /*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1179
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1180
- testId: "list-price",
1181
- variant: "spot",
1182
- className: "text__lead",
1183
- SRText: "Original price:"
1184
- }, Overrides_Price.props), {}, {
1185
- // Dynamic props shouldn't be overridable
1186
- // This decision can be reviewed later if needed
1187
- value: lowPrice,
1188
- "data-value": lowPrice
1189
- }))
1190
- }), /*#__PURE__*/jsx_runtime_.jsx(Overrides_QuantitySelector.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1191
- min: 1,
1192
- max: 10
1193
- }, Overrides_QuantitySelector.props), {}, {
1194
- // Dynamic props shouldn't be overridable
1195
- // This decision can be reviewed later if needed
1196
- onChange: setQuantity
1197
- }))]
1198
- }), skuVariants && /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_Selectors, {
1199
- slugsMap: skuVariants.slugsMap,
1200
- availableVariations: skuVariants.availableVariations,
1201
- activeVariations: skuVariants.activeVariations,
1202
- "data-fs-product-details-selectors": true
1203
- }), isValidating ?
1204
- /*#__PURE__*/
1205
-
1206
- /* NOTE:
1207
- A loading skeleton had to be used to avoid a Lighthouse's
1208
- non-composited animation violation due to the button transitioning its
1209
- background color when changing from its initial disabled to active state.
1210
- See full explanation on commit https://git.io/JyXV5. */
1211
- jsx_runtime_.jsx(AddToCartLoadingSkeleton, {}) : /*#__PURE__*/jsx_runtime_.jsx(AddToCartButton, {})]
1212
- });
1213
- }
1214
-
1215
- /* harmony default export */ const ProductDetails_ProductDetailsSettings = (ProductDetailsSettings);
1216
- // EXTERNAL MODULE: ./src/components/sections/ProductDetails/section.module.scss
1217
- var section_module = __webpack_require__(9034);
1218
- var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
1219
- // EXTERNAL MODULE: ./src/sdk/overrides/PageProvider.tsx
1220
- var PageProvider = __webpack_require__(5953);
1221
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/ProductDetails.tsx
1222
- function ProductDetails_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1223
-
1224
- function ProductDetails_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ProductDetails_ownKeys(Object(source), !0).forEach(function (key) { ProductDetails_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ProductDetails_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1225
-
1226
- function ProductDetails_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; }
1227
-
1228
-
1229
-
1230
-
1231
-
1232
-
1233
-
1234
-
1235
-
1236
-
1237
-
1238
-
1239
-
1240
-
1241
- function ProductDetails({
1242
- productTitle: {
1243
- refNumber: showRefNumber,
1244
- discountBadge: {
1245
- showDiscountBadge,
1246
- size: discountBadgeSize = Overrides_DiscountBadge.props.size
1247
- }
1248
- },
1249
- buyButton: {
1250
- icon: buyButtonIcon,
1251
- title: buyButtonTitle
1252
- },
1253
- shippingSimulator: {
1254
- title: shippingSimulatorTitle = __experimentalShippingSimulation.props.title,
1255
- inputLabel: shippingSimulatorInputLabel = __experimentalShippingSimulation.props.inputLabel,
1256
- shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle = __experimentalShippingSimulation.props.optionsLabel,
1257
- link: {
1258
- to: shippingSimulatorLinkUrl = __experimentalShippingSimulation.props.idkPostalCodeLinkProps?.href,
1259
- text: shippingSimulatorLinkText = __experimentalShippingSimulation.props.idkPostalCodeLinkProps?.children
1260
- }
1261
- },
1262
- productDescription: {
1263
- title: productDescriptionDetailsTitle,
1264
- initiallyExpanded: productDescriptionInitiallyExpanded,
1265
- displayDescription: shouldDisplayProductDescription
1266
- },
1267
- imageGallery: {
1268
- imagePosition = __experimentalImageGallery.props.imagePosition
1269
- },
1270
- notAvailableButton: {
1271
- title: notAvailableButtonTitle = __experimentalNotAvailableButton.props.title
1272
- }
1273
- }) {
1274
- const {
1275
- currency
1276
- } = (0,session/* useSession */.kP)();
1277
- const {
1278
- 0: quantity,
1279
- 1: setQuantity
1280
- } = (0,external_react_.useState)(1);
1281
- const context = (0,PageProvider/* usePDP */.al)();
1282
- const {
1283
- product,
1284
- isValidating
1285
- } = context?.data;
1286
-
1287
- if (!product) {
1288
- throw new Error('NotFound');
1289
- }
1290
-
1291
- const {
1292
- id,
1293
- sku,
1294
- gtin,
1295
- name: variantName,
1296
- brand,
1297
- isVariantOf,
1298
- description,
1299
- isVariantOf: {
1300
- name,
1301
- productGroupID: productId
1302
- },
1303
- image: productImages,
1304
- offers: {
1305
- offers: [{
1306
- availability,
1307
- price,
1308
- listPrice,
1309
- seller
1310
- }],
1311
- lowPrice
1312
- }
1313
- } = product;
1314
- (0,external_react_.useEffect)(() => {
1315
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
1316
- name: 'view_item',
1317
- params: {
1318
- currency: currency.code,
1319
- value: price,
1320
- items: [{
1321
- item_id: isVariantOf.productGroupID,
1322
- item_name: isVariantOf.name,
1323
- item_brand: brand.name,
1324
- item_variant: sku,
1325
- price,
1326
- discount: listPrice - price,
1327
- currency: currency.code,
1328
- item_variant_name: variantName,
1329
- product_reference_id: gtin
1330
- }]
1331
- }
1332
- });
1333
- }, [isVariantOf.productGroupID, isVariantOf.name, brand.name, sku, price, listPrice, currency.code, variantName, gtin]);
1334
- const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
1335
- return /*#__PURE__*/jsx_runtime_.jsx(Section/* default */.Z, {
1336
- className: `${(section_module_default()).section} section-product-details`,
1337
- children: /*#__PURE__*/jsx_runtime_.jsx("section", {
1338
- "data-fs-product-details": true,
1339
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1340
- "data-fs-product-details-body": true,
1341
- "data-fs-content": "product-details",
1342
- children: [/*#__PURE__*/jsx_runtime_.jsx("header", {
1343
- "data-fs-product-details-title": true,
1344
- "data-fs-product-details-section": true,
1345
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides_ProductTitle.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1346
- // TODO: We should review this prop. There's now way to override the title and use the dynamic name value.
1347
- // Maybe passing a ProductTitleHeader component as a prop would be better, as it would be overridable.
1348
- // Maybe now it's worth to make title always a h1 and receive only the name, as it would be easier for users to override.
1349
- title: /*#__PURE__*/jsx_runtime_.jsx("h1", {
1350
- children: name
1351
- })
1352
- }, Overrides_ProductTitle.props), {}, {
1353
- label: showDiscountBadge && /*#__PURE__*/jsx_runtime_.jsx(Overrides_DiscountBadge.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({}, Overrides_DiscountBadge.props), {}, {
1354
- size: discountBadgeSize // Dynamic props shouldn't be overridable
1355
- // This decision can be reviewed later if needed
1356
- ,
1357
- listPrice: listPrice,
1358
- spotPrice: lowPrice
1359
- })),
1360
- refNumber: showRefNumber && productId
1361
- }))
1362
- }), /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGallery.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1363
- "data-fs-product-details-gallery": true
1364
- }, __experimentalImageGallery.props), {}, {
1365
- imagePosition: imagePosition,
1366
- images: productImages
1367
- })), /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1368
- "data-fs-product-details-info": true,
1369
- children: [/*#__PURE__*/jsx_runtime_.jsx("section", {
1370
- "data-fs-product-details-settings": true,
1371
- "data-fs-product-details-section": true,
1372
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductDetails_ProductDetailsSettings, {
1373
- product: product,
1374
- isValidating: isValidating,
1375
- buyButtonTitle: buyButtonTitle,
1376
- quantity: quantity,
1377
- setQuantity: setQuantity,
1378
- buyButtonIcon: buyButtonIcon,
1379
- notAvailableButtonTitle: notAvailableButtonTitle
1380
- })
1381
- }), !outOfStock && /*#__PURE__*/jsx_runtime_.jsx(__experimentalShippingSimulation.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1382
- "data-fs-product-details-section": true,
1383
- "data-fs-product-details-shipping": true,
1384
- formatter: useFormattedPrice/* useFormattedPrice */.P
1385
- }, __experimentalShippingSimulation.props), {}, {
1386
- idkPostalCodeLinkProps: ProductDetails_objectSpread(ProductDetails_objectSpread({}, __experimentalShippingSimulation.props.idkPostalCodeLinkProps), {}, {
1387
- href: shippingSimulatorLinkUrl,
1388
- children: shippingSimulatorLinkText
1389
- }),
1390
- productShippingInfo: {
1391
- id,
1392
- quantity,
1393
- seller: seller.identifier
1394
- },
1395
- title: shippingSimulatorTitle,
1396
- inputLabel: shippingSimulatorInputLabel,
1397
- optionsLabel: shippingSimulatorOptionsTableTitle
1398
- }))]
1399
- }), shouldDisplayProductDescription && /*#__PURE__*/jsx_runtime_.jsx(ProductDescription_ProductDescription, {
1400
- initiallyExpanded: productDescriptionInitiallyExpanded,
1401
- descriptionData: [{
1402
- title: productDescriptionDetailsTitle,
1403
- content: description
1404
- }]
1405
- })]
1406
- })
1407
- })
1408
- });
1409
- }
1410
-
1411
- const fragment = "unknown";
1412
- /* harmony default export */ const ProductDetails_ProductDetails = (ProductDetails);
1413
-
1414
- /***/ }),
1415
-
1416
- /***/ 5779:
1417
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1418
-
1419
- "use strict";
1420
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1421
- __webpack_require__.r(__webpack_exports__);
1422
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1423
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1424
- /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
1425
- /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
1426
- /* harmony export */ });
1427
- /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4826);
1428
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6641);
1429
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_seo__WEBPACK_IMPORTED_MODULE_1__);
1430
- /* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6330);
1431
- /* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);
1432
- /* harmony import */ var src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2224);
1433
- /* harmony import */ var src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2951);
1434
- /* harmony import */ var src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2390);
1435
- /* harmony import */ var src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(994);
1436
- /* harmony import */ var src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2694);
1437
- /* harmony import */ var src_customizations_src_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3276);
1438
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7295);
1439
- /* harmony import */ var src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2541);
1440
- /* harmony import */ var src_server__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9685);
1441
- /* harmony import */ var src_server_cms__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9497);
1442
- /* harmony import */ var src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4074);
1443
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7183);
1444
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_16__);
1445
- /* harmony import */ var src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7853);
1446
- /* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5953);
1447
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
1448
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
1449
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__, src_server__WEBPACK_IMPORTED_MODULE_14__]);
1450
- ([src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__, src_server__WEBPACK_IMPORTED_MODULE_14__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1451
- const _excluded = ["listPrice"];
1452
-
1453
- 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; }
1454
-
1455
- 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; }
1456
-
1457
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1458
-
1459
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1460
-
1461
- 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; }
1462
-
1463
-
1464
-
1465
-
1466
-
1467
-
1468
-
1469
-
1470
-
1471
-
1472
-
1473
-
1474
-
1475
-
1476
-
1477
-
1478
-
1479
-
1480
- /**
1481
- * Sections: Components imported from each store's custom components and '../components/sections' only.
1482
- * Do not import or render components from any other folder in here.
1483
- */
1484
-
1485
-
1486
-
1487
-
1488
- const COMPONENTS = _objectSpread({
1489
- Breadcrumb: src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
1490
- ProductDetails: src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
1491
- CrossSellingShelf: src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
1492
- BannerNewsletter: src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z
1493
- }, src_customizations_src_components__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
1494
-
1495
- // Array merging strategy from deepmerge that makes client arrays overwrite server array
1496
- // https://www.npmjs.com/package/deepmerge
1497
- const overwriteMerge = (_, sourceArray) => sourceArray;
1498
-
1499
- function Page({
1500
- data: server,
1501
- sections,
1502
- globalSections,
1503
- offers,
1504
- meta
1505
- }) {
1506
- const {
1507
- product
1508
- } = server;
1509
- const {
1510
- currency
1511
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_9__/* .useSession */ .kP)(); // Stale while revalidate the product for fetching the new price etc
1512
-
1513
- const {
1514
- data: client,
1515
- isValidating
1516
- } = (0,src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__/* .useProductQuery */ .F)(product.id, {
1517
- product: product
1518
- });
1519
- const context = {
1520
- data: _objectSpread(_objectSpread({}, deepmerge__WEBPACK_IMPORTED_MODULE_2___default()(server, client, {
1521
- arrayMerge: overwriteMerge
1522
- })), {}, {
1523
- isValidating
1524
- })
1525
- };
1526
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP, _objectSpread(_objectSpread({}, globalSections), {}, {
1527
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.NextSeo, {
1528
- title: meta.title,
1529
- description: meta.description,
1530
- canonical: meta.canonical,
1531
- openGraph: {
1532
- type: 'og:product',
1533
- url: meta.canonical,
1534
- title: meta.title,
1535
- description: meta.description,
1536
- images: product.image.map(img => ({
1537
- url: img.url,
1538
- alt: img.alternateName
1539
- }))
1540
- },
1541
- additionalMetaTags: [{
1542
- property: 'product:price:amount',
1543
- content: product.offers.lowPrice?.toString() ?? undefined
1544
- }, {
1545
- property: 'product:price:currency',
1546
- content: currency.code
1547
- }]
1548
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.BreadcrumbJsonLd, {
1549
- itemListElements: product.breadcrumbList.itemListElement
1550
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.ProductJsonLd, {
1551
- productName: product.name,
1552
- description: product.description,
1553
- brand: product.brand.name,
1554
- sku: product.sku,
1555
- gtin: product.gtin,
1556
- releaseDate: product.releaseDate,
1557
- images: product.image.map(img => img.url) // Somehow, Google does not understand this valid Schema.org schema, so we need to do conversions
1558
- ,
1559
- offers: offers
1560
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
1561
- context: context,
1562
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
1563
- sections: sections,
1564
- components: COMPONENTS
1565
- })
1566
- })]
1567
- }));
1568
- }
1569
-
1570
- const query = "ServerProductQuery";
1571
- const getStaticProps = async ({
1572
- params,
1573
- previewData
1574
- }) => {
1575
- const slug = params?.slug ?? '';
1576
- const [searchResult, cmsPage, globalSections] = await Promise.all([(0,src_server__WEBPACK_IMPORTED_MODULE_14__/* .execute */ .h)({
1577
- variables: {
1578
- locator: [{
1579
- key: 'slug',
1580
- value: slug
1581
- }]
1582
- },
1583
- operationName: query
1584
- }), (0,src_server_cms__WEBPACK_IMPORTED_MODULE_15__/* .getPage */ .f)(_objectSpread(_objectSpread({}, previewData?.contentType === 'pdp' ? previewData : null), {}, {
1585
- contentType: 'pdp'
1586
- })), (0,src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__/* .getGlobalSectionsData */ .Tc)(previewData)]);
1587
- const {
1588
- data,
1589
- errors = []
1590
- } = searchResult;
1591
- const notFound = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError);
1592
-
1593
- if (notFound) {
1594
- return {
1595
- notFound: true
1596
- };
1597
- }
1598
-
1599
- if (errors.length > 0) {
1600
- throw errors[0];
1601
- }
1602
-
1603
- const {
1604
- seo
1605
- } = data.product;
1606
- const title = seo.title || (_faststore_config__WEBPACK_IMPORTED_MODULE_16___default().seo.title);
1607
- const description = seo.description || (_faststore_config__WEBPACK_IMPORTED_MODULE_16___default().seo.description);
1608
- const canonical = `${(_faststore_config__WEBPACK_IMPORTED_MODULE_16___default().storeUrl)}${seo.canonical}`;
1609
- const meta = {
1610
- title,
1611
- description,
1612
- canonical
1613
- };
1614
- let offer = {};
1615
-
1616
- if (data.product.offers.offers.length > 0) {
1617
- const _data$product$offers$ = data.product.offers.offers[0],
1618
- {
1619
- listPrice
1620
- } = _data$product$offers$,
1621
- offerData = _objectWithoutProperties(_data$product$offers$, _excluded);
1622
-
1623
- offer = offerData;
1624
- }
1625
-
1626
- const offers = _objectSpread(_objectSpread({}, offer), {}, {
1627
- priceCurrency: data.product.offers.priceCurrency,
1628
- url: canonical
1629
- });
1630
-
1631
- return {
1632
- props: _objectSpread(_objectSpread({
1633
- data
1634
- }, cmsPage), {}, {
1635
- meta,
1636
- offers,
1637
- globalSections,
1638
- key: slug
1639
- })
1640
- };
1641
- };
1642
- const getStaticPaths = async () => {
1643
- return {
1644
- paths: [],
1645
- fallback: 'blocking'
1646
- };
1647
- };
1648
- Page.displayName = 'Page';
1649
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_17__/* .mark */ .B)(Page));
1650
- __webpack_async_result__();
1651
- } catch(e) { __webpack_async_result__(e); } });
1652
-
1653
- /***/ }),
1654
-
1655
- /***/ 7853:
1656
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1657
-
1658
- "use strict";
1659
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1660
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1661
- /* harmony export */ "F": () => (/* binding */ useProductQuery)
1662
- /* harmony export */ });
1663
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
1664
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1665
- /* harmony import */ var _graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7732);
1666
- /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
1667
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__]);
1668
- _graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1669
-
1670
-
1671
-
1672
- const query = "ClientProductQuery";
1673
- const useProductQuery = (productID, fallbackData) => {
1674
- const {
1675
- channel,
1676
- locale
1677
- } = (0,_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
1678
- const variables = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1679
- if (!channel) {
1680
- throw new Error(`useProductQuery: 'channel' from session is an empty string.`);
1681
- }
1682
-
1683
- return {
1684
- locator: [{
1685
- key: 'id',
1686
- value: productID
1687
- }, {
1688
- key: 'channel',
1689
- value: channel
1690
- }, {
1691
- key: 'locale',
1692
- value: locale
1693
- }]
1694
- };
1695
- }, [channel, locale, productID]);
1696
- return (0,_graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__/* .useQuery */ .aM)(query, variables, {
1697
- fallbackData,
1698
- revalidateOnMount: true
1699
- });
1700
- };
1701
- __webpack_async_result__();
1702
- } catch(e) { __webpack_async_result__(e); } });
1703
-
1704
- /***/ }),
1705
-
1706
- /***/ 5411:
1707
- /***/ ((module) => {
1708
-
1709
- // Exports
1710
- module.exports = {
1711
- "section": "section_section__pVnFl"
1712
- };
1713
-
1714
-
1715
- /***/ }),
1716
-
1717
- /***/ 9034:
1718
- /***/ ((module) => {
1719
-
1720
- // Exports
1721
- module.exports = {
1722
- "section": "section_section__XsOoR"
1723
- };
1724
-
1725
-
1726
- /***/ }),
1727
-
1728
- /***/ 1718:
1729
- /***/ ((module) => {
1730
-
1731
- "use strict";
1732
- module.exports = require("@graphql-tools/utils");
1733
-
1734
- /***/ }),
1735
-
1736
- /***/ 4691:
1737
- /***/ ((module) => {
1738
-
1739
- "use strict";
1740
- module.exports = require("@opentelemetry/api");
1741
-
1742
- /***/ }),
1743
-
1744
- /***/ 8973:
1745
- /***/ ((module) => {
1746
-
1747
- "use strict";
1748
- module.exports = require("@opentelemetry/api-logs");
1749
-
1750
- /***/ }),
1751
-
1752
- /***/ 6969:
1753
- /***/ ((module) => {
1754
-
1755
- "use strict";
1756
- module.exports = require("@opentelemetry/exporter-logs-otlp-grpc");
1757
-
1758
- /***/ }),
1759
-
1760
- /***/ 5196:
1761
- /***/ ((module) => {
1762
-
1763
- "use strict";
1764
- module.exports = require("@opentelemetry/exporter-trace-otlp-grpc");
1765
-
1766
- /***/ }),
1767
-
1768
- /***/ 4161:
1769
- /***/ ((module) => {
1770
-
1771
- "use strict";
1772
- module.exports = require("@opentelemetry/resources");
1773
-
1774
- /***/ }),
1775
-
1776
- /***/ 2793:
1777
- /***/ ((module) => {
1778
-
1779
- "use strict";
1780
- module.exports = require("@opentelemetry/sdk-logs");
1781
-
1782
- /***/ }),
1783
-
1784
- /***/ 1283:
1785
- /***/ ((module) => {
1786
-
1787
- "use strict";
1788
- module.exports = require("@opentelemetry/sdk-trace-base");
1789
-
1790
- /***/ }),
1791
-
1792
- /***/ 6676:
1793
- /***/ ((module) => {
1794
-
1795
- "use strict";
1796
- module.exports = require("@vtex/client-cms");
1797
-
1798
- /***/ }),
1799
-
1800
- /***/ 6330:
1801
- /***/ ((module) => {
1802
-
1803
- "use strict";
1804
- module.exports = require("deepmerge");
1805
-
1806
- /***/ }),
1807
-
1808
- /***/ 8641:
1809
- /***/ ((module) => {
1810
-
1811
- "use strict";
1812
- module.exports = require("draftjs-to-html");
1813
-
1814
- /***/ }),
1815
-
1816
- /***/ 2404:
1817
- /***/ ((module) => {
1818
-
1819
- "use strict";
1820
- module.exports = require("fast-deep-equal");
1821
-
1822
- /***/ }),
1823
-
1824
- /***/ 7343:
1825
- /***/ ((module) => {
1826
-
1827
- "use strict";
1828
- module.exports = require("graphql");
1829
-
1830
- /***/ }),
1831
-
1832
- /***/ 6548:
1833
- /***/ ((module) => {
1834
-
1835
- "use strict";
1836
- module.exports = require("graphql/language");
1837
-
1838
- /***/ }),
1839
-
1840
- /***/ 3430:
1841
- /***/ ((module) => {
1842
-
1843
- "use strict";
1844
- module.exports = require("idb-keyval");
1845
-
1846
- /***/ }),
1847
-
1848
- /***/ 7881:
1849
- /***/ ((module) => {
1850
-
1851
- "use strict";
1852
- module.exports = require("isomorphic-unfetch");
1853
-
1854
- /***/ }),
1855
-
1856
- /***/ 6641:
1857
- /***/ ((module) => {
1858
-
1859
- "use strict";
1860
- module.exports = require("next-seo");
1861
-
1862
- /***/ }),
1863
-
1864
- /***/ 3280:
1865
- /***/ ((module) => {
1866
-
1867
- "use strict";
1868
- module.exports = require("next/dist/shared/lib/app-router-context.js");
1869
-
1870
- /***/ }),
1871
-
1872
- /***/ 2796:
1873
- /***/ ((module) => {
1874
-
1875
- "use strict";
1876
- module.exports = require("next/dist/shared/lib/head-manager-context.js");
1877
-
1878
- /***/ }),
1879
-
1880
- /***/ 4957:
1881
- /***/ ((module) => {
1882
-
1883
- "use strict";
1884
- module.exports = require("next/dist/shared/lib/head.js");
1885
-
1886
- /***/ }),
1887
-
1888
- /***/ 3539:
1889
- /***/ ((module) => {
1890
-
1891
- "use strict";
1892
- module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
1893
-
1894
- /***/ }),
1895
-
1896
- /***/ 4014:
1897
- /***/ ((module) => {
1898
-
1899
- "use strict";
1900
- module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
1901
-
1902
- /***/ }),
1903
-
1904
- /***/ 4486:
1905
- /***/ ((module) => {
1906
-
1907
- "use strict";
1908
- module.exports = require("next/dist/shared/lib/image-blur-svg.js");
1909
-
1910
- /***/ }),
1911
-
1912
- /***/ 744:
1913
- /***/ ((module) => {
1914
-
1915
- "use strict";
1916
- module.exports = require("next/dist/shared/lib/image-config-context.js");
1917
-
1918
- /***/ }),
1919
-
1920
- /***/ 5843:
1921
- /***/ ((module) => {
1922
-
1923
- "use strict";
1924
- module.exports = require("next/dist/shared/lib/image-config.js");
1925
-
1926
- /***/ }),
1927
-
1928
- /***/ 8524:
1929
- /***/ ((module) => {
1930
-
1931
- "use strict";
1932
- module.exports = require("next/dist/shared/lib/is-plain-object.js");
1933
-
1934
- /***/ }),
1935
-
1936
- /***/ 8020:
1937
- /***/ ((module) => {
1938
-
1939
- "use strict";
1940
- module.exports = require("next/dist/shared/lib/mitt.js");
1941
-
1942
- /***/ }),
1943
-
1944
- /***/ 4406:
1945
- /***/ ((module) => {
1946
-
1947
- "use strict";
1948
- module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
1949
-
1950
- /***/ }),
1951
-
1952
- /***/ 4964:
1953
- /***/ ((module) => {
1954
-
1955
- "use strict";
1956
- module.exports = require("next/dist/shared/lib/router-context.js");
1957
-
1958
- /***/ }),
1959
-
1960
- /***/ 3431:
1961
- /***/ ((module) => {
1962
-
1963
- "use strict";
1964
- module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
1965
-
1966
- /***/ }),
1967
-
1968
- /***/ 1751:
1969
- /***/ ((module) => {
1970
-
1971
- "use strict";
1972
- module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
1973
-
1974
- /***/ }),
1975
-
1976
- /***/ 6220:
1977
- /***/ ((module) => {
1978
-
1979
- "use strict";
1980
- module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
1981
-
1982
- /***/ }),
1983
-
1984
- /***/ 299:
1985
- /***/ ((module) => {
1986
-
1987
- "use strict";
1988
- module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
1989
-
1990
- /***/ }),
1991
-
1992
- /***/ 3938:
1993
- /***/ ((module) => {
1994
-
1995
- "use strict";
1996
- module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
1997
-
1998
- /***/ }),
1999
-
2000
- /***/ 9565:
2001
- /***/ ((module) => {
2002
-
2003
- "use strict";
2004
- module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
2005
-
2006
- /***/ }),
2007
-
2008
- /***/ 5789:
2009
- /***/ ((module) => {
2010
-
2011
- "use strict";
2012
- module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
2013
-
2014
- /***/ }),
2015
-
2016
- /***/ 1897:
2017
- /***/ ((module) => {
2018
-
2019
- "use strict";
2020
- module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
2021
-
2022
- /***/ }),
2023
-
2024
- /***/ 1428:
2025
- /***/ ((module) => {
2026
-
2027
- "use strict";
2028
- module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
2029
-
2030
- /***/ }),
2031
-
2032
- /***/ 8854:
2033
- /***/ ((module) => {
2034
-
2035
- "use strict";
2036
- module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
2037
-
2038
- /***/ }),
2039
-
2040
- /***/ 1292:
2041
- /***/ ((module) => {
2042
-
2043
- "use strict";
2044
- module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
2045
-
2046
- /***/ }),
2047
-
2048
- /***/ 4567:
2049
- /***/ ((module) => {
2050
-
2051
- "use strict";
2052
- module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
2053
-
2054
- /***/ }),
2055
-
2056
- /***/ 979:
2057
- /***/ ((module) => {
2058
-
2059
- "use strict";
2060
- module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
2061
-
2062
- /***/ }),
2063
-
2064
- /***/ 3297:
2065
- /***/ ((module) => {
2066
-
2067
- "use strict";
2068
- module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
2069
-
2070
- /***/ }),
2071
-
2072
- /***/ 6052:
2073
- /***/ ((module) => {
2074
-
2075
- "use strict";
2076
- module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
2077
-
2078
- /***/ }),
2079
-
2080
- /***/ 4226:
2081
- /***/ ((module) => {
2082
-
2083
- "use strict";
2084
- module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
2085
-
2086
- /***/ }),
2087
-
2088
- /***/ 5052:
2089
- /***/ ((module) => {
2090
-
2091
- "use strict";
2092
- module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
2093
-
2094
- /***/ }),
2095
-
2096
- /***/ 9232:
2097
- /***/ ((module) => {
2098
-
2099
- "use strict";
2100
- module.exports = require("next/dist/shared/lib/utils.js");
2101
-
2102
- /***/ }),
2103
-
2104
- /***/ 1853:
2105
- /***/ ((module) => {
2106
-
2107
- "use strict";
2108
- module.exports = require("next/router");
2109
-
2110
- /***/ }),
2111
-
2112
- /***/ 5471:
2113
- /***/ ((module) => {
2114
-
2115
- "use strict";
2116
- module.exports = require("p-limit");
2117
-
2118
- /***/ }),
2119
-
2120
- /***/ 1423:
2121
- /***/ ((module) => {
2122
-
2123
- "use strict";
2124
- module.exports = require("path");
2125
-
2126
- /***/ }),
2127
-
2128
- /***/ 6689:
2129
- /***/ ((module) => {
2130
-
2131
- "use strict";
2132
- module.exports = require("react");
2133
-
2134
- /***/ }),
2135
-
2136
- /***/ 6405:
2137
- /***/ ((module) => {
2138
-
2139
- "use strict";
2140
- module.exports = require("react-dom");
2141
-
2142
- /***/ }),
2143
-
2144
- /***/ 9785:
2145
- /***/ ((module) => {
2146
-
2147
- "use strict";
2148
- module.exports = require("react-intersection-observer");
2149
-
2150
- /***/ }),
2151
-
2152
- /***/ 3789:
2153
- /***/ ((module) => {
2154
-
2155
- "use strict";
2156
- module.exports = require("react-swipeable");
2157
-
2158
- /***/ }),
2159
-
2160
- /***/ 997:
2161
- /***/ ((module) => {
2162
-
2163
- "use strict";
2164
- module.exports = require("react/jsx-runtime");
2165
-
2166
- /***/ }),
2167
-
2168
- /***/ 6109:
2169
- /***/ ((module) => {
2170
-
2171
- "use strict";
2172
- module.exports = require("sanitize-html");
2173
-
2174
- /***/ }),
2175
-
2176
- /***/ 3823:
2177
- /***/ ((module) => {
2178
-
2179
- "use strict";
2180
- module.exports = require("tabbable");
2181
-
2182
- /***/ }),
2183
-
2184
- /***/ 752:
2185
- /***/ ((module) => {
2186
-
2187
- "use strict";
2188
- module.exports = require("tslib");
2189
-
2190
- /***/ }),
2191
-
2192
- /***/ 9664:
2193
- /***/ ((module) => {
2194
-
2195
- "use strict";
2196
- module.exports = import("@envelop/core");;
2197
-
2198
- /***/ }),
2199
-
2200
- /***/ 7886:
2201
- /***/ ((module) => {
2202
-
2203
- "use strict";
2204
- module.exports = import("@envelop/graphql-jit");;
2205
-
2206
- /***/ }),
2207
-
2208
- /***/ 4656:
2209
- /***/ ((module) => {
2210
-
2211
- "use strict";
2212
- module.exports = import("@envelop/parser-cache");;
2213
-
2214
- /***/ }),
2215
-
2216
- /***/ 6093:
2217
- /***/ ((module) => {
2218
-
2219
- "use strict";
2220
- module.exports = import("@envelop/validation-cache");;
2221
-
2222
- /***/ }),
2223
-
2224
- /***/ 5774:
2225
- /***/ ((module) => {
2226
-
2227
- "use strict";
2228
- module.exports = import("@graphql-tools/load-files");;
2229
-
2230
- /***/ }),
2231
-
2232
- /***/ 6550:
2233
- /***/ ((module) => {
2234
-
2235
- "use strict";
2236
- module.exports = import("@graphql-tools/schema");;
2237
-
2238
- /***/ }),
2239
-
2240
- /***/ 7564:
2241
- /***/ ((module) => {
2242
-
2243
- "use strict";
2244
- module.exports = import("chalk");;
2245
-
2246
- /***/ }),
2247
-
2248
- /***/ 5941:
2249
- /***/ ((module) => {
2250
-
2251
- "use strict";
2252
- module.exports = import("swr");;
2253
-
2254
- /***/ }),
2255
-
2256
- /***/ 6113:
2257
- /***/ ((module) => {
2258
-
2259
- "use strict";
2260
- module.exports = require("crypto");
2261
-
2262
- /***/ })
2263
-
2264
- };
2265
- ;
2266
-
2267
- // load runtime
2268
- var __webpack_require__ = require("../../webpack-runtime.js");
2269
- __webpack_require__.C(exports);
2270
- var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
2271
- var __webpack_exports__ = __webpack_require__.X(0, [676,825,52,183,177,74,53,779,854,117,184,979,390,350,693], () => (__webpack_exec__(5779)));
2272
- module.exports = __webpack_exports__;
2273
-
2274
- })();