@soma-vertical-web/multi-lib-sacurai 0.0.1 → 0.0.3

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,1906 @@
1
+ import { jsxs as at, Fragment as dr, jsx as P } from "react/jsx-runtime";
2
+ import { Utils as vr } from "@soma-vertical-web/core-components";
3
+ const Ge = (t, e = !0) => Intl.NumberFormat("pt-BR", {
4
+ style: "currency",
5
+ currency: "BRL",
6
+ minimumFractionDigits: e ? 2 : 0
7
+ }).format(t), mr = ({ valueInCents: t, hasFree: e, freeTaxMessage: r }) => t === 0 ? e ? r : Ge(0) : Ge(t / 100), gr = (t, e) => {
8
+ const n = (t - e) * 100 / t;
9
+ return Math.floor(n);
10
+ }, Ft = (t, e) => {
11
+ const [r, n] = t.split(e);
12
+ return { name: r.trim(), size: n ? n.trim() : "" };
13
+ }, hr = (t, e) => {
14
+ if (!t)
15
+ return {};
16
+ const [r, n] = t.split(e);
17
+ return { color: r == null ? void 0 : r.trim(), size: n == null ? void 0 : n.trim() };
18
+ }, _r = (t, e = "tamanho") => {
19
+ if (t.additionalProperty) {
20
+ const [r] = t.additionalProperty;
21
+ return r != null && r.name ? r.name.toLocaleLowerCase() === e ? r.value : t.name : "";
22
+ }
23
+ return t.name;
24
+ }, br = (t, e) => t.replace(e, "").trim(), Sr = (t) => t.replace(/\//g, ""), wr = ({ items: t, NAME_SPLIT_SYMBOL: e }) => {
25
+ const r = {
26
+ price: 0,
27
+ listPrice: 0,
28
+ installments: {
29
+ count: 0,
30
+ value: 0
31
+ }
32
+ }, n = (i, c) => {
33
+ var s;
34
+ c && (c.sellerId = i.sellerId, c.sellerName = i.sellerName, c.available = !0, c.isSellerDefault = i.sellerDefault);
35
+ const {
36
+ Price: l,
37
+ ListPrice: u,
38
+ PaymentOptions: { installmentOptions: f }
39
+ } = i.commertialOffer;
40
+ r.price = l, r.listPrice = u;
41
+ const p = (s = f == null ? void 0 : f[0]) == null ? void 0 : s.installments;
42
+ if (p) {
43
+ const { count: v, value: d } = p[p.length - 1];
44
+ r.installments = {
45
+ count: v,
46
+ value: d / 100
47
+ };
48
+ }
49
+ };
50
+ let o = !0;
51
+ const a = t.reduce((i, c) => {
52
+ var f;
53
+ const l = {
54
+ name: c.name,
55
+ sku: c.itemId,
56
+ value: ((f = c.Tamanho) == null ? void 0 : f[0]) ?? Ft(c.nameComplete ?? c.name, e).size,
57
+ available: !1,
58
+ sellerId: "",
59
+ sellerName: "",
60
+ isSellerDefault: !1
61
+ }, u = c.sellers.filter((p) => (p.sellerDefault && p.commertialOffer.IsAvailable && (l.available = !0, n(p, l)), p.commertialOffer.IsAvailable));
62
+ return !l.isSellerDefault && u.length > 0 && (l.available = !0, n(u[0], {
63
+ ...l,
64
+ sellerId: u[0].sellerId,
65
+ sellerName: u[0].sellerName
66
+ })), l.available === !1 && (o = !1), i.push(l), i;
67
+ }, []);
68
+ return {
69
+ ...r,
70
+ sizes: a,
71
+ allSizesAvailable: o
72
+ };
73
+ }, xr = (t) => t ? !t.offers.offers.find(({ quantity: e = 0 }) => e > 0) : !1, Ar = (t, e) => {
74
+ const r = t.find(
75
+ (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0 && n.seller.identifier === e
76
+ );
77
+ return r || t.find(
78
+ (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0
79
+ );
80
+ }, Or = ({ images: t, TEXTURE_IMAGE: e }) => t.find((r) => e.includes(r.imageLabel)) ?? t[0], Er = (t, e) => {
81
+ const r = /\/ids\/(\d+)\//, n = t.match(r);
82
+ return n ? t.replace(
83
+ `/${n[1]}/`,
84
+ `/${n[1]}-${e.width}-${e.height}/`
85
+ ) : t;
86
+ }, Pr = (t, e) => {
87
+ const r = /\/ids\/(\d+)-(\d+)-(\d+)\//, n = t.match(r);
88
+ return n ? t.replace(
89
+ `/${n[1]}-${n[2]}-${n[3]}/`,
90
+ `/${n[1]}-${e.width}-${e.height}/`
91
+ ) : t;
92
+ }, $r = ({
93
+ images: t,
94
+ label: e
95
+ }) => {
96
+ const r = t.filter(
97
+ (n) => n.keywords === e.first || n.keywords === e.second || n.alternateName === e.first || n.alternateName === e.second
98
+ );
99
+ return r.length === 0 ? t.slice(0, 2) : r;
100
+ }, Ir = (t) => {
101
+ const [e, r] = t.split("/").map(Number);
102
+ if (Number.isNaN(e) || Number.isNaN(r))
103
+ throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
104
+ return r / e;
105
+ }, Rr = (t, e, r) => {
106
+ e && (t ? (e.getAttribute("src") || (e.src = r ?? ""), e.play()) : e.pause());
107
+ }, xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
108
+ __proto__: null,
109
+ disableSKU: xr,
110
+ formatPriceToCurrency: Ge,
111
+ freightParsePrice: mr,
112
+ getAspectRatio: Ir,
113
+ getColorAndSizeFromSkuName: hr,
114
+ getDiscountPercent: gr,
115
+ getFirstImages: $r,
116
+ getProductNameWithoutSku: br,
117
+ getSKUName: _r,
118
+ getSkuInfos: wr,
119
+ getThumbImage: Or,
120
+ getValidOffer: Ar,
121
+ removeSlashes: Sr,
122
+ resizingImg: Er,
123
+ setVideoPlay: Rr,
124
+ splitNameAndSizeFromFullName: Ft,
125
+ updatedResizedImg: Pr
126
+ }, Symbol.toStringTag, { value: "Module" })), it = "fuzzy", lt = "operator", kr = (t) => ({
127
+ isDepartment: t != null && t.length ? t[0].key === "category-1" : !1
128
+ }), Ai = (t, e) => {
129
+ const r = decodeURIComponent(e ?? "").slice(1).split("/");
130
+ return t.map((n) => {
131
+ if (n.key === "category-2" && n.__typename === "FacetBoolean") {
132
+ const o = n.values;
133
+ return {
134
+ ...n,
135
+ values: o.filter(
136
+ (a) => !r.find(
137
+ (i) => i.toLowerCase() === a.value || i.toLowerCase() === a.name.toLowerCase()
138
+ )
139
+ )
140
+ };
141
+ }
142
+ return n;
143
+ });
144
+ }, Nt = (t, e) => e ? t === "category-1" : !1, Tr = (t) => t.key === "operator" && (t.value === "and" || t.value === "or"), Cr = (t) => t.type === "TEXT", Dr = (t) => t.key === "fuzzy" && (t.value === "0" || t.value === "1" || t.value === "auto"), Fr = (t) => {
145
+ const { key: e, name: r, values: n } = t;
146
+ return {
147
+ __typename: "FacetBoolean",
148
+ key: e,
149
+ label: r,
150
+ values: n.slice().sort((o, a) => o.name.localeCompare(a.name))
151
+ };
152
+ }, Nr = ({ key: t, values: e }) => ({
153
+ __typename: "FacetRange",
154
+ key: t,
155
+ values: e
156
+ }), Oi = (t, e, r) => {
157
+ if (!(t instanceof Object) || !("facets" in t))
158
+ return [];
159
+ const { facets: n = [] } = t, o = e != null && e.length ? e[0].key === "category-1" : !1;
160
+ return n.filter(
161
+ (i) => !r || !Nt(i.key, o)
162
+ ).map(
163
+ (i) => Cr(i) ? Fr(i) : Nr(i)
164
+ );
165
+ }, Ei = (t, e) => {
166
+ const r = t.find(({ key: o }) => o === it) ?? null, n = t.find(({ key: o }) => o === lt) ?? null;
167
+ r && Dr(r) && e.append(it, r.value), n && Tr(n) && e.append(lt, n.value);
168
+ }, Mr = (t) => t.map((e) => {
169
+ const [r, n] = e.split("/");
170
+ return { key: r, value: n };
171
+ }), Pi = (t, e) => {
172
+ const r = decodeURIComponent(e ?? "").slice(1).split("/"), n = t.filter(({ value: a }) => !r.includes(decodeURIComponent(a))).map((a) => ({
173
+ ...a,
174
+ value: decodeURIComponent(a.value)
175
+ })), { isDepartment: o } = kr(n);
176
+ return n == null ? void 0 : n.filter((a) => !Nt(a.key, o));
177
+ }, $i = ({ pathname: t, searchParams: e }, r) => {
178
+ const n = e.get("sort") ?? "", o = e.get("query") ?? null, a = parseInt(e.get("page") ?? "1", 10);
179
+ return {
180
+ sort: n,
181
+ facets: Mr(r),
182
+ term: o,
183
+ base: o ? "" : t,
184
+ page: a
185
+ };
186
+ }, Ii = (t) => {
187
+ const e = new URLSearchParams();
188
+ return Object.entries(t).forEach(([r, n]) => {
189
+ Array.isArray(n) ? n.forEach((o) => e.append(r, o)) : n !== void 0 && e.append(r, n);
190
+ }), e;
191
+ }, Ri = (t, e, r = 24, n = 1, o) => {
192
+ const a = `/search?query=${e ?? ""}&count=${r}&page=${n}${o ? `&sort=${o.replace("_", ":")}` : ""}`;
193
+ t.push(a);
194
+ };
195
+ var ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
196
+ function jr(t) {
197
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
198
+ }
199
+ function Br(t) {
200
+ if (t.__esModule) return t;
201
+ var e = t.default;
202
+ if (typeof e == "function") {
203
+ var r = function n() {
204
+ return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
205
+ };
206
+ r.prototype = e.prototype;
207
+ } else r = {};
208
+ return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) {
209
+ var o = Object.getOwnPropertyDescriptor(t, n);
210
+ Object.defineProperty(r, n, o.get ? o : {
211
+ enumerable: !0,
212
+ get: function() {
213
+ return t[n];
214
+ }
215
+ });
216
+ }), r;
217
+ }
218
+ const Lr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), ft = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(Lr).join(e), Ur = ({ canonical: t, seo: e, slug: r }) => {
219
+ const n = Array.isArray(r) ? r.join(", ") : r;
220
+ return {
221
+ id: 0,
222
+ Title: `${Array.isArray(r) ? r.map((a) => ft(a)).join(",") : ft(r)} - ${e.title}`,
223
+ MetaTagDescription: e.description,
224
+ name: n,
225
+ hasChildren: !1,
226
+ url: t,
227
+ children: []
228
+ };
229
+ }, zr = ({ canonical: t, category: e, previousImages: r, seo: n }) => ({
230
+ category: String(e == null ? void 0 : e.id),
231
+ title: (e == null ? void 0 : e.Title) ?? n.title,
232
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
233
+ alternates: { canonical: t },
234
+ openGraph: {
235
+ type: "website",
236
+ title: (e == null ? void 0 : e.Title) ?? n.title,
237
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
238
+ images: Array.isArray(r) ? [...r] : []
239
+ }
240
+ }), Wr = ({ items: t, parent: e, apiUrl: r, find: n }) => {
241
+ const o = t.find(
242
+ (i) => i.url.replace(r, "") === decodeURIComponent(e.toLowerCase())
243
+ );
244
+ return (o == null ? void 0 : o.children.find(
245
+ (i) => i.name.toLowerCase() === decodeURIComponent(String(n))
246
+ )) ?? o;
247
+ }, Gr = (t) => {
248
+ t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
249
+ }, qr = /* @__PURE__ */ new Set([
250
+ "brand",
251
+ "category",
252
+ "department",
253
+ "subcategory",
254
+ "collection",
255
+ "cluster"
256
+ ]), Hr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && qr.has(t == null ? void 0 : t.pageType.toLowerCase()), Kr = (t) => ({
257
+ collection: t.Coleção,
258
+ categoryId: t.categoryId,
259
+ current_collection: t["Coleção Atual"],
260
+ items: t.items
261
+ }), Mt = (t, e) => t.reduce((r, n) => {
262
+ if (n.items.filter(
263
+ (i) => i.sellers.find((c) => c.commertialOffer.IsAvailable)
264
+ ).length === 0 || (r == null ? void 0 : r.find((i) => (i == null ? void 0 : i.productId) === (n == null ? void 0 : n.productId))) !== void 0)
265
+ return r;
266
+ const a = n.items[0].images.find(
267
+ (i) => e.includes(i.imageLabel)
268
+ );
269
+ return r.push({
270
+ slug: `/${n.linkText}/p`,
271
+ productId: n == null ? void 0 : n.productId,
272
+ textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
273
+ textureAlt: (a == null ? void 0 : a.imageText) ?? ""
274
+ }), r;
275
+ }, []), ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
276
+ __proto__: null,
277
+ createEmptySeoCategory: Ur,
278
+ createSeoCategory: zr,
279
+ findCategory: Wr,
280
+ formattedSimilars: Mt,
281
+ isCollectionPageType: Hr,
282
+ notFindCategoryError: Gr,
283
+ responseAdapter: Kr
284
+ }, Symbol.toStringTag, { value: "Module" })), Ti = async ({ productId: t, TEXTURE_IMAGE: e, apiUrl: r }) => {
285
+ try {
286
+ const n = await fetch(`${r}/api/catalog_system/pub/products/crossselling/similars/${t}`, {
287
+ priority: "low",
288
+ headers: {
289
+ "X-VTEX-API-AppKey": process.env.vtexAppKey ?? "",
290
+ "X-VTEX-API-AppToken": process.env.vtexAppToken ?? ""
291
+ }
292
+ });
293
+ if (!n.ok)
294
+ throw new Error("Erro ao buscar similares.");
295
+ const o = await n.json();
296
+ return Mt(o, e);
297
+ } catch (n) {
298
+ return console.error(n), [];
299
+ }
300
+ }, se = {
301
+ "responsive-mobile-flex": "_responsive-mobile-flex_1e0ai_1",
302
+ "responsive-desktop-flex": "_responsive-desktop-flex_1e0ai_15",
303
+ "responsive-mobile-block": "_responsive-mobile-block_1e0ai_30",
304
+ "responsive-desktop-block": "_responsive-desktop-block_1e0ai_41"
305
+ }, Vr = "_header_9xxjk_57", Qr = "_actions_9xxjk_131", Jr = "_breadcrumb_9xxjk_142", Xr = "_credits_9xxjk_157", Yr = "_pdplinks_9xxjk_185", Zr = "_similars_9xxjk_212", en = "_sizes_9xxjk_251", tn = "_measurementTable_9xxjk_267", rn = "_measurementHead_9xxjk_280", nn = "_measurementRows_9xxjk_285", on = "_measurementRowsTitle_9xxjk_302", an = "_measurementRowsText_9xxjk_314", ln = "_measurementImage_9xxjk_325", cn = "_measurementImageContainer_9xxjk_328", fn = "_measurementContent_9xxjk_337", sn = "_measurementTitle_9xxjk_341", un = "_measurementClose_9xxjk_352", pn = "_productref_9xxjk_417", yn = "_slideOut_9xxjk_1", dn = "_slideIn_9xxjk_1", vn = "_content_9xxjk_397", mn = "_pdp_9xxjk_185", gn = "_divider_9xxjk_575", Ci = {
306
+ "bottom-navigation": "_bottom-navigation_9xxjk_1",
307
+ "bottom-navigation__credits-modifier": "_bottom-navigation__credits-modifier_9xxjk_18",
308
+ "bottom-navigation__header": "_bottom-navigation__header_9xxjk_21",
309
+ "bottom-navigation__header-content": "_bottom-navigation__header-content_9xxjk_26",
310
+ "golden-tag-content": "_golden-tag-content_9xxjk_45",
311
+ "bottom-navigation__price-and-promo": "_bottom-navigation__price-and-promo_9xxjk_48",
312
+ header: Vr,
313
+ "golden-tag": "_golden-tag_9xxjk_45",
314
+ "golden-tag-video": "_golden-tag-video_9xxjk_86",
315
+ "golden-tag-content-text": "_golden-tag-content-text_9xxjk_105",
316
+ actions: Qr,
317
+ "add-to-cart": "_add-to-cart_9xxjk_138",
318
+ breadcrumb: Jr,
319
+ "breadcrumb--active": "_breadcrumb--active_9xxjk_147",
320
+ credits: Xr,
321
+ "gallery-carousel-modifier": "_gallery-carousel-modifier_9xxjk_162",
322
+ pdplinks: Yr,
323
+ "links-wrapper": "_links-wrapper_9xxjk_195",
324
+ similars: Zr,
325
+ "similars-info": "_similars-info_9xxjk_224",
326
+ "toggle-style-modifier": "_toggle-style-modifier_9xxjk_233",
327
+ "accessibility-info": "_accessibility-info_9xxjk_237",
328
+ sizes: en,
329
+ "price-wrapper": "_price-wrapper_9xxjk_263",
330
+ measurementTable: tn,
331
+ measurementHead: rn,
332
+ measurementRows: nn,
333
+ measurementRowsTitle: on,
334
+ measurementRowsText: an,
335
+ measurementImage: ln,
336
+ measurementImageContainer: cn,
337
+ measurementContent: fn,
338
+ measurementTitle: sn,
339
+ measurementClose: un,
340
+ "tabs-root-modifier": "_tabs-root-modifier_9xxjk_358",
341
+ "tabs-list-modifier": "_tabs-list-modifier_9xxjk_376",
342
+ "tabs-item-modifier": "_tabs-item-modifier_9xxjk_393",
343
+ "content-wrapper": "_content-wrapper_9xxjk_397",
344
+ productref: pn,
345
+ "tabs-panel": "_tabs-panel_9xxjk_428",
346
+ "tabs-panel-exit": "_tabs-panel-exit_9xxjk_434",
347
+ slideOut: yn,
348
+ "tabs-panel-enter": "_tabs-panel-enter_9xxjk_438",
349
+ slideIn: dn,
350
+ content: vn,
351
+ pdp: mn,
352
+ "pdp-main": "_pdp-main_9xxjk_496",
353
+ "pdp-main__gallery-wrapper": "_pdp-main__gallery-wrapper_9xxjk_501",
354
+ "pdp-main__info": "_pdp-main__info_9xxjk_518",
355
+ "pdp-main__info-main-content": "_pdp-main__info-main-content_9xxjk_533",
356
+ "pdp-main__info-subsection": "_pdp-main__info-subsection_9xxjk_533",
357
+ "subsection-product-info": "_subsection-product-info_9xxjk_544",
358
+ "subsection-similars": "_subsection-similars_9xxjk_547",
359
+ "subsection-sizes": "_subsection-sizes_9xxjk_550",
360
+ "subsection-actions": "_subsection-actions_9xxjk_553",
361
+ "pdp-main__info-secondary-content": "_pdp-main__info-secondary-content_9xxjk_557",
362
+ "sections-title": "_sections-title_9xxjk_563",
363
+ divider: gn,
364
+ "breadcrumbs-desktop": "_breadcrumbs-desktop_9xxjk_580",
365
+ "breadcrumbs-mobile": "_breadcrumbs-mobile_9xxjk_589"
366
+ }, Di = ({
367
+ children: t,
368
+ data: e,
369
+ SectionZone: r,
370
+ className: n
371
+ }) => {
372
+ var f, p;
373
+ const o = ((f = e == null ? void 0 : e.filter((s) => {
374
+ var v, d;
375
+ return ((d = (v = s.config) == null ? void 0 : v.responsive) == null ? void 0 : d.deviceType) === "mobile";
376
+ })[0]) == null ? void 0 : f.sections) || [], a = ((p = e == null ? void 0 : e.filter((s) => {
377
+ var v, d;
378
+ return ((d = (v = s.config) == null ? void 0 : v.responsive) == null ? void 0 : d.deviceType) === "desktop";
379
+ })[0]) == null ? void 0 : p.sections) || [], i = o.slice(0, 1), c = o.slice(1, o.length), l = a.slice(0, 1), u = a.slice(1, a.length);
380
+ return /* @__PURE__ */ at(dr, { children: [
381
+ /* @__PURE__ */ at("div", { className: n, children: [
382
+ /* @__PURE__ */ P("div", { className: se["responsive-mobile-flex"], children: /* @__PURE__ */ P(r, { data: i ?? [] }) }),
383
+ /* @__PURE__ */ P("div", { className: se["responsive-desktop-flex"], children: /* @__PURE__ */ P(r, { data: l ?? [] }) })
384
+ ] }),
385
+ t,
386
+ /* @__PURE__ */ P("div", { className: se["responsive-mobile-flex"], children: /* @__PURE__ */ P(r, { data: c ?? [] }) }),
387
+ /* @__PURE__ */ P("div", { className: se["responsive-desktop-flex"], children: /* @__PURE__ */ P(r, { data: u ?? [] }) }),
388
+ /* @__PURE__ */ P(vr.Divider, {})
389
+ ] });
390
+ };
391
+ var J = TypeError;
392
+ const hn = {}, _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
393
+ __proto__: null,
394
+ default: hn
395
+ }, Symbol.toStringTag, { value: "Module" })), bn = /* @__PURE__ */ Br(_n);
396
+ var Xe = typeof Map == "function" && Map.prototype, Pe = Object.getOwnPropertyDescriptor && Xe ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, me = Xe && Pe && typeof Pe.get == "function" ? Pe.get : null, st = Xe && Map.prototype.forEach, Ye = typeof Set == "function" && Set.prototype, $e = Object.getOwnPropertyDescriptor && Ye ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ge = Ye && $e && typeof $e.get == "function" ? $e.get : null, ut = Ye && Set.prototype.forEach, Sn = typeof WeakMap == "function" && WeakMap.prototype, ee = Sn ? WeakMap.prototype.has : null, wn = typeof WeakSet == "function" && WeakSet.prototype, te = wn ? WeakSet.prototype.has : null, xn = typeof WeakRef == "function" && WeakRef.prototype, pt = xn ? WeakRef.prototype.deref : null, An = Boolean.prototype.valueOf, On = Object.prototype.toString, En = Function.prototype.toString, Pn = String.prototype.match, Ze = String.prototype.slice, D = String.prototype.replace, $n = String.prototype.toUpperCase, yt = String.prototype.toLowerCase, jt = RegExp.prototype.test, dt = Array.prototype.concat, O = Array.prototype.join, In = Array.prototype.slice, vt = Math.floor, qe = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Ie = Object.getOwnPropertySymbols, He = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, V = typeof Symbol == "function" && typeof Symbol.iterator == "object", re = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === V || !0) ? Symbol.toStringTag : null, Bt = Object.prototype.propertyIsEnumerable, mt = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
397
+ return t.__proto__;
398
+ } : null);
399
+ function gt(t, e) {
400
+ if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || jt.call(/e/, e))
401
+ return e;
402
+ var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
403
+ if (typeof t == "number") {
404
+ var n = t < 0 ? -vt(-t) : vt(t);
405
+ if (n !== t) {
406
+ var o = String(n), a = Ze.call(e, o.length + 1);
407
+ return D.call(o, r, "$&_") + "." + D.call(D.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
408
+ }
409
+ }
410
+ return D.call(e, r, "$&_");
411
+ }
412
+ var Ke = bn, ht = Ke.custom, _t = zt(ht) ? ht : null, Lt = {
413
+ __proto__: null,
414
+ double: '"',
415
+ single: "'"
416
+ }, Rn = {
417
+ __proto__: null,
418
+ double: /(["\\])/g,
419
+ single: /(['\\])/g
420
+ }, be = function t(e, r, n, o) {
421
+ var a = r || {};
422
+ if ($(a, "quoteStyle") && !$(Lt, a.quoteStyle))
423
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
424
+ if ($(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
425
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
426
+ var i = $(a, "customInspect") ? a.customInspect : !0;
427
+ if (typeof i != "boolean" && i !== "symbol")
428
+ throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
429
+ if ($(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
430
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
431
+ if ($(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
432
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
433
+ var c = a.numericSeparator;
434
+ if (typeof e > "u")
435
+ return "undefined";
436
+ if (e === null)
437
+ return "null";
438
+ if (typeof e == "boolean")
439
+ return e ? "true" : "false";
440
+ if (typeof e == "string")
441
+ return Gt(e, a);
442
+ if (typeof e == "number") {
443
+ if (e === 0)
444
+ return 1 / 0 / e > 0 ? "0" : "-0";
445
+ var l = String(e);
446
+ return c ? gt(e, l) : l;
447
+ }
448
+ if (typeof e == "bigint") {
449
+ var u = String(e) + "n";
450
+ return c ? gt(e, u) : u;
451
+ }
452
+ var f = typeof a.depth > "u" ? 5 : a.depth;
453
+ if (typeof n > "u" && (n = 0), n >= f && f > 0 && typeof e == "object")
454
+ return Ve(e) ? "[Array]" : "[Object]";
455
+ var p = Vn(a, n);
456
+ if (typeof o > "u")
457
+ o = [];
458
+ else if (Wt(o, e) >= 0)
459
+ return "[Circular]";
460
+ function s(w, C, E) {
461
+ if (C && (o = In.call(o), o.push(C)), E) {
462
+ var Y = {
463
+ depth: a.depth
464
+ };
465
+ return $(a, "quoteStyle") && (Y.quoteStyle = a.quoteStyle), t(w, Y, n + 1, o);
466
+ }
467
+ return t(w, a, n + 1, o);
468
+ }
469
+ if (typeof e == "function" && !bt(e)) {
470
+ var v = Bn(e), d = ue(e, s);
471
+ return "[Function" + (v ? ": " + v : " (anonymous)") + "]" + (d.length > 0 ? " { " + O.call(d, ", ") + " }" : "");
472
+ }
473
+ if (zt(e)) {
474
+ var b = V ? D.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : He.call(e);
475
+ return typeof e == "object" && !V ? Z(b) : b;
476
+ }
477
+ if (qn(e)) {
478
+ for (var S = "<" + yt.call(String(e.nodeName)), I = e.attributes || [], R = 0; R < I.length; R++)
479
+ S += " " + I[R].name + "=" + Ut(kn(I[R].value), "double", a);
480
+ return S += ">", e.childNodes && e.childNodes.length && (S += "..."), S += "</" + yt.call(String(e.nodeName)) + ">", S;
481
+ }
482
+ if (Ve(e)) {
483
+ if (e.length === 0)
484
+ return "[]";
485
+ var m = ue(e, s);
486
+ return p && !Kn(m) ? "[" + Qe(m, p) + "]" : "[ " + O.call(m, ", ") + " ]";
487
+ }
488
+ if (Cn(e)) {
489
+ var k = ue(e, s);
490
+ return !("cause" in Error.prototype) && "cause" in e && !Bt.call(e, "cause") ? "{ [" + String(e) + "] " + O.call(dt.call("[cause]: " + s(e.cause), k), ", ") + " }" : k.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + O.call(k, ", ") + " }";
491
+ }
492
+ if (typeof e == "object" && i) {
493
+ if (_t && typeof e[_t] == "function" && Ke)
494
+ return Ke(e, { depth: f - n });
495
+ if (i !== "symbol" && typeof e.inspect == "function")
496
+ return e.inspect();
497
+ }
498
+ if (Ln(e)) {
499
+ var N = [];
500
+ return st && st.call(e, function(w, C) {
501
+ N.push(s(C, e, !0) + " => " + s(w, e));
502
+ }), St("Map", me.call(e), N, p);
503
+ }
504
+ if (Wn(e)) {
505
+ var X = [];
506
+ return ut && ut.call(e, function(w) {
507
+ X.push(s(w, e));
508
+ }), St("Set", ge.call(e), X, p);
509
+ }
510
+ if (Un(e))
511
+ return Re("WeakMap");
512
+ if (Gn(e))
513
+ return Re("WeakSet");
514
+ if (zn(e))
515
+ return Re("WeakRef");
516
+ if (Fn(e))
517
+ return Z(s(Number(e)));
518
+ if (Mn(e))
519
+ return Z(s(qe.call(e)));
520
+ if (Nn(e))
521
+ return Z(An.call(e));
522
+ if (Dn(e))
523
+ return Z(s(String(e)));
524
+ if (typeof window < "u" && e === window)
525
+ return "{ [object Window] }";
526
+ if (typeof globalThis < "u" && e === globalThis || typeof ct < "u" && e === ct)
527
+ return "{ [object globalThis] }";
528
+ if (!Tn(e) && !bt(e)) {
529
+ var z = ue(e, s), ce = mt ? mt(e) === Object.prototype : e instanceof Object || e.constructor === Object, M = e instanceof Object ? "" : "null prototype", T = !ce && re && Object(e) === e && re in e ? Ze.call(F(e), 8, -1) : M ? "Object" : "", fe = ce || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", W = fe + (T || M ? "[" + O.call(dt.call([], T || [], M || []), ": ") + "] " : "");
530
+ return z.length === 0 ? W + "{}" : p ? W + "{" + Qe(z, p) + "}" : W + "{ " + O.call(z, ", ") + " }";
531
+ }
532
+ return String(e);
533
+ };
534
+ function Ut(t, e, r) {
535
+ var n = r.quoteStyle || e, o = Lt[n];
536
+ return o + t + o;
537
+ }
538
+ function kn(t) {
539
+ return D.call(String(t), /"/g, "&quot;");
540
+ }
541
+ function U(t) {
542
+ return !re || !(typeof t == "object" && (re in t || typeof t[re] < "u"));
543
+ }
544
+ function Ve(t) {
545
+ return F(t) === "[object Array]" && U(t);
546
+ }
547
+ function Tn(t) {
548
+ return F(t) === "[object Date]" && U(t);
549
+ }
550
+ function bt(t) {
551
+ return F(t) === "[object RegExp]" && U(t);
552
+ }
553
+ function Cn(t) {
554
+ return F(t) === "[object Error]" && U(t);
555
+ }
556
+ function Dn(t) {
557
+ return F(t) === "[object String]" && U(t);
558
+ }
559
+ function Fn(t) {
560
+ return F(t) === "[object Number]" && U(t);
561
+ }
562
+ function Nn(t) {
563
+ return F(t) === "[object Boolean]" && U(t);
564
+ }
565
+ function zt(t) {
566
+ if (V)
567
+ return t && typeof t == "object" && t instanceof Symbol;
568
+ if (typeof t == "symbol")
569
+ return !0;
570
+ if (!t || typeof t != "object" || !He)
571
+ return !1;
572
+ try {
573
+ return He.call(t), !0;
574
+ } catch {
575
+ }
576
+ return !1;
577
+ }
578
+ function Mn(t) {
579
+ if (!t || typeof t != "object" || !qe)
580
+ return !1;
581
+ try {
582
+ return qe.call(t), !0;
583
+ } catch {
584
+ }
585
+ return !1;
586
+ }
587
+ var jn = Object.prototype.hasOwnProperty || function(t) {
588
+ return t in this;
589
+ };
590
+ function $(t, e) {
591
+ return jn.call(t, e);
592
+ }
593
+ function F(t) {
594
+ return On.call(t);
595
+ }
596
+ function Bn(t) {
597
+ if (t.name)
598
+ return t.name;
599
+ var e = Pn.call(En.call(t), /^function\s*([\w$]+)/);
600
+ return e ? e[1] : null;
601
+ }
602
+ function Wt(t, e) {
603
+ if (t.indexOf)
604
+ return t.indexOf(e);
605
+ for (var r = 0, n = t.length; r < n; r++)
606
+ if (t[r] === e)
607
+ return r;
608
+ return -1;
609
+ }
610
+ function Ln(t) {
611
+ if (!me || !t || typeof t != "object")
612
+ return !1;
613
+ try {
614
+ me.call(t);
615
+ try {
616
+ ge.call(t);
617
+ } catch {
618
+ return !0;
619
+ }
620
+ return t instanceof Map;
621
+ } catch {
622
+ }
623
+ return !1;
624
+ }
625
+ function Un(t) {
626
+ if (!ee || !t || typeof t != "object")
627
+ return !1;
628
+ try {
629
+ ee.call(t, ee);
630
+ try {
631
+ te.call(t, te);
632
+ } catch {
633
+ return !0;
634
+ }
635
+ return t instanceof WeakMap;
636
+ } catch {
637
+ }
638
+ return !1;
639
+ }
640
+ function zn(t) {
641
+ if (!pt || !t || typeof t != "object")
642
+ return !1;
643
+ try {
644
+ return pt.call(t), !0;
645
+ } catch {
646
+ }
647
+ return !1;
648
+ }
649
+ function Wn(t) {
650
+ if (!ge || !t || typeof t != "object")
651
+ return !1;
652
+ try {
653
+ ge.call(t);
654
+ try {
655
+ me.call(t);
656
+ } catch {
657
+ return !0;
658
+ }
659
+ return t instanceof Set;
660
+ } catch {
661
+ }
662
+ return !1;
663
+ }
664
+ function Gn(t) {
665
+ if (!te || !t || typeof t != "object")
666
+ return !1;
667
+ try {
668
+ te.call(t, te);
669
+ try {
670
+ ee.call(t, ee);
671
+ } catch {
672
+ return !0;
673
+ }
674
+ return t instanceof WeakSet;
675
+ } catch {
676
+ }
677
+ return !1;
678
+ }
679
+ function qn(t) {
680
+ return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
681
+ }
682
+ function Gt(t, e) {
683
+ if (t.length > e.maxStringLength) {
684
+ var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
685
+ return Gt(Ze.call(t, 0, e.maxStringLength), e) + n;
686
+ }
687
+ var o = Rn[e.quoteStyle || "single"];
688
+ o.lastIndex = 0;
689
+ var a = D.call(D.call(t, o, "\\$1"), /[\x00-\x1f]/g, Hn);
690
+ return Ut(a, "single", e);
691
+ }
692
+ function Hn(t) {
693
+ var e = t.charCodeAt(0), r = {
694
+ 8: "b",
695
+ 9: "t",
696
+ 10: "n",
697
+ 12: "f",
698
+ 13: "r"
699
+ }[e];
700
+ return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + $n.call(e.toString(16));
701
+ }
702
+ function Z(t) {
703
+ return "Object(" + t + ")";
704
+ }
705
+ function Re(t) {
706
+ return t + " { ? }";
707
+ }
708
+ function St(t, e, r, n) {
709
+ var o = n ? Qe(r, n) : O.call(r, ", ");
710
+ return t + " (" + e + ") {" + o + "}";
711
+ }
712
+ function Kn(t) {
713
+ for (var e = 0; e < t.length; e++)
714
+ if (Wt(t[e], `
715
+ `) >= 0)
716
+ return !1;
717
+ return !0;
718
+ }
719
+ function Vn(t, e) {
720
+ var r;
721
+ if (t.indent === " ")
722
+ r = " ";
723
+ else if (typeof t.indent == "number" && t.indent > 0)
724
+ r = O.call(Array(t.indent + 1), " ");
725
+ else
726
+ return null;
727
+ return {
728
+ base: r,
729
+ prev: O.call(Array(e + 1), r)
730
+ };
731
+ }
732
+ function Qe(t, e) {
733
+ if (t.length === 0)
734
+ return "";
735
+ var r = `
736
+ ` + e.prev + e.base;
737
+ return r + O.call(t, "," + r) + `
738
+ ` + e.prev;
739
+ }
740
+ function ue(t, e) {
741
+ var r = Ve(t), n = [];
742
+ if (r) {
743
+ n.length = t.length;
744
+ for (var o = 0; o < t.length; o++)
745
+ n[o] = $(t, o) ? e(t[o], t) : "";
746
+ }
747
+ var a = typeof Ie == "function" ? Ie(t) : [], i;
748
+ if (V) {
749
+ i = {};
750
+ for (var c = 0; c < a.length; c++)
751
+ i["$" + a[c]] = a[c];
752
+ }
753
+ for (var l in t)
754
+ $(t, l) && (r && String(Number(l)) === l && l < t.length || V && i["$" + l] instanceof Symbol || (jt.call(/[^\w$]/, l) ? n.push(e(l, t) + ": " + e(t[l], t)) : n.push(l + ": " + e(t[l], t))));
755
+ if (typeof Ie == "function")
756
+ for (var u = 0; u < a.length; u++)
757
+ Bt.call(t, a[u]) && n.push("[" + e(a[u]) + "]: " + e(t[a[u]], t));
758
+ return n;
759
+ }
760
+ var Qn = be, Jn = J, Se = function(t, e, r) {
761
+ for (var n = t, o; (o = n.next) != null; n = o)
762
+ if (o.key === e)
763
+ return n.next = o.next, r || (o.next = /** @type {NonNullable<typeof list.next>} */
764
+ t.next, t.next = o), o;
765
+ }, Xn = function(t, e) {
766
+ if (t) {
767
+ var r = Se(t, e);
768
+ return r && r.value;
769
+ }
770
+ }, Yn = function(t, e, r) {
771
+ var n = Se(t, e);
772
+ n ? n.value = r : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
773
+ {
774
+ // eslint-disable-line no-param-reassign, no-extra-parens
775
+ key: e,
776
+ next: t.next,
777
+ value: r
778
+ };
779
+ }, Zn = function(t, e) {
780
+ return t ? !!Se(t, e) : !1;
781
+ }, eo = function(t, e) {
782
+ if (t)
783
+ return Se(t, e, !0);
784
+ }, to = function() {
785
+ var e, r = {
786
+ assert: function(n) {
787
+ if (!r.has(n))
788
+ throw new Jn("Side channel does not contain " + Qn(n));
789
+ },
790
+ delete: function(n) {
791
+ var o = e && e.next, a = eo(e, n);
792
+ return a && o && o === a && (e = void 0), !!a;
793
+ },
794
+ get: function(n) {
795
+ return Xn(e, n);
796
+ },
797
+ has: function(n) {
798
+ return Zn(e, n);
799
+ },
800
+ set: function(n, o) {
801
+ e || (e = {
802
+ next: void 0
803
+ }), Yn(
804
+ /** @type {NonNullable<typeof $o>} */
805
+ e,
806
+ n,
807
+ o
808
+ );
809
+ }
810
+ };
811
+ return r;
812
+ }, qt = Object, ro = Error, no = EvalError, oo = RangeError, ao = ReferenceError, io = SyntaxError, lo = URIError, co = Math.abs, fo = Math.floor, so = Math.max, uo = Math.min, po = Math.pow, yo = Math.round, vo = Number.isNaN || function(e) {
813
+ return e !== e;
814
+ }, mo = vo, go = function(e) {
815
+ return mo(e) || e === 0 ? e : e < 0 ? -1 : 1;
816
+ }, ho = Object.getOwnPropertyDescriptor, ye = ho;
817
+ if (ye)
818
+ try {
819
+ ye([], "length");
820
+ } catch {
821
+ ye = null;
822
+ }
823
+ var Ht = ye, de = Object.defineProperty || !1;
824
+ if (de)
825
+ try {
826
+ de({}, "a", { value: 1 });
827
+ } catch {
828
+ de = !1;
829
+ }
830
+ var _o = de, ke, wt;
831
+ function bo() {
832
+ return wt || (wt = 1, ke = function() {
833
+ if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
834
+ return !1;
835
+ if (typeof Symbol.iterator == "symbol")
836
+ return !0;
837
+ var e = {}, r = Symbol("test"), n = Object(r);
838
+ if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
839
+ return !1;
840
+ var o = 42;
841
+ e[r] = o;
842
+ for (var a in e)
843
+ return !1;
844
+ if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
845
+ return !1;
846
+ var i = Object.getOwnPropertySymbols(e);
847
+ if (i.length !== 1 || i[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
848
+ return !1;
849
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
850
+ var c = (
851
+ /** @type {PropertyDescriptor} */
852
+ Object.getOwnPropertyDescriptor(e, r)
853
+ );
854
+ if (c.value !== o || c.enumerable !== !0)
855
+ return !1;
856
+ }
857
+ return !0;
858
+ }), ke;
859
+ }
860
+ var Te, xt;
861
+ function So() {
862
+ if (xt) return Te;
863
+ xt = 1;
864
+ var t = typeof Symbol < "u" && Symbol, e = bo();
865
+ return Te = function() {
866
+ return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
867
+ }, Te;
868
+ }
869
+ var Ce, At;
870
+ function Kt() {
871
+ return At || (At = 1, Ce = typeof Reflect < "u" && Reflect.getPrototypeOf || null), Ce;
872
+ }
873
+ var De, Ot;
874
+ function Vt() {
875
+ if (Ot) return De;
876
+ Ot = 1;
877
+ var t = qt;
878
+ return De = t.getPrototypeOf || null, De;
879
+ }
880
+ var wo = "Function.prototype.bind called on incompatible ", xo = Object.prototype.toString, Ao = Math.max, Oo = "[object Function]", Et = function(e, r) {
881
+ for (var n = [], o = 0; o < e.length; o += 1)
882
+ n[o] = e[o];
883
+ for (var a = 0; a < r.length; a += 1)
884
+ n[a + e.length] = r[a];
885
+ return n;
886
+ }, Eo = function(e, r) {
887
+ for (var n = [], o = r, a = 0; o < e.length; o += 1, a += 1)
888
+ n[a] = e[o];
889
+ return n;
890
+ }, Po = function(t, e) {
891
+ for (var r = "", n = 0; n < t.length; n += 1)
892
+ r += t[n], n + 1 < t.length && (r += e);
893
+ return r;
894
+ }, $o = function(e) {
895
+ var r = this;
896
+ if (typeof r != "function" || xo.apply(r) !== Oo)
897
+ throw new TypeError(wo + r);
898
+ for (var n = Eo(arguments, 1), o, a = function() {
899
+ if (this instanceof o) {
900
+ var f = r.apply(
901
+ this,
902
+ Et(n, arguments)
903
+ );
904
+ return Object(f) === f ? f : this;
905
+ }
906
+ return r.apply(
907
+ e,
908
+ Et(n, arguments)
909
+ );
910
+ }, i = Ao(0, r.length - n.length), c = [], l = 0; l < i; l++)
911
+ c[l] = "$" + l;
912
+ if (o = Function("binder", "return function (" + Po(c, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
913
+ var u = function() {
914
+ };
915
+ u.prototype = r.prototype, o.prototype = new u(), u.prototype = null;
916
+ }
917
+ return o;
918
+ }, Io = $o, we = Function.prototype.bind || Io, et = Function.prototype.call, Qt = Function.prototype.apply, Ro = typeof Reflect < "u" && Reflect && Reflect.apply, ko = we, To = Qt, Co = et, Do = Ro, Fo = Do || ko.call(Co, To), No = we, Mo = J, jo = et, Bo = Fo, Jt = function(e) {
919
+ if (e.length < 1 || typeof e[0] != "function")
920
+ throw new Mo("a function is required");
921
+ return Bo(No, jo, e);
922
+ }, Fe, Pt;
923
+ function Lo() {
924
+ if (Pt) return Fe;
925
+ Pt = 1;
926
+ var t = Jt, e = Ht, r;
927
+ try {
928
+ r = /** @type {{ __proto__?: typeof Array.prototype }} */
929
+ [].__proto__ === Array.prototype;
930
+ } catch (i) {
931
+ if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
932
+ throw i;
933
+ }
934
+ var n = !!r && e && e(
935
+ Object.prototype,
936
+ /** @type {keyof typeof Object.prototype} */
937
+ "__proto__"
938
+ ), o = Object, a = o.getPrototypeOf;
939
+ return Fe = n && typeof n.get == "function" ? t([n.get]) : typeof a == "function" ? (
940
+ /** @type {import('./get')} */
941
+ function(c) {
942
+ return a(c == null ? c : o(c));
943
+ }
944
+ ) : !1, Fe;
945
+ }
946
+ var Ne, $t;
947
+ function Uo() {
948
+ if ($t) return Ne;
949
+ $t = 1;
950
+ var t = Kt(), e = Vt(), r = Lo();
951
+ return Ne = t ? function(o) {
952
+ return t(o);
953
+ } : e ? function(o) {
954
+ if (!o || typeof o != "object" && typeof o != "function")
955
+ throw new TypeError("getProto: not an object");
956
+ return e(o);
957
+ } : r ? function(o) {
958
+ return r(o);
959
+ } : null, Ne;
960
+ }
961
+ var Me, It;
962
+ function zo() {
963
+ if (It) return Me;
964
+ It = 1;
965
+ var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = we;
966
+ return Me = r.call(t, e), Me;
967
+ }
968
+ var y, Wo = qt, Go = ro, qo = no, Ho = oo, Ko = ao, Q = io, K = J, Vo = lo, Qo = co, Jo = fo, Xo = so, Yo = uo, Zo = po, ea = yo, ta = go, Xt = Function, je = function(t) {
969
+ try {
970
+ return Xt('"use strict"; return (' + t + ").constructor;")();
971
+ } catch {
972
+ }
973
+ }, oe = Ht, ra = _o, Be = function() {
974
+ throw new K();
975
+ }, na = oe ? function() {
976
+ try {
977
+ return arguments.callee, Be;
978
+ } catch {
979
+ try {
980
+ return oe(arguments, "callee").get;
981
+ } catch {
982
+ return Be;
983
+ }
984
+ }
985
+ }() : Be, G = So()(), _ = Uo(), oa = Vt(), aa = Kt(), Yt = Qt, ae = et, H = {}, ia = typeof Uint8Array > "u" || !_ ? y : _(Uint8Array), B = {
986
+ __proto__: null,
987
+ "%AggregateError%": typeof AggregateError > "u" ? y : AggregateError,
988
+ "%Array%": Array,
989
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? y : ArrayBuffer,
990
+ "%ArrayIteratorPrototype%": G && _ ? _([][Symbol.iterator]()) : y,
991
+ "%AsyncFromSyncIteratorPrototype%": y,
992
+ "%AsyncFunction%": H,
993
+ "%AsyncGenerator%": H,
994
+ "%AsyncGeneratorFunction%": H,
995
+ "%AsyncIteratorPrototype%": H,
996
+ "%Atomics%": typeof Atomics > "u" ? y : Atomics,
997
+ "%BigInt%": typeof BigInt > "u" ? y : BigInt,
998
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? y : BigInt64Array,
999
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? y : BigUint64Array,
1000
+ "%Boolean%": Boolean,
1001
+ "%DataView%": typeof DataView > "u" ? y : DataView,
1002
+ "%Date%": Date,
1003
+ "%decodeURI%": decodeURI,
1004
+ "%decodeURIComponent%": decodeURIComponent,
1005
+ "%encodeURI%": encodeURI,
1006
+ "%encodeURIComponent%": encodeURIComponent,
1007
+ "%Error%": Go,
1008
+ "%eval%": eval,
1009
+ // eslint-disable-line no-eval
1010
+ "%EvalError%": qo,
1011
+ "%Float16Array%": typeof Float16Array > "u" ? y : Float16Array,
1012
+ "%Float32Array%": typeof Float32Array > "u" ? y : Float32Array,
1013
+ "%Float64Array%": typeof Float64Array > "u" ? y : Float64Array,
1014
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? y : FinalizationRegistry,
1015
+ "%Function%": Xt,
1016
+ "%GeneratorFunction%": H,
1017
+ "%Int8Array%": typeof Int8Array > "u" ? y : Int8Array,
1018
+ "%Int16Array%": typeof Int16Array > "u" ? y : Int16Array,
1019
+ "%Int32Array%": typeof Int32Array > "u" ? y : Int32Array,
1020
+ "%isFinite%": isFinite,
1021
+ "%isNaN%": isNaN,
1022
+ "%IteratorPrototype%": G && _ ? _(_([][Symbol.iterator]())) : y,
1023
+ "%JSON%": typeof JSON == "object" ? JSON : y,
1024
+ "%Map%": typeof Map > "u" ? y : Map,
1025
+ "%MapIteratorPrototype%": typeof Map > "u" || !G || !_ ? y : _((/* @__PURE__ */ new Map())[Symbol.iterator]()),
1026
+ "%Math%": Math,
1027
+ "%Number%": Number,
1028
+ "%Object%": Wo,
1029
+ "%Object.getOwnPropertyDescriptor%": oe,
1030
+ "%parseFloat%": parseFloat,
1031
+ "%parseInt%": parseInt,
1032
+ "%Promise%": typeof Promise > "u" ? y : Promise,
1033
+ "%Proxy%": typeof Proxy > "u" ? y : Proxy,
1034
+ "%RangeError%": Ho,
1035
+ "%ReferenceError%": Ko,
1036
+ "%Reflect%": typeof Reflect > "u" ? y : Reflect,
1037
+ "%RegExp%": RegExp,
1038
+ "%Set%": typeof Set > "u" ? y : Set,
1039
+ "%SetIteratorPrototype%": typeof Set > "u" || !G || !_ ? y : _((/* @__PURE__ */ new Set())[Symbol.iterator]()),
1040
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? y : SharedArrayBuffer,
1041
+ "%String%": String,
1042
+ "%StringIteratorPrototype%": G && _ ? _(""[Symbol.iterator]()) : y,
1043
+ "%Symbol%": G ? Symbol : y,
1044
+ "%SyntaxError%": Q,
1045
+ "%ThrowTypeError%": na,
1046
+ "%TypedArray%": ia,
1047
+ "%TypeError%": K,
1048
+ "%Uint8Array%": typeof Uint8Array > "u" ? y : Uint8Array,
1049
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? y : Uint8ClampedArray,
1050
+ "%Uint16Array%": typeof Uint16Array > "u" ? y : Uint16Array,
1051
+ "%Uint32Array%": typeof Uint32Array > "u" ? y : Uint32Array,
1052
+ "%URIError%": Vo,
1053
+ "%WeakMap%": typeof WeakMap > "u" ? y : WeakMap,
1054
+ "%WeakRef%": typeof WeakRef > "u" ? y : WeakRef,
1055
+ "%WeakSet%": typeof WeakSet > "u" ? y : WeakSet,
1056
+ "%Function.prototype.call%": ae,
1057
+ "%Function.prototype.apply%": Yt,
1058
+ "%Object.defineProperty%": ra,
1059
+ "%Object.getPrototypeOf%": oa,
1060
+ "%Math.abs%": Qo,
1061
+ "%Math.floor%": Jo,
1062
+ "%Math.max%": Xo,
1063
+ "%Math.min%": Yo,
1064
+ "%Math.pow%": Zo,
1065
+ "%Math.round%": ea,
1066
+ "%Math.sign%": ta,
1067
+ "%Reflect.getPrototypeOf%": aa
1068
+ };
1069
+ if (_)
1070
+ try {
1071
+ null.error;
1072
+ } catch (t) {
1073
+ var la = _(_(t));
1074
+ B["%Error.prototype%"] = la;
1075
+ }
1076
+ var ca = function t(e) {
1077
+ var r;
1078
+ if (e === "%AsyncFunction%")
1079
+ r = je("async function () {}");
1080
+ else if (e === "%GeneratorFunction%")
1081
+ r = je("function* () {}");
1082
+ else if (e === "%AsyncGeneratorFunction%")
1083
+ r = je("async function* () {}");
1084
+ else if (e === "%AsyncGenerator%") {
1085
+ var n = t("%AsyncGeneratorFunction%");
1086
+ n && (r = n.prototype);
1087
+ } else if (e === "%AsyncIteratorPrototype%") {
1088
+ var o = t("%AsyncGenerator%");
1089
+ o && _ && (r = _(o.prototype));
1090
+ }
1091
+ return B[e] = r, r;
1092
+ }, Rt = {
1093
+ __proto__: null,
1094
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
1095
+ "%ArrayPrototype%": ["Array", "prototype"],
1096
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
1097
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
1098
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
1099
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
1100
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
1101
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
1102
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
1103
+ "%BooleanPrototype%": ["Boolean", "prototype"],
1104
+ "%DataViewPrototype%": ["DataView", "prototype"],
1105
+ "%DatePrototype%": ["Date", "prototype"],
1106
+ "%ErrorPrototype%": ["Error", "prototype"],
1107
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
1108
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
1109
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
1110
+ "%FunctionPrototype%": ["Function", "prototype"],
1111
+ "%Generator%": ["GeneratorFunction", "prototype"],
1112
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
1113
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
1114
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
1115
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
1116
+ "%JSONParse%": ["JSON", "parse"],
1117
+ "%JSONStringify%": ["JSON", "stringify"],
1118
+ "%MapPrototype%": ["Map", "prototype"],
1119
+ "%NumberPrototype%": ["Number", "prototype"],
1120
+ "%ObjectPrototype%": ["Object", "prototype"],
1121
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
1122
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
1123
+ "%PromisePrototype%": ["Promise", "prototype"],
1124
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
1125
+ "%Promise_all%": ["Promise", "all"],
1126
+ "%Promise_reject%": ["Promise", "reject"],
1127
+ "%Promise_resolve%": ["Promise", "resolve"],
1128
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
1129
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
1130
+ "%RegExpPrototype%": ["RegExp", "prototype"],
1131
+ "%SetPrototype%": ["Set", "prototype"],
1132
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
1133
+ "%StringPrototype%": ["String", "prototype"],
1134
+ "%SymbolPrototype%": ["Symbol", "prototype"],
1135
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
1136
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
1137
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
1138
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
1139
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
1140
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
1141
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
1142
+ "%URIErrorPrototype%": ["URIError", "prototype"],
1143
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
1144
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
1145
+ }, ie = we, he = zo(), fa = ie.call(ae, Array.prototype.concat), sa = ie.call(Yt, Array.prototype.splice), kt = ie.call(ae, String.prototype.replace), _e = ie.call(ae, String.prototype.slice), ua = ie.call(ae, RegExp.prototype.exec), pa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ya = /\\(\\)?/g, da = function(e) {
1146
+ var r = _e(e, 0, 1), n = _e(e, -1);
1147
+ if (r === "%" && n !== "%")
1148
+ throw new Q("invalid intrinsic syntax, expected closing `%`");
1149
+ if (n === "%" && r !== "%")
1150
+ throw new Q("invalid intrinsic syntax, expected opening `%`");
1151
+ var o = [];
1152
+ return kt(e, pa, function(a, i, c, l) {
1153
+ o[o.length] = c ? kt(l, ya, "$1") : i || a;
1154
+ }), o;
1155
+ }, va = function(e, r) {
1156
+ var n = e, o;
1157
+ if (he(Rt, n) && (o = Rt[n], n = "%" + o[0] + "%"), he(B, n)) {
1158
+ var a = B[n];
1159
+ if (a === H && (a = ca(n)), typeof a > "u" && !r)
1160
+ throw new K("intrinsic " + e + " exists, but is not available. Please file an issue!");
1161
+ return {
1162
+ alias: o,
1163
+ name: n,
1164
+ value: a
1165
+ };
1166
+ }
1167
+ throw new Q("intrinsic " + e + " does not exist!");
1168
+ }, tt = function(e, r) {
1169
+ if (typeof e != "string" || e.length === 0)
1170
+ throw new K("intrinsic name must be a non-empty string");
1171
+ if (arguments.length > 1 && typeof r != "boolean")
1172
+ throw new K('"allowMissing" argument must be a boolean');
1173
+ if (ua(/^%?[^%]*%?$/, e) === null)
1174
+ throw new Q("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1175
+ var n = da(e), o = n.length > 0 ? n[0] : "", a = va("%" + o + "%", r), i = a.name, c = a.value, l = !1, u = a.alias;
1176
+ u && (o = u[0], sa(n, fa([0, 1], u)));
1177
+ for (var f = 1, p = !0; f < n.length; f += 1) {
1178
+ var s = n[f], v = _e(s, 0, 1), d = _e(s, -1);
1179
+ if ((v === '"' || v === "'" || v === "`" || d === '"' || d === "'" || d === "`") && v !== d)
1180
+ throw new Q("property names with quotes must have matching quotes");
1181
+ if ((s === "constructor" || !p) && (l = !0), o += "." + s, i = "%" + o + "%", he(B, i))
1182
+ c = B[i];
1183
+ else if (c != null) {
1184
+ if (!(s in c)) {
1185
+ if (!r)
1186
+ throw new K("base intrinsic for " + e + " exists, but the property is not available.");
1187
+ return;
1188
+ }
1189
+ if (oe && f + 1 >= n.length) {
1190
+ var b = oe(c, s);
1191
+ p = !!b, p && "get" in b && !("originalValue" in b.get) ? c = b.get : c = c[s];
1192
+ } else
1193
+ p = he(c, s), c = c[s];
1194
+ p && !l && (B[i] = c);
1195
+ }
1196
+ }
1197
+ return c;
1198
+ }, Zt = tt, er = Jt, ma = er([Zt("%String.prototype.indexOf%")]), tr = function(e, r) {
1199
+ var n = (
1200
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1201
+ Zt(e, !!r)
1202
+ );
1203
+ return typeof n == "function" && ma(e, ".prototype.") > -1 ? er(
1204
+ /** @type {const} */
1205
+ [n]
1206
+ ) : n;
1207
+ }, ga = tt, le = tr, ha = be, _a = J, Tt = ga("%Map%", !0), ba = le("Map.prototype.get", !0), Sa = le("Map.prototype.set", !0), wa = le("Map.prototype.has", !0), xa = le("Map.prototype.delete", !0), Aa = le("Map.prototype.size", !0), rr = !!Tt && /** @type {Exclude<import('.'), false>} */
1208
+ function() {
1209
+ var e, r = {
1210
+ assert: function(n) {
1211
+ if (!r.has(n))
1212
+ throw new _a("Side channel does not contain " + ha(n));
1213
+ },
1214
+ delete: function(n) {
1215
+ if (e) {
1216
+ var o = xa(e, n);
1217
+ return Aa(e) === 0 && (e = void 0), o;
1218
+ }
1219
+ return !1;
1220
+ },
1221
+ get: function(n) {
1222
+ if (e)
1223
+ return ba(e, n);
1224
+ },
1225
+ has: function(n) {
1226
+ return e ? wa(e, n) : !1;
1227
+ },
1228
+ set: function(n, o) {
1229
+ e || (e = new Tt()), Sa(e, n, o);
1230
+ }
1231
+ };
1232
+ return r;
1233
+ }, Oa = tt, xe = tr, Ea = be, pe = rr, Pa = J, q = Oa("%WeakMap%", !0), $a = xe("WeakMap.prototype.get", !0), Ia = xe("WeakMap.prototype.set", !0), Ra = xe("WeakMap.prototype.has", !0), ka = xe("WeakMap.prototype.delete", !0), Ta = q ? (
1234
+ /** @type {Exclude<import('.'), false>} */
1235
+ function() {
1236
+ var e, r, n = {
1237
+ assert: function(o) {
1238
+ if (!n.has(o))
1239
+ throw new Pa("Side channel does not contain " + Ea(o));
1240
+ },
1241
+ delete: function(o) {
1242
+ if (q && o && (typeof o == "object" || typeof o == "function")) {
1243
+ if (e)
1244
+ return ka(e, o);
1245
+ } else if (pe && r)
1246
+ return r.delete(o);
1247
+ return !1;
1248
+ },
1249
+ get: function(o) {
1250
+ return q && o && (typeof o == "object" || typeof o == "function") && e ? $a(e, o) : r && r.get(o);
1251
+ },
1252
+ has: function(o) {
1253
+ return q && o && (typeof o == "object" || typeof o == "function") && e ? Ra(e, o) : !!r && r.has(o);
1254
+ },
1255
+ set: function(o, a) {
1256
+ q && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new q()), Ia(e, o, a)) : pe && (r || (r = pe()), r.set(o, a));
1257
+ }
1258
+ };
1259
+ return n;
1260
+ }
1261
+ ) : pe, Ca = J, Da = be, Fa = to, Na = rr, Ma = Ta, ja = Ma || Na || Fa, Ba = function() {
1262
+ var e, r = {
1263
+ assert: function(n) {
1264
+ if (!r.has(n))
1265
+ throw new Ca("Side channel does not contain " + Da(n));
1266
+ },
1267
+ delete: function(n) {
1268
+ return !!e && e.delete(n);
1269
+ },
1270
+ get: function(n) {
1271
+ return e && e.get(n);
1272
+ },
1273
+ has: function(n) {
1274
+ return !!e && e.has(n);
1275
+ },
1276
+ set: function(n, o) {
1277
+ e || (e = ja()), e.set(n, o);
1278
+ }
1279
+ };
1280
+ return r;
1281
+ }, La = String.prototype.replace, Ua = /%20/g, Le = {
1282
+ RFC1738: "RFC1738",
1283
+ RFC3986: "RFC3986"
1284
+ }, rt = {
1285
+ default: Le.RFC3986,
1286
+ formatters: {
1287
+ RFC1738: function(t) {
1288
+ return La.call(t, Ua, "+");
1289
+ },
1290
+ RFC3986: function(t) {
1291
+ return String(t);
1292
+ }
1293
+ },
1294
+ RFC1738: Le.RFC1738,
1295
+ RFC3986: Le.RFC3986
1296
+ }, za = rt, Ue = Object.prototype.hasOwnProperty, j = Array.isArray, x = function() {
1297
+ for (var t = [], e = 0; e < 256; ++e)
1298
+ t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
1299
+ return t;
1300
+ }(), Wa = function(e) {
1301
+ for (; e.length > 1; ) {
1302
+ var r = e.pop(), n = r.obj[r.prop];
1303
+ if (j(n)) {
1304
+ for (var o = [], a = 0; a < n.length; ++a)
1305
+ typeof n[a] < "u" && o.push(n[a]);
1306
+ r.obj[r.prop] = o;
1307
+ }
1308
+ }
1309
+ }, nr = function(e, r) {
1310
+ for (var n = r && r.plainObjects ? { __proto__: null } : {}, o = 0; o < e.length; ++o)
1311
+ typeof e[o] < "u" && (n[o] = e[o]);
1312
+ return n;
1313
+ }, Ga = function t(e, r, n) {
1314
+ if (!r)
1315
+ return e;
1316
+ if (typeof r != "object" && typeof r != "function") {
1317
+ if (j(e))
1318
+ e.push(r);
1319
+ else if (e && typeof e == "object")
1320
+ (n && (n.plainObjects || n.allowPrototypes) || !Ue.call(Object.prototype, r)) && (e[r] = !0);
1321
+ else
1322
+ return [e, r];
1323
+ return e;
1324
+ }
1325
+ if (!e || typeof e != "object")
1326
+ return [e].concat(r);
1327
+ var o = e;
1328
+ return j(e) && !j(r) && (o = nr(e, n)), j(e) && j(r) ? (r.forEach(function(a, i) {
1329
+ if (Ue.call(e, i)) {
1330
+ var c = e[i];
1331
+ c && typeof c == "object" && a && typeof a == "object" ? e[i] = t(c, a, n) : e.push(a);
1332
+ } else
1333
+ e[i] = a;
1334
+ }), e) : Object.keys(r).reduce(function(a, i) {
1335
+ var c = r[i];
1336
+ return Ue.call(a, i) ? a[i] = t(a[i], c, n) : a[i] = c, a;
1337
+ }, o);
1338
+ }, qa = function(e, r) {
1339
+ return Object.keys(r).reduce(function(n, o) {
1340
+ return n[o] = r[o], n;
1341
+ }, e);
1342
+ }, Ha = function(t, e, r) {
1343
+ var n = t.replace(/\+/g, " ");
1344
+ if (r === "iso-8859-1")
1345
+ return n.replace(/%[0-9a-f]{2}/gi, unescape);
1346
+ try {
1347
+ return decodeURIComponent(n);
1348
+ } catch {
1349
+ return n;
1350
+ }
1351
+ }, ze = 1024, Ka = function(e, r, n, o, a) {
1352
+ if (e.length === 0)
1353
+ return e;
1354
+ var i = e;
1355
+ if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1")
1356
+ return escape(i).replace(/%u[0-9a-f]{4}/gi, function(v) {
1357
+ return "%26%23" + parseInt(v.slice(2), 16) + "%3B";
1358
+ });
1359
+ for (var c = "", l = 0; l < i.length; l += ze) {
1360
+ for (var u = i.length >= ze ? i.slice(l, l + ze) : i, f = [], p = 0; p < u.length; ++p) {
1361
+ var s = u.charCodeAt(p);
1362
+ if (s === 45 || s === 46 || s === 95 || s === 126 || s >= 48 && s <= 57 || s >= 65 && s <= 90 || s >= 97 && s <= 122 || a === za.RFC1738 && (s === 40 || s === 41)) {
1363
+ f[f.length] = u.charAt(p);
1364
+ continue;
1365
+ }
1366
+ if (s < 128) {
1367
+ f[f.length] = x[s];
1368
+ continue;
1369
+ }
1370
+ if (s < 2048) {
1371
+ f[f.length] = x[192 | s >> 6] + x[128 | s & 63];
1372
+ continue;
1373
+ }
1374
+ if (s < 55296 || s >= 57344) {
1375
+ f[f.length] = x[224 | s >> 12] + x[128 | s >> 6 & 63] + x[128 | s & 63];
1376
+ continue;
1377
+ }
1378
+ p += 1, s = 65536 + ((s & 1023) << 10 | u.charCodeAt(p) & 1023), f[f.length] = x[240 | s >> 18] + x[128 | s >> 12 & 63] + x[128 | s >> 6 & 63] + x[128 | s & 63];
1379
+ }
1380
+ c += f.join("");
1381
+ }
1382
+ return c;
1383
+ }, Va = function(e) {
1384
+ for (var r = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < r.length; ++o)
1385
+ for (var a = r[o], i = a.obj[a.prop], c = Object.keys(i), l = 0; l < c.length; ++l) {
1386
+ var u = c[l], f = i[u];
1387
+ typeof f == "object" && f !== null && n.indexOf(f) === -1 && (r.push({ obj: i, prop: u }), n.push(f));
1388
+ }
1389
+ return Wa(r), e;
1390
+ }, Qa = function(e) {
1391
+ return Object.prototype.toString.call(e) === "[object RegExp]";
1392
+ }, Ja = function(e) {
1393
+ return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
1394
+ }, Xa = function(e, r) {
1395
+ return [].concat(e, r);
1396
+ }, Ya = function(e, r) {
1397
+ if (j(e)) {
1398
+ for (var n = [], o = 0; o < e.length; o += 1)
1399
+ n.push(r(e[o]));
1400
+ return n;
1401
+ }
1402
+ return r(e);
1403
+ }, or = {
1404
+ arrayToObject: nr,
1405
+ assign: qa,
1406
+ combine: Xa,
1407
+ compact: Va,
1408
+ decode: Ha,
1409
+ encode: Ka,
1410
+ isBuffer: Ja,
1411
+ isRegExp: Qa,
1412
+ maybeMap: Ya,
1413
+ merge: Ga
1414
+ }, ar = Ba, ve = or, ne = rt, Za = Object.prototype.hasOwnProperty, ir = {
1415
+ brackets: function(e) {
1416
+ return e + "[]";
1417
+ },
1418
+ comma: "comma",
1419
+ indices: function(e, r) {
1420
+ return e + "[" + r + "]";
1421
+ },
1422
+ repeat: function(e) {
1423
+ return e;
1424
+ }
1425
+ }, A = Array.isArray, ei = Array.prototype.push, lr = function(t, e) {
1426
+ ei.apply(t, A(e) ? e : [e]);
1427
+ }, ti = Date.prototype.toISOString, Ct = ne.default, h = {
1428
+ addQueryPrefix: !1,
1429
+ allowDots: !1,
1430
+ allowEmptyArrays: !1,
1431
+ arrayFormat: "indices",
1432
+ charset: "utf-8",
1433
+ charsetSentinel: !1,
1434
+ commaRoundTrip: !1,
1435
+ delimiter: "&",
1436
+ encode: !0,
1437
+ encodeDotInKeys: !1,
1438
+ encoder: ve.encode,
1439
+ encodeValuesOnly: !1,
1440
+ filter: void 0,
1441
+ format: Ct,
1442
+ formatter: ne.formatters[Ct],
1443
+ // deprecated
1444
+ indices: !1,
1445
+ serializeDate: function(e) {
1446
+ return ti.call(e);
1447
+ },
1448
+ skipNulls: !1,
1449
+ strictNullHandling: !1
1450
+ }, ri = function(e) {
1451
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
1452
+ }, We = {}, ni = function t(e, r, n, o, a, i, c, l, u, f, p, s, v, d, b, S, I, R) {
1453
+ for (var m = e, k = R, N = 0, X = !1; (k = k.get(We)) !== void 0 && !X; ) {
1454
+ var z = k.get(e);
1455
+ if (N += 1, typeof z < "u") {
1456
+ if (z === N)
1457
+ throw new RangeError("Cyclic object value");
1458
+ X = !0;
1459
+ }
1460
+ typeof k.get(We) > "u" && (N = 0);
1461
+ }
1462
+ if (typeof f == "function" ? m = f(r, m) : m instanceof Date ? m = v(m) : n === "comma" && A(m) && (m = ve.maybeMap(m, function(Ee) {
1463
+ return Ee instanceof Date ? v(Ee) : Ee;
1464
+ })), m === null) {
1465
+ if (i)
1466
+ return u && !S ? u(r, h.encoder, I, "key", d) : r;
1467
+ m = "";
1468
+ }
1469
+ if (ri(m) || ve.isBuffer(m)) {
1470
+ if (u) {
1471
+ var ce = S ? r : u(r, h.encoder, I, "key", d);
1472
+ return [b(ce) + "=" + b(u(m, h.encoder, I, "value", d))];
1473
+ }
1474
+ return [b(r) + "=" + b(String(m))];
1475
+ }
1476
+ var M = [];
1477
+ if (typeof m > "u")
1478
+ return M;
1479
+ var T;
1480
+ if (n === "comma" && A(m))
1481
+ S && u && (m = ve.maybeMap(m, u)), T = [{ value: m.length > 0 ? m.join(",") || null : void 0 }];
1482
+ else if (A(f))
1483
+ T = f;
1484
+ else {
1485
+ var fe = Object.keys(m);
1486
+ T = p ? fe.sort(p) : fe;
1487
+ }
1488
+ var W = l ? String(r).replace(/\./g, "%2E") : String(r), w = o && A(m) && m.length === 1 ? W + "[]" : W;
1489
+ if (a && A(m) && m.length === 0)
1490
+ return w + "[]";
1491
+ for (var C = 0; C < T.length; ++C) {
1492
+ var E = T[C], Y = typeof E == "object" && E && typeof E.value < "u" ? E.value : m[E];
1493
+ if (!(c && Y === null)) {
1494
+ var Oe = s && l ? String(E).replace(/\./g, "%2E") : String(E), yr = A(m) ? typeof n == "function" ? n(w, Oe) : w : w + (s ? "." + Oe : "[" + Oe + "]");
1495
+ R.set(e, N);
1496
+ var ot = ar();
1497
+ ot.set(We, R), lr(M, t(
1498
+ Y,
1499
+ yr,
1500
+ n,
1501
+ o,
1502
+ a,
1503
+ i,
1504
+ c,
1505
+ l,
1506
+ n === "comma" && S && A(m) ? null : u,
1507
+ f,
1508
+ p,
1509
+ s,
1510
+ v,
1511
+ d,
1512
+ b,
1513
+ S,
1514
+ I,
1515
+ ot
1516
+ ));
1517
+ }
1518
+ }
1519
+ return M;
1520
+ }, oi = function(e) {
1521
+ if (!e)
1522
+ return h;
1523
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1524
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1525
+ if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
1526
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
1527
+ if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
1528
+ throw new TypeError("Encoder has to be a function.");
1529
+ var r = e.charset || h.charset;
1530
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1531
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1532
+ var n = ne.default;
1533
+ if (typeof e.format < "u") {
1534
+ if (!Za.call(ne.formatters, e.format))
1535
+ throw new TypeError("Unknown format option provided.");
1536
+ n = e.format;
1537
+ }
1538
+ var o = ne.formatters[n], a = h.filter;
1539
+ (typeof e.filter == "function" || A(e.filter)) && (a = e.filter);
1540
+ var i;
1541
+ if (e.arrayFormat in ir ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = h.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
1542
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1543
+ var c = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : h.allowDots : !!e.allowDots;
1544
+ return {
1545
+ addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : h.addQueryPrefix,
1546
+ allowDots: c,
1547
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : h.allowEmptyArrays,
1548
+ arrayFormat: i,
1549
+ charset: r,
1550
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : h.charsetSentinel,
1551
+ commaRoundTrip: !!e.commaRoundTrip,
1552
+ delimiter: typeof e.delimiter > "u" ? h.delimiter : e.delimiter,
1553
+ encode: typeof e.encode == "boolean" ? e.encode : h.encode,
1554
+ encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : h.encodeDotInKeys,
1555
+ encoder: typeof e.encoder == "function" ? e.encoder : h.encoder,
1556
+ encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : h.encodeValuesOnly,
1557
+ filter: a,
1558
+ format: n,
1559
+ formatter: o,
1560
+ serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : h.serializeDate,
1561
+ skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : h.skipNulls,
1562
+ sort: typeof e.sort == "function" ? e.sort : null,
1563
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : h.strictNullHandling
1564
+ };
1565
+ }, ai = function(t, e) {
1566
+ var r = t, n = oi(e), o, a;
1567
+ typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : A(n.filter) && (a = n.filter, o = a);
1568
+ var i = [];
1569
+ if (typeof r != "object" || r === null)
1570
+ return "";
1571
+ var c = ir[n.arrayFormat], l = c === "comma" && n.commaRoundTrip;
1572
+ o || (o = Object.keys(r)), n.sort && o.sort(n.sort);
1573
+ for (var u = ar(), f = 0; f < o.length; ++f) {
1574
+ var p = o[f], s = r[p];
1575
+ n.skipNulls && s === null || lr(i, ni(
1576
+ s,
1577
+ p,
1578
+ c,
1579
+ l,
1580
+ n.allowEmptyArrays,
1581
+ n.strictNullHandling,
1582
+ n.skipNulls,
1583
+ n.encodeDotInKeys,
1584
+ n.encode ? n.encoder : null,
1585
+ n.filter,
1586
+ n.sort,
1587
+ n.allowDots,
1588
+ n.serializeDate,
1589
+ n.format,
1590
+ n.formatter,
1591
+ n.encodeValuesOnly,
1592
+ n.charset,
1593
+ u
1594
+ ));
1595
+ }
1596
+ var v = i.join(n.delimiter), d = n.addQueryPrefix === !0 ? "?" : "";
1597
+ return n.charsetSentinel && (n.charset === "iso-8859-1" ? d += "utf8=%26%2310003%3B&" : d += "utf8=%E2%9C%93&"), v.length > 0 ? d + v : "";
1598
+ }, L = or, Je = Object.prototype.hasOwnProperty, Dt = Array.isArray, g = {
1599
+ allowDots: !1,
1600
+ allowEmptyArrays: !1,
1601
+ allowPrototypes: !1,
1602
+ allowSparse: !1,
1603
+ arrayLimit: 20,
1604
+ charset: "utf-8",
1605
+ charsetSentinel: !1,
1606
+ comma: !1,
1607
+ decodeDotInKeys: !1,
1608
+ decoder: L.decode,
1609
+ delimiter: "&",
1610
+ depth: 5,
1611
+ duplicates: "combine",
1612
+ ignoreQueryPrefix: !1,
1613
+ interpretNumericEntities: !1,
1614
+ parameterLimit: 1e3,
1615
+ parseArrays: !0,
1616
+ plainObjects: !1,
1617
+ strictDepth: !1,
1618
+ strictNullHandling: !1,
1619
+ throwOnLimitExceeded: !1
1620
+ }, ii = function(t) {
1621
+ return t.replace(/&#(\d+);/g, function(e, r) {
1622
+ return String.fromCharCode(parseInt(r, 10));
1623
+ });
1624
+ }, cr = function(t, e, r) {
1625
+ if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1)
1626
+ return t.split(",");
1627
+ if (e.throwOnLimitExceeded && r >= e.arrayLimit)
1628
+ throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1629
+ return t;
1630
+ }, li = "utf8=%26%2310003%3B", ci = "utf8=%E2%9C%93", fi = function(e, r) {
1631
+ var n = { __proto__: null }, o = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
1632
+ o = o.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1633
+ var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, i = o.split(
1634
+ r.delimiter,
1635
+ r.throwOnLimitExceeded ? a + 1 : a
1636
+ );
1637
+ if (r.throwOnLimitExceeded && i.length > a)
1638
+ throw new RangeError("Parameter limit exceeded. Only " + a + " parameter" + (a === 1 ? "" : "s") + " allowed.");
1639
+ var c = -1, l, u = r.charset;
1640
+ if (r.charsetSentinel)
1641
+ for (l = 0; l < i.length; ++l)
1642
+ i[l].indexOf("utf8=") === 0 && (i[l] === ci ? u = "utf-8" : i[l] === li && (u = "iso-8859-1"), c = l, l = i.length);
1643
+ for (l = 0; l < i.length; ++l)
1644
+ if (l !== c) {
1645
+ var f = i[l], p = f.indexOf("]="), s = p === -1 ? f.indexOf("=") : p + 1, v, d;
1646
+ s === -1 ? (v = r.decoder(f, g.decoder, u, "key"), d = r.strictNullHandling ? null : "") : (v = r.decoder(f.slice(0, s), g.decoder, u, "key"), d = L.maybeMap(
1647
+ cr(
1648
+ f.slice(s + 1),
1649
+ r,
1650
+ Dt(n[v]) ? n[v].length : 0
1651
+ ),
1652
+ function(S) {
1653
+ return r.decoder(S, g.decoder, u, "value");
1654
+ }
1655
+ )), d && r.interpretNumericEntities && u === "iso-8859-1" && (d = ii(String(d))), f.indexOf("[]=") > -1 && (d = Dt(d) ? [d] : d);
1656
+ var b = Je.call(n, v);
1657
+ b && r.duplicates === "combine" ? n[v] = L.combine(n[v], d) : (!b || r.duplicates === "last") && (n[v] = d);
1658
+ }
1659
+ return n;
1660
+ }, si = function(t, e, r, n) {
1661
+ var o = 0;
1662
+ if (t.length > 0 && t[t.length - 1] === "[]") {
1663
+ var a = t.slice(0, -1).join("");
1664
+ o = Array.isArray(e) && e[a] ? e[a].length : 0;
1665
+ }
1666
+ for (var i = n ? e : cr(e, r, o), c = t.length - 1; c >= 0; --c) {
1667
+ var l, u = t[c];
1668
+ if (u === "[]" && r.parseArrays)
1669
+ l = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : L.combine([], i);
1670
+ else {
1671
+ l = r.plainObjects ? { __proto__: null } : {};
1672
+ var f = u.charAt(0) === "[" && u.charAt(u.length - 1) === "]" ? u.slice(1, -1) : u, p = r.decodeDotInKeys ? f.replace(/%2E/g, ".") : f, s = parseInt(p, 10);
1673
+ !r.parseArrays && p === "" ? l = { 0: i } : !isNaN(s) && u !== p && String(s) === p && s >= 0 && r.parseArrays && s <= r.arrayLimit ? (l = [], l[s] = i) : p !== "__proto__" && (l[p] = i);
1674
+ }
1675
+ i = l;
1676
+ }
1677
+ return i;
1678
+ }, ui = function(e, r, n, o) {
1679
+ if (e) {
1680
+ var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, i = /(\[[^[\]]*])/, c = /(\[[^[\]]*])/g, l = n.depth > 0 && i.exec(a), u = l ? a.slice(0, l.index) : a, f = [];
1681
+ if (u) {
1682
+ if (!n.plainObjects && Je.call(Object.prototype, u) && !n.allowPrototypes)
1683
+ return;
1684
+ f.push(u);
1685
+ }
1686
+ for (var p = 0; n.depth > 0 && (l = c.exec(a)) !== null && p < n.depth; ) {
1687
+ if (p += 1, !n.plainObjects && Je.call(Object.prototype, l[1].slice(1, -1)) && !n.allowPrototypes)
1688
+ return;
1689
+ f.push(l[1]);
1690
+ }
1691
+ if (l) {
1692
+ if (n.strictDepth === !0)
1693
+ throw new RangeError("Input depth exceeded depth option of " + n.depth + " and strictDepth is true");
1694
+ f.push("[" + a.slice(l.index) + "]");
1695
+ }
1696
+ return si(f, r, n, o);
1697
+ }
1698
+ }, pi = function(e) {
1699
+ if (!e)
1700
+ return g;
1701
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1702
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1703
+ if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
1704
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1705
+ if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
1706
+ throw new TypeError("Decoder has to be a function.");
1707
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1708
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1709
+ if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
1710
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
1711
+ var r = typeof e.charset > "u" ? g.charset : e.charset, n = typeof e.duplicates > "u" ? g.duplicates : e.duplicates;
1712
+ if (n !== "combine" && n !== "first" && n !== "last")
1713
+ throw new TypeError("The duplicates option must be either combine, first, or last");
1714
+ var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : g.allowDots : !!e.allowDots;
1715
+ return {
1716
+ allowDots: o,
1717
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : g.allowEmptyArrays,
1718
+ allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : g.allowPrototypes,
1719
+ allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : g.allowSparse,
1720
+ arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : g.arrayLimit,
1721
+ charset: r,
1722
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : g.charsetSentinel,
1723
+ comma: typeof e.comma == "boolean" ? e.comma : g.comma,
1724
+ decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : g.decodeDotInKeys,
1725
+ decoder: typeof e.decoder == "function" ? e.decoder : g.decoder,
1726
+ delimiter: typeof e.delimiter == "string" || L.isRegExp(e.delimiter) ? e.delimiter : g.delimiter,
1727
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
1728
+ depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : g.depth,
1729
+ duplicates: n,
1730
+ ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
1731
+ interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : g.interpretNumericEntities,
1732
+ parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : g.parameterLimit,
1733
+ parseArrays: e.parseArrays !== !1,
1734
+ plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : g.plainObjects,
1735
+ strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : g.strictDepth,
1736
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : g.strictNullHandling,
1737
+ throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
1738
+ };
1739
+ }, yi = function(t, e) {
1740
+ var r = pi(e);
1741
+ if (t === "" || t === null || typeof t > "u")
1742
+ return r.plainObjects ? { __proto__: null } : {};
1743
+ for (var n = typeof t == "string" ? fi(t, r) : t, o = r.plainObjects ? { __proto__: null } : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
1744
+ var c = a[i], l = ui(c, n[c], r, typeof t == "string");
1745
+ o = L.merge(o, l, r);
1746
+ }
1747
+ return r.allowSparse === !0 ? o : L.compact(o);
1748
+ }, di = ai, vi = yi, mi = rt, gi = {
1749
+ formats: mi,
1750
+ parse: vi,
1751
+ stringify: di
1752
+ };
1753
+ const hi = /* @__PURE__ */ jr(gi);
1754
+ async function Ae(t, e = {}, r) {
1755
+ const { cms: n = "cms" } = e;
1756
+ return fetch(`${t.href}?${hi.stringify(e)}`, {
1757
+ method: "GET",
1758
+ cache: r ? "no-store" : "default",
1759
+ headers: {
1760
+ Accept: "application/json",
1761
+ "Content-Type": "application/json",
1762
+ "strapi-encode-source-maps": n === "strapi" && r ? "true" : "false"
1763
+ // strapi
1764
+ }
1765
+ });
1766
+ }
1767
+ function nt(t, e) {
1768
+ 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(
1769
+ new URL(`api/${t}`, process.env.NEXT_PUBLIC_API_URL)
1770
+ );
1771
+ }
1772
+ function fr(t) {
1773
+ return Array.isArray(t) && t.length > 0 ? t[0] : Array.isArray(t) ? null : t;
1774
+ }
1775
+ async function sr(t, e = [], r = {}) {
1776
+ var n;
1777
+ if ((r == null ? void 0 : r.contentType) === t) {
1778
+ 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}` : "", c = new URL(nt(`${t}${i}`, r)), l = await Ae(c, r, o);
1779
+ if (!l.ok)
1780
+ return console.error(`[Error fetching preview data]: ${t} - status: ${l.statusText}`), [];
1781
+ const u = await l.json(), f = e.findIndex((p) => p.documentId === u.id);
1782
+ return f !== -1 ? (e[f] = u, [...e]) : [u, ...e];
1783
+ }
1784
+ return e;
1785
+ }
1786
+ const Fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1787
+ __proto__: null,
1788
+ createUrl: nt,
1789
+ fetchCMS: Ae,
1790
+ mergePreviewDocument: sr,
1791
+ spreadStrapiData: fr
1792
+ }, Symbol.toStringTag, { value: "Module" }));
1793
+ async function ur(t, e = {}, r) {
1794
+ const n = !!(e != null && e.previewMode), o = await Ae(t, e, n);
1795
+ if (!o.ok)
1796
+ return console.log(
1797
+ `Failed to fetch Strapi (url=${String(t)}, status=${o.status})`
1798
+ ), { status: 404, data: [], error: String(o.status) };
1799
+ const { data: a } = await o.json();
1800
+ return a ? {
1801
+ status: 200,
1802
+ data: r ? fr(a) : a
1803
+ } : { status: 404, data: [], error: "No data found" };
1804
+ }
1805
+ async function pr(t, e, r = {}) {
1806
+ const n = (r == null ? void 0 : r.previewId) ?? "", o = (r == null ? void 0 : r.previewMode) === "true", a = { ...r, versionId: n }, i = [];
1807
+ let c = 1, l = 0, u = !0;
1808
+ try {
1809
+ do {
1810
+ const f = await Ae(e, { ...a, page: c }, o).then((p) => p.json()).catch((p) => (console.error("Error fetching VTEX CMS data:", p), console.error("Error URL:", e.toString()), null));
1811
+ c === 1 && (l = f.totalItems), Array.isArray(f == null ? void 0 : f.data) && i.push(...f.data), u = !!(f != null && f.hasNextPage), c++;
1812
+ } while (u && i.length < l);
1813
+ if (o && i.length > 0) {
1814
+ if (!t || !n)
1815
+ throw new Error(
1816
+ "contentType and previewId are required for preview mode in vtexCMSData"
1817
+ );
1818
+ const f = await sr(
1819
+ t,
1820
+ i,
1821
+ a
1822
+ );
1823
+ return {
1824
+ status: f.length > 0 ? 200 : 404,
1825
+ data: f
1826
+ };
1827
+ }
1828
+ return {
1829
+ status: i.length ? 200 : 404,
1830
+ data: i
1831
+ };
1832
+ } catch (f) {
1833
+ return {
1834
+ status: 500,
1835
+ data: [],
1836
+ error: f instanceof Error ? f.message : String(f)
1837
+ };
1838
+ }
1839
+ }
1840
+ const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1841
+ __proto__: null,
1842
+ strapiCMSData: ur,
1843
+ vtexCMSData: pr
1844
+ }, Symbol.toStringTag, { value: "Module" }));
1845
+ async function _i({
1846
+ contentType: t,
1847
+ documentId: e,
1848
+ versionId: r,
1849
+ storeId: n,
1850
+ CMS_PROJECT_NAME: o
1851
+ }) {
1852
+ const a = e && e.length ? `/${e}` : "", i = r && r.length ? `?versionId=${r}` : "";
1853
+ return fetch(
1854
+ `https://${n}.myvtex.com/_v/cms/api/${o}/${t}${a}${i}`,
1855
+ { cache: "no-cache" }
1856
+ );
1857
+ }
1858
+ async function bi(t, e = {}, r) {
1859
+ const { cms: n = "vtex" } = e ?? {};
1860
+ try {
1861
+ const o = new URL(nt(t, e));
1862
+ return n !== "vtex" ? ur(o, e, r) : pr(t, o, e);
1863
+ } catch (o) {
1864
+ return console.error(`[Fetch ContentType Error CMS ${n}]`, o), r ? { status: 400, data: null } : { status: 200, data: [] };
1865
+ }
1866
+ }
1867
+ const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1868
+ __proto__: null,
1869
+ fetchContentType: bi,
1870
+ getCMSContentType: _i
1871
+ }, Symbol.toStringTag, { value: "Module" }));
1872
+ export {
1873
+ Oi as A,
1874
+ Ii as B,
1875
+ Mi as C,
1876
+ Fi as D,
1877
+ Ni as E,
1878
+ ki as F,
1879
+ Di as S,
1880
+ wr as a,
1881
+ Or as b,
1882
+ _r as c,
1883
+ xr as d,
1884
+ xi as e,
1885
+ Ge as f,
1886
+ hr as g,
1887
+ mr as h,
1888
+ Ar as i,
1889
+ jr as j,
1890
+ Ti as k,
1891
+ gr as l,
1892
+ $r as m,
1893
+ Rr as n,
1894
+ br as o,
1895
+ $i as p,
1896
+ Ci as q,
1897
+ se as r,
1898
+ Ft as s,
1899
+ Er as t,
1900
+ Pr as u,
1901
+ Pi as v,
1902
+ Ai as w,
1903
+ Ri as x,
1904
+ bi as y,
1905
+ Ei as z
1906
+ };