@faststore/core 2.0.80-alpha.0 → 2.0.83-alpha.0

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 (118) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +26 -26
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  6. package/.next/cache/next-server.js.nft.json +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/export-marker.json +1 -1
  12. package/.next/images-manifest.json +1 -1
  13. package/.next/next-server.js.nft.json +1 -1
  14. package/.next/prerender-manifest.json +1 -1
  15. package/.next/react-loadable-manifest.json +7 -4
  16. package/.next/required-server-files.json +1 -1
  17. package/.next/routes-manifest.json +1 -1
  18. package/.next/server/chunks/{317.js → 1317.js} +3 -4
  19. package/.next/server/chunks/{394.js → 1394.js} +2 -2
  20. package/.next/server/chunks/{444.js → 1444.js} +2 -2
  21. package/.next/server/chunks/1608.js +515 -0
  22. package/.next/server/chunks/{154.js → 2154.js} +41 -36
  23. package/.next/server/chunks/{439.js → 2439.js} +2 -2
  24. package/.next/server/chunks/{914.js → 2914.js} +2 -2
  25. package/.next/server/chunks/{264.js → 3264.js} +2 -2
  26. package/.next/server/chunks/{746.js → 3746.js} +2 -2
  27. package/.next/server/chunks/{898.js → 3898.js} +2 -2
  28. package/.next/server/chunks/{312.js → 4312.js} +2 -2
  29. package/.next/server/chunks/{371.js → 4371.js} +3 -3
  30. package/.next/server/chunks/{849.js → 4849.js} +2 -2
  31. package/.next/server/chunks/{664.js → 5098.js} +2 -2
  32. package/.next/server/chunks/{576.js → 5576.js} +2 -2
  33. package/.next/server/chunks/{280.js → 6280.js} +2 -2
  34. package/.next/server/chunks/{307.js → 6307.js} +2 -2
  35. package/.next/server/chunks/{465.js → 6465.js} +2 -2
  36. package/.next/server/chunks/{859.js → 6859.js} +2 -2
  37. package/.next/server/chunks/{881.js → 6881.js} +2 -2
  38. package/.next/server/chunks/{104.js → 7104.js} +2 -2
  39. package/.next/server/chunks/{183.js → 7183.js} +2 -2
  40. package/.next/server/chunks/{377.js → 7377.js} +2 -2
  41. package/.next/server/chunks/{732.js → 7732.js} +2 -2
  42. package/.next/server/chunks/{992.js → 7992.js} +4 -4
  43. package/.next/server/chunks/{98.js → 8098.js} +2 -2
  44. package/.next/server/chunks/{287.js → 8287.js} +2 -2
  45. package/.next/server/chunks/{872.js → 8872.js} +2 -2
  46. package/.next/server/chunks/{143.js → 9143.js} +2 -2
  47. package/.next/server/chunks/{854.js → 9854.js} +2 -2
  48. package/.next/server/middleware-build-manifest.js +1 -1
  49. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  50. package/.next/server/pages/404.js.nft.json +1 -1
  51. package/.next/server/pages/500.js.nft.json +1 -1
  52. package/.next/server/pages/[...slug].js +33 -9
  53. package/.next/server/pages/[...slug].js.nft.json +1 -1
  54. package/.next/server/pages/[slug]/p.js +41 -15
  55. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  56. package/.next/server/pages/_app.js +45 -21
  57. package/.next/server/pages/_app.js.nft.json +1 -1
  58. package/.next/server/pages/_document.js +1 -1
  59. package/.next/server/pages/_document.js.nft.json +1 -1
  60. package/.next/server/pages/_error.js +2 -2
  61. package/.next/server/pages/account.js.nft.json +1 -1
  62. package/.next/server/pages/api/graphql.js +3 -3
  63. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  64. package/.next/server/pages/api/preview.js +3 -3
  65. package/.next/server/pages/api/preview.js.nft.json +1 -1
  66. package/.next/server/pages/checkout.js.nft.json +1 -1
  67. package/.next/server/pages/en-US/404.html +2 -2
  68. package/.next/server/pages/en-US/500.html +2 -2
  69. package/.next/server/pages/en-US/account.html +2 -2
  70. package/.next/server/pages/en-US/checkout.html +2 -2
  71. package/.next/server/pages/en-US/login.html +2 -2
  72. package/.next/server/pages/en-US/s.html +2 -2
  73. package/.next/server/pages/en-US.html +3 -3
  74. package/.next/server/pages/en-US.json +1 -1
  75. package/.next/server/pages/index.js +32 -11
  76. package/.next/server/pages/index.js.nft.json +1 -1
  77. package/.next/server/pages/login.js.nft.json +1 -1
  78. package/.next/server/pages/s.js.nft.json +1 -1
  79. package/.next/server/pages-manifest.json +2 -2
  80. package/.next/server/webpack-api-runtime.js +2 -2
  81. package/.next/server/webpack-runtime.js +2 -2
  82. package/.next/static/chunks/29.8b3dad75b915d222.js +1 -0
  83. package/.next/static/chunks/337-cf283e91e431869b.js +1 -0
  84. package/.next/static/chunks/380-efd3541ef85300d5.js +1 -0
  85. package/.next/static/chunks/608.59e69b83f35d9c44.js +1 -0
  86. package/.next/static/chunks/{686.36adeba271636edd.js → 686.41582b9e75eaba89.js} +1 -1
  87. package/.next/static/chunks/{817-728f854c2948afc0.js → 817-f2821b9a40663949.js} +1 -1
  88. package/.next/static/chunks/{953.7a6f29b1fc85a9d9.js → 843.fab5a00e170b4f11.js} +1 -1
  89. package/.next/static/chunks/{909.1e25801e430906c0.js → 909.787de82e0ed9eea3.js} +1 -1
  90. package/.next/static/chunks/pages/[...slug]-51896262f6760bf1.js +1 -0
  91. package/.next/static/chunks/pages/[slug]/p-08c1f443f7d84d0d.js +1 -0
  92. package/.next/static/chunks/pages/{_app-9cc7312632f19e94.js → _app-81a4a14c7f15c641.js} +1 -1
  93. package/.next/static/chunks/pages/index-912d65fde37706bb.js +1 -0
  94. package/.next/static/chunks/webpack-1352532ac51c6a2d.js +1 -0
  95. package/.next/static/css/{e63697a078fd522e.css → 9e7c9877b9f78c63.css} +1 -1
  96. package/.next/static/css/9e8d9784094a047f.css +1 -0
  97. package/.next/static/{aek2NDV1vh2ZKaUTiqnby → dh7cD3fiozdMG3HhpxK6m}/_buildManifest.js +1 -1
  98. package/.next/trace +65 -64
  99. package/.turbo/turbo-build.log +8 -7
  100. package/CHANGELOG.md +10 -0
  101. package/next.config.js +4 -0
  102. package/package.json +5 -4
  103. package/src/components/sections/Hero/Hero.tsx +1 -2
  104. package/src/components/ui/Image/Image.tsx +25 -51
  105. package/src/components/ui/Image/thumborUrlBuilder.ts +3 -1
  106. package/src/components/ui/ImageGallery/ImageGallery.tsx +2 -2
  107. package/src/components/ui/ImageGallery/ImageGallerySelector.tsx +4 -2
  108. package/src/components/ui/ImageGallery/image-gallery-selector.module.scss +2 -2
  109. package/src/styles/global/layout.scss +0 -7
  110. package/.next/static/chunks/260-994385416f68673d.js +0 -1
  111. package/.next/static/chunks/337-4b719ca7a86d8d8c.js +0 -1
  112. package/.next/static/chunks/588.591fb3bf1a136c66.js +0 -1
  113. package/.next/static/chunks/pages/[...slug]-9443b18a60d89746.js +0 -1
  114. package/.next/static/chunks/pages/[slug]/p-cb8ef12f6449cf26.js +0 -1
  115. package/.next/static/chunks/pages/index-6717326cc207d674.js +0 -1
  116. package/.next/static/chunks/webpack-8649a0a6a4495828.js +0 -1
  117. package/.next/static/css/14ebc84fc6d6c80c.css +0 -1
  118. /package/.next/static/{aek2NDV1vh2ZKaUTiqnby → dh7cD3fiozdMG3HhpxK6m}/_ssgManifest.js +0 -0
@@ -0,0 +1,515 @@
1
+ exports.id = 1608;
2
+ exports.ids = [1608];
3
+ exports.modules = {
4
+
5
+ /***/ 1432:
6
+ /***/ ((module, exports, __webpack_require__) => {
7
+
8
+ "client";
9
+ "use strict";
10
+
11
+ Object.defineProperty(exports, "__esModule", ({
12
+ value: true
13
+ }));
14
+ exports["default"] = Image;
15
+
16
+ var _extends = (__webpack_require__(6495)/* ["default"] */ .Z);
17
+
18
+ var _interop_require_default = (__webpack_require__(2648)/* ["default"] */ .Z);
19
+
20
+ var _interop_require_wildcard = (__webpack_require__(1598)/* ["default"] */ .Z);
21
+
22
+ var _object_without_properties_loose = (__webpack_require__(7273)/* ["default"] */ .Z);
23
+
24
+ var _react = _interop_require_wildcard(__webpack_require__(6689));
25
+
26
+ var _head = _interop_require_default(__webpack_require__(5429));
27
+
28
+ var _imageBlurSvg = __webpack_require__(4486);
29
+
30
+ var _imageConfig = __webpack_require__(5843);
31
+
32
+ var _imageConfigContext = __webpack_require__(744);
33
+
34
+ var _utils = __webpack_require__(9232);
35
+
36
+ function Image(_param) {
37
+ var {
38
+ src,
39
+ sizes,
40
+ unoptimized = false,
41
+ priority = false,
42
+ loading,
43
+ className,
44
+ quality,
45
+ width,
46
+ height,
47
+ fill,
48
+ style,
49
+ onLoadingComplete,
50
+ placeholder = 'empty',
51
+ blurDataURL
52
+ } = _param,
53
+ all = _object_without_properties_loose(_param, ["src", "sizes", "unoptimized", "priority", "loading", "className", "quality", "width", "height", "fill", "style", "onLoadingComplete", "placeholder", "blurDataURL"]);
54
+
55
+ const configContext = (0, _react).useContext(_imageConfigContext.ImageConfigContext);
56
+ const config = (0, _react).useMemo(() => {
57
+ const c = configEnv || configContext || _imageConfig.imageConfigDefault;
58
+ const allSizes = [...c.deviceSizes, ...c.imageSizes].sort((a, b) => a - b);
59
+ const deviceSizes = c.deviceSizes.sort((a, b) => a - b);
60
+ return _extends({}, c, {
61
+ allSizes,
62
+ deviceSizes
63
+ });
64
+ }, [configContext]);
65
+ let rest = all;
66
+ let loader = defaultLoader;
67
+
68
+ if ('loader' in rest) {
69
+ if (rest.loader) {
70
+ const customImageLoader = rest.loader;
71
+
72
+ var _tmp;
73
+
74
+ _tmp = obj => {
75
+ const {
76
+ config: _
77
+ } = obj,
78
+ opts = _object_without_properties_loose(obj, ["config"]); // The config object is internal only so we must
79
+ // not pass it to the user-defined loader()
80
+
81
+
82
+ return customImageLoader(opts);
83
+ }, loader = _tmp, _tmp;
84
+ } // Remove property so it's not spread on <img>
85
+
86
+
87
+ delete rest.loader;
88
+ }
89
+
90
+ let staticSrc = '';
91
+ let widthInt = getInt(width);
92
+ let heightInt = getInt(height);
93
+ let blurWidth;
94
+ let blurHeight;
95
+
96
+ if (isStaticImport(src)) {
97
+ const staticImageData = isStaticRequire(src) ? src.default : src;
98
+
99
+ if (!staticImageData.src) {
100
+ throw new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(staticImageData)}`);
101
+ }
102
+
103
+ if (!staticImageData.height || !staticImageData.width) {
104
+ throw new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(staticImageData)}`);
105
+ }
106
+
107
+ blurWidth = staticImageData.blurWidth;
108
+ blurHeight = staticImageData.blurHeight;
109
+ blurDataURL = blurDataURL || staticImageData.blurDataURL;
110
+ staticSrc = staticImageData.src;
111
+
112
+ if (!fill) {
113
+ if (!widthInt && !heightInt) {
114
+ widthInt = staticImageData.width;
115
+ heightInt = staticImageData.height;
116
+ } else if (widthInt && !heightInt) {
117
+ const ratio = widthInt / staticImageData.width;
118
+ heightInt = Math.round(staticImageData.height * ratio);
119
+ } else if (!widthInt && heightInt) {
120
+ const ratio = heightInt / staticImageData.height;
121
+ widthInt = Math.round(staticImageData.width * ratio);
122
+ }
123
+ }
124
+ }
125
+
126
+ src = typeof src === 'string' ? src : staticSrc;
127
+ let isLazy = !priority && (loading === 'lazy' || typeof loading === 'undefined');
128
+
129
+ if (src.startsWith('data:') || src.startsWith('blob:')) {
130
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
131
+ unoptimized = true;
132
+ isLazy = false;
133
+ }
134
+
135
+ if (config.unoptimized) {
136
+ unoptimized = true;
137
+ }
138
+
139
+ const [blurComplete, setBlurComplete] = (0, _react).useState(false);
140
+ const [showAltText, setShowAltText] = (0, _react).useState(false);
141
+ const qualityInt = getInt(quality);
142
+
143
+ if (false) {}
144
+
145
+ const imgStyle = Object.assign(fill ? {
146
+ position: 'absolute',
147
+ height: '100%',
148
+ width: '100%',
149
+ left: 0,
150
+ top: 0,
151
+ right: 0,
152
+ bottom: 0
153
+ } : {}, showAltText ? {} : {
154
+ color: 'transparent'
155
+ }, style);
156
+ const blurStyle = placeholder === 'blur' && blurDataURL && !blurComplete ? {
157
+ backgroundSize: imgStyle.objectFit || 'cover',
158
+ backgroundPosition: imgStyle.objectPosition || '50% 50%',
159
+ backgroundRepeat: 'no-repeat',
160
+ backgroundImage: `url("data:image/svg+xml;charset=utf-8,${(0, _imageBlurSvg).getImageBlurSvg({
161
+ widthInt,
162
+ heightInt,
163
+ blurWidth,
164
+ blurHeight,
165
+ blurDataURL
166
+ })}")`
167
+ } : {};
168
+
169
+ if (false) {}
170
+
171
+ const imgAttributes = generateImgAttrs({
172
+ config,
173
+ src,
174
+ unoptimized,
175
+ width: widthInt,
176
+ quality: qualityInt,
177
+ sizes,
178
+ loader
179
+ });
180
+ let srcString = src;
181
+
182
+ if (false) {}
183
+
184
+ let imageSrcSetPropName = 'imagesrcset';
185
+ let imageSizesPropName = 'imagesizes';
186
+
187
+ if (true) {
188
+ imageSrcSetPropName = 'imageSrcSet';
189
+ imageSizesPropName = 'imageSizes';
190
+ }
191
+
192
+ const linkProps = {
193
+ // Note: imagesrcset and imagesizes are not in the link element type with react 17.
194
+ [imageSrcSetPropName]: imgAttributes.srcSet,
195
+ [imageSizesPropName]: imgAttributes.sizes,
196
+ crossOrigin: rest.crossOrigin
197
+ };
198
+ const onLoadingCompleteRef = (0, _react).useRef(onLoadingComplete);
199
+ (0, _react).useEffect(() => {
200
+ onLoadingCompleteRef.current = onLoadingComplete;
201
+ }, [onLoadingComplete]);
202
+
203
+ const imgElementArgs = _extends({
204
+ isLazy,
205
+ imgAttributes,
206
+ heightInt,
207
+ widthInt,
208
+ qualityInt,
209
+ className,
210
+ imgStyle,
211
+ blurStyle,
212
+ loading,
213
+ config,
214
+ fill,
215
+ unoptimized,
216
+ placeholder,
217
+ loader,
218
+ srcString,
219
+ onLoadingCompleteRef,
220
+ setBlurComplete,
221
+ setShowAltText
222
+ }, rest);
223
+
224
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ImageElement, Object.assign({}, imgElementArgs)), priority ? // Note how we omit the `href` attribute, as it would only be relevant
225
+ // for browsers that do not support `imagesrcset`, and in those cases
226
+ // it would likely cause the incorrect image to be preloaded.
227
+ //
228
+ // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset
229
+
230
+ /*#__PURE__*/
231
+ _react.default.createElement(_head.default, null, /*#__PURE__*/_react.default.createElement("link", Object.assign({
232
+ key: '__nimg-' + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes,
233
+ rel: "preload",
234
+ as: "image",
235
+ href: imgAttributes.srcSet ? undefined : imgAttributes.src
236
+ }, linkProps))) : null);
237
+ }
238
+
239
+ 'client';
240
+ const configEnv = {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false};
241
+ const allImgs = new Map();
242
+ let perfObserver;
243
+
244
+ if (true) {
245
+ global.__NEXT_IMAGE_IMPORTED = true;
246
+ }
247
+
248
+ const VALID_LOADING_VALUES = (/* unused pure expression or super */ null && (['lazy', 'eager', undefined]));
249
+
250
+ function isStaticRequire(src) {
251
+ return src.default !== undefined;
252
+ }
253
+
254
+ function isStaticImageData(src) {
255
+ return src.src !== undefined;
256
+ }
257
+
258
+ function isStaticImport(src) {
259
+ return typeof src === 'object' && (isStaticRequire(src) || isStaticImageData(src));
260
+ }
261
+
262
+ function getWidths({
263
+ deviceSizes,
264
+ allSizes
265
+ }, width, sizes) {
266
+ if (sizes) {
267
+ // Find all the "vw" percent sizes used in the sizes prop
268
+ const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
269
+ const percentSizes = [];
270
+
271
+ for (let match; match = viewportWidthRe.exec(sizes); match) {
272
+ percentSizes.push(parseInt(match[2]));
273
+ }
274
+
275
+ if (percentSizes.length) {
276
+ const smallestRatio = Math.min(...percentSizes) * 0.01;
277
+ return {
278
+ widths: allSizes.filter(s => s >= deviceSizes[0] * smallestRatio),
279
+ kind: 'w'
280
+ };
281
+ }
282
+
283
+ return {
284
+ widths: allSizes,
285
+ kind: 'w'
286
+ };
287
+ }
288
+
289
+ if (typeof width !== 'number') {
290
+ return {
291
+ widths: deviceSizes,
292
+ kind: 'w'
293
+ };
294
+ }
295
+
296
+ const widths = [...new Set( // > This means that most OLED screens that say they are 3x resolution,
297
+ // > are actually 3x in the green color, but only 1.5x in the red and
298
+ // > blue colors. Showing a 3x resolution image in the app vs a 2x
299
+ // > resolution image will be visually the same, though the 3x image
300
+ // > takes significantly more data. Even true 3x resolution screens are
301
+ // > wasteful as the human eye cannot see that level of detail without
302
+ // > something like a magnifying glass.
303
+ // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
304
+ [width, width * 2
305
+ /*, width * 3*/
306
+ ].map(w => allSizes.find(p => p >= w) || allSizes[allSizes.length - 1]))];
307
+ return {
308
+ widths,
309
+ kind: 'x'
310
+ };
311
+ }
312
+
313
+ function generateImgAttrs({
314
+ config,
315
+ src,
316
+ unoptimized,
317
+ width,
318
+ quality,
319
+ sizes,
320
+ loader
321
+ }) {
322
+ if (unoptimized) {
323
+ return {
324
+ src,
325
+ srcSet: undefined,
326
+ sizes: undefined
327
+ };
328
+ }
329
+
330
+ const {
331
+ widths,
332
+ kind
333
+ } = getWidths(config, width, sizes);
334
+ const last = widths.length - 1;
335
+ return {
336
+ sizes: !sizes && kind === 'w' ? '100vw' : sizes,
337
+ srcSet: widths.map((w, i) => `${loader({
338
+ config,
339
+ src,
340
+ quality,
341
+ width: w
342
+ })} ${kind === 'w' ? w : i + 1}${kind}`).join(', '),
343
+ // It's intended to keep `src` the last attribute because React updates
344
+ // attributes in order. If we keep `src` the first one, Safari will
345
+ // immediately start to fetch `src`, before `sizes` and `srcSet` are even
346
+ // updated by React. That causes multiple unnecessary requests if `srcSet`
347
+ // and `sizes` are defined.
348
+ // This bug cannot be reproduced in Chrome or Firefox.
349
+ src: loader({
350
+ config,
351
+ src,
352
+ quality,
353
+ width: widths[last]
354
+ })
355
+ };
356
+ }
357
+
358
+ function getInt(x) {
359
+ if (typeof x === 'number' || typeof x === 'undefined') {
360
+ return x;
361
+ }
362
+
363
+ if (typeof x === 'string' && /^[0-9]+$/.test(x)) {
364
+ return parseInt(x, 10);
365
+ }
366
+
367
+ return NaN;
368
+ } // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
369
+ // handler instead of the img's onLoad attribute.
370
+
371
+
372
+ function handleLoading(img, src, placeholder, onLoadingCompleteRef, setBlurComplete) {
373
+ if (!img || img['data-loaded-src'] === src) {
374
+ return;
375
+ }
376
+
377
+ img['data-loaded-src'] = src;
378
+ const p = 'decode' in img ? img.decode() : Promise.resolve();
379
+ p.catch(() => {}).then(() => {
380
+ if (!img.parentNode) {
381
+ // Exit early in case of race condition:
382
+ // - onload() is called
383
+ // - decode() is called but incomplete
384
+ // - unmount is called
385
+ // - decode() completes
386
+ return;
387
+ }
388
+
389
+ if (placeholder === 'blur') {
390
+ setBlurComplete(true);
391
+ }
392
+
393
+ if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) {
394
+ onLoadingCompleteRef.current(img);
395
+ }
396
+
397
+ if (false) {}
398
+ });
399
+ }
400
+
401
+ const ImageElement = _param => {
402
+ var {
403
+ imgAttributes,
404
+ heightInt,
405
+ widthInt,
406
+ qualityInt,
407
+ className,
408
+ imgStyle,
409
+ blurStyle,
410
+ isLazy,
411
+ fill,
412
+ placeholder,
413
+ loading,
414
+ srcString,
415
+ config,
416
+ unoptimized,
417
+ loader,
418
+ onLoadingCompleteRef,
419
+ setBlurComplete,
420
+ setShowAltText,
421
+ onLoad,
422
+ onError
423
+ } = _param,
424
+ rest = _object_without_properties_loose(_param, ["imgAttributes", "heightInt", "widthInt", "qualityInt", "className", "imgStyle", "blurStyle", "isLazy", "fill", "placeholder", "loading", "srcString", "config", "unoptimized", "loader", "onLoadingCompleteRef", "setBlurComplete", "setShowAltText", "onLoad", "onError"]);
425
+
426
+ loading = isLazy ? 'lazy' : loading;
427
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("img", Object.assign({}, rest, imgAttributes, {
428
+ width: widthInt,
429
+ height: heightInt,
430
+ decoding: "async",
431
+ "data-nimg": `future${fill ? '-fill' : ''}`,
432
+ className: className,
433
+ // @ts-ignore - TODO: upgrade to `@types/react@17`
434
+ loading: loading,
435
+ style: _extends({}, imgStyle, blurStyle),
436
+ ref: (0, _react).useCallback(img => {
437
+ if (!img) {
438
+ return;
439
+ }
440
+
441
+ if (onError) {
442
+ // If the image has an error before react hydrates, then the error is lost.
443
+ // The workaround is to wait until the image is mounted which is after hydration,
444
+ // then we set the src again to trigger the error handler (if there was an error).
445
+ // eslint-disable-next-line no-self-assign
446
+ img.src = img.src;
447
+ }
448
+
449
+ if (false) {}
450
+
451
+ if (img.complete) {
452
+ handleLoading(img, srcString, placeholder, onLoadingCompleteRef, setBlurComplete);
453
+ }
454
+ }, [srcString, placeholder, onLoadingCompleteRef, setBlurComplete, onError]),
455
+ onLoad: event => {
456
+ const img = event.currentTarget;
457
+ handleLoading(img, srcString, placeholder, onLoadingCompleteRef, setBlurComplete);
458
+
459
+ if (onLoad) {
460
+ onLoad(event);
461
+ }
462
+ },
463
+ onError: event => {
464
+ // if the real image fails to load, this will ensure "alt" is visible
465
+ setShowAltText(true);
466
+
467
+ if (placeholder === 'blur') {
468
+ // If the real image fails to load, this will still remove the placeholder.
469
+ setBlurComplete(true);
470
+ }
471
+
472
+ if (onError) {
473
+ onError(event);
474
+ }
475
+ }
476
+ })));
477
+ };
478
+
479
+ function defaultLoader({
480
+ config,
481
+ src,
482
+ width,
483
+ quality
484
+ }) {
485
+ if (false) {}
486
+
487
+ if (src.endsWith('.svg') && !config.dangerouslyAllowSVG) {
488
+ // Special case to make svg serve as-is to avoid proxying
489
+ // through the built-in Image Optimization API.
490
+ return src;
491
+ }
492
+
493
+ return `${config.path}?url=${encodeURIComponent(src)}&w=${width}&q=${quality || 75}`;
494
+ }
495
+
496
+ if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
497
+ Object.defineProperty(exports.default, '__esModule', {
498
+ value: true
499
+ });
500
+ Object.assign(exports.default, exports);
501
+ module.exports = exports.default;
502
+ }
503
+
504
+ /***/ }),
505
+
506
+ /***/ 1608:
507
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
508
+
509
+ module.exports = __webpack_require__(1432)
510
+
511
+
512
+ /***/ })
513
+
514
+ };
515
+ ;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 154;
3
- exports.ids = [154];
2
+ exports.id = 2154;
3
+ exports.ids = [2154];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 2154:
@@ -14,11 +14,15 @@ __webpack_require__.d(__webpack_exports__, {
14
14
 
15
15
  // EXTERNAL MODULE: external "react"
16
16
  var external_react_ = __webpack_require__(6689);
17
- // EXTERNAL MODULE: external "next/head"
18
- var head_ = __webpack_require__(968);
19
- var head_default = /*#__PURE__*/__webpack_require__.n(head_);
17
+ // EXTERNAL MODULE: ./node_modules/next/future/image.js
18
+ var future_image = __webpack_require__(1608);
19
+ var image_default = /*#__PURE__*/__webpack_require__.n(future_image);
20
+ // EXTERNAL MODULE: ./faststore.config.js
21
+ var faststore_config = __webpack_require__(7183);
22
+ var faststore_config_default = /*#__PURE__*/__webpack_require__.n(faststore_config);
20
23
  ;// CONCATENATED MODULE: ./src/components/ui/Image/thumborUrlBuilder.ts
21
- const THUMBOR_SERVER = 'https://assets.vtex.app';
24
+
25
+ const THUMBOR_SERVER = `https://${(faststore_config_default()).api.storeId}.vtexassets.com`;
22
26
 
23
27
  const cropSection = ({
24
28
  left,
@@ -139,7 +143,7 @@ const useImage = _ref => {
139
143
  // EXTERNAL MODULE: external "react/jsx-runtime"
140
144
  var jsx_runtime_ = __webpack_require__(997);
141
145
  ;// CONCATENATED MODULE: ./src/components/ui/Image/Image.tsx
142
- const Image_excluded = ["preload", "fetchPriority"];
146
+ const Image_excluded = ["src", "width", "height", "quality"];
143
147
 
144
148
  function Image_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; }
145
149
 
@@ -153,43 +157,44 @@ function Image_objectWithoutPropertiesLoose(source, excluded) { if (source == nu
153
157
 
154
158
 
155
159
 
160
+ // Next loader function does not handle all props as height and options,
161
+ // so we use the useImage hook to handle the custom thumbor loader (VTEX CDN) along with unoptimized prop
162
+ // https://nextjs.org/docs/api-reference/next/image#loader
156
163
 
157
164
 
158
165
 
159
-
160
- // TODO: Replace this component by next/image
161
- const Image = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
166
+ function Image(_ref) {
162
167
  let {
163
- preload = false,
164
- fetchPriority
168
+ src,
169
+ width,
170
+ height,
171
+ quality
165
172
  } = _ref,
166
173
  otherProps = Image_objectWithoutProperties(_ref, Image_excluded);
167
174
 
168
- const imgProps = useImage(otherProps);
169
175
  const {
170
- src,
171
- sizes = '100vw',
172
- srcSet
173
- } = imgProps;
174
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
175
- children: [preload && /*#__PURE__*/jsx_runtime_.jsx((head_default()), {
176
- children: /*#__PURE__*/jsx_runtime_.jsx("link", {
177
- as: "image",
178
- rel: "preload",
179
- href: src,
180
- imageSrcSet: srcSet,
181
- imageSizes: sizes,
182
- fetchpriority: fetchPriority
183
- })
184
- }), /*#__PURE__*/jsx_runtime_.jsx("img", Image_objectSpread(Image_objectSpread({
185
- ref: ref,
186
- "data-fs-image": true
187
- }, imgProps), {}, {
188
- alt: imgProps.alt,
189
- fetchpriority: fetchPriority
190
- }))]
191
- });
192
- });
176
+ src: thumborSrc,
177
+ alt
178
+ } = useImage(Image_objectSpread({
179
+ src: String(src),
180
+ width: Number(width),
181
+ height: Number(height),
182
+ options: quality ? {
183
+ filters: {
184
+ quality
185
+ }
186
+ } : undefined
187
+ }, otherProps));
188
+ return /*#__PURE__*/jsx_runtime_.jsx((image_default()), Image_objectSpread({
189
+ "data-fs-image": true,
190
+ unoptimized: true,
191
+ src: thumborSrc,
192
+ width: width,
193
+ height: height,
194
+ alt: alt
195
+ }, otherProps));
196
+ }
197
+
193
198
  Image.displayName = 'Image';
194
199
  /* harmony default export */ const Image_Image = (/*#__PURE__*/(0,external_react_.memo)(Image));
195
200
  ;// CONCATENATED MODULE: ./src/components/ui/Image/index.ts
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 439;
3
- exports.ids = [439];
2
+ exports.id = 2439;
3
+ exports.ids = [2439];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 9739:
@@ -1,5 +1,5 @@
1
- exports.id = 914;
2
- exports.ids = [914];
1
+ exports.id = 2914;
2
+ exports.ids = [2914];
3
3
  exports.modules = {
4
4
 
5
5
  /***/ 2914:
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 264;
3
- exports.ids = [264];
2
+ exports.id = 3264;
3
+ exports.ids = [3264];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 3264:
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 746;
3
- exports.ids = [746];
2
+ exports.id = 3746;
3
+ exports.ids = [3746];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 4875:
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 898;
3
- exports.ids = [898];
2
+ exports.id = 3898;
3
+ exports.ids = [3898];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 6321:
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 312;
3
- exports.ids = [312];
2
+ exports.id = 4312;
3
+ exports.ids = [4312];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 2727: