@soma-vertical-web/multi-lib 0.0.62 → 0.0.63
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/cms/ContentTypes/HelpButton/FormatHelpButtonContent.d.ts +13 -0
- package/cms/ContentTypes/HelpButton/HelpButtonContent.d.ts +3 -0
- package/cms/ContentTypes/Search/SearchContent.d.ts +1 -1
- package/cms/index.d.ts +1 -1
- package/cms/server.d.ts +1 -0
- package/index.js +16 -16
- package/index.mjs +3661 -3544
- package/index2.js +1 -1
- package/index2.mjs +875 -824
- package/layout/index.d.ts +1 -0
- package/layout/team-component/BuyPackage/helpers.d.ts +1 -1
- package/layout/team-component/HelpButton/Composite/Body.d.ts +4 -0
- package/layout/team-component/HelpButton/Composite/CallToAction.d.ts +7 -0
- package/layout/team-component/HelpButton/Composite/Wrapper.d.ts +4 -0
- package/layout/team-component/HelpButton/HelpButton.d.ts +4 -0
- package/layout/team-component/HelpButton/index.d.ts +1 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cms/ContentTypes/HelpButton/index.d.ts +17 -6
- package/types/layout/team-components/HelpButton/index.d.ts +9 -3
package/index2.mjs
CHANGED
|
@@ -1,395 +1,446 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { r as
|
|
3
|
-
import { Utils as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
slug:
|
|
8
|
-
data:
|
|
1
|
+
import { jsxs as j, Fragment as A, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { r as D, q as T, S as ce, t as le, v as ue, a as de, w as pe, x as me, c as fe, p as ge, n as G, y as he, f as be } from "./index-DD12Nl4r.mjs";
|
|
3
|
+
import { Utils as _, helpers as M } from "@soma-vertical-web/core-components";
|
|
4
|
+
import * as a from "yup";
|
|
5
|
+
import ye from "sanitize-html";
|
|
6
|
+
const Ie = ({
|
|
7
|
+
slug: t,
|
|
8
|
+
data: e,
|
|
9
9
|
SectionZone: n,
|
|
10
10
|
COMMON_PAGE_COLUMN_GAP: r,
|
|
11
|
-
identifyWhoIsFirst:
|
|
11
|
+
identifyWhoIsFirst: s
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const o = e == null ? void 0 : e.find(
|
|
14
14
|
(p) => {
|
|
15
15
|
var h, f, m, R;
|
|
16
|
-
return ((f = (h = p.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((R = (m = p.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) ===
|
|
16
|
+
return ((f = (h = p.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((R = (m = p.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) === t;
|
|
17
17
|
}
|
|
18
|
-
), i =
|
|
18
|
+
), i = o == null ? void 0 : o.config.responsive.gapCustom, l = o == null ? void 0 : o.config.responsive.gapSections, c = e == null ? void 0 : e.find(
|
|
19
19
|
(p) => {
|
|
20
20
|
var h, f, m, R;
|
|
21
|
-
return ((f = (h = p.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((R = (m = p.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) ===
|
|
21
|
+
return ((f = (h = p.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((R = (m = p.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) === t;
|
|
22
22
|
}
|
|
23
|
-
), d =
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
23
|
+
), d = c == null ? void 0 : c.config.responsive.gapCustom, u = c == null ? void 0 : c.config.responsive.gapSections;
|
|
24
|
+
return /* @__PURE__ */ j(A, { children: [
|
|
25
|
+
/* @__PURE__ */ y(
|
|
26
|
+
_.Column,
|
|
27
27
|
{
|
|
28
28
|
gap: i && l ? l : r,
|
|
29
29
|
className: M.classNameConcat(
|
|
30
|
-
|
|
30
|
+
D["responsive-desktop-flex"],
|
|
31
31
|
"utils-column-modifier"
|
|
32
32
|
),
|
|
33
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ y(n, { data: (o == null ? void 0 : o.sections) ?? [], identifyWhoIsFirst: s })
|
|
34
34
|
}
|
|
35
35
|
),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
36
|
+
/* @__PURE__ */ y(
|
|
37
|
+
_.Column,
|
|
38
38
|
{
|
|
39
|
-
gap: d &&
|
|
39
|
+
gap: d && u ? u : r,
|
|
40
40
|
className: M.classNameConcat(
|
|
41
|
-
|
|
41
|
+
D["responsive-mobile-flex"],
|
|
42
42
|
"utils-column-modifier"
|
|
43
43
|
),
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ y(n, { data: (c == null ? void 0 : c.sections) ?? [], identifyWhoIsFirst: s })
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
47
|
] });
|
|
48
48
|
}, Re = async ({
|
|
49
|
-
slug:
|
|
50
|
-
SectionZone:
|
|
49
|
+
slug: t,
|
|
50
|
+
SectionZone: e,
|
|
51
51
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
52
52
|
identifyWhoIsFirst: r = !1,
|
|
53
|
-
...
|
|
53
|
+
...s
|
|
54
54
|
}) => {
|
|
55
|
-
const { data:
|
|
55
|
+
const { data: o } = await T({
|
|
56
56
|
contentType: "common_page",
|
|
57
|
-
...
|
|
57
|
+
...s
|
|
58
58
|
});
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
|
|
59
|
+
return /* @__PURE__ */ y(
|
|
60
|
+
Ie,
|
|
61
61
|
{
|
|
62
|
-
data:
|
|
63
|
-
slug:
|
|
64
|
-
SectionZone:
|
|
62
|
+
data: o,
|
|
63
|
+
slug: t,
|
|
64
|
+
SectionZone: e,
|
|
65
65
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
66
66
|
identifyWhoIsFirst: r
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}, Ce = async ({
|
|
70
|
-
PAYMENT_FLAGS_DICTIONARY:
|
|
71
|
-
PAYMENT_FLAGS:
|
|
70
|
+
PAYMENT_FLAGS_DICTIONARY: t,
|
|
71
|
+
PAYMENT_FLAGS: e,
|
|
72
72
|
LEGAL_INFORMATION_TEXT: n,
|
|
73
73
|
SectionZone: r,
|
|
74
|
-
ICONS:
|
|
75
|
-
Footer:
|
|
74
|
+
ICONS: s,
|
|
75
|
+
Footer: o,
|
|
76
76
|
FooterSupport: i,
|
|
77
77
|
...l
|
|
78
78
|
}) => {
|
|
79
|
-
var p, h, f, m, R,
|
|
80
|
-
const { data:
|
|
79
|
+
var p, h, f, m, R, E, v, S, F, g, I;
|
|
80
|
+
const { data: c } = await T({
|
|
81
81
|
contentType: "footer",
|
|
82
82
|
...l
|
|
83
|
-
}), d = Array.isArray(
|
|
83
|
+
}), d = Array.isArray(c) && ((p = c[0]) == null ? void 0 : p.type) === "footer" ? c[0] : null, u = {
|
|
84
84
|
...(h = d == null ? void 0 : d.paymentInfo) == null ? void 0 : h.paymentInfo,
|
|
85
85
|
acceptedFlags: Array.isArray(
|
|
86
86
|
(f = d == null ? void 0 : d.paymentInfo) == null ? void 0 : f.paymentInfo.acceptedFlags
|
|
87
|
-
) ? (m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags.filter((C) => !!
|
|
88
|
-
(C) =>
|
|
87
|
+
) ? (m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags.filter((C) => !!t[C]).map(
|
|
88
|
+
(C) => t[C]
|
|
89
89
|
) : []
|
|
90
90
|
};
|
|
91
|
-
return d ? /* @__PURE__ */
|
|
92
|
-
|
|
91
|
+
return d ? /* @__PURE__ */ y(
|
|
92
|
+
o,
|
|
93
93
|
{
|
|
94
94
|
data: { ...d },
|
|
95
95
|
socialInfo: (R = d.socialMedia) == null ? void 0 : R.socialMedia,
|
|
96
|
-
socialMedias: (v = (
|
|
97
|
-
payments:
|
|
96
|
+
socialMedias: (v = (E = d.socialMedia) == null ? void 0 : E.socialMedia) == null ? void 0 : v.medias,
|
|
97
|
+
payments: u,
|
|
98
98
|
adornment: {
|
|
99
|
-
...(
|
|
100
|
-
bottom: /* @__PURE__ */
|
|
99
|
+
...(F = (S = d.supportInfo) == null ? void 0 : S.supportInfo) != null && F.content ? {
|
|
100
|
+
bottom: /* @__PURE__ */ y(
|
|
101
101
|
i,
|
|
102
102
|
{
|
|
103
|
-
content: (
|
|
103
|
+
content: (I = (g = d.supportInfo) == null ? void 0 : g.supportInfo) == null ? void 0 : I.content,
|
|
104
104
|
CONSTANTS: {
|
|
105
|
-
ICONS:
|
|
106
|
-
PAYMENT_FLAGS:
|
|
107
|
-
PAYMENT_FLAGS_DICTIONARY:
|
|
105
|
+
ICONS: s,
|
|
106
|
+
PAYMENT_FLAGS: e,
|
|
107
|
+
PAYMENT_FLAGS_DICTIONARY: t
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
)
|
|
111
111
|
} : {},
|
|
112
|
-
...d.sections.length ? { top: /* @__PURE__ */
|
|
112
|
+
...d.sections.length ? { top: /* @__PURE__ */ y(r, { data: d.sections }) } : {}
|
|
113
113
|
},
|
|
114
114
|
LEGAL_INFORMATION_TEXT: n,
|
|
115
|
-
ICONS:
|
|
115
|
+
ICONS: s
|
|
116
116
|
}
|
|
117
|
-
) : /* @__PURE__ */
|
|
117
|
+
) : /* @__PURE__ */ y(A, {});
|
|
118
118
|
}, ve = async ({
|
|
119
|
-
children:
|
|
120
|
-
ClientHeaderProvider:
|
|
119
|
+
children: t,
|
|
120
|
+
ClientHeaderProvider: e,
|
|
121
121
|
...n
|
|
122
122
|
}) => {
|
|
123
|
-
var
|
|
124
|
-
const { data: r } = await
|
|
123
|
+
var o, i, l, c;
|
|
124
|
+
const { data: r } = await T({
|
|
125
125
|
contentType: "header",
|
|
126
126
|
...n
|
|
127
|
-
}),
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
|
|
127
|
+
}), s = (o = r[0]) == null ? void 0 : o.sections.map((d) => d.data);
|
|
128
|
+
return /* @__PURE__ */ y(
|
|
129
|
+
e,
|
|
130
130
|
{
|
|
131
131
|
headerData: {
|
|
132
132
|
...(i = r[0]) == null ? void 0 : i.layerConfig.config,
|
|
133
|
-
subMenus:
|
|
133
|
+
subMenus: s ?? [],
|
|
134
134
|
categories: ((l = r[0]) == null ? void 0 : l.categories.categories.items) ?? [],
|
|
135
|
-
navigationLinks: ((
|
|
135
|
+
navigationLinks: ((c = r[0]) == null ? void 0 : c.navigationLinks.navigationLinks.items) ?? []
|
|
136
136
|
},
|
|
137
|
-
children:
|
|
137
|
+
children: t
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}, Se = (t) => {
|
|
141
|
+
var i, l;
|
|
142
|
+
const e = (l = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : l.items;
|
|
143
|
+
if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
|
|
144
|
+
return {
|
|
145
|
+
iconLabel: "",
|
|
146
|
+
label: "",
|
|
147
|
+
content: []
|
|
148
|
+
};
|
|
149
|
+
const n = e == null ? void 0 : e.iconLabel, r = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
|
|
150
|
+
(c, d) => ({
|
|
151
|
+
type: c.type,
|
|
152
|
+
id: `${d.toString()}-${c.title.toLowerCase()}`,
|
|
153
|
+
title: c.title,
|
|
154
|
+
subtitle: c.subtitle,
|
|
155
|
+
description: c.description,
|
|
156
|
+
buttonLabel: c.buttonLabel,
|
|
157
|
+
buttonHref: c.buttonHref,
|
|
158
|
+
buttonMode: c.buttonMode,
|
|
159
|
+
buttonSize: c.buttonSize,
|
|
160
|
+
buttonIcon: c.buttonIcon
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
return {
|
|
164
|
+
iconLabel: n,
|
|
165
|
+
label: r,
|
|
166
|
+
helpButtonSize: s,
|
|
167
|
+
content: o
|
|
168
|
+
};
|
|
169
|
+
}, Te = async ({
|
|
170
|
+
HelpButton: t,
|
|
171
|
+
ICONS: e,
|
|
172
|
+
className: n,
|
|
173
|
+
...r
|
|
174
|
+
}) => {
|
|
175
|
+
const { data: s } = await T({
|
|
176
|
+
contentType: "helpbutton",
|
|
177
|
+
...r
|
|
178
|
+
});
|
|
179
|
+
if (!s) return /* @__PURE__ */ y(A, {});
|
|
180
|
+
const o = Se(s);
|
|
181
|
+
return /* @__PURE__ */ y(
|
|
182
|
+
t,
|
|
183
|
+
{
|
|
184
|
+
data: o,
|
|
185
|
+
...r,
|
|
186
|
+
ICONS: e,
|
|
187
|
+
className: n
|
|
138
188
|
}
|
|
139
189
|
);
|
|
140
|
-
},
|
|
141
|
-
children:
|
|
142
|
-
productId:
|
|
190
|
+
}, Ee = async ({
|
|
191
|
+
children: t,
|
|
192
|
+
productId: e,
|
|
143
193
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
144
194
|
SectionZone: r,
|
|
145
|
-
PDPContentProvider:
|
|
146
|
-
...
|
|
195
|
+
PDPContentProvider: s,
|
|
196
|
+
...o
|
|
147
197
|
}) => {
|
|
148
|
-
const { data: i } = await
|
|
198
|
+
const { data: i } = await T({
|
|
149
199
|
contentType: "product_page",
|
|
150
|
-
...
|
|
200
|
+
...o
|
|
151
201
|
});
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
-
|
|
202
|
+
return /* @__PURE__ */ y(
|
|
203
|
+
s,
|
|
154
204
|
{
|
|
155
205
|
data: i[0],
|
|
156
|
-
productId:
|
|
206
|
+
productId: e,
|
|
157
207
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
158
208
|
SectionZone: r,
|
|
159
|
-
children:
|
|
209
|
+
children: t
|
|
160
210
|
}
|
|
161
211
|
);
|
|
162
|
-
},
|
|
212
|
+
}, Fe = {
|
|
163
213
|
"column-modifier": "_column-modifier_1tqap_1"
|
|
164
|
-
},
|
|
165
|
-
children:
|
|
166
|
-
slug:
|
|
214
|
+
}, Oe = async ({
|
|
215
|
+
children: t,
|
|
216
|
+
slug: e,
|
|
167
217
|
SectionZone: n,
|
|
168
218
|
COMMON_PAGE_COLUMN_GAP_PDC: r,
|
|
169
|
-
PLPContentProvider:
|
|
170
|
-
...
|
|
219
|
+
PLPContentProvider: s,
|
|
220
|
+
...o
|
|
171
221
|
}) => {
|
|
172
|
-
const { data: i } = await
|
|
222
|
+
const { data: i } = await T({
|
|
173
223
|
contentType: "categories_page",
|
|
174
|
-
...
|
|
224
|
+
...o
|
|
175
225
|
}), l = i.find(
|
|
176
226
|
(p) => {
|
|
177
227
|
var h, f, m;
|
|
178
|
-
return ((h = p.config) == null ? void 0 : h.seo.slug) ===
|
|
228
|
+
return ((h = p.config) == null ? void 0 : h.seo.slug) === e && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "desktop";
|
|
179
229
|
}
|
|
180
|
-
),
|
|
230
|
+
), c = i.find(
|
|
181
231
|
(p) => {
|
|
182
232
|
var h, f, m;
|
|
183
|
-
return ((h = p.config) == null ? void 0 : h.seo.slug) ===
|
|
233
|
+
return ((h = p.config) == null ? void 0 : h.seo.slug) === e && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "mobile";
|
|
184
234
|
}
|
|
185
235
|
), d = i.find(
|
|
186
236
|
(p) => {
|
|
187
237
|
var h, f, m;
|
|
188
238
|
return ((h = p.config) == null ? void 0 : h.seo.slug) === "default" && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "desktop";
|
|
189
239
|
}
|
|
190
|
-
),
|
|
240
|
+
), u = i.find(
|
|
191
241
|
(p) => {
|
|
192
242
|
var h, f, m;
|
|
193
243
|
return ((h = p.config) == null ? void 0 : h.seo.slug) === "default" && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "mobile";
|
|
194
244
|
}
|
|
195
245
|
);
|
|
196
|
-
return /* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
|
|
246
|
+
return /* @__PURE__ */ j(A, { children: [
|
|
247
|
+
/* @__PURE__ */ y(
|
|
248
|
+
_.Column,
|
|
199
249
|
{
|
|
200
250
|
className: M.classNameConcat(
|
|
201
|
-
|
|
202
|
-
|
|
251
|
+
D["responsive-desktop-flex"],
|
|
252
|
+
Fe["column-modifier"]
|
|
203
253
|
),
|
|
204
254
|
style: {
|
|
205
255
|
minHeight: "100vh"
|
|
206
256
|
},
|
|
207
|
-
children: /* @__PURE__ */
|
|
208
|
-
|
|
257
|
+
children: /* @__PURE__ */ y(
|
|
258
|
+
s,
|
|
209
259
|
{
|
|
210
260
|
data: l ?? d,
|
|
211
261
|
device: "desktop",
|
|
212
262
|
SectionZone: n,
|
|
213
263
|
COMMON_PAGE_COLUMN_GAP_PDC: r,
|
|
214
|
-
children:
|
|
264
|
+
children: t
|
|
215
265
|
}
|
|
216
266
|
)
|
|
217
267
|
}
|
|
218
268
|
),
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
|
|
269
|
+
/* @__PURE__ */ y(_.Column, { className: D["responsive-mobile-flex"], children: /* @__PURE__ */ y(
|
|
270
|
+
s,
|
|
221
271
|
{
|
|
222
|
-
data:
|
|
272
|
+
data: c ?? u,
|
|
223
273
|
device: "mobile",
|
|
224
274
|
SectionZone: n,
|
|
225
275
|
COMMON_PAGE_COLUMN_GAP_PDC: r,
|
|
226
|
-
children:
|
|
276
|
+
children: t
|
|
227
277
|
}
|
|
228
278
|
) })
|
|
229
279
|
] });
|
|
230
|
-
},
|
|
231
|
-
var i, l,
|
|
232
|
-
const { data: n } = await
|
|
280
|
+
}, $e = async ({ slug: t, ...e }) => {
|
|
281
|
+
var i, l, c;
|
|
282
|
+
const { data: n } = await T({
|
|
233
283
|
contentType: "redirect_to_search",
|
|
234
|
-
...
|
|
235
|
-
}), r = ((
|
|
284
|
+
...e
|
|
285
|
+
}), r = ((c = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : c.paths) ?? [];
|
|
236
286
|
if (!!!r.length)
|
|
237
287
|
return {
|
|
238
|
-
slug:
|
|
288
|
+
slug: t,
|
|
239
289
|
query: null,
|
|
240
290
|
redirect: !1
|
|
241
291
|
};
|
|
242
|
-
const
|
|
292
|
+
const o = r.find(
|
|
243
293
|
(d) => {
|
|
244
|
-
var
|
|
245
|
-
return ((
|
|
294
|
+
var u, p;
|
|
295
|
+
return ((u = d.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((p = d.path) == null ? void 0 : p.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
|
|
246
296
|
}
|
|
247
297
|
);
|
|
248
|
-
return
|
|
249
|
-
slug:
|
|
250
|
-
query:
|
|
298
|
+
return o ? {
|
|
299
|
+
slug: t,
|
|
300
|
+
query: o == null ? void 0 : o.searchQuery,
|
|
251
301
|
redirect: !0,
|
|
252
|
-
collectionId:
|
|
253
|
-
filters:
|
|
254
|
-
sort:
|
|
302
|
+
collectionId: o == null ? void 0 : o.collectionId,
|
|
303
|
+
filters: o == null ? void 0 : o.filters,
|
|
304
|
+
sort: o == null ? void 0 : o.sort
|
|
255
305
|
} : {
|
|
256
|
-
slug:
|
|
306
|
+
slug: t,
|
|
257
307
|
query: null,
|
|
258
308
|
redirect: !1,
|
|
259
309
|
collectionId: null,
|
|
260
310
|
filters: null,
|
|
261
311
|
sort: null
|
|
262
312
|
};
|
|
263
|
-
},
|
|
264
|
-
var i, l,
|
|
265
|
-
const { data: n } = await
|
|
313
|
+
}, qe = async ({ slug: t, ...e }) => {
|
|
314
|
+
var i, l, c;
|
|
315
|
+
const { data: n } = await T({
|
|
266
316
|
contentType: "redirect_to_search",
|
|
267
|
-
...
|
|
268
|
-
}), r = ((
|
|
317
|
+
...e
|
|
318
|
+
}), r = ((c = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : c.paths) ?? [];
|
|
269
319
|
if (!!!r.length)
|
|
270
320
|
return null;
|
|
271
|
-
const
|
|
321
|
+
const o = r.find(
|
|
272
322
|
(d) => {
|
|
273
|
-
var
|
|
274
|
-
return ((
|
|
323
|
+
var u, p;
|
|
324
|
+
return ((u = d.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((p = d.path) == null ? void 0 : p.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
|
|
275
325
|
}
|
|
276
326
|
);
|
|
277
|
-
return
|
|
278
|
-
slug:
|
|
279
|
-
title:
|
|
280
|
-
description:
|
|
327
|
+
return o ? {
|
|
328
|
+
slug: t,
|
|
329
|
+
title: o.pageTitle,
|
|
330
|
+
description: o.pageDescription
|
|
281
331
|
} : null;
|
|
282
|
-
},
|
|
283
|
-
children:
|
|
284
|
-
SectionZone:
|
|
332
|
+
}, Pe = async ({
|
|
333
|
+
children: t,
|
|
334
|
+
SectionZone: e,
|
|
285
335
|
className: n,
|
|
286
336
|
...r
|
|
287
337
|
}) => {
|
|
288
|
-
const { data:
|
|
338
|
+
const { data: s } = await T({
|
|
289
339
|
contentType: "search_page",
|
|
290
340
|
...r
|
|
291
341
|
});
|
|
292
|
-
return Array.isArray(
|
|
342
|
+
return Array.isArray(s) && s.length > 0 ? /* @__PURE__ */ y(
|
|
293
343
|
ce,
|
|
294
344
|
{
|
|
295
|
-
data:
|
|
296
|
-
SectionZone:
|
|
345
|
+
data: s,
|
|
346
|
+
SectionZone: e,
|
|
297
347
|
className: n,
|
|
298
|
-
children:
|
|
348
|
+
children: t
|
|
299
349
|
}
|
|
300
|
-
) : /* @__PURE__ */
|
|
301
|
-
},
|
|
302
|
-
ClientTipbarContent:
|
|
303
|
-
...
|
|
350
|
+
) : /* @__PURE__ */ y(A, { children: t });
|
|
351
|
+
}, we = async ({
|
|
352
|
+
ClientTipbarContent: t,
|
|
353
|
+
...e
|
|
304
354
|
}) => {
|
|
305
|
-
const { data: n } = await
|
|
355
|
+
const { data: n } = await T({
|
|
306
356
|
contentType: "tipbar",
|
|
307
|
-
...
|
|
357
|
+
...e
|
|
308
358
|
});
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
},
|
|
359
|
+
return /* @__PURE__ */ y(t, { data: n });
|
|
360
|
+
}, Ne = {
|
|
311
361
|
CommonPageContent: Re,
|
|
312
362
|
HeaderContent: ve,
|
|
313
|
-
TipbarContent:
|
|
363
|
+
TipbarContent: we,
|
|
314
364
|
FooterContent: Ce,
|
|
315
|
-
PLPContent:
|
|
316
|
-
PDPContent:
|
|
317
|
-
getRedirectData:
|
|
318
|
-
getPLPSynteticMetaData:
|
|
319
|
-
SearchPageContent:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
365
|
+
PLPContent: Oe,
|
|
366
|
+
PDPContent: Ee,
|
|
367
|
+
getRedirectData: $e,
|
|
368
|
+
getPLPSynteticMetaData: qe,
|
|
369
|
+
SearchPageContent: Pe,
|
|
370
|
+
HelpButtonContent: Te
|
|
371
|
+
}, Cr = { Components: Ne }, b = async (t, e = {}) => {
|
|
372
|
+
const { method: n = "GET", body: r, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
|
|
373
|
+
return fetch(t, {
|
|
323
374
|
method: n,
|
|
324
375
|
headers: {
|
|
325
|
-
...
|
|
376
|
+
...s,
|
|
326
377
|
Accept: "application/json",
|
|
327
378
|
"Content-Type": "application/json"
|
|
328
379
|
},
|
|
329
|
-
priority:
|
|
380
|
+
priority: o,
|
|
330
381
|
cache: i,
|
|
331
382
|
...r ? { body: JSON.stringify(r) } : {}
|
|
332
383
|
// not body in get
|
|
333
384
|
}).then((l) => l.json()).catch((l) => {
|
|
334
385
|
console.error("[ERROR FETCH VTEX]", l);
|
|
335
386
|
});
|
|
336
|
-
},
|
|
337
|
-
async function
|
|
387
|
+
}, N = /* @__PURE__ */ new Map();
|
|
388
|
+
async function Ae(t, e = {}) {
|
|
338
389
|
var n;
|
|
339
390
|
try {
|
|
340
|
-
const { abort: r = !1 } =
|
|
341
|
-
r && (
|
|
342
|
-
const
|
|
343
|
-
...
|
|
344
|
-
...r ? { signal:
|
|
391
|
+
const { abort: r = !1 } = e, s = new AbortController();
|
|
392
|
+
r && (N.has(t) && ((n = N.get(t)) == null || n.abort(), N.delete(t)), N.set(t, s));
|
|
393
|
+
const o = b(t, {
|
|
394
|
+
...e,
|
|
395
|
+
...r ? { signal: s.signal } : {}
|
|
345
396
|
});
|
|
346
|
-
return r &&
|
|
397
|
+
return r && N.delete(t), o;
|
|
347
398
|
} catch (r) {
|
|
348
399
|
if (r.name === "AbortError") {
|
|
349
|
-
console.log(`[REQUEST CANCELLED]: ${
|
|
400
|
+
console.log(`[REQUEST CANCELLED]: ${t}`);
|
|
350
401
|
return;
|
|
351
402
|
}
|
|
352
403
|
throw console.error(`[ERROR API]: ${r.message}`), r;
|
|
353
404
|
}
|
|
354
405
|
}
|
|
355
|
-
const
|
|
356
|
-
country:
|
|
357
|
-
postalCode:
|
|
406
|
+
const ke = a.object({
|
|
407
|
+
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
408
|
+
postalCode: a.string().nullable()
|
|
358
409
|
});
|
|
359
|
-
async function
|
|
360
|
-
if (!
|
|
410
|
+
async function je({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
411
|
+
if (!e) {
|
|
361
412
|
console.error("[ERROR FETCHING] Body is required");
|
|
362
413
|
return;
|
|
363
414
|
}
|
|
364
|
-
await
|
|
365
|
-
const { country: r, postalCode:
|
|
366
|
-
return await
|
|
367
|
-
`${
|
|
415
|
+
await ke.validate(e);
|
|
416
|
+
const { country: r, postalCode: s } = e;
|
|
417
|
+
return await b(
|
|
418
|
+
`${t}/api/checkout/pub/postal-code/${r}/${s}`,
|
|
368
419
|
{
|
|
369
420
|
method: "POST",
|
|
370
|
-
body:
|
|
421
|
+
body: e,
|
|
371
422
|
...n
|
|
372
423
|
}
|
|
373
424
|
);
|
|
374
425
|
}
|
|
375
|
-
const
|
|
376
|
-
orderFormId:
|
|
377
|
-
sellerCode:
|
|
378
|
-
sellerName:
|
|
426
|
+
const De = a.object({
|
|
427
|
+
orderFormId: a.string().nullable(),
|
|
428
|
+
sellerCode: a.string().nullable(),
|
|
429
|
+
sellerName: a.string().nullable()
|
|
379
430
|
});
|
|
380
431
|
async function K({
|
|
381
|
-
apiUrl:
|
|
382
|
-
body:
|
|
432
|
+
apiUrl: t,
|
|
433
|
+
body: e,
|
|
383
434
|
fetchOptions: n
|
|
384
435
|
}) {
|
|
385
|
-
if (!
|
|
436
|
+
if (!e) {
|
|
386
437
|
console.error("[ERROR FETCHING] Body is required");
|
|
387
438
|
return;
|
|
388
439
|
}
|
|
389
|
-
await
|
|
390
|
-
const { orderFormId: r, sellerCode:
|
|
391
|
-
return
|
|
392
|
-
`${
|
|
440
|
+
await De.validate(e);
|
|
441
|
+
const { orderFormId: r, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
|
|
442
|
+
return b(
|
|
443
|
+
`${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
|
|
393
444
|
{
|
|
394
445
|
method: "POST",
|
|
395
446
|
body: {
|
|
@@ -399,28 +450,28 @@ async function K({
|
|
|
399
450
|
}
|
|
400
451
|
);
|
|
401
452
|
}
|
|
402
|
-
const
|
|
403
|
-
orderFormId:
|
|
404
|
-
sellerCode:
|
|
405
|
-
marketingData:
|
|
453
|
+
const _e = a.object({
|
|
454
|
+
orderFormId: a.string().nullable(),
|
|
455
|
+
sellerCode: a.string().nullable(),
|
|
456
|
+
marketingData: a.object()
|
|
406
457
|
});
|
|
407
458
|
async function J({
|
|
408
|
-
apiUrl:
|
|
409
|
-
body:
|
|
459
|
+
apiUrl: t,
|
|
460
|
+
body: e,
|
|
410
461
|
extraData: n = {},
|
|
411
462
|
fetchOptions: r
|
|
412
463
|
}) {
|
|
413
|
-
if (!
|
|
464
|
+
if (!e) {
|
|
414
465
|
console.error("[ERROR FETCHING] Body is required");
|
|
415
466
|
return;
|
|
416
467
|
}
|
|
417
|
-
await
|
|
418
|
-
const { orderFormId:
|
|
419
|
-
utmCampaign:
|
|
420
|
-
utmiCampaign:
|
|
468
|
+
await _e.validate(e);
|
|
469
|
+
const { orderFormId: s, sellerCode: o, marketingData: i } = e, l = o ? {
|
|
470
|
+
utmCampaign: o ? o.toUpperCase() : "",
|
|
471
|
+
utmiCampaign: o ? `${n.VENDOR_CODE}` : "semcodigo"
|
|
421
472
|
} : {};
|
|
422
|
-
return
|
|
423
|
-
`${
|
|
473
|
+
return b(
|
|
474
|
+
`${t}/api/checkout/pub/orderForm/${s}/attachments/marketingData`,
|
|
424
475
|
{
|
|
425
476
|
method: "POST",
|
|
426
477
|
body: {
|
|
@@ -431,44 +482,44 @@ async function J({
|
|
|
431
482
|
}
|
|
432
483
|
);
|
|
433
484
|
}
|
|
434
|
-
const
|
|
435
|
-
orderFormId:
|
|
436
|
-
sellerCode:
|
|
437
|
-
sellerName:
|
|
485
|
+
const He = a.object({
|
|
486
|
+
orderFormId: a.string().nullable(),
|
|
487
|
+
sellerCode: a.string().nullable(),
|
|
488
|
+
sellerName: a.string().nullable()
|
|
438
489
|
});
|
|
439
|
-
async function
|
|
440
|
-
if (!
|
|
490
|
+
async function Be({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
491
|
+
if (!e) {
|
|
441
492
|
console.error("[ERROR FETCHING] Body is required");
|
|
442
493
|
return;
|
|
443
494
|
}
|
|
444
|
-
await
|
|
445
|
-
const r = await K({ apiUrl:
|
|
495
|
+
await He.validate(e);
|
|
496
|
+
const r = await K({ apiUrl: t, body: e, fetchOptions: n });
|
|
446
497
|
return J({
|
|
447
|
-
apiUrl:
|
|
498
|
+
apiUrl: t,
|
|
448
499
|
body: {
|
|
449
|
-
...
|
|
500
|
+
...e,
|
|
450
501
|
marketingData: r == null ? void 0 : r.marketingData
|
|
451
502
|
},
|
|
452
503
|
fetchOptions: n
|
|
453
504
|
});
|
|
454
505
|
}
|
|
455
|
-
const
|
|
456
|
-
orderFormId:
|
|
457
|
-
coupon:
|
|
506
|
+
const Le = a.object({
|
|
507
|
+
orderFormId: a.string().nullable(),
|
|
508
|
+
coupon: a.string().nullable()
|
|
458
509
|
});
|
|
459
|
-
async function
|
|
460
|
-
apiUrl:
|
|
461
|
-
body:
|
|
510
|
+
async function Ge({
|
|
511
|
+
apiUrl: t,
|
|
512
|
+
body: e,
|
|
462
513
|
fetchOptions: n
|
|
463
514
|
}) {
|
|
464
|
-
if (!
|
|
515
|
+
if (!e) {
|
|
465
516
|
console.error("[ERROR FETCHING] Body is required");
|
|
466
517
|
return;
|
|
467
518
|
}
|
|
468
|
-
await
|
|
469
|
-
const { coupon: r = "", orderFormId:
|
|
470
|
-
return
|
|
471
|
-
`${
|
|
519
|
+
await Le.validate(e);
|
|
520
|
+
const { coupon: r = "", orderFormId: s } = e;
|
|
521
|
+
return b(
|
|
522
|
+
`${t}/api/checkout/pub/orderForm/${s}/coupons`,
|
|
472
523
|
{
|
|
473
524
|
method: "POST",
|
|
474
525
|
body: { text: r },
|
|
@@ -476,232 +527,232 @@ async function Be({
|
|
|
476
527
|
}
|
|
477
528
|
);
|
|
478
529
|
}
|
|
479
|
-
const
|
|
480
|
-
appId:
|
|
481
|
-
orderFormId:
|
|
482
|
-
key:
|
|
530
|
+
const Me = a.object({
|
|
531
|
+
appId: a.string().required("App ID is required"),
|
|
532
|
+
orderFormId: a.string().nullable(),
|
|
533
|
+
key: a.array().of(a.string())
|
|
483
534
|
});
|
|
484
|
-
async function
|
|
485
|
-
apiUrl:
|
|
486
|
-
body:
|
|
535
|
+
async function Ue({
|
|
536
|
+
apiUrl: t,
|
|
537
|
+
body: e,
|
|
487
538
|
fetchOptions: n
|
|
488
539
|
}) {
|
|
489
|
-
if (!
|
|
540
|
+
if (!e) {
|
|
490
541
|
console.error("[ERROR FETCHING] Body is required");
|
|
491
542
|
return;
|
|
492
543
|
}
|
|
493
|
-
await
|
|
494
|
-
const { appId: r = "faststore", orderFormId:
|
|
495
|
-
return
|
|
496
|
-
`${
|
|
544
|
+
await Me.validate(e);
|
|
545
|
+
const { appId: r = "faststore", orderFormId: s, key: o } = e;
|
|
546
|
+
return b(
|
|
547
|
+
`${t}/api/checkout/pub/orderForm/${s}/customData/${r}/${o}`,
|
|
497
548
|
{
|
|
498
549
|
method: "PUT",
|
|
499
550
|
...n
|
|
500
551
|
}
|
|
501
552
|
);
|
|
502
553
|
}
|
|
503
|
-
const
|
|
504
|
-
name:
|
|
505
|
-
content:
|
|
554
|
+
const Ve = a.object().shape({
|
|
555
|
+
name: a.string().required("Attachment name is required"),
|
|
556
|
+
content: a.object().nullable()
|
|
506
557
|
});
|
|
507
|
-
var
|
|
508
|
-
const
|
|
509
|
-
attachments: (
|
|
510
|
-
id:
|
|
511
|
-
index:
|
|
512
|
-
quantity:
|
|
513
|
-
seller:
|
|
514
|
-
price:
|
|
515
|
-
}),
|
|
516
|
-
orderFormId:
|
|
517
|
-
orderItems:
|
|
558
|
+
var x;
|
|
559
|
+
const ze = a.object().shape({
|
|
560
|
+
attachments: (x = a.array().of(Ve)) == null ? void 0 : x.nullable(),
|
|
561
|
+
id: a.string().required("ID of SKU is required"),
|
|
562
|
+
index: a.number().integer().nullable(),
|
|
563
|
+
quantity: a.number().integer().nullable(),
|
|
564
|
+
seller: a.string().required("Seller is required"),
|
|
565
|
+
price: a.number().integer()
|
|
566
|
+
}), xe = a.object({
|
|
567
|
+
orderFormId: a.string().required("OrderFormId is required"),
|
|
568
|
+
orderItems: a.array().of(ze)
|
|
518
569
|
});
|
|
519
|
-
async function
|
|
520
|
-
apiUrl:
|
|
521
|
-
body:
|
|
570
|
+
async function Qe({
|
|
571
|
+
apiUrl: t,
|
|
572
|
+
body: e,
|
|
522
573
|
fetchOptions: n
|
|
523
574
|
}) {
|
|
524
|
-
if (!
|
|
575
|
+
if (!e) {
|
|
525
576
|
console.error("[ERROR FETCHING] Body is required");
|
|
526
577
|
return;
|
|
527
578
|
}
|
|
528
|
-
await
|
|
529
|
-
const { orderFormId: r, orderItems:
|
|
530
|
-
return
|
|
531
|
-
`${
|
|
579
|
+
await xe.validate(e);
|
|
580
|
+
const { orderFormId: r, orderItems: s } = e;
|
|
581
|
+
return b(
|
|
582
|
+
`${t}/api/checkout/pub/orderForm/${r}/items`,
|
|
532
583
|
{
|
|
533
584
|
method: "POST",
|
|
534
|
-
body: { orderItems:
|
|
585
|
+
body: { orderItems: s },
|
|
535
586
|
...n
|
|
536
587
|
}
|
|
537
588
|
);
|
|
538
589
|
}
|
|
539
|
-
const
|
|
540
|
-
orderFormId:
|
|
590
|
+
const Ke = a.object({
|
|
591
|
+
orderFormId: a.string().nullable()
|
|
541
592
|
});
|
|
542
|
-
async function
|
|
543
|
-
apiUrl:
|
|
544
|
-
body:
|
|
593
|
+
async function Je({
|
|
594
|
+
apiUrl: t,
|
|
595
|
+
body: e,
|
|
545
596
|
fetchOptions: n
|
|
546
597
|
}) {
|
|
547
|
-
if (!
|
|
598
|
+
if (!e) {
|
|
548
599
|
console.error("[ERROR FETCHING] Body is required");
|
|
549
600
|
return;
|
|
550
601
|
}
|
|
551
|
-
await
|
|
552
|
-
const { orderFormId: r } =
|
|
553
|
-
return
|
|
554
|
-
`${
|
|
602
|
+
await Ke.validate(e);
|
|
603
|
+
const { orderFormId: r } = e;
|
|
604
|
+
return b(
|
|
605
|
+
`${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,
|
|
555
606
|
{
|
|
556
607
|
method: "POST",
|
|
557
608
|
...n
|
|
558
609
|
}
|
|
559
610
|
);
|
|
560
611
|
}
|
|
561
|
-
const
|
|
562
|
-
name:
|
|
563
|
-
content:
|
|
612
|
+
const Ye = a.object().shape({
|
|
613
|
+
name: a.string().required("Attachment name is required"),
|
|
614
|
+
content: a.object().nullable()
|
|
564
615
|
});
|
|
565
616
|
var Q;
|
|
566
|
-
const
|
|
567
|
-
attachments: (Q =
|
|
568
|
-
id:
|
|
569
|
-
index:
|
|
570
|
-
quantity:
|
|
571
|
-
seller:
|
|
572
|
-
price:
|
|
573
|
-
}),
|
|
574
|
-
orderFormId:
|
|
575
|
-
orderItems:
|
|
617
|
+
const We = a.object().shape({
|
|
618
|
+
attachments: (Q = a.array().of(Ye)) == null ? void 0 : Q.nullable(),
|
|
619
|
+
id: a.string().required("ID of SKU is required"),
|
|
620
|
+
index: a.number().integer().nullable(),
|
|
621
|
+
quantity: a.number().integer().nullable(),
|
|
622
|
+
seller: a.string().required("Seller is required"),
|
|
623
|
+
price: a.number().integer()
|
|
624
|
+
}), Xe = a.object({
|
|
625
|
+
orderFormId: a.string().nullable(),
|
|
626
|
+
orderItems: a.array().of(We)
|
|
576
627
|
});
|
|
577
|
-
async function
|
|
578
|
-
apiUrl:
|
|
579
|
-
body:
|
|
628
|
+
async function Ze({
|
|
629
|
+
apiUrl: t,
|
|
630
|
+
body: e,
|
|
580
631
|
fetchOptions: n
|
|
581
632
|
}) {
|
|
582
|
-
if (!
|
|
633
|
+
if (!e) {
|
|
583
634
|
console.error("[ERROR FETCHING] Body is required");
|
|
584
635
|
return;
|
|
585
636
|
}
|
|
586
|
-
await
|
|
587
|
-
const { orderFormId: r, orderItems:
|
|
588
|
-
return
|
|
589
|
-
`${
|
|
637
|
+
await Xe.validate(e);
|
|
638
|
+
const { orderFormId: r, orderItems: s } = e;
|
|
639
|
+
return b(
|
|
640
|
+
`${t}/api/checkout/pub/orderForm/${r}/items/update`,
|
|
590
641
|
{
|
|
591
642
|
method: "POST",
|
|
592
|
-
body: { orderItems:
|
|
643
|
+
body: { orderItems: s },
|
|
593
644
|
...n
|
|
594
645
|
}
|
|
595
646
|
);
|
|
596
647
|
}
|
|
597
|
-
const
|
|
598
|
-
orderFormId:
|
|
648
|
+
const et = a.object({
|
|
649
|
+
orderFormId: a.string().nullable()
|
|
599
650
|
});
|
|
600
|
-
async function
|
|
601
|
-
apiUrl:
|
|
602
|
-
body:
|
|
651
|
+
async function tt({
|
|
652
|
+
apiUrl: t,
|
|
653
|
+
body: e,
|
|
603
654
|
fetchOptions: n
|
|
604
655
|
}) {
|
|
605
|
-
if (!
|
|
656
|
+
if (!e) {
|
|
606
657
|
console.error("[ERROR FETCHING] Body is required");
|
|
607
658
|
return;
|
|
608
659
|
}
|
|
609
|
-
await
|
|
610
|
-
const { orderFormId: r } =
|
|
611
|
-
return
|
|
612
|
-
`${
|
|
660
|
+
await et.validate(e);
|
|
661
|
+
const { orderFormId: r } = e;
|
|
662
|
+
return b(
|
|
663
|
+
`${t}/api/checkout/pub/orderForm/${r}/messages/clear`,
|
|
613
664
|
{
|
|
614
665
|
method: "POST",
|
|
615
666
|
...n
|
|
616
667
|
}
|
|
617
668
|
);
|
|
618
669
|
}
|
|
619
|
-
const
|
|
620
|
-
id:
|
|
670
|
+
const rt = a.object({
|
|
671
|
+
id: a.string().nullable(),
|
|
621
672
|
// id offering
|
|
622
|
-
itemIndex:
|
|
623
|
-
orderFormId:
|
|
624
|
-
remove:
|
|
673
|
+
itemIndex: a.number().nullable(),
|
|
674
|
+
orderFormId: a.string().nullable(),
|
|
675
|
+
remove: a.boolean().nullable()
|
|
625
676
|
});
|
|
626
|
-
async function
|
|
627
|
-
if (!
|
|
677
|
+
async function nt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
678
|
+
if (!e) {
|
|
628
679
|
console.error("[ERROR FETCHING] Body is required");
|
|
629
680
|
return;
|
|
630
681
|
}
|
|
631
|
-
await
|
|
632
|
-
const { itemIndex: r, orderFormId:
|
|
633
|
-
return
|
|
682
|
+
await rt.validate(e);
|
|
683
|
+
const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, l = i ? `/${o}/remove` : "", c = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${l}`;
|
|
684
|
+
return b(c, {
|
|
634
685
|
method: "POST",
|
|
635
|
-
body: { id:
|
|
686
|
+
body: { id: o },
|
|
636
687
|
...n
|
|
637
688
|
});
|
|
638
689
|
}
|
|
639
|
-
const
|
|
640
|
-
orderFormId:
|
|
690
|
+
const at = a.object({
|
|
691
|
+
orderFormId: a.string().nullable()
|
|
641
692
|
});
|
|
642
|
-
async function
|
|
643
|
-
apiUrl:
|
|
644
|
-
body:
|
|
693
|
+
async function ot({
|
|
694
|
+
apiUrl: t,
|
|
695
|
+
body: e,
|
|
645
696
|
fetchOptions: n,
|
|
646
697
|
extraData: r
|
|
647
698
|
}) {
|
|
648
699
|
var i;
|
|
649
|
-
if (!
|
|
700
|
+
if (!e) {
|
|
650
701
|
console.error("[ERROR FETCHING] Body is required");
|
|
651
702
|
return;
|
|
652
703
|
}
|
|
653
|
-
await
|
|
654
|
-
const
|
|
704
|
+
await at.validate(e);
|
|
705
|
+
const s = new URLSearchParams({
|
|
655
706
|
refreshOutdatedData: "true"
|
|
656
|
-
}),
|
|
657
|
-
return
|
|
707
|
+
}), o = e.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
|
|
708
|
+
return b(o, { method: "GET", ...n });
|
|
658
709
|
}
|
|
659
|
-
const st =
|
|
660
|
-
orderFormId:
|
|
661
|
-
email:
|
|
662
|
-
firstName:
|
|
663
|
-
lastName:
|
|
664
|
-
documentType:
|
|
665
|
-
document:
|
|
666
|
-
phone:
|
|
710
|
+
const st = a.object({
|
|
711
|
+
orderFormId: a.string().nullable(),
|
|
712
|
+
email: a.string().email().required(),
|
|
713
|
+
firstName: a.string().required(),
|
|
714
|
+
lastName: a.string().required(),
|
|
715
|
+
documentType: a.string().required(),
|
|
716
|
+
document: a.string().required(),
|
|
717
|
+
phone: a.string().matches(/^\+\d{1,3}\d{10,11}$/)
|
|
667
718
|
});
|
|
668
|
-
async function
|
|
669
|
-
apiUrl:
|
|
670
|
-
body:
|
|
719
|
+
async function it({
|
|
720
|
+
apiUrl: t,
|
|
721
|
+
body: e,
|
|
671
722
|
fetchOptions: n
|
|
672
723
|
}) {
|
|
673
|
-
if (!
|
|
724
|
+
if (!e) {
|
|
674
725
|
console.error("[ERROR FETCHING] Body is required");
|
|
675
726
|
return;
|
|
676
727
|
}
|
|
677
|
-
await st.validate(
|
|
678
|
-
const { orderFormId: r, ...
|
|
679
|
-
return
|
|
680
|
-
`${
|
|
728
|
+
await st.validate(e);
|
|
729
|
+
const { orderFormId: r, ...s } = e;
|
|
730
|
+
return b(
|
|
731
|
+
`${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
|
|
681
732
|
{
|
|
682
733
|
method: "POST",
|
|
683
|
-
body: { ...
|
|
734
|
+
body: { ...s },
|
|
684
735
|
...n
|
|
685
736
|
}
|
|
686
737
|
);
|
|
687
738
|
}
|
|
688
|
-
const
|
|
689
|
-
sellerCode:
|
|
739
|
+
const ct = a.object({
|
|
740
|
+
sellerCode: a.string().nullable()
|
|
690
741
|
});
|
|
691
|
-
async function
|
|
692
|
-
apiUrl:
|
|
693
|
-
body:
|
|
742
|
+
async function lt({
|
|
743
|
+
apiUrl: t,
|
|
744
|
+
body: e,
|
|
694
745
|
extraData: n,
|
|
695
746
|
fetchOptions: r
|
|
696
747
|
}) {
|
|
697
|
-
if (!
|
|
748
|
+
if (!e) {
|
|
698
749
|
console.error("[ERROR FETCHING] Body is required");
|
|
699
750
|
return;
|
|
700
751
|
}
|
|
701
|
-
await
|
|
702
|
-
const { sellerCode:
|
|
703
|
-
return
|
|
704
|
-
`${
|
|
752
|
+
await ct.validate(e);
|
|
753
|
+
const { sellerCode: s = "" } = e;
|
|
754
|
+
return b(
|
|
755
|
+
`${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${s}`,
|
|
705
756
|
{
|
|
706
757
|
method: "GET",
|
|
707
758
|
headers: {
|
|
@@ -711,33 +762,33 @@ async function it({
|
|
|
711
762
|
}
|
|
712
763
|
);
|
|
713
764
|
}
|
|
714
|
-
const
|
|
715
|
-
country:
|
|
716
|
-
orderFormId:
|
|
717
|
-
postalCode:
|
|
765
|
+
const ut = a.object().shape({
|
|
766
|
+
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
767
|
+
orderFormId: a.string().nullable(),
|
|
768
|
+
postalCode: a.string().nullable()
|
|
718
769
|
});
|
|
719
|
-
async function
|
|
720
|
-
apiUrl:
|
|
721
|
-
body:
|
|
770
|
+
async function dt({
|
|
771
|
+
apiUrl: t,
|
|
772
|
+
body: e,
|
|
722
773
|
fetchOptions: n
|
|
723
774
|
}) {
|
|
724
|
-
if (!
|
|
775
|
+
if (!e) {
|
|
725
776
|
console.error("[ERROR FETCHING] Body is required");
|
|
726
777
|
return;
|
|
727
778
|
}
|
|
728
|
-
await
|
|
729
|
-
const { country: r, orderFormId:
|
|
779
|
+
await ut.validate(e);
|
|
780
|
+
const { country: r, orderFormId: s, postalCode: o } = e, i = o ? {
|
|
730
781
|
address: {
|
|
731
782
|
addressType: "residential",
|
|
732
|
-
postalCode:
|
|
783
|
+
postalCode: o,
|
|
733
784
|
country: r
|
|
734
785
|
}
|
|
735
786
|
} : {
|
|
736
787
|
logisticsInfo: [],
|
|
737
788
|
clearAddressIfPostalCodeNotFound: !0
|
|
738
789
|
};
|
|
739
|
-
return
|
|
740
|
-
`${
|
|
790
|
+
return b(
|
|
791
|
+
`${t}/api/checkout/pub/orderForm/${s}/attachments/shippingData`,
|
|
741
792
|
{
|
|
742
793
|
method: "POST",
|
|
743
794
|
body: i,
|
|
@@ -745,322 +796,322 @@ async function lt({
|
|
|
745
796
|
}
|
|
746
797
|
);
|
|
747
798
|
}
|
|
748
|
-
const
|
|
749
|
-
orderFormId:
|
|
750
|
-
options:
|
|
751
|
-
|
|
752
|
-
itemIndex:
|
|
753
|
-
selectedDeliveryChannel:
|
|
754
|
-
selectedSla:
|
|
799
|
+
const pt = a.object().shape({
|
|
800
|
+
orderFormId: a.string().nullable(),
|
|
801
|
+
options: a.array().of(
|
|
802
|
+
a.object().shape({
|
|
803
|
+
itemIndex: a.number(),
|
|
804
|
+
selectedDeliveryChannel: a.string(),
|
|
805
|
+
selectedSla: a.string()
|
|
755
806
|
})
|
|
756
807
|
),
|
|
757
|
-
selectedAddresses:
|
|
758
|
-
|
|
759
|
-
addressId:
|
|
760
|
-
addressType:
|
|
761
|
-
city:
|
|
762
|
-
complement:
|
|
763
|
-
country:
|
|
764
|
-
geoCoordinates:
|
|
765
|
-
isDisposable:
|
|
766
|
-
neighborhood:
|
|
767
|
-
number:
|
|
768
|
-
postalCode:
|
|
769
|
-
receiverName:
|
|
770
|
-
reference:
|
|
771
|
-
state:
|
|
772
|
-
street:
|
|
808
|
+
selectedAddresses: a.array().of(
|
|
809
|
+
a.object().shape({
|
|
810
|
+
addressId: a.string().required(),
|
|
811
|
+
addressType: a.string().required(),
|
|
812
|
+
city: a.string().nullable(),
|
|
813
|
+
complement: a.string().nullable(),
|
|
814
|
+
country: a.string().required().length(3),
|
|
815
|
+
geoCoordinates: a.array().of(a.number()).required().min(0),
|
|
816
|
+
isDisposable: a.boolean().required(),
|
|
817
|
+
neighborhood: a.string().nullable(),
|
|
818
|
+
number: a.string().nullable(),
|
|
819
|
+
postalCode: a.string().required(),
|
|
820
|
+
receiverName: a.string().nullable(),
|
|
821
|
+
reference: a.string().nullable(),
|
|
822
|
+
state: a.string().nullable(),
|
|
823
|
+
street: a.string().nullable()
|
|
773
824
|
})
|
|
774
825
|
)
|
|
775
826
|
});
|
|
776
|
-
async function
|
|
777
|
-
if (!
|
|
827
|
+
async function mt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
828
|
+
if (!e) {
|
|
778
829
|
console.error("[ERROR FETCHING] Body is required");
|
|
779
830
|
return;
|
|
780
831
|
}
|
|
781
|
-
await
|
|
782
|
-
const { orderFormId: r, options:
|
|
783
|
-
return
|
|
784
|
-
`${
|
|
832
|
+
await pt.validate(e);
|
|
833
|
+
const { orderFormId: r, options: s, selectedAddresses: o } = e;
|
|
834
|
+
return b(
|
|
835
|
+
`${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
|
|
785
836
|
{
|
|
786
837
|
method: "POST",
|
|
787
838
|
body: {
|
|
788
|
-
selectedAddresses:
|
|
839
|
+
selectedAddresses: o,
|
|
789
840
|
clearAddressIfPostalCodeNotFound: !1,
|
|
790
|
-
logisticsInfo:
|
|
841
|
+
logisticsInfo: s
|
|
791
842
|
},
|
|
792
843
|
...n
|
|
793
844
|
}
|
|
794
845
|
);
|
|
795
846
|
}
|
|
796
|
-
const
|
|
797
|
-
country:
|
|
798
|
-
postalCode:
|
|
799
|
-
geoCoordinates:
|
|
800
|
-
longitude:
|
|
801
|
-
latitude:
|
|
847
|
+
const ft = a.object({
|
|
848
|
+
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
849
|
+
postalCode: a.string().nullable(),
|
|
850
|
+
geoCoordinates: a.object().shape({
|
|
851
|
+
longitude: a.number().required(),
|
|
852
|
+
latitude: a.number().required()
|
|
802
853
|
})
|
|
803
854
|
});
|
|
804
|
-
async function
|
|
805
|
-
if (!
|
|
855
|
+
async function gt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
856
|
+
if (!e) {
|
|
806
857
|
console.error("[ERROR FETCHING] Body is required");
|
|
807
858
|
return;
|
|
808
859
|
}
|
|
809
|
-
await
|
|
810
|
-
const { country: r = "", geoCoordinates:
|
|
811
|
-
return
|
|
860
|
+
await ft.validate(e);
|
|
861
|
+
const { country: r = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(r) });
|
|
862
|
+
return o ? i.append("postalCode", o) : i.append(
|
|
812
863
|
"geoCoordinates",
|
|
813
|
-
`${
|
|
814
|
-
), await
|
|
815
|
-
`${
|
|
864
|
+
`${s == null ? void 0 : s.longitude};${s == null ? void 0 : s.latitude}`
|
|
865
|
+
), await b(
|
|
866
|
+
`${t}/api/checkout/pub/regions/?${i.toString()}`,
|
|
816
867
|
{
|
|
817
868
|
method: "GET",
|
|
818
869
|
...n
|
|
819
870
|
}
|
|
820
871
|
);
|
|
821
872
|
}
|
|
822
|
-
const
|
|
823
|
-
id:
|
|
824
|
-
quantity:
|
|
825
|
-
seller:
|
|
826
|
-
}),
|
|
827
|
-
items:
|
|
828
|
-
country:
|
|
829
|
-
postalCode:
|
|
830
|
-
geoCoordinates:
|
|
873
|
+
const ht = a.object({
|
|
874
|
+
id: a.string().required("ID of SKU is required"),
|
|
875
|
+
quantity: a.number().integer().required("Quantity of item is required"),
|
|
876
|
+
seller: a.string()
|
|
877
|
+
}), bt = a.object({
|
|
878
|
+
items: a.array().of(ht),
|
|
879
|
+
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
880
|
+
postalCode: a.string().nullable(),
|
|
881
|
+
geoCoordinates: a.array().nullable().of(a.number()).length(2)
|
|
831
882
|
});
|
|
832
|
-
async function
|
|
833
|
-
if (!
|
|
883
|
+
async function yt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
884
|
+
if (!e) {
|
|
834
885
|
console.error("[ERROR FETCHING] Body is required");
|
|
835
886
|
return;
|
|
836
887
|
}
|
|
837
|
-
return await
|
|
838
|
-
`${
|
|
888
|
+
return await bt.validate(e), b(
|
|
889
|
+
`${t}/api/checkout/pub/orderForms/simulation`,
|
|
839
890
|
{
|
|
840
891
|
method: "POST",
|
|
841
|
-
body:
|
|
892
|
+
body: e,
|
|
842
893
|
...n
|
|
843
894
|
}
|
|
844
895
|
);
|
|
845
896
|
}
|
|
846
|
-
const
|
|
897
|
+
const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
847
898
|
__proto__: null,
|
|
848
|
-
getMasterDataSellerCode:
|
|
849
|
-
getOrderForm:
|
|
850
|
-
postOrderFormAddCoupon:
|
|
851
|
-
postOrderFormAttachClientProfileData:
|
|
852
|
-
postOrderFormAttachOrderFormData:
|
|
853
|
-
postOrderFormAttachShippingData:
|
|
899
|
+
getMasterDataSellerCode: lt,
|
|
900
|
+
getOrderForm: ot,
|
|
901
|
+
postOrderFormAddCoupon: Ge,
|
|
902
|
+
postOrderFormAttachClientProfileData: it,
|
|
903
|
+
postOrderFormAttachOrderFormData: Be,
|
|
904
|
+
postOrderFormAttachShippingData: dt,
|
|
854
905
|
postOrderFormAttachmentsMarketingData: J,
|
|
855
906
|
postOrderFormAttachmentsOpenTextField: K,
|
|
856
|
-
postOrderFormClearMessages:
|
|
857
|
-
postOrderFormFreightSimulation:
|
|
858
|
-
postOrderFormItems:
|
|
859
|
-
postOrderFormRegion:
|
|
860
|
-
postOrderFormRemoveAllItems:
|
|
861
|
-
postOrderFormUpdateItems:
|
|
862
|
-
postOrderFormUpdateShippingData:
|
|
863
|
-
postOrderformAddress:
|
|
864
|
-
putOrderFormCustomData:
|
|
865
|
-
updateOrderFormOffering:
|
|
866
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
867
|
-
skuId:
|
|
907
|
+
postOrderFormClearMessages: tt,
|
|
908
|
+
postOrderFormFreightSimulation: yt,
|
|
909
|
+
postOrderFormItems: Qe,
|
|
910
|
+
postOrderFormRegion: gt,
|
|
911
|
+
postOrderFormRemoveAllItems: Je,
|
|
912
|
+
postOrderFormUpdateItems: Ze,
|
|
913
|
+
postOrderFormUpdateShippingData: mt,
|
|
914
|
+
postOrderformAddress: je,
|
|
915
|
+
putOrderFormCustomData: Ue,
|
|
916
|
+
updateOrderFormOffering: nt
|
|
917
|
+
}, Symbol.toStringTag, { value: "Module" })), Rt = a.object({
|
|
918
|
+
skuId: a.string()
|
|
868
919
|
});
|
|
869
|
-
async function
|
|
870
|
-
if (!
|
|
920
|
+
async function Ct({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
921
|
+
if (!e) {
|
|
871
922
|
console.error("[ERROR FETCHING] Body is required");
|
|
872
923
|
return;
|
|
873
924
|
}
|
|
874
|
-
await
|
|
875
|
-
const { skuId: r } =
|
|
876
|
-
return
|
|
877
|
-
`${
|
|
925
|
+
await Rt.validate(e);
|
|
926
|
+
const { skuId: r } = e;
|
|
927
|
+
return b(
|
|
928
|
+
`${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
|
|
878
929
|
{
|
|
879
930
|
...n
|
|
880
931
|
}
|
|
881
932
|
);
|
|
882
933
|
}
|
|
883
|
-
const
|
|
884
|
-
ids:
|
|
934
|
+
const vt = a.object({
|
|
935
|
+
ids: a.array().of(a.string().required("ID are required")).required("IDs are required")
|
|
885
936
|
});
|
|
886
|
-
async function
|
|
887
|
-
if (!
|
|
937
|
+
async function St({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
938
|
+
if (!e) {
|
|
888
939
|
console.error("[ERROR FETCHING] Body is required");
|
|
889
940
|
return;
|
|
890
941
|
}
|
|
891
|
-
await
|
|
892
|
-
const { ids: r } =
|
|
893
|
-
return
|
|
894
|
-
`${
|
|
942
|
+
await vt.validate(e);
|
|
943
|
+
const { ids: r } = e;
|
|
944
|
+
return b(
|
|
945
|
+
`${t}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
|
|
895
946
|
{
|
|
896
947
|
...n
|
|
897
948
|
}
|
|
898
949
|
);
|
|
899
950
|
}
|
|
900
|
-
const
|
|
901
|
-
productId:
|
|
951
|
+
const Tt = a.object({
|
|
952
|
+
productId: a.number().required("Product ID is required")
|
|
902
953
|
});
|
|
903
|
-
async function
|
|
904
|
-
if (!
|
|
954
|
+
async function Et({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
955
|
+
if (!e) {
|
|
905
956
|
console.error("[ERROR FETCHING] Body is required");
|
|
906
957
|
return;
|
|
907
958
|
}
|
|
908
|
-
await
|
|
909
|
-
const { productId: r } =
|
|
910
|
-
return
|
|
911
|
-
`${
|
|
959
|
+
await Tt.validate(e);
|
|
960
|
+
const { productId: r } = e;
|
|
961
|
+
return b(
|
|
962
|
+
`${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
|
|
912
963
|
{
|
|
913
964
|
...n
|
|
914
965
|
}
|
|
915
966
|
);
|
|
916
967
|
}
|
|
917
|
-
const
|
|
968
|
+
const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
918
969
|
__proto__: null,
|
|
919
|
-
getCatalogKitProducts:
|
|
920
|
-
getCatalogProducts:
|
|
921
|
-
getCatalogSimilars:
|
|
922
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
923
|
-
query:
|
|
970
|
+
getCatalogKitProducts: Ct,
|
|
971
|
+
getCatalogProducts: St,
|
|
972
|
+
getCatalogSimilars: Et
|
|
973
|
+
}, Symbol.toStringTag, { value: "Module" })), Ot = a.object({
|
|
974
|
+
query: a.string()
|
|
924
975
|
});
|
|
925
|
-
async function
|
|
926
|
-
if (!
|
|
976
|
+
async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
977
|
+
if (!e) {
|
|
927
978
|
console.error("[ERROR FETCHING] Body is required");
|
|
928
979
|
return;
|
|
929
980
|
}
|
|
930
|
-
await
|
|
931
|
-
const { query: r = "" } =
|
|
932
|
-
return
|
|
933
|
-
`${
|
|
981
|
+
await Ot.validate(e);
|
|
982
|
+
const { query: r = "" } = e, s = new URLSearchParams({ query: r });
|
|
983
|
+
return b(
|
|
984
|
+
`${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
|
|
934
985
|
{
|
|
935
986
|
...n
|
|
936
987
|
}
|
|
937
988
|
);
|
|
938
989
|
}
|
|
939
|
-
const
|
|
940
|
-
...
|
|
941
|
-
description:
|
|
942
|
-
}),
|
|
943
|
-
offer:
|
|
944
|
-
seller:
|
|
990
|
+
const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
991
|
+
...t,
|
|
992
|
+
description: t.description ? qt(t.description) : t.description
|
|
993
|
+
}), wt = ({
|
|
994
|
+
offer: t,
|
|
995
|
+
seller: e,
|
|
945
996
|
product: n
|
|
946
997
|
}) => ({
|
|
947
|
-
...
|
|
998
|
+
...t,
|
|
948
999
|
product: n,
|
|
949
|
-
seller:
|
|
950
|
-
}), Y = (
|
|
951
|
-
...
|
|
952
|
-
isVariantOf:
|
|
953
|
-
}),
|
|
1000
|
+
seller: e
|
|
1001
|
+
}), Y = (t, e) => ({
|
|
1002
|
+
...t,
|
|
1003
|
+
isVariantOf: Pt(e)
|
|
1004
|
+
}), Nt = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, At = (t) => t.Price ?? 0, W = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), kt = (t, e) => {
|
|
954
1005
|
let n = 0;
|
|
955
|
-
for (let r = 1; r <
|
|
956
|
-
t
|
|
957
|
-
return
|
|
958
|
-
}, X = (
|
|
959
|
-
const
|
|
960
|
-
(r) => r.sellers.map((
|
|
961
|
-
offer:
|
|
1006
|
+
for (let r = 1; r < t.length; r++)
|
|
1007
|
+
e(t[n], t[r]) > 0 && (n = r);
|
|
1008
|
+
return t[n];
|
|
1009
|
+
}, X = (t) => {
|
|
1010
|
+
const e = t.flatMap(
|
|
1011
|
+
(r) => r.sellers.map((s) => ({
|
|
1012
|
+
offer: s.commertialOffer,
|
|
962
1013
|
sku: r
|
|
963
1014
|
}))
|
|
964
|
-
), n =
|
|
965
|
-
|
|
966
|
-
({ offer: r }, { offer:
|
|
1015
|
+
), n = kt(
|
|
1016
|
+
e,
|
|
1017
|
+
({ offer: r }, { offer: s }) => W(r, s)
|
|
967
1018
|
);
|
|
968
|
-
return n ? n.sku :
|
|
969
|
-
}, Z = (
|
|
970
|
-
({ imageUrl:
|
|
1019
|
+
return n ? n.sku : t[0];
|
|
1020
|
+
}, Z = (t) => t.map(
|
|
1021
|
+
({ imageUrl: e, imageText: n, imageLabel: r }) => ({
|
|
971
1022
|
alternateName: n ?? "",
|
|
972
|
-
url:
|
|
1023
|
+
url: e.replace("vteximg.com.br", "vtexassets.com"),
|
|
973
1024
|
keywords: r
|
|
974
1025
|
})
|
|
975
|
-
),
|
|
1026
|
+
), H = {
|
|
976
1027
|
attachment: "ATTACHMENT",
|
|
977
1028
|
specification: "SPECIFICATION",
|
|
978
1029
|
attribute: "ATTRIBUTE"
|
|
979
|
-
},
|
|
980
|
-
name:
|
|
981
|
-
value:
|
|
982
|
-
valueReference:
|
|
983
|
-
}),
|
|
984
|
-
propertyID:
|
|
985
|
-
name:
|
|
986
|
-
value:
|
|
1030
|
+
}, jt = (t) => ({
|
|
1031
|
+
name: t.name,
|
|
1032
|
+
value: t.content,
|
|
1033
|
+
valueReference: H.attachment
|
|
1034
|
+
}), Dt = (t) => ({
|
|
1035
|
+
propertyID: t.id,
|
|
1036
|
+
name: t.name,
|
|
1037
|
+
value: t.value,
|
|
987
1038
|
valueReference: {
|
|
988
|
-
valueReference:
|
|
989
|
-
visible:
|
|
1039
|
+
valueReference: H.attribute,
|
|
1040
|
+
visible: t.visible
|
|
990
1041
|
}
|
|
991
|
-
}),
|
|
992
|
-
const r =
|
|
1042
|
+
}), B = (t, e, n) => {
|
|
1043
|
+
const r = t.flatMap(({ name: i, values: l }) => l ? l.map((c) => ({
|
|
993
1044
|
name: i,
|
|
994
|
-
value:
|
|
995
|
-
valueReference:
|
|
1045
|
+
value: c,
|
|
1046
|
+
valueReference: H.specification
|
|
996
1047
|
})) : {
|
|
997
1048
|
name: i,
|
|
998
1049
|
value: "",
|
|
999
|
-
valueReference:
|
|
1000
|
-
}),
|
|
1050
|
+
valueReference: H.specification
|
|
1051
|
+
}), s = Array.isArray(n) ? n.map(jt) : [], o = e ? e.map(Dt) : [];
|
|
1001
1052
|
return [
|
|
1002
1053
|
...r,
|
|
1003
|
-
...
|
|
1004
|
-
...
|
|
1054
|
+
...s,
|
|
1055
|
+
...o
|
|
1005
1056
|
];
|
|
1006
|
-
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",
|
|
1007
|
-
let
|
|
1057
|
+
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", _t = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ht = (t) => {
|
|
1058
|
+
let e = t.slice(0);
|
|
1008
1059
|
for (let n = 0; n < V.length; n++)
|
|
1009
|
-
|
|
1060
|
+
e = e.replace(
|
|
1010
1061
|
new RegExp(V.charAt(n), "g"),
|
|
1011
|
-
|
|
1062
|
+
_t.charAt(n)
|
|
1012
1063
|
);
|
|
1013
|
-
return
|
|
1014
|
-
},
|
|
1015
|
-
const n =
|
|
1016
|
-
return
|
|
1017
|
-
}, te = (
|
|
1018
|
-
const
|
|
1019
|
-
...
|
|
1020
|
-
), n =
|
|
1021
|
-
(r) => r.NumberOfInstallments ===
|
|
1064
|
+
return e;
|
|
1065
|
+
}, Bt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
|
|
1066
|
+
const n = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1067
|
+
return Bt(Ht(n)).toLowerCase();
|
|
1068
|
+
}, te = (t) => `/${t}/p`, re = (t) => {
|
|
1069
|
+
const e = Math.max(
|
|
1070
|
+
...t.map((r) => r.NumberOfInstallments)
|
|
1071
|
+
), n = t.find(
|
|
1072
|
+
(r) => r.NumberOfInstallments === e
|
|
1022
1073
|
);
|
|
1023
1074
|
return {
|
|
1024
1075
|
count: (n == null ? void 0 : n.NumberOfInstallments) ?? 0,
|
|
1025
1076
|
value: (n == null ? void 0 : n.Value) ?? 0
|
|
1026
1077
|
};
|
|
1027
|
-
}, ne = (
|
|
1078
|
+
}, ne = (t, e) => {
|
|
1028
1079
|
const n = {
|
|
1029
1080
|
price: 0,
|
|
1030
1081
|
listPrice: 0,
|
|
1031
1082
|
sellerDefault: !1
|
|
1032
|
-
},
|
|
1033
|
-
(
|
|
1034
|
-
offer:
|
|
1035
|
-
seller:
|
|
1036
|
-
product:
|
|
1083
|
+
}, s = t.map(
|
|
1084
|
+
(o) => wt({
|
|
1085
|
+
offer: o.commertialOffer,
|
|
1086
|
+
seller: o,
|
|
1087
|
+
product: e
|
|
1037
1088
|
})
|
|
1038
|
-
).sort(W).map((
|
|
1039
|
-
availability:
|
|
1040
|
-
listPrice:
|
|
1041
|
-
price:
|
|
1042
|
-
priceValidUntil:
|
|
1089
|
+
).sort(W).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (n.price = o.Price, n.listPrice = o.ListPrice, n.sellerDefault = !0), {
|
|
1090
|
+
availability: o.AvailableQuantity > 0,
|
|
1091
|
+
listPrice: o.ListPrice,
|
|
1092
|
+
price: At(o),
|
|
1093
|
+
priceValidUntil: o.PriceValidUntil,
|
|
1043
1094
|
priceCurrency: "BRL",
|
|
1044
|
-
installments:
|
|
1045
|
-
lowPrice:
|
|
1046
|
-
quantity:
|
|
1095
|
+
installments: o.Installments,
|
|
1096
|
+
lowPrice: o.spotPrice,
|
|
1097
|
+
quantity: o.AvailableQuantity,
|
|
1047
1098
|
seller: {
|
|
1048
|
-
identifier:
|
|
1099
|
+
identifier: o.seller.sellerId
|
|
1049
1100
|
}
|
|
1050
1101
|
}));
|
|
1051
1102
|
return {
|
|
1052
|
-
lowPrice: n.sellerDefault ? n.price :
|
|
1053
|
-
highPrice: n.sellerDefault ? n.listPrice :
|
|
1054
|
-
offers:
|
|
1103
|
+
lowPrice: n.sellerDefault ? n.price : s[0].price,
|
|
1104
|
+
highPrice: n.sellerDefault ? n.listPrice : s[0].listPrice,
|
|
1105
|
+
offers: s
|
|
1055
1106
|
};
|
|
1056
|
-
},
|
|
1057
|
-
const { attributes:
|
|
1107
|
+
}, ae = (t) => {
|
|
1108
|
+
const { attributes: e, itemId: n, name: r, sellers: s, variations: o } = t;
|
|
1058
1109
|
return {
|
|
1059
|
-
additionalProperty:
|
|
1110
|
+
additionalProperty: B(o, e, []),
|
|
1060
1111
|
name: r,
|
|
1061
1112
|
offers: {
|
|
1062
|
-
offers:
|
|
1063
|
-
availability:
|
|
1113
|
+
offers: s.map(({ sellerId: i, commertialOffer: l }) => ({
|
|
1114
|
+
availability: Nt(l.AvailableQuantity > 0),
|
|
1064
1115
|
listPrice: l.ListPrice,
|
|
1065
1116
|
price: l.Price,
|
|
1066
1117
|
quantity: l.AvailableQuantity,
|
|
@@ -1072,43 +1123,43 @@ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
|
|
|
1072
1123
|
sku: n
|
|
1073
1124
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1074
1125
|
};
|
|
1075
|
-
},
|
|
1126
|
+
}, Lt = (t) => {
|
|
1076
1127
|
var O;
|
|
1077
1128
|
const {
|
|
1078
|
-
attributes:
|
|
1129
|
+
attributes: e,
|
|
1079
1130
|
referenceId: n,
|
|
1080
1131
|
isVariantOf: r,
|
|
1081
|
-
images:
|
|
1082
|
-
itemId:
|
|
1132
|
+
images: s,
|
|
1133
|
+
itemId: o,
|
|
1083
1134
|
name: i,
|
|
1084
1135
|
sellers: l,
|
|
1085
|
-
videos:
|
|
1136
|
+
videos: c,
|
|
1086
1137
|
variations: d
|
|
1087
|
-
} =
|
|
1088
|
-
brand:
|
|
1138
|
+
} = t, {
|
|
1139
|
+
brand: u,
|
|
1089
1140
|
categories: p,
|
|
1090
1141
|
categoriesIds: h,
|
|
1091
1142
|
description: f,
|
|
1092
1143
|
linkText: m,
|
|
1093
1144
|
productClusters: R,
|
|
1094
|
-
clusterHighlights:
|
|
1145
|
+
clusterHighlights: E,
|
|
1095
1146
|
productName: v,
|
|
1096
1147
|
properties: S,
|
|
1097
|
-
productId:
|
|
1148
|
+
productId: F,
|
|
1098
1149
|
productReference: g
|
|
1099
|
-
} = r,
|
|
1150
|
+
} = r, I = p.slice().reverse(), C = ne(l, t.isVariantOf), q = re(C.offers[0].installments);
|
|
1100
1151
|
return {
|
|
1101
|
-
sku:
|
|
1152
|
+
sku: o,
|
|
1102
1153
|
gtin: ((O = n == null ? void 0 : n[0]) == null ? void 0 : O.Value) ?? g ?? "",
|
|
1103
1154
|
name: v ?? i,
|
|
1104
1155
|
description: f,
|
|
1105
1156
|
releaseDate: r.releaseDate ?? "",
|
|
1106
1157
|
slug: m,
|
|
1107
|
-
video:
|
|
1158
|
+
video: c[0],
|
|
1108
1159
|
categories: p,
|
|
1109
1160
|
categoriesIds: h,
|
|
1110
|
-
id:
|
|
1111
|
-
brand: { name:
|
|
1161
|
+
id: F,
|
|
1162
|
+
brand: { name: u, brandName: u },
|
|
1112
1163
|
seo: {
|
|
1113
1164
|
description: f,
|
|
1114
1165
|
title: v,
|
|
@@ -1116,18 +1167,18 @@ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
|
|
|
1116
1167
|
},
|
|
1117
1168
|
cluster: {
|
|
1118
1169
|
generals: R,
|
|
1119
|
-
highlights:
|
|
1170
|
+
highlights: E
|
|
1120
1171
|
},
|
|
1121
1172
|
properties: S,
|
|
1122
1173
|
availability: { status: C.offers[0].availability },
|
|
1123
1174
|
breadcrumbList: {
|
|
1124
1175
|
itemListElement: [
|
|
1125
|
-
...
|
|
1126
|
-
const $ = P.split("/"),
|
|
1176
|
+
...I.map((P, w) => {
|
|
1177
|
+
const $ = P.split("/"), L = $[$.length - 2], ie = $.map(ee).join("/");
|
|
1127
1178
|
return {
|
|
1128
|
-
name:
|
|
1179
|
+
name: L,
|
|
1129
1180
|
item: ie,
|
|
1130
|
-
position:
|
|
1181
|
+
position: w + 1
|
|
1131
1182
|
};
|
|
1132
1183
|
}),
|
|
1133
1184
|
{
|
|
@@ -1138,56 +1189,56 @@ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
|
|
|
1138
1189
|
],
|
|
1139
1190
|
numberOfItems: p.length
|
|
1140
1191
|
},
|
|
1141
|
-
image: Z(
|
|
1192
|
+
image: Z(s),
|
|
1142
1193
|
offers: C,
|
|
1143
|
-
additionalProperty:
|
|
1194
|
+
additionalProperty: B(d, e, []),
|
|
1144
1195
|
isVariantOf: {
|
|
1145
1196
|
productGroupID: r.productId,
|
|
1146
|
-
hasVariant: r.items.map((P) =>
|
|
1197
|
+
hasVariant: r.items.map((P) => ae(P))
|
|
1147
1198
|
},
|
|
1148
1199
|
installments: q
|
|
1149
1200
|
};
|
|
1150
|
-
},
|
|
1201
|
+
}, Gt = (t) => {
|
|
1151
1202
|
var q;
|
|
1152
1203
|
const {
|
|
1153
|
-
attributes:
|
|
1204
|
+
attributes: e,
|
|
1154
1205
|
referenceId: n,
|
|
1155
1206
|
isVariantOf: r,
|
|
1156
|
-
images:
|
|
1157
|
-
itemId:
|
|
1207
|
+
images: s,
|
|
1208
|
+
itemId: o,
|
|
1158
1209
|
name: i,
|
|
1159
1210
|
sellers: l,
|
|
1160
|
-
Videos:
|
|
1211
|
+
Videos: c,
|
|
1161
1212
|
variations: d
|
|
1162
|
-
} =
|
|
1163
|
-
brand:
|
|
1213
|
+
} = t, {
|
|
1214
|
+
brand: u,
|
|
1164
1215
|
categories: p,
|
|
1165
1216
|
categoriesIds: h,
|
|
1166
1217
|
description: f,
|
|
1167
1218
|
linkText: m,
|
|
1168
1219
|
productClusters: R,
|
|
1169
|
-
productName:
|
|
1220
|
+
productName: E,
|
|
1170
1221
|
Coleção: v,
|
|
1171
1222
|
"ID Coleção": S,
|
|
1172
|
-
productId:
|
|
1173
|
-
} = r, g = p.slice().reverse(),
|
|
1223
|
+
productId: F
|
|
1224
|
+
} = r, g = p.slice().reverse(), I = ne(l, t.isVariantOf), C = re(I.offers[0].installments);
|
|
1174
1225
|
return {
|
|
1175
|
-
sku:
|
|
1226
|
+
sku: o,
|
|
1176
1227
|
gtin: ((q = n[0]) == null ? void 0 : q.Value) ?? "",
|
|
1177
|
-
name:
|
|
1228
|
+
name: E ?? i,
|
|
1178
1229
|
description: f,
|
|
1179
1230
|
releaseDate: r.releaseDate ?? "",
|
|
1180
1231
|
slug: m,
|
|
1181
|
-
video:
|
|
1232
|
+
video: c[0],
|
|
1182
1233
|
categories: p,
|
|
1183
1234
|
categoriesIds: h,
|
|
1184
1235
|
collection: v,
|
|
1185
1236
|
collectionId: S,
|
|
1186
|
-
id:
|
|
1187
|
-
brand: { name:
|
|
1237
|
+
id: F,
|
|
1238
|
+
brand: { name: u, brandName: u },
|
|
1188
1239
|
seo: {
|
|
1189
1240
|
description: f,
|
|
1190
|
-
title:
|
|
1241
|
+
title: E,
|
|
1191
1242
|
canonical: te(m)
|
|
1192
1243
|
},
|
|
1193
1244
|
cluster: {
|
|
@@ -1195,14 +1246,14 @@ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
|
|
|
1195
1246
|
highlights: []
|
|
1196
1247
|
// TODO: add highlights
|
|
1197
1248
|
},
|
|
1198
|
-
availability: { status:
|
|
1249
|
+
availability: { status: I.offers[0].availability },
|
|
1199
1250
|
breadcrumbList: {
|
|
1200
1251
|
itemListElement: [
|
|
1201
1252
|
...g.map((O, P) => {
|
|
1202
|
-
const
|
|
1253
|
+
const w = O.split("/"), $ = w[w.length - 2], L = w.map(ee).join("/");
|
|
1203
1254
|
return {
|
|
1204
1255
|
name: $,
|
|
1205
|
-
item:
|
|
1256
|
+
item: L,
|
|
1206
1257
|
position: P + 1
|
|
1207
1258
|
};
|
|
1208
1259
|
}),
|
|
@@ -1214,21 +1265,21 @@ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
|
|
|
1214
1265
|
],
|
|
1215
1266
|
numberOfItems: p.length
|
|
1216
1267
|
},
|
|
1217
|
-
image: Z(
|
|
1218
|
-
offers:
|
|
1219
|
-
additionalProperty:
|
|
1268
|
+
image: Z(s),
|
|
1269
|
+
offers: I,
|
|
1270
|
+
additionalProperty: B(d, e, []),
|
|
1220
1271
|
isVariantOf: {
|
|
1221
1272
|
productGroupID: r.productId,
|
|
1222
1273
|
hasVariant: r.items.map((O) => {
|
|
1223
|
-
const { variations: P } = O,
|
|
1274
|
+
const { variations: P } = O, w = P.map(($) => ({
|
|
1224
1275
|
name: $,
|
|
1225
1276
|
values: O[$]
|
|
1226
1277
|
}));
|
|
1227
1278
|
return {
|
|
1228
|
-
...
|
|
1229
|
-
additionalProperty:
|
|
1230
|
-
|
|
1231
|
-
|
|
1279
|
+
...ae(O),
|
|
1280
|
+
additionalProperty: B(
|
|
1281
|
+
w,
|
|
1282
|
+
e,
|
|
1232
1283
|
[]
|
|
1233
1284
|
)
|
|
1234
1285
|
};
|
|
@@ -1236,59 +1287,59 @@ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
|
|
|
1236
1287
|
},
|
|
1237
1288
|
installments: C
|
|
1238
1289
|
};
|
|
1239
|
-
},
|
|
1240
|
-
key:
|
|
1241
|
-
value:
|
|
1290
|
+
}, Mt = a.array().of(a.object({
|
|
1291
|
+
key: a.string().required(),
|
|
1292
|
+
value: a.string().required()
|
|
1242
1293
|
})).required("Facets are required");
|
|
1243
|
-
async function
|
|
1244
|
-
if (!
|
|
1294
|
+
async function Ut({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1295
|
+
if (!e) {
|
|
1245
1296
|
console.error("[ERROR FETCHING] Body is required");
|
|
1246
1297
|
return;
|
|
1247
1298
|
}
|
|
1248
|
-
await
|
|
1249
|
-
const r = new URLSearchParams({}),
|
|
1250
|
-
le(
|
|
1251
|
-
const
|
|
1252
|
-
return
|
|
1299
|
+
await Mt.validate(e);
|
|
1300
|
+
const r = new URLSearchParams({}), s = e.map(({ key: i, value: l }) => `${i}/${l}`).join("/");
|
|
1301
|
+
le(e, r);
|
|
1302
|
+
const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
1303
|
+
return b(o, {
|
|
1253
1304
|
cache: "no-store",
|
|
1254
1305
|
...n
|
|
1255
|
-
}).then((i) => i.map((
|
|
1256
|
-
const d = X(
|
|
1257
|
-
return d && Y(d,
|
|
1258
|
-
}).filter((
|
|
1259
|
-
node:
|
|
1306
|
+
}).then((i) => i.map((c) => {
|
|
1307
|
+
const d = X(c.items);
|
|
1308
|
+
return d && Y(d, c);
|
|
1309
|
+
}).filter((c) => !!c).map((c) => ({
|
|
1310
|
+
node: Gt(c)
|
|
1260
1311
|
})));
|
|
1261
1312
|
}
|
|
1262
|
-
const
|
|
1263
|
-
apiUrl:
|
|
1264
|
-
body:
|
|
1313
|
+
const oe = ({
|
|
1314
|
+
apiUrl: t,
|
|
1315
|
+
body: e,
|
|
1265
1316
|
fetchOptions: n,
|
|
1266
1317
|
extraData: r
|
|
1267
1318
|
}) => {
|
|
1268
|
-
if (!
|
|
1319
|
+
if (!e) {
|
|
1269
1320
|
console.error("[ERROR FETCHING] Body is required");
|
|
1270
1321
|
return;
|
|
1271
1322
|
}
|
|
1272
1323
|
const {
|
|
1273
|
-
query:
|
|
1274
|
-
page:
|
|
1324
|
+
query: s = "",
|
|
1325
|
+
page: o = 1,
|
|
1275
1326
|
count: i,
|
|
1276
1327
|
sort: l = "",
|
|
1277
|
-
facets:
|
|
1328
|
+
facets: c = [],
|
|
1278
1329
|
type: d,
|
|
1279
|
-
hideUnavailableItems:
|
|
1330
|
+
hideUnavailableItems: u = !0,
|
|
1280
1331
|
locale: p = ""
|
|
1281
|
-
} =
|
|
1282
|
-
page:
|
|
1332
|
+
} = e, h = new URLSearchParams({
|
|
1333
|
+
page: o.toString(),
|
|
1283
1334
|
count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
|
|
1284
|
-
query:
|
|
1335
|
+
query: s,
|
|
1285
1336
|
sort: l,
|
|
1286
1337
|
locale: p
|
|
1287
1338
|
});
|
|
1288
|
-
|
|
1289
|
-
const f =
|
|
1290
|
-
return
|
|
1291
|
-
`${
|
|
1339
|
+
u !== void 0 && h.append("hideUnavailableItems", u.toString());
|
|
1340
|
+
const f = c.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
|
|
1341
|
+
return Ae(
|
|
1342
|
+
`${t}/api/io/_v/api/intelligent-search/${d}/${f}?${h.toString()}`,
|
|
1292
1343
|
{
|
|
1293
1344
|
headers: {
|
|
1294
1345
|
Accept: "application/json",
|
|
@@ -1298,145 +1349,145 @@ const ae = ({
|
|
|
1298
1349
|
}
|
|
1299
1350
|
);
|
|
1300
1351
|
};
|
|
1301
|
-
async function
|
|
1302
|
-
if (!
|
|
1352
|
+
async function Vt({ body: t, extraData: e, ...n }) {
|
|
1353
|
+
if (!t) {
|
|
1303
1354
|
console.error("[ERROR FETCHING] Body is required");
|
|
1304
1355
|
return;
|
|
1305
1356
|
}
|
|
1306
|
-
const r = await
|
|
1357
|
+
const r = await oe({
|
|
1307
1358
|
body: {
|
|
1308
|
-
...
|
|
1359
|
+
...t,
|
|
1309
1360
|
type: "product_search"
|
|
1310
1361
|
},
|
|
1311
|
-
extraData:
|
|
1362
|
+
extraData: e,
|
|
1312
1363
|
...n
|
|
1313
|
-
}),
|
|
1314
|
-
const
|
|
1315
|
-
return
|
|
1364
|
+
}), s = (r == null ? void 0 : r.products.map((l) => {
|
|
1365
|
+
const c = X(l.items);
|
|
1366
|
+
return c && Y(c, l);
|
|
1316
1367
|
}).filter((l) => !!l)) ?? [], {
|
|
1317
|
-
pagination:
|
|
1368
|
+
pagination: o,
|
|
1318
1369
|
recordsFiltered: i
|
|
1319
1370
|
} = r;
|
|
1320
1371
|
return {
|
|
1321
1372
|
data: {
|
|
1322
1373
|
pagination: {
|
|
1323
|
-
nextPage:
|
|
1324
|
-
previousPage:
|
|
1374
|
+
nextPage: o.after.length > 0,
|
|
1375
|
+
previousPage: o.before.length > 0,
|
|
1325
1376
|
startCursor: "0",
|
|
1326
1377
|
endCursor: i.toString(),
|
|
1327
1378
|
count: i,
|
|
1328
|
-
total:
|
|
1379
|
+
total: o.count
|
|
1329
1380
|
},
|
|
1330
|
-
products:
|
|
1331
|
-
node:
|
|
1332
|
-
cursor:
|
|
1381
|
+
products: s.map((l, c) => ({
|
|
1382
|
+
node: Lt(l),
|
|
1383
|
+
cursor: c.toString()
|
|
1333
1384
|
}))
|
|
1334
1385
|
}
|
|
1335
1386
|
};
|
|
1336
1387
|
}
|
|
1337
|
-
async function
|
|
1338
|
-
if (!
|
|
1388
|
+
async function zt({ body: t, extraData: e, ...n }) {
|
|
1389
|
+
if (!t) {
|
|
1339
1390
|
console.error("[ERROR FETCHING] Body is required");
|
|
1340
1391
|
return;
|
|
1341
1392
|
}
|
|
1342
|
-
const r = await
|
|
1393
|
+
const r = await oe({
|
|
1343
1394
|
body: {
|
|
1344
|
-
...
|
|
1395
|
+
...t,
|
|
1345
1396
|
type: "facets"
|
|
1346
1397
|
},
|
|
1347
|
-
extraData:
|
|
1398
|
+
extraData: e,
|
|
1348
1399
|
...n
|
|
1349
1400
|
});
|
|
1350
1401
|
return !r || !r.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
|
|
1351
1402
|
data: {
|
|
1352
1403
|
...r,
|
|
1353
|
-
facets: ue(r,
|
|
1404
|
+
facets: ue(r, t == null ? void 0 : t.selectedFacets, (t == null ? void 0 : t.query) ?? "")
|
|
1354
1405
|
}
|
|
1355
1406
|
};
|
|
1356
1407
|
}
|
|
1357
|
-
const
|
|
1358
|
-
query:
|
|
1359
|
-
locale:
|
|
1408
|
+
const xt = a.object({
|
|
1409
|
+
query: a.string().optional(),
|
|
1410
|
+
locale: a.string().optional()
|
|
1360
1411
|
});
|
|
1361
|
-
async function
|
|
1362
|
-
if (!
|
|
1412
|
+
async function Qt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1413
|
+
if (!e) {
|
|
1363
1414
|
console.error("[ERROR FETCHING] Body is required");
|
|
1364
1415
|
return;
|
|
1365
1416
|
}
|
|
1366
|
-
await
|
|
1367
|
-
const { query: r = "", locale:
|
|
1368
|
-
return
|
|
1369
|
-
`${
|
|
1417
|
+
await xt.validate(e);
|
|
1418
|
+
const { query: r = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: r, locale: s });
|
|
1419
|
+
return b(
|
|
1420
|
+
`${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,
|
|
1370
1421
|
{
|
|
1371
1422
|
...n
|
|
1372
1423
|
}
|
|
1373
1424
|
);
|
|
1374
1425
|
}
|
|
1375
|
-
async function
|
|
1376
|
-
return
|
|
1426
|
+
async function Kt({ apiUrl: t }) {
|
|
1427
|
+
return b(`${t}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1377
1428
|
}
|
|
1378
|
-
const
|
|
1429
|
+
const Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1379
1430
|
__proto__: null,
|
|
1380
|
-
getSearchAutoCompleteSuggestions:
|
|
1381
|
-
getSearchCrossellingProducts:
|
|
1382
|
-
getSearchFacets:
|
|
1383
|
-
getSearchProducts:
|
|
1384
|
-
getSearchSuggestedTerms:
|
|
1385
|
-
getSearchTopSearchs:
|
|
1386
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1387
|
-
masterDataEntity:
|
|
1388
|
-
payload:
|
|
1431
|
+
getSearchAutoCompleteSuggestions: $t,
|
|
1432
|
+
getSearchCrossellingProducts: Ut,
|
|
1433
|
+
getSearchFacets: zt,
|
|
1434
|
+
getSearchProducts: Vt,
|
|
1435
|
+
getSearchSuggestedTerms: Qt,
|
|
1436
|
+
getSearchTopSearchs: Kt
|
|
1437
|
+
}, Symbol.toStringTag, { value: "Module" })), Yt = a.object({
|
|
1438
|
+
masterDataEntity: a.string().nonNullable(),
|
|
1439
|
+
payload: a.object().shape({}).nullable()
|
|
1389
1440
|
});
|
|
1390
|
-
async function
|
|
1391
|
-
apiUrl:
|
|
1392
|
-
body:
|
|
1441
|
+
async function Wt({
|
|
1442
|
+
apiUrl: t,
|
|
1443
|
+
body: e,
|
|
1393
1444
|
fetchOptions: n
|
|
1394
1445
|
}) {
|
|
1395
|
-
if (!
|
|
1446
|
+
if (!e) {
|
|
1396
1447
|
console.error("[ERROR FETCHING] Body is required");
|
|
1397
1448
|
return;
|
|
1398
1449
|
}
|
|
1399
|
-
await
|
|
1400
|
-
const { masterDataEntity: r, payload:
|
|
1401
|
-
return
|
|
1450
|
+
await Yt.validate(e);
|
|
1451
|
+
const { masterDataEntity: r, payload: s } = e, o = `${t}/api/dataentities/${r}/documents`;
|
|
1452
|
+
return b(o, {
|
|
1402
1453
|
method: "POST",
|
|
1403
1454
|
body: {
|
|
1404
|
-
payload:
|
|
1455
|
+
payload: s
|
|
1405
1456
|
},
|
|
1406
1457
|
...n
|
|
1407
1458
|
});
|
|
1408
1459
|
}
|
|
1409
|
-
const
|
|
1410
|
-
_where:
|
|
1411
|
-
_fields:
|
|
1412
|
-
_sort:
|
|
1413
|
-
_from:
|
|
1414
|
-
_to:
|
|
1415
|
-
_keyword:
|
|
1416
|
-
}),
|
|
1417
|
-
masterDataEntity:
|
|
1418
|
-
searchFields:
|
|
1419
|
-
headers:
|
|
1420
|
-
"REST-Range":
|
|
1460
|
+
const Xt = a.object().shape({
|
|
1461
|
+
_where: a.string().optional(),
|
|
1462
|
+
_fields: a.string().optional(),
|
|
1463
|
+
_sort: a.string().optional(),
|
|
1464
|
+
_from: a.number().integer().min(0).optional(),
|
|
1465
|
+
_to: a.number().integer().min(0).optional(),
|
|
1466
|
+
_keyword: a.string().optional()
|
|
1467
|
+
}), Zt = a.object({
|
|
1468
|
+
masterDataEntity: a.string().required(),
|
|
1469
|
+
searchFields: Xt,
|
|
1470
|
+
headers: a.object().shape({
|
|
1471
|
+
"REST-Range": a.string().notRequired()
|
|
1421
1472
|
})
|
|
1422
1473
|
});
|
|
1423
|
-
async function
|
|
1424
|
-
apiUrl:
|
|
1425
|
-
body:
|
|
1474
|
+
async function er({
|
|
1475
|
+
apiUrl: t,
|
|
1476
|
+
body: e,
|
|
1426
1477
|
fetchOptions: n
|
|
1427
1478
|
}) {
|
|
1428
|
-
if (!
|
|
1479
|
+
if (!e) {
|
|
1429
1480
|
console.error("[ERROR FETCHING] Body is required");
|
|
1430
1481
|
return;
|
|
1431
1482
|
}
|
|
1432
1483
|
const r = new URLSearchParams();
|
|
1433
|
-
await
|
|
1434
|
-
const { masterDataEntity:
|
|
1435
|
-
|
|
1436
|
-
r.append(
|
|
1437
|
-
}), "_fields" in
|
|
1438
|
-
const l = `${
|
|
1439
|
-
return
|
|
1484
|
+
await Zt.validate(e);
|
|
1485
|
+
const { masterDataEntity: s, searchFields: o, headers: i } = e;
|
|
1486
|
+
o && Object.entries(o).forEach(([c, d]) => {
|
|
1487
|
+
r.append(c, String(d));
|
|
1488
|
+
}), "_fields" in o || r == null || r.append("_fields", "_all");
|
|
1489
|
+
const l = `${t}/api/dataentities/${s}/search?${r.toString()}`;
|
|
1490
|
+
return b(l, {
|
|
1440
1491
|
headers: {
|
|
1441
1492
|
"REST-Range": i["REST-Range"] ?? "resources=0-20"
|
|
1442
1493
|
},
|
|
@@ -1444,86 +1495,86 @@ async function Xt({
|
|
|
1444
1495
|
...n
|
|
1445
1496
|
});
|
|
1446
1497
|
}
|
|
1447
|
-
const
|
|
1448
|
-
dataEntityName:
|
|
1449
|
-
id:
|
|
1450
|
-
fieldsToBeUpdated:
|
|
1498
|
+
const tr = a.object({
|
|
1499
|
+
dataEntityName: a.string().required(),
|
|
1500
|
+
id: a.string().required(),
|
|
1501
|
+
fieldsToBeUpdated: a.object().shape({})
|
|
1451
1502
|
});
|
|
1452
|
-
async function
|
|
1453
|
-
apiUrl:
|
|
1454
|
-
body:
|
|
1503
|
+
async function rr({
|
|
1504
|
+
apiUrl: t,
|
|
1505
|
+
body: e,
|
|
1455
1506
|
fetchOptions: n
|
|
1456
1507
|
}) {
|
|
1457
|
-
if (!
|
|
1508
|
+
if (!e) {
|
|
1458
1509
|
console.error("[ERROR FETCHING] Body is required");
|
|
1459
1510
|
return;
|
|
1460
1511
|
}
|
|
1461
|
-
await
|
|
1462
|
-
const { dataEntityName: r, id:
|
|
1463
|
-
return
|
|
1512
|
+
await tr.validate(e);
|
|
1513
|
+
const { dataEntityName: r, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
|
|
1514
|
+
return b(i, {
|
|
1464
1515
|
body: {
|
|
1465
|
-
fieldsToBeUpdated:
|
|
1516
|
+
fieldsToBeUpdated: o
|
|
1466
1517
|
},
|
|
1467
1518
|
method: "PATCH",
|
|
1468
1519
|
...n
|
|
1469
1520
|
});
|
|
1470
1521
|
}
|
|
1471
|
-
const
|
|
1522
|
+
const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1472
1523
|
__proto__: null,
|
|
1473
|
-
getSearchMasterdata:
|
|
1474
|
-
patchUpdateMasterdata:
|
|
1475
|
-
postMasterdata:
|
|
1524
|
+
getSearchMasterdata: er,
|
|
1525
|
+
patchUpdateMasterdata: rr,
|
|
1526
|
+
postMasterdata: Wt
|
|
1476
1527
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1477
|
-
async function
|
|
1478
|
-
const { productIds:
|
|
1479
|
-
if (!
|
|
1528
|
+
async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
1529
|
+
const { productIds: s } = t;
|
|
1530
|
+
if (!s)
|
|
1480
1531
|
return console.error("[ERROR FETCHING] productIds is required"), [];
|
|
1481
|
-
const { NAME_SPLIT_SYMBOL:
|
|
1482
|
-
if (!
|
|
1532
|
+
const { NAME_SPLIT_SYMBOL: o } = n;
|
|
1533
|
+
if (!o)
|
|
1483
1534
|
return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
|
|
1484
|
-
const i =
|
|
1485
|
-
`${
|
|
1535
|
+
const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), l = await b(
|
|
1536
|
+
`${e}/api/catalog_system/pub/products/search?fq=${i}`,
|
|
1486
1537
|
{
|
|
1487
1538
|
...r
|
|
1488
1539
|
}
|
|
1489
|
-
),
|
|
1490
|
-
return l.map((
|
|
1491
|
-
var
|
|
1492
|
-
const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable:
|
|
1540
|
+
), c = (u) => Object.keys(u).map((p) => ({ id: p, name: u[p] }));
|
|
1541
|
+
return l.map((u, p) => {
|
|
1542
|
+
var F;
|
|
1543
|
+
const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable: E } = de({ items: u.items, NAME_SPLIT_SYMBOL: o }), v = E ? !0 : R.some((g) => g.available), S = u.items[0].sellers[0].commertialOffer;
|
|
1493
1544
|
return {
|
|
1494
1545
|
node: {
|
|
1495
|
-
sku:
|
|
1496
|
-
gtin:
|
|
1497
|
-
name:
|
|
1498
|
-
description:
|
|
1499
|
-
releaseDate:
|
|
1500
|
-
slug:
|
|
1501
|
-
categories:
|
|
1502
|
-
categoriesIds:
|
|
1503
|
-
id:
|
|
1546
|
+
sku: u.items[0].itemId,
|
|
1547
|
+
gtin: u.productReference,
|
|
1548
|
+
name: u.productName,
|
|
1549
|
+
description: u.description,
|
|
1550
|
+
releaseDate: u.releaseDate,
|
|
1551
|
+
slug: u.linkText,
|
|
1552
|
+
categories: u.categories,
|
|
1553
|
+
categoriesIds: u.categoriesIds,
|
|
1554
|
+
id: u.items[0].itemId,
|
|
1504
1555
|
brand: {
|
|
1505
|
-
name:
|
|
1506
|
-
brandName:
|
|
1556
|
+
name: u.brand,
|
|
1557
|
+
brandName: u.brand
|
|
1507
1558
|
},
|
|
1508
1559
|
seo: {
|
|
1509
|
-
description:
|
|
1510
|
-
title:
|
|
1511
|
-
canonical: `/${
|
|
1560
|
+
description: u.description,
|
|
1561
|
+
title: u.productName,
|
|
1562
|
+
canonical: `/${u.linkText}/p`
|
|
1512
1563
|
},
|
|
1513
1564
|
cluster: {
|
|
1514
|
-
generals: u
|
|
1515
|
-
highlights: u
|
|
1565
|
+
generals: c(u.productClusters),
|
|
1566
|
+
highlights: c(u.clusterHighlights)
|
|
1516
1567
|
},
|
|
1517
1568
|
availability: {
|
|
1518
1569
|
status: v
|
|
1519
1570
|
},
|
|
1520
|
-
image:
|
|
1571
|
+
image: u.items[0].images.map(
|
|
1521
1572
|
({
|
|
1522
1573
|
imageLabel: g,
|
|
1523
|
-
imageUrl:
|
|
1574
|
+
imageUrl: I
|
|
1524
1575
|
}) => ({
|
|
1525
1576
|
alternateName: g,
|
|
1526
|
-
url:
|
|
1577
|
+
url: I,
|
|
1527
1578
|
keywords: g
|
|
1528
1579
|
})
|
|
1529
1580
|
),
|
|
@@ -1541,23 +1592,23 @@ async function rr({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
|
|
|
1541
1592
|
lowPrice: f,
|
|
1542
1593
|
quantity: S.AvailableQuantity,
|
|
1543
1594
|
seller: {
|
|
1544
|
-
identifier:
|
|
1595
|
+
identifier: u.items[0].sellers[0].sellerId
|
|
1545
1596
|
}
|
|
1546
1597
|
}
|
|
1547
1598
|
]
|
|
1548
1599
|
},
|
|
1549
|
-
additionalProperty: (
|
|
1550
|
-
name:
|
|
1600
|
+
additionalProperty: (F = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : F.map((g) => ({
|
|
1601
|
+
name: u == null ? void 0 : u.skuSpecifications[0].field.name,
|
|
1551
1602
|
value: g,
|
|
1552
1603
|
valueReference: "SPECIFICATION"
|
|
1553
1604
|
})),
|
|
1554
1605
|
isVariantOf: {
|
|
1555
|
-
productGroupID:
|
|
1556
|
-
hasVariant:
|
|
1606
|
+
productGroupID: u.productId,
|
|
1607
|
+
hasVariant: u.items.map((g) => ({
|
|
1557
1608
|
additionalProperty: g == null ? void 0 : g.variations.map(() => {
|
|
1558
|
-
var
|
|
1609
|
+
var I, C, q;
|
|
1559
1610
|
return {
|
|
1560
|
-
name: (
|
|
1611
|
+
name: (I = g == null ? void 0 : g.variations) == null ? void 0 : I[0],
|
|
1561
1612
|
value: (q = g == null ? void 0 : g[(C = g == null ? void 0 : g.variations) == null ? void 0 : C[0]]) == null ? void 0 : q[0],
|
|
1562
1613
|
valueReference: "SPECIFICATION"
|
|
1563
1614
|
};
|
|
@@ -1565,11 +1616,11 @@ async function rr({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
|
|
|
1565
1616
|
name: g.name,
|
|
1566
1617
|
offers: {
|
|
1567
1618
|
offers: g.sellers.map(
|
|
1568
|
-
({ commertialOffer:
|
|
1619
|
+
({ commertialOffer: I, sellerId: C }) => ({
|
|
1569
1620
|
availability: "https://schema.org/InStock",
|
|
1570
|
-
listPrice:
|
|
1571
|
-
price:
|
|
1572
|
-
quantity:
|
|
1621
|
+
listPrice: I.ListPrice,
|
|
1622
|
+
price: I.Price,
|
|
1623
|
+
quantity: I.AvailableQuantity,
|
|
1573
1624
|
seller: {
|
|
1574
1625
|
identifier: C
|
|
1575
1626
|
}
|
|
@@ -1586,112 +1637,112 @@ async function rr({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
|
|
|
1586
1637
|
};
|
|
1587
1638
|
});
|
|
1588
1639
|
}
|
|
1589
|
-
const
|
|
1640
|
+
const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1590
1641
|
__proto__: null,
|
|
1591
|
-
getWishlistProducts:
|
|
1592
|
-
}, Symbol.toStringTag, { value: "Module" })), sr = (
|
|
1642
|
+
getWishlistProducts: ar
|
|
1643
|
+
}, Symbol.toStringTag, { value: "Module" })), sr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), z = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(sr).join(e), ir = ({ canonical: t, seo: e, slug: n }) => {
|
|
1593
1644
|
const r = Array.isArray(n) ? n.join(", ") : n;
|
|
1594
1645
|
return {
|
|
1595
1646
|
id: 0,
|
|
1596
|
-
Title: `${Array.isArray(n) ? n.map((
|
|
1597
|
-
MetaTagDescription:
|
|
1647
|
+
Title: `${Array.isArray(n) ? n.map((o) => z(o)).join(",") : z(n)} - ${e.title}`,
|
|
1648
|
+
MetaTagDescription: e.description,
|
|
1598
1649
|
name: r,
|
|
1599
1650
|
hasChildren: !1,
|
|
1600
|
-
url:
|
|
1651
|
+
url: t,
|
|
1601
1652
|
children: []
|
|
1602
1653
|
};
|
|
1603
|
-
},
|
|
1604
|
-
category: String(
|
|
1605
|
-
title: (
|
|
1606
|
-
description: (
|
|
1607
|
-
alternates: { canonical:
|
|
1654
|
+
}, cr = ({ canonical: t, category: e, previousImages: n, seo: r }) => ({
|
|
1655
|
+
category: String(e == null ? void 0 : e.id),
|
|
1656
|
+
title: (e == null ? void 0 : e.Title) ?? r.title,
|
|
1657
|
+
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
1658
|
+
alternates: { canonical: t },
|
|
1608
1659
|
openGraph: {
|
|
1609
1660
|
type: "website",
|
|
1610
|
-
title: (
|
|
1611
|
-
description: (
|
|
1661
|
+
title: (e == null ? void 0 : e.Title) ?? r.title,
|
|
1662
|
+
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
1612
1663
|
images: Array.isArray(n) ? [...n] : []
|
|
1613
1664
|
}
|
|
1614
|
-
}),
|
|
1615
|
-
const
|
|
1616
|
-
(i) => i.url.replace(n, "") === decodeURIComponent(
|
|
1665
|
+
}), lr = ({ items: t, parent: e, apiUrl: n, find: r }) => {
|
|
1666
|
+
const s = t.find(
|
|
1667
|
+
(i) => i.url.replace(n, "") === decodeURIComponent(e.toLowerCase())
|
|
1617
1668
|
);
|
|
1618
|
-
return (
|
|
1669
|
+
return (s == null ? void 0 : s.children.find(
|
|
1619
1670
|
(i) => i.name.toLowerCase() === decodeURIComponent(String(r))
|
|
1620
|
-
)) ??
|
|
1621
|
-
},
|
|
1622
|
-
|
|
1623
|
-
},
|
|
1671
|
+
)) ?? s;
|
|
1672
|
+
}, ur = (t) => {
|
|
1673
|
+
t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
|
|
1674
|
+
}, dr = /* @__PURE__ */ new Set([
|
|
1624
1675
|
"brand",
|
|
1625
1676
|
"category",
|
|
1626
1677
|
"department",
|
|
1627
1678
|
"subcategory",
|
|
1628
1679
|
"collection",
|
|
1629
1680
|
"cluster"
|
|
1630
|
-
]),
|
|
1631
|
-
collection:
|
|
1632
|
-
categoryId:
|
|
1633
|
-
current_collection:
|
|
1634
|
-
items:
|
|
1635
|
-
}),
|
|
1681
|
+
]), pr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && dr.has(t == null ? void 0 : t.pageType.toLowerCase()), mr = (t) => ({
|
|
1682
|
+
collection: t.Coleção,
|
|
1683
|
+
categoryId: t.categoryId,
|
|
1684
|
+
current_collection: t["Coleção Atual"],
|
|
1685
|
+
items: t.items
|
|
1686
|
+
}), se = (t, e) => t.reduce((n, r) => {
|
|
1636
1687
|
if (r.items.filter(
|
|
1637
1688
|
(i) => i.sellers.find((l) => l.commertialOffer.IsAvailable)
|
|
1638
1689
|
).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
|
|
1639
1690
|
return n;
|
|
1640
|
-
const
|
|
1641
|
-
(i) =>
|
|
1691
|
+
const o = r.items[0].images.find(
|
|
1692
|
+
(i) => e.includes(i.imageLabel)
|
|
1642
1693
|
);
|
|
1643
1694
|
return n.push({
|
|
1644
1695
|
slug: `/${r.linkText}/p`,
|
|
1645
1696
|
productId: r == null ? void 0 : r.productId,
|
|
1646
|
-
textureImage: (
|
|
1647
|
-
textureAlt: (
|
|
1697
|
+
textureImage: (o == null ? void 0 : o.imageUrl) ?? "",
|
|
1698
|
+
textureAlt: (o == null ? void 0 : o.imageText) ?? ""
|
|
1648
1699
|
}), n;
|
|
1649
|
-
}, []),
|
|
1700
|
+
}, []), fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1650
1701
|
__proto__: null,
|
|
1651
|
-
createEmptySeoCategory:
|
|
1652
|
-
createSeoCategory:
|
|
1653
|
-
findCategory:
|
|
1654
|
-
formattedSimilars:
|
|
1655
|
-
isCollectionPageType:
|
|
1656
|
-
notFindCategoryError:
|
|
1657
|
-
responseAdapter:
|
|
1658
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1702
|
+
createEmptySeoCategory: ir,
|
|
1703
|
+
createSeoCategory: cr,
|
|
1704
|
+
findCategory: lr,
|
|
1705
|
+
formattedSimilars: se,
|
|
1706
|
+
isCollectionPageType: pr,
|
|
1707
|
+
notFindCategoryError: ur,
|
|
1708
|
+
responseAdapter: mr
|
|
1709
|
+
}, Symbol.toStringTag, { value: "Module" })), gr = {
|
|
1659
1710
|
parseSearchState: ge,
|
|
1660
1711
|
convertSearchParams: fe,
|
|
1661
1712
|
filterNonRootFacets: me,
|
|
1662
1713
|
filterNonCategorySelected: pe
|
|
1663
|
-
},
|
|
1714
|
+
}, hr = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
|
|
1664
1715
|
const l = await fetch(
|
|
1665
|
-
`${
|
|
1666
|
-
).then((d) => d.json()),
|
|
1667
|
-
return /* @__PURE__ */
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
|
|
1716
|
+
`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
|
|
1717
|
+
).then((d) => d.json()), c = se(l, o);
|
|
1718
|
+
return /* @__PURE__ */ j("div", { className: G.similars, children: [
|
|
1719
|
+
/* @__PURE__ */ j("div", { className: G["similars-info"], children: [
|
|
1720
|
+
/* @__PURE__ */ y("span", { className: G["sections-title"], children: s.product.color_title }),
|
|
1721
|
+
t
|
|
1671
1722
|
] }),
|
|
1672
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ y(r, { productId: n, similars: c, TOGGLE_STYLE_MODIFIER: i })
|
|
1673
1724
|
] });
|
|
1674
|
-
},
|
|
1675
|
-
checkout:
|
|
1676
|
-
catalog:
|
|
1725
|
+
}, vr = {
|
|
1726
|
+
checkout: It,
|
|
1727
|
+
catalog: Ft,
|
|
1677
1728
|
cms: he,
|
|
1678
|
-
search:
|
|
1679
|
-
masterdata:
|
|
1729
|
+
search: Jt,
|
|
1730
|
+
masterdata: nr,
|
|
1680
1731
|
wishlist: {
|
|
1681
|
-
...
|
|
1732
|
+
...or
|
|
1682
1733
|
}
|
|
1683
|
-
},
|
|
1684
|
-
catalog:
|
|
1685
|
-
search:
|
|
1686
|
-
product:
|
|
1687
|
-
},
|
|
1734
|
+
}, Sr = {
|
|
1735
|
+
catalog: fr,
|
|
1736
|
+
search: gr,
|
|
1737
|
+
product: be
|
|
1738
|
+
}, Tr = {
|
|
1688
1739
|
template: {
|
|
1689
|
-
pdp: { PDPSimilars:
|
|
1740
|
+
pdp: { PDPSimilars: hr }
|
|
1690
1741
|
}
|
|
1691
1742
|
};
|
|
1692
1743
|
export {
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1744
|
+
vr as serverAPIs,
|
|
1745
|
+
Cr as serverCMS,
|
|
1746
|
+
Tr as serverComponents,
|
|
1747
|
+
Sr as serverHelpers
|
|
1697
1748
|
};
|