@soma-vertical-web/multi-lib 0.0.68 → 0.0.70
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/header/HeaderCategoryContext.d.ts +7 -0
- package/contexts/contexts/header/MenuMobileContext.d.ts +5 -4
- package/contexts/index.d.ts +2 -2
- package/index.js +17 -17
- package/index.mjs +4837 -4881
- package/layout/index.d.ts +2 -2
- package/layout/team-component/Header/Composite/HeaderDesktopWrapper.d.ts +5 -1
- package/layout/team-component/Header/Composite/HeaderMobileWrapper.d.ts +6 -1
- package/layout/team-component/Header/index.d.ts +1 -1
- package/layout/team-component/Menu/Composite/Mobile/Body/Body.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/Banner.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/Category.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/List.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/SubCategory.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/Title.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/index.d.ts +22 -0
- package/layout/team-component/Menu/Composite/Mobile/{Body/SubMenu/SubMenu.d.ts → Header/Header.d.ts} +2 -2
- package/layout/team-component/Menu/Composite/Mobile/MenuRoot.d.ts +4 -7
- package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBarItem.d.ts → BarItem.d.ts} +1 -1
- package/layout/team-component/Menu/MenuMobile.d.ts +7 -8
- package/layout/team-component/UserMenu/Composite/Menu.d.ts +1 -1
- package/layout/team-component/UserMenu/UserMenu.d.ts +1 -1
- package/layout/team-component/UserMenu/index.d.ts +3 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cms/ContentTypes/Header/index.d.ts +9 -1
- package/types/cms/Sections/SectionZone/intex.d.ts +1 -1
- package/types/constants.d.ts +12 -14
- package/types/layout/team-components/Header/index.d.ts +9 -1
- package/types/layout/team-components/Menu/Mobile/Body/Category/index.d.ts +23 -0
- package/types/layout/team-components/Menu/Mobile/Body/index.d.ts +3 -0
- package/types/layout/team-components/Menu/Mobile/index.d.ts +10 -1
- package/types/layout/team-components/UserMenu/index.d.ts +10 -7
- package/Footer-93X9fl_J.mjs +0 -7055
- package/Footer-BjB3blIh.mjs +0 -6956
- package/Footer-By1Gk2Ku.mjs +0 -7050
- package/Footer-COiI-tye.mjs +0 -7049
- package/Footer-CZqTxkCn.js +0 -41
- package/Footer-D3zDoa2N.mjs +0 -6961
- package/Footer-DfAuGt3s.js +0 -41
- package/Footer-TLfR7lta.js +0 -41
- package/Footer-okPVOqRy.js +0 -41
- package/Footer-rMb9FYog.js +0 -41
- package/SearchPageScreening-BIyp1dAW.mjs +0 -112
- package/SearchPageScreening-gO7dG13l.js +0 -1
- package/__vite-browser-external-B8mGO3z6.js +0 -1
- package/__vite-browser-external-BYRIRx8p.mjs +0 -8
- package/__vite-browser-external-C4n7rb1H.mjs +0 -85
- package/__vite-browser-external-Cjz79hOw.js +0 -1
- package/__vite-browser-external-CpdIDx9o.mjs +0 -79
- package/__vite-browser-external-DDWPeg5L.js +0 -1
- package/cms/ContentTypes/CommonPage/index.d.ts +0 -2
- package/cms/ContentTypes/FlagsAndTags/index.d.ts +0 -1
- package/cms/ContentTypes/PLP/PLPContentContext.d.ts +0 -4
- package/cms/ContentTypes/Search/SearchContentScreening.d.ts +0 -3
- package/cms/ContentTypes/index.d.ts +0 -6
- package/data/actions/masterDataServices.d.ts +0 -5
- package/data/api/user/index.d.ts +0 -3
- package/data/helpers/search/policy.d.ts +0 -3
- package/data/helpers/search/product/utils/index.d.ts +0 -8
- package/data/helpers/search/region.d.ts +0 -3
- package/index-ASRiF3PD.js +0 -1
- package/index-BJzBUeMp.js +0 -1
- package/index-BR5lPUsH.js +0 -1
- package/index-BRfMTuMz.mjs +0 -405
- package/index-BYY2x6mQ.js +0 -1
- package/index-Ba7fQCkk.js +0 -1
- package/index-BzNV29ol.mjs +0 -402
- package/index-C3QT-3iu.mjs +0 -355
- package/index-C5zOWvXN.js +0 -1
- package/index-CbOiLJQX.mjs +0 -403
- package/index-CiBRnp7U.js +0 -1
- package/index-CiMxj6Pg.mjs +0 -412
- package/index-CkcBCfzG.js +0 -1
- package/index-CuKKHhKx.mjs +0 -355
- package/index-D3ONVIla.mjs +0 -412
- package/index-DD12Nl4r.mjs +0 -412
- package/index-DJR4CcKO.mjs +0 -398
- package/index-DJeLEsRl.js +0 -1
- package/index-DKnolQoT.mjs +0 -412
- package/index-DYpuW0tu.mjs +0 -354
- package/index-D__YfUie.js +0 -1
- package/index-DfnS9D5I.mjs +0 -354
- package/index-Do5eAlCL.mjs +0 -219
- package/index-VkanwPXK.mjs +0 -221
- package/index-WV5Gjz3i.js +0 -1
- package/index-catAI5a3.mjs +0 -258
- package/index-drKDwA8_.js +0 -1
- package/layout/team-component/Menu/Composite/Mobile/Body/MenuBody.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/MenuCategories.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/MenuCategoriesWrapper.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/SubMenu/SubMenuItem.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/SubMenu/SubMenuSubCategory.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderContainer.d.ts +0 -5
- package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderNavLinks.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderWrapper.d.ts +0 -7
- package/types/data/actions/index.d.ts +0 -27
- package/types/layout/team-components/PDCNavigation/intex.d.ts +0 -9
- package/types/layout/team-components/ProductList/Composite/Card/index.d.ts +0 -9
- package/types/utils.d.ts +0 -3
- /package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBar.d.ts → Bar.d.ts} +0 -0
package/index-DYpuW0tu.mjs
DELETED
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
import { jsxs as y, Fragment as w, jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { Utils as N } from "@soma-vertical-web/core-components";
|
|
3
|
-
const h = (e, t = !0) => Intl.NumberFormat("pt-BR", {
|
|
4
|
-
style: "currency",
|
|
5
|
-
currency: "BRL",
|
|
6
|
-
minimumFractionDigits: t ? 2 : 0
|
|
7
|
-
}).format(e), O = ({ valueInCents: e, hasFree: t, freeTaxMessage: n }) => e === 0 ? t ? n : h(0) : h(e / 100), I = (e, t) => {
|
|
8
|
-
const [n, s] = e.split(t);
|
|
9
|
-
return { name: n.trim(), size: s ? s.trim() : "" };
|
|
10
|
-
}, P = (e, t) => {
|
|
11
|
-
if (!e)
|
|
12
|
-
return {};
|
|
13
|
-
const [n, s] = e.split(t);
|
|
14
|
-
return { color: n == null ? void 0 : n.trim(), size: s == null ? void 0 : s.trim() };
|
|
15
|
-
}, R = (e, t = "tamanho") => {
|
|
16
|
-
if (e.additionalProperty) {
|
|
17
|
-
const [n] = e.additionalProperty;
|
|
18
|
-
return n != null && n.name ? n.name.toLocaleLowerCase() === t ? n.value : e.name : "";
|
|
19
|
-
}
|
|
20
|
-
return e.name;
|
|
21
|
-
}, F = (e, t) => e.replace(t, "").trim(), z = (e) => e.replace(/\//g, ""), C = ({ items: e, NAME_SPLIT_SYMBOL: t }) => {
|
|
22
|
-
const n = {
|
|
23
|
-
price: 0,
|
|
24
|
-
listPrice: 0,
|
|
25
|
-
installments: {
|
|
26
|
-
count: 0,
|
|
27
|
-
value: 0
|
|
28
|
-
}
|
|
29
|
-
}, s = (r, i) => {
|
|
30
|
-
var m;
|
|
31
|
-
i && (i.sellerId = r.sellerId, i.sellerName = r.sellerName, i.available = !0, i.isSellerDefault = r.sellerDefault);
|
|
32
|
-
const {
|
|
33
|
-
Price: c,
|
|
34
|
-
ListPrice: p,
|
|
35
|
-
PaymentOptions: { installmentOptions: d }
|
|
36
|
-
} = r.commertialOffer;
|
|
37
|
-
n.price = c, n.listPrice = p;
|
|
38
|
-
const l = (m = d == null ? void 0 : d[0]) == null ? void 0 : m.installments;
|
|
39
|
-
if (l) {
|
|
40
|
-
const { count: u, value: g } = l[l.length - 1];
|
|
41
|
-
n.installments = {
|
|
42
|
-
count: u,
|
|
43
|
-
value: g / 100
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
let a = !0;
|
|
48
|
-
const o = e.reduce((r, i) => {
|
|
49
|
-
var d;
|
|
50
|
-
const c = {
|
|
51
|
-
name: i.name,
|
|
52
|
-
sku: i.itemId,
|
|
53
|
-
value: ((d = i.Tamanho) == null ? void 0 : d[0]) ?? I(i.nameComplete ?? i.name, t).size,
|
|
54
|
-
available: !1,
|
|
55
|
-
sellerId: "",
|
|
56
|
-
sellerName: "",
|
|
57
|
-
isSellerDefault: !1
|
|
58
|
-
}, p = i.sellers.filter((l) => (l.sellerDefault && l.commertialOffer.IsAvailable && (c.available = !0, s(l, c)), l.commertialOffer.IsAvailable));
|
|
59
|
-
return !c.isSellerDefault && p.length > 0 && (c.available = !0, s(p[0], {
|
|
60
|
-
...c,
|
|
61
|
-
sellerId: p[0].sellerId,
|
|
62
|
-
sellerName: p[0].sellerName
|
|
63
|
-
})), c.available === !1 && (a = !1), r.push(c), r;
|
|
64
|
-
}, []);
|
|
65
|
-
return {
|
|
66
|
-
...n,
|
|
67
|
-
sizes: o,
|
|
68
|
-
allSizesAvailable: a
|
|
69
|
-
};
|
|
70
|
-
}, j = (e) => e ? !e.offers.offers.find(({ quantity: t = 0 }) => t > 0) : !1, T = (e, t) => {
|
|
71
|
-
const n = e.find(
|
|
72
|
-
(s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0 && s.seller.identifier === t
|
|
73
|
-
);
|
|
74
|
-
return n || e.find(
|
|
75
|
-
(s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0
|
|
76
|
-
);
|
|
77
|
-
}, A = ({ images: e, TEXTURE_IMAGE: t }) => e.find((n) => t.includes(n.imageLabel)) ?? e[0], D = (e, t) => {
|
|
78
|
-
const n = /\/ids\/(\d+)\//, s = e.match(n);
|
|
79
|
-
return s ? e.replace(
|
|
80
|
-
`/${s[1]}/`,
|
|
81
|
-
`/${s[1]}-${t.width}-${t.height}/`
|
|
82
|
-
) : e;
|
|
83
|
-
}, B = (e, t) => {
|
|
84
|
-
const n = /\/ids\/(\d+)-(\d+)-(\d+)\//, s = e.match(n);
|
|
85
|
-
return s ? e.replace(
|
|
86
|
-
`/${s[1]}-${s[2]}-${s[3]}/`,
|
|
87
|
-
`/${s[1]}-${t.width}-${t.height}/`
|
|
88
|
-
) : e;
|
|
89
|
-
}, x = ({
|
|
90
|
-
images: e,
|
|
91
|
-
label: t
|
|
92
|
-
}) => {
|
|
93
|
-
const n = e.filter(
|
|
94
|
-
(s) => s.keywords === t.first || s.keywords === t.second || s.alternateName === t.first || s.alternateName === t.second
|
|
95
|
-
);
|
|
96
|
-
return n.length === 0 ? e.slice(0, 2) : n;
|
|
97
|
-
}, E = (e) => {
|
|
98
|
-
const [t, n] = e.split("/").map(Number);
|
|
99
|
-
if (Number.isNaN(t) || Number.isNaN(n))
|
|
100
|
-
throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
|
|
101
|
-
return n / t;
|
|
102
|
-
}, L = (e, t, n) => {
|
|
103
|
-
t && (e ? (t.getAttribute("src") || (t.src = n ?? ""), t.play()) : t.pause());
|
|
104
|
-
}, ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
105
|
-
__proto__: null,
|
|
106
|
-
disableSKU: j,
|
|
107
|
-
formatPriceToCurrency: h,
|
|
108
|
-
freightParsePrice: O,
|
|
109
|
-
getAspectRatio: E,
|
|
110
|
-
getColorAndSizeFromSkuName: P,
|
|
111
|
-
getFirstImages: x,
|
|
112
|
-
getProductNameWithoutSku: F,
|
|
113
|
-
getSKUName: R,
|
|
114
|
-
getSkuInfos: C,
|
|
115
|
-
getThumbImage: A,
|
|
116
|
-
getValidOffer: T,
|
|
117
|
-
removeSlashes: z,
|
|
118
|
-
resizingImg: D,
|
|
119
|
-
setVideoPlay: L,
|
|
120
|
-
splitNameAndSizeFromFullName: I,
|
|
121
|
-
updatedResizedImg: B
|
|
122
|
-
}, Symbol.toStringTag, { value: "Module" })), b = "fuzzy", _ = "operator", U = (e) => ({
|
|
123
|
-
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
124
|
-
}), te = (e, t) => {
|
|
125
|
-
const n = decodeURIComponent(t ?? "").slice(1).split("/");
|
|
126
|
-
return e.map((s) => {
|
|
127
|
-
if (s.key === "category-2" && s.__typename === "FacetBoolean") {
|
|
128
|
-
const a = s.values;
|
|
129
|
-
return {
|
|
130
|
-
...s,
|
|
131
|
-
values: a.filter(
|
|
132
|
-
(o) => !n.find(
|
|
133
|
-
(r) => r.toLowerCase() === o.value || r.toLowerCase() === o.name.toLowerCase()
|
|
134
|
-
)
|
|
135
|
-
)
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
return s;
|
|
139
|
-
});
|
|
140
|
-
}, S = (e, t) => t ? e === "category-1" : !1, M = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), q = (e) => e.type === "TEXT", K = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), V = (e) => {
|
|
141
|
-
const { key: t, name: n, values: s } = e;
|
|
142
|
-
return {
|
|
143
|
-
__typename: "FacetBoolean",
|
|
144
|
-
key: t,
|
|
145
|
-
label: n,
|
|
146
|
-
values: s.slice().sort((a, o) => a.name.localeCompare(o.name))
|
|
147
|
-
};
|
|
148
|
-
}, Y = ({ key: e, values: t }) => ({
|
|
149
|
-
__typename: "FacetRange",
|
|
150
|
-
key: e,
|
|
151
|
-
values: t
|
|
152
|
-
}), ne = (e, t, n) => {
|
|
153
|
-
if (!(e instanceof Object) || !("facets" in e))
|
|
154
|
-
return [];
|
|
155
|
-
const { facets: s = [] } = e, a = t != null && t.length ? t[0].key === "category-1" : !1;
|
|
156
|
-
return s.filter(
|
|
157
|
-
(r) => !n || !S(r.key, a)
|
|
158
|
-
).map(
|
|
159
|
-
(r) => q(r) ? V(r) : Y(r)
|
|
160
|
-
);
|
|
161
|
-
}, se = (e, t) => {
|
|
162
|
-
const n = e.find(({ key: a }) => a === b) ?? null, s = e.find(({ key: a }) => a === _) ?? null;
|
|
163
|
-
n && K(n) && t.append(b, n.value), s && M(s) && t.append(_, s.value);
|
|
164
|
-
}, J = (e) => e.map((t) => {
|
|
165
|
-
const [n, s] = t.split("/");
|
|
166
|
-
return { key: n, value: s };
|
|
167
|
-
}), re = (e, t) => {
|
|
168
|
-
const n = decodeURIComponent(t ?? "").slice(1).split("/"), s = e.filter(({ value: o }) => !n.includes(decodeURIComponent(o))).map((o) => ({
|
|
169
|
-
...o,
|
|
170
|
-
value: decodeURIComponent(o.value)
|
|
171
|
-
})), { isDepartment: a } = U(s);
|
|
172
|
-
return s == null ? void 0 : s.filter((o) => !S(o.key, a));
|
|
173
|
-
}, ae = ({ pathname: e, searchParams: t }, n) => {
|
|
174
|
-
const s = t.get("sort") ?? "", a = t.get("query") ?? null, o = parseInt(t.get("page") ?? "1", 10);
|
|
175
|
-
return {
|
|
176
|
-
sort: s,
|
|
177
|
-
facets: J(n),
|
|
178
|
-
term: a,
|
|
179
|
-
base: a ? "" : e,
|
|
180
|
-
page: o
|
|
181
|
-
};
|
|
182
|
-
}, oe = (e) => {
|
|
183
|
-
const t = new URLSearchParams();
|
|
184
|
-
return Object.entries(e).forEach(([n, s]) => {
|
|
185
|
-
Array.isArray(s) ? s.forEach((a) => t.append(n, a)) : s !== void 0 && t.append(n, s);
|
|
186
|
-
}), t;
|
|
187
|
-
}, v = {
|
|
188
|
-
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
189
|
-
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
190
|
-
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
191
|
-
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
192
|
-
}, $ = {}, ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
193
|
-
__proto__: null,
|
|
194
|
-
default: $
|
|
195
|
-
}, Symbol.toStringTag, { value: "Module" })), le = ({
|
|
196
|
-
children: e,
|
|
197
|
-
data: t,
|
|
198
|
-
SectionZone: n,
|
|
199
|
-
className: s
|
|
200
|
-
}) => {
|
|
201
|
-
var d, l;
|
|
202
|
-
const a = ((d = t == null ? void 0 : t.filter((m) => {
|
|
203
|
-
var u, g;
|
|
204
|
-
return ((g = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : g.deviceType) === "mobile";
|
|
205
|
-
})[0]) == null ? void 0 : d.sections) || [], o = ((l = t == null ? void 0 : t.filter((m) => {
|
|
206
|
-
var u, g;
|
|
207
|
-
return ((g = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : g.deviceType) === "desktop";
|
|
208
|
-
})[0]) == null ? void 0 : l.sections) || [], r = a.slice(0, 1), i = a.slice(1, a.length), c = o.slice(0, 1), p = o.slice(1, o.length);
|
|
209
|
-
return /* @__PURE__ */ y(w, { children: [
|
|
210
|
-
/* @__PURE__ */ y("div", { className: s, children: [
|
|
211
|
-
/* @__PURE__ */ f("div", { className: v["responsive-mobile-flex"], children: /* @__PURE__ */ f(n, { data: r ?? [] }) }),
|
|
212
|
-
/* @__PURE__ */ f("div", { className: v["responsive-desktop-flex"], children: /* @__PURE__ */ f(n, { data: c ?? [] }) })
|
|
213
|
-
] }),
|
|
214
|
-
e,
|
|
215
|
-
/* @__PURE__ */ f("div", { className: v["responsive-mobile-flex"], children: /* @__PURE__ */ f(n, { data: i ?? [] }) }),
|
|
216
|
-
/* @__PURE__ */ f("div", { className: v["responsive-desktop-flex"], children: /* @__PURE__ */ f(n, { data: p ?? [] }) }),
|
|
217
|
-
/* @__PURE__ */ f(N.Divider, {})
|
|
218
|
-
] });
|
|
219
|
-
};
|
|
220
|
-
async function W({ contentType: e, storeId: t, CMS_PROJECT_NAME: n, NextCookies: s }) {
|
|
221
|
-
const a = await k({
|
|
222
|
-
contentType: e,
|
|
223
|
-
storeId: t,
|
|
224
|
-
CMS_PROJECT_NAME: n,
|
|
225
|
-
NextCookies: s
|
|
226
|
-
});
|
|
227
|
-
if (a.status === 200) {
|
|
228
|
-
const o = {
|
|
229
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
230
|
-
contentType: e,
|
|
231
|
-
data: a.data
|
|
232
|
-
};
|
|
233
|
-
console.log("Resultado da chamada:", a);
|
|
234
|
-
const r = `backup-${e}-${Date.now()}.json`;
|
|
235
|
-
return await $.writeFile(
|
|
236
|
-
`./backups/${r}`,
|
|
237
|
-
JSON.stringify(o, null, 2),
|
|
238
|
-
"utf-8"
|
|
239
|
-
), { success: !0, fileName: r };
|
|
240
|
-
}
|
|
241
|
-
return { success: !1, error: a.error || "No data to backup" };
|
|
242
|
-
}
|
|
243
|
-
async function G(e) {
|
|
244
|
-
return W(e);
|
|
245
|
-
}
|
|
246
|
-
async function H({
|
|
247
|
-
contentType: e,
|
|
248
|
-
documentId: t,
|
|
249
|
-
versionId: n,
|
|
250
|
-
storeId: s,
|
|
251
|
-
CMS_PROJECT_NAME: a
|
|
252
|
-
}) {
|
|
253
|
-
const o = t && t.length ? `/${t}` : "", r = n && n.length ? `?versionId=${n}` : "";
|
|
254
|
-
return fetch(
|
|
255
|
-
`https://${s}.myvtex.com/_v/cms/api/${a}/${e}${o}${r}`,
|
|
256
|
-
{ cache: "no-cache" }
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
async function X({
|
|
260
|
-
contentType: e,
|
|
261
|
-
documents: t,
|
|
262
|
-
NextCookies: n,
|
|
263
|
-
previewId: s,
|
|
264
|
-
CMS_PROJECT_NAME: a,
|
|
265
|
-
storeId: o
|
|
266
|
-
}) {
|
|
267
|
-
var i;
|
|
268
|
-
const r = JSON.parse(
|
|
269
|
-
s ?? ((i = n == null ? void 0 : n().get("cms_preview_data")) == null ? void 0 : i.value) ?? "{}"
|
|
270
|
-
);
|
|
271
|
-
if (r && (r == null ? void 0 : r.contentType) === e) {
|
|
272
|
-
const c = r.documentId && r.documentId.length ? `/${r.documentId}` : "", p = r != null && r.versionId && (r != null && r.versionId.length) ? `?versionId=${r == null ? void 0 : r.versionId}` : "", l = await (await fetch(
|
|
273
|
-
`https://${o}.myvtex.com/_v/cms/api/${a}/${e}${c}${p}`,
|
|
274
|
-
{ cache: "no-store" }
|
|
275
|
-
)).json(), m = t.filter(
|
|
276
|
-
(u) => l.id !== u.documentId
|
|
277
|
-
);
|
|
278
|
-
return m.unshift(l), m;
|
|
279
|
-
}
|
|
280
|
-
return t;
|
|
281
|
-
}
|
|
282
|
-
async function k({
|
|
283
|
-
contentType: e,
|
|
284
|
-
NextCookies: t,
|
|
285
|
-
CMS_PROJECT_NAME: n,
|
|
286
|
-
storeId: s,
|
|
287
|
-
previewId: a
|
|
288
|
-
}) {
|
|
289
|
-
var d, l;
|
|
290
|
-
const o = JSON.parse(
|
|
291
|
-
a ?? ((d = t == null ? void 0 : t().get("cms_preview_data")) == null ? void 0 : d.value) ?? "{}"
|
|
292
|
-
), r = [];
|
|
293
|
-
let i = 1, c = 0, p = !0;
|
|
294
|
-
try {
|
|
295
|
-
do {
|
|
296
|
-
const u = await (await fetch(
|
|
297
|
-
`https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`
|
|
298
|
-
)).json();
|
|
299
|
-
i === 1 && (c = u.totalItems), (l = u == null ? void 0 : u.data) != null && l.length && r.push(...u.data), p = u.hasNextPage, i++;
|
|
300
|
-
} while (p && r.length < c);
|
|
301
|
-
if (o.previewMode && r.length) {
|
|
302
|
-
const m = await X({
|
|
303
|
-
contentType: e,
|
|
304
|
-
documents: r,
|
|
305
|
-
NextCookies: t,
|
|
306
|
-
CMS_PROJECT_NAME: n,
|
|
307
|
-
storeId: s
|
|
308
|
-
});
|
|
309
|
-
return {
|
|
310
|
-
status: m.length > 0 ? 200 : 404,
|
|
311
|
-
data: m ?? []
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
return {
|
|
315
|
-
status: r.length ? 200 : 404,
|
|
316
|
-
data: r
|
|
317
|
-
};
|
|
318
|
-
} catch (m) {
|
|
319
|
-
return { status: "error", data: [], error: m };
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
const ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
323
|
-
__proto__: null,
|
|
324
|
-
cmsBackup: G,
|
|
325
|
-
getCMSContentType: H,
|
|
326
|
-
getContentType: k
|
|
327
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
328
|
-
export {
|
|
329
|
-
le as S,
|
|
330
|
-
ie as _,
|
|
331
|
-
C as a,
|
|
332
|
-
A as b,
|
|
333
|
-
oe as c,
|
|
334
|
-
R as d,
|
|
335
|
-
j as e,
|
|
336
|
-
ee as f,
|
|
337
|
-
P as g,
|
|
338
|
-
h,
|
|
339
|
-
O as i,
|
|
340
|
-
T as j,
|
|
341
|
-
x as k,
|
|
342
|
-
L as l,
|
|
343
|
-
D as m,
|
|
344
|
-
k as n,
|
|
345
|
-
se as o,
|
|
346
|
-
ae as p,
|
|
347
|
-
ne as q,
|
|
348
|
-
v as r,
|
|
349
|
-
I as s,
|
|
350
|
-
te as t,
|
|
351
|
-
B as u,
|
|
352
|
-
re as v,
|
|
353
|
-
ce as w
|
|
354
|
-
};
|
package/index-D__YfUie.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const f=require("react/jsx-runtime"),A=require("@soma-vertical-web/core-components"),b=(e,t=!0)=>Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL",minimumFractionDigits:t?2:0}).format(e),I=({valueInCents:e,hasFree:t,freeTaxMessage:n})=>e===0?t?n:b(0):b(e/100),g=(e,t)=>{const[n,s]=e.split(t);return{name:n.trim(),size:s?s.trim():""}},S=(e,t)=>{if(!e)return{};const[n,s]=e.split(t);return{color:n==null?void 0:n.trim(),size:s==null?void 0:s.trim()}},w=(e,t="tamanho")=>{if(e.additionalProperty){const[n]=e.additionalProperty;return n!=null&&n.name?n.name.toLocaleLowerCase()===t?n.value:e.name:""}return e.name},k=(e,t)=>e.replace(t,"").trim(),B=e=>e.replace(/\//g,""),$=({items:e,NAME_SPLIT_SYMBOL:t})=>{const n={price:0,listPrice:0,installments:{count:0,value:0}},s=(r,i)=>{var m;i&&(i.sellerId=r.sellerId,i.sellerName=r.sellerName,i.available=!0,i.isSellerDefault=r.sellerDefault);const{Price:l,ListPrice:_,PaymentOptions:{installmentOptions:u}}=r.commertialOffer;n.price=l,n.listPrice=_;const c=(m=u==null?void 0:u[0])==null?void 0:m.installments;if(c){const{count:d,value:p}=c[c.length-1];n.installments={count:d,value:p/100}}};let o=!0;const a=e.reduce((r,i)=>{var u;const l={name:i.name,sku:i.itemId,value:((u=i.Tamanho)==null?void 0:u[0])??g(i.nameComplete??i.name,t).size,available:!1,sellerId:"",sellerName:"",isSellerDefault:!1},_=i.sellers.filter(c=>(c.sellerDefault&&c.commertialOffer.IsAvailable&&(l.available=!0,s(c,l)),c.commertialOffer.IsAvailable));return!l.isSellerDefault&&_.length>0&&(l.available=!0,s(_[0],{...l,sellerId:_[0].sellerId,sellerName:_[0].sellerName})),l.available===!1&&(o=!1),r.push(l),r},[]);return{...n,sizes:a,allSizesAvailable:o}},C=e=>e?!e.offers.offers.find(({quantity:t=0})=>t>0):!1,N=(e,t)=>{const n=e.find(s=>s.availability.includes("InStock")&&s.quantity&&s.listPrice>0&&s.seller.identifier===t);return n||e.find(s=>s.availability.includes("InStock")&&s.quantity&&s.listPrice>0)},R=({images:e,TEXTURE_IMAGE:t})=>e.find(n=>t.includes(n.imageLabel))??e[0],T=(e,t)=>{const n=/\/ids\/(\d+)\//,s=e.match(n);return s?e.replace(`/${s[1]}/`,`/${s[1]}-${t.width}-${t.height}/`):e},P=(e,t)=>{const n=/\/ids\/(\d+)-(\d+)-(\d+)\//,s=e.match(n);return s?e.replace(`/${s[1]}-${s[2]}-${s[3]}/`,`/${s[1]}-${t.width}-${t.height}/`):e},z=({images:e,label:t})=>{const n=e.filter(s=>s.keywords===t.first||s.keywords===t.second||s.alternateName===t.first||s.alternateName===t.second);return n.length===0?e.slice(0,2):n},D=e=>{const[t,n]=e.split("/").map(Number);if(Number.isNaN(t)||Number.isNaN(n))throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");return n/t},O=(e,t,n)=>{t&&(e?(t.getAttribute("src")||(t.src=n??""),t.play()):t.pause())},U=Object.freeze(Object.defineProperty({__proto__:null,disableSKU:C,formatPriceToCurrency:b,freightParsePrice:I,getAspectRatio:D,getColorAndSizeFromSkuName:S,getFirstImages:z,getProductNameWithoutSku:k,getSKUName:w,getSkuInfos:$,getThumbImage:R,getValidOffer:N,removeSlashes:B,resizingImg:T,setVideoPlay:O,splitNameAndSizeFromFullName:g,updatedResizedImg:P},Symbol.toStringTag,{value:"Module"})),x="fuzzy",h="operator",E=e=>({isDepartment:e!=null&&e.length?e[0].key==="category-1":!1}),L=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/");return e.map(s=>{if(s.key==="category-2"&&s.__typename==="FacetBoolean"){const o=s.values;return{...s,values:o.filter(a=>!n.find(r=>r.toLowerCase()===a.value||r.toLowerCase()===a.name.toLowerCase()))}}return s})},F=(e,t)=>t?e==="category-1":!1,M=e=>e.key==="operator"&&(e.value==="and"||e.value==="or"),K=e=>e.type==="TEXT",V=e=>e.key==="fuzzy"&&(e.value==="0"||e.value==="1"||e.value==="auto"),q=e=>{const{key:t,name:n,values:s}=e;return{__typename:"FacetBoolean",key:t,label:n,values:s.slice().sort((o,a)=>o.name.localeCompare(a.name))}},H=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),W=(e,t,n)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:s=[]}=e,o=t!=null&&t.length?t[0].key==="category-1":!1;return s.filter(r=>!n||!F(r.key,o)).map(r=>K(r)?q(r):H(r))},Y=(e,t)=>{const n=e.find(({key:o})=>o===x)??null,s=e.find(({key:o})=>o===h)??null;n&&V(n)&&t.append(x,n.value),s&&M(s)&&t.append(h,s.value)},J=e=>e.map(t=>{const[n,s]=t.split("/");return{key:n,value:s}}),G=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/"),s=e.filter(({value:a})=>!n.includes(decodeURIComponent(a))).map(a=>({...a,value:decodeURIComponent(a.value)})),{isDepartment:o}=E(s);return s==null?void 0:s.filter(a=>!F(a.key,o))},X=({pathname:e,searchParams:t},n)=>{const s=t.get("sort")??"",o=t.get("query")??null,a=parseInt(t.get("page")??"1",10);return{sort:s,facets:J(n),term:o,base:o?"":e,page:a}},Q=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{Array.isArray(s)?s.forEach(o=>t.append(n,o)):s!==void 0&&t.append(n,s)}),t},y={"responsive-mobile-flex":"_responsive-mobile-flex_t5bry_2","responsive-desktop-flex":"_responsive-desktop-flex_t5bry_13","responsive-mobile-block":"_responsive-mobile-block_t5bry_24","responsive-desktop-block":"_responsive-desktop-block_t5bry_35"},j={},Z=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"})),ee="_header_1dxfy_40",te="_actions_1dxfy_61",ne="_breadcrumb_1dxfy_72",se="_credits_1dxfy_87",re="_pdplinks_1dxfy_112",oe="_similars_1dxfy_139",ae="_sizes_1dxfy_178",ie="_measurementTable_1dxfy_194",ce="_measurementHead_1dxfy_207",le="_measurementRows_1dxfy_212",de="_measurementRowsTitle_1dxfy_229",me="_measurementRowsText_1dxfy_241",_e="_measurementImage_1dxfy_252",ue="_measurementImageContainer_1dxfy_255",fe="_measurementContent_1dxfy_264",pe="_measurementTitle_1dxfy_268",ye="_measurementClose_1dxfy_279",be="_productref_1dxfy_344",ge="_slideOut_1dxfy_1",ve="_slideIn_1dxfy_1",xe="_content_1dxfy_324",he="_pdp_1dxfy_112",Ie="_divider_1dxfy_507",Se={"bottom-navigation":"_bottom-navigation_1dxfy_1","bottom-navigation__credits-modifier":"_bottom-navigation__credits-modifier_1dxfy_18","bottom-navigation__header":"_bottom-navigation__header_1dxfy_21","bottom-navigation__price-and-promo":"_bottom-navigation__price-and-promo_1dxfy_31",header:ee,actions:te,"add-to-cart":"_add-to-cart_1dxfy_68",breadcrumb:ne,"breadcrumb--active":"_breadcrumb--active_1dxfy_77",credits:se,"gallery-carousel-modifier":"_gallery-carousel-modifier_1dxfy_92",pdplinks:re,"links-wrapper":"_links-wrapper_1dxfy_122",similars:oe,"similars-info":"_similars-info_1dxfy_151","toggle-style-modifier":"_toggle-style-modifier_1dxfy_160","accessibility-info":"_accessibility-info_1dxfy_164",sizes:ae,"price-wrapper":"_price-wrapper_1dxfy_190",measurementTable:ie,measurementHead:ce,measurementRows:le,measurementRowsTitle:de,measurementRowsText:me,measurementImage:_e,measurementImageContainer:ue,measurementContent:fe,measurementTitle:pe,measurementClose:ye,"tabs-root-modifier":"_tabs-root-modifier_1dxfy_285","tabs-list-modifier":"_tabs-list-modifier_1dxfy_303","tabs-item-modifier":"_tabs-item-modifier_1dxfy_320","content-wrapper":"_content-wrapper_1dxfy_324",productref:be,"tabs-panel":"_tabs-panel_1dxfy_355","tabs-panel-exit":"_tabs-panel-exit_1dxfy_361",slideOut:ge,"tabs-panel-enter":"_tabs-panel-enter_1dxfy_365",slideIn:ve,content:xe,pdp:he,"pdp-main":"_pdp-main_1dxfy_423","pdp-main__gallery-wrapper":"_pdp-main__gallery-wrapper_1dxfy_428","pdp-main__info":"_pdp-main__info_1dxfy_445","pdp-main__info-main-content":"_pdp-main__info-main-content_1dxfy_465","pdp-main__info-subsection":"_pdp-main__info-subsection_1dxfy_465","subsection-product-info":"_subsection-product-info_1dxfy_476","subsection-similars":"_subsection-similars_1dxfy_479","subsection-sizes":"_subsection-sizes_1dxfy_482","subsection-actions":"_subsection-actions_1dxfy_485","pdp-main__info-secondary-content":"_pdp-main__info-secondary-content_1dxfy_489","sections-title":"_sections-title_1dxfy_495",divider:Ie,"breadcrumbs-desktop":"_breadcrumbs-desktop_1dxfy_512","breadcrumbs-mobile":"_breadcrumbs-mobile_1dxfy_521"},we=({children:e,data:t,SectionZone:n,className:s})=>{var u,c;const o=((u=t==null?void 0:t.filter(m=>{var d,p;return((p=(d=m.config)==null?void 0:d.responsive)==null?void 0:p.deviceType)==="mobile"})[0])==null?void 0:u.sections)||[],a=((c=t==null?void 0:t.filter(m=>{var d,p;return((p=(d=m.config)==null?void 0:d.responsive)==null?void 0:p.deviceType)==="desktop"})[0])==null?void 0:c.sections)||[],r=o.slice(0,1),i=o.slice(1,o.length),l=a.slice(0,1),_=a.slice(1,a.length);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:s,children:[f.jsx("div",{className:y["responsive-mobile-flex"],children:f.jsx(n,{data:r??[]})}),f.jsx("div",{className:y["responsive-desktop-flex"],children:f.jsx(n,{data:l??[]})})]}),e,f.jsx("div",{className:y["responsive-mobile-flex"],children:f.jsx(n,{data:i??[]})}),f.jsx("div",{className:y["responsive-desktop-flex"],children:f.jsx(n,{data:_??[]})}),f.jsx(A.Utils.Divider,{})]})};async function ke({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:s}){const o=await v({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:s});if(o.status===200){const a={timestamp:new Date().toISOString(),contentType:e,data:o.data};console.log("Resultado da chamada:",o);const r=`backup-${e}-${Date.now()}.json`;return await j.writeFile(`./backups/${r}`,JSON.stringify(a,null,2),"utf-8"),{success:!0,fileName:r}}return{success:!1,error:o.error||"No data to backup"}}async function $e(e){return ke(e)}async function Ce({contentType:e,documentId:t,versionId:n,storeId:s,CMS_PROJECT_NAME:o}){const a=t&&t.length?`/${t}`:"",r=n&&n.length?`?versionId=${n}`:"";return fetch(`https://${s}.myvtex.com/_v/cms/api/${o}/${e}${a}${r}`,{cache:"no-cache"})}async function Ne({contentType:e,documents:t,NextCookies:n,previewId:s,CMS_PROJECT_NAME:o,storeId:a}){var i;const r=JSON.parse(s??((i=n==null?void 0:n().get("cms_preview_data"))==null?void 0:i.value)??"{}");if(r&&(r==null?void 0:r.contentType)===e){const l=r.documentId&&r.documentId.length?`/${r.documentId}`:"",_=r!=null&&r.versionId&&(r!=null&&r.versionId.length)?`?versionId=${r==null?void 0:r.versionId}`:"",c=await(await fetch(`https://${a}.myvtex.com/_v/cms/api/${o}/${e}${l}${_}`,{cache:"no-store"})).json(),m=t.filter(d=>c.id!==d.documentId);return m.unshift(c),m}return t}async function v({contentType:e,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s,previewId:o}){var u,c;const a=JSON.parse(o??((u=t==null?void 0:t().get("cms_preview_data"))==null?void 0:u.value)??"{}"),r=[];let i=1,l=0,_=!0;try{do{const d=await(await fetch(`https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`)).json();i===1&&(l=d.totalItems),(c=d==null?void 0:d.data)!=null&&c.length&&r.push(...d.data),_=d.hasNextPage,i++}while(_&&r.length<l);if(a.previewMode&&r.length){const m=await Ne({contentType:e,documents:r,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s});return{status:m.length>0?200:404,data:m??[]}}return{status:r.length?200:404,data:r}}catch(m){return{status:"error",data:[],error:m}}}const Re=Object.freeze(Object.defineProperty({__proto__:null,cmsBackup:$e,getCMSContentType:Ce,getContentType:v},Symbol.toStringTag,{value:"Module"}));exports.SearchPageScreening=we;exports.__viteBrowserExternal=Z;exports.addSearchParamsFacets=Y;exports.cms=Re;exports.convertSearchParams=Q;exports.disableSKU=C;exports.filterNonCategorySelected=L;exports.filterNonRootFacets=G;exports.formatPriceToCurrency=b;exports.formattedFacets=W;exports.freightParsePrice=I;exports.getColorAndSizeFromSkuName=S;exports.getContentType=v;exports.getFirstImages=z;exports.getProductNameWithoutSku=k;exports.getSKUName=w;exports.getSkuInfos=$;exports.getThumbImage=R;exports.getValidOffer=N;exports.parseSearchState=X;exports.productHelpers=U;exports.resizingImg=T;exports.responsive=y;exports.setVideoPlay=O;exports.splitNameAndSizeFromFullName=g;exports.styles=Se;exports.updatedResizedImg=P;
|