@soma-vertical-web/multi-lib 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contexts/contexts/plp/FilterContext.d.ts +1 -1
- package/contexts/contexts/plp/PLPContext.d.ts +1 -1
- package/contexts/contexts/search/Facets.d.ts +1 -1
- package/contexts/contexts/search/QueryFacets.d.ts +5 -0
- package/contexts/contexts/search/QueryProducts.d.ts +5 -0
- package/contexts/contexts/search/RootTank.d.ts +9 -0
- package/contexts/contexts/search/Search.d.ts +1 -1
- package/contexts/index.d.ts +4 -4
- package/data/helpers/plp/index.d.ts +2 -2
- package/data/helpers/search/facets.d.ts +1 -0
- package/data/helpers/search/index.d.ts +4 -0
- package/data/helpers/search/search.d.ts +1 -0
- package/data/index.d.ts +2 -0
- package/index-BlwJMBFA.mjs +1890 -0
- package/index-dtcYsqh-.js +4 -0
- package/index.js +17 -17
- package/index.mjs +10322 -8216
- package/index2.js +1 -1
- package/index2.mjs +222 -227
- package/layout/index.d.ts +2 -2
- package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
- package/layout/template/PDC/PDC.d.ts +1 -1
- package/layout/template/PDC/index.d.ts +1 -1
- package/layout/template/SearchResult/Composite/Products.d.ts +7 -0
- package/package.json +1 -1
- package/server.d.ts +4 -0
- package/style.css +1 -1
- package/types/contexts/contexts/plp.d.ts +42 -8
- package/types/contexts/contexts/search.d.ts +28 -16
- package/types/layout/team-components/PLPNavigation/index.d.ts +0 -2
- package/types/layout/templates/PLP/index.d.ts +2 -2
package/index2.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as b, jsxs as N, Fragment as B } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { z as S, r as j, S as ce, A as le, B as ue, a as de, q as M, C as me, D as pe, E as fe, p as ge, F as he } from "./index-BlwJMBFA.mjs";
|
|
3
3
|
import { Utils as D, helpers as _ } from "@soma-vertical-web/core-components";
|
|
4
4
|
import * as a from "yup";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import ye from "sanitize-html";
|
|
6
|
+
const be = async ({
|
|
7
7
|
children: t,
|
|
8
8
|
ClientCartProvider: e,
|
|
9
9
|
...n
|
|
@@ -13,7 +13,7 @@ const Re = async ({
|
|
|
13
13
|
n
|
|
14
14
|
);
|
|
15
15
|
return /* @__PURE__ */ b(e, { ...r ? Array.isArray(r) ? { data: r[0] } : { data: r } : {}, children: t });
|
|
16
|
-
},
|
|
16
|
+
}, Ie = ({
|
|
17
17
|
slug: t,
|
|
18
18
|
data: e,
|
|
19
19
|
SectionZone: n,
|
|
@@ -55,7 +55,7 @@ const Re = async ({
|
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
] });
|
|
58
|
-
},
|
|
58
|
+
}, Ce = async ({
|
|
59
59
|
slug: t,
|
|
60
60
|
SectionZone: e,
|
|
61
61
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
@@ -67,7 +67,7 @@ const Re = async ({
|
|
|
67
67
|
s
|
|
68
68
|
);
|
|
69
69
|
return !o || !Array.isArray(o) || o.length === 0 ? null : /* @__PURE__ */ b(
|
|
70
|
-
|
|
70
|
+
Ie,
|
|
71
71
|
{
|
|
72
72
|
data: o,
|
|
73
73
|
slug: t,
|
|
@@ -76,7 +76,7 @@ const Re = async ({
|
|
|
76
76
|
identifyWhoIsFirst: r
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
},
|
|
79
|
+
}, Re = async ({
|
|
80
80
|
children: t,
|
|
81
81
|
ClientFlagsAndTagsProvider: e,
|
|
82
82
|
...n
|
|
@@ -86,7 +86,7 @@ const Re = async ({
|
|
|
86
86
|
n
|
|
87
87
|
);
|
|
88
88
|
return !r || !Array.isArray(r) ? null : /* @__PURE__ */ b(e, { data: r[0], children: t });
|
|
89
|
-
},
|
|
89
|
+
}, ve = async ({
|
|
90
90
|
className: t,
|
|
91
91
|
PAYMENT_FLAGS_DICTIONARY: e,
|
|
92
92
|
PAYMENT_FLAGS: n,
|
|
@@ -136,7 +136,7 @@ const Re = async ({
|
|
|
136
136
|
ICONS: s
|
|
137
137
|
}
|
|
138
138
|
) : null;
|
|
139
|
-
},
|
|
139
|
+
}, Se = async ({
|
|
140
140
|
children: t,
|
|
141
141
|
ClientHeaderProvider: e,
|
|
142
142
|
...n
|
|
@@ -158,7 +158,7 @@ const Re = async ({
|
|
|
158
158
|
children: t
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
|
-
},
|
|
161
|
+
}, Ee = (t) => {
|
|
162
162
|
var i, l;
|
|
163
163
|
const e = (l = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : l.items;
|
|
164
164
|
if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
|
|
@@ -187,7 +187,7 @@ const Re = async ({
|
|
|
187
187
|
helpButtonSize: s,
|
|
188
188
|
content: o
|
|
189
189
|
};
|
|
190
|
-
},
|
|
190
|
+
}, Te = async ({
|
|
191
191
|
HelpButton: t,
|
|
192
192
|
ICONS: e,
|
|
193
193
|
className: n,
|
|
@@ -199,7 +199,7 @@ const Re = async ({
|
|
|
199
199
|
);
|
|
200
200
|
if (!s || !Array.isArray(s) || s.length === 0)
|
|
201
201
|
return null;
|
|
202
|
-
const o =
|
|
202
|
+
const o = Ee(s);
|
|
203
203
|
return /* @__PURE__ */ b(
|
|
204
204
|
t,
|
|
205
205
|
{
|
|
@@ -208,7 +208,7 @@ const Re = async ({
|
|
|
208
208
|
className: n
|
|
209
209
|
}
|
|
210
210
|
);
|
|
211
|
-
},
|
|
211
|
+
}, Fe = async ({
|
|
212
212
|
SectionZone: t,
|
|
213
213
|
LPCadastro: e,
|
|
214
214
|
...n
|
|
@@ -225,7 +225,7 @@ const Re = async ({
|
|
|
225
225
|
/* @__PURE__ */ b(e, { sections: o, content: i }),
|
|
226
226
|
/* @__PURE__ */ b(t, { data: l })
|
|
227
227
|
] });
|
|
228
|
-
},
|
|
228
|
+
}, Oe = async ({
|
|
229
229
|
LPLOJAS_TEMPLATE_RETURN_BUTTON: t,
|
|
230
230
|
ICONS: e,
|
|
231
231
|
entity: n,
|
|
@@ -246,7 +246,7 @@ const Re = async ({
|
|
|
246
246
|
LPLOJAS_TEMPLATE_RETURN_BUTTON: t
|
|
247
247
|
}
|
|
248
248
|
);
|
|
249
|
-
},
|
|
249
|
+
}, $e = async ({
|
|
250
250
|
children: t,
|
|
251
251
|
productId: e,
|
|
252
252
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
@@ -268,9 +268,9 @@ const Re = async ({
|
|
|
268
268
|
children: t
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
|
-
},
|
|
271
|
+
}, qe = {
|
|
272
272
|
"column-modifier": "_column-modifier_1tqap_1"
|
|
273
|
-
},
|
|
273
|
+
}, Ae = async ({
|
|
274
274
|
className: t,
|
|
275
275
|
children: e,
|
|
276
276
|
slug: n,
|
|
@@ -312,7 +312,7 @@ const Re = async ({
|
|
|
312
312
|
{
|
|
313
313
|
className: _.classNameConcat(
|
|
314
314
|
j["responsive-desktop-flex"],
|
|
315
|
-
[
|
|
315
|
+
[qe["column-modifier"], ...C]
|
|
316
316
|
),
|
|
317
317
|
style: {
|
|
318
318
|
minHeight: "100vh"
|
|
@@ -340,7 +340,7 @@ const Re = async ({
|
|
|
340
340
|
}
|
|
341
341
|
) })
|
|
342
342
|
] });
|
|
343
|
-
},
|
|
343
|
+
}, Pe = async ({ slug: t, ...e }) => {
|
|
344
344
|
var i, l, c;
|
|
345
345
|
const { data: n } = await S(
|
|
346
346
|
"redirect_to_search",
|
|
@@ -380,7 +380,7 @@ const Re = async ({
|
|
|
380
380
|
filters: null,
|
|
381
381
|
sort: null
|
|
382
382
|
};
|
|
383
|
-
},
|
|
383
|
+
}, we = async ({ slug: t, ...e }) => {
|
|
384
384
|
var i, l, c;
|
|
385
385
|
const { data: n } = await S(
|
|
386
386
|
"redirect_to_search",
|
|
@@ -402,7 +402,7 @@ const Re = async ({
|
|
|
402
402
|
title: o.pageTitle,
|
|
403
403
|
description: o.pageDescription
|
|
404
404
|
} : null;
|
|
405
|
-
},
|
|
405
|
+
}, Ne = async ({
|
|
406
406
|
children: t,
|
|
407
407
|
SectionZone: e,
|
|
408
408
|
className: n,
|
|
@@ -421,7 +421,7 @@ const Re = async ({
|
|
|
421
421
|
children: t
|
|
422
422
|
}
|
|
423
423
|
) : /* @__PURE__ */ b(B, { children: "children" });
|
|
424
|
-
},
|
|
424
|
+
}, ke = async ({
|
|
425
425
|
ClientTipbarContent: t,
|
|
426
426
|
...e
|
|
427
427
|
}) => {
|
|
@@ -430,22 +430,22 @@ const Re = async ({
|
|
|
430
430
|
e
|
|
431
431
|
);
|
|
432
432
|
return /* @__PURE__ */ b(t, { data: n });
|
|
433
|
-
},
|
|
434
|
-
CommonPageContent:
|
|
435
|
-
CartContent:
|
|
436
|
-
FlagsAndTagsContent:
|
|
437
|
-
HeaderContent:
|
|
438
|
-
TipbarContent:
|
|
439
|
-
FooterContent:
|
|
440
|
-
PLPContent:
|
|
441
|
-
PDPContent:
|
|
442
|
-
getRedirectData:
|
|
443
|
-
getPLPSynteticMetaData:
|
|
444
|
-
SearchPageContent:
|
|
445
|
-
HelpButtonContent:
|
|
446
|
-
LPCadastroContent:
|
|
447
|
-
LPLojasContent:
|
|
448
|
-
},
|
|
433
|
+
}, je = {
|
|
434
|
+
CommonPageContent: Ce,
|
|
435
|
+
CartContent: be,
|
|
436
|
+
FlagsAndTagsContent: Re,
|
|
437
|
+
HeaderContent: Se,
|
|
438
|
+
TipbarContent: ke,
|
|
439
|
+
FooterContent: ve,
|
|
440
|
+
PLPContent: Ae,
|
|
441
|
+
PDPContent: $e,
|
|
442
|
+
getRedirectData: Pe,
|
|
443
|
+
getPLPSynteticMetaData: we,
|
|
444
|
+
SearchPageContent: Ne,
|
|
445
|
+
HelpButtonContent: Te,
|
|
446
|
+
LPCadastroContent: Fe,
|
|
447
|
+
LPLojasContent: Oe
|
|
448
|
+
}, Sr = { Components: je }, h = async (t, e = {}) => {
|
|
449
449
|
const { method: n = "GET", body: r, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
|
|
450
450
|
return fetch(t, {
|
|
451
451
|
method: n,
|
|
@@ -462,7 +462,7 @@ const Re = async ({
|
|
|
462
462
|
console.error("[ERROR FETCH VTEX]", l);
|
|
463
463
|
});
|
|
464
464
|
}, w = /* @__PURE__ */ new Map();
|
|
465
|
-
async function
|
|
465
|
+
async function De(t, e = {}) {
|
|
466
466
|
var n;
|
|
467
467
|
try {
|
|
468
468
|
const { abort: r = !1 } = e, s = new AbortController();
|
|
@@ -480,16 +480,16 @@ async function Le(t, e = {}) {
|
|
|
480
480
|
throw console.error(`[ERROR API]: ${r.message}`), r;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
const
|
|
483
|
+
const _e = a.object({
|
|
484
484
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
485
485
|
postalCode: a.string().nullable()
|
|
486
486
|
});
|
|
487
|
-
async function
|
|
487
|
+
async function He({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
488
488
|
if (!e) {
|
|
489
489
|
console.error("[ERROR FETCHING] Body is required");
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
|
-
await
|
|
492
|
+
await _e.validate(e);
|
|
493
493
|
const { country: r, postalCode: s } = e;
|
|
494
494
|
return await h(
|
|
495
495
|
`${t}/api/checkout/pub/postal-code/${r}/${s}`,
|
|
@@ -500,7 +500,7 @@ async function Ge({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
500
500
|
}
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
|
-
const
|
|
503
|
+
const Le = a.object({
|
|
504
504
|
orderFormId: a.string().nullable(),
|
|
505
505
|
sellerCode: a.string().nullable(),
|
|
506
506
|
sellerName: a.string().nullable()
|
|
@@ -514,7 +514,7 @@ async function K({
|
|
|
514
514
|
console.error("[ERROR FETCHING] Body is required");
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
|
-
await
|
|
517
|
+
await Le.validate(e);
|
|
518
518
|
const { orderFormId: r, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
|
|
519
519
|
return h(
|
|
520
520
|
`${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
|
|
@@ -527,7 +527,7 @@ async function K({
|
|
|
527
527
|
}
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const Be = a.object({
|
|
531
531
|
orderFormId: a.string().nullable(),
|
|
532
532
|
sellerCode: a.string().nullable(),
|
|
533
533
|
marketingData: a.object()
|
|
@@ -542,7 +542,7 @@ async function J({
|
|
|
542
542
|
console.error("[ERROR FETCHING] Body is required");
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
545
|
-
await
|
|
545
|
+
await Be.validate(e);
|
|
546
546
|
const { orderFormId: s, sellerCode: o, marketingData: i } = e, l = o ? {
|
|
547
547
|
utmCampaign: o ? o.toUpperCase() : "",
|
|
548
548
|
utmiCampaign: o ? `${n.VENDOR_CODE}` : "semcodigo"
|
|
@@ -559,17 +559,17 @@ async function J({
|
|
|
559
559
|
}
|
|
560
560
|
);
|
|
561
561
|
}
|
|
562
|
-
const
|
|
562
|
+
const Ge = a.object({
|
|
563
563
|
orderFormId: a.string().nullable(),
|
|
564
564
|
sellerCode: a.string().nullable(),
|
|
565
565
|
sellerName: a.string().nullable()
|
|
566
566
|
});
|
|
567
|
-
async function
|
|
567
|
+
async function Me({ apiUrl: t, body: e, fetchOptions: n, extraData: r }) {
|
|
568
568
|
if (!e) {
|
|
569
569
|
console.error("[ERROR FETCHING] Body is required");
|
|
570
570
|
return;
|
|
571
571
|
}
|
|
572
|
-
await
|
|
572
|
+
await Ge.validate(e);
|
|
573
573
|
const s = await K({ apiUrl: t, body: e, fetchOptions: n });
|
|
574
574
|
return J({
|
|
575
575
|
apiUrl: t,
|
|
@@ -581,11 +581,11 @@ async function ze({ apiUrl: t, body: e, fetchOptions: n, extraData: r }) {
|
|
|
581
581
|
fetchOptions: n
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
|
-
const
|
|
584
|
+
const Ue = a.object({
|
|
585
585
|
orderFormId: a.string().nullable(),
|
|
586
586
|
coupon: a.string().nullable()
|
|
587
587
|
});
|
|
588
|
-
async function
|
|
588
|
+
async function Ve({
|
|
589
589
|
apiUrl: t,
|
|
590
590
|
body: e,
|
|
591
591
|
fetchOptions: n
|
|
@@ -594,7 +594,7 @@ async function Qe({
|
|
|
594
594
|
console.error("[ERROR FETCHING] Body is required");
|
|
595
595
|
return;
|
|
596
596
|
}
|
|
597
|
-
await
|
|
597
|
+
await Ue.validate(e);
|
|
598
598
|
const { coupon: r = "", orderFormId: s } = e;
|
|
599
599
|
return h(
|
|
600
600
|
`${t}/api/checkout/pub/orderForm/${s}/coupons`,
|
|
@@ -605,12 +605,12 @@ async function Qe({
|
|
|
605
605
|
}
|
|
606
606
|
);
|
|
607
607
|
}
|
|
608
|
-
const
|
|
608
|
+
const ze = a.object({
|
|
609
609
|
appId: a.string().required("App ID is required"),
|
|
610
610
|
orderFormId: a.string().nullable(),
|
|
611
611
|
key: a.array().of(a.string())
|
|
612
612
|
});
|
|
613
|
-
async function
|
|
613
|
+
async function xe({
|
|
614
614
|
apiUrl: t,
|
|
615
615
|
body: e,
|
|
616
616
|
fetchOptions: n
|
|
@@ -619,7 +619,7 @@ async function Je({
|
|
|
619
619
|
console.error("[ERROR FETCHING] Body is required");
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
|
-
await
|
|
622
|
+
await ze.validate(e);
|
|
623
623
|
const { appId: r = "faststore", orderFormId: s, key: o } = e;
|
|
624
624
|
return h(
|
|
625
625
|
`${t}/api/checkout/pub/orderForm/${s}/customData/${r}/${o}`,
|
|
@@ -629,23 +629,23 @@ async function Je({
|
|
|
629
629
|
}
|
|
630
630
|
);
|
|
631
631
|
}
|
|
632
|
-
const
|
|
632
|
+
const Qe = a.object().shape({
|
|
633
633
|
name: a.string().required("Attachment name is required"),
|
|
634
634
|
content: a.object().nullable()
|
|
635
635
|
});
|
|
636
636
|
var x;
|
|
637
|
-
const
|
|
638
|
-
attachments: (x = a.array().of(
|
|
637
|
+
const Ke = a.object().shape({
|
|
638
|
+
attachments: (x = a.array().of(Qe)) == null ? void 0 : x.nullable(),
|
|
639
639
|
id: a.string().required("ID of SKU is required"),
|
|
640
640
|
index: a.number().integer().nullable(),
|
|
641
641
|
quantity: a.number().integer().nullable(),
|
|
642
642
|
seller: a.string().required("Seller is required"),
|
|
643
643
|
price: a.number().integer()
|
|
644
|
-
}),
|
|
644
|
+
}), Je = a.object({
|
|
645
645
|
orderFormId: a.string().required("OrderFormId is required"),
|
|
646
|
-
orderItems: a.array().of(
|
|
646
|
+
orderItems: a.array().of(Ke)
|
|
647
647
|
});
|
|
648
|
-
async function
|
|
648
|
+
async function Ye({
|
|
649
649
|
apiUrl: t,
|
|
650
650
|
body: e,
|
|
651
651
|
fetchOptions: n
|
|
@@ -654,7 +654,7 @@ async function Ze({
|
|
|
654
654
|
console.error("[ERROR FETCHING] Body is required");
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
657
|
-
await
|
|
657
|
+
await Je.validate(e);
|
|
658
658
|
const { orderFormId: r, orderItems: s } = e;
|
|
659
659
|
return h(
|
|
660
660
|
`${t}/api/checkout/pub/orderForm/${r}/items`,
|
|
@@ -665,10 +665,10 @@ async function Ze({
|
|
|
665
665
|
}
|
|
666
666
|
);
|
|
667
667
|
}
|
|
668
|
-
const
|
|
668
|
+
const We = a.object({
|
|
669
669
|
orderFormId: a.string().nullable()
|
|
670
670
|
});
|
|
671
|
-
async function
|
|
671
|
+
async function Xe({
|
|
672
672
|
apiUrl: t,
|
|
673
673
|
body: e,
|
|
674
674
|
fetchOptions: n
|
|
@@ -677,7 +677,7 @@ async function tt({
|
|
|
677
677
|
console.error("[ERROR FETCHING] Body is required");
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
|
-
await
|
|
680
|
+
await We.validate(e);
|
|
681
681
|
const { orderFormId: r } = e;
|
|
682
682
|
return h(
|
|
683
683
|
`${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,
|
|
@@ -687,23 +687,23 @@ async function tt({
|
|
|
687
687
|
}
|
|
688
688
|
);
|
|
689
689
|
}
|
|
690
|
-
const
|
|
690
|
+
const Ze = a.object().shape({
|
|
691
691
|
name: a.string().required("Attachment name is required"),
|
|
692
692
|
content: a.object().nullable()
|
|
693
693
|
});
|
|
694
694
|
var Q;
|
|
695
|
-
const
|
|
696
|
-
attachments: (Q = a.array().of(
|
|
695
|
+
const et = a.object().shape({
|
|
696
|
+
attachments: (Q = a.array().of(Ze)) == null ? void 0 : Q.nullable(),
|
|
697
697
|
id: a.string().required("ID of SKU is required"),
|
|
698
698
|
index: a.number().integer().nullable(),
|
|
699
699
|
quantity: a.number().integer().nullable(),
|
|
700
700
|
seller: a.string().required("Seller is required"),
|
|
701
701
|
price: a.number().integer()
|
|
702
|
-
}),
|
|
702
|
+
}), tt = a.object({
|
|
703
703
|
orderFormId: a.string().nullable(),
|
|
704
|
-
orderItems: a.array().of(
|
|
704
|
+
orderItems: a.array().of(et)
|
|
705
705
|
});
|
|
706
|
-
async function
|
|
706
|
+
async function rt({
|
|
707
707
|
apiUrl: t,
|
|
708
708
|
body: e,
|
|
709
709
|
fetchOptions: n
|
|
@@ -712,7 +712,7 @@ async function st({
|
|
|
712
712
|
console.error("[ERROR FETCHING] Body is required");
|
|
713
713
|
return;
|
|
714
714
|
}
|
|
715
|
-
await
|
|
715
|
+
await tt.validate(e);
|
|
716
716
|
const { orderFormId: r, orderItems: s } = e;
|
|
717
717
|
return h(
|
|
718
718
|
`${t}/api/checkout/pub/orderForm/${r}/items/update`,
|
|
@@ -723,10 +723,10 @@ async function st({
|
|
|
723
723
|
}
|
|
724
724
|
);
|
|
725
725
|
}
|
|
726
|
-
const
|
|
726
|
+
const nt = a.object({
|
|
727
727
|
orderFormId: a.string().nullable()
|
|
728
728
|
});
|
|
729
|
-
async function
|
|
729
|
+
async function at({
|
|
730
730
|
apiUrl: t,
|
|
731
731
|
body: e,
|
|
732
732
|
fetchOptions: n
|
|
@@ -735,7 +735,7 @@ async function it({
|
|
|
735
735
|
console.error("[ERROR FETCHING] Body is required");
|
|
736
736
|
return;
|
|
737
737
|
}
|
|
738
|
-
await
|
|
738
|
+
await nt.validate(e);
|
|
739
739
|
const { orderFormId: r } = e;
|
|
740
740
|
return h(
|
|
741
741
|
`${t}/api/checkout/pub/orderForm/${r}/messages/clear`,
|
|
@@ -745,19 +745,19 @@ async function it({
|
|
|
745
745
|
}
|
|
746
746
|
);
|
|
747
747
|
}
|
|
748
|
-
const
|
|
748
|
+
const st = a.object({
|
|
749
749
|
id: a.string().nullable(),
|
|
750
750
|
// id offering
|
|
751
751
|
itemIndex: a.number().nullable(),
|
|
752
752
|
orderFormId: a.string().nullable(),
|
|
753
753
|
remove: a.boolean().nullable()
|
|
754
754
|
});
|
|
755
|
-
async function
|
|
755
|
+
async function ot({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
756
756
|
if (!e) {
|
|
757
757
|
console.error("[ERROR FETCHING] Body is required");
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
|
-
await
|
|
760
|
+
await st.validate(e);
|
|
761
761
|
const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, l = i ? `/${o}/remove` : "", c = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${l}`;
|
|
762
762
|
return h(c, {
|
|
763
763
|
method: "POST",
|
|
@@ -765,10 +765,10 @@ async function lt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
765
765
|
...n
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
const
|
|
768
|
+
const it = a.object({
|
|
769
769
|
orderFormId: a.string().nullable()
|
|
770
770
|
});
|
|
771
|
-
async function
|
|
771
|
+
async function ct({
|
|
772
772
|
apiUrl: t,
|
|
773
773
|
body: e,
|
|
774
774
|
fetchOptions: n,
|
|
@@ -779,13 +779,13 @@ async function dt({
|
|
|
779
779
|
console.error("[ERROR FETCHING] Body is required");
|
|
780
780
|
return;
|
|
781
781
|
}
|
|
782
|
-
await
|
|
782
|
+
await it.validate(e);
|
|
783
783
|
const s = new URLSearchParams({
|
|
784
784
|
refreshOutdatedData: "true"
|
|
785
785
|
}), o = e.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
|
|
786
786
|
return h(o, { method: "GET", ...n });
|
|
787
787
|
}
|
|
788
|
-
const
|
|
788
|
+
const lt = a.object({
|
|
789
789
|
orderFormId: a.string().nullable(),
|
|
790
790
|
email: a.string().email().required(),
|
|
791
791
|
firstName: a.string().required(),
|
|
@@ -794,7 +794,7 @@ const mt = a.object({
|
|
|
794
794
|
document: a.string().required(),
|
|
795
795
|
phone: a.string().matches(/^\+\d{1,3}\d{10,11}$/)
|
|
796
796
|
});
|
|
797
|
-
async function
|
|
797
|
+
async function ut({
|
|
798
798
|
apiUrl: t,
|
|
799
799
|
body: e,
|
|
800
800
|
fetchOptions: n
|
|
@@ -803,7 +803,7 @@ async function pt({
|
|
|
803
803
|
console.error("[ERROR FETCHING] Body is required");
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
806
|
-
await
|
|
806
|
+
await lt.validate(e);
|
|
807
807
|
const { orderFormId: r, ...s } = e;
|
|
808
808
|
return h(
|
|
809
809
|
`${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
|
|
@@ -814,10 +814,10 @@ async function pt({
|
|
|
814
814
|
}
|
|
815
815
|
);
|
|
816
816
|
}
|
|
817
|
-
const
|
|
817
|
+
const dt = a.object({
|
|
818
818
|
sellerCode: a.string().nullable()
|
|
819
819
|
});
|
|
820
|
-
async function
|
|
820
|
+
async function mt({
|
|
821
821
|
apiUrl: t,
|
|
822
822
|
body: e,
|
|
823
823
|
extraData: n,
|
|
@@ -827,7 +827,7 @@ async function gt({
|
|
|
827
827
|
console.error("[ERROR FETCHING] Body is required");
|
|
828
828
|
return;
|
|
829
829
|
}
|
|
830
|
-
await
|
|
830
|
+
await dt.validate(e);
|
|
831
831
|
const { sellerCode: s = "" } = e;
|
|
832
832
|
return h(
|
|
833
833
|
`${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${s}`,
|
|
@@ -840,12 +840,12 @@ async function gt({
|
|
|
840
840
|
}
|
|
841
841
|
);
|
|
842
842
|
}
|
|
843
|
-
const
|
|
843
|
+
const pt = a.object().shape({
|
|
844
844
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
845
845
|
orderFormId: a.string().nullable(),
|
|
846
846
|
postalCode: a.string().nullable()
|
|
847
847
|
});
|
|
848
|
-
async function
|
|
848
|
+
async function ft({
|
|
849
849
|
apiUrl: t,
|
|
850
850
|
body: e,
|
|
851
851
|
fetchOptions: n
|
|
@@ -854,7 +854,7 @@ async function yt({
|
|
|
854
854
|
console.error("[ERROR FETCHING] Body is required");
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
|
-
await
|
|
857
|
+
await pt.validate(e);
|
|
858
858
|
const { country: r, orderFormId: s, postalCode: o } = e, i = o ? {
|
|
859
859
|
address: {
|
|
860
860
|
addressType: "residential",
|
|
@@ -874,7 +874,7 @@ async function yt({
|
|
|
874
874
|
}
|
|
875
875
|
);
|
|
876
876
|
}
|
|
877
|
-
const
|
|
877
|
+
const gt = a.object().shape({
|
|
878
878
|
orderFormId: a.string().nullable(),
|
|
879
879
|
options: a.array().of(
|
|
880
880
|
a.object().shape({
|
|
@@ -902,12 +902,12 @@ const bt = a.object().shape({
|
|
|
902
902
|
})
|
|
903
903
|
)
|
|
904
904
|
});
|
|
905
|
-
async function
|
|
905
|
+
async function ht({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
906
906
|
if (!e) {
|
|
907
907
|
console.error("[ERROR FETCHING] Body is required");
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
910
|
-
await
|
|
910
|
+
await gt.validate(e);
|
|
911
911
|
const { orderFormId: r, options: s, selectedAddresses: o } = e;
|
|
912
912
|
return h(
|
|
913
913
|
`${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
|
|
@@ -922,7 +922,7 @@ async function It({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
922
922
|
}
|
|
923
923
|
);
|
|
924
924
|
}
|
|
925
|
-
const
|
|
925
|
+
const yt = a.object({
|
|
926
926
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
927
927
|
postalCode: a.string().nullable(),
|
|
928
928
|
geoCoordinates: a.object().shape({
|
|
@@ -930,12 +930,12 @@ const Ct = a.object({
|
|
|
930
930
|
latitude: a.number().required()
|
|
931
931
|
})
|
|
932
932
|
});
|
|
933
|
-
async function
|
|
933
|
+
async function bt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
934
934
|
if (!e) {
|
|
935
935
|
console.error("[ERROR FETCHING] Body is required");
|
|
936
936
|
return;
|
|
937
937
|
}
|
|
938
|
-
await
|
|
938
|
+
await yt.validate(e);
|
|
939
939
|
const { country: r = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(r) });
|
|
940
940
|
return o ? i.append("postalCode", o) : i.append(
|
|
941
941
|
"geoCoordinates",
|
|
@@ -948,22 +948,22 @@ async function Rt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
948
948
|
}
|
|
949
949
|
);
|
|
950
950
|
}
|
|
951
|
-
const
|
|
951
|
+
const It = a.object({
|
|
952
952
|
id: a.string().required("ID of SKU is required"),
|
|
953
953
|
quantity: a.number().integer().required("Quantity of item is required"),
|
|
954
954
|
seller: a.string()
|
|
955
|
-
}),
|
|
956
|
-
items: a.array().of(
|
|
955
|
+
}), Ct = a.object({
|
|
956
|
+
items: a.array().of(It),
|
|
957
957
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
958
958
|
postalCode: a.string().nullable(),
|
|
959
959
|
geoCoordinates: a.array().nullable().of(a.number()).length(2)
|
|
960
960
|
});
|
|
961
|
-
async function
|
|
961
|
+
async function Rt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
962
962
|
if (!e) {
|
|
963
963
|
console.error("[ERROR FETCHING] Body is required");
|
|
964
964
|
return;
|
|
965
965
|
}
|
|
966
|
-
return await
|
|
966
|
+
return await Ct.validate(e), h(
|
|
967
967
|
`${t}/api/checkout/pub/orderForms/simulation`,
|
|
968
968
|
{
|
|
969
969
|
method: "POST",
|
|
@@ -972,35 +972,35 @@ async function Et({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
972
972
|
}
|
|
973
973
|
);
|
|
974
974
|
}
|
|
975
|
-
const
|
|
975
|
+
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
976
976
|
__proto__: null,
|
|
977
|
-
getMasterDataSellerCode:
|
|
978
|
-
getOrderForm:
|
|
979
|
-
postOrderFormAddCoupon:
|
|
980
|
-
postOrderFormAttachClientProfileData:
|
|
981
|
-
postOrderFormAttachOrderFormData:
|
|
982
|
-
postOrderFormAttachShippingData:
|
|
977
|
+
getMasterDataSellerCode: mt,
|
|
978
|
+
getOrderForm: ct,
|
|
979
|
+
postOrderFormAddCoupon: Ve,
|
|
980
|
+
postOrderFormAttachClientProfileData: ut,
|
|
981
|
+
postOrderFormAttachOrderFormData: Me,
|
|
982
|
+
postOrderFormAttachShippingData: ft,
|
|
983
983
|
postOrderFormAttachmentsMarketingData: J,
|
|
984
984
|
postOrderFormAttachmentsOpenTextField: K,
|
|
985
|
-
postOrderFormClearMessages:
|
|
986
|
-
postOrderFormFreightSimulation:
|
|
987
|
-
postOrderFormItems:
|
|
988
|
-
postOrderFormRegion:
|
|
989
|
-
postOrderFormRemoveAllItems:
|
|
990
|
-
postOrderFormUpdateItems:
|
|
991
|
-
postOrderFormUpdateShippingData:
|
|
992
|
-
postOrderformAddress:
|
|
993
|
-
putOrderFormCustomData:
|
|
994
|
-
updateOrderFormOffering:
|
|
995
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
985
|
+
postOrderFormClearMessages: at,
|
|
986
|
+
postOrderFormFreightSimulation: Rt,
|
|
987
|
+
postOrderFormItems: Ye,
|
|
988
|
+
postOrderFormRegion: bt,
|
|
989
|
+
postOrderFormRemoveAllItems: Xe,
|
|
990
|
+
postOrderFormUpdateItems: rt,
|
|
991
|
+
postOrderFormUpdateShippingData: ht,
|
|
992
|
+
postOrderformAddress: He,
|
|
993
|
+
putOrderFormCustomData: xe,
|
|
994
|
+
updateOrderFormOffering: ot
|
|
995
|
+
}, Symbol.toStringTag, { value: "Module" })), St = a.object({
|
|
996
996
|
skuId: a.string()
|
|
997
997
|
});
|
|
998
|
-
async function
|
|
998
|
+
async function Et({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
999
999
|
if (!e) {
|
|
1000
1000
|
console.error("[ERROR FETCHING] Body is required");
|
|
1001
1001
|
return;
|
|
1002
1002
|
}
|
|
1003
|
-
await
|
|
1003
|
+
await St.validate(e);
|
|
1004
1004
|
const { skuId: r } = e;
|
|
1005
1005
|
return h(
|
|
1006
1006
|
`${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
|
|
@@ -1009,15 +1009,15 @@ async function Ot({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
);
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1012
|
+
const Tt = a.object({
|
|
1013
1013
|
ids: a.array().of(a.string().required("ID are required")).required("IDs are required")
|
|
1014
1014
|
});
|
|
1015
|
-
async function
|
|
1015
|
+
async function Ft({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1016
1016
|
if (!e) {
|
|
1017
1017
|
console.error("[ERROR FETCHING] Body is required");
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
|
-
await
|
|
1020
|
+
await Tt.validate(e);
|
|
1021
1021
|
const { ids: r } = e;
|
|
1022
1022
|
return h(
|
|
1023
1023
|
`${t}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
|
|
@@ -1026,15 +1026,15 @@ async function qt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
);
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1029
|
+
const Ot = a.object({
|
|
1030
1030
|
productId: a.number().required("Product ID is required")
|
|
1031
1031
|
});
|
|
1032
|
-
async function
|
|
1032
|
+
async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1033
1033
|
if (!e) {
|
|
1034
1034
|
console.error("[ERROR FETCHING] Body is required");
|
|
1035
1035
|
return;
|
|
1036
1036
|
}
|
|
1037
|
-
await
|
|
1037
|
+
await Ot.validate(e);
|
|
1038
1038
|
const { productId: r } = e;
|
|
1039
1039
|
return h(
|
|
1040
1040
|
`${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
|
|
@@ -1043,15 +1043,15 @@ async function Pt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
);
|
|
1045
1045
|
}
|
|
1046
|
-
const
|
|
1046
|
+
const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1047
1047
|
__proto__: null,
|
|
1048
|
-
getCatalogKitProducts:
|
|
1049
|
-
getCatalogProducts:
|
|
1050
|
-
getCatalogSimilars:
|
|
1051
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1048
|
+
getCatalogKitProducts: Et,
|
|
1049
|
+
getCatalogProducts: Ft,
|
|
1050
|
+
getCatalogSimilars: $t
|
|
1051
|
+
}, Symbol.toStringTag, { value: "Module" })), At = a.object({
|
|
1052
1052
|
query: a.string()
|
|
1053
1053
|
});
|
|
1054
|
-
async function
|
|
1054
|
+
async function Pt({
|
|
1055
1055
|
apiUrl: t,
|
|
1056
1056
|
body: e,
|
|
1057
1057
|
fetchOptions: n
|
|
@@ -1060,7 +1060,7 @@ async function kt({
|
|
|
1060
1060
|
console.error("[ERROR FETCHING] Body is required");
|
|
1061
1061
|
return;
|
|
1062
1062
|
}
|
|
1063
|
-
await
|
|
1063
|
+
await At.validate(e);
|
|
1064
1064
|
const { query: r = "" } = e, s = new URLSearchParams({ query: r });
|
|
1065
1065
|
return h(
|
|
1066
1066
|
`${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
|
|
@@ -1069,10 +1069,10 @@ async function kt({
|
|
|
1069
1069
|
}
|
|
1070
1070
|
);
|
|
1071
1071
|
}
|
|
1072
|
-
const
|
|
1072
|
+
const wt = (t, e) => ye(t, e), Nt = (t) => ({
|
|
1073
1073
|
...t,
|
|
1074
|
-
description: t.description ?
|
|
1075
|
-
}),
|
|
1074
|
+
description: t.description ? wt(t.description) : t.description
|
|
1075
|
+
}), kt = ({
|
|
1076
1076
|
offer: t,
|
|
1077
1077
|
seller: e,
|
|
1078
1078
|
product: n
|
|
@@ -1082,8 +1082,8 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1082
1082
|
seller: e
|
|
1083
1083
|
}), Y = (t, e) => ({
|
|
1084
1084
|
...t,
|
|
1085
|
-
isVariantOf:
|
|
1086
|
-
}),
|
|
1085
|
+
isVariantOf: Nt(e)
|
|
1086
|
+
}), jt = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, Dt = (t) => t.Price ?? 0, W = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), _t = (t, e) => {
|
|
1087
1087
|
let n = 0;
|
|
1088
1088
|
for (let r = 1; r < t.length; r++)
|
|
1089
1089
|
e(t[n], t[r]) > 0 && (n = r);
|
|
@@ -1094,7 +1094,7 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1094
1094
|
offer: s.commertialOffer,
|
|
1095
1095
|
sku: r
|
|
1096
1096
|
}))
|
|
1097
|
-
), n =
|
|
1097
|
+
), n = _t(
|
|
1098
1098
|
e,
|
|
1099
1099
|
({ offer: r }, { offer: s }) => W(r, s)
|
|
1100
1100
|
);
|
|
@@ -1109,11 +1109,11 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1109
1109
|
attachment: "ATTACHMENT",
|
|
1110
1110
|
specification: "SPECIFICATION",
|
|
1111
1111
|
attribute: "ATTRIBUTE"
|
|
1112
|
-
},
|
|
1112
|
+
}, Ht = (t) => ({
|
|
1113
1113
|
name: t.name,
|
|
1114
1114
|
value: t.content,
|
|
1115
1115
|
valueReference: H.attachment
|
|
1116
|
-
}),
|
|
1116
|
+
}), Lt = (t) => ({
|
|
1117
1117
|
propertyID: t.id,
|
|
1118
1118
|
name: t.name,
|
|
1119
1119
|
value: t.value,
|
|
@@ -1130,23 +1130,23 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1130
1130
|
name: i,
|
|
1131
1131
|
value: "",
|
|
1132
1132
|
valueReference: H.specification
|
|
1133
|
-
}), s = Array.isArray(n) ? n.map(
|
|
1133
|
+
}), s = Array.isArray(n) ? n.map(Ht) : [], o = e ? e.map(Lt) : [];
|
|
1134
1134
|
return [
|
|
1135
1135
|
...r,
|
|
1136
1136
|
...s,
|
|
1137
1137
|
...o
|
|
1138
1138
|
];
|
|
1139
|
-
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",
|
|
1139
|
+
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Bt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Gt = (t) => {
|
|
1140
1140
|
let e = t.slice(0);
|
|
1141
1141
|
for (let n = 0; n < V.length; n++)
|
|
1142
1142
|
e = e.replace(
|
|
1143
1143
|
new RegExp(V.charAt(n), "g"),
|
|
1144
|
-
|
|
1144
|
+
Bt.charAt(n)
|
|
1145
1145
|
);
|
|
1146
1146
|
return e;
|
|
1147
|
-
},
|
|
1147
|
+
}, Mt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
|
|
1148
1148
|
const n = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1149
|
-
return
|
|
1149
|
+
return Mt(Gt(n)).toLowerCase();
|
|
1150
1150
|
}, te = (t) => `/${t}/p`, re = (t) => {
|
|
1151
1151
|
const e = Math.max(
|
|
1152
1152
|
...t.map((r) => r.NumberOfInstallments)
|
|
@@ -1163,7 +1163,7 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1163
1163
|
listPrice: 0,
|
|
1164
1164
|
sellerDefault: !1
|
|
1165
1165
|
}, s = t.map(
|
|
1166
|
-
(o) =>
|
|
1166
|
+
(o) => kt({
|
|
1167
1167
|
offer: o.commertialOffer,
|
|
1168
1168
|
seller: o,
|
|
1169
1169
|
product: e
|
|
@@ -1171,7 +1171,7 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1171
1171
|
).sort(W).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (n.price = o.Price, n.listPrice = o.ListPrice, n.sellerDefault = !0), {
|
|
1172
1172
|
availability: o.AvailableQuantity > 0,
|
|
1173
1173
|
listPrice: o.ListPrice,
|
|
1174
|
-
price:
|
|
1174
|
+
price: Dt(o),
|
|
1175
1175
|
priceValidUntil: o.PriceValidUntil,
|
|
1176
1176
|
priceCurrency: "BRL",
|
|
1177
1177
|
installments: o.Installments,
|
|
@@ -1193,7 +1193,7 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1193
1193
|
name: r,
|
|
1194
1194
|
offers: {
|
|
1195
1195
|
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: l }) => ({
|
|
1196
|
-
availability:
|
|
1196
|
+
availability: jt(l.AvailableQuantity > 0),
|
|
1197
1197
|
listPrice: l.ListPrice,
|
|
1198
1198
|
price: l.Price,
|
|
1199
1199
|
quantity: l.AvailableQuantity,
|
|
@@ -1205,7 +1205,7 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1205
1205
|
sku: n
|
|
1206
1206
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1207
1207
|
};
|
|
1208
|
-
},
|
|
1208
|
+
}, Ut = (t) => {
|
|
1209
1209
|
var v;
|
|
1210
1210
|
const {
|
|
1211
1211
|
attributes: e,
|
|
@@ -1280,7 +1280,7 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1280
1280
|
},
|
|
1281
1281
|
installments: T
|
|
1282
1282
|
};
|
|
1283
|
-
},
|
|
1283
|
+
}, Vt = (t) => {
|
|
1284
1284
|
var T;
|
|
1285
1285
|
const {
|
|
1286
1286
|
attributes: e,
|
|
@@ -1369,16 +1369,16 @@ const jt = (t, e) => Ce(t, e), Dt = (t) => ({
|
|
|
1369
1369
|
},
|
|
1370
1370
|
installments: R
|
|
1371
1371
|
};
|
|
1372
|
-
},
|
|
1372
|
+
}, zt = a.array().of(a.object({
|
|
1373
1373
|
key: a.string().required(),
|
|
1374
1374
|
value: a.string().required()
|
|
1375
1375
|
})).required("Facets are required");
|
|
1376
|
-
async function
|
|
1376
|
+
async function xt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1377
1377
|
if (!e) {
|
|
1378
1378
|
console.error("[ERROR FETCHING] Body is required");
|
|
1379
1379
|
return;
|
|
1380
1380
|
}
|
|
1381
|
-
await
|
|
1381
|
+
await zt.validate(e);
|
|
1382
1382
|
const r = new URLSearchParams({}), s = e.map(({ key: i, value: l }) => `${i}/${l}`).join("/");
|
|
1383
1383
|
le(e, r);
|
|
1384
1384
|
const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
@@ -1389,7 +1389,7 @@ async function Jt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1389
1389
|
const m = X(c.items);
|
|
1390
1390
|
return m && Y(m, c);
|
|
1391
1391
|
}).filter((c) => !!c).map((c) => ({
|
|
1392
|
-
node:
|
|
1392
|
+
node: Vt(c)
|
|
1393
1393
|
})));
|
|
1394
1394
|
}
|
|
1395
1395
|
const se = ({
|
|
@@ -1420,7 +1420,7 @@ const se = ({
|
|
|
1420
1420
|
});
|
|
1421
1421
|
u !== void 0 && C.append("hideUnavailableItems", u.toString());
|
|
1422
1422
|
const f = c.map((p) => `${p.key}/${p.value}`).join("/") ?? "";
|
|
1423
|
-
return
|
|
1423
|
+
return De(
|
|
1424
1424
|
`${t}/api/io/_v/api/intelligent-search/${m}/${f}?${C.toString()}`,
|
|
1425
1425
|
{
|
|
1426
1426
|
headers: {
|
|
@@ -1431,7 +1431,7 @@ const se = ({
|
|
|
1431
1431
|
}
|
|
1432
1432
|
);
|
|
1433
1433
|
};
|
|
1434
|
-
async function
|
|
1434
|
+
async function Qt({ body: t, extraData: e, ...n }) {
|
|
1435
1435
|
if (!t) {
|
|
1436
1436
|
console.error("[ERROR FETCHING] Body is required");
|
|
1437
1437
|
return;
|
|
@@ -1461,13 +1461,13 @@ async function Yt({ body: t, extraData: e, ...n }) {
|
|
|
1461
1461
|
total: o.count
|
|
1462
1462
|
},
|
|
1463
1463
|
products: s.map((l, c) => ({
|
|
1464
|
-
node:
|
|
1464
|
+
node: Ut(l),
|
|
1465
1465
|
cursor: c.toString()
|
|
1466
1466
|
}))
|
|
1467
1467
|
}
|
|
1468
1468
|
};
|
|
1469
1469
|
}
|
|
1470
|
-
async function
|
|
1470
|
+
async function Kt({ body: t, extraData: e, ...n }) {
|
|
1471
1471
|
if (!t) {
|
|
1472
1472
|
console.error("[ERROR FETCHING] Body is required");
|
|
1473
1473
|
return;
|
|
@@ -1487,16 +1487,16 @@ async function Wt({ body: t, extraData: e, ...n }) {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
};
|
|
1489
1489
|
}
|
|
1490
|
-
const
|
|
1490
|
+
const Jt = a.object({
|
|
1491
1491
|
query: a.string().optional(),
|
|
1492
1492
|
locale: a.string().optional()
|
|
1493
1493
|
});
|
|
1494
|
-
async function
|
|
1494
|
+
async function Yt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1495
1495
|
if (!e) {
|
|
1496
1496
|
console.error("[ERROR FETCHING] Body is required");
|
|
1497
1497
|
return;
|
|
1498
1498
|
}
|
|
1499
|
-
await
|
|
1499
|
+
await Jt.validate(e);
|
|
1500
1500
|
const { query: r = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: r, locale: s });
|
|
1501
1501
|
return h(
|
|
1502
1502
|
`${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,
|
|
@@ -1505,22 +1505,22 @@ async function Zt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1505
1505
|
}
|
|
1506
1506
|
);
|
|
1507
1507
|
}
|
|
1508
|
-
async function
|
|
1508
|
+
async function Wt({ apiUrl: t }) {
|
|
1509
1509
|
return h(`${t}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1510
1510
|
}
|
|
1511
|
-
const
|
|
1511
|
+
const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1512
1512
|
__proto__: null,
|
|
1513
|
-
getSearchAutoCompleteSuggestions:
|
|
1514
|
-
getSearchCrossellingProducts:
|
|
1515
|
-
getSearchFacets:
|
|
1516
|
-
getSearchProducts:
|
|
1517
|
-
getSearchSuggestedTerms:
|
|
1518
|
-
getSearchTopSearchs:
|
|
1519
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1513
|
+
getSearchAutoCompleteSuggestions: Pt,
|
|
1514
|
+
getSearchCrossellingProducts: xt,
|
|
1515
|
+
getSearchFacets: Kt,
|
|
1516
|
+
getSearchProducts: Qt,
|
|
1517
|
+
getSearchSuggestedTerms: Yt,
|
|
1518
|
+
getSearchTopSearchs: Wt
|
|
1519
|
+
}, Symbol.toStringTag, { value: "Module" })), Zt = a.object({
|
|
1520
1520
|
masterDataEntity: a.string().nonNullable(),
|
|
1521
1521
|
payload: a.object().shape({}).nullable()
|
|
1522
1522
|
});
|
|
1523
|
-
async function
|
|
1523
|
+
async function er({
|
|
1524
1524
|
apiUrl: t,
|
|
1525
1525
|
body: e,
|
|
1526
1526
|
fetchOptions: n
|
|
@@ -1529,7 +1529,7 @@ async function nr({
|
|
|
1529
1529
|
console.error("[ERROR FETCHING] Body is required");
|
|
1530
1530
|
return;
|
|
1531
1531
|
}
|
|
1532
|
-
await
|
|
1532
|
+
await Zt.validate(e);
|
|
1533
1533
|
const { masterDataEntity: r, payload: s } = e, o = `${t}/api/dataentities/${r}/documents`;
|
|
1534
1534
|
return h(o, {
|
|
1535
1535
|
method: "POST",
|
|
@@ -1539,21 +1539,21 @@ async function nr({
|
|
|
1539
1539
|
...n
|
|
1540
1540
|
});
|
|
1541
1541
|
}
|
|
1542
|
-
const
|
|
1542
|
+
const tr = a.object().shape({
|
|
1543
1543
|
_where: a.string().optional(),
|
|
1544
1544
|
_fields: a.string().optional(),
|
|
1545
1545
|
_sort: a.string().optional(),
|
|
1546
1546
|
_from: a.number().integer().min(0).optional(),
|
|
1547
1547
|
_to: a.number().integer().min(0).optional(),
|
|
1548
1548
|
_keyword: a.string().optional()
|
|
1549
|
-
}),
|
|
1549
|
+
}), rr = a.object({
|
|
1550
1550
|
masterDataEntity: a.string().required(),
|
|
1551
|
-
searchFields:
|
|
1551
|
+
searchFields: tr,
|
|
1552
1552
|
headers: a.object().shape({
|
|
1553
1553
|
"REST-Range": a.string().notRequired()
|
|
1554
1554
|
})
|
|
1555
1555
|
});
|
|
1556
|
-
async function
|
|
1556
|
+
async function nr({
|
|
1557
1557
|
apiUrl: t,
|
|
1558
1558
|
body: e,
|
|
1559
1559
|
fetchOptions: n
|
|
@@ -1563,7 +1563,7 @@ async function or({
|
|
|
1563
1563
|
return;
|
|
1564
1564
|
}
|
|
1565
1565
|
const r = new URLSearchParams();
|
|
1566
|
-
await
|
|
1566
|
+
await rr.validate(e);
|
|
1567
1567
|
const { masterDataEntity: s, searchFields: o, headers: i } = e;
|
|
1568
1568
|
o && Object.entries(o).forEach(([m, u]) => {
|
|
1569
1569
|
r.append(m, String(u));
|
|
@@ -1591,12 +1591,12 @@ async function or({
|
|
|
1591
1591
|
} while (c);
|
|
1592
1592
|
return l;
|
|
1593
1593
|
}
|
|
1594
|
-
const
|
|
1594
|
+
const ar = a.object({
|
|
1595
1595
|
dataEntityName: a.string().required(),
|
|
1596
1596
|
id: a.string().required(),
|
|
1597
1597
|
fieldsToBeUpdated: a.object().shape({})
|
|
1598
1598
|
});
|
|
1599
|
-
async function
|
|
1599
|
+
async function sr({
|
|
1600
1600
|
apiUrl: t,
|
|
1601
1601
|
body: e,
|
|
1602
1602
|
fetchOptions: n
|
|
@@ -1605,7 +1605,7 @@ async function cr({
|
|
|
1605
1605
|
console.error("[ERROR FETCHING] Body is required");
|
|
1606
1606
|
return;
|
|
1607
1607
|
}
|
|
1608
|
-
await
|
|
1608
|
+
await ar.validate(e);
|
|
1609
1609
|
const { dataEntityName: r, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
|
|
1610
1610
|
return h(i, {
|
|
1611
1611
|
body: {
|
|
@@ -1615,13 +1615,13 @@ async function cr({
|
|
|
1615
1615
|
...n
|
|
1616
1616
|
});
|
|
1617
1617
|
}
|
|
1618
|
-
const
|
|
1618
|
+
const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1619
1619
|
__proto__: null,
|
|
1620
|
-
getSearchMasterdata:
|
|
1621
|
-
patchUpdateMasterdata:
|
|
1622
|
-
postMasterdata:
|
|
1620
|
+
getSearchMasterdata: nr,
|
|
1621
|
+
patchUpdateMasterdata: sr,
|
|
1622
|
+
postMasterdata: er
|
|
1623
1623
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1624
|
-
async function
|
|
1624
|
+
async function ir({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
1625
1625
|
const { productIds: s } = t;
|
|
1626
1626
|
if (!s)
|
|
1627
1627
|
return console.error("[ERROR FETCHING] productIds is required"), [];
|
|
@@ -1736,10 +1736,10 @@ async function ur({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1736
1736
|
};
|
|
1737
1737
|
});
|
|
1738
1738
|
}
|
|
1739
|
-
const
|
|
1739
|
+
const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1740
1740
|
__proto__: null,
|
|
1741
|
-
getWishlistProducts:
|
|
1742
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1741
|
+
getWishlistProducts: ir
|
|
1742
|
+
}, Symbol.toStringTag, { value: "Module" })), lr = (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(lr).join(e), ur = ({ canonical: t, seo: e, slug: n }) => {
|
|
1743
1743
|
const r = Array.isArray(n) ? n.join(", ") : n;
|
|
1744
1744
|
return {
|
|
1745
1745
|
id: 0,
|
|
@@ -1750,7 +1750,7 @@ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1750
1750
|
url: t,
|
|
1751
1751
|
children: []
|
|
1752
1752
|
};
|
|
1753
|
-
},
|
|
1753
|
+
}, dr = ({ canonical: t, category: e, previousImages: n, seo: r }) => ({
|
|
1754
1754
|
category: String(e == null ? void 0 : e.id),
|
|
1755
1755
|
title: (e == null ? void 0 : e.Title) ?? r.title,
|
|
1756
1756
|
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
@@ -1761,23 +1761,23 @@ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1761
1761
|
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
1762
1762
|
images: Array.isArray(n) ? [...n] : []
|
|
1763
1763
|
}
|
|
1764
|
-
}),
|
|
1764
|
+
}), mr = ({ items: t, parent: e, apiUrl: n, find: r }) => {
|
|
1765
1765
|
const s = t.find(
|
|
1766
1766
|
(i) => i.url.replace(n, "") === decodeURIComponent(e.toLowerCase())
|
|
1767
1767
|
);
|
|
1768
1768
|
return (s == null ? void 0 : s.children.find(
|
|
1769
1769
|
(i) => i.name.toLowerCase() === decodeURIComponent(String(r))
|
|
1770
1770
|
)) ?? s;
|
|
1771
|
-
},
|
|
1771
|
+
}, pr = (t) => {
|
|
1772
1772
|
t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
|
|
1773
|
-
},
|
|
1773
|
+
}, fr = /* @__PURE__ */ new Set([
|
|
1774
1774
|
"brand",
|
|
1775
1775
|
"category",
|
|
1776
1776
|
"department",
|
|
1777
1777
|
"subcategory",
|
|
1778
1778
|
"collection",
|
|
1779
1779
|
"cluster"
|
|
1780
|
-
]),
|
|
1780
|
+
]), gr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && fr.has(t == null ? void 0 : t.pageType.toLowerCase()), hr = (t) => ({
|
|
1781
1781
|
collection: t.Coleção,
|
|
1782
1782
|
categoryId: t.categoryId,
|
|
1783
1783
|
current_collection: t["Coleção Atual"],
|
|
@@ -1796,21 +1796,16 @@ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1796
1796
|
textureImage: (o == null ? void 0 : o.imageUrl) ?? "",
|
|
1797
1797
|
textureAlt: (o == null ? void 0 : o.imageText) ?? ""
|
|
1798
1798
|
}), n;
|
|
1799
|
-
}, []),
|
|
1799
|
+
}, []), yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1800
1800
|
__proto__: null,
|
|
1801
|
-
createEmptySeoCategory:
|
|
1802
|
-
createSeoCategory:
|
|
1803
|
-
findCategory:
|
|
1801
|
+
createEmptySeoCategory: ur,
|
|
1802
|
+
createSeoCategory: dr,
|
|
1803
|
+
findCategory: mr,
|
|
1804
1804
|
formattedSimilars: oe,
|
|
1805
|
-
isCollectionPageType:
|
|
1806
|
-
notFindCategoryError:
|
|
1807
|
-
responseAdapter:
|
|
1808
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1809
|
-
parseSearchState: ge,
|
|
1810
|
-
convertSearchParams: fe,
|
|
1811
|
-
filterNonRootFacets: pe,
|
|
1812
|
-
filterNonCategorySelected: me
|
|
1813
|
-
}, vr = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
|
|
1805
|
+
isCollectionPageType: gr,
|
|
1806
|
+
notFindCategoryError: pr,
|
|
1807
|
+
responseAdapter: hr
|
|
1808
|
+
}, Symbol.toStringTag, { value: "Module" })), br = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
|
|
1814
1809
|
const l = await fetch(
|
|
1815
1810
|
`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
|
|
1816
1811
|
).then((m) => m.json()), c = oe(l, o);
|
|
@@ -1821,31 +1816,31 @@ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1821
1816
|
] }),
|
|
1822
1817
|
/* @__PURE__ */ b(r, { productId: n, similars: c, TOGGLE_STYLE_MODIFIER: i })
|
|
1823
1818
|
] });
|
|
1824
|
-
},
|
|
1825
|
-
checkout:
|
|
1826
|
-
catalog:
|
|
1827
|
-
cms:
|
|
1828
|
-
search:
|
|
1829
|
-
masterdata:
|
|
1819
|
+
}, Er = {
|
|
1820
|
+
checkout: vt,
|
|
1821
|
+
catalog: qt,
|
|
1822
|
+
cms: me,
|
|
1823
|
+
search: Xt,
|
|
1824
|
+
masterdata: or,
|
|
1830
1825
|
wishlist: {
|
|
1831
|
-
...
|
|
1826
|
+
...cr
|
|
1832
1827
|
}
|
|
1833
|
-
},
|
|
1834
|
-
catalog:
|
|
1835
|
-
search:
|
|
1836
|
-
product:
|
|
1828
|
+
}, Tr = {
|
|
1829
|
+
catalog: yr,
|
|
1830
|
+
search: he,
|
|
1831
|
+
product: ge,
|
|
1837
1832
|
cms: {
|
|
1838
|
-
...
|
|
1839
|
-
...
|
|
1833
|
+
...fe,
|
|
1834
|
+
...pe
|
|
1840
1835
|
}
|
|
1841
|
-
},
|
|
1836
|
+
}, Fr = {
|
|
1842
1837
|
template: {
|
|
1843
|
-
pdp: { PDPSimilars:
|
|
1838
|
+
pdp: { PDPSimilars: br }
|
|
1844
1839
|
}
|
|
1845
1840
|
};
|
|
1846
1841
|
export {
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1842
|
+
Er as serverAPIs,
|
|
1843
|
+
Sr as serverCMS,
|
|
1844
|
+
Fr as serverComponents,
|
|
1845
|
+
Tr as serverHelpers
|
|
1851
1846
|
};
|