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