@soma-vertical-web/multi-lib 0.0.61 → 0.0.63

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