@soma-vertical-web/multi-lib 0.0.48 → 0.0.49
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/cms/ContentTypes/Redirects/Redirects.d.ts +32 -0
- package/cms/ContentTypes/Search/SearchContent.d.ts +3 -0
- package/cms/ContentTypes/Search/SearchPageContent.d.ts +3 -0
- package/cms/ContentTypes/Search/SearchPageScreening.d.ts +3 -0
- package/cms/server.d.ts +30 -0
- package/index-BJzBUeMp.js +1 -0
- package/index-Ba7fQCkk.js +1 -0
- package/index-Do5eAlCL.mjs +219 -0
- package/index-VkanwPXK.mjs +221 -0
- package/index2.js +1 -1
- package/index2.mjs +322 -268
- package/package.json +1 -1
- package/types/cms/ContentTypes/Redirects/index.d.ts +4 -0
package/index2.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as n from "yup";
|
|
2
|
-
import { f as
|
|
2
|
+
import { f as ae, r as N, a as se, b as ie, d as ce, e as le, c as ue, p as de } from "./__vite-browser-external-C4n7rb1H.mjs";
|
|
3
3
|
import { jsxs as z, Fragment as G, jsx as I } from "react/jsx-runtime";
|
|
4
4
|
import { Utils as j, helpers as B } from "@soma-vertical-web/core-components";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import pe from "sanitize-html";
|
|
6
|
+
const h = async (e, t = {}) => {
|
|
7
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,
|
|
@@ -20,12 +20,12 @@ const g = async (e, t = {}) => {
|
|
|
20
20
|
console.error("[ERROR FETCH VTEX]", c);
|
|
21
21
|
});
|
|
22
22
|
}, P = /* @__PURE__ */ new Map();
|
|
23
|
-
async function
|
|
23
|
+
async function me(e, t = {}) {
|
|
24
24
|
var o;
|
|
25
25
|
try {
|
|
26
26
|
const { abort: r = !1 } = t, s = new AbortController();
|
|
27
27
|
r && (P.has(e) && ((o = P.get(e)) == null || o.abort(), P.delete(e)), P.set(e, s));
|
|
28
|
-
const a =
|
|
28
|
+
const a = h(e, {
|
|
29
29
|
...t,
|
|
30
30
|
...r ? { signal: s.signal } : {}
|
|
31
31
|
});
|
|
@@ -49,7 +49,7 @@ async function ge({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
49
49
|
}
|
|
50
50
|
await fe.validate(t);
|
|
51
51
|
const { country: r, postalCode: s } = t;
|
|
52
|
-
return await
|
|
52
|
+
return await h(
|
|
53
53
|
`${e}/api/checkout/pub/postal-code/${r}/${s}`,
|
|
54
54
|
{
|
|
55
55
|
method: "POST",
|
|
@@ -74,7 +74,7 @@ async function Q({
|
|
|
74
74
|
}
|
|
75
75
|
await he.validate(t);
|
|
76
76
|
const { orderFormId: r, sellerCode: s, sellerName: a } = t, i = s ? `${s.trim()} - ${a}` : null;
|
|
77
|
-
return
|
|
77
|
+
return h(
|
|
78
78
|
`${e}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
|
|
79
79
|
{
|
|
80
80
|
method: "POST",
|
|
@@ -100,7 +100,7 @@ async function J({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
100
100
|
utmCampaign: s ? s.toUpperCase() : "",
|
|
101
101
|
utmiCampaign: s ? "codigodavendedora" : "semcodigo"
|
|
102
102
|
} : {};
|
|
103
|
-
return
|
|
103
|
+
return h(
|
|
104
104
|
`${e}/api/checkout/pub/orderForm/${r}/attachments/marketingData`,
|
|
105
105
|
{
|
|
106
106
|
method: "POST",
|
|
@@ -112,17 +112,17 @@ async function J({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const ye = 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
|
|
120
|
+
async function be({ 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
|
|
125
|
+
await ye.validate(t);
|
|
126
126
|
const r = await Q({ apiUrl: e, body: t, fetchOptions: o });
|
|
127
127
|
return J({
|
|
128
128
|
apiUrl: e,
|
|
@@ -133,11 +133,11 @@ async function ye({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
133
133
|
fetchOptions: o
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
const
|
|
136
|
+
const Ce = n.object({
|
|
137
137
|
orderFormId: n.string().nullable(),
|
|
138
138
|
coupon: n.string().nullable()
|
|
139
139
|
});
|
|
140
|
-
async function
|
|
140
|
+
async function ve({
|
|
141
141
|
apiUrl: e,
|
|
142
142
|
body: t,
|
|
143
143
|
fetchOptions: o
|
|
@@ -146,9 +146,9 @@ async function Ce({
|
|
|
146
146
|
console.error("[ERROR FETCHING] Body is required");
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
await
|
|
149
|
+
await Ce.validate(t);
|
|
150
150
|
const { coupon: r = "", orderFormId: s } = t;
|
|
151
|
-
return
|
|
151
|
+
return h(
|
|
152
152
|
`${e}/api/checkout/pub/orderForm/${s}/coupons`,
|
|
153
153
|
{
|
|
154
154
|
method: "POST",
|
|
@@ -173,7 +173,7 @@ async function Fe({
|
|
|
173
173
|
}
|
|
174
174
|
await Re.validate(t);
|
|
175
175
|
const { appId: r = "faststore", orderFormId: s, key: a } = t;
|
|
176
|
-
return
|
|
176
|
+
return h(
|
|
177
177
|
`${e}/api/checkout/pub/orderForm/${s}/customData/${r}/${a}`,
|
|
178
178
|
{
|
|
179
179
|
method: "PUT",
|
|
@@ -181,23 +181,23 @@ async function Fe({
|
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const Se = n.object().shape({
|
|
185
185
|
name: n.string().required("Attachment name is required"),
|
|
186
186
|
content: n.object().nullable()
|
|
187
187
|
});
|
|
188
188
|
var M;
|
|
189
|
-
const
|
|
190
|
-
attachments: (M = n.array().of(
|
|
189
|
+
const $e = n.object().shape({
|
|
190
|
+
attachments: (M = n.array().of(Se)) == 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
|
-
}),
|
|
196
|
+
}), Te = n.object({
|
|
197
197
|
orderFormId: n.string().required("OrderFormId is required"),
|
|
198
|
-
orderItems: n.array().of(
|
|
198
|
+
orderItems: n.array().of($e)
|
|
199
199
|
});
|
|
200
|
-
async function
|
|
200
|
+
async function Oe({
|
|
201
201
|
apiUrl: e,
|
|
202
202
|
body: t,
|
|
203
203
|
fetchOptions: o
|
|
@@ -206,9 +206,9 @@ async function Te({
|
|
|
206
206
|
console.error("[ERROR FETCHING] Body is required");
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
await
|
|
209
|
+
await Te.validate(t);
|
|
210
210
|
const { orderFormId: r, orderItems: s } = t;
|
|
211
|
-
return
|
|
211
|
+
return h(
|
|
212
212
|
`${e}/api/checkout/pub/orderForm/${r}/items`,
|
|
213
213
|
{
|
|
214
214
|
method: "POST",
|
|
@@ -217,10 +217,10 @@ async function Te({
|
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const qe = n.object({
|
|
221
221
|
orderFormId: n.string().nullable()
|
|
222
222
|
});
|
|
223
|
-
async function
|
|
223
|
+
async function Ee({
|
|
224
224
|
apiUrl: e,
|
|
225
225
|
body: t,
|
|
226
226
|
fetchOptions: o
|
|
@@ -229,9 +229,9 @@ async function qe({
|
|
|
229
229
|
console.error("[ERROR FETCHING] Body is required");
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
await
|
|
232
|
+
await qe.validate(t);
|
|
233
233
|
const { orderFormId: r } = t;
|
|
234
|
-
return
|
|
234
|
+
return h(
|
|
235
235
|
`${e}/api/checkout/pub/orderForm/${r}/items/removeAll`,
|
|
236
236
|
{
|
|
237
237
|
method: "POST",
|
|
@@ -239,13 +239,13 @@ async function qe({
|
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
-
const
|
|
242
|
+
const we = n.object().shape({
|
|
243
243
|
name: n.string().required("Attachment name is required"),
|
|
244
244
|
content: n.object().nullable()
|
|
245
245
|
});
|
|
246
246
|
var x;
|
|
247
|
-
const
|
|
248
|
-
attachments: (x = n.array().of(
|
|
247
|
+
const Ae = n.object().shape({
|
|
248
|
+
attachments: (x = n.array().of(we)) == 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(),
|
|
@@ -253,9 +253,9 @@ const ke = n.object().shape({
|
|
|
253
253
|
price: n.number().integer()
|
|
254
254
|
}), Pe = n.object({
|
|
255
255
|
orderFormId: n.string().nullable(),
|
|
256
|
-
orderItems: n.array().of(
|
|
256
|
+
orderItems: n.array().of(Ae)
|
|
257
257
|
});
|
|
258
|
-
async function
|
|
258
|
+
async function ke({
|
|
259
259
|
apiUrl: e,
|
|
260
260
|
body: t,
|
|
261
261
|
fetchOptions: o
|
|
@@ -266,7 +266,7 @@ async function Ne({
|
|
|
266
266
|
}
|
|
267
267
|
await Pe.validate(t);
|
|
268
268
|
const { orderFormId: r, orderItems: s } = t;
|
|
269
|
-
return
|
|
269
|
+
return h(
|
|
270
270
|
`${e}/api/checkout/pub/orderForm/${r}/items/update`,
|
|
271
271
|
{
|
|
272
272
|
method: "POST",
|
|
@@ -275,7 +275,7 @@ async function Ne({
|
|
|
275
275
|
}
|
|
276
276
|
);
|
|
277
277
|
}
|
|
278
|
-
const
|
|
278
|
+
const Ne = n.object({
|
|
279
279
|
orderFormId: n.string().nullable()
|
|
280
280
|
});
|
|
281
281
|
async function je({
|
|
@@ -287,9 +287,9 @@ async function je({
|
|
|
287
287
|
console.error("[ERROR FETCHING] Body is required");
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
await
|
|
290
|
+
await Ne.validate(t);
|
|
291
291
|
const { orderFormId: r } = t;
|
|
292
|
-
return
|
|
292
|
+
return h(
|
|
293
293
|
`${e}/api/checkout/pub/orderForm/${r}/messages/clear`,
|
|
294
294
|
{
|
|
295
295
|
method: "POST",
|
|
@@ -304,20 +304,20 @@ const De = n.object({
|
|
|
304
304
|
orderFormId: n.string().nullable(),
|
|
305
305
|
remove: n.boolean().nullable()
|
|
306
306
|
});
|
|
307
|
-
async function
|
|
307
|
+
async function _e({ 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
312
|
await De.validate(t);
|
|
313
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
|
|
314
|
+
return h(u, {
|
|
315
315
|
method: "POST",
|
|
316
316
|
body: { id: a },
|
|
317
317
|
...o
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const He = n.object({
|
|
321
321
|
orderFormId: n.string().nullable()
|
|
322
322
|
});
|
|
323
323
|
async function Be({
|
|
@@ -331,11 +331,11 @@ async function Be({
|
|
|
331
331
|
console.error("[ERROR FETCHING] Body is required");
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
await
|
|
334
|
+
await He.validate(t);
|
|
335
335
|
const s = new URLSearchParams({
|
|
336
336
|
refreshOutdatedData: "true"
|
|
337
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
|
|
338
|
+
return h(a, { method: "GET", ...o });
|
|
339
339
|
}
|
|
340
340
|
const Ge = n.object({
|
|
341
341
|
orderFormId: n.string().nullable(),
|
|
@@ -346,7 +346,7 @@ const Ge = 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
|
|
349
|
+
async function Le({
|
|
350
350
|
apiUrl: e,
|
|
351
351
|
body: t,
|
|
352
352
|
fetchOptions: o
|
|
@@ -357,7 +357,7 @@ async function Ue({
|
|
|
357
357
|
}
|
|
358
358
|
await Ge.validate(t);
|
|
359
359
|
const { orderFormId: r, ...s } = t;
|
|
360
|
-
return
|
|
360
|
+
return h(
|
|
361
361
|
`${e}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
|
|
362
362
|
{
|
|
363
363
|
method: "POST",
|
|
@@ -366,10 +366,10 @@ async function Ue({
|
|
|
366
366
|
}
|
|
367
367
|
);
|
|
368
368
|
}
|
|
369
|
-
const
|
|
369
|
+
const Ue = n.object({
|
|
370
370
|
sellerCode: n.string().nullable()
|
|
371
371
|
});
|
|
372
|
-
async function
|
|
372
|
+
async function Ve({
|
|
373
373
|
apiUrl: e,
|
|
374
374
|
body: t,
|
|
375
375
|
fetchOptions: o
|
|
@@ -378,9 +378,9 @@ async function Le({
|
|
|
378
378
|
console.error("[ERROR FETCHING] Body is required");
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
|
-
await
|
|
381
|
+
await Ue.validate(t);
|
|
382
382
|
const { sellerCode: r = "" } = t;
|
|
383
|
-
return
|
|
383
|
+
return h(
|
|
384
384
|
`${e}/api/dataentities/VD/search?_fields=id,cod,name,ativo&cod=${r}`,
|
|
385
385
|
{
|
|
386
386
|
method: "GET",
|
|
@@ -416,7 +416,7 @@ async function xe({
|
|
|
416
416
|
logisticsInfo: [],
|
|
417
417
|
clearAddressIfPostalCodeNotFound: !0
|
|
418
418
|
};
|
|
419
|
-
return
|
|
419
|
+
return h(
|
|
420
420
|
`${e}/api/checkout/pub/orderForm/${s}/attachments/shippingData`,
|
|
421
421
|
{
|
|
422
422
|
method: "POST",
|
|
@@ -460,7 +460,7 @@ async function Qe({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
460
460
|
}
|
|
461
461
|
await ze.validate(t);
|
|
462
462
|
const { orderFormId: r, options: s, selectedAddresses: a } = t;
|
|
463
|
-
return
|
|
463
|
+
return h(
|
|
464
464
|
`${e}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
|
|
465
465
|
{
|
|
466
466
|
method: "POST",
|
|
@@ -491,7 +491,7 @@ async function Ke({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
491
491
|
return a ? i.append("postalCode", a) : i.append(
|
|
492
492
|
"geoCoordinates",
|
|
493
493
|
`${s == null ? void 0 : s.longitude};${s == null ? void 0 : s.latitude}`
|
|
494
|
-
), await
|
|
494
|
+
), await h(
|
|
495
495
|
`${e}/api/checkout/pub/regions/?${i.toString()}`,
|
|
496
496
|
{
|
|
497
497
|
method: "GET",
|
|
@@ -514,7 +514,7 @@ async function Ye({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
514
514
|
console.error("[ERROR FETCHING] Body is required");
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
|
-
return await Xe.validate(t),
|
|
517
|
+
return await Xe.validate(t), h(
|
|
518
518
|
`${e}/api/checkout/pub/orderForms/simulation`,
|
|
519
519
|
{
|
|
520
520
|
method: "POST",
|
|
@@ -525,24 +525,24 @@ async function Ye({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
525
525
|
}
|
|
526
526
|
const Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
527
527
|
__proto__: null,
|
|
528
|
-
getMasterDataSellerCode:
|
|
528
|
+
getMasterDataSellerCode: Ve,
|
|
529
529
|
getOrderForm: Be,
|
|
530
|
-
postOrderFormAddCoupon:
|
|
531
|
-
postOrderFormAttachClientProfileData:
|
|
532
|
-
postOrderFormAttachOrderFormData:
|
|
530
|
+
postOrderFormAddCoupon: ve,
|
|
531
|
+
postOrderFormAttachClientProfileData: Le,
|
|
532
|
+
postOrderFormAttachOrderFormData: be,
|
|
533
533
|
postOrderFormAttachShippingData: xe,
|
|
534
534
|
postOrderFormAttachmentsMarketingData: J,
|
|
535
535
|
postOrderFormAttachmentsOpenTextField: Q,
|
|
536
536
|
postOrderFormClearMessages: je,
|
|
537
537
|
postOrderFormFreightSimulation: Ye,
|
|
538
|
-
postOrderFormItems:
|
|
538
|
+
postOrderFormItems: Oe,
|
|
539
539
|
postOrderFormRegion: Ke,
|
|
540
|
-
postOrderFormRemoveAllItems:
|
|
541
|
-
postOrderFormUpdateItems:
|
|
540
|
+
postOrderFormRemoveAllItems: Ee,
|
|
541
|
+
postOrderFormUpdateItems: ke,
|
|
542
542
|
postOrderFormUpdateShippingData: Qe,
|
|
543
543
|
postOrderformAddress: ge,
|
|
544
544
|
putOrderFormCustomData: Fe,
|
|
545
|
-
updateOrderFormOffering:
|
|
545
|
+
updateOrderFormOffering: _e
|
|
546
546
|
}, Symbol.toStringTag, { value: "Module" })), et = n.object({
|
|
547
547
|
skuId: n.string()
|
|
548
548
|
});
|
|
@@ -553,7 +553,7 @@ async function tt({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
553
553
|
}
|
|
554
554
|
await et.validate(t);
|
|
555
555
|
const { skuId: r } = t;
|
|
556
|
-
return
|
|
556
|
+
return h(
|
|
557
557
|
`${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
|
|
558
558
|
{
|
|
559
559
|
...o
|
|
@@ -570,7 +570,7 @@ async function ot({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
570
570
|
}
|
|
571
571
|
await rt.validate(t);
|
|
572
572
|
const { ids: r } = t;
|
|
573
|
-
return
|
|
573
|
+
return h(
|
|
574
574
|
`${e}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
|
|
575
575
|
{
|
|
576
576
|
...o
|
|
@@ -580,30 +580,30 @@ async function ot({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
|
580
580
|
const nt = n.object({
|
|
581
581
|
productId: n.number().required("Product ID is required")
|
|
582
582
|
});
|
|
583
|
-
async function
|
|
583
|
+
async function at({ 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
588
|
await nt.validate(t);
|
|
589
589
|
const { productId: r } = t;
|
|
590
|
-
return
|
|
590
|
+
return h(
|
|
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
|
|
597
|
+
const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
598
598
|
__proto__: null,
|
|
599
599
|
getCatalogKitProducts: tt,
|
|
600
600
|
getCatalogProducts: ot,
|
|
601
|
-
getCatalogSimilars:
|
|
602
|
-
}, Symbol.toStringTag, { value: "Module" })), it = (e = "") => e.charAt(0).toUpperCase() + e.slice(1),
|
|
601
|
+
getCatalogSimilars: at
|
|
602
|
+
}, Symbol.toStringTag, { value: "Module" })), it = (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(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((a) =>
|
|
606
|
+
Title: `${Array.isArray(o) ? o.map((a) => L(a)).join(",") : L(o)} - ${t.title}`,
|
|
607
607
|
MetaTagDescription: t.description,
|
|
608
608
|
name: r,
|
|
609
609
|
hasChildren: !1,
|
|
@@ -630,14 +630,14 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
630
630
|
)) ?? s;
|
|
631
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
|
-
},
|
|
633
|
+
}, pt = /* @__PURE__ */ new Set([
|
|
634
634
|
"brand",
|
|
635
635
|
"category",
|
|
636
636
|
"department",
|
|
637
637
|
"subcategory",
|
|
638
638
|
"collection",
|
|
639
639
|
"cluster"
|
|
640
|
-
]),
|
|
640
|
+
]), mt = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && pt.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"],
|
|
@@ -662,12 +662,12 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
662
662
|
createSeoCategory: lt,
|
|
663
663
|
findCategory: ut,
|
|
664
664
|
formattedSimilars: gt,
|
|
665
|
-
isCollectionPageType:
|
|
665
|
+
isCollectionPageType: mt,
|
|
666
666
|
notFindCategoryError: dt,
|
|
667
667
|
responseAdapter: ft
|
|
668
668
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
669
669
|
async function It({ contentType: e, storeId: t, CMS_PROJECT_NAME: o, NextCookies: r }) {
|
|
670
|
-
const s = await
|
|
670
|
+
const s = await b({
|
|
671
671
|
contentType: e,
|
|
672
672
|
storeId: t,
|
|
673
673
|
CMS_PROJECT_NAME: o,
|
|
@@ -681,7 +681,7 @@ async function It({ contentType: e, storeId: t, CMS_PROJECT_NAME: o, NextCookies
|
|
|
681
681
|
};
|
|
682
682
|
console.log("Resultado da chamada:", s);
|
|
683
683
|
const i = `backup-${e}-${Date.now()}.json`;
|
|
684
|
-
return await
|
|
684
|
+
return await ae.writeFile(
|
|
685
685
|
`./backups/${i}`,
|
|
686
686
|
JSON.stringify(a, null, 2),
|
|
687
687
|
"utf-8"
|
|
@@ -689,10 +689,10 @@ async function It({ contentType: e, storeId: t, CMS_PROJECT_NAME: o, NextCookies
|
|
|
689
689
|
}
|
|
690
690
|
return { success: !1, error: s.error || "No data to backup" };
|
|
691
691
|
}
|
|
692
|
-
async function
|
|
692
|
+
async function yt(e) {
|
|
693
693
|
return It(e);
|
|
694
694
|
}
|
|
695
|
-
async function
|
|
695
|
+
async function bt({
|
|
696
696
|
contentType: e,
|
|
697
697
|
documentId: t,
|
|
698
698
|
versionId: o,
|
|
@@ -705,7 +705,7 @@ async function yt({
|
|
|
705
705
|
{ cache: "no-cache" }
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
|
-
async function
|
|
708
|
+
async function Ct({
|
|
709
709
|
contentType: e,
|
|
710
710
|
documents: t,
|
|
711
711
|
NextCookies: o,
|
|
@@ -717,36 +717,36 @@ async function vt({
|
|
|
717
717
|
((i = o().get("cms_preview_data")) == null ? void 0 : i.value) ?? "{}"
|
|
718
718
|
);
|
|
719
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}` : "",
|
|
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}` : "", f = await (await fetch(
|
|
721
721
|
`https://${s}.myvtex.com/_v/cms/api/${r}/${e}${c}${u}`,
|
|
722
722
|
{ cache: "no-store" }
|
|
723
723
|
)).json(), l = t.filter(
|
|
724
|
-
(
|
|
724
|
+
(p) => f.id !== p.documentId
|
|
725
725
|
);
|
|
726
|
-
return l.unshift(
|
|
726
|
+
return l.unshift(f), l;
|
|
727
727
|
}
|
|
728
728
|
return t;
|
|
729
729
|
}
|
|
730
|
-
async function
|
|
730
|
+
async function b({
|
|
731
731
|
contentType: e,
|
|
732
732
|
NextCookies: t,
|
|
733
733
|
CMS_PROJECT_NAME: o,
|
|
734
734
|
storeId: r
|
|
735
735
|
}) {
|
|
736
|
-
var d,
|
|
736
|
+
var d, f;
|
|
737
737
|
const s = JSON.parse(
|
|
738
738
|
((d = t().get("cms_preview_data")) == null ? void 0 : d.value) ?? "{}"
|
|
739
739
|
), a = [];
|
|
740
740
|
let i = 1, c = 0, u = !0;
|
|
741
741
|
try {
|
|
742
742
|
do {
|
|
743
|
-
const
|
|
743
|
+
const p = await (await fetch(
|
|
744
744
|
`https://${r}.myvtex.com/_v/cms/api/${o}/${e}?page=${i}`
|
|
745
745
|
)).json();
|
|
746
|
-
i === 1 && (c =
|
|
746
|
+
i === 1 && (c = p.totalItems), (f = p == null ? void 0 : p.data) != null && f.length && a.push(...p.data), u = p.hasNextPage, i++;
|
|
747
747
|
} while (u && a.length < c);
|
|
748
748
|
if (s.previewMode && a.length) {
|
|
749
|
-
const l = await
|
|
749
|
+
const l = await Ct({
|
|
750
750
|
contentType: e,
|
|
751
751
|
documents: a,
|
|
752
752
|
NextCookies: t,
|
|
@@ -766,11 +766,11 @@ async function R({
|
|
|
766
766
|
return { status: "error", data: [], error: l };
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
|
-
const
|
|
769
|
+
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
770
770
|
__proto__: null,
|
|
771
|
-
cmsBackup:
|
|
772
|
-
getCMSContentType:
|
|
773
|
-
getContentType:
|
|
771
|
+
cmsBackup: yt,
|
|
772
|
+
getCMSContentType: bt,
|
|
773
|
+
getContentType: b
|
|
774
774
|
}, Symbol.toStringTag, { value: "Module" })), Rt = ({
|
|
775
775
|
slug: e,
|
|
776
776
|
data: t,
|
|
@@ -778,14 +778,14 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
778
778
|
COMMON_PAGE_COLUMN_GAP: r
|
|
779
779
|
}) => {
|
|
780
780
|
const s = t == null ? void 0 : t.find(
|
|
781
|
-
(
|
|
782
|
-
var l,
|
|
783
|
-
return ((
|
|
781
|
+
(f) => {
|
|
782
|
+
var l, p, g, m;
|
|
783
|
+
return ((p = (l = f.config) == null ? void 0 : l.responsive) == null ? void 0 : p.deviceType) === "desktop" && ((m = (g = f.config) == null ? void 0 : g.seo) == null ? void 0 : m.slug) === e;
|
|
784
784
|
}
|
|
785
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
|
-
(
|
|
787
|
-
var l,
|
|
788
|
-
return ((
|
|
786
|
+
(f) => {
|
|
787
|
+
var l, p, g, m;
|
|
788
|
+
return ((p = (l = f.config) == null ? void 0 : l.responsive) == null ? void 0 : p.deviceType) === "mobile" && ((m = (g = f.config) == null ? void 0 : g.seo) == null ? void 0 : m.slug) === e;
|
|
789
789
|
}
|
|
790
790
|
), u = c == null ? void 0 : c.config.responsive.gapCustom, d = c == null ? void 0 : c.config.responsive.gapSections;
|
|
791
791
|
return /* @__PURE__ */ z(G, { children: [
|
|
@@ -794,7 +794,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
794
794
|
{
|
|
795
795
|
gap: a && i ? i : r,
|
|
796
796
|
className: B.classNameConcat(
|
|
797
|
-
|
|
797
|
+
N["responsive-desktop-flex"],
|
|
798
798
|
"utils-column-modifier"
|
|
799
799
|
),
|
|
800
800
|
children: /* @__PURE__ */ I(o, { data: (s == null ? void 0 : s.sections) ?? [] })
|
|
@@ -805,7 +805,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
805
805
|
{
|
|
806
806
|
gap: u && d ? d : r,
|
|
807
807
|
className: B.classNameConcat(
|
|
808
|
-
|
|
808
|
+
N["responsive-mobile-flex"],
|
|
809
809
|
"utils-column-modifier"
|
|
810
810
|
),
|
|
811
811
|
children: /* @__PURE__ */ I(o, { data: (c == null ? void 0 : c.sections) ?? [] })
|
|
@@ -818,7 +818,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
818
818
|
COMMON_PAGE_COLUMN_GAP: o,
|
|
819
819
|
...r
|
|
820
820
|
}) => {
|
|
821
|
-
const { data: s } = await
|
|
821
|
+
const { data: s } = await b({
|
|
822
822
|
contentType: "common_page",
|
|
823
823
|
...r
|
|
824
824
|
});
|
|
@@ -831,7 +831,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
831
831
|
COMMON_PAGE_COLUMN_GAP: o
|
|
832
832
|
}
|
|
833
833
|
);
|
|
834
|
-
},
|
|
834
|
+
}, St = async ({
|
|
835
835
|
PAYMENT_FLAGS_DICTIONARY: e,
|
|
836
836
|
PAYMENT_FLAGS: t,
|
|
837
837
|
LEGAL_INFORMATION_TEXT: o,
|
|
@@ -841,16 +841,16 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
841
841
|
FooterSupport: i,
|
|
842
842
|
...c
|
|
843
843
|
}) => {
|
|
844
|
-
var l,
|
|
845
|
-
const { data: u } = await
|
|
844
|
+
var l, p, g, m, $, F, S, T, O, q, y, E;
|
|
845
|
+
const { data: u } = await b({
|
|
846
846
|
contentType: "footer",
|
|
847
847
|
...c
|
|
848
|
-
}), d = Array.isArray(u) && ((
|
|
849
|
-
...(
|
|
848
|
+
}), d = Array.isArray(u) && ((p = (l = u[0]) == null ? void 0 : l.name) == null ? void 0 : p.toLowerCase()) === "footer" ? u[0] : null, f = {
|
|
849
|
+
...(g = d == null ? void 0 : d.paymentInfo) == null ? void 0 : g.paymentInfo,
|
|
850
850
|
acceptedFlags: Array.isArray(
|
|
851
|
-
(
|
|
852
|
-
) ? (
|
|
853
|
-
(
|
|
851
|
+
(m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags
|
|
852
|
+
) ? ($ = d == null ? void 0 : d.paymentInfo) == null ? void 0 : $.paymentInfo.acceptedFlags.filter((C) => !!e[C]).map(
|
|
853
|
+
(C) => e[C]
|
|
854
854
|
) : []
|
|
855
855
|
};
|
|
856
856
|
return d ? /* @__PURE__ */ I(
|
|
@@ -858,14 +858,14 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
858
858
|
{
|
|
859
859
|
data: { ...d },
|
|
860
860
|
socialInfo: (F = d.socialMedia) == null ? void 0 : F.socialMedia,
|
|
861
|
-
socialMedias: (
|
|
862
|
-
payments:
|
|
861
|
+
socialMedias: (T = (S = d.socialMedia) == null ? void 0 : S.socialMedia) == null ? void 0 : T.medias,
|
|
862
|
+
payments: f,
|
|
863
863
|
adornment: {
|
|
864
|
-
...(
|
|
864
|
+
...(q = (O = d.supportInfo) == null ? void 0 : O.supportInfo) != null && q.content ? {
|
|
865
865
|
bottom: /* @__PURE__ */ I(
|
|
866
866
|
i,
|
|
867
867
|
{
|
|
868
|
-
content: (
|
|
868
|
+
content: (E = (y = d.supportInfo) == null ? void 0 : y.supportInfo) == null ? void 0 : E.content,
|
|
869
869
|
CONSTANTS: {
|
|
870
870
|
ICONS: s,
|
|
871
871
|
PAYMENT_FLAGS: t,
|
|
@@ -880,13 +880,13 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
880
880
|
ICONS: s
|
|
881
881
|
}
|
|
882
882
|
) : /* @__PURE__ */ I(G, {});
|
|
883
|
-
},
|
|
883
|
+
}, $t = async ({
|
|
884
884
|
children: e,
|
|
885
885
|
ClientHeaderProvider: t,
|
|
886
886
|
...o
|
|
887
887
|
}) => {
|
|
888
888
|
var a, i, c, u;
|
|
889
|
-
const { data: r } = await
|
|
889
|
+
const { data: r } = await b({
|
|
890
890
|
contentType: "header",
|
|
891
891
|
...o
|
|
892
892
|
}), s = (a = r[0]) == null ? void 0 : a.sections.map((d) => d.data);
|
|
@@ -902,7 +902,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
902
902
|
children: e
|
|
903
903
|
}
|
|
904
904
|
);
|
|
905
|
-
},
|
|
905
|
+
}, Tt = async ({
|
|
906
906
|
children: e,
|
|
907
907
|
productId: t,
|
|
908
908
|
COMMON_PAGE_COLUMN_GAP: o,
|
|
@@ -910,7 +910,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
910
910
|
PDPContentProvider: s,
|
|
911
911
|
...a
|
|
912
912
|
}) => {
|
|
913
|
-
const { data: i } = await
|
|
913
|
+
const { data: i } = await b({
|
|
914
914
|
contentType: "product_page",
|
|
915
915
|
...a
|
|
916
916
|
});
|
|
@@ -924,9 +924,9 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
924
924
|
children: e
|
|
925
925
|
}
|
|
926
926
|
);
|
|
927
|
-
},
|
|
927
|
+
}, Ot = {
|
|
928
928
|
"column-modifier": "_column-modifier_1tqap_1"
|
|
929
|
-
},
|
|
929
|
+
}, qt = async ({
|
|
930
930
|
children: e,
|
|
931
931
|
slug: t,
|
|
932
932
|
SectionZone: o,
|
|
@@ -934,28 +934,28 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
934
934
|
PLPContentProvider: s,
|
|
935
935
|
...a
|
|
936
936
|
}) => {
|
|
937
|
-
const { data: i } = await
|
|
937
|
+
const { data: i } = await b({
|
|
938
938
|
contentType: "categories_page",
|
|
939
939
|
...a
|
|
940
940
|
}), c = i.find(
|
|
941
941
|
(l) => {
|
|
942
|
-
var
|
|
943
|
-
return ((
|
|
942
|
+
var p, g, m;
|
|
943
|
+
return ((p = l.config) == null ? void 0 : p.seo.slug) === t && ((m = (g = l.config) == null ? void 0 : g.responsive) == null ? void 0 : m.deviceType) === "desktop";
|
|
944
944
|
}
|
|
945
945
|
), u = i.find(
|
|
946
946
|
(l) => {
|
|
947
|
-
var
|
|
948
|
-
return ((
|
|
947
|
+
var p, g, m;
|
|
948
|
+
return ((p = l.config) == null ? void 0 : p.seo.slug) === t && ((m = (g = l.config) == null ? void 0 : g.responsive) == null ? void 0 : m.deviceType) === "mobile";
|
|
949
949
|
}
|
|
950
950
|
), d = i.find(
|
|
951
951
|
(l) => {
|
|
952
|
-
var
|
|
953
|
-
return ((
|
|
952
|
+
var p, g, m;
|
|
953
|
+
return ((p = l.config) == null ? void 0 : p.seo.slug) === "default" && ((m = (g = l.config) == null ? void 0 : g.responsive) == null ? void 0 : m.deviceType) === "desktop";
|
|
954
954
|
}
|
|
955
|
-
),
|
|
955
|
+
), f = i.find(
|
|
956
956
|
(l) => {
|
|
957
|
-
var
|
|
958
|
-
return ((
|
|
957
|
+
var p, g, m;
|
|
958
|
+
return ((p = l.config) == null ? void 0 : p.seo.slug) === "default" && ((m = (g = l.config) == null ? void 0 : g.responsive) == null ? void 0 : m.deviceType) === "mobile";
|
|
959
959
|
}
|
|
960
960
|
);
|
|
961
961
|
return /* @__PURE__ */ z(G, { children: [
|
|
@@ -963,8 +963,8 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
963
963
|
j.Column,
|
|
964
964
|
{
|
|
965
965
|
className: B.classNameConcat(
|
|
966
|
-
|
|
967
|
-
|
|
966
|
+
N["responsive-desktop-flex"],
|
|
967
|
+
Ot["column-modifier"]
|
|
968
968
|
),
|
|
969
969
|
style: {
|
|
970
970
|
minHeight: "100vh"
|
|
@@ -981,10 +981,10 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
981
981
|
)
|
|
982
982
|
}
|
|
983
983
|
),
|
|
984
|
-
/* @__PURE__ */ I(j.Column, { className:
|
|
984
|
+
/* @__PURE__ */ I(j.Column, { className: N["responsive-mobile-flex"], children: /* @__PURE__ */ I(
|
|
985
985
|
s,
|
|
986
986
|
{
|
|
987
|
-
data: u ??
|
|
987
|
+
data: u ?? f,
|
|
988
988
|
device: "mobile",
|
|
989
989
|
SectionZone: o,
|
|
990
990
|
COMMON_PAGE_COLUMN_GAP_PDC: r,
|
|
@@ -992,43 +992,97 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
992
992
|
}
|
|
993
993
|
) })
|
|
994
994
|
] });
|
|
995
|
-
},
|
|
995
|
+
}, Et = async ({ slug: e, ...t }) => {
|
|
996
|
+
var i, c, u;
|
|
997
|
+
const { data: o } = await b({
|
|
998
|
+
contentType: "redirect_to_search",
|
|
999
|
+
...t
|
|
1000
|
+
}), r = ((u = (c = (i = o[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : u.paths) ?? [];
|
|
1001
|
+
if (!!!r.length)
|
|
1002
|
+
return {
|
|
1003
|
+
slug: e,
|
|
1004
|
+
query: null,
|
|
1005
|
+
redirect: !1
|
|
1006
|
+
};
|
|
1007
|
+
const a = r.find(
|
|
1008
|
+
(d) => {
|
|
1009
|
+
var f, l;
|
|
1010
|
+
return ((f = d.path) == null ? void 0 : f.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((l = d.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
|
|
1011
|
+
}
|
|
1012
|
+
);
|
|
1013
|
+
return a ? {
|
|
1014
|
+
slug: e,
|
|
1015
|
+
query: a == null ? void 0 : a.searchQuery,
|
|
1016
|
+
redirect: !0,
|
|
1017
|
+
collectionId: a == null ? void 0 : a.collectionId,
|
|
1018
|
+
filters: a == null ? void 0 : a.filters,
|
|
1019
|
+
sort: a == null ? void 0 : a.sort
|
|
1020
|
+
} : {
|
|
1021
|
+
slug: e,
|
|
1022
|
+
query: null,
|
|
1023
|
+
redirect: !1,
|
|
1024
|
+
collectionId: null,
|
|
1025
|
+
filters: null,
|
|
1026
|
+
sort: null
|
|
1027
|
+
};
|
|
1028
|
+
}, wt = async ({ slug: e, ...t }) => {
|
|
1029
|
+
var i, c, u;
|
|
1030
|
+
const { data: o } = await b({
|
|
1031
|
+
contentType: "redirect_to_search",
|
|
1032
|
+
...t
|
|
1033
|
+
}), r = ((u = (c = (i = o[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : u.paths) ?? [];
|
|
1034
|
+
if (!!!r.length)
|
|
1035
|
+
return null;
|
|
1036
|
+
const a = r.find(
|
|
1037
|
+
(d) => {
|
|
1038
|
+
var f, l;
|
|
1039
|
+
return ((f = d.path) == null ? void 0 : f.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((l = d.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
return a ? {
|
|
1043
|
+
slug: e,
|
|
1044
|
+
title: a.pageTitle,
|
|
1045
|
+
description: a.pageDescription
|
|
1046
|
+
} : null;
|
|
1047
|
+
}, At = async ({
|
|
996
1048
|
ClientTipbarContent: e,
|
|
997
1049
|
...t
|
|
998
1050
|
}) => {
|
|
999
|
-
const { data: o } = await
|
|
1051
|
+
const { data: o } = await b({
|
|
1000
1052
|
contentType: "tipbar",
|
|
1001
1053
|
...t
|
|
1002
1054
|
});
|
|
1003
1055
|
return /* @__PURE__ */ I(e, { data: o });
|
|
1004
|
-
},
|
|
1056
|
+
}, Pt = {
|
|
1005
1057
|
CommonPageContent: Ft,
|
|
1006
|
-
HeaderContent:
|
|
1007
|
-
TipbarContent:
|
|
1008
|
-
FooterContent:
|
|
1009
|
-
PLPContent:
|
|
1010
|
-
PDPContent:
|
|
1011
|
-
|
|
1058
|
+
HeaderContent: $t,
|
|
1059
|
+
TipbarContent: At,
|
|
1060
|
+
FooterContent: St,
|
|
1061
|
+
PLPContent: qt,
|
|
1062
|
+
PDPContent: Tt,
|
|
1063
|
+
getRedirectData: Et,
|
|
1064
|
+
getPLPSynteticMetaData: wt
|
|
1065
|
+
}, ir = { Components: Pt }, kt = n.object({
|
|
1012
1066
|
query: n.string()
|
|
1013
1067
|
});
|
|
1014
|
-
async function
|
|
1068
|
+
async function Nt({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
1015
1069
|
if (!t) {
|
|
1016
1070
|
console.error("[ERROR FETCHING] Body is required");
|
|
1017
1071
|
return;
|
|
1018
1072
|
}
|
|
1019
1073
|
await kt.validate(t);
|
|
1020
1074
|
const { query: r = "" } = t, s = new URLSearchParams({ query: r });
|
|
1021
|
-
return
|
|
1075
|
+
return h(
|
|
1022
1076
|
`${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
|
|
1023
1077
|
{
|
|
1024
1078
|
...o
|
|
1025
1079
|
}
|
|
1026
1080
|
);
|
|
1027
1081
|
}
|
|
1028
|
-
const
|
|
1082
|
+
const jt = (e, t) => pe(e, t), Dt = (e) => ({
|
|
1029
1083
|
...e,
|
|
1030
|
-
description: e.description ?
|
|
1031
|
-
}),
|
|
1084
|
+
description: e.description ? jt(e.description) : e.description
|
|
1085
|
+
}), _t = ({
|
|
1032
1086
|
offer: e,
|
|
1033
1087
|
seller: t,
|
|
1034
1088
|
product: o
|
|
@@ -1038,8 +1092,8 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1038
1092
|
seller: t
|
|
1039
1093
|
}), K = (e, t) => ({
|
|
1040
1094
|
...e,
|
|
1041
|
-
isVariantOf:
|
|
1042
|
-
}),
|
|
1095
|
+
isVariantOf: Dt(t)
|
|
1096
|
+
}), Ht = (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, W = (e, t) => k(e) && !k(t) ? -1 : !k(e) && k(t) ? 1 : U(e) - U(t), Gt = (e, t) => {
|
|
1043
1097
|
let o = 0;
|
|
1044
1098
|
for (let r = 1; r < e.length; r++)
|
|
1045
1099
|
t(e[o], e[r]) > 0 && (o = r);
|
|
@@ -1050,7 +1104,7 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1050
1104
|
offer: s.commertialOffer,
|
|
1051
1105
|
sku: r
|
|
1052
1106
|
}))
|
|
1053
|
-
), o =
|
|
1107
|
+
), o = Gt(
|
|
1054
1108
|
t,
|
|
1055
1109
|
({ offer: r }, { offer: s }) => W(r, s)
|
|
1056
1110
|
);
|
|
@@ -1065,11 +1119,11 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1065
1119
|
attachment: "ATTACHMENT",
|
|
1066
1120
|
specification: "SPECIFICATION",
|
|
1067
1121
|
attribute: "ATTRIBUTE"
|
|
1068
|
-
},
|
|
1122
|
+
}, Lt = (e) => ({
|
|
1069
1123
|
name: e.name,
|
|
1070
1124
|
value: e.content,
|
|
1071
1125
|
valueReference: D.attachment
|
|
1072
|
-
}),
|
|
1126
|
+
}), Ut = (e) => ({
|
|
1073
1127
|
propertyID: e.id,
|
|
1074
1128
|
name: e.name,
|
|
1075
1129
|
value: e.value,
|
|
@@ -1077,7 +1131,7 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1077
1131
|
valueReference: D.attribute,
|
|
1078
1132
|
visible: e.visible
|
|
1079
1133
|
}
|
|
1080
|
-
}),
|
|
1134
|
+
}), _ = (e, t, o) => {
|
|
1081
1135
|
const r = e.flatMap(({ name: i, values: c }) => c ? c.map((u) => ({
|
|
1082
1136
|
name: i,
|
|
1083
1137
|
value: u,
|
|
@@ -1086,23 +1140,23 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1086
1140
|
name: i,
|
|
1087
1141
|
value: "",
|
|
1088
1142
|
valueReference: D.specification
|
|
1089
|
-
}), s = Array.isArray(o) ? o.map(
|
|
1143
|
+
}), s = Array.isArray(o) ? o.map(Lt) : [], a = t ? t.map(Ut) : [];
|
|
1090
1144
|
return [
|
|
1091
1145
|
...r,
|
|
1092
1146
|
...s,
|
|
1093
1147
|
...a
|
|
1094
1148
|
];
|
|
1095
|
-
},
|
|
1149
|
+
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Vt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Mt = (e) => {
|
|
1096
1150
|
let t = e.slice(0);
|
|
1097
|
-
for (let o = 0; o <
|
|
1151
|
+
for (let o = 0; o < V.length; o++)
|
|
1098
1152
|
t = t.replace(
|
|
1099
|
-
new RegExp(
|
|
1100
|
-
|
|
1153
|
+
new RegExp(V.charAt(o), "g"),
|
|
1154
|
+
Vt.charAt(o)
|
|
1101
1155
|
);
|
|
1102
1156
|
return t;
|
|
1103
|
-
},
|
|
1157
|
+
}, xt = (e) => e.replace(/[·/_,:]/, "-"), Z = (e) => {
|
|
1104
1158
|
const o = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1105
|
-
return
|
|
1159
|
+
return xt(Mt(o)).toLowerCase();
|
|
1106
1160
|
}, ee = (e) => `/${e}/p`, te = (e) => {
|
|
1107
1161
|
const t = Math.max(
|
|
1108
1162
|
...e.map((r) => r.NumberOfInstallments)
|
|
@@ -1119,7 +1173,7 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1119
1173
|
listPrice: 0,
|
|
1120
1174
|
sellerDefault: !1
|
|
1121
1175
|
}, s = e.map(
|
|
1122
|
-
(a) =>
|
|
1176
|
+
(a) => _t({
|
|
1123
1177
|
offer: a.commertialOffer,
|
|
1124
1178
|
seller: a,
|
|
1125
1179
|
product: t
|
|
@@ -1127,7 +1181,7 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1127
1181
|
).sort(W).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (o.price = a.Price, o.listPrice = a.ListPrice, o.sellerDefault = !0), {
|
|
1128
1182
|
availability: a.AvailableQuantity > 0,
|
|
1129
1183
|
listPrice: a.ListPrice,
|
|
1130
|
-
price:
|
|
1184
|
+
price: Bt(a),
|
|
1131
1185
|
priceValidUntil: a.PriceValidUntil,
|
|
1132
1186
|
priceCurrency: "BRL",
|
|
1133
1187
|
installments: a.Installments,
|
|
@@ -1145,11 +1199,11 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1145
1199
|
}, oe = (e) => {
|
|
1146
1200
|
const { attributes: t, itemId: o, name: r, sellers: s, variations: a } = e;
|
|
1147
1201
|
return {
|
|
1148
|
-
additionalProperty:
|
|
1202
|
+
additionalProperty: _(a, t, []),
|
|
1149
1203
|
name: r,
|
|
1150
1204
|
offers: {
|
|
1151
1205
|
offers: s.map(({ sellerId: i, commertialOffer: c }) => ({
|
|
1152
|
-
availability:
|
|
1206
|
+
availability: Ht(c.AvailableQuantity > 0),
|
|
1153
1207
|
listPrice: c.ListPrice,
|
|
1154
1208
|
price: c.Price,
|
|
1155
1209
|
quantity: c.AvailableQuantity,
|
|
@@ -1161,8 +1215,8 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1161
1215
|
sku: o
|
|
1162
1216
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1163
1217
|
};
|
|
1164
|
-
},
|
|
1165
|
-
var
|
|
1218
|
+
}, zt = (e) => {
|
|
1219
|
+
var C;
|
|
1166
1220
|
const {
|
|
1167
1221
|
attributes: t,
|
|
1168
1222
|
referenceId: o,
|
|
@@ -1174,69 +1228,69 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1174
1228
|
videos: u,
|
|
1175
1229
|
variations: d
|
|
1176
1230
|
} = e, {
|
|
1177
|
-
brand:
|
|
1231
|
+
brand: f,
|
|
1178
1232
|
categories: l,
|
|
1179
|
-
categoriesIds:
|
|
1180
|
-
description:
|
|
1181
|
-
linkText:
|
|
1182
|
-
productClusters:
|
|
1233
|
+
categoriesIds: p,
|
|
1234
|
+
description: g,
|
|
1235
|
+
linkText: m,
|
|
1236
|
+
productClusters: $,
|
|
1183
1237
|
clusterHighlights: F,
|
|
1184
|
-
productName:
|
|
1185
|
-
properties:
|
|
1186
|
-
productId:
|
|
1187
|
-
} = r,
|
|
1238
|
+
productName: S,
|
|
1239
|
+
properties: T,
|
|
1240
|
+
productId: O
|
|
1241
|
+
} = r, q = l.slice().reverse(), y = re(c, e.isVariantOf), E = te(y.offers[0].installments);
|
|
1188
1242
|
return {
|
|
1189
1243
|
sku: a,
|
|
1190
|
-
gtin: ((
|
|
1191
|
-
name:
|
|
1192
|
-
description:
|
|
1244
|
+
gtin: ((C = o[0]) == null ? void 0 : C.Value) ?? "",
|
|
1245
|
+
name: S ?? i,
|
|
1246
|
+
description: g,
|
|
1193
1247
|
releaseDate: r.releaseDate ?? "",
|
|
1194
|
-
slug:
|
|
1248
|
+
slug: m,
|
|
1195
1249
|
video: u[0],
|
|
1196
1250
|
categories: l,
|
|
1197
|
-
categoriesIds:
|
|
1198
|
-
id:
|
|
1199
|
-
brand: { name:
|
|
1251
|
+
categoriesIds: p,
|
|
1252
|
+
id: O,
|
|
1253
|
+
brand: { name: f, brandName: f },
|
|
1200
1254
|
seo: {
|
|
1201
|
-
description:
|
|
1202
|
-
title:
|
|
1203
|
-
canonical: ee(
|
|
1255
|
+
description: g,
|
|
1256
|
+
title: S,
|
|
1257
|
+
canonical: ee(m)
|
|
1204
1258
|
},
|
|
1205
1259
|
cluster: {
|
|
1206
|
-
generals:
|
|
1260
|
+
generals: $,
|
|
1207
1261
|
highlights: F
|
|
1208
1262
|
},
|
|
1209
|
-
properties:
|
|
1210
|
-
availability: { status:
|
|
1263
|
+
properties: T,
|
|
1264
|
+
availability: { status: y.offers[0].availability },
|
|
1211
1265
|
breadcrumbList: {
|
|
1212
1266
|
itemListElement: [
|
|
1213
|
-
...
|
|
1214
|
-
const
|
|
1267
|
+
...q.map((v, A) => {
|
|
1268
|
+
const R = v.split("/"), w = R[R.length - 2], H = R.map(Z).join("/");
|
|
1215
1269
|
return {
|
|
1216
|
-
name:
|
|
1217
|
-
item:
|
|
1218
|
-
position:
|
|
1270
|
+
name: w,
|
|
1271
|
+
item: H,
|
|
1272
|
+
position: A + 1
|
|
1219
1273
|
};
|
|
1220
1274
|
}),
|
|
1221
1275
|
{
|
|
1222
1276
|
name: r.productName,
|
|
1223
|
-
item:
|
|
1277
|
+
item: m,
|
|
1224
1278
|
position: l.length + 1
|
|
1225
1279
|
}
|
|
1226
1280
|
],
|
|
1227
1281
|
numberOfItems: l.length
|
|
1228
1282
|
},
|
|
1229
1283
|
image: Y(s),
|
|
1230
|
-
offers:
|
|
1231
|
-
additionalProperty:
|
|
1284
|
+
offers: y,
|
|
1285
|
+
additionalProperty: _(d, t, []),
|
|
1232
1286
|
isVariantOf: {
|
|
1233
1287
|
productGroupID: r.productId,
|
|
1234
1288
|
hasVariant: r.items.map((v) => oe(v))
|
|
1235
1289
|
},
|
|
1236
|
-
installments:
|
|
1290
|
+
installments: E
|
|
1237
1291
|
};
|
|
1238
|
-
},
|
|
1239
|
-
var
|
|
1292
|
+
}, Qt = (e) => {
|
|
1293
|
+
var C;
|
|
1240
1294
|
const {
|
|
1241
1295
|
attributes: t,
|
|
1242
1296
|
referenceId: o,
|
|
@@ -1248,103 +1302,103 @@ const Nt = (e, t) => me(e, t), wt = (e) => ({
|
|
|
1248
1302
|
Videos: u,
|
|
1249
1303
|
variations: d
|
|
1250
1304
|
} = e, {
|
|
1251
|
-
brand:
|
|
1305
|
+
brand: f,
|
|
1252
1306
|
categories: l,
|
|
1253
|
-
categoriesIds:
|
|
1254
|
-
description:
|
|
1255
|
-
linkText:
|
|
1256
|
-
productClusters:
|
|
1307
|
+
categoriesIds: p,
|
|
1308
|
+
description: g,
|
|
1309
|
+
linkText: m,
|
|
1310
|
+
productClusters: $,
|
|
1257
1311
|
productName: F,
|
|
1258
|
-
Coleção:
|
|
1259
|
-
"ID Coleção":
|
|
1260
|
-
productId:
|
|
1261
|
-
} = r,
|
|
1312
|
+
Coleção: S,
|
|
1313
|
+
"ID Coleção": T,
|
|
1314
|
+
productId: O
|
|
1315
|
+
} = r, q = l.slice().reverse(), y = re(c, e.isVariantOf), E = te(y.offers[0].installments);
|
|
1262
1316
|
return {
|
|
1263
1317
|
sku: a,
|
|
1264
|
-
gtin: ((
|
|
1318
|
+
gtin: ((C = o[0]) == null ? void 0 : C.Value) ?? "",
|
|
1265
1319
|
name: F ?? i,
|
|
1266
|
-
description:
|
|
1320
|
+
description: g,
|
|
1267
1321
|
releaseDate: r.releaseDate ?? "",
|
|
1268
|
-
slug:
|
|
1322
|
+
slug: m,
|
|
1269
1323
|
video: u[0],
|
|
1270
1324
|
categories: l,
|
|
1271
|
-
categoriesIds:
|
|
1272
|
-
collection:
|
|
1273
|
-
collectionId:
|
|
1274
|
-
id:
|
|
1275
|
-
brand: { name:
|
|
1325
|
+
categoriesIds: p,
|
|
1326
|
+
collection: S,
|
|
1327
|
+
collectionId: T,
|
|
1328
|
+
id: O,
|
|
1329
|
+
brand: { name: f, brandName: f },
|
|
1276
1330
|
seo: {
|
|
1277
|
-
description:
|
|
1331
|
+
description: g,
|
|
1278
1332
|
title: F,
|
|
1279
|
-
canonical: ee(
|
|
1333
|
+
canonical: ee(m)
|
|
1280
1334
|
},
|
|
1281
1335
|
cluster: {
|
|
1282
|
-
generals:
|
|
1336
|
+
generals: $,
|
|
1283
1337
|
highlights: []
|
|
1284
1338
|
// TODO: add highlights
|
|
1285
1339
|
},
|
|
1286
|
-
availability: { status:
|
|
1340
|
+
availability: { status: y.offers[0].availability },
|
|
1287
1341
|
breadcrumbList: {
|
|
1288
1342
|
itemListElement: [
|
|
1289
|
-
...
|
|
1290
|
-
const
|
|
1343
|
+
...q.map((v, A) => {
|
|
1344
|
+
const R = v.split("/"), w = R[R.length - 2], H = R.map(Z).join("/");
|
|
1291
1345
|
return {
|
|
1292
|
-
name:
|
|
1293
|
-
item:
|
|
1294
|
-
position:
|
|
1346
|
+
name: w,
|
|
1347
|
+
item: H,
|
|
1348
|
+
position: A + 1
|
|
1295
1349
|
};
|
|
1296
1350
|
}),
|
|
1297
1351
|
{
|
|
1298
1352
|
name: r.productName,
|
|
1299
|
-
item:
|
|
1353
|
+
item: m,
|
|
1300
1354
|
position: l.length + 1
|
|
1301
1355
|
}
|
|
1302
1356
|
],
|
|
1303
1357
|
numberOfItems: l.length
|
|
1304
1358
|
},
|
|
1305
1359
|
image: Y(s),
|
|
1306
|
-
offers:
|
|
1307
|
-
additionalProperty:
|
|
1360
|
+
offers: y,
|
|
1361
|
+
additionalProperty: _(d, t, []),
|
|
1308
1362
|
isVariantOf: {
|
|
1309
1363
|
productGroupID: r.productId,
|
|
1310
1364
|
hasVariant: r.items.map((v) => {
|
|
1311
|
-
const { variations:
|
|
1312
|
-
name:
|
|
1313
|
-
values: v[
|
|
1365
|
+
const { variations: A } = v, R = A.map((w) => ({
|
|
1366
|
+
name: w,
|
|
1367
|
+
values: v[w]
|
|
1314
1368
|
}));
|
|
1315
1369
|
return {
|
|
1316
1370
|
...oe(v),
|
|
1317
|
-
additionalProperty:
|
|
1318
|
-
|
|
1371
|
+
additionalProperty: _(
|
|
1372
|
+
R,
|
|
1319
1373
|
t,
|
|
1320
1374
|
[]
|
|
1321
1375
|
)
|
|
1322
1376
|
};
|
|
1323
1377
|
})
|
|
1324
1378
|
},
|
|
1325
|
-
installments:
|
|
1379
|
+
installments: E
|
|
1326
1380
|
};
|
|
1327
|
-
},
|
|
1381
|
+
}, Jt = n.array().of(n.object({
|
|
1328
1382
|
key: n.string().required(),
|
|
1329
1383
|
value: n.string().required()
|
|
1330
1384
|
})).required("Facets are required");
|
|
1331
|
-
async function
|
|
1385
|
+
async function Kt({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
1332
1386
|
if (!t) {
|
|
1333
1387
|
console.error("[ERROR FETCHING] Body is required");
|
|
1334
1388
|
return;
|
|
1335
1389
|
}
|
|
1336
|
-
await
|
|
1390
|
+
await Jt.validate(t);
|
|
1337
1391
|
const r = new URLSearchParams({}), s = t.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
|
|
1338
|
-
|
|
1392
|
+
se(t, r);
|
|
1339
1393
|
const a = `${e}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
1340
|
-
return
|
|
1394
|
+
return h(a, {
|
|
1341
1395
|
cache: "no-store",
|
|
1342
1396
|
...o
|
|
1343
1397
|
}).then((i) => i.map((u) => {
|
|
1344
1398
|
const d = X(u.items);
|
|
1345
1399
|
return d && K(d, u);
|
|
1346
1400
|
}).filter((u) => !!u).map((u) => ({
|
|
1347
|
-
node:
|
|
1401
|
+
node: Qt(u)
|
|
1348
1402
|
})));
|
|
1349
1403
|
}
|
|
1350
1404
|
const ne = ({
|
|
@@ -1364,19 +1418,19 @@ const ne = ({
|
|
|
1364
1418
|
sort: c = "",
|
|
1365
1419
|
facets: u = [],
|
|
1366
1420
|
type: d,
|
|
1367
|
-
hideUnavailableItems:
|
|
1421
|
+
hideUnavailableItems: f = !0,
|
|
1368
1422
|
locale: l = ""
|
|
1369
|
-
} = t,
|
|
1423
|
+
} = t, p = new URLSearchParams({
|
|
1370
1424
|
page: a.toString(),
|
|
1371
1425
|
count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
|
|
1372
1426
|
query: s,
|
|
1373
1427
|
sort: c,
|
|
1374
1428
|
locale: l
|
|
1375
1429
|
});
|
|
1376
|
-
|
|
1377
|
-
const
|
|
1378
|
-
return
|
|
1379
|
-
`${e}/api/io/_v/api/intelligent-search/${d}/${
|
|
1430
|
+
f !== void 0 && p.append("hideUnavailableItems", f.toString());
|
|
1431
|
+
const g = u.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
|
|
1432
|
+
return me(
|
|
1433
|
+
`${e}/api/io/_v/api/intelligent-search/${d}/${g}?${p.toString()}`,
|
|
1380
1434
|
{
|
|
1381
1435
|
headers: {
|
|
1382
1436
|
Accept: "application/json",
|
|
@@ -1386,7 +1440,7 @@ const ne = ({
|
|
|
1386
1440
|
}
|
|
1387
1441
|
);
|
|
1388
1442
|
};
|
|
1389
|
-
async function
|
|
1443
|
+
async function Wt({ body: e, extraData: t, ...o }) {
|
|
1390
1444
|
if (!e) {
|
|
1391
1445
|
console.error("[ERROR FETCHING] Body is required");
|
|
1392
1446
|
return;
|
|
@@ -1416,13 +1470,13 @@ async function Jt({ body: e, extraData: t, ...o }) {
|
|
|
1416
1470
|
total: a.count
|
|
1417
1471
|
},
|
|
1418
1472
|
products: s.map((c, u) => ({
|
|
1419
|
-
node:
|
|
1473
|
+
node: zt(c),
|
|
1420
1474
|
cursor: u.toString()
|
|
1421
1475
|
}))
|
|
1422
1476
|
}
|
|
1423
1477
|
};
|
|
1424
1478
|
}
|
|
1425
|
-
async function
|
|
1479
|
+
async function Xt({ body: e, extraData: t, ...o }) {
|
|
1426
1480
|
if (!e) {
|
|
1427
1481
|
console.error("[ERROR FETCHING] Body is required");
|
|
1428
1482
|
return;
|
|
@@ -1442,51 +1496,51 @@ async function Kt({ body: e, extraData: t, ...o }) {
|
|
|
1442
1496
|
}
|
|
1443
1497
|
};
|
|
1444
1498
|
}
|
|
1445
|
-
const
|
|
1499
|
+
const Yt = n.object({
|
|
1446
1500
|
query: n.string().optional(),
|
|
1447
1501
|
locale: n.string().optional()
|
|
1448
1502
|
});
|
|
1449
|
-
async function
|
|
1503
|
+
async function Zt({ apiUrl: e, body: t, fetchOptions: o }) {
|
|
1450
1504
|
if (!t) {
|
|
1451
1505
|
console.error("[ERROR FETCHING] Body is required");
|
|
1452
1506
|
return;
|
|
1453
1507
|
}
|
|
1454
|
-
await
|
|
1508
|
+
await Yt.validate(t);
|
|
1455
1509
|
const { query: r = "", locale: s = "default_locale" } = t, a = new URLSearchParams({ query: r, locale: s });
|
|
1456
|
-
return
|
|
1510
|
+
return h(
|
|
1457
1511
|
`${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
|
|
1458
1512
|
{
|
|
1459
1513
|
...o
|
|
1460
1514
|
}
|
|
1461
1515
|
);
|
|
1462
1516
|
}
|
|
1463
|
-
async function
|
|
1464
|
-
return
|
|
1517
|
+
async function er({ apiUrl: e }) {
|
|
1518
|
+
return h(`${e}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1465
1519
|
}
|
|
1466
|
-
const
|
|
1520
|
+
const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1467
1521
|
__proto__: null,
|
|
1468
|
-
getSearchAutoCompleteSuggestions:
|
|
1469
|
-
getSearchCrossellingProducts:
|
|
1470
|
-
getSearchFacets:
|
|
1471
|
-
getSearchProducts:
|
|
1472
|
-
getSearchSuggestedTerms:
|
|
1473
|
-
getSearchTopSearchs:
|
|
1474
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1522
|
+
getSearchAutoCompleteSuggestions: Nt,
|
|
1523
|
+
getSearchCrossellingProducts: Kt,
|
|
1524
|
+
getSearchFacets: Xt,
|
|
1525
|
+
getSearchProducts: Wt,
|
|
1526
|
+
getSearchSuggestedTerms: Zt,
|
|
1527
|
+
getSearchTopSearchs: er
|
|
1528
|
+
}, Symbol.toStringTag, { value: "Module" })), rr = {
|
|
1475
1529
|
parseSearchState: de,
|
|
1476
1530
|
convertSearchParams: ue,
|
|
1477
1531
|
filterNonRootFacets: le,
|
|
1478
1532
|
filterNonCategorySelected: ce
|
|
1479
|
-
},
|
|
1533
|
+
}, cr = {
|
|
1480
1534
|
checkout: Ze,
|
|
1481
|
-
catalog:
|
|
1482
|
-
cms:
|
|
1483
|
-
search:
|
|
1484
|
-
},
|
|
1535
|
+
catalog: st,
|
|
1536
|
+
cms: vt,
|
|
1537
|
+
search: tr
|
|
1538
|
+
}, lr = {
|
|
1485
1539
|
catalog: ht,
|
|
1486
|
-
search:
|
|
1540
|
+
search: rr
|
|
1487
1541
|
};
|
|
1488
1542
|
export {
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1543
|
+
cr as serverAPIs,
|
|
1544
|
+
ir as serverCMS,
|
|
1545
|
+
lr as serverHelpers
|
|
1492
1546
|
};
|