@faststore/core 2.0.96-alpha.0 → 2.0.97-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.
- package/.next/BUILD_ID +1 -0
- package/.next/build-manifest.json +101 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/config.json +7 -0
- package/.next/cache/eslint/.cache_1gneedd +1 -0
- package/.next/cache/next-server.js.nft.json +1 -0
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/export-marker.json +1 -0
- package/.next/images-manifest.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +1 -0
- package/.next/react-loadable-manifest.json +44 -0
- package/.next/required-server-files.json +1 -0
- package/.next/routes-manifest.json +1 -0
- package/.next/server/chunks/104.js +196 -0
- package/.next/server/chunks/143.js +106 -0
- package/.next/server/chunks/152.js +216 -0
- package/.next/server/chunks/154.js +206 -0
- package/.next/server/chunks/183.js +72 -0
- package/.next/server/chunks/247.js +61 -0
- package/.next/server/chunks/264.js +67 -0
- package/.next/server/chunks/280.js +417 -0
- package/.next/server/chunks/287.js +79 -0
- package/.next/server/chunks/312.js +684 -0
- package/.next/server/chunks/317.js +125 -0
- package/.next/server/chunks/350.js +120 -0
- package/.next/server/chunks/371.js +1484 -0
- package/.next/server/chunks/377.js +82 -0
- package/.next/server/chunks/394.js +3801 -0
- package/.next/server/chunks/439.js +175 -0
- package/.next/server/chunks/444.js +464 -0
- package/.next/server/chunks/465.js +91 -0
- package/.next/server/chunks/576.js +72 -0
- package/.next/server/chunks/608.js +515 -0
- package/.next/server/chunks/664.js +124 -0
- package/.next/server/chunks/676.js +32 -0
- package/.next/server/chunks/746.js +237 -0
- package/.next/server/chunks/777.js +708 -0
- package/.next/server/chunks/854.js +72 -0
- package/.next/server/chunks/859.js +959 -0
- package/.next/server/chunks/872.js +378 -0
- package/.next/server/chunks/881.js +320 -0
- package/.next/server/chunks/898.js +240 -0
- package/.next/server/chunks/914.js +96 -0
- package/.next/server/chunks/953.js +674 -0
- package/.next/server/chunks/98.js +266 -0
- package/.next/server/chunks/992.js +570 -0
- package/.next/server/chunks/font-manifest.json +1 -0
- package/.next/server/font-manifest.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/pages/404.js.nft.json +1 -0
- package/.next/server/pages/500.js.nft.json +1 -0
- package/.next/server/pages/[...slug].js +633 -0
- package/.next/server/pages/[...slug].js.nft.json +1 -0
- package/.next/server/pages/[slug]/p.js +2390 -0
- package/.next/server/pages/[slug]/p.js.nft.json +1 -0
- package/.next/server/pages/_app.js +2467 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +304 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +164 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages/account.js.nft.json +1 -0
- package/.next/server/pages/api/graphql.js +259 -0
- package/.next/server/pages/api/graphql.js.nft.json +1 -0
- package/.next/server/pages/api/preview.js +118 -0
- package/.next/server/pages/api/preview.js.nft.json +1 -0
- package/.next/server/pages/checkout.js.nft.json +1 -0
- package/.next/server/pages/en-US/404.html +81 -0
- package/.next/server/pages/en-US/500.html +81 -0
- package/.next/server/pages/en-US/account.html +81 -0
- package/.next/server/pages/en-US/checkout.html +81 -0
- package/.next/server/pages/en-US/login.html +81 -0
- package/.next/server/pages/en-US/s.html +81 -0
- package/.next/server/pages/en-US.html +81 -0
- package/.next/server/pages/en-US.json +1 -0
- package/.next/server/pages/index.js +428 -0
- package/.next/server/pages/index.js.nft.json +1 -0
- package/.next/server/pages/login.js.nft.json +1 -0
- package/.next/server/pages/s.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +16 -0
- package/.next/server/webpack-api-runtime.js +229 -0
- package/.next/server/webpack-runtime.js +229 -0
- package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
- package/.next/static/chunks/152.d44c4f8d83e68e26.js +1 -0
- package/.next/static/chunks/251-5059c71d8e624b60.js +1 -0
- package/.next/static/chunks/291.1b3f1a62d6e853d1.js +1 -0
- package/.next/static/chunks/351-a4e28d64f48c5269.js +1 -0
- package/.next/static/chunks/608.59e69b83f35d9c44.js +1 -0
- package/.next/static/chunks/626-d631f2cb747ef569.js +1 -0
- package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
- package/.next/static/chunks/686.41582b9e75eaba89.js +1 -0
- package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
- package/.next/static/chunks/781-7df372b5b56e3f96.js +1 -0
- package/.next/static/chunks/843.f55ad79a8fd4f87c.js +1 -0
- package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
- package/.next/static/chunks/main-9746772201fe3ac1.js +1 -0
- package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +1 -0
- package/.next/static/chunks/pages/500-910883c20541d9ce.js +1 -0
- package/.next/static/chunks/pages/[...slug]-4b2bea89ec5c8fbe.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-912fe4b532f4fdce.js +1 -0
- package/.next/static/chunks/pages/_app-c30dfc55a86c1363.js +1 -0
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
- package/.next/static/chunks/pages/account-b8fc5222ffe89b60.js +1 -0
- package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +1 -0
- package/.next/static/chunks/pages/index-eabe9d42a172b52b.js +1 -0
- package/.next/static/chunks/pages/login-33954810b200eca8.js +1 -0
- package/.next/static/chunks/pages/s-b49bdf6af37376b6.js +1 -0
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
- package/.next/static/chunks/webpack-f1a1b4bcfa6b66bb.js +1 -0
- package/.next/static/css/10db3bc7ecdf0556.css +1 -0
- package/.next/static/css/43d61b402f41569b.css +1 -0
- package/.next/static/css/4899c3cc356704f9.css +1 -0
- package/.next/static/css/5f1958d8dece68c7.css +1 -0
- package/.next/static/css/6507cb48401e73a4.css +1 -0
- package/.next/static/css/8ea129ea90e49e98.css +1 -0
- package/.next/static/css/b2f16bd4b93e0aca.css +1 -0
- package/.next/static/css/db63ea05e98cb7e8.css +1 -0
- package/.next/static/m9qPYxeN9bMid06fpEhbE/_buildManifest.js +1 -0
- package/.next/static/m9qPYxeN9bMid06fpEhbE/_ssgManifest.js +1 -0
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/trace +64 -0
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/public/~partytown/debug/partytown-atomics.js +556 -0
- package/public/~partytown/debug/partytown-media.js +374 -0
- package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
- package/public/~partytown/debug/partytown-sw.js +59 -0
- package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
- package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
- package/public/~partytown/debug/partytown.js +72 -0
- package/public/~partytown/partytown-atomics.js +2 -0
- package/public/~partytown/partytown-media.js +2 -0
- package/public/~partytown/partytown-sw.js +2 -0
- package/public/~partytown/partytown.js +2 -0
- package/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx +5 -1
- package/src/pages/account.tsx +1 -1
- package/src/pages/login.tsx +1 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
exports.id = 104;
|
|
2
|
+
exports.ids = [104];
|
|
3
|
+
exports.modules = {
|
|
4
|
+
|
|
5
|
+
/***/ 8569:
|
|
6
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
|
|
14
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
15
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
|
|
16
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
|
|
17
|
+
/* harmony import */ var src_sdk_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5184);
|
|
18
|
+
/* harmony import */ var src_components_skeletons_ProductShelfSkeleton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9201);
|
|
19
|
+
/* harmony import */ var src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4867);
|
|
20
|
+
/* harmony import */ var _product_ProductCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6475);
|
|
21
|
+
/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8879);
|
|
22
|
+
/* harmony import */ var _product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3656);
|
|
23
|
+
/* harmony import */ var _product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8__);
|
|
24
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(997);
|
|
25
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
|
|
26
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__]);
|
|
27
|
+
src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
28
|
+
const _excluded = ["title", "withDivisor"];
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
function ProductShelf(_ref) {
|
|
46
|
+
let {
|
|
47
|
+
title,
|
|
48
|
+
withDivisor = false
|
|
49
|
+
} = _ref,
|
|
50
|
+
variables = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
|
|
52
|
+
const viewedOnce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
|
|
53
|
+
const {
|
|
54
|
+
ref,
|
|
55
|
+
inView
|
|
56
|
+
} = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
|
|
57
|
+
const products = (0,src_sdk_product_useProductsQuery__WEBPACK_IMPORTED_MODULE_4__/* .useProductsQuery */ .kN)(variables);
|
|
58
|
+
const productEdges = products?.edges ?? [];
|
|
59
|
+
const aspectRatio = 1;
|
|
60
|
+
const {
|
|
61
|
+
sendViewItemListEvent
|
|
62
|
+
} = (0,src_sdk_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_2__/* .useViewItemListEvent */ .m)({
|
|
63
|
+
products: productEdges,
|
|
64
|
+
title,
|
|
65
|
+
page: 0,
|
|
66
|
+
pageSize: 0
|
|
67
|
+
});
|
|
68
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
69
|
+
if (inView && !viewedOnce.current && productEdges.length) {
|
|
70
|
+
sendViewItemListEvent();
|
|
71
|
+
viewedOnce.current = true;
|
|
72
|
+
}
|
|
73
|
+
}, [inView, productEdges.length, sendViewItemListEvent]);
|
|
74
|
+
|
|
75
|
+
if (products?.edges.length === 0) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_Section__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
80
|
+
className: `layout__section ${withDivisor ? 'section__divisor' : ''}`,
|
|
81
|
+
ref: ref,
|
|
82
|
+
children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("h2", {
|
|
83
|
+
className: "text__title-section layout__content",
|
|
84
|
+
children: title
|
|
85
|
+
}), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("div", {
|
|
86
|
+
className: (_product_shelf_module_scss__WEBPACK_IMPORTED_MODULE_8___default().fsProductShelf),
|
|
87
|
+
"data-fs-product-shelf": true,
|
|
88
|
+
children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx(src_components_skeletons_ProductShelfSkeleton__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
|
|
89
|
+
aspectRatio: aspectRatio,
|
|
90
|
+
loading: products === undefined,
|
|
91
|
+
children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("ul", {
|
|
92
|
+
"data-fs-product-shelf-items": true,
|
|
93
|
+
className: "layout__content",
|
|
94
|
+
children: productEdges.map((product, idx) => /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx("li", {
|
|
95
|
+
children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx(_product_ProductCard__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
96
|
+
product: product.node,
|
|
97
|
+
index: idx + 1,
|
|
98
|
+
aspectRatio: aspectRatio
|
|
99
|
+
})
|
|
100
|
+
}, `${product.node.id}`))
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductShelf);
|
|
108
|
+
__webpack_async_result__();
|
|
109
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
110
|
+
|
|
111
|
+
/***/ }),
|
|
112
|
+
|
|
113
|
+
/***/ 7104:
|
|
114
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
115
|
+
|
|
116
|
+
"use strict";
|
|
117
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
118
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
119
|
+
/* harmony export */ "Z": () => (/* reexport safe */ _ProductShelf__WEBPACK_IMPORTED_MODULE_0__.Z)
|
|
120
|
+
/* harmony export */ });
|
|
121
|
+
/* harmony import */ var _ProductShelf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8569);
|
|
122
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ProductShelf__WEBPACK_IMPORTED_MODULE_0__]);
|
|
123
|
+
_ProductShelf__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
124
|
+
|
|
125
|
+
__webpack_async_result__();
|
|
126
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
127
|
+
|
|
128
|
+
/***/ }),
|
|
129
|
+
|
|
130
|
+
/***/ 9201:
|
|
131
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
132
|
+
|
|
133
|
+
"use strict";
|
|
134
|
+
|
|
135
|
+
// EXPORTS
|
|
136
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
137
|
+
"Z": () => (/* reexport */ ProductShelfSkeleton_ProductShelfSkeleton)
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// EXTERNAL MODULE: ./src/constants.ts
|
|
141
|
+
var constants = __webpack_require__(8459);
|
|
142
|
+
// EXTERNAL MODULE: ./src/components/sections/ProductShelf/product-shelf.module.scss
|
|
143
|
+
var product_shelf_module = __webpack_require__(3656);
|
|
144
|
+
var product_shelf_module_default = /*#__PURE__*/__webpack_require__.n(product_shelf_module);
|
|
145
|
+
// EXTERNAL MODULE: ./src/components/skeletons/ProductCardSkeleton/index.ts + 1 modules
|
|
146
|
+
var ProductCardSkeleton = __webpack_require__(3288);
|
|
147
|
+
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
148
|
+
var jsx_runtime_ = __webpack_require__(997);
|
|
149
|
+
;// CONCATENATED MODULE: ./src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
function ProductShelfSkeleton({
|
|
157
|
+
children,
|
|
158
|
+
aspectRatio,
|
|
159
|
+
loading = true
|
|
160
|
+
}) {
|
|
161
|
+
return loading ? /*#__PURE__*/jsx_runtime_.jsx("ul", {
|
|
162
|
+
"data-fs-product-shelf-items": true,
|
|
163
|
+
className: `layout__content ${(product_shelf_module_default()).fsProductShelf}`,
|
|
164
|
+
children: Array.from({
|
|
165
|
+
length: constants/* ITEMS_PER_SECTION */.K
|
|
166
|
+
}, (_, index) => /*#__PURE__*/jsx_runtime_.jsx("li", {
|
|
167
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(ProductCardSkeleton/* default */.Z, {
|
|
168
|
+
aspectRatio: aspectRatio,
|
|
169
|
+
sectioned: true
|
|
170
|
+
})
|
|
171
|
+
}, String(index)))
|
|
172
|
+
}) : /*#__PURE__*/jsx_runtime_.jsx(jsx_runtime_.Fragment, {
|
|
173
|
+
children: children
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* harmony default export */ const ProductShelfSkeleton_ProductShelfSkeleton = (ProductShelfSkeleton);
|
|
178
|
+
;// CONCATENATED MODULE: ./src/components/skeletons/ProductShelfSkeleton/index.ts
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
/***/ }),
|
|
182
|
+
|
|
183
|
+
/***/ 3656:
|
|
184
|
+
/***/ ((module) => {
|
|
185
|
+
|
|
186
|
+
// Exports
|
|
187
|
+
module.exports = {
|
|
188
|
+
"fs-product-shelf": "product-shelf_fs-product-shelf__65g4z",
|
|
189
|
+
"fsProductShelf": "product-shelf_fs-product-shelf__65g4z"
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
/***/ })
|
|
194
|
+
|
|
195
|
+
};
|
|
196
|
+
;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.id = 143;
|
|
3
|
+
exports.ids = [143];
|
|
4
|
+
exports.modules = {
|
|
5
|
+
|
|
6
|
+
/***/ 9143:
|
|
7
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
/* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7183);
|
|
14
|
+
/* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_0__);
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const THIRTY_MINUTES_S = 30 * 60;
|
|
26
|
+
const ONE_YEAR_S = 365 * 24 * 3600;
|
|
27
|
+
|
|
28
|
+
const randomUUID = () => typeof crypto.randomUUID === 'function' ? crypto.randomUUID() : (Math.random() * 1e6).toFixed(0);
|
|
29
|
+
|
|
30
|
+
const createStorage = (key, expiresSecond) => {
|
|
31
|
+
const timelapsed = past => (Date.now() - past) / 1e3;
|
|
32
|
+
|
|
33
|
+
return () => {
|
|
34
|
+
const item = JSON.parse(localStorage.getItem(key) ?? 'null');
|
|
35
|
+
const isExpired = !item || timelapsed(item.createdAt) > expiresSecond;
|
|
36
|
+
const payload = isExpired ? randomUUID() : item.payload;
|
|
37
|
+
|
|
38
|
+
if (isExpired) {
|
|
39
|
+
const data = {
|
|
40
|
+
payload,
|
|
41
|
+
createdAt: Date.now()
|
|
42
|
+
};
|
|
43
|
+
localStorage.setItem(key, JSON.stringify(data));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return payload;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const user = {
|
|
51
|
+
anonymous: createStorage('vtex.search.anonymous', ONE_YEAR_S),
|
|
52
|
+
session: createStorage('vtex.search.session', THIRTY_MINUTES_S)
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const sendEvent = options => fetch(`https://sp.vtex.com/event-api/v1/${(_faststore_config__WEBPACK_IMPORTED_MODULE_0___default().api.storeId)}/event`, {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
body: JSON.stringify(_objectSpread(_objectSpread({}, options), {}, {
|
|
58
|
+
userAgent: navigator.userAgent,
|
|
59
|
+
anonymous: user.anonymous(),
|
|
60
|
+
session: user.session()
|
|
61
|
+
})),
|
|
62
|
+
headers: {
|
|
63
|
+
'content-type': 'application/json'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const isFullTextSearch = url => typeof url.searchParams.get('q') === 'string' && /^\/s(\/)?$/g.test(url.pathname);
|
|
68
|
+
|
|
69
|
+
const handleEvent = event => {
|
|
70
|
+
if (event.name !== 'search_select_item') {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const url = new URL(event.params.url);
|
|
75
|
+
|
|
76
|
+
if (!isFullTextSearch(url)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (const item of event.params.items ?? []) {
|
|
81
|
+
const productId = item.item_id ?? item.item_variant;
|
|
82
|
+
const position = item.index;
|
|
83
|
+
|
|
84
|
+
if (productId && position) {
|
|
85
|
+
sendEvent({
|
|
86
|
+
type: 'search.click',
|
|
87
|
+
productId,
|
|
88
|
+
position,
|
|
89
|
+
url: url.href,
|
|
90
|
+
text: url.searchParams.get('q') ?? '<empty>'
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
setInterval(() => sendEvent({
|
|
97
|
+
type: 'session.ping'
|
|
98
|
+
}), 60 * 1e3
|
|
99
|
+
/* One minute */
|
|
100
|
+
);
|
|
101
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (handleEvent);
|
|
102
|
+
|
|
103
|
+
/***/ })
|
|
104
|
+
|
|
105
|
+
};
|
|
106
|
+
;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
exports.id = 152;
|
|
2
|
+
exports.ids = [152];
|
|
3
|
+
exports.modules = {
|
|
4
|
+
|
|
5
|
+
/***/ 9152:
|
|
6
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
// ESM COMPAT FLAG
|
|
10
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11
|
+
|
|
12
|
+
// EXPORTS
|
|
13
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
14
|
+
"RegionalizationModalContent": () => (/* reexport */ RegionModal_RegionalizationModalContent),
|
|
15
|
+
"default": () => (/* reexport */ RegionModal_RegionalizationModal)
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// EXTERNAL MODULE: ../components/dist/molecules/Modal/Modal.js + 3 modules
|
|
19
|
+
var Modal = __webpack_require__(9600);
|
|
20
|
+
// EXTERNAL MODULE: external "react"
|
|
21
|
+
var external_react_ = __webpack_require__(6689);
|
|
22
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
23
|
+
// EXTERNAL MODULE: ../components/dist/assets/X.js
|
|
24
|
+
var X = __webpack_require__(2543);
|
|
25
|
+
// EXTERNAL MODULE: ../components/dist/molecules/IconButton/IconButton.js
|
|
26
|
+
var IconButton = __webpack_require__(2765);
|
|
27
|
+
;// CONCATENATED MODULE: ../components/dist/molecules/Modal/ModalHeader.js
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const ModalHeader = ({ onClose, title, closeBtnProps = {}, description, }) => {
|
|
32
|
+
return (external_react_default().createElement("header", { "data-fs-modal-header": true },
|
|
33
|
+
onClose && (external_react_default().createElement(IconButton/* default */.Z, { onClick: () => onClose?.(), "data-fs-modal-header-close-button": true, icon: external_react_default().createElement(X/* default */.Z, null), "aria-label": "Close modal", ...closeBtnProps })),
|
|
34
|
+
external_react_default().createElement("p", { "data-fs-modal-header-title": true }, title),
|
|
35
|
+
description && external_react_default().createElement("p", { "data-fs-modal-header-description": true }, description)));
|
|
36
|
+
};
|
|
37
|
+
/* harmony default export */ const Modal_ModalHeader = (ModalHeader);
|
|
38
|
+
//# sourceMappingURL=ModalHeader.js.map
|
|
39
|
+
;// CONCATENATED MODULE: ../components/dist/molecules/Modal/ModalBody.js
|
|
40
|
+
|
|
41
|
+
const ModalBody = ({ children, ...otherProps }) => (external_react_default().createElement("div", { "data-fs-modal-body": true, ...otherProps }, children));
|
|
42
|
+
/* harmony default export */ const Modal_ModalBody = (ModalBody);
|
|
43
|
+
//# sourceMappingURL=ModalBody.js.map
|
|
44
|
+
// EXTERNAL MODULE: ../components/dist/molecules/InputField/InputField.js
|
|
45
|
+
var InputField = __webpack_require__(8287);
|
|
46
|
+
// EXTERNAL MODULE: ./src/sdk/session/index.ts
|
|
47
|
+
var sdk_session = __webpack_require__(5971);
|
|
48
|
+
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
49
|
+
var jsx_runtime_ = __webpack_require__(997);
|
|
50
|
+
;// CONCATENATED MODULE: ./src/components/region/RegionInput/RegionInput.tsx
|
|
51
|
+
const _excluded = ["isValidating"];
|
|
52
|
+
|
|
53
|
+
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; }
|
|
54
|
+
|
|
55
|
+
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; }
|
|
56
|
+
|
|
57
|
+
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; }
|
|
58
|
+
|
|
59
|
+
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; }
|
|
60
|
+
|
|
61
|
+
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; }
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
function RegionInput({
|
|
69
|
+
closeModal
|
|
70
|
+
}) {
|
|
71
|
+
const inputRef = (0,external_react_.useRef)(null);
|
|
72
|
+
|
|
73
|
+
const _useSession = (0,sdk_session/* useSession */.kP)(),
|
|
74
|
+
{
|
|
75
|
+
isValidating
|
|
76
|
+
} = _useSession,
|
|
77
|
+
session = _objectWithoutProperties(_useSession, _excluded);
|
|
78
|
+
|
|
79
|
+
const {
|
|
80
|
+
0: errorMessage,
|
|
81
|
+
1: setErrorMessage
|
|
82
|
+
} = (0,external_react_.useState)('');
|
|
83
|
+
const {
|
|
84
|
+
0: input,
|
|
85
|
+
1: setInput
|
|
86
|
+
} = (0,external_react_.useState)('');
|
|
87
|
+
|
|
88
|
+
const handleSubmit = async () => {
|
|
89
|
+
const postalCode = inputRef.current?.value;
|
|
90
|
+
|
|
91
|
+
if (typeof postalCode !== 'string') {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
setErrorMessage('');
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const newSession = _objectSpread(_objectSpread({}, session), {}, {
|
|
99
|
+
postalCode
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const validatedSession = await (0,sdk_session/* validateSession */.je)(newSession);
|
|
103
|
+
sdk_session/* sessionStore.set */.Qf.set(validatedSession ?? newSession);
|
|
104
|
+
closeModal();
|
|
105
|
+
} catch (error) {
|
|
106
|
+
setErrorMessage('You entered an invalid Postal Code');
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return /*#__PURE__*/jsx_runtime_.jsx("div", {
|
|
111
|
+
className: "regionalization-input",
|
|
112
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(InputField/* default */.Z, {
|
|
113
|
+
inputRef: inputRef,
|
|
114
|
+
id: "postal-code-input",
|
|
115
|
+
error: errorMessage,
|
|
116
|
+
label: "Postal Code",
|
|
117
|
+
actionable: true,
|
|
118
|
+
value: input,
|
|
119
|
+
onInput: e => {
|
|
120
|
+
errorMessage !== '' && setErrorMessage('');
|
|
121
|
+
setInput(e.currentTarget.value);
|
|
122
|
+
},
|
|
123
|
+
onSubmit: handleSubmit,
|
|
124
|
+
onClear: () => setInput('')
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* harmony default export */ const RegionInput_RegionInput = (RegionInput);
|
|
130
|
+
;// CONCATENATED MODULE: ./src/components/region/RegionInput/index.ts
|
|
131
|
+
|
|
132
|
+
// EXTERNAL MODULE: ./src/components/ui/Icon/index.ts + 1 modules
|
|
133
|
+
var Icon = __webpack_require__(2478);
|
|
134
|
+
// EXTERNAL MODULE: ./src/components/ui/Link/index.ts + 1 modules
|
|
135
|
+
var Link = __webpack_require__(1093);
|
|
136
|
+
// EXTERNAL MODULE: ./src/components/region/RegionModal/regionalization-modal-body.module.scss
|
|
137
|
+
var regionalization_modal_body_module = __webpack_require__(3245);
|
|
138
|
+
var regionalization_modal_body_module_default = /*#__PURE__*/__webpack_require__.n(regionalization_modal_body_module);
|
|
139
|
+
;// CONCATENATED MODULE: ./src/components/region/RegionModal/RegionalizationModalContent.tsx
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
function RegionalizationModalContent({
|
|
150
|
+
onClose
|
|
151
|
+
}) {
|
|
152
|
+
return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
|
|
153
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx(Modal_ModalHeader, {
|
|
154
|
+
onClose: () => onClose(),
|
|
155
|
+
title: "Set your location",
|
|
156
|
+
description: "Prices, offers and availability may vary according to your location.",
|
|
157
|
+
closeBtnProps: {
|
|
158
|
+
'aria-label': 'Close Regionalization Modal'
|
|
159
|
+
}
|
|
160
|
+
}), /*#__PURE__*/(0,jsx_runtime_.jsxs)(Modal_ModalBody, {
|
|
161
|
+
className: (regionalization_modal_body_module_default()).fsRegionalizationModalBody,
|
|
162
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
|
|
163
|
+
"data-fs-regionalization-modal-input": true,
|
|
164
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(RegionInput_RegionInput, {
|
|
165
|
+
closeModal: () => onClose()
|
|
166
|
+
})
|
|
167
|
+
}), /*#__PURE__*/(0,jsx_runtime_.jsxs)(Link/* default */.Z, {
|
|
168
|
+
href: "/",
|
|
169
|
+
"data-fs-regionalization-modal-link": true,
|
|
170
|
+
children: ["I don't know my Postal Code", /*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
|
|
171
|
+
name: "ArrowSquareOut",
|
|
172
|
+
width: 18,
|
|
173
|
+
height: 18
|
|
174
|
+
})]
|
|
175
|
+
})]
|
|
176
|
+
})]
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* harmony default export */ const RegionModal_RegionalizationModalContent = (RegionalizationModalContent);
|
|
181
|
+
;// CONCATENATED MODULE: ./src/components/region/RegionModal/RegionalizationModal.tsx
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
function RegionalizationModal() {
|
|
187
|
+
return /*#__PURE__*/jsx_runtime_.jsx(Modal/* default */.Z, {
|
|
188
|
+
children: ({
|
|
189
|
+
fadeOut
|
|
190
|
+
}) => /*#__PURE__*/jsx_runtime_.jsx(RegionModal_RegionalizationModalContent, {
|
|
191
|
+
onClose: fadeOut
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* harmony default export */ const RegionModal_RegionalizationModal = (RegionalizationModal);
|
|
197
|
+
;// CONCATENATED MODULE: ./src/components/region/RegionModal/index.ts
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
/***/ }),
|
|
202
|
+
|
|
203
|
+
/***/ 3245:
|
|
204
|
+
/***/ ((module) => {
|
|
205
|
+
|
|
206
|
+
// Exports
|
|
207
|
+
module.exports = {
|
|
208
|
+
"fs-regionalization-modal-body": "regionalization-modal-body_fs-regionalization-modal-body__VcAKg",
|
|
209
|
+
"fsRegionalizationModalBody": "regionalization-modal-body_fs-regionalization-modal-body__VcAKg"
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
/***/ })
|
|
214
|
+
|
|
215
|
+
};
|
|
216
|
+
;
|