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