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