@soma-vertical-web/multi-lib 1.0.19 → 1.0.21
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/contexts/contexts/Session.d.ts +1 -1
- package/contexts/contexts/plp/FilterContext.d.ts +1 -1
- package/contexts/contexts/plp/PLPContext.d.ts +1 -1
- package/contexts/contexts/search/Facets.d.ts +1 -1
- package/contexts/contexts/search/Search.d.ts +1 -1
- package/contexts/hooks/useSimilars.d.ts +7 -0
- package/contexts/index.d.ts +5 -5
- package/data/api/checkout/order-form/shipping/update/index.d.ts +2 -2
- package/data/api/user/index.d.ts +3 -0
- package/data/helpers/plp/index.d.ts +2 -2
- package/data/helpers/search/facets.d.ts +0 -1
- package/data/helpers/search/index.d.ts +0 -4
- package/data/helpers/search/search.d.ts +0 -1
- package/data/index.d.ts +0 -2
- package/index-BhiCzrut.mjs +2255 -0
- package/index-CpUjW-m9.mjs +1877 -0
- package/index-DZ1MbO8M.js +4 -0
- package/index-xWhZ_YcF.js +4 -0
- package/index.js +17 -17
- package/index.mjs +12132 -14158
- package/index2.js +8 -1
- package/index2.mjs +2345 -1215
- package/layout/index.d.ts +4 -2
- package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
- package/layout/template/PDC/PDC.d.ts +1 -1
- package/layout/template/PDC/index.d.ts +1 -1
- package/layout/template/TrackingRouteWatcher/index.d.ts +5 -0
- package/package.json +1 -1
- package/server.d.ts +2 -4
- package/types/contexts/contexts/plp.d.ts +8 -42
- package/types/contexts/contexts/search.d.ts +15 -34
- package/types/contexts/contexts/session.d.ts +1 -0
- package/types/layout/team-components/PLPNavigation/index.d.ts +2 -0
- package/types/layout/templates/PLP/index.d.ts +2 -2
package/index2.mjs
CHANGED
|
@@ -1,1846 +1,2976 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { Utils as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as N, jsxs as K, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import { F as $, y as se, S as Pt, G as St, H as Ct, a as xt, j as kt, m as Et, r as At, q as Tt, k as Ve, n as Ot, o as qt, l as Nt, D as jt, C as Ft, I as $t, p as Lt, A as Re, J as Dt, K as Ut, L as Ht, e as Mt } from "./index-BhiCzrut.mjs";
|
|
3
|
+
import { Utils as le, helpers as ce } from "@soma-vertical-web/core-components";
|
|
4
|
+
import * as c from "yup";
|
|
5
|
+
import Bt from "sanitize-html";
|
|
6
|
+
import { decodeJwt as zt } from "jose";
|
|
7
|
+
const Gt = async ({
|
|
8
|
+
children: e,
|
|
9
|
+
ClientCartProvider: t,
|
|
10
|
+
...r
|
|
10
11
|
}) => {
|
|
11
|
-
const { data:
|
|
12
|
+
const { data: n } = await $(
|
|
12
13
|
"mini_cart",
|
|
13
|
-
|
|
14
|
+
r
|
|
14
15
|
);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
},
|
|
17
|
-
slug:
|
|
18
|
-
data:
|
|
19
|
-
SectionZone:
|
|
20
|
-
COMMON_PAGE_COLUMN_GAP:
|
|
21
|
-
identifyWhoIsFirst:
|
|
16
|
+
return /* @__PURE__ */ N(t, { ...n ? Array.isArray(n) ? { data: n[0] } : { data: n } : {}, children: e });
|
|
17
|
+
}, Vt = ({
|
|
18
|
+
slug: e,
|
|
19
|
+
data: t,
|
|
20
|
+
SectionZone: r,
|
|
21
|
+
COMMON_PAGE_COLUMN_GAP: n,
|
|
22
|
+
identifyWhoIsFirst: i
|
|
22
23
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
(
|
|
25
|
-
var
|
|
26
|
-
return ((
|
|
27
|
-
}
|
|
28
|
-
),
|
|
29
|
-
(
|
|
30
|
-
var
|
|
31
|
-
return ((
|
|
32
|
-
}
|
|
33
|
-
),
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
24
|
+
const a = t == null ? void 0 : t.find(
|
|
25
|
+
(u) => {
|
|
26
|
+
var w, v, y, _;
|
|
27
|
+
return ((v = (w = u.config) == null ? void 0 : w.responsive) == null ? void 0 : v.deviceType) === "desktop" && ((_ = (y = u.config) == null ? void 0 : y.seo) == null ? void 0 : _.slug) === e;
|
|
28
|
+
}
|
|
29
|
+
), s = a == null ? void 0 : a.config.responsive.gapCustom, o = a == null ? void 0 : a.config.responsive.gapSections, d = t == null ? void 0 : t.find(
|
|
30
|
+
(u) => {
|
|
31
|
+
var w, v, y, _;
|
|
32
|
+
return ((v = (w = u.config) == null ? void 0 : w.responsive) == null ? void 0 : v.deviceType) === "mobile" && ((_ = (y = u.config) == null ? void 0 : y.seo) == null ? void 0 : _.slug) === e;
|
|
33
|
+
}
|
|
34
|
+
), g = d == null ? void 0 : d.config.responsive.gapCustom, l = d == null ? void 0 : d.config.responsive.gapSections;
|
|
35
|
+
return /* @__PURE__ */ K(me, { children: [
|
|
36
|
+
/* @__PURE__ */ N(
|
|
37
|
+
le.Column,
|
|
37
38
|
{
|
|
38
|
-
gap:
|
|
39
|
-
className:
|
|
40
|
-
|
|
39
|
+
gap: s && o ? o : n,
|
|
40
|
+
className: ce.classNameConcat(
|
|
41
|
+
se["responsive-desktop-flex"],
|
|
41
42
|
"utils-column-modifier"
|
|
42
43
|
),
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ N(r, { data: (a == null ? void 0 : a.sections) ?? [], identifyWhoIsFirst: i })
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
47
|
+
/* @__PURE__ */ N(
|
|
48
|
+
le.Column,
|
|
48
49
|
{
|
|
49
|
-
gap:
|
|
50
|
-
className:
|
|
51
|
-
|
|
50
|
+
gap: g && l ? l : n,
|
|
51
|
+
className: ce.classNameConcat(
|
|
52
|
+
se["responsive-mobile-flex"],
|
|
52
53
|
"utils-column-modifier"
|
|
53
54
|
),
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ N(r, { data: (d == null ? void 0 : d.sections) ?? [], identifyWhoIsFirst: i })
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
58
|
] });
|
|
58
|
-
},
|
|
59
|
-
slug:
|
|
60
|
-
SectionZone:
|
|
61
|
-
COMMON_PAGE_COLUMN_GAP:
|
|
62
|
-
identifyWhoIsFirst:
|
|
63
|
-
...
|
|
59
|
+
}, Wt = async ({
|
|
60
|
+
slug: e,
|
|
61
|
+
SectionZone: t,
|
|
62
|
+
COMMON_PAGE_COLUMN_GAP: r,
|
|
63
|
+
identifyWhoIsFirst: n = !1,
|
|
64
|
+
...i
|
|
64
65
|
}) => {
|
|
65
|
-
const { data:
|
|
66
|
+
const { data: a } = await $(
|
|
66
67
|
"common_page",
|
|
67
|
-
|
|
68
|
+
i
|
|
68
69
|
);
|
|
69
|
-
return !
|
|
70
|
-
|
|
70
|
+
return !a || !Array.isArray(a) || a.length === 0 ? null : /* @__PURE__ */ N(
|
|
71
|
+
Vt,
|
|
71
72
|
{
|
|
72
|
-
data:
|
|
73
|
-
slug:
|
|
74
|
-
SectionZone:
|
|
75
|
-
COMMON_PAGE_COLUMN_GAP:
|
|
76
|
-
identifyWhoIsFirst:
|
|
73
|
+
data: a,
|
|
74
|
+
slug: e,
|
|
75
|
+
SectionZone: t,
|
|
76
|
+
COMMON_PAGE_COLUMN_GAP: r,
|
|
77
|
+
identifyWhoIsFirst: n
|
|
77
78
|
}
|
|
78
79
|
);
|
|
79
|
-
},
|
|
80
|
-
children:
|
|
81
|
-
ClientFlagsAndTagsProvider:
|
|
82
|
-
...
|
|
80
|
+
}, Qt = async ({
|
|
81
|
+
children: e,
|
|
82
|
+
ClientFlagsAndTagsProvider: t,
|
|
83
|
+
...r
|
|
83
84
|
}) => {
|
|
84
|
-
const { data:
|
|
85
|
+
const { data: n } = await $(
|
|
85
86
|
"flags_and_tags",
|
|
86
|
-
|
|
87
|
+
r
|
|
87
88
|
);
|
|
88
|
-
return !
|
|
89
|
-
},
|
|
90
|
-
className:
|
|
91
|
-
PAYMENT_FLAGS_DICTIONARY:
|
|
92
|
-
PAYMENT_FLAGS:
|
|
93
|
-
LEGAL_INFORMATION_TEXT:
|
|
94
|
-
ICONS:
|
|
95
|
-
SectionZone:
|
|
96
|
-
Footer:
|
|
97
|
-
FooterSupport:
|
|
98
|
-
hasFooterStamps:
|
|
99
|
-
...
|
|
89
|
+
return !n || !Array.isArray(n) ? null : /* @__PURE__ */ N(t, { data: n[0], children: e });
|
|
90
|
+
}, Xt = async ({
|
|
91
|
+
className: e,
|
|
92
|
+
PAYMENT_FLAGS_DICTIONARY: t,
|
|
93
|
+
PAYMENT_FLAGS: r,
|
|
94
|
+
LEGAL_INFORMATION_TEXT: n,
|
|
95
|
+
ICONS: i,
|
|
96
|
+
SectionZone: a,
|
|
97
|
+
Footer: s,
|
|
98
|
+
FooterSupport: o,
|
|
99
|
+
hasFooterStamps: d,
|
|
100
|
+
...g
|
|
100
101
|
}) => {
|
|
101
|
-
var
|
|
102
|
-
const { data:
|
|
103
|
-
...(
|
|
102
|
+
var v, y, _, p, b, m, h, f, E, q, I;
|
|
103
|
+
const { data: l } = await $("footer", g), u = Array.isArray(l) && ((v = l[0]) == null ? void 0 : v.type) === "footer" ? l[0] : null, w = {
|
|
104
|
+
...(y = u == null ? void 0 : u.paymentInfo) == null ? void 0 : y.paymentInfo,
|
|
104
105
|
acceptedFlags: Array.isArray(
|
|
105
|
-
(
|
|
106
|
-
) ? (
|
|
107
|
-
(
|
|
106
|
+
(_ = u == null ? void 0 : u.paymentInfo) == null ? void 0 : _.paymentInfo.acceptedFlags
|
|
107
|
+
) ? (p = u == null ? void 0 : u.paymentInfo) == null ? void 0 : p.paymentInfo.acceptedFlags.filter((R) => !!t[R]).map(
|
|
108
|
+
(R) => t[R]
|
|
108
109
|
) : []
|
|
109
110
|
};
|
|
110
|
-
return
|
|
111
|
-
|
|
111
|
+
return u ? /* @__PURE__ */ N(
|
|
112
|
+
s,
|
|
112
113
|
{
|
|
113
|
-
className:
|
|
114
|
-
data: { ...
|
|
115
|
-
socialInfo: (
|
|
116
|
-
socialMedias: (
|
|
117
|
-
payments:
|
|
118
|
-
hasFooterStamps:
|
|
114
|
+
className: e,
|
|
115
|
+
data: { ...u },
|
|
116
|
+
socialInfo: (b = u.socialMedia) == null ? void 0 : b.socialMedia,
|
|
117
|
+
socialMedias: (h = (m = u.socialMedia) == null ? void 0 : m.socialMedia) == null ? void 0 : h.medias,
|
|
118
|
+
payments: w,
|
|
119
|
+
hasFooterStamps: d,
|
|
119
120
|
adornment: {
|
|
120
|
-
...(E = (
|
|
121
|
-
bottom: /* @__PURE__ */
|
|
122
|
-
|
|
121
|
+
...(E = (f = u.supportInfo) == null ? void 0 : f.supportInfo) != null && E.content ? {
|
|
122
|
+
bottom: /* @__PURE__ */ N(
|
|
123
|
+
o,
|
|
123
124
|
{
|
|
124
|
-
content: (
|
|
125
|
+
content: (I = (q = u.supportInfo) == null ? void 0 : q.supportInfo) == null ? void 0 : I.content,
|
|
125
126
|
CONSTANTS: {
|
|
126
|
-
ICONS:
|
|
127
|
-
PAYMENT_FLAGS:
|
|
128
|
-
PAYMENT_FLAGS_DICTIONARY:
|
|
127
|
+
ICONS: i,
|
|
128
|
+
PAYMENT_FLAGS: r,
|
|
129
|
+
PAYMENT_FLAGS_DICTIONARY: t
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
)
|
|
132
133
|
} : {},
|
|
133
|
-
...
|
|
134
|
+
...u.sections.length ? { top: /* @__PURE__ */ N(a, { data: u.sections }) } : {}
|
|
134
135
|
},
|
|
135
|
-
LEGAL_INFORMATION_TEXT:
|
|
136
|
-
ICONS:
|
|
136
|
+
LEGAL_INFORMATION_TEXT: n,
|
|
137
|
+
ICONS: i
|
|
137
138
|
}
|
|
138
139
|
) : null;
|
|
139
|
-
},
|
|
140
|
-
children:
|
|
141
|
-
ClientHeaderProvider:
|
|
142
|
-
...
|
|
140
|
+
}, Kt = async ({
|
|
141
|
+
children: e,
|
|
142
|
+
ClientHeaderProvider: t,
|
|
143
|
+
...r
|
|
143
144
|
}) => {
|
|
144
|
-
var
|
|
145
|
-
const { data:
|
|
145
|
+
var a, s, o, d, g, l;
|
|
146
|
+
const { data: n } = await $(
|
|
146
147
|
"header",
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
|
|
148
|
+
r
|
|
149
|
+
), i = Array.isArray(n) ? n[0] : void 0;
|
|
150
|
+
return /* @__PURE__ */ N(
|
|
151
|
+
t,
|
|
151
152
|
{
|
|
152
153
|
headerData: {
|
|
153
|
-
...((
|
|
154
|
-
subMenus: ((
|
|
155
|
-
categories: ((
|
|
156
|
-
navigationLinks: ((
|
|
154
|
+
...((a = i == null ? void 0 : i.layerConfig) == null ? void 0 : a.config) ?? {},
|
|
155
|
+
subMenus: ((s = i == null ? void 0 : i.sections) == null ? void 0 : s.map((u) => u.data)) ?? [],
|
|
156
|
+
categories: ((d = (o = i == null ? void 0 : i.categories) == null ? void 0 : o.categories) == null ? void 0 : d.items) ?? [],
|
|
157
|
+
navigationLinks: ((l = (g = i == null ? void 0 : i.navigationLinks) == null ? void 0 : g.navigationLinks) == null ? void 0 : l.items) ?? []
|
|
157
158
|
},
|
|
158
|
-
children:
|
|
159
|
+
children: e
|
|
159
160
|
}
|
|
160
161
|
);
|
|
161
|
-
},
|
|
162
|
-
var
|
|
163
|
-
const
|
|
164
|
-
if ((
|
|
162
|
+
}, Jt = (e) => {
|
|
163
|
+
var s, o;
|
|
164
|
+
const t = (o = (s = e[0]) == null ? void 0 : s.items) == null ? void 0 : o.items;
|
|
165
|
+
if ((t == null ? void 0 : t.items.length) === 0 || e.length === 0)
|
|
165
166
|
return {
|
|
166
167
|
iconLabel: "",
|
|
167
168
|
label: "",
|
|
168
169
|
content: []
|
|
169
170
|
};
|
|
170
|
-
const
|
|
171
|
-
(
|
|
172
|
-
type:
|
|
173
|
-
id: `${
|
|
174
|
-
title:
|
|
175
|
-
subtitle:
|
|
176
|
-
description:
|
|
177
|
-
buttonLabel:
|
|
178
|
-
buttonHref:
|
|
179
|
-
buttonMode:
|
|
180
|
-
buttonSize:
|
|
181
|
-
buttonIcon:
|
|
171
|
+
const r = t == null ? void 0 : t.iconLabel, n = t == null ? void 0 : t.label, i = t == null ? void 0 : t.helpButtonSize, a = t.items.map(
|
|
172
|
+
(d, g) => ({
|
|
173
|
+
type: d.type,
|
|
174
|
+
id: `${g.toString()}-${d.title.toLowerCase()}`,
|
|
175
|
+
title: d.title,
|
|
176
|
+
subtitle: d.subtitle,
|
|
177
|
+
description: d.description,
|
|
178
|
+
buttonLabel: d.buttonLabel,
|
|
179
|
+
buttonHref: d.buttonHref,
|
|
180
|
+
buttonMode: d.buttonMode,
|
|
181
|
+
buttonSize: d.buttonSize,
|
|
182
|
+
buttonIcon: d.buttonIcon
|
|
182
183
|
})
|
|
183
184
|
);
|
|
184
185
|
return {
|
|
185
|
-
iconLabel:
|
|
186
|
-
label:
|
|
187
|
-
helpButtonSize:
|
|
188
|
-
content:
|
|
186
|
+
iconLabel: r,
|
|
187
|
+
label: n,
|
|
188
|
+
helpButtonSize: i,
|
|
189
|
+
content: a
|
|
189
190
|
};
|
|
190
|
-
},
|
|
191
|
-
HelpButton:
|
|
192
|
-
ICONS:
|
|
193
|
-
className:
|
|
194
|
-
...
|
|
191
|
+
}, Zt = async ({
|
|
192
|
+
HelpButton: e,
|
|
193
|
+
ICONS: t,
|
|
194
|
+
className: r,
|
|
195
|
+
...n
|
|
195
196
|
}) => {
|
|
196
|
-
const { data:
|
|
197
|
+
const { data: i } = await $(
|
|
197
198
|
"helpbutton",
|
|
198
|
-
|
|
199
|
+
n
|
|
199
200
|
);
|
|
200
|
-
if (!
|
|
201
|
+
if (!i || !Array.isArray(i) || i.length === 0)
|
|
201
202
|
return null;
|
|
202
|
-
const
|
|
203
|
-
return /* @__PURE__ */
|
|
204
|
-
|
|
203
|
+
const a = Jt(i);
|
|
204
|
+
return /* @__PURE__ */ N(
|
|
205
|
+
e,
|
|
205
206
|
{
|
|
206
|
-
data:
|
|
207
|
-
ICONS:
|
|
208
|
-
className:
|
|
207
|
+
data: a,
|
|
208
|
+
ICONS: t,
|
|
209
|
+
className: r
|
|
209
210
|
}
|
|
210
211
|
);
|
|
211
|
-
},
|
|
212
|
-
SectionZone:
|
|
213
|
-
LPCadastro:
|
|
214
|
-
...
|
|
212
|
+
}, Yt = async ({
|
|
213
|
+
SectionZone: e,
|
|
214
|
+
LPCadastro: t,
|
|
215
|
+
...r
|
|
215
216
|
}) => {
|
|
216
|
-
var
|
|
217
|
-
const { data:
|
|
217
|
+
var d;
|
|
218
|
+
const { data: n } = await $(
|
|
218
219
|
"lp_cadastro",
|
|
219
|
-
|
|
220
|
+
r
|
|
220
221
|
);
|
|
221
|
-
if (!
|
|
222
|
+
if (!n || !Array.isArray(n) || n.length === 0)
|
|
222
223
|
return null;
|
|
223
|
-
const [
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
224
|
+
const [i] = n, a = (i == null ? void 0 : i.sections) || [], s = ((d = i == null ? void 0 : i.content) == null ? void 0 : d.conteúdo) || {}, o = i == null ? void 0 : i.sections;
|
|
225
|
+
return /* @__PURE__ */ K(me, { children: [
|
|
226
|
+
/* @__PURE__ */ N(t, { sections: a, content: s }),
|
|
227
|
+
/* @__PURE__ */ N(e, { data: o })
|
|
227
228
|
] });
|
|
228
|
-
},
|
|
229
|
-
LPLOJAS_TEMPLATE_RETURN_BUTTON:
|
|
230
|
-
ICONS:
|
|
231
|
-
entity:
|
|
232
|
-
showVendor:
|
|
233
|
-
LPStoresClientWrapper:
|
|
234
|
-
...
|
|
229
|
+
}, er = async ({
|
|
230
|
+
LPLOJAS_TEMPLATE_RETURN_BUTTON: e,
|
|
231
|
+
ICONS: t,
|
|
232
|
+
entity: r,
|
|
233
|
+
showVendor: n,
|
|
234
|
+
LPStoresClientWrapper: i,
|
|
235
|
+
...a
|
|
235
236
|
}) => {
|
|
236
|
-
var
|
|
237
|
-
const { data:
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
|
|
237
|
+
var g;
|
|
238
|
+
const { data: s } = await $("lp_lojas", a), d = (g = (Array.isArray(s) ? s : [])[0]) == null ? void 0 : g.config.config;
|
|
239
|
+
return /* @__PURE__ */ N(
|
|
240
|
+
i,
|
|
240
241
|
{
|
|
241
|
-
entity:
|
|
242
|
-
content:
|
|
243
|
-
data:
|
|
244
|
-
showVendor:
|
|
245
|
-
ICONS:
|
|
246
|
-
LPLOJAS_TEMPLATE_RETURN_BUTTON:
|
|
242
|
+
entity: r,
|
|
243
|
+
content: d,
|
|
244
|
+
data: s,
|
|
245
|
+
showVendor: n,
|
|
246
|
+
ICONS: t,
|
|
247
|
+
LPLOJAS_TEMPLATE_RETURN_BUTTON: e
|
|
247
248
|
}
|
|
248
249
|
);
|
|
249
|
-
},
|
|
250
|
-
children:
|
|
251
|
-
productId:
|
|
252
|
-
COMMON_PAGE_COLUMN_GAP:
|
|
253
|
-
SectionZone:
|
|
254
|
-
PDPContentProvider:
|
|
255
|
-
...
|
|
250
|
+
}, tr = async ({
|
|
251
|
+
children: e,
|
|
252
|
+
productId: t,
|
|
253
|
+
COMMON_PAGE_COLUMN_GAP: r,
|
|
254
|
+
SectionZone: n,
|
|
255
|
+
PDPContentProvider: i,
|
|
256
|
+
...a
|
|
256
257
|
}) => {
|
|
257
|
-
const { data:
|
|
258
|
+
const { data: s } = await $(
|
|
258
259
|
"product_page",
|
|
259
|
-
|
|
260
|
+
a
|
|
260
261
|
);
|
|
261
|
-
return !
|
|
262
|
-
|
|
262
|
+
return !s || !Array.isArray(s) || s.length === 0 ? null : /* @__PURE__ */ N(
|
|
263
|
+
i,
|
|
263
264
|
{
|
|
264
|
-
data:
|
|
265
|
-
productId:
|
|
266
|
-
COMMON_PAGE_COLUMN_GAP:
|
|
267
|
-
SectionZone:
|
|
268
|
-
children:
|
|
265
|
+
data: s[0],
|
|
266
|
+
productId: t,
|
|
267
|
+
COMMON_PAGE_COLUMN_GAP: r,
|
|
268
|
+
SectionZone: n,
|
|
269
|
+
children: e
|
|
269
270
|
}
|
|
270
271
|
);
|
|
271
|
-
},
|
|
272
|
+
}, rr = {
|
|
272
273
|
"column-modifier": "_column-modifier_1tqap_1"
|
|
273
|
-
},
|
|
274
|
-
className:
|
|
275
|
-
children:
|
|
276
|
-
slug:
|
|
277
|
-
SectionZone:
|
|
278
|
-
COMMON_PAGE_COLUMN_GAP_PDC:
|
|
279
|
-
PLPContentProvider:
|
|
280
|
-
...
|
|
274
|
+
}, nr = async ({
|
|
275
|
+
className: e,
|
|
276
|
+
children: t,
|
|
277
|
+
slug: r,
|
|
278
|
+
SectionZone: n,
|
|
279
|
+
COMMON_PAGE_COLUMN_GAP_PDC: i,
|
|
280
|
+
PLPContentProvider: a,
|
|
281
|
+
...s
|
|
281
282
|
}) => {
|
|
282
|
-
const { data:
|
|
283
|
+
const { data: o } = await $(
|
|
283
284
|
"categories_page",
|
|
284
|
-
|
|
285
|
+
s
|
|
285
286
|
);
|
|
286
|
-
if (!
|
|
287
|
+
if (!o || !Array.isArray(o))
|
|
287
288
|
return null;
|
|
288
|
-
const
|
|
289
|
-
(
|
|
290
|
-
var
|
|
291
|
-
return ((
|
|
292
|
-
}
|
|
293
|
-
),
|
|
294
|
-
(
|
|
295
|
-
var
|
|
296
|
-
return ((
|
|
297
|
-
}
|
|
298
|
-
),
|
|
299
|
-
(
|
|
300
|
-
var
|
|
301
|
-
return ((
|
|
302
|
-
}
|
|
303
|
-
),
|
|
304
|
-
(
|
|
305
|
-
var
|
|
306
|
-
return ((
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
|
|
289
|
+
const d = o.find(
|
|
290
|
+
(v) => {
|
|
291
|
+
var y, _, p;
|
|
292
|
+
return ((y = v.config) == null ? void 0 : y.seo.slug) === r && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "desktop";
|
|
293
|
+
}
|
|
294
|
+
), g = o.find(
|
|
295
|
+
(v) => {
|
|
296
|
+
var y, _, p;
|
|
297
|
+
return ((y = v.config) == null ? void 0 : y.seo.slug) === r && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "mobile";
|
|
298
|
+
}
|
|
299
|
+
), l = o.find(
|
|
300
|
+
(v) => {
|
|
301
|
+
var y, _, p;
|
|
302
|
+
return ((y = v.config) == null ? void 0 : y.seo.slug) === "default" && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "desktop";
|
|
303
|
+
}
|
|
304
|
+
), u = o.find(
|
|
305
|
+
(v) => {
|
|
306
|
+
var y, _, p;
|
|
307
|
+
return ((y = v.config) == null ? void 0 : y.seo.slug) === "default" && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "mobile";
|
|
308
|
+
}
|
|
309
|
+
), w = Array.isArray(e) ? e : [e];
|
|
310
|
+
return /* @__PURE__ */ K(me, { children: [
|
|
311
|
+
/* @__PURE__ */ N(
|
|
312
|
+
le.Column,
|
|
312
313
|
{
|
|
313
|
-
className:
|
|
314
|
-
|
|
315
|
-
[
|
|
314
|
+
className: ce.classNameConcat(
|
|
315
|
+
se["responsive-desktop-flex"],
|
|
316
|
+
[rr["column-modifier"], ...w]
|
|
316
317
|
),
|
|
317
318
|
style: {
|
|
318
319
|
minHeight: "100vh"
|
|
319
320
|
},
|
|
320
|
-
children: /* @__PURE__ */
|
|
321
|
-
|
|
321
|
+
children: /* @__PURE__ */ N(
|
|
322
|
+
a,
|
|
322
323
|
{
|
|
323
|
-
data:
|
|
324
|
+
data: d ?? l,
|
|
324
325
|
device: "desktop",
|
|
325
|
-
SectionZone:
|
|
326
|
-
COMMON_PAGE_COLUMN_GAP_PDC:
|
|
327
|
-
children:
|
|
326
|
+
SectionZone: n,
|
|
327
|
+
COMMON_PAGE_COLUMN_GAP_PDC: i,
|
|
328
|
+
children: t
|
|
328
329
|
}
|
|
329
330
|
)
|
|
330
331
|
}
|
|
331
332
|
),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
|
|
333
|
+
/* @__PURE__ */ N(le.Column, { className: ce.classNameConcat(se["responsive-mobile-flex"], e), children: /* @__PURE__ */ N(
|
|
334
|
+
a,
|
|
334
335
|
{
|
|
335
|
-
data:
|
|
336
|
+
data: g ?? u,
|
|
336
337
|
device: "mobile",
|
|
337
|
-
SectionZone:
|
|
338
|
-
COMMON_PAGE_COLUMN_GAP_PDC:
|
|
339
|
-
children:
|
|
338
|
+
SectionZone: n,
|
|
339
|
+
COMMON_PAGE_COLUMN_GAP_PDC: i,
|
|
340
|
+
children: t
|
|
340
341
|
}
|
|
341
342
|
) })
|
|
342
343
|
] });
|
|
343
|
-
},
|
|
344
|
-
var
|
|
345
|
-
const { data:
|
|
344
|
+
}, ir = async ({ slug: e, ...t }) => {
|
|
345
|
+
var s, o, d;
|
|
346
|
+
const { data: r } = await $(
|
|
346
347
|
"redirect_to_search",
|
|
347
|
-
|
|
348
|
+
t
|
|
348
349
|
);
|
|
349
|
-
if (!
|
|
350
|
+
if (!r || !Array.isArray(r))
|
|
350
351
|
return {
|
|
351
|
-
slug:
|
|
352
|
+
slug: e,
|
|
352
353
|
query: null,
|
|
353
354
|
redirect: !1
|
|
354
355
|
};
|
|
355
|
-
const
|
|
356
|
-
if (!!!
|
|
356
|
+
const n = ((d = (o = (s = r[0]) == null ? void 0 : s.redirectToSearch) == null ? void 0 : o.redirectToSearch) == null ? void 0 : d.paths) ?? [];
|
|
357
|
+
if (!!!n.length)
|
|
357
358
|
return {
|
|
358
|
-
slug:
|
|
359
|
+
slug: e,
|
|
359
360
|
query: null,
|
|
360
361
|
redirect: !1
|
|
361
362
|
};
|
|
362
|
-
const
|
|
363
|
-
(
|
|
364
|
-
var
|
|
365
|
-
return ((
|
|
363
|
+
const a = n.find(
|
|
364
|
+
(g) => {
|
|
365
|
+
var l, u;
|
|
366
|
+
return ((l = g.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((u = g.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
|
|
366
367
|
}
|
|
367
368
|
);
|
|
368
|
-
return
|
|
369
|
-
slug:
|
|
370
|
-
query:
|
|
369
|
+
return a ? {
|
|
370
|
+
slug: e,
|
|
371
|
+
query: a == null ? void 0 : a.searchQuery,
|
|
371
372
|
redirect: !0,
|
|
372
|
-
collectionId:
|
|
373
|
-
filters:
|
|
374
|
-
sort:
|
|
373
|
+
collectionId: a == null ? void 0 : a.collectionId,
|
|
374
|
+
filters: a == null ? void 0 : a.filters,
|
|
375
|
+
sort: a == null ? void 0 : a.sort
|
|
375
376
|
} : {
|
|
376
|
-
slug:
|
|
377
|
+
slug: e,
|
|
377
378
|
query: null,
|
|
378
379
|
redirect: !1,
|
|
379
380
|
collectionId: null,
|
|
380
381
|
filters: null,
|
|
381
382
|
sort: null
|
|
382
383
|
};
|
|
383
|
-
},
|
|
384
|
-
var
|
|
385
|
-
const { data:
|
|
384
|
+
}, or = async ({ slug: e, ...t }) => {
|
|
385
|
+
var s, o, d;
|
|
386
|
+
const { data: r } = await $(
|
|
386
387
|
"redirect_to_search",
|
|
387
|
-
|
|
388
|
+
t
|
|
388
389
|
);
|
|
389
|
-
if (!
|
|
390
|
+
if (!r || !Array.isArray(r))
|
|
390
391
|
return null;
|
|
391
|
-
const
|
|
392
|
-
if (!!!
|
|
392
|
+
const n = ((d = (o = (s = r[0]) == null ? void 0 : s.redirectToSearch) == null ? void 0 : o.redirectToSearch) == null ? void 0 : d.paths) ?? [];
|
|
393
|
+
if (!!!n.length)
|
|
393
394
|
return null;
|
|
394
|
-
const
|
|
395
|
-
(
|
|
396
|
-
var
|
|
397
|
-
return ((
|
|
395
|
+
const a = n.find(
|
|
396
|
+
(g) => {
|
|
397
|
+
var l, u;
|
|
398
|
+
return ((l = g.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((u = g.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
|
|
398
399
|
}
|
|
399
400
|
);
|
|
400
|
-
return
|
|
401
|
-
slug:
|
|
402
|
-
title:
|
|
403
|
-
description:
|
|
401
|
+
return a ? {
|
|
402
|
+
slug: e,
|
|
403
|
+
title: a.pageTitle,
|
|
404
|
+
description: a.pageDescription
|
|
404
405
|
} : null;
|
|
405
|
-
},
|
|
406
|
-
children:
|
|
407
|
-
SectionZone:
|
|
408
|
-
className:
|
|
409
|
-
...
|
|
406
|
+
}, ar = async ({
|
|
407
|
+
children: e,
|
|
408
|
+
SectionZone: t,
|
|
409
|
+
className: r,
|
|
410
|
+
...n
|
|
410
411
|
}) => {
|
|
411
|
-
const { data:
|
|
412
|
+
const { data: i } = await $(
|
|
412
413
|
"search_page",
|
|
413
|
-
|
|
414
|
+
n
|
|
414
415
|
);
|
|
415
|
-
return Array.isArray(
|
|
416
|
-
|
|
416
|
+
return Array.isArray(i) && i.length > 0 ? /* @__PURE__ */ N(
|
|
417
|
+
Pt,
|
|
417
418
|
{
|
|
418
|
-
data:
|
|
419
|
-
SectionZone:
|
|
420
|
-
className:
|
|
421
|
-
children:
|
|
422
|
-
}
|
|
423
|
-
) : /* @__PURE__ */
|
|
424
|
-
},
|
|
425
|
-
ClientTipbarContent:
|
|
426
|
-
...
|
|
419
|
+
data: i,
|
|
420
|
+
SectionZone: t,
|
|
421
|
+
className: r,
|
|
422
|
+
children: e
|
|
423
|
+
}
|
|
424
|
+
) : /* @__PURE__ */ N(me, { children: "children" });
|
|
425
|
+
}, sr = async ({
|
|
426
|
+
ClientTipbarContent: e,
|
|
427
|
+
...t
|
|
427
428
|
}) => {
|
|
428
|
-
const { data:
|
|
429
|
+
const { data: r } = await $(
|
|
429
430
|
"tipbar",
|
|
430
|
-
|
|
431
|
+
t
|
|
431
432
|
);
|
|
432
|
-
return /* @__PURE__ */
|
|
433
|
-
},
|
|
434
|
-
CommonPageContent:
|
|
435
|
-
CartContent:
|
|
436
|
-
FlagsAndTagsContent:
|
|
437
|
-
HeaderContent:
|
|
438
|
-
TipbarContent:
|
|
439
|
-
FooterContent:
|
|
440
|
-
PLPContent:
|
|
441
|
-
PDPContent:
|
|
442
|
-
getRedirectData:
|
|
443
|
-
getPLPSynteticMetaData:
|
|
444
|
-
SearchPageContent:
|
|
445
|
-
HelpButtonContent:
|
|
446
|
-
LPCadastroContent:
|
|
447
|
-
LPLojasContent:
|
|
448
|
-
},
|
|
449
|
-
const { method:
|
|
450
|
-
return fetch(
|
|
451
|
-
method:
|
|
433
|
+
return /* @__PURE__ */ N(e, { data: r });
|
|
434
|
+
}, lr = {
|
|
435
|
+
CommonPageContent: Wt,
|
|
436
|
+
CartContent: Gt,
|
|
437
|
+
FlagsAndTagsContent: Qt,
|
|
438
|
+
HeaderContent: Kt,
|
|
439
|
+
TipbarContent: sr,
|
|
440
|
+
FooterContent: Xt,
|
|
441
|
+
PLPContent: nr,
|
|
442
|
+
PDPContent: tr,
|
|
443
|
+
getRedirectData: ir,
|
|
444
|
+
getPLPSynteticMetaData: or,
|
|
445
|
+
SearchPageContent: ar,
|
|
446
|
+
HelpButtonContent: Zt,
|
|
447
|
+
LPCadastroContent: Yt,
|
|
448
|
+
LPLojasContent: er
|
|
449
|
+
}, vi = { Components: lr }, T = async (e, t = {}) => {
|
|
450
|
+
const { method: r = "GET", body: n, headers: i = {}, priority: a = "auto", cache: s = "default" } = t;
|
|
451
|
+
return fetch(e, {
|
|
452
|
+
method: r,
|
|
452
453
|
headers: {
|
|
453
|
-
...
|
|
454
|
+
...i,
|
|
454
455
|
Accept: "application/json",
|
|
455
456
|
"Content-Type": "application/json"
|
|
456
457
|
},
|
|
457
|
-
priority:
|
|
458
|
-
cache:
|
|
459
|
-
...
|
|
458
|
+
priority: a,
|
|
459
|
+
cache: s,
|
|
460
|
+
...n ? { body: JSON.stringify(n) } : {}
|
|
460
461
|
// not body in get
|
|
461
|
-
}).then((
|
|
462
|
-
console.error("[ERROR FETCH VTEX]",
|
|
462
|
+
}).then((o) => o.json()).catch((o) => {
|
|
463
|
+
console.error("[ERROR FETCH VTEX]", o);
|
|
463
464
|
});
|
|
464
|
-
},
|
|
465
|
-
async function
|
|
466
|
-
var
|
|
465
|
+
}, X = /* @__PURE__ */ new Map();
|
|
466
|
+
async function cr(e, t = {}) {
|
|
467
|
+
var r;
|
|
467
468
|
try {
|
|
468
|
-
const { abort:
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
...
|
|
472
|
-
...
|
|
469
|
+
const { abort: n = !1 } = t, i = new AbortController();
|
|
470
|
+
n && (X.has(e) && ((r = X.get(e)) == null || r.abort(), X.delete(e)), X.set(e, i));
|
|
471
|
+
const a = T(e, {
|
|
472
|
+
...t,
|
|
473
|
+
...n ? { signal: i.signal } : {}
|
|
473
474
|
});
|
|
474
|
-
return
|
|
475
|
-
} catch (
|
|
476
|
-
if (
|
|
477
|
-
console.log(`[REQUEST CANCELLED]: ${
|
|
475
|
+
return n && X.delete(e), a;
|
|
476
|
+
} catch (n) {
|
|
477
|
+
if (n.name === "AbortError") {
|
|
478
|
+
console.log(`[REQUEST CANCELLED]: ${e}`);
|
|
478
479
|
return;
|
|
479
480
|
}
|
|
480
|
-
throw console.error(`[ERROR API]: ${
|
|
481
|
+
throw console.error(`[ERROR API]: ${n.message}`), n;
|
|
481
482
|
}
|
|
482
483
|
}
|
|
483
|
-
const
|
|
484
|
-
country:
|
|
485
|
-
postalCode:
|
|
484
|
+
const ur = c.object({
|
|
485
|
+
country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
486
|
+
postalCode: c.string().nullable()
|
|
486
487
|
});
|
|
487
|
-
async function
|
|
488
|
-
if (!
|
|
488
|
+
async function dr({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
489
|
+
if (!t) {
|
|
489
490
|
console.error("[ERROR FETCHING] Body is required");
|
|
490
491
|
return;
|
|
491
492
|
}
|
|
492
|
-
await
|
|
493
|
-
const { country:
|
|
494
|
-
return await
|
|
495
|
-
`${
|
|
493
|
+
await ur.validate(t);
|
|
494
|
+
const { country: n, postalCode: i } = t;
|
|
495
|
+
return await T(
|
|
496
|
+
`${e}/api/checkout/pub/postal-code/${n}/${i}`,
|
|
496
497
|
{
|
|
497
498
|
method: "POST",
|
|
498
|
-
body:
|
|
499
|
-
...
|
|
499
|
+
body: t,
|
|
500
|
+
...r
|
|
500
501
|
}
|
|
501
502
|
);
|
|
502
503
|
}
|
|
503
|
-
const
|
|
504
|
-
orderFormId:
|
|
505
|
-
sellerCode:
|
|
506
|
-
sellerName:
|
|
504
|
+
const pr = c.object({
|
|
505
|
+
orderFormId: c.string().nullable(),
|
|
506
|
+
sellerCode: c.string().nullable(),
|
|
507
|
+
sellerName: c.string().nullable()
|
|
507
508
|
});
|
|
508
|
-
async function
|
|
509
|
-
apiUrl:
|
|
510
|
-
body:
|
|
511
|
-
fetchOptions:
|
|
509
|
+
async function We({
|
|
510
|
+
apiUrl: e,
|
|
511
|
+
body: t,
|
|
512
|
+
fetchOptions: r
|
|
512
513
|
}) {
|
|
513
|
-
if (!
|
|
514
|
+
if (!t) {
|
|
514
515
|
console.error("[ERROR FETCHING] Body is required");
|
|
515
516
|
return;
|
|
516
517
|
}
|
|
517
|
-
await
|
|
518
|
-
const { orderFormId:
|
|
519
|
-
return
|
|
520
|
-
`${
|
|
518
|
+
await pr.validate(t);
|
|
519
|
+
const { orderFormId: n, sellerCode: i, sellerName: a } = t, s = i ? `${i.trim()} - ${a}` : null;
|
|
520
|
+
return T(
|
|
521
|
+
`${e}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,
|
|
521
522
|
{
|
|
522
523
|
method: "POST",
|
|
523
524
|
body: {
|
|
524
|
-
value:
|
|
525
|
+
value: s
|
|
525
526
|
},
|
|
526
|
-
...
|
|
527
|
+
...r
|
|
527
528
|
}
|
|
528
529
|
);
|
|
529
530
|
}
|
|
530
|
-
const
|
|
531
|
-
orderFormId:
|
|
532
|
-
sellerCode:
|
|
533
|
-
marketingData:
|
|
531
|
+
const mr = c.object({
|
|
532
|
+
orderFormId: c.string().nullable(),
|
|
533
|
+
sellerCode: c.string().nullable(),
|
|
534
|
+
marketingData: c.object()
|
|
534
535
|
});
|
|
535
|
-
async function
|
|
536
|
-
apiUrl:
|
|
537
|
-
body:
|
|
538
|
-
extraData:
|
|
539
|
-
fetchOptions:
|
|
536
|
+
async function Qe({
|
|
537
|
+
apiUrl: e,
|
|
538
|
+
body: t,
|
|
539
|
+
extraData: r = {},
|
|
540
|
+
fetchOptions: n
|
|
540
541
|
}) {
|
|
541
|
-
if (!
|
|
542
|
+
if (!t) {
|
|
542
543
|
console.error("[ERROR FETCHING] Body is required");
|
|
543
544
|
return;
|
|
544
545
|
}
|
|
545
|
-
await
|
|
546
|
-
const { orderFormId:
|
|
547
|
-
utmCampaign:
|
|
548
|
-
utmiCampaign:
|
|
546
|
+
await mr.validate(t);
|
|
547
|
+
const { orderFormId: i, sellerCode: a, marketingData: s } = t, o = a ? {
|
|
548
|
+
utmCampaign: a ? a.toUpperCase() : "",
|
|
549
|
+
utmiCampaign: a ? `${r.VENDOR_CODE}` : "semcodigo"
|
|
549
550
|
} : {};
|
|
550
|
-
return
|
|
551
|
-
`${
|
|
551
|
+
return T(
|
|
552
|
+
`${e}/api/checkout/pub/orderForm/${i}/attachments/marketingData`,
|
|
552
553
|
{
|
|
553
554
|
method: "POST",
|
|
554
555
|
body: {
|
|
555
|
-
...
|
|
556
|
-
...
|
|
556
|
+
...s,
|
|
557
|
+
...o
|
|
557
558
|
},
|
|
558
|
-
...
|
|
559
|
+
...n
|
|
559
560
|
}
|
|
560
561
|
);
|
|
561
562
|
}
|
|
562
|
-
const
|
|
563
|
-
orderFormId:
|
|
564
|
-
sellerCode:
|
|
565
|
-
sellerName:
|
|
563
|
+
const hr = c.object({
|
|
564
|
+
orderFormId: c.string().nullable(),
|
|
565
|
+
sellerCode: c.string().nullable(),
|
|
566
|
+
sellerName: c.string().nullable()
|
|
566
567
|
});
|
|
567
|
-
async function
|
|
568
|
-
if (!
|
|
568
|
+
async function fr({ apiUrl: e, body: t, fetchOptions: r, extraData: n }) {
|
|
569
|
+
if (!t) {
|
|
569
570
|
console.error("[ERROR FETCHING] Body is required");
|
|
570
571
|
return;
|
|
571
572
|
}
|
|
572
|
-
await
|
|
573
|
-
const
|
|
574
|
-
return
|
|
575
|
-
apiUrl:
|
|
573
|
+
await hr.validate(t);
|
|
574
|
+
const i = await We({ apiUrl: e, body: t, fetchOptions: r });
|
|
575
|
+
return Qe({
|
|
576
|
+
apiUrl: e,
|
|
576
577
|
body: {
|
|
577
|
-
...
|
|
578
|
-
marketingData:
|
|
578
|
+
...t,
|
|
579
|
+
marketingData: i == null ? void 0 : i.marketingData
|
|
579
580
|
},
|
|
580
|
-
extraData:
|
|
581
|
-
fetchOptions:
|
|
581
|
+
extraData: n,
|
|
582
|
+
fetchOptions: r
|
|
582
583
|
});
|
|
583
584
|
}
|
|
584
|
-
const
|
|
585
|
-
orderFormId:
|
|
586
|
-
coupon:
|
|
585
|
+
const gr = c.object({
|
|
586
|
+
orderFormId: c.string().nullable(),
|
|
587
|
+
coupon: c.string().nullable()
|
|
587
588
|
});
|
|
588
|
-
async function
|
|
589
|
-
apiUrl:
|
|
590
|
-
body:
|
|
591
|
-
fetchOptions:
|
|
589
|
+
async function br({
|
|
590
|
+
apiUrl: e,
|
|
591
|
+
body: t,
|
|
592
|
+
fetchOptions: r
|
|
592
593
|
}) {
|
|
593
|
-
if (!
|
|
594
|
+
if (!t) {
|
|
594
595
|
console.error("[ERROR FETCHING] Body is required");
|
|
595
596
|
return;
|
|
596
597
|
}
|
|
597
|
-
await
|
|
598
|
-
const { coupon:
|
|
599
|
-
return
|
|
600
|
-
`${
|
|
598
|
+
await gr.validate(t);
|
|
599
|
+
const { coupon: n = "", orderFormId: i } = t;
|
|
600
|
+
return T(
|
|
601
|
+
`${e}/api/checkout/pub/orderForm/${i}/coupons`,
|
|
601
602
|
{
|
|
602
603
|
method: "POST",
|
|
603
|
-
body: { text:
|
|
604
|
-
...
|
|
604
|
+
body: { text: n },
|
|
605
|
+
...r
|
|
605
606
|
}
|
|
606
607
|
);
|
|
607
608
|
}
|
|
608
|
-
const
|
|
609
|
-
appId:
|
|
610
|
-
orderFormId:
|
|
611
|
-
key:
|
|
609
|
+
const wr = c.object({
|
|
610
|
+
appId: c.string().required("App ID is required"),
|
|
611
|
+
orderFormId: c.string().nullable(),
|
|
612
|
+
key: c.array().of(c.string())
|
|
612
613
|
});
|
|
613
|
-
async function
|
|
614
|
-
apiUrl:
|
|
615
|
-
body:
|
|
616
|
-
fetchOptions:
|
|
614
|
+
async function vr({
|
|
615
|
+
apiUrl: e,
|
|
616
|
+
body: t,
|
|
617
|
+
fetchOptions: r
|
|
617
618
|
}) {
|
|
618
|
-
if (!
|
|
619
|
+
if (!t) {
|
|
619
620
|
console.error("[ERROR FETCHING] Body is required");
|
|
620
621
|
return;
|
|
621
622
|
}
|
|
622
|
-
await
|
|
623
|
-
const { appId:
|
|
624
|
-
return
|
|
625
|
-
`${
|
|
623
|
+
await wr.validate(t);
|
|
624
|
+
const { appId: n = "faststore", orderFormId: i, key: a } = t;
|
|
625
|
+
return T(
|
|
626
|
+
`${e}/api/checkout/pub/orderForm/${i}/customData/${n}/${a}`,
|
|
626
627
|
{
|
|
627
628
|
method: "PUT",
|
|
628
|
-
...
|
|
629
|
+
...r
|
|
629
630
|
}
|
|
630
631
|
);
|
|
631
632
|
}
|
|
632
|
-
const
|
|
633
|
-
name:
|
|
634
|
-
content:
|
|
633
|
+
const yr = c.object().shape({
|
|
634
|
+
name: c.string().required("Attachment name is required"),
|
|
635
|
+
content: c.object().nullable()
|
|
635
636
|
});
|
|
636
|
-
var
|
|
637
|
-
const
|
|
638
|
-
attachments: (
|
|
639
|
-
id:
|
|
640
|
-
index:
|
|
641
|
-
quantity:
|
|
642
|
-
seller:
|
|
643
|
-
price:
|
|
644
|
-
}),
|
|
645
|
-
orderFormId:
|
|
646
|
-
orderItems:
|
|
637
|
+
var ze;
|
|
638
|
+
const _r = c.object().shape({
|
|
639
|
+
attachments: (ze = c.array().of(yr)) == null ? void 0 : ze.nullable(),
|
|
640
|
+
id: c.string().required("ID of SKU is required"),
|
|
641
|
+
index: c.number().integer().nullable(),
|
|
642
|
+
quantity: c.number().integer().nullable(),
|
|
643
|
+
seller: c.string().required("Seller is required"),
|
|
644
|
+
price: c.number().integer()
|
|
645
|
+
}), Rr = c.object({
|
|
646
|
+
orderFormId: c.string().required("OrderFormId is required"),
|
|
647
|
+
orderItems: c.array().of(_r)
|
|
647
648
|
});
|
|
648
|
-
async function
|
|
649
|
-
apiUrl:
|
|
650
|
-
body:
|
|
651
|
-
fetchOptions:
|
|
649
|
+
async function Ir({
|
|
650
|
+
apiUrl: e,
|
|
651
|
+
body: t,
|
|
652
|
+
fetchOptions: r
|
|
652
653
|
}) {
|
|
653
|
-
if (!
|
|
654
|
+
if (!t) {
|
|
654
655
|
console.error("[ERROR FETCHING] Body is required");
|
|
655
656
|
return;
|
|
656
657
|
}
|
|
657
|
-
await
|
|
658
|
-
const { orderFormId:
|
|
659
|
-
return
|
|
660
|
-
`${
|
|
658
|
+
await Rr.validate(t);
|
|
659
|
+
const { orderFormId: n, orderItems: i } = t;
|
|
660
|
+
return T(
|
|
661
|
+
`${e}/api/checkout/pub/orderForm/${n}/items`,
|
|
661
662
|
{
|
|
662
663
|
method: "POST",
|
|
663
|
-
body: { orderItems:
|
|
664
|
-
...
|
|
664
|
+
body: { orderItems: i },
|
|
665
|
+
...r
|
|
665
666
|
}
|
|
666
667
|
);
|
|
667
668
|
}
|
|
668
|
-
const
|
|
669
|
-
orderFormId:
|
|
669
|
+
const Pr = c.object({
|
|
670
|
+
orderFormId: c.string().nullable()
|
|
670
671
|
});
|
|
671
|
-
async function
|
|
672
|
-
apiUrl:
|
|
673
|
-
body:
|
|
674
|
-
fetchOptions:
|
|
672
|
+
async function Sr({
|
|
673
|
+
apiUrl: e,
|
|
674
|
+
body: t,
|
|
675
|
+
fetchOptions: r
|
|
675
676
|
}) {
|
|
676
|
-
if (!
|
|
677
|
+
if (!t) {
|
|
677
678
|
console.error("[ERROR FETCHING] Body is required");
|
|
678
679
|
return;
|
|
679
680
|
}
|
|
680
|
-
await
|
|
681
|
-
const { orderFormId:
|
|
682
|
-
return
|
|
683
|
-
`${
|
|
681
|
+
await Pr.validate(t);
|
|
682
|
+
const { orderFormId: n } = t;
|
|
683
|
+
return T(
|
|
684
|
+
`${e}/api/checkout/pub/orderForm/${n}/items/removeAll`,
|
|
684
685
|
{
|
|
685
686
|
method: "POST",
|
|
686
|
-
...
|
|
687
|
+
...r
|
|
687
688
|
}
|
|
688
689
|
);
|
|
689
690
|
}
|
|
690
|
-
const
|
|
691
|
-
name:
|
|
692
|
-
content:
|
|
691
|
+
const Cr = c.object().shape({
|
|
692
|
+
name: c.string().required("Attachment name is required"),
|
|
693
|
+
content: c.object().nullable()
|
|
693
694
|
});
|
|
694
|
-
var
|
|
695
|
-
const
|
|
696
|
-
attachments: (
|
|
697
|
-
id:
|
|
698
|
-
index:
|
|
699
|
-
quantity:
|
|
700
|
-
seller:
|
|
701
|
-
price:
|
|
702
|
-
}),
|
|
703
|
-
orderFormId:
|
|
704
|
-
orderItems:
|
|
695
|
+
var Ge;
|
|
696
|
+
const xr = c.object().shape({
|
|
697
|
+
attachments: (Ge = c.array().of(Cr)) == null ? void 0 : Ge.nullable(),
|
|
698
|
+
id: c.string().required("ID of SKU is required"),
|
|
699
|
+
index: c.number().integer().nullable(),
|
|
700
|
+
quantity: c.number().integer().nullable(),
|
|
701
|
+
seller: c.string().required("Seller is required"),
|
|
702
|
+
price: c.number().integer()
|
|
703
|
+
}), kr = c.object({
|
|
704
|
+
orderFormId: c.string().nullable(),
|
|
705
|
+
orderItems: c.array().of(xr)
|
|
705
706
|
});
|
|
706
|
-
async function
|
|
707
|
-
apiUrl:
|
|
708
|
-
body:
|
|
709
|
-
fetchOptions:
|
|
707
|
+
async function Er({
|
|
708
|
+
apiUrl: e,
|
|
709
|
+
body: t,
|
|
710
|
+
fetchOptions: r
|
|
710
711
|
}) {
|
|
711
|
-
if (!
|
|
712
|
+
if (!t) {
|
|
712
713
|
console.error("[ERROR FETCHING] Body is required");
|
|
713
714
|
return;
|
|
714
715
|
}
|
|
715
|
-
await
|
|
716
|
-
const { orderFormId:
|
|
717
|
-
return
|
|
718
|
-
`${
|
|
716
|
+
await kr.validate(t);
|
|
717
|
+
const { orderFormId: n, orderItems: i } = t;
|
|
718
|
+
return T(
|
|
719
|
+
`${e}/api/checkout/pub/orderForm/${n}/items/update`,
|
|
719
720
|
{
|
|
720
721
|
method: "POST",
|
|
721
|
-
body: { orderItems:
|
|
722
|
-
...
|
|
722
|
+
body: { orderItems: i },
|
|
723
|
+
...r
|
|
723
724
|
}
|
|
724
725
|
);
|
|
725
726
|
}
|
|
726
|
-
const
|
|
727
|
-
orderFormId:
|
|
727
|
+
const Ar = c.object({
|
|
728
|
+
orderFormId: c.string().nullable()
|
|
728
729
|
});
|
|
729
|
-
async function
|
|
730
|
-
apiUrl:
|
|
731
|
-
body:
|
|
732
|
-
fetchOptions:
|
|
730
|
+
async function Tr({
|
|
731
|
+
apiUrl: e,
|
|
732
|
+
body: t,
|
|
733
|
+
fetchOptions: r
|
|
733
734
|
}) {
|
|
734
|
-
if (!
|
|
735
|
+
if (!t) {
|
|
735
736
|
console.error("[ERROR FETCHING] Body is required");
|
|
736
737
|
return;
|
|
737
738
|
}
|
|
738
|
-
await
|
|
739
|
-
const { orderFormId:
|
|
740
|
-
return
|
|
741
|
-
`${
|
|
739
|
+
await Ar.validate(t);
|
|
740
|
+
const { orderFormId: n } = t;
|
|
741
|
+
return T(
|
|
742
|
+
`${e}/api/checkout/pub/orderForm/${n}/messages/clear`,
|
|
742
743
|
{
|
|
743
744
|
method: "POST",
|
|
744
|
-
...
|
|
745
|
+
...r
|
|
745
746
|
}
|
|
746
747
|
);
|
|
747
748
|
}
|
|
748
|
-
const
|
|
749
|
-
id:
|
|
749
|
+
const Or = c.object({
|
|
750
|
+
id: c.string().nullable(),
|
|
750
751
|
// id offering
|
|
751
|
-
itemIndex:
|
|
752
|
-
orderFormId:
|
|
753
|
-
remove:
|
|
752
|
+
itemIndex: c.number().nullable(),
|
|
753
|
+
orderFormId: c.string().nullable(),
|
|
754
|
+
remove: c.boolean().nullable()
|
|
754
755
|
});
|
|
755
|
-
async function
|
|
756
|
-
if (!
|
|
756
|
+
async function qr({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
757
|
+
if (!t) {
|
|
757
758
|
console.error("[ERROR FETCHING] Body is required");
|
|
758
759
|
return;
|
|
759
760
|
}
|
|
760
|
-
await
|
|
761
|
-
const { itemIndex:
|
|
762
|
-
return
|
|
761
|
+
await Or.validate(t);
|
|
762
|
+
const { itemIndex: n, orderFormId: i, id: a, remove: s } = t, o = s ? `/${a}/remove` : "", d = `${e}/api/checkout/pub/orderForm/${i}/items/${n}/offerings${o}`;
|
|
763
|
+
return T(d, {
|
|
763
764
|
method: "POST",
|
|
764
|
-
body: { id:
|
|
765
|
-
...
|
|
765
|
+
body: { id: a },
|
|
766
|
+
...r
|
|
766
767
|
});
|
|
767
768
|
}
|
|
768
|
-
const
|
|
769
|
-
orderFormId:
|
|
769
|
+
const Nr = c.object({
|
|
770
|
+
orderFormId: c.string().nullable()
|
|
770
771
|
});
|
|
771
|
-
async function
|
|
772
|
-
apiUrl:
|
|
773
|
-
body:
|
|
774
|
-
fetchOptions:
|
|
775
|
-
extraData:
|
|
772
|
+
async function jr({
|
|
773
|
+
apiUrl: e,
|
|
774
|
+
body: t,
|
|
775
|
+
fetchOptions: r,
|
|
776
|
+
extraData: n
|
|
776
777
|
}) {
|
|
777
|
-
var
|
|
778
|
-
if (!
|
|
778
|
+
var s;
|
|
779
|
+
if (!t) {
|
|
779
780
|
console.error("[ERROR FETCHING] Body is required");
|
|
780
781
|
return;
|
|
781
782
|
}
|
|
782
|
-
await
|
|
783
|
-
const
|
|
783
|
+
await Nr.validate(t);
|
|
784
|
+
const i = new URLSearchParams({
|
|
784
785
|
refreshOutdatedData: "true"
|
|
785
|
-
}),
|
|
786
|
-
return
|
|
786
|
+
}), a = t.orderFormId && ((s = n.orderFormPurchaseId) == null ? void 0 : s.value) !== t.orderFormId ? `${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(i)}` : `${e}/api/checkout/pub/orderForm`;
|
|
787
|
+
return T(a, { method: "GET", ...r });
|
|
787
788
|
}
|
|
788
|
-
const
|
|
789
|
-
orderFormId:
|
|
790
|
-
email:
|
|
791
|
-
firstName:
|
|
792
|
-
lastName:
|
|
793
|
-
documentType:
|
|
794
|
-
document:
|
|
795
|
-
phone:
|
|
789
|
+
const Fr = c.object({
|
|
790
|
+
orderFormId: c.string().nullable(),
|
|
791
|
+
email: c.string().email().required(),
|
|
792
|
+
firstName: c.string().required(),
|
|
793
|
+
lastName: c.string().required(),
|
|
794
|
+
documentType: c.string().required(),
|
|
795
|
+
document: c.string().required(),
|
|
796
|
+
phone: c.string().matches(/^\+\d{1,3}\d{10,11}$/)
|
|
796
797
|
});
|
|
797
|
-
async function
|
|
798
|
-
apiUrl:
|
|
799
|
-
body:
|
|
800
|
-
fetchOptions:
|
|
798
|
+
async function $r({
|
|
799
|
+
apiUrl: e,
|
|
800
|
+
body: t,
|
|
801
|
+
fetchOptions: r
|
|
801
802
|
}) {
|
|
802
|
-
if (!
|
|
803
|
+
if (!t) {
|
|
803
804
|
console.error("[ERROR FETCHING] Body is required");
|
|
804
805
|
return;
|
|
805
806
|
}
|
|
806
|
-
await
|
|
807
|
-
const { orderFormId:
|
|
808
|
-
return
|
|
809
|
-
`${
|
|
807
|
+
await Fr.validate(t);
|
|
808
|
+
const { orderFormId: n, ...i } = t;
|
|
809
|
+
return T(
|
|
810
|
+
`${e}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,
|
|
810
811
|
{
|
|
811
812
|
method: "POST",
|
|
812
|
-
body: { ...
|
|
813
|
-
...
|
|
813
|
+
body: { ...i },
|
|
814
|
+
...r
|
|
814
815
|
}
|
|
815
816
|
);
|
|
816
817
|
}
|
|
817
|
-
const
|
|
818
|
-
sellerCode:
|
|
818
|
+
const Lr = c.object({
|
|
819
|
+
sellerCode: c.string().nullable()
|
|
819
820
|
});
|
|
820
|
-
async function
|
|
821
|
-
apiUrl:
|
|
822
|
-
body:
|
|
823
|
-
extraData:
|
|
824
|
-
fetchOptions:
|
|
821
|
+
async function Dr({
|
|
822
|
+
apiUrl: e,
|
|
823
|
+
body: t,
|
|
824
|
+
extraData: r,
|
|
825
|
+
fetchOptions: n
|
|
825
826
|
}) {
|
|
826
|
-
if (!
|
|
827
|
+
if (!t) {
|
|
827
828
|
console.error("[ERROR FETCHING] Body is required");
|
|
828
829
|
return;
|
|
829
830
|
}
|
|
830
|
-
await
|
|
831
|
-
const { sellerCode:
|
|
832
|
-
return
|
|
833
|
-
`${
|
|
831
|
+
await Lr.validate(t);
|
|
832
|
+
const { sellerCode: i = "" } = t;
|
|
833
|
+
return T(
|
|
834
|
+
`${e}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${i}`,
|
|
834
835
|
{
|
|
835
836
|
method: "GET",
|
|
836
837
|
headers: {
|
|
837
838
|
Accept: "application/vnd.vtex.ds.v10+json"
|
|
838
839
|
},
|
|
839
|
-
...
|
|
840
|
+
...n
|
|
840
841
|
}
|
|
841
842
|
);
|
|
842
843
|
}
|
|
843
|
-
const
|
|
844
|
-
country:
|
|
845
|
-
orderFormId:
|
|
846
|
-
postalCode:
|
|
844
|
+
const Ur = c.object().shape({
|
|
845
|
+
country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
846
|
+
orderFormId: c.string().nullable(),
|
|
847
|
+
postalCode: c.string().nullable()
|
|
847
848
|
});
|
|
848
|
-
async function
|
|
849
|
-
apiUrl:
|
|
850
|
-
body:
|
|
851
|
-
fetchOptions:
|
|
849
|
+
async function Hr({
|
|
850
|
+
apiUrl: e,
|
|
851
|
+
body: t,
|
|
852
|
+
fetchOptions: r
|
|
852
853
|
}) {
|
|
853
|
-
if (!
|
|
854
|
+
if (!t) {
|
|
854
855
|
console.error("[ERROR FETCHING] Body is required");
|
|
855
856
|
return;
|
|
856
857
|
}
|
|
857
|
-
await
|
|
858
|
-
const { country:
|
|
858
|
+
await Ur.validate(t);
|
|
859
|
+
const { country: n, orderFormId: i, postalCode: a } = t, s = a ? {
|
|
859
860
|
address: {
|
|
860
861
|
addressType: "residential",
|
|
861
|
-
postalCode:
|
|
862
|
-
country:
|
|
862
|
+
postalCode: a,
|
|
863
|
+
country: n
|
|
863
864
|
}
|
|
864
865
|
} : {
|
|
865
866
|
logisticsInfo: [],
|
|
866
867
|
clearAddressIfPostalCodeNotFound: !0
|
|
867
868
|
};
|
|
868
|
-
return
|
|
869
|
-
`${
|
|
869
|
+
return T(
|
|
870
|
+
`${e}/api/checkout/pub/orderForm/${i}/attachments/shippingData`,
|
|
870
871
|
{
|
|
871
872
|
method: "POST",
|
|
872
|
-
body:
|
|
873
|
-
...
|
|
873
|
+
body: s,
|
|
874
|
+
...r
|
|
874
875
|
}
|
|
875
876
|
);
|
|
876
877
|
}
|
|
877
|
-
const
|
|
878
|
-
orderFormId:
|
|
879
|
-
options:
|
|
880
|
-
|
|
881
|
-
itemIndex:
|
|
882
|
-
selectedDeliveryChannel:
|
|
883
|
-
selectedSla:
|
|
878
|
+
const Mr = c.object().shape({
|
|
879
|
+
orderFormId: c.string().nullable(),
|
|
880
|
+
options: c.array().of(
|
|
881
|
+
c.object().shape({
|
|
882
|
+
itemIndex: c.number(),
|
|
883
|
+
selectedDeliveryChannel: c.string(),
|
|
884
|
+
selectedSla: c.string()
|
|
884
885
|
})
|
|
885
886
|
),
|
|
886
|
-
selectedAddresses:
|
|
887
|
-
|
|
888
|
-
addressId:
|
|
889
|
-
addressType:
|
|
890
|
-
city:
|
|
891
|
-
complement:
|
|
892
|
-
country:
|
|
893
|
-
geoCoordinates:
|
|
894
|
-
isDisposable:
|
|
895
|
-
neighborhood:
|
|
896
|
-
number:
|
|
897
|
-
postalCode:
|
|
898
|
-
receiverName:
|
|
899
|
-
reference:
|
|
900
|
-
state:
|
|
901
|
-
street:
|
|
887
|
+
selectedAddresses: c.array().of(
|
|
888
|
+
c.object().shape({
|
|
889
|
+
addressId: c.string().required(),
|
|
890
|
+
addressType: c.string().required(),
|
|
891
|
+
city: c.string().nullable(),
|
|
892
|
+
complement: c.string().nullable(),
|
|
893
|
+
country: c.string().required().length(3),
|
|
894
|
+
geoCoordinates: c.array().of(c.number()).required().min(0),
|
|
895
|
+
isDisposable: c.boolean().required(),
|
|
896
|
+
neighborhood: c.string().nullable(),
|
|
897
|
+
number: c.string().nullable(),
|
|
898
|
+
postalCode: c.string().required(),
|
|
899
|
+
receiverName: c.string().nullable(),
|
|
900
|
+
reference: c.string().nullable(),
|
|
901
|
+
state: c.string().nullable(),
|
|
902
|
+
street: c.string().nullable()
|
|
902
903
|
})
|
|
903
904
|
)
|
|
904
905
|
});
|
|
905
|
-
async function
|
|
906
|
-
if (!
|
|
906
|
+
async function Br({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
907
|
+
if (!t) {
|
|
907
908
|
console.error("[ERROR FETCHING] Body is required");
|
|
908
909
|
return;
|
|
909
910
|
}
|
|
910
|
-
await
|
|
911
|
-
const { orderFormId:
|
|
912
|
-
return
|
|
913
|
-
`${
|
|
911
|
+
await Mr.validate(t);
|
|
912
|
+
const { orderFormId: n, options: i, selectedAddresses: a } = t;
|
|
913
|
+
return T(
|
|
914
|
+
`${e}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,
|
|
914
915
|
{
|
|
915
916
|
method: "POST",
|
|
916
917
|
body: {
|
|
917
|
-
selectedAddresses:
|
|
918
|
+
selectedAddresses: a,
|
|
918
919
|
clearAddressIfPostalCodeNotFound: !1,
|
|
919
|
-
logisticsInfo:
|
|
920
|
+
logisticsInfo: i
|
|
920
921
|
},
|
|
921
|
-
...
|
|
922
|
+
...r
|
|
922
923
|
}
|
|
923
924
|
);
|
|
924
925
|
}
|
|
925
|
-
const
|
|
926
|
-
country:
|
|
927
|
-
postalCode:
|
|
928
|
-
geoCoordinates:
|
|
929
|
-
longitude:
|
|
930
|
-
latitude:
|
|
926
|
+
const zr = c.object({
|
|
927
|
+
country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
928
|
+
postalCode: c.string().nullable(),
|
|
929
|
+
geoCoordinates: c.object().shape({
|
|
930
|
+
longitude: c.number().required(),
|
|
931
|
+
latitude: c.number().required()
|
|
931
932
|
})
|
|
932
933
|
});
|
|
933
|
-
async function
|
|
934
|
-
if (!
|
|
934
|
+
async function Gr({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
935
|
+
if (!t) {
|
|
935
936
|
console.error("[ERROR FETCHING] Body is required");
|
|
936
937
|
return;
|
|
937
938
|
}
|
|
938
|
-
await
|
|
939
|
-
const { country:
|
|
940
|
-
return
|
|
939
|
+
await zr.validate(t);
|
|
940
|
+
const { country: n = "", geoCoordinates: i, postalCode: a = "" } = t, s = new URLSearchParams({ country: String(n) });
|
|
941
|
+
return a ? s.append("postalCode", a) : s.append(
|
|
941
942
|
"geoCoordinates",
|
|
942
|
-
`${
|
|
943
|
-
), await
|
|
944
|
-
`${
|
|
943
|
+
`${i == null ? void 0 : i.longitude};${i == null ? void 0 : i.latitude}`
|
|
944
|
+
), await T(
|
|
945
|
+
`${e}/api/checkout/pub/regions/?${s.toString()}`,
|
|
945
946
|
{
|
|
946
947
|
method: "GET",
|
|
947
|
-
...
|
|
948
|
+
...r
|
|
948
949
|
}
|
|
949
950
|
);
|
|
950
951
|
}
|
|
951
|
-
const
|
|
952
|
-
id:
|
|
953
|
-
quantity:
|
|
954
|
-
seller:
|
|
955
|
-
}),
|
|
956
|
-
items:
|
|
957
|
-
country:
|
|
958
|
-
postalCode:
|
|
959
|
-
geoCoordinates:
|
|
952
|
+
const Vr = c.object({
|
|
953
|
+
id: c.string().required("ID of SKU is required"),
|
|
954
|
+
quantity: c.number().integer().required("Quantity of item is required"),
|
|
955
|
+
seller: c.string()
|
|
956
|
+
}), Wr = c.object({
|
|
957
|
+
items: c.array().of(Vr),
|
|
958
|
+
country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
959
|
+
postalCode: c.string().nullable(),
|
|
960
|
+
geoCoordinates: c.array().nullable().of(c.number()).length(2)
|
|
960
961
|
});
|
|
961
|
-
async function
|
|
962
|
-
if (!
|
|
962
|
+
async function Qr({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
963
|
+
if (!t) {
|
|
963
964
|
console.error("[ERROR FETCHING] Body is required");
|
|
964
965
|
return;
|
|
965
966
|
}
|
|
966
|
-
return await
|
|
967
|
-
`${
|
|
967
|
+
return await Wr.validate(t), T(
|
|
968
|
+
`${e}/api/checkout/pub/orderForms/simulation`,
|
|
968
969
|
{
|
|
969
970
|
method: "POST",
|
|
970
|
-
body:
|
|
971
|
-
...
|
|
971
|
+
body: t,
|
|
972
|
+
...r
|
|
972
973
|
}
|
|
973
974
|
);
|
|
974
975
|
}
|
|
975
|
-
const
|
|
976
|
+
const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
976
977
|
__proto__: null,
|
|
977
|
-
getMasterDataSellerCode:
|
|
978
|
-
getOrderForm:
|
|
979
|
-
postOrderFormAddCoupon:
|
|
980
|
-
postOrderFormAttachClientProfileData:
|
|
981
|
-
postOrderFormAttachOrderFormData:
|
|
982
|
-
postOrderFormAttachShippingData:
|
|
983
|
-
postOrderFormAttachmentsMarketingData:
|
|
984
|
-
postOrderFormAttachmentsOpenTextField:
|
|
985
|
-
postOrderFormClearMessages:
|
|
986
|
-
postOrderFormFreightSimulation:
|
|
987
|
-
postOrderFormItems:
|
|
988
|
-
postOrderFormRegion:
|
|
989
|
-
postOrderFormRemoveAllItems:
|
|
990
|
-
postOrderFormUpdateItems:
|
|
991
|
-
postOrderFormUpdateShippingData:
|
|
992
|
-
postOrderformAddress:
|
|
993
|
-
putOrderFormCustomData:
|
|
994
|
-
updateOrderFormOffering:
|
|
995
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
996
|
-
skuId:
|
|
978
|
+
getMasterDataSellerCode: Dr,
|
|
979
|
+
getOrderForm: jr,
|
|
980
|
+
postOrderFormAddCoupon: br,
|
|
981
|
+
postOrderFormAttachClientProfileData: $r,
|
|
982
|
+
postOrderFormAttachOrderFormData: fr,
|
|
983
|
+
postOrderFormAttachShippingData: Hr,
|
|
984
|
+
postOrderFormAttachmentsMarketingData: Qe,
|
|
985
|
+
postOrderFormAttachmentsOpenTextField: We,
|
|
986
|
+
postOrderFormClearMessages: Tr,
|
|
987
|
+
postOrderFormFreightSimulation: Qr,
|
|
988
|
+
postOrderFormItems: Ir,
|
|
989
|
+
postOrderFormRegion: Gr,
|
|
990
|
+
postOrderFormRemoveAllItems: Sr,
|
|
991
|
+
postOrderFormUpdateItems: Er,
|
|
992
|
+
postOrderFormUpdateShippingData: Br,
|
|
993
|
+
postOrderformAddress: dr,
|
|
994
|
+
putOrderFormCustomData: vr,
|
|
995
|
+
updateOrderFormOffering: qr
|
|
996
|
+
}, Symbol.toStringTag, { value: "Module" })), Kr = c.object({
|
|
997
|
+
skuId: c.string()
|
|
997
998
|
});
|
|
998
|
-
async function
|
|
999
|
-
if (!
|
|
999
|
+
async function Jr({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
1000
|
+
if (!t) {
|
|
1000
1001
|
console.error("[ERROR FETCHING] Body is required");
|
|
1001
1002
|
return;
|
|
1002
1003
|
}
|
|
1003
|
-
await
|
|
1004
|
-
const { skuId:
|
|
1005
|
-
return
|
|
1006
|
-
`${
|
|
1004
|
+
await Kr.validate(t);
|
|
1005
|
+
const { skuId: n } = t;
|
|
1006
|
+
return T(
|
|
1007
|
+
`${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,
|
|
1007
1008
|
{
|
|
1008
|
-
...
|
|
1009
|
+
...r
|
|
1009
1010
|
}
|
|
1010
1011
|
);
|
|
1011
1012
|
}
|
|
1012
|
-
const
|
|
1013
|
-
ids:
|
|
1013
|
+
const Zr = c.object({
|
|
1014
|
+
ids: c.array().of(c.string().required("ID are required")).required("IDs are required")
|
|
1014
1015
|
});
|
|
1015
|
-
async function
|
|
1016
|
-
if (!
|
|
1016
|
+
async function Yr({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
1017
|
+
if (!t) {
|
|
1017
1018
|
console.error("[ERROR FETCHING] Body is required");
|
|
1018
1019
|
return;
|
|
1019
1020
|
}
|
|
1020
|
-
await
|
|
1021
|
-
const { ids:
|
|
1022
|
-
return
|
|
1023
|
-
`${
|
|
1021
|
+
await Zr.validate(t);
|
|
1022
|
+
const { ids: n } = t;
|
|
1023
|
+
return T(
|
|
1024
|
+
`${e}/api/catalog_system/pub/products/search?fq=${n.map((i) => `productId:${i}`).join("&fq=")}`,
|
|
1024
1025
|
{
|
|
1025
|
-
...
|
|
1026
|
+
...r
|
|
1026
1027
|
}
|
|
1027
1028
|
);
|
|
1028
1029
|
}
|
|
1029
|
-
const
|
|
1030
|
-
productId:
|
|
1030
|
+
const en = c.object({
|
|
1031
|
+
productId: c.number().required("Product ID is required")
|
|
1031
1032
|
});
|
|
1032
|
-
async function
|
|
1033
|
-
if (!
|
|
1033
|
+
async function tn({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
1034
|
+
if (!t) {
|
|
1034
1035
|
console.error("[ERROR FETCHING] Body is required");
|
|
1035
1036
|
return;
|
|
1036
1037
|
}
|
|
1037
|
-
await
|
|
1038
|
-
const { productId:
|
|
1039
|
-
return
|
|
1040
|
-
`${
|
|
1038
|
+
await en.validate(t);
|
|
1039
|
+
const { productId: n } = t;
|
|
1040
|
+
return T(
|
|
1041
|
+
`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,
|
|
1041
1042
|
{
|
|
1042
|
-
...
|
|
1043
|
+
...r
|
|
1043
1044
|
}
|
|
1044
1045
|
);
|
|
1045
1046
|
}
|
|
1046
|
-
const
|
|
1047
|
+
const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1047
1048
|
__proto__: null,
|
|
1048
|
-
getCatalogKitProducts:
|
|
1049
|
-
getCatalogProducts:
|
|
1050
|
-
getCatalogSimilars:
|
|
1051
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1052
|
-
query:
|
|
1049
|
+
getCatalogKitProducts: Jr,
|
|
1050
|
+
getCatalogProducts: Yr,
|
|
1051
|
+
getCatalogSimilars: tn
|
|
1052
|
+
}, Symbol.toStringTag, { value: "Module" })), nn = c.object({
|
|
1053
|
+
query: c.string()
|
|
1053
1054
|
});
|
|
1054
|
-
async function
|
|
1055
|
-
apiUrl:
|
|
1056
|
-
body:
|
|
1057
|
-
fetchOptions:
|
|
1055
|
+
async function on({
|
|
1056
|
+
apiUrl: e,
|
|
1057
|
+
body: t,
|
|
1058
|
+
fetchOptions: r
|
|
1058
1059
|
}) {
|
|
1059
|
-
if (!
|
|
1060
|
+
if (!t) {
|
|
1060
1061
|
console.error("[ERROR FETCHING] Body is required");
|
|
1061
1062
|
return;
|
|
1062
1063
|
}
|
|
1063
|
-
await
|
|
1064
|
-
const { query:
|
|
1065
|
-
return
|
|
1066
|
-
`${
|
|
1064
|
+
await nn.validate(t);
|
|
1065
|
+
const { query: n = "" } = t, i = new URLSearchParams({ query: n });
|
|
1066
|
+
return T(
|
|
1067
|
+
`${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${i.toString()}`,
|
|
1067
1068
|
{
|
|
1068
|
-
...
|
|
1069
|
+
...r
|
|
1069
1070
|
}
|
|
1070
1071
|
);
|
|
1071
1072
|
}
|
|
1072
|
-
const
|
|
1073
|
-
...
|
|
1074
|
-
description:
|
|
1075
|
-
}),
|
|
1076
|
-
offer:
|
|
1077
|
-
seller:
|
|
1078
|
-
product:
|
|
1073
|
+
const an = (e, t) => Bt(e, t), sn = (e) => ({
|
|
1074
|
+
...e,
|
|
1075
|
+
description: e.description ? an(e.description) : e.description
|
|
1076
|
+
}), ln = ({
|
|
1077
|
+
offer: e,
|
|
1078
|
+
seller: t,
|
|
1079
|
+
product: r
|
|
1079
1080
|
}) => ({
|
|
1080
|
-
...
|
|
1081
|
-
product:
|
|
1082
|
-
seller:
|
|
1083
|
-
}),
|
|
1084
|
-
...
|
|
1085
|
-
isVariantOf:
|
|
1086
|
-
}),
|
|
1087
|
-
let
|
|
1088
|
-
for (let
|
|
1089
|
-
e
|
|
1090
|
-
return
|
|
1091
|
-
},
|
|
1092
|
-
const
|
|
1093
|
-
(
|
|
1094
|
-
offer:
|
|
1095
|
-
sku:
|
|
1081
|
+
...e,
|
|
1082
|
+
product: r,
|
|
1083
|
+
seller: t
|
|
1084
|
+
}), Xe = (e, t) => ({
|
|
1085
|
+
...e,
|
|
1086
|
+
isVariantOf: sn(t)
|
|
1087
|
+
}), cn = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", ae = (e) => e.AvailableQuantity > 0, Ue = (e) => e.spotPrice ?? 0, un = (e) => e.Price ?? 0, Ke = (e, t) => ae(e) && !ae(t) ? -1 : !ae(e) && ae(t) ? 1 : Ue(e) - Ue(t), dn = (e, t) => {
|
|
1088
|
+
let r = 0;
|
|
1089
|
+
for (let n = 1; n < e.length; n++)
|
|
1090
|
+
t(e[r], e[n]) > 0 && (r = n);
|
|
1091
|
+
return e[r];
|
|
1092
|
+
}, Je = (e) => {
|
|
1093
|
+
const t = e.flatMap(
|
|
1094
|
+
(n) => n.sellers.map((i) => ({
|
|
1095
|
+
offer: i.commertialOffer,
|
|
1096
|
+
sku: n
|
|
1096
1097
|
}))
|
|
1097
|
-
),
|
|
1098
|
-
|
|
1099
|
-
({ offer:
|
|
1098
|
+
), r = dn(
|
|
1099
|
+
t,
|
|
1100
|
+
({ offer: n }, { offer: i }) => Ke(n, i)
|
|
1100
1101
|
);
|
|
1101
|
-
return
|
|
1102
|
-
},
|
|
1103
|
-
({ imageUrl:
|
|
1104
|
-
alternateName:
|
|
1105
|
-
url:
|
|
1106
|
-
keywords:
|
|
1102
|
+
return r ? r.sku : e[0];
|
|
1103
|
+
}, Ze = (e) => e.map(
|
|
1104
|
+
({ imageUrl: t, imageText: r, imageLabel: n }) => ({
|
|
1105
|
+
alternateName: r ?? "",
|
|
1106
|
+
url: t.replace("vteximg.com.br", "vtexassets.com"),
|
|
1107
|
+
keywords: n
|
|
1107
1108
|
})
|
|
1108
|
-
),
|
|
1109
|
+
), ue = {
|
|
1109
1110
|
attachment: "ATTACHMENT",
|
|
1110
1111
|
specification: "SPECIFICATION",
|
|
1111
1112
|
attribute: "ATTRIBUTE"
|
|
1112
|
-
},
|
|
1113
|
-
name:
|
|
1114
|
-
value:
|
|
1115
|
-
valueReference:
|
|
1116
|
-
}),
|
|
1117
|
-
propertyID:
|
|
1118
|
-
name:
|
|
1119
|
-
value:
|
|
1113
|
+
}, pn = (e) => ({
|
|
1114
|
+
name: e.name,
|
|
1115
|
+
value: e.content,
|
|
1116
|
+
valueReference: ue.attachment
|
|
1117
|
+
}), mn = (e) => ({
|
|
1118
|
+
propertyID: e.id,
|
|
1119
|
+
name: e.name,
|
|
1120
|
+
value: e.value,
|
|
1120
1121
|
valueReference: {
|
|
1121
|
-
valueReference:
|
|
1122
|
-
visible:
|
|
1123
|
-
}
|
|
1124
|
-
}),
|
|
1125
|
-
const
|
|
1126
|
-
name:
|
|
1127
|
-
value:
|
|
1128
|
-
valueReference:
|
|
1122
|
+
valueReference: ue.attribute,
|
|
1123
|
+
visible: e.visible
|
|
1124
|
+
}
|
|
1125
|
+
}), de = (e, t, r) => {
|
|
1126
|
+
const n = e.flatMap(({ name: s, values: o }) => o ? o.map((d) => ({
|
|
1127
|
+
name: s,
|
|
1128
|
+
value: d,
|
|
1129
|
+
valueReference: ue.specification
|
|
1129
1130
|
})) : {
|
|
1130
|
-
name:
|
|
1131
|
+
name: s,
|
|
1131
1132
|
value: "",
|
|
1132
|
-
valueReference:
|
|
1133
|
-
}),
|
|
1133
|
+
valueReference: ue.specification
|
|
1134
|
+
}), i = Array.isArray(r) ? r.map(pn) : [], a = t ? t.map(mn) : [];
|
|
1134
1135
|
return [
|
|
1135
|
-
...
|
|
1136
|
-
...
|
|
1137
|
-
...
|
|
1136
|
+
...n,
|
|
1137
|
+
...i,
|
|
1138
|
+
...a
|
|
1138
1139
|
];
|
|
1139
|
-
},
|
|
1140
|
-
let
|
|
1141
|
-
for (let
|
|
1142
|
-
|
|
1143
|
-
new RegExp(
|
|
1144
|
-
|
|
1140
|
+
}, He = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", hn = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", fn = (e) => {
|
|
1141
|
+
let t = e.slice(0);
|
|
1142
|
+
for (let r = 0; r < He.length; r++)
|
|
1143
|
+
t = t.replace(
|
|
1144
|
+
new RegExp(He.charAt(r), "g"),
|
|
1145
|
+
hn.charAt(r)
|
|
1145
1146
|
);
|
|
1146
|
-
return
|
|
1147
|
-
},
|
|
1148
|
-
const
|
|
1149
|
-
return
|
|
1150
|
-
},
|
|
1151
|
-
const
|
|
1152
|
-
...
|
|
1153
|
-
),
|
|
1154
|
-
(
|
|
1147
|
+
return t;
|
|
1148
|
+
}, gn = (e) => e.replace(/[·/_,:]/, "-"), Ye = (e) => {
|
|
1149
|
+
const r = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1150
|
+
return gn(fn(r)).toLowerCase();
|
|
1151
|
+
}, et = (e) => `/${e}/p`, tt = (e) => {
|
|
1152
|
+
const t = Math.max(
|
|
1153
|
+
...e.map((n) => n.NumberOfInstallments)
|
|
1154
|
+
), r = e.find(
|
|
1155
|
+
(n) => n.NumberOfInstallments === t
|
|
1155
1156
|
);
|
|
1156
1157
|
return {
|
|
1157
|
-
count: (
|
|
1158
|
-
value: (
|
|
1158
|
+
count: (r == null ? void 0 : r.NumberOfInstallments) ?? 0,
|
|
1159
|
+
value: (r == null ? void 0 : r.Value) ?? 0
|
|
1159
1160
|
};
|
|
1160
|
-
},
|
|
1161
|
-
const
|
|
1161
|
+
}, rt = (e, t) => {
|
|
1162
|
+
const r = {
|
|
1162
1163
|
price: 0,
|
|
1163
1164
|
listPrice: 0,
|
|
1164
1165
|
sellerDefault: !1
|
|
1165
|
-
},
|
|
1166
|
-
(
|
|
1167
|
-
offer:
|
|
1168
|
-
seller:
|
|
1169
|
-
product:
|
|
1166
|
+
}, i = e.map(
|
|
1167
|
+
(a) => ln({
|
|
1168
|
+
offer: a.commertialOffer,
|
|
1169
|
+
seller: a,
|
|
1170
|
+
product: t
|
|
1170
1171
|
})
|
|
1171
|
-
).sort(
|
|
1172
|
-
availability:
|
|
1173
|
-
listPrice:
|
|
1174
|
-
price:
|
|
1175
|
-
priceValidUntil:
|
|
1172
|
+
).sort(Ke).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (r.price = a.Price, r.listPrice = a.ListPrice, r.sellerDefault = !0), {
|
|
1173
|
+
availability: a.AvailableQuantity > 0,
|
|
1174
|
+
listPrice: a.ListPrice,
|
|
1175
|
+
price: un(a),
|
|
1176
|
+
priceValidUntil: a.PriceValidUntil,
|
|
1176
1177
|
priceCurrency: "BRL",
|
|
1177
|
-
installments:
|
|
1178
|
-
lowPrice:
|
|
1179
|
-
quantity:
|
|
1178
|
+
installments: a.Installments,
|
|
1179
|
+
lowPrice: a.spotPrice,
|
|
1180
|
+
quantity: a.AvailableQuantity,
|
|
1180
1181
|
seller: {
|
|
1181
|
-
identifier:
|
|
1182
|
+
identifier: a.seller.sellerId
|
|
1182
1183
|
}
|
|
1183
1184
|
}));
|
|
1184
1185
|
return {
|
|
1185
|
-
lowPrice:
|
|
1186
|
-
highPrice:
|
|
1187
|
-
offers:
|
|
1186
|
+
lowPrice: r.sellerDefault ? r.price : i[0].price,
|
|
1187
|
+
highPrice: r.sellerDefault ? r.listPrice : i[0].listPrice,
|
|
1188
|
+
offers: i
|
|
1188
1189
|
};
|
|
1189
|
-
},
|
|
1190
|
-
const { attributes:
|
|
1190
|
+
}, nt = (e) => {
|
|
1191
|
+
const { attributes: t, itemId: r, name: n, sellers: i, variations: a } = e;
|
|
1191
1192
|
return {
|
|
1192
|
-
additionalProperty:
|
|
1193
|
-
name:
|
|
1193
|
+
additionalProperty: de(a, t, []),
|
|
1194
|
+
name: n,
|
|
1194
1195
|
offers: {
|
|
1195
|
-
offers:
|
|
1196
|
-
availability:
|
|
1197
|
-
listPrice:
|
|
1198
|
-
price:
|
|
1199
|
-
quantity:
|
|
1196
|
+
offers: i == null ? void 0 : i.map(({ sellerId: s, commertialOffer: o }) => ({
|
|
1197
|
+
availability: cn(o.AvailableQuantity > 0),
|
|
1198
|
+
listPrice: o.ListPrice,
|
|
1199
|
+
price: o.Price,
|
|
1200
|
+
quantity: o.AvailableQuantity,
|
|
1200
1201
|
seller: {
|
|
1201
|
-
identifier:
|
|
1202
|
+
identifier: s
|
|
1202
1203
|
}
|
|
1203
1204
|
}))
|
|
1204
1205
|
},
|
|
1205
|
-
sku:
|
|
1206
|
+
sku: r
|
|
1206
1207
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1207
1208
|
};
|
|
1208
|
-
},
|
|
1209
|
-
var
|
|
1209
|
+
}, bn = (e) => {
|
|
1210
|
+
var R;
|
|
1210
1211
|
const {
|
|
1211
|
-
attributes:
|
|
1212
|
-
referenceId:
|
|
1213
|
-
isVariantOf:
|
|
1214
|
-
images:
|
|
1215
|
-
itemId:
|
|
1216
|
-
name:
|
|
1217
|
-
sellers:
|
|
1218
|
-
videos:
|
|
1219
|
-
variations:
|
|
1220
|
-
} =
|
|
1221
|
-
brand:
|
|
1222
|
-
categories:
|
|
1223
|
-
categoriesIds:
|
|
1224
|
-
description:
|
|
1225
|
-
linkText:
|
|
1226
|
-
productClusters:
|
|
1227
|
-
clusterHighlights:
|
|
1228
|
-
productName:
|
|
1229
|
-
properties:
|
|
1230
|
-
productId:
|
|
1231
|
-
productReference:
|
|
1232
|
-
} =
|
|
1212
|
+
attributes: t,
|
|
1213
|
+
referenceId: r,
|
|
1214
|
+
isVariantOf: n,
|
|
1215
|
+
images: i,
|
|
1216
|
+
itemId: a,
|
|
1217
|
+
name: s,
|
|
1218
|
+
sellers: o,
|
|
1219
|
+
videos: d,
|
|
1220
|
+
variations: g
|
|
1221
|
+
} = e, {
|
|
1222
|
+
brand: l,
|
|
1223
|
+
categories: u,
|
|
1224
|
+
categoriesIds: w,
|
|
1225
|
+
description: v,
|
|
1226
|
+
linkText: y,
|
|
1227
|
+
productClusters: _,
|
|
1228
|
+
clusterHighlights: p,
|
|
1229
|
+
productName: b,
|
|
1230
|
+
properties: m,
|
|
1231
|
+
productId: h,
|
|
1232
|
+
productReference: f
|
|
1233
|
+
} = n, E = u.slice().reverse(), q = rt(o, e.isVariantOf), I = tt(q.offers[0].installments);
|
|
1233
1234
|
return {
|
|
1234
|
-
sku:
|
|
1235
|
-
gtin: ((
|
|
1236
|
-
name:
|
|
1237
|
-
description:
|
|
1238
|
-
releaseDate:
|
|
1239
|
-
slug:
|
|
1240
|
-
video:
|
|
1241
|
-
categories:
|
|
1242
|
-
categoriesIds:
|
|
1243
|
-
id:
|
|
1244
|
-
brand: { name:
|
|
1235
|
+
sku: a,
|
|
1236
|
+
gtin: ((R = r == null ? void 0 : r[0]) == null ? void 0 : R.Value) ?? f ?? "",
|
|
1237
|
+
name: b ?? s,
|
|
1238
|
+
description: v,
|
|
1239
|
+
releaseDate: n.releaseDate ?? "",
|
|
1240
|
+
slug: y,
|
|
1241
|
+
video: d[0],
|
|
1242
|
+
categories: u,
|
|
1243
|
+
categoriesIds: w,
|
|
1244
|
+
id: h,
|
|
1245
|
+
brand: { name: l, brandName: l },
|
|
1245
1246
|
seo: {
|
|
1246
|
-
description:
|
|
1247
|
-
title:
|
|
1248
|
-
canonical:
|
|
1247
|
+
description: v,
|
|
1248
|
+
title: b,
|
|
1249
|
+
canonical: et(y)
|
|
1249
1250
|
},
|
|
1250
1251
|
cluster: {
|
|
1251
|
-
generals:
|
|
1252
|
-
highlights:
|
|
1252
|
+
generals: _,
|
|
1253
|
+
highlights: p
|
|
1253
1254
|
},
|
|
1254
|
-
properties:
|
|
1255
|
-
availability: { status:
|
|
1255
|
+
properties: m,
|
|
1256
|
+
availability: { status: q.offers[0].availability },
|
|
1256
1257
|
breadcrumbList: {
|
|
1257
1258
|
itemListElement: [
|
|
1258
|
-
...E.map((
|
|
1259
|
-
const
|
|
1259
|
+
...E.map((x, j) => {
|
|
1260
|
+
const F = x.split("/"), D = F[F.length - 2], U = F.map(Ye).join("/");
|
|
1260
1261
|
return {
|
|
1261
|
-
name:
|
|
1262
|
-
item:
|
|
1263
|
-
position:
|
|
1262
|
+
name: D,
|
|
1263
|
+
item: U,
|
|
1264
|
+
position: j + 1
|
|
1264
1265
|
};
|
|
1265
1266
|
}),
|
|
1266
1267
|
{
|
|
1267
|
-
name:
|
|
1268
|
-
item:
|
|
1269
|
-
position:
|
|
1268
|
+
name: n.productName,
|
|
1269
|
+
item: y,
|
|
1270
|
+
position: u.length + 1
|
|
1270
1271
|
}
|
|
1271
1272
|
],
|
|
1272
|
-
numberOfItems:
|
|
1273
|
+
numberOfItems: u.length
|
|
1273
1274
|
},
|
|
1274
|
-
image:
|
|
1275
|
-
offers:
|
|
1276
|
-
additionalProperty:
|
|
1275
|
+
image: Ze(i),
|
|
1276
|
+
offers: q,
|
|
1277
|
+
additionalProperty: de(g, t, []),
|
|
1277
1278
|
isVariantOf: {
|
|
1278
|
-
productGroupID:
|
|
1279
|
-
hasVariant:
|
|
1279
|
+
productGroupID: n.productId,
|
|
1280
|
+
hasVariant: n.items.map((x) => nt(x))
|
|
1280
1281
|
},
|
|
1281
|
-
installments:
|
|
1282
|
+
installments: I
|
|
1282
1283
|
};
|
|
1283
|
-
},
|
|
1284
|
-
var
|
|
1284
|
+
}, wn = (e) => {
|
|
1285
|
+
var I;
|
|
1285
1286
|
const {
|
|
1286
|
-
attributes:
|
|
1287
|
-
referenceId:
|
|
1288
|
-
isVariantOf:
|
|
1289
|
-
images:
|
|
1290
|
-
itemId:
|
|
1291
|
-
name:
|
|
1292
|
-
sellers:
|
|
1293
|
-
Videos:
|
|
1294
|
-
variations:
|
|
1295
|
-
} =
|
|
1296
|
-
brand:
|
|
1297
|
-
categories:
|
|
1298
|
-
categoriesIds:
|
|
1299
|
-
description:
|
|
1300
|
-
linkText:
|
|
1301
|
-
productClusters:
|
|
1302
|
-
productName:
|
|
1303
|
-
Coleção:
|
|
1304
|
-
"ID Coleção":
|
|
1305
|
-
productId:
|
|
1306
|
-
} =
|
|
1287
|
+
attributes: t,
|
|
1288
|
+
referenceId: r,
|
|
1289
|
+
isVariantOf: n,
|
|
1290
|
+
images: i,
|
|
1291
|
+
itemId: a,
|
|
1292
|
+
name: s,
|
|
1293
|
+
sellers: o,
|
|
1294
|
+
Videos: d,
|
|
1295
|
+
variations: g
|
|
1296
|
+
} = e, {
|
|
1297
|
+
brand: l,
|
|
1298
|
+
categories: u,
|
|
1299
|
+
categoriesIds: w,
|
|
1300
|
+
description: v,
|
|
1301
|
+
linkText: y,
|
|
1302
|
+
productClusters: _,
|
|
1303
|
+
productName: p,
|
|
1304
|
+
Coleção: b,
|
|
1305
|
+
"ID Coleção": m,
|
|
1306
|
+
productId: h
|
|
1307
|
+
} = n, f = u.slice().reverse(), E = rt(o, e.isVariantOf), q = tt(E.offers[0].installments);
|
|
1307
1308
|
return {
|
|
1308
|
-
sku:
|
|
1309
|
-
gtin: ((
|
|
1310
|
-
name:
|
|
1311
|
-
description:
|
|
1312
|
-
releaseDate:
|
|
1313
|
-
slug:
|
|
1314
|
-
video:
|
|
1315
|
-
categories:
|
|
1316
|
-
categoriesIds:
|
|
1317
|
-
collection:
|
|
1318
|
-
collectionId:
|
|
1319
|
-
id:
|
|
1320
|
-
brand: { name:
|
|
1309
|
+
sku: a,
|
|
1310
|
+
gtin: ((I = r[0]) == null ? void 0 : I.Value) ?? "",
|
|
1311
|
+
name: p ?? s,
|
|
1312
|
+
description: v,
|
|
1313
|
+
releaseDate: n.releaseDate ?? "",
|
|
1314
|
+
slug: y,
|
|
1315
|
+
video: d[0],
|
|
1316
|
+
categories: u,
|
|
1317
|
+
categoriesIds: w,
|
|
1318
|
+
collection: b,
|
|
1319
|
+
collectionId: m,
|
|
1320
|
+
id: h,
|
|
1321
|
+
brand: { name: l, brandName: l },
|
|
1321
1322
|
seo: {
|
|
1322
|
-
description:
|
|
1323
|
-
title:
|
|
1324
|
-
canonical:
|
|
1323
|
+
description: v,
|
|
1324
|
+
title: p,
|
|
1325
|
+
canonical: et(y)
|
|
1325
1326
|
},
|
|
1326
1327
|
cluster: {
|
|
1327
|
-
generals:
|
|
1328
|
+
generals: _,
|
|
1328
1329
|
highlights: []
|
|
1329
1330
|
// TODO: add highlights
|
|
1330
1331
|
},
|
|
1331
1332
|
availability: { status: E.offers[0].availability },
|
|
1332
1333
|
breadcrumbList: {
|
|
1333
1334
|
itemListElement: [
|
|
1334
|
-
...
|
|
1335
|
-
const
|
|
1335
|
+
...f.map((R, x) => {
|
|
1336
|
+
const j = R.split("/"), F = j[j.length - 2], D = j.map(Ye).join("/");
|
|
1336
1337
|
return {
|
|
1337
|
-
name:
|
|
1338
|
-
item:
|
|
1339
|
-
position:
|
|
1338
|
+
name: F,
|
|
1339
|
+
item: D,
|
|
1340
|
+
position: x + 1
|
|
1340
1341
|
};
|
|
1341
1342
|
}),
|
|
1342
1343
|
{
|
|
1343
|
-
name:
|
|
1344
|
-
item:
|
|
1345
|
-
position:
|
|
1344
|
+
name: n.productName,
|
|
1345
|
+
item: y,
|
|
1346
|
+
position: u.length + 1
|
|
1346
1347
|
}
|
|
1347
1348
|
],
|
|
1348
|
-
numberOfItems:
|
|
1349
|
+
numberOfItems: u.length
|
|
1349
1350
|
},
|
|
1350
|
-
image:
|
|
1351
|
+
image: Ze(i),
|
|
1351
1352
|
offers: E,
|
|
1352
|
-
additionalProperty:
|
|
1353
|
+
additionalProperty: de(g, t, []),
|
|
1353
1354
|
isVariantOf: {
|
|
1354
|
-
productGroupID:
|
|
1355
|
-
hasVariant:
|
|
1356
|
-
const { variations:
|
|
1357
|
-
name:
|
|
1358
|
-
values:
|
|
1355
|
+
productGroupID: n.productId,
|
|
1356
|
+
hasVariant: n.items.map((R) => {
|
|
1357
|
+
const { variations: x } = R, j = x.map((F) => ({
|
|
1358
|
+
name: F,
|
|
1359
|
+
values: R[F]
|
|
1359
1360
|
}));
|
|
1360
1361
|
return {
|
|
1361
|
-
...
|
|
1362
|
-
additionalProperty:
|
|
1363
|
-
|
|
1364
|
-
|
|
1362
|
+
...nt(R),
|
|
1363
|
+
additionalProperty: de(
|
|
1364
|
+
j,
|
|
1365
|
+
t,
|
|
1365
1366
|
[]
|
|
1366
1367
|
)
|
|
1367
1368
|
};
|
|
1368
1369
|
})
|
|
1369
1370
|
},
|
|
1370
|
-
installments:
|
|
1371
|
+
installments: q
|
|
1371
1372
|
};
|
|
1372
|
-
},
|
|
1373
|
-
key:
|
|
1374
|
-
value:
|
|
1373
|
+
}, vn = c.array().of(c.object({
|
|
1374
|
+
key: c.string().required(),
|
|
1375
|
+
value: c.string().required()
|
|
1375
1376
|
})).required("Facets are required");
|
|
1376
|
-
async function
|
|
1377
|
-
if (!
|
|
1377
|
+
async function yn({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
1378
|
+
if (!t) {
|
|
1378
1379
|
console.error("[ERROR FETCHING] Body is required");
|
|
1379
1380
|
return;
|
|
1380
1381
|
}
|
|
1381
|
-
await
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1384
|
-
const
|
|
1385
|
-
return
|
|
1382
|
+
await vn.validate(t);
|
|
1383
|
+
const n = new URLSearchParams({}), i = t.map(({ key: s, value: o }) => `${s}/${o}`).join("/");
|
|
1384
|
+
St(t, n);
|
|
1385
|
+
const a = `${e}/api/catalog_system/pub/products/crossselling/${i}`;
|
|
1386
|
+
return T(a, {
|
|
1386
1387
|
cache: "no-store",
|
|
1387
|
-
...
|
|
1388
|
-
}).then((
|
|
1389
|
-
const
|
|
1390
|
-
return
|
|
1391
|
-
}).filter((
|
|
1392
|
-
node:
|
|
1388
|
+
...r
|
|
1389
|
+
}).then((s) => s.map((d) => {
|
|
1390
|
+
const g = Je(d.items);
|
|
1391
|
+
return g && Xe(g, d);
|
|
1392
|
+
}).filter((d) => !!d).map((d) => ({
|
|
1393
|
+
node: wn(d)
|
|
1393
1394
|
})));
|
|
1394
1395
|
}
|
|
1395
|
-
const
|
|
1396
|
-
apiUrl:
|
|
1397
|
-
body:
|
|
1398
|
-
fetchOptions:
|
|
1399
|
-
extraData:
|
|
1396
|
+
const it = ({
|
|
1397
|
+
apiUrl: e,
|
|
1398
|
+
body: t,
|
|
1399
|
+
fetchOptions: r,
|
|
1400
|
+
extraData: n
|
|
1400
1401
|
}) => {
|
|
1401
|
-
if (!
|
|
1402
|
+
if (!t) {
|
|
1402
1403
|
console.error("[ERROR FETCHING] Body is required");
|
|
1403
1404
|
return;
|
|
1404
1405
|
}
|
|
1405
1406
|
const {
|
|
1406
|
-
query:
|
|
1407
|
-
page:
|
|
1408
|
-
count:
|
|
1409
|
-
sort:
|
|
1410
|
-
facets:
|
|
1411
|
-
type:
|
|
1412
|
-
hideUnavailableItems:
|
|
1413
|
-
locale:
|
|
1414
|
-
} =
|
|
1415
|
-
page:
|
|
1416
|
-
count: (
|
|
1417
|
-
query:
|
|
1418
|
-
sort:
|
|
1419
|
-
locale:
|
|
1407
|
+
query: i = "",
|
|
1408
|
+
page: a = 1,
|
|
1409
|
+
count: s,
|
|
1410
|
+
sort: o = "",
|
|
1411
|
+
facets: d = [],
|
|
1412
|
+
type: g,
|
|
1413
|
+
hideUnavailableItems: l = !0,
|
|
1414
|
+
locale: u = ""
|
|
1415
|
+
} = t, w = new URLSearchParams({
|
|
1416
|
+
page: a.toString(),
|
|
1417
|
+
count: (s == null ? void 0 : s.toString()) ?? (n == null ? void 0 : n.ITEMS_PER_PAGE) ?? 24,
|
|
1418
|
+
query: i,
|
|
1419
|
+
sort: o,
|
|
1420
|
+
locale: u
|
|
1420
1421
|
});
|
|
1421
|
-
|
|
1422
|
-
const
|
|
1423
|
-
return
|
|
1424
|
-
`${
|
|
1422
|
+
l !== void 0 && w.append("hideUnavailableItems", l.toString());
|
|
1423
|
+
const v = d.map((y) => `${y.key}/${y.value}`).join("/") ?? "";
|
|
1424
|
+
return cr(
|
|
1425
|
+
`${e}/api/io/_v/api/intelligent-search/${g}/${v}?${w.toString()}`,
|
|
1425
1426
|
{
|
|
1426
1427
|
headers: {
|
|
1427
1428
|
Accept: "application/json",
|
|
1428
1429
|
"content-type": "application/json"
|
|
1429
1430
|
},
|
|
1430
|
-
...
|
|
1431
|
+
...r
|
|
1431
1432
|
}
|
|
1432
1433
|
);
|
|
1433
1434
|
};
|
|
1434
|
-
async function
|
|
1435
|
-
if (!
|
|
1435
|
+
async function _n({ body: e, extraData: t, ...r }) {
|
|
1436
|
+
if (!e) {
|
|
1436
1437
|
console.error("[ERROR FETCHING] Body is required");
|
|
1437
1438
|
return;
|
|
1438
1439
|
}
|
|
1439
|
-
const
|
|
1440
|
+
const n = await it({
|
|
1440
1441
|
body: {
|
|
1441
|
-
...
|
|
1442
|
+
...e,
|
|
1442
1443
|
type: "product_search"
|
|
1443
1444
|
},
|
|
1444
|
-
extraData:
|
|
1445
|
-
...
|
|
1446
|
-
}),
|
|
1447
|
-
const
|
|
1448
|
-
return
|
|
1449
|
-
}).filter((
|
|
1450
|
-
pagination:
|
|
1451
|
-
recordsFiltered:
|
|
1452
|
-
} =
|
|
1445
|
+
extraData: t,
|
|
1446
|
+
...r
|
|
1447
|
+
}), i = (n == null ? void 0 : n.products.map((o) => {
|
|
1448
|
+
const d = Je(o.items);
|
|
1449
|
+
return d && Xe(d, o);
|
|
1450
|
+
}).filter((o) => !!o)) ?? [], {
|
|
1451
|
+
pagination: a,
|
|
1452
|
+
recordsFiltered: s
|
|
1453
|
+
} = n;
|
|
1453
1454
|
return {
|
|
1454
1455
|
data: {
|
|
1455
1456
|
pagination: {
|
|
1456
|
-
nextPage:
|
|
1457
|
-
previousPage:
|
|
1457
|
+
nextPage: a.after.length > 0,
|
|
1458
|
+
previousPage: a.before.length > 0,
|
|
1458
1459
|
startCursor: "0",
|
|
1459
|
-
endCursor:
|
|
1460
|
-
count:
|
|
1461
|
-
total:
|
|
1460
|
+
endCursor: s.toString(),
|
|
1461
|
+
count: s,
|
|
1462
|
+
total: a.count
|
|
1462
1463
|
},
|
|
1463
|
-
products:
|
|
1464
|
-
node:
|
|
1465
|
-
cursor:
|
|
1464
|
+
products: i.map((o, d) => ({
|
|
1465
|
+
node: bn(o),
|
|
1466
|
+
cursor: d.toString()
|
|
1466
1467
|
}))
|
|
1467
1468
|
}
|
|
1468
1469
|
};
|
|
1469
1470
|
}
|
|
1470
|
-
async function
|
|
1471
|
-
if (!
|
|
1471
|
+
async function Rn({ body: e, extraData: t, ...r }) {
|
|
1472
|
+
if (!e) {
|
|
1472
1473
|
console.error("[ERROR FETCHING] Body is required");
|
|
1473
1474
|
return;
|
|
1474
1475
|
}
|
|
1475
|
-
const
|
|
1476
|
+
const n = await it({
|
|
1476
1477
|
body: {
|
|
1477
|
-
...
|
|
1478
|
+
...e,
|
|
1478
1479
|
type: "facets"
|
|
1479
1480
|
},
|
|
1480
|
-
extraData:
|
|
1481
|
-
...
|
|
1481
|
+
extraData: t,
|
|
1482
|
+
...r
|
|
1482
1483
|
});
|
|
1483
|
-
return !
|
|
1484
|
+
return !n || !n.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
|
|
1484
1485
|
data: {
|
|
1485
|
-
...
|
|
1486
|
-
facets:
|
|
1486
|
+
...n,
|
|
1487
|
+
facets: Ct(n, e == null ? void 0 : e.selectedFacets, (e == null ? void 0 : e.query) ?? "")
|
|
1487
1488
|
}
|
|
1488
1489
|
};
|
|
1489
1490
|
}
|
|
1490
|
-
const
|
|
1491
|
-
query:
|
|
1492
|
-
locale:
|
|
1491
|
+
const In = c.object({
|
|
1492
|
+
query: c.string().optional(),
|
|
1493
|
+
locale: c.string().optional()
|
|
1493
1494
|
});
|
|
1494
|
-
async function
|
|
1495
|
-
if (!
|
|
1495
|
+
async function Pn({ apiUrl: e, body: t, fetchOptions: r }) {
|
|
1496
|
+
if (!t) {
|
|
1496
1497
|
console.error("[ERROR FETCHING] Body is required");
|
|
1497
1498
|
return;
|
|
1498
1499
|
}
|
|
1499
|
-
await
|
|
1500
|
-
const { query:
|
|
1501
|
-
return
|
|
1502
|
-
`${
|
|
1500
|
+
await In.validate(t);
|
|
1501
|
+
const { query: n = "", locale: i = "default_locale" } = t, a = new URLSearchParams({ query: n, locale: i });
|
|
1502
|
+
return T(
|
|
1503
|
+
`${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
|
|
1503
1504
|
{
|
|
1504
|
-
...
|
|
1505
|
+
...r
|
|
1505
1506
|
}
|
|
1506
1507
|
);
|
|
1507
1508
|
}
|
|
1508
|
-
async function
|
|
1509
|
-
return
|
|
1509
|
+
async function Sn({ apiUrl: e }) {
|
|
1510
|
+
return T(`${e}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1510
1511
|
}
|
|
1511
|
-
const
|
|
1512
|
+
const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1512
1513
|
__proto__: null,
|
|
1513
|
-
getSearchAutoCompleteSuggestions:
|
|
1514
|
-
getSearchCrossellingProducts:
|
|
1515
|
-
getSearchFacets:
|
|
1516
|
-
getSearchProducts:
|
|
1517
|
-
getSearchSuggestedTerms:
|
|
1518
|
-
getSearchTopSearchs:
|
|
1519
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1520
|
-
masterDataEntity:
|
|
1521
|
-
payload:
|
|
1514
|
+
getSearchAutoCompleteSuggestions: on,
|
|
1515
|
+
getSearchCrossellingProducts: yn,
|
|
1516
|
+
getSearchFacets: Rn,
|
|
1517
|
+
getSearchProducts: _n,
|
|
1518
|
+
getSearchSuggestedTerms: Pn,
|
|
1519
|
+
getSearchTopSearchs: Sn
|
|
1520
|
+
}, Symbol.toStringTag, { value: "Module" })), xn = c.object({
|
|
1521
|
+
masterDataEntity: c.string().nonNullable(),
|
|
1522
|
+
payload: c.object().shape({}).nullable()
|
|
1522
1523
|
});
|
|
1523
|
-
async function
|
|
1524
|
-
apiUrl:
|
|
1525
|
-
body:
|
|
1526
|
-
fetchOptions:
|
|
1524
|
+
async function kn({
|
|
1525
|
+
apiUrl: e,
|
|
1526
|
+
body: t,
|
|
1527
|
+
fetchOptions: r
|
|
1527
1528
|
}) {
|
|
1528
|
-
if (!
|
|
1529
|
+
if (!t) {
|
|
1529
1530
|
console.error("[ERROR FETCHING] Body is required");
|
|
1530
1531
|
return;
|
|
1531
1532
|
}
|
|
1532
|
-
await
|
|
1533
|
-
const { masterDataEntity:
|
|
1534
|
-
return
|
|
1533
|
+
await xn.validate(t);
|
|
1534
|
+
const { masterDataEntity: n, payload: i } = t, a = `${e}/api/dataentities/${n}/documents`;
|
|
1535
|
+
return T(a, {
|
|
1535
1536
|
method: "POST",
|
|
1536
1537
|
body: {
|
|
1537
|
-
payload:
|
|
1538
|
+
payload: i
|
|
1538
1539
|
},
|
|
1539
|
-
...
|
|
1540
|
+
...r
|
|
1540
1541
|
});
|
|
1541
1542
|
}
|
|
1542
|
-
const
|
|
1543
|
-
_where:
|
|
1544
|
-
_fields:
|
|
1545
|
-
_sort:
|
|
1546
|
-
_from:
|
|
1547
|
-
_to:
|
|
1548
|
-
_keyword:
|
|
1549
|
-
}),
|
|
1550
|
-
masterDataEntity:
|
|
1551
|
-
searchFields:
|
|
1552
|
-
headers:
|
|
1553
|
-
"REST-Range":
|
|
1543
|
+
const En = c.object().shape({
|
|
1544
|
+
_where: c.string().optional(),
|
|
1545
|
+
_fields: c.string().optional(),
|
|
1546
|
+
_sort: c.string().optional(),
|
|
1547
|
+
_from: c.number().integer().min(0).optional(),
|
|
1548
|
+
_to: c.number().integer().min(0).optional(),
|
|
1549
|
+
_keyword: c.string().optional()
|
|
1550
|
+
}), An = c.object({
|
|
1551
|
+
masterDataEntity: c.string().required(),
|
|
1552
|
+
searchFields: En,
|
|
1553
|
+
headers: c.object().shape({
|
|
1554
|
+
"REST-Range": c.string().notRequired()
|
|
1554
1555
|
})
|
|
1555
1556
|
});
|
|
1556
|
-
async function
|
|
1557
|
-
apiUrl:
|
|
1558
|
-
body:
|
|
1559
|
-
fetchOptions:
|
|
1557
|
+
async function Tn({
|
|
1558
|
+
apiUrl: e,
|
|
1559
|
+
body: t,
|
|
1560
|
+
fetchOptions: r
|
|
1560
1561
|
}) {
|
|
1561
|
-
if (!
|
|
1562
|
+
if (!t) {
|
|
1562
1563
|
console.error("[ERROR FETCHING] Body is required");
|
|
1563
1564
|
return;
|
|
1564
1565
|
}
|
|
1565
|
-
const
|
|
1566
|
-
await
|
|
1567
|
-
const { masterDataEntity:
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
}), "_fields" in
|
|
1571
|
-
let
|
|
1566
|
+
const n = new URLSearchParams();
|
|
1567
|
+
await An.validate(t);
|
|
1568
|
+
const { masterDataEntity: i, searchFields: a, headers: s } = t;
|
|
1569
|
+
a && Object.entries(a).forEach(([g, l]) => {
|
|
1570
|
+
n.append(g, String(l));
|
|
1571
|
+
}), "_fields" in a || n == null || n.append("_fields", "_all");
|
|
1572
|
+
let o = [], d = null;
|
|
1572
1573
|
do {
|
|
1573
|
-
|
|
1574
|
-
const
|
|
1575
|
-
`${
|
|
1574
|
+
d && n.set("_scroll", d);
|
|
1575
|
+
const g = await fetch(
|
|
1576
|
+
`${e}/api/dataentities/${i}/search?${n.toString()}`,
|
|
1576
1577
|
{
|
|
1577
1578
|
method: "GET",
|
|
1578
1579
|
headers: {
|
|
1579
|
-
"REST-Range": (
|
|
1580
|
-
...
|
|
1580
|
+
"REST-Range": (s == null ? void 0 : s["REST-Range"]) ?? "resources=0-100",
|
|
1581
|
+
...r == null ? void 0 : r.headers
|
|
1581
1582
|
},
|
|
1582
1583
|
cache: "no-store"
|
|
1583
1584
|
}
|
|
1584
1585
|
);
|
|
1585
|
-
if (!
|
|
1586
|
+
if (!g.ok)
|
|
1586
1587
|
throw new Error(
|
|
1587
|
-
`[MasterData] ${
|
|
1588
|
+
`[MasterData] ${g.status} - ${g.statusText}`
|
|
1588
1589
|
);
|
|
1589
|
-
const
|
|
1590
|
-
|
|
1591
|
-
} while (
|
|
1592
|
-
return
|
|
1590
|
+
const l = await g.json();
|
|
1591
|
+
o.push(...l), d = g.headers.get("x-vtex-md-scroll");
|
|
1592
|
+
} while (d);
|
|
1593
|
+
return o;
|
|
1593
1594
|
}
|
|
1594
|
-
const
|
|
1595
|
-
dataEntityName:
|
|
1596
|
-
id:
|
|
1597
|
-
fieldsToBeUpdated:
|
|
1595
|
+
const On = c.object({
|
|
1596
|
+
dataEntityName: c.string().required(),
|
|
1597
|
+
id: c.string().required(),
|
|
1598
|
+
fieldsToBeUpdated: c.object().shape({})
|
|
1598
1599
|
});
|
|
1599
|
-
async function
|
|
1600
|
-
apiUrl:
|
|
1601
|
-
body:
|
|
1602
|
-
fetchOptions:
|
|
1600
|
+
async function qn({
|
|
1601
|
+
apiUrl: e,
|
|
1602
|
+
body: t,
|
|
1603
|
+
fetchOptions: r
|
|
1603
1604
|
}) {
|
|
1604
|
-
if (!
|
|
1605
|
+
if (!t) {
|
|
1605
1606
|
console.error("[ERROR FETCHING] Body is required");
|
|
1606
1607
|
return;
|
|
1607
1608
|
}
|
|
1608
|
-
await
|
|
1609
|
-
const { dataEntityName:
|
|
1610
|
-
return
|
|
1609
|
+
await On.validate(t);
|
|
1610
|
+
const { dataEntityName: n, id: i, fieldsToBeUpdated: a } = t, s = `${e}/api/dataentities/${n}/documents/${i}`;
|
|
1611
|
+
return T(s, {
|
|
1611
1612
|
body: {
|
|
1612
|
-
fieldsToBeUpdated:
|
|
1613
|
+
fieldsToBeUpdated: a
|
|
1613
1614
|
},
|
|
1614
1615
|
method: "PATCH",
|
|
1615
|
-
...
|
|
1616
|
+
...r
|
|
1616
1617
|
});
|
|
1617
1618
|
}
|
|
1618
|
-
const
|
|
1619
|
+
const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1619
1620
|
__proto__: null,
|
|
1620
|
-
getSearchMasterdata:
|
|
1621
|
-
patchUpdateMasterdata:
|
|
1622
|
-
postMasterdata:
|
|
1621
|
+
getSearchMasterdata: Tn,
|
|
1622
|
+
patchUpdateMasterdata: qn,
|
|
1623
|
+
postMasterdata: kn
|
|
1623
1624
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1624
|
-
async function
|
|
1625
|
-
const { productIds:
|
|
1626
|
-
if (!
|
|
1625
|
+
async function jn({ body: e, apiUrl: t, extraData: r, fetchOptions: n }) {
|
|
1626
|
+
const { productIds: i } = e;
|
|
1627
|
+
if (!i)
|
|
1627
1628
|
return console.error("[ERROR FETCHING] productIds is required"), [];
|
|
1628
|
-
const { NAME_SPLIT_SYMBOL:
|
|
1629
|
-
if (!
|
|
1629
|
+
const { NAME_SPLIT_SYMBOL: a } = r;
|
|
1630
|
+
if (!a)
|
|
1630
1631
|
return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
|
|
1631
|
-
const
|
|
1632
|
-
`${
|
|
1632
|
+
const s = i.map((l) => typeof l == "string" || typeof l == "number" ? `productId:${l}` : "").join("&fq="), o = await T(
|
|
1633
|
+
`${t}/api/catalog_system/pub/products/search?fq=${s}`,
|
|
1633
1634
|
{
|
|
1634
|
-
...
|
|
1635
|
+
...n
|
|
1635
1636
|
}
|
|
1636
|
-
),
|
|
1637
|
-
return
|
|
1638
|
-
var
|
|
1639
|
-
const { installments:
|
|
1637
|
+
), d = (l) => Object.keys(l).map((u) => ({ id: u, name: l[u] }));
|
|
1638
|
+
return o.map((l, u) => {
|
|
1639
|
+
var h;
|
|
1640
|
+
const { installments: w, price: v, listPrice: y, sizes: _, allSizesAvailable: p } = xt({ items: l.items, NAME_SPLIT_SYMBOL: a }), b = p ? !0 : _.some((f) => f.available), m = l.items[0].sellers[0].commertialOffer;
|
|
1640
1641
|
return {
|
|
1641
1642
|
node: {
|
|
1642
|
-
sku:
|
|
1643
|
-
gtin:
|
|
1644
|
-
name:
|
|
1645
|
-
description:
|
|
1646
|
-
releaseDate:
|
|
1647
|
-
slug:
|
|
1648
|
-
categories:
|
|
1649
|
-
categoriesIds:
|
|
1650
|
-
id:
|
|
1643
|
+
sku: l.items[0].itemId,
|
|
1644
|
+
gtin: l.productReference,
|
|
1645
|
+
name: l.productName,
|
|
1646
|
+
description: l.description,
|
|
1647
|
+
releaseDate: l.releaseDate,
|
|
1648
|
+
slug: l.linkText,
|
|
1649
|
+
categories: l.categories,
|
|
1650
|
+
categoriesIds: l.categoriesIds,
|
|
1651
|
+
id: l.items[0].itemId,
|
|
1651
1652
|
brand: {
|
|
1652
|
-
name:
|
|
1653
|
-
brandName:
|
|
1653
|
+
name: l.brand,
|
|
1654
|
+
brandName: l.brand
|
|
1654
1655
|
},
|
|
1655
1656
|
seo: {
|
|
1656
|
-
description:
|
|
1657
|
-
title:
|
|
1658
|
-
canonical: `/${
|
|
1657
|
+
description: l.description,
|
|
1658
|
+
title: l.productName,
|
|
1659
|
+
canonical: `/${l.linkText}/p`
|
|
1659
1660
|
},
|
|
1660
1661
|
cluster: {
|
|
1661
|
-
generals:
|
|
1662
|
-
highlights:
|
|
1662
|
+
generals: d(l.productClusters),
|
|
1663
|
+
highlights: d(l.clusterHighlights)
|
|
1663
1664
|
},
|
|
1664
1665
|
availability: {
|
|
1665
|
-
status:
|
|
1666
|
+
status: b
|
|
1666
1667
|
},
|
|
1667
|
-
image:
|
|
1668
|
+
image: l.items[0].images.map(
|
|
1668
1669
|
({
|
|
1669
|
-
imageLabel:
|
|
1670
|
+
imageLabel: f,
|
|
1670
1671
|
imageUrl: E
|
|
1671
1672
|
}) => ({
|
|
1672
|
-
alternateName:
|
|
1673
|
+
alternateName: f,
|
|
1673
1674
|
url: E,
|
|
1674
|
-
keywords:
|
|
1675
|
+
keywords: f
|
|
1675
1676
|
})
|
|
1676
1677
|
),
|
|
1677
1678
|
offers: {
|
|
1678
|
-
lowPrice:
|
|
1679
|
-
highPrice:
|
|
1679
|
+
lowPrice: v,
|
|
1680
|
+
highPrice: y,
|
|
1680
1681
|
offers: [
|
|
1681
1682
|
{
|
|
1682
|
-
availability:
|
|
1683
|
-
listPrice:
|
|
1684
|
-
price:
|
|
1685
|
-
priceValidUntil:
|
|
1683
|
+
availability: b,
|
|
1684
|
+
listPrice: y,
|
|
1685
|
+
price: v,
|
|
1686
|
+
priceValidUntil: m.PriceValidUntil,
|
|
1686
1687
|
priceCurrency: "BRL",
|
|
1687
|
-
installments:
|
|
1688
|
-
lowPrice:
|
|
1689
|
-
quantity:
|
|
1688
|
+
installments: m.Installments,
|
|
1689
|
+
lowPrice: v,
|
|
1690
|
+
quantity: m.AvailableQuantity,
|
|
1690
1691
|
seller: {
|
|
1691
|
-
identifier:
|
|
1692
|
+
identifier: l.items[0].sellers[0].sellerId
|
|
1692
1693
|
}
|
|
1693
1694
|
}
|
|
1694
1695
|
]
|
|
1695
1696
|
},
|
|
1696
|
-
additionalProperty: (
|
|
1697
|
-
name:
|
|
1698
|
-
value:
|
|
1697
|
+
additionalProperty: (h = l == null ? void 0 : l.skuSpecifications) == null ? void 0 : h.map((f) => ({
|
|
1698
|
+
name: l == null ? void 0 : l.skuSpecifications[0].field.name,
|
|
1699
|
+
value: f,
|
|
1699
1700
|
valueReference: "SPECIFICATION"
|
|
1700
1701
|
})),
|
|
1701
1702
|
isVariantOf: {
|
|
1702
|
-
productGroupID:
|
|
1703
|
-
hasVariant:
|
|
1703
|
+
productGroupID: l.productId,
|
|
1704
|
+
hasVariant: l.items.map((f) => {
|
|
1704
1705
|
var E;
|
|
1705
1706
|
return {
|
|
1706
|
-
additionalProperty:
|
|
1707
|
-
var
|
|
1707
|
+
additionalProperty: f == null ? void 0 : f.variations.map(() => {
|
|
1708
|
+
var q, I, R;
|
|
1708
1709
|
return {
|
|
1709
|
-
name: (
|
|
1710
|
-
value: (
|
|
1710
|
+
name: (q = f == null ? void 0 : f.variations) == null ? void 0 : q[0],
|
|
1711
|
+
value: (R = f == null ? void 0 : f[(I = f == null ? void 0 : f.variations) == null ? void 0 : I[0]]) == null ? void 0 : R[0],
|
|
1711
1712
|
valueReference: "SPECIFICATION"
|
|
1712
1713
|
};
|
|
1713
1714
|
}),
|
|
1714
|
-
name:
|
|
1715
|
+
name: f.name,
|
|
1715
1716
|
offers: {
|
|
1716
|
-
offers: (E =
|
|
1717
|
-
({ commertialOffer:
|
|
1717
|
+
offers: (E = f.sellers) == null ? void 0 : E.map(
|
|
1718
|
+
({ commertialOffer: q, sellerId: I }) => ({
|
|
1718
1719
|
availability: "https://schema.org/InStock",
|
|
1719
|
-
listPrice:
|
|
1720
|
-
price:
|
|
1721
|
-
quantity:
|
|
1720
|
+
listPrice: q.ListPrice,
|
|
1721
|
+
price: q.Price,
|
|
1722
|
+
quantity: q.AvailableQuantity,
|
|
1722
1723
|
seller: {
|
|
1723
|
-
identifier:
|
|
1724
|
+
identifier: I
|
|
1724
1725
|
}
|
|
1725
1726
|
})
|
|
1726
1727
|
)
|
|
1727
1728
|
},
|
|
1728
|
-
sku:
|
|
1729
|
-
slug: `-${
|
|
1729
|
+
sku: f.itemId,
|
|
1730
|
+
slug: `-${f.itemId}`
|
|
1730
1731
|
};
|
|
1731
1732
|
})
|
|
1732
1733
|
},
|
|
1733
|
-
installments:
|
|
1734
|
+
installments: w
|
|
1734
1735
|
},
|
|
1735
|
-
cursor:
|
|
1736
|
+
cursor: u.toString()
|
|
1737
|
+
};
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1741
|
+
__proto__: null,
|
|
1742
|
+
getWishlistProducts: jn
|
|
1743
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1744
|
+
var Ie = { exports: {} }, ot = {}, Se = {}, at = {}, st = {};
|
|
1745
|
+
(function(e) {
|
|
1746
|
+
Object.defineProperty(e, "__esModule", {
|
|
1747
|
+
value: !0
|
|
1748
|
+
}), Object.defineProperty(e, "addPathSuffix", {
|
|
1749
|
+
enumerable: !0,
|
|
1750
|
+
get: function() {
|
|
1751
|
+
return r;
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
const t = kt;
|
|
1755
|
+
function r(n, i) {
|
|
1756
|
+
if (!n.startsWith("/") || !i)
|
|
1757
|
+
return n;
|
|
1758
|
+
const { pathname: a, query: s, hash: o } = (0, t.parsePath)(n);
|
|
1759
|
+
return "" + a + i + s + o;
|
|
1760
|
+
}
|
|
1761
|
+
})(st);
|
|
1762
|
+
(function(e) {
|
|
1763
|
+
Object.defineProperty(e, "__esModule", {
|
|
1764
|
+
value: !0
|
|
1765
|
+
}), Object.defineProperty(e, "formatNextPathnameInfo", {
|
|
1766
|
+
enumerable: !0,
|
|
1767
|
+
get: function() {
|
|
1768
|
+
return a;
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
const t = At, r = Tt, n = st, i = Et;
|
|
1772
|
+
function a(s) {
|
|
1773
|
+
let o = (0, i.addLocale)(s.pathname, s.locale, s.buildId ? void 0 : s.defaultLocale, s.ignorePrefix);
|
|
1774
|
+
return (s.buildId || !s.trailingSlash) && (o = (0, t.removeTrailingSlash)(o)), s.buildId && (o = (0, n.addPathSuffix)((0, r.addPathPrefix)(o, "/_next/data/" + s.buildId), s.pathname === "/" ? "index.json" : ".json")), o = (0, r.addPathPrefix)(o, s.basePath), !s.buildId && s.trailingSlash ? o.endsWith("/") ? o : (0, n.addPathSuffix)(o, "/") : (0, t.removeTrailingSlash)(o);
|
|
1775
|
+
}
|
|
1776
|
+
})(at);
|
|
1777
|
+
var lt = {};
|
|
1778
|
+
(function(e) {
|
|
1779
|
+
Object.defineProperty(e, "__esModule", {
|
|
1780
|
+
value: !0
|
|
1781
|
+
}), Object.defineProperty(e, "getHostname", {
|
|
1782
|
+
enumerable: !0,
|
|
1783
|
+
get: function() {
|
|
1784
|
+
return t;
|
|
1785
|
+
}
|
|
1786
|
+
});
|
|
1787
|
+
function t(r, n) {
|
|
1788
|
+
let i;
|
|
1789
|
+
if (n != null && n.host && !Array.isArray(n.host))
|
|
1790
|
+
i = n.host.toString().split(":", 1)[0];
|
|
1791
|
+
else if (r.hostname)
|
|
1792
|
+
i = r.hostname;
|
|
1793
|
+
else return;
|
|
1794
|
+
return i.toLowerCase();
|
|
1795
|
+
}
|
|
1796
|
+
})(lt);
|
|
1797
|
+
var ct = {}, ut = {};
|
|
1798
|
+
(function(e) {
|
|
1799
|
+
Object.defineProperty(e, "__esModule", {
|
|
1800
|
+
value: !0
|
|
1801
|
+
}), Object.defineProperty(e, "removePathPrefix", {
|
|
1802
|
+
enumerable: !0,
|
|
1803
|
+
get: function() {
|
|
1804
|
+
return r;
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
const t = Ve;
|
|
1808
|
+
function r(n, i) {
|
|
1809
|
+
if (!(0, t.pathHasPrefix)(n, i))
|
|
1810
|
+
return n;
|
|
1811
|
+
const a = n.slice(i.length);
|
|
1812
|
+
return a.startsWith("/") ? a : "/" + a;
|
|
1813
|
+
}
|
|
1814
|
+
})(ut);
|
|
1815
|
+
(function(e) {
|
|
1816
|
+
Object.defineProperty(e, "__esModule", {
|
|
1817
|
+
value: !0
|
|
1818
|
+
}), Object.defineProperty(e, "getNextPathnameInfo", {
|
|
1819
|
+
enumerable: !0,
|
|
1820
|
+
get: function() {
|
|
1821
|
+
return i;
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1824
|
+
const t = Ot, r = ut, n = Ve;
|
|
1825
|
+
function i(a, s) {
|
|
1826
|
+
var o;
|
|
1827
|
+
const { basePath: d, i18n: g, trailingSlash: l } = (o = s.nextConfig) != null ? o : {}, u = {
|
|
1828
|
+
pathname: a,
|
|
1829
|
+
trailingSlash: a !== "/" ? a.endsWith("/") : l
|
|
1830
|
+
};
|
|
1831
|
+
d && (0, n.pathHasPrefix)(u.pathname, d) && (u.pathname = (0, r.removePathPrefix)(u.pathname, d), u.basePath = d);
|
|
1832
|
+
let w = u.pathname;
|
|
1833
|
+
if (u.pathname.startsWith("/_next/data/") && u.pathname.endsWith(".json")) {
|
|
1834
|
+
const y = u.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), _ = y[0];
|
|
1835
|
+
u.buildId = _, w = y[1] !== "index" ? "/" + y.slice(1).join("/") : "/", s.parseData === !0 && (u.pathname = w);
|
|
1836
|
+
}
|
|
1837
|
+
if (g) {
|
|
1838
|
+
let y = s.i18nProvider ? s.i18nProvider.analyze(u.pathname) : (0, t.normalizeLocalePath)(u.pathname, g.locales);
|
|
1839
|
+
u.locale = y.detectedLocale;
|
|
1840
|
+
var v;
|
|
1841
|
+
u.pathname = (v = y.pathname) != null ? v : u.pathname, !y.detectedLocale && u.buildId && (y = s.i18nProvider ? s.i18nProvider.analyze(w) : (0, t.normalizeLocalePath)(w, g.locales), y.detectedLocale && (u.locale = y.detectedLocale));
|
|
1842
|
+
}
|
|
1843
|
+
return u;
|
|
1844
|
+
}
|
|
1845
|
+
})(ct);
|
|
1846
|
+
(function(e) {
|
|
1847
|
+
Object.defineProperty(e, "__esModule", {
|
|
1848
|
+
value: !0
|
|
1849
|
+
}), Object.defineProperty(e, "NextURL", {
|
|
1850
|
+
enumerable: !0,
|
|
1851
|
+
get: function() {
|
|
1852
|
+
return d;
|
|
1853
|
+
}
|
|
1854
|
+
});
|
|
1855
|
+
const t = qt, r = at, n = lt, i = ct, a = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;
|
|
1856
|
+
function s(g, l) {
|
|
1857
|
+
return new URL(String(g).replace(a, "localhost"), l && String(l).replace(a, "localhost"));
|
|
1858
|
+
}
|
|
1859
|
+
const o = Symbol("NextURLInternal");
|
|
1860
|
+
class d {
|
|
1861
|
+
constructor(l, u, w) {
|
|
1862
|
+
let v, y;
|
|
1863
|
+
typeof u == "object" && "pathname" in u || typeof u == "string" ? (v = u, y = w || {}) : y = w || u || {}, this[o] = {
|
|
1864
|
+
url: s(l, v ?? y.base),
|
|
1865
|
+
options: y,
|
|
1866
|
+
basePath: ""
|
|
1867
|
+
}, this.analyze();
|
|
1868
|
+
}
|
|
1869
|
+
analyze() {
|
|
1870
|
+
var l, u, w, v, y;
|
|
1871
|
+
const _ = (0, i.getNextPathnameInfo)(this[o].url.pathname, {
|
|
1872
|
+
nextConfig: this[o].options.nextConfig,
|
|
1873
|
+
parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,
|
|
1874
|
+
i18nProvider: this[o].options.i18nProvider
|
|
1875
|
+
}), p = (0, n.getHostname)(this[o].url, this[o].options.headers);
|
|
1876
|
+
this[o].domainLocale = this[o].options.i18nProvider ? this[o].options.i18nProvider.detectDomainLocale(p) : (0, t.detectDomainLocale)((u = this[o].options.nextConfig) == null || (l = u.i18n) == null ? void 0 : l.domains, p);
|
|
1877
|
+
const b = ((w = this[o].domainLocale) == null ? void 0 : w.defaultLocale) || ((y = this[o].options.nextConfig) == null || (v = y.i18n) == null ? void 0 : v.defaultLocale);
|
|
1878
|
+
this[o].url.pathname = _.pathname, this[o].defaultLocale = b, this[o].basePath = _.basePath ?? "", this[o].buildId = _.buildId, this[o].locale = _.locale ?? b, this[o].trailingSlash = _.trailingSlash;
|
|
1879
|
+
}
|
|
1880
|
+
formatPathname() {
|
|
1881
|
+
return (0, r.formatNextPathnameInfo)({
|
|
1882
|
+
basePath: this[o].basePath,
|
|
1883
|
+
buildId: this[o].buildId,
|
|
1884
|
+
defaultLocale: this[o].options.forceLocale ? void 0 : this[o].defaultLocale,
|
|
1885
|
+
locale: this[o].locale,
|
|
1886
|
+
pathname: this[o].url.pathname,
|
|
1887
|
+
trailingSlash: this[o].trailingSlash
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
formatSearch() {
|
|
1891
|
+
return this[o].url.search;
|
|
1892
|
+
}
|
|
1893
|
+
get buildId() {
|
|
1894
|
+
return this[o].buildId;
|
|
1895
|
+
}
|
|
1896
|
+
set buildId(l) {
|
|
1897
|
+
this[o].buildId = l;
|
|
1898
|
+
}
|
|
1899
|
+
get locale() {
|
|
1900
|
+
return this[o].locale ?? "";
|
|
1901
|
+
}
|
|
1902
|
+
set locale(l) {
|
|
1903
|
+
var u, w;
|
|
1904
|
+
if (!this[o].locale || !(!((w = this[o].options.nextConfig) == null || (u = w.i18n) == null) && u.locales.includes(l)))
|
|
1905
|
+
throw new TypeError(`The NextURL configuration includes no locale "${l}"`);
|
|
1906
|
+
this[o].locale = l;
|
|
1907
|
+
}
|
|
1908
|
+
get defaultLocale() {
|
|
1909
|
+
return this[o].defaultLocale;
|
|
1910
|
+
}
|
|
1911
|
+
get domainLocale() {
|
|
1912
|
+
return this[o].domainLocale;
|
|
1913
|
+
}
|
|
1914
|
+
get searchParams() {
|
|
1915
|
+
return this[o].url.searchParams;
|
|
1916
|
+
}
|
|
1917
|
+
get host() {
|
|
1918
|
+
return this[o].url.host;
|
|
1919
|
+
}
|
|
1920
|
+
set host(l) {
|
|
1921
|
+
this[o].url.host = l;
|
|
1922
|
+
}
|
|
1923
|
+
get hostname() {
|
|
1924
|
+
return this[o].url.hostname;
|
|
1925
|
+
}
|
|
1926
|
+
set hostname(l) {
|
|
1927
|
+
this[o].url.hostname = l;
|
|
1928
|
+
}
|
|
1929
|
+
get port() {
|
|
1930
|
+
return this[o].url.port;
|
|
1931
|
+
}
|
|
1932
|
+
set port(l) {
|
|
1933
|
+
this[o].url.port = l;
|
|
1934
|
+
}
|
|
1935
|
+
get protocol() {
|
|
1936
|
+
return this[o].url.protocol;
|
|
1937
|
+
}
|
|
1938
|
+
set protocol(l) {
|
|
1939
|
+
this[o].url.protocol = l;
|
|
1940
|
+
}
|
|
1941
|
+
get href() {
|
|
1942
|
+
const l = this.formatPathname(), u = this.formatSearch();
|
|
1943
|
+
return `${this.protocol}//${this.host}${l}${u}${this.hash}`;
|
|
1944
|
+
}
|
|
1945
|
+
set href(l) {
|
|
1946
|
+
this[o].url = s(l), this.analyze();
|
|
1947
|
+
}
|
|
1948
|
+
get origin() {
|
|
1949
|
+
return this[o].url.origin;
|
|
1950
|
+
}
|
|
1951
|
+
get pathname() {
|
|
1952
|
+
return this[o].url.pathname;
|
|
1953
|
+
}
|
|
1954
|
+
set pathname(l) {
|
|
1955
|
+
this[o].url.pathname = l;
|
|
1956
|
+
}
|
|
1957
|
+
get hash() {
|
|
1958
|
+
return this[o].url.hash;
|
|
1959
|
+
}
|
|
1960
|
+
set hash(l) {
|
|
1961
|
+
this[o].url.hash = l;
|
|
1962
|
+
}
|
|
1963
|
+
get search() {
|
|
1964
|
+
return this[o].url.search;
|
|
1965
|
+
}
|
|
1966
|
+
set search(l) {
|
|
1967
|
+
this[o].url.search = l;
|
|
1968
|
+
}
|
|
1969
|
+
get password() {
|
|
1970
|
+
return this[o].url.password;
|
|
1971
|
+
}
|
|
1972
|
+
set password(l) {
|
|
1973
|
+
this[o].url.password = l;
|
|
1974
|
+
}
|
|
1975
|
+
get username() {
|
|
1976
|
+
return this[o].url.username;
|
|
1977
|
+
}
|
|
1978
|
+
set username(l) {
|
|
1979
|
+
this[o].url.username = l;
|
|
1980
|
+
}
|
|
1981
|
+
get basePath() {
|
|
1982
|
+
return this[o].basePath;
|
|
1983
|
+
}
|
|
1984
|
+
set basePath(l) {
|
|
1985
|
+
this[o].basePath = l.startsWith("/") ? l : `/${l}`;
|
|
1986
|
+
}
|
|
1987
|
+
toString() {
|
|
1988
|
+
return this.href;
|
|
1989
|
+
}
|
|
1990
|
+
toJSON() {
|
|
1991
|
+
return this.href;
|
|
1992
|
+
}
|
|
1993
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1994
|
+
return {
|
|
1995
|
+
href: this.href,
|
|
1996
|
+
origin: this.origin,
|
|
1997
|
+
protocol: this.protocol,
|
|
1998
|
+
username: this.username,
|
|
1999
|
+
password: this.password,
|
|
2000
|
+
host: this.host,
|
|
2001
|
+
hostname: this.hostname,
|
|
2002
|
+
port: this.port,
|
|
2003
|
+
pathname: this.pathname,
|
|
2004
|
+
search: this.search,
|
|
2005
|
+
searchParams: this.searchParams,
|
|
2006
|
+
hash: this.hash
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
clone() {
|
|
2010
|
+
return new d(String(this), this[o].options);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
})(Se);
|
|
2014
|
+
var Ce = {};
|
|
2015
|
+
(function(e) {
|
|
2016
|
+
Object.defineProperty(e, "__esModule", {
|
|
2017
|
+
value: !0
|
|
2018
|
+
});
|
|
2019
|
+
function t(d, g) {
|
|
2020
|
+
for (var l in g) Object.defineProperty(d, l, {
|
|
2021
|
+
enumerable: !0,
|
|
2022
|
+
get: g[l]
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
t(e, {
|
|
2026
|
+
fromNodeOutgoingHttpHeaders: function() {
|
|
2027
|
+
return n;
|
|
2028
|
+
},
|
|
2029
|
+
normalizeNextQueryParam: function() {
|
|
2030
|
+
return o;
|
|
2031
|
+
},
|
|
2032
|
+
splitCookiesString: function() {
|
|
2033
|
+
return i;
|
|
2034
|
+
},
|
|
2035
|
+
toNodeOutgoingHttpHeaders: function() {
|
|
2036
|
+
return a;
|
|
2037
|
+
},
|
|
2038
|
+
validateURL: function() {
|
|
2039
|
+
return s;
|
|
2040
|
+
}
|
|
2041
|
+
});
|
|
2042
|
+
const r = Nt;
|
|
2043
|
+
function n(d) {
|
|
2044
|
+
const g = new Headers();
|
|
2045
|
+
for (let [l, u] of Object.entries(d)) {
|
|
2046
|
+
const w = Array.isArray(u) ? u : [
|
|
2047
|
+
u
|
|
2048
|
+
];
|
|
2049
|
+
for (let v of w)
|
|
2050
|
+
typeof v > "u" || (typeof v == "number" && (v = v.toString()), g.append(l, v));
|
|
2051
|
+
}
|
|
2052
|
+
return g;
|
|
2053
|
+
}
|
|
2054
|
+
function i(d) {
|
|
2055
|
+
var g = [], l = 0, u, w, v, y, _;
|
|
2056
|
+
function p() {
|
|
2057
|
+
for (; l < d.length && /\s/.test(d.charAt(l)); )
|
|
2058
|
+
l += 1;
|
|
2059
|
+
return l < d.length;
|
|
2060
|
+
}
|
|
2061
|
+
function b() {
|
|
2062
|
+
return w = d.charAt(l), w !== "=" && w !== ";" && w !== ",";
|
|
2063
|
+
}
|
|
2064
|
+
for (; l < d.length; ) {
|
|
2065
|
+
for (u = l, _ = !1; p(); )
|
|
2066
|
+
if (w = d.charAt(l), w === ",") {
|
|
2067
|
+
for (v = l, l += 1, p(), y = l; l < d.length && b(); )
|
|
2068
|
+
l += 1;
|
|
2069
|
+
l < d.length && d.charAt(l) === "=" ? (_ = !0, l = y, g.push(d.substring(u, v)), u = l) : l = v + 1;
|
|
2070
|
+
} else
|
|
2071
|
+
l += 1;
|
|
2072
|
+
(!_ || l >= d.length) && g.push(d.substring(u, d.length));
|
|
2073
|
+
}
|
|
2074
|
+
return g;
|
|
2075
|
+
}
|
|
2076
|
+
function a(d) {
|
|
2077
|
+
const g = {}, l = [];
|
|
2078
|
+
if (d)
|
|
2079
|
+
for (const [u, w] of d.entries())
|
|
2080
|
+
u.toLowerCase() === "set-cookie" ? (l.push(...i(w)), g[u] = l.length === 1 ? l[0] : l) : g[u] = w;
|
|
2081
|
+
return g;
|
|
2082
|
+
}
|
|
2083
|
+
function s(d) {
|
|
2084
|
+
try {
|
|
2085
|
+
return String(new URL(String(d)));
|
|
2086
|
+
} catch (g) {
|
|
2087
|
+
throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
|
|
2088
|
+
cause: g
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
function o(d, g) {
|
|
2093
|
+
const l = [
|
|
2094
|
+
r.NEXT_QUERY_PARAM_PREFIX,
|
|
2095
|
+
r.NEXT_INTERCEPTION_MARKER_PREFIX
|
|
2096
|
+
];
|
|
2097
|
+
for (const u of l)
|
|
2098
|
+
if (d !== u && d.startsWith(u)) {
|
|
2099
|
+
const w = d.substring(u.length);
|
|
2100
|
+
g(w);
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
})(Ce);
|
|
2104
|
+
var dt = {};
|
|
2105
|
+
(function(e) {
|
|
2106
|
+
Object.defineProperty(e, "__esModule", {
|
|
2107
|
+
value: !0
|
|
2108
|
+
});
|
|
2109
|
+
function t(a, s) {
|
|
2110
|
+
for (var o in s) Object.defineProperty(a, o, {
|
|
2111
|
+
enumerable: !0,
|
|
2112
|
+
get: s[o]
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
t(e, {
|
|
2116
|
+
PageSignatureError: function() {
|
|
2117
|
+
return r;
|
|
2118
|
+
},
|
|
2119
|
+
RemovedPageError: function() {
|
|
2120
|
+
return n;
|
|
2121
|
+
},
|
|
2122
|
+
RemovedUAError: function() {
|
|
2123
|
+
return i;
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
class r extends Error {
|
|
2127
|
+
constructor({ page: s }) {
|
|
2128
|
+
super(`The middleware "${s}" accepts an async API directly with the form:
|
|
2129
|
+
|
|
2130
|
+
export function middleware(request, event) {
|
|
2131
|
+
return NextResponse.redirect('/new-location')
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
2135
|
+
`);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
class n extends Error {
|
|
2139
|
+
constructor() {
|
|
2140
|
+
super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ");
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
class i extends Error {
|
|
2144
|
+
constructor() {
|
|
2145
|
+
super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ");
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
})(dt);
|
|
2149
|
+
var pe = {}, xe = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Ln = Object.getOwnPropertyNames, Dn = Object.prototype.hasOwnProperty, Un = (e, t) => {
|
|
2150
|
+
for (var r in t)
|
|
2151
|
+
xe(e, r, { get: t[r], enumerable: !0 });
|
|
2152
|
+
}, Hn = (e, t, r, n) => {
|
|
2153
|
+
if (t && typeof t == "object" || typeof t == "function")
|
|
2154
|
+
for (let i of Ln(t))
|
|
2155
|
+
!Dn.call(e, i) && i !== r && xe(e, i, { get: () => t[i], enumerable: !(n = $n(t, i)) || n.enumerable });
|
|
2156
|
+
return e;
|
|
2157
|
+
}, Mn = (e) => Hn(xe({}, "__esModule", { value: !0 }), e), pt = {};
|
|
2158
|
+
Un(pt, {
|
|
2159
|
+
RequestCookies: () => Kn,
|
|
2160
|
+
ResponseCookies: () => Jn,
|
|
2161
|
+
parseCookie: () => ke,
|
|
2162
|
+
parseSetCookie: () => mt,
|
|
2163
|
+
stringifyCookie: () => J
|
|
2164
|
+
});
|
|
2165
|
+
var Bn = Mn(pt);
|
|
2166
|
+
function J(e) {
|
|
2167
|
+
var t;
|
|
2168
|
+
const r = [
|
|
2169
|
+
"path" in e && e.path && `Path=${e.path}`,
|
|
2170
|
+
"expires" in e && (e.expires || e.expires === 0) && `Expires=${(typeof e.expires == "number" ? new Date(e.expires) : e.expires).toUTCString()}`,
|
|
2171
|
+
"maxAge" in e && typeof e.maxAge == "number" && `Max-Age=${e.maxAge}`,
|
|
2172
|
+
"domain" in e && e.domain && `Domain=${e.domain}`,
|
|
2173
|
+
"secure" in e && e.secure && "Secure",
|
|
2174
|
+
"httpOnly" in e && e.httpOnly && "HttpOnly",
|
|
2175
|
+
"sameSite" in e && e.sameSite && `SameSite=${e.sameSite}`,
|
|
2176
|
+
"partitioned" in e && e.partitioned && "Partitioned",
|
|
2177
|
+
"priority" in e && e.priority && `Priority=${e.priority}`
|
|
2178
|
+
].filter(Boolean), n = `${e.name}=${encodeURIComponent((t = e.value) != null ? t : "")}`;
|
|
2179
|
+
return r.length === 0 ? n : `${n}; ${r.join("; ")}`;
|
|
2180
|
+
}
|
|
2181
|
+
function ke(e) {
|
|
2182
|
+
const t = /* @__PURE__ */ new Map();
|
|
2183
|
+
for (const r of e.split(/; */)) {
|
|
2184
|
+
if (!r)
|
|
2185
|
+
continue;
|
|
2186
|
+
const n = r.indexOf("=");
|
|
2187
|
+
if (n === -1) {
|
|
2188
|
+
t.set(r, "true");
|
|
2189
|
+
continue;
|
|
2190
|
+
}
|
|
2191
|
+
const [i, a] = [r.slice(0, n), r.slice(n + 1)];
|
|
2192
|
+
try {
|
|
2193
|
+
t.set(i, decodeURIComponent(a ?? "true"));
|
|
2194
|
+
} catch {
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
return t;
|
|
2198
|
+
}
|
|
2199
|
+
function mt(e) {
|
|
2200
|
+
if (!e)
|
|
2201
|
+
return;
|
|
2202
|
+
const [[t, r], ...n] = ke(e), {
|
|
2203
|
+
domain: i,
|
|
2204
|
+
expires: a,
|
|
2205
|
+
httponly: s,
|
|
2206
|
+
maxage: o,
|
|
2207
|
+
path: d,
|
|
2208
|
+
samesite: g,
|
|
2209
|
+
secure: l,
|
|
2210
|
+
partitioned: u,
|
|
2211
|
+
priority: w
|
|
2212
|
+
} = Object.fromEntries(
|
|
2213
|
+
n.map(([y, _]) => [y.toLowerCase(), _])
|
|
2214
|
+
), v = {
|
|
2215
|
+
name: t,
|
|
2216
|
+
value: decodeURIComponent(r),
|
|
2217
|
+
domain: i,
|
|
2218
|
+
...a && { expires: new Date(a) },
|
|
2219
|
+
...s && { httpOnly: !0 },
|
|
2220
|
+
...typeof o == "string" && { maxAge: Number(o) },
|
|
2221
|
+
path: d,
|
|
2222
|
+
...g && { sameSite: Vn(g) },
|
|
2223
|
+
...l && { secure: !0 },
|
|
2224
|
+
...w && { priority: Qn(w) },
|
|
2225
|
+
...u && { partitioned: !0 }
|
|
2226
|
+
};
|
|
2227
|
+
return zn(v);
|
|
2228
|
+
}
|
|
2229
|
+
function zn(e) {
|
|
2230
|
+
const t = {};
|
|
2231
|
+
for (const r in e)
|
|
2232
|
+
e[r] && (t[r] = e[r]);
|
|
2233
|
+
return t;
|
|
2234
|
+
}
|
|
2235
|
+
var Gn = ["strict", "lax", "none"];
|
|
2236
|
+
function Vn(e) {
|
|
2237
|
+
return e = e.toLowerCase(), Gn.includes(e) ? e : void 0;
|
|
2238
|
+
}
|
|
2239
|
+
var Wn = ["low", "medium", "high"];
|
|
2240
|
+
function Qn(e) {
|
|
2241
|
+
return e = e.toLowerCase(), Wn.includes(e) ? e : void 0;
|
|
2242
|
+
}
|
|
2243
|
+
function Xn(e) {
|
|
2244
|
+
if (!e)
|
|
2245
|
+
return [];
|
|
2246
|
+
var t = [], r = 0, n, i, a, s, o;
|
|
2247
|
+
function d() {
|
|
2248
|
+
for (; r < e.length && /\s/.test(e.charAt(r)); )
|
|
2249
|
+
r += 1;
|
|
2250
|
+
return r < e.length;
|
|
2251
|
+
}
|
|
2252
|
+
function g() {
|
|
2253
|
+
return i = e.charAt(r), i !== "=" && i !== ";" && i !== ",";
|
|
2254
|
+
}
|
|
2255
|
+
for (; r < e.length; ) {
|
|
2256
|
+
for (n = r, o = !1; d(); )
|
|
2257
|
+
if (i = e.charAt(r), i === ",") {
|
|
2258
|
+
for (a = r, r += 1, d(), s = r; r < e.length && g(); )
|
|
2259
|
+
r += 1;
|
|
2260
|
+
r < e.length && e.charAt(r) === "=" ? (o = !0, r = s, t.push(e.substring(n, a)), n = r) : r = a + 1;
|
|
2261
|
+
} else
|
|
2262
|
+
r += 1;
|
|
2263
|
+
(!o || r >= e.length) && t.push(e.substring(n, e.length));
|
|
2264
|
+
}
|
|
2265
|
+
return t;
|
|
2266
|
+
}
|
|
2267
|
+
var Kn = class {
|
|
2268
|
+
constructor(e) {
|
|
2269
|
+
this._parsed = /* @__PURE__ */ new Map(), this._headers = e;
|
|
2270
|
+
const t = e.get("cookie");
|
|
2271
|
+
if (t) {
|
|
2272
|
+
const r = ke(t);
|
|
2273
|
+
for (const [n, i] of r)
|
|
2274
|
+
this._parsed.set(n, { name: n, value: i });
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
[Symbol.iterator]() {
|
|
2278
|
+
return this._parsed[Symbol.iterator]();
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* The amount of cookies received from the client
|
|
2282
|
+
*/
|
|
2283
|
+
get size() {
|
|
2284
|
+
return this._parsed.size;
|
|
2285
|
+
}
|
|
2286
|
+
get(...e) {
|
|
2287
|
+
const t = typeof e[0] == "string" ? e[0] : e[0].name;
|
|
2288
|
+
return this._parsed.get(t);
|
|
2289
|
+
}
|
|
2290
|
+
getAll(...e) {
|
|
2291
|
+
var t;
|
|
2292
|
+
const r = Array.from(this._parsed);
|
|
2293
|
+
if (!e.length)
|
|
2294
|
+
return r.map(([i, a]) => a);
|
|
2295
|
+
const n = typeof e[0] == "string" ? e[0] : (t = e[0]) == null ? void 0 : t.name;
|
|
2296
|
+
return r.filter(([i]) => i === n).map(([i, a]) => a);
|
|
2297
|
+
}
|
|
2298
|
+
has(e) {
|
|
2299
|
+
return this._parsed.has(e);
|
|
2300
|
+
}
|
|
2301
|
+
set(...e) {
|
|
2302
|
+
const [t, r] = e.length === 1 ? [e[0].name, e[0].value] : e, n = this._parsed;
|
|
2303
|
+
return n.set(t, { name: t, value: r }), this._headers.set(
|
|
2304
|
+
"cookie",
|
|
2305
|
+
Array.from(n).map(([i, a]) => J(a)).join("; ")
|
|
2306
|
+
), this;
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Delete the cookies matching the passed name or names in the request.
|
|
2310
|
+
*/
|
|
2311
|
+
delete(e) {
|
|
2312
|
+
const t = this._parsed, r = Array.isArray(e) ? e.map((n) => t.delete(n)) : t.delete(e);
|
|
2313
|
+
return this._headers.set(
|
|
2314
|
+
"cookie",
|
|
2315
|
+
Array.from(t).map(([n, i]) => J(i)).join("; ")
|
|
2316
|
+
), r;
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Delete all the cookies in the cookies in the request.
|
|
2320
|
+
*/
|
|
2321
|
+
clear() {
|
|
2322
|
+
return this.delete(Array.from(this._parsed.keys())), this;
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* Format the cookies in the request as a string for logging
|
|
2326
|
+
*/
|
|
2327
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
2328
|
+
return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
|
2329
|
+
}
|
|
2330
|
+
toString() {
|
|
2331
|
+
return [...this._parsed.values()].map((e) => `${e.name}=${encodeURIComponent(e.value)}`).join("; ");
|
|
2332
|
+
}
|
|
2333
|
+
}, Jn = class {
|
|
2334
|
+
constructor(e) {
|
|
2335
|
+
this._parsed = /* @__PURE__ */ new Map();
|
|
2336
|
+
var t, r, n;
|
|
2337
|
+
this._headers = e;
|
|
2338
|
+
const i = (n = (r = (t = e.getSetCookie) == null ? void 0 : t.call(e)) != null ? r : e.get("set-cookie")) != null ? n : [], a = Array.isArray(i) ? i : Xn(i);
|
|
2339
|
+
for (const s of a) {
|
|
2340
|
+
const o = mt(s);
|
|
2341
|
+
o && this._parsed.set(o.name, o);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
|
|
2346
|
+
*/
|
|
2347
|
+
get(...e) {
|
|
2348
|
+
const t = typeof e[0] == "string" ? e[0] : e[0].name;
|
|
2349
|
+
return this._parsed.get(t);
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
|
|
2353
|
+
*/
|
|
2354
|
+
getAll(...e) {
|
|
2355
|
+
var t;
|
|
2356
|
+
const r = Array.from(this._parsed.values());
|
|
2357
|
+
if (!e.length)
|
|
2358
|
+
return r;
|
|
2359
|
+
const n = typeof e[0] == "string" ? e[0] : (t = e[0]) == null ? void 0 : t.name;
|
|
2360
|
+
return r.filter((i) => i.name === n);
|
|
2361
|
+
}
|
|
2362
|
+
has(e) {
|
|
2363
|
+
return this._parsed.has(e);
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
|
|
2367
|
+
*/
|
|
2368
|
+
set(...e) {
|
|
2369
|
+
const [t, r, n] = e.length === 1 ? [e[0].name, e[0].value, e[0]] : e, i = this._parsed;
|
|
2370
|
+
return i.set(t, Yn({ name: t, value: r, ...n })), Zn(i, this._headers), this;
|
|
2371
|
+
}
|
|
2372
|
+
/**
|
|
2373
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
|
|
2374
|
+
*/
|
|
2375
|
+
delete(...e) {
|
|
2376
|
+
const [t, r, n] = typeof e[0] == "string" ? [e[0]] : [e[0].name, e[0].path, e[0].domain];
|
|
2377
|
+
return this.set({ name: t, path: r, domain: n, value: "", expires: /* @__PURE__ */ new Date(0) });
|
|
2378
|
+
}
|
|
2379
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
2380
|
+
return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
|
2381
|
+
}
|
|
2382
|
+
toString() {
|
|
2383
|
+
return [...this._parsed.values()].map(J).join("; ");
|
|
2384
|
+
}
|
|
2385
|
+
};
|
|
2386
|
+
function Zn(e, t) {
|
|
2387
|
+
t.delete("set-cookie");
|
|
2388
|
+
for (const [, r] of e) {
|
|
2389
|
+
const n = J(r);
|
|
2390
|
+
t.append("set-cookie", n);
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
function Yn(e = { name: "", value: "" }) {
|
|
2394
|
+
return typeof e.expires == "number" && (e.expires = new Date(e.expires)), e.maxAge && (e.expires = new Date(Date.now() + e.maxAge * 1e3)), (e.path === null || e.path === void 0) && (e.path = "/"), e;
|
|
2395
|
+
}
|
|
2396
|
+
(function(e) {
|
|
2397
|
+
Object.defineProperty(e, "__esModule", {
|
|
2398
|
+
value: !0
|
|
2399
|
+
});
|
|
2400
|
+
function t(n, i) {
|
|
2401
|
+
for (var a in i) Object.defineProperty(n, a, {
|
|
2402
|
+
enumerable: !0,
|
|
2403
|
+
get: i[a]
|
|
2404
|
+
});
|
|
2405
|
+
}
|
|
2406
|
+
t(e, {
|
|
2407
|
+
RequestCookies: function() {
|
|
2408
|
+
return r.RequestCookies;
|
|
2409
|
+
},
|
|
2410
|
+
ResponseCookies: function() {
|
|
2411
|
+
return r.ResponseCookies;
|
|
2412
|
+
},
|
|
2413
|
+
stringifyCookie: function() {
|
|
2414
|
+
return r.stringifyCookie;
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2417
|
+
const r = Bn;
|
|
2418
|
+
})(pe);
|
|
2419
|
+
(function(e) {
|
|
2420
|
+
Object.defineProperty(e, "__esModule", {
|
|
2421
|
+
value: !0
|
|
2422
|
+
});
|
|
2423
|
+
function t(d, g) {
|
|
2424
|
+
for (var l in g) Object.defineProperty(d, l, {
|
|
2425
|
+
enumerable: !0,
|
|
2426
|
+
get: g[l]
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
t(e, {
|
|
2430
|
+
INTERNALS: function() {
|
|
2431
|
+
return s;
|
|
2432
|
+
},
|
|
2433
|
+
NextRequest: function() {
|
|
2434
|
+
return o;
|
|
2435
|
+
}
|
|
2436
|
+
});
|
|
2437
|
+
const r = Se, n = Ce, i = dt, a = pe, s = Symbol("internal request");
|
|
2438
|
+
class o extends Request {
|
|
2439
|
+
constructor(g, l = {}) {
|
|
2440
|
+
const u = typeof g != "string" && "url" in g ? g.url : String(g);
|
|
2441
|
+
(0, n.validateURL)(u), g instanceof Request ? super(g, l) : super(u, l);
|
|
2442
|
+
const w = new r.NextURL(u, {
|
|
2443
|
+
headers: (0, n.toNodeOutgoingHttpHeaders)(this.headers),
|
|
2444
|
+
nextConfig: l.nextConfig
|
|
2445
|
+
});
|
|
2446
|
+
this[s] = {
|
|
2447
|
+
cookies: new a.RequestCookies(this.headers),
|
|
2448
|
+
geo: l.geo || {},
|
|
2449
|
+
ip: l.ip,
|
|
2450
|
+
nextUrl: w,
|
|
2451
|
+
url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? u : w.toString()
|
|
2452
|
+
};
|
|
2453
|
+
}
|
|
2454
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
2455
|
+
return {
|
|
2456
|
+
cookies: this.cookies,
|
|
2457
|
+
geo: this.geo,
|
|
2458
|
+
ip: this.ip,
|
|
2459
|
+
nextUrl: this.nextUrl,
|
|
2460
|
+
url: this.url,
|
|
2461
|
+
// rest of props come from Request
|
|
2462
|
+
bodyUsed: this.bodyUsed,
|
|
2463
|
+
cache: this.cache,
|
|
2464
|
+
credentials: this.credentials,
|
|
2465
|
+
destination: this.destination,
|
|
2466
|
+
headers: Object.fromEntries(this.headers),
|
|
2467
|
+
integrity: this.integrity,
|
|
2468
|
+
keepalive: this.keepalive,
|
|
2469
|
+
method: this.method,
|
|
2470
|
+
mode: this.mode,
|
|
2471
|
+
redirect: this.redirect,
|
|
2472
|
+
referrer: this.referrer,
|
|
2473
|
+
referrerPolicy: this.referrerPolicy,
|
|
2474
|
+
signal: this.signal
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
get cookies() {
|
|
2478
|
+
return this[s].cookies;
|
|
2479
|
+
}
|
|
2480
|
+
get geo() {
|
|
2481
|
+
return this[s].geo;
|
|
2482
|
+
}
|
|
2483
|
+
get ip() {
|
|
2484
|
+
return this[s].ip;
|
|
2485
|
+
}
|
|
2486
|
+
get nextUrl() {
|
|
2487
|
+
return this[s].nextUrl;
|
|
2488
|
+
}
|
|
2489
|
+
/**
|
|
2490
|
+
* @deprecated
|
|
2491
|
+
* `page` has been deprecated in favour of `URLPattern`.
|
|
2492
|
+
* Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
2493
|
+
*/
|
|
2494
|
+
get page() {
|
|
2495
|
+
throw new i.RemovedPageError();
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* @deprecated
|
|
2499
|
+
* `ua` has been removed in favour of \`userAgent\` function.
|
|
2500
|
+
* Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
2501
|
+
*/
|
|
2502
|
+
get ua() {
|
|
2503
|
+
throw new i.RemovedUAError();
|
|
2504
|
+
}
|
|
2505
|
+
get url() {
|
|
2506
|
+
return this[s].url;
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
})(ot);
|
|
2510
|
+
var ht = {}, ft = {};
|
|
2511
|
+
(function(e) {
|
|
2512
|
+
Object.defineProperty(e, "__esModule", {
|
|
2513
|
+
value: !0
|
|
2514
|
+
}), Object.defineProperty(e, "ReflectAdapter", {
|
|
2515
|
+
enumerable: !0,
|
|
2516
|
+
get: function() {
|
|
2517
|
+
return t;
|
|
2518
|
+
}
|
|
2519
|
+
});
|
|
2520
|
+
class t {
|
|
2521
|
+
static get(n, i, a) {
|
|
2522
|
+
const s = Reflect.get(n, i, a);
|
|
2523
|
+
return typeof s == "function" ? s.bind(n) : s;
|
|
2524
|
+
}
|
|
2525
|
+
static set(n, i, a, s) {
|
|
2526
|
+
return Reflect.set(n, i, a, s);
|
|
2527
|
+
}
|
|
2528
|
+
static has(n, i) {
|
|
2529
|
+
return Reflect.has(n, i);
|
|
2530
|
+
}
|
|
2531
|
+
static deleteProperty(n, i) {
|
|
2532
|
+
return Reflect.deleteProperty(n, i);
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
})(ft);
|
|
2536
|
+
(function(e) {
|
|
2537
|
+
Object.defineProperty(e, "__esModule", {
|
|
2538
|
+
value: !0
|
|
2539
|
+
}), Object.defineProperty(e, "NextResponse", {
|
|
2540
|
+
enumerable: !0,
|
|
2541
|
+
get: function() {
|
|
2542
|
+
return g;
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
const t = pe, r = Se, n = Ce, i = ft, a = pe, s = Symbol("internal response"), o = /* @__PURE__ */ new Set([
|
|
2546
|
+
301,
|
|
2547
|
+
302,
|
|
2548
|
+
303,
|
|
2549
|
+
307,
|
|
2550
|
+
308
|
|
2551
|
+
]);
|
|
2552
|
+
function d(l, u) {
|
|
2553
|
+
var w;
|
|
2554
|
+
if (!(l == null || (w = l.request) == null) && w.headers) {
|
|
2555
|
+
if (!(l.request.headers instanceof Headers))
|
|
2556
|
+
throw new Error("request.headers must be an instance of Headers");
|
|
2557
|
+
const v = [];
|
|
2558
|
+
for (const [y, _] of l.request.headers)
|
|
2559
|
+
u.set("x-middleware-request-" + y, _), v.push(y);
|
|
2560
|
+
u.set("x-middleware-override-headers", v.join(","));
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
class g extends Response {
|
|
2564
|
+
constructor(u, w = {}) {
|
|
2565
|
+
super(u, w);
|
|
2566
|
+
const v = this.headers, y = new a.ResponseCookies(v), _ = new Proxy(y, {
|
|
2567
|
+
get(p, b, m) {
|
|
2568
|
+
switch (b) {
|
|
2569
|
+
case "delete":
|
|
2570
|
+
case "set":
|
|
2571
|
+
return (...h) => {
|
|
2572
|
+
const f = Reflect.apply(p[b], p, h), E = new Headers(v);
|
|
2573
|
+
return f instanceof a.ResponseCookies && v.set("x-middleware-set-cookie", f.getAll().map((q) => (0, t.stringifyCookie)(q)).join(",")), d(w, E), f;
|
|
2574
|
+
};
|
|
2575
|
+
default:
|
|
2576
|
+
return i.ReflectAdapter.get(p, b, m);
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
});
|
|
2580
|
+
this[s] = {
|
|
2581
|
+
cookies: _,
|
|
2582
|
+
url: w.url ? new r.NextURL(w.url, {
|
|
2583
|
+
headers: (0, n.toNodeOutgoingHttpHeaders)(v),
|
|
2584
|
+
nextConfig: w.nextConfig
|
|
2585
|
+
}) : void 0
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2588
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
|
2589
|
+
return {
|
|
2590
|
+
cookies: this.cookies,
|
|
2591
|
+
url: this.url,
|
|
2592
|
+
// rest of props come from Response
|
|
2593
|
+
body: this.body,
|
|
2594
|
+
bodyUsed: this.bodyUsed,
|
|
2595
|
+
headers: Object.fromEntries(this.headers),
|
|
2596
|
+
ok: this.ok,
|
|
2597
|
+
redirected: this.redirected,
|
|
2598
|
+
status: this.status,
|
|
2599
|
+
statusText: this.statusText,
|
|
2600
|
+
type: this.type
|
|
2601
|
+
};
|
|
2602
|
+
}
|
|
2603
|
+
get cookies() {
|
|
2604
|
+
return this[s].cookies;
|
|
2605
|
+
}
|
|
2606
|
+
static json(u, w) {
|
|
2607
|
+
const v = Response.json(u, w);
|
|
2608
|
+
return new g(v.body, v);
|
|
2609
|
+
}
|
|
2610
|
+
static redirect(u, w) {
|
|
2611
|
+
const v = typeof w == "number" ? w : (w == null ? void 0 : w.status) ?? 307;
|
|
2612
|
+
if (!o.has(v))
|
|
2613
|
+
throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
|
|
2614
|
+
const y = typeof w == "object" ? w : {}, _ = new Headers(y == null ? void 0 : y.headers);
|
|
2615
|
+
return _.set("Location", (0, n.validateURL)(u)), new g(null, {
|
|
2616
|
+
...y,
|
|
2617
|
+
headers: _,
|
|
2618
|
+
status: v
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
static rewrite(u, w) {
|
|
2622
|
+
const v = new Headers(w == null ? void 0 : w.headers);
|
|
2623
|
+
return v.set("x-middleware-rewrite", (0, n.validateURL)(u)), d(w, v), new g(null, {
|
|
2624
|
+
...w,
|
|
2625
|
+
headers: v
|
|
2626
|
+
});
|
|
2627
|
+
}
|
|
2628
|
+
static next(u) {
|
|
2629
|
+
const w = new Headers(u == null ? void 0 : u.headers);
|
|
2630
|
+
return w.set("x-middleware-next", "1"), d(u, w), new g(null, {
|
|
2631
|
+
...u,
|
|
2632
|
+
headers: w
|
|
2633
|
+
});
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
})(ht);
|
|
2637
|
+
var gt = {};
|
|
2638
|
+
(function(e) {
|
|
2639
|
+
Object.defineProperty(e, "__esModule", {
|
|
2640
|
+
value: !0
|
|
2641
|
+
}), Object.defineProperty(e, "ImageResponse", {
|
|
2642
|
+
enumerable: !0,
|
|
2643
|
+
get: function() {
|
|
2644
|
+
return t;
|
|
2645
|
+
}
|
|
2646
|
+
});
|
|
2647
|
+
function t() {
|
|
2648
|
+
throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead');
|
|
2649
|
+
}
|
|
2650
|
+
})(gt);
|
|
2651
|
+
var Pe = {}, bt = { exports: {} };
|
|
2652
|
+
(() => {
|
|
2653
|
+
var e = { 226: function(i, a) {
|
|
2654
|
+
(function(s, o) {
|
|
2655
|
+
var d = "1.0.35", g = "", l = "?", u = "function", w = "undefined", v = "object", y = "string", _ = "major", p = "model", b = "name", m = "type", h = "vendor", f = "version", E = "architecture", q = "console", I = "mobile", R = "tablet", x = "smarttv", j = "wearable", F = "embedded", D = 350, U = "Amazon", B = "Apple", Z = "ASUS", Ee = "BlackBerry", G = "Browser", Y = "Chrome", yt = "Edge", ee = "Firefox", te = "Google", Ae = "Huawei", he = "LG", fe = "Microsoft", Te = "Motorola", re = "Opera", ge = "Samsung", Oe = "Sharp", ne = "Sony", be = "Xiaomi", we = "Zebra", qe = "Facebook", Ne = "Chromium OS", je = "Mac OS", _t = function(C, A) {
|
|
2656
|
+
var S = {};
|
|
2657
|
+
for (var O in C)
|
|
2658
|
+
A[O] && A[O].length % 2 === 0 ? S[O] = A[O].concat(C[O]) : S[O] = C[O];
|
|
2659
|
+
return S;
|
|
2660
|
+
}, ie = function(C) {
|
|
2661
|
+
for (var A = {}, S = 0; S < C.length; S++)
|
|
2662
|
+
A[C[S].toUpperCase()] = C[S];
|
|
2663
|
+
return A;
|
|
2664
|
+
}, Fe = function(C, A) {
|
|
2665
|
+
return typeof C === y ? W(A).indexOf(W(C)) !== -1 : !1;
|
|
2666
|
+
}, W = function(C) {
|
|
2667
|
+
return C.toLowerCase();
|
|
2668
|
+
}, Rt = function(C) {
|
|
2669
|
+
return typeof C === y ? C.replace(/[^\d\.]/g, g).split(".")[0] : o;
|
|
2670
|
+
}, ve = function(C, A) {
|
|
2671
|
+
if (typeof C === y)
|
|
2672
|
+
return C = C.replace(/^\s\s*/, g), typeof A === w ? C : C.substring(0, D);
|
|
2673
|
+
}, Q = function(C, A) {
|
|
2674
|
+
for (var S = 0, O, z, H, k, P, M; S < A.length && !P; ) {
|
|
2675
|
+
var _e = A[S], De = A[S + 1];
|
|
2676
|
+
for (O = z = 0; O < _e.length && !P && _e[O]; )
|
|
2677
|
+
if (P = _e[O++].exec(C), P)
|
|
2678
|
+
for (H = 0; H < De.length; H++)
|
|
2679
|
+
M = P[++z], k = De[H], typeof k === v && k.length > 0 ? k.length === 2 ? typeof k[1] == u ? this[k[0]] = k[1].call(this, M) : this[k[0]] = k[1] : k.length === 3 ? typeof k[1] === u && !(k[1].exec && k[1].test) ? this[k[0]] = M ? k[1].call(this, M, k[2]) : o : this[k[0]] = M ? M.replace(k[1], k[2]) : o : k.length === 4 && (this[k[0]] = M ? k[3].call(this, M.replace(k[1], k[2])) : o) : this[k] = M || o;
|
|
2680
|
+
S += 2;
|
|
2681
|
+
}
|
|
2682
|
+
}, ye = function(C, A) {
|
|
2683
|
+
for (var S in A)
|
|
2684
|
+
if (typeof A[S] === v && A[S].length > 0) {
|
|
2685
|
+
for (var O = 0; O < A[S].length; O++)
|
|
2686
|
+
if (Fe(A[S][O], C))
|
|
2687
|
+
return S === l ? o : S;
|
|
2688
|
+
} else if (Fe(A[S], C))
|
|
2689
|
+
return S === l ? o : S;
|
|
2690
|
+
return C;
|
|
2691
|
+
}, It = { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" }, $e = { 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" }, Le = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [f, [b, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [f, [b, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [b, f], [/opios[\/ ]+([\w\.]+)/i], [f, [b, re + " Mini"]], [/\bopr\/([\w\.]+)/i], [f, [b, re]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i], [b, f], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [f, [b, "UC" + G]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i], [f, [b, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [f, [b, "WeChat"]], [/konqueror\/([\w\.]+)/i], [f, [b, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [f, [b, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [f, [b, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[b, /(.+)/, "$1 Secure " + G], f], [/\bfocus\/([\w\.]+)/i], [f, [b, ee + " Focus"]], [/\bopt\/([\w\.]+)/i], [f, [b, re + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [f, [b, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [f, [b, "Dolphin"]], [/coast\/([\w\.]+)/i], [f, [b, re + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [f, [b, "MIUI " + G]], [/fxios\/([-\w\.]+)/i], [f, [b, ee]], [/\bqihu|(qi?ho?o?|360)browser/i], [[b, "360 " + G]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[b, /(.+)/, "$1 " + G], f], [/(comodo_dragon)\/([\w\.]+)/i], [[b, /_/g, " "], f], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i], [b, f], [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i], [b], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[b, qe], f], [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i], [b, f], [/\bgsa\/([\w\.]+) .*safari\//i], [f, [b, "GSA"]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [f, [b, "TikTok"]], [/headlesschrome(?:\/([\w\.]+)| )/i], [f, [b, Y + " Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[b, Y + " WebView"], f], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [f, [b, "Android " + G]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [b, f], [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i], [f, [b, "Mobile Safari"]], [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i], [f, b], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [b, [f, ye, It]], [/(webkit|khtml)\/([\w\.]+)/i], [b, f], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[b, "Netscape"], f], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [f, [b, ee + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i], [b, f], [/(cobalt)\/([\w\.]+)/i], [b, [f, /master.|lts./, ""]]], cpu: [[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i], [[E, "amd64"]], [/(ia32(?=;))/i], [[E, W]], [/((?:i[346]|x)86)[;\)]/i], [[E, "ia32"]], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i], [[E, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[E, "armhf"]], [/windows (ce|mobile); ppc;/i], [[E, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i], [[E, /ower/, g, W]], [/(sun4\w)[;\)]/i], [[E, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[E, W]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [p, [h, ge], [m, R]], [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i], [p, [h, ge], [m, I]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [p, [h, B], [m, I]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [p, [h, B], [m, R]], [/(macintosh);/i], [p, [h, B]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [p, [h, Oe], [m, I]], [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [p, [h, Ae], [m, R]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [p, [h, Ae], [m, I]], [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i], [[p, /_/g, " "], [h, be], [m, I]], [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i], [[p, /_/g, " "], [h, be], [m, R]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [p, [h, "OPPO"], [m, I]], [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [p, [h, "Vivo"], [m, I]], [/\b(rmx[12]\d{3})(?: bui|;|\))/i], [p, [h, "Realme"], [m, I]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [p, [h, Te], [m, I]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [p, [h, Te], [m, R]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [p, [h, he], [m, R]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [p, [h, he], [m, I]], [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [p, [h, "Lenovo"], [m, R]], [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[p, /_/g, " "], [h, "Nokia"], [m, I]], [/(pixel c)\b/i], [p, [h, te], [m, R]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [p, [h, te], [m, I]], [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [p, [h, ne], [m, I]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[p, "Xperia Tablet"], [h, ne], [m, R]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [p, [h, "OnePlus"], [m, I]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [p, [h, U], [m, R]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[p, /(.+)/g, "Fire Phone $1"], [h, U], [m, I]], [/(playbook);[-\w\),; ]+(rim)/i], [p, h, [m, R]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [p, [h, Ee], [m, I]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [p, [h, Z], [m, R]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [p, [h, Z], [m, I]], [/(nexus 9)/i], [p, [h, "HTC"], [m, R]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [h, [p, /_/g, " "], [m, I]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [p, [h, "Acer"], [m, R]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [p, [h, "Meizu"], [m, I]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i], [h, p, [m, I]], [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i], [h, p, [m, R]], [/(surface duo)/i], [p, [h, fe], [m, R]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [p, [h, "Fairphone"], [m, I]], [/(u304aa)/i], [p, [h, "AT&T"], [m, I]], [/\bsie-(\w*)/i], [p, [h, "Siemens"], [m, I]], [/\b(rct\w+) b/i], [p, [h, "RCA"], [m, R]], [/\b(venue[\d ]{2,7}) b/i], [p, [h, "Dell"], [m, R]], [/\b(q(?:mv|ta)\w+) b/i], [p, [h, "Verizon"], [m, R]], [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i], [p, [h, "Barnes & Noble"], [m, R]], [/\b(tm\d{3}\w+) b/i], [p, [h, "NuVision"], [m, R]], [/\b(k88) b/i], [p, [h, "ZTE"], [m, R]], [/\b(nx\d{3}j) b/i], [p, [h, "ZTE"], [m, I]], [/\b(gen\d{3}) b.+49h/i], [p, [h, "Swiss"], [m, I]], [/\b(zur\d{3}) b/i], [p, [h, "Swiss"], [m, R]], [/\b((zeki)?tb.*\b) b/i], [p, [h, "Zeki"], [m, R]], [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i], [[h, "Dragon Touch"], p, [m, R]], [/\b(ns-?\w{0,9}) b/i], [p, [h, "Insignia"], [m, R]], [/\b((nxa|next)-?\w{0,9}) b/i], [p, [h, "NextBook"], [m, R]], [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i], [[h, "Voice"], p, [m, I]], [/\b(lvtel\-)?(v1[12]) b/i], [[h, "LvTel"], p, [m, I]], [/\b(ph-1) /i], [p, [h, "Essential"], [m, I]], [/\b(v(100md|700na|7011|917g).*\b) b/i], [p, [h, "Envizen"], [m, R]], [/\b(trio[-\w\. ]+) b/i], [p, [h, "MachSpeed"], [m, R]], [/\btu_(1491) b/i], [p, [h, "Rotor"], [m, R]], [/(shield[\w ]+) b/i], [p, [h, "Nvidia"], [m, R]], [/(sprint) (\w+)/i], [h, p, [m, I]], [/(kin\.[onetw]{3})/i], [[p, /\./g, " "], [h, fe], [m, I]], [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [p, [h, we], [m, R]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [p, [h, we], [m, I]], [/smart-tv.+(samsung)/i], [h, [m, x]], [/hbbtv.+maple;(\d+)/i], [[p, /^/, "SmartTV"], [h, ge], [m, x]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[h, he], [m, x]], [/(apple) ?tv/i], [h, [p, B + " TV"], [m, x]], [/crkey/i], [[p, Y + "cast"], [h, te], [m, x]], [/droid.+aft(\w)( bui|\))/i], [p, [h, U], [m, x]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [p, [h, Oe], [m, x]], [/(bravia[\w ]+)( bui|\))/i], [p, [h, ne], [m, x]], [/(mitv-\w{5}) bui/i], [p, [h, be], [m, x]], [/Hbbtv.*(technisat) (.*);/i], [h, p, [m, x]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[h, ve], [p, ve], [m, x]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[m, x]], [/(ouya)/i, /(nintendo) ([wids3utch]+)/i], [h, p, [m, q]], [/droid.+; (shield) bui/i], [p, [h, "Nvidia"], [m, q]], [/(playstation [345portablevi]+)/i], [p, [h, ne], [m, q]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [p, [h, fe], [m, q]], [/((pebble))app/i], [h, p, [m, j]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [p, [h, B], [m, j]], [/droid.+; (glass) \d/i], [p, [h, te], [m, j]], [/droid.+; (wt63?0{2,3})\)/i], [p, [h, we], [m, j]], [/(quest( 2| pro)?)/i], [p, [h, qe], [m, j]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [h, [m, F]], [/(aeobc)\b/i], [p, [h, U], [m, F]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i], [p, [m, I]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i], [p, [m, R]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[m, R]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[m, I]], [/(android[-\w\. ]{0,9});.+buil/i], [p, [h, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [f, [b, yt + "HTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [f, [b, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [b, f], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [f, b]], os: [[/microsoft (windows) (vista|xp)/i], [b, f], [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i], [b, [f, ye, $e]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[b, "Windows"], [f, ye, $e]], [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[f, /_/g, "."], [b, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[b, je], [f, /_/g, "."]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [f, b], [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i], [b, f], [/\(bb(10);/i], [f, [b, Ee]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i], [f, [b, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [f, [b, ee + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [f, [b, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [f, [b, "watchOS"]], [/crkey\/([\d\.]+)/i], [f, [b, Y + "cast"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[b, Ne], f], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [b, f], [/(sunos) ?([\w\.\d]*)/i], [[b, "Solaris"], f], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [b, f]] }, L = function(C, A) {
|
|
2692
|
+
if (typeof C === v && (A = C, C = o), !(this instanceof L))
|
|
2693
|
+
return new L(C, A).getResult();
|
|
2694
|
+
var S = typeof s !== w && s.navigator ? s.navigator : o, O = C || (S && S.userAgent ? S.userAgent : g), z = S && S.userAgentData ? S.userAgentData : o, H = A ? _t(Le, A) : Le, k = S && S.userAgent == O;
|
|
2695
|
+
return this.getBrowser = function() {
|
|
2696
|
+
var P = {};
|
|
2697
|
+
return P[b] = o, P[f] = o, Q.call(P, O, H.browser), P[_] = Rt(P[f]), k && S && S.brave && typeof S.brave.isBrave == u && (P[b] = "Brave"), P;
|
|
2698
|
+
}, this.getCPU = function() {
|
|
2699
|
+
var P = {};
|
|
2700
|
+
return P[E] = o, Q.call(P, O, H.cpu), P;
|
|
2701
|
+
}, this.getDevice = function() {
|
|
2702
|
+
var P = {};
|
|
2703
|
+
return P[h] = o, P[p] = o, P[m] = o, Q.call(P, O, H.device), k && !P[m] && z && z.mobile && (P[m] = I), k && P[p] == "Macintosh" && S && typeof S.standalone !== w && S.maxTouchPoints && S.maxTouchPoints > 2 && (P[p] = "iPad", P[m] = R), P;
|
|
2704
|
+
}, this.getEngine = function() {
|
|
2705
|
+
var P = {};
|
|
2706
|
+
return P[b] = o, P[f] = o, Q.call(P, O, H.engine), P;
|
|
2707
|
+
}, this.getOS = function() {
|
|
2708
|
+
var P = {};
|
|
2709
|
+
return P[b] = o, P[f] = o, Q.call(P, O, H.os), k && !P[b] && z && z.platform != "Unknown" && (P[b] = z.platform.replace(/chrome os/i, Ne).replace(/macos/i, je)), P;
|
|
2710
|
+
}, this.getResult = function() {
|
|
2711
|
+
return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
|
|
2712
|
+
}, this.getUA = function() {
|
|
2713
|
+
return O;
|
|
2714
|
+
}, this.setUA = function(P) {
|
|
2715
|
+
return O = typeof P === y && P.length > D ? ve(P, D) : P, this;
|
|
2716
|
+
}, this.setUA(O), this;
|
|
2717
|
+
};
|
|
2718
|
+
L.VERSION = d, L.BROWSER = ie([b, f, _]), L.CPU = ie([E]), L.DEVICE = ie([p, h, m, q, I, x, R, j, F]), L.ENGINE = L.OS = ie([b, f]), typeof a !== w ? (i.exports && (a = i.exports = L), a.UAParser = L) : typeof s !== w && (s.UAParser = L);
|
|
2719
|
+
var V = typeof s !== w && (s.jQuery || s.Zepto);
|
|
2720
|
+
if (V && !V.ua) {
|
|
2721
|
+
var oe = new L();
|
|
2722
|
+
V.ua = oe.getResult(), V.ua.get = function() {
|
|
2723
|
+
return oe.getUA();
|
|
2724
|
+
}, V.ua.set = function(C) {
|
|
2725
|
+
oe.setUA(C);
|
|
2726
|
+
var A = oe.getResult();
|
|
2727
|
+
for (var S in A)
|
|
2728
|
+
V.ua[S] = A[S];
|
|
2729
|
+
};
|
|
2730
|
+
}
|
|
2731
|
+
})(typeof window == "object" ? window : this);
|
|
2732
|
+
} }, t = {};
|
|
2733
|
+
function r(i) {
|
|
2734
|
+
var a = t[i];
|
|
2735
|
+
if (a !== void 0)
|
|
2736
|
+
return a.exports;
|
|
2737
|
+
var s = t[i] = { exports: {} }, o = !0;
|
|
2738
|
+
try {
|
|
2739
|
+
e[i].call(s.exports, s, s.exports, r), o = !1;
|
|
2740
|
+
} finally {
|
|
2741
|
+
o && delete t[i];
|
|
2742
|
+
}
|
|
2743
|
+
return s.exports;
|
|
2744
|
+
}
|
|
2745
|
+
typeof r < "u" && (r.ab = __dirname + "/");
|
|
2746
|
+
var n = r(226);
|
|
2747
|
+
bt.exports = n;
|
|
2748
|
+
})();
|
|
2749
|
+
var ei = bt.exports;
|
|
2750
|
+
(function(e) {
|
|
2751
|
+
Object.defineProperty(e, "__esModule", {
|
|
2752
|
+
value: !0
|
|
2753
|
+
});
|
|
2754
|
+
function t(o, d) {
|
|
2755
|
+
for (var g in d) Object.defineProperty(o, g, {
|
|
2756
|
+
enumerable: !0,
|
|
2757
|
+
get: d[g]
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
t(e, {
|
|
2761
|
+
isBot: function() {
|
|
2762
|
+
return i;
|
|
2763
|
+
},
|
|
2764
|
+
userAgent: function() {
|
|
2765
|
+
return s;
|
|
2766
|
+
},
|
|
2767
|
+
userAgentFromString: function() {
|
|
2768
|
+
return a;
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
const r = /* @__PURE__ */ n(ei);
|
|
2772
|
+
function n(o) {
|
|
2773
|
+
return o && o.__esModule ? o : {
|
|
2774
|
+
default: o
|
|
1736
2775
|
};
|
|
2776
|
+
}
|
|
2777
|
+
function i(o) {
|
|
2778
|
+
return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|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(o);
|
|
2779
|
+
}
|
|
2780
|
+
function a(o) {
|
|
2781
|
+
return {
|
|
2782
|
+
...(0, r.default)(o),
|
|
2783
|
+
isBot: o === void 0 ? !1 : i(o)
|
|
2784
|
+
};
|
|
2785
|
+
}
|
|
2786
|
+
function s({ headers: o }) {
|
|
2787
|
+
return a(o.get("user-agent") || void 0);
|
|
2788
|
+
}
|
|
2789
|
+
})(Pe);
|
|
2790
|
+
var wt = {};
|
|
2791
|
+
(function(e) {
|
|
2792
|
+
Object.defineProperty(e, "__esModule", {
|
|
2793
|
+
value: !0
|
|
2794
|
+
}), Object.defineProperty(e, "URLPattern", {
|
|
2795
|
+
enumerable: !0,
|
|
2796
|
+
get: function() {
|
|
2797
|
+
return t;
|
|
2798
|
+
}
|
|
1737
2799
|
});
|
|
2800
|
+
const t = (
|
|
2801
|
+
// @ts-expect-error: URLPattern is not available in Node.js
|
|
2802
|
+
typeof URLPattern > "u" ? void 0 : URLPattern
|
|
2803
|
+
);
|
|
2804
|
+
})(wt);
|
|
2805
|
+
(function(e, t) {
|
|
2806
|
+
const r = {
|
|
2807
|
+
NextRequest: ot.NextRequest,
|
|
2808
|
+
NextResponse: ht.NextResponse,
|
|
2809
|
+
ImageResponse: gt.ImageResponse,
|
|
2810
|
+
userAgentFromString: Pe.userAgentFromString,
|
|
2811
|
+
userAgent: Pe.userAgent,
|
|
2812
|
+
URLPattern: wt.URLPattern
|
|
2813
|
+
};
|
|
2814
|
+
e.exports = r, t.NextRequest = r.NextRequest, t.NextResponse = r.NextResponse, t.ImageResponse = r.ImageResponse, t.userAgentFromString = r.userAgentFromString, t.userAgent = r.userAgent, t.URLPattern = r.URLPattern;
|
|
2815
|
+
})(Ie, Ie.exports);
|
|
2816
|
+
var Me = Ie.exports;
|
|
2817
|
+
async function ti({ apiUrl: e, extraData: t, fetchOptions: r }) {
|
|
2818
|
+
var I, R;
|
|
2819
|
+
const n = `${e}/api/dataentities`, i = `${e}/api/io/v1/extrato/get-total`, {
|
|
2820
|
+
MASTER_DATA_ENTITY: a,
|
|
2821
|
+
MASTER_DATA_FIELDS: s,
|
|
2822
|
+
AUTH_TOKEN_COOKIE: o,
|
|
2823
|
+
requestHeaders: d,
|
|
2824
|
+
cookies: g
|
|
2825
|
+
} = t, { address: l, client: u } = a, { address: w, client: v } = s, y = ((I = g == null ? void 0 : g.find((x) => (x == null ? void 0 : x.name) === o)) == null ? void 0 : I.value) || "";
|
|
2826
|
+
if (!y)
|
|
2827
|
+
return Me.NextResponse.json(
|
|
2828
|
+
{ error: "Token not found. Unauthorized" },
|
|
2829
|
+
{ status: 200 }
|
|
2830
|
+
);
|
|
2831
|
+
const { sub: _, userId: p } = zt(y), b = Object.fromEntries(
|
|
2832
|
+
Object.entries(d).map(([x, j]) => [x, String(j || "")])
|
|
2833
|
+
), m = async (x, j, F = !1) => {
|
|
2834
|
+
try {
|
|
2835
|
+
const U = await fetch(`${F ? i : n}${x}`, {
|
|
2836
|
+
headers: {
|
|
2837
|
+
...j,
|
|
2838
|
+
...r == null ? void 0 : r.headers
|
|
2839
|
+
}
|
|
2840
|
+
}).then((Z) => Z.json()), B = Array.isArray(U) ? U[0] : U;
|
|
2841
|
+
return Array.isArray(B) ? B[0] : B;
|
|
2842
|
+
} catch (D) {
|
|
2843
|
+
return console.error(`Erro no fetch: ${x}`, D), null;
|
|
2844
|
+
}
|
|
2845
|
+
}, h = await m(
|
|
2846
|
+
`/${u}/search?email=${_}&_fields=${v.join(",")}`,
|
|
2847
|
+
b
|
|
2848
|
+
);
|
|
2849
|
+
if (!(h != null && h.id))
|
|
2850
|
+
return Me.NextResponse.json({ sub: _ }, { status: 200 });
|
|
2851
|
+
const f = (R = h.document) == null ? void 0 : R.replace(/\D/g, ""), E = await m(
|
|
2852
|
+
`/${l}/search?userId=${h.id}&_fields=${w.join(
|
|
2853
|
+
","
|
|
2854
|
+
)}&_sort=lastInteractionIn DESC`,
|
|
2855
|
+
{ ...b, "REST-Range": "resources=0-1000" }
|
|
2856
|
+
), q = f ? await m(
|
|
2857
|
+
`/${f}?user_code=${h.userId},${_}&per_page=1&page=1`,
|
|
2858
|
+
b,
|
|
2859
|
+
!0
|
|
2860
|
+
) : null;
|
|
2861
|
+
return { ...h, ...E, userCredits: q, sub: _, userId: p };
|
|
1738
2862
|
}
|
|
1739
|
-
const
|
|
2863
|
+
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1740
2864
|
__proto__: null,
|
|
1741
|
-
|
|
1742
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1743
|
-
const
|
|
2865
|
+
getUserData: ti
|
|
2866
|
+
}, Symbol.toStringTag, { value: "Module" })), ni = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), Be = (e, t = " ") => !e || typeof e == "string" && e.length === 0 ? e : (Array.isArray(e) ? e : e.split("-")).map(ni).join(t), ii = ({ canonical: e, seo: t, slug: r }) => {
|
|
2867
|
+
const n = Array.isArray(r) ? r.join(", ") : r;
|
|
1744
2868
|
return {
|
|
1745
2869
|
id: 0,
|
|
1746
|
-
Title: `${Array.isArray(
|
|
1747
|
-
MetaTagDescription:
|
|
1748
|
-
name:
|
|
2870
|
+
Title: `${Array.isArray(r) ? r.map((a) => Be(a)).join(",") : Be(r)} - ${t.title}`,
|
|
2871
|
+
MetaTagDescription: t.description,
|
|
2872
|
+
name: n,
|
|
1749
2873
|
hasChildren: !1,
|
|
1750
|
-
url:
|
|
2874
|
+
url: e,
|
|
1751
2875
|
children: []
|
|
1752
2876
|
};
|
|
1753
|
-
},
|
|
1754
|
-
category: String(
|
|
1755
|
-
title: (
|
|
1756
|
-
description: (
|
|
1757
|
-
alternates: { canonical:
|
|
2877
|
+
}, oi = ({ canonical: e, category: t, previousImages: r, seo: n }) => ({
|
|
2878
|
+
category: String(t == null ? void 0 : t.id),
|
|
2879
|
+
title: (t == null ? void 0 : t.Title) ?? n.title,
|
|
2880
|
+
description: (t == null ? void 0 : t.MetaTagDescription) ?? n.description,
|
|
2881
|
+
alternates: { canonical: e },
|
|
1758
2882
|
openGraph: {
|
|
1759
2883
|
type: "website",
|
|
1760
|
-
title: (
|
|
1761
|
-
description: (
|
|
1762
|
-
images: Array.isArray(
|
|
2884
|
+
title: (t == null ? void 0 : t.Title) ?? n.title,
|
|
2885
|
+
description: (t == null ? void 0 : t.MetaTagDescription) ?? n.description,
|
|
2886
|
+
images: Array.isArray(r) ? [...r] : []
|
|
1763
2887
|
}
|
|
1764
|
-
}),
|
|
1765
|
-
const
|
|
1766
|
-
(
|
|
2888
|
+
}), ai = ({ items: e, parent: t, apiUrl: r, find: n }) => {
|
|
2889
|
+
const i = e.find(
|
|
2890
|
+
(s) => s.url.replace(r, "") === decodeURIComponent(t.toLowerCase())
|
|
1767
2891
|
);
|
|
1768
|
-
return (
|
|
1769
|
-
(
|
|
1770
|
-
)) ??
|
|
1771
|
-
},
|
|
1772
|
-
|
|
1773
|
-
},
|
|
2892
|
+
return (i == null ? void 0 : i.children.find(
|
|
2893
|
+
(s) => s.name.toLowerCase() === decodeURIComponent(String(n))
|
|
2894
|
+
)) ?? i;
|
|
2895
|
+
}, si = (e) => {
|
|
2896
|
+
e instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${e.message}`), console.error(e.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", e);
|
|
2897
|
+
}, li = /* @__PURE__ */ new Set([
|
|
1774
2898
|
"brand",
|
|
1775
2899
|
"category",
|
|
1776
2900
|
"department",
|
|
1777
2901
|
"subcategory",
|
|
1778
2902
|
"collection",
|
|
1779
2903
|
"cluster"
|
|
1780
|
-
]),
|
|
1781
|
-
collection:
|
|
1782
|
-
categoryId:
|
|
1783
|
-
current_collection:
|
|
1784
|
-
items:
|
|
1785
|
-
}),
|
|
1786
|
-
if (
|
|
1787
|
-
(
|
|
1788
|
-
).length === 0 || (
|
|
1789
|
-
return
|
|
1790
|
-
const
|
|
1791
|
-
(
|
|
2904
|
+
]), ci = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && li.has(e == null ? void 0 : e.pageType.toLowerCase()), ui = (e) => ({
|
|
2905
|
+
collection: e.Coleção,
|
|
2906
|
+
categoryId: e.categoryId,
|
|
2907
|
+
current_collection: e["Coleção Atual"],
|
|
2908
|
+
items: e.items
|
|
2909
|
+
}), vt = (e, t) => e.reduce((r, n) => {
|
|
2910
|
+
if (n.items.filter(
|
|
2911
|
+
(s) => s.sellers.find((o) => o.commertialOffer.IsAvailable)
|
|
2912
|
+
).length === 0 || (r == null ? void 0 : r.find((s) => (s == null ? void 0 : s.productId) === (n == null ? void 0 : n.productId))) !== void 0)
|
|
2913
|
+
return r;
|
|
2914
|
+
const a = n.items[0].images.find(
|
|
2915
|
+
(s) => t.includes(s.imageLabel)
|
|
1792
2916
|
);
|
|
1793
|
-
return
|
|
1794
|
-
slug: `/${
|
|
1795
|
-
productId:
|
|
1796
|
-
textureImage: (
|
|
1797
|
-
textureAlt: (
|
|
1798
|
-
}),
|
|
1799
|
-
}, []),
|
|
2917
|
+
return r.push({
|
|
2918
|
+
slug: `/${n.linkText}/p`,
|
|
2919
|
+
productId: n == null ? void 0 : n.productId,
|
|
2920
|
+
textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
|
|
2921
|
+
textureAlt: (a == null ? void 0 : a.imageText) ?? ""
|
|
2922
|
+
}), r;
|
|
2923
|
+
}, []), di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1800
2924
|
__proto__: null,
|
|
1801
|
-
createEmptySeoCategory:
|
|
1802
|
-
createSeoCategory:
|
|
1803
|
-
findCategory:
|
|
1804
|
-
formattedSimilars:
|
|
1805
|
-
isCollectionPageType:
|
|
1806
|
-
notFindCategoryError:
|
|
1807
|
-
responseAdapter:
|
|
1808
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
2925
|
+
createEmptySeoCategory: ii,
|
|
2926
|
+
createSeoCategory: oi,
|
|
2927
|
+
findCategory: ai,
|
|
2928
|
+
formattedSimilars: vt,
|
|
2929
|
+
isCollectionPageType: ci,
|
|
2930
|
+
notFindCategoryError: si,
|
|
2931
|
+
responseAdapter: ui
|
|
2932
|
+
}, Symbol.toStringTag, { value: "Module" })), pi = {
|
|
2933
|
+
parseSearchState: Lt,
|
|
2934
|
+
convertSearchParams: $t,
|
|
2935
|
+
filterNonRootFacets: Ft,
|
|
2936
|
+
filterNonCategorySelected: jt
|
|
2937
|
+
}, mi = async ({ children: e, apiUrl: t, productId: r, ClientItems: n, PDP_INFO: i, TEXTURE_IMAGE: a, TOGGLE_STYLE_MODIFIER: s }) => {
|
|
2938
|
+
const o = await fetch(
|
|
2939
|
+
`${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`
|
|
2940
|
+
).then((g) => g.json()), d = vt(o, a);
|
|
2941
|
+
return /* @__PURE__ */ K("div", { className: Re.similars, children: [
|
|
2942
|
+
/* @__PURE__ */ K("div", { className: Re["similars-info"], children: [
|
|
2943
|
+
/* @__PURE__ */ N("span", { className: Re["sections-title"], children: i.product.color_title }),
|
|
2944
|
+
e
|
|
1816
2945
|
] }),
|
|
1817
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ N(n, { productId: r, similars: d, TOGGLE_STYLE_MODIFIER: s })
|
|
1818
2947
|
] });
|
|
1819
|
-
},
|
|
1820
|
-
checkout:
|
|
1821
|
-
catalog:
|
|
1822
|
-
cms:
|
|
1823
|
-
search:
|
|
1824
|
-
masterdata:
|
|
2948
|
+
}, yi = {
|
|
2949
|
+
checkout: Xr,
|
|
2950
|
+
catalog: rn,
|
|
2951
|
+
cms: Dt,
|
|
2952
|
+
search: Cn,
|
|
2953
|
+
masterdata: Nn,
|
|
2954
|
+
user: ri,
|
|
1825
2955
|
wishlist: {
|
|
1826
|
-
...
|
|
2956
|
+
...Fn
|
|
1827
2957
|
}
|
|
1828
|
-
},
|
|
1829
|
-
catalog:
|
|
1830
|
-
search:
|
|
1831
|
-
product:
|
|
2958
|
+
}, _i = {
|
|
2959
|
+
catalog: di,
|
|
2960
|
+
search: pi,
|
|
2961
|
+
product: Mt,
|
|
1832
2962
|
cms: {
|
|
1833
|
-
...
|
|
1834
|
-
...
|
|
2963
|
+
...Ht,
|
|
2964
|
+
...Ut
|
|
1835
2965
|
}
|
|
1836
|
-
},
|
|
2966
|
+
}, Ri = {
|
|
1837
2967
|
template: {
|
|
1838
|
-
pdp: { PDPSimilars:
|
|
2968
|
+
pdp: { PDPSimilars: mi }
|
|
1839
2969
|
}
|
|
1840
2970
|
};
|
|
1841
2971
|
export {
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
2972
|
+
yi as serverAPIs,
|
|
2973
|
+
vi as serverCMS,
|
|
2974
|
+
Ri as serverComponents,
|
|
2975
|
+
_i as serverHelpers
|
|
1846
2976
|
};
|