@soma-vertical-web/multi-lib 0.0.41 → 0.0.43

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