@websolutespa/bom-mixer-models 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +17 -0
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +409 -0
- package/dist/index.js +2574 -0
- package/dist/index.mjs +2519 -0
- package/package.json +54 -0
- package/src/cart/cart.ts +31 -0
- package/src/category/category.service.ts +43 -0
- package/src/category/category.ts +26 -0
- package/src/checkout/checkout.service.ts +351 -0
- package/src/checkout/checkout.ts +65 -0
- package/src/country/country.service.ts +9 -0
- package/src/feature_type/feature_type.service.ts +10 -0
- package/src/feature_type/feature_type.ts +13 -0
- package/src/index.ts +33 -0
- package/src/label/label.service.ts +24 -0
- package/src/label/label.ts +7 -0
- package/src/layout/layout.service.ts +51 -0
- package/src/layout/layout.ts +27 -0
- package/src/link/link.ts +7 -0
- package/src/list/list.service.ts +19 -0
- package/src/list/list.ts +11 -0
- package/src/locale/locale.service.ts +11 -0
- package/src/locale/locale.ts +9 -0
- package/src/market/market.service.ts +10 -0
- package/src/market/market.ts +11 -0
- package/src/media/media.ts +14 -0
- package/src/menu/menu.service.ts +22 -0
- package/src/menu/menu.ts +11 -0
- package/src/order/order.service.ts +29 -0
- package/src/order/order.ts +31 -0
- package/src/page/page.service.ts +132 -0
- package/src/page/page.ts +53 -0
- package/src/province/province.service.ts +9 -0
- package/src/region/region.service.ts +9 -0
- package/src/route/route.interceptor.ts +30 -0
- package/src/route/route.service.ts +203 -0
- package/src/route/route.ts +29 -0
- package/src/store/store.ts +24 -0
- package/src/user/user.ts +57 -0
- package/tsconfig.json +16 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2519 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __publicField = (obj, key, value) => {
|
|
28
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// ../../../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
|
|
33
|
+
var require_detect_domain_locale = __commonJS({
|
|
34
|
+
"../../../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js"(exports) {
|
|
35
|
+
"use strict";
|
|
36
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37
|
+
value: true
|
|
38
|
+
});
|
|
39
|
+
exports.detectDomainLocale = detectDomainLocale;
|
|
40
|
+
function detectDomainLocale(domainItems, hostname, detectedLocale) {
|
|
41
|
+
let domainItem;
|
|
42
|
+
if (domainItems) {
|
|
43
|
+
if (detectedLocale) {
|
|
44
|
+
detectedLocale = detectedLocale.toLowerCase();
|
|
45
|
+
}
|
|
46
|
+
for (const item of domainItems) {
|
|
47
|
+
var ref, ref1;
|
|
48
|
+
const domainHostname = (ref = item.domain) == null ? void 0 : ref.split(":")[0].toLowerCase();
|
|
49
|
+
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((ref1 = item.locales) == null ? void 0 : ref1.some((locale) => locale.toLowerCase() === detectedLocale))) {
|
|
50
|
+
domainItem = item;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return domainItem;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
|
|
61
|
+
var require_remove_trailing_slash = __commonJS({
|
|
62
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js"(exports) {
|
|
63
|
+
"use strict";
|
|
64
|
+
Object.defineProperty(exports, "__esModule", {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
67
|
+
exports.removeTrailingSlash = removeTrailingSlash;
|
|
68
|
+
function removeTrailingSlash(route) {
|
|
69
|
+
return route.replace(/\/$/, "") || "/";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/parse-path.js
|
|
75
|
+
var require_parse_path = __commonJS({
|
|
76
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/parse-path.js"(exports) {
|
|
77
|
+
"use strict";
|
|
78
|
+
Object.defineProperty(exports, "__esModule", {
|
|
79
|
+
value: true
|
|
80
|
+
});
|
|
81
|
+
exports.parsePath = parsePath;
|
|
82
|
+
function parsePath(path) {
|
|
83
|
+
const hashIndex = path.indexOf("#");
|
|
84
|
+
const queryIndex = path.indexOf("?");
|
|
85
|
+
const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
|
|
86
|
+
if (hasQuery || hashIndex > -1) {
|
|
87
|
+
return {
|
|
88
|
+
pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
|
|
89
|
+
query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : void 0) : "",
|
|
90
|
+
hash: hashIndex > -1 ? path.slice(hashIndex) : ""
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
pathname: path,
|
|
95
|
+
query: "",
|
|
96
|
+
hash: ""
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
|
|
103
|
+
var require_add_path_prefix = __commonJS({
|
|
104
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js"(exports) {
|
|
105
|
+
"use strict";
|
|
106
|
+
Object.defineProperty(exports, "__esModule", {
|
|
107
|
+
value: true
|
|
108
|
+
});
|
|
109
|
+
exports.addPathPrefix = addPathPrefix;
|
|
110
|
+
var _parsePath = require_parse_path();
|
|
111
|
+
function addPathPrefix(path, prefix) {
|
|
112
|
+
if (!path.startsWith("/") || !prefix) {
|
|
113
|
+
return path;
|
|
114
|
+
}
|
|
115
|
+
const { pathname, query, hash } = (0, _parsePath).parsePath(path);
|
|
116
|
+
return `${prefix}${pathname}${query}${hash}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js
|
|
122
|
+
var require_add_path_suffix = __commonJS({
|
|
123
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js"(exports) {
|
|
124
|
+
"use strict";
|
|
125
|
+
Object.defineProperty(exports, "__esModule", {
|
|
126
|
+
value: true
|
|
127
|
+
});
|
|
128
|
+
exports.addPathSuffix = addPathSuffix;
|
|
129
|
+
var _parsePath = require_parse_path();
|
|
130
|
+
function addPathSuffix(path, suffix) {
|
|
131
|
+
if (!path.startsWith("/") || !suffix) {
|
|
132
|
+
return path;
|
|
133
|
+
}
|
|
134
|
+
const { pathname, query, hash } = (0, _parsePath).parsePath(path);
|
|
135
|
+
return `${pathname}${suffix}${query}${hash}`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
|
|
141
|
+
var require_path_has_prefix = __commonJS({
|
|
142
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js"(exports) {
|
|
143
|
+
"use strict";
|
|
144
|
+
Object.defineProperty(exports, "__esModule", {
|
|
145
|
+
value: true
|
|
146
|
+
});
|
|
147
|
+
exports.pathHasPrefix = pathHasPrefix;
|
|
148
|
+
var _parsePath = require_parse_path();
|
|
149
|
+
function pathHasPrefix(path, prefix) {
|
|
150
|
+
if (typeof path !== "string") {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
const { pathname } = (0, _parsePath).parsePath(path);
|
|
154
|
+
return pathname === prefix || pathname.startsWith(prefix + "/");
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/add-locale.js
|
|
160
|
+
var require_add_locale = __commonJS({
|
|
161
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/add-locale.js"(exports) {
|
|
162
|
+
"use strict";
|
|
163
|
+
Object.defineProperty(exports, "__esModule", {
|
|
164
|
+
value: true
|
|
165
|
+
});
|
|
166
|
+
exports.addLocale = addLocale;
|
|
167
|
+
var _addPathPrefix = require_add_path_prefix();
|
|
168
|
+
var _pathHasPrefix = require_path_has_prefix();
|
|
169
|
+
function addLocale(path, locale, defaultLocale, ignorePrefix) {
|
|
170
|
+
if (locale && locale !== defaultLocale && (ignorePrefix || !(0, _pathHasPrefix).pathHasPrefix(path.toLowerCase(), `/${locale.toLowerCase()}`) && !(0, _pathHasPrefix).pathHasPrefix(path.toLowerCase(), "/api"))) {
|
|
171
|
+
return (0, _addPathPrefix).addPathPrefix(path, `/${locale}`);
|
|
172
|
+
}
|
|
173
|
+
return path;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
|
|
179
|
+
var require_format_next_pathname_info = __commonJS({
|
|
180
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js"(exports) {
|
|
181
|
+
"use strict";
|
|
182
|
+
Object.defineProperty(exports, "__esModule", {
|
|
183
|
+
value: true
|
|
184
|
+
});
|
|
185
|
+
exports.formatNextPathnameInfo = formatNextPathnameInfo;
|
|
186
|
+
var _removeTrailingSlash = require_remove_trailing_slash();
|
|
187
|
+
var _addPathPrefix = require_add_path_prefix();
|
|
188
|
+
var _addPathSuffix = require_add_path_suffix();
|
|
189
|
+
var _addLocale = require_add_locale();
|
|
190
|
+
function formatNextPathnameInfo(info) {
|
|
191
|
+
let pathname = (0, _addLocale).addLocale(info.pathname, info.locale, info.buildId ? void 0 : info.defaultLocale, info.ignorePrefix);
|
|
192
|
+
if (info.buildId) {
|
|
193
|
+
pathname = (0, _addPathSuffix).addPathSuffix((0, _addPathPrefix).addPathPrefix(pathname, `/_next/data/${info.buildId}`), info.pathname === "/" ? "index.json" : ".json");
|
|
194
|
+
}
|
|
195
|
+
pathname = (0, _addPathPrefix).addPathPrefix(pathname, info.basePath);
|
|
196
|
+
return info.trailingSlash ? !info.buildId && !pathname.endsWith("/") ? (0, _addPathSuffix).addPathSuffix(pathname, "/") : pathname : (0, _removeTrailingSlash).removeTrailingSlash(pathname);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// ../../../../node_modules/next/dist/shared/lib/get-hostname.js
|
|
202
|
+
var require_get_hostname = __commonJS({
|
|
203
|
+
"../../../../node_modules/next/dist/shared/lib/get-hostname.js"(exports) {
|
|
204
|
+
"use strict";
|
|
205
|
+
Object.defineProperty(exports, "__esModule", {
|
|
206
|
+
value: true
|
|
207
|
+
});
|
|
208
|
+
exports.getHostname = getHostname;
|
|
209
|
+
function getHostname(parsed, headers) {
|
|
210
|
+
var ref;
|
|
211
|
+
return (ref = !Array.isArray(headers == null ? void 0 : headers.host) && (headers == null ? void 0 : headers.host) || parsed.hostname) == null ? void 0 : ref.split(":")[0].toLowerCase();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// ../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
|
|
217
|
+
var require_normalize_locale_path = __commonJS({
|
|
218
|
+
"../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js"(exports) {
|
|
219
|
+
"use strict";
|
|
220
|
+
Object.defineProperty(exports, "__esModule", {
|
|
221
|
+
value: true
|
|
222
|
+
});
|
|
223
|
+
exports.normalizeLocalePath = normalizeLocalePath;
|
|
224
|
+
function normalizeLocalePath(pathname, locales) {
|
|
225
|
+
let detectedLocale;
|
|
226
|
+
const pathnameParts = pathname.split("/");
|
|
227
|
+
(locales || []).some((locale) => {
|
|
228
|
+
if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {
|
|
229
|
+
detectedLocale = locale;
|
|
230
|
+
pathnameParts.splice(1, 1);
|
|
231
|
+
pathname = pathnameParts.join("/") || "/";
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
return false;
|
|
235
|
+
});
|
|
236
|
+
return {
|
|
237
|
+
pathname,
|
|
238
|
+
detectedLocale
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js
|
|
245
|
+
var require_remove_path_prefix = __commonJS({
|
|
246
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js"(exports) {
|
|
247
|
+
"use strict";
|
|
248
|
+
Object.defineProperty(exports, "__esModule", {
|
|
249
|
+
value: true
|
|
250
|
+
});
|
|
251
|
+
exports.removePathPrefix = removePathPrefix;
|
|
252
|
+
var _pathHasPrefix = require_path_has_prefix();
|
|
253
|
+
function removePathPrefix(path, prefix) {
|
|
254
|
+
if ((0, _pathHasPrefix).pathHasPrefix(path, prefix)) {
|
|
255
|
+
const withoutPrefix = path.slice(prefix.length);
|
|
256
|
+
return withoutPrefix.startsWith("/") ? withoutPrefix : `/${withoutPrefix}`;
|
|
257
|
+
}
|
|
258
|
+
return path;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// ../../../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js
|
|
264
|
+
var require_get_next_pathname_info = __commonJS({
|
|
265
|
+
"../../../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js"(exports) {
|
|
266
|
+
"use strict";
|
|
267
|
+
Object.defineProperty(exports, "__esModule", {
|
|
268
|
+
value: true
|
|
269
|
+
});
|
|
270
|
+
exports.getNextPathnameInfo = getNextPathnameInfo;
|
|
271
|
+
var _normalizeLocalePath = require_normalize_locale_path();
|
|
272
|
+
var _removePathPrefix = require_remove_path_prefix();
|
|
273
|
+
var _pathHasPrefix = require_path_has_prefix();
|
|
274
|
+
function getNextPathnameInfo(pathname, options) {
|
|
275
|
+
var _nextConfig;
|
|
276
|
+
const { basePath, i18n, trailingSlash } = (_nextConfig = options.nextConfig) != null ? _nextConfig : {};
|
|
277
|
+
const info = {
|
|
278
|
+
pathname,
|
|
279
|
+
trailingSlash: pathname !== "/" ? pathname.endsWith("/") : trailingSlash
|
|
280
|
+
};
|
|
281
|
+
if (basePath && (0, _pathHasPrefix).pathHasPrefix(info.pathname, basePath)) {
|
|
282
|
+
info.pathname = (0, _removePathPrefix).removePathPrefix(info.pathname, basePath);
|
|
283
|
+
info.basePath = basePath;
|
|
284
|
+
}
|
|
285
|
+
if (options.parseData === true && info.pathname.startsWith("/_next/data/") && info.pathname.endsWith(".json")) {
|
|
286
|
+
const paths = info.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/");
|
|
287
|
+
const buildId = paths[0];
|
|
288
|
+
info.pathname = paths[1] !== "index" ? `/${paths.slice(1).join("/")}` : "/";
|
|
289
|
+
info.buildId = buildId;
|
|
290
|
+
}
|
|
291
|
+
if (i18n) {
|
|
292
|
+
const pathLocale = (0, _normalizeLocalePath).normalizeLocalePath(info.pathname, i18n.locales);
|
|
293
|
+
info.locale = pathLocale == null ? void 0 : pathLocale.detectedLocale;
|
|
294
|
+
info.pathname = (pathLocale == null ? void 0 : pathLocale.pathname) || info.pathname;
|
|
295
|
+
}
|
|
296
|
+
return info;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// ../../../../node_modules/next/dist/server/web/next-url.js
|
|
302
|
+
var require_next_url = __commonJS({
|
|
303
|
+
"../../../../node_modules/next/dist/server/web/next-url.js"(exports) {
|
|
304
|
+
"use strict";
|
|
305
|
+
Object.defineProperty(exports, "__esModule", {
|
|
306
|
+
value: true
|
|
307
|
+
});
|
|
308
|
+
var _detectDomainLocale = require_detect_domain_locale();
|
|
309
|
+
var _formatNextPathnameInfo = require_format_next_pathname_info();
|
|
310
|
+
var _getHostname = require_get_hostname();
|
|
311
|
+
var _getNextPathnameInfo = require_get_next_pathname_info();
|
|
312
|
+
var FLIGHT_PARAMETERS = [
|
|
313
|
+
"__flight__",
|
|
314
|
+
"__flight_router_state_tree__",
|
|
315
|
+
"__flight_prefetch__"
|
|
316
|
+
];
|
|
317
|
+
var REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|::1|localhost)/;
|
|
318
|
+
function parseURL(url, base) {
|
|
319
|
+
return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"));
|
|
320
|
+
}
|
|
321
|
+
function parseFlightParameters(searchParams) {
|
|
322
|
+
let flightSearchParameters = {};
|
|
323
|
+
let flightSearchParametersUpdated = false;
|
|
324
|
+
for (const name of FLIGHT_PARAMETERS) {
|
|
325
|
+
const value = searchParams.get(name);
|
|
326
|
+
if (value === null) {
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
flightSearchParameters[name] = value;
|
|
330
|
+
flightSearchParametersUpdated = true;
|
|
331
|
+
}
|
|
332
|
+
if (!flightSearchParametersUpdated) {
|
|
333
|
+
return void 0;
|
|
334
|
+
}
|
|
335
|
+
return flightSearchParameters;
|
|
336
|
+
}
|
|
337
|
+
var Internal = Symbol("NextURLInternal");
|
|
338
|
+
var NextURL = class {
|
|
339
|
+
constructor(input, baseOrOpts, opts) {
|
|
340
|
+
let base;
|
|
341
|
+
let options;
|
|
342
|
+
if (typeof baseOrOpts === "object" && "pathname" in baseOrOpts || typeof baseOrOpts === "string") {
|
|
343
|
+
base = baseOrOpts;
|
|
344
|
+
options = opts || {};
|
|
345
|
+
} else {
|
|
346
|
+
options = opts || baseOrOpts || {};
|
|
347
|
+
}
|
|
348
|
+
this[Internal] = {
|
|
349
|
+
url: parseURL(input, base != null ? base : options.base),
|
|
350
|
+
options,
|
|
351
|
+
basePath: ""
|
|
352
|
+
};
|
|
353
|
+
this.analyzeUrl();
|
|
354
|
+
}
|
|
355
|
+
analyzeUrl() {
|
|
356
|
+
var ref, ref1, ref2, ref3, ref4;
|
|
357
|
+
const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(this[Internal].url.pathname, {
|
|
358
|
+
nextConfig: this[Internal].options.nextConfig,
|
|
359
|
+
parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE
|
|
360
|
+
});
|
|
361
|
+
this[Internal].domainLocale = (0, _detectDomainLocale).detectDomainLocale((ref = this[Internal].options.nextConfig) == null ? void 0 : (ref1 = ref.i18n) == null ? void 0 : ref1.domains, (0, _getHostname).getHostname(this[Internal].url, this[Internal].options.headers));
|
|
362
|
+
const defaultLocale = ((ref2 = this[Internal].domainLocale) == null ? void 0 : ref2.defaultLocale) || ((ref3 = this[Internal].options.nextConfig) == null ? void 0 : (ref4 = ref3.i18n) == null ? void 0 : ref4.defaultLocale);
|
|
363
|
+
this[Internal].url.pathname = pathnameInfo.pathname;
|
|
364
|
+
this[Internal].defaultLocale = defaultLocale;
|
|
365
|
+
var _basePath;
|
|
366
|
+
this[Internal].basePath = (_basePath = pathnameInfo.basePath) != null ? _basePath : "";
|
|
367
|
+
this[Internal].buildId = pathnameInfo.buildId;
|
|
368
|
+
var _locale;
|
|
369
|
+
this[Internal].locale = (_locale = pathnameInfo.locale) != null ? _locale : defaultLocale;
|
|
370
|
+
this[Internal].trailingSlash = pathnameInfo.trailingSlash;
|
|
371
|
+
this[Internal].flightSearchParameters = parseFlightParameters(this[Internal].url.searchParams);
|
|
372
|
+
}
|
|
373
|
+
formatPathname() {
|
|
374
|
+
return (0, _formatNextPathnameInfo).formatNextPathnameInfo({
|
|
375
|
+
basePath: this[Internal].basePath,
|
|
376
|
+
buildId: this[Internal].buildId,
|
|
377
|
+
defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : void 0,
|
|
378
|
+
locale: this[Internal].locale,
|
|
379
|
+
pathname: this[Internal].url.pathname,
|
|
380
|
+
trailingSlash: this[Internal].trailingSlash
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
formatSearch() {
|
|
384
|
+
const flightSearchParameters = this[Internal].flightSearchParameters;
|
|
385
|
+
if (!flightSearchParameters) {
|
|
386
|
+
return this[Internal].url.search;
|
|
387
|
+
}
|
|
388
|
+
const searchParams = new URLSearchParams(this[Internal].url.searchParams);
|
|
389
|
+
for (const name in flightSearchParameters) {
|
|
390
|
+
searchParams.set(name, flightSearchParameters[name]);
|
|
391
|
+
}
|
|
392
|
+
const params = searchParams.toString();
|
|
393
|
+
return params === "" ? "" : `?${params}`;
|
|
394
|
+
}
|
|
395
|
+
get buildId() {
|
|
396
|
+
return this[Internal].buildId;
|
|
397
|
+
}
|
|
398
|
+
set buildId(buildId) {
|
|
399
|
+
this[Internal].buildId = buildId;
|
|
400
|
+
}
|
|
401
|
+
get flightSearchParameters() {
|
|
402
|
+
return this[Internal].flightSearchParameters;
|
|
403
|
+
}
|
|
404
|
+
set flightSearchParameters(flightSearchParams) {
|
|
405
|
+
if (flightSearchParams) {
|
|
406
|
+
for (const name of FLIGHT_PARAMETERS) {
|
|
407
|
+
if (flightSearchParams[name]) {
|
|
408
|
+
this[Internal].url.searchParams.set(name, flightSearchParams[name]);
|
|
409
|
+
} else {
|
|
410
|
+
this[Internal].url.searchParams.delete(name);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} else {
|
|
414
|
+
for (const name of FLIGHT_PARAMETERS) {
|
|
415
|
+
this[Internal].url.searchParams.delete(name);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
this[Internal].flightSearchParameters = flightSearchParams;
|
|
419
|
+
}
|
|
420
|
+
get locale() {
|
|
421
|
+
var _locale;
|
|
422
|
+
return (_locale = this[Internal].locale) != null ? _locale : "";
|
|
423
|
+
}
|
|
424
|
+
set locale(locale) {
|
|
425
|
+
var ref, ref5;
|
|
426
|
+
if (!this[Internal].locale || !((ref = this[Internal].options.nextConfig) == null ? void 0 : (ref5 = ref.i18n) == null ? void 0 : ref5.locales.includes(locale))) {
|
|
427
|
+
throw new TypeError(`The NextURL configuration includes no locale "${locale}"`);
|
|
428
|
+
}
|
|
429
|
+
this[Internal].locale = locale;
|
|
430
|
+
}
|
|
431
|
+
get defaultLocale() {
|
|
432
|
+
return this[Internal].defaultLocale;
|
|
433
|
+
}
|
|
434
|
+
get domainLocale() {
|
|
435
|
+
return this[Internal].domainLocale;
|
|
436
|
+
}
|
|
437
|
+
get searchParams() {
|
|
438
|
+
return this[Internal].url.searchParams;
|
|
439
|
+
}
|
|
440
|
+
get host() {
|
|
441
|
+
return this[Internal].url.host;
|
|
442
|
+
}
|
|
443
|
+
set host(value) {
|
|
444
|
+
this[Internal].url.host = value;
|
|
445
|
+
}
|
|
446
|
+
get hostname() {
|
|
447
|
+
return this[Internal].url.hostname;
|
|
448
|
+
}
|
|
449
|
+
set hostname(value) {
|
|
450
|
+
this[Internal].url.hostname = value;
|
|
451
|
+
}
|
|
452
|
+
get port() {
|
|
453
|
+
return this[Internal].url.port;
|
|
454
|
+
}
|
|
455
|
+
set port(value) {
|
|
456
|
+
this[Internal].url.port = value;
|
|
457
|
+
}
|
|
458
|
+
get protocol() {
|
|
459
|
+
return this[Internal].url.protocol;
|
|
460
|
+
}
|
|
461
|
+
set protocol(value) {
|
|
462
|
+
this[Internal].url.protocol = value;
|
|
463
|
+
}
|
|
464
|
+
get href() {
|
|
465
|
+
const pathname = this.formatPathname();
|
|
466
|
+
const search = this.formatSearch();
|
|
467
|
+
return `${this.protocol}//${this.host}${pathname}${search}`;
|
|
468
|
+
}
|
|
469
|
+
set href(url) {
|
|
470
|
+
this[Internal].url = parseURL(url);
|
|
471
|
+
this.analyzeUrl();
|
|
472
|
+
}
|
|
473
|
+
get origin() {
|
|
474
|
+
return this[Internal].url.origin;
|
|
475
|
+
}
|
|
476
|
+
get pathname() {
|
|
477
|
+
return this[Internal].url.pathname;
|
|
478
|
+
}
|
|
479
|
+
set pathname(value) {
|
|
480
|
+
this[Internal].url.pathname = value;
|
|
481
|
+
}
|
|
482
|
+
get hash() {
|
|
483
|
+
return this[Internal].url.hash;
|
|
484
|
+
}
|
|
485
|
+
set hash(value) {
|
|
486
|
+
this[Internal].url.hash = value;
|
|
487
|
+
}
|
|
488
|
+
get search() {
|
|
489
|
+
return this[Internal].url.search;
|
|
490
|
+
}
|
|
491
|
+
set search(value) {
|
|
492
|
+
this[Internal].url.search = value;
|
|
493
|
+
}
|
|
494
|
+
get password() {
|
|
495
|
+
return this[Internal].url.password;
|
|
496
|
+
}
|
|
497
|
+
set password(value) {
|
|
498
|
+
this[Internal].url.password = value;
|
|
499
|
+
}
|
|
500
|
+
get username() {
|
|
501
|
+
return this[Internal].url.username;
|
|
502
|
+
}
|
|
503
|
+
set username(value) {
|
|
504
|
+
this[Internal].url.username = value;
|
|
505
|
+
}
|
|
506
|
+
get basePath() {
|
|
507
|
+
return this[Internal].basePath;
|
|
508
|
+
}
|
|
509
|
+
set basePath(value) {
|
|
510
|
+
this[Internal].basePath = value.startsWith("/") ? value : `/${value}`;
|
|
511
|
+
}
|
|
512
|
+
toString() {
|
|
513
|
+
return this.href;
|
|
514
|
+
}
|
|
515
|
+
toJSON() {
|
|
516
|
+
return this.href;
|
|
517
|
+
}
|
|
518
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
519
|
+
return {
|
|
520
|
+
href: this.href,
|
|
521
|
+
origin: this.origin,
|
|
522
|
+
protocol: this.protocol,
|
|
523
|
+
username: this.username,
|
|
524
|
+
password: this.password,
|
|
525
|
+
host: this.host,
|
|
526
|
+
hostname: this.hostname,
|
|
527
|
+
port: this.port,
|
|
528
|
+
pathname: this.pathname,
|
|
529
|
+
search: this.search,
|
|
530
|
+
searchParams: this.searchParams,
|
|
531
|
+
hash: this.hash
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
clone() {
|
|
535
|
+
return new NextURL(String(this), this[Internal].options);
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
exports.NextURL = NextURL;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// ../../../../node_modules/next/dist/server/web/utils.js
|
|
543
|
+
var require_utils = __commonJS({
|
|
544
|
+
"../../../../node_modules/next/dist/server/web/utils.js"(exports) {
|
|
545
|
+
"use strict";
|
|
546
|
+
Object.defineProperty(exports, "__esModule", {
|
|
547
|
+
value: true
|
|
548
|
+
});
|
|
549
|
+
exports.fromNodeHeaders = fromNodeHeaders;
|
|
550
|
+
exports.splitCookiesString = splitCookiesString;
|
|
551
|
+
exports.toNodeHeaders = toNodeHeaders;
|
|
552
|
+
exports.validateURL = validateURL;
|
|
553
|
+
function fromNodeHeaders(object) {
|
|
554
|
+
const headers = new Headers();
|
|
555
|
+
for (let [key, value] of Object.entries(object)) {
|
|
556
|
+
const values = Array.isArray(value) ? value : [
|
|
557
|
+
value
|
|
558
|
+
];
|
|
559
|
+
for (let v of values) {
|
|
560
|
+
if (v !== void 0) {
|
|
561
|
+
headers.append(key, v);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return headers;
|
|
566
|
+
}
|
|
567
|
+
function splitCookiesString(cookiesString) {
|
|
568
|
+
var cookiesStrings = [];
|
|
569
|
+
var pos = 0;
|
|
570
|
+
var start;
|
|
571
|
+
var ch;
|
|
572
|
+
var lastComma;
|
|
573
|
+
var nextStart;
|
|
574
|
+
var cookiesSeparatorFound;
|
|
575
|
+
function skipWhitespace() {
|
|
576
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
577
|
+
pos += 1;
|
|
578
|
+
}
|
|
579
|
+
return pos < cookiesString.length;
|
|
580
|
+
}
|
|
581
|
+
function notSpecialChar() {
|
|
582
|
+
ch = cookiesString.charAt(pos);
|
|
583
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
584
|
+
}
|
|
585
|
+
while (pos < cookiesString.length) {
|
|
586
|
+
start = pos;
|
|
587
|
+
cookiesSeparatorFound = false;
|
|
588
|
+
while (skipWhitespace()) {
|
|
589
|
+
ch = cookiesString.charAt(pos);
|
|
590
|
+
if (ch === ",") {
|
|
591
|
+
lastComma = pos;
|
|
592
|
+
pos += 1;
|
|
593
|
+
skipWhitespace();
|
|
594
|
+
nextStart = pos;
|
|
595
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
596
|
+
pos += 1;
|
|
597
|
+
}
|
|
598
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
599
|
+
cookiesSeparatorFound = true;
|
|
600
|
+
pos = nextStart;
|
|
601
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
602
|
+
start = pos;
|
|
603
|
+
} else {
|
|
604
|
+
pos = lastComma + 1;
|
|
605
|
+
}
|
|
606
|
+
} else {
|
|
607
|
+
pos += 1;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
611
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return cookiesStrings;
|
|
615
|
+
}
|
|
616
|
+
function toNodeHeaders(headers) {
|
|
617
|
+
const result = {};
|
|
618
|
+
if (headers) {
|
|
619
|
+
for (const [key, value] of headers.entries()) {
|
|
620
|
+
result[key] = value;
|
|
621
|
+
if (key.toLowerCase() === "set-cookie") {
|
|
622
|
+
result[key] = splitCookiesString(value);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
return result;
|
|
627
|
+
}
|
|
628
|
+
function validateURL(url) {
|
|
629
|
+
try {
|
|
630
|
+
return String(new URL(String(url)));
|
|
631
|
+
} catch (error) {
|
|
632
|
+
throw new Error(`URLs is malformed. Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
|
|
633
|
+
cause: error
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
// ../../../../node_modules/next/dist/server/web/error.js
|
|
641
|
+
var require_error = __commonJS({
|
|
642
|
+
"../../../../node_modules/next/dist/server/web/error.js"(exports) {
|
|
643
|
+
"use strict";
|
|
644
|
+
Object.defineProperty(exports, "__esModule", {
|
|
645
|
+
value: true
|
|
646
|
+
});
|
|
647
|
+
var PageSignatureError = class extends Error {
|
|
648
|
+
constructor({ page }) {
|
|
649
|
+
super(`The middleware "${page}" accepts an async API directly with the form:
|
|
650
|
+
|
|
651
|
+
export function middleware(request, event) {
|
|
652
|
+
return NextResponse.redirect('/new-location')
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
656
|
+
`);
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
exports.PageSignatureError = PageSignatureError;
|
|
660
|
+
var RemovedPageError = class extends Error {
|
|
661
|
+
constructor() {
|
|
662
|
+
super(`The request.page has been deprecated in favour of \`URLPattern\`.
|
|
663
|
+
Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
664
|
+
`);
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
exports.RemovedPageError = RemovedPageError;
|
|
668
|
+
var RemovedUAError = class extends Error {
|
|
669
|
+
constructor() {
|
|
670
|
+
super(`The request.ua has been removed in favour of \`userAgent\` function.
|
|
671
|
+
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
672
|
+
`);
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
exports.RemovedUAError = RemovedUAError;
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
// ../../../../node_modules/next/dist/compiled/cookie/index.js
|
|
680
|
+
var require_cookie = __commonJS({
|
|
681
|
+
"../../../../node_modules/next/dist/compiled/cookie/index.js"(exports, module) {
|
|
682
|
+
(() => {
|
|
683
|
+
"use strict";
|
|
684
|
+
if (typeof __nccwpck_require__ !== "undefined")
|
|
685
|
+
__nccwpck_require__.ab = __dirname + "/";
|
|
686
|
+
var e = {};
|
|
687
|
+
(() => {
|
|
688
|
+
var r = e;
|
|
689
|
+
r.parse = parse;
|
|
690
|
+
r.serialize = serialize;
|
|
691
|
+
var i = decodeURIComponent;
|
|
692
|
+
var t = encodeURIComponent;
|
|
693
|
+
var a = /; */;
|
|
694
|
+
var n = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
695
|
+
function parse(e2, r2) {
|
|
696
|
+
if (typeof e2 !== "string") {
|
|
697
|
+
throw new TypeError("argument str must be a string");
|
|
698
|
+
}
|
|
699
|
+
var t2 = {};
|
|
700
|
+
var n2 = r2 || {};
|
|
701
|
+
var o = e2.split(a);
|
|
702
|
+
var s = n2.decode || i;
|
|
703
|
+
for (var p = 0; p < o.length; p++) {
|
|
704
|
+
var f = o[p];
|
|
705
|
+
var u = f.indexOf("=");
|
|
706
|
+
if (u < 0) {
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
var v = f.substr(0, u).trim();
|
|
710
|
+
var c = f.substr(++u, f.length).trim();
|
|
711
|
+
if ('"' == c[0]) {
|
|
712
|
+
c = c.slice(1, -1);
|
|
713
|
+
}
|
|
714
|
+
if (void 0 == t2[v]) {
|
|
715
|
+
t2[v] = tryDecode(c, s);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return t2;
|
|
719
|
+
}
|
|
720
|
+
function serialize(e2, r2, i2) {
|
|
721
|
+
var a2 = i2 || {};
|
|
722
|
+
var o = a2.encode || t;
|
|
723
|
+
if (typeof o !== "function") {
|
|
724
|
+
throw new TypeError("option encode is invalid");
|
|
725
|
+
}
|
|
726
|
+
if (!n.test(e2)) {
|
|
727
|
+
throw new TypeError("argument name is invalid");
|
|
728
|
+
}
|
|
729
|
+
var s = o(r2);
|
|
730
|
+
if (s && !n.test(s)) {
|
|
731
|
+
throw new TypeError("argument val is invalid");
|
|
732
|
+
}
|
|
733
|
+
var p = e2 + "=" + s;
|
|
734
|
+
if (null != a2.maxAge) {
|
|
735
|
+
var f = a2.maxAge - 0;
|
|
736
|
+
if (isNaN(f) || !isFinite(f)) {
|
|
737
|
+
throw new TypeError("option maxAge is invalid");
|
|
738
|
+
}
|
|
739
|
+
p += "; Max-Age=" + Math.floor(f);
|
|
740
|
+
}
|
|
741
|
+
if (a2.domain) {
|
|
742
|
+
if (!n.test(a2.domain)) {
|
|
743
|
+
throw new TypeError("option domain is invalid");
|
|
744
|
+
}
|
|
745
|
+
p += "; Domain=" + a2.domain;
|
|
746
|
+
}
|
|
747
|
+
if (a2.path) {
|
|
748
|
+
if (!n.test(a2.path)) {
|
|
749
|
+
throw new TypeError("option path is invalid");
|
|
750
|
+
}
|
|
751
|
+
p += "; Path=" + a2.path;
|
|
752
|
+
}
|
|
753
|
+
if (a2.expires) {
|
|
754
|
+
if (typeof a2.expires.toUTCString !== "function") {
|
|
755
|
+
throw new TypeError("option expires is invalid");
|
|
756
|
+
}
|
|
757
|
+
p += "; Expires=" + a2.expires.toUTCString();
|
|
758
|
+
}
|
|
759
|
+
if (a2.httpOnly) {
|
|
760
|
+
p += "; HttpOnly";
|
|
761
|
+
}
|
|
762
|
+
if (a2.secure) {
|
|
763
|
+
p += "; Secure";
|
|
764
|
+
}
|
|
765
|
+
if (a2.sameSite) {
|
|
766
|
+
var u = typeof a2.sameSite === "string" ? a2.sameSite.toLowerCase() : a2.sameSite;
|
|
767
|
+
switch (u) {
|
|
768
|
+
case true:
|
|
769
|
+
p += "; SameSite=Strict";
|
|
770
|
+
break;
|
|
771
|
+
case "lax":
|
|
772
|
+
p += "; SameSite=Lax";
|
|
773
|
+
break;
|
|
774
|
+
case "strict":
|
|
775
|
+
p += "; SameSite=Strict";
|
|
776
|
+
break;
|
|
777
|
+
case "none":
|
|
778
|
+
p += "; SameSite=None";
|
|
779
|
+
break;
|
|
780
|
+
default:
|
|
781
|
+
throw new TypeError("option sameSite is invalid");
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return p;
|
|
785
|
+
}
|
|
786
|
+
function tryDecode(e2, r2) {
|
|
787
|
+
try {
|
|
788
|
+
return r2(e2);
|
|
789
|
+
} catch (r3) {
|
|
790
|
+
return e2;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
})();
|
|
794
|
+
module.exports = e;
|
|
795
|
+
})();
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
// ../../../../node_modules/next/dist/server/web/spec-extension/cookies.js
|
|
800
|
+
var require_cookies = __commonJS({
|
|
801
|
+
"../../../../node_modules/next/dist/server/web/spec-extension/cookies.js"(exports) {
|
|
802
|
+
"use strict";
|
|
803
|
+
Object.defineProperty(exports, "__esModule", {
|
|
804
|
+
value: true
|
|
805
|
+
});
|
|
806
|
+
var _cookie = _interopRequireDefault(require_cookie());
|
|
807
|
+
function _interopRequireDefault(obj) {
|
|
808
|
+
return obj && obj.__esModule ? obj : {
|
|
809
|
+
default: obj
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
var normalizeCookieOptions = (options) => {
|
|
813
|
+
options = Object.assign({}, options);
|
|
814
|
+
if (options.maxAge) {
|
|
815
|
+
options.expires = new Date(Date.now() + options.maxAge * 1e3);
|
|
816
|
+
}
|
|
817
|
+
if (options.path == null) {
|
|
818
|
+
options.path = "/";
|
|
819
|
+
}
|
|
820
|
+
return options;
|
|
821
|
+
};
|
|
822
|
+
var serializeValue = (value) => typeof value === "object" ? `j:${JSON.stringify(value)}` : String(value);
|
|
823
|
+
var serializeExpiredCookie = (key, options = {}) => _cookie.default.serialize(key, "", {
|
|
824
|
+
expires: /* @__PURE__ */ new Date(0),
|
|
825
|
+
path: "/",
|
|
826
|
+
...options
|
|
827
|
+
});
|
|
828
|
+
var deserializeCookie = (input) => {
|
|
829
|
+
const value = input.headers.get("set-cookie");
|
|
830
|
+
return value !== void 0 && value !== null ? value.split(", ") : [];
|
|
831
|
+
};
|
|
832
|
+
var serializeCookie = (input) => input.join(", ");
|
|
833
|
+
var Cookies = class extends Map {
|
|
834
|
+
constructor(input) {
|
|
835
|
+
const parsedInput = typeof input === "string" ? _cookie.default.parse(input) : {};
|
|
836
|
+
super(Object.entries(parsedInput));
|
|
837
|
+
}
|
|
838
|
+
set(key, value, options = {}) {
|
|
839
|
+
return super.set(key, _cookie.default.serialize(key, serializeValue(value), normalizeCookieOptions(options)));
|
|
840
|
+
}
|
|
841
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
842
|
+
return Object.fromEntries(this.entries());
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
exports.Cookies = Cookies;
|
|
846
|
+
var NextCookies = class extends Cookies {
|
|
847
|
+
constructor(response) {
|
|
848
|
+
super(response.headers.get("cookie"));
|
|
849
|
+
__publicField(this, "get", (...args) => {
|
|
850
|
+
return this.getWithOptions(...args).value;
|
|
851
|
+
});
|
|
852
|
+
__publicField(this, "getWithOptions", (...args) => {
|
|
853
|
+
const raw = super.get(...args);
|
|
854
|
+
if (typeof raw !== "string")
|
|
855
|
+
return {
|
|
856
|
+
value: raw,
|
|
857
|
+
options: {}
|
|
858
|
+
};
|
|
859
|
+
const { [args[0]]: value, ...options } = _cookie.default.parse(raw);
|
|
860
|
+
return {
|
|
861
|
+
value,
|
|
862
|
+
options
|
|
863
|
+
};
|
|
864
|
+
});
|
|
865
|
+
__publicField(this, "set", (...args) => {
|
|
866
|
+
const isAlreadyAdded = super.has(args[0]);
|
|
867
|
+
super.set(...args);
|
|
868
|
+
const currentCookie = super.get(args[0]);
|
|
869
|
+
if (typeof currentCookie !== "string") {
|
|
870
|
+
throw new Error(`Invariant: failed to generate cookie for ${JSON.stringify(args)}`);
|
|
871
|
+
}
|
|
872
|
+
if (isAlreadyAdded) {
|
|
873
|
+
const setCookie = serializeCookie(deserializeCookie(this.response).filter((value) => !value.startsWith(`${args[0]}=`)));
|
|
874
|
+
if (setCookie) {
|
|
875
|
+
this.response.headers.set("set-cookie", [
|
|
876
|
+
currentCookie,
|
|
877
|
+
setCookie
|
|
878
|
+
].join(", "));
|
|
879
|
+
} else {
|
|
880
|
+
this.response.headers.set("set-cookie", currentCookie);
|
|
881
|
+
}
|
|
882
|
+
} else {
|
|
883
|
+
this.response.headers.append("set-cookie", currentCookie);
|
|
884
|
+
}
|
|
885
|
+
return this;
|
|
886
|
+
});
|
|
887
|
+
__publicField(this, "delete", (key, options = {}) => {
|
|
888
|
+
const isDeleted = super.delete(key);
|
|
889
|
+
if (isDeleted) {
|
|
890
|
+
const setCookie = serializeCookie(deserializeCookie(this.response).filter((value) => !value.startsWith(`${key}=`)));
|
|
891
|
+
const expiredCookie = serializeExpiredCookie(key, options);
|
|
892
|
+
this.response.headers.set("set-cookie", [
|
|
893
|
+
expiredCookie,
|
|
894
|
+
setCookie
|
|
895
|
+
].join(", "));
|
|
896
|
+
}
|
|
897
|
+
return isDeleted;
|
|
898
|
+
});
|
|
899
|
+
__publicField(this, "clear", (options = {}) => {
|
|
900
|
+
const expiredCookies = Array.from(super.keys()).map((key) => serializeExpiredCookie(key, options)).join(", ");
|
|
901
|
+
if (expiredCookies)
|
|
902
|
+
this.response.headers.set("set-cookie", expiredCookies);
|
|
903
|
+
return super.clear();
|
|
904
|
+
});
|
|
905
|
+
this.response = response;
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
exports.NextCookies = NextCookies;
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
// ../../../../node_modules/next/dist/server/web/spec-extension/request.js
|
|
913
|
+
var require_request = __commonJS({
|
|
914
|
+
"../../../../node_modules/next/dist/server/web/spec-extension/request.js"(exports) {
|
|
915
|
+
"use strict";
|
|
916
|
+
Object.defineProperty(exports, "__esModule", {
|
|
917
|
+
value: true
|
|
918
|
+
});
|
|
919
|
+
exports.INTERNALS = void 0;
|
|
920
|
+
var _nextUrl = require_next_url();
|
|
921
|
+
var _utils = require_utils();
|
|
922
|
+
var _error = require_error();
|
|
923
|
+
var _cookies = require_cookies();
|
|
924
|
+
var INTERNALS = Symbol("internal request");
|
|
925
|
+
exports.INTERNALS = INTERNALS;
|
|
926
|
+
var NextRequest2 = class extends Request {
|
|
927
|
+
constructor(input, init = {}) {
|
|
928
|
+
const url = typeof input !== "string" && "url" in input ? input.url : String(input);
|
|
929
|
+
(0, _utils).validateURL(url);
|
|
930
|
+
super(url, init);
|
|
931
|
+
this[INTERNALS] = {
|
|
932
|
+
cookies: new _cookies.NextCookies(this),
|
|
933
|
+
geo: init.geo || {},
|
|
934
|
+
ip: init.ip,
|
|
935
|
+
url: new _nextUrl.NextURL(url, {
|
|
936
|
+
headers: (0, _utils).toNodeHeaders(this.headers),
|
|
937
|
+
nextConfig: init.nextConfig
|
|
938
|
+
})
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
942
|
+
return {
|
|
943
|
+
cookies: this.cookies,
|
|
944
|
+
geo: this.geo,
|
|
945
|
+
ip: this.ip,
|
|
946
|
+
nextUrl: this.nextUrl,
|
|
947
|
+
url: this.url,
|
|
948
|
+
// rest of props come from Request
|
|
949
|
+
bodyUsed: this.bodyUsed,
|
|
950
|
+
cache: this.cache,
|
|
951
|
+
credentials: this.credentials,
|
|
952
|
+
destination: this.destination,
|
|
953
|
+
headers: Object.fromEntries(this.headers),
|
|
954
|
+
integrity: this.integrity,
|
|
955
|
+
keepalive: this.keepalive,
|
|
956
|
+
method: this.method,
|
|
957
|
+
mode: this.mode,
|
|
958
|
+
redirect: this.redirect,
|
|
959
|
+
referrer: this.referrer,
|
|
960
|
+
referrerPolicy: this.referrerPolicy,
|
|
961
|
+
signal: this.signal
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
get cookies() {
|
|
965
|
+
return this[INTERNALS].cookies;
|
|
966
|
+
}
|
|
967
|
+
get geo() {
|
|
968
|
+
return this[INTERNALS].geo;
|
|
969
|
+
}
|
|
970
|
+
get ip() {
|
|
971
|
+
return this[INTERNALS].ip;
|
|
972
|
+
}
|
|
973
|
+
get nextUrl() {
|
|
974
|
+
return this[INTERNALS].url;
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* @deprecated
|
|
978
|
+
* `page` has been deprecated in favour of `URLPattern`.
|
|
979
|
+
* Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
980
|
+
*/
|
|
981
|
+
get page() {
|
|
982
|
+
throw new _error.RemovedPageError();
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* @deprecated
|
|
986
|
+
* `ua` has been removed in favour of \`userAgent\` function.
|
|
987
|
+
* Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
988
|
+
*/
|
|
989
|
+
get ua() {
|
|
990
|
+
throw new _error.RemovedUAError();
|
|
991
|
+
}
|
|
992
|
+
get url() {
|
|
993
|
+
return this[INTERNALS].url.toString();
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
exports.NextRequest = NextRequest2;
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
// ../../../../node_modules/next/dist/server/web/spec-extension/response.js
|
|
1001
|
+
var require_response = __commonJS({
|
|
1002
|
+
"../../../../node_modules/next/dist/server/web/spec-extension/response.js"(exports) {
|
|
1003
|
+
"use strict";
|
|
1004
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1005
|
+
value: true
|
|
1006
|
+
});
|
|
1007
|
+
var _nextUrl = require_next_url();
|
|
1008
|
+
var _utils = require_utils();
|
|
1009
|
+
var _cookies = require_cookies();
|
|
1010
|
+
var INTERNALS = Symbol("internal response");
|
|
1011
|
+
var REDIRECTS = /* @__PURE__ */ new Set([
|
|
1012
|
+
301,
|
|
1013
|
+
302,
|
|
1014
|
+
303,
|
|
1015
|
+
307,
|
|
1016
|
+
308
|
|
1017
|
+
]);
|
|
1018
|
+
var NextResponse2 = class extends Response {
|
|
1019
|
+
constructor(body, init = {}) {
|
|
1020
|
+
super(body, init);
|
|
1021
|
+
this[INTERNALS] = {
|
|
1022
|
+
cookies: new _cookies.NextCookies(this),
|
|
1023
|
+
url: init.url ? new _nextUrl.NextURL(init.url, {
|
|
1024
|
+
headers: (0, _utils).toNodeHeaders(this.headers),
|
|
1025
|
+
nextConfig: init.nextConfig
|
|
1026
|
+
}) : void 0
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1030
|
+
return {
|
|
1031
|
+
cookies: this.cookies,
|
|
1032
|
+
url: this.url,
|
|
1033
|
+
// rest of props come from Response
|
|
1034
|
+
body: this.body,
|
|
1035
|
+
bodyUsed: this.bodyUsed,
|
|
1036
|
+
headers: Object.fromEntries(this.headers),
|
|
1037
|
+
ok: this.ok,
|
|
1038
|
+
redirected: this.redirected,
|
|
1039
|
+
status: this.status,
|
|
1040
|
+
statusText: this.statusText,
|
|
1041
|
+
type: this.type
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
get cookies() {
|
|
1045
|
+
return this[INTERNALS].cookies;
|
|
1046
|
+
}
|
|
1047
|
+
static json(body, init) {
|
|
1048
|
+
const response = Response.json(body, init);
|
|
1049
|
+
return new NextResponse2(response.body, response);
|
|
1050
|
+
}
|
|
1051
|
+
static redirect(url, init) {
|
|
1052
|
+
var ref;
|
|
1053
|
+
const status = typeof init === "number" ? init : (ref = init == null ? void 0 : init.status) != null ? ref : 307;
|
|
1054
|
+
if (!REDIRECTS.has(status)) {
|
|
1055
|
+
throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
|
|
1056
|
+
}
|
|
1057
|
+
const initObj = typeof init === "object" ? init : {};
|
|
1058
|
+
const headers = new Headers(initObj == null ? void 0 : initObj.headers);
|
|
1059
|
+
headers.set("Location", (0, _utils).validateURL(url));
|
|
1060
|
+
return new NextResponse2(null, {
|
|
1061
|
+
...initObj,
|
|
1062
|
+
headers,
|
|
1063
|
+
status
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
static rewrite(destination, init) {
|
|
1067
|
+
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
1068
|
+
headers.set("x-middleware-rewrite", (0, _utils).validateURL(destination));
|
|
1069
|
+
return new NextResponse2(null, {
|
|
1070
|
+
...init,
|
|
1071
|
+
headers
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
static next(init) {
|
|
1075
|
+
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
1076
|
+
headers.set("x-middleware-next", "1");
|
|
1077
|
+
return new NextResponse2(null, {
|
|
1078
|
+
...init,
|
|
1079
|
+
headers
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
exports.NextResponse = NextResponse2;
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
// ../../../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js
|
|
1088
|
+
var require_ua_parser = __commonJS({
|
|
1089
|
+
"../../../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js"(exports, module) {
|
|
1090
|
+
(() => {
|
|
1091
|
+
var i = { 412: function(i2, s2) {
|
|
1092
|
+
(function(e2, o) {
|
|
1093
|
+
"use strict";
|
|
1094
|
+
var r = "0.7.28", a = "", n = "?", t = "function", l = "undefined", w = "object", d = "string", b = "major", u = "model", c = "name", m = "type", p = "vendor", f = "version", h = "architecture", g = "console", v = "mobile", x = "tablet", k = "smarttv", _ = "wearable", y = "embedded", S = 255;
|
|
1095
|
+
var E = { extend: function(i3, s3) {
|
|
1096
|
+
var e3 = {};
|
|
1097
|
+
for (var o2 in i3) {
|
|
1098
|
+
if (s3[o2] && s3[o2].length % 2 === 0) {
|
|
1099
|
+
e3[o2] = s3[o2].concat(i3[o2]);
|
|
1100
|
+
} else {
|
|
1101
|
+
e3[o2] = i3[o2];
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
return e3;
|
|
1105
|
+
}, has: function(i3, s3) {
|
|
1106
|
+
return typeof i3 === d ? s3.toLowerCase().indexOf(i3.toLowerCase()) !== -1 : false;
|
|
1107
|
+
}, lowerize: function(i3) {
|
|
1108
|
+
return i3.toLowerCase();
|
|
1109
|
+
}, major: function(i3) {
|
|
1110
|
+
return typeof i3 === d ? i3.replace(/[^\d\.]/g, "").split(".")[0] : o;
|
|
1111
|
+
}, trim: function(i3, s3) {
|
|
1112
|
+
i3 = i3.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1113
|
+
return typeof s3 === l ? i3 : i3.substring(0, S);
|
|
1114
|
+
} };
|
|
1115
|
+
var A = { rgx: function(i3, s3) {
|
|
1116
|
+
var e3 = 0, r2, a2, n2, l2, d2, b2;
|
|
1117
|
+
while (e3 < s3.length && !d2) {
|
|
1118
|
+
var u2 = s3[e3], c2 = s3[e3 + 1];
|
|
1119
|
+
r2 = a2 = 0;
|
|
1120
|
+
while (r2 < u2.length && !d2) {
|
|
1121
|
+
d2 = u2[r2++].exec(i3);
|
|
1122
|
+
if (!!d2) {
|
|
1123
|
+
for (n2 = 0; n2 < c2.length; n2++) {
|
|
1124
|
+
b2 = d2[++a2];
|
|
1125
|
+
l2 = c2[n2];
|
|
1126
|
+
if (typeof l2 === w && l2.length > 0) {
|
|
1127
|
+
if (l2.length == 2) {
|
|
1128
|
+
if (typeof l2[1] == t) {
|
|
1129
|
+
this[l2[0]] = l2[1].call(this, b2);
|
|
1130
|
+
} else {
|
|
1131
|
+
this[l2[0]] = l2[1];
|
|
1132
|
+
}
|
|
1133
|
+
} else if (l2.length == 3) {
|
|
1134
|
+
if (typeof l2[1] === t && !(l2[1].exec && l2[1].test)) {
|
|
1135
|
+
this[l2[0]] = b2 ? l2[1].call(this, b2, l2[2]) : o;
|
|
1136
|
+
} else {
|
|
1137
|
+
this[l2[0]] = b2 ? b2.replace(l2[1], l2[2]) : o;
|
|
1138
|
+
}
|
|
1139
|
+
} else if (l2.length == 4) {
|
|
1140
|
+
this[l2[0]] = b2 ? l2[3].call(this, b2.replace(l2[1], l2[2])) : o;
|
|
1141
|
+
}
|
|
1142
|
+
} else {
|
|
1143
|
+
this[l2] = b2 ? b2 : o;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
e3 += 2;
|
|
1149
|
+
}
|
|
1150
|
+
}, str: function(i3, s3) {
|
|
1151
|
+
for (var e3 in s3) {
|
|
1152
|
+
if (typeof s3[e3] === w && s3[e3].length > 0) {
|
|
1153
|
+
for (var r2 = 0; r2 < s3[e3].length; r2++) {
|
|
1154
|
+
if (E.has(s3[e3][r2], i3)) {
|
|
1155
|
+
return e3 === n ? o : e3;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
} else if (E.has(s3[e3], i3)) {
|
|
1159
|
+
return e3 === n ? o : e3;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
return i3;
|
|
1163
|
+
} };
|
|
1164
|
+
var N = { browser: { oldSafari: { version: { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" } }, oldEdge: { version: { 0.1: "12.", 21: "13.", 31: "14.", 39: "15.", 41: "16.", 42: "17.", 44: "18." } } }, os: { windows: { version: { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" } } } };
|
|
1165
|
+
var T = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [f, [c, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [f, [c, "Edge"]], [/(opera\smini)\/([\w\.-]+)/i, /(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i, /(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i], [c, f], [/opios[\/\s]+([\w\.]+)/i], [f, [c, "Opera Mini"]], [/\sopr\/([\w\.]+)/i], [f, [c, "Opera"]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i, /(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i, /(ba?idubrowser)[\/\s]?([\w\.]+)/i, /(?:ms|\()(ie)\s([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i, /(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i, /(weibo)__([\d\.]+)/i], [c, f], [/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i], [f, [c, "UCBrowser"]], [/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i], [f, [c, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [f, [c, "WeChat"]], [/konqueror\/([\w\.]+)/i], [f, [c, "Konqueror"]], [/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i], [f, [c, "IE"]], [/yabrowser\/([\w\.]+)/i], [f, [c, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[c, /(.+)/, "$1 Secure Browser"], f], [/focus\/([\w\.]+)/i], [f, [c, "Firefox Focus"]], [/opt\/([\w\.]+)/i], [f, [c, "Opera Touch"]], [/coc_coc_browser\/([\w\.]+)/i], [f, [c, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [f, [c, "Dolphin"]], [/coast\/([\w\.]+)/i], [f, [c, "Opera Coast"]], [/xiaomi\/miuibrowser\/([\w\.]+)/i], [f, [c, "MIUI Browser"]], [/fxios\/([\w\.-]+)/i], [f, [c, "Firefox"]], [/(qihu|qhbrowser|qihoobrowser|360browser)/i], [[c, "360 Browser"]], [/(oculus|samsung|sailfish)browser\/([\w\.]+)/i], [[c, /(.+)/, "$1 Browser"], f], [/(comodo_dragon)\/([\w\.]+)/i], [[c, /_/g, " "], f], [/\s(electron)\/([\w\.]+)\ssafari/i, /(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i], [c, f], [/(MetaSr)[\/\s]?([\w\.]+)/i, /(LBBROWSER)/i], [c], [/;fbav\/([\w\.]+);/i], [f, [c, "Facebook"]], [/FBAN\/FBIOS|FB_IAB\/FB4A/i], [[c, "Facebook"]], [/safari\s(line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/\s]([\w\.-]+)/i], [c, f], [/\bgsa\/([\w\.]+)\s.*safari\//i], [f, [c, "GSA"]], [/headlesschrome(?:\/([\w\.]+)|\s)/i], [f, [c, "Chrome Headless"]], [/\swv\).+(chrome)\/([\w\.]+)/i], [[c, "Chrome WebView"], f], [/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i], [f, [c, "Android Browser"]], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i], [c, f], [/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i], [f, [c, "Mobile Safari"]], [/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i], [f, c], [/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i], [c, [f, A.str, N.browser.oldSafari.version]], [/(webkit|khtml)\/([\w\.]+)/i], [c, f], [/(navigator|netscape)\/([\w\.-]+)/i], [[c, "Netscape"], f], [/ile\svr;\srv:([\w\.]+)\).+firefox/i], [f, [c, "Firefox Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, /(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i, /(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, /(links)\s\(([\w\.]+)/i, /(gobrowser)\/?([\w\.]*)/i, /(ice\s?browser)\/v?([\w\._]+)/i, /(mosaic)[\/\s]([\w\.]+)/i], [c, f]], cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[h, "amd64"]], [/(ia32(?=;))/i], [[h, E.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[h, "ia32"]], [/\b(aarch64|armv?8e?l?)\b/i], [[h, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[h, "armhf"]], [/windows\s(ce|mobile);\sppc;/i], [[h, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[h, /ower/, "", E.lowerize]], [/(sun4\w)[;\)]/i], [[h, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[h, E.lowerize]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i], [u, [p, "Samsung"], [m, x]], [/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i, /\ssamsung[\s-]([\w-]+)/i, /sec-(sgh\w+)/i], [u, [p, "Samsung"], [m, v]], [/\((ip(?:hone|od)[\s\w]*);/i], [u, [p, "Apple"], [m, v]], [/\((ipad);[\w\s\),;-]+apple/i, /applecoremedia\/[\w\.]+\s\((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [u, [p, "Apple"], [m, x]], [/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i], [u, [p, "Huawei"], [m, x]], [/d\/huawei([\w\s-]+)[;\)]/i, /\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i, /\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i], [u, [p, "Huawei"], [m, v]], [/\b(poco[\s\w]+)(?:\sbuild|\))/i, /\b;\s(\w+)\sbuild\/hm\1/i, /\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i, /\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i, /\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i], [[u, /_/g, " "], [p, "Xiaomi"], [m, v]], [/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i], [[u, /_/g, " "], [p, "Xiaomi"], [m, x]], [/;\s(\w+)\sbuild.+\soppo/i, /\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i], [u, [p, "OPPO"], [m, v]], [/\svivo\s(\w+)(?:\sbuild|\))/i, /\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i], [u, [p, "Vivo"], [m, v]], [/\s(rmx[12]\d{3})(?:\sbuild|;)/i], [u, [p, "Realme"], [m, v]], [/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i, /\smot(?:orola)?[\s-](\w*)/i, /((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i], [u, [p, "Motorola"], [m, v]], [/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i], [u, [p, "Motorola"], [m, x]], [/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i], [u, [p, "LG"], [m, x]], [/(lm-?f100[nv]?|nexus\s[45])/i, /lg[e;\s\/-]+((?!browser|netcast)\w+)/i, /\blg(\-?[\d\w]+)\sbuild/i], [u, [p, "LG"], [m, v]], [/(ideatab[\w\-\s]+)/i, /lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i], [u, [p, "Lenovo"], [m, x]], [/(?:maemo|nokia).*(n900|lumia\s\d+)/i, /nokia[\s_-]?([\w\.-]*)/i], [[u, /_/g, " "], [p, "Nokia"], [m, v]], [/droid.+;\s(pixel\sc)[\s)]/i], [u, [p, "Google"], [m, x]], [/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i], [u, [p, "Google"], [m, v]], [/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [u, [p, "Sony"], [m, v]], [/sony\stablet\s[ps]\sbuild\//i, /(?:sony)?sgp\w+(?:\sbuild\/|\))/i], [[u, "Xperia Tablet"], [p, "Sony"], [m, x]], [/\s(kb2005|in20[12]5|be20[12][59])\b/i, /\ba000(1)\sbuild/i, /\boneplus\s(a\d{4})[\s)]/i], [u, [p, "OnePlus"], [m, v]], [/(alexa)webm/i, /(kf[a-z]{2}wi)(\sbuild\/|\))/i, /(kf[a-z]+)(\sbuild\/|\)).+silk\//i], [u, [p, "Amazon"], [m, x]], [/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i], [[u, "Fire Phone"], [p, "Amazon"], [m, v]], [/\((playbook);[\w\s\),;-]+(rim)/i], [u, p, [m, x]], [/((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10;\s(\w+)/i], [u, [p, "BlackBerry"], [m, v]], [/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i], [u, [p, "ASUS"], [m, x]], [/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i], [u, [p, "ASUS"], [m, v]], [/(nexus\s9)/i], [u, [p, "HTC"], [m, x]], [/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i, /(zte)-(\w*)/i, /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i], [p, [u, /_/g, " "], [m, v]], [/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i], [u, [p, "Acer"], [m, x]], [/droid.+;\s(m[1-5]\snote)\sbuild/i, /\bmz-([\w-]{2,})/i], [u, [p, "Meizu"], [m, v]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i, /(microsoft);\s(lumia[\s\w]+)/i, /(lenovo)[_\s-]?([\w-]+)/i, /linux;.+(jolla);/i, /droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i], [p, u, [m, v]], [/(archos)\s(gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i, /[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i, /[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i, /\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i, /\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i], [p, u, [m, x]], [/\s(surface\sduo)\s/i], [u, [p, "Microsoft"], [m, x]], [/droid\s[\d\.]+;\s(fp\du?)\sbuild/i], [u, [p, "Fairphone"], [m, v]], [/\s(u304aa)\sbuild/i], [u, [p, "AT&T"], [m, v]], [/sie-(\w*)/i], [u, [p, "Siemens"], [m, v]], [/[;\/]\s?(rct\w+)\sbuild/i], [u, [p, "RCA"], [m, x]], [/[;\/\s](venue[\d\s]{2,7})\sbuild/i], [u, [p, "Dell"], [m, x]], [/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i], [u, [p, "Verizon"], [m, x]], [/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i], [u, [p, "Barnes & Noble"], [m, x]], [/[;\/]\s(tm\d{3}\w+)\sbuild/i], [u, [p, "NuVision"], [m, x]], [/;\s(k88)\sbuild/i], [u, [p, "ZTE"], [m, x]], [/;\s(nx\d{3}j)\sbuild/i], [u, [p, "ZTE"], [m, v]], [/[;\/]\s?(gen\d{3})\sbuild.*49h/i], [u, [p, "Swiss"], [m, v]], [/[;\/]\s?(zur\d{3})\sbuild/i], [u, [p, "Swiss"], [m, x]], [/[;\/]\s?((zeki)?tb.*\b)\sbuild/i], [u, [p, "Zeki"], [m, x]], [/[;\/]\s([yr]\d{2})\sbuild/i, /[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i], [[p, "Dragon Touch"], u, [m, x]], [/[;\/]\s?(ns-?\w{0,9})\sbuild/i], [u, [p, "Insignia"], [m, x]], [/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i], [u, [p, "NextBook"], [m, x]], [/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i], [[p, "Voice"], u, [m, v]], [/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i], [[p, "LvTel"], u, [m, v]], [/;\s(ph-1)\s/i], [u, [p, "Essential"], [m, v]], [/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i], [u, [p, "Envizen"], [m, x]], [/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i], [u, [p, "MachSpeed"], [m, x]], [/[;\/]\s?tu_(1491)\sbuild/i], [u, [p, "Rotor"], [m, x]], [/(shield[\w\s]+)\sbuild/i], [u, [p, "Nvidia"], [m, x]], [/(sprint)\s(\w+)/i], [p, u, [m, v]], [/(kin\.[onetw]{3})/i], [[u, /\./g, " "], [p, "Microsoft"], [m, v]], [/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [u, [p, "Zebra"], [m, x]], [/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i], [u, [p, "Zebra"], [m, v]], [/\s(ouya)\s/i, /(nintendo)\s([wids3utch]+)/i], [p, u, [m, g]], [/droid.+;\s(shield)\sbuild/i], [u, [p, "Nvidia"], [m, g]], [/(playstation\s[345portablevi]+)/i], [u, [p, "Sony"], [m, g]], [/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i], [u, [p, "Microsoft"], [m, g]], [/smart-tv.+(samsung)/i], [p, [m, k]], [/hbbtv.+maple;(\d+)/i], [[u, /^/, "SmartTV"], [p, "Samsung"], [m, k]], [/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i], [[p, "LG"], [m, k]], [/(apple)\s?tv/i], [p, [u, "Apple TV"], [m, k]], [/crkey/i], [[u, "Chromecast"], [p, "Google"], [m, k]], [/droid.+aft([\w])(\sbuild\/|\))/i], [u, [p, "Amazon"], [m, k]], [/\(dtv[\);].+(aquos)/i], [u, [p, "Sharp"], [m, k]], [/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i], [[p, E.trim], [u, E.trim], [m, k]], [/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i], [[m, k]], [/((pebble))app\/[\d\.]+\s/i], [p, u, [m, _]], [/droid.+;\s(glass)\s\d/i], [u, [p, "Google"], [m, _]], [/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i], [u, [p, "Zebra"], [m, _]], [/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i], [p, [m, y]], [/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i], [u, [m, v]], [/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i], [u, [m, x]], [/\s(tablet|tab)[;\/]/i, /\s(mobile)(?:[;\/]|\ssafari)/i], [[m, E.lowerize]], [/(android[\w\.\s\-]{0,9});.+build/i], [u, [p, "Generic"]], [/(phone)/i], [[m, v]]], engine: [[/windows.+\sedge\/([\w\.]+)/i], [f, [c, "EdgeHTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [f, [c, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [c, f], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [f, c]], os: [[/microsoft\s(windows)\s(vista|xp)/i], [c, f], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i], [c, [f, A.str, N.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[c, "Windows"], [f, A.str, N.os.windows.version]], [/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i, /cfnetwork\/.+darwin/i], [[f, /_/g, "."], [c, "iOS"]], [/(mac\sos\sx)\s?([\w\s\.]*)/i, /(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i], [[c, "Mac OS"], [f, /_/g, "."]], [/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/\s]([\w\.]+)/i, /\((series40);/i], [c, f], [/\(bb(10);/i], [f, [c, "BlackBerry"]], [/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i], [f, [c, "Symbian"]], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[c, "Firefox OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [f, [c, "webOS"]], [/crkey\/([\d\.]+)/i], [f, [c, "Chromecast"]], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[c, "Chromium OS"], f], [/(nintendo|playstation)\s([wids345portablevuch]+)/i, /(xbox);\s+xbox\s([^\);]+)/i, /(mint)[\/\s\(\)]?(\w*)/i, /(mageia|vectorlinux)[;\s]/i, /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i, /(hurd|linux)\s?([\w\.]*)/i, /(gnu)\s?([\w\.]*)/i, /\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku)\s(\w+)/i], [c, f], [/(sunos)\s?([\w\.\d]*)/i], [[c, "Solaris"], f], [/((?:open)?solaris)[\/\s-]?([\w\.]*)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i, /(unix)\s?([\w\.]*)/i], [c, f]] };
|
|
1166
|
+
var UAParser = function(i3, s3) {
|
|
1167
|
+
if (typeof i3 === "object") {
|
|
1168
|
+
s3 = i3;
|
|
1169
|
+
i3 = o;
|
|
1170
|
+
}
|
|
1171
|
+
if (!(this instanceof UAParser)) {
|
|
1172
|
+
return new UAParser(i3, s3).getResult();
|
|
1173
|
+
}
|
|
1174
|
+
var r2 = i3 || (typeof e2 !== "undefined" && e2.navigator && e2.navigator.userAgent ? e2.navigator.userAgent : a);
|
|
1175
|
+
var n2 = s3 ? E.extend(T, s3) : T;
|
|
1176
|
+
this.getBrowser = function() {
|
|
1177
|
+
var i4 = { name: o, version: o };
|
|
1178
|
+
A.rgx.call(i4, r2, n2.browser);
|
|
1179
|
+
i4.major = E.major(i4.version);
|
|
1180
|
+
return i4;
|
|
1181
|
+
};
|
|
1182
|
+
this.getCPU = function() {
|
|
1183
|
+
var i4 = { architecture: o };
|
|
1184
|
+
A.rgx.call(i4, r2, n2.cpu);
|
|
1185
|
+
return i4;
|
|
1186
|
+
};
|
|
1187
|
+
this.getDevice = function() {
|
|
1188
|
+
var i4 = { vendor: o, model: o, type: o };
|
|
1189
|
+
A.rgx.call(i4, r2, n2.device);
|
|
1190
|
+
return i4;
|
|
1191
|
+
};
|
|
1192
|
+
this.getEngine = function() {
|
|
1193
|
+
var i4 = { name: o, version: o };
|
|
1194
|
+
A.rgx.call(i4, r2, n2.engine);
|
|
1195
|
+
return i4;
|
|
1196
|
+
};
|
|
1197
|
+
this.getOS = function() {
|
|
1198
|
+
var i4 = { name: o, version: o };
|
|
1199
|
+
A.rgx.call(i4, r2, n2.os);
|
|
1200
|
+
return i4;
|
|
1201
|
+
};
|
|
1202
|
+
this.getResult = function() {
|
|
1203
|
+
return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
|
|
1204
|
+
};
|
|
1205
|
+
this.getUA = function() {
|
|
1206
|
+
return r2;
|
|
1207
|
+
};
|
|
1208
|
+
this.setUA = function(i4) {
|
|
1209
|
+
r2 = typeof i4 === d && i4.length > S ? E.trim(i4, S) : i4;
|
|
1210
|
+
return this;
|
|
1211
|
+
};
|
|
1212
|
+
this.setUA(r2);
|
|
1213
|
+
return this;
|
|
1214
|
+
};
|
|
1215
|
+
UAParser.VERSION = r;
|
|
1216
|
+
UAParser.BROWSER = { NAME: c, MAJOR: b, VERSION: f };
|
|
1217
|
+
UAParser.CPU = { ARCHITECTURE: h };
|
|
1218
|
+
UAParser.DEVICE = { MODEL: u, VENDOR: p, TYPE: m, CONSOLE: g, MOBILE: v, SMARTTV: k, TABLET: x, WEARABLE: _, EMBEDDED: y };
|
|
1219
|
+
UAParser.ENGINE = { NAME: c, VERSION: f };
|
|
1220
|
+
UAParser.OS = { NAME: c, VERSION: f };
|
|
1221
|
+
if (typeof s2 !== l) {
|
|
1222
|
+
if ("object" !== l && i2.exports) {
|
|
1223
|
+
s2 = i2.exports = UAParser;
|
|
1224
|
+
}
|
|
1225
|
+
s2.UAParser = UAParser;
|
|
1226
|
+
} else {
|
|
1227
|
+
if (typeof define === "function" && define.amd) {
|
|
1228
|
+
define(function() {
|
|
1229
|
+
return UAParser;
|
|
1230
|
+
});
|
|
1231
|
+
} else if (typeof e2 !== "undefined") {
|
|
1232
|
+
e2.UAParser = UAParser;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
var z = typeof e2 !== "undefined" && (e2.jQuery || e2.Zepto);
|
|
1236
|
+
if (z && !z.ua) {
|
|
1237
|
+
var O = new UAParser();
|
|
1238
|
+
z.ua = O.getResult();
|
|
1239
|
+
z.ua.get = function() {
|
|
1240
|
+
return O.getUA();
|
|
1241
|
+
};
|
|
1242
|
+
z.ua.set = function(i3) {
|
|
1243
|
+
O.setUA(i3);
|
|
1244
|
+
var s3 = O.getResult();
|
|
1245
|
+
for (var e3 in s3) {
|
|
1246
|
+
z.ua[e3] = s3[e3];
|
|
1247
|
+
}
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
})(typeof window === "object" ? window : this);
|
|
1251
|
+
} };
|
|
1252
|
+
var s = {};
|
|
1253
|
+
function __nccwpck_require__2(e2) {
|
|
1254
|
+
var o = s[e2];
|
|
1255
|
+
if (o !== void 0) {
|
|
1256
|
+
return o.exports;
|
|
1257
|
+
}
|
|
1258
|
+
var r = s[e2] = { exports: {} };
|
|
1259
|
+
var a = true;
|
|
1260
|
+
try {
|
|
1261
|
+
i[e2].call(r.exports, r, r.exports, __nccwpck_require__2);
|
|
1262
|
+
a = false;
|
|
1263
|
+
} finally {
|
|
1264
|
+
if (a)
|
|
1265
|
+
delete s[e2];
|
|
1266
|
+
}
|
|
1267
|
+
return r.exports;
|
|
1268
|
+
}
|
|
1269
|
+
if (typeof __nccwpck_require__2 !== "undefined")
|
|
1270
|
+
__nccwpck_require__2.ab = __dirname + "/";
|
|
1271
|
+
var e = __nccwpck_require__2(412);
|
|
1272
|
+
module.exports = e;
|
|
1273
|
+
})();
|
|
1274
|
+
}
|
|
1275
|
+
});
|
|
1276
|
+
|
|
1277
|
+
// ../../../../node_modules/next/dist/server/web/spec-extension/user-agent.js
|
|
1278
|
+
var require_user_agent = __commonJS({
|
|
1279
|
+
"../../../../node_modules/next/dist/server/web/spec-extension/user-agent.js"(exports) {
|
|
1280
|
+
"use strict";
|
|
1281
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1282
|
+
value: true
|
|
1283
|
+
});
|
|
1284
|
+
exports.isBot = isBot;
|
|
1285
|
+
exports.userAgentFromString = userAgentFromString;
|
|
1286
|
+
exports.userAgent = userAgent;
|
|
1287
|
+
var _uaParserJs = _interopRequireDefault(require_ua_parser());
|
|
1288
|
+
function _interopRequireDefault(obj) {
|
|
1289
|
+
return obj && obj.__esModule ? obj : {
|
|
1290
|
+
default: obj
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
function isBot(input) {
|
|
1294
|
+
return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(input);
|
|
1295
|
+
}
|
|
1296
|
+
function userAgentFromString(input) {
|
|
1297
|
+
return {
|
|
1298
|
+
...(0, _uaParserJs).default(input),
|
|
1299
|
+
isBot: input === void 0 ? false : isBot(input)
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
function userAgent({ headers }) {
|
|
1303
|
+
return userAgentFromString(headers.get("user-agent") || void 0);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
// ../../../../node_modules/next/server.js
|
|
1309
|
+
var require_server = __commonJS({
|
|
1310
|
+
"../../../../node_modules/next/server.js"(exports, module) {
|
|
1311
|
+
var serverExports = {
|
|
1312
|
+
NextRequest: require_request().NextRequest,
|
|
1313
|
+
NextResponse: require_response().NextResponse,
|
|
1314
|
+
userAgentFromString: require_user_agent().userAgentFromString,
|
|
1315
|
+
userAgent: require_user_agent().userAgent
|
|
1316
|
+
};
|
|
1317
|
+
if (typeof URLPattern !== "undefined") {
|
|
1318
|
+
serverExports.URLPattern = URLPattern;
|
|
1319
|
+
}
|
|
1320
|
+
module.exports = serverExports;
|
|
1321
|
+
exports.NextRequest = serverExports.NextRequest;
|
|
1322
|
+
exports.NextResponse = serverExports.NextResponse;
|
|
1323
|
+
exports.userAgentFromString = serverExports.userAgentFromString;
|
|
1324
|
+
exports.userAgent = serverExports.userAgent;
|
|
1325
|
+
exports.URLPattern = serverExports.URLPattern;
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
|
|
1329
|
+
// src/category/category.service.ts
|
|
1330
|
+
import { getStore } from "@websolutespa/bom-mixer-store";
|
|
1331
|
+
async function getCategories(params = {}) {
|
|
1332
|
+
const store = await getStore();
|
|
1333
|
+
const categories = await store.category.findMany(params);
|
|
1334
|
+
return categories;
|
|
1335
|
+
}
|
|
1336
|
+
async function getSegments(item, params = {}) {
|
|
1337
|
+
const categories = await getCategories(params);
|
|
1338
|
+
return getRouteSegments(item.schema, item, categories);
|
|
1339
|
+
}
|
|
1340
|
+
function getRouteSegments(schema, item, categories) {
|
|
1341
|
+
const segments = [];
|
|
1342
|
+
let parentId = item.category || null;
|
|
1343
|
+
while (parentId != null) {
|
|
1344
|
+
const parentCategory = categories.find((c) => c.id === parentId);
|
|
1345
|
+
if (parentCategory) {
|
|
1346
|
+
if (parentCategory.slug) {
|
|
1347
|
+
const segment = { ...parentCategory };
|
|
1348
|
+
segments.unshift(segment);
|
|
1349
|
+
}
|
|
1350
|
+
parentId = parentCategory.category || null;
|
|
1351
|
+
} else {
|
|
1352
|
+
parentId = null;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
if (item.isDefault !== true) {
|
|
1356
|
+
segments.push({
|
|
1357
|
+
id: item.id,
|
|
1358
|
+
title: item.title,
|
|
1359
|
+
slug: item.slug,
|
|
1360
|
+
schema,
|
|
1361
|
+
page: item.id,
|
|
1362
|
+
media: item.media
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
return segments;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
// src/country/country.service.ts
|
|
1369
|
+
import { getStore as getStore2 } from "@websolutespa/bom-mixer-store";
|
|
1370
|
+
async function getCountries(locale) {
|
|
1371
|
+
const store = await getStore2();
|
|
1372
|
+
const items = await store.i18n_country.findMany({ locale });
|
|
1373
|
+
return items;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
// src/province/province.service.ts
|
|
1377
|
+
import { getStore as getStore3 } from "@websolutespa/bom-mixer-store";
|
|
1378
|
+
async function getProvinces(locale) {
|
|
1379
|
+
const store = await getStore3();
|
|
1380
|
+
const items = await store.i18n_province.findMany({ locale });
|
|
1381
|
+
return items;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// src/region/region.service.ts
|
|
1385
|
+
import { getStore as getStore4 } from "@websolutespa/bom-mixer-store";
|
|
1386
|
+
async function getRegions(locale) {
|
|
1387
|
+
const store = await getStore4();
|
|
1388
|
+
const items = await store.i18n_region.findMany({ locale });
|
|
1389
|
+
return items;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
// src/route/route.service.ts
|
|
1393
|
+
import { isLocalizedString, localizedToString } from "@websolutespa/bom-mixer-core";
|
|
1394
|
+
import { getStore as getStore5 } from "@websolutespa/bom-mixer-store";
|
|
1395
|
+
async function getRoutes(params = {}) {
|
|
1396
|
+
const store = await getStore5();
|
|
1397
|
+
const routes = await store.route.findMany(params);
|
|
1398
|
+
return routes;
|
|
1399
|
+
}
|
|
1400
|
+
async function getRoute(id) {
|
|
1401
|
+
const store = await getStore5();
|
|
1402
|
+
const route = await store.route.findOne({
|
|
1403
|
+
where: {
|
|
1404
|
+
id: {
|
|
1405
|
+
equals: id
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
});
|
|
1409
|
+
return route;
|
|
1410
|
+
}
|
|
1411
|
+
async function getRoutesForSchemas(schemas, market, locale) {
|
|
1412
|
+
const store = await getStore5();
|
|
1413
|
+
const routes = await store.route.findMany({
|
|
1414
|
+
where: {
|
|
1415
|
+
schema: {
|
|
1416
|
+
in: schemas
|
|
1417
|
+
},
|
|
1418
|
+
market: {
|
|
1419
|
+
equals: market
|
|
1420
|
+
},
|
|
1421
|
+
locale: {
|
|
1422
|
+
equals: locale
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1425
|
+
market,
|
|
1426
|
+
locale
|
|
1427
|
+
});
|
|
1428
|
+
const items = {};
|
|
1429
|
+
routes.forEach((route) => {
|
|
1430
|
+
items[route.schema] = route.id;
|
|
1431
|
+
});
|
|
1432
|
+
return items;
|
|
1433
|
+
}
|
|
1434
|
+
async function getRoutesForTemplates(templates, market, locale) {
|
|
1435
|
+
const store = await getStore5();
|
|
1436
|
+
const routes = await store.route.findMany({
|
|
1437
|
+
where: {
|
|
1438
|
+
template: {
|
|
1439
|
+
in: templates
|
|
1440
|
+
},
|
|
1441
|
+
market: {
|
|
1442
|
+
equals: market
|
|
1443
|
+
},
|
|
1444
|
+
locale: {
|
|
1445
|
+
equals: locale
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
market,
|
|
1449
|
+
locale
|
|
1450
|
+
});
|
|
1451
|
+
const items = {};
|
|
1452
|
+
routes.forEach((route) => {
|
|
1453
|
+
if (route.template) {
|
|
1454
|
+
items[route.template] = route.id;
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
return items;
|
|
1458
|
+
}
|
|
1459
|
+
async function getStaticPathsForSchema(schema) {
|
|
1460
|
+
const store = await getStore5();
|
|
1461
|
+
const routes = await store.route.findMany({
|
|
1462
|
+
where: {
|
|
1463
|
+
schema: {
|
|
1464
|
+
equals: schema
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
return routes.map((x) => ({ params: { id: x.page.toString(), market: x.market, locale: x.locale } }));
|
|
1469
|
+
}
|
|
1470
|
+
async function decorateHref(item, market = "ww", locale = "en") {
|
|
1471
|
+
const routes = await getRoutes({
|
|
1472
|
+
where: {
|
|
1473
|
+
schema: {
|
|
1474
|
+
equals: item.schema
|
|
1475
|
+
},
|
|
1476
|
+
page: {
|
|
1477
|
+
equals: item.id
|
|
1478
|
+
},
|
|
1479
|
+
market: {
|
|
1480
|
+
equals: market
|
|
1481
|
+
},
|
|
1482
|
+
locale: {
|
|
1483
|
+
equals: locale
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
});
|
|
1487
|
+
const href = routes.length ? routes[0].id : null;
|
|
1488
|
+
return { ...item, href };
|
|
1489
|
+
}
|
|
1490
|
+
async function getBreadcrumbFromSegments(segments, market = "ww", locale = "en") {
|
|
1491
|
+
const routes = await getRoutes({
|
|
1492
|
+
where: {
|
|
1493
|
+
market: {
|
|
1494
|
+
equals: market
|
|
1495
|
+
},
|
|
1496
|
+
locale: {
|
|
1497
|
+
equals: locale
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
const tree = segments.map((segment) => {
|
|
1502
|
+
const route = segment.schema && segment.page ? routes.find(
|
|
1503
|
+
(r) => r.schema === segment.schema && r.page === segment.page
|
|
1504
|
+
) : void 0;
|
|
1505
|
+
const href = route ? route.id.toString() : "/#";
|
|
1506
|
+
return { segment, href };
|
|
1507
|
+
}).map((x) => {
|
|
1508
|
+
const segment = x.segment;
|
|
1509
|
+
const href = x.href;
|
|
1510
|
+
let title = segment.title || "untitled";
|
|
1511
|
+
if (isLocalizedString(title)) {
|
|
1512
|
+
title = localizedToString(title, locale);
|
|
1513
|
+
}
|
|
1514
|
+
return {
|
|
1515
|
+
id: segment.id,
|
|
1516
|
+
title,
|
|
1517
|
+
href,
|
|
1518
|
+
items: []
|
|
1519
|
+
};
|
|
1520
|
+
});
|
|
1521
|
+
return tree;
|
|
1522
|
+
}
|
|
1523
|
+
async function getRouteLinkTree(market = "ww", locale = "en") {
|
|
1524
|
+
const store = await getStore5();
|
|
1525
|
+
const routes = await store.route.findMany({
|
|
1526
|
+
where: {
|
|
1527
|
+
market: {
|
|
1528
|
+
equals: market
|
|
1529
|
+
},
|
|
1530
|
+
locale: {
|
|
1531
|
+
equals: locale
|
|
1532
|
+
}
|
|
1533
|
+
},
|
|
1534
|
+
market,
|
|
1535
|
+
locale
|
|
1536
|
+
});
|
|
1537
|
+
const categories = await store.category.findMany();
|
|
1538
|
+
const homepage = categories.find((x) => x.id === "homepage");
|
|
1539
|
+
if (homepage) {
|
|
1540
|
+
const root = categoryToRouteLink(routes, categories, homepage, locale);
|
|
1541
|
+
return root;
|
|
1542
|
+
}
|
|
1543
|
+
return void 0;
|
|
1544
|
+
}
|
|
1545
|
+
function categoryToRouteLink(routes, categories, category, locale = "en") {
|
|
1546
|
+
const route = routes.find(
|
|
1547
|
+
(r) => r.category === category.id
|
|
1548
|
+
);
|
|
1549
|
+
const href = route ? route.id.toString() : "/#";
|
|
1550
|
+
let title = category.title || "untitled";
|
|
1551
|
+
if (isLocalizedString(title)) {
|
|
1552
|
+
title = localizedToString(title, locale);
|
|
1553
|
+
}
|
|
1554
|
+
const childCategories = categories.filter((x) => {
|
|
1555
|
+
const parentId = x.category && typeof x.category === "object" ? x.category["id"] : x.category;
|
|
1556
|
+
return category.id === "homepage" ? x.id !== "homepage" && (parentId === category.id || !parentId) : parentId === category.id;
|
|
1557
|
+
});
|
|
1558
|
+
return {
|
|
1559
|
+
id: category.id,
|
|
1560
|
+
title,
|
|
1561
|
+
href,
|
|
1562
|
+
media: category.media,
|
|
1563
|
+
items: childCategories.map((x) => categoryToRouteLink(routes, categories, x, locale))
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
function resolveRoute(route) {
|
|
1567
|
+
const routepath = route.template ? route.template : route.schema;
|
|
1568
|
+
const resolvedPathname = `/${route.market}/${route.locale}/${routepath}/${route.page}`;
|
|
1569
|
+
return resolvedPathname;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
// src/checkout/checkout.service.ts
|
|
1573
|
+
async function getItems(items, market, locale, user) {
|
|
1574
|
+
return items.map((x) => ({ ...x, fullPrice: x.price, price: x.price * 0.9 }));
|
|
1575
|
+
}
|
|
1576
|
+
async function getInfo(checkout, market, locale) {
|
|
1577
|
+
const countries = await getCountries(locale);
|
|
1578
|
+
const provinces = await getProvinces(locale);
|
|
1579
|
+
const regions = await getRegions(locale);
|
|
1580
|
+
const data = { countries, regions, provinces };
|
|
1581
|
+
return data;
|
|
1582
|
+
}
|
|
1583
|
+
async function getDeliveries(checkout, market, locale) {
|
|
1584
|
+
return [
|
|
1585
|
+
{
|
|
1586
|
+
"id": 1,
|
|
1587
|
+
"name": "In-store pick up",
|
|
1588
|
+
"abstract": "Conveniently collect from your nearest shop at no extra charge",
|
|
1589
|
+
"price": 0,
|
|
1590
|
+
"fullPrice": 0
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
"id": 2,
|
|
1594
|
+
"name": "Courier delivery",
|
|
1595
|
+
"abstract": "Packaged goods are delivered by our trusted forwarder.",
|
|
1596
|
+
"price": 81,
|
|
1597
|
+
"fullPrice": 81
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
"id": 3,
|
|
1601
|
+
"name": "In-home courier delivery",
|
|
1602
|
+
"abstract": "Packaged goods are delivered inside at front door. <br>White glove delivery, unpacking, assembly, or removal of debris is optional on request.",
|
|
1603
|
+
"price": 156,
|
|
1604
|
+
"fullPrice": 156
|
|
1605
|
+
}
|
|
1606
|
+
];
|
|
1607
|
+
}
|
|
1608
|
+
async function getStores(checkout, market, locale) {
|
|
1609
|
+
return [
|
|
1610
|
+
{
|
|
1611
|
+
"id": 10366,
|
|
1612
|
+
"category": { "id": "store_category_distributor", "name": "Hexagon Distributor" },
|
|
1613
|
+
"name": "Di Paolo Arredamenti",
|
|
1614
|
+
"address": "Viale Cesare Battisti",
|
|
1615
|
+
"streetNumber": "80",
|
|
1616
|
+
"zipCode": "64020",
|
|
1617
|
+
"city": "Bellante",
|
|
1618
|
+
"country": { "id": "it", "name": "Italy" },
|
|
1619
|
+
"phoneNumber": "+39 0861 616436",
|
|
1620
|
+
"timetable": [],
|
|
1621
|
+
"position": {
|
|
1622
|
+
"latitude": 0,
|
|
1623
|
+
"longitude": 0
|
|
1624
|
+
},
|
|
1625
|
+
"distance": 151.84174300013095,
|
|
1626
|
+
"rank": 1
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
"id": 7430,
|
|
1630
|
+
"category": { "id": "store_category_distributor", "name": "Hexagon Distributor" },
|
|
1631
|
+
"name": "Mancini Italian Design & Art S.r.l.",
|
|
1632
|
+
"address": "Via Ascari",
|
|
1633
|
+
"streetNumber": "2",
|
|
1634
|
+
"zipCode": "41053",
|
|
1635
|
+
"city": "Maranello",
|
|
1636
|
+
"country": { "id": "it", "name": "Italy" },
|
|
1637
|
+
"email": "info@mancinimida.com",
|
|
1638
|
+
"timetable": [],
|
|
1639
|
+
"position": {
|
|
1640
|
+
"latitude": 0,
|
|
1641
|
+
"longitude": 0
|
|
1642
|
+
},
|
|
1643
|
+
"distance": 170.6551472799284,
|
|
1644
|
+
"rank": 2
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"id": 325,
|
|
1648
|
+
"category": { "id": "store_category_distributor", "name": "Hexagon Distributor" },
|
|
1649
|
+
"name": "AD dal Pozzo",
|
|
1650
|
+
"address": "Via Mazzini",
|
|
1651
|
+
"streetNumber": "24",
|
|
1652
|
+
"zipCode": "36040",
|
|
1653
|
+
"city": "Grisignano Di Zocco",
|
|
1654
|
+
"country": { "id": "it", "name": "Italy" },
|
|
1655
|
+
"phoneNumber": "+39 0444 614521",
|
|
1656
|
+
"email": "mfort@websolute.it",
|
|
1657
|
+
"timetable": [],
|
|
1658
|
+
"position": {
|
|
1659
|
+
"latitude": 0,
|
|
1660
|
+
"longitude": 0
|
|
1661
|
+
},
|
|
1662
|
+
"distance": 196.0600048738732,
|
|
1663
|
+
"rank": 3
|
|
1664
|
+
}
|
|
1665
|
+
];
|
|
1666
|
+
}
|
|
1667
|
+
async function getPayments(checkout, market, locale) {
|
|
1668
|
+
return [
|
|
1669
|
+
{
|
|
1670
|
+
"id": "alipay",
|
|
1671
|
+
"name": "Alipay",
|
|
1672
|
+
"media": {
|
|
1673
|
+
"type": "image",
|
|
1674
|
+
"src": "/assets/payment/alipay.svg"
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
"id": "amex",
|
|
1679
|
+
"name": "American Express",
|
|
1680
|
+
"media": {
|
|
1681
|
+
"type": "image",
|
|
1682
|
+
"src": "/assets/payment/american-express.svg"
|
|
1683
|
+
}
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
"id": "apple-pay",
|
|
1687
|
+
"name": "Apple Pay",
|
|
1688
|
+
"media": {
|
|
1689
|
+
"type": "image",
|
|
1690
|
+
"src": "/assets/payment/apple-pay.svg"
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
"id": "bank-transfer",
|
|
1695
|
+
"name": "Bank Transfer",
|
|
1696
|
+
"media": {
|
|
1697
|
+
"type": "image",
|
|
1698
|
+
"src": "/assets/payment/bank-transfer.svg"
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1701
|
+
{
|
|
1702
|
+
"id": "cbc",
|
|
1703
|
+
"name": "CBC",
|
|
1704
|
+
"media": {
|
|
1705
|
+
"type": "image",
|
|
1706
|
+
"src": "/assets/payment/cbc.svg"
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
"id": "direct-debit",
|
|
1711
|
+
"name": "Direct Debit",
|
|
1712
|
+
"media": {
|
|
1713
|
+
"type": "image",
|
|
1714
|
+
"src": "/assets/payment/direct-debit.svg"
|
|
1715
|
+
}
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
"id": "googlepay",
|
|
1719
|
+
"name": "Google Pay",
|
|
1720
|
+
"media": {
|
|
1721
|
+
"type": "image",
|
|
1722
|
+
"src": "/assets/payment/googlepay.svg"
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
"id": "ideal",
|
|
1727
|
+
"name": "iDEAL",
|
|
1728
|
+
"media": {
|
|
1729
|
+
"type": "image",
|
|
1730
|
+
"src": "/assets/payment/ideal.svg"
|
|
1731
|
+
}
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
"id": "maestro",
|
|
1735
|
+
"name": "Maestro",
|
|
1736
|
+
"media": {
|
|
1737
|
+
"type": "image",
|
|
1738
|
+
"src": "/assets/payment/maestro.svg"
|
|
1739
|
+
}
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
"id": "mastercard",
|
|
1743
|
+
"name": "MasterCard",
|
|
1744
|
+
"abstract": "<p>You can use your Mastercard credit card. The 3DS authentication procedure will be used when the order is concluded, and you will be redirected to the bank's web page. To complete the order, follow the required steps.</p>",
|
|
1745
|
+
"media": {
|
|
1746
|
+
"type": "image",
|
|
1747
|
+
"src": "/assets/payment/mastercard.svg"
|
|
1748
|
+
}
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
"id": "mybank",
|
|
1752
|
+
"name": "MyBank",
|
|
1753
|
+
"media": {
|
|
1754
|
+
"type": "image",
|
|
1755
|
+
"src": "/assets/payment/mybank.svg"
|
|
1756
|
+
}
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
"id": "paypal",
|
|
1760
|
+
"name": "PayPal",
|
|
1761
|
+
"media": {
|
|
1762
|
+
"type": "image",
|
|
1763
|
+
"src": "/assets/payment/paypal.svg"
|
|
1764
|
+
}
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
"id": "trustly",
|
|
1768
|
+
"name": "Trustly",
|
|
1769
|
+
"media": {
|
|
1770
|
+
"type": "image",
|
|
1771
|
+
"src": "/assets/payment/trustly.svg"
|
|
1772
|
+
}
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
"id": "visa",
|
|
1776
|
+
"name": "Visa",
|
|
1777
|
+
"abstract": "<p>You can use your Visa credit card. The 3DS authentication procedure will be used when the order is concluded, and you will be redirected to the bank's web page. To complete the order, follow the required steps.</p>",
|
|
1778
|
+
"media": {
|
|
1779
|
+
"type": "image",
|
|
1780
|
+
"src": "/assets/payment/visa.svg"
|
|
1781
|
+
}
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
"id": "wechatpay",
|
|
1785
|
+
"name": "WeChat Pay",
|
|
1786
|
+
"media": {
|
|
1787
|
+
"type": "image",
|
|
1788
|
+
"src": "/assets/payment/wechatpay.svg"
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
"id": "wire-transfer",
|
|
1793
|
+
"name": "Wire Transfer",
|
|
1794
|
+
"abstract": "<p>The order confirmation will contain a summary of the total amount to be paid and the details of the bank to which the payment is to be made..</p><p> Once the payment has been made, the order will be activated and the delivery terms indicated for the various items ordered will apply. The successful completion of the payment will be communicated by email to the email address indicated during registration.</p>",
|
|
1795
|
+
"media": {
|
|
1796
|
+
"type": "image",
|
|
1797
|
+
"src": "/assets/payment/wire-transfer.svg"
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
];
|
|
1801
|
+
}
|
|
1802
|
+
async function updateCheckout(checkout, action, market, locale) {
|
|
1803
|
+
const subTotal = checkout.items ? checkout.items.reduce((p, c) => {
|
|
1804
|
+
return p + c.price * c.qty;
|
|
1805
|
+
}, 0) : 0;
|
|
1806
|
+
const subTotalFull = checkout.items ? checkout.items.reduce((p, c) => {
|
|
1807
|
+
return p + c.fullPrice * c.qty;
|
|
1808
|
+
}, 0) : 0;
|
|
1809
|
+
const subTotalDiscountPrice = checkout.discounts ? checkout.discounts.reduce((p, c) => {
|
|
1810
|
+
let value = 0;
|
|
1811
|
+
switch (c.id) {
|
|
1812
|
+
case "coupon10":
|
|
1813
|
+
value = subTotal * 0.1 * -1;
|
|
1814
|
+
c.price = value;
|
|
1815
|
+
break;
|
|
1816
|
+
case "coupon50":
|
|
1817
|
+
value = subTotal * 0.5 * -1;
|
|
1818
|
+
c.price = value;
|
|
1819
|
+
break;
|
|
1820
|
+
}
|
|
1821
|
+
return p + value;
|
|
1822
|
+
}, 0) : 0;
|
|
1823
|
+
const deliveryPrice = checkout.delivery?.price || 0;
|
|
1824
|
+
const afterTaxesDiscountPrice = checkout.discounts ? checkout.discounts.reduce((p, c) => {
|
|
1825
|
+
let value = 0;
|
|
1826
|
+
switch (c.id) {
|
|
1827
|
+
case "shipping":
|
|
1828
|
+
value = deliveryPrice * -1;
|
|
1829
|
+
c.price = value;
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
return p + value;
|
|
1833
|
+
}, 0) : 0;
|
|
1834
|
+
const taxes = (subTotal + subTotalDiscountPrice) * 0.2;
|
|
1835
|
+
const total = subTotal + subTotalDiscountPrice + taxes + deliveryPrice + afterTaxesDiscountPrice;
|
|
1836
|
+
checkout.subTotal = subTotal;
|
|
1837
|
+
checkout.subTotalFull = subTotalFull;
|
|
1838
|
+
checkout.taxes = taxes;
|
|
1839
|
+
checkout.total = total;
|
|
1840
|
+
return checkout;
|
|
1841
|
+
}
|
|
1842
|
+
async function setDiscountCode(discountCode, checkout, market, locale) {
|
|
1843
|
+
const discounts = [];
|
|
1844
|
+
if (discountCode === "shipping") {
|
|
1845
|
+
discounts.push({
|
|
1846
|
+
"id": "shipping",
|
|
1847
|
+
"name": "shipping",
|
|
1848
|
+
"abstract": "Free shipping",
|
|
1849
|
+
"price": (checkout.delivery?.price || 0) * -1,
|
|
1850
|
+
"validFrom": /* @__PURE__ */ new Date(),
|
|
1851
|
+
"validTo": /* @__PURE__ */ new Date()
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
if (discountCode === "coupon10") {
|
|
1855
|
+
discounts.push({
|
|
1856
|
+
"id": "coupon10",
|
|
1857
|
+
"name": "coupon10",
|
|
1858
|
+
"abstract": "10%",
|
|
1859
|
+
"price": (checkout.items?.reduce((p, c) => p + c.price * c.qty * 0.1, 0) || 0) * -1,
|
|
1860
|
+
"validFrom": /* @__PURE__ */ new Date(),
|
|
1861
|
+
"validTo": /* @__PURE__ */ new Date()
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
if (discountCode === "coupon50") {
|
|
1865
|
+
discounts.push({
|
|
1866
|
+
"id": "coupon50",
|
|
1867
|
+
"name": "coupon50",
|
|
1868
|
+
"abstract": "50%",
|
|
1869
|
+
"price": (checkout.items?.reduce((p, c) => p + c.price * c.qty * 0.5, 0) || 0) * -1,
|
|
1870
|
+
"validFrom": /* @__PURE__ */ new Date(),
|
|
1871
|
+
"validTo": /* @__PURE__ */ new Date()
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
return await updateCheckout({ ...checkout, discounts }, "discount", market, locale);
|
|
1875
|
+
}
|
|
1876
|
+
async function getPayment(checkout, market, locale) {
|
|
1877
|
+
const knownRoutes = await getRoutesForSchemas(["checkout_result"], market, locale);
|
|
1878
|
+
const redirectUrl = `${knownRoutes.checkout_result}?orderId=1&status=OK`;
|
|
1879
|
+
return { redirectUrl };
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
// src/feature_type/feature_type.service.ts
|
|
1883
|
+
import { getStore as getStore6 } from "@websolutespa/bom-mixer-store";
|
|
1884
|
+
async function getFeatureTypes(params = {}) {
|
|
1885
|
+
const store = await getStore6();
|
|
1886
|
+
const items = await store.feature_type.findMany(params);
|
|
1887
|
+
return items;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
// src/label/label.service.ts
|
|
1891
|
+
import { getStore as getStore7 } from "@websolutespa/bom-mixer-store";
|
|
1892
|
+
async function getLabels(params = {}) {
|
|
1893
|
+
const store = await getStore7();
|
|
1894
|
+
const items = await store.label.findMany(params);
|
|
1895
|
+
return items;
|
|
1896
|
+
}
|
|
1897
|
+
function resolveLabel(labels, id) {
|
|
1898
|
+
const label = labels.find((x) => x.id === id);
|
|
1899
|
+
return label && label.text ? label.text.toString() : id;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
// src/locale/locale.service.ts
|
|
1903
|
+
import { getStore as getStore8 } from "@websolutespa/bom-mixer-store";
|
|
1904
|
+
async function getLocales(params = {}) {
|
|
1905
|
+
const store = await getStore8();
|
|
1906
|
+
const items = await store.locale.findMany(params);
|
|
1907
|
+
return items;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
// src/market/market.service.ts
|
|
1911
|
+
import { getStore as getStore9 } from "@websolutespa/bom-mixer-store";
|
|
1912
|
+
async function getMarkets(params = {}) {
|
|
1913
|
+
const store = await getStore9();
|
|
1914
|
+
const items = await store.market.findMany(params);
|
|
1915
|
+
return items;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
// src/layout/layout.service.ts
|
|
1919
|
+
async function getLayout(market, locale) {
|
|
1920
|
+
const markets = await getMarkets({ locale });
|
|
1921
|
+
const locales = await getLocales({ locale });
|
|
1922
|
+
const labels = await getLabels({ locale });
|
|
1923
|
+
const tree = await getRouteLinkTree(market, locale);
|
|
1924
|
+
const firstLevelRoutes = tree?.items || [];
|
|
1925
|
+
const flatTopLevelRoutes = tree ? [tree, ...firstLevelRoutes] : [];
|
|
1926
|
+
const topLevelRoutes = flatTopLevelRoutes.reduce((object, route) => {
|
|
1927
|
+
object[route.id] = route;
|
|
1928
|
+
return object;
|
|
1929
|
+
}, {});
|
|
1930
|
+
const topLevelHrefs = flatTopLevelRoutes.reduce((object, route) => {
|
|
1931
|
+
if (route.href) {
|
|
1932
|
+
object[route.id] = route.href;
|
|
1933
|
+
}
|
|
1934
|
+
return object;
|
|
1935
|
+
}, {});
|
|
1936
|
+
const navs = {
|
|
1937
|
+
primary: tree && tree.items ? tree.items : [],
|
|
1938
|
+
secondary: [],
|
|
1939
|
+
footer: []
|
|
1940
|
+
};
|
|
1941
|
+
return {
|
|
1942
|
+
markets,
|
|
1943
|
+
market,
|
|
1944
|
+
locales,
|
|
1945
|
+
locale,
|
|
1946
|
+
labels,
|
|
1947
|
+
tree,
|
|
1948
|
+
navs,
|
|
1949
|
+
topLevelRoutes,
|
|
1950
|
+
topLevelHrefs
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
// src/list/list.service.ts
|
|
1955
|
+
import { getStore as getStore10 } from "@websolutespa/bom-mixer-store";
|
|
1956
|
+
async function getLists(locale) {
|
|
1957
|
+
const store = await getStore10();
|
|
1958
|
+
const items = await store.list.findMany({ locale });
|
|
1959
|
+
return items;
|
|
1960
|
+
}
|
|
1961
|
+
async function getListByKeys(keys, locale) {
|
|
1962
|
+
const store = await getStore10();
|
|
1963
|
+
const items = await store.list.findMany({ locale });
|
|
1964
|
+
const lists = {};
|
|
1965
|
+
items.filter((x) => x.key && keys.includes(x.key)).forEach((x) => {
|
|
1966
|
+
lists[x.key] = items.filter((i) => i.listId === x.id);
|
|
1967
|
+
});
|
|
1968
|
+
return lists;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
// src/menu/menu.service.ts
|
|
1972
|
+
import { getStore as getStore11 } from "@websolutespa/bom-mixer-store";
|
|
1973
|
+
async function getMenu(id) {
|
|
1974
|
+
const store = await getStore11();
|
|
1975
|
+
const item = await store.menu.findOne({
|
|
1976
|
+
where: {
|
|
1977
|
+
id: {
|
|
1978
|
+
equals: id
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
});
|
|
1982
|
+
return item;
|
|
1983
|
+
}
|
|
1984
|
+
async function getMenus() {
|
|
1985
|
+
const store = await getStore11();
|
|
1986
|
+
const items = await store.menu.findMany();
|
|
1987
|
+
return items;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
// src/order/order.ts
|
|
1991
|
+
var IOrderStatus = {
|
|
1992
|
+
Pending: "pending",
|
|
1993
|
+
// Customer started the checkout process but did not complete it. Incomplete orders are assigned a "Pending" status and can be found under the More tab in the View Orders screen.
|
|
1994
|
+
AwaitingPayment: "awaitingPayment",
|
|
1995
|
+
// Customer has completed the checkout process, but payment has yet to be confirmed. Authorize only transactions that are not yet captured have this status.
|
|
1996
|
+
AwaitingFulfillment: "awaitingFulfillment",
|
|
1997
|
+
// Customer has completed the checkout process and payment has been confirmed.
|
|
1998
|
+
AwaitingShipment: "awaitingShipment",
|
|
1999
|
+
// Order has been pulled and packaged and is awaiting collection from a shipping provider.
|
|
2000
|
+
AwaitingPickup: "awaitingPickup",
|
|
2001
|
+
// Order has been packaged and is awaiting customer pickup from a seller-specified location.
|
|
2002
|
+
PartiallyShipped: "partiallyShipped",
|
|
2003
|
+
// Only some items in the order have been shipped.
|
|
2004
|
+
Completed: "completed",
|
|
2005
|
+
// Order has been shipped/picked up, and receipt is confirmed; client has paid for their digital product, and their file(s) are available for download.
|
|
2006
|
+
Shipped: "shipped",
|
|
2007
|
+
// Order has been shipped, but receipt has not been confirmed; seller has used the Ship Items action. A listing of all orders with a "Shipped" status can be found under the More tab of the View Orders screen.
|
|
2008
|
+
Cancelled: "cancelled",
|
|
2009
|
+
// Seller has cancelled an order, due to a stock inconsistency or other reasons. Stock levels will automatically update depending on your Inventory Settings. Cancelling an order will not refund the order. This status is triggered automatically when an order using an authorize-only payment gateway is voided in the control panel before capturing payment.
|
|
2010
|
+
Declined: "declined",
|
|
2011
|
+
// Seller has marked the order as declined.
|
|
2012
|
+
Refunded: "refunded",
|
|
2013
|
+
// Seller has used the Refund action to refund the whole order. A listing of all orders with a "Refunded" status can be found under the More tab of the View Orders screen.
|
|
2014
|
+
Disputed: "disputed",
|
|
2015
|
+
// Customer has initiated a dispute resolution process for the PayPal transaction that paid for the order or the seller has marked the order as a fraudulent order.
|
|
2016
|
+
ManualVerificationRequired: "manualVerificationRequired",
|
|
2017
|
+
// Order on hold while some aspect, such as tax-exempt documentation, is manually confirmed. Orders with this status must be updated manually. Capturing funds or other order actions will not automatically update the status of an order marked Manual Verification Required.
|
|
2018
|
+
PartiallyRefunded: "partiallyRefunded"
|
|
2019
|
+
// Seller has partially refunded the order.
|
|
2020
|
+
};
|
|
2021
|
+
|
|
2022
|
+
// ../mock/src/order.json
|
|
2023
|
+
var order_default = {
|
|
2024
|
+
items: [
|
|
2025
|
+
{
|
|
2026
|
+
id: 1,
|
|
2027
|
+
date: "2022-10-25T10:59:54.420Z",
|
|
2028
|
+
status: "awaitingFulfillment",
|
|
2029
|
+
items: [
|
|
2030
|
+
{
|
|
2031
|
+
title: "Cabinet Large dark oak",
|
|
2032
|
+
media: {
|
|
2033
|
+
type: "image",
|
|
2034
|
+
src: "/assets/shop_detail/2693_n_Cabinet_large_dark_oak_440px_a.jpg"
|
|
2035
|
+
},
|
|
2036
|
+
category: "shop_category_furniture",
|
|
2037
|
+
collection: "Accents Accessories",
|
|
2038
|
+
designer: "Oeo Studio",
|
|
2039
|
+
categoryName: "Accents Accessories by Oeo Studio",
|
|
2040
|
+
description: "<p>Mobiletto in legno di rovere e cinghie in pelle da appendere a Rack 72/192.</p> <p>Colore: Rovere scuro + Pelle conciata al vegetale<br />Misure: 14,7 x 48 x 40,5 (H) cm</p>",
|
|
2041
|
+
price: 2318.4,
|
|
2042
|
+
availability: 6,
|
|
2043
|
+
slug: "cabinet-large-dark-oak",
|
|
2044
|
+
id: 156,
|
|
2045
|
+
schema: "shop_detail",
|
|
2046
|
+
href: "/ww/en/shop/furniture/cabinet-large-dark-oak",
|
|
2047
|
+
qty: 1,
|
|
2048
|
+
fullPrice: 2576
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
media: {
|
|
2052
|
+
type: "image",
|
|
2053
|
+
src: "/assets/shop_detail/2697_n_Cabinet-Large-Light-oak-Vegetable-tanned-leather-14,7-x-48-x-40,5-H-cm_DETTAGLIO.jpg"
|
|
2054
|
+
},
|
|
2055
|
+
category: "shop_category_furniture",
|
|
2056
|
+
collection: "Accents Accessories",
|
|
2057
|
+
designer: "Oeo Studio",
|
|
2058
|
+
categoryName: "Accents Accessories by Oeo Studio",
|
|
2059
|
+
title: "Cabinet Large light oak",
|
|
2060
|
+
price: 2318.4,
|
|
2061
|
+
availability: 6,
|
|
2062
|
+
slug: "cabinet-large-light-oak",
|
|
2063
|
+
id: 157,
|
|
2064
|
+
schema: "shop_detail",
|
|
2065
|
+
href: "/ww/en/shop/furniture/cabinet-large-light-oak",
|
|
2066
|
+
qty: 1,
|
|
2067
|
+
fullPrice: 2576
|
|
2068
|
+
}
|
|
2069
|
+
],
|
|
2070
|
+
user: {
|
|
2071
|
+
id: 1,
|
|
2072
|
+
schema: "user",
|
|
2073
|
+
firstName: "Jhon",
|
|
2074
|
+
lastName: "Appleseed",
|
|
2075
|
+
email: "jhon.appleseed@gmail.com"
|
|
2076
|
+
},
|
|
2077
|
+
shippingAddress: {
|
|
2078
|
+
firstName: "Jhon",
|
|
2079
|
+
lastName: "Appleseed",
|
|
2080
|
+
email: "jhon.appleseed@gmail.com",
|
|
2081
|
+
phoneNumber: "0721411112",
|
|
2082
|
+
country: {
|
|
2083
|
+
id: "it",
|
|
2084
|
+
name: "Italy"
|
|
2085
|
+
},
|
|
2086
|
+
region: {
|
|
2087
|
+
id: 10,
|
|
2088
|
+
name: "Marche"
|
|
2089
|
+
},
|
|
2090
|
+
province: {
|
|
2091
|
+
id: 175,
|
|
2092
|
+
name: "Pesaro Urbino"
|
|
2093
|
+
},
|
|
2094
|
+
address: "Strada della Campanara",
|
|
2095
|
+
streetNumber: "15",
|
|
2096
|
+
zipCode: "61122",
|
|
2097
|
+
city: "Pesaro"
|
|
2098
|
+
},
|
|
2099
|
+
hasInvoice: true,
|
|
2100
|
+
hasBilling: false,
|
|
2101
|
+
delivery: {
|
|
2102
|
+
id: 2,
|
|
2103
|
+
name: "Courier delivery",
|
|
2104
|
+
abstract: "Packaged goods are delivered by our trusted forwarder.",
|
|
2105
|
+
price: 81,
|
|
2106
|
+
fullPrice: 81
|
|
2107
|
+
},
|
|
2108
|
+
discounts: [
|
|
2109
|
+
{
|
|
2110
|
+
id: "shipping",
|
|
2111
|
+
name: "shipping",
|
|
2112
|
+
abstract: "Free shipping",
|
|
2113
|
+
price: -81,
|
|
2114
|
+
validFrom: "2022-10-31T09:17:08.309Z",
|
|
2115
|
+
validTo: "2022-10-31T09:17:08.309Z"
|
|
2116
|
+
}
|
|
2117
|
+
],
|
|
2118
|
+
store: {
|
|
2119
|
+
id: 10366,
|
|
2120
|
+
category: {
|
|
2121
|
+
id: "store_category_distributor",
|
|
2122
|
+
name: "Hexagon Distributor"
|
|
2123
|
+
},
|
|
2124
|
+
name: "Di Paolo Arredamenti",
|
|
2125
|
+
address: "Viale Cesare Battisti",
|
|
2126
|
+
streetNumber: "80",
|
|
2127
|
+
zipCode: "64020",
|
|
2128
|
+
city: "Bellante",
|
|
2129
|
+
country: {
|
|
2130
|
+
id: "it",
|
|
2131
|
+
name: "Italy"
|
|
2132
|
+
},
|
|
2133
|
+
phoneNumber: "+39 0861 616436",
|
|
2134
|
+
timetable: [],
|
|
2135
|
+
position: {
|
|
2136
|
+
latitude: 0,
|
|
2137
|
+
longitude: 0
|
|
2138
|
+
},
|
|
2139
|
+
distance: 151.84174300013095,
|
|
2140
|
+
rank: 1
|
|
2141
|
+
},
|
|
2142
|
+
payment: {
|
|
2143
|
+
id: "bank-transfer",
|
|
2144
|
+
name: "Bank Transfer",
|
|
2145
|
+
media: {
|
|
2146
|
+
type: "image",
|
|
2147
|
+
src: "/assets/payment/bank-transfer.svg"
|
|
2148
|
+
}
|
|
2149
|
+
},
|
|
2150
|
+
subTotal: 4636.8,
|
|
2151
|
+
taxes: 927.3600000000001,
|
|
2152
|
+
total: 5564.16,
|
|
2153
|
+
subTotalFull: 5152
|
|
2154
|
+
},
|
|
2155
|
+
{
|
|
2156
|
+
id: 2,
|
|
2157
|
+
date: "2022-08-16T10:59:54.420Z",
|
|
2158
|
+
status: "completed",
|
|
2159
|
+
items: [
|
|
2160
|
+
{
|
|
2161
|
+
title: "Cabinet Large dark oak",
|
|
2162
|
+
media: {
|
|
2163
|
+
type: "image",
|
|
2164
|
+
src: "/assets/shop_detail/2693_n_Cabinet_large_dark_oak_440px_a.jpg"
|
|
2165
|
+
},
|
|
2166
|
+
category: "shop_category_furniture",
|
|
2167
|
+
collection: "Accents Accessories",
|
|
2168
|
+
designer: "Oeo Studio",
|
|
2169
|
+
categoryName: "Accents Accessories by Oeo Studio",
|
|
2170
|
+
description: "<p>Mobiletto in legno di rovere e cinghie in pelle da appendere a Rack 72/192.</p> <p>Colore: Rovere scuro + Pelle conciata al vegetale<br />Misure: 14,7 x 48 x 40,5 (H) cm</p>",
|
|
2171
|
+
price: 2318.4,
|
|
2172
|
+
availability: 6,
|
|
2173
|
+
slug: "cabinet-large-dark-oak",
|
|
2174
|
+
id: 156,
|
|
2175
|
+
schema: "shop_detail",
|
|
2176
|
+
href: "/ww/en/shop/furniture/cabinet-large-dark-oak",
|
|
2177
|
+
qty: 1,
|
|
2178
|
+
fullPrice: 2576
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
media: {
|
|
2182
|
+
type: "image",
|
|
2183
|
+
src: "/assets/shop_detail/2697_n_Cabinet-Large-Light-oak-Vegetable-tanned-leather-14,7-x-48-x-40,5-H-cm_DETTAGLIO.jpg"
|
|
2184
|
+
},
|
|
2185
|
+
category: "shop_category_furniture",
|
|
2186
|
+
collection: "Accents Accessories",
|
|
2187
|
+
designer: "Oeo Studio",
|
|
2188
|
+
categoryName: "Accents Accessories by Oeo Studio",
|
|
2189
|
+
title: "Cabinet Large light oak",
|
|
2190
|
+
price: 2318.4,
|
|
2191
|
+
availability: 6,
|
|
2192
|
+
slug: "cabinet-large-light-oak",
|
|
2193
|
+
id: 157,
|
|
2194
|
+
schema: "shop_detail",
|
|
2195
|
+
href: "/ww/en/shop/furniture/cabinet-large-light-oak",
|
|
2196
|
+
qty: 1,
|
|
2197
|
+
fullPrice: 2576
|
|
2198
|
+
}
|
|
2199
|
+
],
|
|
2200
|
+
user: {
|
|
2201
|
+
id: 1,
|
|
2202
|
+
schema: "user",
|
|
2203
|
+
firstName: "Jhon",
|
|
2204
|
+
lastName: "Appleseed",
|
|
2205
|
+
email: "jhon.appleseed@gmail.com"
|
|
2206
|
+
},
|
|
2207
|
+
shippingAddress: {
|
|
2208
|
+
firstName: "Jhon",
|
|
2209
|
+
lastName: "Appleseed",
|
|
2210
|
+
email: "jhon.appleseed@gmail.com",
|
|
2211
|
+
phoneNumber: "0721411112",
|
|
2212
|
+
country: {
|
|
2213
|
+
id: "it",
|
|
2214
|
+
name: "Italy"
|
|
2215
|
+
},
|
|
2216
|
+
region: {
|
|
2217
|
+
id: 10,
|
|
2218
|
+
name: "Marche"
|
|
2219
|
+
},
|
|
2220
|
+
province: {
|
|
2221
|
+
id: 175,
|
|
2222
|
+
name: "Pesaro Urbino"
|
|
2223
|
+
},
|
|
2224
|
+
address: "Strada della Campanara",
|
|
2225
|
+
streetNumber: "15",
|
|
2226
|
+
zipCode: "61122",
|
|
2227
|
+
city: "Pesaro"
|
|
2228
|
+
},
|
|
2229
|
+
hasInvoice: true,
|
|
2230
|
+
hasBilling: false,
|
|
2231
|
+
delivery: {
|
|
2232
|
+
id: 2,
|
|
2233
|
+
name: "Courier delivery",
|
|
2234
|
+
abstract: "Packaged goods are delivered by our trusted forwarder.",
|
|
2235
|
+
price: 81,
|
|
2236
|
+
fullPrice: 81
|
|
2237
|
+
},
|
|
2238
|
+
discounts: [
|
|
2239
|
+
{
|
|
2240
|
+
id: "shipping",
|
|
2241
|
+
name: "shipping",
|
|
2242
|
+
abstract: "Free shipping",
|
|
2243
|
+
price: -81,
|
|
2244
|
+
validFrom: "2022-10-31T09:17:08.309Z",
|
|
2245
|
+
validTo: "2022-10-31T09:17:08.309Z"
|
|
2246
|
+
}
|
|
2247
|
+
],
|
|
2248
|
+
store: {
|
|
2249
|
+
id: 10366,
|
|
2250
|
+
category: {
|
|
2251
|
+
id: "store_category_distributor",
|
|
2252
|
+
name: "Hexagon Distributor"
|
|
2253
|
+
},
|
|
2254
|
+
name: "Di Paolo Arredamenti",
|
|
2255
|
+
address: "Viale Cesare Battisti",
|
|
2256
|
+
streetNumber: "80",
|
|
2257
|
+
zipCode: "64020",
|
|
2258
|
+
city: "Bellante",
|
|
2259
|
+
country: {
|
|
2260
|
+
id: "it",
|
|
2261
|
+
name: "Italy"
|
|
2262
|
+
},
|
|
2263
|
+
phoneNumber: "+39 0861 616436",
|
|
2264
|
+
timetable: [],
|
|
2265
|
+
position: {
|
|
2266
|
+
latitude: 0,
|
|
2267
|
+
longitude: 0
|
|
2268
|
+
},
|
|
2269
|
+
distance: 151.84174300013095,
|
|
2270
|
+
rank: 1
|
|
2271
|
+
},
|
|
2272
|
+
payment: {
|
|
2273
|
+
id: "bank-transfer",
|
|
2274
|
+
name: "Bank Transfer",
|
|
2275
|
+
media: {
|
|
2276
|
+
type: "image",
|
|
2277
|
+
src: "/assets/payment/bank-transfer.svg"
|
|
2278
|
+
}
|
|
2279
|
+
},
|
|
2280
|
+
subTotal: 4636.8,
|
|
2281
|
+
taxes: 927.3600000000001,
|
|
2282
|
+
total: 5564.16,
|
|
2283
|
+
subTotalFull: 5152
|
|
2284
|
+
}
|
|
2285
|
+
]
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
// src/order/order.service.ts
|
|
2289
|
+
async function getOrders(market, locale) {
|
|
2290
|
+
const knownRoutes = await getRoutesForTemplates(["reserved_area_order_detail"], market, locale);
|
|
2291
|
+
return order_default.items.map((x) => {
|
|
2292
|
+
const orderDetail = {
|
|
2293
|
+
...x,
|
|
2294
|
+
href: `${knownRoutes.reserved_area_order_detail}?orderId=${x.id}`
|
|
2295
|
+
};
|
|
2296
|
+
return orderDetail;
|
|
2297
|
+
});
|
|
2298
|
+
}
|
|
2299
|
+
async function getOrder(id, market, locale) {
|
|
2300
|
+
const knownRoutes = await getRoutesForTemplates(["reserved_area_order_detail"], market, locale);
|
|
2301
|
+
const order = order_default.items.find((x) => String(x.id) === String(id)) || null;
|
|
2302
|
+
if (order) {
|
|
2303
|
+
const orderDetail = {
|
|
2304
|
+
...order,
|
|
2305
|
+
href: `${knownRoutes.reserved_area_order_detail}?orderId=${order.id}`
|
|
2306
|
+
};
|
|
2307
|
+
return orderDetail;
|
|
2308
|
+
}
|
|
2309
|
+
return order;
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
// src/page/page.service.ts
|
|
2313
|
+
import { getStore as getStore12 } from "@websolutespa/bom-mixer-store";
|
|
2314
|
+
async function findPage(schema, params) {
|
|
2315
|
+
const store = await getStore12();
|
|
2316
|
+
const collection = store[schema];
|
|
2317
|
+
if (!collection) {
|
|
2318
|
+
throw `PageService.findPage: Collection not found [${schema}]`;
|
|
2319
|
+
}
|
|
2320
|
+
const page = await collection.findOne(params);
|
|
2321
|
+
if (page) {
|
|
2322
|
+
return page;
|
|
2323
|
+
} else {
|
|
2324
|
+
console.log("PageService.getPage.notfound", schema, params);
|
|
2325
|
+
return;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
async function getPage(schema, id, market, locale) {
|
|
2329
|
+
const store = await getStore12();
|
|
2330
|
+
const page = await findPage(schema, {
|
|
2331
|
+
where: {
|
|
2332
|
+
id: {
|
|
2333
|
+
equals: id
|
|
2334
|
+
}
|
|
2335
|
+
},
|
|
2336
|
+
market,
|
|
2337
|
+
locale
|
|
2338
|
+
});
|
|
2339
|
+
if (page) {
|
|
2340
|
+
const routes = await store.route.findMany({
|
|
2341
|
+
where: {
|
|
2342
|
+
page: {
|
|
2343
|
+
equals: id
|
|
2344
|
+
},
|
|
2345
|
+
schema: {
|
|
2346
|
+
equals: schema
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
});
|
|
2350
|
+
const currentRoute = routes.find((x) => x.market === market && x.locale === locale);
|
|
2351
|
+
if (!currentRoute) {
|
|
2352
|
+
throw "No route found for page " + schema + ":" + id + " in market " + market + " and locale " + locale;
|
|
2353
|
+
}
|
|
2354
|
+
const alternates = routes.filter((x) => x.market !== market || x.locale !== locale);
|
|
2355
|
+
const segments = await getSegments(page);
|
|
2356
|
+
const breadcrumb = await getBreadcrumbFromSegments(segments, market, locale);
|
|
2357
|
+
const parentRoute = breadcrumb.length > 1 ? breadcrumb[breadcrumb.length - 2] : void 0;
|
|
2358
|
+
return {
|
|
2359
|
+
...page,
|
|
2360
|
+
href: currentRoute.id,
|
|
2361
|
+
// !!! route?
|
|
2362
|
+
alternates,
|
|
2363
|
+
breadcrumb,
|
|
2364
|
+
parentRoute
|
|
2365
|
+
};
|
|
2366
|
+
} else {
|
|
2367
|
+
console.log("PageService.getPage.notfound", schema, id, locale);
|
|
2368
|
+
return;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
async function getPageCategory(schema, page, market, locale) {
|
|
2372
|
+
if (!page) {
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
const store = await getStore12();
|
|
2376
|
+
const category = await findPage(schema, {
|
|
2377
|
+
where: {
|
|
2378
|
+
category: {
|
|
2379
|
+
equals: typeof page.category === "object" ? page.category.id : page.category
|
|
2380
|
+
}
|
|
2381
|
+
},
|
|
2382
|
+
market,
|
|
2383
|
+
locale
|
|
2384
|
+
});
|
|
2385
|
+
if (category) {
|
|
2386
|
+
const routes = await store.route.findMany({
|
|
2387
|
+
where: {
|
|
2388
|
+
schema: {
|
|
2389
|
+
equals: schema
|
|
2390
|
+
},
|
|
2391
|
+
page: {
|
|
2392
|
+
equals: category.id
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
});
|
|
2396
|
+
const currentRoute = routes.find((x) => x.market === market && x.locale === locale);
|
|
2397
|
+
if (!currentRoute) {
|
|
2398
|
+
throw "No route found for page " + schema + ":" + category.id + " in market " + market + " and locale " + locale;
|
|
2399
|
+
}
|
|
2400
|
+
return {
|
|
2401
|
+
...category,
|
|
2402
|
+
href: currentRoute.id
|
|
2403
|
+
};
|
|
2404
|
+
} else {
|
|
2405
|
+
console.log("PageService.getPageCategory.notfound", schema, locale);
|
|
2406
|
+
return;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
async function getErrorPageLayout() {
|
|
2410
|
+
const defaultMarket = "ww";
|
|
2411
|
+
const defaultLocale = "en";
|
|
2412
|
+
const layout = await getLayout(defaultMarket, defaultLocale);
|
|
2413
|
+
const title = resolveLabel(layout.labels, "notfound.title");
|
|
2414
|
+
const abstract = resolveLabel(layout.labels, "notfound.abstract");
|
|
2415
|
+
const page = {
|
|
2416
|
+
id: "notfound",
|
|
2417
|
+
schema: "notfound",
|
|
2418
|
+
href: "",
|
|
2419
|
+
alternates: [],
|
|
2420
|
+
breadcrumb: [],
|
|
2421
|
+
title,
|
|
2422
|
+
abstract,
|
|
2423
|
+
category: "homepage",
|
|
2424
|
+
meta: {
|
|
2425
|
+
title,
|
|
2426
|
+
description: abstract,
|
|
2427
|
+
keywords: "",
|
|
2428
|
+
robots: "all"
|
|
2429
|
+
}
|
|
2430
|
+
};
|
|
2431
|
+
return { layout, page };
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
// src/route/route.interceptor.ts
|
|
2435
|
+
var import_server = __toESM(require_server());
|
|
2436
|
+
import { apiPost } from "@websolutespa/bom-mixer-core";
|
|
2437
|
+
async function routeInterceptor(request, next) {
|
|
2438
|
+
let url = request.nextUrl;
|
|
2439
|
+
let route;
|
|
2440
|
+
try {
|
|
2441
|
+
route = await apiPost("/route", { pathname: url.pathname });
|
|
2442
|
+
if (!route) {
|
|
2443
|
+
console.log("routeInterceptor.route.notfound", url.pathname);
|
|
2444
|
+
return;
|
|
2445
|
+
}
|
|
2446
|
+
} catch (error) {
|
|
2447
|
+
console.log("routeInterceptor.error", url.pathname, error, error.url, error.status, error.statusText);
|
|
2448
|
+
return;
|
|
2449
|
+
}
|
|
2450
|
+
url = request.nextUrl.clone();
|
|
2451
|
+
const resolvedPathname = resolveRoute(route);
|
|
2452
|
+
url.pathname = resolvedPathname;
|
|
2453
|
+
const response = import_server.NextResponse.rewrite(url);
|
|
2454
|
+
return response;
|
|
2455
|
+
}
|
|
2456
|
+
export {
|
|
2457
|
+
IOrderStatus,
|
|
2458
|
+
categoryToRouteLink,
|
|
2459
|
+
decorateHref,
|
|
2460
|
+
findPage,
|
|
2461
|
+
getBreadcrumbFromSegments,
|
|
2462
|
+
getCategories,
|
|
2463
|
+
getCountries,
|
|
2464
|
+
getDeliveries,
|
|
2465
|
+
getErrorPageLayout,
|
|
2466
|
+
getFeatureTypes,
|
|
2467
|
+
getInfo,
|
|
2468
|
+
getItems,
|
|
2469
|
+
getLabels,
|
|
2470
|
+
getLayout,
|
|
2471
|
+
getListByKeys,
|
|
2472
|
+
getLists,
|
|
2473
|
+
getLocales,
|
|
2474
|
+
getMarkets,
|
|
2475
|
+
getMenu,
|
|
2476
|
+
getMenus,
|
|
2477
|
+
getOrder,
|
|
2478
|
+
getOrders,
|
|
2479
|
+
getPage,
|
|
2480
|
+
getPageCategory,
|
|
2481
|
+
getPayment,
|
|
2482
|
+
getPayments,
|
|
2483
|
+
getProvinces,
|
|
2484
|
+
getRegions,
|
|
2485
|
+
getRoute,
|
|
2486
|
+
getRouteLinkTree,
|
|
2487
|
+
getRouteSegments,
|
|
2488
|
+
getRoutes,
|
|
2489
|
+
getRoutesForSchemas,
|
|
2490
|
+
getRoutesForTemplates,
|
|
2491
|
+
getSegments,
|
|
2492
|
+
getStaticPathsForSchema,
|
|
2493
|
+
getStores,
|
|
2494
|
+
resolveLabel,
|
|
2495
|
+
resolveRoute,
|
|
2496
|
+
routeInterceptor,
|
|
2497
|
+
setDiscountCode,
|
|
2498
|
+
updateCheckout
|
|
2499
|
+
};
|
|
2500
|
+
/*! Bundled license information:
|
|
2501
|
+
|
|
2502
|
+
next/dist/compiled/cookie/index.js:
|
|
2503
|
+
(*!
|
|
2504
|
+
* cookie
|
|
2505
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
2506
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
2507
|
+
* MIT Licensed
|
|
2508
|
+
*)
|
|
2509
|
+
|
|
2510
|
+
next/dist/compiled/ua-parser-js/ua-parser.js:
|
|
2511
|
+
(*!@license
|
|
2512
|
+
* UAParser.js v0.7.28
|
|
2513
|
+
* Lightweight JavaScript-based User-Agent string parser
|
|
2514
|
+
* https://github.com/faisalman/ua-parser-js
|
|
2515
|
+
*
|
|
2516
|
+
* Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
|
|
2517
|
+
* Licensed under MIT License
|
|
2518
|
+
*)
|
|
2519
|
+
*/
|