@soma-vertical-web/multi-lib 0.0.70 → 0.0.72
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/Sections/PopupModal/Component.d.ts +4 -0
- package/cms/Sections/PopupModal/Composite/FormSection.d.ts +4 -0
- package/cms/Sections/PopupModal/Composite/Success.d.ts +4 -0
- package/cms/index.d.ts +1 -0
- package/cms/server.d.ts +1 -0
- package/constants.d.ts +4 -1
- package/data/api/DitoIngest/sendDitoEvent.d.ts +3 -0
- package/data/api/search/autoCompleteSuggestions/index.d.ts +1 -1
- package/data/helpers/utils/stringToSHA1.d.ts +1 -0
- package/index.js +16 -16
- package/index.mjs +5587 -5190
- package/index2.js +1 -1
- package/index2.mjs +456 -437
- package/layout/index.d.ts +12 -0
- 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/template/LPCadastro/index.d.ts +3 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cms/Sections/PopupModal/index.d.ts +26 -0
- package/types/data/api/dito-ingest/index.d.ts +65 -0
- package/types/layout/team-components/Form/index.d.ts +21 -3
- package/types/layout/templates/LPCadastro/index.d.ts +32 -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,24 @@ 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({
|
|
991
|
+
apiUrl: t,
|
|
992
|
+
body: e,
|
|
993
|
+
fetchOptions: n
|
|
994
|
+
}) {
|
|
976
995
|
if (!e) {
|
|
977
996
|
console.error("[ERROR FETCHING] Body is required");
|
|
978
997
|
return;
|
|
979
998
|
}
|
|
980
|
-
await
|
|
999
|
+
await $t.validate(e);
|
|
981
1000
|
const { query: r = "" } = e, s = new URLSearchParams({ query: r });
|
|
982
1001
|
return b(
|
|
983
1002
|
`${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
|
|
@@ -986,10 +1005,10 @@ async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
986
1005
|
}
|
|
987
1006
|
);
|
|
988
1007
|
}
|
|
989
|
-
const
|
|
1008
|
+
const Pt = (t, e) => ye(t, e), wt = (t) => ({
|
|
990
1009
|
...t,
|
|
991
|
-
description: t.description ?
|
|
992
|
-
}),
|
|
1010
|
+
description: t.description ? Pt(t.description) : t.description
|
|
1011
|
+
}), Nt = ({
|
|
993
1012
|
offer: t,
|
|
994
1013
|
seller: e,
|
|
995
1014
|
product: n
|
|
@@ -999,8 +1018,8 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
999
1018
|
seller: e
|
|
1000
1019
|
}), Y = (t, e) => ({
|
|
1001
1020
|
...t,
|
|
1002
|
-
isVariantOf:
|
|
1003
|
-
}),
|
|
1021
|
+
isVariantOf: wt(e)
|
|
1022
|
+
}), 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
1023
|
let n = 0;
|
|
1005
1024
|
for (let r = 1; r < t.length; r++)
|
|
1006
1025
|
e(t[n], t[r]) > 0 && (n = r);
|
|
@@ -1011,7 +1030,7 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1011
1030
|
offer: s.commertialOffer,
|
|
1012
1031
|
sku: r
|
|
1013
1032
|
}))
|
|
1014
|
-
), n =
|
|
1033
|
+
), n = jt(
|
|
1015
1034
|
e,
|
|
1016
1035
|
({ offer: r }, { offer: s }) => W(r, s)
|
|
1017
1036
|
);
|
|
@@ -1026,11 +1045,11 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1026
1045
|
attachment: "ATTACHMENT",
|
|
1027
1046
|
specification: "SPECIFICATION",
|
|
1028
1047
|
attribute: "ATTRIBUTE"
|
|
1029
|
-
},
|
|
1048
|
+
}, Dt = (t) => ({
|
|
1030
1049
|
name: t.name,
|
|
1031
1050
|
value: t.content,
|
|
1032
1051
|
valueReference: H.attachment
|
|
1033
|
-
}),
|
|
1052
|
+
}), _t = (t) => ({
|
|
1034
1053
|
propertyID: t.id,
|
|
1035
1054
|
name: t.name,
|
|
1036
1055
|
value: t.value,
|
|
@@ -1038,7 +1057,7 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1038
1057
|
valueReference: H.attribute,
|
|
1039
1058
|
visible: t.visible
|
|
1040
1059
|
}
|
|
1041
|
-
}),
|
|
1060
|
+
}), L = (t, e, n) => {
|
|
1042
1061
|
const r = t.flatMap(({ name: i, values: l }) => l ? l.map((c) => ({
|
|
1043
1062
|
name: i,
|
|
1044
1063
|
value: c,
|
|
@@ -1047,23 +1066,23 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1047
1066
|
name: i,
|
|
1048
1067
|
value: "",
|
|
1049
1068
|
valueReference: H.specification
|
|
1050
|
-
}), s = Array.isArray(n) ? n.map(
|
|
1069
|
+
}), s = Array.isArray(n) ? n.map(Dt) : [], a = e ? e.map(_t) : [];
|
|
1051
1070
|
return [
|
|
1052
1071
|
...r,
|
|
1053
1072
|
...s,
|
|
1054
|
-
...
|
|
1073
|
+
...a
|
|
1055
1074
|
];
|
|
1056
|
-
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",
|
|
1075
|
+
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Ht = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Lt = (t) => {
|
|
1057
1076
|
let e = t.slice(0);
|
|
1058
1077
|
for (let n = 0; n < V.length; n++)
|
|
1059
1078
|
e = e.replace(
|
|
1060
1079
|
new RegExp(V.charAt(n), "g"),
|
|
1061
|
-
|
|
1080
|
+
Ht.charAt(n)
|
|
1062
1081
|
);
|
|
1063
1082
|
return e;
|
|
1064
1083
|
}, Bt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
|
|
1065
1084
|
const n = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1066
|
-
return Bt(
|
|
1085
|
+
return Bt(Lt(n)).toLowerCase();
|
|
1067
1086
|
}, te = (t) => `/${t}/p`, re = (t) => {
|
|
1068
1087
|
const e = Math.max(
|
|
1069
1088
|
...t.map((r) => r.NumberOfInstallments)
|
|
@@ -1080,22 +1099,22 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1080
1099
|
listPrice: 0,
|
|
1081
1100
|
sellerDefault: !1
|
|
1082
1101
|
}, s = t.map(
|
|
1083
|
-
(
|
|
1084
|
-
offer:
|
|
1085
|
-
seller:
|
|
1102
|
+
(a) => Nt({
|
|
1103
|
+
offer: a.commertialOffer,
|
|
1104
|
+
seller: a,
|
|
1086
1105
|
product: e
|
|
1087
1106
|
})
|
|
1088
|
-
).sort(W).map((
|
|
1089
|
-
availability:
|
|
1090
|
-
listPrice:
|
|
1091
|
-
price:
|
|
1092
|
-
priceValidUntil:
|
|
1107
|
+
).sort(W).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (n.price = a.Price, n.listPrice = a.ListPrice, n.sellerDefault = !0), {
|
|
1108
|
+
availability: a.AvailableQuantity > 0,
|
|
1109
|
+
listPrice: a.ListPrice,
|
|
1110
|
+
price: kt(a),
|
|
1111
|
+
priceValidUntil: a.PriceValidUntil,
|
|
1093
1112
|
priceCurrency: "BRL",
|
|
1094
|
-
installments:
|
|
1095
|
-
lowPrice:
|
|
1096
|
-
quantity:
|
|
1113
|
+
installments: a.Installments,
|
|
1114
|
+
lowPrice: a.spotPrice,
|
|
1115
|
+
quantity: a.AvailableQuantity,
|
|
1097
1116
|
seller: {
|
|
1098
|
-
identifier:
|
|
1117
|
+
identifier: a.seller.sellerId
|
|
1099
1118
|
}
|
|
1100
1119
|
}));
|
|
1101
1120
|
return {
|
|
@@ -1103,14 +1122,14 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1103
1122
|
highPrice: n.sellerDefault ? n.listPrice : s[0].listPrice,
|
|
1104
1123
|
offers: s
|
|
1105
1124
|
};
|
|
1106
|
-
},
|
|
1107
|
-
const { attributes: e, itemId: n, name: r, sellers: s, variations:
|
|
1125
|
+
}, oe = (t) => {
|
|
1126
|
+
const { attributes: e, itemId: n, name: r, sellers: s, variations: a } = t;
|
|
1108
1127
|
return {
|
|
1109
|
-
additionalProperty:
|
|
1128
|
+
additionalProperty: L(a, e, []),
|
|
1110
1129
|
name: r,
|
|
1111
1130
|
offers: {
|
|
1112
1131
|
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: l }) => ({
|
|
1113
|
-
availability:
|
|
1132
|
+
availability: At(l.AvailableQuantity > 0),
|
|
1114
1133
|
listPrice: l.ListPrice,
|
|
1115
1134
|
price: l.Price,
|
|
1116
1135
|
quantity: l.AvailableQuantity,
|
|
@@ -1122,14 +1141,14 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1122
1141
|
sku: n
|
|
1123
1142
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1124
1143
|
};
|
|
1125
|
-
},
|
|
1144
|
+
}, Gt = (t) => {
|
|
1126
1145
|
var v;
|
|
1127
1146
|
const {
|
|
1128
1147
|
attributes: e,
|
|
1129
1148
|
referenceId: n,
|
|
1130
1149
|
isVariantOf: r,
|
|
1131
1150
|
images: s,
|
|
1132
|
-
itemId:
|
|
1151
|
+
itemId: a,
|
|
1133
1152
|
name: i,
|
|
1134
1153
|
sellers: l,
|
|
1135
1154
|
videos: c,
|
|
@@ -1142,15 +1161,15 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1142
1161
|
linkText: m,
|
|
1143
1162
|
productClusters: R,
|
|
1144
1163
|
clusterHighlights: F,
|
|
1145
|
-
productName:
|
|
1146
|
-
properties:
|
|
1164
|
+
productName: T,
|
|
1165
|
+
properties: E,
|
|
1147
1166
|
productId: O,
|
|
1148
1167
|
productReference: g
|
|
1149
1168
|
} = r, C = p.slice().reverse(), I = ne(l, t.isVariantOf), $ = re(I.offers[0].installments);
|
|
1150
1169
|
return {
|
|
1151
|
-
sku:
|
|
1170
|
+
sku: a,
|
|
1152
1171
|
gtin: ((v = n == null ? void 0 : n[0]) == null ? void 0 : v.Value) ?? g ?? "",
|
|
1153
|
-
name:
|
|
1172
|
+
name: T ?? i,
|
|
1154
1173
|
description: f,
|
|
1155
1174
|
releaseDate: r.releaseDate ?? "",
|
|
1156
1175
|
slug: m,
|
|
@@ -1161,21 +1180,21 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1161
1180
|
brand: { name: u, brandName: u },
|
|
1162
1181
|
seo: {
|
|
1163
1182
|
description: f,
|
|
1164
|
-
title:
|
|
1183
|
+
title: T,
|
|
1165
1184
|
canonical: te(m)
|
|
1166
1185
|
},
|
|
1167
1186
|
cluster: {
|
|
1168
1187
|
generals: R,
|
|
1169
1188
|
highlights: F
|
|
1170
1189
|
},
|
|
1171
|
-
properties:
|
|
1190
|
+
properties: E,
|
|
1172
1191
|
availability: { status: I.offers[0].availability },
|
|
1173
1192
|
breadcrumbList: {
|
|
1174
1193
|
itemListElement: [
|
|
1175
1194
|
...C.map((P, w) => {
|
|
1176
|
-
const q = P.split("/"),
|
|
1195
|
+
const q = P.split("/"), B = q[q.length - 2], ie = q.map(ee).join("/");
|
|
1177
1196
|
return {
|
|
1178
|
-
name:
|
|
1197
|
+
name: B,
|
|
1179
1198
|
item: ie,
|
|
1180
1199
|
position: w + 1
|
|
1181
1200
|
};
|
|
@@ -1190,21 +1209,21 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1190
1209
|
},
|
|
1191
1210
|
image: Z(s),
|
|
1192
1211
|
offers: I,
|
|
1193
|
-
additionalProperty:
|
|
1212
|
+
additionalProperty: L(d, e, []),
|
|
1194
1213
|
isVariantOf: {
|
|
1195
1214
|
productGroupID: r.productId,
|
|
1196
|
-
hasVariant: r.items.map((P) =>
|
|
1215
|
+
hasVariant: r.items.map((P) => oe(P))
|
|
1197
1216
|
},
|
|
1198
1217
|
installments: $
|
|
1199
1218
|
};
|
|
1200
|
-
},
|
|
1219
|
+
}, Mt = (t) => {
|
|
1201
1220
|
var $;
|
|
1202
1221
|
const {
|
|
1203
1222
|
attributes: e,
|
|
1204
1223
|
referenceId: n,
|
|
1205
1224
|
isVariantOf: r,
|
|
1206
1225
|
images: s,
|
|
1207
|
-
itemId:
|
|
1226
|
+
itemId: a,
|
|
1208
1227
|
name: i,
|
|
1209
1228
|
sellers: l,
|
|
1210
1229
|
Videos: c,
|
|
@@ -1217,12 +1236,12 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1217
1236
|
linkText: m,
|
|
1218
1237
|
productClusters: R,
|
|
1219
1238
|
productName: F,
|
|
1220
|
-
Coleção:
|
|
1221
|
-
"ID Coleção":
|
|
1239
|
+
Coleção: T,
|
|
1240
|
+
"ID Coleção": E,
|
|
1222
1241
|
productId: O
|
|
1223
1242
|
} = r, g = p.slice().reverse(), C = ne(l, t.isVariantOf), I = re(C.offers[0].installments);
|
|
1224
1243
|
return {
|
|
1225
|
-
sku:
|
|
1244
|
+
sku: a,
|
|
1226
1245
|
gtin: (($ = n[0]) == null ? void 0 : $.Value) ?? "",
|
|
1227
1246
|
name: F ?? i,
|
|
1228
1247
|
description: f,
|
|
@@ -1231,8 +1250,8 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1231
1250
|
video: c[0],
|
|
1232
1251
|
categories: p,
|
|
1233
1252
|
categoriesIds: h,
|
|
1234
|
-
collection:
|
|
1235
|
-
collectionId:
|
|
1253
|
+
collection: T,
|
|
1254
|
+
collectionId: E,
|
|
1236
1255
|
id: O,
|
|
1237
1256
|
brand: { name: u, brandName: u },
|
|
1238
1257
|
seo: {
|
|
@@ -1249,10 +1268,10 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1249
1268
|
breadcrumbList: {
|
|
1250
1269
|
itemListElement: [
|
|
1251
1270
|
...g.map((v, P) => {
|
|
1252
|
-
const w = v.split("/"), q = w[w.length - 2],
|
|
1271
|
+
const w = v.split("/"), q = w[w.length - 2], B = w.map(ee).join("/");
|
|
1253
1272
|
return {
|
|
1254
1273
|
name: q,
|
|
1255
|
-
item:
|
|
1274
|
+
item: B,
|
|
1256
1275
|
position: P + 1
|
|
1257
1276
|
};
|
|
1258
1277
|
}),
|
|
@@ -1266,7 +1285,7 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1266
1285
|
},
|
|
1267
1286
|
image: Z(s),
|
|
1268
1287
|
offers: C,
|
|
1269
|
-
additionalProperty:
|
|
1288
|
+
additionalProperty: L(d, e, []),
|
|
1270
1289
|
isVariantOf: {
|
|
1271
1290
|
productGroupID: r.productId,
|
|
1272
1291
|
hasVariant: r.items.map((v) => {
|
|
@@ -1275,8 +1294,8 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1275
1294
|
values: v[q]
|
|
1276
1295
|
}));
|
|
1277
1296
|
return {
|
|
1278
|
-
...
|
|
1279
|
-
additionalProperty:
|
|
1297
|
+
...oe(v),
|
|
1298
|
+
additionalProperty: L(
|
|
1280
1299
|
w,
|
|
1281
1300
|
e,
|
|
1282
1301
|
[]
|
|
@@ -1286,30 +1305,30 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1286
1305
|
},
|
|
1287
1306
|
installments: I
|
|
1288
1307
|
};
|
|
1289
|
-
},
|
|
1290
|
-
key:
|
|
1291
|
-
value:
|
|
1308
|
+
}, Ut = o.array().of(o.object({
|
|
1309
|
+
key: o.string().required(),
|
|
1310
|
+
value: o.string().required()
|
|
1292
1311
|
})).required("Facets are required");
|
|
1293
|
-
async function
|
|
1312
|
+
async function Vt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1294
1313
|
if (!e) {
|
|
1295
1314
|
console.error("[ERROR FETCHING] Body is required");
|
|
1296
1315
|
return;
|
|
1297
1316
|
}
|
|
1298
|
-
await
|
|
1317
|
+
await Ut.validate(e);
|
|
1299
1318
|
const r = new URLSearchParams({}), s = e.map(({ key: i, value: l }) => `${i}/${l}`).join("/");
|
|
1300
1319
|
le(e, r);
|
|
1301
|
-
const
|
|
1302
|
-
return b(
|
|
1320
|
+
const a = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
1321
|
+
return b(a, {
|
|
1303
1322
|
cache: "no-store",
|
|
1304
1323
|
...n
|
|
1305
1324
|
}).then((i) => i.map((c) => {
|
|
1306
1325
|
const d = X(c.items);
|
|
1307
1326
|
return d && Y(d, c);
|
|
1308
1327
|
}).filter((c) => !!c).map((c) => ({
|
|
1309
|
-
node:
|
|
1328
|
+
node: Mt(c)
|
|
1310
1329
|
})));
|
|
1311
1330
|
}
|
|
1312
|
-
const
|
|
1331
|
+
const ae = ({
|
|
1313
1332
|
apiUrl: t,
|
|
1314
1333
|
body: e,
|
|
1315
1334
|
fetchOptions: n,
|
|
@@ -1321,7 +1340,7 @@ const oe = ({
|
|
|
1321
1340
|
}
|
|
1322
1341
|
const {
|
|
1323
1342
|
query: s = "",
|
|
1324
|
-
page:
|
|
1343
|
+
page: a = 1,
|
|
1325
1344
|
count: i,
|
|
1326
1345
|
sort: l = "",
|
|
1327
1346
|
facets: c = [],
|
|
@@ -1329,7 +1348,7 @@ const oe = ({
|
|
|
1329
1348
|
hideUnavailableItems: u = !0,
|
|
1330
1349
|
locale: p = ""
|
|
1331
1350
|
} = e, h = new URLSearchParams({
|
|
1332
|
-
page:
|
|
1351
|
+
page: a.toString(),
|
|
1333
1352
|
count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
|
|
1334
1353
|
query: s,
|
|
1335
1354
|
sort: l,
|
|
@@ -1337,7 +1356,7 @@ const oe = ({
|
|
|
1337
1356
|
});
|
|
1338
1357
|
u !== void 0 && h.append("hideUnavailableItems", u.toString());
|
|
1339
1358
|
const f = c.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
|
|
1340
|
-
return
|
|
1359
|
+
return ke(
|
|
1341
1360
|
`${t}/api/io/_v/api/intelligent-search/${d}/${f}?${h.toString()}`,
|
|
1342
1361
|
{
|
|
1343
1362
|
headers: {
|
|
@@ -1348,12 +1367,12 @@ const oe = ({
|
|
|
1348
1367
|
}
|
|
1349
1368
|
);
|
|
1350
1369
|
};
|
|
1351
|
-
async function
|
|
1370
|
+
async function zt({ body: t, extraData: e, ...n }) {
|
|
1352
1371
|
if (!t) {
|
|
1353
1372
|
console.error("[ERROR FETCHING] Body is required");
|
|
1354
1373
|
return;
|
|
1355
1374
|
}
|
|
1356
|
-
const r = await
|
|
1375
|
+
const r = await ae({
|
|
1357
1376
|
body: {
|
|
1358
1377
|
...t,
|
|
1359
1378
|
type: "product_search"
|
|
@@ -1364,32 +1383,32 @@ async function Vt({ body: t, extraData: e, ...n }) {
|
|
|
1364
1383
|
const c = X(l.items);
|
|
1365
1384
|
return c && Y(c, l);
|
|
1366
1385
|
}).filter((l) => !!l)) ?? [], {
|
|
1367
|
-
pagination:
|
|
1386
|
+
pagination: a,
|
|
1368
1387
|
recordsFiltered: i
|
|
1369
1388
|
} = r;
|
|
1370
1389
|
return {
|
|
1371
1390
|
data: {
|
|
1372
1391
|
pagination: {
|
|
1373
|
-
nextPage:
|
|
1374
|
-
previousPage:
|
|
1392
|
+
nextPage: a.after.length > 0,
|
|
1393
|
+
previousPage: a.before.length > 0,
|
|
1375
1394
|
startCursor: "0",
|
|
1376
1395
|
endCursor: i.toString(),
|
|
1377
1396
|
count: i,
|
|
1378
|
-
total:
|
|
1397
|
+
total: a.count
|
|
1379
1398
|
},
|
|
1380
1399
|
products: s.map((l, c) => ({
|
|
1381
|
-
node:
|
|
1400
|
+
node: Gt(l),
|
|
1382
1401
|
cursor: c.toString()
|
|
1383
1402
|
}))
|
|
1384
1403
|
}
|
|
1385
1404
|
};
|
|
1386
1405
|
}
|
|
1387
|
-
async function
|
|
1406
|
+
async function xt({ body: t, extraData: e, ...n }) {
|
|
1388
1407
|
if (!t) {
|
|
1389
1408
|
console.error("[ERROR FETCHING] Body is required");
|
|
1390
1409
|
return;
|
|
1391
1410
|
}
|
|
1392
|
-
const r = await
|
|
1411
|
+
const r = await ae({
|
|
1393
1412
|
body: {
|
|
1394
1413
|
...t,
|
|
1395
1414
|
type: "facets"
|
|
@@ -1404,40 +1423,40 @@ async function zt({ body: t, extraData: e, ...n }) {
|
|
|
1404
1423
|
}
|
|
1405
1424
|
};
|
|
1406
1425
|
}
|
|
1407
|
-
const
|
|
1408
|
-
query:
|
|
1409
|
-
locale:
|
|
1426
|
+
const Qt = o.object({
|
|
1427
|
+
query: o.string().optional(),
|
|
1428
|
+
locale: o.string().optional()
|
|
1410
1429
|
});
|
|
1411
|
-
async function
|
|
1430
|
+
async function Kt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1412
1431
|
if (!e) {
|
|
1413
1432
|
console.error("[ERROR FETCHING] Body is required");
|
|
1414
1433
|
return;
|
|
1415
1434
|
}
|
|
1416
|
-
await
|
|
1417
|
-
const { query: r = "", locale: s = "default_locale" } = e,
|
|
1435
|
+
await Qt.validate(e);
|
|
1436
|
+
const { query: r = "", locale: s = "default_locale" } = e, a = new URLSearchParams({ query: r, locale: s });
|
|
1418
1437
|
return b(
|
|
1419
|
-
`${t}/api/io/_v/api/intelligent-search/search_suggestions?${
|
|
1438
|
+
`${t}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
|
|
1420
1439
|
{
|
|
1421
1440
|
...n
|
|
1422
1441
|
}
|
|
1423
1442
|
);
|
|
1424
1443
|
}
|
|
1425
|
-
async function
|
|
1444
|
+
async function Jt({ apiUrl: t }) {
|
|
1426
1445
|
return b(`${t}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1427
1446
|
}
|
|
1428
|
-
const
|
|
1447
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1429
1448
|
__proto__: null,
|
|
1430
|
-
getSearchAutoCompleteSuggestions:
|
|
1431
|
-
getSearchCrossellingProducts:
|
|
1432
|
-
getSearchFacets:
|
|
1433
|
-
getSearchProducts:
|
|
1434
|
-
getSearchSuggestedTerms:
|
|
1435
|
-
getSearchTopSearchs:
|
|
1436
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1437
|
-
masterDataEntity:
|
|
1438
|
-
payload:
|
|
1449
|
+
getSearchAutoCompleteSuggestions: qt,
|
|
1450
|
+
getSearchCrossellingProducts: Vt,
|
|
1451
|
+
getSearchFacets: xt,
|
|
1452
|
+
getSearchProducts: zt,
|
|
1453
|
+
getSearchSuggestedTerms: Kt,
|
|
1454
|
+
getSearchTopSearchs: Jt
|
|
1455
|
+
}, Symbol.toStringTag, { value: "Module" })), Wt = o.object({
|
|
1456
|
+
masterDataEntity: o.string().nonNullable(),
|
|
1457
|
+
payload: o.object().shape({}).nullable()
|
|
1439
1458
|
});
|
|
1440
|
-
async function
|
|
1459
|
+
async function Xt({
|
|
1441
1460
|
apiUrl: t,
|
|
1442
1461
|
body: e,
|
|
1443
1462
|
fetchOptions: n
|
|
@@ -1446,9 +1465,9 @@ async function Wt({
|
|
|
1446
1465
|
console.error("[ERROR FETCHING] Body is required");
|
|
1447
1466
|
return;
|
|
1448
1467
|
}
|
|
1449
|
-
await
|
|
1450
|
-
const { masterDataEntity: r, payload: s } = e,
|
|
1451
|
-
return b(
|
|
1468
|
+
await Wt.validate(e);
|
|
1469
|
+
const { masterDataEntity: r, payload: s } = e, a = `${t}/api/dataentities/${r}/documents`;
|
|
1470
|
+
return b(a, {
|
|
1452
1471
|
method: "POST",
|
|
1453
1472
|
body: {
|
|
1454
1473
|
payload: s
|
|
@@ -1456,21 +1475,21 @@ async function Wt({
|
|
|
1456
1475
|
...n
|
|
1457
1476
|
});
|
|
1458
1477
|
}
|
|
1459
|
-
const
|
|
1460
|
-
_where:
|
|
1461
|
-
_fields:
|
|
1462
|
-
_sort:
|
|
1463
|
-
_from:
|
|
1464
|
-
_to:
|
|
1465
|
-
_keyword:
|
|
1466
|
-
}),
|
|
1467
|
-
masterDataEntity:
|
|
1468
|
-
searchFields:
|
|
1469
|
-
headers:
|
|
1470
|
-
"REST-Range":
|
|
1478
|
+
const Zt = o.object().shape({
|
|
1479
|
+
_where: o.string().optional(),
|
|
1480
|
+
_fields: o.string().optional(),
|
|
1481
|
+
_sort: o.string().optional(),
|
|
1482
|
+
_from: o.number().integer().min(0).optional(),
|
|
1483
|
+
_to: o.number().integer().min(0).optional(),
|
|
1484
|
+
_keyword: o.string().optional()
|
|
1485
|
+
}), er = o.object({
|
|
1486
|
+
masterDataEntity: o.string().required(),
|
|
1487
|
+
searchFields: Zt,
|
|
1488
|
+
headers: o.object().shape({
|
|
1489
|
+
"REST-Range": o.string().notRequired()
|
|
1471
1490
|
})
|
|
1472
1491
|
});
|
|
1473
|
-
async function
|
|
1492
|
+
async function tr({
|
|
1474
1493
|
apiUrl: t,
|
|
1475
1494
|
body: e,
|
|
1476
1495
|
fetchOptions: n
|
|
@@ -1480,11 +1499,11 @@ async function er({
|
|
|
1480
1499
|
return;
|
|
1481
1500
|
}
|
|
1482
1501
|
const r = new URLSearchParams();
|
|
1483
|
-
await
|
|
1484
|
-
const { masterDataEntity: s, searchFields:
|
|
1485
|
-
|
|
1502
|
+
await er.validate(e);
|
|
1503
|
+
const { masterDataEntity: s, searchFields: a, headers: i } = e;
|
|
1504
|
+
a && Object.entries(a).forEach(([c, d]) => {
|
|
1486
1505
|
r.append(c, String(d));
|
|
1487
|
-
}), "_fields" in
|
|
1506
|
+
}), "_fields" in a || r == null || r.append("_fields", "_all");
|
|
1488
1507
|
const l = `${t}/api/dataentities/${s}/search?${r.toString()}`;
|
|
1489
1508
|
return b(l, {
|
|
1490
1509
|
headers: {
|
|
@@ -1494,12 +1513,12 @@ async function er({
|
|
|
1494
1513
|
...n
|
|
1495
1514
|
});
|
|
1496
1515
|
}
|
|
1497
|
-
const
|
|
1498
|
-
dataEntityName:
|
|
1499
|
-
id:
|
|
1500
|
-
fieldsToBeUpdated:
|
|
1516
|
+
const rr = o.object({
|
|
1517
|
+
dataEntityName: o.string().required(),
|
|
1518
|
+
id: o.string().required(),
|
|
1519
|
+
fieldsToBeUpdated: o.object().shape({})
|
|
1501
1520
|
});
|
|
1502
|
-
async function
|
|
1521
|
+
async function nr({
|
|
1503
1522
|
apiUrl: t,
|
|
1504
1523
|
body: e,
|
|
1505
1524
|
fetchOptions: n
|
|
@@ -1508,28 +1527,28 @@ async function rr({
|
|
|
1508
1527
|
console.error("[ERROR FETCHING] Body is required");
|
|
1509
1528
|
return;
|
|
1510
1529
|
}
|
|
1511
|
-
await
|
|
1512
|
-
const { dataEntityName: r, id: s, fieldsToBeUpdated:
|
|
1530
|
+
await rr.validate(e);
|
|
1531
|
+
const { dataEntityName: r, id: s, fieldsToBeUpdated: a } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
|
|
1513
1532
|
return b(i, {
|
|
1514
1533
|
body: {
|
|
1515
|
-
fieldsToBeUpdated:
|
|
1534
|
+
fieldsToBeUpdated: a
|
|
1516
1535
|
},
|
|
1517
1536
|
method: "PATCH",
|
|
1518
1537
|
...n
|
|
1519
1538
|
});
|
|
1520
1539
|
}
|
|
1521
|
-
const
|
|
1540
|
+
const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1522
1541
|
__proto__: null,
|
|
1523
|
-
getSearchMasterdata:
|
|
1524
|
-
patchUpdateMasterdata:
|
|
1525
|
-
postMasterdata:
|
|
1542
|
+
getSearchMasterdata: tr,
|
|
1543
|
+
patchUpdateMasterdata: nr,
|
|
1544
|
+
postMasterdata: Xt
|
|
1526
1545
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1527
1546
|
async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
1528
1547
|
const { productIds: s } = t;
|
|
1529
1548
|
if (!s)
|
|
1530
1549
|
return console.error("[ERROR FETCHING] productIds is required"), [];
|
|
1531
|
-
const { NAME_SPLIT_SYMBOL:
|
|
1532
|
-
if (!
|
|
1550
|
+
const { NAME_SPLIT_SYMBOL: a } = n;
|
|
1551
|
+
if (!a)
|
|
1533
1552
|
return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
|
|
1534
1553
|
const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), l = await b(
|
|
1535
1554
|
`${e}/api/catalog_system/pub/products/search?fq=${i}`,
|
|
@@ -1539,7 +1558,7 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1539
1558
|
), c = (u) => Object.keys(u).map((p) => ({ id: p, name: u[p] }));
|
|
1540
1559
|
return l.map((u, p) => {
|
|
1541
1560
|
var O;
|
|
1542
|
-
const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable: F } = de({ items: u.items, NAME_SPLIT_SYMBOL:
|
|
1561
|
+
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
1562
|
return {
|
|
1544
1563
|
node: {
|
|
1545
1564
|
sku: u.items[0].itemId,
|
|
@@ -1565,7 +1584,7 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1565
1584
|
highlights: c(u.clusterHighlights)
|
|
1566
1585
|
},
|
|
1567
1586
|
availability: {
|
|
1568
|
-
status:
|
|
1587
|
+
status: T
|
|
1569
1588
|
},
|
|
1570
1589
|
image: u.items[0].images.map(
|
|
1571
1590
|
({
|
|
@@ -1582,14 +1601,14 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1582
1601
|
highPrice: m,
|
|
1583
1602
|
offers: [
|
|
1584
1603
|
{
|
|
1585
|
-
availability:
|
|
1604
|
+
availability: T,
|
|
1586
1605
|
listPrice: m,
|
|
1587
1606
|
price: f,
|
|
1588
|
-
priceValidUntil:
|
|
1607
|
+
priceValidUntil: E.PriceValidUntil,
|
|
1589
1608
|
priceCurrency: "BRL",
|
|
1590
|
-
installments:
|
|
1609
|
+
installments: E.Installments,
|
|
1591
1610
|
lowPrice: f,
|
|
1592
|
-
quantity:
|
|
1611
|
+
quantity: E.AvailableQuantity,
|
|
1593
1612
|
seller: {
|
|
1594
1613
|
identifier: u.items[0].sellers[0].sellerId
|
|
1595
1614
|
}
|
|
@@ -1639,21 +1658,21 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1639
1658
|
};
|
|
1640
1659
|
});
|
|
1641
1660
|
}
|
|
1642
|
-
const
|
|
1661
|
+
const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1643
1662
|
__proto__: null,
|
|
1644
1663
|
getWishlistProducts: ar
|
|
1645
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1664
|
+
}, 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
1665
|
const r = Array.isArray(n) ? n.join(", ") : n;
|
|
1647
1666
|
return {
|
|
1648
1667
|
id: 0,
|
|
1649
|
-
Title: `${Array.isArray(n) ? n.map((
|
|
1668
|
+
Title: `${Array.isArray(n) ? n.map((a) => z(a)).join(",") : z(n)} - ${e.title}`,
|
|
1650
1669
|
MetaTagDescription: e.description,
|
|
1651
1670
|
name: r,
|
|
1652
1671
|
hasChildren: !1,
|
|
1653
1672
|
url: t,
|
|
1654
1673
|
children: []
|
|
1655
1674
|
};
|
|
1656
|
-
},
|
|
1675
|
+
}, lr = ({ canonical: t, category: e, previousImages: n, seo: r }) => ({
|
|
1657
1676
|
category: String(e == null ? void 0 : e.id),
|
|
1658
1677
|
title: (e == null ? void 0 : e.Title) ?? r.title,
|
|
1659
1678
|
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
@@ -1664,23 +1683,23 @@ const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1664
1683
|
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
1665
1684
|
images: Array.isArray(n) ? [...n] : []
|
|
1666
1685
|
}
|
|
1667
|
-
}),
|
|
1686
|
+
}), ur = ({ items: t, parent: e, apiUrl: n, find: r }) => {
|
|
1668
1687
|
const s = t.find(
|
|
1669
1688
|
(i) => i.url.replace(n, "") === decodeURIComponent(e.toLowerCase())
|
|
1670
1689
|
);
|
|
1671
1690
|
return (s == null ? void 0 : s.children.find(
|
|
1672
1691
|
(i) => i.name.toLowerCase() === decodeURIComponent(String(r))
|
|
1673
1692
|
)) ?? s;
|
|
1674
|
-
},
|
|
1693
|
+
}, dr = (t) => {
|
|
1675
1694
|
t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
|
|
1676
|
-
},
|
|
1695
|
+
}, pr = /* @__PURE__ */ new Set([
|
|
1677
1696
|
"brand",
|
|
1678
1697
|
"category",
|
|
1679
1698
|
"department",
|
|
1680
1699
|
"subcategory",
|
|
1681
1700
|
"collection",
|
|
1682
1701
|
"cluster"
|
|
1683
|
-
]),
|
|
1702
|
+
]), mr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && pr.has(t == null ? void 0 : t.pageType.toLowerCase()), fr = (t) => ({
|
|
1684
1703
|
collection: t.Coleção,
|
|
1685
1704
|
categoryId: t.categoryId,
|
|
1686
1705
|
current_collection: t["Coleção Atual"],
|
|
@@ -1690,61 +1709,61 @@ const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1690
1709
|
(i) => i.sellers.find((l) => l.commertialOffer.IsAvailable)
|
|
1691
1710
|
).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
|
|
1692
1711
|
return n;
|
|
1693
|
-
const
|
|
1712
|
+
const a = r.items[0].images.find(
|
|
1694
1713
|
(i) => e.includes(i.imageLabel)
|
|
1695
1714
|
);
|
|
1696
1715
|
return n.push({
|
|
1697
1716
|
slug: `/${r.linkText}/p`,
|
|
1698
1717
|
productId: r == null ? void 0 : r.productId,
|
|
1699
|
-
textureImage: (
|
|
1700
|
-
textureAlt: (
|
|
1718
|
+
textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
|
|
1719
|
+
textureAlt: (a == null ? void 0 : a.imageText) ?? ""
|
|
1701
1720
|
}), n;
|
|
1702
|
-
}, []),
|
|
1721
|
+
}, []), gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1703
1722
|
__proto__: null,
|
|
1704
|
-
createEmptySeoCategory:
|
|
1705
|
-
createSeoCategory:
|
|
1706
|
-
findCategory:
|
|
1723
|
+
createEmptySeoCategory: cr,
|
|
1724
|
+
createSeoCategory: lr,
|
|
1725
|
+
findCategory: ur,
|
|
1707
1726
|
formattedSimilars: se,
|
|
1708
|
-
isCollectionPageType:
|
|
1709
|
-
notFindCategoryError:
|
|
1710
|
-
responseAdapter:
|
|
1711
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1727
|
+
isCollectionPageType: mr,
|
|
1728
|
+
notFindCategoryError: dr,
|
|
1729
|
+
responseAdapter: fr
|
|
1730
|
+
}, Symbol.toStringTag, { value: "Module" })), hr = {
|
|
1712
1731
|
parseSearchState: ge,
|
|
1713
1732
|
convertSearchParams: fe,
|
|
1714
1733
|
filterNonRootFacets: me,
|
|
1715
1734
|
filterNonCategorySelected: pe
|
|
1716
|
-
},
|
|
1735
|
+
}, br = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: a, TOGGLE_STYLE_MODIFIER: i }) => {
|
|
1717
1736
|
const l = await fetch(
|
|
1718
1737
|
`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
|
|
1719
|
-
).then((d) => d.json()), c = se(l,
|
|
1720
|
-
return /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1738
|
+
).then((d) => d.json()), c = se(l, a);
|
|
1739
|
+
return /* @__PURE__ */ k("div", { className: G.similars, children: [
|
|
1740
|
+
/* @__PURE__ */ k("div", { className: G["similars-info"], children: [
|
|
1722
1741
|
/* @__PURE__ */ y("span", { className: G["sections-title"], children: s.product.color_title }),
|
|
1723
1742
|
t
|
|
1724
1743
|
] }),
|
|
1725
1744
|
/* @__PURE__ */ y(r, { productId: n, similars: c, TOGGLE_STYLE_MODIFIER: i })
|
|
1726
1745
|
] });
|
|
1727
|
-
},
|
|
1728
|
-
checkout:
|
|
1729
|
-
catalog:
|
|
1746
|
+
}, Sr = {
|
|
1747
|
+
checkout: Rt,
|
|
1748
|
+
catalog: Ot,
|
|
1730
1749
|
cms: he,
|
|
1731
|
-
search:
|
|
1732
|
-
masterdata:
|
|
1750
|
+
search: Yt,
|
|
1751
|
+
masterdata: or,
|
|
1733
1752
|
wishlist: {
|
|
1734
|
-
...
|
|
1753
|
+
...sr
|
|
1735
1754
|
}
|
|
1736
|
-
}, Sr = {
|
|
1737
|
-
catalog: fr,
|
|
1738
|
-
search: gr,
|
|
1739
|
-
product: be
|
|
1740
1755
|
}, Tr = {
|
|
1756
|
+
catalog: gr,
|
|
1757
|
+
search: hr,
|
|
1758
|
+
product: be
|
|
1759
|
+
}, Er = {
|
|
1741
1760
|
template: {
|
|
1742
|
-
pdp: { PDPSimilars:
|
|
1761
|
+
pdp: { PDPSimilars: br }
|
|
1743
1762
|
}
|
|
1744
1763
|
};
|
|
1745
1764
|
export {
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1765
|
+
Sr as serverAPIs,
|
|
1766
|
+
vr as serverCMS,
|
|
1767
|
+
Er as serverComponents,
|
|
1768
|
+
Tr as serverHelpers
|
|
1750
1769
|
};
|