@storybook/core
Version:
Storybook framework-agnostic API
1,187 lines (1,181 loc) • 75.3 kB
JavaScript
"use strict";
var Le = Object.create;
var z = Object.defineProperty;
var Me = Object.getOwnPropertyDescriptor;
var Fe = Object.getOwnPropertyNames;
var Ue = Object.getPrototypeOf, $e = Object.prototype.hasOwnProperty;
var o = (t, e) => z(t, "name", { value: e, configurable: !0 });
var F = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), ke = (t, e) => {
for (var r in e)
z(t, r, { get: e[r], enumerable: !0 });
}, he = (t, e, r, n) => {
if (e && typeof e == "object" || typeof e == "function")
for (let a of Fe(e))
!$e.call(t, a) && a !== r && z(t, a, { get: () => e[a], enumerable: !(n = Me(e, a)) || n.enumerable });
return t;
};
var I = (t, e, r) => (r = t != null ? Le(Ue(t)) : {}, he(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
e || !t || !t.__esModule ? z(r, "default", { value: t, enumerable: !0 }) : r,
t
)), Ge = (t) => he(z({}, "__esModule", { value: !0 }), t);
// ../node_modules/@storybook/global/dist/index.js
var te = F((pt, de) => {
"use strict";
var ne = Object.defineProperty, He = Object.getOwnPropertyDescriptor, We = Object.getOwnPropertyNames, qe = Object.prototype.hasOwnProperty,
Je = /* @__PURE__ */ o((t, e) => {
for (var r in e)
ne(t, r, { get: e[r], enumerable: !0 });
}, "__export"), ze = /* @__PURE__ */ o((t, e, r, n) => {
if (e && typeof e == "object" || typeof e == "function")
for (let a of We(e))
!qe.call(t, a) && a !== r && ne(t, a, { get: /* @__PURE__ */ o(() => e[a], "get"), enumerable: !(n = He(e, a)) || n.enumerable });
return t;
}, "__copyProps"), Be = /* @__PURE__ */ o((t) => ze(ne({}, "__esModule", { value: !0 }), t), "__toCommonJS"), ye = {};
Je(ye, {
global: /* @__PURE__ */ o(() => Ve, "global")
});
de.exports = Be(ye);
var Ve = (() => {
let t;
return typeof window < "u" ? t = window : typeof globalThis < "u" ? t = globalThis : typeof global < "u" ? t = global : typeof self < "u" ?
t = self : t = {}, t;
})();
});
// ../node_modules/ts-dedent/dist/index.js
var me = F((B) => {
"use strict";
Object.defineProperty(B, "__esModule", { value: !0 });
B.dedent = void 0;
function ge(t) {
for (var e = [], r = 1; r < arguments.length; r++)
e[r - 1] = arguments[r];
var n = Array.from(typeof t == "string" ? [t] : t);
n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
var a = n.reduce(function(c, i) {
var h = i.match(/\n([\t ]+|(?!\s).)/g);
return h ? c.concat(h.map(function(u) {
var p, y;
return (y = (p = u.match(/[\t ]/g)) === null || p === void 0 ? void 0 : p.length) !== null && y !== void 0 ? y : 0;
})) : c;
}, []);
if (a.length) {
var s = new RegExp(`
[ ]{` + Math.min.apply(Math, a) + "}", "g");
n = n.map(function(c) {
return c.replace(s, `
`);
});
}
n[0] = n[0].replace(/^\r?\n/, "");
var l = n[0];
return e.forEach(function(c, i) {
var h = l.match(/(?:^|\n)( *)$/), u = h ? h[1] : "", p = c;
typeof c == "string" && c.includes(`
`) && (p = String(c).split(`
`).map(function(y, d) {
return d === 0 ? y : "" + u + y;
}).join(`
`)), l += p + n[i + 1];
}), l;
}
o(ge, "dedent");
B.dedent = ge;
B.default = ge;
});
// ../node_modules/map-or-similar/src/similar.js
var _e = F((bt, ve) => {
function x() {
return this.list = [], this.lastItem = void 0, this.size = 0, this;
}
o(x, "Similar");
x.prototype.get = function(t) {
var e;
if (this.lastItem && this.isEqual(this.lastItem.key, t))
return this.lastItem.val;
if (e = this.indexOf(t), e >= 0)
return this.lastItem = this.list[e], this.list[e].val;
};
x.prototype.set = function(t, e) {
var r;
return this.lastItem && this.isEqual(this.lastItem.key, t) ? (this.lastItem.val = e, this) : (r = this.indexOf(t), r >= 0 ? (this.lastItem =
this.list[r], this.list[r].val = e, this) : (this.lastItem = { key: t, val: e }, this.list.push(this.lastItem), this.size++, this));
};
x.prototype.delete = function(t) {
var e;
if (this.lastItem && this.isEqual(this.lastItem.key, t) && (this.lastItem = void 0), e = this.indexOf(t), e >= 0)
return this.size--, this.list.splice(e, 1)[0];
};
x.prototype.has = function(t) {
var e;
return this.lastItem && this.isEqual(this.lastItem.key, t) ? !0 : (e = this.indexOf(t), e >= 0 ? (this.lastItem = this.list[e], !0) : !1);
};
x.prototype.forEach = function(t, e) {
var r;
for (r = 0; r < this.size; r++)
t.call(e || this, this.list[r].val, this.list[r].key, this);
};
x.prototype.indexOf = function(t) {
var e;
for (e = 0; e < this.size; e++)
if (this.isEqual(this.list[e].key, t))
return e;
return -1;
};
x.prototype.isEqual = function(t, e) {
return t === e || t !== t && e !== e;
};
ve.exports = x;
});
// ../node_modules/map-or-similar/src/map-or-similar.js
var Ee = F((St, be) => {
be.exports = function(t) {
if (typeof Map != "function" || t) {
var e = _e();
return new e();
} else
return /* @__PURE__ */ new Map();
};
});
// ../node_modules/memoizerific/src/memoizerific.js
var Ce = F((Tt, Te) => {
var Se = Ee();
Te.exports = function(t) {
var e = new Se(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), r = [];
return function(n) {
var a = /* @__PURE__ */ o(function() {
var s = e, l, c, i = arguments.length - 1, h = Array(i + 1), u = !0, p;
if ((a.numArgs || a.numArgs === 0) && a.numArgs !== i + 1)
throw new Error("Memoizerific functions should always be called with the same number of arguments");
for (p = 0; p < i; p++) {
if (h[p] = {
cacheItem: s,
arg: arguments[p]
}, s.has(arguments[p])) {
s = s.get(arguments[p]);
continue;
}
u = !1, l = new Se(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), s.set(arguments[p], l), s = l;
}
return u && (s.has(arguments[i]) ? c = s.get(arguments[i]) : u = !1), u || (c = n.apply(null, arguments), s.set(arguments[i], c)), t >
0 && (h[i] = {
cacheItem: s,
arg: arguments[i]
}, u ? Ze(r, h) : r.push(h), r.length > t && Qe(r.shift())), a.wasMemoized = u, a.numArgs = i + 1, c;
}, "memoizerific");
return a.limit = t, a.wasMemoized = !1, a.cache = e, a.lru = r, a;
};
};
function Ze(t, e) {
var r = t.length, n = e.length, a, s, l;
for (s = 0; s < r; s++) {
for (a = !0, l = 0; l < n; l++)
if (!et(t[s][l].arg, e[l].arg)) {
a = !1;
break;
}
if (a)
break;
}
t.push(t.splice(s, 1)[0]);
}
o(Ze, "moveToMostRecentLru");
function Qe(t) {
var e = t.length, r = t[e - 1], n, a;
for (r.cacheItem.delete(r.arg), a = e - 2; a >= 0 && (r = t[a], n = r.cacheItem.get(r.arg), !n || !n.size); a--)
r.cacheItem.delete(r.arg);
}
o(Qe, "removeCachedResult");
function et(t, e) {
return t === e || t !== t && e !== e;
}
o(et, "isEqual");
});
// ../node_modules/telejson/dist/index.js
var oe = F((exports, module) => {
"use strict";
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.
getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJS = /* @__PURE__ */ o(
(t, e) => /* @__PURE__ */ o(function() {
return e || (0, t[__getOwnPropNames(t)[0]])((e = { exports: {} }).exports, e), e.exports;
}, "__require"), "__commonJS"), __export = /* @__PURE__ */ o((t, e) => {
for (var r in e)
__defProp(t, r, { get: e[r], enumerable: !0 });
}, "__export"), __copyProps = /* @__PURE__ */ o((t, e, r, n) => {
if (e && typeof e == "object" || typeof e == "function")
for (let a of __getOwnPropNames(e))
!__hasOwnProp.call(t, a) && a !== r && __defProp(t, a, { get: /* @__PURE__ */ o(() => e[a], "get"), enumerable: !(n = __getOwnPropDesc(
e, a)) || n.enumerable });
return t;
}, "__copyProps"), __toESM = /* @__PURE__ */ o((t, e, r) => (r = t != null ? __create(__getProtoOf(t)) : {}, __copyProps(
e || !t || !t.__esModule ? __defProp(r, "default", { value: t, enumerable: !0 }) : r,
t
)), "__toESM"), __toCommonJS = /* @__PURE__ */ o((t) => __copyProps(__defProp({}, "__esModule", { value: !0 }), t), "__toCommonJS"), require_shams = __commonJS(
{
"node_modules/has-symbols/shams.js"(t, e) {
"use strict";
e.exports = /* @__PURE__ */ o(function() {
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
return !1;
if (typeof Symbol.iterator == "symbol")
return !0;
var n = {}, a = Symbol("test"), s = Object(a);
if (typeof a == "string" || Object.prototype.toString.call(a) !== "[object Symbol]" || Object.prototype.toString.call(s) !== "[objec\
t Symbol]")
return !1;
var l = 42;
n[a] = l;
for (a in n)
return !1;
if (typeof Object.keys == "function" && Object.keys(n).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(
n).length !== 0)
return !1;
var c = Object.getOwnPropertySymbols(n);
if (c.length !== 1 || c[0] !== a || !Object.prototype.propertyIsEnumerable.call(n, a))
return !1;
if (typeof Object.getOwnPropertyDescriptor == "function") {
var i = Object.getOwnPropertyDescriptor(n, a);
if (i.value !== l || i.enumerable !== !0)
return !1;
}
return !0;
}, "hasSymbols");
}
}), require_has_symbols = __commonJS({
"node_modules/has-symbols/index.js"(t, e) {
"use strict";
var r = typeof Symbol < "u" && Symbol, n = require_shams();
e.exports = /* @__PURE__ */ o(function() {
return typeof r != "function" || typeof Symbol != "function" || typeof r("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
n();
}, "hasNativeSymbols");
}
}), require_implementation = __commonJS({
"node_modules/function-bind/implementation.js"(t, e) {
"use strict";
var r = "Function.prototype.bind called on incompatible ", n = Array.prototype.slice, a = Object.prototype.toString, s = "[object Func\
tion]";
e.exports = /* @__PURE__ */ o(function(c) {
var i = this;
if (typeof i != "function" || a.call(i) !== s)
throw new TypeError(r + i);
for (var h = n.call(arguments, 1), u, p = /* @__PURE__ */ o(function() {
if (this instanceof u) {
var T = i.apply(
this,
h.concat(n.call(arguments))
);
return Object(T) === T ? T : this;
} else
return i.apply(
c,
h.concat(n.call(arguments))
);
}, "binder"), y = Math.max(0, i.length - h.length), d = [], v = 0; v < y; v++)
d.push("$" + v);
if (u = Function("binder", "return function (" + d.join(",") + "){ return binder.apply(this,arguments); }")(p), i.prototype) {
var w = /* @__PURE__ */ o(function() {
}, "Empty2");
w.prototype = i.prototype, u.prototype = new w(), w.prototype = null;
}
return u;
}, "bind");
}
}), require_function_bind = __commonJS({
"node_modules/function-bind/index.js"(t, e) {
"use strict";
var r = require_implementation();
e.exports = Function.prototype.bind || r;
}
}), require_src = __commonJS({
"node_modules/has/src/index.js"(t, e) {
"use strict";
var r = require_function_bind();
e.exports = r.call(Function.call, Object.prototype.hasOwnProperty);
}
}), require_get_intrinsic = __commonJS({
"node_modules/get-intrinsic/index.js"(t, e) {
"use strict";
var r, n = SyntaxError, a = Function, s = TypeError, l = /* @__PURE__ */ o(function(A) {
try {
return a('"use strict"; return (' + A + ").constructor;")();
} catch {
}
}, "getEvalledConstructor"), c = Object.getOwnPropertyDescriptor;
if (c)
try {
c({}, "");
} catch {
c = null;
}
var i = /* @__PURE__ */ o(function() {
throw new s();
}, "throwTypeError"), h = c ? function() {
try {
return arguments.callee, i;
} catch {
try {
return c(arguments, "callee").get;
} catch {
return i;
}
}
}() : i, u = require_has_symbols()(), p = Object.getPrototypeOf || function(A) {
return A.__proto__;
}, y = {}, d = typeof Uint8Array > "u" ? r : p(Uint8Array), v = {
"%AggregateError%": typeof AggregateError > "u" ? r : AggregateError,
"%Array%": Array,
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? r : ArrayBuffer,
"%ArrayIteratorPrototype%": u ? p([][Symbol.iterator]()) : r,
"%AsyncFromSyncIteratorPrototype%": r,
"%AsyncFunction%": y,
"%AsyncGenerator%": y,
"%AsyncGeneratorFunction%": y,
"%AsyncIteratorPrototype%": y,
"%Atomics%": typeof Atomics > "u" ? r : Atomics,
"%BigInt%": typeof BigInt > "u" ? r : BigInt,
"%Boolean%": Boolean,
"%DataView%": typeof DataView > "u" ? r : DataView,
"%Date%": Date,
"%decodeURI%": decodeURI,
"%decodeURIComponent%": decodeURIComponent,
"%encodeURI%": encodeURI,
"%encodeURIComponent%": encodeURIComponent,
"%Error%": Error,
"%eval%": eval,
"%EvalError%": EvalError,
"%Float32Array%": typeof Float32Array > "u" ? r : Float32Array,
"%Float64Array%": typeof Float64Array > "u" ? r : Float64Array,
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? r : FinalizationRegistry,
"%Function%": a,
"%GeneratorFunction%": y,
"%Int8Array%": typeof Int8Array > "u" ? r : Int8Array,
"%Int16Array%": typeof Int16Array > "u" ? r : Int16Array,
"%Int32Array%": typeof Int32Array > "u" ? r : Int32Array,
"%isFinite%": isFinite,
"%isNaN%": isNaN,
"%IteratorPrototype%": u ? p(p([][Symbol.iterator]())) : r,
"%JSON%": typeof JSON == "object" ? JSON : r,
"%Map%": typeof Map > "u" ? r : Map,
"%MapIteratorPrototype%": typeof Map > "u" || !u ? r : p((/* @__PURE__ */ new Map())[Symbol.iterator]()),
"%Math%": Math,
"%Number%": Number,
"%Object%": Object,
"%parseFloat%": parseFloat,
"%parseInt%": parseInt,
"%Promise%": typeof Promise > "u" ? r : Promise,
"%Proxy%": typeof Proxy > "u" ? r : Proxy,
"%RangeError%": RangeError,
"%ReferenceError%": ReferenceError,
"%Reflect%": typeof Reflect > "u" ? r : Reflect,
"%RegExp%": RegExp,
"%Set%": typeof Set > "u" ? r : Set,
"%SetIteratorPrototype%": typeof Set > "u" || !u ? r : p((/* @__PURE__ */ new Set())[Symbol.iterator]()),
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? r : SharedArrayBuffer,
"%String%": String,
"%StringIteratorPrototype%": u ? p(""[Symbol.iterator]()) : r,
"%Symbol%": u ? Symbol : r,
"%SyntaxError%": n,
"%ThrowTypeError%": h,
"%TypedArray%": d,
"%TypeError%": s,
"%Uint8Array%": typeof Uint8Array > "u" ? r : Uint8Array,
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? r : Uint8ClampedArray,
"%Uint16Array%": typeof Uint16Array > "u" ? r : Uint16Array,
"%Uint32Array%": typeof Uint32Array > "u" ? r : Uint32Array,
"%URIError%": URIError,
"%WeakMap%": typeof WeakMap > "u" ? r : WeakMap,
"%WeakRef%": typeof WeakRef > "u" ? r : WeakRef,
"%WeakSet%": typeof WeakSet > "u" ? r : WeakSet
}, w = /* @__PURE__ */ o(function A(g) {
var b;
if (g === "%AsyncFunction%")
b = l("async function () {}");
else if (g === "%GeneratorFunction%")
b = l("function* () {}");
else if (g === "%AsyncGeneratorFunction%")
b = l("async function* () {}");
else if (g === "%AsyncGenerator%") {
var m = A("%AsyncGeneratorFunction%");
m && (b = m.prototype);
} else if (g === "%AsyncIteratorPrototype%") {
var E = A("%AsyncGenerator%");
E && (b = p(E.prototype));
}
return v[g] = b, b;
}, "doEval2"), T = {
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
"%ArrayPrototype%": ["Array", "prototype"],
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
"%ArrayProto_values%": ["Array", "prototype", "values"],
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
"%BooleanPrototype%": ["Boolean", "prototype"],
"%DataViewPrototype%": ["DataView", "prototype"],
"%DatePrototype%": ["Date", "prototype"],
"%ErrorPrototype%": ["Error", "prototype"],
"%EvalErrorPrototype%": ["EvalError", "prototype"],
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
"%FunctionPrototype%": ["Function", "prototype"],
"%Generator%": ["GeneratorFunction", "prototype"],
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
"%JSONParse%": ["JSON", "parse"],
"%JSONStringify%": ["JSON", "stringify"],
"%MapPrototype%": ["Map", "prototype"],
"%NumberPrototype%": ["Number", "prototype"],
"%ObjectPrototype%": ["Object", "prototype"],
"%ObjProto_toString%": ["Object", "prototype", "toString"],
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
"%PromisePrototype%": ["Promise", "prototype"],
"%PromiseProto_then%": ["Promise", "prototype", "then"],
"%Promise_all%": ["Promise", "all"],
"%Promise_reject%": ["Promise", "reject"],
"%Promise_resolve%": ["Promise", "resolve"],
"%RangeErrorPrototype%": ["RangeError", "prototype"],
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
"%RegExpPrototype%": ["RegExp", "prototype"],
"%SetPrototype%": ["Set", "prototype"],
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
"%StringPrototype%": ["String", "prototype"],
"%SymbolPrototype%": ["Symbol", "prototype"],
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
"%TypeErrorPrototype%": ["TypeError", "prototype"],
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
"%URIErrorPrototype%": ["URIError", "prototype"],
"%WeakMapPrototype%": ["WeakMap", "prototype"],
"%WeakSetPrototype%": ["WeakSet", "prototype"]
}, N = require_function_bind(), j = require_src(), D = N.call(Function.call, Array.prototype.concat), L = N.call(Function.apply, Array.
prototype.splice), fe = N.call(Function.call, String.prototype.replace), K = N.call(Function.call, String.prototype.slice), xe = N.call(
Function.call, RegExp.prototype.exec), Ne = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
Re = /\\(\\)?/g, je = /* @__PURE__ */ o(function(g) {
var b = K(g, 0, 1), m = K(g, -1);
if (b === "%" && m !== "%")
throw new n("invalid intrinsic syntax, expected closing `%`");
if (m === "%" && b !== "%")
throw new n("invalid intrinsic syntax, expected opening `%`");
var E = [];
return fe(g, Ne, function(O, M, S, Y) {
E[E.length] = S ? fe(Y, Re, "$1") : M || O;
}), E;
}, "stringToPath3"), De = /* @__PURE__ */ o(function(g, b) {
var m = g, E;
if (j(T, m) && (E = T[m], m = "%" + E[0] + "%"), j(v, m)) {
var O = v[m];
if (O === y && (O = w(m)), typeof O > "u" && !b)
throw new s("intrinsic " + g + " exists, but is not available. Please file an issue!");
return {
alias: E,
name: m,
value: O
};
}
throw new n("intrinsic " + g + " does not exist!");
}, "getBaseIntrinsic2");
e.exports = /* @__PURE__ */ o(function(g, b) {
if (typeof g != "string" || g.length === 0)
throw new s("intrinsic name must be a non-empty string");
if (arguments.length > 1 && typeof b != "boolean")
throw new s('"allowMissing" argument must be a boolean');
if (xe(/^%?[^%]*%?$/, g) === null)
throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
var m = je(g), E = m.length > 0 ? m[0] : "", O = De("%" + E + "%", b), M = O.name, S = O.value, Y = !1, re = O.alias;
re && (E = re[0], L(m, D([0, 1], re)));
for (var X = 1, J = !0; X < m.length; X += 1) {
var P = m[X], Z = K(P, 0, 1), Q = K(P, -1);
if ((Z === '"' || Z === "'" || Z === "`" || Q === '"' || Q === "'" || Q === "`") && Z !== Q)
throw new n("property names with quotes must have matching quotes");
if ((P === "constructor" || !J) && (Y = !0), E += "." + P, M = "%" + E + "%", j(v, M))
S = v[M];
else if (S != null) {
if (!(P in S)) {
if (!b)
throw new s("base intrinsic for " + g + " exists, but the property is not available.");
return;
}
if (c && X + 1 >= m.length) {
var ee = c(S, P);
J = !!ee, J && "get" in ee && !("originalValue" in ee.get) ? S = ee.get : S = S[P];
} else
J = j(S, P), S = S[P];
J && !Y && (v[M] = S);
}
}
return S;
}, "GetIntrinsic");
}
}), require_call_bind = __commonJS({
"node_modules/call-bind/index.js"(t, e) {
"use strict";
var r = require_function_bind(), n = require_get_intrinsic(), a = n("%Function.prototype.apply%"), s = n("%Function.prototype.call%"),
l = n("%Reflect.apply%", !0) || r.call(s, a), c = n("%Object.getOwnPropertyDescriptor%", !0), i = n("%Object.defineProperty%", !0), h = n(
"%Math.max%");
if (i)
try {
i({}, "a", { value: 1 });
} catch {
i = null;
}
e.exports = /* @__PURE__ */ o(function(y) {
var d = l(r, s, arguments);
if (c && i) {
var v = c(d, "length");
v.configurable && i(
d,
"length",
{ value: 1 + h(0, y.length - (arguments.length - 1)) }
);
}
return d;
}, "callBind");
var u = /* @__PURE__ */ o(function() {
return l(r, a, arguments);
}, "applyBind2");
i ? i(e.exports, "apply", { value: u }) : e.exports.apply = u;
}
}), require_callBound = __commonJS({
"node_modules/call-bind/callBound.js"(t, e) {
"use strict";
var r = require_get_intrinsic(), n = require_call_bind(), a = n(r("String.prototype.indexOf"));
e.exports = /* @__PURE__ */ o(function(l, c) {
var i = r(l, !!c);
return typeof i == "function" && a(l, ".prototype.") > -1 ? n(i) : i;
}, "callBoundIntrinsic");
}
}), require_shams2 = __commonJS({
"node_modules/has-tostringtag/shams.js"(t, e) {
"use strict";
var r = require_shams();
e.exports = /* @__PURE__ */ o(function() {
return r() && !!Symbol.toStringTag;
}, "hasToStringTagShams");
}
}), require_is_regex = __commonJS({
"node_modules/is-regex/index.js"(t, e) {
"use strict";
var r = require_callBound(), n = require_shams2()(), a, s, l, c;
n && (a = r("Object.prototype.hasOwnProperty"), s = r("RegExp.prototype.exec"), l = {}, i = /* @__PURE__ */ o(function() {
throw l;
}, "throwRegexMarker"), c = {
toString: i,
valueOf: i
}, typeof Symbol.toPrimitive == "symbol" && (c[Symbol.toPrimitive] = i));
var i, h = r("Object.prototype.toString"), u = Object.getOwnPropertyDescriptor, p = "[object RegExp]";
e.exports = /* @__PURE__ */ o(n ? function(d) {
if (!d || typeof d != "object")
return !1;
var v = u(d, "lastIndex"), w = v && a(v, "value");
if (!w)
return !1;
try {
s(d, c);
} catch (T) {
return T === l;
}
} : function(d) {
return !d || typeof d != "object" && typeof d != "function" ? !1 : h(d) === p;
}, "isRegex");
}
}), require_is_function = __commonJS({
"node_modules/is-function/index.js"(t, e) {
e.exports = n;
var r = Object.prototype.toString;
function n(a) {
if (!a)
return !1;
var s = r.call(a);
return s === "[object Function]" || typeof a == "function" && s !== "[object RegExp]" || typeof window < "u" && (a === window.setTimeout ||
a === window.alert || a === window.confirm || a === window.prompt);
}
o(n, "isFunction3");
}
}), require_is_symbol = __commonJS({
"node_modules/is-symbol/index.js"(t, e) {
"use strict";
var r = Object.prototype.toString, n = require_has_symbols()();
n ? (a = Symbol.prototype.toString, s = /^Symbol\(.*\)$/, l = /* @__PURE__ */ o(function(i) {
return typeof i.valueOf() != "symbol" ? !1 : s.test(a.call(i));
}, "isRealSymbolObject"), e.exports = /* @__PURE__ */ o(function(i) {
if (typeof i == "symbol")
return !0;
if (r.call(i) !== "[object Symbol]")
return !1;
try {
return l(i);
} catch {
return !1;
}
}, "isSymbol3")) : e.exports = /* @__PURE__ */ o(function(i) {
return !1;
}, "isSymbol3");
var a, s, l;
}
}), src_exports = {};
__export(src_exports, {
isJSON: /* @__PURE__ */ o(() => isJSON, "isJSON"),
parse: /* @__PURE__ */ o(() => parse, "parse"),
replacer: /* @__PURE__ */ o(() => replacer, "replacer"),
reviver: /* @__PURE__ */ o(() => reviver2, "reviver"),
stringify: /* @__PURE__ */ o(() => stringify, "stringify")
});
module.exports = __toCommonJS(src_exports);
var import_is_regex = __toESM(require_is_regex()), import_is_function = __toESM(require_is_function()), import_is_symbol = __toESM(require_is_symbol());
function isObject(t) {
return t != null && typeof t == "object" && Array.isArray(t) === !1;
}
o(isObject, "isObject");
var freeGlobal = typeof global == "object" && global && global.Object === Object && global, freeGlobal_default = freeGlobal, freeSelf = typeof self ==
"object" && self && self.Object === Object && self, root2 = freeGlobal_default || freeSelf || Function("return this")(), root_default = root2,
Symbol2 = root_default.Symbol, Symbol_default = Symbol2, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.
toString, symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
function getRawTag(t) {
var e = hasOwnProperty.call(t, symToStringTag), r = t[symToStringTag];
try {
t[symToStringTag] = void 0;
var n = !0;
} catch {
}
var a = nativeObjectToString.call(t);
return n && (e ? t[symToStringTag] = r : delete t[symToStringTag]), a;
}
o(getRawTag, "getRawTag");
var getRawTag_default = getRawTag, objectProto2 = Object.prototype, nativeObjectToString2 = objectProto2.toString;
function objectToString(t) {
return nativeObjectToString2.call(t);
}
o(objectToString, "objectToString");
var objectToString_default = objectToString, nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2 = Symbol_default ?
Symbol_default.toStringTag : void 0;
function baseGetTag(t) {
return t == null ? t === void 0 ? undefinedTag : nullTag : symToStringTag2 && symToStringTag2 in Object(t) ? getRawTag_default(t) : objectToString_default(
t);
}
o(baseGetTag, "baseGetTag");
var baseGetTag_default = baseGetTag;
function isObjectLike(t) {
return t != null && typeof t == "object";
}
o(isObjectLike, "isObjectLike");
var isObjectLike_default = isObjectLike, symbolTag = "[object Symbol]";
function isSymbol(t) {
return typeof t == "symbol" || isObjectLike_default(t) && baseGetTag_default(t) == symbolTag;
}
o(isSymbol, "isSymbol");
var isSymbol_default = isSymbol;
function arrayMap(t, e) {
for (var r = -1, n = t == null ? 0 : t.length, a = Array(n); ++r < n; )
a[r] = e(t[r], r, t);
return a;
}
o(arrayMap, "arrayMap");
var arrayMap_default = arrayMap, isArray = Array.isArray, isArray_default = isArray, INFINITY = 1 / 0, symbolProto = Symbol_default ? Symbol_default.
prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
function baseToString(t) {
if (typeof t == "string")
return t;
if (isArray_default(t))
return arrayMap_default(t, baseToString) + "";
if (isSymbol_default(t))
return symbolToString ? symbolToString.call(t) : "";
var e = t + "";
return e == "0" && 1 / t == -INFINITY ? "-0" : e;
}
o(baseToString, "baseToString");
var baseToString_default = baseToString;
function isObject2(t) {
var e = typeof t;
return t != null && (e == "object" || e == "function");
}
o(isObject2, "isObject2");
var isObject_default = isObject2, asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]",
proxyTag = "[object Proxy]";
function isFunction(t) {
if (!isObject_default(t))
return !1;
var e = baseGetTag_default(t);
return e == funcTag || e == genTag || e == asyncTag || e == proxyTag;
}
o(isFunction, "isFunction");
var isFunction_default = isFunction, coreJsData = root_default["__core-js_shared__"], coreJsData_default = coreJsData, maskSrcKey = function() {
var t = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
return t ? "Symbol(src)_1." + t : "";
}();
function isMasked(t) {
return !!maskSrcKey && maskSrcKey in t;
}
o(isMasked, "isMasked");
var isMasked_default = isMasked, funcProto = Function.prototype, funcToString = funcProto.toString;
function toSource(t) {
if (t != null) {
try {
return funcToString.call(t);
} catch {
}
try {
return t + "";
} catch {
}
}
return "";
}
o(toSource, "toSource");
var toSource_default = toSource, reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto2 = Function.
prototype, objectProto3 = Object.prototype, funcToString2 = funcProto2.toString, hasOwnProperty2 = objectProto3.hasOwnProperty, reIsNative = RegExp(
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
"$1.*?") + "$"
);
function baseIsNative(t) {
if (!isObject_default(t) || isMasked_default(t))
return !1;
var e = isFunction_default(t) ? reIsNative : reIsHostCtor;
return e.test(toSource_default(t));
}
o(baseIsNative, "baseIsNative");
var baseIsNative_default = baseIsNative;
function getValue(t, e) {
return t?.[e];
}
o(getValue, "getValue");
var getValue_default = getValue;
function getNative(t, e) {
var r = getValue_default(t, e);
return baseIsNative_default(r) ? r : void 0;
}
o(getNative, "getNative");
var getNative_default = getNative;
function eq(t, e) {
return t === e || t !== t && e !== e;
}
o(eq, "eq");
var eq_default = eq, reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
function isKey(t, e) {
if (isArray_default(t))
return !1;
var r = typeof t;
return r == "number" || r == "symbol" || r == "boolean" || t == null || isSymbol_default(t) ? !0 : reIsPlainProp.test(t) || !reIsDeepProp.
test(t) || e != null && t in Object(e);
}
o(isKey, "isKey");
var isKey_default = isKey, nativeCreate = getNative_default(Object, "create"), nativeCreate_default = nativeCreate;
function hashClear() {
this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {}, this.size = 0;
}
o(hashClear, "hashClear");
var hashClear_default = hashClear;
function hashDelete(t) {
var e = this.has(t) && delete this.__data__[t];
return this.size -= e ? 1 : 0, e;
}
o(hashDelete, "hashDelete");
var hashDelete_default = hashDelete, HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto4 = Object.prototype, hasOwnProperty3 = objectProto4.
hasOwnProperty;
function hashGet(t) {
var e = this.__data__;
if (nativeCreate_default) {
var r = e[t];
return r === HASH_UNDEFINED ? void 0 : r;
}
return hasOwnProperty3.call(e, t) ? e[t] : void 0;
}
o(hashGet, "hashGet");
var hashGet_default = hashGet, objectProto5 = Object.prototype, hasOwnProperty4 = objectProto5.hasOwnProperty;
function hashHas(t) {
var e = this.__data__;
return nativeCreate_default ? e[t] !== void 0 : hasOwnProperty4.call(e, t);
}
o(hashHas, "hashHas");
var hashHas_default = hashHas, HASH_UNDEFINED2 = "__lodash_hash_undefined__";
function hashSet(t, e) {
var r = this.__data__;
return this.size += this.has(t) ? 0 : 1, r[t] = nativeCreate_default && e === void 0 ? HASH_UNDEFINED2 : e, this;
}
o(hashSet, "hashSet");
var hashSet_default = hashSet;
function Hash(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var n = t[e];
this.set(n[0], n[1]);
}
}
o(Hash, "Hash");
Hash.prototype.clear = hashClear_default;
Hash.prototype.delete = hashDelete_default;
Hash.prototype.get = hashGet_default;
Hash.prototype.has = hashHas_default;
Hash.prototype.set = hashSet_default;
var Hash_default = Hash;
function listCacheClear() {
this.__data__ = [], this.size = 0;
}
o(listCacheClear, "listCacheClear");
var listCacheClear_default = listCacheClear;
function assocIndexOf(t, e) {
for (var r = t.length; r--; )
if (eq_default(t[r][0], e))
return r;
return -1;
}
o(assocIndexOf, "assocIndexOf");
var assocIndexOf_default = assocIndexOf, arrayProto = Array.prototype, splice = arrayProto.splice;
function listCacheDelete(t) {
var e = this.__data__, r = assocIndexOf_default(e, t);
if (r < 0)
return !1;
var n = e.length - 1;
return r == n ? e.pop() : splice.call(e, r, 1), --this.size, !0;
}
o(listCacheDelete, "listCacheDelete");
var listCacheDelete_default = listCacheDelete;
function listCacheGet(t) {
var e = this.__data__, r = assocIndexOf_default(e, t);
return r < 0 ? void 0 : e[r][1];
}
o(listCacheGet, "listCacheGet");
var listCacheGet_default = listCacheGet;
function listCacheHas(t) {
return assocIndexOf_default(this.__data__, t) > -1;
}
o(listCacheHas, "listCacheHas");
var listCacheHas_default = listCacheHas;
function listCacheSet(t, e) {
var r = this.__data__, n = assocIndexOf_default(r, t);
return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
}
o(listCacheSet, "listCacheSet");
var listCacheSet_default = listCacheSet;
function ListCache(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var n = t[e];
this.set(n[0], n[1]);
}
}
o(ListCache, "ListCache");
ListCache.prototype.clear = listCacheClear_default;
ListCache.prototype.delete = listCacheDelete_default;
ListCache.prototype.get = listCacheGet_default;
ListCache.prototype.has = listCacheHas_default;
ListCache.prototype.set = listCacheSet_default;
var ListCache_default = ListCache, Map2 = getNative_default(root_default, "Map"), Map_default = Map2;
function mapCacheClear() {
this.size = 0, this.__data__ = {
hash: new Hash_default(),
map: new (Map_default || ListCache_default)(),
string: new Hash_default()
};
}
o(mapCacheClear, "mapCacheClear");
var mapCacheClear_default = mapCacheClear;
function isKeyable(t) {
var e = typeof t;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
o(isKeyable, "isKeyable");
var isKeyable_default = isKeyable;
function getMapData(t, e) {
var r = t.__data__;
return isKeyable_default(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
o(getMapData, "getMapData");
var getMapData_default = getMapData;
function mapCacheDelete(t) {
var e = getMapData_default(this, t).delete(t);
return this.size -= e ? 1 : 0, e;
}
o(mapCacheDelete, "mapCacheDelete");
var mapCacheDelete_default = mapCacheDelete;
function mapCacheGet(t) {
return getMapData_default(this, t).get(t);
}
o(mapCacheGet, "mapCacheGet");
var mapCacheGet_default = mapCacheGet;
function mapCacheHas(t) {
return getMapData_default(this, t).has(t);
}
o(mapCacheHas, "mapCacheHas");
var mapCacheHas_default = mapCacheHas;
function mapCacheSet(t, e) {
var r = getMapData_default(this, t), n = r.size;
return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
}
o(mapCacheSet, "mapCacheSet");
var mapCacheSet_default = mapCacheSet;
function MapCache(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var n = t[e];
this.set(n[0], n[1]);
}
}
o(MapCache, "MapCache");
MapCache.prototype.clear = mapCacheClear_default;
MapCache.prototype.delete = mapCacheDelete_default;
MapCache.prototype.get = mapCacheGet_default;
MapCache.prototype.has = mapCacheHas_default;
MapCache.prototype.set = mapCacheSet_default;
var MapCache_default = MapCache, FUNC_ERROR_TEXT = "Expected a function";
function memoize(t, e) {
if (typeof t != "function" || e != null && typeof e != "function")
throw new TypeError(FUNC_ERROR_TEXT);
var r = /* @__PURE__ */ o(function() {
var n = arguments, a = e ? e.apply(this, n) : n[0], s = r.cache;
if (s.has(a))
return s.get(a);
var l = t.apply(this, n);
return r.cache = s.set(a, l) || s, l;
}, "memoized");
return r.cache = new (memoize.Cache || MapCache_default)(), r;
}
o(memoize, "memoize");
memoize.Cache = MapCache_default;
var memoize_default = memoize, MAX_MEMOIZE_SIZE = 500;
function memoizeCapped(t) {
var e = memoize_default(t, function(n) {
return r.size === MAX_MEMOIZE_SIZE && r.clear(), n;
}), r = e.cache;
return e;
}
o(memoizeCapped, "memoizeCapped");
var memoizeCapped_default = memoizeCapped, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
reEscapeChar = /\\(\\)?/g, stringToPath = memoizeCapped_default(function(t) {
var e = [];
return t.charCodeAt(0) === 46 && e.push(""), t.replace(rePropName, function(r, n, a, s) {
e.push(a ? s.replace(reEscapeChar, "$1") : n || r);
}), e;
}), stringToPath_default = stringToPath;
function toString(t) {
return t == null ? "" : baseToString_default(t);
}
o(toString, "toString");
var toString_default = toString;
function castPath(t, e) {
return isArray_default(t) ? t : isKey_default(t, e) ? [t] : stringToPath_default(toString_default(t));
}
o(castPath, "castPath");
var castPath_default = castPath, INFINITY2 = 1 / 0;
function toKey(t) {
if (typeof t == "string" || isSymbol_default(t))
return t;
var e = t + "";
return e == "0" && 1 / t == -INFINITY2 ? "-0" : e;
}
o(toKey, "toKey");
var toKey_default = toKey;
function baseGet(t, e) {
e = castPath_default(e, t);
for (var r = 0, n = e.length; t != null && r < n; )
t = t[toKey_default(e[r++])];
return r && r == n ? t : void 0;
}
o(baseGet, "baseGet");
var baseGet_default = baseGet;
function get(t, e, r) {
var n = t == null ? void 0 : baseGet_default(t, e);
return n === void 0 ? r : n;
}
o(get, "get");
var get_default = get, import_memoizerific = __toESM(Ce()), eventProperties = [
"bubbles",
"cancelBubble",
"cancelable",
"composed",
"currentTarget",
"defaultPrevented",
"eventPhase",
"isTrusted",
"returnValue",
"srcElement",
"target",
"timeStamp",
"type"
], customEventSpecificProperties = ["detail"];
function extractEventHiddenProperties(t) {
let e = eventProperties.filter((r) => t[r] !== void 0).reduce((r, n) => ({ ...r, [n]: t[n] }), {});
return t instanceof CustomEvent && customEventSpecificProperties.filter((r) => t[r] !== void 0).forEach((r) => {
e[r] = t[r];
}), e;
}
o(extractEventHiddenProperties, "extractEventHiddenProperties");
var isObject3 = isObject, removeCodeComments = /* @__PURE__ */ o((t) => {
let e = null, r = !1, n = !1, a = !1, s = "";
if (t.indexOf("//") >= 0 || t.indexOf("/*") >= 0)
for (let l = 0; l < t.length; l += 1)
!e && !r && !n && !a ? t[l] === '"' || t[l] === "'" || t[l] === "`" ? e = t[l] : t[l] === "/" && t[l + 1] === "*" ? r = !0 : t[l] ===
"/" && t[l + 1] === "/" ? n = !0 : t[l] === "/" && t[l + 1] !== "/" && (a = !0) : (e && (t[l] === e && t[l - 1] !== "\\" || t[l] ===
`
` && e !== "`") && (e = null), a && (t[l] === "/" && t[l - 1] !== "\\" || t[l] === `
`) && (a = !1), r && t[l - 1] === "/" && t[l - 2] === "*" && (r = !1), n && t[l] === `
` && (n = !1)), !r && !n && (s += t[l]);
else
s = t;
return s;
}, "removeCodeComments"), cleanCode = (0, import_memoizerific.default)(1e4)(
(t) => removeCodeComments(t).replace(/\n\s*/g, "").trim()
), convertShorthandMethods = /* @__PURE__ */ o(function(e, r) {
let n = r.slice(0, r.indexOf("{")), a = r.slice(r.indexOf("{"));
if (n.includes("=>") || n.includes("function"))
return r;
let s = n;
return s = s.replace(e, "function"), s + a;
}, "convertShorthandMethods2"), dateFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, isJSON = /* @__PURE__ */ o((t) => t.match(
/^[\[\{\"\}].*[\]\}\"]$/), "isJSON");
function convertUnconventionalData(t) {
if (!isObject3(t))
return t;
let e = t, r = !1;
return typeof Event < "u" && t instanceof Event && (e = extractEventHiddenProperties(e), r = !0), e = Object.keys(e).reduce((n, a) => {
try {
e[a] && e[a].toJSON, n[a] = e[a];
} catch {
r = !0;
}
return n;
}, {}), r ? e : t;
}
o(convertUnconventionalData, "convertUnconventionalData");
var replacer = /* @__PURE__ */ o(function(e) {
let r, n, a, s;
return /* @__PURE__ */ o(function(c, i) {
try {
if (c === "")
return s = [], r = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), a = [], i;
let h = n.get(this) || this;
for (; a.length && h !== a[0]; )
a.shift(), s.pop();
if (typeof i == "boolean")
return i;
if (i === void 0)
return e.allowUndefined ? "_undefined_" : void 0;
if (i === null)
return null;
if (typeof i == "number")
return i === -1 / 0 ? "_-Infinity_" : i === 1 / 0 ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
if (typeof i == "bigint")
return `_bigint_${i.toString()}`;
if (typeof i == "string")
return dateFormat.test(i) ? e.allowDate ? `_date_${i}` : void 0 : i;
if ((0, import_is_regex.default)(i))
return e.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
if ((0, import_is_function.default)(i)) {
if (!e.allowFunction)
return;
let { name: p } = i, y = i.toString();
return y.match(
/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/
) ? `_function_${p}|${(() => {
}).toString()}` : `_function_${p}|${cleanCode(convertShorthandMethods(c, y))}`;
}
if ((0, import_is_symbol.default)(i)) {
if (!e.allowSymbol)
return;
let p = Symbol.keyFor(i);
return p !== void 0 ? `_gsymbol_${p}` : `_symbol_${i.toString().slice(7, -1)}`;
}
if (a.length >= e.maxDepth)
return Array.isArray(i) ? `[Array(${i.length})]` : "[Object]";
if (i === this)
return `_duplicate_${JSON.stringify(s)}`;
if (i instanceof Error && e.allowError)
return {
__isConvertedError__: !0,
errorProperties: {
...i.cause ? { cause: i.cause } : {},
...i,
name: i.name,
message: i.message,
stack: i.stack,
"_constructor-name_": i.constructor.name
}
};
if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && !e.allowClass)
return;
let u = r.get(i);
if (!u) {
let p = Array.isArray(i) ? i : convertUnconventionalData(i);
if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && e.allowClass)
try {
Object.assign(p, { "_constructor-name_": i.constructor.name });
} catch {
}
return s.push(c), a.unshift(p), r.set(i, JSON.stringify(s)), i !== p && n.set(i, p), p;
}
return `_duplicate_${u}`;
} catch {
return;
}
}, "replace");
}, "replacer2"), reviver2 = /* @__PURE__ */ o(function reviver(options) {
let refs = [], root;
return /* @__PURE__ */ o(function revive(key, value) {
if (key === "" && (root = value, refs.forEach(({ target: t, container: e, replacement: r }) => {
let n = isJSON(r) ? JSON.parse(r) : r.split(".");
n.length === 0 ? e[t] = root : e[t] = get_default(root, n);
})), key === "_constructor-name_")
return value;
if (isObject3(value) && value.__isConvertedError__) {
let { message: t, ...e } = value.errorProperties, r = new Error(t);
return Object.assign(r, e), r;
}
if (isObject3(value) && value["_constructor-name_"] && options.allowFunction) {
let t = value["_constructor-name_"];
if (t !== "Object") {
let e = new Function(`return function ${t.replace(/[^a-zA-Z0-9$_]+/g, "")}(){}`)();
Object.setPrototypeOf(value, new e());
}
return delete value["_constructor-name_"], value;
}
if (typeof value == "string" && value.startsWith("_function_") && options.allowFunction) {
let [, name, source] = value.match(/_function_([^|]*)\|(.*)/) || [], sourceSanitized = source.replace(/[(\(\))|\\| |\]|`]*$/, "");
if (!options.lazyEval)
return eval(`(${sourceSanitized})`);
let result = /* @__PURE__ */ o((...args) => {
let f = eval(`(${sourceSanitized})`);
return f(...args);
}, "result");
return Object.defineProperty(result, "toString", {
value: /* @__PURE__ */ o(() => sourceSanitized, "value")
}), Object.defineProperty(result, "name", {
value: name
}), result;
}
if (typeof value == "string" && value.startsWith("_regexp_") && options.allowRegExp) {
let [, t, e] = value.match(/_regexp_([^|]*)\|(.*)/) || [];
return new RegExp(e, t);
}
return typeof value == "string" && value.startsWith("_date_") && options.allowDate ? new Date(value.replace("_date_", "")) : typeof value ==
"string" && value.startsWith("_duplicate_") ? (refs.push({ target: key, container: this, replacement: value.replace(/^_duplicate_/, "") }),
null) : typeof value == "string" && value.startsWith("_symbol_") && options.allowSymbol ? Symbol(value.replace("_symbol_", "")) : typeof value ==
"string" && value.startsWith("_gsymbol_") && options.allowSymbol ? Symbol.for(value.replace("_gsymbol_", "")) : typeof value == "strin\
g" && value === "_-Infinity_" ? -1 / 0 : typeof value == "string" && value === "_Infinity_" ? 1 / 0 : typeof value == "string" && value === "\
_NaN_" ? NaN : typeof value == "string" && value.startsWith("_bigint_") && typeof BigInt == "function" ? BigInt(value.replace("_bigint_", "")) :
value;
}, "revive");
}, "reviver"), defaultOptions = {
maxDepth: 10,
space: void 0,
allowFunction: !0,
allowRegExp: !0,
allowDate: !0,
allowClass: !0,
allowError: !0,
allowUndefined: !0,
allowSymbol: !0,
lazyEval: !0
}, stringify = /* @__PURE__ */ o((t, e = {}) => {
let r = { ...defaultOptions, ...e };
return JSON.stringify(convertUnconventionalData(t), replacer(r), e.space);
}, "stringify"), mutator = /*