@soma-vertical-web/multi-lib 1.0.39 → 1.0.41

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.
@@ -0,0 +1,2714 @@
1
+ import { decodeJwt as nn } from "jose";
2
+ import * as U from "yup";
3
+ import { jsxs as Pt, Fragment as on, jsx as B } from "react/jsx-runtime";
4
+ import { Utils as an } from "@soma-vertical-web/core-components";
5
+ const ot = (t, e = !0) => Intl.NumberFormat("pt-BR", {
6
+ style: "currency",
7
+ currency: "BRL",
8
+ minimumFractionDigits: e ? 2 : 0
9
+ }).format(t), ln = ({ valueInCents: t, hasFree: e, freeTaxMessage: r }) => t === 0 ? e ? r : ot(0) : ot(t / 100), cn = (t, e) => {
10
+ const n = (t - e) * 100 / t;
11
+ return Math.floor(n);
12
+ }, or = (t, e) => {
13
+ const [r, n] = t.split(e);
14
+ return { name: r.trim(), size: n ? n.trim() : "" };
15
+ }, sn = (t, e) => {
16
+ if (!t)
17
+ return {};
18
+ const [r, n] = t.split(e);
19
+ return { color: r == null ? void 0 : r.trim(), size: n == null ? void 0 : n.trim() };
20
+ }, un = (t, e = "tamanho") => {
21
+ if (t.additionalProperty) {
22
+ const [r] = t.additionalProperty;
23
+ return r != null && r.name ? r.name.toLocaleLowerCase() === e ? r.value : t.name : "";
24
+ }
25
+ return t.name;
26
+ }, fn = (t, e) => t.replace(e, "").trim(), pn = (t) => t.replace(/\//g, ""), dn = ({ items: t, NAME_SPLIT_SYMBOL: e }) => {
27
+ const r = {
28
+ price: 0,
29
+ listPrice: 0,
30
+ installments: {
31
+ count: 0,
32
+ value: 0
33
+ }
34
+ }, n = (i, l) => {
35
+ var u;
36
+ l && (l.sellerId = i.sellerId, l.sellerName = i.sellerName, l.available = !0, l.isSellerDefault = i.sellerDefault);
37
+ const {
38
+ Price: s,
39
+ ListPrice: f,
40
+ PaymentOptions: { installmentOptions: c }
41
+ } = i.commertialOffer;
42
+ r.price = s, r.listPrice = f;
43
+ const p = (u = c == null ? void 0 : c[0]) == null ? void 0 : u.installments;
44
+ if (p) {
45
+ const { count: y, value: d } = p[p.length - 1];
46
+ r.installments = {
47
+ count: y,
48
+ value: d / 100
49
+ };
50
+ }
51
+ };
52
+ let o = !0;
53
+ const a = t.reduce((i, l) => {
54
+ var c;
55
+ const s = {
56
+ name: l.name,
57
+ sku: l.itemId,
58
+ value: ((c = l.Tamanho) == null ? void 0 : c[0]) ?? or(l.nameComplete ?? l.name, e).size,
59
+ available: !1,
60
+ sellerId: "",
61
+ sellerName: "",
62
+ isSellerDefault: !1
63
+ }, f = l.sellers.filter((p) => (p.sellerDefault && p.commertialOffer.IsAvailable && (s.available = !0, n(p, s)), p.commertialOffer.IsAvailable));
64
+ return !s.isSellerDefault && f.length > 0 && (s.available = !0, n(f[0], {
65
+ ...s,
66
+ sellerId: f[0].sellerId,
67
+ sellerName: f[0].sellerName
68
+ })), s.available === !1 && (o = !1), i.push(s), i;
69
+ }, []);
70
+ return {
71
+ ...r,
72
+ sizes: a,
73
+ allSizesAvailable: o
74
+ };
75
+ }, yn = (t) => t ? !t.offers.offers.find(({ quantity: e = 0 }) => e > 0) : !1, vn = (t, e) => {
76
+ const r = t.find(
77
+ (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0 && n.seller.identifier === e
78
+ );
79
+ return r || t.find(
80
+ (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0
81
+ );
82
+ }, mn = ({ images: t, TEXTURE_IMAGE: e }) => t.find((r) => e.includes(r.imageLabel)) ?? t[0], gn = (t, e) => {
83
+ const r = /\/ids\/(\d+)\//, n = t.match(r);
84
+ return n ? t.replace(
85
+ `/${n[1]}/`,
86
+ `/${n[1]}-${e.width}-${e.height}/`
87
+ ) : t;
88
+ }, hn = (t, e) => {
89
+ const r = /\/ids\/(\d+)-(\d+)-(\d+)\//, n = t.match(r);
90
+ return n ? t.replace(
91
+ `/${n[1]}-${n[2]}-${n[3]}/`,
92
+ `/${n[1]}-${e.width}-${e.height}/`
93
+ ) : t;
94
+ }, _n = ({
95
+ images: t,
96
+ label: e
97
+ }) => {
98
+ const r = t.filter(
99
+ (n) => n.keywords === e.first || n.keywords === e.second || n.alternateName === e.first || n.alternateName === e.second
100
+ );
101
+ return r.length === 0 ? t.slice(0, 2) : r;
102
+ }, En = (t) => {
103
+ const [e, r] = t.split("/").map(Number);
104
+ if (Number.isNaN(e) || Number.isNaN(r))
105
+ throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
106
+ return r / e;
107
+ }, Sn = (t, e, r) => {
108
+ e && (t ? (e.getAttribute("src") || (e.src = r ?? ""), e.play()) : e.pause());
109
+ }, Sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
110
+ __proto__: null,
111
+ disableSKU: yn,
112
+ formatPriceToCurrency: ot,
113
+ freightParsePrice: ln,
114
+ getAspectRatio: En,
115
+ getColorAndSizeFromSkuName: sn,
116
+ getDiscountPercent: cn,
117
+ getFirstImages: _n,
118
+ getProductNameWithoutSku: fn,
119
+ getSKUName: un,
120
+ getSkuInfos: dn,
121
+ getThumbImage: mn,
122
+ getValidOffer: vn,
123
+ removeSlashes: pn,
124
+ resizingImg: gn,
125
+ setVideoPlay: Sn,
126
+ splitNameAndSizeFromFullName: or,
127
+ updatedResizedImg: hn
128
+ }, Symbol.toStringTag, { value: "Module" })), An = {
129
+ attachment: "ATTACHMENT",
130
+ specification: "SPECIFICATION",
131
+ attribute: "ATTRIBUTE"
132
+ }, T = Promise.resolve(!1), bn = {
133
+ id: "",
134
+ isOpen: !1,
135
+ items: [],
136
+ loading: !1,
137
+ marketingData: null,
138
+ messages: [],
139
+ openTextField: {},
140
+ paymentData: null,
141
+ shippingData: null,
142
+ totalizers: [],
143
+ itemMetadata: [],
144
+ recentlyAddedProducts: [],
145
+ addCoupon: () => T,
146
+ addItem: () => T,
147
+ addSellerCode: () => T,
148
+ addMarketingData: () => T,
149
+ emptyCart: () => ({}),
150
+ removeItem: () => T,
151
+ setIsOpen: () => ({}),
152
+ shipping: () => T,
153
+ shippingUpdate: () => T,
154
+ toggleServiceToProduct: () => T,
155
+ updateItemQuantity: () => T,
156
+ insertProfileEmail: () => T,
157
+ setRecentlyAddedProducts: () => ({})
158
+ }, pt = (t) => t === 0, ar = (t, e) => {
159
+ if (!t || t.length === 0)
160
+ return [];
161
+ let r = "";
162
+ const n = [], o = t.match(/\d+/g) ?? [];
163
+ for (const a of o) {
164
+ const i = e[Number(a)];
165
+ i && (r += (r ? "/" : "") + i, n.push(r));
166
+ }
167
+ return n;
168
+ }, ir = (t, e) => {
169
+ const {
170
+ availability: r,
171
+ additionalInfo: { brandName: n },
172
+ bundleItems: o,
173
+ id: a,
174
+ uniqueId: i,
175
+ detailUrl: l,
176
+ ean: s,
177
+ imageUrl: f,
178
+ name: c,
179
+ listPrice: p,
180
+ quantity: u,
181
+ price: y,
182
+ priceDefinition: d,
183
+ productCategories: g,
184
+ productCategoryIds: h,
185
+ productId: b,
186
+ refId: P,
187
+ seller: m,
188
+ referenceId: R,
189
+ offerings: I,
190
+ productRefId: $,
191
+ skuName: C,
192
+ sellingPrice: j
193
+ } = t;
194
+ return {
195
+ availability: r,
196
+ bundleItems: o,
197
+ referenceId: R,
198
+ productRefId: $,
199
+ id: a,
200
+ ean: s,
201
+ uniqueId: i,
202
+ itemOffered: {
203
+ additionalProperty: [],
204
+ brand: {
205
+ name: n
206
+ },
207
+ categories: ar(h, g),
208
+ categoriesIds: h,
209
+ gtin: P,
210
+ image: [
211
+ {
212
+ alternateName: (e == null ? void 0 : e.MAIN_IMAGE) ?? "1",
213
+ url: f
214
+ }
215
+ ],
216
+ name: c,
217
+ isVariationOf: {
218
+ name: c,
219
+ productGroupID: b
220
+ },
221
+ sku: a,
222
+ slug: l,
223
+ skuName: C
224
+ },
225
+ listPrice: p,
226
+ quantity: u,
227
+ offerings: I,
228
+ price: y,
229
+ priceDefinition: d,
230
+ sellingPrice: j,
231
+ seller: m
232
+ };
233
+ }, On = (t, e) => {
234
+ const r = t.map((n) => ({
235
+ id: n.uniqueId,
236
+ quantity: n.quantity,
237
+ seller: n.seller
238
+ }));
239
+ return Array.isArray(e) ? [...r, ...e] : [...r, e];
240
+ }, Pn = (t, e) => {
241
+ const r = t.find((n) => n.id === e);
242
+ if (r) {
243
+ const n = t.map((o, a) => {
244
+ var i, l;
245
+ return {
246
+ id: ((i = o.itemOffered) == null ? void 0 : i.sku) ?? "",
247
+ index: a,
248
+ quantity: (r == null ? void 0 : r.id) === ((l = o.itemOffered) == null ? void 0 : l.sku) ? 0 : o.quantity,
249
+ seller: o.seller ?? ""
250
+ };
251
+ });
252
+ return {
253
+ updateItems: n,
254
+ filterItems: n.filter((o) => o.id !== e)
255
+ };
256
+ }
257
+ return { updateItems: [], filterItems: [] };
258
+ }, Rn = (t, e, r) => t.filter(
259
+ (n) => n.availability !== "withoutStock" && n.availability !== "https://schema.org/OutOfStock"
260
+ ).map(
261
+ (n, o) => {
262
+ var a, i;
263
+ return n.id === e ? {
264
+ id: n.id,
265
+ index: o,
266
+ quantity: r,
267
+ seller: n.seller,
268
+ sku: ((a = n.itemOffered) == null ? void 0 : a.sku) ?? ""
269
+ } : {
270
+ id: n.id,
271
+ index: o,
272
+ quantity: n.quantity,
273
+ seller: n.seller,
274
+ sku: ((i = n.itemOffered) == null ? void 0 : i.sku) ?? ""
275
+ };
276
+ }
277
+ ), In = (t, e) => t.filter((r) => r.availability !== "withoutStock").findIndex(({ id: r }) => r === e), wn = (t, e) => {
278
+ var r;
279
+ return Array.isArray(t) ? (((r = t == null ? void 0 : t.find((n) => {
280
+ var o;
281
+ return ((o = n == null ? void 0 : n.id) == null ? void 0 : o.toLowerCase()) === e;
282
+ })) == null ? void 0 : r.value) ?? 0) / 100 : 0;
283
+ }, Tn = (t) => {
284
+ const e = t.reduce((o, a) => {
285
+ const i = pt(a.price) ? 0 : a.quantity;
286
+ return o + i;
287
+ }, 0), r = t.reduce(
288
+ (o, a) => o + a.price * a.quantity,
289
+ 0
290
+ ), n = t.reduce(
291
+ (o, a) => o + a.listPrice * a.quantity,
292
+ 0
293
+ );
294
+ return {
295
+ totalItems: e,
296
+ total: r,
297
+ subTotal: n
298
+ };
299
+ }, Cn = (t) => Array.isArray(t) ? t.filter((e) => e.availability !== "withoutStock").reduce((e, r) => e + (pt(r == null ? void 0 : r.price) ? 0 : r.quantity), 0) : 0, dt = (t, e) => {
300
+ const { items: r, orderFormId: n, ...o } = t;
301
+ return {
302
+ ...o,
303
+ id: n,
304
+ items: Array.isArray(r) ? r.map((a) => ir(a, e)) : []
305
+ };
306
+ }, Nn = (t, e) => {
307
+ const r = t.find((n) => n.id === e);
308
+ return r ? r.availability === "unavailableItemFulfillment" : !1;
309
+ }, Dn = (t, e) => {
310
+ const r = t.sku, n = t.isVariantOf.hasVariant.find((o) => o.sku === r);
311
+ return n ? n.name.split(e)[1] : "--";
312
+ }, xn = (t, e, r = !1) => !t && e !== "" ? { code: 300, value: e, statusOk: r } : t === e ? { code: 200, value: e, statusOk: r } : { code: 400, value: e, statusOk: r }, Fn = (t, e) => {
313
+ const r = /* @__PURE__ */ new Set();
314
+ return [t, ...e].filter(
315
+ (n) => !r.has(n) && r.add(n),
316
+ r
317
+ );
318
+ }, Mn = (t, e) => e && Array.isArray(e) && e.find((n) => n.id === t) ? Promise.resolve(t) : Promise.resolve(!1), $n = (t, e) => e ? Promise.resolve(t[e]) : Promise.resolve(!1), Ln = async (t) => {
319
+ try {
320
+ const e = await t();
321
+ if (typeof e != "boolean")
322
+ return e;
323
+ } catch (e) {
324
+ console.error(`[Error orderForm]: ${e}`);
325
+ }
326
+ return !1;
327
+ }, Un = (t, e) => {
328
+ if (e !== -1) {
329
+ const r = Number(t);
330
+ return r ? r + 1 : 1;
331
+ }
332
+ return t ?? 1;
333
+ }, Bn = (t, e) => Array.isArray(t) ? t.filter(
334
+ (r) => e == null ? void 0 : e.some((n) => n.id === r.id)
335
+ ) : [], Gn = async (t, e) => t.then((r) => [...r ?? [], ...e ?? []]), jn = async (t, e, r, n) => {
336
+ const { priority: o = "auto", body: a } = e;
337
+ return fetch(t, {
338
+ // priority,
339
+ headers: {
340
+ "Content-Type": "application/json"
341
+ },
342
+ priority: o,
343
+ method: "POST",
344
+ body: JSON.stringify(a)
345
+ }).then(async (i) => {
346
+ const l = await i.json();
347
+ return r ? l : dt(l, n);
348
+ });
349
+ }, kn = (t, e, r) => ({
350
+ notifications: [
351
+ ...t.notifications,
352
+ { id: Date.now(), message: e, callback: r }
353
+ ]
354
+ }), Hn = (t) => [...Array.isArray(t) ? t : [t], "faststore"], qn = (t) => {
355
+ const e = t.get("utm_source") || V("utm_source"), r = t.get("utm_campaign") || V("utm_campaign"), n = t.get("utm_medium") || V("utm_medium"), o = t.get("utmi_cp") || V("utmi_cp"), a = t.get("utmi_pc") || V("utmi_pc"), i = t.get("utmi_p") || V("utmi_p");
356
+ return {
357
+ ...e && { utmSource: e },
358
+ ...n && { utmMedium: n },
359
+ ...r && { utmCampaign: r },
360
+ ...o && { utmiCampaign: o },
361
+ ...a && { utmiPart: a },
362
+ ...i && { utmipage: i }
363
+ };
364
+ }, V = (t) => {
365
+ if (!t || typeof window > "u")
366
+ return;
367
+ const e = window.location.href;
368
+ t = t.replace(/[[\]]/g, "\\$&");
369
+ const r = new RegExp("[?&]" + t + "(=([^&#]*)|&|#|$)"), n = r.exec(e);
370
+ return n ? n[2] ? decodeURIComponent(n[2].replace(/\+/g, " ")) : "" : null;
371
+ }, Xn = (t, e, r = "BR") => {
372
+ const n = e, o = {
373
+ country: r,
374
+ addressType: "",
375
+ postalCode: t || null,
376
+ city: "",
377
+ state: "",
378
+ street: "",
379
+ number: "",
380
+ neighborhood: "",
381
+ complement: "",
382
+ reference: "",
383
+ geoCoordinates: []
384
+ };
385
+ if (n) {
386
+ const a = typeof n == "object" && "latitude" in n ? n.latitude : null, i = typeof n == "object" && "longitude" in n ? n.longitude : null;
387
+ o.geoCoordinates = typeof a == "number" && typeof i == "number" ? { latitude: a, longitude: i } : null;
388
+ }
389
+ return [o];
390
+ }, Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
391
+ __proto__: null,
392
+ VALUE_REFERENCES: An,
393
+ addItemOrder: On,
394
+ addNotification: kn,
395
+ createItemOrder: ir,
396
+ createNewAddress: Xn,
397
+ fetchCartAPI: jn,
398
+ findItemIndex: In,
399
+ findOptions: Bn,
400
+ findTotalizerValue: wn,
401
+ getCategories: ar,
402
+ getCode: xn,
403
+ getQuantity: Un,
404
+ getRemoveId: Mn,
405
+ getSize: Dn,
406
+ getTotalItems: Cn,
407
+ getTotalizer: Tn,
408
+ getUrlParameter: V,
409
+ getValue: $n,
410
+ initialState: bn,
411
+ isGift: pt,
412
+ marketingTagsBuilder: Hn,
413
+ mergeOptionsPromise: Gn,
414
+ mountMarketingData: qn,
415
+ orderFormValues: dt,
416
+ promiseDefault: T,
417
+ removeQuantity: Pn,
418
+ updateItemSellerExternal: Nn,
419
+ updateOrderFormPromise: Ln,
420
+ updateQuantity: Rn,
421
+ wishlistArray: Fn
422
+ }, Symbol.toStringTag, { value: "Module" })), at = { baseUrl: "" }, bl = (t) => {
423
+ at.baseUrl || Object.defineProperty(at, "baseUrl", {
424
+ value: `https://${t}.myvtex.com`,
425
+ writable: !1,
426
+ configurable: !1
427
+ });
428
+ }, lr = (t, e) => fetch(`${at.baseUrl}${t}`, e), Ol = async (t, e, r = !1, n) => {
429
+ const { priority: o = "auto", body: a } = e, i = await lr(t, {
430
+ headers: { "Content-Type": "application/json" },
431
+ method: "POST",
432
+ body: JSON.stringify(a),
433
+ priority: o
434
+ });
435
+ if (!i.ok) {
436
+ const s = await i.json().catch(() => ({ message: "Unknown error" }));
437
+ throw new Error(s.message || `HTTP ${i.status}`);
438
+ }
439
+ const l = await i.json();
440
+ return r ? l : dt(l, n);
441
+ }, Rt = "fuzzy", It = "operator", Wn = (t) => ({
442
+ isDepartment: t != null && t.length ? t[0].key === "category-1" : !1
443
+ }), Vn = (t, e) => {
444
+ const r = decodeURIComponent(e ?? "").slice(1).split("/");
445
+ return t.map((n) => {
446
+ if (n.key === "category-2" && n.__typename === "FacetBoolean") {
447
+ const o = n.values;
448
+ return {
449
+ ...n,
450
+ values: o.filter(
451
+ (a) => !r.find(
452
+ (i) => i.toLowerCase() === a.value || i.toLowerCase() === a.name.toLowerCase()
453
+ )
454
+ )
455
+ };
456
+ }
457
+ return n;
458
+ });
459
+ }, cr = (t, e) => e ? t === "category-1" : !1, zn = (t) => t.key === "operator" && (t.value === "and" || t.value === "or"), Kn = (t) => t.type === "TEXT", Yn = (t) => t.key === "fuzzy" && (t.value === "0" || t.value === "1" || t.value === "auto"), Qn = (t) => {
460
+ const { key: e, name: r, values: n } = t;
461
+ return {
462
+ __typename: "FacetBoolean",
463
+ key: e,
464
+ label: r,
465
+ values: n.slice().sort((o, a) => o.name.localeCompare(a.name))
466
+ };
467
+ }, Jn = ({ key: t, values: e }) => ({
468
+ __typename: "FacetRange",
469
+ key: t,
470
+ values: e
471
+ }), Pl = (t, e, r) => {
472
+ if (!(t instanceof Object) || !("facets" in t))
473
+ return [];
474
+ const { facets: n = [] } = t, o = e != null && e.length ? e[0].key === "category-1" : !1;
475
+ return n.filter(
476
+ (i) => !r || !cr(i.key, o)
477
+ ).map(
478
+ (i) => Kn(i) ? Qn(i) : Jn(i)
479
+ );
480
+ }, Rl = (t, e) => {
481
+ const r = t.find(({ key: o }) => o === Rt) ?? null, n = t.find(({ key: o }) => o === It) ?? null;
482
+ r && Yn(r) && e.append(Rt, r.value), n && zn(n) && e.append(It, n.value);
483
+ }, sr = (t) => t.map((e) => {
484
+ const [r, n] = e.split("/");
485
+ return { key: r, value: n };
486
+ }), Zn = (t, e) => {
487
+ const r = decodeURIComponent(e ?? "").slice(1).split("/"), n = t.filter(({ value: a }) => !r.includes(decodeURIComponent(a))).map((a) => ({
488
+ ...a,
489
+ value: decodeURIComponent(a.value)
490
+ })), { isDepartment: o } = Wn(n);
491
+ return n == null ? void 0 : n.filter((a) => !cr(a.key, o));
492
+ }, Il = (t) => t.getAll("facets").flatMap((e) => {
493
+ const [r, ...n] = e.split("/");
494
+ return !r || n.length === 0 ? [] : [
495
+ {
496
+ key: r,
497
+ value: n.join("/")
498
+ }
499
+ ];
500
+ }), wl = (t) => {
501
+ const e = nn(t ?? "");
502
+ return {
503
+ email: e.sub,
504
+ userId: e.userId
505
+ };
506
+ }, eo = ({ pathname: t, searchParams: e }, r) => {
507
+ const n = e.get("sort") ?? "", o = e.get("query") ?? null, a = parseInt(e.get("page") ?? "1", 10);
508
+ return {
509
+ sort: n,
510
+ facets: sr(r),
511
+ term: o,
512
+ base: o ? "" : t,
513
+ page: a
514
+ };
515
+ }, to = (t) => {
516
+ const e = new URLSearchParams();
517
+ return Object.entries(t).forEach(([r, n]) => {
518
+ Array.isArray(n) ? n.forEach((o) => e.append(r, o)) : n !== void 0 && e.append(r, n);
519
+ }), e;
520
+ }, Tl = (t, e, r = 24, n = 1, o) => {
521
+ const a = `/search?query=${e ?? ""}&count=${r}&page=${n}${o ? `&sort=${o.replace("_", ":")}` : ""}`;
522
+ t.push(a);
523
+ }, ro = {
524
+ parseSearchState: eo,
525
+ convertSearchParams: to,
526
+ filterNonRootFacets: Zn,
527
+ selectedFacets: sr,
528
+ filterNonCategorySelected: Vn
529
+ }, Cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
530
+ __proto__: null,
531
+ default: ro
532
+ }, Symbol.toStringTag, { value: "Module" }));
533
+ var wt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
534
+ function no(t) {
535
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
536
+ }
537
+ function oo(t) {
538
+ if (t.__esModule) return t;
539
+ var e = t.default;
540
+ if (typeof e == "function") {
541
+ var r = function n() {
542
+ return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
543
+ };
544
+ r.prototype = e.prototype;
545
+ } else r = {};
546
+ return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) {
547
+ var o = Object.getOwnPropertyDescriptor(t, n);
548
+ Object.defineProperty(r, n, o.get ? o : {
549
+ enumerable: !0,
550
+ get: function() {
551
+ return t[n];
552
+ }
553
+ });
554
+ }), r;
555
+ }
556
+ var ao = {};
557
+ (function(t) {
558
+ Object.defineProperty(t, "__esModule", {
559
+ value: !0
560
+ }), Object.defineProperty(t, "removeTrailingSlash", {
561
+ enumerable: !0,
562
+ get: function() {
563
+ return e;
564
+ }
565
+ });
566
+ function e(r) {
567
+ return r.replace(/\/$/, "") || "/";
568
+ }
569
+ })(ao);
570
+ var yt = {};
571
+ (function(t) {
572
+ Object.defineProperty(t, "__esModule", {
573
+ value: !0
574
+ }), Object.defineProperty(t, "parsePath", {
575
+ enumerable: !0,
576
+ get: function() {
577
+ return e;
578
+ }
579
+ });
580
+ function e(r) {
581
+ const n = r.indexOf("#"), o = r.indexOf("?"), a = o > -1 && (n < 0 || o < n);
582
+ return a || n > -1 ? {
583
+ pathname: r.substring(0, a ? o : n),
584
+ query: a ? r.substring(o, n > -1 ? n : void 0) : "",
585
+ hash: n > -1 ? r.slice(n) : ""
586
+ } : {
587
+ pathname: r,
588
+ query: "",
589
+ hash: ""
590
+ };
591
+ }
592
+ })(yt);
593
+ var ur = {};
594
+ (function(t) {
595
+ Object.defineProperty(t, "__esModule", {
596
+ value: !0
597
+ }), Object.defineProperty(t, "pathHasPrefix", {
598
+ enumerable: !0,
599
+ get: function() {
600
+ return r;
601
+ }
602
+ });
603
+ const e = yt;
604
+ function r(n, o) {
605
+ if (typeof n != "string")
606
+ return !1;
607
+ const { pathname: a } = (0, e.parsePath)(n);
608
+ return a === o || a.startsWith(o + "/");
609
+ }
610
+ })(ur);
611
+ var io = {};
612
+ (function(t) {
613
+ Object.defineProperty(t, "__esModule", {
614
+ value: !0
615
+ });
616
+ function e(rn, bt) {
617
+ for (var Ot in bt) Object.defineProperty(rn, Ot, {
618
+ enumerable: !0,
619
+ get: bt[Ot]
620
+ });
621
+ }
622
+ e(t, {
623
+ ACTION_SUFFIX: function() {
624
+ return s;
625
+ },
626
+ APP_DIR_ALIAS: function() {
627
+ return Q;
628
+ },
629
+ CACHE_ONE_YEAR: function() {
630
+ return R;
631
+ },
632
+ DOT_NEXT_ALIAS: function() {
633
+ return L;
634
+ },
635
+ ESLINT_DEFAULT_DIRS: function() {
636
+ return Jr;
637
+ },
638
+ GSP_NO_RETURNED_VALUE: function() {
639
+ return Wr;
640
+ },
641
+ GSSP_COMPONENT_MEMBER_ERROR: function() {
642
+ return Kr;
643
+ },
644
+ GSSP_NO_RETURNED_VALUE: function() {
645
+ return Vr;
646
+ },
647
+ INSTRUMENTATION_HOOK_FILENAME: function() {
648
+ return C;
649
+ },
650
+ MIDDLEWARE_FILENAME: function() {
651
+ return I;
652
+ },
653
+ MIDDLEWARE_LOCATION_REGEXP: function() {
654
+ return $;
655
+ },
656
+ NEXT_BODY_SUFFIX: function() {
657
+ return p;
658
+ },
659
+ NEXT_CACHE_IMPLICIT_TAG_ID: function() {
660
+ return m;
661
+ },
662
+ NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
663
+ return d;
664
+ },
665
+ NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
666
+ return g;
667
+ },
668
+ NEXT_CACHE_SOFT_TAGS_HEADER: function() {
669
+ return y;
670
+ },
671
+ NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
672
+ return P;
673
+ },
674
+ NEXT_CACHE_TAGS_HEADER: function() {
675
+ return u;
676
+ },
677
+ NEXT_CACHE_TAG_MAX_ITEMS: function() {
678
+ return h;
679
+ },
680
+ NEXT_CACHE_TAG_MAX_LENGTH: function() {
681
+ return b;
682
+ },
683
+ NEXT_DATA_SUFFIX: function() {
684
+ return f;
685
+ },
686
+ NEXT_INTERCEPTION_MARKER_PREFIX: function() {
687
+ return n;
688
+ },
689
+ NEXT_META_SUFFIX: function() {
690
+ return c;
691
+ },
692
+ NEXT_QUERY_PARAM_PREFIX: function() {
693
+ return r;
694
+ },
695
+ NON_STANDARD_NODE_ENV: function() {
696
+ return Yr;
697
+ },
698
+ PAGES_DIR_ALIAS: function() {
699
+ return j;
700
+ },
701
+ PRERENDER_REVALIDATE_HEADER: function() {
702
+ return o;
703
+ },
704
+ PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
705
+ return a;
706
+ },
707
+ PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
708
+ return ae;
709
+ },
710
+ ROOT_DIR_ALIAS: function() {
711
+ return N;
712
+ },
713
+ RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
714
+ return W;
715
+ },
716
+ RSC_ACTION_ENCRYPTION_ALIAS: function() {
717
+ return w;
718
+ },
719
+ RSC_ACTION_PROXY_ALIAS: function() {
720
+ return D;
721
+ },
722
+ RSC_ACTION_VALIDATE_ALIAS: function() {
723
+ return O;
724
+ },
725
+ RSC_MOD_REF_PROXY_ALIAS: function() {
726
+ return k;
727
+ },
728
+ RSC_PREFETCH_SUFFIX: function() {
729
+ return i;
730
+ },
731
+ RSC_SUFFIX: function() {
732
+ return l;
733
+ },
734
+ SERVER_PROPS_EXPORT_ERROR: function() {
735
+ return Xr;
736
+ },
737
+ SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
738
+ return ge;
739
+ },
740
+ SERVER_PROPS_SSG_CONFLICT: function() {
741
+ return ie;
742
+ },
743
+ SERVER_RUNTIME: function() {
744
+ return Zr;
745
+ },
746
+ SSG_FALLBACK_EXPORT_ERROR: function() {
747
+ return Qr;
748
+ },
749
+ SSG_GET_INITIAL_PROPS_CONFLICT: function() {
750
+ return $e;
751
+ },
752
+ STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
753
+ return qr;
754
+ },
755
+ UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
756
+ return zr;
757
+ },
758
+ WEBPACK_LAYERS: function() {
759
+ return en;
760
+ },
761
+ WEBPACK_RESOURCE_QUERIES: function() {
762
+ return tn;
763
+ }
764
+ });
765
+ const r = "nxtP", n = "nxtI", o = "x-prerender-revalidate", a = "x-prerender-revalidate-if-generated", i = ".prefetch.rsc", l = ".rsc", s = ".action", f = ".json", c = ".meta", p = ".body", u = "x-next-cache-tags", y = "x-next-cache-soft-tags", d = "x-next-revalidated-tags", g = "x-next-revalidate-tag-token", h = 128, b = 256, P = 1024, m = "_N_T_", R = 31536e3, I = "middleware", $ = `(?:src/)?${I}`, C = "instrumentation", j = "private-next-pages", L = "private-dot-next", N = "private-next-root-dir", Q = "private-next-app-dir", k = "private-next-rsc-mod-ref-proxy", O = "private-next-rsc-action-validate", D = "private-next-rsc-server-reference", w = "private-next-rsc-action-encryption", W = "private-next-rsc-action-client-wrapper", ae = "You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict", $e = "You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps", ge = "You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.", ie = "You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps", qr = "can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props", Xr = "pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export", Wr = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?", Vr = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?", zr = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.", Kr = "can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member", Yr = 'You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env', Qr = "Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export", Jr = [
766
+ "app",
767
+ "pages",
768
+ "components",
769
+ "lib",
770
+ "src"
771
+ ], Zr = {
772
+ edge: "edge",
773
+ experimentalEdge: "experimental-edge",
774
+ nodejs: "nodejs"
775
+ }, S = {
776
+ /**
777
+ * The layer for the shared code between the client and server bundles.
778
+ */
779
+ shared: "shared",
780
+ /**
781
+ * React Server Components layer (rsc).
782
+ */
783
+ reactServerComponents: "rsc",
784
+ /**
785
+ * Server Side Rendering layer for app (ssr).
786
+ */
787
+ serverSideRendering: "ssr",
788
+ /**
789
+ * The browser client bundle layer for actions.
790
+ */
791
+ actionBrowser: "action-browser",
792
+ /**
793
+ * The layer for the API routes.
794
+ */
795
+ api: "api",
796
+ /**
797
+ * The layer for the middleware code.
798
+ */
799
+ middleware: "middleware",
800
+ /**
801
+ * The layer for the instrumentation hooks.
802
+ */
803
+ instrument: "instrument",
804
+ /**
805
+ * The layer for assets on the edge.
806
+ */
807
+ edgeAsset: "edge-asset",
808
+ /**
809
+ * The browser client bundle layer for App directory.
810
+ */
811
+ appPagesBrowser: "app-pages-browser",
812
+ /**
813
+ * The server bundle layer for metadata routes.
814
+ */
815
+ appMetadataRoute: "app-metadata-route",
816
+ /**
817
+ * The layer for the server bundle for App Route handlers.
818
+ */
819
+ appRouteHandler: "app-route-handler"
820
+ }, en = {
821
+ ...S,
822
+ GROUP: {
823
+ serverOnly: [
824
+ S.reactServerComponents,
825
+ S.actionBrowser,
826
+ S.appMetadataRoute,
827
+ S.appRouteHandler,
828
+ S.instrument
829
+ ],
830
+ clientOnly: [
831
+ S.serverSideRendering,
832
+ S.appPagesBrowser
833
+ ],
834
+ nonClientServerTarget: [
835
+ // middleware and pages api
836
+ S.middleware,
837
+ S.api
838
+ ],
839
+ app: [
840
+ S.reactServerComponents,
841
+ S.actionBrowser,
842
+ S.appMetadataRoute,
843
+ S.appRouteHandler,
844
+ S.serverSideRendering,
845
+ S.appPagesBrowser,
846
+ S.shared,
847
+ S.instrument
848
+ ]
849
+ }
850
+ }, tn = {
851
+ edgeSSREntry: "__next_edge_ssr_entry__",
852
+ metadata: "__next_metadata__",
853
+ metadataRoute: "__next_metadata_route__",
854
+ metadataImageMeta: "__next_metadata_image_meta__"
855
+ };
856
+ })(io);
857
+ var lo = {}, fr = {};
858
+ (function(t) {
859
+ Object.defineProperty(t, "__esModule", {
860
+ value: !0
861
+ }), Object.defineProperty(t, "addPathPrefix", {
862
+ enumerable: !0,
863
+ get: function() {
864
+ return r;
865
+ }
866
+ });
867
+ const e = yt;
868
+ function r(n, o) {
869
+ if (!n.startsWith("/") || !o)
870
+ return n;
871
+ const { pathname: a, query: i, hash: l } = (0, e.parsePath)(n);
872
+ return "" + o + a + i + l;
873
+ }
874
+ })(fr);
875
+ (function(t) {
876
+ Object.defineProperty(t, "__esModule", {
877
+ value: !0
878
+ }), Object.defineProperty(t, "addLocale", {
879
+ enumerable: !0,
880
+ get: function() {
881
+ return n;
882
+ }
883
+ });
884
+ const e = fr, r = ur;
885
+ function n(o, a, i, l) {
886
+ if (!a || a === i) return o;
887
+ const s = o.toLowerCase();
888
+ return !l && ((0, r.pathHasPrefix)(s, "/api") || (0, r.pathHasPrefix)(s, "/" + a.toLowerCase())) ? o : (0, e.addPathPrefix)(o, "/" + a);
889
+ }
890
+ })(lo);
891
+ var co = {};
892
+ (function(t) {
893
+ Object.defineProperty(t, "__esModule", {
894
+ value: !0
895
+ }), Object.defineProperty(t, "normalizeLocalePath", {
896
+ enumerable: !0,
897
+ get: function() {
898
+ return e;
899
+ }
900
+ });
901
+ function e(r, n) {
902
+ let o;
903
+ const a = r.split("/");
904
+ return (n || []).some((i) => a[1] && a[1].toLowerCase() === i.toLowerCase() ? (o = i, a.splice(1, 1), r = a.join("/") || "/", !0) : !1), {
905
+ pathname: r,
906
+ detectedLocale: o
907
+ };
908
+ }
909
+ })(co);
910
+ var so = {};
911
+ (function(t) {
912
+ Object.defineProperty(t, "__esModule", {
913
+ value: !0
914
+ }), Object.defineProperty(t, "detectDomainLocale", {
915
+ enumerable: !0,
916
+ get: function() {
917
+ return e;
918
+ }
919
+ });
920
+ function e(r, n, o) {
921
+ if (r) {
922
+ o && (o = o.toLowerCase());
923
+ for (const l of r) {
924
+ var a, i;
925
+ const s = (a = l.domain) == null ? void 0 : a.split(":", 1)[0].toLowerCase();
926
+ if (n === s || o === l.defaultLocale.toLowerCase() || (i = l.locales) != null && i.some((f) => f.toLowerCase() === o))
927
+ return l;
928
+ }
929
+ }
930
+ }
931
+ })(so);
932
+ const uo = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), Tt = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(uo).join(e), fo = ({ canonical: t, seo: e, slug: r }) => {
933
+ const n = Array.isArray(r) ? r.join(", ") : r;
934
+ return {
935
+ id: 0,
936
+ Title: `${Array.isArray(r) ? r.map((a) => Tt(a)).join(",") : Tt(r)} - ${e.title}`,
937
+ MetaTagDescription: e.description,
938
+ name: n,
939
+ hasChildren: !1,
940
+ url: t,
941
+ children: []
942
+ };
943
+ }, po = ({ canonical: t, category: e, previousImages: r, seo: n }) => ({
944
+ category: String(e == null ? void 0 : e.id),
945
+ title: (e == null ? void 0 : e.Title) ?? n.title,
946
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
947
+ alternates: { canonical: t },
948
+ openGraph: {
949
+ type: "website",
950
+ title: (e == null ? void 0 : e.Title) ?? n.title,
951
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
952
+ images: Array.isArray(r) ? [...r] : []
953
+ }
954
+ }), yo = ({ items: t, parent: e, apiUrl: r, find: n }) => {
955
+ const o = t.find(
956
+ (i) => i.url.replace(r, "") === decodeURIComponent(e.toLowerCase())
957
+ );
958
+ return (o == null ? void 0 : o.children.find(
959
+ (i) => i.name.toLowerCase() === decodeURIComponent(String(n))
960
+ )) ?? o;
961
+ }, vo = (t) => {
962
+ t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
963
+ }, mo = /* @__PURE__ */ new Set([
964
+ "brand",
965
+ "category",
966
+ "department",
967
+ "subcategory",
968
+ "collection",
969
+ "cluster"
970
+ ]), go = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && mo.has(t == null ? void 0 : t.pageType.toLowerCase()), ho = (t) => ({
971
+ collection: t.Coleção,
972
+ categoryId: t.categoryId,
973
+ current_collection: t["Coleção Atual"],
974
+ items: t.items
975
+ }), _o = (t, e) => t.reduce((r, n) => {
976
+ if (n.items.filter(
977
+ (i) => i.sellers.find((l) => l.commertialOffer.IsAvailable)
978
+ ).length === 0 || (r == null ? void 0 : r.find((i) => (i == null ? void 0 : i.productId) === (n == null ? void 0 : n.productId))) !== void 0)
979
+ return r;
980
+ const a = n.items[0].images.find(
981
+ (i) => e.includes(i.imageLabel)
982
+ );
983
+ return r.push({
984
+ slug: `/${n.linkText}/p`,
985
+ productId: n == null ? void 0 : n.productId,
986
+ textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
987
+ textureAlt: (a == null ? void 0 : a.imageText) ?? ""
988
+ }), r;
989
+ }, []), Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
990
+ __proto__: null,
991
+ createEmptySeoCategory: fo,
992
+ createSeoCategory: po,
993
+ findCategory: yo,
994
+ formattedSimilars: _o,
995
+ isCollectionPageType: go,
996
+ notFindCategoryError: vo,
997
+ responseAdapter: ho
998
+ }, Symbol.toStringTag, { value: "Module" })), he = {
999
+ "responsive-mobile-flex": "_responsive-mobile-flex_1e0ai_1",
1000
+ "responsive-desktop-flex": "_responsive-desktop-flex_1e0ai_15",
1001
+ "responsive-mobile-block": "_responsive-mobile-block_1e0ai_30",
1002
+ "responsive-desktop-block": "_responsive-desktop-block_1e0ai_41"
1003
+ }, pr = async (t, e = {}) => {
1004
+ const { method: r = "GET", body: n, headers: o = {}, priority: a = "auto", cache: i = "default" } = e;
1005
+ return fetch(t, {
1006
+ method: r,
1007
+ headers: {
1008
+ ...o,
1009
+ Accept: "application/json",
1010
+ "Content-Type": "application/json"
1011
+ },
1012
+ priority: a,
1013
+ cache: i,
1014
+ ...n ? { body: JSON.stringify(n) } : {}
1015
+ // not body in get
1016
+ }).then((l) => l.json()).catch((l) => {
1017
+ console.error("[ERROR FETCH VTEX]", l);
1018
+ });
1019
+ }, le = /* @__PURE__ */ new Map();
1020
+ async function Dl(t, e = {}) {
1021
+ var r;
1022
+ try {
1023
+ const { abort: n = !1 } = e, o = new AbortController();
1024
+ n && (le.has(t) && ((r = le.get(t)) == null || r.abort(), le.delete(t)), le.set(t, o));
1025
+ const a = pr(t, {
1026
+ ...e,
1027
+ ...n ? { signal: o.signal } : {}
1028
+ });
1029
+ return n && le.delete(t), a;
1030
+ } catch (n) {
1031
+ if (n.name === "AbortError") {
1032
+ console.log(`[REQUEST CANCELLED]: ${t}`);
1033
+ return;
1034
+ }
1035
+ throw console.error(`[ERROR API]: ${n.message}`), n;
1036
+ }
1037
+ }
1038
+ const Eo = U.object({
1039
+ orderFormId: U.string().required(),
1040
+ coupon: U.string().nullable(),
1041
+ utmSource: U.string().optional(),
1042
+ utmMedium: U.string().optional(),
1043
+ utmCampaign: U.string().optional(),
1044
+ utmiCampaign: U.string().optional(),
1045
+ utmiPart: U.string().optional(),
1046
+ utmipage: U.string().optional()
1047
+ });
1048
+ async function So({
1049
+ apiUrl: t,
1050
+ body: e
1051
+ }) {
1052
+ if (!e) {
1053
+ console.error("[ERROR FETCHING] Body is required");
1054
+ return;
1055
+ }
1056
+ await Eo.validate(e);
1057
+ const { orderFormId: r, utmiPart: n, coupon: o, ...a } = e, i = `${t}/api/checkout/pub/orderForm/${r}/attachments/marketingData`;
1058
+ return pr(i, {
1059
+ method: "POST",
1060
+ body: {
1061
+ orderFormId: r,
1062
+ utmiPart: n ?? r,
1063
+ coupon: o ?? null,
1064
+ ...a
1065
+ }
1066
+ });
1067
+ }
1068
+ const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1069
+ __proto__: null,
1070
+ postMediaData: So
1071
+ }, Symbol.toStringTag, { value: "Module" })), Fl = ({
1072
+ children: t,
1073
+ data: e,
1074
+ SectionZone: r,
1075
+ className: n
1076
+ }) => {
1077
+ var c, p;
1078
+ const o = ((c = e == null ? void 0 : e.filter((u) => {
1079
+ var y, d;
1080
+ return ((d = (y = u.config) == null ? void 0 : y.responsive) == null ? void 0 : d.deviceType) === "mobile";
1081
+ })[0]) == null ? void 0 : c.sections) || [], a = ((p = e == null ? void 0 : e.filter((u) => {
1082
+ var y, d;
1083
+ return ((d = (y = u.config) == null ? void 0 : y.responsive) == null ? void 0 : d.deviceType) === "desktop";
1084
+ })[0]) == null ? void 0 : p.sections) || [], i = o.slice(0, 1), l = o.slice(1, o.length), s = a.slice(0, 1), f = a.slice(1, a.length);
1085
+ return /* @__PURE__ */ Pt(on, { children: [
1086
+ /* @__PURE__ */ Pt("div", { className: n, children: [
1087
+ /* @__PURE__ */ B("div", { className: he["responsive-mobile-flex"], children: /* @__PURE__ */ B(r, { data: i ?? [] }) }),
1088
+ /* @__PURE__ */ B("div", { className: he["responsive-desktop-flex"], children: /* @__PURE__ */ B(r, { data: s ?? [] }) })
1089
+ ] }),
1090
+ t,
1091
+ /* @__PURE__ */ B("div", { className: he["responsive-mobile-flex"], children: /* @__PURE__ */ B(r, { data: l ?? [] }) }),
1092
+ /* @__PURE__ */ B("div", { className: he["responsive-desktop-flex"], children: /* @__PURE__ */ B(r, { data: f ?? [] }) }),
1093
+ /* @__PURE__ */ B(an.Divider, {})
1094
+ ] });
1095
+ };
1096
+ var oe = TypeError;
1097
+ const Ao = {}, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1098
+ __proto__: null,
1099
+ default: Ao
1100
+ }, Symbol.toStringTag, { value: "Module" })), Oo = /* @__PURE__ */ oo(bo);
1101
+ var vt = typeof Map == "function" && Map.prototype, Le = Object.getOwnPropertyDescriptor && vt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, Pe = vt && Le && typeof Le.get == "function" ? Le.get : null, Ct = vt && Map.prototype.forEach, mt = typeof Set == "function" && Set.prototype, Ue = Object.getOwnPropertyDescriptor && mt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Re = mt && Ue && typeof Ue.get == "function" ? Ue.get : null, Nt = mt && Set.prototype.forEach, Po = typeof WeakMap == "function" && WeakMap.prototype, se = Po ? WeakMap.prototype.has : null, Ro = typeof WeakSet == "function" && WeakSet.prototype, ue = Ro ? WeakSet.prototype.has : null, Io = typeof WeakRef == "function" && WeakRef.prototype, Dt = Io ? WeakRef.prototype.deref : null, wo = Boolean.prototype.valueOf, To = Object.prototype.toString, Co = Function.prototype.toString, No = String.prototype.match, gt = String.prototype.slice, H = String.prototype.replace, Do = String.prototype.toUpperCase, xt = String.prototype.toLowerCase, dr = RegExp.prototype.test, Ft = Array.prototype.concat, M = Array.prototype.join, xo = Array.prototype.slice, Mt = Math.floor, it = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Be = Object.getOwnPropertySymbols, lt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, re = typeof Symbol == "function" && typeof Symbol.iterator == "object", fe = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === re || !0) ? Symbol.toStringTag : null, yr = Object.prototype.propertyIsEnumerable, $t = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
1102
+ return t.__proto__;
1103
+ } : null);
1104
+ function Lt(t, e) {
1105
+ if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || dr.call(/e/, e))
1106
+ return e;
1107
+ var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1108
+ if (typeof t == "number") {
1109
+ var n = t < 0 ? -Mt(-t) : Mt(t);
1110
+ if (n !== t) {
1111
+ var o = String(n), a = gt.call(e, o.length + 1);
1112
+ return H.call(o, r, "$&_") + "." + H.call(H.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
1113
+ }
1114
+ }
1115
+ return H.call(e, r, "$&_");
1116
+ }
1117
+ var ct = Oo, Ut = ct.custom, Bt = gr(Ut) ? Ut : null, vr = {
1118
+ __proto__: null,
1119
+ double: '"',
1120
+ single: "'"
1121
+ }, Fo = {
1122
+ __proto__: null,
1123
+ double: /(["\\])/g,
1124
+ single: /(['\\])/g
1125
+ }, Ce = function t(e, r, n, o) {
1126
+ var a = r || {};
1127
+ if (G(a, "quoteStyle") && !G(vr, a.quoteStyle))
1128
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
1129
+ if (G(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
1130
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1131
+ var i = G(a, "customInspect") ? a.customInspect : !0;
1132
+ if (typeof i != "boolean" && i !== "symbol")
1133
+ throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
1134
+ if (G(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
1135
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1136
+ if (G(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
1137
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1138
+ var l = a.numericSeparator;
1139
+ if (typeof e > "u")
1140
+ return "undefined";
1141
+ if (e === null)
1142
+ return "null";
1143
+ if (typeof e == "boolean")
1144
+ return e ? "true" : "false";
1145
+ if (typeof e == "string")
1146
+ return _r(e, a);
1147
+ if (typeof e == "number") {
1148
+ if (e === 0)
1149
+ return 1 / 0 / e > 0 ? "0" : "-0";
1150
+ var s = String(e);
1151
+ return l ? Lt(e, s) : s;
1152
+ }
1153
+ if (typeof e == "bigint") {
1154
+ var f = String(e) + "n";
1155
+ return l ? Lt(e, f) : f;
1156
+ }
1157
+ var c = typeof a.depth > "u" ? 5 : a.depth;
1158
+ if (typeof n > "u" && (n = 0), n >= c && c > 0 && typeof e == "object")
1159
+ return st(e) ? "[Array]" : "[Object]";
1160
+ var p = Jo(a, n);
1161
+ if (typeof o > "u")
1162
+ o = [];
1163
+ else if (hr(o, e) >= 0)
1164
+ return "[Circular]";
1165
+ function u(O, D, w) {
1166
+ if (D && (o = xo.call(o), o.push(D)), w) {
1167
+ var W = {
1168
+ depth: a.depth
1169
+ };
1170
+ return G(a, "quoteStyle") && (W.quoteStyle = a.quoteStyle), t(O, W, n + 1, o);
1171
+ }
1172
+ return t(O, a, n + 1, o);
1173
+ }
1174
+ if (typeof e == "function" && !Gt(e)) {
1175
+ var y = Ho(e), d = _e(e, u);
1176
+ return "[Function" + (y ? ": " + y : " (anonymous)") + "]" + (d.length > 0 ? " { " + M.call(d, ", ") + " }" : "");
1177
+ }
1178
+ if (gr(e)) {
1179
+ var g = re ? H.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : lt.call(e);
1180
+ return typeof e == "object" && !re ? ce(g) : g;
1181
+ }
1182
+ if (Ko(e)) {
1183
+ for (var h = "<" + xt.call(String(e.nodeName)), b = e.attributes || [], P = 0; P < b.length; P++)
1184
+ h += " " + b[P].name + "=" + mr(Mo(b[P].value), "double", a);
1185
+ return h += ">", e.childNodes && e.childNodes.length && (h += "..."), h += "</" + xt.call(String(e.nodeName)) + ">", h;
1186
+ }
1187
+ if (st(e)) {
1188
+ if (e.length === 0)
1189
+ return "[]";
1190
+ var m = _e(e, u);
1191
+ return p && !Qo(m) ? "[" + ut(m, p) + "]" : "[ " + M.call(m, ", ") + " ]";
1192
+ }
1193
+ if (Lo(e)) {
1194
+ var R = _e(e, u);
1195
+ return !("cause" in Error.prototype) && "cause" in e && !yr.call(e, "cause") ? "{ [" + String(e) + "] " + M.call(Ft.call("[cause]: " + u(e.cause), R), ", ") + " }" : R.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + M.call(R, ", ") + " }";
1196
+ }
1197
+ if (typeof e == "object" && i) {
1198
+ if (Bt && typeof e[Bt] == "function" && ct)
1199
+ return ct(e, { depth: c - n });
1200
+ if (i !== "symbol" && typeof e.inspect == "function")
1201
+ return e.inspect();
1202
+ }
1203
+ if (qo(e)) {
1204
+ var I = [];
1205
+ return Ct && Ct.call(e, function(O, D) {
1206
+ I.push(u(D, e, !0) + " => " + u(O, e));
1207
+ }), jt("Map", Pe.call(e), I, p);
1208
+ }
1209
+ if (Vo(e)) {
1210
+ var $ = [];
1211
+ return Nt && Nt.call(e, function(O) {
1212
+ $.push(u(O, e));
1213
+ }), jt("Set", Re.call(e), $, p);
1214
+ }
1215
+ if (Xo(e))
1216
+ return Ge("WeakMap");
1217
+ if (zo(e))
1218
+ return Ge("WeakSet");
1219
+ if (Wo(e))
1220
+ return Ge("WeakRef");
1221
+ if (Bo(e))
1222
+ return ce(u(Number(e)));
1223
+ if (jo(e))
1224
+ return ce(u(it.call(e)));
1225
+ if (Go(e))
1226
+ return ce(wo.call(e));
1227
+ if (Uo(e))
1228
+ return ce(u(String(e)));
1229
+ if (typeof window < "u" && e === window)
1230
+ return "{ [object Window] }";
1231
+ if (typeof globalThis < "u" && e === globalThis || typeof wt < "u" && e === wt)
1232
+ return "{ [object globalThis] }";
1233
+ if (!$o(e) && !Gt(e)) {
1234
+ var C = _e(e, u), j = $t ? $t(e) === Object.prototype : e instanceof Object || e.constructor === Object, L = e instanceof Object ? "" : "null prototype", N = !j && fe && Object(e) === e && fe in e ? gt.call(X(e), 8, -1) : L ? "Object" : "", Q = j || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", k = Q + (N || L ? "[" + M.call(Ft.call([], N || [], L || []), ": ") + "] " : "");
1235
+ return C.length === 0 ? k + "{}" : p ? k + "{" + ut(C, p) + "}" : k + "{ " + M.call(C, ", ") + " }";
1236
+ }
1237
+ return String(e);
1238
+ };
1239
+ function mr(t, e, r) {
1240
+ var n = r.quoteStyle || e, o = vr[n];
1241
+ return o + t + o;
1242
+ }
1243
+ function Mo(t) {
1244
+ return H.call(String(t), /"/g, "&quot;");
1245
+ }
1246
+ function Y(t) {
1247
+ return !fe || !(typeof t == "object" && (fe in t || typeof t[fe] < "u"));
1248
+ }
1249
+ function st(t) {
1250
+ return X(t) === "[object Array]" && Y(t);
1251
+ }
1252
+ function $o(t) {
1253
+ return X(t) === "[object Date]" && Y(t);
1254
+ }
1255
+ function Gt(t) {
1256
+ return X(t) === "[object RegExp]" && Y(t);
1257
+ }
1258
+ function Lo(t) {
1259
+ return X(t) === "[object Error]" && Y(t);
1260
+ }
1261
+ function Uo(t) {
1262
+ return X(t) === "[object String]" && Y(t);
1263
+ }
1264
+ function Bo(t) {
1265
+ return X(t) === "[object Number]" && Y(t);
1266
+ }
1267
+ function Go(t) {
1268
+ return X(t) === "[object Boolean]" && Y(t);
1269
+ }
1270
+ function gr(t) {
1271
+ if (re)
1272
+ return t && typeof t == "object" && t instanceof Symbol;
1273
+ if (typeof t == "symbol")
1274
+ return !0;
1275
+ if (!t || typeof t != "object" || !lt)
1276
+ return !1;
1277
+ try {
1278
+ return lt.call(t), !0;
1279
+ } catch {
1280
+ }
1281
+ return !1;
1282
+ }
1283
+ function jo(t) {
1284
+ if (!t || typeof t != "object" || !it)
1285
+ return !1;
1286
+ try {
1287
+ return it.call(t), !0;
1288
+ } catch {
1289
+ }
1290
+ return !1;
1291
+ }
1292
+ var ko = Object.prototype.hasOwnProperty || function(t) {
1293
+ return t in this;
1294
+ };
1295
+ function G(t, e) {
1296
+ return ko.call(t, e);
1297
+ }
1298
+ function X(t) {
1299
+ return To.call(t);
1300
+ }
1301
+ function Ho(t) {
1302
+ if (t.name)
1303
+ return t.name;
1304
+ var e = No.call(Co.call(t), /^function\s*([\w$]+)/);
1305
+ return e ? e[1] : null;
1306
+ }
1307
+ function hr(t, e) {
1308
+ if (t.indexOf)
1309
+ return t.indexOf(e);
1310
+ for (var r = 0, n = t.length; r < n; r++)
1311
+ if (t[r] === e)
1312
+ return r;
1313
+ return -1;
1314
+ }
1315
+ function qo(t) {
1316
+ if (!Pe || !t || typeof t != "object")
1317
+ return !1;
1318
+ try {
1319
+ Pe.call(t);
1320
+ try {
1321
+ Re.call(t);
1322
+ } catch {
1323
+ return !0;
1324
+ }
1325
+ return t instanceof Map;
1326
+ } catch {
1327
+ }
1328
+ return !1;
1329
+ }
1330
+ function Xo(t) {
1331
+ if (!se || !t || typeof t != "object")
1332
+ return !1;
1333
+ try {
1334
+ se.call(t, se);
1335
+ try {
1336
+ ue.call(t, ue);
1337
+ } catch {
1338
+ return !0;
1339
+ }
1340
+ return t instanceof WeakMap;
1341
+ } catch {
1342
+ }
1343
+ return !1;
1344
+ }
1345
+ function Wo(t) {
1346
+ if (!Dt || !t || typeof t != "object")
1347
+ return !1;
1348
+ try {
1349
+ return Dt.call(t), !0;
1350
+ } catch {
1351
+ }
1352
+ return !1;
1353
+ }
1354
+ function Vo(t) {
1355
+ if (!Re || !t || typeof t != "object")
1356
+ return !1;
1357
+ try {
1358
+ Re.call(t);
1359
+ try {
1360
+ Pe.call(t);
1361
+ } catch {
1362
+ return !0;
1363
+ }
1364
+ return t instanceof Set;
1365
+ } catch {
1366
+ }
1367
+ return !1;
1368
+ }
1369
+ function zo(t) {
1370
+ if (!ue || !t || typeof t != "object")
1371
+ return !1;
1372
+ try {
1373
+ ue.call(t, ue);
1374
+ try {
1375
+ se.call(t, se);
1376
+ } catch {
1377
+ return !0;
1378
+ }
1379
+ return t instanceof WeakSet;
1380
+ } catch {
1381
+ }
1382
+ return !1;
1383
+ }
1384
+ function Ko(t) {
1385
+ return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
1386
+ }
1387
+ function _r(t, e) {
1388
+ if (t.length > e.maxStringLength) {
1389
+ var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
1390
+ return _r(gt.call(t, 0, e.maxStringLength), e) + n;
1391
+ }
1392
+ var o = Fo[e.quoteStyle || "single"];
1393
+ o.lastIndex = 0;
1394
+ var a = H.call(H.call(t, o, "\\$1"), /[\x00-\x1f]/g, Yo);
1395
+ return mr(a, "single", e);
1396
+ }
1397
+ function Yo(t) {
1398
+ var e = t.charCodeAt(0), r = {
1399
+ 8: "b",
1400
+ 9: "t",
1401
+ 10: "n",
1402
+ 12: "f",
1403
+ 13: "r"
1404
+ }[e];
1405
+ return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Do.call(e.toString(16));
1406
+ }
1407
+ function ce(t) {
1408
+ return "Object(" + t + ")";
1409
+ }
1410
+ function Ge(t) {
1411
+ return t + " { ? }";
1412
+ }
1413
+ function jt(t, e, r, n) {
1414
+ var o = n ? ut(r, n) : M.call(r, ", ");
1415
+ return t + " (" + e + ") {" + o + "}";
1416
+ }
1417
+ function Qo(t) {
1418
+ for (var e = 0; e < t.length; e++)
1419
+ if (hr(t[e], `
1420
+ `) >= 0)
1421
+ return !1;
1422
+ return !0;
1423
+ }
1424
+ function Jo(t, e) {
1425
+ var r;
1426
+ if (t.indent === " ")
1427
+ r = " ";
1428
+ else if (typeof t.indent == "number" && t.indent > 0)
1429
+ r = M.call(Array(t.indent + 1), " ");
1430
+ else
1431
+ return null;
1432
+ return {
1433
+ base: r,
1434
+ prev: M.call(Array(e + 1), r)
1435
+ };
1436
+ }
1437
+ function ut(t, e) {
1438
+ if (t.length === 0)
1439
+ return "";
1440
+ var r = `
1441
+ ` + e.prev + e.base;
1442
+ return r + M.call(t, "," + r) + `
1443
+ ` + e.prev;
1444
+ }
1445
+ function _e(t, e) {
1446
+ var r = st(t), n = [];
1447
+ if (r) {
1448
+ n.length = t.length;
1449
+ for (var o = 0; o < t.length; o++)
1450
+ n[o] = G(t, o) ? e(t[o], t) : "";
1451
+ }
1452
+ var a = typeof Be == "function" ? Be(t) : [], i;
1453
+ if (re) {
1454
+ i = {};
1455
+ for (var l = 0; l < a.length; l++)
1456
+ i["$" + a[l]] = a[l];
1457
+ }
1458
+ for (var s in t)
1459
+ G(t, s) && (r && String(Number(s)) === s && s < t.length || re && i["$" + s] instanceof Symbol || (dr.call(/[^\w$]/, s) ? n.push(e(s, t) + ": " + e(t[s], t)) : n.push(s + ": " + e(t[s], t))));
1460
+ if (typeof Be == "function")
1461
+ for (var f = 0; f < a.length; f++)
1462
+ yr.call(t, a[f]) && n.push("[" + e(a[f]) + "]: " + e(t[a[f]], t));
1463
+ return n;
1464
+ }
1465
+ var Zo = Ce, ea = oe, Ne = function(t, e, r) {
1466
+ for (var n = t, o; (o = n.next) != null; n = o)
1467
+ if (o.key === e)
1468
+ return n.next = o.next, r || (o.next = /** @type {NonNullable<typeof list.next>} */
1469
+ t.next, t.next = o), o;
1470
+ }, ta = function(t, e) {
1471
+ if (t) {
1472
+ var r = Ne(t, e);
1473
+ return r && r.value;
1474
+ }
1475
+ }, ra = function(t, e, r) {
1476
+ var n = Ne(t, e);
1477
+ n ? n.value = r : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
1478
+ {
1479
+ // eslint-disable-line no-param-reassign, no-extra-parens
1480
+ key: e,
1481
+ next: t.next,
1482
+ value: r
1483
+ };
1484
+ }, na = function(t, e) {
1485
+ return t ? !!Ne(t, e) : !1;
1486
+ }, oa = function(t, e) {
1487
+ if (t)
1488
+ return Ne(t, e, !0);
1489
+ }, aa = function() {
1490
+ var e, r = {
1491
+ assert: function(n) {
1492
+ if (!r.has(n))
1493
+ throw new ea("Side channel does not contain " + Zo(n));
1494
+ },
1495
+ delete: function(n) {
1496
+ var o = e && e.next, a = oa(e, n);
1497
+ return a && o && o === a && (e = void 0), !!a;
1498
+ },
1499
+ get: function(n) {
1500
+ return ta(e, n);
1501
+ },
1502
+ has: function(n) {
1503
+ return na(e, n);
1504
+ },
1505
+ set: function(n, o) {
1506
+ e || (e = {
1507
+ next: void 0
1508
+ }), ra(
1509
+ /** @type {NonNullable<typeof $o>} */
1510
+ e,
1511
+ n,
1512
+ o
1513
+ );
1514
+ }
1515
+ };
1516
+ return r;
1517
+ }, Er = Object, ia = Error, la = EvalError, ca = RangeError, sa = ReferenceError, ua = SyntaxError, fa = URIError, pa = Math.abs, da = Math.floor, ya = Math.max, va = Math.min, ma = Math.pow, ga = Math.round, ha = Number.isNaN || function(e) {
1518
+ return e !== e;
1519
+ }, _a = ha, Ea = function(e) {
1520
+ return _a(e) || e === 0 ? e : e < 0 ? -1 : 1;
1521
+ }, Sa = Object.getOwnPropertyDescriptor, Se = Sa;
1522
+ if (Se)
1523
+ try {
1524
+ Se([], "length");
1525
+ } catch {
1526
+ Se = null;
1527
+ }
1528
+ var Sr = Se, Ae = Object.defineProperty || !1;
1529
+ if (Ae)
1530
+ try {
1531
+ Ae({}, "a", { value: 1 });
1532
+ } catch {
1533
+ Ae = !1;
1534
+ }
1535
+ var Aa = Ae, je, kt;
1536
+ function ba() {
1537
+ return kt || (kt = 1, je = function() {
1538
+ if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
1539
+ return !1;
1540
+ if (typeof Symbol.iterator == "symbol")
1541
+ return !0;
1542
+ var e = {}, r = Symbol("test"), n = Object(r);
1543
+ if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
1544
+ return !1;
1545
+ var o = 42;
1546
+ e[r] = o;
1547
+ for (var a in e)
1548
+ return !1;
1549
+ if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
1550
+ return !1;
1551
+ var i = Object.getOwnPropertySymbols(e);
1552
+ if (i.length !== 1 || i[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
1553
+ return !1;
1554
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
1555
+ var l = (
1556
+ /** @type {PropertyDescriptor} */
1557
+ Object.getOwnPropertyDescriptor(e, r)
1558
+ );
1559
+ if (l.value !== o || l.enumerable !== !0)
1560
+ return !1;
1561
+ }
1562
+ return !0;
1563
+ }), je;
1564
+ }
1565
+ var ke, Ht;
1566
+ function Oa() {
1567
+ if (Ht) return ke;
1568
+ Ht = 1;
1569
+ var t = typeof Symbol < "u" && Symbol, e = ba();
1570
+ return ke = function() {
1571
+ return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
1572
+ }, ke;
1573
+ }
1574
+ var He, qt;
1575
+ function Ar() {
1576
+ return qt || (qt = 1, He = typeof Reflect < "u" && Reflect.getPrototypeOf || null), He;
1577
+ }
1578
+ var qe, Xt;
1579
+ function br() {
1580
+ if (Xt) return qe;
1581
+ Xt = 1;
1582
+ var t = Er;
1583
+ return qe = t.getPrototypeOf || null, qe;
1584
+ }
1585
+ var Xe, Wt;
1586
+ function Pa() {
1587
+ if (Wt) return Xe;
1588
+ Wt = 1;
1589
+ var t = "Function.prototype.bind called on incompatible ", e = Object.prototype.toString, r = Math.max, n = "[object Function]", o = function(s, f) {
1590
+ for (var c = [], p = 0; p < s.length; p += 1)
1591
+ c[p] = s[p];
1592
+ for (var u = 0; u < f.length; u += 1)
1593
+ c[u + s.length] = f[u];
1594
+ return c;
1595
+ }, a = function(s, f) {
1596
+ for (var c = [], p = f, u = 0; p < s.length; p += 1, u += 1)
1597
+ c[u] = s[p];
1598
+ return c;
1599
+ }, i = function(l, s) {
1600
+ for (var f = "", c = 0; c < l.length; c += 1)
1601
+ f += l[c], c + 1 < l.length && (f += s);
1602
+ return f;
1603
+ };
1604
+ return Xe = function(s) {
1605
+ var f = this;
1606
+ if (typeof f != "function" || e.apply(f) !== n)
1607
+ throw new TypeError(t + f);
1608
+ for (var c = a(arguments, 1), p, u = function() {
1609
+ if (this instanceof p) {
1610
+ var b = f.apply(
1611
+ this,
1612
+ o(c, arguments)
1613
+ );
1614
+ return Object(b) === b ? b : this;
1615
+ }
1616
+ return f.apply(
1617
+ s,
1618
+ o(c, arguments)
1619
+ );
1620
+ }, y = r(0, f.length - c.length), d = [], g = 0; g < y; g++)
1621
+ d[g] = "$" + g;
1622
+ if (p = Function("binder", "return function (" + i(d, ",") + "){ return binder.apply(this,arguments); }")(u), f.prototype) {
1623
+ var h = function() {
1624
+ };
1625
+ h.prototype = f.prototype, p.prototype = new h(), h.prototype = null;
1626
+ }
1627
+ return p;
1628
+ }, Xe;
1629
+ }
1630
+ var We, Vt;
1631
+ function De() {
1632
+ if (Vt) return We;
1633
+ Vt = 1;
1634
+ var t = Pa();
1635
+ return We = Function.prototype.bind || t, We;
1636
+ }
1637
+ var Ve, zt;
1638
+ function ht() {
1639
+ return zt || (zt = 1, Ve = Function.prototype.call), Ve;
1640
+ }
1641
+ var ze, Kt;
1642
+ function Or() {
1643
+ return Kt || (Kt = 1, ze = Function.prototype.apply), ze;
1644
+ }
1645
+ var Ra = typeof Reflect < "u" && Reflect && Reflect.apply, Ia = De(), wa = Or(), Ta = ht(), Ca = Ra, Na = Ca || Ia.call(Ta, wa), Da = De(), xa = oe, Fa = ht(), Ma = Na, Pr = function(e) {
1646
+ if (e.length < 1 || typeof e[0] != "function")
1647
+ throw new xa("a function is required");
1648
+ return Ma(Da, Fa, e);
1649
+ }, Ke, Yt;
1650
+ function $a() {
1651
+ if (Yt) return Ke;
1652
+ Yt = 1;
1653
+ var t = Pr, e = Sr, r;
1654
+ try {
1655
+ r = /** @type {{ __proto__?: typeof Array.prototype }} */
1656
+ [].__proto__ === Array.prototype;
1657
+ } catch (i) {
1658
+ if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
1659
+ throw i;
1660
+ }
1661
+ var n = !!r && e && e(
1662
+ Object.prototype,
1663
+ /** @type {keyof typeof Object.prototype} */
1664
+ "__proto__"
1665
+ ), o = Object, a = o.getPrototypeOf;
1666
+ return Ke = n && typeof n.get == "function" ? t([n.get]) : typeof a == "function" ? (
1667
+ /** @type {import('./get')} */
1668
+ function(l) {
1669
+ return a(l == null ? l : o(l));
1670
+ }
1671
+ ) : !1, Ke;
1672
+ }
1673
+ var Ye, Qt;
1674
+ function La() {
1675
+ if (Qt) return Ye;
1676
+ Qt = 1;
1677
+ var t = Ar(), e = br(), r = $a();
1678
+ return Ye = t ? function(o) {
1679
+ return t(o);
1680
+ } : e ? function(o) {
1681
+ if (!o || typeof o != "object" && typeof o != "function")
1682
+ throw new TypeError("getProto: not an object");
1683
+ return e(o);
1684
+ } : r ? function(o) {
1685
+ return r(o);
1686
+ } : null, Ye;
1687
+ }
1688
+ var Qe, Jt;
1689
+ function Ua() {
1690
+ if (Jt) return Qe;
1691
+ Jt = 1;
1692
+ var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = De();
1693
+ return Qe = r.call(t, e), Qe;
1694
+ }
1695
+ var v, Ba = Er, Ga = ia, ja = la, ka = ca, Ha = sa, ne = ua, te = oe, qa = fa, Xa = pa, Wa = da, Va = ya, za = va, Ka = ma, Ya = ga, Qa = Ea, Rr = Function, Je = function(t) {
1696
+ try {
1697
+ return Rr('"use strict"; return (' + t + ").constructor;")();
1698
+ } catch {
1699
+ }
1700
+ }, de = Sr, Ja = Aa, Ze = function() {
1701
+ throw new te();
1702
+ }, Za = de ? function() {
1703
+ try {
1704
+ return arguments.callee, Ze;
1705
+ } catch {
1706
+ try {
1707
+ return de(arguments, "callee").get;
1708
+ } catch {
1709
+ return Ze;
1710
+ }
1711
+ }
1712
+ }() : Ze, J = Oa()(), A = La(), ei = br(), ti = Ar(), Ir = Or(), ye = ht(), ee = {}, ri = typeof Uint8Array > "u" || !A ? v : A(Uint8Array), K = {
1713
+ __proto__: null,
1714
+ "%AggregateError%": typeof AggregateError > "u" ? v : AggregateError,
1715
+ "%Array%": Array,
1716
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? v : ArrayBuffer,
1717
+ "%ArrayIteratorPrototype%": J && A ? A([][Symbol.iterator]()) : v,
1718
+ "%AsyncFromSyncIteratorPrototype%": v,
1719
+ "%AsyncFunction%": ee,
1720
+ "%AsyncGenerator%": ee,
1721
+ "%AsyncGeneratorFunction%": ee,
1722
+ "%AsyncIteratorPrototype%": ee,
1723
+ "%Atomics%": typeof Atomics > "u" ? v : Atomics,
1724
+ "%BigInt%": typeof BigInt > "u" ? v : BigInt,
1725
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? v : BigInt64Array,
1726
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? v : BigUint64Array,
1727
+ "%Boolean%": Boolean,
1728
+ "%DataView%": typeof DataView > "u" ? v : DataView,
1729
+ "%Date%": Date,
1730
+ "%decodeURI%": decodeURI,
1731
+ "%decodeURIComponent%": decodeURIComponent,
1732
+ "%encodeURI%": encodeURI,
1733
+ "%encodeURIComponent%": encodeURIComponent,
1734
+ "%Error%": Ga,
1735
+ "%eval%": eval,
1736
+ // eslint-disable-line no-eval
1737
+ "%EvalError%": ja,
1738
+ "%Float16Array%": typeof Float16Array > "u" ? v : Float16Array,
1739
+ "%Float32Array%": typeof Float32Array > "u" ? v : Float32Array,
1740
+ "%Float64Array%": typeof Float64Array > "u" ? v : Float64Array,
1741
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? v : FinalizationRegistry,
1742
+ "%Function%": Rr,
1743
+ "%GeneratorFunction%": ee,
1744
+ "%Int8Array%": typeof Int8Array > "u" ? v : Int8Array,
1745
+ "%Int16Array%": typeof Int16Array > "u" ? v : Int16Array,
1746
+ "%Int32Array%": typeof Int32Array > "u" ? v : Int32Array,
1747
+ "%isFinite%": isFinite,
1748
+ "%isNaN%": isNaN,
1749
+ "%IteratorPrototype%": J && A ? A(A([][Symbol.iterator]())) : v,
1750
+ "%JSON%": typeof JSON == "object" ? JSON : v,
1751
+ "%Map%": typeof Map > "u" ? v : Map,
1752
+ "%MapIteratorPrototype%": typeof Map > "u" || !J || !A ? v : A((/* @__PURE__ */ new Map())[Symbol.iterator]()),
1753
+ "%Math%": Math,
1754
+ "%Number%": Number,
1755
+ "%Object%": Ba,
1756
+ "%Object.getOwnPropertyDescriptor%": de,
1757
+ "%parseFloat%": parseFloat,
1758
+ "%parseInt%": parseInt,
1759
+ "%Promise%": typeof Promise > "u" ? v : Promise,
1760
+ "%Proxy%": typeof Proxy > "u" ? v : Proxy,
1761
+ "%RangeError%": ka,
1762
+ "%ReferenceError%": Ha,
1763
+ "%Reflect%": typeof Reflect > "u" ? v : Reflect,
1764
+ "%RegExp%": RegExp,
1765
+ "%Set%": typeof Set > "u" ? v : Set,
1766
+ "%SetIteratorPrototype%": typeof Set > "u" || !J || !A ? v : A((/* @__PURE__ */ new Set())[Symbol.iterator]()),
1767
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? v : SharedArrayBuffer,
1768
+ "%String%": String,
1769
+ "%StringIteratorPrototype%": J && A ? A(""[Symbol.iterator]()) : v,
1770
+ "%Symbol%": J ? Symbol : v,
1771
+ "%SyntaxError%": ne,
1772
+ "%ThrowTypeError%": Za,
1773
+ "%TypedArray%": ri,
1774
+ "%TypeError%": te,
1775
+ "%Uint8Array%": typeof Uint8Array > "u" ? v : Uint8Array,
1776
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? v : Uint8ClampedArray,
1777
+ "%Uint16Array%": typeof Uint16Array > "u" ? v : Uint16Array,
1778
+ "%Uint32Array%": typeof Uint32Array > "u" ? v : Uint32Array,
1779
+ "%URIError%": qa,
1780
+ "%WeakMap%": typeof WeakMap > "u" ? v : WeakMap,
1781
+ "%WeakRef%": typeof WeakRef > "u" ? v : WeakRef,
1782
+ "%WeakSet%": typeof WeakSet > "u" ? v : WeakSet,
1783
+ "%Function.prototype.call%": ye,
1784
+ "%Function.prototype.apply%": Ir,
1785
+ "%Object.defineProperty%": Ja,
1786
+ "%Object.getPrototypeOf%": ei,
1787
+ "%Math.abs%": Xa,
1788
+ "%Math.floor%": Wa,
1789
+ "%Math.max%": Va,
1790
+ "%Math.min%": za,
1791
+ "%Math.pow%": Ka,
1792
+ "%Math.round%": Ya,
1793
+ "%Math.sign%": Qa,
1794
+ "%Reflect.getPrototypeOf%": ti
1795
+ };
1796
+ if (A)
1797
+ try {
1798
+ null.error;
1799
+ } catch (t) {
1800
+ var ni = A(A(t));
1801
+ K["%Error.prototype%"] = ni;
1802
+ }
1803
+ var oi = function t(e) {
1804
+ var r;
1805
+ if (e === "%AsyncFunction%")
1806
+ r = Je("async function () {}");
1807
+ else if (e === "%GeneratorFunction%")
1808
+ r = Je("function* () {}");
1809
+ else if (e === "%AsyncGeneratorFunction%")
1810
+ r = Je("async function* () {}");
1811
+ else if (e === "%AsyncGenerator%") {
1812
+ var n = t("%AsyncGeneratorFunction%");
1813
+ n && (r = n.prototype);
1814
+ } else if (e === "%AsyncIteratorPrototype%") {
1815
+ var o = t("%AsyncGenerator%");
1816
+ o && A && (r = A(o.prototype));
1817
+ }
1818
+ return K[e] = r, r;
1819
+ }, Zt = {
1820
+ __proto__: null,
1821
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
1822
+ "%ArrayPrototype%": ["Array", "prototype"],
1823
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
1824
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
1825
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
1826
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
1827
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
1828
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
1829
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
1830
+ "%BooleanPrototype%": ["Boolean", "prototype"],
1831
+ "%DataViewPrototype%": ["DataView", "prototype"],
1832
+ "%DatePrototype%": ["Date", "prototype"],
1833
+ "%ErrorPrototype%": ["Error", "prototype"],
1834
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
1835
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
1836
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
1837
+ "%FunctionPrototype%": ["Function", "prototype"],
1838
+ "%Generator%": ["GeneratorFunction", "prototype"],
1839
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
1840
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
1841
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
1842
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
1843
+ "%JSONParse%": ["JSON", "parse"],
1844
+ "%JSONStringify%": ["JSON", "stringify"],
1845
+ "%MapPrototype%": ["Map", "prototype"],
1846
+ "%NumberPrototype%": ["Number", "prototype"],
1847
+ "%ObjectPrototype%": ["Object", "prototype"],
1848
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
1849
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
1850
+ "%PromisePrototype%": ["Promise", "prototype"],
1851
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
1852
+ "%Promise_all%": ["Promise", "all"],
1853
+ "%Promise_reject%": ["Promise", "reject"],
1854
+ "%Promise_resolve%": ["Promise", "resolve"],
1855
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
1856
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
1857
+ "%RegExpPrototype%": ["RegExp", "prototype"],
1858
+ "%SetPrototype%": ["Set", "prototype"],
1859
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
1860
+ "%StringPrototype%": ["String", "prototype"],
1861
+ "%SymbolPrototype%": ["Symbol", "prototype"],
1862
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
1863
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
1864
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
1865
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
1866
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
1867
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
1868
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
1869
+ "%URIErrorPrototype%": ["URIError", "prototype"],
1870
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
1871
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
1872
+ }, ve = De(), Ie = Ua(), ai = ve.call(ye, Array.prototype.concat), ii = ve.call(Ir, Array.prototype.splice), er = ve.call(ye, String.prototype.replace), we = ve.call(ye, String.prototype.slice), li = ve.call(ye, RegExp.prototype.exec), ci = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, si = /\\(\\)?/g, ui = function(e) {
1873
+ var r = we(e, 0, 1), n = we(e, -1);
1874
+ if (r === "%" && n !== "%")
1875
+ throw new ne("invalid intrinsic syntax, expected closing `%`");
1876
+ if (n === "%" && r !== "%")
1877
+ throw new ne("invalid intrinsic syntax, expected opening `%`");
1878
+ var o = [];
1879
+ return er(e, ci, function(a, i, l, s) {
1880
+ o[o.length] = l ? er(s, si, "$1") : i || a;
1881
+ }), o;
1882
+ }, fi = function(e, r) {
1883
+ var n = e, o;
1884
+ if (Ie(Zt, n) && (o = Zt[n], n = "%" + o[0] + "%"), Ie(K, n)) {
1885
+ var a = K[n];
1886
+ if (a === ee && (a = oi(n)), typeof a > "u" && !r)
1887
+ throw new te("intrinsic " + e + " exists, but is not available. Please file an issue!");
1888
+ return {
1889
+ alias: o,
1890
+ name: n,
1891
+ value: a
1892
+ };
1893
+ }
1894
+ throw new ne("intrinsic " + e + " does not exist!");
1895
+ }, _t = function(e, r) {
1896
+ if (typeof e != "string" || e.length === 0)
1897
+ throw new te("intrinsic name must be a non-empty string");
1898
+ if (arguments.length > 1 && typeof r != "boolean")
1899
+ throw new te('"allowMissing" argument must be a boolean');
1900
+ if (li(/^%?[^%]*%?$/, e) === null)
1901
+ throw new ne("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1902
+ var n = ui(e), o = n.length > 0 ? n[0] : "", a = fi("%" + o + "%", r), i = a.name, l = a.value, s = !1, f = a.alias;
1903
+ f && (o = f[0], ii(n, ai([0, 1], f)));
1904
+ for (var c = 1, p = !0; c < n.length; c += 1) {
1905
+ var u = n[c], y = we(u, 0, 1), d = we(u, -1);
1906
+ if ((y === '"' || y === "'" || y === "`" || d === '"' || d === "'" || d === "`") && y !== d)
1907
+ throw new ne("property names with quotes must have matching quotes");
1908
+ if ((u === "constructor" || !p) && (s = !0), o += "." + u, i = "%" + o + "%", Ie(K, i))
1909
+ l = K[i];
1910
+ else if (l != null) {
1911
+ if (!(u in l)) {
1912
+ if (!r)
1913
+ throw new te("base intrinsic for " + e + " exists, but the property is not available.");
1914
+ return;
1915
+ }
1916
+ if (de && c + 1 >= n.length) {
1917
+ var g = de(l, u);
1918
+ p = !!g, p && "get" in g && !("originalValue" in g.get) ? l = g.get : l = l[u];
1919
+ } else
1920
+ p = Ie(l, u), l = l[u];
1921
+ p && !s && (K[i] = l);
1922
+ }
1923
+ }
1924
+ return l;
1925
+ }, wr = _t, Tr = Pr, pi = Tr([wr("%String.prototype.indexOf%")]), Cr = function(e, r) {
1926
+ var n = (
1927
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1928
+ wr(e, !!r)
1929
+ );
1930
+ return typeof n == "function" && pi(e, ".prototype.") > -1 ? Tr(
1931
+ /** @type {const} */
1932
+ [n]
1933
+ ) : n;
1934
+ }, di = _t, me = Cr, yi = Ce, vi = oe, tr = di("%Map%", !0), mi = me("Map.prototype.get", !0), gi = me("Map.prototype.set", !0), hi = me("Map.prototype.has", !0), _i = me("Map.prototype.delete", !0), Ei = me("Map.prototype.size", !0), Nr = !!tr && /** @type {Exclude<import('.'), false>} */
1935
+ function() {
1936
+ var e, r = {
1937
+ assert: function(n) {
1938
+ if (!r.has(n))
1939
+ throw new vi("Side channel does not contain " + yi(n));
1940
+ },
1941
+ delete: function(n) {
1942
+ if (e) {
1943
+ var o = _i(e, n);
1944
+ return Ei(e) === 0 && (e = void 0), o;
1945
+ }
1946
+ return !1;
1947
+ },
1948
+ get: function(n) {
1949
+ if (e)
1950
+ return mi(e, n);
1951
+ },
1952
+ has: function(n) {
1953
+ return e ? hi(e, n) : !1;
1954
+ },
1955
+ set: function(n, o) {
1956
+ e || (e = new tr()), gi(e, n, o);
1957
+ }
1958
+ };
1959
+ return r;
1960
+ }, Si = _t, xe = Cr, Ai = Ce, Ee = Nr, bi = oe, Z = Si("%WeakMap%", !0), Oi = xe("WeakMap.prototype.get", !0), Pi = xe("WeakMap.prototype.set", !0), Ri = xe("WeakMap.prototype.has", !0), Ii = xe("WeakMap.prototype.delete", !0), wi = Z ? (
1961
+ /** @type {Exclude<import('.'), false>} */
1962
+ function() {
1963
+ var e, r, n = {
1964
+ assert: function(o) {
1965
+ if (!n.has(o))
1966
+ throw new bi("Side channel does not contain " + Ai(o));
1967
+ },
1968
+ delete: function(o) {
1969
+ if (Z && o && (typeof o == "object" || typeof o == "function")) {
1970
+ if (e)
1971
+ return Ii(e, o);
1972
+ } else if (Ee && r)
1973
+ return r.delete(o);
1974
+ return !1;
1975
+ },
1976
+ get: function(o) {
1977
+ return Z && o && (typeof o == "object" || typeof o == "function") && e ? Oi(e, o) : r && r.get(o);
1978
+ },
1979
+ has: function(o) {
1980
+ return Z && o && (typeof o == "object" || typeof o == "function") && e ? Ri(e, o) : !!r && r.has(o);
1981
+ },
1982
+ set: function(o, a) {
1983
+ Z && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new Z()), Pi(e, o, a)) : Ee && (r || (r = Ee()), r.set(o, a));
1984
+ }
1985
+ };
1986
+ return n;
1987
+ }
1988
+ ) : Ee, Ti = oe, Ci = Ce, Ni = aa, Di = Nr, xi = wi, Fi = xi || Di || Ni, Dr = function() {
1989
+ var e, r = {
1990
+ assert: function(n) {
1991
+ if (!r.has(n))
1992
+ throw new Ti("Side channel does not contain " + Ci(n));
1993
+ },
1994
+ delete: function(n) {
1995
+ return !!e && e.delete(n);
1996
+ },
1997
+ get: function(n) {
1998
+ return e && e.get(n);
1999
+ },
2000
+ has: function(n) {
2001
+ return !!e && e.has(n);
2002
+ },
2003
+ set: function(n, o) {
2004
+ e || (e = Fi()), e.set(n, o);
2005
+ }
2006
+ };
2007
+ return r;
2008
+ }, Mi = String.prototype.replace, $i = /%20/g, et = {
2009
+ RFC1738: "RFC1738",
2010
+ RFC3986: "RFC3986"
2011
+ }, Et = {
2012
+ default: et.RFC3986,
2013
+ formatters: {
2014
+ RFC1738: function(t) {
2015
+ return Mi.call(t, $i, "+");
2016
+ },
2017
+ RFC3986: function(t) {
2018
+ return String(t);
2019
+ }
2020
+ },
2021
+ RFC1738: et.RFC1738,
2022
+ RFC3986: et.RFC3986
2023
+ }, Li = Et, Ui = Dr, tt = Object.prototype.hasOwnProperty, z = Array.isArray, Fe = Ui(), xr = function(e, r) {
2024
+ return Fe.set(e, r), e;
2025
+ }, Te = function(e) {
2026
+ return Fe.has(e);
2027
+ }, ft = function(e) {
2028
+ return Fe.get(e);
2029
+ }, Fr = function(e, r) {
2030
+ Fe.set(e, r);
2031
+ }, x = function() {
2032
+ for (var t = [], e = 0; e < 256; ++e)
2033
+ t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
2034
+ return t;
2035
+ }(), Bi = function(e) {
2036
+ for (; e.length > 1; ) {
2037
+ var r = e.pop(), n = r.obj[r.prop];
2038
+ if (z(n)) {
2039
+ for (var o = [], a = 0; a < n.length; ++a)
2040
+ typeof n[a] < "u" && o.push(n[a]);
2041
+ r.obj[r.prop] = o;
2042
+ }
2043
+ }
2044
+ }, St = function(e, r) {
2045
+ for (var n = r && r.plainObjects ? { __proto__: null } : {}, o = 0; o < e.length; ++o)
2046
+ typeof e[o] < "u" && (n[o] = e[o]);
2047
+ return n;
2048
+ }, Gi = function t(e, r, n) {
2049
+ if (!r)
2050
+ return e;
2051
+ if (typeof r != "object" && typeof r != "function") {
2052
+ if (z(e))
2053
+ e.push(r);
2054
+ else if (e && typeof e == "object")
2055
+ if (Te(e)) {
2056
+ var o = ft(e) + 1;
2057
+ e[o] = r, Fr(e, o);
2058
+ } else (n && (n.plainObjects || n.allowPrototypes) || !tt.call(Object.prototype, r)) && (e[r] = !0);
2059
+ else
2060
+ return [e, r];
2061
+ return e;
2062
+ }
2063
+ if (!e || typeof e != "object") {
2064
+ if (Te(r)) {
2065
+ for (var a = Object.keys(r), i = n && n.plainObjects ? { __proto__: null, 0: e } : { 0: e }, l = 0; l < a.length; l++) {
2066
+ var s = parseInt(a[l], 10);
2067
+ i[s + 1] = r[a[l]];
2068
+ }
2069
+ return xr(i, ft(r) + 1);
2070
+ }
2071
+ return [e].concat(r);
2072
+ }
2073
+ var f = e;
2074
+ return z(e) && !z(r) && (f = St(e, n)), z(e) && z(r) ? (r.forEach(function(c, p) {
2075
+ if (tt.call(e, p)) {
2076
+ var u = e[p];
2077
+ u && typeof u == "object" && c && typeof c == "object" ? e[p] = t(u, c, n) : e.push(c);
2078
+ } else
2079
+ e[p] = c;
2080
+ }), e) : Object.keys(r).reduce(function(c, p) {
2081
+ var u = r[p];
2082
+ return tt.call(c, p) ? c[p] = t(c[p], u, n) : c[p] = u, c;
2083
+ }, f);
2084
+ }, ji = function(e, r) {
2085
+ return Object.keys(r).reduce(function(n, o) {
2086
+ return n[o] = r[o], n;
2087
+ }, e);
2088
+ }, ki = function(t, e, r) {
2089
+ var n = t.replace(/\+/g, " ");
2090
+ if (r === "iso-8859-1")
2091
+ return n.replace(/%[0-9a-f]{2}/gi, unescape);
2092
+ try {
2093
+ return decodeURIComponent(n);
2094
+ } catch {
2095
+ return n;
2096
+ }
2097
+ }, rt = 1024, Hi = function(e, r, n, o, a) {
2098
+ if (e.length === 0)
2099
+ return e;
2100
+ var i = e;
2101
+ if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1")
2102
+ return escape(i).replace(/%u[0-9a-f]{4}/gi, function(y) {
2103
+ return "%26%23" + parseInt(y.slice(2), 16) + "%3B";
2104
+ });
2105
+ for (var l = "", s = 0; s < i.length; s += rt) {
2106
+ for (var f = i.length >= rt ? i.slice(s, s + rt) : i, c = [], p = 0; p < f.length; ++p) {
2107
+ var u = f.charCodeAt(p);
2108
+ if (u === 45 || u === 46 || u === 95 || u === 126 || u >= 48 && u <= 57 || u >= 65 && u <= 90 || u >= 97 && u <= 122 || a === Li.RFC1738 && (u === 40 || u === 41)) {
2109
+ c[c.length] = f.charAt(p);
2110
+ continue;
2111
+ }
2112
+ if (u < 128) {
2113
+ c[c.length] = x[u];
2114
+ continue;
2115
+ }
2116
+ if (u < 2048) {
2117
+ c[c.length] = x[192 | u >> 6] + x[128 | u & 63];
2118
+ continue;
2119
+ }
2120
+ if (u < 55296 || u >= 57344) {
2121
+ c[c.length] = x[224 | u >> 12] + x[128 | u >> 6 & 63] + x[128 | u & 63];
2122
+ continue;
2123
+ }
2124
+ p += 1, u = 65536 + ((u & 1023) << 10 | f.charCodeAt(p) & 1023), c[c.length] = x[240 | u >> 18] + x[128 | u >> 12 & 63] + x[128 | u >> 6 & 63] + x[128 | u & 63];
2125
+ }
2126
+ l += c.join("");
2127
+ }
2128
+ return l;
2129
+ }, qi = function(e) {
2130
+ for (var r = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < r.length; ++o)
2131
+ for (var a = r[o], i = a.obj[a.prop], l = Object.keys(i), s = 0; s < l.length; ++s) {
2132
+ var f = l[s], c = i[f];
2133
+ typeof c == "object" && c !== null && n.indexOf(c) === -1 && (r.push({ obj: i, prop: f }), n.push(c));
2134
+ }
2135
+ return Bi(r), e;
2136
+ }, Xi = function(e) {
2137
+ return Object.prototype.toString.call(e) === "[object RegExp]";
2138
+ }, Wi = function(e) {
2139
+ return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
2140
+ }, Vi = function(e, r, n, o) {
2141
+ if (Te(e)) {
2142
+ var a = ft(e) + 1;
2143
+ return e[a] = r, Fr(e, a), e;
2144
+ }
2145
+ var i = [].concat(e, r);
2146
+ return i.length > n ? xr(St(i, { plainObjects: o }), i.length - 1) : i;
2147
+ }, zi = function(e, r) {
2148
+ if (z(e)) {
2149
+ for (var n = [], o = 0; o < e.length; o += 1)
2150
+ n.push(r(e[o]));
2151
+ return n;
2152
+ }
2153
+ return r(e);
2154
+ }, Mr = {
2155
+ arrayToObject: St,
2156
+ assign: ji,
2157
+ combine: Vi,
2158
+ compact: qi,
2159
+ decode: ki,
2160
+ encode: Hi,
2161
+ isBuffer: Wi,
2162
+ isOverflow: Te,
2163
+ isRegExp: Xi,
2164
+ maybeMap: zi,
2165
+ merge: Gi
2166
+ }, $r = Dr, be = Mr, pe = Et, Ki = Object.prototype.hasOwnProperty, Lr = {
2167
+ brackets: function(e) {
2168
+ return e + "[]";
2169
+ },
2170
+ comma: "comma",
2171
+ indices: function(e, r) {
2172
+ return e + "[" + r + "]";
2173
+ },
2174
+ repeat: function(e) {
2175
+ return e;
2176
+ }
2177
+ }, F = Array.isArray, Yi = Array.prototype.push, Ur = function(t, e) {
2178
+ Yi.apply(t, F(e) ? e : [e]);
2179
+ }, Qi = Date.prototype.toISOString, rr = pe.default, E = {
2180
+ addQueryPrefix: !1,
2181
+ allowDots: !1,
2182
+ allowEmptyArrays: !1,
2183
+ arrayFormat: "indices",
2184
+ charset: "utf-8",
2185
+ charsetSentinel: !1,
2186
+ commaRoundTrip: !1,
2187
+ delimiter: "&",
2188
+ encode: !0,
2189
+ encodeDotInKeys: !1,
2190
+ encoder: be.encode,
2191
+ encodeValuesOnly: !1,
2192
+ filter: void 0,
2193
+ format: rr,
2194
+ formatter: pe.formatters[rr],
2195
+ // deprecated
2196
+ indices: !1,
2197
+ serializeDate: function(e) {
2198
+ return Qi.call(e);
2199
+ },
2200
+ skipNulls: !1,
2201
+ strictNullHandling: !1
2202
+ }, Ji = function(e) {
2203
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
2204
+ }, nt = {}, Zi = function t(e, r, n, o, a, i, l, s, f, c, p, u, y, d, g, h, b, P) {
2205
+ for (var m = e, R = P, I = 0, $ = !1; (R = R.get(nt)) !== void 0 && !$; ) {
2206
+ var C = R.get(e);
2207
+ if (I += 1, typeof C < "u") {
2208
+ if (C === I)
2209
+ throw new RangeError("Cyclic object value");
2210
+ $ = !0;
2211
+ }
2212
+ typeof R.get(nt) > "u" && (I = 0);
2213
+ }
2214
+ if (typeof c == "function" ? m = c(r, m) : m instanceof Date ? m = y(m) : n === "comma" && F(m) && (m = be.maybeMap(m, function(ie) {
2215
+ return ie instanceof Date ? y(ie) : ie;
2216
+ })), m === null) {
2217
+ if (i)
2218
+ return f && !h ? f(r, E.encoder, b, "key", d) : r;
2219
+ m = "";
2220
+ }
2221
+ if (Ji(m) || be.isBuffer(m)) {
2222
+ if (f) {
2223
+ var j = h ? r : f(r, E.encoder, b, "key", d);
2224
+ return [g(j) + "=" + g(f(m, E.encoder, b, "value", d))];
2225
+ }
2226
+ return [g(r) + "=" + g(String(m))];
2227
+ }
2228
+ var L = [];
2229
+ if (typeof m > "u")
2230
+ return L;
2231
+ var N;
2232
+ if (n === "comma" && F(m))
2233
+ h && f && (m = be.maybeMap(m, f)), N = [{ value: m.length > 0 ? m.join(",") || null : void 0 }];
2234
+ else if (F(c))
2235
+ N = c;
2236
+ else {
2237
+ var Q = Object.keys(m);
2238
+ N = p ? Q.sort(p) : Q;
2239
+ }
2240
+ var k = s ? String(r).replace(/\./g, "%2E") : String(r), O = o && F(m) && m.length === 1 ? k + "[]" : k;
2241
+ if (a && F(m) && m.length === 0)
2242
+ return O + "[]";
2243
+ for (var D = 0; D < N.length; ++D) {
2244
+ var w = N[D], W = typeof w == "object" && w && typeof w.value < "u" ? w.value : m[w];
2245
+ if (!(l && W === null)) {
2246
+ var ae = u && s ? String(w).replace(/\./g, "%2E") : String(w), $e = F(m) ? typeof n == "function" ? n(O, ae) : O : O + (u ? "." + ae : "[" + ae + "]");
2247
+ P.set(e, I);
2248
+ var ge = $r();
2249
+ ge.set(nt, P), Ur(L, t(
2250
+ W,
2251
+ $e,
2252
+ n,
2253
+ o,
2254
+ a,
2255
+ i,
2256
+ l,
2257
+ s,
2258
+ n === "comma" && h && F(m) ? null : f,
2259
+ c,
2260
+ p,
2261
+ u,
2262
+ y,
2263
+ d,
2264
+ g,
2265
+ h,
2266
+ b,
2267
+ ge
2268
+ ));
2269
+ }
2270
+ }
2271
+ return L;
2272
+ }, el = function(e) {
2273
+ if (!e)
2274
+ return E;
2275
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
2276
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
2277
+ if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
2278
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
2279
+ if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
2280
+ throw new TypeError("Encoder has to be a function.");
2281
+ var r = e.charset || E.charset;
2282
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
2283
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
2284
+ var n = pe.default;
2285
+ if (typeof e.format < "u") {
2286
+ if (!Ki.call(pe.formatters, e.format))
2287
+ throw new TypeError("Unknown format option provided.");
2288
+ n = e.format;
2289
+ }
2290
+ var o = pe.formatters[n], a = E.filter;
2291
+ (typeof e.filter == "function" || F(e.filter)) && (a = e.filter);
2292
+ var i;
2293
+ if (e.arrayFormat in Lr ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = E.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
2294
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
2295
+ var l = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : E.allowDots : !!e.allowDots;
2296
+ return {
2297
+ addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : E.addQueryPrefix,
2298
+ allowDots: l,
2299
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : E.allowEmptyArrays,
2300
+ arrayFormat: i,
2301
+ charset: r,
2302
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : E.charsetSentinel,
2303
+ commaRoundTrip: !!e.commaRoundTrip,
2304
+ delimiter: typeof e.delimiter > "u" ? E.delimiter : e.delimiter,
2305
+ encode: typeof e.encode == "boolean" ? e.encode : E.encode,
2306
+ encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : E.encodeDotInKeys,
2307
+ encoder: typeof e.encoder == "function" ? e.encoder : E.encoder,
2308
+ encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : E.encodeValuesOnly,
2309
+ filter: a,
2310
+ format: n,
2311
+ formatter: o,
2312
+ serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : E.serializeDate,
2313
+ skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : E.skipNulls,
2314
+ sort: typeof e.sort == "function" ? e.sort : null,
2315
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : E.strictNullHandling
2316
+ };
2317
+ }, tl = function(t, e) {
2318
+ var r = t, n = el(e), o, a;
2319
+ typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : F(n.filter) && (a = n.filter, o = a);
2320
+ var i = [];
2321
+ if (typeof r != "object" || r === null)
2322
+ return "";
2323
+ var l = Lr[n.arrayFormat], s = l === "comma" && n.commaRoundTrip;
2324
+ o || (o = Object.keys(r)), n.sort && o.sort(n.sort);
2325
+ for (var f = $r(), c = 0; c < o.length; ++c) {
2326
+ var p = o[c], u = r[p];
2327
+ n.skipNulls && u === null || Ur(i, Zi(
2328
+ u,
2329
+ p,
2330
+ l,
2331
+ s,
2332
+ n.allowEmptyArrays,
2333
+ n.strictNullHandling,
2334
+ n.skipNulls,
2335
+ n.encodeDotInKeys,
2336
+ n.encode ? n.encoder : null,
2337
+ n.filter,
2338
+ n.sort,
2339
+ n.allowDots,
2340
+ n.serializeDate,
2341
+ n.format,
2342
+ n.formatter,
2343
+ n.encodeValuesOnly,
2344
+ n.charset,
2345
+ f
2346
+ ));
2347
+ }
2348
+ var y = i.join(n.delimiter), d = n.addQueryPrefix === !0 ? "?" : "";
2349
+ return n.charsetSentinel && (n.charset === "iso-8859-1" ? d += "utf8=%26%2310003%3B&" : d += "utf8=%E2%9C%93&"), y.length > 0 ? d + y : "";
2350
+ }, q = Mr, Oe = Object.prototype.hasOwnProperty, nr = Array.isArray, _ = {
2351
+ allowDots: !1,
2352
+ allowEmptyArrays: !1,
2353
+ allowPrototypes: !1,
2354
+ allowSparse: !1,
2355
+ arrayLimit: 20,
2356
+ charset: "utf-8",
2357
+ charsetSentinel: !1,
2358
+ comma: !1,
2359
+ decodeDotInKeys: !1,
2360
+ decoder: q.decode,
2361
+ delimiter: "&",
2362
+ depth: 5,
2363
+ duplicates: "combine",
2364
+ ignoreQueryPrefix: !1,
2365
+ interpretNumericEntities: !1,
2366
+ parameterLimit: 1e3,
2367
+ parseArrays: !0,
2368
+ plainObjects: !1,
2369
+ strictDepth: !1,
2370
+ strictNullHandling: !1,
2371
+ throwOnLimitExceeded: !1
2372
+ }, rl = function(t) {
2373
+ return t.replace(/&#(\d+);/g, function(e, r) {
2374
+ return String.fromCharCode(parseInt(r, 10));
2375
+ });
2376
+ }, Br = function(t, e, r) {
2377
+ if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1)
2378
+ return t.split(",");
2379
+ if (e.throwOnLimitExceeded && r >= e.arrayLimit)
2380
+ throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
2381
+ return t;
2382
+ }, nl = "utf8=%26%2310003%3B", ol = "utf8=%E2%9C%93", al = function(e, r) {
2383
+ var n = { __proto__: null }, o = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
2384
+ o = o.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2385
+ var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, i = o.split(
2386
+ r.delimiter,
2387
+ r.throwOnLimitExceeded ? a + 1 : a
2388
+ );
2389
+ if (r.throwOnLimitExceeded && i.length > a)
2390
+ throw new RangeError("Parameter limit exceeded. Only " + a + " parameter" + (a === 1 ? "" : "s") + " allowed.");
2391
+ var l = -1, s, f = r.charset;
2392
+ if (r.charsetSentinel)
2393
+ for (s = 0; s < i.length; ++s)
2394
+ i[s].indexOf("utf8=") === 0 && (i[s] === ol ? f = "utf-8" : i[s] === nl && (f = "iso-8859-1"), l = s, s = i.length);
2395
+ for (s = 0; s < i.length; ++s)
2396
+ if (s !== l) {
2397
+ var c = i[s], p = c.indexOf("]="), u = p === -1 ? c.indexOf("=") : p + 1, y, d;
2398
+ if (u === -1 ? (y = r.decoder(c, _.decoder, f, "key"), d = r.strictNullHandling ? null : "") : (y = r.decoder(c.slice(0, u), _.decoder, f, "key"), y !== null && (d = q.maybeMap(
2399
+ Br(
2400
+ c.slice(u + 1),
2401
+ r,
2402
+ nr(n[y]) ? n[y].length : 0
2403
+ ),
2404
+ function(h) {
2405
+ return r.decoder(h, _.decoder, f, "value");
2406
+ }
2407
+ ))), d && r.interpretNumericEntities && f === "iso-8859-1" && (d = rl(String(d))), c.indexOf("[]=") > -1 && (d = nr(d) ? [d] : d), y !== null) {
2408
+ var g = Oe.call(n, y);
2409
+ g && r.duplicates === "combine" ? n[y] = q.combine(
2410
+ n[y],
2411
+ d,
2412
+ r.arrayLimit,
2413
+ r.plainObjects
2414
+ ) : (!g || r.duplicates === "last") && (n[y] = d);
2415
+ }
2416
+ }
2417
+ return n;
2418
+ }, il = function(t, e, r, n) {
2419
+ var o = 0;
2420
+ if (t.length > 0 && t[t.length - 1] === "[]") {
2421
+ var a = t.slice(0, -1).join("");
2422
+ o = Array.isArray(e) && e[a] ? e[a].length : 0;
2423
+ }
2424
+ for (var i = n ? e : Br(e, r, o), l = t.length - 1; l >= 0; --l) {
2425
+ var s, f = t[l];
2426
+ if (f === "[]" && r.parseArrays)
2427
+ q.isOverflow(i) ? s = i : s = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : q.combine(
2428
+ [],
2429
+ i,
2430
+ r.arrayLimit,
2431
+ r.plainObjects
2432
+ );
2433
+ else {
2434
+ s = r.plainObjects ? { __proto__: null } : {};
2435
+ var c = f.charAt(0) === "[" && f.charAt(f.length - 1) === "]" ? f.slice(1, -1) : f, p = r.decodeDotInKeys ? c.replace(/%2E/g, ".") : c, u = parseInt(p, 10);
2436
+ !r.parseArrays && p === "" ? s = { 0: i } : !isNaN(u) && f !== p && String(u) === p && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (s = [], s[u] = i) : p !== "__proto__" && (s[p] = i);
2437
+ }
2438
+ i = s;
2439
+ }
2440
+ return i;
2441
+ }, ll = function(e, r) {
2442
+ var n = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e;
2443
+ if (r.depth <= 0)
2444
+ return !r.plainObjects && Oe.call(Object.prototype, n) && !r.allowPrototypes ? void 0 : [n];
2445
+ var o = /(\[[^[\]]*])/, a = /(\[[^[\]]*])/g, i = o.exec(n), l = i ? n.slice(0, i.index) : n, s = [];
2446
+ if (l) {
2447
+ if (!r.plainObjects && Oe.call(Object.prototype, l) && !r.allowPrototypes)
2448
+ return;
2449
+ s.push(l);
2450
+ }
2451
+ for (var f = 0; (i = a.exec(n)) !== null && f < r.depth; ) {
2452
+ f += 1;
2453
+ var c = i[1].slice(1, -1);
2454
+ if (!r.plainObjects && Oe.call(Object.prototype, c) && !r.allowPrototypes)
2455
+ return;
2456
+ s.push(i[1]);
2457
+ }
2458
+ if (i) {
2459
+ if (r.strictDepth === !0)
2460
+ throw new RangeError("Input depth exceeded depth option of " + r.depth + " and strictDepth is true");
2461
+ s.push("[" + n.slice(i.index) + "]");
2462
+ }
2463
+ return s;
2464
+ }, cl = function(e, r, n, o) {
2465
+ if (e) {
2466
+ var a = ll(e, n);
2467
+ if (a)
2468
+ return il(a, r, n, o);
2469
+ }
2470
+ }, sl = function(e) {
2471
+ if (!e)
2472
+ return _;
2473
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
2474
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
2475
+ if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
2476
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
2477
+ if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
2478
+ throw new TypeError("Decoder has to be a function.");
2479
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
2480
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
2481
+ if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
2482
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
2483
+ var r = typeof e.charset > "u" ? _.charset : e.charset, n = typeof e.duplicates > "u" ? _.duplicates : e.duplicates;
2484
+ if (n !== "combine" && n !== "first" && n !== "last")
2485
+ throw new TypeError("The duplicates option must be either combine, first, or last");
2486
+ var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : _.allowDots : !!e.allowDots;
2487
+ return {
2488
+ allowDots: o,
2489
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : _.allowEmptyArrays,
2490
+ allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : _.allowPrototypes,
2491
+ allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : _.allowSparse,
2492
+ arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : _.arrayLimit,
2493
+ charset: r,
2494
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : _.charsetSentinel,
2495
+ comma: typeof e.comma == "boolean" ? e.comma : _.comma,
2496
+ decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : _.decodeDotInKeys,
2497
+ decoder: typeof e.decoder == "function" ? e.decoder : _.decoder,
2498
+ delimiter: typeof e.delimiter == "string" || q.isRegExp(e.delimiter) ? e.delimiter : _.delimiter,
2499
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2500
+ depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : _.depth,
2501
+ duplicates: n,
2502
+ ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
2503
+ interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : _.interpretNumericEntities,
2504
+ parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : _.parameterLimit,
2505
+ parseArrays: e.parseArrays !== !1,
2506
+ plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : _.plainObjects,
2507
+ strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : _.strictDepth,
2508
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : _.strictNullHandling,
2509
+ throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
2510
+ };
2511
+ }, ul = function(t, e) {
2512
+ var r = sl(e);
2513
+ if (t === "" || t === null || typeof t > "u")
2514
+ return r.plainObjects ? { __proto__: null } : {};
2515
+ for (var n = typeof t == "string" ? al(t, r) : t, o = r.plainObjects ? { __proto__: null } : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
2516
+ var l = a[i], s = cl(l, n[l], r, typeof t == "string");
2517
+ o = q.merge(o, s, r);
2518
+ }
2519
+ return r.allowSparse === !0 ? o : q.compact(o);
2520
+ }, fl = tl, pl = ul, dl = Et, yl = {
2521
+ formats: dl,
2522
+ parse: pl,
2523
+ stringify: fl
2524
+ };
2525
+ const vl = /* @__PURE__ */ no(yl);
2526
+ async function Me(t, e = {}, r) {
2527
+ const { cms: n = "cms" } = e;
2528
+ return fetch(`${t.href}?${vl.stringify(e)}`, {
2529
+ method: "GET",
2530
+ cache: r ? "no-store" : "default",
2531
+ headers: {
2532
+ Accept: "application/json",
2533
+ "Content-Type": "application/json",
2534
+ "strapi-encode-source-maps": n === "strapi" && r ? "true" : "false"
2535
+ // strapi
2536
+ }
2537
+ });
2538
+ }
2539
+ function At(t, e) {
2540
+ return !(e != null && e.cms) || (e == null ? void 0 : e.cms) === "vtex" ? `https://${e == null ? void 0 : e.storeId}.myvtex.com/_v/cms/api/${e == null ? void 0 : e.name}/${t}` : String(
2541
+ new URL(`api/${t}`, process.env.NEXT_PUBLIC_API_URL)
2542
+ );
2543
+ }
2544
+ function Gr(t) {
2545
+ return Array.isArray(t) && t.length > 0 ? t[0] : Array.isArray(t) ? null : t;
2546
+ }
2547
+ async function jr(t, e = [], r = {}) {
2548
+ var n;
2549
+ if ((r == null ? void 0 : r.contentType) === t) {
2550
+ const o = (r == null ? void 0 : r.previewMode) === "true", a = (r == null ? void 0 : r.documentId) ?? "", i = a && ((n = String(a)) != null && n.length) ? `/${r.documentId}` : "", l = new URL(At(`${t}${i}`, r)), s = await Me(l, r, o);
2551
+ if (!s.ok)
2552
+ return console.error(`[Error fetching preview data]: ${t} - status: ${s.statusText}`), [];
2553
+ const f = await s.json(), c = e.findIndex((p) => p.documentId === f.id);
2554
+ return c !== -1 ? (e[c] = f, [...e]) : [f, ...e];
2555
+ }
2556
+ return e;
2557
+ }
2558
+ const Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2559
+ __proto__: null,
2560
+ createUrl: At,
2561
+ fetchCMS: Me,
2562
+ mergePreviewDocument: jr,
2563
+ spreadStrapiData: Gr
2564
+ }, Symbol.toStringTag, { value: "Module" }));
2565
+ async function kr(t, e = {}, r) {
2566
+ const n = !!(e != null && e.previewMode), o = await Me(t, e, n);
2567
+ if (!o.ok)
2568
+ return console.log(
2569
+ `Failed to fetch Strapi (url=${String(t)}, status=${o.status})`
2570
+ ), { status: 404, data: [], error: String(o.status) };
2571
+ const { data: a } = await o.json();
2572
+ return a ? {
2573
+ status: 200,
2574
+ data: r ? Gr(a) : a
2575
+ } : { status: 404, data: [], error: "No data found" };
2576
+ }
2577
+ async function Hr(t, e, r = {}) {
2578
+ const n = (r == null ? void 0 : r.previewId) ?? "", o = (r == null ? void 0 : r.previewMode) === "true", a = { ...r, versionId: n }, i = [];
2579
+ let l = 1, s = 0, f = !0;
2580
+ try {
2581
+ do {
2582
+ const c = await Me(e, { ...a, page: l }, o).then((p) => p.json()).catch((p) => (console.error("Error fetching VTEX CMS data:", p), console.error("Error URL:", e.toString()), null));
2583
+ l === 1 && (s = c.totalItems), Array.isArray(c == null ? void 0 : c.data) && i.push(...c.data), f = !!(c != null && c.hasNextPage), l++;
2584
+ } while (f && i.length < s);
2585
+ if (o && i.length > 0) {
2586
+ if (!t || !n)
2587
+ throw new Error(
2588
+ "contentType and previewId are required for preview mode in vtexCMSData"
2589
+ );
2590
+ const c = await jr(
2591
+ t,
2592
+ i,
2593
+ a
2594
+ );
2595
+ return {
2596
+ status: c.length > 0 ? 200 : 404,
2597
+ data: c
2598
+ };
2599
+ }
2600
+ return {
2601
+ status: i.length ? 200 : 404,
2602
+ data: i
2603
+ };
2604
+ } catch (c) {
2605
+ return {
2606
+ status: 500,
2607
+ data: [],
2608
+ error: c instanceof Error ? c.message : String(c)
2609
+ };
2610
+ }
2611
+ }
2612
+ const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2613
+ __proto__: null,
2614
+ strapiCMSData: kr,
2615
+ vtexCMSData: Hr
2616
+ }, Symbol.toStringTag, { value: "Module" }));
2617
+ async function ml({
2618
+ contentType: t,
2619
+ documentId: e,
2620
+ versionId: r,
2621
+ CMS_PROJECT_NAME: n
2622
+ }) {
2623
+ const o = e && e.length ? `/${e}` : "", a = r && r.length ? `?versionId=${r}` : "";
2624
+ return lr(
2625
+ `/cms/api/${n}/${t}${o}${a}`,
2626
+ { cache: "no-cache" }
2627
+ );
2628
+ }
2629
+ async function gl(t, e = {}, r) {
2630
+ const { cms: n = "vtex" } = e ?? {};
2631
+ try {
2632
+ const o = new URL(At(t, e));
2633
+ return n !== "vtex" ? kr(o, e, r) : Hr(t, o, e);
2634
+ } catch (o) {
2635
+ return console.error(`[Fetch ContentType Error CMS ${n}]`, o), r ? { status: 400, data: null } : { status: 200, data: [] };
2636
+ }
2637
+ }
2638
+ const Ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2639
+ __proto__: null,
2640
+ fetchContentType: gl,
2641
+ getCMSContentType: ml
2642
+ }, Symbol.toStringTag, { value: "Module" }));
2643
+ export {
2644
+ Zn as $,
2645
+ yn as A,
2646
+ wl as B,
2647
+ Cl as C,
2648
+ Sl as D,
2649
+ Al as E,
2650
+ ot as F,
2651
+ hn as G,
2652
+ ln as H,
2653
+ vn as I,
2654
+ yt as J,
2655
+ ao as K,
2656
+ ur as L,
2657
+ io as M,
2658
+ lo as N,
2659
+ co as O,
2660
+ so as P,
2661
+ fr as Q,
2662
+ no as R,
2663
+ _o as S,
2664
+ cn as T,
2665
+ _n as U,
2666
+ Sn as V,
2667
+ he as W,
2668
+ Hn as X,
2669
+ fn as Y,
2670
+ gn as Z,
2671
+ Il as _,
2672
+ dn as a,
2673
+ Vn as a0,
2674
+ wt as a1,
2675
+ Tl as a2,
2676
+ So as a3,
2677
+ gl as a4,
2678
+ Fl as a5,
2679
+ pr as a6,
2680
+ Rl as a7,
2681
+ Dl as a8,
2682
+ Pl as a9,
2683
+ xl as aa,
2684
+ Ll as ab,
2685
+ Ml as ac,
2686
+ $l as ad,
2687
+ ro as ae,
2688
+ Nl as af,
2689
+ mn as b,
2690
+ On as c,
2691
+ Rn as d,
2692
+ Mn as e,
2693
+ kn as f,
2694
+ sn as g,
2695
+ Bn as h,
2696
+ bn as i,
2697
+ Ln as j,
2698
+ $n as k,
2699
+ T as l,
2700
+ Gn as m,
2701
+ Xn as n,
2702
+ bl as o,
2703
+ Ol as p,
2704
+ qn as q,
2705
+ Pn as r,
2706
+ or as s,
2707
+ xn as t,
2708
+ Nn as u,
2709
+ In as v,
2710
+ Un as w,
2711
+ sr as x,
2712
+ lr as y,
2713
+ un as z
2714
+ };