UNPKG

@vrism/viewer-sdk

Version:

React and Vanilla JavaScript SDK for embedding 3D product viewers powered by Verge3D technology

1,458 lines 817 kB
import "../index.css"; import { jsx as I, jsxs as he, Fragment as Vn } from "react/jsx-runtime"; import * as D from "react"; import wt, { Component as I0, createElement as bu, createContext as Qp, forwardRef as _a, useContext as L0, useEffect as le, useImperativeHandle as Xp, useState as fe, useRef as He, useMemo as zn, useCallback as gn, useLayoutEffect as P0 } from "react"; function R0(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var ds = { exports: {} }; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ var _u; function z0() { return _u || (_u = 1, (function(t) { (function() { var e = {}.hasOwnProperty; function n() { for (var a = "", o = 0; o < arguments.length; o++) { var s = arguments[o]; s && (a = i(a, r(s))); } return a; } function r(a) { if (typeof a == "string" || typeof a == "number") return a; if (typeof a != "object") return ""; if (Array.isArray(a)) return n.apply(null, a); if (a.toString !== Object.prototype.toString && !a.toString.toString().includes("[native code]")) return a.toString(); var o = ""; for (var s in a) e.call(a, s) && a[s] && (o = i(o, s)); return o; } function i(a, o) { return o ? a ? a + " " + o : a + o : a; } t.exports ? (n.default = n, t.exports = n) : window.classNames = n; })(); })(ds)), ds.exports; } var D0 = z0(); const N0 = /* @__PURE__ */ R0(D0), j0 = Qp(null), ps = { didCatch: !1, error: null }; class V0 extends I0 { constructor(e) { super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = ps; } static getDerivedStateFromError(e) { return { didCatch: !0, error: e }; } resetErrorBoundary() { const { error: e } = this.state; if (e !== null) { for (var n, r, i = arguments.length, a = new Array(i), o = 0; o < i; o++) a[o] = arguments[o]; (n = (r = this.props).onReset) === null || n === void 0 || n.call(r, { args: a, reason: "imperative-api" }), this.setState(ps); } } componentDidCatch(e, n) { var r, i; (r = (i = this.props).onError) === null || r === void 0 || r.call(i, e, n); } componentDidUpdate(e, n) { const { didCatch: r } = this.state, { resetKeys: i } = this.props; if (r && n.error !== null && F0(e.resetKeys, i)) { var a, o; (a = (o = this.props).onReset) === null || a === void 0 || a.call(o, { next: i, prev: e.resetKeys, reason: "keys" }), this.setState(ps); } } render() { const { children: e, fallbackRender: n, FallbackComponent: r, fallback: i } = this.props, { didCatch: a, error: o } = this.state; let s = e; if (a) { const l = { error: o, resetErrorBoundary: this.resetErrorBoundary }; if (typeof n == "function") s = n(l); else if (r) s = bu(r, l); else if (i !== void 0) s = i; else throw o; } return bu(j0.Provider, { value: { didCatch: a, error: o, resetErrorBoundary: this.resetErrorBoundary } }, s); } } function F0() { let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; return t.length !== e.length || t.some((n, r) => !Object.is(n, e[r])); } var B0 = Object.defineProperty, U0 = (t, e, n) => e in t ? B0(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, lo = (t, e, n) => U0(t, typeof e != "symbol" ? e + "" : e, n); function H0({ isInitiatedRef: t, onUpdate: e, onFinish: n }) { const { v3d: r } = Th(), [i, a] = fe(0), [o, s] = fe(!1), [l, c] = fe(null); function d() { a(0), s(!1); } return le(() => { if (!r) return; let p = new r.Preloader(); p.onUpdate = (u) => { a(u), e && e(u); }, p.onFinish = () => { n && n(p), setTimeout(() => { s(!0); }, 175); }, c(p); }, [r]), le(() => { t.current || d(); }, [t.current]), { resetLoader: d, preloader: l, isLoaded: o, percentage: i }; } const W0 = {}, wu = (t) => { let e; const n = /* @__PURE__ */ new Set(), r = (s, l) => { const c = typeof s == "function" ? s(e) : s; if (!Object.is(c, e)) { const d = e; e = (l != null ? l : typeof c != "object" || c === null) ? c : Object.assign({}, e, c), n.forEach((p) => p(e, d)); } }, i = () => e, a = { setState: r, getState: i, getInitialState: () => o, subscribe: (s) => (n.add(s), () => n.delete(s)), destroy: () => { (W0 ? "production" : void 0) !== "production" && console.warn( "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." ), n.clear(); } }, o = e = t(r, i, a); return a; }, G0 = (t) => t ? wu(t) : wu; var dl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function hc(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } function q0(t) { if (t.__esModule) return t; var e = t.default; if (typeof e == "function") { var n = function r() { return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; n.prototype = e.prototype; } else n = {}; return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) { var i = Object.getOwnPropertyDescriptor(t, r); Object.defineProperty(n, r, i.get ? i : { enumerable: !0, get: function() { return t[r]; } }); }), n; } var pl = { exports: {} }, hs = {}, fs = { exports: {} }, ms = {}; /** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var xu; function $0() { if (xu) return ms; xu = 1; var t = wt; function e(p, u) { return p === u && (p !== 0 || 1 / p === 1 / u) || p !== p && u !== u; } var n = typeof Object.is == "function" ? Object.is : e, r = t.useState, i = t.useEffect, a = t.useLayoutEffect, o = t.useDebugValue; function s(p, u) { var f = u(), h = r({ inst: { value: f, getSnapshot: u } }), m = h[0].inst, g = h[1]; return a( function() { m.value = f, m.getSnapshot = u, l(m) && g({ inst: m }); }, [p, f, u] ), i( function() { return l(m) && g({ inst: m }), p(function() { l(m) && g({ inst: m }); }); }, [p] ), o(f), f; } function l(p) { var u = p.getSnapshot; p = p.value; try { var f = u(); return !n(p, f); } catch (h) { return !0; } } function c(p, u) { return u(); } var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? c : s; return ms.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : d, ms; } var Su = {}; /** * @license React * use-sync-external-store-shim.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Eu; function Y0() { return Eu || (Eu = 1, process.env.NODE_ENV !== "production" && (function() { function t(f, h) { return f === h && (f !== 0 || 1 / f === 1 / h) || f !== f && h !== h; } function e(f, h) { d || i.startTransition === void 0 || (d = !0, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var m = h(); if (!p) { var g = h(); a(m, g) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), p = !0); } g = o({ inst: { value: m, getSnapshot: h } }); var y = g[0].inst, _ = g[1]; return l( function() { y.value = m, y.getSnapshot = h, n(y) && _({ inst: y }); }, [f, m, h] ), s( function() { return n(y) && _({ inst: y }), f(function() { n(y) && _({ inst: y }); }); }, [f] ), c(m), m; } function n(f) { var h = f.getSnapshot; f = f.value; try { var m = h(); return !a(f, m); } catch (g) { return !0; } } function r(f, h) { return h(); } typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var i = wt, a = typeof Object.is == "function" ? Object.is : t, o = i.useState, s = i.useEffect, l = i.useLayoutEffect, c = i.useDebugValue, d = !1, p = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : e; Su.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })()), Su; } var Cu; function Jp() { return Cu || (Cu = 1, process.env.NODE_ENV === "production" ? fs.exports = $0() : fs.exports = Y0()), fs.exports; } /** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ku; function Z0() { if (ku) return hs; ku = 1; var t = wt, e = Jp(); function n(c, d) { return c === d && (c !== 0 || 1 / c === 1 / d) || c !== c && d !== d; } var r = typeof Object.is == "function" ? Object.is : n, i = e.useSyncExternalStore, a = t.useRef, o = t.useEffect, s = t.useMemo, l = t.useDebugValue; return hs.useSyncExternalStoreWithSelector = function(c, d, p, u, f) { var h = a(null); if (h.current === null) { var m = { hasValue: !1, value: null }; h.current = m; } else m = h.current; h = s( function() { function y(x) { if (!_) { if (_ = !0, b = x, x = u(x), f !== void 0 && m.hasValue) { var S = m.value; if (f(S, x)) return v = S; } return v = x; } if (S = v, r(b, x)) return S; var E = u(x); return f !== void 0 && f(S, E) ? (b = x, S) : (b = x, v = E); } var _ = !1, b, v, w = p === void 0 ? null : p; return [ function() { return y(d()); }, w === null ? void 0 : function() { return y(w()); } ]; }, [d, p, u, f] ); var g = i(c, h[0], h[1]); return o( function() { m.hasValue = !0, m.value = g; }, [g] ), l(g), g; }, hs; } var Tu = {}; /** * @license React * use-sync-external-store-shim/with-selector.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Au; function K0() { return Au || (Au = 1, process.env.NODE_ENV !== "production" && (function() { function t(c, d) { return c === d && (c !== 0 || 1 / c === 1 / d) || c !== c && d !== d; } typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var e = wt, n = Jp(), r = typeof Object.is == "function" ? Object.is : t, i = n.useSyncExternalStore, a = e.useRef, o = e.useEffect, s = e.useMemo, l = e.useDebugValue; Tu.useSyncExternalStoreWithSelector = function(c, d, p, u, f) { var h = a(null); if (h.current === null) { var m = { hasValue: !1, value: null }; h.current = m; } else m = h.current; h = s( function() { function y(x) { if (!_) { if (_ = !0, b = x, x = u(x), f !== void 0 && m.hasValue) { var S = m.value; if (f(S, x)) return v = S; } return v = x; } if (S = v, r(b, x)) return S; var E = u(x); return f !== void 0 && f(S, E) ? (b = x, S) : (b = x, v = E); } var _ = !1, b, v, w = p === void 0 ? null : p; return [ function() { return y(d()); }, w === null ? void 0 : function() { return y(w()); } ]; }, [d, p, u, f] ); var g = i(c, h[0], h[1]); return o( function() { m.hasValue = !0, m.value = g; }, [g] ), l(g), g; }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })()), Tu; } process.env.NODE_ENV === "production" ? pl.exports = Z0() : pl.exports = K0(); var Q0 = pl.exports; const X0 = /* @__PURE__ */ hc(Q0), eh = {}, { useDebugValue: J0 } = wt, { useSyncExternalStoreWithSelector: eg } = X0; let Mu = !1; const tg = (t) => t; function ng(t, e = tg, n) { (eh ? "production" : void 0) !== "production" && n && !Mu && (console.warn( "[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937" ), Mu = !0); const r = eg( t.subscribe, t.getState, t.getServerState || t.getInitialState, e, n ); return J0(r), r; } const Ou = (t) => { (eh ? "production" : void 0) !== "production" && typeof t != "function" && console.warn( "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." ); const e = typeof t == "function" ? G0(t) : t, n = (r, i) => ng(e, r, i); return Object.assign(n, e), n; }, rg = (t) => t ? Ou(t) : Ou; var Oi = TypeError; const ig = {}, ag = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: ig }, Symbol.toStringTag, { value: "Module" })), og = /* @__PURE__ */ q0(ag); var fc = typeof Map == "function" && Map.prototype, gs = Object.getOwnPropertyDescriptor && fc ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, Co = fc && gs && typeof gs.get == "function" ? gs.get : null, Iu = fc && Map.prototype.forEach, mc = typeof Set == "function" && Set.prototype, vs = Object.getOwnPropertyDescriptor && mc ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ko = mc && vs && typeof vs.get == "function" ? vs.get : null, Lu = mc && Set.prototype.forEach, sg = typeof WeakMap == "function" && WeakMap.prototype, Xi = sg ? WeakMap.prototype.has : null, lg = typeof WeakSet == "function" && WeakSet.prototype, Ji = lg ? WeakSet.prototype.has : null, cg = typeof WeakRef == "function" && WeakRef.prototype, Pu = cg ? WeakRef.prototype.deref : null, ug = Boolean.prototype.valueOf, dg = Object.prototype.toString, pg = Function.prototype.toString, hg = String.prototype.match, gc = String.prototype.slice, Zn = String.prototype.replace, fg = String.prototype.toUpperCase, Ru = String.prototype.toLowerCase, th = RegExp.prototype.test, zu = Array.prototype.concat, pn = Array.prototype.join, mg = Array.prototype.slice, Du = Math.floor, hl = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, ys = Object.getOwnPropertySymbols, fl = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, gi = typeof Symbol == "function" && typeof Symbol.iterator == "object", ea = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === gi || !0) ? Symbol.toStringTag : null, nh = Object.prototype.propertyIsEnumerable, Nu = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) { return t.__proto__; } : null); function ju(t, e) { if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || th.call(/e/, e)) return e; var n = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; if (typeof t == "number") { var r = t < 0 ? -Du(-t) : Du(t); if (r !== t) { var i = String(r), a = gc.call(e, i.length + 1); return Zn.call(i, n, "$&_") + "." + Zn.call(Zn.call(a, /([0-9]{3})/g, "$&_"), /_$/, ""); } } return Zn.call(e, n, "$&_"); } var ml = og, Vu = ml.custom, Fu = ah(Vu) ? Vu : null, rh = { __proto__: null, double: '"', single: "'" }, gg = { __proto__: null, double: /(["\\])/g, single: /(['\\])/g }, qo = function t(e, n, r, i) { var a = n || {}; if (Tn(a, "quoteStyle") && !Tn(rh, a.quoteStyle)) throw new TypeError('option "quoteStyle" must be "single" or "double"'); if (Tn(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null)) throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); var o = Tn(a, "customInspect") ? a.customInspect : !0; if (typeof o != "boolean" && o !== "symbol") throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); if (Tn(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0)) throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); if (Tn(a, "numericSeparator") && typeof a.numericSeparator != "boolean") throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); var s = a.numericSeparator; if (typeof e > "u") return "undefined"; if (e === null) return "null"; if (typeof e == "boolean") return e ? "true" : "false"; if (typeof e == "string") return sh(e, a); if (typeof e == "number") { if (e === 0) return 1 / 0 / e > 0 ? "0" : "-0"; var l = String(e); return s ? ju(e, l) : l; } if (typeof e == "bigint") { var c = String(e) + "n"; return s ? ju(e, c) : c; } var d = typeof a.depth > "u" ? 5 : a.depth; if (typeof r > "u" && (r = 0), r >= d && d > 0 && typeof e == "object") return gl(e) ? "[Array]" : "[Object]"; var p = Rg(a, r); if (typeof i > "u") i = []; else if (oh(i, e) >= 0) return "[Circular]"; function u(L, V, F) { if (V && (i = mg.call(i), i.push(V)), F) { var H = { depth: a.depth }; return Tn(a, "quoteStyle") && (H.quoteStyle = a.quoteStyle), t(L, H, r + 1, i); } return t(L, a, r + 1, i); } if (typeof e == "function" && !Bu(e)) { var f = Cg(e), h = Ua(e, u); return "[Function" + (f ? ": " + f : " (anonymous)") + "]" + (h.length > 0 ? " { " + pn.call(h, ", ") + " }" : ""); } if (ah(e)) { var m = gi ? Zn.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : fl.call(e); return typeof e == "object" && !gi ? Ui(m) : m; } if (Ig(e)) { for (var g = "<" + Ru.call(String(e.nodeName)), y = e.attributes || [], _ = 0; _ < y.length; _++) g += " " + y[_].name + "=" + ih(vg(y[_].value), "double", a); return g += ">", e.childNodes && e.childNodes.length && (g += "..."), g += "</" + Ru.call(String(e.nodeName)) + ">", g; } if (gl(e)) { if (e.length === 0) return "[]"; var b = Ua(e, u); return p && !Pg(b) ? "[" + vl(b, p) + "]" : "[ " + pn.call(b, ", ") + " ]"; } if (bg(e)) { var v = Ua(e, u); return !("cause" in Error.prototype) && "cause" in e && !nh.call(e, "cause") ? "{ [" + String(e) + "] " + pn.call(zu.call("[cause]: " + u(e.cause), v), ", ") + " }" : v.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + pn.call(v, ", ") + " }"; } if (typeof e == "object" && o) { if (Fu && typeof e[Fu] == "function" && ml) return ml(e, { depth: d - r }); if (o !== "symbol" && typeof e.inspect == "function") return e.inspect(); } if (kg(e)) { var w = []; return Iu && Iu.call(e, function(L, V) { w.push(u(V, e, !0) + " => " + u(L, e)); }), Uu("Map", Co.call(e), w, p); } if (Mg(e)) { var x = []; return Lu && Lu.call(e, function(L) { x.push(u(L, e)); }), Uu("Set", ko.call(e), x, p); } if (Tg(e)) return bs("WeakMap"); if (Og(e)) return bs("WeakSet"); if (Ag(e)) return bs("WeakRef"); if (wg(e)) return Ui(u(Number(e))); if (Sg(e)) return Ui(u(hl.call(e))); if (xg(e)) return Ui(ug.call(e)); if (_g(e)) return Ui(u(String(e))); if (typeof window < "u" && e === window) return "{ [object Window] }"; if (typeof globalThis < "u" && e === globalThis || typeof dl < "u" && e === dl) return "{ [object globalThis] }"; if (!yg(e) && !Bu(e)) { var S = Ua(e, u), E = Nu ? Nu(e) === Object.prototype : e instanceof Object || e.constructor === Object, A = e instanceof Object ? "" : "null prototype", C = !E && ea && Object(e) === e && ea in e ? gc.call(sr(e), 8, -1) : A ? "Object" : "", O = E || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", M = O + (C || A ? "[" + pn.call(zu.call([], C || [], A || []), ": ") + "] " : ""); return S.length === 0 ? M + "{}" : p ? M + "{" + vl(S, p) + "}" : M + "{ " + pn.call(S, ", ") + " }"; } return String(e); }; function ih(t, e, n) { var r = n.quoteStyle || e, i = rh[r]; return i + t + i; } function vg(t) { return Zn.call(String(t), /"/g, "&quot;"); } function zr(t) { return !ea || !(typeof t == "object" && (ea in t || typeof t[ea] < "u")); } function gl(t) { return sr(t) === "[object Array]" && zr(t); } function yg(t) { return sr(t) === "[object Date]" && zr(t); } function Bu(t) { return sr(t) === "[object RegExp]" && zr(t); } function bg(t) { return sr(t) === "[object Error]" && zr(t); } function _g(t) { return sr(t) === "[object String]" && zr(t); } function wg(t) { return sr(t) === "[object Number]" && zr(t); } function xg(t) { return sr(t) === "[object Boolean]" && zr(t); } function ah(t) { if (gi) return t && typeof t == "object" && t instanceof Symbol; if (typeof t == "symbol") return !0; if (!t || typeof t != "object" || !fl) return !1; try { return fl.call(t), !0; } catch (e) { } return !1; } function Sg(t) { if (!t || typeof t != "object" || !hl) return !1; try { return hl.call(t), !0; } catch (e) { } return !1; } var Eg = Object.prototype.hasOwnProperty || function(t) { return t in this; }; function Tn(t, e) { return Eg.call(t, e); } function sr(t) { return dg.call(t); } function Cg(t) { if (t.name) return t.name; var e = hg.call(pg.call(t), /^function\s*([\w$]+)/); return e ? e[1] : null; } function oh(t, e) { if (t.indexOf) return t.indexOf(e); for (var n = 0, r = t.length; n < r; n++) if (t[n] === e) return n; return -1; } function kg(t) { if (!Co || !t || typeof t != "object") return !1; try { Co.call(t); try { ko.call(t); } catch (e) { return !0; } return t instanceof Map; } catch (e) { } return !1; } function Tg(t) { if (!Xi || !t || typeof t != "object") return !1; try { Xi.call(t, Xi); try { Ji.call(t, Ji); } catch (e) { return !0; } return t instanceof WeakMap; } catch (e) { } return !1; } function Ag(t) { if (!Pu || !t || typeof t != "object") return !1; try { return Pu.call(t), !0; } catch (e) { } return !1; } function Mg(t) { if (!ko || !t || typeof t != "object") return !1; try { ko.call(t); try { Co.call(t); } catch (e) { return !0; } return t instanceof Set; } catch (e) { } return !1; } function Og(t) { if (!Ji || !t || typeof t != "object") return !1; try { Ji.call(t, Ji); try { Xi.call(t, Xi); } catch (e) { return !0; } return t instanceof WeakSet; } catch (e) { } return !1; } function Ig(t) { return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function"; } function sh(t, e) { if (t.length > e.maxStringLength) { var n = t.length - e.maxStringLength, r = "... " + n + " more character" + (n > 1 ? "s" : ""); return sh(gc.call(t, 0, e.maxStringLength), e) + r; } var i = gg[e.quoteStyle || "single"]; i.lastIndex = 0; var a = Zn.call(Zn.call(t, i, "\\$1"), /[\x00-\x1f]/g, Lg); return ih(a, "single", e); } function Lg(t) { var e = t.charCodeAt(0), n = { 8: "b", 9: "t", 10: "n", 12: "f", 13: "r" }[e]; return n ? "\\" + n : "\\x" + (e < 16 ? "0" : "") + fg.call(e.toString(16)); } function Ui(t) { return "Object(" + t + ")"; } function bs(t) { return t + " { ? }"; } function Uu(t, e, n, r) { var i = r ? vl(n, r) : pn.call(n, ", "); return t + " (" + e + ") {" + i + "}"; } function Pg(t) { for (var e = 0; e < t.length; e++) if (oh(t[e], ` `) >= 0) return !1; return !0; } function Rg(t, e) { var n; if (t.indent === " ") n = " "; else if (typeof t.indent == "number" && t.indent > 0) n = pn.call(Array(t.indent + 1), " "); else return null; return { base: n, prev: pn.call(Array(e + 1), n) }; } function vl(t, e) { if (t.length === 0) return ""; var n = ` ` + e.prev + e.base; return n + pn.call(t, "," + n) + ` ` + e.prev; } function Ua(t, e) { var n = gl(t), r = []; if (n) { r.length = t.length; for (var i = 0; i < t.length; i++) r[i] = Tn(t, i) ? e(t[i], t) : ""; } var a = typeof ys == "function" ? ys(t) : [], o; if (gi) { o = {}; for (var s = 0; s < a.length; s++) o["$" + a[s]] = a[s]; } for (var l in t) Tn(t, l) && (n && String(Number(l)) === l && l < t.length || gi && o["$" + l] instanceof Symbol || (th.call(/[^\w$]/, l) ? r.push(e(l, t) + ": " + e(t[l], t)) : r.push(l + ": " + e(t[l], t)))); if (typeof ys == "function") for (var c = 0; c < a.length; c++) nh.call(t, a[c]) && r.push("[" + e(a[c]) + "]: " + e(t[a[c]], t)); return r; } var zg = qo, Dg = Oi, $o = function(t, e, n) { for (var r = t, i; (i = r.next) != null; r = i) if (i.key === e) return r.next = i.next, n || (i.next = /** @type {NonNullable<typeof list.next>} */ t.next, t.next = i), i; }, Ng = function(t, e) { if (t) { var n = $o(t, e); return n && n.value; } }, jg = function(t, e, n) { var r = $o(t, e); r ? r.value = n : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ { // eslint-disable-line no-param-reassign, no-extra-parens key: e, next: t.next, value: n }; }, Vg = function(t, e) { return t ? !!$o(t, e) : !1; }, Fg = function(t, e) { if (t) return $o(t, e, !0); }, Bg = function() { var t, e = { assert: function(n) { if (!e.has(n)) throw new Dg("Side channel does not contain " + zg(n)); }, delete: function(n) { var r = t && t.next, i = Fg(t, n); return i && r && r === i && (t = void 0), !!i; }, get: function(n) { return Ng(t, n); }, has: function(n) { return Vg(t, n); }, set: function(n, r) { t || (t = { next: void 0 }), jg( /** @type {NonNullable<typeof $o>} */ t, n, r ); } }; return e; }, lh = Object, Ug = Error, Hg = EvalError, Wg = RangeError, Gg = ReferenceError, qg = SyntaxError, $g = URIError, Yg = Math.abs, Zg = Math.floor, Kg = Math.max, Qg = Math.min, Xg = Math.pow, Jg = Math.round, e2 = Number.isNaN || function(t) { return t !== t; }, t2 = e2, n2 = function(t) { return t2(t) || t === 0 ? t : t < 0 ? -1 : 1; }, r2 = Object.getOwnPropertyDescriptor, co = r2; if (co) try { co([], "length"); } catch (t) { co = null; } var ch = co, uo = Object.defineProperty || !1; if (uo) try { uo({}, "a", { value: 1 }); } catch (t) { uo = !1; } var i2 = uo, Hu, Wu; function a2() { return Wu || (Wu = 1, Hu = function() { if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1; if (typeof Symbol.iterator == "symbol") return !0; var t = {}, e = Symbol("test"), n = Object(e); if (typeof e == "string" || Object.prototype.toString.call(e) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]") return !1; var r = 42; t[e] = r; for (var i in t) return !1; if (typeof Object.keys == "function" && Object.keys(t).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(t).length !== 0) return !1; var a = Object.getOwnPropertySymbols(t); if (a.length !== 1 || a[0] !== e || !Object.prototype.propertyIsEnumerable.call(t, e)) return !1; if (typeof Object.getOwnPropertyDescriptor == "function") { var o = ( /** @type {PropertyDescriptor} */ Object.getOwnPropertyDescriptor(t, e) ); if (o.value !== r || o.enumerable !== !0) return !1; } return !0; }), Hu; } var _s, Gu; function o2() { if (Gu) return _s; Gu = 1; var t = typeof Symbol < "u" && Symbol, e = a2(); return _s = function() { return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e(); }, _s; } var qu, $u; function uh() { return $u || ($u = 1, qu = typeof Reflect < "u" && Reflect.getPrototypeOf || null), qu; } var ws, Yu; function dh() { if (Yu) return ws; Yu = 1; var t = lh; return ws = t.getPrototypeOf || null, ws; } var s2 = "Function.prototype.bind called on incompatible ", l2 = Object.prototype.toString, c2 = Math.max, u2 = "[object Function]", Zu = function(t, e) { for (var n = [], r = 0; r < t.length; r += 1) n[r] = t[r]; for (var i = 0; i < e.length; i += 1) n[i + t.length] = e[i]; return n; }, d2 = function(t, e) { for (var n = [], r = e, i = 0; r < t.length; r += 1, i += 1) n[i] = t[r]; return n; }, p2 = function(t, e) { for (var n = "", r = 0; r < t.length; r += 1) n += t[r], r + 1 < t.length && (n += e); return n; }, h2 = function(t) { var e = this; if (typeof e != "function" || l2.apply(e) !== u2) throw new TypeError(s2 + e); for (var n = d2(arguments, 1), r, i = function() { if (this instanceof r) { var c = e.apply( this, Zu(n, arguments) ); return Object(c) === c ? c : this; } return e.apply( t, Zu(n, arguments) ); }, a = c2(0, e.length - n.length), o = [], s = 0; s < a; s++) o[s] = "$" + s; if (r = Function("binder", "return function (" + p2(o, ",") + "){ return binder.apply(this,arguments); }")(i), e.prototype) { var l = function() { }; l.prototype = e.prototype, r.prototype = new l(), l.prototype = null; } return r; }, f2 = h2, Yo = Function.prototype.bind || f2, vc = Function.prototype.call, Ku, Qu; function ph() { return Qu || (Qu = 1, Ku = Function.prototype.apply), Ku; } var m2 = typeof Reflect < "u" && Reflect && Reflect.apply, g2 = Yo, v2 = ph(), y2 = vc, b2 = m2, _2 = b2 || g2.call(y2, v2), w2 = Yo, x2 = Oi, S2 = vc, E2 = _2, hh = function(t) { if (t.length < 1 || typeof t[0] != "function") throw new x2("a function is required"); return E2(w2, S2, t); }, xs, Xu; function C2() { if (Xu) return xs; Xu = 1; var t = hh, e = ch, n; try { n = /** @type {{ __proto__?: typeof Array.prototype }} */ [].__proto__ === Array.prototype; } catch (o) { if (!o || typeof o != "object" || !("code" in o) || o.code !== "ERR_PROTO_ACCESS") throw o; } var r = !!n && e && e( Object.prototype, /** @type {keyof typeof Object.prototype} */ "__proto__" ), i = Object, a = i.getPrototypeOf; return xs = r && typeof r.get == "function" ? t([r.get]) : typeof a == "function" ? ( /** @type {import('./get')} */ (function(o) { return a(o == null ? o : i(o)); }) ) : !1, xs; } var Ss, Ju; function k2() { if (Ju) return Ss; Ju = 1; var t = uh(), e = dh(), n = C2(); return Ss = t ? function(r) { return t(r); } : e ? function(r) { if (!r || typeof r != "object" && typeof r != "function") throw new TypeError("getProto: not an object"); return e(r); } : n ? function(r) { return n(r); } : null, Ss; } var Es, ed; function T2() { if (ed) return Es; ed = 1; var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, n = Yo; return Es = n.call(t, e), Es; } var ne, A2 = lh, M2 = Ug, O2 = Hg, I2 = Wg, L2 = Gg, vi = qg, li = Oi, P2 = $g, R2 = Yg, z2 = Zg, D2 = Kg, N2 = Qg, j2 = Xg, V2 = Jg, F2 = n2, fh = Function, Cs = function(t) { try { return fh('"use strict"; return (' + t + ").constructor;")(); } catch (e) { } }, ca = ch, B2 = i2, ks = function() { throw new li(); }, U2 = ca ? (function() { try { return arguments.callee, ks; } catch (t) { try { return ca(arguments, "callee").get; } catch (e) { return ks; } } })() : ks, Gr = o2()(), Xe = k2(), H2 = dh(), W2 = uh(), mh = ph(), wa = vc, ei = {}, G2 = typeof Uint8Array > "u" || !Xe ? ne : Xe(Uint8Array), xr = { __proto__: null, "%AggregateError%": typeof AggregateError > "u" ? ne : AggregateError, "%Array%": Array, "%ArrayBuffer%": typeof ArrayBuffer > "u" ? ne : ArrayBuffer, "%ArrayIteratorPrototype%": Gr && Xe ? Xe([][Symbol.iterator]()) : ne, "%AsyncFromSyncIteratorPrototype%": ne, "%AsyncFunction%": ei, "%AsyncGenerator%": ei, "%AsyncGeneratorFunction%": ei, "%AsyncIteratorPrototype%": ei, "%Atomics%": typeof Atomics > "u" ? ne : Atomics, "%BigInt%": typeof BigInt > "u" ? ne : BigInt, "%BigInt64Array%": typeof BigInt64Array > "u" ? ne : BigInt64Array, "%BigUint64Array%": typeof BigUint64Array > "u" ? ne : BigUint64Array, "%Boolean%": Boolean, "%DataView%": typeof DataView > "u" ? ne : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": M2, "%eval%": eval, // eslint-disable-line no-eval "%EvalError%": O2, "%Float16Array%": typeof Float16Array > "u" ? ne : Float16Array, "%Float32Array%": typeof Float32Array > "u" ? ne : Float32Array, "%Float64Array%": typeof Float64Array > "u" ? ne : Float64Array, "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? ne : FinalizationRegistry, "%Function%": fh, "%GeneratorFunction%": ei, "%Int8Array%": typeof Int8Array > "u" ? ne : Int8Array, "%Int16Array%": typeof Int16Array > "u" ? ne : Int16Array, "%Int32Array%": typeof Int32Array > "u" ? ne : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": Gr && Xe ? Xe(Xe([][Symbol.iterator]())) : ne, "%JSON%": typeof JSON == "object" ? JSON : ne, "%Map%": typeof Map > "u" ? ne : Map, "%MapIteratorPrototype%": typeof Map > "u" || !Gr || !Xe ? ne : Xe((/* @__PURE__ */ new Map())[Symbol.iterator]()), "%Math%": Math, "%Number%": Number, "%Object%": A2, "%Object.getOwnPropertyDescriptor%": ca, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": typeof Promise > "u" ? ne : Promise, "%Proxy%": typeof Proxy > "u" ? ne : Proxy, "%RangeError%": I2, "%ReferenceError%": L2, "%Reflect%": typeof Reflect > "u" ? ne : Reflect, "%RegExp%": RegExp, "%Set%": typeof Set > "u" ? ne : Set, "%SetIteratorPrototype%": typeof Set > "u" || !Gr || !Xe ? ne : Xe((/* @__PURE__ */ new Set())[Symbol.iterator]()), "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? ne : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": Gr && Xe ? Xe(""[Symbol.iterator]()) : ne, "%Symbol%": Gr ? Symbol : ne, "%SyntaxError%": vi, "%ThrowTypeError%": U2, "%TypedArray%": G2, "%TypeError%": li, "%Uint8Array%": typeof Uint8Array > "u" ? ne : Uint8Array, "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? ne : Uint8ClampedArray, "%Uint16Array%": typeof Uint16Array > "u" ? ne : Uint16Array, "%Uint32Array%": typeof Uint32Array > "u" ? ne : Uint32Array, "%URIError%": P2, "%WeakMap%": typeof WeakMap > "u" ? ne : WeakMap, "%WeakRef%": typeof WeakRef > "u" ? ne : WeakRef, "%WeakSet%": typeof WeakSet > "u" ? ne : WeakSet, "%Function.prototype.call%": wa, "%Function.prototype.apply%": mh, "%Object.defineProperty%": B2, "%Object.getPrototypeOf%": H2, "%Math.abs%": R2, "%Math.floor%": z2, "%Math.max%": D2, "%Math.min%": N2, "%Math.pow%": j2, "%Math.round%": V2, "%Math.sign%": F2, "%Reflect.getPrototypeOf%": W2 }; if (Xe) try { null.error; } catch (t) { var q2 = Xe(Xe(t)); xr["%Error.prototype%"] = q2; } var $2 = function t(e) { var n; if (e === "%AsyncFunction%") n = Cs("async function () {}"); else if (e === "%GeneratorFunction%") n = Cs("function* () {}"); else if (e === "%AsyncGeneratorFunction%") n = Cs("async function* () {}"); else if (e === "%AsyncGenerator%") { var r = t("%AsyncGeneratorFunction%"); r && (n = r.prototype); } else if (e === "%AsyncIteratorPrototype%") { var i = t("%AsyncGenerator%"); i && Xe && (n = Xe(i.prototype)); } return xr[e] = n, n; }, td = { __proto__: null, "%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"] }, xa = Yo, To = T2(), Y2 = xa.call(wa, Array.prototype.concat), Z2 = xa.call(mh, Array.prototype.splice), nd = xa.call(wa, String.prototype.replace), Ao = xa.call(wa, String.prototype.slice), K2 = xa.call(wa, RegExp.prototype.exec), Q2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, X2 = /\\(\\)?/g, J2 = function(t) { var e = Ao(t, 0, 1), n = Ao(t, -1); if (e === "%" && n !== "%") throw new vi("invalid intrinsic syntax, expected closing `%`"); if (n === "%" && e !== "%") throw new vi("invalid intrinsic syntax, expected opening `%`"); var r = []; return nd(t, Q2, function(i, a, o, s) { r[r.length] = o ? nd(s, X2, "$1") : a || i; }), r; }, ev = function(t, e) { var n = t, r; if (To(td, n) && (r = td[n], n = "%" + r[0] + "%"), To(xr, n)) { var i = xr[n]; if (i === ei && (i = $2(n)), typeof i > "u" && !e) throw new li("intrinsic " + t + " exists, but is not available. Please file an issue!"); return { alias: r, name: n, value: i }; } throw new vi("intrinsic " + t + " does not exist!"); }, yc = function(t, e) { if (typeof t != "string" || t.length === 0) throw new li("intrinsic name must be a non-empty string"); if (arguments.length > 1 && typeof e != "boolean") throw new li('"allowMissing" argument must be a boolean'); if (K2(/^%?[^%]*%?$/, t) === null) throw new vi("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); var n = J2(t), r = n.length > 0 ? n[0] : "", i = ev("%" + r + "%", e), a = i.name, o = i.value, s = !1, l = i.alias; l && (r = l[0], Z2(n, Y2([0, 1], l))); for (var c = 1, d = !0; c < n.length; c += 1) { var p = n[c], u = Ao(p, 0, 1), f = Ao(p, -1); if ((u === '"' || u === "'" || u === "`" || f === '"' || f === "'" || f === "`") && u !== f) throw new vi("property names with quotes must have matching quotes"); if ((p === "constructor" || !d) && (s = !0), r += "." + p, a = "%" + r + "%", To(xr, a)) o = xr[a]; else if (o != null) { if (!(p in o)) { if (!e) throw new li("base intrinsic for " + t + " exists, but the property is not available."); return; } if (ca && c + 1 >= n.length) { var h = ca(o, p); d = !!h, d && "get" in h && !("originalValue" in h.get) ? o = h.get : o = o[p]; } else d = To(o, p), o = o[p]; d && !s && (xr[a] = o); } } return o; }, gh = yc, vh = hh, tv = vh([gh("%String.prototype.indexOf%")]), yh = function(t, e) { var n = ( /** @type {(this: unknown, ...args: unknown[]) => unknown} */ gh(t, !!e) ); return typeof n == "function" && tv(t, ".prototype.") > -1 ? vh( /** @type {const} */ [n] ) : n; }, nv = yc, Sa = yh, rv = qo, iv = Oi, rd = nv("%Map%", !0), av = Sa("Map.prototype.get", !0), ov = Sa("Map.prototype.set", !0), sv = Sa("Map.prototype.has", !0), lv = Sa("Map.prototype.delete", !0), cv = Sa("Map.prototype.size", !0), bh = !!rd && /** @type {Exclude<import('.'), false>} */ function() { var t, e = { assert: function(n) { if (!e.has(n)) throw new iv("Side channel does not contain " + rv(n)); }, delete: function(n) { if (t) { var r = lv(t, n); return cv(t) === 0 && (t = void 0), r; } return !1; }, get: function(n) { if (t) return av(t, n); }, has: function(n) { return t ? sv(t, n) : !1; }, set: function(n, r) { t || (t = new rd()), ov(t, n, r); } }; return e; }, uv = yc, Zo = yh, dv = qo, Ha = bh, pv = Oi, qr = uv("%WeakMap%", !0), hv = Zo("WeakMap.prototype.get", !0), fv = Zo("WeakMap.prototype.set", !0), mv = Zo("WeakMap.prototype.has", !0), gv = Zo("WeakMap.prototype.delete", !0), vv = qr ? ( /** @type {Exclude<import('.'), false>} */ (function() { var t, e, n = { assert: function(r) { if (!n.has(r)) throw new pv("Side channel does not contain " + dv(r)); }, delete: function(r) { if (qr && r && (typeof r == "object" || typeof r == "function")) { if (t) return gv(t, r); } else if (Ha && e) return e.delete(r); return !1; }, get: function(r) { return qr && r && (typeof r == "object" || typeof r == "function") && t ? hv(t, r) : e && e.get(r); }, has: function(r) { return qr && r && (typeof r == "object" || typeof r == "function") && t ? mv(t, r) : !!e && e.has(r); }, set: function(r, i) { qr && r && (typeof r == "object" || typeof r == "function") ? (t || (t = new qr()), fv(t, r, i)) : Ha && (e || (e = Ha()), e.set(r, i)); } }; return n; }) ) : Ha, yv = Oi, bv = qo, _v = Bg, wv = bh, xv = vv, Sv = xv || wv || _v, Ev = function() { var t, e = { assert: function(n) { if (!e.has(n)) throw new yv("Side channel does not contain " + bv(n)); }, delete: function(n) { return !!t && t.delete(n); }, get: function(n) { return t && t.get(n); }, has: function(n) { return !!t && t.has(n); }, set: function(n, r) { t || (t = Sv()), t.set(n, r); } }; return e; }, Cv = String.prototype.replace, kv = /%20/g, Ts = { RFC1738: "RFC1738", RFC3986: "RFC3986" }, bc = { default: Ts.RFC3986, formatters: { RFC1738: function(t) { return Cv.call(t, kv, "+"); }, RFC3986: function(t) { return String(t); } }, RFC1738: Ts.RFC1738, RFC3986: Ts.RFC3986 }, Tv = bc, As = Object.prototype.hasOwnProperty, yr = Array.isArray, sn = (function() { for (var t = [], e = 0; e < 256; ++e) t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()); return t; })(), Av = function(t) { for (; t.length > 1; ) { var e = t.pop(), n = e.obj[e.prop]; if (yr(n)) { for (var r = [], i = 0; i < n.length; ++i) typeof n[i] < "u" && r.push(n[i]); e.obj[e.prop] = r; } } }, _h = function(t, e) { for (var n = e && e.plainObjects ? { __proto__: null } : {}, r = 0; r < t.length; ++r) typeof t[r] < "u" && (n[r] = t[r]); return n; }, Mv = function t(e, n, r) { if (!n) return e; if (typeof n != "object" && typeof n != "function") { if (yr(e)) e.push(n); else if (e && typeof e == "object") (r && (r.plainObjects || r.allowPrototypes) || !As.call(Object.prototype, n)) && (e[n] = !0); else return [e, n]; return e; } if (!e || typeof e != "object") return [e].concat(n); var i = e; return yr(e) && !yr(n) && (i = _h(e, r)), yr(e) && yr(n) ? (n.forEach(function(a, o) { if (As.call(e, o)) { var s = e[o]; s && typeof s == "object" && a && typeof a == "object" ? e[o] = t(s, a, r) : e.push(a); } else e[o] = a; }), e) : Object.keys(n).reduce(function(a, o) { var s = n[o]; return As.call(a, o) ? a[o] = t(a[o], s, r) : a[o] = s, a; }, i); }, Ov = function(t, e) { return Object.keys(e).reduce(function(n, r) { return n[r] = e[r], n; }, t); }, Iv = function(t, e, n) { var r = t.replace(/\+/g, " "); if (n === "iso-8859-1") return r.replace(/%[0-9a-f]{2}/gi, unescape); try { return decodeURIComponent(r); } catch (i) { return r; } }, Ms = 1024, Lv = function(t, e, n, r, i) { if (t.length === 0) return t; var a = t; if (typeof t == "symbol" ? a = Symbol.prototype.toString.call(t) : typeof t != "string" && (a = String(t)), n === "iso-8859-1") return escape(a).replace(/%u[0-9a-f]{4}/gi, function(u) { return "%26%23" + parseInt(u.slice(2), 16) + "%3B"; }); for (var o = "", s = 0; s < a.length; s += Ms) { for (var l = a.length >= Ms ? a.slice(s, s + Ms) : a, c = [], d = 0; d < l.length; ++d) { var p = l.charCodeAt(d); if (p === 45 || p === 46 || p === 95 || p === 126 || p >= 48 && p <= 57 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || i === Tv.RFC1738 && (p === 40 || p === 41)) { c[c.length] = l.charAt(d); continue; } if (p < 128) { c[c.length] = sn[p]; continue; } if (p < 2048) { c[c.length] = sn[192 | p >> 6] + sn[128 | p & 63]; continue; } if (p < 55296 || p >= 57344) { c[c.length] = sn[224 | p >> 12] + sn[128 | p >> 6 & 63] + sn[128 | p & 63]; continue; } d += 1, p = 65536 + ((p & 1023) << 10 | l.charCodeAt(d) & 1023), c[c.length] = sn[240 | p >> 18] + sn[128 | p >> 12 & 63] + sn[128 | p >> 6 & 63] + sn[128 | p & 63]; } o += c.join(""); } return o; }, Pv = function(t) { for (var e = [{ obj: { o