@soma-vertical-web/multi-lib 0.0.52 → 0.0.54

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