Server IP : 103.169.32.36 / Your IP : 216.73.217.13 Web Server : Apache System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : apache ( 48) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/eset/efs/lib/webd/frontend/assets/ |
Upload File : |
| Current File : /opt/eset/efs/lib/webd/frontend/assets/vendor-a489d579.js |
function _mergeNamespaces(n2, m2) {
for (var i2 = 0; i2 < m2.length; i2++) {
const e7 = m2[i2];
if (typeof e7 !== "string" && !Array.isArray(e7)) {
for (const k2 in e7) {
if (k2 !== "default" && !(k2 in n2)) {
const d2 = Object.getOwnPropertyDescriptor(e7, k2);
if (d2) {
Object.defineProperty(n2, k2, d2.get ? d2 : {
enumerable: true,
get: () => e7[k2]
});
}
}
}
}
}
return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" }));
}
var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x2) {
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
}
function getAugmentedNamespace(n2) {
if (n2.__esModule)
return n2;
var f2 = n2.default;
if (typeof f2 == "function") {
var a2 = function a3() {
if (this instanceof a3) {
return Reflect.construct(f2, arguments, this.constructor);
}
return f2.apply(this, arguments);
};
a2.prototype = f2.prototype;
} else
a2 = {};
Object.defineProperty(a2, "__esModule", { value: true });
Object.keys(n2).forEach(function(k2) {
var d2 = Object.getOwnPropertyDescriptor(n2, k2);
Object.defineProperty(a2, k2, d2.get ? d2 : {
enumerable: true,
get: function() {
return n2[k2];
}
});
});
return a2;
}
var jsxRuntime = { exports: {} };
var reactJsxRuntime_production_min = {};
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject$5(val) {
if (val === null || val === void 0) {
throw new TypeError("Object.assign cannot be called with null or undefined");
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
var test1 = new String("abc");
test1[5] = "de";
if (Object.getOwnPropertyNames(test1)[0] === "5") {
return false;
}
var test2 = {};
for (var i2 = 0; i2 < 10; i2++) {
test2["_" + String.fromCharCode(i2)] = i2;
}
var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
return test2[n2];
});
if (order2.join("") !== "0123456789") {
return false;
}
var test3 = {};
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
return false;
}
return true;
} catch (err) {
return false;
}
}
var objectAssign = shouldUseNative() ? Object.assign : function(target2, source2) {
var from2;
var to2 = toObject$5(target2);
var symbols2;
for (var s2 = 1; s2 < arguments.length; s2++) {
from2 = Object(arguments[s2]);
for (var key2 in from2) {
if (hasOwnProperty$7.call(from2, key2)) {
to2[key2] = from2[key2];
}
}
if (getOwnPropertySymbols$1) {
symbols2 = getOwnPropertySymbols$1(from2);
for (var i2 = 0; i2 < symbols2.length; i2++) {
if (propIsEnumerable.call(from2, symbols2[i2])) {
to2[symbols2[i2]] = from2[symbols2[i2]];
}
}
}
}
return to2;
};
var react = { exports: {} };
var react_production_min = {};
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var l$6 = objectAssign, n$h = 60103, p$a = 60106;
react_production_min.Fragment = 60107;
react_production_min.StrictMode = 60108;
react_production_min.Profiler = 60114;
var q$7 = 60109, r$t = 60110, t$r = 60112;
react_production_min.Suspense = 60113;
var u$d = 60115, v$7 = 60116;
if ("function" === typeof Symbol && Symbol.for) {
var w$7 = Symbol.for;
n$h = w$7("react.element");
p$a = w$7("react.portal");
react_production_min.Fragment = w$7("react.fragment");
react_production_min.StrictMode = w$7("react.strict_mode");
react_production_min.Profiler = w$7("react.profiler");
q$7 = w$7("react.provider");
r$t = w$7("react.context");
t$r = w$7("react.forward_ref");
react_production_min.Suspense = w$7("react.suspense");
u$d = w$7("react.memo");
v$7 = w$7("react.lazy");
}
var x$9 = "function" === typeof Symbol && Symbol.iterator;
function y$c(a2) {
if (null === a2 || "object" !== typeof a2)
return null;
a2 = x$9 && a2[x$9] || a2["@@iterator"];
return "function" === typeof a2 ? a2 : null;
}
function z$6(a2) {
for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++)
b2 += "&args[]=" + encodeURIComponent(arguments[c2]);
return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}
var A$6 = { isMounted: function() {
return false;
}, enqueueForceUpdate: function() {
}, enqueueReplaceState: function() {
}, enqueueSetState: function() {
} }, B$6 = {};
function C$5(a2, b2, c2) {
this.props = a2;
this.context = b2;
this.refs = B$6;
this.updater = c2 || A$6;
}
C$5.prototype.isReactComponent = {};
C$5.prototype.setState = function(a2, b2) {
if ("object" !== typeof a2 && "function" !== typeof a2 && null != a2)
throw Error(z$6(85));
this.updater.enqueueSetState(this, a2, b2, "setState");
};
C$5.prototype.forceUpdate = function(a2) {
this.updater.enqueueForceUpdate(this, a2, "forceUpdate");
};
function D$6() {
}
D$6.prototype = C$5.prototype;
function E$6(a2, b2, c2) {
this.props = a2;
this.context = b2;
this.refs = B$6;
this.updater = c2 || A$6;
}
var F$5 = E$6.prototype = new D$6();
F$5.constructor = E$6;
l$6(F$5, C$5.prototype);
F$5.isPureReactComponent = true;
var G$4 = { current: null }, H$3 = Object.prototype.hasOwnProperty, I$4 = { key: true, ref: true, __self: true, __source: true };
function J$3(a2, b2, c2) {
var e7, d2 = {}, k2 = null, h2 = null;
if (null != b2)
for (e7 in void 0 !== b2.ref && (h2 = b2.ref), void 0 !== b2.key && (k2 = "" + b2.key), b2)
H$3.call(b2, e7) && !I$4.hasOwnProperty(e7) && (d2[e7] = b2[e7]);
var g2 = arguments.length - 2;
if (1 === g2)
d2.children = c2;
else if (1 < g2) {
for (var f2 = Array(g2), m2 = 0; m2 < g2; m2++)
f2[m2] = arguments[m2 + 2];
d2.children = f2;
}
if (a2 && a2.defaultProps)
for (e7 in g2 = a2.defaultProps, g2)
void 0 === d2[e7] && (d2[e7] = g2[e7]);
return { $$typeof: n$h, type: a2, key: k2, ref: h2, props: d2, _owner: G$4.current };
}
function K$3(a2, b2) {
return { $$typeof: n$h, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner };
}
function L$4(a2) {
return "object" === typeof a2 && null !== a2 && a2.$$typeof === n$h;
}
function escape$1(a2) {
var b2 = { "=": "=0", ":": "=2" };
return "$" + a2.replace(/[=:]/g, function(a3) {
return b2[a3];
});
}
var M$a = /\/+/g;
function N$5(a2, b2) {
return "object" === typeof a2 && null !== a2 && null != a2.key ? escape$1("" + a2.key) : b2.toString(36);
}
function O$5(a2, b2, c2, e7, d2) {
var k2 = typeof a2;
if ("undefined" === k2 || "boolean" === k2)
a2 = null;
var h2 = false;
if (null === a2)
h2 = true;
else
switch (k2) {
case "string":
case "number":
h2 = true;
break;
case "object":
switch (a2.$$typeof) {
case n$h:
case p$a:
h2 = true;
}
}
if (h2)
return h2 = a2, d2 = d2(h2), a2 = "" === e7 ? "." + N$5(h2, 0) : e7, Array.isArray(d2) ? (c2 = "", null != a2 && (c2 = a2.replace(M$a, "$&/") + "/"), O$5(d2, b2, c2, "", function(a3) {
return a3;
})) : null != d2 && (L$4(d2) && (d2 = K$3(d2, c2 + (!d2.key || h2 && h2.key === d2.key ? "" : ("" + d2.key).replace(M$a, "$&/") + "/") + a2)), b2.push(d2)), 1;
h2 = 0;
e7 = "" === e7 ? "." : e7 + ":";
if (Array.isArray(a2))
for (var g2 = 0; g2 < a2.length; g2++) {
k2 = a2[g2];
var f2 = e7 + N$5(k2, g2);
h2 += O$5(k2, b2, c2, f2, d2);
}
else if (f2 = y$c(a2), "function" === typeof f2)
for (a2 = f2.call(a2), g2 = 0; !(k2 = a2.next()).done; )
k2 = k2.value, f2 = e7 + N$5(k2, g2++), h2 += O$5(k2, b2, c2, f2, d2);
else if ("object" === k2)
throw b2 = "" + a2, Error(z$6(31, "[object Object]" === b2 ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b2));
return h2;
}
function P$4(a2, b2, c2) {
if (null == a2)
return a2;
var e7 = [], d2 = 0;
O$5(a2, e7, "", "", function(a3) {
return b2.call(c2, a3, d2++);
});
return e7;
}
function Q$2(a2) {
if (-1 === a2._status) {
var b2 = a2._result;
b2 = b2();
a2._status = 0;
a2._result = b2;
b2.then(function(b3) {
0 === a2._status && (b3 = b3.default, a2._status = 1, a2._result = b3);
}, function(b3) {
0 === a2._status && (a2._status = 2, a2._result = b3);
});
}
if (1 === a2._status)
return a2._result;
throw a2._result;
}
var R$4 = { current: null };
function S$5() {
var a2 = R$4.current;
if (null === a2)
throw Error(z$6(321));
return a2;
}
var T$6 = { ReactCurrentDispatcher: R$4, ReactCurrentBatchConfig: { transition: 0 }, ReactCurrentOwner: G$4, IsSomeRendererActing: { current: false }, assign: l$6 };
react_production_min.Children = { map: P$4, forEach: function(a2, b2, c2) {
P$4(a2, function() {
b2.apply(this, arguments);
}, c2);
}, count: function(a2) {
var b2 = 0;
P$4(a2, function() {
b2++;
});
return b2;
}, toArray: function(a2) {
return P$4(a2, function(a3) {
return a3;
}) || [];
}, only: function(a2) {
if (!L$4(a2))
throw Error(z$6(143));
return a2;
} };
react_production_min.Component = C$5;
react_production_min.PureComponent = E$6;
react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = T$6;
react_production_min.cloneElement = function(a2, b2, c2) {
if (null === a2 || void 0 === a2)
throw Error(z$6(267, a2));
var e7 = l$6({}, a2.props), d2 = a2.key, k2 = a2.ref, h2 = a2._owner;
if (null != b2) {
void 0 !== b2.ref && (k2 = b2.ref, h2 = G$4.current);
void 0 !== b2.key && (d2 = "" + b2.key);
if (a2.type && a2.type.defaultProps)
var g2 = a2.type.defaultProps;
for (f2 in b2)
H$3.call(b2, f2) && !I$4.hasOwnProperty(f2) && (e7[f2] = void 0 === b2[f2] && void 0 !== g2 ? g2[f2] : b2[f2]);
}
var f2 = arguments.length - 2;
if (1 === f2)
e7.children = c2;
else if (1 < f2) {
g2 = Array(f2);
for (var m2 = 0; m2 < f2; m2++)
g2[m2] = arguments[m2 + 2];
e7.children = g2;
}
return {
$$typeof: n$h,
type: a2.type,
key: d2,
ref: k2,
props: e7,
_owner: h2
};
};
react_production_min.createContext = function(a2, b2) {
void 0 === b2 && (b2 = null);
a2 = { $$typeof: r$t, _calculateChangedBits: b2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null };
a2.Provider = { $$typeof: q$7, _context: a2 };
return a2.Consumer = a2;
};
react_production_min.createElement = J$3;
react_production_min.createFactory = function(a2) {
var b2 = J$3.bind(null, a2);
b2.type = a2;
return b2;
};
react_production_min.createRef = function() {
return { current: null };
};
react_production_min.forwardRef = function(a2) {
return { $$typeof: t$r, render: a2 };
};
react_production_min.isValidElement = L$4;
react_production_min.lazy = function(a2) {
return { $$typeof: v$7, _payload: { _status: -1, _result: a2 }, _init: Q$2 };
};
react_production_min.memo = function(a2, b2) {
return { $$typeof: u$d, type: a2, compare: void 0 === b2 ? null : b2 };
};
react_production_min.useCallback = function(a2, b2) {
return S$5().useCallback(a2, b2);
};
react_production_min.useContext = function(a2, b2) {
return S$5().useContext(a2, b2);
};
react_production_min.useDebugValue = function() {
};
react_production_min.useEffect = function(a2, b2) {
return S$5().useEffect(a2, b2);
};
react_production_min.useImperativeHandle = function(a2, b2, c2) {
return S$5().useImperativeHandle(a2, b2, c2);
};
react_production_min.useLayoutEffect = function(a2, b2) {
return S$5().useLayoutEffect(a2, b2);
};
react_production_min.useMemo = function(a2, b2) {
return S$5().useMemo(a2, b2);
};
react_production_min.useReducer = function(a2, b2, c2) {
return S$5().useReducer(a2, b2, c2);
};
react_production_min.useRef = function(a2) {
return S$5().useRef(a2);
};
react_production_min.useState = function(a2) {
return S$5().useState(a2);
};
react_production_min.version = "17.0.2";
{
react.exports = react_production_min;
}
var reactExports = react.exports;
const React = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
const React$1 = /* @__PURE__ */ _mergeNamespaces({
__proto__: null,
default: React
}, [reactExports]);
/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var f$7 = reactExports, g$4 = 60103;
reactJsxRuntime_production_min.Fragment = 60107;
if ("function" === typeof Symbol && Symbol.for) {
var h$c = Symbol.for;
g$4 = h$c("react.element");
reactJsxRuntime_production_min.Fragment = h$c("react.fragment");
}
var m$p = f$7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n$g = Object.prototype.hasOwnProperty, p$9 = { key: true, ref: true, __self: true, __source: true };
function q$6(c2, a2, k2) {
var b2, d2 = {}, e7 = null, l2 = null;
void 0 !== k2 && (e7 = "" + k2);
void 0 !== a2.key && (e7 = "" + a2.key);
void 0 !== a2.ref && (l2 = a2.ref);
for (b2 in a2)
n$g.call(a2, b2) && !p$9.hasOwnProperty(b2) && (d2[b2] = a2[b2]);
if (c2 && c2.defaultProps)
for (b2 in a2 = c2.defaultProps, a2)
void 0 === d2[b2] && (d2[b2] = a2[b2]);
return { $$typeof: g$4, type: c2, key: e7, ref: l2, props: d2, _owner: m$p.current };
}
reactJsxRuntime_production_min.jsx = q$6;
reactJsxRuntime_production_min.jsxs = q$6;
{
jsxRuntime.exports = reactJsxRuntime_production_min;
}
var jsxRuntimeExports = jsxRuntime.exports;
var reactDom = { exports: {} };
var reactDom_production_min = {};
var scheduler = { exports: {} };
var scheduler_production_min = {};
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(function(exports) {
var f2, g2, h2, k2;
if ("object" === typeof performance && "function" === typeof performance.now) {
var l2 = performance;
exports.unstable_now = function() {
return l2.now();
};
} else {
var p2 = Date, q2 = p2.now();
exports.unstable_now = function() {
return p2.now() - q2;
};
}
if ("undefined" === typeof window || "function" !== typeof MessageChannel) {
var t5 = null, u2 = null, w2 = function() {
if (null !== t5)
try {
var a2 = exports.unstable_now();
t5(true, a2);
t5 = null;
} catch (b2) {
throw setTimeout(w2, 0), b2;
}
};
f2 = function(a2) {
null !== t5 ? setTimeout(f2, 0, a2) : (t5 = a2, setTimeout(w2, 0));
};
g2 = function(a2, b2) {
u2 = setTimeout(a2, b2);
};
h2 = function() {
clearTimeout(u2);
};
exports.unstable_shouldYield = function() {
return false;
};
k2 = exports.unstable_forceFrameRate = function() {
};
} else {
var x2 = window.setTimeout, y2 = window.clearTimeout;
if ("undefined" !== typeof console) {
var z2 = window.cancelAnimationFrame;
"function" !== typeof window.requestAnimationFrame && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
"function" !== typeof z2 && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
}
var A5 = false, B3 = null, C3 = -1, D2 = 5, E2 = 0;
exports.unstable_shouldYield = function() {
return exports.unstable_now() >= E2;
};
k2 = function() {
};
exports.unstable_forceFrameRate = function(a2) {
0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : D2 = 0 < a2 ? Math.floor(1e3 / a2) : 5;
};
var F2 = new MessageChannel(), G2 = F2.port2;
F2.port1.onmessage = function() {
if (null !== B3) {
var a2 = exports.unstable_now();
E2 = a2 + D2;
try {
B3(true, a2) ? G2.postMessage(null) : (A5 = false, B3 = null);
} catch (b2) {
throw G2.postMessage(null), b2;
}
} else
A5 = false;
};
f2 = function(a2) {
B3 = a2;
A5 || (A5 = true, G2.postMessage(null));
};
g2 = function(a2, b2) {
C3 = x2(function() {
a2(exports.unstable_now());
}, b2);
};
h2 = function() {
y2(C3);
C3 = -1;
};
}
function H4(a2, b2) {
var c2 = a2.length;
a2.push(b2);
a:
for (; ; ) {
var d2 = c2 - 1 >>> 1, e7 = a2[d2];
if (void 0 !== e7 && 0 < I2(e7, b2))
a2[d2] = b2, a2[c2] = e7, c2 = d2;
else
break a;
}
}
function J2(a2) {
a2 = a2[0];
return void 0 === a2 ? null : a2;
}
function K2(a2) {
var b2 = a2[0];
if (void 0 !== b2) {
var c2 = a2.pop();
if (c2 !== b2) {
a2[0] = c2;
a:
for (var d2 = 0, e7 = a2.length; d2 < e7; ) {
var m2 = 2 * (d2 + 1) - 1, n2 = a2[m2], v2 = m2 + 1, r2 = a2[v2];
if (void 0 !== n2 && 0 > I2(n2, c2))
void 0 !== r2 && 0 > I2(r2, n2) ? (a2[d2] = r2, a2[v2] = c2, d2 = v2) : (a2[d2] = n2, a2[m2] = c2, d2 = m2);
else if (void 0 !== r2 && 0 > I2(r2, c2))
a2[d2] = r2, a2[v2] = c2, d2 = v2;
else
break a;
}
}
return b2;
}
return null;
}
function I2(a2, b2) {
var c2 = a2.sortIndex - b2.sortIndex;
return 0 !== c2 ? c2 : a2.id - b2.id;
}
var L2 = [], M2 = [], N2 = 1, O2 = null, P2 = 3, Q2 = false, R2 = false, S2 = false;
function T2(a2) {
for (var b2 = J2(M2); null !== b2; ) {
if (null === b2.callback)
K2(M2);
else if (b2.startTime <= a2)
K2(M2), b2.sortIndex = b2.expirationTime, H4(L2, b2);
else
break;
b2 = J2(M2);
}
}
function U2(a2) {
S2 = false;
T2(a2);
if (!R2)
if (null !== J2(L2))
R2 = true, f2(V2);
else {
var b2 = J2(M2);
null !== b2 && g2(U2, b2.startTime - a2);
}
}
function V2(a2, b2) {
R2 = false;
S2 && (S2 = false, h2());
Q2 = true;
var c2 = P2;
try {
T2(b2);
for (O2 = J2(L2); null !== O2 && (!(O2.expirationTime > b2) || a2 && !exports.unstable_shouldYield()); ) {
var d2 = O2.callback;
if ("function" === typeof d2) {
O2.callback = null;
P2 = O2.priorityLevel;
var e7 = d2(O2.expirationTime <= b2);
b2 = exports.unstable_now();
"function" === typeof e7 ? O2.callback = e7 : O2 === J2(L2) && K2(L2);
T2(b2);
} else
K2(L2);
O2 = J2(L2);
}
if (null !== O2)
var m2 = true;
else {
var n2 = J2(M2);
null !== n2 && g2(U2, n2.startTime - b2);
m2 = false;
}
return m2;
} finally {
O2 = null, P2 = c2, Q2 = false;
}
}
var W2 = k2;
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_cancelCallback = function(a2) {
a2.callback = null;
};
exports.unstable_continueExecution = function() {
R2 || Q2 || (R2 = true, f2(V2));
};
exports.unstable_getCurrentPriorityLevel = function() {
return P2;
};
exports.unstable_getFirstCallbackNode = function() {
return J2(L2);
};
exports.unstable_next = function(a2) {
switch (P2) {
case 1:
case 2:
case 3:
var b2 = 3;
break;
default:
b2 = P2;
}
var c2 = P2;
P2 = b2;
try {
return a2();
} finally {
P2 = c2;
}
};
exports.unstable_pauseExecution = function() {
};
exports.unstable_requestPaint = W2;
exports.unstable_runWithPriority = function(a2, b2) {
switch (a2) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
a2 = 3;
}
var c2 = P2;
P2 = a2;
try {
return b2();
} finally {
P2 = c2;
}
};
exports.unstable_scheduleCallback = function(a2, b2, c2) {
var d2 = exports.unstable_now();
"object" === typeof c2 && null !== c2 ? (c2 = c2.delay, c2 = "number" === typeof c2 && 0 < c2 ? d2 + c2 : d2) : c2 = d2;
switch (a2) {
case 1:
var e7 = -1;
break;
case 2:
e7 = 250;
break;
case 5:
e7 = 1073741823;
break;
case 4:
e7 = 1e4;
break;
default:
e7 = 5e3;
}
e7 = c2 + e7;
a2 = { id: N2++, callback: b2, priorityLevel: a2, startTime: c2, expirationTime: e7, sortIndex: -1 };
c2 > d2 ? (a2.sortIndex = c2, H4(M2, a2), null === J2(L2) && a2 === J2(M2) && (S2 ? h2() : S2 = true, g2(U2, c2 - d2))) : (a2.sortIndex = e7, H4(L2, a2), R2 || Q2 || (R2 = true, f2(V2)));
return a2;
};
exports.unstable_wrapCallback = function(a2) {
var b2 = P2;
return function() {
var c2 = P2;
P2 = b2;
try {
return a2.apply(this, arguments);
} finally {
P2 = c2;
}
};
};
})(scheduler_production_min);
{
scheduler.exports = scheduler_production_min;
}
var schedulerExports = scheduler.exports;
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var aa$1 = reactExports, m$o = objectAssign, r$s = schedulerExports;
function y$b(a2) {
for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++)
b2 += "&args[]=" + encodeURIComponent(arguments[c2]);
return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}
if (!aa$1)
throw Error(y$b(227));
var ba$1 = /* @__PURE__ */ new Set(), ca$1 = {};
function da$1(a2, b2) {
ea$2(a2, b2);
ea$2(a2 + "Capture", b2);
}
function ea$2(a2, b2) {
ca$1[a2] = b2;
for (a2 = 0; a2 < b2.length; a2++)
ba$1.add(b2[a2]);
}
var fa$1 = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), ha$1 = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, ia$1 = Object.prototype.hasOwnProperty, ja$2 = {}, ka$1 = {};
function la$1(a2) {
if (ia$1.call(ka$1, a2))
return true;
if (ia$1.call(ja$2, a2))
return false;
if (ha$1.test(a2))
return ka$1[a2] = true;
ja$2[a2] = true;
return false;
}
function ma$2(a2, b2, c2, d2) {
if (null !== c2 && 0 === c2.type)
return false;
switch (typeof b2) {
case "function":
case "symbol":
return true;
case "boolean":
if (d2)
return false;
if (null !== c2)
return !c2.acceptsBooleans;
a2 = a2.toLowerCase().slice(0, 5);
return "data-" !== a2 && "aria-" !== a2;
default:
return false;
}
}
function na$1(a2, b2, c2, d2) {
if (null === b2 || "undefined" === typeof b2 || ma$2(a2, b2, c2, d2))
return true;
if (d2)
return false;
if (null !== c2)
switch (c2.type) {
case 3:
return !b2;
case 4:
return false === b2;
case 5:
return isNaN(b2);
case 6:
return isNaN(b2) || 1 > b2;
}
return false;
}
function B$5(a2, b2, c2, d2, e7, f2, g2) {
this.acceptsBooleans = 2 === b2 || 3 === b2 || 4 === b2;
this.attributeName = d2;
this.attributeNamespace = e7;
this.mustUseProperty = c2;
this.propertyName = a2;
this.type = b2;
this.sanitizeURL = f2;
this.removeEmptyString = g2;
}
var D$5 = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a2) {
D$5[a2] = new B$5(a2, 0, false, a2, null, false, false);
});
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a2) {
var b2 = a2[0];
D$5[b2] = new B$5(b2, 1, false, a2[1], null, false, false);
});
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 2, false, a2.toLowerCase(), null, false, false);
});
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 2, false, a2, null, false, false);
});
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a2) {
D$5[a2] = new B$5(a2, 3, false, a2.toLowerCase(), null, false, false);
});
["checked", "multiple", "muted", "selected"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 3, true, a2, null, false, false);
});
["capture", "download"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 4, false, a2, null, false, false);
});
["cols", "rows", "size", "span"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 6, false, a2, null, false, false);
});
["rowSpan", "start"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 5, false, a2.toLowerCase(), null, false, false);
});
var oa$1 = /[\-:]([a-z])/g;
function pa$2(a2) {
return a2[1].toUpperCase();
}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a2) {
var b2 = a2.replace(
oa$1,
pa$2
);
D$5[b2] = new B$5(b2, 1, false, a2, null, false, false);
});
"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a2) {
var b2 = a2.replace(oa$1, pa$2);
D$5[b2] = new B$5(b2, 1, false, a2, "http://www.w3.org/1999/xlink", false, false);
});
["xml:base", "xml:lang", "xml:space"].forEach(function(a2) {
var b2 = a2.replace(oa$1, pa$2);
D$5[b2] = new B$5(b2, 1, false, a2, "http://www.w3.org/XML/1998/namespace", false, false);
});
["tabIndex", "crossOrigin"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 1, false, a2.toLowerCase(), null, false, false);
});
D$5.xlinkHref = new B$5("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false);
["src", "href", "action", "formAction"].forEach(function(a2) {
D$5[a2] = new B$5(a2, 1, false, a2.toLowerCase(), null, true, true);
});
function qa$1(a2, b2, c2, d2) {
var e7 = D$5.hasOwnProperty(b2) ? D$5[b2] : null;
var f2 = null !== e7 ? 0 === e7.type : d2 ? false : !(2 < b2.length) || "o" !== b2[0] && "O" !== b2[0] || "n" !== b2[1] && "N" !== b2[1] ? false : true;
f2 || (na$1(b2, c2, e7, d2) && (c2 = null), d2 || null === e7 ? la$1(b2) && (null === c2 ? a2.removeAttribute(b2) : a2.setAttribute(b2, "" + c2)) : e7.mustUseProperty ? a2[e7.propertyName] = null === c2 ? 3 === e7.type ? false : "" : c2 : (b2 = e7.attributeName, d2 = e7.attributeNamespace, null === c2 ? a2.removeAttribute(b2) : (e7 = e7.type, c2 = 3 === e7 || 4 === e7 && true === c2 ? "" : "" + c2, d2 ? a2.setAttributeNS(d2, b2, c2) : a2.setAttribute(b2, c2))));
}
var ra$1 = aa$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, sa$2 = 60103, ta$1 = 60106, ua$1 = 60107, wa$1 = 60108, xa$1 = 60114, ya$1 = 60109, za$1 = 60110, Aa$1 = 60112, Ba$1 = 60113, Ca$1 = 60120, Da$1 = 60115, Ea$1 = 60116, Fa$1 = 60121, Ga$1 = 60128, Ha$1 = 60129, Ia$1 = 60130, Ja$1 = 60131;
if ("function" === typeof Symbol && Symbol.for) {
var E$5 = Symbol.for;
sa$2 = E$5("react.element");
ta$1 = E$5("react.portal");
ua$1 = E$5("react.fragment");
wa$1 = E$5("react.strict_mode");
xa$1 = E$5("react.profiler");
ya$1 = E$5("react.provider");
za$1 = E$5("react.context");
Aa$1 = E$5("react.forward_ref");
Ba$1 = E$5("react.suspense");
Ca$1 = E$5("react.suspense_list");
Da$1 = E$5("react.memo");
Ea$1 = E$5("react.lazy");
Fa$1 = E$5("react.block");
E$5("react.scope");
Ga$1 = E$5("react.opaque.id");
Ha$1 = E$5("react.debug_trace_mode");
Ia$1 = E$5("react.offscreen");
Ja$1 = E$5("react.legacy_hidden");
}
var Ka$1 = "function" === typeof Symbol && Symbol.iterator;
function La$1(a2) {
if (null === a2 || "object" !== typeof a2)
return null;
a2 = Ka$1 && a2[Ka$1] || a2["@@iterator"];
return "function" === typeof a2 ? a2 : null;
}
var Ma$1;
function Na$1(a2) {
if (void 0 === Ma$1)
try {
throw Error();
} catch (c2) {
var b2 = c2.stack.trim().match(/\n( *(at )?)/);
Ma$1 = b2 && b2[1] || "";
}
return "\n" + Ma$1 + a2;
}
var Oa$1 = false;
function Pa$1(a2, b2) {
if (!a2 || Oa$1)
return "";
Oa$1 = true;
var c2 = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
try {
if (b2)
if (b2 = function() {
throw Error();
}, Object.defineProperty(b2.prototype, "props", { set: function() {
throw Error();
} }), "object" === typeof Reflect && Reflect.construct) {
try {
Reflect.construct(b2, []);
} catch (k2) {
var d2 = k2;
}
Reflect.construct(a2, [], b2);
} else {
try {
b2.call();
} catch (k2) {
d2 = k2;
}
a2.call(b2.prototype);
}
else {
try {
throw Error();
} catch (k2) {
d2 = k2;
}
a2();
}
} catch (k2) {
if (k2 && d2 && "string" === typeof k2.stack) {
for (var e7 = k2.stack.split("\n"), f2 = d2.stack.split("\n"), g2 = e7.length - 1, h2 = f2.length - 1; 1 <= g2 && 0 <= h2 && e7[g2] !== f2[h2]; )
h2--;
for (; 1 <= g2 && 0 <= h2; g2--, h2--)
if (e7[g2] !== f2[h2]) {
if (1 !== g2 || 1 !== h2) {
do
if (g2--, h2--, 0 > h2 || e7[g2] !== f2[h2])
return "\n" + e7[g2].replace(" at new ", " at ");
while (1 <= g2 && 0 <= h2);
}
break;
}
}
} finally {
Oa$1 = false, Error.prepareStackTrace = c2;
}
return (a2 = a2 ? a2.displayName || a2.name : "") ? Na$1(a2) : "";
}
function Qa$1(a2) {
switch (a2.tag) {
case 5:
return Na$1(a2.type);
case 16:
return Na$1("Lazy");
case 13:
return Na$1("Suspense");
case 19:
return Na$1("SuspenseList");
case 0:
case 2:
case 15:
return a2 = Pa$1(a2.type, false), a2;
case 11:
return a2 = Pa$1(a2.type.render, false), a2;
case 22:
return a2 = Pa$1(a2.type._render, false), a2;
case 1:
return a2 = Pa$1(a2.type, true), a2;
default:
return "";
}
}
function Ra$1(a2) {
if (null == a2)
return null;
if ("function" === typeof a2)
return a2.displayName || a2.name || null;
if ("string" === typeof a2)
return a2;
switch (a2) {
case ua$1:
return "Fragment";
case ta$1:
return "Portal";
case xa$1:
return "Profiler";
case wa$1:
return "StrictMode";
case Ba$1:
return "Suspense";
case Ca$1:
return "SuspenseList";
}
if ("object" === typeof a2)
switch (a2.$$typeof) {
case za$1:
return (a2.displayName || "Context") + ".Consumer";
case ya$1:
return (a2._context.displayName || "Context") + ".Provider";
case Aa$1:
var b2 = a2.render;
b2 = b2.displayName || b2.name || "";
return a2.displayName || ("" !== b2 ? "ForwardRef(" + b2 + ")" : "ForwardRef");
case Da$1:
return Ra$1(a2.type);
case Fa$1:
return Ra$1(a2._render);
case Ea$1:
b2 = a2._payload;
a2 = a2._init;
try {
return Ra$1(a2(b2));
} catch (c2) {
}
}
return null;
}
function Sa$1(a2) {
switch (typeof a2) {
case "boolean":
case "number":
case "object":
case "string":
case "undefined":
return a2;
default:
return "";
}
}
function Ta$1(a2) {
var b2 = a2.type;
return (a2 = a2.nodeName) && "input" === a2.toLowerCase() && ("checkbox" === b2 || "radio" === b2);
}
function Ua$1(a2) {
var b2 = Ta$1(a2) ? "checked" : "value", c2 = Object.getOwnPropertyDescriptor(a2.constructor.prototype, b2), d2 = "" + a2[b2];
if (!a2.hasOwnProperty(b2) && "undefined" !== typeof c2 && "function" === typeof c2.get && "function" === typeof c2.set) {
var e7 = c2.get, f2 = c2.set;
Object.defineProperty(a2, b2, { configurable: true, get: function() {
return e7.call(this);
}, set: function(a3) {
d2 = "" + a3;
f2.call(this, a3);
} });
Object.defineProperty(a2, b2, { enumerable: c2.enumerable });
return { getValue: function() {
return d2;
}, setValue: function(a3) {
d2 = "" + a3;
}, stopTracking: function() {
a2._valueTracker = null;
delete a2[b2];
} };
}
}
function Va$1(a2) {
a2._valueTracker || (a2._valueTracker = Ua$1(a2));
}
function Wa$1(a2) {
if (!a2)
return false;
var b2 = a2._valueTracker;
if (!b2)
return true;
var c2 = b2.getValue();
var d2 = "";
a2 && (d2 = Ta$1(a2) ? a2.checked ? "true" : "false" : a2.value);
a2 = d2;
return a2 !== c2 ? (b2.setValue(a2), true) : false;
}
function Xa$1(a2) {
a2 = a2 || ("undefined" !== typeof document ? document : void 0);
if ("undefined" === typeof a2)
return null;
try {
return a2.activeElement || a2.body;
} catch (b2) {
return a2.body;
}
}
function Ya$1(a2, b2) {
var c2 = b2.checked;
return m$o({}, b2, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c2 ? c2 : a2._wrapperState.initialChecked });
}
function Za$1(a2, b2) {
var c2 = null == b2.defaultValue ? "" : b2.defaultValue, d2 = null != b2.checked ? b2.checked : b2.defaultChecked;
c2 = Sa$1(null != b2.value ? b2.value : c2);
a2._wrapperState = { initialChecked: d2, initialValue: c2, controlled: "checkbox" === b2.type || "radio" === b2.type ? null != b2.checked : null != b2.value };
}
function $a$1(a2, b2) {
b2 = b2.checked;
null != b2 && qa$1(a2, "checked", b2, false);
}
function ab(a2, b2) {
$a$1(a2, b2);
var c2 = Sa$1(b2.value), d2 = b2.type;
if (null != c2)
if ("number" === d2) {
if (0 === c2 && "" === a2.value || a2.value != c2)
a2.value = "" + c2;
} else
a2.value !== "" + c2 && (a2.value = "" + c2);
else if ("submit" === d2 || "reset" === d2) {
a2.removeAttribute("value");
return;
}
b2.hasOwnProperty("value") ? bb(a2, b2.type, c2) : b2.hasOwnProperty("defaultValue") && bb(a2, b2.type, Sa$1(b2.defaultValue));
null == b2.checked && null != b2.defaultChecked && (a2.defaultChecked = !!b2.defaultChecked);
}
function cb(a2, b2, c2) {
if (b2.hasOwnProperty("value") || b2.hasOwnProperty("defaultValue")) {
var d2 = b2.type;
if (!("submit" !== d2 && "reset" !== d2 || void 0 !== b2.value && null !== b2.value))
return;
b2 = "" + a2._wrapperState.initialValue;
c2 || b2 === a2.value || (a2.value = b2);
a2.defaultValue = b2;
}
c2 = a2.name;
"" !== c2 && (a2.name = "");
a2.defaultChecked = !!a2._wrapperState.initialChecked;
"" !== c2 && (a2.name = c2);
}
function bb(a2, b2, c2) {
if ("number" !== b2 || Xa$1(a2.ownerDocument) !== a2)
null == c2 ? a2.defaultValue = "" + a2._wrapperState.initialValue : a2.defaultValue !== "" + c2 && (a2.defaultValue = "" + c2);
}
function db(a2) {
var b2 = "";
aa$1.Children.forEach(a2, function(a3) {
null != a3 && (b2 += a3);
});
return b2;
}
function eb(a2, b2) {
a2 = m$o({ children: void 0 }, b2);
if (b2 = db(b2.children))
a2.children = b2;
return a2;
}
function fb(a2, b2, c2, d2) {
a2 = a2.options;
if (b2) {
b2 = {};
for (var e7 = 0; e7 < c2.length; e7++)
b2["$" + c2[e7]] = true;
for (c2 = 0; c2 < a2.length; c2++)
e7 = b2.hasOwnProperty("$" + a2[c2].value), a2[c2].selected !== e7 && (a2[c2].selected = e7), e7 && d2 && (a2[c2].defaultSelected = true);
} else {
c2 = "" + Sa$1(c2);
b2 = null;
for (e7 = 0; e7 < a2.length; e7++) {
if (a2[e7].value === c2) {
a2[e7].selected = true;
d2 && (a2[e7].defaultSelected = true);
return;
}
null !== b2 || a2[e7].disabled || (b2 = a2[e7]);
}
null !== b2 && (b2.selected = true);
}
}
function gb(a2, b2) {
if (null != b2.dangerouslySetInnerHTML)
throw Error(y$b(91));
return m$o({}, b2, { value: void 0, defaultValue: void 0, children: "" + a2._wrapperState.initialValue });
}
function hb(a2, b2) {
var c2 = b2.value;
if (null == c2) {
c2 = b2.children;
b2 = b2.defaultValue;
if (null != c2) {
if (null != b2)
throw Error(y$b(92));
if (Array.isArray(c2)) {
if (!(1 >= c2.length))
throw Error(y$b(93));
c2 = c2[0];
}
b2 = c2;
}
null == b2 && (b2 = "");
c2 = b2;
}
a2._wrapperState = { initialValue: Sa$1(c2) };
}
function ib(a2, b2) {
var c2 = Sa$1(b2.value), d2 = Sa$1(b2.defaultValue);
null != c2 && (c2 = "" + c2, c2 !== a2.value && (a2.value = c2), null == b2.defaultValue && a2.defaultValue !== c2 && (a2.defaultValue = c2));
null != d2 && (a2.defaultValue = "" + d2);
}
function jb(a2) {
var b2 = a2.textContent;
b2 === a2._wrapperState.initialValue && "" !== b2 && null !== b2 && (a2.value = b2);
}
var kb = { html: "http://www.w3.org/1999/xhtml", mathml: "http://www.w3.org/1998/Math/MathML", svg: "http://www.w3.org/2000/svg" };
function lb(a2) {
switch (a2) {
case "svg":
return "http://www.w3.org/2000/svg";
case "math":
return "http://www.w3.org/1998/Math/MathML";
default:
return "http://www.w3.org/1999/xhtml";
}
}
function mb$1(a2, b2) {
return null == a2 || "http://www.w3.org/1999/xhtml" === a2 ? lb(b2) : "http://www.w3.org/2000/svg" === a2 && "foreignObject" === b2 ? "http://www.w3.org/1999/xhtml" : a2;
}
var nb, ob = function(a2) {
return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b2, c2, d2, e7) {
MSApp.execUnsafeLocalFunction(function() {
return a2(b2, c2, d2, e7);
});
} : a2;
}(function(a2, b2) {
if (a2.namespaceURI !== kb.svg || "innerHTML" in a2)
a2.innerHTML = b2;
else {
nb = nb || document.createElement("div");
nb.innerHTML = "<svg>" + b2.valueOf().toString() + "</svg>";
for (b2 = nb.firstChild; a2.firstChild; )
a2.removeChild(a2.firstChild);
for (; b2.firstChild; )
a2.appendChild(b2.firstChild);
}
});
function pb(a2, b2) {
if (b2) {
var c2 = a2.firstChild;
if (c2 && c2 === a2.lastChild && 3 === c2.nodeType) {
c2.nodeValue = b2;
return;
}
}
a2.textContent = b2;
}
var qb = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
columns: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridArea: true,
gridRow: true,
gridRowEnd: true,
gridRowSpan: true,
gridRowStart: true,
gridColumn: true,
gridColumnEnd: true,
gridColumnSpan: true,
gridColumnStart: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
}, rb = ["Webkit", "ms", "Moz", "O"];
Object.keys(qb).forEach(function(a2) {
rb.forEach(function(b2) {
b2 = b2 + a2.charAt(0).toUpperCase() + a2.substring(1);
qb[b2] = qb[a2];
});
});
function sb(a2, b2, c2) {
return null == b2 || "boolean" === typeof b2 || "" === b2 ? "" : c2 || "number" !== typeof b2 || 0 === b2 || qb.hasOwnProperty(a2) && qb[a2] ? ("" + b2).trim() : b2 + "px";
}
function tb(a2, b2) {
a2 = a2.style;
for (var c2 in b2)
if (b2.hasOwnProperty(c2)) {
var d2 = 0 === c2.indexOf("--"), e7 = sb(c2, b2[c2], d2);
"float" === c2 && (c2 = "cssFloat");
d2 ? a2.setProperty(c2, e7) : a2[c2] = e7;
}
}
var ub = m$o({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true });
function vb(a2, b2) {
if (b2) {
if (ub[a2] && (null != b2.children || null != b2.dangerouslySetInnerHTML))
throw Error(y$b(137, a2));
if (null != b2.dangerouslySetInnerHTML) {
if (null != b2.children)
throw Error(y$b(60));
if (!("object" === typeof b2.dangerouslySetInnerHTML && "__html" in b2.dangerouslySetInnerHTML))
throw Error(y$b(61));
}
if (null != b2.style && "object" !== typeof b2.style)
throw Error(y$b(62));
}
}
function wb(a2, b2) {
if (-1 === a2.indexOf("-"))
return "string" === typeof b2.is;
switch (a2) {
case "annotation-xml":
case "color-profile":
case "font-face":
case "font-face-src":
case "font-face-uri":
case "font-face-format":
case "font-face-name":
case "missing-glyph":
return false;
default:
return true;
}
}
function xb(a2) {
a2 = a2.target || a2.srcElement || window;
a2.correspondingUseElement && (a2 = a2.correspondingUseElement);
return 3 === a2.nodeType ? a2.parentNode : a2;
}
var yb = null, zb = null, Ab = null;
function Bb(a2) {
if (a2 = Cb(a2)) {
if ("function" !== typeof yb)
throw Error(y$b(280));
var b2 = a2.stateNode;
b2 && (b2 = Db(b2), yb(a2.stateNode, a2.type, b2));
}
}
function Eb(a2) {
zb ? Ab ? Ab.push(a2) : Ab = [a2] : zb = a2;
}
function Fb() {
if (zb) {
var a2 = zb, b2 = Ab;
Ab = zb = null;
Bb(a2);
if (b2)
for (a2 = 0; a2 < b2.length; a2++)
Bb(b2[a2]);
}
}
function Gb(a2, b2) {
return a2(b2);
}
function Hb(a2, b2, c2, d2, e7) {
return a2(b2, c2, d2, e7);
}
function Ib() {
}
var Jb = Gb, Kb = false, Lb = false;
function Mb() {
if (null !== zb || null !== Ab)
Ib(), Fb();
}
function Nb(a2, b2, c2) {
if (Lb)
return a2(b2, c2);
Lb = true;
try {
return Jb(a2, b2, c2);
} finally {
Lb = false, Mb();
}
}
function Ob(a2, b2) {
var c2 = a2.stateNode;
if (null === c2)
return null;
var d2 = Db(c2);
if (null === d2)
return null;
c2 = d2[b2];
a:
switch (b2) {
case "onClick":
case "onClickCapture":
case "onDoubleClick":
case "onDoubleClickCapture":
case "onMouseDown":
case "onMouseDownCapture":
case "onMouseMove":
case "onMouseMoveCapture":
case "onMouseUp":
case "onMouseUpCapture":
case "onMouseEnter":
(d2 = !d2.disabled) || (a2 = a2.type, d2 = !("button" === a2 || "input" === a2 || "select" === a2 || "textarea" === a2));
a2 = !d2;
break a;
default:
a2 = false;
}
if (a2)
return null;
if (c2 && "function" !== typeof c2)
throw Error(y$b(231, b2, typeof c2));
return c2;
}
var Pb = false;
if (fa$1)
try {
var Qb = {};
Object.defineProperty(Qb, "passive", { get: function() {
Pb = true;
} });
window.addEventListener("test", Qb, Qb);
window.removeEventListener("test", Qb, Qb);
} catch (a2) {
Pb = false;
}
function Rb(a2, b2, c2, d2, e7, f2, g2, h2, k2) {
var l2 = Array.prototype.slice.call(arguments, 3);
try {
b2.apply(c2, l2);
} catch (n2) {
this.onError(n2);
}
}
var Sb = false, Tb = null, Ub = false, Vb = null, Wb = { onError: function(a2) {
Sb = true;
Tb = a2;
} };
function Xb(a2, b2, c2, d2, e7, f2, g2, h2, k2) {
Sb = false;
Tb = null;
Rb.apply(Wb, arguments);
}
function Yb(a2, b2, c2, d2, e7, f2, g2, h2, k2) {
Xb.apply(this, arguments);
if (Sb) {
if (Sb) {
var l2 = Tb;
Sb = false;
Tb = null;
} else
throw Error(y$b(198));
Ub || (Ub = true, Vb = l2);
}
}
function Zb(a2) {
var b2 = a2, c2 = a2;
if (a2.alternate)
for (; b2.return; )
b2 = b2.return;
else {
a2 = b2;
do
b2 = a2, 0 !== (b2.flags & 1026) && (c2 = b2.return), a2 = b2.return;
while (a2);
}
return 3 === b2.tag ? c2 : null;
}
function $b(a2) {
if (13 === a2.tag) {
var b2 = a2.memoizedState;
null === b2 && (a2 = a2.alternate, null !== a2 && (b2 = a2.memoizedState));
if (null !== b2)
return b2.dehydrated;
}
return null;
}
function ac$1(a2) {
if (Zb(a2) !== a2)
throw Error(y$b(188));
}
function bc$1(a2) {
var b2 = a2.alternate;
if (!b2) {
b2 = Zb(a2);
if (null === b2)
throw Error(y$b(188));
return b2 !== a2 ? null : a2;
}
for (var c2 = a2, d2 = b2; ; ) {
var e7 = c2.return;
if (null === e7)
break;
var f2 = e7.alternate;
if (null === f2) {
d2 = e7.return;
if (null !== d2) {
c2 = d2;
continue;
}
break;
}
if (e7.child === f2.child) {
for (f2 = e7.child; f2; ) {
if (f2 === c2)
return ac$1(e7), a2;
if (f2 === d2)
return ac$1(e7), b2;
f2 = f2.sibling;
}
throw Error(y$b(188));
}
if (c2.return !== d2.return)
c2 = e7, d2 = f2;
else {
for (var g2 = false, h2 = e7.child; h2; ) {
if (h2 === c2) {
g2 = true;
c2 = e7;
d2 = f2;
break;
}
if (h2 === d2) {
g2 = true;
d2 = e7;
c2 = f2;
break;
}
h2 = h2.sibling;
}
if (!g2) {
for (h2 = f2.child; h2; ) {
if (h2 === c2) {
g2 = true;
c2 = f2;
d2 = e7;
break;
}
if (h2 === d2) {
g2 = true;
d2 = f2;
c2 = e7;
break;
}
h2 = h2.sibling;
}
if (!g2)
throw Error(y$b(189));
}
}
if (c2.alternate !== d2)
throw Error(y$b(190));
}
if (3 !== c2.tag)
throw Error(y$b(188));
return c2.stateNode.current === c2 ? a2 : b2;
}
function cc$1(a2) {
a2 = bc$1(a2);
if (!a2)
return null;
for (var b2 = a2; ; ) {
if (5 === b2.tag || 6 === b2.tag)
return b2;
if (b2.child)
b2.child.return = b2, b2 = b2.child;
else {
if (b2 === a2)
break;
for (; !b2.sibling; ) {
if (!b2.return || b2.return === a2)
return null;
b2 = b2.return;
}
b2.sibling.return = b2.return;
b2 = b2.sibling;
}
}
return null;
}
function dc$1(a2, b2) {
for (var c2 = a2.alternate; null !== b2; ) {
if (b2 === a2 || b2 === c2)
return true;
b2 = b2.return;
}
return false;
}
var ec$1, fc$1, gc$1, hc$1, ic$1 = false, jc$1 = [], kc$1 = null, lc$2 = null, mc$2 = null, nc$1 = /* @__PURE__ */ new Map(), oc$1 = /* @__PURE__ */ new Map(), pc$1 = [], qc$1 = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
function rc$1(a2, b2, c2, d2, e7) {
return { blockedOn: a2, domEventName: b2, eventSystemFlags: c2 | 16, nativeEvent: e7, targetContainers: [d2] };
}
function sc$1(a2, b2) {
switch (a2) {
case "focusin":
case "focusout":
kc$1 = null;
break;
case "dragenter":
case "dragleave":
lc$2 = null;
break;
case "mouseover":
case "mouseout":
mc$2 = null;
break;
case "pointerover":
case "pointerout":
nc$1.delete(b2.pointerId);
break;
case "gotpointercapture":
case "lostpointercapture":
oc$1.delete(b2.pointerId);
}
}
function tc$1(a2, b2, c2, d2, e7, f2) {
if (null === a2 || a2.nativeEvent !== f2)
return a2 = rc$1(b2, c2, d2, e7, f2), null !== b2 && (b2 = Cb(b2), null !== b2 && fc$1(b2)), a2;
a2.eventSystemFlags |= d2;
b2 = a2.targetContainers;
null !== e7 && -1 === b2.indexOf(e7) && b2.push(e7);
return a2;
}
function uc$1(a2, b2, c2, d2, e7) {
switch (b2) {
case "focusin":
return kc$1 = tc$1(kc$1, a2, b2, c2, d2, e7), true;
case "dragenter":
return lc$2 = tc$1(lc$2, a2, b2, c2, d2, e7), true;
case "mouseover":
return mc$2 = tc$1(mc$2, a2, b2, c2, d2, e7), true;
case "pointerover":
var f2 = e7.pointerId;
nc$1.set(f2, tc$1(nc$1.get(f2) || null, a2, b2, c2, d2, e7));
return true;
case "gotpointercapture":
return f2 = e7.pointerId, oc$1.set(f2, tc$1(oc$1.get(f2) || null, a2, b2, c2, d2, e7)), true;
}
return false;
}
function vc$1(a2) {
var b2 = wc$1(a2.target);
if (null !== b2) {
var c2 = Zb(b2);
if (null !== c2) {
if (b2 = c2.tag, 13 === b2) {
if (b2 = $b(c2), null !== b2) {
a2.blockedOn = b2;
hc$1(a2.lanePriority, function() {
r$s.unstable_runWithPriority(a2.priority, function() {
gc$1(c2);
});
});
return;
}
} else if (3 === b2 && c2.stateNode.hydrate) {
a2.blockedOn = 3 === c2.tag ? c2.stateNode.containerInfo : null;
return;
}
}
}
a2.blockedOn = null;
}
function xc$1(a2) {
if (null !== a2.blockedOn)
return false;
for (var b2 = a2.targetContainers; 0 < b2.length; ) {
var c2 = yc$1(a2.domEventName, a2.eventSystemFlags, b2[0], a2.nativeEvent);
if (null !== c2)
return b2 = Cb(c2), null !== b2 && fc$1(b2), a2.blockedOn = c2, false;
b2.shift();
}
return true;
}
function zc$1(a2, b2, c2) {
xc$1(a2) && c2.delete(b2);
}
function Ac$1() {
for (ic$1 = false; 0 < jc$1.length; ) {
var a2 = jc$1[0];
if (null !== a2.blockedOn) {
a2 = Cb(a2.blockedOn);
null !== a2 && ec$1(a2);
break;
}
for (var b2 = a2.targetContainers; 0 < b2.length; ) {
var c2 = yc$1(a2.domEventName, a2.eventSystemFlags, b2[0], a2.nativeEvent);
if (null !== c2) {
a2.blockedOn = c2;
break;
}
b2.shift();
}
null === a2.blockedOn && jc$1.shift();
}
null !== kc$1 && xc$1(kc$1) && (kc$1 = null);
null !== lc$2 && xc$1(lc$2) && (lc$2 = null);
null !== mc$2 && xc$1(mc$2) && (mc$2 = null);
nc$1.forEach(zc$1);
oc$1.forEach(zc$1);
}
function Bc$1(a2, b2) {
a2.blockedOn === b2 && (a2.blockedOn = null, ic$1 || (ic$1 = true, r$s.unstable_scheduleCallback(r$s.unstable_NormalPriority, Ac$1)));
}
function Cc$1(a2) {
function b2(b3) {
return Bc$1(b3, a2);
}
if (0 < jc$1.length) {
Bc$1(jc$1[0], a2);
for (var c2 = 1; c2 < jc$1.length; c2++) {
var d2 = jc$1[c2];
d2.blockedOn === a2 && (d2.blockedOn = null);
}
}
null !== kc$1 && Bc$1(kc$1, a2);
null !== lc$2 && Bc$1(lc$2, a2);
null !== mc$2 && Bc$1(mc$2, a2);
nc$1.forEach(b2);
oc$1.forEach(b2);
for (c2 = 0; c2 < pc$1.length; c2++)
d2 = pc$1[c2], d2.blockedOn === a2 && (d2.blockedOn = null);
for (; 0 < pc$1.length && (c2 = pc$1[0], null === c2.blockedOn); )
vc$1(c2), null === c2.blockedOn && pc$1.shift();
}
function Dc$1(a2, b2) {
var c2 = {};
c2[a2.toLowerCase()] = b2.toLowerCase();
c2["Webkit" + a2] = "webkit" + b2;
c2["Moz" + a2] = "moz" + b2;
return c2;
}
var Ec$1 = { animationend: Dc$1("Animation", "AnimationEnd"), animationiteration: Dc$1("Animation", "AnimationIteration"), animationstart: Dc$1("Animation", "AnimationStart"), transitionend: Dc$1("Transition", "TransitionEnd") }, Fc$1 = {}, Gc$1 = {};
fa$1 && (Gc$1 = document.createElement("div").style, "AnimationEvent" in window || (delete Ec$1.animationend.animation, delete Ec$1.animationiteration.animation, delete Ec$1.animationstart.animation), "TransitionEvent" in window || delete Ec$1.transitionend.transition);
function Hc$1(a2) {
if (Fc$1[a2])
return Fc$1[a2];
if (!Ec$1[a2])
return a2;
var b2 = Ec$1[a2], c2;
for (c2 in b2)
if (b2.hasOwnProperty(c2) && c2 in Gc$1)
return Fc$1[a2] = b2[c2];
return a2;
}
var Ic$1 = Hc$1("animationend"), Jc$1 = Hc$1("animationiteration"), Kc$1 = Hc$1("animationstart"), Lc$1 = Hc$1("transitionend"), Mc$1 = /* @__PURE__ */ new Map(), Nc$1 = /* @__PURE__ */ new Map(), Oc$1 = [
"abort",
"abort",
Ic$1,
"animationEnd",
Jc$1,
"animationIteration",
Kc$1,
"animationStart",
"canplay",
"canPlay",
"canplaythrough",
"canPlayThrough",
"durationchange",
"durationChange",
"emptied",
"emptied",
"encrypted",
"encrypted",
"ended",
"ended",
"error",
"error",
"gotpointercapture",
"gotPointerCapture",
"load",
"load",
"loadeddata",
"loadedData",
"loadedmetadata",
"loadedMetadata",
"loadstart",
"loadStart",
"lostpointercapture",
"lostPointerCapture",
"playing",
"playing",
"progress",
"progress",
"seeking",
"seeking",
"stalled",
"stalled",
"suspend",
"suspend",
"timeupdate",
"timeUpdate",
Lc$1,
"transitionEnd",
"waiting",
"waiting"
];
function Pc$1(a2, b2) {
for (var c2 = 0; c2 < a2.length; c2 += 2) {
var d2 = a2[c2], e7 = a2[c2 + 1];
e7 = "on" + (e7[0].toUpperCase() + e7.slice(1));
Nc$1.set(d2, b2);
Mc$1.set(d2, e7);
da$1(e7, [d2]);
}
}
var Qc$1 = r$s.unstable_now;
Qc$1();
var F$4 = 8;
function Rc$1(a2) {
if (0 !== (1 & a2))
return F$4 = 15, 1;
if (0 !== (2 & a2))
return F$4 = 14, 2;
if (0 !== (4 & a2))
return F$4 = 13, 4;
var b2 = 24 & a2;
if (0 !== b2)
return F$4 = 12, b2;
if (0 !== (a2 & 32))
return F$4 = 11, 32;
b2 = 192 & a2;
if (0 !== b2)
return F$4 = 10, b2;
if (0 !== (a2 & 256))
return F$4 = 9, 256;
b2 = 3584 & a2;
if (0 !== b2)
return F$4 = 8, b2;
if (0 !== (a2 & 4096))
return F$4 = 7, 4096;
b2 = 4186112 & a2;
if (0 !== b2)
return F$4 = 6, b2;
b2 = 62914560 & a2;
if (0 !== b2)
return F$4 = 5, b2;
if (a2 & 67108864)
return F$4 = 4, 67108864;
if (0 !== (a2 & 134217728))
return F$4 = 3, 134217728;
b2 = 805306368 & a2;
if (0 !== b2)
return F$4 = 2, b2;
if (0 !== (1073741824 & a2))
return F$4 = 1, 1073741824;
F$4 = 8;
return a2;
}
function Sc$1(a2) {
switch (a2) {
case 99:
return 15;
case 98:
return 10;
case 97:
case 96:
return 8;
case 95:
return 2;
default:
return 0;
}
}
function Tc$1(a2) {
switch (a2) {
case 15:
case 14:
return 99;
case 13:
case 12:
case 11:
case 10:
return 98;
case 9:
case 8:
case 7:
case 6:
case 4:
case 5:
return 97;
case 3:
case 2:
case 1:
return 95;
case 0:
return 90;
default:
throw Error(y$b(358, a2));
}
}
function Uc$1(a2, b2) {
var c2 = a2.pendingLanes;
if (0 === c2)
return F$4 = 0;
var d2 = 0, e7 = 0, f2 = a2.expiredLanes, g2 = a2.suspendedLanes, h2 = a2.pingedLanes;
if (0 !== f2)
d2 = f2, e7 = F$4 = 15;
else if (f2 = c2 & 134217727, 0 !== f2) {
var k2 = f2 & ~g2;
0 !== k2 ? (d2 = Rc$1(k2), e7 = F$4) : (h2 &= f2, 0 !== h2 && (d2 = Rc$1(h2), e7 = F$4));
} else
f2 = c2 & ~g2, 0 !== f2 ? (d2 = Rc$1(f2), e7 = F$4) : 0 !== h2 && (d2 = Rc$1(h2), e7 = F$4);
if (0 === d2)
return 0;
d2 = 31 - Vc$1(d2);
d2 = c2 & ((0 > d2 ? 0 : 1 << d2) << 1) - 1;
if (0 !== b2 && b2 !== d2 && 0 === (b2 & g2)) {
Rc$1(b2);
if (e7 <= F$4)
return b2;
F$4 = e7;
}
b2 = a2.entangledLanes;
if (0 !== b2)
for (a2 = a2.entanglements, b2 &= d2; 0 < b2; )
c2 = 31 - Vc$1(b2), e7 = 1 << c2, d2 |= a2[c2], b2 &= ~e7;
return d2;
}
function Wc$1(a2) {
a2 = a2.pendingLanes & -1073741825;
return 0 !== a2 ? a2 : a2 & 1073741824 ? 1073741824 : 0;
}
function Xc$1(a2, b2) {
switch (a2) {
case 15:
return 1;
case 14:
return 2;
case 12:
return a2 = Yc$1(24 & ~b2), 0 === a2 ? Xc$1(10, b2) : a2;
case 10:
return a2 = Yc$1(192 & ~b2), 0 === a2 ? Xc$1(8, b2) : a2;
case 8:
return a2 = Yc$1(3584 & ~b2), 0 === a2 && (a2 = Yc$1(4186112 & ~b2), 0 === a2 && (a2 = 512)), a2;
case 2:
return b2 = Yc$1(805306368 & ~b2), 0 === b2 && (b2 = 268435456), b2;
}
throw Error(y$b(358, a2));
}
function Yc$1(a2) {
return a2 & -a2;
}
function Zc$1(a2) {
for (var b2 = [], c2 = 0; 31 > c2; c2++)
b2.push(a2);
return b2;
}
function $c$1(a2, b2, c2) {
a2.pendingLanes |= b2;
var d2 = b2 - 1;
a2.suspendedLanes &= d2;
a2.pingedLanes &= d2;
a2 = a2.eventTimes;
b2 = 31 - Vc$1(b2);
a2[b2] = c2;
}
var Vc$1 = Math.clz32 ? Math.clz32 : ad, bd = Math.log, cd = Math.LN2;
function ad(a2) {
return 0 === a2 ? 32 : 31 - (bd(a2) / cd | 0) | 0;
}
var dd = r$s.unstable_UserBlockingPriority, ed = r$s.unstable_runWithPriority, fd$1 = true;
function gd(a2, b2, c2, d2) {
Kb || Ib();
var e7 = hd, f2 = Kb;
Kb = true;
try {
Hb(e7, a2, b2, c2, d2);
} finally {
(Kb = f2) || Mb();
}
}
function id$3(a2, b2, c2, d2) {
ed(dd, hd.bind(null, a2, b2, c2, d2));
}
function hd(a2, b2, c2, d2) {
if (fd$1) {
var e7;
if ((e7 = 0 === (b2 & 4)) && 0 < jc$1.length && -1 < qc$1.indexOf(a2))
a2 = rc$1(null, a2, b2, c2, d2), jc$1.push(a2);
else {
var f2 = yc$1(a2, b2, c2, d2);
if (null === f2)
e7 && sc$1(a2, d2);
else {
if (e7) {
if (-1 < qc$1.indexOf(a2)) {
a2 = rc$1(f2, a2, b2, c2, d2);
jc$1.push(a2);
return;
}
if (uc$1(f2, a2, b2, c2, d2))
return;
sc$1(a2, d2);
}
jd(a2, b2, d2, null, c2);
}
}
}
}
function yc$1(a2, b2, c2, d2) {
var e7 = xb(d2);
e7 = wc$1(e7);
if (null !== e7) {
var f2 = Zb(e7);
if (null === f2)
e7 = null;
else {
var g2 = f2.tag;
if (13 === g2) {
e7 = $b(f2);
if (null !== e7)
return e7;
e7 = null;
} else if (3 === g2) {
if (f2.stateNode.hydrate)
return 3 === f2.tag ? f2.stateNode.containerInfo : null;
e7 = null;
} else
f2 !== e7 && (e7 = null);
}
}
jd(a2, b2, d2, e7, c2);
return null;
}
var kd = null, ld = null, md$1 = null;
function nd() {
if (md$1)
return md$1;
var a2, b2 = ld, c2 = b2.length, d2, e7 = "value" in kd ? kd.value : kd.textContent, f2 = e7.length;
for (a2 = 0; a2 < c2 && b2[a2] === e7[a2]; a2++)
;
var g2 = c2 - a2;
for (d2 = 1; d2 <= g2 && b2[c2 - d2] === e7[f2 - d2]; d2++)
;
return md$1 = e7.slice(a2, 1 < d2 ? 1 - d2 : void 0);
}
function od(a2) {
var b2 = a2.keyCode;
"charCode" in a2 ? (a2 = a2.charCode, 0 === a2 && 13 === b2 && (a2 = 13)) : a2 = b2;
10 === a2 && (a2 = 13);
return 32 <= a2 || 13 === a2 ? a2 : 0;
}
function pd() {
return true;
}
function qd() {
return false;
}
function rd(a2) {
function b2(b3, d2, e7, f2, g2) {
this._reactName = b3;
this._targetInst = e7;
this.type = d2;
this.nativeEvent = f2;
this.target = g2;
this.currentTarget = null;
for (var c2 in a2)
a2.hasOwnProperty(c2) && (b3 = a2[c2], this[c2] = b3 ? b3(f2) : f2[c2]);
this.isDefaultPrevented = (null != f2.defaultPrevented ? f2.defaultPrevented : false === f2.returnValue) ? pd : qd;
this.isPropagationStopped = qd;
return this;
}
m$o(b2.prototype, { preventDefault: function() {
this.defaultPrevented = true;
var a3 = this.nativeEvent;
a3 && (a3.preventDefault ? a3.preventDefault() : "unknown" !== typeof a3.returnValue && (a3.returnValue = false), this.isDefaultPrevented = pd);
}, stopPropagation: function() {
var a3 = this.nativeEvent;
a3 && (a3.stopPropagation ? a3.stopPropagation() : "unknown" !== typeof a3.cancelBubble && (a3.cancelBubble = true), this.isPropagationStopped = pd);
}, persist: function() {
}, isPersistent: pd });
return b2;
}
var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a2) {
return a2.timeStamp || Date.now();
}, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = m$o({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = m$o({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a2) {
return void 0 === a2.relatedTarget ? a2.fromElement === a2.srcElement ? a2.toElement : a2.fromElement : a2.relatedTarget;
}, movementX: function(a2) {
if ("movementX" in a2)
return a2.movementX;
a2 !== yd && (yd && "mousemove" === a2.type ? (wd = a2.screenX - yd.screenX, xd = a2.screenY - yd.screenY) : xd = wd = 0, yd = a2);
return wd;
}, movementY: function(a2) {
return "movementY" in a2 ? a2.movementY : xd;
} }), Bd = rd(Ad), Cd = m$o({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = m$o({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = m$o({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = m$o({}, sd, { clipboardData: function(a2) {
return "clipboardData" in a2 ? a2.clipboardData : window.clipboardData;
} }), Jd = rd(Id), Kd = m$o({}, sd, { data: 0 }), Ld = rd(Kd), Md = {
Esc: "Escape",
Spacebar: " ",
Left: "ArrowLeft",
Up: "ArrowUp",
Right: "ArrowRight",
Down: "ArrowDown",
Del: "Delete",
Win: "OS",
Menu: "ContextMenu",
Apps: "ContextMenu",
Scroll: "ScrollLock",
MozPrintableKey: "Unidentified"
}, Nd = {
8: "Backspace",
9: "Tab",
12: "Clear",
13: "Enter",
16: "Shift",
17: "Control",
18: "Alt",
19: "Pause",
20: "CapsLock",
27: "Escape",
32: " ",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "ArrowLeft",
38: "ArrowUp",
39: "ArrowRight",
40: "ArrowDown",
45: "Insert",
46: "Delete",
112: "F1",
113: "F2",
114: "F3",
115: "F4",
116: "F5",
117: "F6",
118: "F7",
119: "F8",
120: "F9",
121: "F10",
122: "F11",
123: "F12",
144: "NumLock",
145: "ScrollLock",
224: "Meta"
}, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
function Pd(a2) {
var b2 = this.nativeEvent;
return b2.getModifierState ? b2.getModifierState(a2) : (a2 = Od[a2]) ? !!b2[a2] : false;
}
function zd() {
return Pd;
}
var Qd = m$o({}, ud, { key: function(a2) {
if (a2.key) {
var b2 = Md[a2.key] || a2.key;
if ("Unidentified" !== b2)
return b2;
}
return "keypress" === a2.type ? (a2 = od(a2), 13 === a2 ? "Enter" : String.fromCharCode(a2)) : "keydown" === a2.type || "keyup" === a2.type ? Nd[a2.keyCode] || "Unidentified" : "";
}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a2) {
return "keypress" === a2.type ? od(a2) : 0;
}, keyCode: function(a2) {
return "keydown" === a2.type || "keyup" === a2.type ? a2.keyCode : 0;
}, which: function(a2) {
return "keypress" === a2.type ? od(a2) : "keydown" === a2.type || "keyup" === a2.type ? a2.keyCode : 0;
} }), Rd = rd(Qd), Sd = m$o({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = m$o({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = m$o({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = m$o({}, Ad, {
deltaX: function(a2) {
return "deltaX" in a2 ? a2.deltaX : "wheelDeltaX" in a2 ? -a2.wheelDeltaX : 0;
},
deltaY: function(a2) {
return "deltaY" in a2 ? a2.deltaY : "wheelDeltaY" in a2 ? -a2.wheelDeltaY : "wheelDelta" in a2 ? -a2.wheelDelta : 0;
},
deltaZ: 0,
deltaMode: 0
}), Zd = rd(Yd), $d = [9, 13, 27, 32], ae$2 = fa$1 && "CompositionEvent" in window, be$2 = null;
fa$1 && "documentMode" in document && (be$2 = document.documentMode);
var ce$2 = fa$1 && "TextEvent" in window && !be$2, de$3 = fa$1 && (!ae$2 || be$2 && 8 < be$2 && 11 >= be$2), ee$2 = String.fromCharCode(32), fe$2 = false;
function ge$2(a2, b2) {
switch (a2) {
case "keyup":
return -1 !== $d.indexOf(b2.keyCode);
case "keydown":
return 229 !== b2.keyCode;
case "keypress":
case "mousedown":
case "focusout":
return true;
default:
return false;
}
}
function he$2(a2) {
a2 = a2.detail;
return "object" === typeof a2 && "data" in a2 ? a2.data : null;
}
var ie$2 = false;
function je$1(a2, b2) {
switch (a2) {
case "compositionend":
return he$2(b2);
case "keypress":
if (32 !== b2.which)
return null;
fe$2 = true;
return ee$2;
case "textInput":
return a2 = b2.data, a2 === ee$2 && fe$2 ? null : a2;
default:
return null;
}
}
function ke$1(a2, b2) {
if (ie$2)
return "compositionend" === a2 || !ae$2 && ge$2(a2, b2) ? (a2 = nd(), md$1 = ld = kd = null, ie$2 = false, a2) : null;
switch (a2) {
case "paste":
return null;
case "keypress":
if (!(b2.ctrlKey || b2.altKey || b2.metaKey) || b2.ctrlKey && b2.altKey) {
if (b2.char && 1 < b2.char.length)
return b2.char;
if (b2.which)
return String.fromCharCode(b2.which);
}
return null;
case "compositionend":
return de$3 && "ko" !== b2.locale ? null : b2.data;
default:
return null;
}
}
var le$2 = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true };
function me$2(a2) {
var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase();
return "input" === b2 ? !!le$2[a2.type] : "textarea" === b2 ? true : false;
}
function ne$2(a2, b2, c2, d2) {
Eb(d2);
b2 = oe$2(b2, "onChange");
0 < b2.length && (c2 = new td("onChange", "change", null, c2, d2), a2.push({ event: c2, listeners: b2 }));
}
var pe$2 = null, qe$1 = null;
function re$4(a2) {
se$2(a2, 0);
}
function te$2(a2) {
var b2 = ue$2(a2);
if (Wa$1(b2))
return a2;
}
function ve$2(a2, b2) {
if ("change" === a2)
return b2;
}
var we$2 = false;
if (fa$1) {
var xe$1;
if (fa$1) {
var ye$2 = "oninput" in document;
if (!ye$2) {
var ze$1 = document.createElement("div");
ze$1.setAttribute("oninput", "return;");
ye$2 = "function" === typeof ze$1.oninput;
}
xe$1 = ye$2;
} else
xe$1 = false;
we$2 = xe$1 && (!document.documentMode || 9 < document.documentMode);
}
function Ae$1() {
pe$2 && (pe$2.detachEvent("onpropertychange", Be$1), qe$1 = pe$2 = null);
}
function Be$1(a2) {
if ("value" === a2.propertyName && te$2(qe$1)) {
var b2 = [];
ne$2(b2, qe$1, a2, xb(a2));
a2 = re$4;
if (Kb)
a2(b2);
else {
Kb = true;
try {
Gb(a2, b2);
} finally {
Kb = false, Mb();
}
}
}
}
function Ce$1(a2, b2, c2) {
"focusin" === a2 ? (Ae$1(), pe$2 = b2, qe$1 = c2, pe$2.attachEvent("onpropertychange", Be$1)) : "focusout" === a2 && Ae$1();
}
function De$1(a2) {
if ("selectionchange" === a2 || "keyup" === a2 || "keydown" === a2)
return te$2(qe$1);
}
function Ee$1(a2, b2) {
if ("click" === a2)
return te$2(b2);
}
function Fe$1(a2, b2) {
if ("input" === a2 || "change" === a2)
return te$2(b2);
}
function Ge$1(a2, b2) {
return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
}
var He$1 = "function" === typeof Object.is ? Object.is : Ge$1, Ie$1 = Object.prototype.hasOwnProperty;
function Je$1(a2, b2) {
if (He$1(a2, b2))
return true;
if ("object" !== typeof a2 || null === a2 || "object" !== typeof b2 || null === b2)
return false;
var c2 = Object.keys(a2), d2 = Object.keys(b2);
if (c2.length !== d2.length)
return false;
for (d2 = 0; d2 < c2.length; d2++)
if (!Ie$1.call(b2, c2[d2]) || !He$1(a2[c2[d2]], b2[c2[d2]]))
return false;
return true;
}
function Ke$1(a2) {
for (; a2 && a2.firstChild; )
a2 = a2.firstChild;
return a2;
}
function Le$2(a2, b2) {
var c2 = Ke$1(a2);
a2 = 0;
for (var d2; c2; ) {
if (3 === c2.nodeType) {
d2 = a2 + c2.textContent.length;
if (a2 <= b2 && d2 >= b2)
return { node: c2, offset: b2 - a2 };
a2 = d2;
}
a: {
for (; c2; ) {
if (c2.nextSibling) {
c2 = c2.nextSibling;
break a;
}
c2 = c2.parentNode;
}
c2 = void 0;
}
c2 = Ke$1(c2);
}
}
function Me$1(a2, b2) {
return a2 && b2 ? a2 === b2 ? true : a2 && 3 === a2.nodeType ? false : b2 && 3 === b2.nodeType ? Me$1(a2, b2.parentNode) : "contains" in a2 ? a2.contains(b2) : a2.compareDocumentPosition ? !!(a2.compareDocumentPosition(b2) & 16) : false : false;
}
function Ne$2() {
for (var a2 = window, b2 = Xa$1(); b2 instanceof a2.HTMLIFrameElement; ) {
try {
var c2 = "string" === typeof b2.contentWindow.location.href;
} catch (d2) {
c2 = false;
}
if (c2)
a2 = b2.contentWindow;
else
break;
b2 = Xa$1(a2.document);
}
return b2;
}
function Oe$1(a2) {
var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase();
return b2 && ("input" === b2 && ("text" === a2.type || "search" === a2.type || "tel" === a2.type || "url" === a2.type || "password" === a2.type) || "textarea" === b2 || "true" === a2.contentEditable);
}
var Pe$1 = fa$1 && "documentMode" in document && 11 >= document.documentMode, Qe$1 = null, Re$1 = null, Se$1 = null, Te$1 = false;
function Ue$1(a2, b2, c2) {
var d2 = c2.window === c2 ? c2.document : 9 === c2.nodeType ? c2 : c2.ownerDocument;
Te$1 || null == Qe$1 || Qe$1 !== Xa$1(d2) || (d2 = Qe$1, "selectionStart" in d2 && Oe$1(d2) ? d2 = { start: d2.selectionStart, end: d2.selectionEnd } : (d2 = (d2.ownerDocument && d2.ownerDocument.defaultView || window).getSelection(), d2 = { anchorNode: d2.anchorNode, anchorOffset: d2.anchorOffset, focusNode: d2.focusNode, focusOffset: d2.focusOffset }), Se$1 && Je$1(Se$1, d2) || (Se$1 = d2, d2 = oe$2(Re$1, "onSelect"), 0 < d2.length && (b2 = new td("onSelect", "select", null, b2, c2), a2.push({ event: b2, listeners: d2 }), b2.target = Qe$1)));
}
Pc$1(
"cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),
0
);
Pc$1("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "), 1);
Pc$1(Oc$1, 2);
for (var Ve$1 = "change selectionchange textInput compositionstart compositionend compositionupdate".split(" "), We$1 = 0; We$1 < Ve$1.length; We$1++)
Nc$1.set(Ve$1[We$1], 0);
ea$2("onMouseEnter", ["mouseout", "mouseover"]);
ea$2("onMouseLeave", ["mouseout", "mouseover"]);
ea$2("onPointerEnter", ["pointerout", "pointerover"]);
ea$2("onPointerLeave", ["pointerout", "pointerover"]);
da$1("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" "));
da$1("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));
da$1("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
da$1("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" "));
da$1("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" "));
da$1("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
var Xe$1 = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), Ye$1 = new Set("cancel close invalid load scroll toggle".split(" ").concat(Xe$1));
function Ze$1(a2, b2, c2) {
var d2 = a2.type || "unknown-event";
a2.currentTarget = c2;
Yb(d2, b2, void 0, a2);
a2.currentTarget = null;
}
function se$2(a2, b2) {
b2 = 0 !== (b2 & 4);
for (var c2 = 0; c2 < a2.length; c2++) {
var d2 = a2[c2], e7 = d2.event;
d2 = d2.listeners;
a: {
var f2 = void 0;
if (b2)
for (var g2 = d2.length - 1; 0 <= g2; g2--) {
var h2 = d2[g2], k2 = h2.instance, l2 = h2.currentTarget;
h2 = h2.listener;
if (k2 !== f2 && e7.isPropagationStopped())
break a;
Ze$1(e7, h2, l2);
f2 = k2;
}
else
for (g2 = 0; g2 < d2.length; g2++) {
h2 = d2[g2];
k2 = h2.instance;
l2 = h2.currentTarget;
h2 = h2.listener;
if (k2 !== f2 && e7.isPropagationStopped())
break a;
Ze$1(e7, h2, l2);
f2 = k2;
}
}
}
if (Ub)
throw a2 = Vb, Ub = false, Vb = null, a2;
}
function G$3(a2, b2) {
var c2 = $e$1(b2), d2 = a2 + "__bubble";
c2.has(d2) || (af(b2, a2, 2, false), c2.add(d2));
}
var bf = "_reactListening" + Math.random().toString(36).slice(2);
function cf(a2) {
a2[bf] || (a2[bf] = true, ba$1.forEach(function(b2) {
Ye$1.has(b2) || df(b2, false, a2, null);
df(b2, true, a2, null);
}));
}
function df(a2, b2, c2, d2) {
var e7 = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 0, f2 = c2;
"selectionchange" === a2 && 9 !== c2.nodeType && (f2 = c2.ownerDocument);
if (null !== d2 && !b2 && Ye$1.has(a2)) {
if ("scroll" !== a2)
return;
e7 |= 2;
f2 = d2;
}
var g2 = $e$1(f2), h2 = a2 + "__" + (b2 ? "capture" : "bubble");
g2.has(h2) || (b2 && (e7 |= 4), af(f2, a2, e7, b2), g2.add(h2));
}
function af(a2, b2, c2, d2) {
var e7 = Nc$1.get(b2);
switch (void 0 === e7 ? 2 : e7) {
case 0:
e7 = gd;
break;
case 1:
e7 = id$3;
break;
default:
e7 = hd;
}
c2 = e7.bind(null, b2, c2, a2);
e7 = void 0;
!Pb || "touchstart" !== b2 && "touchmove" !== b2 && "wheel" !== b2 || (e7 = true);
d2 ? void 0 !== e7 ? a2.addEventListener(b2, c2, { capture: true, passive: e7 }) : a2.addEventListener(b2, c2, true) : void 0 !== e7 ? a2.addEventListener(b2, c2, { passive: e7 }) : a2.addEventListener(b2, c2, false);
}
function jd(a2, b2, c2, d2, e7) {
var f2 = d2;
if (0 === (b2 & 1) && 0 === (b2 & 2) && null !== d2)
a:
for (; ; ) {
if (null === d2)
return;
var g2 = d2.tag;
if (3 === g2 || 4 === g2) {
var h2 = d2.stateNode.containerInfo;
if (h2 === e7 || 8 === h2.nodeType && h2.parentNode === e7)
break;
if (4 === g2)
for (g2 = d2.return; null !== g2; ) {
var k2 = g2.tag;
if (3 === k2 || 4 === k2) {
if (k2 = g2.stateNode.containerInfo, k2 === e7 || 8 === k2.nodeType && k2.parentNode === e7)
return;
}
g2 = g2.return;
}
for (; null !== h2; ) {
g2 = wc$1(h2);
if (null === g2)
return;
k2 = g2.tag;
if (5 === k2 || 6 === k2) {
d2 = f2 = g2;
continue a;
}
h2 = h2.parentNode;
}
}
d2 = d2.return;
}
Nb(function() {
var d3 = f2, e8 = xb(c2), g3 = [];
a: {
var h3 = Mc$1.get(a2);
if (void 0 !== h3) {
var k3 = td, x2 = a2;
switch (a2) {
case "keypress":
if (0 === od(c2))
break a;
case "keydown":
case "keyup":
k3 = Rd;
break;
case "focusin":
x2 = "focus";
k3 = Fd;
break;
case "focusout":
x2 = "blur";
k3 = Fd;
break;
case "beforeblur":
case "afterblur":
k3 = Fd;
break;
case "click":
if (2 === c2.button)
break a;
case "auxclick":
case "dblclick":
case "mousedown":
case "mousemove":
case "mouseup":
case "mouseout":
case "mouseover":
case "contextmenu":
k3 = Bd;
break;
case "drag":
case "dragend":
case "dragenter":
case "dragexit":
case "dragleave":
case "dragover":
case "dragstart":
case "drop":
k3 = Dd;
break;
case "touchcancel":
case "touchend":
case "touchmove":
case "touchstart":
k3 = Vd;
break;
case Ic$1:
case Jc$1:
case Kc$1:
k3 = Hd;
break;
case Lc$1:
k3 = Xd;
break;
case "scroll":
k3 = vd;
break;
case "wheel":
k3 = Zd;
break;
case "copy":
case "cut":
case "paste":
k3 = Jd;
break;
case "gotpointercapture":
case "lostpointercapture":
case "pointercancel":
case "pointerdown":
case "pointermove":
case "pointerout":
case "pointerover":
case "pointerup":
k3 = Td;
}
var w2 = 0 !== (b2 & 4), z2 = !w2 && "scroll" === a2, u2 = w2 ? null !== h3 ? h3 + "Capture" : null : h3;
w2 = [];
for (var t5 = d3, q2; null !== t5; ) {
q2 = t5;
var v2 = q2.stateNode;
5 === q2.tag && null !== v2 && (q2 = v2, null !== u2 && (v2 = Ob(t5, u2), null != v2 && w2.push(ef(t5, v2, q2))));
if (z2)
break;
t5 = t5.return;
}
0 < w2.length && (h3 = new k3(h3, x2, null, c2, e8), g3.push({ event: h3, listeners: w2 }));
}
}
if (0 === (b2 & 7)) {
a: {
h3 = "mouseover" === a2 || "pointerover" === a2;
k3 = "mouseout" === a2 || "pointerout" === a2;
if (h3 && 0 === (b2 & 16) && (x2 = c2.relatedTarget || c2.fromElement) && (wc$1(x2) || x2[ff]))
break a;
if (k3 || h3) {
h3 = e8.window === e8 ? e8 : (h3 = e8.ownerDocument) ? h3.defaultView || h3.parentWindow : window;
if (k3) {
if (x2 = c2.relatedTarget || c2.toElement, k3 = d3, x2 = x2 ? wc$1(x2) : null, null !== x2 && (z2 = Zb(x2), x2 !== z2 || 5 !== x2.tag && 6 !== x2.tag))
x2 = null;
} else
k3 = null, x2 = d3;
if (k3 !== x2) {
w2 = Bd;
v2 = "onMouseLeave";
u2 = "onMouseEnter";
t5 = "mouse";
if ("pointerout" === a2 || "pointerover" === a2)
w2 = Td, v2 = "onPointerLeave", u2 = "onPointerEnter", t5 = "pointer";
z2 = null == k3 ? h3 : ue$2(k3);
q2 = null == x2 ? h3 : ue$2(x2);
h3 = new w2(v2, t5 + "leave", k3, c2, e8);
h3.target = z2;
h3.relatedTarget = q2;
v2 = null;
wc$1(e8) === d3 && (w2 = new w2(u2, t5 + "enter", x2, c2, e8), w2.target = q2, w2.relatedTarget = z2, v2 = w2);
z2 = v2;
if (k3 && x2)
b: {
w2 = k3;
u2 = x2;
t5 = 0;
for (q2 = w2; q2; q2 = gf(q2))
t5++;
q2 = 0;
for (v2 = u2; v2; v2 = gf(v2))
q2++;
for (; 0 < t5 - q2; )
w2 = gf(w2), t5--;
for (; 0 < q2 - t5; )
u2 = gf(u2), q2--;
for (; t5--; ) {
if (w2 === u2 || null !== u2 && w2 === u2.alternate)
break b;
w2 = gf(w2);
u2 = gf(u2);
}
w2 = null;
}
else
w2 = null;
null !== k3 && hf(g3, h3, k3, w2, false);
null !== x2 && null !== z2 && hf(g3, z2, x2, w2, true);
}
}
}
a: {
h3 = d3 ? ue$2(d3) : window;
k3 = h3.nodeName && h3.nodeName.toLowerCase();
if ("select" === k3 || "input" === k3 && "file" === h3.type)
var J2 = ve$2;
else if (me$2(h3))
if (we$2)
J2 = Fe$1;
else {
J2 = De$1;
var K2 = Ce$1;
}
else
(k3 = h3.nodeName) && "input" === k3.toLowerCase() && ("checkbox" === h3.type || "radio" === h3.type) && (J2 = Ee$1);
if (J2 && (J2 = J2(a2, d3))) {
ne$2(g3, J2, c2, e8);
break a;
}
K2 && K2(a2, h3, d3);
"focusout" === a2 && (K2 = h3._wrapperState) && K2.controlled && "number" === h3.type && bb(h3, "number", h3.value);
}
K2 = d3 ? ue$2(d3) : window;
switch (a2) {
case "focusin":
if (me$2(K2) || "true" === K2.contentEditable)
Qe$1 = K2, Re$1 = d3, Se$1 = null;
break;
case "focusout":
Se$1 = Re$1 = Qe$1 = null;
break;
case "mousedown":
Te$1 = true;
break;
case "contextmenu":
case "mouseup":
case "dragend":
Te$1 = false;
Ue$1(g3, c2, e8);
break;
case "selectionchange":
if (Pe$1)
break;
case "keydown":
case "keyup":
Ue$1(g3, c2, e8);
}
var Q2;
if (ae$2)
b: {
switch (a2) {
case "compositionstart":
var L2 = "onCompositionStart";
break b;
case "compositionend":
L2 = "onCompositionEnd";
break b;
case "compositionupdate":
L2 = "onCompositionUpdate";
break b;
}
L2 = void 0;
}
else
ie$2 ? ge$2(a2, c2) && (L2 = "onCompositionEnd") : "keydown" === a2 && 229 === c2.keyCode && (L2 = "onCompositionStart");
L2 && (de$3 && "ko" !== c2.locale && (ie$2 || "onCompositionStart" !== L2 ? "onCompositionEnd" === L2 && ie$2 && (Q2 = nd()) : (kd = e8, ld = "value" in kd ? kd.value : kd.textContent, ie$2 = true)), K2 = oe$2(d3, L2), 0 < K2.length && (L2 = new Ld(L2, a2, null, c2, e8), g3.push({ event: L2, listeners: K2 }), Q2 ? L2.data = Q2 : (Q2 = he$2(c2), null !== Q2 && (L2.data = Q2))));
if (Q2 = ce$2 ? je$1(a2, c2) : ke$1(a2, c2))
d3 = oe$2(d3, "onBeforeInput"), 0 < d3.length && (e8 = new Ld(
"onBeforeInput",
"beforeinput",
null,
c2,
e8
), g3.push({ event: e8, listeners: d3 }), e8.data = Q2);
}
se$2(g3, b2);
});
}
function ef(a2, b2, c2) {
return { instance: a2, listener: b2, currentTarget: c2 };
}
function oe$2(a2, b2) {
for (var c2 = b2 + "Capture", d2 = []; null !== a2; ) {
var e7 = a2, f2 = e7.stateNode;
5 === e7.tag && null !== f2 && (e7 = f2, f2 = Ob(a2, c2), null != f2 && d2.unshift(ef(a2, f2, e7)), f2 = Ob(a2, b2), null != f2 && d2.push(ef(a2, f2, e7)));
a2 = a2.return;
}
return d2;
}
function gf(a2) {
if (null === a2)
return null;
do
a2 = a2.return;
while (a2 && 5 !== a2.tag);
return a2 ? a2 : null;
}
function hf(a2, b2, c2, d2, e7) {
for (var f2 = b2._reactName, g2 = []; null !== c2 && c2 !== d2; ) {
var h2 = c2, k2 = h2.alternate, l2 = h2.stateNode;
if (null !== k2 && k2 === d2)
break;
5 === h2.tag && null !== l2 && (h2 = l2, e7 ? (k2 = Ob(c2, f2), null != k2 && g2.unshift(ef(c2, k2, h2))) : e7 || (k2 = Ob(c2, f2), null != k2 && g2.push(ef(c2, k2, h2))));
c2 = c2.return;
}
0 !== g2.length && a2.push({ event: b2, listeners: g2 });
}
function jf() {
}
var kf = null, lf = null;
function mf(a2, b2) {
switch (a2) {
case "button":
case "input":
case "select":
case "textarea":
return !!b2.autoFocus;
}
return false;
}
function nf(a2, b2) {
return "textarea" === a2 || "option" === a2 || "noscript" === a2 || "string" === typeof b2.children || "number" === typeof b2.children || "object" === typeof b2.dangerouslySetInnerHTML && null !== b2.dangerouslySetInnerHTML && null != b2.dangerouslySetInnerHTML.__html;
}
var of = "function" === typeof setTimeout ? setTimeout : void 0, pf = "function" === typeof clearTimeout ? clearTimeout : void 0;
function qf(a2) {
1 === a2.nodeType ? a2.textContent = "" : 9 === a2.nodeType && (a2 = a2.body, null != a2 && (a2.textContent = ""));
}
function rf(a2) {
for (; null != a2; a2 = a2.nextSibling) {
var b2 = a2.nodeType;
if (1 === b2 || 3 === b2)
break;
}
return a2;
}
function sf(a2) {
a2 = a2.previousSibling;
for (var b2 = 0; a2; ) {
if (8 === a2.nodeType) {
var c2 = a2.data;
if ("$" === c2 || "$!" === c2 || "$?" === c2) {
if (0 === b2)
return a2;
b2--;
} else
"/$" === c2 && b2++;
}
a2 = a2.previousSibling;
}
return null;
}
var tf = 0;
function uf(a2) {
return { $$typeof: Ga$1, toString: a2, valueOf: a2 };
}
var vf = Math.random().toString(36).slice(2), wf = "__reactFiber$" + vf, xf$1 = "__reactProps$" + vf, ff = "__reactContainer$" + vf, yf = "__reactEvents$" + vf;
function wc$1(a2) {
var b2 = a2[wf];
if (b2)
return b2;
for (var c2 = a2.parentNode; c2; ) {
if (b2 = c2[ff] || c2[wf]) {
c2 = b2.alternate;
if (null !== b2.child || null !== c2 && null !== c2.child)
for (a2 = sf(a2); null !== a2; ) {
if (c2 = a2[wf])
return c2;
a2 = sf(a2);
}
return b2;
}
a2 = c2;
c2 = a2.parentNode;
}
return null;
}
function Cb(a2) {
a2 = a2[wf] || a2[ff];
return !a2 || 5 !== a2.tag && 6 !== a2.tag && 13 !== a2.tag && 3 !== a2.tag ? null : a2;
}
function ue$2(a2) {
if (5 === a2.tag || 6 === a2.tag)
return a2.stateNode;
throw Error(y$b(33));
}
function Db(a2) {
return a2[xf$1] || null;
}
function $e$1(a2) {
var b2 = a2[yf];
void 0 === b2 && (b2 = a2[yf] = /* @__PURE__ */ new Set());
return b2;
}
var zf = [], Af = -1;
function Bf(a2) {
return { current: a2 };
}
function H$2(a2) {
0 > Af || (a2.current = zf[Af], zf[Af] = null, Af--);
}
function I$3(a2, b2) {
Af++;
zf[Af] = a2.current;
a2.current = b2;
}
var Cf = {}, M$9 = Bf(Cf), N$4 = Bf(false), Df = Cf;
function Ef(a2, b2) {
var c2 = a2.type.contextTypes;
if (!c2)
return Cf;
var d2 = a2.stateNode;
if (d2 && d2.__reactInternalMemoizedUnmaskedChildContext === b2)
return d2.__reactInternalMemoizedMaskedChildContext;
var e7 = {}, f2;
for (f2 in c2)
e7[f2] = b2[f2];
d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = b2, a2.__reactInternalMemoizedMaskedChildContext = e7);
return e7;
}
function Ff(a2) {
a2 = a2.childContextTypes;
return null !== a2 && void 0 !== a2;
}
function Gf() {
H$2(N$4);
H$2(M$9);
}
function Hf(a2, b2, c2) {
if (M$9.current !== Cf)
throw Error(y$b(168));
I$3(M$9, b2);
I$3(N$4, c2);
}
function If(a2, b2, c2) {
var d2 = a2.stateNode;
a2 = b2.childContextTypes;
if ("function" !== typeof d2.getChildContext)
return c2;
d2 = d2.getChildContext();
for (var e7 in d2)
if (!(e7 in a2))
throw Error(y$b(108, Ra$1(b2) || "Unknown", e7));
return m$o({}, c2, d2);
}
function Jf(a2) {
a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || Cf;
Df = M$9.current;
I$3(M$9, a2);
I$3(N$4, N$4.current);
return true;
}
function Kf(a2, b2, c2) {
var d2 = a2.stateNode;
if (!d2)
throw Error(y$b(169));
c2 ? (a2 = If(a2, b2, Df), d2.__reactInternalMemoizedMergedChildContext = a2, H$2(N$4), H$2(M$9), I$3(M$9, a2)) : H$2(N$4);
I$3(N$4, c2);
}
var Lf = null, Mf = null, Nf = r$s.unstable_runWithPriority, Of = r$s.unstable_scheduleCallback, Pf = r$s.unstable_cancelCallback, Qf = r$s.unstable_shouldYield, Rf = r$s.unstable_requestPaint, Sf = r$s.unstable_now, Tf = r$s.unstable_getCurrentPriorityLevel, Uf = r$s.unstable_ImmediatePriority, Vf = r$s.unstable_UserBlockingPriority, Wf = r$s.unstable_NormalPriority, Xf = r$s.unstable_LowPriority, Yf = r$s.unstable_IdlePriority, Zf = {}, $f = void 0 !== Rf ? Rf : function() {
}, ag = null, bg = null, cg = false, dg = Sf(), O$4 = 1e4 > dg ? Sf : function() {
return Sf() - dg;
};
function eg$1() {
switch (Tf()) {
case Uf:
return 99;
case Vf:
return 98;
case Wf:
return 97;
case Xf:
return 96;
case Yf:
return 95;
default:
throw Error(y$b(332));
}
}
function fg(a2) {
switch (a2) {
case 99:
return Uf;
case 98:
return Vf;
case 97:
return Wf;
case 96:
return Xf;
case 95:
return Yf;
default:
throw Error(y$b(332));
}
}
function gg(a2, b2) {
a2 = fg(a2);
return Nf(a2, b2);
}
function hg(a2, b2, c2) {
a2 = fg(a2);
return Of(a2, b2, c2);
}
function ig() {
if (null !== bg) {
var a2 = bg;
bg = null;
Pf(a2);
}
jg();
}
function jg() {
if (!cg && null !== ag) {
cg = true;
var a2 = 0;
try {
var b2 = ag;
gg(99, function() {
for (; a2 < b2.length; a2++) {
var c2 = b2[a2];
do
c2 = c2(true);
while (null !== c2);
}
});
ag = null;
} catch (c2) {
throw null !== ag && (ag = ag.slice(a2 + 1)), Of(Uf, ig), c2;
} finally {
cg = false;
}
}
}
var kg = ra$1.ReactCurrentBatchConfig;
function lg(a2, b2) {
if (a2 && a2.defaultProps) {
b2 = m$o({}, b2);
a2 = a2.defaultProps;
for (var c2 in a2)
void 0 === b2[c2] && (b2[c2] = a2[c2]);
return b2;
}
return b2;
}
var mg = Bf(null), ng = null, og = null, pg = null;
function qg() {
pg = og = ng = null;
}
function rg(a2) {
var b2 = mg.current;
H$2(mg);
a2.type._context._currentValue = b2;
}
function sg(a2, b2) {
for (; null !== a2; ) {
var c2 = a2.alternate;
if ((a2.childLanes & b2) === b2)
if (null === c2 || (c2.childLanes & b2) === b2)
break;
else
c2.childLanes |= b2;
else
a2.childLanes |= b2, null !== c2 && (c2.childLanes |= b2);
a2 = a2.return;
}
}
function tg$1(a2, b2) {
ng = a2;
pg = og = null;
a2 = a2.dependencies;
null !== a2 && null !== a2.firstContext && (0 !== (a2.lanes & b2) && (ug = true), a2.firstContext = null);
}
function vg(a2, b2) {
if (pg !== a2 && false !== b2 && 0 !== b2) {
if ("number" !== typeof b2 || 1073741823 === b2)
pg = a2, b2 = 1073741823;
b2 = { context: a2, observedBits: b2, next: null };
if (null === og) {
if (null === ng)
throw Error(y$b(308));
og = b2;
ng.dependencies = { lanes: 0, firstContext: b2, responders: null };
} else
og = og.next = b2;
}
return a2._currentValue;
}
var wg = false;
function xg(a2) {
a2.updateQueue = { baseState: a2.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null }, effects: null };
}
function yg(a2, b2) {
a2 = a2.updateQueue;
b2.updateQueue === a2 && (b2.updateQueue = { baseState: a2.baseState, firstBaseUpdate: a2.firstBaseUpdate, lastBaseUpdate: a2.lastBaseUpdate, shared: a2.shared, effects: a2.effects });
}
function zg(a2, b2) {
return { eventTime: a2, lane: b2, tag: 0, payload: null, callback: null, next: null };
}
function Ag(a2, b2) {
a2 = a2.updateQueue;
if (null !== a2) {
a2 = a2.shared;
var c2 = a2.pending;
null === c2 ? b2.next = b2 : (b2.next = c2.next, c2.next = b2);
a2.pending = b2;
}
}
function Bg(a2, b2) {
var c2 = a2.updateQueue, d2 = a2.alternate;
if (null !== d2 && (d2 = d2.updateQueue, c2 === d2)) {
var e7 = null, f2 = null;
c2 = c2.firstBaseUpdate;
if (null !== c2) {
do {
var g2 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null };
null === f2 ? e7 = f2 = g2 : f2 = f2.next = g2;
c2 = c2.next;
} while (null !== c2);
null === f2 ? e7 = f2 = b2 : f2 = f2.next = b2;
} else
e7 = f2 = b2;
c2 = { baseState: d2.baseState, firstBaseUpdate: e7, lastBaseUpdate: f2, shared: d2.shared, effects: d2.effects };
a2.updateQueue = c2;
return;
}
a2 = c2.lastBaseUpdate;
null === a2 ? c2.firstBaseUpdate = b2 : a2.next = b2;
c2.lastBaseUpdate = b2;
}
function Cg(a2, b2, c2, d2) {
var e7 = a2.updateQueue;
wg = false;
var f2 = e7.firstBaseUpdate, g2 = e7.lastBaseUpdate, h2 = e7.shared.pending;
if (null !== h2) {
e7.shared.pending = null;
var k2 = h2, l2 = k2.next;
k2.next = null;
null === g2 ? f2 = l2 : g2.next = l2;
g2 = k2;
var n2 = a2.alternate;
if (null !== n2) {
n2 = n2.updateQueue;
var A5 = n2.lastBaseUpdate;
A5 !== g2 && (null === A5 ? n2.firstBaseUpdate = l2 : A5.next = l2, n2.lastBaseUpdate = k2);
}
}
if (null !== f2) {
A5 = e7.baseState;
g2 = 0;
n2 = l2 = k2 = null;
do {
h2 = f2.lane;
var p2 = f2.eventTime;
if ((d2 & h2) === h2) {
null !== n2 && (n2 = n2.next = {
eventTime: p2,
lane: 0,
tag: f2.tag,
payload: f2.payload,
callback: f2.callback,
next: null
});
a: {
var C3 = a2, x2 = f2;
h2 = b2;
p2 = c2;
switch (x2.tag) {
case 1:
C3 = x2.payload;
if ("function" === typeof C3) {
A5 = C3.call(p2, A5, h2);
break a;
}
A5 = C3;
break a;
case 3:
C3.flags = C3.flags & -4097 | 64;
case 0:
C3 = x2.payload;
h2 = "function" === typeof C3 ? C3.call(p2, A5, h2) : C3;
if (null === h2 || void 0 === h2)
break a;
A5 = m$o({}, A5, h2);
break a;
case 2:
wg = true;
}
}
null !== f2.callback && (a2.flags |= 32, h2 = e7.effects, null === h2 ? e7.effects = [f2] : h2.push(f2));
} else
p2 = { eventTime: p2, lane: h2, tag: f2.tag, payload: f2.payload, callback: f2.callback, next: null }, null === n2 ? (l2 = n2 = p2, k2 = A5) : n2 = n2.next = p2, g2 |= h2;
f2 = f2.next;
if (null === f2)
if (h2 = e7.shared.pending, null === h2)
break;
else
f2 = h2.next, h2.next = null, e7.lastBaseUpdate = h2, e7.shared.pending = null;
} while (1);
null === n2 && (k2 = A5);
e7.baseState = k2;
e7.firstBaseUpdate = l2;
e7.lastBaseUpdate = n2;
Dg |= g2;
a2.lanes = g2;
a2.memoizedState = A5;
}
}
function Eg(a2, b2, c2) {
a2 = b2.effects;
b2.effects = null;
if (null !== a2)
for (b2 = 0; b2 < a2.length; b2++) {
var d2 = a2[b2], e7 = d2.callback;
if (null !== e7) {
d2.callback = null;
d2 = c2;
if ("function" !== typeof e7)
throw Error(y$b(191, e7));
e7.call(d2);
}
}
}
var Fg = new aa$1.Component().refs;
function Gg(a2, b2, c2, d2) {
b2 = a2.memoizedState;
c2 = c2(d2, b2);
c2 = null === c2 || void 0 === c2 ? b2 : m$o({}, b2, c2);
a2.memoizedState = c2;
0 === a2.lanes && (a2.updateQueue.baseState = c2);
}
var Kg = { isMounted: function(a2) {
return (a2 = a2._reactInternals) ? Zb(a2) === a2 : false;
}, enqueueSetState: function(a2, b2, c2) {
a2 = a2._reactInternals;
var d2 = Hg(), e7 = Ig(a2), f2 = zg(d2, e7);
f2.payload = b2;
void 0 !== c2 && null !== c2 && (f2.callback = c2);
Ag(a2, f2);
Jg(a2, e7, d2);
}, enqueueReplaceState: function(a2, b2, c2) {
a2 = a2._reactInternals;
var d2 = Hg(), e7 = Ig(a2), f2 = zg(d2, e7);
f2.tag = 1;
f2.payload = b2;
void 0 !== c2 && null !== c2 && (f2.callback = c2);
Ag(a2, f2);
Jg(a2, e7, d2);
}, enqueueForceUpdate: function(a2, b2) {
a2 = a2._reactInternals;
var c2 = Hg(), d2 = Ig(a2), e7 = zg(c2, d2);
e7.tag = 2;
void 0 !== b2 && null !== b2 && (e7.callback = b2);
Ag(a2, e7);
Jg(a2, d2, c2);
} };
function Lg(a2, b2, c2, d2, e7, f2, g2) {
a2 = a2.stateNode;
return "function" === typeof a2.shouldComponentUpdate ? a2.shouldComponentUpdate(d2, f2, g2) : b2.prototype && b2.prototype.isPureReactComponent ? !Je$1(c2, d2) || !Je$1(e7, f2) : true;
}
function Mg(a2, b2, c2) {
var d2 = false, e7 = Cf;
var f2 = b2.contextType;
"object" === typeof f2 && null !== f2 ? f2 = vg(f2) : (e7 = Ff(b2) ? Df : M$9.current, d2 = b2.contextTypes, f2 = (d2 = null !== d2 && void 0 !== d2) ? Ef(a2, e7) : Cf);
b2 = new b2(c2, f2);
a2.memoizedState = null !== b2.state && void 0 !== b2.state ? b2.state : null;
b2.updater = Kg;
a2.stateNode = b2;
b2._reactInternals = a2;
d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = e7, a2.__reactInternalMemoizedMaskedChildContext = f2);
return b2;
}
function Ng(a2, b2, c2, d2) {
a2 = b2.state;
"function" === typeof b2.componentWillReceiveProps && b2.componentWillReceiveProps(c2, d2);
"function" === typeof b2.UNSAFE_componentWillReceiveProps && b2.UNSAFE_componentWillReceiveProps(c2, d2);
b2.state !== a2 && Kg.enqueueReplaceState(b2, b2.state, null);
}
function Og(a2, b2, c2, d2) {
var e7 = a2.stateNode;
e7.props = c2;
e7.state = a2.memoizedState;
e7.refs = Fg;
xg(a2);
var f2 = b2.contextType;
"object" === typeof f2 && null !== f2 ? e7.context = vg(f2) : (f2 = Ff(b2) ? Df : M$9.current, e7.context = Ef(a2, f2));
Cg(a2, c2, e7, d2);
e7.state = a2.memoizedState;
f2 = b2.getDerivedStateFromProps;
"function" === typeof f2 && (Gg(a2, b2, f2, c2), e7.state = a2.memoizedState);
"function" === typeof b2.getDerivedStateFromProps || "function" === typeof e7.getSnapshotBeforeUpdate || "function" !== typeof e7.UNSAFE_componentWillMount && "function" !== typeof e7.componentWillMount || (b2 = e7.state, "function" === typeof e7.componentWillMount && e7.componentWillMount(), "function" === typeof e7.UNSAFE_componentWillMount && e7.UNSAFE_componentWillMount(), b2 !== e7.state && Kg.enqueueReplaceState(e7, e7.state, null), Cg(a2, c2, e7, d2), e7.state = a2.memoizedState);
"function" === typeof e7.componentDidMount && (a2.flags |= 4);
}
var Pg = Array.isArray;
function Qg(a2, b2, c2) {
a2 = c2.ref;
if (null !== a2 && "function" !== typeof a2 && "object" !== typeof a2) {
if (c2._owner) {
c2 = c2._owner;
if (c2) {
if (1 !== c2.tag)
throw Error(y$b(309));
var d2 = c2.stateNode;
}
if (!d2)
throw Error(y$b(147, a2));
var e7 = "" + a2;
if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === e7)
return b2.ref;
b2 = function(a3) {
var b3 = d2.refs;
b3 === Fg && (b3 = d2.refs = {});
null === a3 ? delete b3[e7] : b3[e7] = a3;
};
b2._stringRef = e7;
return b2;
}
if ("string" !== typeof a2)
throw Error(y$b(284));
if (!c2._owner)
throw Error(y$b(290, a2));
}
return a2;
}
function Rg(a2, b2) {
if ("textarea" !== a2.type)
throw Error(y$b(31, "[object Object]" === Object.prototype.toString.call(b2) ? "object with keys {" + Object.keys(b2).join(", ") + "}" : b2));
}
function Sg(a2) {
function b2(b3, c3) {
if (a2) {
var d3 = b3.lastEffect;
null !== d3 ? (d3.nextEffect = c3, b3.lastEffect = c3) : b3.firstEffect = b3.lastEffect = c3;
c3.nextEffect = null;
c3.flags = 8;
}
}
function c2(c3, d3) {
if (!a2)
return null;
for (; null !== d3; )
b2(c3, d3), d3 = d3.sibling;
return null;
}
function d2(a3, b3) {
for (a3 = /* @__PURE__ */ new Map(); null !== b3; )
null !== b3.key ? a3.set(b3.key, b3) : a3.set(b3.index, b3), b3 = b3.sibling;
return a3;
}
function e7(a3, b3) {
a3 = Tg(a3, b3);
a3.index = 0;
a3.sibling = null;
return a3;
}
function f2(b3, c3, d3) {
b3.index = d3;
if (!a2)
return c3;
d3 = b3.alternate;
if (null !== d3)
return d3 = d3.index, d3 < c3 ? (b3.flags = 2, c3) : d3;
b3.flags = 2;
return c3;
}
function g2(b3) {
a2 && null === b3.alternate && (b3.flags = 2);
return b3;
}
function h2(a3, b3, c3, d3) {
if (null === b3 || 6 !== b3.tag)
return b3 = Ug(c3, a3.mode, d3), b3.return = a3, b3;
b3 = e7(b3, c3);
b3.return = a3;
return b3;
}
function k2(a3, b3, c3, d3) {
if (null !== b3 && b3.elementType === c3.type)
return d3 = e7(b3, c3.props), d3.ref = Qg(a3, b3, c3), d3.return = a3, d3;
d3 = Vg(c3.type, c3.key, c3.props, null, a3.mode, d3);
d3.ref = Qg(a3, b3, c3);
d3.return = a3;
return d3;
}
function l2(a3, b3, c3, d3) {
if (null === b3 || 4 !== b3.tag || b3.stateNode.containerInfo !== c3.containerInfo || b3.stateNode.implementation !== c3.implementation)
return b3 = Wg(c3, a3.mode, d3), b3.return = a3, b3;
b3 = e7(b3, c3.children || []);
b3.return = a3;
return b3;
}
function n2(a3, b3, c3, d3, f3) {
if (null === b3 || 7 !== b3.tag)
return b3 = Xg(c3, a3.mode, d3, f3), b3.return = a3, b3;
b3 = e7(b3, c3);
b3.return = a3;
return b3;
}
function A5(a3, b3, c3) {
if ("string" === typeof b3 || "number" === typeof b3)
return b3 = Ug("" + b3, a3.mode, c3), b3.return = a3, b3;
if ("object" === typeof b3 && null !== b3) {
switch (b3.$$typeof) {
case sa$2:
return c3 = Vg(b3.type, b3.key, b3.props, null, a3.mode, c3), c3.ref = Qg(a3, null, b3), c3.return = a3, c3;
case ta$1:
return b3 = Wg(b3, a3.mode, c3), b3.return = a3, b3;
}
if (Pg(b3) || La$1(b3))
return b3 = Xg(
b3,
a3.mode,
c3,
null
), b3.return = a3, b3;
Rg(a3, b3);
}
return null;
}
function p2(a3, b3, c3, d3) {
var e8 = null !== b3 ? b3.key : null;
if ("string" === typeof c3 || "number" === typeof c3)
return null !== e8 ? null : h2(a3, b3, "" + c3, d3);
if ("object" === typeof c3 && null !== c3) {
switch (c3.$$typeof) {
case sa$2:
return c3.key === e8 ? c3.type === ua$1 ? n2(a3, b3, c3.props.children, d3, e8) : k2(a3, b3, c3, d3) : null;
case ta$1:
return c3.key === e8 ? l2(a3, b3, c3, d3) : null;
}
if (Pg(c3) || La$1(c3))
return null !== e8 ? null : n2(a3, b3, c3, d3, null);
Rg(a3, c3);
}
return null;
}
function C3(a3, b3, c3, d3, e8) {
if ("string" === typeof d3 || "number" === typeof d3)
return a3 = a3.get(c3) || null, h2(b3, a3, "" + d3, e8);
if ("object" === typeof d3 && null !== d3) {
switch (d3.$$typeof) {
case sa$2:
return a3 = a3.get(null === d3.key ? c3 : d3.key) || null, d3.type === ua$1 ? n2(b3, a3, d3.props.children, e8, d3.key) : k2(b3, a3, d3, e8);
case ta$1:
return a3 = a3.get(null === d3.key ? c3 : d3.key) || null, l2(b3, a3, d3, e8);
}
if (Pg(d3) || La$1(d3))
return a3 = a3.get(c3) || null, n2(b3, a3, d3, e8, null);
Rg(b3, d3);
}
return null;
}
function x2(e8, g3, h3, k3) {
for (var l3 = null, t5 = null, u2 = g3, z2 = g3 = 0, q2 = null; null !== u2 && z2 < h3.length; z2++) {
u2.index > z2 ? (q2 = u2, u2 = null) : q2 = u2.sibling;
var n3 = p2(e8, u2, h3[z2], k3);
if (null === n3) {
null === u2 && (u2 = q2);
break;
}
a2 && u2 && null === n3.alternate && b2(e8, u2);
g3 = f2(n3, g3, z2);
null === t5 ? l3 = n3 : t5.sibling = n3;
t5 = n3;
u2 = q2;
}
if (z2 === h3.length)
return c2(e8, u2), l3;
if (null === u2) {
for (; z2 < h3.length; z2++)
u2 = A5(e8, h3[z2], k3), null !== u2 && (g3 = f2(u2, g3, z2), null === t5 ? l3 = u2 : t5.sibling = u2, t5 = u2);
return l3;
}
for (u2 = d2(e8, u2); z2 < h3.length; z2++)
q2 = C3(u2, e8, z2, h3[z2], k3), null !== q2 && (a2 && null !== q2.alternate && u2.delete(null === q2.key ? z2 : q2.key), g3 = f2(q2, g3, z2), null === t5 ? l3 = q2 : t5.sibling = q2, t5 = q2);
a2 && u2.forEach(function(a3) {
return b2(e8, a3);
});
return l3;
}
function w2(e8, g3, h3, k3) {
var l3 = La$1(h3);
if ("function" !== typeof l3)
throw Error(y$b(150));
h3 = l3.call(h3);
if (null == h3)
throw Error(y$b(151));
for (var t5 = l3 = null, u2 = g3, z2 = g3 = 0, q2 = null, n3 = h3.next(); null !== u2 && !n3.done; z2++, n3 = h3.next()) {
u2.index > z2 ? (q2 = u2, u2 = null) : q2 = u2.sibling;
var w3 = p2(e8, u2, n3.value, k3);
if (null === w3) {
null === u2 && (u2 = q2);
break;
}
a2 && u2 && null === w3.alternate && b2(e8, u2);
g3 = f2(w3, g3, z2);
null === t5 ? l3 = w3 : t5.sibling = w3;
t5 = w3;
u2 = q2;
}
if (n3.done)
return c2(e8, u2), l3;
if (null === u2) {
for (; !n3.done; z2++, n3 = h3.next())
n3 = A5(e8, n3.value, k3), null !== n3 && (g3 = f2(n3, g3, z2), null === t5 ? l3 = n3 : t5.sibling = n3, t5 = n3);
return l3;
}
for (u2 = d2(e8, u2); !n3.done; z2++, n3 = h3.next())
n3 = C3(u2, e8, z2, n3.value, k3), null !== n3 && (a2 && null !== n3.alternate && u2.delete(null === n3.key ? z2 : n3.key), g3 = f2(n3, g3, z2), null === t5 ? l3 = n3 : t5.sibling = n3, t5 = n3);
a2 && u2.forEach(function(a3) {
return b2(e8, a3);
});
return l3;
}
return function(a3, d3, f3, h3) {
var k3 = "object" === typeof f3 && null !== f3 && f3.type === ua$1 && null === f3.key;
k3 && (f3 = f3.props.children);
var l3 = "object" === typeof f3 && null !== f3;
if (l3)
switch (f3.$$typeof) {
case sa$2:
a: {
l3 = f3.key;
for (k3 = d3; null !== k3; ) {
if (k3.key === l3) {
switch (k3.tag) {
case 7:
if (f3.type === ua$1) {
c2(a3, k3.sibling);
d3 = e7(k3, f3.props.children);
d3.return = a3;
a3 = d3;
break a;
}
break;
default:
if (k3.elementType === f3.type) {
c2(a3, k3.sibling);
d3 = e7(k3, f3.props);
d3.ref = Qg(a3, k3, f3);
d3.return = a3;
a3 = d3;
break a;
}
}
c2(a3, k3);
break;
} else
b2(a3, k3);
k3 = k3.sibling;
}
f3.type === ua$1 ? (d3 = Xg(f3.props.children, a3.mode, h3, f3.key), d3.return = a3, a3 = d3) : (h3 = Vg(f3.type, f3.key, f3.props, null, a3.mode, h3), h3.ref = Qg(a3, d3, f3), h3.return = a3, a3 = h3);
}
return g2(a3);
case ta$1:
a: {
for (k3 = f3.key; null !== d3; ) {
if (d3.key === k3)
if (4 === d3.tag && d3.stateNode.containerInfo === f3.containerInfo && d3.stateNode.implementation === f3.implementation) {
c2(a3, d3.sibling);
d3 = e7(d3, f3.children || []);
d3.return = a3;
a3 = d3;
break a;
} else {
c2(a3, d3);
break;
}
else
b2(a3, d3);
d3 = d3.sibling;
}
d3 = Wg(f3, a3.mode, h3);
d3.return = a3;
a3 = d3;
}
return g2(a3);
}
if ("string" === typeof f3 || "number" === typeof f3)
return f3 = "" + f3, null !== d3 && 6 === d3.tag ? (c2(a3, d3.sibling), d3 = e7(d3, f3), d3.return = a3, a3 = d3) : (c2(a3, d3), d3 = Ug(f3, a3.mode, h3), d3.return = a3, a3 = d3), g2(a3);
if (Pg(f3))
return x2(a3, d3, f3, h3);
if (La$1(f3))
return w2(a3, d3, f3, h3);
l3 && Rg(a3, f3);
if ("undefined" === typeof f3 && !k3)
switch (a3.tag) {
case 1:
case 22:
case 0:
case 11:
case 15:
throw Error(y$b(152, Ra$1(a3.type) || "Component"));
}
return c2(a3, d3);
};
}
var Yg = Sg(true), Zg = Sg(false), $g = {}, ah = Bf($g), bh = Bf($g), ch$1 = Bf($g);
function dh(a2) {
if (a2 === $g)
throw Error(y$b(174));
return a2;
}
function eh(a2, b2) {
I$3(ch$1, b2);
I$3(bh, a2);
I$3(ah, $g);
a2 = b2.nodeType;
switch (a2) {
case 9:
case 11:
b2 = (b2 = b2.documentElement) ? b2.namespaceURI : mb$1(null, "");
break;
default:
a2 = 8 === a2 ? b2.parentNode : b2, b2 = a2.namespaceURI || null, a2 = a2.tagName, b2 = mb$1(b2, a2);
}
H$2(ah);
I$3(ah, b2);
}
function fh() {
H$2(ah);
H$2(bh);
H$2(ch$1);
}
function gh(a2) {
dh(ch$1.current);
var b2 = dh(ah.current);
var c2 = mb$1(b2, a2.type);
b2 !== c2 && (I$3(bh, a2), I$3(ah, c2));
}
function hh(a2) {
bh.current === a2 && (H$2(ah), H$2(bh));
}
var P$3 = Bf(0);
function ih(a2) {
for (var b2 = a2; null !== b2; ) {
if (13 === b2.tag) {
var c2 = b2.memoizedState;
if (null !== c2 && (c2 = c2.dehydrated, null === c2 || "$?" === c2.data || "$!" === c2.data))
return b2;
} else if (19 === b2.tag && void 0 !== b2.memoizedProps.revealOrder) {
if (0 !== (b2.flags & 64))
return b2;
} else if (null !== b2.child) {
b2.child.return = b2;
b2 = b2.child;
continue;
}
if (b2 === a2)
break;
for (; null === b2.sibling; ) {
if (null === b2.return || b2.return === a2)
return null;
b2 = b2.return;
}
b2.sibling.return = b2.return;
b2 = b2.sibling;
}
return null;
}
var jh = null, kh = null, lh = false;
function mh(a2, b2) {
var c2 = nh(5, null, null, 0);
c2.elementType = "DELETED";
c2.type = "DELETED";
c2.stateNode = b2;
c2.return = a2;
c2.flags = 8;
null !== a2.lastEffect ? (a2.lastEffect.nextEffect = c2, a2.lastEffect = c2) : a2.firstEffect = a2.lastEffect = c2;
}
function oh(a2, b2) {
switch (a2.tag) {
case 5:
var c2 = a2.type;
b2 = 1 !== b2.nodeType || c2.toLowerCase() !== b2.nodeName.toLowerCase() ? null : b2;
return null !== b2 ? (a2.stateNode = b2, true) : false;
case 6:
return b2 = "" === a2.pendingProps || 3 !== b2.nodeType ? null : b2, null !== b2 ? (a2.stateNode = b2, true) : false;
case 13:
return false;
default:
return false;
}
}
function ph(a2) {
if (lh) {
var b2 = kh;
if (b2) {
var c2 = b2;
if (!oh(a2, b2)) {
b2 = rf(c2.nextSibling);
if (!b2 || !oh(a2, b2)) {
a2.flags = a2.flags & -1025 | 2;
lh = false;
jh = a2;
return;
}
mh(jh, c2);
}
jh = a2;
kh = rf(b2.firstChild);
} else
a2.flags = a2.flags & -1025 | 2, lh = false, jh = a2;
}
}
function qh(a2) {
for (a2 = a2.return; null !== a2 && 5 !== a2.tag && 3 !== a2.tag && 13 !== a2.tag; )
a2 = a2.return;
jh = a2;
}
function rh(a2) {
if (a2 !== jh)
return false;
if (!lh)
return qh(a2), lh = true, false;
var b2 = a2.type;
if (5 !== a2.tag || "head" !== b2 && "body" !== b2 && !nf(b2, a2.memoizedProps))
for (b2 = kh; b2; )
mh(a2, b2), b2 = rf(b2.nextSibling);
qh(a2);
if (13 === a2.tag) {
a2 = a2.memoizedState;
a2 = null !== a2 ? a2.dehydrated : null;
if (!a2)
throw Error(y$b(317));
a: {
a2 = a2.nextSibling;
for (b2 = 0; a2; ) {
if (8 === a2.nodeType) {
var c2 = a2.data;
if ("/$" === c2) {
if (0 === b2) {
kh = rf(a2.nextSibling);
break a;
}
b2--;
} else
"$" !== c2 && "$!" !== c2 && "$?" !== c2 || b2++;
}
a2 = a2.nextSibling;
}
kh = null;
}
} else
kh = jh ? rf(a2.stateNode.nextSibling) : null;
return true;
}
function sh() {
kh = jh = null;
lh = false;
}
var th = [];
function uh() {
for (var a2 = 0; a2 < th.length; a2++)
th[a2]._workInProgressVersionPrimary = null;
th.length = 0;
}
var vh = ra$1.ReactCurrentDispatcher, wh = ra$1.ReactCurrentBatchConfig, xh = 0, R$3 = null, S$4 = null, T$5 = null, yh$1 = false, zh = false;
function Ah() {
throw Error(y$b(321));
}
function Bh(a2, b2) {
if (null === b2)
return false;
for (var c2 = 0; c2 < b2.length && c2 < a2.length; c2++)
if (!He$1(a2[c2], b2[c2]))
return false;
return true;
}
function Ch(a2, b2, c2, d2, e7, f2) {
xh = f2;
R$3 = b2;
b2.memoizedState = null;
b2.updateQueue = null;
b2.lanes = 0;
vh.current = null === a2 || null === a2.memoizedState ? Dh : Eh;
a2 = c2(d2, e7);
if (zh) {
f2 = 0;
do {
zh = false;
if (!(25 > f2))
throw Error(y$b(301));
f2 += 1;
T$5 = S$4 = null;
b2.updateQueue = null;
vh.current = Fh;
a2 = c2(d2, e7);
} while (zh);
}
vh.current = Gh;
b2 = null !== S$4 && null !== S$4.next;
xh = 0;
T$5 = S$4 = R$3 = null;
yh$1 = false;
if (b2)
throw Error(y$b(300));
return a2;
}
function Hh() {
var a2 = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
null === T$5 ? R$3.memoizedState = T$5 = a2 : T$5 = T$5.next = a2;
return T$5;
}
function Ih() {
if (null === S$4) {
var a2 = R$3.alternate;
a2 = null !== a2 ? a2.memoizedState : null;
} else
a2 = S$4.next;
var b2 = null === T$5 ? R$3.memoizedState : T$5.next;
if (null !== b2)
T$5 = b2, S$4 = a2;
else {
if (null === a2)
throw Error(y$b(310));
S$4 = a2;
a2 = { memoizedState: S$4.memoizedState, baseState: S$4.baseState, baseQueue: S$4.baseQueue, queue: S$4.queue, next: null };
null === T$5 ? R$3.memoizedState = T$5 = a2 : T$5 = T$5.next = a2;
}
return T$5;
}
function Jh(a2, b2) {
return "function" === typeof b2 ? b2(a2) : b2;
}
function Kh(a2) {
var b2 = Ih(), c2 = b2.queue;
if (null === c2)
throw Error(y$b(311));
c2.lastRenderedReducer = a2;
var d2 = S$4, e7 = d2.baseQueue, f2 = c2.pending;
if (null !== f2) {
if (null !== e7) {
var g2 = e7.next;
e7.next = f2.next;
f2.next = g2;
}
d2.baseQueue = e7 = f2;
c2.pending = null;
}
if (null !== e7) {
e7 = e7.next;
d2 = d2.baseState;
var h2 = g2 = f2 = null, k2 = e7;
do {
var l2 = k2.lane;
if ((xh & l2) === l2)
null !== h2 && (h2 = h2.next = { lane: 0, action: k2.action, eagerReducer: k2.eagerReducer, eagerState: k2.eagerState, next: null }), d2 = k2.eagerReducer === a2 ? k2.eagerState : a2(d2, k2.action);
else {
var n2 = {
lane: l2,
action: k2.action,
eagerReducer: k2.eagerReducer,
eagerState: k2.eagerState,
next: null
};
null === h2 ? (g2 = h2 = n2, f2 = d2) : h2 = h2.next = n2;
R$3.lanes |= l2;
Dg |= l2;
}
k2 = k2.next;
} while (null !== k2 && k2 !== e7);
null === h2 ? f2 = d2 : h2.next = g2;
He$1(d2, b2.memoizedState) || (ug = true);
b2.memoizedState = d2;
b2.baseState = f2;
b2.baseQueue = h2;
c2.lastRenderedState = d2;
}
return [b2.memoizedState, c2.dispatch];
}
function Lh(a2) {
var b2 = Ih(), c2 = b2.queue;
if (null === c2)
throw Error(y$b(311));
c2.lastRenderedReducer = a2;
var d2 = c2.dispatch, e7 = c2.pending, f2 = b2.memoizedState;
if (null !== e7) {
c2.pending = null;
var g2 = e7 = e7.next;
do
f2 = a2(f2, g2.action), g2 = g2.next;
while (g2 !== e7);
He$1(f2, b2.memoizedState) || (ug = true);
b2.memoizedState = f2;
null === b2.baseQueue && (b2.baseState = f2);
c2.lastRenderedState = f2;
}
return [f2, d2];
}
function Mh(a2, b2, c2) {
var d2 = b2._getVersion;
d2 = d2(b2._source);
var e7 = b2._workInProgressVersionPrimary;
if (null !== e7)
a2 = e7 === d2;
else if (a2 = a2.mutableReadLanes, a2 = (xh & a2) === a2)
b2._workInProgressVersionPrimary = d2, th.push(b2);
if (a2)
return c2(b2._source);
th.push(b2);
throw Error(y$b(350));
}
function Nh(a2, b2, c2, d2) {
var e7 = U$4;
if (null === e7)
throw Error(y$b(349));
var f2 = b2._getVersion, g2 = f2(b2._source), h2 = vh.current, k2 = h2.useState(function() {
return Mh(e7, b2, c2);
}), l2 = k2[1], n2 = k2[0];
k2 = T$5;
var A5 = a2.memoizedState, p2 = A5.refs, C3 = p2.getSnapshot, x2 = A5.source;
A5 = A5.subscribe;
var w2 = R$3;
a2.memoizedState = { refs: p2, source: b2, subscribe: d2 };
h2.useEffect(function() {
p2.getSnapshot = c2;
p2.setSnapshot = l2;
var a3 = f2(b2._source);
if (!He$1(g2, a3)) {
a3 = c2(b2._source);
He$1(n2, a3) || (l2(a3), a3 = Ig(w2), e7.mutableReadLanes |= a3 & e7.pendingLanes);
a3 = e7.mutableReadLanes;
e7.entangledLanes |= a3;
for (var d3 = e7.entanglements, h3 = a3; 0 < h3; ) {
var k3 = 31 - Vc$1(h3), v2 = 1 << k3;
d3[k3] |= a3;
h3 &= ~v2;
}
}
}, [c2, b2, d2]);
h2.useEffect(function() {
return d2(b2._source, function() {
var a3 = p2.getSnapshot, c3 = p2.setSnapshot;
try {
c3(a3(b2._source));
var d3 = Ig(w2);
e7.mutableReadLanes |= d3 & e7.pendingLanes;
} catch (q2) {
c3(function() {
throw q2;
});
}
});
}, [b2, d2]);
He$1(C3, c2) && He$1(x2, b2) && He$1(A5, d2) || (a2 = { pending: null, dispatch: null, lastRenderedReducer: Jh, lastRenderedState: n2 }, a2.dispatch = l2 = Oh.bind(null, R$3, a2), k2.queue = a2, k2.baseQueue = null, n2 = Mh(e7, b2, c2), k2.memoizedState = k2.baseState = n2);
return n2;
}
function Ph(a2, b2, c2) {
var d2 = Ih();
return Nh(d2, a2, b2, c2);
}
function Qh(a2) {
var b2 = Hh();
"function" === typeof a2 && (a2 = a2());
b2.memoizedState = b2.baseState = a2;
a2 = b2.queue = { pending: null, dispatch: null, lastRenderedReducer: Jh, lastRenderedState: a2 };
a2 = a2.dispatch = Oh.bind(null, R$3, a2);
return [b2.memoizedState, a2];
}
function Rh(a2, b2, c2, d2) {
a2 = { tag: a2, create: b2, destroy: c2, deps: d2, next: null };
b2 = R$3.updateQueue;
null === b2 ? (b2 = { lastEffect: null }, R$3.updateQueue = b2, b2.lastEffect = a2.next = a2) : (c2 = b2.lastEffect, null === c2 ? b2.lastEffect = a2.next = a2 : (d2 = c2.next, c2.next = a2, a2.next = d2, b2.lastEffect = a2));
return a2;
}
function Sh(a2) {
var b2 = Hh();
a2 = { current: a2 };
return b2.memoizedState = a2;
}
function Th() {
return Ih().memoizedState;
}
function Uh(a2, b2, c2, d2) {
var e7 = Hh();
R$3.flags |= a2;
e7.memoizedState = Rh(1 | b2, c2, void 0, void 0 === d2 ? null : d2);
}
function Vh(a2, b2, c2, d2) {
var e7 = Ih();
d2 = void 0 === d2 ? null : d2;
var f2 = void 0;
if (null !== S$4) {
var g2 = S$4.memoizedState;
f2 = g2.destroy;
if (null !== d2 && Bh(d2, g2.deps)) {
Rh(b2, c2, f2, d2);
return;
}
}
R$3.flags |= a2;
e7.memoizedState = Rh(1 | b2, c2, f2, d2);
}
function Wh(a2, b2) {
return Uh(516, 4, a2, b2);
}
function Xh(a2, b2) {
return Vh(516, 4, a2, b2);
}
function Yh(a2, b2) {
return Vh(4, 2, a2, b2);
}
function Zh(a2, b2) {
if ("function" === typeof b2)
return a2 = a2(), b2(a2), function() {
b2(null);
};
if (null !== b2 && void 0 !== b2)
return a2 = a2(), b2.current = a2, function() {
b2.current = null;
};
}
function $h(a2, b2, c2) {
c2 = null !== c2 && void 0 !== c2 ? c2.concat([a2]) : null;
return Vh(4, 2, Zh.bind(null, b2, a2), c2);
}
function ai$1() {
}
function bi$1(a2, b2) {
var c2 = Ih();
b2 = void 0 === b2 ? null : b2;
var d2 = c2.memoizedState;
if (null !== d2 && null !== b2 && Bh(b2, d2[1]))
return d2[0];
c2.memoizedState = [a2, b2];
return a2;
}
function ci$1(a2, b2) {
var c2 = Ih();
b2 = void 0 === b2 ? null : b2;
var d2 = c2.memoizedState;
if (null !== d2 && null !== b2 && Bh(b2, d2[1]))
return d2[0];
a2 = a2();
c2.memoizedState = [a2, b2];
return a2;
}
function di$1(a2, b2) {
var c2 = eg$1();
gg(98 > c2 ? 98 : c2, function() {
a2(true);
});
gg(97 < c2 ? 97 : c2, function() {
var c3 = wh.transition;
wh.transition = 1;
try {
a2(false), b2();
} finally {
wh.transition = c3;
}
});
}
function Oh(a2, b2, c2) {
var d2 = Hg(), e7 = Ig(a2), f2 = { lane: e7, action: c2, eagerReducer: null, eagerState: null, next: null }, g2 = b2.pending;
null === g2 ? f2.next = f2 : (f2.next = g2.next, g2.next = f2);
b2.pending = f2;
g2 = a2.alternate;
if (a2 === R$3 || null !== g2 && g2 === R$3)
zh = yh$1 = true;
else {
if (0 === a2.lanes && (null === g2 || 0 === g2.lanes) && (g2 = b2.lastRenderedReducer, null !== g2))
try {
var h2 = b2.lastRenderedState, k2 = g2(h2, c2);
f2.eagerReducer = g2;
f2.eagerState = k2;
if (He$1(k2, h2))
return;
} catch (l2) {
} finally {
}
Jg(a2, e7, d2);
}
}
var Gh = { readContext: vg, useCallback: Ah, useContext: Ah, useEffect: Ah, useImperativeHandle: Ah, useLayoutEffect: Ah, useMemo: Ah, useReducer: Ah, useRef: Ah, useState: Ah, useDebugValue: Ah, useDeferredValue: Ah, useTransition: Ah, useMutableSource: Ah, useOpaqueIdentifier: Ah, unstable_isNewReconciler: false }, Dh = { readContext: vg, useCallback: function(a2, b2) {
Hh().memoizedState = [a2, void 0 === b2 ? null : b2];
return a2;
}, useContext: vg, useEffect: Wh, useImperativeHandle: function(a2, b2, c2) {
c2 = null !== c2 && void 0 !== c2 ? c2.concat([a2]) : null;
return Uh(4, 2, Zh.bind(
null,
b2,
a2
), c2);
}, useLayoutEffect: function(a2, b2) {
return Uh(4, 2, a2, b2);
}, useMemo: function(a2, b2) {
var c2 = Hh();
b2 = void 0 === b2 ? null : b2;
a2 = a2();
c2.memoizedState = [a2, b2];
return a2;
}, useReducer: function(a2, b2, c2) {
var d2 = Hh();
b2 = void 0 !== c2 ? c2(b2) : b2;
d2.memoizedState = d2.baseState = b2;
a2 = d2.queue = { pending: null, dispatch: null, lastRenderedReducer: a2, lastRenderedState: b2 };
a2 = a2.dispatch = Oh.bind(null, R$3, a2);
return [d2.memoizedState, a2];
}, useRef: Sh, useState: Qh, useDebugValue: ai$1, useDeferredValue: function(a2) {
var b2 = Qh(a2), c2 = b2[0], d2 = b2[1];
Wh(function() {
var b3 = wh.transition;
wh.transition = 1;
try {
d2(a2);
} finally {
wh.transition = b3;
}
}, [a2]);
return c2;
}, useTransition: function() {
var a2 = Qh(false), b2 = a2[0];
a2 = di$1.bind(null, a2[1]);
Sh(a2);
return [a2, b2];
}, useMutableSource: function(a2, b2, c2) {
var d2 = Hh();
d2.memoizedState = { refs: { getSnapshot: b2, setSnapshot: null }, source: a2, subscribe: c2 };
return Nh(d2, a2, b2, c2);
}, useOpaqueIdentifier: function() {
if (lh) {
var a2 = false, b2 = uf(function() {
a2 || (a2 = true, c2("r:" + (tf++).toString(36)));
throw Error(y$b(355));
}), c2 = Qh(b2)[1];
0 === (R$3.mode & 2) && (R$3.flags |= 516, Rh(
5,
function() {
c2("r:" + (tf++).toString(36));
},
void 0,
null
));
return b2;
}
b2 = "r:" + (tf++).toString(36);
Qh(b2);
return b2;
}, unstable_isNewReconciler: false }, Eh = { readContext: vg, useCallback: bi$1, useContext: vg, useEffect: Xh, useImperativeHandle: $h, useLayoutEffect: Yh, useMemo: ci$1, useReducer: Kh, useRef: Th, useState: function() {
return Kh(Jh);
}, useDebugValue: ai$1, useDeferredValue: function(a2) {
var b2 = Kh(Jh), c2 = b2[0], d2 = b2[1];
Xh(function() {
var b3 = wh.transition;
wh.transition = 1;
try {
d2(a2);
} finally {
wh.transition = b3;
}
}, [a2]);
return c2;
}, useTransition: function() {
var a2 = Kh(Jh)[0];
return [
Th().current,
a2
];
}, useMutableSource: Ph, useOpaqueIdentifier: function() {
return Kh(Jh)[0];
}, unstable_isNewReconciler: false }, Fh = { readContext: vg, useCallback: bi$1, useContext: vg, useEffect: Xh, useImperativeHandle: $h, useLayoutEffect: Yh, useMemo: ci$1, useReducer: Lh, useRef: Th, useState: function() {
return Lh(Jh);
}, useDebugValue: ai$1, useDeferredValue: function(a2) {
var b2 = Lh(Jh), c2 = b2[0], d2 = b2[1];
Xh(function() {
var b3 = wh.transition;
wh.transition = 1;
try {
d2(a2);
} finally {
wh.transition = b3;
}
}, [a2]);
return c2;
}, useTransition: function() {
var a2 = Lh(Jh)[0];
return [
Th().current,
a2
];
}, useMutableSource: Ph, useOpaqueIdentifier: function() {
return Lh(Jh)[0];
}, unstable_isNewReconciler: false }, ei$1 = ra$1.ReactCurrentOwner, ug = false;
function fi$1(a2, b2, c2, d2) {
b2.child = null === a2 ? Zg(b2, null, c2, d2) : Yg(b2, a2.child, c2, d2);
}
function gi$1(a2, b2, c2, d2, e7) {
c2 = c2.render;
var f2 = b2.ref;
tg$1(b2, e7);
d2 = Ch(a2, b2, c2, d2, f2, e7);
if (null !== a2 && !ug)
return b2.updateQueue = a2.updateQueue, b2.flags &= -517, a2.lanes &= ~e7, hi$1(a2, b2, e7);
b2.flags |= 1;
fi$1(a2, b2, d2, e7);
return b2.child;
}
function ii$1(a2, b2, c2, d2, e7, f2) {
if (null === a2) {
var g2 = c2.type;
if ("function" === typeof g2 && !ji$1(g2) && void 0 === g2.defaultProps && null === c2.compare && void 0 === c2.defaultProps)
return b2.tag = 15, b2.type = g2, ki$1(a2, b2, g2, d2, e7, f2);
a2 = Vg(c2.type, null, d2, b2, b2.mode, f2);
a2.ref = b2.ref;
a2.return = b2;
return b2.child = a2;
}
g2 = a2.child;
if (0 === (e7 & f2) && (e7 = g2.memoizedProps, c2 = c2.compare, c2 = null !== c2 ? c2 : Je$1, c2(e7, d2) && a2.ref === b2.ref))
return hi$1(a2, b2, f2);
b2.flags |= 1;
a2 = Tg(g2, d2);
a2.ref = b2.ref;
a2.return = b2;
return b2.child = a2;
}
function ki$1(a2, b2, c2, d2, e7, f2) {
if (null !== a2 && Je$1(a2.memoizedProps, d2) && a2.ref === b2.ref)
if (ug = false, 0 !== (f2 & e7))
0 !== (a2.flags & 16384) && (ug = true);
else
return b2.lanes = a2.lanes, hi$1(a2, b2, f2);
return li$1(a2, b2, c2, d2, f2);
}
function mi$1(a2, b2, c2) {
var d2 = b2.pendingProps, e7 = d2.children, f2 = null !== a2 ? a2.memoizedState : null;
if ("hidden" === d2.mode || "unstable-defer-without-hiding" === d2.mode)
if (0 === (b2.mode & 4))
b2.memoizedState = { baseLanes: 0 }, ni$1(b2, c2);
else if (0 !== (c2 & 1073741824))
b2.memoizedState = { baseLanes: 0 }, ni$1(b2, null !== f2 ? f2.baseLanes : c2);
else
return a2 = null !== f2 ? f2.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a2 }, ni$1(b2, a2), null;
else
null !== f2 ? (d2 = f2.baseLanes | c2, b2.memoizedState = null) : d2 = c2, ni$1(b2, d2);
fi$1(a2, b2, e7, c2);
return b2.child;
}
function oi$1(a2, b2) {
var c2 = b2.ref;
if (null === a2 && null !== c2 || null !== a2 && a2.ref !== c2)
b2.flags |= 128;
}
function li$1(a2, b2, c2, d2, e7) {
var f2 = Ff(c2) ? Df : M$9.current;
f2 = Ef(b2, f2);
tg$1(b2, e7);
c2 = Ch(a2, b2, c2, d2, f2, e7);
if (null !== a2 && !ug)
return b2.updateQueue = a2.updateQueue, b2.flags &= -517, a2.lanes &= ~e7, hi$1(a2, b2, e7);
b2.flags |= 1;
fi$1(a2, b2, c2, e7);
return b2.child;
}
function pi$5(a2, b2, c2, d2, e7) {
if (Ff(c2)) {
var f2 = true;
Jf(b2);
} else
f2 = false;
tg$1(b2, e7);
if (null === b2.stateNode)
null !== a2 && (a2.alternate = null, b2.alternate = null, b2.flags |= 2), Mg(b2, c2, d2), Og(b2, c2, d2, e7), d2 = true;
else if (null === a2) {
var g2 = b2.stateNode, h2 = b2.memoizedProps;
g2.props = h2;
var k2 = g2.context, l2 = c2.contextType;
"object" === typeof l2 && null !== l2 ? l2 = vg(l2) : (l2 = Ff(c2) ? Df : M$9.current, l2 = Ef(b2, l2));
var n2 = c2.getDerivedStateFromProps, A5 = "function" === typeof n2 || "function" === typeof g2.getSnapshotBeforeUpdate;
A5 || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== d2 || k2 !== l2) && Ng(b2, g2, d2, l2);
wg = false;
var p2 = b2.memoizedState;
g2.state = p2;
Cg(b2, d2, g2, e7);
k2 = b2.memoizedState;
h2 !== d2 || p2 !== k2 || N$4.current || wg ? ("function" === typeof n2 && (Gg(b2, c2, n2, d2), k2 = b2.memoizedState), (h2 = wg || Lg(b2, c2, h2, d2, p2, k2, l2)) ? (A5 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b2.flags |= 4)) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4), d2 = false);
} else {
g2 = b2.stateNode;
yg(a2, b2);
h2 = b2.memoizedProps;
l2 = b2.type === b2.elementType ? h2 : lg(b2.type, h2);
g2.props = l2;
A5 = b2.pendingProps;
p2 = g2.context;
k2 = c2.contextType;
"object" === typeof k2 && null !== k2 ? k2 = vg(k2) : (k2 = Ff(c2) ? Df : M$9.current, k2 = Ef(b2, k2));
var C3 = c2.getDerivedStateFromProps;
(n2 = "function" === typeof C3 || "function" === typeof g2.getSnapshotBeforeUpdate) || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== A5 || p2 !== k2) && Ng(b2, g2, d2, k2);
wg = false;
p2 = b2.memoizedState;
g2.state = p2;
Cg(b2, d2, g2, e7);
var x2 = b2.memoizedState;
h2 !== A5 || p2 !== x2 || N$4.current || wg ? ("function" === typeof C3 && (Gg(b2, c2, C3, d2), x2 = b2.memoizedState), (l2 = wg || Lg(b2, c2, l2, d2, p2, x2, k2)) ? (n2 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(
d2,
x2,
k2
), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, x2, k2)), "function" === typeof g2.componentDidUpdate && (b2.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b2.flags |= 256)) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && p2 === a2.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && p2 === a2.memoizedState || (b2.flags |= 256), b2.memoizedProps = d2, b2.memoizedState = x2), g2.props = d2, g2.state = x2, g2.context = k2, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && p2 === a2.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && p2 === a2.memoizedState || (b2.flags |= 256), d2 = false);
}
return qi$1(a2, b2, c2, d2, f2, e7);
}
function qi$1(a2, b2, c2, d2, e7, f2) {
oi$1(a2, b2);
var g2 = 0 !== (b2.flags & 64);
if (!d2 && !g2)
return e7 && Kf(b2, c2, false), hi$1(a2, b2, f2);
d2 = b2.stateNode;
ei$1.current = b2;
var h2 = g2 && "function" !== typeof c2.getDerivedStateFromError ? null : d2.render();
b2.flags |= 1;
null !== a2 && g2 ? (b2.child = Yg(b2, a2.child, null, f2), b2.child = Yg(b2, null, h2, f2)) : fi$1(a2, b2, h2, f2);
b2.memoizedState = d2.state;
e7 && Kf(b2, c2, true);
return b2.child;
}
function ri$1(a2) {
var b2 = a2.stateNode;
b2.pendingContext ? Hf(a2, b2.pendingContext, b2.pendingContext !== b2.context) : b2.context && Hf(a2, b2.context, false);
eh(a2, b2.containerInfo);
}
var si$1 = { dehydrated: null, retryLane: 0 };
function ti$1(a2, b2, c2) {
var d2 = b2.pendingProps, e7 = P$3.current, f2 = false, g2;
(g2 = 0 !== (b2.flags & 64)) || (g2 = null !== a2 && null === a2.memoizedState ? false : 0 !== (e7 & 2));
g2 ? (f2 = true, b2.flags &= -65) : null !== a2 && null === a2.memoizedState || void 0 === d2.fallback || true === d2.unstable_avoidThisFallback || (e7 |= 1);
I$3(P$3, e7 & 1);
if (null === a2) {
void 0 !== d2.fallback && ph(b2);
a2 = d2.children;
e7 = d2.fallback;
if (f2)
return a2 = ui$1(b2, a2, e7, c2), b2.child.memoizedState = { baseLanes: c2 }, b2.memoizedState = si$1, a2;
if ("number" === typeof d2.unstable_expectedLoadTime)
return a2 = ui$1(b2, a2, e7, c2), b2.child.memoizedState = { baseLanes: c2 }, b2.memoizedState = si$1, b2.lanes = 33554432, a2;
c2 = vi$2({ mode: "visible", children: a2 }, b2.mode, c2, null);
c2.return = b2;
return b2.child = c2;
}
if (null !== a2.memoizedState) {
if (f2)
return d2 = wi$1(a2, b2, d2.children, d2.fallback, c2), f2 = b2.child, e7 = a2.child.memoizedState, f2.memoizedState = null === e7 ? { baseLanes: c2 } : { baseLanes: e7.baseLanes | c2 }, f2.childLanes = a2.childLanes & ~c2, b2.memoizedState = si$1, d2;
c2 = xi$1(a2, b2, d2.children, c2);
b2.memoizedState = null;
return c2;
}
if (f2)
return d2 = wi$1(a2, b2, d2.children, d2.fallback, c2), f2 = b2.child, e7 = a2.child.memoizedState, f2.memoizedState = null === e7 ? { baseLanes: c2 } : { baseLanes: e7.baseLanes | c2 }, f2.childLanes = a2.childLanes & ~c2, b2.memoizedState = si$1, d2;
c2 = xi$1(a2, b2, d2.children, c2);
b2.memoizedState = null;
return c2;
}
function ui$1(a2, b2, c2, d2) {
var e7 = a2.mode, f2 = a2.child;
b2 = { mode: "hidden", children: b2 };
0 === (e7 & 2) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = b2) : f2 = vi$2(b2, e7, 0, null);
c2 = Xg(c2, e7, d2, null);
f2.return = a2;
c2.return = a2;
f2.sibling = c2;
a2.child = f2;
return c2;
}
function xi$1(a2, b2, c2, d2) {
var e7 = a2.child;
a2 = e7.sibling;
c2 = Tg(e7, { mode: "visible", children: c2 });
0 === (b2.mode & 2) && (c2.lanes = d2);
c2.return = b2;
c2.sibling = null;
null !== a2 && (a2.nextEffect = null, a2.flags = 8, b2.firstEffect = b2.lastEffect = a2);
return b2.child = c2;
}
function wi$1(a2, b2, c2, d2, e7) {
var f2 = b2.mode, g2 = a2.child;
a2 = g2.sibling;
var h2 = { mode: "hidden", children: c2 };
0 === (f2 & 2) && b2.child !== g2 ? (c2 = b2.child, c2.childLanes = 0, c2.pendingProps = h2, g2 = c2.lastEffect, null !== g2 ? (b2.firstEffect = c2.firstEffect, b2.lastEffect = g2, g2.nextEffect = null) : b2.firstEffect = b2.lastEffect = null) : c2 = Tg(g2, h2);
null !== a2 ? d2 = Tg(a2, d2) : (d2 = Xg(d2, f2, e7, null), d2.flags |= 2);
d2.return = b2;
c2.return = b2;
c2.sibling = d2;
b2.child = c2;
return d2;
}
function yi$1(a2, b2) {
a2.lanes |= b2;
var c2 = a2.alternate;
null !== c2 && (c2.lanes |= b2);
sg(a2.return, b2);
}
function zi$1(a2, b2, c2, d2, e7, f2) {
var g2 = a2.memoizedState;
null === g2 ? a2.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d2, tail: c2, tailMode: e7, lastEffect: f2 } : (g2.isBackwards = b2, g2.rendering = null, g2.renderingStartTime = 0, g2.last = d2, g2.tail = c2, g2.tailMode = e7, g2.lastEffect = f2);
}
function Ai$1(a2, b2, c2) {
var d2 = b2.pendingProps, e7 = d2.revealOrder, f2 = d2.tail;
fi$1(a2, b2, d2.children, c2);
d2 = P$3.current;
if (0 !== (d2 & 2))
d2 = d2 & 1 | 2, b2.flags |= 64;
else {
if (null !== a2 && 0 !== (a2.flags & 64))
a:
for (a2 = b2.child; null !== a2; ) {
if (13 === a2.tag)
null !== a2.memoizedState && yi$1(a2, c2);
else if (19 === a2.tag)
yi$1(a2, c2);
else if (null !== a2.child) {
a2.child.return = a2;
a2 = a2.child;
continue;
}
if (a2 === b2)
break a;
for (; null === a2.sibling; ) {
if (null === a2.return || a2.return === b2)
break a;
a2 = a2.return;
}
a2.sibling.return = a2.return;
a2 = a2.sibling;
}
d2 &= 1;
}
I$3(P$3, d2);
if (0 === (b2.mode & 2))
b2.memoizedState = null;
else
switch (e7) {
case "forwards":
c2 = b2.child;
for (e7 = null; null !== c2; )
a2 = c2.alternate, null !== a2 && null === ih(a2) && (e7 = c2), c2 = c2.sibling;
c2 = e7;
null === c2 ? (e7 = b2.child, b2.child = null) : (e7 = c2.sibling, c2.sibling = null);
zi$1(b2, false, e7, c2, f2, b2.lastEffect);
break;
case "backwards":
c2 = null;
e7 = b2.child;
for (b2.child = null; null !== e7; ) {
a2 = e7.alternate;
if (null !== a2 && null === ih(a2)) {
b2.child = e7;
break;
}
a2 = e7.sibling;
e7.sibling = c2;
c2 = e7;
e7 = a2;
}
zi$1(b2, true, c2, null, f2, b2.lastEffect);
break;
case "together":
zi$1(b2, false, null, null, void 0, b2.lastEffect);
break;
default:
b2.memoizedState = null;
}
return b2.child;
}
function hi$1(a2, b2, c2) {
null !== a2 && (b2.dependencies = a2.dependencies);
Dg |= b2.lanes;
if (0 !== (c2 & b2.childLanes)) {
if (null !== a2 && b2.child !== a2.child)
throw Error(y$b(153));
if (null !== b2.child) {
a2 = b2.child;
c2 = Tg(a2, a2.pendingProps);
b2.child = c2;
for (c2.return = b2; null !== a2.sibling; )
a2 = a2.sibling, c2 = c2.sibling = Tg(a2, a2.pendingProps), c2.return = b2;
c2.sibling = null;
}
return b2.child;
}
return null;
}
var Bi$1, Ci$1, Di$1, Ei$1;
Bi$1 = function(a2, b2) {
for (var c2 = b2.child; null !== c2; ) {
if (5 === c2.tag || 6 === c2.tag)
a2.appendChild(c2.stateNode);
else if (4 !== c2.tag && null !== c2.child) {
c2.child.return = c2;
c2 = c2.child;
continue;
}
if (c2 === b2)
break;
for (; null === c2.sibling; ) {
if (null === c2.return || c2.return === b2)
return;
c2 = c2.return;
}
c2.sibling.return = c2.return;
c2 = c2.sibling;
}
};
Ci$1 = function() {
};
Di$1 = function(a2, b2, c2, d2) {
var e7 = a2.memoizedProps;
if (e7 !== d2) {
a2 = b2.stateNode;
dh(ah.current);
var f2 = null;
switch (c2) {
case "input":
e7 = Ya$1(a2, e7);
d2 = Ya$1(a2, d2);
f2 = [];
break;
case "option":
e7 = eb(a2, e7);
d2 = eb(a2, d2);
f2 = [];
break;
case "select":
e7 = m$o({}, e7, { value: void 0 });
d2 = m$o({}, d2, { value: void 0 });
f2 = [];
break;
case "textarea":
e7 = gb(a2, e7);
d2 = gb(a2, d2);
f2 = [];
break;
default:
"function" !== typeof e7.onClick && "function" === typeof d2.onClick && (a2.onclick = jf);
}
vb(c2, d2);
var g2;
c2 = null;
for (l2 in e7)
if (!d2.hasOwnProperty(l2) && e7.hasOwnProperty(l2) && null != e7[l2])
if ("style" === l2) {
var h2 = e7[l2];
for (g2 in h2)
h2.hasOwnProperty(g2) && (c2 || (c2 = {}), c2[g2] = "");
} else
"dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ca$1.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null));
for (l2 in d2) {
var k2 = d2[l2];
h2 = null != e7 ? e7[l2] : void 0;
if (d2.hasOwnProperty(l2) && k2 !== h2 && (null != k2 || null != h2))
if ("style" === l2)
if (h2) {
for (g2 in h2)
!h2.hasOwnProperty(g2) || k2 && k2.hasOwnProperty(g2) || (c2 || (c2 = {}), c2[g2] = "");
for (g2 in k2)
k2.hasOwnProperty(g2) && h2[g2] !== k2[g2] && (c2 || (c2 = {}), c2[g2] = k2[g2]);
} else
c2 || (f2 || (f2 = []), f2.push(l2, c2)), c2 = k2;
else
"dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h2 = h2 ? h2.__html : void 0, null != k2 && h2 !== k2 && (f2 = f2 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f2 = f2 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ca$1.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && G$3("scroll", a2), f2 || h2 === k2 || (f2 = [])) : "object" === typeof k2 && null !== k2 && k2.$$typeof === Ga$1 ? k2.toString() : (f2 = f2 || []).push(l2, k2));
}
c2 && (f2 = f2 || []).push(
"style",
c2
);
var l2 = f2;
if (b2.updateQueue = l2)
b2.flags |= 4;
}
};
Ei$1 = function(a2, b2, c2, d2) {
c2 !== d2 && (b2.flags |= 4);
};
function Fi$1(a2, b2) {
if (!lh)
switch (a2.tailMode) {
case "hidden":
b2 = a2.tail;
for (var c2 = null; null !== b2; )
null !== b2.alternate && (c2 = b2), b2 = b2.sibling;
null === c2 ? a2.tail = null : c2.sibling = null;
break;
case "collapsed":
c2 = a2.tail;
for (var d2 = null; null !== c2; )
null !== c2.alternate && (d2 = c2), c2 = c2.sibling;
null === d2 ? b2 || null === a2.tail ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null;
}
}
function Gi$1(a2, b2, c2) {
var d2 = b2.pendingProps;
switch (b2.tag) {
case 2:
case 16:
case 15:
case 0:
case 11:
case 7:
case 8:
case 12:
case 9:
case 14:
return null;
case 1:
return Ff(b2.type) && Gf(), null;
case 3:
fh();
H$2(N$4);
H$2(M$9);
uh();
d2 = b2.stateNode;
d2.pendingContext && (d2.context = d2.pendingContext, d2.pendingContext = null);
if (null === a2 || null === a2.child)
rh(b2) ? b2.flags |= 4 : d2.hydrate || (b2.flags |= 256);
Ci$1(b2);
return null;
case 5:
hh(b2);
var e7 = dh(ch$1.current);
c2 = b2.type;
if (null !== a2 && null != b2.stateNode)
Di$1(a2, b2, c2, d2, e7), a2.ref !== b2.ref && (b2.flags |= 128);
else {
if (!d2) {
if (null === b2.stateNode)
throw Error(y$b(166));
return null;
}
a2 = dh(ah.current);
if (rh(b2)) {
d2 = b2.stateNode;
c2 = b2.type;
var f2 = b2.memoizedProps;
d2[wf] = b2;
d2[xf$1] = f2;
switch (c2) {
case "dialog":
G$3("cancel", d2);
G$3("close", d2);
break;
case "iframe":
case "object":
case "embed":
G$3("load", d2);
break;
case "video":
case "audio":
for (a2 = 0; a2 < Xe$1.length; a2++)
G$3(Xe$1[a2], d2);
break;
case "source":
G$3("error", d2);
break;
case "img":
case "image":
case "link":
G$3("error", d2);
G$3("load", d2);
break;
case "details":
G$3("toggle", d2);
break;
case "input":
Za$1(d2, f2);
G$3("invalid", d2);
break;
case "select":
d2._wrapperState = { wasMultiple: !!f2.multiple };
G$3("invalid", d2);
break;
case "textarea":
hb(d2, f2), G$3("invalid", d2);
}
vb(c2, f2);
a2 = null;
for (var g2 in f2)
f2.hasOwnProperty(g2) && (e7 = f2[g2], "children" === g2 ? "string" === typeof e7 ? d2.textContent !== e7 && (a2 = ["children", e7]) : "number" === typeof e7 && d2.textContent !== "" + e7 && (a2 = ["children", "" + e7]) : ca$1.hasOwnProperty(g2) && null != e7 && "onScroll" === g2 && G$3("scroll", d2));
switch (c2) {
case "input":
Va$1(d2);
cb(d2, f2, true);
break;
case "textarea":
Va$1(d2);
jb(d2);
break;
case "select":
case "option":
break;
default:
"function" === typeof f2.onClick && (d2.onclick = jf);
}
d2 = a2;
b2.updateQueue = d2;
null !== d2 && (b2.flags |= 4);
} else {
g2 = 9 === e7.nodeType ? e7 : e7.ownerDocument;
a2 === kb.html && (a2 = lb(c2));
a2 === kb.html ? "script" === c2 ? (a2 = g2.createElement("div"), a2.innerHTML = "<script><\/script>", a2 = a2.removeChild(a2.firstChild)) : "string" === typeof d2.is ? a2 = g2.createElement(c2, { is: d2.is }) : (a2 = g2.createElement(c2), "select" === c2 && (g2 = a2, d2.multiple ? g2.multiple = true : d2.size && (g2.size = d2.size))) : a2 = g2.createElementNS(a2, c2);
a2[wf] = b2;
a2[xf$1] = d2;
Bi$1(a2, b2, false, false);
b2.stateNode = a2;
g2 = wb(c2, d2);
switch (c2) {
case "dialog":
G$3("cancel", a2);
G$3("close", a2);
e7 = d2;
break;
case "iframe":
case "object":
case "embed":
G$3("load", a2);
e7 = d2;
break;
case "video":
case "audio":
for (e7 = 0; e7 < Xe$1.length; e7++)
G$3(Xe$1[e7], a2);
e7 = d2;
break;
case "source":
G$3("error", a2);
e7 = d2;
break;
case "img":
case "image":
case "link":
G$3("error", a2);
G$3("load", a2);
e7 = d2;
break;
case "details":
G$3("toggle", a2);
e7 = d2;
break;
case "input":
Za$1(a2, d2);
e7 = Ya$1(a2, d2);
G$3("invalid", a2);
break;
case "option":
e7 = eb(a2, d2);
break;
case "select":
a2._wrapperState = { wasMultiple: !!d2.multiple };
e7 = m$o({}, d2, { value: void 0 });
G$3("invalid", a2);
break;
case "textarea":
hb(a2, d2);
e7 = gb(a2, d2);
G$3("invalid", a2);
break;
default:
e7 = d2;
}
vb(c2, e7);
var h2 = e7;
for (f2 in h2)
if (h2.hasOwnProperty(f2)) {
var k2 = h2[f2];
"style" === f2 ? tb(a2, k2) : "dangerouslySetInnerHTML" === f2 ? (k2 = k2 ? k2.__html : void 0, null != k2 && ob(a2, k2)) : "children" === f2 ? "string" === typeof k2 ? ("textarea" !== c2 || "" !== k2) && pb(a2, k2) : "number" === typeof k2 && pb(a2, "" + k2) : "suppressContentEditableWarning" !== f2 && "suppressHydrationWarning" !== f2 && "autoFocus" !== f2 && (ca$1.hasOwnProperty(f2) ? null != k2 && "onScroll" === f2 && G$3("scroll", a2) : null != k2 && qa$1(a2, f2, k2, g2));
}
switch (c2) {
case "input":
Va$1(a2);
cb(a2, d2, false);
break;
case "textarea":
Va$1(a2);
jb(a2);
break;
case "option":
null != d2.value && a2.setAttribute("value", "" + Sa$1(d2.value));
break;
case "select":
a2.multiple = !!d2.multiple;
f2 = d2.value;
null != f2 ? fb(a2, !!d2.multiple, f2, false) : null != d2.defaultValue && fb(a2, !!d2.multiple, d2.defaultValue, true);
break;
default:
"function" === typeof e7.onClick && (a2.onclick = jf);
}
mf(c2, d2) && (b2.flags |= 4);
}
null !== b2.ref && (b2.flags |= 128);
}
return null;
case 6:
if (a2 && null != b2.stateNode)
Ei$1(a2, b2, a2.memoizedProps, d2);
else {
if ("string" !== typeof d2 && null === b2.stateNode)
throw Error(y$b(166));
c2 = dh(ch$1.current);
dh(ah.current);
rh(b2) ? (d2 = b2.stateNode, c2 = b2.memoizedProps, d2[wf] = b2, d2.nodeValue !== c2 && (b2.flags |= 4)) : (d2 = (9 === c2.nodeType ? c2 : c2.ownerDocument).createTextNode(d2), d2[wf] = b2, b2.stateNode = d2);
}
return null;
case 13:
H$2(P$3);
d2 = b2.memoizedState;
if (0 !== (b2.flags & 64))
return b2.lanes = c2, b2;
d2 = null !== d2;
c2 = false;
null === a2 ? void 0 !== b2.memoizedProps.fallback && rh(b2) : c2 = null !== a2.memoizedState;
if (d2 && !c2 && 0 !== (b2.mode & 2))
if (null === a2 && true !== b2.memoizedProps.unstable_avoidThisFallback || 0 !== (P$3.current & 1))
0 === V$4 && (V$4 = 3);
else {
if (0 === V$4 || 3 === V$4)
V$4 = 4;
null === U$4 || 0 === (Dg & 134217727) && 0 === (Hi$1 & 134217727) || Ii$1(U$4, W$2);
}
if (d2 || c2)
b2.flags |= 4;
return null;
case 4:
return fh(), Ci$1(b2), null === a2 && cf(b2.stateNode.containerInfo), null;
case 10:
return rg(b2), null;
case 17:
return Ff(b2.type) && Gf(), null;
case 19:
H$2(P$3);
d2 = b2.memoizedState;
if (null === d2)
return null;
f2 = 0 !== (b2.flags & 64);
g2 = d2.rendering;
if (null === g2)
if (f2)
Fi$1(d2, false);
else {
if (0 !== V$4 || null !== a2 && 0 !== (a2.flags & 64))
for (a2 = b2.child; null !== a2; ) {
g2 = ih(a2);
if (null !== g2) {
b2.flags |= 64;
Fi$1(d2, false);
f2 = g2.updateQueue;
null !== f2 && (b2.updateQueue = f2, b2.flags |= 4);
null === d2.lastEffect && (b2.firstEffect = null);
b2.lastEffect = d2.lastEffect;
d2 = c2;
for (c2 = b2.child; null !== c2; )
f2 = c2, a2 = d2, f2.flags &= 2, f2.nextEffect = null, f2.firstEffect = null, f2.lastEffect = null, g2 = f2.alternate, null === g2 ? (f2.childLanes = 0, f2.lanes = a2, f2.child = null, f2.memoizedProps = null, f2.memoizedState = null, f2.updateQueue = null, f2.dependencies = null, f2.stateNode = null) : (f2.childLanes = g2.childLanes, f2.lanes = g2.lanes, f2.child = g2.child, f2.memoizedProps = g2.memoizedProps, f2.memoizedState = g2.memoizedState, f2.updateQueue = g2.updateQueue, f2.type = g2.type, a2 = g2.dependencies, f2.dependencies = null === a2 ? null : { lanes: a2.lanes, firstContext: a2.firstContext }), c2 = c2.sibling;
I$3(P$3, P$3.current & 1 | 2);
return b2.child;
}
a2 = a2.sibling;
}
null !== d2.tail && O$4() > Ji$1 && (b2.flags |= 64, f2 = true, Fi$1(d2, false), b2.lanes = 33554432);
}
else {
if (!f2)
if (a2 = ih(g2), null !== a2) {
if (b2.flags |= 64, f2 = true, c2 = a2.updateQueue, null !== c2 && (b2.updateQueue = c2, b2.flags |= 4), Fi$1(d2, true), null === d2.tail && "hidden" === d2.tailMode && !g2.alternate && !lh)
return b2 = b2.lastEffect = d2.lastEffect, null !== b2 && (b2.nextEffect = null), null;
} else
2 * O$4() - d2.renderingStartTime > Ji$1 && 1073741824 !== c2 && (b2.flags |= 64, f2 = true, Fi$1(d2, false), b2.lanes = 33554432);
d2.isBackwards ? (g2.sibling = b2.child, b2.child = g2) : (c2 = d2.last, null !== c2 ? c2.sibling = g2 : b2.child = g2, d2.last = g2);
}
return null !== d2.tail ? (c2 = d2.tail, d2.rendering = c2, d2.tail = c2.sibling, d2.lastEffect = b2.lastEffect, d2.renderingStartTime = O$4(), c2.sibling = null, b2 = P$3.current, I$3(P$3, f2 ? b2 & 1 | 2 : b2 & 1), c2) : null;
case 23:
case 24:
return Ki$1(), null !== a2 && null !== a2.memoizedState !== (null !== b2.memoizedState) && "unstable-defer-without-hiding" !== d2.mode && (b2.flags |= 4), null;
}
throw Error(y$b(156, b2.tag));
}
function Li$1(a2) {
switch (a2.tag) {
case 1:
Ff(a2.type) && Gf();
var b2 = a2.flags;
return b2 & 4096 ? (a2.flags = b2 & -4097 | 64, a2) : null;
case 3:
fh();
H$2(N$4);
H$2(M$9);
uh();
b2 = a2.flags;
if (0 !== (b2 & 64))
throw Error(y$b(285));
a2.flags = b2 & -4097 | 64;
return a2;
case 5:
return hh(a2), null;
case 13:
return H$2(P$3), b2 = a2.flags, b2 & 4096 ? (a2.flags = b2 & -4097 | 64, a2) : null;
case 19:
return H$2(P$3), null;
case 4:
return fh(), null;
case 10:
return rg(a2), null;
case 23:
case 24:
return Ki$1(), null;
default:
return null;
}
}
function Mi$1(a2, b2) {
try {
var c2 = "", d2 = b2;
do
c2 += Qa$1(d2), d2 = d2.return;
while (d2);
var e7 = c2;
} catch (f2) {
e7 = "\nError generating stack: " + f2.message + "\n" + f2.stack;
}
return { value: a2, source: b2, stack: e7 };
}
function Ni$1(a2, b2) {
try {
console.error(b2.value);
} catch (c2) {
setTimeout(function() {
throw c2;
});
}
}
var Oi$1 = "function" === typeof WeakMap ? WeakMap : Map;
function Pi$1(a2, b2, c2) {
c2 = zg(-1, c2);
c2.tag = 3;
c2.payload = { element: null };
var d2 = b2.value;
c2.callback = function() {
Qi$1 || (Qi$1 = true, Ri$1 = d2);
Ni$1(a2, b2);
};
return c2;
}
function Si$1(a2, b2, c2) {
c2 = zg(-1, c2);
c2.tag = 3;
var d2 = a2.type.getDerivedStateFromError;
if ("function" === typeof d2) {
var e7 = b2.value;
c2.payload = function() {
Ni$1(a2, b2);
return d2(e7);
};
}
var f2 = a2.stateNode;
null !== f2 && "function" === typeof f2.componentDidCatch && (c2.callback = function() {
"function" !== typeof d2 && (null === Ti$1 ? Ti$1 = /* @__PURE__ */ new Set([this]) : Ti$1.add(this), Ni$1(a2, b2));
var c3 = b2.stack;
this.componentDidCatch(b2.value, { componentStack: null !== c3 ? c3 : "" });
});
return c2;
}
var Ui$1 = "function" === typeof WeakSet ? WeakSet : Set;
function Vi$1(a2) {
var b2 = a2.ref;
if (null !== b2)
if ("function" === typeof b2)
try {
b2(null);
} catch (c2) {
Wi$1(a2, c2);
}
else
b2.current = null;
}
function Xi$1(a2, b2) {
switch (b2.tag) {
case 0:
case 11:
case 15:
case 22:
return;
case 1:
if (b2.flags & 256 && null !== a2) {
var c2 = a2.memoizedProps, d2 = a2.memoizedState;
a2 = b2.stateNode;
b2 = a2.getSnapshotBeforeUpdate(b2.elementType === b2.type ? c2 : lg(b2.type, c2), d2);
a2.__reactInternalSnapshotBeforeUpdate = b2;
}
return;
case 3:
b2.flags & 256 && qf(b2.stateNode.containerInfo);
return;
case 5:
case 6:
case 4:
case 17:
return;
}
throw Error(y$b(163));
}
function Yi$1(a2, b2, c2) {
switch (c2.tag) {
case 0:
case 11:
case 15:
case 22:
b2 = c2.updateQueue;
b2 = null !== b2 ? b2.lastEffect : null;
if (null !== b2) {
a2 = b2 = b2.next;
do {
if (3 === (a2.tag & 3)) {
var d2 = a2.create;
a2.destroy = d2();
}
a2 = a2.next;
} while (a2 !== b2);
}
b2 = c2.updateQueue;
b2 = null !== b2 ? b2.lastEffect : null;
if (null !== b2) {
a2 = b2 = b2.next;
do {
var e7 = a2;
d2 = e7.next;
e7 = e7.tag;
0 !== (e7 & 4) && 0 !== (e7 & 1) && (Zi$1(c2, a2), $i$1(c2, a2));
a2 = d2;
} while (a2 !== b2);
}
return;
case 1:
a2 = c2.stateNode;
c2.flags & 4 && (null === b2 ? a2.componentDidMount() : (d2 = c2.elementType === c2.type ? b2.memoizedProps : lg(c2.type, b2.memoizedProps), a2.componentDidUpdate(
d2,
b2.memoizedState,
a2.__reactInternalSnapshotBeforeUpdate
)));
b2 = c2.updateQueue;
null !== b2 && Eg(c2, b2, a2);
return;
case 3:
b2 = c2.updateQueue;
if (null !== b2) {
a2 = null;
if (null !== c2.child)
switch (c2.child.tag) {
case 5:
a2 = c2.child.stateNode;
break;
case 1:
a2 = c2.child.stateNode;
}
Eg(c2, b2, a2);
}
return;
case 5:
a2 = c2.stateNode;
null === b2 && c2.flags & 4 && mf(c2.type, c2.memoizedProps) && a2.focus();
return;
case 6:
return;
case 4:
return;
case 12:
return;
case 13:
null === c2.memoizedState && (c2 = c2.alternate, null !== c2 && (c2 = c2.memoizedState, null !== c2 && (c2 = c2.dehydrated, null !== c2 && Cc$1(c2))));
return;
case 19:
case 17:
case 20:
case 21:
case 23:
case 24:
return;
}
throw Error(y$b(163));
}
function aj(a2, b2) {
for (var c2 = a2; ; ) {
if (5 === c2.tag) {
var d2 = c2.stateNode;
if (b2)
d2 = d2.style, "function" === typeof d2.setProperty ? d2.setProperty("display", "none", "important") : d2.display = "none";
else {
d2 = c2.stateNode;
var e7 = c2.memoizedProps.style;
e7 = void 0 !== e7 && null !== e7 && e7.hasOwnProperty("display") ? e7.display : null;
d2.style.display = sb("display", e7);
}
} else if (6 === c2.tag)
c2.stateNode.nodeValue = b2 ? "" : c2.memoizedProps;
else if ((23 !== c2.tag && 24 !== c2.tag || null === c2.memoizedState || c2 === a2) && null !== c2.child) {
c2.child.return = c2;
c2 = c2.child;
continue;
}
if (c2 === a2)
break;
for (; null === c2.sibling; ) {
if (null === c2.return || c2.return === a2)
return;
c2 = c2.return;
}
c2.sibling.return = c2.return;
c2 = c2.sibling;
}
}
function bj(a2, b2) {
if (Mf && "function" === typeof Mf.onCommitFiberUnmount)
try {
Mf.onCommitFiberUnmount(Lf, b2);
} catch (f2) {
}
switch (b2.tag) {
case 0:
case 11:
case 14:
case 15:
case 22:
a2 = b2.updateQueue;
if (null !== a2 && (a2 = a2.lastEffect, null !== a2)) {
var c2 = a2 = a2.next;
do {
var d2 = c2, e7 = d2.destroy;
d2 = d2.tag;
if (void 0 !== e7)
if (0 !== (d2 & 4))
Zi$1(b2, c2);
else {
d2 = b2;
try {
e7();
} catch (f2) {
Wi$1(d2, f2);
}
}
c2 = c2.next;
} while (c2 !== a2);
}
break;
case 1:
Vi$1(b2);
a2 = b2.stateNode;
if ("function" === typeof a2.componentWillUnmount)
try {
a2.props = b2.memoizedProps, a2.state = b2.memoizedState, a2.componentWillUnmount();
} catch (f2) {
Wi$1(
b2,
f2
);
}
break;
case 5:
Vi$1(b2);
break;
case 4:
cj(a2, b2);
}
}
function dj(a2) {
a2.alternate = null;
a2.child = null;
a2.dependencies = null;
a2.firstEffect = null;
a2.lastEffect = null;
a2.memoizedProps = null;
a2.memoizedState = null;
a2.pendingProps = null;
a2.return = null;
a2.updateQueue = null;
}
function ej(a2) {
return 5 === a2.tag || 3 === a2.tag || 4 === a2.tag;
}
function fj(a2) {
a: {
for (var b2 = a2.return; null !== b2; ) {
if (ej(b2))
break a;
b2 = b2.return;
}
throw Error(y$b(160));
}
var c2 = b2;
b2 = c2.stateNode;
switch (c2.tag) {
case 5:
var d2 = false;
break;
case 3:
b2 = b2.containerInfo;
d2 = true;
break;
case 4:
b2 = b2.containerInfo;
d2 = true;
break;
default:
throw Error(y$b(161));
}
c2.flags & 16 && (pb(b2, ""), c2.flags &= -17);
a:
b:
for (c2 = a2; ; ) {
for (; null === c2.sibling; ) {
if (null === c2.return || ej(c2.return)) {
c2 = null;
break a;
}
c2 = c2.return;
}
c2.sibling.return = c2.return;
for (c2 = c2.sibling; 5 !== c2.tag && 6 !== c2.tag && 18 !== c2.tag; ) {
if (c2.flags & 2)
continue b;
if (null === c2.child || 4 === c2.tag)
continue b;
else
c2.child.return = c2, c2 = c2.child;
}
if (!(c2.flags & 2)) {
c2 = c2.stateNode;
break a;
}
}
d2 ? gj(a2, c2, b2) : hj(a2, c2, b2);
}
function gj(a2, b2, c2) {
var d2 = a2.tag, e7 = 5 === d2 || 6 === d2;
if (e7)
a2 = e7 ? a2.stateNode : a2.stateNode.instance, b2 ? 8 === c2.nodeType ? c2.parentNode.insertBefore(a2, b2) : c2.insertBefore(a2, b2) : (8 === c2.nodeType ? (b2 = c2.parentNode, b2.insertBefore(a2, c2)) : (b2 = c2, b2.appendChild(a2)), c2 = c2._reactRootContainer, null !== c2 && void 0 !== c2 || null !== b2.onclick || (b2.onclick = jf));
else if (4 !== d2 && (a2 = a2.child, null !== a2))
for (gj(a2, b2, c2), a2 = a2.sibling; null !== a2; )
gj(a2, b2, c2), a2 = a2.sibling;
}
function hj(a2, b2, c2) {
var d2 = a2.tag, e7 = 5 === d2 || 6 === d2;
if (e7)
a2 = e7 ? a2.stateNode : a2.stateNode.instance, b2 ? c2.insertBefore(a2, b2) : c2.appendChild(a2);
else if (4 !== d2 && (a2 = a2.child, null !== a2))
for (hj(a2, b2, c2), a2 = a2.sibling; null !== a2; )
hj(a2, b2, c2), a2 = a2.sibling;
}
function cj(a2, b2) {
for (var c2 = b2, d2 = false, e7, f2; ; ) {
if (!d2) {
d2 = c2.return;
a:
for (; ; ) {
if (null === d2)
throw Error(y$b(160));
e7 = d2.stateNode;
switch (d2.tag) {
case 5:
f2 = false;
break a;
case 3:
e7 = e7.containerInfo;
f2 = true;
break a;
case 4:
e7 = e7.containerInfo;
f2 = true;
break a;
}
d2 = d2.return;
}
d2 = true;
}
if (5 === c2.tag || 6 === c2.tag) {
a:
for (var g2 = a2, h2 = c2, k2 = h2; ; )
if (bj(g2, k2), null !== k2.child && 4 !== k2.tag)
k2.child.return = k2, k2 = k2.child;
else {
if (k2 === h2)
break a;
for (; null === k2.sibling; ) {
if (null === k2.return || k2.return === h2)
break a;
k2 = k2.return;
}
k2.sibling.return = k2.return;
k2 = k2.sibling;
}
f2 ? (g2 = e7, h2 = c2.stateNode, 8 === g2.nodeType ? g2.parentNode.removeChild(h2) : g2.removeChild(h2)) : e7.removeChild(c2.stateNode);
} else if (4 === c2.tag) {
if (null !== c2.child) {
e7 = c2.stateNode.containerInfo;
f2 = true;
c2.child.return = c2;
c2 = c2.child;
continue;
}
} else if (bj(a2, c2), null !== c2.child) {
c2.child.return = c2;
c2 = c2.child;
continue;
}
if (c2 === b2)
break;
for (; null === c2.sibling; ) {
if (null === c2.return || c2.return === b2)
return;
c2 = c2.return;
4 === c2.tag && (d2 = false);
}
c2.sibling.return = c2.return;
c2 = c2.sibling;
}
}
function ij(a2, b2) {
switch (b2.tag) {
case 0:
case 11:
case 14:
case 15:
case 22:
var c2 = b2.updateQueue;
c2 = null !== c2 ? c2.lastEffect : null;
if (null !== c2) {
var d2 = c2 = c2.next;
do
3 === (d2.tag & 3) && (a2 = d2.destroy, d2.destroy = void 0, void 0 !== a2 && a2()), d2 = d2.next;
while (d2 !== c2);
}
return;
case 1:
return;
case 5:
c2 = b2.stateNode;
if (null != c2) {
d2 = b2.memoizedProps;
var e7 = null !== a2 ? a2.memoizedProps : d2;
a2 = b2.type;
var f2 = b2.updateQueue;
b2.updateQueue = null;
if (null !== f2) {
c2[xf$1] = d2;
"input" === a2 && "radio" === d2.type && null != d2.name && $a$1(c2, d2);
wb(a2, e7);
b2 = wb(a2, d2);
for (e7 = 0; e7 < f2.length; e7 += 2) {
var g2 = f2[e7], h2 = f2[e7 + 1];
"style" === g2 ? tb(c2, h2) : "dangerouslySetInnerHTML" === g2 ? ob(c2, h2) : "children" === g2 ? pb(c2, h2) : qa$1(c2, g2, h2, b2);
}
switch (a2) {
case "input":
ab(c2, d2);
break;
case "textarea":
ib(c2, d2);
break;
case "select":
a2 = c2._wrapperState.wasMultiple, c2._wrapperState.wasMultiple = !!d2.multiple, f2 = d2.value, null != f2 ? fb(c2, !!d2.multiple, f2, false) : a2 !== !!d2.multiple && (null != d2.defaultValue ? fb(c2, !!d2.multiple, d2.defaultValue, true) : fb(c2, !!d2.multiple, d2.multiple ? [] : "", false));
}
}
}
return;
case 6:
if (null === b2.stateNode)
throw Error(y$b(162));
b2.stateNode.nodeValue = b2.memoizedProps;
return;
case 3:
c2 = b2.stateNode;
c2.hydrate && (c2.hydrate = false, Cc$1(c2.containerInfo));
return;
case 12:
return;
case 13:
null !== b2.memoizedState && (jj = O$4(), aj(b2.child, true));
kj(b2);
return;
case 19:
kj(b2);
return;
case 17:
return;
case 23:
case 24:
aj(b2, null !== b2.memoizedState);
return;
}
throw Error(y$b(163));
}
function kj(a2) {
var b2 = a2.updateQueue;
if (null !== b2) {
a2.updateQueue = null;
var c2 = a2.stateNode;
null === c2 && (c2 = a2.stateNode = new Ui$1());
b2.forEach(function(b3) {
var d2 = lj.bind(null, a2, b3);
c2.has(b3) || (c2.add(b3), b3.then(d2, d2));
});
}
}
function mj(a2, b2) {
return null !== a2 && (a2 = a2.memoizedState, null === a2 || null !== a2.dehydrated) ? (b2 = b2.memoizedState, null !== b2 && null === b2.dehydrated) : false;
}
var nj = Math.ceil, oj = ra$1.ReactCurrentDispatcher, pj = ra$1.ReactCurrentOwner, X$4 = 0, U$4 = null, Y$4 = null, W$2 = 0, qj = 0, rj = Bf(0), V$4 = 0, sj = null, tj = 0, Dg = 0, Hi$1 = 0, uj = 0, vj = null, jj = 0, Ji$1 = Infinity;
function wj() {
Ji$1 = O$4() + 500;
}
var Z$3 = null, Qi$1 = false, Ri$1 = null, Ti$1 = null, xj = false, yj = null, zj = 90, Aj = [], Bj = [], Cj = null, Dj = 0, Ej = null, Fj = -1, Gj = 0, Hj = 0, Ij = null, Jj = false;
function Hg() {
return 0 !== (X$4 & 48) ? O$4() : -1 !== Fj ? Fj : Fj = O$4();
}
function Ig(a2) {
a2 = a2.mode;
if (0 === (a2 & 2))
return 1;
if (0 === (a2 & 4))
return 99 === eg$1() ? 1 : 2;
0 === Gj && (Gj = tj);
if (0 !== kg.transition) {
0 !== Hj && (Hj = null !== vj ? vj.pendingLanes : 0);
a2 = Gj;
var b2 = 4186112 & ~Hj;
b2 &= -b2;
0 === b2 && (a2 = 4186112 & ~a2, b2 = a2 & -a2, 0 === b2 && (b2 = 8192));
return b2;
}
a2 = eg$1();
0 !== (X$4 & 4) && 98 === a2 ? a2 = Xc$1(12, Gj) : (a2 = Sc$1(a2), a2 = Xc$1(a2, Gj));
return a2;
}
function Jg(a2, b2, c2) {
if (50 < Dj)
throw Dj = 0, Ej = null, Error(y$b(185));
a2 = Kj(a2, b2);
if (null === a2)
return null;
$c$1(a2, b2, c2);
a2 === U$4 && (Hi$1 |= b2, 4 === V$4 && Ii$1(a2, W$2));
var d2 = eg$1();
1 === b2 ? 0 !== (X$4 & 8) && 0 === (X$4 & 48) ? Lj(a2) : (Mj(a2, c2), 0 === X$4 && (wj(), ig())) : (0 === (X$4 & 4) || 98 !== d2 && 99 !== d2 || (null === Cj ? Cj = /* @__PURE__ */ new Set([a2]) : Cj.add(a2)), Mj(a2, c2));
vj = a2;
}
function Kj(a2, b2) {
a2.lanes |= b2;
var c2 = a2.alternate;
null !== c2 && (c2.lanes |= b2);
c2 = a2;
for (a2 = a2.return; null !== a2; )
a2.childLanes |= b2, c2 = a2.alternate, null !== c2 && (c2.childLanes |= b2), c2 = a2, a2 = a2.return;
return 3 === c2.tag ? c2.stateNode : null;
}
function Mj(a2, b2) {
for (var c2 = a2.callbackNode, d2 = a2.suspendedLanes, e7 = a2.pingedLanes, f2 = a2.expirationTimes, g2 = a2.pendingLanes; 0 < g2; ) {
var h2 = 31 - Vc$1(g2), k2 = 1 << h2, l2 = f2[h2];
if (-1 === l2) {
if (0 === (k2 & d2) || 0 !== (k2 & e7)) {
l2 = b2;
Rc$1(k2);
var n2 = F$4;
f2[h2] = 10 <= n2 ? l2 + 250 : 6 <= n2 ? l2 + 5e3 : -1;
}
} else
l2 <= b2 && (a2.expiredLanes |= k2);
g2 &= ~k2;
}
d2 = Uc$1(a2, a2 === U$4 ? W$2 : 0);
b2 = F$4;
if (0 === d2)
null !== c2 && (c2 !== Zf && Pf(c2), a2.callbackNode = null, a2.callbackPriority = 0);
else {
if (null !== c2) {
if (a2.callbackPriority === b2)
return;
c2 !== Zf && Pf(c2);
}
15 === b2 ? (c2 = Lj.bind(null, a2), null === ag ? (ag = [c2], bg = Of(Uf, jg)) : ag.push(c2), c2 = Zf) : 14 === b2 ? c2 = hg(99, Lj.bind(null, a2)) : (c2 = Tc$1(b2), c2 = hg(c2, Nj.bind(null, a2)));
a2.callbackPriority = b2;
a2.callbackNode = c2;
}
}
function Nj(a2) {
Fj = -1;
Hj = Gj = 0;
if (0 !== (X$4 & 48))
throw Error(y$b(327));
var b2 = a2.callbackNode;
if (Oj() && a2.callbackNode !== b2)
return null;
var c2 = Uc$1(a2, a2 === U$4 ? W$2 : 0);
if (0 === c2)
return null;
var d2 = c2;
var e7 = X$4;
X$4 |= 16;
var f2 = Pj();
if (U$4 !== a2 || W$2 !== d2)
wj(), Qj(a2, d2);
do
try {
Rj();
break;
} catch (h2) {
Sj(a2, h2);
}
while (1);
qg();
oj.current = f2;
X$4 = e7;
null !== Y$4 ? d2 = 0 : (U$4 = null, W$2 = 0, d2 = V$4);
if (0 !== (tj & Hi$1))
Qj(a2, 0);
else if (0 !== d2) {
2 === d2 && (X$4 |= 64, a2.hydrate && (a2.hydrate = false, qf(a2.containerInfo)), c2 = Wc$1(a2), 0 !== c2 && (d2 = Tj(a2, c2)));
if (1 === d2)
throw b2 = sj, Qj(a2, 0), Ii$1(a2, c2), Mj(a2, O$4()), b2;
a2.finishedWork = a2.current.alternate;
a2.finishedLanes = c2;
switch (d2) {
case 0:
case 1:
throw Error(y$b(345));
case 2:
Uj(a2);
break;
case 3:
Ii$1(a2, c2);
if ((c2 & 62914560) === c2 && (d2 = jj + 500 - O$4(), 10 < d2)) {
if (0 !== Uc$1(a2, 0))
break;
e7 = a2.suspendedLanes;
if ((e7 & c2) !== c2) {
Hg();
a2.pingedLanes |= a2.suspendedLanes & e7;
break;
}
a2.timeoutHandle = of(Uj.bind(null, a2), d2);
break;
}
Uj(a2);
break;
case 4:
Ii$1(a2, c2);
if ((c2 & 4186112) === c2)
break;
d2 = a2.eventTimes;
for (e7 = -1; 0 < c2; ) {
var g2 = 31 - Vc$1(c2);
f2 = 1 << g2;
g2 = d2[g2];
g2 > e7 && (e7 = g2);
c2 &= ~f2;
}
c2 = e7;
c2 = O$4() - c2;
c2 = (120 > c2 ? 120 : 480 > c2 ? 480 : 1080 > c2 ? 1080 : 1920 > c2 ? 1920 : 3e3 > c2 ? 3e3 : 4320 > c2 ? 4320 : 1960 * nj(c2 / 1960)) - c2;
if (10 < c2) {
a2.timeoutHandle = of(Uj.bind(null, a2), c2);
break;
}
Uj(a2);
break;
case 5:
Uj(a2);
break;
default:
throw Error(y$b(329));
}
}
Mj(a2, O$4());
return a2.callbackNode === b2 ? Nj.bind(null, a2) : null;
}
function Ii$1(a2, b2) {
b2 &= ~uj;
b2 &= ~Hi$1;
a2.suspendedLanes |= b2;
a2.pingedLanes &= ~b2;
for (a2 = a2.expirationTimes; 0 < b2; ) {
var c2 = 31 - Vc$1(b2), d2 = 1 << c2;
a2[c2] = -1;
b2 &= ~d2;
}
}
function Lj(a2) {
if (0 !== (X$4 & 48))
throw Error(y$b(327));
Oj();
if (a2 === U$4 && 0 !== (a2.expiredLanes & W$2)) {
var b2 = W$2;
var c2 = Tj(a2, b2);
0 !== (tj & Hi$1) && (b2 = Uc$1(a2, b2), c2 = Tj(a2, b2));
} else
b2 = Uc$1(a2, 0), c2 = Tj(a2, b2);
0 !== a2.tag && 2 === c2 && (X$4 |= 64, a2.hydrate && (a2.hydrate = false, qf(a2.containerInfo)), b2 = Wc$1(a2), 0 !== b2 && (c2 = Tj(a2, b2)));
if (1 === c2)
throw c2 = sj, Qj(a2, 0), Ii$1(a2, b2), Mj(a2, O$4()), c2;
a2.finishedWork = a2.current.alternate;
a2.finishedLanes = b2;
Uj(a2);
Mj(a2, O$4());
return null;
}
function Vj() {
if (null !== Cj) {
var a2 = Cj;
Cj = null;
a2.forEach(function(a3) {
a3.expiredLanes |= 24 & a3.pendingLanes;
Mj(a3, O$4());
});
}
ig();
}
function Wj(a2, b2) {
var c2 = X$4;
X$4 |= 1;
try {
return a2(b2);
} finally {
X$4 = c2, 0 === X$4 && (wj(), ig());
}
}
function Xj(a2, b2) {
var c2 = X$4;
X$4 &= -2;
X$4 |= 8;
try {
return a2(b2);
} finally {
X$4 = c2, 0 === X$4 && (wj(), ig());
}
}
function ni$1(a2, b2) {
I$3(rj, qj);
qj |= b2;
tj |= b2;
}
function Ki$1() {
qj = rj.current;
H$2(rj);
}
function Qj(a2, b2) {
a2.finishedWork = null;
a2.finishedLanes = 0;
var c2 = a2.timeoutHandle;
-1 !== c2 && (a2.timeoutHandle = -1, pf(c2));
if (null !== Y$4)
for (c2 = Y$4.return; null !== c2; ) {
var d2 = c2;
switch (d2.tag) {
case 1:
d2 = d2.type.childContextTypes;
null !== d2 && void 0 !== d2 && Gf();
break;
case 3:
fh();
H$2(N$4);
H$2(M$9);
uh();
break;
case 5:
hh(d2);
break;
case 4:
fh();
break;
case 13:
H$2(P$3);
break;
case 19:
H$2(P$3);
break;
case 10:
rg(d2);
break;
case 23:
case 24:
Ki$1();
}
c2 = c2.return;
}
U$4 = a2;
Y$4 = Tg(a2.current, null);
W$2 = qj = tj = b2;
V$4 = 0;
sj = null;
uj = Hi$1 = Dg = 0;
}
function Sj(a2, b2) {
do {
var c2 = Y$4;
try {
qg();
vh.current = Gh;
if (yh$1) {
for (var d2 = R$3.memoizedState; null !== d2; ) {
var e7 = d2.queue;
null !== e7 && (e7.pending = null);
d2 = d2.next;
}
yh$1 = false;
}
xh = 0;
T$5 = S$4 = R$3 = null;
zh = false;
pj.current = null;
if (null === c2 || null === c2.return) {
V$4 = 1;
sj = b2;
Y$4 = null;
break;
}
a: {
var f2 = a2, g2 = c2.return, h2 = c2, k2 = b2;
b2 = W$2;
h2.flags |= 2048;
h2.firstEffect = h2.lastEffect = null;
if (null !== k2 && "object" === typeof k2 && "function" === typeof k2.then) {
var l2 = k2;
if (0 === (h2.mode & 2)) {
var n2 = h2.alternate;
n2 ? (h2.updateQueue = n2.updateQueue, h2.memoizedState = n2.memoizedState, h2.lanes = n2.lanes) : (h2.updateQueue = null, h2.memoizedState = null);
}
var A5 = 0 !== (P$3.current & 1), p2 = g2;
do {
var C3;
if (C3 = 13 === p2.tag) {
var x2 = p2.memoizedState;
if (null !== x2)
C3 = null !== x2.dehydrated ? true : false;
else {
var w2 = p2.memoizedProps;
C3 = void 0 === w2.fallback ? false : true !== w2.unstable_avoidThisFallback ? true : A5 ? false : true;
}
}
if (C3) {
var z2 = p2.updateQueue;
if (null === z2) {
var u2 = /* @__PURE__ */ new Set();
u2.add(l2);
p2.updateQueue = u2;
} else
z2.add(l2);
if (0 === (p2.mode & 2)) {
p2.flags |= 64;
h2.flags |= 16384;
h2.flags &= -2981;
if (1 === h2.tag)
if (null === h2.alternate)
h2.tag = 17;
else {
var t5 = zg(-1, 1);
t5.tag = 2;
Ag(h2, t5);
}
h2.lanes |= 1;
break a;
}
k2 = void 0;
h2 = b2;
var q2 = f2.pingCache;
null === q2 ? (q2 = f2.pingCache = new Oi$1(), k2 = /* @__PURE__ */ new Set(), q2.set(l2, k2)) : (k2 = q2.get(l2), void 0 === k2 && (k2 = /* @__PURE__ */ new Set(), q2.set(l2, k2)));
if (!k2.has(h2)) {
k2.add(h2);
var v2 = Yj.bind(null, f2, l2, h2);
l2.then(v2, v2);
}
p2.flags |= 4096;
p2.lanes = b2;
break a;
}
p2 = p2.return;
} while (null !== p2);
k2 = Error((Ra$1(h2.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.");
}
5 !== V$4 && (V$4 = 2);
k2 = Mi$1(k2, h2);
p2 = g2;
do {
switch (p2.tag) {
case 3:
f2 = k2;
p2.flags |= 4096;
b2 &= -b2;
p2.lanes |= b2;
var J2 = Pi$1(p2, f2, b2);
Bg(p2, J2);
break a;
case 1:
f2 = k2;
var K2 = p2.type, Q2 = p2.stateNode;
if (0 === (p2.flags & 64) && ("function" === typeof K2.getDerivedStateFromError || null !== Q2 && "function" === typeof Q2.componentDidCatch && (null === Ti$1 || !Ti$1.has(Q2)))) {
p2.flags |= 4096;
b2 &= -b2;
p2.lanes |= b2;
var L2 = Si$1(p2, f2, b2);
Bg(p2, L2);
break a;
}
}
p2 = p2.return;
} while (null !== p2);
}
Zj(c2);
} catch (va2) {
b2 = va2;
Y$4 === c2 && null !== c2 && (Y$4 = c2 = c2.return);
continue;
}
break;
} while (1);
}
function Pj() {
var a2 = oj.current;
oj.current = Gh;
return null === a2 ? Gh : a2;
}
function Tj(a2, b2) {
var c2 = X$4;
X$4 |= 16;
var d2 = Pj();
U$4 === a2 && W$2 === b2 || Qj(a2, b2);
do
try {
ak();
break;
} catch (e7) {
Sj(a2, e7);
}
while (1);
qg();
X$4 = c2;
oj.current = d2;
if (null !== Y$4)
throw Error(y$b(261));
U$4 = null;
W$2 = 0;
return V$4;
}
function ak() {
for (; null !== Y$4; )
bk(Y$4);
}
function Rj() {
for (; null !== Y$4 && !Qf(); )
bk(Y$4);
}
function bk(a2) {
var b2 = ck(a2.alternate, a2, qj);
a2.memoizedProps = a2.pendingProps;
null === b2 ? Zj(a2) : Y$4 = b2;
pj.current = null;
}
function Zj(a2) {
var b2 = a2;
do {
var c2 = b2.alternate;
a2 = b2.return;
if (0 === (b2.flags & 2048)) {
c2 = Gi$1(c2, b2, qj);
if (null !== c2) {
Y$4 = c2;
return;
}
c2 = b2;
if (24 !== c2.tag && 23 !== c2.tag || null === c2.memoizedState || 0 !== (qj & 1073741824) || 0 === (c2.mode & 4)) {
for (var d2 = 0, e7 = c2.child; null !== e7; )
d2 |= e7.lanes | e7.childLanes, e7 = e7.sibling;
c2.childLanes = d2;
}
null !== a2 && 0 === (a2.flags & 2048) && (null === a2.firstEffect && (a2.firstEffect = b2.firstEffect), null !== b2.lastEffect && (null !== a2.lastEffect && (a2.lastEffect.nextEffect = b2.firstEffect), a2.lastEffect = b2.lastEffect), 1 < b2.flags && (null !== a2.lastEffect ? a2.lastEffect.nextEffect = b2 : a2.firstEffect = b2, a2.lastEffect = b2));
} else {
c2 = Li$1(b2);
if (null !== c2) {
c2.flags &= 2047;
Y$4 = c2;
return;
}
null !== a2 && (a2.firstEffect = a2.lastEffect = null, a2.flags |= 2048);
}
b2 = b2.sibling;
if (null !== b2) {
Y$4 = b2;
return;
}
Y$4 = b2 = a2;
} while (null !== b2);
0 === V$4 && (V$4 = 5);
}
function Uj(a2) {
var b2 = eg$1();
gg(99, dk.bind(null, a2, b2));
return null;
}
function dk(a2, b2) {
do
Oj();
while (null !== yj);
if (0 !== (X$4 & 48))
throw Error(y$b(327));
var c2 = a2.finishedWork;
if (null === c2)
return null;
a2.finishedWork = null;
a2.finishedLanes = 0;
if (c2 === a2.current)
throw Error(y$b(177));
a2.callbackNode = null;
var d2 = c2.lanes | c2.childLanes, e7 = d2, f2 = a2.pendingLanes & ~e7;
a2.pendingLanes = e7;
a2.suspendedLanes = 0;
a2.pingedLanes = 0;
a2.expiredLanes &= e7;
a2.mutableReadLanes &= e7;
a2.entangledLanes &= e7;
e7 = a2.entanglements;
for (var g2 = a2.eventTimes, h2 = a2.expirationTimes; 0 < f2; ) {
var k2 = 31 - Vc$1(f2), l2 = 1 << k2;
e7[k2] = 0;
g2[k2] = -1;
h2[k2] = -1;
f2 &= ~l2;
}
null !== Cj && 0 === (d2 & 24) && Cj.has(a2) && Cj.delete(a2);
a2 === U$4 && (Y$4 = U$4 = null, W$2 = 0);
1 < c2.flags ? null !== c2.lastEffect ? (c2.lastEffect.nextEffect = c2, d2 = c2.firstEffect) : d2 = c2 : d2 = c2.firstEffect;
if (null !== d2) {
e7 = X$4;
X$4 |= 32;
pj.current = null;
kf = fd$1;
g2 = Ne$2();
if (Oe$1(g2)) {
if ("selectionStart" in g2)
h2 = { start: g2.selectionStart, end: g2.selectionEnd };
else
a:
if (h2 = (h2 = g2.ownerDocument) && h2.defaultView || window, (l2 = h2.getSelection && h2.getSelection()) && 0 !== l2.rangeCount) {
h2 = l2.anchorNode;
f2 = l2.anchorOffset;
k2 = l2.focusNode;
l2 = l2.focusOffset;
try {
h2.nodeType, k2.nodeType;
} catch (va2) {
h2 = null;
break a;
}
var n2 = 0, A5 = -1, p2 = -1, C3 = 0, x2 = 0, w2 = g2, z2 = null;
b:
for (; ; ) {
for (var u2; ; ) {
w2 !== h2 || 0 !== f2 && 3 !== w2.nodeType || (A5 = n2 + f2);
w2 !== k2 || 0 !== l2 && 3 !== w2.nodeType || (p2 = n2 + l2);
3 === w2.nodeType && (n2 += w2.nodeValue.length);
if (null === (u2 = w2.firstChild))
break;
z2 = w2;
w2 = u2;
}
for (; ; ) {
if (w2 === g2)
break b;
z2 === h2 && ++C3 === f2 && (A5 = n2);
z2 === k2 && ++x2 === l2 && (p2 = n2);
if (null !== (u2 = w2.nextSibling))
break;
w2 = z2;
z2 = w2.parentNode;
}
w2 = u2;
}
h2 = -1 === A5 || -1 === p2 ? null : { start: A5, end: p2 };
} else
h2 = null;
h2 = h2 || { start: 0, end: 0 };
} else
h2 = null;
lf = { focusedElem: g2, selectionRange: h2 };
fd$1 = false;
Ij = null;
Jj = false;
Z$3 = d2;
do
try {
ek();
} catch (va2) {
if (null === Z$3)
throw Error(y$b(330));
Wi$1(Z$3, va2);
Z$3 = Z$3.nextEffect;
}
while (null !== Z$3);
Ij = null;
Z$3 = d2;
do
try {
for (g2 = a2; null !== Z$3; ) {
var t5 = Z$3.flags;
t5 & 16 && pb(Z$3.stateNode, "");
if (t5 & 128) {
var q2 = Z$3.alternate;
if (null !== q2) {
var v2 = q2.ref;
null !== v2 && ("function" === typeof v2 ? v2(null) : v2.current = null);
}
}
switch (t5 & 1038) {
case 2:
fj(Z$3);
Z$3.flags &= -3;
break;
case 6:
fj(Z$3);
Z$3.flags &= -3;
ij(Z$3.alternate, Z$3);
break;
case 1024:
Z$3.flags &= -1025;
break;
case 1028:
Z$3.flags &= -1025;
ij(Z$3.alternate, Z$3);
break;
case 4:
ij(Z$3.alternate, Z$3);
break;
case 8:
h2 = Z$3;
cj(g2, h2);
var J2 = h2.alternate;
dj(h2);
null !== J2 && dj(J2);
}
Z$3 = Z$3.nextEffect;
}
} catch (va2) {
if (null === Z$3)
throw Error(y$b(330));
Wi$1(Z$3, va2);
Z$3 = Z$3.nextEffect;
}
while (null !== Z$3);
v2 = lf;
q2 = Ne$2();
t5 = v2.focusedElem;
g2 = v2.selectionRange;
if (q2 !== t5 && t5 && t5.ownerDocument && Me$1(t5.ownerDocument.documentElement, t5)) {
null !== g2 && Oe$1(t5) && (q2 = g2.start, v2 = g2.end, void 0 === v2 && (v2 = q2), "selectionStart" in t5 ? (t5.selectionStart = q2, t5.selectionEnd = Math.min(v2, t5.value.length)) : (v2 = (q2 = t5.ownerDocument || document) && q2.defaultView || window, v2.getSelection && (v2 = v2.getSelection(), h2 = t5.textContent.length, J2 = Math.min(g2.start, h2), g2 = void 0 === g2.end ? J2 : Math.min(g2.end, h2), !v2.extend && J2 > g2 && (h2 = g2, g2 = J2, J2 = h2), h2 = Le$2(t5, J2), f2 = Le$2(t5, g2), h2 && f2 && (1 !== v2.rangeCount || v2.anchorNode !== h2.node || v2.anchorOffset !== h2.offset || v2.focusNode !== f2.node || v2.focusOffset !== f2.offset) && (q2 = q2.createRange(), q2.setStart(h2.node, h2.offset), v2.removeAllRanges(), J2 > g2 ? (v2.addRange(q2), v2.extend(f2.node, f2.offset)) : (q2.setEnd(f2.node, f2.offset), v2.addRange(q2))))));
q2 = [];
for (v2 = t5; v2 = v2.parentNode; )
1 === v2.nodeType && q2.push({ element: v2, left: v2.scrollLeft, top: v2.scrollTop });
"function" === typeof t5.focus && t5.focus();
for (t5 = 0; t5 < q2.length; t5++)
v2 = q2[t5], v2.element.scrollLeft = v2.left, v2.element.scrollTop = v2.top;
}
fd$1 = !!kf;
lf = kf = null;
a2.current = c2;
Z$3 = d2;
do
try {
for (t5 = a2; null !== Z$3; ) {
var K2 = Z$3.flags;
K2 & 36 && Yi$1(t5, Z$3.alternate, Z$3);
if (K2 & 128) {
q2 = void 0;
var Q2 = Z$3.ref;
if (null !== Q2) {
var L2 = Z$3.stateNode;
switch (Z$3.tag) {
case 5:
q2 = L2;
break;
default:
q2 = L2;
}
"function" === typeof Q2 ? Q2(q2) : Q2.current = q2;
}
}
Z$3 = Z$3.nextEffect;
}
} catch (va2) {
if (null === Z$3)
throw Error(y$b(330));
Wi$1(Z$3, va2);
Z$3 = Z$3.nextEffect;
}
while (null !== Z$3);
Z$3 = null;
$f();
X$4 = e7;
} else
a2.current = c2;
if (xj)
xj = false, yj = a2, zj = b2;
else
for (Z$3 = d2; null !== Z$3; )
b2 = Z$3.nextEffect, Z$3.nextEffect = null, Z$3.flags & 8 && (K2 = Z$3, K2.sibling = null, K2.stateNode = null), Z$3 = b2;
d2 = a2.pendingLanes;
0 === d2 && (Ti$1 = null);
1 === d2 ? a2 === Ej ? Dj++ : (Dj = 0, Ej = a2) : Dj = 0;
c2 = c2.stateNode;
if (Mf && "function" === typeof Mf.onCommitFiberRoot)
try {
Mf.onCommitFiberRoot(Lf, c2, void 0, 64 === (c2.current.flags & 64));
} catch (va2) {
}
Mj(a2, O$4());
if (Qi$1)
throw Qi$1 = false, a2 = Ri$1, Ri$1 = null, a2;
if (0 !== (X$4 & 8))
return null;
ig();
return null;
}
function ek() {
for (; null !== Z$3; ) {
var a2 = Z$3.alternate;
Jj || null === Ij || (0 !== (Z$3.flags & 8) ? dc$1(Z$3, Ij) && (Jj = true) : 13 === Z$3.tag && mj(a2, Z$3) && dc$1(Z$3, Ij) && (Jj = true));
var b2 = Z$3.flags;
0 !== (b2 & 256) && Xi$1(a2, Z$3);
0 === (b2 & 512) || xj || (xj = true, hg(97, function() {
Oj();
return null;
}));
Z$3 = Z$3.nextEffect;
}
}
function Oj() {
if (90 !== zj) {
var a2 = 97 < zj ? 97 : zj;
zj = 90;
return gg(a2, fk);
}
return false;
}
function $i$1(a2, b2) {
Aj.push(b2, a2);
xj || (xj = true, hg(97, function() {
Oj();
return null;
}));
}
function Zi$1(a2, b2) {
Bj.push(b2, a2);
xj || (xj = true, hg(97, function() {
Oj();
return null;
}));
}
function fk() {
if (null === yj)
return false;
var a2 = yj;
yj = null;
if (0 !== (X$4 & 48))
throw Error(y$b(331));
var b2 = X$4;
X$4 |= 32;
var c2 = Bj;
Bj = [];
for (var d2 = 0; d2 < c2.length; d2 += 2) {
var e7 = c2[d2], f2 = c2[d2 + 1], g2 = e7.destroy;
e7.destroy = void 0;
if ("function" === typeof g2)
try {
g2();
} catch (k2) {
if (null === f2)
throw Error(y$b(330));
Wi$1(f2, k2);
}
}
c2 = Aj;
Aj = [];
for (d2 = 0; d2 < c2.length; d2 += 2) {
e7 = c2[d2];
f2 = c2[d2 + 1];
try {
var h2 = e7.create;
e7.destroy = h2();
} catch (k2) {
if (null === f2)
throw Error(y$b(330));
Wi$1(f2, k2);
}
}
for (h2 = a2.current.firstEffect; null !== h2; )
a2 = h2.nextEffect, h2.nextEffect = null, h2.flags & 8 && (h2.sibling = null, h2.stateNode = null), h2 = a2;
X$4 = b2;
ig();
return true;
}
function gk(a2, b2, c2) {
b2 = Mi$1(c2, b2);
b2 = Pi$1(a2, b2, 1);
Ag(a2, b2);
b2 = Hg();
a2 = Kj(a2, 1);
null !== a2 && ($c$1(a2, 1, b2), Mj(a2, b2));
}
function Wi$1(a2, b2) {
if (3 === a2.tag)
gk(a2, a2, b2);
else
for (var c2 = a2.return; null !== c2; ) {
if (3 === c2.tag) {
gk(c2, a2, b2);
break;
} else if (1 === c2.tag) {
var d2 = c2.stateNode;
if ("function" === typeof c2.type.getDerivedStateFromError || "function" === typeof d2.componentDidCatch && (null === Ti$1 || !Ti$1.has(d2))) {
a2 = Mi$1(b2, a2);
var e7 = Si$1(c2, a2, 1);
Ag(c2, e7);
e7 = Hg();
c2 = Kj(c2, 1);
if (null !== c2)
$c$1(c2, 1, e7), Mj(c2, e7);
else if ("function" === typeof d2.componentDidCatch && (null === Ti$1 || !Ti$1.has(d2)))
try {
d2.componentDidCatch(b2, a2);
} catch (f2) {
}
break;
}
}
c2 = c2.return;
}
}
function Yj(a2, b2, c2) {
var d2 = a2.pingCache;
null !== d2 && d2.delete(b2);
b2 = Hg();
a2.pingedLanes |= a2.suspendedLanes & c2;
U$4 === a2 && (W$2 & c2) === c2 && (4 === V$4 || 3 === V$4 && (W$2 & 62914560) === W$2 && 500 > O$4() - jj ? Qj(a2, 0) : uj |= c2);
Mj(a2, b2);
}
function lj(a2, b2) {
var c2 = a2.stateNode;
null !== c2 && c2.delete(b2);
b2 = 0;
0 === b2 && (b2 = a2.mode, 0 === (b2 & 2) ? b2 = 1 : 0 === (b2 & 4) ? b2 = 99 === eg$1() ? 1 : 2 : (0 === Gj && (Gj = tj), b2 = Yc$1(62914560 & ~Gj), 0 === b2 && (b2 = 4194304)));
c2 = Hg();
a2 = Kj(a2, b2);
null !== a2 && ($c$1(a2, b2, c2), Mj(a2, c2));
}
var ck;
ck = function(a2, b2, c2) {
var d2 = b2.lanes;
if (null !== a2)
if (a2.memoizedProps !== b2.pendingProps || N$4.current)
ug = true;
else if (0 !== (c2 & d2))
ug = 0 !== (a2.flags & 16384) ? true : false;
else {
ug = false;
switch (b2.tag) {
case 3:
ri$1(b2);
sh();
break;
case 5:
gh(b2);
break;
case 1:
Ff(b2.type) && Jf(b2);
break;
case 4:
eh(b2, b2.stateNode.containerInfo);
break;
case 10:
d2 = b2.memoizedProps.value;
var e7 = b2.type._context;
I$3(mg, e7._currentValue);
e7._currentValue = d2;
break;
case 13:
if (null !== b2.memoizedState) {
if (0 !== (c2 & b2.child.childLanes))
return ti$1(a2, b2, c2);
I$3(P$3, P$3.current & 1);
b2 = hi$1(a2, b2, c2);
return null !== b2 ? b2.sibling : null;
}
I$3(P$3, P$3.current & 1);
break;
case 19:
d2 = 0 !== (c2 & b2.childLanes);
if (0 !== (a2.flags & 64)) {
if (d2)
return Ai$1(a2, b2, c2);
b2.flags |= 64;
}
e7 = b2.memoizedState;
null !== e7 && (e7.rendering = null, e7.tail = null, e7.lastEffect = null);
I$3(P$3, P$3.current);
if (d2)
break;
else
return null;
case 23:
case 24:
return b2.lanes = 0, mi$1(a2, b2, c2);
}
return hi$1(a2, b2, c2);
}
else
ug = false;
b2.lanes = 0;
switch (b2.tag) {
case 2:
d2 = b2.type;
null !== a2 && (a2.alternate = null, b2.alternate = null, b2.flags |= 2);
a2 = b2.pendingProps;
e7 = Ef(b2, M$9.current);
tg$1(b2, c2);
e7 = Ch(null, b2, d2, a2, e7, c2);
b2.flags |= 1;
if ("object" === typeof e7 && null !== e7 && "function" === typeof e7.render && void 0 === e7.$$typeof) {
b2.tag = 1;
b2.memoizedState = null;
b2.updateQueue = null;
if (Ff(d2)) {
var f2 = true;
Jf(b2);
} else
f2 = false;
b2.memoizedState = null !== e7.state && void 0 !== e7.state ? e7.state : null;
xg(b2);
var g2 = d2.getDerivedStateFromProps;
"function" === typeof g2 && Gg(b2, d2, g2, a2);
e7.updater = Kg;
b2.stateNode = e7;
e7._reactInternals = b2;
Og(b2, d2, a2, c2);
b2 = qi$1(null, b2, d2, true, f2, c2);
} else
b2.tag = 0, fi$1(null, b2, e7, c2), b2 = b2.child;
return b2;
case 16:
e7 = b2.elementType;
a: {
null !== a2 && (a2.alternate = null, b2.alternate = null, b2.flags |= 2);
a2 = b2.pendingProps;
f2 = e7._init;
e7 = f2(e7._payload);
b2.type = e7;
f2 = b2.tag = hk(e7);
a2 = lg(e7, a2);
switch (f2) {
case 0:
b2 = li$1(null, b2, e7, a2, c2);
break a;
case 1:
b2 = pi$5(null, b2, e7, a2, c2);
break a;
case 11:
b2 = gi$1(null, b2, e7, a2, c2);
break a;
case 14:
b2 = ii$1(null, b2, e7, lg(e7.type, a2), d2, c2);
break a;
}
throw Error(y$b(306, e7, ""));
}
return b2;
case 0:
return d2 = b2.type, e7 = b2.pendingProps, e7 = b2.elementType === d2 ? e7 : lg(d2, e7), li$1(a2, b2, d2, e7, c2);
case 1:
return d2 = b2.type, e7 = b2.pendingProps, e7 = b2.elementType === d2 ? e7 : lg(d2, e7), pi$5(a2, b2, d2, e7, c2);
case 3:
ri$1(b2);
d2 = b2.updateQueue;
if (null === a2 || null === d2)
throw Error(y$b(282));
d2 = b2.pendingProps;
e7 = b2.memoizedState;
e7 = null !== e7 ? e7.element : null;
yg(a2, b2);
Cg(b2, d2, null, c2);
d2 = b2.memoizedState.element;
if (d2 === e7)
sh(), b2 = hi$1(a2, b2, c2);
else {
e7 = b2.stateNode;
if (f2 = e7.hydrate)
kh = rf(b2.stateNode.containerInfo.firstChild), jh = b2, f2 = lh = true;
if (f2) {
a2 = e7.mutableSourceEagerHydrationData;
if (null != a2)
for (e7 = 0; e7 < a2.length; e7 += 2)
f2 = a2[e7], f2._workInProgressVersionPrimary = a2[e7 + 1], th.push(f2);
c2 = Zg(b2, null, d2, c2);
for (b2.child = c2; c2; )
c2.flags = c2.flags & -3 | 1024, c2 = c2.sibling;
} else
fi$1(a2, b2, d2, c2), sh();
b2 = b2.child;
}
return b2;
case 5:
return gh(b2), null === a2 && ph(b2), d2 = b2.type, e7 = b2.pendingProps, f2 = null !== a2 ? a2.memoizedProps : null, g2 = e7.children, nf(d2, e7) ? g2 = null : null !== f2 && nf(d2, f2) && (b2.flags |= 16), oi$1(a2, b2), fi$1(a2, b2, g2, c2), b2.child;
case 6:
return null === a2 && ph(b2), null;
case 13:
return ti$1(a2, b2, c2);
case 4:
return eh(b2, b2.stateNode.containerInfo), d2 = b2.pendingProps, null === a2 ? b2.child = Yg(b2, null, d2, c2) : fi$1(a2, b2, d2, c2), b2.child;
case 11:
return d2 = b2.type, e7 = b2.pendingProps, e7 = b2.elementType === d2 ? e7 : lg(d2, e7), gi$1(a2, b2, d2, e7, c2);
case 7:
return fi$1(a2, b2, b2.pendingProps, c2), b2.child;
case 8:
return fi$1(
a2,
b2,
b2.pendingProps.children,
c2
), b2.child;
case 12:
return fi$1(a2, b2, b2.pendingProps.children, c2), b2.child;
case 10:
a: {
d2 = b2.type._context;
e7 = b2.pendingProps;
g2 = b2.memoizedProps;
f2 = e7.value;
var h2 = b2.type._context;
I$3(mg, h2._currentValue);
h2._currentValue = f2;
if (null !== g2)
if (h2 = g2.value, f2 = He$1(h2, f2) ? 0 : ("function" === typeof d2._calculateChangedBits ? d2._calculateChangedBits(h2, f2) : 1073741823) | 0, 0 === f2) {
if (g2.children === e7.children && !N$4.current) {
b2 = hi$1(a2, b2, c2);
break a;
}
} else
for (h2 = b2.child, null !== h2 && (h2.return = b2); null !== h2; ) {
var k2 = h2.dependencies;
if (null !== k2) {
g2 = h2.child;
for (var l2 = k2.firstContext; null !== l2; ) {
if (l2.context === d2 && 0 !== (l2.observedBits & f2)) {
1 === h2.tag && (l2 = zg(-1, c2 & -c2), l2.tag = 2, Ag(h2, l2));
h2.lanes |= c2;
l2 = h2.alternate;
null !== l2 && (l2.lanes |= c2);
sg(h2.return, c2);
k2.lanes |= c2;
break;
}
l2 = l2.next;
}
} else
g2 = 10 === h2.tag ? h2.type === b2.type ? null : h2.child : h2.child;
if (null !== g2)
g2.return = h2;
else
for (g2 = h2; null !== g2; ) {
if (g2 === b2) {
g2 = null;
break;
}
h2 = g2.sibling;
if (null !== h2) {
h2.return = g2.return;
g2 = h2;
break;
}
g2 = g2.return;
}
h2 = g2;
}
fi$1(a2, b2, e7.children, c2);
b2 = b2.child;
}
return b2;
case 9:
return e7 = b2.type, f2 = b2.pendingProps, d2 = f2.children, tg$1(b2, c2), e7 = vg(
e7,
f2.unstable_observedBits
), d2 = d2(e7), b2.flags |= 1, fi$1(a2, b2, d2, c2), b2.child;
case 14:
return e7 = b2.type, f2 = lg(e7, b2.pendingProps), f2 = lg(e7.type, f2), ii$1(a2, b2, e7, f2, d2, c2);
case 15:
return ki$1(a2, b2, b2.type, b2.pendingProps, d2, c2);
case 17:
return d2 = b2.type, e7 = b2.pendingProps, e7 = b2.elementType === d2 ? e7 : lg(d2, e7), null !== a2 && (a2.alternate = null, b2.alternate = null, b2.flags |= 2), b2.tag = 1, Ff(d2) ? (a2 = true, Jf(b2)) : a2 = false, tg$1(b2, c2), Mg(b2, d2, e7), Og(b2, d2, e7, c2), qi$1(null, b2, d2, true, a2, c2);
case 19:
return Ai$1(a2, b2, c2);
case 23:
return mi$1(a2, b2, c2);
case 24:
return mi$1(a2, b2, c2);
}
throw Error(y$b(156, b2.tag));
};
function ik(a2, b2, c2, d2) {
this.tag = a2;
this.key = c2;
this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
this.index = 0;
this.ref = null;
this.pendingProps = b2;
this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
this.mode = d2;
this.flags = 0;
this.lastEffect = this.firstEffect = this.nextEffect = null;
this.childLanes = this.lanes = 0;
this.alternate = null;
}
function nh(a2, b2, c2, d2) {
return new ik(a2, b2, c2, d2);
}
function ji$1(a2) {
a2 = a2.prototype;
return !(!a2 || !a2.isReactComponent);
}
function hk(a2) {
if ("function" === typeof a2)
return ji$1(a2) ? 1 : 0;
if (void 0 !== a2 && null !== a2) {
a2 = a2.$$typeof;
if (a2 === Aa$1)
return 11;
if (a2 === Da$1)
return 14;
}
return 2;
}
function Tg(a2, b2) {
var c2 = a2.alternate;
null === c2 ? (c2 = nh(a2.tag, b2, a2.key, a2.mode), c2.elementType = a2.elementType, c2.type = a2.type, c2.stateNode = a2.stateNode, c2.alternate = a2, a2.alternate = c2) : (c2.pendingProps = b2, c2.type = a2.type, c2.flags = 0, c2.nextEffect = null, c2.firstEffect = null, c2.lastEffect = null);
c2.childLanes = a2.childLanes;
c2.lanes = a2.lanes;
c2.child = a2.child;
c2.memoizedProps = a2.memoizedProps;
c2.memoizedState = a2.memoizedState;
c2.updateQueue = a2.updateQueue;
b2 = a2.dependencies;
c2.dependencies = null === b2 ? null : { lanes: b2.lanes, firstContext: b2.firstContext };
c2.sibling = a2.sibling;
c2.index = a2.index;
c2.ref = a2.ref;
return c2;
}
function Vg(a2, b2, c2, d2, e7, f2) {
var g2 = 2;
d2 = a2;
if ("function" === typeof a2)
ji$1(a2) && (g2 = 1);
else if ("string" === typeof a2)
g2 = 5;
else
a:
switch (a2) {
case ua$1:
return Xg(c2.children, e7, f2, b2);
case Ha$1:
g2 = 8;
e7 |= 16;
break;
case wa$1:
g2 = 8;
e7 |= 1;
break;
case xa$1:
return a2 = nh(12, c2, b2, e7 | 8), a2.elementType = xa$1, a2.type = xa$1, a2.lanes = f2, a2;
case Ba$1:
return a2 = nh(13, c2, b2, e7), a2.type = Ba$1, a2.elementType = Ba$1, a2.lanes = f2, a2;
case Ca$1:
return a2 = nh(19, c2, b2, e7), a2.elementType = Ca$1, a2.lanes = f2, a2;
case Ia$1:
return vi$2(c2, e7, f2, b2);
case Ja$1:
return a2 = nh(24, c2, b2, e7), a2.elementType = Ja$1, a2.lanes = f2, a2;
default:
if ("object" === typeof a2 && null !== a2)
switch (a2.$$typeof) {
case ya$1:
g2 = 10;
break a;
case za$1:
g2 = 9;
break a;
case Aa$1:
g2 = 11;
break a;
case Da$1:
g2 = 14;
break a;
case Ea$1:
g2 = 16;
d2 = null;
break a;
case Fa$1:
g2 = 22;
break a;
}
throw Error(y$b(130, null == a2 ? a2 : typeof a2, ""));
}
b2 = nh(g2, c2, b2, e7);
b2.elementType = a2;
b2.type = d2;
b2.lanes = f2;
return b2;
}
function Xg(a2, b2, c2, d2) {
a2 = nh(7, a2, d2, b2);
a2.lanes = c2;
return a2;
}
function vi$2(a2, b2, c2, d2) {
a2 = nh(23, a2, d2, b2);
a2.elementType = Ia$1;
a2.lanes = c2;
return a2;
}
function Ug(a2, b2, c2) {
a2 = nh(6, a2, null, b2);
a2.lanes = c2;
return a2;
}
function Wg(a2, b2, c2) {
b2 = nh(4, null !== a2.children ? a2.children : [], a2.key, b2);
b2.lanes = c2;
b2.stateNode = { containerInfo: a2.containerInfo, pendingChildren: null, implementation: a2.implementation };
return b2;
}
function jk(a2, b2, c2) {
this.tag = b2;
this.containerInfo = a2;
this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
this.timeoutHandle = -1;
this.pendingContext = this.context = null;
this.hydrate = c2;
this.callbackNode = null;
this.callbackPriority = 0;
this.eventTimes = Zc$1(0);
this.expirationTimes = Zc$1(-1);
this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
this.entanglements = Zc$1(0);
this.mutableSourceEagerHydrationData = null;
}
function kk(a2, b2, c2) {
var d2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
return { $$typeof: ta$1, key: null == d2 ? null : "" + d2, children: a2, containerInfo: b2, implementation: c2 };
}
function lk(a2, b2, c2, d2) {
var e7 = b2.current, f2 = Hg(), g2 = Ig(e7);
a:
if (c2) {
c2 = c2._reactInternals;
b: {
if (Zb(c2) !== c2 || 1 !== c2.tag)
throw Error(y$b(170));
var h2 = c2;
do {
switch (h2.tag) {
case 3:
h2 = h2.stateNode.context;
break b;
case 1:
if (Ff(h2.type)) {
h2 = h2.stateNode.__reactInternalMemoizedMergedChildContext;
break b;
}
}
h2 = h2.return;
} while (null !== h2);
throw Error(y$b(171));
}
if (1 === c2.tag) {
var k2 = c2.type;
if (Ff(k2)) {
c2 = If(c2, k2, h2);
break a;
}
}
c2 = h2;
} else
c2 = Cf;
null === b2.context ? b2.context = c2 : b2.pendingContext = c2;
b2 = zg(f2, g2);
b2.payload = { element: a2 };
d2 = void 0 === d2 ? null : d2;
null !== d2 && (b2.callback = d2);
Ag(e7, b2);
Jg(e7, g2, f2);
return g2;
}
function mk(a2) {
a2 = a2.current;
if (!a2.child)
return null;
switch (a2.child.tag) {
case 5:
return a2.child.stateNode;
default:
return a2.child.stateNode;
}
}
function nk(a2, b2) {
a2 = a2.memoizedState;
if (null !== a2 && null !== a2.dehydrated) {
var c2 = a2.retryLane;
a2.retryLane = 0 !== c2 && c2 < b2 ? c2 : b2;
}
}
function ok(a2, b2) {
nk(a2, b2);
(a2 = a2.alternate) && nk(a2, b2);
}
function pk() {
return null;
}
function qk(a2, b2, c2) {
var d2 = null != c2 && null != c2.hydrationOptions && c2.hydrationOptions.mutableSources || null;
c2 = new jk(a2, b2, null != c2 && true === c2.hydrate);
b2 = nh(3, null, null, 2 === b2 ? 7 : 1 === b2 ? 3 : 0);
c2.current = b2;
b2.stateNode = c2;
xg(b2);
a2[ff] = c2.current;
cf(8 === a2.nodeType ? a2.parentNode : a2);
if (d2)
for (a2 = 0; a2 < d2.length; a2++) {
b2 = d2[a2];
var e7 = b2._getVersion;
e7 = e7(b2._source);
null == c2.mutableSourceEagerHydrationData ? c2.mutableSourceEagerHydrationData = [b2, e7] : c2.mutableSourceEagerHydrationData.push(b2, e7);
}
this._internalRoot = c2;
}
qk.prototype.render = function(a2) {
lk(a2, this._internalRoot, null, null);
};
qk.prototype.unmount = function() {
var a2 = this._internalRoot, b2 = a2.containerInfo;
lk(null, a2, null, function() {
b2[ff] = null;
});
};
function rk(a2) {
return !(!a2 || 1 !== a2.nodeType && 9 !== a2.nodeType && 11 !== a2.nodeType && (8 !== a2.nodeType || " react-mount-point-unstable " !== a2.nodeValue));
}
function sk$1(a2, b2) {
b2 || (b2 = a2 ? 9 === a2.nodeType ? a2.documentElement : a2.firstChild : null, b2 = !(!b2 || 1 !== b2.nodeType || !b2.hasAttribute("data-reactroot")));
if (!b2)
for (var c2; c2 = a2.lastChild; )
a2.removeChild(c2);
return new qk(a2, 0, b2 ? { hydrate: true } : void 0);
}
function tk(a2, b2, c2, d2, e7) {
var f2 = c2._reactRootContainer;
if (f2) {
var g2 = f2._internalRoot;
if ("function" === typeof e7) {
var h2 = e7;
e7 = function() {
var a3 = mk(g2);
h2.call(a3);
};
}
lk(b2, g2, a2, e7);
} else {
f2 = c2._reactRootContainer = sk$1(c2, d2);
g2 = f2._internalRoot;
if ("function" === typeof e7) {
var k2 = e7;
e7 = function() {
var a3 = mk(g2);
k2.call(a3);
};
}
Xj(function() {
lk(b2, g2, a2, e7);
});
}
return mk(g2);
}
ec$1 = function(a2) {
if (13 === a2.tag) {
var b2 = Hg();
Jg(a2, 4, b2);
ok(a2, 4);
}
};
fc$1 = function(a2) {
if (13 === a2.tag) {
var b2 = Hg();
Jg(a2, 67108864, b2);
ok(a2, 67108864);
}
};
gc$1 = function(a2) {
if (13 === a2.tag) {
var b2 = Hg(), c2 = Ig(a2);
Jg(a2, c2, b2);
ok(a2, c2);
}
};
hc$1 = function(a2, b2) {
return b2();
};
yb = function(a2, b2, c2) {
switch (b2) {
case "input":
ab(a2, c2);
b2 = c2.name;
if ("radio" === c2.type && null != b2) {
for (c2 = a2; c2.parentNode; )
c2 = c2.parentNode;
c2 = c2.querySelectorAll("input[name=" + JSON.stringify("" + b2) + '][type="radio"]');
for (b2 = 0; b2 < c2.length; b2++) {
var d2 = c2[b2];
if (d2 !== a2 && d2.form === a2.form) {
var e7 = Db(d2);
if (!e7)
throw Error(y$b(90));
Wa$1(d2);
ab(d2, e7);
}
}
}
break;
case "textarea":
ib(a2, c2);
break;
case "select":
b2 = c2.value, null != b2 && fb(a2, !!c2.multiple, b2, false);
}
};
Gb = Wj;
Hb = function(a2, b2, c2, d2, e7) {
var f2 = X$4;
X$4 |= 4;
try {
return gg(98, a2.bind(null, b2, c2, d2, e7));
} finally {
X$4 = f2, 0 === X$4 && (wj(), ig());
}
};
Ib = function() {
0 === (X$4 & 49) && (Vj(), Oj());
};
Jb = function(a2, b2) {
var c2 = X$4;
X$4 |= 2;
try {
return a2(b2);
} finally {
X$4 = c2, 0 === X$4 && (wj(), ig());
}
};
function uk(a2, b2) {
var c2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
if (!rk(b2))
throw Error(y$b(200));
return kk(a2, b2, null, c2);
}
var vk = { Events: [Cb, ue$2, Db, Eb, Fb, Oj, { current: false }] }, wk = { findFiberByHostInstance: wc$1, bundleType: 0, version: "17.0.2", rendererPackageName: "react-dom" };
var xk = { bundleType: wk.bundleType, version: wk.version, rendererPackageName: wk.rendererPackageName, rendererConfig: wk.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: ra$1.ReactCurrentDispatcher, findHostInstanceByFiber: function(a2) {
a2 = cc$1(a2);
return null === a2 ? null : a2.stateNode;
}, findFiberByHostInstance: wk.findFiberByHostInstance || pk, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null };
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var yk = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (!yk.isDisabled && yk.supportsFiber)
try {
Lf = yk.inject(xk), Mf = yk;
} catch (a2) {
}
}
reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = vk;
reactDom_production_min.createPortal = uk;
reactDom_production_min.findDOMNode = function(a2) {
if (null == a2)
return null;
if (1 === a2.nodeType)
return a2;
var b2 = a2._reactInternals;
if (void 0 === b2) {
if ("function" === typeof a2.render)
throw Error(y$b(188));
throw Error(y$b(268, Object.keys(a2)));
}
a2 = cc$1(b2);
a2 = null === a2 ? null : a2.stateNode;
return a2;
};
reactDom_production_min.flushSync = function(a2, b2) {
var c2 = X$4;
if (0 !== (c2 & 48))
return a2(b2);
X$4 |= 1;
try {
if (a2)
return gg(99, a2.bind(null, b2));
} finally {
X$4 = c2, ig();
}
};
reactDom_production_min.hydrate = function(a2, b2, c2) {
if (!rk(b2))
throw Error(y$b(200));
return tk(null, a2, b2, true, c2);
};
reactDom_production_min.render = function(a2, b2, c2) {
if (!rk(b2))
throw Error(y$b(200));
return tk(null, a2, b2, false, c2);
};
reactDom_production_min.unmountComponentAtNode = function(a2) {
if (!rk(a2))
throw Error(y$b(40));
return a2._reactRootContainer ? (Xj(function() {
tk(null, null, a2, false, function() {
a2._reactRootContainer = null;
a2[ff] = null;
});
}), true) : false;
};
reactDom_production_min.unstable_batchedUpdates = Wj;
reactDom_production_min.unstable_createPortal = function(a2, b2) {
return uk(a2, b2, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null);
};
reactDom_production_min.unstable_renderSubtreeIntoContainer = function(a2, b2, c2, d2) {
if (!rk(c2))
throw Error(y$b(200));
if (null == a2 || void 0 === a2._reactInternals)
throw Error(y$b(38));
return tk(a2, b2, c2, false, d2);
};
reactDom_production_min.version = "17.0.2";
function checkDCE() {
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
return;
}
try {
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
} catch (err) {
console.error(err);
}
}
{
checkDCE();
reactDom.exports = reactDom_production_min;
}
var reactDomExports = reactDom.exports;
const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(reactDomExports);
var shim$1 = { exports: {} };
var useSyncExternalStoreShim_production_min = {};
/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var e$p = reactExports;
function h$b(a2, b2) {
return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
}
var k$5 = "function" === typeof Object.is ? Object.is : h$b, l$5 = e$p.useState, m$n = e$p.useEffect, n$f = e$p.useLayoutEffect, p$8 = e$p.useDebugValue;
function q$5(a2, b2) {
var d2 = b2(), f2 = l$5({ inst: { value: d2, getSnapshot: b2 } }), c2 = f2[0].inst, g2 = f2[1];
n$f(function() {
c2.value = d2;
c2.getSnapshot = b2;
r$r(c2) && g2({ inst: c2 });
}, [a2, d2, b2]);
m$n(function() {
r$r(c2) && g2({ inst: c2 });
return a2(function() {
r$r(c2) && g2({ inst: c2 });
});
}, [a2]);
p$8(d2);
return d2;
}
function r$r(a2) {
var b2 = a2.getSnapshot;
a2 = a2.value;
try {
var d2 = b2();
return !k$5(a2, d2);
} catch (f2) {
return true;
}
}
function t$q(a2, b2) {
return b2();
}
var u$c = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t$q : q$5;
useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e$p.useSyncExternalStore ? e$p.useSyncExternalStore : u$c;
{
shim$1.exports = useSyncExternalStoreShim_production_min;
}
var shimExports = shim$1.exports;
var withSelector = { exports: {} };
var withSelector_production_min = {};
/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var h$a = reactExports, n$e = shimExports;
function p$7(a2, b2) {
return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
}
var q$4 = "function" === typeof Object.is ? Object.is : p$7, r$q = n$e.useSyncExternalStore, t$p = h$a.useRef, u$b = h$a.useEffect, v$6 = h$a.useMemo, w$6 = h$a.useDebugValue;
withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b2, e7, l2, g2) {
var c2 = t$p(null);
if (null === c2.current) {
var f2 = { hasValue: false, value: null };
c2.current = f2;
} else
f2 = c2.current;
c2 = v$6(function() {
function a3(a4) {
if (!c3) {
c3 = true;
d3 = a4;
a4 = l2(a4);
if (void 0 !== g2 && f2.hasValue) {
var b3 = f2.value;
if (g2(b3, a4))
return k2 = b3;
}
return k2 = a4;
}
b3 = k2;
if (q$4(d3, a4))
return b3;
var e8 = l2(a4);
if (void 0 !== g2 && g2(b3, e8))
return b3;
d3 = a4;
return k2 = e8;
}
var c3 = false, d3, k2, m2 = void 0 === e7 ? null : e7;
return [function() {
return a3(b2());
}, null === m2 ? void 0 : function() {
return a3(m2());
}];
}, [b2, e7, l2, g2]);
var d2 = r$q(a2, c2[0], c2[1]);
u$b(function() {
f2.hasValue = true;
f2.value = d2;
}, [d2]);
w$6(d2);
return d2;
};
{
withSelector.exports = withSelector_production_min;
}
var withSelectorExports = withSelector.exports;
function defaultNoopBatch(callback) {
callback();
}
let batch = defaultNoopBatch;
const setBatch = (newBatch) => batch = newBatch;
const getBatch = () => batch;
const ContextKey = Symbol.for(`react-redux-context`);
const gT = typeof globalThis !== "undefined" ? globalThis : (
/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
{}
);
function getContext$1() {
var _gT$ContextKey;
if (!reactExports.createContext)
return {};
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = /* @__PURE__ */ new Map();
let realContext = contextMap.get(reactExports.createContext);
if (!realContext) {
realContext = reactExports.createContext(null);
contextMap.set(reactExports.createContext, realContext);
}
return realContext;
}
const ReactReduxContext = /* @__PURE__ */ getContext$1();
function createReduxContextHook(context2 = ReactReduxContext) {
return function useReduxContext2() {
const contextValue = reactExports.useContext(context2);
return contextValue;
};
}
const useReduxContext = /* @__PURE__ */ createReduxContextHook();
const notInitialized = () => {
throw new Error("uSES not initialized!");
};
let useSyncExternalStoreWithSelector = notInitialized;
const initializeUseSelector = (fn8) => {
useSyncExternalStoreWithSelector = fn8;
};
const refEquality = (a2, b2) => a2 === b2;
function createSelectorHook(context2 = ReactReduxContext) {
const useReduxContext$1 = context2 === ReactReduxContext ? useReduxContext : createReduxContextHook(context2);
return function useSelector2(selector, equalityFnOrOptions = {}) {
const {
equalityFn = refEquality,
stabilityCheck = void 0,
noopCheck = void 0
} = typeof equalityFnOrOptions === "function" ? {
equalityFn: equalityFnOrOptions
} : equalityFnOrOptions;
const {
store,
subscription,
getServerState,
stabilityCheck: globalStabilityCheck,
noopCheck: globalNoopCheck
} = useReduxContext$1();
reactExports.useRef(true);
const wrappedSelector = reactExports.useCallback({
[selector.name](state) {
const selected = selector(state);
return selected;
}
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
reactExports.useDebugValue(selectedState);
return selectedState;
};
}
const useSelector = /* @__PURE__ */ createSelectorHook();
function _extends$3() {
_extends$3 = Object.assign ? Object.assign.bind() : function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends$3.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$2(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
var reactIs$2 = { exports: {} };
var reactIs_production_min$1 = {};
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var b$5 = "function" === typeof Symbol && Symbol.for, c$7 = b$5 ? Symbol.for("react.element") : 60103, d$l = b$5 ? Symbol.for("react.portal") : 60106, e$o = b$5 ? Symbol.for("react.fragment") : 60107, f$6 = b$5 ? Symbol.for("react.strict_mode") : 60108, g$3 = b$5 ? Symbol.for("react.profiler") : 60114, h$9 = b$5 ? Symbol.for("react.provider") : 60109, k$4 = b$5 ? Symbol.for("react.context") : 60110, l$4 = b$5 ? Symbol.for("react.async_mode") : 60111, m$m = b$5 ? Symbol.for("react.concurrent_mode") : 60111, n$d = b$5 ? Symbol.for("react.forward_ref") : 60112, p$6 = b$5 ? Symbol.for("react.suspense") : 60113, q$3 = b$5 ? Symbol.for("react.suspense_list") : 60120, r$p = b$5 ? Symbol.for("react.memo") : 60115, t$o = b$5 ? Symbol.for("react.lazy") : 60116, v$5 = b$5 ? Symbol.for("react.block") : 60121, w$5 = b$5 ? Symbol.for("react.fundamental") : 60117, x$8 = b$5 ? Symbol.for("react.responder") : 60118, y$a = b$5 ? Symbol.for("react.scope") : 60119;
function z$5(a2) {
if ("object" === typeof a2 && null !== a2) {
var u2 = a2.$$typeof;
switch (u2) {
case c$7:
switch (a2 = a2.type, a2) {
case l$4:
case m$m:
case e$o:
case g$3:
case f$6:
case p$6:
return a2;
default:
switch (a2 = a2 && a2.$$typeof, a2) {
case k$4:
case n$d:
case t$o:
case r$p:
case h$9:
return a2;
default:
return u2;
}
}
case d$l:
return u2;
}
}
}
function A$5(a2) {
return z$5(a2) === m$m;
}
reactIs_production_min$1.AsyncMode = l$4;
reactIs_production_min$1.ConcurrentMode = m$m;
reactIs_production_min$1.ContextConsumer = k$4;
reactIs_production_min$1.ContextProvider = h$9;
reactIs_production_min$1.Element = c$7;
reactIs_production_min$1.ForwardRef = n$d;
reactIs_production_min$1.Fragment = e$o;
reactIs_production_min$1.Lazy = t$o;
reactIs_production_min$1.Memo = r$p;
reactIs_production_min$1.Portal = d$l;
reactIs_production_min$1.Profiler = g$3;
reactIs_production_min$1.StrictMode = f$6;
reactIs_production_min$1.Suspense = p$6;
reactIs_production_min$1.isAsyncMode = function(a2) {
return A$5(a2) || z$5(a2) === l$4;
};
reactIs_production_min$1.isConcurrentMode = A$5;
reactIs_production_min$1.isContextConsumer = function(a2) {
return z$5(a2) === k$4;
};
reactIs_production_min$1.isContextProvider = function(a2) {
return z$5(a2) === h$9;
};
reactIs_production_min$1.isElement = function(a2) {
return "object" === typeof a2 && null !== a2 && a2.$$typeof === c$7;
};
reactIs_production_min$1.isForwardRef = function(a2) {
return z$5(a2) === n$d;
};
reactIs_production_min$1.isFragment = function(a2) {
return z$5(a2) === e$o;
};
reactIs_production_min$1.isLazy = function(a2) {
return z$5(a2) === t$o;
};
reactIs_production_min$1.isMemo = function(a2) {
return z$5(a2) === r$p;
};
reactIs_production_min$1.isPortal = function(a2) {
return z$5(a2) === d$l;
};
reactIs_production_min$1.isProfiler = function(a2) {
return z$5(a2) === g$3;
};
reactIs_production_min$1.isStrictMode = function(a2) {
return z$5(a2) === f$6;
};
reactIs_production_min$1.isSuspense = function(a2) {
return z$5(a2) === p$6;
};
reactIs_production_min$1.isValidElementType = function(a2) {
return "string" === typeof a2 || "function" === typeof a2 || a2 === e$o || a2 === m$m || a2 === g$3 || a2 === f$6 || a2 === p$6 || a2 === q$3 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === t$o || a2.$$typeof === r$p || a2.$$typeof === h$9 || a2.$$typeof === k$4 || a2.$$typeof === n$d || a2.$$typeof === w$5 || a2.$$typeof === x$8 || a2.$$typeof === y$a || a2.$$typeof === v$5);
};
reactIs_production_min$1.typeOf = z$5;
{
reactIs$2.exports = reactIs_production_min$1;
}
var reactIsExports$1 = reactIs$2.exports;
var reactIs$1 = reactIsExports$1;
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
"$$typeof": true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
"$$typeof": true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
function getStatics(component) {
if (reactIs$1.isMemo(component)) {
return MEMO_STATICS;
}
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
}
var defineProperty$7 = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor$6 = Object.getOwnPropertyDescriptor;
var getPrototypeOf$5 = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics$1(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== "string") {
if (objectPrototype) {
var inheritedComponent = getPrototypeOf$5(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics$1(targetComponent, inheritedComponent, blacklist);
}
}
var keys3 = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys3 = keys3.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i2 = 0; i2 < keys3.length; ++i2) {
var key2 = keys3[i2];
if (!KNOWN_STATICS[key2] && !(blacklist && blacklist[key2]) && !(sourceStatics && sourceStatics[key2]) && !(targetStatics && targetStatics[key2])) {
var descriptor = getOwnPropertyDescriptor$6(sourceComponent, key2);
try {
defineProperty$7(targetComponent, key2, descriptor);
} catch (e7) {
}
}
}
}
return targetComponent;
}
var hoistNonReactStatics_cjs = hoistNonReactStatics$1;
const hoistNonReactStatics$1$1 = /* @__PURE__ */ getDefaultExportFromCjs(hoistNonReactStatics_cjs);
var reactIs = { exports: {} };
var reactIs_production_min = {};
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var b$4 = Symbol.for("react.element"), c$6 = Symbol.for("react.portal"), d$k = Symbol.for("react.fragment"), e$n = Symbol.for("react.strict_mode"), f$5 = Symbol.for("react.profiler"), g$2 = Symbol.for("react.provider"), h$8 = Symbol.for("react.context"), k$3 = Symbol.for("react.server_context"), l$3 = Symbol.for("react.forward_ref"), m$l = Symbol.for("react.suspense"), n$c = Symbol.for("react.suspense_list"), p$5 = Symbol.for("react.memo"), q$2 = Symbol.for("react.lazy"), t$n = Symbol.for("react.offscreen"), u$a;
u$a = Symbol.for("react.module.reference");
function v$4(a2) {
if ("object" === typeof a2 && null !== a2) {
var r2 = a2.$$typeof;
switch (r2) {
case b$4:
switch (a2 = a2.type, a2) {
case d$k:
case f$5:
case e$n:
case m$l:
case n$c:
return a2;
default:
switch (a2 = a2 && a2.$$typeof, a2) {
case k$3:
case h$8:
case l$3:
case q$2:
case p$5:
case g$2:
return a2;
default:
return r2;
}
}
case c$6:
return r2;
}
}
}
reactIs_production_min.ContextConsumer = h$8;
reactIs_production_min.ContextProvider = g$2;
reactIs_production_min.Element = b$4;
reactIs_production_min.ForwardRef = l$3;
reactIs_production_min.Fragment = d$k;
reactIs_production_min.Lazy = q$2;
reactIs_production_min.Memo = p$5;
reactIs_production_min.Portal = c$6;
reactIs_production_min.Profiler = f$5;
reactIs_production_min.StrictMode = e$n;
reactIs_production_min.Suspense = m$l;
reactIs_production_min.SuspenseList = n$c;
reactIs_production_min.isAsyncMode = function() {
return false;
};
reactIs_production_min.isConcurrentMode = function() {
return false;
};
reactIs_production_min.isContextConsumer = function(a2) {
return v$4(a2) === h$8;
};
reactIs_production_min.isContextProvider = function(a2) {
return v$4(a2) === g$2;
};
reactIs_production_min.isElement = function(a2) {
return "object" === typeof a2 && null !== a2 && a2.$$typeof === b$4;
};
reactIs_production_min.isForwardRef = function(a2) {
return v$4(a2) === l$3;
};
reactIs_production_min.isFragment = function(a2) {
return v$4(a2) === d$k;
};
reactIs_production_min.isLazy = function(a2) {
return v$4(a2) === q$2;
};
reactIs_production_min.isMemo = function(a2) {
return v$4(a2) === p$5;
};
reactIs_production_min.isPortal = function(a2) {
return v$4(a2) === c$6;
};
reactIs_production_min.isProfiler = function(a2) {
return v$4(a2) === f$5;
};
reactIs_production_min.isStrictMode = function(a2) {
return v$4(a2) === e$n;
};
reactIs_production_min.isSuspense = function(a2) {
return v$4(a2) === m$l;
};
reactIs_production_min.isSuspenseList = function(a2) {
return v$4(a2) === n$c;
};
reactIs_production_min.isValidElementType = function(a2) {
return "string" === typeof a2 || "function" === typeof a2 || a2 === d$k || a2 === f$5 || a2 === e$n || a2 === m$l || a2 === n$c || a2 === t$n || "object" === typeof a2 && null !== a2 && (a2.$$typeof === q$2 || a2.$$typeof === p$5 || a2.$$typeof === g$2 || a2.$$typeof === h$8 || a2.$$typeof === l$3 || a2.$$typeof === u$a || void 0 !== a2.getModuleId) ? true : false;
};
reactIs_production_min.typeOf = v$4;
{
reactIs.exports = reactIs_production_min;
}
var reactIsExports = reactIs.exports;
const _excluded$a = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"];
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps2, dispatch2, {
areStatesEqual,
areOwnPropsEqual,
areStatePropsEqual
}) {
let hasRunAtLeastOnce = false;
let state;
let ownProps;
let stateProps;
let dispatchProps;
let mergedProps;
function handleFirstCall(firstState, firstOwnProps) {
state = firstState;
ownProps = firstOwnProps;
stateProps = mapStateToProps(state, ownProps);
dispatchProps = mapDispatchToProps(dispatch2, ownProps);
mergedProps = mergeProps2(stateProps, dispatchProps, ownProps);
hasRunAtLeastOnce = true;
return mergedProps;
}
function handleNewPropsAndNewState() {
stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps)
dispatchProps = mapDispatchToProps(dispatch2, ownProps);
mergedProps = mergeProps2(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewProps() {
if (mapStateToProps.dependsOnOwnProps)
stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps)
dispatchProps = mapDispatchToProps(dispatch2, ownProps);
mergedProps = mergeProps2(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewState() {
const nextStateProps = mapStateToProps(state, ownProps);
const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
stateProps = nextStateProps;
if (statePropsChanged)
mergedProps = mergeProps2(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleSubsequentCalls(nextState, nextOwnProps) {
const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
const stateChanged = !areStatesEqual(nextState, state, nextOwnProps, ownProps);
state = nextState;
ownProps = nextOwnProps;
if (propsChanged && stateChanged)
return handleNewPropsAndNewState();
if (propsChanged)
return handleNewProps();
if (stateChanged)
return handleNewState();
return mergedProps;
}
return function pureFinalPropsSelector(nextState, nextOwnProps) {
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
};
}
function finalPropsSelectorFactory(dispatch2, _ref3) {
let {
initMapStateToProps,
initMapDispatchToProps,
initMergeProps
} = _ref3, options2 = _objectWithoutPropertiesLoose$2(_ref3, _excluded$a);
const mapStateToProps = initMapStateToProps(dispatch2, options2);
const mapDispatchToProps = initMapDispatchToProps(dispatch2, options2);
const mergeProps2 = initMergeProps(dispatch2, options2);
return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps2, dispatch2, options2);
}
function bindActionCreators$1(actionCreators, dispatch2) {
const boundActionCreators = {};
for (const key2 in actionCreators) {
const actionCreator = actionCreators[key2];
if (typeof actionCreator === "function") {
boundActionCreators[key2] = (...args) => dispatch2(actionCreator(...args));
}
}
return boundActionCreators;
}
function wrapMapToPropsConstant(getConstant) {
return function initConstantSelector(dispatch2) {
const constant2 = getConstant(dispatch2);
function constantSelector() {
return constant2;
}
constantSelector.dependsOnOwnProps = false;
return constantSelector;
};
}
function getDependsOnOwnProps(mapToProps) {
return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
}
function wrapMapToPropsFunc(mapToProps, methodName) {
return function initProxySelector(dispatch2, {
displayName
}) {
const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);
};
proxy.dependsOnOwnProps = true;
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
proxy.mapToProps = mapToProps;
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
let props = proxy(stateOrDispatch, ownProps);
if (typeof props === "function") {
proxy.mapToProps = props;
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
props = proxy(stateOrDispatch, ownProps);
}
return props;
};
return proxy;
};
}
function createInvalidArgFactory(arg, name) {
return (dispatch2, options2) => {
throw new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options2.wrappedComponentName}.`);
};
}
function mapDispatchToPropsFactory(mapDispatchToProps) {
return mapDispatchToProps && typeof mapDispatchToProps === "object" ? wrapMapToPropsConstant((dispatch2) => (
// @ts-ignore
bindActionCreators$1(mapDispatchToProps, dispatch2)
)) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch2) => ({
dispatch: dispatch2
})) : typeof mapDispatchToProps === "function" ? (
// @ts-ignore
wrapMapToPropsFunc(mapDispatchToProps)
) : createInvalidArgFactory(mapDispatchToProps, "mapDispatchToProps");
}
function mapStateToPropsFactory(mapStateToProps) {
return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === "function" ? (
// @ts-ignore
wrapMapToPropsFunc(mapStateToProps)
) : createInvalidArgFactory(mapStateToProps, "mapStateToProps");
}
function defaultMergeProps(stateProps, dispatchProps, ownProps) {
return _extends$3({}, ownProps, stateProps, dispatchProps);
}
function wrapMergePropsFunc(mergeProps2) {
return function initMergePropsProxy(dispatch2, {
displayName,
areMergedPropsEqual
}) {
let hasRunOnce = false;
let mergedProps;
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
const nextMergedProps = mergeProps2(stateProps, dispatchProps, ownProps);
if (hasRunOnce) {
if (!areMergedPropsEqual(nextMergedProps, mergedProps))
mergedProps = nextMergedProps;
} else {
hasRunOnce = true;
mergedProps = nextMergedProps;
}
return mergedProps;
};
};
}
function mergePropsFactory(mergeProps2) {
return !mergeProps2 ? () => defaultMergeProps : typeof mergeProps2 === "function" ? wrapMergePropsFunc(mergeProps2) : createInvalidArgFactory(mergeProps2, "mergeProps");
}
function createListenerCollection() {
const batch2 = getBatch();
let first = null;
let last = null;
return {
clear() {
first = null;
last = null;
},
notify() {
batch2(() => {
let listener2 = first;
while (listener2) {
listener2.callback();
listener2 = listener2.next;
}
});
},
get() {
let listeners = [];
let listener2 = first;
while (listener2) {
listeners.push(listener2);
listener2 = listener2.next;
}
return listeners;
},
subscribe(callback) {
let isSubscribed = true;
let listener2 = last = {
callback,
next: null,
prev: last
};
if (listener2.prev) {
listener2.prev.next = listener2;
} else {
first = listener2;
}
return function unsubscribe() {
if (!isSubscribed || first === null)
return;
isSubscribed = false;
if (listener2.next) {
listener2.next.prev = listener2.prev;
} else {
last = listener2.prev;
}
if (listener2.prev) {
listener2.prev.next = listener2.next;
} else {
first = listener2.next;
}
};
}
};
}
const nullListeners = {
notify() {
},
get: () => []
};
function createSubscription(store, parentSub) {
let unsubscribe;
let listeners = nullListeners;
let subscriptionsAmount = 0;
let selfSubscribed = false;
function addNestedSub(listener2) {
trySubscribe();
const cleanupListener = listeners.subscribe(listener2);
let removed = false;
return () => {
if (!removed) {
removed = true;
cleanupListener();
tryUnsubscribe();
}
};
}
function notifyNestedSubs() {
listeners.notify();
}
function handleChangeWrapper() {
if (subscription.onStateChange) {
subscription.onStateChange();
}
}
function isSubscribed() {
return selfSubscribed;
}
function trySubscribe() {
subscriptionsAmount++;
if (!unsubscribe) {
unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);
listeners = createListenerCollection();
}
}
function tryUnsubscribe() {
subscriptionsAmount--;
if (unsubscribe && subscriptionsAmount === 0) {
unsubscribe();
unsubscribe = void 0;
listeners.clear();
listeners = nullListeners;
}
}
function trySubscribeSelf() {
if (!selfSubscribed) {
selfSubscribed = true;
trySubscribe();
}
}
function tryUnsubscribeSelf() {
if (selfSubscribed) {
selfSubscribed = false;
tryUnsubscribe();
}
}
const subscription = {
addNestedSub,
notifyNestedSubs,
handleChangeWrapper,
isSubscribed,
trySubscribe: trySubscribeSelf,
tryUnsubscribe: tryUnsubscribeSelf,
getListeners: () => listeners
};
return subscription;
}
const canUseDOM$3 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
const useIsomorphicLayoutEffect$3 = canUseDOM$3 ? reactExports.useLayoutEffect : reactExports.useEffect;
function is$1(x2, y2) {
if (x2 === y2) {
return x2 !== 0 || y2 !== 0 || 1 / x2 === 1 / y2;
} else {
return x2 !== x2 && y2 !== y2;
}
}
function shallowEqual(objA, objB) {
if (is$1(objA, objB))
return true;
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
return false;
}
const keysA = Object.keys(objA);
const keysB = Object.keys(objB);
if (keysA.length !== keysB.length)
return false;
for (let i2 = 0; i2 < keysA.length; i2++) {
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i2]) || !is$1(objA[keysA[i2]], objB[keysA[i2]])) {
return false;
}
}
return true;
}
const _excluded$9 = ["reactReduxForwardedRef"];
let useSyncExternalStore = notInitialized;
const initializeConnect = (fn8) => {
useSyncExternalStore = fn8;
};
const NO_SUBSCRIPTION_ARRAY = [null, null];
function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
useIsomorphicLayoutEffect$3(() => effectFunc(...effectArgs), dependencies);
}
function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {
lastWrapperProps.current = wrapperProps;
renderIsScheduled.current = false;
if (childPropsFromStoreUpdate.current) {
childPropsFromStoreUpdate.current = null;
notifyNestedSubs();
}
}
function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) {
if (!shouldHandleStateChanges)
return () => {
};
let didUnsubscribe = false;
let lastThrownError = null;
const checkForUpdates = () => {
if (didUnsubscribe || !isMounted.current) {
return;
}
const latestStoreState = store.getState();
let newChildProps, error3;
try {
newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
} catch (e7) {
error3 = e7;
lastThrownError = e7;
}
if (!error3) {
lastThrownError = null;
}
if (newChildProps === lastChildProps.current) {
if (!renderIsScheduled.current) {
notifyNestedSubs();
}
} else {
lastChildProps.current = newChildProps;
childPropsFromStoreUpdate.current = newChildProps;
renderIsScheduled.current = true;
additionalSubscribeListener();
}
};
subscription.onStateChange = checkForUpdates;
subscription.trySubscribe();
checkForUpdates();
const unsubscribeWrapper = () => {
didUnsubscribe = true;
subscription.tryUnsubscribe();
subscription.onStateChange = null;
if (lastThrownError) {
throw lastThrownError;
}
};
return unsubscribeWrapper;
}
function strictEqual(a2, b2) {
return a2 === b2;
}
function connect$1(mapStateToProps, mapDispatchToProps, mergeProps2, {
// The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.
// @ts-ignore
pure,
areStatesEqual = strictEqual,
areOwnPropsEqual = shallowEqual,
areStatePropsEqual = shallowEqual,
areMergedPropsEqual = shallowEqual,
// use React's forwardRef to expose a ref of the wrapped component
forwardRef: forwardRef2 = false,
// the context consumer to use
context: context2 = ReactReduxContext
} = {}) {
const Context2 = context2;
const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);
const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);
const initMergeProps = mergePropsFactory(mergeProps2);
const shouldHandleStateChanges = Boolean(mapStateToProps);
const wrapWithConnect = (WrappedComponent) => {
const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || "Component";
const displayName = `Connect(${wrappedComponentName})`;
const selectorFactoryOptions = {
shouldHandleStateChanges,
displayName,
wrappedComponentName,
WrappedComponent,
// @ts-ignore
initMapStateToProps,
// @ts-ignore
initMapDispatchToProps,
initMergeProps,
areStatesEqual,
areStatePropsEqual,
areOwnPropsEqual,
areMergedPropsEqual
};
function ConnectFunction(props) {
const [propsContext, reactReduxForwardedRef, wrapperProps] = reactExports.useMemo(() => {
const {
reactReduxForwardedRef: reactReduxForwardedRef2
} = props, wrapperProps2 = _objectWithoutPropertiesLoose$2(props, _excluded$9);
return [props.context, reactReduxForwardedRef2, wrapperProps2];
}, [props]);
const ContextToUse = reactExports.useMemo(() => {
return propsContext && propsContext.Consumer && // @ts-ignore
reactIsExports.isContextConsumer(/* @__PURE__ */ reactExports.createElement(propsContext.Consumer, null)) ? propsContext : Context2;
}, [propsContext, Context2]);
const contextValue = reactExports.useContext(ContextToUse);
const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
const store = didStoreComeFromProps ? props.store : contextValue.store;
const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;
const childPropsSelector = reactExports.useMemo(() => {
return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);
}, [store]);
const [subscription, notifyNestedSubs] = reactExports.useMemo(() => {
if (!shouldHandleStateChanges)
return NO_SUBSCRIPTION_ARRAY;
const subscription2 = createSubscription(store, didStoreComeFromProps ? void 0 : contextValue.subscription);
const notifyNestedSubs2 = subscription2.notifyNestedSubs.bind(subscription2);
return [subscription2, notifyNestedSubs2];
}, [store, didStoreComeFromProps, contextValue]);
const overriddenContextValue = reactExports.useMemo(() => {
if (didStoreComeFromProps) {
return contextValue;
}
return _extends$3({}, contextValue, {
subscription
});
}, [didStoreComeFromProps, contextValue, subscription]);
const lastChildProps = reactExports.useRef();
const lastWrapperProps = reactExports.useRef(wrapperProps);
const childPropsFromStoreUpdate = reactExports.useRef();
const renderIsScheduled = reactExports.useRef(false);
reactExports.useRef(false);
const isMounted = reactExports.useRef(false);
const latestSubscriptionCallbackError = reactExports.useRef();
useIsomorphicLayoutEffect$3(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
const actualChildPropsSelector = reactExports.useMemo(() => {
const selector = () => {
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
return childPropsFromStoreUpdate.current;
}
return childPropsSelector(store.getState(), wrapperProps);
};
return selector;
}, [store, wrapperProps]);
const subscribeForReact = reactExports.useMemo(() => {
const subscribe = (reactListener) => {
if (!subscription) {
return () => {
};
}
return subscribeUpdates(
shouldHandleStateChanges,
store,
subscription,
// @ts-ignore
childPropsSelector,
lastWrapperProps,
lastChildProps,
renderIsScheduled,
isMounted,
childPropsFromStoreUpdate,
notifyNestedSubs,
reactListener
);
};
return subscribe;
}, [subscription]);
useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs]);
let actualChildProps;
try {
actualChildProps = useSyncExternalStore(
// TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing
subscribeForReact,
// TODO This is incredibly hacky. We've already processed the store update and calculated new child props,
// TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.
actualChildPropsSelector,
getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector
);
} catch (err) {
if (latestSubscriptionCallbackError.current) {
err.message += `
The error may be correlated with this previous error:
${latestSubscriptionCallbackError.current.stack}
`;
}
throw err;
}
useIsomorphicLayoutEffect$3(() => {
latestSubscriptionCallbackError.current = void 0;
childPropsFromStoreUpdate.current = void 0;
lastChildProps.current = actualChildProps;
});
const renderedWrappedComponent = reactExports.useMemo(() => {
return (
// @ts-ignore
/* @__PURE__ */ reactExports.createElement(WrappedComponent, _extends$3({}, actualChildProps, {
ref: reactReduxForwardedRef
}))
);
}, [reactReduxForwardedRef, WrappedComponent, actualChildProps]);
const renderedChild = reactExports.useMemo(() => {
if (shouldHandleStateChanges) {
return /* @__PURE__ */ reactExports.createElement(ContextToUse.Provider, {
value: overriddenContextValue
}, renderedWrappedComponent);
}
return renderedWrappedComponent;
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
return renderedChild;
}
const _Connect = reactExports.memo(ConnectFunction);
const Connect = _Connect;
Connect.WrappedComponent = WrappedComponent;
Connect.displayName = ConnectFunction.displayName = displayName;
if (forwardRef2) {
const _forwarded = reactExports.forwardRef(function forwardConnectRef(props, ref2) {
return /* @__PURE__ */ reactExports.createElement(Connect, _extends$3({}, props, {
reactReduxForwardedRef: ref2
}));
});
const forwarded = _forwarded;
forwarded.displayName = displayName;
forwarded.WrappedComponent = WrappedComponent;
return hoistNonReactStatics$1$1(forwarded, WrappedComponent);
}
return hoistNonReactStatics$1$1(Connect, WrappedComponent);
};
return wrapWithConnect;
}
function Provider({
store,
context: context2,
children: children2,
serverState,
stabilityCheck = "once",
noopCheck = "once"
}) {
const contextValue = reactExports.useMemo(() => {
const subscription = createSubscription(store);
return {
store,
subscription,
getServerState: serverState ? () => serverState : void 0,
stabilityCheck,
noopCheck
};
}, [store, serverState, stabilityCheck, noopCheck]);
const previousState = reactExports.useMemo(() => store.getState(), [store]);
useIsomorphicLayoutEffect$3(() => {
const {
subscription
} = contextValue;
subscription.onStateChange = subscription.notifyNestedSubs;
subscription.trySubscribe();
if (previousState !== store.getState()) {
subscription.notifyNestedSubs();
}
return () => {
subscription.tryUnsubscribe();
subscription.onStateChange = void 0;
};
}, [contextValue, previousState]);
const Context2 = context2 || ReactReduxContext;
return /* @__PURE__ */ reactExports.createElement(Context2.Provider, {
value: contextValue
}, children2);
}
function createStoreHook(context2 = ReactReduxContext) {
const useReduxContext$1 = (
// @ts-ignore
context2 === ReactReduxContext ? useReduxContext : (
// @ts-ignore
createReduxContextHook(context2)
)
);
return function useStore2() {
const {
store
} = useReduxContext$1();
return store;
};
}
const useStore = /* @__PURE__ */ createStoreHook();
function createDispatchHook(context2 = ReactReduxContext) {
const useStore$1 = (
// @ts-ignore
context2 === ReactReduxContext ? useStore : createStoreHook(context2)
);
return function useDispatch2() {
const store = useStore$1();
return store.dispatch;
};
}
const useDispatch = /* @__PURE__ */ createDispatchHook();
initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);
initializeConnect(shimExports.useSyncExternalStore);
setBatch(reactDomExports.unstable_batchedUpdates);
/**
* @remix-run/router v1.0.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function _extends$2() {
_extends$2 = Object.assign ? Object.assign.bind() : function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends$2.apply(this, arguments);
}
var Action$2;
(function(Action2) {
Action2["Pop"] = "POP";
Action2["Push"] = "PUSH";
Action2["Replace"] = "REPLACE";
})(Action$2 || (Action$2 = {}));
function parsePath$1(path2) {
let parsedPath = {};
if (path2) {
let hashIndex = path2.indexOf("#");
if (hashIndex >= 0) {
parsedPath.hash = path2.substr(hashIndex);
path2 = path2.substr(0, hashIndex);
}
let searchIndex = path2.indexOf("?");
if (searchIndex >= 0) {
parsedPath.search = path2.substr(searchIndex);
path2 = path2.substr(0, searchIndex);
}
if (path2) {
parsedPath.pathname = path2;
}
}
return parsedPath;
}
var ResultType;
(function(ResultType2) {
ResultType2["data"] = "data";
ResultType2["deferred"] = "deferred";
ResultType2["redirect"] = "redirect";
ResultType2["error"] = "error";
})(ResultType || (ResultType = {}));
function matchRoutes(routes, locationArg, basename) {
if (basename === void 0) {
basename = "/";
}
let location2 = typeof locationArg === "string" ? parsePath$1(locationArg) : locationArg;
let pathname = stripBasename(location2.pathname || "/", basename);
if (pathname == null) {
return null;
}
let branches = flattenRoutes(routes);
rankRouteBranches(branches);
let matches = null;
for (let i2 = 0; matches == null && i2 < branches.length; ++i2) {
matches = matchRouteBranch(branches[i2], pathname);
}
return matches;
}
function flattenRoutes(routes, branches, parentsMeta, parentPath) {
if (branches === void 0) {
branches = [];
}
if (parentsMeta === void 0) {
parentsMeta = [];
}
if (parentPath === void 0) {
parentPath = "";
}
routes.forEach((route2, index2) => {
let meta = {
relativePath: route2.path || "",
caseSensitive: route2.caseSensitive === true,
childrenIndex: index2,
route: route2
};
if (meta.relativePath.startsWith("/")) {
invariant$2(meta.relativePath.startsWith(parentPath), 'Absolute route path "' + meta.relativePath + '" nested under path ' + ('"' + parentPath + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes.");
meta.relativePath = meta.relativePath.slice(parentPath.length);
}
let path2 = joinPaths([parentPath, meta.relativePath]);
let routesMeta = parentsMeta.concat(meta);
if (route2.children && route2.children.length > 0) {
invariant$2(
// Our types know better, but runtime JS may not!
// @ts-expect-error
route2.index !== true,
"Index routes must not have child routes. Please remove " + ('all child routes from route path "' + path2 + '".')
);
flattenRoutes(route2.children, branches, routesMeta, path2);
}
if (route2.path == null && !route2.index) {
return;
}
branches.push({
path: path2,
score: computeScore(path2, route2.index),
routesMeta
});
});
return branches;
}
function rankRouteBranches(branches) {
branches.sort((a2, b2) => a2.score !== b2.score ? b2.score - a2.score : compareIndexes(a2.routesMeta.map((meta) => meta.childrenIndex), b2.routesMeta.map((meta) => meta.childrenIndex)));
}
const paramRe = /^:\w+$/;
const dynamicSegmentValue = 3;
const indexRouteValue = 2;
const emptySegmentValue = 1;
const staticSegmentValue = 10;
const splatPenalty = -2;
const isSplat = (s2) => s2 === "*";
function computeScore(path2, index2) {
let segments2 = path2.split("/");
let initialScore = segments2.length;
if (segments2.some(isSplat)) {
initialScore += splatPenalty;
}
if (index2) {
initialScore += indexRouteValue;
}
return segments2.filter((s2) => !isSplat(s2)).reduce((score2, segment) => score2 + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
}
function compareIndexes(a2, b2) {
let siblings = a2.length === b2.length && a2.slice(0, -1).every((n2, i2) => n2 === b2[i2]);
return siblings ? (
// If two routes are siblings, we should try to match the earlier sibling
// first. This allows people to have fine-grained control over the matching
// behavior by simply putting routes with identical paths in the order they
// want them tried.
a2[a2.length - 1] - b2[b2.length - 1]
) : (
// Otherwise, it doesn't really make sense to rank non-siblings by index,
// so they sort equally.
0
);
}
function matchRouteBranch(branch, pathname) {
let {
routesMeta
} = branch;
let matchedParams = {};
let matchedPathname = "/";
let matches = [];
for (let i2 = 0; i2 < routesMeta.length; ++i2) {
let meta = routesMeta[i2];
let end2 = i2 === routesMeta.length - 1;
let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
let match2 = matchPath({
path: meta.relativePath,
caseSensitive: meta.caseSensitive,
end: end2
}, remainingPathname);
if (!match2)
return null;
Object.assign(matchedParams, match2.params);
let route2 = meta.route;
matches.push({
// TODO: Can this as be avoided?
params: matchedParams,
pathname: joinPaths([matchedPathname, match2.pathname]),
pathnameBase: normalizePathname(joinPaths([matchedPathname, match2.pathnameBase])),
route: route2
});
if (match2.pathnameBase !== "/") {
matchedPathname = joinPaths([matchedPathname, match2.pathnameBase]);
}
}
return matches;
}
function matchPath(pattern, pathname) {
if (typeof pattern === "string") {
pattern = {
path: pattern,
caseSensitive: false,
end: true
};
}
let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
let match2 = pathname.match(matcher);
if (!match2)
return null;
let matchedPathname = match2[0];
let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
let captureGroups = match2.slice(1);
let params2 = paramNames.reduce((memo, paramName, index2) => {
if (paramName === "*") {
let splatValue = captureGroups[index2] || "";
pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
}
memo[paramName] = safelyDecodeURIComponent(captureGroups[index2] || "", paramName);
return memo;
}, {});
return {
params: params2,
pathname: matchedPathname,
pathnameBase,
pattern
};
}
function compilePath(path2, caseSensitive, end2) {
if (caseSensitive === void 0) {
caseSensitive = false;
}
if (end2 === void 0) {
end2 = true;
}
warning$2(path2 === "*" || !path2.endsWith("*") || path2.endsWith("/*"), 'Route path "' + path2 + '" will be treated as if it were ' + ('"' + path2.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + path2.replace(/\*$/, "/*") + '".'));
let paramNames = [];
let regexpSource = "^" + path2.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^$?{}|()[\]]/g, "\\$&").replace(/:(\w+)/g, (_24, paramName) => {
paramNames.push(paramName);
return "([^\\/]+)";
});
if (path2.endsWith("*")) {
paramNames.push("*");
regexpSource += path2 === "*" || path2 === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
} else if (end2) {
regexpSource += "\\/*$";
} else if (path2 !== "" && path2 !== "/") {
regexpSource += "(?:(?=\\/|$))";
} else
;
let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i");
return [matcher, paramNames];
}
function safelyDecodeURIComponent(value2, paramName) {
try {
return decodeURIComponent(value2);
} catch (error3) {
warning$2(false, 'The value for the URL param "' + paramName + '" will not be decoded because' + (' the string "' + value2 + '" is a malformed URL segment. This is probably') + (" due to a bad percent encoding (" + error3 + ")."));
return value2;
}
}
function stripBasename(pathname, basename) {
if (basename === "/")
return pathname;
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
return null;
}
let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
let nextChar = pathname.charAt(startIndex);
if (nextChar && nextChar !== "/") {
return null;
}
return pathname.slice(startIndex) || "/";
}
function invariant$2(value2, message) {
if (value2 === false || value2 === null || typeof value2 === "undefined") {
throw new Error(message);
}
}
function warning$2(cond, message) {
if (!cond) {
if (typeof console !== "undefined")
console.warn(message);
try {
throw new Error(message);
} catch (e7) {
}
}
}
function resolvePath(to2, fromPathname) {
if (fromPathname === void 0) {
fromPathname = "/";
}
let {
pathname: toPathname,
search = "",
hash: hash2 = ""
} = typeof to2 === "string" ? parsePath$1(to2) : to2;
let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
return {
pathname,
search: normalizeSearch(search),
hash: normalizeHash(hash2)
};
}
function resolvePathname(relativePath, fromPathname) {
let segments2 = fromPathname.replace(/\/+$/, "").split("/");
let relativeSegments = relativePath.split("/");
relativeSegments.forEach((segment) => {
if (segment === "..") {
if (segments2.length > 1)
segments2.pop();
} else if (segment !== ".") {
segments2.push(segment);
}
});
return segments2.length > 1 ? segments2.join("/") : "/";
}
function getInvalidPathError(char2, field2, dest, path2) {
return "Cannot include a '" + char2 + "' character in a manually specified " + ("`to." + field2 + "` field [" + JSON.stringify(path2) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
}
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
if (isPathRelative === void 0) {
isPathRelative = false;
}
let to2;
if (typeof toArg === "string") {
to2 = parsePath$1(toArg);
} else {
to2 = _extends$2({}, toArg);
invariant$2(!to2.pathname || !to2.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to2));
invariant$2(!to2.pathname || !to2.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to2));
invariant$2(!to2.search || !to2.search.includes("#"), getInvalidPathError("#", "search", "hash", to2));
}
let isEmptyPath = toArg === "" || to2.pathname === "";
let toPathname = isEmptyPath ? "/" : to2.pathname;
let from2;
if (isPathRelative || toPathname == null) {
from2 = locationPathname;
} else {
let routePathnameIndex = routePathnames.length - 1;
if (toPathname.startsWith("..")) {
let toSegments = toPathname.split("/");
while (toSegments[0] === "..") {
toSegments.shift();
routePathnameIndex -= 1;
}
to2.pathname = toSegments.join("/");
}
from2 = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
}
let path2 = resolvePath(to2, from2);
let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
if (!path2.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
path2.pathname += "/";
}
return path2;
}
const joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
const normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
const normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
const normalizeHash = (hash2) => !hash2 || hash2 === "#" ? "" : hash2.startsWith("#") ? hash2 : "#" + hash2;
class ErrorResponse {
constructor(status, statusText, data2) {
this.status = status;
this.statusText = statusText || "";
this.data = data2;
}
}
function isRouteErrorResponse(e7) {
return e7 instanceof ErrorResponse;
}
/**
* React Router v6.4.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function _extends$1() {
_extends$1 = Object.assign ? Object.assign.bind() : function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends$1.apply(this, arguments);
}
function isPolyfill(x2, y2) {
return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
}
const is = typeof Object.is === "function" ? Object.is : isPolyfill;
const {
useState,
useEffect,
useLayoutEffect,
useDebugValue
} = React$1;
function useSyncExternalStore$2(subscribe, getSnapshot, getServerSnapshot) {
const value2 = getSnapshot();
const [{
inst
}, forceUpdate] = useState({
inst: {
value: value2,
getSnapshot
}
});
useLayoutEffect(() => {
inst.value = value2;
inst.getSnapshot = getSnapshot;
if (checkIfSnapshotChanged(inst)) {
forceUpdate({
inst
});
}
}, [subscribe, value2, getSnapshot]);
useEffect(() => {
if (checkIfSnapshotChanged(inst)) {
forceUpdate({
inst
});
}
const handleStoreChange = () => {
if (checkIfSnapshotChanged(inst)) {
forceUpdate({
inst
});
}
};
return subscribe(handleStoreChange);
}, [subscribe]);
useDebugValue(value2);
return value2;
}
function checkIfSnapshotChanged(inst) {
const latestGetSnapshot = inst.getSnapshot;
const prevValue = inst.value;
try {
const nextValue = latestGetSnapshot();
return !is(prevValue, nextValue);
} catch (error3) {
return true;
}
}
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
return getSnapshot();
}
const canUseDOM$2 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
const isServerEnvironment = !canUseDOM$2;
const shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;
"useSyncExternalStore" in React$1 ? ((module) => module.useSyncExternalStore)(React$1) : shim;
const DataStaticRouterContext = /* @__PURE__ */ reactExports.createContext(null);
const DataRouterContext = /* @__PURE__ */ reactExports.createContext(null);
const DataRouterStateContext = /* @__PURE__ */ reactExports.createContext(null);
const NavigationContext = /* @__PURE__ */ reactExports.createContext(null);
const LocationContext = /* @__PURE__ */ reactExports.createContext(null);
const RouteContext = /* @__PURE__ */ reactExports.createContext({
outlet: null,
matches: []
});
const RouteErrorContext = /* @__PURE__ */ reactExports.createContext(null);
function useInRouterContext() {
return reactExports.useContext(LocationContext) != null;
}
function useLocation() {
!useInRouterContext() ? invariant$2(false) : void 0;
return reactExports.useContext(LocationContext).location;
}
function getPathContributingMatches(matches) {
return matches.filter((match2, index2) => index2 === 0 || !match2.route.index && match2.pathnameBase !== matches[index2 - 1].pathnameBase);
}
function useNavigate() {
!useInRouterContext() ? invariant$2(false) : void 0;
let {
basename,
navigator: navigator2
} = reactExports.useContext(NavigationContext);
let {
matches
} = reactExports.useContext(RouteContext);
let {
pathname: locationPathname
} = useLocation();
let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match2) => match2.pathnameBase));
let activeRef = reactExports.useRef(false);
reactExports.useEffect(() => {
activeRef.current = true;
});
let navigate = reactExports.useCallback(function(to2, options2) {
if (options2 === void 0) {
options2 = {};
}
if (!activeRef.current)
return;
if (typeof to2 === "number") {
navigator2.go(to2);
return;
}
let path2 = resolveTo(to2, JSON.parse(routePathnamesJson), locationPathname, options2.relative === "path");
if (basename !== "/") {
path2.pathname = path2.pathname === "/" ? basename : joinPaths([basename, path2.pathname]);
}
(!!options2.replace ? navigator2.replace : navigator2.push)(path2, options2.state, options2);
}, [basename, navigator2, routePathnamesJson, locationPathname]);
return navigate;
}
function useParams() {
let {
matches
} = reactExports.useContext(RouteContext);
let routeMatch = matches[matches.length - 1];
return routeMatch ? routeMatch.params : {};
}
function useRoutes(routes, locationArg) {
!useInRouterContext() ? invariant$2(false) : void 0;
let dataRouterStateContext = reactExports.useContext(DataRouterStateContext);
let {
matches: parentMatches
} = reactExports.useContext(RouteContext);
let routeMatch = parentMatches[parentMatches.length - 1];
let parentParams = routeMatch ? routeMatch.params : {};
routeMatch ? routeMatch.pathname : "/";
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
routeMatch && routeMatch.route;
let locationFromContext = useLocation();
let location2;
if (locationArg) {
var _parsedLocationArg$pa;
let parsedLocationArg = typeof locationArg === "string" ? parsePath$1(locationArg) : locationArg;
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? invariant$2(false) : void 0;
location2 = parsedLocationArg;
} else {
location2 = locationFromContext;
}
let pathname = location2.pathname || "/";
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
let matches = matchRoutes(routes, {
pathname: remainingPathname
});
let renderedMatches = _renderMatches(matches && matches.map((match2) => Object.assign({}, match2, {
params: Object.assign({}, parentParams, match2.params),
pathname: joinPaths([parentPathnameBase, match2.pathname]),
pathnameBase: match2.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match2.pathnameBase])
})), parentMatches, dataRouterStateContext || void 0);
if (locationArg) {
return /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, {
value: {
location: _extends$1({
pathname: "/",
search: "",
hash: "",
state: null,
key: "default"
}, location2),
navigationType: Action$2.Pop
}
}, renderedMatches);
}
return renderedMatches;
}
function DefaultErrorElement() {
let error3 = useRouteError();
let message = isRouteErrorResponse(error3) ? error3.status + " " + error3.statusText : error3 instanceof Error ? error3.message : JSON.stringify(error3);
let stack = error3 instanceof Error ? error3.stack : null;
let lightgrey = "rgba(200,200,200, 0.5)";
let preStyles = {
padding: "0.5rem",
backgroundColor: lightgrey
};
let codeStyles = {
padding: "2px 4px",
backgroundColor: lightgrey
};
return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("h2", null, "Unhandled Thrown Error!"), /* @__PURE__ */ reactExports.createElement("h3", {
style: {
fontStyle: "italic"
}
}, message), stack ? /* @__PURE__ */ reactExports.createElement("pre", {
style: preStyles
}, stack) : null, /* @__PURE__ */ reactExports.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ reactExports.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ reactExports.createElement("code", {
style: codeStyles
}, "errorElement"), " props on ", /* @__PURE__ */ reactExports.createElement("code", {
style: codeStyles
}, "<Route>")));
}
class RenderErrorBoundary extends reactExports.Component {
constructor(props) {
super(props);
this.state = {
location: props.location,
error: props.error
};
}
static getDerivedStateFromError(error3) {
return {
error: error3
};
}
static getDerivedStateFromProps(props, state) {
if (state.location !== props.location) {
return {
error: props.error,
location: props.location
};
}
return {
error: props.error || state.error,
location: state.location
};
}
componentDidCatch(error3, errorInfo) {
console.error("React Router caught the following error during render", error3, errorInfo);
}
render() {
return this.state.error ? /* @__PURE__ */ reactExports.createElement(RouteErrorContext.Provider, {
value: this.state.error,
children: this.props.component
}) : this.props.children;
}
}
function RenderedRoute(_ref3) {
let {
routeContext,
match: match2,
children: children2
} = _ref3;
let dataStaticRouterContext = reactExports.useContext(DataStaticRouterContext);
if (dataStaticRouterContext && match2.route.errorElement) {
dataStaticRouterContext._deepestRenderedBoundaryId = match2.route.id;
}
return /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, {
value: routeContext
}, children2);
}
function _renderMatches(matches, parentMatches, dataRouterState) {
if (parentMatches === void 0) {
parentMatches = [];
}
if (matches == null) {
if (dataRouterState != null && dataRouterState.errors) {
matches = dataRouterState.matches;
} else {
return null;
}
}
let renderedMatches = matches;
let errors = dataRouterState == null ? void 0 : dataRouterState.errors;
if (errors != null) {
let errorIndex = renderedMatches.findIndex((m2) => m2.route.id && (errors == null ? void 0 : errors[m2.route.id]));
!(errorIndex >= 0) ? invariant$2(false) : void 0;
renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
}
return renderedMatches.reduceRight((outlet, match2, index2) => {
let error3 = match2.route.id ? errors == null ? void 0 : errors[match2.route.id] : null;
let errorElement = dataRouterState ? match2.route.errorElement || /* @__PURE__ */ reactExports.createElement(DefaultErrorElement, null) : null;
let getChildren2 = () => /* @__PURE__ */ reactExports.createElement(RenderedRoute, {
match: match2,
routeContext: {
outlet,
matches: parentMatches.concat(renderedMatches.slice(0, index2 + 1))
}
}, error3 ? errorElement : match2.route.element !== void 0 ? match2.route.element : outlet);
return dataRouterState && (match2.route.errorElement || index2 === 0) ? /* @__PURE__ */ reactExports.createElement(RenderErrorBoundary, {
location: dataRouterState.location,
component: errorElement,
error: error3,
children: getChildren2()
}) : getChildren2();
}, null);
}
var DataRouterHook$1;
(function(DataRouterHook2) {
DataRouterHook2["UseRevalidator"] = "useRevalidator";
})(DataRouterHook$1 || (DataRouterHook$1 = {}));
var DataRouterStateHook$1;
(function(DataRouterStateHook2) {
DataRouterStateHook2["UseLoaderData"] = "useLoaderData";
DataRouterStateHook2["UseActionData"] = "useActionData";
DataRouterStateHook2["UseRouteError"] = "useRouteError";
DataRouterStateHook2["UseNavigation"] = "useNavigation";
DataRouterStateHook2["UseRouteLoaderData"] = "useRouteLoaderData";
DataRouterStateHook2["UseMatches"] = "useMatches";
DataRouterStateHook2["UseRevalidator"] = "useRevalidator";
})(DataRouterStateHook$1 || (DataRouterStateHook$1 = {}));
function useDataRouterState(hookName) {
let state = reactExports.useContext(DataRouterStateContext);
!state ? invariant$2(false) : void 0;
return state;
}
function useRouteError() {
var _state$errors;
let error3 = reactExports.useContext(RouteErrorContext);
let state = useDataRouterState(DataRouterStateHook$1.UseRouteError);
let route2 = reactExports.useContext(RouteContext);
let thisRoute = route2.matches[route2.matches.length - 1];
if (error3) {
return error3;
}
!route2 ? invariant$2(false) : void 0;
!thisRoute.route.id ? invariant$2(false) : void 0;
return (_state$errors = state.errors) == null ? void 0 : _state$errors[thisRoute.route.id];
}
function Navigate(_ref3) {
let {
to: to2,
replace: replace2,
state,
relative
} = _ref3;
!useInRouterContext() ? invariant$2(false) : void 0;
let dataRouterState = reactExports.useContext(DataRouterStateContext);
let navigate = useNavigate();
reactExports.useEffect(() => {
if (dataRouterState && dataRouterState.navigation.state !== "idle") {
return;
}
navigate(to2, {
replace: replace2,
state,
relative
});
});
return null;
}
function Route(_props) {
invariant$2(false);
}
function Router(_ref4) {
let {
basename: basenameProp = "/",
children: children2 = null,
location: locationProp,
navigationType = Action$2.Pop,
navigator: navigator2,
static: staticProp = false
} = _ref4;
!!useInRouterContext() ? invariant$2(false) : void 0;
let basename = basenameProp.replace(/^\/*/, "/");
let navigationContext = reactExports.useMemo(() => ({
basename,
navigator: navigator2,
static: staticProp
}), [basename, navigator2, staticProp]);
if (typeof locationProp === "string") {
locationProp = parsePath$1(locationProp);
}
let {
pathname = "/",
search = "",
hash: hash2 = "",
state = null,
key: key2 = "default"
} = locationProp;
let location2 = reactExports.useMemo(() => {
let trailingPathname = stripBasename(pathname, basename);
if (trailingPathname == null) {
return null;
}
return {
pathname: trailingPathname,
search,
hash: hash2,
state,
key: key2
};
}, [basename, pathname, search, hash2, state, key2]);
if (location2 == null) {
return null;
}
return /* @__PURE__ */ reactExports.createElement(NavigationContext.Provider, {
value: navigationContext
}, /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, {
children: children2,
value: {
location: location2,
navigationType
}
}));
}
function Routes(_ref5) {
let {
children: children2,
location: location2
} = _ref5;
let dataRouterContext = reactExports.useContext(DataRouterContext);
let routes = dataRouterContext && !children2 ? dataRouterContext.router.routes : createRoutesFromChildren(children2);
return useRoutes(routes, location2);
}
var AwaitRenderStatus;
(function(AwaitRenderStatus2) {
AwaitRenderStatus2[AwaitRenderStatus2["pending"] = 0] = "pending";
AwaitRenderStatus2[AwaitRenderStatus2["success"] = 1] = "success";
AwaitRenderStatus2[AwaitRenderStatus2["error"] = 2] = "error";
})(AwaitRenderStatus || (AwaitRenderStatus = {}));
new Promise(() => {
});
function createRoutesFromChildren(children2, parentPath) {
if (parentPath === void 0) {
parentPath = [];
}
let routes = [];
reactExports.Children.forEach(children2, (element2, index2) => {
if (!/* @__PURE__ */ reactExports.isValidElement(element2)) {
return;
}
if (element2.type === reactExports.Fragment) {
routes.push.apply(routes, createRoutesFromChildren(element2.props.children, parentPath));
return;
}
!(element2.type === Route) ? invariant$2(false) : void 0;
!(!element2.props.index || !element2.props.children) ? invariant$2(false) : void 0;
let treePath2 = [...parentPath, index2];
let route2 = {
id: element2.props.id || treePath2.join("-"),
caseSensitive: element2.props.caseSensitive,
element: element2.props.element,
index: element2.props.index,
path: element2.props.path,
loader: element2.props.loader,
action: element2.props.action,
errorElement: element2.props.errorElement,
hasErrorBoundary: element2.props.errorElement != null,
shouldRevalidate: element2.props.shouldRevalidate,
handle: element2.props.handle
};
if (element2.props.children) {
route2.children = createRoutesFromChildren(element2.props.children, treePath2);
}
routes.push(route2);
});
return routes;
}
/**
* React Router DOM v6.4.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function HistoryRouter(_ref3) {
let {
basename,
children: children2,
history
} = _ref3;
const [state, setState2] = reactExports.useState({
action: history.action,
location: history.location
});
reactExports.useLayoutEffect(() => history.listen(setState2), [history]);
return /* @__PURE__ */ reactExports.createElement(Router, {
basename,
children: children2,
location: state.location,
navigationType: state.action,
navigator: history
});
}
var DataRouterHook;
(function(DataRouterHook2) {
DataRouterHook2["UseScrollRestoration"] = "useScrollRestoration";
DataRouterHook2["UseSubmitImpl"] = "useSubmitImpl";
DataRouterHook2["UseFetcher"] = "useFetcher";
})(DataRouterHook || (DataRouterHook = {}));
var DataRouterStateHook;
(function(DataRouterStateHook2) {
DataRouterStateHook2["UseFetchers"] = "useFetchers";
DataRouterStateHook2["UseScrollRestoration"] = "useScrollRestoration";
})(DataRouterStateHook || (DataRouterStateHook = {}));
function _typeof$3(o2) {
"@babel/helpers - typeof";
return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
return typeof o3;
} : function(o3) {
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
}, _typeof$3(o2);
}
const _typeof$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _typeof$3
}, Symbol.toStringTag, { value: "Module" }));
function _toPrimitive(input, hint) {
if (_typeof$3(input) !== "object" || input === null)
return input;
var prim = input[Symbol.toPrimitive];
if (prim !== void 0) {
var res = prim.call(input, hint || "default");
if (_typeof$3(res) !== "object")
return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key2 = _toPrimitive(arg, "string");
return _typeof$3(key2) === "symbol" ? key2 : String(key2);
}
function _defineProperty$3(obj, key2, value2) {
key2 = _toPropertyKey(key2);
if (key2 in obj) {
Object.defineProperty(obj, key2, {
value: value2,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key2] = value2;
}
return obj;
}
const defineProperty$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _defineProperty$3
}, Symbol.toStringTag, { value: "Module" }));
function ownKeys$d(e7, r2) {
var t5 = Object.keys(e7);
if (Object.getOwnPropertySymbols) {
var o2 = Object.getOwnPropertySymbols(e7);
r2 && (o2 = o2.filter(function(r3) {
return Object.getOwnPropertyDescriptor(e7, r3).enumerable;
})), t5.push.apply(t5, o2);
}
return t5;
}
function _objectSpread2(e7) {
for (var r2 = 1; r2 < arguments.length; r2++) {
var t5 = null != arguments[r2] ? arguments[r2] : {};
r2 % 2 ? ownKeys$d(Object(t5), true).forEach(function(r3) {
_defineProperty$3(e7, r3, t5[r3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e7, Object.getOwnPropertyDescriptors(t5)) : ownKeys$d(Object(t5)).forEach(function(r3) {
Object.defineProperty(e7, r3, Object.getOwnPropertyDescriptor(t5, r3));
});
}
return e7;
}
function formatProdErrorMessage(code) {
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or use the non-minified dev environment for full errors. ";
}
var $$observable = function() {
return typeof Symbol === "function" && Symbol.observable || "@@observable";
}();
var randomString = function randomString2() {
return Math.random().toString(36).substring(7).split("").join(".");
};
var ActionTypes = {
INIT: "@@redux/INIT" + randomString(),
REPLACE: "@@redux/REPLACE" + randomString(),
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
}
};
function isPlainObject(obj) {
if (typeof obj !== "object" || obj === null)
return false;
var proto = obj;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(obj) === proto;
}
function createStore(reducer2, preloadedState, enhancer) {
var _ref22;
if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
throw new Error(formatProdErrorMessage(0));
}
if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
enhancer = preloadedState;
preloadedState = void 0;
}
if (typeof enhancer !== "undefined") {
if (typeof enhancer !== "function") {
throw new Error(formatProdErrorMessage(1));
}
return enhancer(createStore)(reducer2, preloadedState);
}
if (typeof reducer2 !== "function") {
throw new Error(formatProdErrorMessage(2));
}
var currentReducer = reducer2;
var currentState = preloadedState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
function getState2() {
if (isDispatching) {
throw new Error(formatProdErrorMessage(3));
}
return currentState;
}
function subscribe(listener2) {
if (typeof listener2 !== "function") {
throw new Error(formatProdErrorMessage(4));
}
if (isDispatching) {
throw new Error(formatProdErrorMessage(5));
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener2);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
if (isDispatching) {
throw new Error(formatProdErrorMessage(6));
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index2 = nextListeners.indexOf(listener2);
nextListeners.splice(index2, 1);
currentListeners = null;
};
}
function dispatch2(action) {
if (!isPlainObject(action)) {
throw new Error(formatProdErrorMessage(7));
}
if (typeof action.type === "undefined") {
throw new Error(formatProdErrorMessage(8));
}
if (isDispatching) {
throw new Error(formatProdErrorMessage(9));
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i2 = 0; i2 < listeners.length; i2++) {
var listener2 = listeners[i2];
listener2();
}
return action;
}
function replaceReducer(nextReducer) {
if (typeof nextReducer !== "function") {
throw new Error(formatProdErrorMessage(10));
}
currentReducer = nextReducer;
dispatch2({
type: ActionTypes.REPLACE
});
}
function observable2() {
var _ref3;
var outerSubscribe = subscribe;
return _ref3 = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe2(observer) {
if (typeof observer !== "object" || observer === null) {
throw new Error(formatProdErrorMessage(11));
}
function observeState() {
if (observer.next) {
observer.next(getState2());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return {
unsubscribe
};
}
}, _ref3[$$observable] = function() {
return this;
}, _ref3;
}
dispatch2({
type: ActionTypes.INIT
});
return _ref22 = {
dispatch: dispatch2,
subscribe,
getState: getState2,
replaceReducer
}, _ref22[$$observable] = observable2, _ref22;
}
var legacy_createStore = createStore;
function assertReducerShape(reducers) {
Object.keys(reducers).forEach(function(key2) {
var reducer2 = reducers[key2];
var initialState2 = reducer2(void 0, {
type: ActionTypes.INIT
});
if (typeof initialState2 === "undefined") {
throw new Error(formatProdErrorMessage(12));
}
if (typeof reducer2(void 0, {
type: ActionTypes.PROBE_UNKNOWN_ACTION()
}) === "undefined") {
throw new Error(formatProdErrorMessage(13));
}
});
}
function combineReducers(reducers) {
var reducerKeys = Object.keys(reducers);
var finalReducers = {};
for (var i2 = 0; i2 < reducerKeys.length; i2++) {
var key2 = reducerKeys[i2];
if (typeof reducers[key2] === "function") {
finalReducers[key2] = reducers[key2];
}
}
var finalReducerKeys = Object.keys(finalReducers);
var shapeAssertionError;
try {
assertReducerShape(finalReducers);
} catch (e7) {
shapeAssertionError = e7;
}
return function combination(state, action) {
if (state === void 0) {
state = {};
}
if (shapeAssertionError) {
throw shapeAssertionError;
}
var hasChanged = false;
var nextState = {};
for (var _i2 = 0; _i2 < finalReducerKeys.length; _i2++) {
var _key = finalReducerKeys[_i2];
var reducer2 = finalReducers[_key];
var previousStateForKey = state[_key];
var nextStateForKey = reducer2(previousStateForKey, action);
if (typeof nextStateForKey === "undefined") {
action && action.type;
throw new Error(formatProdErrorMessage(14));
}
nextState[_key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
return hasChanged ? nextState : state;
};
}
function bindActionCreator(actionCreator, dispatch2) {
return function() {
return dispatch2(actionCreator.apply(this, arguments));
};
}
function bindActionCreators(actionCreators, dispatch2) {
if (typeof actionCreators === "function") {
return bindActionCreator(actionCreators, dispatch2);
}
if (typeof actionCreators !== "object" || actionCreators === null) {
throw new Error(formatProdErrorMessage(16));
}
var boundActionCreators = {};
for (var key2 in actionCreators) {
var actionCreator = actionCreators[key2];
if (typeof actionCreator === "function") {
boundActionCreators[key2] = bindActionCreator(actionCreator, dispatch2);
}
}
return boundActionCreators;
}
function compose$2() {
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function(arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
return funcs.reduce(function(a2, b2) {
return function() {
return a2(b2.apply(void 0, arguments));
};
});
}
function applyMiddleware() {
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function(createStore2) {
return function() {
var store = createStore2.apply(void 0, arguments);
var _dispatch = function dispatch2() {
throw new Error(formatProdErrorMessage(15));
};
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch2() {
return _dispatch.apply(void 0, arguments);
}
};
var chain = middlewares.map(function(middleware2) {
return middleware2(middlewareAPI);
});
_dispatch = compose$2.apply(void 0, chain)(store.dispatch);
return _objectSpread2(_objectSpread2({}, store), {}, {
dispatch: _dispatch
});
};
};
}
const redux = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
__DO_NOT_USE__ActionTypes: ActionTypes,
applyMiddleware,
bindActionCreators,
combineReducers,
compose: compose$2,
createStore,
legacy_createStore
}, Symbol.toStringTag, { value: "Module" }));
function createThunkMiddleware(extraArgument) {
var middleware2 = function middleware3(_ref3) {
var dispatch2 = _ref3.dispatch, getState2 = _ref3.getState;
return function(next2) {
return function(action) {
if (typeof action === "function") {
return action(dispatch2, getState2, extraArgument);
}
return next2(action);
};
};
};
return middleware2;
}
var thunk = createThunkMiddleware();
thunk.withExtraArgument = createThunkMiddleware;
const thunkMiddleware = thunk;
const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(redux);
var compose$1 = require$$0$1.compose;
var composeWithDevTools = function() {
if (arguments.length === 0)
return void 0;
if (typeof arguments[0] === "object")
return compose$1;
return compose$1.apply(null, arguments);
};
var tcache = {};
function tokenize$1(fmt) {
if (tcache[fmt])
return tcache[fmt];
var out = [];
var start2 = 0;
var i2 = 0;
var infmt = false;
var fmtparam = "", fmtflags = "", fmtwidth = "", fmtprec = "", fmtlen = "";
var c2 = 0;
var L2 = fmt.length;
for (; i2 < L2; ++i2) {
c2 = fmt.charCodeAt(i2);
if (!infmt) {
if (c2 !== 37)
continue;
if (start2 < i2)
out.push(["L", fmt.substring(start2, i2)]);
start2 = i2;
infmt = true;
continue;
}
if (c2 >= 48 && c2 < 58) {
if (fmtprec.length)
fmtprec += String.fromCharCode(c2);
else if (c2 == 48 && !fmtwidth.length)
fmtflags += String.fromCharCode(c2);
else
fmtwidth += String.fromCharCode(c2);
} else
switch (c2) {
case 36:
if (fmtprec.length)
fmtprec += "$";
else if (fmtwidth.charAt(0) == "*")
fmtwidth += "$";
else {
fmtparam = fmtwidth + "$";
fmtwidth = "";
}
break;
case 39:
fmtflags += "'";
break;
case 45:
fmtflags += "-";
break;
case 43:
fmtflags += "+";
break;
case 32:
fmtflags += " ";
break;
case 35:
fmtflags += "#";
break;
case 46:
fmtprec = ".";
break;
case 42:
if (fmtprec.charAt(0) == ".")
fmtprec += "*";
else
fmtwidth += "*";
break;
case 104:
case 108:
if (fmtlen.length > 1)
throw "bad length " + fmtlen + String(c2);
fmtlen += String.fromCharCode(c2);
break;
case 76:
case 106:
case 122:
case 116:
case 113:
case 90:
case 119:
if (fmtlen !== "")
throw "bad length " + fmtlen + String.fromCharCode(c2);
fmtlen = String.fromCharCode(c2);
break;
case 73:
if (fmtlen !== "")
throw "bad length " + fmtlen + "I";
fmtlen = "I";
break;
case 100:
case 105:
case 111:
case 117:
case 120:
case 88:
case 102:
case 70:
case 101:
case 69:
case 103:
case 71:
case 97:
case 65:
case 99:
case 67:
case 115:
case 83:
case 112:
case 110:
case 68:
case 85:
case 79:
case 109:
case 98:
case 66:
case 121:
case 89:
case 74:
case 86:
case 84:
case 37:
infmt = false;
if (fmtprec.length > 1)
fmtprec = fmtprec.substr(1);
out.push([String.fromCharCode(c2), fmt.substring(start2, i2 + 1), fmtparam, fmtflags, fmtwidth, fmtprec, fmtlen]);
start2 = i2 + 1;
fmtlen = fmtprec = fmtwidth = fmtflags = fmtparam = "";
break;
default:
throw new Error("Invalid format string starting with |" + fmt.substring(start2, i2 + 1) + "|");
}
}
if (start2 < fmt.length)
out.push(["L", fmt.substring(start2)]);
return tcache[fmt] = out;
}
var u_inspect = JSON.stringify;
function doit(t5, args) {
var o2 = "";
var argidx = 0, idx = 0;
var Vnum = 0;
var pad2 = "";
for (var i2 = 0; i2 < t5.length; ++i2) {
var m2 = t5[i2], c2 = m2[0].charCodeAt(0);
if (c2 === /*L*/
76) {
o2 += /*o.push*/
m2[1];
continue;
}
if (c2 === /*%*/
37) {
o2 += /*o.push*/
"%";
continue;
}
var O2 = "";
var isnum = 0, radix = 10, bytes = 4, sign2 = false;
var flags = m2[3];
var alt = flags.indexOf("#") > -1;
if (m2[2])
argidx = parseInt(m2[2], 10) - 1;
else if (c2 === /*m*/
109 && !alt) {
o2 += /*.push*/
"Success";
continue;
}
var width2 = 0;
if (m2[4].length > 0) {
if (m2[4].charAt(0) !== "*")
width2 = parseInt(m2[4], 10);
else if (m2[4].length === 1)
width2 = args[idx++];
else
width2 = args[parseInt(m2[4].substr(1), 10) - 1];
}
var prec = -1;
if (m2[5].length > 0) {
if (m2[5].charAt(0) !== "*")
prec = parseInt(m2[5], 10);
else if (m2[5].length === 1)
prec = args[idx++];
else
prec = args[parseInt(m2[5].substr(1), 10) - 1];
}
if (!m2[2])
argidx = idx++;
var arg = args[argidx];
var len = m2[6];
switch (c2) {
case /*S*/
83:
case /*s*/
115:
O2 = String(arg);
if (prec >= 0)
O2 = O2.substr(0, prec);
if (width2 > O2.length || -width2 > O2.length) {
if ((flags.indexOf("-") == -1 || width2 < 0) && flags.indexOf("0") != -1) {
pad2 = width2 - O2.length >= 0 ? "0".repeat(width2 - O2.length) : "";
O2 = pad2 + O2;
} else {
pad2 = width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "";
O2 = flags.indexOf("-") > -1 ? O2 + pad2 : pad2 + O2;
}
}
break;
case /*C*/
67:
case /*c*/
99:
switch (typeof arg) {
case "number":
var cc2 = arg;
if (c2 == 67 || len.charCodeAt(0) === /*l*/
108) {
cc2 &= 4294967295;
O2 = String.fromCharCode(cc2);
} else {
cc2 &= 255;
O2 = String.fromCharCode(cc2);
}
break;
case "string":
O2 = /*::(*/
arg.charAt(0);
break;
default:
O2 = String(arg).charAt(0);
}
if (width2 > O2.length || -width2 > O2.length) {
if ((flags.indexOf("-") == -1 || width2 < 0) && flags.indexOf("0") != -1) {
pad2 = width2 - O2.length >= 0 ? "0".repeat(width2 - O2.length) : "";
O2 = pad2 + O2;
} else {
pad2 = width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "";
O2 = flags.indexOf("-") > -1 ? O2 + pad2 : pad2 + O2;
}
}
break;
case /*D*/
68:
bytes = 8;
case /*d*/
100:
case /*i*/
105:
isnum = -1;
sign2 = true;
break;
case /*U*/
85:
bytes = 8;
case /*u*/
117:
isnum = -1;
break;
case /*O*/
79:
bytes = 8;
case /*o*/
111:
isnum = -1;
radix = 8;
break;
case /*x*/
120:
isnum = -1;
radix = -16;
break;
case /*X*/
88:
isnum = -1;
radix = 16;
break;
case /*B*/
66:
bytes = 8;
case /*b*/
98:
isnum = -1;
radix = 2;
break;
case /*F*/
70:
case /*f*/
102:
isnum = 1;
break;
case /*E*/
69:
case /*e*/
101:
isnum = 2;
break;
case /*G*/
71:
case /*g*/
103:
isnum = 3;
break;
case /*A*/
65:
case /*a*/
97:
isnum = 4;
break;
case /*p*/
112:
Vnum = typeof arg == "number" ? arg : arg ? Number(arg.l) : -1;
if (isNaN(Vnum))
Vnum = -1;
if (alt)
O2 = Vnum.toString(10);
else {
Vnum = Math.abs(Vnum);
O2 = "0x" + Vnum.toString(16).toLowerCase();
}
break;
case /*n*/
110:
if (arg) {
arg.len = o2.length;
}
continue;
case /*m*/
109:
if (!(arg instanceof Error))
O2 = "Success";
else if (arg.message)
O2 = arg.message;
else if (arg.errno)
O2 = "Error number " + arg.errno;
else
O2 = "Error " + String(arg);
break;
case /*J*/
74:
O2 = (alt ? u_inspect : JSON.stringify)(arg);
break;
case /*V*/
86:
O2 = arg == null ? "null" : String(arg.valueOf());
break;
case /*T*/
84:
if (alt) {
O2 = Object.prototype.toString.call(arg).substr(8);
O2 = O2.substr(0, O2.length - 1);
} else
O2 = typeof arg;
break;
case /*Y*/
89:
case /*y*/
121:
O2 = arg ? alt ? "yes" : "true" : alt ? "no" : "false";
if (c2 == /*Y*/
89)
O2 = O2.toUpperCase();
if (prec >= 0)
O2 = O2.substr(0, prec);
if (width2 > O2.length || -width2 > O2.length) {
if ((flags.indexOf("-") == -1 || width2 < 0) && flags.indexOf("0") != -1) {
pad2 = width2 - O2.length >= 0 ? "0".repeat(width2 - O2.length) : "";
O2 = pad2 + O2;
} else {
pad2 = width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "";
O2 = flags.indexOf("-") > -1 ? O2 + pad2 : pad2 + O2;
}
}
break;
}
if (width2 < 0) {
width2 = -width2;
flags += "-";
}
if (isnum == -1) {
Vnum = Number(arg);
switch (len) {
case "hh":
{
bytes = 1;
}
break;
case "h":
{
bytes = 2;
}
break;
case "l":
{
if (bytes == 4)
bytes = 8;
}
break;
case "L":
case "q":
case "ll":
{
if (bytes == 4)
bytes = 8;
}
break;
case "j":
{
if (bytes == 4)
bytes = 8;
}
break;
case "t":
{
if (bytes == 4)
bytes = 8;
}
break;
case "z":
case "Z":
{
if (bytes == 4)
bytes = 8;
}
break;
case "I":
{
if (bytes == 4)
bytes = 8;
}
break;
}
switch (bytes) {
case 1:
Vnum = Vnum & 255;
if (sign2 && Vnum > 127)
Vnum -= 255 + 1;
break;
case 2:
Vnum = Vnum & 65535;
if (sign2 && Vnum > 32767)
Vnum -= 65535 + 1;
break;
case 4:
Vnum = sign2 ? Vnum | 0 : Vnum >>> 0;
break;
default:
Vnum = isNaN(Vnum) ? 0 : Math.round(Vnum);
break;
}
if (bytes > 4 && Vnum < 0 && !sign2) {
if (radix == 16 || radix == -16) {
O2 = (Vnum >>> 0).toString(16);
Vnum = Math.floor((Vnum - (Vnum >>> 0)) / Math.pow(2, 32));
O2 = (Vnum >>> 0).toString(16) + (8 - O2.length >= 0 ? "0".repeat(8 - O2.length) : "") + O2;
O2 = (16 - O2.length >= 0 ? "f".repeat(16 - O2.length) : "") + O2;
if (radix == 16)
O2 = O2.toUpperCase();
} else if (radix == 8) {
O2 = (Vnum >>> 0).toString(8);
O2 = (10 - O2.length >= 0 ? "0".repeat(10 - O2.length) : "") + O2;
Vnum = Math.floor((Vnum - (Vnum >>> 0 & 1073741823)) / Math.pow(2, 30));
O2 = (Vnum >>> 0).toString(8) + O2.substr(O2.length - 10);
O2 = O2.substr(O2.length - 20);
O2 = "1" + (21 - O2.length >= 0 ? "7".repeat(21 - O2.length) : "") + O2;
} else {
Vnum = -Vnum % 1e16;
var d1 = [1, 8, 4, 4, 6, 7, 4, 4, 0, 7, 3, 7, 0, 9, 5, 5, 1, 6, 1, 6];
var di2 = d1.length - 1;
while (Vnum > 0) {
if ((d1[di2] -= Vnum % 10) < 0) {
d1[di2] += 10;
d1[di2 - 1]--;
}
--di2;
Vnum = Math.floor(Vnum / 10);
}
O2 = d1.join("");
}
} else {
if (radix === -16)
O2 = Vnum.toString(16).toLowerCase();
else if (radix === 16)
O2 = Vnum.toString(16).toUpperCase();
else
O2 = Vnum.toString(radix);
}
if (prec === 0 && O2 == "0" && !(radix == 8 && alt))
O2 = "";
else {
if (O2.length < prec + (O2.substr(0, 1) == "-" ? 1 : 0)) {
if (O2.substr(0, 1) != "-")
O2 = (prec - O2.length >= 0 ? "0".repeat(prec - O2.length) : "") + O2;
else
O2 = O2.substr(0, 1) + (prec + 1 - O2.length >= 0 ? "0".repeat(prec + 1 - O2.length) : "") + O2.substr(1);
}
if (!sign2 && alt && Vnum !== 0)
switch (radix) {
case -16:
O2 = "0x" + O2;
break;
case 16:
O2 = "0X" + O2;
break;
case 8:
if (O2.charAt(0) != "0")
O2 = "0" + O2;
break;
case 2:
O2 = "0b" + O2;
break;
}
}
if (sign2 && O2.charAt(0) != "-") {
if (flags.indexOf("+") > -1)
O2 = "+" + O2;
else if (flags.indexOf(" ") > -1)
O2 = " " + O2;
}
if (width2 > 0) {
if (O2.length < width2) {
if (flags.indexOf("-") > -1) {
O2 = O2 + (width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "");
} else if (flags.indexOf("0") > -1 && prec < 0 && O2.length > 0) {
if (prec > O2.length)
O2 = (prec - O2.length >= 0 ? "0".repeat(prec - O2.length) : "") + O2;
pad2 = width2 - O2.length >= 0 ? (prec > 0 ? " " : "0").repeat(width2 - O2.length) : "";
if (O2.charCodeAt(0) < 48) {
if (O2.charAt(2).toLowerCase() == "x")
O2 = O2.substr(0, 3) + pad2 + O2.substring(3);
else
O2 = O2.substr(0, 1) + pad2 + O2.substring(1);
} else if (O2.charAt(1).toLowerCase() == "x")
O2 = O2.substr(0, 2) + pad2 + O2.substring(2);
else
O2 = pad2 + O2;
} else {
O2 = (width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "") + O2;
}
}
}
} else if (isnum > 0) {
Vnum = Number(arg);
if (arg === null)
Vnum = 0 / 0;
if (len == "L")
bytes = 12;
var isf = isFinite(Vnum);
if (!isf) {
if (Vnum < 0)
O2 = "-";
else if (flags.indexOf("+") > -1)
O2 = "+";
else if (flags.indexOf(" ") > -1)
O2 = " ";
O2 += isNaN(Vnum) ? "nan" : "inf";
} else {
var E2 = 0;
if (prec == -1 && isnum != 4)
prec = 6;
if (isnum == 3) {
O2 = Vnum.toExponential(1);
E2 = +O2.substr(O2.indexOf("e") + 1);
if (prec === 0)
prec = 1;
if (prec > E2 && E2 >= -4) {
isnum = 11;
prec = prec - (E2 + 1);
} else {
isnum = 12;
prec = prec - 1;
}
}
var sg2 = Vnum < 0 || 1 / Vnum == -Infinity ? "-" : "";
if (Vnum < 0)
Vnum = -Vnum;
switch (isnum) {
case 1:
case 11:
if (Vnum < 1e21) {
O2 = Vnum.toFixed(prec);
if (isnum == 1) {
if (prec === 0 && alt && O2.indexOf(".") == -1)
O2 += ".";
} else if (!alt)
O2 = O2.replace(/(\.\d*[1-9])0*$/, "$1").replace(/\.0*$/, "");
else if (O2.indexOf(".") == -1)
O2 += ".";
break;
}
O2 = Vnum.toExponential(20);
E2 = +O2.substr(O2.indexOf("e") + 1);
O2 = O2.charAt(0) + O2.substr(2, O2.indexOf("e") - 2);
O2 = O2 + (E2 - O2.length + 1 >= 0 ? "0".repeat(E2 - O2.length + 1) : "");
if (alt || prec > 0 && isnum !== 11)
O2 = O2 + "." + (prec >= 0 ? "0".repeat(prec) : "");
break;
case 2:
case 12:
O2 = Vnum.toExponential(prec);
E2 = O2.indexOf("e");
if (O2.length - E2 === 3)
O2 = O2.substr(0, E2 + 2) + "0" + O2.substr(E2 + 2);
if (alt && O2.indexOf(".") == -1)
O2 = O2.substr(0, E2) + "." + O2.substr(E2);
else if (!alt && isnum == 12)
O2 = O2.replace(/\.0*e/, "e").replace(/\.(\d*[1-9])0*e/, ".$1e");
break;
case 4:
if (Vnum === 0) {
O2 = "0x0" + (alt || prec > 0 ? "." + (prec >= 0 ? "0".repeat(prec) : "") : "") + "p+0";
break;
}
O2 = Vnum.toString(16);
var ac2 = O2.charCodeAt(0);
if (ac2 == 48) {
ac2 = 2;
E2 = -4;
Vnum *= 16;
while (O2.charCodeAt(ac2++) == 48) {
E2 -= 4;
Vnum *= 16;
}
O2 = Vnum.toString(16);
ac2 = O2.charCodeAt(0);
}
var ai2 = O2.indexOf(".");
if (O2.indexOf("(") > -1) {
var am = O2.match(/\(e(.*)\)/);
var ae2 = am ? +am[1] : 0;
E2 += 4 * ae2;
Vnum /= Math.pow(16, ae2);
} else if (ai2 > 1) {
E2 += 4 * (ai2 - 1);
Vnum /= Math.pow(16, ai2 - 1);
} else if (ai2 == -1) {
E2 += 4 * (O2.length - 1);
Vnum /= Math.pow(16, O2.length - 1);
}
if (bytes > 8) {
if (ac2 < 50) {
E2 -= 3;
Vnum *= 8;
} else if (ac2 < 52) {
E2 -= 2;
Vnum *= 4;
} else if (ac2 < 56) {
E2 -= 1;
Vnum *= 2;
}
} else {
if (ac2 >= 56) {
E2 += 3;
Vnum /= 8;
} else if (ac2 >= 52) {
E2 += 2;
Vnum /= 4;
} else if (ac2 >= 50) {
E2 += 1;
Vnum /= 2;
}
}
O2 = Vnum.toString(16);
if (O2.length > 1) {
if (O2.length > prec + 2 && O2.charCodeAt(prec + 2) >= 56) {
var _f = O2.charCodeAt(0) == 102;
O2 = (Vnum + 8 * Math.pow(16, -prec - 1)).toString(16);
if (_f && O2.charCodeAt(0) == 49)
E2 += 4;
}
if (prec > 0) {
O2 = O2.substr(0, prec + 2);
if (O2.length < prec + 2) {
if (O2.charCodeAt(0) < 48)
O2 = O2.charAt(0) + (prec + 2 - O2.length >= 0 ? "0".repeat(prec + 2 - O2.length) : "") + O2.substr(1);
else
O2 += prec + 2 - O2.length >= 0 ? "0".repeat(prec + 2 - O2.length) : "";
}
} else if (prec === 0)
O2 = O2.charAt(0) + (alt ? "." : "");
} else if (prec > 0)
O2 = O2 + "." + (prec >= 0 ? "0".repeat(prec) : "");
else if (alt)
O2 = O2 + ".";
O2 = "0x" + O2 + "p" + (E2 >= 0 ? "+" + E2 : E2);
break;
}
if (sg2 === "") {
if (flags.indexOf("+") > -1)
sg2 = "+";
else if (flags.indexOf(" ") > -1)
sg2 = " ";
}
O2 = sg2 + O2;
}
if (width2 > O2.length) {
if (flags.indexOf("-") > -1) {
O2 = O2 + (width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "");
} else if (flags.indexOf("0") > -1 && O2.length > 0 && isf) {
pad2 = width2 - O2.length >= 0 ? "0".repeat(width2 - O2.length) : "";
if (O2.charCodeAt(0) < 48) {
if (O2.charAt(2).toLowerCase() == "x")
O2 = O2.substr(0, 3) + pad2 + O2.substring(3);
else
O2 = O2.substr(0, 1) + pad2 + O2.substring(1);
} else if (O2.charAt(1).toLowerCase() == "x")
O2 = O2.substr(0, 2) + pad2 + O2.substring(2);
else
O2 = pad2 + O2;
} else {
O2 = (width2 - O2.length >= 0 ? " ".repeat(width2 - O2.length) : "") + O2;
}
}
if (c2 < 96)
O2 = O2.toUpperCase();
}
o2 += /*.push*/
O2;
}
return o2;
}
function sprintf() {
var args = new Array(arguments.length - 1);
for (var i2 = 0; i2 < args.length; ++i2)
args[i2] = arguments[i2 + 1];
return doit(tokenize$1(arguments[0]), args);
}
var Action$1;
(function(Action2) {
Action2["Pop"] = "POP";
Action2["Push"] = "PUSH";
Action2["Replace"] = "REPLACE";
})(Action$1 || (Action$1 = {}));
var readOnly = function(obj) {
return obj;
};
var BeforeUnloadEventType = "beforeunload";
var PopStateEventType = "popstate";
function createBrowserHistory(options2) {
if (options2 === void 0) {
options2 = {};
}
var _options = options2, _options$window = _options.window, window2 = _options$window === void 0 ? document.defaultView : _options$window;
var globalHistory = window2.history;
function getIndexAndLocation() {
var _window$location = window2.location, pathname = _window$location.pathname, search = _window$location.search, hash2 = _window$location.hash;
var state = globalHistory.state || {};
return [state.idx, readOnly({
pathname,
search,
hash: hash2,
state: state.usr || null,
key: state.key || "default"
})];
}
var blockedPopTx = null;
function handlePop() {
if (blockedPopTx) {
blockers.call(blockedPopTx);
blockedPopTx = null;
} else {
var nextAction = Action$1.Pop;
var _getIndexAndLocation = getIndexAndLocation(), nextIndex = _getIndexAndLocation[0], nextLocation = _getIndexAndLocation[1];
if (blockers.length) {
if (nextIndex != null) {
var delta = index2 - nextIndex;
if (delta) {
blockedPopTx = {
action: nextAction,
location: nextLocation,
retry: function retry() {
go2(delta * -1);
}
};
go2(delta);
}
}
} else {
applyTx(nextAction);
}
}
}
window2.addEventListener(PopStateEventType, handlePop);
var action = Action$1.Pop;
var _getIndexAndLocation2 = getIndexAndLocation(), index2 = _getIndexAndLocation2[0], location2 = _getIndexAndLocation2[1];
var listeners = createEvents();
var blockers = createEvents();
if (index2 == null) {
index2 = 0;
globalHistory.replaceState(_extends$3({}, globalHistory.state, {
idx: index2
}), "");
}
function createHref(to2) {
return typeof to2 === "string" ? to2 : createPath(to2);
}
function getNextLocation(to2, state) {
if (state === void 0) {
state = null;
}
return readOnly(_extends$3({
pathname: location2.pathname,
hash: "",
search: ""
}, typeof to2 === "string" ? parsePath(to2) : to2, {
state,
key: createKey()
}));
}
function getHistoryStateAndUrl(nextLocation, index3) {
return [{
usr: nextLocation.state,
key: nextLocation.key,
idx: index3
}, createHref(nextLocation)];
}
function allowTx(action2, location3, retry) {
return !blockers.length || (blockers.call({
action: action2,
location: location3,
retry
}), false);
}
function applyTx(nextAction) {
action = nextAction;
var _getIndexAndLocation3 = getIndexAndLocation();
index2 = _getIndexAndLocation3[0];
location2 = _getIndexAndLocation3[1];
listeners.call({
action,
location: location2
});
}
function push2(to2, state) {
var nextAction = Action$1.Push;
var nextLocation = getNextLocation(to2, state);
function retry() {
push2(to2, state);
}
if (allowTx(nextAction, nextLocation, retry)) {
var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index2 + 1), historyState = _getHistoryStateAndUr[0], url2 = _getHistoryStateAndUr[1];
try {
globalHistory.pushState(historyState, "", url2);
} catch (error3) {
window2.location.assign(url2);
}
applyTx(nextAction);
}
}
function replace2(to2, state) {
var nextAction = Action$1.Replace;
var nextLocation = getNextLocation(to2, state);
function retry() {
replace2(to2, state);
}
if (allowTx(nextAction, nextLocation, retry)) {
var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index2), historyState = _getHistoryStateAndUr2[0], url2 = _getHistoryStateAndUr2[1];
globalHistory.replaceState(historyState, "", url2);
applyTx(nextAction);
}
}
function go2(delta) {
globalHistory.go(delta);
}
var history = {
get action() {
return action;
},
get location() {
return location2;
},
createHref,
push: push2,
replace: replace2,
go: go2,
back: function back() {
go2(-1);
},
forward: function forward() {
go2(1);
},
listen: function listen(listener2) {
return listeners.push(listener2);
},
block: function block(blocker) {
var unblock = blockers.push(blocker);
if (blockers.length === 1) {
window2.addEventListener(BeforeUnloadEventType, promptBeforeUnload);
}
return function() {
unblock();
if (!blockers.length) {
window2.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);
}
};
}
};
return history;
}
function promptBeforeUnload(event2) {
event2.preventDefault();
event2.returnValue = "";
}
function createEvents() {
var handlers = [];
return {
get length() {
return handlers.length;
},
push: function push2(fn8) {
handlers.push(fn8);
return function() {
handlers = handlers.filter(function(handler) {
return handler !== fn8;
});
};
},
call: function call2(arg) {
handlers.forEach(function(fn8) {
return fn8 && fn8(arg);
});
}
};
}
function createKey() {
return Math.random().toString(36).substr(2, 8);
}
function createPath(_ref3) {
var _ref$pathname = _ref3.pathname, pathname = _ref$pathname === void 0 ? "/" : _ref$pathname, _ref$search = _ref3.search, search = _ref$search === void 0 ? "" : _ref$search, _ref$hash = _ref3.hash, hash2 = _ref$hash === void 0 ? "" : _ref$hash;
if (search && search !== "?")
pathname += search.charAt(0) === "?" ? search : "?" + search;
if (hash2 && hash2 !== "#")
pathname += hash2.charAt(0) === "#" ? hash2 : "#" + hash2;
return pathname;
}
function parsePath(path2) {
var parsedPath = {};
if (path2) {
var hashIndex = path2.indexOf("#");
if (hashIndex >= 0) {
parsedPath.hash = path2.substr(hashIndex);
path2 = path2.substr(0, hashIndex);
}
var searchIndex = path2.indexOf("?");
if (searchIndex >= 0) {
parsedPath.search = path2.substr(searchIndex);
path2 = path2.substr(0, searchIndex);
}
if (path2) {
parsedPath.pathname = path2;
}
}
return parsedPath;
}
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(_typeof$4);
var interopRequireDefault = { exports: {} };
(function(module) {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(interopRequireDefault);
var interopRequireDefaultExports = interopRequireDefault.exports;
function sheetForTag(tag) {
if (tag.sheet) {
return tag.sheet;
}
for (var i2 = 0; i2 < document.styleSheets.length; i2++) {
if (document.styleSheets[i2].ownerNode === tag) {
return document.styleSheets[i2];
}
}
}
function createStyleElement(options2) {
var tag = document.createElement("style");
tag.setAttribute("data-emotion", options2.key);
if (options2.nonce !== void 0) {
tag.setAttribute("nonce", options2.nonce);
}
tag.appendChild(document.createTextNode(""));
tag.setAttribute("data-s", "");
return tag;
}
var StyleSheet = /* @__PURE__ */ function() {
function StyleSheet2(options2) {
var _this = this;
this._insertTag = function(tag) {
var before;
if (_this.tags.length === 0) {
if (_this.insertionPoint) {
before = _this.insertionPoint.nextSibling;
} else if (_this.prepend) {
before = _this.container.firstChild;
} else {
before = _this.before;
}
} else {
before = _this.tags[_this.tags.length - 1].nextSibling;
}
_this.container.insertBefore(tag, before);
_this.tags.push(tag);
};
this.isSpeedy = options2.speedy === void 0 ? true : options2.speedy;
this.tags = [];
this.ctr = 0;
this.nonce = options2.nonce;
this.key = options2.key;
this.container = options2.container;
this.prepend = options2.prepend;
this.insertionPoint = options2.insertionPoint;
this.before = null;
}
var _proto = StyleSheet2.prototype;
_proto.hydrate = function hydrate(nodes) {
nodes.forEach(this._insertTag);
};
_proto.insert = function insert2(rule2) {
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
this._insertTag(createStyleElement(this));
}
var tag = this.tags[this.tags.length - 1];
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
sheet.insertRule(rule2, sheet.cssRules.length);
} catch (e7) {
}
} else {
tag.appendChild(document.createTextNode(rule2));
}
this.ctr++;
};
_proto.flush = function flush() {
this.tags.forEach(function(tag) {
return tag.parentNode && tag.parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
};
return StyleSheet2;
}();
var MS = "-ms-";
var MOZ = "-moz-";
var WEBKIT = "-webkit-";
var COMMENT = "comm";
var RULESET = "rule";
var DECLARATION = "decl";
var IMPORT = "@import";
var KEYFRAMES = "@keyframes";
var LAYER = "@layer";
var abs$3 = Math.abs;
var from$1 = String.fromCharCode;
var assign = Object.assign;
function hash$2(value2, length2) {
return charat(value2, 0) ^ 45 ? (((length2 << 2 ^ charat(value2, 0)) << 2 ^ charat(value2, 1)) << 2 ^ charat(value2, 2)) << 2 ^ charat(value2, 3) : 0;
}
function trim(value2) {
return value2.trim();
}
function match$3(value2, pattern) {
return (value2 = pattern.exec(value2)) ? value2[0] : value2;
}
function replace$6(value2, pattern, replacement2) {
return value2.replace(pattern, replacement2);
}
function indexof$1(value2, search) {
return value2.indexOf(search);
}
function charat(value2, index2) {
return value2.charCodeAt(index2) | 0;
}
function substr(value2, begin, end2) {
return value2.slice(begin, end2);
}
function strlen(value2) {
return value2.length;
}
function sizeof(value2) {
return value2.length;
}
function append$2(value2, array2) {
return array2.push(value2), value2;
}
function combine(array2, callback) {
return array2.map(callback).join("");
}
var line$3 = 1;
var column = 1;
var length$2 = 0;
var position$2 = 0;
var character = 0;
var characters = "";
function node$2(value2, root2, parent, type2, props, children2, length2) {
return { value: value2, root: root2, parent, type: type2, props, children: children2, line: line$3, column, length: length2, return: "" };
}
function copy$6(root2, props) {
return assign(node$2("", null, null, "", null, null, 0), root2, { length: -root2.length }, props);
}
function char() {
return character;
}
function prev$1() {
character = position$2 > 0 ? charat(characters, --position$2) : 0;
if (column--, character === 10)
column = 1, line$3--;
return character;
}
function next() {
character = position$2 < length$2 ? charat(characters, position$2++) : 0;
if (column++, character === 10)
column = 1, line$3++;
return character;
}
function peek$2() {
return charat(characters, position$2);
}
function caret() {
return position$2;
}
function slice$5(begin, end2) {
return substr(characters, begin, end2);
}
function token(type2) {
switch (type2) {
case 0:
case 9:
case 10:
case 13:
case 32:
return 5;
case 33:
case 43:
case 44:
case 47:
case 62:
case 64:
case 126:
case 59:
case 123:
case 125:
return 4;
case 58:
return 3;
case 34:
case 39:
case 40:
case 91:
return 2;
case 41:
case 93:
return 1;
}
return 0;
}
function alloc(value2) {
return line$3 = column = 1, length$2 = strlen(characters = value2), position$2 = 0, [];
}
function dealloc(value2) {
return characters = "", value2;
}
function delimit(type2) {
return trim(slice$5(position$2 - 1, delimiter(type2 === 91 ? type2 + 2 : type2 === 40 ? type2 + 1 : type2)));
}
function whitespace(type2) {
while (character = peek$2())
if (character < 33)
next();
else
break;
return token(type2) > 2 || token(character) > 3 ? "" : " ";
}
function escaping(index2, count2) {
while (--count2 && next())
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
break;
return slice$5(index2, caret() + (count2 < 6 && peek$2() == 32 && next() == 32));
}
function delimiter(type2) {
while (next())
switch (character) {
case type2:
return position$2;
case 34:
case 39:
if (type2 !== 34 && type2 !== 39)
delimiter(character);
break;
case 40:
if (type2 === 41)
delimiter(type2);
break;
case 92:
next();
break;
}
return position$2;
}
function commenter(type2, index2) {
while (next())
if (type2 + character === 47 + 10)
break;
else if (type2 + character === 42 + 42 && peek$2() === 47)
break;
return "/*" + slice$5(index2, position$2 - 1) + "*" + from$1(type2 === 47 ? type2 : next());
}
function identifier(index2) {
while (!token(peek$2()))
next();
return slice$5(index2, position$2);
}
function compile(value2) {
return dealloc(parse$a("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2));
}
function parse$a(value2, root2, parent, rule2, rules, rulesets, pseudo, points2, declarations) {
var index2 = 0;
var offset2 = 0;
var length2 = pseudo;
var atrule = 0;
var property2 = 0;
var previous = 0;
var variable = 1;
var scanning = 1;
var ampersand = 1;
var character2 = 0;
var type2 = "";
var props = rules;
var children2 = rulesets;
var reference2 = rule2;
var characters2 = type2;
while (scanning)
switch (previous = character2, character2 = next()) {
case 40:
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
if (indexof$1(characters2 += replace$6(delimit(character2), "&", "&\f"), "&\f") != -1)
ampersand = -1;
break;
}
case 34:
case 39:
case 91:
characters2 += delimit(character2);
break;
case 9:
case 10:
case 13:
case 32:
characters2 += whitespace(previous);
break;
case 92:
characters2 += escaping(caret() - 1, 7);
continue;
case 47:
switch (peek$2()) {
case 42:
case 47:
append$2(comment(commenter(next(), caret()), root2, parent), declarations);
break;
default:
characters2 += "/";
}
break;
case 123 * variable:
points2[index2++] = strlen(characters2) * ampersand;
case 125 * variable:
case 59:
case 0:
switch (character2) {
case 0:
case 125:
scanning = 0;
case 59 + offset2:
if (ampersand == -1)
characters2 = replace$6(characters2, /\f/g, "");
if (property2 > 0 && strlen(characters2) - length2)
append$2(property2 > 32 ? declaration(characters2 + ";", rule2, parent, length2 - 1) : declaration(replace$6(characters2, " ", "") + ";", rule2, parent, length2 - 2), declarations);
break;
case 59:
characters2 += ";";
default:
append$2(reference2 = ruleset(characters2, root2, parent, index2, offset2, rules, points2, type2, props = [], children2 = [], length2), rulesets);
if (character2 === 123)
if (offset2 === 0)
parse$a(characters2, root2, reference2, reference2, props, rulesets, length2, points2, children2);
else
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
case 100:
case 108:
case 109:
case 115:
parse$a(value2, reference2, reference2, rule2 && append$2(ruleset(value2, reference2, reference2, 0, 0, rules, points2, type2, rules, props = [], length2), children2), rules, children2, length2, points2, rule2 ? props : children2);
break;
default:
parse$a(characters2, reference2, reference2, reference2, [""], children2, 0, points2, children2);
}
}
index2 = offset2 = property2 = 0, variable = ampersand = 1, type2 = characters2 = "", length2 = pseudo;
break;
case 58:
length2 = 1 + strlen(characters2), property2 = previous;
default:
if (variable < 1) {
if (character2 == 123)
--variable;
else if (character2 == 125 && variable++ == 0 && prev$1() == 125)
continue;
}
switch (characters2 += from$1(character2), character2 * variable) {
case 38:
ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1);
break;
case 44:
points2[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
break;
case 64:
if (peek$2() === 45)
characters2 += delimit(next());
atrule = peek$2(), offset2 = length2 = strlen(type2 = characters2 += identifier(caret())), character2++;
break;
case 45:
if (previous === 45 && strlen(characters2) == 2)
variable = 0;
}
}
return rulesets;
}
function ruleset(value2, root2, parent, index2, offset2, rules, points2, type2, props, children2, length2) {
var post = offset2 - 1;
var rule2 = offset2 === 0 ? rules : [""];
var size = sizeof(rule2);
for (var i2 = 0, j2 = 0, k2 = 0; i2 < index2; ++i2)
for (var x2 = 0, y2 = substr(value2, post + 1, post = abs$3(j2 = points2[i2])), z2 = value2; x2 < size; ++x2)
if (z2 = trim(j2 > 0 ? rule2[x2] + " " + y2 : replace$6(y2, /&\f/g, rule2[x2])))
props[k2++] = z2;
return node$2(value2, root2, parent, offset2 === 0 ? RULESET : type2, props, children2, length2);
}
function comment(value2, root2, parent) {
return node$2(value2, root2, parent, COMMENT, from$1(char()), substr(value2, 2, -2), 0);
}
function declaration(value2, root2, parent, length2) {
return node$2(value2, root2, parent, DECLARATION, substr(value2, 0, length2), substr(value2, length2 + 1, -1), length2);
}
function serialize(children2, callback) {
var output3 = "";
var length2 = sizeof(children2);
for (var i2 = 0; i2 < length2; i2++)
output3 += callback(children2[i2], i2, children2, callback) || "";
return output3;
}
function stringify$1(element2, index2, children2, callback) {
switch (element2.type) {
case LAYER:
if (element2.children.length)
break;
case IMPORT:
case DECLARATION:
return element2.return = element2.return || element2.value;
case COMMENT:
return "";
case KEYFRAMES:
return element2.return = element2.value + "{" + serialize(element2.children, callback) + "}";
case RULESET:
element2.value = element2.props.join(",");
}
return strlen(children2 = serialize(element2.children, callback)) ? element2.return = element2.value + "{" + children2 + "}" : "";
}
function middleware(collection) {
var length2 = sizeof(collection);
return function(element2, index2, children2, callback) {
var output3 = "";
for (var i2 = 0; i2 < length2; i2++)
output3 += collection[i2](element2, index2, children2, callback) || "";
return output3;
};
}
function rulesheet(callback) {
return function(element2) {
if (!element2.root) {
if (element2 = element2.return)
callback(element2);
}
};
}
var weakMemoize = function weakMemoize2(func) {
var cache2 = /* @__PURE__ */ new WeakMap();
return function(arg) {
if (cache2.has(arg)) {
return cache2.get(arg);
}
var ret = func(arg);
cache2.set(arg, ret);
return ret;
};
};
function memoize$1(fn8) {
var cache2 = /* @__PURE__ */ Object.create(null);
return function(arg) {
if (cache2[arg] === void 0)
cache2[arg] = fn8(arg);
return cache2[arg];
};
}
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points2, index2) {
var previous = 0;
var character2 = 0;
while (true) {
previous = character2;
character2 = peek$2();
if (previous === 38 && character2 === 12) {
points2[index2] = 1;
}
if (token(character2)) {
break;
}
next();
}
return slice$5(begin, position$2);
};
var toRules = function toRules2(parsed, points2) {
var index2 = -1;
var character2 = 44;
do {
switch (token(character2)) {
case 0:
if (character2 === 38 && peek$2() === 12) {
points2[index2] = 1;
}
parsed[index2] += identifierWithPointTracking(position$2 - 1, points2, index2);
break;
case 2:
parsed[index2] += delimit(character2);
break;
case 4:
if (character2 === 44) {
parsed[++index2] = peek$2() === 58 ? "&\f" : "";
points2[index2] = parsed[index2].length;
break;
}
default:
parsed[index2] += from$1(character2);
}
} while (character2 = next());
return parsed;
};
var getRules = function getRules2(value2, points2) {
return dealloc(toRules(alloc(value2), points2));
};
var fixedElements = /* @__PURE__ */ new WeakMap();
var compat = function compat2(element2) {
if (element2.type !== "rule" || !element2.parent || // positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
element2.length < 1) {
return;
}
var value2 = element2.value, parent = element2.parent;
var isImplicitRule = element2.column === parent.column && element2.line === parent.line;
while (parent.type !== "rule") {
parent = parent.parent;
if (!parent)
return;
}
if (element2.props.length === 1 && value2.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
return;
}
if (isImplicitRule) {
return;
}
fixedElements.set(element2, true);
var points2 = [];
var rules = getRules(value2, points2);
var parentRules = parent.props;
for (var i2 = 0, k2 = 0; i2 < rules.length; i2++) {
for (var j2 = 0; j2 < parentRules.length; j2++, k2++) {
element2.props[k2] = points2[i2] ? rules[i2].replace(/&\f/g, parentRules[j2]) : parentRules[j2] + " " + rules[i2];
}
}
};
var removeLabel = function removeLabel2(element2) {
if (element2.type === "decl") {
var value2 = element2.value;
if (
// charcode for l
value2.charCodeAt(0) === 108 && // charcode for b
value2.charCodeAt(2) === 98
) {
element2["return"] = "";
element2.value = "";
}
}
};
function prefix(value2, length2) {
switch (hash$2(value2, length2)) {
case 5103:
return WEBKIT + "print-" + value2 + value2;
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921:
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005:
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855:
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
return WEBKIT + value2 + value2;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return WEBKIT + value2 + MOZ + value2 + MS + value2 + value2;
case 6828:
case 4268:
return WEBKIT + value2 + MS + value2 + value2;
case 6165:
return WEBKIT + value2 + MS + "flex-" + value2 + value2;
case 5187:
return WEBKIT + value2 + replace$6(value2, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value2;
case 5443:
return WEBKIT + value2 + MS + "flex-item-" + replace$6(value2, /flex-|-self/, "") + value2;
case 4675:
return WEBKIT + value2 + MS + "flex-line-pack" + replace$6(value2, /align-content|flex-|-self/, "") + value2;
case 5548:
return WEBKIT + value2 + MS + replace$6(value2, "shrink", "negative") + value2;
case 5292:
return WEBKIT + value2 + MS + replace$6(value2, "basis", "preferred-size") + value2;
case 6060:
return WEBKIT + "box-" + replace$6(value2, "-grow", "") + WEBKIT + value2 + MS + replace$6(value2, "grow", "positive") + value2;
case 4554:
return WEBKIT + replace$6(value2, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value2;
case 6187:
return replace$6(replace$6(replace$6(value2, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value2, "") + value2;
case 5495:
case 3959:
return replace$6(value2, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
case 4968:
return replace$6(replace$6(value2, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value2 + value2;
case 4095:
case 3583:
case 4068:
case 2532:
return replace$6(value2, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value2;
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
if (strlen(value2) - 1 - length2 > 6)
switch (charat(value2, length2 + 1)) {
case 109:
if (charat(value2, length2 + 4) !== 45)
break;
case 102:
return replace$6(value2, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value2, length2 + 3) == 108 ? "$3" : "$2-$3")) + value2;
case 115:
return ~indexof$1(value2, "stretch") ? prefix(replace$6(value2, "stretch", "fill-available"), length2) + value2 : value2;
}
break;
case 4949:
if (charat(value2, length2 + 1) !== 115)
break;
case 6444:
switch (charat(value2, strlen(value2) - 3 - (~indexof$1(value2, "!important") && 10))) {
case 107:
return replace$6(value2, ":", ":" + WEBKIT) + value2;
case 101:
return replace$6(value2, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value2, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value2;
}
break;
case 5936:
switch (charat(value2, length2 + 11)) {
case 114:
return WEBKIT + value2 + MS + replace$6(value2, /[svh]\w+-[tblr]{2}/, "tb") + value2;
case 108:
return WEBKIT + value2 + MS + replace$6(value2, /[svh]\w+-[tblr]{2}/, "tb-rl") + value2;
case 45:
return WEBKIT + value2 + MS + replace$6(value2, /[svh]\w+-[tblr]{2}/, "lr") + value2;
}
return WEBKIT + value2 + MS + value2 + value2;
}
return value2;
}
var prefixer = function prefixer2(element2, index2, children2, callback) {
if (element2.length > -1) {
if (!element2["return"])
switch (element2.type) {
case DECLARATION:
element2["return"] = prefix(element2.value, element2.length);
break;
case KEYFRAMES:
return serialize([copy$6(element2, {
value: replace$6(element2.value, "@", "@" + WEBKIT)
})], callback);
case RULESET:
if (element2.length)
return combine(element2.props, function(value2) {
switch (match$3(value2, /(::plac\w+|:read-\w+)/)) {
case ":read-only":
case ":read-write":
return serialize([copy$6(element2, {
props: [replace$6(value2, /:(read-\w+)/, ":" + MOZ + "$1")]
})], callback);
case "::placeholder":
return serialize([copy$6(element2, {
props: [replace$6(value2, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
}), copy$6(element2, {
props: [replace$6(value2, /:(plac\w+)/, ":" + MOZ + "$1")]
}), copy$6(element2, {
props: [replace$6(value2, /:(plac\w+)/, MS + "input-$1")]
})], callback);
}
return "";
});
}
}
};
var defaultStylisPlugins = [prefixer];
var createCache = function createCache2(options2) {
var key2 = options2.key;
if (key2 === "css") {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
Array.prototype.forEach.call(ssrStyles, function(node2) {
var dataEmotionAttribute = node2.getAttribute("data-emotion");
if (dataEmotionAttribute.indexOf(" ") === -1) {
return;
}
document.head.appendChild(node2);
node2.setAttribute("data-s", "");
});
}
var stylisPlugins = options2.stylisPlugins || defaultStylisPlugins;
var inserted = {};
var container;
var nodesToHydrate = [];
{
container = options2.container || document.head;
Array.prototype.forEach.call(
// this means we will ignore elements which don't have a space in them which
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll('style[data-emotion^="' + key2 + ' "]'),
function(node2) {
var attrib = node2.getAttribute("data-emotion").split(" ");
for (var i2 = 1; i2 < attrib.length; i2++) {
inserted[attrib[i2]] = true;
}
nodesToHydrate.push(node2);
}
);
}
var _insert;
var omnipresentPlugins = [compat, removeLabel];
{
var currentSheet;
var finalizingPlugins = [stringify$1, rulesheet(function(rule2) {
currentSheet.insert(rule2);
})];
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
var stylis = function stylis2(styles2) {
return serialize(compile(styles2), serializer);
};
_insert = function insert2(selector, serialized, sheet, shouldCache) {
currentSheet = sheet;
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
if (shouldCache) {
cache2.inserted[serialized.name] = true;
}
};
}
var cache2 = {
key: key2,
sheet: new StyleSheet({
key: key2,
container,
nonce: options2.nonce,
speedy: options2.speedy,
prepend: options2.prepend,
insertionPoint: options2.insertionPoint
}),
nonce: options2.nonce,
inserted,
registered: {},
insert: _insert
};
cache2.sheet.hydrate(nodesToHydrate);
return cache2;
};
var hoistNonReactStatics = function(targetComponent, sourceComponent) {
return hoistNonReactStatics$1$1(targetComponent, sourceComponent);
};
var isBrowser$3 = true;
function getRegisteredStyles(registered, registeredStyles, classNames2) {
var rawClassName = "";
classNames2.split(" ").forEach(function(className) {
if (registered[className] !== void 0) {
registeredStyles.push(registered[className] + ";");
} else {
rawClassName += className + " ";
}
});
return rawClassName;
}
var registerStyles = function registerStyles2(cache2, serialized, isStringTag) {
var className = cache2.key + "-" + serialized.name;
if (
// we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser$3 === false) && cache2.registered[className] === void 0
) {
cache2.registered[className] = serialized.styles;
}
};
var insertStyles = function insertStyles2(cache2, serialized, isStringTag) {
registerStyles(cache2, serialized, isStringTag);
var className = cache2.key + "-" + serialized.name;
if (cache2.inserted[serialized.name] === void 0) {
var current = serialized;
do {
cache2.insert(serialized === current ? "." + className : "", current, cache2.sheet, true);
current = current.next;
} while (current !== void 0);
}
};
function murmur2(str) {
var h2 = 0;
var k2, i2 = 0, len = str.length;
for (; len >= 4; ++i2, len -= 4) {
k2 = str.charCodeAt(i2) & 255 | (str.charCodeAt(++i2) & 255) << 8 | (str.charCodeAt(++i2) & 255) << 16 | (str.charCodeAt(++i2) & 255) << 24;
k2 = /* Math.imul(k, m): */
(k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
k2 ^= /* k >>> r: */
k2 >>> 24;
h2 = /* Math.imul(k, m): */
(k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
}
switch (len) {
case 3:
h2 ^= (str.charCodeAt(i2 + 2) & 255) << 16;
case 2:
h2 ^= (str.charCodeAt(i2 + 1) & 255) << 8;
case 1:
h2 ^= str.charCodeAt(i2) & 255;
h2 = /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
}
h2 ^= h2 >>> 13;
h2 = /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
}
var unitlessKeys = {
animationIterationCount: 1,
aspectRatio: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty2(property2) {
return property2.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue2(value2) {
return value2 != null && typeof value2 !== "boolean";
};
var processStyleName = /* @__PURE__ */ memoize$1(function(styleName) {
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
});
var processStyleValue = function processStyleValue2(key2, value2) {
switch (key2) {
case "animation":
case "animationName": {
if (typeof value2 === "string") {
return value2.replace(animationRegex, function(match2, p1, p2) {
cursor$1 = {
name: p1,
styles: p2,
next: cursor$1
};
return p1;
});
}
}
}
if (unitlessKeys[key2] !== 1 && !isCustomProperty(key2) && typeof value2 === "number" && value2 !== 0) {
return value2 + "px";
}
return value2;
};
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
function handleInterpolation(mergedProps, registered, interpolation) {
if (interpolation == null) {
return "";
}
if (interpolation.__emotion_styles !== void 0) {
return interpolation;
}
switch (typeof interpolation) {
case "boolean": {
return "";
}
case "object": {
if (interpolation.anim === 1) {
cursor$1 = {
name: interpolation.name,
styles: interpolation.styles,
next: cursor$1
};
return interpolation.name;
}
if (interpolation.styles !== void 0) {
var next2 = interpolation.next;
if (next2 !== void 0) {
while (next2 !== void 0) {
cursor$1 = {
name: next2.name,
styles: next2.styles,
next: cursor$1
};
next2 = next2.next;
}
}
var styles2 = interpolation.styles + ";";
return styles2;
}
return createStringFromObject(mergedProps, registered, interpolation);
}
case "function": {
if (mergedProps !== void 0) {
var previousCursor = cursor$1;
var result = interpolation(mergedProps);
cursor$1 = previousCursor;
return handleInterpolation(mergedProps, registered, result);
}
break;
}
}
if (registered == null) {
return interpolation;
}
var cached = registered[interpolation];
return cached !== void 0 ? cached : interpolation;
}
function createStringFromObject(mergedProps, registered, obj) {
var string2 = "";
if (Array.isArray(obj)) {
for (var i2 = 0; i2 < obj.length; i2++) {
string2 += handleInterpolation(mergedProps, registered, obj[i2]) + ";";
}
} else {
for (var _key in obj) {
var value2 = obj[_key];
if (typeof value2 !== "object") {
if (registered != null && registered[value2] !== void 0) {
string2 += _key + "{" + registered[value2] + "}";
} else if (isProcessableValue(value2)) {
string2 += processStyleName(_key) + ":" + processStyleValue(_key, value2) + ";";
}
} else {
if (_key === "NO_COMPONENT_SELECTOR" && false) {
throw new Error(noComponentSelectorMessage);
}
if (Array.isArray(value2) && typeof value2[0] === "string" && (registered == null || registered[value2[0]] === void 0)) {
for (var _i2 = 0; _i2 < value2.length; _i2++) {
if (isProcessableValue(value2[_i2])) {
string2 += processStyleName(_key) + ":" + processStyleValue(_key, value2[_i2]) + ";";
}
}
} else {
var interpolated = handleInterpolation(mergedProps, registered, value2);
switch (_key) {
case "animation":
case "animationName": {
string2 += processStyleName(_key) + ":" + interpolated + ";";
break;
}
default: {
string2 += _key + "{" + interpolated + "}";
}
}
}
}
}
}
return string2;
}
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
var cursor$1;
var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
return args[0];
}
var stringMode = true;
var styles2 = "";
cursor$1 = void 0;
var strings = args[0];
if (strings == null || strings.raw === void 0) {
stringMode = false;
styles2 += handleInterpolation(mergedProps, registered, strings);
} else {
styles2 += strings[0];
}
for (var i2 = 1; i2 < args.length; i2++) {
styles2 += handleInterpolation(mergedProps, registered, args[i2]);
if (stringMode) {
styles2 += strings[i2];
}
}
labelPattern.lastIndex = 0;
var identifierName = "";
var match2;
while ((match2 = labelPattern.exec(styles2)) !== null) {
identifierName += "-" + // $FlowFixMe we know it's not null
match2[1];
}
var name = murmur2(styles2) + identifierName;
return {
name,
styles: styles2,
next: cursor$1
};
};
var syncFallback = function syncFallback2(create4) {
return create4();
};
var useInsertionEffect = React$1["useInsertionEffect"] ? React$1["useInsertionEffect"] : false;
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
var useInsertionEffectWithLayoutFallback = useInsertionEffect || reactExports.useLayoutEffect;
var hasOwnProperty$6 = {}.hasOwnProperty;
var EmotionCacheContext = /* @__PURE__ */ reactExports.createContext(
// we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache({
key: "css"
}) : null
);
var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
return reactExports.useContext(EmotionCacheContext);
};
var withEmotionCache = function withEmotionCache2(func) {
return /* @__PURE__ */ reactExports.forwardRef(function(props, ref2) {
var cache2 = reactExports.useContext(EmotionCacheContext);
return func(props, cache2, ref2);
});
};
var ThemeContext = /* @__PURE__ */ reactExports.createContext({});
var useTheme = function useTheme2() {
return reactExports.useContext(ThemeContext);
};
var getTheme = function getTheme2(outerTheme, theme) {
if (typeof theme === "function") {
var mergedTheme = theme(outerTheme);
return mergedTheme;
}
return _extends$3({}, outerTheme, theme);
};
var createCacheWithTheme = /* @__PURE__ */ weakMemoize(function(outerTheme) {
return weakMemoize(function(theme) {
return getTheme(outerTheme, theme);
});
});
var ThemeProvider = function ThemeProvider2(props) {
var theme = reactExports.useContext(ThemeContext);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /* @__PURE__ */ reactExports.createElement(ThemeContext.Provider, {
value: theme
}, props.children);
};
function withTheme(Component) {
var componentName = Component.displayName || Component.name || "Component";
var render3 = function render4(props, ref2) {
var theme = reactExports.useContext(ThemeContext);
return /* @__PURE__ */ reactExports.createElement(Component, _extends$3({
theme,
ref: ref2
}, props));
};
var WithTheme = /* @__PURE__ */ reactExports.forwardRef(render3);
WithTheme.displayName = "WithTheme(" + componentName + ")";
return hoistNonReactStatics(WithTheme, Component);
}
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
var createEmotionProps = function createEmotionProps2(type2, props) {
var newProps = {};
for (var key2 in props) {
if (hasOwnProperty$6.call(props, key2)) {
newProps[key2] = props[key2];
}
}
newProps[typePropName] = type2;
return newProps;
};
var Insertion$1 = function Insertion(_ref3) {
var cache2 = _ref3.cache, serialized = _ref3.serialized, isStringTag = _ref3.isStringTag;
registerStyles(cache2, serialized, isStringTag);
useInsertionEffectAlwaysWithSyncFallback(function() {
return insertStyles(cache2, serialized, isStringTag);
});
return null;
};
var Emotion = /* @__PURE__ */ withEmotionCache(function(props, cache2, ref2) {
var cssProp = props.css;
if (typeof cssProp === "string" && cache2.registered[cssProp] !== void 0) {
cssProp = cache2.registered[cssProp];
}
var WrappedComponent = props[typePropName];
var registeredStyles = [cssProp];
var className = "";
if (typeof props.className === "string") {
className = getRegisteredStyles(cache2.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(registeredStyles, void 0, reactExports.useContext(ThemeContext));
className += cache2.key + "-" + serialized.name;
var newProps = {};
for (var key2 in props) {
if (hasOwnProperty$6.call(props, key2) && key2 !== "css" && key2 !== typePropName && true) {
newProps[key2] = props[key2];
}
}
newProps.ref = ref2;
newProps.className = className;
return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement(Insertion$1, {
cache: cache2,
serialized,
isStringTag: typeof WrappedComponent === "string"
}), /* @__PURE__ */ reactExports.createElement(WrappedComponent, newProps));
});
var Emotion$1 = Emotion;
var _extends = { exports: {} };
var hasRequired_extends;
function require_extends() {
if (hasRequired_extends)
return _extends.exports;
hasRequired_extends = 1;
(function(module) {
function _extends2() {
module.exports = _extends2 = Object.assign ? Object.assign.bind() : function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _extends2.apply(this, arguments);
}
module.exports = _extends2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(_extends);
return _extends.exports;
}
require_extends();
var jsx$1 = function jsx(type2, props) {
var args = arguments;
if (props == null || !hasOwnProperty$6.call(props, "css")) {
return reactExports.createElement.apply(void 0, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = Emotion$1;
createElementArgArray[1] = createEmotionProps(type2, props);
for (var i2 = 2; i2 < argsLength; i2++) {
createElementArgArray[i2] = args[i2];
}
return reactExports.createElement.apply(null, createElementArgArray);
};
var Global = /* @__PURE__ */ withEmotionCache(function(props, cache2) {
var styles2 = props.styles;
var serialized = serializeStyles([styles2], void 0, reactExports.useContext(ThemeContext));
var sheetRef = reactExports.useRef();
useInsertionEffectWithLayoutFallback(function() {
var key2 = cache2.key + "-global";
var sheet = new cache2.sheet.constructor({
key: key2,
nonce: cache2.sheet.nonce,
container: cache2.sheet.container,
speedy: cache2.sheet.isSpeedy
});
var rehydrating = false;
var node2 = document.querySelector('style[data-emotion="' + key2 + " " + serialized.name + '"]');
if (cache2.sheet.tags.length) {
sheet.before = cache2.sheet.tags[0];
}
if (node2 !== null) {
rehydrating = true;
node2.setAttribute("data-emotion", key2);
sheet.hydrate([node2]);
}
sheetRef.current = [sheet, rehydrating];
return function() {
sheet.flush();
};
}, [cache2]);
useInsertionEffectWithLayoutFallback(function() {
var sheetRefCurrent = sheetRef.current;
var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
if (rehydrating) {
sheetRefCurrent[1] = false;
return;
}
if (serialized.next !== void 0) {
insertStyles(cache2, serialized.next, true);
}
if (sheet.tags.length) {
var element2 = sheet.tags[sheet.tags.length - 1].nextElementSibling;
sheet.before = element2;
sheet.flush();
}
cache2.insert("", serialized, sheet, false);
}, [cache2, serialized.name]);
return null;
});
function css$2() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serializeStyles(args);
}
var keyframes = function keyframes2() {
var insertable = css$2.apply(void 0, arguments);
var name = "animation-" + insertable.name;
return {
name,
styles: "@keyframes " + name + "{" + insertable.styles + "}",
anim: 1,
toString: function toString4() {
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
}
};
};
var classnames$1 = function classnames(args) {
var len = args.length;
var i2 = 0;
var cls = "";
for (; i2 < len; i2++) {
var arg = args[i2];
if (arg == null)
continue;
var toAdd = void 0;
switch (typeof arg) {
case "boolean":
break;
case "object": {
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = "";
for (var k2 in arg) {
if (arg[k2] && k2) {
toAdd && (toAdd += " ");
toAdd += k2;
}
}
}
break;
}
default: {
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += " ");
cls += toAdd;
}
}
return cls;
};
function merge$4(registered, css4, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css4(registeredStyles);
}
var Insertion2 = function Insertion3(_ref3) {
var cache2 = _ref3.cache, serializedArr = _ref3.serializedArr;
useInsertionEffectAlwaysWithSyncFallback(function() {
for (var i2 = 0; i2 < serializedArr.length; i2++) {
insertStyles(cache2, serializedArr[i2], false);
}
});
return null;
};
var ClassNames = /* @__PURE__ */ withEmotionCache(function(props, cache2) {
var hasRendered = false;
var serializedArr = [];
var css4 = function css5() {
if (hasRendered && false) {
throw new Error("css can only be used during render");
}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serializeStyles(args, cache2.registered);
serializedArr.push(serialized);
registerStyles(cache2, serialized, false);
return cache2.key + "-" + serialized.name;
};
var cx = function cx2() {
if (hasRendered && false) {
throw new Error("cx can only be used during render");
}
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return merge$4(cache2.registered, css4, classnames$1(args));
};
var content2 = {
css: css4,
cx,
theme: reactExports.useContext(ThemeContext)
};
var ele = props.children(content2);
hasRendered = true;
return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement(Insertion2, {
cache: cache2,
serializedArr
}), ele);
});
const emotionReact_browser_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
CacheProvider,
ClassNames,
Global,
ThemeContext,
ThemeProvider,
__unsafe_useEmotionCache,
createElement: jsx$1,
css: css$2,
jsx: jsx$1,
keyframes,
useTheme,
withEmotionCache,
withTheme
}, Symbol.toStringTag, { value: "Module" }));
const require$$3$2 = /* @__PURE__ */ getAugmentedNamespace(emotionReact_browser_esm);
var __spreadArray$2 = globalThis && globalThis.__spreadArray || function(to2, from2, pack2) {
if (pack2 || arguments.length === 2)
for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) {
if (ar2 || !(i2 in from2)) {
if (!ar2)
ar2 = Array.prototype.slice.call(from2, 0, i2);
ar2[i2] = from2[i2];
}
}
return to2.concat(ar2 || Array.prototype.slice.call(from2));
};
var BrowserInfo = (
/** @class */
function() {
function BrowserInfo2(name, version2, os) {
this.name = name;
this.version = version2;
this.os = os;
this.type = "browser";
}
return BrowserInfo2;
}()
);
var NodeInfo = (
/** @class */
function() {
function NodeInfo2(version2) {
this.version = version2;
this.type = "node";
this.name = "node";
this.os = process.platform;
}
return NodeInfo2;
}()
);
var SearchBotDeviceInfo = (
/** @class */
function() {
function SearchBotDeviceInfo2(name, version2, os, bot) {
this.name = name;
this.version = version2;
this.os = os;
this.bot = bot;
this.type = "bot-device";
}
return SearchBotDeviceInfo2;
}()
);
var BotInfo = (
/** @class */
function() {
function BotInfo2() {
this.type = "bot";
this.bot = true;
this.name = "bot";
this.version = null;
this.os = null;
}
return BotInfo2;
}()
);
var ReactNativeInfo = (
/** @class */
function() {
function ReactNativeInfo2() {
this.type = "react-native";
this.name = "react-native";
this.version = null;
this.os = null;
}
return ReactNativeInfo2;
}()
);
var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;
var SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/;
var REQUIRED_VERSION_PARTS = 3;
var userAgentRules = [
["aol", /AOLShield\/([0-9\._]+)/],
["edge", /Edge\/([0-9\._]+)/],
["edge-ios", /EdgiOS\/([0-9\._]+)/],
["yandexbrowser", /YaBrowser\/([0-9\._]+)/],
["kakaotalk", /KAKAOTALK\s([0-9\.]+)/],
["samsung", /SamsungBrowser\/([0-9\.]+)/],
["silk", /\bSilk\/([0-9._-]+)\b/],
["miui", /MiuiBrowser\/([0-9\.]+)$/],
["beaker", /BeakerBrowser\/([0-9\.]+)/],
["edge-chromium", /EdgA?\/([0-9\.]+)/],
[
"chromium-webview",
/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/
],
["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],
["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/],
["crios", /CriOS\/([0-9\.]+)(:?\s|$)/],
["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/],
["fxios", /FxiOS\/([0-9\.]+)/],
["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/],
["opera", /Opera\/([0-9\.]+)(?:\s|$)/],
["opera", /OPR\/([0-9\.]+)(:?\s|$)/],
["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],
["pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],
["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],
["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],
["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],
["ie", /MSIE\s(7\.0)/],
["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/],
["android", /Android\s([0-9\.]+)/],
["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/],
["safari", /Version\/([0-9\._]+).*Safari/],
["facebook", /FB[AS]V\/([0-9\.]+)/],
["instagram", /Instagram\s([0-9\.]+)/],
["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/],
["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/],
["curl", /^curl\/([0-9\.]+)$/],
["searchbot", SEARCHBOX_UA_REGEX]
];
var operatingSystemRules = [
["iOS", /iP(hone|od|ad)/],
["Android OS", /Android/],
["BlackBerry OS", /BlackBerry|BB10/],
["Windows Mobile", /IEMobile/],
["Amazon OS", /Kindle/],
["Windows 3.11", /Win16/],
["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/],
["Windows 98", /(Windows 98)|(Win98)/],
["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/],
["Windows XP", /(Windows NT 5.1)|(Windows XP)/],
["Windows Server 2003", /(Windows NT 5.2)/],
["Windows Vista", /(Windows NT 6.0)/],
["Windows 7", /(Windows NT 6.1)/],
["Windows 8", /(Windows NT 6.2)/],
["Windows 8.1", /(Windows NT 6.3)/],
["Windows 10", /(Windows NT 10.0)/],
["Windows ME", /Windows ME/],
["Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],
["Open BSD", /OpenBSD/],
["Sun OS", /SunOS/],
["Chrome OS", /CrOS/],
["Linux", /(Linux)|(X11)/],
["Mac OS", /(Mac_PowerPC)|(Macintosh)/],
["QNX", /QNX/],
["BeOS", /BeOS/],
["OS/2", /OS\/2/]
];
function detect(userAgent2) {
if (!!userAgent2) {
return parseUserAgent(userAgent2);
}
if (typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative") {
return new ReactNativeInfo();
}
if (typeof navigator !== "undefined") {
return parseUserAgent(navigator.userAgent);
}
return getNodeVersion();
}
function matchUserAgent(ua2) {
return ua2 !== "" && userAgentRules.reduce(function(matched, _a2) {
var browser2 = _a2[0], regex = _a2[1];
if (matched) {
return matched;
}
var uaMatch = regex.exec(ua2);
return !!uaMatch && [browser2, uaMatch];
}, false);
}
function browserName(ua2) {
var data2 = matchUserAgent(ua2);
return data2 ? data2[0] : null;
}
function parseUserAgent(ua2) {
var matchedRule = matchUserAgent(ua2);
if (!matchedRule) {
return null;
}
var name = matchedRule[0], match2 = matchedRule[1];
if (name === "searchbot") {
return new BotInfo();
}
var versionParts = match2[1] && match2[1].split(".").join("_").split("_").slice(0, 3);
if (versionParts) {
if (versionParts.length < REQUIRED_VERSION_PARTS) {
versionParts = __spreadArray$2(__spreadArray$2([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true);
}
} else {
versionParts = [];
}
var version2 = versionParts.join(".");
var os = detectOS(ua2);
var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua2);
if (searchBotMatch && searchBotMatch[1]) {
return new SearchBotDeviceInfo(name, version2, os, searchBotMatch[1]);
}
return new BrowserInfo(name, version2, os);
}
function detectOS(ua2) {
for (var ii2 = 0, count2 = operatingSystemRules.length; ii2 < count2; ii2++) {
var _a2 = operatingSystemRules[ii2], os = _a2[0], regex = _a2[1];
var match2 = regex.exec(ua2);
if (match2) {
return os;
}
}
return null;
}
function getNodeVersion() {
var isNode2 = typeof process !== "undefined" && process.version;
return isNode2 ? new NodeInfo(process.version.slice(1)) : null;
}
function createVersionParts(count2) {
var output3 = [];
for (var ii2 = 0; ii2 < count2; ii2++) {
output3.push("0");
}
return output3;
}
const es$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
BotInfo,
BrowserInfo,
NodeInfo,
ReactNativeInfo,
SearchBotDeviceInfo,
browserName,
detect,
detectOS,
getNodeVersion,
parseUserAgent
}, Symbol.toStringTag, { value: "Module" }));
const require$$2$4 = /* @__PURE__ */ getAugmentedNamespace(es$2);
var cssjanus = { exports: {} };
/*!
* CSSJanus. https://github.com/cssjanus/cssjanus
*
* Copyright 2014 Trevor Parscal
* Copyright 2010 Roan Kattouw
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var hasRequiredCssjanus;
function requireCssjanus() {
if (hasRequiredCssjanus)
return cssjanus.exports;
hasRequiredCssjanus = 1;
(function(module, exports) {
var cssjanus2;
function Tokenizer2(regex, token2) {
var matches = [], index2 = 0;
function tokenizeCallback(match2) {
matches.push(match2);
return token2;
}
function detokenizeCallback() {
return matches[index2++];
}
return {
/**
* Replace matching strings with tokens.
*
* @param {string} str String to tokenize
* @return {string} Tokenized string
*/
tokenize: function(str) {
return str.replace(regex, tokenizeCallback);
},
/**
* Restores tokens to their original values.
*
* @param {string} str String previously run through tokenize()
* @return {string} Original string
*/
detokenize: function(str) {
return str.replace(new RegExp("(" + token2 + ")", "g"), detokenizeCallback);
}
};
}
function CSSJanus() {
var temporaryToken = "`TMP`", noFlipSingleToken = "`NOFLIP_SINGLE`", noFlipClassToken = "`NOFLIP_CLASS`", commentToken = "`COMMENT`", nonAsciiPattern = "[^\\u0020-\\u007e]", unicodePattern = "(?:(?:\\\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)", numPattern = "(?:[0-9]*\\.[0-9]+|[0-9]+)", unitPattern = "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)", directionPattern = "direction\\s*:\\s*", urlSpecialCharsPattern = "[!#$%&*-~]", validAfterUriCharsPattern = `['"]?\\s*`, nonLetterPattern = "(^|[^a-zA-Z])", charsWithinSelectorPattern = "[^\\}]*?", noFlipPattern = "\\/\\*\\!?\\s*@noflip\\s*\\*\\/", commentPattern = "\\/\\*[^*]*\\*+([^\\/*][^*]*\\*+)*\\/", escapePattern = "(?:" + unicodePattern + "|\\\\[^\\r\\n\\f0-9a-f])", nmstartPattern = "(?:[_a-z]|" + nonAsciiPattern + "|" + escapePattern + ")", nmcharPattern = "(?:[_a-z0-9-]|" + nonAsciiPattern + "|" + escapePattern + ")", identPattern = "-?" + nmstartPattern + nmcharPattern + "*", quantPattern = numPattern + "(?:\\s*" + unitPattern + "|" + identPattern + ")?", signedQuantPattern = "((?:-?" + quantPattern + ")|(?:inherit|auto))", fourNotationQuantPropsPattern = "((?:margin|padding|border-width)\\s*:\\s*)", fourNotationColorPropsPattern = "((?:-color|border-style)\\s*:\\s*)", colorPattern = "(#?" + nmcharPattern + "+|(?:rgba?|hsla?)\\([ \\d.,%-]+\\))", urlCharsPattern = "(?:" + urlSpecialCharsPattern + "|" + nonAsciiPattern + "|" + escapePattern + ")*?", lookAheadNotLetterPattern = "(?![a-zA-Z])", lookAheadNotOpenBracePattern = "(?!(" + nmcharPattern + `|\\r?\\n|\\s|#|\\:|\\.|\\,|\\+|>|~|\\(|\\)|\\[|\\]|=|\\*=|~=|\\^=|'[^']*'|"[^"]*"|` + commentToken + ")*?{)", lookAheadNotClosingParenPattern = "(?!" + urlCharsPattern + validAfterUriCharsPattern + "\\))", lookAheadForClosingParenPattern = "(?=" + urlCharsPattern + validAfterUriCharsPattern + "\\))", suffixPattern = "(\\s*(?:!important\\s*)?[;}])", temporaryTokenRegExp = /`TMP`/g, commentRegExp = new RegExp(commentPattern, "gi"), noFlipSingleRegExp = new RegExp("(" + noFlipPattern + lookAheadNotOpenBracePattern + "[^;}]+;?)", "gi"), noFlipClassRegExp = new RegExp("(" + noFlipPattern + charsWithinSelectorPattern + "})", "gi"), directionLtrRegExp = new RegExp("(" + directionPattern + ")ltr", "gi"), directionRtlRegExp = new RegExp("(" + directionPattern + ")rtl", "gi"), leftRegExp = new RegExp(nonLetterPattern + "(left)" + lookAheadNotLetterPattern + lookAheadNotClosingParenPattern + lookAheadNotOpenBracePattern, "gi"), rightRegExp = new RegExp(nonLetterPattern + "(right)" + lookAheadNotLetterPattern + lookAheadNotClosingParenPattern + lookAheadNotOpenBracePattern, "gi"), leftInUrlRegExp = new RegExp(nonLetterPattern + "(left)" + lookAheadForClosingParenPattern, "gi"), rightInUrlRegExp = new RegExp(nonLetterPattern + "(right)" + lookAheadForClosingParenPattern, "gi"), ltrInUrlRegExp = new RegExp(nonLetterPattern + "(ltr)" + lookAheadForClosingParenPattern, "gi"), rtlInUrlRegExp = new RegExp(nonLetterPattern + "(rtl)" + lookAheadForClosingParenPattern, "gi"), cursorEastRegExp = new RegExp(nonLetterPattern + "([ns]?)e-resize", "gi"), cursorWestRegExp = new RegExp(nonLetterPattern + "([ns]?)w-resize", "gi"), fourNotationQuantRegExp = new RegExp(fourNotationQuantPropsPattern + signedQuantPattern + "(\\s+)" + signedQuantPattern + "(\\s+)" + signedQuantPattern + "(\\s+)" + signedQuantPattern + suffixPattern, "gi"), fourNotationColorRegExp = new RegExp(fourNotationColorPropsPattern + colorPattern + "(\\s+)" + colorPattern + "(\\s+)" + colorPattern + "(\\s+)" + colorPattern + suffixPattern, "gi"), bgHorizontalPercentageRegExp = new RegExp("(background(?:-position)?\\s*:\\s*(?:[^:;}\\s]+\\s+)*?)(" + quantPattern + ")", "gi"), bgHorizontalPercentageXRegExp = new RegExp("(background-position-x\\s*:\\s*)(-?" + numPattern + "%)", "gi"), borderRadiusRegExp = new RegExp("(border-radius\\s*:\\s*)" + signedQuantPattern + "(?:(?:\\s+" + signedQuantPattern + ")(?:\\s+" + signedQuantPattern + ")?(?:\\s+" + signedQuantPattern + ")?)?(?:(?:(?:\\s*\\/\\s*)" + signedQuantPattern + ")(?:\\s+" + signedQuantPattern + ")?(?:\\s+" + signedQuantPattern + ")?(?:\\s+" + signedQuantPattern + ")?)?" + suffixPattern, "gi"), boxShadowRegExp = new RegExp("(box-shadow\\s*:\\s*(?:inset\\s*)?)" + signedQuantPattern, "gi"), textShadow1RegExp = new RegExp("(text-shadow\\s*:\\s*)" + signedQuantPattern + "(\\s*)" + colorPattern, "gi"), textShadow2RegExp = new RegExp("(text-shadow\\s*:\\s*)" + colorPattern + "(\\s*)" + signedQuantPattern, "gi"), textShadow3RegExp = new RegExp("(text-shadow\\s*:\\s*)" + signedQuantPattern, "gi"), translateXRegExp = new RegExp("(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)" + signedQuantPattern + "(\\s*\\))", "gi"), translateRegExp = new RegExp("(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)" + signedQuantPattern + "((?:\\s*,\\s*" + signedQuantPattern + "){0,2}\\s*\\))", "gi");
function calculateNewBackgroundPosition(match2, pre, value2) {
var idx, len;
if (value2.slice(-1) === "%") {
idx = value2.indexOf(".");
if (idx !== -1) {
len = value2.length - idx - 2;
value2 = 100 - parseFloat(value2);
value2 = value2.toFixed(len) + "%";
} else {
value2 = 100 - parseFloat(value2) + "%";
}
}
return pre + value2;
}
function flipBorderRadiusValues(values2) {
switch (values2.length) {
case 4:
values2 = [values2[1], values2[0], values2[3], values2[2]];
break;
case 3:
values2 = [values2[1], values2[0], values2[1], values2[2]];
break;
case 2:
values2 = [values2[1], values2[0]];
break;
case 1:
values2 = [values2[0]];
break;
}
return values2.join(" ");
}
function calculateNewBorderRadius(match2, pre) {
var values2, args = [].slice.call(arguments), firstGroup = args.slice(2, 6).filter(function(val) {
return val;
}), secondGroup = args.slice(6, 10).filter(function(val) {
return val;
}), post = args[10] || "";
if (secondGroup.length) {
values2 = flipBorderRadiusValues(firstGroup) + " / " + flipBorderRadiusValues(secondGroup);
} else {
values2 = flipBorderRadiusValues(firstGroup);
}
return pre + values2 + post;
}
function flipSign(value2) {
if (parseFloat(value2) === 0) {
return value2;
}
if (value2[0] === "-") {
return value2.slice(1);
}
return "-" + value2;
}
function calculateNewShadow(match2, property2, offset2) {
return property2 + flipSign(offset2);
}
function calculateNewTranslate(match2, property2, prefix2, offset2, suffix2) {
return property2 + prefix2 + flipSign(offset2) + suffix2;
}
function calculateNewFourTextShadow(match2, property2, color2, space, offset2) {
return property2 + color2 + space + flipSign(offset2);
}
return {
/**
* Transform a left-to-right stylesheet to right-to-left.
*
* @param {string} css Stylesheet to transform
* @param {Object} options Options
* @param {boolean} [options.transformDirInUrl=false] Transform directions in URLs
* (e.g. 'ltr', 'rtl')
* @param {boolean} [options.transformEdgeInUrl=false] Transform edges in URLs
* (e.g. 'left', 'right')
* @return {string} Transformed stylesheet
*/
"transform": function(css4, options2) {
var noFlipSingleTokenizer = new Tokenizer2(noFlipSingleRegExp, noFlipSingleToken), noFlipClassTokenizer = new Tokenizer2(noFlipClassRegExp, noFlipClassToken), commentTokenizer = new Tokenizer2(commentRegExp, commentToken);
css4 = commentTokenizer.tokenize(
noFlipClassTokenizer.tokenize(
noFlipSingleTokenizer.tokenize(
// We wrap tokens in ` , not ~ like the original implementation does.
// This was done because ` is not a legal character in CSS and can only
// occur in URLs, where we escape it to %60 before inserting our tokens.
css4.replace("`", "%60")
)
)
);
if (options2.transformDirInUrl) {
css4 = css4.replace(ltrInUrlRegExp, "$1" + temporaryToken).replace(rtlInUrlRegExp, "$1ltr").replace(temporaryTokenRegExp, "rtl");
}
if (options2.transformEdgeInUrl) {
css4 = css4.replace(leftInUrlRegExp, "$1" + temporaryToken).replace(rightInUrlRegExp, "$1left").replace(temporaryTokenRegExp, "right");
}
css4 = css4.replace(directionLtrRegExp, "$1" + temporaryToken).replace(directionRtlRegExp, "$1ltr").replace(temporaryTokenRegExp, "rtl").replace(leftRegExp, "$1" + temporaryToken).replace(rightRegExp, "$1left").replace(temporaryTokenRegExp, "right").replace(cursorEastRegExp, "$1$2" + temporaryToken).replace(cursorWestRegExp, "$1$2e-resize").replace(temporaryTokenRegExp, "w-resize").replace(borderRadiusRegExp, calculateNewBorderRadius).replace(boxShadowRegExp, calculateNewShadow).replace(textShadow1RegExp, calculateNewFourTextShadow).replace(textShadow2RegExp, calculateNewFourTextShadow).replace(textShadow3RegExp, calculateNewShadow).replace(translateXRegExp, calculateNewTranslate).replace(translateRegExp, calculateNewTranslate).replace(fourNotationQuantRegExp, "$1$2$3$8$5$6$7$4$9").replace(fourNotationColorRegExp, "$1$2$3$8$5$6$7$4$9").replace(bgHorizontalPercentageRegExp, calculateNewBackgroundPosition).replace(bgHorizontalPercentageXRegExp, calculateNewBackgroundPosition);
css4 = noFlipSingleTokenizer.detokenize(
noFlipClassTokenizer.detokenize(
commentTokenizer.detokenize(css4)
)
);
return css4;
}
};
}
cssjanus2 = new CSSJanus();
if (module.exports) {
exports.transform = function(css4, options2, transformEdgeInUrl) {
var norm;
if (typeof options2 === "object") {
norm = options2;
} else {
norm = {};
if (typeof options2 === "boolean") {
norm.transformDirInUrl = options2;
}
if (typeof transformEdgeInUrl === "boolean") {
norm.transformEdgeInUrl = transformEdgeInUrl;
}
}
return cssjanus2.transform(css4, norm);
};
} else if (typeof window !== "undefined") {
window["cssjanus"] = cssjanus2;
}
})(cssjanus, cssjanus.exports);
return cssjanus.exports;
}
var _freeGlobal$1;
var hasRequired_freeGlobal;
function require_freeGlobal() {
if (hasRequired_freeGlobal)
return _freeGlobal$1;
hasRequired_freeGlobal = 1;
var freeGlobal2 = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
_freeGlobal$1 = freeGlobal2;
return _freeGlobal$1;
}
var _root$1;
var hasRequired_root;
function require_root() {
if (hasRequired_root)
return _root$1;
hasRequired_root = 1;
var freeGlobal2 = require_freeGlobal();
var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
var root2 = freeGlobal2 || freeSelf2 || Function("return this")();
_root$1 = root2;
return _root$1;
}
var _Symbol$1;
var hasRequired_Symbol;
function require_Symbol() {
if (hasRequired_Symbol)
return _Symbol$1;
hasRequired_Symbol = 1;
var root2 = require_root();
var Symbol2 = root2.Symbol;
_Symbol$1 = Symbol2;
return _Symbol$1;
}
var _getRawTag$1;
var hasRequired_getRawTag;
function require_getRawTag() {
if (hasRequired_getRawTag)
return _getRawTag$1;
hasRequired_getRawTag = 1;
var Symbol2 = require_Symbol();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
var nativeObjectToString2 = objectProto2.toString;
var symToStringTag2 = Symbol2 ? Symbol2.toStringTag : void 0;
function getRawTag2(value2) {
var isOwn = hasOwnProperty2.call(value2, symToStringTag2), tag = value2[symToStringTag2];
try {
value2[symToStringTag2] = void 0;
var unmasked = true;
} catch (e7) {
}
var result = nativeObjectToString2.call(value2);
if (unmasked) {
if (isOwn) {
value2[symToStringTag2] = tag;
} else {
delete value2[symToStringTag2];
}
}
return result;
}
_getRawTag$1 = getRawTag2;
return _getRawTag$1;
}
var _objectToString$1;
var hasRequired_objectToString;
function require_objectToString() {
if (hasRequired_objectToString)
return _objectToString$1;
hasRequired_objectToString = 1;
var objectProto2 = Object.prototype;
var nativeObjectToString2 = objectProto2.toString;
function objectToString2(value2) {
return nativeObjectToString2.call(value2);
}
_objectToString$1 = objectToString2;
return _objectToString$1;
}
var _baseGetTag$1;
var hasRequired_baseGetTag;
function require_baseGetTag() {
if (hasRequired_baseGetTag)
return _baseGetTag$1;
hasRequired_baseGetTag = 1;
var Symbol2 = require_Symbol(), getRawTag2 = require_getRawTag(), objectToString2 = require_objectToString();
var nullTag2 = "[object Null]", undefinedTag2 = "[object Undefined]";
var symToStringTag2 = Symbol2 ? Symbol2.toStringTag : void 0;
function baseGetTag2(value2) {
if (value2 == null) {
return value2 === void 0 ? undefinedTag2 : nullTag2;
}
return symToStringTag2 && symToStringTag2 in Object(value2) ? getRawTag2(value2) : objectToString2(value2);
}
_baseGetTag$1 = baseGetTag2;
return _baseGetTag$1;
}
var isObject_1$1;
var hasRequiredIsObject;
function requireIsObject() {
if (hasRequiredIsObject)
return isObject_1$1;
hasRequiredIsObject = 1;
function isObject2(value2) {
var type2 = typeof value2;
return value2 != null && (type2 == "object" || type2 == "function");
}
isObject_1$1 = isObject2;
return isObject_1$1;
}
var isFunction_1;
var hasRequiredIsFunction;
function requireIsFunction() {
if (hasRequiredIsFunction)
return isFunction_1;
hasRequiredIsFunction = 1;
var baseGetTag2 = require_baseGetTag(), isObject2 = requireIsObject();
var asyncTag = "[object AsyncFunction]", funcTag2 = "[object Function]", genTag2 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
function isFunction2(value2) {
if (!isObject2(value2)) {
return false;
}
var tag = baseGetTag2(value2);
return tag == funcTag2 || tag == genTag2 || tag == asyncTag || tag == proxyTag;
}
isFunction_1 = isFunction2;
return isFunction_1;
}
var isObjectLike_1$1;
var hasRequiredIsObjectLike;
function requireIsObjectLike() {
if (hasRequiredIsObjectLike)
return isObjectLike_1$1;
hasRequiredIsObjectLike = 1;
function isObjectLike2(value2) {
return value2 != null && typeof value2 == "object";
}
isObjectLike_1$1 = isObjectLike2;
return isObjectLike_1$1;
}
var isBoolean_1;
var hasRequiredIsBoolean;
function requireIsBoolean() {
if (hasRequiredIsBoolean)
return isBoolean_1;
hasRequiredIsBoolean = 1;
var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
var boolTag = "[object Boolean]";
function isBoolean2(value2) {
return value2 === true || value2 === false || isObjectLike2(value2) && baseGetTag2(value2) == boolTag;
}
isBoolean_1 = isBoolean2;
return isBoolean_1;
}
var isArray_1;
var hasRequiredIsArray;
function requireIsArray() {
if (hasRequiredIsArray)
return isArray_1;
hasRequiredIsArray = 1;
var isArray3 = Array.isArray;
isArray_1 = isArray3;
return isArray_1;
}
var isString_1;
var hasRequiredIsString;
function requireIsString() {
if (hasRequiredIsString)
return isString_1;
hasRequiredIsString = 1;
var baseGetTag2 = require_baseGetTag(), isArray3 = requireIsArray(), isObjectLike2 = requireIsObjectLike();
var stringTag = "[object String]";
function isString2(value2) {
return typeof value2 == "string" || !isArray3(value2) && isObjectLike2(value2) && baseGetTag2(value2) == stringTag;
}
isString_1 = isString2;
return isString_1;
}
var _arrayMap;
var hasRequired_arrayMap;
function require_arrayMap() {
if (hasRequired_arrayMap)
return _arrayMap;
hasRequired_arrayMap = 1;
function arrayMap2(array2, iteratee) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2);
while (++index2 < length2) {
result[index2] = iteratee(array2[index2], index2, array2);
}
return result;
}
_arrayMap = arrayMap2;
return _arrayMap;
}
var _listCacheClear;
var hasRequired_listCacheClear;
function require_listCacheClear() {
if (hasRequired_listCacheClear)
return _listCacheClear;
hasRequired_listCacheClear = 1;
function listCacheClear2() {
this.__data__ = [];
this.size = 0;
}
_listCacheClear = listCacheClear2;
return _listCacheClear;
}
var eq_1;
var hasRequiredEq;
function requireEq() {
if (hasRequiredEq)
return eq_1;
hasRequiredEq = 1;
function eq2(value2, other) {
return value2 === other || value2 !== value2 && other !== other;
}
eq_1 = eq2;
return eq_1;
}
var _assocIndexOf;
var hasRequired_assocIndexOf;
function require_assocIndexOf() {
if (hasRequired_assocIndexOf)
return _assocIndexOf;
hasRequired_assocIndexOf = 1;
var eq2 = requireEq();
function assocIndexOf2(array2, key2) {
var length2 = array2.length;
while (length2--) {
if (eq2(array2[length2][0], key2)) {
return length2;
}
}
return -1;
}
_assocIndexOf = assocIndexOf2;
return _assocIndexOf;
}
var _listCacheDelete;
var hasRequired_listCacheDelete;
function require_listCacheDelete() {
if (hasRequired_listCacheDelete)
return _listCacheDelete;
hasRequired_listCacheDelete = 1;
var assocIndexOf2 = require_assocIndexOf();
var arrayProto2 = Array.prototype;
var splice2 = arrayProto2.splice;
function listCacheDelete2(key2) {
var data2 = this.__data__, index2 = assocIndexOf2(data2, key2);
if (index2 < 0) {
return false;
}
var lastIndex = data2.length - 1;
if (index2 == lastIndex) {
data2.pop();
} else {
splice2.call(data2, index2, 1);
}
--this.size;
return true;
}
_listCacheDelete = listCacheDelete2;
return _listCacheDelete;
}
var _listCacheGet;
var hasRequired_listCacheGet;
function require_listCacheGet() {
if (hasRequired_listCacheGet)
return _listCacheGet;
hasRequired_listCacheGet = 1;
var assocIndexOf2 = require_assocIndexOf();
function listCacheGet2(key2) {
var data2 = this.__data__, index2 = assocIndexOf2(data2, key2);
return index2 < 0 ? void 0 : data2[index2][1];
}
_listCacheGet = listCacheGet2;
return _listCacheGet;
}
var _listCacheHas;
var hasRequired_listCacheHas;
function require_listCacheHas() {
if (hasRequired_listCacheHas)
return _listCacheHas;
hasRequired_listCacheHas = 1;
var assocIndexOf2 = require_assocIndexOf();
function listCacheHas2(key2) {
return assocIndexOf2(this.__data__, key2) > -1;
}
_listCacheHas = listCacheHas2;
return _listCacheHas;
}
var _listCacheSet;
var hasRequired_listCacheSet;
function require_listCacheSet() {
if (hasRequired_listCacheSet)
return _listCacheSet;
hasRequired_listCacheSet = 1;
var assocIndexOf2 = require_assocIndexOf();
function listCacheSet2(key2, value2) {
var data2 = this.__data__, index2 = assocIndexOf2(data2, key2);
if (index2 < 0) {
++this.size;
data2.push([key2, value2]);
} else {
data2[index2][1] = value2;
}
return this;
}
_listCacheSet = listCacheSet2;
return _listCacheSet;
}
var _ListCache;
var hasRequired_ListCache;
function require_ListCache() {
if (hasRequired_ListCache)
return _ListCache;
hasRequired_ListCache = 1;
var listCacheClear2 = require_listCacheClear(), listCacheDelete2 = require_listCacheDelete(), listCacheGet2 = require_listCacheGet(), listCacheHas2 = require_listCacheHas(), listCacheSet2 = require_listCacheSet();
function ListCache2(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
ListCache2.prototype.clear = listCacheClear2;
ListCache2.prototype["delete"] = listCacheDelete2;
ListCache2.prototype.get = listCacheGet2;
ListCache2.prototype.has = listCacheHas2;
ListCache2.prototype.set = listCacheSet2;
_ListCache = ListCache2;
return _ListCache;
}
var _stackClear;
var hasRequired_stackClear;
function require_stackClear() {
if (hasRequired_stackClear)
return _stackClear;
hasRequired_stackClear = 1;
var ListCache2 = require_ListCache();
function stackClear() {
this.__data__ = new ListCache2();
this.size = 0;
}
_stackClear = stackClear;
return _stackClear;
}
var _stackDelete;
var hasRequired_stackDelete;
function require_stackDelete() {
if (hasRequired_stackDelete)
return _stackDelete;
hasRequired_stackDelete = 1;
function stackDelete(key2) {
var data2 = this.__data__, result = data2["delete"](key2);
this.size = data2.size;
return result;
}
_stackDelete = stackDelete;
return _stackDelete;
}
var _stackGet;
var hasRequired_stackGet;
function require_stackGet() {
if (hasRequired_stackGet)
return _stackGet;
hasRequired_stackGet = 1;
function stackGet(key2) {
return this.__data__.get(key2);
}
_stackGet = stackGet;
return _stackGet;
}
var _stackHas;
var hasRequired_stackHas;
function require_stackHas() {
if (hasRequired_stackHas)
return _stackHas;
hasRequired_stackHas = 1;
function stackHas(key2) {
return this.__data__.has(key2);
}
_stackHas = stackHas;
return _stackHas;
}
var _coreJsData;
var hasRequired_coreJsData;
function require_coreJsData() {
if (hasRequired_coreJsData)
return _coreJsData;
hasRequired_coreJsData = 1;
var root2 = require_root();
var coreJsData2 = root2["__core-js_shared__"];
_coreJsData = coreJsData2;
return _coreJsData;
}
var _isMasked;
var hasRequired_isMasked;
function require_isMasked() {
if (hasRequired_isMasked)
return _isMasked;
hasRequired_isMasked = 1;
var coreJsData2 = require_coreJsData();
var maskSrcKey2 = function() {
var uid2 = /[^.]+$/.exec(coreJsData2 && coreJsData2.keys && coreJsData2.keys.IE_PROTO || "");
return uid2 ? "Symbol(src)_1." + uid2 : "";
}();
function isMasked2(func) {
return !!maskSrcKey2 && maskSrcKey2 in func;
}
_isMasked = isMasked2;
return _isMasked;
}
var _toSource;
var hasRequired_toSource;
function require_toSource() {
if (hasRequired_toSource)
return _toSource;
hasRequired_toSource = 1;
var funcProto2 = Function.prototype;
var funcToString2 = funcProto2.toString;
function toSource2(func) {
if (func != null) {
try {
return funcToString2.call(func);
} catch (e7) {
}
try {
return func + "";
} catch (e7) {
}
}
return "";
}
_toSource = toSource2;
return _toSource;
}
var _baseIsNative;
var hasRequired_baseIsNative;
function require_baseIsNative() {
if (hasRequired_baseIsNative)
return _baseIsNative;
hasRequired_baseIsNative = 1;
var isFunction2 = requireIsFunction(), isMasked2 = require_isMasked(), isObject2 = requireIsObject(), toSource2 = require_toSource();
var reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor2 = /^\[object .+?Constructor\]$/;
var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
var funcToString2 = funcProto2.toString;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
var reIsNative2 = RegExp(
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative2(value2) {
if (!isObject2(value2) || isMasked2(value2)) {
return false;
}
var pattern = isFunction2(value2) ? reIsNative2 : reIsHostCtor2;
return pattern.test(toSource2(value2));
}
_baseIsNative = baseIsNative2;
return _baseIsNative;
}
var _getValue;
var hasRequired_getValue;
function require_getValue() {
if (hasRequired_getValue)
return _getValue;
hasRequired_getValue = 1;
function getValue2(object2, key2) {
return object2 == null ? void 0 : object2[key2];
}
_getValue = getValue2;
return _getValue;
}
var _getNative;
var hasRequired_getNative;
function require_getNative() {
if (hasRequired_getNative)
return _getNative;
hasRequired_getNative = 1;
var baseIsNative2 = require_baseIsNative(), getValue2 = require_getValue();
function getNative2(object2, key2) {
var value2 = getValue2(object2, key2);
return baseIsNative2(value2) ? value2 : void 0;
}
_getNative = getNative2;
return _getNative;
}
var _Map;
var hasRequired_Map;
function require_Map() {
if (hasRequired_Map)
return _Map;
hasRequired_Map = 1;
var getNative2 = require_getNative(), root2 = require_root();
var Map2 = getNative2(root2, "Map");
_Map = Map2;
return _Map;
}
var _nativeCreate;
var hasRequired_nativeCreate;
function require_nativeCreate() {
if (hasRequired_nativeCreate)
return _nativeCreate;
hasRequired_nativeCreate = 1;
var getNative2 = require_getNative();
var nativeCreate2 = getNative2(Object, "create");
_nativeCreate = nativeCreate2;
return _nativeCreate;
}
var _hashClear;
var hasRequired_hashClear;
function require_hashClear() {
if (hasRequired_hashClear)
return _hashClear;
hasRequired_hashClear = 1;
var nativeCreate2 = require_nativeCreate();
function hashClear2() {
this.__data__ = nativeCreate2 ? nativeCreate2(null) : {};
this.size = 0;
}
_hashClear = hashClear2;
return _hashClear;
}
var _hashDelete;
var hasRequired_hashDelete;
function require_hashDelete() {
if (hasRequired_hashDelete)
return _hashDelete;
hasRequired_hashDelete = 1;
function hashDelete2(key2) {
var result = this.has(key2) && delete this.__data__[key2];
this.size -= result ? 1 : 0;
return result;
}
_hashDelete = hashDelete2;
return _hashDelete;
}
var _hashGet;
var hasRequired_hashGet;
function require_hashGet() {
if (hasRequired_hashGet)
return _hashGet;
hasRequired_hashGet = 1;
var nativeCreate2 = require_nativeCreate();
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function hashGet2(key2) {
var data2 = this.__data__;
if (nativeCreate2) {
var result = data2[key2];
return result === HASH_UNDEFINED2 ? void 0 : result;
}
return hasOwnProperty2.call(data2, key2) ? data2[key2] : void 0;
}
_hashGet = hashGet2;
return _hashGet;
}
var _hashHas;
var hasRequired_hashHas;
function require_hashHas() {
if (hasRequired_hashHas)
return _hashHas;
hasRequired_hashHas = 1;
var nativeCreate2 = require_nativeCreate();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function hashHas2(key2) {
var data2 = this.__data__;
return nativeCreate2 ? data2[key2] !== void 0 : hasOwnProperty2.call(data2, key2);
}
_hashHas = hashHas2;
return _hashHas;
}
var _hashSet;
var hasRequired_hashSet;
function require_hashSet() {
if (hasRequired_hashSet)
return _hashSet;
hasRequired_hashSet = 1;
var nativeCreate2 = require_nativeCreate();
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
function hashSet2(key2, value2) {
var data2 = this.__data__;
this.size += this.has(key2) ? 0 : 1;
data2[key2] = nativeCreate2 && value2 === void 0 ? HASH_UNDEFINED2 : value2;
return this;
}
_hashSet = hashSet2;
return _hashSet;
}
var _Hash;
var hasRequired_Hash;
function require_Hash() {
if (hasRequired_Hash)
return _Hash;
hasRequired_Hash = 1;
var hashClear2 = require_hashClear(), hashDelete2 = require_hashDelete(), hashGet2 = require_hashGet(), hashHas2 = require_hashHas(), hashSet2 = require_hashSet();
function Hash2(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
Hash2.prototype.clear = hashClear2;
Hash2.prototype["delete"] = hashDelete2;
Hash2.prototype.get = hashGet2;
Hash2.prototype.has = hashHas2;
Hash2.prototype.set = hashSet2;
_Hash = Hash2;
return _Hash;
}
var _mapCacheClear;
var hasRequired_mapCacheClear;
function require_mapCacheClear() {
if (hasRequired_mapCacheClear)
return _mapCacheClear;
hasRequired_mapCacheClear = 1;
var Hash2 = require_Hash(), ListCache2 = require_ListCache(), Map2 = require_Map();
function mapCacheClear2() {
this.size = 0;
this.__data__ = {
"hash": new Hash2(),
"map": new (Map2 || ListCache2)(),
"string": new Hash2()
};
}
_mapCacheClear = mapCacheClear2;
return _mapCacheClear;
}
var _isKeyable;
var hasRequired_isKeyable;
function require_isKeyable() {
if (hasRequired_isKeyable)
return _isKeyable;
hasRequired_isKeyable = 1;
function isKeyable2(value2) {
var type2 = typeof value2;
return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value2 !== "__proto__" : value2 === null;
}
_isKeyable = isKeyable2;
return _isKeyable;
}
var _getMapData;
var hasRequired_getMapData;
function require_getMapData() {
if (hasRequired_getMapData)
return _getMapData;
hasRequired_getMapData = 1;
var isKeyable2 = require_isKeyable();
function getMapData2(map2, key2) {
var data2 = map2.__data__;
return isKeyable2(key2) ? data2[typeof key2 == "string" ? "string" : "hash"] : data2.map;
}
_getMapData = getMapData2;
return _getMapData;
}
var _mapCacheDelete;
var hasRequired_mapCacheDelete;
function require_mapCacheDelete() {
if (hasRequired_mapCacheDelete)
return _mapCacheDelete;
hasRequired_mapCacheDelete = 1;
var getMapData2 = require_getMapData();
function mapCacheDelete2(key2) {
var result = getMapData2(this, key2)["delete"](key2);
this.size -= result ? 1 : 0;
return result;
}
_mapCacheDelete = mapCacheDelete2;
return _mapCacheDelete;
}
var _mapCacheGet;
var hasRequired_mapCacheGet;
function require_mapCacheGet() {
if (hasRequired_mapCacheGet)
return _mapCacheGet;
hasRequired_mapCacheGet = 1;
var getMapData2 = require_getMapData();
function mapCacheGet2(key2) {
return getMapData2(this, key2).get(key2);
}
_mapCacheGet = mapCacheGet2;
return _mapCacheGet;
}
var _mapCacheHas;
var hasRequired_mapCacheHas;
function require_mapCacheHas() {
if (hasRequired_mapCacheHas)
return _mapCacheHas;
hasRequired_mapCacheHas = 1;
var getMapData2 = require_getMapData();
function mapCacheHas2(key2) {
return getMapData2(this, key2).has(key2);
}
_mapCacheHas = mapCacheHas2;
return _mapCacheHas;
}
var _mapCacheSet;
var hasRequired_mapCacheSet;
function require_mapCacheSet() {
if (hasRequired_mapCacheSet)
return _mapCacheSet;
hasRequired_mapCacheSet = 1;
var getMapData2 = require_getMapData();
function mapCacheSet2(key2, value2) {
var data2 = getMapData2(this, key2), size = data2.size;
data2.set(key2, value2);
this.size += data2.size == size ? 0 : 1;
return this;
}
_mapCacheSet = mapCacheSet2;
return _mapCacheSet;
}
var _MapCache;
var hasRequired_MapCache;
function require_MapCache() {
if (hasRequired_MapCache)
return _MapCache;
hasRequired_MapCache = 1;
var mapCacheClear2 = require_mapCacheClear(), mapCacheDelete2 = require_mapCacheDelete(), mapCacheGet2 = require_mapCacheGet(), mapCacheHas2 = require_mapCacheHas(), mapCacheSet2 = require_mapCacheSet();
function MapCache2(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
MapCache2.prototype.clear = mapCacheClear2;
MapCache2.prototype["delete"] = mapCacheDelete2;
MapCache2.prototype.get = mapCacheGet2;
MapCache2.prototype.has = mapCacheHas2;
MapCache2.prototype.set = mapCacheSet2;
_MapCache = MapCache2;
return _MapCache;
}
var _stackSet;
var hasRequired_stackSet;
function require_stackSet() {
if (hasRequired_stackSet)
return _stackSet;
hasRequired_stackSet = 1;
var ListCache2 = require_ListCache(), Map2 = require_Map(), MapCache2 = require_MapCache();
var LARGE_ARRAY_SIZE2 = 200;
function stackSet(key2, value2) {
var data2 = this.__data__;
if (data2 instanceof ListCache2) {
var pairs = data2.__data__;
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE2 - 1) {
pairs.push([key2, value2]);
this.size = ++data2.size;
return this;
}
data2 = this.__data__ = new MapCache2(pairs);
}
data2.set(key2, value2);
this.size = data2.size;
return this;
}
_stackSet = stackSet;
return _stackSet;
}
var _Stack;
var hasRequired_Stack;
function require_Stack() {
if (hasRequired_Stack)
return _Stack;
hasRequired_Stack = 1;
var ListCache2 = require_ListCache(), stackClear = require_stackClear(), stackDelete = require_stackDelete(), stackGet = require_stackGet(), stackHas = require_stackHas(), stackSet = require_stackSet();
function Stack2(entries) {
var data2 = this.__data__ = new ListCache2(entries);
this.size = data2.size;
}
Stack2.prototype.clear = stackClear;
Stack2.prototype["delete"] = stackDelete;
Stack2.prototype.get = stackGet;
Stack2.prototype.has = stackHas;
Stack2.prototype.set = stackSet;
_Stack = Stack2;
return _Stack;
}
var _setCacheAdd;
var hasRequired_setCacheAdd;
function require_setCacheAdd() {
if (hasRequired_setCacheAdd)
return _setCacheAdd;
hasRequired_setCacheAdd = 1;
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
function setCacheAdd2(value2) {
this.__data__.set(value2, HASH_UNDEFINED2);
return this;
}
_setCacheAdd = setCacheAdd2;
return _setCacheAdd;
}
var _setCacheHas;
var hasRequired_setCacheHas;
function require_setCacheHas() {
if (hasRequired_setCacheHas)
return _setCacheHas;
hasRequired_setCacheHas = 1;
function setCacheHas2(value2) {
return this.__data__.has(value2);
}
_setCacheHas = setCacheHas2;
return _setCacheHas;
}
var _SetCache;
var hasRequired_SetCache;
function require_SetCache() {
if (hasRequired_SetCache)
return _SetCache;
hasRequired_SetCache = 1;
var MapCache2 = require_MapCache(), setCacheAdd2 = require_setCacheAdd(), setCacheHas2 = require_setCacheHas();
function SetCache2(values2) {
var index2 = -1, length2 = values2 == null ? 0 : values2.length;
this.__data__ = new MapCache2();
while (++index2 < length2) {
this.add(values2[index2]);
}
}
SetCache2.prototype.add = SetCache2.prototype.push = setCacheAdd2;
SetCache2.prototype.has = setCacheHas2;
_SetCache = SetCache2;
return _SetCache;
}
var _arraySome;
var hasRequired_arraySome;
function require_arraySome() {
if (hasRequired_arraySome)
return _arraySome;
hasRequired_arraySome = 1;
function arraySome(array2, predicate) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length;
while (++index2 < length2) {
if (predicate(array2[index2], index2, array2)) {
return true;
}
}
return false;
}
_arraySome = arraySome;
return _arraySome;
}
var _cacheHas;
var hasRequired_cacheHas;
function require_cacheHas() {
if (hasRequired_cacheHas)
return _cacheHas;
hasRequired_cacheHas = 1;
function cacheHas2(cache2, key2) {
return cache2.has(key2);
}
_cacheHas = cacheHas2;
return _cacheHas;
}
var _equalArrays;
var hasRequired_equalArrays;
function require_equalArrays() {
if (hasRequired_equalArrays)
return _equalArrays;
hasRequired_equalArrays = 1;
var SetCache2 = require_SetCache(), arraySome = require_arraySome(), cacheHas2 = require_cacheHas();
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
var arrStacked = stack.get(array2);
var othStacked = stack.get(other);
if (arrStacked && othStacked) {
return arrStacked == other && othStacked == array2;
}
var index2 = -1, result = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache2() : void 0;
stack.set(array2, other);
stack.set(other, array2);
while (++index2 < arrLength) {
var arrValue = array2[index2], othValue = other[index2];
if (customizer) {
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
}
if (compared !== void 0) {
if (compared) {
continue;
}
result = false;
break;
}
if (seen2) {
if (!arraySome(other, function(othValue2, othIndex) {
if (!cacheHas2(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
return seen2.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
result = false;
break;
}
}
stack["delete"](array2);
stack["delete"](other);
return result;
}
_equalArrays = equalArrays;
return _equalArrays;
}
var _Uint8Array;
var hasRequired_Uint8Array;
function require_Uint8Array() {
if (hasRequired_Uint8Array)
return _Uint8Array;
hasRequired_Uint8Array = 1;
var root2 = require_root();
var Uint8Array2 = root2.Uint8Array;
_Uint8Array = Uint8Array2;
return _Uint8Array;
}
var _mapToArray;
var hasRequired_mapToArray;
function require_mapToArray() {
if (hasRequired_mapToArray)
return _mapToArray;
hasRequired_mapToArray = 1;
function mapToArray(map2) {
var index2 = -1, result = Array(map2.size);
map2.forEach(function(value2, key2) {
result[++index2] = [key2, value2];
});
return result;
}
_mapToArray = mapToArray;
return _mapToArray;
}
var _setToArray;
var hasRequired_setToArray;
function require_setToArray() {
if (hasRequired_setToArray)
return _setToArray;
hasRequired_setToArray = 1;
function setToArray(set2) {
var index2 = -1, result = Array(set2.size);
set2.forEach(function(value2) {
result[++index2] = value2;
});
return result;
}
_setToArray = setToArray;
return _setToArray;
}
var _equalByTag;
var hasRequired_equalByTag;
function require_equalByTag() {
if (hasRequired_equalByTag)
return _equalByTag;
hasRequired_equalByTag = 1;
var Symbol2 = require_Symbol(), Uint8Array2 = require_Uint8Array(), eq2 = requireEq(), equalArrays = require_equalArrays(), mapToArray = require_mapToArray(), setToArray = require_setToArray();
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag2 = "[object Symbol]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
return false;
}
object2 = object2.buffer;
other = other.buffer;
case arrayBufferTag:
if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
return eq2(+object2, +other);
case errorTag:
return object2.name == other.name && object2.message == other.message;
case regexpTag:
case stringTag:
return object2 == other + "";
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object2.size != other.size && !isPartial) {
return false;
}
var stacked = stack.get(object2);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
stack.set(object2, other);
var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack);
stack["delete"](object2);
return result;
case symbolTag2:
if (symbolValueOf) {
return symbolValueOf.call(object2) == symbolValueOf.call(other);
}
}
return false;
}
_equalByTag = equalByTag;
return _equalByTag;
}
var _arrayPush;
var hasRequired_arrayPush;
function require_arrayPush() {
if (hasRequired_arrayPush)
return _arrayPush;
hasRequired_arrayPush = 1;
function arrayPush2(array2, values2) {
var index2 = -1, length2 = values2.length, offset2 = array2.length;
while (++index2 < length2) {
array2[offset2 + index2] = values2[index2];
}
return array2;
}
_arrayPush = arrayPush2;
return _arrayPush;
}
var _baseGetAllKeys;
var hasRequired_baseGetAllKeys;
function require_baseGetAllKeys() {
if (hasRequired_baseGetAllKeys)
return _baseGetAllKeys;
hasRequired_baseGetAllKeys = 1;
var arrayPush2 = require_arrayPush(), isArray3 = requireIsArray();
function baseGetAllKeys2(object2, keysFunc, symbolsFunc) {
var result = keysFunc(object2);
return isArray3(object2) ? result : arrayPush2(result, symbolsFunc(object2));
}
_baseGetAllKeys = baseGetAllKeys2;
return _baseGetAllKeys;
}
var _arrayFilter;
var hasRequired_arrayFilter;
function require_arrayFilter() {
if (hasRequired_arrayFilter)
return _arrayFilter;
hasRequired_arrayFilter = 1;
function arrayFilter(array2, predicate) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
while (++index2 < length2) {
var value2 = array2[index2];
if (predicate(value2, index2, array2)) {
result[resIndex++] = value2;
}
}
return result;
}
_arrayFilter = arrayFilter;
return _arrayFilter;
}
var stubArray_1;
var hasRequiredStubArray;
function requireStubArray() {
if (hasRequiredStubArray)
return stubArray_1;
hasRequiredStubArray = 1;
function stubArray2() {
return [];
}
stubArray_1 = stubArray2;
return stubArray_1;
}
var _getSymbols;
var hasRequired_getSymbols;
function require_getSymbols() {
if (hasRequired_getSymbols)
return _getSymbols;
hasRequired_getSymbols = 1;
var arrayFilter = require_arrayFilter(), stubArray2 = requireStubArray();
var objectProto2 = Object.prototype;
var propertyIsEnumerable3 = objectProto2.propertyIsEnumerable;
var nativeGetSymbols2 = Object.getOwnPropertySymbols;
var getSymbols2 = !nativeGetSymbols2 ? stubArray2 : function(object2) {
if (object2 == null) {
return [];
}
object2 = Object(object2);
return arrayFilter(nativeGetSymbols2(object2), function(symbol2) {
return propertyIsEnumerable3.call(object2, symbol2);
});
};
_getSymbols = getSymbols2;
return _getSymbols;
}
var _baseTimes;
var hasRequired_baseTimes;
function require_baseTimes() {
if (hasRequired_baseTimes)
return _baseTimes;
hasRequired_baseTimes = 1;
function baseTimes2(n2, iteratee) {
var index2 = -1, result = Array(n2);
while (++index2 < n2) {
result[index2] = iteratee(index2);
}
return result;
}
_baseTimes = baseTimes2;
return _baseTimes;
}
var _baseIsArguments;
var hasRequired_baseIsArguments;
function require_baseIsArguments() {
if (hasRequired_baseIsArguments)
return _baseIsArguments;
hasRequired_baseIsArguments = 1;
var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
var argsTag2 = "[object Arguments]";
function baseIsArguments(value2) {
return isObjectLike2(value2) && baseGetTag2(value2) == argsTag2;
}
_baseIsArguments = baseIsArguments;
return _baseIsArguments;
}
var isArguments_1;
var hasRequiredIsArguments;
function requireIsArguments() {
if (hasRequiredIsArguments)
return isArguments_1;
hasRequiredIsArguments = 1;
var baseIsArguments = require_baseIsArguments(), isObjectLike2 = requireIsObjectLike();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
var propertyIsEnumerable3 = objectProto2.propertyIsEnumerable;
var isArguments2 = baseIsArguments(function() {
return arguments;
}()) ? baseIsArguments : function(value2) {
return isObjectLike2(value2) && hasOwnProperty2.call(value2, "callee") && !propertyIsEnumerable3.call(value2, "callee");
};
isArguments_1 = isArguments2;
return isArguments_1;
}
var isBuffer$1 = { exports: {} };
var stubFalse_1;
var hasRequiredStubFalse;
function requireStubFalse() {
if (hasRequiredStubFalse)
return stubFalse_1;
hasRequiredStubFalse = 1;
function stubFalse() {
return false;
}
stubFalse_1 = stubFalse;
return stubFalse_1;
}
isBuffer$1.exports;
var hasRequiredIsBuffer;
function requireIsBuffer() {
if (hasRequiredIsBuffer)
return isBuffer$1.exports;
hasRequiredIsBuffer = 1;
(function(module, exports) {
var root2 = require_root(), stubFalse = requireStubFalse();
var freeExports = exports && !exports.nodeType && exports;
var freeModule = freeExports && true && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var Buffer2 = moduleExports ? root2.Buffer : void 0;
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
var isBuffer2 = nativeIsBuffer || stubFalse;
module.exports = isBuffer2;
})(isBuffer$1, isBuffer$1.exports);
return isBuffer$1.exports;
}
var _isIndex;
var hasRequired_isIndex;
function require_isIndex() {
if (hasRequired_isIndex)
return _isIndex;
hasRequired_isIndex = 1;
var MAX_SAFE_INTEGER2 = 9007199254740991;
var reIsUint2 = /^(?:0|[1-9]\d*)$/;
function isIndex2(value2, length2) {
var type2 = typeof value2;
length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2;
return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint2.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2);
}
_isIndex = isIndex2;
return _isIndex;
}
var isLength_1;
var hasRequiredIsLength;
function requireIsLength() {
if (hasRequiredIsLength)
return isLength_1;
hasRequiredIsLength = 1;
var MAX_SAFE_INTEGER2 = 9007199254740991;
function isLength2(value2) {
return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER2;
}
isLength_1 = isLength2;
return isLength_1;
}
var _baseIsTypedArray;
var hasRequired_baseIsTypedArray;
function require_baseIsTypedArray() {
if (hasRequired_baseIsTypedArray)
return _baseIsTypedArray;
hasRequired_baseIsTypedArray = 1;
var baseGetTag2 = require_baseGetTag(), isLength2 = requireIsLength(), isObjectLike2 = requireIsObjectLike();
var argsTag2 = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag2 = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
function baseIsTypedArray(value2) {
return isObjectLike2(value2) && isLength2(value2.length) && !!typedArrayTags[baseGetTag2(value2)];
}
_baseIsTypedArray = baseIsTypedArray;
return _baseIsTypedArray;
}
var _baseUnary;
var hasRequired_baseUnary;
function require_baseUnary() {
if (hasRequired_baseUnary)
return _baseUnary;
hasRequired_baseUnary = 1;
function baseUnary2(func) {
return function(value2) {
return func(value2);
};
}
_baseUnary = baseUnary2;
return _baseUnary;
}
var _nodeUtil = { exports: {} };
_nodeUtil.exports;
var hasRequired_nodeUtil;
function require_nodeUtil() {
if (hasRequired_nodeUtil)
return _nodeUtil.exports;
hasRequired_nodeUtil = 1;
(function(module, exports) {
var freeGlobal2 = require_freeGlobal();
var freeExports = exports && !exports.nodeType && exports;
var freeModule = freeExports && true && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var freeProcess = moduleExports && freeGlobal2.process;
var nodeUtil = function() {
try {
var types2 = freeModule && freeModule.require && freeModule.require("util").types;
if (types2) {
return types2;
}
return freeProcess && freeProcess.binding && freeProcess.binding("util");
} catch (e7) {
}
}();
module.exports = nodeUtil;
})(_nodeUtil, _nodeUtil.exports);
return _nodeUtil.exports;
}
var isTypedArray_1;
var hasRequiredIsTypedArray;
function requireIsTypedArray() {
if (hasRequiredIsTypedArray)
return isTypedArray_1;
hasRequiredIsTypedArray = 1;
var baseIsTypedArray = require_baseIsTypedArray(), baseUnary2 = require_baseUnary(), nodeUtil = require_nodeUtil();
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
var isTypedArray = nodeIsTypedArray ? baseUnary2(nodeIsTypedArray) : baseIsTypedArray;
isTypedArray_1 = isTypedArray;
return isTypedArray_1;
}
var _arrayLikeKeys;
var hasRequired_arrayLikeKeys;
function require_arrayLikeKeys() {
if (hasRequired_arrayLikeKeys)
return _arrayLikeKeys;
hasRequired_arrayLikeKeys = 1;
var baseTimes2 = require_baseTimes(), isArguments2 = requireIsArguments(), isArray3 = requireIsArray(), isBuffer2 = requireIsBuffer(), isIndex2 = require_isIndex(), isTypedArray = requireIsTypedArray();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function arrayLikeKeys2(value2, inherited) {
var isArr = isArray3(value2), isArg = !isArr && isArguments2(value2), isBuff = !isArr && !isArg && isBuffer2(value2), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value2), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes2(value2.length, String) : [], length2 = result.length;
for (var key2 in value2) {
if ((inherited || hasOwnProperty2.call(value2, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
(key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
isType2 && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
isIndex2(key2, length2)))) {
result.push(key2);
}
}
return result;
}
_arrayLikeKeys = arrayLikeKeys2;
return _arrayLikeKeys;
}
var _isPrototype;
var hasRequired_isPrototype;
function require_isPrototype() {
if (hasRequired_isPrototype)
return _isPrototype;
hasRequired_isPrototype = 1;
var objectProto2 = Object.prototype;
function isPrototype2(value2) {
var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
return value2 === proto;
}
_isPrototype = isPrototype2;
return _isPrototype;
}
var _overArg;
var hasRequired_overArg;
function require_overArg() {
if (hasRequired_overArg)
return _overArg;
hasRequired_overArg = 1;
function overArg2(func, transform2) {
return function(arg) {
return func(transform2(arg));
};
}
_overArg = overArg2;
return _overArg;
}
var _nativeKeys;
var hasRequired_nativeKeys;
function require_nativeKeys() {
if (hasRequired_nativeKeys)
return _nativeKeys;
hasRequired_nativeKeys = 1;
var overArg2 = require_overArg();
var nativeKeys = overArg2(Object.keys, Object);
_nativeKeys = nativeKeys;
return _nativeKeys;
}
var _baseKeys;
var hasRequired_baseKeys;
function require_baseKeys() {
if (hasRequired_baseKeys)
return _baseKeys;
hasRequired_baseKeys = 1;
var isPrototype2 = require_isPrototype(), nativeKeys = require_nativeKeys();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function baseKeys(object2) {
if (!isPrototype2(object2)) {
return nativeKeys(object2);
}
var result = [];
for (var key2 in Object(object2)) {
if (hasOwnProperty2.call(object2, key2) && key2 != "constructor") {
result.push(key2);
}
}
return result;
}
_baseKeys = baseKeys;
return _baseKeys;
}
var isArrayLike_1;
var hasRequiredIsArrayLike;
function requireIsArrayLike() {
if (hasRequiredIsArrayLike)
return isArrayLike_1;
hasRequiredIsArrayLike = 1;
var isFunction2 = requireIsFunction(), isLength2 = requireIsLength();
function isArrayLike2(value2) {
return value2 != null && isLength2(value2.length) && !isFunction2(value2);
}
isArrayLike_1 = isArrayLike2;
return isArrayLike_1;
}
var keys_1;
var hasRequiredKeys;
function requireKeys() {
if (hasRequiredKeys)
return keys_1;
hasRequiredKeys = 1;
var arrayLikeKeys2 = require_arrayLikeKeys(), baseKeys = require_baseKeys(), isArrayLike2 = requireIsArrayLike();
function keys3(object2) {
return isArrayLike2(object2) ? arrayLikeKeys2(object2) : baseKeys(object2);
}
keys_1 = keys3;
return keys_1;
}
var _getAllKeys;
var hasRequired_getAllKeys;
function require_getAllKeys() {
if (hasRequired_getAllKeys)
return _getAllKeys;
hasRequired_getAllKeys = 1;
var baseGetAllKeys2 = require_baseGetAllKeys(), getSymbols2 = require_getSymbols(), keys3 = requireKeys();
function getAllKeys(object2) {
return baseGetAllKeys2(object2, keys3, getSymbols2);
}
_getAllKeys = getAllKeys;
return _getAllKeys;
}
var _equalObjects;
var hasRequired_equalObjects;
function require_equalObjects() {
if (hasRequired_equalObjects)
return _equalObjects;
hasRequired_equalObjects = 1;
var getAllKeys = require_getAllKeys();
var COMPARE_PARTIAL_FLAG = 1;
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index2 = objLength;
while (index2--) {
var key2 = objProps[index2];
if (!(isPartial ? key2 in other : hasOwnProperty2.call(other, key2))) {
return false;
}
}
var objStacked = stack.get(object2);
var othStacked = stack.get(other);
if (objStacked && othStacked) {
return objStacked == other && othStacked == object2;
}
var result = true;
stack.set(object2, other);
stack.set(other, object2);
var skipCtor = isPartial;
while (++index2 < objLength) {
key2 = objProps[index2];
var objValue = object2[key2], othValue = other[key2];
if (customizer) {
var compared = isPartial ? customizer(othValue, objValue, key2, other, object2, stack) : customizer(objValue, othValue, key2, object2, other, stack);
}
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
result = false;
break;
}
skipCtor || (skipCtor = key2 == "constructor");
}
if (result && !skipCtor) {
var objCtor = object2.constructor, othCtor = other.constructor;
if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
result = false;
}
}
stack["delete"](object2);
stack["delete"](other);
return result;
}
_equalObjects = equalObjects;
return _equalObjects;
}
var _DataView;
var hasRequired_DataView;
function require_DataView() {
if (hasRequired_DataView)
return _DataView;
hasRequired_DataView = 1;
var getNative2 = require_getNative(), root2 = require_root();
var DataView2 = getNative2(root2, "DataView");
_DataView = DataView2;
return _DataView;
}
var _Promise;
var hasRequired_Promise;
function require_Promise() {
if (hasRequired_Promise)
return _Promise;
hasRequired_Promise = 1;
var getNative2 = require_getNative(), root2 = require_root();
var Promise2 = getNative2(root2, "Promise");
_Promise = Promise2;
return _Promise;
}
var _Set;
var hasRequired_Set;
function require_Set() {
if (hasRequired_Set)
return _Set;
hasRequired_Set = 1;
var getNative2 = require_getNative(), root2 = require_root();
var Set2 = getNative2(root2, "Set");
_Set = Set2;
return _Set;
}
var _WeakMap;
var hasRequired_WeakMap;
function require_WeakMap() {
if (hasRequired_WeakMap)
return _WeakMap;
hasRequired_WeakMap = 1;
var getNative2 = require_getNative(), root2 = require_root();
var WeakMap2 = getNative2(root2, "WeakMap");
_WeakMap = WeakMap2;
return _WeakMap;
}
var _getTag;
var hasRequired_getTag;
function require_getTag() {
if (hasRequired_getTag)
return _getTag;
hasRequired_getTag = 1;
var DataView2 = require_DataView(), Map2 = require_Map(), Promise2 = require_Promise(), Set2 = require_Set(), WeakMap2 = require_WeakMap(), baseGetTag2 = require_baseGetTag(), toSource2 = require_toSource();
var mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
var dataViewTag = "[object DataView]";
var dataViewCtorString = toSource2(DataView2), mapCtorString = toSource2(Map2), promiseCtorString = toSource2(Promise2), setCtorString = toSource2(Set2), weakMapCtorString = toSource2(WeakMap2);
var getTag = baseGetTag2;
if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
getTag = function(value2) {
var result = baseGetTag2(value2), Ctor = result == objectTag ? value2.constructor : void 0, ctorString = Ctor ? toSource2(Ctor) : "";
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
_getTag = getTag;
return _getTag;
}
var _baseIsEqualDeep;
var hasRequired_baseIsEqualDeep;
function require_baseIsEqualDeep() {
if (hasRequired_baseIsEqualDeep)
return _baseIsEqualDeep;
hasRequired_baseIsEqualDeep = 1;
var Stack2 = require_Stack(), equalArrays = require_equalArrays(), equalByTag = require_equalByTag(), equalObjects = require_equalObjects(), getTag = require_getTag(), isArray3 = requireIsArray(), isBuffer2 = requireIsBuffer(), isTypedArray = requireIsTypedArray();
var COMPARE_PARTIAL_FLAG = 1;
var argsTag2 = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray3(object2), othIsArr = isArray3(other), objTag = objIsArr ? arrayTag : getTag(object2), othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag2 ? objectTag : objTag;
othTag = othTag == argsTag2 ? objectTag : othTag;
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
if (isSameTag && isBuffer2(object2)) {
if (!isBuffer2(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack2());
return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty2.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__");
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack2());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack2());
return equalObjects(object2, other, bitmask, customizer, equalFunc, stack);
}
_baseIsEqualDeep = baseIsEqualDeep;
return _baseIsEqualDeep;
}
var _baseIsEqual;
var hasRequired_baseIsEqual;
function require_baseIsEqual() {
if (hasRequired_baseIsEqual)
return _baseIsEqual;
hasRequired_baseIsEqual = 1;
var baseIsEqualDeep = require_baseIsEqualDeep(), isObjectLike2 = requireIsObjectLike();
function baseIsEqual(value2, other, bitmask, customizer, stack) {
if (value2 === other) {
return true;
}
if (value2 == null || other == null || !isObjectLike2(value2) && !isObjectLike2(other)) {
return value2 !== value2 && other !== other;
}
return baseIsEqualDeep(value2, other, bitmask, customizer, baseIsEqual, stack);
}
_baseIsEqual = baseIsEqual;
return _baseIsEqual;
}
var _baseIsMatch;
var hasRequired_baseIsMatch;
function require_baseIsMatch() {
if (hasRequired_baseIsMatch)
return _baseIsMatch;
hasRequired_baseIsMatch = 1;
var Stack2 = require_Stack(), baseIsEqual = require_baseIsEqual();
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
function baseIsMatch(object2, source2, matchData, customizer) {
var index2 = matchData.length, length2 = index2, noCustomizer = !customizer;
if (object2 == null) {
return !length2;
}
object2 = Object(object2);
while (index2--) {
var data2 = matchData[index2];
if (noCustomizer && data2[2] ? data2[1] !== object2[data2[0]] : !(data2[0] in object2)) {
return false;
}
}
while (++index2 < length2) {
data2 = matchData[index2];
var key2 = data2[0], objValue = object2[key2], srcValue = data2[1];
if (noCustomizer && data2[2]) {
if (objValue === void 0 && !(key2 in object2)) {
return false;
}
} else {
var stack = new Stack2();
if (customizer) {
var result = customizer(objValue, srcValue, key2, object2, source2, stack);
}
if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
return false;
}
}
}
return true;
}
_baseIsMatch = baseIsMatch;
return _baseIsMatch;
}
var _isStrictComparable;
var hasRequired_isStrictComparable;
function require_isStrictComparable() {
if (hasRequired_isStrictComparable)
return _isStrictComparable;
hasRequired_isStrictComparable = 1;
var isObject2 = requireIsObject();
function isStrictComparable(value2) {
return value2 === value2 && !isObject2(value2);
}
_isStrictComparable = isStrictComparable;
return _isStrictComparable;
}
var _getMatchData;
var hasRequired_getMatchData;
function require_getMatchData() {
if (hasRequired_getMatchData)
return _getMatchData;
hasRequired_getMatchData = 1;
var isStrictComparable = require_isStrictComparable(), keys3 = requireKeys();
function getMatchData(object2) {
var result = keys3(object2), length2 = result.length;
while (length2--) {
var key2 = result[length2], value2 = object2[key2];
result[length2] = [key2, value2, isStrictComparable(value2)];
}
return result;
}
_getMatchData = getMatchData;
return _getMatchData;
}
var _matchesStrictComparable;
var hasRequired_matchesStrictComparable;
function require_matchesStrictComparable() {
if (hasRequired_matchesStrictComparable)
return _matchesStrictComparable;
hasRequired_matchesStrictComparable = 1;
function matchesStrictComparable(key2, srcValue) {
return function(object2) {
if (object2 == null) {
return false;
}
return object2[key2] === srcValue && (srcValue !== void 0 || key2 in Object(object2));
};
}
_matchesStrictComparable = matchesStrictComparable;
return _matchesStrictComparable;
}
var _baseMatches;
var hasRequired_baseMatches;
function require_baseMatches() {
if (hasRequired_baseMatches)
return _baseMatches;
hasRequired_baseMatches = 1;
var baseIsMatch = require_baseIsMatch(), getMatchData = require_getMatchData(), matchesStrictComparable = require_matchesStrictComparable();
function baseMatches(source2) {
var matchData = getMatchData(source2);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object2) {
return object2 === source2 || baseIsMatch(object2, source2, matchData);
};
}
_baseMatches = baseMatches;
return _baseMatches;
}
var isSymbol_1$1;
var hasRequiredIsSymbol;
function requireIsSymbol() {
if (hasRequiredIsSymbol)
return isSymbol_1$1;
hasRequiredIsSymbol = 1;
var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
var symbolTag2 = "[object Symbol]";
function isSymbol2(value2) {
return typeof value2 == "symbol" || isObjectLike2(value2) && baseGetTag2(value2) == symbolTag2;
}
isSymbol_1$1 = isSymbol2;
return isSymbol_1$1;
}
var _isKey;
var hasRequired_isKey;
function require_isKey() {
if (hasRequired_isKey)
return _isKey;
hasRequired_isKey = 1;
var isArray3 = requireIsArray(), isSymbol2 = requireIsSymbol();
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
function isKey(value2, object2) {
if (isArray3(value2)) {
return false;
}
var type2 = typeof value2;
if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value2 == null || isSymbol2(value2)) {
return true;
}
return reIsPlainProp.test(value2) || !reIsDeepProp.test(value2) || object2 != null && value2 in Object(object2);
}
_isKey = isKey;
return _isKey;
}
var memoize_1;
var hasRequiredMemoize;
function requireMemoize() {
if (hasRequiredMemoize)
return memoize_1;
hasRequiredMemoize = 1;
var MapCache2 = require_MapCache();
var FUNC_ERROR_TEXT2 = "Expected a function";
function memoize2(func, resolver) {
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
throw new TypeError(FUNC_ERROR_TEXT2);
}
var memoized = function() {
var args = arguments, key2 = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
if (cache2.has(key2)) {
return cache2.get(key2);
}
var result = func.apply(this, args);
memoized.cache = cache2.set(key2, result) || cache2;
return result;
};
memoized.cache = new (memoize2.Cache || MapCache2)();
return memoized;
}
memoize2.Cache = MapCache2;
memoize_1 = memoize2;
return memoize_1;
}
var _memoizeCapped;
var hasRequired_memoizeCapped;
function require_memoizeCapped() {
if (hasRequired_memoizeCapped)
return _memoizeCapped;
hasRequired_memoizeCapped = 1;
var memoize2 = requireMemoize();
var MAX_MEMOIZE_SIZE = 500;
function memoizeCapped(func) {
var result = memoize2(func, function(key2) {
if (cache2.size === MAX_MEMOIZE_SIZE) {
cache2.clear();
}
return key2;
});
var cache2 = result.cache;
return result;
}
_memoizeCapped = memoizeCapped;
return _memoizeCapped;
}
var _stringToPath;
var hasRequired_stringToPath;
function require_stringToPath() {
if (hasRequired_stringToPath)
return _stringToPath;
hasRequired_stringToPath = 1;
var memoizeCapped = require_memoizeCapped();
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var reEscapeChar = /\\(\\)?/g;
var stringToPath = memoizeCapped(function(string2) {
var result = [];
if (string2.charCodeAt(0) === 46) {
result.push("");
}
string2.replace(rePropName, function(match2, number2, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2);
});
return result;
});
_stringToPath = stringToPath;
return _stringToPath;
}
var _baseToString;
var hasRequired_baseToString;
function require_baseToString() {
if (hasRequired_baseToString)
return _baseToString;
hasRequired_baseToString = 1;
var Symbol2 = require_Symbol(), arrayMap2 = require_arrayMap(), isArray3 = requireIsArray(), isSymbol2 = requireIsSymbol();
var INFINITY2 = 1 / 0;
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
function baseToString(value2) {
if (typeof value2 == "string") {
return value2;
}
if (isArray3(value2)) {
return arrayMap2(value2, baseToString) + "";
}
if (isSymbol2(value2)) {
return symbolToString ? symbolToString.call(value2) : "";
}
var result = value2 + "";
return result == "0" && 1 / value2 == -INFINITY2 ? "-0" : result;
}
_baseToString = baseToString;
return _baseToString;
}
var toString_1;
var hasRequiredToString;
function requireToString() {
if (hasRequiredToString)
return toString_1;
hasRequiredToString = 1;
var baseToString = require_baseToString();
function toString4(value2) {
return value2 == null ? "" : baseToString(value2);
}
toString_1 = toString4;
return toString_1;
}
var _castPath;
var hasRequired_castPath;
function require_castPath() {
if (hasRequired_castPath)
return _castPath;
hasRequired_castPath = 1;
var isArray3 = requireIsArray(), isKey = require_isKey(), stringToPath = require_stringToPath(), toString4 = requireToString();
function castPath(value2, object2) {
if (isArray3(value2)) {
return value2;
}
return isKey(value2, object2) ? [value2] : stringToPath(toString4(value2));
}
_castPath = castPath;
return _castPath;
}
var _toKey;
var hasRequired_toKey;
function require_toKey() {
if (hasRequired_toKey)
return _toKey;
hasRequired_toKey = 1;
var isSymbol2 = requireIsSymbol();
var INFINITY2 = 1 / 0;
function toKey2(value2) {
if (typeof value2 == "string" || isSymbol2(value2)) {
return value2;
}
var result = value2 + "";
return result == "0" && 1 / value2 == -INFINITY2 ? "-0" : result;
}
_toKey = toKey2;
return _toKey;
}
var _baseGet;
var hasRequired_baseGet;
function require_baseGet() {
if (hasRequired_baseGet)
return _baseGet;
hasRequired_baseGet = 1;
var castPath = require_castPath(), toKey2 = require_toKey();
function baseGet(object2, path2) {
path2 = castPath(path2, object2);
var index2 = 0, length2 = path2.length;
while (object2 != null && index2 < length2) {
object2 = object2[toKey2(path2[index2++])];
}
return index2 && index2 == length2 ? object2 : void 0;
}
_baseGet = baseGet;
return _baseGet;
}
var get_1;
var hasRequiredGet$1;
function requireGet$1() {
if (hasRequiredGet$1)
return get_1;
hasRequiredGet$1 = 1;
var baseGet = require_baseGet();
function get2(object2, path2, defaultValue2) {
var result = object2 == null ? void 0 : baseGet(object2, path2);
return result === void 0 ? defaultValue2 : result;
}
get_1 = get2;
return get_1;
}
var _baseHasIn;
var hasRequired_baseHasIn;
function require_baseHasIn() {
if (hasRequired_baseHasIn)
return _baseHasIn;
hasRequired_baseHasIn = 1;
function baseHasIn(object2, key2) {
return object2 != null && key2 in Object(object2);
}
_baseHasIn = baseHasIn;
return _baseHasIn;
}
var _hasPath;
var hasRequired_hasPath;
function require_hasPath() {
if (hasRequired_hasPath)
return _hasPath;
hasRequired_hasPath = 1;
var castPath = require_castPath(), isArguments2 = requireIsArguments(), isArray3 = requireIsArray(), isIndex2 = require_isIndex(), isLength2 = requireIsLength(), toKey2 = require_toKey();
function hasPath(object2, path2, hasFunc) {
path2 = castPath(path2, object2);
var index2 = -1, length2 = path2.length, result = false;
while (++index2 < length2) {
var key2 = toKey2(path2[index2]);
if (!(result = object2 != null && hasFunc(object2, key2))) {
break;
}
object2 = object2[key2];
}
if (result || ++index2 != length2) {
return result;
}
length2 = object2 == null ? 0 : object2.length;
return !!length2 && isLength2(length2) && isIndex2(key2, length2) && (isArray3(object2) || isArguments2(object2));
}
_hasPath = hasPath;
return _hasPath;
}
var hasIn_1;
var hasRequiredHasIn;
function requireHasIn() {
if (hasRequiredHasIn)
return hasIn_1;
hasRequiredHasIn = 1;
var baseHasIn = require_baseHasIn(), hasPath = require_hasPath();
function hasIn(object2, path2) {
return object2 != null && hasPath(object2, path2, baseHasIn);
}
hasIn_1 = hasIn;
return hasIn_1;
}
var _baseMatchesProperty;
var hasRequired_baseMatchesProperty;
function require_baseMatchesProperty() {
if (hasRequired_baseMatchesProperty)
return _baseMatchesProperty;
hasRequired_baseMatchesProperty = 1;
var baseIsEqual = require_baseIsEqual(), get2 = requireGet$1(), hasIn = requireHasIn(), isKey = require_isKey(), isStrictComparable = require_isStrictComparable(), matchesStrictComparable = require_matchesStrictComparable(), toKey2 = require_toKey();
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
function baseMatchesProperty(path2, srcValue) {
if (isKey(path2) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey2(path2), srcValue);
}
return function(object2) {
var objValue = get2(object2, path2);
return objValue === void 0 && objValue === srcValue ? hasIn(object2, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
_baseMatchesProperty = baseMatchesProperty;
return _baseMatchesProperty;
}
var identity_1;
var hasRequiredIdentity;
function requireIdentity() {
if (hasRequiredIdentity)
return identity_1;
hasRequiredIdentity = 1;
function identity2(value2) {
return value2;
}
identity_1 = identity2;
return identity_1;
}
var _baseProperty;
var hasRequired_baseProperty;
function require_baseProperty() {
if (hasRequired_baseProperty)
return _baseProperty;
hasRequired_baseProperty = 1;
function baseProperty(key2) {
return function(object2) {
return object2 == null ? void 0 : object2[key2];
};
}
_baseProperty = baseProperty;
return _baseProperty;
}
var _basePropertyDeep;
var hasRequired_basePropertyDeep;
function require_basePropertyDeep() {
if (hasRequired_basePropertyDeep)
return _basePropertyDeep;
hasRequired_basePropertyDeep = 1;
var baseGet = require_baseGet();
function basePropertyDeep(path2) {
return function(object2) {
return baseGet(object2, path2);
};
}
_basePropertyDeep = basePropertyDeep;
return _basePropertyDeep;
}
var property_1;
var hasRequiredProperty;
function requireProperty() {
if (hasRequiredProperty)
return property_1;
hasRequiredProperty = 1;
var baseProperty = require_baseProperty(), basePropertyDeep = require_basePropertyDeep(), isKey = require_isKey(), toKey2 = require_toKey();
function property2(path2) {
return isKey(path2) ? baseProperty(toKey2(path2)) : basePropertyDeep(path2);
}
property_1 = property2;
return property_1;
}
var _baseIteratee;
var hasRequired_baseIteratee;
function require_baseIteratee() {
if (hasRequired_baseIteratee)
return _baseIteratee;
hasRequired_baseIteratee = 1;
var baseMatches = require_baseMatches(), baseMatchesProperty = require_baseMatchesProperty(), identity2 = requireIdentity(), isArray3 = requireIsArray(), property2 = requireProperty();
function baseIteratee(value2) {
if (typeof value2 == "function") {
return value2;
}
if (value2 == null) {
return identity2;
}
if (typeof value2 == "object") {
return isArray3(value2) ? baseMatchesProperty(value2[0], value2[1]) : baseMatches(value2);
}
return property2(value2);
}
_baseIteratee = baseIteratee;
return _baseIteratee;
}
var _defineProperty$2;
var hasRequired_defineProperty;
function require_defineProperty() {
if (hasRequired_defineProperty)
return _defineProperty$2;
hasRequired_defineProperty = 1;
var getNative2 = require_getNative();
var defineProperty4 = function() {
try {
var func = getNative2(Object, "defineProperty");
func({}, "", {});
return func;
} catch (e7) {
}
}();
_defineProperty$2 = defineProperty4;
return _defineProperty$2;
}
var _baseAssignValue;
var hasRequired_baseAssignValue;
function require_baseAssignValue() {
if (hasRequired_baseAssignValue)
return _baseAssignValue;
hasRequired_baseAssignValue = 1;
var defineProperty4 = require_defineProperty();
function baseAssignValue(object2, key2, value2) {
if (key2 == "__proto__" && defineProperty4) {
defineProperty4(object2, key2, {
"configurable": true,
"enumerable": true,
"value": value2,
"writable": true
});
} else {
object2[key2] = value2;
}
}
_baseAssignValue = baseAssignValue;
return _baseAssignValue;
}
var _assignValue;
var hasRequired_assignValue;
function require_assignValue() {
if (hasRequired_assignValue)
return _assignValue;
hasRequired_assignValue = 1;
var baseAssignValue = require_baseAssignValue(), eq2 = requireEq();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function assignValue(object2, key2, value2) {
var objValue = object2[key2];
if (!(hasOwnProperty2.call(object2, key2) && eq2(objValue, value2)) || value2 === void 0 && !(key2 in object2)) {
baseAssignValue(object2, key2, value2);
}
}
_assignValue = assignValue;
return _assignValue;
}
var _baseSet;
var hasRequired_baseSet;
function require_baseSet() {
if (hasRequired_baseSet)
return _baseSet;
hasRequired_baseSet = 1;
var assignValue = require_assignValue(), castPath = require_castPath(), isIndex2 = require_isIndex(), isObject2 = requireIsObject(), toKey2 = require_toKey();
function baseSet(object2, path2, value2, customizer) {
if (!isObject2(object2)) {
return object2;
}
path2 = castPath(path2, object2);
var index2 = -1, length2 = path2.length, lastIndex = length2 - 1, nested = object2;
while (nested != null && ++index2 < length2) {
var key2 = toKey2(path2[index2]), newValue = value2;
if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") {
return object2;
}
if (index2 != lastIndex) {
var objValue = nested[key2];
newValue = customizer ? customizer(objValue, key2, nested) : void 0;
if (newValue === void 0) {
newValue = isObject2(objValue) ? objValue : isIndex2(path2[index2 + 1]) ? [] : {};
}
}
assignValue(nested, key2, newValue);
nested = nested[key2];
}
return object2;
}
_baseSet = baseSet;
return _baseSet;
}
var _basePickBy;
var hasRequired_basePickBy;
function require_basePickBy() {
if (hasRequired_basePickBy)
return _basePickBy;
hasRequired_basePickBy = 1;
var baseGet = require_baseGet(), baseSet = require_baseSet(), castPath = require_castPath();
function basePickBy2(object2, paths, predicate) {
var index2 = -1, length2 = paths.length, result = {};
while (++index2 < length2) {
var path2 = paths[index2], value2 = baseGet(object2, path2);
if (predicate(value2, path2)) {
baseSet(result, castPath(path2, object2), value2);
}
}
return result;
}
_basePickBy = basePickBy2;
return _basePickBy;
}
var _getPrototype;
var hasRequired_getPrototype;
function require_getPrototype() {
if (hasRequired_getPrototype)
return _getPrototype;
hasRequired_getPrototype = 1;
var overArg2 = require_overArg();
var getPrototype2 = overArg2(Object.getPrototypeOf, Object);
_getPrototype = getPrototype2;
return _getPrototype;
}
var _getSymbolsIn;
var hasRequired_getSymbolsIn;
function require_getSymbolsIn() {
if (hasRequired_getSymbolsIn)
return _getSymbolsIn;
hasRequired_getSymbolsIn = 1;
var arrayPush2 = require_arrayPush(), getPrototype2 = require_getPrototype(), getSymbols2 = require_getSymbols(), stubArray2 = requireStubArray();
var nativeGetSymbols2 = Object.getOwnPropertySymbols;
var getSymbolsIn2 = !nativeGetSymbols2 ? stubArray2 : function(object2) {
var result = [];
while (object2) {
arrayPush2(result, getSymbols2(object2));
object2 = getPrototype2(object2);
}
return result;
};
_getSymbolsIn = getSymbolsIn2;
return _getSymbolsIn;
}
var _nativeKeysIn;
var hasRequired_nativeKeysIn;
function require_nativeKeysIn() {
if (hasRequired_nativeKeysIn)
return _nativeKeysIn;
hasRequired_nativeKeysIn = 1;
function nativeKeysIn2(object2) {
var result = [];
if (object2 != null) {
for (var key2 in Object(object2)) {
result.push(key2);
}
}
return result;
}
_nativeKeysIn = nativeKeysIn2;
return _nativeKeysIn;
}
var _baseKeysIn;
var hasRequired_baseKeysIn;
function require_baseKeysIn() {
if (hasRequired_baseKeysIn)
return _baseKeysIn;
hasRequired_baseKeysIn = 1;
var isObject2 = requireIsObject(), isPrototype2 = require_isPrototype(), nativeKeysIn2 = require_nativeKeysIn();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function baseKeysIn2(object2) {
if (!isObject2(object2)) {
return nativeKeysIn2(object2);
}
var isProto = isPrototype2(object2), result = [];
for (var key2 in object2) {
if (!(key2 == "constructor" && (isProto || !hasOwnProperty2.call(object2, key2)))) {
result.push(key2);
}
}
return result;
}
_baseKeysIn = baseKeysIn2;
return _baseKeysIn;
}
var keysIn_1;
var hasRequiredKeysIn;
function requireKeysIn() {
if (hasRequiredKeysIn)
return keysIn_1;
hasRequiredKeysIn = 1;
var arrayLikeKeys2 = require_arrayLikeKeys(), baseKeysIn2 = require_baseKeysIn(), isArrayLike2 = requireIsArrayLike();
function keysIn2(object2) {
return isArrayLike2(object2) ? arrayLikeKeys2(object2, true) : baseKeysIn2(object2);
}
keysIn_1 = keysIn2;
return keysIn_1;
}
var _getAllKeysIn;
var hasRequired_getAllKeysIn;
function require_getAllKeysIn() {
if (hasRequired_getAllKeysIn)
return _getAllKeysIn;
hasRequired_getAllKeysIn = 1;
var baseGetAllKeys2 = require_baseGetAllKeys(), getSymbolsIn2 = require_getSymbolsIn(), keysIn2 = requireKeysIn();
function getAllKeysIn2(object2) {
return baseGetAllKeys2(object2, keysIn2, getSymbolsIn2);
}
_getAllKeysIn = getAllKeysIn2;
return _getAllKeysIn;
}
var pickBy_1;
var hasRequiredPickBy;
function requirePickBy() {
if (hasRequiredPickBy)
return pickBy_1;
hasRequiredPickBy = 1;
var arrayMap2 = require_arrayMap(), baseIteratee = require_baseIteratee(), basePickBy2 = require_basePickBy(), getAllKeysIn2 = require_getAllKeysIn();
function pickBy(object2, predicate) {
if (object2 == null) {
return {};
}
var props = arrayMap2(getAllKeysIn2(object2), function(prop) {
return [prop];
});
predicate = baseIteratee(predicate);
return basePickBy2(object2, props, function(value2, path2) {
return predicate(value2, path2[0]);
});
}
pickBy_1 = pickBy;
return pickBy_1;
}
var isEmpty_1;
var hasRequiredIsEmpty;
function requireIsEmpty() {
if (hasRequiredIsEmpty)
return isEmpty_1;
hasRequiredIsEmpty = 1;
var baseKeys = require_baseKeys(), getTag = require_getTag(), isArguments2 = requireIsArguments(), isArray3 = requireIsArray(), isArrayLike2 = requireIsArrayLike(), isBuffer2 = requireIsBuffer(), isPrototype2 = require_isPrototype(), isTypedArray = requireIsTypedArray();
var mapTag = "[object Map]", setTag = "[object Set]";
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function isEmpty(value2) {
if (value2 == null) {
return true;
}
if (isArrayLike2(value2) && (isArray3(value2) || typeof value2 == "string" || typeof value2.splice == "function" || isBuffer2(value2) || isTypedArray(value2) || isArguments2(value2))) {
return !value2.length;
}
var tag = getTag(value2);
if (tag == mapTag || tag == setTag) {
return !value2.size;
}
if (isPrototype2(value2)) {
return !baseKeys(value2).length;
}
for (var key2 in value2) {
if (hasOwnProperty2.call(value2, key2)) {
return false;
}
}
return true;
}
isEmpty_1 = isEmpty;
return isEmpty_1;
}
var clipboard = { exports: {} };
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
var hasRequiredClipboard;
function requireClipboard() {
if (hasRequiredClipboard)
return clipboard.exports;
hasRequiredClipboard = 1;
(function(module, exports) {
(function webpackUniversalModuleDefinition(root2, factory) {
module.exports = factory();
})(commonjsGlobal$1, function() {
return (
/******/
function() {
var __webpack_modules__ = {
/***/
686: (
/***/
function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
__webpack_require__2.d(__webpack_exports__, {
"default": function() {
return (
/* binding */
clipboard2
);
}
});
var tiny_emitter = __webpack_require__2(279);
var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
var listen = __webpack_require__2(370);
var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
var src_select = __webpack_require__2(817);
var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
function command(type2) {
try {
return document.execCommand(type2);
} catch (err) {
return false;
}
}
var ClipboardActionCut = function ClipboardActionCut2(target2) {
var selectedText = select_default()(target2);
command("cut");
return selectedText;
};
var actions_cut = ClipboardActionCut;
function createFakeElement(value2) {
var isRTL = document.documentElement.getAttribute("dir") === "rtl";
var fakeElement = document.createElement("textarea");
fakeElement.style.fontSize = "12pt";
fakeElement.style.border = "0";
fakeElement.style.padding = "0";
fakeElement.style.margin = "0";
fakeElement.style.position = "absolute";
fakeElement.style[isRTL ? "right" : "left"] = "-9999px";
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
fakeElement.style.top = "".concat(yPosition, "px");
fakeElement.setAttribute("readonly", "");
fakeElement.value = value2;
return fakeElement;
}
var fakeCopyAction = function fakeCopyAction2(value2, options2) {
var fakeElement = createFakeElement(value2);
options2.container.appendChild(fakeElement);
var selectedText = select_default()(fakeElement);
command("copy");
fakeElement.remove();
return selectedText;
};
var ClipboardActionCopy = function ClipboardActionCopy2(target2) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
container: document.body
};
var selectedText = "";
if (typeof target2 === "string") {
selectedText = fakeCopyAction(target2, options2);
} else if (target2 instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(target2 === null || target2 === void 0 ? void 0 : target2.type)) {
selectedText = fakeCopyAction(target2.value, options2);
} else {
selectedText = select_default()(target2);
command("copy");
}
return selectedText;
};
var actions_copy = ClipboardActionCopy;
function _typeof2(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof2 = function _typeof3(obj2) {
return typeof obj2;
};
} else {
_typeof2 = function _typeof3(obj2) {
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
};
}
return _typeof2(obj);
}
var ClipboardActionDefault = function ClipboardActionDefault2() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var _options$action = options2.action, action = _options$action === void 0 ? "copy" : _options$action, container = options2.container, target2 = options2.target, text2 = options2.text;
if (action !== "copy" && action !== "cut") {
throw new Error('Invalid "action" value, use either "copy" or "cut"');
}
if (target2 !== void 0) {
if (target2 && _typeof2(target2) === "object" && target2.nodeType === 1) {
if (action === "copy" && target2.hasAttribute("disabled")) {
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
}
if (action === "cut" && (target2.hasAttribute("readonly") || target2.hasAttribute("disabled"))) {
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
}
} else {
throw new Error('Invalid "target" value, use a valid Element');
}
}
if (text2) {
return actions_copy(text2, {
container
});
}
if (target2) {
return action === "cut" ? actions_cut(target2) : actions_copy(target2, {
container
});
}
};
var actions_default = ClipboardActionDefault;
function clipboard_typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
clipboard_typeof = function _typeof3(obj2) {
return typeof obj2;
};
} else {
clipboard_typeof = function _typeof3(obj2) {
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
};
}
return clipboard_typeof(obj);
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (clipboard_typeof(call2) === "object" || typeof call2 === "function")) {
return call2;
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function getAttributeValue(suffix2, element2) {
var attribute = "data-clipboard-".concat(suffix2);
if (!element2.hasAttribute(attribute)) {
return;
}
return element2.getAttribute(attribute);
}
var Clipboard = /* @__PURE__ */ function(_Emitter) {
_inherits2(Clipboard2, _Emitter);
var _super = _createSuper2(Clipboard2);
function Clipboard2(trigger, options2) {
var _this;
_classCallCheck2(this, Clipboard2);
_this = _super.call(this);
_this.resolveOptions(options2);
_this.listenClick(trigger);
return _this;
}
_createClass2(Clipboard2, [{
key: "resolveOptions",
value: function resolveOptions() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
this.action = typeof options2.action === "function" ? options2.action : this.defaultAction;
this.target = typeof options2.target === "function" ? options2.target : this.defaultTarget;
this.text = typeof options2.text === "function" ? options2.text : this.defaultText;
this.container = clipboard_typeof(options2.container) === "object" ? options2.container : document.body;
}
/**
* Adds a click event listener to the passed trigger.
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
*/
}, {
key: "listenClick",
value: function listenClick(trigger) {
var _this2 = this;
this.listener = listen_default()(trigger, "click", function(e7) {
return _this2.onClick(e7);
});
}
/**
* Defines a new `ClipboardAction` on each click event.
* @param {Event} e
*/
}, {
key: "onClick",
value: function onClick(e7) {
var trigger = e7.delegateTarget || e7.currentTarget;
var action = this.action(trigger) || "copy";
var text2 = actions_default({
action,
container: this.container,
target: this.target(trigger),
text: this.text(trigger)
});
this.emit(text2 ? "success" : "error", {
action,
text: text2,
trigger,
clearSelection: function clearSelection() {
if (trigger) {
trigger.focus();
}
window.getSelection().removeAllRanges();
}
});
}
/**
* Default `action` lookup function.
* @param {Element} trigger
*/
}, {
key: "defaultAction",
value: function defaultAction(trigger) {
return getAttributeValue("action", trigger);
}
/**
* Default `target` lookup function.
* @param {Element} trigger
*/
}, {
key: "defaultTarget",
value: function defaultTarget(trigger) {
var selector = getAttributeValue("target", trigger);
if (selector) {
return document.querySelector(selector);
}
}
/**
* Allow fire programmatically a copy action
* @param {String|HTMLElement} target
* @param {Object} options
* @returns Text copied.
*/
}, {
key: "defaultText",
/**
* Default `text` lookup function.
* @param {Element} trigger
*/
value: function defaultText(trigger) {
return getAttributeValue("text", trigger);
}
/**
* Destroy lifecycle.
*/
}, {
key: "destroy",
value: function destroy() {
this.listener.destroy();
}
}], [{
key: "copy",
value: function copy2(target2) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
container: document.body
};
return actions_copy(target2, options2);
}
/**
* Allow fire programmatically a cut action
* @param {String|HTMLElement} target
* @returns Text cutted.
*/
}, {
key: "cut",
value: function cut(target2) {
return actions_cut(target2);
}
/**
* Returns the support of the given action, or all actions if no action is
* given.
* @param {String} [action]
*/
}, {
key: "isSupported",
value: function isSupported() {
var action = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
var actions = typeof action === "string" ? [action] : action;
var support = !!document.queryCommandSupported;
actions.forEach(function(action2) {
support = support && !!document.queryCommandSupported(action2);
});
return support;
}
}]);
return Clipboard2;
}(tiny_emitter_default());
var clipboard2 = Clipboard;
}
),
/***/
828: (
/***/
function(module2) {
var DOCUMENT_NODE_TYPE = 9;
if (typeof Element !== "undefined" && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
}
function closest2(element2, selector) {
while (element2 && element2.nodeType !== DOCUMENT_NODE_TYPE) {
if (typeof element2.matches === "function" && element2.matches(selector)) {
return element2;
}
element2 = element2.parentNode;
}
}
module2.exports = closest2;
}
),
/***/
438: (
/***/
function(module2, __unused_webpack_exports, __webpack_require__2) {
var closest2 = __webpack_require__2(828);
function _delegate(element2, selector, type2, callback, useCapture) {
var listenerFn = listener2.apply(this, arguments);
element2.addEventListener(type2, listenerFn, useCapture);
return {
destroy: function() {
element2.removeEventListener(type2, listenerFn, useCapture);
}
};
}
function delegate2(elements2, selector, type2, callback, useCapture) {
if (typeof elements2.addEventListener === "function") {
return _delegate.apply(null, arguments);
}
if (typeof type2 === "function") {
return _delegate.bind(null, document).apply(null, arguments);
}
if (typeof elements2 === "string") {
elements2 = document.querySelectorAll(elements2);
}
return Array.prototype.map.call(elements2, function(element2) {
return _delegate(element2, selector, type2, callback, useCapture);
});
}
function listener2(element2, selector, type2, callback) {
return function(e7) {
e7.delegateTarget = closest2(e7.target, selector);
if (e7.delegateTarget) {
callback.call(element2, e7);
}
};
}
module2.exports = delegate2;
}
),
/***/
879: (
/***/
function(__unused_webpack_module, exports2) {
exports2.node = function(value2) {
return value2 !== void 0 && value2 instanceof HTMLElement && value2.nodeType === 1;
};
exports2.nodeList = function(value2) {
var type2 = Object.prototype.toString.call(value2);
return value2 !== void 0 && (type2 === "[object NodeList]" || type2 === "[object HTMLCollection]") && "length" in value2 && (value2.length === 0 || exports2.node(value2[0]));
};
exports2.string = function(value2) {
return typeof value2 === "string" || value2 instanceof String;
};
exports2.fn = function(value2) {
var type2 = Object.prototype.toString.call(value2);
return type2 === "[object Function]";
};
}
),
/***/
370: (
/***/
function(module2, __unused_webpack_exports, __webpack_require__2) {
var is2 = __webpack_require__2(879);
var delegate2 = __webpack_require__2(438);
function listen(target2, type2, callback) {
if (!target2 && !type2 && !callback) {
throw new Error("Missing required arguments");
}
if (!is2.string(type2)) {
throw new TypeError("Second argument must be a String");
}
if (!is2.fn(callback)) {
throw new TypeError("Third argument must be a Function");
}
if (is2.node(target2)) {
return listenNode(target2, type2, callback);
} else if (is2.nodeList(target2)) {
return listenNodeList(target2, type2, callback);
} else if (is2.string(target2)) {
return listenSelector(target2, type2, callback);
} else {
throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
}
}
function listenNode(node2, type2, callback) {
node2.addEventListener(type2, callback);
return {
destroy: function() {
node2.removeEventListener(type2, callback);
}
};
}
function listenNodeList(nodeList, type2, callback) {
Array.prototype.forEach.call(nodeList, function(node2) {
node2.addEventListener(type2, callback);
});
return {
destroy: function() {
Array.prototype.forEach.call(nodeList, function(node2) {
node2.removeEventListener(type2, callback);
});
}
};
}
function listenSelector(selector, type2, callback) {
return delegate2(document.body, selector, type2, callback);
}
module2.exports = listen;
}
),
/***/
817: (
/***/
function(module2) {
function select2(element2) {
var selectedText;
if (element2.nodeName === "SELECT") {
element2.focus();
selectedText = element2.value;
} else if (element2.nodeName === "INPUT" || element2.nodeName === "TEXTAREA") {
var isReadOnly = element2.hasAttribute("readonly");
if (!isReadOnly) {
element2.setAttribute("readonly", "");
}
element2.select();
element2.setSelectionRange(0, element2.value.length);
if (!isReadOnly) {
element2.removeAttribute("readonly");
}
selectedText = element2.value;
} else {
if (element2.hasAttribute("contenteditable")) {
element2.focus();
}
var selection = window.getSelection();
var range2 = document.createRange();
range2.selectNodeContents(element2);
selection.removeAllRanges();
selection.addRange(range2);
selectedText = selection.toString();
}
return selectedText;
}
module2.exports = select2;
}
),
/***/
279: (
/***/
function(module2) {
function E2() {
}
E2.prototype = {
on: function(name, callback, ctx) {
var e7 = this.e || (this.e = {});
(e7[name] || (e7[name] = [])).push({
fn: callback,
ctx
});
return this;
},
once: function(name, callback, ctx) {
var self2 = this;
function listener2() {
self2.off(name, listener2);
callback.apply(ctx, arguments);
}
listener2._ = callback;
return this.on(name, listener2, ctx);
},
emit: function(name) {
var data2 = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i2 = 0;
var len = evtArr.length;
for (i2; i2 < len; i2++) {
evtArr[i2].fn.apply(evtArr[i2].ctx, data2);
}
return this;
},
off: function(name, callback) {
var e7 = this.e || (this.e = {});
var evts = e7[name];
var liveEvents = [];
if (evts && callback) {
for (var i2 = 0, len = evts.length; i2 < len; i2++) {
if (evts[i2].fn !== callback && evts[i2].fn._ !== callback)
liveEvents.push(evts[i2]);
}
}
liveEvents.length ? e7[name] = liveEvents : delete e7[name];
return this;
}
};
module2.exports = E2;
module2.exports.TinyEmitter = E2;
}
)
/******/
};
var __webpack_module_cache__ = {};
function __webpack_require__(moduleId) {
if (__webpack_module_cache__[moduleId]) {
return __webpack_module_cache__[moduleId].exports;
}
var module2 = __webpack_module_cache__[moduleId] = {
/******/
// no module.id needed
/******/
// no module.loaded needed
/******/
exports: {}
/******/
};
__webpack_modules__[moduleId](module2, module2.exports, __webpack_require__);
return module2.exports;
}
!function() {
__webpack_require__.n = function(module2) {
var getter2 = module2 && module2.__esModule ? (
/******/
function() {
return module2["default"];
}
) : (
/******/
function() {
return module2;
}
);
__webpack_require__.d(getter2, { a: getter2 });
return getter2;
};
}();
!function() {
__webpack_require__.d = function(exports2, definition2) {
for (var key2 in definition2) {
if (__webpack_require__.o(definition2, key2) && !__webpack_require__.o(exports2, key2)) {
Object.defineProperty(exports2, key2, { enumerable: true, get: definition2[key2] });
}
}
};
}();
!function() {
__webpack_require__.o = function(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
};
}();
return __webpack_require__(686);
}().default
);
});
})(clipboard);
return clipboard.exports;
}
var Fragment = jsxRuntimeExports.Fragment;
function jsx2(type2, props, key2) {
if (!hasOwnProperty$6.call(props, "css")) {
return jsxRuntimeExports.jsx(type2, props, key2);
}
return jsxRuntimeExports.jsx(Emotion$1, createEmotionProps(type2, props), key2);
}
function jsxs(type2, props, key2) {
if (!hasOwnProperty$6.call(props, "css")) {
return jsxRuntimeExports.jsxs(type2, props, key2);
}
return jsxRuntimeExports.jsxs(Emotion$1, createEmotionProps(type2, props), key2);
}
const emotionReactJsxRuntime_browser_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
Fragment,
jsx: jsx2,
jsxs
}, Symbol.toStringTag, { value: "Module" }));
const require$$7$1 = /* @__PURE__ */ getAugmentedNamespace(emotionReactJsxRuntime_browser_esm);
var colors$2 = {
success: "#77bb1a",
successBig: "#8dc640",
successBackground: "#eef7e3",
warning: "#e9a514",
warningBig: "#fbbf01",
warningBackground: "#fcf2dc",
error: "#e04239",
errorBackground: "#f9e7e6",
errorDark: "#d03930",
info: "#3daae1",
infoBig: "#69b8e0",
infoBackground: "#e1f1f9",
primary: "#3daae1",
primaryHover: "#82bdf4",
primaryActive: "#4690d5",
primaryBackground: "#dfedfa",
secondary: "#fff",
secondaryHover: "#f0f3fb",
secondaryActive: "#dfe4f1",
disabled: "#999",
disabledBackground: "#dfdfdf",
disabledBorder: "#c6c6c6",
text: "#737373",
iconColor: "#576575",
headlineColor: "#424d56",
sidebarBackground: "#363a40",
sidebarColor: "#949ca1",
turquoise: "#0096a1",
formInputColor: "#000000",
formInputBorderColor: "#c6c6c6",
formInputBackground: "#ffffff",
formInputPlaceholderColor: "#bfbfbf"
};
const colors_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: colors$2
}, Symbol.toStringTag, { value: "Module" }));
const require$$7 = /* @__PURE__ */ getAugmentedNamespace(colors_module);
function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
}
const taggedTemplateLiteral = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _taggedTemplateLiteral
}, Symbol.toStringTag, { value: "Module" }));
const require$$1$2 = /* @__PURE__ */ getAugmentedNamespace(taggedTemplateLiteral);
function _arrayWithHoles$2(arr2) {
if (Array.isArray(arr2))
return arr2;
}
function _iterableToArrayLimit$2(r2, l2) {
var t5 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
if (null != t5) {
var e7, n2, i2, u2, a2 = [], f2 = true, o2 = false;
try {
if (i2 = (t5 = t5.call(r2)).next, 0 === l2) {
if (Object(t5) !== t5)
return;
f2 = false;
} else
for (; !(f2 = (e7 = i2.call(t5)).done) && (a2.push(e7.value), a2.length !== l2); f2 = true)
;
} catch (r3) {
o2 = true, n2 = r3;
} finally {
try {
if (!f2 && null != t5["return"] && (u2 = t5["return"](), Object(u2) !== u2))
return;
} finally {
if (o2)
throw n2;
}
}
return a2;
}
}
function _arrayLikeToArray$3(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++)
arr22[i2] = arr2[i2];
return arr22;
}
function _unsupportedIterableToArray$3(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray$3(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray$3(o2, minLen);
}
function _nonIterableRest$2() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray$2(arr2, i2) {
return _arrayWithHoles$2(arr2) || _iterableToArrayLimit$2(arr2, i2) || _unsupportedIterableToArray$3(arr2, i2) || _nonIterableRest$2();
}
const slicedToArray = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _slicedToArray$2
}, Symbol.toStringTag, { value: "Module" }));
const require$$2$3 = /* @__PURE__ */ getAugmentedNamespace(slicedToArray);
const require$$3$1 = /* @__PURE__ */ getAugmentedNamespace(defineProperty$6);
var _assignMergeValue;
var hasRequired_assignMergeValue;
function require_assignMergeValue() {
if (hasRequired_assignMergeValue)
return _assignMergeValue;
hasRequired_assignMergeValue = 1;
var baseAssignValue = require_baseAssignValue(), eq2 = requireEq();
function assignMergeValue(object2, key2, value2) {
if (value2 !== void 0 && !eq2(object2[key2], value2) || value2 === void 0 && !(key2 in object2)) {
baseAssignValue(object2, key2, value2);
}
}
_assignMergeValue = assignMergeValue;
return _assignMergeValue;
}
var _createBaseFor;
var hasRequired_createBaseFor;
function require_createBaseFor() {
if (hasRequired_createBaseFor)
return _createBaseFor;
hasRequired_createBaseFor = 1;
function createBaseFor(fromRight) {
return function(object2, iteratee, keysFunc) {
var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length2 = props.length;
while (length2--) {
var key2 = props[fromRight ? length2 : ++index2];
if (iteratee(iterable[key2], key2, iterable) === false) {
break;
}
}
return object2;
};
}
_createBaseFor = createBaseFor;
return _createBaseFor;
}
var _baseFor;
var hasRequired_baseFor;
function require_baseFor() {
if (hasRequired_baseFor)
return _baseFor;
hasRequired_baseFor = 1;
var createBaseFor = require_createBaseFor();
var baseFor = createBaseFor();
_baseFor = baseFor;
return _baseFor;
}
var _cloneBuffer = { exports: {} };
_cloneBuffer.exports;
var hasRequired_cloneBuffer;
function require_cloneBuffer() {
if (hasRequired_cloneBuffer)
return _cloneBuffer.exports;
hasRequired_cloneBuffer = 1;
(function(module, exports) {
var root2 = require_root();
var freeExports = exports && !exports.nodeType && exports;
var freeModule = freeExports && true && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var Buffer2 = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
})(_cloneBuffer, _cloneBuffer.exports);
return _cloneBuffer.exports;
}
var _cloneArrayBuffer;
var hasRequired_cloneArrayBuffer;
function require_cloneArrayBuffer() {
if (hasRequired_cloneArrayBuffer)
return _cloneArrayBuffer;
hasRequired_cloneArrayBuffer = 1;
var Uint8Array2 = require_Uint8Array();
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
return result;
}
_cloneArrayBuffer = cloneArrayBuffer;
return _cloneArrayBuffer;
}
var _cloneTypedArray;
var hasRequired_cloneTypedArray;
function require_cloneTypedArray() {
if (hasRequired_cloneTypedArray)
return _cloneTypedArray;
hasRequired_cloneTypedArray = 1;
var cloneArrayBuffer = require_cloneArrayBuffer();
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
_cloneTypedArray = cloneTypedArray;
return _cloneTypedArray;
}
var _copyArray;
var hasRequired_copyArray;
function require_copyArray() {
if (hasRequired_copyArray)
return _copyArray;
hasRequired_copyArray = 1;
function copyArray(source2, array2) {
var index2 = -1, length2 = source2.length;
array2 || (array2 = Array(length2));
while (++index2 < length2) {
array2[index2] = source2[index2];
}
return array2;
}
_copyArray = copyArray;
return _copyArray;
}
var _baseCreate;
var hasRequired_baseCreate;
function require_baseCreate() {
if (hasRequired_baseCreate)
return _baseCreate;
hasRequired_baseCreate = 1;
var isObject2 = requireIsObject();
var objectCreate2 = Object.create;
var baseCreate = function() {
function object2() {
}
return function(proto) {
if (!isObject2(proto)) {
return {};
}
if (objectCreate2) {
return objectCreate2(proto);
}
object2.prototype = proto;
var result = new object2();
object2.prototype = void 0;
return result;
};
}();
_baseCreate = baseCreate;
return _baseCreate;
}
var _initCloneObject;
var hasRequired_initCloneObject;
function require_initCloneObject() {
if (hasRequired_initCloneObject)
return _initCloneObject;
hasRequired_initCloneObject = 1;
var baseCreate = require_baseCreate(), getPrototype2 = require_getPrototype(), isPrototype2 = require_isPrototype();
function initCloneObject(object2) {
return typeof object2.constructor == "function" && !isPrototype2(object2) ? baseCreate(getPrototype2(object2)) : {};
}
_initCloneObject = initCloneObject;
return _initCloneObject;
}
var isArrayLikeObject_1;
var hasRequiredIsArrayLikeObject;
function requireIsArrayLikeObject() {
if (hasRequiredIsArrayLikeObject)
return isArrayLikeObject_1;
hasRequiredIsArrayLikeObject = 1;
var isArrayLike2 = requireIsArrayLike(), isObjectLike2 = requireIsObjectLike();
function isArrayLikeObject2(value2) {
return isObjectLike2(value2) && isArrayLike2(value2);
}
isArrayLikeObject_1 = isArrayLikeObject2;
return isArrayLikeObject_1;
}
var isPlainObject_1;
var hasRequiredIsPlainObject;
function requireIsPlainObject() {
if (hasRequiredIsPlainObject)
return isPlainObject_1;
hasRequiredIsPlainObject = 1;
var baseGetTag2 = require_baseGetTag(), getPrototype2 = require_getPrototype(), isObjectLike2 = requireIsObjectLike();
var objectTag = "[object Object]";
var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
var funcToString2 = funcProto2.toString;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
var objectCtorString = funcToString2.call(Object);
function isPlainObject2(value2) {
if (!isObjectLike2(value2) || baseGetTag2(value2) != objectTag) {
return false;
}
var proto = getPrototype2(value2);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString2.call(Ctor) == objectCtorString;
}
isPlainObject_1 = isPlainObject2;
return isPlainObject_1;
}
var _safeGet;
var hasRequired_safeGet;
function require_safeGet() {
if (hasRequired_safeGet)
return _safeGet;
hasRequired_safeGet = 1;
function safeGet(object2, key2) {
if (key2 === "constructor" && typeof object2[key2] === "function") {
return;
}
if (key2 == "__proto__") {
return;
}
return object2[key2];
}
_safeGet = safeGet;
return _safeGet;
}
var _copyObject;
var hasRequired_copyObject;
function require_copyObject() {
if (hasRequired_copyObject)
return _copyObject;
hasRequired_copyObject = 1;
var assignValue = require_assignValue(), baseAssignValue = require_baseAssignValue();
function copyObject(source2, props, object2, customizer) {
var isNew = !object2;
object2 || (object2 = {});
var index2 = -1, length2 = props.length;
while (++index2 < length2) {
var key2 = props[index2];
var newValue = customizer ? customizer(object2[key2], source2[key2], key2, object2, source2) : void 0;
if (newValue === void 0) {
newValue = source2[key2];
}
if (isNew) {
baseAssignValue(object2, key2, newValue);
} else {
assignValue(object2, key2, newValue);
}
}
return object2;
}
_copyObject = copyObject;
return _copyObject;
}
var toPlainObject_1;
var hasRequiredToPlainObject;
function requireToPlainObject() {
if (hasRequiredToPlainObject)
return toPlainObject_1;
hasRequiredToPlainObject = 1;
var copyObject = require_copyObject(), keysIn2 = requireKeysIn();
function toPlainObject(value2) {
return copyObject(value2, keysIn2(value2));
}
toPlainObject_1 = toPlainObject;
return toPlainObject_1;
}
var _baseMergeDeep;
var hasRequired_baseMergeDeep;
function require_baseMergeDeep() {
if (hasRequired_baseMergeDeep)
return _baseMergeDeep;
hasRequired_baseMergeDeep = 1;
var assignMergeValue = require_assignMergeValue(), cloneBuffer = require_cloneBuffer(), cloneTypedArray = require_cloneTypedArray(), copyArray = require_copyArray(), initCloneObject = require_initCloneObject(), isArguments2 = requireIsArguments(), isArray3 = requireIsArray(), isArrayLikeObject2 = requireIsArrayLikeObject(), isBuffer2 = requireIsBuffer(), isFunction2 = requireIsFunction(), isObject2 = requireIsObject(), isPlainObject2 = requireIsPlainObject(), isTypedArray = requireIsTypedArray(), safeGet = require_safeGet(), toPlainObject = requireToPlainObject();
function baseMergeDeep(object2, source2, key2, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet(object2, key2), srcValue = safeGet(source2, key2), stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object2, key2, stacked);
return;
}
var newValue = customizer ? customizer(objValue, srcValue, key2 + "", object2, source2, stack) : void 0;
var isCommon = newValue === void 0;
if (isCommon) {
var isArr = isArray3(srcValue), isBuff = !isArr && isBuffer2(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray3(objValue)) {
newValue = objValue;
} else if (isArrayLikeObject2(objValue)) {
newValue = copyArray(objValue);
} else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
} else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
} else {
newValue = [];
}
} else if (isPlainObject2(srcValue) || isArguments2(srcValue)) {
newValue = objValue;
if (isArguments2(objValue)) {
newValue = toPlainObject(objValue);
} else if (!isObject2(objValue) || isFunction2(objValue)) {
newValue = initCloneObject(srcValue);
}
} else {
isCommon = false;
}
}
if (isCommon) {
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack["delete"](srcValue);
}
assignMergeValue(object2, key2, newValue);
}
_baseMergeDeep = baseMergeDeep;
return _baseMergeDeep;
}
var _baseMerge;
var hasRequired_baseMerge;
function require_baseMerge() {
if (hasRequired_baseMerge)
return _baseMerge;
hasRequired_baseMerge = 1;
var Stack2 = require_Stack(), assignMergeValue = require_assignMergeValue(), baseFor = require_baseFor(), baseMergeDeep = require_baseMergeDeep(), isObject2 = requireIsObject(), keysIn2 = requireKeysIn(), safeGet = require_safeGet();
function baseMerge(object2, source2, srcIndex, customizer, stack) {
if (object2 === source2) {
return;
}
baseFor(source2, function(srcValue, key2) {
stack || (stack = new Stack2());
if (isObject2(srcValue)) {
baseMergeDeep(object2, source2, key2, srcIndex, baseMerge, customizer, stack);
} else {
var newValue = customizer ? customizer(safeGet(object2, key2), srcValue, key2 + "", object2, source2, stack) : void 0;
if (newValue === void 0) {
newValue = srcValue;
}
assignMergeValue(object2, key2, newValue);
}
}, keysIn2);
}
_baseMerge = baseMerge;
return _baseMerge;
}
var _apply;
var hasRequired_apply;
function require_apply() {
if (hasRequired_apply)
return _apply;
hasRequired_apply = 1;
function apply2(func, thisArg, args) {
switch (args.length) {
case 0:
return func.call(thisArg);
case 1:
return func.call(thisArg, args[0]);
case 2:
return func.call(thisArg, args[0], args[1]);
case 3:
return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
_apply = apply2;
return _apply;
}
var _overRest;
var hasRequired_overRest;
function require_overRest() {
if (hasRequired_overRest)
return _overRest;
hasRequired_overRest = 1;
var apply2 = require_apply();
var nativeMax2 = Math.max;
function overRest(func, start2, transform2) {
start2 = nativeMax2(start2 === void 0 ? func.length - 1 : start2, 0);
return function() {
var args = arguments, index2 = -1, length2 = nativeMax2(args.length - start2, 0), array2 = Array(length2);
while (++index2 < length2) {
array2[index2] = args[start2 + index2];
}
index2 = -1;
var otherArgs = Array(start2 + 1);
while (++index2 < start2) {
otherArgs[index2] = args[index2];
}
otherArgs[start2] = transform2(array2);
return apply2(func, this, otherArgs);
};
}
_overRest = overRest;
return _overRest;
}
var constant_1;
var hasRequiredConstant;
function requireConstant() {
if (hasRequiredConstant)
return constant_1;
hasRequiredConstant = 1;
function constant2(value2) {
return function() {
return value2;
};
}
constant_1 = constant2;
return constant_1;
}
var _baseSetToString;
var hasRequired_baseSetToString;
function require_baseSetToString() {
if (hasRequired_baseSetToString)
return _baseSetToString;
hasRequired_baseSetToString = 1;
var constant2 = requireConstant(), defineProperty4 = require_defineProperty(), identity2 = requireIdentity();
var baseSetToString = !defineProperty4 ? identity2 : function(func, string2) {
return defineProperty4(func, "toString", {
"configurable": true,
"enumerable": false,
"value": constant2(string2),
"writable": true
});
};
_baseSetToString = baseSetToString;
return _baseSetToString;
}
var _shortOut;
var hasRequired_shortOut;
function require_shortOut() {
if (hasRequired_shortOut)
return _shortOut;
hasRequired_shortOut = 1;
var HOT_COUNT = 800, HOT_SPAN = 16;
var nativeNow = Date.now;
function shortOut(func) {
var count2 = 0, lastCalled = 0;
return function() {
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count2 >= HOT_COUNT) {
return arguments[0];
}
} else {
count2 = 0;
}
return func.apply(void 0, arguments);
};
}
_shortOut = shortOut;
return _shortOut;
}
var _setToString;
var hasRequired_setToString;
function require_setToString() {
if (hasRequired_setToString)
return _setToString;
hasRequired_setToString = 1;
var baseSetToString = require_baseSetToString(), shortOut = require_shortOut();
var setToString = shortOut(baseSetToString);
_setToString = setToString;
return _setToString;
}
var _baseRest;
var hasRequired_baseRest;
function require_baseRest() {
if (hasRequired_baseRest)
return _baseRest;
hasRequired_baseRest = 1;
var identity2 = requireIdentity(), overRest = require_overRest(), setToString = require_setToString();
function baseRest2(func, start2) {
return setToString(overRest(func, start2, identity2), func + "");
}
_baseRest = baseRest2;
return _baseRest;
}
var _isIterateeCall;
var hasRequired_isIterateeCall;
function require_isIterateeCall() {
if (hasRequired_isIterateeCall)
return _isIterateeCall;
hasRequired_isIterateeCall = 1;
var eq2 = requireEq(), isArrayLike2 = requireIsArrayLike(), isIndex2 = require_isIndex(), isObject2 = requireIsObject();
function isIterateeCall(value2, index2, object2) {
if (!isObject2(object2)) {
return false;
}
var type2 = typeof index2;
if (type2 == "number" ? isArrayLike2(object2) && isIndex2(index2, object2.length) : type2 == "string" && index2 in object2) {
return eq2(object2[index2], value2);
}
return false;
}
_isIterateeCall = isIterateeCall;
return _isIterateeCall;
}
var _createAssigner;
var hasRequired_createAssigner;
function require_createAssigner() {
if (hasRequired_createAssigner)
return _createAssigner;
hasRequired_createAssigner = 1;
var baseRest2 = require_baseRest(), isIterateeCall = require_isIterateeCall();
function createAssigner(assigner) {
return baseRest2(function(object2, sources) {
var index2 = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0;
customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length2 < 3 ? void 0 : customizer;
length2 = 1;
}
object2 = Object(object2);
while (++index2 < length2) {
var source2 = sources[index2];
if (source2) {
assigner(object2, source2, index2, customizer);
}
}
return object2;
});
}
_createAssigner = createAssigner;
return _createAssigner;
}
var merge_1;
var hasRequiredMerge;
function requireMerge() {
if (hasRequiredMerge)
return merge_1;
hasRequiredMerge = 1;
var baseMerge = require_baseMerge(), createAssigner = require_createAssigner();
var merge2 = createAssigner(function(object2, source2, srcIndex) {
baseMerge(object2, source2, srcIndex);
});
merge_1 = merge2;
return merge_1;
}
var validate = { exports: {} };
/*!
* validate.js 0.13.1
*
* (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
* Validate.js may be freely distributed under the MIT license.
* For all details and documentation:
* http://validatejs.org/
*/
(function(module, exports) {
(function(exports2, module2, define2) {
var validate2 = function(attributes, constraints, options2) {
options2 = v2.extend({}, v2.options, options2);
var results = v2.runValidations(attributes, constraints, options2);
if (results.some(function(r2) {
return v2.isPromise(r2.error);
})) {
throw new Error("Use validate.async if you want support for promises");
}
return validate2.processValidationResults(results, options2);
};
var v2 = validate2;
v2.extend = function(obj) {
[].slice.call(arguments, 1).forEach(function(source2) {
for (var attr2 in source2) {
obj[attr2] = source2[attr2];
}
});
return obj;
};
v2.extend(validate2, {
// This is the version of the library as a semver.
// The toString function will allow it to be coerced into a string
version: {
major: 0,
minor: 13,
patch: 1,
metadata: null,
toString: function() {
var version2 = v2.format("%{major}.%{minor}.%{patch}", v2.version);
if (!v2.isEmpty(v2.version.metadata)) {
version2 += "+" + v2.version.metadata;
}
return version2;
}
},
// Below is the dependencies that are used in validate.js
// The constructor of the Promise implementation.
// If you are using Q.js, RSVP or any other A+ compatible implementation
// override this attribute to be the constructor of that promise.
// Since jQuery promises aren't A+ compatible they won't work.
Promise: typeof Promise !== "undefined" ? Promise : (
/* istanbul ignore next */
null
),
EMPTY_STRING_REGEXP: /^\s*$/,
// Runs the validators specified by the constraints object.
// Will return an array of the format:
// [{attribute: "<attribute name>", error: "<validation result>"}, ...]
runValidations: function(attributes, constraints, options2) {
var results = [], attr2, validatorName, value2, validators, validator, validatorOptions, error3;
if (v2.isDomElement(attributes) || v2.isJqueryElement(attributes)) {
attributes = v2.collectFormValues(attributes);
}
for (attr2 in constraints) {
value2 = v2.getDeepObjectValue(attributes, attr2);
validators = v2.result(constraints[attr2], value2, attributes, attr2, options2, constraints);
for (validatorName in validators) {
validator = v2.validators[validatorName];
if (!validator) {
error3 = v2.format("Unknown validator %{name}", { name: validatorName });
throw new Error(error3);
}
validatorOptions = validators[validatorName];
validatorOptions = v2.result(validatorOptions, value2, attributes, attr2, options2, constraints);
if (!validatorOptions) {
continue;
}
results.push({
attribute: attr2,
value: value2,
validator: validatorName,
globalOptions: options2,
attributes,
options: validatorOptions,
error: validator.call(
validator,
value2,
validatorOptions,
attr2,
attributes,
options2
)
});
}
}
return results;
},
// Takes the output from runValidations and converts it to the correct
// output format.
processValidationResults: function(errors, options2) {
errors = v2.pruneEmptyErrors(errors, options2);
errors = v2.expandMultipleErrors(errors, options2);
errors = v2.convertErrorMessages(errors, options2);
var format2 = options2.format || "grouped";
if (typeof v2.formatters[format2] === "function") {
errors = v2.formatters[format2](errors);
} else {
throw new Error(v2.format("Unknown format %{format}", options2));
}
return v2.isEmpty(errors) ? void 0 : errors;
},
// Runs the validations with support for promises.
// This function will return a promise that is settled when all the
// validation promises have been completed.
// It can be called even if no validations returned a promise.
async: function(attributes, constraints, options2) {
options2 = v2.extend({}, v2.async.options, options2);
var WrapErrors = options2.wrapErrors || function(errors) {
return errors;
};
if (options2.cleanAttributes !== false) {
attributes = v2.cleanAttributes(attributes, constraints);
}
var results = v2.runValidations(attributes, constraints, options2);
return new v2.Promise(function(resolve3, reject2) {
v2.waitForResults(results).then(function() {
var errors = v2.processValidationResults(results, options2);
if (errors) {
reject2(new WrapErrors(errors, options2, attributes, constraints));
} else {
resolve3(attributes);
}
}, function(err) {
reject2(err);
});
});
},
single: function(value2, constraints, options2) {
options2 = v2.extend({}, v2.single.options, options2, {
format: "flat",
fullMessages: false
});
return v2({ single: value2 }, { single: constraints }, options2);
},
// Returns a promise that is resolved when all promises in the results array
// are settled. The promise returned from this function is always resolved,
// never rejected.
// This function modifies the input argument, it replaces the promises
// with the value returned from the promise.
waitForResults: function(results) {
return results.reduce(function(memo, result) {
if (!v2.isPromise(result.error)) {
return memo;
}
return memo.then(function() {
return result.error.then(function(error3) {
result.error = error3 || null;
});
});
}, new v2.Promise(function(r2) {
r2();
}));
},
// If the given argument is a call: function the and: function return the value
// otherwise just return the value. Additional arguments will be passed as
// arguments to the function.
// Example:
// ```
// result('foo') // 'foo'
// result(Math.max, 1, 2) // 2
// ```
result: function(value2) {
var args = [].slice.call(arguments, 1);
if (typeof value2 === "function") {
value2 = value2.apply(null, args);
}
return value2;
},
// Checks if the value is a number. This function does not consider NaN a
// number like many other `isNumber` functions do.
isNumber: function(value2) {
return typeof value2 === "number" && !isNaN(value2);
},
// Returns false if the object is not a function
isFunction: function(value2) {
return typeof value2 === "function";
},
// A simple check to verify that the value is an integer. Uses `isNumber`
// and a simple modulo check.
isInteger: function(value2) {
return v2.isNumber(value2) && value2 % 1 === 0;
},
// Checks if the value is a boolean
isBoolean: function(value2) {
return typeof value2 === "boolean";
},
// Uses the `Object` function to check if the given argument is an object.
isObject: function(obj) {
return obj === Object(obj);
},
// Simply checks if the object is an instance of a date
isDate: function(obj) {
return obj instanceof Date;
},
// Returns false if the object is `null` of `undefined`
isDefined: function(obj) {
return obj !== null && obj !== void 0;
},
// Checks if the given argument is a promise. Anything with a `then`
// function is considered a promise.
isPromise: function(p2) {
return !!p2 && v2.isFunction(p2.then);
},
isJqueryElement: function(o2) {
return o2 && v2.isString(o2.jquery);
},
isDomElement: function(o2) {
if (!o2) {
return false;
}
if (!o2.querySelectorAll || !o2.querySelector) {
return false;
}
if (v2.isObject(document) && o2 === document) {
return true;
}
if (typeof HTMLElement === "object") {
return o2 instanceof HTMLElement;
} else {
return o2 && typeof o2 === "object" && o2 !== null && o2.nodeType === 1 && typeof o2.nodeName === "string";
}
},
isEmpty: function(value2) {
var attr2;
if (!v2.isDefined(value2)) {
return true;
}
if (v2.isFunction(value2)) {
return false;
}
if (v2.isString(value2)) {
return v2.EMPTY_STRING_REGEXP.test(value2);
}
if (v2.isArray(value2)) {
return value2.length === 0;
}
if (v2.isDate(value2)) {
return false;
}
if (v2.isObject(value2)) {
for (attr2 in value2) {
return false;
}
return true;
}
return false;
},
// Formats the specified strings with the given values like so:
// ```
// format("Foo: %{foo}", {foo: "bar"}) // "Foo bar"
// ```
// If you want to write %{...} without having it replaced simply
// prefix it with % like this `Foo: %%{foo}` and it will be returned
// as `"Foo: %{foo}"`
format: v2.extend(function(str, vals) {
if (!v2.isString(str)) {
return str;
}
return str.replace(v2.format.FORMAT_REGEXP, function(m0, m1, m2) {
if (m1 === "%") {
return "%{" + m2 + "}";
} else {
return String(vals[m2]);
}
});
}, {
// Finds %{key} style patterns in the given string
FORMAT_REGEXP: /(%?)%\{([^\}]+)\}/g
}),
// "Prettifies" the given string.
// Prettifying means replacing [.\_-] with spaces as well as splitting
// camel case words.
prettify: function(str) {
if (v2.isNumber(str)) {
if (str * 100 % 1 === 0) {
return "" + str;
} else {
return parseFloat(Math.round(str * 100) / 100).toFixed(2);
}
}
if (v2.isArray(str)) {
return str.map(function(s2) {
return v2.prettify(s2);
}).join(", ");
}
if (v2.isObject(str)) {
if (!v2.isDefined(str.toString)) {
return JSON.stringify(str);
}
return str.toString();
}
str = "" + str;
return str.replace(/([^\s])\.([^\s])/g, "$1 $2").replace(/\\+/g, "").replace(/[_-]/g, " ").replace(/([a-z])([A-Z])/g, function(m0, m1, m2) {
return "" + m1 + " " + m2.toLowerCase();
}).toLowerCase();
},
stringifyValue: function(value2, options2) {
var prettify = options2 && options2.prettify || v2.prettify;
return prettify(value2);
},
isString: function(value2) {
return typeof value2 === "string";
},
isArray: function(value2) {
return {}.toString.call(value2) === "[object Array]";
},
// Checks if the object is a hash, which is equivalent to an object that
// is neither an array nor a function.
isHash: function(value2) {
return v2.isObject(value2) && !v2.isArray(value2) && !v2.isFunction(value2);
},
contains: function(obj, value2) {
if (!v2.isDefined(obj)) {
return false;
}
if (v2.isArray(obj)) {
return obj.indexOf(value2) !== -1;
}
return value2 in obj;
},
unique: function(array2) {
if (!v2.isArray(array2)) {
return array2;
}
return array2.filter(function(el, index2, array3) {
return array3.indexOf(el) == index2;
});
},
forEachKeyInKeypath: function(object2, keypath, callback) {
if (!v2.isString(keypath)) {
return void 0;
}
var key2 = "", i2, escape2 = false;
for (i2 = 0; i2 < keypath.length; ++i2) {
switch (keypath[i2]) {
case ".":
if (escape2) {
escape2 = false;
key2 += ".";
} else {
object2 = callback(object2, key2, false);
key2 = "";
}
break;
case "\\":
if (escape2) {
escape2 = false;
key2 += "\\";
} else {
escape2 = true;
}
break;
default:
escape2 = false;
key2 += keypath[i2];
break;
}
}
return callback(object2, key2, true);
},
getDeepObjectValue: function(obj, keypath) {
if (!v2.isObject(obj)) {
return void 0;
}
return v2.forEachKeyInKeypath(obj, keypath, function(obj2, key2) {
if (v2.isObject(obj2)) {
return obj2[key2];
}
});
},
// This returns an object with all the values of the form.
// It uses the input name as key and the value as value
// So for example this:
// <input type="text" name="email" value="foo@bar.com" />
// would return:
// {email: "foo@bar.com"}
collectFormValues: function(form2, options2) {
var values2 = {}, i2, j2, input, inputs, option, value2;
if (v2.isJqueryElement(form2)) {
form2 = form2[0];
}
if (!form2) {
return values2;
}
options2 = options2 || {};
inputs = form2.querySelectorAll("input[name], textarea[name]");
for (i2 = 0; i2 < inputs.length; ++i2) {
input = inputs.item(i2);
if (v2.isDefined(input.getAttribute("data-ignored"))) {
continue;
}
var name = input.name.replace(/\./g, "\\\\.");
value2 = v2.sanitizeFormValue(input.value, options2);
if (input.type === "number") {
value2 = value2 ? +value2 : null;
} else if (input.type === "checkbox") {
if (input.attributes.value) {
if (!input.checked) {
value2 = values2[name] || null;
}
} else {
value2 = input.checked;
}
} else if (input.type === "radio") {
if (!input.checked) {
value2 = values2[name] || null;
}
}
values2[name] = value2;
}
inputs = form2.querySelectorAll("select[name]");
for (i2 = 0; i2 < inputs.length; ++i2) {
input = inputs.item(i2);
if (v2.isDefined(input.getAttribute("data-ignored"))) {
continue;
}
if (input.multiple) {
value2 = [];
for (j2 in input.options) {
option = input.options[j2];
if (option && option.selected) {
value2.push(v2.sanitizeFormValue(option.value, options2));
}
}
} else {
var _val = typeof input.options[input.selectedIndex] !== "undefined" ? input.options[input.selectedIndex].value : (
/* istanbul ignore next */
""
);
value2 = v2.sanitizeFormValue(_val, options2);
}
values2[input.name] = value2;
}
return values2;
},
sanitizeFormValue: function(value2, options2) {
if (options2.trim && v2.isString(value2)) {
value2 = value2.trim();
}
if (options2.nullify !== false && value2 === "") {
return null;
}
return value2;
},
capitalize: function(str) {
if (!v2.isString(str)) {
return str;
}
return str[0].toUpperCase() + str.slice(1);
},
// Remove all errors who's error attribute is empty (null or undefined)
pruneEmptyErrors: function(errors) {
return errors.filter(function(error3) {
return !v2.isEmpty(error3.error);
});
},
// In
// [{error: ["err1", "err2"], ...}]
// Out
// [{error: "err1", ...}, {error: "err2", ...}]
//
// All attributes in an error with multiple messages are duplicated
// when expanding the errors.
expandMultipleErrors: function(errors) {
var ret = [];
errors.forEach(function(error3) {
if (v2.isArray(error3.error)) {
error3.error.forEach(function(msg) {
ret.push(v2.extend({}, error3, { error: msg }));
});
} else {
ret.push(error3);
}
});
return ret;
},
// Converts the error mesages by prepending the attribute name unless the
// message is prefixed by ^
convertErrorMessages: function(errors, options2) {
options2 = options2 || {};
var ret = [], prettify = options2.prettify || v2.prettify;
errors.forEach(function(errorInfo) {
var error3 = v2.result(
errorInfo.error,
errorInfo.value,
errorInfo.attribute,
errorInfo.options,
errorInfo.attributes,
errorInfo.globalOptions
);
if (!v2.isString(error3)) {
ret.push(errorInfo);
return;
}
if (error3[0] === "^") {
error3 = error3.slice(1);
} else if (options2.fullMessages !== false) {
error3 = v2.capitalize(prettify(errorInfo.attribute)) + " " + error3;
}
error3 = error3.replace(/\\\^/g, "^");
error3 = v2.format(error3, {
value: v2.stringifyValue(errorInfo.value, options2)
});
ret.push(v2.extend({}, errorInfo, { error: error3 }));
});
return ret;
},
// In:
// [{attribute: "<attributeName>", ...}]
// Out:
// {"<attributeName>": [{attribute: "<attributeName>", ...}]}
groupErrorsByAttribute: function(errors) {
var ret = {};
errors.forEach(function(error3) {
var list = ret[error3.attribute];
if (list) {
list.push(error3);
} else {
ret[error3.attribute] = [error3];
}
});
return ret;
},
// In:
// [{error: "<message 1>", ...}, {error: "<message 2>", ...}]
// Out:
// ["<message 1>", "<message 2>"]
flattenErrorsToArray: function(errors) {
return errors.map(function(error3) {
return error3.error;
}).filter(function(value2, index2, self2) {
return self2.indexOf(value2) === index2;
});
},
cleanAttributes: function(attributes, whitelist) {
function whitelistCreator(obj, key2, last) {
if (v2.isObject(obj[key2])) {
return obj[key2];
}
return obj[key2] = last ? true : {};
}
function buildObjectWhitelist(whitelist2) {
var ow = {}, attr2;
for (attr2 in whitelist2) {
if (!whitelist2[attr2]) {
continue;
}
v2.forEachKeyInKeypath(ow, attr2, whitelistCreator);
}
return ow;
}
function cleanRecursive(attributes2, whitelist2) {
if (!v2.isObject(attributes2)) {
return attributes2;
}
var ret = v2.extend({}, attributes2), w2, attribute;
for (attribute in attributes2) {
w2 = whitelist2[attribute];
if (v2.isObject(w2)) {
ret[attribute] = cleanRecursive(ret[attribute], w2);
} else if (!w2) {
delete ret[attribute];
}
}
return ret;
}
if (!v2.isObject(whitelist) || !v2.isObject(attributes)) {
return {};
}
whitelist = buildObjectWhitelist(whitelist);
return cleanRecursive(attributes, whitelist);
},
exposeModule: function(validate3, root2, exports3, module3, define3) {
if (exports3) {
if (module3 && module3.exports) {
exports3 = module3.exports = validate3;
}
exports3.validate = validate3;
} else {
root2.validate = validate3;
if (validate3.isFunction(define3) && define3.amd) {
define3([], function() {
return validate3;
});
}
}
},
warn: function(msg) {
if (typeof console !== "undefined" && console.warn) {
console.warn("[validate.js] " + msg);
}
},
error: function(msg) {
if (typeof console !== "undefined" && console.error) {
console.error("[validate.js] " + msg);
}
}
});
validate2.validators = {
// Presence validates that the value isn't empty
presence: function(value2, options2) {
options2 = v2.extend({}, this.options, options2);
if (options2.allowEmpty !== false ? !v2.isDefined(value2) : v2.isEmpty(value2)) {
return options2.message || this.message || "can't be blank";
}
},
length: function(value2, options2, attribute) {
if (!v2.isDefined(value2)) {
return;
}
options2 = v2.extend({}, this.options, options2);
var is2 = options2.is, maximum = options2.maximum, minimum = options2.minimum, tokenizer = options2.tokenizer || function(val) {
return val;
}, err, errors = [];
value2 = tokenizer(value2);
var length2 = value2.length;
if (!v2.isNumber(length2)) {
return options2.message || this.notValid || "has an incorrect length";
}
if (v2.isNumber(is2) && length2 !== is2) {
err = options2.wrongLength || this.wrongLength || "is the wrong length (should be %{count} characters)";
errors.push(v2.format(err, { count: is2 }));
}
if (v2.isNumber(minimum) && length2 < minimum) {
err = options2.tooShort || this.tooShort || "is too short (minimum is %{count} characters)";
errors.push(v2.format(err, { count: minimum }));
}
if (v2.isNumber(maximum) && length2 > maximum) {
err = options2.tooLong || this.tooLong || "is too long (maximum is %{count} characters)";
errors.push(v2.format(err, { count: maximum }));
}
if (errors.length > 0) {
return options2.message || errors;
}
},
numericality: function(value2, options2, attribute, attributes, globalOptions) {
if (!v2.isDefined(value2)) {
return;
}
options2 = v2.extend({}, this.options, options2);
var errors = [], name, count2, checks = {
greaterThan: function(v3, c2) {
return v3 > c2;
},
greaterThanOrEqualTo: function(v3, c2) {
return v3 >= c2;
},
equalTo: function(v3, c2) {
return v3 === c2;
},
lessThan: function(v3, c2) {
return v3 < c2;
},
lessThanOrEqualTo: function(v3, c2) {
return v3 <= c2;
},
divisibleBy: function(v3, c2) {
return v3 % c2 === 0;
}
}, prettify = options2.prettify || globalOptions && globalOptions.prettify || v2.prettify;
if (v2.isString(value2) && options2.strict) {
var pattern = "^-?(0|[1-9]\\d*)";
if (!options2.onlyInteger) {
pattern += "(\\.\\d+)?";
}
pattern += "$";
if (!new RegExp(pattern).test(value2)) {
return options2.message || options2.notValid || this.notValid || this.message || "must be a valid number";
}
}
if (options2.noStrings !== true && v2.isString(value2) && !v2.isEmpty(value2)) {
value2 = +value2;
}
if (!v2.isNumber(value2)) {
return options2.message || options2.notValid || this.notValid || this.message || "is not a number";
}
if (options2.onlyInteger && !v2.isInteger(value2)) {
return options2.message || options2.notInteger || this.notInteger || this.message || "must be an integer";
}
for (name in checks) {
count2 = options2[name];
if (v2.isNumber(count2) && !checks[name](value2, count2)) {
var key2 = "not" + v2.capitalize(name);
var msg = options2[key2] || this[key2] || this.message || "must be %{type} %{count}";
errors.push(v2.format(msg, {
count: count2,
type: prettify(name)
}));
}
}
if (options2.odd && value2 % 2 !== 1) {
errors.push(options2.notOdd || this.notOdd || this.message || "must be odd");
}
if (options2.even && value2 % 2 !== 0) {
errors.push(options2.notEven || this.notEven || this.message || "must be even");
}
if (errors.length) {
return options2.message || errors;
}
},
datetime: v2.extend(function(value2, options2) {
if (!v2.isFunction(this.parse) || !v2.isFunction(this.format)) {
throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");
}
if (!v2.isDefined(value2)) {
return;
}
options2 = v2.extend({}, this.options, options2);
var err, errors = [], earliest = options2.earliest ? this.parse(options2.earliest, options2) : NaN, latest = options2.latest ? this.parse(options2.latest, options2) : NaN;
value2 = this.parse(value2, options2);
if (isNaN(value2) || options2.dateOnly && value2 % 864e5 !== 0) {
err = options2.notValid || options2.message || this.notValid || "must be a valid date";
return v2.format(err, { value: arguments[0] });
}
if (!isNaN(earliest) && value2 < earliest) {
err = options2.tooEarly || options2.message || this.tooEarly || "must be no earlier than %{date}";
err = v2.format(err, {
value: this.format(value2, options2),
date: this.format(earliest, options2)
});
errors.push(err);
}
if (!isNaN(latest) && value2 > latest) {
err = options2.tooLate || options2.message || this.tooLate || "must be no later than %{date}";
err = v2.format(err, {
date: this.format(latest, options2),
value: this.format(value2, options2)
});
errors.push(err);
}
if (errors.length) {
return v2.unique(errors);
}
}, {
parse: null,
format: null
}),
date: function(value2, options2) {
options2 = v2.extend({}, options2, { dateOnly: true });
return v2.validators.datetime.call(v2.validators.datetime, value2, options2);
},
format: function(value2, options2) {
if (v2.isString(options2) || options2 instanceof RegExp) {
options2 = { pattern: options2 };
}
options2 = v2.extend({}, this.options, options2);
var message = options2.message || this.message || "is invalid", pattern = options2.pattern, match2;
if (!v2.isDefined(value2)) {
return;
}
if (!v2.isString(value2)) {
return message;
}
if (v2.isString(pattern)) {
pattern = new RegExp(options2.pattern, options2.flags);
}
match2 = pattern.exec(value2);
if (!match2 || match2[0].length != value2.length) {
return message;
}
},
inclusion: function(value2, options2) {
if (!v2.isDefined(value2)) {
return;
}
if (v2.isArray(options2)) {
options2 = { within: options2 };
}
options2 = v2.extend({}, this.options, options2);
if (v2.contains(options2.within, value2)) {
return;
}
var message = options2.message || this.message || "^%{value} is not included in the list";
return v2.format(message, { value: value2 });
},
exclusion: function(value2, options2) {
if (!v2.isDefined(value2)) {
return;
}
if (v2.isArray(options2)) {
options2 = { within: options2 };
}
options2 = v2.extend({}, this.options, options2);
if (!v2.contains(options2.within, value2)) {
return;
}
var message = options2.message || this.message || "^%{value} is restricted";
if (v2.isString(options2.within[value2])) {
value2 = options2.within[value2];
}
return v2.format(message, { value: value2 });
},
email: v2.extend(function(value2, options2) {
options2 = v2.extend({}, this.options, options2);
var message = options2.message || this.message || "is not a valid email";
if (!v2.isDefined(value2)) {
return;
}
if (!v2.isString(value2)) {
return message;
}
if (!this.PATTERN.exec(value2)) {
return message;
}
}, {
PATTERN: /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i
}),
equality: function(value2, options2, attribute, attributes, globalOptions) {
if (!v2.isDefined(value2)) {
return;
}
if (v2.isString(options2)) {
options2 = { attribute: options2 };
}
options2 = v2.extend({}, this.options, options2);
var message = options2.message || this.message || "is not equal to %{attribute}";
if (v2.isEmpty(options2.attribute) || !v2.isString(options2.attribute)) {
throw new Error("The attribute must be a non empty string");
}
var otherValue = v2.getDeepObjectValue(attributes, options2.attribute), comparator2 = options2.comparator || function(v1, v22) {
return v1 === v22;
}, prettify = options2.prettify || globalOptions && globalOptions.prettify || v2.prettify;
if (!comparator2(value2, otherValue, options2, attribute, attributes)) {
return v2.format(message, { attribute: prettify(options2.attribute) });
}
},
// A URL validator that is used to validate URLs with the ability to
// restrict schemes and some domains.
url: function(value2, options2) {
if (!v2.isDefined(value2)) {
return;
}
options2 = v2.extend({}, this.options, options2);
var message = options2.message || this.message || "is not a valid url", schemes2 = options2.schemes || this.schemes || ["http", "https"], allowLocal = options2.allowLocal || this.allowLocal || false, allowDataUrl = options2.allowDataUrl || this.allowDataUrl || false;
if (!v2.isString(value2)) {
return message;
}
var regex = "^(?:(?:" + schemes2.join("|") + ")://)(?:\\S+(?::\\S*)?@)?(?:";
var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
if (allowLocal) {
tld += "?";
} else {
regex += // IP address exclusion
// private & local networks
"(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})";
}
regex += // IP address dotted notation octets
// excludes loopback network 0.0.0.0
// excludes reserved space >= 224.0.0.0
// excludes network & broacast addresses
// (first & last IP address of each class)
"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" + tld + ")(?::\\d{2,5})?(?:[/?#]\\S*)?$";
if (allowDataUrl) {
var mediaType = "\\w+\\/[-+.\\w]+(?:;[\\w=]+)*";
var urlchar = "[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*";
var dataurl = "data:(?:" + mediaType + ")?(?:;base64)?," + urlchar;
regex = "(?:" + regex + ")|(?:^" + dataurl + "$)";
}
var PATTERN = new RegExp(regex, "i");
if (!PATTERN.exec(value2)) {
return message;
}
},
type: v2.extend(function(value2, originalOptions, attribute, attributes, globalOptions) {
if (v2.isString(originalOptions)) {
originalOptions = { type: originalOptions };
}
if (!v2.isDefined(value2)) {
return;
}
var options2 = v2.extend({}, this.options, originalOptions);
var type2 = options2.type;
if (!v2.isDefined(type2)) {
throw new Error("No type was specified");
}
var check2;
if (v2.isFunction(type2)) {
check2 = type2;
} else {
check2 = this.types[type2];
}
if (!v2.isFunction(check2)) {
throw new Error("validate.validators.type.types." + type2 + " must be a function.");
}
if (!check2(value2, options2, attribute, attributes, globalOptions)) {
var message = originalOptions.message || this.messages[type2] || this.message || options2.message || (v2.isFunction(type2) ? "must be of the correct type" : "must be of type %{type}");
if (v2.isFunction(message)) {
message = message(value2, originalOptions, attribute, attributes, globalOptions);
}
return v2.format(message, { attribute: v2.prettify(attribute), type: type2 });
}
}, {
types: {
object: function(value2) {
return v2.isObject(value2) && !v2.isArray(value2);
},
array: v2.isArray,
integer: v2.isInteger,
number: v2.isNumber,
string: v2.isString,
date: v2.isDate,
boolean: v2.isBoolean
},
messages: {}
})
};
validate2.formatters = {
detailed: function(errors) {
return errors;
},
flat: v2.flattenErrorsToArray,
grouped: function(errors) {
var attr2;
errors = v2.groupErrorsByAttribute(errors);
for (attr2 in errors) {
errors[attr2] = v2.flattenErrorsToArray(errors[attr2]);
}
return errors;
},
constraint: function(errors) {
var attr2;
errors = v2.groupErrorsByAttribute(errors);
for (attr2 in errors) {
errors[attr2] = errors[attr2].map(function(result) {
return result.validator;
}).sort();
}
return errors;
}
};
validate2.exposeModule(validate2, this, exports2, module2, define2);
}).call(
commonjsGlobal$1,
/* istanbul ignore next */
exports,
/* istanbul ignore next */
module,
null
);
})(validate, validate.exports);
var validateExports = validate.exports;
var toConsumableArray = { exports: {} };
var arrayWithoutHoles = { exports: {} };
var arrayLikeToArray = { exports: {} };
var hasRequiredArrayLikeToArray;
function requireArrayLikeToArray() {
if (hasRequiredArrayLikeToArray)
return arrayLikeToArray.exports;
hasRequiredArrayLikeToArray = 1;
(function(module) {
function _arrayLikeToArray2(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++)
arr22[i2] = arr2[i2];
return arr22;
}
module.exports = _arrayLikeToArray2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(arrayLikeToArray);
return arrayLikeToArray.exports;
}
var hasRequiredArrayWithoutHoles;
function requireArrayWithoutHoles() {
if (hasRequiredArrayWithoutHoles)
return arrayWithoutHoles.exports;
hasRequiredArrayWithoutHoles = 1;
(function(module) {
var arrayLikeToArray2 = requireArrayLikeToArray();
function _arrayWithoutHoles2(arr2) {
if (Array.isArray(arr2))
return arrayLikeToArray2(arr2);
}
module.exports = _arrayWithoutHoles2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(arrayWithoutHoles);
return arrayWithoutHoles.exports;
}
var iterableToArray = { exports: {} };
var hasRequiredIterableToArray;
function requireIterableToArray() {
if (hasRequiredIterableToArray)
return iterableToArray.exports;
hasRequiredIterableToArray = 1;
(function(module) {
function _iterableToArray2(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
module.exports = _iterableToArray2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(iterableToArray);
return iterableToArray.exports;
}
var unsupportedIterableToArray = { exports: {} };
var hasRequiredUnsupportedIterableToArray;
function requireUnsupportedIterableToArray() {
if (hasRequiredUnsupportedIterableToArray)
return unsupportedIterableToArray.exports;
hasRequiredUnsupportedIterableToArray = 1;
(function(module) {
var arrayLikeToArray2 = requireArrayLikeToArray();
function _unsupportedIterableToArray2(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return arrayLikeToArray2(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return arrayLikeToArray2(o2, minLen);
}
module.exports = _unsupportedIterableToArray2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(unsupportedIterableToArray);
return unsupportedIterableToArray.exports;
}
var nonIterableSpread = { exports: {} };
var hasRequiredNonIterableSpread;
function requireNonIterableSpread() {
if (hasRequiredNonIterableSpread)
return nonIterableSpread.exports;
hasRequiredNonIterableSpread = 1;
(function(module) {
function _nonIterableSpread2() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(nonIterableSpread);
return nonIterableSpread.exports;
}
var hasRequiredToConsumableArray;
function requireToConsumableArray() {
if (hasRequiredToConsumableArray)
return toConsumableArray.exports;
hasRequiredToConsumableArray = 1;
(function(module) {
var arrayWithoutHoles2 = requireArrayWithoutHoles();
var iterableToArray2 = requireIterableToArray();
var unsupportedIterableToArray2 = requireUnsupportedIterableToArray();
var nonIterableSpread2 = requireNonIterableSpread();
function _toConsumableArray2(arr2) {
return arrayWithoutHoles2(arr2) || iterableToArray2(arr2) || unsupportedIterableToArray2(arr2) || nonIterableSpread2();
}
module.exports = _toConsumableArray2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(toConsumableArray);
return toConsumableArray.exports;
}
var colorString = { exports: {} };
var colorName;
var hasRequiredColorName;
function requireColorName() {
if (hasRequiredColorName)
return colorName;
hasRequiredColorName = 1;
colorName = {
"aliceblue": [240, 248, 255],
"antiquewhite": [250, 235, 215],
"aqua": [0, 255, 255],
"aquamarine": [127, 255, 212],
"azure": [240, 255, 255],
"beige": [245, 245, 220],
"bisque": [255, 228, 196],
"black": [0, 0, 0],
"blanchedalmond": [255, 235, 205],
"blue": [0, 0, 255],
"blueviolet": [138, 43, 226],
"brown": [165, 42, 42],
"burlywood": [222, 184, 135],
"cadetblue": [95, 158, 160],
"chartreuse": [127, 255, 0],
"chocolate": [210, 105, 30],
"coral": [255, 127, 80],
"cornflowerblue": [100, 149, 237],
"cornsilk": [255, 248, 220],
"crimson": [220, 20, 60],
"cyan": [0, 255, 255],
"darkblue": [0, 0, 139],
"darkcyan": [0, 139, 139],
"darkgoldenrod": [184, 134, 11],
"darkgray": [169, 169, 169],
"darkgreen": [0, 100, 0],
"darkgrey": [169, 169, 169],
"darkkhaki": [189, 183, 107],
"darkmagenta": [139, 0, 139],
"darkolivegreen": [85, 107, 47],
"darkorange": [255, 140, 0],
"darkorchid": [153, 50, 204],
"darkred": [139, 0, 0],
"darksalmon": [233, 150, 122],
"darkseagreen": [143, 188, 143],
"darkslateblue": [72, 61, 139],
"darkslategray": [47, 79, 79],
"darkslategrey": [47, 79, 79],
"darkturquoise": [0, 206, 209],
"darkviolet": [148, 0, 211],
"deeppink": [255, 20, 147],
"deepskyblue": [0, 191, 255],
"dimgray": [105, 105, 105],
"dimgrey": [105, 105, 105],
"dodgerblue": [30, 144, 255],
"firebrick": [178, 34, 34],
"floralwhite": [255, 250, 240],
"forestgreen": [34, 139, 34],
"fuchsia": [255, 0, 255],
"gainsboro": [220, 220, 220],
"ghostwhite": [248, 248, 255],
"gold": [255, 215, 0],
"goldenrod": [218, 165, 32],
"gray": [128, 128, 128],
"green": [0, 128, 0],
"greenyellow": [173, 255, 47],
"grey": [128, 128, 128],
"honeydew": [240, 255, 240],
"hotpink": [255, 105, 180],
"indianred": [205, 92, 92],
"indigo": [75, 0, 130],
"ivory": [255, 255, 240],
"khaki": [240, 230, 140],
"lavender": [230, 230, 250],
"lavenderblush": [255, 240, 245],
"lawngreen": [124, 252, 0],
"lemonchiffon": [255, 250, 205],
"lightblue": [173, 216, 230],
"lightcoral": [240, 128, 128],
"lightcyan": [224, 255, 255],
"lightgoldenrodyellow": [250, 250, 210],
"lightgray": [211, 211, 211],
"lightgreen": [144, 238, 144],
"lightgrey": [211, 211, 211],
"lightpink": [255, 182, 193],
"lightsalmon": [255, 160, 122],
"lightseagreen": [32, 178, 170],
"lightskyblue": [135, 206, 250],
"lightslategray": [119, 136, 153],
"lightslategrey": [119, 136, 153],
"lightsteelblue": [176, 196, 222],
"lightyellow": [255, 255, 224],
"lime": [0, 255, 0],
"limegreen": [50, 205, 50],
"linen": [250, 240, 230],
"magenta": [255, 0, 255],
"maroon": [128, 0, 0],
"mediumaquamarine": [102, 205, 170],
"mediumblue": [0, 0, 205],
"mediumorchid": [186, 85, 211],
"mediumpurple": [147, 112, 219],
"mediumseagreen": [60, 179, 113],
"mediumslateblue": [123, 104, 238],
"mediumspringgreen": [0, 250, 154],
"mediumturquoise": [72, 209, 204],
"mediumvioletred": [199, 21, 133],
"midnightblue": [25, 25, 112],
"mintcream": [245, 255, 250],
"mistyrose": [255, 228, 225],
"moccasin": [255, 228, 181],
"navajowhite": [255, 222, 173],
"navy": [0, 0, 128],
"oldlace": [253, 245, 230],
"olive": [128, 128, 0],
"olivedrab": [107, 142, 35],
"orange": [255, 165, 0],
"orangered": [255, 69, 0],
"orchid": [218, 112, 214],
"palegoldenrod": [238, 232, 170],
"palegreen": [152, 251, 152],
"paleturquoise": [175, 238, 238],
"palevioletred": [219, 112, 147],
"papayawhip": [255, 239, 213],
"peachpuff": [255, 218, 185],
"peru": [205, 133, 63],
"pink": [255, 192, 203],
"plum": [221, 160, 221],
"powderblue": [176, 224, 230],
"purple": [128, 0, 128],
"rebeccapurple": [102, 51, 153],
"red": [255, 0, 0],
"rosybrown": [188, 143, 143],
"royalblue": [65, 105, 225],
"saddlebrown": [139, 69, 19],
"salmon": [250, 128, 114],
"sandybrown": [244, 164, 96],
"seagreen": [46, 139, 87],
"seashell": [255, 245, 238],
"sienna": [160, 82, 45],
"silver": [192, 192, 192],
"skyblue": [135, 206, 235],
"slateblue": [106, 90, 205],
"slategray": [112, 128, 144],
"slategrey": [112, 128, 144],
"snow": [255, 250, 250],
"springgreen": [0, 255, 127],
"steelblue": [70, 130, 180],
"tan": [210, 180, 140],
"teal": [0, 128, 128],
"thistle": [216, 191, 216],
"tomato": [255, 99, 71],
"turquoise": [64, 224, 208],
"violet": [238, 130, 238],
"wheat": [245, 222, 179],
"white": [255, 255, 255],
"whitesmoke": [245, 245, 245],
"yellow": [255, 255, 0],
"yellowgreen": [154, 205, 50]
};
return colorName;
}
var simpleSwizzle = { exports: {} };
var isArrayish;
var hasRequiredIsArrayish;
function requireIsArrayish() {
if (hasRequiredIsArrayish)
return isArrayish;
hasRequiredIsArrayish = 1;
isArrayish = function isArrayish2(obj) {
if (!obj || typeof obj === "string") {
return false;
}
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
};
return isArrayish;
}
var hasRequiredSimpleSwizzle;
function requireSimpleSwizzle() {
if (hasRequiredSimpleSwizzle)
return simpleSwizzle.exports;
hasRequiredSimpleSwizzle = 1;
var isArrayish2 = requireIsArrayish();
var concat2 = Array.prototype.concat;
var slice2 = Array.prototype.slice;
var swizzle = simpleSwizzle.exports = function swizzle2(args) {
var results = [];
for (var i2 = 0, len = args.length; i2 < len; i2++) {
var arg = args[i2];
if (isArrayish2(arg)) {
results = concat2.call(results, slice2.call(arg));
} else {
results.push(arg);
}
}
return results;
};
swizzle.wrap = function(fn8) {
return function() {
return fn8(swizzle(arguments));
};
};
return simpleSwizzle.exports;
}
var hasRequiredColorString;
function requireColorString() {
if (hasRequiredColorString)
return colorString.exports;
hasRequiredColorString = 1;
var colorNames = requireColorName();
var swizzle = requireSimpleSwizzle();
var hasOwnProperty2 = Object.hasOwnProperty;
var reverseNames = /* @__PURE__ */ Object.create(null);
for (var name in colorNames) {
if (hasOwnProperty2.call(colorNames, name)) {
reverseNames[colorNames[name]] = name;
}
}
var cs2 = colorString.exports = {
to: {},
get: {}
};
cs2.get = function(string2) {
var prefix2 = string2.substring(0, 3).toLowerCase();
var val;
var model;
switch (prefix2) {
case "hsl":
val = cs2.get.hsl(string2);
model = "hsl";
break;
case "hwb":
val = cs2.get.hwb(string2);
model = "hwb";
break;
default:
val = cs2.get.rgb(string2);
model = "rgb";
break;
}
if (!val) {
return null;
}
return { model, value: val };
};
cs2.get.rgb = function(string2) {
if (!string2) {
return null;
}
var abbr = /^#([a-f0-9]{3,4})$/i;
var hex2 = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
var rgba2 = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
var keyword = /^(\w+)$/;
var rgb2 = [0, 0, 0, 1];
var match2;
var i2;
var hexAlpha;
if (match2 = string2.match(hex2)) {
hexAlpha = match2[2];
match2 = match2[1];
for (i2 = 0; i2 < 3; i2++) {
var i22 = i2 * 2;
rgb2[i2] = parseInt(match2.slice(i22, i22 + 2), 16);
}
if (hexAlpha) {
rgb2[3] = parseInt(hexAlpha, 16) / 255;
}
} else if (match2 = string2.match(abbr)) {
match2 = match2[1];
hexAlpha = match2[3];
for (i2 = 0; i2 < 3; i2++) {
rgb2[i2] = parseInt(match2[i2] + match2[i2], 16);
}
if (hexAlpha) {
rgb2[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
}
} else if (match2 = string2.match(rgba2)) {
for (i2 = 0; i2 < 3; i2++) {
rgb2[i2] = parseInt(match2[i2 + 1], 0);
}
if (match2[4]) {
if (match2[5]) {
rgb2[3] = parseFloat(match2[4]) * 0.01;
} else {
rgb2[3] = parseFloat(match2[4]);
}
}
} else if (match2 = string2.match(per)) {
for (i2 = 0; i2 < 3; i2++) {
rgb2[i2] = Math.round(parseFloat(match2[i2 + 1]) * 2.55);
}
if (match2[4]) {
if (match2[5]) {
rgb2[3] = parseFloat(match2[4]) * 0.01;
} else {
rgb2[3] = parseFloat(match2[4]);
}
}
} else if (match2 = string2.match(keyword)) {
if (match2[1] === "transparent") {
return [0, 0, 0, 0];
}
if (!hasOwnProperty2.call(colorNames, match2[1])) {
return null;
}
rgb2 = colorNames[match2[1]];
rgb2[3] = 1;
return rgb2;
} else {
return null;
}
for (i2 = 0; i2 < 3; i2++) {
rgb2[i2] = clamp2(rgb2[i2], 0, 255);
}
rgb2[3] = clamp2(rgb2[3], 0, 1);
return rgb2;
};
cs2.get.hsl = function(string2) {
if (!string2) {
return null;
}
var hsl2 = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
var match2 = string2.match(hsl2);
if (match2) {
var alpha = parseFloat(match2[4]);
var h2 = (parseFloat(match2[1]) % 360 + 360) % 360;
var s2 = clamp2(parseFloat(match2[2]), 0, 100);
var l2 = clamp2(parseFloat(match2[3]), 0, 100);
var a2 = clamp2(isNaN(alpha) ? 1 : alpha, 0, 1);
return [h2, s2, l2, a2];
}
return null;
};
cs2.get.hwb = function(string2) {
if (!string2) {
return null;
}
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
var match2 = string2.match(hwb);
if (match2) {
var alpha = parseFloat(match2[4]);
var h2 = (parseFloat(match2[1]) % 360 + 360) % 360;
var w2 = clamp2(parseFloat(match2[2]), 0, 100);
var b2 = clamp2(parseFloat(match2[3]), 0, 100);
var a2 = clamp2(isNaN(alpha) ? 1 : alpha, 0, 1);
return [h2, w2, b2, a2];
}
return null;
};
cs2.to.hex = function() {
var rgba2 = swizzle(arguments);
return "#" + hexDouble(rgba2[0]) + hexDouble(rgba2[1]) + hexDouble(rgba2[2]) + (rgba2[3] < 1 ? hexDouble(Math.round(rgba2[3] * 255)) : "");
};
cs2.to.rgb = function() {
var rgba2 = swizzle(arguments);
return rgba2.length < 4 || rgba2[3] === 1 ? "rgb(" + Math.round(rgba2[0]) + ", " + Math.round(rgba2[1]) + ", " + Math.round(rgba2[2]) + ")" : "rgba(" + Math.round(rgba2[0]) + ", " + Math.round(rgba2[1]) + ", " + Math.round(rgba2[2]) + ", " + rgba2[3] + ")";
};
cs2.to.rgb.percent = function() {
var rgba2 = swizzle(arguments);
var r2 = Math.round(rgba2[0] / 255 * 100);
var g2 = Math.round(rgba2[1] / 255 * 100);
var b2 = Math.round(rgba2[2] / 255 * 100);
return rgba2.length < 4 || rgba2[3] === 1 ? "rgb(" + r2 + "%, " + g2 + "%, " + b2 + "%)" : "rgba(" + r2 + "%, " + g2 + "%, " + b2 + "%, " + rgba2[3] + ")";
};
cs2.to.hsl = function() {
var hsla2 = swizzle(arguments);
return hsla2.length < 4 || hsla2[3] === 1 ? "hsl(" + hsla2[0] + ", " + hsla2[1] + "%, " + hsla2[2] + "%)" : "hsla(" + hsla2[0] + ", " + hsla2[1] + "%, " + hsla2[2] + "%, " + hsla2[3] + ")";
};
cs2.to.hwb = function() {
var hwba = swizzle(arguments);
var a2 = "";
if (hwba.length >= 4 && hwba[3] !== 1) {
a2 = ", " + hwba[3];
}
return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a2 + ")";
};
cs2.to.keyword = function(rgb2) {
return reverseNames[rgb2.slice(0, 3)];
};
function clamp2(num, min2, max2) {
return Math.min(Math.max(min2, num), max2);
}
function hexDouble(num) {
var str = Math.round(num).toString(16).toUpperCase();
return str.length < 2 ? "0" + str : str;
}
return colorString.exports;
}
var conversions = { exports: {} };
var hasRequiredConversions;
function requireConversions() {
if (hasRequiredConversions)
return conversions.exports;
hasRequiredConversions = 1;
var cssKeywords = requireColorName();
var reverseKeywords = {};
for (var key2 in cssKeywords) {
if (cssKeywords.hasOwnProperty(key2)) {
reverseKeywords[cssKeywords[key2]] = key2;
}
}
var convert = conversions.exports = {
rgb: { channels: 3, labels: "rgb" },
hsl: { channels: 3, labels: "hsl" },
hsv: { channels: 3, labels: "hsv" },
hwb: { channels: 3, labels: "hwb" },
cmyk: { channels: 4, labels: "cmyk" },
xyz: { channels: 3, labels: "xyz" },
lab: { channels: 3, labels: "lab" },
lch: { channels: 3, labels: "lch" },
hex: { channels: 1, labels: ["hex"] },
keyword: { channels: 1, labels: ["keyword"] },
ansi16: { channels: 1, labels: ["ansi16"] },
ansi256: { channels: 1, labels: ["ansi256"] },
hcg: { channels: 3, labels: ["h", "c", "g"] },
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
gray: { channels: 1, labels: ["gray"] }
};
for (var model in convert) {
if (convert.hasOwnProperty(model)) {
if (!("channels" in convert[model])) {
throw new Error("missing channels property: " + model);
}
if (!("labels" in convert[model])) {
throw new Error("missing channel labels property: " + model);
}
if (convert[model].labels.length !== convert[model].channels) {
throw new Error("channel and label counts mismatch: " + model);
}
var channels = convert[model].channels;
var labels = convert[model].labels;
delete convert[model].channels;
delete convert[model].labels;
Object.defineProperty(convert[model], "channels", { value: channels });
Object.defineProperty(convert[model], "labels", { value: labels });
}
}
convert.rgb.hsl = function(rgb2) {
var r2 = rgb2[0] / 255;
var g2 = rgb2[1] / 255;
var b2 = rgb2[2] / 255;
var min2 = Math.min(r2, g2, b2);
var max2 = Math.max(r2, g2, b2);
var delta = max2 - min2;
var h2;
var s2;
var l2;
if (max2 === min2) {
h2 = 0;
} else if (r2 === max2) {
h2 = (g2 - b2) / delta;
} else if (g2 === max2) {
h2 = 2 + (b2 - r2) / delta;
} else if (b2 === max2) {
h2 = 4 + (r2 - g2) / delta;
}
h2 = Math.min(h2 * 60, 360);
if (h2 < 0) {
h2 += 360;
}
l2 = (min2 + max2) / 2;
if (max2 === min2) {
s2 = 0;
} else if (l2 <= 0.5) {
s2 = delta / (max2 + min2);
} else {
s2 = delta / (2 - max2 - min2);
}
return [h2, s2 * 100, l2 * 100];
};
convert.rgb.hsv = function(rgb2) {
var rdif;
var gdif;
var bdif;
var h2;
var s2;
var r2 = rgb2[0] / 255;
var g2 = rgb2[1] / 255;
var b2 = rgb2[2] / 255;
var v2 = Math.max(r2, g2, b2);
var diff2 = v2 - Math.min(r2, g2, b2);
var diffc = function(c2) {
return (v2 - c2) / 6 / diff2 + 1 / 2;
};
if (diff2 === 0) {
h2 = s2 = 0;
} else {
s2 = diff2 / v2;
rdif = diffc(r2);
gdif = diffc(g2);
bdif = diffc(b2);
if (r2 === v2) {
h2 = bdif - gdif;
} else if (g2 === v2) {
h2 = 1 / 3 + rdif - bdif;
} else if (b2 === v2) {
h2 = 2 / 3 + gdif - rdif;
}
if (h2 < 0) {
h2 += 1;
} else if (h2 > 1) {
h2 -= 1;
}
}
return [
h2 * 360,
s2 * 100,
v2 * 100
];
};
convert.rgb.hwb = function(rgb2) {
var r2 = rgb2[0];
var g2 = rgb2[1];
var b2 = rgb2[2];
var h2 = convert.rgb.hsl(rgb2)[0];
var w2 = 1 / 255 * Math.min(r2, Math.min(g2, b2));
b2 = 1 - 1 / 255 * Math.max(r2, Math.max(g2, b2));
return [h2, w2 * 100, b2 * 100];
};
convert.rgb.cmyk = function(rgb2) {
var r2 = rgb2[0] / 255;
var g2 = rgb2[1] / 255;
var b2 = rgb2[2] / 255;
var c2;
var m2;
var y2;
var k2;
k2 = Math.min(1 - r2, 1 - g2, 1 - b2);
c2 = (1 - r2 - k2) / (1 - k2) || 0;
m2 = (1 - g2 - k2) / (1 - k2) || 0;
y2 = (1 - b2 - k2) / (1 - k2) || 0;
return [c2 * 100, m2 * 100, y2 * 100, k2 * 100];
};
function comparativeDistance(x2, y2) {
return Math.pow(x2[0] - y2[0], 2) + Math.pow(x2[1] - y2[1], 2) + Math.pow(x2[2] - y2[2], 2);
}
convert.rgb.keyword = function(rgb2) {
var reversed = reverseKeywords[rgb2];
if (reversed) {
return reversed;
}
var currentClosestDistance = Infinity;
var currentClosestKeyword;
for (var keyword in cssKeywords) {
if (cssKeywords.hasOwnProperty(keyword)) {
var value2 = cssKeywords[keyword];
var distance2 = comparativeDistance(rgb2, value2);
if (distance2 < currentClosestDistance) {
currentClosestDistance = distance2;
currentClosestKeyword = keyword;
}
}
}
return currentClosestKeyword;
};
convert.keyword.rgb = function(keyword) {
return cssKeywords[keyword];
};
convert.rgb.xyz = function(rgb2) {
var r2 = rgb2[0] / 255;
var g2 = rgb2[1] / 255;
var b2 = rgb2[2] / 255;
r2 = r2 > 0.04045 ? Math.pow((r2 + 0.055) / 1.055, 2.4) : r2 / 12.92;
g2 = g2 > 0.04045 ? Math.pow((g2 + 0.055) / 1.055, 2.4) : g2 / 12.92;
b2 = b2 > 0.04045 ? Math.pow((b2 + 0.055) / 1.055, 2.4) : b2 / 12.92;
var x2 = r2 * 0.4124 + g2 * 0.3576 + b2 * 0.1805;
var y2 = r2 * 0.2126 + g2 * 0.7152 + b2 * 0.0722;
var z2 = r2 * 0.0193 + g2 * 0.1192 + b2 * 0.9505;
return [x2 * 100, y2 * 100, z2 * 100];
};
convert.rgb.lab = function(rgb2) {
var xyz = convert.rgb.xyz(rgb2);
var x2 = xyz[0];
var y2 = xyz[1];
var z2 = xyz[2];
var l2;
var a2;
var b2;
x2 /= 95.047;
y2 /= 100;
z2 /= 108.883;
x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
l2 = 116 * y2 - 16;
a2 = 500 * (x2 - y2);
b2 = 200 * (y2 - z2);
return [l2, a2, b2];
};
convert.hsl.rgb = function(hsl2) {
var h2 = hsl2[0] / 360;
var s2 = hsl2[1] / 100;
var l2 = hsl2[2] / 100;
var t12;
var t22;
var t32;
var rgb2;
var val;
if (s2 === 0) {
val = l2 * 255;
return [val, val, val];
}
if (l2 < 0.5) {
t22 = l2 * (1 + s2);
} else {
t22 = l2 + s2 - l2 * s2;
}
t12 = 2 * l2 - t22;
rgb2 = [0, 0, 0];
for (var i2 = 0; i2 < 3; i2++) {
t32 = h2 + 1 / 3 * -(i2 - 1);
if (t32 < 0) {
t32++;
}
if (t32 > 1) {
t32--;
}
if (6 * t32 < 1) {
val = t12 + (t22 - t12) * 6 * t32;
} else if (2 * t32 < 1) {
val = t22;
} else if (3 * t32 < 2) {
val = t12 + (t22 - t12) * (2 / 3 - t32) * 6;
} else {
val = t12;
}
rgb2[i2] = val * 255;
}
return rgb2;
};
convert.hsl.hsv = function(hsl2) {
var h2 = hsl2[0];
var s2 = hsl2[1] / 100;
var l2 = hsl2[2] / 100;
var smin = s2;
var lmin = Math.max(l2, 0.01);
var sv;
var v2;
l2 *= 2;
s2 *= l2 <= 1 ? l2 : 2 - l2;
smin *= lmin <= 1 ? lmin : 2 - lmin;
v2 = (l2 + s2) / 2;
sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s2 / (l2 + s2);
return [h2, sv * 100, v2 * 100];
};
convert.hsv.rgb = function(hsv) {
var h2 = hsv[0] / 60;
var s2 = hsv[1] / 100;
var v2 = hsv[2] / 100;
var hi2 = Math.floor(h2) % 6;
var f2 = h2 - Math.floor(h2);
var p2 = 255 * v2 * (1 - s2);
var q2 = 255 * v2 * (1 - s2 * f2);
var t5 = 255 * v2 * (1 - s2 * (1 - f2));
v2 *= 255;
switch (hi2) {
case 0:
return [v2, t5, p2];
case 1:
return [q2, v2, p2];
case 2:
return [p2, v2, t5];
case 3:
return [p2, q2, v2];
case 4:
return [t5, p2, v2];
case 5:
return [v2, p2, q2];
}
};
convert.hsv.hsl = function(hsv) {
var h2 = hsv[0];
var s2 = hsv[1] / 100;
var v2 = hsv[2] / 100;
var vmin = Math.max(v2, 0.01);
var lmin;
var sl2;
var l2;
l2 = (2 - s2) * v2;
lmin = (2 - s2) * vmin;
sl2 = s2 * vmin;
sl2 /= lmin <= 1 ? lmin : 2 - lmin;
sl2 = sl2 || 0;
l2 /= 2;
return [h2, sl2 * 100, l2 * 100];
};
convert.hwb.rgb = function(hwb) {
var h2 = hwb[0] / 360;
var wh2 = hwb[1] / 100;
var bl2 = hwb[2] / 100;
var ratio = wh2 + bl2;
var i2;
var v2;
var f2;
var n2;
if (ratio > 1) {
wh2 /= ratio;
bl2 /= ratio;
}
i2 = Math.floor(6 * h2);
v2 = 1 - bl2;
f2 = 6 * h2 - i2;
if ((i2 & 1) !== 0) {
f2 = 1 - f2;
}
n2 = wh2 + f2 * (v2 - wh2);
var r2;
var g2;
var b2;
switch (i2) {
default:
case 6:
case 0:
r2 = v2;
g2 = n2;
b2 = wh2;
break;
case 1:
r2 = n2;
g2 = v2;
b2 = wh2;
break;
case 2:
r2 = wh2;
g2 = v2;
b2 = n2;
break;
case 3:
r2 = wh2;
g2 = n2;
b2 = v2;
break;
case 4:
r2 = n2;
g2 = wh2;
b2 = v2;
break;
case 5:
r2 = v2;
g2 = wh2;
b2 = n2;
break;
}
return [r2 * 255, g2 * 255, b2 * 255];
};
convert.cmyk.rgb = function(cmyk) {
var c2 = cmyk[0] / 100;
var m2 = cmyk[1] / 100;
var y2 = cmyk[2] / 100;
var k2 = cmyk[3] / 100;
var r2;
var g2;
var b2;
r2 = 1 - Math.min(1, c2 * (1 - k2) + k2);
g2 = 1 - Math.min(1, m2 * (1 - k2) + k2);
b2 = 1 - Math.min(1, y2 * (1 - k2) + k2);
return [r2 * 255, g2 * 255, b2 * 255];
};
convert.xyz.rgb = function(xyz) {
var x2 = xyz[0] / 100;
var y2 = xyz[1] / 100;
var z2 = xyz[2] / 100;
var r2;
var g2;
var b2;
r2 = x2 * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
g2 = x2 * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
b2 = x2 * 0.0557 + y2 * -0.204 + z2 * 1.057;
r2 = r2 > 31308e-7 ? 1.055 * Math.pow(r2, 1 / 2.4) - 0.055 : r2 * 12.92;
g2 = g2 > 31308e-7 ? 1.055 * Math.pow(g2, 1 / 2.4) - 0.055 : g2 * 12.92;
b2 = b2 > 31308e-7 ? 1.055 * Math.pow(b2, 1 / 2.4) - 0.055 : b2 * 12.92;
r2 = Math.min(Math.max(0, r2), 1);
g2 = Math.min(Math.max(0, g2), 1);
b2 = Math.min(Math.max(0, b2), 1);
return [r2 * 255, g2 * 255, b2 * 255];
};
convert.xyz.lab = function(xyz) {
var x2 = xyz[0];
var y2 = xyz[1];
var z2 = xyz[2];
var l2;
var a2;
var b2;
x2 /= 95.047;
y2 /= 100;
z2 /= 108.883;
x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
l2 = 116 * y2 - 16;
a2 = 500 * (x2 - y2);
b2 = 200 * (y2 - z2);
return [l2, a2, b2];
};
convert.lab.xyz = function(lab2) {
var l2 = lab2[0];
var a2 = lab2[1];
var b2 = lab2[2];
var x2;
var y2;
var z2;
y2 = (l2 + 16) / 116;
x2 = a2 / 500 + y2;
z2 = y2 - b2 / 200;
var y22 = Math.pow(y2, 3);
var x22 = Math.pow(x2, 3);
var z22 = Math.pow(z2, 3);
y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787;
x2 = x22 > 8856e-6 ? x22 : (x2 - 16 / 116) / 7.787;
z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
x2 *= 95.047;
y2 *= 100;
z2 *= 108.883;
return [x2, y2, z2];
};
convert.lab.lch = function(lab2) {
var l2 = lab2[0];
var a2 = lab2[1];
var b2 = lab2[2];
var hr2;
var h2;
var c2;
hr2 = Math.atan2(b2, a2);
h2 = hr2 * 360 / 2 / Math.PI;
if (h2 < 0) {
h2 += 360;
}
c2 = Math.sqrt(a2 * a2 + b2 * b2);
return [l2, c2, h2];
};
convert.lch.lab = function(lch) {
var l2 = lch[0];
var c2 = lch[1];
var h2 = lch[2];
var a2;
var b2;
var hr2;
hr2 = h2 / 360 * 2 * Math.PI;
a2 = c2 * Math.cos(hr2);
b2 = c2 * Math.sin(hr2);
return [l2, a2, b2];
};
convert.rgb.ansi16 = function(args) {
var r2 = args[0];
var g2 = args[1];
var b2 = args[2];
var value2 = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
value2 = Math.round(value2 / 50);
if (value2 === 0) {
return 30;
}
var ansi = 30 + (Math.round(b2 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
if (value2 === 2) {
ansi += 60;
}
return ansi;
};
convert.hsv.ansi16 = function(args) {
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
};
convert.rgb.ansi256 = function(args) {
var r2 = args[0];
var g2 = args[1];
var b2 = args[2];
if (r2 === g2 && g2 === b2) {
if (r2 < 8) {
return 16;
}
if (r2 > 248) {
return 231;
}
return Math.round((r2 - 8) / 247 * 24) + 232;
}
var ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b2 / 255 * 5);
return ansi;
};
convert.ansi16.rgb = function(args) {
var color2 = args % 10;
if (color2 === 0 || color2 === 7) {
if (args > 50) {
color2 += 3.5;
}
color2 = color2 / 10.5 * 255;
return [color2, color2, color2];
}
var mult2 = (~~(args > 50) + 1) * 0.5;
var r2 = (color2 & 1) * mult2 * 255;
var g2 = (color2 >> 1 & 1) * mult2 * 255;
var b2 = (color2 >> 2 & 1) * mult2 * 255;
return [r2, g2, b2];
};
convert.ansi256.rgb = function(args) {
if (args >= 232) {
var c2 = (args - 232) * 10 + 8;
return [c2, c2, c2];
}
args -= 16;
var rem2;
var r2 = Math.floor(args / 36) / 5 * 255;
var g2 = Math.floor((rem2 = args % 36) / 6) / 5 * 255;
var b2 = rem2 % 6 / 5 * 255;
return [r2, g2, b2];
};
convert.rgb.hex = function(args) {
var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
var string2 = integer.toString(16).toUpperCase();
return "000000".substring(string2.length) + string2;
};
convert.hex.rgb = function(args) {
var match2 = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
if (!match2) {
return [0, 0, 0];
}
var colorString2 = match2[0];
if (match2[0].length === 3) {
colorString2 = colorString2.split("").map(function(char2) {
return char2 + char2;
}).join("");
}
var integer = parseInt(colorString2, 16);
var r2 = integer >> 16 & 255;
var g2 = integer >> 8 & 255;
var b2 = integer & 255;
return [r2, g2, b2];
};
convert.rgb.hcg = function(rgb2) {
var r2 = rgb2[0] / 255;
var g2 = rgb2[1] / 255;
var b2 = rgb2[2] / 255;
var max2 = Math.max(Math.max(r2, g2), b2);
var min2 = Math.min(Math.min(r2, g2), b2);
var chroma = max2 - min2;
var grayscale;
var hue2;
if (chroma < 1) {
grayscale = min2 / (1 - chroma);
} else {
grayscale = 0;
}
if (chroma <= 0) {
hue2 = 0;
} else if (max2 === r2) {
hue2 = (g2 - b2) / chroma % 6;
} else if (max2 === g2) {
hue2 = 2 + (b2 - r2) / chroma;
} else {
hue2 = 4 + (r2 - g2) / chroma + 4;
}
hue2 /= 6;
hue2 %= 1;
return [hue2 * 360, chroma * 100, grayscale * 100];
};
convert.hsl.hcg = function(hsl2) {
var s2 = hsl2[1] / 100;
var l2 = hsl2[2] / 100;
var c2 = 1;
var f2 = 0;
if (l2 < 0.5) {
c2 = 2 * s2 * l2;
} else {
c2 = 2 * s2 * (1 - l2);
}
if (c2 < 1) {
f2 = (l2 - 0.5 * c2) / (1 - c2);
}
return [hsl2[0], c2 * 100, f2 * 100];
};
convert.hsv.hcg = function(hsv) {
var s2 = hsv[1] / 100;
var v2 = hsv[2] / 100;
var c2 = s2 * v2;
var f2 = 0;
if (c2 < 1) {
f2 = (v2 - c2) / (1 - c2);
}
return [hsv[0], c2 * 100, f2 * 100];
};
convert.hcg.rgb = function(hcg) {
var h2 = hcg[0] / 360;
var c2 = hcg[1] / 100;
var g2 = hcg[2] / 100;
if (c2 === 0) {
return [g2 * 255, g2 * 255, g2 * 255];
}
var pure = [0, 0, 0];
var hi2 = h2 % 1 * 6;
var v2 = hi2 % 1;
var w2 = 1 - v2;
var mg2 = 0;
switch (Math.floor(hi2)) {
case 0:
pure[0] = 1;
pure[1] = v2;
pure[2] = 0;
break;
case 1:
pure[0] = w2;
pure[1] = 1;
pure[2] = 0;
break;
case 2:
pure[0] = 0;
pure[1] = 1;
pure[2] = v2;
break;
case 3:
pure[0] = 0;
pure[1] = w2;
pure[2] = 1;
break;
case 4:
pure[0] = v2;
pure[1] = 0;
pure[2] = 1;
break;
default:
pure[0] = 1;
pure[1] = 0;
pure[2] = w2;
}
mg2 = (1 - c2) * g2;
return [
(c2 * pure[0] + mg2) * 255,
(c2 * pure[1] + mg2) * 255,
(c2 * pure[2] + mg2) * 255
];
};
convert.hcg.hsv = function(hcg) {
var c2 = hcg[1] / 100;
var g2 = hcg[2] / 100;
var v2 = c2 + g2 * (1 - c2);
var f2 = 0;
if (v2 > 0) {
f2 = c2 / v2;
}
return [hcg[0], f2 * 100, v2 * 100];
};
convert.hcg.hsl = function(hcg) {
var c2 = hcg[1] / 100;
var g2 = hcg[2] / 100;
var l2 = g2 * (1 - c2) + 0.5 * c2;
var s2 = 0;
if (l2 > 0 && l2 < 0.5) {
s2 = c2 / (2 * l2);
} else if (l2 >= 0.5 && l2 < 1) {
s2 = c2 / (2 * (1 - l2));
}
return [hcg[0], s2 * 100, l2 * 100];
};
convert.hcg.hwb = function(hcg) {
var c2 = hcg[1] / 100;
var g2 = hcg[2] / 100;
var v2 = c2 + g2 * (1 - c2);
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
};
convert.hwb.hcg = function(hwb) {
var w2 = hwb[1] / 100;
var b2 = hwb[2] / 100;
var v2 = 1 - b2;
var c2 = v2 - w2;
var g2 = 0;
if (c2 < 1) {
g2 = (v2 - c2) / (1 - c2);
}
return [hwb[0], c2 * 100, g2 * 100];
};
convert.apple.rgb = function(apple) {
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
};
convert.rgb.apple = function(rgb2) {
return [rgb2[0] / 255 * 65535, rgb2[1] / 255 * 65535, rgb2[2] / 255 * 65535];
};
convert.gray.rgb = function(args) {
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
};
convert.gray.hsl = convert.gray.hsv = function(args) {
return [0, 0, args[0]];
};
convert.gray.hwb = function(gray) {
return [0, 100, gray[0]];
};
convert.gray.cmyk = function(gray) {
return [0, 0, 0, gray[0]];
};
convert.gray.lab = function(gray) {
return [gray[0], 0, 0];
};
convert.gray.hex = function(gray) {
var val = Math.round(gray[0] / 100 * 255) & 255;
var integer = (val << 16) + (val << 8) + val;
var string2 = integer.toString(16).toUpperCase();
return "000000".substring(string2.length) + string2;
};
convert.rgb.gray = function(rgb2) {
var val = (rgb2[0] + rgb2[1] + rgb2[2]) / 3;
return [val / 255 * 100];
};
return conversions.exports;
}
var route;
var hasRequiredRoute;
function requireRoute() {
if (hasRequiredRoute)
return route;
hasRequiredRoute = 1;
var conversions2 = requireConversions();
function buildGraph() {
var graph = {};
var models = Object.keys(conversions2);
for (var len = models.length, i2 = 0; i2 < len; i2++) {
graph[models[i2]] = {
// http://jsperf.com/1-vs-infinity
// micro-opt, but this is simple.
distance: -1,
parent: null
};
}
return graph;
}
function deriveBFS(fromModel) {
var graph = buildGraph();
var queue = [fromModel];
graph[fromModel].distance = 0;
while (queue.length) {
var current = queue.pop();
var adjacents = Object.keys(conversions2[current]);
for (var len = adjacents.length, i2 = 0; i2 < len; i2++) {
var adjacent = adjacents[i2];
var node2 = graph[adjacent];
if (node2.distance === -1) {
node2.distance = graph[current].distance + 1;
node2.parent = current;
queue.unshift(adjacent);
}
}
}
return graph;
}
function link2(from2, to2) {
return function(args) {
return to2(from2(args));
};
}
function wrapConversion(toModel, graph) {
var path2 = [graph[toModel].parent, toModel];
var fn8 = conversions2[graph[toModel].parent][toModel];
var cur = graph[toModel].parent;
while (graph[cur].parent) {
path2.unshift(graph[cur].parent);
fn8 = link2(conversions2[graph[cur].parent][cur], fn8);
cur = graph[cur].parent;
}
fn8.conversion = path2;
return fn8;
}
route = function(fromModel) {
var graph = deriveBFS(fromModel);
var conversion = {};
var models = Object.keys(graph);
for (var len = models.length, i2 = 0; i2 < len; i2++) {
var toModel = models[i2];
var node2 = graph[toModel];
if (node2.parent === null) {
continue;
}
conversion[toModel] = wrapConversion(toModel, graph);
}
return conversion;
};
return route;
}
var colorConvert;
var hasRequiredColorConvert;
function requireColorConvert() {
if (hasRequiredColorConvert)
return colorConvert;
hasRequiredColorConvert = 1;
var conversions2 = requireConversions();
var route2 = requireRoute();
var convert = {};
var models = Object.keys(conversions2);
function wrapRaw(fn8) {
var wrappedFn = function(args) {
if (args === void 0 || args === null) {
return args;
}
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments);
}
return fn8(args);
};
if ("conversion" in fn8) {
wrappedFn.conversion = fn8.conversion;
}
return wrappedFn;
}
function wrapRounded(fn8) {
var wrappedFn = function(args) {
if (args === void 0 || args === null) {
return args;
}
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments);
}
var result = fn8(args);
if (typeof result === "object") {
for (var len = result.length, i2 = 0; i2 < len; i2++) {
result[i2] = Math.round(result[i2]);
}
}
return result;
};
if ("conversion" in fn8) {
wrappedFn.conversion = fn8.conversion;
}
return wrappedFn;
}
models.forEach(function(fromModel) {
convert[fromModel] = {};
Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
var routes = route2(fromModel);
var routeModels = Object.keys(routes);
routeModels.forEach(function(toModel) {
var fn8 = routes[toModel];
convert[fromModel][toModel] = wrapRounded(fn8);
convert[fromModel][toModel].raw = wrapRaw(fn8);
});
});
colorConvert = convert;
return colorConvert;
}
var color$6;
var hasRequiredColor;
function requireColor() {
if (hasRequiredColor)
return color$6;
hasRequiredColor = 1;
var colorString2 = requireColorString();
var convert = requireColorConvert();
var _slice = [].slice;
var skippedModels = [
// to be honest, I don't really feel like keyword belongs in color convert, but eh.
"keyword",
// gray conflicts with some method names, and has its own method defined.
"gray",
// shouldn't really be in color-convert either...
"hex"
];
var hashedModelKeys = {};
Object.keys(convert).forEach(function(model) {
hashedModelKeys[_slice.call(convert[model].labels).sort().join("")] = model;
});
var limiters = {};
function Color2(obj, model) {
if (!(this instanceof Color2)) {
return new Color2(obj, model);
}
if (model && model in skippedModels) {
model = null;
}
if (model && !(model in convert)) {
throw new Error("Unknown model: " + model);
}
var i2;
var channels;
if (obj == null) {
this.model = "rgb";
this.color = [0, 0, 0];
this.valpha = 1;
} else if (obj instanceof Color2) {
this.model = obj.model;
this.color = obj.color.slice();
this.valpha = obj.valpha;
} else if (typeof obj === "string") {
var result = colorString2.get(obj);
if (result === null) {
throw new Error("Unable to parse color from string: " + obj);
}
this.model = result.model;
channels = convert[this.model].channels;
this.color = result.value.slice(0, channels);
this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
} else if (obj.length) {
this.model = model || "rgb";
channels = convert[this.model].channels;
var newArr = _slice.call(obj, 0, channels);
this.color = zeroArray2(newArr, channels);
this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1;
} else if (typeof obj === "number") {
obj &= 16777215;
this.model = "rgb";
this.color = [
obj >> 16 & 255,
obj >> 8 & 255,
obj & 255
];
this.valpha = 1;
} else {
this.valpha = 1;
var keys3 = Object.keys(obj);
if ("alpha" in obj) {
keys3.splice(keys3.indexOf("alpha"), 1);
this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
}
var hashedKeys = keys3.sort().join("");
if (!(hashedKeys in hashedModelKeys)) {
throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
}
this.model = hashedModelKeys[hashedKeys];
var labels = convert[this.model].labels;
var color2 = [];
for (i2 = 0; i2 < labels.length; i2++) {
color2.push(obj[labels[i2]]);
}
this.color = zeroArray2(color2);
}
if (limiters[this.model]) {
channels = convert[this.model].channels;
for (i2 = 0; i2 < channels; i2++) {
var limit2 = limiters[this.model][i2];
if (limit2) {
this.color[i2] = limit2(this.color[i2]);
}
}
}
this.valpha = Math.max(0, Math.min(1, this.valpha));
if (Object.freeze) {
Object.freeze(this);
}
}
Color2.prototype = {
toString: function() {
return this.string();
},
toJSON: function() {
return this[this.model]();
},
string: function(places) {
var self2 = this.model in colorString2.to ? this : this.rgb();
self2 = self2.round(typeof places === "number" ? places : 1);
var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
return colorString2.to[self2.model](args);
},
percentString: function(places) {
var self2 = this.rgb().round(typeof places === "number" ? places : 1);
var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
return colorString2.to.rgb.percent(args);
},
array: function() {
return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
},
object: function() {
var result = {};
var channels = convert[this.model].channels;
var labels = convert[this.model].labels;
for (var i2 = 0; i2 < channels; i2++) {
result[labels[i2]] = this.color[i2];
}
if (this.valpha !== 1) {
result.alpha = this.valpha;
}
return result;
},
unitArray: function() {
var rgb2 = this.rgb().color;
rgb2[0] /= 255;
rgb2[1] /= 255;
rgb2[2] /= 255;
if (this.valpha !== 1) {
rgb2.push(this.valpha);
}
return rgb2;
},
unitObject: function() {
var rgb2 = this.rgb().object();
rgb2.r /= 255;
rgb2.g /= 255;
rgb2.b /= 255;
if (this.valpha !== 1) {
rgb2.alpha = this.valpha;
}
return rgb2;
},
round: function(places) {
places = Math.max(places || 0, 0);
return new Color2(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
},
alpha: function(val) {
if (arguments.length) {
return new Color2(this.color.concat(Math.max(0, Math.min(1, val))), this.model);
}
return this.valpha;
},
// rgb
red: getset("rgb", 0, maxfn(255)),
green: getset("rgb", 1, maxfn(255)),
blue: getset("rgb", 2, maxfn(255)),
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function(val) {
return (val % 360 + 360) % 360;
}),
// eslint-disable-line brace-style
saturationl: getset("hsl", 1, maxfn(100)),
lightness: getset("hsl", 2, maxfn(100)),
saturationv: getset("hsv", 1, maxfn(100)),
value: getset("hsv", 2, maxfn(100)),
chroma: getset("hcg", 1, maxfn(100)),
gray: getset("hcg", 2, maxfn(100)),
white: getset("hwb", 1, maxfn(100)),
wblack: getset("hwb", 2, maxfn(100)),
cyan: getset("cmyk", 0, maxfn(100)),
magenta: getset("cmyk", 1, maxfn(100)),
yellow: getset("cmyk", 2, maxfn(100)),
black: getset("cmyk", 3, maxfn(100)),
x: getset("xyz", 0, maxfn(100)),
y: getset("xyz", 1, maxfn(100)),
z: getset("xyz", 2, maxfn(100)),
l: getset("lab", 0, maxfn(100)),
a: getset("lab", 1),
b: getset("lab", 2),
keyword: function(val) {
if (arguments.length) {
return new Color2(val);
}
return convert[this.model].keyword(this.color);
},
hex: function(val) {
if (arguments.length) {
return new Color2(val);
}
return colorString2.to.hex(this.rgb().round().color);
},
rgbNumber: function() {
var rgb2 = this.rgb().color;
return (rgb2[0] & 255) << 16 | (rgb2[1] & 255) << 8 | rgb2[2] & 255;
},
luminosity: function() {
var rgb2 = this.rgb().color;
var lum = [];
for (var i2 = 0; i2 < rgb2.length; i2++) {
var chan = rgb2[i2] / 255;
lum[i2] = chan <= 0.03928 ? chan / 12.92 : Math.pow((chan + 0.055) / 1.055, 2.4);
}
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
},
contrast: function(color2) {
var lum1 = this.luminosity();
var lum2 = color2.luminosity();
if (lum1 > lum2) {
return (lum1 + 0.05) / (lum2 + 0.05);
}
return (lum2 + 0.05) / (lum1 + 0.05);
},
level: function(color2) {
var contrastRatio = this.contrast(color2);
if (contrastRatio >= 7.1) {
return "AAA";
}
return contrastRatio >= 4.5 ? "AA" : "";
},
isDark: function() {
var rgb2 = this.rgb().color;
var yiq = (rgb2[0] * 299 + rgb2[1] * 587 + rgb2[2] * 114) / 1e3;
return yiq < 128;
},
isLight: function() {
return !this.isDark();
},
negate: function() {
var rgb2 = this.rgb();
for (var i2 = 0; i2 < 3; i2++) {
rgb2.color[i2] = 255 - rgb2.color[i2];
}
return rgb2;
},
lighten: function(ratio) {
var hsl2 = this.hsl();
hsl2.color[2] += hsl2.color[2] * ratio;
return hsl2;
},
darken: function(ratio) {
var hsl2 = this.hsl();
hsl2.color[2] -= hsl2.color[2] * ratio;
return hsl2;
},
saturate: function(ratio) {
var hsl2 = this.hsl();
hsl2.color[1] += hsl2.color[1] * ratio;
return hsl2;
},
desaturate: function(ratio) {
var hsl2 = this.hsl();
hsl2.color[1] -= hsl2.color[1] * ratio;
return hsl2;
},
whiten: function(ratio) {
var hwb = this.hwb();
hwb.color[1] += hwb.color[1] * ratio;
return hwb;
},
blacken: function(ratio) {
var hwb = this.hwb();
hwb.color[2] += hwb.color[2] * ratio;
return hwb;
},
grayscale: function() {
var rgb2 = this.rgb().color;
var val = rgb2[0] * 0.3 + rgb2[1] * 0.59 + rgb2[2] * 0.11;
return Color2.rgb(val, val, val);
},
fade: function(ratio) {
return this.alpha(this.valpha - this.valpha * ratio);
},
opaquer: function(ratio) {
return this.alpha(this.valpha + this.valpha * ratio);
},
rotate: function(degrees2) {
var hsl2 = this.hsl();
var hue2 = hsl2.color[0];
hue2 = (hue2 + degrees2) % 360;
hue2 = hue2 < 0 ? 360 + hue2 : hue2;
hsl2.color[0] = hue2;
return hsl2;
},
mix: function(mixinColor, weight) {
if (!mixinColor || !mixinColor.rgb) {
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
}
var color1 = mixinColor.rgb();
var color2 = this.rgb();
var p2 = weight === void 0 ? 0.5 : weight;
var w2 = 2 * p2 - 1;
var a2 = color1.alpha() - color2.alpha();
var w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
var w22 = 1 - w1;
return Color2.rgb(
w1 * color1.red() + w22 * color2.red(),
w1 * color1.green() + w22 * color2.green(),
w1 * color1.blue() + w22 * color2.blue(),
color1.alpha() * p2 + color2.alpha() * (1 - p2)
);
}
};
Object.keys(convert).forEach(function(model) {
if (skippedModels.indexOf(model) !== -1) {
return;
}
var channels = convert[model].channels;
Color2.prototype[model] = function() {
if (this.model === model) {
return new Color2(this);
}
if (arguments.length) {
return new Color2(arguments, model);
}
var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha;
return new Color2(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);
};
Color2[model] = function(color2) {
if (typeof color2 === "number") {
color2 = zeroArray2(_slice.call(arguments), channels);
}
return new Color2(color2, model);
};
});
function roundTo2(num, places) {
return Number(num.toFixed(places));
}
function roundToPlace(places) {
return function(num) {
return roundTo2(num, places);
};
}
function getset(model, channel2, modifier) {
model = Array.isArray(model) ? model : [model];
model.forEach(function(m2) {
(limiters[m2] || (limiters[m2] = []))[channel2] = modifier;
});
model = model[0];
return function(val) {
var result;
if (arguments.length) {
if (modifier) {
val = modifier(val);
}
result = this[model]();
result.color[channel2] = val;
return result;
}
result = this[model]().color[channel2];
if (modifier) {
result = modifier(result);
}
return result;
};
}
function maxfn(max2) {
return function(v2) {
return Math.max(0, Math.min(max2, v2));
};
}
function assertArray(val) {
return Array.isArray(val) ? val : [val];
}
function zeroArray2(arr2, length2) {
for (var i2 = 0; i2 < length2; i2++) {
if (typeof arr2[i2] !== "number") {
arr2[i2] = 0;
}
}
return arr2;
}
color$6 = Color2;
return color$6;
}
const normalize$3 = "";
const normalize$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: normalize$3
}, Symbol.toStringTag, { value: "Module" }));
const require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(normalize$4);
function _objectWithoutProperties$1(source2, excluded) {
if (source2 == null)
return {};
var target2 = _objectWithoutPropertiesLoose$2(source2, excluded);
var key2, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source2);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key2 = sourceSymbolKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source2, key2))
continue;
target2[key2] = source2[key2];
}
}
return target2;
}
const objectWithoutProperties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _objectWithoutProperties$1
}, Symbol.toStringTag, { value: "Module" }));
const require$$1 = /* @__PURE__ */ getAugmentedNamespace(objectWithoutProperties);
var dist$1 = {};
var hasRequiredDist;
function requireDist() {
if (hasRequiredDist)
return dist$1;
hasRequiredDist = 1;
var r2 = reactExports;
function n2(n3, e8, t6) {
var u2 = this, c2 = r2.useRef(null), i2 = r2.useRef(0), a2 = r2.useRef(null), f2 = r2.useRef([]), o2 = r2.useRef(), l2 = r2.useRef(), s2 = r2.useRef(n3), v2 = r2.useRef(true);
r2.useEffect(function() {
s2.current = n3;
}, [n3]);
var m2 = !e8 && 0 !== e8 && "undefined" != typeof window;
if ("function" != typeof n3)
throw new TypeError("Expected a function");
e8 = +e8 || 0;
var d2 = !!(t6 = t6 || {}).leading, p2 = !("trailing" in t6) || !!t6.trailing, R2 = "maxWait" in t6, g2 = R2 ? Math.max(+t6.maxWait || 0, e8) : null;
r2.useEffect(function() {
return v2.current = true, function() {
v2.current = false;
};
}, []);
var x2 = r2.useMemo(function() {
var r3 = function(r4) {
var n5 = f2.current, e9 = o2.current;
return f2.current = o2.current = null, i2.current = r4, l2.current = s2.current.apply(e9, n5);
}, n4 = function(r4, n5) {
m2 && cancelAnimationFrame(a2.current), a2.current = m2 ? requestAnimationFrame(r4) : setTimeout(r4, n5);
}, t7 = function(r4) {
if (!v2.current)
return false;
var n5 = r4 - c2.current;
return !c2.current || n5 >= e8 || n5 < 0 || R2 && r4 - i2.current >= g2;
}, x3 = function(n5) {
return a2.current = null, p2 && f2.current ? r3(n5) : (f2.current = o2.current = null, l2.current);
}, w2 = function r4() {
var u3 = Date.now();
if (t7(u3))
return x3(u3);
if (v2.current) {
var a3 = e8 - (u3 - c2.current), f3 = R2 ? Math.min(a3, g2 - (u3 - i2.current)) : a3;
n4(r4, f3);
}
}, b2 = function() {
var s3 = Date.now(), m3 = t7(s3);
if (f2.current = [].slice.call(arguments), o2.current = u2, c2.current = s3, m3) {
if (!a2.current && v2.current)
return i2.current = c2.current, n4(w2, e8), d2 ? r3(c2.current) : l2.current;
if (R2)
return n4(w2, e8), r3(c2.current);
}
return a2.current || n4(w2, e8), l2.current;
};
return b2.cancel = function() {
a2.current && (m2 ? cancelAnimationFrame(a2.current) : clearTimeout(a2.current)), i2.current = 0, f2.current = c2.current = o2.current = a2.current = null;
}, b2.isPending = function() {
return !!a2.current;
}, b2.flush = function() {
return a2.current ? x3(Date.now()) : l2.current;
}, b2;
}, [d2, R2, e8, g2, p2, m2]);
return x2;
}
function e7(r3, n3) {
return r3 === n3;
}
function t5(r3) {
return "function" == typeof r3 ? function() {
return r3;
} : r3;
}
dist$1.useDebounce = function(u2, c2, i2) {
var a2, f2, o2 = i2 && i2.equalityFn || e7, l2 = (a2 = r2.useState(t5(u2)), f2 = a2[1], [a2[0], r2.useCallback(function(r3) {
return f2(t5(r3));
}, [])]), s2 = l2[0], v2 = l2[1], m2 = n2(r2.useCallback(function(r3) {
return v2(r3);
}, [v2]), c2, i2), d2 = r2.useRef(u2);
return o2(d2.current, u2) || (m2(u2), d2.current = u2), [s2, m2];
}, dist$1.useDebouncedCallback = n2, dist$1.useThrottledCallback = function(r3, e8, t6) {
var u2 = void 0 === t6 ? {} : t6, c2 = u2.leading, i2 = u2.trailing;
return n2(r3, e8, { maxWait: e8, leading: void 0 === c2 || c2, trailing: void 0 === i2 || i2 });
};
return dist$1;
}
var classnames2 = { exports: {} };
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
var hasRequiredClassnames;
function requireClassnames() {
if (hasRequiredClassnames)
return classnames2.exports;
hasRequiredClassnames = 1;
(function(module) {
(function() {
var hasOwn3 = {}.hasOwnProperty;
function classNames2() {
var classes = [];
for (var i2 = 0; i2 < arguments.length; i2++) {
var arg = arguments[i2];
if (!arg)
continue;
var argType = typeof arg;
if (argType === "string" || argType === "number") {
classes.push(arg);
} else if (Array.isArray(arg)) {
if (arg.length) {
var inner = classNames2.apply(null, arg);
if (inner) {
classes.push(inner);
}
}
} else if (argType === "object") {
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
classes.push(arg.toString());
continue;
}
for (var key2 in arg) {
if (hasOwn3.call(arg, key2) && arg[key2]) {
classes.push(key2);
}
}
}
}
return classes.join(" ");
}
if (module.exports) {
classNames2.default = classNames2;
module.exports = classNames2;
} else {
window.classNames = classNames2;
}
})();
})(classnames2);
return classnames2.exports;
}
function _classCallCheck$1(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
const classCallCheck = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _classCallCheck$1
}, Symbol.toStringTag, { value: "Module" }));
const require$$4$1 = /* @__PURE__ */ getAugmentedNamespace(classCallCheck);
function _defineProperties(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
const createClass = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: _createClass
}, Symbol.toStringTag, { value: "Module" }));
const require$$5$2 = /* @__PURE__ */ getAugmentedNamespace(createClass);
var inherits$1 = { exports: {} };
var setPrototypeOf$3 = { exports: {} };
var hasRequiredSetPrototypeOf;
function requireSetPrototypeOf() {
if (hasRequiredSetPrototypeOf)
return setPrototypeOf$3.exports;
hasRequiredSetPrototypeOf = 1;
(function(module) {
function _setPrototypeOf2(o2, p2) {
module.exports = _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _setPrototypeOf2(o2, p2);
}
module.exports = _setPrototypeOf2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(setPrototypeOf$3);
return setPrototypeOf$3.exports;
}
var hasRequiredInherits;
function requireInherits() {
if (hasRequiredInherits)
return inherits$1.exports;
hasRequiredInherits = 1;
(function(module) {
var setPrototypeOf2 = requireSetPrototypeOf();
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass)
setPrototypeOf2(subClass, superClass);
}
module.exports = _inherits2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(inherits$1);
return inherits$1.exports;
}
var possibleConstructorReturn = { exports: {} };
var _typeof$2 = { exports: {} };
var hasRequired_typeof;
function require_typeof() {
if (hasRequired_typeof)
return _typeof$2.exports;
hasRequired_typeof = 1;
(function(module) {
function _typeof2(o2) {
"@babel/helpers - typeof";
return module.exports = _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
return typeof o3;
} : function(o3) {
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof2(o2);
}
module.exports = _typeof2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(_typeof$2);
return _typeof$2.exports;
}
var assertThisInitialized = { exports: {} };
var hasRequiredAssertThisInitialized;
function requireAssertThisInitialized() {
if (hasRequiredAssertThisInitialized)
return assertThisInitialized.exports;
hasRequiredAssertThisInitialized = 1;
(function(module) {
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
module.exports = _assertThisInitialized2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(assertThisInitialized);
return assertThisInitialized.exports;
}
var hasRequiredPossibleConstructorReturn;
function requirePossibleConstructorReturn() {
if (hasRequiredPossibleConstructorReturn)
return possibleConstructorReturn.exports;
hasRequiredPossibleConstructorReturn = 1;
(function(module) {
var _typeof2 = require_typeof()["default"];
var assertThisInitialized2 = requireAssertThisInitialized();
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return assertThisInitialized2(self2);
}
module.exports = _possibleConstructorReturn2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(possibleConstructorReturn);
return possibleConstructorReturn.exports;
}
var getPrototypeOf$4 = { exports: {} };
var hasRequiredGetPrototypeOf;
function requireGetPrototypeOf() {
if (hasRequiredGetPrototypeOf)
return getPrototypeOf$4.exports;
hasRequiredGetPrototypeOf = 1;
(function(module) {
function _getPrototypeOf2(o2) {
module.exports = _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _getPrototypeOf2(o2);
}
module.exports = _getPrototypeOf2, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(getPrototypeOf$4);
return getPrototypeOf$4.exports;
}
var propTypes$3 = { exports: {} };
var ReactPropTypesSecret_1;
var hasRequiredReactPropTypesSecret;
function requireReactPropTypesSecret() {
if (hasRequiredReactPropTypesSecret)
return ReactPropTypesSecret_1;
hasRequiredReactPropTypesSecret = 1;
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
ReactPropTypesSecret_1 = ReactPropTypesSecret;
return ReactPropTypesSecret_1;
}
var factoryWithThrowingShims;
var hasRequiredFactoryWithThrowingShims;
function requireFactoryWithThrowingShims() {
if (hasRequiredFactoryWithThrowingShims)
return factoryWithThrowingShims;
hasRequiredFactoryWithThrowingShims = 1;
var ReactPropTypesSecret = requireReactPropTypesSecret();
function emptyFunction() {
}
function emptyFunctionWithReset() {
}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
factoryWithThrowingShims = function() {
function shim2(props, propName, componentName, location2, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
return;
}
var err = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
err.name = "Invariant Violation";
throw err;
}
shim2.isRequired = shim2;
function getShim() {
return shim2;
}
var ReactPropTypes = {
array: shim2,
bigint: shim2,
bool: shim2,
func: shim2,
number: shim2,
object: shim2,
string: shim2,
symbol: shim2,
any: shim2,
arrayOf: getShim,
element: shim2,
elementType: shim2,
instanceOf: getShim,
node: shim2,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
return factoryWithThrowingShims;
}
var hasRequiredPropTypes$1;
function requirePropTypes$1() {
if (hasRequiredPropTypes$1)
return propTypes$3.exports;
hasRequiredPropTypes$1 = 1;
{
propTypes$3.exports = requireFactoryWithThrowingShims()();
}
return propTypes$3.exports;
}
var _excluded$8 = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
function useStateManager(_ref3) {
var _ref$defaultInputValu = _ref3.defaultInputValue, defaultInputValue = _ref$defaultInputValu === void 0 ? "" : _ref$defaultInputValu, _ref$defaultMenuIsOpe = _ref3.defaultMenuIsOpen, defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe, _ref$defaultValue = _ref3.defaultValue, defaultValue2 = _ref$defaultValue === void 0 ? null : _ref$defaultValue, propsInputValue = _ref3.inputValue, propsMenuIsOpen = _ref3.menuIsOpen, propsOnChange = _ref3.onChange, propsOnInputChange = _ref3.onInputChange, propsOnMenuClose = _ref3.onMenuClose, propsOnMenuOpen = _ref3.onMenuOpen, propsValue = _ref3.value, restSelectProps = _objectWithoutProperties$1(_ref3, _excluded$8);
var _useState = reactExports.useState(propsInputValue !== void 0 ? propsInputValue : defaultInputValue), _useState2 = _slicedToArray$2(_useState, 2), stateInputValue = _useState2[0], setStateInputValue = _useState2[1];
var _useState3 = reactExports.useState(propsMenuIsOpen !== void 0 ? propsMenuIsOpen : defaultMenuIsOpen), _useState4 = _slicedToArray$2(_useState3, 2), stateMenuIsOpen = _useState4[0], setStateMenuIsOpen = _useState4[1];
var _useState5 = reactExports.useState(propsValue !== void 0 ? propsValue : defaultValue2), _useState6 = _slicedToArray$2(_useState5, 2), stateValue = _useState6[0], setStateValue = _useState6[1];
var onChange2 = reactExports.useCallback(function(value3, actionMeta) {
if (typeof propsOnChange === "function") {
propsOnChange(value3, actionMeta);
}
setStateValue(value3);
}, [propsOnChange]);
var onInputChange = reactExports.useCallback(function(value3, actionMeta) {
var newValue;
if (typeof propsOnInputChange === "function") {
newValue = propsOnInputChange(value3, actionMeta);
}
setStateInputValue(newValue !== void 0 ? newValue : value3);
}, [propsOnInputChange]);
var onMenuOpen = reactExports.useCallback(function() {
if (typeof propsOnMenuOpen === "function") {
propsOnMenuOpen();
}
setStateMenuIsOpen(true);
}, [propsOnMenuOpen]);
var onMenuClose = reactExports.useCallback(function() {
if (typeof propsOnMenuClose === "function") {
propsOnMenuClose();
}
setStateMenuIsOpen(false);
}, [propsOnMenuClose]);
var inputValue = propsInputValue !== void 0 ? propsInputValue : stateInputValue;
var menuIsOpen = propsMenuIsOpen !== void 0 ? propsMenuIsOpen : stateMenuIsOpen;
var value2 = propsValue !== void 0 ? propsValue : stateValue;
return _objectSpread2(_objectSpread2({}, restSelectProps), {}, {
inputValue,
menuIsOpen,
onChange: onChange2,
onInputChange,
onMenuClose,
onMenuOpen,
value: value2
});
}
function _setPrototypeOf$1(o2, p2) {
_setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf$1(o2, p2);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass)
_setPrototypeOf$1(subClass, superClass);
}
function _getPrototypeOf(o2) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf(o2);
}
function _isNativeReflectConstruct$5() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _assertThisInitialized(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _possibleConstructorReturn(self2, call2) {
if (call2 && (_typeof$3(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self2);
}
function _createSuper$4(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct$5();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _arrayWithoutHoles$2(arr2) {
if (Array.isArray(arr2))
return _arrayLikeToArray$3(arr2);
}
function _iterableToArray$2(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
function _nonIterableSpread$2() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray$2(arr2) {
return _arrayWithoutHoles$2(arr2) || _iterableToArray$2(arr2) || _unsupportedIterableToArray$3(arr2) || _nonIterableSpread$2();
}
const min$b = Math.min;
const max$a = Math.max;
const round$1 = Math.round;
const floor$3 = Math.floor;
const createCoords = (v2) => ({
x: v2,
y: v2
});
function rectToClientRect$1(rect2) {
return {
...rect2,
top: rect2.y,
left: rect2.x,
right: rect2.x + rect2.width,
bottom: rect2.y + rect2.height
};
}
function getNodeName$1(node2) {
if (isNode$1(node2)) {
return (node2.nodeName || "").toLowerCase();
}
return "#document";
}
function getWindow$2(node2) {
var _node$ownerDocument;
return (node2 == null ? void 0 : (_node$ownerDocument = node2.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement$1(node2) {
var _ref3;
return (_ref3 = (isNode$1(node2) ? node2.ownerDocument : node2.document) || window.document) == null ? void 0 : _ref3.documentElement;
}
function isNode$1(value2) {
return value2 instanceof Node || value2 instanceof getWindow$2(value2).Node;
}
function isElement$3(value2) {
return value2 instanceof Element || value2 instanceof getWindow$2(value2).Element;
}
function isHTMLElement$3(value2) {
return value2 instanceof HTMLElement || value2 instanceof getWindow$2(value2).HTMLElement;
}
function isShadowRoot$1(value2) {
if (typeof ShadowRoot === "undefined") {
return false;
}
return value2 instanceof ShadowRoot || value2 instanceof getWindow$2(value2).ShadowRoot;
}
function isOverflowElement(element2) {
const {
overflow: overflow2,
overflowX,
overflowY,
display: display2
} = getComputedStyle$2(element2);
return /auto|scroll|overlay|hidden|clip/.test(overflow2 + overflowY + overflowX) && !["inline", "contents"].includes(display2);
}
function isWebKit() {
if (typeof CSS === "undefined" || !CSS.supports)
return false;
return CSS.supports("-webkit-backdrop-filter", "none");
}
function isLastTraversableNode(node2) {
return ["html", "body", "#document"].includes(getNodeName$1(node2));
}
function getComputedStyle$2(element2) {
return getWindow$2(element2).getComputedStyle(element2);
}
function getParentNode$1(node2) {
if (getNodeName$1(node2) === "html") {
return node2;
}
const result = (
// Step into the shadow DOM of the parent of a slotted node.
node2.assignedSlot || // DOM Element detected.
node2.parentNode || // ShadowRoot detected.
isShadowRoot$1(node2) && node2.host || // Fallback.
getDocumentElement$1(node2)
);
return isShadowRoot$1(result) ? result.host : result;
}
function getNearestOverflowAncestor(node2) {
const parentNode = getParentNode$1(node2);
if (isLastTraversableNode(parentNode)) {
return node2.ownerDocument ? node2.ownerDocument.body : node2.body;
}
if (isHTMLElement$3(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node2, list, traverseIframes) {
var _node$ownerDocument2;
if (list === void 0) {
list = [];
}
if (traverseIframes === void 0) {
traverseIframes = true;
}
const scrollableAncestor = getNearestOverflowAncestor(node2);
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node2.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
const win = getWindow$2(scrollableAncestor);
if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getCssDimensions(element2) {
const css4 = getComputedStyle$2(element2);
let width2 = parseFloat(css4.width) || 0;
let height2 = parseFloat(css4.height) || 0;
const hasOffset = isHTMLElement$3(element2);
const offsetWidth = hasOffset ? element2.offsetWidth : width2;
const offsetHeight = hasOffset ? element2.offsetHeight : height2;
const shouldFallback = round$1(width2) !== offsetWidth || round$1(height2) !== offsetHeight;
if (shouldFallback) {
width2 = offsetWidth;
height2 = offsetHeight;
}
return {
width: width2,
height: height2,
$: shouldFallback
};
}
function unwrapElement(element2) {
return !isElement$3(element2) ? element2.contextElement : element2;
}
function getScale$1(element2) {
const domElement = unwrapElement(element2);
if (!isHTMLElement$3(domElement)) {
return createCoords(1);
}
const rect2 = domElement.getBoundingClientRect();
const {
width: width2,
height: height2,
$: $2
} = getCssDimensions(domElement);
let x2 = ($2 ? round$1(rect2.width) : rect2.width) / width2;
let y2 = ($2 ? round$1(rect2.height) : rect2.height) / height2;
if (!x2 || !Number.isFinite(x2)) {
x2 = 1;
}
if (!y2 || !Number.isFinite(y2)) {
y2 = 1;
}
return {
x: x2,
y: y2
};
}
const noOffsets = /* @__PURE__ */ createCoords(0);
function getVisualOffsets(element2) {
const win = getWindow$2(element2);
if (!isWebKit() || !win.visualViewport) {
return noOffsets;
}
return {
x: win.visualViewport.offsetLeft,
y: win.visualViewport.offsetTop
};
}
function shouldAddVisualOffsets(element2, isFixed2, floatingOffsetParent) {
if (isFixed2 === void 0) {
isFixed2 = false;
}
if (!floatingOffsetParent || isFixed2 && floatingOffsetParent !== getWindow$2(element2)) {
return false;
}
return isFixed2;
}
function getBoundingClientRect$1(element2, includeScale, isFixedStrategy, offsetParent) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
const clientRect = element2.getBoundingClientRect();
const domElement = unwrapElement(element2);
let scale2 = createCoords(1);
if (includeScale) {
if (offsetParent) {
if (isElement$3(offsetParent)) {
scale2 = getScale$1(offsetParent);
}
} else {
scale2 = getScale$1(element2);
}
}
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
let x2 = (clientRect.left + visualOffsets.x) / scale2.x;
let y2 = (clientRect.top + visualOffsets.y) / scale2.y;
let width2 = clientRect.width / scale2.x;
let height2 = clientRect.height / scale2.y;
if (domElement) {
const win = getWindow$2(domElement);
const offsetWin = offsetParent && isElement$3(offsetParent) ? getWindow$2(offsetParent) : offsetParent;
let currentIFrame = win.frameElement;
while (currentIFrame && offsetParent && offsetWin !== win) {
const iframeScale = getScale$1(currentIFrame);
const iframeRect = currentIFrame.getBoundingClientRect();
const css4 = getComputedStyle$2(currentIFrame);
const left2 = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css4.paddingLeft)) * iframeScale.x;
const top2 = iframeRect.top + (currentIFrame.clientTop + parseFloat(css4.paddingTop)) * iframeScale.y;
x2 *= iframeScale.x;
y2 *= iframeScale.y;
width2 *= iframeScale.x;
height2 *= iframeScale.y;
x2 += left2;
y2 += top2;
currentIFrame = getWindow$2(currentIFrame).frameElement;
}
}
return rectToClientRect$1({
width: width2,
height: height2,
x: x2,
y: y2
});
}
function observeMove(element2, onMove) {
let io2 = null;
let timeoutId;
const root2 = getDocumentElement$1(element2);
function cleanup() {
clearTimeout(timeoutId);
io2 && io2.disconnect();
io2 = null;
}
function refresh(skip, threshold2) {
if (skip === void 0) {
skip = false;
}
if (threshold2 === void 0) {
threshold2 = 1;
}
cleanup();
const {
left: left2,
top: top2,
width: width2,
height: height2
} = element2.getBoundingClientRect();
if (!skip) {
onMove();
}
if (!width2 || !height2) {
return;
}
const insetTop = floor$3(top2);
const insetRight = floor$3(root2.clientWidth - (left2 + width2));
const insetBottom = floor$3(root2.clientHeight - (top2 + height2));
const insetLeft = floor$3(left2);
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
const options2 = {
rootMargin,
threshold: max$a(0, min$b(1, threshold2)) || 1
};
let isFirstUpdate = true;
function handleObserve(entries) {
const ratio = entries[0].intersectionRatio;
if (ratio !== threshold2) {
if (!isFirstUpdate) {
return refresh();
}
if (!ratio) {
timeoutId = setTimeout(() => {
refresh(false, 1e-7);
}, 100);
} else {
refresh(false, ratio);
}
}
isFirstUpdate = false;
}
try {
io2 = new IntersectionObserver(handleObserve, {
...options2,
// Handle <iframe>s
root: root2.ownerDocument
});
} catch (e7) {
io2 = new IntersectionObserver(handleObserve, options2);
}
io2.observe(element2);
}
refresh(true);
return cleanup;
}
function autoUpdate(reference2, floating, update2, options2) {
if (options2 === void 0) {
options2 = {};
}
const {
ancestorScroll = true,
ancestorResize = true,
elementResize = typeof ResizeObserver === "function",
layoutShift = typeof IntersectionObserver === "function",
animationFrame = false
} = options2;
const referenceEl = unwrapElement(reference2);
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.addEventListener("scroll", update2, {
passive: true
});
ancestorResize && ancestor.addEventListener("resize", update2);
});
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null;
let reobserveFrame = -1;
let resizeObserver = null;
if (elementResize) {
resizeObserver = new ResizeObserver((_ref3) => {
let [firstEntry] = _ref3;
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
resizeObserver.unobserve(floating);
cancelAnimationFrame(reobserveFrame);
reobserveFrame = requestAnimationFrame(() => {
resizeObserver && resizeObserver.observe(floating);
});
}
update2();
});
if (referenceEl && !animationFrame) {
resizeObserver.observe(referenceEl);
}
resizeObserver.observe(floating);
}
let frameId;
let prevRefRect = animationFrame ? getBoundingClientRect$1(reference2) : null;
if (animationFrame) {
frameLoop();
}
function frameLoop() {
const nextRefRect = getBoundingClientRect$1(reference2);
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
update2();
}
prevRefRect = nextRefRect;
frameId = requestAnimationFrame(frameLoop);
}
update2();
return () => {
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.removeEventListener("scroll", update2);
ancestorResize && ancestor.removeEventListener("resize", update2);
});
cleanupIo && cleanupIo();
resizeObserver && resizeObserver.disconnect();
resizeObserver = null;
if (animationFrame) {
cancelAnimationFrame(frameId);
}
};
}
var index$3 = reactExports.useLayoutEffect;
var _excluded$3$1 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
var noop$c = function noop() {
};
function applyPrefixToName(prefix2, name) {
if (!name) {
return prefix2;
} else if (name[0] === "-") {
return prefix2 + name;
} else {
return prefix2 + "__" + name;
}
}
function classNames(prefix2, state) {
for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
classNameList[_key - 2] = arguments[_key];
}
var arr2 = [].concat(classNameList);
if (state && prefix2) {
for (var key2 in state) {
if (state.hasOwnProperty(key2) && state[key2]) {
arr2.push("".concat(applyPrefixToName(prefix2, key2)));
}
}
}
return arr2.filter(function(i2) {
return i2;
}).map(function(i2) {
return String(i2).trim();
}).join(" ");
}
var cleanValue = function cleanValue2(value2) {
if (isArray$7(value2))
return value2.filter(Boolean);
if (_typeof$3(value2) === "object" && value2 !== null)
return [value2];
return [];
};
var cleanCommonProps = function cleanCommonProps2(props) {
props.className;
props.clearValue;
props.cx;
props.getStyles;
props.getClassNames;
props.getValue;
props.hasValue;
props.isMulti;
props.isRtl;
props.options;
props.selectOption;
props.selectProps;
props.setValue;
props.theme;
var innerProps = _objectWithoutProperties$1(props, _excluded$3$1);
return _objectSpread2({}, innerProps);
};
var getStyleProps = function getStyleProps2(props, name, classNamesState) {
var cx = props.cx, getStyles = props.getStyles, getClassNames = props.getClassNames, className = props.className;
return {
css: getStyles(name, props),
className: cx(classNamesState !== null && classNamesState !== void 0 ? classNamesState : {}, getClassNames(name, props), className)
};
};
function handleInputChange(inputValue, actionMeta, onInputChange) {
if (onInputChange) {
var _newValue = onInputChange(inputValue, actionMeta);
if (typeof _newValue === "string")
return _newValue;
}
return inputValue;
}
function isDocumentElement(el) {
return [document.documentElement, document.body, window].indexOf(el) > -1;
}
function normalizedHeight(el) {
if (isDocumentElement(el)) {
return window.innerHeight;
}
return el.clientHeight;
}
function getScrollTop(el) {
if (isDocumentElement(el)) {
return window.pageYOffset;
}
return el.scrollTop;
}
function scrollTo(el, top2) {
if (isDocumentElement(el)) {
window.scrollTo(0, top2);
return;
}
el.scrollTop = top2;
}
function getScrollParent$1(element2) {
var style2 = getComputedStyle(element2);
var excludeStaticParent = style2.position === "absolute";
var overflowRx = /(auto|scroll)/;
if (style2.position === "fixed")
return document.documentElement;
for (var parent = element2; parent = parent.parentElement; ) {
style2 = getComputedStyle(parent);
if (excludeStaticParent && style2.position === "static") {
continue;
}
if (overflowRx.test(style2.overflow + style2.overflowY + style2.overflowX)) {
return parent;
}
}
return document.documentElement;
}
function easeOutCubic(t5, b2, c2, d2) {
return c2 * ((t5 = t5 / d2 - 1) * t5 * t5 + 1) + b2;
}
function animatedScrollTo(element2, to2) {
var duration2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 200;
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : noop$c;
var start2 = getScrollTop(element2);
var change2 = to2 - start2;
var increment2 = 10;
var currentTime = 0;
function animateScroll() {
currentTime += increment2;
var val = easeOutCubic(currentTime, start2, change2, duration2);
scrollTo(element2, val);
if (currentTime < duration2) {
window.requestAnimationFrame(animateScroll);
} else {
callback(element2);
}
}
animateScroll();
}
function scrollIntoView(menuEl, focusedEl) {
var menuRect = menuEl.getBoundingClientRect();
var focusedRect = focusedEl.getBoundingClientRect();
var overScroll = focusedEl.offsetHeight / 3;
if (focusedRect.bottom + overScroll > menuRect.bottom) {
scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));
} else if (focusedRect.top - overScroll < menuRect.top) {
scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));
}
}
function getBoundingClientObj(element2) {
var rect2 = element2.getBoundingClientRect();
return {
bottom: rect2.bottom,
height: rect2.height,
left: rect2.left,
right: rect2.right,
top: rect2.top,
width: rect2.width
};
}
function isTouchCapable() {
try {
document.createEvent("TouchEvent");
return true;
} catch (e7) {
return false;
}
}
function isMobileDevice() {
try {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
} catch (e7) {
return false;
}
}
var passiveOptionAccessed = false;
var options = {
get passive() {
return passiveOptionAccessed = true;
}
};
var w$4 = typeof window !== "undefined" ? window : {};
if (w$4.addEventListener && w$4.removeEventListener) {
w$4.addEventListener("p", noop$c, options);
w$4.removeEventListener("p", noop$c, false);
}
var supportsPassiveEvents = passiveOptionAccessed;
function notNullish(item) {
return item != null;
}
function isArray$7(arg) {
return Array.isArray(arg);
}
function valueTernary(isMulti, multiValue, singleValue) {
return isMulti ? multiValue : singleValue;
}
function singleValueAsValue(singleValue) {
return singleValue;
}
function multiValueAsValue(multiValue) {
return multiValue;
}
var removeProps = function removeProps2(propsObj) {
for (var _len2 = arguments.length, properties2 = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
properties2[_key2 - 1] = arguments[_key2];
}
var propsMap = Object.entries(propsObj).filter(function(_ref3) {
var _ref22 = _slicedToArray$2(_ref3, 1), key2 = _ref22[0];
return !properties2.includes(key2);
});
return propsMap.reduce(function(newProps, _ref3) {
var _ref4 = _slicedToArray$2(_ref3, 2), key2 = _ref4[0], val = _ref4[1];
newProps[key2] = val;
return newProps;
}, {});
};
function getMenuPlacement(_ref3) {
var preferredMaxHeight = _ref3.maxHeight, menuEl = _ref3.menuEl, minHeight = _ref3.minHeight, preferredPlacement = _ref3.placement, shouldScroll = _ref3.shouldScroll, isFixedPosition = _ref3.isFixedPosition, controlHeight2 = _ref3.controlHeight;
var scrollParent = getScrollParent$1(menuEl);
var defaultState = {
placement: "bottom",
maxHeight: preferredMaxHeight
};
if (!menuEl || !menuEl.offsetParent)
return defaultState;
var _scrollParent$getBoun = scrollParent.getBoundingClientRect(), scrollHeight = _scrollParent$getBoun.height;
var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(), menuBottom = _menuEl$getBoundingCl.bottom, menuHeight = _menuEl$getBoundingCl.height, menuTop = _menuEl$getBoundingCl.top;
var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(), containerTop = _menuEl$offsetParent$.top;
var viewHeight2 = isFixedPosition ? window.innerHeight : normalizedHeight(scrollParent);
var scrollTop = getScrollTop(scrollParent);
var marginBottom2 = parseInt(getComputedStyle(menuEl).marginBottom, 10);
var marginTop2 = parseInt(getComputedStyle(menuEl).marginTop, 10);
var viewSpaceAbove = containerTop - marginTop2;
var viewSpaceBelow = viewHeight2 - menuTop;
var scrollSpaceAbove = viewSpaceAbove + scrollTop;
var scrollSpaceBelow = scrollHeight - scrollTop - menuTop;
var scrollDown = menuBottom - viewHeight2 + scrollTop + marginBottom2;
var scrollUp = scrollTop + menuTop - marginTop2;
var scrollDuration = 160;
switch (preferredPlacement) {
case "auto":
case "bottom":
if (viewSpaceBelow >= menuHeight) {
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
}
if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollDown, scrollDuration);
}
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
}
if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) {
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollDown, scrollDuration);
}
var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom2 : scrollSpaceBelow - marginBottom2;
return {
placement: "bottom",
maxHeight: constrainedHeight
};
}
if (preferredPlacement === "auto" || isFixedPosition) {
var _constrainedHeight = preferredMaxHeight;
var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove;
if (spaceAbove >= minHeight) {
_constrainedHeight = Math.min(spaceAbove - marginBottom2 - controlHeight2, preferredMaxHeight);
}
return {
placement: "top",
maxHeight: _constrainedHeight
};
}
if (preferredPlacement === "bottom") {
if (shouldScroll) {
scrollTo(scrollParent, scrollDown);
}
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
}
break;
case "top":
if (viewSpaceAbove >= menuHeight) {
return {
placement: "top",
maxHeight: preferredMaxHeight
};
}
if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollUp, scrollDuration);
}
return {
placement: "top",
maxHeight: preferredMaxHeight
};
}
if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
var _constrainedHeight2 = preferredMaxHeight;
if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
_constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop2 : scrollSpaceAbove - marginTop2;
}
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollUp, scrollDuration);
}
return {
placement: "top",
maxHeight: _constrainedHeight2
};
}
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
default:
throw new Error('Invalid placement provided "'.concat(preferredPlacement, '".'));
}
return defaultState;
}
function alignToControl(placement) {
var placementToCSSProp = {
bottom: "top",
top: "bottom"
};
return placement ? placementToCSSProp[placement] : "bottom";
}
var coercePlacement = function coercePlacement2(p2) {
return p2 === "auto" ? "bottom" : p2;
};
var menuCSS = function menuCSS2(_ref22, unstyled) {
var _objectSpread2$1;
var placement = _ref22.placement, _ref2$theme = _ref22.theme, borderRadius2 = _ref2$theme.borderRadius, spacing2 = _ref2$theme.spacing, colors2 = _ref2$theme.colors;
return _objectSpread2((_objectSpread2$1 = {
label: "menu"
}, _defineProperty$3(_objectSpread2$1, alignToControl(placement), "100%"), _defineProperty$3(_objectSpread2$1, "position", "absolute"), _defineProperty$3(_objectSpread2$1, "width", "100%"), _defineProperty$3(_objectSpread2$1, "zIndex", 1), _objectSpread2$1), unstyled ? {} : {
backgroundColor: colors2.neutral0,
borderRadius: borderRadius2,
boxShadow: "0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",
marginBottom: spacing2.menuGutter,
marginTop: spacing2.menuGutter
});
};
var PortalPlacementContext = /* @__PURE__ */ reactExports.createContext(null);
var MenuPlacer = function MenuPlacer2(props) {
var children2 = props.children, minMenuHeight = props.minMenuHeight, maxMenuHeight = props.maxMenuHeight, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition, menuShouldScrollIntoView = props.menuShouldScrollIntoView, theme = props.theme;
var _ref3 = reactExports.useContext(PortalPlacementContext) || {}, setPortalPlacement = _ref3.setPortalPlacement;
var ref2 = reactExports.useRef(null);
var _useState = reactExports.useState(maxMenuHeight), _useState2 = _slicedToArray$2(_useState, 2), maxHeight = _useState2[0], setMaxHeight = _useState2[1];
var _useState3 = reactExports.useState(null), _useState4 = _slicedToArray$2(_useState3, 2), placement = _useState4[0], setPlacement = _useState4[1];
var controlHeight2 = theme.spacing.controlHeight;
index$3(function() {
var menuEl = ref2.current;
if (!menuEl)
return;
var isFixedPosition = menuPosition === "fixed";
var shouldScroll = menuShouldScrollIntoView && !isFixedPosition;
var state = getMenuPlacement({
maxHeight: maxMenuHeight,
menuEl,
minHeight: minMenuHeight,
placement: menuPlacement,
shouldScroll,
isFixedPosition,
controlHeight: controlHeight2
});
setMaxHeight(state.maxHeight);
setPlacement(state.placement);
setPortalPlacement === null || setPortalPlacement === void 0 ? void 0 : setPortalPlacement(state.placement);
}, [maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, setPortalPlacement, controlHeight2]);
return children2({
ref: ref2,
placerProps: _objectSpread2(_objectSpread2({}, props), {}, {
placement: placement || coercePlacement(menuPlacement),
maxHeight
})
});
};
var Menu = function Menu2(props) {
var children2 = props.children, innerRef = props.innerRef, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "menu", {
menu: true
}), {
ref: innerRef
}, innerProps), children2);
};
var Menu$1 = Menu;
var menuListCSS = function menuListCSS2(_ref4, unstyled) {
var maxHeight = _ref4.maxHeight, baseUnit2 = _ref4.theme.spacing.baseUnit;
return _objectSpread2({
maxHeight,
overflowY: "auto",
position: "relative",
// required for offset[Height, Top] > keyboard scroll
WebkitOverflowScrolling: "touch"
}, unstyled ? {} : {
paddingBottom: baseUnit2,
paddingTop: baseUnit2
});
};
var MenuList = function MenuList2(props) {
var children2 = props.children, innerProps = props.innerProps, innerRef = props.innerRef, isMulti = props.isMulti;
return jsx$1("div", _extends$3({}, getStyleProps(props, "menuList", {
"menu-list": true,
"menu-list--is-multi": isMulti
}), {
ref: innerRef
}, innerProps), children2);
};
var noticeCSS = function noticeCSS2(_ref5, unstyled) {
var _ref5$theme = _ref5.theme, baseUnit2 = _ref5$theme.spacing.baseUnit, colors2 = _ref5$theme.colors;
return _objectSpread2({
textAlign: "center"
}, unstyled ? {} : {
color: colors2.neutral40,
padding: "".concat(baseUnit2 * 2, "px ").concat(baseUnit2 * 3, "px")
});
};
var noOptionsMessageCSS = noticeCSS;
var loadingMessageCSS = noticeCSS;
var NoOptionsMessage = function NoOptionsMessage2(props) {
var children2 = props.children, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "noOptionsMessage", {
"menu-notice": true,
"menu-notice--no-options": true
}), innerProps), children2);
};
NoOptionsMessage.defaultProps = {
children: "No options"
};
var LoadingMessage = function LoadingMessage2(props) {
var children2 = props.children, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "loadingMessage", {
"menu-notice": true,
"menu-notice--loading": true
}), innerProps), children2);
};
LoadingMessage.defaultProps = {
children: "Loading..."
};
var menuPortalCSS = function menuPortalCSS2(_ref6) {
var rect2 = _ref6.rect, offset2 = _ref6.offset, position2 = _ref6.position;
return {
left: rect2.left,
position: position2,
top: offset2,
width: rect2.width,
zIndex: 1
};
};
var MenuPortal = function MenuPortal2(props) {
var appendTo = props.appendTo, children2 = props.children, controlElement = props.controlElement, innerProps = props.innerProps, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition;
var menuPortalRef = reactExports.useRef(null);
var cleanupRef = reactExports.useRef(null);
var _useState5 = reactExports.useState(coercePlacement(menuPlacement)), _useState6 = _slicedToArray$2(_useState5, 2), placement = _useState6[0], setPortalPlacement = _useState6[1];
var portalPlacementContext = reactExports.useMemo(function() {
return {
setPortalPlacement
};
}, []);
var _useState7 = reactExports.useState(null), _useState8 = _slicedToArray$2(_useState7, 2), computedPosition = _useState8[0], setComputedPosition = _useState8[1];
var updateComputedPosition = reactExports.useCallback(function() {
if (!controlElement)
return;
var rect2 = getBoundingClientObj(controlElement);
var scrollDistance = menuPosition === "fixed" ? 0 : window.pageYOffset;
var offset2 = rect2[placement] + scrollDistance;
if (offset2 !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset) || rect2.left !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left) || rect2.width !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width)) {
setComputedPosition({
offset: offset2,
rect: rect2
});
}
}, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
index$3(function() {
updateComputedPosition();
}, [updateComputedPosition]);
var runAutoUpdate = reactExports.useCallback(function() {
if (typeof cleanupRef.current === "function") {
cleanupRef.current();
cleanupRef.current = null;
}
if (controlElement && menuPortalRef.current) {
cleanupRef.current = autoUpdate(controlElement, menuPortalRef.current, updateComputedPosition, {
elementResize: "ResizeObserver" in window
});
}
}, [controlElement, updateComputedPosition]);
index$3(function() {
runAutoUpdate();
}, [runAutoUpdate]);
var setMenuPortalElement = reactExports.useCallback(function(menuPortalElement) {
menuPortalRef.current = menuPortalElement;
runAutoUpdate();
}, [runAutoUpdate]);
if (!appendTo && menuPosition !== "fixed" || !computedPosition)
return null;
var menuWrapper = jsx$1("div", _extends$3({
ref: setMenuPortalElement
}, getStyleProps(_objectSpread2(_objectSpread2({}, props), {}, {
offset: computedPosition.offset,
position: menuPosition,
rect: computedPosition.rect
}), "menuPortal", {
"menu-portal": true
}), innerProps), children2);
return jsx$1(PortalPlacementContext.Provider, {
value: portalPlacementContext
}, appendTo ? /* @__PURE__ */ reactDomExports.createPortal(menuWrapper, appendTo) : menuWrapper);
};
var containerCSS = function containerCSS2(_ref3) {
var isDisabled = _ref3.isDisabled, isRtl = _ref3.isRtl;
return {
label: "container",
direction: isRtl ? "rtl" : void 0,
pointerEvents: isDisabled ? "none" : void 0,
// cancel mouse events when disabled
position: "relative"
};
};
var SelectContainer = function SelectContainer2(props) {
var children2 = props.children, innerProps = props.innerProps, isDisabled = props.isDisabled, isRtl = props.isRtl;
return jsx$1("div", _extends$3({}, getStyleProps(props, "container", {
"--is-disabled": isDisabled,
"--is-rtl": isRtl
}), innerProps), children2);
};
var valueContainerCSS = function valueContainerCSS2(_ref22, unstyled) {
var spacing2 = _ref22.theme.spacing, isMulti = _ref22.isMulti, hasValue = _ref22.hasValue, controlShouldRenderValue = _ref22.selectProps.controlShouldRenderValue;
return _objectSpread2({
alignItems: "center",
display: isMulti && hasValue && controlShouldRenderValue ? "flex" : "grid",
flex: 1,
flexWrap: "wrap",
WebkitOverflowScrolling: "touch",
position: "relative",
overflow: "hidden"
}, unstyled ? {} : {
padding: "".concat(spacing2.baseUnit / 2, "px ").concat(spacing2.baseUnit * 2, "px")
});
};
var ValueContainer = function ValueContainer2(props) {
var children2 = props.children, innerProps = props.innerProps, isMulti = props.isMulti, hasValue = props.hasValue;
return jsx$1("div", _extends$3({}, getStyleProps(props, "valueContainer", {
"value-container": true,
"value-container--is-multi": isMulti,
"value-container--has-value": hasValue
}), innerProps), children2);
};
var indicatorsContainerCSS = function indicatorsContainerCSS2() {
return {
alignItems: "center",
alignSelf: "stretch",
display: "flex",
flexShrink: 0
};
};
var IndicatorsContainer = function IndicatorsContainer2(props) {
var children2 = props.children, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "indicatorsContainer", {
indicators: true
}), innerProps), children2);
};
var _templateObject;
var _excluded$2$1 = ["size"];
var _ref2$2 = {
name: "8mmkcg",
styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"
};
var Svg = function Svg2(_ref3) {
var size = _ref3.size, props = _objectWithoutProperties$1(_ref3, _excluded$2$1);
return jsx$1("svg", _extends$3({
height: size,
width: size,
viewBox: "0 0 20 20",
"aria-hidden": "true",
focusable: "false",
css: _ref2$2
}, props));
};
var CrossIcon = function CrossIcon2(props) {
return jsx$1(Svg, _extends$3({
size: 20
}, props), jsx$1("path", {
d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
}));
};
var DownChevron = function DownChevron2(props) {
return jsx$1(Svg, _extends$3({
size: 20
}, props), jsx$1("path", {
d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
}));
};
var baseCSS = function baseCSS2(_ref3, unstyled) {
var isFocused = _ref3.isFocused, _ref3$theme = _ref3.theme, baseUnit2 = _ref3$theme.spacing.baseUnit, colors2 = _ref3$theme.colors;
return _objectSpread2({
label: "indicatorContainer",
display: "flex",
transition: "color 150ms"
}, unstyled ? {} : {
color: isFocused ? colors2.neutral60 : colors2.neutral20,
padding: baseUnit2 * 2,
":hover": {
color: isFocused ? colors2.neutral80 : colors2.neutral40
}
});
};
var dropdownIndicatorCSS = baseCSS;
var DropdownIndicator = function DropdownIndicator2(props) {
var children2 = props.children, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "dropdownIndicator", {
indicator: true,
"dropdown-indicator": true
}), innerProps), children2 || jsx$1(DownChevron, null));
};
var clearIndicatorCSS = baseCSS;
var ClearIndicator = function ClearIndicator2(props) {
var children2 = props.children, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "clearIndicator", {
indicator: true,
"clear-indicator": true
}), innerProps), children2 || jsx$1(CrossIcon, null));
};
var indicatorSeparatorCSS = function indicatorSeparatorCSS2(_ref4, unstyled) {
var isDisabled = _ref4.isDisabled, _ref4$theme = _ref4.theme, baseUnit2 = _ref4$theme.spacing.baseUnit, colors2 = _ref4$theme.colors;
return _objectSpread2({
label: "indicatorSeparator",
alignSelf: "stretch",
width: 1
}, unstyled ? {} : {
backgroundColor: isDisabled ? colors2.neutral10 : colors2.neutral20,
marginBottom: baseUnit2 * 2,
marginTop: baseUnit2 * 2
});
};
var IndicatorSeparator = function IndicatorSeparator2(props) {
var innerProps = props.innerProps;
return jsx$1("span", _extends$3({}, innerProps, getStyleProps(props, "indicatorSeparator", {
"indicator-separator": true
})));
};
var loadingDotAnimations = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"])));
var loadingIndicatorCSS = function loadingIndicatorCSS2(_ref5, unstyled) {
var isFocused = _ref5.isFocused, size = _ref5.size, _ref5$theme = _ref5.theme, colors2 = _ref5$theme.colors, baseUnit2 = _ref5$theme.spacing.baseUnit;
return _objectSpread2({
label: "loadingIndicator",
display: "flex",
transition: "color 150ms",
alignSelf: "center",
fontSize: size,
lineHeight: 1,
marginRight: size,
textAlign: "center",
verticalAlign: "middle"
}, unstyled ? {} : {
color: isFocused ? colors2.neutral60 : colors2.neutral20,
padding: baseUnit2 * 2
});
};
var LoadingDot = function LoadingDot2(_ref6) {
var delay = _ref6.delay, offset2 = _ref6.offset;
return jsx$1("span", {
css: /* @__PURE__ */ css$2({
animation: "".concat(loadingDotAnimations, " 1s ease-in-out ").concat(delay, "ms infinite;"),
backgroundColor: "currentColor",
borderRadius: "1em",
display: "inline-block",
marginLeft: offset2 ? "1em" : void 0,
height: "1em",
verticalAlign: "top",
width: "1em"
}, "", "")
});
};
var LoadingIndicator = function LoadingIndicator2(props) {
var innerProps = props.innerProps, isRtl = props.isRtl;
return jsx$1("div", _extends$3({}, getStyleProps(props, "loadingIndicator", {
indicator: true,
"loading-indicator": true
}), innerProps), jsx$1(LoadingDot, {
delay: 0,
offset: isRtl
}), jsx$1(LoadingDot, {
delay: 160,
offset: true
}), jsx$1(LoadingDot, {
delay: 320,
offset: !isRtl
}));
};
LoadingIndicator.defaultProps = {
size: 4
};
var css$1 = function css(_ref3, unstyled) {
var isDisabled = _ref3.isDisabled, isFocused = _ref3.isFocused, _ref$theme = _ref3.theme, colors2 = _ref$theme.colors, borderRadius2 = _ref$theme.borderRadius, spacing2 = _ref$theme.spacing;
return _objectSpread2({
label: "control",
alignItems: "center",
cursor: "default",
display: "flex",
flexWrap: "wrap",
justifyContent: "space-between",
minHeight: spacing2.controlHeight,
outline: "0 !important",
position: "relative",
transition: "all 100ms"
}, unstyled ? {} : {
backgroundColor: isDisabled ? colors2.neutral5 : colors2.neutral0,
borderColor: isDisabled ? colors2.neutral10 : isFocused ? colors2.primary : colors2.neutral20,
borderRadius: borderRadius2,
borderStyle: "solid",
borderWidth: 1,
boxShadow: isFocused ? "0 0 0 1px ".concat(colors2.primary) : void 0,
"&:hover": {
borderColor: isFocused ? colors2.primary : colors2.neutral30
}
});
};
var Control$1 = function Control(props) {
var children2 = props.children, isDisabled = props.isDisabled, isFocused = props.isFocused, innerRef = props.innerRef, innerProps = props.innerProps, menuIsOpen = props.menuIsOpen;
return jsx$1("div", _extends$3({
ref: innerRef
}, getStyleProps(props, "control", {
control: true,
"control--is-disabled": isDisabled,
"control--is-focused": isFocused,
"control--menu-is-open": menuIsOpen
}), innerProps), children2);
};
var Control$1$1 = Control$1;
var _excluded$1$1 = ["data"];
var groupCSS = function groupCSS2(_ref3, unstyled) {
var spacing2 = _ref3.theme.spacing;
return unstyled ? {} : {
paddingBottom: spacing2.baseUnit * 2,
paddingTop: spacing2.baseUnit * 2
};
};
var Group$1 = function Group(props) {
var children2 = props.children, cx = props.cx, getStyles = props.getStyles, getClassNames = props.getClassNames, Heading = props.Heading, headingProps = props.headingProps, innerProps = props.innerProps, label2 = props.label, theme = props.theme, selectProps = props.selectProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "group", {
group: true
}), innerProps), jsx$1(Heading, _extends$3({}, headingProps, {
selectProps,
theme,
getStyles,
getClassNames,
cx
}), label2), jsx$1("div", null, children2));
};
var groupHeadingCSS = function groupHeadingCSS2(_ref22, unstyled) {
var _ref2$theme = _ref22.theme, colors2 = _ref2$theme.colors, spacing2 = _ref2$theme.spacing;
return _objectSpread2({
label: "group",
cursor: "default",
display: "block"
}, unstyled ? {} : {
color: colors2.neutral40,
fontSize: "75%",
fontWeight: 500,
marginBottom: "0.25em",
paddingLeft: spacing2.baseUnit * 3,
paddingRight: spacing2.baseUnit * 3,
textTransform: "uppercase"
});
};
var GroupHeading = function GroupHeading2(props) {
var _cleanCommonProps = cleanCommonProps(props);
_cleanCommonProps.data;
var innerProps = _objectWithoutProperties$1(_cleanCommonProps, _excluded$1$1);
return jsx$1("div", _extends$3({}, getStyleProps(props, "groupHeading", {
"group-heading": true
}), innerProps));
};
var Group$1$1 = Group$1;
var _excluded$7 = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
var inputCSS = function inputCSS2(_ref3, unstyled) {
var isDisabled = _ref3.isDisabled, value2 = _ref3.value, _ref$theme = _ref3.theme, spacing2 = _ref$theme.spacing, colors2 = _ref$theme.colors;
return _objectSpread2(_objectSpread2({
visibility: isDisabled ? "hidden" : "visible",
// force css to recompute when value change due to @emotion bug.
// We can remove it whenever the bug is fixed.
transform: value2 ? "translateZ(0)" : ""
}, containerStyle), unstyled ? {} : {
margin: spacing2.baseUnit / 2,
paddingBottom: spacing2.baseUnit / 2,
paddingTop: spacing2.baseUnit / 2,
color: colors2.neutral80
});
};
var spacingStyle = {
gridArea: "1 / 2",
font: "inherit",
minWidth: "2px",
border: 0,
margin: 0,
outline: 0,
padding: 0
};
var containerStyle = {
flex: "1 1 auto",
display: "inline-grid",
gridArea: "1 / 1 / 2 / 3",
gridTemplateColumns: "0 min-content",
"&:after": _objectSpread2({
content: 'attr(data-value) " "',
visibility: "hidden",
whiteSpace: "pre"
}, spacingStyle)
};
var inputStyle = function inputStyle2(isHidden) {
return _objectSpread2({
label: "input",
color: "inherit",
background: 0,
opacity: isHidden ? 0 : 1,
width: "100%"
}, spacingStyle);
};
var Input = function Input2(props) {
var cx = props.cx, value2 = props.value;
var _cleanCommonProps = cleanCommonProps(props), innerRef = _cleanCommonProps.innerRef, isDisabled = _cleanCommonProps.isDisabled, isHidden = _cleanCommonProps.isHidden, inputClassName = _cleanCommonProps.inputClassName, innerProps = _objectWithoutProperties$1(_cleanCommonProps, _excluded$7);
return jsx$1("div", _extends$3({}, getStyleProps(props, "input", {
"input-container": true
}), {
"data-value": value2 || ""
}), jsx$1("input", _extends$3({
className: cx({
input: true
}, inputClassName),
ref: innerRef,
style: inputStyle(isHidden),
disabled: isDisabled
}, innerProps)));
};
var Input$1 = Input;
var multiValueCSS = function multiValueCSS2(_ref3, unstyled) {
var _ref$theme = _ref3.theme, spacing2 = _ref$theme.spacing, borderRadius2 = _ref$theme.borderRadius, colors2 = _ref$theme.colors;
return _objectSpread2({
label: "multiValue",
display: "flex",
minWidth: 0
}, unstyled ? {} : {
backgroundColor: colors2.neutral10,
borderRadius: borderRadius2 / 2,
margin: spacing2.baseUnit / 2
});
};
var multiValueLabelCSS = function multiValueLabelCSS2(_ref22, unstyled) {
var _ref2$theme = _ref22.theme, borderRadius2 = _ref2$theme.borderRadius, colors2 = _ref2$theme.colors, cropWithEllipsis = _ref22.cropWithEllipsis;
return _objectSpread2({
overflow: "hidden",
textOverflow: cropWithEllipsis || cropWithEllipsis === void 0 ? "ellipsis" : void 0,
whiteSpace: "nowrap"
}, unstyled ? {} : {
borderRadius: borderRadius2 / 2,
color: colors2.neutral80,
fontSize: "85%",
padding: 3,
paddingLeft: 6
});
};
var multiValueRemoveCSS = function multiValueRemoveCSS2(_ref3, unstyled) {
var _ref3$theme = _ref3.theme, spacing2 = _ref3$theme.spacing, borderRadius2 = _ref3$theme.borderRadius, colors2 = _ref3$theme.colors, isFocused = _ref3.isFocused;
return _objectSpread2({
alignItems: "center",
display: "flex"
}, unstyled ? {} : {
borderRadius: borderRadius2 / 2,
backgroundColor: isFocused ? colors2.dangerLight : void 0,
paddingLeft: spacing2.baseUnit,
paddingRight: spacing2.baseUnit,
":hover": {
backgroundColor: colors2.dangerLight,
color: colors2.danger
}
});
};
var MultiValueGeneric = function MultiValueGeneric2(_ref4) {
var children2 = _ref4.children, innerProps = _ref4.innerProps;
return jsx$1("div", innerProps, children2);
};
var MultiValueContainer = MultiValueGeneric;
var MultiValueLabel = MultiValueGeneric;
function MultiValueRemove(_ref5) {
var children2 = _ref5.children, innerProps = _ref5.innerProps;
return jsx$1("div", _extends$3({
role: "button"
}, innerProps), children2 || jsx$1(CrossIcon, {
size: 14
}));
}
var MultiValue = function MultiValue2(props) {
var children2 = props.children, components2 = props.components, data2 = props.data, innerProps = props.innerProps, isDisabled = props.isDisabled, removeProps3 = props.removeProps, selectProps = props.selectProps;
var Container = components2.Container, Label2 = components2.Label, Remove = components2.Remove;
return jsx$1(Container, {
data: data2,
innerProps: _objectSpread2(_objectSpread2({}, getStyleProps(props, "multiValue", {
"multi-value": true,
"multi-value--is-disabled": isDisabled
})), innerProps),
selectProps
}, jsx$1(Label2, {
data: data2,
innerProps: _objectSpread2({}, getStyleProps(props, "multiValueLabel", {
"multi-value__label": true
})),
selectProps
}, children2), jsx$1(Remove, {
data: data2,
innerProps: _objectSpread2(_objectSpread2({}, getStyleProps(props, "multiValueRemove", {
"multi-value__remove": true
})), {}, {
"aria-label": "Remove ".concat(children2 || "option")
}, removeProps3),
selectProps
}));
};
var MultiValue$1 = MultiValue;
var optionCSS = function optionCSS2(_ref3, unstyled) {
var isDisabled = _ref3.isDisabled, isFocused = _ref3.isFocused, isSelected = _ref3.isSelected, _ref$theme = _ref3.theme, spacing2 = _ref$theme.spacing, colors2 = _ref$theme.colors;
return _objectSpread2({
label: "option",
cursor: "default",
display: "block",
fontSize: "inherit",
width: "100%",
userSelect: "none",
WebkitTapHighlightColor: "rgba(0, 0, 0, 0)"
}, unstyled ? {} : {
backgroundColor: isSelected ? colors2.primary : isFocused ? colors2.primary25 : "transparent",
color: isDisabled ? colors2.neutral20 : isSelected ? colors2.neutral0 : "inherit",
padding: "".concat(spacing2.baseUnit * 2, "px ").concat(spacing2.baseUnit * 3, "px"),
// provide some affordance on touch devices
":active": {
backgroundColor: !isDisabled ? isSelected ? colors2.primary : colors2.primary50 : void 0
}
});
};
var Option = function Option2(props) {
var children2 = props.children, isDisabled = props.isDisabled, isFocused = props.isFocused, isSelected = props.isSelected, innerRef = props.innerRef, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "option", {
option: true,
"option--is-disabled": isDisabled,
"option--is-focused": isFocused,
"option--is-selected": isSelected
}), {
ref: innerRef,
"aria-disabled": isDisabled
}, innerProps), children2);
};
var Option$1 = Option;
var placeholderCSS = function placeholderCSS2(_ref3, unstyled) {
var _ref$theme = _ref3.theme, spacing2 = _ref$theme.spacing, colors2 = _ref$theme.colors;
return _objectSpread2({
label: "placeholder",
gridArea: "1 / 1 / 2 / 3"
}, unstyled ? {} : {
color: colors2.neutral50,
marginLeft: spacing2.baseUnit / 2,
marginRight: spacing2.baseUnit / 2
});
};
var Placeholder = function Placeholder2(props) {
var children2 = props.children, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "placeholder", {
placeholder: true
}), innerProps), children2);
};
var Placeholder$1 = Placeholder;
var css2 = function css3(_ref3, unstyled) {
var isDisabled = _ref3.isDisabled, _ref$theme = _ref3.theme, spacing2 = _ref$theme.spacing, colors2 = _ref$theme.colors;
return _objectSpread2({
label: "singleValue",
gridArea: "1 / 1 / 2 / 3",
maxWidth: "100%",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
}, unstyled ? {} : {
color: isDisabled ? colors2.neutral40 : colors2.neutral80,
marginLeft: spacing2.baseUnit / 2,
marginRight: spacing2.baseUnit / 2
});
};
var SingleValue = function SingleValue2(props) {
var children2 = props.children, isDisabled = props.isDisabled, innerProps = props.innerProps;
return jsx$1("div", _extends$3({}, getStyleProps(props, "singleValue", {
"single-value": true,
"single-value--is-disabled": isDisabled
}), innerProps), children2);
};
var SingleValue$1 = SingleValue;
var components = {
ClearIndicator,
Control: Control$1$1,
DropdownIndicator,
DownChevron,
CrossIcon,
Group: Group$1$1,
GroupHeading,
IndicatorsContainer,
IndicatorSeparator,
Input: Input$1,
LoadingIndicator,
Menu: Menu$1,
MenuList,
MenuPortal,
LoadingMessage,
NoOptionsMessage,
MultiValue: MultiValue$1,
MultiValueContainer,
MultiValueLabel,
MultiValueRemove,
Option: Option$1,
Placeholder: Placeholder$1,
SelectContainer,
SingleValue: SingleValue$1,
ValueContainer
};
var defaultComponents = function defaultComponents2(props) {
return _objectSpread2(_objectSpread2({}, components), props.components);
};
var safeIsNaN = Number.isNaN || function ponyfill(value2) {
return typeof value2 === "number" && value2 !== value2;
};
function isEqual$2(first, second2) {
if (first === second2) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second2)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i2 = 0; i2 < newInputs.length; i2++) {
if (!isEqual$2(newInputs[i2], lastInputs[i2])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual3) {
if (isEqual3 === void 0) {
isEqual3 = areInputsEqual;
}
var cache2 = null;
function memoized() {
var newArgs = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
newArgs[_i2] = arguments[_i2];
}
if (cache2 && cache2.lastThis === this && isEqual3(newArgs, cache2.lastArgs)) {
return cache2.lastResult;
}
var lastResult = resultFn.apply(this, newArgs);
cache2 = {
lastResult,
lastArgs: newArgs,
lastThis: this
};
return lastResult;
}
memoized.clear = function clear2() {
cache2 = null;
};
return memoized;
}
const memoizeOne_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: memoizeOne
}, Symbol.toStringTag, { value: "Module" }));
var _ref$1 = {
name: "7pg0cj-a11yText",
styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
};
var A11yText = function A11yText2(props) {
return jsx$1("span", _extends$3({
css: _ref$1
}, props));
};
var A11yText$1 = A11yText;
var defaultAriaLiveMessages = {
guidance: function guidance(props) {
var isSearchable = props.isSearchable, isMulti = props.isMulti, isDisabled = props.isDisabled, tabSelectsValue = props.tabSelectsValue, context2 = props.context;
switch (context2) {
case "menu":
return "Use Up and Down to choose options".concat(isDisabled ? "" : ", press Enter to select the currently focused option", ", press Escape to exit the menu").concat(tabSelectsValue ? ", press Tab to select the option and exit the menu" : "", ".");
case "input":
return "".concat(props["aria-label"] || "Select", " is focused ").concat(isSearchable ? ",type to refine list" : "", ", press Down to open the menu, ").concat(isMulti ? " press left to focus selected values" : "");
case "value":
return "Use left and right to toggle between focused values, press Backspace to remove the currently focused value";
default:
return "";
}
},
onChange: function onChange(props) {
var action = props.action, _props$label = props.label, label2 = _props$label === void 0 ? "" : _props$label, labels = props.labels, isDisabled = props.isDisabled;
switch (action) {
case "deselect-option":
case "pop-value":
case "remove-value":
return "option ".concat(label2, ", deselected.");
case "clear":
return "All selected options have been cleared.";
case "initial-input-focus":
return "option".concat(labels.length > 1 ? "s" : "", " ").concat(labels.join(","), ", selected.");
case "select-option":
return isDisabled ? "option ".concat(label2, " is disabled. Select another option.") : "option ".concat(label2, ", selected.");
default:
return "";
}
},
onFocus: function onFocus(props) {
var context2 = props.context, focused = props.focused, options2 = props.options, _props$label2 = props.label, label2 = _props$label2 === void 0 ? "" : _props$label2, selectValue = props.selectValue, isDisabled = props.isDisabled, isSelected = props.isSelected;
var getArrayIndex = function getArrayIndex2(arr2, item) {
return arr2 && arr2.length ? "".concat(arr2.indexOf(item) + 1, " of ").concat(arr2.length) : "";
};
if (context2 === "value" && selectValue) {
return "value ".concat(label2, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
}
if (context2 === "menu") {
var disabled = isDisabled ? " disabled" : "";
var status = "".concat(isSelected ? "selected" : "focused").concat(disabled);
return "option ".concat(label2, " ").concat(status, ", ").concat(getArrayIndex(options2, focused), ".");
}
return "";
},
onFilter: function onFilter(props) {
var inputValue = props.inputValue, resultsMessage = props.resultsMessage;
return "".concat(resultsMessage).concat(inputValue ? " for search term " + inputValue : "", ".");
}
};
var LiveRegion$1 = function LiveRegion(props) {
var ariaSelection = props.ariaSelection, focusedOption = props.focusedOption, focusedValue = props.focusedValue, focusableOptions = props.focusableOptions, isFocused = props.isFocused, selectValue = props.selectValue, selectProps = props.selectProps, id = props.id;
var ariaLiveMessages = selectProps.ariaLiveMessages, getOptionLabel4 = selectProps.getOptionLabel, inputValue = selectProps.inputValue, isMulti = selectProps.isMulti, isOptionDisabled3 = selectProps.isOptionDisabled, isSearchable = selectProps.isSearchable, menuIsOpen = selectProps.menuIsOpen, options2 = selectProps.options, screenReaderStatus2 = selectProps.screenReaderStatus, tabSelectsValue = selectProps.tabSelectsValue;
var ariaLabel2 = selectProps["aria-label"];
var ariaLive = selectProps["aria-live"];
var messages = reactExports.useMemo(function() {
return _objectSpread2(_objectSpread2({}, defaultAriaLiveMessages), ariaLiveMessages || {});
}, [ariaLiveMessages]);
var ariaSelected = reactExports.useMemo(function() {
var message = "";
if (ariaSelection && messages.onChange) {
var option = ariaSelection.option, selectedOptions = ariaSelection.options, removedValue = ariaSelection.removedValue, removedValues = ariaSelection.removedValues, value2 = ariaSelection.value;
var asOption = function asOption2(val) {
return !Array.isArray(val) ? val : null;
};
var selected = removedValue || option || asOption(value2);
var label2 = selected ? getOptionLabel4(selected) : "";
var multiSelected = selectedOptions || removedValues || void 0;
var labels = multiSelected ? multiSelected.map(getOptionLabel4) : [];
var onChangeProps = _objectSpread2({
// multiSelected items are usually items that have already been selected
// or set by the user as a default value so we assume they are not disabled
isDisabled: selected && isOptionDisabled3(selected, selectValue),
label: label2,
labels
}, ariaSelection);
message = messages.onChange(onChangeProps);
}
return message;
}, [ariaSelection, messages, isOptionDisabled3, selectValue, getOptionLabel4]);
var ariaFocused = reactExports.useMemo(function() {
var focusMsg = "";
var focused = focusedOption || focusedValue;
var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
if (focused && messages.onFocus) {
var onFocusProps = {
focused,
label: getOptionLabel4(focused),
isDisabled: isOptionDisabled3(focused, selectValue),
isSelected,
options: focusableOptions,
context: focused === focusedOption ? "menu" : "value",
selectValue
};
focusMsg = messages.onFocus(onFocusProps);
}
return focusMsg;
}, [focusedOption, focusedValue, getOptionLabel4, isOptionDisabled3, messages, focusableOptions, selectValue]);
var ariaResults = reactExports.useMemo(function() {
var resultsMsg = "";
if (menuIsOpen && options2.length && messages.onFilter) {
var resultsMessage = screenReaderStatus2({
count: focusableOptions.length
});
resultsMsg = messages.onFilter({
inputValue,
resultsMessage
});
}
return resultsMsg;
}, [focusableOptions, inputValue, menuIsOpen, messages, options2, screenReaderStatus2]);
var ariaGuidance = reactExports.useMemo(function() {
var guidanceMsg = "";
if (messages.guidance) {
var context2 = focusedValue ? "value" : menuIsOpen ? "menu" : "input";
guidanceMsg = messages.guidance({
"aria-label": ariaLabel2,
context: context2,
isDisabled: focusedOption && isOptionDisabled3(focusedOption, selectValue),
isMulti,
isSearchable,
tabSelectsValue
});
}
return guidanceMsg;
}, [ariaLabel2, focusedOption, focusedValue, isMulti, isOptionDisabled3, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
var ScreenReaderText = jsx$1(reactExports.Fragment, null, jsx$1("span", {
id: "aria-selection"
}, ariaSelected), jsx$1("span", {
id: "aria-context"
}, ariaContext));
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === "initial-input-focus";
return jsx$1(reactExports.Fragment, null, jsx$1(A11yText$1, {
id
}, isInitialFocus && ScreenReaderText), jsx$1(A11yText$1, {
"aria-live": ariaLive,
"aria-atomic": "false",
"aria-relevant": "additions text"
}, isFocused && !isInitialFocus && ScreenReaderText));
};
var LiveRegion$1$1 = LiveRegion$1;
var diacritics = [{
base: "A",
letters: "AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"
}, {
base: "AA",
letters: "Ꜳ"
}, {
base: "AE",
letters: "ÆǼǢ"
}, {
base: "AO",
letters: "Ꜵ"
}, {
base: "AU",
letters: "Ꜷ"
}, {
base: "AV",
letters: "ꜸꜺ"
}, {
base: "AY",
letters: "Ꜽ"
}, {
base: "B",
letters: "BⒷBḂḄḆɃƂƁ"
}, {
base: "C",
letters: "CⒸCĆĈĊČÇḈƇȻꜾ"
}, {
base: "D",
letters: "DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"
}, {
base: "DZ",
letters: "DZDŽ"
}, {
base: "Dz",
letters: "DzDž"
}, {
base: "E",
letters: "EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"
}, {
base: "F",
letters: "FⒻFḞƑꝻ"
}, {
base: "G",
letters: "GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"
}, {
base: "H",
letters: "HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"
}, {
base: "I",
letters: "IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"
}, {
base: "J",
letters: "JⒿJĴɈ"
}, {
base: "K",
letters: "KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"
}, {
base: "L",
letters: "LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"
}, {
base: "LJ",
letters: "LJ"
}, {
base: "Lj",
letters: "Lj"
}, {
base: "M",
letters: "MⓂMḾṀṂⱮƜ"
}, {
base: "N",
letters: "NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"
}, {
base: "NJ",
letters: "NJ"
}, {
base: "Nj",
letters: "Nj"
}, {
base: "O",
letters: "OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"
}, {
base: "OI",
letters: "Ƣ"
}, {
base: "OO",
letters: "Ꝏ"
}, {
base: "OU",
letters: "Ȣ"
}, {
base: "P",
letters: "PⓅPṔṖƤⱣꝐꝒꝔ"
}, {
base: "Q",
letters: "QⓆQꝖꝘɊ"
}, {
base: "R",
letters: "RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"
}, {
base: "S",
letters: "SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"
}, {
base: "T",
letters: "TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"
}, {
base: "TZ",
letters: "Ꜩ"
}, {
base: "U",
letters: "UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"
}, {
base: "V",
letters: "VⓋVṼṾƲꝞɅ"
}, {
base: "VY",
letters: "Ꝡ"
}, {
base: "W",
letters: "WⓌWẀẂŴẆẄẈⱲ"
}, {
base: "X",
letters: "XⓍXẊẌ"
}, {
base: "Y",
letters: "YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"
}, {
base: "Z",
letters: "ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"
}, {
base: "a",
letters: "aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"
}, {
base: "aa",
letters: "ꜳ"
}, {
base: "ae",
letters: "æǽǣ"
}, {
base: "ao",
letters: "ꜵ"
}, {
base: "au",
letters: "ꜷ"
}, {
base: "av",
letters: "ꜹꜻ"
}, {
base: "ay",
letters: "ꜽ"
}, {
base: "b",
letters: "bⓑbḃḅḇƀƃɓ"
}, {
base: "c",
letters: "cⓒcćĉċčçḉƈȼꜿↄ"
}, {
base: "d",
letters: "dⓓdḋďḍḑḓḏđƌɖɗꝺ"
}, {
base: "dz",
letters: "dzdž"
}, {
base: "e",
letters: "eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"
}, {
base: "f",
letters: "fⓕfḟƒꝼ"
}, {
base: "g",
letters: "gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"
}, {
base: "h",
letters: "hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"
}, {
base: "hv",
letters: "ƕ"
}, {
base: "i",
letters: "iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"
}, {
base: "j",
letters: "jⓙjĵǰɉ"
}, {
base: "k",
letters: "kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"
}, {
base: "l",
letters: "lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"
}, {
base: "lj",
letters: "lj"
}, {
base: "m",
letters: "mⓜmḿṁṃɱɯ"
}, {
base: "n",
letters: "nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"
}, {
base: "nj",
letters: "nj"
}, {
base: "o",
letters: "oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"
}, {
base: "oi",
letters: "ƣ"
}, {
base: "ou",
letters: "ȣ"
}, {
base: "oo",
letters: "ꝏ"
}, {
base: "p",
letters: "pⓟpṕṗƥᵽꝑꝓꝕ"
}, {
base: "q",
letters: "qⓠqɋꝗꝙ"
}, {
base: "r",
letters: "rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"
}, {
base: "s",
letters: "sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"
}, {
base: "t",
letters: "tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"
}, {
base: "tz",
letters: "ꜩ"
}, {
base: "u",
letters: "uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"
}, {
base: "v",
letters: "vⓥvṽṿʋꝟʌ"
}, {
base: "vy",
letters: "ꝡ"
}, {
base: "w",
letters: "wⓦwẁẃŵẇẅẘẉⱳ"
}, {
base: "x",
letters: "xⓧxẋẍ"
}, {
base: "y",
letters: "yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"
}, {
base: "z",
letters: "zⓩzźẑżžẓẕƶȥɀⱬꝣ"
}];
var anyDiacritic = new RegExp("[" + diacritics.map(function(d2) {
return d2.letters;
}).join("") + "]", "g");
var diacriticToBase = {};
for (var i$h = 0; i$h < diacritics.length; i$h++) {
var diacritic = diacritics[i$h];
for (var j$3 = 0; j$3 < diacritic.letters.length; j$3++) {
diacriticToBase[diacritic.letters[j$3]] = diacritic.base;
}
}
var stripDiacritics = function stripDiacritics2(str) {
return str.replace(anyDiacritic, function(match2) {
return diacriticToBase[match2];
});
};
var memoizedStripDiacriticsForInput = memoizeOne(stripDiacritics);
var trimString = function trimString2(str) {
return str.replace(/^\s+|\s+$/g, "");
};
var defaultStringify = function defaultStringify2(option) {
return "".concat(option.label, " ").concat(option.value);
};
var createFilter = function createFilter2(config2) {
return function(option, rawInput) {
if (option.data.__isNew__)
return true;
var _ignoreCase$ignoreAcc = _objectSpread2({
ignoreCase: true,
ignoreAccents: true,
stringify: defaultStringify,
trim: true,
matchFrom: "any"
}, config2), ignoreCase = _ignoreCase$ignoreAcc.ignoreCase, ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents, stringify2 = _ignoreCase$ignoreAcc.stringify, trim3 = _ignoreCase$ignoreAcc.trim, matchFrom = _ignoreCase$ignoreAcc.matchFrom;
var input = trim3 ? trimString(rawInput) : rawInput;
var candidate = trim3 ? trimString(stringify2(option)) : stringify2(option);
if (ignoreCase) {
input = input.toLowerCase();
candidate = candidate.toLowerCase();
}
if (ignoreAccents) {
input = memoizedStripDiacriticsForInput(input);
candidate = stripDiacritics(candidate);
}
return matchFrom === "start" ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;
};
};
var _excluded$6 = ["innerRef"];
function DummyInput(_ref3) {
var innerRef = _ref3.innerRef, props = _objectWithoutProperties$1(_ref3, _excluded$6);
var filteredProps = removeProps(props, "onExited", "in", "enter", "exit", "appear");
return jsx$1("input", _extends$3({
ref: innerRef
}, filteredProps, {
css: /* @__PURE__ */ css$2({
label: "dummyInput",
// get rid of any default styles
background: 0,
border: 0,
// important! this hides the flashing cursor
caretColor: "transparent",
fontSize: "inherit",
gridArea: "1 / 1 / 2 / 3",
outline: 0,
padding: 0,
// important! without `width` browsers won't allow focus
width: 1,
// remove cursor on desktop
color: "transparent",
// remove cursor on mobile whilst maintaining "scroll into view" behaviour
left: -100,
opacity: 0,
position: "relative",
transform: "scale(.01)"
}, "", "")
}));
}
var cancelScroll = function cancelScroll2(event2) {
event2.preventDefault();
event2.stopPropagation();
};
function useScrollCapture(_ref3) {
var isEnabled = _ref3.isEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
var isBottom = reactExports.useRef(false);
var isTop = reactExports.useRef(false);
var touchStart = reactExports.useRef(0);
var scrollTarget = reactExports.useRef(null);
var handleEventDelta = reactExports.useCallback(function(event2, delta) {
if (scrollTarget.current === null)
return;
var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight;
var target2 = scrollTarget.current;
var isDeltaPositive = delta > 0;
var availableScroll = scrollHeight - clientHeight - scrollTop;
var shouldCancelScroll = false;
if (availableScroll > delta && isBottom.current) {
if (onBottomLeave)
onBottomLeave(event2);
isBottom.current = false;
}
if (isDeltaPositive && isTop.current) {
if (onTopLeave)
onTopLeave(event2);
isTop.current = false;
}
if (isDeltaPositive && delta > availableScroll) {
if (onBottomArrive && !isBottom.current) {
onBottomArrive(event2);
}
target2.scrollTop = scrollHeight;
shouldCancelScroll = true;
isBottom.current = true;
} else if (!isDeltaPositive && -delta > scrollTop) {
if (onTopArrive && !isTop.current) {
onTopArrive(event2);
}
target2.scrollTop = 0;
shouldCancelScroll = true;
isTop.current = true;
}
if (shouldCancelScroll) {
cancelScroll(event2);
}
}, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]);
var onWheel = reactExports.useCallback(function(event2) {
handleEventDelta(event2, event2.deltaY);
}, [handleEventDelta]);
var onTouchStart = reactExports.useCallback(function(event2) {
touchStart.current = event2.changedTouches[0].clientY;
}, []);
var onTouchMove = reactExports.useCallback(function(event2) {
var deltaY = touchStart.current - event2.changedTouches[0].clientY;
handleEventDelta(event2, deltaY);
}, [handleEventDelta]);
var startListening = reactExports.useCallback(function(el) {
if (!el)
return;
var notPassive = supportsPassiveEvents ? {
passive: false
} : false;
el.addEventListener("wheel", onWheel, notPassive);
el.addEventListener("touchstart", onTouchStart, notPassive);
el.addEventListener("touchmove", onTouchMove, notPassive);
}, [onTouchMove, onTouchStart, onWheel]);
var stopListening = reactExports.useCallback(function(el) {
if (!el)
return;
el.removeEventListener("wheel", onWheel, false);
el.removeEventListener("touchstart", onTouchStart, false);
el.removeEventListener("touchmove", onTouchMove, false);
}, [onTouchMove, onTouchStart, onWheel]);
reactExports.useEffect(function() {
if (!isEnabled)
return;
var element2 = scrollTarget.current;
startListening(element2);
return function() {
stopListening(element2);
};
}, [isEnabled, startListening, stopListening]);
return function(element2) {
scrollTarget.current = element2;
};
}
var STYLE_KEYS = ["boxSizing", "height", "overflow", "paddingRight", "position"];
var LOCK_STYLES = {
boxSizing: "border-box",
// account for possible declaration `width: 100%;` on body
overflow: "hidden",
position: "relative",
height: "100%"
};
function preventTouchMove(e7) {
e7.preventDefault();
}
function allowTouchMove(e7) {
e7.stopPropagation();
}
function preventInertiaScroll() {
var top2 = this.scrollTop;
var totalScroll = this.scrollHeight;
var currentScroll = top2 + this.offsetHeight;
if (top2 === 0) {
this.scrollTop = 1;
} else if (currentScroll === totalScroll) {
this.scrollTop = top2 - 1;
}
}
function isTouchDevice() {
return "ontouchstart" in window || navigator.maxTouchPoints;
}
var canUseDOM$1 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
var activeScrollLocks = 0;
var listenerOptions = {
capture: false,
passive: false
};
function useScrollLock(_ref3) {
var isEnabled = _ref3.isEnabled, _ref$accountForScroll = _ref3.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
var originalStyles = reactExports.useRef({});
var scrollTarget = reactExports.useRef(null);
var addScrollLock = reactExports.useCallback(function(touchScrollTarget) {
if (!canUseDOM$1)
return;
var target2 = document.body;
var targetStyle = target2 && target2.style;
if (accountForScrollbars) {
STYLE_KEYS.forEach(function(key2) {
var val = targetStyle && targetStyle[key2];
originalStyles.current[key2] = val;
});
}
if (accountForScrollbars && activeScrollLocks < 1) {
var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0;
var clientWidth = document.body ? document.body.clientWidth : 0;
var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;
Object.keys(LOCK_STYLES).forEach(function(key2) {
var val = LOCK_STYLES[key2];
if (targetStyle) {
targetStyle[key2] = val;
}
});
if (targetStyle) {
targetStyle.paddingRight = "".concat(adjustedPadding, "px");
}
}
if (target2 && isTouchDevice()) {
target2.addEventListener("touchmove", preventTouchMove, listenerOptions);
if (touchScrollTarget) {
touchScrollTarget.addEventListener("touchstart", preventInertiaScroll, listenerOptions);
touchScrollTarget.addEventListener("touchmove", allowTouchMove, listenerOptions);
}
}
activeScrollLocks += 1;
}, [accountForScrollbars]);
var removeScrollLock = reactExports.useCallback(function(touchScrollTarget) {
if (!canUseDOM$1)
return;
var target2 = document.body;
var targetStyle = target2 && target2.style;
activeScrollLocks = Math.max(activeScrollLocks - 1, 0);
if (accountForScrollbars && activeScrollLocks < 1) {
STYLE_KEYS.forEach(function(key2) {
var val = originalStyles.current[key2];
if (targetStyle) {
targetStyle[key2] = val;
}
});
}
if (target2 && isTouchDevice()) {
target2.removeEventListener("touchmove", preventTouchMove, listenerOptions);
if (touchScrollTarget) {
touchScrollTarget.removeEventListener("touchstart", preventInertiaScroll, listenerOptions);
touchScrollTarget.removeEventListener("touchmove", allowTouchMove, listenerOptions);
}
}
}, [accountForScrollbars]);
reactExports.useEffect(function() {
if (!isEnabled)
return;
var element2 = scrollTarget.current;
addScrollLock(element2);
return function() {
removeScrollLock(element2);
};
}, [isEnabled, addScrollLock, removeScrollLock]);
return function(element2) {
scrollTarget.current = element2;
};
}
var blurSelectInput = function blurSelectInput2() {
return document.activeElement && document.activeElement.blur();
};
var _ref2$1 = {
name: "1kfdb0e",
styles: "position:fixed;left:0;bottom:0;right:0;top:0"
};
function ScrollManager(_ref3) {
var children2 = _ref3.children, lockEnabled = _ref3.lockEnabled, _ref$captureEnabled = _ref3.captureEnabled, captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
var setScrollCaptureTarget = useScrollCapture({
isEnabled: captureEnabled,
onBottomArrive,
onBottomLeave,
onTopArrive,
onTopLeave
});
var setScrollLockTarget = useScrollLock({
isEnabled: lockEnabled
});
var targetRef = function targetRef2(element2) {
setScrollCaptureTarget(element2);
setScrollLockTarget(element2);
};
return jsx$1(reactExports.Fragment, null, lockEnabled && jsx$1("div", {
onClick: blurSelectInput,
css: _ref2$1
}), children2(targetRef));
}
var _ref2 = {
name: "1a0ro4n-requiredInput",
styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"
};
var RequiredInput = function RequiredInput2(_ref3) {
var name = _ref3.name, onFocus2 = _ref3.onFocus;
return jsx$1("input", {
required: true,
name,
tabIndex: -1,
"aria-hidden": "true",
onFocus: onFocus2,
css: _ref2,
value: "",
onChange: function onChange2() {
}
});
};
var RequiredInput$1 = RequiredInput;
var formatGroupLabel = function formatGroupLabel2(group2) {
return group2.label;
};
var getOptionLabel$1 = function getOptionLabel(option) {
return option.label;
};
var getOptionValue$1 = function getOptionValue(option) {
return option.value;
};
var isOptionDisabled = function isOptionDisabled2(option) {
return !!option.isDisabled;
};
var defaultStyles = {
clearIndicator: clearIndicatorCSS,
container: containerCSS,
control: css$1,
dropdownIndicator: dropdownIndicatorCSS,
group: groupCSS,
groupHeading: groupHeadingCSS,
indicatorsContainer: indicatorsContainerCSS,
indicatorSeparator: indicatorSeparatorCSS,
input: inputCSS,
loadingIndicator: loadingIndicatorCSS,
loadingMessage: loadingMessageCSS,
menu: menuCSS,
menuList: menuListCSS,
menuPortal: menuPortalCSS,
multiValue: multiValueCSS,
multiValueLabel: multiValueLabelCSS,
multiValueRemove: multiValueRemoveCSS,
noOptionsMessage: noOptionsMessageCSS,
option: optionCSS,
placeholder: placeholderCSS,
singleValue: css2,
valueContainer: valueContainerCSS
};
function mergeStyles(source2) {
var target2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var styles2 = _objectSpread2({}, source2);
Object.keys(target2).forEach(function(keyAsString) {
var key2 = keyAsString;
if (source2[key2]) {
styles2[key2] = function(rsCss, props) {
return target2[key2](source2[key2](rsCss, props), props);
};
} else {
styles2[key2] = target2[key2];
}
});
return styles2;
}
var colors$1 = {
primary: "#2684FF",
primary75: "#4C9AFF",
primary50: "#B2D4FF",
primary25: "#DEEBFF",
danger: "#DE350B",
dangerLight: "#FFBDAD",
neutral0: "hsl(0, 0%, 100%)",
neutral5: "hsl(0, 0%, 95%)",
neutral10: "hsl(0, 0%, 90%)",
neutral20: "hsl(0, 0%, 80%)",
neutral30: "hsl(0, 0%, 70%)",
neutral40: "hsl(0, 0%, 60%)",
neutral50: "hsl(0, 0%, 50%)",
neutral60: "hsl(0, 0%, 40%)",
neutral70: "hsl(0, 0%, 30%)",
neutral80: "hsl(0, 0%, 20%)",
neutral90: "hsl(0, 0%, 10%)"
};
var borderRadius = 4;
var baseUnit = 4;
var controlHeight = 38;
var menuGutter = baseUnit * 2;
var spacing = {
baseUnit,
controlHeight,
menuGutter
};
var defaultTheme = {
borderRadius,
colors: colors$1,
spacing
};
var defaultProps$5 = {
"aria-live": "polite",
backspaceRemovesValue: true,
blurInputOnSelect: isTouchCapable(),
captureMenuScroll: !isTouchCapable(),
classNames: {},
closeMenuOnSelect: true,
closeMenuOnScroll: false,
components: {},
controlShouldRenderValue: true,
escapeClearsValue: false,
filterOption: createFilter(),
formatGroupLabel,
getOptionLabel: getOptionLabel$1,
getOptionValue: getOptionValue$1,
isDisabled: false,
isLoading: false,
isMulti: false,
isRtl: false,
isSearchable: true,
isOptionDisabled,
loadingMessage: function loadingMessage() {
return "Loading...";
},
maxMenuHeight: 300,
minMenuHeight: 140,
menuIsOpen: false,
menuPlacement: "bottom",
menuPosition: "absolute",
menuShouldBlockScroll: false,
menuShouldScrollIntoView: !isMobileDevice(),
noOptionsMessage: function noOptionsMessage() {
return "No options";
},
openMenuOnFocus: false,
openMenuOnClick: true,
options: [],
pageSize: 5,
placeholder: "Select...",
screenReaderStatus: function screenReaderStatus(_ref3) {
var count2 = _ref3.count;
return "".concat(count2, " result").concat(count2 !== 1 ? "s" : "", " available");
},
styles: {},
tabIndex: 0,
tabSelectsValue: true,
unstyled: false
};
function toCategorizedOption(props, option, selectValue, index2) {
var isDisabled = _isOptionDisabled(props, option, selectValue);
var isSelected = _isOptionSelected(props, option, selectValue);
var label2 = getOptionLabel2(props, option);
var value2 = getOptionValue2(props, option);
return {
type: "option",
data: option,
isDisabled,
isSelected,
label: label2,
value: value2,
index: index2
};
}
function buildCategorizedOptions(props, selectValue) {
return props.options.map(function(groupOrOption, groupOrOptionIndex) {
if ("options" in groupOrOption) {
var categorizedOptions = groupOrOption.options.map(function(option, optionIndex) {
return toCategorizedOption(props, option, selectValue, optionIndex);
}).filter(function(categorizedOption2) {
return isFocusable(props, categorizedOption2);
});
return categorizedOptions.length > 0 ? {
type: "group",
data: groupOrOption,
options: categorizedOptions,
index: groupOrOptionIndex
} : void 0;
}
var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex);
return isFocusable(props, categorizedOption) ? categorizedOption : void 0;
}).filter(notNullish);
}
function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
return categorizedOptions.reduce(function(optionsAccumulator, categorizedOption) {
if (categorizedOption.type === "group") {
optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray$2(categorizedOption.options.map(function(option) {
return option.data;
})));
} else {
optionsAccumulator.push(categorizedOption.data);
}
return optionsAccumulator;
}, []);
}
function buildFocusableOptions(props, selectValue) {
return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
}
function isFocusable(props, categorizedOption) {
var _props$inputValue = props.inputValue, inputValue = _props$inputValue === void 0 ? "" : _props$inputValue;
var data2 = categorizedOption.data, isSelected = categorizedOption.isSelected, label2 = categorizedOption.label, value2 = categorizedOption.value;
return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, {
label: label2,
value: value2,
data: data2
}, inputValue);
}
function getNextFocusedValue(state, nextSelectValue) {
var focusedValue = state.focusedValue, lastSelectValue = state.selectValue;
var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);
if (lastFocusedIndex > -1) {
var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);
if (nextFocusedIndex > -1) {
return focusedValue;
} else if (lastFocusedIndex < nextSelectValue.length) {
return nextSelectValue[lastFocusedIndex];
}
}
return null;
}
function getNextFocusedOption(state, options2) {
var lastFocusedOption = state.focusedOption;
return lastFocusedOption && options2.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options2[0];
}
var getOptionLabel2 = function getOptionLabel3(props, data2) {
return props.getOptionLabel(data2);
};
var getOptionValue2 = function getOptionValue3(props, data2) {
return props.getOptionValue(data2);
};
function _isOptionDisabled(props, option, selectValue) {
return typeof props.isOptionDisabled === "function" ? props.isOptionDisabled(option, selectValue) : false;
}
function _isOptionSelected(props, option, selectValue) {
if (selectValue.indexOf(option) > -1)
return true;
if (typeof props.isOptionSelected === "function") {
return props.isOptionSelected(option, selectValue);
}
var candidate = getOptionValue2(props, option);
return selectValue.some(function(i2) {
return getOptionValue2(props, i2) === candidate;
});
}
function _filterOption(props, option, inputValue) {
return props.filterOption ? props.filterOption(option, inputValue) : true;
}
var shouldHideSelectedOptions = function shouldHideSelectedOptions2(props) {
var hideSelectedOptions = props.hideSelectedOptions, isMulti = props.isMulti;
if (hideSelectedOptions === void 0)
return isMulti;
return hideSelectedOptions;
};
var instanceId = 1;
var Select = /* @__PURE__ */ function(_Component) {
_inherits(Select2, _Component);
var _super = _createSuper$4(Select2);
function Select2(_props) {
var _this;
_classCallCheck$1(this, Select2);
_this = _super.call(this, _props);
_this.state = {
ariaSelection: null,
focusedOption: null,
focusedValue: null,
inputIsHidden: false,
isFocused: false,
selectValue: [],
clearFocusValueOnUpdate: false,
prevWasFocused: false,
inputIsHiddenAfterUpdate: void 0,
prevProps: void 0
};
_this.blockOptionHover = false;
_this.isComposing = false;
_this.commonProps = void 0;
_this.initialTouchX = 0;
_this.initialTouchY = 0;
_this.instancePrefix = "";
_this.openAfterFocus = false;
_this.scrollToFocusedOptionOnUpdate = false;
_this.userIsDragging = void 0;
_this.controlRef = null;
_this.getControlRef = function(ref2) {
_this.controlRef = ref2;
};
_this.focusedOptionRef = null;
_this.getFocusedOptionRef = function(ref2) {
_this.focusedOptionRef = ref2;
};
_this.menuListRef = null;
_this.getMenuListRef = function(ref2) {
_this.menuListRef = ref2;
};
_this.inputRef = null;
_this.getInputRef = function(ref2) {
_this.inputRef = ref2;
};
_this.focus = _this.focusInput;
_this.blur = _this.blurInput;
_this.onChange = function(newValue, actionMeta) {
var _this$props = _this.props, onChange2 = _this$props.onChange, name = _this$props.name;
actionMeta.name = name;
_this.ariaOnChange(newValue, actionMeta);
onChange2(newValue, actionMeta);
};
_this.setValue = function(newValue, action, option) {
var _this$props2 = _this.props, closeMenuOnSelect = _this$props2.closeMenuOnSelect, isMulti = _this$props2.isMulti, inputValue = _this$props2.inputValue;
_this.onInputChange("", {
action: "set-value",
prevInputValue: inputValue
});
if (closeMenuOnSelect) {
_this.setState({
inputIsHiddenAfterUpdate: !isMulti
});
_this.onMenuClose();
}
_this.setState({
clearFocusValueOnUpdate: true
});
_this.onChange(newValue, {
action,
option
});
};
_this.selectOption = function(newValue) {
var _this$props3 = _this.props, blurInputOnSelect = _this$props3.blurInputOnSelect, isMulti = _this$props3.isMulti, name = _this$props3.name;
var selectValue = _this.state.selectValue;
var deselected = isMulti && _this.isOptionSelected(newValue, selectValue);
var isDisabled = _this.isOptionDisabled(newValue, selectValue);
if (deselected) {
var candidate = _this.getOptionValue(newValue);
_this.setValue(multiValueAsValue(selectValue.filter(function(i2) {
return _this.getOptionValue(i2) !== candidate;
})), "deselect-option", newValue);
} else if (!isDisabled) {
if (isMulti) {
_this.setValue(multiValueAsValue([].concat(_toConsumableArray$2(selectValue), [newValue])), "select-option", newValue);
} else {
_this.setValue(singleValueAsValue(newValue), "select-option");
}
} else {
_this.ariaOnChange(singleValueAsValue(newValue), {
action: "select-option",
option: newValue,
name
});
return;
}
if (blurInputOnSelect) {
_this.blurInput();
}
};
_this.removeValue = function(removedValue) {
var isMulti = _this.props.isMulti;
var selectValue = _this.state.selectValue;
var candidate = _this.getOptionValue(removedValue);
var newValueArray = selectValue.filter(function(i2) {
return _this.getOptionValue(i2) !== candidate;
});
var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
_this.onChange(newValue, {
action: "remove-value",
removedValue
});
_this.focusInput();
};
_this.clearValue = function() {
var selectValue = _this.state.selectValue;
_this.onChange(valueTernary(_this.props.isMulti, [], null), {
action: "clear",
removedValues: selectValue
});
};
_this.popValue = function() {
var isMulti = _this.props.isMulti;
var selectValue = _this.state.selectValue;
var lastSelectedValue = selectValue[selectValue.length - 1];
var newValueArray = selectValue.slice(0, selectValue.length - 1);
var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
_this.onChange(newValue, {
action: "pop-value",
removedValue: lastSelectedValue
});
};
_this.getValue = function() {
return _this.state.selectValue;
};
_this.cx = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
};
_this.getOptionLabel = function(data2) {
return getOptionLabel2(_this.props, data2);
};
_this.getOptionValue = function(data2) {
return getOptionValue2(_this.props, data2);
};
_this.getStyles = function(key2, props) {
var unstyled = _this.props.unstyled;
var base2 = defaultStyles[key2](props, unstyled);
base2.boxSizing = "border-box";
var custom11 = _this.props.styles[key2];
return custom11 ? custom11(base2, props) : base2;
};
_this.getClassNames = function(key2, props) {
var _this$props$className, _this$props$className2;
return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key2]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
};
_this.getElementId = function(element2) {
return "".concat(_this.instancePrefix, "-").concat(element2);
};
_this.getComponents = function() {
return defaultComponents(_this.props);
};
_this.buildCategorizedOptions = function() {
return buildCategorizedOptions(_this.props, _this.state.selectValue);
};
_this.getCategorizedOptions = function() {
return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : [];
};
_this.buildFocusableOptions = function() {
return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions());
};
_this.getFocusableOptions = function() {
return _this.props.menuIsOpen ? _this.buildFocusableOptions() : [];
};
_this.ariaOnChange = function(value2, actionMeta) {
_this.setState({
ariaSelection: _objectSpread2({
value: value2
}, actionMeta)
});
};
_this.onMenuMouseDown = function(event2) {
if (event2.button !== 0) {
return;
}
event2.stopPropagation();
event2.preventDefault();
_this.focusInput();
};
_this.onMenuMouseMove = function(event2) {
_this.blockOptionHover = false;
};
_this.onControlMouseDown = function(event2) {
if (event2.defaultPrevented) {
return;
}
var openMenuOnClick = _this.props.openMenuOnClick;
if (!_this.state.isFocused) {
if (openMenuOnClick) {
_this.openAfterFocus = true;
}
_this.focusInput();
} else if (!_this.props.menuIsOpen) {
if (openMenuOnClick) {
_this.openMenu("first");
}
} else {
if (event2.target.tagName !== "INPUT" && event2.target.tagName !== "TEXTAREA") {
_this.onMenuClose();
}
}
if (event2.target.tagName !== "INPUT" && event2.target.tagName !== "TEXTAREA") {
event2.preventDefault();
}
};
_this.onDropdownIndicatorMouseDown = function(event2) {
if (event2 && event2.type === "mousedown" && event2.button !== 0) {
return;
}
if (_this.props.isDisabled)
return;
var _this$props4 = _this.props, isMulti = _this$props4.isMulti, menuIsOpen = _this$props4.menuIsOpen;
_this.focusInput();
if (menuIsOpen) {
_this.setState({
inputIsHiddenAfterUpdate: !isMulti
});
_this.onMenuClose();
} else {
_this.openMenu("first");
}
event2.preventDefault();
};
_this.onClearIndicatorMouseDown = function(event2) {
if (event2 && event2.type === "mousedown" && event2.button !== 0) {
return;
}
_this.clearValue();
event2.preventDefault();
_this.openAfterFocus = false;
if (event2.type === "touchend") {
_this.focusInput();
} else {
setTimeout(function() {
return _this.focusInput();
});
}
};
_this.onScroll = function(event2) {
if (typeof _this.props.closeMenuOnScroll === "boolean") {
if (event2.target instanceof HTMLElement && isDocumentElement(event2.target)) {
_this.props.onMenuClose();
}
} else if (typeof _this.props.closeMenuOnScroll === "function") {
if (_this.props.closeMenuOnScroll(event2)) {
_this.props.onMenuClose();
}
}
};
_this.onCompositionStart = function() {
_this.isComposing = true;
};
_this.onCompositionEnd = function() {
_this.isComposing = false;
};
_this.onTouchStart = function(_ref22) {
var touches = _ref22.touches;
var touch2 = touches && touches.item(0);
if (!touch2) {
return;
}
_this.initialTouchX = touch2.clientX;
_this.initialTouchY = touch2.clientY;
_this.userIsDragging = false;
};
_this.onTouchMove = function(_ref3) {
var touches = _ref3.touches;
var touch2 = touches && touches.item(0);
if (!touch2) {
return;
}
var deltaX = Math.abs(touch2.clientX - _this.initialTouchX);
var deltaY = Math.abs(touch2.clientY - _this.initialTouchY);
var moveThreshold = 5;
_this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;
};
_this.onTouchEnd = function(event2) {
if (_this.userIsDragging)
return;
if (_this.controlRef && !_this.controlRef.contains(event2.target) && _this.menuListRef && !_this.menuListRef.contains(event2.target)) {
_this.blurInput();
}
_this.initialTouchX = 0;
_this.initialTouchY = 0;
};
_this.onControlTouchEnd = function(event2) {
if (_this.userIsDragging)
return;
_this.onControlMouseDown(event2);
};
_this.onClearIndicatorTouchEnd = function(event2) {
if (_this.userIsDragging)
return;
_this.onClearIndicatorMouseDown(event2);
};
_this.onDropdownIndicatorTouchEnd = function(event2) {
if (_this.userIsDragging)
return;
_this.onDropdownIndicatorMouseDown(event2);
};
_this.handleInputChange = function(event2) {
var prevInputValue = _this.props.inputValue;
var inputValue = event2.currentTarget.value;
_this.setState({
inputIsHiddenAfterUpdate: false
});
_this.onInputChange(inputValue, {
action: "input-change",
prevInputValue
});
if (!_this.props.menuIsOpen) {
_this.onMenuOpen();
}
};
_this.onInputFocus = function(event2) {
if (_this.props.onFocus) {
_this.props.onFocus(event2);
}
_this.setState({
inputIsHiddenAfterUpdate: false,
isFocused: true
});
if (_this.openAfterFocus || _this.props.openMenuOnFocus) {
_this.openMenu("first");
}
_this.openAfterFocus = false;
};
_this.onInputBlur = function(event2) {
var prevInputValue = _this.props.inputValue;
if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {
_this.inputRef.focus();
return;
}
if (_this.props.onBlur) {
_this.props.onBlur(event2);
}
_this.onInputChange("", {
action: "input-blur",
prevInputValue
});
_this.onMenuClose();
_this.setState({
focusedValue: null,
isFocused: false
});
};
_this.onOptionHover = function(focusedOption) {
if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
return;
}
_this.setState({
focusedOption
});
};
_this.shouldHideSelectedOptions = function() {
return shouldHideSelectedOptions(_this.props);
};
_this.onValueInputFocus = function(e7) {
e7.preventDefault();
e7.stopPropagation();
_this.focus();
};
_this.onKeyDown = function(event2) {
var _this$props5 = _this.props, isMulti = _this$props5.isMulti, backspaceRemovesValue = _this$props5.backspaceRemovesValue, escapeClearsValue = _this$props5.escapeClearsValue, inputValue = _this$props5.inputValue, isClearable = _this$props5.isClearable, isDisabled = _this$props5.isDisabled, menuIsOpen = _this$props5.menuIsOpen, onKeyDown = _this$props5.onKeyDown, tabSelectsValue = _this$props5.tabSelectsValue, openMenuOnFocus = _this$props5.openMenuOnFocus;
var _this$state = _this.state, focusedOption = _this$state.focusedOption, focusedValue = _this$state.focusedValue, selectValue = _this$state.selectValue;
if (isDisabled)
return;
if (typeof onKeyDown === "function") {
onKeyDown(event2);
if (event2.defaultPrevented) {
return;
}
}
_this.blockOptionHover = true;
switch (event2.key) {
case "ArrowLeft":
if (!isMulti || inputValue)
return;
_this.focusValue("previous");
break;
case "ArrowRight":
if (!isMulti || inputValue)
return;
_this.focusValue("next");
break;
case "Delete":
case "Backspace":
if (inputValue)
return;
if (focusedValue) {
_this.removeValue(focusedValue);
} else {
if (!backspaceRemovesValue)
return;
if (isMulti) {
_this.popValue();
} else if (isClearable) {
_this.clearValue();
}
}
break;
case "Tab":
if (_this.isComposing)
return;
if (event2.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || // don't capture the event if the menu opens on focus and the focused
// option is already selected; it breaks the flow of navigation
openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {
return;
}
_this.selectOption(focusedOption);
break;
case "Enter":
if (event2.keyCode === 229) {
break;
}
if (menuIsOpen) {
if (!focusedOption)
return;
if (_this.isComposing)
return;
_this.selectOption(focusedOption);
break;
}
return;
case "Escape":
if (menuIsOpen) {
_this.setState({
inputIsHiddenAfterUpdate: false
});
_this.onInputChange("", {
action: "menu-close",
prevInputValue: inputValue
});
_this.onMenuClose();
} else if (isClearable && escapeClearsValue) {
_this.clearValue();
}
break;
case " ":
if (inputValue) {
return;
}
if (!menuIsOpen) {
_this.openMenu("first");
break;
}
if (!focusedOption)
return;
_this.selectOption(focusedOption);
break;
case "ArrowUp":
if (menuIsOpen) {
_this.focusOption("up");
} else {
_this.openMenu("last");
}
break;
case "ArrowDown":
if (menuIsOpen) {
_this.focusOption("down");
} else {
_this.openMenu("first");
}
break;
case "PageUp":
if (!menuIsOpen)
return;
_this.focusOption("pageup");
break;
case "PageDown":
if (!menuIsOpen)
return;
_this.focusOption("pagedown");
break;
case "Home":
if (!menuIsOpen)
return;
_this.focusOption("first");
break;
case "End":
if (!menuIsOpen)
return;
_this.focusOption("last");
break;
default:
return;
}
event2.preventDefault();
};
_this.instancePrefix = "react-select-" + (_this.props.instanceId || ++instanceId);
_this.state.selectValue = cleanValue(_props.value);
if (_props.menuIsOpen && _this.state.selectValue.length) {
var focusableOptions = _this.buildFocusableOptions();
var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
_this.state.focusedOption = focusableOptions[optionIndex];
}
return _this;
}
_createClass(Select2, [{
key: "componentDidMount",
value: function componentDidMount() {
this.startListeningComposition();
this.startListeningToTouch();
if (this.props.closeMenuOnScroll && document && document.addEventListener) {
document.addEventListener("scroll", this.onScroll, true);
}
if (this.props.autoFocus) {
this.focusInput();
}
if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) {
scrollIntoView(this.menuListRef, this.focusedOptionRef);
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var _this$props6 = this.props, isDisabled = _this$props6.isDisabled, menuIsOpen = _this$props6.menuIsOpen;
var isFocused = this.state.isFocused;
if (
// ensure focus is restored correctly when the control becomes enabled
isFocused && !isDisabled && prevProps.isDisabled || // ensure focus is on the Input when the menu opens
isFocused && menuIsOpen && !prevProps.menuIsOpen
) {
this.focusInput();
}
if (isFocused && isDisabled && !prevProps.isDisabled) {
this.setState({
isFocused: false
}, this.onMenuClose);
} else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
this.setState({
isFocused: true
});
}
if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
scrollIntoView(this.menuListRef, this.focusedOptionRef);
this.scrollToFocusedOptionOnUpdate = false;
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.stopListeningComposition();
this.stopListeningToTouch();
document.removeEventListener("scroll", this.onScroll, true);
}
// ==============================
// Consumer Handlers
// ==============================
}, {
key: "onMenuOpen",
value: function onMenuOpen() {
this.props.onMenuOpen();
}
}, {
key: "onMenuClose",
value: function onMenuClose() {
this.onInputChange("", {
action: "menu-close",
prevInputValue: this.props.inputValue
});
this.props.onMenuClose();
}
}, {
key: "onInputChange",
value: function onInputChange(newValue, actionMeta) {
this.props.onInputChange(newValue, actionMeta);
}
// ==============================
// Methods
// ==============================
}, {
key: "focusInput",
value: function focusInput() {
if (!this.inputRef)
return;
this.inputRef.focus();
}
}, {
key: "blurInput",
value: function blurInput() {
if (!this.inputRef)
return;
this.inputRef.blur();
}
// aliased for consumers
}, {
key: "openMenu",
value: function openMenu(focusOption) {
var _this2 = this;
var _this$state2 = this.state, selectValue = _this$state2.selectValue, isFocused = _this$state2.isFocused;
var focusableOptions = this.buildFocusableOptions();
var openAtIndex = focusOption === "first" ? 0 : focusableOptions.length - 1;
if (!this.props.isMulti) {
var selectedIndex = focusableOptions.indexOf(selectValue[0]);
if (selectedIndex > -1) {
openAtIndex = selectedIndex;
}
}
this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
this.setState({
inputIsHiddenAfterUpdate: false,
focusedValue: null,
focusedOption: focusableOptions[openAtIndex]
}, function() {
return _this2.onMenuOpen();
});
}
}, {
key: "focusValue",
value: function focusValue(direction2) {
var _this$state3 = this.state, selectValue = _this$state3.selectValue, focusedValue = _this$state3.focusedValue;
if (!this.props.isMulti)
return;
this.setState({
focusedOption: null
});
var focusedIndex = selectValue.indexOf(focusedValue);
if (!focusedValue) {
focusedIndex = -1;
}
var lastIndex = selectValue.length - 1;
var nextFocus = -1;
if (!selectValue.length)
return;
switch (direction2) {
case "previous":
if (focusedIndex === 0) {
nextFocus = 0;
} else if (focusedIndex === -1) {
nextFocus = lastIndex;
} else {
nextFocus = focusedIndex - 1;
}
break;
case "next":
if (focusedIndex > -1 && focusedIndex < lastIndex) {
nextFocus = focusedIndex + 1;
}
break;
}
this.setState({
inputIsHidden: nextFocus !== -1,
focusedValue: selectValue[nextFocus]
});
}
}, {
key: "focusOption",
value: function focusOption() {
var direction2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "first";
var pageSize = this.props.pageSize;
var focusedOption = this.state.focusedOption;
var options2 = this.getFocusableOptions();
if (!options2.length)
return;
var nextFocus = 0;
var focusedIndex = options2.indexOf(focusedOption);
if (!focusedOption) {
focusedIndex = -1;
}
if (direction2 === "up") {
nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options2.length - 1;
} else if (direction2 === "down") {
nextFocus = (focusedIndex + 1) % options2.length;
} else if (direction2 === "pageup") {
nextFocus = focusedIndex - pageSize;
if (nextFocus < 0)
nextFocus = 0;
} else if (direction2 === "pagedown") {
nextFocus = focusedIndex + pageSize;
if (nextFocus > options2.length - 1)
nextFocus = options2.length - 1;
} else if (direction2 === "last") {
nextFocus = options2.length - 1;
}
this.scrollToFocusedOptionOnUpdate = true;
this.setState({
focusedOption: options2[nextFocus],
focusedValue: null
});
}
}, {
key: "getTheme",
value: (
// ==============================
// Getters
// ==============================
function getTheme3() {
if (!this.props.theme) {
return defaultTheme;
}
if (typeof this.props.theme === "function") {
return this.props.theme(defaultTheme);
}
return _objectSpread2(_objectSpread2({}, defaultTheme), this.props.theme);
}
)
}, {
key: "getCommonProps",
value: function getCommonProps() {
var clearValue = this.clearValue, cx = this.cx, getStyles = this.getStyles, getClassNames = this.getClassNames, getValue2 = this.getValue, selectOption = this.selectOption, setValue = this.setValue, props = this.props;
var isMulti = props.isMulti, isRtl = props.isRtl, options2 = props.options;
var hasValue = this.hasValue();
return {
clearValue,
cx,
getStyles,
getClassNames,
getValue: getValue2,
hasValue,
isMulti,
isRtl,
options: options2,
selectOption,
selectProps: props,
setValue,
theme: this.getTheme()
};
}
}, {
key: "hasValue",
value: function hasValue() {
var selectValue = this.state.selectValue;
return selectValue.length > 0;
}
}, {
key: "hasOptions",
value: function hasOptions() {
return !!this.getFocusableOptions().length;
}
}, {
key: "isClearable",
value: function isClearable() {
var _this$props7 = this.props, isClearable2 = _this$props7.isClearable, isMulti = _this$props7.isMulti;
if (isClearable2 === void 0)
return isMulti;
return isClearable2;
}
}, {
key: "isOptionDisabled",
value: function isOptionDisabled3(option, selectValue) {
return _isOptionDisabled(this.props, option, selectValue);
}
}, {
key: "isOptionSelected",
value: function isOptionSelected(option, selectValue) {
return _isOptionSelected(this.props, option, selectValue);
}
}, {
key: "filterOption",
value: function filterOption(option, inputValue) {
return _filterOption(this.props, option, inputValue);
}
}, {
key: "formatOptionLabel",
value: function formatOptionLabel(data2, context2) {
if (typeof this.props.formatOptionLabel === "function") {
var _inputValue = this.props.inputValue;
var _selectValue = this.state.selectValue;
return this.props.formatOptionLabel(data2, {
context: context2,
inputValue: _inputValue,
selectValue: _selectValue
});
} else {
return this.getOptionLabel(data2);
}
}
}, {
key: "formatGroupLabel",
value: function formatGroupLabel3(data2) {
return this.props.formatGroupLabel(data2);
}
// ==============================
// Mouse Handlers
// ==============================
}, {
key: "startListeningComposition",
value: (
// ==============================
// Composition Handlers
// ==============================
function startListeningComposition() {
if (document && document.addEventListener) {
document.addEventListener("compositionstart", this.onCompositionStart, false);
document.addEventListener("compositionend", this.onCompositionEnd, false);
}
}
)
}, {
key: "stopListeningComposition",
value: function stopListeningComposition() {
if (document && document.removeEventListener) {
document.removeEventListener("compositionstart", this.onCompositionStart);
document.removeEventListener("compositionend", this.onCompositionEnd);
}
}
}, {
key: "startListeningToTouch",
value: (
// ==============================
// Touch Handlers
// ==============================
function startListeningToTouch() {
if (document && document.addEventListener) {
document.addEventListener("touchstart", this.onTouchStart, false);
document.addEventListener("touchmove", this.onTouchMove, false);
document.addEventListener("touchend", this.onTouchEnd, false);
}
}
)
}, {
key: "stopListeningToTouch",
value: function stopListeningToTouch() {
if (document && document.removeEventListener) {
document.removeEventListener("touchstart", this.onTouchStart);
document.removeEventListener("touchmove", this.onTouchMove);
document.removeEventListener("touchend", this.onTouchEnd);
}
}
}, {
key: "renderInput",
value: (
// ==============================
// Renderers
// ==============================
function renderInput() {
var _this$props8 = this.props, isDisabled = _this$props8.isDisabled, isSearchable = _this$props8.isSearchable, inputId = _this$props8.inputId, inputValue = _this$props8.inputValue, tabIndex = _this$props8.tabIndex, form2 = _this$props8.form, menuIsOpen = _this$props8.menuIsOpen, required2 = _this$props8.required;
var _this$getComponents = this.getComponents(), Input3 = _this$getComponents.Input;
var _this$state4 = this.state, inputIsHidden = _this$state4.inputIsHidden, ariaSelection = _this$state4.ariaSelection;
var commonProps = this.commonProps;
var id = inputId || this.getElementId("input");
var ariaAttributes = _objectSpread2(_objectSpread2(_objectSpread2({
"aria-autocomplete": "list",
"aria-expanded": menuIsOpen,
"aria-haspopup": true,
"aria-errormessage": this.props["aria-errormessage"],
"aria-invalid": this.props["aria-invalid"],
"aria-label": this.props["aria-label"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-required": required2,
role: "combobox"
}, menuIsOpen && {
"aria-controls": this.getElementId("listbox"),
"aria-owns": this.getElementId("listbox")
}), !isSearchable && {
"aria-readonly": true
}), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === "initial-input-focus" && {
"aria-describedby": this.getElementId("live-region")
} : {
"aria-describedby": this.getElementId("placeholder")
});
if (!isSearchable) {
return /* @__PURE__ */ reactExports.createElement(DummyInput, _extends$3({
id,
innerRef: this.getInputRef,
onBlur: this.onInputBlur,
onChange: noop$c,
onFocus: this.onInputFocus,
disabled: isDisabled,
tabIndex,
inputMode: "none",
form: form2,
value: ""
}, ariaAttributes));
}
return /* @__PURE__ */ reactExports.createElement(Input3, _extends$3({}, commonProps, {
autoCapitalize: "none",
autoComplete: "off",
autoCorrect: "off",
id,
innerRef: this.getInputRef,
isDisabled,
isHidden: inputIsHidden,
onBlur: this.onInputBlur,
onChange: this.handleInputChange,
onFocus: this.onInputFocus,
spellCheck: "false",
tabIndex,
form: form2,
type: "text",
value: inputValue
}, ariaAttributes));
}
)
}, {
key: "renderPlaceholderOrValue",
value: function renderPlaceholderOrValue() {
var _this3 = this;
var _this$getComponents2 = this.getComponents(), MultiValue3 = _this$getComponents2.MultiValue, MultiValueContainer2 = _this$getComponents2.MultiValueContainer, MultiValueLabel2 = _this$getComponents2.MultiValueLabel, MultiValueRemove2 = _this$getComponents2.MultiValueRemove, SingleValue3 = _this$getComponents2.SingleValue, Placeholder3 = _this$getComponents2.Placeholder;
var commonProps = this.commonProps;
var _this$props9 = this.props, controlShouldRenderValue = _this$props9.controlShouldRenderValue, isDisabled = _this$props9.isDisabled, isMulti = _this$props9.isMulti, inputValue = _this$props9.inputValue, placeholder = _this$props9.placeholder;
var _this$state5 = this.state, selectValue = _this$state5.selectValue, focusedValue = _this$state5.focusedValue, isFocused = _this$state5.isFocused;
if (!this.hasValue() || !controlShouldRenderValue) {
return inputValue ? null : /* @__PURE__ */ reactExports.createElement(Placeholder3, _extends$3({}, commonProps, {
key: "placeholder",
isDisabled,
isFocused,
innerProps: {
id: this.getElementId("placeholder")
}
}), placeholder);
}
if (isMulti) {
return selectValue.map(function(opt, index2) {
var isOptionFocused = opt === focusedValue;
var key2 = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
return /* @__PURE__ */ reactExports.createElement(MultiValue3, _extends$3({}, commonProps, {
components: {
Container: MultiValueContainer2,
Label: MultiValueLabel2,
Remove: MultiValueRemove2
},
isFocused: isOptionFocused,
isDisabled,
key: key2,
index: index2,
removeProps: {
onClick: function onClick() {
return _this3.removeValue(opt);
},
onTouchEnd: function onTouchEnd() {
return _this3.removeValue(opt);
},
onMouseDown: function onMouseDown(e7) {
e7.preventDefault();
}
},
data: opt
}), _this3.formatOptionLabel(opt, "value"));
});
}
if (inputValue) {
return null;
}
var singleValue = selectValue[0];
return /* @__PURE__ */ reactExports.createElement(SingleValue3, _extends$3({}, commonProps, {
data: singleValue,
isDisabled
}), this.formatOptionLabel(singleValue, "value"));
}
}, {
key: "renderClearIndicator",
value: function renderClearIndicator() {
var _this$getComponents3 = this.getComponents(), ClearIndicator3 = _this$getComponents3.ClearIndicator;
var commonProps = this.commonProps;
var _this$props10 = this.props, isDisabled = _this$props10.isDisabled, isLoading = _this$props10.isLoading;
var isFocused = this.state.isFocused;
if (!this.isClearable() || !ClearIndicator3 || isDisabled || !this.hasValue() || isLoading) {
return null;
}
var innerProps = {
onMouseDown: this.onClearIndicatorMouseDown,
onTouchEnd: this.onClearIndicatorTouchEnd,
"aria-hidden": "true"
};
return /* @__PURE__ */ reactExports.createElement(ClearIndicator3, _extends$3({}, commonProps, {
innerProps,
isFocused
}));
}
}, {
key: "renderLoadingIndicator",
value: function renderLoadingIndicator() {
var _this$getComponents4 = this.getComponents(), LoadingIndicator3 = _this$getComponents4.LoadingIndicator;
var commonProps = this.commonProps;
var _this$props11 = this.props, isDisabled = _this$props11.isDisabled, isLoading = _this$props11.isLoading;
var isFocused = this.state.isFocused;
if (!LoadingIndicator3 || !isLoading)
return null;
var innerProps = {
"aria-hidden": "true"
};
return /* @__PURE__ */ reactExports.createElement(LoadingIndicator3, _extends$3({}, commonProps, {
innerProps,
isDisabled,
isFocused
}));
}
}, {
key: "renderIndicatorSeparator",
value: function renderIndicatorSeparator() {
var _this$getComponents5 = this.getComponents(), DropdownIndicator3 = _this$getComponents5.DropdownIndicator, IndicatorSeparator3 = _this$getComponents5.IndicatorSeparator;
if (!DropdownIndicator3 || !IndicatorSeparator3)
return null;
var commonProps = this.commonProps;
var isDisabled = this.props.isDisabled;
var isFocused = this.state.isFocused;
return /* @__PURE__ */ reactExports.createElement(IndicatorSeparator3, _extends$3({}, commonProps, {
isDisabled,
isFocused
}));
}
}, {
key: "renderDropdownIndicator",
value: function renderDropdownIndicator() {
var _this$getComponents6 = this.getComponents(), DropdownIndicator3 = _this$getComponents6.DropdownIndicator;
if (!DropdownIndicator3)
return null;
var commonProps = this.commonProps;
var isDisabled = this.props.isDisabled;
var isFocused = this.state.isFocused;
var innerProps = {
onMouseDown: this.onDropdownIndicatorMouseDown,
onTouchEnd: this.onDropdownIndicatorTouchEnd,
"aria-hidden": "true"
};
return /* @__PURE__ */ reactExports.createElement(DropdownIndicator3, _extends$3({}, commonProps, {
innerProps,
isDisabled,
isFocused
}));
}
}, {
key: "renderMenu",
value: function renderMenu() {
var _this4 = this;
var _this$getComponents7 = this.getComponents(), Group3 = _this$getComponents7.Group, GroupHeading3 = _this$getComponents7.GroupHeading, Menu3 = _this$getComponents7.Menu, MenuList3 = _this$getComponents7.MenuList, MenuPortal3 = _this$getComponents7.MenuPortal, LoadingMessage3 = _this$getComponents7.LoadingMessage, NoOptionsMessage3 = _this$getComponents7.NoOptionsMessage, Option3 = _this$getComponents7.Option;
var commonProps = this.commonProps;
var focusedOption = this.state.focusedOption;
var _this$props12 = this.props, captureMenuScroll = _this$props12.captureMenuScroll, inputValue = _this$props12.inputValue, isLoading = _this$props12.isLoading, loadingMessage2 = _this$props12.loadingMessage, minMenuHeight = _this$props12.minMenuHeight, maxMenuHeight = _this$props12.maxMenuHeight, menuIsOpen = _this$props12.menuIsOpen, menuPlacement = _this$props12.menuPlacement, menuPosition = _this$props12.menuPosition, menuPortalTarget = _this$props12.menuPortalTarget, menuShouldBlockScroll = _this$props12.menuShouldBlockScroll, menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView, noOptionsMessage2 = _this$props12.noOptionsMessage, onMenuScrollToTop = _this$props12.onMenuScrollToTop, onMenuScrollToBottom = _this$props12.onMenuScrollToBottom;
if (!menuIsOpen)
return null;
var render3 = function render4(props, id) {
var type2 = props.type, data2 = props.data, isDisabled = props.isDisabled, isSelected = props.isSelected, label2 = props.label, value2 = props.value;
var isFocused = focusedOption === data2;
var onHover = isDisabled ? void 0 : function() {
return _this4.onOptionHover(data2);
};
var onSelect = isDisabled ? void 0 : function() {
return _this4.selectOption(data2);
};
var optionId = "".concat(_this4.getElementId("option"), "-").concat(id);
var innerProps = {
id: optionId,
onClick: onSelect,
onMouseMove: onHover,
onMouseOver: onHover,
tabIndex: -1
};
return /* @__PURE__ */ reactExports.createElement(Option3, _extends$3({}, commonProps, {
innerProps,
data: data2,
isDisabled,
isSelected,
key: optionId,
label: label2,
type: type2,
value: value2,
isFocused,
innerRef: isFocused ? _this4.getFocusedOptionRef : void 0
}), _this4.formatOptionLabel(props.data, "menu"));
};
var menuUI;
if (this.hasOptions()) {
menuUI = this.getCategorizedOptions().map(function(item) {
if (item.type === "group") {
var _data = item.data, options2 = item.options, groupIndex = item.index;
var groupId = "".concat(_this4.getElementId("group"), "-").concat(groupIndex);
var headingId = "".concat(groupId, "-heading");
return /* @__PURE__ */ reactExports.createElement(Group3, _extends$3({}, commonProps, {
key: groupId,
data: _data,
options: options2,
Heading: GroupHeading3,
headingProps: {
id: headingId,
data: item.data
},
label: _this4.formatGroupLabel(item.data)
}), item.options.map(function(option) {
return render3(option, "".concat(groupIndex, "-").concat(option.index));
}));
} else if (item.type === "option") {
return render3(item, "".concat(item.index));
}
});
} else if (isLoading) {
var message = loadingMessage2({
inputValue
});
if (message === null)
return null;
menuUI = /* @__PURE__ */ reactExports.createElement(LoadingMessage3, commonProps, message);
} else {
var _message = noOptionsMessage2({
inputValue
});
if (_message === null)
return null;
menuUI = /* @__PURE__ */ reactExports.createElement(NoOptionsMessage3, commonProps, _message);
}
var menuPlacementProps = {
minMenuHeight,
maxMenuHeight,
menuPlacement,
menuPosition,
menuShouldScrollIntoView
};
var menuElement = /* @__PURE__ */ reactExports.createElement(MenuPlacer, _extends$3({}, commonProps, menuPlacementProps), function(_ref4) {
var ref2 = _ref4.ref, _ref4$placerProps = _ref4.placerProps, placement = _ref4$placerProps.placement, maxHeight = _ref4$placerProps.maxHeight;
return /* @__PURE__ */ reactExports.createElement(Menu3, _extends$3({}, commonProps, menuPlacementProps, {
innerRef: ref2,
innerProps: {
onMouseDown: _this4.onMenuMouseDown,
onMouseMove: _this4.onMenuMouseMove,
id: _this4.getElementId("listbox")
},
isLoading,
placement
}), /* @__PURE__ */ reactExports.createElement(ScrollManager, {
captureEnabled: captureMenuScroll,
onTopArrive: onMenuScrollToTop,
onBottomArrive: onMenuScrollToBottom,
lockEnabled: menuShouldBlockScroll
}, function(scrollTargetRef) {
return /* @__PURE__ */ reactExports.createElement(MenuList3, _extends$3({}, commonProps, {
innerRef: function innerRef(instance2) {
_this4.getMenuListRef(instance2);
scrollTargetRef(instance2);
},
isLoading,
maxHeight,
focusedOption
}), menuUI);
}));
});
return menuPortalTarget || menuPosition === "fixed" ? /* @__PURE__ */ reactExports.createElement(MenuPortal3, _extends$3({}, commonProps, {
appendTo: menuPortalTarget,
controlElement: this.controlRef,
menuPlacement,
menuPosition
}), menuElement) : menuElement;
}
}, {
key: "renderFormField",
value: function renderFormField() {
var _this5 = this;
var _this$props13 = this.props, delimiter2 = _this$props13.delimiter, isDisabled = _this$props13.isDisabled, isMulti = _this$props13.isMulti, name = _this$props13.name, required2 = _this$props13.required;
var selectValue = this.state.selectValue;
if (required2 && !this.hasValue() && !isDisabled) {
return /* @__PURE__ */ reactExports.createElement(RequiredInput$1, {
name,
onFocus: this.onValueInputFocus
});
}
if (!name || isDisabled)
return;
if (isMulti) {
if (delimiter2) {
var value2 = selectValue.map(function(opt) {
return _this5.getOptionValue(opt);
}).join(delimiter2);
return /* @__PURE__ */ reactExports.createElement("input", {
name,
type: "hidden",
value: value2
});
} else {
var input = selectValue.length > 0 ? selectValue.map(function(opt, i2) {
return /* @__PURE__ */ reactExports.createElement("input", {
key: "i-".concat(i2),
name,
type: "hidden",
value: _this5.getOptionValue(opt)
});
}) : /* @__PURE__ */ reactExports.createElement("input", {
name,
type: "hidden",
value: ""
});
return /* @__PURE__ */ reactExports.createElement("div", null, input);
}
} else {
var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : "";
return /* @__PURE__ */ reactExports.createElement("input", {
name,
type: "hidden",
value: _value
});
}
}
}, {
key: "renderLiveRegion",
value: function renderLiveRegion() {
var commonProps = this.commonProps;
var _this$state6 = this.state, ariaSelection = _this$state6.ariaSelection, focusedOption = _this$state6.focusedOption, focusedValue = _this$state6.focusedValue, isFocused = _this$state6.isFocused, selectValue = _this$state6.selectValue;
var focusableOptions = this.getFocusableOptions();
return /* @__PURE__ */ reactExports.createElement(LiveRegion$1$1, _extends$3({}, commonProps, {
id: this.getElementId("live-region"),
ariaSelection,
focusedOption,
focusedValue,
isFocused,
selectValue,
focusableOptions
}));
}
}, {
key: "render",
value: function render3() {
var _this$getComponents8 = this.getComponents(), Control3 = _this$getComponents8.Control, IndicatorsContainer3 = _this$getComponents8.IndicatorsContainer, SelectContainer3 = _this$getComponents8.SelectContainer, ValueContainer3 = _this$getComponents8.ValueContainer;
var _this$props14 = this.props, className = _this$props14.className, id = _this$props14.id, isDisabled = _this$props14.isDisabled, menuIsOpen = _this$props14.menuIsOpen;
var isFocused = this.state.isFocused;
var commonProps = this.commonProps = this.getCommonProps();
return /* @__PURE__ */ reactExports.createElement(SelectContainer3, _extends$3({}, commonProps, {
className,
innerProps: {
id,
onKeyDown: this.onKeyDown
},
isDisabled,
isFocused
}), this.renderLiveRegion(), /* @__PURE__ */ reactExports.createElement(Control3, _extends$3({}, commonProps, {
innerRef: this.getControlRef,
innerProps: {
onMouseDown: this.onControlMouseDown,
onTouchEnd: this.onControlTouchEnd
},
isDisabled,
isFocused,
menuIsOpen
}), /* @__PURE__ */ reactExports.createElement(ValueContainer3, _extends$3({}, commonProps, {
isDisabled
}), this.renderPlaceholderOrValue(), this.renderInput()), /* @__PURE__ */ reactExports.createElement(IndicatorsContainer3, _extends$3({}, commonProps, {
isDisabled
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, state) {
var prevProps = state.prevProps, clearFocusValueOnUpdate = state.clearFocusValueOnUpdate, inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate, ariaSelection = state.ariaSelection, isFocused = state.isFocused, prevWasFocused = state.prevWasFocused;
var options2 = props.options, value2 = props.value, menuIsOpen = props.menuIsOpen, inputValue = props.inputValue, isMulti = props.isMulti;
var selectValue = cleanValue(value2);
var newMenuOptionsState = {};
if (prevProps && (value2 !== prevProps.value || options2 !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
var focusedOption = getNextFocusedOption(state, focusableOptions);
newMenuOptionsState = {
selectValue,
focusedOption,
focusedValue,
clearFocusValueOnUpdate: false
};
}
var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? {
inputIsHidden: inputIsHiddenAfterUpdate,
inputIsHiddenAfterUpdate: void 0
} : {};
var newAriaSelection = ariaSelection;
var hasKeptFocus = isFocused && prevWasFocused;
if (isFocused && !hasKeptFocus) {
newAriaSelection = {
value: valueTernary(isMulti, selectValue, selectValue[0] || null),
options: selectValue,
action: "initial-input-focus"
};
hasKeptFocus = !prevWasFocused;
}
if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === "initial-input-focus") {
newAriaSelection = null;
}
return _objectSpread2(_objectSpread2(_objectSpread2({}, newMenuOptionsState), newInputIsHiddenState), {}, {
prevProps: props,
ariaSelection: newAriaSelection,
prevWasFocused: hasKeptFocus
});
}
}]);
return Select2;
}(reactExports.Component);
Select.defaultProps = defaultProps$5;
var inheritsExports = requireInherits();
const r$o = /* @__PURE__ */ getDefaultExportFromCjs(inheritsExports);
requireToConsumableArray();
var StateManagedSelect = /* @__PURE__ */ reactExports.forwardRef(function(props, ref2) {
var baseSelectProps = useStateManager(props);
return /* @__PURE__ */ reactExports.createElement(Select, _extends$3({
ref: ref2
}, baseSelectProps));
});
var StateManagedSelect$1 = StateManagedSelect;
var NonceProvider = function(_ref3) {
var nonce = _ref3.nonce, children2 = _ref3.children, cacheKey = _ref3.cacheKey;
var emotionCache = reactExports.useMemo(function() {
return createCache({
key: cacheKey,
nonce
});
}, [cacheKey, nonce]);
return /* @__PURE__ */ reactExports.createElement(CacheProvider, {
value: emotionCache
}, children2);
};
const reactSelect_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
NonceProvider,
components,
createFilter,
default: StateManagedSelect$1,
defaultTheme,
mergeStyles,
useStateManager
}, Symbol.toStringTag, { value: "Module" }));
const require$$4 = /* @__PURE__ */ getAugmentedNamespace(reactSelect_esm);
var _excluded$5 = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"];
var compareOption = function compareOption2() {
var inputValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
var option = arguments.length > 1 ? arguments[1] : void 0;
var accessors2 = arguments.length > 2 ? arguments[2] : void 0;
var candidate = String(inputValue).toLowerCase();
var optionValue = String(accessors2.getOptionValue(option)).toLowerCase();
var optionLabel = String(accessors2.getOptionLabel(option)).toLowerCase();
return optionValue === candidate || optionLabel === candidate;
};
var builtins$1 = {
formatCreateLabel: function formatCreateLabel(inputValue) {
return 'Create "'.concat(inputValue, '"');
},
isValidNewOption: function isValidNewOption(inputValue, selectValue, selectOptions, accessors2) {
return !(!inputValue || selectValue.some(function(option) {
return compareOption(inputValue, option, accessors2);
}) || selectOptions.some(function(option) {
return compareOption(inputValue, option, accessors2);
}));
},
getNewOptionData: function getNewOptionData(inputValue, optionLabel) {
return {
label: optionLabel,
value: inputValue,
__isNew__: true
};
}
};
function useCreatable(_ref3) {
var _ref$allowCreateWhile = _ref3.allowCreateWhileLoading, allowCreateWhileLoading = _ref$allowCreateWhile === void 0 ? false : _ref$allowCreateWhile, _ref$createOptionPosi = _ref3.createOptionPosition, createOptionPosition = _ref$createOptionPosi === void 0 ? "last" : _ref$createOptionPosi, _ref$formatCreateLabe = _ref3.formatCreateLabel, formatCreateLabel2 = _ref$formatCreateLabe === void 0 ? builtins$1.formatCreateLabel : _ref$formatCreateLabe, _ref$isValidNewOption = _ref3.isValidNewOption, isValidNewOption2 = _ref$isValidNewOption === void 0 ? builtins$1.isValidNewOption : _ref$isValidNewOption, _ref$getNewOptionData = _ref3.getNewOptionData, getNewOptionData2 = _ref$getNewOptionData === void 0 ? builtins$1.getNewOptionData : _ref$getNewOptionData, onCreateOption = _ref3.onCreateOption, _ref$options = _ref3.options, propsOptions = _ref$options === void 0 ? [] : _ref$options, propsOnChange = _ref3.onChange, restSelectProps = _objectWithoutProperties$1(_ref3, _excluded$5);
var _restSelectProps$getO = restSelectProps.getOptionValue, getOptionValue$1$1 = _restSelectProps$getO === void 0 ? getOptionValue$1 : _restSelectProps$getO, _restSelectProps$getO2 = restSelectProps.getOptionLabel, getOptionLabel$1$1 = _restSelectProps$getO2 === void 0 ? getOptionLabel$1 : _restSelectProps$getO2, inputValue = restSelectProps.inputValue, isLoading = restSelectProps.isLoading, isMulti = restSelectProps.isMulti, value2 = restSelectProps.value, name = restSelectProps.name;
var newOption = reactExports.useMemo(function() {
return isValidNewOption2(inputValue, cleanValue(value2), propsOptions, {
getOptionValue: getOptionValue$1$1,
getOptionLabel: getOptionLabel$1$1
}) ? getNewOptionData2(inputValue, formatCreateLabel2(inputValue)) : void 0;
}, [formatCreateLabel2, getNewOptionData2, getOptionLabel$1$1, getOptionValue$1$1, inputValue, isValidNewOption2, propsOptions, value2]);
var options2 = reactExports.useMemo(function() {
return (allowCreateWhileLoading || !isLoading) && newOption ? createOptionPosition === "first" ? [newOption].concat(_toConsumableArray$2(propsOptions)) : [].concat(_toConsumableArray$2(propsOptions), [newOption]) : propsOptions;
}, [allowCreateWhileLoading, createOptionPosition, isLoading, newOption, propsOptions]);
var onChange2 = reactExports.useCallback(function(newValue, actionMeta) {
if (actionMeta.action !== "select-option") {
return propsOnChange(newValue, actionMeta);
}
var valueArray = Array.isArray(newValue) ? newValue : [newValue];
if (valueArray[valueArray.length - 1] === newOption) {
if (onCreateOption)
onCreateOption(inputValue);
else {
var newOptionData = getNewOptionData2(inputValue, inputValue);
var newActionMeta = {
action: "create-option",
name,
option: newOptionData
};
propsOnChange(valueTernary(isMulti, [].concat(_toConsumableArray$2(cleanValue(value2)), [newOptionData]), newOptionData), newActionMeta);
}
return;
}
propsOnChange(newValue, actionMeta);
}, [getNewOptionData2, inputValue, isMulti, name, newOption, onCreateOption, propsOnChange, value2]);
return _objectSpread2(_objectSpread2({}, restSelectProps), {}, {
options: options2,
onChange: onChange2
});
}
var CreatableSelect = /* @__PURE__ */ reactExports.forwardRef(function(props, ref2) {
var creatableProps = useStateManager(props);
var selectProps = useCreatable(creatableProps);
return /* @__PURE__ */ reactExports.createElement(Select, _extends$3({
ref: ref2
}, selectProps));
});
var CreatableSelect$1 = CreatableSelect;
const reactSelectCreatable_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: CreatableSelect$1,
useCreatable
}, Symbol.toStringTag, { value: "Module" }));
const require$$11$2 = /* @__PURE__ */ getAugmentedNamespace(reactSelectCreatable_esm);
var _excluded$4 = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"];
function useAsync(_ref3) {
var _ref$defaultOptions = _ref3.defaultOptions, propsDefaultOptions = _ref$defaultOptions === void 0 ? false : _ref$defaultOptions, _ref$cacheOptions = _ref3.cacheOptions, cacheOptions = _ref$cacheOptions === void 0 ? false : _ref$cacheOptions, propsLoadOptions = _ref3.loadOptions;
_ref3.options;
var _ref$isLoading = _ref3.isLoading, propsIsLoading = _ref$isLoading === void 0 ? false : _ref$isLoading, propsOnInputChange = _ref3.onInputChange, _ref$filterOption = _ref3.filterOption, filterOption = _ref$filterOption === void 0 ? null : _ref$filterOption, restSelectProps = _objectWithoutProperties$1(_ref3, _excluded$4);
var propsInputValue = restSelectProps.inputValue;
var lastRequest = reactExports.useRef(void 0);
var mounted = reactExports.useRef(false);
var _useState = reactExports.useState(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : void 0), _useState2 = _slicedToArray$2(_useState, 2), defaultOptions2 = _useState2[0], setDefaultOptions = _useState2[1];
var _useState3 = reactExports.useState(typeof propsInputValue !== "undefined" ? propsInputValue : ""), _useState4 = _slicedToArray$2(_useState3, 2), stateInputValue = _useState4[0], setStateInputValue = _useState4[1];
var _useState5 = reactExports.useState(propsDefaultOptions === true), _useState6 = _slicedToArray$2(_useState5, 2), isLoading = _useState6[0], setIsLoading = _useState6[1];
var _useState7 = reactExports.useState(void 0), _useState8 = _slicedToArray$2(_useState7, 2), loadedInputValue = _useState8[0], setLoadedInputValue = _useState8[1];
var _useState9 = reactExports.useState([]), _useState10 = _slicedToArray$2(_useState9, 2), loadedOptions = _useState10[0], setLoadedOptions = _useState10[1];
var _useState11 = reactExports.useState(false), _useState12 = _slicedToArray$2(_useState11, 2), passEmptyOptions = _useState12[0], setPassEmptyOptions = _useState12[1];
var _useState13 = reactExports.useState({}), _useState14 = _slicedToArray$2(_useState13, 2), optionsCache = _useState14[0], setOptionsCache = _useState14[1];
var _useState15 = reactExports.useState(void 0), _useState16 = _slicedToArray$2(_useState15, 2), prevDefaultOptions = _useState16[0], setPrevDefaultOptions = _useState16[1];
var _useState17 = reactExports.useState(void 0), _useState18 = _slicedToArray$2(_useState17, 2), prevCacheOptions = _useState18[0], setPrevCacheOptions = _useState18[1];
if (cacheOptions !== prevCacheOptions) {
setOptionsCache({});
setPrevCacheOptions(cacheOptions);
}
if (propsDefaultOptions !== prevDefaultOptions) {
setDefaultOptions(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : void 0);
setPrevDefaultOptions(propsDefaultOptions);
}
reactExports.useEffect(function() {
mounted.current = true;
return function() {
mounted.current = false;
};
}, []);
var loadOptions = reactExports.useCallback(function(inputValue, callback) {
if (!propsLoadOptions)
return callback();
var loader2 = propsLoadOptions(inputValue, callback);
if (loader2 && typeof loader2.then === "function") {
loader2.then(callback, function() {
return callback();
});
}
}, [propsLoadOptions]);
reactExports.useEffect(function() {
if (propsDefaultOptions === true) {
loadOptions(stateInputValue, function(options3) {
if (!mounted.current)
return;
setDefaultOptions(options3 || []);
setIsLoading(!!lastRequest.current);
});
}
}, []);
var onInputChange = reactExports.useCallback(function(newValue, actionMeta) {
var inputValue = handleInputChange(newValue, actionMeta, propsOnInputChange);
if (!inputValue) {
lastRequest.current = void 0;
setStateInputValue("");
setLoadedInputValue("");
setLoadedOptions([]);
setIsLoading(false);
setPassEmptyOptions(false);
return;
}
if (cacheOptions && optionsCache[inputValue]) {
setStateInputValue(inputValue);
setLoadedInputValue(inputValue);
setLoadedOptions(optionsCache[inputValue]);
setIsLoading(false);
setPassEmptyOptions(false);
} else {
var request2 = lastRequest.current = {};
setStateInputValue(inputValue);
setIsLoading(true);
setPassEmptyOptions(!loadedInputValue);
loadOptions(inputValue, function(options3) {
if (!mounted)
return;
if (request2 !== lastRequest.current)
return;
lastRequest.current = void 0;
setIsLoading(false);
setLoadedInputValue(inputValue);
setLoadedOptions(options3 || []);
setPassEmptyOptions(false);
setOptionsCache(options3 ? _objectSpread2(_objectSpread2({}, optionsCache), {}, _defineProperty$3({}, inputValue, options3)) : optionsCache);
});
}
}, [cacheOptions, loadOptions, loadedInputValue, optionsCache, propsOnInputChange]);
var options2 = passEmptyOptions ? [] : stateInputValue && loadedInputValue ? loadedOptions : defaultOptions2 || [];
return _objectSpread2(_objectSpread2({}, restSelectProps), {}, {
options: options2,
isLoading: isLoading || propsIsLoading,
onInputChange,
filterOption
});
}
var AsyncSelect = /* @__PURE__ */ reactExports.forwardRef(function(props, ref2) {
var stateManagedProps = useAsync(props);
var selectProps = useStateManager(stateManagedProps);
return /* @__PURE__ */ reactExports.createElement(Select, _extends$3({
ref: ref2
}, selectProps));
});
var AsyncSelect$1 = AsyncSelect;
const reactSelectAsync_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: AsyncSelect$1,
useAsync
}, Symbol.toStringTag, { value: "Module" }));
const require$$12 = /* @__PURE__ */ getAugmentedNamespace(reactSelectAsync_esm);
var AsyncCreatableSelect = /* @__PURE__ */ reactExports.forwardRef(function(props, ref2) {
var stateManagerProps = useAsync(props);
var creatableProps = useStateManager(stateManagerProps);
var selectProps = useCreatable(creatableProps);
return /* @__PURE__ */ reactExports.createElement(Select, _extends$3({
ref: ref2
}, selectProps));
});
var AsyncCreatableSelect$1 = AsyncCreatableSelect;
const reactSelectAsyncCreatable_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: AsyncCreatableSelect$1
}, Symbol.toStringTag, { value: "Module" }));
const require$$13 = /* @__PURE__ */ getAugmentedNamespace(reactSelectAsyncCreatable_esm);
var uniqueId_1;
var hasRequiredUniqueId;
function requireUniqueId() {
if (hasRequiredUniqueId)
return uniqueId_1;
hasRequiredUniqueId = 1;
var toString4 = requireToString();
var idCounter2 = 0;
function uniqueId(prefix2) {
var id = ++idCounter2;
return toString4(prefix2) + id;
}
uniqueId_1 = uniqueId;
return uniqueId_1;
}
var ManagerReferenceNodeContext = reactExports.createContext();
var ManagerReferenceNodeSetterContext = reactExports.createContext();
function Manager$2(_ref3) {
var children2 = _ref3.children;
var _React$useState = reactExports.useState(null), referenceNode = _React$useState[0], setReferenceNode = _React$useState[1];
var hasUnmounted = reactExports.useRef(false);
reactExports.useEffect(function() {
return function() {
hasUnmounted.current = true;
};
}, []);
var handleSetReferenceNode = reactExports.useCallback(function(node2) {
if (!hasUnmounted.current) {
setReferenceNode(node2);
}
}, []);
return /* @__PURE__ */ reactExports.createElement(ManagerReferenceNodeContext.Provider, {
value: referenceNode
}, /* @__PURE__ */ reactExports.createElement(ManagerReferenceNodeSetterContext.Provider, {
value: handleSetReferenceNode
}, children2));
}
var unwrapArray = function unwrapArray2(arg) {
return Array.isArray(arg) ? arg[0] : arg;
};
var safeInvoke = function safeInvoke2(fn8) {
if (typeof fn8 === "function") {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return fn8.apply(void 0, args);
}
};
var setRef = function setRef2(ref2, node2) {
if (typeof ref2 === "function") {
return safeInvoke(ref2, node2);
} else if (ref2 != null) {
ref2.current = node2;
}
};
var fromEntries = function fromEntries2(entries) {
return entries.reduce(function(acc, _ref3) {
var key2 = _ref3[0], value2 = _ref3[1];
acc[key2] = value2;
return acc;
}, {});
};
var useIsomorphicLayoutEffect$2 = typeof window !== "undefined" && window.document && window.document.createElement ? reactExports.useLayoutEffect : reactExports.useEffect;
var top = "top";
var bottom = "bottom";
var right = "right";
var left = "left";
var auto = "auto";
var basePlacements = [top, bottom, right, left];
var start = "start";
var end = "end";
var clippingParents = "clippingParents";
var viewport = "viewport";
var popper = "popper";
var reference = "reference";
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []);
var beforeRead = "beforeRead";
var read$1 = "read";
var afterRead = "afterRead";
var beforeMain = "beforeMain";
var main = "main";
var afterMain = "afterMain";
var beforeWrite = "beforeWrite";
var write = "write";
var afterWrite = "afterWrite";
var modifierPhases = [beforeRead, read$1, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
function getNodeName(element2) {
return element2 ? (element2.nodeName || "").toLowerCase() : null;
}
function getWindow$1(node2) {
if (node2 == null) {
return window;
}
if (node2.toString() !== "[object Window]") {
var ownerDocument = node2.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node2;
}
function isElement$2(node2) {
var OwnElement = getWindow$1(node2).Element;
return node2 instanceof OwnElement || node2 instanceof Element;
}
function isHTMLElement$2(node2) {
var OwnElement = getWindow$1(node2).HTMLElement;
return node2 instanceof OwnElement || node2 instanceof HTMLElement;
}
function isShadowRoot(node2) {
if (typeof ShadowRoot === "undefined") {
return false;
}
var OwnElement = getWindow$1(node2).ShadowRoot;
return node2 instanceof OwnElement || node2 instanceof ShadowRoot;
}
function applyStyles(_ref3) {
var state = _ref3.state;
Object.keys(state.elements).forEach(function(name) {
var style2 = state.styles[name] || {};
var attributes = state.attributes[name] || {};
var element2 = state.elements[name];
if (!isHTMLElement$2(element2) || !getNodeName(element2)) {
return;
}
Object.assign(element2.style, style2);
Object.keys(attributes).forEach(function(name2) {
var value2 = attributes[name2];
if (value2 === false) {
element2.removeAttribute(name2);
} else {
element2.setAttribute(name2, value2 === true ? "" : value2);
}
});
});
}
function effect$2(_ref22) {
var state = _ref22.state;
var initialStyles = {
popper: {
position: state.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles = initialStyles;
if (state.elements.arrow) {
Object.assign(state.elements.arrow.style, initialStyles.arrow);
}
return function() {
Object.keys(state.elements).forEach(function(name) {
var element2 = state.elements[name];
var attributes = state.attributes[name] || {};
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
var style2 = styleProperties.reduce(function(style3, property2) {
style3[property2] = "";
return style3;
}, {});
if (!isHTMLElement$2(element2) || !getNodeName(element2)) {
return;
}
Object.assign(element2.style, style2);
Object.keys(attributes).forEach(function(attribute) {
element2.removeAttribute(attribute);
});
});
};
}
const applyStyles$1 = {
name: "applyStyles",
enabled: true,
phase: "write",
fn: applyStyles,
effect: effect$2,
requires: ["computeStyles"]
};
function getBasePlacement$2(placement) {
return placement.split("-")[0];
}
var max$9 = Math.max;
var min$a = Math.min;
var round = Math.round;
function getUAString() {
var uaData = navigator.userAgentData;
if (uaData != null && uaData.brands) {
return uaData.brands.map(function(item) {
return item.brand + "/" + item.version;
}).join(" ");
}
return navigator.userAgent;
}
function isLayoutViewport() {
return !/^((?!chrome|android).)*safari/i.test(getUAString());
}
function getBoundingClientRect(element2, includeScale, isFixedStrategy) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
var clientRect = element2.getBoundingClientRect();
var scaleX = 1;
var scaleY2 = 1;
if (includeScale && isHTMLElement$2(element2)) {
scaleX = element2.offsetWidth > 0 ? round(clientRect.width) / element2.offsetWidth || 1 : 1;
scaleY2 = element2.offsetHeight > 0 ? round(clientRect.height) / element2.offsetHeight || 1 : 1;
}
var _ref3 = isElement$2(element2) ? getWindow$1(element2) : window, visualViewport = _ref3.visualViewport;
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
var y2 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY2;
var width2 = clientRect.width / scaleX;
var height2 = clientRect.height / scaleY2;
return {
width: width2,
height: height2,
top: y2,
right: x2 + width2,
bottom: y2 + height2,
left: x2,
x: x2,
y: y2
};
}
function getLayoutRect(element2) {
var clientRect = getBoundingClientRect(element2);
var width2 = element2.offsetWidth;
var height2 = element2.offsetHeight;
if (Math.abs(clientRect.width - width2) <= 1) {
width2 = clientRect.width;
}
if (Math.abs(clientRect.height - height2) <= 1) {
height2 = clientRect.height;
}
return {
x: element2.offsetLeft,
y: element2.offsetTop,
width: width2,
height: height2
};
}
function contains$2(parent, child) {
var rootNode = child.getRootNode && child.getRootNode();
if (parent.contains(child)) {
return true;
} else if (rootNode && isShadowRoot(rootNode)) {
var next2 = child;
do {
if (next2 && parent.isSameNode(next2)) {
return true;
}
next2 = next2.parentNode || next2.host;
} while (next2);
}
return false;
}
function getComputedStyle$1(element2) {
return getWindow$1(element2).getComputedStyle(element2);
}
function isTableElement(element2) {
return ["table", "td", "th"].indexOf(getNodeName(element2)) >= 0;
}
function getDocumentElement(element2) {
return ((isElement$2(element2) ? element2.ownerDocument : (
// $FlowFixMe[prop-missing]
element2.document
)) || window.document).documentElement;
}
function getParentNode(element2) {
if (getNodeName(element2) === "html") {
return element2;
}
return (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
element2.assignedSlot || // step into the shadow DOM of the parent of a slotted node
element2.parentNode || // DOM Element detected
(isShadowRoot(element2) ? element2.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
getDocumentElement(element2)
);
}
function getTrueOffsetParent(element2) {
if (!isHTMLElement$2(element2) || // https://github.com/popperjs/popper-core/issues/837
getComputedStyle$1(element2).position === "fixed") {
return null;
}
return element2.offsetParent;
}
function getContainingBlock(element2) {
var isFirefox = /firefox/i.test(getUAString());
var isIE = /Trident/i.test(getUAString());
if (isIE && isHTMLElement$2(element2)) {
var elementCss = getComputedStyle$1(element2);
if (elementCss.position === "fixed") {
return null;
}
}
var currentNode = getParentNode(element2);
if (isShadowRoot(currentNode)) {
currentNode = currentNode.host;
}
while (isHTMLElement$2(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
var css4 = getComputedStyle$1(currentNode);
if (css4.transform !== "none" || css4.perspective !== "none" || css4.contain === "paint" || ["transform", "perspective"].indexOf(css4.willChange) !== -1 || isFirefox && css4.willChange === "filter" || isFirefox && css4.filter && css4.filter !== "none") {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
}
return null;
}
function getOffsetParent(element2) {
var window2 = getWindow$1(element2);
var offsetParent = getTrueOffsetParent(element2);
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
offsetParent = getTrueOffsetParent(offsetParent);
}
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static")) {
return window2;
}
return offsetParent || getContainingBlock(element2) || window2;
}
function getMainAxisFromPlacement(placement) {
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
}
function within$1(min2, value2, max2) {
return max$9(min2, min$a(value2, max2));
}
function withinMaxClamp(min2, value2, max2) {
var v2 = within$1(min2, value2, max2);
return v2 > max2 ? max2 : v2;
}
function getFreshSideObject() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function mergePaddingObject(paddingObject2) {
return Object.assign({}, getFreshSideObject(), paddingObject2);
}
function expandToHashMap(value2, keys3) {
return keys3.reduce(function(hashMap, key2) {
hashMap[key2] = value2;
return hashMap;
}, {});
}
var toPaddingObject = function toPaddingObject2(padding2, state) {
padding2 = typeof padding2 === "function" ? padding2(Object.assign({}, state.rects, {
placement: state.placement
})) : padding2;
return mergePaddingObject(typeof padding2 !== "number" ? padding2 : expandToHashMap(padding2, basePlacements));
};
function arrow(_ref3) {
var _state$modifiersData$;
var state = _ref3.state, name = _ref3.name, options2 = _ref3.options;
var arrowElement = state.elements.arrow;
var popperOffsets2 = state.modifiersData.popperOffsets;
var basePlacement = getBasePlacement$2(state.placement);
var axis = getMainAxisFromPlacement(basePlacement);
var isVertical = [left, right].indexOf(basePlacement) >= 0;
var len = isVertical ? "height" : "width";
if (!arrowElement || !popperOffsets2) {
return;
}
var paddingObject2 = toPaddingObject(options2.padding, state);
var arrowRect = getLayoutRect(arrowElement);
var minProp = axis === "y" ? top : left;
var maxProp = axis === "y" ? bottom : right;
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
var arrowOffsetParent = getOffsetParent(arrowElement);
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
var centerToReference = endDiff / 2 - startDiff / 2;
var min2 = paddingObject2[minProp];
var max2 = clientSize - arrowRect[len] - paddingObject2[maxProp];
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
var offset2 = within$1(min2, center, max2);
var axisProp = axis;
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
}
function effect$1(_ref22) {
var state = _ref22.state, options2 = _ref22.options;
var _options$element = options2.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
if (arrowElement == null) {
return;
}
if (typeof arrowElement === "string") {
arrowElement = state.elements.popper.querySelector(arrowElement);
if (!arrowElement) {
return;
}
}
if (!contains$2(state.elements.popper, arrowElement)) {
return;
}
state.elements.arrow = arrowElement;
}
const arrow$1 = {
name: "arrow",
enabled: true,
phase: "main",
fn: arrow,
effect: effect$1,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
function getVariation(placement) {
return placement.split("-")[1];
}
var unsetSides = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function roundOffsetsByDPR(_ref3) {
var x2 = _ref3.x, y2 = _ref3.y;
var win = window;
var dpr = win.devicePixelRatio || 1;
return {
x: round(x2 * dpr) / dpr || 0,
y: round(y2 * dpr) / dpr || 0
};
}
function mapToStyles(_ref22) {
var _Object$assign2;
var popper2 = _ref22.popper, popperRect = _ref22.popperRect, placement = _ref22.placement, variation = _ref22.variation, offsets2 = _ref22.offsets, position2 = _ref22.position, gpuAcceleration = _ref22.gpuAcceleration, adaptive = _ref22.adaptive, roundOffsets = _ref22.roundOffsets, isFixed2 = _ref22.isFixed;
var _offsets$x = offsets2.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets2.y, y2 = _offsets$y === void 0 ? 0 : _offsets$y;
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
x: x2,
y: y2
}) : {
x: x2,
y: y2
};
x2 = _ref3.x;
y2 = _ref3.y;
var hasX = offsets2.hasOwnProperty("x");
var hasY = offsets2.hasOwnProperty("y");
var sideX = left;
var sideY = top;
var win = window;
if (adaptive) {
var offsetParent = getOffsetParent(popper2);
var heightProp = "clientHeight";
var widthProp = "clientWidth";
if (offsetParent === getWindow$1(popper2)) {
offsetParent = getDocumentElement(popper2);
if (getComputedStyle$1(offsetParent).position !== "static" && position2 === "absolute") {
heightProp = "scrollHeight";
widthProp = "scrollWidth";
}
}
offsetParent = offsetParent;
if (placement === top || (placement === left || placement === right) && variation === end) {
sideY = bottom;
var offsetY = isFixed2 && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
// $FlowFixMe[prop-missing]
offsetParent[heightProp]
);
y2 -= offsetY - popperRect.height;
y2 *= gpuAcceleration ? 1 : -1;
}
if (placement === left || (placement === top || placement === bottom) && variation === end) {
sideX = right;
var offsetX = isFixed2 && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
// $FlowFixMe[prop-missing]
offsetParent[widthProp]
);
x2 -= offsetX - popperRect.width;
x2 *= gpuAcceleration ? 1 : -1;
}
}
var commonStyles = Object.assign({
position: position2
}, adaptive && unsetSides);
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
x: x2,
y: y2
}) : {
x: x2,
y: y2
};
x2 = _ref4.x;
y2 = _ref4.y;
if (gpuAcceleration) {
var _Object$assign;
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _Object$assign));
}
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2));
}
function computeStyles(_ref5) {
var state = _ref5.state, options2 = _ref5.options;
var _options$gpuAccelerat = options2.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options2.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options2.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
var commonStyles = {
placement: getBasePlacement$2(state.placement),
variation: getVariation(state.placement),
popper: state.elements.popper,
popperRect: state.rects.popper,
gpuAcceleration,
isFixed: state.options.strategy === "fixed"
};
if (state.modifiersData.popperOffsets != null) {
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.popperOffsets,
position: state.options.strategy,
adaptive,
roundOffsets
})));
}
if (state.modifiersData.arrow != null) {
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.arrow,
position: "absolute",
adaptive: false,
roundOffsets
})));
}
state.attributes.popper = Object.assign({}, state.attributes.popper, {
"data-popper-placement": state.placement
});
}
const computeStyles$1 = {
name: "computeStyles",
enabled: true,
phase: "beforeWrite",
fn: computeStyles,
data: {}
};
var passive = {
passive: true
};
function effect(_ref3) {
var state = _ref3.state, instance2 = _ref3.instance, options2 = _ref3.options;
var _options$scroll = options2.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options2.resize, resize2 = _options$resize === void 0 ? true : _options$resize;
var window2 = getWindow$1(state.elements.popper);
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
if (scroll) {
scrollParents.forEach(function(scrollParent) {
scrollParent.addEventListener("scroll", instance2.update, passive);
});
}
if (resize2) {
window2.addEventListener("resize", instance2.update, passive);
}
return function() {
if (scroll) {
scrollParents.forEach(function(scrollParent) {
scrollParent.removeEventListener("scroll", instance2.update, passive);
});
}
if (resize2) {
window2.removeEventListener("resize", instance2.update, passive);
}
};
}
const eventListeners = {
name: "eventListeners",
enabled: true,
phase: "write",
fn: function fn() {
},
effect,
data: {}
};
var hash$1 = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, function(matched) {
return hash$1[matched];
});
}
var hash = {
start: "end",
end: "start"
};
function getOppositeVariationPlacement(placement) {
return placement.replace(/start|end/g, function(matched) {
return hash[matched];
});
}
function getWindowScroll(node2) {
var win = getWindow$1(node2);
var scrollLeft = win.pageXOffset;
var scrollTop = win.pageYOffset;
return {
scrollLeft,
scrollTop
};
}
function getWindowScrollBarX(element2) {
return getBoundingClientRect(getDocumentElement(element2)).left + getWindowScroll(element2).scrollLeft;
}
function getViewportRect(element2, strategy) {
var win = getWindow$1(element2);
var html2 = getDocumentElement(element2);
var visualViewport = win.visualViewport;
var width2 = html2.clientWidth;
var height2 = html2.clientHeight;
var x2 = 0;
var y2 = 0;
if (visualViewport) {
width2 = visualViewport.width;
height2 = visualViewport.height;
var layoutViewport = isLayoutViewport();
if (layoutViewport || !layoutViewport && strategy === "fixed") {
x2 = visualViewport.offsetLeft;
y2 = visualViewport.offsetTop;
}
}
return {
width: width2,
height: height2,
x: x2 + getWindowScrollBarX(element2),
y: y2
};
}
function getDocumentRect(element2) {
var _element$ownerDocumen;
var html2 = getDocumentElement(element2);
var winScroll = getWindowScroll(element2);
var body = (_element$ownerDocumen = element2.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
var width2 = max$9(html2.scrollWidth, html2.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
var height2 = max$9(html2.scrollHeight, html2.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element2);
var y2 = -winScroll.scrollTop;
if (getComputedStyle$1(body || html2).direction === "rtl") {
x2 += max$9(html2.clientWidth, body ? body.clientWidth : 0) - width2;
}
return {
width: width2,
height: height2,
x: x2,
y: y2
};
}
function isScrollParent(element2) {
var _getComputedStyle = getComputedStyle$1(element2), overflow2 = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
return /auto|scroll|overlay|hidden/.test(overflow2 + overflowY + overflowX);
}
function getScrollParent(node2) {
if (["html", "body", "#document"].indexOf(getNodeName(node2)) >= 0) {
return node2.ownerDocument.body;
}
if (isHTMLElement$2(node2) && isScrollParent(node2)) {
return node2;
}
return getScrollParent(getParentNode(node2));
}
function listScrollParents(element2, list) {
var _element$ownerDocumen;
if (list === void 0) {
list = [];
}
var scrollParent = getScrollParent(element2);
var isBody = scrollParent === ((_element$ownerDocumen = element2.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
var win = getWindow$1(scrollParent);
var target2 = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
var updatedList = list.concat(target2);
return isBody ? updatedList : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
updatedList.concat(listScrollParents(getParentNode(target2)))
);
}
function rectToClientRect(rect2) {
return Object.assign({}, rect2, {
left: rect2.x,
top: rect2.y,
right: rect2.x + rect2.width,
bottom: rect2.y + rect2.height
});
}
function getInnerBoundingClientRect(element2, strategy) {
var rect2 = getBoundingClientRect(element2, false, strategy === "fixed");
rect2.top = rect2.top + element2.clientTop;
rect2.left = rect2.left + element2.clientLeft;
rect2.bottom = rect2.top + element2.clientHeight;
rect2.right = rect2.left + element2.clientWidth;
rect2.width = element2.clientWidth;
rect2.height = element2.clientHeight;
rect2.x = rect2.left;
rect2.y = rect2.top;
return rect2;
}
function getClientRectFromMixedType(element2, clippingParent, strategy) {
return clippingParent === viewport ? rectToClientRect(getViewportRect(element2, strategy)) : isElement$2(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element2)));
}
function getClippingParents(element2) {
var clippingParents2 = listScrollParents(getParentNode(element2));
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle$1(element2).position) >= 0;
var clipperElement = canEscapeClipping && isHTMLElement$2(element2) ? getOffsetParent(element2) : element2;
if (!isElement$2(clipperElement)) {
return [];
}
return clippingParents2.filter(function(clippingParent) {
return isElement$2(clippingParent) && contains$2(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
});
}
function getClippingRect(element2, boundary, rootBoundary, strategy) {
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element2) : [].concat(boundary);
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
var firstClippingParent = clippingParents2[0];
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
var rect2 = getClientRectFromMixedType(element2, clippingParent, strategy);
accRect.top = max$9(rect2.top, accRect.top);
accRect.right = min$a(rect2.right, accRect.right);
accRect.bottom = min$a(rect2.bottom, accRect.bottom);
accRect.left = max$9(rect2.left, accRect.left);
return accRect;
}, getClientRectFromMixedType(element2, firstClippingParent, strategy));
clippingRect.width = clippingRect.right - clippingRect.left;
clippingRect.height = clippingRect.bottom - clippingRect.top;
clippingRect.x = clippingRect.left;
clippingRect.y = clippingRect.top;
return clippingRect;
}
function computeOffsets(_ref3) {
var reference2 = _ref3.reference, element2 = _ref3.element, placement = _ref3.placement;
var basePlacement = placement ? getBasePlacement$2(placement) : null;
var variation = placement ? getVariation(placement) : null;
var commonX = reference2.x + reference2.width / 2 - element2.width / 2;
var commonY = reference2.y + reference2.height / 2 - element2.height / 2;
var offsets2;
switch (basePlacement) {
case top:
offsets2 = {
x: commonX,
y: reference2.y - element2.height
};
break;
case bottom:
offsets2 = {
x: commonX,
y: reference2.y + reference2.height
};
break;
case right:
offsets2 = {
x: reference2.x + reference2.width,
y: commonY
};
break;
case left:
offsets2 = {
x: reference2.x - element2.width,
y: commonY
};
break;
default:
offsets2 = {
x: reference2.x,
y: reference2.y
};
}
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
if (mainAxis != null) {
var len = mainAxis === "y" ? "height" : "width";
switch (variation) {
case start:
offsets2[mainAxis] = offsets2[mainAxis] - (reference2[len] / 2 - element2[len] / 2);
break;
case end:
offsets2[mainAxis] = offsets2[mainAxis] + (reference2[len] / 2 - element2[len] / 2);
break;
}
}
return offsets2;
}
function detectOverflow(state, options2) {
if (options2 === void 0) {
options2 = {};
}
var _options = options2, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding2 = _options$padding === void 0 ? 0 : _options$padding;
var paddingObject2 = mergePaddingObject(typeof padding2 !== "number" ? padding2 : expandToHashMap(padding2, basePlacements));
var altContext = elementContext === popper ? reference : popper;
var popperRect = state.rects.popper;
var element2 = state.elements[altBoundary ? altContext : elementContext];
var clippingClientRect = getClippingRect(isElement$2(element2) ? element2 : element2.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
var referenceClientRect = getBoundingClientRect(state.elements.reference);
var popperOffsets2 = computeOffsets({
reference: referenceClientRect,
element: popperRect,
strategy: "absolute",
placement
});
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
var overflowOffsets = {
top: clippingClientRect.top - elementClientRect.top + paddingObject2.top,
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject2.bottom,
left: clippingClientRect.left - elementClientRect.left + paddingObject2.left,
right: elementClientRect.right - clippingClientRect.right + paddingObject2.right
};
var offsetData = state.modifiersData.offset;
if (elementContext === popper && offsetData) {
var offset2 = offsetData[placement];
Object.keys(overflowOffsets).forEach(function(key2) {
var multiply2 = [right, bottom].indexOf(key2) >= 0 ? 1 : -1;
var axis = [top, bottom].indexOf(key2) >= 0 ? "y" : "x";
overflowOffsets[key2] += offset2[axis] * multiply2;
});
}
return overflowOffsets;
}
function computeAutoPlacement(state, options2) {
if (options2 === void 0) {
options2 = {};
}
var _options = options2, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding2 = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
var variation = getVariation(placement);
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
return getVariation(placement2) === variation;
}) : basePlacements;
var allowedPlacements = placements$1.filter(function(placement2) {
return allowedAutoPlacements.indexOf(placement2) >= 0;
});
if (allowedPlacements.length === 0) {
allowedPlacements = placements$1;
}
var overflows = allowedPlacements.reduce(function(acc, placement2) {
acc[placement2] = detectOverflow(state, {
placement: placement2,
boundary,
rootBoundary,
padding: padding2
})[getBasePlacement$2(placement2)];
return acc;
}, {});
return Object.keys(overflows).sort(function(a2, b2) {
return overflows[a2] - overflows[b2];
});
}
function getExpandedFallbackPlacements(placement) {
if (getBasePlacement$2(placement) === auto) {
return [];
}
var oppositePlacement = getOppositePlacement(placement);
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip$1(_ref3) {
var state = _ref3.state, options2 = _ref3.options, name = _ref3.name;
if (state.modifiersData[name]._skip) {
return;
}
var _options$mainAxis = options2.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options2.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options2.fallbackPlacements, padding2 = options2.padding, boundary = options2.boundary, rootBoundary = options2.rootBoundary, altBoundary = options2.altBoundary, _options$flipVariatio = options2.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options2.allowedAutoPlacements;
var preferredPlacement = state.options.placement;
var basePlacement = getBasePlacement$2(preferredPlacement);
var isBasePlacement = basePlacement === preferredPlacement;
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
return acc.concat(getBasePlacement$2(placement2) === auto ? computeAutoPlacement(state, {
placement: placement2,
boundary,
rootBoundary,
padding: padding2,
flipVariations,
allowedAutoPlacements
}) : placement2);
}, []);
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var checksMap = /* @__PURE__ */ new Map();
var makeFallbackChecks = true;
var firstFittingPlacement = placements2[0];
for (var i2 = 0; i2 < placements2.length; i2++) {
var placement = placements2[i2];
var _basePlacement = getBasePlacement$2(placement);
var isStartVariation = getVariation(placement) === start;
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
var len = isVertical ? "width" : "height";
var overflow2 = detectOverflow(state, {
placement,
boundary,
rootBoundary,
altBoundary,
padding: padding2
});
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
if (referenceRect[len] > popperRect[len]) {
mainVariationSide = getOppositePlacement(mainVariationSide);
}
var altVariationSide = getOppositePlacement(mainVariationSide);
var checks = [];
if (checkMainAxis) {
checks.push(overflow2[_basePlacement] <= 0);
}
if (checkAltAxis) {
checks.push(overflow2[mainVariationSide] <= 0, overflow2[altVariationSide] <= 0);
}
if (checks.every(function(check2) {
return check2;
})) {
firstFittingPlacement = placement;
makeFallbackChecks = false;
break;
}
checksMap.set(placement, checks);
}
if (makeFallbackChecks) {
var numberOfChecks = flipVariations ? 3 : 1;
var _loop = function _loop2(_i3) {
var fittingPlacement = placements2.find(function(placement2) {
var checks2 = checksMap.get(placement2);
if (checks2) {
return checks2.slice(0, _i3).every(function(check2) {
return check2;
});
}
});
if (fittingPlacement) {
firstFittingPlacement = fittingPlacement;
return "break";
}
};
for (var _i2 = numberOfChecks; _i2 > 0; _i2--) {
var _ret = _loop(_i2);
if (_ret === "break")
break;
}
}
if (state.placement !== firstFittingPlacement) {
state.modifiersData[name]._skip = true;
state.placement = firstFittingPlacement;
state.reset = true;
}
}
const flip$2 = {
name: "flip",
enabled: true,
phase: "main",
fn: flip$1,
requiresIfExists: ["offset"],
data: {
_skip: false
}
};
function getSideOffsets(overflow2, rect2, preventedOffsets) {
if (preventedOffsets === void 0) {
preventedOffsets = {
x: 0,
y: 0
};
}
return {
top: overflow2.top - rect2.height - preventedOffsets.y,
right: overflow2.right - rect2.width + preventedOffsets.x,
bottom: overflow2.bottom - rect2.height + preventedOffsets.y,
left: overflow2.left - rect2.width - preventedOffsets.x
};
}
function isAnySideFullyClipped(overflow2) {
return [top, right, bottom, left].some(function(side) {
return overflow2[side] >= 0;
});
}
function hide(_ref3) {
var state = _ref3.state, name = _ref3.name;
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var preventedOffsets = state.modifiersData.preventOverflow;
var referenceOverflow = detectOverflow(state, {
elementContext: "reference"
});
var popperAltOverflow = detectOverflow(state, {
altBoundary: true
});
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
state.modifiersData[name] = {
referenceClippingOffsets,
popperEscapeOffsets,
isReferenceHidden,
hasPopperEscaped
};
state.attributes.popper = Object.assign({}, state.attributes.popper, {
"data-popper-reference-hidden": isReferenceHidden,
"data-popper-escaped": hasPopperEscaped
});
}
const hide$1 = {
name: "hide",
enabled: true,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: hide
};
function distanceAndSkiddingToXY(placement, rects, offset2) {
var basePlacement = getBasePlacement$2(placement);
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
var _ref3 = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
placement
})) : offset2, skidding = _ref3[0], distance2 = _ref3[1];
skidding = skidding || 0;
distance2 = (distance2 || 0) * invertDistance;
return [left, right].indexOf(basePlacement) >= 0 ? {
x: distance2,
y: skidding
} : {
x: skidding,
y: distance2
};
}
function offset$5(_ref22) {
var state = _ref22.state, options2 = _ref22.options, name = _ref22.name;
var _options$offset = options2.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
var data2 = placements.reduce(function(acc, placement) {
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
return acc;
}, {});
var _data$state$placement = data2[state.placement], x2 = _data$state$placement.x, y2 = _data$state$placement.y;
if (state.modifiersData.popperOffsets != null) {
state.modifiersData.popperOffsets.x += x2;
state.modifiersData.popperOffsets.y += y2;
}
state.modifiersData[name] = data2;
}
const offset$6 = {
name: "offset",
enabled: true,
phase: "main",
requires: ["popperOffsets"],
fn: offset$5
};
function popperOffsets(_ref3) {
var state = _ref3.state, name = _ref3.name;
state.modifiersData[name] = computeOffsets({
reference: state.rects.reference,
element: state.rects.popper,
strategy: "absolute",
placement: state.placement
});
}
const popperOffsets$1 = {
name: "popperOffsets",
enabled: true,
phase: "read",
fn: popperOffsets,
data: {}
};
function getAltAxis(axis) {
return axis === "x" ? "y" : "x";
}
function preventOverflow(_ref3) {
var state = _ref3.state, options2 = _ref3.options, name = _ref3.name;
var _options$mainAxis = options2.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options2.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options2.boundary, rootBoundary = options2.rootBoundary, altBoundary = options2.altBoundary, padding2 = options2.padding, _options$tether = options2.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options2.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
var overflow2 = detectOverflow(state, {
boundary,
rootBoundary,
padding: padding2,
altBoundary
});
var basePlacement = getBasePlacement$2(state.placement);
var variation = getVariation(state.placement);
var isBasePlacement = !variation;
var mainAxis = getMainAxisFromPlacement(basePlacement);
var altAxis = getAltAxis(mainAxis);
var popperOffsets2 = state.modifiersData.popperOffsets;
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
placement: state.placement
})) : tetherOffset;
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
mainAxis: tetherOffsetValue,
altAxis: tetherOffsetValue
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, tetherOffsetValue);
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
var data2 = {
x: 0,
y: 0
};
if (!popperOffsets2) {
return;
}
if (checkMainAxis) {
var _offsetModifierState$;
var mainSide = mainAxis === "y" ? top : left;
var altSide = mainAxis === "y" ? bottom : right;
var len = mainAxis === "y" ? "height" : "width";
var offset2 = popperOffsets2[mainAxis];
var min2 = offset2 + overflow2[mainSide];
var max2 = offset2 - overflow2[altSide];
var additive = tether ? -popperRect[len] / 2 : 0;
var minLen = variation === start ? referenceRect[len] : popperRect[len];
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
var arrowElement = state.elements.arrow;
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
width: 0,
height: 0
};
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
var arrowPaddingMin = arrowPaddingObject[mainSide];
var arrowPaddingMax = arrowPaddingObject[altSide];
var arrowLen = within$1(0, referenceRect[len], arrowRect[len]);
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
var tetherMax = offset2 + maxOffset - offsetModifierValue;
var preventedOffset = within$1(tether ? min$a(min2, tetherMin) : min2, offset2, tether ? max$9(max2, tetherMax) : max2);
popperOffsets2[mainAxis] = preventedOffset;
data2[mainAxis] = preventedOffset - offset2;
}
if (checkAltAxis) {
var _offsetModifierState$2;
var _mainSide = mainAxis === "x" ? top : left;
var _altSide = mainAxis === "x" ? bottom : right;
var _offset = popperOffsets2[altAxis];
var _len = altAxis === "y" ? "height" : "width";
var _min = _offset + overflow2[_mainSide];
var _max = _offset - overflow2[_altSide];
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within$1(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
popperOffsets2[altAxis] = _preventedOffset;
data2[altAxis] = _preventedOffset - _offset;
}
state.modifiersData[name] = data2;
}
const preventOverflow$1 = {
name: "preventOverflow",
enabled: true,
phase: "main",
fn: preventOverflow,
requiresIfExists: ["offset"]
};
function getHTMLElementScroll(element2) {
return {
scrollLeft: element2.scrollLeft,
scrollTop: element2.scrollTop
};
}
function getNodeScroll(node2) {
if (node2 === getWindow$1(node2) || !isHTMLElement$2(node2)) {
return getWindowScroll(node2);
} else {
return getHTMLElementScroll(node2);
}
}
function isElementScaled(element2) {
var rect2 = element2.getBoundingClientRect();
var scaleX = round(rect2.width) / element2.offsetWidth || 1;
var scaleY2 = round(rect2.height) / element2.offsetHeight || 1;
return scaleX !== 1 || scaleY2 !== 1;
}
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed2) {
if (isFixed2 === void 0) {
isFixed2 = false;
}
var isOffsetParentAnElement = isHTMLElement$2(offsetParent);
var offsetParentIsScaled = isHTMLElement$2(offsetParent) && isElementScaled(offsetParent);
var documentElement = getDocumentElement(offsetParent);
var rect2 = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed2);
var scroll = {
scrollLeft: 0,
scrollTop: 0
};
var offsets2 = {
x: 0,
y: 0
};
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed2) {
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
isScrollParent(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isHTMLElement$2(offsetParent)) {
offsets2 = getBoundingClientRect(offsetParent, true);
offsets2.x += offsetParent.clientLeft;
offsets2.y += offsetParent.clientTop;
} else if (documentElement) {
offsets2.x = getWindowScrollBarX(documentElement);
}
}
return {
x: rect2.left + scroll.scrollLeft - offsets2.x,
y: rect2.top + scroll.scrollTop - offsets2.y,
width: rect2.width,
height: rect2.height
};
}
function order(modifiers) {
var map2 = /* @__PURE__ */ new Map();
var visited = /* @__PURE__ */ new Set();
var result = [];
modifiers.forEach(function(modifier) {
map2.set(modifier.name, modifier);
});
function sort2(modifier) {
visited.add(modifier.name);
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
requires.forEach(function(dep) {
if (!visited.has(dep)) {
var depModifier = map2.get(dep);
if (depModifier) {
sort2(depModifier);
}
}
});
result.push(modifier);
}
modifiers.forEach(function(modifier) {
if (!visited.has(modifier.name)) {
sort2(modifier);
}
});
return result;
}
function orderModifiers(modifiers) {
var orderedModifiers = order(modifiers);
return modifierPhases.reduce(function(acc, phase) {
return acc.concat(orderedModifiers.filter(function(modifier) {
return modifier.phase === phase;
}));
}, []);
}
function debounce$4(fn8) {
var pending;
return function() {
if (!pending) {
pending = new Promise(function(resolve3) {
Promise.resolve().then(function() {
pending = void 0;
resolve3(fn8());
});
});
}
return pending;
};
}
function mergeByName(modifiers) {
var merged = modifiers.reduce(function(merged2, current) {
var existing = merged2[current.name];
merged2[current.name] = existing ? Object.assign({}, existing, current, {
options: Object.assign({}, existing.options, current.options),
data: Object.assign({}, existing.data, current.data)
}) : current;
return merged2;
}, {});
return Object.keys(merged).map(function(key2) {
return merged[key2];
});
}
var DEFAULT_OPTIONS$1 = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function areValidElements() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return !args.some(function(element2) {
return !(element2 && typeof element2.getBoundingClientRect === "function");
});
}
function popperGenerator(generatorOptions) {
if (generatorOptions === void 0) {
generatorOptions = {};
}
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions2 = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS$1 : _generatorOptions$def2;
return function createPopper2(reference2, popper2, options2) {
if (options2 === void 0) {
options2 = defaultOptions2;
}
var state = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, DEFAULT_OPTIONS$1, defaultOptions2),
modifiersData: {},
elements: {
reference: reference2,
popper: popper2
},
attributes: {},
styles: {}
};
var effectCleanupFns = [];
var isDestroyed = false;
var instance2 = {
state,
setOptions: function setOptions(setOptionsAction) {
var options3 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
cleanupModifierEffects();
state.options = Object.assign({}, defaultOptions2, state.options, options3);
state.scrollParents = {
reference: isElement$2(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
popper: listScrollParents(popper2)
};
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
state.orderedModifiers = orderedModifiers.filter(function(m2) {
return m2.enabled;
});
runModifierEffects();
return instance2.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function forceUpdate() {
if (isDestroyed) {
return;
}
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
if (!areValidElements(reference3, popper3)) {
return;
}
state.rects = {
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
popper: getLayoutRect(popper3)
};
state.reset = false;
state.placement = state.options.placement;
state.orderedModifiers.forEach(function(modifier) {
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
});
for (var index2 = 0; index2 < state.orderedModifiers.length; index2++) {
if (state.reset === true) {
state.reset = false;
index2 = -1;
continue;
}
var _state$orderedModifie = state.orderedModifiers[index2], fn8 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
if (typeof fn8 === "function") {
state = fn8({
state,
options: _options,
name,
instance: instance2
}) || state;
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: debounce$4(function() {
return new Promise(function(resolve3) {
instance2.forceUpdate();
resolve3(state);
});
}),
destroy: function destroy() {
cleanupModifierEffects();
isDestroyed = true;
}
};
if (!areValidElements(reference2, popper2)) {
return instance2;
}
instance2.setOptions(options2).then(function(state2) {
if (!isDestroyed && options2.onFirstUpdate) {
options2.onFirstUpdate(state2);
}
});
function runModifierEffects() {
state.orderedModifiers.forEach(function(_ref3) {
var name = _ref3.name, _ref3$options = _ref3.options, options3 = _ref3$options === void 0 ? {} : _ref3$options, effect4 = _ref3.effect;
if (typeof effect4 === "function") {
var cleanupFn = effect4({
state,
name,
instance: instance2,
options: options3
});
var noopFn = function noopFn2() {
};
effectCleanupFns.push(cleanupFn || noopFn);
}
});
}
function cleanupModifierEffects() {
effectCleanupFns.forEach(function(fn8) {
return fn8();
});
effectCleanupFns = [];
}
return instance2;
};
}
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$6, flip$2, preventOverflow$1, arrow$1, hide$1];
var createPopper = /* @__PURE__ */ popperGenerator({
defaultModifiers
});
var hasElementType = typeof Element !== "undefined";
var hasMap = typeof Map === "function";
var hasSet = typeof Set === "function";
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
function equal$1(a2, b2) {
if (a2 === b2)
return true;
if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
if (a2.constructor !== b2.constructor)
return false;
var length2, i2, keys3;
if (Array.isArray(a2)) {
length2 = a2.length;
if (length2 != b2.length)
return false;
for (i2 = length2; i2-- !== 0; )
if (!equal$1(a2[i2], b2[i2]))
return false;
return true;
}
var it2;
if (hasMap && a2 instanceof Map && b2 instanceof Map) {
if (a2.size !== b2.size)
return false;
it2 = a2.entries();
while (!(i2 = it2.next()).done)
if (!b2.has(i2.value[0]))
return false;
it2 = a2.entries();
while (!(i2 = it2.next()).done)
if (!equal$1(i2.value[1], b2.get(i2.value[0])))
return false;
return true;
}
if (hasSet && a2 instanceof Set && b2 instanceof Set) {
if (a2.size !== b2.size)
return false;
it2 = a2.entries();
while (!(i2 = it2.next()).done)
if (!b2.has(i2.value[0]))
return false;
return true;
}
if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
length2 = a2.length;
if (length2 != b2.length)
return false;
for (i2 = length2; i2-- !== 0; )
if (a2[i2] !== b2[i2])
return false;
return true;
}
if (a2.constructor === RegExp)
return a2.source === b2.source && a2.flags === b2.flags;
if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf === "function" && typeof b2.valueOf === "function")
return a2.valueOf() === b2.valueOf();
if (a2.toString !== Object.prototype.toString && typeof a2.toString === "function" && typeof b2.toString === "function")
return a2.toString() === b2.toString();
keys3 = Object.keys(a2);
length2 = keys3.length;
if (length2 !== Object.keys(b2).length)
return false;
for (i2 = length2; i2-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(b2, keys3[i2]))
return false;
if (hasElementType && a2 instanceof Element)
return false;
for (i2 = length2; i2-- !== 0; ) {
if ((keys3[i2] === "_owner" || keys3[i2] === "__v" || keys3[i2] === "__o") && a2.$$typeof) {
continue;
}
if (!equal$1(a2[keys3[i2]], b2[keys3[i2]]))
return false;
}
return true;
}
return a2 !== a2 && b2 !== b2;
}
var reactFastCompare = function isEqual(a2, b2) {
try {
return equal$1(a2, b2);
} catch (error3) {
if ((error3.message || "").match(/stack|recursion/i)) {
console.warn("react-fast-compare cannot handle circular refs");
return false;
}
throw error3;
}
};
const isEqual$1 = /* @__PURE__ */ getDefaultExportFromCjs(reactFastCompare);
var EMPTY_MODIFIERS$1 = [];
var usePopper = function usePopper2(referenceElement, popperElement, options2) {
if (options2 === void 0) {
options2 = {};
}
var prevOptions = reactExports.useRef(null);
var optionsWithDefaults = {
onFirstUpdate: options2.onFirstUpdate,
placement: options2.placement || "bottom",
strategy: options2.strategy || "absolute",
modifiers: options2.modifiers || EMPTY_MODIFIERS$1
};
var _React$useState = reactExports.useState({
styles: {
popper: {
position: optionsWithDefaults.strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
}), state = _React$useState[0], setState2 = _React$useState[1];
var updateStateModifier = reactExports.useMemo(function() {
return {
name: "updateState",
enabled: true,
phase: "write",
fn: function fn8(_ref3) {
var state2 = _ref3.state;
var elements2 = Object.keys(state2.elements);
reactDomExports.flushSync(function() {
setState2({
styles: fromEntries(elements2.map(function(element2) {
return [element2, state2.styles[element2] || {}];
})),
attributes: fromEntries(elements2.map(function(element2) {
return [element2, state2.attributes[element2]];
}))
});
});
},
requires: ["computeStyles"]
};
}, []);
var popperOptions = reactExports.useMemo(function() {
var newOptions = {
onFirstUpdate: optionsWithDefaults.onFirstUpdate,
placement: optionsWithDefaults.placement,
strategy: optionsWithDefaults.strategy,
modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
name: "applyStyles",
enabled: false
}])
};
if (isEqual$1(prevOptions.current, newOptions)) {
return prevOptions.current || newOptions;
} else {
prevOptions.current = newOptions;
return newOptions;
}
}, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
var popperInstanceRef = reactExports.useRef();
useIsomorphicLayoutEffect$2(function() {
if (popperInstanceRef.current) {
popperInstanceRef.current.setOptions(popperOptions);
}
}, [popperOptions]);
useIsomorphicLayoutEffect$2(function() {
if (referenceElement == null || popperElement == null) {
return;
}
var createPopper$1 = options2.createPopper || createPopper;
var popperInstance = createPopper$1(referenceElement, popperElement, popperOptions);
popperInstanceRef.current = popperInstance;
return function() {
popperInstance.destroy();
popperInstanceRef.current = null;
};
}, [referenceElement, popperElement, options2.createPopper]);
return {
state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
styles: state.styles,
attributes: state.attributes,
update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
};
};
var NOOP = function NOOP2() {
return void 0;
};
var NOOP_PROMISE = function NOOP_PROMISE2() {
return Promise.resolve(null);
};
var EMPTY_MODIFIERS = [];
function Popper(_ref3) {
var _ref$placement = _ref3.placement, placement = _ref$placement === void 0 ? "bottom" : _ref$placement, _ref$strategy = _ref3.strategy, strategy = _ref$strategy === void 0 ? "absolute" : _ref$strategy, _ref$modifiers = _ref3.modifiers, modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS : _ref$modifiers, referenceElement = _ref3.referenceElement, onFirstUpdate = _ref3.onFirstUpdate, innerRef = _ref3.innerRef, children2 = _ref3.children;
var referenceNode = reactExports.useContext(ManagerReferenceNodeContext);
var _React$useState = reactExports.useState(null), popperElement = _React$useState[0], setPopperElement = _React$useState[1];
var _React$useState2 = reactExports.useState(null), arrowElement = _React$useState2[0], setArrowElement = _React$useState2[1];
reactExports.useEffect(function() {
setRef(innerRef, popperElement);
}, [innerRef, popperElement]);
var options2 = reactExports.useMemo(function() {
return {
placement,
strategy,
onFirstUpdate,
modifiers: [].concat(modifiers, [{
name: "arrow",
enabled: arrowElement != null,
options: {
element: arrowElement
}
}])
};
}, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
var _usePopper = usePopper(referenceElement || referenceNode, popperElement, options2), state = _usePopper.state, styles2 = _usePopper.styles, forceUpdate = _usePopper.forceUpdate, update2 = _usePopper.update;
var childrenProps = reactExports.useMemo(function() {
return {
ref: setPopperElement,
style: styles2.popper,
placement: state ? state.placement : placement,
hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
arrowProps: {
style: styles2.arrow,
ref: setArrowElement
},
forceUpdate: forceUpdate || NOOP,
update: update2 || NOOP_PROMISE
};
}, [setPopperElement, setArrowElement, placement, state, styles2, update2, forceUpdate]);
return unwrapArray(children2)(childrenProps);
}
var warning = function() {
};
var warning_1 = warning;
const warning$1 = /* @__PURE__ */ getDefaultExportFromCjs(warning_1);
function Reference(_ref3) {
var children2 = _ref3.children, innerRef = _ref3.innerRef;
var setReferenceNode = reactExports.useContext(ManagerReferenceNodeSetterContext);
var refHandler = reactExports.useCallback(function(node2) {
setRef(innerRef, node2);
safeInvoke(setReferenceNode, node2);
}, [innerRef, setReferenceNode]);
reactExports.useEffect(function() {
return function() {
return setRef(innerRef, null);
};
}, []);
reactExports.useEffect(function() {
warning$1(Boolean(setReferenceNode), "`Reference` should not be used outside of a `Manager` component.");
}, [setReferenceNode]);
return unwrapArray(children2)({
ref: refHandler
});
}
const esm$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
Manager: Manager$2,
Popper,
Reference,
usePopper
}, Symbol.toStringTag, { value: "Module" }));
const require$$9$2 = /* @__PURE__ */ getAugmentedNamespace(esm$2);
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$1(subClass, superClass);
}
var propTypesExports = requirePropTypes$1();
const u$9 = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
function hasClass(element2, className) {
if (element2.classList)
return !!className && element2.classList.contains(className);
return (" " + (element2.className.baseVal || element2.className) + " ").indexOf(" " + className + " ") !== -1;
}
function addClass(element2, className) {
if (element2.classList)
element2.classList.add(className);
else if (!hasClass(element2, className))
if (typeof element2.className === "string")
element2.className = element2.className + " " + className;
else
element2.setAttribute("class", (element2.className && element2.className.baseVal || "") + " " + className);
}
function replaceClassName(origClass, classToRemove) {
return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
}
function removeClass$1(element2, className) {
if (element2.classList) {
element2.classList.remove(className);
} else if (typeof element2.className === "string") {
element2.className = replaceClassName(element2.className, className);
} else {
element2.setAttribute("class", replaceClassName(element2.className && element2.className.baseVal || "", className));
}
}
const config$1 = {
disabled: false
};
const TransitionGroupContext = React.createContext(null);
var forceReflow = function forceReflow2(node2) {
return node2.scrollTop;
};
var UNMOUNTED = "unmounted";
var EXITED = "exited";
var ENTERING = "entering";
var ENTERED = "entered";
var EXITING = "exiting";
var Transition = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose(Transition2, _React$Component);
function Transition2(props, context2) {
var _this;
_this = _React$Component.call(this, props, context2) || this;
var parentGroup = context2;
var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
var initialStatus;
_this.appearStatus = null;
if (props.in) {
if (appear) {
initialStatus = EXITED;
_this.appearStatus = ENTERING;
} else {
initialStatus = ENTERED;
}
} else {
if (props.unmountOnExit || props.mountOnEnter) {
initialStatus = UNMOUNTED;
} else {
initialStatus = EXITED;
}
}
_this.state = {
status: initialStatus
};
_this.nextCallback = null;
return _this;
}
Transition2.getDerivedStateFromProps = function getDerivedStateFromProps(_ref3, prevState) {
var nextIn = _ref3.in;
if (nextIn && prevState.status === UNMOUNTED) {
return {
status: EXITED
};
}
return null;
};
var _proto = Transition2.prototype;
_proto.componentDidMount = function componentDidMount() {
this.updateStatus(true, this.appearStatus);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
var nextStatus = null;
if (prevProps !== this.props) {
var status = this.state.status;
if (this.props.in) {
if (status !== ENTERING && status !== ENTERED) {
nextStatus = ENTERING;
}
} else {
if (status === ENTERING || status === ENTERED) {
nextStatus = EXITING;
}
}
}
this.updateStatus(false, nextStatus);
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.cancelNextCallback();
};
_proto.getTimeouts = function getTimeouts() {
var timeout2 = this.props.timeout;
var exit, enter, appear;
exit = enter = appear = timeout2;
if (timeout2 != null && typeof timeout2 !== "number") {
exit = timeout2.exit;
enter = timeout2.enter;
appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
}
return {
exit,
enter,
appear
};
};
_proto.updateStatus = function updateStatus(mounting, nextStatus) {
if (mounting === void 0) {
mounting = false;
}
if (nextStatus !== null) {
this.cancelNextCallback();
if (nextStatus === ENTERING) {
if (this.props.unmountOnExit || this.props.mountOnEnter) {
var node2 = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
if (node2)
forceReflow(node2);
}
this.performEnter(mounting);
} else {
this.performExit();
}
} else if (this.props.unmountOnExit && this.state.status === EXITED) {
this.setState({
status: UNMOUNTED
});
}
};
_proto.performEnter = function performEnter(mounting) {
var _this2 = this;
var enter = this.props.enter;
var appearing = this.context ? this.context.isMounting : mounting;
var _ref22 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref22[0], maybeAppearing = _ref22[1];
var timeouts = this.getTimeouts();
var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
if (!mounting && !enter || config$1.disabled) {
this.safeSetState({
status: ENTERED
}, function() {
_this2.props.onEntered(maybeNode);
});
return;
}
this.props.onEnter(maybeNode, maybeAppearing);
this.safeSetState({
status: ENTERING
}, function() {
_this2.props.onEntering(maybeNode, maybeAppearing);
_this2.onTransitionEnd(enterTimeout, function() {
_this2.safeSetState({
status: ENTERED
}, function() {
_this2.props.onEntered(maybeNode, maybeAppearing);
});
});
});
};
_proto.performExit = function performExit() {
var _this3 = this;
var exit = this.props.exit;
var timeouts = this.getTimeouts();
var maybeNode = this.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
if (!exit || config$1.disabled) {
this.safeSetState({
status: EXITED
}, function() {
_this3.props.onExited(maybeNode);
});
return;
}
this.props.onExit(maybeNode);
this.safeSetState({
status: EXITING
}, function() {
_this3.props.onExiting(maybeNode);
_this3.onTransitionEnd(timeouts.exit, function() {
_this3.safeSetState({
status: EXITED
}, function() {
_this3.props.onExited(maybeNode);
});
});
});
};
_proto.cancelNextCallback = function cancelNextCallback() {
if (this.nextCallback !== null) {
this.nextCallback.cancel();
this.nextCallback = null;
}
};
_proto.safeSetState = function safeSetState(nextState, callback) {
callback = this.setNextCallback(callback);
this.setState(nextState, callback);
};
_proto.setNextCallback = function setNextCallback(callback) {
var _this4 = this;
var active = true;
this.nextCallback = function(event2) {
if (active) {
active = false;
_this4.nextCallback = null;
callback(event2);
}
};
this.nextCallback.cancel = function() {
active = false;
};
return this.nextCallback;
};
_proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
this.setNextCallback(handler);
var node2 = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
if (!node2 || doesNotHaveTimeoutOrListener) {
setTimeout(this.nextCallback, 0);
return;
}
if (this.props.addEndListener) {
var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node2, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1];
this.props.addEndListener(maybeNode, maybeNextCallback);
}
if (timeout2 != null) {
setTimeout(this.nextCallback, timeout2);
}
};
_proto.render = function render3() {
var status = this.state.status;
if (status === UNMOUNTED) {
return null;
}
var _this$props = this.props, children2 = _this$props.children;
_this$props.in;
_this$props.mountOnEnter;
_this$props.unmountOnExit;
_this$props.appear;
_this$props.enter;
_this$props.exit;
_this$props.timeout;
_this$props.addEndListener;
_this$props.onEnter;
_this$props.onEntering;
_this$props.onEntered;
_this$props.onExit;
_this$props.onExiting;
_this$props.onExited;
_this$props.nodeRef;
var childProps = _objectWithoutPropertiesLoose$2(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
return (
// allows for nested Transitions
/* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
value: null
}, typeof children2 === "function" ? children2(status, childProps) : React.cloneElement(React.Children.only(children2), childProps))
);
};
return Transition2;
}(React.Component);
Transition.contextType = TransitionGroupContext;
Transition.propTypes = {};
function noop$b() {
}
Transition.defaultProps = {
in: false,
mountOnEnter: false,
unmountOnExit: false,
appear: false,
enter: true,
exit: true,
onEnter: noop$b,
onEntering: noop$b,
onEntered: noop$b,
onExit: noop$b,
onExiting: noop$b,
onExited: noop$b
};
Transition.UNMOUNTED = UNMOUNTED;
Transition.EXITED = EXITED;
Transition.ENTERING = ENTERING;
Transition.ENTERED = ENTERED;
Transition.EXITING = EXITING;
const Transition$1 = Transition;
var _addClass = function addClass$1(node2, classes) {
return node2 && classes && classes.split(" ").forEach(function(c2) {
return addClass(node2, c2);
});
};
var removeClass = function removeClass2(node2, classes) {
return node2 && classes && classes.split(" ").forEach(function(c2) {
return removeClass$1(node2, c2);
});
};
var CSSTransition = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose(CSSTransition2, _React$Component);
function CSSTransition2() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.appliedClasses = {
appear: {},
enter: {},
exit: {}
};
_this.onEnter = function(maybeNode, maybeAppearing) {
var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing), node2 = _this$resolveArgument[0], appearing = _this$resolveArgument[1];
_this.removeClasses(node2, "exit");
_this.addClass(node2, appearing ? "appear" : "enter", "base");
if (_this.props.onEnter) {
_this.props.onEnter(maybeNode, maybeAppearing);
}
};
_this.onEntering = function(maybeNode, maybeAppearing) {
var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing), node2 = _this$resolveArgument2[0], appearing = _this$resolveArgument2[1];
var type2 = appearing ? "appear" : "enter";
_this.addClass(node2, type2, "active");
if (_this.props.onEntering) {
_this.props.onEntering(maybeNode, maybeAppearing);
}
};
_this.onEntered = function(maybeNode, maybeAppearing) {
var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing), node2 = _this$resolveArgument3[0], appearing = _this$resolveArgument3[1];
var type2 = appearing ? "appear" : "enter";
_this.removeClasses(node2, type2);
_this.addClass(node2, type2, "done");
if (_this.props.onEntered) {
_this.props.onEntered(maybeNode, maybeAppearing);
}
};
_this.onExit = function(maybeNode) {
var _this$resolveArgument4 = _this.resolveArguments(maybeNode), node2 = _this$resolveArgument4[0];
_this.removeClasses(node2, "appear");
_this.removeClasses(node2, "enter");
_this.addClass(node2, "exit", "base");
if (_this.props.onExit) {
_this.props.onExit(maybeNode);
}
};
_this.onExiting = function(maybeNode) {
var _this$resolveArgument5 = _this.resolveArguments(maybeNode), node2 = _this$resolveArgument5[0];
_this.addClass(node2, "exit", "active");
if (_this.props.onExiting) {
_this.props.onExiting(maybeNode);
}
};
_this.onExited = function(maybeNode) {
var _this$resolveArgument6 = _this.resolveArguments(maybeNode), node2 = _this$resolveArgument6[0];
_this.removeClasses(node2, "exit");
_this.addClass(node2, "exit", "done");
if (_this.props.onExited) {
_this.props.onExited(maybeNode);
}
};
_this.resolveArguments = function(maybeNode, maybeAppearing) {
return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] : [maybeNode, maybeAppearing];
};
_this.getClassNames = function(type2) {
var classNames2 = _this.props.classNames;
var isStringClassNames = typeof classNames2 === "string";
var prefix2 = isStringClassNames && classNames2 ? classNames2 + "-" : "";
var baseClassName = isStringClassNames ? "" + prefix2 + type2 : classNames2[type2];
var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames2[type2 + "Active"];
var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames2[type2 + "Done"];
return {
baseClassName,
activeClassName,
doneClassName
};
};
return _this;
}
var _proto = CSSTransition2.prototype;
_proto.addClass = function addClass2(node2, type2, phase) {
var className = this.getClassNames(type2)[phase + "ClassName"];
var _this$getClassNames = this.getClassNames("enter"), doneClassName = _this$getClassNames.doneClassName;
if (type2 === "appear" && phase === "done" && doneClassName) {
className += " " + doneClassName;
}
if (phase === "active") {
if (node2)
forceReflow(node2);
}
if (className) {
this.appliedClasses[type2][phase] = className;
_addClass(node2, className);
}
};
_proto.removeClasses = function removeClasses(node2, type2) {
var _this$appliedClasses$ = this.appliedClasses[type2], baseClassName = _this$appliedClasses$.base, activeClassName = _this$appliedClasses$.active, doneClassName = _this$appliedClasses$.done;
this.appliedClasses[type2] = {};
if (baseClassName) {
removeClass(node2, baseClassName);
}
if (activeClassName) {
removeClass(node2, activeClassName);
}
if (doneClassName) {
removeClass(node2, doneClassName);
}
};
_proto.render = function render3() {
var _this$props = this.props;
_this$props.classNames;
var props = _objectWithoutPropertiesLoose$2(_this$props, ["classNames"]);
return /* @__PURE__ */ React.createElement(Transition$1, _extends$3({}, props, {
onEnter: this.onEnter,
onEntered: this.onEntered,
onEntering: this.onEntering,
onExit: this.onExit,
onExiting: this.onExiting,
onExited: this.onExited
}));
};
return CSSTransition2;
}(React.Component);
CSSTransition.defaultProps = {
classNames: ""
};
CSSTransition.propTypes = {};
const CSSTransition$1 = CSSTransition;
function getChildMapping(children2, mapFn) {
var mapper = function mapper2(child) {
return mapFn && reactExports.isValidElement(child) ? mapFn(child) : child;
};
var result = /* @__PURE__ */ Object.create(null);
if (children2)
reactExports.Children.map(children2, function(c2) {
return c2;
}).forEach(function(child) {
result[child.key] = mapper(child);
});
return result;
}
function mergeChildMappings(prev2, next2) {
prev2 = prev2 || {};
next2 = next2 || {};
function getValueForKey(key2) {
return key2 in next2 ? next2[key2] : prev2[key2];
}
var nextKeysPending = /* @__PURE__ */ Object.create(null);
var pendingKeys = [];
for (var prevKey in prev2) {
if (prevKey in next2) {
if (pendingKeys.length) {
nextKeysPending[prevKey] = pendingKeys;
pendingKeys = [];
}
} else {
pendingKeys.push(prevKey);
}
}
var i2;
var childMapping = {};
for (var nextKey in next2) {
if (nextKeysPending[nextKey]) {
for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
var pendingNextKey = nextKeysPending[nextKey][i2];
childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
}
}
childMapping[nextKey] = getValueForKey(nextKey);
}
for (i2 = 0; i2 < pendingKeys.length; i2++) {
childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
}
return childMapping;
}
function getProp(child, prop, props) {
return props[prop] != null ? props[prop] : child.props[prop];
}
function getInitialChildMapping(props, onExited) {
return getChildMapping(props.children, function(child) {
return reactExports.cloneElement(child, {
onExited: onExited.bind(null, child),
in: true,
appear: getProp(child, "appear", props),
enter: getProp(child, "enter", props),
exit: getProp(child, "exit", props)
});
});
}
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
var nextChildMapping = getChildMapping(nextProps.children);
var children2 = mergeChildMappings(prevChildMapping, nextChildMapping);
Object.keys(children2).forEach(function(key2) {
var child = children2[key2];
if (!reactExports.isValidElement(child))
return;
var hasPrev = key2 in prevChildMapping;
var hasNext = key2 in nextChildMapping;
var prevChild = prevChildMapping[key2];
var isLeaving = reactExports.isValidElement(prevChild) && !prevChild.props.in;
if (hasNext && (!hasPrev || isLeaving)) {
children2[key2] = reactExports.cloneElement(child, {
onExited: onExited.bind(null, child),
in: true,
exit: getProp(child, "exit", nextProps),
enter: getProp(child, "enter", nextProps)
});
} else if (!hasNext && hasPrev && !isLeaving) {
children2[key2] = reactExports.cloneElement(child, {
in: false
});
} else if (hasNext && hasPrev && reactExports.isValidElement(prevChild)) {
children2[key2] = reactExports.cloneElement(child, {
onExited: onExited.bind(null, child),
in: prevChild.props.in,
exit: getProp(child, "exit", nextProps),
enter: getProp(child, "enter", nextProps)
});
}
});
return children2;
}
var values$2 = Object.values || function(obj) {
return Object.keys(obj).map(function(k2) {
return obj[k2];
});
};
var defaultProps$4 = {
component: "div",
childFactory: function childFactory(child) {
return child;
}
};
var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose(TransitionGroup2, _React$Component);
function TransitionGroup2(props, context2) {
var _this;
_this = _React$Component.call(this, props, context2) || this;
var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
_this.state = {
contextValue: {
isMounting: true
},
handleExited,
firstRender: true
};
return _this;
}
var _proto = TransitionGroup2.prototype;
_proto.componentDidMount = function componentDidMount() {
this.mounted = true;
this.setState({
contextValue: {
isMounting: false
}
});
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.mounted = false;
};
TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref3) {
var prevChildMapping = _ref3.children, handleExited = _ref3.handleExited, firstRender = _ref3.firstRender;
return {
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
firstRender: false
};
};
_proto.handleExited = function handleExited(child, node2) {
var currentChildMapping = getChildMapping(this.props.children);
if (child.key in currentChildMapping)
return;
if (child.props.onExited) {
child.props.onExited(node2);
}
if (this.mounted) {
this.setState(function(state) {
var children2 = _extends$3({}, state.children);
delete children2[child.key];
return {
children: children2
};
});
}
};
_proto.render = function render3() {
var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose$2(_this$props, ["component", "childFactory"]);
var contextValue = this.state.contextValue;
var children2 = values$2(this.state.children).map(childFactory2);
delete props.appear;
delete props.enter;
delete props.exit;
if (Component === null) {
return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
value: contextValue
}, children2);
}
return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
value: contextValue
}, /* @__PURE__ */ React.createElement(Component, props, children2));
};
return TransitionGroup2;
}(React.Component);
TransitionGroup.propTypes = {};
TransitionGroup.defaultProps = defaultProps$4;
const TransitionGroup$1 = TransitionGroup;
var ReplaceTransition = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose(ReplaceTransition2, _React$Component);
function ReplaceTransition2() {
var _this;
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
_this.handleEnter = function() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return _this.handleLifecycle("onEnter", 0, args);
};
_this.handleEntering = function() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return _this.handleLifecycle("onEntering", 0, args);
};
_this.handleEntered = function() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return _this.handleLifecycle("onEntered", 0, args);
};
_this.handleExit = function() {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
return _this.handleLifecycle("onExit", 1, args);
};
_this.handleExiting = function() {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
args[_key6] = arguments[_key6];
}
return _this.handleLifecycle("onExiting", 1, args);
};
_this.handleExited = function() {
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
return _this.handleLifecycle("onExited", 1, args);
};
return _this;
}
var _proto = ReplaceTransition2.prototype;
_proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
var _child$props;
var children2 = this.props.children;
var child = React.Children.toArray(children2)[idx];
if (child.props[handler])
(_child$props = child.props)[handler].apply(_child$props, originalArgs);
if (this.props[handler]) {
var maybeNode = child.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
this.props[handler](maybeNode);
}
};
_proto.render = function render3() {
var _this$props = this.props, children2 = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose$2(_this$props, ["children", "in"]);
var _React$Children$toArr = React.Children.toArray(children2), first = _React$Children$toArr[0], second2 = _React$Children$toArr[1];
delete props.onEnter;
delete props.onEntering;
delete props.onEntered;
delete props.onExit;
delete props.onExiting;
delete props.onExited;
return /* @__PURE__ */ React.createElement(TransitionGroup$1, props, inProp ? React.cloneElement(first, {
key: "first",
onEnter: this.handleEnter,
onEntering: this.handleEntering,
onEntered: this.handleEntered
}) : React.cloneElement(second2, {
key: "second",
onEnter: this.handleExit,
onEntering: this.handleExiting,
onEntered: this.handleExited
}));
};
return ReplaceTransition2;
}(React.Component);
ReplaceTransition.propTypes = {};
const ReplaceTransition$1 = ReplaceTransition;
var _leaveRenders, _enterRenders;
function areChildrenDifferent(oldChildren, newChildren) {
if (oldChildren === newChildren)
return false;
if (React.isValidElement(oldChildren) && React.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
return false;
}
return true;
}
var modes = {
out: "out-in",
in: "in-out"
};
var callHook = function callHook2(element2, name, cb2) {
return function() {
var _element$props;
element2.props[name] && (_element$props = element2.props)[name].apply(_element$props, arguments);
cb2();
};
};
var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function(_ref3) {
var current = _ref3.current, changeState = _ref3.changeState;
return React.cloneElement(current, {
in: false,
onExited: callHook(current, "onExited", function() {
changeState(ENTERING, null);
})
});
}, _leaveRenders[modes.in] = function(_ref22) {
var current = _ref22.current, changeState = _ref22.changeState, children2 = _ref22.children;
return [current, React.cloneElement(children2, {
in: true,
onEntered: callHook(children2, "onEntered", function() {
changeState(ENTERING);
})
})];
}, _leaveRenders);
var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function(_ref3) {
var children2 = _ref3.children, changeState = _ref3.changeState;
return React.cloneElement(children2, {
in: true,
onEntered: callHook(children2, "onEntered", function() {
changeState(ENTERED, React.cloneElement(children2, {
in: true
}));
})
});
}, _enterRenders[modes.in] = function(_ref4) {
var current = _ref4.current, children2 = _ref4.children, changeState = _ref4.changeState;
return [React.cloneElement(current, {
in: false,
onExited: callHook(current, "onExited", function() {
changeState(ENTERED, React.cloneElement(children2, {
in: true
}));
})
}), React.cloneElement(children2, {
in: true
})];
}, _enterRenders);
var SwitchTransition = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose(SwitchTransition2, _React$Component);
function SwitchTransition2() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.state = {
status: ENTERED,
current: null
};
_this.appeared = false;
_this.changeState = function(status, current) {
if (current === void 0) {
current = _this.state.current;
}
_this.setState({
status,
current
});
};
return _this;
}
var _proto = SwitchTransition2.prototype;
_proto.componentDidMount = function componentDidMount() {
this.appeared = true;
};
SwitchTransition2.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
if (props.children == null) {
return {
current: null
};
}
if (state.status === ENTERING && props.mode === modes.in) {
return {
status: ENTERING
};
}
if (state.current && areChildrenDifferent(state.current, props.children)) {
return {
status: EXITING
};
}
return {
current: React.cloneElement(props.children, {
in: true
})
};
};
_proto.render = function render3() {
var _this$props = this.props, children2 = _this$props.children, mode = _this$props.mode, _this$state = this.state, status = _this$state.status, current = _this$state.current;
var data2 = {
children: children2,
current,
changeState: this.changeState,
status
};
var component;
switch (status) {
case ENTERING:
component = enterRenders[mode](data2);
break;
case EXITING:
component = leaveRenders[mode](data2);
break;
case ENTERED:
component = current;
}
return /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
value: {
isMounting: !this.appeared
}
}, component);
};
return SwitchTransition2;
}(React.Component);
SwitchTransition.propTypes = {};
SwitchTransition.defaultProps = {
mode: modes.out
};
const SwitchTransition$1 = SwitchTransition;
const esm$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
CSSTransition: CSSTransition$1,
ReplaceTransition: ReplaceTransition$1,
SwitchTransition: SwitchTransition$1,
Transition: Transition$1,
TransitionGroup: TransitionGroup$1,
config: config$1
}, Symbol.toStringTag, { value: "Module" }));
const require$$9$1 = /* @__PURE__ */ getAugmentedNamespace(esm$1);
var _baseFindIndex;
var hasRequired_baseFindIndex;
function require_baseFindIndex() {
if (hasRequired_baseFindIndex)
return _baseFindIndex;
hasRequired_baseFindIndex = 1;
function baseFindIndex2(array2, predicate, fromIndex, fromRight) {
var length2 = array2.length, index2 = fromIndex + (fromRight ? 1 : -1);
while (fromRight ? index2-- : ++index2 < length2) {
if (predicate(array2[index2], index2, array2)) {
return index2;
}
}
return -1;
}
_baseFindIndex = baseFindIndex2;
return _baseFindIndex;
}
var _trimmedEndIndex$1;
var hasRequired_trimmedEndIndex;
function require_trimmedEndIndex() {
if (hasRequired_trimmedEndIndex)
return _trimmedEndIndex$1;
hasRequired_trimmedEndIndex = 1;
var reWhitespace2 = /\s/;
function trimmedEndIndex2(string2) {
var index2 = string2.length;
while (index2-- && reWhitespace2.test(string2.charAt(index2))) {
}
return index2;
}
_trimmedEndIndex$1 = trimmedEndIndex2;
return _trimmedEndIndex$1;
}
var _baseTrim$1;
var hasRequired_baseTrim;
function require_baseTrim() {
if (hasRequired_baseTrim)
return _baseTrim$1;
hasRequired_baseTrim = 1;
var trimmedEndIndex2 = require_trimmedEndIndex();
var reTrimStart2 = /^\s+/;
function baseTrim2(string2) {
return string2 ? string2.slice(0, trimmedEndIndex2(string2) + 1).replace(reTrimStart2, "") : string2;
}
_baseTrim$1 = baseTrim2;
return _baseTrim$1;
}
var toNumber_1$1;
var hasRequiredToNumber;
function requireToNumber() {
if (hasRequiredToNumber)
return toNumber_1$1;
hasRequiredToNumber = 1;
var baseTrim2 = require_baseTrim(), isObject2 = requireIsObject(), isSymbol2 = requireIsSymbol();
var NAN2 = 0 / 0;
var reIsBadHex2 = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary2 = /^0b[01]+$/i;
var reIsOctal2 = /^0o[0-7]+$/i;
var freeParseInt2 = parseInt;
function toNumber3(value2) {
if (typeof value2 == "number") {
return value2;
}
if (isSymbol2(value2)) {
return NAN2;
}
if (isObject2(value2)) {
var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
value2 = isObject2(other) ? other + "" : other;
}
if (typeof value2 != "string") {
return value2 === 0 ? value2 : +value2;
}
value2 = baseTrim2(value2);
var isBinary2 = reIsBinary2.test(value2);
return isBinary2 || reIsOctal2.test(value2) ? freeParseInt2(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex2.test(value2) ? NAN2 : +value2;
}
toNumber_1$1 = toNumber3;
return toNumber_1$1;
}
var toFinite_1;
var hasRequiredToFinite;
function requireToFinite() {
if (hasRequiredToFinite)
return toFinite_1;
hasRequiredToFinite = 1;
var toNumber3 = requireToNumber();
var INFINITY2 = 1 / 0, MAX_INTEGER = 17976931348623157e292;
function toFinite(value2) {
if (!value2) {
return value2 === 0 ? value2 : 0;
}
value2 = toNumber3(value2);
if (value2 === INFINITY2 || value2 === -INFINITY2) {
var sign2 = value2 < 0 ? -1 : 1;
return sign2 * MAX_INTEGER;
}
return value2 === value2 ? value2 : 0;
}
toFinite_1 = toFinite;
return toFinite_1;
}
var toInteger_1;
var hasRequiredToInteger;
function requireToInteger() {
if (hasRequiredToInteger)
return toInteger_1;
hasRequiredToInteger = 1;
var toFinite = requireToFinite();
function toInteger(value2) {
var result = toFinite(value2), remainder = result % 1;
return result === result ? remainder ? result - remainder : result : 0;
}
toInteger_1 = toInteger;
return toInteger_1;
}
var findIndex_1;
var hasRequiredFindIndex;
function requireFindIndex() {
if (hasRequiredFindIndex)
return findIndex_1;
hasRequiredFindIndex = 1;
var baseFindIndex2 = require_baseFindIndex(), baseIteratee = require_baseIteratee(), toInteger = requireToInteger();
var nativeMax2 = Math.max;
function findIndex(array2, predicate, fromIndex) {
var length2 = array2 == null ? 0 : array2.length;
if (!length2) {
return -1;
}
var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
if (index2 < 0) {
index2 = nativeMax2(length2 + index2, 0);
}
return baseFindIndex2(array2, baseIteratee(predicate, 3), index2);
}
findIndex_1 = findIndex;
return findIndex_1;
}
var has$3 = Object.prototype.hasOwnProperty;
function find$3(iter, tar, key2) {
for (key2 of iter.keys()) {
if (dequal(key2, tar))
return key2;
}
}
function dequal(foo, bar) {
var ctor, len, tmp;
if (foo === bar)
return true;
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
if (ctor === Date)
return foo.getTime() === bar.getTime();
if (ctor === RegExp)
return foo.toString() === bar.toString();
if (ctor === Array) {
if ((len = foo.length) === bar.length) {
while (len-- && dequal(foo[len], bar[len]))
;
}
return len === -1;
}
if (ctor === Set) {
if (foo.size !== bar.size) {
return false;
}
for (len of foo) {
tmp = len;
if (tmp && typeof tmp === "object") {
tmp = find$3(bar, tmp);
if (!tmp)
return false;
}
if (!bar.has(tmp))
return false;
}
return true;
}
if (ctor === Map) {
if (foo.size !== bar.size) {
return false;
}
for (len of foo) {
tmp = len[0];
if (tmp && typeof tmp === "object") {
tmp = find$3(bar, tmp);
if (!tmp)
return false;
}
if (!dequal(len[1], bar.get(tmp))) {
return false;
}
}
return true;
}
if (ctor === ArrayBuffer) {
foo = new Uint8Array(foo);
bar = new Uint8Array(bar);
} else if (ctor === DataView) {
if ((len = foo.byteLength) === bar.byteLength) {
while (len-- && foo.getInt8(len) === bar.getInt8(len))
;
}
return len === -1;
}
if (ArrayBuffer.isView(foo)) {
if ((len = foo.byteLength) === bar.byteLength) {
while (len-- && foo[len] === bar[len])
;
}
return len === -1;
}
if (!ctor || typeof foo === "object") {
len = 0;
for (ctor in foo) {
if (has$3.call(foo, ctor) && ++len && !has$3.call(bar, ctor))
return false;
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor]))
return false;
}
return Object.keys(bar).length === len;
}
}
return foo !== foo && bar !== bar;
}
function useDeepCompareMemoize(value2) {
var ref2 = reactExports.useRef(value2);
var signalRef = reactExports.useRef(0);
if (!dequal(value2, ref2.current)) {
ref2.current = value2;
signalRef.current += 1;
}
return reactExports.useMemo(function() {
return ref2.current;
}, [signalRef.current]);
}
function useDeepCompareEffect(callback, dependencies) {
return reactExports.useEffect(callback, useDeepCompareMemoize(dependencies));
}
function useDeepCompareEffectNoCheck(callback, dependencies) {
return reactExports.useEffect(callback, useDeepCompareMemoize(dependencies));
}
const useDeepCompareEffect_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: useDeepCompareEffect,
useDeepCompareEffectNoCheck,
useDeepCompareMemoize
}, Symbol.toStringTag, { value: "Module" }));
const require$$18 = /* @__PURE__ */ getAugmentedNamespace(useDeepCompareEffect_esm);
var _isFlattenable;
var hasRequired_isFlattenable;
function require_isFlattenable() {
if (hasRequired_isFlattenable)
return _isFlattenable;
hasRequired_isFlattenable = 1;
var Symbol2 = require_Symbol(), isArguments2 = requireIsArguments(), isArray3 = requireIsArray();
var spreadableSymbol2 = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
function isFlattenable2(value2) {
return isArray3(value2) || isArguments2(value2) || !!(spreadableSymbol2 && value2 && value2[spreadableSymbol2]);
}
_isFlattenable = isFlattenable2;
return _isFlattenable;
}
var _baseFlatten;
var hasRequired_baseFlatten;
function require_baseFlatten() {
if (hasRequired_baseFlatten)
return _baseFlatten;
hasRequired_baseFlatten = 1;
var arrayPush2 = require_arrayPush(), isFlattenable2 = require_isFlattenable();
function baseFlatten2(array2, depth, predicate, isStrict, result) {
var index2 = -1, length2 = array2.length;
predicate || (predicate = isFlattenable2);
result || (result = []);
while (++index2 < length2) {
var value2 = array2[index2];
if (depth > 0 && predicate(value2)) {
if (depth > 1) {
baseFlatten2(value2, depth - 1, predicate, isStrict, result);
} else {
arrayPush2(result, value2);
}
} else if (!isStrict) {
result[result.length] = value2;
}
}
return result;
}
_baseFlatten = baseFlatten2;
return _baseFlatten;
}
var _baseIsNaN;
var hasRequired_baseIsNaN;
function require_baseIsNaN() {
if (hasRequired_baseIsNaN)
return _baseIsNaN;
hasRequired_baseIsNaN = 1;
function baseIsNaN2(value2) {
return value2 !== value2;
}
_baseIsNaN = baseIsNaN2;
return _baseIsNaN;
}
var _strictIndexOf;
var hasRequired_strictIndexOf;
function require_strictIndexOf() {
if (hasRequired_strictIndexOf)
return _strictIndexOf;
hasRequired_strictIndexOf = 1;
function strictIndexOf(array2, value2, fromIndex) {
var index2 = fromIndex - 1, length2 = array2.length;
while (++index2 < length2) {
if (array2[index2] === value2) {
return index2;
}
}
return -1;
}
_strictIndexOf = strictIndexOf;
return _strictIndexOf;
}
var _baseIndexOf;
var hasRequired_baseIndexOf;
function require_baseIndexOf() {
if (hasRequired_baseIndexOf)
return _baseIndexOf;
hasRequired_baseIndexOf = 1;
var baseFindIndex2 = require_baseFindIndex(), baseIsNaN2 = require_baseIsNaN(), strictIndexOf = require_strictIndexOf();
function baseIndexOf2(array2, value2, fromIndex) {
return value2 === value2 ? strictIndexOf(array2, value2, fromIndex) : baseFindIndex2(array2, baseIsNaN2, fromIndex);
}
_baseIndexOf = baseIndexOf2;
return _baseIndexOf;
}
var _arrayIncludes;
var hasRequired_arrayIncludes;
function require_arrayIncludes() {
if (hasRequired_arrayIncludes)
return _arrayIncludes;
hasRequired_arrayIncludes = 1;
var baseIndexOf2 = require_baseIndexOf();
function arrayIncludes2(array2, value2) {
var length2 = array2 == null ? 0 : array2.length;
return !!length2 && baseIndexOf2(array2, value2, 0) > -1;
}
_arrayIncludes = arrayIncludes2;
return _arrayIncludes;
}
var _arrayIncludesWith;
var hasRequired_arrayIncludesWith;
function require_arrayIncludesWith() {
if (hasRequired_arrayIncludesWith)
return _arrayIncludesWith;
hasRequired_arrayIncludesWith = 1;
function arrayIncludesWith2(array2, value2, comparator2) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length;
while (++index2 < length2) {
if (comparator2(value2, array2[index2])) {
return true;
}
}
return false;
}
_arrayIncludesWith = arrayIncludesWith2;
return _arrayIncludesWith;
}
var noop_1;
var hasRequiredNoop;
function requireNoop() {
if (hasRequiredNoop)
return noop_1;
hasRequiredNoop = 1;
function noop3() {
}
noop_1 = noop3;
return noop_1;
}
var _createSet;
var hasRequired_createSet;
function require_createSet() {
if (hasRequired_createSet)
return _createSet;
hasRequired_createSet = 1;
var Set2 = require_Set(), noop3 = requireNoop(), setToArray = require_setToArray();
var INFINITY2 = 1 / 0;
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY2) ? noop3 : function(values2) {
return new Set2(values2);
};
_createSet = createSet;
return _createSet;
}
var _baseUniq;
var hasRequired_baseUniq;
function require_baseUniq() {
if (hasRequired_baseUniq)
return _baseUniq;
hasRequired_baseUniq = 1;
var SetCache2 = require_SetCache(), arrayIncludes2 = require_arrayIncludes(), arrayIncludesWith2 = require_arrayIncludesWith(), cacheHas2 = require_cacheHas(), createSet = require_createSet(), setToArray = require_setToArray();
var LARGE_ARRAY_SIZE2 = 200;
function baseUniq(array2, iteratee, comparator2) {
var index2 = -1, includes2 = arrayIncludes2, length2 = array2.length, isCommon = true, result = [], seen2 = result;
if (comparator2) {
isCommon = false;
includes2 = arrayIncludesWith2;
} else if (length2 >= LARGE_ARRAY_SIZE2) {
var set2 = iteratee ? null : createSet(array2);
if (set2) {
return setToArray(set2);
}
isCommon = false;
includes2 = cacheHas2;
seen2 = new SetCache2();
} else {
seen2 = iteratee ? [] : result;
}
outer:
while (++index2 < length2) {
var value2 = array2[index2], computed = iteratee ? iteratee(value2) : value2;
value2 = comparator2 || value2 !== 0 ? value2 : 0;
if (isCommon && computed === computed) {
var seenIndex = seen2.length;
while (seenIndex--) {
if (seen2[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen2.push(computed);
}
result.push(value2);
} else if (!includes2(seen2, computed, comparator2)) {
if (seen2 !== result) {
seen2.push(computed);
}
result.push(value2);
}
}
return result;
}
_baseUniq = baseUniq;
return _baseUniq;
}
var union_1;
var hasRequiredUnion;
function requireUnion() {
if (hasRequiredUnion)
return union_1;
hasRequiredUnion = 1;
var baseFlatten2 = require_baseFlatten(), baseRest2 = require_baseRest(), baseUniq = require_baseUniq(), isArrayLikeObject2 = requireIsArrayLikeObject();
var union2 = baseRest2(function(arrays) {
return baseUniq(baseFlatten2(arrays, 1, isArrayLikeObject2, true));
});
union_1 = union2;
return union_1;
}
var extendStatics$2 = function(d2, b2) {
extendStatics$2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
d3.__proto__ = b3;
} || function(d3, b3) {
for (var p2 in b3)
if (Object.prototype.hasOwnProperty.call(b3, p2))
d3[p2] = b3[p2];
};
return extendStatics$2(d2, b2);
};
function __extends$2(d2, b2) {
if (typeof b2 !== "function" && b2 !== null)
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
extendStatics$2(d2, b2);
function __() {
this.constructor = d2;
}
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
}
var __assign$1 = function() {
__assign$1 = Object.assign || function __assign2(t5) {
for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
s2 = arguments[i2];
for (var p2 in s2)
if (Object.prototype.hasOwnProperty.call(s2, p2))
t5[p2] = s2[p2];
}
return t5;
};
return __assign$1.apply(this, arguments);
};
function __rest$1(s2, e7) {
var t5 = {};
for (var p2 in s2)
if (Object.prototype.hasOwnProperty.call(s2, p2) && e7.indexOf(p2) < 0)
t5[p2] = s2[p2];
if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) {
if (e7.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]))
t5[p2[i2]] = s2[p2[i2]];
}
return t5;
}
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function isObject$3$1(value2) {
var type2 = typeof value2;
return value2 != null && (type2 == "object" || type2 == "function");
}
var isObject_1 = isObject$3$1;
var freeGlobal$1$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
var _freeGlobal = freeGlobal$1$1;
var freeGlobal$2 = _freeGlobal;
var freeSelf$2 = typeof self == "object" && self && self.Object === Object && self;
var root$2$1 = freeGlobal$2 || freeSelf$2 || Function("return this")();
var _root = root$2$1;
var root$1$1 = _root;
var now$1$1 = function() {
return root$1$1.Date.now();
};
var now_1$1 = now$1$1;
var reWhitespace = /\s/;
function trimmedEndIndex$1(string2) {
var index2 = string2.length;
while (index2-- && reWhitespace.test(string2.charAt(index2))) {
}
return index2;
}
var _trimmedEndIndex = trimmedEndIndex$1;
var trimmedEndIndex = _trimmedEndIndex;
var reTrimStart = /^\s+/;
function baseTrim$1(string2) {
return string2 ? string2.slice(0, trimmedEndIndex(string2) + 1).replace(reTrimStart, "") : string2;
}
var _baseTrim = baseTrim$1;
var root$3 = _root;
var Symbol$2$1 = root$3.Symbol;
var _Symbol = Symbol$2$1;
var Symbol$1$1 = _Symbol;
var objectProto$1$1 = Object.prototype;
var hasOwnProperty$5 = objectProto$1$1.hasOwnProperty;
var nativeObjectToString$1 = objectProto$1$1.toString;
var symToStringTag$1 = Symbol$1$1 ? Symbol$1$1.toStringTag : void 0;
function getRawTag$1(value2) {
var isOwn = hasOwnProperty$5.call(value2, symToStringTag$1), tag = value2[symToStringTag$1];
try {
value2[symToStringTag$1] = void 0;
var unmasked = true;
} catch (e7) {
}
var result = nativeObjectToString$1.call(value2);
if (unmasked) {
if (isOwn) {
value2[symToStringTag$1] = tag;
} else {
delete value2[symToStringTag$1];
}
}
return result;
}
var _getRawTag = getRawTag$1;
var objectProto$3 = Object.prototype;
var nativeObjectToString = objectProto$3.toString;
function objectToString$1$1(value2) {
return nativeObjectToString.call(value2);
}
var _objectToString = objectToString$1$1;
var Symbol$5 = _Symbol, getRawTag = _getRawTag, objectToString$2 = _objectToString;
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
var symToStringTag = Symbol$5 ? Symbol$5.toStringTag : void 0;
function baseGetTag$1(value2) {
if (value2 == null) {
return value2 === void 0 ? undefinedTag : nullTag;
}
return symToStringTag && symToStringTag in Object(value2) ? getRawTag(value2) : objectToString$2(value2);
}
var _baseGetTag = baseGetTag$1;
function isObjectLike$1$1(value2) {
return value2 != null && typeof value2 == "object";
}
var isObjectLike_1 = isObjectLike$1$1;
var baseGetTag = _baseGetTag, isObjectLike$2 = isObjectLike_1;
var symbolTag$2 = "[object Symbol]";
function isSymbol$1$1(value2) {
return typeof value2 == "symbol" || isObjectLike$2(value2) && baseGetTag(value2) == symbolTag$2;
}
var isSymbol_1 = isSymbol$1$1;
var baseTrim = _baseTrim, isObject$2$1 = isObject_1, isSymbol$5 = isSymbol_1;
var NAN = 0 / 0;
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary = /^0b[01]+$/i;
var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
function toNumber$1(value2) {
if (typeof value2 == "number") {
return value2;
}
if (isSymbol$5(value2)) {
return NAN;
}
if (isObject$2$1(value2)) {
var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2;
value2 = isObject$2$1(other) ? other + "" : other;
}
if (typeof value2 != "string") {
return value2 === 0 ? value2 : +value2;
}
value2 = baseTrim(value2);
var isBinary2 = reIsBinary.test(value2);
return isBinary2 || reIsOctal.test(value2) ? freeParseInt(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value2) ? NAN : +value2;
}
var toNumber_1 = toNumber$1;
var isObject$1$1 = isObject_1, now$3 = now_1$1, toNumber$2 = toNumber_1;
var FUNC_ERROR_TEXT$1 = "Expected a function";
var nativeMax$2 = Math.max, nativeMin = Math.min;
function debounce$1$1(func, wait, options2) {
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT$1);
}
wait = toNumber$2(wait) || 0;
if (isObject$1$1(options2)) {
leading = !!options2.leading;
maxing = "maxWait" in options2;
maxWait = maxing ? nativeMax$2(toNumber$2(options2.maxWait) || 0, wait) : maxWait;
trailing = "trailing" in options2 ? !!options2.trailing : trailing;
}
function invokeFunc(time2) {
var args = lastArgs, thisArg = lastThis;
lastArgs = lastThis = void 0;
lastInvokeTime = time2;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time2) {
lastInvokeTime = time2;
timerId = setTimeout(timerExpired, wait);
return leading ? invokeFunc(time2) : result;
}
function remainingWait(time2) {
var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
}
function shouldInvoke(time2) {
var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
var time2 = now$3();
if (shouldInvoke(time2)) {
return trailingEdge(time2);
}
timerId = setTimeout(timerExpired, remainingWait(time2));
}
function trailingEdge(time2) {
timerId = void 0;
if (trailing && lastArgs) {
return invokeFunc(time2);
}
lastArgs = lastThis = void 0;
return result;
}
function cancel() {
if (timerId !== void 0) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = void 0;
}
function flush() {
return timerId === void 0 ? result : trailingEdge(now$3());
}
function debounced() {
var time2 = now$3(), isInvoking = shouldInvoke(time2);
lastArgs = arguments;
lastThis = this;
lastCallTime = time2;
if (isInvoking) {
if (timerId === void 0) {
return leadingEdge(lastCallTime);
}
if (maxing) {
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === void 0) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
var debounce_1$1 = debounce$1$1;
var debounce$3 = debounce_1$1, isObject$f = isObject_1;
var FUNC_ERROR_TEXT = "Expected a function";
function throttle(func, wait, options2) {
var leading = true, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject$f(options2)) {
leading = "leading" in options2 ? !!options2.leading : leading;
trailing = "trailing" in options2 ? !!options2.trailing : trailing;
}
return debounce$3(func, wait, {
"leading": leading,
"maxWait": wait,
"trailing": trailing
});
}
var throttle_1$1 = throttle;
var patchResizeHandler = function(resizeCallback, refreshMode, refreshRate, refreshOptions) {
switch (refreshMode) {
case "debounce":
return debounce_1$1(resizeCallback, refreshRate, refreshOptions);
case "throttle":
return throttle_1$1(resizeCallback, refreshRate, refreshOptions);
default:
return resizeCallback;
}
};
var isFunction$4 = function(fn8) {
return typeof fn8 === "function";
};
var isSSR = function() {
return typeof window === "undefined";
};
var isDOMElement = function(element2) {
return element2 instanceof Element || element2 instanceof HTMLDocument;
};
var createNotifier = function(onResize, setSize, handleWidth, handleHeight) {
return function(_a2) {
var width2 = _a2.width, height2 = _a2.height;
setSize(function(prev2) {
if (prev2.width === width2 && prev2.height === height2) {
return prev2;
}
if (prev2.width === width2 && !handleHeight || prev2.height === height2 && !handleWidth) {
return prev2;
}
if (onResize && isFunction$4(onResize)) {
onResize(width2, height2);
}
return { width: width2, height: height2 };
});
};
};
var ResizeDetector = (
/** @class */
function(_super) {
__extends$2(ResizeDetector2, _super);
function ResizeDetector2(props) {
var _this = _super.call(this, props) || this;
_this.cancelHandler = function() {
if (_this.resizeHandler && _this.resizeHandler.cancel) {
_this.resizeHandler.cancel();
_this.resizeHandler = null;
}
};
_this.attachObserver = function() {
var _a3 = _this.props, targetRef = _a3.targetRef, observerOptions = _a3.observerOptions;
if (isSSR()) {
return;
}
if (targetRef && targetRef.current) {
_this.targetRef.current = targetRef.current;
}
var element2 = _this.getElement();
if (!element2) {
return;
}
if (_this.observableElement && _this.observableElement === element2) {
return;
}
_this.observableElement = element2;
_this.resizeObserver.observe(element2, observerOptions);
};
_this.getElement = function() {
var _a3 = _this.props, querySelector = _a3.querySelector, targetDomEl = _a3.targetDomEl;
if (isSSR())
return null;
if (querySelector)
return document.querySelector(querySelector);
if (targetDomEl && isDOMElement(targetDomEl))
return targetDomEl;
if (_this.targetRef && isDOMElement(_this.targetRef.current))
return _this.targetRef.current;
var currentElement = reactDomExports.findDOMNode(_this);
if (!currentElement)
return null;
var renderType = _this.getRenderType();
switch (renderType) {
case "renderProp":
return currentElement;
case "childFunction":
return currentElement;
case "child":
return currentElement;
case "childArray":
return currentElement;
default:
return currentElement.parentElement;
}
};
_this.createResizeHandler = function(entries) {
var _a3 = _this.props, _b2 = _a3.handleWidth, handleWidth = _b2 === void 0 ? true : _b2, _c2 = _a3.handleHeight, handleHeight = _c2 === void 0 ? true : _c2, onResize = _a3.onResize;
if (!handleWidth && !handleHeight)
return;
var notifyResize = createNotifier(onResize, _this.setState.bind(_this), handleWidth, handleHeight);
entries.forEach(function(entry2) {
var _a4 = entry2 && entry2.contentRect || {}, width2 = _a4.width, height2 = _a4.height;
var shouldSetSize = !_this.skipOnMount && !isSSR();
if (shouldSetSize) {
notifyResize({ width: width2, height: height2 });
}
_this.skipOnMount = false;
});
};
_this.getRenderType = function() {
var _a3 = _this.props, render3 = _a3.render, children2 = _a3.children;
if (isFunction$4(render3)) {
return "renderProp";
}
if (isFunction$4(children2)) {
return "childFunction";
}
if (reactExports.isValidElement(children2)) {
return "child";
}
if (Array.isArray(children2)) {
return "childArray";
}
return "parent";
};
var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a2 = props.refreshRate, refreshRate = _a2 === void 0 ? 1e3 : _a2, refreshOptions = props.refreshOptions;
_this.state = {
width: void 0,
height: void 0
};
_this.skipOnMount = skipOnMount;
_this.targetRef = reactExports.createRef();
_this.observableElement = null;
if (isSSR()) {
return _this;
}
_this.resizeHandler = patchResizeHandler(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);
_this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);
return _this;
}
ResizeDetector2.prototype.componentDidMount = function() {
this.attachObserver();
};
ResizeDetector2.prototype.componentDidUpdate = function() {
this.attachObserver();
};
ResizeDetector2.prototype.componentWillUnmount = function() {
if (isSSR()) {
return;
}
this.observableElement = null;
this.resizeObserver.disconnect();
this.cancelHandler();
};
ResizeDetector2.prototype.render = function() {
var _a2 = this.props, render3 = _a2.render, children2 = _a2.children, _b2 = _a2.nodeType, WrapperTag = _b2 === void 0 ? "div" : _b2;
var _c2 = this.state, width2 = _c2.width, height2 = _c2.height;
var childProps = { width: width2, height: height2, targetRef: this.targetRef };
var renderType = this.getRenderType();
var typedChildren;
switch (renderType) {
case "renderProp":
return render3 && render3(childProps);
case "childFunction":
typedChildren = children2;
return typedChildren(childProps);
case "child":
typedChildren = children2;
if (typedChildren.type && typeof typedChildren.type === "string") {
childProps.targetRef;
var nativeProps = __rest$1(childProps, ["targetRef"]);
return reactExports.cloneElement(typedChildren, nativeProps);
}
return reactExports.cloneElement(typedChildren, childProps);
case "childArray":
typedChildren = children2;
return typedChildren.map(function(el) {
return !!el && reactExports.cloneElement(el, childProps);
});
default:
return reactExports.createElement(WrapperTag, null);
}
};
return ResizeDetector2;
}(reactExports.PureComponent)
);
function withResizeDetector(ComponentInner, options2) {
if (options2 === void 0) {
options2 = {};
}
var ResizeDetectorHOC = (
/** @class */
function(_super) {
__extends$2(ResizeDetectorHOC2, _super);
function ResizeDetectorHOC2() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.ref = reactExports.createRef();
return _this;
}
ResizeDetectorHOC2.prototype.render = function() {
var _a2 = this.props, forwardedRef = _a2.forwardedRef, rest = __rest$1(_a2, ["forwardedRef"]);
var targetRef = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : this.ref;
return reactExports.createElement(
ResizeDetector,
__assign$1({}, options2, { targetRef }),
reactExports.createElement(ComponentInner, __assign$1({ targetRef }, rest))
);
};
return ResizeDetectorHOC2;
}(reactExports.Component)
);
function forwardRefWrapper(props, ref2) {
return reactExports.createElement(ResizeDetectorHOC, __assign$1({}, props, { forwardedRef: ref2 }));
}
var name = ComponentInner.displayName || ComponentInner.name;
forwardRefWrapper.displayName = "withResizeDetector(".concat(name, ")");
return reactExports.forwardRef(forwardRefWrapper);
}
var useEnhancedEffect = isSSR() ? reactExports.useEffect : reactExports.useLayoutEffect;
function useResizeDetector(props) {
if (props === void 0) {
props = {};
}
var _a2 = props.skipOnMount, skipOnMount = _a2 === void 0 ? false : _a2, refreshMode = props.refreshMode, _b2 = props.refreshRate, refreshRate = _b2 === void 0 ? 1e3 : _b2, refreshOptions = props.refreshOptions, _c2 = props.handleWidth, handleWidth = _c2 === void 0 ? true : _c2, _d = props.handleHeight, handleHeight = _d === void 0 ? true : _d, targetRef = props.targetRef, observerOptions = props.observerOptions, onResize = props.onResize;
var skipResize = reactExports.useRef(skipOnMount);
var localRef = reactExports.useRef(null);
var ref2 = targetRef !== null && targetRef !== void 0 ? targetRef : localRef;
var resizeHandler = reactExports.useRef();
var _e2 = reactExports.useState({
width: void 0,
height: void 0
}), size = _e2[0], setSize = _e2[1];
useEnhancedEffect(function() {
if (isSSR()) {
return;
}
var notifyResize = createNotifier(onResize, setSize, handleWidth, handleHeight);
var resizeCallback = function(entries) {
if (!handleWidth && !handleHeight)
return;
entries.forEach(function(entry2) {
var _a3 = entry2 && entry2.contentRect || {}, width2 = _a3.width, height2 = _a3.height;
var shouldSetSize = !skipResize.current && !isSSR();
if (shouldSetSize) {
notifyResize({ width: width2, height: height2 });
}
skipResize.current = false;
});
};
resizeHandler.current = patchResizeHandler(resizeCallback, refreshMode, refreshRate, refreshOptions);
var resizeObserver = new window.ResizeObserver(resizeHandler.current);
if (ref2.current) {
resizeObserver.observe(ref2.current, observerOptions);
}
return function() {
resizeObserver.disconnect();
var patchedResizeHandler = resizeHandler.current;
if (patchedResizeHandler && patchedResizeHandler.cancel) {
patchedResizeHandler.cancel();
}
};
}, [refreshMode, refreshRate, refreshOptions, handleWidth, handleHeight, onResize, observerOptions, ref2.current]);
return __assign$1({ ref: ref2 }, size);
}
const index_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: ResizeDetector,
useResizeDetector,
withResizeDetector
}, Symbol.toStringTag, { value: "Module" }));
const require$$9 = /* @__PURE__ */ getAugmentedNamespace(index_esm);
var cssMediaquery = {};
cssMediaquery.match = matchQuery;
cssMediaquery.parse = parseQuery;
var RE_MEDIA_QUERY = /(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i, RE_MQ_EXPRESSION = /\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/, RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/, RE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?$/, RE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?$/;
function matchQuery(mediaQuery, values2) {
return parseQuery(mediaQuery).some(function(query) {
var inverse = query.inverse;
var typeMatch = query.type === "all" || values2.type === query.type;
if (typeMatch && inverse || !(typeMatch || inverse)) {
return false;
}
var expressionsMatch = query.expressions.every(function(expression2) {
var feature2 = expression2.feature, modifier = expression2.modifier, expValue = expression2.value, value2 = values2[feature2];
if (!value2) {
return false;
}
switch (feature2) {
case "orientation":
case "scan":
return value2.toLowerCase() === expValue.toLowerCase();
case "width":
case "height":
case "device-width":
case "device-height":
expValue = toPx(expValue);
value2 = toPx(value2);
break;
case "resolution":
expValue = toDpi(expValue);
value2 = toDpi(value2);
break;
case "aspect-ratio":
case "device-aspect-ratio":
case /* Deprecated */
"device-pixel-ratio":
expValue = toDecimal(expValue);
value2 = toDecimal(value2);
break;
case "grid":
case "color":
case "color-index":
case "monochrome":
expValue = parseInt(expValue, 10) || 1;
value2 = parseInt(value2, 10) || 0;
break;
}
switch (modifier) {
case "min":
return value2 >= expValue;
case "max":
return value2 <= expValue;
default:
return value2 === expValue;
}
});
return expressionsMatch && !inverse || !expressionsMatch && inverse;
});
}
function parseQuery(mediaQuery) {
return mediaQuery.split(",").map(function(query) {
query = query.trim();
var captures = query.match(RE_MEDIA_QUERY), modifier = captures[1], type2 = captures[2], expressions = captures[3] || "", parsed = {};
parsed.inverse = !!modifier && modifier.toLowerCase() === "not";
parsed.type = type2 ? type2.toLowerCase() : "all";
expressions = expressions.match(/\([^\)]+\)/g) || [];
parsed.expressions = expressions.map(function(expression2) {
var captures2 = expression2.match(RE_MQ_EXPRESSION), feature2 = captures2[1].toLowerCase().match(RE_MQ_FEATURE);
return {
modifier: feature2[1],
feature: feature2[2],
value: captures2[2]
};
});
return parsed;
});
}
function toDecimal(ratio) {
var decimal = Number(ratio), numbers2;
if (!decimal) {
numbers2 = ratio.match(/^(\d+)\s*\/\s*(\d+)$/);
decimal = numbers2[1] / numbers2[2];
}
return decimal;
}
function toDpi(resolution) {
var value2 = parseFloat(resolution), units = String(resolution).match(RE_RESOLUTION_UNIT)[1];
switch (units) {
case "dpcm":
return value2 / 2.54;
case "dppx":
return value2 * 96;
default:
return value2;
}
}
function toPx(length2) {
var value2 = parseFloat(length2), units = String(length2).match(RE_LENGTH_UNIT)[1];
switch (units) {
case "em":
return value2 * 16;
case "rem":
return value2 * 16;
case "cm":
return value2 * 96 / 2.54;
case "mm":
return value2 * 96 / 2.54 / 10;
case "in":
return value2 * 96;
case "pt":
return value2 * 72;
case "pc":
return value2 * 72 / 12;
default:
return value2;
}
}
var staticMatch = cssMediaquery.match;
var dynamicMatch = typeof window !== "undefined" ? window.matchMedia : null;
function Mql(query, values2, forceStatic) {
var self2 = this;
if (dynamicMatch && !forceStatic) {
var mql = dynamicMatch.call(window, query);
this.matches = mql.matches;
this.media = mql.media;
mql.addListener(update2);
} else {
this.matches = staticMatch(query, values2);
this.media = query;
}
this.addListener = addListener;
this.removeListener = removeListener;
this.dispose = dispose;
function addListener(listener2) {
if (mql) {
mql.addListener(listener2);
}
}
function removeListener(listener2) {
if (mql) {
mql.removeListener(listener2);
}
}
function update2(evt) {
self2.matches = evt.matches;
self2.media = evt.media;
}
function dispose() {
if (mql) {
mql.removeListener(update2);
}
}
}
function matchMedia$1(query, values2, forceStatic) {
return new Mql(query, values2, forceStatic);
}
var matchmediaquery = matchMedia$1;
const matchMedia$2 = /* @__PURE__ */ getDefaultExportFromCjs(matchmediaquery);
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
var cache$2 = {};
function toHyphenLower(match2) {
return "-" + match2.toLowerCase();
}
function hyphenateStyleName(name) {
if (cache$2.hasOwnProperty(name)) {
return cache$2[name];
}
var hName = name.replace(uppercasePattern, toHyphenLower);
return cache$2[name] = msPattern.test(hName) ? "-" + hName : hName;
}
function shallowEqualObjects(objA, objB) {
if (objA === objB) {
return true;
}
if (!objA || !objB) {
return false;
}
var aKeys = Object.keys(objA);
var bKeys = Object.keys(objB);
var len = aKeys.length;
if (bKeys.length !== len) {
return false;
}
for (var i2 = 0; i2 < len; i2++) {
var key2 = aKeys[i2];
if (objA[key2] !== objB[key2] || !Object.prototype.hasOwnProperty.call(objB, key2)) {
return false;
}
}
return true;
}
const stringOrNumber = u$9.oneOfType([u$9.string, u$9.number]);
const types = {
all: u$9.bool,
grid: u$9.bool,
aural: u$9.bool,
braille: u$9.bool,
handheld: u$9.bool,
print: u$9.bool,
projection: u$9.bool,
screen: u$9.bool,
tty: u$9.bool,
tv: u$9.bool,
embossed: u$9.bool
};
const matchers = {
orientation: u$9.oneOf(["portrait", "landscape"]),
scan: u$9.oneOf(["progressive", "interlace"]),
aspectRatio: u$9.string,
deviceAspectRatio: u$9.string,
height: stringOrNumber,
deviceHeight: stringOrNumber,
width: stringOrNumber,
deviceWidth: stringOrNumber,
color: u$9.bool,
colorIndex: u$9.bool,
monochrome: u$9.bool,
resolution: stringOrNumber,
type: Object.keys(types)
};
const { type: type$1, ...featureMatchers } = matchers;
const features = {
minAspectRatio: u$9.string,
maxAspectRatio: u$9.string,
minDeviceAspectRatio: u$9.string,
maxDeviceAspectRatio: u$9.string,
minHeight: stringOrNumber,
maxHeight: stringOrNumber,
minDeviceHeight: stringOrNumber,
maxDeviceHeight: stringOrNumber,
minWidth: stringOrNumber,
maxWidth: stringOrNumber,
minDeviceWidth: stringOrNumber,
maxDeviceWidth: stringOrNumber,
minColor: u$9.number,
maxColor: u$9.number,
minColorIndex: u$9.number,
maxColorIndex: u$9.number,
minMonochrome: u$9.number,
maxMonochrome: u$9.number,
minResolution: stringOrNumber,
maxResolution: stringOrNumber,
...featureMatchers
};
const all = { ...types, ...features };
var mq = {
all,
types,
matchers,
features
};
const negate = (cond) => `not ${cond}`;
const keyVal = (k2, v2) => {
const realKey = hyphenateStyleName(k2);
if (typeof v2 === "number") {
v2 = `${v2}px`;
}
if (v2 === true) {
return realKey;
}
if (v2 === false) {
return negate(realKey);
}
return `(${realKey}: ${v2})`;
};
const join$3 = (conds) => conds.join(" and ");
const toQuery = (obj) => {
const rules = [];
Object.keys(mq.all).forEach((k2) => {
const v2 = obj[k2];
if (v2 != null) {
rules.push(keyVal(k2, v2));
}
});
return join$3(rules);
};
const Context$3 = reactExports.createContext(void 0);
const makeQuery = (settings) => settings.query || toQuery(settings);
const hyphenateKeys = (obj) => {
if (!obj)
return void 0;
const keys3 = Object.keys(obj);
return keys3.reduce((result, key2) => {
result[hyphenateStyleName(key2)] = obj[key2];
return result;
}, {});
};
const useIsUpdate = () => {
const ref2 = reactExports.useRef(false);
reactExports.useEffect(() => {
ref2.current = true;
}, []);
return ref2.current;
};
const useDevice = (deviceFromProps) => {
const deviceFromContext = reactExports.useContext(Context$3);
const getDevice = () => hyphenateKeys(deviceFromProps) || hyphenateKeys(deviceFromContext);
const [device, setDevice] = reactExports.useState(getDevice);
reactExports.useEffect(() => {
const newDevice = getDevice();
if (!shallowEqualObjects(device, newDevice)) {
setDevice(newDevice);
}
}, [deviceFromProps, deviceFromContext]);
return device;
};
const useQuery = (settings) => {
const getQuery = () => makeQuery(settings);
const [query, setQuery] = reactExports.useState(getQuery);
reactExports.useEffect(() => {
const newQuery = getQuery();
if (query !== newQuery) {
setQuery(newQuery);
}
}, [settings]);
return query;
};
const useMatchMedia = (query, device) => {
const getMatchMedia = () => matchMedia$2(query, device || {}, !!device);
const [mq2, setMq] = reactExports.useState(getMatchMedia);
const isUpdate = useIsUpdate();
reactExports.useEffect(() => {
if (isUpdate) {
const newMq = getMatchMedia();
setMq(newMq);
return () => {
if (newMq) {
newMq.dispose();
}
};
}
}, [query, device]);
return mq2;
};
const useMatches = (mediaQuery) => {
const [matches, setMatches] = reactExports.useState(mediaQuery.matches);
reactExports.useEffect(() => {
const updateMatches = (ev) => {
setMatches(ev.matches);
};
mediaQuery.addListener(updateMatches);
setMatches(mediaQuery.matches);
return () => {
mediaQuery.removeListener(updateMatches);
};
}, [mediaQuery]);
return matches;
};
const useMediaQuery = (settings, device, onChange2) => {
const deviceSettings = useDevice(device);
const query = useQuery(settings);
if (!query)
throw new Error("Invalid or missing MediaQuery!");
const mq2 = useMatchMedia(query, deviceSettings);
const matches = useMatches(mq2);
const isUpdate = useIsUpdate();
reactExports.useEffect(() => {
if (isUpdate && onChange2) {
onChange2(matches);
}
}, [matches]);
reactExports.useEffect(() => () => {
if (mq2) {
mq2.dispose();
}
}, []);
return matches;
};
const MediaQuery = ({ children: children2, device, onChange: onChange2, ...settings }) => {
const matches = useMediaQuery(settings, device, onChange2);
if (typeof children2 === "function") {
return children2(matches);
}
return matches ? children2 : null;
};
const esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
Context: Context$3,
default: MediaQuery,
toQuery,
useMediaQuery
}, Symbol.toStringTag, { value: "Module" }));
const require$$2$2 = /* @__PURE__ */ getAugmentedNamespace(esm);
var CONTENT_CLASS$1 = "tippy-content";
var BACKDROP_CLASS$1 = "tippy-backdrop";
var ARROW_CLASS$1 = "tippy-arrow";
var SVG_ARROW_CLASS$1 = "tippy-svg-arrow";
var TOUCH_OPTIONS$1 = {
passive: true,
capture: true
};
var TIPPY_DEFAULT_APPEND_TO$1 = function TIPPY_DEFAULT_APPEND_TO() {
return document.body;
};
function getValueAtIndexOrReturn$1(value2, index2, defaultValue2) {
if (Array.isArray(value2)) {
var v2 = value2[index2];
return v2 == null ? Array.isArray(defaultValue2) ? defaultValue2[index2] : defaultValue2 : v2;
}
return value2;
}
function isType$1(value2, type2) {
var str = {}.toString.call(value2);
return str.indexOf("[object") === 0 && str.indexOf(type2 + "]") > -1;
}
function invokeWithArgsOrReturn$1(value2, args) {
return typeof value2 === "function" ? value2.apply(void 0, args) : value2;
}
function debounce$2(fn8, ms) {
if (ms === 0) {
return fn8;
}
var timeout2;
return function(arg) {
clearTimeout(timeout2);
timeout2 = setTimeout(function() {
fn8(arg);
}, ms);
};
}
function removeProperties$1(obj, keys3) {
var clone2 = Object.assign({}, obj);
keys3.forEach(function(key2) {
delete clone2[key2];
});
return clone2;
}
function splitBySpaces$1(value2) {
return value2.split(/\s+/).filter(Boolean);
}
function normalizeToArray$1(value2) {
return [].concat(value2);
}
function pushIfUnique$1(arr2, value2) {
if (arr2.indexOf(value2) === -1) {
arr2.push(value2);
}
}
function unique$1(arr2) {
return arr2.filter(function(item, index2) {
return arr2.indexOf(item) === index2;
});
}
function getBasePlacement$1(placement) {
return placement.split("-")[0];
}
function arrayFrom$1(value2) {
return [].slice.call(value2);
}
function removeUndefinedProps$1(obj) {
return Object.keys(obj).reduce(function(acc, key2) {
if (obj[key2] !== void 0) {
acc[key2] = obj[key2];
}
return acc;
}, {});
}
function div$1() {
return document.createElement("div");
}
function isElement$1(value2) {
return ["Element", "Fragment"].some(function(type2) {
return isType$1(value2, type2);
});
}
function isNodeList$1(value2) {
return isType$1(value2, "NodeList");
}
function isMouseEvent$1(value2) {
return isType$1(value2, "MouseEvent");
}
function isReferenceElement$1(value2) {
return !!(value2 && value2._tippy && value2._tippy.reference === value2);
}
function getArrayOfElements$1(value2) {
if (isElement$1(value2)) {
return [value2];
}
if (isNodeList$1(value2)) {
return arrayFrom$1(value2);
}
if (Array.isArray(value2)) {
return value2;
}
return arrayFrom$1(document.querySelectorAll(value2));
}
function setTransitionDuration$2(els, value2) {
els.forEach(function(el) {
if (el) {
el.style.transitionDuration = value2 + "ms";
}
});
}
function setVisibilityState$1(els, state) {
els.forEach(function(el) {
if (el) {
el.setAttribute("data-state", state);
}
});
}
function getOwnerDocument$2(elementOrElements) {
var _element$ownerDocumen;
var _normalizeToArray = normalizeToArray$1(elementOrElements), element2 = _normalizeToArray[0];
return element2 != null && (_element$ownerDocumen = element2.ownerDocument) != null && _element$ownerDocumen.body ? element2.ownerDocument : document;
}
function isCursorOutsideInteractiveBorder$1(popperTreeData, event2) {
var clientX = event2.clientX, clientY = event2.clientY;
return popperTreeData.every(function(_ref3) {
var popperRect = _ref3.popperRect, popperState = _ref3.popperState, props = _ref3.props;
var interactiveBorder = props.interactiveBorder;
var basePlacement = getBasePlacement$1(popperState.placement);
var offsetData = popperState.modifiersData.offset;
if (!offsetData) {
return true;
}
var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0;
var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0;
var leftDistance = basePlacement === "right" ? offsetData.left.x : 0;
var rightDistance = basePlacement === "left" ? offsetData.right.x : 0;
var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
});
}
function updateTransitionEndListener$1(box, action, listener2) {
var method = action + "EventListener";
["transitionend", "webkitTransitionEnd"].forEach(function(event2) {
box[method](event2, listener2);
});
}
function actualContains$1(parent, child) {
var target2 = child;
while (target2) {
var _target$getRootNode;
if (parent.contains(target2)) {
return true;
}
target2 = target2.getRootNode == null ? void 0 : (_target$getRootNode = target2.getRootNode()) == null ? void 0 : _target$getRootNode.host;
}
return false;
}
var currentInput$1 = {
isTouch: false
};
var lastMouseMoveTime$1 = 0;
function onDocumentTouchStart$1() {
if (currentInput$1.isTouch) {
return;
}
currentInput$1.isTouch = true;
if (window.performance) {
document.addEventListener("mousemove", onDocumentMouseMove$1);
}
}
function onDocumentMouseMove$1() {
var now2 = performance.now();
if (now2 - lastMouseMoveTime$1 < 20) {
currentInput$1.isTouch = false;
document.removeEventListener("mousemove", onDocumentMouseMove$1);
}
lastMouseMoveTime$1 = now2;
}
function onWindowBlur$1() {
var activeElement = document.activeElement;
if (isReferenceElement$1(activeElement)) {
var instance2 = activeElement._tippy;
if (activeElement.blur && !instance2.state.isVisible) {
activeElement.blur();
}
}
}
function bindGlobalEventListeners$1() {
document.addEventListener("touchstart", onDocumentTouchStart$1, TOUCH_OPTIONS$1);
window.addEventListener("blur", onWindowBlur$1);
}
var isBrowser$2 = typeof window !== "undefined" && typeof document !== "undefined";
var isIE11$1 = isBrowser$2 ? (
// @ts-ignore
!!window.msCrypto
) : false;
var pluginProps$1 = {
animateFill: false,
followCursor: false,
inlinePositioning: false,
sticky: false
};
var renderProps$1 = {
allowHTML: false,
animation: "fade",
arrow: true,
content: "",
inertia: false,
maxWidth: 350,
role: "tooltip",
theme: "",
zIndex: 9999
};
var defaultProps$3 = Object.assign({
appendTo: TIPPY_DEFAULT_APPEND_TO$1,
aria: {
content: "auto",
expanded: "auto"
},
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: true,
ignoreAttributes: false,
interactive: false,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: "",
offset: [0, 10],
onAfterUpdate: function onAfterUpdate() {
},
onBeforeUpdate: function onBeforeUpdate() {
},
onCreate: function onCreate() {
},
onDestroy: function onDestroy() {
},
onHidden: function onHidden() {
},
onHide: function onHide() {
},
onMount: function onMount() {
},
onShow: function onShow() {
},
onShown: function onShown() {
},
onTrigger: function onTrigger() {
},
onUntrigger: function onUntrigger() {
},
onClickOutside: function onClickOutside() {
},
placement: "top",
plugins: [],
popperOptions: {},
render: null,
showOnCreate: false,
touch: true,
trigger: "mouseenter focus",
triggerTarget: null
}, pluginProps$1, renderProps$1);
var defaultKeys$1 = Object.keys(defaultProps$3);
var setDefaultProps$1 = function setDefaultProps(partialProps) {
var keys3 = Object.keys(partialProps);
keys3.forEach(function(key2) {
defaultProps$3[key2] = partialProps[key2];
});
};
function getExtendedPassedProps$1(passedProps) {
var plugins = passedProps.plugins || [];
var pluginProps2 = plugins.reduce(function(acc, plugin) {
var name = plugin.name, defaultValue2 = plugin.defaultValue;
if (name) {
var _name;
acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps$3[name]) != null ? _name : defaultValue2;
}
return acc;
}, {});
return Object.assign({}, passedProps, pluginProps2);
}
function getDataAttributeProps$1(reference2, plugins) {
var propKeys = plugins ? Object.keys(getExtendedPassedProps$1(Object.assign({}, defaultProps$3, {
plugins
}))) : defaultKeys$1;
var props = propKeys.reduce(function(acc, key2) {
var valueAsString = (reference2.getAttribute("data-tippy-" + key2) || "").trim();
if (!valueAsString) {
return acc;
}
if (key2 === "content") {
acc[key2] = valueAsString;
} else {
try {
acc[key2] = JSON.parse(valueAsString);
} catch (e7) {
acc[key2] = valueAsString;
}
}
return acc;
}, {});
return props;
}
function evaluateProps$1(reference2, props) {
var out = Object.assign({}, props, {
content: invokeWithArgsOrReturn$1(props.content, [reference2])
}, props.ignoreAttributes ? {} : getDataAttributeProps$1(reference2, props.plugins));
out.aria = Object.assign({}, defaultProps$3.aria, out.aria);
out.aria = {
expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded,
content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content
};
return out;
}
function getChildren$2(popper2) {
var box = popper2.firstElementChild;
var boxChildren = arrayFrom$1(box.children);
return {
box,
content: boxChildren.find(function(node2) {
return node2.classList.contains(CONTENT_CLASS$1);
}),
arrow: boxChildren.find(function(node2) {
return node2.classList.contains(ARROW_CLASS$1) || node2.classList.contains(SVG_ARROW_CLASS$1);
}),
backdrop: boxChildren.find(function(node2) {
return node2.classList.contains(BACKDROP_CLASS$1);
})
};
}
var idCounter$1 = 1;
var mouseMoveListeners$1 = [];
var mountedInstances$1 = [];
function createTippy$1(reference2, passedProps) {
var props = evaluateProps$1(reference2, Object.assign({}, defaultProps$3, getExtendedPassedProps$1(removeUndefinedProps$1(passedProps))));
var showTimeout;
var hideTimeout;
var scheduleHideAnimationFrame;
var isVisibleFromClick = false;
var didHideDueToDocumentMouseDown = false;
var didTouchMove = false;
var ignoreOnFirstUpdate = false;
var lastTriggerEvent;
var currentTransitionEndListener;
var onFirstUpdate;
var listeners = [];
var debouncedOnMouseMove = debounce$2(onMouseMove, props.interactiveDebounce);
var currentTarget;
var id = idCounter$1++;
var popperInstance = null;
var plugins = unique$1(props.plugins);
var state = {
// Is the instance currently enabled?
isEnabled: true,
// Is the tippy currently showing and not transitioning out?
isVisible: false,
// Has the instance been destroyed?
isDestroyed: false,
// Is the tippy currently mounted to the DOM?
isMounted: false,
// Has the tippy finished transitioning in?
isShown: false
};
var instance2 = {
// properties
id,
reference: reference2,
popper: div$1(),
popperInstance,
props,
state,
plugins,
// methods
clearDelayTimeouts,
setProps,
setContent: setContent2,
show,
hide: hide2,
hideWithInteractivity,
enable,
disable,
unmount,
destroy
};
if (!props.render) {
return instance2;
}
var _props$render = props.render(instance2), popper2 = _props$render.popper, onUpdate = _props$render.onUpdate;
popper2.setAttribute("data-tippy-root", "");
popper2.id = "tippy-" + instance2.id;
instance2.popper = popper2;
reference2._tippy = instance2;
popper2._tippy = instance2;
var pluginsHooks = plugins.map(function(plugin) {
return plugin.fn(instance2);
});
var hasAriaExpanded = reference2.hasAttribute("aria-expanded");
addListeners();
handleAriaExpandedAttribute();
handleStyles();
invokeHook("onCreate", [instance2]);
if (props.showOnCreate) {
scheduleShow();
}
popper2.addEventListener("mouseenter", function() {
if (instance2.props.interactive && instance2.state.isVisible) {
instance2.clearDelayTimeouts();
}
});
popper2.addEventListener("mouseleave", function() {
if (instance2.props.interactive && instance2.props.trigger.indexOf("mouseenter") >= 0) {
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
}
});
return instance2;
function getNormalizedTouchSettings() {
var touch2 = instance2.props.touch;
return Array.isArray(touch2) ? touch2 : [touch2, 0];
}
function getIsCustomTouchBehavior() {
return getNormalizedTouchSettings()[0] === "hold";
}
function getIsDefaultRenderFn() {
var _instance$props$rende;
return !!((_instance$props$rende = instance2.props.render) != null && _instance$props$rende.$$tippy);
}
function getCurrentTarget() {
return currentTarget || reference2;
}
function getDocument() {
var parent = getCurrentTarget().parentNode;
return parent ? getOwnerDocument$2(parent) : document;
}
function getDefaultTemplateChildren() {
return getChildren$2(popper2);
}
function getDelay(isShow) {
if (instance2.state.isMounted && !instance2.state.isVisible || currentInput$1.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") {
return 0;
}
return getValueAtIndexOrReturn$1(instance2.props.delay, isShow ? 0 : 1, defaultProps$3.delay);
}
function handleStyles(fromHide) {
if (fromHide === void 0) {
fromHide = false;
}
popper2.style.pointerEvents = instance2.props.interactive && !fromHide ? "" : "none";
popper2.style.zIndex = "" + instance2.props.zIndex;
}
function invokeHook(hook, args, shouldInvokePropsHook) {
if (shouldInvokePropsHook === void 0) {
shouldInvokePropsHook = true;
}
pluginsHooks.forEach(function(pluginHooks) {
if (pluginHooks[hook]) {
pluginHooks[hook].apply(pluginHooks, args);
}
});
if (shouldInvokePropsHook) {
var _instance$props;
(_instance$props = instance2.props)[hook].apply(_instance$props, args);
}
}
function handleAriaContentAttribute() {
var aria = instance2.props.aria;
if (!aria.content) {
return;
}
var attr2 = "aria-" + aria.content;
var id2 = popper2.id;
var nodes = normalizeToArray$1(instance2.props.triggerTarget || reference2);
nodes.forEach(function(node2) {
var currentValue = node2.getAttribute(attr2);
if (instance2.state.isVisible) {
node2.setAttribute(attr2, currentValue ? currentValue + " " + id2 : id2);
} else {
var nextValue = currentValue && currentValue.replace(id2, "").trim();
if (nextValue) {
node2.setAttribute(attr2, nextValue);
} else {
node2.removeAttribute(attr2);
}
}
});
}
function handleAriaExpandedAttribute() {
if (hasAriaExpanded || !instance2.props.aria.expanded) {
return;
}
var nodes = normalizeToArray$1(instance2.props.triggerTarget || reference2);
nodes.forEach(function(node2) {
if (instance2.props.interactive) {
node2.setAttribute("aria-expanded", instance2.state.isVisible && node2 === getCurrentTarget() ? "true" : "false");
} else {
node2.removeAttribute("aria-expanded");
}
});
}
function cleanupInteractiveMouseListeners() {
getDocument().removeEventListener("mousemove", debouncedOnMouseMove);
mouseMoveListeners$1 = mouseMoveListeners$1.filter(function(listener2) {
return listener2 !== debouncedOnMouseMove;
});
}
function onDocumentPress(event2) {
if (currentInput$1.isTouch) {
if (didTouchMove || event2.type === "mousedown") {
return;
}
}
var actualTarget = event2.composedPath && event2.composedPath()[0] || event2.target;
if (instance2.props.interactive && actualContains$1(popper2, actualTarget)) {
return;
}
if (normalizeToArray$1(instance2.props.triggerTarget || reference2).some(function(el) {
return actualContains$1(el, actualTarget);
})) {
if (currentInput$1.isTouch) {
return;
}
if (instance2.state.isVisible && instance2.props.trigger.indexOf("click") >= 0) {
return;
}
} else {
invokeHook("onClickOutside", [instance2, event2]);
}
if (instance2.props.hideOnClick === true) {
instance2.clearDelayTimeouts();
instance2.hide();
didHideDueToDocumentMouseDown = true;
setTimeout(function() {
didHideDueToDocumentMouseDown = false;
});
if (!instance2.state.isMounted) {
removeDocumentPress();
}
}
}
function onTouchMove() {
didTouchMove = true;
}
function onTouchStart() {
didTouchMove = false;
}
function addDocumentPress() {
var doc = getDocument();
doc.addEventListener("mousedown", onDocumentPress, true);
doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS$1);
doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS$1);
doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS$1);
}
function removeDocumentPress() {
var doc = getDocument();
doc.removeEventListener("mousedown", onDocumentPress, true);
doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS$1);
doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS$1);
doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS$1);
}
function onTransitionedOut(duration2, callback) {
onTransitionEnd(duration2, function() {
if (!instance2.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) {
callback();
}
});
}
function onTransitionedIn(duration2, callback) {
onTransitionEnd(duration2, callback);
}
function onTransitionEnd(duration2, callback) {
var box = getDefaultTemplateChildren().box;
function listener2(event2) {
if (event2.target === box) {
updateTransitionEndListener$1(box, "remove", listener2);
callback();
}
}
if (duration2 === 0) {
return callback();
}
updateTransitionEndListener$1(box, "remove", currentTransitionEndListener);
updateTransitionEndListener$1(box, "add", listener2);
currentTransitionEndListener = listener2;
}
function on2(eventType, handler, options2) {
if (options2 === void 0) {
options2 = false;
}
var nodes = normalizeToArray$1(instance2.props.triggerTarget || reference2);
nodes.forEach(function(node2) {
node2.addEventListener(eventType, handler, options2);
listeners.push({
node: node2,
eventType,
handler,
options: options2
});
});
}
function addListeners() {
if (getIsCustomTouchBehavior()) {
on2("touchstart", onTrigger3, {
passive: true
});
on2("touchend", onMouseLeave, {
passive: true
});
}
splitBySpaces$1(instance2.props.trigger).forEach(function(eventType) {
if (eventType === "manual") {
return;
}
on2(eventType, onTrigger3);
switch (eventType) {
case "mouseenter":
on2("mouseleave", onMouseLeave);
break;
case "focus":
on2(isIE11$1 ? "focusout" : "blur", onBlurOrFocusOut);
break;
case "focusin":
on2("focusout", onBlurOrFocusOut);
break;
}
});
}
function removeListeners() {
listeners.forEach(function(_ref3) {
var node2 = _ref3.node, eventType = _ref3.eventType, handler = _ref3.handler, options2 = _ref3.options;
node2.removeEventListener(eventType, handler, options2);
});
listeners = [];
}
function onTrigger3(event2) {
var _lastTriggerEvent;
var shouldScheduleClickHide = false;
if (!instance2.state.isEnabled || isEventListenerStopped(event2) || didHideDueToDocumentMouseDown) {
return;
}
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
lastTriggerEvent = event2;
currentTarget = event2.currentTarget;
handleAriaExpandedAttribute();
if (!instance2.state.isVisible && isMouseEvent$1(event2)) {
mouseMoveListeners$1.forEach(function(listener2) {
return listener2(event2);
});
}
if (event2.type === "click" && (instance2.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance2.props.hideOnClick !== false && instance2.state.isVisible) {
shouldScheduleClickHide = true;
} else {
scheduleShow(event2);
}
if (event2.type === "click") {
isVisibleFromClick = !shouldScheduleClickHide;
}
if (shouldScheduleClickHide && !wasFocused) {
scheduleHide(event2);
}
}
function onMouseMove(event2) {
var target2 = event2.target;
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target2) || popper2.contains(target2);
if (event2.type === "mousemove" && isCursorOverReferenceOrPopper) {
return;
}
var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
var _instance$popperInsta;
var instance3 = popper3._tippy;
var state2 = (_instance$popperInsta = instance3.popperInstance) == null ? void 0 : _instance$popperInsta.state;
if (state2) {
return {
popperRect: popper3.getBoundingClientRect(),
popperState: state2,
props
};
}
return null;
}).filter(Boolean);
if (isCursorOutsideInteractiveBorder$1(popperTreeData, event2)) {
cleanupInteractiveMouseListeners();
scheduleHide(event2);
}
}
function onMouseLeave(event2) {
var shouldBail = isEventListenerStopped(event2) || instance2.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
if (shouldBail) {
return;
}
if (instance2.props.interactive) {
instance2.hideWithInteractivity(event2);
return;
}
scheduleHide(event2);
}
function onBlurOrFocusOut(event2) {
if (instance2.props.trigger.indexOf("focusin") < 0 && event2.target !== getCurrentTarget()) {
return;
}
if (instance2.props.interactive && event2.relatedTarget && popper2.contains(event2.relatedTarget)) {
return;
}
scheduleHide(event2);
}
function isEventListenerStopped(event2) {
return currentInput$1.isTouch ? getIsCustomTouchBehavior() !== event2.type.indexOf("touch") >= 0 : false;
}
function createPopperInstance() {
destroyPopperInstance();
var _instance$props2 = instance2.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition;
var arrow2 = getIsDefaultRenderFn() ? getChildren$2(popper2).arrow : null;
var computedReference = getReferenceClientRect ? {
getBoundingClientRect: getReferenceClientRect,
contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
} : reference2;
var tippyModifier = {
name: "$$tippy",
enabled: true,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: function fn8(_ref22) {
var state2 = _ref22.state;
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box;
["placement", "reference-hidden", "escaped"].forEach(function(attr2) {
if (attr2 === "placement") {
box.setAttribute("data-placement", state2.placement);
} else {
if (state2.attributes.popper["data-popper-" + attr2]) {
box.setAttribute("data-" + attr2, "");
} else {
box.removeAttribute("data-" + attr2);
}
}
});
state2.attributes.popper = {};
}
}
};
var modifiers = [{
name: "offset",
options: {
offset: offset2
}
}, {
name: "preventOverflow",
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}
}
}, {
name: "flip",
options: {
padding: 5
}
}, {
name: "computeStyles",
options: {
adaptive: !moveTransition
}
}, tippyModifier];
if (getIsDefaultRenderFn() && arrow2) {
modifiers.push({
name: "arrow",
options: {
element: arrow2,
padding: 3
}
});
}
modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
instance2.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, {
placement,
onFirstUpdate,
modifiers
}));
}
function destroyPopperInstance() {
if (instance2.popperInstance) {
instance2.popperInstance.destroy();
instance2.popperInstance = null;
}
}
function mount() {
var appendTo = instance2.props.appendTo;
var parentNode;
var node2 = getCurrentTarget();
if (instance2.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO$1 || appendTo === "parent") {
parentNode = node2.parentNode;
} else {
parentNode = invokeWithArgsOrReturn$1(appendTo, [node2]);
}
if (!parentNode.contains(popper2)) {
parentNode.appendChild(popper2);
}
instance2.state.isMounted = true;
createPopperInstance();
}
function getNestedPopperTree() {
return arrayFrom$1(popper2.querySelectorAll("[data-tippy-root]"));
}
function scheduleShow(event2) {
instance2.clearDelayTimeouts();
if (event2) {
invokeHook("onTrigger", [instance2, event2]);
}
addDocumentPress();
var delay = getDelay(true);
var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1];
if (currentInput$1.isTouch && touchValue === "hold" && touchDelay) {
delay = touchDelay;
}
if (delay) {
showTimeout = setTimeout(function() {
instance2.show();
}, delay);
} else {
instance2.show();
}
}
function scheduleHide(event2) {
instance2.clearDelayTimeouts();
invokeHook("onUntrigger", [instance2, event2]);
if (!instance2.state.isVisible) {
removeDocumentPress();
return;
}
if (instance2.props.trigger.indexOf("mouseenter") >= 0 && instance2.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event2.type) >= 0 && isVisibleFromClick) {
return;
}
var delay = getDelay(false);
if (delay) {
hideTimeout = setTimeout(function() {
if (instance2.state.isVisible) {
instance2.hide();
}
}, delay);
} else {
scheduleHideAnimationFrame = requestAnimationFrame(function() {
instance2.hide();
});
}
}
function enable() {
instance2.state.isEnabled = true;
}
function disable() {
instance2.hide();
instance2.state.isEnabled = false;
}
function clearDelayTimeouts() {
clearTimeout(showTimeout);
clearTimeout(hideTimeout);
cancelAnimationFrame(scheduleHideAnimationFrame);
}
function setProps(partialProps) {
if (instance2.state.isDestroyed) {
return;
}
invokeHook("onBeforeUpdate", [instance2, partialProps]);
removeListeners();
var prevProps = instance2.props;
var nextProps = evaluateProps$1(reference2, Object.assign({}, prevProps, removeUndefinedProps$1(partialProps), {
ignoreAttributes: true
}));
instance2.props = nextProps;
addListeners();
if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
cleanupInteractiveMouseListeners();
debouncedOnMouseMove = debounce$2(onMouseMove, nextProps.interactiveDebounce);
}
if (prevProps.triggerTarget && !nextProps.triggerTarget) {
normalizeToArray$1(prevProps.triggerTarget).forEach(function(node2) {
node2.removeAttribute("aria-expanded");
});
} else if (nextProps.triggerTarget) {
reference2.removeAttribute("aria-expanded");
}
handleAriaExpandedAttribute();
handleStyles();
if (onUpdate) {
onUpdate(prevProps, nextProps);
}
if (instance2.popperInstance) {
createPopperInstance();
getNestedPopperTree().forEach(function(nestedPopper) {
requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
});
}
invokeHook("onAfterUpdate", [instance2, partialProps]);
}
function setContent2(content2) {
instance2.setProps({
content: content2
});
}
function show() {
var isAlreadyVisible = instance2.state.isVisible;
var isDestroyed = instance2.state.isDestroyed;
var isDisabled = !instance2.state.isEnabled;
var isTouchAndTouchDisabled = currentInput$1.isTouch && !instance2.props.touch;
var duration2 = getValueAtIndexOrReturn$1(instance2.props.duration, 0, defaultProps$3.duration);
if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
return;
}
if (getCurrentTarget().hasAttribute("disabled")) {
return;
}
invokeHook("onShow", [instance2], false);
if (instance2.props.onShow(instance2) === false) {
return;
}
instance2.state.isVisible = true;
if (getIsDefaultRenderFn()) {
popper2.style.visibility = "visible";
}
handleStyles();
addDocumentPress();
if (!instance2.state.isMounted) {
popper2.style.transition = "none";
}
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content2 = _getDefaultTemplateCh2.content;
setTransitionDuration$2([box, content2], 0);
}
onFirstUpdate = function onFirstUpdate2() {
var _instance$popperInsta2;
if (!instance2.state.isVisible || ignoreOnFirstUpdate) {
return;
}
ignoreOnFirstUpdate = true;
void popper2.offsetHeight;
popper2.style.transition = instance2.props.moveTransition;
if (getIsDefaultRenderFn() && instance2.props.animation) {
var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content;
setTransitionDuration$2([_box, _content], duration2);
setVisibilityState$1([_box, _content], "visible");
}
handleAriaContentAttribute();
handleAriaExpandedAttribute();
pushIfUnique$1(mountedInstances$1, instance2);
(_instance$popperInsta2 = instance2.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
invokeHook("onMount", [instance2]);
if (instance2.props.animation && getIsDefaultRenderFn()) {
onTransitionedIn(duration2, function() {
instance2.state.isShown = true;
invokeHook("onShown", [instance2]);
});
}
};
mount();
}
function hide2() {
var isAlreadyHidden = !instance2.state.isVisible;
var isDestroyed = instance2.state.isDestroyed;
var isDisabled = !instance2.state.isEnabled;
var duration2 = getValueAtIndexOrReturn$1(instance2.props.duration, 1, defaultProps$3.duration);
if (isAlreadyHidden || isDestroyed || isDisabled) {
return;
}
invokeHook("onHide", [instance2], false);
if (instance2.props.onHide(instance2) === false) {
return;
}
instance2.state.isVisible = false;
instance2.state.isShown = false;
ignoreOnFirstUpdate = false;
isVisibleFromClick = false;
if (getIsDefaultRenderFn()) {
popper2.style.visibility = "hidden";
}
cleanupInteractiveMouseListeners();
removeDocumentPress();
handleStyles(true);
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content2 = _getDefaultTemplateCh4.content;
if (instance2.props.animation) {
setTransitionDuration$2([box, content2], duration2);
setVisibilityState$1([box, content2], "hidden");
}
}
handleAriaContentAttribute();
handleAriaExpandedAttribute();
if (instance2.props.animation) {
if (getIsDefaultRenderFn()) {
onTransitionedOut(duration2, instance2.unmount);
}
} else {
instance2.unmount();
}
}
function hideWithInteractivity(event2) {
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
pushIfUnique$1(mouseMoveListeners$1, debouncedOnMouseMove);
debouncedOnMouseMove(event2);
}
function unmount() {
if (instance2.state.isVisible) {
instance2.hide();
}
if (!instance2.state.isMounted) {
return;
}
destroyPopperInstance();
getNestedPopperTree().forEach(function(nestedPopper) {
nestedPopper._tippy.unmount();
});
if (popper2.parentNode) {
popper2.parentNode.removeChild(popper2);
}
mountedInstances$1 = mountedInstances$1.filter(function(i2) {
return i2 !== instance2;
});
instance2.state.isMounted = false;
invokeHook("onHidden", [instance2]);
}
function destroy() {
if (instance2.state.isDestroyed) {
return;
}
instance2.clearDelayTimeouts();
instance2.unmount();
removeListeners();
delete reference2._tippy;
instance2.state.isDestroyed = true;
invokeHook("onDestroy", [instance2]);
}
}
function tippy$1(targets, optionalProps) {
if (optionalProps === void 0) {
optionalProps = {};
}
var plugins = defaultProps$3.plugins.concat(optionalProps.plugins || []);
bindGlobalEventListeners$1();
var passedProps = Object.assign({}, optionalProps, {
plugins
});
var elements2 = getArrayOfElements$1(targets);
var instances = elements2.reduce(function(acc, reference2) {
var instance2 = reference2 && createTippy$1(reference2, passedProps);
if (instance2) {
acc.push(instance2);
}
return acc;
}, []);
return isElement$1(targets) ? instances[0] : instances;
}
tippy$1.defaultProps = defaultProps$3;
tippy$1.setDefaultProps = setDefaultProps$1;
tippy$1.currentInput = currentInput$1;
var applyStylesModifier$1 = Object.assign({}, applyStyles$1, {
effect: function effect2(_ref3) {
var state = _ref3.state;
var initialStyles = {
popper: {
position: state.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles = initialStyles;
if (state.elements.arrow) {
Object.assign(state.elements.arrow.style, initialStyles.arrow);
}
}
});
var createSingleton$1 = function createSingleton(tippyInstances, optionalProps) {
var _optionalProps$popper;
if (optionalProps === void 0) {
optionalProps = {};
}
var individualInstances = tippyInstances;
var references = [];
var triggerTargets = [];
var currentTarget;
var overrides = optionalProps.overrides;
var interceptSetPropsCleanups = [];
var shownOnCreate = false;
function setTriggerTargets() {
triggerTargets = individualInstances.map(function(instance2) {
return normalizeToArray$1(instance2.props.triggerTarget || instance2.reference);
}).reduce(function(acc, item) {
return acc.concat(item);
}, []);
}
function setReferences() {
references = individualInstances.map(function(instance2) {
return instance2.reference;
});
}
function enableInstances(isEnabled) {
individualInstances.forEach(function(instance2) {
if (isEnabled) {
instance2.enable();
} else {
instance2.disable();
}
});
}
function interceptSetProps(singleton3) {
return individualInstances.map(function(instance2) {
var originalSetProps2 = instance2.setProps;
instance2.setProps = function(props) {
originalSetProps2(props);
if (instance2.reference === currentTarget) {
singleton3.setProps(props);
}
};
return function() {
instance2.setProps = originalSetProps2;
};
});
}
function prepareInstance(singleton3, target2) {
var index2 = triggerTargets.indexOf(target2);
if (target2 === currentTarget) {
return;
}
currentTarget = target2;
var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) {
acc[prop] = individualInstances[index2].props[prop];
return acc;
}, {});
singleton3.setProps(Object.assign({}, overrideProps, {
getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() {
var _references$index;
return (_references$index = references[index2]) == null ? void 0 : _references$index.getBoundingClientRect();
}
}));
}
enableInstances(false);
setReferences();
setTriggerTargets();
var plugin = {
fn: function fn8() {
return {
onDestroy: function onDestroy3() {
enableInstances(true);
},
onHidden: function onHidden3() {
currentTarget = null;
},
onClickOutside: function onClickOutside3(instance2) {
if (instance2.props.showOnCreate && !shownOnCreate) {
shownOnCreate = true;
currentTarget = null;
}
},
onShow: function onShow3(instance2) {
if (instance2.props.showOnCreate && !shownOnCreate) {
shownOnCreate = true;
prepareInstance(instance2, references[0]);
}
},
onTrigger: function onTrigger3(instance2, event2) {
prepareInstance(instance2, event2.currentTarget);
}
};
}
};
var singleton2 = tippy$1(div$1(), Object.assign({}, removeProperties$1(optionalProps, ["overrides"]), {
plugins: [plugin].concat(optionalProps.plugins || []),
triggerTarget: triggerTargets,
popperOptions: Object.assign({}, optionalProps.popperOptions, {
modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier$1])
})
}));
var originalShow = singleton2.show;
singleton2.show = function(target2) {
originalShow();
if (!currentTarget && target2 == null) {
return prepareInstance(singleton2, references[0]);
}
if (currentTarget && target2 == null) {
return;
}
if (typeof target2 === "number") {
return references[target2] && prepareInstance(singleton2, references[target2]);
}
if (individualInstances.indexOf(target2) >= 0) {
var ref2 = target2.reference;
return prepareInstance(singleton2, ref2);
}
if (references.indexOf(target2) >= 0) {
return prepareInstance(singleton2, target2);
}
};
singleton2.showNext = function() {
var first = references[0];
if (!currentTarget) {
return singleton2.show(0);
}
var index2 = references.indexOf(currentTarget);
singleton2.show(references[index2 + 1] || first);
};
singleton2.showPrevious = function() {
var last = references[references.length - 1];
if (!currentTarget) {
return singleton2.show(last);
}
var index2 = references.indexOf(currentTarget);
var target2 = references[index2 - 1] || last;
singleton2.show(target2);
};
var originalSetProps = singleton2.setProps;
singleton2.setProps = function(props) {
overrides = props.overrides || overrides;
originalSetProps(props);
};
singleton2.setInstances = function(nextInstances) {
enableInstances(true);
interceptSetPropsCleanups.forEach(function(fn8) {
return fn8();
});
individualInstances = nextInstances;
enableInstances(false);
setReferences();
setTriggerTargets();
interceptSetPropsCleanups = interceptSetProps(singleton2);
singleton2.setProps({
triggerTarget: triggerTargets
});
};
interceptSetPropsCleanups = interceptSetProps(singleton2);
return singleton2;
};
tippy$1.setDefaultProps({
animation: false
});
function _objectWithoutPropertiesLoose$1(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
var isBrowser$1 = typeof window !== "undefined" && typeof document !== "undefined";
function preserveRef(ref2, node2) {
if (ref2) {
if (typeof ref2 === "function") {
ref2(node2);
}
if ({}.hasOwnProperty.call(ref2, "current")) {
ref2.current = node2;
}
}
}
function ssrSafeCreateDiv() {
return isBrowser$1 && document.createElement("div");
}
function toDataAttributes(attrs) {
var dataAttrs = {
"data-placement": attrs.placement
};
if (attrs.referenceHidden) {
dataAttrs["data-reference-hidden"] = "";
}
if (attrs.escaped) {
dataAttrs["data-escaped"] = "";
}
return dataAttrs;
}
function deepEqual(x2, y2) {
if (x2 === y2) {
return true;
} else if (typeof x2 === "object" && x2 != null && typeof y2 === "object" && y2 != null) {
if (Object.keys(x2).length !== Object.keys(y2).length) {
return false;
}
for (var prop in x2) {
if (y2.hasOwnProperty(prop)) {
if (!deepEqual(x2[prop], y2[prop])) {
return false;
}
} else {
return false;
}
}
return true;
} else {
return false;
}
}
function uniqueByShape(arr2) {
var output3 = [];
arr2.forEach(function(item) {
if (!output3.find(function(outputItem) {
return deepEqual(item, outputItem);
})) {
output3.push(item);
}
});
return output3;
}
function deepPreserveProps(instanceProps, componentProps) {
var _instanceProps$popper, _componentProps$poppe;
return Object.assign({}, componentProps, {
popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {
modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))
})
});
}
var useIsomorphicLayoutEffect$1 = isBrowser$1 ? reactExports.useLayoutEffect : reactExports.useEffect;
function useMutableBox(initialValue) {
var ref2 = reactExports.useRef();
if (!ref2.current) {
ref2.current = typeof initialValue === "function" ? initialValue() : initialValue;
}
return ref2.current;
}
function updateClassName(box, action, classNames2) {
classNames2.split(/\s+/).forEach(function(name) {
if (name) {
box.classList[action](name);
}
});
}
var classNamePlugin = {
name: "className",
defaultValue: "",
fn: function fn2(instance2) {
var box = instance2.popper.firstElementChild;
var isDefaultRenderFn = function isDefaultRenderFn2() {
var _instance$props$rende;
return !!((_instance$props$rende = instance2.props.render) == null ? void 0 : _instance$props$rende.$$tippy);
};
function add3() {
if (instance2.props.className && !isDefaultRenderFn()) {
return;
}
updateClassName(box, "add", instance2.props.className);
}
function remove3() {
if (isDefaultRenderFn()) {
updateClassName(box, "remove", instance2.props.className);
}
}
return {
onCreate: add3,
onBeforeUpdate: remove3,
onAfterUpdate: add3
};
}
};
function TippyGenerator(tippy2) {
function Tippy(_ref3) {
var children2 = _ref3.children, content2 = _ref3.content, visible = _ref3.visible, singleton2 = _ref3.singleton, render3 = _ref3.render, reference2 = _ref3.reference, _ref$disabled = _ref3.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$ignoreAttributes = _ref3.ignoreAttributes, ignoreAttributes = _ref$ignoreAttributes === void 0 ? true : _ref$ignoreAttributes;
_ref3.__source;
_ref3.__self;
var restOfNativeProps = _objectWithoutPropertiesLoose$1(_ref3, ["children", "content", "visible", "singleton", "render", "reference", "disabled", "ignoreAttributes", "__source", "__self"]);
var isControlledMode = visible !== void 0;
var isSingletonMode = singleton2 !== void 0;
var _useState = reactExports.useState(false), mounted = _useState[0], setMounted = _useState[1];
var _useState2 = reactExports.useState({}), attrs = _useState2[0], setAttrs = _useState2[1];
var _useState3 = reactExports.useState(), singletonContent = _useState3[0], setSingletonContent = _useState3[1];
var mutableBox = useMutableBox(function() {
return {
container: ssrSafeCreateDiv(),
renders: 1
};
});
var props = Object.assign({
ignoreAttributes
}, restOfNativeProps, {
content: mutableBox.container
});
if (isControlledMode) {
props.trigger = "manual";
props.hideOnClick = false;
}
if (isSingletonMode) {
disabled = true;
}
var computedProps = props;
var plugins = props.plugins || [];
if (render3) {
computedProps = Object.assign({}, props, {
plugins: isSingletonMode && singleton2.data != null ? [].concat(plugins, [{
fn: function fn8() {
return {
onTrigger: function onTrigger3(instance2, event2) {
var node2 = singleton2.data.children.find(function(_ref22) {
var instance3 = _ref22.instance;
return instance3.reference === event2.currentTarget;
});
instance2.state.$$activeSingletonInstance = node2.instance;
setSingletonContent(node2.content);
}
};
}
}]) : plugins,
render: function render4() {
return {
popper: mutableBox.container
};
}
});
}
var deps = [reference2].concat(children2 ? [children2.type] : []);
useIsomorphicLayoutEffect$1(function() {
var element2 = reference2;
if (reference2 && reference2.hasOwnProperty("current")) {
element2 = reference2.current;
}
var instance2 = tippy2(element2 || mutableBox.ref || ssrSafeCreateDiv(), Object.assign({}, computedProps, {
plugins: [classNamePlugin].concat(props.plugins || [])
}));
mutableBox.instance = instance2;
if (disabled) {
instance2.disable();
}
if (visible) {
instance2.show();
}
if (isSingletonMode) {
singleton2.hook({
instance: instance2,
content: content2,
props: computedProps,
setSingletonContent
});
}
setMounted(true);
return function() {
instance2.destroy();
singleton2 == null ? void 0 : singleton2.cleanup(instance2);
};
}, deps);
useIsomorphicLayoutEffect$1(function() {
var _instance$popperInsta;
if (mutableBox.renders === 1) {
mutableBox.renders++;
return;
}
var instance2 = mutableBox.instance;
instance2.setProps(deepPreserveProps(instance2.props, computedProps));
(_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.forceUpdate();
if (disabled) {
instance2.disable();
} else {
instance2.enable();
}
if (isControlledMode) {
if (visible) {
instance2.show();
} else {
instance2.hide();
}
}
if (isSingletonMode) {
singleton2.hook({
instance: instance2,
content: content2,
props: computedProps,
setSingletonContent
});
}
});
useIsomorphicLayoutEffect$1(function() {
var _instance$props$poppe;
if (!render3) {
return;
}
var instance2 = mutableBox.instance;
instance2.setProps({
popperOptions: Object.assign({}, instance2.props.popperOptions, {
modifiers: [].concat((((_instance$props$poppe = instance2.props.popperOptions) == null ? void 0 : _instance$props$poppe.modifiers) || []).filter(function(_ref32) {
var name = _ref32.name;
return name !== "$$tippyReact";
}), [{
name: "$$tippyReact",
enabled: true,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: function fn8(_ref4) {
var _state$modifiersData;
var state = _ref4.state;
var hideData = (_state$modifiersData = state.modifiersData) == null ? void 0 : _state$modifiersData.hide;
if (attrs.placement !== state.placement || attrs.referenceHidden !== (hideData == null ? void 0 : hideData.isReferenceHidden) || attrs.escaped !== (hideData == null ? void 0 : hideData.hasPopperEscaped)) {
setAttrs({
placement: state.placement,
referenceHidden: hideData == null ? void 0 : hideData.isReferenceHidden,
escaped: hideData == null ? void 0 : hideData.hasPopperEscaped
});
}
state.attributes.popper = {};
}
}])
})
});
}, [attrs.placement, attrs.referenceHidden, attrs.escaped].concat(deps));
return /* @__PURE__ */ React.createElement(React.Fragment, null, children2 ? /* @__PURE__ */ reactExports.cloneElement(children2, {
ref: function ref2(node2) {
mutableBox.ref = node2;
preserveRef(children2.ref, node2);
}
}) : null, mounted && /* @__PURE__ */ reactDomExports.createPortal(render3 ? render3(toDataAttributes(attrs), singletonContent, mutableBox.instance) : content2, mutableBox.container));
}
return Tippy;
}
function useSingletonGenerator(createSingleton4) {
return function useSingleton2(_temp) {
var _ref3 = _temp === void 0 ? {} : _temp, _ref$disabled = _ref3.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$overrides = _ref3.overrides, overrides = _ref$overrides === void 0 ? [] : _ref$overrides;
var _useState = reactExports.useState(false), mounted = _useState[0], setMounted = _useState[1];
var mutableBox = useMutableBox({
children: [],
renders: 1
});
useIsomorphicLayoutEffect$1(function() {
if (!mounted) {
setMounted(true);
return;
}
var children2 = mutableBox.children, sourceData = mutableBox.sourceData;
if (!sourceData) {
return;
}
var instance2 = createSingleton4(children2.map(function(child) {
return child.instance;
}), Object.assign({}, sourceData.props, {
popperOptions: sourceData.instance.props.popperOptions,
overrides,
plugins: [classNamePlugin].concat(sourceData.props.plugins || [])
}));
mutableBox.instance = instance2;
if (disabled) {
instance2.disable();
}
return function() {
instance2.destroy();
mutableBox.children = children2.filter(function(_ref22) {
var instance3 = _ref22.instance;
return !instance3.state.isDestroyed;
});
};
}, [mounted]);
useIsomorphicLayoutEffect$1(function() {
if (!mounted) {
return;
}
if (mutableBox.renders === 1) {
mutableBox.renders++;
return;
}
var children2 = mutableBox.children, instance2 = mutableBox.instance, sourceData = mutableBox.sourceData;
if (!(instance2 && sourceData)) {
return;
}
var _sourceData$props = sourceData.props;
_sourceData$props.content;
var props = _objectWithoutPropertiesLoose$1(_sourceData$props, ["content"]);
instance2.setProps(deepPreserveProps(instance2.props, Object.assign({}, props, {
overrides
})));
instance2.setInstances(children2.map(function(child) {
return child.instance;
}));
if (disabled) {
instance2.disable();
} else {
instance2.enable();
}
});
return reactExports.useMemo(function() {
var source2 = {
data: mutableBox,
hook: function hook(data2) {
mutableBox.sourceData = data2;
mutableBox.setSingletonContent = data2.setSingletonContent;
},
cleanup: function cleanup() {
mutableBox.sourceData = null;
}
};
var target2 = {
hook: function hook(data2) {
var _mutableBox$instance, _mutableBox$instance2;
mutableBox.children = mutableBox.children.filter(function(_ref32) {
var instance2 = _ref32.instance;
return data2.instance !== instance2;
});
mutableBox.children.push(data2);
if (((_mutableBox$instance = mutableBox.instance) == null ? void 0 : _mutableBox$instance.state.isMounted) && ((_mutableBox$instance2 = mutableBox.instance) == null ? void 0 : _mutableBox$instance2.state.$$activeSingletonInstance) === data2.instance) {
mutableBox.setSingletonContent == null ? void 0 : mutableBox.setSingletonContent(data2.content);
}
if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {
mutableBox.instance.setInstances(mutableBox.children.map(function(child) {
return child.instance;
}));
}
},
cleanup: function cleanup(instance2) {
mutableBox.children = mutableBox.children.filter(function(data2) {
return data2.instance !== instance2;
});
if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {
mutableBox.instance.setInstances(mutableBox.children.map(function(child) {
return child.instance;
}));
}
}
};
return [source2, target2];
}, []);
};
}
var forwardRef = function(Tippy, defaultProps2) {
return /* @__PURE__ */ reactExports.forwardRef(function TippyWrapper(_ref3, _ref22) {
var children2 = _ref3.children, props = _objectWithoutPropertiesLoose$1(_ref3, ["children"]);
return (
// If I spread them separately here, Babel adds the _extends ponyfill for
// some reason
/* @__PURE__ */ React.createElement(Tippy, Object.assign({}, defaultProps2, props), children2 ? /* @__PURE__ */ reactExports.cloneElement(children2, {
ref: function ref2(node2) {
preserveRef(_ref22, node2);
preserveRef(children2.ref, node2);
}
}) : null)
);
});
};
var useSingleton = /* @__PURE__ */ useSingletonGenerator(createSingleton$1);
var headless = /* @__PURE__ */ forwardRef(/* @__PURE__ */ TippyGenerator(tippy$1), {
render: function render() {
return "";
}
});
const tippyReactHeadless_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: headless,
tippy: tippy$1,
useSingleton
}, Symbol.toStringTag, { value: "Module" }));
const require$$5$1 = /* @__PURE__ */ getAugmentedNamespace(tippyReactHeadless_esm);
var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
var BOX_CLASS = "tippy-box";
var CONTENT_CLASS = "tippy-content";
var BACKDROP_CLASS = "tippy-backdrop";
var ARROW_CLASS = "tippy-arrow";
var SVG_ARROW_CLASS = "tippy-svg-arrow";
var TOUCH_OPTIONS = {
passive: true,
capture: true
};
var TIPPY_DEFAULT_APPEND_TO2 = function TIPPY_DEFAULT_APPEND_TO3() {
return document.body;
};
function getValueAtIndexOrReturn(value2, index2, defaultValue2) {
if (Array.isArray(value2)) {
var v2 = value2[index2];
return v2 == null ? Array.isArray(defaultValue2) ? defaultValue2[index2] : defaultValue2 : v2;
}
return value2;
}
function isType(value2, type2) {
var str = {}.toString.call(value2);
return str.indexOf("[object") === 0 && str.indexOf(type2 + "]") > -1;
}
function invokeWithArgsOrReturn(value2, args) {
return typeof value2 === "function" ? value2.apply(void 0, args) : value2;
}
function debounce$1(fn8, ms) {
if (ms === 0) {
return fn8;
}
var timeout2;
return function(arg) {
clearTimeout(timeout2);
timeout2 = setTimeout(function() {
fn8(arg);
}, ms);
};
}
function removeProperties(obj, keys3) {
var clone2 = Object.assign({}, obj);
keys3.forEach(function(key2) {
delete clone2[key2];
});
return clone2;
}
function splitBySpaces(value2) {
return value2.split(/\s+/).filter(Boolean);
}
function normalizeToArray(value2) {
return [].concat(value2);
}
function pushIfUnique(arr2, value2) {
if (arr2.indexOf(value2) === -1) {
arr2.push(value2);
}
}
function unique(arr2) {
return arr2.filter(function(item, index2) {
return arr2.indexOf(item) === index2;
});
}
function getBasePlacement(placement) {
return placement.split("-")[0];
}
function arrayFrom(value2) {
return [].slice.call(value2);
}
function removeUndefinedProps(obj) {
return Object.keys(obj).reduce(function(acc, key2) {
if (obj[key2] !== void 0) {
acc[key2] = obj[key2];
}
return acc;
}, {});
}
function div() {
return document.createElement("div");
}
function isElement(value2) {
return ["Element", "Fragment"].some(function(type2) {
return isType(value2, type2);
});
}
function isNodeList(value2) {
return isType(value2, "NodeList");
}
function isMouseEvent(value2) {
return isType(value2, "MouseEvent");
}
function isReferenceElement(value2) {
return !!(value2 && value2._tippy && value2._tippy.reference === value2);
}
function getArrayOfElements(value2) {
if (isElement(value2)) {
return [value2];
}
if (isNodeList(value2)) {
return arrayFrom(value2);
}
if (Array.isArray(value2)) {
return value2;
}
return arrayFrom(document.querySelectorAll(value2));
}
function setTransitionDuration$1(els, value2) {
els.forEach(function(el) {
if (el) {
el.style.transitionDuration = value2 + "ms";
}
});
}
function setVisibilityState(els, state) {
els.forEach(function(el) {
if (el) {
el.setAttribute("data-state", state);
}
});
}
function getOwnerDocument$1(elementOrElements) {
var _element$ownerDocumen;
var _normalizeToArray = normalizeToArray(elementOrElements), element2 = _normalizeToArray[0];
return element2 != null && (_element$ownerDocumen = element2.ownerDocument) != null && _element$ownerDocumen.body ? element2.ownerDocument : document;
}
function isCursorOutsideInteractiveBorder(popperTreeData, event2) {
var clientX = event2.clientX, clientY = event2.clientY;
return popperTreeData.every(function(_ref3) {
var popperRect = _ref3.popperRect, popperState = _ref3.popperState, props = _ref3.props;
var interactiveBorder = props.interactiveBorder;
var basePlacement = getBasePlacement(popperState.placement);
var offsetData = popperState.modifiersData.offset;
if (!offsetData) {
return true;
}
var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0;
var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0;
var leftDistance = basePlacement === "right" ? offsetData.left.x : 0;
var rightDistance = basePlacement === "left" ? offsetData.right.x : 0;
var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
});
}
function updateTransitionEndListener(box, action, listener2) {
var method = action + "EventListener";
["transitionend", "webkitTransitionEnd"].forEach(function(event2) {
box[method](event2, listener2);
});
}
function actualContains(parent, child) {
var target2 = child;
while (target2) {
var _target$getRootNode;
if (parent.contains(target2)) {
return true;
}
target2 = target2.getRootNode == null ? void 0 : (_target$getRootNode = target2.getRootNode()) == null ? void 0 : _target$getRootNode.host;
}
return false;
}
var currentInput = {
isTouch: false
};
var lastMouseMoveTime = 0;
function onDocumentTouchStart() {
if (currentInput.isTouch) {
return;
}
currentInput.isTouch = true;
if (window.performance) {
document.addEventListener("mousemove", onDocumentMouseMove);
}
}
function onDocumentMouseMove() {
var now2 = performance.now();
if (now2 - lastMouseMoveTime < 20) {
currentInput.isTouch = false;
document.removeEventListener("mousemove", onDocumentMouseMove);
}
lastMouseMoveTime = now2;
}
function onWindowBlur() {
var activeElement = document.activeElement;
if (isReferenceElement(activeElement)) {
var instance2 = activeElement._tippy;
if (activeElement.blur && !instance2.state.isVisible) {
activeElement.blur();
}
}
}
function bindGlobalEventListeners() {
document.addEventListener("touchstart", onDocumentTouchStart, TOUCH_OPTIONS);
window.addEventListener("blur", onWindowBlur);
}
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
var isIE11 = isBrowser ? (
// @ts-ignore
!!window.msCrypto
) : false;
var pluginProps = {
animateFill: false,
followCursor: false,
inlinePositioning: false,
sticky: false
};
var renderProps = {
allowHTML: false,
animation: "fade",
arrow: true,
content: "",
inertia: false,
maxWidth: 350,
role: "tooltip",
theme: "",
zIndex: 9999
};
var defaultProps$2 = Object.assign({
appendTo: TIPPY_DEFAULT_APPEND_TO2,
aria: {
content: "auto",
expanded: "auto"
},
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: true,
ignoreAttributes: false,
interactive: false,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: "",
offset: [0, 10],
onAfterUpdate: function onAfterUpdate2() {
},
onBeforeUpdate: function onBeforeUpdate2() {
},
onCreate: function onCreate2() {
},
onDestroy: function onDestroy2() {
},
onHidden: function onHidden2() {
},
onHide: function onHide2() {
},
onMount: function onMount2() {
},
onShow: function onShow2() {
},
onShown: function onShown2() {
},
onTrigger: function onTrigger2() {
},
onUntrigger: function onUntrigger2() {
},
onClickOutside: function onClickOutside2() {
},
placement: "top",
plugins: [],
popperOptions: {},
render: null,
showOnCreate: false,
touch: true,
trigger: "mouseenter focus",
triggerTarget: null
}, pluginProps, renderProps);
var defaultKeys = Object.keys(defaultProps$2);
var setDefaultProps2 = function setDefaultProps3(partialProps) {
var keys3 = Object.keys(partialProps);
keys3.forEach(function(key2) {
defaultProps$2[key2] = partialProps[key2];
});
};
function getExtendedPassedProps(passedProps) {
var plugins = passedProps.plugins || [];
var pluginProps2 = plugins.reduce(function(acc, plugin) {
var name = plugin.name, defaultValue2 = plugin.defaultValue;
if (name) {
var _name;
acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps$2[name]) != null ? _name : defaultValue2;
}
return acc;
}, {});
return Object.assign({}, passedProps, pluginProps2);
}
function getDataAttributeProps(reference2, plugins) {
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps$2, {
plugins
}))) : defaultKeys;
var props = propKeys.reduce(function(acc, key2) {
var valueAsString = (reference2.getAttribute("data-tippy-" + key2) || "").trim();
if (!valueAsString) {
return acc;
}
if (key2 === "content") {
acc[key2] = valueAsString;
} else {
try {
acc[key2] = JSON.parse(valueAsString);
} catch (e7) {
acc[key2] = valueAsString;
}
}
return acc;
}, {});
return props;
}
function evaluateProps(reference2, props) {
var out = Object.assign({}, props, {
content: invokeWithArgsOrReturn(props.content, [reference2])
}, props.ignoreAttributes ? {} : getDataAttributeProps(reference2, props.plugins));
out.aria = Object.assign({}, defaultProps$2.aria, out.aria);
out.aria = {
expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded,
content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content
};
return out;
}
var innerHTML = function innerHTML2() {
return "innerHTML";
};
function dangerouslySetInnerHTML(element2, html2) {
element2[innerHTML()] = html2;
}
function createArrowElement(value2) {
var arrow2 = div();
if (value2 === true) {
arrow2.className = ARROW_CLASS;
} else {
arrow2.className = SVG_ARROW_CLASS;
if (isElement(value2)) {
arrow2.appendChild(value2);
} else {
dangerouslySetInnerHTML(arrow2, value2);
}
}
return arrow2;
}
function setContent(content2, props) {
if (isElement(props.content)) {
dangerouslySetInnerHTML(content2, "");
content2.appendChild(props.content);
} else if (typeof props.content !== "function") {
if (props.allowHTML) {
dangerouslySetInnerHTML(content2, props.content);
} else {
content2.textContent = props.content;
}
}
}
function getChildren$1(popper2) {
var box = popper2.firstElementChild;
var boxChildren = arrayFrom(box.children);
return {
box,
content: boxChildren.find(function(node2) {
return node2.classList.contains(CONTENT_CLASS);
}),
arrow: boxChildren.find(function(node2) {
return node2.classList.contains(ARROW_CLASS) || node2.classList.contains(SVG_ARROW_CLASS);
}),
backdrop: boxChildren.find(function(node2) {
return node2.classList.contains(BACKDROP_CLASS);
})
};
}
function render2(instance2) {
var popper2 = div();
var box = div();
box.className = BOX_CLASS;
box.setAttribute("data-state", "hidden");
box.setAttribute("tabindex", "-1");
var content2 = div();
content2.className = CONTENT_CLASS;
content2.setAttribute("data-state", "hidden");
setContent(content2, instance2.props);
popper2.appendChild(box);
box.appendChild(content2);
onUpdate(instance2.props, instance2.props);
function onUpdate(prevProps, nextProps) {
var _getChildren = getChildren$1(popper2), box2 = _getChildren.box, content3 = _getChildren.content, arrow2 = _getChildren.arrow;
if (nextProps.theme) {
box2.setAttribute("data-theme", nextProps.theme);
} else {
box2.removeAttribute("data-theme");
}
if (typeof nextProps.animation === "string") {
box2.setAttribute("data-animation", nextProps.animation);
} else {
box2.removeAttribute("data-animation");
}
if (nextProps.inertia) {
box2.setAttribute("data-inertia", "");
} else {
box2.removeAttribute("data-inertia");
}
box2.style.maxWidth = typeof nextProps.maxWidth === "number" ? nextProps.maxWidth + "px" : nextProps.maxWidth;
if (nextProps.role) {
box2.setAttribute("role", nextProps.role);
} else {
box2.removeAttribute("role");
}
if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
setContent(content3, instance2.props);
}
if (nextProps.arrow) {
if (!arrow2) {
box2.appendChild(createArrowElement(nextProps.arrow));
} else if (prevProps.arrow !== nextProps.arrow) {
box2.removeChild(arrow2);
box2.appendChild(createArrowElement(nextProps.arrow));
}
} else if (arrow2) {
box2.removeChild(arrow2);
}
}
return {
popper: popper2,
onUpdate
};
}
render2.$$tippy = true;
var idCounter = 1;
var mouseMoveListeners = [];
var mountedInstances = [];
function createTippy(reference2, passedProps) {
var props = evaluateProps(reference2, Object.assign({}, defaultProps$2, getExtendedPassedProps(removeUndefinedProps(passedProps))));
var showTimeout;
var hideTimeout;
var scheduleHideAnimationFrame;
var isVisibleFromClick = false;
var didHideDueToDocumentMouseDown = false;
var didTouchMove = false;
var ignoreOnFirstUpdate = false;
var lastTriggerEvent;
var currentTransitionEndListener;
var onFirstUpdate;
var listeners = [];
var debouncedOnMouseMove = debounce$1(onMouseMove, props.interactiveDebounce);
var currentTarget;
var id = idCounter++;
var popperInstance = null;
var plugins = unique(props.plugins);
var state = {
// Is the instance currently enabled?
isEnabled: true,
// Is the tippy currently showing and not transitioning out?
isVisible: false,
// Has the instance been destroyed?
isDestroyed: false,
// Is the tippy currently mounted to the DOM?
isMounted: false,
// Has the tippy finished transitioning in?
isShown: false
};
var instance2 = {
// properties
id,
reference: reference2,
popper: div(),
popperInstance,
props,
state,
plugins,
// methods
clearDelayTimeouts,
setProps,
setContent: setContent2,
show,
hide: hide2,
hideWithInteractivity,
enable,
disable,
unmount,
destroy
};
if (!props.render) {
return instance2;
}
var _props$render = props.render(instance2), popper2 = _props$render.popper, onUpdate = _props$render.onUpdate;
popper2.setAttribute("data-tippy-root", "");
popper2.id = "tippy-" + instance2.id;
instance2.popper = popper2;
reference2._tippy = instance2;
popper2._tippy = instance2;
var pluginsHooks = plugins.map(function(plugin) {
return plugin.fn(instance2);
});
var hasAriaExpanded = reference2.hasAttribute("aria-expanded");
addListeners();
handleAriaExpandedAttribute();
handleStyles();
invokeHook("onCreate", [instance2]);
if (props.showOnCreate) {
scheduleShow();
}
popper2.addEventListener("mouseenter", function() {
if (instance2.props.interactive && instance2.state.isVisible) {
instance2.clearDelayTimeouts();
}
});
popper2.addEventListener("mouseleave", function() {
if (instance2.props.interactive && instance2.props.trigger.indexOf("mouseenter") >= 0) {
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
}
});
return instance2;
function getNormalizedTouchSettings() {
var touch2 = instance2.props.touch;
return Array.isArray(touch2) ? touch2 : [touch2, 0];
}
function getIsCustomTouchBehavior() {
return getNormalizedTouchSettings()[0] === "hold";
}
function getIsDefaultRenderFn() {
var _instance$props$rende;
return !!((_instance$props$rende = instance2.props.render) != null && _instance$props$rende.$$tippy);
}
function getCurrentTarget() {
return currentTarget || reference2;
}
function getDocument() {
var parent = getCurrentTarget().parentNode;
return parent ? getOwnerDocument$1(parent) : document;
}
function getDefaultTemplateChildren() {
return getChildren$1(popper2);
}
function getDelay(isShow) {
if (instance2.state.isMounted && !instance2.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") {
return 0;
}
return getValueAtIndexOrReturn(instance2.props.delay, isShow ? 0 : 1, defaultProps$2.delay);
}
function handleStyles(fromHide) {
if (fromHide === void 0) {
fromHide = false;
}
popper2.style.pointerEvents = instance2.props.interactive && !fromHide ? "" : "none";
popper2.style.zIndex = "" + instance2.props.zIndex;
}
function invokeHook(hook, args, shouldInvokePropsHook) {
if (shouldInvokePropsHook === void 0) {
shouldInvokePropsHook = true;
}
pluginsHooks.forEach(function(pluginHooks) {
if (pluginHooks[hook]) {
pluginHooks[hook].apply(pluginHooks, args);
}
});
if (shouldInvokePropsHook) {
var _instance$props;
(_instance$props = instance2.props)[hook].apply(_instance$props, args);
}
}
function handleAriaContentAttribute() {
var aria = instance2.props.aria;
if (!aria.content) {
return;
}
var attr2 = "aria-" + aria.content;
var id2 = popper2.id;
var nodes = normalizeToArray(instance2.props.triggerTarget || reference2);
nodes.forEach(function(node2) {
var currentValue = node2.getAttribute(attr2);
if (instance2.state.isVisible) {
node2.setAttribute(attr2, currentValue ? currentValue + " " + id2 : id2);
} else {
var nextValue = currentValue && currentValue.replace(id2, "").trim();
if (nextValue) {
node2.setAttribute(attr2, nextValue);
} else {
node2.removeAttribute(attr2);
}
}
});
}
function handleAriaExpandedAttribute() {
if (hasAriaExpanded || !instance2.props.aria.expanded) {
return;
}
var nodes = normalizeToArray(instance2.props.triggerTarget || reference2);
nodes.forEach(function(node2) {
if (instance2.props.interactive) {
node2.setAttribute("aria-expanded", instance2.state.isVisible && node2 === getCurrentTarget() ? "true" : "false");
} else {
node2.removeAttribute("aria-expanded");
}
});
}
function cleanupInteractiveMouseListeners() {
getDocument().removeEventListener("mousemove", debouncedOnMouseMove);
mouseMoveListeners = mouseMoveListeners.filter(function(listener2) {
return listener2 !== debouncedOnMouseMove;
});
}
function onDocumentPress(event2) {
if (currentInput.isTouch) {
if (didTouchMove || event2.type === "mousedown") {
return;
}
}
var actualTarget = event2.composedPath && event2.composedPath()[0] || event2.target;
if (instance2.props.interactive && actualContains(popper2, actualTarget)) {
return;
}
if (normalizeToArray(instance2.props.triggerTarget || reference2).some(function(el) {
return actualContains(el, actualTarget);
})) {
if (currentInput.isTouch) {
return;
}
if (instance2.state.isVisible && instance2.props.trigger.indexOf("click") >= 0) {
return;
}
} else {
invokeHook("onClickOutside", [instance2, event2]);
}
if (instance2.props.hideOnClick === true) {
instance2.clearDelayTimeouts();
instance2.hide();
didHideDueToDocumentMouseDown = true;
setTimeout(function() {
didHideDueToDocumentMouseDown = false;
});
if (!instance2.state.isMounted) {
removeDocumentPress();
}
}
}
function onTouchMove() {
didTouchMove = true;
}
function onTouchStart() {
didTouchMove = false;
}
function addDocumentPress() {
var doc = getDocument();
doc.addEventListener("mousedown", onDocumentPress, true);
doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
}
function removeDocumentPress() {
var doc = getDocument();
doc.removeEventListener("mousedown", onDocumentPress, true);
doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
}
function onTransitionedOut(duration2, callback) {
onTransitionEnd(duration2, function() {
if (!instance2.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) {
callback();
}
});
}
function onTransitionedIn(duration2, callback) {
onTransitionEnd(duration2, callback);
}
function onTransitionEnd(duration2, callback) {
var box = getDefaultTemplateChildren().box;
function listener2(event2) {
if (event2.target === box) {
updateTransitionEndListener(box, "remove", listener2);
callback();
}
}
if (duration2 === 0) {
return callback();
}
updateTransitionEndListener(box, "remove", currentTransitionEndListener);
updateTransitionEndListener(box, "add", listener2);
currentTransitionEndListener = listener2;
}
function on2(eventType, handler, options2) {
if (options2 === void 0) {
options2 = false;
}
var nodes = normalizeToArray(instance2.props.triggerTarget || reference2);
nodes.forEach(function(node2) {
node2.addEventListener(eventType, handler, options2);
listeners.push({
node: node2,
eventType,
handler,
options: options2
});
});
}
function addListeners() {
if (getIsCustomTouchBehavior()) {
on2("touchstart", onTrigger3, {
passive: true
});
on2("touchend", onMouseLeave, {
passive: true
});
}
splitBySpaces(instance2.props.trigger).forEach(function(eventType) {
if (eventType === "manual") {
return;
}
on2(eventType, onTrigger3);
switch (eventType) {
case "mouseenter":
on2("mouseleave", onMouseLeave);
break;
case "focus":
on2(isIE11 ? "focusout" : "blur", onBlurOrFocusOut);
break;
case "focusin":
on2("focusout", onBlurOrFocusOut);
break;
}
});
}
function removeListeners() {
listeners.forEach(function(_ref3) {
var node2 = _ref3.node, eventType = _ref3.eventType, handler = _ref3.handler, options2 = _ref3.options;
node2.removeEventListener(eventType, handler, options2);
});
listeners = [];
}
function onTrigger3(event2) {
var _lastTriggerEvent;
var shouldScheduleClickHide = false;
if (!instance2.state.isEnabled || isEventListenerStopped(event2) || didHideDueToDocumentMouseDown) {
return;
}
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
lastTriggerEvent = event2;
currentTarget = event2.currentTarget;
handleAriaExpandedAttribute();
if (!instance2.state.isVisible && isMouseEvent(event2)) {
mouseMoveListeners.forEach(function(listener2) {
return listener2(event2);
});
}
if (event2.type === "click" && (instance2.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance2.props.hideOnClick !== false && instance2.state.isVisible) {
shouldScheduleClickHide = true;
} else {
scheduleShow(event2);
}
if (event2.type === "click") {
isVisibleFromClick = !shouldScheduleClickHide;
}
if (shouldScheduleClickHide && !wasFocused) {
scheduleHide(event2);
}
}
function onMouseMove(event2) {
var target2 = event2.target;
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target2) || popper2.contains(target2);
if (event2.type === "mousemove" && isCursorOverReferenceOrPopper) {
return;
}
var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
var _instance$popperInsta;
var instance3 = popper3._tippy;
var state2 = (_instance$popperInsta = instance3.popperInstance) == null ? void 0 : _instance$popperInsta.state;
if (state2) {
return {
popperRect: popper3.getBoundingClientRect(),
popperState: state2,
props
};
}
return null;
}).filter(Boolean);
if (isCursorOutsideInteractiveBorder(popperTreeData, event2)) {
cleanupInteractiveMouseListeners();
scheduleHide(event2);
}
}
function onMouseLeave(event2) {
var shouldBail = isEventListenerStopped(event2) || instance2.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
if (shouldBail) {
return;
}
if (instance2.props.interactive) {
instance2.hideWithInteractivity(event2);
return;
}
scheduleHide(event2);
}
function onBlurOrFocusOut(event2) {
if (instance2.props.trigger.indexOf("focusin") < 0 && event2.target !== getCurrentTarget()) {
return;
}
if (instance2.props.interactive && event2.relatedTarget && popper2.contains(event2.relatedTarget)) {
return;
}
scheduleHide(event2);
}
function isEventListenerStopped(event2) {
return currentInput.isTouch ? getIsCustomTouchBehavior() !== event2.type.indexOf("touch") >= 0 : false;
}
function createPopperInstance() {
destroyPopperInstance();
var _instance$props2 = instance2.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition;
var arrow2 = getIsDefaultRenderFn() ? getChildren$1(popper2).arrow : null;
var computedReference = getReferenceClientRect ? {
getBoundingClientRect: getReferenceClientRect,
contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
} : reference2;
var tippyModifier = {
name: "$$tippy",
enabled: true,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: function fn8(_ref22) {
var state2 = _ref22.state;
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box;
["placement", "reference-hidden", "escaped"].forEach(function(attr2) {
if (attr2 === "placement") {
box.setAttribute("data-placement", state2.placement);
} else {
if (state2.attributes.popper["data-popper-" + attr2]) {
box.setAttribute("data-" + attr2, "");
} else {
box.removeAttribute("data-" + attr2);
}
}
});
state2.attributes.popper = {};
}
}
};
var modifiers = [{
name: "offset",
options: {
offset: offset2
}
}, {
name: "preventOverflow",
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}
}
}, {
name: "flip",
options: {
padding: 5
}
}, {
name: "computeStyles",
options: {
adaptive: !moveTransition
}
}, tippyModifier];
if (getIsDefaultRenderFn() && arrow2) {
modifiers.push({
name: "arrow",
options: {
element: arrow2,
padding: 3
}
});
}
modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
instance2.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, {
placement,
onFirstUpdate,
modifiers
}));
}
function destroyPopperInstance() {
if (instance2.popperInstance) {
instance2.popperInstance.destroy();
instance2.popperInstance = null;
}
}
function mount() {
var appendTo = instance2.props.appendTo;
var parentNode;
var node2 = getCurrentTarget();
if (instance2.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO2 || appendTo === "parent") {
parentNode = node2.parentNode;
} else {
parentNode = invokeWithArgsOrReturn(appendTo, [node2]);
}
if (!parentNode.contains(popper2)) {
parentNode.appendChild(popper2);
}
instance2.state.isMounted = true;
createPopperInstance();
}
function getNestedPopperTree() {
return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
}
function scheduleShow(event2) {
instance2.clearDelayTimeouts();
if (event2) {
invokeHook("onTrigger", [instance2, event2]);
}
addDocumentPress();
var delay = getDelay(true);
var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1];
if (currentInput.isTouch && touchValue === "hold" && touchDelay) {
delay = touchDelay;
}
if (delay) {
showTimeout = setTimeout(function() {
instance2.show();
}, delay);
} else {
instance2.show();
}
}
function scheduleHide(event2) {
instance2.clearDelayTimeouts();
invokeHook("onUntrigger", [instance2, event2]);
if (!instance2.state.isVisible) {
removeDocumentPress();
return;
}
if (instance2.props.trigger.indexOf("mouseenter") >= 0 && instance2.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event2.type) >= 0 && isVisibleFromClick) {
return;
}
var delay = getDelay(false);
if (delay) {
hideTimeout = setTimeout(function() {
if (instance2.state.isVisible) {
instance2.hide();
}
}, delay);
} else {
scheduleHideAnimationFrame = requestAnimationFrame(function() {
instance2.hide();
});
}
}
function enable() {
instance2.state.isEnabled = true;
}
function disable() {
instance2.hide();
instance2.state.isEnabled = false;
}
function clearDelayTimeouts() {
clearTimeout(showTimeout);
clearTimeout(hideTimeout);
cancelAnimationFrame(scheduleHideAnimationFrame);
}
function setProps(partialProps) {
if (instance2.state.isDestroyed) {
return;
}
invokeHook("onBeforeUpdate", [instance2, partialProps]);
removeListeners();
var prevProps = instance2.props;
var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
ignoreAttributes: true
}));
instance2.props = nextProps;
addListeners();
if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
cleanupInteractiveMouseListeners();
debouncedOnMouseMove = debounce$1(onMouseMove, nextProps.interactiveDebounce);
}
if (prevProps.triggerTarget && !nextProps.triggerTarget) {
normalizeToArray(prevProps.triggerTarget).forEach(function(node2) {
node2.removeAttribute("aria-expanded");
});
} else if (nextProps.triggerTarget) {
reference2.removeAttribute("aria-expanded");
}
handleAriaExpandedAttribute();
handleStyles();
if (onUpdate) {
onUpdate(prevProps, nextProps);
}
if (instance2.popperInstance) {
createPopperInstance();
getNestedPopperTree().forEach(function(nestedPopper) {
requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
});
}
invokeHook("onAfterUpdate", [instance2, partialProps]);
}
function setContent2(content2) {
instance2.setProps({
content: content2
});
}
function show() {
var isAlreadyVisible = instance2.state.isVisible;
var isDestroyed = instance2.state.isDestroyed;
var isDisabled = !instance2.state.isEnabled;
var isTouchAndTouchDisabled = currentInput.isTouch && !instance2.props.touch;
var duration2 = getValueAtIndexOrReturn(instance2.props.duration, 0, defaultProps$2.duration);
if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
return;
}
if (getCurrentTarget().hasAttribute("disabled")) {
return;
}
invokeHook("onShow", [instance2], false);
if (instance2.props.onShow(instance2) === false) {
return;
}
instance2.state.isVisible = true;
if (getIsDefaultRenderFn()) {
popper2.style.visibility = "visible";
}
handleStyles();
addDocumentPress();
if (!instance2.state.isMounted) {
popper2.style.transition = "none";
}
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content2 = _getDefaultTemplateCh2.content;
setTransitionDuration$1([box, content2], 0);
}
onFirstUpdate = function onFirstUpdate2() {
var _instance$popperInsta2;
if (!instance2.state.isVisible || ignoreOnFirstUpdate) {
return;
}
ignoreOnFirstUpdate = true;
void popper2.offsetHeight;
popper2.style.transition = instance2.props.moveTransition;
if (getIsDefaultRenderFn() && instance2.props.animation) {
var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content;
setTransitionDuration$1([_box, _content], duration2);
setVisibilityState([_box, _content], "visible");
}
handleAriaContentAttribute();
handleAriaExpandedAttribute();
pushIfUnique(mountedInstances, instance2);
(_instance$popperInsta2 = instance2.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
invokeHook("onMount", [instance2]);
if (instance2.props.animation && getIsDefaultRenderFn()) {
onTransitionedIn(duration2, function() {
instance2.state.isShown = true;
invokeHook("onShown", [instance2]);
});
}
};
mount();
}
function hide2() {
var isAlreadyHidden = !instance2.state.isVisible;
var isDestroyed = instance2.state.isDestroyed;
var isDisabled = !instance2.state.isEnabled;
var duration2 = getValueAtIndexOrReturn(instance2.props.duration, 1, defaultProps$2.duration);
if (isAlreadyHidden || isDestroyed || isDisabled) {
return;
}
invokeHook("onHide", [instance2], false);
if (instance2.props.onHide(instance2) === false) {
return;
}
instance2.state.isVisible = false;
instance2.state.isShown = false;
ignoreOnFirstUpdate = false;
isVisibleFromClick = false;
if (getIsDefaultRenderFn()) {
popper2.style.visibility = "hidden";
}
cleanupInteractiveMouseListeners();
removeDocumentPress();
handleStyles(true);
if (getIsDefaultRenderFn()) {
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content2 = _getDefaultTemplateCh4.content;
if (instance2.props.animation) {
setTransitionDuration$1([box, content2], duration2);
setVisibilityState([box, content2], "hidden");
}
}
handleAriaContentAttribute();
handleAriaExpandedAttribute();
if (instance2.props.animation) {
if (getIsDefaultRenderFn()) {
onTransitionedOut(duration2, instance2.unmount);
}
} else {
instance2.unmount();
}
}
function hideWithInteractivity(event2) {
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
debouncedOnMouseMove(event2);
}
function unmount() {
if (instance2.state.isVisible) {
instance2.hide();
}
if (!instance2.state.isMounted) {
return;
}
destroyPopperInstance();
getNestedPopperTree().forEach(function(nestedPopper) {
nestedPopper._tippy.unmount();
});
if (popper2.parentNode) {
popper2.parentNode.removeChild(popper2);
}
mountedInstances = mountedInstances.filter(function(i2) {
return i2 !== instance2;
});
instance2.state.isMounted = false;
invokeHook("onHidden", [instance2]);
}
function destroy() {
if (instance2.state.isDestroyed) {
return;
}
instance2.clearDelayTimeouts();
instance2.unmount();
removeListeners();
delete reference2._tippy;
instance2.state.isDestroyed = true;
invokeHook("onDestroy", [instance2]);
}
}
function tippy(targets, optionalProps) {
if (optionalProps === void 0) {
optionalProps = {};
}
var plugins = defaultProps$2.plugins.concat(optionalProps.plugins || []);
bindGlobalEventListeners();
var passedProps = Object.assign({}, optionalProps, {
plugins
});
var elements2 = getArrayOfElements(targets);
var instances = elements2.reduce(function(acc, reference2) {
var instance2 = reference2 && createTippy(reference2, passedProps);
if (instance2) {
acc.push(instance2);
}
return acc;
}, []);
return isElement(targets) ? instances[0] : instances;
}
tippy.defaultProps = defaultProps$2;
tippy.setDefaultProps = setDefaultProps2;
tippy.currentInput = currentInput;
var hideAll = function hideAll2(_temp) {
var _ref3 = _temp === void 0 ? {} : _temp, excludedReferenceOrInstance = _ref3.exclude, duration2 = _ref3.duration;
mountedInstances.forEach(function(instance2) {
var isExcluded = false;
if (excludedReferenceOrInstance) {
isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance2.reference === excludedReferenceOrInstance : instance2.popper === excludedReferenceOrInstance.popper;
}
if (!isExcluded) {
var originalDuration = instance2.props.duration;
instance2.setProps({
duration: duration2
});
instance2.hide();
if (!instance2.state.isDestroyed) {
instance2.setProps({
duration: originalDuration
});
}
}
});
};
var applyStylesModifier = Object.assign({}, applyStyles$1, {
effect: function effect3(_ref3) {
var state = _ref3.state;
var initialStyles = {
popper: {
position: state.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles = initialStyles;
if (state.elements.arrow) {
Object.assign(state.elements.arrow.style, initialStyles.arrow);
}
}
});
var createSingleton2 = function createSingleton3(tippyInstances, optionalProps) {
var _optionalProps$popper;
if (optionalProps === void 0) {
optionalProps = {};
}
var individualInstances = tippyInstances;
var references = [];
var triggerTargets = [];
var currentTarget;
var overrides = optionalProps.overrides;
var interceptSetPropsCleanups = [];
var shownOnCreate = false;
function setTriggerTargets() {
triggerTargets = individualInstances.map(function(instance2) {
return normalizeToArray(instance2.props.triggerTarget || instance2.reference);
}).reduce(function(acc, item) {
return acc.concat(item);
}, []);
}
function setReferences() {
references = individualInstances.map(function(instance2) {
return instance2.reference;
});
}
function enableInstances(isEnabled) {
individualInstances.forEach(function(instance2) {
if (isEnabled) {
instance2.enable();
} else {
instance2.disable();
}
});
}
function interceptSetProps(singleton3) {
return individualInstances.map(function(instance2) {
var originalSetProps2 = instance2.setProps;
instance2.setProps = function(props) {
originalSetProps2(props);
if (instance2.reference === currentTarget) {
singleton3.setProps(props);
}
};
return function() {
instance2.setProps = originalSetProps2;
};
});
}
function prepareInstance(singleton3, target2) {
var index2 = triggerTargets.indexOf(target2);
if (target2 === currentTarget) {
return;
}
currentTarget = target2;
var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) {
acc[prop] = individualInstances[index2].props[prop];
return acc;
}, {});
singleton3.setProps(Object.assign({}, overrideProps, {
getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() {
var _references$index;
return (_references$index = references[index2]) == null ? void 0 : _references$index.getBoundingClientRect();
}
}));
}
enableInstances(false);
setReferences();
setTriggerTargets();
var plugin = {
fn: function fn8() {
return {
onDestroy: function onDestroy3() {
enableInstances(true);
},
onHidden: function onHidden3() {
currentTarget = null;
},
onClickOutside: function onClickOutside3(instance2) {
if (instance2.props.showOnCreate && !shownOnCreate) {
shownOnCreate = true;
currentTarget = null;
}
},
onShow: function onShow3(instance2) {
if (instance2.props.showOnCreate && !shownOnCreate) {
shownOnCreate = true;
prepareInstance(instance2, references[0]);
}
},
onTrigger: function onTrigger3(instance2, event2) {
prepareInstance(instance2, event2.currentTarget);
}
};
}
};
var singleton2 = tippy(div(), Object.assign({}, removeProperties(optionalProps, ["overrides"]), {
plugins: [plugin].concat(optionalProps.plugins || []),
triggerTarget: triggerTargets,
popperOptions: Object.assign({}, optionalProps.popperOptions, {
modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
})
}));
var originalShow = singleton2.show;
singleton2.show = function(target2) {
originalShow();
if (!currentTarget && target2 == null) {
return prepareInstance(singleton2, references[0]);
}
if (currentTarget && target2 == null) {
return;
}
if (typeof target2 === "number") {
return references[target2] && prepareInstance(singleton2, references[target2]);
}
if (individualInstances.indexOf(target2) >= 0) {
var ref2 = target2.reference;
return prepareInstance(singleton2, ref2);
}
if (references.indexOf(target2) >= 0) {
return prepareInstance(singleton2, target2);
}
};
singleton2.showNext = function() {
var first = references[0];
if (!currentTarget) {
return singleton2.show(0);
}
var index2 = references.indexOf(currentTarget);
singleton2.show(references[index2 + 1] || first);
};
singleton2.showPrevious = function() {
var last = references[references.length - 1];
if (!currentTarget) {
return singleton2.show(last);
}
var index2 = references.indexOf(currentTarget);
var target2 = references[index2 - 1] || last;
singleton2.show(target2);
};
var originalSetProps = singleton2.setProps;
singleton2.setProps = function(props) {
overrides = props.overrides || overrides;
originalSetProps(props);
};
singleton2.setInstances = function(nextInstances) {
enableInstances(true);
interceptSetPropsCleanups.forEach(function(fn8) {
return fn8();
});
individualInstances = nextInstances;
enableInstances(false);
setReferences();
setTriggerTargets();
interceptSetPropsCleanups = interceptSetProps(singleton2);
singleton2.setProps({
triggerTarget: triggerTargets
});
};
interceptSetPropsCleanups = interceptSetProps(singleton2);
return singleton2;
};
var BUBBLING_EVENTS_MAP = {
mouseover: "mouseenter",
focusin: "focus",
click: "click"
};
function delegate(targets, props) {
var listeners = [];
var childTippyInstances = [];
var disabled = false;
var target2 = props.target;
var nativeProps = removeProperties(props, ["target"]);
var parentProps = Object.assign({}, nativeProps, {
trigger: "manual",
touch: false
});
var childProps = Object.assign({
touch: defaultProps$2.touch
}, nativeProps, {
showOnCreate: true
});
var returnValue = tippy(targets, parentProps);
var normalizedReturnValue = normalizeToArray(returnValue);
function onTrigger3(event2) {
if (!event2.target || disabled) {
return;
}
var targetNode = event2.target.closest(target2);
if (!targetNode) {
return;
}
var trigger = targetNode.getAttribute("data-tippy-trigger") || props.trigger || defaultProps$2.trigger;
if (targetNode._tippy) {
return;
}
if (event2.type === "touchstart" && typeof childProps.touch === "boolean") {
return;
}
if (event2.type !== "touchstart" && trigger.indexOf(BUBBLING_EVENTS_MAP[event2.type]) < 0) {
return;
}
var instance2 = tippy(targetNode, childProps);
if (instance2) {
childTippyInstances = childTippyInstances.concat(instance2);
}
}
function on2(node2, eventType, handler, options2) {
if (options2 === void 0) {
options2 = false;
}
node2.addEventListener(eventType, handler, options2);
listeners.push({
node: node2,
eventType,
handler,
options: options2
});
}
function addEventListeners(instance2) {
var reference2 = instance2.reference;
on2(reference2, "touchstart", onTrigger3, TOUCH_OPTIONS);
on2(reference2, "mouseover", onTrigger3);
on2(reference2, "focusin", onTrigger3);
on2(reference2, "click", onTrigger3);
}
function removeEventListeners() {
listeners.forEach(function(_ref3) {
var node2 = _ref3.node, eventType = _ref3.eventType, handler = _ref3.handler, options2 = _ref3.options;
node2.removeEventListener(eventType, handler, options2);
});
listeners = [];
}
function applyMutations(instance2) {
var originalDestroy = instance2.destroy;
var originalEnable = instance2.enable;
var originalDisable = instance2.disable;
instance2.destroy = function(shouldDestroyChildInstances) {
if (shouldDestroyChildInstances === void 0) {
shouldDestroyChildInstances = true;
}
if (shouldDestroyChildInstances) {
childTippyInstances.forEach(function(instance3) {
instance3.destroy();
});
}
childTippyInstances = [];
removeEventListeners();
originalDestroy();
};
instance2.enable = function() {
originalEnable();
childTippyInstances.forEach(function(instance3) {
return instance3.enable();
});
disabled = false;
};
instance2.disable = function() {
originalDisable();
childTippyInstances.forEach(function(instance3) {
return instance3.disable();
});
disabled = true;
};
addEventListeners(instance2);
}
normalizedReturnValue.forEach(applyMutations);
return returnValue;
}
var animateFill = {
name: "animateFill",
defaultValue: false,
fn: function fn3(instance2) {
var _instance$props$rende;
if (!((_instance$props$rende = instance2.props.render) != null && _instance$props$rende.$$tippy)) {
return {};
}
var _getChildren = getChildren$1(instance2.popper), box = _getChildren.box, content2 = _getChildren.content;
var backdrop = instance2.props.animateFill ? createBackdropElement() : null;
return {
onCreate: function onCreate3() {
if (backdrop) {
box.insertBefore(backdrop, box.firstElementChild);
box.setAttribute("data-animatefill", "");
box.style.overflow = "hidden";
instance2.setProps({
arrow: false,
animation: "shift-away"
});
}
},
onMount: function onMount3() {
if (backdrop) {
var transitionDuration = box.style.transitionDuration;
var duration2 = Number(transitionDuration.replace("ms", ""));
content2.style.transitionDelay = Math.round(duration2 / 10) + "ms";
backdrop.style.transitionDuration = transitionDuration;
setVisibilityState([backdrop], "visible");
}
},
onShow: function onShow3() {
if (backdrop) {
backdrop.style.transitionDuration = "0ms";
}
},
onHide: function onHide3() {
if (backdrop) {
setVisibilityState([backdrop], "hidden");
}
}
};
}
};
function createBackdropElement() {
var backdrop = div();
backdrop.className = BACKDROP_CLASS;
setVisibilityState([backdrop], "hidden");
return backdrop;
}
var mouseCoords = {
clientX: 0,
clientY: 0
};
var activeInstances = [];
function storeMouseCoords(_ref3) {
var clientX = _ref3.clientX, clientY = _ref3.clientY;
mouseCoords = {
clientX,
clientY
};
}
function addMouseCoordsListener(doc) {
doc.addEventListener("mousemove", storeMouseCoords);
}
function removeMouseCoordsListener(doc) {
doc.removeEventListener("mousemove", storeMouseCoords);
}
var followCursor = {
name: "followCursor",
defaultValue: false,
fn: function fn4(instance2) {
var reference2 = instance2.reference;
var doc = getOwnerDocument$1(instance2.props.triggerTarget || reference2);
var isInternalUpdate = false;
var wasFocusEvent = false;
var isUnmounted = true;
var prevProps = instance2.props;
function getIsInitialBehavior() {
return instance2.props.followCursor === "initial" && instance2.state.isVisible;
}
function addListener() {
doc.addEventListener("mousemove", onMouseMove);
}
function removeListener() {
doc.removeEventListener("mousemove", onMouseMove);
}
function unsetGetReferenceClientRect() {
isInternalUpdate = true;
instance2.setProps({
getReferenceClientRect: null
});
isInternalUpdate = false;
}
function onMouseMove(event2) {
var isCursorOverReference = event2.target ? reference2.contains(event2.target) : true;
var followCursor2 = instance2.props.followCursor;
var clientX = event2.clientX, clientY = event2.clientY;
var rect2 = reference2.getBoundingClientRect();
var relativeX = clientX - rect2.left;
var relativeY = clientY - rect2.top;
if (isCursorOverReference || !instance2.props.interactive) {
instance2.setProps({
// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect: function getReferenceClientRect() {
var rect3 = reference2.getBoundingClientRect();
var x2 = clientX;
var y2 = clientY;
if (followCursor2 === "initial") {
x2 = rect3.left + relativeX;
y2 = rect3.top + relativeY;
}
var top2 = followCursor2 === "horizontal" ? rect3.top : y2;
var right2 = followCursor2 === "vertical" ? rect3.right : x2;
var bottom2 = followCursor2 === "horizontal" ? rect3.bottom : y2;
var left2 = followCursor2 === "vertical" ? rect3.left : x2;
return {
width: right2 - left2,
height: bottom2 - top2,
top: top2,
right: right2,
bottom: bottom2,
left: left2
};
}
});
}
}
function create4() {
if (instance2.props.followCursor) {
activeInstances.push({
instance: instance2,
doc
});
addMouseCoordsListener(doc);
}
}
function destroy() {
activeInstances = activeInstances.filter(function(data2) {
return data2.instance !== instance2;
});
if (activeInstances.filter(function(data2) {
return data2.doc === doc;
}).length === 0) {
removeMouseCoordsListener(doc);
}
}
return {
onCreate: create4,
onDestroy: destroy,
onBeforeUpdate: function onBeforeUpdate3() {
prevProps = instance2.props;
},
onAfterUpdate: function onAfterUpdate3(_24, _ref22) {
var followCursor2 = _ref22.followCursor;
if (isInternalUpdate) {
return;
}
if (followCursor2 !== void 0 && prevProps.followCursor !== followCursor2) {
destroy();
if (followCursor2) {
create4();
if (instance2.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {
addListener();
}
} else {
removeListener();
unsetGetReferenceClientRect();
}
}
},
onMount: function onMount3() {
if (instance2.props.followCursor && !wasFocusEvent) {
if (isUnmounted) {
onMouseMove(mouseCoords);
isUnmounted = false;
}
if (!getIsInitialBehavior()) {
addListener();
}
}
},
onTrigger: function onTrigger3(_24, event2) {
if (isMouseEvent(event2)) {
mouseCoords = {
clientX: event2.clientX,
clientY: event2.clientY
};
}
wasFocusEvent = event2.type === "focus";
},
onHidden: function onHidden3() {
if (instance2.props.followCursor) {
unsetGetReferenceClientRect();
removeListener();
isUnmounted = true;
}
}
};
}
};
function getProps(props, modifier) {
var _props$popperOptions;
return {
popperOptions: Object.assign({}, props.popperOptions, {
modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function(_ref3) {
var name = _ref3.name;
return name !== modifier.name;
}), [modifier])
})
};
}
var inlinePositioning = {
name: "inlinePositioning",
defaultValue: false,
fn: function fn5(instance2) {
var reference2 = instance2.reference;
function isEnabled() {
return !!instance2.props.inlinePositioning;
}
var placement;
var cursorRectIndex = -1;
var isInternalUpdate = false;
var triedPlacements = [];
var modifier = {
name: "tippyInlinePositioning",
enabled: true,
phase: "afterWrite",
fn: function fn8(_ref22) {
var state = _ref22.state;
if (isEnabled()) {
if (triedPlacements.indexOf(state.placement) !== -1) {
triedPlacements = [];
}
if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
triedPlacements.push(state.placement);
instance2.setProps({
// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect: function getReferenceClientRect() {
return _getReferenceClientRect(state.placement);
}
});
}
placement = state.placement;
}
}
};
function _getReferenceClientRect(placement2) {
return getInlineBoundingClientRect(getBasePlacement(placement2), reference2.getBoundingClientRect(), arrayFrom(reference2.getClientRects()), cursorRectIndex);
}
function setInternalProps(partialProps) {
isInternalUpdate = true;
instance2.setProps(partialProps);
isInternalUpdate = false;
}
function addModifier() {
if (!isInternalUpdate) {
setInternalProps(getProps(instance2.props, modifier));
}
}
return {
onCreate: addModifier,
onAfterUpdate: addModifier,
onTrigger: function onTrigger3(_24, event2) {
if (isMouseEvent(event2)) {
var rects = arrayFrom(instance2.reference.getClientRects());
var cursorRect = rects.find(function(rect2) {
return rect2.left - 2 <= event2.clientX && rect2.right + 2 >= event2.clientX && rect2.top - 2 <= event2.clientY && rect2.bottom + 2 >= event2.clientY;
});
var index2 = rects.indexOf(cursorRect);
cursorRectIndex = index2 > -1 ? index2 : cursorRectIndex;
}
},
onHidden: function onHidden3() {
cursorRectIndex = -1;
}
};
}
};
function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) {
if (clientRects.length < 2 || currentBasePlacement === null) {
return boundingRect;
}
if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) {
return clientRects[cursorRectIndex] || boundingRect;
}
switch (currentBasePlacement) {
case "top":
case "bottom": {
var firstRect = clientRects[0];
var lastRect = clientRects[clientRects.length - 1];
var isTop = currentBasePlacement === "top";
var top2 = firstRect.top;
var bottom2 = lastRect.bottom;
var left2 = isTop ? firstRect.left : lastRect.left;
var right2 = isTop ? firstRect.right : lastRect.right;
var width2 = right2 - left2;
var height2 = bottom2 - top2;
return {
top: top2,
bottom: bottom2,
left: left2,
right: right2,
width: width2,
height: height2
};
}
case "left":
case "right": {
var minLeft = Math.min.apply(Math, clientRects.map(function(rects) {
return rects.left;
}));
var maxRight = Math.max.apply(Math, clientRects.map(function(rects) {
return rects.right;
}));
var measureRects = clientRects.filter(function(rect2) {
return currentBasePlacement === "left" ? rect2.left === minLeft : rect2.right === maxRight;
});
var _top = measureRects[0].top;
var _bottom = measureRects[measureRects.length - 1].bottom;
var _left = minLeft;
var _right = maxRight;
var _width = _right - _left;
var _height = _bottom - _top;
return {
top: _top,
bottom: _bottom,
left: _left,
right: _right,
width: _width,
height: _height
};
}
default: {
return boundingRect;
}
}
}
var sticky = {
name: "sticky",
defaultValue: false,
fn: function fn6(instance2) {
var reference2 = instance2.reference, popper2 = instance2.popper;
function getReference() {
return instance2.popperInstance ? instance2.popperInstance.state.elements.reference : reference2;
}
function shouldCheck(value2) {
return instance2.props.sticky === true || instance2.props.sticky === value2;
}
var prevRefRect = null;
var prevPopRect = null;
function updatePosition() {
var currentRefRect = shouldCheck("reference") ? getReference().getBoundingClientRect() : null;
var currentPopRect = shouldCheck("popper") ? popper2.getBoundingClientRect() : null;
if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {
if (instance2.popperInstance) {
instance2.popperInstance.update();
}
}
prevRefRect = currentRefRect;
prevPopRect = currentPopRect;
if (instance2.state.isMounted) {
requestAnimationFrame(updatePosition);
}
}
return {
onMount: function onMount3() {
if (instance2.props.sticky) {
updatePosition();
}
}
};
}
};
function areRectsDifferent(rectA, rectB) {
if (rectA && rectB) {
return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;
}
return true;
}
tippy.setDefaultProps({
render: render2
});
const tippy_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
animateFill,
createSingleton: createSingleton2,
default: tippy,
delegate,
followCursor,
hideAll,
inlinePositioning,
roundArrow: ROUND_ARROW,
sticky
}, Symbol.toStringTag, { value: "Module" }));
const require$$6 = /* @__PURE__ */ getAugmentedNamespace(tippy_esm);
var _arrayEach;
var hasRequired_arrayEach;
function require_arrayEach() {
if (hasRequired_arrayEach)
return _arrayEach;
hasRequired_arrayEach = 1;
function arrayEach(array2, iteratee) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length;
while (++index2 < length2) {
if (iteratee(array2[index2], index2, array2) === false) {
break;
}
}
return array2;
}
_arrayEach = arrayEach;
return _arrayEach;
}
var _baseAssign;
var hasRequired_baseAssign;
function require_baseAssign() {
if (hasRequired_baseAssign)
return _baseAssign;
hasRequired_baseAssign = 1;
var copyObject = require_copyObject(), keys3 = requireKeys();
function baseAssign(object2, source2) {
return object2 && copyObject(source2, keys3(source2), object2);
}
_baseAssign = baseAssign;
return _baseAssign;
}
var _baseAssignIn;
var hasRequired_baseAssignIn;
function require_baseAssignIn() {
if (hasRequired_baseAssignIn)
return _baseAssignIn;
hasRequired_baseAssignIn = 1;
var copyObject = require_copyObject(), keysIn2 = requireKeysIn();
function baseAssignIn(object2, source2) {
return object2 && copyObject(source2, keysIn2(source2), object2);
}
_baseAssignIn = baseAssignIn;
return _baseAssignIn;
}
var _copySymbols;
var hasRequired_copySymbols;
function require_copySymbols() {
if (hasRequired_copySymbols)
return _copySymbols;
hasRequired_copySymbols = 1;
var copyObject = require_copyObject(), getSymbols2 = require_getSymbols();
function copySymbols(source2, object2) {
return copyObject(source2, getSymbols2(source2), object2);
}
_copySymbols = copySymbols;
return _copySymbols;
}
var _copySymbolsIn;
var hasRequired_copySymbolsIn;
function require_copySymbolsIn() {
if (hasRequired_copySymbolsIn)
return _copySymbolsIn;
hasRequired_copySymbolsIn = 1;
var copyObject = require_copyObject(), getSymbolsIn2 = require_getSymbolsIn();
function copySymbolsIn(source2, object2) {
return copyObject(source2, getSymbolsIn2(source2), object2);
}
_copySymbolsIn = copySymbolsIn;
return _copySymbolsIn;
}
var _initCloneArray;
var hasRequired_initCloneArray;
function require_initCloneArray() {
if (hasRequired_initCloneArray)
return _initCloneArray;
hasRequired_initCloneArray = 1;
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
function initCloneArray(array2) {
var length2 = array2.length, result = new array2.constructor(length2);
if (length2 && typeof array2[0] == "string" && hasOwnProperty2.call(array2, "index")) {
result.index = array2.index;
result.input = array2.input;
}
return result;
}
_initCloneArray = initCloneArray;
return _initCloneArray;
}
var _cloneDataView;
var hasRequired_cloneDataView;
function require_cloneDataView() {
if (hasRequired_cloneDataView)
return _cloneDataView;
hasRequired_cloneDataView = 1;
var cloneArrayBuffer = require_cloneArrayBuffer();
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
_cloneDataView = cloneDataView;
return _cloneDataView;
}
var _cloneRegExp;
var hasRequired_cloneRegExp;
function require_cloneRegExp() {
if (hasRequired_cloneRegExp)
return _cloneRegExp;
hasRequired_cloneRegExp = 1;
var reFlags = /\w*$/;
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
_cloneRegExp = cloneRegExp;
return _cloneRegExp;
}
var _cloneSymbol;
var hasRequired_cloneSymbol;
function require_cloneSymbol() {
if (hasRequired_cloneSymbol)
return _cloneSymbol;
hasRequired_cloneSymbol = 1;
var Symbol2 = require_Symbol();
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
function cloneSymbol(symbol2) {
return symbolValueOf ? Object(symbolValueOf.call(symbol2)) : {};
}
_cloneSymbol = cloneSymbol;
return _cloneSymbol;
}
var _initCloneByTag;
var hasRequired_initCloneByTag;
function require_initCloneByTag() {
if (hasRequired_initCloneByTag)
return _initCloneByTag;
hasRequired_initCloneByTag = 1;
var cloneArrayBuffer = require_cloneArrayBuffer(), cloneDataView = require_cloneDataView(), cloneRegExp = require_cloneRegExp(), cloneSymbol = require_cloneSymbol(), cloneTypedArray = require_cloneTypedArray();
var boolTag = "[object Boolean]", dateTag = "[object Date]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag2 = "[object Symbol]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
function initCloneByTag(object2, tag, isDeep) {
var Ctor = object2.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object2);
case boolTag:
case dateTag:
return new Ctor(+object2);
case dataViewTag:
return cloneDataView(object2, isDeep);
case float32Tag:
case float64Tag:
case int8Tag:
case int16Tag:
case int32Tag:
case uint8Tag:
case uint8ClampedTag:
case uint16Tag:
case uint32Tag:
return cloneTypedArray(object2, isDeep);
case mapTag:
return new Ctor();
case numberTag:
case stringTag:
return new Ctor(object2);
case regexpTag:
return cloneRegExp(object2);
case setTag:
return new Ctor();
case symbolTag2:
return cloneSymbol(object2);
}
}
_initCloneByTag = initCloneByTag;
return _initCloneByTag;
}
var _baseIsMap;
var hasRequired_baseIsMap;
function require_baseIsMap() {
if (hasRequired_baseIsMap)
return _baseIsMap;
hasRequired_baseIsMap = 1;
var getTag = require_getTag(), isObjectLike2 = requireIsObjectLike();
var mapTag = "[object Map]";
function baseIsMap(value2) {
return isObjectLike2(value2) && getTag(value2) == mapTag;
}
_baseIsMap = baseIsMap;
return _baseIsMap;
}
var isMap_1;
var hasRequiredIsMap;
function requireIsMap() {
if (hasRequiredIsMap)
return isMap_1;
hasRequiredIsMap = 1;
var baseIsMap = require_baseIsMap(), baseUnary2 = require_baseUnary(), nodeUtil = require_nodeUtil();
var nodeIsMap = nodeUtil && nodeUtil.isMap;
var isMap = nodeIsMap ? baseUnary2(nodeIsMap) : baseIsMap;
isMap_1 = isMap;
return isMap_1;
}
var _baseIsSet;
var hasRequired_baseIsSet;
function require_baseIsSet() {
if (hasRequired_baseIsSet)
return _baseIsSet;
hasRequired_baseIsSet = 1;
var getTag = require_getTag(), isObjectLike2 = requireIsObjectLike();
var setTag = "[object Set]";
function baseIsSet(value2) {
return isObjectLike2(value2) && getTag(value2) == setTag;
}
_baseIsSet = baseIsSet;
return _baseIsSet;
}
var isSet_1;
var hasRequiredIsSet;
function requireIsSet() {
if (hasRequiredIsSet)
return isSet_1;
hasRequiredIsSet = 1;
var baseIsSet = require_baseIsSet(), baseUnary2 = require_baseUnary(), nodeUtil = require_nodeUtil();
var nodeIsSet = nodeUtil && nodeUtil.isSet;
var isSet = nodeIsSet ? baseUnary2(nodeIsSet) : baseIsSet;
isSet_1 = isSet;
return isSet_1;
}
var _baseClone;
var hasRequired_baseClone;
function require_baseClone() {
if (hasRequired_baseClone)
return _baseClone;
hasRequired_baseClone = 1;
var Stack2 = require_Stack(), arrayEach = require_arrayEach(), assignValue = require_assignValue(), baseAssign = require_baseAssign(), baseAssignIn = require_baseAssignIn(), cloneBuffer = require_cloneBuffer(), copyArray = require_copyArray(), copySymbols = require_copySymbols(), copySymbolsIn = require_copySymbolsIn(), getAllKeys = require_getAllKeys(), getAllKeysIn2 = require_getAllKeysIn(), getTag = require_getTag(), initCloneArray = require_initCloneArray(), initCloneByTag = require_initCloneByTag(), initCloneObject = require_initCloneObject(), isArray3 = requireIsArray(), isBuffer2 = requireIsBuffer(), isMap = requireIsMap(), isObject2 = requireIsObject(), isSet = requireIsSet(), keys3 = requireKeys(), keysIn2 = requireKeysIn();
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
var argsTag2 = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag2 = "[object Function]", genTag2 = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag2 = "[object Symbol]", weakMapTag = "[object WeakMap]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
var cloneableTags = {};
cloneableTags[argsTag2] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag2] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag2] = cloneableTags[weakMapTag] = false;
function baseClone(value2, bitmask, customizer, key2, object2, stack) {
var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object2 ? customizer(value2, key2, object2, stack) : customizer(value2);
}
if (result !== void 0) {
return result;
}
if (!isObject2(value2)) {
return value2;
}
var isArr = isArray3(value2);
if (isArr) {
result = initCloneArray(value2);
if (!isDeep) {
return copyArray(value2, result);
}
} else {
var tag = getTag(value2), isFunc = tag == funcTag2 || tag == genTag2;
if (isBuffer2(value2)) {
return cloneBuffer(value2, isDeep);
}
if (tag == objectTag || tag == argsTag2 || isFunc && !object2) {
result = isFlat || isFunc ? {} : initCloneObject(value2);
if (!isDeep) {
return isFlat ? copySymbolsIn(value2, baseAssignIn(result, value2)) : copySymbols(value2, baseAssign(result, value2));
}
} else {
if (!cloneableTags[tag]) {
return object2 ? value2 : {};
}
result = initCloneByTag(value2, tag, isDeep);
}
}
stack || (stack = new Stack2());
var stacked = stack.get(value2);
if (stacked) {
return stacked;
}
stack.set(value2, result);
if (isSet(value2)) {
value2.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack));
});
} else if (isMap(value2)) {
value2.forEach(function(subValue, key3) {
result.set(key3, baseClone(subValue, bitmask, customizer, key3, value2, stack));
});
}
var keysFunc = isFull ? isFlat ? getAllKeysIn2 : getAllKeys : isFlat ? keysIn2 : keys3;
var props = isArr ? void 0 : keysFunc(value2);
arrayEach(props || value2, function(subValue, key3) {
if (props) {
key3 = subValue;
subValue = value2[key3];
}
assignValue(result, key3, baseClone(subValue, bitmask, customizer, key3, value2, stack));
});
return result;
}
_baseClone = baseClone;
return _baseClone;
}
var cloneDeep_1;
var hasRequiredCloneDeep;
function requireCloneDeep() {
if (hasRequiredCloneDeep)
return cloneDeep_1;
hasRequiredCloneDeep = 1;
var baseClone = require_baseClone();
var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
function cloneDeep(value2) {
return baseClone(value2, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
cloneDeep_1 = cloneDeep;
return cloneDeep_1;
}
var reactToastify = {};
function r$n(e7) {
var t5, f2, n2 = "";
if ("string" == typeof e7 || "number" == typeof e7)
n2 += e7;
else if ("object" == typeof e7)
if (Array.isArray(e7))
for (t5 = 0; t5 < e7.length; t5++)
e7[t5] && (f2 = r$n(e7[t5])) && (n2 && (n2 += " "), n2 += f2);
else
for (t5 in e7)
e7[t5] && (n2 && (n2 += " "), n2 += t5);
return n2;
}
function clsx() {
for (var e7, t5, f2 = 0, n2 = ""; f2 < arguments.length; )
(e7 = arguments[f2++]) && (t5 = r$n(e7)) && (n2 && (n2 += " "), n2 += t5);
return n2;
}
const clsx_m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
clsx,
default: clsx
}, Symbol.toStringTag, { value: "Module" }));
const require$$2$1 = /* @__PURE__ */ getAugmentedNamespace(clsx_m);
var hasRequiredReactToastify;
function requireReactToastify() {
if (hasRequiredReactToastify)
return reactToastify;
hasRequiredReactToastify = 1;
var e7 = reactExports, t5 = require$$2$1;
function n2(e8) {
return e8 && "object" == typeof e8 && "default" in e8 ? e8 : { default: e8 };
}
var o2 = /* @__PURE__ */ n2(e7), s2 = /* @__PURE__ */ n2(t5);
const a2 = (e8) => "number" == typeof e8 && !isNaN(e8), r2 = (e8) => "string" == typeof e8, i2 = (e8) => "function" == typeof e8, l2 = (e8) => r2(e8) || i2(e8) ? e8 : null, c2 = (t6) => e7.isValidElement(t6) || r2(t6) || i2(t6) || a2(t6);
function u2(e8, t6, n3) {
void 0 === n3 && (n3 = 300);
const { scrollHeight: o3, style: s3 } = e8;
requestAnimationFrame(() => {
s3.minHeight = "initial", s3.height = o3 + "px", s3.transition = `all ${n3}ms`, requestAnimationFrame(() => {
s3.height = "0", s3.padding = "0", s3.margin = "0", setTimeout(t6, n3);
});
});
}
function d2(t6) {
let { enter: n3, exit: s3, appendPosition: a3 = false, collapse: r3 = true, collapseDuration: i3 = 300 } = t6;
return function(t7) {
let { children: l3, position: c3, preventExitTransition: d3, done: f3, nodeRef: p3, isIn: m3 } = t7;
const g3 = a3 ? `${n3}--${c3}` : n3, h3 = a3 ? `${s3}--${c3}` : s3, y3 = e7.useRef(0);
return e7.useLayoutEffect(() => {
const e8 = p3.current, t8 = g3.split(" "), n4 = (o3) => {
o3.target === p3.current && (e8.dispatchEvent(new Event("d")), e8.removeEventListener("animationend", n4), e8.removeEventListener("animationcancel", n4), 0 === y3.current && "animationcancel" !== o3.type && e8.classList.remove(...t8));
};
e8.classList.add(...t8), e8.addEventListener("animationend", n4), e8.addEventListener("animationcancel", n4);
}, []), e7.useEffect(() => {
const e8 = p3.current, t8 = () => {
e8.removeEventListener("animationend", t8), r3 ? u2(e8, f3, i3) : f3();
};
m3 || (d3 ? t8() : (y3.current = 1, e8.className += ` ${h3}`, e8.addEventListener("animationend", t8)));
}, [m3]), o2.default.createElement(o2.default.Fragment, null, l3);
};
}
function f2(e8, t6) {
return null != e8 ? { content: e8.content, containerId: e8.props.containerId, id: e8.props.toastId, theme: e8.props.theme, type: e8.props.type, data: e8.props.data || {}, isLoading: e8.props.isLoading, icon: e8.props.icon, status: t6 } : {};
}
const p2 = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e8, t6) {
return this.list.has(e8) || this.list.set(e8, []), this.list.get(e8).push(t6), this;
}, off(e8, t6) {
if (t6) {
const n3 = this.list.get(e8).filter((e9) => e9 !== t6);
return this.list.set(e8, n3), this;
}
return this.list.delete(e8), this;
}, cancelEmit(e8) {
const t6 = this.emitQueue.get(e8);
return t6 && (t6.forEach(clearTimeout), this.emitQueue.delete(e8)), this;
}, emit(e8) {
this.list.has(e8) && this.list.get(e8).forEach((t6) => {
const n3 = setTimeout(() => {
t6(...[].slice.call(arguments, 1));
}, 0);
this.emitQueue.has(e8) || this.emitQueue.set(e8, []), this.emitQueue.get(e8).push(n3);
});
} }, m2 = (e8) => {
let { theme: t6, type: n3, ...s3 } = e8;
return o2.default.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: "colored" === t6 ? "currentColor" : `var(--toastify-icon-color-${n3})`, ...s3 });
}, g2 = { info: function(e8) {
return o2.default.createElement(m2, { ...e8 }, o2.default.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
}, warning: function(e8) {
return o2.default.createElement(m2, { ...e8 }, o2.default.createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" }));
}, success: function(e8) {
return o2.default.createElement(m2, { ...e8 }, o2.default.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }));
}, error: function(e8) {
return o2.default.createElement(m2, { ...e8 }, o2.default.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
}, spinner: function() {
return o2.default.createElement("div", { className: "Toastify__spinner" });
} };
function h2(t6) {
const [, n3] = e7.useReducer((e8) => e8 + 1, 0), [o3, s3] = e7.useState([]), u3 = e7.useRef(null), d3 = e7.useRef(/* @__PURE__ */ new Map()).current, m3 = (e8) => -1 !== o3.indexOf(e8), h3 = e7.useRef({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: t6, containerId: null, isToastActive: m3, getToast: (e8) => d3.get(e8) }).current;
function y3(e8) {
let { containerId: t7 } = e8;
const { limit: n4 } = h3.props;
!n4 || t7 && h3.containerId !== t7 || (h3.count -= h3.queue.length, h3.queue = []);
}
function v3(e8) {
s3((t7) => null == e8 ? [] : t7.filter((t8) => t8 !== e8));
}
function T3() {
const { toastContent: e8, toastProps: t7, staleId: n4 } = h3.queue.shift();
C4(e8, t7, n4);
}
function E3(t7, o4) {
let { delay: s4, staleId: m4, ...y4 } = o4;
if (!c2(t7) || function(e8) {
return !u3.current || h3.props.enableMultiContainer && e8.containerId !== h3.props.containerId || d3.has(e8.toastId) && null == e8.updateId;
}(y4))
return;
const { toastId: E4, updateId: b3, data: I3 } = y4, { props: _25 } = h3, L3 = () => v3(E4), O3 = null == b3;
O3 && h3.count++;
const N3 = { ..._25, style: _25.toastStyle, key: h3.toastKey++, ...Object.fromEntries(Object.entries(y4).filter((e8) => {
let [t8, n4] = e8;
return null != n4;
})), toastId: E4, updateId: b3, data: I3, closeToast: L3, isIn: false, className: l2(y4.className || _25.toastClassName), bodyClassName: l2(y4.bodyClassName || _25.bodyClassName), progressClassName: l2(y4.progressClassName || _25.progressClassName), autoClose: !y4.isLoading && (x3 = y4.autoClose, R3 = _25.autoClose, false === x3 || a2(x3) && x3 > 0 ? x3 : R3), deleteToast() {
const e8 = f2(d3.get(E4), "removed");
d3.delete(E4), p2.emit(4, e8);
const t8 = h3.queue.length;
if (h3.count = null == E4 ? h3.count - h3.displayedToast : h3.count - 1, h3.count < 0 && (h3.count = 0), t8 > 0) {
const e9 = null == E4 ? h3.props.limit : 1;
if (1 === t8 || 1 === e9)
h3.displayedToast++, T3();
else {
const n4 = e9 > t8 ? t8 : e9;
h3.displayedToast = n4;
for (let e11 = 0; e11 < n4; e11++)
T3();
}
} else
n3();
} };
var x3, R3;
N3.iconOut = function(t8) {
let { theme: n4, type: o5, isLoading: s5, icon: l3 } = t8, c3 = null;
const u4 = { theme: n4, type: o5 };
return false === l3 || (i2(l3) ? c3 = l3(u4) : e7.isValidElement(l3) ? c3 = e7.cloneElement(l3, u4) : r2(l3) || a2(l3) ? c3 = l3 : s5 ? c3 = g2.spinner() : ((e8) => e8 in g2)(o5) && (c3 = g2[o5](u4))), c3;
}(N3), i2(y4.onOpen) && (N3.onOpen = y4.onOpen), i2(y4.onClose) && (N3.onClose = y4.onClose), N3.closeButton = _25.closeButton, false === y4.closeButton || c2(y4.closeButton) ? N3.closeButton = y4.closeButton : true === y4.closeButton && (N3.closeButton = !c2(_25.closeButton) || _25.closeButton);
let w3 = t7;
e7.isValidElement(t7) && !r2(t7.type) ? w3 = e7.cloneElement(t7, { closeToast: L3, toastProps: N3, data: I3 }) : i2(t7) && (w3 = t7({ closeToast: L3, toastProps: N3, data: I3 })), _25.limit && _25.limit > 0 && h3.count > _25.limit && O3 ? h3.queue.push({ toastContent: w3, toastProps: N3, staleId: m4 }) : a2(s4) ? setTimeout(() => {
C4(w3, N3, m4);
}, s4) : C4(w3, N3, m4);
}
function C4(e8, t7, n4) {
const { toastId: o4 } = t7;
n4 && d3.delete(n4);
const a3 = { content: e8, props: t7 };
d3.set(o4, a3), s3((e9) => [...e9, o4].filter((e11) => e11 !== n4)), p2.emit(4, f2(a3, null == a3.props.updateId ? "added" : "updated"));
}
return e7.useEffect(() => (h3.containerId = t6.containerId, p2.cancelEmit(3).on(0, E3).on(1, (e8) => u3.current && v3(e8)).on(5, y3).emit(2, h3), () => {
d3.clear(), p2.emit(3, h3);
}), []), e7.useEffect(() => {
h3.props = t6, h3.isToastActive = m3, h3.displayedToast = o3.length;
}), { getToastToRender: function(e8) {
const n4 = /* @__PURE__ */ new Map(), o4 = Array.from(d3.values());
return t6.newestOnTop && o4.reverse(), o4.forEach((e9) => {
const { position: t7 } = e9.props;
n4.has(t7) || n4.set(t7, []), n4.get(t7).push(e9);
}), Array.from(n4, (t7) => e8(t7[0], t7[1]));
}, containerRef: u3, isToastActive: m3 };
}
function y2(e8) {
return e8.targetTouches && e8.targetTouches.length >= 1 ? e8.targetTouches[0].clientX : e8.clientX;
}
function v2(e8) {
return e8.targetTouches && e8.targetTouches.length >= 1 ? e8.targetTouches[0].clientY : e8.clientY;
}
function T2(t6) {
const [n3, o3] = e7.useState(false), [s3, a3] = e7.useState(false), r3 = e7.useRef(null), l3 = e7.useRef({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: true, canDrag: false, boundingRect: null, didMove: false }).current, c3 = e7.useRef(t6), { autoClose: u3, pauseOnHover: d3, closeToast: f3, onClick: p3, closeOnClick: m3 } = t6;
function g3(e8) {
if (t6.draggable) {
"touchstart" === e8.nativeEvent.type && e8.nativeEvent.preventDefault(), l3.didMove = false, document.addEventListener("mousemove", C4), document.addEventListener("mouseup", b3), document.addEventListener("touchmove", C4), document.addEventListener("touchend", b3);
const n4 = r3.current;
l3.canCloseOnClick = true, l3.canDrag = true, l3.boundingRect = n4.getBoundingClientRect(), n4.style.transition = "", l3.x = y2(e8.nativeEvent), l3.y = v2(e8.nativeEvent), "x" === t6.draggableDirection ? (l3.start = l3.x, l3.removalDistance = n4.offsetWidth * (t6.draggablePercent / 100)) : (l3.start = l3.y, l3.removalDistance = n4.offsetHeight * (80 === t6.draggablePercent ? 1.5 * t6.draggablePercent : t6.draggablePercent / 100));
}
}
function h3(e8) {
if (l3.boundingRect) {
const { top: n4, bottom: o4, left: s4, right: a4 } = l3.boundingRect;
"touchend" !== e8.nativeEvent.type && t6.pauseOnHover && l3.x >= s4 && l3.x <= a4 && l3.y >= n4 && l3.y <= o4 ? E3() : T3();
}
}
function T3() {
o3(true);
}
function E3() {
o3(false);
}
function C4(e8) {
const o4 = r3.current;
l3.canDrag && o4 && (l3.didMove = true, n3 && E3(), l3.x = y2(e8), l3.y = v2(e8), l3.delta = "x" === t6.draggableDirection ? l3.x - l3.start : l3.y - l3.start, l3.start !== l3.x && (l3.canCloseOnClick = false), o4.style.transform = `translate${t6.draggableDirection}(${l3.delta}px)`, o4.style.opacity = "" + (1 - Math.abs(l3.delta / l3.removalDistance)));
}
function b3() {
document.removeEventListener("mousemove", C4), document.removeEventListener("mouseup", b3), document.removeEventListener("touchmove", C4), document.removeEventListener("touchend", b3);
const e8 = r3.current;
if (l3.canDrag && l3.didMove && e8) {
if (l3.canDrag = false, Math.abs(l3.delta) > l3.removalDistance)
return a3(true), void t6.closeToast();
e8.style.transition = "transform 0.2s, opacity 0.2s", e8.style.transform = `translate${t6.draggableDirection}(0)`, e8.style.opacity = "1";
}
}
e7.useEffect(() => {
c3.current = t6;
}), e7.useEffect(() => (r3.current && r3.current.addEventListener("d", T3, { once: true }), i2(t6.onOpen) && t6.onOpen(e7.isValidElement(t6.children) && t6.children.props), () => {
const t7 = c3.current;
i2(t7.onClose) && t7.onClose(e7.isValidElement(t7.children) && t7.children.props);
}), []), e7.useEffect(() => (t6.pauseOnFocusLoss && (document.hasFocus() || E3(), window.addEventListener("focus", T3), window.addEventListener("blur", E3)), () => {
t6.pauseOnFocusLoss && (window.removeEventListener("focus", T3), window.removeEventListener("blur", E3));
}), [t6.pauseOnFocusLoss]);
const I3 = { onMouseDown: g3, onTouchStart: g3, onMouseUp: h3, onTouchEnd: h3 };
return u3 && d3 && (I3.onMouseEnter = E3, I3.onMouseLeave = T3), m3 && (I3.onClick = (e8) => {
p3 && p3(e8), l3.canCloseOnClick && f3();
}), { playToast: T3, pauseToast: E3, isRunning: n3, preventExitTransition: s3, toastRef: r3, eventHandlers: I3 };
}
function E2(e8) {
let { closeToast: t6, theme: n3, ariaLabel: s3 = "close" } = e8;
return o2.default.createElement("button", { className: `Toastify__close-button Toastify__close-button--${n3}`, type: "button", onClick: (e9) => {
e9.stopPropagation(), t6(e9);
}, "aria-label": s3 }, o2.default.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, o2.default.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
}
function C3(e8) {
let { delay: t6, isRunning: n3, closeToast: a3, type: r3 = "default", hide: l3, className: c3, style: u3, controlledProgress: d3, progress: f3, rtl: p3, isIn: m3, theme: g3 } = e8;
const h3 = l3 || d3 && 0 === f3, y3 = { ...u3, animationDuration: `${t6}ms`, animationPlayState: n3 ? "running" : "paused", opacity: h3 ? 0 : 1 };
d3 && (y3.transform = `scaleX(${f3})`);
const v3 = s2.default("Toastify__progress-bar", d3 ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${g3}`, `Toastify__progress-bar--${r3}`, { "Toastify__progress-bar--rtl": p3 }), T3 = i2(c3) ? c3({ rtl: p3, type: r3, defaultClassName: v3 }) : s2.default(v3, c3);
return o2.default.createElement("div", { role: "progressbar", "aria-hidden": h3 ? "true" : "false", "aria-label": "notification timer", className: T3, style: y3, [d3 && f3 >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: d3 && f3 < 1 ? null : () => {
m3 && a3();
} });
}
const b2 = (t6) => {
const { isRunning: n3, preventExitTransition: a3, toastRef: r3, eventHandlers: l3 } = T2(t6), { closeButton: c3, children: u3, autoClose: d3, onClick: f3, type: p3, hideProgressBar: m3, closeToast: g3, transition: h3, position: y3, className: v3, style: b3, bodyClassName: I3, bodyStyle: _25, progressClassName: L3, progressStyle: O3, updateId: N3, role: x3, progress: R3, rtl: w3, toastId: M3, deleteToast: $3, isIn: k3, isLoading: B4, iconOut: P3, closeOnClick: D3, theme: A6 } = t6, z3 = s2.default("Toastify__toast", `Toastify__toast-theme--${A6}`, `Toastify__toast--${p3}`, { "Toastify__toast--rtl": w3 }, { "Toastify__toast--close-on-click": D3 }), F2 = i2(v3) ? v3({ rtl: w3, position: y3, type: p3, defaultClassName: z3 }) : s2.default(z3, v3), S2 = !!R3 || !d3, q2 = { closeToast: g3, type: p3, theme: A6 };
let H4 = null;
return false === c3 || (H4 = i2(c3) ? c3(q2) : e7.isValidElement(c3) ? e7.cloneElement(c3, q2) : E2(q2)), o2.default.createElement(h3, { isIn: k3, done: $3, position: y3, preventExitTransition: a3, nodeRef: r3 }, o2.default.createElement("div", { id: M3, onClick: f3, className: F2, ...l3, style: b3, ref: r3 }, o2.default.createElement("div", { ...k3 && { role: x3 }, className: i2(I3) ? I3({ type: p3 }) : s2.default("Toastify__toast-body", I3), style: _25 }, null != P3 && o2.default.createElement("div", { className: s2.default("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !B4 }) }, P3), o2.default.createElement("div", null, u3)), H4, o2.default.createElement(C3, { ...N3 && !S2 ? { key: `pb-${N3}` } : {}, rtl: w3, theme: A6, delay: d3, isRunning: n3, isIn: k3, closeToast: g3, hide: m3, type: p3, style: O3, className: L3, controlledProgress: S2, progress: R3 || 0 })));
}, I2 = function(e8, t6) {
return void 0 === t6 && (t6 = false), { enter: `Toastify--animate Toastify__${e8}-enter`, exit: `Toastify--animate Toastify__${e8}-exit`, appendPosition: t6 };
}, _24 = d2(I2("bounce", true)), L2 = d2(I2("slide", true)), O2 = d2(I2("zoom")), N2 = d2(I2("flip")), x2 = e7.forwardRef((t6, n3) => {
const { getToastToRender: a3, containerRef: r3, isToastActive: c3 } = h2(t6), { className: u3, style: d3, rtl: f3, containerId: p3 } = t6;
function m3(e8) {
const t7 = s2.default("Toastify__toast-container", `Toastify__toast-container--${e8}`, { "Toastify__toast-container--rtl": f3 });
return i2(u3) ? u3({ position: e8, rtl: f3, defaultClassName: t7 }) : s2.default(t7, l2(u3));
}
return e7.useEffect(() => {
n3 && (n3.current = r3.current);
}, []), o2.default.createElement("div", { ref: r3, className: "Toastify", id: p3 }, a3((e8, t7) => {
const n4 = t7.length ? { ...d3 } : { ...d3, pointerEvents: "none" };
return o2.default.createElement("div", { className: m3(e8), style: n4, key: `container-${e8}` }, t7.map((e9, n5) => {
let { content: s3, props: a4 } = e9;
return o2.default.createElement(b2, { ...a4, isIn: c3(a4.toastId), style: { ...a4.style, "--nth": n5 + 1, "--len": t7.length }, key: `toast-${a4.key}` }, s3);
}));
}));
});
x2.displayName = "ToastContainer", x2.defaultProps = { position: "top-right", transition: _24, autoClose: 5e3, closeButton: E2, pauseOnHover: true, pauseOnFocusLoss: true, closeOnClick: true, draggable: true, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
let R2, w2 = /* @__PURE__ */ new Map(), M2 = [], $2 = 1;
function k2() {
return "" + $2++;
}
function B3(e8) {
return e8 && (r2(e8.toastId) || a2(e8.toastId)) ? e8.toastId : k2();
}
function P2(e8, t6) {
return w2.size > 0 ? p2.emit(0, e8, t6) : M2.push({ content: e8, options: t6 }), t6.toastId;
}
function D2(e8, t6) {
return { ...t6, type: t6 && t6.type || e8, toastId: B3(t6) };
}
function A5(e8) {
return (t6, n3) => P2(t6, D2(e8, n3));
}
function z2(e8, t6) {
return P2(e8, D2("default", t6));
}
z2.loading = (e8, t6) => P2(e8, D2("default", { isLoading: true, autoClose: false, closeOnClick: false, closeButton: false, draggable: false, ...t6 })), z2.promise = function(e8, t6, n3) {
let o3, { pending: s3, error: a3, success: l3 } = t6;
s3 && (o3 = r2(s3) ? z2.loading(s3, n3) : z2.loading(s3.render, { ...n3, ...s3 }));
const c3 = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, u3 = (e9, t7, s4) => {
if (null == t7)
return void z2.dismiss(o3);
const a4 = { type: e9, ...c3, ...n3, data: s4 }, i3 = r2(t7) ? { render: t7 } : t7;
return o3 ? z2.update(o3, { ...a4, ...i3 }) : z2(i3.render, { ...a4, ...i3 }), s4;
}, d3 = i2(e8) ? e8() : e8;
return d3.then((e9) => u3("success", l3, e9)).catch((e9) => u3("error", a3, e9)), d3;
}, z2.success = A5("success"), z2.info = A5("info"), z2.error = A5("error"), z2.warning = A5("warning"), z2.warn = z2.warning, z2.dark = (e8, t6) => P2(e8, D2("default", { theme: "dark", ...t6 })), z2.dismiss = (e8) => {
w2.size > 0 ? p2.emit(1, e8) : M2 = M2.filter((t6) => null != e8 && t6.options.toastId !== e8);
}, z2.clearWaitingQueue = function(e8) {
return void 0 === e8 && (e8 = {}), p2.emit(5, e8);
}, z2.isActive = (e8) => {
let t6 = false;
return w2.forEach((n3) => {
n3.isToastActive && n3.isToastActive(e8) && (t6 = true);
}), t6;
}, z2.update = function(e8, t6) {
void 0 === t6 && (t6 = {}), setTimeout(() => {
const n3 = function(e9, t7) {
let { containerId: n4 } = t7;
const o3 = w2.get(n4 || R2);
return o3 && o3.getToast(e9);
}(e8, t6);
if (n3) {
const { props: o3, content: s3 } = n3, a3 = { delay: 100, ...o3, ...t6, toastId: t6.toastId || e8, updateId: k2() };
a3.toastId !== e8 && (a3.staleId = e8);
const r3 = a3.render || s3;
delete a3.render, P2(r3, a3);
}
}, 0);
}, z2.done = (e8) => {
z2.update(e8, { progress: 1 });
}, z2.onChange = (e8) => (p2.on(4, e8), () => {
p2.off(4, e8);
}), z2.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, z2.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, p2.on(2, (e8) => {
R2 = e8.containerId || e8, w2.set(R2, e8), M2.forEach((e9) => {
p2.emit(0, e9.content, e9.options);
}), M2 = [];
}).on(3, (e8) => {
w2.delete(e8.containerId || e8), 0 === w2.size && p2.off(0).off(1).off(5);
}), reactToastify.Bounce = _24, reactToastify.Flip = N2, reactToastify.Icons = g2, reactToastify.Slide = L2, reactToastify.ToastContainer = x2, reactToastify.Zoom = O2, reactToastify.collapseToast = u2, reactToastify.cssTransition = d2, reactToastify.toast = z2, reactToastify.useToast = T2, reactToastify.useToastContainer = h2;
return reactToastify;
}
const ReactToastify = "";
const ReactToastify$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: ReactToastify
}, Symbol.toStringTag, { value: "Module" }));
const require$$5 = /* @__PURE__ */ getAugmentedNamespace(ReactToastify$1);
var _baseSlice;
var hasRequired_baseSlice;
function require_baseSlice() {
if (hasRequired_baseSlice)
return _baseSlice;
hasRequired_baseSlice = 1;
function baseSlice(array2, start2, end2) {
var index2 = -1, length2 = array2.length;
if (start2 < 0) {
start2 = -start2 > length2 ? 0 : length2 + start2;
}
end2 = end2 > length2 ? length2 : end2;
if (end2 < 0) {
end2 += length2;
}
length2 = start2 > end2 ? 0 : end2 - start2 >>> 0;
start2 >>>= 0;
var result = Array(length2);
while (++index2 < length2) {
result[index2] = array2[index2 + start2];
}
return result;
}
_baseSlice = baseSlice;
return _baseSlice;
}
var _castSlice;
var hasRequired_castSlice;
function require_castSlice() {
if (hasRequired_castSlice)
return _castSlice;
hasRequired_castSlice = 1;
var baseSlice = require_baseSlice();
function castSlice(array2, start2, end2) {
var length2 = array2.length;
end2 = end2 === void 0 ? length2 : end2;
return !start2 && end2 >= length2 ? array2 : baseSlice(array2, start2, end2);
}
_castSlice = castSlice;
return _castSlice;
}
var _hasUnicode;
var hasRequired_hasUnicode;
function require_hasUnicode() {
if (hasRequired_hasUnicode)
return _hasUnicode;
hasRequired_hasUnicode = 1;
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
var rsZWJ = "\\u200d";
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
function hasUnicode(string2) {
return reHasUnicode.test(string2);
}
_hasUnicode = hasUnicode;
return _hasUnicode;
}
var _asciiToArray;
var hasRequired_asciiToArray;
function require_asciiToArray() {
if (hasRequired_asciiToArray)
return _asciiToArray;
hasRequired_asciiToArray = 1;
function asciiToArray(string2) {
return string2.split("");
}
_asciiToArray = asciiToArray;
return _asciiToArray;
}
var _unicodeToArray;
var hasRequired_unicodeToArray;
function require_unicodeToArray() {
if (hasRequired_unicodeToArray)
return _unicodeToArray;
hasRequired_unicodeToArray = 1;
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
var rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d";
var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
function unicodeToArray(string2) {
return string2.match(reUnicode) || [];
}
_unicodeToArray = unicodeToArray;
return _unicodeToArray;
}
var _stringToArray;
var hasRequired_stringToArray;
function require_stringToArray() {
if (hasRequired_stringToArray)
return _stringToArray;
hasRequired_stringToArray = 1;
var asciiToArray = require_asciiToArray(), hasUnicode = require_hasUnicode(), unicodeToArray = require_unicodeToArray();
function stringToArray(string2) {
return hasUnicode(string2) ? unicodeToArray(string2) : asciiToArray(string2);
}
_stringToArray = stringToArray;
return _stringToArray;
}
var _createCaseFirst;
var hasRequired_createCaseFirst;
function require_createCaseFirst() {
if (hasRequired_createCaseFirst)
return _createCaseFirst;
hasRequired_createCaseFirst = 1;
var castSlice = require_castSlice(), hasUnicode = require_hasUnicode(), stringToArray = require_stringToArray(), toString4 = requireToString();
function createCaseFirst(methodName) {
return function(string2) {
string2 = toString4(string2);
var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0;
var chr = strSymbols ? strSymbols[0] : string2.charAt(0);
var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1);
return chr[methodName]() + trailing;
};
}
_createCaseFirst = createCaseFirst;
return _createCaseFirst;
}
var upperFirst_1;
var hasRequiredUpperFirst;
function requireUpperFirst() {
if (hasRequiredUpperFirst)
return upperFirst_1;
hasRequiredUpperFirst = 1;
var createCaseFirst = require_createCaseFirst();
var upperFirst = createCaseFirst("toUpperCase");
upperFirst_1 = upperFirst;
return upperFirst_1;
}
var capitalize_1;
var hasRequiredCapitalize;
function requireCapitalize() {
if (hasRequiredCapitalize)
return capitalize_1;
hasRequiredCapitalize = 1;
var toString4 = requireToString(), upperFirst = requireUpperFirst();
function capitalize2(string2) {
return upperFirst(toString4(string2).toLowerCase());
}
capitalize_1 = capitalize2;
return capitalize_1;
}
var _basePick;
var hasRequired_basePick;
function require_basePick() {
if (hasRequired_basePick)
return _basePick;
hasRequired_basePick = 1;
var basePickBy2 = require_basePickBy(), hasIn = requireHasIn();
function basePick2(object2, paths) {
return basePickBy2(object2, paths, function(value2, path2) {
return hasIn(object2, path2);
});
}
_basePick = basePick2;
return _basePick;
}
var flatten_1;
var hasRequiredFlatten;
function requireFlatten() {
if (hasRequiredFlatten)
return flatten_1;
hasRequiredFlatten = 1;
var baseFlatten2 = require_baseFlatten();
function flatten2(array2) {
var length2 = array2 == null ? 0 : array2.length;
return length2 ? baseFlatten2(array2, 1) : [];
}
flatten_1 = flatten2;
return flatten_1;
}
var _flatRest;
var hasRequired_flatRest;
function require_flatRest() {
if (hasRequired_flatRest)
return _flatRest;
hasRequired_flatRest = 1;
var flatten2 = requireFlatten(), overRest = require_overRest(), setToString = require_setToString();
function flatRest(func) {
return setToString(overRest(func, void 0, flatten2), func + "");
}
_flatRest = flatRest;
return _flatRest;
}
var pick_1;
var hasRequiredPick;
function requirePick() {
if (hasRequiredPick)
return pick_1;
hasRequiredPick = 1;
var basePick2 = require_basePick(), flatRest = require_flatRest();
var pick2 = flatRest(function(object2, paths) {
return object2 == null ? {} : basePick2(object2, paths);
});
pick_1 = pick2;
return pick_1;
}
var isNumber_1;
var hasRequiredIsNumber;
function requireIsNumber() {
if (hasRequiredIsNumber)
return isNumber_1;
hasRequiredIsNumber = 1;
var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
var numberTag = "[object Number]";
function isNumber2(value2) {
return typeof value2 == "number" || isObjectLike2(value2) && baseGetTag2(value2) == numberTag;
}
isNumber_1 = isNumber2;
return isNumber_1;
}
var now_1;
var hasRequiredNow;
function requireNow() {
if (hasRequiredNow)
return now_1;
hasRequiredNow = 1;
var root2 = require_root();
var now2 = function() {
return root2.Date.now();
};
now_1 = now2;
return now_1;
}
var debounce_1;
var hasRequiredDebounce;
function requireDebounce() {
if (hasRequiredDebounce)
return debounce_1;
hasRequiredDebounce = 1;
var isObject2 = requireIsObject(), now2 = requireNow(), toNumber3 = requireToNumber();
var FUNC_ERROR_TEXT2 = "Expected a function";
var nativeMax2 = Math.max, nativeMin2 = Math.min;
function debounce2(func, wait, options2) {
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT2);
}
wait = toNumber3(wait) || 0;
if (isObject2(options2)) {
leading = !!options2.leading;
maxing = "maxWait" in options2;
maxWait = maxing ? nativeMax2(toNumber3(options2.maxWait) || 0, wait) : maxWait;
trailing = "trailing" in options2 ? !!options2.trailing : trailing;
}
function invokeFunc(time2) {
var args = lastArgs, thisArg = lastThis;
lastArgs = lastThis = void 0;
lastInvokeTime = time2;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time2) {
lastInvokeTime = time2;
timerId = setTimeout(timerExpired, wait);
return leading ? invokeFunc(time2) : result;
}
function remainingWait(time2) {
var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin2(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
}
function shouldInvoke(time2) {
var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
var time2 = now2();
if (shouldInvoke(time2)) {
return trailingEdge(time2);
}
timerId = setTimeout(timerExpired, remainingWait(time2));
}
function trailingEdge(time2) {
timerId = void 0;
if (trailing && lastArgs) {
return invokeFunc(time2);
}
lastArgs = lastThis = void 0;
return result;
}
function cancel() {
if (timerId !== void 0) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = void 0;
}
function flush() {
return timerId === void 0 ? result : trailingEdge(now2());
}
function debounced() {
var time2 = now2(), isInvoking = shouldInvoke(time2);
lastArgs = arguments;
lastThis = this;
lastCallTime = time2;
if (isInvoking) {
if (timerId === void 0) {
return leadingEdge(lastCallTime);
}
if (maxing) {
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === void 0) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
debounce_1 = debounce2;
return debounce_1;
}
var reactGridLayout = { exports: {} };
var ReactGridLayout = {};
var lodash_isequal = { exports: {} };
lodash_isequal.exports;
(function(module, exports) {
var LARGE_ARRAY_SIZE2 = 200;
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
var MAX_SAFE_INTEGER2 = 9007199254740991;
var argsTag2 = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag2 = "[object Function]", genTag2 = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag2 = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag2 = "[object Symbol]", undefinedTag2 = "[object Undefined]", weakMapTag = "[object WeakMap]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
var reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor2 = /^\[object .+?Constructor\]$/;
var reIsUint2 = /^(?:0|[1-9]\d*)$/;
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
var freeGlobal2 = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
var root2 = freeGlobal2 || freeSelf2 || Function("return this")();
var freeExports = exports && !exports.nodeType && exports;
var freeModule = freeExports && true && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var freeProcess = moduleExports && freeGlobal2.process;
var nodeUtil = function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding("util");
} catch (e7) {
}
}();
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
function arrayFilter(array2, predicate) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
while (++index2 < length2) {
var value2 = array2[index2];
if (predicate(value2, index2, array2)) {
result[resIndex++] = value2;
}
}
return result;
}
function arrayPush2(array2, values2) {
var index2 = -1, length2 = values2.length, offset2 = array2.length;
while (++index2 < length2) {
array2[offset2 + index2] = values2[index2];
}
return array2;
}
function arraySome(array2, predicate) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length;
while (++index2 < length2) {
if (predicate(array2[index2], index2, array2)) {
return true;
}
}
return false;
}
function baseTimes2(n2, iteratee) {
var index2 = -1, result = Array(n2);
while (++index2 < n2) {
result[index2] = iteratee(index2);
}
return result;
}
function baseUnary2(func) {
return function(value2) {
return func(value2);
};
}
function cacheHas2(cache2, key2) {
return cache2.has(key2);
}
function getValue2(object2, key2) {
return object2 == null ? void 0 : object2[key2];
}
function mapToArray(map2) {
var index2 = -1, result = Array(map2.size);
map2.forEach(function(value2, key2) {
result[++index2] = [key2, value2];
});
return result;
}
function overArg2(func, transform2) {
return function(arg) {
return func(transform2(arg));
};
}
function setToArray(set2) {
var index2 = -1, result = Array(set2.size);
set2.forEach(function(value2) {
result[++index2] = value2;
});
return result;
}
var arrayProto2 = Array.prototype, funcProto2 = Function.prototype, objectProto2 = Object.prototype;
var coreJsData2 = root2["__core-js_shared__"];
var funcToString2 = funcProto2.toString;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
var maskSrcKey2 = function() {
var uid2 = /[^.]+$/.exec(coreJsData2 && coreJsData2.keys && coreJsData2.keys.IE_PROTO || "");
return uid2 ? "Symbol(src)_1." + uid2 : "";
}();
var nativeObjectToString2 = objectProto2.toString;
var reIsNative2 = RegExp(
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
var Buffer2 = moduleExports ? root2.Buffer : void 0, Symbol2 = root2.Symbol, Uint8Array2 = root2.Uint8Array, propertyIsEnumerable3 = objectProto2.propertyIsEnumerable, splice2 = arrayProto2.splice, symToStringTag2 = Symbol2 ? Symbol2.toStringTag : void 0;
var nativeGetSymbols2 = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg2(Object.keys, Object);
var DataView2 = getNative2(root2, "DataView"), Map2 = getNative2(root2, "Map"), Promise2 = getNative2(root2, "Promise"), Set2 = getNative2(root2, "Set"), WeakMap2 = getNative2(root2, "WeakMap"), nativeCreate2 = getNative2(Object, "create");
var dataViewCtorString = toSource2(DataView2), mapCtorString = toSource2(Map2), promiseCtorString = toSource2(Promise2), setCtorString = toSource2(Set2), weakMapCtorString = toSource2(WeakMap2);
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
function Hash2(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
function hashClear2() {
this.__data__ = nativeCreate2 ? nativeCreate2(null) : {};
this.size = 0;
}
function hashDelete2(key2) {
var result = this.has(key2) && delete this.__data__[key2];
this.size -= result ? 1 : 0;
return result;
}
function hashGet2(key2) {
var data2 = this.__data__;
if (nativeCreate2) {
var result = data2[key2];
return result === HASH_UNDEFINED2 ? void 0 : result;
}
return hasOwnProperty2.call(data2, key2) ? data2[key2] : void 0;
}
function hashHas2(key2) {
var data2 = this.__data__;
return nativeCreate2 ? data2[key2] !== void 0 : hasOwnProperty2.call(data2, key2);
}
function hashSet2(key2, value2) {
var data2 = this.__data__;
this.size += this.has(key2) ? 0 : 1;
data2[key2] = nativeCreate2 && value2 === void 0 ? HASH_UNDEFINED2 : value2;
return this;
}
Hash2.prototype.clear = hashClear2;
Hash2.prototype["delete"] = hashDelete2;
Hash2.prototype.get = hashGet2;
Hash2.prototype.has = hashHas2;
Hash2.prototype.set = hashSet2;
function ListCache2(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
function listCacheClear2() {
this.__data__ = [];
this.size = 0;
}
function listCacheDelete2(key2) {
var data2 = this.__data__, index2 = assocIndexOf2(data2, key2);
if (index2 < 0) {
return false;
}
var lastIndex = data2.length - 1;
if (index2 == lastIndex) {
data2.pop();
} else {
splice2.call(data2, index2, 1);
}
--this.size;
return true;
}
function listCacheGet2(key2) {
var data2 = this.__data__, index2 = assocIndexOf2(data2, key2);
return index2 < 0 ? void 0 : data2[index2][1];
}
function listCacheHas2(key2) {
return assocIndexOf2(this.__data__, key2) > -1;
}
function listCacheSet2(key2, value2) {
var data2 = this.__data__, index2 = assocIndexOf2(data2, key2);
if (index2 < 0) {
++this.size;
data2.push([key2, value2]);
} else {
data2[index2][1] = value2;
}
return this;
}
ListCache2.prototype.clear = listCacheClear2;
ListCache2.prototype["delete"] = listCacheDelete2;
ListCache2.prototype.get = listCacheGet2;
ListCache2.prototype.has = listCacheHas2;
ListCache2.prototype.set = listCacheSet2;
function MapCache2(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
function mapCacheClear2() {
this.size = 0;
this.__data__ = {
"hash": new Hash2(),
"map": new (Map2 || ListCache2)(),
"string": new Hash2()
};
}
function mapCacheDelete2(key2) {
var result = getMapData2(this, key2)["delete"](key2);
this.size -= result ? 1 : 0;
return result;
}
function mapCacheGet2(key2) {
return getMapData2(this, key2).get(key2);
}
function mapCacheHas2(key2) {
return getMapData2(this, key2).has(key2);
}
function mapCacheSet2(key2, value2) {
var data2 = getMapData2(this, key2), size = data2.size;
data2.set(key2, value2);
this.size += data2.size == size ? 0 : 1;
return this;
}
MapCache2.prototype.clear = mapCacheClear2;
MapCache2.prototype["delete"] = mapCacheDelete2;
MapCache2.prototype.get = mapCacheGet2;
MapCache2.prototype.has = mapCacheHas2;
MapCache2.prototype.set = mapCacheSet2;
function SetCache2(values2) {
var index2 = -1, length2 = values2 == null ? 0 : values2.length;
this.__data__ = new MapCache2();
while (++index2 < length2) {
this.add(values2[index2]);
}
}
function setCacheAdd2(value2) {
this.__data__.set(value2, HASH_UNDEFINED2);
return this;
}
function setCacheHas2(value2) {
return this.__data__.has(value2);
}
SetCache2.prototype.add = SetCache2.prototype.push = setCacheAdd2;
SetCache2.prototype.has = setCacheHas2;
function Stack2(entries) {
var data2 = this.__data__ = new ListCache2(entries);
this.size = data2.size;
}
function stackClear() {
this.__data__ = new ListCache2();
this.size = 0;
}
function stackDelete(key2) {
var data2 = this.__data__, result = data2["delete"](key2);
this.size = data2.size;
return result;
}
function stackGet(key2) {
return this.__data__.get(key2);
}
function stackHas(key2) {
return this.__data__.has(key2);
}
function stackSet(key2, value2) {
var data2 = this.__data__;
if (data2 instanceof ListCache2) {
var pairs = data2.__data__;
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE2 - 1) {
pairs.push([key2, value2]);
this.size = ++data2.size;
return this;
}
data2 = this.__data__ = new MapCache2(pairs);
}
data2.set(key2, value2);
this.size = data2.size;
return this;
}
Stack2.prototype.clear = stackClear;
Stack2.prototype["delete"] = stackDelete;
Stack2.prototype.get = stackGet;
Stack2.prototype.has = stackHas;
Stack2.prototype.set = stackSet;
function arrayLikeKeys2(value2, inherited) {
var isArr = isArray3(value2), isArg = !isArr && isArguments2(value2), isBuff = !isArr && !isArg && isBuffer2(value2), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value2), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes2(value2.length, String) : [], length2 = result.length;
for (var key2 in value2) {
if ((inherited || hasOwnProperty2.call(value2, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
(key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
isType2 && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
isIndex2(key2, length2)))) {
result.push(key2);
}
}
return result;
}
function assocIndexOf2(array2, key2) {
var length2 = array2.length;
while (length2--) {
if (eq2(array2[length2][0], key2)) {
return length2;
}
}
return -1;
}
function baseGetAllKeys2(object2, keysFunc, symbolsFunc) {
var result = keysFunc(object2);
return isArray3(object2) ? result : arrayPush2(result, symbolsFunc(object2));
}
function baseGetTag2(value2) {
if (value2 == null) {
return value2 === void 0 ? undefinedTag2 : nullTag2;
}
return symToStringTag2 && symToStringTag2 in Object(value2) ? getRawTag2(value2) : objectToString2(value2);
}
function baseIsArguments(value2) {
return isObjectLike2(value2) && baseGetTag2(value2) == argsTag2;
}
function baseIsEqual(value2, other, bitmask, customizer, stack) {
if (value2 === other) {
return true;
}
if (value2 == null || other == null || !isObjectLike2(value2) && !isObjectLike2(other)) {
return value2 !== value2 && other !== other;
}
return baseIsEqualDeep(value2, other, bitmask, customizer, baseIsEqual, stack);
}
function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray3(object2), othIsArr = isArray3(other), objTag = objIsArr ? arrayTag : getTag(object2), othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag2 ? objectTag : objTag;
othTag = othTag == argsTag2 ? objectTag : othTag;
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
if (isSameTag && isBuffer2(object2)) {
if (!isBuffer2(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack2());
return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty2.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__");
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack2());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack2());
return equalObjects(object2, other, bitmask, customizer, equalFunc, stack);
}
function baseIsNative2(value2) {
if (!isObject2(value2) || isMasked2(value2)) {
return false;
}
var pattern = isFunction2(value2) ? reIsNative2 : reIsHostCtor2;
return pattern.test(toSource2(value2));
}
function baseIsTypedArray(value2) {
return isObjectLike2(value2) && isLength2(value2.length) && !!typedArrayTags[baseGetTag2(value2)];
}
function baseKeys(object2) {
if (!isPrototype2(object2)) {
return nativeKeys(object2);
}
var result = [];
for (var key2 in Object(object2)) {
if (hasOwnProperty2.call(object2, key2) && key2 != "constructor") {
result.push(key2);
}
}
return result;
}
function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
var stacked = stack.get(array2);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index2 = -1, result = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache2() : void 0;
stack.set(array2, other);
stack.set(other, array2);
while (++index2 < arrLength) {
var arrValue = array2[index2], othValue = other[index2];
if (customizer) {
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
}
if (compared !== void 0) {
if (compared) {
continue;
}
result = false;
break;
}
if (seen2) {
if (!arraySome(other, function(othValue2, othIndex) {
if (!cacheHas2(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
return seen2.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
result = false;
break;
}
}
stack["delete"](array2);
stack["delete"](other);
return result;
}
function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
return false;
}
object2 = object2.buffer;
other = other.buffer;
case arrayBufferTag:
if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
return eq2(+object2, +other);
case errorTag:
return object2.name == other.name && object2.message == other.message;
case regexpTag:
case stringTag:
return object2 == other + "";
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object2.size != other.size && !isPartial) {
return false;
}
var stacked = stack.get(object2);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
stack.set(object2, other);
var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack);
stack["delete"](object2);
return result;
case symbolTag2:
if (symbolValueOf) {
return symbolValueOf.call(object2) == symbolValueOf.call(other);
}
}
return false;
}
function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index2 = objLength;
while (index2--) {
var key2 = objProps[index2];
if (!(isPartial ? key2 in other : hasOwnProperty2.call(other, key2))) {
return false;
}
}
var stacked = stack.get(object2);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object2, other);
stack.set(other, object2);
var skipCtor = isPartial;
while (++index2 < objLength) {
key2 = objProps[index2];
var objValue = object2[key2], othValue = other[key2];
if (customizer) {
var compared = isPartial ? customizer(othValue, objValue, key2, other, object2, stack) : customizer(objValue, othValue, key2, object2, other, stack);
}
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
result = false;
break;
}
skipCtor || (skipCtor = key2 == "constructor");
}
if (result && !skipCtor) {
var objCtor = object2.constructor, othCtor = other.constructor;
if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
result = false;
}
}
stack["delete"](object2);
stack["delete"](other);
return result;
}
function getAllKeys(object2) {
return baseGetAllKeys2(object2, keys3, getSymbols2);
}
function getMapData2(map2, key2) {
var data2 = map2.__data__;
return isKeyable2(key2) ? data2[typeof key2 == "string" ? "string" : "hash"] : data2.map;
}
function getNative2(object2, key2) {
var value2 = getValue2(object2, key2);
return baseIsNative2(value2) ? value2 : void 0;
}
function getRawTag2(value2) {
var isOwn = hasOwnProperty2.call(value2, symToStringTag2), tag = value2[symToStringTag2];
try {
value2[symToStringTag2] = void 0;
var unmasked = true;
} catch (e7) {
}
var result = nativeObjectToString2.call(value2);
if (unmasked) {
if (isOwn) {
value2[symToStringTag2] = tag;
} else {
delete value2[symToStringTag2];
}
}
return result;
}
var getSymbols2 = !nativeGetSymbols2 ? stubArray2 : function(object2) {
if (object2 == null) {
return [];
}
object2 = Object(object2);
return arrayFilter(nativeGetSymbols2(object2), function(symbol2) {
return propertyIsEnumerable3.call(object2, symbol2);
});
};
var getTag = baseGetTag2;
if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
getTag = function(value2) {
var result = baseGetTag2(value2), Ctor = result == objectTag ? value2.constructor : void 0, ctorString = Ctor ? toSource2(Ctor) : "";
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
function isIndex2(value2, length2) {
length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2;
return !!length2 && (typeof value2 == "number" || reIsUint2.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2);
}
function isKeyable2(value2) {
var type2 = typeof value2;
return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value2 !== "__proto__" : value2 === null;
}
function isMasked2(func) {
return !!maskSrcKey2 && maskSrcKey2 in func;
}
function isPrototype2(value2) {
var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
return value2 === proto;
}
function objectToString2(value2) {
return nativeObjectToString2.call(value2);
}
function toSource2(func) {
if (func != null) {
try {
return funcToString2.call(func);
} catch (e7) {
}
try {
return func + "";
} catch (e7) {
}
}
return "";
}
function eq2(value2, other) {
return value2 === other || value2 !== value2 && other !== other;
}
var isArguments2 = baseIsArguments(function() {
return arguments;
}()) ? baseIsArguments : function(value2) {
return isObjectLike2(value2) && hasOwnProperty2.call(value2, "callee") && !propertyIsEnumerable3.call(value2, "callee");
};
var isArray3 = Array.isArray;
function isArrayLike2(value2) {
return value2 != null && isLength2(value2.length) && !isFunction2(value2);
}
var isBuffer2 = nativeIsBuffer || stubFalse;
function isEqual3(value2, other) {
return baseIsEqual(value2, other);
}
function isFunction2(value2) {
if (!isObject2(value2)) {
return false;
}
var tag = baseGetTag2(value2);
return tag == funcTag2 || tag == genTag2 || tag == asyncTag || tag == proxyTag;
}
function isLength2(value2) {
return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER2;
}
function isObject2(value2) {
var type2 = typeof value2;
return value2 != null && (type2 == "object" || type2 == "function");
}
function isObjectLike2(value2) {
return value2 != null && typeof value2 == "object";
}
var isTypedArray = nodeIsTypedArray ? baseUnary2(nodeIsTypedArray) : baseIsTypedArray;
function keys3(object2) {
return isArrayLike2(object2) ? arrayLikeKeys2(object2) : baseKeys(object2);
}
function stubArray2() {
return [];
}
function stubFalse() {
return false;
}
module.exports = isEqual3;
})(lodash_isequal, lodash_isequal.exports);
var lodash_isequalExports = lodash_isequal.exports;
const isDeepEqual = /* @__PURE__ */ getDefaultExportFromCjs(lodash_isequalExports);
var utils$1 = {};
var fastRGLPropsEqual;
var hasRequiredFastRGLPropsEqual;
function requireFastRGLPropsEqual() {
if (hasRequiredFastRGLPropsEqual)
return fastRGLPropsEqual;
hasRequiredFastRGLPropsEqual = 1;
fastRGLPropsEqual = function fastRGLPropsEqual2(a2, b2, isEqualImpl) {
if (a2 === b2)
return true;
return a2.className === b2.className && isEqualImpl(a2.style, b2.style) && a2.width === b2.width && a2.autoSize === b2.autoSize && a2.cols === b2.cols && a2.draggableCancel === b2.draggableCancel && a2.draggableHandle === b2.draggableHandle && isEqualImpl(a2.verticalCompact, b2.verticalCompact) && isEqualImpl(a2.compactType, b2.compactType) && isEqualImpl(a2.layout, b2.layout) && isEqualImpl(a2.margin, b2.margin) && isEqualImpl(a2.containerPadding, b2.containerPadding) && a2.rowHeight === b2.rowHeight && a2.maxRows === b2.maxRows && a2.isBounded === b2.isBounded && a2.isDraggable === b2.isDraggable && a2.isResizable === b2.isResizable && a2.allowOverlap === b2.allowOverlap && a2.preventCollision === b2.preventCollision && a2.useCSSTransforms === b2.useCSSTransforms && a2.transformScale === b2.transformScale && a2.isDroppable === b2.isDroppable && isEqualImpl(a2.resizeHandles, b2.resizeHandles) && isEqualImpl(a2.resizeHandle, b2.resizeHandle) && a2.onLayoutChange === b2.onLayoutChange && a2.onDragStart === b2.onDragStart && a2.onDrag === b2.onDrag && a2.onDragStop === b2.onDragStop && a2.onResizeStart === b2.onResizeStart && a2.onResize === b2.onResize && a2.onResizeStop === b2.onResizeStop && a2.onDrop === b2.onDrop && isEqualImpl(a2.droppingItem, b2.droppingItem) && isEqualImpl(a2.innerRef, b2.innerRef);
};
return fastRGLPropsEqual;
}
var hasRequiredUtils$1;
function requireUtils$1() {
if (hasRequiredUtils$1)
return utils$1;
hasRequiredUtils$1 = 1;
Object.defineProperty(utils$1, "__esModule", {
value: true
});
utils$1.bottom = bottom2;
utils$1.childrenEqual = childrenEqual;
utils$1.cloneLayout = cloneLayout;
utils$1.cloneLayoutItem = cloneLayoutItem;
utils$1.collides = collides;
utils$1.compact = compact;
utils$1.compactItem = compactItem;
utils$1.compactType = compactType;
utils$1.correctBounds = correctBounds;
utils$1.fastPositionEqual = fastPositionEqual;
utils$1.fastRGLPropsEqual = void 0;
utils$1.getAllCollisions = getAllCollisions;
utils$1.getFirstCollision = getFirstCollision2;
utils$1.getLayoutItem = getLayoutItem;
utils$1.getStatics = getStatics2;
utils$1.modifyLayout = modifyLayout;
utils$1.moveElement = moveElement;
utils$1.moveElementAwayFromCollision = moveElementAwayFromCollision;
utils$1.noop = void 0;
utils$1.perc = perc;
utils$1.setTopLeft = setTopLeft;
utils$1.setTransform = setTransform;
utils$1.sortLayoutItems = sortLayoutItems;
utils$1.sortLayoutItemsByColRow = sortLayoutItemsByColRow;
utils$1.sortLayoutItemsByRowCol = sortLayoutItemsByRowCol;
utils$1.synchronizeLayoutWithChildren = synchronizeLayoutWithChildren;
utils$1.validateLayout = validateLayout;
utils$1.withLayoutItem = withLayoutItem;
var _lodash = _interopRequireDefault(lodash_isequalExports);
var _react = _interopRequireDefault(reactExports);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
function bottom2(layout) {
var max2 = 0, bottomY;
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
bottomY = layout[i2].y + layout[i2].h;
if (bottomY > max2)
max2 = bottomY;
}
return max2;
}
function cloneLayout(layout) {
var newLayout = Array(layout.length);
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
newLayout[i2] = cloneLayoutItem(layout[i2]);
}
return newLayout;
}
function modifyLayout(layout, layoutItem) {
var newLayout = Array(layout.length);
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
if (layoutItem.i === layout[i2].i) {
newLayout[i2] = layoutItem;
} else {
newLayout[i2] = layout[i2];
}
}
return newLayout;
}
function withLayoutItem(layout, itemKey, cb2) {
var item = getLayoutItem(layout, itemKey);
if (!item)
return [layout, null];
item = cb2(cloneLayoutItem(item));
layout = modifyLayout(layout, item);
return [layout, item];
}
function cloneLayoutItem(layoutItem) {
return {
w: layoutItem.w,
h: layoutItem.h,
x: layoutItem.x,
y: layoutItem.y,
i: layoutItem.i,
minW: layoutItem.minW,
maxW: layoutItem.maxW,
minH: layoutItem.minH,
maxH: layoutItem.maxH,
moved: Boolean(layoutItem.moved),
static: Boolean(layoutItem.static),
// These can be null/undefined
isDraggable: layoutItem.isDraggable,
isResizable: layoutItem.isResizable,
resizeHandles: layoutItem.resizeHandles,
isBounded: layoutItem.isBounded
};
}
function childrenEqual(a2, b2) {
return (0, _lodash.default)(_react.default.Children.map(a2, function(c2) {
return c2 === null || c2 === void 0 ? void 0 : c2.key;
}), _react.default.Children.map(b2, function(c2) {
return c2 === null || c2 === void 0 ? void 0 : c2.key;
}));
}
var fastRGLPropsEqual2 = requireFastRGLPropsEqual();
utils$1.fastRGLPropsEqual = fastRGLPropsEqual2;
function fastPositionEqual(a2, b2) {
return a2.left === b2.left && a2.top === b2.top && a2.width === b2.width && a2.height === b2.height;
}
function collides(l1, l2) {
if (l1.i === l2.i)
return false;
if (l1.x + l1.w <= l2.x)
return false;
if (l1.x >= l2.x + l2.w)
return false;
if (l1.y + l1.h <= l2.y)
return false;
if (l1.y >= l2.y + l2.h)
return false;
return true;
}
function compact(layout, compactType2, cols) {
var compareWith = getStatics2(layout);
var sorted = sortLayoutItems(layout, compactType2);
var out = Array(layout.length);
for (var i2 = 0, len = sorted.length; i2 < len; i2++) {
var l2 = cloneLayoutItem(sorted[i2]);
if (!l2.static) {
l2 = compactItem(compareWith, l2, compactType2, cols, sorted);
compareWith.push(l2);
}
out[layout.indexOf(sorted[i2])] = l2;
l2.moved = false;
}
return out;
}
var heightWidth = {
x: "w",
y: "h"
};
function resolveCompactionCollision(layout, item, moveToCoord, axis) {
var sizeProp = heightWidth[axis];
item[axis] += 1;
var itemIndex = layout.map(function(layoutItem) {
return layoutItem.i;
}).indexOf(item.i);
for (var i2 = itemIndex + 1; i2 < layout.length; i2++) {
var otherItem = layout[i2];
if (otherItem.static)
continue;
if (otherItem.y > item.y + item.h)
break;
if (collides(item, otherItem)) {
resolveCompactionCollision(layout, otherItem, moveToCoord + item[sizeProp], axis);
}
}
item[axis] = moveToCoord;
}
function compactItem(compareWith, l2, compactType2, cols, fullLayout) {
var compactV = compactType2 === "vertical";
var compactH = compactType2 === "horizontal";
if (compactV) {
l2.y = Math.min(bottom2(compareWith), l2.y);
while (l2.y > 0 && !getFirstCollision2(compareWith, l2)) {
l2.y--;
}
} else if (compactH) {
while (l2.x > 0 && !getFirstCollision2(compareWith, l2)) {
l2.x--;
}
}
var collides2;
while (collides2 = getFirstCollision2(compareWith, l2)) {
if (compactH) {
resolveCompactionCollision(fullLayout, l2, collides2.x + collides2.w, "x");
} else {
resolveCompactionCollision(fullLayout, l2, collides2.y + collides2.h, "y");
}
if (compactH && l2.x + l2.w > cols) {
l2.x = cols - l2.w;
l2.y++;
}
}
l2.y = Math.max(l2.y, 0);
l2.x = Math.max(l2.x, 0);
return l2;
}
function correctBounds(layout, bounds2) {
var collidesWith = getStatics2(layout);
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
var l2 = layout[i2];
if (l2.x + l2.w > bounds2.cols)
l2.x = bounds2.cols - l2.w;
if (l2.x < 0) {
l2.x = 0;
l2.w = bounds2.cols;
}
if (!l2.static)
collidesWith.push(l2);
else {
while (getFirstCollision2(collidesWith, l2)) {
l2.y++;
}
}
}
return layout;
}
function getLayoutItem(layout, id) {
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
if (layout[i2].i === id)
return layout[i2];
}
}
function getFirstCollision2(layout, layoutItem) {
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
if (collides(layout[i2], layoutItem))
return layout[i2];
}
}
function getAllCollisions(layout, layoutItem) {
return layout.filter(function(l2) {
return collides(l2, layoutItem);
});
}
function getStatics2(layout) {
return layout.filter(function(l2) {
return l2.static;
});
}
function moveElement(layout, l2, x2, y2, isUserAction, preventCollision, compactType2, cols, allowOverlap) {
if (l2.static && l2.isDraggable !== true)
return layout;
if (l2.y === y2 && l2.x === x2)
return layout;
log3("Moving element ".concat(l2.i, " to [").concat(String(x2), ",").concat(String(y2), "] from [").concat(l2.x, ",").concat(l2.y, "]"));
var oldX = l2.x;
var oldY = l2.y;
if (typeof x2 === "number")
l2.x = x2;
if (typeof y2 === "number")
l2.y = y2;
l2.moved = true;
var sorted = sortLayoutItems(layout, compactType2);
var movingUp = compactType2 === "vertical" && typeof y2 === "number" ? oldY >= y2 : compactType2 === "horizontal" && typeof x2 === "number" ? oldX >= x2 : false;
if (movingUp)
sorted = sorted.reverse();
var collisions = getAllCollisions(sorted, l2);
var hasCollisions = collisions.length > 0;
if (hasCollisions && allowOverlap) {
return cloneLayout(layout);
} else if (hasCollisions && preventCollision) {
log3("Collision prevented on ".concat(l2.i, ", reverting."));
l2.x = oldX;
l2.y = oldY;
l2.moved = false;
return layout;
}
for (var i2 = 0, len = collisions.length; i2 < len; i2++) {
var collision2 = collisions[i2];
log3("Resolving collision between ".concat(l2.i, " at [").concat(l2.x, ",").concat(l2.y, "] and ").concat(collision2.i, " at [").concat(collision2.x, ",").concat(collision2.y, "]"));
if (collision2.moved)
continue;
if (collision2.static) {
layout = moveElementAwayFromCollision(layout, collision2, l2, isUserAction, compactType2);
} else {
layout = moveElementAwayFromCollision(layout, l2, collision2, isUserAction, compactType2);
}
}
return layout;
}
function moveElementAwayFromCollision(layout, collidesWith, itemToMove, isUserAction, compactType2, cols) {
var compactH = compactType2 === "horizontal";
var compactV = compactType2 !== "horizontal";
var preventCollision = collidesWith.static;
if (isUserAction) {
isUserAction = false;
var fakeItem = {
x: compactH ? Math.max(collidesWith.x - itemToMove.w, 0) : itemToMove.x,
y: compactV ? Math.max(collidesWith.y - itemToMove.h, 0) : itemToMove.y,
w: itemToMove.w,
h: itemToMove.h,
i: "-1"
};
if (!getFirstCollision2(layout, fakeItem)) {
log3("Doing reverse collision on ".concat(itemToMove.i, " up to [").concat(fakeItem.x, ",").concat(fakeItem.y, "]."));
return moveElement(layout, itemToMove, compactH ? fakeItem.x : void 0, compactV ? fakeItem.y : void 0, isUserAction, preventCollision, compactType2);
}
}
return moveElement(layout, itemToMove, compactH ? itemToMove.x + 1 : void 0, compactV ? itemToMove.y + 1 : void 0, isUserAction, preventCollision, compactType2);
}
function perc(num) {
return num * 100 + "%";
}
function setTransform(_ref3) {
var top2 = _ref3.top, left2 = _ref3.left, width2 = _ref3.width, height2 = _ref3.height;
var translate2 = "translate(".concat(left2, "px,").concat(top2, "px)");
return {
transform: translate2,
WebkitTransform: translate2,
MozTransform: translate2,
msTransform: translate2,
OTransform: translate2,
width: "".concat(width2, "px"),
height: "".concat(height2, "px"),
position: "absolute"
};
}
function setTopLeft(_ref22) {
var top2 = _ref22.top, left2 = _ref22.left, width2 = _ref22.width, height2 = _ref22.height;
return {
top: "".concat(top2, "px"),
left: "".concat(left2, "px"),
width: "".concat(width2, "px"),
height: "".concat(height2, "px"),
position: "absolute"
};
}
function sortLayoutItems(layout, compactType2) {
if (compactType2 === "horizontal")
return sortLayoutItemsByColRow(layout);
if (compactType2 === "vertical")
return sortLayoutItemsByRowCol(layout);
else
return layout;
}
function sortLayoutItemsByRowCol(layout) {
return layout.slice(0).sort(function(a2, b2) {
if (a2.y > b2.y || a2.y === b2.y && a2.x > b2.x) {
return 1;
} else if (a2.y === b2.y && a2.x === b2.x) {
return 0;
}
return -1;
});
}
function sortLayoutItemsByColRow(layout) {
return layout.slice(0).sort(function(a2, b2) {
if (a2.x > b2.x || a2.x === b2.x && a2.y > b2.y) {
return 1;
}
return -1;
});
}
function synchronizeLayoutWithChildren(initialLayout, children2, cols, compactType2, allowOverlap) {
initialLayout = initialLayout || [];
var layout = [];
_react.default.Children.forEach(children2, function(child) {
if ((child === null || child === void 0 ? void 0 : child.key) == null)
return;
var exists = getLayoutItem(initialLayout, String(child.key));
if (exists) {
layout.push(cloneLayoutItem(exists));
} else {
var g2 = child.props["data-grid"] || child.props._grid;
if (g2) {
layout.push(cloneLayoutItem(_objectSpread3(_objectSpread3({}, g2), {}, {
i: child.key
})));
} else {
layout.push(cloneLayoutItem({
w: 1,
h: 1,
x: 0,
y: bottom2(layout),
i: String(child.key)
}));
}
}
});
var correctedLayout = correctBounds(layout, {
cols
});
return allowOverlap ? correctedLayout : compact(correctedLayout, compactType2, cols);
}
function validateLayout(layout) {
var contextName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Layout";
var subProps = ["x", "y", "w", "h"];
if (!Array.isArray(layout))
throw new Error(contextName + " must be an array!");
for (var i2 = 0, len = layout.length; i2 < len; i2++) {
var item = layout[i2];
for (var j2 = 0; j2 < subProps.length; j2++) {
if (typeof item[subProps[j2]] !== "number") {
throw new Error("ReactGridLayout: " + contextName + "[" + i2 + "]." + subProps[j2] + " must be a number!");
}
}
}
}
function compactType(props) {
var _ref3 = props || {}, verticalCompact = _ref3.verticalCompact, compactType2 = _ref3.compactType;
return verticalCompact === false ? null : compactType2;
}
function log3() {
return;
}
var noop3 = function noop4() {
};
utils$1.noop = noop3;
return utils$1;
}
var calculateUtils = {};
var hasRequiredCalculateUtils;
function requireCalculateUtils() {
if (hasRequiredCalculateUtils)
return calculateUtils;
hasRequiredCalculateUtils = 1;
Object.defineProperty(calculateUtils, "__esModule", {
value: true
});
calculateUtils.calcGridColWidth = calcGridColWidth;
calculateUtils.calcGridItemPosition = calcGridItemPosition;
calculateUtils.calcGridItemWHPx = calcGridItemWHPx;
calculateUtils.calcWH = calcWH;
calculateUtils.calcXY = calcXY;
calculateUtils.clamp = clamp2;
function calcGridColWidth(positionParams) {
var margin = positionParams.margin, containerPadding = positionParams.containerPadding, containerWidth = positionParams.containerWidth, cols = positionParams.cols;
return (containerWidth - margin[0] * (cols - 1) - containerPadding[0] * 2) / cols;
}
function calcGridItemWHPx(gridUnits, colOrRowSize, marginPx) {
if (!Number.isFinite(gridUnits))
return gridUnits;
return Math.round(colOrRowSize * gridUnits + Math.max(0, gridUnits - 1) * marginPx);
}
function calcGridItemPosition(positionParams, x2, y2, w2, h2, state) {
var margin = positionParams.margin, containerPadding = positionParams.containerPadding, rowHeight = positionParams.rowHeight;
var colWidth = calcGridColWidth(positionParams);
var out = {};
if (state && state.resizing) {
out.width = Math.round(state.resizing.width);
out.height = Math.round(state.resizing.height);
} else {
out.width = calcGridItemWHPx(w2, colWidth, margin[0]);
out.height = calcGridItemWHPx(h2, rowHeight, margin[1]);
}
if (state && state.dragging) {
out.top = Math.round(state.dragging.top);
out.left = Math.round(state.dragging.left);
} else {
out.top = Math.round((rowHeight + margin[1]) * y2 + containerPadding[1]);
out.left = Math.round((colWidth + margin[0]) * x2 + containerPadding[0]);
}
return out;
}
function calcXY(positionParams, top2, left2, w2, h2) {
var margin = positionParams.margin, cols = positionParams.cols, rowHeight = positionParams.rowHeight, maxRows = positionParams.maxRows;
var colWidth = calcGridColWidth(positionParams);
var x2 = Math.round((left2 - margin[0]) / (colWidth + margin[0]));
var y2 = Math.round((top2 - margin[1]) / (rowHeight + margin[1]));
x2 = clamp2(x2, 0, cols - w2);
y2 = clamp2(y2, 0, maxRows - h2);
return {
x: x2,
y: y2
};
}
function calcWH(positionParams, width2, height2, x2, y2) {
var margin = positionParams.margin, maxRows = positionParams.maxRows, cols = positionParams.cols, rowHeight = positionParams.rowHeight;
var colWidth = calcGridColWidth(positionParams);
var w2 = Math.round((width2 + margin[0]) / (colWidth + margin[0]));
var h2 = Math.round((height2 + margin[1]) / (rowHeight + margin[1]));
w2 = clamp2(w2, 0, cols - x2);
h2 = clamp2(h2, 0, maxRows - y2);
return {
w: w2,
h: h2
};
}
function clamp2(num, lowerBound, upperBound) {
return Math.max(Math.min(num, upperBound), lowerBound);
}
return calculateUtils;
}
var GridItem = {};
var cjs$1 = { exports: {} };
var Draggable = {};
var domFns = {};
var shims = {};
var hasRequiredShims;
function requireShims() {
if (hasRequiredShims)
return shims;
hasRequiredShims = 1;
Object.defineProperty(shims, "__esModule", {
value: true
});
shims.dontSetMe = dontSetMe;
shims.findInArray = findInArray;
shims.int = int2;
shims.isFunction = isFunction2;
shims.isNum = isNum;
function findInArray(array2, callback) {
for (var i2 = 0, length2 = array2.length; i2 < length2; i2++) {
if (callback.apply(callback, [array2[i2], i2, array2]))
return array2[i2];
}
}
function isFunction2(func) {
return typeof func === "function" || Object.prototype.toString.call(func) === "[object Function]";
}
function isNum(num) {
return typeof num === "number" && !isNaN(num);
}
function int2(a2) {
return parseInt(a2, 10);
}
function dontSetMe(props, propName, componentName) {
if (props[propName]) {
return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
}
}
return shims;
}
var getPrefix = {};
var hasRequiredGetPrefix;
function requireGetPrefix() {
if (hasRequiredGetPrefix)
return getPrefix;
hasRequiredGetPrefix = 1;
Object.defineProperty(getPrefix, "__esModule", {
value: true
});
getPrefix.browserPrefixToKey = browserPrefixToKey;
getPrefix.browserPrefixToStyle = browserPrefixToStyle;
getPrefix.default = void 0;
getPrefix.getPrefix = getPrefix$1;
var prefixes2 = ["Moz", "Webkit", "O", "ms"];
function getPrefix$1() {
var _window$document, _window$document$docu;
var prop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
if (typeof window === "undefined")
return "";
var style2 = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
if (!style2)
return "";
if (prop in style2)
return "";
for (var i2 = 0; i2 < prefixes2.length; i2++) {
if (browserPrefixToKey(prop, prefixes2[i2]) in style2)
return prefixes2[i2];
}
return "";
}
function browserPrefixToKey(prop, prefix2) {
return prefix2 ? "".concat(prefix2).concat(kebabToTitleCase(prop)) : prop;
}
function browserPrefixToStyle(prop, prefix2) {
return prefix2 ? "-".concat(prefix2.toLowerCase(), "-").concat(prop) : prop;
}
function kebabToTitleCase(str) {
var out = "";
var shouldCapitalize = true;
for (var i2 = 0; i2 < str.length; i2++) {
if (shouldCapitalize) {
out += str[i2].toUpperCase();
shouldCapitalize = false;
} else if (str[i2] === "-") {
shouldCapitalize = true;
} else {
out += str[i2];
}
}
return out;
}
var _default = getPrefix$1();
getPrefix.default = _default;
return getPrefix;
}
var hasRequiredDomFns;
function requireDomFns() {
if (hasRequiredDomFns)
return domFns;
hasRequiredDomFns = 1;
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(domFns, "__esModule", {
value: true
});
domFns.addClassName = addClassName;
domFns.addEvent = addEvent;
domFns.addUserSelectStyles = addUserSelectStyles;
domFns.createCSSTransform = createCSSTransform;
domFns.createSVGTransform = createSVGTransform;
domFns.getTouch = getTouch;
domFns.getTouchIdentifier = getTouchIdentifier;
domFns.getTranslation = getTranslation;
domFns.innerHeight = innerHeight;
domFns.innerWidth = innerWidth;
domFns.matchesSelector = matchesSelector;
domFns.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
domFns.offsetXYFromParent = offsetXYFromParent;
domFns.outerHeight = outerHeight;
domFns.outerWidth = outerWidth;
domFns.removeClassName = removeClassName;
domFns.removeEvent = removeEvent;
domFns.removeUserSelectStyles = removeUserSelectStyles;
var _shims = requireShims();
var _getPrefix = _interopRequireWildcard(requireGetPrefix());
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var matchesSelectorFunc = "";
function matchesSelector(el, selector) {
if (!matchesSelectorFunc) {
matchesSelectorFunc = (0, _shims.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(method) {
return (0, _shims.isFunction)(el[method]);
});
}
if (!(0, _shims.isFunction)(el[matchesSelectorFunc]))
return false;
return el[matchesSelectorFunc](selector);
}
function matchesSelectorAndParentsTo(el, selector, baseNode) {
var node2 = el;
do {
if (matchesSelector(node2, selector))
return true;
if (node2 === baseNode)
return false;
node2 = node2.parentNode;
} while (node2);
return false;
}
function addEvent(el, event2, handler, inputOptions) {
if (!el)
return;
var options2 = _objectSpread3({
capture: true
}, inputOptions);
if (el.addEventListener) {
el.addEventListener(event2, handler, options2);
} else if (el.attachEvent) {
el.attachEvent("on" + event2, handler);
} else {
el["on" + event2] = handler;
}
}
function removeEvent(el, event2, handler, inputOptions) {
if (!el)
return;
var options2 = _objectSpread3({
capture: true
}, inputOptions);
if (el.removeEventListener) {
el.removeEventListener(event2, handler, options2);
} else if (el.detachEvent) {
el.detachEvent("on" + event2, handler);
} else {
el["on" + event2] = null;
}
}
function outerHeight(node2) {
var height2 = node2.clientHeight;
var computedStyle = node2.ownerDocument.defaultView.getComputedStyle(node2);
height2 += (0, _shims.int)(computedStyle.borderTopWidth);
height2 += (0, _shims.int)(computedStyle.borderBottomWidth);
return height2;
}
function outerWidth(node2) {
var width2 = node2.clientWidth;
var computedStyle = node2.ownerDocument.defaultView.getComputedStyle(node2);
width2 += (0, _shims.int)(computedStyle.borderLeftWidth);
width2 += (0, _shims.int)(computedStyle.borderRightWidth);
return width2;
}
function innerHeight(node2) {
var height2 = node2.clientHeight;
var computedStyle = node2.ownerDocument.defaultView.getComputedStyle(node2);
height2 -= (0, _shims.int)(computedStyle.paddingTop);
height2 -= (0, _shims.int)(computedStyle.paddingBottom);
return height2;
}
function innerWidth(node2) {
var width2 = node2.clientWidth;
var computedStyle = node2.ownerDocument.defaultView.getComputedStyle(node2);
width2 -= (0, _shims.int)(computedStyle.paddingLeft);
width2 -= (0, _shims.int)(computedStyle.paddingRight);
return width2;
}
function offsetXYFromParent(evt, offsetParent, scale2) {
var isBody = offsetParent === offsetParent.ownerDocument.body;
var offsetParentRect = isBody ? {
left: 0,
top: 0
} : offsetParent.getBoundingClientRect();
var x2 = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale2;
var y2 = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale2;
return {
x: x2,
y: y2
};
}
function createCSSTransform(controlPos, positionOffset) {
var translation = getTranslation(controlPos, positionOffset, "px");
return _defineProperty2({}, (0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default), translation);
}
function createSVGTransform(controlPos, positionOffset) {
var translation = getTranslation(controlPos, positionOffset, "");
return translation;
}
function getTranslation(_ref22, positionOffset, unitSuffix) {
var x2 = _ref22.x, y2 = _ref22.y;
var translation = "translate(".concat(x2).concat(unitSuffix, ",").concat(y2).concat(unitSuffix, ")");
if (positionOffset) {
var defaultX2 = "".concat(typeof positionOffset.x === "string" ? positionOffset.x : positionOffset.x + unitSuffix);
var defaultY2 = "".concat(typeof positionOffset.y === "string" ? positionOffset.y : positionOffset.y + unitSuffix);
translation = "translate(".concat(defaultX2, ", ").concat(defaultY2, ")") + translation;
}
return translation;
}
function getTouch(e7, identifier2) {
return e7.targetTouches && (0, _shims.findInArray)(e7.targetTouches, function(t5) {
return identifier2 === t5.identifier;
}) || e7.changedTouches && (0, _shims.findInArray)(e7.changedTouches, function(t5) {
return identifier2 === t5.identifier;
});
}
function getTouchIdentifier(e7) {
if (e7.targetTouches && e7.targetTouches[0])
return e7.targetTouches[0].identifier;
if (e7.changedTouches && e7.changedTouches[0])
return e7.changedTouches[0].identifier;
}
function addUserSelectStyles(doc) {
if (!doc)
return;
var styleEl = doc.getElementById("react-draggable-style-el");
if (!styleEl) {
styleEl = doc.createElement("style");
styleEl.type = "text/css";
styleEl.id = "react-draggable-style-el";
styleEl.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n";
styleEl.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n";
doc.getElementsByTagName("head")[0].appendChild(styleEl);
}
if (doc.body)
addClassName(doc.body, "react-draggable-transparent-selection");
}
function removeUserSelectStyles(doc) {
if (!doc)
return;
try {
if (doc.body)
removeClassName(doc.body, "react-draggable-transparent-selection");
if (doc.selection) {
doc.selection.empty();
} else {
var selection = (doc.defaultView || window).getSelection();
if (selection && selection.type !== "Caret") {
selection.removeAllRanges();
}
}
} catch (e7) {
}
}
function addClassName(el, className) {
if (el.classList) {
el.classList.add(className);
} else {
if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
el.className += " ".concat(className);
}
}
}
function removeClassName(el, className) {
if (el.classList) {
el.classList.remove(className);
} else {
el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), "g"), "");
}
}
return domFns;
}
var positionFns = {};
var hasRequiredPositionFns;
function requirePositionFns() {
if (hasRequiredPositionFns)
return positionFns;
hasRequiredPositionFns = 1;
Object.defineProperty(positionFns, "__esModule", {
value: true
});
positionFns.canDragX = canDragX;
positionFns.canDragY = canDragY;
positionFns.createCoreData = createCoreData;
positionFns.createDraggableData = createDraggableData;
positionFns.getBoundPosition = getBoundPosition;
positionFns.getControlPosition = getControlPosition;
positionFns.snapToGrid = snapToGrid;
var _shims = requireShims();
var _domFns = requireDomFns();
function getBoundPosition(draggable, x2, y2) {
if (!draggable.props.bounds)
return [x2, y2];
var bounds2 = draggable.props.bounds;
bounds2 = typeof bounds2 === "string" ? bounds2 : cloneBounds(bounds2);
var node2 = findDOMNode(draggable);
if (typeof bounds2 === "string") {
var ownerDocument = node2.ownerDocument;
var ownerWindow = ownerDocument.defaultView;
var boundNode;
if (bounds2 === "parent") {
boundNode = node2.parentNode;
} else {
boundNode = ownerDocument.querySelector(bounds2);
}
if (!(boundNode instanceof ownerWindow.HTMLElement)) {
throw new Error('Bounds selector "' + bounds2 + '" could not find an element.');
}
var boundNodeEl = boundNode;
var nodeStyle = ownerWindow.getComputedStyle(node2);
var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl);
bounds2 = {
left: -node2.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
top: -node2.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node2) - node2.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node2) - node2.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
};
}
if ((0, _shims.isNum)(bounds2.right))
x2 = Math.min(x2, bounds2.right);
if ((0, _shims.isNum)(bounds2.bottom))
y2 = Math.min(y2, bounds2.bottom);
if ((0, _shims.isNum)(bounds2.left))
x2 = Math.max(x2, bounds2.left);
if ((0, _shims.isNum)(bounds2.top))
y2 = Math.max(y2, bounds2.top);
return [x2, y2];
}
function snapToGrid(grid, pendingX, pendingY) {
var x2 = Math.round(pendingX / grid[0]) * grid[0];
var y2 = Math.round(pendingY / grid[1]) * grid[1];
return [x2, y2];
}
function canDragX(draggable) {
return draggable.props.axis === "both" || draggable.props.axis === "x";
}
function canDragY(draggable) {
return draggable.props.axis === "both" || draggable.props.axis === "y";
}
function getControlPosition(e7, touchIdentifier, draggableCore) {
var touchObj = typeof touchIdentifier === "number" ? (0, _domFns.getTouch)(e7, touchIdentifier) : null;
if (typeof touchIdentifier === "number" && !touchObj)
return null;
var node2 = findDOMNode(draggableCore);
var offsetParent = draggableCore.props.offsetParent || node2.offsetParent || node2.ownerDocument.body;
return (0, _domFns.offsetXYFromParent)(touchObj || e7, offsetParent, draggableCore.props.scale);
}
function createCoreData(draggable, x2, y2) {
var state = draggable.state;
var isStart = !(0, _shims.isNum)(state.lastX);
var node2 = findDOMNode(draggable);
if (isStart) {
return {
node: node2,
deltaX: 0,
deltaY: 0,
lastX: x2,
lastY: y2,
x: x2,
y: y2
};
} else {
return {
node: node2,
deltaX: x2 - state.lastX,
deltaY: y2 - state.lastY,
lastX: state.lastX,
lastY: state.lastY,
x: x2,
y: y2
};
}
}
function createDraggableData(draggable, coreData) {
var scale2 = draggable.props.scale;
return {
node: coreData.node,
x: draggable.state.x + coreData.deltaX / scale2,
y: draggable.state.y + coreData.deltaY / scale2,
deltaX: coreData.deltaX / scale2,
deltaY: coreData.deltaY / scale2,
lastX: draggable.state.x,
lastY: draggable.state.y
};
}
function cloneBounds(bounds2) {
return {
left: bounds2.left,
top: bounds2.top,
right: bounds2.right,
bottom: bounds2.bottom
};
}
function findDOMNode(draggable) {
var node2 = draggable.findDOMNode();
if (!node2) {
throw new Error("<DraggableCore>: Unmounted during event!");
}
return node2;
}
return positionFns;
}
var DraggableCore = {};
var log$5 = {};
var hasRequiredLog;
function requireLog() {
if (hasRequiredLog)
return log$5;
hasRequiredLog = 1;
Object.defineProperty(log$5, "__esModule", {
value: true
});
log$5.default = log3;
function log3() {
}
return log$5;
}
var hasRequiredDraggableCore;
function requireDraggableCore() {
if (hasRequiredDraggableCore)
return DraggableCore;
hasRequiredDraggableCore = 1;
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(DraggableCore, "__esModule", {
value: true
});
DraggableCore.default = void 0;
var React2 = _interopRequireWildcard(reactExports);
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _reactDom = _interopRequireDefault(reactDomExports);
var _domFns = requireDomFns();
var _positionFns = requirePositionFns();
var _shims = requireShims();
var _log = _interopRequireDefault(requireLog());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _slicedToArray2(arr2, i2) {
return _arrayWithHoles2(arr2) || _iterableToArrayLimit2(arr2, i2) || _unsupportedIterableToArray2(arr2, i2) || _nonIterableRest2();
}
function _nonIterableRest2() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray2(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray2(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray2(o2, minLen);
}
function _arrayLikeToArray2(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++) {
arr22[i2] = arr2[i2];
}
return arr22;
}
function _iterableToArrayLimit2(arr2, i2) {
var _i2 = arr2 == null ? null : typeof Symbol !== "undefined" && arr2[Symbol.iterator] || arr2["@@iterator"];
if (_i2 == null)
return;
var _arr = [];
var _n2 = true;
var _d = false;
var _s, _e2;
try {
for (_i2 = _i2.call(arr2); !(_n2 = (_s = _i2.next()).done); _n2 = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e2 = err;
} finally {
try {
if (!_n2 && _i2["return"] != null)
_i2["return"]();
} finally {
if (_d)
throw _e2;
}
}
return _arr;
}
function _arrayWithHoles2(arr2) {
if (Array.isArray(arr2))
return arr2;
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
Object.defineProperty(subClass, "prototype", { writable: false });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var eventsFor = {
touch: {
start: "touchstart",
move: "touchmove",
stop: "touchend"
},
mouse: {
start: "mousedown",
move: "mousemove",
stop: "mouseup"
}
};
var dragEventFor = eventsFor.mouse;
var DraggableCore$1 = /* @__PURE__ */ function(_React$Component) {
_inherits2(DraggableCore2, _React$Component);
var _super = _createSuper2(DraggableCore2);
function DraggableCore2() {
var _this;
_classCallCheck2(this, DraggableCore2);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty2(_assertThisInitialized2(_this), "state", {
dragging: false,
// Used while dragging to determine deltas.
lastX: NaN,
lastY: NaN,
touchIdentifier: null
});
_defineProperty2(_assertThisInitialized2(_this), "mounted", false);
_defineProperty2(_assertThisInitialized2(_this), "handleDragStart", function(e7) {
_this.props.onMouseDown(e7);
if (!_this.props.allowAnyClick && typeof e7.button === "number" && e7.button !== 0)
return false;
var thisNode = _this.findDOMNode();
if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
throw new Error("<DraggableCore> not mounted on DragStart!");
}
var ownerDocument = thisNode.ownerDocument;
if (_this.props.disabled || !(e7.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e7.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e7.target, _this.props.cancel, thisNode)) {
return;
}
if (e7.type === "touchstart")
e7.preventDefault();
var touchIdentifier = (0, _domFns.getTouchIdentifier)(e7);
_this.setState({
touchIdentifier
});
var position2 = (0, _positionFns.getControlPosition)(e7, touchIdentifier, _assertThisInitialized2(_this));
if (position2 == null)
return;
var x2 = position2.x, y2 = position2.y;
var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized2(_this), x2, y2);
(0, _log.default)("DraggableCore: handleDragStart: %j", coreEvent);
(0, _log.default)("calling", _this.props.onStart);
var shouldUpdate = _this.props.onStart(e7, coreEvent);
if (shouldUpdate === false || _this.mounted === false)
return;
if (_this.props.enableUserSelectHack)
(0, _domFns.addUserSelectStyles)(ownerDocument);
_this.setState({
dragging: true,
lastX: x2,
lastY: y2
});
(0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);
(0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
});
_defineProperty2(_assertThisInitialized2(_this), "handleDrag", function(e7) {
var position2 = (0, _positionFns.getControlPosition)(e7, _this.state.touchIdentifier, _assertThisInitialized2(_this));
if (position2 == null)
return;
var x2 = position2.x, y2 = position2.y;
if (Array.isArray(_this.props.grid)) {
var deltaX = x2 - _this.state.lastX, deltaY = y2 - _this.state.lastY;
var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
var _snapToGrid2 = _slicedToArray2(_snapToGrid, 2);
deltaX = _snapToGrid2[0];
deltaY = _snapToGrid2[1];
if (!deltaX && !deltaY)
return;
x2 = _this.state.lastX + deltaX, y2 = _this.state.lastY + deltaY;
}
var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized2(_this), x2, y2);
(0, _log.default)("DraggableCore: handleDrag: %j", coreEvent);
var shouldUpdate = _this.props.onDrag(e7, coreEvent);
if (shouldUpdate === false || _this.mounted === false) {
try {
_this.handleDragStop(new MouseEvent("mouseup"));
} catch (err) {
var event2 = document.createEvent("MouseEvents");
event2.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
_this.handleDragStop(event2);
}
return;
}
_this.setState({
lastX: x2,
lastY: y2
});
});
_defineProperty2(_assertThisInitialized2(_this), "handleDragStop", function(e7) {
if (!_this.state.dragging)
return;
var position2 = (0, _positionFns.getControlPosition)(e7, _this.state.touchIdentifier, _assertThisInitialized2(_this));
if (position2 == null)
return;
var x2 = position2.x, y2 = position2.y;
if (Array.isArray(_this.props.grid)) {
var deltaX = x2 - _this.state.lastX || 0;
var deltaY = y2 - _this.state.lastY || 0;
var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
var _snapToGrid4 = _slicedToArray2(_snapToGrid3, 2);
deltaX = _snapToGrid4[0];
deltaY = _snapToGrid4[1];
x2 = _this.state.lastX + deltaX, y2 = _this.state.lastY + deltaY;
}
var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized2(_this), x2, y2);
var shouldContinue = _this.props.onStop(e7, coreEvent);
if (shouldContinue === false || _this.mounted === false)
return false;
var thisNode = _this.findDOMNode();
if (thisNode) {
if (_this.props.enableUserSelectHack)
(0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
}
(0, _log.default)("DraggableCore: handleDragStop: %j", coreEvent);
_this.setState({
dragging: false,
lastX: NaN,
lastY: NaN
});
if (thisNode) {
(0, _log.default)("DraggableCore: Removing handlers");
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
}
});
_defineProperty2(_assertThisInitialized2(_this), "onMouseDown", function(e7) {
dragEventFor = eventsFor.mouse;
return _this.handleDragStart(e7);
});
_defineProperty2(_assertThisInitialized2(_this), "onMouseUp", function(e7) {
dragEventFor = eventsFor.mouse;
return _this.handleDragStop(e7);
});
_defineProperty2(_assertThisInitialized2(_this), "onTouchStart", function(e7) {
dragEventFor = eventsFor.touch;
return _this.handleDragStart(e7);
});
_defineProperty2(_assertThisInitialized2(_this), "onTouchEnd", function(e7) {
dragEventFor = eventsFor.touch;
return _this.handleDragStop(e7);
});
return _this;
}
_createClass2(DraggableCore2, [{
key: "componentDidMount",
value: function componentDidMount() {
this.mounted = true;
var thisNode = this.findDOMNode();
if (thisNode) {
(0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
passive: false
});
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.mounted = false;
var thisNode = this.findDOMNode();
if (thisNode) {
var ownerDocument = thisNode.ownerDocument;
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
(0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
passive: false
});
if (this.props.enableUserSelectHack)
(0, _domFns.removeUserSelectStyles)(ownerDocument);
}
}
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
// the underlying DOM node ourselves. See the README for more information.
}, {
key: "findDOMNode",
value: function findDOMNode() {
var _this$props, _this$props2, _this$props2$nodeRef;
return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this);
}
}, {
key: "render",
value: function render3() {
return /* @__PURE__ */ React2.cloneElement(React2.Children.only(this.props.children), {
// Note: mouseMove handler is attached to document so it will still function
// when the user drags quickly and leaves the bounds of the element.
onMouseDown: this.onMouseDown,
onMouseUp: this.onMouseUp,
// onTouchStart is added on `componentDidMount` so they can be added with
// {passive: false}, which allows it to cancel. See
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
onTouchEnd: this.onTouchEnd
});
}
}]);
return DraggableCore2;
}(React2.Component);
DraggableCore.default = DraggableCore$1;
_defineProperty2(DraggableCore$1, "displayName", "DraggableCore");
_defineProperty2(DraggableCore$1, "propTypes", {
/**
* `allowAnyClick` allows dragging using any mouse button.
* By default, we only accept the left button.
*
* Defaults to `false`.
*/
allowAnyClick: _propTypes.default.bool,
/**
* `disabled`, if true, stops the <Draggable> from dragging. All handlers,
* with the exception of `onMouseDown`, will not fire.
*/
disabled: _propTypes.default.bool,
/**
* By default, we add 'user-select:none' attributes to the document body
* to prevent ugly text selection during drag. If this is causing problems
* for your app, set this to `false`.
*/
enableUserSelectHack: _propTypes.default.bool,
/**
* `offsetParent`, if set, uses the passed DOM node to compute drag offsets
* instead of using the parent node.
*/
offsetParent: function offsetParent(props, propName) {
if (props[propName] && props[propName].nodeType !== 1) {
throw new Error("Draggable's offsetParent must be a DOM Node.");
}
},
/**
* `grid` specifies the x and y that dragging should snap to.
*/
grid: _propTypes.default.arrayOf(_propTypes.default.number),
/**
* `handle` specifies a selector to be used as the handle that initiates drag.
*
* Example:
*
* ```jsx
* let App = React.createClass({
* render: function () {
* return (
* <Draggable handle=".handle">
* <div>
* <div className="handle">Click me to drag</div>
* <div>This is some other content</div>
* </div>
* </Draggable>
* );
* }
* });
* ```
*/
handle: _propTypes.default.string,
/**
* `cancel` specifies a selector to be used to prevent drag initialization.
*
* Example:
*
* ```jsx
* let App = React.createClass({
* render: function () {
* return(
* <Draggable cancel=".cancel">
* <div>
* <div className="cancel">You can't drag from here</div>
* <div>Dragging here works fine</div>
* </div>
* </Draggable>
* );
* }
* });
* ```
*/
cancel: _propTypes.default.string,
/* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
* Unfortunately, in order for <Draggable> to work properly, we need raw access
* to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
* as in this example:
*
* function MyComponent() {
* const nodeRef = React.useRef(null);
* return (
* <Draggable nodeRef={nodeRef}>
* <div ref={nodeRef}>Example Target</div>
* </Draggable>
* );
* }
*
* This can be used for arbitrarily nested components, so long as the ref ends up
* pointing to the actual child DOM node and not a custom component.
*/
nodeRef: _propTypes.default.object,
/**
* Called when dragging starts.
* If this function returns the boolean false, dragging will be canceled.
*/
onStart: _propTypes.default.func,
/**
* Called while dragging.
* If this function returns the boolean false, dragging will be canceled.
*/
onDrag: _propTypes.default.func,
/**
* Called when dragging stops.
* If this function returns the boolean false, the drag will remain active.
*/
onStop: _propTypes.default.func,
/**
* A workaround option which can be passed if onMouseDown needs to be accessed,
* since it'll always be blocked (as there is internal use of onMouseDown)
*/
onMouseDown: _propTypes.default.func,
/**
* `scale`, if set, applies scaling while dragging an element
*/
scale: _propTypes.default.number,
/**
* These properties should be defined on the child, not here.
*/
className: _shims.dontSetMe,
style: _shims.dontSetMe,
transform: _shims.dontSetMe
});
_defineProperty2(DraggableCore$1, "defaultProps", {
allowAnyClick: false,
// by default only accept left click
disabled: false,
enableUserSelectHack: true,
onStart: function onStart() {
},
onDrag: function onDrag() {
},
onStop: function onStop() {
},
onMouseDown: function onMouseDown() {
},
scale: 1
});
return DraggableCore;
}
var hasRequiredDraggable;
function requireDraggable() {
if (hasRequiredDraggable)
return Draggable;
hasRequiredDraggable = 1;
(function(exports) {
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DraggableCore", {
enumerable: true,
get: function get2() {
return _DraggableCore.default;
}
});
exports.default = void 0;
var React2 = _interopRequireWildcard(reactExports);
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _reactDom = _interopRequireDefault(reactDomExports);
var _clsx2 = _interopRequireDefault(require$$2$1);
var _domFns = requireDomFns();
var _positionFns = requirePositionFns();
var _shims = requireShims();
var _DraggableCore = _interopRequireDefault(requireDraggableCore());
var _log = _interopRequireDefault(requireLog());
var _excluded5 = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _extends2() {
_extends2 = Object.assign || function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends2.apply(this, arguments);
}
function _objectWithoutProperties2(source2, excluded) {
if (source2 == null)
return {};
var target2 = _objectWithoutPropertiesLoose2(source2, excluded);
var key2, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source2);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key2 = sourceSymbolKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source2, key2))
continue;
target2[key2] = source2[key2];
}
}
return target2;
}
function _objectWithoutPropertiesLoose2(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _slicedToArray2(arr2, i2) {
return _arrayWithHoles2(arr2) || _iterableToArrayLimit2(arr2, i2) || _unsupportedIterableToArray2(arr2, i2) || _nonIterableRest2();
}
function _nonIterableRest2() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray2(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray2(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray2(o2, minLen);
}
function _arrayLikeToArray2(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++) {
arr22[i2] = arr2[i2];
}
return arr22;
}
function _iterableToArrayLimit2(arr2, i2) {
var _i2 = arr2 == null ? null : typeof Symbol !== "undefined" && arr2[Symbol.iterator] || arr2["@@iterator"];
if (_i2 == null)
return;
var _arr = [];
var _n2 = true;
var _d = false;
var _s, _e2;
try {
for (_i2 = _i2.call(arr2); !(_n2 = (_s = _i2.next()).done); _n2 = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e2 = err;
} finally {
try {
if (!_n2 && _i2["return"] != null)
_i2["return"]();
} finally {
if (_d)
throw _e2;
}
}
return _arr;
}
function _arrayWithHoles2(arr2) {
if (Array.isArray(arr2))
return arr2;
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
Object.defineProperty(subClass, "prototype", { writable: false });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var Draggable2 = /* @__PURE__ */ function(_React$Component) {
_inherits2(Draggable3, _React$Component);
var _super = _createSuper2(Draggable3);
function Draggable3(props) {
var _this;
_classCallCheck2(this, Draggable3);
_this = _super.call(this, props);
_defineProperty2(_assertThisInitialized2(_this), "onDragStart", function(e7, coreData) {
(0, _log.default)("Draggable: onDragStart: %j", coreData);
var shouldStart = _this.props.onStart(e7, (0, _positionFns.createDraggableData)(_assertThisInitialized2(_this), coreData));
if (shouldStart === false)
return false;
_this.setState({
dragging: true,
dragged: true
});
});
_defineProperty2(_assertThisInitialized2(_this), "onDrag", function(e7, coreData) {
if (!_this.state.dragging)
return false;
(0, _log.default)("Draggable: onDrag: %j", coreData);
var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized2(_this), coreData);
var newState = {
x: uiData.x,
y: uiData.y
};
if (_this.props.bounds) {
var x2 = newState.x, y2 = newState.y;
newState.x += _this.state.slackX;
newState.y += _this.state.slackY;
var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized2(_this), newState.x, newState.y), _getBoundPosition2 = _slicedToArray2(_getBoundPosition, 2), newStateX = _getBoundPosition2[0], newStateY = _getBoundPosition2[1];
newState.x = newStateX;
newState.y = newStateY;
newState.slackX = _this.state.slackX + (x2 - newState.x);
newState.slackY = _this.state.slackY + (y2 - newState.y);
uiData.x = newState.x;
uiData.y = newState.y;
uiData.deltaX = newState.x - _this.state.x;
uiData.deltaY = newState.y - _this.state.y;
}
var shouldUpdate = _this.props.onDrag(e7, uiData);
if (shouldUpdate === false)
return false;
_this.setState(newState);
});
_defineProperty2(_assertThisInitialized2(_this), "onDragStop", function(e7, coreData) {
if (!_this.state.dragging)
return false;
var shouldContinue = _this.props.onStop(e7, (0, _positionFns.createDraggableData)(_assertThisInitialized2(_this), coreData));
if (shouldContinue === false)
return false;
(0, _log.default)("Draggable: onDragStop: %j", coreData);
var newState = {
dragging: false,
slackX: 0,
slackY: 0
};
var controlled = Boolean(_this.props.position);
if (controlled) {
var _this$props$position = _this.props.position, x2 = _this$props$position.x, y2 = _this$props$position.y;
newState.x = x2;
newState.y = y2;
}
_this.setState(newState);
});
_this.state = {
// Whether or not we are currently dragging.
dragging: false,
// Whether or not we have been dragged before.
dragged: false,
// Current transform x and y.
x: props.position ? props.position.x : props.defaultPosition.x,
y: props.position ? props.position.y : props.defaultPosition.y,
prevPropsPosition: _objectSpread3({}, props.position),
// Used for compensating for out-of-bounds drags
slackX: 0,
slackY: 0,
// Can only determine if SVG after mounting
isElementSVG: false
};
if (props.position && !(props.onDrag || props.onStop)) {
console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
}
return _this;
}
_createClass2(Draggable3, [{
key: "componentDidMount",
value: function componentDidMount() {
if (typeof window.SVGElement !== "undefined" && this.findDOMNode() instanceof window.SVGElement) {
this.setState({
isElementSVG: true
});
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.setState({
dragging: false
});
}
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
// the underlying DOM node ourselves. See the README for more information.
}, {
key: "findDOMNode",
value: function findDOMNode() {
var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;
return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
}
}, {
key: "render",
value: function render3() {
var _clsx;
var _this$props2 = this.props;
_this$props2.axis;
_this$props2.bounds;
var children2 = _this$props2.children, defaultPosition = _this$props2.defaultPosition, defaultClassName = _this$props2.defaultClassName, defaultClassNameDragging = _this$props2.defaultClassNameDragging, defaultClassNameDragged = _this$props2.defaultClassNameDragged, position2 = _this$props2.position, positionOffset = _this$props2.positionOffset;
_this$props2.scale;
var draggableCoreProps = _objectWithoutProperties2(_this$props2, _excluded5);
var style2 = {};
var svgTransform = null;
var controlled = Boolean(position2);
var draggable = !controlled || this.state.dragging;
var validPosition = position2 || defaultPosition;
var transformOpts = {
// Set left if horizontal drag is enabled
x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
// Set top if vertical drag is enabled
y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
};
if (this.state.isElementSVG) {
svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
} else {
style2 = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
}
var className = (0, _clsx2.default)(children2.props.className || "", defaultClassName, (_clsx = {}, _defineProperty2(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty2(_clsx, defaultClassNameDragged, this.state.dragged), _clsx));
return /* @__PURE__ */ React2.createElement(_DraggableCore.default, _extends2({}, draggableCoreProps, {
onStart: this.onDragStart,
onDrag: this.onDrag,
onStop: this.onDragStop
}), /* @__PURE__ */ React2.cloneElement(React2.Children.only(children2), {
className,
style: _objectSpread3(_objectSpread3({}, children2.props.style), style2),
transform: svgTransform
}));
}
}], [{
key: "getDerivedStateFromProps",
value: (
// React 16.3+
// Arity (props, state)
function getDerivedStateFromProps(_ref3, _ref22) {
var position2 = _ref3.position;
var prevPropsPosition = _ref22.prevPropsPosition;
if (position2 && (!prevPropsPosition || position2.x !== prevPropsPosition.x || position2.y !== prevPropsPosition.y)) {
(0, _log.default)("Draggable: getDerivedStateFromProps %j", {
position: position2,
prevPropsPosition
});
return {
x: position2.x,
y: position2.y,
prevPropsPosition: _objectSpread3({}, position2)
};
}
return null;
}
)
}]);
return Draggable3;
}(React2.Component);
exports.default = Draggable2;
_defineProperty2(Draggable2, "displayName", "Draggable");
_defineProperty2(Draggable2, "propTypes", _objectSpread3(_objectSpread3({}, _DraggableCore.default.propTypes), {}, {
/**
* `axis` determines which axis the draggable can move.
*
* Note that all callbacks will still return data as normal. This only
* controls flushing to the DOM.
*
* 'both' allows movement horizontally and vertically.
* 'x' limits movement to horizontal axis.
* 'y' limits movement to vertical axis.
* 'none' limits all movement.
*
* Defaults to 'both'.
*/
axis: _propTypes.default.oneOf(["both", "x", "y", "none"]),
/**
* `bounds` determines the range of movement available to the element.
* Available values are:
*
* 'parent' restricts movement within the Draggable's parent node.
*
* Alternatively, pass an object with the following properties, all of which are optional:
*
* {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
*
* All values are in px.
*
* Example:
*
* ```jsx
* let App = React.createClass({
* render: function () {
* return (
* <Draggable bounds={{right: 300, bottom: 300}}>
* <div>Content</div>
* </Draggable>
* );
* }
* });
* ```
*/
bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
left: _propTypes.default.number,
right: _propTypes.default.number,
top: _propTypes.default.number,
bottom: _propTypes.default.number
}), _propTypes.default.string, _propTypes.default.oneOf([false])]),
defaultClassName: _propTypes.default.string,
defaultClassNameDragging: _propTypes.default.string,
defaultClassNameDragged: _propTypes.default.string,
/**
* `defaultPosition` specifies the x and y that the dragged item should start at
*
* Example:
*
* ```jsx
* let App = React.createClass({
* render: function () {
* return (
* <Draggable defaultPosition={{x: 25, y: 25}}>
* <div>I start with transformX: 25px and transformY: 25px;</div>
* </Draggable>
* );
* }
* });
* ```
*/
defaultPosition: _propTypes.default.shape({
x: _propTypes.default.number,
y: _propTypes.default.number
}),
positionOffset: _propTypes.default.shape({
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
}),
/**
* `position`, if present, defines the current position of the element.
*
* This is similar to how form elements in React work - if no `position` is supplied, the component
* is uncontrolled.
*
* Example:
*
* ```jsx
* let App = React.createClass({
* render: function () {
* return (
* <Draggable position={{x: 25, y: 25}}>
* <div>I start with transformX: 25px and transformY: 25px;</div>
* </Draggable>
* );
* }
* });
* ```
*/
position: _propTypes.default.shape({
x: _propTypes.default.number,
y: _propTypes.default.number
}),
/**
* These properties should be defined on the child, not here.
*/
className: _shims.dontSetMe,
style: _shims.dontSetMe,
transform: _shims.dontSetMe
}));
_defineProperty2(Draggable2, "defaultProps", _objectSpread3(_objectSpread3({}, _DraggableCore.default.defaultProps), {}, {
axis: "both",
bounds: false,
defaultClassName: "react-draggable",
defaultClassNameDragging: "react-draggable-dragging",
defaultClassNameDragged: "react-draggable-dragged",
defaultPosition: {
x: 0,
y: 0
},
scale: 1
}));
})(Draggable);
return Draggable;
}
var hasRequiredCjs$1;
function requireCjs$1() {
if (hasRequiredCjs$1)
return cjs$1.exports;
hasRequiredCjs$1 = 1;
var _require = requireDraggable(), Draggable2 = _require.default, DraggableCore2 = _require.DraggableCore;
cjs$1.exports = Draggable2;
cjs$1.exports.default = Draggable2;
cjs$1.exports.DraggableCore = DraggableCore2;
return cjs$1.exports;
}
var reactResizable = { exports: {} };
var Resizable = {};
var utils = {};
var hasRequiredUtils;
function requireUtils() {
if (hasRequiredUtils)
return utils;
hasRequiredUtils = 1;
utils.__esModule = true;
utils.cloneElement = cloneElement;
var _react = _interopRequireDefault(reactExports);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty2(obj, key2, value2) {
key2 = _toPropertyKey2(key2);
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
function _toPropertyKey2(arg) {
var key2 = _toPrimitive2(arg, "string");
return typeof key2 === "symbol" ? key2 : String(key2);
}
function _toPrimitive2(input, hint) {
if (typeof input !== "object" || input === null)
return input;
var prim = input[Symbol.toPrimitive];
if (prim !== void 0) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object")
return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function cloneElement(element2, props) {
if (props.style && element2.props.style) {
props.style = _objectSpread3(_objectSpread3({}, element2.props.style), props.style);
}
if (props.className && element2.props.className) {
props.className = element2.props.className + " " + props.className;
}
return /* @__PURE__ */ _react.default.cloneElement(element2, props);
}
return utils;
}
var propTypes$2 = {};
var hasRequiredPropTypes;
function requirePropTypes() {
if (hasRequiredPropTypes)
return propTypes$2;
hasRequiredPropTypes = 1;
propTypes$2.__esModule = true;
propTypes$2.resizableProps = void 0;
var _propTypes = _interopRequireDefault(requirePropTypes$1());
requireCjs$1();
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var resizableProps = {
/*
* Restricts resizing to a particular axis (default: 'both')
* 'both' - allows resizing by width or height
* 'x' - only allows the width to be changed
* 'y' - only allows the height to be changed
* 'none' - disables resizing altogether
* */
axis: _propTypes.default.oneOf(["both", "x", "y", "none"]),
className: _propTypes.default.string,
/*
* Require that one and only one child be present.
* */
children: _propTypes.default.element.isRequired,
/*
* These will be passed wholesale to react-draggable's DraggableCore
* */
draggableOpts: _propTypes.default.shape({
allowAnyClick: _propTypes.default.bool,
cancel: _propTypes.default.string,
children: _propTypes.default.node,
disabled: _propTypes.default.bool,
enableUserSelectHack: _propTypes.default.bool,
offsetParent: _propTypes.default.node,
grid: _propTypes.default.arrayOf(_propTypes.default.number),
handle: _propTypes.default.string,
nodeRef: _propTypes.default.object,
onStart: _propTypes.default.func,
onDrag: _propTypes.default.func,
onStop: _propTypes.default.func,
onMouseDown: _propTypes.default.func,
scale: _propTypes.default.number
}),
/*
* Initial height
* */
height: function height2() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var props = args[0];
if (props.axis === "both" || props.axis === "y") {
var _PropTypes$number;
return (_PropTypes$number = _propTypes.default.number).isRequired.apply(_PropTypes$number, args);
}
return _propTypes.default.number.apply(_propTypes.default, args);
},
/*
* Customize cursor resize handle
* */
handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
/*
* If you change this, be sure to update your css
* */
handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
lockAspectRatio: _propTypes.default.bool,
/*
* Max X & Y measure
* */
maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
/*
* Min X & Y measure
* */
minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
/*
* Called on stop resize event
* */
onResizeStop: _propTypes.default.func,
/*
* Called on start resize event
* */
onResizeStart: _propTypes.default.func,
/*
* Called on resize event
* */
onResize: _propTypes.default.func,
/*
* Defines which resize handles should be rendered (default: 'se')
* 's' - South handle (bottom-center)
* 'w' - West handle (left-center)
* 'e' - East handle (right-center)
* 'n' - North handle (top-center)
* 'sw' - Southwest handle (bottom-left)
* 'nw' - Northwest handle (top-left)
* 'se' - Southeast handle (bottom-right)
* 'ne' - Northeast handle (top-center)
* */
resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"])),
/*
* If `transform: scale(n)` is set on the parent, this should be set to `n`.
* */
transformScale: _propTypes.default.number,
/*
* Initial width
*/
width: function width2() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var props = args[0];
if (props.axis === "both" || props.axis === "x") {
var _PropTypes$number2;
return (_PropTypes$number2 = _propTypes.default.number).isRequired.apply(_PropTypes$number2, args);
}
return _propTypes.default.number.apply(_propTypes.default, args);
}
};
propTypes$2.resizableProps = resizableProps;
return propTypes$2;
}
var hasRequiredResizable;
function requireResizable() {
if (hasRequiredResizable)
return Resizable;
hasRequiredResizable = 1;
Resizable.__esModule = true;
Resizable.default = void 0;
var React2 = _interopRequireWildcard(reactExports);
var _reactDraggable = requireCjs$1();
var _utils = requireUtils();
var _propTypes = requirePropTypes();
var _excluded5 = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _extends2() {
_extends2 = Object.assign ? Object.assign.bind() : function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends2.apply(this, arguments);
}
function _objectWithoutPropertiesLoose2(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty2(obj, key2, value2) {
key2 = _toPropertyKey2(key2);
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
function _toPropertyKey2(arg) {
var key2 = _toPrimitive2(arg, "string");
return typeof key2 === "symbol" ? key2 : String(key2);
}
function _toPrimitive2(input, hint) {
if (typeof input !== "object" || input === null)
return input;
var prim = input[Symbol.toPrimitive];
if (prim !== void 0) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object")
return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _inheritsLoose2(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
var Resizable$1 = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose2(Resizable2, _React$Component);
function Resizable2() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.handleRefs = {};
_this.lastHandleRect = null;
_this.slack = null;
return _this;
}
var _proto = Resizable2.prototype;
_proto.componentWillUnmount = function componentWillUnmount() {
this.resetData();
};
_proto.resetData = function resetData() {
this.lastHandleRect = this.slack = null;
};
_proto.runConstraints = function runConstraints(width2, height2) {
var _this$props = this.props, minConstraints = _this$props.minConstraints, maxConstraints = _this$props.maxConstraints, lockAspectRatio = _this$props.lockAspectRatio;
if (!minConstraints && !maxConstraints && !lockAspectRatio)
return [width2, height2];
if (lockAspectRatio) {
var ratio = this.props.width / this.props.height;
var deltaW = width2 - this.props.width;
var deltaH = height2 - this.props.height;
if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
height2 = width2 / ratio;
} else {
width2 = height2 * ratio;
}
}
var oldW = width2, oldH = height2;
var _ref3 = this.slack || [0, 0], slackW = _ref3[0], slackH = _ref3[1];
width2 += slackW;
height2 += slackH;
if (minConstraints) {
width2 = Math.max(minConstraints[0], width2);
height2 = Math.max(minConstraints[1], height2);
}
if (maxConstraints) {
width2 = Math.min(maxConstraints[0], width2);
height2 = Math.min(maxConstraints[1], height2);
}
this.slack = [slackW + (oldW - width2), slackH + (oldH - height2)];
return [width2, height2];
};
_proto.resizeHandler = function resizeHandler(handlerName, axis) {
var _this2 = this;
return function(e7, _ref22) {
var node2 = _ref22.node, deltaX = _ref22.deltaX, deltaY = _ref22.deltaY;
if (handlerName === "onResizeStart")
_this2.resetData();
var canDragX = (_this2.props.axis === "both" || _this2.props.axis === "x") && axis !== "n" && axis !== "s";
var canDragY = (_this2.props.axis === "both" || _this2.props.axis === "y") && axis !== "e" && axis !== "w";
if (!canDragX && !canDragY)
return;
var axisV = axis[0];
var axisH = axis[axis.length - 1];
var handleRect = node2.getBoundingClientRect();
if (_this2.lastHandleRect != null) {
if (axisH === "w") {
var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
deltaX += deltaLeftSinceLast;
}
if (axisV === "n") {
var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
deltaY += deltaTopSinceLast;
}
}
_this2.lastHandleRect = handleRect;
if (axisH === "w")
deltaX = -deltaX;
if (axisV === "n")
deltaY = -deltaY;
var width2 = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
var height2 = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0);
var _this2$runConstraints = _this2.runConstraints(width2, height2);
width2 = _this2$runConstraints[0];
height2 = _this2$runConstraints[1];
var dimensionsChanged = width2 !== _this2.props.width || height2 !== _this2.props.height;
var cb2 = typeof _this2.props[handlerName] === "function" ? _this2.props[handlerName] : null;
var shouldSkipCb = handlerName === "onResize" && !dimensionsChanged;
if (cb2 && !shouldSkipCb) {
e7.persist == null ? void 0 : e7.persist();
cb2(e7, {
node: node2,
size: {
width: width2,
height: height2
},
handle: axis
});
}
if (handlerName === "onResizeStop")
_this2.resetData();
};
};
_proto.renderResizeHandle = function renderResizeHandle(handleAxis, ref2) {
var handle2 = this.props.handle;
if (!handle2) {
return /* @__PURE__ */ React2.createElement("span", {
className: "react-resizable-handle react-resizable-handle-" + handleAxis,
ref: ref2
});
}
if (typeof handle2 === "function") {
return handle2(handleAxis, ref2);
}
var isDOMElement2 = typeof handle2.type === "string";
var props = _objectSpread3({
ref: ref2
}, isDOMElement2 ? {} : {
handleAxis
});
return /* @__PURE__ */ React2.cloneElement(handle2, props);
};
_proto.render = function render3() {
var _this3 = this;
var _this$props2 = this.props, children2 = _this$props2.children, className = _this$props2.className, draggableOpts = _this$props2.draggableOpts;
_this$props2.width;
_this$props2.height;
_this$props2.handle;
_this$props2.handleSize;
_this$props2.lockAspectRatio;
_this$props2.axis;
_this$props2.minConstraints;
_this$props2.maxConstraints;
_this$props2.onResize;
_this$props2.onResizeStop;
_this$props2.onResizeStart;
var resizeHandles = _this$props2.resizeHandles;
_this$props2.transformScale;
var p2 = _objectWithoutPropertiesLoose2(_this$props2, _excluded5);
return (0, _utils.cloneElement)(children2, _objectSpread3(_objectSpread3({}, p2), {}, {
className: (className ? className + " " : "") + "react-resizable",
children: [].concat(children2.props.children, resizeHandles.map(function(handleAxis) {
var _this3$handleRefs$han;
var ref2 = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /* @__PURE__ */ React2.createRef();
return /* @__PURE__ */ React2.createElement(_reactDraggable.DraggableCore, _extends2({}, draggableOpts, {
nodeRef: ref2,
key: "resizableHandle-" + handleAxis,
onStop: _this3.resizeHandler("onResizeStop", handleAxis),
onStart: _this3.resizeHandler("onResizeStart", handleAxis),
onDrag: _this3.resizeHandler("onResize", handleAxis)
}), _this3.renderResizeHandle(handleAxis, ref2));
}))
}));
};
return Resizable2;
}(React2.Component);
Resizable.default = Resizable$1;
Resizable$1.propTypes = _propTypes.resizableProps;
Resizable$1.defaultProps = {
axis: "both",
handleSize: [20, 20],
lockAspectRatio: false,
minConstraints: [20, 20],
maxConstraints: [Infinity, Infinity],
resizeHandles: ["se"],
transformScale: 1
};
return Resizable;
}
var ResizableBox = {};
var hasRequiredResizableBox;
function requireResizableBox() {
if (hasRequiredResizableBox)
return ResizableBox;
hasRequiredResizableBox = 1;
ResizableBox.__esModule = true;
ResizableBox.default = void 0;
var React2 = _interopRequireWildcard(reactExports);
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _Resizable = _interopRequireDefault(requireResizable());
var _propTypes2 = requirePropTypes();
var _excluded5 = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _extends2() {
_extends2 = Object.assign ? Object.assign.bind() : function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends2.apply(this, arguments);
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty2(obj, key2, value2) {
key2 = _toPropertyKey2(key2);
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
function _toPropertyKey2(arg) {
var key2 = _toPrimitive2(arg, "string");
return typeof key2 === "symbol" ? key2 : String(key2);
}
function _toPrimitive2(input, hint) {
if (typeof input !== "object" || input === null)
return input;
var prim = input[Symbol.toPrimitive];
if (prim !== void 0) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object")
return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _objectWithoutPropertiesLoose2(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
function _inheritsLoose2(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
var ResizableBox$1 = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose2(ResizableBox2, _React$Component);
function ResizableBox2() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.state = {
width: _this.props.width,
height: _this.props.height,
propsWidth: _this.props.width,
propsHeight: _this.props.height
};
_this.onResize = function(e7, data2) {
var size = data2.size;
if (_this.props.onResize) {
e7.persist == null ? void 0 : e7.persist();
_this.setState(size, function() {
return _this.props.onResize && _this.props.onResize(e7, data2);
});
} else {
_this.setState(size);
}
};
return _this;
}
ResizableBox2.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
return {
width: props.width,
height: props.height,
propsWidth: props.width,
propsHeight: props.height
};
}
return null;
};
var _proto = ResizableBox2.prototype;
_proto.render = function render3() {
var _this$props = this.props, handle2 = _this$props.handle, handleSize = _this$props.handleSize;
_this$props.onResize;
var onResizeStart = _this$props.onResizeStart, onResizeStop = _this$props.onResizeStop, draggableOpts = _this$props.draggableOpts, minConstraints = _this$props.minConstraints, maxConstraints = _this$props.maxConstraints, lockAspectRatio = _this$props.lockAspectRatio, axis = _this$props.axis;
_this$props.width;
_this$props.height;
var resizeHandles = _this$props.resizeHandles, style2 = _this$props.style, transformScale = _this$props.transformScale, props = _objectWithoutPropertiesLoose2(_this$props, _excluded5);
return /* @__PURE__ */ React2.createElement(_Resizable.default, {
axis,
draggableOpts,
handle: handle2,
handleSize,
height: this.state.height,
lockAspectRatio,
maxConstraints,
minConstraints,
onResizeStart,
onResize: this.onResize,
onResizeStop,
resizeHandles,
transformScale,
width: this.state.width
}, /* @__PURE__ */ React2.createElement("div", _extends2({}, props, {
style: _objectSpread3(_objectSpread3({}, style2), {}, {
width: this.state.width + "px",
height: this.state.height + "px"
})
})));
};
return ResizableBox2;
}(React2.Component);
ResizableBox.default = ResizableBox$1;
ResizableBox$1.propTypes = _objectSpread3(_objectSpread3({}, _propTypes2.resizableProps), {}, {
children: _propTypes.default.element
});
return ResizableBox;
}
var hasRequiredReactResizable;
function requireReactResizable() {
if (hasRequiredReactResizable)
return reactResizable.exports;
hasRequiredReactResizable = 1;
reactResizable.exports = function() {
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
};
reactResizable.exports.Resizable = requireResizable().default;
reactResizable.exports.ResizableBox = requireResizableBox().default;
return reactResizable.exports;
}
var ReactGridLayoutPropTypes = {};
var hasRequiredReactGridLayoutPropTypes;
function requireReactGridLayoutPropTypes() {
if (hasRequiredReactGridLayoutPropTypes)
return ReactGridLayoutPropTypes;
hasRequiredReactGridLayoutPropTypes = 1;
Object.defineProperty(ReactGridLayoutPropTypes, "__esModule", {
value: true
});
ReactGridLayoutPropTypes.resizeHandleType = ReactGridLayoutPropTypes.resizeHandleAxesType = ReactGridLayoutPropTypes.default = void 0;
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _react = _interopRequireDefault(reactExports);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var resizeHandleAxesType = _propTypes.default.arrayOf(_propTypes.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"]));
ReactGridLayoutPropTypes.resizeHandleAxesType = resizeHandleAxesType;
var resizeHandleType = _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]);
ReactGridLayoutPropTypes.resizeHandleType = resizeHandleType;
var _default = {
//
// Basic props
//
className: _propTypes.default.string,
style: _propTypes.default.object,
// This can be set explicitly. If it is not set, it will automatically
// be set to the container width. Note that resizes will *not* cause this to adjust.
// If you need that behavior, use WidthProvider.
width: _propTypes.default.number,
// If true, the container height swells and contracts to fit contents
autoSize: _propTypes.default.bool,
// # of cols.
cols: _propTypes.default.number,
// A selector that will not be draggable.
draggableCancel: _propTypes.default.string,
// A selector for the draggable handler
draggableHandle: _propTypes.default.string,
// Deprecated
verticalCompact: function verticalCompact(props) {
if (props.verticalCompact === false && false) {
console.warn(
// eslint-disable-line no-console
'`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.'
);
}
},
// Choose vertical or hotizontal compaction
compactType: _propTypes.default.oneOf(["vertical", "horizontal"]),
// layout is an array of object with the format:
// {x: Number, y: Number, w: Number, h: Number, i: String}
layout: function layout(props) {
var layout2 = props.layout;
if (layout2 === void 0)
return;
requireUtils$1().validateLayout(layout2, "layout");
},
//
// Grid Dimensions
//
// Margin between items [x, y] in px
margin: _propTypes.default.arrayOf(_propTypes.default.number),
// Padding inside the container [x, y] in px
containerPadding: _propTypes.default.arrayOf(_propTypes.default.number),
// Rows have a static height, but you can change this based on breakpoints if you like
rowHeight: _propTypes.default.number,
// Default Infinity, but you can specify a max here if you like.
// Note that this isn't fully fleshed out and won't error if you specify a layout that
// extends beyond the row capacity. It will, however, not allow users to drag/resize
// an item past the barrier. They can push items beyond the barrier, though.
// Intentionally not documented for this reason.
maxRows: _propTypes.default.number,
//
// Flags
//
isBounded: _propTypes.default.bool,
isDraggable: _propTypes.default.bool,
isResizable: _propTypes.default.bool,
// If true, grid can be placed one over the other.
allowOverlap: _propTypes.default.bool,
// If true, grid items won't change position when being dragged over.
preventCollision: _propTypes.default.bool,
// Use CSS transforms instead of top/left
useCSSTransforms: _propTypes.default.bool,
// parent layout transform scale
transformScale: _propTypes.default.number,
// If true, an external element can trigger onDrop callback with a specific grid position as a parameter
isDroppable: _propTypes.default.bool,
// Resize handle options
resizeHandles: resizeHandleAxesType,
resizeHandle: resizeHandleType,
//
// Callbacks
//
// Callback so you can save the layout. Calls after each drag & resize stops.
onLayoutChange: _propTypes.default.func,
// Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node).
// All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'.
onDragStart: _propTypes.default.func,
// Calls on each drag movement.
onDrag: _propTypes.default.func,
// Calls when drag is complete.
onDragStop: _propTypes.default.func,
//Calls when resize starts.
onResizeStart: _propTypes.default.func,
// Calls when resize movement happens.
onResize: _propTypes.default.func,
// Calls when resize is complete.
onResizeStop: _propTypes.default.func,
// Calls when some element is dropped.
onDrop: _propTypes.default.func,
//
// Other validations
//
droppingItem: _propTypes.default.shape({
i: _propTypes.default.string.isRequired,
w: _propTypes.default.number.isRequired,
h: _propTypes.default.number.isRequired
}),
// Children must not have duplicate keys.
children: function children2(props, propName) {
var children3 = props[propName];
var keys3 = {};
_react.default.Children.forEach(children3, function(child) {
if ((child === null || child === void 0 ? void 0 : child.key) == null)
return;
if (keys3[child.key]) {
throw new Error('Duplicate child key "' + child.key + '" found! This will cause problems in ReactGridLayout.');
}
keys3[child.key] = true;
});
},
// Optional ref for getting a reference for the wrapping div.
innerRef: _propTypes.default.any
};
ReactGridLayoutPropTypes.default = _default;
return ReactGridLayoutPropTypes;
}
var hasRequiredGridItem;
function requireGridItem() {
if (hasRequiredGridItem)
return GridItem;
hasRequiredGridItem = 1;
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(GridItem, "__esModule", {
value: true
});
GridItem.default = void 0;
var _react = _interopRequireDefault(reactExports);
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _reactDraggable = requireCjs$1();
var _reactResizable = requireReactResizable();
var _utils = requireUtils$1();
var _calculateUtils = requireCalculateUtils();
var _ReactGridLayoutPropTypes = requireReactGridLayoutPropTypes();
var _clsx = _interopRequireDefault(require$$2$1);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
Object.defineProperty(subClass, "prototype", { writable: false });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var GridItem$1 = /* @__PURE__ */ function(_React$Component) {
_inherits2(GridItem2, _React$Component);
var _super = _createSuper2(GridItem2);
function GridItem2() {
var _this;
_classCallCheck2(this, GridItem2);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty2(_assertThisInitialized2(_this), "state", {
resizing: null,
dragging: null,
className: ""
});
_defineProperty2(_assertThisInitialized2(_this), "elementRef", /* @__PURE__ */ _react.default.createRef());
_defineProperty2(_assertThisInitialized2(_this), "onDragStart", function(e7, _ref3) {
var node2 = _ref3.node;
var _this$props = _this.props, onDragStart = _this$props.onDragStart, transformScale = _this$props.transformScale;
if (!onDragStart)
return;
var newPosition = {
top: 0,
left: 0
};
var offsetParent = node2.offsetParent;
if (!offsetParent)
return;
var parentRect = offsetParent.getBoundingClientRect();
var clientRect = node2.getBoundingClientRect();
var cLeft = clientRect.left / transformScale;
var pLeft = parentRect.left / transformScale;
var cTop = clientRect.top / transformScale;
var pTop = parentRect.top / transformScale;
newPosition.left = cLeft - pLeft + offsetParent.scrollLeft;
newPosition.top = cTop - pTop + offsetParent.scrollTop;
_this.setState({
dragging: newPosition
});
var _calcXY = (0, _calculateUtils.calcXY)(_this.getPositionParams(), newPosition.top, newPosition.left, _this.props.w, _this.props.h), x2 = _calcXY.x, y2 = _calcXY.y;
return onDragStart.call(_assertThisInitialized2(_this), _this.props.i, x2, y2, {
e: e7,
node: node2,
newPosition
});
});
_defineProperty2(_assertThisInitialized2(_this), "onDrag", function(e7, _ref22) {
var node2 = _ref22.node, deltaX = _ref22.deltaX, deltaY = _ref22.deltaY;
var onDrag = _this.props.onDrag;
if (!onDrag)
return;
if (!_this.state.dragging) {
throw new Error("onDrag called before onDragStart.");
}
var top2 = _this.state.dragging.top + deltaY;
var left2 = _this.state.dragging.left + deltaX;
var _this$props2 = _this.props, isBounded = _this$props2.isBounded, i2 = _this$props2.i, w2 = _this$props2.w, h2 = _this$props2.h, containerWidth = _this$props2.containerWidth;
var positionParams = _this.getPositionParams();
if (isBounded) {
var offsetParent = node2.offsetParent;
if (offsetParent) {
var _this$props3 = _this.props, margin = _this$props3.margin, rowHeight = _this$props3.rowHeight;
var bottomBoundary = offsetParent.clientHeight - (0, _calculateUtils.calcGridItemWHPx)(h2, rowHeight, margin[1]);
top2 = (0, _calculateUtils.clamp)(top2, 0, bottomBoundary);
var colWidth = (0, _calculateUtils.calcGridColWidth)(positionParams);
var rightBoundary = containerWidth - (0, _calculateUtils.calcGridItemWHPx)(w2, colWidth, margin[0]);
left2 = (0, _calculateUtils.clamp)(left2, 0, rightBoundary);
}
}
var newPosition = {
top: top2,
left: left2
};
_this.setState({
dragging: newPosition
});
var _calcXY2 = (0, _calculateUtils.calcXY)(positionParams, top2, left2, w2, h2), x2 = _calcXY2.x, y2 = _calcXY2.y;
return onDrag.call(_assertThisInitialized2(_this), i2, x2, y2, {
e: e7,
node: node2,
newPosition
});
});
_defineProperty2(_assertThisInitialized2(_this), "onDragStop", function(e7, _ref3) {
var node2 = _ref3.node;
var onDragStop = _this.props.onDragStop;
if (!onDragStop)
return;
if (!_this.state.dragging) {
throw new Error("onDragEnd called before onDragStart.");
}
var _this$props4 = _this.props, w2 = _this$props4.w, h2 = _this$props4.h, i2 = _this$props4.i;
var _this$state$dragging = _this.state.dragging, left2 = _this$state$dragging.left, top2 = _this$state$dragging.top;
var newPosition = {
top: top2,
left: left2
};
_this.setState({
dragging: null
});
var _calcXY3 = (0, _calculateUtils.calcXY)(_this.getPositionParams(), top2, left2, w2, h2), x2 = _calcXY3.x, y2 = _calcXY3.y;
return onDragStop.call(_assertThisInitialized2(_this), i2, x2, y2, {
e: e7,
node: node2,
newPosition
});
});
_defineProperty2(_assertThisInitialized2(_this), "onResizeStop", function(e7, callbackData) {
_this.onResizeHandler(e7, callbackData, "onResizeStop");
});
_defineProperty2(_assertThisInitialized2(_this), "onResizeStart", function(e7, callbackData) {
_this.onResizeHandler(e7, callbackData, "onResizeStart");
});
_defineProperty2(_assertThisInitialized2(_this), "onResize", function(e7, callbackData) {
_this.onResizeHandler(e7, callbackData, "onResize");
});
return _this;
}
_createClass2(GridItem2, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps, nextState) {
if (this.props.children !== nextProps.children)
return true;
if (this.props.droppingPosition !== nextProps.droppingPosition)
return true;
var oldPosition = (0, _calculateUtils.calcGridItemPosition)(this.getPositionParams(this.props), this.props.x, this.props.y, this.props.w, this.props.h, this.state);
var newPosition = (0, _calculateUtils.calcGridItemPosition)(this.getPositionParams(nextProps), nextProps.x, nextProps.y, nextProps.w, nextProps.h, nextState);
return !(0, _utils.fastPositionEqual)(oldPosition, newPosition) || this.props.useCSSTransforms !== nextProps.useCSSTransforms;
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
this.moveDroppingItem({});
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
this.moveDroppingItem(prevProps);
}
// When a droppingPosition is present, this means we should fire a move event, as if we had moved
// this element by `x, y` pixels.
}, {
key: "moveDroppingItem",
value: function moveDroppingItem(prevProps) {
var droppingPosition = this.props.droppingPosition;
if (!droppingPosition)
return;
var node2 = this.elementRef.current;
if (!node2)
return;
var prevDroppingPosition = prevProps.droppingPosition || {
left: 0,
top: 0
};
var dragging = this.state.dragging;
var shouldDrag = dragging && droppingPosition.left !== prevDroppingPosition.left || droppingPosition.top !== prevDroppingPosition.top;
if (!dragging) {
this.onDragStart(droppingPosition.e, {
node: node2,
deltaX: droppingPosition.left,
deltaY: droppingPosition.top
});
} else if (shouldDrag) {
var deltaX = droppingPosition.left - dragging.left;
var deltaY = droppingPosition.top - dragging.top;
this.onDrag(droppingPosition.e, {
node: node2,
deltaX,
deltaY
});
}
}
}, {
key: "getPositionParams",
value: function getPositionParams() {
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
return {
cols: props.cols,
containerPadding: props.containerPadding,
containerWidth: props.containerWidth,
margin: props.margin,
maxRows: props.maxRows,
rowHeight: props.rowHeight
};
}
/**
* This is where we set the grid item's absolute placement. It gets a little tricky because we want to do it
* well when server rendering, and the only way to do that properly is to use percentage width/left because
* we don't know exactly what the browser viewport is.
* Unfortunately, CSS Transforms, which are great for performance, break in this instance because a percentage
* left is relative to the item itself, not its container! So we cannot use them on the server rendering pass.
*
* @param {Object} pos Position object with width, height, left, top.
* @return {Object} Style object.
*/
}, {
key: "createStyle",
value: function createStyle(pos) {
var _this$props5 = this.props, usePercentages = _this$props5.usePercentages, containerWidth = _this$props5.containerWidth, useCSSTransforms = _this$props5.useCSSTransforms;
var style2;
if (useCSSTransforms) {
style2 = (0, _utils.setTransform)(pos);
} else {
style2 = (0, _utils.setTopLeft)(pos);
if (usePercentages) {
style2.left = (0, _utils.perc)(pos.left / containerWidth);
style2.width = (0, _utils.perc)(pos.width / containerWidth);
}
}
return style2;
}
/**
* Mix a Draggable instance into a child.
* @param {Element} child Child element.
* @return {Element} Child wrapped in Draggable.
*/
}, {
key: "mixinDraggable",
value: function mixinDraggable(child, isDraggable) {
return /* @__PURE__ */ _react.default.createElement(_reactDraggable.DraggableCore, {
disabled: !isDraggable,
onStart: this.onDragStart,
onDrag: this.onDrag,
onStop: this.onDragStop,
handle: this.props.handle,
cancel: ".react-resizable-handle" + (this.props.cancel ? "," + this.props.cancel : ""),
scale: this.props.transformScale,
nodeRef: this.elementRef
}, child);
}
/**
* Mix a Resizable instance into a child.
* @param {Element} child Child element.
* @param {Object} position Position object (pixel values)
* @return {Element} Child wrapped in Resizable.
*/
}, {
key: "mixinResizable",
value: function mixinResizable(child, position2, isResizable) {
var _this$props6 = this.props, cols = _this$props6.cols, x2 = _this$props6.x, minW = _this$props6.minW, minH = _this$props6.minH, maxW = _this$props6.maxW, maxH = _this$props6.maxH, transformScale = _this$props6.transformScale, resizeHandles = _this$props6.resizeHandles, resizeHandle = _this$props6.resizeHandle;
var positionParams = this.getPositionParams();
var maxWidth = (0, _calculateUtils.calcGridItemPosition)(positionParams, 0, 0, cols - x2, 0).width;
var mins = (0, _calculateUtils.calcGridItemPosition)(positionParams, 0, 0, minW, minH);
var maxes = (0, _calculateUtils.calcGridItemPosition)(positionParams, 0, 0, maxW, maxH);
var minConstraints = [mins.width, mins.height];
var maxConstraints = [Math.min(maxes.width, maxWidth), Math.min(maxes.height, Infinity)];
return /* @__PURE__ */ _react.default.createElement(
_reactResizable.Resizable,
{
draggableOpts: {
disabled: !isResizable
},
className: isResizable ? void 0 : "react-resizable-hide",
width: position2.width,
height: position2.height,
minConstraints,
maxConstraints,
onResizeStop: this.onResizeStop,
onResizeStart: this.onResizeStart,
onResize: this.onResize,
transformScale,
resizeHandles,
handle: resizeHandle
},
child
);
}
/**
* onDragStart event handler
* @param {Event} e event data
* @param {Object} callbackData an object with node, delta and position information
*/
}, {
key: "onResizeHandler",
value: (
/**
* Wrapper around drag events to provide more useful data.
* All drag events call the function with the given handler name,
* with the signature (index, x, y).
*
* @param {String} handlerName Handler name to wrap.
* @return {Function} Handler function.
*/
function onResizeHandler(e7, _ref4, handlerName) {
var node2 = _ref4.node, size = _ref4.size;
var handler = this.props[handlerName];
if (!handler)
return;
var _this$props7 = this.props, cols = _this$props7.cols, x2 = _this$props7.x, y2 = _this$props7.y, i2 = _this$props7.i, maxH = _this$props7.maxH, minH = _this$props7.minH;
var _this$props8 = this.props, minW = _this$props8.minW, maxW = _this$props8.maxW;
var _calcWH = (0, _calculateUtils.calcWH)(this.getPositionParams(), size.width, size.height, x2, y2), w2 = _calcWH.w, h2 = _calcWH.h;
minW = Math.max(minW, 1);
maxW = Math.min(maxW, cols - x2);
w2 = (0, _calculateUtils.clamp)(w2, minW, maxW);
h2 = (0, _calculateUtils.clamp)(h2, minH, maxH);
this.setState({
resizing: handlerName === "onResizeStop" ? null : size
});
handler.call(this, i2, w2, h2, {
e: e7,
node: node2,
size
});
}
)
}, {
key: "render",
value: function render3() {
var _this$props9 = this.props, x2 = _this$props9.x, y2 = _this$props9.y, w2 = _this$props9.w, h2 = _this$props9.h, isDraggable = _this$props9.isDraggable, isResizable = _this$props9.isResizable, droppingPosition = _this$props9.droppingPosition, useCSSTransforms = _this$props9.useCSSTransforms;
var pos = (0, _calculateUtils.calcGridItemPosition)(this.getPositionParams(), x2, y2, w2, h2, this.state);
var child = _react.default.Children.only(this.props.children);
var newChild = /* @__PURE__ */ _react.default.cloneElement(child, {
ref: this.elementRef,
className: (0, _clsx.default)("react-grid-item", child.props.className, this.props.className, {
static: this.props.static,
resizing: Boolean(this.state.resizing),
"react-draggable": isDraggable,
"react-draggable-dragging": Boolean(this.state.dragging),
dropping: Boolean(droppingPosition),
cssTransforms: useCSSTransforms
}),
// We can set the width and height on the child, but unfortunately we can't set the position.
style: _objectSpread3(_objectSpread3(_objectSpread3({}, this.props.style), child.props.style), this.createStyle(pos))
});
newChild = this.mixinResizable(newChild, pos, isResizable);
newChild = this.mixinDraggable(newChild, isDraggable);
return newChild;
}
}]);
return GridItem2;
}(_react.default.Component);
GridItem.default = GridItem$1;
_defineProperty2(GridItem$1, "propTypes", {
// Children must be only a single element
children: _propTypes.default.element,
// General grid attributes
cols: _propTypes.default.number.isRequired,
containerWidth: _propTypes.default.number.isRequired,
rowHeight: _propTypes.default.number.isRequired,
margin: _propTypes.default.array.isRequired,
maxRows: _propTypes.default.number.isRequired,
containerPadding: _propTypes.default.array.isRequired,
// These are all in grid units
x: _propTypes.default.number.isRequired,
y: _propTypes.default.number.isRequired,
w: _propTypes.default.number.isRequired,
h: _propTypes.default.number.isRequired,
// All optional
minW: function minW(props, propName) {
var value2 = props[propName];
if (typeof value2 !== "number")
return new Error("minWidth not Number");
if (value2 > props.w || value2 > props.maxW)
return new Error("minWidth larger than item width/maxWidth");
},
maxW: function maxW(props, propName) {
var value2 = props[propName];
if (typeof value2 !== "number")
return new Error("maxWidth not Number");
if (value2 < props.w || value2 < props.minW)
return new Error("maxWidth smaller than item width/minWidth");
},
minH: function minH(props, propName) {
var value2 = props[propName];
if (typeof value2 !== "number")
return new Error("minHeight not Number");
if (value2 > props.h || value2 > props.maxH)
return new Error("minHeight larger than item height/maxHeight");
},
maxH: function maxH(props, propName) {
var value2 = props[propName];
if (typeof value2 !== "number")
return new Error("maxHeight not Number");
if (value2 < props.h || value2 < props.minH)
return new Error("maxHeight smaller than item height/minHeight");
},
// ID is nice to have for callbacks
i: _propTypes.default.string.isRequired,
// Resize handle options
resizeHandles: _ReactGridLayoutPropTypes.resizeHandleAxesType,
resizeHandle: _ReactGridLayoutPropTypes.resizeHandleType,
// Functions
onDragStop: _propTypes.default.func,
onDragStart: _propTypes.default.func,
onDrag: _propTypes.default.func,
onResizeStop: _propTypes.default.func,
onResizeStart: _propTypes.default.func,
onResize: _propTypes.default.func,
// Flags
isDraggable: _propTypes.default.bool.isRequired,
isResizable: _propTypes.default.bool.isRequired,
isBounded: _propTypes.default.bool.isRequired,
static: _propTypes.default.bool,
// Use CSS transforms instead of top/left
useCSSTransforms: _propTypes.default.bool.isRequired,
transformScale: _propTypes.default.number,
// Others
className: _propTypes.default.string,
// Selector for draggable handle
handle: _propTypes.default.string,
// Selector for draggable cancel (see react-draggable)
cancel: _propTypes.default.string,
// Current position of a dropping element
droppingPosition: _propTypes.default.shape({
e: _propTypes.default.object.isRequired,
left: _propTypes.default.number.isRequired,
top: _propTypes.default.number.isRequired
})
});
_defineProperty2(GridItem$1, "defaultProps", {
className: "",
cancel: "",
handle: "",
minH: 1,
minW: 1,
maxH: Infinity,
maxW: Infinity,
transformScale: 1
});
return GridItem;
}
var hasRequiredReactGridLayout$1;
function requireReactGridLayout$1() {
if (hasRequiredReactGridLayout$1)
return ReactGridLayout;
hasRequiredReactGridLayout$1 = 1;
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(ReactGridLayout, "__esModule", {
value: true
});
ReactGridLayout.default = void 0;
var React2 = _interopRequireWildcard(reactExports);
var _lodash = _interopRequireDefault(lodash_isequalExports);
var _clsx = _interopRequireDefault(require$$2$1);
var _utils = requireUtils$1();
var _calculateUtils = requireCalculateUtils();
var _GridItem = _interopRequireDefault(requireGridItem());
var _ReactGridLayoutPropTypes = _interopRequireDefault(requireReactGridLayoutPropTypes());
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _toConsumableArray2(arr2) {
return _arrayWithoutHoles2(arr2) || _iterableToArray2(arr2) || _unsupportedIterableToArray2(arr2) || _nonIterableSpread2();
}
function _nonIterableSpread2() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray2(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
function _arrayWithoutHoles2(arr2) {
if (Array.isArray(arr2))
return _arrayLikeToArray2(arr2);
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _slicedToArray2(arr2, i2) {
return _arrayWithHoles2(arr2) || _iterableToArrayLimit2(arr2, i2) || _unsupportedIterableToArray2(arr2, i2) || _nonIterableRest2();
}
function _nonIterableRest2() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray2(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray2(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray2(o2, minLen);
}
function _arrayLikeToArray2(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++) {
arr22[i2] = arr2[i2];
}
return arr22;
}
function _iterableToArrayLimit2(arr2, i2) {
var _i2 = arr2 == null ? null : typeof Symbol !== "undefined" && arr2[Symbol.iterator] || arr2["@@iterator"];
if (_i2 == null)
return;
var _arr = [];
var _n2 = true;
var _d = false;
var _s, _e2;
try {
for (_i2 = _i2.call(arr2); !(_n2 = (_s = _i2.next()).done); _n2 = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e2 = err;
} finally {
try {
if (!_n2 && _i2["return"] != null)
_i2["return"]();
} finally {
if (_d)
throw _e2;
}
}
return _arr;
}
function _arrayWithHoles2(arr2) {
if (Array.isArray(arr2))
return arr2;
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
Object.defineProperty(subClass, "prototype", { writable: false });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var layoutClassName = "react-grid-layout";
var isFirefox = false;
try {
isFirefox = /firefox/i.test(navigator.userAgent);
} catch (e7) {
}
var ReactGridLayout$1 = /* @__PURE__ */ function(_React$Component) {
_inherits2(ReactGridLayout2, _React$Component);
var _super = _createSuper2(ReactGridLayout2);
function ReactGridLayout2() {
var _this;
_classCallCheck2(this, ReactGridLayout2);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty2(_assertThisInitialized2(_this), "state", {
activeDrag: null,
layout: (0, _utils.synchronizeLayoutWithChildren)(
_this.props.layout,
_this.props.children,
_this.props.cols,
// Legacy support for verticalCompact: false
(0, _utils.compactType)(_this.props),
_this.props.allowOverlap
),
mounted: false,
oldDragItem: null,
oldLayout: null,
oldResizeItem: null,
droppingDOMNode: null,
children: []
});
_defineProperty2(_assertThisInitialized2(_this), "dragEnterCounter", 0);
_defineProperty2(_assertThisInitialized2(_this), "onDragStart", function(i2, x2, y2, _ref3) {
var e7 = _ref3.e, node2 = _ref3.node;
var layout = _this.state.layout;
var l2 = (0, _utils.getLayoutItem)(layout, i2);
if (!l2)
return;
_this.setState({
oldDragItem: (0, _utils.cloneLayoutItem)(l2),
oldLayout: layout
});
return _this.props.onDragStart(layout, l2, l2, null, e7, node2);
});
_defineProperty2(_assertThisInitialized2(_this), "onDrag", function(i2, x2, y2, _ref22) {
var e7 = _ref22.e, node2 = _ref22.node;
var oldDragItem = _this.state.oldDragItem;
var layout = _this.state.layout;
var _this$props = _this.props, cols = _this$props.cols, allowOverlap = _this$props.allowOverlap, preventCollision = _this$props.preventCollision;
var l2 = (0, _utils.getLayoutItem)(layout, i2);
if (!l2)
return;
var placeholder = {
w: l2.w,
h: l2.h,
x: l2.x,
y: l2.y,
placeholder: true,
i: i2
};
var isUserAction = true;
layout = (0, _utils.moveElement)(layout, l2, x2, y2, isUserAction, preventCollision, (0, _utils.compactType)(_this.props), cols, allowOverlap);
_this.props.onDrag(layout, oldDragItem, l2, placeholder, e7, node2);
_this.setState({
layout: allowOverlap ? layout : (0, _utils.compact)(layout, (0, _utils.compactType)(_this.props), cols),
activeDrag: placeholder
});
});
_defineProperty2(_assertThisInitialized2(_this), "onDragStop", function(i2, x2, y2, _ref3) {
var e7 = _ref3.e, node2 = _ref3.node;
if (!_this.state.activeDrag)
return;
var oldDragItem = _this.state.oldDragItem;
var layout = _this.state.layout;
var _this$props2 = _this.props, cols = _this$props2.cols, preventCollision = _this$props2.preventCollision, allowOverlap = _this$props2.allowOverlap;
var l2 = (0, _utils.getLayoutItem)(layout, i2);
if (!l2)
return;
var isUserAction = true;
layout = (0, _utils.moveElement)(layout, l2, x2, y2, isUserAction, preventCollision, (0, _utils.compactType)(_this.props), cols, allowOverlap);
_this.props.onDragStop(layout, oldDragItem, l2, null, e7, node2);
var newLayout = allowOverlap ? layout : (0, _utils.compact)(layout, (0, _utils.compactType)(_this.props), cols);
var oldLayout = _this.state.oldLayout;
_this.setState({
activeDrag: null,
layout: newLayout,
oldDragItem: null,
oldLayout: null
});
_this.onLayoutMaybeChanged(newLayout, oldLayout);
});
_defineProperty2(_assertThisInitialized2(_this), "onResizeStart", function(i2, w2, h2, _ref4) {
var e7 = _ref4.e, node2 = _ref4.node;
var layout = _this.state.layout;
var l2 = (0, _utils.getLayoutItem)(layout, i2);
if (!l2)
return;
_this.setState({
oldResizeItem: (0, _utils.cloneLayoutItem)(l2),
oldLayout: _this.state.layout
});
_this.props.onResizeStart(layout, l2, l2, null, e7, node2);
});
_defineProperty2(_assertThisInitialized2(_this), "onResize", function(i2, w2, h2, _ref5) {
var e7 = _ref5.e, node2 = _ref5.node;
var _this$state = _this.state, layout = _this$state.layout, oldResizeItem = _this$state.oldResizeItem;
var _this$props3 = _this.props, cols = _this$props3.cols, preventCollision = _this$props3.preventCollision, allowOverlap = _this$props3.allowOverlap;
var _withLayoutItem = (0, _utils.withLayoutItem)(layout, i2, function(l3) {
var hasCollisions;
if (preventCollision && !allowOverlap) {
var collisions = (0, _utils.getAllCollisions)(layout, _objectSpread3(_objectSpread3({}, l3), {}, {
w: w2,
h: h2
})).filter(function(layoutItem) {
return layoutItem.i !== l3.i;
});
hasCollisions = collisions.length > 0;
if (hasCollisions) {
var leastX = Infinity, leastY = Infinity;
collisions.forEach(function(layoutItem) {
if (layoutItem.x > l3.x)
leastX = Math.min(leastX, layoutItem.x);
if (layoutItem.y > l3.y)
leastY = Math.min(leastY, layoutItem.y);
});
if (Number.isFinite(leastX))
l3.w = leastX - l3.x;
if (Number.isFinite(leastY))
l3.h = leastY - l3.y;
}
}
if (!hasCollisions) {
l3.w = w2;
l3.h = h2;
}
return l3;
}), _withLayoutItem2 = _slicedToArray2(_withLayoutItem, 2), newLayout = _withLayoutItem2[0], l2 = _withLayoutItem2[1];
if (!l2)
return;
var placeholder = {
w: l2.w,
h: l2.h,
x: l2.x,
y: l2.y,
static: true,
i: i2
};
_this.props.onResize(newLayout, oldResizeItem, l2, placeholder, e7, node2);
_this.setState({
layout: allowOverlap ? newLayout : (0, _utils.compact)(newLayout, (0, _utils.compactType)(_this.props), cols),
activeDrag: placeholder
});
});
_defineProperty2(_assertThisInitialized2(_this), "onResizeStop", function(i2, w2, h2, _ref6) {
var e7 = _ref6.e, node2 = _ref6.node;
var _this$state2 = _this.state, layout = _this$state2.layout, oldResizeItem = _this$state2.oldResizeItem;
var _this$props4 = _this.props, cols = _this$props4.cols, allowOverlap = _this$props4.allowOverlap;
var l2 = (0, _utils.getLayoutItem)(layout, i2);
_this.props.onResizeStop(layout, oldResizeItem, l2, null, e7, node2);
var newLayout = allowOverlap ? layout : (0, _utils.compact)(layout, (0, _utils.compactType)(_this.props), cols);
var oldLayout = _this.state.oldLayout;
_this.setState({
activeDrag: null,
layout: newLayout,
oldResizeItem: null,
oldLayout: null
});
_this.onLayoutMaybeChanged(newLayout, oldLayout);
});
_defineProperty2(_assertThisInitialized2(_this), "onDragOver", function(e7) {
var _e$nativeEvent$target;
e7.preventDefault();
e7.stopPropagation();
if (isFirefox && // $FlowIgnore can't figure this out
!((_e$nativeEvent$target = e7.nativeEvent.target) !== null && _e$nativeEvent$target !== void 0 && _e$nativeEvent$target.classList.contains(layoutClassName))) {
return false;
}
var _this$props5 = _this.props, droppingItem = _this$props5.droppingItem, onDropDragOver = _this$props5.onDropDragOver, margin = _this$props5.margin, cols = _this$props5.cols, rowHeight = _this$props5.rowHeight, maxRows = _this$props5.maxRows, width2 = _this$props5.width, containerPadding = _this$props5.containerPadding, transformScale = _this$props5.transformScale;
var onDragOverResult = onDropDragOver === null || onDropDragOver === void 0 ? void 0 : onDropDragOver(e7);
if (onDragOverResult === false) {
if (_this.state.droppingDOMNode) {
_this.removeDroppingPlaceholder();
}
return false;
}
var finalDroppingItem = _objectSpread3(_objectSpread3({}, droppingItem), onDragOverResult);
var layout = _this.state.layout;
var _e$nativeEvent = e7.nativeEvent, layerX = _e$nativeEvent.layerX, layerY = _e$nativeEvent.layerY;
var droppingPosition = {
left: layerX / transformScale,
top: layerY / transformScale,
e: e7
};
if (!_this.state.droppingDOMNode) {
var positionParams = {
cols,
margin,
maxRows,
rowHeight,
containerWidth: width2,
containerPadding: containerPadding || margin
};
var calculatedPosition = (0, _calculateUtils.calcXY)(positionParams, layerY, layerX, finalDroppingItem.w, finalDroppingItem.h);
_this.setState({
droppingDOMNode: /* @__PURE__ */ React2.createElement("div", {
key: finalDroppingItem.i
}),
droppingPosition,
layout: [].concat(_toConsumableArray2(layout), [_objectSpread3(_objectSpread3({}, finalDroppingItem), {}, {
x: calculatedPosition.x,
y: calculatedPosition.y,
static: false,
isDraggable: true
})])
});
} else if (_this.state.droppingPosition) {
var _this$state$droppingP = _this.state.droppingPosition, left2 = _this$state$droppingP.left, top2 = _this$state$droppingP.top;
var shouldUpdatePosition = left2 != layerX || top2 != layerY;
if (shouldUpdatePosition) {
_this.setState({
droppingPosition
});
}
}
});
_defineProperty2(_assertThisInitialized2(_this), "removeDroppingPlaceholder", function() {
var _this$props6 = _this.props, droppingItem = _this$props6.droppingItem, cols = _this$props6.cols;
var layout = _this.state.layout;
var newLayout = (0, _utils.compact)(layout.filter(function(l2) {
return l2.i !== droppingItem.i;
}), (0, _utils.compactType)(_this.props), cols);
_this.setState({
layout: newLayout,
droppingDOMNode: null,
activeDrag: null,
droppingPosition: void 0
});
});
_defineProperty2(_assertThisInitialized2(_this), "onDragLeave", function(e7) {
e7.preventDefault();
e7.stopPropagation();
_this.dragEnterCounter--;
if (_this.dragEnterCounter === 0) {
_this.removeDroppingPlaceholder();
}
});
_defineProperty2(_assertThisInitialized2(_this), "onDragEnter", function(e7) {
e7.preventDefault();
e7.stopPropagation();
_this.dragEnterCounter++;
});
_defineProperty2(_assertThisInitialized2(_this), "onDrop", function(e7) {
e7.preventDefault();
e7.stopPropagation();
var droppingItem = _this.props.droppingItem;
var layout = _this.state.layout;
var item = layout.find(function(l2) {
return l2.i === droppingItem.i;
});
_this.dragEnterCounter = 0;
_this.removeDroppingPlaceholder();
_this.props.onDrop(layout, item, e7);
});
return _this;
}
_createClass2(ReactGridLayout2, [{
key: "componentDidMount",
value: function componentDidMount() {
this.setState({
mounted: true
});
this.onLayoutMaybeChanged(this.state.layout, this.props.layout);
}
}, {
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps, nextState) {
return (
// NOTE: this is almost always unequal. Therefore the only way to get better performance
// from SCU is if the user intentionally memoizes children. If they do, and they can
// handle changes properly, performance will increase.
this.props.children !== nextProps.children || !(0, _utils.fastRGLPropsEqual)(this.props, nextProps, _lodash.default) || this.state.activeDrag !== nextState.activeDrag || this.state.mounted !== nextState.mounted || this.state.droppingPosition !== nextState.droppingPosition
);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps, prevState) {
if (!this.state.activeDrag) {
var newLayout = this.state.layout;
var oldLayout = prevState.layout;
this.onLayoutMaybeChanged(newLayout, oldLayout);
}
}
/**
* Calculates a pixel value for the container.
* @return {String} Container height in pixels.
*/
}, {
key: "containerHeight",
value: function containerHeight() {
if (!this.props.autoSize)
return;
var nbRow = (0, _utils.bottom)(this.state.layout);
var containerPaddingY = this.props.containerPadding ? this.props.containerPadding[1] : this.props.margin[1];
return nbRow * this.props.rowHeight + (nbRow - 1) * this.props.margin[1] + containerPaddingY * 2 + "px";
}
/**
* When dragging starts
* @param {String} i Id of the child
* @param {Number} x X position of the move
* @param {Number} y Y position of the move
* @param {Event} e The mousedown event
* @param {Element} node The current dragging DOM element
*/
}, {
key: "onLayoutMaybeChanged",
value: function onLayoutMaybeChanged(newLayout, oldLayout) {
if (!oldLayout)
oldLayout = this.state.layout;
if (!(0, _lodash.default)(oldLayout, newLayout)) {
this.props.onLayoutChange(newLayout);
}
}
}, {
key: "placeholder",
value: (
/**
* Create a placeholder object.
* @return {Element} Placeholder div.
*/
function placeholder() {
var activeDrag = this.state.activeDrag;
if (!activeDrag)
return null;
var _this$props7 = this.props, width2 = _this$props7.width, cols = _this$props7.cols, margin = _this$props7.margin, containerPadding = _this$props7.containerPadding, rowHeight = _this$props7.rowHeight, maxRows = _this$props7.maxRows, useCSSTransforms = _this$props7.useCSSTransforms, transformScale = _this$props7.transformScale;
return /* @__PURE__ */ React2.createElement(_GridItem.default, {
w: activeDrag.w,
h: activeDrag.h,
x: activeDrag.x,
y: activeDrag.y,
i: activeDrag.i,
className: "react-grid-placeholder",
containerWidth: width2,
cols,
margin,
containerPadding: containerPadding || margin,
maxRows,
rowHeight,
isDraggable: false,
isResizable: false,
isBounded: false,
useCSSTransforms,
transformScale
}, /* @__PURE__ */ React2.createElement("div", null));
}
)
/**
* Given a grid item, set its style attributes & surround in a <Draggable>.
* @param {Element} child React element.
* @return {Element} Element wrapped in draggable and properly placed.
*/
}, {
key: "processGridItem",
value: function processGridItem(child, isDroppingItem) {
if (!child || !child.key)
return;
var l2 = (0, _utils.getLayoutItem)(this.state.layout, String(child.key));
if (!l2)
return null;
var _this$props8 = this.props, width2 = _this$props8.width, cols = _this$props8.cols, margin = _this$props8.margin, containerPadding = _this$props8.containerPadding, rowHeight = _this$props8.rowHeight, maxRows = _this$props8.maxRows, isDraggable = _this$props8.isDraggable, isResizable = _this$props8.isResizable, isBounded = _this$props8.isBounded, useCSSTransforms = _this$props8.useCSSTransforms, transformScale = _this$props8.transformScale, draggableCancel = _this$props8.draggableCancel, draggableHandle = _this$props8.draggableHandle, resizeHandles = _this$props8.resizeHandles, resizeHandle = _this$props8.resizeHandle;
var _this$state3 = this.state, mounted = _this$state3.mounted, droppingPosition = _this$state3.droppingPosition;
var draggable = typeof l2.isDraggable === "boolean" ? l2.isDraggable : !l2.static && isDraggable;
var resizable = typeof l2.isResizable === "boolean" ? l2.isResizable : !l2.static && isResizable;
var resizeHandlesOptions = l2.resizeHandles || resizeHandles;
var bounded = draggable && isBounded && l2.isBounded !== false;
return /* @__PURE__ */ React2.createElement(_GridItem.default, {
containerWidth: width2,
cols,
margin,
containerPadding: containerPadding || margin,
maxRows,
rowHeight,
cancel: draggableCancel,
handle: draggableHandle,
onDragStop: this.onDragStop,
onDragStart: this.onDragStart,
onDrag: this.onDrag,
onResizeStart: this.onResizeStart,
onResize: this.onResize,
onResizeStop: this.onResizeStop,
isDraggable: draggable,
isResizable: resizable,
isBounded: bounded,
useCSSTransforms: useCSSTransforms && mounted,
usePercentages: !mounted,
transformScale,
w: l2.w,
h: l2.h,
x: l2.x,
y: l2.y,
i: l2.i,
minH: l2.minH,
minW: l2.minW,
maxH: l2.maxH,
maxW: l2.maxW,
static: l2.static,
droppingPosition: isDroppingItem ? droppingPosition : void 0,
resizeHandles: resizeHandlesOptions,
resizeHandle
}, child);
}
// Called while dragging an element. Part of browser native drag/drop API.
// Native event target might be the layout itself, or an element within the layout.
}, {
key: "render",
value: function render3() {
var _this2 = this;
var _this$props9 = this.props, className = _this$props9.className, style2 = _this$props9.style, isDroppable = _this$props9.isDroppable, innerRef = _this$props9.innerRef;
var mergedClassName = (0, _clsx.default)(layoutClassName, className);
var mergedStyle = _objectSpread3({
height: this.containerHeight()
}, style2);
return /* @__PURE__ */ React2.createElement("div", {
ref: innerRef,
className: mergedClassName,
style: mergedStyle,
onDrop: isDroppable ? this.onDrop : _utils.noop,
onDragLeave: isDroppable ? this.onDragLeave : _utils.noop,
onDragEnter: isDroppable ? this.onDragEnter : _utils.noop,
onDragOver: isDroppable ? this.onDragOver : _utils.noop
}, React2.Children.map(this.props.children, function(child) {
return _this2.processGridItem(child);
}), isDroppable && this.state.droppingDOMNode && this.processGridItem(this.state.droppingDOMNode, true), this.placeholder());
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
var newLayoutBase;
if (prevState.activeDrag) {
return null;
}
if (!(0, _lodash.default)(nextProps.layout, prevState.propsLayout) || nextProps.compactType !== prevState.compactType) {
newLayoutBase = nextProps.layout;
} else if (!(0, _utils.childrenEqual)(nextProps.children, prevState.children)) {
newLayoutBase = prevState.layout;
}
if (newLayoutBase) {
var newLayout = (0, _utils.synchronizeLayoutWithChildren)(newLayoutBase, nextProps.children, nextProps.cols, (0, _utils.compactType)(nextProps), nextProps.allowOverlap);
return {
layout: newLayout,
// We need to save these props to state for using
// getDerivedStateFromProps instead of componentDidMount (in which we would get extra rerender)
compactType: nextProps.compactType,
children: nextProps.children,
propsLayout: nextProps.layout
};
}
return null;
}
}]);
return ReactGridLayout2;
}(React2.Component);
ReactGridLayout.default = ReactGridLayout$1;
_defineProperty2(ReactGridLayout$1, "displayName", "ReactGridLayout");
_defineProperty2(ReactGridLayout$1, "propTypes", _ReactGridLayoutPropTypes.default);
_defineProperty2(ReactGridLayout$1, "defaultProps", {
autoSize: true,
cols: 12,
className: "",
style: {},
draggableHandle: "",
draggableCancel: "",
containerPadding: null,
rowHeight: 150,
maxRows: Infinity,
// infinite vertical growth
layout: [],
margin: [10, 10],
isBounded: false,
isDraggable: true,
isResizable: true,
allowOverlap: false,
isDroppable: false,
useCSSTransforms: true,
transformScale: 1,
verticalCompact: true,
compactType: "vertical",
preventCollision: false,
droppingItem: {
i: "__dropping-elem__",
h: 1,
w: 1
},
resizeHandles: ["se"],
onLayoutChange: _utils.noop,
onDragStart: _utils.noop,
onDrag: _utils.noop,
onDragStop: _utils.noop,
onResizeStart: _utils.noop,
onResize: _utils.noop,
onResizeStop: _utils.noop,
onDrop: _utils.noop,
onDropDragOver: _utils.noop
});
return ReactGridLayout;
}
var ResponsiveReactGridLayout = {};
var responsiveUtils = {};
var hasRequiredResponsiveUtils;
function requireResponsiveUtils() {
if (hasRequiredResponsiveUtils)
return responsiveUtils;
hasRequiredResponsiveUtils = 1;
Object.defineProperty(responsiveUtils, "__esModule", {
value: true
});
responsiveUtils.findOrGenerateResponsiveLayout = findOrGenerateResponsiveLayout;
responsiveUtils.getBreakpointFromWidth = getBreakpointFromWidth;
responsiveUtils.getColsFromBreakpoint = getColsFromBreakpoint;
responsiveUtils.sortBreakpoints = sortBreakpoints;
var _utils = requireUtils$1();
function getBreakpointFromWidth(breakpoints, width2) {
var sorted = sortBreakpoints(breakpoints);
var matching = sorted[0];
for (var i2 = 1, len = sorted.length; i2 < len; i2++) {
var breakpointName = sorted[i2];
if (width2 > breakpoints[breakpointName])
matching = breakpointName;
}
return matching;
}
function getColsFromBreakpoint(breakpoint, cols) {
if (!cols[breakpoint]) {
throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint " + breakpoint + " is missing!");
}
return cols[breakpoint];
}
function findOrGenerateResponsiveLayout(layouts, breakpoints, breakpoint, lastBreakpoint, cols, compactType) {
if (layouts[breakpoint])
return (0, _utils.cloneLayout)(layouts[breakpoint]);
var layout = layouts[lastBreakpoint];
var breakpointsSorted = sortBreakpoints(breakpoints);
var breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));
for (var i2 = 0, len = breakpointsAbove.length; i2 < len; i2++) {
var b2 = breakpointsAbove[i2];
if (layouts[b2]) {
layout = layouts[b2];
break;
}
}
layout = (0, _utils.cloneLayout)(layout || []);
return (0, _utils.compact)((0, _utils.correctBounds)(layout, {
cols
}), compactType, cols);
}
function sortBreakpoints(breakpoints) {
var keys3 = Object.keys(breakpoints);
return keys3.sort(function(a2, b2) {
return breakpoints[a2] - breakpoints[b2];
});
}
return responsiveUtils;
}
var hasRequiredResponsiveReactGridLayout;
function requireResponsiveReactGridLayout() {
if (hasRequiredResponsiveReactGridLayout)
return ResponsiveReactGridLayout;
hasRequiredResponsiveReactGridLayout = 1;
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(ResponsiveReactGridLayout, "__esModule", {
value: true
});
ResponsiveReactGridLayout.default = void 0;
var React2 = _interopRequireWildcard(reactExports);
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _lodash = _interopRequireDefault(lodash_isequalExports);
var _utils = requireUtils$1();
var _responsiveUtils = requireResponsiveUtils();
var _ReactGridLayout = _interopRequireDefault(requireReactGridLayout$1());
var _excluded5 = ["breakpoint", "breakpoints", "cols", "layouts", "margin", "containerPadding", "onBreakpointChange", "onLayoutChange", "onWidthChange"];
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _extends2() {
_extends2 = Object.assign || function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends2.apply(this, arguments);
}
function _objectWithoutProperties2(source2, excluded) {
if (source2 == null)
return {};
var target2 = _objectWithoutPropertiesLoose2(source2, excluded);
var key2, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source2);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key2 = sourceSymbolKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source2, key2))
continue;
target2[key2] = source2[key2];
}
}
return target2;
}
function _objectWithoutPropertiesLoose2(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
function ownKeys3(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys3(Object(source2), true).forEach(function(key2) {
_defineProperty2(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys3(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
Object.defineProperty(subClass, "prototype", { writable: false });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var type2 = function type3(obj) {
return Object.prototype.toString.call(obj);
};
function getIndentationValue(param2, breakpoint) {
if (param2 == null)
return null;
return Array.isArray(param2) ? param2 : param2[breakpoint];
}
var ResponsiveReactGridLayout$1 = /* @__PURE__ */ function(_React$Component) {
_inherits2(ResponsiveReactGridLayout2, _React$Component);
var _super = _createSuper2(ResponsiveReactGridLayout2);
function ResponsiveReactGridLayout2() {
var _this;
_classCallCheck2(this, ResponsiveReactGridLayout2);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty2(_assertThisInitialized2(_this), "state", _this.generateInitialState());
_defineProperty2(_assertThisInitialized2(_this), "onLayoutChange", function(layout) {
_this.props.onLayoutChange(layout, _objectSpread3(_objectSpread3({}, _this.props.layouts), {}, _defineProperty2({}, _this.state.breakpoint, layout)));
});
return _this;
}
_createClass2(ResponsiveReactGridLayout2, [{
key: "generateInitialState",
value: function generateInitialState() {
var _this$props = this.props, width2 = _this$props.width, breakpoints = _this$props.breakpoints, layouts = _this$props.layouts, cols = _this$props.cols;
var breakpoint = (0, _responsiveUtils.getBreakpointFromWidth)(breakpoints, width2);
var colNo = (0, _responsiveUtils.getColsFromBreakpoint)(breakpoint, cols);
var compactType = this.props.verticalCompact === false ? null : this.props.compactType;
var initialLayout = (0, _responsiveUtils.findOrGenerateResponsiveLayout)(layouts, breakpoints, breakpoint, breakpoint, colNo, compactType);
return {
layout: initialLayout,
breakpoint,
cols: colNo
};
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (this.props.width != prevProps.width || this.props.breakpoint !== prevProps.breakpoint || !(0, _lodash.default)(this.props.breakpoints, prevProps.breakpoints) || !(0, _lodash.default)(this.props.cols, prevProps.cols)) {
this.onWidthChange(prevProps);
}
}
// wrap layouts so we do not need to pass layouts to child
}, {
key: "onWidthChange",
value: (
/**
* When the width changes work through breakpoints and reset state with the new width & breakpoint.
* Width changes are necessary to figure out the widget widths.
*/
function onWidthChange(prevProps) {
var _this$props2 = this.props, breakpoints = _this$props2.breakpoints, cols = _this$props2.cols, layouts = _this$props2.layouts, compactType = _this$props2.compactType;
var newBreakpoint = this.props.breakpoint || (0, _responsiveUtils.getBreakpointFromWidth)(this.props.breakpoints, this.props.width);
var lastBreakpoint = this.state.breakpoint;
var newCols = (0, _responsiveUtils.getColsFromBreakpoint)(newBreakpoint, cols);
var newLayouts = _objectSpread3({}, layouts);
if (lastBreakpoint !== newBreakpoint || prevProps.breakpoints !== breakpoints || prevProps.cols !== cols) {
if (!(lastBreakpoint in newLayouts))
newLayouts[lastBreakpoint] = (0, _utils.cloneLayout)(this.state.layout);
var layout = (0, _responsiveUtils.findOrGenerateResponsiveLayout)(newLayouts, breakpoints, newBreakpoint, lastBreakpoint, newCols, compactType);
layout = (0, _utils.synchronizeLayoutWithChildren)(layout, this.props.children, newCols, compactType, this.props.allowOverlap);
newLayouts[newBreakpoint] = layout;
this.props.onLayoutChange(layout, newLayouts);
this.props.onBreakpointChange(newBreakpoint, newCols);
this.setState({
breakpoint: newBreakpoint,
layout,
cols: newCols
});
}
var margin = getIndentationValue(this.props.margin, newBreakpoint);
var containerPadding = getIndentationValue(this.props.containerPadding, newBreakpoint);
this.props.onWidthChange(this.props.width, margin, newCols, containerPadding);
}
)
}, {
key: "render",
value: function render3() {
var _this$props3 = this.props;
_this$props3.breakpoint;
_this$props3.breakpoints;
_this$props3.cols;
_this$props3.layouts;
var margin = _this$props3.margin, containerPadding = _this$props3.containerPadding;
_this$props3.onBreakpointChange;
_this$props3.onLayoutChange;
_this$props3.onWidthChange;
var other = _objectWithoutProperties2(_this$props3, _excluded5);
return /* @__PURE__ */ React2.createElement(_ReactGridLayout.default, _extends2({}, other, {
// $FlowIgnore should allow nullable here due to DefaultProps
margin: getIndentationValue(margin, this.state.breakpoint),
containerPadding: getIndentationValue(containerPadding, this.state.breakpoint),
onLayoutChange: this.onLayoutChange,
layout: this.state.layout,
cols: this.state.cols
}));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
if (!(0, _lodash.default)(nextProps.layouts, prevState.layouts)) {
var breakpoint = prevState.breakpoint, _cols = prevState.cols;
var newLayout = (0, _responsiveUtils.findOrGenerateResponsiveLayout)(nextProps.layouts, nextProps.breakpoints, breakpoint, breakpoint, _cols, nextProps.compactType);
return {
layout: newLayout,
layouts: nextProps.layouts
};
}
return null;
}
}]);
return ResponsiveReactGridLayout2;
}(React2.Component);
ResponsiveReactGridLayout.default = ResponsiveReactGridLayout$1;
_defineProperty2(ResponsiveReactGridLayout$1, "propTypes", {
//
// Basic props
//
// Optional, but if you are managing width yourself you may want to set the breakpoint
// yourself as well.
breakpoint: _propTypes.default.string,
// {name: pxVal}, e.g. {lg: 1200, md: 996, sm: 768, xs: 480}
breakpoints: _propTypes.default.object,
allowOverlap: _propTypes.default.bool,
// # of cols. This is a breakpoint -> cols map
cols: _propTypes.default.object,
// # of margin. This is a breakpoint -> margin map
// e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] }
// Margin between items [x, y] in px
// e.g. [10, 10]
margin: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object]),
// # of containerPadding. This is a breakpoint -> containerPadding map
// e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] }
// Padding inside the container [x, y] in px
// e.g. [10, 10]
containerPadding: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object]),
// layouts is an object mapping breakpoints to layouts.
// e.g. {lg: Layout, md: Layout, ...}
layouts: function layouts(props, propName) {
if (type2(props[propName]) !== "[object Object]") {
throw new Error("Layout property must be an object. Received: " + type2(props[propName]));
}
Object.keys(props[propName]).forEach(function(key2) {
if (!(key2 in props.breakpoints)) {
throw new Error("Each key in layouts must align with a key in breakpoints.");
}
(0, _utils.validateLayout)(props.layouts[key2], "layouts." + key2);
});
},
// The width of this component.
// Required in this propTypes stanza because generateInitialState() will fail without it.
width: _propTypes.default.number.isRequired,
//
// Callbacks
//
// Calls back with breakpoint and new # cols
onBreakpointChange: _propTypes.default.func,
// Callback so you can save the layout.
// Calls back with (currentLayout, allLayouts). allLayouts are keyed by breakpoint.
onLayoutChange: _propTypes.default.func,
// Calls back with (containerWidth, margin, cols, containerPadding)
onWidthChange: _propTypes.default.func
});
_defineProperty2(ResponsiveReactGridLayout$1, "defaultProps", {
breakpoints: {
lg: 1200,
md: 996,
sm: 768,
xs: 480,
xxs: 0
},
cols: {
lg: 12,
md: 10,
sm: 6,
xs: 4,
xxs: 2
},
containerPadding: {
lg: null,
md: null,
sm: null,
xs: null,
xxs: null
},
layouts: {},
margin: [10, 10],
allowOverlap: false,
onBreakpointChange: _utils.noop,
onLayoutChange: _utils.noop,
onWidthChange: _utils.noop
});
return ResponsiveReactGridLayout;
}
var WidthProvider = {};
var hasRequiredWidthProvider;
function requireWidthProvider() {
if (hasRequiredWidthProvider)
return WidthProvider;
hasRequiredWidthProvider = 1;
function _typeof2(obj) {
"@babel/helpers - typeof";
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof2(obj);
}
Object.defineProperty(WidthProvider, "__esModule", {
value: true
});
WidthProvider.default = WidthProvideRGL;
var React2 = _interopRequireWildcard(reactExports);
var _propTypes = _interopRequireDefault(requirePropTypes$1());
var _clsx = _interopRequireDefault(require$$2$1);
var _excluded5 = ["measureBeforeMount"];
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function")
return null;
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
return { default: obj };
}
var cache2 = _getRequireWildcardCache(nodeInterop);
if (cache2 && cache2.has(obj)) {
return cache2.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key2 in obj) {
if (key2 !== "default" && Object.prototype.hasOwnProperty.call(obj, key2)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key2) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key2, desc);
} else {
newObj[key2] = obj[key2];
}
}
}
newObj.default = obj;
if (cache2) {
cache2.set(obj, newObj);
}
return newObj;
}
function _extends2() {
_extends2 = Object.assign || function(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2];
for (var key2 in source2) {
if (Object.prototype.hasOwnProperty.call(source2, key2)) {
target2[key2] = source2[key2];
}
}
}
return target2;
};
return _extends2.apply(this, arguments);
}
function _objectWithoutProperties2(source2, excluded) {
if (source2 == null)
return {};
var target2 = _objectWithoutPropertiesLoose2(source2, excluded);
var key2, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source2);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key2 = sourceSymbolKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source2, key2))
continue;
target2[key2] = source2[key2];
}
}
return target2;
}
function _objectWithoutPropertiesLoose2(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
function _classCallCheck2(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _inherits2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
Object.defineProperty(subClass, "prototype", { writable: false });
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o2, p2) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf2(o2, p2);
}
function _createSuper2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
return function _createSuperInternal() {
var Super = _getPrototypeOf2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn2(this, result);
};
}
function _possibleConstructorReturn2(self2, call2) {
if (call2 && (_typeof2(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _isNativeReflectConstruct2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _getPrototypeOf2(o2) {
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf2(o2);
}
function _defineProperty2(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
var layoutClassName = "react-grid-layout";
function WidthProvideRGL(ComposedComponent) {
var _class;
return _class = /* @__PURE__ */ function(_React$Component) {
_inherits2(WidthProvider2, _React$Component);
var _super = _createSuper2(WidthProvider2);
function WidthProvider2() {
var _this;
_classCallCheck2(this, WidthProvider2);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty2(_assertThisInitialized2(_this), "state", {
width: 1280
});
_defineProperty2(_assertThisInitialized2(_this), "elementRef", /* @__PURE__ */ React2.createRef());
_defineProperty2(_assertThisInitialized2(_this), "mounted", false);
_defineProperty2(_assertThisInitialized2(_this), "onWindowResize", function() {
if (!_this.mounted)
return;
var node2 = _this.elementRef.current;
if (node2 instanceof HTMLElement && node2.offsetWidth) {
_this.setState({
width: node2.offsetWidth
});
}
});
return _this;
}
_createClass2(WidthProvider2, [{
key: "componentDidMount",
value: function componentDidMount() {
this.mounted = true;
window.addEventListener("resize", this.onWindowResize);
this.onWindowResize();
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.mounted = false;
window.removeEventListener("resize", this.onWindowResize);
}
}, {
key: "render",
value: function render3() {
var _this$props = this.props, measureBeforeMount = _this$props.measureBeforeMount, rest = _objectWithoutProperties2(_this$props, _excluded5);
if (measureBeforeMount && !this.mounted) {
return /* @__PURE__ */ React2.createElement("div", {
className: (0, _clsx.default)(this.props.className, layoutClassName),
style: this.props.style,
ref: this.elementRef
});
}
return /* @__PURE__ */ React2.createElement(ComposedComponent, _extends2({
innerRef: this.elementRef
}, rest, this.state));
}
}]);
return WidthProvider2;
}(React2.Component), _defineProperty2(_class, "defaultProps", {
measureBeforeMount: false
}), _defineProperty2(_class, "propTypes", {
// If true, will not render children until mounted. Useful for getting the exact width before
// rendering, to prevent any unsightly resizing.
measureBeforeMount: _propTypes.default.bool
}), _class;
}
return WidthProvider;
}
var hasRequiredReactGridLayout;
function requireReactGridLayout() {
if (hasRequiredReactGridLayout)
return reactGridLayout.exports;
hasRequiredReactGridLayout = 1;
(function(module) {
module.exports = requireReactGridLayout$1().default;
module.exports.utils = requireUtils$1();
module.exports.Responsive = requireResponsiveReactGridLayout().default;
module.exports.Responsive.utils = requireResponsiveUtils();
module.exports.WidthProvider = requireWidthProvider().default;
})(reactGridLayout);
return reactGridLayout.exports;
}
const styles = "";
const styles$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: styles
}, Symbol.toStringTag, { value: "Module" }));
const require$$3 = /* @__PURE__ */ getAugmentedNamespace(styles$1);
var _arrayAggregator;
var hasRequired_arrayAggregator;
function require_arrayAggregator() {
if (hasRequired_arrayAggregator)
return _arrayAggregator;
hasRequired_arrayAggregator = 1;
function arrayAggregator(array2, setter, iteratee, accumulator) {
var index2 = -1, length2 = array2 == null ? 0 : array2.length;
while (++index2 < length2) {
var value2 = array2[index2];
setter(accumulator, value2, iteratee(value2), array2);
}
return accumulator;
}
_arrayAggregator = arrayAggregator;
return _arrayAggregator;
}
var _baseForOwn;
var hasRequired_baseForOwn;
function require_baseForOwn() {
if (hasRequired_baseForOwn)
return _baseForOwn;
hasRequired_baseForOwn = 1;
var baseFor = require_baseFor(), keys3 = requireKeys();
function baseForOwn(object2, iteratee) {
return object2 && baseFor(object2, iteratee, keys3);
}
_baseForOwn = baseForOwn;
return _baseForOwn;
}
var _createBaseEach;
var hasRequired_createBaseEach;
function require_createBaseEach() {
if (hasRequired_createBaseEach)
return _createBaseEach;
hasRequired_createBaseEach = 1;
var isArrayLike2 = requireIsArrayLike();
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike2(collection)) {
return eachFunc(collection, iteratee);
}
var length2 = collection.length, index2 = fromRight ? length2 : -1, iterable = Object(collection);
while (fromRight ? index2-- : ++index2 < length2) {
if (iteratee(iterable[index2], index2, iterable) === false) {
break;
}
}
return collection;
};
}
_createBaseEach = createBaseEach;
return _createBaseEach;
}
var _baseEach;
var hasRequired_baseEach;
function require_baseEach() {
if (hasRequired_baseEach)
return _baseEach;
hasRequired_baseEach = 1;
var baseForOwn = require_baseForOwn(), createBaseEach = require_createBaseEach();
var baseEach = createBaseEach(baseForOwn);
_baseEach = baseEach;
return _baseEach;
}
var _baseAggregator;
var hasRequired_baseAggregator;
function require_baseAggregator() {
if (hasRequired_baseAggregator)
return _baseAggregator;
hasRequired_baseAggregator = 1;
var baseEach = require_baseEach();
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value2, key2, collection2) {
setter(accumulator, value2, iteratee(value2), collection2);
});
return accumulator;
}
_baseAggregator = baseAggregator;
return _baseAggregator;
}
var _createAggregator;
var hasRequired_createAggregator;
function require_createAggregator() {
if (hasRequired_createAggregator)
return _createAggregator;
hasRequired_createAggregator = 1;
var arrayAggregator = require_arrayAggregator(), baseAggregator = require_baseAggregator(), baseIteratee = require_baseIteratee(), isArray3 = requireIsArray();
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var func = isArray3(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
};
}
_createAggregator = createAggregator;
return _createAggregator;
}
var groupBy_1;
var hasRequiredGroupBy;
function requireGroupBy() {
if (hasRequiredGroupBy)
return groupBy_1;
hasRequiredGroupBy = 1;
var baseAssignValue = require_baseAssignValue(), createAggregator = require_createAggregator();
var objectProto2 = Object.prototype;
var hasOwnProperty2 = objectProto2.hasOwnProperty;
var groupBy = createAggregator(function(result, value2, key2) {
if (hasOwnProperty2.call(result, key2)) {
result[key2].push(value2);
} else {
baseAssignValue(result, key2, [value2]);
}
});
groupBy_1 = groupBy;
return groupBy_1;
}
const require$$11$1 = /* @__PURE__ */ getAugmentedNamespace(memoizeOne_esm);
function useCombinedRefs() {
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
refs[_key] = arguments[_key];
}
return reactExports.useMemo(
() => (node2) => {
refs.forEach((ref2) => ref2(node2));
},
// eslint-disable-next-line react-hooks/exhaustive-deps
refs
);
}
const canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
function isWindow(element2) {
const elementString = Object.prototype.toString.call(element2);
return elementString === "[object Window]" || // In Electron context the Window object serializes to [object global]
elementString === "[object global]";
}
function isNode(node2) {
return "nodeType" in node2;
}
function getWindow(target2) {
var _target$ownerDocument, _target$ownerDocument2;
if (!target2) {
return window;
}
if (isWindow(target2)) {
return target2;
}
if (!isNode(target2)) {
return window;
}
return (_target$ownerDocument = (_target$ownerDocument2 = target2.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
}
function isDocument(node2) {
const {
Document: Document2
} = getWindow(node2);
return node2 instanceof Document2;
}
function isHTMLElement$1(node2) {
if (isWindow(node2)) {
return false;
}
return node2 instanceof getWindow(node2).HTMLElement;
}
function isSVGElement$1(node2) {
return node2 instanceof getWindow(node2).SVGElement;
}
function getOwnerDocument(target2) {
if (!target2) {
return document;
}
if (isWindow(target2)) {
return target2.document;
}
if (!isNode(target2)) {
return document;
}
if (isDocument(target2)) {
return target2;
}
if (isHTMLElement$1(target2)) {
return target2.ownerDocument;
}
return document;
}
const useIsomorphicLayoutEffect = canUseDOM ? reactExports.useLayoutEffect : reactExports.useEffect;
function useEvent(handler) {
const handlerRef = reactExports.useRef(handler);
useIsomorphicLayoutEffect(() => {
handlerRef.current = handler;
});
return reactExports.useCallback(function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return handlerRef.current == null ? void 0 : handlerRef.current(...args);
}, []);
}
function useInterval() {
const intervalRef = reactExports.useRef(null);
const set2 = reactExports.useCallback((listener2, duration2) => {
intervalRef.current = setInterval(listener2, duration2);
}, []);
const clear2 = reactExports.useCallback(() => {
if (intervalRef.current !== null) {
clearInterval(intervalRef.current);
intervalRef.current = null;
}
}, []);
return [set2, clear2];
}
function useLatestValue(value2, dependencies) {
if (dependencies === void 0) {
dependencies = [value2];
}
const valueRef = reactExports.useRef(value2);
useIsomorphicLayoutEffect(() => {
if (valueRef.current !== value2) {
valueRef.current = value2;
}
}, dependencies);
return valueRef;
}
function useLazyMemo(callback, dependencies) {
const valueRef = reactExports.useRef();
return reactExports.useMemo(
() => {
const newValue = callback(valueRef.current);
valueRef.current = newValue;
return newValue;
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[...dependencies]
);
}
function useNodeRef(onChange2) {
const onChangeHandler = useEvent(onChange2);
const node2 = reactExports.useRef(null);
const setNodeRef = reactExports.useCallback(
(element2) => {
if (element2 !== node2.current) {
onChangeHandler == null ? void 0 : onChangeHandler(element2, node2.current);
}
node2.current = element2;
},
//eslint-disable-next-line
[]
);
return [node2, setNodeRef];
}
let ids = {};
function useUniqueId(prefix2, value2) {
return reactExports.useMemo(() => {
if (value2) {
return value2;
}
const id = ids[prefix2] == null ? 0 : ids[prefix2] + 1;
ids[prefix2] = id;
return prefix2 + "-" + id;
}, [prefix2, value2]);
}
function createAdjustmentFn(modifier) {
return function(object2) {
for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
adjustments[_key - 1] = arguments[_key];
}
return adjustments.reduce((accumulator, adjustment) => {
const entries = Object.entries(adjustment);
for (const [key2, valueAdjustment] of entries) {
const value2 = accumulator[key2];
if (value2 != null) {
accumulator[key2] = value2 + modifier * valueAdjustment;
}
}
return accumulator;
}, {
...object2
});
};
}
const add$4 = /* @__PURE__ */ createAdjustmentFn(1);
const subtract = /* @__PURE__ */ createAdjustmentFn(-1);
function hasViewportRelativeCoordinates(event2) {
return "clientX" in event2 && "clientY" in event2;
}
function isKeyboardEvent(event2) {
if (!event2) {
return false;
}
const {
KeyboardEvent
} = getWindow(event2.target);
return KeyboardEvent && event2 instanceof KeyboardEvent;
}
function isTouchEvent$1(event2) {
if (!event2) {
return false;
}
const {
TouchEvent: TouchEvent2
} = getWindow(event2.target);
return TouchEvent2 && event2 instanceof TouchEvent2;
}
function getEventCoordinates(event2) {
if (isTouchEvent$1(event2)) {
if (event2.touches && event2.touches.length) {
const {
clientX: x2,
clientY: y2
} = event2.touches[0];
return {
x: x2,
y: y2
};
} else if (event2.changedTouches && event2.changedTouches.length) {
const {
clientX: x2,
clientY: y2
} = event2.changedTouches[0];
return {
x: x2,
y: y2
};
}
}
if (hasViewportRelativeCoordinates(event2)) {
return {
x: event2.clientX,
y: event2.clientY
};
}
return null;
}
const CSS$1 = /* @__PURE__ */ Object.freeze({
Translate: {
toString(transform2) {
if (!transform2) {
return;
}
const {
x: x2,
y: y2
} = transform2;
return "translate3d(" + (x2 ? Math.round(x2) : 0) + "px, " + (y2 ? Math.round(y2) : 0) + "px, 0)";
}
},
Scale: {
toString(transform2) {
if (!transform2) {
return;
}
const {
scaleX,
scaleY: scaleY2
} = transform2;
return "scaleX(" + scaleX + ") scaleY(" + scaleY2 + ")";
}
},
Transform: {
toString(transform2) {
if (!transform2) {
return;
}
return [CSS$1.Translate.toString(transform2), CSS$1.Scale.toString(transform2)].join(" ");
}
},
Transition: {
toString(_ref3) {
let {
property: property2,
duration: duration2,
easing
} = _ref3;
return property2 + " " + duration2 + "ms " + easing;
}
}
});
const hiddenStyles = {
display: "none"
};
function HiddenText(_ref3) {
let {
id,
value: value2
} = _ref3;
return React.createElement("div", {
id,
style: hiddenStyles
}, value2);
}
const visuallyHidden = {
position: "fixed",
width: 1,
height: 1,
margin: -1,
border: 0,
padding: 0,
overflow: "hidden",
clip: "rect(0 0 0 0)",
clipPath: "inset(100%)",
whiteSpace: "nowrap"
};
function LiveRegion2(_ref3) {
let {
id,
announcement
} = _ref3;
return React.createElement("div", {
id,
style: visuallyHidden,
role: "status",
"aria-live": "assertive",
"aria-atomic": true
}, announcement);
}
function useAnnouncement() {
const [announcement, setAnnouncement] = reactExports.useState("");
const announce = reactExports.useCallback((value2) => {
if (value2 != null) {
setAnnouncement(value2);
}
}, []);
return {
announce,
announcement
};
}
const screenReaderInstructions = {
draggable: `
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`
};
const defaultAnnouncements = {
onDragStart(id) {
return `Picked up draggable item ${id}.`;
},
onDragOver(id, overId) {
if (overId) {
return `Draggable item ${id} was moved over droppable area ${overId}.`;
}
return `Draggable item ${id} is no longer over a droppable area.`;
},
onDragEnd(id, overId) {
if (overId) {
return `Draggable item ${id} was dropped over droppable area ${overId}`;
}
return `Draggable item ${id} was dropped.`;
},
onDragCancel(id) {
return `Dragging was cancelled. Draggable item ${id} was dropped.`;
}
};
var Action;
(function(Action2) {
Action2["DragStart"] = "dragStart";
Action2["DragMove"] = "dragMove";
Action2["DragEnd"] = "dragEnd";
Action2["DragCancel"] = "dragCancel";
Action2["DragOver"] = "dragOver";
Action2["RegisterDroppable"] = "registerDroppable";
Action2["SetDroppableDisabled"] = "setDroppableDisabled";
Action2["UnregisterDroppable"] = "unregisterDroppable";
})(Action || (Action = {}));
function noop$a(..._args) {
}
class DroppableContainersMap extends Map {
get(id) {
var _super$get;
return id != null ? (_super$get = super.get(id)) != null ? _super$get : void 0 : void 0;
}
toArray() {
return Array.from(this.values());
}
getEnabled() {
return this.toArray().filter(({
disabled
}) => !disabled);
}
getNodeFor(id) {
var _this$get$node$curren, _this$get;
return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : void 0;
}
}
const defaultPublicContext = {
activatorEvent: null,
active: null,
activeNode: null,
activeNodeRect: null,
collisions: null,
containerNodeRect: null,
draggableNodes: {},
droppableRects: /* @__PURE__ */ new Map(),
droppableContainers: /* @__PURE__ */ new DroppableContainersMap(),
over: null,
dragOverlay: {
nodeRef: {
current: null
},
rect: null,
setRef: noop$a
},
scrollableAncestors: [],
scrollableAncestorRects: [],
measureDroppableContainers: noop$a,
windowRect: null,
measuringScheduled: false
};
const defaultInternalContext = {
activatorEvent: null,
activators: [],
active: null,
activeNodeRect: null,
ariaDescribedById: {
draggable: ""
},
dispatch: noop$a,
draggableNodes: {},
over: null,
measureDroppableContainers: noop$a
};
const InternalContext = /* @__PURE__ */ reactExports.createContext(defaultInternalContext);
const PublicContext = /* @__PURE__ */ reactExports.createContext(defaultPublicContext);
function getInitialState() {
return {
draggable: {
active: null,
initialCoordinates: {
x: 0,
y: 0
},
nodes: {},
translate: {
x: 0,
y: 0
}
},
droppable: {
containers: new DroppableContainersMap()
}
};
}
function reducer$1(state, action) {
switch (action.type) {
case Action.DragStart:
return {
...state,
draggable: {
...state.draggable,
initialCoordinates: action.initialCoordinates,
active: action.active
}
};
case Action.DragMove:
if (!state.draggable.active) {
return state;
}
return {
...state,
draggable: {
...state.draggable,
translate: {
x: action.coordinates.x - state.draggable.initialCoordinates.x,
y: action.coordinates.y - state.draggable.initialCoordinates.y
}
}
};
case Action.DragEnd:
case Action.DragCancel:
return {
...state,
draggable: {
...state.draggable,
active: null,
initialCoordinates: {
x: 0,
y: 0
},
translate: {
x: 0,
y: 0
}
}
};
case Action.RegisterDroppable: {
const {
element: element2
} = action;
const {
id
} = element2;
const containers = new DroppableContainersMap(state.droppable.containers);
containers.set(id, element2);
return {
...state,
droppable: {
...state.droppable,
containers
}
};
}
case Action.SetDroppableDisabled: {
const {
id,
key: key2,
disabled
} = action;
const element2 = state.droppable.containers.get(id);
if (!element2 || key2 !== element2.key) {
return state;
}
const containers = new DroppableContainersMap(state.droppable.containers);
containers.set(id, {
...element2,
disabled
});
return {
...state,
droppable: {
...state.droppable,
containers
}
};
}
case Action.UnregisterDroppable: {
const {
id,
key: key2
} = action;
const element2 = state.droppable.containers.get(id);
if (!element2 || key2 !== element2.key) {
return state;
}
const containers = new DroppableContainersMap(state.droppable.containers);
containers.delete(id);
return {
...state,
droppable: {
...state.droppable,
containers
}
};
}
default: {
return state;
}
}
}
const DndMonitorContext = /* @__PURE__ */ reactExports.createContext({
type: null,
event: null
});
function useDndMonitor({
onDragStart,
onDragMove,
onDragOver,
onDragEnd,
onDragCancel
}) {
const monitorState = reactExports.useContext(DndMonitorContext);
const previousMonitorState = reactExports.useRef(monitorState);
reactExports.useEffect(() => {
if (monitorState !== previousMonitorState.current) {
const {
type: type2,
event: event2
} = monitorState;
switch (type2) {
case Action.DragStart:
onDragStart == null ? void 0 : onDragStart(event2);
break;
case Action.DragMove:
onDragMove == null ? void 0 : onDragMove(event2);
break;
case Action.DragOver:
onDragOver == null ? void 0 : onDragOver(event2);
break;
case Action.DragCancel:
onDragCancel == null ? void 0 : onDragCancel(event2);
break;
case Action.DragEnd:
onDragEnd == null ? void 0 : onDragEnd(event2);
break;
}
previousMonitorState.current = monitorState;
}
}, [monitorState, onDragStart, onDragMove, onDragOver, onDragEnd, onDragCancel]);
}
function Accessibility({
announcements = defaultAnnouncements,
hiddenTextDescribedById,
screenReaderInstructions: screenReaderInstructions2
}) {
const {
announce,
announcement
} = useAnnouncement();
const liveRegionId = useUniqueId(`DndLiveRegion`);
const [mounted, setMounted] = reactExports.useState(false);
reactExports.useEffect(() => {
setMounted(true);
}, []);
useDndMonitor(reactExports.useMemo(() => ({
onDragStart({
active
}) {
announce(announcements.onDragStart(active.id));
},
onDragMove({
active,
over
}) {
if (announcements.onDragMove) {
announce(announcements.onDragMove(active.id, over == null ? void 0 : over.id));
}
},
onDragOver({
active,
over
}) {
announce(announcements.onDragOver(active.id, over == null ? void 0 : over.id));
},
onDragEnd({
active,
over
}) {
announce(announcements.onDragEnd(active.id, over == null ? void 0 : over.id));
},
onDragCancel({
active
}) {
announce(announcements.onDragCancel(active.id));
}
}), [announce, announcements]));
return mounted ? reactDomExports.createPortal(React.createElement(React.Fragment, null, React.createElement(HiddenText, {
id: hiddenTextDescribedById,
value: screenReaderInstructions2.draggable
}), React.createElement(LiveRegion2, {
id: liveRegionId,
announcement
})), document.body) : null;
}
const defaultCoordinates = /* @__PURE__ */ Object.freeze({
x: 0,
y: 0
});
function distanceBetween(p1, p2) {
return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
}
function getRelativeTransformOrigin(event2, rect2) {
const eventCoordinates = getEventCoordinates(event2);
if (!eventCoordinates) {
return "0 0";
}
const transformOrigin2 = {
x: (eventCoordinates.x - rect2.left) / rect2.width * 100,
y: (eventCoordinates.y - rect2.top) / rect2.height * 100
};
return `${transformOrigin2.x}% ${transformOrigin2.y}%`;
}
function sortCollisionsAsc({
data: {
value: a2
}
}, {
data: {
value: b2
}
}) {
return a2 - b2;
}
function sortCollisionsDesc({
data: {
value: a2
}
}, {
data: {
value: b2
}
}) {
return b2 - a2;
}
function cornersOfRectangle({
left: left2,
top: top2,
height: height2,
width: width2
}) {
return [{
x: left2,
y: top2
}, {
x: left2 + width2,
y: top2
}, {
x: left2,
y: top2 + height2
}, {
x: left2 + width2,
y: top2 + height2
}];
}
function getFirstCollision(collisions, property2) {
if (!collisions || collisions.length === 0) {
return null;
}
const [firstCollision] = collisions;
return property2 ? firstCollision[property2] : firstCollision;
}
function centerOfRectangle(rect2, left2 = rect2.left, top2 = rect2.top) {
return {
x: left2 + rect2.width * 0.5,
y: top2 + rect2.height * 0.5
};
}
const closestCenter = ({
collisionRect,
droppableContainers
}) => {
const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top);
const collisions = [];
for (const droppableContainer of droppableContainers) {
const {
id,
rect: {
current: rect2
}
} = droppableContainer;
if (rect2) {
const distBetween = distanceBetween(centerOfRectangle(rect2), centerRect);
collisions.push({
id,
data: {
droppableContainer,
value: distBetween
}
});
}
}
return collisions.sort(sortCollisionsAsc);
};
const closestCorners = ({
collisionRect,
droppableContainers
}) => {
const corners = cornersOfRectangle(collisionRect);
const collisions = [];
for (const droppableContainer of droppableContainers) {
const {
id,
rect: {
current: rect2
}
} = droppableContainer;
if (rect2) {
const rectCorners = cornersOfRectangle(rect2);
const distances = corners.reduce((accumulator, corner, index2) => {
return accumulator + distanceBetween(rectCorners[index2], corner);
}, 0);
const effectiveDistance = Number((distances / 4).toFixed(4));
collisions.push({
id,
data: {
droppableContainer,
value: effectiveDistance
}
});
}
}
return collisions.sort(sortCollisionsAsc);
};
function getIntersectionRatio(entry2, target2) {
const top2 = Math.max(target2.top, entry2.top);
const left2 = Math.max(target2.left, entry2.left);
const right2 = Math.min(target2.left + target2.width, entry2.left + entry2.width);
const bottom2 = Math.min(target2.top + target2.height, entry2.top + entry2.height);
const width2 = right2 - left2;
const height2 = bottom2 - top2;
if (left2 < right2 && top2 < bottom2) {
const targetArea = target2.width * target2.height;
const entryArea = entry2.width * entry2.height;
const intersectionArea = width2 * height2;
const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea);
return Number(intersectionRatio.toFixed(4));
}
return 0;
}
const rectIntersection = ({
collisionRect,
droppableContainers
}) => {
const collisions = [];
for (const droppableContainer of droppableContainers) {
const {
id,
rect: {
current: rect2
}
} = droppableContainer;
if (rect2) {
const intersectionRatio = getIntersectionRatio(rect2, collisionRect);
if (intersectionRatio > 0) {
collisions.push({
id,
data: {
droppableContainer,
value: intersectionRatio
}
});
}
}
}
return collisions.sort(sortCollisionsDesc);
};
function isPointWithinRect(point2, rect2) {
const {
top: top2,
left: left2,
bottom: bottom2,
right: right2
} = rect2;
return top2 <= point2.y && point2.y <= bottom2 && left2 <= point2.x && point2.x <= right2;
}
const pointerWithin = ({
droppableContainers,
pointerCoordinates
}) => {
if (!pointerCoordinates) {
return [];
}
const collisions = [];
for (const droppableContainer of droppableContainers) {
const {
id,
rect: {
current: rect2
}
} = droppableContainer;
if (rect2 && isPointWithinRect(pointerCoordinates, rect2)) {
const corners = cornersOfRectangle(rect2);
const distances = corners.reduce((accumulator, corner) => {
return accumulator + distanceBetween(pointerCoordinates, corner);
}, 0);
const effectiveDistance = Number((distances / 4).toFixed(4));
collisions.push({
id,
data: {
droppableContainer,
value: effectiveDistance
}
});
}
}
return collisions.sort(sortCollisionsAsc);
};
function adjustScale(transform2, rect1, rect2) {
return {
...transform2,
scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1,
scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1
};
}
function getRectDelta(rect1, rect2) {
return rect1 && rect2 ? {
x: rect1.left - rect2.left,
y: rect1.top - rect2.top
} : defaultCoordinates;
}
function createRectAdjustmentFn(modifier) {
return function adjustClientRect(rect2, ...adjustments) {
return adjustments.reduce((acc, adjustment) => ({
...acc,
top: acc.top + modifier * adjustment.y,
bottom: acc.bottom + modifier * adjustment.y,
left: acc.left + modifier * adjustment.x,
right: acc.right + modifier * adjustment.x
}), {
...rect2
});
};
}
const getAdjustedRect = /* @__PURE__ */ createRectAdjustmentFn(1);
function inverseTransform(rect2, transform2, transformOrigin2) {
let ta2, sx, sy, dx, dy;
if (transform2.startsWith("matrix3d(")) {
ta2 = transform2.slice(9, -1).split(/, /);
sx = +ta2[0];
sy = +ta2[5];
dx = +ta2[12];
dy = +ta2[13];
} else if (transform2.startsWith("matrix(")) {
ta2 = transform2.slice(7, -1).split(/, /);
sx = +ta2[0];
sy = +ta2[3];
dx = +ta2[4];
dy = +ta2[5];
} else {
return rect2;
}
const x2 = rect2.left - dx - (1 - sx) * parseFloat(transformOrigin2);
const y2 = rect2.top - dy - (1 - sy) * parseFloat(transformOrigin2.slice(transformOrigin2.indexOf(" ") + 1));
const w2 = sx ? rect2.width / sx : rect2.width;
const h2 = sy ? rect2.height / sy : rect2.height;
return {
width: w2,
height: h2,
top: y2,
right: x2 + w2,
bottom: y2 + h2,
left: x2
};
}
const defaultOptions$1 = {
ignoreTransform: false
};
function getClientRect(element2, options2 = defaultOptions$1) {
let rect2 = element2.getBoundingClientRect();
if (options2.ignoreTransform) {
const {
getComputedStyle: getComputedStyle2
} = getWindow(element2);
const {
transform: transform2,
transformOrigin: transformOrigin2
} = getComputedStyle2(element2);
if (transform2) {
rect2 = inverseTransform(rect2, transform2, transformOrigin2);
}
}
const {
top: top2,
left: left2,
width: width2,
height: height2,
bottom: bottom2,
right: right2
} = rect2;
return {
top: top2,
left: left2,
width: width2,
height: height2,
bottom: bottom2,
right: right2
};
}
function getTransformAgnosticClientRect(element2) {
return getClientRect(element2, {
ignoreTransform: true
});
}
function getWindowClientRect(element2) {
const width2 = element2.innerWidth;
const height2 = element2.innerHeight;
return {
top: 0,
left: 0,
right: width2,
bottom: height2,
width: width2,
height: height2
};
}
function isFixed(node2, computedStyle = getWindow(node2).getComputedStyle(node2)) {
return computedStyle.position === "fixed";
}
function isScrollable$1(element2, computedStyle = getWindow(element2).getComputedStyle(element2)) {
const overflowRegex = /(auto|scroll|overlay)/;
const properties2 = ["overflow", "overflowX", "overflowY"];
return properties2.find((property2) => {
const value2 = computedStyle[property2];
return typeof value2 === "string" ? overflowRegex.test(value2) : false;
}) != null;
}
function getScrollableAncestors(element2) {
const scrollParents = [];
function findScrollableAncestors(node2) {
if (!node2) {
return scrollParents;
}
if (isDocument(node2) && node2.scrollingElement != null && !scrollParents.includes(node2.scrollingElement)) {
scrollParents.push(node2.scrollingElement);
return scrollParents;
}
if (!isHTMLElement$1(node2) || isSVGElement$1(node2)) {
return scrollParents;
}
if (scrollParents.includes(node2)) {
return scrollParents;
}
const {
getComputedStyle: getComputedStyle2
} = getWindow(node2);
const computedStyle = getComputedStyle2(node2);
if (node2 !== element2) {
if (isScrollable$1(node2, computedStyle)) {
scrollParents.push(node2);
}
}
if (isFixed(node2, computedStyle)) {
return scrollParents;
}
return findScrollableAncestors(node2.parentNode);
}
if (!element2) {
return scrollParents;
}
return findScrollableAncestors(element2);
}
function getScrollableElement(element2) {
if (!canUseDOM || !element2) {
return null;
}
if (isWindow(element2)) {
return element2;
}
if (!isNode(element2)) {
return null;
}
if (isDocument(element2) || element2 === getOwnerDocument(element2).scrollingElement) {
return window;
}
if (isHTMLElement$1(element2)) {
return element2;
}
return null;
}
function getScrollXCoordinate(element2) {
if (isWindow(element2)) {
return element2.scrollX;
}
return element2.scrollLeft;
}
function getScrollYCoordinate(element2) {
if (isWindow(element2)) {
return element2.scrollY;
}
return element2.scrollTop;
}
function getScrollCoordinates(element2) {
return {
x: getScrollXCoordinate(element2),
y: getScrollYCoordinate(element2)
};
}
var Direction;
(function(Direction2) {
Direction2[Direction2["Forward"] = 1] = "Forward";
Direction2[Direction2["Backward"] = -1] = "Backward";
})(Direction || (Direction = {}));
function getScrollPosition(scrollingContainer) {
const minScroll = {
x: 0,
y: 0
};
const maxScroll = {
x: scrollingContainer.scrollWidth - scrollingContainer.clientWidth,
y: scrollingContainer.scrollHeight - scrollingContainer.clientHeight
};
const isTop = scrollingContainer.scrollTop <= minScroll.y;
const isLeft = scrollingContainer.scrollLeft <= minScroll.x;
const isBottom = scrollingContainer.scrollTop >= maxScroll.y;
const isRight = scrollingContainer.scrollLeft >= maxScroll.x;
return {
isTop,
isLeft,
isBottom,
isRight,
maxScroll,
minScroll
};
}
function isDocumentScrollingElement(element2) {
if (!canUseDOM || !element2) {
return false;
}
return element2 === document.scrollingElement;
}
const defaultThreshold = {
x: 0.2,
y: 0.2
};
function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, {
top: top2,
left: left2,
right: right2,
bottom: bottom2
}, acceleration = 10, thresholdPercentage = defaultThreshold) {
const {
clientHeight,
clientWidth
} = scrollContainer;
const finalScrollContainerRect = isDocumentScrollingElement(scrollContainer) ? {
top: 0,
left: 0,
right: clientWidth,
bottom: clientHeight,
width: clientWidth,
height: clientHeight
} : scrollContainerRect;
const {
isTop,
isBottom,
isLeft,
isRight
} = getScrollPosition(scrollContainer);
const direction2 = {
x: 0,
y: 0
};
const speed = {
x: 0,
y: 0
};
const threshold2 = {
height: finalScrollContainerRect.height * thresholdPercentage.y,
width: finalScrollContainerRect.width * thresholdPercentage.x
};
if (!isTop && top2 <= finalScrollContainerRect.top + threshold2.height) {
direction2.y = Direction.Backward;
speed.y = acceleration * Math.abs((finalScrollContainerRect.top + threshold2.height - top2) / threshold2.height);
} else if (!isBottom && bottom2 >= finalScrollContainerRect.bottom - threshold2.height) {
direction2.y = Direction.Forward;
speed.y = acceleration * Math.abs((finalScrollContainerRect.bottom - threshold2.height - bottom2) / threshold2.height);
}
if (!isRight && right2 >= finalScrollContainerRect.right - threshold2.width) {
direction2.x = Direction.Forward;
speed.x = acceleration * Math.abs((finalScrollContainerRect.right - threshold2.width - right2) / threshold2.width);
} else if (!isLeft && left2 <= finalScrollContainerRect.left + threshold2.width) {
direction2.x = Direction.Backward;
speed.x = acceleration * Math.abs((finalScrollContainerRect.left + threshold2.width - left2) / threshold2.width);
}
return {
direction: direction2,
speed
};
}
function getScrollElementRect(element2) {
if (element2 === document.scrollingElement) {
const {
innerWidth,
innerHeight
} = window;
return {
top: 0,
left: 0,
right: innerWidth,
bottom: innerHeight,
width: innerWidth,
height: innerHeight
};
}
const {
top: top2,
left: left2,
right: right2,
bottom: bottom2
} = element2.getBoundingClientRect();
return {
top: top2,
left: left2,
right: right2,
bottom: bottom2,
width: element2.clientWidth,
height: element2.clientHeight
};
}
function getScrollOffsets(scrollableAncestors) {
return scrollableAncestors.reduce((acc, node2) => {
return add$4(acc, getScrollCoordinates(node2));
}, defaultCoordinates);
}
function getScrollXOffset(scrollableAncestors) {
return scrollableAncestors.reduce((acc, node2) => {
return acc + getScrollXCoordinate(node2);
}, 0);
}
function getScrollYOffset(scrollableAncestors) {
return scrollableAncestors.reduce((acc, node2) => {
return acc + getScrollYCoordinate(node2);
}, 0);
}
const properties = [["x", ["left", "right"], getScrollXOffset], ["y", ["top", "bottom"], getScrollYOffset]];
class Rect {
constructor(rect2, element2) {
this.rect = void 0;
this.width = void 0;
this.height = void 0;
this.top = void 0;
this.bottom = void 0;
this.right = void 0;
this.left = void 0;
const scrollableAncestors = getScrollableAncestors(element2);
const scrollOffsets = getScrollOffsets(scrollableAncestors);
this.rect = {
...rect2
};
this.width = rect2.width;
this.height = rect2.height;
for (const [axis, keys3, getScrollOffset] of properties) {
for (const key2 of keys3) {
Object.defineProperty(this, key2, {
get: () => {
const currentOffsets = getScrollOffset(scrollableAncestors);
const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets;
return this.rect[key2] + scrollOffsetsDeltla;
},
enumerable: true
});
}
}
Object.defineProperty(this, "rect", {
enumerable: false
});
}
}
var AutoScrollActivator;
(function(AutoScrollActivator2) {
AutoScrollActivator2[AutoScrollActivator2["Pointer"] = 0] = "Pointer";
AutoScrollActivator2[AutoScrollActivator2["DraggableRect"] = 1] = "DraggableRect";
})(AutoScrollActivator || (AutoScrollActivator = {}));
var TraversalOrder;
(function(TraversalOrder2) {
TraversalOrder2[TraversalOrder2["TreeOrder"] = 0] = "TreeOrder";
TraversalOrder2[TraversalOrder2["ReversedTreeOrder"] = 1] = "ReversedTreeOrder";
})(TraversalOrder || (TraversalOrder = {}));
function useAutoScroller({
acceleration,
activator = AutoScrollActivator.Pointer,
canScroll,
draggingRect,
enabled,
interval: interval2 = 5,
order: order2 = TraversalOrder.TreeOrder,
pointerCoordinates,
scrollableAncestors,
scrollableAncestorRects,
threshold: threshold2
}) {
const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval();
const scrollSpeed = reactExports.useRef({
x: 1,
y: 1
});
const rect2 = reactExports.useMemo(() => {
switch (activator) {
case AutoScrollActivator.Pointer:
return pointerCoordinates ? {
top: pointerCoordinates.y,
bottom: pointerCoordinates.y,
left: pointerCoordinates.x,
right: pointerCoordinates.x
} : null;
case AutoScrollActivator.DraggableRect:
return draggingRect;
}
return null;
}, [activator, draggingRect, pointerCoordinates]);
const scrollDirection = reactExports.useRef(defaultCoordinates);
const scrollContainerRef = reactExports.useRef(null);
const autoScroll = reactExports.useCallback(() => {
const scrollContainer = scrollContainerRef.current;
if (!scrollContainer) {
return;
}
const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x;
const scrollTop = scrollSpeed.current.y * scrollDirection.current.y;
scrollContainer.scrollBy(scrollLeft, scrollTop);
}, []);
const sortedScrollableAncestors = reactExports.useMemo(() => order2 === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order2, scrollableAncestors]);
reactExports.useEffect(
() => {
if (!enabled || !scrollableAncestors.length || !rect2) {
clearAutoScrollInterval();
return;
}
for (const scrollContainer of sortedScrollableAncestors) {
if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) {
continue;
}
const index2 = scrollableAncestors.indexOf(scrollContainer);
const scrollContainerRect = scrollableAncestorRects[index2];
if (!scrollContainerRect) {
continue;
}
const {
direction: direction2,
speed
} = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect2, acceleration, threshold2);
if (speed.x > 0 || speed.y > 0) {
clearAutoScrollInterval();
scrollContainerRef.current = scrollContainer;
setAutoScrollInterval(autoScroll, interval2);
scrollSpeed.current = speed;
scrollDirection.current = direction2;
return;
}
}
scrollSpeed.current = {
x: 0,
y: 0
};
scrollDirection.current = {
x: 0,
y: 0
};
clearAutoScrollInterval();
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[
acceleration,
autoScroll,
canScroll,
clearAutoScrollInterval,
enabled,
interval2,
// eslint-disable-next-line react-hooks/exhaustive-deps
JSON.stringify(rect2),
setAutoScrollInterval,
scrollableAncestors,
sortedScrollableAncestors,
scrollableAncestorRects,
// eslint-disable-next-line react-hooks/exhaustive-deps
JSON.stringify(threshold2)
]
);
}
function useCachedNode(draggableNodes, id) {
const draggableNode = id !== null ? draggableNodes[id] : void 0;
const node2 = draggableNode ? draggableNode.node.current : null;
return useLazyMemo((cachedNode) => {
var _ref3;
if (id === null) {
return null;
}
return (_ref3 = node2 != null ? node2 : cachedNode) != null ? _ref3 : null;
}, [node2, id]);
}
function useCombineActivators(sensors, getSyntheticHandler) {
return reactExports.useMemo(() => sensors.reduce((accumulator, sensor) => {
const {
sensor: Sensor
} = sensor;
const sensorActivators = Sensor.activators.map((activator) => ({
eventName: activator.eventName,
handler: getSyntheticHandler(activator.handler, sensor)
}));
return [...accumulator, ...sensorActivators];
}, []), [sensors, getSyntheticHandler]);
}
var MeasuringStrategy;
(function(MeasuringStrategy2) {
MeasuringStrategy2[MeasuringStrategy2["Always"] = 0] = "Always";
MeasuringStrategy2[MeasuringStrategy2["BeforeDragging"] = 1] = "BeforeDragging";
MeasuringStrategy2[MeasuringStrategy2["WhileDragging"] = 2] = "WhileDragging";
})(MeasuringStrategy || (MeasuringStrategy = {}));
var MeasuringFrequency;
(function(MeasuringFrequency2) {
MeasuringFrequency2["Optimized"] = "optimized";
})(MeasuringFrequency || (MeasuringFrequency = {}));
const defaultValue = /* @__PURE__ */ new Map();
const defaultConfig = {
measure: getTransformAgnosticClientRect,
strategy: MeasuringStrategy.WhileDragging,
frequency: MeasuringFrequency.Optimized
};
function useDroppableMeasuring(containers, {
dragging,
dependencies,
config: config2
}) {
const [containerIdsScheduledForMeasurement, setContainerIdsScheduledForMeasurement] = reactExports.useState(null);
const measuringScheduled = containerIdsScheduledForMeasurement != null;
const {
frequency,
measure: measure2,
strategy
} = {
...defaultConfig,
...config2
};
const containersRef = reactExports.useRef(containers);
const measureDroppableContainers = reactExports.useCallback((ids2 = []) => setContainerIdsScheduledForMeasurement((value2) => value2 ? value2.concat(ids2) : ids2), []);
const timeoutId = reactExports.useRef(null);
const disabled = isDisabled();
const droppableRects = useLazyMemo((previousValue) => {
if (disabled && !dragging) {
return defaultValue;
}
const ids2 = containerIdsScheduledForMeasurement;
if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || ids2 != null) {
const map2 = /* @__PURE__ */ new Map();
for (let container of containers) {
if (!container) {
continue;
}
if (ids2 && ids2.length > 0 && !ids2.includes(container.id) && container.rect.current) {
map2.set(container.id, container.rect.current);
continue;
}
const node2 = container.node.current;
const rect2 = node2 ? new Rect(measure2(node2), node2) : null;
container.rect.current = rect2;
if (rect2) {
map2.set(container.id, rect2);
}
}
return map2;
}
return previousValue;
}, [containers, containerIdsScheduledForMeasurement, dragging, disabled, measure2]);
reactExports.useEffect(() => {
containersRef.current = containers;
}, [containers]);
reactExports.useEffect(
() => {
if (disabled) {
return;
}
requestAnimationFrame(() => measureDroppableContainers());
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[dragging, disabled]
);
reactExports.useEffect(() => {
if (measuringScheduled) {
setContainerIdsScheduledForMeasurement(null);
}
}, [measuringScheduled]);
reactExports.useEffect(
() => {
if (disabled || typeof frequency !== "number" || timeoutId.current !== null) {
return;
}
timeoutId.current = setTimeout(() => {
measureDroppableContainers();
timeoutId.current = null;
}, frequency);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[frequency, disabled, measureDroppableContainers, ...dependencies]
);
return {
droppableRects,
measureDroppableContainers,
measuringScheduled
};
function isDisabled() {
switch (strategy) {
case MeasuringStrategy.Always:
return false;
case MeasuringStrategy.BeforeDragging:
return dragging;
default:
return !dragging;
}
}
}
function useResizeObserver({
onResize,
disabled
}) {
const resizeObserver = reactExports.useMemo(() => {
if (disabled || typeof window === "undefined" || typeof window.ResizeObserver === "undefined") {
return void 0;
}
const {
ResizeObserver: ResizeObserver2
} = window;
return new ResizeObserver2(onResize);
}, [disabled, onResize]);
reactExports.useEffect(() => {
return () => resizeObserver == null ? void 0 : resizeObserver.disconnect();
}, [resizeObserver]);
return resizeObserver;
}
function useScrollOffsets(elements2) {
const [scrollCoordinates, setScrollCoordinates] = reactExports.useState(null);
const prevElements = reactExports.useRef(elements2);
const handleScroll = reactExports.useCallback((event2) => {
const scrollingElement = getScrollableElement(event2.target);
if (!scrollingElement) {
return;
}
setScrollCoordinates((scrollCoordinates2) => {
if (!scrollCoordinates2) {
return null;
}
scrollCoordinates2.set(scrollingElement, getScrollCoordinates(scrollingElement));
return new Map(scrollCoordinates2);
});
}, []);
reactExports.useEffect(() => {
const previousElements = prevElements.current;
if (elements2 !== previousElements) {
cleanup(previousElements);
const entries = elements2.map((element2) => {
const scrollableElement = getScrollableElement(element2);
if (scrollableElement) {
scrollableElement.addEventListener("scroll", handleScroll, {
passive: true
});
return [scrollableElement, getScrollCoordinates(scrollableElement)];
}
return null;
}).filter((entry2) => entry2 != null);
setScrollCoordinates(entries.length ? new Map(entries) : null);
prevElements.current = elements2;
}
return () => {
cleanup(elements2);
cleanup(previousElements);
};
function cleanup(elements3) {
elements3.forEach((element2) => {
const scrollableElement = getScrollableElement(element2);
scrollableElement == null ? void 0 : scrollableElement.removeEventListener("scroll", handleScroll);
});
}
}, [handleScroll, elements2]);
return reactExports.useMemo(() => {
if (elements2.length) {
return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add$4(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements2);
}
return defaultCoordinates;
}, [elements2, scrollCoordinates]);
}
const defaultValue$1 = [];
function useScrollableAncestors(node2) {
const previousNode = reactExports.useRef(node2);
const ancestors = useLazyMemo((previousValue) => {
if (!node2) {
return defaultValue$1;
}
if (previousValue && node2 && previousNode.current && node2.parentNode === previousNode.current.parentNode) {
return previousValue;
}
return getScrollableAncestors(node2);
}, [node2]);
reactExports.useEffect(() => {
previousNode.current = node2;
}, [node2]);
return ancestors;
}
function useSensorSetup(sensors) {
reactExports.useEffect(
() => {
if (!canUseDOM) {
return;
}
const teardownFns = sensors.map(({
sensor
}) => sensor.setup == null ? void 0 : sensor.setup());
return () => {
for (const teardown of teardownFns) {
teardown == null ? void 0 : teardown();
}
};
},
// TO-DO: Sensors length could theoretically change which would not be a valid dependency
// eslint-disable-next-line react-hooks/exhaustive-deps
sensors.map(({
sensor
}) => sensor)
);
}
function useSyntheticListeners(listeners, id) {
return reactExports.useMemo(() => {
return listeners.reduce((acc, {
eventName,
handler
}) => {
acc[eventName] = (event2) => {
handler(event2, id);
};
return acc;
}, {});
}, [listeners, id]);
}
const useClientRect = /* @__PURE__ */ createUseRectFn(getTransformAgnosticClientRect);
const useClientRects = /* @__PURE__ */ createUseRectsFn(getTransformAgnosticClientRect);
function useRect(element2, getRect, forceRecompute) {
const previousElement = reactExports.useRef(element2);
return useLazyMemo((previousValue) => {
if (!element2) {
return null;
}
if (forceRecompute || !previousValue && element2 || element2 !== previousElement.current) {
if (isHTMLElement$1(element2) && element2.parentNode == null) {
return null;
}
return new Rect(getRect(element2), element2);
}
return previousValue != null ? previousValue : null;
}, [element2, forceRecompute, getRect]);
}
function createUseRectFn(getRect) {
return (element2, forceRecompute) => useRect(element2, getRect, forceRecompute);
}
function createUseRectsFn(getRect) {
const defaultValue2 = [];
return function useRects(elements2, forceRecompute) {
const previousElements = reactExports.useRef(elements2);
return useLazyMemo((previousValue) => {
if (!elements2.length) {
return defaultValue2;
}
if (forceRecompute || !previousValue && elements2.length || elements2 !== previousElements.current) {
return elements2.map((element2) => new Rect(getRect(element2), element2));
}
return previousValue != null ? previousValue : defaultValue2;
}, [elements2, forceRecompute]);
};
}
function useWindowRect(element2) {
return reactExports.useMemo(() => element2 ? getWindowClientRect(element2) : null, [element2]);
}
function getMeasurableNode(node2) {
if (!node2) {
return null;
}
if (node2.children.length > 1) {
return node2;
}
const firstChild = node2.children[0];
return isHTMLElement$1(firstChild) ? firstChild : node2;
}
function useDragOverlayMeasuring({
measure: measure2 = getClientRect
}) {
const [rect2, setRect] = reactExports.useState(null);
const handleResize = reactExports.useCallback((entries) => {
for (const {
target: target2
} of entries) {
if (isHTMLElement$1(target2)) {
setRect((rect3) => {
const newRect = measure2(target2);
return rect3 ? {
...rect3,
width: newRect.width,
height: newRect.height
} : newRect;
});
break;
}
}
}, [measure2]);
const resizeObserver = useResizeObserver({
onResize: handleResize
});
const handleNodeChange = reactExports.useCallback((element2) => {
const node2 = getMeasurableNode(element2);
resizeObserver == null ? void 0 : resizeObserver.disconnect();
if (node2) {
resizeObserver == null ? void 0 : resizeObserver.observe(node2);
}
setRect(node2 ? measure2(node2) : null);
}, [measure2, resizeObserver]);
const [nodeRef, setRef3] = useNodeRef(handleNodeChange);
return reactExports.useMemo(() => ({
nodeRef,
rect: rect2,
setRef: setRef3
}), [rect2, nodeRef, setRef3]);
}
function useSensor(sensor, options2) {
return reactExports.useMemo(
() => ({
sensor,
options: options2 != null ? options2 : {}
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[sensor, options2]
);
}
function useSensors(...sensors) {
return reactExports.useMemo(
() => [...sensors].filter((sensor) => sensor != null),
// eslint-disable-next-line react-hooks/exhaustive-deps
[...sensors]
);
}
class Listeners {
constructor(target2) {
this.target = void 0;
this.listeners = [];
this.removeAll = () => {
this.listeners.forEach((listener2) => {
var _this$target;
return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener2);
});
};
this.target = target2;
}
add(eventName, handler, options2) {
var _this$target2;
(_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options2);
this.listeners.push([eventName, handler, options2]);
}
}
function getEventListenerTarget(target2) {
const {
EventTarget
} = getWindow(target2);
return target2 instanceof EventTarget ? target2 : getOwnerDocument(target2);
}
function hasExceededDistance(delta, measurement) {
const dx = Math.abs(delta.x);
const dy = Math.abs(delta.y);
if (typeof measurement === "number") {
return Math.sqrt(dx ** 2 + dy ** 2) > measurement;
}
if ("x" in measurement && "y" in measurement) {
return dx > measurement.x && dy > measurement.y;
}
if ("x" in measurement) {
return dx > measurement.x;
}
if ("y" in measurement) {
return dy > measurement.y;
}
return false;
}
var EventName;
(function(EventName2) {
EventName2["Click"] = "click";
EventName2["DragStart"] = "dragstart";
EventName2["Keydown"] = "keydown";
EventName2["ContextMenu"] = "contextmenu";
EventName2["Resize"] = "resize";
EventName2["SelectionChange"] = "selectionchange";
EventName2["VisibilityChange"] = "visibilitychange";
})(EventName || (EventName = {}));
function preventDefault(event2) {
event2.preventDefault();
}
function stopPropagation(event2) {
event2.stopPropagation();
}
var KeyboardCode;
(function(KeyboardCode2) {
KeyboardCode2["Space"] = "Space";
KeyboardCode2["Down"] = "ArrowDown";
KeyboardCode2["Right"] = "ArrowRight";
KeyboardCode2["Left"] = "ArrowLeft";
KeyboardCode2["Up"] = "ArrowUp";
KeyboardCode2["Esc"] = "Escape";
KeyboardCode2["Enter"] = "Enter";
})(KeyboardCode || (KeyboardCode = {}));
const defaultKeyboardCodes = {
start: [KeyboardCode.Space, KeyboardCode.Enter],
cancel: [KeyboardCode.Esc],
end: [KeyboardCode.Space, KeyboardCode.Enter]
};
const defaultKeyboardCoordinateGetter = (event2, {
currentCoordinates
}) => {
switch (event2.code) {
case KeyboardCode.Right:
return {
...currentCoordinates,
x: currentCoordinates.x + 25
};
case KeyboardCode.Left:
return {
...currentCoordinates,
x: currentCoordinates.x - 25
};
case KeyboardCode.Down:
return {
...currentCoordinates,
y: currentCoordinates.y + 25
};
case KeyboardCode.Up:
return {
...currentCoordinates,
y: currentCoordinates.y - 25
};
}
return void 0;
};
class KeyboardSensor {
constructor(props) {
this.props = void 0;
this.autoScrollEnabled = false;
this.coordinates = defaultCoordinates;
this.listeners = void 0;
this.windowListeners = void 0;
this.props = props;
const {
event: {
target: target2
}
} = props;
this.props = props;
this.listeners = new Listeners(getOwnerDocument(target2));
this.windowListeners = new Listeners(getWindow(target2));
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleCancel = this.handleCancel.bind(this);
this.attach();
}
attach() {
this.handleStart();
this.windowListeners.add(EventName.Resize, this.handleCancel);
this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown));
}
handleStart() {
const {
activeNode,
onStart
} = this.props;
if (!activeNode.node.current) {
throw new Error("Active draggable node is undefined");
}
const activeNodeRect = getTransformAgnosticClientRect(activeNode.node.current);
const coordinates = {
x: activeNodeRect.left,
y: activeNodeRect.top
};
this.coordinates = coordinates;
onStart(coordinates);
}
handleKeyDown(event2) {
if (isKeyboardEvent(event2)) {
const {
coordinates
} = this;
const {
active,
context: context2,
options: options2
} = this.props;
const {
keyboardCodes = defaultKeyboardCodes,
coordinateGetter = defaultKeyboardCoordinateGetter,
scrollBehavior = "smooth"
} = options2;
const {
code
} = event2;
if (keyboardCodes.end.includes(code)) {
this.handleEnd(event2);
return;
}
if (keyboardCodes.cancel.includes(code)) {
this.handleCancel(event2);
return;
}
const newCoordinates = coordinateGetter(event2, {
active,
context: context2.current,
currentCoordinates: coordinates
});
if (newCoordinates) {
const scrollDelta = {
x: 0,
y: 0
};
const {
scrollableAncestors
} = context2.current;
for (const scrollContainer of scrollableAncestors) {
const direction2 = event2.code;
const coordinatesDelta = subtract(newCoordinates, coordinates);
const {
isTop,
isRight,
isLeft,
isBottom,
maxScroll,
minScroll
} = getScrollPosition(scrollContainer);
const scrollElementRect = getScrollElementRect(scrollContainer);
const clampedCoordinates = {
x: Math.min(direction2 === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction2 === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)),
y: Math.min(direction2 === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction2 === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y))
};
const canScrollX = direction2 === KeyboardCode.Right && !isRight || direction2 === KeyboardCode.Left && !isLeft;
const canScrollY = direction2 === KeyboardCode.Down && !isBottom || direction2 === KeyboardCode.Up && !isTop;
if (canScrollX && clampedCoordinates.x !== newCoordinates.x) {
const canFullyScrollToNewCoordinates = direction2 === KeyboardCode.Right && scrollContainer.scrollLeft + coordinatesDelta.x <= maxScroll.x || direction2 === KeyboardCode.Left && scrollContainer.scrollLeft + coordinatesDelta.x >= minScroll.x;
if (canFullyScrollToNewCoordinates) {
scrollContainer.scrollBy({
left: coordinatesDelta.x,
behavior: scrollBehavior
});
return;
}
scrollDelta.x = direction2 === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x;
scrollContainer.scrollBy({
left: -scrollDelta.x,
behavior: scrollBehavior
});
break;
} else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) {
const canFullyScrollToNewCoordinates = direction2 === KeyboardCode.Down && scrollContainer.scrollTop + coordinatesDelta.y <= maxScroll.y || direction2 === KeyboardCode.Up && scrollContainer.scrollTop + coordinatesDelta.y >= minScroll.y;
if (canFullyScrollToNewCoordinates) {
scrollContainer.scrollBy({
top: coordinatesDelta.y,
behavior: scrollBehavior
});
return;
}
scrollDelta.y = direction2 === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y;
scrollContainer.scrollBy({
top: -scrollDelta.y,
behavior: scrollBehavior
});
break;
}
}
this.handleMove(event2, add$4(newCoordinates, scrollDelta));
}
}
}
handleMove(event2, coordinates) {
const {
onMove
} = this.props;
event2.preventDefault();
onMove(coordinates);
this.coordinates = coordinates;
}
handleEnd(event2) {
const {
onEnd
} = this.props;
event2.preventDefault();
this.detach();
onEnd();
}
handleCancel(event2) {
const {
onCancel
} = this.props;
event2.preventDefault();
this.detach();
onCancel();
}
detach() {
this.listeners.removeAll();
this.windowListeners.removeAll();
}
}
KeyboardSensor.activators = [{
eventName: "onKeyDown",
handler: (event2, {
keyboardCodes = defaultKeyboardCodes,
onActivation
}) => {
const {
code
} = event2.nativeEvent;
if (keyboardCodes.start.includes(code)) {
event2.preventDefault();
onActivation == null ? void 0 : onActivation({
event: event2.nativeEvent
});
return true;
}
return false;
}
}];
function isDistanceConstraint(constraint) {
return Boolean(constraint && "distance" in constraint);
}
function isDelayConstraint(constraint) {
return Boolean(constraint && "delay" in constraint);
}
class AbstractPointerSensor {
constructor(props, events2, listenerTarget = getEventListenerTarget(props.event.target)) {
var _getEventCoordinates;
this.props = void 0;
this.events = void 0;
this.autoScrollEnabled = true;
this.document = void 0;
this.activated = false;
this.initialCoordinates = void 0;
this.timeoutId = null;
this.listeners = void 0;
this.documentListeners = void 0;
this.windowListeners = void 0;
this.props = props;
this.events = events2;
const {
event: event2
} = props;
const {
target: target2
} = event2;
this.props = props;
this.events = events2;
this.document = getOwnerDocument(target2);
this.documentListeners = new Listeners(this.document);
this.listeners = new Listeners(listenerTarget);
this.windowListeners = new Listeners(getWindow(target2));
this.initialCoordinates = (_getEventCoordinates = getEventCoordinates(event2)) != null ? _getEventCoordinates : defaultCoordinates;
this.handleStart = this.handleStart.bind(this);
this.handleMove = this.handleMove.bind(this);
this.handleEnd = this.handleEnd.bind(this);
this.handleCancel = this.handleCancel.bind(this);
this.handleKeydown = this.handleKeydown.bind(this);
this.removeTextSelection = this.removeTextSelection.bind(this);
this.attach();
}
attach() {
const {
events: events2,
props: {
options: {
activationConstraint
}
}
} = this;
this.listeners.add(events2.move.name, this.handleMove, {
passive: false
});
this.listeners.add(events2.end.name, this.handleEnd);
this.windowListeners.add(EventName.Resize, this.handleCancel);
this.windowListeners.add(EventName.DragStart, preventDefault);
this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
this.windowListeners.add(EventName.ContextMenu, preventDefault);
this.documentListeners.add(EventName.Keydown, this.handleKeydown);
if (activationConstraint) {
if (isDistanceConstraint(activationConstraint)) {
return;
}
if (isDelayConstraint(activationConstraint)) {
this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay);
return;
}
}
this.handleStart();
}
detach() {
this.listeners.removeAll();
this.windowListeners.removeAll();
setTimeout(this.documentListeners.removeAll, 50);
if (this.timeoutId !== null) {
clearTimeout(this.timeoutId);
this.timeoutId = null;
}
}
handleStart() {
const {
initialCoordinates
} = this;
const {
onStart
} = this.props;
if (initialCoordinates) {
this.activated = true;
this.documentListeners.add(EventName.Click, stopPropagation, {
capture: true
});
this.removeTextSelection();
this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection);
onStart(initialCoordinates);
}
}
handleMove(event2) {
var _getEventCoordinates2;
const {
activated,
initialCoordinates,
props
} = this;
const {
onMove,
options: {
activationConstraint
}
} = props;
if (!initialCoordinates) {
return;
}
const coordinates = (_getEventCoordinates2 = getEventCoordinates(event2)) != null ? _getEventCoordinates2 : defaultCoordinates;
const delta = subtract(initialCoordinates, coordinates);
if (!activated && activationConstraint) {
if (isDelayConstraint(activationConstraint)) {
if (hasExceededDistance(delta, activationConstraint.tolerance)) {
return this.handleCancel();
}
return;
}
if (isDistanceConstraint(activationConstraint)) {
if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) {
return this.handleCancel();
}
if (hasExceededDistance(delta, activationConstraint.distance)) {
return this.handleStart();
}
return;
}
}
if (event2.cancelable) {
event2.preventDefault();
}
onMove(coordinates);
}
handleEnd() {
const {
onEnd
} = this.props;
this.detach();
onEnd();
}
handleCancel() {
const {
onCancel
} = this.props;
this.detach();
onCancel();
}
handleKeydown(event2) {
if (event2.code === KeyboardCode.Esc) {
this.handleCancel();
}
}
removeTextSelection() {
var _this$document$getSel;
(_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges();
}
}
const events$3 = {
move: {
name: "pointermove"
},
end: {
name: "pointerup"
}
};
class PointerSensor extends AbstractPointerSensor {
constructor(props) {
const {
event: event2
} = props;
const listenerTarget = getOwnerDocument(event2.target);
super(props, events$3, listenerTarget);
}
}
PointerSensor.activators = [{
eventName: "onPointerDown",
handler: ({
nativeEvent: event2
}, {
onActivation
}) => {
if (!event2.isPrimary || event2.button !== 0) {
return false;
}
onActivation == null ? void 0 : onActivation({
event: event2
});
return true;
}
}];
const events$1$1 = {
move: {
name: "mousemove"
},
end: {
name: "mouseup"
}
};
var MouseButton;
(function(MouseButton2) {
MouseButton2[MouseButton2["RightClick"] = 2] = "RightClick";
})(MouseButton || (MouseButton = {}));
class MouseSensor extends AbstractPointerSensor {
constructor(props) {
super(props, events$1$1, getOwnerDocument(props.event.target));
}
}
MouseSensor.activators = [{
eventName: "onMouseDown",
handler: ({
nativeEvent: event2
}, {
onActivation
}) => {
if (event2.button === MouseButton.RightClick) {
return false;
}
onActivation == null ? void 0 : onActivation({
event: event2
});
return true;
}
}];
const events$2$1 = {
move: {
name: "touchmove"
},
end: {
name: "touchend"
}
};
class TouchSensor extends AbstractPointerSensor {
constructor(props) {
super(props, events$2$1);
}
static setup() {
window.addEventListener(events$2$1.move.name, noop3, {
capture: false,
passive: false
});
return function teardown() {
window.removeEventListener(events$2$1.move.name, noop3);
};
function noop3() {
}
}
}
TouchSensor.activators = [{
eventName: "onTouchStart",
handler: ({
nativeEvent: event2
}, {
onActivation
}) => {
const {
touches
} = event2;
if (touches.length > 1) {
return false;
}
onActivation == null ? void 0 : onActivation({
event: event2
});
return true;
}
}];
function applyModifiers(modifiers, {
transform: transform2,
...args
}) {
return (modifiers == null ? void 0 : modifiers.length) ? modifiers.reduce((accumulator, modifier) => {
return modifier({
transform: accumulator,
...args
});
}, transform2) : transform2;
}
const defaultSensors = [{
sensor: PointerSensor,
options: {}
}, {
sensor: KeyboardSensor,
options: {}
}];
const defaultData = {
current: {}
};
const ActiveDraggableContext = /* @__PURE__ */ reactExports.createContext({
...defaultCoordinates,
scaleX: 1,
scaleY: 1
});
const DndContext = /* @__PURE__ */ reactExports.memo(function DndContext2({
id,
autoScroll = true,
announcements,
children: children2,
sensors = defaultSensors,
collisionDetection = rectIntersection,
measuring,
modifiers,
screenReaderInstructions: screenReaderInstructions$1 = screenReaderInstructions,
...props
}) {
var _measuring$draggable$, _measuring$draggable, _sensorContext$curren, _measuring$dragOverla, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect;
const store = reactExports.useReducer(reducer$1, void 0, getInitialState);
const [state, dispatch2] = store;
const [monitorState, setMonitorState] = reactExports.useState(() => ({
type: null,
event: null
}));
const [isDragging, setIsDragging] = reactExports.useState(false);
const {
draggable: {
active: activeId,
nodes: draggableNodes,
translate: translate2
},
droppable: {
containers: droppableContainers
}
} = state;
const node2 = activeId ? draggableNodes[activeId] : null;
const activeRects = reactExports.useRef({
initial: null,
translated: null
});
const active = reactExports.useMemo(() => {
var _node$data;
return activeId != null ? {
id: activeId,
// It's possible for the active node to unmount while dragging
data: (_node$data = node2 == null ? void 0 : node2.data) != null ? _node$data : defaultData,
rect: activeRects
} : null;
}, [activeId, node2]);
const activeRef = reactExports.useRef(null);
const [activeSensor, setActiveSensor] = reactExports.useState(null);
const [activatorEvent, setActivatorEvent] = reactExports.useState(null);
const latestProps = useLatestValue(props, Object.values(props));
const draggableDescribedById = useUniqueId(`DndDescribedBy`, id);
const enabledDroppableContainers = reactExports.useMemo(() => droppableContainers.getEnabled(), [droppableContainers]);
const {
droppableRects,
measureDroppableContainers,
measuringScheduled
} = useDroppableMeasuring(enabledDroppableContainers, {
dragging: isDragging,
dependencies: [translate2.x, translate2.y],
config: measuring == null ? void 0 : measuring.droppable
});
const activeNode = useCachedNode(draggableNodes, activeId);
const activationCoordinates = activatorEvent ? getEventCoordinates(activatorEvent) : null;
const activeNodeRect = useRect(activeNode, (_measuring$draggable$ = measuring == null ? void 0 : (_measuring$draggable = measuring.draggable) == null ? void 0 : _measuring$draggable.measure) != null ? _measuring$draggable$ : getTransformAgnosticClientRect);
const containerNodeRect = useClientRect(activeNode ? activeNode.parentElement : null);
const sensorContext = reactExports.useRef({
active: null,
activeNode,
collisionRect: null,
collisions: null,
droppableRects,
draggableNodes,
draggingNode: null,
draggingNodeRect: null,
droppableContainers,
over: null,
scrollableAncestors: [],
scrollAdjustedTranslate: null
});
const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id);
const dragOverlay = useDragOverlayMeasuring({
measure: measuring == null ? void 0 : (_measuring$dragOverla = measuring.dragOverlay) == null ? void 0 : _measuring$dragOverla.measure
});
const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode;
const draggingNodeRect = (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect;
const initialActiveNodeRectRef = reactExports.useRef(null);
const initialActiveNodeRect = initialActiveNodeRectRef.current;
const nodeRectDelta = draggingNodeRect === activeNodeRect ? getRectDelta(activeNodeRect, initialActiveNodeRect) : defaultCoordinates;
const windowRect = useWindowRect(draggingNode ? draggingNode.ownerDocument.defaultView : null);
const scrollableAncestors = useScrollableAncestors(activeId ? overNode != null ? overNode : draggingNode : null);
const scrollableAncestorRects = useClientRects(scrollableAncestors);
const modifiedTranslate = applyModifiers(modifiers, {
transform: {
x: translate2.x - nodeRectDelta.x,
y: translate2.y - nodeRectDelta.y,
scaleX: 1,
scaleY: 1
},
activatorEvent,
active,
activeNodeRect,
containerNodeRect,
draggingNodeRect,
over: sensorContext.current.over,
overlayNodeRect: dragOverlay.rect,
scrollableAncestors,
scrollableAncestorRects,
windowRect
});
const pointerCoordinates = activationCoordinates ? add$4(activationCoordinates, translate2) : null;
const scrollAdjustment = useScrollOffsets(scrollableAncestors);
const scrollAdjustedTranslate = add$4(modifiedTranslate, scrollAdjustment);
const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null;
const collisions = active && collisionRect ? collisionDetection({
active,
collisionRect,
droppableContainers: enabledDroppableContainers,
pointerCoordinates
}) : null;
const overId = getFirstCollision(collisions, "id");
const [over, setOver] = reactExports.useState(null);
const transform2 = adjustScale(modifiedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect);
const instantiateSensor = reactExports.useCallback(
(event2, {
sensor: Sensor,
options: options2
}) => {
if (!activeRef.current) {
return;
}
const activeNode2 = draggableNodes[activeRef.current];
if (!activeNode2) {
return;
}
const sensorInstance = new Sensor({
active: activeRef.current,
activeNode: activeNode2,
event: event2.nativeEvent,
options: options2,
// Sensors need to be instantiated with refs for arguments that change over time
// otherwise they are frozen in time with the stale arguments
context: sensorContext,
onStart(initialCoordinates) {
const id2 = activeRef.current;
if (!id2) {
return;
}
const node3 = draggableNodes[id2];
if (!node3) {
return;
}
const {
onDragStart
} = latestProps.current;
const event3 = {
active: {
id: id2,
data: node3.data,
rect: activeRects
}
};
reactDomExports.unstable_batchedUpdates(() => {
dispatch2({
type: Action.DragStart,
initialCoordinates,
active: id2
});
setMonitorState({
type: Action.DragStart,
event: event3
});
});
onDragStart == null ? void 0 : onDragStart(event3);
},
onMove(coordinates) {
dispatch2({
type: Action.DragMove,
coordinates
});
},
onEnd: createHandler(Action.DragEnd),
onCancel: createHandler(Action.DragCancel)
});
reactDomExports.unstable_batchedUpdates(() => {
setActiveSensor(sensorInstance);
setActivatorEvent(event2.nativeEvent);
});
function createHandler(type2) {
return async function handler() {
const {
active: active2,
collisions: collisions2,
over: over2,
scrollAdjustedTranslate: scrollAdjustedTranslate2
} = sensorContext.current;
let event3 = null;
if (active2 && scrollAdjustedTranslate2) {
const {
cancelDrop
} = latestProps.current;
event3 = {
active: active2,
collisions: collisions2,
delta: scrollAdjustedTranslate2,
over: over2
};
if (type2 === Action.DragEnd && typeof cancelDrop === "function") {
const shouldCancel = await Promise.resolve(cancelDrop(event3));
if (shouldCancel) {
type2 = Action.DragCancel;
}
}
}
activeRef.current = null;
reactDomExports.unstable_batchedUpdates(() => {
dispatch2({
type: type2
});
setOver(null);
setIsDragging(false);
setActiveSensor(null);
setActivatorEvent(null);
if (event3) {
setMonitorState({
type: type2,
event: event3
});
}
if (event3) {
const {
onDragCancel,
onDragEnd
} = latestProps.current;
const handler2 = type2 === Action.DragEnd ? onDragEnd : onDragCancel;
handler2 == null ? void 0 : handler2(event3);
}
});
};
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[draggableNodes]
);
const bindActivatorToSensorInstantiator = reactExports.useCallback((handler, sensor) => {
return (event2, active2) => {
const nativeEvent = event2.nativeEvent;
if (
// No active draggable
activeRef.current !== null || // Event has already been captured
nativeEvent.dndKit || nativeEvent.defaultPrevented
) {
return;
}
if (handler(event2, sensor.options) === true) {
nativeEvent.dndKit = {
capturedBy: sensor.sensor
};
activeRef.current = active2;
instantiateSensor(event2, sensor);
}
};
}, [instantiateSensor]);
const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
useSensorSetup(sensors);
reactExports.useEffect(() => {
if (activeId != null) {
setIsDragging(true);
}
}, [activeId]);
reactExports.useEffect(() => {
if (!active) {
initialActiveNodeRectRef.current = null;
}
if (active && activeNodeRect && !initialActiveNodeRectRef.current) {
initialActiveNodeRectRef.current = activeNodeRect;
}
}, [activeNodeRect, active]);
reactExports.useEffect(
() => {
const {
onDragMove
} = latestProps.current;
const {
active: active2,
collisions: collisions2,
over: over2
} = sensorContext.current;
if (!active2) {
return;
}
const event2 = {
active: active2,
collisions: collisions2,
delta: {
x: scrollAdjustedTranslate.x,
y: scrollAdjustedTranslate.y
},
over: over2
};
setMonitorState({
type: Action.DragMove,
event: event2
});
onDragMove == null ? void 0 : onDragMove(event2);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]
);
reactExports.useEffect(
() => {
const {
active: active2,
collisions: collisions2,
droppableContainers: droppableContainers2,
scrollAdjustedTranslate: scrollAdjustedTranslate2
} = sensorContext.current;
if (!active2 || !activeRef.current || !scrollAdjustedTranslate2) {
return;
}
const {
onDragOver
} = latestProps.current;
const overContainer = droppableContainers2.get(overId);
const over2 = overContainer && overContainer.rect.current ? {
id: overContainer.id,
rect: overContainer.rect.current,
data: overContainer.data,
disabled: overContainer.disabled
} : null;
const event2 = {
active: active2,
collisions: collisions2,
delta: {
x: scrollAdjustedTranslate2.x,
y: scrollAdjustedTranslate2.y
},
over: over2
};
reactDomExports.unstable_batchedUpdates(() => {
setOver(over2);
setMonitorState({
type: Action.DragOver,
event: event2
});
onDragOver == null ? void 0 : onDragOver(event2);
});
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[overId]
);
useIsomorphicLayoutEffect(() => {
sensorContext.current = {
active,
activeNode,
collisionRect,
collisions,
droppableRects,
draggableNodes,
draggingNode,
draggingNodeRect,
droppableContainers,
over,
scrollableAncestors,
scrollAdjustedTranslate
};
activeRects.current = {
initial: draggingNodeRect,
translated: collisionRect
};
}, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]);
useAutoScroller({
...getAutoScrollerOptions(),
draggingRect: collisionRect,
pointerCoordinates,
scrollableAncestors,
scrollableAncestorRects
});
const publicContext = reactExports.useMemo(() => {
const context2 = {
active,
activeNode,
activeNodeRect,
activatorEvent,
collisions,
containerNodeRect,
dragOverlay,
draggableNodes,
droppableContainers,
droppableRects,
over,
measureDroppableContainers,
scrollableAncestors,
scrollableAncestorRects,
measuringScheduled,
windowRect
};
return context2;
}, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringScheduled, windowRect]);
const internalContext = reactExports.useMemo(() => {
const context2 = {
activatorEvent,
activators,
active,
activeNodeRect,
ariaDescribedById: {
draggable: draggableDescribedById
},
dispatch: dispatch2,
draggableNodes,
over,
measureDroppableContainers
};
return context2;
}, [activatorEvent, activators, active, activeNodeRect, dispatch2, draggableDescribedById, draggableNodes, over, measureDroppableContainers]);
return React.createElement(DndMonitorContext.Provider, {
value: monitorState
}, React.createElement(InternalContext.Provider, {
value: internalContext
}, React.createElement(PublicContext.Provider, {
value: publicContext
}, React.createElement(ActiveDraggableContext.Provider, {
value: transform2
}, children2))), React.createElement(Accessibility, {
announcements,
hiddenTextDescribedById: draggableDescribedById,
screenReaderInstructions: screenReaderInstructions$1
}));
function getAutoScrollerOptions() {
const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false;
const autoScrollGloballyDisabled = typeof autoScroll === "object" ? autoScroll.enabled === false : autoScroll === false;
const enabled = !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled;
if (typeof autoScroll === "object") {
return {
...autoScroll,
enabled
};
}
return {
enabled
};
}
});
const NullContext = /* @__PURE__ */ reactExports.createContext(null);
const defaultRole = "button";
const ID_PREFIX$1 = "Droppable";
function useDraggable({
id,
data: data2,
disabled = false,
attributes
}) {
const key2 = useUniqueId(ID_PREFIX$1);
const {
activators,
activatorEvent,
active,
activeNodeRect,
ariaDescribedById,
draggableNodes,
over
} = reactExports.useContext(InternalContext);
const {
role = defaultRole,
roleDescription = "draggable",
tabIndex = 0
} = attributes != null ? attributes : {};
const isDragging = (active == null ? void 0 : active.id) === id;
const transform2 = reactExports.useContext(isDragging ? ActiveDraggableContext : NullContext);
const [node2, setNodeRef] = useNodeRef();
const listeners = useSyntheticListeners(activators, id);
const dataRef = useLatestValue(data2);
useIsomorphicLayoutEffect(
() => {
draggableNodes[id] = {
id,
key: key2,
node: node2,
data: dataRef
};
return () => {
const node3 = draggableNodes[id];
if (node3 && node3.key === key2) {
delete draggableNodes[id];
}
};
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[draggableNodes, id]
);
const memoizedAttributes = reactExports.useMemo(() => ({
role,
tabIndex,
"aria-pressed": isDragging && role === defaultRole ? true : void 0,
"aria-roledescription": roleDescription,
"aria-describedby": ariaDescribedById.draggable
}), [role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]);
return {
active,
activatorEvent,
activeNodeRect,
attributes: memoizedAttributes,
isDragging,
listeners: disabled ? void 0 : listeners,
node: node2,
over,
setNodeRef,
transform: transform2
};
}
function useDndContext() {
return reactExports.useContext(PublicContext);
}
const ID_PREFIX$1$1 = "Droppable";
const defaultResizeObserverConfig = {
timeout: 25
};
function useDroppable({
data: data2,
disabled = false,
id,
resizeObserverConfig
}) {
const key2 = useUniqueId(ID_PREFIX$1$1);
const {
active,
dispatch: dispatch2,
over,
measureDroppableContainers
} = reactExports.useContext(InternalContext);
const resizeObserverConnected = reactExports.useRef(false);
const rect2 = reactExports.useRef(null);
const callbackId = reactExports.useRef(null);
const {
disabled: resizeObserverDisabled,
updateMeasurementsFor,
timeout: resizeObserverTimeout
} = {
...defaultResizeObserverConfig,
...resizeObserverConfig
};
const ids2 = useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id);
const handleResize = reactExports.useCallback(
() => {
if (!resizeObserverConnected.current) {
resizeObserverConnected.current = true;
return;
}
if (callbackId.current != null) {
clearTimeout(callbackId.current);
}
callbackId.current = setTimeout(() => {
measureDroppableContainers(typeof ids2.current === "string" ? [ids2.current] : ids2.current);
callbackId.current = null;
}, resizeObserverTimeout);
},
//eslint-disable-next-line react-hooks/exhaustive-deps
[resizeObserverTimeout]
);
const resizeObserver = useResizeObserver({
onResize: handleResize,
disabled: resizeObserverDisabled || !active
});
const handleNodeChange = reactExports.useCallback((newElement, previousElement) => {
if (!resizeObserver) {
return;
}
if (previousElement) {
resizeObserver.unobserve(previousElement);
resizeObserverConnected.current = false;
}
if (newElement) {
resizeObserver.observe(newElement);
}
}, [resizeObserver]);
const [nodeRef, setNodeRef] = useNodeRef(handleNodeChange);
const dataRef = useLatestValue(data2);
reactExports.useEffect(() => {
if (!resizeObserver || !nodeRef.current) {
return;
}
resizeObserver.disconnect();
resizeObserverConnected.current = false;
resizeObserver.observe(nodeRef.current);
}, [nodeRef, resizeObserver]);
useIsomorphicLayoutEffect(
() => {
dispatch2({
type: Action.RegisterDroppable,
element: {
id,
key: key2,
disabled,
node: nodeRef,
rect: rect2,
data: dataRef
}
});
return () => dispatch2({
type: Action.UnregisterDroppable,
key: key2,
id
});
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[id]
);
reactExports.useEffect(
() => {
dispatch2({
type: Action.SetDroppableDisabled,
id,
key: key2,
disabled
});
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[disabled]
);
return {
active,
rect: rect2,
isOver: (over == null ? void 0 : over.id) === id,
node: nodeRef,
over,
setNodeRef
};
}
const defaultDropAnimation = {
duration: 250,
easing: "ease",
dragSourceOpacity: 0
};
function useDropAnimation({
animate,
adjustScale: adjustScale2,
activeId,
draggableNodes,
duration: duration2,
dragSourceOpacity,
easing,
node: node2,
transform: transform2
}) {
const [dropAnimationComplete, setDropAnimationComplete] = reactExports.useState(false);
useIsomorphicLayoutEffect(() => {
var _draggableNodes$activ;
if (!animate || !activeId || !easing || !duration2) {
if (animate) {
setDropAnimationComplete(true);
}
return;
}
const finalNode = (_draggableNodes$activ = draggableNodes[activeId]) == null ? void 0 : _draggableNodes$activ.node.current;
if (transform2 && node2 && finalNode && finalNode.parentNode !== null) {
const fromNode = getMeasurableNode(node2);
if (fromNode) {
const from2 = fromNode.getBoundingClientRect();
const to2 = getTransformAgnosticClientRect(finalNode);
const delta = {
x: from2.left - to2.left,
y: from2.top - to2.top
};
if (Math.abs(delta.x) || Math.abs(delta.y)) {
const scaleDelta = {
scaleX: adjustScale2 ? to2.width * transform2.scaleX / from2.width : 1,
scaleY: adjustScale2 ? to2.height * transform2.scaleY / from2.height : 1
};
const finalTransform = CSS$1.Transform.toString({
x: transform2.x - delta.x,
y: transform2.y - delta.y,
...scaleDelta
});
const originalOpacity = finalNode.style.opacity;
if (dragSourceOpacity != null) {
finalNode.style.opacity = `${dragSourceOpacity}`;
}
const nodeAnimation = node2.animate([{
transform: CSS$1.Transform.toString(transform2)
}, {
transform: finalTransform
}], {
easing,
duration: duration2
});
nodeAnimation.onfinish = () => {
node2.style.display = "none";
setDropAnimationComplete(true);
if (finalNode && dragSourceOpacity != null) {
finalNode.style.opacity = originalOpacity;
}
};
return;
}
}
}
setDropAnimationComplete(true);
}, [animate, activeId, adjustScale2, draggableNodes, duration2, easing, dragSourceOpacity, node2, transform2]);
useIsomorphicLayoutEffect(() => {
if (dropAnimationComplete) {
setDropAnimationComplete(false);
}
}, [dropAnimationComplete]);
return dropAnimationComplete;
}
const defaultTransform = {
x: 0,
y: 0,
scaleX: 1,
scaleY: 1
};
const defaultTransition$1 = (activatorEvent) => {
const isKeyboardActivator = isKeyboardEvent(activatorEvent);
return isKeyboardActivator ? "transform 250ms ease" : void 0;
};
const DragOverlay = /* @__PURE__ */ React.memo(({
adjustScale: adjustScale2 = false,
children: children2,
dropAnimation = defaultDropAnimation,
style: styleProp,
transition = defaultTransition$1,
modifiers,
wrapperElement = "div",
className,
zIndex: zIndex2 = 999
}) => {
var _active$id, _attributesSnapshot$c;
const {
active,
activeNodeRect,
containerNodeRect,
draggableNodes,
activatorEvent,
over,
dragOverlay,
scrollableAncestors,
scrollableAncestorRects,
windowRect
} = useDndContext();
const transform2 = reactExports.useContext(ActiveDraggableContext);
const modifiedTransform = applyModifiers(modifiers, {
activatorEvent,
active,
activeNodeRect,
containerNodeRect,
draggingNodeRect: dragOverlay.rect,
over,
overlayNodeRect: dragOverlay.rect,
scrollableAncestors,
scrollableAncestorRects,
transform: transform2,
windowRect
});
const isDragging = active !== null;
const finalTransform = adjustScale2 ? modifiedTransform : {
...modifiedTransform,
scaleX: 1,
scaleY: 1
};
const initialRect = useLazyMemo((previousValue) => {
if (isDragging) {
if (previousValue) {
return previousValue;
}
if (!activeNodeRect) {
return null;
}
return {
...activeNodeRect
};
}
return null;
}, [isDragging, activeNodeRect]);
const style2 = initialRect ? {
position: "fixed",
width: initialRect.width,
height: initialRect.height,
top: initialRect.top,
left: initialRect.left,
zIndex: zIndex2,
transform: CSS$1.Transform.toString(finalTransform),
touchAction: "none",
transformOrigin: adjustScale2 && activatorEvent ? getRelativeTransformOrigin(activatorEvent, initialRect) : void 0,
transition: typeof transition === "function" ? transition(activatorEvent) : transition,
...styleProp
} : void 0;
const attributes = isDragging ? {
style: style2,
children: children2,
className,
transform: finalTransform
} : void 0;
const attributesSnapshot = reactExports.useRef(attributes);
const derivedAttributes = attributes != null ? attributes : attributesSnapshot.current;
const {
children: finalChildren,
transform: _24,
...otherAttributes
} = derivedAttributes != null ? derivedAttributes : {};
const prevActiveId = reactExports.useRef((_active$id = active == null ? void 0 : active.id) != null ? _active$id : null);
const dropAnimationComplete = useDropAnimation({
animate: Boolean(dropAnimation && prevActiveId.current && !active),
adjustScale: adjustScale2,
activeId: prevActiveId.current,
draggableNodes,
duration: dropAnimation == null ? void 0 : dropAnimation.duration,
easing: dropAnimation == null ? void 0 : dropAnimation.easing,
dragSourceOpacity: dropAnimation == null ? void 0 : dropAnimation.dragSourceOpacity,
node: dragOverlay.nodeRef.current,
transform: (_attributesSnapshot$c = attributesSnapshot.current) == null ? void 0 : _attributesSnapshot$c.transform
});
const shouldRender = Boolean(finalChildren && (children2 || dropAnimation && !dropAnimationComplete));
reactExports.useEffect(() => {
if ((active == null ? void 0 : active.id) !== prevActiveId.current) {
var _active$id2;
prevActiveId.current = (_active$id2 = active == null ? void 0 : active.id) != null ? _active$id2 : null;
}
if (active && attributesSnapshot.current !== attributes) {
attributesSnapshot.current = attributes;
}
}, [active, attributes]);
reactExports.useEffect(() => {
if (dropAnimationComplete) {
attributesSnapshot.current = void 0;
}
}, [dropAnimationComplete]);
if (!shouldRender) {
return null;
}
return React.createElement(InternalContext.Provider, {
value: defaultInternalContext
}, React.createElement(ActiveDraggableContext.Provider, {
value: defaultTransform
}, React.createElement(wrapperElement, {
...otherAttributes,
ref: dragOverlay.setRef
}, finalChildren)));
});
const core_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
get AutoScrollActivator() {
return AutoScrollActivator;
},
DndContext,
DragOverlay,
get KeyboardCode() {
return KeyboardCode;
},
KeyboardSensor,
get MeasuringFrequency() {
return MeasuringFrequency;
},
get MeasuringStrategy() {
return MeasuringStrategy;
},
MouseSensor,
PointerSensor,
TouchSensor,
get TraversalOrder() {
return TraversalOrder;
},
applyModifiers,
closestCenter,
closestCorners,
defaultAnnouncements,
defaultCoordinates,
defaultDropAnimation,
getClientRect,
getFirstCollision,
getScrollableAncestors,
pointerWithin,
rectIntersection,
useDndContext,
useDndMonitor,
useDraggable,
useDroppable,
useSensor,
useSensors
}, Symbol.toStringTag, { value: "Module" }));
const require$$14$1 = /* @__PURE__ */ getAugmentedNamespace(core_esm);
function arrayMove$1(array2, from2, to2) {
const newArray = array2.slice();
newArray.splice(to2 < 0 ? newArray.length + to2 : to2, 0, newArray.splice(from2, 1)[0]);
return newArray;
}
function arraySwap(array2, from2, to2) {
const newArray = array2.slice();
newArray[from2] = array2[to2];
newArray[to2] = array2[from2];
return newArray;
}
function getSortedRects(items, rects) {
return items.reduce((accumulator, id, index2) => {
const rect2 = rects.get(id);
if (rect2) {
accumulator[index2] = rect2;
}
return accumulator;
}, Array(items.length));
}
function isValidIndex(index2) {
return index2 !== null && index2 >= 0;
}
const defaultScale = {
scaleX: 1,
scaleY: 1
};
const horizontalListSortingStrategy = ({
rects,
activeNodeRect: fallbackActiveRect,
activeIndex,
overIndex,
index: index2
}) => {
var _rects$activeIndex;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
const itemGap = getItemGap(rects, index2, activeIndex);
if (index2 === activeIndex) {
const newIndexRect = rects[overIndex];
if (!newIndexRect) {
return null;
}
return {
x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
y: 0,
...defaultScale
};
}
if (index2 > activeIndex && index2 <= overIndex) {
return {
x: -activeNodeRect.width - itemGap,
y: 0,
...defaultScale
};
}
if (index2 < activeIndex && index2 >= overIndex) {
return {
x: activeNodeRect.width + itemGap,
y: 0,
...defaultScale
};
}
return {
x: 0,
y: 0,
...defaultScale
};
};
function getItemGap(rects, index2, activeIndex) {
const currentRect = rects[index2];
const previousRect = rects[index2 - 1];
const nextRect = rects[index2 + 1];
if (!currentRect || !previousRect && !nextRect) {
return 0;
}
if (activeIndex < index2) {
return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
}
return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
}
const rectSortingStrategy = ({
rects,
activeIndex,
overIndex,
index: index2
}) => {
const newRects = arrayMove$1(rects, overIndex, activeIndex);
const oldRect = rects[index2];
const newRect = newRects[index2];
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
const rectSwappingStrategy = ({
activeIndex,
index: index2,
rects,
overIndex
}) => {
let oldRect;
let newRect;
if (index2 === activeIndex) {
oldRect = rects[index2];
newRect = rects[overIndex];
}
if (index2 === overIndex) {
oldRect = rects[index2];
newRect = rects[activeIndex];
}
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
const defaultScale$1 = {
scaleX: 1,
scaleY: 1
};
const verticalListSortingStrategy = ({
activeIndex,
activeNodeRect: fallbackActiveRect,
index: index2,
rects,
overIndex
}) => {
var _rects$activeIndex;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
if (index2 === activeIndex) {
const overIndexRect = rects[overIndex];
if (!overIndexRect) {
return null;
}
return {
x: 0,
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
...defaultScale$1
};
}
const itemGap = getItemGap$1(rects, index2, activeIndex);
if (index2 > activeIndex && index2 <= overIndex) {
return {
x: 0,
y: -activeNodeRect.height - itemGap,
...defaultScale$1
};
}
if (index2 < activeIndex && index2 >= overIndex) {
return {
x: 0,
y: activeNodeRect.height + itemGap,
...defaultScale$1
};
}
return {
x: 0,
y: 0,
...defaultScale$1
};
};
function getItemGap$1(clientRects, index2, activeIndex) {
const currentRect = clientRects[index2];
const previousRect = clientRects[index2 - 1];
const nextRect = clientRects[index2 + 1];
if (!currentRect) {
return 0;
}
if (activeIndex < index2) {
return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
}
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
}
const ID_PREFIX = "Sortable";
const Context$2 = /* @__PURE__ */ React.createContext({
activeIndex: -1,
containerId: ID_PREFIX,
disableTransforms: false,
items: [],
overIndex: -1,
useDragOverlay: false,
sortedRects: [],
strategy: rectSortingStrategy
});
function SortableContext$1({
children: children2,
id,
items: userDefinedItems,
strategy = rectSortingStrategy
}) {
const {
active,
dragOverlay,
droppableRects,
over,
measureDroppableContainers,
measuringScheduled
} = useDndContext();
const containerId = useUniqueId(ID_PREFIX, id);
const useDragOverlay = Boolean(dragOverlay.rect !== null);
const items = reactExports.useMemo(() => userDefinedItems.map((item) => typeof item === "string" ? item : item.id), [userDefinedItems]);
const isDragging = active != null;
const activeIndex = active ? items.indexOf(active.id) : -1;
const overIndex = over ? items.indexOf(over.id) : -1;
const previousItemsRef = reactExports.useRef(items);
const itemsHaveChanged = !isEqual2(items, previousItemsRef.current);
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
useIsomorphicLayoutEffect(() => {
if (itemsHaveChanged && isDragging && !measuringScheduled) {
measureDroppableContainers(items);
}
}, [itemsHaveChanged, items, isDragging, measureDroppableContainers, measuringScheduled]);
reactExports.useEffect(() => {
previousItemsRef.current = items;
}, [items]);
const contextValue = reactExports.useMemo(() => ({
activeIndex,
containerId,
disableTransforms,
items,
overIndex,
useDragOverlay,
sortedRects: getSortedRects(items, droppableRects),
strategy
}), [activeIndex, containerId, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);
return React.createElement(Context$2.Provider, {
value: contextValue
}, children2);
}
function isEqual2(arr1, arr2) {
return arr1.join() === arr2.join();
}
const defaultNewIndexGetter = ({
id,
items,
activeIndex,
overIndex
}) => arrayMove$1(items, activeIndex, overIndex).indexOf(id);
const defaultAnimateLayoutChanges = ({
containerId,
isSorting,
wasDragging,
index: index2,
items,
newIndex,
previousItems,
previousContainerId,
transition
}) => {
if (!transition || !wasDragging) {
return false;
}
if (previousItems !== items && index2 === newIndex) {
return false;
}
if (isSorting) {
return true;
}
return newIndex !== index2 && containerId === previousContainerId;
};
const defaultTransition = {
duration: 200,
easing: "ease"
};
const transitionProperty = "transform";
const disabledTransition = /* @__PURE__ */ CSS$1.Transition.toString({
property: transitionProperty,
duration: 0,
easing: "linear"
});
const defaultAttributes = {
roleDescription: "sortable"
};
function useDerivedTransform({
disabled,
index: index2,
node: node2,
rect: rect2
}) {
const [derivedTransform, setDerivedtransform] = reactExports.useState(null);
const previousIndex = reactExports.useRef(index2);
useIsomorphicLayoutEffect(() => {
if (!disabled && index2 !== previousIndex.current && node2.current) {
const initial = rect2.current;
if (initial) {
const current = getClientRect(node2.current, {
ignoreTransform: true
});
const delta = {
x: initial.left - current.left,
y: initial.top - current.top,
scaleX: initial.width / current.width,
scaleY: initial.height / current.height
};
if (delta.x || delta.y) {
setDerivedtransform(delta);
}
}
}
if (index2 !== previousIndex.current) {
previousIndex.current = index2;
}
}, [disabled, index2, node2, rect2]);
reactExports.useEffect(() => {
if (derivedTransform) {
requestAnimationFrame(() => {
setDerivedtransform(null);
});
}
}, [derivedTransform]);
return derivedTransform;
}
function useSortable({
animateLayoutChanges = defaultAnimateLayoutChanges,
attributes: userDefinedAttributes,
disabled,
data: customData,
getNewIndex = defaultNewIndexGetter,
id,
strategy: localStrategy,
resizeObserverConfig,
transition = defaultTransition
}) {
const {
items,
containerId,
activeIndex,
disableTransforms,
sortedRects,
overIndex,
useDragOverlay,
strategy: globalStrategy
} = reactExports.useContext(Context$2);
const index2 = items.indexOf(id);
const data2 = reactExports.useMemo(() => ({
sortable: {
containerId,
index: index2,
items
},
...customData
}), [containerId, customData, index2, items]);
const itemsAfterCurrentSortable = reactExports.useMemo(() => items.slice(items.indexOf(id)), [items, id]);
const {
rect: rect2,
node: node2,
isOver,
setNodeRef: setDroppableNodeRef
} = useDroppable({
id,
data: data2,
resizeObserverConfig: {
updateMeasurementsFor: itemsAfterCurrentSortable,
...resizeObserverConfig
}
});
const {
active,
activatorEvent,
activeNodeRect,
attributes,
setNodeRef: setDraggableNodeRef,
listeners,
isDragging,
over,
transform: transform2
} = useDraggable({
id,
data: data2,
attributes: {
...defaultAttributes,
...userDefinedAttributes
},
disabled
});
const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
const isSorting = Boolean(active);
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform2 : null;
const strategy = localStrategy != null ? localStrategy : globalStrategy;
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
rects: sortedRects,
activeNodeRect,
activeIndex,
overIndex,
index: index2
}) : null;
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
id,
items,
activeIndex,
overIndex
}) : index2;
const activeId = active == null ? void 0 : active.id;
const previous = reactExports.useRef({
activeId,
items,
newIndex,
containerId
});
const itemsHaveChanged = items !== previous.current.items;
const shouldAnimateLayoutChanges = animateLayoutChanges({
active,
containerId,
isDragging,
isSorting,
id,
index: index2,
items,
newIndex: previous.current.newIndex,
previousItems: previous.current.items,
previousContainerId: previous.current.containerId,
transition,
wasDragging: previous.current.activeId != null
});
const derivedTransform = useDerivedTransform({
disabled: !shouldAnimateLayoutChanges,
index: index2,
node: node2,
rect: rect2
});
reactExports.useEffect(() => {
if (isSorting && previous.current.newIndex !== newIndex) {
previous.current.newIndex = newIndex;
}
if (containerId !== previous.current.containerId) {
previous.current.containerId = containerId;
}
if (items !== previous.current.items) {
previous.current.items = items;
}
if (activeId !== previous.current.activeId) {
previous.current.activeId = activeId;
}
}, [activeId, isSorting, newIndex, containerId, items]);
return {
active,
activeIndex,
attributes,
rect: rect2,
index: index2,
newIndex,
items,
isOver,
isSorting,
isDragging,
listeners,
node: node2,
overIndex,
over,
setNodeRef,
setDroppableNodeRef,
setDraggableNodeRef,
transform: derivedTransform != null ? derivedTransform : finalTransform,
transition: getTransition()
};
function getTransition() {
if (
// Temporarily disable transitions for a single frame to set up derived transforms
derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
itemsHaveChanged && previous.current.newIndex === index2
) {
return disabledTransition;
}
if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {
return void 0;
}
if (isSorting || shouldAnimateLayoutChanges) {
return CSS$1.Transition.toString({
...transition,
property: transitionProperty
});
}
return void 0;
}
}
const directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
const sortableKeyboardCoordinates = (event2, {
context: {
active,
droppableContainers,
collisionRect,
scrollableAncestors
}
}) => {
if (directions.includes(event2.code)) {
event2.preventDefault();
if (!active || !collisionRect) {
return;
}
const filteredContainers = [];
droppableContainers.getEnabled().forEach((entry2) => {
if (!entry2 || (entry2 == null ? void 0 : entry2.disabled)) {
return;
}
const rect2 = entry2 == null ? void 0 : entry2.rect.current;
if (!rect2) {
return;
}
switch (event2.code) {
case KeyboardCode.Down:
if (collisionRect.top + collisionRect.height <= rect2.top) {
filteredContainers.push(entry2);
}
break;
case KeyboardCode.Up:
if (collisionRect.top >= rect2.top + rect2.height) {
filteredContainers.push(entry2);
}
break;
case KeyboardCode.Left:
if (collisionRect.left >= rect2.left + rect2.width) {
filteredContainers.push(entry2);
}
break;
case KeyboardCode.Right:
if (collisionRect.left + collisionRect.width <= rect2.left) {
filteredContainers.push(entry2);
}
break;
}
});
const collisions = closestCorners({
active,
collisionRect,
droppableContainers: filteredContainers,
pointerCoordinates: null
});
const closestId = getFirstCollision(collisions, "id");
if (closestId != null) {
const newDroppable = droppableContainers.get(closestId);
const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
const newRect = newDroppable == null ? void 0 : newDroppable.rect.current;
if (newNode && newRect) {
const newScrollAncestors = getScrollableAncestors(newNode);
const hasDifferentScrollAncestors = newScrollAncestors.some((element2, index2) => scrollableAncestors[index2] !== element2);
const offset2 = hasDifferentScrollAncestors ? {
x: 0,
y: 0
} : {
x: collisionRect.width - newRect.width,
y: collisionRect.height - newRect.height
};
const newCoordinates = {
x: newRect.left - offset2.x,
y: newRect.top - offset2.y
};
return newCoordinates;
}
}
}
return void 0;
};
const sortable_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
SortableContext: SortableContext$1,
arrayMove: arrayMove$1,
arraySwap,
defaultAnimateLayoutChanges,
defaultNewIndexGetter,
horizontalListSortingStrategy,
rectSortingStrategy,
rectSwappingStrategy,
sortableKeyboardCoordinates,
useSortable,
verticalListSortingStrategy
}, Symbol.toStringTag, { value: "Module" }));
const require$$14 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
var _baseDelay;
var hasRequired_baseDelay;
function require_baseDelay() {
if (hasRequired_baseDelay)
return _baseDelay;
hasRequired_baseDelay = 1;
var FUNC_ERROR_TEXT2 = "Expected a function";
function baseDelay(func, wait, args) {
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT2);
}
return setTimeout(function() {
func.apply(void 0, args);
}, wait);
}
_baseDelay = baseDelay;
return _baseDelay;
}
var defer_1;
var hasRequiredDefer;
function requireDefer() {
if (hasRequiredDefer)
return defer_1;
hasRequiredDefer = 1;
var baseDelay = require_baseDelay(), baseRest2 = require_baseRest();
var defer2 = baseRest2(function(func, args) {
return baseDelay(func, 1, args);
});
defer_1 = defer2;
return defer_1;
}
function createSnapModifier(gridSize) {
return ({
transform: transform2
}) => ({
...transform2,
x: Math.ceil(transform2.x / gridSize) * gridSize,
y: Math.ceil(transform2.y / gridSize) * gridSize
});
}
const restrictToHorizontalAxis = ({
transform: transform2
}) => {
return {
...transform2,
y: 0
};
};
function restrictToBoundingRect(transform2, rect2, boundingRect) {
const value2 = {
...transform2
};
if (rect2.top + transform2.y <= boundingRect.top) {
value2.y = boundingRect.top - rect2.top;
} else if (rect2.bottom + transform2.y >= boundingRect.top + boundingRect.height) {
value2.y = boundingRect.top + boundingRect.height - rect2.bottom;
}
if (rect2.left + transform2.x <= boundingRect.left) {
value2.x = boundingRect.left - rect2.left;
} else if (rect2.right + transform2.x >= boundingRect.left + boundingRect.width) {
value2.x = boundingRect.left + boundingRect.width - rect2.right;
}
return value2;
}
const restrictToParentElement = ({
containerNodeRect,
draggingNodeRect,
transform: transform2
}) => {
if (!draggingNodeRect || !containerNodeRect) {
return transform2;
}
return restrictToBoundingRect(transform2, draggingNodeRect, containerNodeRect);
};
const restrictToFirstScrollableAncestor = ({
draggingNodeRect,
transform: transform2,
scrollableAncestorRects
}) => {
const firstScrollableAncestorRect = scrollableAncestorRects[0];
if (!draggingNodeRect || !firstScrollableAncestorRect) {
return transform2;
}
return restrictToBoundingRect(transform2, draggingNodeRect, firstScrollableAncestorRect);
};
const restrictToVerticalAxis = ({
transform: transform2
}) => {
return {
...transform2,
x: 0
};
};
const restrictToWindowEdges = ({
transform: transform2,
draggingNodeRect,
windowRect
}) => {
if (!draggingNodeRect || !windowRect) {
return transform2;
}
return restrictToBoundingRect(transform2, draggingNodeRect, windowRect);
};
const snapCenterToCursor = ({
activatorEvent,
draggingNodeRect,
transform: transform2
}) => {
if (draggingNodeRect && activatorEvent) {
const activatorCoordinates = getEventCoordinates(activatorEvent);
if (!activatorCoordinates) {
return transform2;
}
const offsetX = activatorCoordinates.x - draggingNodeRect.left;
const offsetY = activatorCoordinates.y - draggingNodeRect.top;
return {
...transform2,
x: transform2.x + offsetX - draggingNodeRect.width / 2,
y: transform2.y + offsetY - draggingNodeRect.height / 2
};
}
return transform2;
};
const modifiers_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
createSnapModifier,
restrictToFirstScrollableAncestor,
restrictToHorizontalAxis,
restrictToParentElement,
restrictToVerticalAxis,
restrictToWindowEdges,
snapCenterToCursor
}, Symbol.toStringTag, { value: "Module" }));
const require$$17 = /* @__PURE__ */ getAugmentedNamespace(modifiers_esm);
var _baseMap;
var hasRequired_baseMap;
function require_baseMap() {
if (hasRequired_baseMap)
return _baseMap;
hasRequired_baseMap = 1;
var baseEach = require_baseEach(), isArrayLike2 = requireIsArrayLike();
function baseMap(collection, iteratee) {
var index2 = -1, result = isArrayLike2(collection) ? Array(collection.length) : [];
baseEach(collection, function(value2, key2, collection2) {
result[++index2] = iteratee(value2, key2, collection2);
});
return result;
}
_baseMap = baseMap;
return _baseMap;
}
var _baseSortBy;
var hasRequired_baseSortBy;
function require_baseSortBy() {
if (hasRequired_baseSortBy)
return _baseSortBy;
hasRequired_baseSortBy = 1;
function baseSortBy(array2, comparer) {
var length2 = array2.length;
array2.sort(comparer);
while (length2--) {
array2[length2] = array2[length2].value;
}
return array2;
}
_baseSortBy = baseSortBy;
return _baseSortBy;
}
var _compareAscending;
var hasRequired_compareAscending;
function require_compareAscending() {
if (hasRequired_compareAscending)
return _compareAscending;
hasRequired_compareAscending = 1;
var isSymbol2 = requireIsSymbol();
function compareAscending(value2, other) {
if (value2 !== other) {
var valIsDefined = value2 !== void 0, valIsNull = value2 === null, valIsReflexive = value2 === value2, valIsSymbol = isSymbol2(value2);
var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol2(other);
if (!othIsNull && !othIsSymbol && !valIsSymbol && value2 > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
return 1;
}
if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
return -1;
}
}
return 0;
}
_compareAscending = compareAscending;
return _compareAscending;
}
var _compareMultiple;
var hasRequired_compareMultiple;
function require_compareMultiple() {
if (hasRequired_compareMultiple)
return _compareMultiple;
hasRequired_compareMultiple = 1;
var compareAscending = require_compareAscending();
function compareMultiple(object2, other, orders) {
var index2 = -1, objCriteria = object2.criteria, othCriteria = other.criteria, length2 = objCriteria.length, ordersLength = orders.length;
while (++index2 < length2) {
var result = compareAscending(objCriteria[index2], othCriteria[index2]);
if (result) {
if (index2 >= ordersLength) {
return result;
}
var order2 = orders[index2];
return result * (order2 == "desc" ? -1 : 1);
}
}
return object2.index - other.index;
}
_compareMultiple = compareMultiple;
return _compareMultiple;
}
var _baseOrderBy;
var hasRequired_baseOrderBy;
function require_baseOrderBy() {
if (hasRequired_baseOrderBy)
return _baseOrderBy;
hasRequired_baseOrderBy = 1;
var arrayMap2 = require_arrayMap(), baseGet = require_baseGet(), baseIteratee = require_baseIteratee(), baseMap = require_baseMap(), baseSortBy = require_baseSortBy(), baseUnary2 = require_baseUnary(), compareMultiple = require_compareMultiple(), identity2 = requireIdentity(), isArray3 = requireIsArray();
function baseOrderBy(collection, iteratees, orders) {
if (iteratees.length) {
iteratees = arrayMap2(iteratees, function(iteratee) {
if (isArray3(iteratee)) {
return function(value2) {
return baseGet(value2, iteratee.length === 1 ? iteratee[0] : iteratee);
};
}
return iteratee;
});
} else {
iteratees = [identity2];
}
var index2 = -1;
iteratees = arrayMap2(iteratees, baseUnary2(baseIteratee));
var result = baseMap(collection, function(value2, key2, collection2) {
var criteria = arrayMap2(iteratees, function(iteratee) {
return iteratee(value2);
});
return { "criteria": criteria, "index": ++index2, "value": value2 };
});
return baseSortBy(result, function(object2, other) {
return compareMultiple(object2, other, orders);
});
}
_baseOrderBy = baseOrderBy;
return _baseOrderBy;
}
var sortBy_1;
var hasRequiredSortBy;
function requireSortBy() {
if (hasRequiredSortBy)
return sortBy_1;
hasRequiredSortBy = 1;
var baseFlatten2 = require_baseFlatten(), baseOrderBy = require_baseOrderBy(), baseRest2 = require_baseRest(), isIterateeCall = require_isIterateeCall();
var sortBy = baseRest2(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length2 = iteratees.length;
if (length2 > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length2 > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten2(iteratees, 1), []);
});
sortBy_1 = sortBy;
return sortBy_1;
}
var get$7 = { exports: {} };
var superPropBase = { exports: {} };
var hasRequiredSuperPropBase;
function requireSuperPropBase() {
if (hasRequiredSuperPropBase)
return superPropBase.exports;
hasRequiredSuperPropBase = 1;
(function(module) {
var getPrototypeOf2 = requireGetPrototypeOf();
function _superPropBase(object2, property2) {
while (!Object.prototype.hasOwnProperty.call(object2, property2)) {
object2 = getPrototypeOf2(object2);
if (object2 === null)
break;
}
return object2;
}
module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(superPropBase);
return superPropBase.exports;
}
var hasRequiredGet;
function requireGet() {
if (hasRequiredGet)
return get$7.exports;
hasRequiredGet = 1;
(function(module) {
var superPropBase2 = requireSuperPropBase();
function _get() {
if (typeof Reflect !== "undefined" && Reflect.get) {
module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
} else {
module.exports = _get = function _get2(target2, property2, receiver) {
var base2 = superPropBase2(target2, property2);
if (!base2)
return;
var desc = Object.getOwnPropertyDescriptor(base2, property2);
if (desc.get) {
return desc.get.call(arguments.length < 3 ? target2 : receiver);
}
return desc.value;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
}
return _get.apply(this, arguments);
}
module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(get$7);
return get$7.exports;
}
var isEqual_1;
var hasRequiredIsEqual;
function requireIsEqual() {
if (hasRequiredIsEqual)
return isEqual_1;
hasRequiredIsEqual = 1;
var baseIsEqual = require_baseIsEqual();
function isEqual3(value2, other) {
return baseIsEqual(value2, other);
}
isEqual_1 = isEqual3;
return isEqual_1;
}
var transform_1;
var hasRequiredTransform;
function requireTransform() {
if (hasRequiredTransform)
return transform_1;
hasRequiredTransform = 1;
var arrayEach = require_arrayEach(), baseCreate = require_baseCreate(), baseForOwn = require_baseForOwn(), baseIteratee = require_baseIteratee(), getPrototype2 = require_getPrototype(), isArray3 = requireIsArray(), isBuffer2 = requireIsBuffer(), isFunction2 = requireIsFunction(), isObject2 = requireIsObject(), isTypedArray = requireIsTypedArray();
function transform2(object2, iteratee, accumulator) {
var isArr = isArray3(object2), isArrLike = isArr || isBuffer2(object2) || isTypedArray(object2);
iteratee = baseIteratee(iteratee, 4);
if (accumulator == null) {
var Ctor = object2 && object2.constructor;
if (isArrLike) {
accumulator = isArr ? new Ctor() : [];
} else if (isObject2(object2)) {
accumulator = isFunction2(Ctor) ? baseCreate(getPrototype2(object2)) : {};
} else {
accumulator = {};
}
}
(isArrLike ? arrayEach : baseForOwn)(object2, function(value2, index2, object3) {
return iteratee(accumulator, value2, index2, object3);
});
return accumulator;
}
transform_1 = transform2;
return transform_1;
}
function _objectSpread$b(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys3 = Object.keys(source2);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys3.push.apply(ownKeys3, Object.getOwnPropertySymbols(source2).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source2, sym).enumerable;
}));
}
ownKeys3.forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
}
return target2;
}
var invariant = function(condition, format2, a2, b2, c2, d2, e7, f2) {
if (!condition) {
var error3;
if (format2 === void 0) {
error3 = new Error(
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
);
} else {
var args = [a2, b2, c2, d2, e7, f2];
var argIndex = 0;
error3 = new Error(
format2.replace(/%s/g, function() {
return args[argIndex++];
})
);
error3.name = "Invariant Violation";
}
error3.framesToPop = 1;
throw error3;
}
};
var browser = invariant;
const invariant$1 = /* @__PURE__ */ getDefaultExportFromCjs(browser);
var Manager$1 = function() {
function Manager2() {
_classCallCheck$1(this, Manager2);
_defineProperty$3(this, "refs", {});
}
_createClass(Manager2, [{
key: "add",
value: function add3(collection, ref2) {
if (!this.refs[collection]) {
this.refs[collection] = [];
}
this.refs[collection].push(ref2);
}
}, {
key: "remove",
value: function remove3(collection, ref2) {
var index2 = this.getIndex(collection, ref2);
if (index2 !== -1) {
this.refs[collection].splice(index2, 1);
}
}
}, {
key: "isActive",
value: function isActive() {
return this.active;
}
}, {
key: "getActive",
value: function getActive() {
var _this = this;
return this.refs[this.active.collection].find(function(_ref3) {
var node2 = _ref3.node;
return node2.sortableInfo.index == _this.active.index;
});
}
}, {
key: "getIndex",
value: function getIndex(collection, ref2) {
return this.refs[collection].indexOf(ref2);
}
}, {
key: "getOrderedRefs",
value: function getOrderedRefs() {
var collection = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.active.collection;
return this.refs[collection].sort(sortByIndex);
}
}]);
return Manager2;
}();
function sortByIndex(_ref22, _ref3) {
var index1 = _ref22.node.sortableInfo.index;
var index2 = _ref3.node.sortableInfo.index;
return index1 - index2;
}
function arrayMove(array2, from2, to2) {
array2 = array2.slice();
array2.splice(to2 < 0 ? array2.length + to2 : to2, 0, array2.splice(from2, 1)[0]);
return array2;
}
function omit$2(obj, keysToOmit) {
return Object.keys(obj).reduce(function(acc, key2) {
if (keysToOmit.indexOf(key2) === -1) {
acc[key2] = obj[key2];
}
return acc;
}, {});
}
var events$2 = {
end: ["touchend", "touchcancel", "mouseup"],
move: ["touchmove", "mousemove"],
start: ["touchstart", "mousedown"]
};
var vendorPrefix = function() {
if (typeof window === "undefined" || typeof document === "undefined") {
return "";
}
var styles2 = window.getComputedStyle(document.documentElement, "") || ["-moz-hidden-iframe"];
var pre = (Array.prototype.slice.call(styles2).join("").match(/-(moz|webkit|ms)-/) || styles2.OLink === "" && ["", "o"])[1];
switch (pre) {
case "ms":
return "ms";
default:
return pre && pre.length ? pre[0].toUpperCase() + pre.substr(1) : "";
}
}();
function setInlineStyles(node2, styles2) {
Object.keys(styles2).forEach(function(key2) {
node2.style[key2] = styles2[key2];
});
}
function setTranslate3d(node2, translate2) {
node2.style["".concat(vendorPrefix, "Transform")] = translate2 == null ? "" : "translate3d(".concat(translate2.x, "px,").concat(translate2.y, "px,0)");
}
function setTransitionDuration(node2, duration2) {
node2.style["".concat(vendorPrefix, "TransitionDuration")] = duration2 == null ? "" : "".concat(duration2, "ms");
}
function closest(el, fn8) {
while (el) {
if (fn8(el)) {
return el;
}
el = el.parentNode;
}
return null;
}
function limit(min2, max2, value2) {
return Math.max(min2, Math.min(value2, max2));
}
function getPixelValue(stringValue) {
if (stringValue.substr(-2) === "px") {
return parseFloat(stringValue);
}
return 0;
}
function getElementMargin(element2) {
var style2 = window.getComputedStyle(element2);
return {
bottom: getPixelValue(style2.marginBottom),
left: getPixelValue(style2.marginLeft),
right: getPixelValue(style2.marginRight),
top: getPixelValue(style2.marginTop)
};
}
function provideDisplayName(prefix2, Component$$1) {
var componentName = Component$$1.displayName || Component$$1.name;
return componentName ? "".concat(prefix2, "(").concat(componentName, ")") : prefix2;
}
function getScrollAdjustedBoundingClientRect(node2, scrollDelta) {
var boundingClientRect = node2.getBoundingClientRect();
return {
top: boundingClientRect.top + scrollDelta.top,
left: boundingClientRect.left + scrollDelta.left
};
}
function getPosition(event2) {
if (event2.touches && event2.touches.length) {
return {
x: event2.touches[0].pageX,
y: event2.touches[0].pageY
};
} else if (event2.changedTouches && event2.changedTouches.length) {
return {
x: event2.changedTouches[0].pageX,
y: event2.changedTouches[0].pageY
};
} else {
return {
x: event2.pageX,
y: event2.pageY
};
}
}
function isTouchEvent(event2) {
return event2.touches && event2.touches.length || event2.changedTouches && event2.changedTouches.length;
}
function getEdgeOffset(node2, parent) {
var offset2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
left: 0,
top: 0
};
if (!node2) {
return void 0;
}
var nodeOffset = {
left: offset2.left + node2.offsetLeft,
top: offset2.top + node2.offsetTop
};
if (node2.parentNode === parent) {
return nodeOffset;
}
return getEdgeOffset(node2.parentNode, parent, nodeOffset);
}
function getTargetIndex(newIndex, prevIndex, oldIndex) {
if (newIndex < oldIndex && newIndex > prevIndex) {
return newIndex - 1;
} else if (newIndex > oldIndex && newIndex < prevIndex) {
return newIndex + 1;
} else {
return newIndex;
}
}
function getLockPixelOffset(_ref3) {
var lockOffset = _ref3.lockOffset, width2 = _ref3.width, height2 = _ref3.height;
var offsetX = lockOffset;
var offsetY = lockOffset;
var unit2 = "px";
if (typeof lockOffset === "string") {
var match2 = /^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(lockOffset);
invariant$1(match2 !== null, 'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s', lockOffset);
offsetX = parseFloat(lockOffset);
offsetY = parseFloat(lockOffset);
unit2 = match2[1];
}
invariant$1(isFinite(offsetX) && isFinite(offsetY), "lockOffset value should be a finite. Given %s", lockOffset);
if (unit2 === "%") {
offsetX = offsetX * width2 / 100;
offsetY = offsetY * height2 / 100;
}
return {
x: offsetX,
y: offsetY
};
}
function getLockPixelOffsets(_ref22) {
var height2 = _ref22.height, width2 = _ref22.width, lockOffset = _ref22.lockOffset;
var offsets2 = Array.isArray(lockOffset) ? lockOffset : [lockOffset, lockOffset];
invariant$1(offsets2.length === 2, "lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s", lockOffset);
var _offsets = _slicedToArray$2(offsets2, 2), minLockOffset = _offsets[0], maxLockOffset = _offsets[1];
return [getLockPixelOffset({
height: height2,
lockOffset: minLockOffset,
width: width2
}), getLockPixelOffset({
height: height2,
lockOffset: maxLockOffset,
width: width2
})];
}
function isScrollable(el) {
var computedStyle = window.getComputedStyle(el);
var overflowRegex = /(auto|scroll)/;
var properties2 = ["overflow", "overflowX", "overflowY"];
return properties2.find(function(property2) {
return overflowRegex.test(computedStyle[property2]);
});
}
function getScrollingParent(el) {
if (!(el instanceof HTMLElement)) {
return null;
} else if (isScrollable(el)) {
return el;
} else {
return getScrollingParent(el.parentNode);
}
}
function getContainerGridGap(element2) {
var style2 = window.getComputedStyle(element2);
if (style2.display === "grid") {
return {
x: getPixelValue(style2.gridColumnGap),
y: getPixelValue(style2.gridRowGap)
};
}
return {
x: 0,
y: 0
};
}
var KEYCODE = {
TAB: 9,
ESC: 27,
SPACE: 32,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40
};
var NodeType = {
Anchor: "A",
Button: "BUTTON",
Canvas: "CANVAS",
Input: "INPUT",
Option: "OPTION",
Textarea: "TEXTAREA",
Select: "SELECT"
};
function cloneNode(node2) {
var selector = "input, textarea, select, canvas, [contenteditable]";
var fields = node2.querySelectorAll(selector);
var clonedNode = node2.cloneNode(true);
var clonedFields = _toConsumableArray$2(clonedNode.querySelectorAll(selector));
clonedFields.forEach(function(field2, i2) {
if (field2.type !== "file") {
field2.value = fields[i2].value;
}
if (field2.type === "radio" && field2.name) {
field2.name = "__sortableClone__".concat(field2.name);
}
if (field2.tagName === NodeType.Canvas && fields[i2].width > 0 && fields[i2].height > 0) {
var destCtx = field2.getContext("2d");
destCtx.drawImage(fields[i2], 0, 0);
}
});
return clonedNode;
}
function sortableHandle(WrappedComponent) {
var _class, _temp;
var config2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
withRef: false
};
return _temp = _class = function(_React$Component) {
_inherits(WithSortableHandle, _React$Component);
function WithSortableHandle() {
var _getPrototypeOf2;
var _this;
_classCallCheck$1(this, WithSortableHandle);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(WithSortableHandle)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "wrappedInstance", reactExports.createRef());
return _this;
}
_createClass(WithSortableHandle, [{
key: "componentDidMount",
value: function componentDidMount() {
var node2 = reactDomExports.findDOMNode(this);
node2.sortableHandle = true;
}
}, {
key: "getWrappedInstance",
value: function getWrappedInstance() {
invariant$1(config2.withRef, "To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call");
return this.wrappedInstance.current;
}
}, {
key: "render",
value: function render3() {
var ref2 = config2.withRef ? this.wrappedInstance : null;
return reactExports.createElement(WrappedComponent, _extends$3({
ref: ref2
}, this.props));
}
}]);
return WithSortableHandle;
}(reactExports.Component), _defineProperty$3(_class, "displayName", provideDisplayName("sortableHandle", WrappedComponent)), _temp;
}
function isSortableHandle(node2) {
return node2.sortableHandle != null;
}
var AutoScroller = function() {
function AutoScroller2(container, onScrollCallback) {
_classCallCheck$1(this, AutoScroller2);
this.container = container;
this.onScrollCallback = onScrollCallback;
}
_createClass(AutoScroller2, [{
key: "clear",
value: function clear2() {
if (this.interval == null) {
return;
}
clearInterval(this.interval);
this.interval = null;
}
}, {
key: "update",
value: function update2(_ref3) {
var _this = this;
var translate2 = _ref3.translate, minTranslate = _ref3.minTranslate, maxTranslate = _ref3.maxTranslate, width2 = _ref3.width, height2 = _ref3.height;
var direction2 = {
x: 0,
y: 0
};
var speed = {
x: 1,
y: 1
};
var acceleration = {
x: 10,
y: 10
};
var _this$container = this.container, scrollTop = _this$container.scrollTop, scrollLeft = _this$container.scrollLeft, scrollHeight = _this$container.scrollHeight, scrollWidth = _this$container.scrollWidth, clientHeight = _this$container.clientHeight, clientWidth = _this$container.clientWidth;
var isTop = scrollTop === 0;
var isBottom = scrollHeight - scrollTop - clientHeight === 0;
var isLeft = scrollLeft === 0;
var isRight = scrollWidth - scrollLeft - clientWidth === 0;
if (translate2.y >= maxTranslate.y - height2 / 2 && !isBottom) {
direction2.y = 1;
speed.y = acceleration.y * Math.abs((maxTranslate.y - height2 / 2 - translate2.y) / height2);
} else if (translate2.x >= maxTranslate.x - width2 / 2 && !isRight) {
direction2.x = 1;
speed.x = acceleration.x * Math.abs((maxTranslate.x - width2 / 2 - translate2.x) / width2);
} else if (translate2.y <= minTranslate.y + height2 / 2 && !isTop) {
direction2.y = -1;
speed.y = acceleration.y * Math.abs((translate2.y - height2 / 2 - minTranslate.y) / height2);
} else if (translate2.x <= minTranslate.x + width2 / 2 && !isLeft) {
direction2.x = -1;
speed.x = acceleration.x * Math.abs((translate2.x - width2 / 2 - minTranslate.x) / width2);
}
if (this.interval) {
this.clear();
this.isAutoScrolling = false;
}
if (direction2.x !== 0 || direction2.y !== 0) {
this.interval = setInterval(function() {
_this.isAutoScrolling = true;
var offset2 = {
left: speed.x * direction2.x,
top: speed.y * direction2.y
};
_this.container.scrollTop += offset2.top;
_this.container.scrollLeft += offset2.left;
_this.onScrollCallback(offset2);
}, 5);
}
}
}]);
return AutoScroller2;
}();
function defaultGetHelperDimensions(_ref3) {
var node2 = _ref3.node;
return {
height: node2.offsetHeight,
width: node2.offsetWidth
};
}
function defaultShouldCancelStart(event2) {
var interactiveElements = [NodeType.Input, NodeType.Textarea, NodeType.Select, NodeType.Option, NodeType.Button];
if (interactiveElements.indexOf(event2.target.tagName) !== -1) {
return true;
}
if (closest(event2.target, function(el) {
return el.contentEditable === "true";
})) {
return true;
}
return false;
}
var propTypes = {
axis: u$9.oneOf(["x", "y", "xy"]),
contentWindow: u$9.any,
disableAutoscroll: u$9.bool,
distance: u$9.number,
getContainer: u$9.func,
getHelperDimensions: u$9.func,
helperClass: u$9.string,
helperContainer: u$9.oneOfType([u$9.func, typeof HTMLElement === "undefined" ? u$9.any : u$9.instanceOf(HTMLElement)]),
hideSortableGhost: u$9.bool,
keyboardSortingTransitionDuration: u$9.number,
lockAxis: u$9.string,
lockOffset: u$9.oneOfType([u$9.number, u$9.string, u$9.arrayOf(u$9.oneOfType([u$9.number, u$9.string]))]),
lockToContainerEdges: u$9.bool,
onSortEnd: u$9.func,
onSortMove: u$9.func,
onSortOver: u$9.func,
onSortStart: u$9.func,
pressDelay: u$9.number,
pressThreshold: u$9.number,
keyCodes: u$9.shape({
lift: u$9.arrayOf(u$9.number),
drop: u$9.arrayOf(u$9.number),
cancel: u$9.arrayOf(u$9.number),
up: u$9.arrayOf(u$9.number),
down: u$9.arrayOf(u$9.number)
}),
shouldCancelStart: u$9.func,
transitionDuration: u$9.number,
updateBeforeSortStart: u$9.func,
useDragHandle: u$9.bool,
useWindowAsScrollContainer: u$9.bool
};
var defaultKeyCodes = {
lift: [KEYCODE.SPACE],
drop: [KEYCODE.SPACE],
cancel: [KEYCODE.ESC],
up: [KEYCODE.UP, KEYCODE.LEFT],
down: [KEYCODE.DOWN, KEYCODE.RIGHT]
};
var defaultProps$1 = {
axis: "y",
disableAutoscroll: false,
distance: 0,
getHelperDimensions: defaultGetHelperDimensions,
hideSortableGhost: true,
lockOffset: "50%",
lockToContainerEdges: false,
pressDelay: 0,
pressThreshold: 5,
keyCodes: defaultKeyCodes,
shouldCancelStart: defaultShouldCancelStart,
transitionDuration: 300,
useWindowAsScrollContainer: false
};
var omittedProps = Object.keys(propTypes);
function validateProps(props) {
invariant$1(!(props.distance && props.pressDelay), "Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.");
}
function _finallyRethrows(body, finalizer) {
try {
var result = body();
} catch (e7) {
return finalizer(true, e7);
}
if (result && result.then) {
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
}
return finalizer(false, value);
}
var SortableContext = reactExports.createContext({
manager: {}
});
function sortableContainer(WrappedComponent) {
var _class, _temp;
var config2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
withRef: false
};
return _temp = _class = function(_React$Component) {
_inherits(WithSortableContainer, _React$Component);
function WithSortableContainer(props) {
var _this;
_classCallCheck$1(this, WithSortableContainer);
_this = _possibleConstructorReturn(this, _getPrototypeOf(WithSortableContainer).call(this, props));
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "state", {});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleStart", function(event2) {
var _this$props = _this.props, distance2 = _this$props.distance, shouldCancelStart = _this$props.shouldCancelStart;
if (event2.button === 2 || shouldCancelStart(event2)) {
return;
}
_this.touched = true;
_this.position = getPosition(event2);
var node2 = closest(event2.target, function(el) {
return el.sortableInfo != null;
});
if (node2 && node2.sortableInfo && _this.nodeIsChild(node2) && !_this.state.sorting) {
var useDragHandle = _this.props.useDragHandle;
var _node$sortableInfo = node2.sortableInfo, index2 = _node$sortableInfo.index, collection = _node$sortableInfo.collection, disabled = _node$sortableInfo.disabled;
if (disabled) {
return;
}
if (useDragHandle && !closest(event2.target, isSortableHandle)) {
return;
}
_this.manager.active = {
collection,
index: index2
};
if (!isTouchEvent(event2) && event2.target.tagName === NodeType.Anchor) {
event2.preventDefault();
}
if (!distance2) {
if (_this.props.pressDelay === 0) {
_this.handlePress(event2);
} else {
_this.pressTimer = setTimeout(function() {
return _this.handlePress(event2);
}, _this.props.pressDelay);
}
}
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "nodeIsChild", function(node2) {
return node2.sortableInfo.manager === _this.manager;
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleMove", function(event2) {
var _this$props2 = _this.props, distance2 = _this$props2.distance, pressThreshold = _this$props2.pressThreshold;
if (!_this.state.sorting && _this.touched && !_this._awaitingUpdateBeforeSortStart) {
var position2 = getPosition(event2);
var delta = {
x: _this.position.x - position2.x,
y: _this.position.y - position2.y
};
var combinedDelta = Math.abs(delta.x) + Math.abs(delta.y);
_this.delta = delta;
if (!distance2 && (!pressThreshold || combinedDelta >= pressThreshold)) {
clearTimeout(_this.cancelTimer);
_this.cancelTimer = setTimeout(_this.cancel, 0);
} else if (distance2 && combinedDelta >= distance2 && _this.manager.isActive()) {
_this.handlePress(event2);
}
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleEnd", function() {
_this.touched = false;
_this.cancel();
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "cancel", function() {
var distance2 = _this.props.distance;
var sorting = _this.state.sorting;
if (!sorting) {
if (!distance2) {
clearTimeout(_this.pressTimer);
}
_this.manager.active = null;
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handlePress", function(event2) {
try {
var active = _this.manager.getActive();
var _temp6 = function() {
if (active) {
var _temp7 = function _temp72() {
var index2 = _node.sortableInfo.index;
var margin = getElementMargin(_node);
var gridGap = getContainerGridGap(_this.container);
var containerBoundingRect = _this.scrollContainer.getBoundingClientRect();
var dimensions = _getHelperDimensions({
index: index2,
node: _node,
collection: _collection
});
_this.node = _node;
_this.margin = margin;
_this.gridGap = gridGap;
_this.width = dimensions.width;
_this.height = dimensions.height;
_this.marginOffset = {
x: _this.margin.left + _this.margin.right + _this.gridGap.x,
y: Math.max(_this.margin.top, _this.margin.bottom, _this.gridGap.y)
};
_this.boundingClientRect = _node.getBoundingClientRect();
_this.containerBoundingRect = containerBoundingRect;
_this.index = index2;
_this.newIndex = index2;
_this.axis = {
x: _axis.indexOf("x") >= 0,
y: _axis.indexOf("y") >= 0
};
_this.offsetEdge = getEdgeOffset(_node, _this.container);
if (_isKeySorting) {
_this.initialOffset = getPosition(_objectSpread$b({}, event2, {
pageX: _this.boundingClientRect.left,
pageY: _this.boundingClientRect.top
}));
} else {
_this.initialOffset = getPosition(event2);
}
_this.initialScroll = {
left: _this.scrollContainer.scrollLeft,
top: _this.scrollContainer.scrollTop
};
_this.initialWindowScroll = {
left: window.pageXOffset,
top: window.pageYOffset
};
_this.helper = _this.helperContainer.appendChild(cloneNode(_node));
setInlineStyles(_this.helper, {
boxSizing: "border-box",
height: "".concat(_this.height, "px"),
left: "".concat(_this.boundingClientRect.left - margin.left, "px"),
pointerEvents: "none",
position: "fixed",
top: "".concat(_this.boundingClientRect.top - margin.top, "px"),
width: "".concat(_this.width, "px")
});
if (_isKeySorting) {
_this.helper.focus();
}
if (_hideSortableGhost) {
_this.sortableGhost = _node;
setInlineStyles(_node, {
opacity: 0,
visibility: "hidden"
});
}
_this.minTranslate = {};
_this.maxTranslate = {};
if (_isKeySorting) {
var _ref3 = _useWindowAsScrollContainer ? {
top: 0,
left: 0,
width: _this.contentWindow.innerWidth,
height: _this.contentWindow.innerHeight
} : _this.containerBoundingRect, containerTop = _ref3.top, containerLeft = _ref3.left, containerWidth = _ref3.width, containerHeight = _ref3.height;
var containerBottom = containerTop + containerHeight;
var containerRight = containerLeft + containerWidth;
if (_this.axis.x) {
_this.minTranslate.x = containerLeft - _this.boundingClientRect.left;
_this.maxTranslate.x = containerRight - (_this.boundingClientRect.left + _this.width);
}
if (_this.axis.y) {
_this.minTranslate.y = containerTop - _this.boundingClientRect.top;
_this.maxTranslate.y = containerBottom - (_this.boundingClientRect.top + _this.height);
}
} else {
if (_this.axis.x) {
_this.minTranslate.x = (_useWindowAsScrollContainer ? 0 : containerBoundingRect.left) - _this.boundingClientRect.left - _this.width / 2;
_this.maxTranslate.x = (_useWindowAsScrollContainer ? _this.contentWindow.innerWidth : containerBoundingRect.left + containerBoundingRect.width) - _this.boundingClientRect.left - _this.width / 2;
}
if (_this.axis.y) {
_this.minTranslate.y = (_useWindowAsScrollContainer ? 0 : containerBoundingRect.top) - _this.boundingClientRect.top - _this.height / 2;
_this.maxTranslate.y = (_useWindowAsScrollContainer ? _this.contentWindow.innerHeight : containerBoundingRect.top + containerBoundingRect.height) - _this.boundingClientRect.top - _this.height / 2;
}
}
if (_helperClass) {
_helperClass.split(" ").forEach(function(className) {
return _this.helper.classList.add(className);
});
}
_this.listenerNode = event2.touches ? event2.target : _this.contentWindow;
if (_isKeySorting) {
_this.listenerNode.addEventListener("wheel", _this.handleKeyEnd, true);
_this.listenerNode.addEventListener("mousedown", _this.handleKeyEnd, true);
_this.listenerNode.addEventListener("keydown", _this.handleKeyDown);
} else {
events$2.move.forEach(function(eventName) {
return _this.listenerNode.addEventListener(eventName, _this.handleSortMove, false);
});
events$2.end.forEach(function(eventName) {
return _this.listenerNode.addEventListener(eventName, _this.handleSortEnd, false);
});
}
_this.setState({
sorting: true,
sortingIndex: index2
});
if (_onSortStart) {
_onSortStart({
node: _node,
index: index2,
collection: _collection,
isKeySorting: _isKeySorting,
nodes: _this.manager.getOrderedRefs(),
helper: _this.helper
}, event2);
}
if (_isKeySorting) {
_this.keyMove(0);
}
};
var _this$props3 = _this.props, _axis = _this$props3.axis, _getHelperDimensions = _this$props3.getHelperDimensions, _helperClass = _this$props3.helperClass, _hideSortableGhost = _this$props3.hideSortableGhost, updateBeforeSortStart = _this$props3.updateBeforeSortStart, _onSortStart = _this$props3.onSortStart, _useWindowAsScrollContainer = _this$props3.useWindowAsScrollContainer;
var _node = active.node, _collection = active.collection;
var _isKeySorting = _this.manager.isKeySorting;
var _temp8 = function() {
if (typeof updateBeforeSortStart === "function") {
_this._awaitingUpdateBeforeSortStart = true;
var _temp9 = _finallyRethrows(function() {
var index2 = _node.sortableInfo.index;
return Promise.resolve(updateBeforeSortStart({
collection: _collection,
index: index2,
node: _node,
isKeySorting: _isKeySorting
}, event2)).then(function() {
});
}, function(_wasThrown, _result) {
_this._awaitingUpdateBeforeSortStart = false;
if (_wasThrown)
throw _result;
return _result;
});
if (_temp9 && _temp9.then)
return _temp9.then(function() {
});
}
}();
return _temp8 && _temp8.then ? _temp8.then(_temp7) : _temp7(_temp8);
}
}();
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function() {
}) : void 0);
} catch (e7) {
return Promise.reject(e7);
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleSortMove", function(event2) {
var onSortMove = _this.props.onSortMove;
if (typeof event2.preventDefault === "function" && event2.cancelable) {
event2.preventDefault();
}
_this.updateHelperPosition(event2);
_this.animateNodes();
_this.autoscroll();
if (onSortMove) {
onSortMove(event2);
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleSortEnd", function(event2) {
var _this$props4 = _this.props, hideSortableGhost = _this$props4.hideSortableGhost, onSortEnd = _this$props4.onSortEnd;
var _this$manager = _this.manager, collection = _this$manager.active.collection, isKeySorting = _this$manager.isKeySorting;
var nodes = _this.manager.getOrderedRefs();
if (_this.listenerNode) {
if (isKeySorting) {
_this.listenerNode.removeEventListener("wheel", _this.handleKeyEnd, true);
_this.listenerNode.removeEventListener("mousedown", _this.handleKeyEnd, true);
_this.listenerNode.removeEventListener("keydown", _this.handleKeyDown);
} else {
events$2.move.forEach(function(eventName) {
return _this.listenerNode.removeEventListener(eventName, _this.handleSortMove);
});
events$2.end.forEach(function(eventName) {
return _this.listenerNode.removeEventListener(eventName, _this.handleSortEnd);
});
}
}
_this.helper.parentNode.removeChild(_this.helper);
if (hideSortableGhost && _this.sortableGhost) {
setInlineStyles(_this.sortableGhost, {
opacity: "",
visibility: ""
});
}
for (var i2 = 0, len = nodes.length; i2 < len; i2++) {
var _node2 = nodes[i2];
var el = _node2.node;
_node2.edgeOffset = null;
_node2.boundingClientRect = null;
setTranslate3d(el, null);
setTransitionDuration(el, null);
_node2.translate = null;
}
_this.autoScroller.clear();
_this.manager.active = null;
_this.manager.isKeySorting = false;
_this.setState({
sorting: false,
sortingIndex: null
});
if (typeof onSortEnd === "function") {
onSortEnd({
collection,
newIndex: _this.newIndex,
oldIndex: _this.index,
isKeySorting,
nodes
}, event2);
}
_this.touched = false;
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "autoscroll", function() {
var disableAutoscroll = _this.props.disableAutoscroll;
var isKeySorting = _this.manager.isKeySorting;
if (disableAutoscroll) {
_this.autoScroller.clear();
return;
}
if (isKeySorting) {
var translate2 = _objectSpread$b({}, _this.translate);
var scrollX = 0;
var scrollY = 0;
if (_this.axis.x) {
translate2.x = Math.min(_this.maxTranslate.x, Math.max(_this.minTranslate.x, _this.translate.x));
scrollX = _this.translate.x - translate2.x;
}
if (_this.axis.y) {
translate2.y = Math.min(_this.maxTranslate.y, Math.max(_this.minTranslate.y, _this.translate.y));
scrollY = _this.translate.y - translate2.y;
}
_this.translate = translate2;
setTranslate3d(_this.helper, _this.translate);
_this.scrollContainer.scrollLeft += scrollX;
_this.scrollContainer.scrollTop += scrollY;
return;
}
_this.autoScroller.update({
height: _this.height,
maxTranslate: _this.maxTranslate,
minTranslate: _this.minTranslate,
translate: _this.translate,
width: _this.width
});
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "onAutoScroll", function(offset2) {
_this.translate.x += offset2.left;
_this.translate.y += offset2.top;
_this.animateNodes();
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleKeyDown", function(event2) {
var keyCode = event2.keyCode;
var _this$props5 = _this.props, shouldCancelStart = _this$props5.shouldCancelStart, _this$props5$keyCodes = _this$props5.keyCodes, customKeyCodes = _this$props5$keyCodes === void 0 ? {} : _this$props5$keyCodes;
var keyCodes = _objectSpread$b({}, defaultKeyCodes, customKeyCodes);
if (_this.manager.active && !_this.manager.isKeySorting || !_this.manager.active && (!keyCodes.lift.includes(keyCode) || shouldCancelStart(event2) || !_this.isValidSortingTarget(event2))) {
return;
}
event2.stopPropagation();
event2.preventDefault();
if (keyCodes.lift.includes(keyCode) && !_this.manager.active) {
_this.keyLift(event2);
} else if (keyCodes.drop.includes(keyCode) && _this.manager.active) {
_this.keyDrop(event2);
} else if (keyCodes.cancel.includes(keyCode)) {
_this.newIndex = _this.manager.active.index;
_this.keyDrop(event2);
} else if (keyCodes.up.includes(keyCode)) {
_this.keyMove(-1);
} else if (keyCodes.down.includes(keyCode)) {
_this.keyMove(1);
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "keyLift", function(event2) {
var target2 = event2.target;
var node2 = closest(target2, function(el) {
return el.sortableInfo != null;
});
var _node$sortableInfo2 = node2.sortableInfo, index2 = _node$sortableInfo2.index, collection = _node$sortableInfo2.collection;
_this.initialFocusedNode = target2;
_this.manager.isKeySorting = true;
_this.manager.active = {
index: index2,
collection
};
_this.handlePress(event2);
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "keyMove", function(shift) {
var nodes = _this.manager.getOrderedRefs();
var lastIndex = nodes[nodes.length - 1].node.sortableInfo.index;
var newIndex = _this.newIndex + shift;
var prevIndex = _this.newIndex;
if (newIndex < 0 || newIndex > lastIndex) {
return;
}
_this.prevIndex = prevIndex;
_this.newIndex = newIndex;
var targetIndex = getTargetIndex(_this.newIndex, _this.prevIndex, _this.index);
var target2 = nodes.find(function(_ref22) {
var node2 = _ref22.node;
return node2.sortableInfo.index === targetIndex;
});
var targetNode = target2.node;
var scrollDelta = _this.containerScrollDelta;
var targetBoundingClientRect = target2.boundingClientRect || getScrollAdjustedBoundingClientRect(targetNode, scrollDelta);
var targetTranslate = target2.translate || {
x: 0,
y: 0
};
var targetPosition = {
top: targetBoundingClientRect.top + targetTranslate.y - scrollDelta.top,
left: targetBoundingClientRect.left + targetTranslate.x - scrollDelta.left
};
var shouldAdjustForSize = prevIndex < newIndex;
var sizeAdjustment = {
x: shouldAdjustForSize && _this.axis.x ? targetNode.offsetWidth - _this.width : 0,
y: shouldAdjustForSize && _this.axis.y ? targetNode.offsetHeight - _this.height : 0
};
_this.handleSortMove({
pageX: targetPosition.left + sizeAdjustment.x,
pageY: targetPosition.top + sizeAdjustment.y,
ignoreTransition: shift === 0
});
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "keyDrop", function(event2) {
_this.handleSortEnd(event2);
if (_this.initialFocusedNode) {
_this.initialFocusedNode.focus();
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "handleKeyEnd", function(event2) {
if (_this.manager.active) {
_this.keyDrop(event2);
}
});
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "isValidSortingTarget", function(event2) {
var useDragHandle = _this.props.useDragHandle;
var target2 = event2.target;
var node2 = closest(target2, function(el) {
return el.sortableInfo != null;
});
return node2 && node2.sortableInfo && !node2.sortableInfo.disabled && (useDragHandle ? isSortableHandle(target2) : target2.sortableInfo);
});
var manager = new Manager$1();
validateProps(props);
_this.manager = manager;
_this.wrappedInstance = reactExports.createRef();
_this.sortableContextValue = {
manager
};
_this.events = {
end: _this.handleEnd,
move: _this.handleMove,
start: _this.handleStart
};
return _this;
}
_createClass(WithSortableContainer, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
var useWindowAsScrollContainer = this.props.useWindowAsScrollContainer;
var container = this.getContainer();
Promise.resolve(container).then(function(containerNode) {
_this2.container = containerNode;
_this2.document = _this2.container.ownerDocument || document;
var contentWindow = _this2.props.contentWindow || _this2.document.defaultView || window;
_this2.contentWindow = typeof contentWindow === "function" ? contentWindow() : contentWindow;
_this2.scrollContainer = useWindowAsScrollContainer ? _this2.document.scrollingElement || _this2.document.documentElement : getScrollingParent(_this2.container) || _this2.container;
_this2.autoScroller = new AutoScroller(_this2.scrollContainer, _this2.onAutoScroll);
Object.keys(_this2.events).forEach(function(key2) {
return events$2[key2].forEach(function(eventName) {
return _this2.container.addEventListener(eventName, _this2.events[key2], false);
});
});
_this2.container.addEventListener("keydown", _this2.handleKeyDown);
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var _this3 = this;
if (this.helper && this.helper.parentNode) {
this.helper.parentNode.removeChild(this.helper);
}
if (!this.container) {
return;
}
Object.keys(this.events).forEach(function(key2) {
return events$2[key2].forEach(function(eventName) {
return _this3.container.removeEventListener(eventName, _this3.events[key2]);
});
});
this.container.removeEventListener("keydown", this.handleKeyDown);
}
}, {
key: "updateHelperPosition",
value: function updateHelperPosition(event2) {
var _this$props6 = this.props, lockAxis = _this$props6.lockAxis, lockOffset = _this$props6.lockOffset, lockToContainerEdges = _this$props6.lockToContainerEdges, transitionDuration = _this$props6.transitionDuration, _this$props6$keyboard = _this$props6.keyboardSortingTransitionDuration, keyboardSortingTransitionDuration = _this$props6$keyboard === void 0 ? transitionDuration : _this$props6$keyboard;
var isKeySorting = this.manager.isKeySorting;
var ignoreTransition = event2.ignoreTransition;
var offset2 = getPosition(event2);
var translate2 = {
x: offset2.x - this.initialOffset.x,
y: offset2.y - this.initialOffset.y
};
translate2.y -= window.pageYOffset - this.initialWindowScroll.top;
translate2.x -= window.pageXOffset - this.initialWindowScroll.left;
this.translate = translate2;
if (lockToContainerEdges) {
var _getLockPixelOffsets = getLockPixelOffsets({
height: this.height,
lockOffset,
width: this.width
}), _getLockPixelOffsets2 = _slicedToArray$2(_getLockPixelOffsets, 2), minLockOffset = _getLockPixelOffsets2[0], maxLockOffset = _getLockPixelOffsets2[1];
var minOffset = {
x: this.width / 2 - minLockOffset.x,
y: this.height / 2 - minLockOffset.y
};
var maxOffset = {
x: this.width / 2 - maxLockOffset.x,
y: this.height / 2 - maxLockOffset.y
};
translate2.x = limit(this.minTranslate.x + minOffset.x, this.maxTranslate.x - maxOffset.x, translate2.x);
translate2.y = limit(this.minTranslate.y + minOffset.y, this.maxTranslate.y - maxOffset.y, translate2.y);
}
if (lockAxis === "x") {
translate2.y = 0;
} else if (lockAxis === "y") {
translate2.x = 0;
}
if (isKeySorting && keyboardSortingTransitionDuration && !ignoreTransition) {
setTransitionDuration(this.helper, keyboardSortingTransitionDuration);
}
setTranslate3d(this.helper, translate2);
}
}, {
key: "animateNodes",
value: function animateNodes() {
var _this$props7 = this.props, transitionDuration = _this$props7.transitionDuration, hideSortableGhost = _this$props7.hideSortableGhost, onSortOver = _this$props7.onSortOver;
var containerScrollDelta = this.containerScrollDelta, windowScrollDelta = this.windowScrollDelta;
var nodes = this.manager.getOrderedRefs();
var sortingOffset = {
left: this.offsetEdge.left + this.translate.x + containerScrollDelta.left,
top: this.offsetEdge.top + this.translate.y + containerScrollDelta.top
};
var isKeySorting = this.manager.isKeySorting;
var prevIndex = this.newIndex;
this.newIndex = null;
for (var i2 = 0, len = nodes.length; i2 < len; i2++) {
var _node3 = nodes[i2].node;
var index2 = _node3.sortableInfo.index;
var width2 = _node3.offsetWidth;
var height2 = _node3.offsetHeight;
var offset2 = {
height: this.height > height2 ? height2 / 2 : this.height / 2,
width: this.width > width2 ? width2 / 2 : this.width / 2
};
var mustShiftBackward = isKeySorting && index2 > this.index && index2 <= prevIndex;
var mustShiftForward = isKeySorting && index2 < this.index && index2 >= prevIndex;
var translate2 = {
x: 0,
y: 0
};
var edgeOffset = nodes[i2].edgeOffset;
if (!edgeOffset) {
edgeOffset = getEdgeOffset(_node3, this.container);
nodes[i2].edgeOffset = edgeOffset;
if (isKeySorting) {
nodes[i2].boundingClientRect = getScrollAdjustedBoundingClientRect(_node3, containerScrollDelta);
}
}
var nextNode = i2 < nodes.length - 1 && nodes[i2 + 1];
var prevNode = i2 > 0 && nodes[i2 - 1];
if (nextNode && !nextNode.edgeOffset) {
nextNode.edgeOffset = getEdgeOffset(nextNode.node, this.container);
if (isKeySorting) {
nextNode.boundingClientRect = getScrollAdjustedBoundingClientRect(nextNode.node, containerScrollDelta);
}
}
if (index2 === this.index) {
if (hideSortableGhost) {
this.sortableGhost = _node3;
setInlineStyles(_node3, {
opacity: 0,
visibility: "hidden"
});
}
continue;
}
if (transitionDuration) {
setTransitionDuration(_node3, transitionDuration);
}
if (this.axis.x) {
if (this.axis.y) {
if (mustShiftForward || index2 < this.index && (sortingOffset.left + windowScrollDelta.left - offset2.width <= edgeOffset.left && sortingOffset.top + windowScrollDelta.top <= edgeOffset.top + offset2.height || sortingOffset.top + windowScrollDelta.top + offset2.height <= edgeOffset.top)) {
translate2.x = this.width + this.marginOffset.x;
if (edgeOffset.left + translate2.x > this.containerBoundingRect.width - offset2.width) {
if (nextNode) {
translate2.x = nextNode.edgeOffset.left - edgeOffset.left;
translate2.y = nextNode.edgeOffset.top - edgeOffset.top;
}
}
if (this.newIndex === null) {
this.newIndex = index2;
}
} else if (mustShiftBackward || index2 > this.index && (sortingOffset.left + windowScrollDelta.left + offset2.width >= edgeOffset.left && sortingOffset.top + windowScrollDelta.top + offset2.height >= edgeOffset.top || sortingOffset.top + windowScrollDelta.top + offset2.height >= edgeOffset.top + height2)) {
translate2.x = -(this.width + this.marginOffset.x);
if (edgeOffset.left + translate2.x < this.containerBoundingRect.left + offset2.width) {
if (prevNode) {
translate2.x = prevNode.edgeOffset.left - edgeOffset.left;
translate2.y = prevNode.edgeOffset.top - edgeOffset.top;
}
}
this.newIndex = index2;
}
} else {
if (mustShiftBackward || index2 > this.index && sortingOffset.left + windowScrollDelta.left + offset2.width >= edgeOffset.left) {
translate2.x = -(this.width + this.marginOffset.x);
this.newIndex = index2;
} else if (mustShiftForward || index2 < this.index && sortingOffset.left + windowScrollDelta.left <= edgeOffset.left + offset2.width) {
translate2.x = this.width + this.marginOffset.x;
if (this.newIndex == null) {
this.newIndex = index2;
}
}
}
} else if (this.axis.y) {
if (mustShiftBackward || index2 > this.index && sortingOffset.top + windowScrollDelta.top + offset2.height >= edgeOffset.top) {
translate2.y = -(this.height + this.marginOffset.y);
this.newIndex = index2;
} else if (mustShiftForward || index2 < this.index && sortingOffset.top + windowScrollDelta.top <= edgeOffset.top + offset2.height) {
translate2.y = this.height + this.marginOffset.y;
if (this.newIndex == null) {
this.newIndex = index2;
}
}
}
setTranslate3d(_node3, translate2);
nodes[i2].translate = translate2;
}
if (this.newIndex == null) {
this.newIndex = this.index;
}
if (isKeySorting) {
this.newIndex = prevIndex;
}
var oldIndex = isKeySorting ? this.prevIndex : prevIndex;
if (onSortOver && this.newIndex !== oldIndex) {
onSortOver({
collection: this.manager.active.collection,
index: this.index,
newIndex: this.newIndex,
oldIndex,
isKeySorting,
nodes,
helper: this.helper
});
}
}
}, {
key: "getWrappedInstance",
value: function getWrappedInstance() {
invariant$1(config2.withRef, "To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call");
return this.wrappedInstance.current;
}
}, {
key: "getContainer",
value: function getContainer() {
var getContainer2 = this.props.getContainer;
if (typeof getContainer2 !== "function") {
return reactDomExports.findDOMNode(this);
}
return getContainer2(config2.withRef ? this.getWrappedInstance() : void 0);
}
}, {
key: "render",
value: function render3() {
var ref2 = config2.withRef ? this.wrappedInstance : null;
return reactExports.createElement(SortableContext.Provider, {
value: this.sortableContextValue
}, reactExports.createElement(WrappedComponent, _extends$3({
ref: ref2
}, omit$2(this.props, omittedProps))));
}
}, {
key: "helperContainer",
get: function get2() {
var helperContainer = this.props.helperContainer;
if (typeof helperContainer === "function") {
return helperContainer();
}
return this.props.helperContainer || this.document.body;
}
}, {
key: "containerScrollDelta",
get: function get2() {
var useWindowAsScrollContainer = this.props.useWindowAsScrollContainer;
if (useWindowAsScrollContainer) {
return {
left: 0,
top: 0
};
}
return {
left: this.scrollContainer.scrollLeft - this.initialScroll.left,
top: this.scrollContainer.scrollTop - this.initialScroll.top
};
}
}, {
key: "windowScrollDelta",
get: function get2() {
return {
left: this.contentWindow.pageXOffset - this.initialWindowScroll.left,
top: this.contentWindow.pageYOffset - this.initialWindowScroll.top
};
}
}]);
return WithSortableContainer;
}(reactExports.Component), _defineProperty$3(_class, "displayName", provideDisplayName("sortableList", WrappedComponent)), _defineProperty$3(_class, "defaultProps", defaultProps$1), _defineProperty$3(_class, "propTypes", propTypes), _temp;
}
var propTypes$1 = {
index: u$9.number.isRequired,
collection: u$9.oneOfType([u$9.number, u$9.string]),
disabled: u$9.bool
};
var omittedProps$1 = Object.keys(propTypes$1);
function sortableElement(WrappedComponent) {
var _class, _temp;
var config2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
withRef: false
};
return _temp = _class = function(_React$Component) {
_inherits(WithSortableElement, _React$Component);
function WithSortableElement() {
var _getPrototypeOf2;
var _this;
_classCallCheck$1(this, WithSortableElement);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(WithSortableElement)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$3(_assertThisInitialized(_assertThisInitialized(_this)), "wrappedInstance", reactExports.createRef());
return _this;
}
_createClass(WithSortableElement, [{
key: "componentDidMount",
value: function componentDidMount() {
this.register();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (this.node) {
if (prevProps.index !== this.props.index) {
this.node.sortableInfo.index = this.props.index;
}
if (prevProps.disabled !== this.props.disabled) {
this.node.sortableInfo.disabled = this.props.disabled;
}
}
if (prevProps.collection !== this.props.collection) {
this.unregister(prevProps.collection);
this.register();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.unregister();
}
}, {
key: "register",
value: function register() {
var _this$props = this.props, collection = _this$props.collection, disabled = _this$props.disabled, index2 = _this$props.index;
var node2 = reactDomExports.findDOMNode(this);
node2.sortableInfo = {
collection,
disabled,
index: index2,
manager: this.context.manager
};
this.node = node2;
this.ref = {
node: node2
};
this.context.manager.add(collection, this.ref);
}
}, {
key: "unregister",
value: function unregister() {
var collection = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props.collection;
this.context.manager.remove(collection, this.ref);
}
}, {
key: "getWrappedInstance",
value: function getWrappedInstance() {
invariant$1(config2.withRef, "To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call");
return this.wrappedInstance.current;
}
}, {
key: "render",
value: function render3() {
var ref2 = config2.withRef ? this.wrappedInstance : null;
return reactExports.createElement(WrappedComponent, _extends$3({
ref: ref2
}, omit$2(this.props, omittedProps$1)));
}
}]);
return WithSortableElement;
}(reactExports.Component), _defineProperty$3(_class, "displayName", provideDisplayName("sortableElement", WrappedComponent)), _defineProperty$3(_class, "contextType", SortableContext), _defineProperty$3(_class, "propTypes", propTypes$1), _defineProperty$3(_class, "defaultProps", {
collection: 0
}), _temp;
}
const reactSortableHoc_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
SortableContainer: sortableContainer,
SortableElement: sortableElement,
SortableHandle: sortableHandle,
arrayMove,
sortableContainer,
sortableElement,
sortableHandle
}, Symbol.toStringTag, { value: "Module" }));
const require$$11 = /* @__PURE__ */ getAugmentedNamespace(reactSortableHoc_esm);
var _createFind;
var hasRequired_createFind;
function require_createFind() {
if (hasRequired_createFind)
return _createFind;
hasRequired_createFind = 1;
var baseIteratee = require_baseIteratee(), isArrayLike2 = requireIsArrayLike(), keys3 = requireKeys();
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike2(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys3(collection);
predicate = function(key2) {
return iteratee(iterable[key2], key2, iterable);
};
}
var index2 = findIndexFunc(collection, predicate, fromIndex);
return index2 > -1 ? iterable[iteratee ? collection[index2] : index2] : void 0;
};
}
_createFind = createFind;
return _createFind;
}
var find_1;
var hasRequiredFind;
function requireFind() {
if (hasRequiredFind)
return find_1;
hasRequiredFind = 1;
var createFind = require_createFind(), findIndex = requireFindIndex();
var find2 = createFind(findIndex);
find_1 = find2;
return find_1;
}
var throttle_1;
var hasRequiredThrottle;
function requireThrottle() {
if (hasRequiredThrottle)
return throttle_1;
hasRequiredThrottle = 1;
var debounce2 = requireDebounce(), isObject2 = requireIsObject();
var FUNC_ERROR_TEXT2 = "Expected a function";
function throttle2(func, wait, options2) {
var leading = true, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT2);
}
if (isObject2(options2)) {
leading = "leading" in options2 ? !!options2.leading : leading;
trailing = "trailing" in options2 ? !!options2.trailing : trailing;
}
return debounce2(func, wait, {
"leading": leading,
"maxWait": wait,
"trailing": trailing
});
}
throttle_1 = throttle2;
return throttle_1;
}
var last_1;
var hasRequiredLast;
function requireLast() {
if (hasRequiredLast)
return last_1;
hasRequiredLast = 1;
function last(array2) {
var length2 = array2 == null ? 0 : array2.length;
return length2 ? array2[length2 - 1] : void 0;
}
last_1 = last;
return last_1;
}
var _parent;
var hasRequired_parent;
function require_parent() {
if (hasRequired_parent)
return _parent;
hasRequired_parent = 1;
var baseGet = require_baseGet(), baseSlice = require_baseSlice();
function parent(object2, path2) {
return path2.length < 2 ? object2 : baseGet(object2, baseSlice(path2, 0, -1));
}
_parent = parent;
return _parent;
}
var _baseUnset;
var hasRequired_baseUnset;
function require_baseUnset() {
if (hasRequired_baseUnset)
return _baseUnset;
hasRequired_baseUnset = 1;
var castPath = require_castPath(), last = requireLast(), parent = require_parent(), toKey2 = require_toKey();
function baseUnset(object2, path2) {
path2 = castPath(path2, object2);
object2 = parent(object2, path2);
return object2 == null || delete object2[toKey2(last(path2))];
}
_baseUnset = baseUnset;
return _baseUnset;
}
var _basePullAt;
var hasRequired_basePullAt;
function require_basePullAt() {
if (hasRequired_basePullAt)
return _basePullAt;
hasRequired_basePullAt = 1;
var baseUnset = require_baseUnset(), isIndex2 = require_isIndex();
var arrayProto2 = Array.prototype;
var splice2 = arrayProto2.splice;
function basePullAt(array2, indexes) {
var length2 = array2 ? indexes.length : 0, lastIndex = length2 - 1;
while (length2--) {
var index2 = indexes[length2];
if (length2 == lastIndex || index2 !== previous) {
var previous = index2;
if (isIndex2(index2)) {
splice2.call(array2, index2, 1);
} else {
baseUnset(array2, index2);
}
}
}
return array2;
}
_basePullAt = basePullAt;
return _basePullAt;
}
var remove_1;
var hasRequiredRemove;
function requireRemove() {
if (hasRequiredRemove)
return remove_1;
hasRequiredRemove = 1;
var baseIteratee = require_baseIteratee(), basePullAt = require_basePullAt();
function remove3(array2, predicate) {
var result = [];
if (!(array2 && array2.length)) {
return result;
}
var index2 = -1, indexes = [], length2 = array2.length;
predicate = baseIteratee(predicate, 3);
while (++index2 < length2) {
var value2 = array2[index2];
if (predicate(value2, index2, array2)) {
result.push(value2);
indexes.push(index2);
}
}
basePullAt(array2, indexes);
return result;
}
remove_1 = remove3;
return remove_1;
}
var isNil_1;
var hasRequiredIsNil;
function requireIsNil() {
if (hasRequiredIsNil)
return isNil_1;
hasRequiredIsNil = 1;
function isNil(value2) {
return value2 == null;
}
isNil_1 = isNil;
return isNil_1;
}
var _baseValues;
var hasRequired_baseValues;
function require_baseValues() {
if (hasRequired_baseValues)
return _baseValues;
hasRequired_baseValues = 1;
var arrayMap2 = require_arrayMap();
function baseValues(object2, props) {
return arrayMap2(props, function(key2) {
return object2[key2];
});
}
_baseValues = baseValues;
return _baseValues;
}
var values_1;
var hasRequiredValues;
function requireValues() {
if (hasRequiredValues)
return values_1;
hasRequiredValues = 1;
var baseValues = require_baseValues(), keys3 = requireKeys();
function values2(object2) {
return object2 == null ? [] : baseValues(object2, keys3(object2));
}
values_1 = values2;
return values_1;
}
var includes_1;
var hasRequiredIncludes;
function requireIncludes() {
if (hasRequiredIncludes)
return includes_1;
hasRequiredIncludes = 1;
var baseIndexOf2 = require_baseIndexOf(), isArrayLike2 = requireIsArrayLike(), isString2 = requireIsString(), toInteger = requireToInteger(), values2 = requireValues();
var nativeMax2 = Math.max;
function includes2(collection, value2, fromIndex, guard) {
collection = isArrayLike2(collection) ? collection : values2(collection);
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
var length2 = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax2(length2 + fromIndex, 0);
}
return isString2(collection) ? fromIndex <= length2 && collection.indexOf(value2, fromIndex) > -1 : !!length2 && baseIndexOf2(collection, value2, fromIndex) > -1;
}
includes_1 = includes2;
return includes_1;
}
var _baseRange;
var hasRequired_baseRange;
function require_baseRange() {
if (hasRequired_baseRange)
return _baseRange;
hasRequired_baseRange = 1;
var nativeCeil = Math.ceil, nativeMax2 = Math.max;
function baseRange(start2, end2, step, fromRight) {
var index2 = -1, length2 = nativeMax2(nativeCeil((end2 - start2) / (step || 1)), 0), result = Array(length2);
while (length2--) {
result[fromRight ? length2 : ++index2] = start2;
start2 += step;
}
return result;
}
_baseRange = baseRange;
return _baseRange;
}
var _createRange;
var hasRequired_createRange;
function require_createRange() {
if (hasRequired_createRange)
return _createRange;
hasRequired_createRange = 1;
var baseRange = require_baseRange(), isIterateeCall = require_isIterateeCall(), toFinite = requireToFinite();
function createRange2(fromRight) {
return function(start2, end2, step) {
if (step && typeof step != "number" && isIterateeCall(start2, end2, step)) {
end2 = step = void 0;
}
start2 = toFinite(start2);
if (end2 === void 0) {
end2 = start2;
start2 = 0;
} else {
end2 = toFinite(end2);
}
step = step === void 0 ? start2 < end2 ? 1 : -1 : toFinite(step);
return baseRange(start2, end2, step, fromRight);
};
}
_createRange = createRange2;
return _createRange;
}
var range_1;
var hasRequiredRange;
function requireRange() {
if (hasRequiredRange)
return range_1;
hasRequiredRange = 1;
var createRange2 = require_createRange();
var range2 = createRange2();
range_1 = range2;
return range_1;
}
var extendStatics$1 = function(d2, b2) {
extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
d3.__proto__ = b3;
} || function(d3, b3) {
for (var p2 in b3)
if (Object.prototype.hasOwnProperty.call(b3, p2))
d3[p2] = b3[p2];
};
return extendStatics$1(d2, b2);
};
function __extends$1(d2, b2) {
if (typeof b2 !== "function" && b2 !== null)
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
extendStatics$1(d2, b2);
function __() {
this.constructor = d2;
}
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
}
function __awaiter$1(thisArg, _arguments, P2, generator) {
function adopt(value2) {
return value2 instanceof P2 ? value2 : new P2(function(resolve3) {
resolve3(value2);
});
}
return new (P2 || (P2 = Promise))(function(resolve3, reject2) {
function fulfilled(value2) {
try {
step(generator.next(value2));
} catch (e7) {
reject2(e7);
}
}
function rejected(value2) {
try {
step(generator["throw"](value2));
} catch (e7) {
reject2(e7);
}
}
function step(result) {
result.done ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator$1(thisArg, body) {
var _24 = { label: 0, sent: function() {
if (t5[0] & 1)
throw t5[1];
return t5[1];
}, trys: [], ops: [] }, f2, y2, t5, g2;
return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
return this;
}), g2;
function verb(n2) {
return function(v2) {
return step([n2, v2]);
};
}
function step(op) {
if (f2)
throw new TypeError("Generator is already executing.");
while (g2 && (g2 = 0, op[0] && (_24 = 0)), _24)
try {
if (f2 = 1, y2 && (t5 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t5 = y2["return"]) && t5.call(y2), 0) : y2.next) && !(t5 = t5.call(y2, op[1])).done)
return t5;
if (y2 = 0, t5)
op = [op[0] & 2, t5.value];
switch (op[0]) {
case 0:
case 1:
t5 = op;
break;
case 4:
_24.label++;
return { value: op[1], done: false };
case 5:
_24.label++;
y2 = op[1];
op = [0];
continue;
case 7:
op = _24.ops.pop();
_24.trys.pop();
continue;
default:
if (!(t5 = _24.trys, t5 = t5.length > 0 && t5[t5.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_24 = 0;
continue;
}
if (op[0] === 3 && (!t5 || op[1] > t5[0] && op[1] < t5[3])) {
_24.label = op[1];
break;
}
if (op[0] === 6 && _24.label < t5[1]) {
_24.label = t5[1];
t5 = op;
break;
}
if (t5 && _24.label < t5[2]) {
_24.label = t5[2];
_24.ops.push(op);
break;
}
if (t5[2])
_24.ops.pop();
_24.trys.pop();
continue;
}
op = body.call(thisArg, _24);
} catch (e7) {
op = [6, e7];
y2 = 0;
} finally {
f2 = t5 = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __values(o2) {
var s2 = typeof Symbol === "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0;
if (m2)
return m2.call(o2);
if (o2 && typeof o2.length === "number")
return {
next: function() {
if (o2 && i2 >= o2.length)
o2 = void 0;
return { value: o2 && o2[i2++], done: !o2 };
}
};
throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o2, n2) {
var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
if (!m2)
return o2;
var i2 = m2.call(o2), r2, ar2 = [], e7;
try {
while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done)
ar2.push(r2.value);
} catch (error3) {
e7 = { error: error3 };
} finally {
try {
if (r2 && !r2.done && (m2 = i2["return"]))
m2.call(i2);
} finally {
if (e7)
throw e7.error;
}
}
return ar2;
}
function __spread() {
for (var ar2 = [], i2 = 0; i2 < arguments.length; i2++)
ar2 = ar2.concat(__read(arguments[i2]));
return ar2;
}
function __spreadArray$1(to2, from2, pack2) {
if (pack2 || arguments.length === 2)
for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) {
if (ar2 || !(i2 in from2)) {
if (!ar2)
ar2 = Array.prototype.slice.call(from2, 0, i2);
ar2[i2] = from2[i2];
}
}
return to2.concat(ar2 || Array.prototype.slice.call(from2));
}
function __await(v2) {
return this instanceof __await ? (this.v = v2, this) : new __await(v2);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = [];
return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
return this;
}, i2;
function verb(n2) {
if (g2[n2])
i2[n2] = function(v2) {
return new Promise(function(a2, b2) {
q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2);
});
};
}
function resume(n2, v2) {
try {
step(g2[n2](v2));
} catch (e7) {
settle(q2[0][3], e7);
}
}
function step(r2) {
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject2) : settle(q2[0][2], r2);
}
function fulfill(value2) {
resume("next", value2);
}
function reject2(value2) {
resume("throw", value2);
}
function settle(f2, v2) {
if (f2(v2), q2.shift(), q2.length)
resume(q2[0][0], q2[0][1]);
}
}
function __asyncValues(o2) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var m2 = o2[Symbol.asyncIterator], i2;
return m2 ? m2.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
return this;
}, i2);
function verb(n2) {
i2[n2] = o2[n2] && function(v2) {
return new Promise(function(resolve3, reject2) {
v2 = o2[n2](v2), settle(resolve3, reject2, v2.done, v2.value);
});
};
}
function settle(resolve3, reject2, d2, v2) {
Promise.resolve(v2).then(function(v3) {
resolve3({ value: v3, done: d2 });
}, reject2);
}
}
typeof SuppressedError === "function" ? SuppressedError : function(error3, suppressed, message) {
var e7 = new Error(message);
return e7.name = "SuppressedError", e7.error = error3, e7.suppressed = suppressed, e7;
};
var COMMON_MIME_TYPES = /* @__PURE__ */ new Map([
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
["aac", "audio/aac"],
["abw", "application/x-abiword"],
["arc", "application/x-freearc"],
["avif", "image/avif"],
["avi", "video/x-msvideo"],
["azw", "application/vnd.amazon.ebook"],
["bin", "application/octet-stream"],
["bmp", "image/bmp"],
["bz", "application/x-bzip"],
["bz2", "application/x-bzip2"],
["cda", "application/x-cdf"],
["csh", "application/x-csh"],
["css", "text/css"],
["csv", "text/csv"],
["doc", "application/msword"],
["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
["eot", "application/vnd.ms-fontobject"],
["epub", "application/epub+zip"],
["gz", "application/gzip"],
["gif", "image/gif"],
["htm", "text/html"],
["html", "text/html"],
["ico", "image/vnd.microsoft.icon"],
["ics", "text/calendar"],
["jar", "application/java-archive"],
["jpeg", "image/jpeg"],
["jpg", "image/jpeg"],
["js", "text/javascript"],
["json", "application/json"],
["jsonld", "application/ld+json"],
["mid", "audio/midi"],
["midi", "audio/midi"],
["mjs", "text/javascript"],
["mp3", "audio/mpeg"],
["mp4", "video/mp4"],
["mpeg", "video/mpeg"],
["mpkg", "application/vnd.apple.installer+xml"],
["odp", "application/vnd.oasis.opendocument.presentation"],
["ods", "application/vnd.oasis.opendocument.spreadsheet"],
["odt", "application/vnd.oasis.opendocument.text"],
["oga", "audio/ogg"],
["ogv", "video/ogg"],
["ogx", "application/ogg"],
["opus", "audio/opus"],
["otf", "font/otf"],
["png", "image/png"],
["pdf", "application/pdf"],
["php", "application/x-httpd-php"],
["ppt", "application/vnd.ms-powerpoint"],
["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
["rar", "application/vnd.rar"],
["rtf", "application/rtf"],
["sh", "application/x-sh"],
["svg", "image/svg+xml"],
["swf", "application/x-shockwave-flash"],
["tar", "application/x-tar"],
["tif", "image/tiff"],
["tiff", "image/tiff"],
["ts", "video/mp2t"],
["ttf", "font/ttf"],
["txt", "text/plain"],
["vsd", "application/vnd.visio"],
["wav", "audio/wav"],
["weba", "audio/webm"],
["webm", "video/webm"],
["webp", "image/webp"],
["woff", "font/woff"],
["woff2", "font/woff2"],
["xhtml", "application/xhtml+xml"],
["xls", "application/vnd.ms-excel"],
["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
["xml", "application/xml"],
["xul", "application/vnd.mozilla.xul+xml"],
["zip", "application/zip"],
["7z", "application/x-7z-compressed"],
// Others
["mkv", "video/x-matroska"],
["mov", "video/quicktime"],
["msg", "application/vnd.ms-outlook"]
]);
function toFileWithPath(file, path2) {
var f2 = withMimeType(file);
if (typeof f2.path !== "string") {
var webkitRelativePath = file.webkitRelativePath;
Object.defineProperty(f2, "path", {
value: typeof path2 === "string" ? path2 : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : file.name,
writable: false,
configurable: false,
enumerable: true
});
}
return f2;
}
function withMimeType(file) {
var name = file.name;
var hasExtension = name && name.lastIndexOf(".") !== -1;
if (hasExtension && !file.type) {
var ext = name.split(".").pop().toLowerCase();
var type2 = COMMON_MIME_TYPES.get(ext);
if (type2) {
Object.defineProperty(file, "type", {
value: type2,
writable: false,
configurable: false,
enumerable: true
});
}
}
return file;
}
var FILES_TO_IGNORE = [
// Thumbnail cache files for macOS and Windows
".DS_Store",
"Thumbs.db"
// Windows
];
function fromEvent(evt) {
return __awaiter$1(this, void 0, void 0, function() {
return __generator$1(this, function(_a2) {
if (isObject$e(evt) && isDataTransfer(evt)) {
return [2, getDataTransferFiles(evt.dataTransfer, evt.type)];
} else if (isChangeEvt(evt)) {
return [2, getInputFiles(evt)];
} else if (Array.isArray(evt) && evt.every(function(item) {
return "getFile" in item && typeof item.getFile === "function";
})) {
return [2, getFsHandleFiles(evt)];
}
return [2, []];
});
});
}
function isDataTransfer(value2) {
return isObject$e(value2.dataTransfer);
}
function isChangeEvt(value2) {
return isObject$e(value2) && isObject$e(value2.target);
}
function isObject$e(v2) {
return typeof v2 === "object" && v2 !== null;
}
function getInputFiles(evt) {
return fromList(evt.target.files).map(function(file) {
return toFileWithPath(file);
});
}
function getFsHandleFiles(handles) {
return __awaiter$1(this, void 0, void 0, function() {
var files;
return __generator$1(this, function(_a2) {
switch (_a2.label) {
case 0:
return [4, Promise.all(handles.map(function(h2) {
return h2.getFile();
}))];
case 1:
files = _a2.sent();
return [2, files.map(function(file) {
return toFileWithPath(file);
})];
}
});
});
}
function getDataTransferFiles(dt2, type2) {
return __awaiter$1(this, void 0, void 0, function() {
var items, files;
return __generator$1(this, function(_a2) {
switch (_a2.label) {
case 0:
if (dt2 === null) {
return [2, []];
}
if (!dt2.items)
return [3, 2];
items = fromList(dt2.items).filter(function(item) {
return item.kind === "file";
});
if (type2 !== "drop") {
return [2, items];
}
return [4, Promise.all(items.map(toFilePromises))];
case 1:
files = _a2.sent();
return [2, noIgnoredFiles(flatten$1(files))];
case 2:
return [2, noIgnoredFiles(fromList(dt2.files).map(function(file) {
return toFileWithPath(file);
}))];
}
});
});
}
function noIgnoredFiles(files) {
return files.filter(function(file) {
return FILES_TO_IGNORE.indexOf(file.name) === -1;
});
}
function fromList(items) {
if (items === null) {
return [];
}
var files = [];
for (var i2 = 0; i2 < items.length; i2++) {
var file = items[i2];
files.push(file);
}
return files;
}
function toFilePromises(item) {
if (typeof item.webkitGetAsEntry !== "function") {
return fromDataTransferItem(item);
}
var entry2 = item.webkitGetAsEntry();
if (entry2 && entry2.isDirectory) {
return fromDirEntry(entry2);
}
return fromDataTransferItem(item);
}
function flatten$1(items) {
return items.reduce(function(acc, files) {
return __spread(acc, Array.isArray(files) ? flatten$1(files) : [files]);
}, []);
}
function fromDataTransferItem(item) {
var file = item.getAsFile();
if (!file) {
return Promise.reject(item + " is not a File");
}
var fwp = toFileWithPath(file);
return Promise.resolve(fwp);
}
function fromEntry(entry2) {
return __awaiter$1(this, void 0, void 0, function() {
return __generator$1(this, function(_a2) {
return [2, entry2.isDirectory ? fromDirEntry(entry2) : fromFileEntry(entry2)];
});
});
}
function fromDirEntry(entry2) {
var reader = entry2.createReader();
return new Promise(function(resolve3, reject2) {
var entries = [];
function readEntries() {
var _this = this;
reader.readEntries(function(batch2) {
return __awaiter$1(_this, void 0, void 0, function() {
var files, err_1, items;
return __generator$1(this, function(_a2) {
switch (_a2.label) {
case 0:
if (!!batch2.length)
return [3, 5];
_a2.label = 1;
case 1:
_a2.trys.push([1, 3, , 4]);
return [4, Promise.all(entries)];
case 2:
files = _a2.sent();
resolve3(files);
return [3, 4];
case 3:
err_1 = _a2.sent();
reject2(err_1);
return [3, 4];
case 4:
return [3, 6];
case 5:
items = Promise.all(batch2.map(fromEntry));
entries.push(items);
readEntries();
_a2.label = 6;
case 6:
return [
2
/*return*/
];
}
});
});
}, function(err) {
reject2(err);
});
}
readEntries();
});
}
function fromFileEntry(entry2) {
return __awaiter$1(this, void 0, void 0, function() {
return __generator$1(this, function(_a2) {
return [2, new Promise(function(resolve3, reject2) {
entry2.file(function(file) {
var fwp = toFileWithPath(file, entry2.fullPath);
resolve3(fwp);
}, function(err) {
reject2(err);
});
})];
});
});
}
var es$1 = {};
var hasRequiredEs;
function requireEs() {
if (hasRequiredEs)
return es$1;
hasRequiredEs = 1;
es$1.__esModule = true;
es$1.default = function(file, acceptedFiles) {
if (file && acceptedFiles) {
var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
var fileName = file.name || "";
var mimeType = (file.type || "").toLowerCase();
var baseMimeType = mimeType.replace(/\/.*$/, "");
return acceptedFilesArray.some(function(type2) {
var validType = type2.trim().toLowerCase();
if (validType.charAt(0) === ".") {
return fileName.toLowerCase().endsWith(validType);
} else if (validType.endsWith("/*")) {
return baseMimeType === validType.replace(/\/.*$/, "");
}
return mimeType === validType;
});
}
return true;
};
return es$1;
}
var esExports = requireEs();
const accepts = /* @__PURE__ */ getDefaultExportFromCjs(esExports);
function ownKeys$c(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$a(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$c(Object(source2), true).forEach(function(key2) {
_defineProperty$1(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$c(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty$1(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
function _slicedToArray$1(arr2, i2) {
return _arrayWithHoles$1(arr2) || _iterableToArrayLimit$1(arr2, i2) || _unsupportedIterableToArray$2(arr2, i2) || _nonIterableRest$1();
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$2(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray$2(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray$2(o2, minLen);
}
function _arrayLikeToArray$2(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++) {
arr22[i2] = arr2[i2];
}
return arr22;
}
function _iterableToArrayLimit$1(arr2, i2) {
var _i2 = arr2 == null ? null : typeof Symbol !== "undefined" && arr2[Symbol.iterator] || arr2["@@iterator"];
if (_i2 == null)
return;
var _arr = [];
var _n2 = true;
var _d = false;
var _s, _e2;
try {
for (_i2 = _i2.call(arr2); !(_n2 = (_s = _i2.next()).done); _n2 = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e2 = err;
} finally {
try {
if (!_n2 && _i2["return"] != null)
_i2["return"]();
} finally {
if (_d)
throw _e2;
}
}
return _arr;
}
function _arrayWithHoles$1(arr2) {
if (Array.isArray(arr2))
return arr2;
}
var FILE_INVALID_TYPE = "file-invalid-type";
var FILE_TOO_LARGE = "file-too-large";
var FILE_TOO_SMALL = "file-too-small";
var TOO_MANY_FILES = "too-many-files";
var ErrorCode = {
FileInvalidType: FILE_INVALID_TYPE,
FileTooLarge: FILE_TOO_LARGE,
FileTooSmall: FILE_TOO_SMALL,
TooManyFiles: TOO_MANY_FILES
};
var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr2(accept) {
accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;
var messageSuffix = Array.isArray(accept) ? "one of ".concat(accept.join(", ")) : accept;
return {
code: FILE_INVALID_TYPE,
message: "File type must be ".concat(messageSuffix)
};
};
var getTooLargeRejectionErr = function getTooLargeRejectionErr2(maxSize) {
return {
code: FILE_TOO_LARGE,
message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
};
};
var getTooSmallRejectionErr = function getTooSmallRejectionErr2(minSize) {
return {
code: FILE_TOO_SMALL,
message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
};
};
var TOO_MANY_FILES_REJECTION = {
code: TOO_MANY_FILES,
message: "Too many files"
};
function fileAccepted(file, accept) {
var isAcceptable = file.type === "application/x-moz-file" || accepts(file, accept);
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
}
function fileMatchSize(file, minSize, maxSize) {
if (isDefined(file.size)) {
if (isDefined(minSize) && isDefined(maxSize)) {
if (file.size > maxSize)
return [false, getTooLargeRejectionErr(maxSize)];
if (file.size < minSize)
return [false, getTooSmallRejectionErr(minSize)];
} else if (isDefined(minSize) && file.size < minSize)
return [false, getTooSmallRejectionErr(minSize)];
else if (isDefined(maxSize) && file.size > maxSize)
return [false, getTooLargeRejectionErr(maxSize)];
}
return [true, null];
}
function isDefined(value2) {
return value2 !== void 0 && value2 !== null;
}
function allFilesAccepted(_ref3) {
var files = _ref3.files, accept = _ref3.accept, minSize = _ref3.minSize, maxSize = _ref3.maxSize, multiple = _ref3.multiple, maxFiles = _ref3.maxFiles;
if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
return false;
}
return files.every(function(file) {
var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$1(_fileAccepted, 1), accepted = _fileAccepted2[0];
var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
return accepted && sizeMatch;
});
}
function isPropagationStopped(event2) {
if (typeof event2.isPropagationStopped === "function") {
return event2.isPropagationStopped();
} else if (typeof event2.cancelBubble !== "undefined") {
return event2.cancelBubble;
}
return false;
}
function isEvtWithFiles(event2) {
if (!event2.dataTransfer) {
return !!event2.target && !!event2.target.files;
}
return Array.prototype.some.call(event2.dataTransfer.types, function(type2) {
return type2 === "Files" || type2 === "application/x-moz-file";
});
}
function onDocumentDragOver(event2) {
event2.preventDefault();
}
function isIe(userAgent2) {
return userAgent2.indexOf("MSIE") !== -1 || userAgent2.indexOf("Trident/") !== -1;
}
function isEdge(userAgent2) {
return userAgent2.indexOf("Edge/") !== -1;
}
function isIeOrEdge() {
var userAgent2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
return isIe(userAgent2) || isEdge(userAgent2);
}
function composeEventHandlers() {
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];
}
return function(event2) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return fns.some(function(fn8) {
if (!isPropagationStopped(event2) && fn8) {
fn8.apply(void 0, [event2].concat(args));
}
return isPropagationStopped(event2);
});
};
}
function canUseFileSystemAccessAPI() {
return "showOpenFilePicker" in window;
}
function filePickerOptionsTypes(accept) {
accept = typeof accept === "string" ? accept.split(",") : accept;
return [{
description: "everything",
// TODO: Need to handle filtering more elegantly than this!
accept: Array.isArray(accept) ? accept.filter(function(item) {
return item === "audio/*" || item === "video/*" || item === "image/*" || item === "text/*" || /\w+\/[-+.\w]+/g.test(item);
}).reduce(function(a2, b2) {
return _objectSpread$a(_objectSpread$a({}, a2), {}, _defineProperty$1({}, b2, []));
}, {}) : {}
}];
}
var _excluded$3 = ["children"], _excluded2$1 = ["open"], _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _excluded4 = ["refKey", "onChange", "onClick"];
function _toConsumableArray$1(arr2) {
return _arrayWithoutHoles$1(arr2) || _iterableToArray$1(arr2) || _unsupportedIterableToArray$1(arr2) || _nonIterableSpread$1();
}
function _nonIterableSpread$1() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray$1(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
function _arrayWithoutHoles$1(arr2) {
if (Array.isArray(arr2))
return _arrayLikeToArray$1(arr2);
}
function _slicedToArray(arr2, i2) {
return _arrayWithHoles(arr2) || _iterableToArrayLimit(arr2, i2) || _unsupportedIterableToArray$1(arr2, i2) || _nonIterableRest();
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$1(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray$1(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray$1(o2, minLen);
}
function _arrayLikeToArray$1(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++) {
arr22[i2] = arr2[i2];
}
return arr22;
}
function _iterableToArrayLimit(arr2, i2) {
var _i2 = arr2 == null ? null : typeof Symbol !== "undefined" && arr2[Symbol.iterator] || arr2["@@iterator"];
if (_i2 == null)
return;
var _arr = [];
var _n2 = true;
var _d = false;
var _s, _e2;
try {
for (_i2 = _i2.call(arr2); !(_n2 = (_s = _i2.next()).done); _n2 = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e2 = err;
} finally {
try {
if (!_n2 && _i2["return"] != null)
_i2["return"]();
} finally {
if (_d)
throw _e2;
}
}
return _arr;
}
function _arrayWithHoles(arr2) {
if (Array.isArray(arr2))
return arr2;
}
function ownKeys$b(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$9(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$b(Object(source2), true).forEach(function(key2) {
_defineProperty(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$b(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _defineProperty(obj, key2, value2) {
if (key2 in obj) {
Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true });
} else {
obj[key2] = value2;
}
return obj;
}
function _objectWithoutProperties(source2, excluded) {
if (source2 == null)
return {};
var target2 = _objectWithoutPropertiesLoose(source2, excluded);
var key2, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source2);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key2 = sourceSymbolKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source2, key2))
continue;
target2[key2] = source2[key2];
}
}
return target2;
}
function _objectWithoutPropertiesLoose(source2, excluded) {
if (source2 == null)
return {};
var target2 = {};
var sourceKeys = Object.keys(source2);
var key2, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key2 = sourceKeys[i2];
if (excluded.indexOf(key2) >= 0)
continue;
target2[key2] = source2[key2];
}
return target2;
}
var Dropzone = /* @__PURE__ */ reactExports.forwardRef(function(_ref3, ref2) {
var children2 = _ref3.children, params2 = _objectWithoutProperties(_ref3, _excluded$3);
var _useDropzone = useDropzone(params2), open2 = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded2$1);
reactExports.useImperativeHandle(ref2, function() {
return {
open: open2
};
}, [open2]);
return /* @__PURE__ */ React.createElement(reactExports.Fragment, null, children2(_objectSpread$9(_objectSpread$9({}, props), {}, {
open: open2
})));
});
Dropzone.displayName = "Dropzone";
var defaultProps = {
disabled: false,
getFilesFromEvent: fromEvent,
maxSize: Infinity,
minSize: 0,
multiple: true,
maxFiles: 0,
preventDropOnDocument: true,
noClick: false,
noKeyboard: false,
noDrag: false,
noDragEventsBubbling: false,
validator: null,
useFsAccessApi: false
};
Dropzone.defaultProps = defaultProps;
Dropzone.propTypes = {
/**
* Render function that exposes the dropzone state and prop getter fns
*
* @param {object} params
* @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
* @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
* @param {Function} params.open Open the native file selection dialog
* @param {boolean} params.isFocused Dropzone area is in focus
* @param {boolean} params.isFileDialogActive File dialog is opened
* @param {boolean} params.isDragActive Active drag is in progress
* @param {boolean} params.isDragAccept Dragged files are accepted
* @param {boolean} params.isDragReject Some dragged files are rejected
* @param {File[]} params.draggedFiles Files in active drag
* @param {File[]} params.acceptedFiles Accepted files
* @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
*/
children: u$9.func,
/**
* Set accepted file types.
* See https://github.com/okonet/attr-accept for more information.
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
* Windows. In some cases there might not be a mime type set at all.
* See: https://github.com/react-dropzone/react-dropzone/issues/276
*/
accept: u$9.oneOfType([u$9.string, u$9.arrayOf(u$9.string)]),
/**
* Allow drag 'n' drop (or selection from the file dialog) of multiple files
*/
multiple: u$9.bool,
/**
* If false, allow dropped items to take over the current browser window
*/
preventDropOnDocument: u$9.bool,
/**
* If true, disables click to open the native file selection dialog
*/
noClick: u$9.bool,
/**
* If true, disables SPACE/ENTER to open the native file selection dialog.
* Note that it also stops tracking the focus state.
*/
noKeyboard: u$9.bool,
/**
* If true, disables drag 'n' drop
*/
noDrag: u$9.bool,
/**
* If true, stops drag event propagation to parents
*/
noDragEventsBubbling: u$9.bool,
/**
* Minimum file size (in bytes)
*/
minSize: u$9.number,
/**
* Maximum file size (in bytes)
*/
maxSize: u$9.number,
/**
* Maximum accepted number of files
* The default value is 0 which means there is no limitation to how many files are accepted.
*/
maxFiles: u$9.number,
/**
* Enable/disable the dropzone
*/
disabled: u$9.bool,
/**
* Use this to provide a custom file aggregator
*
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
*/
getFilesFromEvent: u$9.func,
/**
* Cb for when closing the file dialog with no selection
*/
onFileDialogCancel: u$9.func,
/**
* Cb for when opening the file dialog
*/
onFileDialogOpen: u$9.func,
/**
* Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
* to open the file picker instead of using an `<input type="file">` click event.
*/
useFsAccessApi: u$9.bool,
/**
* Cb for when the `dragenter` event occurs.
*
* @param {DragEvent} event
*/
onDragEnter: u$9.func,
/**
* Cb for when the `dragleave` event occurs
*
* @param {DragEvent} event
*/
onDragLeave: u$9.func,
/**
* Cb for when the `dragover` event occurs
*
* @param {DragEvent} event
*/
onDragOver: u$9.func,
/**
* Cb for when the `drop` event occurs.
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
*
* Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
* `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
* If `multiple` is set to false and additional files are dropped,
* all files besides the first will be rejected.
* Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
*
* Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
* If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
*
* `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
* For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
*
* ```js
* function onDrop(acceptedFiles) {
* const req = request.post('/upload')
* acceptedFiles.forEach(file => {
* req.attach(file.name, file)
* })
* req.end(callback)
* }
* ```
*
* @param {File[]} acceptedFiles
* @param {FileRejection[]} fileRejections
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
*/
onDrop: u$9.func,
/**
* Cb for when the `drop` event occurs.
* Note that if no files are accepted, this callback is not invoked.
*
* @param {File[]} files
* @param {(DragEvent|Event)} event
*/
onDropAccepted: u$9.func,
/**
* Cb for when the `drop` event occurs.
* Note that if no files are rejected, this callback is not invoked.
*
* @param {FileRejection[]} fileRejections
* @param {(DragEvent|Event)} event
*/
onDropRejected: u$9.func,
/**
* Custom validation function
* @param {File} file
* @returns {FileError|FileError[]}
*/
validator: u$9.func
};
var initialState = {
isFocused: false,
isFileDialogActive: false,
isDragActive: false,
isDragAccept: false,
isDragReject: false,
draggedFiles: [],
acceptedFiles: [],
fileRejections: []
};
function useDropzone() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var _defaultProps$options = _objectSpread$9(_objectSpread$9({}, defaultProps), options2), accept = _defaultProps$options.accept, disabled = _defaultProps$options.disabled, getFilesFromEvent = _defaultProps$options.getFilesFromEvent, maxSize = _defaultProps$options.maxSize, minSize = _defaultProps$options.minSize, multiple = _defaultProps$options.multiple, maxFiles = _defaultProps$options.maxFiles, onDragEnter = _defaultProps$options.onDragEnter, onDragLeave = _defaultProps$options.onDragLeave, onDragOver = _defaultProps$options.onDragOver, onDrop = _defaultProps$options.onDrop, onDropAccepted = _defaultProps$options.onDropAccepted, onDropRejected = _defaultProps$options.onDropRejected, onFileDialogCancel = _defaultProps$options.onFileDialogCancel, onFileDialogOpen = _defaultProps$options.onFileDialogOpen, useFsAccessApi = _defaultProps$options.useFsAccessApi, preventDropOnDocument = _defaultProps$options.preventDropOnDocument, noClick = _defaultProps$options.noClick, noKeyboard = _defaultProps$options.noKeyboard, noDrag = _defaultProps$options.noDrag, noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling, validator = _defaultProps$options.validator;
var onFileDialogOpenCb = reactExports.useMemo(function() {
return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop$9;
}, [onFileDialogOpen]);
var onFileDialogCancelCb = reactExports.useMemo(function() {
return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop$9;
}, [onFileDialogCancel]);
var rootRef = reactExports.useRef(null);
var inputRef = reactExports.useRef(null);
var _useReducer = reactExports.useReducer(reducer, initialState), _useReducer2 = _slicedToArray(_useReducer, 2), state = _useReducer2[0], dispatch2 = _useReducer2[1];
var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive, draggedFiles = state.draggedFiles;
var onWindowFocus = function onWindowFocus2() {
if (isFileDialogActive) {
setTimeout(function() {
if (inputRef.current) {
var files = inputRef.current.files;
if (!files.length) {
dispatch2({
type: "closeDialog"
});
onFileDialogCancelCb();
}
}
}, 300);
}
};
reactExports.useEffect(function() {
if (useFsAccessApi && canUseFileSystemAccessAPI()) {
return function() {
};
}
window.addEventListener("focus", onWindowFocus, false);
return function() {
window.removeEventListener("focus", onWindowFocus, false);
};
}, [inputRef, isFileDialogActive, onFileDialogCancelCb, useFsAccessApi]);
var dragTargetsRef = reactExports.useRef([]);
var onDocumentDrop = function onDocumentDrop2(event2) {
if (rootRef.current && rootRef.current.contains(event2.target)) {
return;
}
event2.preventDefault();
dragTargetsRef.current = [];
};
reactExports.useEffect(function() {
if (preventDropOnDocument) {
document.addEventListener("dragover", onDocumentDragOver, false);
document.addEventListener("drop", onDocumentDrop, false);
}
return function() {
if (preventDropOnDocument) {
document.removeEventListener("dragover", onDocumentDragOver);
document.removeEventListener("drop", onDocumentDrop);
}
};
}, [rootRef, preventDropOnDocument]);
var onDragEnterCb = reactExports.useCallback(function(event2) {
event2.preventDefault();
event2.persist();
stopPropagation2(event2);
dragTargetsRef.current = [].concat(_toConsumableArray$1(dragTargetsRef.current), [event2.target]);
if (isEvtWithFiles(event2)) {
Promise.resolve(getFilesFromEvent(event2)).then(function(draggedFiles2) {
if (isPropagationStopped(event2) && !noDragEventsBubbling) {
return;
}
dispatch2({
draggedFiles: draggedFiles2,
isDragActive: true,
type: "setDraggedFiles"
});
if (onDragEnter) {
onDragEnter(event2);
}
});
}
}, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);
var onDragOverCb = reactExports.useCallback(function(event2) {
event2.preventDefault();
event2.persist();
stopPropagation2(event2);
var hasFiles = isEvtWithFiles(event2);
if (hasFiles && event2.dataTransfer) {
try {
event2.dataTransfer.dropEffect = "copy";
} catch (_unused) {
}
}
if (hasFiles && onDragOver) {
onDragOver(event2);
}
return false;
}, [onDragOver, noDragEventsBubbling]);
var onDragLeaveCb = reactExports.useCallback(function(event2) {
event2.preventDefault();
event2.persist();
stopPropagation2(event2);
var targets = dragTargetsRef.current.filter(function(target2) {
return rootRef.current && rootRef.current.contains(target2);
});
var targetIdx = targets.indexOf(event2.target);
if (targetIdx !== -1) {
targets.splice(targetIdx, 1);
}
dragTargetsRef.current = targets;
if (targets.length > 0) {
return;
}
dispatch2({
isDragActive: false,
type: "setDraggedFiles",
draggedFiles: []
});
if (isEvtWithFiles(event2) && onDragLeave) {
onDragLeave(event2);
}
}, [rootRef, onDragLeave, noDragEventsBubbling]);
var setFiles = reactExports.useCallback(function(files, event2) {
var acceptedFiles = [];
var fileRejections = [];
files.forEach(function(file) {
var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
var customErrors = validator ? validator(file) : null;
if (accepted && sizeMatch && !customErrors) {
acceptedFiles.push(file);
} else {
var errors = [acceptError, sizeError];
if (customErrors) {
errors = errors.concat(customErrors);
}
fileRejections.push({
file,
errors: errors.filter(function(e7) {
return e7;
})
});
}
});
if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {
acceptedFiles.forEach(function(file) {
fileRejections.push({
file,
errors: [TOO_MANY_FILES_REJECTION]
});
});
acceptedFiles.splice(0);
}
dispatch2({
acceptedFiles,
fileRejections,
type: "setFiles"
});
if (onDrop) {
onDrop(acceptedFiles, fileRejections, event2);
}
if (fileRejections.length > 0 && onDropRejected) {
onDropRejected(fileRejections, event2);
}
if (acceptedFiles.length > 0 && onDropAccepted) {
onDropAccepted(acceptedFiles, event2);
}
}, [dispatch2, multiple, accept, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);
var onDropCb = reactExports.useCallback(function(event2) {
event2.preventDefault();
event2.persist();
stopPropagation2(event2);
dragTargetsRef.current = [];
if (isEvtWithFiles(event2)) {
Promise.resolve(getFilesFromEvent(event2)).then(function(files) {
if (isPropagationStopped(event2) && !noDragEventsBubbling) {
return;
}
setFiles(files, event2);
});
}
dispatch2({
type: "reset"
});
}, [getFilesFromEvent, setFiles, noDragEventsBubbling]);
var openFileDialog = reactExports.useCallback(function() {
if (useFsAccessApi && canUseFileSystemAccessAPI()) {
dispatch2({
type: "openDialog"
});
onFileDialogOpenCb();
var opts = {
multiple,
types: filePickerOptionsTypes(accept)
};
window.showOpenFilePicker(opts).then(function(handles) {
return getFilesFromEvent(handles);
}).then(function(files) {
return setFiles(files, null);
}).catch(function(e7) {
return onFileDialogCancelCb(e7);
}).finally(function() {
return dispatch2({
type: "closeDialog"
});
});
return;
}
if (inputRef.current) {
dispatch2({
type: "openDialog"
});
onFileDialogOpenCb();
inputRef.current.value = null;
inputRef.current.click();
}
}, [dispatch2, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, accept, multiple]);
var onKeyDownCb = reactExports.useCallback(function(event2) {
if (!rootRef.current || !rootRef.current.isEqualNode(event2.target)) {
return;
}
if (event2.keyCode === 32 || event2.keyCode === 13) {
event2.preventDefault();
openFileDialog();
}
}, [rootRef, inputRef, openFileDialog]);
var onFocusCb = reactExports.useCallback(function() {
dispatch2({
type: "focus"
});
}, []);
var onBlurCb = reactExports.useCallback(function() {
dispatch2({
type: "blur"
});
}, []);
var onClickCb = reactExports.useCallback(function() {
if (noClick) {
return;
}
if (isIeOrEdge()) {
setTimeout(openFileDialog, 0);
} else {
openFileDialog();
}
}, [inputRef, noClick, openFileDialog]);
var composeHandler = function composeHandler2(fn8) {
return disabled ? null : fn8;
};
var composeKeyboardHandler = function composeKeyboardHandler2(fn8) {
return noKeyboard ? null : composeHandler(fn8);
};
var composeDragHandler = function composeDragHandler2(fn8) {
return noDrag ? null : composeHandler(fn8);
};
var stopPropagation2 = function stopPropagation3(event2) {
if (noDragEventsBubbling) {
event2.stopPropagation();
}
};
var getRootProps = reactExports.useMemo(function() {
return function() {
var _ref22 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref22.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref22.role, onKeyDown = _ref22.onKeyDown, onFocus2 = _ref22.onFocus, onBlur = _ref22.onBlur, onClick = _ref22.onClick, onDragEnter2 = _ref22.onDragEnter, onDragOver2 = _ref22.onDragOver, onDragLeave2 = _ref22.onDragLeave, onDrop2 = _ref22.onDrop, rest = _objectWithoutProperties(_ref22, _excluded3);
return _objectSpread$9(_objectSpread$9(_defineProperty({
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus2, onFocusCb)),
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter2, onDragEnterCb)),
onDragOver: composeDragHandler(composeEventHandlers(onDragOver2, onDragOverCb)),
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave2, onDragLeaveCb)),
onDrop: composeDragHandler(composeEventHandlers(onDrop2, onDropCb)),
role: typeof role === "string" && role !== "" ? role : "button"
}, refKey, rootRef), !disabled && !noKeyboard ? {
tabIndex: 0
} : {}), rest);
};
}, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);
var onInputElementClick = reactExports.useCallback(function(event2) {
event2.stopPropagation();
}, []);
var getInputProps = reactExports.useMemo(function() {
return function() {
var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange2 = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4);
var inputProps = _defineProperty({
accept,
multiple,
type: "file",
style: {
display: "none"
},
onChange: composeHandler(composeEventHandlers(onChange2, onDropCb)),
onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
autoComplete: "off",
tabIndex: -1
}, refKey, inputRef);
return _objectSpread$9(_objectSpread$9({}, inputProps), rest);
};
}, [inputRef, accept, multiple, onDropCb, disabled]);
var fileCount = draggedFiles.length;
var isDragAccept = fileCount > 0 && allFilesAccepted({
files: draggedFiles,
accept,
minSize,
maxSize,
multiple,
maxFiles
});
var isDragReject = fileCount > 0 && !isDragAccept;
return _objectSpread$9(_objectSpread$9({}, state), {}, {
isDragAccept,
isDragReject,
isFocused: isFocused && !disabled,
getRootProps,
getInputProps,
rootRef,
inputRef,
open: composeHandler(openFileDialog)
});
}
function reducer(state, action) {
switch (action.type) {
case "focus":
return _objectSpread$9(_objectSpread$9({}, state), {}, {
isFocused: true
});
case "blur":
return _objectSpread$9(_objectSpread$9({}, state), {}, {
isFocused: false
});
case "openDialog":
return _objectSpread$9(_objectSpread$9({}, initialState), {}, {
isFileDialogActive: true
});
case "closeDialog":
return _objectSpread$9(_objectSpread$9({}, state), {}, {
isFileDialogActive: false
});
case "setDraggedFiles":
var isDragActive = action.isDragActive, draggedFiles = action.draggedFiles;
return _objectSpread$9(_objectSpread$9({}, state), {}, {
draggedFiles,
isDragActive
});
case "setFiles":
return _objectSpread$9(_objectSpread$9({}, state), {}, {
acceptedFiles: action.acceptedFiles,
fileRejections: action.fileRejections
});
case "reset":
return _objectSpread$9({}, initialState);
default:
return state;
}
}
function noop$9() {
}
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
ErrorCode,
default: Dropzone,
useDropzone
}, Symbol.toStringTag, { value: "Module" }));
const require$$8 = /* @__PURE__ */ getAugmentedNamespace(es);
var splide_cjs = {};
/*!
* Splide.js
* Version : 4.1.4
* License : MIT
* Copyright: 2022 Naotoshi Fujita
*/
var hasRequiredSplide_cjs;
function requireSplide_cjs() {
if (hasRequiredSplide_cjs)
return splide_cjs;
hasRequiredSplide_cjs = 1;
(function(exports) {
function _defineProperties2(target2, props) {
for (var i2 = 0; i2 < props.length; i2++) {
var descriptor = props[i2];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target2, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties2(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
Object.defineProperty(exports, "__esModule", {
value: true
});
var MEDIA_PREFERS_REDUCED_MOTION = "(prefers-reduced-motion: reduce)";
var CREATED = 1;
var MOUNTED = 2;
var IDLE = 3;
var MOVING = 4;
var SCROLLING = 5;
var DRAGGING = 6;
var DESTROYED = 7;
var STATES = {
CREATED,
MOUNTED,
IDLE,
MOVING,
SCROLLING,
DRAGGING,
DESTROYED
};
function empty2(array2) {
array2.length = 0;
}
function slice2(arrayLike, start2, end2) {
return Array.prototype.slice.call(arrayLike, start2, end2);
}
function apply2(func) {
return func.bind.apply(func, [null].concat(slice2(arguments, 1)));
}
var nextTick2 = setTimeout;
var noop3 = function noop4() {
};
function raf2(func) {
return requestAnimationFrame(func);
}
function typeOf(type2, subject) {
return typeof subject === type2;
}
function isObject2(subject) {
return !isNull(subject) && typeOf("object", subject);
}
var isArray3 = Array.isArray;
var isFunction2 = apply2(typeOf, "function");
var isString2 = apply2(typeOf, "string");
var isUndefined2 = apply2(typeOf, "undefined");
function isNull(subject) {
return subject === null;
}
function isHTMLElement2(subject) {
try {
return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement;
} catch (e7) {
return false;
}
}
function toArray2(value2) {
return isArray3(value2) ? value2 : [value2];
}
function forEach(values2, iteratee) {
toArray2(values2).forEach(iteratee);
}
function includes2(array2, value2) {
return array2.indexOf(value2) > -1;
}
function push2(array2, items) {
array2.push.apply(array2, toArray2(items));
return array2;
}
function toggleClass(elm, classes, add3) {
if (elm) {
forEach(classes, function(name) {
if (name) {
elm.classList[add3 ? "add" : "remove"](name);
}
});
}
}
function addClass2(elm, classes) {
toggleClass(elm, isString2(classes) ? classes.split(" ") : classes, true);
}
function append2(parent, children3) {
forEach(children3, parent.appendChild.bind(parent));
}
function before(nodes, ref2) {
forEach(nodes, function(node2) {
var parent = (ref2 || node2).parentNode;
if (parent) {
parent.insertBefore(node2, ref2);
}
});
}
function matches(elm, selector) {
return isHTMLElement2(elm) && (elm["msMatchesSelector"] || elm.matches).call(elm, selector);
}
function children2(parent, selector) {
var children22 = parent ? slice2(parent.children) : [];
return selector ? children22.filter(function(child2) {
return matches(child2, selector);
}) : children22;
}
function child(parent, selector) {
return selector ? children2(parent, selector)[0] : parent.firstElementChild;
}
var ownKeys3 = Object.keys;
function forOwn(object2, iteratee, right2) {
if (object2) {
(right2 ? ownKeys3(object2).reverse() : ownKeys3(object2)).forEach(function(key2) {
key2 !== "__proto__" && iteratee(object2[key2], key2);
});
}
return object2;
}
function assign2(object2) {
slice2(arguments, 1).forEach(function(source2) {
forOwn(source2, function(value2, key2) {
object2[key2] = source2[key2];
});
});
return object2;
}
function merge2(object2) {
slice2(arguments, 1).forEach(function(source2) {
forOwn(source2, function(value2, key2) {
if (isArray3(value2)) {
object2[key2] = value2.slice();
} else if (isObject2(value2)) {
object2[key2] = merge2({}, isObject2(object2[key2]) ? object2[key2] : {}, value2);
} else {
object2[key2] = value2;
}
});
});
return object2;
}
function omit2(object2, keys3) {
forEach(keys3 || ownKeys3(object2), function(key2) {
delete object2[key2];
});
}
function removeAttribute(elms, attrs) {
forEach(elms, function(elm) {
forEach(attrs, function(attr2) {
elm && elm.removeAttribute(attr2);
});
});
}
function setAttribute2(elms, attrs, value2) {
if (isObject2(attrs)) {
forOwn(attrs, function(value22, name) {
setAttribute2(elms, name, value22);
});
} else {
forEach(elms, function(elm) {
isNull(value2) || value2 === "" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value2));
});
}
}
function create4(tag, attrs, parent) {
var elm = document.createElement(tag);
if (attrs) {
isString2(attrs) ? addClass2(elm, attrs) : setAttribute2(elm, attrs);
}
parent && append2(parent, elm);
return elm;
}
function style2(elm, prop, value2) {
if (isUndefined2(value2)) {
return getComputedStyle(elm)[prop];
}
if (!isNull(value2)) {
elm.style[prop] = "" + value2;
}
}
function display2(elm, display22) {
style2(elm, "display", display22);
}
function focus(elm) {
elm["setActive"] && elm["setActive"]() || elm.focus({
preventScroll: true
});
}
function getAttribute(elm, attr2) {
return elm.getAttribute(attr2);
}
function hasClass2(elm, className) {
return elm && elm.classList.contains(className);
}
function rect2(target2) {
return target2.getBoundingClientRect();
}
function remove3(nodes) {
forEach(nodes, function(node2) {
if (node2 && node2.parentNode) {
node2.parentNode.removeChild(node2);
}
});
}
function parseHtml(html2) {
return child(new DOMParser().parseFromString(html2, "text/html").body);
}
function prevent2(e7, stopPropagation2) {
e7.preventDefault();
if (stopPropagation2) {
e7.stopPropagation();
e7.stopImmediatePropagation();
}
}
function query(parent, selector) {
return parent && parent.querySelector(selector);
}
function queryAll(parent, selector) {
return selector ? slice2(parent.querySelectorAll(selector)) : [];
}
function removeClass3(elm, classes) {
toggleClass(elm, classes, false);
}
function timeOf(e7) {
return e7.timeStamp;
}
function unit2(value2) {
return isString2(value2) ? value2 : value2 ? value2 + "px" : "";
}
var PROJECT_CODE = "splide";
var DATA_ATTRIBUTE = "data-" + PROJECT_CODE;
function assert2(condition, message) {
if (!condition) {
throw new Error("[" + PROJECT_CODE + "] " + (message || ""));
}
}
var min2 = Math.min, max2 = Math.max, floor2 = Math.floor, ceil2 = Math.ceil, abs2 = Math.abs;
function approximatelyEqual(x2, y2, epsilon3) {
return abs2(x2 - y2) < epsilon3;
}
function between(number2, x2, y2, exclusive) {
var minimum = min2(x2, y2);
var maximum = max2(x2, y2);
return exclusive ? minimum < number2 && number2 < maximum : minimum <= number2 && number2 <= maximum;
}
function clamp2(number2, x2, y2) {
var minimum = min2(x2, y2);
var maximum = max2(x2, y2);
return min2(max2(minimum, number2), maximum);
}
function sign2(x2) {
return +(x2 > 0) - +(x2 < 0);
}
function camelToKebab(string2) {
return string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
}
function format2(string2, replacements) {
forEach(replacements, function(replacement2) {
string2 = string2.replace("%s", "" + replacement2);
});
return string2;
}
function pad2(number2) {
return number2 < 10 ? "0" + number2 : "" + number2;
}
var ids2 = {};
function uniqueId(prefix2) {
return "" + prefix2 + pad2(ids2[prefix2] = (ids2[prefix2] || 0) + 1);
}
function EventBinder() {
var listeners = [];
function bind2(targets, events2, callback, options2) {
forEachEvent(targets, events2, function(target2, event2, namespace) {
var isEventTarget = "addEventListener" in target2;
var remover = isEventTarget ? target2.removeEventListener.bind(target2, event2, callback, options2) : target2["removeListener"].bind(target2, callback);
isEventTarget ? target2.addEventListener(event2, callback, options2) : target2["addListener"](callback);
listeners.push([target2, event2, namespace, callback, remover]);
});
}
function unbind(targets, events2, callback) {
forEachEvent(targets, events2, function(target2, event2, namespace) {
listeners = listeners.filter(function(listener2) {
if (listener2[0] === target2 && listener2[1] === event2 && listener2[2] === namespace && (!callback || listener2[3] === callback)) {
listener2[4]();
return false;
}
return true;
});
});
}
function dispatch2(target2, type2, detail) {
var e7;
var bubbles = true;
if (typeof CustomEvent === "function") {
e7 = new CustomEvent(type2, {
bubbles,
detail
});
} else {
e7 = document.createEvent("CustomEvent");
e7.initCustomEvent(type2, bubbles, false, detail);
}
target2.dispatchEvent(e7);
return e7;
}
function forEachEvent(targets, events2, iteratee) {
forEach(targets, function(target2) {
target2 && forEach(events2, function(events22) {
events22.split(" ").forEach(function(eventNS) {
var fragment = eventNS.split(".");
iteratee(target2, fragment[0], fragment[1]);
});
});
});
}
function destroy() {
listeners.forEach(function(data2) {
data2[4]();
});
empty2(listeners);
}
return {
bind: bind2,
unbind,
dispatch: dispatch2,
destroy
};
}
var EVENT_MOUNTED = "mounted";
var EVENT_READY = "ready";
var EVENT_MOVE = "move";
var EVENT_MOVED = "moved";
var EVENT_CLICK = "click";
var EVENT_ACTIVE = "active";
var EVENT_INACTIVE = "inactive";
var EVENT_VISIBLE = "visible";
var EVENT_HIDDEN = "hidden";
var EVENT_REFRESH = "refresh";
var EVENT_UPDATED = "updated";
var EVENT_RESIZE = "resize";
var EVENT_RESIZED = "resized";
var EVENT_DRAG = "drag";
var EVENT_DRAGGING = "dragging";
var EVENT_DRAGGED = "dragged";
var EVENT_SCROLL = "scroll";
var EVENT_SCROLLED = "scrolled";
var EVENT_OVERFLOW = "overflow";
var EVENT_DESTROY = "destroy";
var EVENT_ARROWS_MOUNTED = "arrows:mounted";
var EVENT_ARROWS_UPDATED = "arrows:updated";
var EVENT_PAGINATION_MOUNTED = "pagination:mounted";
var EVENT_PAGINATION_UPDATED = "pagination:updated";
var EVENT_NAVIGATION_MOUNTED = "navigation:mounted";
var EVENT_AUTOPLAY_PLAY = "autoplay:play";
var EVENT_AUTOPLAY_PLAYING = "autoplay:playing";
var EVENT_AUTOPLAY_PAUSE = "autoplay:pause";
var EVENT_LAZYLOAD_LOADED = "lazyload:loaded";
var EVENT_SLIDE_KEYDOWN = "sk";
var EVENT_SHIFTED = "sh";
var EVENT_END_INDEX_CHANGED = "ei";
function EventInterface(Splide2) {
var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment();
var binder = EventBinder();
function on2(events2, callback) {
binder.bind(bus, toArray2(events2).join(" "), function(e7) {
callback.apply(callback, isArray3(e7.detail) ? e7.detail : []);
});
}
function emit2(event2) {
binder.dispatch(bus, event2, slice2(arguments, 1));
}
if (Splide2) {
Splide2.event.on(EVENT_DESTROY, binder.destroy);
}
return assign2(binder, {
bus,
on: on2,
off: apply2(binder.unbind, bus),
emit: emit2
});
}
function RequestInterval(interval2, onInterval, onUpdate, limit2) {
var now2 = Date.now;
var startTime;
var rate = 0;
var id;
var paused = true;
var count2 = 0;
function update2() {
if (!paused) {
rate = interval2 ? min2((now2() - startTime) / interval2, 1) : 1;
onUpdate && onUpdate(rate);
if (rate >= 1) {
onInterval();
startTime = now2();
if (limit2 && ++count2 >= limit2) {
return pause();
}
}
id = raf2(update2);
}
}
function start2(resume) {
resume || cancel();
startTime = now2() - (resume ? rate * interval2 : 0);
paused = false;
id = raf2(update2);
}
function pause() {
paused = true;
}
function rewind() {
startTime = now2();
rate = 0;
if (onUpdate) {
onUpdate(rate);
}
}
function cancel() {
id && cancelAnimationFrame(id);
rate = 0;
id = 0;
paused = true;
}
function set2(time2) {
interval2 = time2;
}
function isPaused() {
return paused;
}
return {
start: start2,
rewind,
pause,
cancel,
set: set2,
isPaused
};
}
function State(initialState2) {
var state = initialState2;
function set2(value2) {
state = value2;
}
function is2(states) {
return includes2(toArray2(states), state);
}
return {
set: set2,
is: is2
};
}
function Throttle(func, duration2) {
var interval2 = RequestInterval(duration2 || 0, func, null, 1);
return function() {
interval2.isPaused() && interval2.start();
};
}
function Media(Splide2, Components2, options2) {
var state = Splide2.state;
var breakpoints = options2.breakpoints || {};
var reducedMotion = options2.reducedMotion || {};
var binder = EventBinder();
var queries = [];
function setup2() {
var isMin = options2.mediaQuery === "min";
ownKeys3(breakpoints).sort(function(n2, m2) {
return isMin ? +n2 - +m2 : +m2 - +n2;
}).forEach(function(key2) {
register(breakpoints[key2], "(" + (isMin ? "min" : "max") + "-width:" + key2 + "px)");
});
register(reducedMotion, MEDIA_PREFERS_REDUCED_MOTION);
update2();
}
function destroy(completely) {
if (completely) {
binder.destroy();
}
}
function register(options22, query2) {
var queryList = matchMedia(query2);
binder.bind(queryList, "change", update2);
queries.push([options22, queryList]);
}
function update2() {
var destroyed = state.is(DESTROYED);
var direction2 = options2.direction;
var merged = queries.reduce(function(merged2, entry2) {
return merge2(merged2, entry2[1].matches ? entry2[0] : {});
}, {});
omit2(options2);
set2(merged);
if (options2.destroy) {
Splide2.destroy(options2.destroy === "completely");
} else if (destroyed) {
destroy(true);
Splide2.mount();
} else {
direction2 !== options2.direction && Splide2.refresh();
}
}
function reduce2(enable) {
if (matchMedia(MEDIA_PREFERS_REDUCED_MOTION).matches) {
enable ? merge2(options2, reducedMotion) : omit2(options2, ownKeys3(reducedMotion));
}
}
function set2(opts, base2, notify2) {
merge2(options2, opts);
base2 && merge2(Object.getPrototypeOf(options2), opts);
if (notify2 || !state.is(CREATED)) {
Splide2.emit(EVENT_UPDATED, options2);
}
}
return {
setup: setup2,
destroy,
reduce: reduce2,
set: set2
};
}
var ARROW = "Arrow";
var ARROW_LEFT = ARROW + "Left";
var ARROW_RIGHT = ARROW + "Right";
var ARROW_UP = ARROW + "Up";
var ARROW_DOWN = ARROW + "Down";
var LTR = "ltr";
var RTL = "rtl";
var TTB = "ttb";
var ORIENTATION_MAP = {
width: ["height"],
left: ["top", "right"],
right: ["bottom", "left"],
x: ["y"],
X: ["Y"],
Y: ["X"],
ArrowLeft: [ARROW_UP, ARROW_RIGHT],
ArrowRight: [ARROW_DOWN, ARROW_LEFT]
};
function Direction2(Splide2, Components2, options2) {
function resolve3(prop, axisOnly, direction2) {
direction2 = direction2 || options2.direction;
var index2 = direction2 === RTL && !axisOnly ? 1 : direction2 === TTB ? 0 : -1;
return ORIENTATION_MAP[prop] && ORIENTATION_MAP[prop][index2] || prop.replace(/width|left|right/i, function(match2, offset2) {
var replacement2 = ORIENTATION_MAP[match2.toLowerCase()][index2] || match2;
return offset2 > 0 ? replacement2.charAt(0).toUpperCase() + replacement2.slice(1) : replacement2;
});
}
function orient(value2) {
return value2 * (options2.direction === RTL ? 1 : -1);
}
return {
resolve: resolve3,
orient
};
}
var ROLE = "role";
var TAB_INDEX = "tabindex";
var DISABLED2 = "disabled";
var ARIA_PREFIX = "aria-";
var ARIA_CONTROLS = ARIA_PREFIX + "controls";
var ARIA_CURRENT = ARIA_PREFIX + "current";
var ARIA_SELECTED = ARIA_PREFIX + "selected";
var ARIA_LABEL2 = ARIA_PREFIX + "label";
var ARIA_LABELLEDBY = ARIA_PREFIX + "labelledby";
var ARIA_HIDDEN2 = ARIA_PREFIX + "hidden";
var ARIA_ORIENTATION = ARIA_PREFIX + "orientation";
var ARIA_ROLEDESCRIPTION2 = ARIA_PREFIX + "roledescription";
var ARIA_LIVE = ARIA_PREFIX + "live";
var ARIA_BUSY = ARIA_PREFIX + "busy";
var ARIA_ATOMIC = ARIA_PREFIX + "atomic";
var ALL_ATTRIBUTES = [ROLE, TAB_INDEX, DISABLED2, ARIA_CONTROLS, ARIA_CURRENT, ARIA_LABEL2, ARIA_LABELLEDBY, ARIA_HIDDEN2, ARIA_ORIENTATION, ARIA_ROLEDESCRIPTION2];
var CLASS_PREFIX = PROJECT_CODE + "__";
var STATUS_CLASS_PREFIX = "is-";
var CLASS_ROOT = PROJECT_CODE;
var CLASS_TRACK = CLASS_PREFIX + "track";
var CLASS_LIST = CLASS_PREFIX + "list";
var CLASS_SLIDE = CLASS_PREFIX + "slide";
var CLASS_CLONE = CLASS_SLIDE + "--clone";
var CLASS_CONTAINER = CLASS_SLIDE + "__container";
var CLASS_ARROWS = CLASS_PREFIX + "arrows";
var CLASS_ARROW = CLASS_PREFIX + "arrow";
var CLASS_ARROW_PREV = CLASS_ARROW + "--prev";
var CLASS_ARROW_NEXT = CLASS_ARROW + "--next";
var CLASS_PAGINATION = CLASS_PREFIX + "pagination";
var CLASS_PAGINATION_PAGE = CLASS_PAGINATION + "__page";
var CLASS_PROGRESS = CLASS_PREFIX + "progress";
var CLASS_PROGRESS_BAR = CLASS_PROGRESS + "__bar";
var CLASS_TOGGLE = CLASS_PREFIX + "toggle";
var CLASS_TOGGLE_PLAY = CLASS_TOGGLE + "__play";
var CLASS_TOGGLE_PAUSE = CLASS_TOGGLE + "__pause";
var CLASS_SPINNER = CLASS_PREFIX + "spinner";
var CLASS_SR = CLASS_PREFIX + "sr";
var CLASS_INITIALIZED = STATUS_CLASS_PREFIX + "initialized";
var CLASS_ACTIVE = STATUS_CLASS_PREFIX + "active";
var CLASS_PREV = STATUS_CLASS_PREFIX + "prev";
var CLASS_NEXT = STATUS_CLASS_PREFIX + "next";
var CLASS_VISIBLE = STATUS_CLASS_PREFIX + "visible";
var CLASS_LOADING = STATUS_CLASS_PREFIX + "loading";
var CLASS_FOCUS_IN = STATUS_CLASS_PREFIX + "focus-in";
var CLASS_OVERFLOW = STATUS_CLASS_PREFIX + "overflow";
var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN, CLASS_OVERFLOW];
var CLASSES = {
slide: CLASS_SLIDE,
clone: CLASS_CLONE,
arrows: CLASS_ARROWS,
arrow: CLASS_ARROW,
prev: CLASS_ARROW_PREV,
next: CLASS_ARROW_NEXT,
pagination: CLASS_PAGINATION,
page: CLASS_PAGINATION_PAGE,
spinner: CLASS_SPINNER
};
function closest2(from2, selector) {
if (isFunction2(from2.closest)) {
return from2.closest(selector);
}
var elm = from2;
while (elm && elm.nodeType === 1) {
if (matches(elm, selector)) {
break;
}
elm = elm.parentElement;
}
return elm;
}
var FRICTION = 5;
var LOG_INTERVAL = 200;
var POINTER_DOWN_EVENTS = "touchstart mousedown";
var POINTER_MOVE_EVENTS = "touchmove mousemove";
var POINTER_UP_EVENTS = "touchend touchcancel mouseup click";
function Elements(Splide2, Components2, options2) {
var _EventInterface = EventInterface(Splide2), on2 = _EventInterface.on, bind2 = _EventInterface.bind;
var root2 = Splide2.root;
var i18n = options2.i18n;
var elements2 = {};
var slides = [];
var rootClasses = [];
var trackClasses = [];
var track;
var list;
var isUsingKey;
function setup2() {
collect2();
init3();
update2();
}
function mount() {
on2(EVENT_REFRESH, destroy);
on2(EVENT_REFRESH, setup2);
on2(EVENT_UPDATED, update2);
bind2(document, POINTER_DOWN_EVENTS + " keydown", function(e7) {
isUsingKey = e7.type === "keydown";
}, {
capture: true
});
bind2(root2, "focusin", function() {
toggleClass(root2, CLASS_FOCUS_IN, !!isUsingKey);
});
}
function destroy(completely) {
var attrs = ALL_ATTRIBUTES.concat("style");
empty2(slides);
removeClass3(root2, rootClasses);
removeClass3(track, trackClasses);
removeAttribute([track, list], attrs);
removeAttribute(root2, completely ? attrs : ["style", ARIA_ROLEDESCRIPTION2]);
}
function update2() {
removeClass3(root2, rootClasses);
removeClass3(track, trackClasses);
rootClasses = getClasses(CLASS_ROOT);
trackClasses = getClasses(CLASS_TRACK);
addClass2(root2, rootClasses);
addClass2(track, trackClasses);
setAttribute2(root2, ARIA_LABEL2, options2.label);
setAttribute2(root2, ARIA_LABELLEDBY, options2.labelledby);
}
function collect2() {
track = find2("." + CLASS_TRACK);
list = child(track, "." + CLASS_LIST);
assert2(track && list, "A track/list element is missing.");
push2(slides, children2(list, "." + CLASS_SLIDE + ":not(." + CLASS_CLONE + ")"));
forOwn({
arrows: CLASS_ARROWS,
pagination: CLASS_PAGINATION,
prev: CLASS_ARROW_PREV,
next: CLASS_ARROW_NEXT,
bar: CLASS_PROGRESS_BAR,
toggle: CLASS_TOGGLE
}, function(className, key2) {
elements2[key2] = find2("." + className);
});
assign2(elements2, {
root: root2,
track,
list,
slides
});
}
function init3() {
var id = root2.id || uniqueId(PROJECT_CODE);
var role = options2.role;
root2.id = id;
track.id = track.id || id + "-track";
list.id = list.id || id + "-list";
if (!getAttribute(root2, ROLE) && root2.tagName !== "SECTION" && role) {
setAttribute2(root2, ROLE, role);
}
setAttribute2(root2, ARIA_ROLEDESCRIPTION2, i18n.carousel);
setAttribute2(list, ROLE, "presentation");
}
function find2(selector) {
var elm = query(root2, selector);
return elm && closest2(elm, "." + CLASS_ROOT) === root2 ? elm : void 0;
}
function getClasses(base2) {
return [base2 + "--" + options2.type, base2 + "--" + options2.direction, options2.drag && base2 + "--draggable", options2.isNavigation && base2 + "--nav", base2 === CLASS_ROOT && CLASS_ACTIVE];
}
return assign2(elements2, {
setup: setup2,
mount,
destroy
});
}
var SLIDE = "slide";
var LOOP = "loop";
var FADE = "fade";
function Slide$1(Splide2, index2, slideIndex, slide) {
var event2 = EventInterface(Splide2);
var on2 = event2.on, emit2 = event2.emit, bind2 = event2.bind;
var Components = Splide2.Components, root2 = Splide2.root, options2 = Splide2.options;
var isNavigation = options2.isNavigation, updateOnMove = options2.updateOnMove, i18n = options2.i18n, pagination = options2.pagination, slideFocus = options2.slideFocus;
var resolve3 = Components.Direction.resolve;
var styles2 = getAttribute(slide, "style");
var label2 = getAttribute(slide, ARIA_LABEL2);
var isClone = slideIndex > -1;
var container = child(slide, "." + CLASS_CONTAINER);
var destroyed;
function mount() {
if (!isClone) {
slide.id = root2.id + "-slide" + pad2(index2 + 1);
setAttribute2(slide, ROLE, pagination ? "tabpanel" : "group");
setAttribute2(slide, ARIA_ROLEDESCRIPTION2, i18n.slide);
setAttribute2(slide, ARIA_LABEL2, label2 || format2(i18n.slideLabel, [index2 + 1, Splide2.length]));
}
listen();
}
function listen() {
bind2(slide, "click", apply2(emit2, EVENT_CLICK, self2));
bind2(slide, "keydown", apply2(emit2, EVENT_SLIDE_KEYDOWN, self2));
on2([EVENT_MOVED, EVENT_SHIFTED, EVENT_SCROLLED], update2);
on2(EVENT_NAVIGATION_MOUNTED, initNavigation);
if (updateOnMove) {
on2(EVENT_MOVE, onMove);
}
}
function destroy() {
destroyed = true;
event2.destroy();
removeClass3(slide, STATUS_CLASSES);
removeAttribute(slide, ALL_ATTRIBUTES);
setAttribute2(slide, "style", styles2);
setAttribute2(slide, ARIA_LABEL2, label2 || "");
}
function initNavigation() {
var controls = Splide2.splides.map(function(target2) {
var Slide2 = target2.splide.Components.Slides.getAt(index2);
return Slide2 ? Slide2.slide.id : "";
}).join(" ");
setAttribute2(slide, ARIA_LABEL2, format2(i18n.slideX, (isClone ? slideIndex : index2) + 1));
setAttribute2(slide, ARIA_CONTROLS, controls);
setAttribute2(slide, ROLE, slideFocus ? "button" : "");
slideFocus && removeAttribute(slide, ARIA_ROLEDESCRIPTION2);
}
function onMove() {
if (!destroyed) {
update2();
}
}
function update2() {
if (!destroyed) {
var curr = Splide2.index;
updateActivity();
updateVisibility();
toggleClass(slide, CLASS_PREV, index2 === curr - 1);
toggleClass(slide, CLASS_NEXT, index2 === curr + 1);
}
}
function updateActivity() {
var active = isActive();
if (active !== hasClass2(slide, CLASS_ACTIVE)) {
toggleClass(slide, CLASS_ACTIVE, active);
setAttribute2(slide, ARIA_CURRENT, isNavigation && active || "");
emit2(active ? EVENT_ACTIVE : EVENT_INACTIVE, self2);
}
}
function updateVisibility() {
var visible = isVisible();
var hidden = !visible && (!isActive() || isClone);
if (!Splide2.state.is([MOVING, SCROLLING])) {
setAttribute2(slide, ARIA_HIDDEN2, hidden || "");
}
setAttribute2(queryAll(slide, options2.focusableNodes || ""), TAB_INDEX, hidden ? -1 : "");
if (slideFocus) {
setAttribute2(slide, TAB_INDEX, hidden ? -1 : 0);
}
if (visible !== hasClass2(slide, CLASS_VISIBLE)) {
toggleClass(slide, CLASS_VISIBLE, visible);
emit2(visible ? EVENT_VISIBLE : EVENT_HIDDEN, self2);
}
if (!visible && document.activeElement === slide) {
var Slide2 = Components.Slides.getAt(Splide2.index);
Slide2 && focus(Slide2.slide);
}
}
function style$1(prop, value2, useContainer) {
style2(useContainer && container || slide, prop, value2);
}
function isActive() {
var curr = Splide2.index;
return curr === index2 || options2.cloneStatus && curr === slideIndex;
}
function isVisible() {
if (Splide2.is(FADE)) {
return isActive();
}
var trackRect = rect2(Components.Elements.track);
var slideRect = rect2(slide);
var left2 = resolve3("left", true);
var right2 = resolve3("right", true);
return floor2(trackRect[left2]) <= ceil2(slideRect[left2]) && floor2(slideRect[right2]) <= ceil2(trackRect[right2]);
}
function isWithin(from2, distance2) {
var diff2 = abs2(from2 - index2);
if (!isClone && (options2.rewind || Splide2.is(LOOP))) {
diff2 = min2(diff2, Splide2.length - diff2);
}
return diff2 <= distance2;
}
var self2 = {
index: index2,
slideIndex,
slide,
container,
isClone,
mount,
destroy,
update: update2,
style: style$1,
isWithin
};
return self2;
}
function Slides(Splide2, Components2, options2) {
var _EventInterface2 = EventInterface(Splide2), on2 = _EventInterface2.on, emit2 = _EventInterface2.emit, bind2 = _EventInterface2.bind;
var _Components2$Elements = Components2.Elements, slides = _Components2$Elements.slides, list = _Components2$Elements.list;
var Slides2 = [];
function mount() {
init3();
on2(EVENT_REFRESH, destroy);
on2(EVENT_REFRESH, init3);
}
function init3() {
slides.forEach(function(slide, index2) {
register(slide, index2, -1);
});
}
function destroy() {
forEach$1(function(Slide2) {
Slide2.destroy();
});
empty2(Slides2);
}
function update2() {
forEach$1(function(Slide2) {
Slide2.update();
});
}
function register(slide, index2, slideIndex) {
var object2 = Slide$1(Splide2, index2, slideIndex, slide);
object2.mount();
Slides2.push(object2);
Slides2.sort(function(Slide1, Slide2) {
return Slide1.index - Slide2.index;
});
}
function get2(excludeClones) {
return excludeClones ? filter2(function(Slide2) {
return !Slide2.isClone;
}) : Slides2;
}
function getIn(page) {
var Controller2 = Components2.Controller;
var index2 = Controller2.toIndex(page);
var max3 = Controller2.hasFocus() ? 1 : options2.perPage;
return filter2(function(Slide2) {
return between(Slide2.index, index2, index2 + max3 - 1);
});
}
function getAt(index2) {
return filter2(index2)[0];
}
function add3(items, index2) {
forEach(items, function(slide) {
if (isString2(slide)) {
slide = parseHtml(slide);
}
if (isHTMLElement2(slide)) {
var ref2 = slides[index2];
ref2 ? before(slide, ref2) : append2(list, slide);
addClass2(slide, options2.classes.slide);
observeImages(slide, apply2(emit2, EVENT_RESIZE));
}
});
emit2(EVENT_REFRESH);
}
function remove$1(matcher) {
remove3(filter2(matcher).map(function(Slide2) {
return Slide2.slide;
}));
emit2(EVENT_REFRESH);
}
function forEach$1(iteratee, excludeClones) {
get2(excludeClones).forEach(iteratee);
}
function filter2(matcher) {
return Slides2.filter(isFunction2(matcher) ? matcher : function(Slide2) {
return isString2(matcher) ? matches(Slide2.slide, matcher) : includes2(toArray2(matcher), Slide2.index);
});
}
function style3(prop, value2, useContainer) {
forEach$1(function(Slide2) {
Slide2.style(prop, value2, useContainer);
});
}
function observeImages(elm, callback) {
var images = queryAll(elm, "img");
var length2 = images.length;
if (length2) {
images.forEach(function(img) {
bind2(img, "load error", function() {
if (!--length2) {
callback();
}
});
});
} else {
callback();
}
}
function getLength(excludeClones) {
return excludeClones ? slides.length : Slides2.length;
}
function isEnough() {
return Slides2.length > options2.perPage;
}
return {
mount,
destroy,
update: update2,
register,
get: get2,
getIn,
getAt,
add: add3,
remove: remove$1,
forEach: forEach$1,
filter: filter2,
style: style3,
getLength,
isEnough
};
}
function Layout(Splide2, Components2, options2) {
var _EventInterface3 = EventInterface(Splide2), on2 = _EventInterface3.on, bind2 = _EventInterface3.bind, emit2 = _EventInterface3.emit;
var Slides2 = Components2.Slides;
var resolve3 = Components2.Direction.resolve;
var _Components2$Elements2 = Components2.Elements, root2 = _Components2$Elements2.root, track = _Components2$Elements2.track, list = _Components2$Elements2.list;
var getAt = Slides2.getAt, styleSlides = Slides2.style;
var vertical;
var rootRect;
var overflow2;
function mount() {
init3();
bind2(window, "resize load", Throttle(apply2(emit2, EVENT_RESIZE)));
on2([EVENT_UPDATED, EVENT_REFRESH], init3);
on2(EVENT_RESIZE, resize2);
}
function init3() {
vertical = options2.direction === TTB;
style2(root2, "maxWidth", unit2(options2.width));
style2(track, resolve3("paddingLeft"), cssPadding(false));
style2(track, resolve3("paddingRight"), cssPadding(true));
resize2(true);
}
function resize2(force2) {
var newRect = rect2(root2);
if (force2 || rootRect.width !== newRect.width || rootRect.height !== newRect.height) {
style2(track, "height", cssTrackHeight());
styleSlides(resolve3("marginRight"), unit2(options2.gap));
styleSlides("width", cssSlideWidth());
styleSlides("height", cssSlideHeight(), true);
rootRect = newRect;
emit2(EVENT_RESIZED);
if (overflow2 !== (overflow2 = isOverflow())) {
toggleClass(root2, CLASS_OVERFLOW, overflow2);
emit2(EVENT_OVERFLOW, overflow2);
}
}
}
function cssPadding(right2) {
var padding2 = options2.padding;
var prop = resolve3(right2 ? "right" : "left");
return padding2 && unit2(padding2[prop] || (isObject2(padding2) ? 0 : padding2)) || "0px";
}
function cssTrackHeight() {
var height2 = "";
if (vertical) {
height2 = cssHeight();
assert2(height2, "height or heightRatio is missing.");
height2 = "calc(" + height2 + " - " + cssPadding(false) + " - " + cssPadding(true) + ")";
}
return height2;
}
function cssHeight() {
return unit2(options2.height || rect2(list).width * options2.heightRatio);
}
function cssSlideWidth() {
return options2.autoWidth ? null : unit2(options2.fixedWidth) || (vertical ? "" : cssSlideSize());
}
function cssSlideHeight() {
return unit2(options2.fixedHeight) || (vertical ? options2.autoHeight ? null : cssSlideSize() : cssHeight());
}
function cssSlideSize() {
var gap = unit2(options2.gap);
return "calc((100%" + (gap && " + " + gap) + ")/" + (options2.perPage || 1) + (gap && " - " + gap) + ")";
}
function listSize() {
return rect2(list)[resolve3("width")];
}
function slideSize(index2, withoutGap) {
var Slide2 = getAt(index2 || 0);
return Slide2 ? rect2(Slide2.slide)[resolve3("width")] + (withoutGap ? 0 : getGap()) : 0;
}
function totalSize(index2, withoutGap) {
var Slide2 = getAt(index2);
if (Slide2) {
var right2 = rect2(Slide2.slide)[resolve3("right")];
var left2 = rect2(list)[resolve3("left")];
return abs2(right2 - left2) + (withoutGap ? 0 : getGap());
}
return 0;
}
function sliderSize(withoutGap) {
return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap);
}
function getGap() {
var Slide2 = getAt(0);
return Slide2 && parseFloat(style2(Slide2.slide, resolve3("marginRight"))) || 0;
}
function getPadding(right2) {
return parseFloat(style2(track, resolve3("padding" + (right2 ? "Right" : "Left")))) || 0;
}
function isOverflow() {
return Splide2.is(FADE) || sliderSize(true) > listSize();
}
return {
mount,
resize: resize2,
listSize,
slideSize,
sliderSize,
totalSize,
getPadding,
isOverflow
};
}
var MULTIPLIER = 2;
function Clones(Splide2, Components2, options2) {
var event2 = EventInterface(Splide2);
var on2 = event2.on;
var Elements2 = Components2.Elements, Slides2 = Components2.Slides;
var resolve3 = Components2.Direction.resolve;
var clones = [];
var cloneCount;
function mount() {
on2(EVENT_REFRESH, remount);
on2([EVENT_UPDATED, EVENT_RESIZE], observe);
if (cloneCount = computeCloneCount()) {
generate2(cloneCount);
Components2.Layout.resize(true);
}
}
function remount() {
destroy();
mount();
}
function destroy() {
remove3(clones);
empty2(clones);
event2.destroy();
}
function observe() {
var count2 = computeCloneCount();
if (cloneCount !== count2) {
if (cloneCount < count2 || !count2) {
event2.emit(EVENT_REFRESH);
}
}
}
function generate2(count2) {
var slides = Slides2.get().slice();
var length2 = slides.length;
if (length2) {
while (slides.length < count2) {
push2(slides, slides);
}
push2(slides.slice(-count2), slides.slice(0, count2)).forEach(function(Slide2, index2) {
var isHead = index2 < count2;
var clone2 = cloneDeep(Slide2.slide, index2);
isHead ? before(clone2, slides[0].slide) : append2(Elements2.list, clone2);
push2(clones, clone2);
Slides2.register(clone2, index2 - count2 + (isHead ? 0 : length2), Slide2.index);
});
}
}
function cloneDeep(elm, index2) {
var clone2 = elm.cloneNode(true);
addClass2(clone2, options2.classes.clone);
clone2.id = Splide2.root.id + "-clone" + pad2(index2 + 1);
return clone2;
}
function computeCloneCount() {
var clones2 = options2.clones;
if (!Splide2.is(LOOP)) {
clones2 = 0;
} else if (isUndefined2(clones2)) {
var fixedSize = options2[resolve3("fixedWidth")] && Components2.Layout.slideSize(0);
var fixedCount = fixedSize && ceil2(rect2(Elements2.track)[resolve3("width")] / fixedSize);
clones2 = fixedCount || options2[resolve3("autoWidth")] && Splide2.length || options2.perPage * MULTIPLIER;
}
return clones2;
}
return {
mount,
destroy
};
}
function Move(Splide2, Components2, options2) {
var _EventInterface4 = EventInterface(Splide2), on2 = _EventInterface4.on, emit2 = _EventInterface4.emit;
var set2 = Splide2.state.set;
var _Components2$Layout = Components2.Layout, slideSize = _Components2$Layout.slideSize, getPadding = _Components2$Layout.getPadding, totalSize = _Components2$Layout.totalSize, listSize = _Components2$Layout.listSize, sliderSize = _Components2$Layout.sliderSize;
var _Components2$Directio = Components2.Direction, resolve3 = _Components2$Directio.resolve, orient = _Components2$Directio.orient;
var _Components2$Elements3 = Components2.Elements, list = _Components2$Elements3.list, track = _Components2$Elements3.track;
var Transition2;
function mount() {
Transition2 = Components2.Transition;
on2([EVENT_MOUNTED, EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition);
}
function reposition() {
if (!Components2.Controller.isBusy()) {
Components2.Scroll.cancel();
jump(Splide2.index);
Components2.Slides.update();
}
}
function move2(dest, index2, prev2, callback) {
if (dest !== index2 && canShift(dest > prev2)) {
cancel();
translate2(shift(getPosition2(), dest > prev2), true);
}
set2(MOVING);
emit2(EVENT_MOVE, index2, prev2, dest);
Transition2.start(index2, function() {
set2(IDLE);
emit2(EVENT_MOVED, index2, prev2, dest);
callback && callback();
});
}
function jump(index2) {
translate2(toPosition(index2, true));
}
function translate2(position2, preventLoop) {
if (!Splide2.is(FADE)) {
var destination = preventLoop ? position2 : loop(position2);
style2(list, "transform", "translate" + resolve3("X") + "(" + destination + "px)");
position2 !== destination && emit2(EVENT_SHIFTED);
}
}
function loop(position2) {
if (Splide2.is(LOOP)) {
var index2 = toIndex(position2);
var exceededMax = index2 > Components2.Controller.getEnd();
var exceededMin = index2 < 0;
if (exceededMin || exceededMax) {
position2 = shift(position2, exceededMax);
}
}
return position2;
}
function shift(position2, backwards) {
var excess = position2 - getLimit(backwards);
var size = sliderSize();
position2 -= orient(size * (ceil2(abs2(excess) / size) || 1)) * (backwards ? 1 : -1);
return position2;
}
function cancel() {
translate2(getPosition2(), true);
Transition2.cancel();
}
function toIndex(position2) {
var Slides2 = Components2.Slides.get();
var index2 = 0;
var minDistance = Infinity;
for (var i2 = 0; i2 < Slides2.length; i2++) {
var slideIndex = Slides2[i2].index;
var distance2 = abs2(toPosition(slideIndex, true) - position2);
if (distance2 <= minDistance) {
minDistance = distance2;
index2 = slideIndex;
} else {
break;
}
}
return index2;
}
function toPosition(index2, trimming) {
var position2 = orient(totalSize(index2 - 1) - offset2(index2));
return trimming ? trim3(position2) : position2;
}
function getPosition2() {
var left2 = resolve3("left");
return rect2(list)[left2] - rect2(track)[left2] + orient(getPadding(false));
}
function trim3(position2) {
if (options2.trimSpace && Splide2.is(SLIDE)) {
position2 = clamp2(position2, 0, orient(sliderSize(true) - listSize()));
}
return position2;
}
function offset2(index2) {
var focus2 = options2.focus;
return focus2 === "center" ? (listSize() - slideSize(index2, true)) / 2 : +focus2 * slideSize(index2) || 0;
}
function getLimit(max3) {
return toPosition(max3 ? Components2.Controller.getEnd() : 0, !!options2.trimSpace);
}
function canShift(backwards) {
var shifted = orient(shift(getPosition2(), backwards));
return backwards ? shifted >= 0 : shifted <= list[resolve3("scrollWidth")] - rect2(track)[resolve3("width")];
}
function exceededLimit(max3, position2) {
position2 = isUndefined2(position2) ? getPosition2() : position2;
var exceededMin = max3 !== true && orient(position2) < orient(getLimit(false));
var exceededMax = max3 !== false && orient(position2) > orient(getLimit(true));
return exceededMin || exceededMax;
}
return {
mount,
move: move2,
jump,
translate: translate2,
shift,
cancel,
toIndex,
toPosition,
getPosition: getPosition2,
getLimit,
exceededLimit,
reposition
};
}
function Controller(Splide2, Components2, options2) {
var _EventInterface5 = EventInterface(Splide2), on2 = _EventInterface5.on, emit2 = _EventInterface5.emit;
var Move2 = Components2.Move;
var getPosition2 = Move2.getPosition, getLimit = Move2.getLimit, toPosition = Move2.toPosition;
var _Components2$Slides = Components2.Slides, isEnough = _Components2$Slides.isEnough, getLength = _Components2$Slides.getLength;
var omitEnd = options2.omitEnd;
var isLoop = Splide2.is(LOOP);
var isSlide = Splide2.is(SLIDE);
var getNext = apply2(getAdjacent, false);
var getPrev = apply2(getAdjacent, true);
var currIndex = options2.start || 0;
var endIndex;
var prevIndex = currIndex;
var slideCount;
var perMove;
var perPage;
function mount() {
init3();
on2([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], init3);
on2(EVENT_RESIZED, onResized);
}
function init3() {
slideCount = getLength(true);
perMove = options2.perMove;
perPage = options2.perPage;
endIndex = getEnd();
var index2 = clamp2(currIndex, 0, omitEnd ? endIndex : slideCount - 1);
if (index2 !== currIndex) {
currIndex = index2;
Move2.reposition();
}
}
function onResized() {
if (endIndex !== getEnd()) {
emit2(EVENT_END_INDEX_CHANGED);
}
}
function go2(control, allowSameIndex, callback) {
if (!isBusy()) {
var dest = parse2(control);
var index2 = loop(dest);
if (index2 > -1 && (allowSameIndex || index2 !== currIndex)) {
setIndex(index2);
Move2.move(dest, index2, prevIndex, callback);
}
}
}
function scroll(destination, duration2, snap, callback) {
Components2.Scroll.scroll(destination, duration2, snap, function() {
var index2 = loop(Move2.toIndex(getPosition2()));
setIndex(omitEnd ? min2(index2, endIndex) : index2);
callback && callback();
});
}
function parse2(control) {
var index2 = currIndex;
if (isString2(control)) {
var _ref3 = control.match(/([+\-<>])(\d+)?/) || [], indicator = _ref3[1], number2 = _ref3[2];
if (indicator === "+" || indicator === "-") {
index2 = computeDestIndex(currIndex + +("" + indicator + (+number2 || 1)), currIndex);
} else if (indicator === ">") {
index2 = number2 ? toIndex(+number2) : getNext(true);
} else if (indicator === "<") {
index2 = getPrev(true);
}
} else {
index2 = isLoop ? control : clamp2(control, 0, endIndex);
}
return index2;
}
function getAdjacent(prev2, destination) {
var number2 = perMove || (hasFocus() ? 1 : perPage);
var dest = computeDestIndex(currIndex + number2 * (prev2 ? -1 : 1), currIndex, !(perMove || hasFocus()));
if (dest === -1 && isSlide) {
if (!approximatelyEqual(getPosition2(), getLimit(!prev2), 1)) {
return prev2 ? 0 : endIndex;
}
}
return destination ? dest : loop(dest);
}
function computeDestIndex(dest, from2, snapPage) {
if (isEnough() || hasFocus()) {
var index2 = computeMovableDestIndex(dest);
if (index2 !== dest) {
from2 = dest;
dest = index2;
snapPage = false;
}
if (dest < 0 || dest > endIndex) {
if (!perMove && (between(0, dest, from2, true) || between(endIndex, from2, dest, true))) {
dest = toIndex(toPage(dest));
} else {
if (isLoop) {
dest = snapPage ? dest < 0 ? -(slideCount % perPage || perPage) : slideCount : dest;
} else if (options2.rewind) {
dest = dest < 0 ? endIndex : 0;
} else {
dest = -1;
}
}
} else {
if (snapPage && dest !== from2) {
dest = toIndex(toPage(from2) + (dest < from2 ? -1 : 1));
}
}
} else {
dest = -1;
}
return dest;
}
function computeMovableDestIndex(dest) {
if (isSlide && options2.trimSpace === "move" && dest !== currIndex) {
var position2 = getPosition2();
while (position2 === toPosition(dest, true) && between(dest, 0, Splide2.length - 1, !options2.rewind)) {
dest < currIndex ? --dest : ++dest;
}
}
return dest;
}
function loop(index2) {
return isLoop ? (index2 + slideCount) % slideCount || 0 : index2;
}
function getEnd() {
var end2 = slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage);
while (omitEnd && end2-- > 0) {
if (toPosition(slideCount - 1, true) !== toPosition(end2, true)) {
end2++;
break;
}
}
return clamp2(end2, 0, slideCount - 1);
}
function toIndex(page) {
return clamp2(hasFocus() ? page : perPage * page, 0, endIndex);
}
function toPage(index2) {
return hasFocus() ? min2(index2, endIndex) : floor2((index2 >= endIndex ? slideCount - 1 : index2) / perPage);
}
function toDest(destination) {
var closest3 = Move2.toIndex(destination);
return isSlide ? clamp2(closest3, 0, endIndex) : closest3;
}
function setIndex(index2) {
if (index2 !== currIndex) {
prevIndex = currIndex;
currIndex = index2;
}
}
function getIndex(prev2) {
return prev2 ? prevIndex : currIndex;
}
function hasFocus() {
return !isUndefined2(options2.focus) || options2.isNavigation;
}
function isBusy() {
return Splide2.state.is([MOVING, SCROLLING]) && !!options2.waitForTransition;
}
return {
mount,
go: go2,
scroll,
getNext,
getPrev,
getAdjacent,
getEnd,
setIndex,
getIndex,
toIndex,
toPage,
toDest,
hasFocus,
isBusy
};
}
var XML_NAME_SPACE = "http://www.w3.org/2000/svg";
var PATH = "m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z";
var SIZE2 = 40;
function Arrows(Splide2, Components2, options2) {
var event2 = EventInterface(Splide2);
var on2 = event2.on, bind2 = event2.bind, emit2 = event2.emit;
var classes = options2.classes, i18n = options2.i18n;
var Elements2 = Components2.Elements, Controller2 = Components2.Controller;
var placeholder = Elements2.arrows, track = Elements2.track;
var wrapper = placeholder;
var prev2 = Elements2.prev;
var next2 = Elements2.next;
var created;
var wrapperClasses;
var arrows = {};
function mount() {
init3();
on2(EVENT_UPDATED, remount);
}
function remount() {
destroy();
mount();
}
function init3() {
var enabled = options2.arrows;
if (enabled && !(prev2 && next2)) {
createArrows();
}
if (prev2 && next2) {
assign2(arrows, {
prev: prev2,
next: next2
});
display2(wrapper, enabled ? "" : "none");
addClass2(wrapper, wrapperClasses = CLASS_ARROWS + "--" + options2.direction);
if (enabled) {
listen();
update2();
setAttribute2([prev2, next2], ARIA_CONTROLS, track.id);
emit2(EVENT_ARROWS_MOUNTED, prev2, next2);
}
}
}
function destroy() {
event2.destroy();
removeClass3(wrapper, wrapperClasses);
if (created) {
remove3(placeholder ? [prev2, next2] : wrapper);
prev2 = next2 = null;
} else {
removeAttribute([prev2, next2], ALL_ATTRIBUTES);
}
}
function listen() {
on2([EVENT_MOUNTED, EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED, EVENT_END_INDEX_CHANGED], update2);
bind2(next2, "click", apply2(go2, ">"));
bind2(prev2, "click", apply2(go2, "<"));
}
function go2(control) {
Controller2.go(control, true);
}
function createArrows() {
wrapper = placeholder || create4("div", classes.arrows);
prev2 = createArrow(true);
next2 = createArrow(false);
created = true;
append2(wrapper, [prev2, next2]);
!placeholder && before(wrapper, track);
}
function createArrow(prev22) {
var arrow2 = '<button class="' + classes.arrow + " " + (prev22 ? classes.prev : classes.next) + '" type="button"><svg xmlns="' + XML_NAME_SPACE + '" viewBox="0 0 ' + SIZE2 + " " + SIZE2 + '" width="' + SIZE2 + '" height="' + SIZE2 + '" focusable="false"><path d="' + (options2.arrowPath || PATH) + '" />';
return parseHtml(arrow2);
}
function update2() {
if (prev2 && next2) {
var index2 = Splide2.index;
var prevIndex = Controller2.getPrev();
var nextIndex = Controller2.getNext();
var prevLabel = prevIndex > -1 && index2 < prevIndex ? i18n.last : i18n.prev;
var nextLabel = nextIndex > -1 && index2 > nextIndex ? i18n.first : i18n.next;
prev2.disabled = prevIndex < 0;
next2.disabled = nextIndex < 0;
setAttribute2(prev2, ARIA_LABEL2, prevLabel);
setAttribute2(next2, ARIA_LABEL2, nextLabel);
emit2(EVENT_ARROWS_UPDATED, prev2, next2, prevIndex, nextIndex);
}
}
return {
arrows,
mount,
destroy,
update: update2
};
}
var INTERVAL_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-interval";
function Autoplay(Splide2, Components2, options2) {
var _EventInterface6 = EventInterface(Splide2), on2 = _EventInterface6.on, bind2 = _EventInterface6.bind, emit2 = _EventInterface6.emit;
var interval2 = RequestInterval(options2.interval, Splide2.go.bind(Splide2, ">"), onAnimationFrame);
var isPaused = interval2.isPaused;
var Elements2 = Components2.Elements, _Components2$Elements4 = Components2.Elements, root2 = _Components2$Elements4.root, toggle2 = _Components2$Elements4.toggle;
var autoplay = options2.autoplay;
var hovered;
var focused;
var stopped = autoplay === "pause";
function mount() {
if (autoplay) {
listen();
toggle2 && setAttribute2(toggle2, ARIA_CONTROLS, Elements2.track.id);
stopped || play();
update2();
}
}
function listen() {
if (options2.pauseOnHover) {
bind2(root2, "mouseenter mouseleave", function(e7) {
hovered = e7.type === "mouseenter";
autoToggle();
});
}
if (options2.pauseOnFocus) {
bind2(root2, "focusin focusout", function(e7) {
focused = e7.type === "focusin";
autoToggle();
});
}
if (toggle2) {
bind2(toggle2, "click", function() {
stopped ? play() : pause(true);
});
}
on2([EVENT_MOVE, EVENT_SCROLL, EVENT_REFRESH], interval2.rewind);
on2(EVENT_MOVE, onMove);
}
function play() {
if (isPaused() && Components2.Slides.isEnough()) {
interval2.start(!options2.resetProgress);
focused = hovered = stopped = false;
update2();
emit2(EVENT_AUTOPLAY_PLAY);
}
}
function pause(stop2) {
if (stop2 === void 0) {
stop2 = true;
}
stopped = !!stop2;
update2();
if (!isPaused()) {
interval2.pause();
emit2(EVENT_AUTOPLAY_PAUSE);
}
}
function autoToggle() {
if (!stopped) {
hovered || focused ? pause(false) : play();
}
}
function update2() {
if (toggle2) {
toggleClass(toggle2, CLASS_ACTIVE, !stopped);
setAttribute2(toggle2, ARIA_LABEL2, options2.i18n[stopped ? "play" : "pause"]);
}
}
function onAnimationFrame(rate) {
var bar = Elements2.bar;
bar && style2(bar, "width", rate * 100 + "%");
emit2(EVENT_AUTOPLAY_PLAYING, rate);
}
function onMove(index2) {
var Slide2 = Components2.Slides.getAt(index2);
interval2.set(Slide2 && +getAttribute(Slide2.slide, INTERVAL_DATA_ATTRIBUTE) || options2.interval);
}
return {
mount,
destroy: interval2.cancel,
play,
pause,
isPaused
};
}
function Cover(Splide2, Components2, options2) {
var _EventInterface7 = EventInterface(Splide2), on2 = _EventInterface7.on;
function mount() {
if (options2.cover) {
on2(EVENT_LAZYLOAD_LOADED, apply2(toggle2, true));
on2([EVENT_MOUNTED, EVENT_UPDATED, EVENT_REFRESH], apply2(cover, true));
}
}
function cover(cover2) {
Components2.Slides.forEach(function(Slide2) {
var img = child(Slide2.container || Slide2.slide, "img");
if (img && img.src) {
toggle2(cover2, img, Slide2);
}
});
}
function toggle2(cover2, img, Slide2) {
Slide2.style("background", cover2 ? 'center/cover no-repeat url("' + img.src + '")' : "", true);
display2(img, cover2 ? "none" : "");
}
return {
mount,
destroy: apply2(cover, false)
};
}
var BOUNCE_DIFF_THRESHOLD = 10;
var BOUNCE_DURATION = 600;
var FRICTION_FACTOR = 0.6;
var BASE_VELOCITY = 1.5;
var MIN_DURATION = 800;
function Scroll(Splide2, Components2, options2) {
var _EventInterface8 = EventInterface(Splide2), on2 = _EventInterface8.on, emit2 = _EventInterface8.emit;
var set2 = Splide2.state.set;
var Move2 = Components2.Move;
var getPosition2 = Move2.getPosition, getLimit = Move2.getLimit, exceededLimit = Move2.exceededLimit, translate2 = Move2.translate;
var isSlide = Splide2.is(SLIDE);
var interval2;
var callback;
var friction = 1;
function mount() {
on2(EVENT_MOVE, clear2);
on2([EVENT_UPDATED, EVENT_REFRESH], cancel);
}
function scroll(destination, duration2, snap, onScrolled, noConstrain) {
var from2 = getPosition2();
clear2();
if (snap && (!isSlide || !exceededLimit())) {
var size = Components2.Layout.sliderSize();
var offset2 = sign2(destination) * size * floor2(abs2(destination) / size) || 0;
destination = Move2.toPosition(Components2.Controller.toDest(destination % size)) + offset2;
}
var noDistance = approximatelyEqual(from2, destination, 1);
friction = 1;
duration2 = noDistance ? 0 : duration2 || max2(abs2(destination - from2) / BASE_VELOCITY, MIN_DURATION);
callback = onScrolled;
interval2 = RequestInterval(duration2, onEnd, apply2(update2, from2, destination, noConstrain), 1);
set2(SCROLLING);
emit2(EVENT_SCROLL);
interval2.start();
}
function onEnd() {
set2(IDLE);
callback && callback();
emit2(EVENT_SCROLLED);
}
function update2(from2, to2, noConstrain, rate) {
var position2 = getPosition2();
var target2 = from2 + (to2 - from2) * easing(rate);
var diff2 = (target2 - position2) * friction;
translate2(position2 + diff2);
if (isSlide && !noConstrain && exceededLimit()) {
friction *= FRICTION_FACTOR;
if (abs2(diff2) < BOUNCE_DIFF_THRESHOLD) {
scroll(getLimit(exceededLimit(true)), BOUNCE_DURATION, false, callback, true);
}
}
}
function clear2() {
if (interval2) {
interval2.cancel();
}
}
function cancel() {
if (interval2 && !interval2.isPaused()) {
clear2();
onEnd();
}
}
function easing(t5) {
var easingFunc = options2.easingFunc;
return easingFunc ? easingFunc(t5) : 1 - Math.pow(1 - t5, 4);
}
return {
mount,
destroy: clear2,
scroll,
cancel
};
}
var SCROLL_LISTENER_OPTIONS = {
passive: false,
capture: true
};
function Drag(Splide2, Components2, options2) {
var _EventInterface9 = EventInterface(Splide2), on2 = _EventInterface9.on, emit2 = _EventInterface9.emit, bind2 = _EventInterface9.bind, unbind = _EventInterface9.unbind;
var state = Splide2.state;
var Move2 = Components2.Move, Scroll2 = Components2.Scroll, Controller2 = Components2.Controller, track = Components2.Elements.track, reduce2 = Components2.Media.reduce;
var _Components2$Directio2 = Components2.Direction, resolve3 = _Components2$Directio2.resolve, orient = _Components2$Directio2.orient;
var getPosition2 = Move2.getPosition, exceededLimit = Move2.exceededLimit;
var basePosition;
var baseEvent;
var prevBaseEvent;
var isFree;
var dragging;
var exceeded = false;
var clickPrevented;
var disabled;
var target2;
function mount() {
bind2(track, POINTER_MOVE_EVENTS, noop3, SCROLL_LISTENER_OPTIONS);
bind2(track, POINTER_UP_EVENTS, noop3, SCROLL_LISTENER_OPTIONS);
bind2(track, POINTER_DOWN_EVENTS, onPointerDown, SCROLL_LISTENER_OPTIONS);
bind2(track, "click", onClick, {
capture: true
});
bind2(track, "dragstart", prevent2);
on2([EVENT_MOUNTED, EVENT_UPDATED], init3);
}
function init3() {
var drag = options2.drag;
disable(!drag);
isFree = drag === "free";
}
function onPointerDown(e7) {
clickPrevented = false;
if (!disabled) {
var isTouch = isTouchEvent2(e7);
if (isDraggable(e7.target) && (isTouch || !e7.button)) {
if (!Controller2.isBusy()) {
target2 = isTouch ? track : window;
dragging = state.is([MOVING, SCROLLING]);
prevBaseEvent = null;
bind2(target2, POINTER_MOVE_EVENTS, onPointerMove, SCROLL_LISTENER_OPTIONS);
bind2(target2, POINTER_UP_EVENTS, onPointerUp, SCROLL_LISTENER_OPTIONS);
Move2.cancel();
Scroll2.cancel();
save(e7);
} else {
prevent2(e7, true);
}
}
}
}
function onPointerMove(e7) {
if (!state.is(DRAGGING)) {
state.set(DRAGGING);
emit2(EVENT_DRAG);
}
if (e7.cancelable) {
if (dragging) {
Move2.translate(basePosition + constrain(diffCoord(e7)));
var expired = diffTime(e7) > LOG_INTERVAL;
var hasExceeded = exceeded !== (exceeded = exceededLimit());
if (expired || hasExceeded) {
save(e7);
}
clickPrevented = true;
emit2(EVENT_DRAGGING);
prevent2(e7);
} else if (isSliderDirection(e7)) {
dragging = shouldStart(e7);
prevent2(e7);
}
}
}
function onPointerUp(e7) {
if (state.is(DRAGGING)) {
state.set(IDLE);
emit2(EVENT_DRAGGED);
}
if (dragging) {
move2(e7);
prevent2(e7);
}
unbind(target2, POINTER_MOVE_EVENTS, onPointerMove);
unbind(target2, POINTER_UP_EVENTS, onPointerUp);
dragging = false;
}
function onClick(e7) {
if (!disabled && clickPrevented) {
prevent2(e7, true);
}
}
function save(e7) {
prevBaseEvent = baseEvent;
baseEvent = e7;
basePosition = getPosition2();
}
function move2(e7) {
var velocity = computeVelocity(e7);
var destination = computeDestination(velocity);
var rewind = options2.rewind && options2.rewindByDrag;
reduce2(false);
if (isFree) {
Controller2.scroll(destination, 0, options2.snap);
} else if (Splide2.is(FADE)) {
Controller2.go(orient(sign2(velocity)) < 0 ? rewind ? "<" : "-" : rewind ? ">" : "+");
} else if (Splide2.is(SLIDE) && exceeded && rewind) {
Controller2.go(exceededLimit(true) ? ">" : "<");
} else {
Controller2.go(Controller2.toDest(destination), true);
}
reduce2(true);
}
function shouldStart(e7) {
var thresholds = options2.dragMinThreshold;
var isObj = isObject2(thresholds);
var mouse = isObj && thresholds.mouse || 0;
var touch2 = (isObj ? thresholds.touch : +thresholds) || 10;
return abs2(diffCoord(e7)) > (isTouchEvent2(e7) ? touch2 : mouse);
}
function isSliderDirection(e7) {
return abs2(diffCoord(e7)) > abs2(diffCoord(e7, true));
}
function computeVelocity(e7) {
if (Splide2.is(LOOP) || !exceeded) {
var time2 = diffTime(e7);
if (time2 && time2 < LOG_INTERVAL) {
return diffCoord(e7) / time2;
}
}
return 0;
}
function computeDestination(velocity) {
return getPosition2() + sign2(velocity) * min2(abs2(velocity) * (options2.flickPower || 600), isFree ? Infinity : Components2.Layout.listSize() * (options2.flickMaxPages || 1));
}
function diffCoord(e7, orthogonal) {
return coordOf(e7, orthogonal) - coordOf(getBaseEvent(e7), orthogonal);
}
function diffTime(e7) {
return timeOf(e7) - timeOf(getBaseEvent(e7));
}
function getBaseEvent(e7) {
return baseEvent === e7 && prevBaseEvent || baseEvent;
}
function coordOf(e7, orthogonal) {
return (isTouchEvent2(e7) ? e7.changedTouches[0] : e7)["page" + resolve3(orthogonal ? "Y" : "X")];
}
function constrain(diff2) {
return diff2 / (exceeded && Splide2.is(SLIDE) ? FRICTION : 1);
}
function isDraggable(target22) {
var noDrag = options2.noDrag;
return !matches(target22, "." + CLASS_PAGINATION_PAGE + ", ." + CLASS_ARROW) && (!noDrag || !matches(target22, noDrag));
}
function isTouchEvent2(e7) {
return typeof TouchEvent !== "undefined" && e7 instanceof TouchEvent;
}
function isDragging() {
return dragging;
}
function disable(value2) {
disabled = value2;
}
return {
mount,
disable,
isDragging
};
}
var NORMALIZATION_MAP = {
Spacebar: " ",
Right: ARROW_RIGHT,
Left: ARROW_LEFT,
Up: ARROW_UP,
Down: ARROW_DOWN
};
function normalizeKey(key2) {
key2 = isString2(key2) ? key2 : key2.key;
return NORMALIZATION_MAP[key2] || key2;
}
var KEYBOARD_EVENT = "keydown";
function Keyboard(Splide2, Components2, options2) {
var _EventInterface10 = EventInterface(Splide2), on2 = _EventInterface10.on, bind2 = _EventInterface10.bind, unbind = _EventInterface10.unbind;
var root2 = Splide2.root;
var resolve3 = Components2.Direction.resolve;
var target2;
var disabled;
function mount() {
init3();
on2(EVENT_UPDATED, destroy);
on2(EVENT_UPDATED, init3);
on2(EVENT_MOVE, onMove);
}
function init3() {
var keyboard = options2.keyboard;
if (keyboard) {
target2 = keyboard === "global" ? window : root2;
bind2(target2, KEYBOARD_EVENT, onKeydown);
}
}
function destroy() {
unbind(target2, KEYBOARD_EVENT);
}
function disable(value2) {
disabled = value2;
}
function onMove() {
var _disabled = disabled;
disabled = true;
nextTick2(function() {
disabled = _disabled;
});
}
function onKeydown(e7) {
if (!disabled) {
var key2 = normalizeKey(e7);
if (key2 === resolve3(ARROW_LEFT)) {
Splide2.go("<");
} else if (key2 === resolve3(ARROW_RIGHT)) {
Splide2.go(">");
}
}
}
return {
mount,
destroy,
disable
};
}
var SRC_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-lazy";
var SRCSET_DATA_ATTRIBUTE = SRC_DATA_ATTRIBUTE + "-srcset";
var IMAGE_SELECTOR = "[" + SRC_DATA_ATTRIBUTE + "], [" + SRCSET_DATA_ATTRIBUTE + "]";
function LazyLoad(Splide2, Components2, options2) {
var _EventInterface11 = EventInterface(Splide2), on2 = _EventInterface11.on, off = _EventInterface11.off, bind2 = _EventInterface11.bind, emit2 = _EventInterface11.emit;
var isSequential = options2.lazyLoad === "sequential";
var events2 = [EVENT_MOVED, EVENT_SCROLLED];
var entries = [];
function mount() {
if (options2.lazyLoad) {
init3();
on2(EVENT_REFRESH, init3);
}
}
function init3() {
empty2(entries);
register();
if (isSequential) {
loadNext();
} else {
off(events2);
on2(events2, check2);
check2();
}
}
function register() {
Components2.Slides.forEach(function(Slide2) {
queryAll(Slide2.slide, IMAGE_SELECTOR).forEach(function(img) {
var src = getAttribute(img, SRC_DATA_ATTRIBUTE);
var srcset = getAttribute(img, SRCSET_DATA_ATTRIBUTE);
if (src !== img.src || srcset !== img.srcset) {
var className = options2.classes.spinner;
var parent = img.parentElement;
var spinner = child(parent, "." + className) || create4("span", className, parent);
entries.push([img, Slide2, spinner]);
img.src || display2(img, "none");
}
});
});
}
function check2() {
entries = entries.filter(function(data2) {
var distance2 = options2.perPage * ((options2.preloadPages || 1) + 1) - 1;
return data2[1].isWithin(Splide2.index, distance2) ? load2(data2) : true;
});
entries.length || off(events2);
}
function load2(data2) {
var img = data2[0];
addClass2(data2[1].slide, CLASS_LOADING);
bind2(img, "load error", apply2(onLoad, data2));
setAttribute2(img, "src", getAttribute(img, SRC_DATA_ATTRIBUTE));
setAttribute2(img, "srcset", getAttribute(img, SRCSET_DATA_ATTRIBUTE));
removeAttribute(img, SRC_DATA_ATTRIBUTE);
removeAttribute(img, SRCSET_DATA_ATTRIBUTE);
}
function onLoad(data2, e7) {
var img = data2[0], Slide2 = data2[1];
removeClass3(Slide2.slide, CLASS_LOADING);
if (e7.type !== "error") {
remove3(data2[2]);
display2(img, "");
emit2(EVENT_LAZYLOAD_LOADED, img, Slide2);
emit2(EVENT_RESIZE);
}
isSequential && loadNext();
}
function loadNext() {
entries.length && load2(entries.shift());
}
return {
mount,
destroy: apply2(empty2, entries),
check: check2
};
}
function Pagination(Splide2, Components2, options2) {
var event2 = EventInterface(Splide2);
var on2 = event2.on, emit2 = event2.emit, bind2 = event2.bind;
var Slides2 = Components2.Slides, Elements2 = Components2.Elements, Controller2 = Components2.Controller;
var hasFocus = Controller2.hasFocus, getIndex = Controller2.getIndex, go2 = Controller2.go;
var resolve3 = Components2.Direction.resolve;
var placeholder = Elements2.pagination;
var items = [];
var list;
var paginationClasses;
function mount() {
destroy();
on2([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], mount);
var enabled = options2.pagination;
placeholder && display2(placeholder, enabled ? "" : "none");
if (enabled) {
on2([EVENT_MOVE, EVENT_SCROLL, EVENT_SCROLLED], update2);
createPagination();
update2();
emit2(EVENT_PAGINATION_MOUNTED, {
list,
items
}, getAt(Splide2.index));
}
}
function destroy() {
if (list) {
remove3(placeholder ? slice2(list.children) : list);
removeClass3(list, paginationClasses);
empty2(items);
list = null;
}
event2.destroy();
}
function createPagination() {
var length2 = Splide2.length;
var classes = options2.classes, i18n = options2.i18n, perPage = options2.perPage;
var max3 = hasFocus() ? Controller2.getEnd() + 1 : ceil2(length2 / perPage);
list = placeholder || create4("ul", classes.pagination, Elements2.track.parentElement);
addClass2(list, paginationClasses = CLASS_PAGINATION + "--" + getDirection());
setAttribute2(list, ROLE, "tablist");
setAttribute2(list, ARIA_LABEL2, i18n.select);
setAttribute2(list, ARIA_ORIENTATION, getDirection() === TTB ? "vertical" : "");
for (var i2 = 0; i2 < max3; i2++) {
var li2 = create4("li", null, list);
var button = create4("button", {
class: classes.page,
type: "button"
}, li2);
var controls = Slides2.getIn(i2).map(function(Slide2) {
return Slide2.slide.id;
});
var text2 = !hasFocus() && perPage > 1 ? i18n.pageX : i18n.slideX;
bind2(button, "click", apply2(onClick, i2));
if (options2.paginationKeyboard) {
bind2(button, "keydown", apply2(onKeydown, i2));
}
setAttribute2(li2, ROLE, "presentation");
setAttribute2(button, ROLE, "tab");
setAttribute2(button, ARIA_CONTROLS, controls.join(" "));
setAttribute2(button, ARIA_LABEL2, format2(text2, i2 + 1));
setAttribute2(button, TAB_INDEX, -1);
items.push({
li: li2,
button,
page: i2
});
}
}
function onClick(page) {
go2(">" + page, true);
}
function onKeydown(page, e7) {
var length2 = items.length;
var key2 = normalizeKey(e7);
var dir = getDirection();
var nextPage = -1;
if (key2 === resolve3(ARROW_RIGHT, false, dir)) {
nextPage = ++page % length2;
} else if (key2 === resolve3(ARROW_LEFT, false, dir)) {
nextPage = (--page + length2) % length2;
} else if (key2 === "Home") {
nextPage = 0;
} else if (key2 === "End") {
nextPage = length2 - 1;
}
var item = items[nextPage];
if (item) {
focus(item.button);
go2(">" + nextPage);
prevent2(e7, true);
}
}
function getDirection() {
return options2.paginationDirection || options2.direction;
}
function getAt(index2) {
return items[Controller2.toPage(index2)];
}
function update2() {
var prev2 = getAt(getIndex(true));
var curr = getAt(getIndex());
if (prev2) {
var button = prev2.button;
removeClass3(button, CLASS_ACTIVE);
removeAttribute(button, ARIA_SELECTED);
setAttribute2(button, TAB_INDEX, -1);
}
if (curr) {
var _button = curr.button;
addClass2(_button, CLASS_ACTIVE);
setAttribute2(_button, ARIA_SELECTED, true);
setAttribute2(_button, TAB_INDEX, "");
}
emit2(EVENT_PAGINATION_UPDATED, {
list,
items
}, prev2, curr);
}
return {
items,
mount,
destroy,
getAt,
update: update2
};
}
var TRIGGER_KEYS = [" ", "Enter"];
function Sync(Splide2, Components2, options2) {
var isNavigation = options2.isNavigation, slideFocus = options2.slideFocus;
var events2 = [];
function mount() {
Splide2.splides.forEach(function(target2) {
if (!target2.isParent) {
sync(Splide2, target2.splide);
sync(target2.splide, Splide2);
}
});
if (isNavigation) {
navigate();
}
}
function destroy() {
events2.forEach(function(event2) {
event2.destroy();
});
empty2(events2);
}
function remount() {
destroy();
mount();
}
function sync(splide, target2) {
var event2 = EventInterface(splide);
event2.on(EVENT_MOVE, function(index2, prev2, dest) {
target2.go(target2.is(LOOP) ? dest : index2);
});
events2.push(event2);
}
function navigate() {
var event2 = EventInterface(Splide2);
var on2 = event2.on;
on2(EVENT_CLICK, onClick);
on2(EVENT_SLIDE_KEYDOWN, onKeydown);
on2([EVENT_MOUNTED, EVENT_UPDATED], update2);
events2.push(event2);
event2.emit(EVENT_NAVIGATION_MOUNTED, Splide2.splides);
}
function update2() {
setAttribute2(Components2.Elements.list, ARIA_ORIENTATION, options2.direction === TTB ? "vertical" : "");
}
function onClick(Slide2) {
Splide2.go(Slide2.index);
}
function onKeydown(Slide2, e7) {
if (includes2(TRIGGER_KEYS, normalizeKey(e7))) {
onClick(Slide2);
prevent2(e7);
}
}
return {
setup: apply2(Components2.Media.set, {
slideFocus: isUndefined2(slideFocus) ? isNavigation : slideFocus
}, true),
mount,
destroy,
remount
};
}
function Wheel(Splide2, Components2, options2) {
var _EventInterface12 = EventInterface(Splide2), bind2 = _EventInterface12.bind;
var lastTime = 0;
function mount() {
if (options2.wheel) {
bind2(Components2.Elements.track, "wheel", onWheel, SCROLL_LISTENER_OPTIONS);
}
}
function onWheel(e7) {
if (e7.cancelable) {
var deltaY = e7.deltaY;
var backwards = deltaY < 0;
var timeStamp = timeOf(e7);
var _min = options2.wheelMinThreshold || 0;
var sleep2 = options2.wheelSleep || 0;
if (abs2(deltaY) > _min && timeStamp - lastTime > sleep2) {
Splide2.go(backwards ? "<" : ">");
lastTime = timeStamp;
}
shouldPrevent(backwards) && prevent2(e7);
}
}
function shouldPrevent(backwards) {
return !options2.releaseWheel || Splide2.state.is(MOVING) || Components2.Controller.getAdjacent(backwards) !== -1;
}
return {
mount
};
}
var SR_REMOVAL_DELAY = 90;
function Live(Splide2, Components2, options2) {
var _EventInterface13 = EventInterface(Splide2), on2 = _EventInterface13.on;
var track = Components2.Elements.track;
var enabled = options2.live && !options2.isNavigation;
var sr2 = create4("span", CLASS_SR);
var interval2 = RequestInterval(SR_REMOVAL_DELAY, apply2(toggle2, false));
function mount() {
if (enabled) {
disable(!Components2.Autoplay.isPaused());
setAttribute2(track, ARIA_ATOMIC, true);
sr2.textContent = "…";
on2(EVENT_AUTOPLAY_PLAY, apply2(disable, true));
on2(EVENT_AUTOPLAY_PAUSE, apply2(disable, false));
on2([EVENT_MOVED, EVENT_SCROLLED], apply2(toggle2, true));
}
}
function toggle2(active) {
setAttribute2(track, ARIA_BUSY, active);
if (active) {
append2(track, sr2);
interval2.start();
} else {
remove3(sr2);
interval2.cancel();
}
}
function destroy() {
removeAttribute(track, [ARIA_LIVE, ARIA_ATOMIC, ARIA_BUSY]);
remove3(sr2);
}
function disable(disabled) {
if (enabled) {
setAttribute2(track, ARIA_LIVE, disabled ? "off" : "polite");
}
}
return {
mount,
disable,
destroy
};
}
var ComponentConstructors = /* @__PURE__ */ Object.freeze({
__proto__: null,
Media,
Direction: Direction2,
Elements,
Slides,
Layout,
Clones,
Move,
Controller,
Arrows,
Autoplay,
Cover,
Scroll,
Drag,
Keyboard,
LazyLoad,
Pagination,
Sync,
Wheel,
Live
});
var I18N = {
prev: "Previous slide",
next: "Next slide",
first: "Go to first slide",
last: "Go to last slide",
slideX: "Go to slide %s",
pageX: "Go to page %s",
play: "Start autoplay",
pause: "Pause autoplay",
carousel: "carousel",
slide: "slide",
select: "Select a slide to show",
slideLabel: "%s of %s"
};
var DEFAULTS = {
type: "slide",
role: "region",
speed: 400,
perPage: 1,
cloneStatus: true,
arrows: true,
pagination: true,
paginationKeyboard: true,
interval: 5e3,
pauseOnHover: true,
pauseOnFocus: true,
resetProgress: true,
easing: "cubic-bezier(0.25, 1, 0.5, 1)",
drag: true,
direction: "ltr",
trimSpace: true,
focusableNodes: "a, button, textarea, input, select, iframe",
live: true,
classes: CLASSES,
i18n: I18N,
reducedMotion: {
speed: 0,
rewindSpeed: 0,
autoplay: "pause"
}
};
function Fade(Splide2, Components2, options2) {
var Slides2 = Components2.Slides;
function mount() {
EventInterface(Splide2).on([EVENT_MOUNTED, EVENT_REFRESH], init3);
}
function init3() {
Slides2.forEach(function(Slide2) {
Slide2.style("transform", "translateX(-" + 100 * Slide2.index + "%)");
});
}
function start2(index2, done) {
Slides2.style("transition", "opacity " + options2.speed + "ms " + options2.easing);
nextTick2(done);
}
return {
mount,
start: start2,
cancel: noop3
};
}
function Slide(Splide2, Components2, options2) {
var Move2 = Components2.Move, Controller2 = Components2.Controller, Scroll2 = Components2.Scroll;
var list = Components2.Elements.list;
var transition = apply2(style2, list, "transition");
var endCallback;
function mount() {
EventInterface(Splide2).bind(list, "transitionend", function(e7) {
if (e7.target === list && endCallback) {
cancel();
endCallback();
}
});
}
function start2(index2, done) {
var destination = Move2.toPosition(index2, true);
var position2 = Move2.getPosition();
var speed = getSpeed(index2);
if (abs2(destination - position2) >= 1 && speed >= 1) {
if (options2.useScroll) {
Scroll2.scroll(destination, speed, false, done);
} else {
transition("transform " + speed + "ms " + options2.easing);
Move2.translate(destination, true);
endCallback = done;
}
} else {
Move2.jump(index2);
done();
}
}
function cancel() {
transition("");
Scroll2.cancel();
}
function getSpeed(index2) {
var rewindSpeed = options2.rewindSpeed;
if (Splide2.is(SLIDE) && rewindSpeed) {
var prev2 = Controller2.getIndex(true);
var end2 = Controller2.getEnd();
if (prev2 === 0 && index2 >= end2 || prev2 >= end2 && index2 === 0) {
return rewindSpeed;
}
}
return options2.speed;
}
return {
mount,
start: start2,
cancel
};
}
var _Splide = /* @__PURE__ */ function() {
function _Splide2(target2, options2) {
this.event = EventInterface();
this.Components = {};
this.state = State(CREATED);
this.splides = [];
this._o = {};
this._E = {};
var root2 = isString2(target2) ? query(document, target2) : target2;
assert2(root2, root2 + " is invalid.");
this.root = root2;
options2 = merge2({
label: getAttribute(root2, ARIA_LABEL2) || "",
labelledby: getAttribute(root2, ARIA_LABELLEDBY) || ""
}, DEFAULTS, _Splide2.defaults, options2 || {});
try {
merge2(options2, JSON.parse(getAttribute(root2, DATA_ATTRIBUTE)));
} catch (e7) {
assert2(false, "Invalid JSON");
}
this._o = Object.create(merge2({}, options2));
}
var _proto = _Splide2.prototype;
_proto.mount = function mount(Extensions, Transition2) {
var _this = this;
var state = this.state, Components2 = this.Components;
assert2(state.is([CREATED, DESTROYED]), "Already mounted!");
state.set(CREATED);
this._C = Components2;
this._T = Transition2 || this._T || (this.is(FADE) ? Fade : Slide);
this._E = Extensions || this._E;
var Constructors = assign2({}, ComponentConstructors, this._E, {
Transition: this._T
});
forOwn(Constructors, function(Component, key2) {
var component = Component(_this, Components2, _this._o);
Components2[key2] = component;
component.setup && component.setup();
});
forOwn(Components2, function(component) {
component.mount && component.mount();
});
this.emit(EVENT_MOUNTED);
addClass2(this.root, CLASS_INITIALIZED);
state.set(IDLE);
this.emit(EVENT_READY);
return this;
};
_proto.sync = function sync(splide) {
this.splides.push({
splide
});
splide.splides.push({
splide: this,
isParent: true
});
if (this.state.is(IDLE)) {
this._C.Sync.remount();
splide.Components.Sync.remount();
}
return this;
};
_proto.go = function go2(control) {
this._C.Controller.go(control);
return this;
};
_proto.on = function on2(events2, callback) {
this.event.on(events2, callback);
return this;
};
_proto.off = function off(events2) {
this.event.off(events2);
return this;
};
_proto.emit = function emit2(event2) {
var _this$event;
(_this$event = this.event).emit.apply(_this$event, [event2].concat(slice2(arguments, 1)));
return this;
};
_proto.add = function add3(slides, index2) {
this._C.Slides.add(slides, index2);
return this;
};
_proto.remove = function remove4(matcher) {
this._C.Slides.remove(matcher);
return this;
};
_proto.is = function is2(type2) {
return this._o.type === type2;
};
_proto.refresh = function refresh() {
this.emit(EVENT_REFRESH);
return this;
};
_proto.destroy = function destroy(completely) {
if (completely === void 0) {
completely = true;
}
var event2 = this.event, state = this.state;
if (state.is(CREATED)) {
EventInterface(this).on(EVENT_READY, this.destroy.bind(this, completely));
} else {
forOwn(this._C, function(component) {
component.destroy && component.destroy(completely);
}, true);
event2.emit(EVENT_DESTROY);
event2.destroy();
completely && empty2(this.splides);
state.set(DESTROYED);
}
return this;
};
_createClass2(_Splide2, [{
key: "options",
get: function get2() {
return this._o;
},
set: function set2(options2) {
this._C.Media.set(options2, true, true);
}
}, {
key: "length",
get: function get2() {
return this._C.Slides.getLength(true);
}
}, {
key: "index",
get: function get2() {
return this._C.Controller.getIndex();
}
}]);
return _Splide2;
}();
var Splide = _Splide;
Splide.defaults = {};
Splide.STATES = STATES;
var CLASS_RENDERED = "is-rendered";
var RENDERER_DEFAULT_CONFIG = {
listTag: "ul",
slideTag: "li"
};
var Style = /* @__PURE__ */ function() {
function Style2(id, options2) {
this.styles = {};
this.id = id;
this.options = options2;
}
var _proto2 = Style2.prototype;
_proto2.rule = function rule2(selector, prop, value2, breakpoint) {
breakpoint = breakpoint || "default";
var selectors = this.styles[breakpoint] = this.styles[breakpoint] || {};
var styles2 = selectors[selector] = selectors[selector] || {};
styles2[prop] = value2;
};
_proto2.build = function build() {
var _this2 = this;
var css4 = "";
if (this.styles.default) {
css4 += this.buildSelectors(this.styles.default);
}
Object.keys(this.styles).sort(function(n2, m2) {
return _this2.options.mediaQuery === "min" ? +n2 - +m2 : +m2 - +n2;
}).forEach(function(breakpoint) {
if (breakpoint !== "default") {
css4 += "@media screen and (max-width: " + breakpoint + "px) {";
css4 += _this2.buildSelectors(_this2.styles[breakpoint]);
css4 += "}";
}
});
return css4;
};
_proto2.buildSelectors = function buildSelectors(selectors) {
var _this3 = this;
var css4 = "";
forOwn(selectors, function(styles2, selector) {
selector = ("#" + _this3.id + " " + selector).trim();
css4 += selector + " {";
forOwn(styles2, function(value2, prop) {
if (value2 || value2 === 0) {
css4 += prop + ": " + value2 + ";";
}
});
css4 += "}";
});
return css4;
};
return Style2;
}();
var SplideRenderer = /* @__PURE__ */ function() {
function SplideRenderer2(contents, options2, config2, defaults2) {
this.slides = [];
this.options = {};
this.breakpoints = [];
merge2(DEFAULTS, defaults2 || {});
merge2(merge2(this.options, DEFAULTS), options2 || {});
this.contents = contents;
this.config = assign2({}, RENDERER_DEFAULT_CONFIG, config2 || {});
this.id = this.config.id || uniqueId("splide");
this.Style = new Style(this.id, this.options);
this.Direction = Direction2(null, null, this.options);
assert2(this.contents.length, "Provide at least 1 content.");
this.init();
}
SplideRenderer2.clean = function clean(splide) {
var _EventInterface14 = EventInterface(splide), on2 = _EventInterface14.on;
var root2 = splide.root;
var clones = queryAll(root2, "." + CLASS_CLONE);
on2(EVENT_MOUNTED, function() {
remove3(child(root2, "style"));
});
remove3(clones);
};
var _proto3 = SplideRenderer2.prototype;
_proto3.init = function init3() {
this.parseBreakpoints();
this.initSlides();
this.registerRootStyles();
this.registerTrackStyles();
this.registerSlideStyles();
this.registerListStyles();
};
_proto3.initSlides = function initSlides() {
var _this4 = this;
push2(this.slides, this.contents.map(function(content2, index2) {
content2 = isString2(content2) ? {
html: content2
} : content2;
content2.styles = content2.styles || {};
content2.attrs = content2.attrs || {};
_this4.cover(content2);
var classes = _this4.options.classes.slide + " " + (index2 === 0 ? CLASS_ACTIVE : "");
assign2(content2.attrs, {
class: (classes + " " + (content2.attrs.class || "")).trim(),
style: _this4.buildStyles(content2.styles)
});
return content2;
}));
if (this.isLoop()) {
this.generateClones(this.slides);
}
};
_proto3.registerRootStyles = function registerRootStyles() {
var _this5 = this;
this.breakpoints.forEach(function(_ref22) {
var width2 = _ref22[0], options2 = _ref22[1];
_this5.Style.rule(" ", "max-width", unit2(options2.width), width2);
});
};
_proto3.registerTrackStyles = function registerTrackStyles() {
var _this6 = this;
var Style2 = this.Style;
var selector = "." + CLASS_TRACK;
this.breakpoints.forEach(function(_ref3) {
var width2 = _ref3[0], options2 = _ref3[1];
Style2.rule(selector, _this6.resolve("paddingLeft"), _this6.cssPadding(options2, false), width2);
Style2.rule(selector, _this6.resolve("paddingRight"), _this6.cssPadding(options2, true), width2);
Style2.rule(selector, "height", _this6.cssTrackHeight(options2), width2);
});
};
_proto3.registerListStyles = function registerListStyles() {
var _this7 = this;
var Style2 = this.Style;
var selector = "." + CLASS_LIST;
this.breakpoints.forEach(function(_ref4) {
var width2 = _ref4[0], options2 = _ref4[1];
Style2.rule(selector, "transform", _this7.buildTranslate(options2), width2);
if (!_this7.cssSlideHeight(options2)) {
Style2.rule(selector, "aspect-ratio", _this7.cssAspectRatio(options2), width2);
}
});
};
_proto3.registerSlideStyles = function registerSlideStyles() {
var _this8 = this;
var Style2 = this.Style;
var selector = "." + CLASS_SLIDE;
this.breakpoints.forEach(function(_ref5) {
var width2 = _ref5[0], options2 = _ref5[1];
Style2.rule(selector, "width", _this8.cssSlideWidth(options2), width2);
Style2.rule(selector, "height", _this8.cssSlideHeight(options2) || "100%", width2);
Style2.rule(selector, _this8.resolve("marginRight"), unit2(options2.gap) || "0px", width2);
Style2.rule(selector + " > img", "display", options2.cover ? "none" : "inline", width2);
});
};
_proto3.buildTranslate = function buildTranslate(options2) {
var _this$Direction = this.Direction, resolve3 = _this$Direction.resolve, orient = _this$Direction.orient;
var values2 = [];
values2.push(this.cssOffsetClones(options2));
values2.push(this.cssOffsetGaps(options2));
if (this.isCenter(options2)) {
values2.push(this.buildCssValue(orient(-50), "%"));
values2.push.apply(values2, this.cssOffsetCenter(options2));
}
return values2.filter(Boolean).map(function(value2) {
return "translate" + resolve3("X") + "(" + value2 + ")";
}).join(" ");
};
_proto3.cssOffsetClones = function cssOffsetClones(options2) {
var _this$Direction2 = this.Direction, resolve3 = _this$Direction2.resolve, orient = _this$Direction2.orient;
var cloneCount = this.getCloneCount();
if (this.isFixedWidth(options2)) {
var _this$parseCssValue = this.parseCssValue(options2[resolve3("fixedWidth")]), value2 = _this$parseCssValue.value, unit22 = _this$parseCssValue.unit;
return this.buildCssValue(orient(value2) * cloneCount, unit22);
}
var percent = 100 * cloneCount / options2.perPage;
return orient(percent) + "%";
};
_proto3.cssOffsetCenter = function cssOffsetCenter(options2) {
var _this$Direction3 = this.Direction, resolve3 = _this$Direction3.resolve, orient = _this$Direction3.orient;
if (this.isFixedWidth(options2)) {
var _this$parseCssValue2 = this.parseCssValue(options2[resolve3("fixedWidth")]), value2 = _this$parseCssValue2.value, unit22 = _this$parseCssValue2.unit;
return [this.buildCssValue(orient(value2 / 2), unit22)];
}
var values2 = [];
var perPage = options2.perPage, gap = options2.gap;
values2.push(orient(50 / perPage) + "%");
if (gap) {
var _this$parseCssValue3 = this.parseCssValue(gap), _value = _this$parseCssValue3.value, _unit = _this$parseCssValue3.unit;
var gapOffset = (_value / perPage - _value) / 2;
values2.push(this.buildCssValue(orient(gapOffset), _unit));
}
return values2;
};
_proto3.cssOffsetGaps = function cssOffsetGaps(options2) {
var cloneCount = this.getCloneCount();
if (cloneCount && options2.gap) {
var orient = this.Direction.orient;
var _this$parseCssValue4 = this.parseCssValue(options2.gap), value2 = _this$parseCssValue4.value, unit22 = _this$parseCssValue4.unit;
if (this.isFixedWidth(options2)) {
return this.buildCssValue(orient(value2 * cloneCount), unit22);
}
var perPage = options2.perPage;
var gaps = cloneCount / perPage;
return this.buildCssValue(orient(gaps * value2), unit22);
}
return "";
};
_proto3.resolve = function resolve3(prop) {
return camelToKebab(this.Direction.resolve(prop));
};
_proto3.cssPadding = function cssPadding(options2, right2) {
var padding2 = options2.padding;
var prop = this.Direction.resolve(right2 ? "right" : "left", true);
return padding2 && unit2(padding2[prop] || (isObject2(padding2) ? 0 : padding2)) || "0px";
};
_proto3.cssTrackHeight = function cssTrackHeight(options2) {
var height2 = "";
if (this.isVertical()) {
height2 = this.cssHeight(options2);
assert2(height2, '"height" is missing.');
height2 = "calc(" + height2 + " - " + this.cssPadding(options2, false) + " - " + this.cssPadding(options2, true) + ")";
}
return height2;
};
_proto3.cssHeight = function cssHeight(options2) {
return unit2(options2.height);
};
_proto3.cssSlideWidth = function cssSlideWidth(options2) {
return options2.autoWidth ? "" : unit2(options2.fixedWidth) || (this.isVertical() ? "" : this.cssSlideSize(options2));
};
_proto3.cssSlideHeight = function cssSlideHeight(options2) {
return unit2(options2.fixedHeight) || (this.isVertical() ? options2.autoHeight ? "" : this.cssSlideSize(options2) : this.cssHeight(options2));
};
_proto3.cssSlideSize = function cssSlideSize(options2) {
var gap = unit2(options2.gap);
return "calc((100%" + (gap && " + " + gap) + ")/" + (options2.perPage || 1) + (gap && " - " + gap) + ")";
};
_proto3.cssAspectRatio = function cssAspectRatio(options2) {
var heightRatio = options2.heightRatio;
return heightRatio ? "" + 1 / heightRatio : "";
};
_proto3.buildCssValue = function buildCssValue(value2, unit22) {
return "" + value2 + unit22;
};
_proto3.parseCssValue = function parseCssValue(value2) {
if (isString2(value2)) {
var number2 = parseFloat(value2) || 0;
var unit22 = value2.replace(/\d*(\.\d*)?/, "") || "px";
return {
value: number2,
unit: unit22
};
}
return {
value: value2,
unit: "px"
};
};
_proto3.parseBreakpoints = function parseBreakpoints() {
var _this9 = this;
var breakpoints = this.options.breakpoints;
this.breakpoints.push(["default", this.options]);
if (breakpoints) {
forOwn(breakpoints, function(options2, width2) {
_this9.breakpoints.push([width2, merge2(merge2({}, _this9.options), options2)]);
});
}
};
_proto3.isFixedWidth = function isFixedWidth(options2) {
return !!options2[this.Direction.resolve("fixedWidth")];
};
_proto3.isLoop = function isLoop() {
return this.options.type === LOOP;
};
_proto3.isCenter = function isCenter(options2) {
if (options2.focus === "center") {
if (this.isLoop()) {
return true;
}
if (this.options.type === SLIDE) {
return !this.options.trimSpace;
}
}
return false;
};
_proto3.isVertical = function isVertical() {
return this.options.direction === TTB;
};
_proto3.buildClasses = function buildClasses() {
var options2 = this.options;
return [CLASS_ROOT, CLASS_ROOT + "--" + options2.type, CLASS_ROOT + "--" + options2.direction, options2.drag && CLASS_ROOT + "--draggable", options2.isNavigation && CLASS_ROOT + "--nav", CLASS_ACTIVE, !this.config.hidden && CLASS_RENDERED].filter(Boolean).join(" ");
};
_proto3.buildAttrs = function buildAttrs(attrs) {
var attr2 = "";
forOwn(attrs, function(value2, key2) {
attr2 += value2 ? " " + camelToKebab(key2) + '="' + value2 + '"' : "";
});
return attr2.trim();
};
_proto3.buildStyles = function buildStyles(styles2) {
var style3 = "";
forOwn(styles2, function(value2, key2) {
style3 += " " + camelToKebab(key2) + ":" + value2 + ";";
});
return style3.trim();
};
_proto3.renderSlides = function renderSlides() {
var _this10 = this;
var tag = this.config.slideTag;
return this.slides.map(function(content2) {
return "<" + tag + " " + _this10.buildAttrs(content2.attrs) + ">" + (content2.html || "") + "</" + tag + ">";
}).join("");
};
_proto3.cover = function cover(content2) {
var styles2 = content2.styles, _content$html = content2.html, html2 = _content$html === void 0 ? "" : _content$html;
if (this.options.cover && !this.options.lazyLoad) {
var src = html2.match(/<img.*?src\s*=\s*(['"])(.+?)\1.*?>/);
if (src && src[2]) {
styles2.background = "center/cover no-repeat url('" + src[2] + "')";
}
}
};
_proto3.generateClones = function generateClones(contents) {
var classes = this.options.classes;
var count2 = this.getCloneCount();
var slides = contents.slice();
while (slides.length < count2) {
push2(slides, slides);
}
push2(slides.slice(-count2).reverse(), slides.slice(0, count2)).forEach(function(content2, index2) {
var attrs = assign2({}, content2.attrs, {
class: content2.attrs.class + " " + classes.clone
});
var clone2 = assign2({}, content2, {
attrs
});
index2 < count2 ? contents.unshift(clone2) : contents.push(clone2);
});
};
_proto3.getCloneCount = function getCloneCount() {
if (this.isLoop()) {
var options2 = this.options;
if (options2.clones) {
return options2.clones;
}
var perPage = max2.apply(void 0, this.breakpoints.map(function(_ref6) {
var options22 = _ref6[1];
return options22.perPage;
}));
return perPage * ((options2.flickMaxPages || 1) + 1);
}
return 0;
};
_proto3.renderArrows = function renderArrows() {
var html2 = "";
html2 += '<div class="' + this.options.classes.arrows + '">';
html2 += this.renderArrow(true);
html2 += this.renderArrow(false);
html2 += "</div>";
return html2;
};
_proto3.renderArrow = function renderArrow(prev2) {
var _this$options = this.options, classes = _this$options.classes, i18n = _this$options.i18n;
var attrs = {
class: classes.arrow + " " + (prev2 ? classes.prev : classes.next),
type: "button",
ariaLabel: prev2 ? i18n.prev : i18n.next
};
return "<button " + this.buildAttrs(attrs) + '><svg xmlns="' + XML_NAME_SPACE + '" viewBox="0 0 ' + SIZE2 + " " + SIZE2 + '" width="' + SIZE2 + '" height="' + SIZE2 + '"><path d="' + (this.options.arrowPath || PATH) + '" /></svg></button>';
};
_proto3.html = function html2() {
var _this$config = this.config, rootClass = _this$config.rootClass, listTag = _this$config.listTag, arrows = _this$config.arrows, beforeTrack = _this$config.beforeTrack, afterTrack = _this$config.afterTrack, slider = _this$config.slider, beforeSlider = _this$config.beforeSlider, afterSlider = _this$config.afterSlider;
var html3 = "";
html3 += '<div id="' + this.id + '" class="' + this.buildClasses() + " " + (rootClass || "") + '">';
html3 += "<style>" + this.Style.build() + "</style>";
if (slider) {
html3 += beforeSlider || "";
html3 += '<div class="splide__slider">';
}
html3 += beforeTrack || "";
if (arrows) {
html3 += this.renderArrows();
}
html3 += '<div class="splide__track">';
html3 += "<" + listTag + ' class="splide__list">';
html3 += this.renderSlides();
html3 += "</" + listTag + ">";
html3 += "</div>";
html3 += afterTrack || "";
if (slider) {
html3 += "</div>";
html3 += afterSlider || "";
}
html3 += "</div>";
return html3;
};
return SplideRenderer2;
}();
exports.CLASSES = CLASSES;
exports.CLASS_ACTIVE = CLASS_ACTIVE;
exports.CLASS_ARROW = CLASS_ARROW;
exports.CLASS_ARROWS = CLASS_ARROWS;
exports.CLASS_ARROW_NEXT = CLASS_ARROW_NEXT;
exports.CLASS_ARROW_PREV = CLASS_ARROW_PREV;
exports.CLASS_CLONE = CLASS_CLONE;
exports.CLASS_CONTAINER = CLASS_CONTAINER;
exports.CLASS_FOCUS_IN = CLASS_FOCUS_IN;
exports.CLASS_INITIALIZED = CLASS_INITIALIZED;
exports.CLASS_LIST = CLASS_LIST;
exports.CLASS_LOADING = CLASS_LOADING;
exports.CLASS_NEXT = CLASS_NEXT;
exports.CLASS_OVERFLOW = CLASS_OVERFLOW;
exports.CLASS_PAGINATION = CLASS_PAGINATION;
exports.CLASS_PAGINATION_PAGE = CLASS_PAGINATION_PAGE;
exports.CLASS_PREV = CLASS_PREV;
exports.CLASS_PROGRESS = CLASS_PROGRESS;
exports.CLASS_PROGRESS_BAR = CLASS_PROGRESS_BAR;
exports.CLASS_ROOT = CLASS_ROOT;
exports.CLASS_SLIDE = CLASS_SLIDE;
exports.CLASS_SPINNER = CLASS_SPINNER;
exports.CLASS_SR = CLASS_SR;
exports.CLASS_TOGGLE = CLASS_TOGGLE;
exports.CLASS_TOGGLE_PAUSE = CLASS_TOGGLE_PAUSE;
exports.CLASS_TOGGLE_PLAY = CLASS_TOGGLE_PLAY;
exports.CLASS_TRACK = CLASS_TRACK;
exports.CLASS_VISIBLE = CLASS_VISIBLE;
exports.DEFAULTS = DEFAULTS;
exports.EVENT_ACTIVE = EVENT_ACTIVE;
exports.EVENT_ARROWS_MOUNTED = EVENT_ARROWS_MOUNTED;
exports.EVENT_ARROWS_UPDATED = EVENT_ARROWS_UPDATED;
exports.EVENT_AUTOPLAY_PAUSE = EVENT_AUTOPLAY_PAUSE;
exports.EVENT_AUTOPLAY_PLAY = EVENT_AUTOPLAY_PLAY;
exports.EVENT_AUTOPLAY_PLAYING = EVENT_AUTOPLAY_PLAYING;
exports.EVENT_CLICK = EVENT_CLICK;
exports.EVENT_DESTROY = EVENT_DESTROY;
exports.EVENT_DRAG = EVENT_DRAG;
exports.EVENT_DRAGGED = EVENT_DRAGGED;
exports.EVENT_DRAGGING = EVENT_DRAGGING;
exports.EVENT_END_INDEX_CHANGED = EVENT_END_INDEX_CHANGED;
exports.EVENT_HIDDEN = EVENT_HIDDEN;
exports.EVENT_INACTIVE = EVENT_INACTIVE;
exports.EVENT_LAZYLOAD_LOADED = EVENT_LAZYLOAD_LOADED;
exports.EVENT_MOUNTED = EVENT_MOUNTED;
exports.EVENT_MOVE = EVENT_MOVE;
exports.EVENT_MOVED = EVENT_MOVED;
exports.EVENT_NAVIGATION_MOUNTED = EVENT_NAVIGATION_MOUNTED;
exports.EVENT_OVERFLOW = EVENT_OVERFLOW;
exports.EVENT_PAGINATION_MOUNTED = EVENT_PAGINATION_MOUNTED;
exports.EVENT_PAGINATION_UPDATED = EVENT_PAGINATION_UPDATED;
exports.EVENT_READY = EVENT_READY;
exports.EVENT_REFRESH = EVENT_REFRESH;
exports.EVENT_RESIZE = EVENT_RESIZE;
exports.EVENT_RESIZED = EVENT_RESIZED;
exports.EVENT_SCROLL = EVENT_SCROLL;
exports.EVENT_SCROLLED = EVENT_SCROLLED;
exports.EVENT_SHIFTED = EVENT_SHIFTED;
exports.EVENT_SLIDE_KEYDOWN = EVENT_SLIDE_KEYDOWN;
exports.EVENT_UPDATED = EVENT_UPDATED;
exports.EVENT_VISIBLE = EVENT_VISIBLE;
exports.EventBinder = EventBinder;
exports.EventInterface = EventInterface;
exports.FADE = FADE;
exports.LOOP = LOOP;
exports.LTR = LTR;
exports.RTL = RTL;
exports.RequestInterval = RequestInterval;
exports.SLIDE = SLIDE;
exports.STATUS_CLASSES = STATUS_CLASSES;
exports.Splide = Splide;
exports.SplideRenderer = SplideRenderer;
exports.State = State;
exports.TTB = TTB;
exports.Throttle = Throttle;
exports["default"] = Splide;
})(splide_cjs);
return splide_cjs;
}
const splideCore_min = "";
const splideCore_min$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: splideCore_min
}, Symbol.toStringTag, { value: "Module" }));
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(splideCore_min$1);
var numeral = { exports: {} };
/*! @preserve
* numeral.js
* version : 2.0.6
* author : Adam Draper
* license : MIT
* http://adamwdraper.github.com/Numeral-js/
*/
var hasRequiredNumeral;
function requireNumeral() {
if (hasRequiredNumeral)
return numeral.exports;
hasRequiredNumeral = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
module.exports = factory();
} else {
global2.numeral = factory();
}
})(commonjsGlobal$1, function() {
var numeral2, _24, VERSION = "2.0.6", formats2 = {}, locales = {}, defaults2 = {
currentLocale: "en",
zeroFormat: null,
nullFormat: null,
defaultFormat: "0,0",
scalePercentBy100: true
}, options2 = {
currentLocale: defaults2.currentLocale,
zeroFormat: defaults2.zeroFormat,
nullFormat: defaults2.nullFormat,
defaultFormat: defaults2.defaultFormat,
scalePercentBy100: defaults2.scalePercentBy100
};
function Numeral(input, number2) {
this._input = input;
this._value = number2;
}
numeral2 = function(input) {
var value2, kind, unformatFunction, regexp;
if (numeral2.isNumeral(input)) {
value2 = input.value();
} else if (input === 0 || typeof input === "undefined") {
value2 = 0;
} else if (input === null || _24.isNaN(input)) {
value2 = null;
} else if (typeof input === "string") {
if (options2.zeroFormat && input === options2.zeroFormat) {
value2 = 0;
} else if (options2.nullFormat && input === options2.nullFormat || !input.replace(/[^0-9]+/g, "").length) {
value2 = null;
} else {
for (kind in formats2) {
regexp = typeof formats2[kind].regexps.unformat === "function" ? formats2[kind].regexps.unformat() : formats2[kind].regexps.unformat;
if (regexp && input.match(regexp)) {
unformatFunction = formats2[kind].unformat;
break;
}
}
unformatFunction = unformatFunction || numeral2._.stringToNumber;
value2 = unformatFunction(input);
}
} else {
value2 = Number(input) || null;
}
return new Numeral(input, value2);
};
numeral2.version = VERSION;
numeral2.isNumeral = function(obj) {
return obj instanceof Numeral;
};
numeral2._ = _24 = {
// formats numbers separators, decimals places, signs, abbreviations
numberToFormat: function(value2, format2, roundingFunction) {
var locale2 = locales[numeral2.options.currentLocale], negP = false, optDec = false, leadingCount = 0, abbr = "", trillion = 1e12, billion = 1e9, million = 1e6, thousand = 1e3, decimal = "", neg = false, abbrForce, abs2, int2, precision, signed, thousands, output3;
value2 = value2 || 0;
abs2 = Math.abs(value2);
if (numeral2._.includes(format2, "(")) {
negP = true;
format2 = format2.replace(/[\(|\)]/g, "");
} else if (numeral2._.includes(format2, "+") || numeral2._.includes(format2, "-")) {
signed = numeral2._.includes(format2, "+") ? format2.indexOf("+") : value2 < 0 ? format2.indexOf("-") : -1;
format2 = format2.replace(/[\+|\-]/g, "");
}
if (numeral2._.includes(format2, "a")) {
abbrForce = format2.match(/a(k|m|b|t)?/);
abbrForce = abbrForce ? abbrForce[1] : false;
if (numeral2._.includes(format2, " a")) {
abbr = " ";
}
format2 = format2.replace(new RegExp(abbr + "a[kmbt]?"), "");
if (abs2 >= trillion && !abbrForce || abbrForce === "t") {
abbr += locale2.abbreviations.trillion;
value2 = value2 / trillion;
} else if (abs2 < trillion && abs2 >= billion && !abbrForce || abbrForce === "b") {
abbr += locale2.abbreviations.billion;
value2 = value2 / billion;
} else if (abs2 < billion && abs2 >= million && !abbrForce || abbrForce === "m") {
abbr += locale2.abbreviations.million;
value2 = value2 / million;
} else if (abs2 < million && abs2 >= thousand && !abbrForce || abbrForce === "k") {
abbr += locale2.abbreviations.thousand;
value2 = value2 / thousand;
}
}
if (numeral2._.includes(format2, "[.]")) {
optDec = true;
format2 = format2.replace("[.]", ".");
}
int2 = value2.toString().split(".")[0];
precision = format2.split(".")[1];
thousands = format2.indexOf(",");
leadingCount = (format2.split(".")[0].split(",")[0].match(/0/g) || []).length;
if (precision) {
if (numeral2._.includes(precision, "[")) {
precision = precision.replace("]", "");
precision = precision.split("[");
decimal = numeral2._.toFixed(value2, precision[0].length + precision[1].length, roundingFunction, precision[1].length);
} else {
decimal = numeral2._.toFixed(value2, precision.length, roundingFunction);
}
int2 = decimal.split(".")[0];
if (numeral2._.includes(decimal, ".")) {
decimal = locale2.delimiters.decimal + decimal.split(".")[1];
} else {
decimal = "";
}
if (optDec && Number(decimal.slice(1)) === 0) {
decimal = "";
}
} else {
int2 = numeral2._.toFixed(value2, 0, roundingFunction);
}
if (abbr && !abbrForce && Number(int2) >= 1e3 && abbr !== locale2.abbreviations.trillion) {
int2 = String(Number(int2) / 1e3);
switch (abbr) {
case locale2.abbreviations.thousand:
abbr = locale2.abbreviations.million;
break;
case locale2.abbreviations.million:
abbr = locale2.abbreviations.billion;
break;
case locale2.abbreviations.billion:
abbr = locale2.abbreviations.trillion;
break;
}
}
if (numeral2._.includes(int2, "-")) {
int2 = int2.slice(1);
neg = true;
}
if (int2.length < leadingCount) {
for (var i2 = leadingCount - int2.length; i2 > 0; i2--) {
int2 = "0" + int2;
}
}
if (thousands > -1) {
int2 = int2.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1" + locale2.delimiters.thousands);
}
if (format2.indexOf(".") === 0) {
int2 = "";
}
output3 = int2 + decimal + (abbr ? abbr : "");
if (negP) {
output3 = (negP && neg ? "(" : "") + output3 + (negP && neg ? ")" : "");
} else {
if (signed >= 0) {
output3 = signed === 0 ? (neg ? "-" : "+") + output3 : output3 + (neg ? "-" : "+");
} else if (neg) {
output3 = "-" + output3;
}
}
return output3;
},
// unformats numbers separators, decimals places, signs, abbreviations
stringToNumber: function(string2) {
var locale2 = locales[options2.currentLocale], stringOriginal = string2, abbreviations = {
thousand: 3,
million: 6,
billion: 9,
trillion: 12
}, abbreviation, value2, regexp;
if (options2.zeroFormat && string2 === options2.zeroFormat) {
value2 = 0;
} else if (options2.nullFormat && string2 === options2.nullFormat || !string2.replace(/[^0-9]+/g, "").length) {
value2 = null;
} else {
value2 = 1;
if (locale2.delimiters.decimal !== ".") {
string2 = string2.replace(/\./g, "").replace(locale2.delimiters.decimal, ".");
}
for (abbreviation in abbreviations) {
regexp = new RegExp("[^a-zA-Z]" + locale2.abbreviations[abbreviation] + "(?:\\)|(\\" + locale2.currency.symbol + ")?(?:\\))?)?$");
if (stringOriginal.match(regexp)) {
value2 *= Math.pow(10, abbreviations[abbreviation]);
break;
}
}
value2 *= (string2.split("-").length + Math.min(string2.split("(").length - 1, string2.split(")").length - 1)) % 2 ? 1 : -1;
string2 = string2.replace(/[^0-9\.]+/g, "");
value2 *= Number(string2);
}
return value2;
},
isNaN: function(value2) {
return typeof value2 === "number" && isNaN(value2);
},
includes: function(string2, search) {
return string2.indexOf(search) !== -1;
},
insert: function(string2, subString, start2) {
return string2.slice(0, start2) + subString + string2.slice(start2);
},
reduce: function(array2, callback) {
if (this === null) {
throw new TypeError("Array.prototype.reduce called on null or undefined");
}
if (typeof callback !== "function") {
throw new TypeError(callback + " is not a function");
}
var t5 = Object(array2), len = t5.length >>> 0, k2 = 0, value2;
if (arguments.length === 3) {
value2 = arguments[2];
} else {
while (k2 < len && !(k2 in t5)) {
k2++;
}
if (k2 >= len) {
throw new TypeError("Reduce of empty array with no initial value");
}
value2 = t5[k2++];
}
for (; k2 < len; k2++) {
if (k2 in t5) {
value2 = callback(value2, t5[k2], k2, t5);
}
}
return value2;
},
/**
* Computes the multiplier necessary to make x >= 1,
* effectively eliminating miscalculations caused by
* finite precision.
*/
multiplier: function(x2) {
var parts2 = x2.toString().split(".");
return parts2.length < 2 ? 1 : Math.pow(10, parts2[1].length);
},
/**
* Given a variable number of arguments, returns the maximum
* multiplier that must be used to normalize an operation involving
* all of them.
*/
correctionFactor: function() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(accum, next2) {
var mn2 = _24.multiplier(next2);
return accum > mn2 ? accum : mn2;
}, 1);
},
/**
* Implementation of toFixed() that treats floats more like decimals
*
* Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present
* problems for accounting- and finance-related software.
*/
toFixed: function(value2, maxDecimals, roundingFunction, optionals) {
var splitValue = value2.toString().split("."), minDecimals = maxDecimals - (optionals || 0), boundedPrecision, optionalsRegExp, power, output3;
if (splitValue.length === 2) {
boundedPrecision = Math.min(Math.max(splitValue[1].length, minDecimals), maxDecimals);
} else {
boundedPrecision = minDecimals;
}
power = Math.pow(10, boundedPrecision);
output3 = (roundingFunction(value2 + "e+" + boundedPrecision) / power).toFixed(boundedPrecision);
if (optionals > maxDecimals - boundedPrecision) {
optionalsRegExp = new RegExp("\\.?0{1," + (optionals - (maxDecimals - boundedPrecision)) + "}$");
output3 = output3.replace(optionalsRegExp, "");
}
return output3;
}
};
numeral2.options = options2;
numeral2.formats = formats2;
numeral2.locales = locales;
numeral2.locale = function(key2) {
if (key2) {
options2.currentLocale = key2.toLowerCase();
}
return options2.currentLocale;
};
numeral2.localeData = function(key2) {
if (!key2) {
return locales[options2.currentLocale];
}
key2 = key2.toLowerCase();
if (!locales[key2]) {
throw new Error("Unknown locale : " + key2);
}
return locales[key2];
};
numeral2.reset = function() {
for (var property2 in defaults2) {
options2[property2] = defaults2[property2];
}
};
numeral2.zeroFormat = function(format2) {
options2.zeroFormat = typeof format2 === "string" ? format2 : null;
};
numeral2.nullFormat = function(format2) {
options2.nullFormat = typeof format2 === "string" ? format2 : null;
};
numeral2.defaultFormat = function(format2) {
options2.defaultFormat = typeof format2 === "string" ? format2 : "0.0";
};
numeral2.register = function(type2, name, format2) {
name = name.toLowerCase();
if (this[type2 + "s"][name]) {
throw new TypeError(name + " " + type2 + " already registered.");
}
this[type2 + "s"][name] = format2;
return format2;
};
numeral2.validate = function(val, culture) {
var _decimalSep, _thousandSep, _currSymbol, _valArray, _abbrObj, _thousandRegEx, localeData, temp2;
if (typeof val !== "string") {
val += "";
if (console.warn) {
console.warn("Numeral.js: Value is not string. It has been co-erced to: ", val);
}
}
val = val.trim();
if (!!val.match(/^\d+$/)) {
return true;
}
if (val === "") {
return false;
}
try {
localeData = numeral2.localeData(culture);
} catch (e7) {
localeData = numeral2.localeData(numeral2.locale());
}
_currSymbol = localeData.currency.symbol;
_abbrObj = localeData.abbreviations;
_decimalSep = localeData.delimiters.decimal;
if (localeData.delimiters.thousands === ".") {
_thousandSep = "\\.";
} else {
_thousandSep = localeData.delimiters.thousands;
}
temp2 = val.match(/^[^\d]+/);
if (temp2 !== null) {
val = val.substr(1);
if (temp2[0] !== _currSymbol) {
return false;
}
}
temp2 = val.match(/[^\d]+$/);
if (temp2 !== null) {
val = val.slice(0, -1);
if (temp2[0] !== _abbrObj.thousand && temp2[0] !== _abbrObj.million && temp2[0] !== _abbrObj.billion && temp2[0] !== _abbrObj.trillion) {
return false;
}
}
_thousandRegEx = new RegExp(_thousandSep + "{2}");
if (!val.match(/[^\d.,]/g)) {
_valArray = val.split(_decimalSep);
if (_valArray.length > 2) {
return false;
} else {
if (_valArray.length < 2) {
return !!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx);
} else {
if (_valArray[0].length === 1) {
return !!_valArray[0].match(/^\d+$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/);
} else {
return !!_valArray[0].match(/^\d+.*\d$/) && !_valArray[0].match(_thousandRegEx) && !!_valArray[1].match(/^\d+$/);
}
}
}
}
return false;
};
numeral2.fn = Numeral.prototype = {
clone: function() {
return numeral2(this);
},
format: function(inputString, roundingFunction) {
var value2 = this._value, format2 = inputString || options2.defaultFormat, kind, output3, formatFunction;
roundingFunction = roundingFunction || Math.round;
if (value2 === 0 && options2.zeroFormat !== null) {
output3 = options2.zeroFormat;
} else if (value2 === null && options2.nullFormat !== null) {
output3 = options2.nullFormat;
} else {
for (kind in formats2) {
if (format2.match(formats2[kind].regexps.format)) {
formatFunction = formats2[kind].format;
break;
}
}
formatFunction = formatFunction || numeral2._.numberToFormat;
output3 = formatFunction(value2, format2, roundingFunction);
}
return output3;
},
value: function() {
return this._value;
},
input: function() {
return this._input;
},
set: function(value2) {
this._value = Number(value2);
return this;
},
add: function(value2) {
var corrFactor = _24.correctionFactor.call(null, this._value, value2);
function cback(accum, curr, currI, O2) {
return accum + Math.round(corrFactor * curr);
}
this._value = _24.reduce([this._value, value2], cback, 0) / corrFactor;
return this;
},
subtract: function(value2) {
var corrFactor = _24.correctionFactor.call(null, this._value, value2);
function cback(accum, curr, currI, O2) {
return accum - Math.round(corrFactor * curr);
}
this._value = _24.reduce([value2], cback, Math.round(this._value * corrFactor)) / corrFactor;
return this;
},
multiply: function(value2) {
function cback(accum, curr, currI, O2) {
var corrFactor = _24.correctionFactor(accum, curr);
return Math.round(accum * corrFactor) * Math.round(curr * corrFactor) / Math.round(corrFactor * corrFactor);
}
this._value = _24.reduce([this._value, value2], cback, 1);
return this;
},
divide: function(value2) {
function cback(accum, curr, currI, O2) {
var corrFactor = _24.correctionFactor(accum, curr);
return Math.round(accum * corrFactor) / Math.round(curr * corrFactor);
}
this._value = _24.reduce([this._value, value2], cback);
return this;
},
difference: function(value2) {
return Math.abs(numeral2(this._value).subtract(value2).value());
}
};
numeral2.register("locale", "en", {
delimiters: {
thousands: ",",
decimal: "."
},
abbreviations: {
thousand: "k",
million: "m",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
var b2 = number2 % 10;
return ~~(number2 % 100 / 10) === 1 ? "th" : b2 === 1 ? "st" : b2 === 2 ? "nd" : b2 === 3 ? "rd" : "th";
},
currency: {
symbol: "$"
}
});
(function() {
numeral2.register("format", "bps", {
regexps: {
format: /(BPS)/,
unformat: /(BPS)/
},
format: function(value2, format2, roundingFunction) {
var space = numeral2._.includes(format2, " BPS") ? " " : "", output3;
value2 = value2 * 1e4;
format2 = format2.replace(/\s?BPS/, "");
output3 = numeral2._.numberToFormat(value2, format2, roundingFunction);
if (numeral2._.includes(output3, ")")) {
output3 = output3.split("");
output3.splice(-1, 0, space + "BPS");
output3 = output3.join("");
} else {
output3 = output3 + space + "BPS";
}
return output3;
},
unformat: function(string2) {
return +(numeral2._.stringToNumber(string2) * 1e-4).toFixed(15);
}
});
})();
(function() {
var decimal = {
base: 1e3,
suffixes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
}, binary = {
base: 1024,
suffixes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
};
var allSuffixes = decimal.suffixes.concat(binary.suffixes.filter(function(item) {
return decimal.suffixes.indexOf(item) < 0;
}));
var unformatRegex = allSuffixes.join("|");
unformatRegex = "(" + unformatRegex.replace("B", "B(?!PS)") + ")";
numeral2.register("format", "bytes", {
regexps: {
format: /([0\s]i?b)/,
unformat: new RegExp(unformatRegex)
},
format: function(value2, format2, roundingFunction) {
var output3, bytes = numeral2._.includes(format2, "ib") ? binary : decimal, suffix2 = numeral2._.includes(format2, " b") || numeral2._.includes(format2, " ib") ? " " : "", power, min2, max2;
format2 = format2.replace(/\s?i?b/, "");
for (power = 0; power <= bytes.suffixes.length; power++) {
min2 = Math.pow(bytes.base, power);
max2 = Math.pow(bytes.base, power + 1);
if (value2 === null || value2 === 0 || value2 >= min2 && value2 < max2) {
suffix2 += bytes.suffixes[power];
if (min2 > 0) {
value2 = value2 / min2;
}
break;
}
}
output3 = numeral2._.numberToFormat(value2, format2, roundingFunction);
return output3 + suffix2;
},
unformat: function(string2) {
var value2 = numeral2._.stringToNumber(string2), power, bytesMultiplier;
if (value2) {
for (power = decimal.suffixes.length - 1; power >= 0; power--) {
if (numeral2._.includes(string2, decimal.suffixes[power])) {
bytesMultiplier = Math.pow(decimal.base, power);
break;
}
if (numeral2._.includes(string2, binary.suffixes[power])) {
bytesMultiplier = Math.pow(binary.base, power);
break;
}
}
value2 *= bytesMultiplier || 1;
}
return value2;
}
});
})();
(function() {
numeral2.register("format", "currency", {
regexps: {
format: /(\$)/
},
format: function(value2, format2, roundingFunction) {
var locale2 = numeral2.locales[numeral2.options.currentLocale], symbols2 = {
before: format2.match(/^([\+|\-|\(|\s|\$]*)/)[0],
after: format2.match(/([\+|\-|\)|\s|\$]*)$/)[0]
}, output3, symbol2, i2;
format2 = format2.replace(/\s?\$\s?/, "");
output3 = numeral2._.numberToFormat(value2, format2, roundingFunction);
if (value2 >= 0) {
symbols2.before = symbols2.before.replace(/[\-\(]/, "");
symbols2.after = symbols2.after.replace(/[\-\)]/, "");
} else if (value2 < 0 && (!numeral2._.includes(symbols2.before, "-") && !numeral2._.includes(symbols2.before, "("))) {
symbols2.before = "-" + symbols2.before;
}
for (i2 = 0; i2 < symbols2.before.length; i2++) {
symbol2 = symbols2.before[i2];
switch (symbol2) {
case "$":
output3 = numeral2._.insert(output3, locale2.currency.symbol, i2);
break;
case " ":
output3 = numeral2._.insert(output3, " ", i2 + locale2.currency.symbol.length - 1);
break;
}
}
for (i2 = symbols2.after.length - 1; i2 >= 0; i2--) {
symbol2 = symbols2.after[i2];
switch (symbol2) {
case "$":
output3 = i2 === symbols2.after.length - 1 ? output3 + locale2.currency.symbol : numeral2._.insert(output3, locale2.currency.symbol, -(symbols2.after.length - (1 + i2)));
break;
case " ":
output3 = i2 === symbols2.after.length - 1 ? output3 + " " : numeral2._.insert(output3, " ", -(symbols2.after.length - (1 + i2) + locale2.currency.symbol.length - 1));
break;
}
}
return output3;
}
});
})();
(function() {
numeral2.register("format", "exponential", {
regexps: {
format: /(e\+|e-)/,
unformat: /(e\+|e-)/
},
format: function(value2, format2, roundingFunction) {
var output3, exponential2 = typeof value2 === "number" && !numeral2._.isNaN(value2) ? value2.toExponential() : "0e+0", parts2 = exponential2.split("e");
format2 = format2.replace(/e[\+|\-]{1}0/, "");
output3 = numeral2._.numberToFormat(Number(parts2[0]), format2, roundingFunction);
return output3 + "e" + parts2[1];
},
unformat: function(string2) {
var parts2 = numeral2._.includes(string2, "e+") ? string2.split("e+") : string2.split("e-"), value2 = Number(parts2[0]), power = Number(parts2[1]);
power = numeral2._.includes(string2, "e-") ? power *= -1 : power;
function cback(accum, curr, currI, O2) {
var corrFactor = numeral2._.correctionFactor(accum, curr), num = accum * corrFactor * (curr * corrFactor) / (corrFactor * corrFactor);
return num;
}
return numeral2._.reduce([value2, Math.pow(10, power)], cback, 1);
}
});
})();
(function() {
numeral2.register("format", "ordinal", {
regexps: {
format: /(o)/
},
format: function(value2, format2, roundingFunction) {
var locale2 = numeral2.locales[numeral2.options.currentLocale], output3, ordinal2 = numeral2._.includes(format2, " o") ? " " : "";
format2 = format2.replace(/\s?o/, "");
ordinal2 += locale2.ordinal(value2);
output3 = numeral2._.numberToFormat(value2, format2, roundingFunction);
return output3 + ordinal2;
}
});
})();
(function() {
numeral2.register("format", "percentage", {
regexps: {
format: /(%)/,
unformat: /(%)/
},
format: function(value2, format2, roundingFunction) {
var space = numeral2._.includes(format2, " %") ? " " : "", output3;
if (numeral2.options.scalePercentBy100) {
value2 = value2 * 100;
}
format2 = format2.replace(/\s?\%/, "");
output3 = numeral2._.numberToFormat(value2, format2, roundingFunction);
if (numeral2._.includes(output3, ")")) {
output3 = output3.split("");
output3.splice(-1, 0, space + "%");
output3 = output3.join("");
} else {
output3 = output3 + space + "%";
}
return output3;
},
unformat: function(string2) {
var number2 = numeral2._.stringToNumber(string2);
if (numeral2.options.scalePercentBy100) {
return number2 * 0.01;
}
return number2;
}
});
})();
(function() {
numeral2.register("format", "time", {
regexps: {
format: /(:)/,
unformat: /(:)/
},
format: function(value2, format2, roundingFunction) {
var hours = Math.floor(value2 / 60 / 60), minutes = Math.floor((value2 - hours * 60 * 60) / 60), seconds = Math.round(value2 - hours * 60 * 60 - minutes * 60);
return hours + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds);
},
unformat: function(string2) {
var timeArray = string2.split(":"), seconds = 0;
if (timeArray.length === 3) {
seconds = seconds + Number(timeArray[0]) * 60 * 60;
seconds = seconds + Number(timeArray[1]) * 60;
seconds = seconds + Number(timeArray[2]);
} else if (timeArray.length === 2) {
seconds = seconds + Number(timeArray[0]) * 60;
seconds = seconds + Number(timeArray[1]);
}
return Number(seconds);
}
});
})();
return numeral2;
});
})(numeral);
return numeral.exports;
}
var cs = { exports: {} };
var hasRequiredCs;
function requireCs() {
if (hasRequiredCs)
return cs.exports;
hasRequiredCs = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "cs", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "tis.",
million: "mil.",
billion: "b",
trillion: "t"
},
ordinal: function() {
return ".";
},
currency: {
symbol: "Kč"
}
});
});
})(cs);
return cs.exports;
}
var de$2 = { exports: {} };
var hasRequiredDe;
function requireDe() {
if (hasRequiredDe)
return de$2.exports;
hasRequiredDe = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "de", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "k",
million: "m",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
return ".";
},
currency: {
symbol: "€"
}
});
});
})(de$2);
return de$2.exports;
}
var esEs = { exports: {} };
var hasRequiredEsEs;
function requireEsEs() {
if (hasRequiredEsEs)
return esEs.exports;
hasRequiredEsEs = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "es-es", {
delimiters: {
thousands: ".",
decimal: ","
},
abbreviations: {
thousand: "k",
million: "mm",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
var b2 = number2 % 10;
return b2 === 1 || b2 === 3 ? "er" : b2 === 2 ? "do" : b2 === 7 || b2 === 0 ? "mo" : b2 === 8 ? "vo" : b2 === 9 ? "no" : "to";
},
currency: {
symbol: "€"
}
});
});
})(esEs);
return esEs.exports;
}
var frCa = { exports: {} };
var hasRequiredFrCa;
function requireFrCa() {
if (hasRequiredFrCa)
return frCa.exports;
hasRequiredFrCa = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "fr-ca", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "k",
million: "M",
billion: "G",
trillion: "T"
},
ordinal: function(number2) {
return number2 === 1 ? "er" : "e";
},
currency: {
symbol: "$"
}
});
});
})(frCa);
return frCa.exports;
}
var fr$1 = { exports: {} };
var hasRequiredFr;
function requireFr() {
if (hasRequiredFr)
return fr$1.exports;
hasRequiredFr = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "fr", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "k",
million: "m",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
return number2 === 1 ? "er" : "e";
},
currency: {
symbol: "€"
}
});
});
})(fr$1);
return fr$1.exports;
}
var sl = { exports: {} };
var hasRequiredSl;
function requireSl() {
if (hasRequiredSl)
return sl.exports;
hasRequiredSl = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "sl", {
delimiters: {
thousands: ".",
decimal: ","
},
abbreviations: {
thousand: "k",
million: "mio",
billion: "mrd",
trillion: "trilijon"
},
ordinal: function() {
return ".";
},
currency: {
symbol: "€"
}
});
});
})(sl);
return sl.exports;
}
var hu$1 = { exports: {} };
var hasRequiredHu;
function requireHu() {
if (hasRequiredHu)
return hu$1.exports;
hasRequiredHu = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "hu", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "E",
// ezer
million: "M",
// millió
billion: "Mrd",
// milliárd
trillion: "T"
// trillió
},
ordinal: function(number2) {
return ".";
},
currency: {
symbol: " Ft"
}
});
});
})(hu$1);
return hu$1.exports;
}
var vi$1 = { exports: {} };
var hasRequiredVi;
function requireVi() {
if (hasRequiredVi)
return vi$1.exports;
hasRequiredVi = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "vi", {
delimiters: {
thousands: ".",
decimal: ","
},
abbreviations: {
thousand: " nghìn",
million: " triệu",
billion: " tỷ",
trillion: " nghìn tỷ"
},
ordinal: function() {
return ".";
},
currency: {
symbol: "₫"
}
});
});
})(vi$1);
return vi$1.exports;
}
var it$2 = { exports: {} };
var hasRequiredIt;
function requireIt() {
if (hasRequiredIt)
return it$2.exports;
hasRequiredIt = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "it", {
delimiters: {
thousands: ".",
decimal: ","
},
abbreviations: {
thousand: "mila",
million: "mil",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
return "º";
},
currency: {
symbol: "€"
}
});
});
})(it$2);
return it$2.exports;
}
var ja$1 = { exports: {} };
var hasRequiredJa;
function requireJa() {
if (hasRequiredJa)
return ja$1.exports;
hasRequiredJa = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "ja", {
delimiters: {
thousands: ",",
decimal: "."
},
abbreviations: {
thousand: "千",
million: "百万",
billion: "十億",
trillion: "兆"
},
ordinal: function(number2) {
return ".";
},
currency: {
symbol: "¥"
}
});
});
})(ja$1);
return ja$1.exports;
}
var pl = { exports: {} };
var hasRequiredPl;
function requirePl() {
if (hasRequiredPl)
return pl.exports;
hasRequiredPl = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "pl", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "tys.",
million: "mln",
billion: "mld",
trillion: "bln"
},
ordinal: function(number2) {
return ".";
},
currency: {
symbol: "PLN"
}
});
});
})(pl);
return pl.exports;
}
var ptBr = { exports: {} };
var hasRequiredPtBr;
function requirePtBr() {
if (hasRequiredPtBr)
return ptBr.exports;
hasRequiredPtBr = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "pt-br", {
delimiters: {
thousands: ".",
decimal: ","
},
abbreviations: {
thousand: "mil",
million: "milhões",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
return "º";
},
currency: {
symbol: "R$"
}
});
});
})(ptBr);
return ptBr.exports;
}
var ru$1 = { exports: {} };
var hasRequiredRu;
function requireRu() {
if (hasRequiredRu)
return ru$1.exports;
hasRequiredRu = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "ru", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "тыс.",
million: "млн.",
billion: "млрд.",
trillion: "трлн."
},
ordinal: function() {
return ".";
},
currency: {
symbol: "руб."
}
});
});
})(ru$1);
return ru$1.exports;
}
var sk = { exports: {} };
var hasRequiredSk;
function requireSk() {
if (hasRequiredSk)
return sk.exports;
hasRequiredSk = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "sk", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "tis.",
million: "mil.",
billion: "b",
trillion: "t"
},
ordinal: function() {
return ".";
},
currency: {
symbol: "€"
}
});
});
})(sk);
return sk.exports;
}
var tr$2 = { exports: {} };
var hasRequiredTr;
function requireTr() {
if (hasRequiredTr)
return tr$2.exports;
hasRequiredTr = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
var suffixes = {
1: "'inci",
5: "'inci",
8: "'inci",
70: "'inci",
80: "'inci",
2: "'nci",
7: "'nci",
20: "'nci",
50: "'nci",
3: "'üncü",
4: "'üncü",
100: "'üncü",
6: "'ncı",
9: "'uncu",
10: "'uncu",
30: "'uncu",
60: "'ıncı",
90: "'ıncı"
};
numeral2.register("locale", "tr", {
delimiters: {
thousands: ".",
decimal: ","
},
abbreviations: {
thousand: "bin",
million: "milyon",
billion: "milyar",
trillion: "trilyon"
},
ordinal: function(number2) {
if (number2 === 0) {
return "'ıncı";
}
var a2 = number2 % 10, b2 = number2 % 100 - a2, c2 = number2 >= 100 ? 100 : null;
return suffixes[a2] || suffixes[b2] || suffixes[c2];
},
currency: {
symbol: "₺"
}
});
});
})(tr$2);
return tr$2.exports;
}
var ruUa = { exports: {} };
var hasRequiredRuUa;
function requireRuUa() {
if (hasRequiredRuUa)
return ruUa.exports;
hasRequiredRuUa = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "ru-ua", {
delimiters: {
thousands: " ",
decimal: ","
},
abbreviations: {
thousand: "тыс.",
million: "млн",
billion: "b",
trillion: "t"
},
ordinal: function() {
return ".";
},
currency: {
symbol: "₴"
}
});
});
})(ruUa);
return ruUa.exports;
}
var chs = { exports: {} };
var hasRequiredChs;
function requireChs() {
if (hasRequiredChs)
return chs.exports;
hasRequiredChs = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "chs", {
delimiters: {
thousands: ",",
decimal: "."
},
abbreviations: {
thousand: "千",
million: "百万",
billion: "十亿",
trillion: "兆"
},
ordinal: function(number2) {
return ".";
},
currency: {
symbol: "¥"
}
});
});
})(chs);
return chs.exports;
}
var enGb = { exports: {} };
var hasRequiredEnGb;
function requireEnGb() {
if (hasRequiredEnGb)
return enGb.exports;
hasRequiredEnGb = 1;
(function(module) {
(function(global2, factory) {
if (module.exports) {
factory(requireNumeral());
} else {
factory(global2.numeral);
}
})(commonjsGlobal$1, function(numeral2) {
numeral2.register("locale", "en-gb", {
delimiters: {
thousands: ",",
decimal: "."
},
abbreviations: {
thousand: "k",
million: "m",
billion: "b",
trillion: "t"
},
ordinal: function(number2) {
var b2 = number2 % 10;
return ~~(number2 % 100 / 10) === 1 ? "th" : b2 === 1 ? "st" : b2 === 2 ? "nd" : b2 === 3 ? "rd" : "th";
},
currency: {
symbol: "£"
}
});
});
})(enGb);
return enGb.exports;
}
var cjs = {};
var hasRequiredCjs;
function requireCjs() {
if (hasRequiredCjs)
return cjs;
hasRequiredCjs = 1;
var __createBinding = commonjsGlobal$1 && commonjsGlobal$1.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
if (k22 === void 0)
k22 = k2;
var desc = Object.getOwnPropertyDescriptor(m2, k2);
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m2[k2];
} };
}
Object.defineProperty(o2, k22, desc);
} : function(o2, m2, k2, k22) {
if (k22 === void 0)
k22 = k2;
o2[k22] = m2[k2];
});
var __setModuleDefault = commonjsGlobal$1 && commonjsGlobal$1.__setModuleDefault || (Object.create ? function(o2, v2) {
Object.defineProperty(o2, "default", { enumerable: true, value: v2 });
} : function(o2, v2) {
o2["default"] = v2;
});
var __importStar = commonjsGlobal$1 && commonjsGlobal$1.__importStar || function(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null) {
for (var k2 in mod)
if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2))
__createBinding(result, mod, k2);
}
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(cjs, "__esModule", { value: true });
const react_1 = __importStar(reactExports);
function isNumber2(n2) {
const number2 = parseFloat(n2);
return !isNaN(number2) && isFinite(number2);
}
function isPercentage(height2) {
return typeof height2 === "string" && height2[height2.length - 1] === "%" && isNumber2(height2.substring(0, height2.length - 1));
}
function hideContent(element2, height2) {
if (height2 === 0 && (element2 === null || element2 === void 0 ? void 0 : element2.style)) {
element2.style.display = "none";
}
}
function showContent(element2, height2) {
if (height2 === 0 && (element2 === null || element2 === void 0 ? void 0 : element2.style)) {
element2.style.display = "";
}
}
const ANIMATION_STATE_CLASSES = {
animating: "rah-animating",
animatingUp: "rah-animating--up",
animatingDown: "rah-animating--down",
animatingToHeightZero: "rah-animating--to-height-zero",
animatingToHeightAuto: "rah-animating--to-height-auto",
animatingToHeightSpecific: "rah-animating--to-height-specific",
static: "rah-static",
staticHeightZero: "rah-static--height-zero",
staticHeightAuto: "rah-static--height-auto",
staticHeightSpecific: "rah-static--height-specific"
};
function getStaticStateClasses(animationStateClasses, height2) {
return [
animationStateClasses.static,
height2 === 0 && animationStateClasses.staticHeightZero,
typeof height2 === "number" && height2 > 0 ? animationStateClasses.staticHeightSpecific : null,
height2 === "auto" && animationStateClasses.staticHeightAuto
].filter((v2) => v2).join(" ");
}
const propsToOmitFromDiv = [
"animateOpacity",
"animationStateClasses",
"applyInlineTransitions",
"children",
"className",
"contentClassName",
"contentRef",
"delay",
"duration",
"easing",
"height",
"onHeightAnimationEnd",
"onHeightAnimationStart",
"style"
];
const AnimateHeight = react_1.default.forwardRef((componentProps, ref2) => {
const { animateOpacity = false, animationStateClasses = {}, applyInlineTransitions = true, children: children2, className = "", contentClassName, delay: userDelay = 0, duration: userDuration = 500, easing = "ease", height: height2, onHeightAnimationEnd, onHeightAnimationStart, style: style2, contentRef } = componentProps;
const divProps = Object.assign({}, componentProps);
propsToOmitFromDiv.forEach((propKey) => {
delete divProps[propKey];
});
const prevHeight = (0, react_1.useRef)(height2);
const contentElement = (0, react_1.useRef)(null);
const animationClassesTimeoutID = (0, react_1.useRef)();
const timeoutID = (0, react_1.useRef)();
const stateClasses = (0, react_1.useRef)(Object.assign(Object.assign({}, ANIMATION_STATE_CLASSES), animationStateClasses));
const isBrowser2 = typeof window !== "undefined";
const prefersReducedMotion = (0, react_1.useRef)(isBrowser2 && window.matchMedia ? window.matchMedia("(prefers-reduced-motion)").matches : false);
const delay = prefersReducedMotion.current ? 0 : userDelay;
const duration2 = prefersReducedMotion.current ? 0 : userDuration;
let initHeight = height2;
let initOverflow = "visible";
if (typeof height2 === "number") {
initHeight = height2 < 0 ? 0 : height2;
initOverflow = "hidden";
} else if (isPercentage(initHeight)) {
initHeight = height2 === "0%" ? 0 : height2;
initOverflow = "hidden";
}
const [currentHeight, setCurrentHeight] = (0, react_1.useState)(initHeight);
const [overflow2, setOverflow] = (0, react_1.useState)(initOverflow);
const [useTransitions, setUseTransitions] = (0, react_1.useState)(false);
const [animationStateClassNames, setAnimationStateClassNames] = (0, react_1.useState)(getStaticStateClasses(stateClasses.current, height2));
(0, react_1.useEffect)(() => {
hideContent(contentElement.current, currentHeight);
}, []);
(0, react_1.useEffect)(() => {
if (height2 !== prevHeight.current && contentElement.current) {
showContent(contentElement.current, prevHeight.current);
contentElement.current.style.overflow = "hidden";
const contentHeight = contentElement.current.offsetHeight;
contentElement.current.style.overflow = "";
const totalDuration = duration2 + delay;
let newHeight;
let timeoutHeight;
let timeoutOverflow = "hidden";
let timeoutUseTransitions;
const isCurrentHeightAuto = prevHeight.current === "auto";
if (typeof height2 === "number") {
newHeight = height2 < 0 ? 0 : height2;
timeoutHeight = newHeight;
} else if (isPercentage(height2)) {
newHeight = height2 === "0%" ? 0 : height2;
timeoutHeight = newHeight;
} else {
newHeight = contentHeight;
timeoutHeight = "auto";
timeoutOverflow = void 0;
}
if (isCurrentHeightAuto) {
timeoutHeight = newHeight;
newHeight = contentHeight;
}
const newAnimationStateClassNames = [
stateClasses.current.animating,
(prevHeight.current === "auto" || height2 < prevHeight.current) && stateClasses.current.animatingUp,
(height2 === "auto" || height2 > prevHeight.current) && stateClasses.current.animatingDown,
timeoutHeight === 0 && stateClasses.current.animatingToHeightZero,
timeoutHeight === "auto" && stateClasses.current.animatingToHeightAuto,
typeof timeoutHeight === "number" && timeoutHeight > 0 ? stateClasses.current.animatingToHeightSpecific : null
].filter((v2) => v2).join(" ");
const timeoutAnimationStateClasses = getStaticStateClasses(stateClasses.current, timeoutHeight);
setCurrentHeight(newHeight);
setOverflow("hidden");
setUseTransitions(!isCurrentHeightAuto);
setAnimationStateClassNames(newAnimationStateClassNames);
clearTimeout(timeoutID.current);
clearTimeout(animationClassesTimeoutID.current);
if (isCurrentHeightAuto) {
timeoutUseTransitions = true;
timeoutID.current = setTimeout(() => {
setCurrentHeight(timeoutHeight);
setOverflow(timeoutOverflow);
setUseTransitions(timeoutUseTransitions);
onHeightAnimationStart === null || onHeightAnimationStart === void 0 ? void 0 : onHeightAnimationStart(timeoutHeight);
}, 50);
animationClassesTimeoutID.current = setTimeout(() => {
setUseTransitions(false);
setAnimationStateClassNames(timeoutAnimationStateClasses);
hideContent(contentElement.current, timeoutHeight);
onHeightAnimationEnd === null || onHeightAnimationEnd === void 0 ? void 0 : onHeightAnimationEnd(timeoutHeight);
}, totalDuration);
} else {
onHeightAnimationStart === null || onHeightAnimationStart === void 0 ? void 0 : onHeightAnimationStart(newHeight);
timeoutID.current = setTimeout(() => {
setCurrentHeight(timeoutHeight);
setOverflow(timeoutOverflow);
setUseTransitions(false);
setAnimationStateClassNames(timeoutAnimationStateClasses);
if (height2 !== "auto") {
hideContent(contentElement.current, newHeight);
}
onHeightAnimationEnd === null || onHeightAnimationEnd === void 0 ? void 0 : onHeightAnimationEnd(newHeight);
}, totalDuration);
}
}
prevHeight.current = height2;
return () => {
clearTimeout(timeoutID.current);
clearTimeout(animationClassesTimeoutID.current);
};
}, [height2]);
const componentStyle = Object.assign(Object.assign({}, style2), { height: currentHeight, overflow: overflow2 || (style2 === null || style2 === void 0 ? void 0 : style2.overflow) });
if (useTransitions && applyInlineTransitions) {
componentStyle.transition = `height ${duration2}ms ${easing} ${delay}ms`;
if (style2 === null || style2 === void 0 ? void 0 : style2.transition) {
componentStyle.transition = `${style2.transition}, ${componentStyle.transition}`;
}
componentStyle.WebkitTransition = componentStyle.transition;
}
const contentStyle = {};
if (animateOpacity) {
contentStyle.transition = `opacity ${duration2}ms ${easing} ${delay}ms`;
contentStyle.WebkitTransition = contentStyle.transition;
if (currentHeight === 0) {
contentStyle.opacity = 0;
}
}
const hasAriaHiddenProp = typeof divProps["aria-hidden"] !== "undefined";
const ariaHidden = hasAriaHiddenProp ? divProps["aria-hidden"] : height2 === 0;
return react_1.default.createElement(
"div",
Object.assign({}, divProps, { "aria-hidden": ariaHidden, className: `${animationStateClassNames} ${className}`, style: componentStyle, ref: ref2 }),
react_1.default.createElement("div", { className: contentClassName, style: contentStyle, ref: (el) => {
contentElement.current = el;
if (contentRef) {
contentRef.current = el;
}
} }, children2)
);
});
cjs.default = AnimateHeight;
return cjs;
}
/**
* @license
* Copyright 2009 The Closure Library Authors
* Copyright 2020 Daniel Wirtz / The long.js Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
var wasm = null;
try {
wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
0,
97,
115,
109,
1,
0,
0,
0,
1,
13,
2,
96,
0,
1,
127,
96,
4,
127,
127,
127,
127,
1,
127,
3,
7,
6,
0,
1,
1,
1,
1,
1,
6,
6,
1,
127,
1,
65,
0,
11,
7,
50,
6,
3,
109,
117,
108,
0,
1,
5,
100,
105,
118,
95,
115,
0,
2,
5,
100,
105,
118,
95,
117,
0,
3,
5,
114,
101,
109,
95,
115,
0,
4,
5,
114,
101,
109,
95,
117,
0,
5,
8,
103,
101,
116,
95,
104,
105,
103,
104,
0,
0,
10,
191,
1,
6,
4,
0,
35,
0,
11,
36,
1,
1,
126,
32,
0,
173,
32,
1,
173,
66,
32,
134,
132,
32,
2,
173,
32,
3,
173,
66,
32,
134,
132,
126,
34,
4,
66,
32,
135,
167,
36,
0,
32,
4,
167,
11,
36,
1,
1,
126,
32,
0,
173,
32,
1,
173,
66,
32,
134,
132,
32,
2,
173,
32,
3,
173,
66,
32,
134,
132,
127,
34,
4,
66,
32,
135,
167,
36,
0,
32,
4,
167,
11,
36,
1,
1,
126,
32,
0,
173,
32,
1,
173,
66,
32,
134,
132,
32,
2,
173,
32,
3,
173,
66,
32,
134,
132,
128,
34,
4,
66,
32,
135,
167,
36,
0,
32,
4,
167,
11,
36,
1,
1,
126,
32,
0,
173,
32,
1,
173,
66,
32,
134,
132,
32,
2,
173,
32,
3,
173,
66,
32,
134,
132,
129,
34,
4,
66,
32,
135,
167,
36,
0,
32,
4,
167,
11,
36,
1,
1,
126,
32,
0,
173,
32,
1,
173,
66,
32,
134,
132,
32,
2,
173,
32,
3,
173,
66,
32,
134,
132,
130,
34,
4,
66,
32,
135,
167,
36,
0,
32,
4,
167,
11
])), {}).exports;
} catch (e7) {
}
function Long(low, high, unsigned) {
this.low = low | 0;
this.high = high | 0;
this.unsigned = !!unsigned;
}
Long.prototype.__isLong__;
Object.defineProperty(Long.prototype, "__isLong__", { value: true });
function isLong(obj) {
return (obj && obj["__isLong__"]) === true;
}
function ctz32(value2) {
var c2 = Math.clz32(value2 & -value2);
return value2 ? 31 - c2 : c2;
}
Long.isLong = isLong;
var INT_CACHE = {};
var UINT_CACHE = {};
function fromInt(value2, unsigned) {
var obj, cachedObj, cache2;
if (unsigned) {
value2 >>>= 0;
if (cache2 = 0 <= value2 && value2 < 256) {
cachedObj = UINT_CACHE[value2];
if (cachedObj)
return cachedObj;
}
obj = fromBits(value2, 0, true);
if (cache2)
UINT_CACHE[value2] = obj;
return obj;
} else {
value2 |= 0;
if (cache2 = -128 <= value2 && value2 < 128) {
cachedObj = INT_CACHE[value2];
if (cachedObj)
return cachedObj;
}
obj = fromBits(value2, value2 < 0 ? -1 : 0, false);
if (cache2)
INT_CACHE[value2] = obj;
return obj;
}
}
Long.fromInt = fromInt;
function fromNumber(value2, unsigned) {
if (isNaN(value2))
return unsigned ? UZERO : ZERO$2;
if (unsigned) {
if (value2 < 0)
return UZERO;
if (value2 >= TWO_PWR_64_DBL)
return MAX_UNSIGNED_VALUE;
} else {
if (value2 <= -TWO_PWR_63_DBL)
return MIN_VALUE;
if (value2 + 1 >= TWO_PWR_63_DBL)
return MAX_VALUE;
}
if (value2 < 0)
return fromNumber(-value2, unsigned).neg();
return fromBits(value2 % TWO_PWR_32_DBL | 0, value2 / TWO_PWR_32_DBL | 0, unsigned);
}
Long.fromNumber = fromNumber;
function fromBits(lowBits, highBits, unsigned) {
return new Long(lowBits, highBits, unsigned);
}
Long.fromBits = fromBits;
var pow_dbl = Math.pow;
function fromString(str, unsigned, radix) {
if (str.length === 0)
throw Error("empty string");
if (typeof unsigned === "number") {
radix = unsigned;
unsigned = false;
} else {
unsigned = !!unsigned;
}
if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
return unsigned ? UZERO : ZERO$2;
radix = radix || 10;
if (radix < 2 || 36 < radix)
throw RangeError("radix");
var p2;
if ((p2 = str.indexOf("-")) > 0)
throw Error("interior hyphen");
else if (p2 === 0) {
return fromString(str.substring(1), unsigned, radix).neg();
}
var radixToPower = fromNumber(pow_dbl(radix, 8));
var result = ZERO$2;
for (var i2 = 0; i2 < str.length; i2 += 8) {
var size = Math.min(8, str.length - i2), value2 = parseInt(str.substring(i2, i2 + size), radix);
if (size < 8) {
var power = fromNumber(pow_dbl(radix, size));
result = result.mul(power).add(fromNumber(value2));
} else {
result = result.mul(radixToPower);
result = result.add(fromNumber(value2));
}
}
result.unsigned = unsigned;
return result;
}
Long.fromString = fromString;
function fromValue(val, unsigned) {
if (typeof val === "number")
return fromNumber(val, unsigned);
if (typeof val === "string")
return fromString(val, unsigned);
return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned);
}
Long.fromValue = fromValue;
var TWO_PWR_16_DBL = 1 << 16;
var TWO_PWR_24_DBL = 1 << 24;
var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
var ZERO$2 = fromInt(0);
Long.ZERO = ZERO$2;
var UZERO = fromInt(0, true);
Long.UZERO = UZERO;
var ONE = fromInt(1);
Long.ONE = ONE;
var UONE = fromInt(1, true);
Long.UONE = UONE;
var NEG_ONE = fromInt(-1);
Long.NEG_ONE = NEG_ONE;
var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false);
Long.MAX_VALUE = MAX_VALUE;
var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true);
Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
var MIN_VALUE = fromBits(0, 2147483648 | 0, false);
Long.MIN_VALUE = MIN_VALUE;
var LongPrototype = Long.prototype;
LongPrototype.toInt = function toInt() {
return this.unsigned ? this.low >>> 0 : this.low;
};
LongPrototype.toNumber = function toNumber() {
if (this.unsigned)
return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0);
return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
};
LongPrototype.toString = function toString(radix) {
radix = radix || 10;
if (radix < 2 || 36 < radix)
throw RangeError("radix");
if (this.isZero())
return "0";
if (this.isNegative()) {
if (this.eq(MIN_VALUE)) {
var radixLong = fromNumber(radix), div2 = this.div(radixLong), rem1 = div2.mul(radixLong).sub(this);
return div2.toString(radix) + rem1.toInt().toString(radix);
} else
return "-" + this.neg().toString(radix);
}
var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem2 = this;
var result = "";
while (true) {
var remDiv = rem2.div(radixToPower), intval = rem2.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix);
rem2 = remDiv;
if (rem2.isZero())
return digits + result;
else {
while (digits.length < 6)
digits = "0" + digits;
result = "" + digits + result;
}
}
};
LongPrototype.getHighBits = function getHighBits() {
return this.high;
};
LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
return this.high >>> 0;
};
LongPrototype.getLowBits = function getLowBits() {
return this.low;
};
LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
return this.low >>> 0;
};
LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
if (this.isNegative())
return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
var val = this.high != 0 ? this.high : this.low;
for (var bit = 31; bit > 0; bit--)
if ((val & 1 << bit) != 0)
break;
return this.high != 0 ? bit + 33 : bit + 1;
};
LongPrototype.isZero = function isZero() {
return this.high === 0 && this.low === 0;
};
LongPrototype.eqz = LongPrototype.isZero;
LongPrototype.isNegative = function isNegative() {
return !this.unsigned && this.high < 0;
};
LongPrototype.isPositive = function isPositive() {
return this.unsigned || this.high >= 0;
};
LongPrototype.isOdd = function isOdd() {
return (this.low & 1) === 1;
};
LongPrototype.isEven = function isEven() {
return (this.low & 1) === 0;
};
LongPrototype.equals = function equals(other) {
if (!isLong(other))
other = fromValue(other);
if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1)
return false;
return this.high === other.high && this.low === other.low;
};
LongPrototype.eq = LongPrototype.equals;
LongPrototype.notEquals = function notEquals(other) {
return !this.eq(
/* validates */
other
);
};
LongPrototype.neq = LongPrototype.notEquals;
LongPrototype.ne = LongPrototype.notEquals;
LongPrototype.lessThan = function lessThan(other) {
return this.comp(
/* validates */
other
) < 0;
};
LongPrototype.lt = LongPrototype.lessThan;
LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
return this.comp(
/* validates */
other
) <= 0;
};
LongPrototype.lte = LongPrototype.lessThanOrEqual;
LongPrototype.le = LongPrototype.lessThanOrEqual;
LongPrototype.greaterThan = function greaterThan(other) {
return this.comp(
/* validates */
other
) > 0;
};
LongPrototype.gt = LongPrototype.greaterThan;
LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
return this.comp(
/* validates */
other
) >= 0;
};
LongPrototype.gte = LongPrototype.greaterThanOrEqual;
LongPrototype.ge = LongPrototype.greaterThanOrEqual;
LongPrototype.compare = function compare(other) {
if (!isLong(other))
other = fromValue(other);
if (this.eq(other))
return 0;
var thisNeg = this.isNegative(), otherNeg = other.isNegative();
if (thisNeg && !otherNeg)
return -1;
if (!thisNeg && otherNeg)
return 1;
if (!this.unsigned)
return this.sub(other).isNegative() ? -1 : 1;
return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1;
};
LongPrototype.comp = LongPrototype.compare;
LongPrototype.negate = function negate2() {
if (!this.unsigned && this.eq(MIN_VALUE))
return MIN_VALUE;
return this.not().add(ONE);
};
LongPrototype.neg = LongPrototype.negate;
LongPrototype.add = function add(addend) {
if (!isLong(addend))
addend = fromValue(addend);
var a48 = this.high >>> 16;
var a32 = this.high & 65535;
var a16 = this.low >>> 16;
var a00 = this.low & 65535;
var b48 = addend.high >>> 16;
var b32 = addend.high & 65535;
var b16 = addend.low >>> 16;
var b00 = addend.low & 65535;
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
c00 += a00 + b00;
c16 += c00 >>> 16;
c00 &= 65535;
c16 += a16 + b16;
c32 += c16 >>> 16;
c16 &= 65535;
c32 += a32 + b32;
c48 += c32 >>> 16;
c32 &= 65535;
c48 += a48 + b48;
c48 &= 65535;
return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
};
LongPrototype.subtract = function subtract2(subtrahend) {
if (!isLong(subtrahend))
subtrahend = fromValue(subtrahend);
return this.add(subtrahend.neg());
};
LongPrototype.sub = LongPrototype.subtract;
LongPrototype.multiply = function multiply(multiplier) {
if (this.isZero())
return this;
if (!isLong(multiplier))
multiplier = fromValue(multiplier);
if (wasm) {
var low = wasm["mul"](
this.low,
this.high,
multiplier.low,
multiplier.high
);
return fromBits(low, wasm["get_high"](), this.unsigned);
}
if (multiplier.isZero())
return this.unsigned ? UZERO : ZERO$2;
if (this.eq(MIN_VALUE))
return multiplier.isOdd() ? MIN_VALUE : ZERO$2;
if (multiplier.eq(MIN_VALUE))
return this.isOdd() ? MIN_VALUE : ZERO$2;
if (this.isNegative()) {
if (multiplier.isNegative())
return this.neg().mul(multiplier.neg());
else
return this.neg().mul(multiplier).neg();
} else if (multiplier.isNegative())
return this.mul(multiplier.neg()).neg();
if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
var a48 = this.high >>> 16;
var a32 = this.high & 65535;
var a16 = this.low >>> 16;
var a00 = this.low & 65535;
var b48 = multiplier.high >>> 16;
var b32 = multiplier.high & 65535;
var b16 = multiplier.low >>> 16;
var b00 = multiplier.low & 65535;
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
c00 += a00 * b00;
c16 += c00 >>> 16;
c00 &= 65535;
c16 += a16 * b00;
c32 += c16 >>> 16;
c16 &= 65535;
c16 += a00 * b16;
c32 += c16 >>> 16;
c16 &= 65535;
c32 += a32 * b00;
c48 += c32 >>> 16;
c32 &= 65535;
c32 += a16 * b16;
c48 += c32 >>> 16;
c32 &= 65535;
c32 += a00 * b32;
c48 += c32 >>> 16;
c32 &= 65535;
c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
c48 &= 65535;
return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
};
LongPrototype.mul = LongPrototype.multiply;
LongPrototype.divide = function divide(divisor) {
if (!isLong(divisor))
divisor = fromValue(divisor);
if (divisor.isZero())
throw Error("division by zero");
if (wasm) {
if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) {
return this;
}
var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])(
this.low,
this.high,
divisor.low,
divisor.high
);
return fromBits(low, wasm["get_high"](), this.unsigned);
}
if (this.isZero())
return this.unsigned ? UZERO : ZERO$2;
var approx, rem2, res;
if (!this.unsigned) {
if (this.eq(MIN_VALUE)) {
if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
return MIN_VALUE;
else if (divisor.eq(MIN_VALUE))
return ONE;
else {
var halfThis = this.shr(1);
approx = halfThis.div(divisor).shl(1);
if (approx.eq(ZERO$2)) {
return divisor.isNegative() ? ONE : NEG_ONE;
} else {
rem2 = this.sub(divisor.mul(approx));
res = approx.add(rem2.div(divisor));
return res;
}
}
} else if (divisor.eq(MIN_VALUE))
return this.unsigned ? UZERO : ZERO$2;
if (this.isNegative()) {
if (divisor.isNegative())
return this.neg().div(divisor.neg());
return this.neg().div(divisor).neg();
} else if (divisor.isNegative())
return this.div(divisor.neg()).neg();
res = ZERO$2;
} else {
if (!divisor.unsigned)
divisor = divisor.toUnsigned();
if (divisor.gt(this))
return UZERO;
if (divisor.gt(this.shru(1)))
return UONE;
res = UZERO;
}
rem2 = this;
while (rem2.gte(divisor)) {
approx = Math.max(1, Math.floor(rem2.toNumber() / divisor.toNumber()));
var log22 = Math.ceil(Math.log(approx) / Math.LN2), delta = log22 <= 48 ? 1 : pow_dbl(2, log22 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor);
while (approxRem.isNegative() || approxRem.gt(rem2)) {
approx -= delta;
approxRes = fromNumber(approx, this.unsigned);
approxRem = approxRes.mul(divisor);
}
if (approxRes.isZero())
approxRes = ONE;
res = res.add(approxRes);
rem2 = rem2.sub(approxRem);
}
return res;
};
LongPrototype.div = LongPrototype.divide;
LongPrototype.modulo = function modulo(divisor) {
if (!isLong(divisor))
divisor = fromValue(divisor);
if (wasm) {
var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(
this.low,
this.high,
divisor.low,
divisor.high
);
return fromBits(low, wasm["get_high"](), this.unsigned);
}
return this.sub(this.div(divisor).mul(divisor));
};
LongPrototype.mod = LongPrototype.modulo;
LongPrototype.rem = LongPrototype.modulo;
LongPrototype.not = function not() {
return fromBits(~this.low, ~this.high, this.unsigned);
};
LongPrototype.countLeadingZeros = function countLeadingZeros() {
return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;
};
LongPrototype.clz = LongPrototype.countLeadingZeros;
LongPrototype.countTrailingZeros = function countTrailingZeros() {
return this.low ? ctz32(this.low) : ctz32(this.high) + 32;
};
LongPrototype.ctz = LongPrototype.countTrailingZeros;
LongPrototype.and = function and(other) {
if (!isLong(other))
other = fromValue(other);
return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
};
LongPrototype.or = function or(other) {
if (!isLong(other))
other = fromValue(other);
return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
};
LongPrototype.xor = function xor(other) {
if (!isLong(other))
other = fromValue(other);
return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
};
LongPrototype.shiftLeft = function shiftLeft(numBits) {
if (isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
else if (numBits < 32)
return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned);
else
return fromBits(0, this.low << numBits - 32, this.unsigned);
};
LongPrototype.shl = LongPrototype.shiftLeft;
LongPrototype.shiftRight = function shiftRight(numBits) {
if (isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
else if (numBits < 32)
return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned);
else
return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned);
};
LongPrototype.shr = LongPrototype.shiftRight;
LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
if (isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
if (numBits < 32)
return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
if (numBits === 32)
return fromBits(this.high, 0, this.unsigned);
return fromBits(this.high >>> numBits - 32, 0, this.unsigned);
};
LongPrototype.shru = LongPrototype.shiftRightUnsigned;
LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;
LongPrototype.rotateLeft = function rotateLeft(numBits) {
var b2;
if (isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
if (numBits === 32)
return fromBits(this.high, this.low, this.unsigned);
if (numBits < 32) {
b2 = 32 - numBits;
return fromBits(this.low << numBits | this.high >>> b2, this.high << numBits | this.low >>> b2, this.unsigned);
}
numBits -= 32;
b2 = 32 - numBits;
return fromBits(this.high << numBits | this.low >>> b2, this.low << numBits | this.high >>> b2, this.unsigned);
};
LongPrototype.rotl = LongPrototype.rotateLeft;
LongPrototype.rotateRight = function rotateRight(numBits) {
var b2;
if (isLong(numBits))
numBits = numBits.toInt();
if ((numBits &= 63) === 0)
return this;
if (numBits === 32)
return fromBits(this.high, this.low, this.unsigned);
if (numBits < 32) {
b2 = 32 - numBits;
return fromBits(this.high << b2 | this.low >>> numBits, this.low << b2 | this.high >>> numBits, this.unsigned);
}
numBits -= 32;
b2 = 32 - numBits;
return fromBits(this.low << b2 | this.high >>> numBits, this.high << b2 | this.low >>> numBits, this.unsigned);
};
LongPrototype.rotr = LongPrototype.rotateRight;
LongPrototype.toSigned = function toSigned() {
if (!this.unsigned)
return this;
return fromBits(this.low, this.high, false);
};
LongPrototype.toUnsigned = function toUnsigned() {
if (this.unsigned)
return this;
return fromBits(this.low, this.high, true);
};
LongPrototype.toBytes = function toBytes(le2) {
return le2 ? this.toBytesLE() : this.toBytesBE();
};
LongPrototype.toBytesLE = function toBytesLE() {
var hi2 = this.high, lo2 = this.low;
return [
lo2 & 255,
lo2 >>> 8 & 255,
lo2 >>> 16 & 255,
lo2 >>> 24,
hi2 & 255,
hi2 >>> 8 & 255,
hi2 >>> 16 & 255,
hi2 >>> 24
];
};
LongPrototype.toBytesBE = function toBytesBE() {
var hi2 = this.high, lo2 = this.low;
return [
hi2 >>> 24,
hi2 >>> 16 & 255,
hi2 >>> 8 & 255,
hi2 & 255,
lo2 >>> 24,
lo2 >>> 16 & 255,
lo2 >>> 8 & 255,
lo2 & 255
];
};
Long.fromBytes = function fromBytes(bytes, unsigned, le2) {
return le2 ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);
};
Long.fromBytesLE = function fromBytesLE(bytes, unsigned) {
return new Long(
bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24,
bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24,
unsigned
);
};
Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
return new Long(
bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7],
bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3],
unsigned
);
};
/**
* filesize
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 10.1.0
*/
const ARRAY = "array";
const BIT = "bit";
const BITS = "bits";
const BYTE = "byte";
const BYTES = "bytes";
const EMPTY = "";
const EXPONENT = "exponent";
const FUNCTION$1 = "function";
const IEC = "iec";
const INVALID_NUMBER = "Invalid number";
const INVALID_ROUND = "Invalid rounding method";
const JEDEC = "jedec";
const OBJECT = "object";
const PERIOD = ".";
const ROUND = "round";
const S$3 = "s";
const SI = "si";
const SI_KBIT = "kbit";
const SI_KBYTE = "kB";
const SPACE$2 = " ";
const STRING = "string";
const ZERO$1 = "0";
const STRINGS = {
symbol: {
iec: {
bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
},
jedec: {
bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"],
bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
}
},
fullform: {
iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
}
};
function filesize(arg, {
bits: bits2 = false,
pad: pad2 = false,
base: base2 = -1,
round: round2 = 2,
locale: locale2 = EMPTY,
localeOptions = {},
separator = EMPTY,
spacer = SPACE$2,
symbols: symbols2 = {},
standard = EMPTY,
output: output3 = STRING,
fullform = false,
fullforms = [],
exponent: exponent2 = -1,
roundingMethod = ROUND,
precision = 0
} = {}) {
let e7 = exponent2, num = Number(arg), result = [], val = 0, u2 = EMPTY;
if (standard === SI) {
base2 = 10;
standard = JEDEC;
} else if (standard === IEC || standard === JEDEC) {
base2 = 2;
} else if (base2 === 2) {
standard = IEC;
} else {
base2 = 10;
standard = JEDEC;
}
const ceil2 = base2 === 10 ? 1e3 : 1024, full = fullform === true, neg = num < 0, roundingFunc = Math[roundingMethod];
if (typeof arg !== "bigint" && isNaN(arg)) {
throw new TypeError(INVALID_NUMBER);
}
if (typeof roundingFunc !== FUNCTION$1) {
throw new TypeError(INVALID_ROUND);
}
if (neg) {
num = -num;
}
if (e7 === -1 || isNaN(e7)) {
e7 = Math.floor(Math.log(num) / Math.log(ceil2));
if (e7 < 0) {
e7 = 0;
}
}
if (e7 > 8) {
if (precision > 0) {
precision += 8 - e7;
}
e7 = 8;
}
if (output3 === EXPONENT) {
return e7;
}
if (num === 0) {
result[0] = 0;
u2 = result[1] = STRINGS.symbol[standard][bits2 ? BITS : BYTES][e7];
} else {
val = num / (base2 === 2 ? Math.pow(2, e7 * 10) : Math.pow(1e3, e7));
if (bits2) {
val = val * 8;
if (val >= ceil2 && e7 < 8) {
val = val / ceil2;
e7++;
}
}
const p2 = Math.pow(10, e7 > 0 ? round2 : 0);
result[0] = roundingFunc(val * p2) / p2;
if (result[0] === ceil2 && e7 < 8 && exponent2 === -1) {
result[0] = 1;
e7++;
}
u2 = result[1] = base2 === 10 && e7 === 1 ? bits2 ? SI_KBIT : SI_KBYTE : STRINGS.symbol[standard][bits2 ? BITS : BYTES][e7];
}
if (neg) {
result[0] = -result[0];
}
if (precision > 0) {
result[0] = result[0].toPrecision(precision);
}
result[1] = symbols2[result[1]] || result[1];
if (locale2 === true) {
result[0] = result[0].toLocaleString();
} else if (locale2.length > 0) {
result[0] = result[0].toLocaleString(locale2, localeOptions);
} else if (separator.length > 0) {
result[0] = result[0].toString().replace(PERIOD, separator);
}
if (pad2 && Number.isInteger(result[0]) === false && round2 > 0) {
const x2 = separator || PERIOD, tmp = result[0].toString().split(x2), s2 = tmp[1] || EMPTY, l2 = s2.length, n2 = round2 - l2;
result[0] = `${tmp[0]}${x2}${s2.padEnd(l2 + n2, ZERO$1)}`;
}
if (full) {
result[1] = fullforms[e7] ? fullforms[e7] : STRINGS.fullform[standard][e7] + (bits2 ? BIT : BYTE) + (result[0] === 1 ? EMPTY : S$3);
}
return output3 === ARRAY ? result : output3 === OBJECT ? {
value: result[0],
symbol: result[1],
exponent: e7,
unit: u2
} : result.join(spacer);
}
class LuxonError extends Error {
}
class InvalidDateTimeError extends LuxonError {
constructor(reason) {
super(`Invalid DateTime: ${reason.toMessage()}`);
}
}
class InvalidIntervalError extends LuxonError {
constructor(reason) {
super(`Invalid Interval: ${reason.toMessage()}`);
}
}
class InvalidDurationError extends LuxonError {
constructor(reason) {
super(`Invalid Duration: ${reason.toMessage()}`);
}
}
class ConflictingSpecificationError extends LuxonError {
}
class InvalidUnitError extends LuxonError {
constructor(unit2) {
super(`Invalid unit ${unit2}`);
}
}
class InvalidArgumentError extends LuxonError {
}
class ZoneIsAbstractError extends LuxonError {
constructor() {
super("Zone is an abstract class");
}
}
const n$b = "numeric", s$i = "short", l$2 = "long";
const DATE_SHORT = {
year: n$b,
month: n$b,
day: n$b
};
const DATE_MED = {
year: n$b,
month: s$i,
day: n$b
};
const DATE_MED_WITH_WEEKDAY = {
year: n$b,
month: s$i,
day: n$b,
weekday: s$i
};
const DATE_FULL = {
year: n$b,
month: l$2,
day: n$b
};
const DATE_HUGE = {
year: n$b,
month: l$2,
day: n$b,
weekday: l$2
};
const TIME_SIMPLE = {
hour: n$b,
minute: n$b
};
const TIME_WITH_SECONDS = {
hour: n$b,
minute: n$b,
second: n$b
};
const TIME_WITH_SHORT_OFFSET = {
hour: n$b,
minute: n$b,
second: n$b,
timeZoneName: s$i
};
const TIME_WITH_LONG_OFFSET = {
hour: n$b,
minute: n$b,
second: n$b,
timeZoneName: l$2
};
const TIME_24_SIMPLE = {
hour: n$b,
minute: n$b,
hourCycle: "h23"
};
const TIME_24_WITH_SECONDS = {
hour: n$b,
minute: n$b,
second: n$b,
hourCycle: "h23"
};
const TIME_24_WITH_SHORT_OFFSET = {
hour: n$b,
minute: n$b,
second: n$b,
hourCycle: "h23",
timeZoneName: s$i
};
const TIME_24_WITH_LONG_OFFSET = {
hour: n$b,
minute: n$b,
second: n$b,
hourCycle: "h23",
timeZoneName: l$2
};
const DATETIME_SHORT = {
year: n$b,
month: n$b,
day: n$b,
hour: n$b,
minute: n$b
};
const DATETIME_SHORT_WITH_SECONDS = {
year: n$b,
month: n$b,
day: n$b,
hour: n$b,
minute: n$b,
second: n$b
};
const DATETIME_MED = {
year: n$b,
month: s$i,
day: n$b,
hour: n$b,
minute: n$b
};
const DATETIME_MED_WITH_SECONDS = {
year: n$b,
month: s$i,
day: n$b,
hour: n$b,
minute: n$b,
second: n$b
};
const DATETIME_MED_WITH_WEEKDAY = {
year: n$b,
month: s$i,
day: n$b,
weekday: s$i,
hour: n$b,
minute: n$b
};
const DATETIME_FULL = {
year: n$b,
month: l$2,
day: n$b,
hour: n$b,
minute: n$b,
timeZoneName: s$i
};
const DATETIME_FULL_WITH_SECONDS = {
year: n$b,
month: l$2,
day: n$b,
hour: n$b,
minute: n$b,
second: n$b,
timeZoneName: s$i
};
const DATETIME_HUGE = {
year: n$b,
month: l$2,
day: n$b,
weekday: l$2,
hour: n$b,
minute: n$b,
timeZoneName: l$2
};
const DATETIME_HUGE_WITH_SECONDS = {
year: n$b,
month: l$2,
day: n$b,
weekday: l$2,
hour: n$b,
minute: n$b,
second: n$b,
timeZoneName: l$2
};
class Zone {
/**
* The type of zone
* @abstract
* @type {string}
*/
get type() {
throw new ZoneIsAbstractError();
}
/**
* The name of this zone.
* @abstract
* @type {string}
*/
get name() {
throw new ZoneIsAbstractError();
}
get ianaName() {
return this.name;
}
/**
* Returns whether the offset is known to be fixed for the whole year.
* @abstract
* @type {boolean}
*/
get isUniversal() {
throw new ZoneIsAbstractError();
}
/**
* Returns the offset's common name (such as EST) at the specified timestamp
* @abstract
* @param {number} ts - Epoch milliseconds for which to get the name
* @param {Object} opts - Options to affect the format
* @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.
* @param {string} opts.locale - What locale to return the offset name in.
* @return {string}
*/
offsetName(ts2, opts) {
throw new ZoneIsAbstractError();
}
/**
* Returns the offset's value as a string
* @abstract
* @param {number} ts - Epoch milliseconds for which to get the offset
* @param {string} format - What style of offset to return.
* Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively
* @return {string}
*/
formatOffset(ts2, format2) {
throw new ZoneIsAbstractError();
}
/**
* Return the offset in minutes for this zone at the specified timestamp.
* @abstract
* @param {number} ts - Epoch milliseconds for which to compute the offset
* @return {number}
*/
offset(ts2) {
throw new ZoneIsAbstractError();
}
/**
* Return whether this Zone is equal to another zone
* @abstract
* @param {Zone} otherZone - the zone to compare
* @return {boolean}
*/
equals(otherZone) {
throw new ZoneIsAbstractError();
}
/**
* Return whether this Zone is valid.
* @abstract
* @type {boolean}
*/
get isValid() {
throw new ZoneIsAbstractError();
}
}
let singleton$1 = null;
class SystemZone extends Zone {
/**
* Get a singleton instance of the local zone
* @return {SystemZone}
*/
static get instance() {
if (singleton$1 === null) {
singleton$1 = new SystemZone();
}
return singleton$1;
}
/** @override **/
get type() {
return "system";
}
/** @override **/
get name() {
return new Intl.DateTimeFormat().resolvedOptions().timeZone;
}
/** @override **/
get isUniversal() {
return false;
}
/** @override **/
offsetName(ts2, { format: format2, locale: locale2 }) {
return parseZoneInfo(ts2, format2, locale2);
}
/** @override **/
formatOffset(ts2, format2) {
return formatOffset(this.offset(ts2), format2);
}
/** @override **/
offset(ts2) {
return -new Date(ts2).getTimezoneOffset();
}
/** @override **/
equals(otherZone) {
return otherZone.type === "system";
}
/** @override **/
get isValid() {
return true;
}
}
let dtfCache = {};
function makeDTF(zone) {
if (!dtfCache[zone]) {
dtfCache[zone] = new Intl.DateTimeFormat("en-US", {
hour12: false,
timeZone: zone,
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
era: "short"
});
}
return dtfCache[zone];
}
const typeToPos = {
year: 0,
month: 1,
day: 2,
era: 3,
hour: 4,
minute: 5,
second: 6
};
function hackyOffset(dtf, date2) {
const formatted = dtf.format(date2).replace(/\u200E/g, ""), parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;
return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
}
function partsOffset(dtf, date2) {
const formatted = dtf.formatToParts(date2);
const filled = [];
for (let i2 = 0; i2 < formatted.length; i2++) {
const { type: type2, value: value2 } = formatted[i2];
const pos = typeToPos[type2];
if (type2 === "era") {
filled[pos] = value2;
} else if (!isUndefined(pos)) {
filled[pos] = parseInt(value2, 10);
}
}
return filled;
}
let ianaZoneCache = {};
class IANAZone extends Zone {
/**
* @param {string} name - Zone name
* @return {IANAZone}
*/
static create(name) {
if (!ianaZoneCache[name]) {
ianaZoneCache[name] = new IANAZone(name);
}
return ianaZoneCache[name];
}
/**
* Reset local caches. Should only be necessary in testing scenarios.
* @return {void}
*/
static resetCache() {
ianaZoneCache = {};
dtfCache = {};
}
/**
* Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.
* @param {string} s - The string to check validity on
* @example IANAZone.isValidSpecifier("America/New_York") //=> true
* @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false
* @deprecated This method returns false for some valid IANA names. Use isValidZone instead.
* @return {boolean}
*/
static isValidSpecifier(s2) {
return this.isValidZone(s2);
}
/**
* Returns whether the provided string identifies a real zone
* @param {string} zone - The string to check
* @example IANAZone.isValidZone("America/New_York") //=> true
* @example IANAZone.isValidZone("Fantasia/Castle") //=> false
* @example IANAZone.isValidZone("Sport~~blorp") //=> false
* @return {boolean}
*/
static isValidZone(zone) {
if (!zone) {
return false;
}
try {
new Intl.DateTimeFormat("en-US", { timeZone: zone }).format();
return true;
} catch (e7) {
return false;
}
}
constructor(name) {
super();
this.zoneName = name;
this.valid = IANAZone.isValidZone(name);
}
/** @override **/
get type() {
return "iana";
}
/** @override **/
get name() {
return this.zoneName;
}
/** @override **/
get isUniversal() {
return false;
}
/** @override **/
offsetName(ts2, { format: format2, locale: locale2 }) {
return parseZoneInfo(ts2, format2, locale2, this.name);
}
/** @override **/
formatOffset(ts2, format2) {
return formatOffset(this.offset(ts2), format2);
}
/** @override **/
offset(ts2) {
const date2 = new Date(ts2);
if (isNaN(date2))
return NaN;
const dtf = makeDTF(this.name);
let [year2, month2, day2, adOrBc, hour2, minute2, second2] = dtf.formatToParts ? partsOffset(dtf, date2) : hackyOffset(dtf, date2);
if (adOrBc === "BC") {
year2 = -Math.abs(year2) + 1;
}
const adjustedHour = hour2 === 24 ? 0 : hour2;
const asUTC = objToLocalTS({
year: year2,
month: month2,
day: day2,
hour: adjustedHour,
minute: minute2,
second: second2,
millisecond: 0
});
let asTS = +date2;
const over = asTS % 1e3;
asTS -= over >= 0 ? over : 1e3 + over;
return (asUTC - asTS) / (60 * 1e3);
}
/** @override **/
equals(otherZone) {
return otherZone.type === "iana" && otherZone.name === this.name;
}
/** @override **/
get isValid() {
return this.valid;
}
}
let intlLFCache = {};
function getCachedLF(locString, opts = {}) {
const key2 = JSON.stringify([locString, opts]);
let dtf = intlLFCache[key2];
if (!dtf) {
dtf = new Intl.ListFormat(locString, opts);
intlLFCache[key2] = dtf;
}
return dtf;
}
let intlDTCache = {};
function getCachedDTF(locString, opts = {}) {
const key2 = JSON.stringify([locString, opts]);
let dtf = intlDTCache[key2];
if (!dtf) {
dtf = new Intl.DateTimeFormat(locString, opts);
intlDTCache[key2] = dtf;
}
return dtf;
}
let intlNumCache = {};
function getCachedINF(locString, opts = {}) {
const key2 = JSON.stringify([locString, opts]);
let inf = intlNumCache[key2];
if (!inf) {
inf = new Intl.NumberFormat(locString, opts);
intlNumCache[key2] = inf;
}
return inf;
}
let intlRelCache = {};
function getCachedRTF(locString, opts = {}) {
const { base: base2, ...cacheKeyOpts } = opts;
const key2 = JSON.stringify([locString, cacheKeyOpts]);
let inf = intlRelCache[key2];
if (!inf) {
inf = new Intl.RelativeTimeFormat(locString, opts);
intlRelCache[key2] = inf;
}
return inf;
}
let sysLocaleCache = null;
function systemLocale() {
if (sysLocaleCache) {
return sysLocaleCache;
} else {
sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;
return sysLocaleCache;
}
}
function parseLocaleString(localeStr) {
const xIndex = localeStr.indexOf("-x-");
if (xIndex !== -1) {
localeStr = localeStr.substring(0, xIndex);
}
const uIndex = localeStr.indexOf("-u-");
if (uIndex === -1) {
return [localeStr];
} else {
let options2;
let selectedStr;
try {
options2 = getCachedDTF(localeStr).resolvedOptions();
selectedStr = localeStr;
} catch (e7) {
const smaller = localeStr.substring(0, uIndex);
options2 = getCachedDTF(smaller).resolvedOptions();
selectedStr = smaller;
}
const { numberingSystem, calendar: calendar2 } = options2;
return [selectedStr, numberingSystem, calendar2];
}
}
function intlConfigString(localeStr, numberingSystem, outputCalendar) {
if (outputCalendar || numberingSystem) {
if (!localeStr.includes("-u-")) {
localeStr += "-u";
}
if (outputCalendar) {
localeStr += `-ca-${outputCalendar}`;
}
if (numberingSystem) {
localeStr += `-nu-${numberingSystem}`;
}
return localeStr;
} else {
return localeStr;
}
}
function mapMonths(f2) {
const ms = [];
for (let i2 = 1; i2 <= 12; i2++) {
const dt2 = DateTime.utc(2009, i2, 1);
ms.push(f2(dt2));
}
return ms;
}
function mapWeekdays(f2) {
const ms = [];
for (let i2 = 1; i2 <= 7; i2++) {
const dt2 = DateTime.utc(2016, 11, 13 + i2);
ms.push(f2(dt2));
}
return ms;
}
function listStuff(loc, length2, englishFn, intlFn) {
const mode = loc.listingMode();
if (mode === "error") {
return null;
} else if (mode === "en") {
return englishFn(length2);
} else {
return intlFn(length2);
}
}
function supportsFastNumbers(loc) {
if (loc.numberingSystem && loc.numberingSystem !== "latn") {
return false;
} else {
return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn";
}
}
class PolyNumberFormatter {
constructor(intl, forceSimple, opts) {
this.padTo = opts.padTo || 0;
this.floor = opts.floor || false;
const { padTo, floor: floor2, ...otherOpts } = opts;
if (!forceSimple || Object.keys(otherOpts).length > 0) {
const intlOpts = { useGrouping: false, ...opts };
if (opts.padTo > 0)
intlOpts.minimumIntegerDigits = opts.padTo;
this.inf = getCachedINF(intl, intlOpts);
}
}
format(i2) {
if (this.inf) {
const fixed = this.floor ? Math.floor(i2) : i2;
return this.inf.format(fixed);
} else {
const fixed = this.floor ? Math.floor(i2) : roundTo(i2, 3);
return padStart(fixed, this.padTo);
}
}
}
class PolyDateFormatter {
constructor(dt2, intl, opts) {
this.opts = opts;
this.originalZone = void 0;
let z2 = void 0;
if (this.opts.timeZone) {
this.dt = dt2;
} else if (dt2.zone.type === "fixed") {
const gmtOffset = -1 * (dt2.offset / 60);
const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
if (dt2.offset !== 0 && IANAZone.create(offsetZ).valid) {
z2 = offsetZ;
this.dt = dt2;
} else {
z2 = "UTC";
this.dt = dt2.offset === 0 ? dt2 : dt2.setZone("UTC").plus({ minutes: dt2.offset });
this.originalZone = dt2.zone;
}
} else if (dt2.zone.type === "system") {
this.dt = dt2;
} else if (dt2.zone.type === "iana") {
this.dt = dt2;
z2 = dt2.zone.name;
} else {
z2 = "UTC";
this.dt = dt2.setZone("UTC").plus({ minutes: dt2.offset });
this.originalZone = dt2.zone;
}
const intlOpts = { ...this.opts };
intlOpts.timeZone = intlOpts.timeZone || z2;
this.dtf = getCachedDTF(intl, intlOpts);
}
format() {
if (this.originalZone) {
return this.formatToParts().map(({ value: value2 }) => value2).join("");
}
return this.dtf.format(this.dt.toJSDate());
}
formatToParts() {
const parts2 = this.dtf.formatToParts(this.dt.toJSDate());
if (this.originalZone) {
return parts2.map((part) => {
if (part.type === "timeZoneName") {
const offsetName = this.originalZone.offsetName(this.dt.ts, {
locale: this.dt.locale,
format: this.opts.timeZoneName
});
return {
...part,
value: offsetName
};
} else {
return part;
}
});
}
return parts2;
}
resolvedOptions() {
return this.dtf.resolvedOptions();
}
}
class PolyRelFormatter {
constructor(intl, isEnglish, opts) {
this.opts = { style: "long", ...opts };
if (!isEnglish && hasRelative()) {
this.rtf = getCachedRTF(intl, opts);
}
}
format(count2, unit2) {
if (this.rtf) {
return this.rtf.format(count2, unit2);
} else {
return formatRelativeTime(unit2, count2, this.opts.numeric, this.opts.style !== "long");
}
}
formatToParts(count2, unit2) {
if (this.rtf) {
return this.rtf.formatToParts(count2, unit2);
} else {
return [];
}
}
}
class Locale {
static fromOpts(opts) {
return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);
}
static create(locale2, numberingSystem, outputCalendar, defaultToEN = false) {
const specifiedLocale = locale2 || Settings.defaultLocale;
const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale());
const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;
const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;
return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);
}
static resetCache() {
sysLocaleCache = null;
intlDTCache = {};
intlNumCache = {};
intlRelCache = {};
}
static fromObject({ locale: locale2, numberingSystem, outputCalendar } = {}) {
return Locale.create(locale2, numberingSystem, outputCalendar);
}
constructor(locale2, numbering, outputCalendar, specifiedLocale) {
const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale2);
this.locale = parsedLocale;
this.numberingSystem = numbering || parsedNumberingSystem || null;
this.outputCalendar = outputCalendar || parsedOutputCalendar || null;
this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);
this.weekdaysCache = { format: {}, standalone: {} };
this.monthsCache = { format: {}, standalone: {} };
this.meridiemCache = null;
this.eraCache = {};
this.specifiedLocale = specifiedLocale;
this.fastNumbersCached = null;
}
get fastNumbers() {
if (this.fastNumbersCached == null) {
this.fastNumbersCached = supportsFastNumbers(this);
}
return this.fastNumbersCached;
}
listingMode() {
const isActuallyEn = this.isEnglish();
const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
return isActuallyEn && hasNoWeirdness ? "en" : "intl";
}
clone(alts) {
if (!alts || Object.getOwnPropertyNames(alts).length === 0) {
return this;
} else {
return Locale.create(
alts.locale || this.specifiedLocale,
alts.numberingSystem || this.numberingSystem,
alts.outputCalendar || this.outputCalendar,
alts.defaultToEN || false
);
}
}
redefaultToEN(alts = {}) {
return this.clone({ ...alts, defaultToEN: true });
}
redefaultToSystem(alts = {}) {
return this.clone({ ...alts, defaultToEN: false });
}
months(length2, format2 = false) {
return listStuff(this, length2, months, () => {
const intl = format2 ? { month: length2, day: "numeric" } : { month: length2 }, formatStr = format2 ? "format" : "standalone";
if (!this.monthsCache[formatStr][length2]) {
this.monthsCache[formatStr][length2] = mapMonths((dt2) => this.extract(dt2, intl, "month"));
}
return this.monthsCache[formatStr][length2];
});
}
weekdays(length2, format2 = false) {
return listStuff(this, length2, weekdays, () => {
const intl = format2 ? { weekday: length2, year: "numeric", month: "long", day: "numeric" } : { weekday: length2 }, formatStr = format2 ? "format" : "standalone";
if (!this.weekdaysCache[formatStr][length2]) {
this.weekdaysCache[formatStr][length2] = mapWeekdays(
(dt2) => this.extract(dt2, intl, "weekday")
);
}
return this.weekdaysCache[formatStr][length2];
});
}
meridiems() {
return listStuff(
this,
void 0,
() => meridiems,
() => {
if (!this.meridiemCache) {
const intl = { hour: "numeric", hourCycle: "h12" };
this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(
(dt2) => this.extract(dt2, intl, "dayperiod")
);
}
return this.meridiemCache;
}
);
}
eras(length2) {
return listStuff(this, length2, eras, () => {
const intl = { era: length2 };
if (!this.eraCache[length2]) {
this.eraCache[length2] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(
(dt2) => this.extract(dt2, intl, "era")
);
}
return this.eraCache[length2];
});
}
extract(dt2, intlOpts, field2) {
const df2 = this.dtFormatter(dt2, intlOpts), results = df2.formatToParts(), matching = results.find((m2) => m2.type.toLowerCase() === field2);
return matching ? matching.value : null;
}
numberFormatter(opts = {}) {
return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);
}
dtFormatter(dt2, intlOpts = {}) {
return new PolyDateFormatter(dt2, this.intl, intlOpts);
}
relFormatter(opts = {}) {
return new PolyRelFormatter(this.intl, this.isEnglish(), opts);
}
listFormatter(opts = {}) {
return getCachedLF(this.intl, opts);
}
isEnglish() {
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
}
equals(other) {
return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar;
}
}
let singleton = null;
class FixedOffsetZone extends Zone {
/**
* Get a singleton instance of UTC
* @return {FixedOffsetZone}
*/
static get utcInstance() {
if (singleton === null) {
singleton = new FixedOffsetZone(0);
}
return singleton;
}
/**
* Get an instance with a specified offset
* @param {number} offset - The offset in minutes
* @return {FixedOffsetZone}
*/
static instance(offset2) {
return offset2 === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset2);
}
/**
* Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
* @param {string} s - The offset string to parse
* @example FixedOffsetZone.parseSpecifier("UTC+6")
* @example FixedOffsetZone.parseSpecifier("UTC+06")
* @example FixedOffsetZone.parseSpecifier("UTC-6:00")
* @return {FixedOffsetZone}
*/
static parseSpecifier(s2) {
if (s2) {
const r2 = s2.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
if (r2) {
return new FixedOffsetZone(signedOffset(r2[1], r2[2]));
}
}
return null;
}
constructor(offset2) {
super();
this.fixed = offset2;
}
/** @override **/
get type() {
return "fixed";
}
/** @override **/
get name() {
return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`;
}
get ianaName() {
if (this.fixed === 0) {
return "Etc/UTC";
} else {
return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`;
}
}
/** @override **/
offsetName() {
return this.name;
}
/** @override **/
formatOffset(ts2, format2) {
return formatOffset(this.fixed, format2);
}
/** @override **/
get isUniversal() {
return true;
}
/** @override **/
offset() {
return this.fixed;
}
/** @override **/
equals(otherZone) {
return otherZone.type === "fixed" && otherZone.fixed === this.fixed;
}
/** @override **/
get isValid() {
return true;
}
}
class InvalidZone extends Zone {
constructor(zoneName) {
super();
this.zoneName = zoneName;
}
/** @override **/
get type() {
return "invalid";
}
/** @override **/
get name() {
return this.zoneName;
}
/** @override **/
get isUniversal() {
return false;
}
/** @override **/
offsetName() {
return null;
}
/** @override **/
formatOffset() {
return "";
}
/** @override **/
offset() {
return NaN;
}
/** @override **/
equals() {
return false;
}
/** @override **/
get isValid() {
return false;
}
}
function normalizeZone(input, defaultZone2) {
if (isUndefined(input) || input === null) {
return defaultZone2;
} else if (input instanceof Zone) {
return input;
} else if (isString$1(input)) {
const lowered = input.toLowerCase();
if (lowered === "default")
return defaultZone2;
else if (lowered === "local" || lowered === "system")
return SystemZone.instance;
else if (lowered === "utc" || lowered === "gmt")
return FixedOffsetZone.utcInstance;
else
return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
} else if (isNumber$2(input)) {
return FixedOffsetZone.instance(input);
} else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") {
return input;
} else {
return new InvalidZone(input);
}
}
let now$2 = () => Date.now(), defaultZone = "system", defaultLocale$4 = null, defaultNumberingSystem = null, defaultOutputCalendar = null, twoDigitCutoffYear = 60, throwOnInvalid;
class Settings {
/**
* Get the callback for returning the current timestamp.
* @type {function}
*/
static get now() {
return now$2;
}
/**
* Set the callback for returning the current timestamp.
* The function should return a number, which will be interpreted as an Epoch millisecond count
* @type {function}
* @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future
* @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
*/
static set now(n2) {
now$2 = n2;
}
/**
* Set the default time zone to create DateTimes in. Does not affect existing instances.
* Use the value "system" to reset this value to the system's time zone.
* @type {string}
*/
static set defaultZone(zone) {
defaultZone = zone;
}
/**
* Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
* The default value is the system's time zone (the one set on the machine that runs this code).
* @type {Zone}
*/
static get defaultZone() {
return normalizeZone(defaultZone, SystemZone.instance);
}
/**
* Get the default locale to create DateTimes with. Does not affect existing instances.
* @type {string}
*/
static get defaultLocale() {
return defaultLocale$4;
}
/**
* Set the default locale to create DateTimes with. Does not affect existing instances.
* @type {string}
*/
static set defaultLocale(locale2) {
defaultLocale$4 = locale2;
}
/**
* Get the default numbering system to create DateTimes with. Does not affect existing instances.
* @type {string}
*/
static get defaultNumberingSystem() {
return defaultNumberingSystem;
}
/**
* Set the default numbering system to create DateTimes with. Does not affect existing instances.
* @type {string}
*/
static set defaultNumberingSystem(numberingSystem) {
defaultNumberingSystem = numberingSystem;
}
/**
* Get the default output calendar to create DateTimes with. Does not affect existing instances.
* @type {string}
*/
static get defaultOutputCalendar() {
return defaultOutputCalendar;
}
/**
* Set the default output calendar to create DateTimes with. Does not affect existing instances.
* @type {string}
*/
static set defaultOutputCalendar(outputCalendar) {
defaultOutputCalendar = outputCalendar;
}
/**
* Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.
* @type {number}
*/
static get twoDigitCutoffYear() {
return twoDigitCutoffYear;
}
/**
* Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.
* @type {number}
* @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century
* @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050
* @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50
* @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
*/
static set twoDigitCutoffYear(cutoffYear) {
twoDigitCutoffYear = cutoffYear % 100;
}
/**
* Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
* @type {boolean}
*/
static get throwOnInvalid() {
return throwOnInvalid;
}
/**
* Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
* @type {boolean}
*/
static set throwOnInvalid(t5) {
throwOnInvalid = t5;
}
/**
* Reset Luxon's global caches. Should only be necessary in testing scenarios.
* @return {void}
*/
static resetCaches() {
Locale.resetCache();
IANAZone.resetCache();
}
}
function isUndefined(o2) {
return typeof o2 === "undefined";
}
function isNumber$2(o2) {
return typeof o2 === "number";
}
function isInteger$1(o2) {
return typeof o2 === "number" && o2 % 1 === 0;
}
function isString$1(o2) {
return typeof o2 === "string";
}
function isDate$2(o2) {
return Object.prototype.toString.call(o2) === "[object Date]";
}
function hasRelative() {
try {
return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat;
} catch (e7) {
return false;
}
}
function maybeArray(thing) {
return Array.isArray(thing) ? thing : [thing];
}
function bestBy(arr2, by, compare3) {
if (arr2.length === 0) {
return void 0;
}
return arr2.reduce((best, next2) => {
const pair = [by(next2), next2];
if (!best) {
return pair;
} else if (compare3(best[0], pair[0]) === best[0]) {
return best;
} else {
return pair;
}
}, null)[1];
}
function pick$5(obj, keys3) {
return keys3.reduce((a2, k2) => {
a2[k2] = obj[k2];
return a2;
}, {});
}
function hasOwnProperty$4(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
function integerBetween(thing, bottom2, top2) {
return isInteger$1(thing) && thing >= bottom2 && thing <= top2;
}
function floorMod(x2, n2) {
return x2 - n2 * Math.floor(x2 / n2);
}
function padStart(input, n2 = 2) {
const isNeg = input < 0;
let padded;
if (isNeg) {
padded = "-" + ("" + -input).padStart(n2, "0");
} else {
padded = ("" + input).padStart(n2, "0");
}
return padded;
}
function parseInteger(string2) {
if (isUndefined(string2) || string2 === null || string2 === "") {
return void 0;
} else {
return parseInt(string2, 10);
}
}
function parseFloating(string2) {
if (isUndefined(string2) || string2 === null || string2 === "") {
return void 0;
} else {
return parseFloat(string2);
}
}
function parseMillis(fraction) {
if (isUndefined(fraction) || fraction === null || fraction === "") {
return void 0;
} else {
const f2 = parseFloat("0." + fraction) * 1e3;
return Math.floor(f2);
}
}
function roundTo(number2, digits, towardZero = false) {
const factor = 10 ** digits, rounder = towardZero ? Math.trunc : Math.round;
return rounder(number2 * factor) / factor;
}
function isLeapYear(year2) {
return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0);
}
function daysInYear(year2) {
return isLeapYear(year2) ? 366 : 365;
}
function daysInMonth(year2, month2) {
const modMonth = floorMod(month2 - 1, 12) + 1, modYear = year2 + (month2 - modMonth) / 12;
if (modMonth === 2) {
return isLeapYear(modYear) ? 29 : 28;
} else {
return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];
}
}
function objToLocalTS(obj) {
let d2 = Date.UTC(
obj.year,
obj.month - 1,
obj.day,
obj.hour,
obj.minute,
obj.second,
obj.millisecond
);
if (obj.year < 100 && obj.year >= 0) {
d2 = new Date(d2);
d2.setUTCFullYear(obj.year, obj.month - 1, obj.day);
}
return +d2;
}
function weeksInWeekYear(weekYear) {
const p1 = (weekYear + Math.floor(weekYear / 4) - Math.floor(weekYear / 100) + Math.floor(weekYear / 400)) % 7, last = weekYear - 1, p2 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7;
return p1 === 4 || p2 === 3 ? 53 : 52;
}
function untruncateYear(year2) {
if (year2 > 99) {
return year2;
} else
return year2 > Settings.twoDigitCutoffYear ? 1900 + year2 : 2e3 + year2;
}
function parseZoneInfo(ts2, offsetFormat, locale2, timeZone = null) {
const date2 = new Date(ts2), intlOpts = {
hourCycle: "h23",
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit"
};
if (timeZone) {
intlOpts.timeZone = timeZone;
}
const modified2 = { timeZoneName: offsetFormat, ...intlOpts };
const parsed = new Intl.DateTimeFormat(locale2, modified2).formatToParts(date2).find((m2) => m2.type.toLowerCase() === "timezonename");
return parsed ? parsed.value : null;
}
function signedOffset(offHourStr, offMinuteStr) {
let offHour = parseInt(offHourStr, 10);
if (Number.isNaN(offHour)) {
offHour = 0;
}
const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;
return offHour * 60 + offMinSigned;
}
function asNumber(value2) {
const numericValue = Number(value2);
if (typeof value2 === "boolean" || value2 === "" || Number.isNaN(numericValue))
throw new InvalidArgumentError(`Invalid unit value ${value2}`);
return numericValue;
}
function normalizeObject(obj, normalizer) {
const normalized = {};
for (const u2 in obj) {
if (hasOwnProperty$4(obj, u2)) {
const v2 = obj[u2];
if (v2 === void 0 || v2 === null)
continue;
normalized[normalizer(u2)] = asNumber(v2);
}
}
return normalized;
}
function formatOffset(offset2, format2) {
const hours = Math.trunc(Math.abs(offset2 / 60)), minutes = Math.trunc(Math.abs(offset2 % 60)), sign2 = offset2 >= 0 ? "+" : "-";
switch (format2) {
case "short":
return `${sign2}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
case "narrow":
return `${sign2}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
case "techie":
return `${sign2}${padStart(hours, 2)}${padStart(minutes, 2)}`;
default:
throw new RangeError(`Value format ${format2} is out of range for property format`);
}
}
function timeObject(obj) {
return pick$5(obj, ["hour", "minute", "second", "millisecond"]);
}
const monthsLong = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
const monthsShort = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
];
const monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
function months(length2) {
switch (length2) {
case "narrow":
return [...monthsNarrow];
case "short":
return [...monthsShort];
case "long":
return [...monthsLong];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
case "2-digit":
return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
default:
return null;
}
}
const weekdaysLong = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
];
const weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"];
function weekdays(length2) {
switch (length2) {
case "narrow":
return [...weekdaysNarrow];
case "short":
return [...weekdaysShort];
case "long":
return [...weekdaysLong];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7"];
default:
return null;
}
}
const meridiems = ["AM", "PM"];
const erasLong = ["Before Christ", "Anno Domini"];
const erasShort = ["BC", "AD"];
const erasNarrow = ["B", "A"];
function eras(length2) {
switch (length2) {
case "narrow":
return [...erasNarrow];
case "short":
return [...erasShort];
case "long":
return [...erasLong];
default:
return null;
}
}
function meridiemForDateTime(dt2) {
return meridiems[dt2.hour < 12 ? 0 : 1];
}
function weekdayForDateTime(dt2, length2) {
return weekdays(length2)[dt2.weekday - 1];
}
function monthForDateTime(dt2, length2) {
return months(length2)[dt2.month - 1];
}
function eraForDateTime(dt2, length2) {
return eras(length2)[dt2.year < 0 ? 0 : 1];
}
function formatRelativeTime(unit2, count2, numeric = "always", narrow = false) {
const units = {
years: ["year", "yr."],
quarters: ["quarter", "qtr."],
months: ["month", "mo."],
weeks: ["week", "wk."],
days: ["day", "day", "days"],
hours: ["hour", "hr."],
minutes: ["minute", "min."],
seconds: ["second", "sec."]
};
const lastable = ["hours", "minutes", "seconds"].indexOf(unit2) === -1;
if (numeric === "auto" && lastable) {
const isDay = unit2 === "days";
switch (count2) {
case 1:
return isDay ? "tomorrow" : `next ${units[unit2][0]}`;
case -1:
return isDay ? "yesterday" : `last ${units[unit2][0]}`;
case 0:
return isDay ? "today" : `this ${units[unit2][0]}`;
}
}
const isInPast = Object.is(count2, -0) || count2 < 0, fmtValue = Math.abs(count2), singular = fmtValue === 1, lilUnits = units[unit2], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit2][0] : unit2;
return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;
}
function stringifyTokens(splits, tokenToString) {
let s2 = "";
for (const token2 of splits) {
if (token2.literal) {
s2 += token2.val;
} else {
s2 += tokenToString(token2.val);
}
}
return s2;
}
const macroTokenToFormatOpts = {
D: DATE_SHORT,
DD: DATE_MED,
DDD: DATE_FULL,
DDDD: DATE_HUGE,
t: TIME_SIMPLE,
tt: TIME_WITH_SECONDS,
ttt: TIME_WITH_SHORT_OFFSET,
tttt: TIME_WITH_LONG_OFFSET,
T: TIME_24_SIMPLE,
TT: TIME_24_WITH_SECONDS,
TTT: TIME_24_WITH_SHORT_OFFSET,
TTTT: TIME_24_WITH_LONG_OFFSET,
f: DATETIME_SHORT,
ff: DATETIME_MED,
fff: DATETIME_FULL,
ffff: DATETIME_HUGE,
F: DATETIME_SHORT_WITH_SECONDS,
FF: DATETIME_MED_WITH_SECONDS,
FFF: DATETIME_FULL_WITH_SECONDS,
FFFF: DATETIME_HUGE_WITH_SECONDS
};
let Formatter$1 = class Formatter {
static create(locale2, opts = {}) {
return new Formatter(locale2, opts);
}
static parseFormat(fmt) {
let current = null, currentFull = "", bracketed = false;
const splits = [];
for (let i2 = 0; i2 < fmt.length; i2++) {
const c2 = fmt.charAt(i2);
if (c2 === "'") {
if (currentFull.length > 0) {
splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull });
}
current = null;
currentFull = "";
bracketed = !bracketed;
} else if (bracketed) {
currentFull += c2;
} else if (c2 === current) {
currentFull += c2;
} else {
if (currentFull.length > 0) {
splits.push({ literal: /^\s+$/.test(currentFull), val: currentFull });
}
currentFull = c2;
current = c2;
}
}
if (currentFull.length > 0) {
splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull });
}
return splits;
}
static macroTokenToFormatOpts(token2) {
return macroTokenToFormatOpts[token2];
}
constructor(locale2, formatOpts) {
this.opts = formatOpts;
this.loc = locale2;
this.systemLoc = null;
}
formatWithSystemDefault(dt2, opts) {
if (this.systemLoc === null) {
this.systemLoc = this.loc.redefaultToSystem();
}
const df2 = this.systemLoc.dtFormatter(dt2, { ...this.opts, ...opts });
return df2.format();
}
dtFormatter(dt2, opts = {}) {
return this.loc.dtFormatter(dt2, { ...this.opts, ...opts });
}
formatDateTime(dt2, opts) {
return this.dtFormatter(dt2, opts).format();
}
formatDateTimeParts(dt2, opts) {
return this.dtFormatter(dt2, opts).formatToParts();
}
formatInterval(interval2, opts) {
const df2 = this.dtFormatter(interval2.start, opts);
return df2.dtf.formatRange(interval2.start.toJSDate(), interval2.end.toJSDate());
}
resolvedOptions(dt2, opts) {
return this.dtFormatter(dt2, opts).resolvedOptions();
}
num(n2, p2 = 0) {
if (this.opts.forceSimple) {
return padStart(n2, p2);
}
const opts = { ...this.opts };
if (p2 > 0) {
opts.padTo = p2;
}
return this.loc.numberFormatter(opts).format(n2);
}
formatDateTimeFromString(dt2, fmt) {
const knownEnglish = this.loc.listingMode() === "en", useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", string2 = (opts, extract) => this.loc.extract(dt2, opts, extract), formatOffset2 = (opts) => {
if (dt2.isOffsetFixed && dt2.offset === 0 && opts.allowZ) {
return "Z";
}
return dt2.isValid ? dt2.zone.formatOffset(dt2.ts, opts.format) : "";
}, meridiem = () => knownEnglish ? meridiemForDateTime(dt2) : string2({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), month2 = (length2, standalone) => knownEnglish ? monthForDateTime(dt2, length2) : string2(standalone ? { month: length2 } : { month: length2, day: "numeric" }, "month"), weekday2 = (length2, standalone) => knownEnglish ? weekdayForDateTime(dt2, length2) : string2(
standalone ? { weekday: length2 } : { weekday: length2, month: "long", day: "numeric" },
"weekday"
), maybeMacro = (token2) => {
const formatOpts = Formatter.macroTokenToFormatOpts(token2);
if (formatOpts) {
return this.formatWithSystemDefault(dt2, formatOpts);
} else {
return token2;
}
}, era = (length2) => knownEnglish ? eraForDateTime(dt2, length2) : string2({ era: length2 }, "era"), tokenToString = (token2) => {
switch (token2) {
case "S":
return this.num(dt2.millisecond);
case "u":
case "SSS":
return this.num(dt2.millisecond, 3);
case "s":
return this.num(dt2.second);
case "ss":
return this.num(dt2.second, 2);
case "uu":
return this.num(Math.floor(dt2.millisecond / 10), 2);
case "uuu":
return this.num(Math.floor(dt2.millisecond / 100));
case "m":
return this.num(dt2.minute);
case "mm":
return this.num(dt2.minute, 2);
case "h":
return this.num(dt2.hour % 12 === 0 ? 12 : dt2.hour % 12);
case "hh":
return this.num(dt2.hour % 12 === 0 ? 12 : dt2.hour % 12, 2);
case "H":
return this.num(dt2.hour);
case "HH":
return this.num(dt2.hour, 2);
case "Z":
return formatOffset2({ format: "narrow", allowZ: this.opts.allowZ });
case "ZZ":
return formatOffset2({ format: "short", allowZ: this.opts.allowZ });
case "ZZZ":
return formatOffset2({ format: "techie", allowZ: this.opts.allowZ });
case "ZZZZ":
return dt2.zone.offsetName(dt2.ts, { format: "short", locale: this.loc.locale });
case "ZZZZZ":
return dt2.zone.offsetName(dt2.ts, { format: "long", locale: this.loc.locale });
case "z":
return dt2.zoneName;
case "a":
return meridiem();
case "d":
return useDateTimeFormatter ? string2({ day: "numeric" }, "day") : this.num(dt2.day);
case "dd":
return useDateTimeFormatter ? string2({ day: "2-digit" }, "day") : this.num(dt2.day, 2);
case "c":
return this.num(dt2.weekday);
case "ccc":
return weekday2("short", true);
case "cccc":
return weekday2("long", true);
case "ccccc":
return weekday2("narrow", true);
case "E":
return this.num(dt2.weekday);
case "EEE":
return weekday2("short", false);
case "EEEE":
return weekday2("long", false);
case "EEEEE":
return weekday2("narrow", false);
case "L":
return useDateTimeFormatter ? string2({ month: "numeric", day: "numeric" }, "month") : this.num(dt2.month);
case "LL":
return useDateTimeFormatter ? string2({ month: "2-digit", day: "numeric" }, "month") : this.num(dt2.month, 2);
case "LLL":
return month2("short", true);
case "LLLL":
return month2("long", true);
case "LLLLL":
return month2("narrow", true);
case "M":
return useDateTimeFormatter ? string2({ month: "numeric" }, "month") : this.num(dt2.month);
case "MM":
return useDateTimeFormatter ? string2({ month: "2-digit" }, "month") : this.num(dt2.month, 2);
case "MMM":
return month2("short", false);
case "MMMM":
return month2("long", false);
case "MMMMM":
return month2("narrow", false);
case "y":
return useDateTimeFormatter ? string2({ year: "numeric" }, "year") : this.num(dt2.year);
case "yy":
return useDateTimeFormatter ? string2({ year: "2-digit" }, "year") : this.num(dt2.year.toString().slice(-2), 2);
case "yyyy":
return useDateTimeFormatter ? string2({ year: "numeric" }, "year") : this.num(dt2.year, 4);
case "yyyyyy":
return useDateTimeFormatter ? string2({ year: "numeric" }, "year") : this.num(dt2.year, 6);
case "G":
return era("short");
case "GG":
return era("long");
case "GGGGG":
return era("narrow");
case "kk":
return this.num(dt2.weekYear.toString().slice(-2), 2);
case "kkkk":
return this.num(dt2.weekYear, 4);
case "W":
return this.num(dt2.weekNumber);
case "WW":
return this.num(dt2.weekNumber, 2);
case "o":
return this.num(dt2.ordinal);
case "ooo":
return this.num(dt2.ordinal, 3);
case "q":
return this.num(dt2.quarter);
case "qq":
return this.num(dt2.quarter, 2);
case "X":
return this.num(Math.floor(dt2.ts / 1e3));
case "x":
return this.num(dt2.ts);
default:
return maybeMacro(token2);
}
};
return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);
}
formatDurationFromString(dur, fmt) {
const tokenToField = (token2) => {
switch (token2[0]) {
case "S":
return "millisecond";
case "s":
return "second";
case "m":
return "minute";
case "h":
return "hour";
case "d":
return "day";
case "w":
return "week";
case "M":
return "month";
case "y":
return "year";
default:
return null;
}
}, tokenToString = (lildur) => (token2) => {
const mapped = tokenToField(token2);
if (mapped) {
return this.num(lildur.get(mapped), token2.length);
} else {
return token2;
}
}, tokens = Formatter.parseFormat(fmt), realTokens = tokens.reduce(
(found, { literal, val }) => literal ? found : found.concat(val),
[]
), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t5) => t5));
return stringifyTokens(tokens, tokenToString(collapsed));
}
};
class Invalid {
constructor(reason, explanation) {
this.reason = reason;
this.explanation = explanation;
}
toMessage() {
if (this.explanation) {
return `${this.reason}: ${this.explanation}`;
} else {
return this.reason;
}
}
}
const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
function combineRegexes(...regexes) {
const full = regexes.reduce((f2, r2) => f2 + r2.source, "");
return RegExp(`^${full}$`);
}
function combineExtractors(...extractors) {
return (m2) => extractors.reduce(
([mergedVals, mergedZone, cursor2], ex) => {
const [val, zone, next2] = ex(m2, cursor2);
return [{ ...mergedVals, ...val }, zone || mergedZone, next2];
},
[{}, null, 1]
).slice(0, 2);
}
function parse$9(s2, ...patterns) {
if (s2 == null) {
return [null, null];
}
for (const [regex, extractor] of patterns) {
const m2 = regex.exec(s2);
if (m2) {
return extractor(m2);
}
}
return [null, null];
}
function simpleParse(...keys3) {
return (match2, cursor2) => {
const ret = {};
let i2;
for (i2 = 0; i2 < keys3.length; i2++) {
ret[keys3[i2]] = parseInteger(match2[cursor2 + i2]);
}
return [ret, null, cursor2 + i2];
};
}
const offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;
const isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`;
const isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
const isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);
const isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);
const isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
const isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
const isoOrdinalRegex = /(\d{4})-?(\d{3})/;
const extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay");
const extractISOOrdinalData = simpleParse("year", "ordinal");
const sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/;
const sqlTimeRegex = RegExp(
`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`
);
const sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);
function int(match2, pos, fallback2) {
const m2 = match2[pos];
return isUndefined(m2) ? fallback2 : parseInteger(m2);
}
function extractISOYmd(match2, cursor2) {
const item = {
year: int(match2, cursor2),
month: int(match2, cursor2 + 1, 1),
day: int(match2, cursor2 + 2, 1)
};
return [item, null, cursor2 + 3];
}
function extractISOTime(match2, cursor2) {
const item = {
hours: int(match2, cursor2, 0),
minutes: int(match2, cursor2 + 1, 0),
seconds: int(match2, cursor2 + 2, 0),
milliseconds: parseMillis(match2[cursor2 + 3])
};
return [item, null, cursor2 + 4];
}
function extractISOOffset(match2, cursor2) {
const local = !match2[cursor2] && !match2[cursor2 + 1], fullOffset = signedOffset(match2[cursor2 + 1], match2[cursor2 + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset);
return [{}, zone, cursor2 + 3];
}
function extractIANAZone(match2, cursor2) {
const zone = match2[cursor2] ? IANAZone.create(match2[cursor2]) : null;
return [{}, zone, cursor2 + 1];
}
const isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);
const isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
function extractISODuration(match2) {
const [s2, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2;
const hasNegativePrefix = s2[0] === "-";
const negativeSeconds = secondStr && secondStr[0] === "-";
const maybeNegate = (num, force2 = false) => num !== void 0 && (force2 || num && hasNegativePrefix) ? -num : num;
return [
{
years: maybeNegate(parseFloating(yearStr)),
months: maybeNegate(parseFloating(monthStr)),
weeks: maybeNegate(parseFloating(weekStr)),
days: maybeNegate(parseFloating(dayStr)),
hours: maybeNegate(parseFloating(hourStr)),
minutes: maybeNegate(parseFloating(minuteStr)),
seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"),
milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds)
}
];
}
const obsOffsets = {
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60
};
function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
const result = {
year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),
month: monthsShort.indexOf(monthStr) + 1,
day: parseInteger(dayStr),
hour: parseInteger(hourStr),
minute: parseInteger(minuteStr)
};
if (secondStr)
result.second = parseInteger(secondStr);
if (weekdayStr) {
result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1;
}
return result;
}
const rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
function extractRFC2822(match2) {
const [
,
weekdayStr,
dayStr,
monthStr,
yearStr,
hourStr,
minuteStr,
secondStr,
obsOffset,
milOffset,
offHourStr,
offMinuteStr
] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
let offset2;
if (obsOffset) {
offset2 = obsOffsets[obsOffset];
} else if (milOffset) {
offset2 = 0;
} else {
offset2 = signedOffset(offHourStr, offMinuteStr);
}
return [result, new FixedOffsetZone(offset2)];
}
function preprocessRFC2822(s2) {
return s2.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
}
const rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
function extractRFC1123Or850(match2) {
const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
return [result, FixedOffsetZone.utcInstance];
}
function extractASCII(match2) {
const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
return [result, FixedOffsetZone.utcInstance];
}
const isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);
const isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);
const isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);
const isoTimeCombinedRegex = combineRegexes(isoTimeRegex);
const extractISOYmdTimeAndOffset = combineExtractors(
extractISOYmd,
extractISOTime,
extractISOOffset,
extractIANAZone
);
const extractISOWeekTimeAndOffset = combineExtractors(
extractISOWeekData,
extractISOTime,
extractISOOffset,
extractIANAZone
);
const extractISOOrdinalDateAndTime = combineExtractors(
extractISOOrdinalData,
extractISOTime,
extractISOOffset,
extractIANAZone
);
const extractISOTimeAndOffset = combineExtractors(
extractISOTime,
extractISOOffset,
extractIANAZone
);
function parseISODate(s2) {
return parse$9(
s2,
[isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
[isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],
[isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],
[isoTimeCombinedRegex, extractISOTimeAndOffset]
);
}
function parseRFC2822Date(s2) {
return parse$9(preprocessRFC2822(s2), [rfc2822, extractRFC2822]);
}
function parseHTTPDate(s2) {
return parse$9(
s2,
[rfc1123, extractRFC1123Or850],
[rfc850, extractRFC1123Or850],
[ascii, extractASCII]
);
}
function parseISODuration(s2) {
return parse$9(s2, [isoDuration, extractISODuration]);
}
const extractISOTimeOnly = combineExtractors(extractISOTime);
function parseISOTimeOnly(s2) {
return parse$9(s2, [isoTimeOnly, extractISOTimeOnly]);
}
const sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
const sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
const extractISOTimeOffsetAndIANAZone = combineExtractors(
extractISOTime,
extractISOOffset,
extractIANAZone
);
function parseSQL(s2) {
return parse$9(
s2,
[sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
[sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]
);
}
const INVALID$2 = "Invalid Duration";
const lowOrderMatrix = {
weeks: {
days: 7,
hours: 7 * 24,
minutes: 7 * 24 * 60,
seconds: 7 * 24 * 60 * 60,
milliseconds: 7 * 24 * 60 * 60 * 1e3
},
days: {
hours: 24,
minutes: 24 * 60,
seconds: 24 * 60 * 60,
milliseconds: 24 * 60 * 60 * 1e3
},
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
seconds: { milliseconds: 1e3 }
}, casualMatrix = {
years: {
quarters: 4,
months: 12,
weeks: 52,
days: 365,
hours: 365 * 24,
minutes: 365 * 24 * 60,
seconds: 365 * 24 * 60 * 60,
milliseconds: 365 * 24 * 60 * 60 * 1e3
},
quarters: {
months: 3,
weeks: 13,
days: 91,
hours: 91 * 24,
minutes: 91 * 24 * 60,
seconds: 91 * 24 * 60 * 60,
milliseconds: 91 * 24 * 60 * 60 * 1e3
},
months: {
weeks: 4,
days: 30,
hours: 30 * 24,
minutes: 30 * 24 * 60,
seconds: 30 * 24 * 60 * 60,
milliseconds: 30 * 24 * 60 * 60 * 1e3
},
...lowOrderMatrix
}, daysInYearAccurate = 146097 / 400, daysInMonthAccurate = 146097 / 4800, accurateMatrix = {
years: {
quarters: 4,
months: 12,
weeks: daysInYearAccurate / 7,
days: daysInYearAccurate,
hours: daysInYearAccurate * 24,
minutes: daysInYearAccurate * 24 * 60,
seconds: daysInYearAccurate * 24 * 60 * 60,
milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3
},
quarters: {
months: 3,
weeks: daysInYearAccurate / 28,
days: daysInYearAccurate / 4,
hours: daysInYearAccurate * 24 / 4,
minutes: daysInYearAccurate * 24 * 60 / 4,
seconds: daysInYearAccurate * 24 * 60 * 60 / 4,
milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 / 4
},
months: {
weeks: daysInMonthAccurate / 7,
days: daysInMonthAccurate,
hours: daysInMonthAccurate * 24,
minutes: daysInMonthAccurate * 24 * 60,
seconds: daysInMonthAccurate * 24 * 60 * 60,
milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1e3
},
...lowOrderMatrix
};
const orderedUnits$1 = [
"years",
"quarters",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds"
];
const reverseUnits = orderedUnits$1.slice(0).reverse();
function clone$2(dur, alts, clear2 = false) {
const conf = {
values: clear2 ? alts.values : { ...dur.values, ...alts.values || {} },
loc: dur.loc.clone(alts.loc),
conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
matrix: alts.matrix || dur.matrix
};
return new Duration(conf);
}
function durationToMillis(matrix2, vals) {
let sum2 = vals.milliseconds ?? 0;
for (const unit2 of reverseUnits.slice(1)) {
if (vals[unit2]) {
sum2 += vals[unit2] * matrix2[unit2]["milliseconds"];
}
}
return sum2;
}
function normalizeValues(matrix2, vals) {
const factor = durationToMillis(matrix2, vals) < 0 ? -1 : 1;
orderedUnits$1.reduceRight((previous, current) => {
if (!isUndefined(vals[current])) {
if (previous) {
const previousVal = vals[previous] * factor;
const conv = matrix2[current][previous];
const rollUp = Math.floor(previousVal / conv);
vals[current] += rollUp * factor;
vals[previous] -= rollUp * conv * factor;
}
return current;
} else {
return previous;
}
}, null);
orderedUnits$1.reduce((previous, current) => {
if (!isUndefined(vals[current])) {
if (previous) {
const fraction = vals[previous] % 1;
vals[previous] -= fraction;
vals[current] += fraction * matrix2[previous][current];
}
return current;
} else {
return previous;
}
}, null);
}
function removeZeroes(vals) {
const newVals = {};
for (const [key2, value2] of Object.entries(vals)) {
if (value2 !== 0) {
newVals[key2] = value2;
}
}
return newVals;
}
class Duration {
/**
* @private
*/
constructor(config2) {
const accurate = config2.conversionAccuracy === "longterm" || false;
let matrix2 = accurate ? accurateMatrix : casualMatrix;
if (config2.matrix) {
matrix2 = config2.matrix;
}
this.values = config2.values;
this.loc = config2.loc || Locale.create();
this.conversionAccuracy = accurate ? "longterm" : "casual";
this.invalid = config2.invalid || null;
this.matrix = matrix2;
this.isLuxonDuration = true;
}
/**
* Create Duration from a number of milliseconds.
* @param {number} count of milliseconds
* @param {Object} opts - options for parsing
* @param {string} [opts.locale='en-US'] - the locale to use
* @param {string} opts.numberingSystem - the numbering system to use
* @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
* @return {Duration}
*/
static fromMillis(count2, opts) {
return Duration.fromObject({ milliseconds: count2 }, opts);
}
/**
* Create a Duration from a JavaScript object with keys like 'years' and 'hours'.
* If this object is empty then a zero milliseconds duration is returned.
* @param {Object} obj - the object to create the DateTime from
* @param {number} obj.years
* @param {number} obj.quarters
* @param {number} obj.months
* @param {number} obj.weeks
* @param {number} obj.days
* @param {number} obj.hours
* @param {number} obj.minutes
* @param {number} obj.seconds
* @param {number} obj.milliseconds
* @param {Object} [opts=[]] - options for creating this Duration
* @param {string} [opts.locale='en-US'] - the locale to use
* @param {string} opts.numberingSystem - the numbering system to use
* @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use
* @param {string} [opts.matrix=Object] - the custom conversion system to use
* @return {Duration}
*/
static fromObject(obj, opts = {}) {
if (obj == null || typeof obj !== "object") {
throw new InvalidArgumentError(
`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`
);
}
return new Duration({
values: normalizeObject(obj, Duration.normalizeUnit),
loc: Locale.fromObject(opts),
conversionAccuracy: opts.conversionAccuracy,
matrix: opts.matrix
});
}
/**
* Create a Duration from DurationLike.
*
* @param {Object | number | Duration} durationLike
* One of:
* - object with keys like 'years' and 'hours'.
* - number representing milliseconds
* - Duration instance
* @return {Duration}
*/
static fromDurationLike(durationLike) {
if (isNumber$2(durationLike)) {
return Duration.fromMillis(durationLike);
} else if (Duration.isDuration(durationLike)) {
return durationLike;
} else if (typeof durationLike === "object") {
return Duration.fromObject(durationLike);
} else {
throw new InvalidArgumentError(
`Unknown duration argument ${durationLike} of type ${typeof durationLike}`
);
}
}
/**
* Create a Duration from an ISO 8601 duration string.
* @param {string} text - text to parse
* @param {Object} opts - options for parsing
* @param {string} [opts.locale='en-US'] - the locale to use
* @param {string} opts.numberingSystem - the numbering system to use
* @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use
* @param {string} [opts.matrix=Object] - the preset conversion system to use
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations
* @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }
* @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }
* @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }
* @return {Duration}
*/
static fromISO(text2, opts) {
const [parsed] = parseISODuration(text2);
if (parsed) {
return Duration.fromObject(parsed, opts);
} else {
return Duration.invalid("unparsable", `the input "${text2}" can't be parsed as ISO 8601`);
}
}
/**
* Create a Duration from an ISO 8601 time string.
* @param {string} text - text to parse
* @param {Object} opts - options for parsing
* @param {string} [opts.locale='en-US'] - the locale to use
* @param {string} opts.numberingSystem - the numbering system to use
* @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use
* @param {string} [opts.matrix=Object] - the conversion system to use
* @see https://en.wikipedia.org/wiki/ISO_8601#Times
* @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }
* @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
* @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
* @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
* @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
* @return {Duration}
*/
static fromISOTime(text2, opts) {
const [parsed] = parseISOTimeOnly(text2);
if (parsed) {
return Duration.fromObject(parsed, opts);
} else {
return Duration.invalid("unparsable", `the input "${text2}" can't be parsed as ISO 8601`);
}
}
/**
* Create an invalid Duration.
* @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent
* @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information
* @return {Duration}
*/
static invalid(reason, explanation = null) {
if (!reason) {
throw new InvalidArgumentError("need to specify a reason the Duration is invalid");
}
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
if (Settings.throwOnInvalid) {
throw new InvalidDurationError(invalid);
} else {
return new Duration({ invalid });
}
}
/**
* @private
*/
static normalizeUnit(unit2) {
const normalized = {
year: "years",
years: "years",
quarter: "quarters",
quarters: "quarters",
month: "months",
months: "months",
week: "weeks",
weeks: "weeks",
day: "days",
days: "days",
hour: "hours",
hours: "hours",
minute: "minutes",
minutes: "minutes",
second: "seconds",
seconds: "seconds",
millisecond: "milliseconds",
milliseconds: "milliseconds"
}[unit2 ? unit2.toLowerCase() : unit2];
if (!normalized)
throw new InvalidUnitError(unit2);
return normalized;
}
/**
* Check if an object is a Duration. Works across context boundaries
* @param {object} o
* @return {boolean}
*/
static isDuration(o2) {
return o2 && o2.isLuxonDuration || false;
}
/**
* Get the locale of a Duration, such 'en-GB'
* @type {string}
*/
get locale() {
return this.isValid ? this.loc.locale : null;
}
/**
* Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration
*
* @type {string}
*/
get numberingSystem() {
return this.isValid ? this.loc.numberingSystem : null;
}
/**
* Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:
* * `S` for milliseconds
* * `s` for seconds
* * `m` for minutes
* * `h` for hours
* * `d` for days
* * `w` for weeks
* * `M` for months
* * `y` for years
* Notes:
* * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits
* * Tokens can be escaped by wrapping with single quotes.
* * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.
* @param {string} fmt - the format string
* @param {Object} opts - options
* @param {boolean} [opts.floor=true] - floor numerical values
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2"
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002"
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000"
* @return {string}
*/
toFormat(fmt, opts = {}) {
const fmtOpts = {
...opts,
floor: opts.round !== false && opts.floor !== false
};
return this.isValid ? Formatter$1.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
}
/**
* Returns a string representation of a Duration with all units included.
* To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
* @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`.
* @example
* ```js
* var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })
* dur.toHuman() //=> '1 day, 5 hours, 6 minutes'
* dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes'
* dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min'
* ```
*/
toHuman(opts = {}) {
if (!this.isValid)
return INVALID$2;
const l2 = orderedUnits$1.map((unit2) => {
const val = this.values[unit2];
if (isUndefined(val)) {
return null;
}
return this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit2.slice(0, -1) }).format(val);
}).filter((n2) => n2);
return this.loc.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }).format(l2);
}
/**
* Returns a JavaScript object with this Duration's values.
* @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }
* @return {Object}
*/
toObject() {
if (!this.isValid)
return {};
return { ...this.values };
}
/**
* Returns an ISO 8601-compliant string representation of this Duration.
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations
* @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'
* @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'
* @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'
* @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'
* @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'
* @return {string}
*/
toISO() {
if (!this.isValid)
return null;
let s2 = "P";
if (this.years !== 0)
s2 += this.years + "Y";
if (this.months !== 0 || this.quarters !== 0)
s2 += this.months + this.quarters * 3 + "M";
if (this.weeks !== 0)
s2 += this.weeks + "W";
if (this.days !== 0)
s2 += this.days + "D";
if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)
s2 += "T";
if (this.hours !== 0)
s2 += this.hours + "H";
if (this.minutes !== 0)
s2 += this.minutes + "M";
if (this.seconds !== 0 || this.milliseconds !== 0)
s2 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S";
if (s2 === "P")
s2 += "T0S";
return s2;
}
/**
* Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
* Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.
* @see https://en.wikipedia.org/wiki/ISO_8601#Times
* @param {Object} opts - options
* @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0
* @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0
* @param {boolean} [opts.includePrefix=false] - include the `T` prefix
* @param {string} [opts.format='extended'] - choose between the basic and extended format
* @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'
* @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'
* @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'
* @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'
* @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'
* @return {string}
*/
toISOTime(opts = {}) {
if (!this.isValid)
return null;
const millis = this.toMillis();
if (millis < 0 || millis >= 864e5)
return null;
opts = {
suppressMilliseconds: false,
suppressSeconds: false,
includePrefix: false,
format: "extended",
...opts,
includeOffset: false
};
const dateTime = DateTime.fromMillis(millis, { zone: "UTC" });
return dateTime.toISOTime(opts);
}
/**
* Returns an ISO 8601 representation of this Duration appropriate for use in JSON.
* @return {string}
*/
toJSON() {
return this.toISO();
}
/**
* Returns an ISO 8601 representation of this Duration appropriate for use in debugging.
* @return {string}
*/
toString() {
return this.toISO();
}
/**
* Returns an milliseconds value of this Duration.
* @return {number}
*/
toMillis() {
if (!this.isValid)
return NaN;
return durationToMillis(this.matrix, this.values);
}
/**
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
* @return {number}
*/
valueOf() {
return this.toMillis();
}
/**
* Make this Duration longer by the specified amount. Return a newly-constructed Duration.
* @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
* @return {Duration}
*/
plus(duration2) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration2), result = {};
for (const k2 of orderedUnits$1) {
if (hasOwnProperty$4(dur.values, k2) || hasOwnProperty$4(this.values, k2)) {
result[k2] = dur.get(k2) + this.get(k2);
}
}
return clone$2(this, { values: result }, true);
}
/**
* Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
* @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
* @return {Duration}
*/
minus(duration2) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration2);
return this.plus(dur.negate());
}
/**
* Scale this Duration by the specified amount. Return a newly-constructed Duration.
* @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.
* @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }
* @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 }
* @return {Duration}
*/
mapUnits(fn8) {
if (!this.isValid)
return this;
const result = {};
for (const k2 of Object.keys(this.values)) {
result[k2] = asNumber(fn8(this.values[k2], k2));
}
return clone$2(this, { values: result }, true);
}
/**
* Get the value of unit.
* @param {string} unit - a unit such as 'minute' or 'day'
* @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2
* @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0
* @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3
* @return {number}
*/
get(unit2) {
return this[Duration.normalizeUnit(unit2)];
}
/**
* "Set" the values of specified units. Return a newly-constructed Duration.
* @param {Object} values - a mapping of units to numbers
* @example dur.set({ years: 2017 })
* @example dur.set({ hours: 8, minutes: 30 })
* @return {Duration}
*/
set(values2) {
if (!this.isValid)
return this;
const mixed = { ...this.values, ...normalizeObject(values2, Duration.normalizeUnit) };
return clone$2(this, { values: mixed });
}
/**
* "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
* @example dur.reconfigure({ locale: 'en-GB' })
* @return {Duration}
*/
reconfigure({ locale: locale2, numberingSystem, conversionAccuracy, matrix: matrix2 } = {}) {
const loc = this.loc.clone({ locale: locale2, numberingSystem });
const opts = { loc, matrix: matrix2, conversionAccuracy };
return clone$2(this, opts);
}
/**
* Return the length of the duration in the specified unit.
* @param {string} unit - a unit such as 'minutes' or 'days'
* @example Duration.fromObject({years: 1}).as('days') //=> 365
* @example Duration.fromObject({years: 1}).as('months') //=> 12
* @example Duration.fromObject({hours: 60}).as('days') //=> 2.5
* @return {number}
*/
as(unit2) {
return this.isValid ? this.shiftTo(unit2).get(unit2) : NaN;
}
/**
* Reduce this Duration to its canonical representation in its current units.
* Assuming the overall value of the Duration is positive, this means:
* - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)
* - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise
* the overall value would be negative, see second example)
* - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)
*
* If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.
* @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }
* @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }
* @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }
* @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }
* @return {Duration}
*/
normalize() {
if (!this.isValid)
return this;
const vals = this.toObject();
normalizeValues(this.matrix, vals);
return clone$2(this, { values: vals }, true);
}
/**
* Rescale units to its largest representation
* @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }
* @return {Duration}
*/
rescale() {
if (!this.isValid)
return this;
const vals = removeZeroes(this.normalize().shiftToAll().toObject());
return clone$2(this, { values: vals }, true);
}
/**
* Convert this Duration into its representation in a different set of units.
* @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }
* @return {Duration}
*/
shiftTo(...units) {
if (!this.isValid)
return this;
if (units.length === 0) {
return this;
}
units = units.map((u2) => Duration.normalizeUnit(u2));
const built = {}, accumulated = {}, vals = this.toObject();
let lastUnit;
for (const k2 of orderedUnits$1) {
if (units.indexOf(k2) >= 0) {
lastUnit = k2;
let own = 0;
for (const ak2 in accumulated) {
own += this.matrix[ak2][k2] * accumulated[ak2];
accumulated[ak2] = 0;
}
if (isNumber$2(vals[k2])) {
own += vals[k2];
}
const i2 = Math.trunc(own);
built[k2] = i2;
accumulated[k2] = (own * 1e3 - i2 * 1e3) / 1e3;
} else if (isNumber$2(vals[k2])) {
accumulated[k2] = vals[k2];
}
}
for (const key2 in accumulated) {
if (accumulated[key2] !== 0) {
built[lastUnit] += key2 === lastUnit ? accumulated[key2] : accumulated[key2] / this.matrix[lastUnit][key2];
}
}
normalizeValues(this.matrix, built);
return clone$2(this, { values: built }, true);
}
/**
* Shift this Duration to all available units.
* Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds")
* @return {Duration}
*/
shiftToAll() {
if (!this.isValid)
return this;
return this.shiftTo(
"years",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds"
);
}
/**
* Return the negative of this Duration.
* @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }
* @return {Duration}
*/
negate() {
if (!this.isValid)
return this;
const negated = {};
for (const k2 of Object.keys(this.values)) {
negated[k2] = this.values[k2] === 0 ? 0 : -this.values[k2];
}
return clone$2(this, { values: negated }, true);
}
/**
* Get the years.
* @type {number}
*/
get years() {
return this.isValid ? this.values.years || 0 : NaN;
}
/**
* Get the quarters.
* @type {number}
*/
get quarters() {
return this.isValid ? this.values.quarters || 0 : NaN;
}
/**
* Get the months.
* @type {number}
*/
get months() {
return this.isValid ? this.values.months || 0 : NaN;
}
/**
* Get the weeks
* @type {number}
*/
get weeks() {
return this.isValid ? this.values.weeks || 0 : NaN;
}
/**
* Get the days.
* @type {number}
*/
get days() {
return this.isValid ? this.values.days || 0 : NaN;
}
/**
* Get the hours.
* @type {number}
*/
get hours() {
return this.isValid ? this.values.hours || 0 : NaN;
}
/**
* Get the minutes.
* @type {number}
*/
get minutes() {
return this.isValid ? this.values.minutes || 0 : NaN;
}
/**
* Get the seconds.
* @return {number}
*/
get seconds() {
return this.isValid ? this.values.seconds || 0 : NaN;
}
/**
* Get the milliseconds.
* @return {number}
*/
get milliseconds() {
return this.isValid ? this.values.milliseconds || 0 : NaN;
}
/**
* Returns whether the Duration is invalid. Invalid durations are returned by diff operations
* on invalid DateTimes or Intervals.
* @return {boolean}
*/
get isValid() {
return this.invalid === null;
}
/**
* Returns an error code if this Duration became invalid, or null if the Duration is valid
* @return {string}
*/
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
/**
* Returns an explanation of why this Duration became invalid, or null if the Duration is valid
* @type {string}
*/
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
/**
* Equality check
* Two Durations are equal iff they have the same units and the same values for each unit.
* @param {Duration} other
* @return {boolean}
*/
equals(other) {
if (!this.isValid || !other.isValid) {
return false;
}
if (!this.loc.equals(other.loc)) {
return false;
}
function eq2(v1, v2) {
if (v1 === void 0 || v1 === 0)
return v2 === void 0 || v2 === 0;
return v1 === v2;
}
for (const u2 of orderedUnits$1) {
if (!eq2(this.values[u2], other.values[u2])) {
return false;
}
}
return true;
}
}
const INVALID$1 = "Invalid Interval";
function validateStartEnd(start2, end2) {
if (!start2 || !start2.isValid) {
return Interval.invalid("missing or invalid start");
} else if (!end2 || !end2.isValid) {
return Interval.invalid("missing or invalid end");
} else if (end2 < start2) {
return Interval.invalid(
"end before start",
`The end of an interval must be after its start, but you had start=${start2.toISO()} and end=${end2.toISO()}`
);
} else {
return null;
}
}
class Interval {
/**
* @private
*/
constructor(config2) {
this.s = config2.start;
this.e = config2.end;
this.invalid = config2.invalid || null;
this.isLuxonInterval = true;
}
/**
* Create an invalid Interval.
* @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent
* @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information
* @return {Interval}
*/
static invalid(reason, explanation = null) {
if (!reason) {
throw new InvalidArgumentError("need to specify a reason the Interval is invalid");
}
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
if (Settings.throwOnInvalid) {
throw new InvalidIntervalError(invalid);
} else {
return new Interval({ invalid });
}
}
/**
* Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.
* @param {DateTime|Date|Object} start
* @param {DateTime|Date|Object} end
* @return {Interval}
*/
static fromDateTimes(start2, end2) {
const builtStart = friendlyDateTime(start2), builtEnd = friendlyDateTime(end2);
const validateError = validateStartEnd(builtStart, builtEnd);
if (validateError == null) {
return new Interval({
start: builtStart,
end: builtEnd
});
} else {
return validateError;
}
}
/**
* Create an Interval from a start DateTime and a Duration to extend to.
* @param {DateTime|Date|Object} start
* @param {Duration|Object|number} duration - the length of the Interval.
* @return {Interval}
*/
static after(start2, duration2) {
const dur = Duration.fromDurationLike(duration2), dt2 = friendlyDateTime(start2);
return Interval.fromDateTimes(dt2, dt2.plus(dur));
}
/**
* Create an Interval from an end DateTime and a Duration to extend backwards to.
* @param {DateTime|Date|Object} end
* @param {Duration|Object|number} duration - the length of the Interval.
* @return {Interval}
*/
static before(end2, duration2) {
const dur = Duration.fromDurationLike(duration2), dt2 = friendlyDateTime(end2);
return Interval.fromDateTimes(dt2.minus(dur), dt2);
}
/**
* Create an Interval from an ISO 8601 string.
* Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.
* @param {string} text - the ISO string to parse
* @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
* @return {Interval}
*/
static fromISO(text2, opts) {
const [s2, e7] = (text2 || "").split("/", 2);
if (s2 && e7) {
let start2, startIsValid;
try {
start2 = DateTime.fromISO(s2, opts);
startIsValid = start2.isValid;
} catch (e8) {
startIsValid = false;
}
let end2, endIsValid;
try {
end2 = DateTime.fromISO(e7, opts);
endIsValid = end2.isValid;
} catch (e8) {
endIsValid = false;
}
if (startIsValid && endIsValid) {
return Interval.fromDateTimes(start2, end2);
}
if (startIsValid) {
const dur = Duration.fromISO(e7, opts);
if (dur.isValid) {
return Interval.after(start2, dur);
}
} else if (endIsValid) {
const dur = Duration.fromISO(s2, opts);
if (dur.isValid) {
return Interval.before(end2, dur);
}
}
}
return Interval.invalid("unparsable", `the input "${text2}" can't be parsed as ISO 8601`);
}
/**
* Check if an object is an Interval. Works across context boundaries
* @param {object} o
* @return {boolean}
*/
static isInterval(o2) {
return o2 && o2.isLuxonInterval || false;
}
/**
* Returns the start of the Interval
* @type {DateTime}
*/
get start() {
return this.isValid ? this.s : null;
}
/**
* Returns the end of the Interval
* @type {DateTime}
*/
get end() {
return this.isValid ? this.e : null;
}
/**
* Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.
* @type {boolean}
*/
get isValid() {
return this.invalidReason === null;
}
/**
* Returns an error code if this Interval is invalid, or null if the Interval is valid
* @type {string}
*/
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
/**
* Returns an explanation of why this Interval became invalid, or null if the Interval is valid
* @type {string}
*/
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
/**
* Returns the length of the Interval in the specified unit.
* @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.
* @return {number}
*/
length(unit2 = "milliseconds") {
return this.isValid ? this.toDuration(...[unit2]).get(unit2) : NaN;
}
/**
* Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.
* Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'
* asks 'what dates are included in this interval?', not 'how many days long is this interval?'
* @param {string} [unit='milliseconds'] - the unit of time to count.
* @return {number}
*/
count(unit2 = "milliseconds") {
if (!this.isValid)
return NaN;
const start2 = this.start.startOf(unit2), end2 = this.end.startOf(unit2);
return Math.floor(end2.diff(start2, unit2).get(unit2)) + (end2.valueOf() !== this.end.valueOf());
}
/**
* Returns whether this Interval's start and end are both in the same unit of time
* @param {string} unit - the unit of time to check sameness on
* @return {boolean}
*/
hasSame(unit2) {
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit2) : false;
}
/**
* Return whether this Interval has the same start and end DateTimes.
* @return {boolean}
*/
isEmpty() {
return this.s.valueOf() === this.e.valueOf();
}
/**
* Return whether this Interval's start is after the specified DateTime.
* @param {DateTime} dateTime
* @return {boolean}
*/
isAfter(dateTime) {
if (!this.isValid)
return false;
return this.s > dateTime;
}
/**
* Return whether this Interval's end is before the specified DateTime.
* @param {DateTime} dateTime
* @return {boolean}
*/
isBefore(dateTime) {
if (!this.isValid)
return false;
return this.e <= dateTime;
}
/**
* Return whether this Interval contains the specified DateTime.
* @param {DateTime} dateTime
* @return {boolean}
*/
contains(dateTime) {
if (!this.isValid)
return false;
return this.s <= dateTime && this.e > dateTime;
}
/**
* "Sets" the start and/or end dates. Returns a newly-constructed Interval.
* @param {Object} values - the values to set
* @param {DateTime} values.start - the starting DateTime
* @param {DateTime} values.end - the ending DateTime
* @return {Interval}
*/
set({ start: start2, end: end2 } = {}) {
if (!this.isValid)
return this;
return Interval.fromDateTimes(start2 || this.s, end2 || this.e);
}
/**
* Split this Interval at each of the specified DateTimes
* @param {...DateTime} dateTimes - the unit of time to count.
* @return {Array}
*/
splitAt(...dateTimes) {
if (!this.isValid)
return [];
const sorted = dateTimes.map(friendlyDateTime).filter((d2) => this.contains(d2)).sort(), results = [];
let { s: s2 } = this, i2 = 0;
while (s2 < this.e) {
const added = sorted[i2] || this.e, next2 = +added > +this.e ? this.e : added;
results.push(Interval.fromDateTimes(s2, next2));
s2 = next2;
i2 += 1;
}
return results;
}
/**
* Split this Interval into smaller Intervals, each of the specified length.
* Left over time is grouped into a smaller interval
* @param {Duration|Object|number} duration - The length of each resulting interval.
* @return {Array}
*/
splitBy(duration2) {
const dur = Duration.fromDurationLike(duration2);
if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) {
return [];
}
let { s: s2 } = this, idx = 1, next2;
const results = [];
while (s2 < this.e) {
const added = this.start.plus(dur.mapUnits((x2) => x2 * idx));
next2 = +added > +this.e ? this.e : added;
results.push(Interval.fromDateTimes(s2, next2));
s2 = next2;
idx += 1;
}
return results;
}
/**
* Split this Interval into the specified number of smaller intervals.
* @param {number} numberOfParts - The number of Intervals to divide the Interval into.
* @return {Array}
*/
divideEqually(numberOfParts) {
if (!this.isValid)
return [];
return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);
}
/**
* Return whether this Interval overlaps with the specified Interval
* @param {Interval} other
* @return {boolean}
*/
overlaps(other) {
return this.e > other.s && this.s < other.e;
}
/**
* Return whether this Interval's end is adjacent to the specified Interval's start.
* @param {Interval} other
* @return {boolean}
*/
abutsStart(other) {
if (!this.isValid)
return false;
return +this.e === +other.s;
}
/**
* Return whether this Interval's start is adjacent to the specified Interval's end.
* @param {Interval} other
* @return {boolean}
*/
abutsEnd(other) {
if (!this.isValid)
return false;
return +other.e === +this.s;
}
/**
* Return whether this Interval engulfs the start and end of the specified Interval.
* @param {Interval} other
* @return {boolean}
*/
engulfs(other) {
if (!this.isValid)
return false;
return this.s <= other.s && this.e >= other.e;
}
/**
* Return whether this Interval has the same start and end as the specified Interval.
* @param {Interval} other
* @return {boolean}
*/
equals(other) {
if (!this.isValid || !other.isValid) {
return false;
}
return this.s.equals(other.s) && this.e.equals(other.e);
}
/**
* Return an Interval representing the intersection of this Interval and the specified Interval.
* Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.
* Returns null if the intersection is empty, meaning, the intervals don't intersect.
* @param {Interval} other
* @return {Interval}
*/
intersection(other) {
if (!this.isValid)
return this;
const s2 = this.s > other.s ? this.s : other.s, e7 = this.e < other.e ? this.e : other.e;
if (s2 >= e7) {
return null;
} else {
return Interval.fromDateTimes(s2, e7);
}
}
/**
* Return an Interval representing the union of this Interval and the specified Interval.
* Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.
* @param {Interval} other
* @return {Interval}
*/
union(other) {
if (!this.isValid)
return this;
const s2 = this.s < other.s ? this.s : other.s, e7 = this.e > other.e ? this.e : other.e;
return Interval.fromDateTimes(s2, e7);
}
/**
* Merge an array of Intervals into a equivalent minimal set of Intervals.
* Combines overlapping and adjacent Intervals.
* @param {Array} intervals
* @return {Array}
*/
static merge(intervals2) {
const [found, final] = intervals2.sort((a2, b2) => a2.s - b2.s).reduce(
([sofar, current], item) => {
if (!current) {
return [sofar, item];
} else if (current.overlaps(item) || current.abutsStart(item)) {
return [sofar, current.union(item)];
} else {
return [sofar.concat([current]), item];
}
},
[[], null]
);
if (final) {
found.push(final);
}
return found;
}
/**
* Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.
* @param {Array} intervals
* @return {Array}
*/
static xor(intervals2) {
let start2 = null, currentCount = 0;
const results = [], ends = intervals2.map((i2) => [
{ time: i2.s, type: "s" },
{ time: i2.e, type: "e" }
]), flattened = Array.prototype.concat(...ends), arr2 = flattened.sort((a2, b2) => a2.time - b2.time);
for (const i2 of arr2) {
currentCount += i2.type === "s" ? 1 : -1;
if (currentCount === 1) {
start2 = i2.time;
} else {
if (start2 && +start2 !== +i2.time) {
results.push(Interval.fromDateTimes(start2, i2.time));
}
start2 = null;
}
}
return Interval.merge(results);
}
/**
* Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.
* @param {...Interval} intervals
* @return {Array}
*/
difference(...intervals2) {
return Interval.xor([this].concat(intervals2)).map((i2) => this.intersection(i2)).filter((i2) => i2 && !i2.isEmpty());
}
/**
* Returns a string representation of this Interval appropriate for debugging.
* @return {string}
*/
toString() {
if (!this.isValid)
return INVALID$1;
return `[${this.s.toISO()} – ${this.e.toISO()})`;
}
/**
* Returns a localized string representing this Interval. Accepts the same options as the
* Intl.DateTimeFormat constructor and any presets defined by Luxon, such as
* {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method
* is browser-specific, but in general it will return an appropriate representation of the
* Interval in the assigned locale. Defaults to the system's locale if no locale has been
* specified.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
* @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or
* Intl.DateTimeFormat constructor options.
* @param {Object} opts - Options to override the configuration of the start DateTime.
* @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022
* @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022
* @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022
* @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM
* @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p
* @return {string}
*/
toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
return this.isValid ? Formatter$1.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1;
}
/**
* Returns an ISO 8601-compliant string representation of this Interval.
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
* @param {Object} opts - The same options as {@link DateTime#toISO}
* @return {string}
*/
toISO(opts) {
if (!this.isValid)
return INVALID$1;
return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;
}
/**
* Returns an ISO 8601-compliant string representation of date of this Interval.
* The time components are ignored.
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
* @return {string}
*/
toISODate() {
if (!this.isValid)
return INVALID$1;
return `${this.s.toISODate()}/${this.e.toISODate()}`;
}
/**
* Returns an ISO 8601-compliant string representation of time of this Interval.
* The date components are ignored.
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
* @param {Object} opts - The same options as {@link DateTime#toISO}
* @return {string}
*/
toISOTime(opts) {
if (!this.isValid)
return INVALID$1;
return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;
}
/**
* Returns a string representation of this Interval formatted according to the specified format
* string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible
* formatting tool.
* @param {string} dateFormat - The format string. This string formats the start and end time.
* See {@link DateTime#toFormat} for details.
* @param {Object} opts - Options.
* @param {string} [opts.separator = ' – '] - A separator to place between the start and end
* representations.
* @return {string}
*/
toFormat(dateFormat, { separator = " – " } = {}) {
if (!this.isValid)
return INVALID$1;
return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;
}
/**
* Return a Duration representing the time spanned by this interval.
* @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.
* @param {Object} opts - options that affect the creation of the Duration
* @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
* @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }
* @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }
* @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }
* @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }
* @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }
* @return {Duration}
*/
toDuration(unit2, opts) {
if (!this.isValid) {
return Duration.invalid(this.invalidReason);
}
return this.e.diff(this.s, unit2, opts);
}
/**
* Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes
* @param {function} mapFn
* @return {Interval}
* @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())
* @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))
*/
mapEndpoints(mapFn) {
return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));
}
}
let Info$1 = class Info {
/**
* Return whether the specified zone contains a DST.
* @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.
* @return {boolean}
*/
static hasDST(zone = Settings.defaultZone) {
const proto = DateTime.now().setZone(zone).set({ month: 12 });
return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;
}
/**
* Return whether the specified zone is a valid IANA specifier.
* @param {string} zone - Zone to check
* @return {boolean}
*/
static isValidIANAZone(zone) {
return IANAZone.isValidZone(zone);
}
/**
* Converts the input into a {@link Zone} instance.
*
* * If `input` is already a Zone instance, it is returned unchanged.
* * If `input` is a string containing a valid time zone name, a Zone instance
* with that name is returned.
* * If `input` is a string that doesn't refer to a known time zone, a Zone
* instance with {@link Zone#isValid} == false is returned.
* * If `input is a number, a Zone instance with the specified fixed offset
* in minutes is returned.
* * If `input` is `null` or `undefined`, the default zone is returned.
* @param {string|Zone|number} [input] - the value to be converted
* @return {Zone}
*/
static normalizeZone(input) {
return normalizeZone(input, Settings.defaultZone);
}
/**
* Return an array of standalone month names.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
* @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long"
* @param {Object} opts - options
* @param {string} [opts.locale] - the locale code
* @param {string} [opts.numberingSystem=null] - the numbering system
* @param {string} [opts.locObj=null] - an existing locale object to use
* @param {string} [opts.outputCalendar='gregory'] - the calendar
* @example Info.months()[0] //=> 'January'
* @example Info.months('short')[0] //=> 'Jan'
* @example Info.months('numeric')[0] //=> '1'
* @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'
* @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'
* @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'
* @return {Array}
*/
static months(length2 = "long", { locale: locale2 = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, outputCalendar)).months(length2);
}
/**
* Return an array of format month names.
* Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that
* changes the string.
* See {@link Info#months}
* @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long"
* @param {Object} opts - options
* @param {string} [opts.locale] - the locale code
* @param {string} [opts.numberingSystem=null] - the numbering system
* @param {string} [opts.locObj=null] - an existing locale object to use
* @param {string} [opts.outputCalendar='gregory'] - the calendar
* @return {Array}
*/
static monthsFormat(length2 = "long", { locale: locale2 = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, outputCalendar)).months(length2, true);
}
/**
* Return an array of standalone week names.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
* @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long".
* @param {Object} opts - options
* @param {string} [opts.locale] - the locale code
* @param {string} [opts.numberingSystem=null] - the numbering system
* @param {string} [opts.locObj=null] - an existing locale object to use
* @example Info.weekdays()[0] //=> 'Monday'
* @example Info.weekdays('short')[0] //=> 'Mon'
* @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'
* @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'
* @return {Array}
*/
static weekdays(length2 = "long", { locale: locale2 = null, numberingSystem = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, null)).weekdays(length2);
}
/**
* Return an array of format week names.
* Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that
* changes the string.
* See {@link Info#weekdays}
* @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long".
* @param {Object} opts - options
* @param {string} [opts.locale=null] - the locale code
* @param {string} [opts.numberingSystem=null] - the numbering system
* @param {string} [opts.locObj=null] - an existing locale object to use
* @return {Array}
*/
static weekdaysFormat(length2 = "long", { locale: locale2 = null, numberingSystem = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, null)).weekdays(length2, true);
}
/**
* Return an array of meridiems.
* @param {Object} opts - options
* @param {string} [opts.locale] - the locale code
* @example Info.meridiems() //=> [ 'AM', 'PM' ]
* @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]
* @return {Array}
*/
static meridiems({ locale: locale2 = null } = {}) {
return Locale.create(locale2).meridiems();
}
/**
* Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.
* @param {string} [length='short'] - the length of the era representation, such as "short" or "long".
* @param {Object} opts - options
* @param {string} [opts.locale] - the locale code
* @example Info.eras() //=> [ 'BC', 'AD' ]
* @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]
* @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]
* @return {Array}
*/
static eras(length2 = "short", { locale: locale2 = null } = {}) {
return Locale.create(locale2, null, "gregory").eras(length2);
}
/**
* Return the set of available features in this environment.
* Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.
* Keys:
* * `relative`: whether this environment supports relative time formatting
* @example Info.features() //=> { relative: false }
* @return {Object}
*/
static features() {
return { relative: hasRelative() };
}
};
function dayDiff(earlier, later) {
const utcDayStart = (dt2) => dt2.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier);
return Math.floor(Duration.fromMillis(ms).as("days"));
}
function highOrderDiffs(cursor2, later, units) {
const differs = [
["years", (a2, b2) => b2.year - a2.year],
["quarters", (a2, b2) => b2.quarter - a2.quarter + (b2.year - a2.year) * 4],
["months", (a2, b2) => b2.month - a2.month + (b2.year - a2.year) * 12],
[
"weeks",
(a2, b2) => {
const days = dayDiff(a2, b2);
return (days - days % 7) / 7;
}
],
["days", dayDiff]
];
const results = {};
const earlier = cursor2;
let lowestOrder, highWater;
for (const [unit2, differ] of differs) {
if (units.indexOf(unit2) >= 0) {
lowestOrder = unit2;
results[unit2] = differ(cursor2, later);
highWater = earlier.plus(results);
if (highWater > later) {
results[unit2]--;
cursor2 = earlier.plus(results);
if (cursor2 > later) {
highWater = cursor2;
results[unit2]--;
cursor2 = earlier.plus(results);
}
} else {
cursor2 = highWater;
}
}
}
return [cursor2, results, highWater, lowestOrder];
}
function diff(earlier, later, units, opts) {
let [cursor2, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);
const remainingMillis = later - cursor2;
const lowerOrderUnits = units.filter(
(u2) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u2) >= 0
);
if (lowerOrderUnits.length === 0) {
if (highWater < later) {
highWater = cursor2.plus({ [lowestOrder]: 1 });
}
if (highWater !== cursor2) {
results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor2);
}
}
const duration2 = Duration.fromObject(results, opts);
if (lowerOrderUnits.length > 0) {
return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration2);
} else {
return duration2;
}
}
const numberingSystems = {
arab: "[٠-٩]",
arabext: "[۰-۹]",
bali: "[᭐-᭙]",
beng: "[০-৯]",
deva: "[०-९]",
fullwide: "[0-9]",
gujr: "[૦-૯]",
hanidec: "[〇|一|二|三|四|五|六|七|八|九]",
khmr: "[០-៩]",
knda: "[೦-೯]",
laoo: "[໐-໙]",
limb: "[᥆-᥏]",
mlym: "[൦-൯]",
mong: "[᠐-᠙]",
mymr: "[၀-၉]",
orya: "[୦-୯]",
tamldec: "[௦-௯]",
telu: "[౦-౯]",
thai: "[๐-๙]",
tibt: "[༠-༩]",
latn: "\\d"
};
const numberingSystemsUTF16 = {
arab: [1632, 1641],
arabext: [1776, 1785],
bali: [6992, 7001],
beng: [2534, 2543],
deva: [2406, 2415],
fullwide: [65296, 65303],
gujr: [2790, 2799],
khmr: [6112, 6121],
knda: [3302, 3311],
laoo: [3792, 3801],
limb: [6470, 6479],
mlym: [3430, 3439],
mong: [6160, 6169],
mymr: [4160, 4169],
orya: [2918, 2927],
tamldec: [3046, 3055],
telu: [3174, 3183],
thai: [3664, 3673],
tibt: [3872, 3881]
};
const hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
function parseDigits(str) {
let value2 = parseInt(str, 10);
if (isNaN(value2)) {
value2 = "";
for (let i2 = 0; i2 < str.length; i2++) {
const code = str.charCodeAt(i2);
if (str[i2].search(numberingSystems.hanidec) !== -1) {
value2 += hanidecChars.indexOf(str[i2]);
} else {
for (const key2 in numberingSystemsUTF16) {
const [min2, max2] = numberingSystemsUTF16[key2];
if (code >= min2 && code <= max2) {
value2 += code - min2;
}
}
}
}
return parseInt(value2, 10);
} else {
return value2;
}
}
function digitRegex({ numberingSystem }, append2 = "") {
return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append2}`);
}
const MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support";
function intUnit(regex, post = (i2) => i2) {
return { regex, deser: ([s2]) => post(parseDigits(s2)) };
}
const NBSP = String.fromCharCode(160);
const spaceOrNBSP = `[ ${NBSP}]`;
const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
function fixListRegex(s2) {
return s2.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
}
function stripInsensitivities(s2) {
return s2.replace(/\./g, "").replace(spaceOrNBSPRegExp, " ").toLowerCase();
}
function oneOf(strings, startIndex) {
if (strings === null) {
return null;
} else {
return {
regex: RegExp(strings.map(fixListRegex).join("|")),
deser: ([s2]) => strings.findIndex((i2) => stripInsensitivities(s2) === stripInsensitivities(i2)) + startIndex
};
}
}
function offset$4(regex, groups) {
return { regex, deser: ([, h2, m2]) => signedOffset(h2, m2), groups };
}
function simple(regex) {
return { regex, deser: ([s2]) => s2 };
}
function escapeToken(value2) {
return value2.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
}
function unitForToken(token2, loc) {
const one2 = digitRegex(loc), two = digitRegex(loc, "{2}"), three = digitRegex(loc, "{3}"), four = digitRegex(loc, "{4}"), six = digitRegex(loc, "{6}"), oneOrTwo = digitRegex(loc, "{1,2}"), oneToThree = digitRegex(loc, "{1,3}"), oneToSix = digitRegex(loc, "{1,6}"), oneToNine = digitRegex(loc, "{1,9}"), twoToFour = digitRegex(loc, "{2,4}"), fourToSix = digitRegex(loc, "{4,6}"), literal = (t5) => ({ regex: RegExp(escapeToken(t5.val)), deser: ([s2]) => s2, literal: true }), unitate = (t5) => {
if (token2.literal) {
return literal(t5);
}
switch (t5.val) {
case "G":
return oneOf(loc.eras("short"), 0);
case "GG":
return oneOf(loc.eras("long"), 0);
case "y":
return intUnit(oneToSix);
case "yy":
return intUnit(twoToFour, untruncateYear);
case "yyyy":
return intUnit(four);
case "yyyyy":
return intUnit(fourToSix);
case "yyyyyy":
return intUnit(six);
case "M":
return intUnit(oneOrTwo);
case "MM":
return intUnit(two);
case "MMM":
return oneOf(loc.months("short", true), 1);
case "MMMM":
return oneOf(loc.months("long", true), 1);
case "L":
return intUnit(oneOrTwo);
case "LL":
return intUnit(two);
case "LLL":
return oneOf(loc.months("short", false), 1);
case "LLLL":
return oneOf(loc.months("long", false), 1);
case "d":
return intUnit(oneOrTwo);
case "dd":
return intUnit(two);
case "o":
return intUnit(oneToThree);
case "ooo":
return intUnit(three);
case "HH":
return intUnit(two);
case "H":
return intUnit(oneOrTwo);
case "hh":
return intUnit(two);
case "h":
return intUnit(oneOrTwo);
case "mm":
return intUnit(two);
case "m":
return intUnit(oneOrTwo);
case "q":
return intUnit(oneOrTwo);
case "qq":
return intUnit(two);
case "s":
return intUnit(oneOrTwo);
case "ss":
return intUnit(two);
case "S":
return intUnit(oneToThree);
case "SSS":
return intUnit(three);
case "u":
return simple(oneToNine);
case "uu":
return simple(oneOrTwo);
case "uuu":
return intUnit(one2);
case "a":
return oneOf(loc.meridiems(), 0);
case "kkkk":
return intUnit(four);
case "kk":
return intUnit(twoToFour, untruncateYear);
case "W":
return intUnit(oneOrTwo);
case "WW":
return intUnit(two);
case "E":
case "c":
return intUnit(one2);
case "EEE":
return oneOf(loc.weekdays("short", false), 1);
case "EEEE":
return oneOf(loc.weekdays("long", false), 1);
case "ccc":
return oneOf(loc.weekdays("short", true), 1);
case "cccc":
return oneOf(loc.weekdays("long", true), 1);
case "Z":
case "ZZ":
return offset$4(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);
case "ZZZ":
return offset$4(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);
case "z":
return simple(/[a-z_+-/]{1,256}?/i);
case " ":
return simple(/[^\S\n\r]/);
default:
return literal(t5);
}
};
const unit2 = unitate(token2) || {
invalidReason: MISSING_FTP
};
unit2.token = token2;
return unit2;
}
const partTypeStyleToTokenVal = {
year: {
"2-digit": "yy",
numeric: "yyyyy"
},
month: {
numeric: "M",
"2-digit": "MM",
short: "MMM",
long: "MMMM"
},
day: {
numeric: "d",
"2-digit": "dd"
},
weekday: {
short: "EEE",
long: "EEEE"
},
dayperiod: "a",
dayPeriod: "a",
hour12: {
numeric: "h",
"2-digit": "hh"
},
hour24: {
numeric: "H",
"2-digit": "HH"
},
minute: {
numeric: "m",
"2-digit": "mm"
},
second: {
numeric: "s",
"2-digit": "ss"
},
timeZoneName: {
long: "ZZZZZ",
short: "ZZZ"
}
};
function tokenForPart(part, formatOpts, resolvedOpts) {
const { type: type2, value: value2 } = part;
if (type2 === "literal") {
const isSpace = /^\s+$/.test(value2);
return {
literal: !isSpace,
val: isSpace ? " " : value2
};
}
const style2 = formatOpts[type2];
let actualType = type2;
if (type2 === "hour") {
if (formatOpts.hour12 != null) {
actualType = formatOpts.hour12 ? "hour12" : "hour24";
} else if (formatOpts.hourCycle != null) {
if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") {
actualType = "hour12";
} else {
actualType = "hour24";
}
} else {
actualType = resolvedOpts.hour12 ? "hour12" : "hour24";
}
}
let val = partTypeStyleToTokenVal[actualType];
if (typeof val === "object") {
val = val[style2];
}
if (val) {
return {
literal: false,
val
};
}
return void 0;
}
function buildRegex(units) {
const re2 = units.map((u2) => u2.regex).reduce((f2, r2) => `${f2}(${r2.source})`, "");
return [`^${re2}$`, units];
}
function match$2(input, regex, handlers) {
const matches = input.match(regex);
if (matches) {
const all3 = {};
let matchIndex = 1;
for (const i2 in handlers) {
if (hasOwnProperty$4(handlers, i2)) {
const h2 = handlers[i2], groups = h2.groups ? h2.groups + 1 : 1;
if (!h2.literal && h2.token) {
all3[h2.token.val[0]] = h2.deser(matches.slice(matchIndex, matchIndex + groups));
}
matchIndex += groups;
}
}
return [matches, all3];
} else {
return [matches, {}];
}
}
function dateTimeFromMatches(matches) {
const toField = (token2) => {
switch (token2) {
case "S":
return "millisecond";
case "s":
return "second";
case "m":
return "minute";
case "h":
case "H":
return "hour";
case "d":
return "day";
case "o":
return "ordinal";
case "L":
case "M":
return "month";
case "y":
return "year";
case "E":
case "c":
return "weekday";
case "W":
return "weekNumber";
case "k":
return "weekYear";
case "q":
return "quarter";
default:
return null;
}
};
let zone = null;
let specificOffset;
if (!isUndefined(matches.z)) {
zone = IANAZone.create(matches.z);
}
if (!isUndefined(matches.Z)) {
if (!zone) {
zone = new FixedOffsetZone(matches.Z);
}
specificOffset = matches.Z;
}
if (!isUndefined(matches.q)) {
matches.M = (matches.q - 1) * 3 + 1;
}
if (!isUndefined(matches.h)) {
if (matches.h < 12 && matches.a === 1) {
matches.h += 12;
} else if (matches.h === 12 && matches.a === 0) {
matches.h = 0;
}
}
if (matches.G === 0 && matches.y) {
matches.y = -matches.y;
}
if (!isUndefined(matches.u)) {
matches.S = parseMillis(matches.u);
}
const vals = Object.keys(matches).reduce((r2, k2) => {
const f2 = toField(k2);
if (f2) {
r2[f2] = matches[k2];
}
return r2;
}, {});
return [vals, zone, specificOffset];
}
let dummyDateTimeCache = null;
function getDummyDateTime() {
if (!dummyDateTimeCache) {
dummyDateTimeCache = DateTime.fromMillis(1555555555555);
}
return dummyDateTimeCache;
}
function maybeExpandMacroToken(token2, locale2) {
if (token2.literal) {
return token2;
}
const formatOpts = Formatter$1.macroTokenToFormatOpts(token2.val);
const tokens = formatOptsToTokens(formatOpts, locale2);
if (tokens == null || tokens.includes(void 0)) {
return token2;
}
return tokens;
}
function expandMacroTokens(tokens, locale2) {
return Array.prototype.concat(...tokens.map((t5) => maybeExpandMacroToken(t5, locale2)));
}
function explainFromTokens(locale2, input, format2) {
const tokens = expandMacroTokens(Formatter$1.parseFormat(format2), locale2), units = tokens.map((t5) => unitForToken(t5, locale2)), disqualifyingUnit = units.find((t5) => t5.invalidReason);
if (disqualifyingUnit) {
return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };
} else {
const [regexString, handlers] = buildRegex(units), regex = RegExp(regexString, "i"), [rawMatches, matches] = match$2(input, regex, handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, void 0];
if (hasOwnProperty$4(matches, "a") && hasOwnProperty$4(matches, "H")) {
throw new ConflictingSpecificationError(
"Can't include meridiem when specifying 24-hour format"
);
}
return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };
}
}
function parseFromTokens(locale2, input, format2) {
const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale2, input, format2);
return [result, zone, specificOffset, invalidReason];
}
function formatOptsToTokens(formatOpts, locale2) {
if (!formatOpts) {
return null;
}
const formatter = Formatter$1.create(locale2, formatOpts);
const df2 = formatter.dtFormatter(getDummyDateTime());
const parts2 = df2.formatToParts();
const resolvedOpts = df2.resolvedOptions();
return parts2.map((p2) => tokenForPart(p2, formatOpts, resolvedOpts));
}
const nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
function unitOutOfRange(unit2, value2) {
return new Invalid(
"unit out of range",
`you specified ${value2} (of type ${typeof value2}) as a ${unit2}, which is invalid`
);
}
function dayOfWeek(year2, month2, day2) {
const d2 = new Date(Date.UTC(year2, month2 - 1, day2));
if (year2 < 100 && year2 >= 0) {
d2.setUTCFullYear(d2.getUTCFullYear() - 1900);
}
const js = d2.getUTCDay();
return js === 0 ? 7 : js;
}
function computeOrdinal(year2, month2, day2) {
return day2 + (isLeapYear(year2) ? leapLadder : nonLeapLadder)[month2 - 1];
}
function uncomputeOrdinal(year2, ordinal2) {
const table = isLeapYear(year2) ? leapLadder : nonLeapLadder, month0 = table.findIndex((i2) => i2 < ordinal2), day2 = ordinal2 - table[month0];
return { month: month0 + 1, day: day2 };
}
function gregorianToWeek(gregObj) {
const { year: year2, month: month2, day: day2 } = gregObj, ordinal2 = computeOrdinal(year2, month2, day2), weekday2 = dayOfWeek(year2, month2, day2);
let weekNumber = Math.floor((ordinal2 - weekday2 + 10) / 7), weekYear;
if (weekNumber < 1) {
weekYear = year2 - 1;
weekNumber = weeksInWeekYear(weekYear);
} else if (weekNumber > weeksInWeekYear(year2)) {
weekYear = year2 + 1;
weekNumber = 1;
} else {
weekYear = year2;
}
return { weekYear, weekNumber, weekday: weekday2, ...timeObject(gregObj) };
}
function weekToGregorian(weekData) {
const { weekYear, weekNumber, weekday: weekday2 } = weekData, weekdayOfJan4 = dayOfWeek(weekYear, 1, 4), yearInDays = daysInYear(weekYear);
let ordinal2 = weekNumber * 7 + weekday2 - weekdayOfJan4 - 3, year2;
if (ordinal2 < 1) {
year2 = weekYear - 1;
ordinal2 += daysInYear(year2);
} else if (ordinal2 > yearInDays) {
year2 = weekYear + 1;
ordinal2 -= daysInYear(weekYear);
} else {
year2 = weekYear;
}
const { month: month2, day: day2 } = uncomputeOrdinal(year2, ordinal2);
return { year: year2, month: month2, day: day2, ...timeObject(weekData) };
}
function gregorianToOrdinal(gregData) {
const { year: year2, month: month2, day: day2 } = gregData;
const ordinal2 = computeOrdinal(year2, month2, day2);
return { year: year2, ordinal: ordinal2, ...timeObject(gregData) };
}
function ordinalToGregorian(ordinalData) {
const { year: year2, ordinal: ordinal2 } = ordinalData;
const { month: month2, day: day2 } = uncomputeOrdinal(year2, ordinal2);
return { year: year2, month: month2, day: day2, ...timeObject(ordinalData) };
}
function hasInvalidWeekData(obj) {
const validYear = isInteger$1(obj.weekYear), validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)), validWeekday = integerBetween(obj.weekday, 1, 7);
if (!validYear) {
return unitOutOfRange("weekYear", obj.weekYear);
} else if (!validWeek) {
return unitOutOfRange("week", obj.week);
} else if (!validWeekday) {
return unitOutOfRange("weekday", obj.weekday);
} else
return false;
}
function hasInvalidOrdinalData(obj) {
const validYear = isInteger$1(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));
if (!validYear) {
return unitOutOfRange("year", obj.year);
} else if (!validOrdinal) {
return unitOutOfRange("ordinal", obj.ordinal);
} else
return false;
}
function hasInvalidGregorianData(obj) {
const validYear = isInteger$1(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));
if (!validYear) {
return unitOutOfRange("year", obj.year);
} else if (!validMonth) {
return unitOutOfRange("month", obj.month);
} else if (!validDay) {
return unitOutOfRange("day", obj.day);
} else
return false;
}
function hasInvalidTimeData(obj) {
const { hour: hour2, minute: minute2, second: second2, millisecond: millisecond2 } = obj;
const validHour = integerBetween(hour2, 0, 23) || hour2 === 24 && minute2 === 0 && second2 === 0 && millisecond2 === 0, validMinute = integerBetween(minute2, 0, 59), validSecond = integerBetween(second2, 0, 59), validMillisecond = integerBetween(millisecond2, 0, 999);
if (!validHour) {
return unitOutOfRange("hour", hour2);
} else if (!validMinute) {
return unitOutOfRange("minute", minute2);
} else if (!validSecond) {
return unitOutOfRange("second", second2);
} else if (!validMillisecond) {
return unitOutOfRange("millisecond", millisecond2);
} else
return false;
}
const INVALID = "Invalid DateTime";
const MAX_DATE = 864e13;
function unsupportedZone(zone) {
return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`);
}
function possiblyCachedWeekData(dt2) {
if (dt2.weekData === null) {
dt2.weekData = gregorianToWeek(dt2.c);
}
return dt2.weekData;
}
function clone$1(inst, alts) {
const current = {
ts: inst.ts,
zone: inst.zone,
c: inst.c,
o: inst.o,
loc: inst.loc,
invalid: inst.invalid
};
return new DateTime({ ...current, ...alts, old: current });
}
function fixOffset(localTS, o2, tz) {
let utcGuess = localTS - o2 * 60 * 1e3;
const o22 = tz.offset(utcGuess);
if (o2 === o22) {
return [utcGuess, o2];
}
utcGuess -= (o22 - o2) * 60 * 1e3;
const o3 = tz.offset(utcGuess);
if (o22 === o3) {
return [utcGuess, o22];
}
return [localTS - Math.min(o22, o3) * 60 * 1e3, Math.max(o22, o3)];
}
function tsToObj(ts2, offset2) {
ts2 += offset2 * 60 * 1e3;
const d2 = new Date(ts2);
return {
year: d2.getUTCFullYear(),
month: d2.getUTCMonth() + 1,
day: d2.getUTCDate(),
hour: d2.getUTCHours(),
minute: d2.getUTCMinutes(),
second: d2.getUTCSeconds(),
millisecond: d2.getUTCMilliseconds()
};
}
function objToTS(obj, offset2, zone) {
return fixOffset(objToLocalTS(obj), offset2, zone);
}
function adjustTime(inst, dur) {
const oPre = inst.o, year2 = inst.c.year + Math.trunc(dur.years), month2 = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c2 = {
...inst.c,
year: year2,
month: month2,
day: Math.min(inst.c.day, daysInMonth(year2, month2)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
}, millisToAdd = Duration.fromObject({
years: dur.years - Math.trunc(dur.years),
quarters: dur.quarters - Math.trunc(dur.quarters),
months: dur.months - Math.trunc(dur.months),
weeks: dur.weeks - Math.trunc(dur.weeks),
days: dur.days - Math.trunc(dur.days),
hours: dur.hours,
minutes: dur.minutes,
seconds: dur.seconds,
milliseconds: dur.milliseconds
}).as("milliseconds"), localTS = objToLocalTS(c2);
let [ts2, o2] = fixOffset(localTS, oPre, inst.zone);
if (millisToAdd !== 0) {
ts2 += millisToAdd;
o2 = inst.zone.offset(ts2);
}
return { ts: ts2, o: o2 };
}
function parseDataToDateTime(parsed, parsedZone, opts, format2, text2, specificOffset) {
const { setZone, zone } = opts;
if (parsed && Object.keys(parsed).length !== 0 || parsedZone) {
const interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, {
...opts,
zone: interpretationZone,
specificOffset
});
return setZone ? inst : inst.setZone(zone);
} else {
return DateTime.invalid(
new Invalid("unparsable", `the input "${text2}" can't be parsed as ${format2}`)
);
}
}
function toTechFormat(dt2, format2, allowZ = true) {
return dt2.isValid ? Formatter$1.create(Locale.create("en-US"), {
allowZ,
forceSimple: true
}).formatDateTimeFromString(dt2, format2) : null;
}
function toISODate(o2, extended) {
const longFormat = o2.c.year > 9999 || o2.c.year < 0;
let c2 = "";
if (longFormat && o2.c.year >= 0)
c2 += "+";
c2 += padStart(o2.c.year, longFormat ? 6 : 4);
if (extended) {
c2 += "-";
c2 += padStart(o2.c.month);
c2 += "-";
c2 += padStart(o2.c.day);
} else {
c2 += padStart(o2.c.month);
c2 += padStart(o2.c.day);
}
return c2;
}
function toISOTime(o2, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) {
let c2 = padStart(o2.c.hour);
if (extended) {
c2 += ":";
c2 += padStart(o2.c.minute);
if (o2.c.millisecond !== 0 || o2.c.second !== 0 || !suppressSeconds) {
c2 += ":";
}
} else {
c2 += padStart(o2.c.minute);
}
if (o2.c.millisecond !== 0 || o2.c.second !== 0 || !suppressSeconds) {
c2 += padStart(o2.c.second);
if (o2.c.millisecond !== 0 || !suppressMilliseconds) {
c2 += ".";
c2 += padStart(o2.c.millisecond, 3);
}
}
if (includeOffset) {
if (o2.isOffsetFixed && o2.offset === 0 && !extendedZone) {
c2 += "Z";
} else if (o2.o < 0) {
c2 += "-";
c2 += padStart(Math.trunc(-o2.o / 60));
c2 += ":";
c2 += padStart(Math.trunc(-o2.o % 60));
} else {
c2 += "+";
c2 += padStart(Math.trunc(o2.o / 60));
c2 += ":";
c2 += padStart(Math.trunc(o2.o % 60));
}
}
if (extendedZone) {
c2 += "[" + o2.zone.ianaName + "]";
}
return c2;
}
const defaultUnitValues = {
month: 1,
day: 1,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
}, defaultWeekUnitValues = {
weekNumber: 1,
weekday: 1,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
}, defaultOrdinalUnitValues = {
ordinal: 1,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
};
const orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], orderedWeekUnits = [
"weekYear",
"weekNumber",
"weekday",
"hour",
"minute",
"second",
"millisecond"
], orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
function normalizeUnit(unit2) {
const normalized = {
year: "year",
years: "year",
month: "month",
months: "month",
day: "day",
days: "day",
hour: "hour",
hours: "hour",
minute: "minute",
minutes: "minute",
quarter: "quarter",
quarters: "quarter",
second: "second",
seconds: "second",
millisecond: "millisecond",
milliseconds: "millisecond",
weekday: "weekday",
weekdays: "weekday",
weeknumber: "weekNumber",
weeksnumber: "weekNumber",
weeknumbers: "weekNumber",
weekyear: "weekYear",
weekyears: "weekYear",
ordinal: "ordinal"
}[unit2.toLowerCase()];
if (!normalized)
throw new InvalidUnitError(unit2);
return normalized;
}
function quickDT(obj, opts) {
const zone = normalizeZone(opts.zone, Settings.defaultZone), loc = Locale.fromObject(opts), tsNow = Settings.now();
let ts2, o2;
if (!isUndefined(obj.year)) {
for (const u2 of orderedUnits) {
if (isUndefined(obj[u2])) {
obj[u2] = defaultUnitValues[u2];
}
}
const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);
if (invalid) {
return DateTime.invalid(invalid);
}
const offsetProvis = zone.offset(tsNow);
[ts2, o2] = objToTS(obj, offsetProvis, zone);
} else {
ts2 = tsNow;
}
return new DateTime({ ts: ts2, zone, loc, o: o2 });
}
function diffRelative(start2, end2, opts) {
const round2 = isUndefined(opts.round) ? true : opts.round, format2 = (c2, unit2) => {
c2 = roundTo(c2, round2 || opts.calendary ? 0 : 2, true);
const formatter = end2.loc.clone(opts).relFormatter(opts);
return formatter.format(c2, unit2);
}, differ = (unit2) => {
if (opts.calendary) {
if (!end2.hasSame(start2, unit2)) {
return end2.startOf(unit2).diff(start2.startOf(unit2), unit2).get(unit2);
} else
return 0;
} else {
return end2.diff(start2, unit2).get(unit2);
}
};
if (opts.unit) {
return format2(differ(opts.unit), opts.unit);
}
for (const unit2 of opts.units) {
const count2 = differ(unit2);
if (Math.abs(count2) >= 1) {
return format2(count2, unit2);
}
}
return format2(start2 > end2 ? -0 : 0, opts.units[opts.units.length - 1]);
}
function lastOpts(argList) {
let opts = {}, args;
if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
opts = argList[argList.length - 1];
args = Array.from(argList).slice(0, argList.length - 1);
} else {
args = Array.from(argList);
}
return [opts, args];
}
class DateTime {
/**
* @access private
*/
constructor(config2) {
const zone = config2.zone || Settings.defaultZone;
let invalid = config2.invalid || (Number.isNaN(config2.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null);
this.ts = isUndefined(config2.ts) ? Settings.now() : config2.ts;
let c2 = null, o2 = null;
if (!invalid) {
const unchanged = config2.old && config2.old.ts === this.ts && config2.old.zone.equals(zone);
if (unchanged) {
[c2, o2] = [config2.old.c, config2.old.o];
} else {
const ot2 = zone.offset(this.ts);
c2 = tsToObj(this.ts, ot2);
invalid = Number.isNaN(c2.year) ? new Invalid("invalid input") : null;
c2 = invalid ? null : c2;
o2 = invalid ? null : ot2;
}
}
this._zone = zone;
this.loc = config2.loc || Locale.create();
this.invalid = invalid;
this.weekData = null;
this.c = c2;
this.o = o2;
this.isLuxonDateTime = true;
}
// CONSTRUCT
/**
* Create a DateTime for the current instant, in the system's time zone.
*
* Use Settings to override these default values if needed.
* @example DateTime.now().toISO() //~> now in the ISO format
* @return {DateTime}
*/
static now() {
return new DateTime({});
}
/**
* Create a local DateTime
* @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used
* @param {number} [month=1] - The month, 1-indexed
* @param {number} [day=1] - The day of the month, 1-indexed
* @param {number} [hour=0] - The hour of the day, in 24-hour time
* @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59
* @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59
* @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999
* @example DateTime.local() //~> now
* @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time
* @example DateTime.local(2017) //~> 2017-01-01T00:00:00
* @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00
* @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale
* @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00
* @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC
* @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00
* @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10
* @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765
* @return {DateTime}
*/
static local() {
const [opts, args] = lastOpts(arguments), [year2, month2, day2, hour2, minute2, second2, millisecond2] = args;
return quickDT({ year: year2, month: month2, day: day2, hour: hour2, minute: minute2, second: second2, millisecond: millisecond2 }, opts);
}
/**
* Create a DateTime in UTC
* @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used
* @param {number} [month=1] - The month, 1-indexed
* @param {number} [day=1] - The day of the month
* @param {number} [hour=0] - The hour of the day, in 24-hour time
* @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59
* @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59
* @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999
* @param {Object} options - configuration options for the DateTime
* @param {string} [options.locale] - a locale to set on the resulting DateTime instance
* @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance
* @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance
* @example DateTime.utc() //~> now
* @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z
* @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z
* @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z
* @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z
* @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z
* @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale
* @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z
* @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale
* @return {DateTime}
*/
static utc() {
const [opts, args] = lastOpts(arguments), [year2, month2, day2, hour2, minute2, second2, millisecond2] = args;
opts.zone = FixedOffsetZone.utcInstance;
return quickDT({ year: year2, month: month2, day: day2, hour: hour2, minute: minute2, second: second2, millisecond: millisecond2 }, opts);
}
/**
* Create a DateTime from a JavaScript Date object. Uses the default zone.
* @param {Date} date - a JavaScript Date object
* @param {Object} options - configuration options for the DateTime
* @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into
* @return {DateTime}
*/
static fromJSDate(date2, options2 = {}) {
const ts2 = isDate$2(date2) ? date2.valueOf() : NaN;
if (Number.isNaN(ts2)) {
return DateTime.invalid("invalid input");
}
const zoneToUse = normalizeZone(options2.zone, Settings.defaultZone);
if (!zoneToUse.isValid) {
return DateTime.invalid(unsupportedZone(zoneToUse));
}
return new DateTime({
ts: ts2,
zone: zoneToUse,
loc: Locale.fromObject(options2)
});
}
/**
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
* @param {number} milliseconds - a number of milliseconds since 1970 UTC
* @param {Object} options - configuration options for the DateTime
* @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into
* @param {string} [options.locale] - a locale to set on the resulting DateTime instance
* @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance
* @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance
* @return {DateTime}
*/
static fromMillis(milliseconds, options2 = {}) {
if (!isNumber$2(milliseconds)) {
throw new InvalidArgumentError(
`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`
);
} else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
return DateTime.invalid("Timestamp out of range");
} else {
return new DateTime({
ts: milliseconds,
zone: normalizeZone(options2.zone, Settings.defaultZone),
loc: Locale.fromObject(options2)
});
}
}
/**
* Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
* @param {number} seconds - a number of seconds since 1970 UTC
* @param {Object} options - configuration options for the DateTime
* @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into
* @param {string} [options.locale] - a locale to set on the resulting DateTime instance
* @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance
* @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance
* @return {DateTime}
*/
static fromSeconds(seconds, options2 = {}) {
if (!isNumber$2(seconds)) {
throw new InvalidArgumentError("fromSeconds requires a numerical input");
} else {
return new DateTime({
ts: seconds * 1e3,
zone: normalizeZone(options2.zone, Settings.defaultZone),
loc: Locale.fromObject(options2)
});
}
}
/**
* Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
* @param {Object} obj - the object to create the DateTime from
* @param {number} obj.year - a year, such as 1987
* @param {number} obj.month - a month, 1-12
* @param {number} obj.day - a day of the month, 1-31, depending on the month
* @param {number} obj.ordinal - day of the year, 1-365 or 366
* @param {number} obj.weekYear - an ISO week year
* @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year
* @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday
* @param {number} obj.hour - hour of the day, 0-23
* @param {number} obj.minute - minute of the hour, 0-59
* @param {number} obj.second - second of the minute, 0-59
* @param {number} obj.millisecond - millisecond of the second, 0-999
* @param {Object} opts - options for creating this DateTime
* @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()
* @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
* @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance
* @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'
* @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'
* @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06
* @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),
* @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })
* @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })
* @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'
* @return {DateTime}
*/
static fromObject(obj, opts = {}) {
obj = obj || {};
const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);
if (!zoneToUse.isValid) {
return DateTime.invalid(unsupportedZone(zoneToUse));
}
const tsNow = Settings.now(), offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), normalized = normalizeObject(obj, normalizeUnit), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber, loc = Locale.fromObject(opts);
if ((containsGregor || containsOrdinal) && definiteWeekDef) {
throw new ConflictingSpecificationError(
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
);
}
if (containsGregorMD && containsOrdinal) {
throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
}
const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor;
let units, defaultValues, objNow = tsToObj(tsNow, offsetProvis);
if (useWeekData) {
units = orderedWeekUnits;
defaultValues = defaultWeekUnitValues;
objNow = gregorianToWeek(objNow);
} else if (containsOrdinal) {
units = orderedOrdinalUnits;
defaultValues = defaultOrdinalUnitValues;
objNow = gregorianToOrdinal(objNow);
} else {
units = orderedUnits;
defaultValues = defaultUnitValues;
}
let foundFirst = false;
for (const u2 of units) {
const v2 = normalized[u2];
if (!isUndefined(v2)) {
foundFirst = true;
} else if (foundFirst) {
normalized[u2] = defaultValues[u2];
} else {
normalized[u2] = objNow[u2];
}
}
const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), invalid = higherOrderInvalid || hasInvalidTimeData(normalized);
if (invalid) {
return DateTime.invalid(invalid);
}
const gregorian = useWeekData ? weekToGregorian(normalized) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), inst = new DateTime({
ts: tsFinal,
zone: zoneToUse,
o: offsetFinal,
loc
});
if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {
return DateTime.invalid(
"mismatched weekday",
`you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`
);
}
return inst;
}
/**
* Create a DateTime from an ISO 8601 string
* @param {string} text - the ISO string
* @param {Object} opts - options to affect the creation
* @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone
* @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one
* @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance
* @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance
* @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance
* @example DateTime.fromISO('2016-05-25T09:08:34.123')
* @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')
* @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})
* @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})
* @example DateTime.fromISO('2016-W05-4')
* @return {DateTime}
*/
static fromISO(text2, opts = {}) {
const [vals, parsedZone] = parseISODate(text2);
return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text2);
}
/**
* Create a DateTime from an RFC 2822 string
* @param {string} text - the RFC 2822 string
* @param {Object} opts - options to affect the creation
* @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.
* @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one
* @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
* @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance
* @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')
* @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')
* @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')
* @return {DateTime}
*/
static fromRFC2822(text2, opts = {}) {
const [vals, parsedZone] = parseRFC2822Date(text2);
return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text2);
}
/**
* Create a DateTime from an HTTP header date
* @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
* @param {string} text - the HTTP header date
* @param {Object} opts - options to affect the creation
* @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.
* @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.
* @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
* @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance
* @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')
* @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')
* @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')
* @return {DateTime}
*/
static fromHTTP(text2, opts = {}) {
const [vals, parsedZone] = parseHTTPDate(text2);
return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts);
}
/**
* Create a DateTime from an input string and format string.
* Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).
* @param {string} text - the string to parse
* @param {string} fmt - the format the string is expected to be in (see the link below for the formats)
* @param {Object} opts - options to affect the creation
* @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone
* @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one
* @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale
* @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
* @return {DateTime}
*/
static fromFormat(text2, fmt, opts = {}) {
if (isUndefined(text2) || isUndefined(fmt)) {
throw new InvalidArgumentError("fromFormat requires an input string and a format");
}
const { locale: locale2 = null, numberingSystem = null } = opts, localeToUse = Locale.fromOpts({
locale: locale2,
numberingSystem,
defaultToEN: true
}), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text2, fmt);
if (invalid) {
return DateTime.invalid(invalid);
} else {
return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text2, specificOffset);
}
}
/**
* @deprecated use fromFormat instead
*/
static fromString(text2, fmt, opts = {}) {
return DateTime.fromFormat(text2, fmt, opts);
}
/**
* Create a DateTime from a SQL date, time, or datetime
* Defaults to en-US if no locale has been specified, regardless of the system's locale
* @param {string} text - the string to parse
* @param {Object} opts - options to affect the creation
* @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone
* @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one
* @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale
* @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
* @example DateTime.fromSQL('2017-05-15')
* @example DateTime.fromSQL('2017-05-15 09:12:34')
* @example DateTime.fromSQL('2017-05-15 09:12:34.342')
* @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')
* @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')
* @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })
* @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })
* @example DateTime.fromSQL('09:12:34.342')
* @return {DateTime}
*/
static fromSQL(text2, opts = {}) {
const [vals, parsedZone] = parseSQL(text2);
return parseDataToDateTime(vals, parsedZone, opts, "SQL", text2);
}
/**
* Create an invalid DateTime.
* @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.
* @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information
* @return {DateTime}
*/
static invalid(reason, explanation = null) {
if (!reason) {
throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");
}
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
if (Settings.throwOnInvalid) {
throw new InvalidDateTimeError(invalid);
} else {
return new DateTime({ invalid });
}
}
/**
* Check if an object is an instance of DateTime. Works across context boundaries
* @param {object} o
* @return {boolean}
*/
static isDateTime(o2) {
return o2 && o2.isLuxonDateTime || false;
}
/**
* Produce the format string for a set of options
* @param formatOpts
* @param localeOpts
* @returns {string}
*/
static parseFormatForOpts(formatOpts, localeOpts = {}) {
const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));
return !tokenList ? null : tokenList.map((t5) => t5 ? t5.val : null).join("");
}
/**
* Produce the the fully expanded format token for the locale
* Does NOT quote characters, so quoted tokens will not round trip correctly
* @param fmt
* @param localeOpts
* @returns {string}
*/
static expandFormat(fmt, localeOpts = {}) {
const expanded = expandMacroTokens(Formatter$1.parseFormat(fmt), Locale.fromObject(localeOpts));
return expanded.map((t5) => t5.val).join("");
}
// INFO
/**
* Get the value of unit.
* @param {string} unit - a unit such as 'minute' or 'day'
* @example DateTime.local(2017, 7, 4).get('month'); //=> 7
* @example DateTime.local(2017, 7, 4).get('day'); //=> 4
* @return {number}
*/
get(unit2) {
return this[unit2];
}
/**
* Returns whether the DateTime is valid. Invalid DateTimes occur when:
* * The DateTime was created from invalid calendar information, such as the 13th month or February 30
* * The DateTime was created by an operation on another invalid date
* @type {boolean}
*/
get isValid() {
return this.invalid === null;
}
/**
* Returns an error code if this DateTime is invalid, or null if the DateTime is valid
* @type {string}
*/
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
/**
* Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid
* @type {string}
*/
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
/**
* Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime
*
* @type {string}
*/
get locale() {
return this.isValid ? this.loc.locale : null;
}
/**
* Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime
*
* @type {string}
*/
get numberingSystem() {
return this.isValid ? this.loc.numberingSystem : null;
}
/**
* Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime
*
* @type {string}
*/
get outputCalendar() {
return this.isValid ? this.loc.outputCalendar : null;
}
/**
* Get the time zone associated with this DateTime.
* @type {Zone}
*/
get zone() {
return this._zone;
}
/**
* Get the name of the time zone.
* @type {string}
*/
get zoneName() {
return this.isValid ? this.zone.name : null;
}
/**
* Get the year
* @example DateTime.local(2017, 5, 25).year //=> 2017
* @type {number}
*/
get year() {
return this.isValid ? this.c.year : NaN;
}
/**
* Get the quarter
* @example DateTime.local(2017, 5, 25).quarter //=> 2
* @type {number}
*/
get quarter() {
return this.isValid ? Math.ceil(this.c.month / 3) : NaN;
}
/**
* Get the month (1-12).
* @example DateTime.local(2017, 5, 25).month //=> 5
* @type {number}
*/
get month() {
return this.isValid ? this.c.month : NaN;
}
/**
* Get the day of the month (1-30ish).
* @example DateTime.local(2017, 5, 25).day //=> 25
* @type {number}
*/
get day() {
return this.isValid ? this.c.day : NaN;
}
/**
* Get the hour of the day (0-23).
* @example DateTime.local(2017, 5, 25, 9).hour //=> 9
* @type {number}
*/
get hour() {
return this.isValid ? this.c.hour : NaN;
}
/**
* Get the minute of the hour (0-59).
* @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30
* @type {number}
*/
get minute() {
return this.isValid ? this.c.minute : NaN;
}
/**
* Get the second of the minute (0-59).
* @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52
* @type {number}
*/
get second() {
return this.isValid ? this.c.second : NaN;
}
/**
* Get the millisecond of the second (0-999).
* @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654
* @type {number}
*/
get millisecond() {
return this.isValid ? this.c.millisecond : NaN;
}
/**
* Get the week year
* @see https://en.wikipedia.org/wiki/ISO_week_date
* @example DateTime.local(2014, 12, 31).weekYear //=> 2015
* @type {number}
*/
get weekYear() {
return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;
}
/**
* Get the week number of the week year (1-52ish).
* @see https://en.wikipedia.org/wiki/ISO_week_date
* @example DateTime.local(2017, 5, 25).weekNumber //=> 21
* @type {number}
*/
get weekNumber() {
return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;
}
/**
* Get the day of the week.
* 1 is Monday and 7 is Sunday
* @see https://en.wikipedia.org/wiki/ISO_week_date
* @example DateTime.local(2014, 11, 31).weekday //=> 4
* @type {number}
*/
get weekday() {
return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;
}
/**
* Get the ordinal (meaning the day of the year)
* @example DateTime.local(2017, 5, 25).ordinal //=> 145
* @type {number|DateTime}
*/
get ordinal() {
return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;
}
/**
* Get the human readable short month name, such as 'Oct'.
* Defaults to the system's locale if no locale has been specified
* @example DateTime.local(2017, 10, 30).monthShort //=> Oct
* @type {string}
*/
get monthShort() {
return this.isValid ? Info$1.months("short", { locObj: this.loc })[this.month - 1] : null;
}
/**
* Get the human readable long month name, such as 'October'.
* Defaults to the system's locale if no locale has been specified
* @example DateTime.local(2017, 10, 30).monthLong //=> October
* @type {string}
*/
get monthLong() {
return this.isValid ? Info$1.months("long", { locObj: this.loc })[this.month - 1] : null;
}
/**
* Get the human readable short weekday, such as 'Mon'.
* Defaults to the system's locale if no locale has been specified
* @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon
* @type {string}
*/
get weekdayShort() {
return this.isValid ? Info$1.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
}
/**
* Get the human readable long weekday, such as 'Monday'.
* Defaults to the system's locale if no locale has been specified
* @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday
* @type {string}
*/
get weekdayLong() {
return this.isValid ? Info$1.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
}
/**
* Get the UTC offset of this DateTime in minutes
* @example DateTime.now().offset //=> -240
* @example DateTime.utc().offset //=> 0
* @type {number}
*/
get offset() {
return this.isValid ? +this.o : NaN;
}
/**
* Get the short human name for the zone's current offset, for example "EST" or "EDT".
* Defaults to the system's locale if no locale has been specified
* @type {string}
*/
get offsetNameShort() {
if (this.isValid) {
return this.zone.offsetName(this.ts, {
format: "short",
locale: this.locale
});
} else {
return null;
}
}
/**
* Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time".
* Defaults to the system's locale if no locale has been specified
* @type {string}
*/
get offsetNameLong() {
if (this.isValid) {
return this.zone.offsetName(this.ts, {
format: "long",
locale: this.locale
});
} else {
return null;
}
}
/**
* Get whether this zone's offset ever changes, as in a DST.
* @type {boolean}
*/
get isOffsetFixed() {
return this.isValid ? this.zone.isUniversal : null;
}
/**
* Get whether the DateTime is in a DST.
* @type {boolean}
*/
get isInDST() {
if (this.isOffsetFixed) {
return false;
} else {
return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset;
}
}
/**
* Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC
* in this DateTime's zone. During DST changes local time can be ambiguous, for example
* `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.
* This method will return both possible DateTimes if this DateTime's local time is ambiguous.
* @returns {DateTime[]}
*/
getPossibleOffsets() {
if (!this.isValid || this.isOffsetFixed) {
return [this];
}
const dayMs = 864e5;
const minuteMs = 6e4;
const localTS = objToLocalTS(this.c);
const oEarlier = this.zone.offset(localTS - dayMs);
const oLater = this.zone.offset(localTS + dayMs);
const o1 = this.zone.offset(localTS - oEarlier * minuteMs);
const o2 = this.zone.offset(localTS - oLater * minuteMs);
if (o1 === o2) {
return [this];
}
const ts1 = localTS - o1 * minuteMs;
const ts2 = localTS - o2 * minuteMs;
const c1 = tsToObj(ts1, o1);
const c2 = tsToObj(ts2, o2);
if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) {
return [clone$1(this, { ts: ts1 }), clone$1(this, { ts: ts2 })];
}
return [this];
}
/**
* Returns true if this DateTime is in a leap year, false otherwise
* @example DateTime.local(2016).isInLeapYear //=> true
* @example DateTime.local(2013).isInLeapYear //=> false
* @type {boolean}
*/
get isInLeapYear() {
return isLeapYear(this.year);
}
/**
* Returns the number of days in this DateTime's month
* @example DateTime.local(2016, 2).daysInMonth //=> 29
* @example DateTime.local(2016, 3).daysInMonth //=> 31
* @type {number}
*/
get daysInMonth() {
return daysInMonth(this.year, this.month);
}
/**
* Returns the number of days in this DateTime's year
* @example DateTime.local(2016).daysInYear //=> 366
* @example DateTime.local(2013).daysInYear //=> 365
* @type {number}
*/
get daysInYear() {
return this.isValid ? daysInYear(this.year) : NaN;
}
/**
* Returns the number of weeks in this DateTime's year
* @see https://en.wikipedia.org/wiki/ISO_week_date
* @example DateTime.local(2004).weeksInWeekYear //=> 53
* @example DateTime.local(2013).weeksInWeekYear //=> 52
* @type {number}
*/
get weeksInWeekYear() {
return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;
}
/**
* Returns the resolved Intl options for this DateTime.
* This is useful in understanding the behavior of formatting methods
* @param {Object} opts - the same options as toLocaleString
* @return {Object}
*/
resolvedLocaleOptions(opts = {}) {
const { locale: locale2, numberingSystem, calendar: calendar2 } = Formatter$1.create(
this.loc.clone(opts),
opts
).resolvedOptions(this);
return { locale: locale2, numberingSystem, outputCalendar: calendar2 };
}
// TRANSFORM
/**
* "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime.
*
* Equivalent to {@link DateTime#setZone}('utc')
* @param {number} [offset=0] - optionally, an offset from UTC in minutes
* @param {Object} [opts={}] - options to pass to `setZone()`
* @return {DateTime}
*/
toUTC(offset2 = 0, opts = {}) {
return this.setZone(FixedOffsetZone.instance(offset2), opts);
}
/**
* "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
*
* Equivalent to `setZone('local')`
* @return {DateTime}
*/
toLocal() {
return this.setZone(Settings.defaultZone);
}
/**
* "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.
*
* By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.
* @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.
* @param {Object} opts - options
* @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.
* @return {DateTime}
*/
setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {
zone = normalizeZone(zone, Settings.defaultZone);
if (zone.equals(this.zone)) {
return this;
} else if (!zone.isValid) {
return DateTime.invalid(unsupportedZone(zone));
} else {
let newTS = this.ts;
if (keepLocalTime || keepCalendarTime) {
const offsetGuess = zone.offset(this.ts);
const asObj = this.toObject();
[newTS] = objToTS(asObj, offsetGuess, zone);
}
return clone$1(this, { ts: newTS, zone });
}
}
/**
* "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
* @param {Object} properties - the properties to set
* @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })
* @return {DateTime}
*/
reconfigure({ locale: locale2, numberingSystem, outputCalendar } = {}) {
const loc = this.loc.clone({ locale: locale2, numberingSystem, outputCalendar });
return clone$1(this, { loc });
}
/**
* "Set" the locale. Returns a newly-constructed DateTime.
* Just a convenient alias for reconfigure({ locale })
* @example DateTime.local(2017, 5, 25).setLocale('en-GB')
* @return {DateTime}
*/
setLocale(locale2) {
return this.reconfigure({ locale: locale2 });
}
/**
* "Set" the values of specified units. Returns a newly-constructed DateTime.
* You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.
* @param {Object} values - a mapping of units to numbers
* @example dt.set({ year: 2017 })
* @example dt.set({ hour: 8, minute: 30 })
* @example dt.set({ weekday: 5 })
* @example dt.set({ year: 2005, ordinal: 234 })
* @return {DateTime}
*/
set(values2) {
if (!this.isValid)
return this;
const normalized = normalizeObject(values2, normalizeUnit), settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber;
if ((containsGregor || containsOrdinal) && definiteWeekDef) {
throw new ConflictingSpecificationError(
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
);
}
if (containsGregorMD && containsOrdinal) {
throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
}
let mixed;
if (settingWeekStuff) {
mixed = weekToGregorian({ ...gregorianToWeek(this.c), ...normalized });
} else if (!isUndefined(normalized.ordinal)) {
mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });
} else {
mixed = { ...this.toObject(), ...normalized };
if (isUndefined(normalized.day)) {
mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);
}
}
const [ts2, o2] = objToTS(mixed, this.o, this.zone);
return clone$1(this, { ts: ts2, o: o2 });
}
/**
* Add a period of time to this DateTime and return the resulting DateTime
*
* Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.
* @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
* @example DateTime.now().plus(123) //~> in 123 milliseconds
* @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes
* @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow
* @example DateTime.now().plus({ days: -1 }) //~> this time yesterday
* @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min
* @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min
* @return {DateTime}
*/
plus(duration2) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration2);
return clone$1(this, adjustTime(this, dur));
}
/**
* Subtract a period of time to this DateTime and return the resulting DateTime
* See {@link DateTime#plus}
* @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()
@return {DateTime}
*/
minus(duration2) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration2).negate();
return clone$1(this, adjustTime(this, dur));
}
/**
* "Set" this DateTime to the beginning of a unit of time.
* @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.
* @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'
* @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'
* @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays
* @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'
* @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'
* @return {DateTime}
*/
startOf(unit2) {
if (!this.isValid)
return this;
const o2 = {}, normalizedUnit = Duration.normalizeUnit(unit2);
switch (normalizedUnit) {
case "years":
o2.month = 1;
case "quarters":
case "months":
o2.day = 1;
case "weeks":
case "days":
o2.hour = 0;
case "hours":
o2.minute = 0;
case "minutes":
o2.second = 0;
case "seconds":
o2.millisecond = 0;
break;
}
if (normalizedUnit === "weeks") {
o2.weekday = 1;
}
if (normalizedUnit === "quarters") {
const q2 = Math.ceil(this.month / 3);
o2.month = (q2 - 1) * 3 + 1;
}
return this.set(o2);
}
/**
* "Set" this DateTime to the end (meaning the last millisecond) of a unit of time
* @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.
* @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'
* @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'
* @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays
* @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'
* @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'
* @return {DateTime}
*/
endOf(unit2) {
return this.isValid ? this.plus({ [unit2]: 1 }).startOf(unit2).minus(1) : this;
}
// OUTPUT
/**
* Returns a string representation of this DateTime formatted according to the specified format string.
* **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).
* Defaults to en-US if no locale has been specified, regardless of the system's locale.
* @param {string} fmt - the format string
* @param {Object} opts - opts to override the configuration options on this DateTime
* @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'
* @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'
* @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22'
* @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes'
* @return {string}
*/
toFormat(fmt, opts = {}) {
return this.isValid ? Formatter$1.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID;
}
/**
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
* The exact behavior of this method is browser-specific, but in general it will return an appropriate representation
* of the DateTime in the assigned locale.
* Defaults to the system's locale if no locale has been specified
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
* @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options
* @param {Object} opts - opts to override the configuration options on this DateTime
* @example DateTime.now().toLocaleString(); //=> 4/20/2017
* @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'
* @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'
* @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'
* @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'
* @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'
* @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'
* @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'
* @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'
* @return {string}
*/
toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
return this.isValid ? Formatter$1.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID;
}
/**
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
* Defaults to the system's locale if no locale has been specified
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts
* @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.
* @example DateTime.now().toLocaleParts(); //=> [
* //=> { type: 'day', value: '25' },
* //=> { type: 'literal', value: '/' },
* //=> { type: 'month', value: '05' },
* //=> { type: 'literal', value: '/' },
* //=> { type: 'year', value: '1982' }
* //=> ]
*/
toLocaleParts(opts = {}) {
return this.isValid ? Formatter$1.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : [];
}
/**
* Returns an ISO 8601-compliant string representation of this DateTime
* @param {Object} opts - options
* @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0
* @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0
* @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
* @param {boolean} [opts.extendedZone=false] - add the time zone format extension
* @param {string} [opts.format='extended'] - choose between the basic and extended format
* @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'
* @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'
* @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'
* @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'
* @return {string}
*/
toISO({
format: format2 = "extended",
suppressSeconds = false,
suppressMilliseconds = false,
includeOffset = true,
extendedZone = false
} = {}) {
if (!this.isValid) {
return null;
}
const ext = format2 === "extended";
let c2 = toISODate(this, ext);
c2 += "T";
c2 += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
return c2;
}
/**
* Returns an ISO 8601-compliant string representation of this DateTime's date component
* @param {Object} opts - options
* @param {string} [opts.format='extended'] - choose between the basic and extended format
* @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'
* @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'
* @return {string}
*/
toISODate({ format: format2 = "extended" } = {}) {
if (!this.isValid) {
return null;
}
return toISODate(this, format2 === "extended");
}
/**
* Returns an ISO 8601-compliant string representation of this DateTime's week date
* @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'
* @return {string}
*/
toISOWeekDate() {
return toTechFormat(this, "kkkk-'W'WW-c");
}
/**
* Returns an ISO 8601-compliant string representation of this DateTime's time component
* @param {Object} opts - options
* @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0
* @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0
* @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
* @param {boolean} [opts.extendedZone=true] - add the time zone format extension
* @param {boolean} [opts.includePrefix=false] - include the `T` prefix
* @param {string} [opts.format='extended'] - choose between the basic and extended format
* @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'
* @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'
* @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'
* @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'
* @return {string}
*/
toISOTime({
suppressMilliseconds = false,
suppressSeconds = false,
includeOffset = true,
includePrefix = false,
extendedZone = false,
format: format2 = "extended"
} = {}) {
if (!this.isValid) {
return null;
}
let c2 = includePrefix ? "T" : "";
return c2 + toISOTime(
this,
format2 === "extended",
suppressSeconds,
suppressMilliseconds,
includeOffset,
extendedZone
);
}
/**
* Returns an RFC 2822-compatible string representation of this DateTime
* @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'
* @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'
* @return {string}
*/
toRFC2822() {
return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false);
}
/**
* Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.
* Specifically, the string conforms to RFC 1123.
* @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
* @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'
* @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'
* @return {string}
*/
toHTTP() {
return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
}
/**
* Returns a string representation of this DateTime appropriate for use in SQL Date
* @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'
* @return {string}
*/
toSQLDate() {
if (!this.isValid) {
return null;
}
return toISODate(this, true);
}
/**
* Returns a string representation of this DateTime appropriate for use in SQL Time
* @param {Object} opts - options
* @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.
* @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
* @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'
* @example DateTime.utc().toSQL() //=> '05:15:16.345'
* @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'
* @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'
* @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'
* @return {string}
*/
toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {
let fmt = "HH:mm:ss.SSS";
if (includeZone || includeOffset) {
if (includeOffsetSpace) {
fmt += " ";
}
if (includeZone) {
fmt += "z";
} else if (includeOffset) {
fmt += "ZZ";
}
}
return toTechFormat(this, fmt, true);
}
/**
* Returns a string representation of this DateTime appropriate for use in SQL DateTime
* @param {Object} opts - options
* @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.
* @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'
* @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'
* @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'
* @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'
* @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'
* @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'
* @return {string}
*/
toSQL(opts = {}) {
if (!this.isValid) {
return null;
}
return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;
}
/**
* Returns a string representation of this DateTime appropriate for debugging
* @return {string}
*/
toString() {
return this.isValid ? this.toISO() : INVALID;
}
/**
* Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}
* @return {number}
*/
valueOf() {
return this.toMillis();
}
/**
* Returns the epoch milliseconds of this DateTime.
* @return {number}
*/
toMillis() {
return this.isValid ? this.ts : NaN;
}
/**
* Returns the epoch seconds of this DateTime.
* @return {number}
*/
toSeconds() {
return this.isValid ? this.ts / 1e3 : NaN;
}
/**
* Returns the epoch seconds (as a whole number) of this DateTime.
* @return {number}
*/
toUnixInteger() {
return this.isValid ? Math.floor(this.ts / 1e3) : NaN;
}
/**
* Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.
* @return {string}
*/
toJSON() {
return this.toISO();
}
/**
* Returns a BSON serializable equivalent to this DateTime.
* @return {Date}
*/
toBSON() {
return this.toJSDate();
}
/**
* Returns a JavaScript object with this DateTime's year, month, day, and so on.
* @param opts - options for generating the object
* @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output
* @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }
* @return {Object}
*/
toObject(opts = {}) {
if (!this.isValid)
return {};
const base2 = { ...this.c };
if (opts.includeConfig) {
base2.outputCalendar = this.outputCalendar;
base2.numberingSystem = this.loc.numberingSystem;
base2.locale = this.loc.locale;
}
return base2;
}
/**
* Returns a JavaScript Date equivalent to this DateTime.
* @return {Date}
*/
toJSDate() {
return new Date(this.isValid ? this.ts : NaN);
}
// COMPARE
/**
* Return the difference between two DateTimes as a Duration.
* @param {DateTime} otherDateTime - the DateTime to compare this one to
* @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.
* @param {Object} opts - options that affect the creation of the Duration
* @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
* @example
* var i1 = DateTime.fromISO('1982-05-25T09:45'),
* i2 = DateTime.fromISO('1983-10-14T10:30');
* i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }
* i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }
* i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }
* i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }
* @return {Duration}
*/
diff(otherDateTime, unit2 = "milliseconds", opts = {}) {
if (!this.isValid || !otherDateTime.isValid) {
return Duration.invalid("created by diffing an invalid DateTime");
}
const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };
const units = maybeArray(unit2).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = diff(earlier, later, units, durOpts);
return otherIsLater ? diffed.negate() : diffed;
}
/**
* Return the difference between this DateTime and right now.
* See {@link DateTime#diff}
* @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration
* @param {Object} opts - options that affect the creation of the Duration
* @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
* @return {Duration}
*/
diffNow(unit2 = "milliseconds", opts = {}) {
return this.diff(DateTime.now(), unit2, opts);
}
/**
* Return an Interval spanning between this DateTime and another DateTime
* @param {DateTime} otherDateTime - the other end point of the Interval
* @return {Interval}
*/
until(otherDateTime) {
return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
}
/**
* Return whether this DateTime is in the same unit of time as another DateTime.
* Higher-order units must also be identical for this function to return `true`.
* Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.
* @param {DateTime} otherDateTime - the other DateTime
* @param {string} unit - the unit of time to check sameness on
* @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day
* @return {boolean}
*/
hasSame(otherDateTime, unit2) {
if (!this.isValid)
return false;
const inputMs = otherDateTime.valueOf();
const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });
return adjustedToZone.startOf(unit2) <= inputMs && inputMs <= adjustedToZone.endOf(unit2);
}
/**
* Equality check
* Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.
* To compare just the millisecond values, use `+dt1 === +dt2`.
* @param {DateTime} other - the other DateTime
* @return {boolean}
*/
equals(other) {
return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc);
}
/**
* Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your
* platform supports Intl.RelativeTimeFormat. Rounds down by default.
* @param {Object} options - options that affect the output
* @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.
* @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow"
* @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds"
* @param {boolean} [options.round=true] - whether to round the numbers in the output.
* @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.
* @param {string} options.locale - override the locale of this DateTime
* @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this
* @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day"
* @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día"
* @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures"
* @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago"
* @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago"
* @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago"
*/
toRelative(options2 = {}) {
if (!this.isValid)
return null;
const base2 = options2.base || DateTime.fromObject({}, { zone: this.zone }), padding2 = options2.padding ? this < base2 ? -options2.padding : options2.padding : 0;
let units = ["years", "months", "days", "hours", "minutes", "seconds"];
let unit2 = options2.unit;
if (Array.isArray(options2.unit)) {
units = options2.unit;
unit2 = void 0;
}
return diffRelative(base2, this.plus(padding2), {
...options2,
numeric: "always",
units,
unit: unit2
});
}
/**
* Returns a string representation of this date relative to today, such as "yesterday" or "next month".
* Only internationalizes on platforms that supports Intl.RelativeTimeFormat.
* @param {Object} options - options that affect the output
* @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.
* @param {string} options.locale - override the locale of this DateTime
* @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days"
* @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this
* @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow"
* @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana"
* @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain"
* @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
*/
toRelativeCalendar(options2 = {}) {
if (!this.isValid)
return null;
return diffRelative(options2.base || DateTime.fromObject({}, { zone: this.zone }), this, {
...options2,
numeric: "auto",
units: ["years", "months", "days"],
calendary: true
});
}
/**
* Return the min of several date times
* @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum
* @return {DateTime} the min DateTime, or undefined if called with no argument
*/
static min(...dateTimes) {
if (!dateTimes.every(DateTime.isDateTime)) {
throw new InvalidArgumentError("min requires all arguments be DateTimes");
}
return bestBy(dateTimes, (i2) => i2.valueOf(), Math.min);
}
/**
* Return the max of several date times
* @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum
* @return {DateTime} the max DateTime, or undefined if called with no argument
*/
static max(...dateTimes) {
if (!dateTimes.every(DateTime.isDateTime)) {
throw new InvalidArgumentError("max requires all arguments be DateTimes");
}
return bestBy(dateTimes, (i2) => i2.valueOf(), Math.max);
}
// MISC
/**
* Explain how a string would be parsed by fromFormat()
* @param {string} text - the string to parse
* @param {string} fmt - the format the string is expected to be in (see description)
* @param {Object} options - options taken by fromFormat()
* @return {Object}
*/
static fromFormatExplain(text2, fmt, options2 = {}) {
const { locale: locale2 = null, numberingSystem = null } = options2, localeToUse = Locale.fromOpts({
locale: locale2,
numberingSystem,
defaultToEN: true
});
return explainFromTokens(localeToUse, text2, fmt);
}
/**
* @deprecated use fromFormatExplain instead
*/
static fromStringExplain(text2, fmt, options2 = {}) {
return DateTime.fromFormatExplain(text2, fmt, options2);
}
// FORMAT PRESETS
/**
* {@link DateTime#toLocaleString} format like 10/14/1983
* @type {Object}
*/
static get DATE_SHORT() {
return DATE_SHORT;
}
/**
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983'
* @type {Object}
*/
static get DATE_MED() {
return DATE_MED;
}
/**
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
* @type {Object}
*/
static get DATE_MED_WITH_WEEKDAY() {
return DATE_MED_WITH_WEEKDAY;
}
/**
* {@link DateTime#toLocaleString} format like 'October 14, 1983'
* @type {Object}
*/
static get DATE_FULL() {
return DATE_FULL;
}
/**
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
* @type {Object}
*/
static get DATE_HUGE() {
return DATE_HUGE;
}
/**
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get TIME_SIMPLE() {
return TIME_SIMPLE;
}
/**
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get TIME_WITH_SECONDS() {
return TIME_WITH_SECONDS;
}
/**
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
* @type {Object}
*/
static get TIME_WITH_SHORT_OFFSET() {
return TIME_WITH_SHORT_OFFSET;
}
/**
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
* @type {Object}
*/
static get TIME_WITH_LONG_OFFSET() {
return TIME_WITH_LONG_OFFSET;
}
/**
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
* @type {Object}
*/
static get TIME_24_SIMPLE() {
return TIME_24_SIMPLE;
}
/**
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
* @type {Object}
*/
static get TIME_24_WITH_SECONDS() {
return TIME_24_WITH_SECONDS;
}
/**
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
* @type {Object}
*/
static get TIME_24_WITH_SHORT_OFFSET() {
return TIME_24_WITH_SHORT_OFFSET;
}
/**
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
* @type {Object}
*/
static get TIME_24_WITH_LONG_OFFSET() {
return TIME_24_WITH_LONG_OFFSET;
}
/**
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_SHORT() {
return DATETIME_SHORT;
}
/**
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_SHORT_WITH_SECONDS() {
return DATETIME_SHORT_WITH_SECONDS;
}
/**
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_MED() {
return DATETIME_MED;
}
/**
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_MED_WITH_SECONDS() {
return DATETIME_MED_WITH_SECONDS;
}
/**
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_MED_WITH_WEEKDAY() {
return DATETIME_MED_WITH_WEEKDAY;
}
/**
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_FULL() {
return DATETIME_FULL;
}
/**
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_FULL_WITH_SECONDS() {
return DATETIME_FULL_WITH_SECONDS;
}
/**
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_HUGE() {
return DATETIME_HUGE;
}
/**
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
* @type {Object}
*/
static get DATETIME_HUGE_WITH_SECONDS() {
return DATETIME_HUGE_WITH_SECONDS;
}
}
function friendlyDateTime(dateTimeish) {
if (DateTime.isDateTime(dateTimeish)) {
return dateTimeish;
} else if (dateTimeish && dateTimeish.valueOf && isNumber$2(dateTimeish.valueOf())) {
return DateTime.fromJSDate(dateTimeish);
} else if (dateTimeish && typeof dateTimeish === "object") {
return DateTime.fromObject(dateTimeish);
} else {
throw new InvalidArgumentError(
`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`
);
}
}
const scriptRel = "modulepreload";
const assetsURL = function(dep) {
return "/" + dep;
};
const seen = {};
const __vitePreload = function preload(baseModule, deps, importerUrl) {
if (!deps || deps.length === 0) {
return baseModule();
}
const links = document.getElementsByTagName("link");
return Promise.all(deps.map((dep) => {
dep = assetsURL(dep);
if (dep in seen)
return;
seen[dep] = true;
const isCss = dep.endsWith(".css");
const cssSelector = isCss ? '[rel="stylesheet"]' : "";
const isBaseRelative = !!importerUrl;
if (isBaseRelative) {
for (let i2 = links.length - 1; i2 >= 0; i2--) {
const link3 = links[i2];
if (link3.href === dep && (!isCss || link3.rel === "stylesheet")) {
return;
}
}
} else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
return;
}
const link2 = document.createElement("link");
link2.rel = isCss ? "stylesheet" : scriptRel;
if (!isCss) {
link2.as = "script";
link2.crossOrigin = "";
}
link2.href = dep;
document.head.appendChild(link2);
if (isCss) {
return new Promise((res, rej) => {
link2.addEventListener("load", res);
link2.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
});
}
})).then(() => baseModule()).catch((err) => {
const e7 = new Event("vite:preloadError", { cancelable: true });
e7.payload = err;
window.dispatchEvent(e7);
if (!e7.defaultPrevented) {
throw err;
}
});
};
var humanizeDuration$1 = { exports: {} };
(function(module) {
(function() {
var GREEK = language(
function(c2) {
return c2 === 1 ? "χρόνος" : "χρόνια";
},
function(c2) {
return c2 === 1 ? "μήνας" : "μήνες";
},
function(c2) {
return c2 === 1 ? "εβδομάδα" : "εβδομάδες";
},
function(c2) {
return c2 === 1 ? "μέρα" : "μέρες";
},
function(c2) {
return c2 === 1 ? "ώρα" : "ώρες";
},
function(c2) {
return c2 === 1 ? "λεπτό" : "λεπτά";
},
function(c2) {
return c2 === 1 ? "δευτερόλεπτο" : "δευτερόλεπτα";
},
function(c2) {
return (c2 === 1 ? "χιλιοστό" : "χιλιοστά") + " του δευτερολέπτου";
},
","
);
var LANGUAGES = {
af: language(
"jaar",
function(c2) {
return "maand" + (c2 === 1 ? "" : "e");
},
function(c2) {
return c2 === 1 ? "week" : "weke";
},
function(c2) {
return c2 === 1 ? "dag" : "dae";
},
function(c2) {
return c2 === 1 ? "uur" : "ure";
},
function(c2) {
return c2 === 1 ? "minuut" : "minute";
},
function(c2) {
return "sekonde" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "millisekonde" + (c2 === 1 ? "" : "s");
},
","
),
ar: assign2(
language(
function(c2) {
return ["سنة", "سنتان", "سنوات"][getArabicForm(c2)];
},
function(c2) {
return ["شهر", "شهران", "أشهر"][getArabicForm(c2)];
},
function(c2) {
return ["أسبوع", "أسبوعين", "أسابيع"][getArabicForm(c2)];
},
function(c2) {
return ["يوم", "يومين", "أيام"][getArabicForm(c2)];
},
function(c2) {
return ["ساعة", "ساعتين", "ساعات"][getArabicForm(c2)];
},
function(c2) {
return ["دقيقة", "دقيقتان", "دقائق"][getArabicForm(c2)];
},
function(c2) {
return ["ثانية", "ثانيتان", "ثواني"][getArabicForm(c2)];
},
function(c2) {
return ["جزء من الثانية", "جزآن من الثانية", "أجزاء من الثانية"][getArabicForm(c2)];
},
","
),
{
delimiter: " ﻭ ",
_digitReplacements: ["۰", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"]
}
),
bg: language(
function(c2) {
return ["години", "година", "години"][getSlavicForm(c2)];
},
function(c2) {
return ["месеца", "месец", "месеца"][getSlavicForm(c2)];
},
function(c2) {
return ["седмици", "седмица", "седмици"][getSlavicForm(c2)];
},
function(c2) {
return ["дни", "ден", "дни"][getSlavicForm(c2)];
},
function(c2) {
return ["часа", "час", "часа"][getSlavicForm(c2)];
},
function(c2) {
return ["минути", "минута", "минути"][getSlavicForm(c2)];
},
function(c2) {
return ["секунди", "секунда", "секунди"][getSlavicForm(c2)];
},
function(c2) {
return ["милисекунди", "милисекунда", "милисекунди"][getSlavicForm(c2)];
},
","
),
bn: language(
"বছর",
"মাস",
"সপ্তাহ",
"দিন",
"ঘন্টা",
"মিনিট",
"সেকেন্ড",
"মিলিসেকেন্ড"
),
ca: language(
function(c2) {
return "any" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "mes" + (c2 === 1 ? "" : "os");
},
function(c2) {
return "setman" + (c2 === 1 ? "a" : "es");
},
function(c2) {
return "di" + (c2 === 1 ? "a" : "es");
},
function(c2) {
return "hor" + (c2 === 1 ? "a" : "es");
},
function(c2) {
return "minut" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "segon" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "milisegon" + (c2 === 1 ? "" : "s");
},
","
),
cs: language(
function(c2) {
return ["rok", "roku", "roky", "let"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["měsíc", "měsíce", "měsíce", "měsíců"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["týden", "týdne", "týdny", "týdnů"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["den", "dne", "dny", "dní"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["hodina", "hodiny", "hodiny", "hodin"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["minuta", "minuty", "minuty", "minut"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["sekunda", "sekundy", "sekundy", "sekund"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["milisekunda", "milisekundy", "milisekundy", "milisekund"][getCzechOrSlovakForm(c2)];
},
","
),
cy: language(
"flwyddyn",
"mis",
"wythnos",
"diwrnod",
"awr",
"munud",
"eiliad",
"milieiliad"
),
da: language(
"år",
function(c2) {
return "måned" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "uge" + (c2 === 1 ? "" : "r");
},
function(c2) {
return "dag" + (c2 === 1 ? "" : "e");
},
function(c2) {
return "time" + (c2 === 1 ? "" : "r");
},
function(c2) {
return "minut" + (c2 === 1 ? "" : "ter");
},
function(c2) {
return "sekund" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "millisekund" + (c2 === 1 ? "" : "er");
},
","
),
de: language(
function(c2) {
return "Jahr" + (c2 === 1 ? "" : "e");
},
function(c2) {
return "Monat" + (c2 === 1 ? "" : "e");
},
function(c2) {
return "Woche" + (c2 === 1 ? "" : "n");
},
function(c2) {
return "Tag" + (c2 === 1 ? "" : "e");
},
function(c2) {
return "Stunde" + (c2 === 1 ? "" : "n");
},
function(c2) {
return "Minute" + (c2 === 1 ? "" : "n");
},
function(c2) {
return "Sekunde" + (c2 === 1 ? "" : "n");
},
function(c2) {
return "Millisekunde" + (c2 === 1 ? "" : "n");
},
","
),
el: GREEK,
en: language(
function(c2) {
return "year" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "month" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "week" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "day" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "hour" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "minute" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "second" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "millisecond" + (c2 === 1 ? "" : "s");
}
),
eo: language(
function(c2) {
return "jaro" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "monato" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "semajno" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "tago" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "horo" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "minuto" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "sekundo" + (c2 === 1 ? "" : "j");
},
function(c2) {
return "milisekundo" + (c2 === 1 ? "" : "j");
},
","
),
es: language(
function(c2) {
return "año" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "mes" + (c2 === 1 ? "" : "es");
},
function(c2) {
return "semana" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "día" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "hora" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "minuto" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "segundo" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "milisegundo" + (c2 === 1 ? "" : "s");
},
","
),
et: language(
function(c2) {
return "aasta" + (c2 === 1 ? "" : "t");
},
function(c2) {
return "kuu" + (c2 === 1 ? "" : "d");
},
function(c2) {
return "nädal" + (c2 === 1 ? "" : "at");
},
function(c2) {
return "päev" + (c2 === 1 ? "" : "a");
},
function(c2) {
return "tund" + (c2 === 1 ? "" : "i");
},
function(c2) {
return "minut" + (c2 === 1 ? "" : "it");
},
function(c2) {
return "sekund" + (c2 === 1 ? "" : "it");
},
function(c2) {
return "millisekund" + (c2 === 1 ? "" : "it");
},
","
),
eu: language(
"urte",
"hilabete",
"aste",
"egun",
"ordu",
"minutu",
"segundo",
"milisegundo",
","
),
fa: language(
"سال",
"ماه",
"هفته",
"روز",
"ساعت",
"دقیقه",
"ثانیه",
"میلی ثانیه"
),
fi: language(
function(c2) {
return c2 === 1 ? "vuosi" : "vuotta";
},
function(c2) {
return c2 === 1 ? "kuukausi" : "kuukautta";
},
function(c2) {
return "viikko" + (c2 === 1 ? "" : "a");
},
function(c2) {
return "päivä" + (c2 === 1 ? "" : "ä");
},
function(c2) {
return "tunti" + (c2 === 1 ? "" : "a");
},
function(c2) {
return "minuutti" + (c2 === 1 ? "" : "a");
},
function(c2) {
return "sekunti" + (c2 === 1 ? "" : "a");
},
function(c2) {
return "millisekunti" + (c2 === 1 ? "" : "a");
},
","
),
fo: language(
"ár",
function(c2) {
return c2 === 1 ? "mánaður" : "mánaðir";
},
function(c2) {
return c2 === 1 ? "vika" : "vikur";
},
function(c2) {
return c2 === 1 ? "dagur" : "dagar";
},
function(c2) {
return c2 === 1 ? "tími" : "tímar";
},
function(c2) {
return c2 === 1 ? "minuttur" : "minuttir";
},
"sekund",
"millisekund",
","
),
fr: language(
function(c2) {
return "an" + (c2 >= 2 ? "s" : "");
},
"mois",
function(c2) {
return "semaine" + (c2 >= 2 ? "s" : "");
},
function(c2) {
return "jour" + (c2 >= 2 ? "s" : "");
},
function(c2) {
return "heure" + (c2 >= 2 ? "s" : "");
},
function(c2) {
return "minute" + (c2 >= 2 ? "s" : "");
},
function(c2) {
return "seconde" + (c2 >= 2 ? "s" : "");
},
function(c2) {
return "milliseconde" + (c2 >= 2 ? "s" : "");
},
","
),
gr: GREEK,
he: language(
function(c2) {
return c2 === 1 ? "שנה" : "שנים";
},
function(c2) {
return c2 === 1 ? "חודש" : "חודשים";
},
function(c2) {
return c2 === 1 ? "שבוע" : "שבועות";
},
function(c2) {
return c2 === 1 ? "יום" : "ימים";
},
function(c2) {
return c2 === 1 ? "שעה" : "שעות";
},
function(c2) {
return c2 === 1 ? "דקה" : "דקות";
},
function(c2) {
return c2 === 1 ? "שניה" : "שניות";
},
function(c2) {
return c2 === 1 ? "מילישנייה" : "מילישניות";
}
),
hr: language(
function(c2) {
if (c2 % 10 === 2 || c2 % 10 === 3 || c2 % 10 === 4) {
return "godine";
}
return "godina";
},
function(c2) {
if (c2 === 1) {
return "mjesec";
} else if (c2 === 2 || c2 === 3 || c2 === 4) {
return "mjeseca";
}
return "mjeseci";
},
function(c2) {
if (c2 % 10 === 1 && c2 !== 11) {
return "tjedan";
}
return "tjedna";
},
function(c2) {
return c2 === 1 ? "dan" : "dana";
},
function(c2) {
if (c2 === 1) {
return "sat";
} else if (c2 === 2 || c2 === 3 || c2 === 4) {
return "sata";
}
return "sati";
},
function(c2) {
var mod10 = c2 % 10;
if ((mod10 === 2 || mod10 === 3 || mod10 === 4) && (c2 < 10 || c2 > 14)) {
return "minute";
}
return "minuta";
},
function(c2) {
var mod10 = c2 % 10;
if (mod10 === 5 || Math.floor(c2) === c2 && c2 >= 10 && c2 <= 19) {
return "sekundi";
} else if (mod10 === 1) {
return "sekunda";
} else if (mod10 === 2 || mod10 === 3 || mod10 === 4) {
return "sekunde";
}
return "sekundi";
},
function(c2) {
if (c2 === 1) {
return "milisekunda";
} else if (c2 % 10 === 2 || c2 % 10 === 3 || c2 % 10 === 4) {
return "milisekunde";
}
return "milisekundi";
},
","
),
hi: language(
"साल",
function(c2) {
return c2 === 1 ? "महीना" : "महीने";
},
function(c2) {
return c2 === 1 ? "हफ़्ता" : "हफ्ते";
},
"दिन",
function(c2) {
return c2 === 1 ? "घंटा" : "घंटे";
},
"मिनट",
"सेकंड",
"मिलीसेकंड"
),
hu: language(
"év",
"hónap",
"hét",
"nap",
"óra",
"perc",
"másodperc",
"ezredmásodperc",
","
),
id: language(
"tahun",
"bulan",
"minggu",
"hari",
"jam",
"menit",
"detik",
"milidetik"
),
is: language(
"ár",
function(c2) {
return "mánuð" + (c2 === 1 ? "ur" : "ir");
},
function(c2) {
return "vik" + (c2 === 1 ? "a" : "ur");
},
function(c2) {
return "dag" + (c2 === 1 ? "ur" : "ar");
},
function(c2) {
return "klukkutím" + (c2 === 1 ? "i" : "ar");
},
function(c2) {
return "mínút" + (c2 === 1 ? "a" : "ur");
},
function(c2) {
return "sekúnd" + (c2 === 1 ? "a" : "ur");
},
function(c2) {
return "millisekúnd" + (c2 === 1 ? "a" : "ur");
}
),
it: language(
function(c2) {
return "ann" + (c2 === 1 ? "o" : "i");
},
function(c2) {
return "mes" + (c2 === 1 ? "e" : "i");
},
function(c2) {
return "settiman" + (c2 === 1 ? "a" : "e");
},
function(c2) {
return "giorn" + (c2 === 1 ? "o" : "i");
},
function(c2) {
return "or" + (c2 === 1 ? "a" : "e");
},
function(c2) {
return "minut" + (c2 === 1 ? "o" : "i");
},
function(c2) {
return "second" + (c2 === 1 ? "o" : "i");
},
function(c2) {
return "millisecond" + (c2 === 1 ? "o" : "i");
},
","
),
ja: language("年", "ヶ月", "週", "日", "時間", "分", "秒", "ミリ秒"),
km: language(
"ឆ្នាំ",
"ខែ",
"សប្តាហ៍",
"ថ្ងៃ",
"ម៉ោង",
"នាទី",
"វិនាទី",
"មិល្លីវិនាទី"
),
kn: language(
function(c2) {
return c2 === 1 ? "ವರ್ಷ" : "ವರ್ಷಗಳು";
},
function(c2) {
return c2 === 1 ? "ತಿಂಗಳು" : "ತಿಂಗಳುಗಳು";
},
function(c2) {
return c2 === 1 ? "ವಾರ" : "ವಾರಗಳು";
},
function(c2) {
return c2 === 1 ? "ದಿನ" : "ದಿನಗಳು";
},
function(c2) {
return c2 === 1 ? "ಗಂಟೆ" : "ಗಂಟೆಗಳು";
},
function(c2) {
return c2 === 1 ? "ನಿಮಿಷ" : "ನಿಮಿಷಗಳು";
},
function(c2) {
return c2 === 1 ? "ಸೆಕೆಂಡ್" : "ಸೆಕೆಂಡುಗಳು";
},
function(c2) {
return c2 === 1 ? "ಮಿಲಿಸೆಕೆಂಡ್" : "ಮಿಲಿಸೆಕೆಂಡುಗಳು";
}
),
ko: language("년", "개월", "주일", "일", "시간", "분", "초", "밀리 초"),
ku: language(
"sal",
"meh",
"hefte",
"roj",
"seet",
"deqe",
"saniye",
"mîlîçirk",
","
),
lo: language(
"ປີ",
"ເດືອນ",
"ອາທິດ",
"ມື້",
"ຊົ່ວໂມງ",
"ນາທີ",
"ວິນາທີ",
"ມິນລິວິນາທີ",
","
),
lt: language(
function(c2) {
return c2 % 10 === 0 || c2 % 100 >= 10 && c2 % 100 <= 20 ? "metų" : "metai";
},
function(c2) {
return ["mėnuo", "mėnesiai", "mėnesių"][getLithuanianForm(c2)];
},
function(c2) {
return ["savaitė", "savaitės", "savaičių"][getLithuanianForm(c2)];
},
function(c2) {
return ["diena", "dienos", "dienų"][getLithuanianForm(c2)];
},
function(c2) {
return ["valanda", "valandos", "valandų"][getLithuanianForm(c2)];
},
function(c2) {
return ["minutė", "minutės", "minučių"][getLithuanianForm(c2)];
},
function(c2) {
return ["sekundė", "sekundės", "sekundžių"][getLithuanianForm(c2)];
},
function(c2) {
return ["milisekundė", "milisekundės", "milisekundžių"][getLithuanianForm(c2)];
},
","
),
lv: language(
function(c2) {
return getLatvianForm(c2) ? "gads" : "gadi";
},
function(c2) {
return getLatvianForm(c2) ? "mēnesis" : "mēneši";
},
function(c2) {
return getLatvianForm(c2) ? "nedēļa" : "nedēļas";
},
function(c2) {
return getLatvianForm(c2) ? "diena" : "dienas";
},
function(c2) {
return getLatvianForm(c2) ? "stunda" : "stundas";
},
function(c2) {
return getLatvianForm(c2) ? "minūte" : "minūtes";
},
function(c2) {
return getLatvianForm(c2) ? "sekunde" : "sekundes";
},
function(c2) {
return getLatvianForm(c2) ? "milisekunde" : "milisekundes";
},
","
),
mk: language(
function(c2) {
return c2 === 1 ? "година" : "години";
},
function(c2) {
return c2 === 1 ? "месец" : "месеци";
},
function(c2) {
return c2 === 1 ? "недела" : "недели";
},
function(c2) {
return c2 === 1 ? "ден" : "дена";
},
function(c2) {
return c2 === 1 ? "час" : "часа";
},
function(c2) {
return c2 === 1 ? "минута" : "минути";
},
function(c2) {
return c2 === 1 ? "секунда" : "секунди";
},
function(c2) {
return c2 === 1 ? "милисекунда" : "милисекунди";
},
","
),
mn: language(
"жил",
"сар",
"долоо хоног",
"өдөр",
"цаг",
"минут",
"секунд",
"миллисекунд"
),
mr: language(
function(c2) {
return c2 === 1 ? "वर्ष" : "वर्षे";
},
function(c2) {
return c2 === 1 ? "महिना" : "महिने";
},
function(c2) {
return c2 === 1 ? "आठवडा" : "आठवडे";
},
"दिवस",
"तास",
function(c2) {
return c2 === 1 ? "मिनिट" : "मिनिटे";
},
"सेकंद",
"मिलिसेकंद"
),
ms: language(
"tahun",
"bulan",
"minggu",
"hari",
"jam",
"minit",
"saat",
"milisaat"
),
nl: language(
"jaar",
function(c2) {
return c2 === 1 ? "maand" : "maanden";
},
function(c2) {
return c2 === 1 ? "week" : "weken";
},
function(c2) {
return c2 === 1 ? "dag" : "dagen";
},
"uur",
function(c2) {
return c2 === 1 ? "minuut" : "minuten";
},
function(c2) {
return c2 === 1 ? "seconde" : "seconden";
},
function(c2) {
return c2 === 1 ? "milliseconde" : "milliseconden";
},
","
),
no: language(
"år",
function(c2) {
return "måned" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "uke" + (c2 === 1 ? "" : "r");
},
function(c2) {
return "dag" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "time" + (c2 === 1 ? "" : "r");
},
function(c2) {
return "minutt" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "sekund" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "millisekund" + (c2 === 1 ? "" : "er");
},
","
),
pl: language(
function(c2) {
return ["rok", "roku", "lata", "lat"][getPolishForm(c2)];
},
function(c2) {
return ["miesiąc", "miesiąca", "miesiące", "miesięcy"][getPolishForm(c2)];
},
function(c2) {
return ["tydzień", "tygodnia", "tygodnie", "tygodni"][getPolishForm(c2)];
},
function(c2) {
return ["dzień", "dnia", "dni", "dni"][getPolishForm(c2)];
},
function(c2) {
return ["godzina", "godziny", "godziny", "godzin"][getPolishForm(c2)];
},
function(c2) {
return ["minuta", "minuty", "minuty", "minut"][getPolishForm(c2)];
},
function(c2) {
return ["sekunda", "sekundy", "sekundy", "sekund"][getPolishForm(c2)];
},
function(c2) {
return ["milisekunda", "milisekundy", "milisekundy", "milisekund"][getPolishForm(c2)];
},
","
),
pt: language(
function(c2) {
return "ano" + (c2 === 1 ? "" : "s");
},
function(c2) {
return c2 === 1 ? "mês" : "meses";
},
function(c2) {
return "semana" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "dia" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "hora" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "minuto" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "segundo" + (c2 === 1 ? "" : "s");
},
function(c2) {
return "milissegundo" + (c2 === 1 ? "" : "s");
},
","
),
ro: language(
function(c2) {
return c2 === 1 ? "an" : "ani";
},
function(c2) {
return c2 === 1 ? "lună" : "luni";
},
function(c2) {
return c2 === 1 ? "săptămână" : "săptămâni";
},
function(c2) {
return c2 === 1 ? "zi" : "zile";
},
function(c2) {
return c2 === 1 ? "oră" : "ore";
},
function(c2) {
return c2 === 1 ? "minut" : "minute";
},
function(c2) {
return c2 === 1 ? "secundă" : "secunde";
},
function(c2) {
return c2 === 1 ? "milisecundă" : "milisecunde";
},
","
),
ru: language(
function(c2) {
return ["лет", "год", "года"][getSlavicForm(c2)];
},
function(c2) {
return ["месяцев", "месяц", "месяца"][getSlavicForm(c2)];
},
function(c2) {
return ["недель", "неделя", "недели"][getSlavicForm(c2)];
},
function(c2) {
return ["дней", "день", "дня"][getSlavicForm(c2)];
},
function(c2) {
return ["часов", "час", "часа"][getSlavicForm(c2)];
},
function(c2) {
return ["минут", "минута", "минуты"][getSlavicForm(c2)];
},
function(c2) {
return ["секунд", "секунда", "секунды"][getSlavicForm(c2)];
},
function(c2) {
return ["миллисекунд", "миллисекунда", "миллисекунды"][getSlavicForm(c2)];
},
","
),
sq: language(
function(c2) {
return c2 === 1 ? "vit" : "vjet";
},
"muaj",
"javë",
"ditë",
"orë",
function(c2) {
return "minut" + (c2 === 1 ? "ë" : "a");
},
function(c2) {
return "sekond" + (c2 === 1 ? "ë" : "a");
},
function(c2) {
return "milisekond" + (c2 === 1 ? "ë" : "a");
},
","
),
sr: language(
function(c2) {
return ["години", "година", "године"][getSlavicForm(c2)];
},
function(c2) {
return ["месеци", "месец", "месеца"][getSlavicForm(c2)];
},
function(c2) {
return ["недељи", "недеља", "недеље"][getSlavicForm(c2)];
},
function(c2) {
return ["дани", "дан", "дана"][getSlavicForm(c2)];
},
function(c2) {
return ["сати", "сат", "сата"][getSlavicForm(c2)];
},
function(c2) {
return ["минута", "минут", "минута"][getSlavicForm(c2)];
},
function(c2) {
return ["секунди", "секунда", "секунде"][getSlavicForm(c2)];
},
function(c2) {
return ["милисекунди", "милисекунда", "милисекунде"][getSlavicForm(c2)];
},
","
),
ta: language(
function(c2) {
return c2 === 1 ? "வருடம்" : "ஆண்டுகள்";
},
function(c2) {
return c2 === 1 ? "மாதம்" : "மாதங்கள்";
},
function(c2) {
return c2 === 1 ? "வாரம்" : "வாரங்கள்";
},
function(c2) {
return c2 === 1 ? "நாள்" : "நாட்கள்";
},
function(c2) {
return c2 === 1 ? "மணி" : "மணிநேரம்";
},
function(c2) {
return "நிமிட" + (c2 === 1 ? "ம்" : "ங்கள்");
},
function(c2) {
return "வினாடி" + (c2 === 1 ? "" : "கள்");
},
function(c2) {
return "மில்லி விநாடி" + (c2 === 1 ? "" : "கள்");
}
),
te: language(
function(c2) {
return "సంవత్స" + (c2 === 1 ? "రం" : "రాల");
},
function(c2) {
return "నెల" + (c2 === 1 ? "" : "ల");
},
function(c2) {
return c2 === 1 ? "వారం" : "వారాలు";
},
function(c2) {
return "రోజు" + (c2 === 1 ? "" : "లు");
},
function(c2) {
return "గంట" + (c2 === 1 ? "" : "లు");
},
function(c2) {
return c2 === 1 ? "నిమిషం" : "నిమిషాలు";
},
function(c2) {
return c2 === 1 ? "సెకను" : "సెకన్లు";
},
function(c2) {
return c2 === 1 ? "మిల్లీసెకన్" : "మిల్లీసెకన్లు";
}
),
uk: language(
function(c2) {
return ["років", "рік", "роки"][getSlavicForm(c2)];
},
function(c2) {
return ["місяців", "місяць", "місяці"][getSlavicForm(c2)];
},
function(c2) {
return ["тижнів", "тиждень", "тижні"][getSlavicForm(c2)];
},
function(c2) {
return ["днів", "день", "дні"][getSlavicForm(c2)];
},
function(c2) {
return ["годин", "година", "години"][getSlavicForm(c2)];
},
function(c2) {
return ["хвилин", "хвилина", "хвилини"][getSlavicForm(c2)];
},
function(c2) {
return ["секунд", "секунда", "секунди"][getSlavicForm(c2)];
},
function(c2) {
return ["мілісекунд", "мілісекунда", "мілісекунди"][getSlavicForm(c2)];
},
","
),
ur: language(
"سال",
function(c2) {
return c2 === 1 ? "مہینہ" : "مہینے";
},
function(c2) {
return c2 === 1 ? "ہفتہ" : "ہفتے";
},
"دن",
function(c2) {
return c2 === 1 ? "گھنٹہ" : "گھنٹے";
},
"منٹ",
"سیکنڈ",
"ملی سیکنڈ"
),
sk: language(
function(c2) {
return ["rok", "roky", "roky", "rokov"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["mesiac", "mesiace", "mesiace", "mesiacov"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["týždeň", "týždne", "týždne", "týždňov"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["deň", "dni", "dni", "dní"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["hodina", "hodiny", "hodiny", "hodín"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["minúta", "minúty", "minúty", "minút"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["sekunda", "sekundy", "sekundy", "sekúnd"][getCzechOrSlovakForm(c2)];
},
function(c2) {
return ["milisekunda", "milisekundy", "milisekundy", "milisekúnd"][getCzechOrSlovakForm(c2)];
},
","
),
sl: language(
function(c2) {
if (c2 % 10 === 1) {
return "leto";
} else if (c2 % 100 === 2) {
return "leti";
} else if (c2 % 100 === 3 || c2 % 100 === 4 || Math.floor(c2) !== c2 && c2 % 100 <= 5) {
return "leta";
} else {
return "let";
}
},
function(c2) {
if (c2 % 10 === 1) {
return "mesec";
} else if (c2 % 100 === 2 || Math.floor(c2) !== c2 && c2 % 100 <= 5) {
return "meseca";
} else if (c2 % 10 === 3 || c2 % 10 === 4) {
return "mesece";
} else {
return "mesecev";
}
},
function(c2) {
if (c2 % 10 === 1) {
return "teden";
} else if (c2 % 10 === 2 || Math.floor(c2) !== c2 && c2 % 100 <= 4) {
return "tedna";
} else if (c2 % 10 === 3 || c2 % 10 === 4) {
return "tedne";
} else {
return "tednov";
}
},
function(c2) {
return c2 % 100 === 1 ? "dan" : "dni";
},
function(c2) {
if (c2 % 10 === 1) {
return "ura";
} else if (c2 % 100 === 2) {
return "uri";
} else if (c2 % 10 === 3 || c2 % 10 === 4 || Math.floor(c2) !== c2) {
return "ure";
} else {
return "ur";
}
},
function(c2) {
if (c2 % 10 === 1) {
return "minuta";
} else if (c2 % 10 === 2) {
return "minuti";
} else if (c2 % 10 === 3 || c2 % 10 === 4 || Math.floor(c2) !== c2 && c2 % 100 <= 4) {
return "minute";
} else {
return "minut";
}
},
function(c2) {
if (c2 % 10 === 1) {
return "sekunda";
} else if (c2 % 100 === 2) {
return "sekundi";
} else if (c2 % 100 === 3 || c2 % 100 === 4 || Math.floor(c2) !== c2) {
return "sekunde";
} else {
return "sekund";
}
},
function(c2) {
if (c2 % 10 === 1) {
return "milisekunda";
} else if (c2 % 100 === 2) {
return "milisekundi";
} else if (c2 % 100 === 3 || c2 % 100 === 4 || Math.floor(c2) !== c2) {
return "milisekunde";
} else {
return "milisekund";
}
},
","
),
sv: language(
"år",
function(c2) {
return "månad" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "veck" + (c2 === 1 ? "a" : "or");
},
function(c2) {
return "dag" + (c2 === 1 ? "" : "ar");
},
function(c2) {
return "timm" + (c2 === 1 ? "e" : "ar");
},
function(c2) {
return "minut" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "sekund" + (c2 === 1 ? "" : "er");
},
function(c2) {
return "millisekund" + (c2 === 1 ? "" : "er");
},
","
),
sw: assign2(
language(
function(c2) {
return c2 === 1 ? "mwaka" : "miaka";
},
function(c2) {
return c2 === 1 ? "mwezi" : "miezi";
},
"wiki",
function(c2) {
return c2 === 1 ? "siku" : "masiku";
},
function(c2) {
return c2 === 1 ? "saa" : "masaa";
},
"dakika",
"sekunde",
"milisekunde"
),
{ _numberFirst: true }
),
tr: language(
"yıl",
"ay",
"hafta",
"gün",
"saat",
"dakika",
"saniye",
"milisaniye",
","
),
th: language(
"ปี",
"เดือน",
"สัปดาห์",
"วัน",
"ชั่วโมง",
"นาที",
"วินาที",
"มิลลิวินาที"
),
uz: language(
"yil",
"oy",
"hafta",
"kun",
"soat",
"minut",
"sekund",
"millisekund"
),
uz_CYR: language(
"йил",
"ой",
"ҳафта",
"кун",
"соат",
"минут",
"секунд",
"миллисекунд"
),
vi: language(
"năm",
"tháng",
"tuần",
"ngày",
"giờ",
"phút",
"giây",
"mili giây",
","
),
zh_CN: language("年", "个月", "周", "天", "小时", "分钟", "秒", "毫秒"),
zh_TW: language("年", "個月", "周", "天", "小時", "分鐘", "秒", "毫秒")
};
function language(y2, mo2, w2, d2, h2, m2, s2, ms, decimal) {
var result = { y: y2, mo: mo2, w: w2, d: d2, h: h2, m: m2, s: s2, ms };
if (typeof decimal !== "undefined") {
result.decimal = decimal;
}
return result;
}
function getArabicForm(c2) {
if (c2 === 2) {
return 1;
}
if (c2 > 2 && c2 < 11) {
return 2;
}
return 0;
}
function getPolishForm(c2) {
if (c2 === 1) {
return 0;
}
if (Math.floor(c2) !== c2) {
return 1;
}
if (c2 % 10 >= 2 && c2 % 10 <= 4 && !(c2 % 100 > 10 && c2 % 100 < 20)) {
return 2;
}
return 3;
}
function getSlavicForm(c2) {
if (Math.floor(c2) !== c2) {
return 2;
}
if (c2 % 100 >= 5 && c2 % 100 <= 20 || c2 % 10 >= 5 && c2 % 10 <= 9 || c2 % 10 === 0) {
return 0;
}
if (c2 % 10 === 1) {
return 1;
}
if (c2 > 1) {
return 2;
}
return 0;
}
function getCzechOrSlovakForm(c2) {
if (c2 === 1) {
return 0;
}
if (Math.floor(c2) !== c2) {
return 1;
}
if (c2 % 10 >= 2 && c2 % 10 <= 4 && c2 % 100 < 10) {
return 2;
}
return 3;
}
function getLithuanianForm(c2) {
if (c2 === 1 || c2 % 10 === 1 && c2 % 100 > 20) {
return 0;
}
if (Math.floor(c2) !== c2 || c2 % 10 >= 2 && c2 % 100 > 20 || c2 % 10 >= 2 && c2 % 100 < 10) {
return 1;
}
return 2;
}
function getLatvianForm(c2) {
return c2 % 10 === 1 && c2 % 100 !== 11;
}
function assign2(destination) {
var source2;
for (var i2 = 1; i2 < arguments.length; i2++) {
source2 = arguments[i2];
for (var prop in source2) {
if (has2(source2, prop)) {
destination[prop] = source2[prop];
}
}
}
return destination;
}
var isArray3 = Array.isArray || function(arg) {
return Object.prototype.toString.call(arg) === "[object Array]";
};
function has2(obj, key2) {
return Object.prototype.hasOwnProperty.call(obj, key2);
}
function getLanguage(options2) {
var possibleLanguages = [options2.language];
if (has2(options2, "fallbacks")) {
if (isArray3(options2.fallbacks) && options2.fallbacks.length) {
possibleLanguages = possibleLanguages.concat(options2.fallbacks);
} else {
throw new Error("fallbacks must be an array with at least one element");
}
}
for (var i2 = 0; i2 < possibleLanguages.length; i2++) {
var languageToTry = possibleLanguages[i2];
if (has2(options2.languages, languageToTry)) {
return options2.languages[languageToTry];
}
if (has2(LANGUAGES, languageToTry)) {
return LANGUAGES[languageToTry];
}
}
throw new Error("No language found.");
}
function renderPiece(piece, language2, options2) {
var unitName = piece.unitName;
var unitCount = piece.unitCount;
var spacer = options2.spacer;
var maxDecimalPoints = options2.maxDecimalPoints;
var decimal;
if (has2(options2, "decimal")) {
decimal = options2.decimal;
} else if (has2(language2, "decimal")) {
decimal = language2.decimal;
} else {
decimal = ".";
}
var digitReplacements;
if ("digitReplacements" in options2) {
digitReplacements = options2.digitReplacements;
} else if ("_digitReplacements" in language2) {
digitReplacements = language2._digitReplacements;
}
var formattedCount;
var normalizedUnitCount = maxDecimalPoints === void 0 ? unitCount : Math.floor(unitCount * Math.pow(10, maxDecimalPoints)) / Math.pow(10, maxDecimalPoints);
var countStr = normalizedUnitCount.toString();
if (digitReplacements) {
formattedCount = "";
for (var i2 = 0; i2 < countStr.length; i2++) {
var char2 = countStr[i2];
if (char2 === ".") {
formattedCount += decimal;
} else {
formattedCount += digitReplacements[char2];
}
}
} else {
formattedCount = countStr.replace(".", decimal);
}
var languageWord = language2[unitName];
var word;
if (typeof languageWord === "function") {
word = languageWord(unitCount);
} else {
word = languageWord;
}
if (language2._numberFirst) {
return word + spacer + formattedCount;
}
return formattedCount + spacer + word;
}
function getPieces(ms, options2) {
var unitName;
var i2;
var unitCount;
var msRemaining;
var units = options2.units;
var unitMeasures = options2.unitMeasures;
var largest = "largest" in options2 ? options2.largest : Infinity;
if (!units.length)
return [];
var unitCounts = {};
msRemaining = ms;
for (i2 = 0; i2 < units.length; i2++) {
unitName = units[i2];
var unitMs = unitMeasures[unitName];
var isLast = i2 === units.length - 1;
unitCount = isLast ? msRemaining / unitMs : Math.floor(msRemaining / unitMs);
unitCounts[unitName] = unitCount;
msRemaining -= unitCount * unitMs;
}
if (options2.round) {
var unitsRemainingBeforeRound = largest;
for (i2 = 0; i2 < units.length; i2++) {
unitName = units[i2];
unitCount = unitCounts[unitName];
if (unitCount === 0)
continue;
unitsRemainingBeforeRound--;
if (unitsRemainingBeforeRound === 0) {
for (var j2 = i2 + 1; j2 < units.length; j2++) {
var smallerUnitName = units[j2];
var smallerUnitCount = unitCounts[smallerUnitName];
unitCounts[unitName] += smallerUnitCount * unitMeasures[smallerUnitName] / unitMeasures[unitName];
unitCounts[smallerUnitName] = 0;
}
break;
}
}
for (i2 = units.length - 1; i2 >= 0; i2--) {
unitName = units[i2];
unitCount = unitCounts[unitName];
if (unitCount === 0)
continue;
var rounded = Math.round(unitCount);
unitCounts[unitName] = rounded;
if (i2 === 0)
break;
var previousUnitName = units[i2 - 1];
var previousUnitMs = unitMeasures[previousUnitName];
var amountOfPreviousUnit = Math.floor(
rounded * unitMeasures[unitName] / previousUnitMs
);
if (amountOfPreviousUnit) {
unitCounts[previousUnitName] += amountOfPreviousUnit;
unitCounts[unitName] = 0;
} else {
break;
}
}
}
var result = [];
for (i2 = 0; i2 < units.length && result.length < largest; i2++) {
unitName = units[i2];
unitCount = unitCounts[unitName];
if (unitCount) {
result.push({ unitName, unitCount });
}
}
return result;
}
function formatPieces(pieces, options2) {
var language2 = getLanguage(options2);
if (!pieces.length) {
var units = options2.units;
var smallestUnitName = units[units.length - 1];
return renderPiece(
{ unitName: smallestUnitName, unitCount: 0 },
language2,
options2
);
}
var conjunction = options2.conjunction;
var serialComma = options2.serialComma;
var delimiter2;
if (has2(options2, "delimiter")) {
delimiter2 = options2.delimiter;
} else if (has2(language2, "delimiter")) {
delimiter2 = language2.delimiter;
} else {
delimiter2 = ", ";
}
var renderedPieces = [];
for (var i2 = 0; i2 < pieces.length; i2++) {
renderedPieces.push(renderPiece(pieces[i2], language2, options2));
}
if (!conjunction || pieces.length === 1) {
return renderedPieces.join(delimiter2);
}
if (pieces.length === 2) {
return renderedPieces.join(conjunction);
}
return renderedPieces.slice(0, -1).join(delimiter2) + (serialComma ? "," : "") + conjunction + renderedPieces.slice(-1);
}
function humanizer(passedOptions) {
var result = function humanizer2(ms, humanizerOptions) {
ms = Math.abs(ms);
var options2 = assign2({}, result, humanizerOptions || {});
var pieces = getPieces(ms, options2);
return formatPieces(pieces, options2);
};
return assign2(
result,
{
language: "en",
spacer: " ",
conjunction: "",
serialComma: true,
units: ["y", "mo", "w", "d", "h", "m", "s"],
languages: {},
round: false,
unitMeasures: {
y: 315576e5,
mo: 26298e5,
w: 6048e5,
d: 864e5,
h: 36e5,
m: 6e4,
s: 1e3,
ms: 1
}
},
passedOptions
);
}
var humanizeDuration2 = humanizer({});
humanizeDuration2.getSupportedLanguages = function getSupportedLanguages() {
var result = [];
for (var language2 in LANGUAGES) {
if (has2(LANGUAGES, language2) && language2 !== "gr") {
result.push(language2);
}
}
return result;
};
humanizeDuration2.humanizer = humanizer;
if (module.exports) {
module.exports = humanizeDuration2;
} else {
this.humanizeDuration = humanizeDuration2;
}
})();
})(humanizeDuration$1);
var humanizeDurationExports = humanizeDuration$1.exports;
const humanizeDuration = /* @__PURE__ */ getDefaultExportFromCjs(humanizeDurationExports);
function _toArray(arr2) {
return _arrayWithHoles$2(arr2) || _iterableToArray$2(arr2) || _unsupportedIterableToArray$3(arr2) || _nonIterableRest$2();
}
function ownKeys$6$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$6$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$6$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$6$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
var consoleLogger = {
type: "logger",
log: function log(args) {
this.output("log", args);
},
warn: function warn(args) {
this.output("warn", args);
},
error: function error(args) {
this.output("error", args);
},
output: function output(type2, args) {
if (console && console[type2])
console[type2].apply(console, args);
}
};
var Logger$1 = function() {
function Logger2(concreteLogger) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck$1(this, Logger2);
this.init(concreteLogger, options2);
}
_createClass(Logger2, [{
key: "init",
value: function init3(concreteLogger) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
this.prefix = options2.prefix || "i18next:";
this.logger = concreteLogger || consoleLogger;
this.options = options2;
this.debug = options2.debug;
}
}, {
key: "setDebug",
value: function setDebug(bool) {
this.debug = bool;
}
}, {
key: "log",
value: function log3() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return this.forward(args, "log", "", true);
}
}, {
key: "warn",
value: function warn3() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return this.forward(args, "warn", "", true);
}
}, {
key: "error",
value: function error3() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return this.forward(args, "error", "");
}
}, {
key: "deprecate",
value: function deprecate() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return this.forward(args, "warn", "WARNING DEPRECATED: ", true);
}
}, {
key: "forward",
value: function forward(args, lvl, prefix2, debugOnly) {
if (debugOnly && !this.debug)
return null;
if (typeof args[0] === "string")
args[0] = "".concat(prefix2).concat(this.prefix, " ").concat(args[0]);
return this.logger[lvl](args);
}
}, {
key: "create",
value: function create4(moduleName) {
return new Logger2(this.logger, _objectSpread$6$1(_objectSpread$6$1({}, {
prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
}), this.options));
}
}, {
key: "clone",
value: function clone2(options2) {
options2 = options2 || this.options;
options2.prefix = options2.prefix || this.prefix;
return new Logger2(this.logger, options2);
}
}]);
return Logger2;
}();
var baseLogger = new Logger$1();
var EventEmitter = function() {
function EventEmitter2() {
_classCallCheck$1(this, EventEmitter2);
this.observers = {};
}
_createClass(EventEmitter2, [{
key: "on",
value: function on2(events2, listener2) {
var _this = this;
events2.split(" ").forEach(function(event2) {
_this.observers[event2] = _this.observers[event2] || [];
_this.observers[event2].push(listener2);
});
return this;
}
}, {
key: "off",
value: function off(event2, listener2) {
if (!this.observers[event2])
return;
if (!listener2) {
delete this.observers[event2];
return;
}
this.observers[event2] = this.observers[event2].filter(function(l2) {
return l2 !== listener2;
});
}
}, {
key: "emit",
value: function emit2(event2) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (this.observers[event2]) {
var cloned = [].concat(this.observers[event2]);
cloned.forEach(function(observer) {
observer.apply(void 0, args);
});
}
if (this.observers["*"]) {
var _cloned = [].concat(this.observers["*"]);
_cloned.forEach(function(observer) {
observer.apply(observer, [event2].concat(args));
});
}
}
}]);
return EventEmitter2;
}();
function defer$1() {
var res;
var rej;
var promise2 = new Promise(function(resolve3, reject2) {
res = resolve3;
rej = reject2;
});
promise2.resolve = res;
promise2.reject = rej;
return promise2;
}
function makeString(object2) {
if (object2 == null)
return "";
return "" + object2;
}
function copy$5(a2, s2, t5) {
a2.forEach(function(m2) {
if (s2[m2])
t5[m2] = s2[m2];
});
}
function getLastOfPath(object2, path2, Empty2) {
function cleanKey(key3) {
return key3 && key3.indexOf("###") > -1 ? key3.replace(/###/g, ".") : key3;
}
function canNotTraverseDeeper() {
return !object2 || typeof object2 === "string";
}
var stack = typeof path2 !== "string" ? [].concat(path2) : path2.split(".");
while (stack.length > 1) {
if (canNotTraverseDeeper())
return {};
var key2 = cleanKey(stack.shift());
if (!object2[key2] && Empty2)
object2[key2] = new Empty2();
if (Object.prototype.hasOwnProperty.call(object2, key2)) {
object2 = object2[key2];
} else {
object2 = {};
}
}
if (canNotTraverseDeeper())
return {};
return {
obj: object2,
k: cleanKey(stack.shift())
};
}
function setPath(object2, path2, newValue) {
var _getLastOfPath = getLastOfPath(object2, path2, Object), obj = _getLastOfPath.obj, k2 = _getLastOfPath.k;
obj[k2] = newValue;
}
function pushPath(object2, path2, newValue, concat2) {
var _getLastOfPath2 = getLastOfPath(object2, path2, Object), obj = _getLastOfPath2.obj, k2 = _getLastOfPath2.k;
obj[k2] = obj[k2] || [];
if (concat2)
obj[k2] = obj[k2].concat(newValue);
if (!concat2)
obj[k2].push(newValue);
}
function getPath(object2, path2) {
var _getLastOfPath3 = getLastOfPath(object2, path2), obj = _getLastOfPath3.obj, k2 = _getLastOfPath3.k;
if (!obj)
return void 0;
return obj[k2];
}
function getPathWithDefaults(data2, defaultData2, key2) {
var value2 = getPath(data2, key2);
if (value2 !== void 0) {
return value2;
}
return getPath(defaultData2, key2);
}
function deepExtend(target2, source2, overwrite) {
for (var prop in source2) {
if (prop !== "__proto__" && prop !== "constructor") {
if (prop in target2) {
if (typeof target2[prop] === "string" || target2[prop] instanceof String || typeof source2[prop] === "string" || source2[prop] instanceof String) {
if (overwrite)
target2[prop] = source2[prop];
} else {
deepExtend(target2[prop], source2[prop], overwrite);
}
} else {
target2[prop] = source2[prop];
}
}
}
return target2;
}
function regexEscape(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var _entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"/": "/"
};
function escape(data2) {
if (typeof data2 === "string") {
return data2.replace(/[&<>"'\/]/g, function(s2) {
return _entityMap[s2];
});
}
return data2;
}
var isIE10 = typeof window !== "undefined" && window.navigator && typeof window.navigator.userAgentData === "undefined" && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1;
var chars$5 = [" ", ",", "?", "!", ";"];
function looksLikeObjectPath(key2, nsSeparator, keySeparator) {
nsSeparator = nsSeparator || "";
keySeparator = keySeparator || "";
var possibleChars = chars$5.filter(function(c2) {
return nsSeparator.indexOf(c2) < 0 && keySeparator.indexOf(c2) < 0;
});
if (possibleChars.length === 0)
return true;
var r2 = new RegExp("(".concat(possibleChars.map(function(c2) {
return c2 === "?" ? "\\?" : c2;
}).join("|"), ")"));
var matched = !r2.test(key2);
if (!matched) {
var ki2 = key2.indexOf(keySeparator);
if (ki2 > 0 && !r2.test(key2.substring(0, ki2))) {
matched = true;
}
}
return matched;
}
function deepFind(obj, path2) {
var keySeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
if (!obj)
return void 0;
if (obj[path2])
return obj[path2];
var paths = path2.split(keySeparator);
var current = obj;
for (var i2 = 0; i2 < paths.length; ++i2) {
if (!current)
return void 0;
if (typeof current[paths[i2]] === "string" && i2 + 1 < paths.length) {
return void 0;
}
if (current[paths[i2]] === void 0) {
var j2 = 2;
var p2 = paths.slice(i2, i2 + j2).join(keySeparator);
var mix = current[p2];
while (mix === void 0 && paths.length > i2 + j2) {
j2++;
p2 = paths.slice(i2, i2 + j2).join(keySeparator);
mix = current[p2];
}
if (mix === void 0)
return void 0;
if (mix === null)
return null;
if (path2.endsWith(p2)) {
if (typeof mix === "string")
return mix;
if (p2 && typeof mix[p2] === "string")
return mix[p2];
}
var joinedPath = paths.slice(i2 + j2).join(keySeparator);
if (joinedPath)
return deepFind(mix, joinedPath, keySeparator);
return void 0;
}
current = current[paths[i2]];
}
return current;
}
function ownKeys$5$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$5$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$5$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$5$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _createSuper$3(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct$3();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _isNativeReflectConstruct$3() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
var ResourceStore = function(_EventEmitter) {
_inherits(ResourceStore2, _EventEmitter);
var _super = _createSuper$3(ResourceStore2);
function ResourceStore2(data2) {
var _this;
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
ns: ["translation"],
defaultNS: "translation"
};
_classCallCheck$1(this, ResourceStore2);
_this = _super.call(this);
if (isIE10) {
EventEmitter.call(_assertThisInitialized(_this));
}
_this.data = data2 || {};
_this.options = options2;
if (_this.options.keySeparator === void 0) {
_this.options.keySeparator = ".";
}
if (_this.options.ignoreJSONStructure === void 0) {
_this.options.ignoreJSONStructure = true;
}
return _this;
}
_createClass(ResourceStore2, [{
key: "addNamespaces",
value: function addNamespaces(ns) {
if (this.options.ns.indexOf(ns) < 0) {
this.options.ns.push(ns);
}
}
}, {
key: "removeNamespaces",
value: function removeNamespaces(ns) {
var index2 = this.options.ns.indexOf(ns);
if (index2 > -1) {
this.options.ns.splice(index2, 1);
}
}
}, {
key: "getResource",
value: function getResource(lng, ns, key2) {
var options2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
var keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator;
var ignoreJSONStructure = options2.ignoreJSONStructure !== void 0 ? options2.ignoreJSONStructure : this.options.ignoreJSONStructure;
var path2 = [lng, ns];
if (key2 && typeof key2 !== "string")
path2 = path2.concat(key2);
if (key2 && typeof key2 === "string")
path2 = path2.concat(keySeparator ? key2.split(keySeparator) : key2);
if (lng.indexOf(".") > -1) {
path2 = lng.split(".");
}
var result = getPath(this.data, path2);
if (result || !ignoreJSONStructure || typeof key2 !== "string")
return result;
return deepFind(this.data && this.data[lng] && this.data[lng][ns], key2, keySeparator);
}
}, {
key: "addResource",
value: function addResource(lng, ns, key2, value2) {
var options2 = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
silent: false
};
var keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator;
var path2 = [lng, ns];
if (key2)
path2 = path2.concat(keySeparator ? key2.split(keySeparator) : key2);
if (lng.indexOf(".") > -1) {
path2 = lng.split(".");
value2 = ns;
ns = path2[1];
}
this.addNamespaces(ns);
setPath(this.data, path2, value2);
if (!options2.silent)
this.emit("added", lng, ns, key2, value2);
}
}, {
key: "addResources",
value: function addResources(lng, ns, resources) {
var options2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
silent: false
};
for (var m2 in resources) {
if (typeof resources[m2] === "string" || Object.prototype.toString.apply(resources[m2]) === "[object Array]")
this.addResource(lng, ns, m2, resources[m2], {
silent: true
});
}
if (!options2.silent)
this.emit("added", lng, ns, resources);
}
}, {
key: "addResourceBundle",
value: function addResourceBundle(lng, ns, resources, deep, overwrite) {
var options2 = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
silent: false
};
var path2 = [lng, ns];
if (lng.indexOf(".") > -1) {
path2 = lng.split(".");
deep = resources;
resources = ns;
ns = path2[1];
}
this.addNamespaces(ns);
var pack2 = getPath(this.data, path2) || {};
if (deep) {
deepExtend(pack2, resources, overwrite);
} else {
pack2 = _objectSpread$5$1(_objectSpread$5$1({}, pack2), resources);
}
setPath(this.data, path2, pack2);
if (!options2.silent)
this.emit("added", lng, ns, resources);
}
}, {
key: "removeResourceBundle",
value: function removeResourceBundle(lng, ns) {
if (this.hasResourceBundle(lng, ns)) {
delete this.data[lng][ns];
}
this.removeNamespaces(ns);
this.emit("removed", lng, ns);
}
}, {
key: "hasResourceBundle",
value: function hasResourceBundle(lng, ns) {
return this.getResource(lng, ns) !== void 0;
}
}, {
key: "getResourceBundle",
value: function getResourceBundle(lng, ns) {
if (!ns)
ns = this.options.defaultNS;
if (this.options.compatibilityAPI === "v1")
return _objectSpread$5$1(_objectSpread$5$1({}, {}), this.getResource(lng, ns));
return this.getResource(lng, ns);
}
}, {
key: "getDataByLanguage",
value: function getDataByLanguage(lng) {
return this.data[lng];
}
}, {
key: "hasLanguageSomeTranslations",
value: function hasLanguageSomeTranslations(lng) {
var data2 = this.getDataByLanguage(lng);
var n2 = data2 && Object.keys(data2) || [];
return !!n2.find(function(v2) {
return data2[v2] && Object.keys(data2[v2]).length > 0;
});
}
}, {
key: "toJSON",
value: function toJSON() {
return this.data;
}
}]);
return ResourceStore2;
}(EventEmitter);
var postProcessor = {
processors: {},
addPostProcessor: function addPostProcessor(module) {
this.processors[module.name] = module;
},
handle: function handle(processors, value2, key2, options2, translator) {
var _this = this;
processors.forEach(function(processor) {
if (_this.processors[processor])
value2 = _this.processors[processor].process(value2, key2, options2, translator);
});
return value2;
}
};
function ownKeys$4$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$4$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$4$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$4$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _createSuper$2(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct$2();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _isNativeReflectConstruct$2() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
var checkedLoadedFor = {};
var Translator = function(_EventEmitter) {
_inherits(Translator2, _EventEmitter);
var _super = _createSuper$2(Translator2);
function Translator2(services) {
var _this;
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck$1(this, Translator2);
_this = _super.call(this);
if (isIE10) {
EventEmitter.call(_assertThisInitialized(_this));
}
copy$5(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], services, _assertThisInitialized(_this));
_this.options = options2;
if (_this.options.keySeparator === void 0) {
_this.options.keySeparator = ".";
}
_this.logger = baseLogger.create("translator");
return _this;
}
_createClass(Translator2, [{
key: "changeLanguage",
value: function changeLanguage(lng) {
if (lng)
this.language = lng;
}
}, {
key: "exists",
value: function exists(key2) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
interpolation: {}
};
if (key2 === void 0 || key2 === null) {
return false;
}
var resolved = this.resolve(key2, options2);
return resolved && resolved.res !== void 0;
}
}, {
key: "extractFromKey",
value: function extractFromKey(key2, options2) {
var nsSeparator = options2.nsSeparator !== void 0 ? options2.nsSeparator : this.options.nsSeparator;
if (nsSeparator === void 0)
nsSeparator = ":";
var keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator;
var namespaces = options2.ns || this.options.defaultNS || [];
var wouldCheckForNsInKey = nsSeparator && key2.indexOf(nsSeparator) > -1;
var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options2.keySeparator && !this.options.userDefinedNsSeparator && !options2.nsSeparator && !looksLikeObjectPath(key2, nsSeparator, keySeparator);
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
var m2 = key2.match(this.interpolator.nestingRegexp);
if (m2 && m2.length > 0) {
return {
key: key2,
namespaces
};
}
var parts2 = key2.split(nsSeparator);
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts2[0]) > -1)
namespaces = parts2.shift();
key2 = parts2.join(keySeparator);
}
if (typeof namespaces === "string")
namespaces = [namespaces];
return {
key: key2,
namespaces
};
}
}, {
key: "translate",
value: function translate2(keys3, options2, lastKey) {
var _this2 = this;
if (_typeof$3(options2) !== "object" && this.options.overloadTranslationOptionHandler) {
options2 = this.options.overloadTranslationOptionHandler(arguments);
}
if (_typeof$3(options2) === "object")
options2 = _objectSpread$4$1({}, options2);
if (!options2)
options2 = {};
if (keys3 === void 0 || keys3 === null)
return "";
if (!Array.isArray(keys3))
keys3 = [String(keys3)];
var returnDetails = options2.returnDetails !== void 0 ? options2.returnDetails : this.options.returnDetails;
var keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator;
var _this$extractFromKey = this.extractFromKey(keys3[keys3.length - 1], options2), key2 = _this$extractFromKey.key, namespaces = _this$extractFromKey.namespaces;
var namespace = namespaces[namespaces.length - 1];
var lng = options2.lng || this.language;
var appendNamespaceToCIMode = options2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
if (lng && lng.toLowerCase() === "cimode") {
if (appendNamespaceToCIMode) {
var nsSeparator = options2.nsSeparator || this.options.nsSeparator;
if (returnDetails) {
return {
res: "".concat(namespace).concat(nsSeparator).concat(key2),
usedKey: key2,
exactUsedKey: key2,
usedLng: lng,
usedNS: namespace
};
}
return "".concat(namespace).concat(nsSeparator).concat(key2);
}
if (returnDetails) {
return {
res: key2,
usedKey: key2,
exactUsedKey: key2,
usedLng: lng,
usedNS: namespace
};
}
return key2;
}
var resolved = this.resolve(keys3, options2);
var res = resolved && resolved.res;
var resUsedKey = resolved && resolved.usedKey || key2;
var resExactUsedKey = resolved && resolved.exactUsedKey || key2;
var resType = Object.prototype.toString.apply(res);
var noObject = ["[object Number]", "[object Function]", "[object RegExp]"];
var joinArrays = options2.joinArrays !== void 0 ? options2.joinArrays : this.options.joinArrays;
var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
var handleAsObject = typeof res !== "string" && typeof res !== "boolean" && typeof res !== "number";
if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === "string" && resType === "[object Array]")) {
if (!options2.returnObjects && !this.options.returnObjects) {
if (!this.options.returnedObjectHandler) {
this.logger.warn("accessing an object - but returnObjects options is not enabled!");
}
var r2 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$4$1(_objectSpread$4$1({}, options2), {}, {
ns: namespaces
})) : "key '".concat(key2, " (").concat(this.language, ")' returned an object instead of string.");
if (returnDetails) {
resolved.res = r2;
return resolved;
}
return r2;
}
if (keySeparator) {
var resTypeIsArray = resType === "[object Array]";
var copy2 = resTypeIsArray ? [] : {};
var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
for (var m2 in res) {
if (Object.prototype.hasOwnProperty.call(res, m2)) {
var deepKey = "".concat(newKeyToUse).concat(keySeparator).concat(m2);
copy2[m2] = this.translate(deepKey, _objectSpread$4$1(_objectSpread$4$1({}, options2), {
joinArrays: false,
ns: namespaces
}));
if (copy2[m2] === deepKey)
copy2[m2] = res[m2];
}
}
res = copy2;
}
} else if (handleAsObjectInI18nFormat && typeof joinArrays === "string" && resType === "[object Array]") {
res = res.join(joinArrays);
if (res)
res = this.extendTranslation(res, keys3, options2, lastKey);
} else {
var usedDefault = false;
var usedKey = false;
var needsPluralHandling = options2.count !== void 0 && typeof options2.count !== "string";
var hasDefaultValue = Translator2.hasDefaultValue(options2);
var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options2.count, options2) : "";
var defaultValue2 = options2["defaultValue".concat(defaultValueSuffix)] || options2.defaultValue;
if (!this.isValidLookup(res) && hasDefaultValue) {
usedDefault = true;
res = defaultValue2;
}
if (!this.isValidLookup(res)) {
usedKey = true;
res = key2;
}
var missingKeyNoValueFallbackToKey = options2.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? void 0 : res;
var updateMissing = hasDefaultValue && defaultValue2 !== res && this.options.updateMissing;
if (usedKey || usedDefault || updateMissing) {
this.logger.log(updateMissing ? "updateKey" : "missingKey", lng, namespace, key2, updateMissing ? defaultValue2 : res);
if (keySeparator) {
var fk2 = this.resolve(key2, _objectSpread$4$1(_objectSpread$4$1({}, options2), {}, {
keySeparator: false
}));
if (fk2 && fk2.res)
this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
}
var lngs = [];
var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options2.lng || this.language);
if (this.options.saveMissingTo === "fallback" && fallbackLngs && fallbackLngs[0]) {
for (var i2 = 0; i2 < fallbackLngs.length; i2++) {
lngs.push(fallbackLngs[i2]);
}
} else if (this.options.saveMissingTo === "all") {
lngs = this.languageUtils.toResolveHierarchy(options2.lng || this.language);
} else {
lngs.push(options2.lng || this.language);
}
var send = function send2(l2, k2, specificDefaultValue) {
var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
if (_this2.options.missingKeyHandler) {
_this2.options.missingKeyHandler(l2, namespace, k2, defaultForMissing, updateMissing, options2);
} else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {
_this2.backendConnector.saveMissing(l2, namespace, k2, defaultForMissing, updateMissing, options2);
}
_this2.emit("missingKey", l2, namespace, k2, res);
};
if (this.options.saveMissing) {
if (this.options.saveMissingPlurals && needsPluralHandling) {
lngs.forEach(function(language) {
_this2.pluralResolver.getSuffixes(language, options2).forEach(function(suffix2) {
send([language], key2 + suffix2, options2["defaultValue".concat(suffix2)] || defaultValue2);
});
});
} else {
send(lngs, key2, defaultValue2);
}
}
}
res = this.extendTranslation(res, keys3, options2, resolved, lastKey);
if (usedKey && res === key2 && this.options.appendNamespaceToMissingKey)
res = "".concat(namespace, ":").concat(key2);
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
if (this.options.compatibilityAPI !== "v1") {
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(namespace, ":").concat(key2) : key2, usedDefault ? res : void 0);
} else {
res = this.options.parseMissingKeyHandler(res);
}
}
}
if (returnDetails) {
resolved.res = res;
return resolved;
}
return res;
}
}, {
key: "extendTranslation",
value: function extendTranslation(res, key2, options2, resolved, lastKey) {
var _this3 = this;
if (this.i18nFormat && this.i18nFormat.parse) {
res = this.i18nFormat.parse(res, _objectSpread$4$1(_objectSpread$4$1({}, this.options.interpolation.defaultVariables), options2), resolved.usedLng, resolved.usedNS, resolved.usedKey, {
resolved
});
} else if (!options2.skipInterpolation) {
if (options2.interpolation)
this.interpolator.init(_objectSpread$4$1(_objectSpread$4$1({}, options2), {
interpolation: _objectSpread$4$1(_objectSpread$4$1({}, this.options.interpolation), options2.interpolation)
}));
var skipOnVariables = typeof res === "string" && (options2 && options2.interpolation && options2.interpolation.skipOnVariables !== void 0 ? options2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
var nestBef;
if (skipOnVariables) {
var nb2 = res.match(this.interpolator.nestingRegexp);
nestBef = nb2 && nb2.length;
}
var data2 = options2.replace && typeof options2.replace !== "string" ? options2.replace : options2;
if (this.options.interpolation.defaultVariables)
data2 = _objectSpread$4$1(_objectSpread$4$1({}, this.options.interpolation.defaultVariables), data2);
res = this.interpolator.interpolate(res, data2, options2.lng || this.language, options2);
if (skipOnVariables) {
var na2 = res.match(this.interpolator.nestingRegexp);
var nestAft = na2 && na2.length;
if (nestBef < nestAft)
options2.nest = false;
}
if (!options2.lng && this.options.compatibilityAPI !== "v1" && resolved && resolved.res)
options2.lng = resolved.usedLng;
if (options2.nest !== false)
res = this.interpolator.nest(res, function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (lastKey && lastKey[0] === args[0] && !options2.context) {
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key2[0]));
return null;
}
return _this3.translate.apply(_this3, args.concat([key2]));
}, options2);
if (options2.interpolation)
this.interpolator.reset();
}
var postProcess = options2.postProcess || this.options.postProcess;
var postProcessorNames = typeof postProcess === "string" ? [postProcess] : postProcess;
if (res !== void 0 && res !== null && postProcessorNames && postProcessorNames.length && options2.applyPostProcessor !== false) {
res = postProcessor.handle(postProcessorNames, res, key2, this.options && this.options.postProcessPassResolved ? _objectSpread$4$1({
i18nResolved: resolved
}, options2) : options2, this);
}
return res;
}
}, {
key: "resolve",
value: function resolve3(keys3) {
var _this4 = this;
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var found;
var usedKey;
var exactUsedKey;
var usedLng;
var usedNS;
if (typeof keys3 === "string")
keys3 = [keys3];
keys3.forEach(function(k2) {
if (_this4.isValidLookup(found))
return;
var extracted = _this4.extractFromKey(k2, options2);
var key2 = extracted.key;
usedKey = key2;
var namespaces = extracted.namespaces;
if (_this4.options.fallbackNS)
namespaces = namespaces.concat(_this4.options.fallbackNS);
var needsPluralHandling = options2.count !== void 0 && typeof options2.count !== "string";
var needsZeroSuffixLookup = needsPluralHandling && !options2.ordinal && options2.count === 0 && _this4.pluralResolver.shouldUseIntlApi();
var needsContextHandling = options2.context !== void 0 && (typeof options2.context === "string" || typeof options2.context === "number") && options2.context !== "";
var codes = options2.lngs ? options2.lngs : _this4.languageUtils.toResolveHierarchy(options2.lng || _this4.language, options2.fallbackLng);
namespaces.forEach(function(ns) {
if (_this4.isValidLookup(found))
return;
usedNS = ns;
if (!checkedLoadedFor["".concat(codes[0], "-").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {
checkedLoadedFor["".concat(codes[0], "-").concat(ns)] = true;
_this4.logger.warn('key "'.concat(usedKey, '" for languages "').concat(codes.join(", "), `" won't get resolved as namespace "`).concat(usedNS, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
}
codes.forEach(function(code) {
if (_this4.isValidLookup(found))
return;
usedLng = code;
var finalKeys = [key2];
if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {
_this4.i18nFormat.addLookupKeys(finalKeys, key2, code, ns, options2);
} else {
var pluralSuffix;
if (needsPluralHandling)
pluralSuffix = _this4.pluralResolver.getSuffix(code, options2.count, options2);
var zeroSuffix = "".concat(_this4.options.pluralSeparator, "zero");
if (needsPluralHandling) {
finalKeys.push(key2 + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(key2 + zeroSuffix);
}
}
if (needsContextHandling) {
var contextKey = "".concat(key2).concat(_this4.options.contextSeparator).concat(options2.context);
finalKeys.push(contextKey);
if (needsPluralHandling) {
finalKeys.push(contextKey + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(contextKey + zeroSuffix);
}
}
}
}
var possibleKey;
while (possibleKey = finalKeys.pop()) {
if (!_this4.isValidLookup(found)) {
exactUsedKey = possibleKey;
found = _this4.getResource(code, ns, possibleKey, options2);
}
}
});
});
});
return {
res: found,
usedKey,
exactUsedKey,
usedLng,
usedNS
};
}
}, {
key: "isValidLookup",
value: function isValidLookup(res) {
return res !== void 0 && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === "");
}
}, {
key: "getResource",
value: function getResource(code, ns, key2) {
var options2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
if (this.i18nFormat && this.i18nFormat.getResource)
return this.i18nFormat.getResource(code, ns, key2, options2);
return this.resourceStore.getResource(code, ns, key2, options2);
}
}], [{
key: "hasDefaultValue",
value: function hasDefaultValue(options2) {
var prefix2 = "defaultValue";
for (var option in options2) {
if (Object.prototype.hasOwnProperty.call(options2, option) && prefix2 === option.substring(0, prefix2.length) && void 0 !== options2[option]) {
return true;
}
}
return false;
}
}]);
return Translator2;
}(EventEmitter);
function capitalize$2(string2) {
return string2.charAt(0).toUpperCase() + string2.slice(1);
}
var LanguageUtil = function() {
function LanguageUtil2(options2) {
_classCallCheck$1(this, LanguageUtil2);
this.options = options2;
this.supportedLngs = this.options.supportedLngs || false;
this.logger = baseLogger.create("languageUtils");
}
_createClass(LanguageUtil2, [{
key: "getScriptPartFromCode",
value: function getScriptPartFromCode(code) {
if (!code || code.indexOf("-") < 0)
return null;
var p2 = code.split("-");
if (p2.length === 2)
return null;
p2.pop();
if (p2[p2.length - 1].toLowerCase() === "x")
return null;
return this.formatLanguageCode(p2.join("-"));
}
}, {
key: "getLanguagePartFromCode",
value: function getLanguagePartFromCode(code) {
if (!code || code.indexOf("-") < 0)
return code;
var p2 = code.split("-");
return this.formatLanguageCode(p2[0]);
}
}, {
key: "formatLanguageCode",
value: function formatLanguageCode(code) {
if (typeof code === "string" && code.indexOf("-") > -1) {
var specialCases = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
var p2 = code.split("-");
if (this.options.lowerCaseLng) {
p2 = p2.map(function(part) {
return part.toLowerCase();
});
} else if (p2.length === 2) {
p2[0] = p2[0].toLowerCase();
p2[1] = p2[1].toUpperCase();
if (specialCases.indexOf(p2[1].toLowerCase()) > -1)
p2[1] = capitalize$2(p2[1].toLowerCase());
} else if (p2.length === 3) {
p2[0] = p2[0].toLowerCase();
if (p2[1].length === 2)
p2[1] = p2[1].toUpperCase();
if (p2[0] !== "sgn" && p2[2].length === 2)
p2[2] = p2[2].toUpperCase();
if (specialCases.indexOf(p2[1].toLowerCase()) > -1)
p2[1] = capitalize$2(p2[1].toLowerCase());
if (specialCases.indexOf(p2[2].toLowerCase()) > -1)
p2[2] = capitalize$2(p2[2].toLowerCase());
}
return p2.join("-");
}
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
}
}, {
key: "isSupportedCode",
value: function isSupportedCode(code) {
if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) {
code = this.getLanguagePartFromCode(code);
}
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
}
}, {
key: "getBestMatchFromCodes",
value: function getBestMatchFromCodes(codes) {
var _this = this;
if (!codes)
return null;
var found;
codes.forEach(function(code) {
if (found)
return;
var cleanedLng = _this.formatLanguageCode(code);
if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng))
found = cleanedLng;
});
if (!found && this.options.supportedLngs) {
codes.forEach(function(code) {
if (found)
return;
var lngOnly = _this.getLanguagePartFromCode(code);
if (_this.isSupportedCode(lngOnly))
return found = lngOnly;
found = _this.options.supportedLngs.find(function(supportedLng) {
if (supportedLng === lngOnly)
return supportedLng;
if (supportedLng.indexOf("-") < 0 && lngOnly.indexOf("-") < 0)
return;
if (supportedLng.indexOf(lngOnly) === 0)
return supportedLng;
});
});
}
if (!found)
found = this.getFallbackCodes(this.options.fallbackLng)[0];
return found;
}
}, {
key: "getFallbackCodes",
value: function getFallbackCodes(fallbacks, code) {
if (!fallbacks)
return [];
if (typeof fallbacks === "function")
fallbacks = fallbacks(code);
if (typeof fallbacks === "string")
fallbacks = [fallbacks];
if (Object.prototype.toString.apply(fallbacks) === "[object Array]")
return fallbacks;
if (!code)
return fallbacks["default"] || [];
var found = fallbacks[code];
if (!found)
found = fallbacks[this.getScriptPartFromCode(code)];
if (!found)
found = fallbacks[this.formatLanguageCode(code)];
if (!found)
found = fallbacks[this.getLanguagePartFromCode(code)];
if (!found)
found = fallbacks["default"];
return found || [];
}
}, {
key: "toResolveHierarchy",
value: function toResolveHierarchy(code, fallbackCode) {
var _this2 = this;
var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
var codes = [];
var addCode = function addCode2(c2) {
if (!c2)
return;
if (_this2.isSupportedCode(c2)) {
codes.push(c2);
} else {
_this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c2));
}
};
if (typeof code === "string" && code.indexOf("-") > -1) {
if (this.options.load !== "languageOnly")
addCode(this.formatLanguageCode(code));
if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly")
addCode(this.getScriptPartFromCode(code));
if (this.options.load !== "currentOnly")
addCode(this.getLanguagePartFromCode(code));
} else if (typeof code === "string") {
addCode(this.formatLanguageCode(code));
}
fallbackCodes.forEach(function(fc2) {
if (codes.indexOf(fc2) < 0)
addCode(_this2.formatLanguageCode(fc2));
});
return codes;
}
}]);
return LanguageUtil2;
}();
var sets = [{
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
nr: [1, 2],
fc: 1
}, {
lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
nr: [1, 2],
fc: 2
}, {
lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
nr: [1],
fc: 3
}, {
lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
nr: [1, 2, 5],
fc: 4
}, {
lngs: ["ar"],
nr: [0, 1, 2, 3, 11, 100],
fc: 5
}, {
lngs: ["cs", "sk"],
nr: [1, 2, 5],
fc: 6
}, {
lngs: ["csb", "pl"],
nr: [1, 2, 5],
fc: 7
}, {
lngs: ["cy"],
nr: [1, 2, 3, 8],
fc: 8
}, {
lngs: ["fr"],
nr: [1, 2],
fc: 9
}, {
lngs: ["ga"],
nr: [1, 2, 3, 7, 11],
fc: 10
}, {
lngs: ["gd"],
nr: [1, 2, 3, 20],
fc: 11
}, {
lngs: ["is"],
nr: [1, 2],
fc: 12
}, {
lngs: ["jv"],
nr: [0, 1],
fc: 13
}, {
lngs: ["kw"],
nr: [1, 2, 3, 4],
fc: 14
}, {
lngs: ["lt"],
nr: [1, 2, 10],
fc: 15
}, {
lngs: ["lv"],
nr: [1, 2, 0],
fc: 16
}, {
lngs: ["mk"],
nr: [1, 2],
fc: 17
}, {
lngs: ["mnk"],
nr: [0, 1, 2],
fc: 18
}, {
lngs: ["mt"],
nr: [1, 2, 11, 20],
fc: 19
}, {
lngs: ["or"],
nr: [2, 1],
fc: 2
}, {
lngs: ["ro"],
nr: [1, 2, 20],
fc: 20
}, {
lngs: ["sl"],
nr: [5, 1, 2, 3],
fc: 21
}, {
lngs: ["he", "iw"],
nr: [1, 2, 20, 21],
fc: 22
}];
var _rulesPluralsTypes = {
1: function _(n2) {
return Number(n2 > 1);
},
2: function _2(n2) {
return Number(n2 != 1);
},
3: function _3(n2) {
return 0;
},
4: function _4(n2) {
return Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2);
},
5: function _5(n2) {
return Number(n2 == 0 ? 0 : n2 == 1 ? 1 : n2 == 2 ? 2 : n2 % 100 >= 3 && n2 % 100 <= 10 ? 3 : n2 % 100 >= 11 ? 4 : 5);
},
6: function _6(n2) {
return Number(n2 == 1 ? 0 : n2 >= 2 && n2 <= 4 ? 1 : 2);
},
7: function _7(n2) {
return Number(n2 == 1 ? 0 : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2);
},
8: function _8(n2) {
return Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 != 8 && n2 != 11 ? 2 : 3);
},
9: function _9(n2) {
return Number(n2 >= 2);
},
10: function _10(n2) {
return Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 < 7 ? 2 : n2 < 11 ? 3 : 4);
},
11: function _11(n2) {
return Number(n2 == 1 || n2 == 11 ? 0 : n2 == 2 || n2 == 12 ? 1 : n2 > 2 && n2 < 20 ? 2 : 3);
},
12: function _12(n2) {
return Number(n2 % 10 != 1 || n2 % 100 == 11);
},
13: function _13(n2) {
return Number(n2 !== 0);
},
14: function _14(n2) {
return Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 == 3 ? 2 : 3);
},
15: function _15(n2) {
return Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 % 10 >= 2 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2);
},
16: function _16(n2) {
return Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 !== 0 ? 1 : 2);
},
17: function _17(n2) {
return Number(n2 == 1 || n2 % 10 == 1 && n2 % 100 != 11 ? 0 : 1);
},
18: function _18(n2) {
return Number(n2 == 0 ? 0 : n2 == 1 ? 1 : 2);
},
19: function _19(n2) {
return Number(n2 == 1 ? 0 : n2 == 0 || n2 % 100 > 1 && n2 % 100 < 11 ? 1 : n2 % 100 > 10 && n2 % 100 < 20 ? 2 : 3);
},
20: function _20(n2) {
return Number(n2 == 1 ? 0 : n2 == 0 || n2 % 100 > 0 && n2 % 100 < 20 ? 1 : 2);
},
21: function _21(n2) {
return Number(n2 % 100 == 1 ? 1 : n2 % 100 == 2 ? 2 : n2 % 100 == 3 || n2 % 100 == 4 ? 3 : 0);
},
22: function _22(n2) {
return Number(n2 == 1 ? 0 : n2 == 2 ? 1 : (n2 < 0 || n2 > 10) && n2 % 10 == 0 ? 2 : 3);
}
};
var deprecatedJsonVersions = ["v1", "v2", "v3"];
var suffixesOrder = {
zero: 0,
one: 1,
two: 2,
few: 3,
many: 4,
other: 5
};
function createRules() {
var rules = {};
sets.forEach(function(set2) {
set2.lngs.forEach(function(l2) {
rules[l2] = {
numbers: set2.nr,
plurals: _rulesPluralsTypes[set2.fc]
};
});
});
return rules;
}
var PluralResolver = function() {
function PluralResolver2(languageUtils) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck$1(this, PluralResolver2);
this.languageUtils = languageUtils;
this.options = options2;
this.logger = baseLogger.create("pluralResolver");
if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === "v4") && (typeof Intl === "undefined" || !Intl.PluralRules)) {
this.options.compatibilityJSON = "v3";
this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.");
}
this.rules = createRules();
}
_createClass(PluralResolver2, [{
key: "addRule",
value: function addRule(lng, obj) {
this.rules[lng] = obj;
}
}, {
key: "getRule",
value: function getRule(code) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (this.shouldUseIntlApi()) {
try {
return new Intl.PluralRules(code, {
type: options2.ordinal ? "ordinal" : "cardinal"
});
} catch (_unused) {
return;
}
}
return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
}
}, {
key: "needsPlural",
value: function needsPlural(code) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var rule2 = this.getRule(code, options2);
if (this.shouldUseIntlApi()) {
return rule2 && rule2.resolvedOptions().pluralCategories.length > 1;
}
return rule2 && rule2.numbers.length > 1;
}
}, {
key: "getPluralFormsOfKey",
value: function getPluralFormsOfKey(code, key2) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return this.getSuffixes(code, options2).map(function(suffix2) {
return "".concat(key2).concat(suffix2);
});
}
}, {
key: "getSuffixes",
value: function getSuffixes(code) {
var _this = this;
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var rule2 = this.getRule(code, options2);
if (!rule2) {
return [];
}
if (this.shouldUseIntlApi()) {
return rule2.resolvedOptions().pluralCategories.sort(function(pluralCategory1, pluralCategory2) {
return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];
}).map(function(pluralCategory) {
return "".concat(_this.options.prepend).concat(pluralCategory);
});
}
return rule2.numbers.map(function(number2) {
return _this.getSuffix(code, number2, options2);
});
}
}, {
key: "getSuffix",
value: function getSuffix(code, count2) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var rule2 = this.getRule(code, options2);
if (rule2) {
if (this.shouldUseIntlApi()) {
return "".concat(this.options.prepend).concat(rule2.select(count2));
}
return this.getSuffixRetroCompatible(rule2, count2);
}
this.logger.warn("no plural rule found for: ".concat(code));
return "";
}
}, {
key: "getSuffixRetroCompatible",
value: function getSuffixRetroCompatible(rule2, count2) {
var _this2 = this;
var idx = rule2.noAbs ? rule2.plurals(count2) : rule2.plurals(Math.abs(count2));
var suffix2 = rule2.numbers[idx];
if (this.options.simplifyPluralSuffix && rule2.numbers.length === 2 && rule2.numbers[0] === 1) {
if (suffix2 === 2) {
suffix2 = "plural";
} else if (suffix2 === 1) {
suffix2 = "";
}
}
var returnSuffix = function returnSuffix2() {
return _this2.options.prepend && suffix2.toString() ? _this2.options.prepend + suffix2.toString() : suffix2.toString();
};
if (this.options.compatibilityJSON === "v1") {
if (suffix2 === 1)
return "";
if (typeof suffix2 === "number")
return "_plural_".concat(suffix2.toString());
return returnSuffix();
} else if (this.options.compatibilityJSON === "v2") {
return returnSuffix();
} else if (this.options.simplifyPluralSuffix && rule2.numbers.length === 2 && rule2.numbers[0] === 1) {
return returnSuffix();
}
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
}
}, {
key: "shouldUseIntlApi",
value: function shouldUseIntlApi() {
return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);
}
}]);
return PluralResolver2;
}();
function ownKeys$3$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$3$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$3$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$3$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function deepFindWithDefaults(data2, defaultData2, key2) {
var keySeparator = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".";
var ignoreJSONStructure = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
var path2 = getPathWithDefaults(data2, defaultData2, key2);
if (!path2 && ignoreJSONStructure && typeof key2 === "string") {
path2 = deepFind(data2, key2, keySeparator);
if (path2 === void 0)
path2 = deepFind(defaultData2, key2, keySeparator);
}
return path2;
}
var Interpolator = function() {
function Interpolator2() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
_classCallCheck$1(this, Interpolator2);
this.logger = baseLogger.create("interpolator");
this.options = options2;
this.format = options2.interpolation && options2.interpolation.format || function(value2) {
return value2;
};
this.init(options2);
}
_createClass(Interpolator2, [{
key: "init",
value: function init3() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (!options2.interpolation)
options2.interpolation = {
escapeValue: true
};
var iOpts = options2.interpolation;
this.escape = iOpts.escape !== void 0 ? iOpts.escape : escape;
this.escapeValue = iOpts.escapeValue !== void 0 ? iOpts.escapeValue : true;
this.useRawValueToEscape = iOpts.useRawValueToEscape !== void 0 ? iOpts.useRawValueToEscape : false;
this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || "{{";
this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || "}}";
this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ",";
this.unescapePrefix = iOpts.unescapeSuffix ? "" : iOpts.unescapePrefix || "-";
this.unescapeSuffix = this.unescapePrefix ? "" : iOpts.unescapeSuffix || "";
this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape("$t(");
this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(")");
this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ",";
this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1e3;
this.alwaysFormat = iOpts.alwaysFormat !== void 0 ? iOpts.alwaysFormat : false;
this.resetRegExp();
}
}, {
key: "reset",
value: function reset2() {
if (this.options)
this.init(this.options);
}
}, {
key: "resetRegExp",
value: function resetRegExp() {
var regexpStr = "".concat(this.prefix, "(.+?)").concat(this.suffix);
this.regexp = new RegExp(regexpStr, "g");
var regexpUnescapeStr = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
this.regexpUnescape = new RegExp(regexpUnescapeStr, "g");
var nestingRegexpStr = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
this.nestingRegexp = new RegExp(nestingRegexpStr, "g");
}
}, {
key: "interpolate",
value: function interpolate2(str, data2, lng, options2) {
var _this = this;
var match2;
var value2;
var replaces;
var defaultData2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
function regexSafe(val) {
return val.replace(/\$/g, "$$$$");
}
var handleFormat = function handleFormat2(key2) {
if (key2.indexOf(_this.formatSeparator) < 0) {
var path2 = deepFindWithDefaults(data2, defaultData2, key2, _this.options.keySeparator, _this.options.ignoreJSONStructure);
return _this.alwaysFormat ? _this.format(path2, void 0, lng, _objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({}, options2), data2), {}, {
interpolationkey: key2
})) : path2;
}
var p2 = key2.split(_this.formatSeparator);
var k2 = p2.shift().trim();
var f2 = p2.join(_this.formatSeparator).trim();
return _this.format(deepFindWithDefaults(data2, defaultData2, k2, _this.options.keySeparator, _this.options.ignoreJSONStructure), f2, lng, _objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({}, options2), data2), {}, {
interpolationkey: k2
}));
};
this.resetRegExp();
var missingInterpolationHandler = options2 && options2.missingInterpolationHandler || this.options.missingInterpolationHandler;
var skipOnVariables = options2 && options2.interpolation && options2.interpolation.skipOnVariables !== void 0 ? options2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
var todos = [{
regex: this.regexpUnescape,
safeValue: function safeValue(val) {
return regexSafe(val);
}
}, {
regex: this.regexp,
safeValue: function safeValue(val) {
return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val);
}
}];
todos.forEach(function(todo) {
replaces = 0;
while (match2 = todo.regex.exec(str)) {
var matchedVar = match2[1].trim();
value2 = handleFormat(matchedVar);
if (value2 === void 0) {
if (typeof missingInterpolationHandler === "function") {
var temp2 = missingInterpolationHandler(str, match2, options2);
value2 = typeof temp2 === "string" ? temp2 : "";
} else if (options2 && Object.prototype.hasOwnProperty.call(options2, matchedVar)) {
value2 = "";
} else if (skipOnVariables) {
value2 = match2[0];
continue;
} else {
_this.logger.warn("missed to pass in variable ".concat(matchedVar, " for interpolating ").concat(str));
value2 = "";
}
} else if (typeof value2 !== "string" && !_this.useRawValueToEscape) {
value2 = makeString(value2);
}
var safeValue = todo.safeValue(value2);
str = str.replace(match2[0], safeValue);
if (skipOnVariables) {
todo.regex.lastIndex += value2.length;
todo.regex.lastIndex -= match2[0].length;
} else {
todo.regex.lastIndex = 0;
}
replaces++;
if (replaces >= _this.maxReplaces) {
break;
}
}
});
return str;
}
}, {
key: "nest",
value: function nest2(str, fc2) {
var _this2 = this;
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var match2;
var value2;
var clonedOptions;
function handleHasOptions(key2, inheritedOptions) {
var sep = this.nestingOptionsSeparator;
if (key2.indexOf(sep) < 0)
return key2;
var c2 = key2.split(new RegExp("".concat(sep, "[ ]*{")));
var optionsString = "{".concat(c2[1]);
key2 = c2[0];
optionsString = this.interpolate(optionsString, clonedOptions);
var matchedSingleQuotes = optionsString.match(/'/g);
var matchedDoubleQuotes = optionsString.match(/"/g);
if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
optionsString = optionsString.replace(/'/g, '"');
}
try {
clonedOptions = JSON.parse(optionsString);
if (inheritedOptions)
clonedOptions = _objectSpread$3$1(_objectSpread$3$1({}, inheritedOptions), clonedOptions);
} catch (e7) {
this.logger.warn("failed parsing options string in nesting for key ".concat(key2), e7);
return "".concat(key2).concat(sep).concat(optionsString);
}
delete clonedOptions.defaultValue;
return key2;
}
while (match2 = this.nestingRegexp.exec(str)) {
var formatters = [];
clonedOptions = _objectSpread$3$1({}, options2);
clonedOptions = clonedOptions.replace && typeof clonedOptions.replace !== "string" ? clonedOptions.replace : clonedOptions;
clonedOptions.applyPostProcessor = false;
delete clonedOptions.defaultValue;
var doReduce = false;
if (match2[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match2[1])) {
var r2 = match2[1].split(this.formatSeparator).map(function(elem) {
return elem.trim();
});
match2[1] = r2.shift();
formatters = r2;
doReduce = true;
}
value2 = fc2(handleHasOptions.call(this, match2[1].trim(), clonedOptions), clonedOptions);
if (value2 && match2[0] === str && typeof value2 !== "string")
return value2;
if (typeof value2 !== "string")
value2 = makeString(value2);
if (!value2) {
this.logger.warn("missed to resolve ".concat(match2[1], " for nesting ").concat(str));
value2 = "";
}
if (doReduce) {
value2 = formatters.reduce(function(v2, f2) {
return _this2.format(v2, f2, options2.lng, _objectSpread$3$1(_objectSpread$3$1({}, options2), {}, {
interpolationkey: match2[1].trim()
}));
}, value2.trim());
}
str = str.replace(match2[0], value2);
this.regexp.lastIndex = 0;
}
return str;
}
}]);
return Interpolator2;
}();
function ownKeys$2$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$2$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$2$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$2$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function parseFormatStr(formatStr) {
var formatName = formatStr.toLowerCase().trim();
var formatOptions = {};
if (formatStr.indexOf("(") > -1) {
var p2 = formatStr.split("(");
formatName = p2[0].toLowerCase().trim();
var optStr = p2[1].substring(0, p2[1].length - 1);
if (formatName === "currency" && optStr.indexOf(":") < 0) {
if (!formatOptions.currency)
formatOptions.currency = optStr.trim();
} else if (formatName === "relativetime" && optStr.indexOf(":") < 0) {
if (!formatOptions.range)
formatOptions.range = optStr.trim();
} else {
var opts = optStr.split(";");
opts.forEach(function(opt) {
if (!opt)
return;
var _opt$split = opt.split(":"), _opt$split2 = _toArray(_opt$split), key2 = _opt$split2[0], rest = _opt$split2.slice(1);
var val = rest.join(":").trim().replace(/^'+|'+$/g, "");
if (!formatOptions[key2.trim()])
formatOptions[key2.trim()] = val;
if (val === "false")
formatOptions[key2.trim()] = false;
if (val === "true")
formatOptions[key2.trim()] = true;
if (!isNaN(val))
formatOptions[key2.trim()] = parseInt(val, 10);
});
}
}
return {
formatName,
formatOptions
};
}
function createCachedFormatter(fn8) {
var cache2 = {};
return function invokeFormatter(val, lng, options2) {
var key2 = lng + JSON.stringify(options2);
var formatter = cache2[key2];
if (!formatter) {
formatter = fn8(lng, options2);
cache2[key2] = formatter;
}
return formatter(val);
};
}
var Formatter2 = function() {
function Formatter3() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
_classCallCheck$1(this, Formatter3);
this.logger = baseLogger.create("formatter");
this.options = options2;
this.formats = {
number: createCachedFormatter(function(lng, opt) {
var formatter = new Intl.NumberFormat(lng, _objectSpread$2$1({}, opt));
return function(val) {
return formatter.format(val);
};
}),
currency: createCachedFormatter(function(lng, opt) {
var formatter = new Intl.NumberFormat(lng, _objectSpread$2$1(_objectSpread$2$1({}, opt), {}, {
style: "currency"
}));
return function(val) {
return formatter.format(val);
};
}),
datetime: createCachedFormatter(function(lng, opt) {
var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2$1({}, opt));
return function(val) {
return formatter.format(val);
};
}),
relativetime: createCachedFormatter(function(lng, opt) {
var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2$1({}, opt));
return function(val) {
return formatter.format(val, opt.range || "day");
};
}),
list: createCachedFormatter(function(lng, opt) {
var formatter = new Intl.ListFormat(lng, _objectSpread$2$1({}, opt));
return function(val) {
return formatter.format(val);
};
})
};
this.init(options2);
}
_createClass(Formatter3, [{
key: "init",
value: function init3(services) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
interpolation: {}
};
var iOpts = options2.interpolation;
this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ",";
}
}, {
key: "add",
value: function add3(name, fc2) {
this.formats[name.toLowerCase().trim()] = fc2;
}
}, {
key: "addCached",
value: function addCached(name, fc2) {
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc2);
}
}, {
key: "format",
value: function format2(value2, _format, lng) {
var _this = this;
var options2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
var formats2 = _format.split(this.formatSeparator);
var result = formats2.reduce(function(mem, f2) {
var _parseFormatStr = parseFormatStr(f2), formatName = _parseFormatStr.formatName, formatOptions = _parseFormatStr.formatOptions;
if (_this.formats[formatName]) {
var formatted = mem;
try {
var valOptions = options2 && options2.formatParams && options2.formatParams[options2.interpolationkey] || {};
var l2 = valOptions.locale || valOptions.lng || options2.locale || options2.lng || lng;
formatted = _this.formats[formatName](mem, l2, _objectSpread$2$1(_objectSpread$2$1(_objectSpread$2$1({}, formatOptions), options2), valOptions));
} catch (error3) {
_this.logger.warn(error3);
}
return formatted;
} else {
_this.logger.warn("there was no format function for ".concat(formatName));
}
return mem;
}, value2);
return result;
}
}]);
return Formatter3;
}();
function ownKeys$1$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$1$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$1$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$1$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _createSuper$1(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct$1();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _isNativeReflectConstruct$1() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function removePending(q2, name) {
if (q2.pending[name] !== void 0) {
delete q2.pending[name];
q2.pendingCount--;
}
}
var Connector = function(_EventEmitter) {
_inherits(Connector2, _EventEmitter);
var _super = _createSuper$1(Connector2);
function Connector2(backend, store, services) {
var _this;
var options2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
_classCallCheck$1(this, Connector2);
_this = _super.call(this);
if (isIE10) {
EventEmitter.call(_assertThisInitialized(_this));
}
_this.backend = backend;
_this.store = store;
_this.services = services;
_this.languageUtils = services.languageUtils;
_this.options = options2;
_this.logger = baseLogger.create("backendConnector");
_this.waitingReads = [];
_this.maxParallelReads = options2.maxParallelReads || 10;
_this.readingCalls = 0;
_this.maxRetries = options2.maxRetries >= 0 ? options2.maxRetries : 5;
_this.retryTimeout = options2.retryTimeout >= 1 ? options2.retryTimeout : 350;
_this.state = {};
_this.queue = [];
if (_this.backend && _this.backend.init) {
_this.backend.init(services, options2.backend, options2);
}
return _this;
}
_createClass(Connector2, [{
key: "queueLoad",
value: function queueLoad(languages, namespaces, options2, callback) {
var _this2 = this;
var toLoad = {};
var pending = {};
var toLoadLanguages = {};
var toLoadNamespaces = {};
languages.forEach(function(lng) {
var hasAllNamespaces = true;
namespaces.forEach(function(ns) {
var name = "".concat(lng, "|").concat(ns);
if (!options2.reload && _this2.store.hasResourceBundle(lng, ns)) {
_this2.state[name] = 2;
} else if (_this2.state[name] < 0)
;
else if (_this2.state[name] === 1) {
if (pending[name] === void 0)
pending[name] = true;
} else {
_this2.state[name] = 1;
hasAllNamespaces = false;
if (pending[name] === void 0)
pending[name] = true;
if (toLoad[name] === void 0)
toLoad[name] = true;
if (toLoadNamespaces[ns] === void 0)
toLoadNamespaces[ns] = true;
}
});
if (!hasAllNamespaces)
toLoadLanguages[lng] = true;
});
if (Object.keys(toLoad).length || Object.keys(pending).length) {
this.queue.push({
pending,
pendingCount: Object.keys(pending).length,
loaded: {},
errors: [],
callback
});
}
return {
toLoad: Object.keys(toLoad),
pending: Object.keys(pending),
toLoadLanguages: Object.keys(toLoadLanguages),
toLoadNamespaces: Object.keys(toLoadNamespaces)
};
}
}, {
key: "loaded",
value: function loaded(name, err, data2) {
var s2 = name.split("|");
var lng = s2[0];
var ns = s2[1];
if (err)
this.emit("failedLoading", lng, ns, err);
if (data2) {
this.store.addResourceBundle(lng, ns, data2);
}
this.state[name] = err ? -1 : 2;
var loaded2 = {};
this.queue.forEach(function(q2) {
pushPath(q2.loaded, [lng], ns);
removePending(q2, name);
if (err)
q2.errors.push(err);
if (q2.pendingCount === 0 && !q2.done) {
Object.keys(q2.loaded).forEach(function(l2) {
if (!loaded2[l2])
loaded2[l2] = {};
var loadedKeys = q2.loaded[l2];
if (loadedKeys.length) {
loadedKeys.forEach(function(n2) {
if (loaded2[l2][n2] === void 0)
loaded2[l2][n2] = true;
});
}
});
q2.done = true;
if (q2.errors.length) {
q2.callback(q2.errors);
} else {
q2.callback();
}
}
});
this.emit("loaded", loaded2);
this.queue = this.queue.filter(function(q2) {
return !q2.done;
});
}
}, {
key: "read",
value: function read3(lng, ns, fcName) {
var _this3 = this;
var tried = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
var wait = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout;
var callback = arguments.length > 5 ? arguments[5] : void 0;
if (!lng.length)
return callback(null, {});
if (this.readingCalls >= this.maxParallelReads) {
this.waitingReads.push({
lng,
ns,
fcName,
tried,
wait,
callback
});
return;
}
this.readingCalls++;
var resolver = function resolver2(err, data2) {
_this3.readingCalls--;
if (_this3.waitingReads.length > 0) {
var next2 = _this3.waitingReads.shift();
_this3.read(next2.lng, next2.ns, next2.fcName, next2.tried, next2.wait, next2.callback);
}
if (err && data2 && tried < _this3.maxRetries) {
setTimeout(function() {
_this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);
}, wait);
return;
}
callback(err, data2);
};
var fc2 = this.backend[fcName].bind(this.backend);
if (fc2.length === 2) {
try {
var r2 = fc2(lng, ns);
if (r2 && typeof r2.then === "function") {
r2.then(function(data2) {
return resolver(null, data2);
})["catch"](resolver);
} else {
resolver(null, r2);
}
} catch (err) {
resolver(err);
}
return;
}
return fc2(lng, ns, resolver);
}
}, {
key: "prepareLoading",
value: function prepareLoading(languages, namespaces) {
var _this4 = this;
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var callback = arguments.length > 3 ? arguments[3] : void 0;
if (!this.backend) {
this.logger.warn("No backend was added via i18next.use. Will not load resources.");
return callback && callback();
}
if (typeof languages === "string")
languages = this.languageUtils.toResolveHierarchy(languages);
if (typeof namespaces === "string")
namespaces = [namespaces];
var toLoad = this.queueLoad(languages, namespaces, options2, callback);
if (!toLoad.toLoad.length) {
if (!toLoad.pending.length)
callback();
return null;
}
toLoad.toLoad.forEach(function(name) {
_this4.loadOne(name);
});
}
}, {
key: "load",
value: function load2(languages, namespaces, callback) {
this.prepareLoading(languages, namespaces, {}, callback);
}
}, {
key: "reload",
value: function reload(languages, namespaces, callback) {
this.prepareLoading(languages, namespaces, {
reload: true
}, callback);
}
}, {
key: "loadOne",
value: function loadOne(name) {
var _this5 = this;
var prefix2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
var s2 = name.split("|");
var lng = s2[0];
var ns = s2[1];
this.read(lng, ns, "read", void 0, void 0, function(err, data2) {
if (err)
_this5.logger.warn("".concat(prefix2, "loading namespace ").concat(ns, " for language ").concat(lng, " failed"), err);
if (!err && data2)
_this5.logger.log("".concat(prefix2, "loaded namespace ").concat(ns, " for language ").concat(lng), data2);
_this5.loaded(name, err, data2);
});
}
}, {
key: "saveMissing",
value: function saveMissing(languages, namespace, key2, fallbackValue, isUpdate) {
var options2 = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
var clb = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : function() {
};
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
this.logger.warn('did not save key "'.concat(key2, '" as the namespace "').concat(namespace, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
return;
}
if (key2 === void 0 || key2 === null || key2 === "")
return;
if (this.backend && this.backend.create) {
var opts = _objectSpread$1$1(_objectSpread$1$1({}, options2), {}, {
isUpdate
});
var fc2 = this.backend.create.bind(this.backend);
if (fc2.length < 6) {
try {
var r2;
if (fc2.length === 5) {
r2 = fc2(languages, namespace, key2, fallbackValue, opts);
} else {
r2 = fc2(languages, namespace, key2, fallbackValue);
}
if (r2 && typeof r2.then === "function") {
r2.then(function(data2) {
return clb(null, data2);
})["catch"](clb);
} else {
clb(null, r2);
}
} catch (err) {
clb(err);
}
} else {
fc2(languages, namespace, key2, fallbackValue, clb, opts);
}
}
if (!languages || !languages[0])
return;
this.store.addResource(languages[0], namespace, key2, fallbackValue);
}
}]);
return Connector2;
}(EventEmitter);
function get$6() {
return {
debug: false,
initImmediate: true,
ns: ["translation"],
defaultNS: ["translation"],
fallbackLng: ["dev"],
fallbackNS: false,
supportedLngs: false,
nonExplicitSupportedLngs: false,
load: "all",
preload: false,
simplifyPluralSuffix: true,
keySeparator: ".",
nsSeparator: ":",
pluralSeparator: "_",
contextSeparator: "_",
partialBundledLanguages: false,
saveMissing: false,
updateMissing: false,
saveMissingTo: "fallback",
saveMissingPlurals: true,
missingKeyHandler: false,
missingInterpolationHandler: false,
postProcess: false,
postProcessPassResolved: false,
returnNull: true,
returnEmptyString: true,
returnObjects: false,
joinArrays: false,
returnedObjectHandler: false,
parseMissingKeyHandler: false,
appendNamespaceToMissingKey: false,
appendNamespaceToCIMode: false,
overloadTranslationOptionHandler: function handle2(args) {
var ret = {};
if (_typeof$3(args[1]) === "object")
ret = args[1];
if (typeof args[1] === "string")
ret.defaultValue = args[1];
if (typeof args[2] === "string")
ret.tDescription = args[2];
if (_typeof$3(args[2]) === "object" || _typeof$3(args[3]) === "object") {
var options2 = args[3] || args[2];
Object.keys(options2).forEach(function(key2) {
ret[key2] = options2[key2];
});
}
return ret;
},
interpolation: {
escapeValue: true,
format: function format2(value2, _format, lng, options2) {
return value2;
},
prefix: "{{",
suffix: "}}",
formatSeparator: ",",
unescapePrefix: "-",
nestingPrefix: "$t(",
nestingSuffix: ")",
nestingOptionsSeparator: ",",
maxReplaces: 1e3,
skipOnVariables: true
}
};
}
function transformOptions(options2) {
if (typeof options2.ns === "string")
options2.ns = [options2.ns];
if (typeof options2.fallbackLng === "string")
options2.fallbackLng = [options2.fallbackLng];
if (typeof options2.fallbackNS === "string")
options2.fallbackNS = [options2.fallbackNS];
if (options2.supportedLngs && options2.supportedLngs.indexOf("cimode") < 0) {
options2.supportedLngs = options2.supportedLngs.concat(["cimode"]);
}
return options2;
}
function ownKeys$a(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
enumerableOnly && (symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
})), keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$8(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys$a(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2)) : ownKeys$a(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
return target2;
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct$4();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _isNativeReflectConstruct$4() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function noop$8() {
}
function bindMemberFunctions(inst) {
var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
mems.forEach(function(mem) {
if (typeof inst[mem] === "function") {
inst[mem] = inst[mem].bind(inst);
}
});
}
var I18n = function(_EventEmitter) {
_inherits(I18n2, _EventEmitter);
var _super = _createSuper(I18n2);
function I18n2() {
var _this;
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var callback = arguments.length > 1 ? arguments[1] : void 0;
_classCallCheck$1(this, I18n2);
_this = _super.call(this);
if (isIE10) {
EventEmitter.call(_assertThisInitialized(_this));
}
_this.options = transformOptions(options2);
_this.services = {};
_this.logger = baseLogger;
_this.modules = {
external: []
};
bindMemberFunctions(_assertThisInitialized(_this));
if (callback && !_this.isInitialized && !options2.isClone) {
if (!_this.options.initImmediate) {
_this.init(options2, callback);
return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
}
setTimeout(function() {
_this.init(options2, callback);
}, 0);
}
return _this;
}
_createClass(I18n2, [{
key: "init",
value: function init3() {
var _this2 = this;
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var callback = arguments.length > 1 ? arguments[1] : void 0;
if (typeof options2 === "function") {
callback = options2;
options2 = {};
}
if (!options2.defaultNS && options2.defaultNS !== false && options2.ns) {
if (typeof options2.ns === "string") {
options2.defaultNS = options2.ns;
} else if (options2.ns.indexOf("translation") < 0) {
options2.defaultNS = options2.ns[0];
}
}
var defOpts = get$6();
this.options = _objectSpread$8(_objectSpread$8(_objectSpread$8({}, defOpts), this.options), transformOptions(options2));
if (this.options.compatibilityAPI !== "v1") {
this.options.interpolation = _objectSpread$8(_objectSpread$8({}, defOpts.interpolation), this.options.interpolation);
}
if (options2.keySeparator !== void 0) {
this.options.userDefinedKeySeparator = options2.keySeparator;
}
if (options2.nsSeparator !== void 0) {
this.options.userDefinedNsSeparator = options2.nsSeparator;
}
function createClassOnDemand(ClassOrObject) {
if (!ClassOrObject)
return null;
if (typeof ClassOrObject === "function")
return new ClassOrObject();
return ClassOrObject;
}
if (!this.options.isClone) {
if (this.modules.logger) {
baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
} else {
baseLogger.init(null, this.options);
}
var formatter;
if (this.modules.formatter) {
formatter = this.modules.formatter;
} else if (typeof Intl !== "undefined") {
formatter = Formatter2;
}
var lu2 = new LanguageUtil(this.options);
this.store = new ResourceStore(this.options.resources, this.options);
var s2 = this.services;
s2.logger = baseLogger;
s2.resourceStore = this.store;
s2.languageUtils = lu2;
s2.pluralResolver = new PluralResolver(lu2, {
prepend: this.options.pluralSeparator,
compatibilityJSON: this.options.compatibilityJSON,
simplifyPluralSuffix: this.options.simplifyPluralSuffix
});
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
s2.formatter = createClassOnDemand(formatter);
s2.formatter.init(s2, this.options);
this.options.interpolation.format = s2.formatter.format.bind(s2.formatter);
}
s2.interpolator = new Interpolator(this.options);
s2.utils = {
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
};
s2.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s2.resourceStore, s2, this.options);
s2.backendConnector.on("*", function(event2) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_this2.emit.apply(_this2, [event2].concat(args));
});
if (this.modules.languageDetector) {
s2.languageDetector = createClassOnDemand(this.modules.languageDetector);
if (s2.languageDetector.init)
s2.languageDetector.init(s2, this.options.detection, this.options);
}
if (this.modules.i18nFormat) {
s2.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
if (s2.i18nFormat.init)
s2.i18nFormat.init(this);
}
this.translator = new Translator(this.services, this.options);
this.translator.on("*", function(event2) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
_this2.emit.apply(_this2, [event2].concat(args));
});
this.modules.external.forEach(function(m2) {
if (m2.init)
m2.init(_this2);
});
}
this.format = this.options.interpolation.format;
if (!callback)
callback = noop$8;
if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
if (codes.length > 0 && codes[0] !== "dev")
this.options.lng = codes[0];
}
if (!this.services.languageDetector && !this.options.lng) {
this.logger.warn("init: no languageDetector is used and no lng is defined");
}
var storeApi = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
storeApi.forEach(function(fcName) {
_this2[fcName] = function() {
var _this2$store;
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
};
});
var storeApiChained = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
storeApiChained.forEach(function(fcName) {
_this2[fcName] = function() {
var _this2$store2;
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
return _this2;
};
});
var deferred = defer$1();
var load2 = function load3() {
var finish = function finish2(err, t5) {
if (_this2.isInitialized && !_this2.initializedStoreOnce)
_this2.logger.warn("init: i18next is already initialized. You should call init just once!");
_this2.isInitialized = true;
if (!_this2.options.isClone)
_this2.logger.log("initialized", _this2.options);
_this2.emit("initialized", _this2.options);
deferred.resolve(t5);
callback(err, t5);
};
if (_this2.languages && _this2.options.compatibilityAPI !== "v1" && !_this2.isInitialized)
return finish(null, _this2.t.bind(_this2));
_this2.changeLanguage(_this2.options.lng, finish);
};
if (this.options.resources || !this.options.initImmediate) {
load2();
} else {
setTimeout(load2, 0);
}
return deferred;
}
}, {
key: "loadResources",
value: function loadResources(language) {
var _this3 = this;
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop$8;
var usedCallback = callback;
var usedLng = typeof language === "string" ? language : this.language;
if (typeof language === "function")
usedCallback = language;
if (!this.options.resources || this.options.partialBundledLanguages) {
if (usedLng && usedLng.toLowerCase() === "cimode")
return usedCallback();
var toLoad = [];
var append2 = function append3(lng) {
if (!lng)
return;
var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);
lngs.forEach(function(l2) {
if (toLoad.indexOf(l2) < 0)
toLoad.push(l2);
});
};
if (!usedLng) {
var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
fallbacks.forEach(function(l2) {
return append2(l2);
});
} else {
append2(usedLng);
}
if (this.options.preload) {
this.options.preload.forEach(function(l2) {
return append2(l2);
});
}
this.services.backendConnector.load(toLoad, this.options.ns, function(e7) {
if (!e7 && !_this3.resolvedLanguage && _this3.language)
_this3.setResolvedLanguage(_this3.language);
usedCallback(e7);
});
} else {
usedCallback(null);
}
}
}, {
key: "reloadResources",
value: function reloadResources(lngs, ns, callback) {
var deferred = defer$1();
if (!lngs)
lngs = this.languages;
if (!ns)
ns = this.options.ns;
if (!callback)
callback = noop$8;
this.services.backendConnector.reload(lngs, ns, function(err) {
deferred.resolve();
callback(err);
});
return deferred;
}
}, {
key: "use",
value: function use(module) {
if (!module)
throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
if (!module.type)
throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
if (module.type === "backend") {
this.modules.backend = module;
}
if (module.type === "logger" || module.log && module.warn && module.error) {
this.modules.logger = module;
}
if (module.type === "languageDetector") {
this.modules.languageDetector = module;
}
if (module.type === "i18nFormat") {
this.modules.i18nFormat = module;
}
if (module.type === "postProcessor") {
postProcessor.addPostProcessor(module);
}
if (module.type === "formatter") {
this.modules.formatter = module;
}
if (module.type === "3rdParty") {
this.modules.external.push(module);
}
return this;
}
}, {
key: "setResolvedLanguage",
value: function setResolvedLanguage(l2) {
if (!l2 || !this.languages)
return;
if (["cimode", "dev"].indexOf(l2) > -1)
return;
for (var li2 = 0; li2 < this.languages.length; li2++) {
var lngInLngs = this.languages[li2];
if (["cimode", "dev"].indexOf(lngInLngs) > -1)
continue;
if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
this.resolvedLanguage = lngInLngs;
break;
}
}
}
}, {
key: "changeLanguage",
value: function changeLanguage(lng, callback) {
var _this4 = this;
this.isLanguageChangingTo = lng;
var deferred = defer$1();
this.emit("languageChanging", lng);
var setLngProps = function setLngProps2(l2) {
_this4.language = l2;
_this4.languages = _this4.services.languageUtils.toResolveHierarchy(l2);
_this4.resolvedLanguage = void 0;
_this4.setResolvedLanguage(l2);
};
var done = function done2(err, l2) {
if (l2) {
setLngProps(l2);
_this4.translator.changeLanguage(l2);
_this4.isLanguageChangingTo = void 0;
_this4.emit("languageChanged", l2);
_this4.logger.log("languageChanged", l2);
} else {
_this4.isLanguageChangingTo = void 0;
}
deferred.resolve(function() {
return _this4.t.apply(_this4, arguments);
});
if (callback)
callback(err, function() {
return _this4.t.apply(_this4, arguments);
});
};
var setLng = function setLng2(lngs) {
if (!lng && !lngs && _this4.services.languageDetector)
lngs = [];
var l2 = typeof lngs === "string" ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);
if (l2) {
if (!_this4.language) {
setLngProps(l2);
}
if (!_this4.translator.language)
_this4.translator.changeLanguage(l2);
if (_this4.services.languageDetector && _this4.services.languageDetector.cacheUserLanguage)
_this4.services.languageDetector.cacheUserLanguage(l2);
}
_this4.loadResources(l2, function(err) {
done(err, l2);
});
};
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
setLng(this.services.languageDetector.detect());
} else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
if (this.services.languageDetector.detect.length === 0) {
this.services.languageDetector.detect().then(setLng);
} else {
this.services.languageDetector.detect(setLng);
}
} else {
setLng(lng);
}
return deferred;
}
}, {
key: "getFixedT",
value: function getFixedT(lng, ns, keyPrefix) {
var _this5 = this;
var fixedT = function fixedT2(key2, opts) {
var options2;
if (_typeof$3(opts) !== "object") {
for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
rest[_key3 - 2] = arguments[_key3];
}
options2 = _this5.options.overloadTranslationOptionHandler([key2, opts].concat(rest));
} else {
options2 = _objectSpread$8({}, opts);
}
options2.lng = options2.lng || fixedT2.lng;
options2.lngs = options2.lngs || fixedT2.lngs;
options2.ns = options2.ns || fixedT2.ns;
options2.keyPrefix = options2.keyPrefix || keyPrefix || fixedT2.keyPrefix;
var keySeparator = _this5.options.keySeparator || ".";
var resultKey;
if (options2.keyPrefix && Array.isArray(key2)) {
resultKey = key2.map(function(k2) {
return "".concat(options2.keyPrefix).concat(keySeparator).concat(k2);
});
} else {
resultKey = options2.keyPrefix ? "".concat(options2.keyPrefix).concat(keySeparator).concat(key2) : key2;
}
return _this5.t(resultKey, options2);
};
if (typeof lng === "string") {
fixedT.lng = lng;
} else {
fixedT.lngs = lng;
}
fixedT.ns = ns;
fixedT.keyPrefix = keyPrefix;
return fixedT;
}
}, {
key: "t",
value: function t5() {
var _this$translator;
return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);
}
}, {
key: "exists",
value: function exists() {
var _this$translator2;
return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);
}
}, {
key: "setDefaultNamespace",
value: function setDefaultNamespace(ns) {
this.options.defaultNS = ns;
}
}, {
key: "hasLoadedNamespace",
value: function hasLoadedNamespace2(ns) {
var _this6 = this;
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (!this.isInitialized) {
this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages);
return false;
}
if (!this.languages || !this.languages.length) {
this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages);
return false;
}
var lng = options2.lng || this.resolvedLanguage || this.languages[0];
var fallbackLng = this.options ? this.options.fallbackLng : false;
var lastLng = this.languages[this.languages.length - 1];
if (lng.toLowerCase() === "cimode")
return true;
var loadNotPending = function loadNotPending2(l2, n2) {
var loadState = _this6.services.backendConnector.state["".concat(l2, "|").concat(n2)];
return loadState === -1 || loadState === 2;
};
if (options2.precheck) {
var preResult = options2.precheck(this, loadNotPending);
if (preResult !== void 0)
return preResult;
}
if (this.hasResourceBundle(lng, ns))
return true;
if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages)
return true;
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns)))
return true;
return false;
}
}, {
key: "loadNamespaces",
value: function loadNamespaces2(ns, callback) {
var _this7 = this;
var deferred = defer$1();
if (!this.options.ns) {
if (callback)
callback();
return Promise.resolve();
}
if (typeof ns === "string")
ns = [ns];
ns.forEach(function(n2) {
if (_this7.options.ns.indexOf(n2) < 0)
_this7.options.ns.push(n2);
});
this.loadResources(function(err) {
deferred.resolve();
if (callback)
callback(err);
});
return deferred;
}
}, {
key: "loadLanguages",
value: function loadLanguages2(lngs, callback) {
var deferred = defer$1();
if (typeof lngs === "string")
lngs = [lngs];
var preloaded = this.options.preload || [];
var newLngs = lngs.filter(function(lng) {
return preloaded.indexOf(lng) < 0;
});
if (!newLngs.length) {
if (callback)
callback();
return Promise.resolve();
}
this.options.preload = preloaded.concat(newLngs);
this.loadResources(function(err) {
deferred.resolve();
if (callback)
callback(err);
});
return deferred;
}
}, {
key: "dir",
value: function dir(lng) {
if (!lng)
lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
if (!lng)
return "rtl";
var rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"];
var languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get$6());
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
}
}, {
key: "cloneInstance",
value: function cloneInstance() {
var _this8 = this;
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop$8;
var mergedOptions = _objectSpread$8(_objectSpread$8(_objectSpread$8({}, this.options), options2), {
isClone: true
});
var clone2 = new I18n2(mergedOptions);
if (options2.debug !== void 0 || options2.prefix !== void 0) {
clone2.logger = clone2.logger.clone(options2);
}
var membersToCopy = ["store", "services", "language"];
membersToCopy.forEach(function(m2) {
clone2[m2] = _this8[m2];
});
clone2.services = _objectSpread$8({}, this.services);
clone2.services.utils = {
hasLoadedNamespace: clone2.hasLoadedNamespace.bind(clone2)
};
clone2.translator = new Translator(clone2.services, clone2.options);
clone2.translator.on("*", function(event2) {
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
args[_key4 - 1] = arguments[_key4];
}
clone2.emit.apply(clone2, [event2].concat(args));
});
clone2.init(mergedOptions, callback);
clone2.translator.options = clone2.options;
clone2.translator.backendConnector.services.utils = {
hasLoadedNamespace: clone2.hasLoadedNamespace.bind(clone2)
};
return clone2;
}
}, {
key: "toJSON",
value: function toJSON() {
return {
options: this.options,
store: this.store,
language: this.language,
languages: this.languages,
resolvedLanguage: this.resolvedLanguage
};
}
}]);
return I18n2;
}(EventEmitter);
_defineProperty$3(I18n, "createInstance", function() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var callback = arguments.length > 1 ? arguments[1] : void 0;
return new I18n(options2, callback);
});
var instance = I18n.createInstance();
instance.createInstance = I18n.createInstance;
instance.createInstance;
instance.dir;
instance.init;
instance.loadResources;
instance.reloadResources;
instance.use;
instance.changeLanguage;
instance.getFixedT;
var t$m = instance.t;
instance.exists;
instance.setDefaultNamespace;
instance.hasLoadedNamespace;
instance.loadNamespaces;
instance.loadLanguages;
let getRandomValues;
const rnds8 = new Uint8Array(16);
function rng() {
if (!getRandomValues) {
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
if (!getRandomValues) {
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
}
}
return getRandomValues(rnds8);
}
const byteToHex = [];
for (let i2 = 0; i2 < 256; ++i2) {
byteToHex.push((i2 + 256).toString(16).slice(1));
}
function unsafeStringify(arr2, offset2 = 0) {
return byteToHex[arr2[offset2 + 0]] + byteToHex[arr2[offset2 + 1]] + byteToHex[arr2[offset2 + 2]] + byteToHex[arr2[offset2 + 3]] + "-" + byteToHex[arr2[offset2 + 4]] + byteToHex[arr2[offset2 + 5]] + "-" + byteToHex[arr2[offset2 + 6]] + byteToHex[arr2[offset2 + 7]] + "-" + byteToHex[arr2[offset2 + 8]] + byteToHex[arr2[offset2 + 9]] + "-" + byteToHex[arr2[offset2 + 10]] + byteToHex[arr2[offset2 + 11]] + byteToHex[arr2[offset2 + 12]] + byteToHex[arr2[offset2 + 13]] + byteToHex[arr2[offset2 + 14]] + byteToHex[arr2[offset2 + 15]];
}
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
const native = {
randomUUID
};
function v4(options2, buf, offset2) {
if (native.randomUUID && !buf && !options2) {
return native.randomUUID();
}
options2 = options2 || {};
const rnds = options2.random || (options2.rng || rng)();
rnds[6] = rnds[6] & 15 | 64;
rnds[8] = rnds[8] & 63 | 128;
if (buf) {
offset2 = offset2 || 0;
for (let i2 = 0; i2 < 16; ++i2) {
buf[offset2 + i2] = rnds[i2];
}
return buf;
}
return unsafeStringify(rnds);
}
var arr$1 = [];
var each$1 = arr$1.forEach;
var slice$4 = arr$1.slice;
function defaults$2(obj) {
each$1.call(slice$4.call(arguments, 1), function(source2) {
if (source2) {
for (var prop in source2) {
if (obj[prop] === void 0)
obj[prop] = source2[prop];
}
}
});
return obj;
}
function addQueryString(url2, params2) {
if (params2 && _typeof$3(params2) === "object") {
var queryString = "", e7 = encodeURIComponent;
for (var paramName in params2) {
queryString += "&" + e7(paramName) + "=" + e7(params2[paramName]);
}
if (!queryString) {
return url2;
}
url2 = url2 + (url2.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
}
return url2;
}
function ajax(url2, options2, callback, data2, cache2) {
if (data2 && _typeof$3(data2) === "object") {
if (!cache2) {
data2["_t"] = /* @__PURE__ */ new Date();
}
data2 = addQueryString("", data2).slice(1);
}
if (options2.queryStringParams) {
url2 = addQueryString(url2, options2.queryStringParams);
}
try {
var x2;
if (XMLHttpRequest) {
x2 = new XMLHttpRequest();
} else {
x2 = new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
x2.open(data2 ? "POST" : "GET", url2, 1);
if (!options2.crossDomain) {
x2.setRequestHeader("X-Requested-With", "XMLHttpRequest");
}
x2.withCredentials = !!options2.withCredentials;
if (data2) {
x2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
}
if (x2.overrideMimeType) {
x2.overrideMimeType("application/json");
}
var h2 = options2.customHeaders;
h2 = typeof h2 === "function" ? h2() : h2;
if (h2) {
for (var i2 in h2) {
x2.setRequestHeader(i2, h2[i2]);
}
}
x2.onreadystatechange = function() {
x2.readyState > 3 && callback && callback(x2.responseText, x2);
};
x2.send(data2);
} catch (e7) {
console && console.log(e7);
}
}
function getDefaults$2() {
return {
loadPath: "/locales/{{lng}}/{{ns}}.json",
addPath: "/locales/add/{{lng}}/{{ns}}",
allowMultiLoading: false,
parse: JSON.parse,
parsePayload: function parsePayload(namespace, key2, fallbackValue) {
return _defineProperty$3({}, key2, fallbackValue || "");
},
crossDomain: false,
ajax
};
}
var Backend = /* @__PURE__ */ function() {
function Backend2(services) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck$1(this, Backend2);
this.init(services, options2);
this.type = "backend";
}
_createClass(Backend2, [{
key: "init",
value: function init3(services) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
this.services = services;
this.options = defaults$2(options2, this.options || {}, getDefaults$2());
}
}, {
key: "readMulti",
value: function readMulti(languages, namespaces, callback) {
var loadPath = this.options.loadPath;
if (typeof this.options.loadPath === "function") {
loadPath = this.options.loadPath(languages, namespaces);
}
var url2 = this.services.interpolator.interpolate(loadPath, {
lng: languages.join("+"),
ns: namespaces.join("+")
});
this.loadUrl(url2, callback);
}
}, {
key: "read",
value: function read3(language, namespace, callback) {
var loadPath = this.options.loadPath;
if (typeof this.options.loadPath === "function") {
loadPath = this.options.loadPath([language], [namespace]);
}
var url2 = this.services.interpolator.interpolate(loadPath, {
lng: language,
ns: namespace
});
this.loadUrl(url2, callback);
}
}, {
key: "loadUrl",
value: function loadUrl(url2, callback) {
var _this = this;
this.options.ajax(url2, this.options, function(data2, xhr) {
if (xhr.status >= 500 && xhr.status < 600)
return callback(
"failed loading " + url2,
true
/* retry */
);
if (xhr.status >= 400 && xhr.status < 500)
return callback(
"failed loading " + url2,
false
/* no retry */
);
var ret, err;
try {
ret = _this.options.parse(data2, url2);
} catch (e7) {
err = "failed parsing " + url2 + " to json";
}
if (err)
return callback(err, false);
callback(null, ret);
});
}
}, {
key: "create",
value: function create4(languages, namespace, key2, fallbackValue) {
var _this2 = this;
if (typeof languages === "string")
languages = [languages];
var payload = this.options.parsePayload(namespace, key2, fallbackValue);
languages.forEach(function(lng) {
var url2 = _this2.services.interpolator.interpolate(_this2.options.addPath, {
lng,
ns: namespace
});
_this2.options.ajax(url2, _this2.options, function(data2, xhr) {
}, payload);
});
}
}]);
return Backend2;
}();
Backend.type = "backend";
var arr = [];
var each = arr.forEach;
var slice$3 = arr.slice;
function defaults$1(obj) {
each.call(slice$3.call(arguments, 1), function(source2) {
if (source2) {
for (var prop in source2) {
if (obj[prop] === void 0)
obj[prop] = source2[prop];
}
}
});
return obj;
}
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
var serializeCookie = function serializeCookie2(name, val, options2) {
var opt = options2 || {};
opt.path = opt.path || "/";
var value2 = encodeURIComponent(val);
var str = "".concat(name, "=").concat(value2);
if (opt.maxAge > 0) {
var maxAge = opt.maxAge - 0;
if (Number.isNaN(maxAge))
throw new Error("maxAge should be a Number");
str += "; Max-Age=".concat(Math.floor(maxAge));
}
if (opt.domain) {
if (!fieldContentRegExp.test(opt.domain)) {
throw new TypeError("option domain is invalid");
}
str += "; Domain=".concat(opt.domain);
}
if (opt.path) {
if (!fieldContentRegExp.test(opt.path)) {
throw new TypeError("option path is invalid");
}
str += "; Path=".concat(opt.path);
}
if (opt.expires) {
if (typeof opt.expires.toUTCString !== "function") {
throw new TypeError("option expires is invalid");
}
str += "; Expires=".concat(opt.expires.toUTCString());
}
if (opt.httpOnly)
str += "; HttpOnly";
if (opt.secure)
str += "; Secure";
if (opt.sameSite) {
var sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite;
switch (sameSite) {
case true:
str += "; SameSite=Strict";
break;
case "lax":
str += "; SameSite=Lax";
break;
case "strict":
str += "; SameSite=Strict";
break;
case "none":
str += "; SameSite=None";
break;
default:
throw new TypeError("option sameSite is invalid");
}
}
return str;
};
var cookie = {
create: function create(name, value2, minutes, domain2) {
var cookieOptions = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
path: "/",
sameSite: "strict"
};
if (minutes) {
cookieOptions.expires = /* @__PURE__ */ new Date();
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1e3);
}
if (domain2)
cookieOptions.domain = domain2;
document.cookie = serializeCookie(name, encodeURIComponent(value2), cookieOptions);
},
read: function read(name) {
var nameEQ = "".concat(name, "=");
var ca2 = document.cookie.split(";");
for (var i2 = 0; i2 < ca2.length; i2++) {
var c2 = ca2[i2];
while (c2.charAt(0) === " ") {
c2 = c2.substring(1, c2.length);
}
if (c2.indexOf(nameEQ) === 0)
return c2.substring(nameEQ.length, c2.length);
}
return null;
},
remove: function remove(name) {
this.create(name, "", -1);
}
};
var cookie$1 = {
name: "cookie",
lookup: function lookup(options2) {
var found;
if (options2.lookupCookie && typeof document !== "undefined") {
var c2 = cookie.read(options2.lookupCookie);
if (c2)
found = c2;
}
return found;
},
cacheUserLanguage: function cacheUserLanguage(lng, options2) {
if (options2.lookupCookie && typeof document !== "undefined") {
cookie.create(options2.lookupCookie, lng, options2.cookieMinutes, options2.cookieDomain, options2.cookieOptions);
}
}
};
var querystring = {
name: "querystring",
lookup: function lookup2(options2) {
var found;
if (typeof window !== "undefined") {
var search = window.location.search;
if (!window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1) {
search = window.location.hash.substring(window.location.hash.indexOf("?"));
}
var query = search.substring(1);
var params2 = query.split("&");
for (var i2 = 0; i2 < params2.length; i2++) {
var pos = params2[i2].indexOf("=");
if (pos > 0) {
var key2 = params2[i2].substring(0, pos);
if (key2 === options2.lookupQuerystring) {
found = params2[i2].substring(pos + 1);
}
}
}
}
return found;
}
};
var hasLocalStorageSupport = null;
var localStorageAvailable = function localStorageAvailable2() {
if (hasLocalStorageSupport !== null)
return hasLocalStorageSupport;
try {
hasLocalStorageSupport = window !== "undefined" && window.localStorage !== null;
var testKey = "i18next.translate.boo";
window.localStorage.setItem(testKey, "foo");
window.localStorage.removeItem(testKey);
} catch (e7) {
hasLocalStorageSupport = false;
}
return hasLocalStorageSupport;
};
var localStorage = {
name: "localStorage",
lookup: function lookup3(options2) {
var found;
if (options2.lookupLocalStorage && localStorageAvailable()) {
var lng = window.localStorage.getItem(options2.lookupLocalStorage);
if (lng)
found = lng;
}
return found;
},
cacheUserLanguage: function cacheUserLanguage2(lng, options2) {
if (options2.lookupLocalStorage && localStorageAvailable()) {
window.localStorage.setItem(options2.lookupLocalStorage, lng);
}
}
};
var hasSessionStorageSupport = null;
var sessionStorageAvailable = function sessionStorageAvailable2() {
if (hasSessionStorageSupport !== null)
return hasSessionStorageSupport;
try {
hasSessionStorageSupport = window !== "undefined" && window.sessionStorage !== null;
var testKey = "i18next.translate.boo";
window.sessionStorage.setItem(testKey, "foo");
window.sessionStorage.removeItem(testKey);
} catch (e7) {
hasSessionStorageSupport = false;
}
return hasSessionStorageSupport;
};
var sessionStorage$1 = {
name: "sessionStorage",
lookup: function lookup4(options2) {
var found;
if (options2.lookupSessionStorage && sessionStorageAvailable()) {
var lng = window.sessionStorage.getItem(options2.lookupSessionStorage);
if (lng)
found = lng;
}
return found;
},
cacheUserLanguage: function cacheUserLanguage3(lng, options2) {
if (options2.lookupSessionStorage && sessionStorageAvailable()) {
window.sessionStorage.setItem(options2.lookupSessionStorage, lng);
}
}
};
var navigator$1 = {
name: "navigator",
lookup: function lookup5(options2) {
var found = [];
if (typeof navigator !== "undefined") {
if (navigator.languages) {
for (var i2 = 0; i2 < navigator.languages.length; i2++) {
found.push(navigator.languages[i2]);
}
}
if (navigator.userLanguage) {
found.push(navigator.userLanguage);
}
if (navigator.language) {
found.push(navigator.language);
}
}
return found.length > 0 ? found : void 0;
}
};
var htmlTag = {
name: "htmlTag",
lookup: function lookup6(options2) {
var found;
var htmlTag2 = options2.htmlTag || (typeof document !== "undefined" ? document.documentElement : null);
if (htmlTag2 && typeof htmlTag2.getAttribute === "function") {
found = htmlTag2.getAttribute("lang");
}
return found;
}
};
var path$4 = {
name: "path",
lookup: function lookup7(options2) {
var found;
if (typeof window !== "undefined") {
var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
if (language instanceof Array) {
if (typeof options2.lookupFromPathIndex === "number") {
if (typeof language[options2.lookupFromPathIndex] !== "string") {
return void 0;
}
found = language[options2.lookupFromPathIndex].replace("/", "");
} else {
found = language[0].replace("/", "");
}
}
}
return found;
}
};
var subdomain = {
name: "subdomain",
lookup: function lookup8(options2) {
var lookupFromSubdomainIndex = typeof options2.lookupFromSubdomainIndex === "number" ? options2.lookupFromSubdomainIndex + 1 : 1;
var language = typeof window !== "undefined" && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
if (!language)
return void 0;
return language[lookupFromSubdomainIndex];
}
};
function getDefaults$1() {
return {
order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"],
lookupQuerystring: "lng",
lookupCookie: "i18next",
lookupLocalStorage: "i18nextLng",
lookupSessionStorage: "i18nextLng",
// cache user language
caches: ["localStorage"],
excludeCacheFor: ["cimode"],
// cookieMinutes: 10,
// cookieDomain: 'myDomain'
convertDetectedLanguage: function convertDetectedLanguage(l2) {
return l2;
}
};
}
var Browser = /* @__PURE__ */ function() {
function Browser2(services) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck$1(this, Browser2);
this.type = "languageDetector";
this.detectors = {};
this.init(services, options2);
}
_createClass(Browser2, [{
key: "init",
value: function init3(services) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var i18nOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
this.services = services || {
languageUtils: {}
};
this.options = defaults$1(options2, this.options || {}, getDefaults$1());
if (typeof this.options.convertDetectedLanguage === "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1) {
this.options.convertDetectedLanguage = function(l2) {
return l2.replace("-", "_");
};
}
if (this.options.lookupFromUrlIndex)
this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
this.i18nOptions = i18nOptions;
this.addDetector(cookie$1);
this.addDetector(querystring);
this.addDetector(localStorage);
this.addDetector(sessionStorage$1);
this.addDetector(navigator$1);
this.addDetector(htmlTag);
this.addDetector(path$4);
this.addDetector(subdomain);
}
}, {
key: "addDetector",
value: function addDetector(detector) {
this.detectors[detector.name] = detector;
}
}, {
key: "detect",
value: function detect2(detectionOrder) {
var _this = this;
if (!detectionOrder)
detectionOrder = this.options.order;
var detected = [];
detectionOrder.forEach(function(detectorName) {
if (_this.detectors[detectorName]) {
var lookup10 = _this.detectors[detectorName].lookup(_this.options);
if (lookup10 && typeof lookup10 === "string")
lookup10 = [lookup10];
if (lookup10)
detected = detected.concat(lookup10);
}
});
detected = detected.map(function(d2) {
return _this.options.convertDetectedLanguage(d2);
});
if (this.services.languageUtils.getBestMatchFromCodes)
return detected;
return detected.length > 0 ? detected[0] : null;
}
}, {
key: "cacheUserLanguage",
value: function cacheUserLanguage4(lng, caches) {
var _this2 = this;
if (!caches)
caches = this.options.caches;
if (!caches)
return;
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1)
return;
caches.forEach(function(cacheName) {
if (_this2.detectors[cacheName])
_this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options);
});
}
}]);
return Browser2;
}();
Browser.type = "languageDetector";
var voidElements = {
"area": true,
"base": true,
"br": true,
"col": true,
"embed": true,
"hr": true,
"img": true,
"input": true,
"link": true,
"meta": true,
"param": true,
"source": true,
"track": true,
"wbr": true
};
const e$m = /* @__PURE__ */ getDefaultExportFromCjs(voidElements);
var t$l = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
function n$a(n2) {
var r2 = { type: "tag", name: "", voidElement: false, attrs: {}, children: [] }, i2 = n2.match(/<\/?([^\s]+?)[/\s>]/);
if (i2 && (r2.name = i2[1], (e$m[i2[1]] || "/" === n2.charAt(n2.length - 2)) && (r2.voidElement = true), r2.name.startsWith("!--"))) {
var s2 = n2.indexOf("-->");
return { type: "comment", comment: -1 !== s2 ? n2.slice(4, s2) : "" };
}
for (var a2 = new RegExp(t$l), c2 = null; null !== (c2 = a2.exec(n2)); )
if (c2[0].trim())
if (c2[1]) {
var o2 = c2[1].trim(), l2 = [o2, ""];
o2.indexOf("=") > -1 && (l2 = o2.split("=")), r2.attrs[l2[0]] = l2[1], a2.lastIndex--;
} else
c2[2] && (r2.attrs[c2[2]] = c2[3].trim().substring(1, c2[3].length - 1));
return r2;
}
var r$m = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, i$g = /^\s*$/, s$h = /* @__PURE__ */ Object.create(null);
function a$p(e7, t5) {
switch (t5.type) {
case "text":
return e7 + t5.content;
case "tag":
return e7 += "<" + t5.name + (t5.attrs ? function(e8) {
var t6 = [];
for (var n2 in e8)
t6.push(n2 + '="' + e8[n2] + '"');
return t6.length ? " " + t6.join(" ") : "";
}(t5.attrs) : "") + (t5.voidElement ? "/>" : ">"), t5.voidElement ? e7 : e7 + t5.children.reduce(a$p, "") + "</" + t5.name + ">";
case "comment":
return e7 + "<!--" + t5.comment + "-->";
}
}
var c$5 = { parse: function(e7, t5) {
t5 || (t5 = {}), t5.components || (t5.components = s$h);
var a2, c2 = [], o2 = [], l2 = -1, m2 = false;
if (0 !== e7.indexOf("<")) {
var u2 = e7.indexOf("<");
c2.push({ type: "text", content: -1 === u2 ? e7 : e7.substring(0, u2) });
}
return e7.replace(r$m, function(r2, s2) {
if (m2) {
if (r2 !== "</" + a2.name + ">")
return;
m2 = false;
}
var u3, f2 = "/" !== r2.charAt(1), h2 = r2.startsWith("<!--"), p2 = s2 + r2.length, d2 = e7.charAt(p2);
if (h2) {
var v2 = n$a(r2);
return l2 < 0 ? (c2.push(v2), c2) : ((u3 = o2[l2]).children.push(v2), c2);
}
if (f2 && (l2++, "tag" === (a2 = n$a(r2)).type && t5.components[a2.name] && (a2.type = "component", m2 = true), a2.voidElement || m2 || !d2 || "<" === d2 || a2.children.push({ type: "text", content: e7.slice(p2, e7.indexOf("<", p2)) }), 0 === l2 && c2.push(a2), (u3 = o2[l2 - 1]) && u3.children.push(a2), o2[l2] = a2), (!f2 || a2.voidElement) && (l2 > -1 && (a2.voidElement || a2.name === r2.slice(2, -1)) && (l2--, a2 = -1 === l2 ? c2 : o2[l2]), !m2 && "<" !== d2 && d2)) {
u3 = -1 === l2 ? c2 : o2[l2].children;
var x2 = e7.indexOf("<", p2), g2 = e7.slice(p2, -1 === x2 ? void 0 : x2);
i$g.test(g2) && (g2 = " "), (x2 > -1 && l2 + u3.length >= 0 || " " !== g2) && u3.push({ type: "text", content: g2 });
}
}), c2;
}, stringify: function(e7) {
return e7.reduce(function(e8, t5) {
return e8 + a$p("", t5);
}, "");
} };
function warn$1() {
if (console && console.warn) {
var _console;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (typeof args[0] === "string")
args[0] = "react-i18next:: ".concat(args[0]);
(_console = console).warn.apply(_console, args);
}
}
var alreadyWarned = {};
function warnOnce() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (typeof args[0] === "string" && alreadyWarned[args[0]])
return;
if (typeof args[0] === "string")
alreadyWarned[args[0]] = /* @__PURE__ */ new Date();
warn$1.apply(void 0, args);
}
var loadedClb = function loadedClb2(i18n, cb2) {
return function() {
if (i18n.isInitialized) {
cb2();
} else {
var initialized = function initialized2() {
setTimeout(function() {
i18n.off("initialized", initialized2);
}, 0);
cb2();
};
i18n.on("initialized", initialized);
}
};
};
function loadNamespaces(i18n, ns, cb2) {
i18n.loadNamespaces(ns, loadedClb(i18n, cb2));
}
function loadLanguages(i18n, lng, ns, cb2) {
if (typeof ns === "string")
ns = [ns];
ns.forEach(function(n2) {
if (i18n.options.ns.indexOf(n2) < 0)
i18n.options.ns.push(n2);
});
i18n.loadLanguages(lng, loadedClb(i18n, cb2));
}
function oldI18nextHasLoadedNamespace(ns, i18n) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var lng = i18n.languages[0];
var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
var lastLng = i18n.languages[i18n.languages.length - 1];
if (lng.toLowerCase() === "cimode")
return true;
var loadNotPending = function loadNotPending2(l2, n2) {
var loadState = i18n.services.backendConnector.state["".concat(l2, "|").concat(n2)];
return loadState === -1 || loadState === 2;
};
if (options2.bindI18n && options2.bindI18n.indexOf("languageChanging") > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns))
return false;
if (i18n.hasResourceBundle(lng, ns))
return true;
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages)
return true;
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns)))
return true;
return false;
}
function hasLoadedNamespace(ns, i18n) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
if (!i18n.languages || !i18n.languages.length) {
warnOnce("i18n.languages were undefined or empty", i18n.languages);
return true;
}
var isNewerI18next = i18n.options.ignoreJSONStructure !== void 0;
if (!isNewerI18next) {
return oldI18nextHasLoadedNamespace(ns, i18n, options2);
}
return i18n.hasLoadedNamespace(ns, {
lng: options2.lng,
precheck: function precheck(i18nInstance2, loadNotPending) {
if (options2.bindI18n && options2.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns))
return false;
}
});
}
function getDisplayName(Component) {
return Component.displayName || Component.name || (typeof Component === "string" && Component.length > 0 ? Component : "Unknown");
}
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
var htmlEntities = {
"&": "&",
"&": "&",
"<": "<",
"<": "<",
">": ">",
">": ">",
"'": "'",
"'": "'",
""": '"',
""": '"',
" ": " ",
" ": " ",
"©": "©",
"©": "©",
"®": "®",
"®": "®",
"…": "…",
"…": "…",
"/": "/",
"/": "/"
};
var unescapeHtmlEntity = function unescapeHtmlEntity2(m2) {
return htmlEntities[m2];
};
var unescape$1 = function unescape2(text2) {
return text2.replace(matchHtmlEntity, unescapeHtmlEntity);
};
function ownKeys$9(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$7(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$9(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$9(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
var defaultOptions = {
bindI18n: "languageChanged",
bindI18nStore: "",
transEmptyNodeValue: "",
transSupportBasicHtmlNodes: true,
transWrapTextNodes: "",
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
useSuspense: true,
unescape: unescape$1
};
function setDefaults() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
defaultOptions = _objectSpread$7(_objectSpread$7({}, defaultOptions), options2);
}
function getDefaults() {
return defaultOptions;
}
var i18nInstance;
function setI18n(instance2) {
i18nInstance = instance2;
}
function getI18n() {
return i18nInstance;
}
var _excluded$2 = ["format"], _excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
function ownKeys$8(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$6(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$8(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$8(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
function hasChildren(node2, checkLength) {
if (!node2)
return false;
var base2 = node2.props ? node2.props.children : node2.children;
if (checkLength)
return base2.length > 0;
return !!base2;
}
function getChildren(node2) {
if (!node2)
return [];
return node2.props ? node2.props.children : node2.children;
}
function hasValidReactChildren(children2) {
if (Object.prototype.toString.call(children2) !== "[object Array]")
return false;
return children2.every(function(child) {
return reactExports.isValidElement(child);
});
}
function getAsArray(data2) {
return Array.isArray(data2) ? data2 : [data2];
}
function mergeProps(source2, target2) {
var newTarget = _objectSpread$6({}, target2);
newTarget.props = Object.assign(source2.props, target2.props);
return newTarget;
}
function nodesToString(children2, i18nOptions) {
if (!children2)
return "";
var stringNode = "";
var childrenArray = getAsArray(children2);
var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
childrenArray.forEach(function(child, childIndex) {
if (typeof child === "string") {
stringNode += "".concat(child);
} else if (reactExports.isValidElement(child)) {
var childPropsCount = Object.keys(child.props).length;
var shouldKeepChild = keepArray.indexOf(child.type) > -1;
var childChildren = child.props.children;
if (!childChildren && shouldKeepChild && childPropsCount === 0) {
stringNode += "<".concat(child.type, "/>");
} else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
} else if (child.props.i18nIsDynamicList) {
stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
} else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === "string") {
stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
} else {
var content2 = nodesToString(childChildren, i18nOptions);
stringNode += "<".concat(childIndex, ">").concat(content2, "</").concat(childIndex, ">");
}
} else if (child === null) {
warn$1("Trans: the passed in value is invalid - seems you passed in a null child.");
} else if (_typeof$3(child) === "object") {
var format2 = child.format, clone2 = _objectWithoutProperties$1(child, _excluded$2);
var keys3 = Object.keys(clone2);
if (keys3.length === 1) {
var value2 = format2 ? "".concat(keys3[0], ", ").concat(format2) : keys3[0];
stringNode += "{{".concat(value2, "}}");
} else {
warn$1("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
}
} else {
warn$1("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.", child);
}
});
return stringNode;
}
function renderNodes(children2, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
if (targetString === "")
return [];
var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join("|")).test(targetString);
if (!children2 && !emptyChildrenButNeedsHandling)
return [targetString];
var data2 = {};
function getData(childs) {
var childrenArray = getAsArray(childs);
childrenArray.forEach(function(child) {
if (typeof child === "string")
return;
if (hasChildren(child))
getData(getChildren(child));
else if (_typeof$3(child) === "object" && !reactExports.isValidElement(child))
Object.assign(data2, child);
});
}
getData(children2);
var ast = c$5.parse("<0>".concat(targetString, "</0>"));
var opts = _objectSpread$6(_objectSpread$6({}, data2), combinedTOpts);
function renderInner(child, node2, rootReactNode) {
var childs = getChildren(child);
var mappedChildren = mapAST(childs, node2.children, rootReactNode);
return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
}
function pushTranslatedJSX(child, inner, mem, i2, isVoid) {
if (child.dummy)
child.children = inner;
mem.push(reactExports.cloneElement(child, _objectSpread$6(_objectSpread$6({}, child.props), {}, {
key: i2
}), isVoid ? void 0 : inner));
}
function mapAST(reactNode, astNode, rootReactNode) {
var reactNodes = getAsArray(reactNode);
var astNodes = getAsArray(astNode);
return astNodes.reduce(function(mem, node2, i2) {
var translationContent = node2.children && node2.children[0] && node2.children[0].content && i18n.services.interpolator.interpolate(node2.children[0].content, opts, i18n.language);
if (node2.type === "tag") {
var tmp = reactNodes[parseInt(node2.name, 10)];
if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node2.name])
tmp = rootReactNode[0][node2.name];
if (!tmp)
tmp = {};
var child = Object.keys(node2.attrs).length !== 0 ? mergeProps({
props: node2.attrs
}, tmp) : tmp;
var isElement2 = reactExports.isValidElement(child);
var isValidTranslationWithChildren = isElement2 && hasChildren(node2, true) && !node2.voidElement;
var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof$3(child) === "object" && child.dummy && !isElement2;
var isKnownComponent = _typeof$3(children2) === "object" && children2 !== null && Object.hasOwnProperty.call(children2, node2.name);
if (typeof child === "string") {
var value2 = i18n.services.interpolator.interpolate(child, opts, i18n.language);
mem.push(value2);
} else if (hasChildren(child) || isValidTranslationWithChildren) {
var inner = renderInner(child, node2, rootReactNode);
pushTranslatedJSX(child, inner, mem, i2);
} else if (isEmptyTransWithHTML) {
var _inner = mapAST(reactNodes, node2.children, rootReactNode);
mem.push(reactExports.cloneElement(child, _objectSpread$6(_objectSpread$6({}, child.props), {}, {
key: i2
}), _inner));
} else if (Number.isNaN(parseFloat(node2.name))) {
if (isKnownComponent) {
var _inner2 = renderInner(child, node2, rootReactNode);
pushTranslatedJSX(child, _inner2, mem, i2, node2.voidElement);
} else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node2.name) > -1) {
if (node2.voidElement) {
mem.push(reactExports.createElement(node2.name, {
key: "".concat(node2.name, "-").concat(i2)
}));
} else {
var _inner3 = mapAST(reactNodes, node2.children, rootReactNode);
mem.push(reactExports.createElement(node2.name, {
key: "".concat(node2.name, "-").concat(i2)
}, _inner3));
}
} else if (node2.voidElement) {
mem.push("<".concat(node2.name, " />"));
} else {
var _inner4 = mapAST(reactNodes, node2.children, rootReactNode);
mem.push("<".concat(node2.name, ">").concat(_inner4, "</").concat(node2.name, ">"));
}
} else if (_typeof$3(child) === "object" && !isElement2) {
var content2 = node2.children[0] ? translationContent : null;
if (content2)
mem.push(content2);
} else if (node2.children.length === 1 && translationContent) {
mem.push(reactExports.cloneElement(child, _objectSpread$6(_objectSpread$6({}, child.props), {}, {
key: i2
}), translationContent));
} else {
mem.push(reactExports.cloneElement(child, _objectSpread$6(_objectSpread$6({}, child.props), {}, {
key: i2
})));
}
} else if (node2.type === "text") {
var wrapTextNodes = i18nOptions.transWrapTextNodes;
var _content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node2.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node2.content, opts, i18n.language);
if (wrapTextNodes) {
mem.push(reactExports.createElement(wrapTextNodes, {
key: "".concat(node2.name, "-").concat(i2)
}, _content));
} else {
mem.push(_content);
}
}
return mem;
}, []);
}
var result = mapAST([{
dummy: true,
children: children2 || []
}], ast, getAsArray(children2 || []));
return getChildren(result[0]);
}
function Trans$1(_ref3) {
var children2 = _ref3.children, count2 = _ref3.count, parent = _ref3.parent, i18nKey = _ref3.i18nKey, context2 = _ref3.context, _ref$tOptions = _ref3.tOptions, tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions, values2 = _ref3.values, defaults2 = _ref3.defaults, components2 = _ref3.components, ns = _ref3.ns, i18nFromProps = _ref3.i18n, tFromProps = _ref3.t, shouldUnescape = _ref3.shouldUnescape, additionalProps = _objectWithoutProperties$1(_ref3, _excluded2);
var i18n = i18nFromProps || getI18n();
if (!i18n) {
warnOnce("You will need to pass in an i18next instance by using i18nextReactModule");
return children2;
}
var t5 = tFromProps || i18n.t.bind(i18n) || function(k2) {
return k2;
};
if (context2)
tOptions.context = context2;
var reactI18nextOptions = _objectSpread$6(_objectSpread$6({}, getDefaults()), i18n.options && i18n.options.react);
var namespaces = ns || t5.ns || i18n.options && i18n.options.defaultNS;
namespaces = typeof namespaces === "string" ? [namespaces] : namespaces || ["translation"];
var defaultValue2 = defaults2 || nodesToString(children2, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
var hashTransKey = reactI18nextOptions.hashTransKey;
var key2 = i18nKey || (hashTransKey ? hashTransKey(defaultValue2) : defaultValue2);
var interpolationOverride = values2 ? tOptions.interpolation : {
interpolation: _objectSpread$6(_objectSpread$6({}, tOptions.interpolation), {}, {
prefix: "#$?",
suffix: "?$#"
})
};
var combinedTOpts = _objectSpread$6(_objectSpread$6(_objectSpread$6(_objectSpread$6({}, tOptions), {}, {
count: count2
}, values2), interpolationOverride), {}, {
defaultValue: defaultValue2,
ns: namespaces
});
var translation = key2 ? t5(key2, combinedTOpts) : defaultValue2;
var content2 = renderNodes(components2 || children2, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
var useAsParent = parent !== void 0 ? parent : reactI18nextOptions.defaultTransParent;
return useAsParent ? reactExports.createElement(useAsParent, additionalProps, content2) : content2;
}
var initReactI18next = {
type: "3rdParty",
init: function init(instance2) {
setDefaults(instance2.options.react);
setI18n(instance2);
}
};
var I18nContext = reactExports.createContext();
var ReportNamespaces = function() {
function ReportNamespaces2() {
_classCallCheck$1(this, ReportNamespaces2);
this.usedNamespaces = {};
}
_createClass(ReportNamespaces2, [{
key: "addUsedNamespaces",
value: function addUsedNamespaces(namespaces) {
var _this = this;
namespaces.forEach(function(ns) {
if (!_this.usedNamespaces[ns])
_this.usedNamespaces[ns] = true;
});
}
}, {
key: "getUsedNamespaces",
value: function getUsedNamespaces() {
return Object.keys(this.usedNamespaces);
}
}]);
return ReportNamespaces2;
}();
var _excluded$1 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
function ownKeys$7(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$5(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$7(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$7(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
function Trans(_ref3) {
var children2 = _ref3.children, count2 = _ref3.count, parent = _ref3.parent, i18nKey = _ref3.i18nKey, context2 = _ref3.context, _ref$tOptions = _ref3.tOptions, tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions, values2 = _ref3.values, defaults2 = _ref3.defaults, components2 = _ref3.components, ns = _ref3.ns, i18nFromProps = _ref3.i18n, tFromProps = _ref3.t, shouldUnescape = _ref3.shouldUnescape, additionalProps = _objectWithoutProperties$1(_ref3, _excluded$1);
var _ref22 = reactExports.useContext(I18nContext) || {}, i18nFromContext = _ref22.i18n, defaultNSFromContext = _ref22.defaultNS;
var i18n = i18nFromProps || i18nFromContext || getI18n();
var t5 = tFromProps || i18n && i18n.t.bind(i18n);
return Trans$1(_objectSpread$5({
children: children2,
count: count2,
parent,
i18nKey,
context: context2,
tOptions,
values: values2,
defaults: defaults2,
components: components2,
ns: ns || t5 && t5.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
i18n,
t: tFromProps,
shouldUnescape
}, additionalProps));
}
function ownKeys$6(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$4(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$6(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$6(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
var usePrevious = function usePrevious2(value2, ignore) {
var ref2 = reactExports.useRef();
reactExports.useEffect(function() {
ref2.current = ignore ? ref2.current : value2;
}, [value2, ignore]);
return ref2.current;
};
function useTranslation(ns) {
var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var i18nFromProps = props.i18n;
var _ref3 = reactExports.useContext(I18nContext) || {}, i18nFromContext = _ref3.i18n, defaultNSFromContext = _ref3.defaultNS;
var i18n = i18nFromProps || i18nFromContext || getI18n();
if (i18n && !i18n.reportNamespaces)
i18n.reportNamespaces = new ReportNamespaces();
if (!i18n) {
warnOnce("You will need to pass in an i18next instance by using initReactI18next");
var notReadyT = function notReadyT2(k2, optsOrDefaultValue) {
if (typeof optsOrDefaultValue === "string")
return optsOrDefaultValue;
if (optsOrDefaultValue && _typeof$3(optsOrDefaultValue) === "object" && typeof optsOrDefaultValue.defaultValue === "string")
return optsOrDefaultValue.defaultValue;
return Array.isArray(k2) ? k2[k2.length - 1] : k2;
};
var retNotReady = [notReadyT, {}, false];
retNotReady.t = notReadyT;
retNotReady.i18n = {};
retNotReady.ready = false;
return retNotReady;
}
if (i18n.options.react && i18n.options.react.wait !== void 0)
warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
var i18nOptions = _objectSpread$4(_objectSpread$4(_objectSpread$4({}, getDefaults()), i18n.options.react), props);
var useSuspense = i18nOptions.useSuspense, keyPrefix = i18nOptions.keyPrefix;
var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
namespaces = typeof namespaces === "string" ? [namespaces] : namespaces || ["translation"];
if (i18n.reportNamespaces.addUsedNamespaces)
i18n.reportNamespaces.addUsedNamespaces(namespaces);
var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function(n2) {
return hasLoadedNamespace(n2, i18n, i18nOptions);
});
function getT() {
return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
}
var _useState = reactExports.useState(getT), _useState2 = _slicedToArray$2(_useState, 2), t5 = _useState2[0], setT = _useState2[1];
var joinedNS = namespaces.join();
if (props.lng)
joinedNS = "".concat(props.lng).concat(joinedNS);
var previousJoinedNS = usePrevious(joinedNS);
var isMounted = reactExports.useRef(true);
reactExports.useEffect(function() {
var bindI18n = i18nOptions.bindI18n, bindI18nStore = i18nOptions.bindI18nStore;
isMounted.current = true;
if (!ready && !useSuspense) {
if (props.lng) {
loadLanguages(i18n, props.lng, namespaces, function() {
if (isMounted.current)
setT(getT);
});
} else {
loadNamespaces(i18n, namespaces, function() {
if (isMounted.current)
setT(getT);
});
}
}
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
setT(getT);
}
function boundReset() {
if (isMounted.current)
setT(getT);
}
if (bindI18n && i18n)
i18n.on(bindI18n, boundReset);
if (bindI18nStore && i18n)
i18n.store.on(bindI18nStore, boundReset);
return function() {
isMounted.current = false;
if (bindI18n && i18n)
bindI18n.split(" ").forEach(function(e7) {
return i18n.off(e7, boundReset);
});
if (bindI18nStore && i18n)
bindI18nStore.split(" ").forEach(function(e7) {
return i18n.store.off(e7, boundReset);
});
};
}, [i18n, joinedNS]);
var isInitial = reactExports.useRef(true);
reactExports.useEffect(function() {
if (isMounted.current && !isInitial.current) {
setT(getT);
}
isInitial.current = false;
}, [i18n, keyPrefix]);
var ret = [t5, i18n, ready];
ret.t = t5;
ret.i18n = i18n;
ret.ready = ready;
if (ready)
return ret;
if (!ready && !useSuspense)
return ret;
throw new Promise(function(resolve3) {
if (props.lng) {
loadLanguages(i18n, props.lng, namespaces, function() {
return resolve3();
});
} else {
loadNamespaces(i18n, namespaces, function() {
return resolve3();
});
}
});
}
var _excluded = ["forwardedRef"];
function ownKeys$5(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$3(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$5(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$5(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
function withTranslation(ns) {
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return function Extend2(WrappedComponent) {
function I18nextWithTranslation(_ref3) {
var forwardedRef = _ref3.forwardedRef, rest = _objectWithoutProperties$1(_ref3, _excluded);
var _useTranslation = useTranslation(ns, _objectSpread$3(_objectSpread$3({}, rest), {}, {
keyPrefix: options2.keyPrefix
})), _useTranslation2 = _slicedToArray$2(_useTranslation, 3), t5 = _useTranslation2[0], i18n = _useTranslation2[1], ready = _useTranslation2[2];
var passDownProps = _objectSpread$3(_objectSpread$3({}, rest), {}, {
t: t5,
i18n,
tReady: ready
});
if (options2.withRef && forwardedRef) {
passDownProps.ref = forwardedRef;
} else if (!options2.withRef && forwardedRef) {
passDownProps.forwardedRef = forwardedRef;
}
return reactExports.createElement(WrappedComponent, passDownProps);
}
I18nextWithTranslation.displayName = "withI18nextTranslation(".concat(getDisplayName(WrappedComponent), ")");
I18nextWithTranslation.WrappedComponent = WrappedComponent;
var forwardRef2 = function forwardRef3(props, ref2) {
return reactExports.createElement(I18nextWithTranslation, Object.assign({}, props, {
forwardedRef: ref2
}));
};
return options2.withRef ? reactExports.forwardRef(forwardRef2) : I18nextWithTranslation;
};
}
function isFunction$3(value2) {
return typeof value2 === "function";
}
function createErrorClass(createImpl) {
var _super = function(instance2) {
Error.call(instance2);
instance2.stack = new Error().stack;
};
var ctorFunc = createImpl(_super);
ctorFunc.prototype = Object.create(Error.prototype);
ctorFunc.prototype.constructor = ctorFunc;
return ctorFunc;
}
var UnsubscriptionError = createErrorClass(function(_super) {
return function UnsubscriptionErrorImpl(errors) {
_super(this);
this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i2) {
return i2 + 1 + ") " + err.toString();
}).join("\n ") : "";
this.name = "UnsubscriptionError";
this.errors = errors;
};
});
function arrRemove(arr2, item) {
if (arr2) {
var index2 = arr2.indexOf(item);
0 <= index2 && arr2.splice(index2, 1);
}
}
var Subscription = function() {
function Subscription2(initialTeardown) {
this.initialTeardown = initialTeardown;
this.closed = false;
this._parentage = null;
this._finalizers = null;
}
Subscription2.prototype.unsubscribe = function() {
var e_1, _a2, e_2, _b2;
var errors;
if (!this.closed) {
this.closed = true;
var _parentage = this._parentage;
if (_parentage) {
this._parentage = null;
if (Array.isArray(_parentage)) {
try {
for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
var parent_1 = _parentage_1_1.value;
parent_1.remove(this);
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (_parentage_1_1 && !_parentage_1_1.done && (_a2 = _parentage_1.return))
_a2.call(_parentage_1);
} finally {
if (e_1)
throw e_1.error;
}
}
} else {
_parentage.remove(this);
}
}
var initialFinalizer = this.initialTeardown;
if (isFunction$3(initialFinalizer)) {
try {
initialFinalizer();
} catch (e7) {
errors = e7 instanceof UnsubscriptionError ? e7.errors : [e7];
}
}
var _finalizers = this._finalizers;
if (_finalizers) {
this._finalizers = null;
try {
for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
var finalizer = _finalizers_1_1.value;
try {
execFinalizer(finalizer);
} catch (err) {
errors = errors !== null && errors !== void 0 ? errors : [];
if (err instanceof UnsubscriptionError) {
errors = __spreadArray$1(__spreadArray$1([], __read(errors)), __read(err.errors));
} else {
errors.push(err);
}
}
}
} catch (e_2_1) {
e_2 = { error: e_2_1 };
} finally {
try {
if (_finalizers_1_1 && !_finalizers_1_1.done && (_b2 = _finalizers_1.return))
_b2.call(_finalizers_1);
} finally {
if (e_2)
throw e_2.error;
}
}
}
if (errors) {
throw new UnsubscriptionError(errors);
}
}
};
Subscription2.prototype.add = function(teardown) {
var _a2;
if (teardown && teardown !== this) {
if (this.closed) {
execFinalizer(teardown);
} else {
if (teardown instanceof Subscription2) {
if (teardown.closed || teardown._hasParent(this)) {
return;
}
teardown._addParent(this);
}
(this._finalizers = (_a2 = this._finalizers) !== null && _a2 !== void 0 ? _a2 : []).push(teardown);
}
}
};
Subscription2.prototype._hasParent = function(parent) {
var _parentage = this._parentage;
return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
};
Subscription2.prototype._addParent = function(parent) {
var _parentage = this._parentage;
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
};
Subscription2.prototype._removeParent = function(parent) {
var _parentage = this._parentage;
if (_parentage === parent) {
this._parentage = null;
} else if (Array.isArray(_parentage)) {
arrRemove(_parentage, parent);
}
};
Subscription2.prototype.remove = function(teardown) {
var _finalizers = this._finalizers;
_finalizers && arrRemove(_finalizers, teardown);
if (teardown instanceof Subscription2) {
teardown._removeParent(this);
}
};
Subscription2.EMPTY = function() {
var empty2 = new Subscription2();
empty2.closed = true;
return empty2;
}();
return Subscription2;
}();
var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
function isSubscription(value2) {
return value2 instanceof Subscription || value2 && "closed" in value2 && isFunction$3(value2.remove) && isFunction$3(value2.add) && isFunction$3(value2.unsubscribe);
}
function execFinalizer(finalizer) {
if (isFunction$3(finalizer)) {
finalizer();
} else {
finalizer.unsubscribe();
}
}
var config = {
onUnhandledError: null,
onStoppedNotification: null,
Promise: void 0,
useDeprecatedSynchronousErrorHandling: false,
useDeprecatedNextContext: false
};
var timeoutProvider = {
setTimeout: function(handler, timeout2) {
var args = [];
for (var _i2 = 2; _i2 < arguments.length; _i2++) {
args[_i2 - 2] = arguments[_i2];
}
var delegate2 = timeoutProvider.delegate;
if (delegate2 === null || delegate2 === void 0 ? void 0 : delegate2.setTimeout) {
return delegate2.setTimeout.apply(delegate2, __spreadArray$1([handler, timeout2], __read(args)));
}
return setTimeout.apply(void 0, __spreadArray$1([handler, timeout2], __read(args)));
},
clearTimeout: function(handle2) {
var delegate2 = timeoutProvider.delegate;
return ((delegate2 === null || delegate2 === void 0 ? void 0 : delegate2.clearTimeout) || clearTimeout)(handle2);
},
delegate: void 0
};
function reportUnhandledError(err) {
timeoutProvider.setTimeout(function() {
{
throw err;
}
});
}
function noop$7() {
}
function errorContext(cb2) {
{
cb2();
}
}
var Subscriber = function(_super) {
__extends$1(Subscriber2, _super);
function Subscriber2(destination) {
var _this = _super.call(this) || this;
_this.isStopped = false;
if (destination) {
_this.destination = destination;
if (isSubscription(destination)) {
destination.add(_this);
}
} else {
_this.destination = EMPTY_OBSERVER;
}
return _this;
}
Subscriber2.create = function(next2, error3, complete) {
return new SafeSubscriber(next2, error3, complete);
};
Subscriber2.prototype.next = function(value2) {
if (this.isStopped)
;
else {
this._next(value2);
}
};
Subscriber2.prototype.error = function(err) {
if (this.isStopped)
;
else {
this.isStopped = true;
this._error(err);
}
};
Subscriber2.prototype.complete = function() {
if (this.isStopped)
;
else {
this.isStopped = true;
this._complete();
}
};
Subscriber2.prototype.unsubscribe = function() {
if (!this.closed) {
this.isStopped = true;
_super.prototype.unsubscribe.call(this);
this.destination = null;
}
};
Subscriber2.prototype._next = function(value2) {
this.destination.next(value2);
};
Subscriber2.prototype._error = function(err) {
try {
this.destination.error(err);
} finally {
this.unsubscribe();
}
};
Subscriber2.prototype._complete = function() {
try {
this.destination.complete();
} finally {
this.unsubscribe();
}
};
return Subscriber2;
}(Subscription);
var _bind = Function.prototype.bind;
function bind$7(fn8, thisArg) {
return _bind.call(fn8, thisArg);
}
var ConsumerObserver = function() {
function ConsumerObserver2(partialObserver) {
this.partialObserver = partialObserver;
}
ConsumerObserver2.prototype.next = function(value2) {
var partialObserver = this.partialObserver;
if (partialObserver.next) {
try {
partialObserver.next(value2);
} catch (error3) {
handleUnhandledError(error3);
}
}
};
ConsumerObserver2.prototype.error = function(err) {
var partialObserver = this.partialObserver;
if (partialObserver.error) {
try {
partialObserver.error(err);
} catch (error3) {
handleUnhandledError(error3);
}
} else {
handleUnhandledError(err);
}
};
ConsumerObserver2.prototype.complete = function() {
var partialObserver = this.partialObserver;
if (partialObserver.complete) {
try {
partialObserver.complete();
} catch (error3) {
handleUnhandledError(error3);
}
}
};
return ConsumerObserver2;
}();
var SafeSubscriber = function(_super) {
__extends$1(SafeSubscriber2, _super);
function SafeSubscriber2(observerOrNext, error3, complete) {
var _this = _super.call(this) || this;
var partialObserver;
if (isFunction$3(observerOrNext) || !observerOrNext) {
partialObserver = {
next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
error: error3 !== null && error3 !== void 0 ? error3 : void 0,
complete: complete !== null && complete !== void 0 ? complete : void 0
};
} else {
var context_1;
if (_this && config.useDeprecatedNextContext) {
context_1 = Object.create(observerOrNext);
context_1.unsubscribe = function() {
return _this.unsubscribe();
};
partialObserver = {
next: observerOrNext.next && bind$7(observerOrNext.next, context_1),
error: observerOrNext.error && bind$7(observerOrNext.error, context_1),
complete: observerOrNext.complete && bind$7(observerOrNext.complete, context_1)
};
} else {
partialObserver = observerOrNext;
}
}
_this.destination = new ConsumerObserver(partialObserver);
return _this;
}
return SafeSubscriber2;
}(Subscriber);
function handleUnhandledError(error3) {
{
reportUnhandledError(error3);
}
}
function defaultErrorHandler(err) {
throw err;
}
var EMPTY_OBSERVER = {
closed: true,
next: noop$7,
error: defaultErrorHandler,
complete: noop$7
};
var observable = function() {
return typeof Symbol === "function" && Symbol.observable || "@@observable";
}();
function identity$7(x2) {
return x2;
}
function pipeFromArray(fns) {
if (fns.length === 0) {
return identity$7;
}
if (fns.length === 1) {
return fns[0];
}
return function piped(input) {
return fns.reduce(function(prev2, fn8) {
return fn8(prev2);
}, input);
};
}
var Observable = function() {
function Observable2(subscribe) {
if (subscribe) {
this._subscribe = subscribe;
}
}
Observable2.prototype.lift = function(operator2) {
var observable2 = new Observable2();
observable2.source = this;
observable2.operator = operator2;
return observable2;
};
Observable2.prototype.subscribe = function(observerOrNext, error3, complete) {
var _this = this;
var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error3, complete);
errorContext(function() {
var _a2 = _this, operator2 = _a2.operator, source2 = _a2.source;
subscriber.add(operator2 ? operator2.call(subscriber, source2) : source2 ? _this._subscribe(subscriber) : _this._trySubscribe(subscriber));
});
return subscriber;
};
Observable2.prototype._trySubscribe = function(sink) {
try {
return this._subscribe(sink);
} catch (err) {
sink.error(err);
}
};
Observable2.prototype.forEach = function(next2, promiseCtor) {
var _this = this;
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor(function(resolve3, reject2) {
var subscriber = new SafeSubscriber({
next: function(value2) {
try {
next2(value2);
} catch (err) {
reject2(err);
subscriber.unsubscribe();
}
},
error: reject2,
complete: resolve3
});
_this.subscribe(subscriber);
});
};
Observable2.prototype._subscribe = function(subscriber) {
var _a2;
return (_a2 = this.source) === null || _a2 === void 0 ? void 0 : _a2.subscribe(subscriber);
};
Observable2.prototype[observable] = function() {
return this;
};
Observable2.prototype.pipe = function() {
var operations = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
operations[_i2] = arguments[_i2];
}
return pipeFromArray(operations)(this);
};
Observable2.prototype.toPromise = function(promiseCtor) {
var _this = this;
promiseCtor = getPromiseCtor(promiseCtor);
return new promiseCtor(function(resolve3, reject2) {
var value2;
_this.subscribe(function(x2) {
return value2 = x2;
}, function(err) {
return reject2(err);
}, function() {
return resolve3(value2);
});
});
};
Observable2.create = function(subscribe) {
return new Observable2(subscribe);
};
return Observable2;
}();
function getPromiseCtor(promiseCtor) {
var _a2;
return (_a2 = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a2 !== void 0 ? _a2 : Promise;
}
function isObserver(value2) {
return value2 && isFunction$3(value2.next) && isFunction$3(value2.error) && isFunction$3(value2.complete);
}
function isSubscriber(value2) {
return value2 && value2 instanceof Subscriber || isObserver(value2) && isSubscription(value2);
}
function hasLift(source2) {
return isFunction$3(source2 === null || source2 === void 0 ? void 0 : source2.lift);
}
function operate(init3) {
return function(source2) {
if (hasLift(source2)) {
return source2.lift(function(liftedSource) {
try {
return init3(liftedSource, this);
} catch (err) {
this.error(err);
}
});
}
throw new TypeError("Unable to lift unknown Observable type");
};
}
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
}
var OperatorSubscriber = function(_super) {
__extends$1(OperatorSubscriber2, _super);
function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
var _this = _super.call(this, destination) || this;
_this.onFinalize = onFinalize;
_this.shouldUnsubscribe = shouldUnsubscribe;
_this._next = onNext ? function(value2) {
try {
onNext(value2);
} catch (err) {
destination.error(err);
}
} : _super.prototype._next;
_this._error = onError ? function(err) {
try {
onError(err);
} catch (err2) {
destination.error(err2);
} finally {
this.unsubscribe();
}
} : _super.prototype._error;
_this._complete = onComplete ? function() {
try {
onComplete();
} catch (err) {
destination.error(err);
} finally {
this.unsubscribe();
}
} : _super.prototype._complete;
return _this;
}
OperatorSubscriber2.prototype.unsubscribe = function() {
var _a2;
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
var closed_1 = this.closed;
_super.prototype.unsubscribe.call(this);
!closed_1 && ((_a2 = this.onFinalize) === null || _a2 === void 0 ? void 0 : _a2.call(this));
}
};
return OperatorSubscriber2;
}(Subscriber);
var ObjectUnsubscribedError = createErrorClass(function(_super) {
return function ObjectUnsubscribedErrorImpl() {
_super(this);
this.name = "ObjectUnsubscribedError";
this.message = "object unsubscribed";
};
});
var Subject = function(_super) {
__extends$1(Subject2, _super);
function Subject2() {
var _this = _super.call(this) || this;
_this.closed = false;
_this.currentObservers = null;
_this.observers = [];
_this.isStopped = false;
_this.hasError = false;
_this.thrownError = null;
return _this;
}
Subject2.prototype.lift = function(operator2) {
var subject = new AnonymousSubject(this, this);
subject.operator = operator2;
return subject;
};
Subject2.prototype._throwIfClosed = function() {
if (this.closed) {
throw new ObjectUnsubscribedError();
}
};
Subject2.prototype.next = function(value2) {
var _this = this;
errorContext(function() {
var e_1, _a2;
_this._throwIfClosed();
if (!_this.isStopped) {
if (!_this.currentObservers) {
_this.currentObservers = Array.from(_this.observers);
}
try {
for (var _b2 = __values(_this.currentObservers), _c2 = _b2.next(); !_c2.done; _c2 = _b2.next()) {
var observer = _c2.value;
observer.next(value2);
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (_c2 && !_c2.done && (_a2 = _b2.return))
_a2.call(_b2);
} finally {
if (e_1)
throw e_1.error;
}
}
}
});
};
Subject2.prototype.error = function(err) {
var _this = this;
errorContext(function() {
_this._throwIfClosed();
if (!_this.isStopped) {
_this.hasError = _this.isStopped = true;
_this.thrownError = err;
var observers = _this.observers;
while (observers.length) {
observers.shift().error(err);
}
}
});
};
Subject2.prototype.complete = function() {
var _this = this;
errorContext(function() {
_this._throwIfClosed();
if (!_this.isStopped) {
_this.isStopped = true;
var observers = _this.observers;
while (observers.length) {
observers.shift().complete();
}
}
});
};
Subject2.prototype.unsubscribe = function() {
this.isStopped = this.closed = true;
this.observers = this.currentObservers = null;
};
Object.defineProperty(Subject2.prototype, "observed", {
get: function() {
var _a2;
return ((_a2 = this.observers) === null || _a2 === void 0 ? void 0 : _a2.length) > 0;
},
enumerable: false,
configurable: true
});
Subject2.prototype._trySubscribe = function(subscriber) {
this._throwIfClosed();
return _super.prototype._trySubscribe.call(this, subscriber);
};
Subject2.prototype._subscribe = function(subscriber) {
this._throwIfClosed();
this._checkFinalizedStatuses(subscriber);
return this._innerSubscribe(subscriber);
};
Subject2.prototype._innerSubscribe = function(subscriber) {
var _this = this;
var _a2 = this, hasError = _a2.hasError, isStopped = _a2.isStopped, observers = _a2.observers;
if (hasError || isStopped) {
return EMPTY_SUBSCRIPTION;
}
this.currentObservers = null;
observers.push(subscriber);
return new Subscription(function() {
_this.currentObservers = null;
arrRemove(observers, subscriber);
});
};
Subject2.prototype._checkFinalizedStatuses = function(subscriber) {
var _a2 = this, hasError = _a2.hasError, thrownError = _a2.thrownError, isStopped = _a2.isStopped;
if (hasError) {
subscriber.error(thrownError);
} else if (isStopped) {
subscriber.complete();
}
};
Subject2.prototype.asObservable = function() {
var observable2 = new Observable();
observable2.source = this;
return observable2;
};
Subject2.create = function(destination, source2) {
return new AnonymousSubject(destination, source2);
};
return Subject2;
}(Observable);
var AnonymousSubject = function(_super) {
__extends$1(AnonymousSubject2, _super);
function AnonymousSubject2(destination, source2) {
var _this = _super.call(this) || this;
_this.destination = destination;
_this.source = source2;
return _this;
}
AnonymousSubject2.prototype.next = function(value2) {
var _a2, _b2;
(_b2 = (_a2 = this.destination) === null || _a2 === void 0 ? void 0 : _a2.next) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, value2);
};
AnonymousSubject2.prototype.error = function(err) {
var _a2, _b2;
(_b2 = (_a2 = this.destination) === null || _a2 === void 0 ? void 0 : _a2.error) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, err);
};
AnonymousSubject2.prototype.complete = function() {
var _a2, _b2;
(_b2 = (_a2 = this.destination) === null || _a2 === void 0 ? void 0 : _a2.complete) === null || _b2 === void 0 ? void 0 : _b2.call(_a2);
};
AnonymousSubject2.prototype._subscribe = function(subscriber) {
var _a2, _b2;
return (_b2 = (_a2 = this.source) === null || _a2 === void 0 ? void 0 : _a2.subscribe(subscriber)) !== null && _b2 !== void 0 ? _b2 : EMPTY_SUBSCRIPTION;
};
return AnonymousSubject2;
}(Subject);
function isScheduler(value2) {
return value2 && isFunction$3(value2.schedule);
}
function last$1(arr2) {
return arr2[arr2.length - 1];
}
function popResultSelector(args) {
return isFunction$3(last$1(args)) ? args.pop() : void 0;
}
function popScheduler(args) {
return isScheduler(last$1(args)) ? args.pop() : void 0;
}
var isArrayLike$2 = function(x2) {
return x2 && typeof x2.length === "number" && typeof x2 !== "function";
};
function isPromise(value2) {
return isFunction$3(value2 === null || value2 === void 0 ? void 0 : value2.then);
}
function isInteropObservable(input) {
return isFunction$3(input[observable]);
}
function isAsyncIterable(obj) {
return Symbol.asyncIterator && isFunction$3(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
}
function createInvalidObservableTypeError(input) {
return new TypeError("You provided " + (input !== null && typeof input === "object" ? "an invalid object" : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
}
function getSymbolIterator() {
if (typeof Symbol !== "function" || !Symbol.iterator) {
return "@@iterator";
}
return Symbol.iterator;
}
var iterator = getSymbolIterator();
function isIterable$1(input) {
return isFunction$3(input === null || input === void 0 ? void 0 : input[iterator]);
}
function readableStreamLikeToAsyncGenerator(readableStream) {
return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
var reader, _a2, value2, done;
return __generator$1(this, function(_b2) {
switch (_b2.label) {
case 0:
reader = readableStream.getReader();
_b2.label = 1;
case 1:
_b2.trys.push([1, , 9, 10]);
_b2.label = 2;
case 2:
return [4, __await(reader.read())];
case 3:
_a2 = _b2.sent(), value2 = _a2.value, done = _a2.done;
if (!done)
return [3, 5];
return [4, __await(void 0)];
case 4:
return [2, _b2.sent()];
case 5:
return [4, __await(value2)];
case 6:
return [4, _b2.sent()];
case 7:
_b2.sent();
return [3, 2];
case 8:
return [3, 10];
case 9:
reader.releaseLock();
return [7];
case 10:
return [2];
}
});
});
}
function isReadableStreamLike(obj) {
return isFunction$3(obj === null || obj === void 0 ? void 0 : obj.getReader);
}
function innerFrom(input) {
if (input instanceof Observable) {
return input;
}
if (input != null) {
if (isInteropObservable(input)) {
return fromInteropObservable(input);
}
if (isArrayLike$2(input)) {
return fromArrayLike(input);
}
if (isPromise(input)) {
return fromPromise(input);
}
if (isAsyncIterable(input)) {
return fromAsyncIterable(input);
}
if (isIterable$1(input)) {
return fromIterable(input);
}
if (isReadableStreamLike(input)) {
return fromReadableStreamLike(input);
}
}
throw createInvalidObservableTypeError(input);
}
function fromInteropObservable(obj) {
return new Observable(function(subscriber) {
var obs = obj[observable]();
if (isFunction$3(obs.subscribe)) {
return obs.subscribe(subscriber);
}
throw new TypeError("Provided object does not correctly implement Symbol.observable");
});
}
function fromArrayLike(array2) {
return new Observable(function(subscriber) {
for (var i2 = 0; i2 < array2.length && !subscriber.closed; i2++) {
subscriber.next(array2[i2]);
}
subscriber.complete();
});
}
function fromPromise(promise2) {
return new Observable(function(subscriber) {
promise2.then(function(value2) {
if (!subscriber.closed) {
subscriber.next(value2);
subscriber.complete();
}
}, function(err) {
return subscriber.error(err);
}).then(null, reportUnhandledError);
});
}
function fromIterable(iterable) {
return new Observable(function(subscriber) {
var e_1, _a2;
try {
for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {
var value2 = iterable_1_1.value;
subscriber.next(value2);
if (subscriber.closed) {
return;
}
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (iterable_1_1 && !iterable_1_1.done && (_a2 = iterable_1.return))
_a2.call(iterable_1);
} finally {
if (e_1)
throw e_1.error;
}
}
subscriber.complete();
});
}
function fromAsyncIterable(asyncIterable) {
return new Observable(function(subscriber) {
process$5(asyncIterable, subscriber).catch(function(err) {
return subscriber.error(err);
});
});
}
function fromReadableStreamLike(readableStream) {
return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
}
function process$5(asyncIterable, subscriber) {
var asyncIterable_1, asyncIterable_1_1;
var e_2, _a2;
return __awaiter$1(this, void 0, void 0, function() {
var value2, e_2_1;
return __generator$1(this, function(_b2) {
switch (_b2.label) {
case 0:
_b2.trys.push([0, 5, 6, 11]);
asyncIterable_1 = __asyncValues(asyncIterable);
_b2.label = 1;
case 1:
return [4, asyncIterable_1.next()];
case 2:
if (!(asyncIterable_1_1 = _b2.sent(), !asyncIterable_1_1.done))
return [3, 4];
value2 = asyncIterable_1_1.value;
subscriber.next(value2);
if (subscriber.closed) {
return [2];
}
_b2.label = 3;
case 3:
return [3, 1];
case 4:
return [3, 11];
case 5:
e_2_1 = _b2.sent();
e_2 = { error: e_2_1 };
return [3, 11];
case 6:
_b2.trys.push([6, , 9, 10]);
if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a2 = asyncIterable_1.return)))
return [3, 8];
return [4, _a2.call(asyncIterable_1)];
case 7:
_b2.sent();
_b2.label = 8;
case 8:
return [3, 10];
case 9:
if (e_2)
throw e_2.error;
return [7];
case 10:
return [7];
case 11:
subscriber.complete();
return [2];
}
});
});
}
function executeSchedule(parentSubscription, scheduler2, work, delay, repeat2) {
if (delay === void 0) {
delay = 0;
}
if (repeat2 === void 0) {
repeat2 = false;
}
var scheduleSubscription = scheduler2.schedule(function() {
work();
if (repeat2) {
parentSubscription.add(this.schedule(null, delay));
} else {
this.unsubscribe();
}
}, delay);
parentSubscription.add(scheduleSubscription);
if (!repeat2) {
return scheduleSubscription;
}
}
function observeOn(scheduler2, delay) {
if (delay === void 0) {
delay = 0;
}
return operate(function(source2, subscriber) {
source2.subscribe(createOperatorSubscriber(subscriber, function(value2) {
return executeSchedule(subscriber, scheduler2, function() {
return subscriber.next(value2);
}, delay);
}, function() {
return executeSchedule(subscriber, scheduler2, function() {
return subscriber.complete();
}, delay);
}, function(err) {
return executeSchedule(subscriber, scheduler2, function() {
return subscriber.error(err);
}, delay);
}));
});
}
function subscribeOn(scheduler2, delay) {
if (delay === void 0) {
delay = 0;
}
return operate(function(source2, subscriber) {
subscriber.add(scheduler2.schedule(function() {
return source2.subscribe(subscriber);
}, delay));
});
}
function scheduleObservable(input, scheduler2) {
return innerFrom(input).pipe(subscribeOn(scheduler2), observeOn(scheduler2));
}
function schedulePromise(input, scheduler2) {
return innerFrom(input).pipe(subscribeOn(scheduler2), observeOn(scheduler2));
}
function scheduleArray(input, scheduler2) {
return new Observable(function(subscriber) {
var i2 = 0;
return scheduler2.schedule(function() {
if (i2 === input.length) {
subscriber.complete();
} else {
subscriber.next(input[i2++]);
if (!subscriber.closed) {
this.schedule();
}
}
});
});
}
function scheduleIterable(input, scheduler2) {
return new Observable(function(subscriber) {
var iterator$1;
executeSchedule(subscriber, scheduler2, function() {
iterator$1 = input[iterator]();
executeSchedule(subscriber, scheduler2, function() {
var _a2;
var value2;
var done;
try {
_a2 = iterator$1.next(), value2 = _a2.value, done = _a2.done;
} catch (err) {
subscriber.error(err);
return;
}
if (done) {
subscriber.complete();
} else {
subscriber.next(value2);
}
}, 0, true);
});
return function() {
return isFunction$3(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return();
};
});
}
function scheduleAsyncIterable(input, scheduler2) {
if (!input) {
throw new Error("Iterable cannot be null");
}
return new Observable(function(subscriber) {
executeSchedule(subscriber, scheduler2, function() {
var iterator2 = input[Symbol.asyncIterator]();
executeSchedule(subscriber, scheduler2, function() {
iterator2.next().then(function(result) {
if (result.done) {
subscriber.complete();
} else {
subscriber.next(result.value);
}
});
}, 0, true);
});
});
}
function scheduleReadableStreamLike(input, scheduler2) {
return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler2);
}
function scheduled(input, scheduler2) {
if (input != null) {
if (isInteropObservable(input)) {
return scheduleObservable(input, scheduler2);
}
if (isArrayLike$2(input)) {
return scheduleArray(input, scheduler2);
}
if (isPromise(input)) {
return schedulePromise(input, scheduler2);
}
if (isAsyncIterable(input)) {
return scheduleAsyncIterable(input, scheduler2);
}
if (isIterable$1(input)) {
return scheduleIterable(input, scheduler2);
}
if (isReadableStreamLike(input)) {
return scheduleReadableStreamLike(input, scheduler2);
}
}
throw createInvalidObservableTypeError(input);
}
function from(input, scheduler2) {
return scheduler2 ? scheduled(input, scheduler2) : innerFrom(input);
}
function map$3(project2, thisArg) {
return operate(function(source2, subscriber) {
var index2 = 0;
source2.subscribe(createOperatorSubscriber(subscriber, function(value2) {
subscriber.next(project2.call(thisArg, value2, index2++));
}));
});
}
var isArray$6 = Array.isArray;
function callOrApply(fn8, args) {
return isArray$6(args) ? fn8.apply(void 0, __spreadArray$1([], __read(args))) : fn8(args);
}
function mapOneOrManyArgs(fn8) {
return map$3(function(args) {
return callOrApply(fn8, args);
});
}
var isArray$5 = Array.isArray;
var getPrototypeOf$3 = Object.getPrototypeOf, objectProto$2 = Object.prototype, getKeys = Object.keys;
function argsArgArrayOrObject(args) {
if (args.length === 1) {
var first_1 = args[0];
if (isArray$5(first_1)) {
return { args: first_1, keys: null };
}
if (isPOJO(first_1)) {
var keys3 = getKeys(first_1);
return {
args: keys3.map(function(key2) {
return first_1[key2];
}),
keys: keys3
};
}
}
return { args, keys: null };
}
function isPOJO(obj) {
return obj && typeof obj === "object" && getPrototypeOf$3(obj) === objectProto$2;
}
function createObject(keys3, values2) {
return keys3.reduce(function(result, key2, i2) {
return result[key2] = values2[i2], result;
}, {});
}
function combineLatest() {
var args = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
args[_i2] = arguments[_i2];
}
var scheduler2 = popScheduler(args);
var resultSelector = popResultSelector(args);
var _a2 = argsArgArrayOrObject(args), observables = _a2.args, keys3 = _a2.keys;
if (observables.length === 0) {
return from([], scheduler2);
}
var result = new Observable(combineLatestInit(observables, scheduler2, keys3 ? function(values2) {
return createObject(keys3, values2);
} : identity$7));
return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
}
function combineLatestInit(observables, scheduler2, valueTransform) {
if (valueTransform === void 0) {
valueTransform = identity$7;
}
return function(subscriber) {
maybeSchedule(scheduler2, function() {
var length2 = observables.length;
var values2 = new Array(length2);
var active = length2;
var remainingFirstValues = length2;
var _loop_1 = function(i3) {
maybeSchedule(scheduler2, function() {
var source2 = from(observables[i3], scheduler2);
var hasFirstValue = false;
source2.subscribe(createOperatorSubscriber(subscriber, function(value2) {
values2[i3] = value2;
if (!hasFirstValue) {
hasFirstValue = true;
remainingFirstValues--;
}
if (!remainingFirstValues) {
subscriber.next(valueTransform(values2.slice()));
}
}, function() {
if (!--active) {
subscriber.complete();
}
}));
}, subscriber);
};
for (var i2 = 0; i2 < length2; i2++) {
_loop_1(i2);
}
}, subscriber);
};
}
function maybeSchedule(scheduler2, execute, subscription) {
if (scheduler2) {
executeSchedule(subscription, scheduler2, execute);
} else {
execute();
}
}
const PACKET_TYPES = /* @__PURE__ */ Object.create(null);
PACKET_TYPES["open"] = "0";
PACKET_TYPES["close"] = "1";
PACKET_TYPES["ping"] = "2";
PACKET_TYPES["pong"] = "3";
PACKET_TYPES["message"] = "4";
PACKET_TYPES["upgrade"] = "5";
PACKET_TYPES["noop"] = "6";
const PACKET_TYPES_REVERSE = /* @__PURE__ */ Object.create(null);
Object.keys(PACKET_TYPES).forEach((key2) => {
PACKET_TYPES_REVERSE[PACKET_TYPES[key2]] = key2;
});
const ERROR_PACKET = { type: "error", data: "parser error" };
const withNativeBlob$1 = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
const withNativeArrayBuffer$2 = typeof ArrayBuffer === "function";
const isView$1 = (obj) => {
return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer;
};
const encodePacket = ({ type: type2, data: data2 }, supportsBinary, callback) => {
if (withNativeBlob$1 && data2 instanceof Blob) {
if (supportsBinary) {
return callback(data2);
} else {
return encodeBlobAsBase64(data2, callback);
}
} else if (withNativeArrayBuffer$2 && (data2 instanceof ArrayBuffer || isView$1(data2))) {
if (supportsBinary) {
return callback(data2);
} else {
return encodeBlobAsBase64(new Blob([data2]), callback);
}
}
return callback(PACKET_TYPES[type2] + (data2 || ""));
};
const encodeBlobAsBase64 = (data2, callback) => {
const fileReader = new FileReader();
fileReader.onload = function() {
const content2 = fileReader.result.split(",")[1];
callback("b" + (content2 || ""));
};
return fileReader.readAsDataURL(data2);
};
function toArray(data2) {
if (data2 instanceof Uint8Array) {
return data2;
} else if (data2 instanceof ArrayBuffer) {
return new Uint8Array(data2);
} else {
return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength);
}
}
let TEXT_ENCODER;
function encodePacketToBinary(packet, callback) {
if (withNativeBlob$1 && packet.data instanceof Blob) {
return packet.data.arrayBuffer().then(toArray).then(callback);
} else if (withNativeArrayBuffer$2 && (packet.data instanceof ArrayBuffer || isView$1(packet.data))) {
return callback(toArray(packet.data));
}
encodePacket(packet, false, (encoded) => {
if (!TEXT_ENCODER) {
TEXT_ENCODER = new TextEncoder();
}
callback(TEXT_ENCODER.encode(encoded));
});
}
const chars$4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const lookup$a = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for (let i2 = 0; i2 < chars$4.length; i2++) {
lookup$a[chars$4.charCodeAt(i2)] = i2;
}
const decode$3 = (base642) => {
let bufferLength = base642.length * 0.75, len = base642.length, i2, p2 = 0, encoded1, encoded2, encoded3, encoded4;
if (base642[base642.length - 1] === "=") {
bufferLength--;
if (base642[base642.length - 2] === "=") {
bufferLength--;
}
}
const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);
for (i2 = 0; i2 < len; i2 += 4) {
encoded1 = lookup$a[base642.charCodeAt(i2)];
encoded2 = lookup$a[base642.charCodeAt(i2 + 1)];
encoded3 = lookup$a[base642.charCodeAt(i2 + 2)];
encoded4 = lookup$a[base642.charCodeAt(i2 + 3)];
bytes[p2++] = encoded1 << 2 | encoded2 >> 4;
bytes[p2++] = (encoded2 & 15) << 4 | encoded3 >> 2;
bytes[p2++] = (encoded3 & 3) << 6 | encoded4 & 63;
}
return arraybuffer;
};
const withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
const decodePacket = (encodedPacket, binaryType) => {
if (typeof encodedPacket !== "string") {
return {
type: "message",
data: mapBinary(encodedPacket, binaryType)
};
}
const type2 = encodedPacket.charAt(0);
if (type2 === "b") {
return {
type: "message",
data: decodeBase64Packet(encodedPacket.substring(1), binaryType)
};
}
const packetType = PACKET_TYPES_REVERSE[type2];
if (!packetType) {
return ERROR_PACKET;
}
return encodedPacket.length > 1 ? {
type: PACKET_TYPES_REVERSE[type2],
data: encodedPacket.substring(1)
} : {
type: PACKET_TYPES_REVERSE[type2]
};
};
const decodeBase64Packet = (data2, binaryType) => {
if (withNativeArrayBuffer$1) {
const decoded = decode$3(data2);
return mapBinary(decoded, binaryType);
} else {
return { base64: true, data: data2 };
}
};
const mapBinary = (data2, binaryType) => {
switch (binaryType) {
case "blob":
if (data2 instanceof Blob) {
return data2;
} else {
return new Blob([data2]);
}
case "arraybuffer":
default:
if (data2 instanceof ArrayBuffer) {
return data2;
} else {
return data2.buffer;
}
}
};
const SEPARATOR = String.fromCharCode(30);
const encodePayload = (packets, callback) => {
const length2 = packets.length;
const encodedPackets = new Array(length2);
let count2 = 0;
packets.forEach((packet, i2) => {
encodePacket(packet, false, (encodedPacket) => {
encodedPackets[i2] = encodedPacket;
if (++count2 === length2) {
callback(encodedPackets.join(SEPARATOR));
}
});
});
};
const decodePayload = (encodedPayload, binaryType) => {
const encodedPackets = encodedPayload.split(SEPARATOR);
const packets = [];
for (let i2 = 0; i2 < encodedPackets.length; i2++) {
const decodedPacket = decodePacket(encodedPackets[i2], binaryType);
packets.push(decodedPacket);
if (decodedPacket.type === "error") {
break;
}
}
return packets;
};
function createPacketEncoderStream() {
return new TransformStream({
transform(packet, controller) {
encodePacketToBinary(packet, (encodedPacket) => {
const payloadLength = encodedPacket.length;
let header;
if (payloadLength < 126) {
header = new Uint8Array(1);
new DataView(header.buffer).setUint8(0, payloadLength);
} else if (payloadLength < 65536) {
header = new Uint8Array(3);
const view = new DataView(header.buffer);
view.setUint8(0, 126);
view.setUint16(1, payloadLength);
} else {
header = new Uint8Array(9);
const view = new DataView(header.buffer);
view.setUint8(0, 127);
view.setBigUint64(1, BigInt(payloadLength));
}
if (packet.data && typeof packet.data !== "string") {
header[0] |= 128;
}
controller.enqueue(header);
controller.enqueue(encodedPacket);
});
}
});
}
let TEXT_DECODER;
function totalLength(chunks) {
return chunks.reduce((acc, chunk) => acc + chunk.length, 0);
}
function concatChunks(chunks, size) {
if (chunks[0].length === size) {
return chunks.shift();
}
const buffer = new Uint8Array(size);
let j2 = 0;
for (let i2 = 0; i2 < size; i2++) {
buffer[i2] = chunks[0][j2++];
if (j2 === chunks[0].length) {
chunks.shift();
j2 = 0;
}
}
if (chunks.length && j2 < chunks[0].length) {
chunks[0] = chunks[0].slice(j2);
}
return buffer;
}
function createPacketDecoderStream(maxPayload, binaryType) {
if (!TEXT_DECODER) {
TEXT_DECODER = new TextDecoder();
}
const chunks = [];
let state = 0;
let expectedLength = -1;
let isBinary2 = false;
return new TransformStream({
transform(chunk, controller) {
chunks.push(chunk);
while (true) {
if (state === 0) {
if (totalLength(chunks) < 1) {
break;
}
const header = concatChunks(chunks, 1);
isBinary2 = (header[0] & 128) === 128;
expectedLength = header[0] & 127;
if (expectedLength < 126) {
state = 3;
} else if (expectedLength === 126) {
state = 1;
} else {
state = 2;
}
} else if (state === 1) {
if (totalLength(chunks) < 2) {
break;
}
const headerArray = concatChunks(chunks, 2);
expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);
state = 3;
} else if (state === 2) {
if (totalLength(chunks) < 8) {
break;
}
const headerArray = concatChunks(chunks, 8);
const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);
const n2 = view.getUint32(0);
if (n2 > Math.pow(2, 53 - 32) - 1) {
controller.enqueue(ERROR_PACKET);
break;
}
expectedLength = n2 * Math.pow(2, 32) + view.getUint32(4);
state = 3;
} else {
if (totalLength(chunks) < expectedLength) {
break;
}
const data2 = concatChunks(chunks, expectedLength);
controller.enqueue(decodePacket(isBinary2 ? data2 : TEXT_DECODER.decode(data2), binaryType));
state = 0;
}
if (expectedLength === 0 || expectedLength > maxPayload) {
controller.enqueue(ERROR_PACKET);
break;
}
}
}
});
}
const protocol$1 = 4;
function Emitter(obj) {
if (obj)
return mixin(obj);
}
function mixin(obj) {
for (var key2 in Emitter.prototype) {
obj[key2] = Emitter.prototype[key2];
}
return obj;
}
Emitter.prototype.on = Emitter.prototype.addEventListener = function(event2, fn8) {
this._callbacks = this._callbacks || {};
(this._callbacks["$" + event2] = this._callbacks["$" + event2] || []).push(fn8);
return this;
};
Emitter.prototype.once = function(event2, fn8) {
function on2() {
this.off(event2, on2);
fn8.apply(this, arguments);
}
on2.fn = fn8;
this.on(event2, on2);
return this;
};
Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event2, fn8) {
this._callbacks = this._callbacks || {};
if (0 == arguments.length) {
this._callbacks = {};
return this;
}
var callbacks = this._callbacks["$" + event2];
if (!callbacks)
return this;
if (1 == arguments.length) {
delete this._callbacks["$" + event2];
return this;
}
var cb2;
for (var i2 = 0; i2 < callbacks.length; i2++) {
cb2 = callbacks[i2];
if (cb2 === fn8 || cb2.fn === fn8) {
callbacks.splice(i2, 1);
break;
}
}
if (callbacks.length === 0) {
delete this._callbacks["$" + event2];
}
return this;
};
Emitter.prototype.emit = function(event2) {
this._callbacks = this._callbacks || {};
var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event2];
for (var i2 = 1; i2 < arguments.length; i2++) {
args[i2 - 1] = arguments[i2];
}
if (callbacks) {
callbacks = callbacks.slice(0);
for (var i2 = 0, len = callbacks.length; i2 < len; ++i2) {
callbacks[i2].apply(this, args);
}
}
return this;
};
Emitter.prototype.emitReserved = Emitter.prototype.emit;
Emitter.prototype.listeners = function(event2) {
this._callbacks = this._callbacks || {};
return this._callbacks["$" + event2] || [];
};
Emitter.prototype.hasListeners = function(event2) {
return !!this.listeners(event2).length;
};
const globalThisShim = (() => {
if (typeof self !== "undefined") {
return self;
} else if (typeof window !== "undefined") {
return window;
} else {
return Function("return this")();
}
})();
function pick$4(obj, ...attr2) {
return attr2.reduce((acc, k2) => {
if (obj.hasOwnProperty(k2)) {
acc[k2] = obj[k2];
}
return acc;
}, {});
}
const NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
const NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
function installTimerFunctions(obj, opts) {
if (opts.useNativeTimers) {
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
} else {
obj.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim);
obj.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim);
}
}
const BASE64_OVERHEAD = 1.33;
function byteLength(obj) {
if (typeof obj === "string") {
return utf8Length(obj);
}
return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);
}
function utf8Length(str) {
let c2 = 0, length2 = 0;
for (let i2 = 0, l2 = str.length; i2 < l2; i2++) {
c2 = str.charCodeAt(i2);
if (c2 < 128) {
length2 += 1;
} else if (c2 < 2048) {
length2 += 2;
} else if (c2 < 55296 || c2 >= 57344) {
length2 += 3;
} else {
i2++;
length2 += 4;
}
}
return length2;
}
function encode$3(obj) {
let str = "";
for (let i2 in obj) {
if (obj.hasOwnProperty(i2)) {
if (str.length)
str += "&";
str += encodeURIComponent(i2) + "=" + encodeURIComponent(obj[i2]);
}
}
return str;
}
function decode$2(qs) {
let qry = {};
let pairs = qs.split("&");
for (let i2 = 0, l2 = pairs.length; i2 < l2; i2++) {
let pair = pairs[i2].split("=");
qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
}
return qry;
}
class TransportError extends Error {
constructor(reason, description, context2) {
super(reason);
this.description = description;
this.context = context2;
this.type = "TransportError";
}
}
class Transport extends Emitter {
/**
* Transport abstract constructor.
*
* @param {Object} opts - options
* @protected
*/
constructor(opts) {
super();
this.writable = false;
installTimerFunctions(this, opts);
this.opts = opts;
this.query = opts.query;
this.socket = opts.socket;
}
/**
* Emits an error.
*
* @param {String} reason
* @param description
* @param context - the error context
* @return {Transport} for chaining
* @protected
*/
onError(reason, description, context2) {
super.emitReserved("error", new TransportError(reason, description, context2));
return this;
}
/**
* Opens the transport.
*/
open() {
this.readyState = "opening";
this.doOpen();
return this;
}
/**
* Closes the transport.
*/
close() {
if (this.readyState === "opening" || this.readyState === "open") {
this.doClose();
this.onClose();
}
return this;
}
/**
* Sends multiple packets.
*
* @param {Array} packets
*/
send(packets) {
if (this.readyState === "open") {
this.write(packets);
}
}
/**
* Called upon open
*
* @protected
*/
onOpen() {
this.readyState = "open";
this.writable = true;
super.emitReserved("open");
}
/**
* Called with data.
*
* @param {String} data
* @protected
*/
onData(data2) {
const packet = decodePacket(data2, this.socket.binaryType);
this.onPacket(packet);
}
/**
* Called with a decoded packet.
*
* @protected
*/
onPacket(packet) {
super.emitReserved("packet", packet);
}
/**
* Called upon close.
*
* @protected
*/
onClose(details) {
this.readyState = "closed";
super.emitReserved("close", details);
}
/**
* Pauses the transport, in order not to lose packets during an upgrade.
*
* @param onPause
*/
pause(onPause) {
}
createUri(schema, query = {}) {
return schema + "://" + this._hostname() + this._port() + this.opts.path + this._query(query);
}
_hostname() {
const hostname = this.opts.hostname;
return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
}
_port() {
if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
return ":" + this.opts.port;
} else {
return "";
}
}
_query(query) {
const encodedQuery = encode$3(query);
return encodedQuery.length ? "?" + encodedQuery : "";
}
}
const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), length$1 = 64, map$2 = {};
let seed = 0, i$f = 0, prev;
function encode$2(num) {
let encoded = "";
do {
encoded = alphabet[num % length$1] + encoded;
num = Math.floor(num / length$1);
} while (num > 0);
return encoded;
}
function yeast() {
const now2 = encode$2(+/* @__PURE__ */ new Date());
if (now2 !== prev)
return seed = 0, prev = now2;
return now2 + "." + encode$2(seed++);
}
for (; i$f < length$1; i$f++)
map$2[alphabet[i$f]] = i$f;
let value$3 = false;
try {
value$3 = typeof XMLHttpRequest !== "undefined" && "withCredentials" in new XMLHttpRequest();
} catch (err) {
}
const hasCORS = value$3;
function XHR(opts) {
const xdomain = opts.xdomain;
try {
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
return new XMLHttpRequest();
}
} catch (e7) {
}
if (!xdomain) {
try {
return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
} catch (e7) {
}
}
}
function createCookieJar() {
}
function empty$1() {
}
const hasXHR2 = function() {
const xhr = new XHR({
xdomain: false
});
return null != xhr.responseType;
}();
class Polling extends Transport {
/**
* XHR Polling constructor.
*
* @param {Object} opts
* @package
*/
constructor(opts) {
super(opts);
this.polling = false;
if (typeof location !== "undefined") {
const isSSL = "https:" === location.protocol;
let port2 = location.port;
if (!port2) {
port2 = isSSL ? "443" : "80";
}
this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port2 !== opts.port;
}
const forceBase64 = opts && opts.forceBase64;
this.supportsBinary = hasXHR2 && !forceBase64;
if (this.opts.withCredentials) {
this.cookieJar = createCookieJar();
}
}
get name() {
return "polling";
}
/**
* Opens the socket (triggers polling). We write a PING message to determine
* when the transport is open.
*
* @protected
*/
doOpen() {
this.poll();
}
/**
* Pauses polling.
*
* @param {Function} onPause - callback upon buffers are flushed and transport is paused
* @package
*/
pause(onPause) {
this.readyState = "pausing";
const pause = () => {
this.readyState = "paused";
onPause();
};
if (this.polling || !this.writable) {
let total = 0;
if (this.polling) {
total++;
this.once("pollComplete", function() {
--total || pause();
});
}
if (!this.writable) {
total++;
this.once("drain", function() {
--total || pause();
});
}
} else {
pause();
}
}
/**
* Starts polling cycle.
*
* @private
*/
poll() {
this.polling = true;
this.doPoll();
this.emitReserved("poll");
}
/**
* Overloads onData to detect payloads.
*
* @protected
*/
onData(data2) {
const callback = (packet) => {
if ("opening" === this.readyState && packet.type === "open") {
this.onOpen();
}
if ("close" === packet.type) {
this.onClose({ description: "transport closed by the server" });
return false;
}
this.onPacket(packet);
};
decodePayload(data2, this.socket.binaryType).forEach(callback);
if ("closed" !== this.readyState) {
this.polling = false;
this.emitReserved("pollComplete");
if ("open" === this.readyState) {
this.poll();
}
}
}
/**
* For polling, send a close packet.
*
* @protected
*/
doClose() {
const close = () => {
this.write([{ type: "close" }]);
};
if ("open" === this.readyState) {
close();
} else {
this.once("open", close);
}
}
/**
* Writes a packets payload.
*
* @param {Array} packets - data packets
* @protected
*/
write(packets) {
this.writable = false;
encodePayload(packets, (data2) => {
this.doWrite(data2, () => {
this.writable = true;
this.emitReserved("drain");
});
});
}
/**
* Generates uri for connection.
*
* @private
*/
uri() {
const schema = this.opts.secure ? "https" : "http";
const query = this.query || {};
if (false !== this.opts.timestampRequests) {
query[this.opts.timestampParam] = yeast();
}
if (!this.supportsBinary && !query.sid) {
query.b64 = 1;
}
return this.createUri(schema, query);
}
/**
* Creates a request.
*
* @param {String} method
* @private
*/
request(opts = {}) {
Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);
return new Request(this.uri(), opts);
}
/**
* Sends data.
*
* @param {String} data to send.
* @param {Function} called upon flush.
* @private
*/
doWrite(data2, fn8) {
const req = this.request({
method: "POST",
data: data2
});
req.on("success", fn8);
req.on("error", (xhrStatus, context2) => {
this.onError("xhr post error", xhrStatus, context2);
});
}
/**
* Starts a poll cycle.
*
* @private
*/
doPoll() {
const req = this.request();
req.on("data", this.onData.bind(this));
req.on("error", (xhrStatus, context2) => {
this.onError("xhr poll error", xhrStatus, context2);
});
this.pollXhr = req;
}
}
class Request extends Emitter {
/**
* Request constructor
*
* @param {Object} options
* @package
*/
constructor(uri, opts) {
super();
installTimerFunctions(this, opts);
this.opts = opts;
this.method = opts.method || "GET";
this.uri = uri;
this.data = void 0 !== opts.data ? opts.data : null;
this.create();
}
/**
* Creates the XHR object and sends the request.
*
* @private
*/
create() {
var _a2;
const opts = pick$4(this.opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
opts.xdomain = !!this.opts.xd;
const xhr = this.xhr = new XHR(opts);
try {
xhr.open(this.method, this.uri, true);
try {
if (this.opts.extraHeaders) {
xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
for (let i2 in this.opts.extraHeaders) {
if (this.opts.extraHeaders.hasOwnProperty(i2)) {
xhr.setRequestHeader(i2, this.opts.extraHeaders[i2]);
}
}
}
} catch (e7) {
}
if ("POST" === this.method) {
try {
xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
} catch (e7) {
}
}
try {
xhr.setRequestHeader("Accept", "*/*");
} catch (e7) {
}
(_a2 = this.opts.cookieJar) === null || _a2 === void 0 ? void 0 : _a2.addCookies(xhr);
if ("withCredentials" in xhr) {
xhr.withCredentials = this.opts.withCredentials;
}
if (this.opts.requestTimeout) {
xhr.timeout = this.opts.requestTimeout;
}
xhr.onreadystatechange = () => {
var _a3;
if (xhr.readyState === 3) {
(_a3 = this.opts.cookieJar) === null || _a3 === void 0 ? void 0 : _a3.parseCookies(xhr);
}
if (4 !== xhr.readyState)
return;
if (200 === xhr.status || 1223 === xhr.status) {
this.onLoad();
} else {
this.setTimeoutFn(() => {
this.onError(typeof xhr.status === "number" ? xhr.status : 0);
}, 0);
}
};
xhr.send(this.data);
} catch (e7) {
this.setTimeoutFn(() => {
this.onError(e7);
}, 0);
return;
}
if (typeof document !== "undefined") {
this.index = Request.requestsCount++;
Request.requests[this.index] = this;
}
}
/**
* Called upon error.
*
* @private
*/
onError(err) {
this.emitReserved("error", err, this.xhr);
this.cleanup(true);
}
/**
* Cleans up house.
*
* @private
*/
cleanup(fromError) {
if ("undefined" === typeof this.xhr || null === this.xhr) {
return;
}
this.xhr.onreadystatechange = empty$1;
if (fromError) {
try {
this.xhr.abort();
} catch (e7) {
}
}
if (typeof document !== "undefined") {
delete Request.requests[this.index];
}
this.xhr = null;
}
/**
* Called upon load.
*
* @private
*/
onLoad() {
const data2 = this.xhr.responseText;
if (data2 !== null) {
this.emitReserved("data", data2);
this.emitReserved("success");
this.cleanup();
}
}
/**
* Aborts the request.
*
* @package
*/
abort() {
this.cleanup();
}
}
Request.requestsCount = 0;
Request.requests = {};
if (typeof document !== "undefined") {
if (typeof attachEvent === "function") {
attachEvent("onunload", unloadHandler);
} else if (typeof addEventListener === "function") {
const terminationEvent = "onpagehide" in globalThisShim ? "pagehide" : "unload";
addEventListener(terminationEvent, unloadHandler, false);
}
}
function unloadHandler() {
for (let i2 in Request.requests) {
if (Request.requests.hasOwnProperty(i2)) {
Request.requests[i2].abort();
}
}
}
const nextTick = (() => {
const isPromiseAvailable = typeof Promise === "function" && typeof Promise.resolve === "function";
if (isPromiseAvailable) {
return (cb2) => Promise.resolve().then(cb2);
} else {
return (cb2, setTimeoutFn) => setTimeoutFn(cb2, 0);
}
})();
const WebSocket = globalThisShim.WebSocket || globalThisShim.MozWebSocket;
const usingBrowserWebSocket = true;
const defaultBinaryType = "arraybuffer";
const isReactNative = typeof navigator !== "undefined" && typeof navigator.product === "string" && navigator.product.toLowerCase() === "reactnative";
class WS extends Transport {
/**
* WebSocket transport constructor.
*
* @param {Object} opts - connection options
* @protected
*/
constructor(opts) {
super(opts);
this.supportsBinary = !opts.forceBase64;
}
get name() {
return "websocket";
}
doOpen() {
if (!this.check()) {
return;
}
const uri = this.uri();
const protocols = this.opts.protocols;
const opts = isReactNative ? {} : pick$4(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
if (this.opts.extraHeaders) {
opts.headers = this.opts.extraHeaders;
}
try {
this.ws = usingBrowserWebSocket && !isReactNative ? protocols ? new WebSocket(uri, protocols) : new WebSocket(uri) : new WebSocket(uri, protocols, opts);
} catch (err) {
return this.emitReserved("error", err);
}
this.ws.binaryType = this.socket.binaryType;
this.addEventListeners();
}
/**
* Adds event listeners to the socket
*
* @private
*/
addEventListeners() {
this.ws.onopen = () => {
if (this.opts.autoUnref) {
this.ws._socket.unref();
}
this.onOpen();
};
this.ws.onclose = (closeEvent) => this.onClose({
description: "websocket connection closed",
context: closeEvent
});
this.ws.onmessage = (ev) => this.onData(ev.data);
this.ws.onerror = (e7) => this.onError("websocket error", e7);
}
write(packets) {
this.writable = false;
for (let i2 = 0; i2 < packets.length; i2++) {
const packet = packets[i2];
const lastPacket = i2 === packets.length - 1;
encodePacket(packet, this.supportsBinary, (data2) => {
const opts = {};
try {
if (usingBrowserWebSocket) {
this.ws.send(data2);
}
} catch (e7) {
}
if (lastPacket) {
nextTick(() => {
this.writable = true;
this.emitReserved("drain");
}, this.setTimeoutFn);
}
});
}
}
doClose() {
if (typeof this.ws !== "undefined") {
this.ws.close();
this.ws = null;
}
}
/**
* Generates uri for connection.
*
* @private
*/
uri() {
const schema = this.opts.secure ? "wss" : "ws";
const query = this.query || {};
if (this.opts.timestampRequests) {
query[this.opts.timestampParam] = yeast();
}
if (!this.supportsBinary) {
query.b64 = 1;
}
return this.createUri(schema, query);
}
/**
* Feature detection for WebSocket.
*
* @return {Boolean} whether this transport is available.
* @private
*/
check() {
return !!WebSocket;
}
}
class WT extends Transport {
get name() {
return "webtransport";
}
doOpen() {
if (typeof WebTransport !== "function") {
return;
}
this.transport = new WebTransport(this.createUri("https"), this.opts.transportOptions[this.name]);
this.transport.closed.then(() => {
this.onClose();
}).catch((err) => {
this.onError("webtransport error", err);
});
this.transport.ready.then(() => {
this.transport.createBidirectionalStream().then((stream2) => {
const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);
const reader = stream2.readable.pipeThrough(decoderStream).getReader();
const encoderStream = createPacketEncoderStream();
encoderStream.readable.pipeTo(stream2.writable);
this.writer = encoderStream.writable.getWriter();
const read3 = () => {
reader.read().then(({ done, value: value2 }) => {
if (done) {
return;
}
this.onPacket(value2);
read3();
}).catch((err) => {
});
};
read3();
const packet = { type: "open" };
if (this.query.sid) {
packet.data = `{"sid":"${this.query.sid}"}`;
}
this.writer.write(packet).then(() => this.onOpen());
});
});
}
write(packets) {
this.writable = false;
for (let i2 = 0; i2 < packets.length; i2++) {
const packet = packets[i2];
const lastPacket = i2 === packets.length - 1;
this.writer.write(packet).then(() => {
if (lastPacket) {
nextTick(() => {
this.writable = true;
this.emitReserved("drain");
}, this.setTimeoutFn);
}
});
}
}
doClose() {
var _a2;
(_a2 = this.transport) === null || _a2 === void 0 ? void 0 : _a2.close();
}
}
const transports = {
websocket: WS,
webtransport: WT,
polling: Polling
};
const re$3 = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
const parts = [
"source",
"protocol",
"authority",
"userInfo",
"user",
"password",
"host",
"port",
"relative",
"path",
"directory",
"file",
"query",
"anchor"
];
function parse$8(str) {
const src = str, b2 = str.indexOf("["), e7 = str.indexOf("]");
if (b2 != -1 && e7 != -1) {
str = str.substring(0, b2) + str.substring(b2, e7).replace(/:/g, ";") + str.substring(e7, str.length);
}
let m2 = re$3.exec(str || ""), uri = {}, i2 = 14;
while (i2--) {
uri[parts[i2]] = m2[i2] || "";
}
if (b2 != -1 && e7 != -1) {
uri.source = src;
uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ":");
uri.authority = uri.authority.replace("[", "").replace("]", "").replace(/;/g, ":");
uri.ipv6uri = true;
}
uri.pathNames = pathNames(uri, uri["path"]);
uri.queryKey = queryKey(uri, uri["query"]);
return uri;
}
function pathNames(obj, path2) {
const regx = /\/{2,9}/g, names = path2.replace(regx, "/").split("/");
if (path2.slice(0, 1) == "/" || path2.length === 0) {
names.splice(0, 1);
}
if (path2.slice(-1) == "/") {
names.splice(names.length - 1, 1);
}
return names;
}
function queryKey(uri, query) {
const data2 = {};
query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function($0, $1, $2) {
if ($1) {
data2[$1] = $2;
}
});
return data2;
}
let Socket$1 = class Socket extends Emitter {
/**
* Socket constructor.
*
* @param {String|Object} uri - uri or options
* @param {Object} opts - options
*/
constructor(uri, opts = {}) {
super();
this.binaryType = defaultBinaryType;
this.writeBuffer = [];
if (uri && "object" === typeof uri) {
opts = uri;
uri = null;
}
if (uri) {
uri = parse$8(uri);
opts.hostname = uri.host;
opts.secure = uri.protocol === "https" || uri.protocol === "wss";
opts.port = uri.port;
if (uri.query)
opts.query = uri.query;
} else if (opts.host) {
opts.hostname = parse$8(opts.host).host;
}
installTimerFunctions(this, opts);
this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
if (opts.hostname && !opts.port) {
opts.port = this.secure ? "443" : "80";
}
this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : this.secure ? "443" : "80");
this.transports = opts.transports || [
"polling",
"websocket",
"webtransport"
];
this.writeBuffer = [];
this.prevBufferLen = 0;
this.opts = Object.assign({
path: "/engine.io",
agent: false,
withCredentials: false,
upgrade: true,
timestampParam: "t",
rememberUpgrade: false,
addTrailingSlash: true,
rejectUnauthorized: true,
perMessageDeflate: {
threshold: 1024
},
transportOptions: {},
closeOnBeforeunload: false
}, opts);
this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : "");
if (typeof this.opts.query === "string") {
this.opts.query = decode$2(this.opts.query);
}
this.id = null;
this.upgrades = null;
this.pingInterval = null;
this.pingTimeout = null;
this.pingTimeoutTimer = null;
if (typeof addEventListener === "function") {
if (this.opts.closeOnBeforeunload) {
this.beforeunloadEventListener = () => {
if (this.transport) {
this.transport.removeAllListeners();
this.transport.close();
}
};
addEventListener("beforeunload", this.beforeunloadEventListener, false);
}
if (this.hostname !== "localhost") {
this.offlineEventListener = () => {
this.onClose("transport close", {
description: "network connection lost"
});
};
addEventListener("offline", this.offlineEventListener, false);
}
}
this.open();
}
/**
* Creates transport of the given type.
*
* @param {String} name - transport name
* @return {Transport}
* @private
*/
createTransport(name) {
const query = Object.assign({}, this.opts.query);
query.EIO = protocol$1;
query.transport = name;
if (this.id)
query.sid = this.id;
const opts = Object.assign({}, this.opts, {
query,
socket: this,
hostname: this.hostname,
secure: this.secure,
port: this.port
}, this.opts.transportOptions[name]);
return new transports[name](opts);
}
/**
* Initializes transport to use and starts probe.
*
* @private
*/
open() {
let transport;
if (this.opts.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1) {
transport = "websocket";
} else if (0 === this.transports.length) {
this.setTimeoutFn(() => {
this.emitReserved("error", "No transports available");
}, 0);
return;
} else {
transport = this.transports[0];
}
this.readyState = "opening";
try {
transport = this.createTransport(transport);
} catch (e7) {
this.transports.shift();
this.open();
return;
}
transport.open();
this.setTransport(transport);
}
/**
* Sets the current transport. Disables the existing one (if any).
*
* @private
*/
setTransport(transport) {
if (this.transport) {
this.transport.removeAllListeners();
}
this.transport = transport;
transport.on("drain", this.onDrain.bind(this)).on("packet", this.onPacket.bind(this)).on("error", this.onError.bind(this)).on("close", (reason) => this.onClose("transport close", reason));
}
/**
* Probes a transport.
*
* @param {String} name - transport name
* @private
*/
probe(name) {
let transport = this.createTransport(name);
let failed = false;
Socket.priorWebsocketSuccess = false;
const onTransportOpen = () => {
if (failed)
return;
transport.send([{ type: "ping", data: "probe" }]);
transport.once("packet", (msg) => {
if (failed)
return;
if ("pong" === msg.type && "probe" === msg.data) {
this.upgrading = true;
this.emitReserved("upgrading", transport);
if (!transport)
return;
Socket.priorWebsocketSuccess = "websocket" === transport.name;
this.transport.pause(() => {
if (failed)
return;
if ("closed" === this.readyState)
return;
cleanup();
this.setTransport(transport);
transport.send([{ type: "upgrade" }]);
this.emitReserved("upgrade", transport);
transport = null;
this.upgrading = false;
this.flush();
});
} else {
const err = new Error("probe error");
err.transport = transport.name;
this.emitReserved("upgradeError", err);
}
});
};
function freezeTransport() {
if (failed)
return;
failed = true;
cleanup();
transport.close();
transport = null;
}
const onerror = (err) => {
const error3 = new Error("probe error: " + err);
error3.transport = transport.name;
freezeTransport();
this.emitReserved("upgradeError", error3);
};
function onTransportClose() {
onerror("transport closed");
}
function onclose() {
onerror("socket closed");
}
function onupgrade(to2) {
if (transport && to2.name !== transport.name) {
freezeTransport();
}
}
const cleanup = () => {
transport.removeListener("open", onTransportOpen);
transport.removeListener("error", onerror);
transport.removeListener("close", onTransportClose);
this.off("close", onclose);
this.off("upgrading", onupgrade);
};
transport.once("open", onTransportOpen);
transport.once("error", onerror);
transport.once("close", onTransportClose);
this.once("close", onclose);
this.once("upgrading", onupgrade);
if (this.upgrades.indexOf("webtransport") !== -1 && name !== "webtransport") {
this.setTimeoutFn(() => {
if (!failed) {
transport.open();
}
}, 200);
} else {
transport.open();
}
}
/**
* Called when connection is deemed open.
*
* @private
*/
onOpen() {
this.readyState = "open";
Socket.priorWebsocketSuccess = "websocket" === this.transport.name;
this.emitReserved("open");
this.flush();
if ("open" === this.readyState && this.opts.upgrade) {
let i2 = 0;
const l2 = this.upgrades.length;
for (; i2 < l2; i2++) {
this.probe(this.upgrades[i2]);
}
}
}
/**
* Handles a packet.
*
* @private
*/
onPacket(packet) {
if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
this.emitReserved("packet", packet);
this.emitReserved("heartbeat");
this.resetPingTimeout();
switch (packet.type) {
case "open":
this.onHandshake(JSON.parse(packet.data));
break;
case "ping":
this.sendPacket("pong");
this.emitReserved("ping");
this.emitReserved("pong");
break;
case "error":
const err = new Error("server error");
err.code = packet.data;
this.onError(err);
break;
case "message":
this.emitReserved("data", packet.data);
this.emitReserved("message", packet.data);
break;
}
}
}
/**
* Called upon handshake completion.
*
* @param {Object} data - handshake obj
* @private
*/
onHandshake(data2) {
this.emitReserved("handshake", data2);
this.id = data2.sid;
this.transport.query.sid = data2.sid;
this.upgrades = this.filterUpgrades(data2.upgrades);
this.pingInterval = data2.pingInterval;
this.pingTimeout = data2.pingTimeout;
this.maxPayload = data2.maxPayload;
this.onOpen();
if ("closed" === this.readyState)
return;
this.resetPingTimeout();
}
/**
* Sets and resets ping timeout timer based on server pings.
*
* @private
*/
resetPingTimeout() {
this.clearTimeoutFn(this.pingTimeoutTimer);
this.pingTimeoutTimer = this.setTimeoutFn(() => {
this.onClose("ping timeout");
}, this.pingInterval + this.pingTimeout);
if (this.opts.autoUnref) {
this.pingTimeoutTimer.unref();
}
}
/**
* Called on `drain` event
*
* @private
*/
onDrain() {
this.writeBuffer.splice(0, this.prevBufferLen);
this.prevBufferLen = 0;
if (0 === this.writeBuffer.length) {
this.emitReserved("drain");
} else {
this.flush();
}
}
/**
* Flush write buffers.
*
* @private
*/
flush() {
if ("closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) {
const packets = this.getWritablePackets();
this.transport.send(packets);
this.prevBufferLen = packets.length;
this.emitReserved("flush");
}
}
/**
* Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP
* long-polling)
*
* @private
*/
getWritablePackets() {
const shouldCheckPayloadSize = this.maxPayload && this.transport.name === "polling" && this.writeBuffer.length > 1;
if (!shouldCheckPayloadSize) {
return this.writeBuffer;
}
let payloadSize = 1;
for (let i2 = 0; i2 < this.writeBuffer.length; i2++) {
const data2 = this.writeBuffer[i2].data;
if (data2) {
payloadSize += byteLength(data2);
}
if (i2 > 0 && payloadSize > this.maxPayload) {
return this.writeBuffer.slice(0, i2);
}
payloadSize += 2;
}
return this.writeBuffer;
}
/**
* Sends a message.
*
* @param {String} msg - message.
* @param {Object} options.
* @param {Function} callback function.
* @return {Socket} for chaining.
*/
write(msg, options2, fn8) {
this.sendPacket("message", msg, options2, fn8);
return this;
}
send(msg, options2, fn8) {
this.sendPacket("message", msg, options2, fn8);
return this;
}
/**
* Sends a packet.
*
* @param {String} type: packet type.
* @param {String} data.
* @param {Object} options.
* @param {Function} fn - callback function.
* @private
*/
sendPacket(type2, data2, options2, fn8) {
if ("function" === typeof data2) {
fn8 = data2;
data2 = void 0;
}
if ("function" === typeof options2) {
fn8 = options2;
options2 = null;
}
if ("closing" === this.readyState || "closed" === this.readyState) {
return;
}
options2 = options2 || {};
options2.compress = false !== options2.compress;
const packet = {
type: type2,
data: data2,
options: options2
};
this.emitReserved("packetCreate", packet);
this.writeBuffer.push(packet);
if (fn8)
this.once("flush", fn8);
this.flush();
}
/**
* Closes the connection.
*/
close() {
const close = () => {
this.onClose("forced close");
this.transport.close();
};
const cleanupAndClose = () => {
this.off("upgrade", cleanupAndClose);
this.off("upgradeError", cleanupAndClose);
close();
};
const waitForUpgrade = () => {
this.once("upgrade", cleanupAndClose);
this.once("upgradeError", cleanupAndClose);
};
if ("opening" === this.readyState || "open" === this.readyState) {
this.readyState = "closing";
if (this.writeBuffer.length) {
this.once("drain", () => {
if (this.upgrading) {
waitForUpgrade();
} else {
close();
}
});
} else if (this.upgrading) {
waitForUpgrade();
} else {
close();
}
}
return this;
}
/**
* Called upon transport error
*
* @private
*/
onError(err) {
Socket.priorWebsocketSuccess = false;
this.emitReserved("error", err);
this.onClose("transport error", err);
}
/**
* Called upon transport close.
*
* @private
*/
onClose(reason, description) {
if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
this.clearTimeoutFn(this.pingTimeoutTimer);
this.transport.removeAllListeners("close");
this.transport.close();
this.transport.removeAllListeners();
if (typeof removeEventListener === "function") {
removeEventListener("beforeunload", this.beforeunloadEventListener, false);
removeEventListener("offline", this.offlineEventListener, false);
}
this.readyState = "closed";
this.id = null;
this.emitReserved("close", reason, description);
this.writeBuffer = [];
this.prevBufferLen = 0;
}
}
/**
* Filters upgrades, returning only those matching client transports.
*
* @param {Array} upgrades - server upgrades
* @private
*/
filterUpgrades(upgrades) {
const filteredUpgrades = [];
let i2 = 0;
const j2 = upgrades.length;
for (; i2 < j2; i2++) {
if (~this.transports.indexOf(upgrades[i2]))
filteredUpgrades.push(upgrades[i2]);
}
return filteredUpgrades;
}
};
Socket$1.protocol = protocol$1;
function url(uri, path2 = "", loc) {
let obj = uri;
loc = loc || typeof location !== "undefined" && location;
if (null == uri)
uri = loc.protocol + "//" + loc.host;
if (typeof uri === "string") {
if ("/" === uri.charAt(0)) {
if ("/" === uri.charAt(1)) {
uri = loc.protocol + uri;
} else {
uri = loc.host + uri;
}
}
if (!/^(https?|wss?):\/\//.test(uri)) {
if ("undefined" !== typeof loc) {
uri = loc.protocol + "//" + uri;
} else {
uri = "https://" + uri;
}
}
obj = parse$8(uri);
}
if (!obj.port) {
if (/^(http|ws)$/.test(obj.protocol)) {
obj.port = "80";
} else if (/^(http|ws)s$/.test(obj.protocol)) {
obj.port = "443";
}
}
obj.path = obj.path || "/";
const ipv6 = obj.host.indexOf(":") !== -1;
const host = ipv6 ? "[" + obj.host + "]" : obj.host;
obj.id = obj.protocol + "://" + host + ":" + obj.port + path2;
obj.href = obj.protocol + "://" + host + (loc && loc.port === obj.port ? "" : ":" + obj.port);
return obj;
}
const withNativeArrayBuffer = typeof ArrayBuffer === "function";
const isView = (obj) => {
return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
};
const toString$d = Object.prototype.toString;
const withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && toString$d.call(Blob) === "[object BlobConstructor]";
const withNativeFile = typeof File === "function" || typeof File !== "undefined" && toString$d.call(File) === "[object FileConstructor]";
function isBinary(obj) {
return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File;
}
function hasBinary(obj, toJSON) {
if (!obj || typeof obj !== "object") {
return false;
}
if (Array.isArray(obj)) {
for (let i2 = 0, l2 = obj.length; i2 < l2; i2++) {
if (hasBinary(obj[i2])) {
return true;
}
}
return false;
}
if (isBinary(obj)) {
return true;
}
if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) {
return hasBinary(obj.toJSON(), true);
}
for (const key2 in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key2) && hasBinary(obj[key2])) {
return true;
}
}
return false;
}
function deconstructPacket(packet) {
const buffers = [];
const packetData = packet.data;
const pack2 = packet;
pack2.data = _deconstructPacket(packetData, buffers);
pack2.attachments = buffers.length;
return { packet: pack2, buffers };
}
function _deconstructPacket(data2, buffers) {
if (!data2)
return data2;
if (isBinary(data2)) {
const placeholder = { _placeholder: true, num: buffers.length };
buffers.push(data2);
return placeholder;
} else if (Array.isArray(data2)) {
const newData = new Array(data2.length);
for (let i2 = 0; i2 < data2.length; i2++) {
newData[i2] = _deconstructPacket(data2[i2], buffers);
}
return newData;
} else if (typeof data2 === "object" && !(data2 instanceof Date)) {
const newData = {};
for (const key2 in data2) {
if (Object.prototype.hasOwnProperty.call(data2, key2)) {
newData[key2] = _deconstructPacket(data2[key2], buffers);
}
}
return newData;
}
return data2;
}
function reconstructPacket(packet, buffers) {
packet.data = _reconstructPacket(packet.data, buffers);
delete packet.attachments;
return packet;
}
function _reconstructPacket(data2, buffers) {
if (!data2)
return data2;
if (data2 && data2._placeholder === true) {
const isIndexValid = typeof data2.num === "number" && data2.num >= 0 && data2.num < buffers.length;
if (isIndexValid) {
return buffers[data2.num];
} else {
throw new Error("illegal attachments");
}
} else if (Array.isArray(data2)) {
for (let i2 = 0; i2 < data2.length; i2++) {
data2[i2] = _reconstructPacket(data2[i2], buffers);
}
} else if (typeof data2 === "object") {
for (const key2 in data2) {
if (Object.prototype.hasOwnProperty.call(data2, key2)) {
data2[key2] = _reconstructPacket(data2[key2], buffers);
}
}
}
return data2;
}
const RESERVED_EVENTS$1 = [
"connect",
"connect_error",
"disconnect",
"disconnecting",
"newListener",
"removeListener"
// used by the Node.js EventEmitter
];
const protocol = 5;
var PacketType;
(function(PacketType2) {
PacketType2[PacketType2["CONNECT"] = 0] = "CONNECT";
PacketType2[PacketType2["DISCONNECT"] = 1] = "DISCONNECT";
PacketType2[PacketType2["EVENT"] = 2] = "EVENT";
PacketType2[PacketType2["ACK"] = 3] = "ACK";
PacketType2[PacketType2["CONNECT_ERROR"] = 4] = "CONNECT_ERROR";
PacketType2[PacketType2["BINARY_EVENT"] = 5] = "BINARY_EVENT";
PacketType2[PacketType2["BINARY_ACK"] = 6] = "BINARY_ACK";
})(PacketType || (PacketType = {}));
class Encoder {
/**
* Encoder constructor
*
* @param {function} replacer - custom replacer to pass down to JSON.parse
*/
constructor(replacer2) {
this.replacer = replacer2;
}
/**
* Encode a packet as a single string if non-binary, or as a
* buffer sequence, depending on packet type.
*
* @param {Object} obj - packet object
*/
encode(obj) {
if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
if (hasBinary(obj)) {
return this.encodeAsBinary({
type: obj.type === PacketType.EVENT ? PacketType.BINARY_EVENT : PacketType.BINARY_ACK,
nsp: obj.nsp,
data: obj.data,
id: obj.id
});
}
}
return [this.encodeAsString(obj)];
}
/**
* Encode packet as string.
*/
encodeAsString(obj) {
let str = "" + obj.type;
if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) {
str += obj.attachments + "-";
}
if (obj.nsp && "/" !== obj.nsp) {
str += obj.nsp + ",";
}
if (null != obj.id) {
str += obj.id;
}
if (null != obj.data) {
str += JSON.stringify(obj.data, this.replacer);
}
return str;
}
/**
* Encode packet as 'buffer sequence' by removing blobs, and
* deconstructing packet into object with placeholders and
* a list of buffers.
*/
encodeAsBinary(obj) {
const deconstruction = deconstructPacket(obj);
const pack2 = this.encodeAsString(deconstruction.packet);
const buffers = deconstruction.buffers;
buffers.unshift(pack2);
return buffers;
}
}
function isObject$d(value2) {
return Object.prototype.toString.call(value2) === "[object Object]";
}
class Decoder extends Emitter {
/**
* Decoder constructor
*
* @param {function} reviver - custom reviver to pass down to JSON.stringify
*/
constructor(reviver) {
super();
this.reviver = reviver;
}
/**
* Decodes an encoded packet string into packet JSON.
*
* @param {String} obj - encoded packet
*/
add(obj) {
let packet;
if (typeof obj === "string") {
if (this.reconstructor) {
throw new Error("got plaintext data when reconstructing a packet");
}
packet = this.decodeString(obj);
const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;
if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {
packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;
this.reconstructor = new BinaryReconstructor(packet);
if (packet.attachments === 0) {
super.emitReserved("decoded", packet);
}
} else {
super.emitReserved("decoded", packet);
}
} else if (isBinary(obj) || obj.base64) {
if (!this.reconstructor) {
throw new Error("got binary data when not reconstructing a packet");
} else {
packet = this.reconstructor.takeBinaryData(obj);
if (packet) {
this.reconstructor = null;
super.emitReserved("decoded", packet);
}
}
} else {
throw new Error("Unknown type: " + obj);
}
}
/**
* Decode a packet String (JSON data)
*
* @param {String} str
* @return {Object} packet
*/
decodeString(str) {
let i2 = 0;
const p2 = {
type: Number(str.charAt(0))
};
if (PacketType[p2.type] === void 0) {
throw new Error("unknown packet type " + p2.type);
}
if (p2.type === PacketType.BINARY_EVENT || p2.type === PacketType.BINARY_ACK) {
const start2 = i2 + 1;
while (str.charAt(++i2) !== "-" && i2 != str.length) {
}
const buf = str.substring(start2, i2);
if (buf != Number(buf) || str.charAt(i2) !== "-") {
throw new Error("Illegal attachments");
}
p2.attachments = Number(buf);
}
if ("/" === str.charAt(i2 + 1)) {
const start2 = i2 + 1;
while (++i2) {
const c2 = str.charAt(i2);
if ("," === c2)
break;
if (i2 === str.length)
break;
}
p2.nsp = str.substring(start2, i2);
} else {
p2.nsp = "/";
}
const next2 = str.charAt(i2 + 1);
if ("" !== next2 && Number(next2) == next2) {
const start2 = i2 + 1;
while (++i2) {
const c2 = str.charAt(i2);
if (null == c2 || Number(c2) != c2) {
--i2;
break;
}
if (i2 === str.length)
break;
}
p2.id = Number(str.substring(start2, i2 + 1));
}
if (str.charAt(++i2)) {
const payload = this.tryParse(str.substr(i2));
if (Decoder.isPayloadValid(p2.type, payload)) {
p2.data = payload;
} else {
throw new Error("invalid payload");
}
}
return p2;
}
tryParse(str) {
try {
return JSON.parse(str, this.reviver);
} catch (e7) {
return false;
}
}
static isPayloadValid(type2, payload) {
switch (type2) {
case PacketType.CONNECT:
return isObject$d(payload);
case PacketType.DISCONNECT:
return payload === void 0;
case PacketType.CONNECT_ERROR:
return typeof payload === "string" || isObject$d(payload);
case PacketType.EVENT:
case PacketType.BINARY_EVENT:
return Array.isArray(payload) && (typeof payload[0] === "number" || typeof payload[0] === "string" && RESERVED_EVENTS$1.indexOf(payload[0]) === -1);
case PacketType.ACK:
case PacketType.BINARY_ACK:
return Array.isArray(payload);
}
}
/**
* Deallocates a parser's resources
*/
destroy() {
if (this.reconstructor) {
this.reconstructor.finishedReconstruction();
this.reconstructor = null;
}
}
}
class BinaryReconstructor {
constructor(packet) {
this.packet = packet;
this.buffers = [];
this.reconPack = packet;
}
/**
* Method to be called when binary data received from connection
* after a BINARY_EVENT packet.
*
* @param {Buffer | ArrayBuffer} binData - the raw binary data received
* @return {null | Object} returns null if more binary data is expected or
* a reconstructed packet object if all buffers have been received.
*/
takeBinaryData(binData) {
this.buffers.push(binData);
if (this.buffers.length === this.reconPack.attachments) {
const packet = reconstructPacket(this.reconPack, this.buffers);
this.finishedReconstruction();
return packet;
}
return null;
}
/**
* Cleans up binary packet reconstruction variables.
*/
finishedReconstruction() {
this.reconPack = null;
this.buffers = [];
}
}
const parser$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
Decoder,
Encoder,
get PacketType() {
return PacketType;
},
protocol
}, Symbol.toStringTag, { value: "Module" }));
function on$2(obj, ev, fn8) {
obj.on(ev, fn8);
return function subDestroy() {
obj.off(ev, fn8);
};
}
const RESERVED_EVENTS = Object.freeze({
connect: 1,
connect_error: 1,
disconnect: 1,
disconnecting: 1,
// EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener
newListener: 1,
removeListener: 1
});
class Socket2 extends Emitter {
/**
* `Socket` constructor.
*/
constructor(io2, nsp, opts) {
super();
this.connected = false;
this.recovered = false;
this.receiveBuffer = [];
this.sendBuffer = [];
this._queue = [];
this._queueSeq = 0;
this.ids = 0;
this.acks = {};
this.flags = {};
this.io = io2;
this.nsp = nsp;
if (opts && opts.auth) {
this.auth = opts.auth;
}
this._opts = Object.assign({}, opts);
if (this.io._autoConnect)
this.open();
}
/**
* Whether the socket is currently disconnected
*
* @example
* const socket = io();
*
* socket.on("connect", () => {
* console.log(socket.disconnected); // false
* });
*
* socket.on("disconnect", () => {
* console.log(socket.disconnected); // true
* });
*/
get disconnected() {
return !this.connected;
}
/**
* Subscribe to open, close and packet events
*
* @private
*/
subEvents() {
if (this.subs)
return;
const io2 = this.io;
this.subs = [
on$2(io2, "open", this.onopen.bind(this)),
on$2(io2, "packet", this.onpacket.bind(this)),
on$2(io2, "error", this.onerror.bind(this)),
on$2(io2, "close", this.onclose.bind(this))
];
}
/**
* Whether the Socket will try to reconnect when its Manager connects or reconnects.
*
* @example
* const socket = io();
*
* console.log(socket.active); // true
*
* socket.on("disconnect", (reason) => {
* if (reason === "io server disconnect") {
* // the disconnection was initiated by the server, you need to manually reconnect
* console.log(socket.active); // false
* }
* // else the socket will automatically try to reconnect
* console.log(socket.active); // true
* });
*/
get active() {
return !!this.subs;
}
/**
* "Opens" the socket.
*
* @example
* const socket = io({
* autoConnect: false
* });
*
* socket.connect();
*/
connect() {
if (this.connected)
return this;
this.subEvents();
if (!this.io["_reconnecting"])
this.io.open();
if ("open" === this.io._readyState)
this.onopen();
return this;
}
/**
* Alias for {@link connect()}.
*/
open() {
return this.connect();
}
/**
* Sends a `message` event.
*
* This method mimics the WebSocket.send() method.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
*
* @example
* socket.send("hello");
*
* // this is equivalent to
* socket.emit("message", "hello");
*
* @return self
*/
send(...args) {
args.unshift("message");
this.emit.apply(this, args);
return this;
}
/**
* Override `emit`.
* If the event is in `events`, it's emitted normally.
*
* @example
* socket.emit("hello", "world");
*
* // all serializable datastructures are supported (no need to call JSON.stringify)
* socket.emit("hello", 1, "2", { 3: ["4"], 5: Uint8Array.from([6]) });
*
* // with an acknowledgement from the server
* socket.emit("hello", "world", (val) => {
* // ...
* });
*
* @return self
*/
emit(ev, ...args) {
if (RESERVED_EVENTS.hasOwnProperty(ev)) {
throw new Error('"' + ev.toString() + '" is a reserved event name');
}
args.unshift(ev);
if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {
this._addToQueue(args);
return this;
}
const packet = {
type: PacketType.EVENT,
data: args
};
packet.options = {};
packet.options.compress = this.flags.compress !== false;
if ("function" === typeof args[args.length - 1]) {
const id = this.ids++;
const ack = args.pop();
this._registerAckCallback(id, ack);
packet.id = id;
}
const isTransportWritable = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable;
const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);
if (discardPacket)
;
else if (this.connected) {
this.notifyOutgoingListeners(packet);
this.packet(packet);
} else {
this.sendBuffer.push(packet);
}
this.flags = {};
return this;
}
/**
* @private
*/
_registerAckCallback(id, ack) {
var _a2;
const timeout2 = (_a2 = this.flags.timeout) !== null && _a2 !== void 0 ? _a2 : this._opts.ackTimeout;
if (timeout2 === void 0) {
this.acks[id] = ack;
return;
}
const timer2 = this.io.setTimeoutFn(() => {
delete this.acks[id];
for (let i2 = 0; i2 < this.sendBuffer.length; i2++) {
if (this.sendBuffer[i2].id === id) {
this.sendBuffer.splice(i2, 1);
}
}
ack.call(this, new Error("operation has timed out"));
}, timeout2);
this.acks[id] = (...args) => {
this.io.clearTimeoutFn(timer2);
ack.apply(this, [null, ...args]);
};
}
/**
* Emits an event and waits for an acknowledgement
*
* @example
* // without timeout
* const response = await socket.emitWithAck("hello", "world");
*
* // with a specific timeout
* try {
* const response = await socket.timeout(1000).emitWithAck("hello", "world");
* } catch (err) {
* // the server did not acknowledge the event in the given delay
* }
*
* @return a Promise that will be fulfilled when the server acknowledges the event
*/
emitWithAck(ev, ...args) {
const withErr = this.flags.timeout !== void 0 || this._opts.ackTimeout !== void 0;
return new Promise((resolve3, reject2) => {
args.push((arg1, arg2) => {
if (withErr) {
return arg1 ? reject2(arg1) : resolve3(arg2);
} else {
return resolve3(arg1);
}
});
this.emit(ev, ...args);
});
}
/**
* Add the packet to the queue.
* @param args
* @private
*/
_addToQueue(args) {
let ack;
if (typeof args[args.length - 1] === "function") {
ack = args.pop();
}
const packet = {
id: this._queueSeq++,
tryCount: 0,
pending: false,
args,
flags: Object.assign({ fromQueue: true }, this.flags)
};
args.push((err, ...responseArgs) => {
if (packet !== this._queue[0]) {
return;
}
const hasError = err !== null;
if (hasError) {
if (packet.tryCount > this._opts.retries) {
this._queue.shift();
if (ack) {
ack(err);
}
}
} else {
this._queue.shift();
if (ack) {
ack(null, ...responseArgs);
}
}
packet.pending = false;
return this._drainQueue();
});
this._queue.push(packet);
this._drainQueue();
}
/**
* Send the first packet of the queue, and wait for an acknowledgement from the server.
* @param force - whether to resend a packet that has not been acknowledged yet
*
* @private
*/
_drainQueue(force2 = false) {
if (!this.connected || this._queue.length === 0) {
return;
}
const packet = this._queue[0];
if (packet.pending && !force2) {
return;
}
packet.pending = true;
packet.tryCount++;
this.flags = packet.flags;
this.emit.apply(this, packet.args);
}
/**
* Sends a packet.
*
* @param packet
* @private
*/
packet(packet) {
packet.nsp = this.nsp;
this.io._packet(packet);
}
/**
* Called upon engine `open`.
*
* @private
*/
onopen() {
if (typeof this.auth == "function") {
this.auth((data2) => {
this._sendConnectPacket(data2);
});
} else {
this._sendConnectPacket(this.auth);
}
}
/**
* Sends a CONNECT packet to initiate the Socket.IO session.
*
* @param data
* @private
*/
_sendConnectPacket(data2) {
this.packet({
type: PacketType.CONNECT,
data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data2) : data2
});
}
/**
* Called upon engine or manager `error`.
*
* @param err
* @private
*/
onerror(err) {
if (!this.connected) {
this.emitReserved("connect_error", err);
}
}
/**
* Called upon engine `close`.
*
* @param reason
* @param description
* @private
*/
onclose(reason, description) {
this.connected = false;
delete this.id;
this.emitReserved("disconnect", reason, description);
}
/**
* Called with socket packet.
*
* @param packet
* @private
*/
onpacket(packet) {
const sameNamespace = packet.nsp === this.nsp;
if (!sameNamespace)
return;
switch (packet.type) {
case PacketType.CONNECT:
if (packet.data && packet.data.sid) {
this.onconnect(packet.data.sid, packet.data.pid);
} else {
this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
}
break;
case PacketType.EVENT:
case PacketType.BINARY_EVENT:
this.onevent(packet);
break;
case PacketType.ACK:
case PacketType.BINARY_ACK:
this.onack(packet);
break;
case PacketType.DISCONNECT:
this.ondisconnect();
break;
case PacketType.CONNECT_ERROR:
this.destroy();
const err = new Error(packet.data.message);
err.data = packet.data.data;
this.emitReserved("connect_error", err);
break;
}
}
/**
* Called upon a server event.
*
* @param packet
* @private
*/
onevent(packet) {
const args = packet.data || [];
if (null != packet.id) {
args.push(this.ack(packet.id));
}
if (this.connected) {
this.emitEvent(args);
} else {
this.receiveBuffer.push(Object.freeze(args));
}
}
emitEvent(args) {
if (this._anyListeners && this._anyListeners.length) {
const listeners = this._anyListeners.slice();
for (const listener2 of listeners) {
listener2.apply(this, args);
}
}
super.emit.apply(this, args);
if (this._pid && args.length && typeof args[args.length - 1] === "string") {
this._lastOffset = args[args.length - 1];
}
}
/**
* Produces an ack callback to emit with an event.
*
* @private
*/
ack(id) {
const self2 = this;
let sent = false;
return function(...args) {
if (sent)
return;
sent = true;
self2.packet({
type: PacketType.ACK,
id,
data: args
});
};
}
/**
* Called upon a server acknowlegement.
*
* @param packet
* @private
*/
onack(packet) {
const ack = this.acks[packet.id];
if ("function" === typeof ack) {
ack.apply(this, packet.data);
delete this.acks[packet.id];
}
}
/**
* Called upon server connect.
*
* @private
*/
onconnect(id, pid) {
this.id = id;
this.recovered = pid && this._pid === pid;
this._pid = pid;
this.connected = true;
this.emitBuffered();
this.emitReserved("connect");
this._drainQueue(true);
}
/**
* Emit buffered events (received and emitted).
*
* @private
*/
emitBuffered() {
this.receiveBuffer.forEach((args) => this.emitEvent(args));
this.receiveBuffer = [];
this.sendBuffer.forEach((packet) => {
this.notifyOutgoingListeners(packet);
this.packet(packet);
});
this.sendBuffer = [];
}
/**
* Called upon server disconnect.
*
* @private
*/
ondisconnect() {
this.destroy();
this.onclose("io server disconnect");
}
/**
* Called upon forced client/server side disconnections,
* this method ensures the manager stops tracking us and
* that reconnections don't get triggered for this.
*
* @private
*/
destroy() {
if (this.subs) {
this.subs.forEach((subDestroy) => subDestroy());
this.subs = void 0;
}
this.io["_destroy"](this);
}
/**
* Disconnects the socket manually. In that case, the socket will not try to reconnect.
*
* If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.
*
* @example
* const socket = io();
*
* socket.on("disconnect", (reason) => {
* // console.log(reason); prints "io client disconnect"
* });
*
* socket.disconnect();
*
* @return self
*/
disconnect() {
if (this.connected) {
this.packet({ type: PacketType.DISCONNECT });
}
this.destroy();
if (this.connected) {
this.onclose("io client disconnect");
}
return this;
}
/**
* Alias for {@link disconnect()}.
*
* @return self
*/
close() {
return this.disconnect();
}
/**
* Sets the compress flag.
*
* @example
* socket.compress(false).emit("hello");
*
* @param compress - if `true`, compresses the sending data
* @return self
*/
compress(compress) {
this.flags.compress = compress;
return this;
}
/**
* Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not
* ready to send messages.
*
* @example
* socket.volatile.emit("hello"); // the server may or may not receive it
*
* @returns self
*/
get volatile() {
this.flags.volatile = true;
return this;
}
/**
* Sets a modifier for a subsequent event emission that the callback will be called with an error when the
* given number of milliseconds have elapsed without an acknowledgement from the server:
*
* @example
* socket.timeout(5000).emit("my-event", (err) => {
* if (err) {
* // the server did not acknowledge the event in the given delay
* }
* });
*
* @returns self
*/
timeout(timeout2) {
this.flags.timeout = timeout2;
return this;
}
/**
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
* callback.
*
* @example
* socket.onAny((event, ...args) => {
* console.log(`got ${event}`);
* });
*
* @param listener
*/
onAny(listener2) {
this._anyListeners = this._anyListeners || [];
this._anyListeners.push(listener2);
return this;
}
/**
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
* callback. The listener is added to the beginning of the listeners array.
*
* @example
* socket.prependAny((event, ...args) => {
* console.log(`got event ${event}`);
* });
*
* @param listener
*/
prependAny(listener2) {
this._anyListeners = this._anyListeners || [];
this._anyListeners.unshift(listener2);
return this;
}
/**
* Removes the listener that will be fired when any event is emitted.
*
* @example
* const catchAllListener = (event, ...args) => {
* console.log(`got event ${event}`);
* }
*
* socket.onAny(catchAllListener);
*
* // remove a specific listener
* socket.offAny(catchAllListener);
*
* // or remove all listeners
* socket.offAny();
*
* @param listener
*/
offAny(listener2) {
if (!this._anyListeners) {
return this;
}
if (listener2) {
const listeners = this._anyListeners;
for (let i2 = 0; i2 < listeners.length; i2++) {
if (listener2 === listeners[i2]) {
listeners.splice(i2, 1);
return this;
}
}
} else {
this._anyListeners = [];
}
return this;
}
/**
* Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,
* e.g. to remove listeners.
*/
listenersAny() {
return this._anyListeners || [];
}
/**
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
* callback.
*
* Note: acknowledgements sent to the server are not included.
*
* @example
* socket.onAnyOutgoing((event, ...args) => {
* console.log(`sent event ${event}`);
* });
*
* @param listener
*/
onAnyOutgoing(listener2) {
this._anyOutgoingListeners = this._anyOutgoingListeners || [];
this._anyOutgoingListeners.push(listener2);
return this;
}
/**
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
* callback. The listener is added to the beginning of the listeners array.
*
* Note: acknowledgements sent to the server are not included.
*
* @example
* socket.prependAnyOutgoing((event, ...args) => {
* console.log(`sent event ${event}`);
* });
*
* @param listener
*/
prependAnyOutgoing(listener2) {
this._anyOutgoingListeners = this._anyOutgoingListeners || [];
this._anyOutgoingListeners.unshift(listener2);
return this;
}
/**
* Removes the listener that will be fired when any event is emitted.
*
* @example
* const catchAllListener = (event, ...args) => {
* console.log(`sent event ${event}`);
* }
*
* socket.onAnyOutgoing(catchAllListener);
*
* // remove a specific listener
* socket.offAnyOutgoing(catchAllListener);
*
* // or remove all listeners
* socket.offAnyOutgoing();
*
* @param [listener] - the catch-all listener (optional)
*/
offAnyOutgoing(listener2) {
if (!this._anyOutgoingListeners) {
return this;
}
if (listener2) {
const listeners = this._anyOutgoingListeners;
for (let i2 = 0; i2 < listeners.length; i2++) {
if (listener2 === listeners[i2]) {
listeners.splice(i2, 1);
return this;
}
}
} else {
this._anyOutgoingListeners = [];
}
return this;
}
/**
* Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,
* e.g. to remove listeners.
*/
listenersAnyOutgoing() {
return this._anyOutgoingListeners || [];
}
/**
* Notify the listeners for each packet sent
*
* @param packet
*
* @private
*/
notifyOutgoingListeners(packet) {
if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {
const listeners = this._anyOutgoingListeners.slice();
for (const listener2 of listeners) {
listener2.apply(this, packet.data);
}
}
}
}
function Backoff(opts) {
opts = opts || {};
this.ms = opts.min || 100;
this.max = opts.max || 1e4;
this.factor = opts.factor || 2;
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
this.attempts = 0;
}
Backoff.prototype.duration = function() {
var ms = this.ms * Math.pow(this.factor, this.attempts++);
if (this.jitter) {
var rand = Math.random();
var deviation2 = Math.floor(rand * this.jitter * ms);
ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation2 : ms + deviation2;
}
return Math.min(ms, this.max) | 0;
};
Backoff.prototype.reset = function() {
this.attempts = 0;
};
Backoff.prototype.setMin = function(min2) {
this.ms = min2;
};
Backoff.prototype.setMax = function(max2) {
this.max = max2;
};
Backoff.prototype.setJitter = function(jitter2) {
this.jitter = jitter2;
};
class Manager extends Emitter {
constructor(uri, opts) {
var _a2;
super();
this.nsps = {};
this.subs = [];
if (uri && "object" === typeof uri) {
opts = uri;
uri = void 0;
}
opts = opts || {};
opts.path = opts.path || "/socket.io";
this.opts = opts;
installTimerFunctions(this, opts);
this.reconnection(opts.reconnection !== false);
this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
this.reconnectionDelay(opts.reconnectionDelay || 1e3);
this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
this.randomizationFactor((_a2 = opts.randomizationFactor) !== null && _a2 !== void 0 ? _a2 : 0.5);
this.backoff = new Backoff({
min: this.reconnectionDelay(),
max: this.reconnectionDelayMax(),
jitter: this.randomizationFactor()
});
this.timeout(null == opts.timeout ? 2e4 : opts.timeout);
this._readyState = "closed";
this.uri = uri;
const _parser = opts.parser || parser$2;
this.encoder = new _parser.Encoder();
this.decoder = new _parser.Decoder();
this._autoConnect = opts.autoConnect !== false;
if (this._autoConnect)
this.open();
}
reconnection(v2) {
if (!arguments.length)
return this._reconnection;
this._reconnection = !!v2;
return this;
}
reconnectionAttempts(v2) {
if (v2 === void 0)
return this._reconnectionAttempts;
this._reconnectionAttempts = v2;
return this;
}
reconnectionDelay(v2) {
var _a2;
if (v2 === void 0)
return this._reconnectionDelay;
this._reconnectionDelay = v2;
(_a2 = this.backoff) === null || _a2 === void 0 ? void 0 : _a2.setMin(v2);
return this;
}
randomizationFactor(v2) {
var _a2;
if (v2 === void 0)
return this._randomizationFactor;
this._randomizationFactor = v2;
(_a2 = this.backoff) === null || _a2 === void 0 ? void 0 : _a2.setJitter(v2);
return this;
}
reconnectionDelayMax(v2) {
var _a2;
if (v2 === void 0)
return this._reconnectionDelayMax;
this._reconnectionDelayMax = v2;
(_a2 = this.backoff) === null || _a2 === void 0 ? void 0 : _a2.setMax(v2);
return this;
}
timeout(v2) {
if (!arguments.length)
return this._timeout;
this._timeout = v2;
return this;
}
/**
* Starts trying to reconnect if reconnection is enabled and we have not
* started reconnecting yet
*
* @private
*/
maybeReconnectOnOpen() {
if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) {
this.reconnect();
}
}
/**
* Sets the current transport `socket`.
*
* @param {Function} fn - optional, callback
* @return self
* @public
*/
open(fn8) {
if (~this._readyState.indexOf("open"))
return this;
this.engine = new Socket$1(this.uri, this.opts);
const socket = this.engine;
const self2 = this;
this._readyState = "opening";
this.skipReconnect = false;
const openSubDestroy = on$2(socket, "open", function() {
self2.onopen();
fn8 && fn8();
});
const onError = (err) => {
this.cleanup();
this._readyState = "closed";
this.emitReserved("error", err);
if (fn8) {
fn8(err);
} else {
this.maybeReconnectOnOpen();
}
};
const errorSub = on$2(socket, "error", onError);
if (false !== this._timeout) {
const timeout2 = this._timeout;
const timer2 = this.setTimeoutFn(() => {
openSubDestroy();
onError(new Error("timeout"));
socket.close();
}, timeout2);
if (this.opts.autoUnref) {
timer2.unref();
}
this.subs.push(() => {
this.clearTimeoutFn(timer2);
});
}
this.subs.push(openSubDestroy);
this.subs.push(errorSub);
return this;
}
/**
* Alias for open()
*
* @return self
* @public
*/
connect(fn8) {
return this.open(fn8);
}
/**
* Called upon transport open.
*
* @private
*/
onopen() {
this.cleanup();
this._readyState = "open";
this.emitReserved("open");
const socket = this.engine;
this.subs.push(on$2(socket, "ping", this.onping.bind(this)), on$2(socket, "data", this.ondata.bind(this)), on$2(socket, "error", this.onerror.bind(this)), on$2(socket, "close", this.onclose.bind(this)), on$2(this.decoder, "decoded", this.ondecoded.bind(this)));
}
/**
* Called upon a ping.
*
* @private
*/
onping() {
this.emitReserved("ping");
}
/**
* Called with data.
*
* @private
*/
ondata(data2) {
try {
this.decoder.add(data2);
} catch (e7) {
this.onclose("parse error", e7);
}
}
/**
* Called when parser fully decodes a packet.
*
* @private
*/
ondecoded(packet) {
nextTick(() => {
this.emitReserved("packet", packet);
}, this.setTimeoutFn);
}
/**
* Called upon socket error.
*
* @private
*/
onerror(err) {
this.emitReserved("error", err);
}
/**
* Creates a new socket for the given `nsp`.
*
* @return {Socket}
* @public
*/
socket(nsp, opts) {
let socket = this.nsps[nsp];
if (!socket) {
socket = new Socket2(this, nsp, opts);
this.nsps[nsp] = socket;
} else if (this._autoConnect && !socket.active) {
socket.connect();
}
return socket;
}
/**
* Called upon a socket close.
*
* @param socket
* @private
*/
_destroy(socket) {
const nsps = Object.keys(this.nsps);
for (const nsp of nsps) {
const socket2 = this.nsps[nsp];
if (socket2.active) {
return;
}
}
this._close();
}
/**
* Writes a packet.
*
* @param packet
* @private
*/
_packet(packet) {
const encodedPackets = this.encoder.encode(packet);
for (let i2 = 0; i2 < encodedPackets.length; i2++) {
this.engine.write(encodedPackets[i2], packet.options);
}
}
/**
* Clean up transport subscriptions and packet buffer.
*
* @private
*/
cleanup() {
this.subs.forEach((subDestroy) => subDestroy());
this.subs.length = 0;
this.decoder.destroy();
}
/**
* Close the current socket.
*
* @private
*/
_close() {
this.skipReconnect = true;
this._reconnecting = false;
this.onclose("forced close");
if (this.engine)
this.engine.close();
}
/**
* Alias for close()
*
* @private
*/
disconnect() {
return this._close();
}
/**
* Called upon engine close.
*
* @private
*/
onclose(reason, description) {
this.cleanup();
this.backoff.reset();
this._readyState = "closed";
this.emitReserved("close", reason, description);
if (this._reconnection && !this.skipReconnect) {
this.reconnect();
}
}
/**
* Attempt a reconnection.
*
* @private
*/
reconnect() {
if (this._reconnecting || this.skipReconnect)
return this;
const self2 = this;
if (this.backoff.attempts >= this._reconnectionAttempts) {
this.backoff.reset();
this.emitReserved("reconnect_failed");
this._reconnecting = false;
} else {
const delay = this.backoff.duration();
this._reconnecting = true;
const timer2 = this.setTimeoutFn(() => {
if (self2.skipReconnect)
return;
this.emitReserved("reconnect_attempt", self2.backoff.attempts);
if (self2.skipReconnect)
return;
self2.open((err) => {
if (err) {
self2._reconnecting = false;
self2.reconnect();
this.emitReserved("reconnect_error", err);
} else {
self2.onreconnect();
}
});
}, delay);
if (this.opts.autoUnref) {
timer2.unref();
}
this.subs.push(() => {
this.clearTimeoutFn(timer2);
});
}
}
/**
* Called upon successful reconnect.
*
* @private
*/
onreconnect() {
const attempt = this.backoff.attempts;
this._reconnecting = false;
this.backoff.reset();
this.emitReserved("reconnect", attempt);
}
}
const cache$1 = {};
function lookup$9(uri, opts) {
if (typeof uri === "object") {
opts = uri;
uri = void 0;
}
opts = opts || {};
const parsed = url(uri, opts.path || "/socket.io");
const source2 = parsed.source;
const id = parsed.id;
const path2 = parsed.path;
const sameNamespace = cache$1[id] && path2 in cache$1[id]["nsps"];
const newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;
let io2;
if (newConnection) {
io2 = new Manager(source2, opts);
} else {
if (!cache$1[id]) {
cache$1[id] = new Manager(source2, opts);
}
io2 = cache$1[id];
}
if (parsed.query && !opts.query) {
opts.query = parsed.queryKey;
}
return io2.socket(parsed.path, opts);
}
Object.assign(lookup$9, {
Manager,
Socket: Socket2,
io: lookup$9,
connect: lookup$9
});
var toggleSelection = function() {
var selection = document.getSelection();
if (!selection.rangeCount) {
return function() {
};
}
var active = document.activeElement;
var ranges2 = [];
for (var i2 = 0; i2 < selection.rangeCount; i2++) {
ranges2.push(selection.getRangeAt(i2));
}
switch (active.tagName.toUpperCase()) {
case "INPUT":
case "TEXTAREA":
active.blur();
break;
default:
active = null;
break;
}
selection.removeAllRanges();
return function() {
selection.type === "Caret" && selection.removeAllRanges();
if (!selection.rangeCount) {
ranges2.forEach(function(range2) {
selection.addRange(range2);
});
}
active && active.focus();
};
};
var deselectCurrent = toggleSelection;
var clipboardToIE11Formatting = {
"text/plain": "Text",
"text/html": "Url",
"default": "Text"
};
var defaultMessage = "Copy to clipboard: #{key}, Enter";
function format$4(message) {
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
return message.replace(/#{\s*key\s*}/g, copyKey);
}
function copy$3(text2, options2) {
var debug2, message, reselectPrevious, range2, selection, mark, success = false;
if (!options2) {
options2 = {};
}
debug2 = options2.debug || false;
try {
reselectPrevious = deselectCurrent();
range2 = document.createRange();
selection = document.getSelection();
mark = document.createElement("span");
mark.textContent = text2;
mark.ariaHidden = "true";
mark.style.all = "unset";
mark.style.position = "fixed";
mark.style.top = 0;
mark.style.clip = "rect(0, 0, 0, 0)";
mark.style.whiteSpace = "pre";
mark.style.webkitUserSelect = "text";
mark.style.MozUserSelect = "text";
mark.style.msUserSelect = "text";
mark.style.userSelect = "text";
mark.addEventListener("copy", function(e7) {
e7.stopPropagation();
if (options2.format) {
e7.preventDefault();
if (typeof e7.clipboardData === "undefined") {
debug2 && console.warn("unable to use e.clipboardData");
debug2 && console.warn("trying IE specific stuff");
window.clipboardData.clearData();
var format2 = clipboardToIE11Formatting[options2.format] || clipboardToIE11Formatting["default"];
window.clipboardData.setData(format2, text2);
} else {
e7.clipboardData.clearData();
e7.clipboardData.setData(options2.format, text2);
}
}
if (options2.onCopy) {
e7.preventDefault();
options2.onCopy(e7.clipboardData);
}
});
document.body.appendChild(mark);
range2.selectNodeContents(mark);
selection.addRange(range2);
var successful = document.execCommand("copy");
if (!successful) {
throw new Error("copy command was unsuccessful");
}
success = true;
} catch (err) {
debug2 && console.error("unable to copy using execCommand: ", err);
debug2 && console.warn("trying IE specific stuff");
try {
window.clipboardData.setData(options2.format || "text", text2);
options2.onCopy && options2.onCopy(window.clipboardData);
success = true;
} catch (err2) {
debug2 && console.error("unable to copy using clipboardData: ", err2);
debug2 && console.error("falling back to prompt");
message = format$4("message" in options2 ? options2.message : defaultMessage);
window.prompt(message, text2);
}
} finally {
if (selection) {
if (typeof selection.removeRange == "function") {
selection.removeRange(range2);
} else {
selection.removeAllRanges();
}
}
if (mark) {
document.body.removeChild(mark);
}
reselectPrevious();
}
return success;
}
var copyToClipboard = copy$3;
const copy$4 = /* @__PURE__ */ getDefaultExportFromCjs(copyToClipboard);
var LARGE_ARRAY_SIZE = 200;
var HASH_UNDEFINED = "__lodash_hash_undefined__";
var INFINITY$1 = 1 / 0, MAX_SAFE_INTEGER$1 = 9007199254740991;
var argsTag$1 = "[object Arguments]", funcTag$1 = "[object Function]", genTag$1 = "[object GeneratorFunction]", symbolTag$1 = "[object Symbol]";
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var reIsUint = /^(?:0|[1-9]\d*)$/;
var freeGlobal$1 = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
var freeSelf$1 = typeof self == "object" && self && self.Object === Object && self;
var root$2 = freeGlobal$1 || freeSelf$1 || Function("return this")();
function apply$7(func, thisArg, args) {
switch (args.length) {
case 0:
return func.call(thisArg);
case 1:
return func.call(thisArg, args[0]);
case 2:
return func.call(thisArg, args[0], args[1]);
case 3:
return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
function arrayIncludes$1(array2, value2) {
var length2 = array2 ? array2.length : 0;
return !!length2 && baseIndexOf(array2, value2, 0) > -1;
}
function arrayIncludesWith(array2, value2, comparator2) {
var index2 = -1, length2 = array2 ? array2.length : 0;
while (++index2 < length2) {
if (comparator2(value2, array2[index2])) {
return true;
}
}
return false;
}
function arrayMap$1(array2, iteratee) {
var index2 = -1, length2 = array2 ? array2.length : 0, result = Array(length2);
while (++index2 < length2) {
result[index2] = iteratee(array2[index2], index2, array2);
}
return result;
}
function arrayPush$2(array2, values2) {
var index2 = -1, length2 = values2.length, offset2 = array2.length;
while (++index2 < length2) {
array2[offset2 + index2] = values2[index2];
}
return array2;
}
function baseFindIndex(array2, predicate, fromIndex, fromRight) {
var length2 = array2.length, index2 = fromIndex + (fromRight ? 1 : -1);
while (fromRight ? index2-- : ++index2 < length2) {
if (predicate(array2[index2], index2, array2)) {
return index2;
}
}
return -1;
}
function baseIndexOf(array2, value2, fromIndex) {
if (value2 !== value2) {
return baseFindIndex(array2, baseIsNaN, fromIndex);
}
var index2 = fromIndex - 1, length2 = array2.length;
while (++index2 < length2) {
if (array2[index2] === value2) {
return index2;
}
}
return -1;
}
function baseIsNaN(value2) {
return value2 !== value2;
}
function baseTimes(n2, iteratee) {
var index2 = -1, result = Array(n2);
while (++index2 < n2) {
result[index2] = iteratee(index2);
}
return result;
}
function baseUnary(func) {
return function(value2) {
return func(value2);
};
}
function cacheHas(cache2, key2) {
return cache2.has(key2);
}
function getValue$1(object2, key2) {
return object2 == null ? void 0 : object2[key2];
}
function isHostObject(value2) {
var result = false;
if (value2 != null && typeof value2.toString != "function") {
try {
result = !!(value2 + "");
} catch (e7) {
}
}
return result;
}
function overArg(func, transform2) {
return function(arg) {
return func(transform2(arg));
};
}
var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto$1 = Object.prototype;
var coreJsData = root$2["__core-js_shared__"];
var maskSrcKey = function() {
var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
return uid2 ? "Symbol(src)_1." + uid2 : "";
}();
var funcToString = funcProto.toString;
var hasOwnProperty$3 = objectProto$1.hasOwnProperty;
var objectToString$1 = objectProto$1.toString;
var reIsNative = RegExp(
"^" + funcToString.call(hasOwnProperty$3).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
var Symbol$4 = root$2.Symbol, getPrototype = overArg(Object.getPrototypeOf, Object), propertyIsEnumerable$1 = objectProto$1.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol$1 = Symbol$4 ? Symbol$4.isConcatSpreadable : void 0;
var nativeGetSymbols = Object.getOwnPropertySymbols, nativeMax$1 = Math.max;
var Map$1 = getNative(root$2, "Map"), nativeCreate = getNative(Object, "create");
function Hash(entries) {
var index2 = -1, length2 = entries ? entries.length : 0;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
function hashDelete(key2) {
return this.has(key2) && delete this.__data__[key2];
}
function hashGet(key2) {
var data2 = this.__data__;
if (nativeCreate) {
var result = data2[key2];
return result === HASH_UNDEFINED ? void 0 : result;
}
return hasOwnProperty$3.call(data2, key2) ? data2[key2] : void 0;
}
function hashHas(key2) {
var data2 = this.__data__;
return nativeCreate ? data2[key2] !== void 0 : hasOwnProperty$3.call(data2, key2);
}
function hashSet(key2, value2) {
var data2 = this.__data__;
data2[key2] = nativeCreate && value2 === void 0 ? HASH_UNDEFINED : value2;
return this;
}
Hash.prototype.clear = hashClear;
Hash.prototype["delete"] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
function ListCache(entries) {
var index2 = -1, length2 = entries ? entries.length : 0;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
function listCacheClear() {
this.__data__ = [];
}
function listCacheDelete(key2) {
var data2 = this.__data__, index2 = assocIndexOf(data2, key2);
if (index2 < 0) {
return false;
}
var lastIndex = data2.length - 1;
if (index2 == lastIndex) {
data2.pop();
} else {
splice.call(data2, index2, 1);
}
return true;
}
function listCacheGet(key2) {
var data2 = this.__data__, index2 = assocIndexOf(data2, key2);
return index2 < 0 ? void 0 : data2[index2][1];
}
function listCacheHas(key2) {
return assocIndexOf(this.__data__, key2) > -1;
}
function listCacheSet(key2, value2) {
var data2 = this.__data__, index2 = assocIndexOf(data2, key2);
if (index2 < 0) {
data2.push([key2, value2]);
} else {
data2[index2][1] = value2;
}
return this;
}
ListCache.prototype.clear = listCacheClear;
ListCache.prototype["delete"] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
function MapCache(entries) {
var index2 = -1, length2 = entries ? entries.length : 0;
this.clear();
while (++index2 < length2) {
var entry2 = entries[index2];
this.set(entry2[0], entry2[1]);
}
}
function mapCacheClear() {
this.__data__ = {
"hash": new Hash(),
"map": new (Map$1 || ListCache)(),
"string": new Hash()
};
}
function mapCacheDelete(key2) {
return getMapData(this, key2)["delete"](key2);
}
function mapCacheGet(key2) {
return getMapData(this, key2).get(key2);
}
function mapCacheHas(key2) {
return getMapData(this, key2).has(key2);
}
function mapCacheSet(key2, value2) {
getMapData(this, key2).set(key2, value2);
return this;
}
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype["delete"] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
function SetCache(values2) {
var index2 = -1, length2 = values2 ? values2.length : 0;
this.__data__ = new MapCache();
while (++index2 < length2) {
this.add(values2[index2]);
}
}
function setCacheAdd(value2) {
this.__data__.set(value2, HASH_UNDEFINED);
return this;
}
function setCacheHas(value2) {
return this.__data__.has(value2);
}
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
function arrayLikeKeys(value2, inherited) {
var result = isArray$4(value2) || isArguments$1(value2) ? baseTimes(value2.length, String) : [];
var length2 = result.length, skipIndexes = !!length2;
for (var key2 in value2) {
if ((inherited || hasOwnProperty$3.call(value2, key2)) && !(skipIndexes && (key2 == "length" || isIndex(key2, length2)))) {
result.push(key2);
}
}
return result;
}
function assocIndexOf(array2, key2) {
var length2 = array2.length;
while (length2--) {
if (eq(array2[length2][0], key2)) {
return length2;
}
}
return -1;
}
function baseDifference(array2, values2, iteratee, comparator2) {
var index2 = -1, includes2 = arrayIncludes$1, isCommon = true, length2 = array2.length, result = [], valuesLength = values2.length;
if (!length2) {
return result;
}
if (iteratee) {
values2 = arrayMap$1(values2, baseUnary(iteratee));
}
if (comparator2) {
includes2 = arrayIncludesWith;
isCommon = false;
} else if (values2.length >= LARGE_ARRAY_SIZE) {
includes2 = cacheHas;
isCommon = false;
values2 = new SetCache(values2);
}
outer:
while (++index2 < length2) {
var value2 = array2[index2], computed = iteratee ? iteratee(value2) : value2;
value2 = comparator2 || value2 !== 0 ? value2 : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values2[valuesIndex] === computed) {
continue outer;
}
}
result.push(value2);
} else if (!includes2(values2, computed, comparator2)) {
result.push(value2);
}
}
return result;
}
function baseFlatten$1(array2, depth, predicate, isStrict, result) {
var index2 = -1, length2 = array2.length;
predicate || (predicate = isFlattenable$1);
result || (result = []);
while (++index2 < length2) {
var value2 = array2[index2];
if (depth > 0 && predicate(value2)) {
if (depth > 1) {
baseFlatten$1(value2, depth - 1, predicate, isStrict, result);
} else {
arrayPush$2(result, value2);
}
} else if (!isStrict) {
result[result.length] = value2;
}
}
return result;
}
function baseGetAllKeys(object2, keysFunc, symbolsFunc) {
var result = keysFunc(object2);
return isArray$4(object2) ? result : arrayPush$2(result, symbolsFunc(object2));
}
function baseIsNative(value2) {
if (!isObject$c(value2) || isMasked(value2)) {
return false;
}
var pattern = isFunction$2(value2) || isHostObject(value2) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value2));
}
function baseKeysIn(object2) {
if (!isObject$c(object2)) {
return nativeKeysIn(object2);
}
var isProto = isPrototype(object2), result = [];
for (var key2 in object2) {
if (!(key2 == "constructor" && (isProto || !hasOwnProperty$3.call(object2, key2)))) {
result.push(key2);
}
}
return result;
}
function basePick$1(object2, props) {
object2 = Object(object2);
return basePickBy$1(object2, props, function(value2, key2) {
return key2 in object2;
});
}
function basePickBy$1(object2, props, predicate) {
var index2 = -1, length2 = props.length, result = {};
while (++index2 < length2) {
var key2 = props[index2], value2 = object2[key2];
if (predicate(value2, key2)) {
result[key2] = value2;
}
}
return result;
}
function baseRest$1(func, start2) {
start2 = nativeMax$1(start2 === void 0 ? func.length - 1 : start2, 0);
return function() {
var args = arguments, index2 = -1, length2 = nativeMax$1(args.length - start2, 0), array2 = Array(length2);
while (++index2 < length2) {
array2[index2] = args[start2 + index2];
}
index2 = -1;
var otherArgs = Array(start2 + 1);
while (++index2 < start2) {
otherArgs[index2] = args[index2];
}
otherArgs[start2] = array2;
return apply$7(func, this, otherArgs);
};
}
function getAllKeysIn(object2) {
return baseGetAllKeys(object2, keysIn, getSymbolsIn);
}
function getMapData(map2, key2) {
var data2 = map2.__data__;
return isKeyable(key2) ? data2[typeof key2 == "string" ? "string" : "hash"] : data2.map;
}
function getNative(object2, key2) {
var value2 = getValue$1(object2, key2);
return baseIsNative(value2) ? value2 : void 0;
}
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object2) {
var result = [];
while (object2) {
arrayPush$2(result, getSymbols(object2));
object2 = getPrototype(object2);
}
return result;
};
function isFlattenable$1(value2) {
return isArray$4(value2) || isArguments$1(value2) || !!(spreadableSymbol$1 && value2 && value2[spreadableSymbol$1]);
}
function isIndex(value2, length2) {
length2 = length2 == null ? MAX_SAFE_INTEGER$1 : length2;
return !!length2 && (typeof value2 == "number" || reIsUint.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length2);
}
function isKeyable(value2) {
var type2 = typeof value2;
return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value2 !== "__proto__" : value2 === null;
}
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
function isPrototype(value2) {
var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$1;
return value2 === proto;
}
function nativeKeysIn(object2) {
var result = [];
if (object2 != null) {
for (var key2 in Object(object2)) {
result.push(key2);
}
}
return result;
}
function toKey$1(value2) {
if (typeof value2 == "string" || isSymbol$4(value2)) {
return value2;
}
var result = value2 + "";
return result == "0" && 1 / value2 == -INFINITY$1 ? "-0" : result;
}
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e7) {
}
try {
return func + "";
} catch (e7) {
}
}
return "";
}
function eq(value2, other) {
return value2 === other || value2 !== value2 && other !== other;
}
function isArguments$1(value2) {
return isArrayLikeObject$1(value2) && hasOwnProperty$3.call(value2, "callee") && (!propertyIsEnumerable$1.call(value2, "callee") || objectToString$1.call(value2) == argsTag$1);
}
var isArray$4 = Array.isArray;
function isArrayLike$1(value2) {
return value2 != null && isLength$2(value2.length) && !isFunction$2(value2);
}
function isArrayLikeObject$1(value2) {
return isObjectLike$1(value2) && isArrayLike$1(value2);
}
function isFunction$2(value2) {
var tag = isObject$c(value2) ? objectToString$1.call(value2) : "";
return tag == funcTag$1 || tag == genTag$1;
}
function isLength$2(value2) {
return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER$1;
}
function isObject$c(value2) {
var type2 = typeof value2;
return !!value2 && (type2 == "object" || type2 == "function");
}
function isObjectLike$1(value2) {
return !!value2 && typeof value2 == "object";
}
function isSymbol$4(value2) {
return typeof value2 == "symbol" || isObjectLike$1(value2) && objectToString$1.call(value2) == symbolTag$1;
}
function keysIn(object2) {
return isArrayLike$1(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2);
}
var omit = baseRest$1(function(object2, props) {
if (object2 == null) {
return {};
}
props = arrayMap$1(baseFlatten$1(props, 1), toKey$1);
return basePick$1(object2, baseDifference(getAllKeysIn(object2), props));
});
function stubArray() {
return [];
}
var lodash_omit = omit;
const omit$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_omit);
var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991;
var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", symbolTag = "[object Symbol]";
var freeGlobal = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root$1 = freeGlobal || freeSelf || Function("return this")();
function apply$6(func, thisArg, args) {
switch (args.length) {
case 0:
return func.call(thisArg);
case 1:
return func.call(thisArg, args[0]);
case 2:
return func.call(thisArg, args[0], args[1]);
case 3:
return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
function arrayMap(array2, iteratee) {
var index2 = -1, length2 = array2 ? array2.length : 0, result = Array(length2);
while (++index2 < length2) {
result[index2] = iteratee(array2[index2], index2, array2);
}
return result;
}
function arrayPush$1(array2, values2) {
var index2 = -1, length2 = values2.length, offset2 = array2.length;
while (++index2 < length2) {
array2[offset2 + index2] = values2[index2];
}
return array2;
}
var objectProto = Object.prototype;
var hasOwnProperty$2 = objectProto.hasOwnProperty;
var objectToString = objectProto.toString;
var Symbol$3 = root$1.Symbol, propertyIsEnumerable = objectProto.propertyIsEnumerable, spreadableSymbol = Symbol$3 ? Symbol$3.isConcatSpreadable : void 0;
var nativeMax = Math.max;
function baseFlatten(array2, depth, predicate, isStrict, result) {
var index2 = -1, length2 = array2.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index2 < length2) {
var value2 = array2[index2];
if (depth > 0 && predicate(value2)) {
if (depth > 1) {
baseFlatten(value2, depth - 1, predicate, isStrict, result);
} else {
arrayPush$1(result, value2);
}
} else if (!isStrict) {
result[result.length] = value2;
}
}
return result;
}
function basePick(object2, props) {
object2 = Object(object2);
return basePickBy(object2, props, function(value2, key2) {
return key2 in object2;
});
}
function basePickBy(object2, props, predicate) {
var index2 = -1, length2 = props.length, result = {};
while (++index2 < length2) {
var key2 = props[index2], value2 = object2[key2];
if (predicate(value2, key2)) {
result[key2] = value2;
}
}
return result;
}
function baseRest(func, start2) {
start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
return function() {
var args = arguments, index2 = -1, length2 = nativeMax(args.length - start2, 0), array2 = Array(length2);
while (++index2 < length2) {
array2[index2] = args[start2 + index2];
}
index2 = -1;
var otherArgs = Array(start2 + 1);
while (++index2 < start2) {
otherArgs[index2] = args[index2];
}
otherArgs[start2] = array2;
return apply$6(func, this, otherArgs);
};
}
function isFlattenable(value2) {
return isArray$3(value2) || isArguments(value2) || !!(spreadableSymbol && value2 && value2[spreadableSymbol]);
}
function toKey(value2) {
if (typeof value2 == "string" || isSymbol$3(value2)) {
return value2;
}
var result = value2 + "";
return result == "0" && 1 / value2 == -INFINITY ? "-0" : result;
}
function isArguments(value2) {
return isArrayLikeObject(value2) && hasOwnProperty$2.call(value2, "callee") && (!propertyIsEnumerable.call(value2, "callee") || objectToString.call(value2) == argsTag);
}
var isArray$3 = Array.isArray;
function isArrayLike(value2) {
return value2 != null && isLength$1(value2.length) && !isFunction$1(value2);
}
function isArrayLikeObject(value2) {
return isObjectLike(value2) && isArrayLike(value2);
}
function isFunction$1(value2) {
var tag = isObject$b(value2) ? objectToString.call(value2) : "";
return tag == funcTag || tag == genTag;
}
function isLength$1(value2) {
return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER;
}
function isObject$b(value2) {
var type2 = typeof value2;
return !!value2 && (type2 == "object" || type2 == "function");
}
function isObjectLike(value2) {
return !!value2 && typeof value2 == "object";
}
function isSymbol$3(value2) {
return typeof value2 == "symbol" || isObjectLike(value2) && objectToString.call(value2) == symbolTag;
}
var pick$2 = baseRest(function(object2, props) {
return object2 == null ? {} : basePick(object2, arrayMap(baseFlatten(props, 1), toKey));
});
var lodash_pick = pick$2;
const pick$3 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_pick);
function commonjsRequire(path2) {
throw new Error('Could not dynamically require "' + path2 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var jszip_min = { exports: {} };
/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/
(function(module, exports) {
!function(e7) {
module.exports = e7();
}(function() {
return function s2(a2, o2, h2) {
function u2(r2, e8) {
if (!o2[r2]) {
if (!a2[r2]) {
var t5 = "function" == typeof commonjsRequire && commonjsRequire;
if (!e8 && t5)
return t5(r2, true);
if (l2)
return l2(r2, true);
var n2 = new Error("Cannot find module '" + r2 + "'");
throw n2.code = "MODULE_NOT_FOUND", n2;
}
var i2 = o2[r2] = { exports: {} };
a2[r2][0].call(i2.exports, function(e9) {
var t6 = a2[r2][1][e9];
return u2(t6 || e9);
}, i2, i2.exports, s2, a2, o2, h2);
}
return o2[r2].exports;
}
for (var l2 = "function" == typeof commonjsRequire && commonjsRequire, e7 = 0; e7 < h2.length; e7++)
u2(h2[e7]);
return u2;
}({ 1: [function(e7, t5, r2) {
var d2 = e7("./utils"), c2 = e7("./support"), p2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
r2.encode = function(e8) {
for (var t6, r3, n2, i2, s2, a2, o2, h2 = [], u2 = 0, l2 = e8.length, f2 = l2, c3 = "string" !== d2.getTypeOf(e8); u2 < e8.length; )
f2 = l2 - u2, n2 = c3 ? (t6 = e8[u2++], r3 = u2 < l2 ? e8[u2++] : 0, u2 < l2 ? e8[u2++] : 0) : (t6 = e8.charCodeAt(u2++), r3 = u2 < l2 ? e8.charCodeAt(u2++) : 0, u2 < l2 ? e8.charCodeAt(u2++) : 0), i2 = t6 >> 2, s2 = (3 & t6) << 4 | r3 >> 4, a2 = 1 < f2 ? (15 & r3) << 2 | n2 >> 6 : 64, o2 = 2 < f2 ? 63 & n2 : 64, h2.push(p2.charAt(i2) + p2.charAt(s2) + p2.charAt(a2) + p2.charAt(o2));
return h2.join("");
}, r2.decode = function(e8) {
var t6, r3, n2, i2, s2, a2, o2 = 0, h2 = 0, u2 = "data:";
if (e8.substr(0, u2.length) === u2)
throw new Error("Invalid base64 input, it looks like a data url.");
var l2, f2 = 3 * (e8 = e8.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
if (e8.charAt(e8.length - 1) === p2.charAt(64) && f2--, e8.charAt(e8.length - 2) === p2.charAt(64) && f2--, f2 % 1 != 0)
throw new Error("Invalid base64 input, bad content length.");
for (l2 = c2.uint8array ? new Uint8Array(0 | f2) : new Array(0 | f2); o2 < e8.length; )
t6 = p2.indexOf(e8.charAt(o2++)) << 2 | (i2 = p2.indexOf(e8.charAt(o2++))) >> 4, r3 = (15 & i2) << 4 | (s2 = p2.indexOf(e8.charAt(o2++))) >> 2, n2 = (3 & s2) << 6 | (a2 = p2.indexOf(e8.charAt(o2++))), l2[h2++] = t6, 64 !== s2 && (l2[h2++] = r3), 64 !== a2 && (l2[h2++] = n2);
return l2;
};
}, { "./support": 30, "./utils": 32 }], 2: [function(e7, t5, r2) {
var n2 = e7("./external"), i2 = e7("./stream/DataWorker"), s2 = e7("./stream/Crc32Probe"), a2 = e7("./stream/DataLengthProbe");
function o2(e8, t6, r3, n3, i3) {
this.compressedSize = e8, this.uncompressedSize = t6, this.crc32 = r3, this.compression = n3, this.compressedContent = i3;
}
o2.prototype = { getContentWorker: function() {
var e8 = new i2(n2.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a2("data_length")), t6 = this;
return e8.on("end", function() {
if (this.streamInfo.data_length !== t6.uncompressedSize)
throw new Error("Bug : uncompressed data size mismatch");
}), e8;
}, getCompressedWorker: function() {
return new i2(n2.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
} }, o2.createWorkerFrom = function(e8, t6, r3) {
return e8.pipe(new s2()).pipe(new a2("uncompressedSize")).pipe(t6.compressWorker(r3)).pipe(new a2("compressedSize")).withStreamInfo("compression", t6);
}, t5.exports = o2;
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(e7, t5, r2) {
var n2 = e7("./stream/GenericWorker");
r2.STORE = { magic: "\0\0", compressWorker: function() {
return new n2("STORE compression");
}, uncompressWorker: function() {
return new n2("STORE decompression");
} }, r2.DEFLATE = e7("./flate");
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(e7, t5, r2) {
var n2 = e7("./utils");
var o2 = function() {
for (var e8, t6 = [], r3 = 0; r3 < 256; r3++) {
e8 = r3;
for (var n3 = 0; n3 < 8; n3++)
e8 = 1 & e8 ? 3988292384 ^ e8 >>> 1 : e8 >>> 1;
t6[r3] = e8;
}
return t6;
}();
t5.exports = function(e8, t6) {
return void 0 !== e8 && e8.length ? "string" !== n2.getTypeOf(e8) ? function(e9, t7, r3, n3) {
var i2 = o2, s2 = n3 + r3;
e9 ^= -1;
for (var a2 = n3; a2 < s2; a2++)
e9 = e9 >>> 8 ^ i2[255 & (e9 ^ t7[a2])];
return -1 ^ e9;
}(0 | t6, e8, e8.length, 0) : function(e9, t7, r3, n3) {
var i2 = o2, s2 = n3 + r3;
e9 ^= -1;
for (var a2 = n3; a2 < s2; a2++)
e9 = e9 >>> 8 ^ i2[255 & (e9 ^ t7.charCodeAt(a2))];
return -1 ^ e9;
}(0 | t6, e8, e8.length, 0) : 0;
};
}, { "./utils": 32 }], 5: [function(e7, t5, r2) {
r2.base64 = false, r2.binary = false, r2.dir = false, r2.createFolders = true, r2.date = null, r2.compression = null, r2.compressionOptions = null, r2.comment = null, r2.unixPermissions = null, r2.dosPermissions = null;
}, {}], 6: [function(e7, t5, r2) {
var n2 = null;
n2 = "undefined" != typeof Promise ? Promise : e7("lie"), t5.exports = { Promise: n2 };
}, { lie: 37 }], 7: [function(e7, t5, r2) {
var n2 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, i2 = e7("pako"), s2 = e7("./utils"), a2 = e7("./stream/GenericWorker"), o2 = n2 ? "uint8array" : "array";
function h2(e8, t6) {
a2.call(this, "FlateWorker/" + e8), this._pako = null, this._pakoAction = e8, this._pakoOptions = t6, this.meta = {};
}
r2.magic = "\b\0", s2.inherits(h2, a2), h2.prototype.processChunk = function(e8) {
this.meta = e8.meta, null === this._pako && this._createPako(), this._pako.push(s2.transformTo(o2, e8.data), false);
}, h2.prototype.flush = function() {
a2.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], true);
}, h2.prototype.cleanUp = function() {
a2.prototype.cleanUp.call(this), this._pako = null;
}, h2.prototype._createPako = function() {
this._pako = new i2[this._pakoAction]({ raw: true, level: this._pakoOptions.level || -1 });
var t6 = this;
this._pako.onData = function(e8) {
t6.push({ data: e8, meta: t6.meta });
};
}, r2.compressWorker = function(e8) {
return new h2("Deflate", e8);
}, r2.uncompressWorker = function() {
return new h2("Inflate", {});
};
}, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(e7, t5, r2) {
function A5(e8, t6) {
var r3, n3 = "";
for (r3 = 0; r3 < t6; r3++)
n3 += String.fromCharCode(255 & e8), e8 >>>= 8;
return n3;
}
function n2(e8, t6, r3, n3, i3, s3) {
var a2, o2, h2 = e8.file, u2 = e8.compression, l2 = s3 !== O2.utf8encode, f2 = I2.transformTo("string", s3(h2.name)), c2 = I2.transformTo("string", O2.utf8encode(h2.name)), d2 = h2.comment, p2 = I2.transformTo("string", s3(d2)), m2 = I2.transformTo("string", O2.utf8encode(d2)), _24 = c2.length !== h2.name.length, g2 = m2.length !== d2.length, b2 = "", v2 = "", y2 = "", w2 = h2.dir, k2 = h2.date, x2 = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
t6 && !r3 || (x2.crc32 = e8.crc32, x2.compressedSize = e8.compressedSize, x2.uncompressedSize = e8.uncompressedSize);
var S2 = 0;
t6 && (S2 |= 8), l2 || !_24 && !g2 || (S2 |= 2048);
var z2 = 0, C3 = 0;
w2 && (z2 |= 16), "UNIX" === i3 ? (C3 = 798, z2 |= function(e9, t7) {
var r4 = e9;
return e9 || (r4 = t7 ? 16893 : 33204), (65535 & r4) << 16;
}(h2.unixPermissions, w2)) : (C3 = 20, z2 |= function(e9) {
return 63 & (e9 || 0);
}(h2.dosPermissions)), a2 = k2.getUTCHours(), a2 <<= 6, a2 |= k2.getUTCMinutes(), a2 <<= 5, a2 |= k2.getUTCSeconds() / 2, o2 = k2.getUTCFullYear() - 1980, o2 <<= 4, o2 |= k2.getUTCMonth() + 1, o2 <<= 5, o2 |= k2.getUTCDate(), _24 && (v2 = A5(1, 1) + A5(B3(f2), 4) + c2, b2 += "up" + A5(v2.length, 2) + v2), g2 && (y2 = A5(1, 1) + A5(B3(p2), 4) + m2, b2 += "uc" + A5(y2.length, 2) + y2);
var E2 = "";
return E2 += "\n\0", E2 += A5(S2, 2), E2 += u2.magic, E2 += A5(a2, 2), E2 += A5(o2, 2), E2 += A5(x2.crc32, 4), E2 += A5(x2.compressedSize, 4), E2 += A5(x2.uncompressedSize, 4), E2 += A5(f2.length, 2), E2 += A5(b2.length, 2), { fileRecord: R2.LOCAL_FILE_HEADER + E2 + f2 + b2, dirRecord: R2.CENTRAL_FILE_HEADER + A5(C3, 2) + E2 + A5(p2.length, 2) + "\0\0\0\0" + A5(z2, 4) + A5(n3, 4) + f2 + b2 + p2 };
}
var I2 = e7("../utils"), i2 = e7("../stream/GenericWorker"), O2 = e7("../utf8"), B3 = e7("../crc32"), R2 = e7("../signature");
function s2(e8, t6, r3, n3) {
i2.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = t6, this.zipPlatform = r3, this.encodeFileName = n3, this.streamFiles = e8, this.accumulate = false, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
}
I2.inherits(s2, i2), s2.prototype.push = function(e8) {
var t6 = e8.meta.percent || 0, r3 = this.entriesCount, n3 = this._sources.length;
this.accumulate ? this.contentBuffer.push(e8) : (this.bytesWritten += e8.data.length, i2.prototype.push.call(this, { data: e8.data, meta: { currentFile: this.currentFile, percent: r3 ? (t6 + 100 * (r3 - n3 - 1)) / r3 : 100 } }));
}, s2.prototype.openedSource = function(e8) {
this.currentSourceOffset = this.bytesWritten, this.currentFile = e8.file.name;
var t6 = this.streamFiles && !e8.file.dir;
if (t6) {
var r3 = n2(e8, t6, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
this.push({ data: r3.fileRecord, meta: { percent: 0 } });
} else
this.accumulate = true;
}, s2.prototype.closedSource = function(e8) {
this.accumulate = false;
var t6 = this.streamFiles && !e8.file.dir, r3 = n2(e8, t6, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
if (this.dirRecords.push(r3.dirRecord), t6)
this.push({ data: function(e9) {
return R2.DATA_DESCRIPTOR + A5(e9.crc32, 4) + A5(e9.compressedSize, 4) + A5(e9.uncompressedSize, 4);
}(e8), meta: { percent: 100 } });
else
for (this.push({ data: r3.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; )
this.push(this.contentBuffer.shift());
this.currentFile = null;
}, s2.prototype.flush = function() {
for (var e8 = this.bytesWritten, t6 = 0; t6 < this.dirRecords.length; t6++)
this.push({ data: this.dirRecords[t6], meta: { percent: 100 } });
var r3 = this.bytesWritten - e8, n3 = function(e9, t7, r4, n4, i3) {
var s3 = I2.transformTo("string", i3(n4));
return R2.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A5(e9, 2) + A5(e9, 2) + A5(t7, 4) + A5(r4, 4) + A5(s3.length, 2) + s3;
}(this.dirRecords.length, r3, e8, this.zipComment, this.encodeFileName);
this.push({ data: n3, meta: { percent: 100 } });
}, s2.prototype.prepareNextSource = function() {
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
}, s2.prototype.registerPrevious = function(e8) {
this._sources.push(e8);
var t6 = this;
return e8.on("data", function(e9) {
t6.processChunk(e9);
}), e8.on("end", function() {
t6.closedSource(t6.previous.streamInfo), t6._sources.length ? t6.prepareNextSource() : t6.end();
}), e8.on("error", function(e9) {
t6.error(e9);
}), this;
}, s2.prototype.resume = function() {
return !!i2.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), true) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), true));
}, s2.prototype.error = function(e8) {
var t6 = this._sources;
if (!i2.prototype.error.call(this, e8))
return false;
for (var r3 = 0; r3 < t6.length; r3++)
try {
t6[r3].error(e8);
} catch (e9) {
}
return true;
}, s2.prototype.lock = function() {
i2.prototype.lock.call(this);
for (var e8 = this._sources, t6 = 0; t6 < e8.length; t6++)
e8[t6].lock();
}, t5.exports = s2;
}, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(e7, t5, r2) {
var u2 = e7("../compressions"), n2 = e7("./ZipFileWorker");
r2.generateWorker = function(e8, a2, t6) {
var o2 = new n2(a2.streamFiles, t6, a2.platform, a2.encodeFileName), h2 = 0;
try {
e8.forEach(function(e9, t7) {
h2++;
var r3 = function(e11, t8) {
var r4 = e11 || t8, n4 = u2[r4];
if (!n4)
throw new Error(r4 + " is not a valid compression method !");
return n4;
}(t7.options.compression, a2.compression), n3 = t7.options.compressionOptions || a2.compressionOptions || {}, i2 = t7.dir, s2 = t7.date;
t7._compressWorker(r3, n3).withStreamInfo("file", { name: e9, dir: i2, date: s2, comment: t7.comment || "", unixPermissions: t7.unixPermissions, dosPermissions: t7.dosPermissions }).pipe(o2);
}), o2.entriesCount = h2;
} catch (e9) {
o2.error(e9);
}
return o2;
};
}, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(e7, t5, r2) {
function n2() {
if (!(this instanceof n2))
return new n2();
if (arguments.length)
throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
var e8 = new n2();
for (var t6 in this)
"function" != typeof this[t6] && (e8[t6] = this[t6]);
return e8;
};
}
(n2.prototype = e7("./object")).loadAsync = e7("./load"), n2.support = e7("./support"), n2.defaults = e7("./defaults"), n2.version = "3.10.1", n2.loadAsync = function(e8, t6) {
return new n2().loadAsync(e8, t6);
}, n2.external = e7("./external"), t5.exports = n2;
}, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(e7, t5, r2) {
var u2 = e7("./utils"), i2 = e7("./external"), n2 = e7("./utf8"), s2 = e7("./zipEntries"), a2 = e7("./stream/Crc32Probe"), l2 = e7("./nodejsUtils");
function f2(n3) {
return new i2.Promise(function(e8, t6) {
var r3 = n3.decompressed.getContentWorker().pipe(new a2());
r3.on("error", function(e9) {
t6(e9);
}).on("end", function() {
r3.streamInfo.crc32 !== n3.decompressed.crc32 ? t6(new Error("Corrupted zip : CRC32 mismatch")) : e8();
}).resume();
});
}
t5.exports = function(e8, o2) {
var h2 = this;
return o2 = u2.extend(o2 || {}, { base64: false, checkCRC32: false, optimizedBinaryString: false, createFolders: false, decodeFileName: n2.utf8decode }), l2.isNode && l2.isStream(e8) ? i2.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : u2.prepareContent("the loaded zip file", e8, true, o2.optimizedBinaryString, o2.base64).then(function(e9) {
var t6 = new s2(o2);
return t6.load(e9), t6;
}).then(function(e9) {
var t6 = [i2.Promise.resolve(e9)], r3 = e9.files;
if (o2.checkCRC32)
for (var n3 = 0; n3 < r3.length; n3++)
t6.push(f2(r3[n3]));
return i2.Promise.all(t6);
}).then(function(e9) {
for (var t6 = e9.shift(), r3 = t6.files, n3 = 0; n3 < r3.length; n3++) {
var i3 = r3[n3], s3 = i3.fileNameStr, a3 = u2.resolve(i3.fileNameStr);
h2.file(a3, i3.decompressed, { binary: true, optimizedBinaryString: true, date: i3.date, dir: i3.dir, comment: i3.fileCommentStr.length ? i3.fileCommentStr : null, unixPermissions: i3.unixPermissions, dosPermissions: i3.dosPermissions, createFolders: o2.createFolders }), i3.dir || (h2.file(a3).unsafeOriginalName = s3);
}
return t6.zipComment.length && (h2.comment = t6.zipComment), h2;
});
};
}, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(e7, t5, r2) {
var n2 = e7("../utils"), i2 = e7("../stream/GenericWorker");
function s2(e8, t6) {
i2.call(this, "Nodejs stream input adapter for " + e8), this._upstreamEnded = false, this._bindStream(t6);
}
n2.inherits(s2, i2), s2.prototype._bindStream = function(e8) {
var t6 = this;
(this._stream = e8).pause(), e8.on("data", function(e9) {
t6.push({ data: e9, meta: { percent: 0 } });
}).on("error", function(e9) {
t6.isPaused ? this.generatedError = e9 : t6.error(e9);
}).on("end", function() {
t6.isPaused ? t6._upstreamEnded = true : t6.end();
});
}, s2.prototype.pause = function() {
return !!i2.prototype.pause.call(this) && (this._stream.pause(), true);
}, s2.prototype.resume = function() {
return !!i2.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), true);
}, t5.exports = s2;
}, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(e7, t5, r2) {
var i2 = e7("readable-stream").Readable;
function n2(e8, t6, r3) {
i2.call(this, t6), this._helper = e8;
var n3 = this;
e8.on("data", function(e9, t7) {
n3.push(e9) || n3._helper.pause(), r3 && r3(t7);
}).on("error", function(e9) {
n3.emit("error", e9);
}).on("end", function() {
n3.push(null);
});
}
e7("../utils").inherits(n2, i2), n2.prototype._read = function() {
this._helper.resume();
}, t5.exports = n2;
}, { "../utils": 32, "readable-stream": 16 }], 14: [function(e7, t5, r2) {
t5.exports = { isNode: "undefined" != typeof Buffer, newBufferFrom: function(e8, t6) {
if (Buffer.from && Buffer.from !== Uint8Array.from)
return Buffer.from(e8, t6);
if ("number" == typeof e8)
throw new Error('The "data" argument must not be a number');
return new Buffer(e8, t6);
}, allocBuffer: function(e8) {
if (Buffer.alloc)
return Buffer.alloc(e8);
var t6 = new Buffer(e8);
return t6.fill(0), t6;
}, isBuffer: function(e8) {
return Buffer.isBuffer(e8);
}, isStream: function(e8) {
return e8 && "function" == typeof e8.on && "function" == typeof e8.pause && "function" == typeof e8.resume;
} };
}, {}], 15: [function(e7, t5, r2) {
function s2(e8, t6, r3) {
var n3, i3 = u2.getTypeOf(t6), s3 = u2.extend(r3 || {}, f2);
s3.date = s3.date || /* @__PURE__ */ new Date(), null !== s3.compression && (s3.compression = s3.compression.toUpperCase()), "string" == typeof s3.unixPermissions && (s3.unixPermissions = parseInt(s3.unixPermissions, 8)), s3.unixPermissions && 16384 & s3.unixPermissions && (s3.dir = true), s3.dosPermissions && 16 & s3.dosPermissions && (s3.dir = true), s3.dir && (e8 = g2(e8)), s3.createFolders && (n3 = _24(e8)) && b2.call(this, n3, true);
var a3 = "string" === i3 && false === s3.binary && false === s3.base64;
r3 && void 0 !== r3.binary || (s3.binary = !a3), (t6 instanceof c2 && 0 === t6.uncompressedSize || s3.dir || !t6 || 0 === t6.length) && (s3.base64 = false, s3.binary = true, t6 = "", s3.compression = "STORE", i3 = "string");
var o3 = null;
o3 = t6 instanceof c2 || t6 instanceof l2 ? t6 : p2.isNode && p2.isStream(t6) ? new m2(e8, t6) : u2.prepareContent(e8, t6, s3.binary, s3.optimizedBinaryString, s3.base64);
var h3 = new d2(e8, o3, s3);
this.files[e8] = h3;
}
var i2 = e7("./utf8"), u2 = e7("./utils"), l2 = e7("./stream/GenericWorker"), a2 = e7("./stream/StreamHelper"), f2 = e7("./defaults"), c2 = e7("./compressedObject"), d2 = e7("./zipObject"), o2 = e7("./generate"), p2 = e7("./nodejsUtils"), m2 = e7("./nodejs/NodejsStreamInputAdapter"), _24 = function(e8) {
"/" === e8.slice(-1) && (e8 = e8.substring(0, e8.length - 1));
var t6 = e8.lastIndexOf("/");
return 0 < t6 ? e8.substring(0, t6) : "";
}, g2 = function(e8) {
return "/" !== e8.slice(-1) && (e8 += "/"), e8;
}, b2 = function(e8, t6) {
return t6 = void 0 !== t6 ? t6 : f2.createFolders, e8 = g2(e8), this.files[e8] || s2.call(this, e8, null, { dir: true, createFolders: t6 }), this.files[e8];
};
function h2(e8) {
return "[object RegExp]" === Object.prototype.toString.call(e8);
}
var n2 = { load: function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, forEach: function(e8) {
var t6, r3, n3;
for (t6 in this.files)
n3 = this.files[t6], (r3 = t6.slice(this.root.length, t6.length)) && t6.slice(0, this.root.length) === this.root && e8(r3, n3);
}, filter: function(r3) {
var n3 = [];
return this.forEach(function(e8, t6) {
r3(e8, t6) && n3.push(t6);
}), n3;
}, file: function(e8, t6, r3) {
if (1 !== arguments.length)
return e8 = this.root + e8, s2.call(this, e8, t6, r3), this;
if (h2(e8)) {
var n3 = e8;
return this.filter(function(e9, t7) {
return !t7.dir && n3.test(e9);
});
}
var i3 = this.files[this.root + e8];
return i3 && !i3.dir ? i3 : null;
}, folder: function(r3) {
if (!r3)
return this;
if (h2(r3))
return this.filter(function(e9, t7) {
return t7.dir && r3.test(e9);
});
var e8 = this.root + r3, t6 = b2.call(this, e8), n3 = this.clone();
return n3.root = t6.name, n3;
}, remove: function(r3) {
r3 = this.root + r3;
var e8 = this.files[r3];
if (e8 || ("/" !== r3.slice(-1) && (r3 += "/"), e8 = this.files[r3]), e8 && !e8.dir)
delete this.files[r3];
else
for (var t6 = this.filter(function(e9, t7) {
return t7.name.slice(0, r3.length) === r3;
}), n3 = 0; n3 < t6.length; n3++)
delete this.files[t6[n3].name];
return this;
}, generate: function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, generateInternalStream: function(e8) {
var t6, r3 = {};
try {
if ((r3 = u2.extend(e8 || {}, { streamFiles: false, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i2.utf8encode })).type = r3.type.toLowerCase(), r3.compression = r3.compression.toUpperCase(), "binarystring" === r3.type && (r3.type = "string"), !r3.type)
throw new Error("No output type specified.");
u2.checkSupport(r3.type), "darwin" !== r3.platform && "freebsd" !== r3.platform && "linux" !== r3.platform && "sunos" !== r3.platform || (r3.platform = "UNIX"), "win32" === r3.platform && (r3.platform = "DOS");
var n3 = r3.comment || this.comment || "";
t6 = o2.generateWorker(this, r3, n3);
} catch (e9) {
(t6 = new l2("error")).error(e9);
}
return new a2(t6, r3.type || "string", r3.mimeType);
}, generateAsync: function(e8, t6) {
return this.generateInternalStream(e8).accumulate(t6);
}, generateNodeStream: function(e8, t6) {
return (e8 = e8 || {}).type || (e8.type = "nodebuffer"), this.generateInternalStream(e8).toNodejsStream(t6);
} };
t5.exports = n2;
}, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function(e7, t5, r2) {
t5.exports = e7("stream");
}, { stream: void 0 }], 17: [function(e7, t5, r2) {
var n2 = e7("./DataReader");
function i2(e8) {
n2.call(this, e8);
for (var t6 = 0; t6 < this.data.length; t6++)
e8[t6] = 255 & e8[t6];
}
e7("../utils").inherits(i2, n2), i2.prototype.byteAt = function(e8) {
return this.data[this.zero + e8];
}, i2.prototype.lastIndexOfSignature = function(e8) {
for (var t6 = e8.charCodeAt(0), r3 = e8.charCodeAt(1), n3 = e8.charCodeAt(2), i3 = e8.charCodeAt(3), s2 = this.length - 4; 0 <= s2; --s2)
if (this.data[s2] === t6 && this.data[s2 + 1] === r3 && this.data[s2 + 2] === n3 && this.data[s2 + 3] === i3)
return s2 - this.zero;
return -1;
}, i2.prototype.readAndCheckSignature = function(e8) {
var t6 = e8.charCodeAt(0), r3 = e8.charCodeAt(1), n3 = e8.charCodeAt(2), i3 = e8.charCodeAt(3), s2 = this.readData(4);
return t6 === s2[0] && r3 === s2[1] && n3 === s2[2] && i3 === s2[3];
}, i2.prototype.readData = function(e8) {
if (this.checkOffset(e8), 0 === e8)
return [];
var t6 = this.data.slice(this.zero + this.index, this.zero + this.index + e8);
return this.index += e8, t6;
}, t5.exports = i2;
}, { "../utils": 32, "./DataReader": 18 }], 18: [function(e7, t5, r2) {
var n2 = e7("../utils");
function i2(e8) {
this.data = e8, this.length = e8.length, this.index = 0, this.zero = 0;
}
i2.prototype = { checkOffset: function(e8) {
this.checkIndex(this.index + e8);
}, checkIndex: function(e8) {
if (this.length < this.zero + e8 || e8 < 0)
throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e8 + "). Corrupted zip ?");
}, setIndex: function(e8) {
this.checkIndex(e8), this.index = e8;
}, skip: function(e8) {
this.setIndex(this.index + e8);
}, byteAt: function() {
}, readInt: function(e8) {
var t6, r3 = 0;
for (this.checkOffset(e8), t6 = this.index + e8 - 1; t6 >= this.index; t6--)
r3 = (r3 << 8) + this.byteAt(t6);
return this.index += e8, r3;
}, readString: function(e8) {
return n2.transformTo("string", this.readData(e8));
}, readData: function() {
}, lastIndexOfSignature: function() {
}, readAndCheckSignature: function() {
}, readDate: function() {
var e8 = this.readInt(4);
return new Date(Date.UTC(1980 + (e8 >> 25 & 127), (e8 >> 21 & 15) - 1, e8 >> 16 & 31, e8 >> 11 & 31, e8 >> 5 & 63, (31 & e8) << 1));
} }, t5.exports = i2;
}, { "../utils": 32 }], 19: [function(e7, t5, r2) {
var n2 = e7("./Uint8ArrayReader");
function i2(e8) {
n2.call(this, e8);
}
e7("../utils").inherits(i2, n2), i2.prototype.readData = function(e8) {
this.checkOffset(e8);
var t6 = this.data.slice(this.zero + this.index, this.zero + this.index + e8);
return this.index += e8, t6;
}, t5.exports = i2;
}, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(e7, t5, r2) {
var n2 = e7("./DataReader");
function i2(e8) {
n2.call(this, e8);
}
e7("../utils").inherits(i2, n2), i2.prototype.byteAt = function(e8) {
return this.data.charCodeAt(this.zero + e8);
}, i2.prototype.lastIndexOfSignature = function(e8) {
return this.data.lastIndexOf(e8) - this.zero;
}, i2.prototype.readAndCheckSignature = function(e8) {
return e8 === this.readData(4);
}, i2.prototype.readData = function(e8) {
this.checkOffset(e8);
var t6 = this.data.slice(this.zero + this.index, this.zero + this.index + e8);
return this.index += e8, t6;
}, t5.exports = i2;
}, { "../utils": 32, "./DataReader": 18 }], 21: [function(e7, t5, r2) {
var n2 = e7("./ArrayReader");
function i2(e8) {
n2.call(this, e8);
}
e7("../utils").inherits(i2, n2), i2.prototype.readData = function(e8) {
if (this.checkOffset(e8), 0 === e8)
return new Uint8Array(0);
var t6 = this.data.subarray(this.zero + this.index, this.zero + this.index + e8);
return this.index += e8, t6;
}, t5.exports = i2;
}, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(e7, t5, r2) {
var n2 = e7("../utils"), i2 = e7("../support"), s2 = e7("./ArrayReader"), a2 = e7("./StringReader"), o2 = e7("./NodeBufferReader"), h2 = e7("./Uint8ArrayReader");
t5.exports = function(e8) {
var t6 = n2.getTypeOf(e8);
return n2.checkSupport(t6), "string" !== t6 || i2.uint8array ? "nodebuffer" === t6 ? new o2(e8) : i2.uint8array ? new h2(n2.transformTo("uint8array", e8)) : new s2(n2.transformTo("array", e8)) : new a2(e8);
};
}, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(e7, t5, r2) {
r2.LOCAL_FILE_HEADER = "PK", r2.CENTRAL_FILE_HEADER = "PK", r2.CENTRAL_DIRECTORY_END = "PK", r2.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", r2.ZIP64_CENTRAL_DIRECTORY_END = "PK", r2.DATA_DESCRIPTOR = "PK\x07\b";
}, {}], 24: [function(e7, t5, r2) {
var n2 = e7("./GenericWorker"), i2 = e7("../utils");
function s2(e8) {
n2.call(this, "ConvertWorker to " + e8), this.destType = e8;
}
i2.inherits(s2, n2), s2.prototype.processChunk = function(e8) {
this.push({ data: i2.transformTo(this.destType, e8.data), meta: e8.meta });
}, t5.exports = s2;
}, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(e7, t5, r2) {
var n2 = e7("./GenericWorker"), i2 = e7("../crc32");
function s2() {
n2.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
}
e7("../utils").inherits(s2, n2), s2.prototype.processChunk = function(e8) {
this.streamInfo.crc32 = i2(e8.data, this.streamInfo.crc32 || 0), this.push(e8);
}, t5.exports = s2;
}, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(e7, t5, r2) {
var n2 = e7("../utils"), i2 = e7("./GenericWorker");
function s2(e8) {
i2.call(this, "DataLengthProbe for " + e8), this.propName = e8, this.withStreamInfo(e8, 0);
}
n2.inherits(s2, i2), s2.prototype.processChunk = function(e8) {
if (e8) {
var t6 = this.streamInfo[this.propName] || 0;
this.streamInfo[this.propName] = t6 + e8.data.length;
}
i2.prototype.processChunk.call(this, e8);
}, t5.exports = s2;
}, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(e7, t5, r2) {
var n2 = e7("../utils"), i2 = e7("./GenericWorker");
function s2(e8) {
i2.call(this, "DataWorker");
var t6 = this;
this.dataIsReady = false, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = false, e8.then(function(e9) {
t6.dataIsReady = true, t6.data = e9, t6.max = e9 && e9.length || 0, t6.type = n2.getTypeOf(e9), t6.isPaused || t6._tickAndRepeat();
}, function(e9) {
t6.error(e9);
});
}
n2.inherits(s2, i2), s2.prototype.cleanUp = function() {
i2.prototype.cleanUp.call(this), this.data = null;
}, s2.prototype.resume = function() {
return !!i2.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = true, n2.delay(this._tickAndRepeat, [], this)), true);
}, s2.prototype._tickAndRepeat = function() {
this._tickScheduled = false, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (n2.delay(this._tickAndRepeat, [], this), this._tickScheduled = true));
}, s2.prototype._tick = function() {
if (this.isPaused || this.isFinished)
return false;
var e8 = null, t6 = Math.min(this.max, this.index + 16384);
if (this.index >= this.max)
return this.end();
switch (this.type) {
case "string":
e8 = this.data.substring(this.index, t6);
break;
case "uint8array":
e8 = this.data.subarray(this.index, t6);
break;
case "array":
case "nodebuffer":
e8 = this.data.slice(this.index, t6);
}
return this.index = t6, this.push({ data: e8, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
}, t5.exports = s2;
}, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(e7, t5, r2) {
function n2(e8) {
this.name = e8 || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = true, this.isFinished = false, this.isLocked = false, this._listeners = { data: [], end: [], error: [] }, this.previous = null;
}
n2.prototype = { push: function(e8) {
this.emit("data", e8);
}, end: function() {
if (this.isFinished)
return false;
this.flush();
try {
this.emit("end"), this.cleanUp(), this.isFinished = true;
} catch (e8) {
this.emit("error", e8);
}
return true;
}, error: function(e8) {
return !this.isFinished && (this.isPaused ? this.generatedError = e8 : (this.isFinished = true, this.emit("error", e8), this.previous && this.previous.error(e8), this.cleanUp()), true);
}, on: function(e8, t6) {
return this._listeners[e8].push(t6), this;
}, cleanUp: function() {
this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
}, emit: function(e8, t6) {
if (this._listeners[e8])
for (var r3 = 0; r3 < this._listeners[e8].length; r3++)
this._listeners[e8][r3].call(this, t6);
}, pipe: function(e8) {
return e8.registerPrevious(this);
}, registerPrevious: function(e8) {
if (this.isLocked)
throw new Error("The stream '" + this + "' has already been used.");
this.streamInfo = e8.streamInfo, this.mergeStreamInfo(), this.previous = e8;
var t6 = this;
return e8.on("data", function(e9) {
t6.processChunk(e9);
}), e8.on("end", function() {
t6.end();
}), e8.on("error", function(e9) {
t6.error(e9);
}), this;
}, pause: function() {
return !this.isPaused && !this.isFinished && (this.isPaused = true, this.previous && this.previous.pause(), true);
}, resume: function() {
if (!this.isPaused || this.isFinished)
return false;
var e8 = this.isPaused = false;
return this.generatedError && (this.error(this.generatedError), e8 = true), this.previous && this.previous.resume(), !e8;
}, flush: function() {
}, processChunk: function(e8) {
this.push(e8);
}, withStreamInfo: function(e8, t6) {
return this.extraStreamInfo[e8] = t6, this.mergeStreamInfo(), this;
}, mergeStreamInfo: function() {
for (var e8 in this.extraStreamInfo)
Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e8) && (this.streamInfo[e8] = this.extraStreamInfo[e8]);
}, lock: function() {
if (this.isLocked)
throw new Error("The stream '" + this + "' has already been used.");
this.isLocked = true, this.previous && this.previous.lock();
}, toString: function() {
var e8 = "Worker " + this.name;
return this.previous ? this.previous + " -> " + e8 : e8;
} }, t5.exports = n2;
}, {}], 29: [function(e7, t5, r2) {
var h2 = e7("../utils"), i2 = e7("./ConvertWorker"), s2 = e7("./GenericWorker"), u2 = e7("../base64"), n2 = e7("../support"), a2 = e7("../external"), o2 = null;
if (n2.nodestream)
try {
o2 = e7("../nodejs/NodejsStreamOutputAdapter");
} catch (e8) {
}
function l2(e8, o3) {
return new a2.Promise(function(t6, r3) {
var n3 = [], i3 = e8._internalType, s3 = e8._outputType, a3 = e8._mimeType;
e8.on("data", function(e9, t7) {
n3.push(e9), o3 && o3(t7);
}).on("error", function(e9) {
n3 = [], r3(e9);
}).on("end", function() {
try {
var e9 = function(e11, t7, r4) {
switch (e11) {
case "blob":
return h2.newBlob(h2.transformTo("arraybuffer", t7), r4);
case "base64":
return u2.encode(t7);
default:
return h2.transformTo(e11, t7);
}
}(s3, function(e11, t7) {
var r4, n4 = 0, i4 = null, s4 = 0;
for (r4 = 0; r4 < t7.length; r4++)
s4 += t7[r4].length;
switch (e11) {
case "string":
return t7.join("");
case "array":
return Array.prototype.concat.apply([], t7);
case "uint8array":
for (i4 = new Uint8Array(s4), r4 = 0; r4 < t7.length; r4++)
i4.set(t7[r4], n4), n4 += t7[r4].length;
return i4;
case "nodebuffer":
return Buffer.concat(t7);
default:
throw new Error("concat : unsupported type '" + e11 + "'");
}
}(i3, n3), a3);
t6(e9);
} catch (e11) {
r3(e11);
}
n3 = [];
}).resume();
});
}
function f2(e8, t6, r3) {
var n3 = t6;
switch (t6) {
case "blob":
case "arraybuffer":
n3 = "uint8array";
break;
case "base64":
n3 = "string";
}
try {
this._internalType = n3, this._outputType = t6, this._mimeType = r3, h2.checkSupport(n3), this._worker = e8.pipe(new i2(n3)), e8.lock();
} catch (e9) {
this._worker = new s2("error"), this._worker.error(e9);
}
}
f2.prototype = { accumulate: function(e8) {
return l2(this, e8);
}, on: function(e8, t6) {
var r3 = this;
return "data" === e8 ? this._worker.on(e8, function(e9) {
t6.call(r3, e9.data, e9.meta);
}) : this._worker.on(e8, function() {
h2.delay(t6, arguments, r3);
}), this;
}, resume: function() {
return h2.delay(this._worker.resume, [], this._worker), this;
}, pause: function() {
return this._worker.pause(), this;
}, toNodejsStream: function(e8) {
if (h2.checkSupport("nodestream"), "nodebuffer" !== this._outputType)
throw new Error(this._outputType + " is not supported by this method");
return new o2(this, { objectMode: "nodebuffer" !== this._outputType }, e8);
} }, t5.exports = f2;
}, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(e7, t5, r2) {
if (r2.base64 = true, r2.array = true, r2.string = true, r2.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, r2.nodebuffer = "undefined" != typeof Buffer, r2.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer)
r2.blob = false;
else {
var n2 = new ArrayBuffer(0);
try {
r2.blob = 0 === new Blob([n2], { type: "application/zip" }).size;
} catch (e8) {
try {
var i2 = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
i2.append(n2), r2.blob = 0 === i2.getBlob("application/zip").size;
} catch (e9) {
r2.blob = false;
}
}
}
try {
r2.nodestream = !!e7("readable-stream").Readable;
} catch (e8) {
r2.nodestream = false;
}
}, { "readable-stream": 16 }], 31: [function(e7, t5, s2) {
for (var o2 = e7("./utils"), h2 = e7("./support"), r2 = e7("./nodejsUtils"), n2 = e7("./stream/GenericWorker"), u2 = new Array(256), i2 = 0; i2 < 256; i2++)
u2[i2] = 252 <= i2 ? 6 : 248 <= i2 ? 5 : 240 <= i2 ? 4 : 224 <= i2 ? 3 : 192 <= i2 ? 2 : 1;
u2[254] = u2[254] = 1;
function a2() {
n2.call(this, "utf-8 decode"), this.leftOver = null;
}
function l2() {
n2.call(this, "utf-8 encode");
}
s2.utf8encode = function(e8) {
return h2.nodebuffer ? r2.newBufferFrom(e8, "utf-8") : function(e9) {
var t6, r3, n3, i3, s3, a3 = e9.length, o3 = 0;
for (i3 = 0; i3 < a3; i3++)
55296 == (64512 & (r3 = e9.charCodeAt(i3))) && i3 + 1 < a3 && 56320 == (64512 & (n3 = e9.charCodeAt(i3 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n3 - 56320), i3++), o3 += r3 < 128 ? 1 : r3 < 2048 ? 2 : r3 < 65536 ? 3 : 4;
for (t6 = h2.uint8array ? new Uint8Array(o3) : new Array(o3), i3 = s3 = 0; s3 < o3; i3++)
55296 == (64512 & (r3 = e9.charCodeAt(i3))) && i3 + 1 < a3 && 56320 == (64512 & (n3 = e9.charCodeAt(i3 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n3 - 56320), i3++), r3 < 128 ? t6[s3++] = r3 : (r3 < 2048 ? t6[s3++] = 192 | r3 >>> 6 : (r3 < 65536 ? t6[s3++] = 224 | r3 >>> 12 : (t6[s3++] = 240 | r3 >>> 18, t6[s3++] = 128 | r3 >>> 12 & 63), t6[s3++] = 128 | r3 >>> 6 & 63), t6[s3++] = 128 | 63 & r3);
return t6;
}(e8);
}, s2.utf8decode = function(e8) {
return h2.nodebuffer ? o2.transformTo("nodebuffer", e8).toString("utf-8") : function(e9) {
var t6, r3, n3, i3, s3 = e9.length, a3 = new Array(2 * s3);
for (t6 = r3 = 0; t6 < s3; )
if ((n3 = e9[t6++]) < 128)
a3[r3++] = n3;
else if (4 < (i3 = u2[n3]))
a3[r3++] = 65533, t6 += i3 - 1;
else {
for (n3 &= 2 === i3 ? 31 : 3 === i3 ? 15 : 7; 1 < i3 && t6 < s3; )
n3 = n3 << 6 | 63 & e9[t6++], i3--;
1 < i3 ? a3[r3++] = 65533 : n3 < 65536 ? a3[r3++] = n3 : (n3 -= 65536, a3[r3++] = 55296 | n3 >> 10 & 1023, a3[r3++] = 56320 | 1023 & n3);
}
return a3.length !== r3 && (a3.subarray ? a3 = a3.subarray(0, r3) : a3.length = r3), o2.applyFromCharCode(a3);
}(e8 = o2.transformTo(h2.uint8array ? "uint8array" : "array", e8));
}, o2.inherits(a2, n2), a2.prototype.processChunk = function(e8) {
var t6 = o2.transformTo(h2.uint8array ? "uint8array" : "array", e8.data);
if (this.leftOver && this.leftOver.length) {
if (h2.uint8array) {
var r3 = t6;
(t6 = new Uint8Array(r3.length + this.leftOver.length)).set(this.leftOver, 0), t6.set(r3, this.leftOver.length);
} else
t6 = this.leftOver.concat(t6);
this.leftOver = null;
}
var n3 = function(e9, t7) {
var r4;
for ((t7 = t7 || e9.length) > e9.length && (t7 = e9.length), r4 = t7 - 1; 0 <= r4 && 128 == (192 & e9[r4]); )
r4--;
return r4 < 0 ? t7 : 0 === r4 ? t7 : r4 + u2[e9[r4]] > t7 ? r4 : t7;
}(t6), i3 = t6;
n3 !== t6.length && (h2.uint8array ? (i3 = t6.subarray(0, n3), this.leftOver = t6.subarray(n3, t6.length)) : (i3 = t6.slice(0, n3), this.leftOver = t6.slice(n3, t6.length))), this.push({ data: s2.utf8decode(i3), meta: e8.meta });
}, a2.prototype.flush = function() {
this.leftOver && this.leftOver.length && (this.push({ data: s2.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
}, s2.Utf8DecodeWorker = a2, o2.inherits(l2, n2), l2.prototype.processChunk = function(e8) {
this.push({ data: s2.utf8encode(e8.data), meta: e8.meta });
}, s2.Utf8EncodeWorker = l2;
}, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(e7, t5, a2) {
var o2 = e7("./support"), h2 = e7("./base64"), r2 = e7("./nodejsUtils"), u2 = e7("./external");
function n2(e8) {
return e8;
}
function l2(e8, t6) {
for (var r3 = 0; r3 < e8.length; ++r3)
t6[r3] = 255 & e8.charCodeAt(r3);
return t6;
}
e7("setimmediate"), a2.newBlob = function(t6, r3) {
a2.checkSupport("blob");
try {
return new Blob([t6], { type: r3 });
} catch (e8) {
try {
var n3 = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
return n3.append(t6), n3.getBlob(r3);
} catch (e9) {
throw new Error("Bug : can't construct the Blob.");
}
}
};
var i2 = { stringifyByChunk: function(e8, t6, r3) {
var n3 = [], i3 = 0, s3 = e8.length;
if (s3 <= r3)
return String.fromCharCode.apply(null, e8);
for (; i3 < s3; )
"array" === t6 || "nodebuffer" === t6 ? n3.push(String.fromCharCode.apply(null, e8.slice(i3, Math.min(i3 + r3, s3)))) : n3.push(String.fromCharCode.apply(null, e8.subarray(i3, Math.min(i3 + r3, s3)))), i3 += r3;
return n3.join("");
}, stringifyByChar: function(e8) {
for (var t6 = "", r3 = 0; r3 < e8.length; r3++)
t6 += String.fromCharCode(e8[r3]);
return t6;
}, applyCanBeUsed: { uint8array: function() {
try {
return o2.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length;
} catch (e8) {
return false;
}
}(), nodebuffer: function() {
try {
return o2.nodebuffer && 1 === String.fromCharCode.apply(null, r2.allocBuffer(1)).length;
} catch (e8) {
return false;
}
}() } };
function s2(e8) {
var t6 = 65536, r3 = a2.getTypeOf(e8), n3 = true;
if ("uint8array" === r3 ? n3 = i2.applyCanBeUsed.uint8array : "nodebuffer" === r3 && (n3 = i2.applyCanBeUsed.nodebuffer), n3)
for (; 1 < t6; )
try {
return i2.stringifyByChunk(e8, r3, t6);
} catch (e9) {
t6 = Math.floor(t6 / 2);
}
return i2.stringifyByChar(e8);
}
function f2(e8, t6) {
for (var r3 = 0; r3 < e8.length; r3++)
t6[r3] = e8[r3];
return t6;
}
a2.applyFromCharCode = s2;
var c2 = {};
c2.string = { string: n2, array: function(e8) {
return l2(e8, new Array(e8.length));
}, arraybuffer: function(e8) {
return c2.string.uint8array(e8).buffer;
}, uint8array: function(e8) {
return l2(e8, new Uint8Array(e8.length));
}, nodebuffer: function(e8) {
return l2(e8, r2.allocBuffer(e8.length));
} }, c2.array = { string: s2, array: n2, arraybuffer: function(e8) {
return new Uint8Array(e8).buffer;
}, uint8array: function(e8) {
return new Uint8Array(e8);
}, nodebuffer: function(e8) {
return r2.newBufferFrom(e8);
} }, c2.arraybuffer = { string: function(e8) {
return s2(new Uint8Array(e8));
}, array: function(e8) {
return f2(new Uint8Array(e8), new Array(e8.byteLength));
}, arraybuffer: n2, uint8array: function(e8) {
return new Uint8Array(e8);
}, nodebuffer: function(e8) {
return r2.newBufferFrom(new Uint8Array(e8));
} }, c2.uint8array = { string: s2, array: function(e8) {
return f2(e8, new Array(e8.length));
}, arraybuffer: function(e8) {
return e8.buffer;
}, uint8array: n2, nodebuffer: function(e8) {
return r2.newBufferFrom(e8);
} }, c2.nodebuffer = { string: s2, array: function(e8) {
return f2(e8, new Array(e8.length));
}, arraybuffer: function(e8) {
return c2.nodebuffer.uint8array(e8).buffer;
}, uint8array: function(e8) {
return f2(e8, new Uint8Array(e8.length));
}, nodebuffer: n2 }, a2.transformTo = function(e8, t6) {
if (t6 = t6 || "", !e8)
return t6;
a2.checkSupport(e8);
var r3 = a2.getTypeOf(t6);
return c2[r3][e8](t6);
}, a2.resolve = function(e8) {
for (var t6 = e8.split("/"), r3 = [], n3 = 0; n3 < t6.length; n3++) {
var i3 = t6[n3];
"." === i3 || "" === i3 && 0 !== n3 && n3 !== t6.length - 1 || (".." === i3 ? r3.pop() : r3.push(i3));
}
return r3.join("/");
}, a2.getTypeOf = function(e8) {
return "string" == typeof e8 ? "string" : "[object Array]" === Object.prototype.toString.call(e8) ? "array" : o2.nodebuffer && r2.isBuffer(e8) ? "nodebuffer" : o2.uint8array && e8 instanceof Uint8Array ? "uint8array" : o2.arraybuffer && e8 instanceof ArrayBuffer ? "arraybuffer" : void 0;
}, a2.checkSupport = function(e8) {
if (!o2[e8.toLowerCase()])
throw new Error(e8 + " is not supported by this platform");
}, a2.MAX_VALUE_16BITS = 65535, a2.MAX_VALUE_32BITS = -1, a2.pretty = function(e8) {
var t6, r3, n3 = "";
for (r3 = 0; r3 < (e8 || "").length; r3++)
n3 += "\\x" + ((t6 = e8.charCodeAt(r3)) < 16 ? "0" : "") + t6.toString(16).toUpperCase();
return n3;
}, a2.delay = function(e8, t6, r3) {
setImmediate(function() {
e8.apply(r3 || null, t6 || []);
});
}, a2.inherits = function(e8, t6) {
function r3() {
}
r3.prototype = t6.prototype, e8.prototype = new r3();
}, a2.extend = function() {
var e8, t6, r3 = {};
for (e8 = 0; e8 < arguments.length; e8++)
for (t6 in arguments[e8])
Object.prototype.hasOwnProperty.call(arguments[e8], t6) && void 0 === r3[t6] && (r3[t6] = arguments[e8][t6]);
return r3;
}, a2.prepareContent = function(r3, e8, n3, i3, s3) {
return u2.Promise.resolve(e8).then(function(n4) {
return o2.blob && (n4 instanceof Blob || -1 !== ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(n4))) && "undefined" != typeof FileReader ? new u2.Promise(function(t6, r4) {
var e9 = new FileReader();
e9.onload = function(e11) {
t6(e11.target.result);
}, e9.onerror = function(e11) {
r4(e11.target.error);
}, e9.readAsArrayBuffer(n4);
}) : n4;
}).then(function(e9) {
var t6 = a2.getTypeOf(e9);
return t6 ? ("arraybuffer" === t6 ? e9 = a2.transformTo("uint8array", e9) : "string" === t6 && (s3 ? e9 = h2.decode(e9) : n3 && true !== i3 && (e9 = function(e11) {
return l2(e11, o2.uint8array ? new Uint8Array(e11.length) : new Array(e11.length));
}(e9))), e9) : u2.Promise.reject(new Error("Can't read the data of '" + r3 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
});
};
}, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(e7, t5, r2) {
var n2 = e7("./reader/readerFor"), i2 = e7("./utils"), s2 = e7("./signature"), a2 = e7("./zipEntry"), o2 = e7("./support");
function h2(e8) {
this.files = [], this.loadOptions = e8;
}
h2.prototype = { checkSignature: function(e8) {
if (!this.reader.readAndCheckSignature(e8)) {
this.reader.index -= 4;
var t6 = this.reader.readString(4);
throw new Error("Corrupted zip or bug: unexpected signature (" + i2.pretty(t6) + ", expected " + i2.pretty(e8) + ")");
}
}, isSignature: function(e8, t6) {
var r3 = this.reader.index;
this.reader.setIndex(e8);
var n3 = this.reader.readString(4) === t6;
return this.reader.setIndex(r3), n3;
}, readBlockEndOfCentral: function() {
this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2);
var e8 = this.reader.readData(this.zipCommentLength), t6 = o2.uint8array ? "uint8array" : "array", r3 = i2.transformTo(t6, e8);
this.zipComment = this.loadOptions.decodeFileName(r3);
}, readBlockZip64EndOfCentral: function() {
this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {};
for (var e8, t6, r3, n3 = this.zip64EndOfCentralSize - 44; 0 < n3; )
e8 = this.reader.readInt(2), t6 = this.reader.readInt(4), r3 = this.reader.readData(t6), this.zip64ExtensibleData[e8] = { id: e8, length: t6, value: r3 };
}, readBlockZip64EndOfCentralLocator: function() {
if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount)
throw new Error("Multi-volumes zip are not supported");
}, readLocalFiles: function() {
var e8, t6;
for (e8 = 0; e8 < this.files.length; e8++)
t6 = this.files[e8], this.reader.setIndex(t6.localHeaderOffset), this.checkSignature(s2.LOCAL_FILE_HEADER), t6.readLocalPart(this.reader), t6.handleUTF8(), t6.processAttributes();
}, readCentralDir: function() {
var e8;
for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(s2.CENTRAL_FILE_HEADER); )
(e8 = new a2({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(e8);
if (this.centralDirRecords !== this.files.length && 0 !== this.centralDirRecords && 0 === this.files.length)
throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
}, readEndOfCentral: function() {
var e8 = this.reader.lastIndexOfSignature(s2.CENTRAL_DIRECTORY_END);
if (e8 < 0)
throw !this.isSignature(0, s2.LOCAL_FILE_HEADER) ? new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html") : new Error("Corrupted zip: can't find end of central directory");
this.reader.setIndex(e8);
var t6 = e8;
if (this.checkSignature(s2.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i2.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i2.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i2.MAX_VALUE_16BITS || this.centralDirRecords === i2.MAX_VALUE_16BITS || this.centralDirSize === i2.MAX_VALUE_32BITS || this.centralDirOffset === i2.MAX_VALUE_32BITS) {
if (this.zip64 = true, (e8 = this.reader.lastIndexOfSignature(s2.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0)
throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
if (this.reader.setIndex(e8), this.checkSignature(s2.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, s2.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(s2.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0))
throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(s2.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
}
var r3 = this.centralDirOffset + this.centralDirSize;
this.zip64 && (r3 += 20, r3 += 12 + this.zip64EndOfCentralSize);
var n3 = t6 - r3;
if (0 < n3)
this.isSignature(t6, s2.CENTRAL_FILE_HEADER) || (this.reader.zero = n3);
else if (n3 < 0)
throw new Error("Corrupted zip: missing " + Math.abs(n3) + " bytes.");
}, prepareReader: function(e8) {
this.reader = n2(e8);
}, load: function(e8) {
this.prepareReader(e8), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
} }, t5.exports = h2;
}, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(e7, t5, r2) {
var n2 = e7("./reader/readerFor"), s2 = e7("./utils"), i2 = e7("./compressedObject"), a2 = e7("./crc32"), o2 = e7("./utf8"), h2 = e7("./compressions"), u2 = e7("./support");
function l2(e8, t6) {
this.options = e8, this.loadOptions = t6;
}
l2.prototype = { isEncrypted: function() {
return 1 == (1 & this.bitFlag);
}, useUTF8: function() {
return 2048 == (2048 & this.bitFlag);
}, readLocalPart: function(e8) {
var t6, r3;
if (e8.skip(22), this.fileNameLength = e8.readInt(2), r3 = e8.readInt(2), this.fileName = e8.readData(this.fileNameLength), e8.skip(r3), -1 === this.compressedSize || -1 === this.uncompressedSize)
throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
if (null === (t6 = function(e9) {
for (var t7 in h2)
if (Object.prototype.hasOwnProperty.call(h2, t7) && h2[t7].magic === e9)
return h2[t7];
return null;
}(this.compressionMethod)))
throw new Error("Corrupted zip : compression " + s2.pretty(this.compressionMethod) + " unknown (inner file : " + s2.transformTo("string", this.fileName) + ")");
this.decompressed = new i2(this.compressedSize, this.uncompressedSize, this.crc32, t6, e8.readData(this.compressedSize));
}, readCentralPart: function(e8) {
this.versionMadeBy = e8.readInt(2), e8.skip(2), this.bitFlag = e8.readInt(2), this.compressionMethod = e8.readString(2), this.date = e8.readDate(), this.crc32 = e8.readInt(4), this.compressedSize = e8.readInt(4), this.uncompressedSize = e8.readInt(4);
var t6 = e8.readInt(2);
if (this.extraFieldsLength = e8.readInt(2), this.fileCommentLength = e8.readInt(2), this.diskNumberStart = e8.readInt(2), this.internalFileAttributes = e8.readInt(2), this.externalFileAttributes = e8.readInt(4), this.localHeaderOffset = e8.readInt(4), this.isEncrypted())
throw new Error("Encrypted zip are not supported");
e8.skip(t6), this.readExtraFields(e8), this.parseZIP64ExtraField(e8), this.fileComment = e8.readData(this.fileCommentLength);
}, processAttributes: function() {
this.unixPermissions = null, this.dosPermissions = null;
var e8 = this.versionMadeBy >> 8;
this.dir = !!(16 & this.externalFileAttributes), 0 == e8 && (this.dosPermissions = 63 & this.externalFileAttributes), 3 == e8 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || "/" !== this.fileNameStr.slice(-1) || (this.dir = true);
}, parseZIP64ExtraField: function() {
if (this.extraFields[1]) {
var e8 = n2(this.extraFields[1].value);
this.uncompressedSize === s2.MAX_VALUE_32BITS && (this.uncompressedSize = e8.readInt(8)), this.compressedSize === s2.MAX_VALUE_32BITS && (this.compressedSize = e8.readInt(8)), this.localHeaderOffset === s2.MAX_VALUE_32BITS && (this.localHeaderOffset = e8.readInt(8)), this.diskNumberStart === s2.MAX_VALUE_32BITS && (this.diskNumberStart = e8.readInt(4));
}
}, readExtraFields: function(e8) {
var t6, r3, n3, i3 = e8.index + this.extraFieldsLength;
for (this.extraFields || (this.extraFields = {}); e8.index + 4 < i3; )
t6 = e8.readInt(2), r3 = e8.readInt(2), n3 = e8.readData(r3), this.extraFields[t6] = { id: t6, length: r3, value: n3 };
e8.setIndex(i3);
}, handleUTF8: function() {
var e8 = u2.uint8array ? "uint8array" : "array";
if (this.useUTF8())
this.fileNameStr = o2.utf8decode(this.fileName), this.fileCommentStr = o2.utf8decode(this.fileComment);
else {
var t6 = this.findExtraFieldUnicodePath();
if (null !== t6)
this.fileNameStr = t6;
else {
var r3 = s2.transformTo(e8, this.fileName);
this.fileNameStr = this.loadOptions.decodeFileName(r3);
}
var n3 = this.findExtraFieldUnicodeComment();
if (null !== n3)
this.fileCommentStr = n3;
else {
var i3 = s2.transformTo(e8, this.fileComment);
this.fileCommentStr = this.loadOptions.decodeFileName(i3);
}
}
}, findExtraFieldUnicodePath: function() {
var e8 = this.extraFields[28789];
if (e8) {
var t6 = n2(e8.value);
return 1 !== t6.readInt(1) ? null : a2(this.fileName) !== t6.readInt(4) ? null : o2.utf8decode(t6.readData(e8.length - 5));
}
return null;
}, findExtraFieldUnicodeComment: function() {
var e8 = this.extraFields[25461];
if (e8) {
var t6 = n2(e8.value);
return 1 !== t6.readInt(1) ? null : a2(this.fileComment) !== t6.readInt(4) ? null : o2.utf8decode(t6.readData(e8.length - 5));
}
return null;
} }, t5.exports = l2;
}, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(e7, t5, r2) {
function n2(e8, t6, r3) {
this.name = e8, this.dir = r3.dir, this.date = r3.date, this.comment = r3.comment, this.unixPermissions = r3.unixPermissions, this.dosPermissions = r3.dosPermissions, this._data = t6, this._dataBinary = r3.binary, this.options = { compression: r3.compression, compressionOptions: r3.compressionOptions };
}
var s2 = e7("./stream/StreamHelper"), i2 = e7("./stream/DataWorker"), a2 = e7("./utf8"), o2 = e7("./compressedObject"), h2 = e7("./stream/GenericWorker");
n2.prototype = { internalStream: function(e8) {
var t6 = null, r3 = "string";
try {
if (!e8)
throw new Error("No output type specified.");
var n3 = "string" === (r3 = e8.toLowerCase()) || "text" === r3;
"binarystring" !== r3 && "text" !== r3 || (r3 = "string"), t6 = this._decompressWorker();
var i3 = !this._dataBinary;
i3 && !n3 && (t6 = t6.pipe(new a2.Utf8EncodeWorker())), !i3 && n3 && (t6 = t6.pipe(new a2.Utf8DecodeWorker()));
} catch (e9) {
(t6 = new h2("error")).error(e9);
}
return new s2(t6, r3, "");
}, async: function(e8, t6) {
return this.internalStream(e8).accumulate(t6);
}, nodeStream: function(e8, t6) {
return this.internalStream(e8 || "nodebuffer").toNodejsStream(t6);
}, _compressWorker: function(e8, t6) {
if (this._data instanceof o2 && this._data.compression.magic === e8.magic)
return this._data.getCompressedWorker();
var r3 = this._decompressWorker();
return this._dataBinary || (r3 = r3.pipe(new a2.Utf8EncodeWorker())), o2.createWorkerFrom(r3, e8, t6);
}, _decompressWorker: function() {
return this._data instanceof o2 ? this._data.getContentWorker() : this._data instanceof h2 ? this._data : new i2(this._data);
} };
for (var u2 = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], l2 = function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, f2 = 0; f2 < u2.length; f2++)
n2.prototype[u2[f2]] = l2;
t5.exports = n2;
}, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(e7, l2, t5) {
(function(t6) {
var r2, n2, e8 = t6.MutationObserver || t6.WebKitMutationObserver;
if (e8) {
var i2 = 0, s2 = new e8(u2), a2 = t6.document.createTextNode("");
s2.observe(a2, { characterData: true }), r2 = function() {
a2.data = i2 = ++i2 % 2;
};
} else if (t6.setImmediate || void 0 === t6.MessageChannel)
r2 = "document" in t6 && "onreadystatechange" in t6.document.createElement("script") ? function() {
var e9 = t6.document.createElement("script");
e9.onreadystatechange = function() {
u2(), e9.onreadystatechange = null, e9.parentNode.removeChild(e9), e9 = null;
}, t6.document.documentElement.appendChild(e9);
} : function() {
setTimeout(u2, 0);
};
else {
var o2 = new t6.MessageChannel();
o2.port1.onmessage = u2, r2 = function() {
o2.port2.postMessage(0);
};
}
var h2 = [];
function u2() {
var e9, t7;
n2 = true;
for (var r3 = h2.length; r3; ) {
for (t7 = h2, h2 = [], e9 = -1; ++e9 < r3; )
t7[e9]();
r3 = h2.length;
}
n2 = false;
}
l2.exports = function(e9) {
1 !== h2.push(e9) || n2 || r2();
};
}).call(this, "undefined" != typeof commonjsGlobal$1 ? commonjsGlobal$1 : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
}, {}], 37: [function(e7, t5, r2) {
var i2 = e7("immediate");
function u2() {
}
var l2 = {}, s2 = ["REJECTED"], a2 = ["FULFILLED"], n2 = ["PENDING"];
function o2(e8) {
if ("function" != typeof e8)
throw new TypeError("resolver must be a function");
this.state = n2, this.queue = [], this.outcome = void 0, e8 !== u2 && d2(this, e8);
}
function h2(e8, t6, r3) {
this.promise = e8, "function" == typeof t6 && (this.onFulfilled = t6, this.callFulfilled = this.otherCallFulfilled), "function" == typeof r3 && (this.onRejected = r3, this.callRejected = this.otherCallRejected);
}
function f2(t6, r3, n3) {
i2(function() {
var e8;
try {
e8 = r3(n3);
} catch (e9) {
return l2.reject(t6, e9);
}
e8 === t6 ? l2.reject(t6, new TypeError("Cannot resolve promise with itself")) : l2.resolve(t6, e8);
});
}
function c2(e8) {
var t6 = e8 && e8.then;
if (e8 && ("object" == typeof e8 || "function" == typeof e8) && "function" == typeof t6)
return function() {
t6.apply(e8, arguments);
};
}
function d2(t6, e8) {
var r3 = false;
function n3(e9) {
r3 || (r3 = true, l2.reject(t6, e9));
}
function i3(e9) {
r3 || (r3 = true, l2.resolve(t6, e9));
}
var s3 = p2(function() {
e8(i3, n3);
});
"error" === s3.status && n3(s3.value);
}
function p2(e8, t6) {
var r3 = {};
try {
r3.value = e8(t6), r3.status = "success";
} catch (e9) {
r3.status = "error", r3.value = e9;
}
return r3;
}
(t5.exports = o2).prototype.finally = function(t6) {
if ("function" != typeof t6)
return this;
var r3 = this.constructor;
return this.then(function(e8) {
return r3.resolve(t6()).then(function() {
return e8;
});
}, function(e8) {
return r3.resolve(t6()).then(function() {
throw e8;
});
});
}, o2.prototype.catch = function(e8) {
return this.then(null, e8);
}, o2.prototype.then = function(e8, t6) {
if ("function" != typeof e8 && this.state === a2 || "function" != typeof t6 && this.state === s2)
return this;
var r3 = new this.constructor(u2);
this.state !== n2 ? f2(r3, this.state === a2 ? e8 : t6, this.outcome) : this.queue.push(new h2(r3, e8, t6));
return r3;
}, h2.prototype.callFulfilled = function(e8) {
l2.resolve(this.promise, e8);
}, h2.prototype.otherCallFulfilled = function(e8) {
f2(this.promise, this.onFulfilled, e8);
}, h2.prototype.callRejected = function(e8) {
l2.reject(this.promise, e8);
}, h2.prototype.otherCallRejected = function(e8) {
f2(this.promise, this.onRejected, e8);
}, l2.resolve = function(e8, t6) {
var r3 = p2(c2, t6);
if ("error" === r3.status)
return l2.reject(e8, r3.value);
var n3 = r3.value;
if (n3)
d2(e8, n3);
else {
e8.state = a2, e8.outcome = t6;
for (var i3 = -1, s3 = e8.queue.length; ++i3 < s3; )
e8.queue[i3].callFulfilled(t6);
}
return e8;
}, l2.reject = function(e8, t6) {
e8.state = s2, e8.outcome = t6;
for (var r3 = -1, n3 = e8.queue.length; ++r3 < n3; )
e8.queue[r3].callRejected(t6);
return e8;
}, o2.resolve = function(e8) {
if (e8 instanceof this)
return e8;
return l2.resolve(new this(u2), e8);
}, o2.reject = function(e8) {
var t6 = new this(u2);
return l2.reject(t6, e8);
}, o2.all = function(e8) {
var r3 = this;
if ("[object Array]" !== Object.prototype.toString.call(e8))
return this.reject(new TypeError("must be an array"));
var n3 = e8.length, i3 = false;
if (!n3)
return this.resolve([]);
var s3 = new Array(n3), a3 = 0, t6 = -1, o3 = new this(u2);
for (; ++t6 < n3; )
h3(e8[t6], t6);
return o3;
function h3(e9, t7) {
r3.resolve(e9).then(function(e11) {
s3[t7] = e11, ++a3 !== n3 || i3 || (i3 = true, l2.resolve(o3, s3));
}, function(e11) {
i3 || (i3 = true, l2.reject(o3, e11));
});
}
}, o2.race = function(e8) {
var t6 = this;
if ("[object Array]" !== Object.prototype.toString.call(e8))
return this.reject(new TypeError("must be an array"));
var r3 = e8.length, n3 = false;
if (!r3)
return this.resolve([]);
var i3 = -1, s3 = new this(u2);
for (; ++i3 < r3; )
a3 = e8[i3], t6.resolve(a3).then(function(e9) {
n3 || (n3 = true, l2.resolve(s3, e9));
}, function(e9) {
n3 || (n3 = true, l2.reject(s3, e9));
});
var a3;
return s3;
};
}, { immediate: 36 }], 38: [function(e7, t5, r2) {
var n2 = {};
(0, e7("./lib/utils/common").assign)(n2, e7("./lib/deflate"), e7("./lib/inflate"), e7("./lib/zlib/constants")), t5.exports = n2;
}, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(e7, t5, r2) {
var a2 = e7("./zlib/deflate"), o2 = e7("./utils/common"), h2 = e7("./utils/strings"), i2 = e7("./zlib/messages"), s2 = e7("./zlib/zstream"), u2 = Object.prototype.toString, l2 = 0, f2 = -1, c2 = 0, d2 = 8;
function p2(e8) {
if (!(this instanceof p2))
return new p2(e8);
this.options = o2.assign({ level: f2, method: d2, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: c2, to: "" }, e8 || {});
var t6 = this.options;
t6.raw && 0 < t6.windowBits ? t6.windowBits = -t6.windowBits : t6.gzip && 0 < t6.windowBits && t6.windowBits < 16 && (t6.windowBits += 16), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new s2(), this.strm.avail_out = 0;
var r3 = a2.deflateInit2(this.strm, t6.level, t6.method, t6.windowBits, t6.memLevel, t6.strategy);
if (r3 !== l2)
throw new Error(i2[r3]);
if (t6.header && a2.deflateSetHeader(this.strm, t6.header), t6.dictionary) {
var n3;
if (n3 = "string" == typeof t6.dictionary ? h2.string2buf(t6.dictionary) : "[object ArrayBuffer]" === u2.call(t6.dictionary) ? new Uint8Array(t6.dictionary) : t6.dictionary, (r3 = a2.deflateSetDictionary(this.strm, n3)) !== l2)
throw new Error(i2[r3]);
this._dict_set = true;
}
}
function n2(e8, t6) {
var r3 = new p2(t6);
if (r3.push(e8, true), r3.err)
throw r3.msg || i2[r3.err];
return r3.result;
}
p2.prototype.push = function(e8, t6) {
var r3, n3, i3 = this.strm, s3 = this.options.chunkSize;
if (this.ended)
return false;
n3 = t6 === ~~t6 ? t6 : true === t6 ? 4 : 0, "string" == typeof e8 ? i3.input = h2.string2buf(e8) : "[object ArrayBuffer]" === u2.call(e8) ? i3.input = new Uint8Array(e8) : i3.input = e8, i3.next_in = 0, i3.avail_in = i3.input.length;
do {
if (0 === i3.avail_out && (i3.output = new o2.Buf8(s3), i3.next_out = 0, i3.avail_out = s3), 1 !== (r3 = a2.deflate(i3, n3)) && r3 !== l2)
return this.onEnd(r3), !(this.ended = true);
0 !== i3.avail_out && (0 !== i3.avail_in || 4 !== n3 && 2 !== n3) || ("string" === this.options.to ? this.onData(h2.buf2binstring(o2.shrinkBuf(i3.output, i3.next_out))) : this.onData(o2.shrinkBuf(i3.output, i3.next_out)));
} while ((0 < i3.avail_in || 0 === i3.avail_out) && 1 !== r3);
return 4 === n3 ? (r3 = a2.deflateEnd(this.strm), this.onEnd(r3), this.ended = true, r3 === l2) : 2 !== n3 || (this.onEnd(l2), !(i3.avail_out = 0));
}, p2.prototype.onData = function(e8) {
this.chunks.push(e8);
}, p2.prototype.onEnd = function(e8) {
e8 === l2 && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = o2.flattenChunks(this.chunks)), this.chunks = [], this.err = e8, this.msg = this.strm.msg;
}, r2.Deflate = p2, r2.deflate = n2, r2.deflateRaw = function(e8, t6) {
return (t6 = t6 || {}).raw = true, n2(e8, t6);
}, r2.gzip = function(e8, t6) {
return (t6 = t6 || {}).gzip = true, n2(e8, t6);
};
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(e7, t5, r2) {
var c2 = e7("./zlib/inflate"), d2 = e7("./utils/common"), p2 = e7("./utils/strings"), m2 = e7("./zlib/constants"), n2 = e7("./zlib/messages"), i2 = e7("./zlib/zstream"), s2 = e7("./zlib/gzheader"), _24 = Object.prototype.toString;
function a2(e8) {
if (!(this instanceof a2))
return new a2(e8);
this.options = d2.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e8 || {});
var t6 = this.options;
t6.raw && 0 <= t6.windowBits && t6.windowBits < 16 && (t6.windowBits = -t6.windowBits, 0 === t6.windowBits && (t6.windowBits = -15)), !(0 <= t6.windowBits && t6.windowBits < 16) || e8 && e8.windowBits || (t6.windowBits += 32), 15 < t6.windowBits && t6.windowBits < 48 && 0 == (15 & t6.windowBits) && (t6.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new i2(), this.strm.avail_out = 0;
var r3 = c2.inflateInit2(this.strm, t6.windowBits);
if (r3 !== m2.Z_OK)
throw new Error(n2[r3]);
this.header = new s2(), c2.inflateGetHeader(this.strm, this.header);
}
function o2(e8, t6) {
var r3 = new a2(t6);
if (r3.push(e8, true), r3.err)
throw r3.msg || n2[r3.err];
return r3.result;
}
a2.prototype.push = function(e8, t6) {
var r3, n3, i3, s3, a3, o3, h2 = this.strm, u2 = this.options.chunkSize, l2 = this.options.dictionary, f2 = false;
if (this.ended)
return false;
n3 = t6 === ~~t6 ? t6 : true === t6 ? m2.Z_FINISH : m2.Z_NO_FLUSH, "string" == typeof e8 ? h2.input = p2.binstring2buf(e8) : "[object ArrayBuffer]" === _24.call(e8) ? h2.input = new Uint8Array(e8) : h2.input = e8, h2.next_in = 0, h2.avail_in = h2.input.length;
do {
if (0 === h2.avail_out && (h2.output = new d2.Buf8(u2), h2.next_out = 0, h2.avail_out = u2), (r3 = c2.inflate(h2, m2.Z_NO_FLUSH)) === m2.Z_NEED_DICT && l2 && (o3 = "string" == typeof l2 ? p2.string2buf(l2) : "[object ArrayBuffer]" === _24.call(l2) ? new Uint8Array(l2) : l2, r3 = c2.inflateSetDictionary(this.strm, o3)), r3 === m2.Z_BUF_ERROR && true === f2 && (r3 = m2.Z_OK, f2 = false), r3 !== m2.Z_STREAM_END && r3 !== m2.Z_OK)
return this.onEnd(r3), !(this.ended = true);
h2.next_out && (0 !== h2.avail_out && r3 !== m2.Z_STREAM_END && (0 !== h2.avail_in || n3 !== m2.Z_FINISH && n3 !== m2.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i3 = p2.utf8border(h2.output, h2.next_out), s3 = h2.next_out - i3, a3 = p2.buf2string(h2.output, i3), h2.next_out = s3, h2.avail_out = u2 - s3, s3 && d2.arraySet(h2.output, h2.output, i3, s3, 0), this.onData(a3)) : this.onData(d2.shrinkBuf(h2.output, h2.next_out)))), 0 === h2.avail_in && 0 === h2.avail_out && (f2 = true);
} while ((0 < h2.avail_in || 0 === h2.avail_out) && r3 !== m2.Z_STREAM_END);
return r3 === m2.Z_STREAM_END && (n3 = m2.Z_FINISH), n3 === m2.Z_FINISH ? (r3 = c2.inflateEnd(this.strm), this.onEnd(r3), this.ended = true, r3 === m2.Z_OK) : n3 !== m2.Z_SYNC_FLUSH || (this.onEnd(m2.Z_OK), !(h2.avail_out = 0));
}, a2.prototype.onData = function(e8) {
this.chunks.push(e8);
}, a2.prototype.onEnd = function(e8) {
e8 === m2.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = d2.flattenChunks(this.chunks)), this.chunks = [], this.err = e8, this.msg = this.strm.msg;
}, r2.Inflate = a2, r2.inflate = o2, r2.inflateRaw = function(e8, t6) {
return (t6 = t6 || {}).raw = true, o2(e8, t6);
}, r2.ungzip = o2;
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(e7, t5, r2) {
var n2 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;
r2.assign = function(e8) {
for (var t6 = Array.prototype.slice.call(arguments, 1); t6.length; ) {
var r3 = t6.shift();
if (r3) {
if ("object" != typeof r3)
throw new TypeError(r3 + "must be non-object");
for (var n3 in r3)
r3.hasOwnProperty(n3) && (e8[n3] = r3[n3]);
}
}
return e8;
}, r2.shrinkBuf = function(e8, t6) {
return e8.length === t6 ? e8 : e8.subarray ? e8.subarray(0, t6) : (e8.length = t6, e8);
};
var i2 = { arraySet: function(e8, t6, r3, n3, i3) {
if (t6.subarray && e8.subarray)
e8.set(t6.subarray(r3, r3 + n3), i3);
else
for (var s3 = 0; s3 < n3; s3++)
e8[i3 + s3] = t6[r3 + s3];
}, flattenChunks: function(e8) {
var t6, r3, n3, i3, s3, a2;
for (t6 = n3 = 0, r3 = e8.length; t6 < r3; t6++)
n3 += e8[t6].length;
for (a2 = new Uint8Array(n3), t6 = i3 = 0, r3 = e8.length; t6 < r3; t6++)
s3 = e8[t6], a2.set(s3, i3), i3 += s3.length;
return a2;
} }, s2 = { arraySet: function(e8, t6, r3, n3, i3) {
for (var s3 = 0; s3 < n3; s3++)
e8[i3 + s3] = t6[r3 + s3];
}, flattenChunks: function(e8) {
return [].concat.apply([], e8);
} };
r2.setTyped = function(e8) {
e8 ? (r2.Buf8 = Uint8Array, r2.Buf16 = Uint16Array, r2.Buf32 = Int32Array, r2.assign(r2, i2)) : (r2.Buf8 = Array, r2.Buf16 = Array, r2.Buf32 = Array, r2.assign(r2, s2));
}, r2.setTyped(n2);
}, {}], 42: [function(e7, t5, r2) {
var h2 = e7("./common"), i2 = true, s2 = true;
try {
String.fromCharCode.apply(null, [0]);
} catch (e8) {
i2 = false;
}
try {
String.fromCharCode.apply(null, new Uint8Array(1));
} catch (e8) {
s2 = false;
}
for (var u2 = new h2.Buf8(256), n2 = 0; n2 < 256; n2++)
u2[n2] = 252 <= n2 ? 6 : 248 <= n2 ? 5 : 240 <= n2 ? 4 : 224 <= n2 ? 3 : 192 <= n2 ? 2 : 1;
function l2(e8, t6) {
if (t6 < 65537 && (e8.subarray && s2 || !e8.subarray && i2))
return String.fromCharCode.apply(null, h2.shrinkBuf(e8, t6));
for (var r3 = "", n3 = 0; n3 < t6; n3++)
r3 += String.fromCharCode(e8[n3]);
return r3;
}
u2[254] = u2[254] = 1, r2.string2buf = function(e8) {
var t6, r3, n3, i3, s3, a2 = e8.length, o2 = 0;
for (i3 = 0; i3 < a2; i3++)
55296 == (64512 & (r3 = e8.charCodeAt(i3))) && i3 + 1 < a2 && 56320 == (64512 & (n3 = e8.charCodeAt(i3 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n3 - 56320), i3++), o2 += r3 < 128 ? 1 : r3 < 2048 ? 2 : r3 < 65536 ? 3 : 4;
for (t6 = new h2.Buf8(o2), i3 = s3 = 0; s3 < o2; i3++)
55296 == (64512 & (r3 = e8.charCodeAt(i3))) && i3 + 1 < a2 && 56320 == (64512 & (n3 = e8.charCodeAt(i3 + 1))) && (r3 = 65536 + (r3 - 55296 << 10) + (n3 - 56320), i3++), r3 < 128 ? t6[s3++] = r3 : (r3 < 2048 ? t6[s3++] = 192 | r3 >>> 6 : (r3 < 65536 ? t6[s3++] = 224 | r3 >>> 12 : (t6[s3++] = 240 | r3 >>> 18, t6[s3++] = 128 | r3 >>> 12 & 63), t6[s3++] = 128 | r3 >>> 6 & 63), t6[s3++] = 128 | 63 & r3);
return t6;
}, r2.buf2binstring = function(e8) {
return l2(e8, e8.length);
}, r2.binstring2buf = function(e8) {
for (var t6 = new h2.Buf8(e8.length), r3 = 0, n3 = t6.length; r3 < n3; r3++)
t6[r3] = e8.charCodeAt(r3);
return t6;
}, r2.buf2string = function(e8, t6) {
var r3, n3, i3, s3, a2 = t6 || e8.length, o2 = new Array(2 * a2);
for (r3 = n3 = 0; r3 < a2; )
if ((i3 = e8[r3++]) < 128)
o2[n3++] = i3;
else if (4 < (s3 = u2[i3]))
o2[n3++] = 65533, r3 += s3 - 1;
else {
for (i3 &= 2 === s3 ? 31 : 3 === s3 ? 15 : 7; 1 < s3 && r3 < a2; )
i3 = i3 << 6 | 63 & e8[r3++], s3--;
1 < s3 ? o2[n3++] = 65533 : i3 < 65536 ? o2[n3++] = i3 : (i3 -= 65536, o2[n3++] = 55296 | i3 >> 10 & 1023, o2[n3++] = 56320 | 1023 & i3);
}
return l2(o2, n3);
}, r2.utf8border = function(e8, t6) {
var r3;
for ((t6 = t6 || e8.length) > e8.length && (t6 = e8.length), r3 = t6 - 1; 0 <= r3 && 128 == (192 & e8[r3]); )
r3--;
return r3 < 0 ? t6 : 0 === r3 ? t6 : r3 + u2[e8[r3]] > t6 ? r3 : t6;
};
}, { "./common": 41 }], 43: [function(e7, t5, r2) {
t5.exports = function(e8, t6, r3, n2) {
for (var i2 = 65535 & e8 | 0, s2 = e8 >>> 16 & 65535 | 0, a2 = 0; 0 !== r3; ) {
for (r3 -= a2 = 2e3 < r3 ? 2e3 : r3; s2 = s2 + (i2 = i2 + t6[n2++] | 0) | 0, --a2; )
;
i2 %= 65521, s2 %= 65521;
}
return i2 | s2 << 16 | 0;
};
}, {}], 44: [function(e7, t5, r2) {
t5.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 };
}, {}], 45: [function(e7, t5, r2) {
var o2 = function() {
for (var e8, t6 = [], r3 = 0; r3 < 256; r3++) {
e8 = r3;
for (var n2 = 0; n2 < 8; n2++)
e8 = 1 & e8 ? 3988292384 ^ e8 >>> 1 : e8 >>> 1;
t6[r3] = e8;
}
return t6;
}();
t5.exports = function(e8, t6, r3, n2) {
var i2 = o2, s2 = n2 + r3;
e8 ^= -1;
for (var a2 = n2; a2 < s2; a2++)
e8 = e8 >>> 8 ^ i2[255 & (e8 ^ t6[a2])];
return -1 ^ e8;
};
}, {}], 46: [function(e7, t5, r2) {
var h2, c2 = e7("../utils/common"), u2 = e7("./trees"), d2 = e7("./adler32"), p2 = e7("./crc32"), n2 = e7("./messages"), l2 = 0, f2 = 4, m2 = 0, _24 = -2, g2 = -1, b2 = 4, i2 = 2, v2 = 8, y2 = 9, s2 = 286, a2 = 30, o2 = 19, w2 = 2 * s2 + 1, k2 = 15, x2 = 3, S2 = 258, z2 = S2 + x2 + 1, C3 = 42, E2 = 113, A5 = 1, I2 = 2, O2 = 3, B3 = 4;
function R2(e8, t6) {
return e8.msg = n2[t6], t6;
}
function T2(e8) {
return (e8 << 1) - (4 < e8 ? 9 : 0);
}
function D2(e8) {
for (var t6 = e8.length; 0 <= --t6; )
e8[t6] = 0;
}
function F2(e8) {
var t6 = e8.state, r3 = t6.pending;
r3 > e8.avail_out && (r3 = e8.avail_out), 0 !== r3 && (c2.arraySet(e8.output, t6.pending_buf, t6.pending_out, r3, e8.next_out), e8.next_out += r3, t6.pending_out += r3, e8.total_out += r3, e8.avail_out -= r3, t6.pending -= r3, 0 === t6.pending && (t6.pending_out = 0));
}
function N2(e8, t6) {
u2._tr_flush_block(e8, 0 <= e8.block_start ? e8.block_start : -1, e8.strstart - e8.block_start, t6), e8.block_start = e8.strstart, F2(e8.strm);
}
function U2(e8, t6) {
e8.pending_buf[e8.pending++] = t6;
}
function P2(e8, t6) {
e8.pending_buf[e8.pending++] = t6 >>> 8 & 255, e8.pending_buf[e8.pending++] = 255 & t6;
}
function L2(e8, t6) {
var r3, n3, i3 = e8.max_chain_length, s3 = e8.strstart, a3 = e8.prev_length, o3 = e8.nice_match, h3 = e8.strstart > e8.w_size - z2 ? e8.strstart - (e8.w_size - z2) : 0, u3 = e8.window, l3 = e8.w_mask, f3 = e8.prev, c3 = e8.strstart + S2, d3 = u3[s3 + a3 - 1], p3 = u3[s3 + a3];
e8.prev_length >= e8.good_match && (i3 >>= 2), o3 > e8.lookahead && (o3 = e8.lookahead);
do {
if (u3[(r3 = t6) + a3] === p3 && u3[r3 + a3 - 1] === d3 && u3[r3] === u3[s3] && u3[++r3] === u3[s3 + 1]) {
s3 += 2, r3++;
do {
} while (u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && u3[++s3] === u3[++r3] && s3 < c3);
if (n3 = S2 - (c3 - s3), s3 = c3 - S2, a3 < n3) {
if (e8.match_start = t6, o3 <= (a3 = n3))
break;
d3 = u3[s3 + a3 - 1], p3 = u3[s3 + a3];
}
}
} while ((t6 = f3[t6 & l3]) > h3 && 0 != --i3);
return a3 <= e8.lookahead ? a3 : e8.lookahead;
}
function j2(e8) {
var t6, r3, n3, i3, s3, a3, o3, h3, u3, l3, f3 = e8.w_size;
do {
if (i3 = e8.window_size - e8.lookahead - e8.strstart, e8.strstart >= f3 + (f3 - z2)) {
for (c2.arraySet(e8.window, e8.window, f3, f3, 0), e8.match_start -= f3, e8.strstart -= f3, e8.block_start -= f3, t6 = r3 = e8.hash_size; n3 = e8.head[--t6], e8.head[t6] = f3 <= n3 ? n3 - f3 : 0, --r3; )
;
for (t6 = r3 = f3; n3 = e8.prev[--t6], e8.prev[t6] = f3 <= n3 ? n3 - f3 : 0, --r3; )
;
i3 += f3;
}
if (0 === e8.strm.avail_in)
break;
if (a3 = e8.strm, o3 = e8.window, h3 = e8.strstart + e8.lookahead, u3 = i3, l3 = void 0, l3 = a3.avail_in, u3 < l3 && (l3 = u3), r3 = 0 === l3 ? 0 : (a3.avail_in -= l3, c2.arraySet(o3, a3.input, a3.next_in, l3, h3), 1 === a3.state.wrap ? a3.adler = d2(a3.adler, o3, l3, h3) : 2 === a3.state.wrap && (a3.adler = p2(a3.adler, o3, l3, h3)), a3.next_in += l3, a3.total_in += l3, l3), e8.lookahead += r3, e8.lookahead + e8.insert >= x2)
for (s3 = e8.strstart - e8.insert, e8.ins_h = e8.window[s3], e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[s3 + 1]) & e8.hash_mask; e8.insert && (e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[s3 + x2 - 1]) & e8.hash_mask, e8.prev[s3 & e8.w_mask] = e8.head[e8.ins_h], e8.head[e8.ins_h] = s3, s3++, e8.insert--, !(e8.lookahead + e8.insert < x2)); )
;
} while (e8.lookahead < z2 && 0 !== e8.strm.avail_in);
}
function Z3(e8, t6) {
for (var r3, n3; ; ) {
if (e8.lookahead < z2) {
if (j2(e8), e8.lookahead < z2 && t6 === l2)
return A5;
if (0 === e8.lookahead)
break;
}
if (r3 = 0, e8.lookahead >= x2 && (e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[e8.strstart + x2 - 1]) & e8.hash_mask, r3 = e8.prev[e8.strstart & e8.w_mask] = e8.head[e8.ins_h], e8.head[e8.ins_h] = e8.strstart), 0 !== r3 && e8.strstart - r3 <= e8.w_size - z2 && (e8.match_length = L2(e8, r3)), e8.match_length >= x2)
if (n3 = u2._tr_tally(e8, e8.strstart - e8.match_start, e8.match_length - x2), e8.lookahead -= e8.match_length, e8.match_length <= e8.max_lazy_match && e8.lookahead >= x2) {
for (e8.match_length--; e8.strstart++, e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[e8.strstart + x2 - 1]) & e8.hash_mask, r3 = e8.prev[e8.strstart & e8.w_mask] = e8.head[e8.ins_h], e8.head[e8.ins_h] = e8.strstart, 0 != --e8.match_length; )
;
e8.strstart++;
} else
e8.strstart += e8.match_length, e8.match_length = 0, e8.ins_h = e8.window[e8.strstart], e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[e8.strstart + 1]) & e8.hash_mask;
else
n3 = u2._tr_tally(e8, 0, e8.window[e8.strstart]), e8.lookahead--, e8.strstart++;
if (n3 && (N2(e8, false), 0 === e8.strm.avail_out))
return A5;
}
return e8.insert = e8.strstart < x2 - 1 ? e8.strstart : x2 - 1, t6 === f2 ? (N2(e8, true), 0 === e8.strm.avail_out ? O2 : B3) : e8.last_lit && (N2(e8, false), 0 === e8.strm.avail_out) ? A5 : I2;
}
function W2(e8, t6) {
for (var r3, n3, i3; ; ) {
if (e8.lookahead < z2) {
if (j2(e8), e8.lookahead < z2 && t6 === l2)
return A5;
if (0 === e8.lookahead)
break;
}
if (r3 = 0, e8.lookahead >= x2 && (e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[e8.strstart + x2 - 1]) & e8.hash_mask, r3 = e8.prev[e8.strstart & e8.w_mask] = e8.head[e8.ins_h], e8.head[e8.ins_h] = e8.strstart), e8.prev_length = e8.match_length, e8.prev_match = e8.match_start, e8.match_length = x2 - 1, 0 !== r3 && e8.prev_length < e8.max_lazy_match && e8.strstart - r3 <= e8.w_size - z2 && (e8.match_length = L2(e8, r3), e8.match_length <= 5 && (1 === e8.strategy || e8.match_length === x2 && 4096 < e8.strstart - e8.match_start) && (e8.match_length = x2 - 1)), e8.prev_length >= x2 && e8.match_length <= e8.prev_length) {
for (i3 = e8.strstart + e8.lookahead - x2, n3 = u2._tr_tally(e8, e8.strstart - 1 - e8.prev_match, e8.prev_length - x2), e8.lookahead -= e8.prev_length - 1, e8.prev_length -= 2; ++e8.strstart <= i3 && (e8.ins_h = (e8.ins_h << e8.hash_shift ^ e8.window[e8.strstart + x2 - 1]) & e8.hash_mask, r3 = e8.prev[e8.strstart & e8.w_mask] = e8.head[e8.ins_h], e8.head[e8.ins_h] = e8.strstart), 0 != --e8.prev_length; )
;
if (e8.match_available = 0, e8.match_length = x2 - 1, e8.strstart++, n3 && (N2(e8, false), 0 === e8.strm.avail_out))
return A5;
} else if (e8.match_available) {
if ((n3 = u2._tr_tally(e8, 0, e8.window[e8.strstart - 1])) && N2(e8, false), e8.strstart++, e8.lookahead--, 0 === e8.strm.avail_out)
return A5;
} else
e8.match_available = 1, e8.strstart++, e8.lookahead--;
}
return e8.match_available && (n3 = u2._tr_tally(e8, 0, e8.window[e8.strstart - 1]), e8.match_available = 0), e8.insert = e8.strstart < x2 - 1 ? e8.strstart : x2 - 1, t6 === f2 ? (N2(e8, true), 0 === e8.strm.avail_out ? O2 : B3) : e8.last_lit && (N2(e8, false), 0 === e8.strm.avail_out) ? A5 : I2;
}
function M2(e8, t6, r3, n3, i3) {
this.good_length = e8, this.max_lazy = t6, this.nice_length = r3, this.max_chain = n3, this.func = i3;
}
function H4() {
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = v2, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new c2.Buf16(2 * w2), this.dyn_dtree = new c2.Buf16(2 * (2 * a2 + 1)), this.bl_tree = new c2.Buf16(2 * (2 * o2 + 1)), D2(this.dyn_ltree), D2(this.dyn_dtree), D2(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new c2.Buf16(k2 + 1), this.heap = new c2.Buf16(2 * s2 + 1), D2(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new c2.Buf16(2 * s2 + 1), D2(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
}
function G2(e8) {
var t6;
return e8 && e8.state ? (e8.total_in = e8.total_out = 0, e8.data_type = i2, (t6 = e8.state).pending = 0, t6.pending_out = 0, t6.wrap < 0 && (t6.wrap = -t6.wrap), t6.status = t6.wrap ? C3 : E2, e8.adler = 2 === t6.wrap ? 0 : 1, t6.last_flush = l2, u2._tr_init(t6), m2) : R2(e8, _24);
}
function K2(e8) {
var t6 = G2(e8);
return t6 === m2 && function(e9) {
e9.window_size = 2 * e9.w_size, D2(e9.head), e9.max_lazy_match = h2[e9.level].max_lazy, e9.good_match = h2[e9.level].good_length, e9.nice_match = h2[e9.level].nice_length, e9.max_chain_length = h2[e9.level].max_chain, e9.strstart = 0, e9.block_start = 0, e9.lookahead = 0, e9.insert = 0, e9.match_length = e9.prev_length = x2 - 1, e9.match_available = 0, e9.ins_h = 0;
}(e8.state), t6;
}
function Y3(e8, t6, r3, n3, i3, s3) {
if (!e8)
return _24;
var a3 = 1;
if (t6 === g2 && (t6 = 6), n3 < 0 ? (a3 = 0, n3 = -n3) : 15 < n3 && (a3 = 2, n3 -= 16), i3 < 1 || y2 < i3 || r3 !== v2 || n3 < 8 || 15 < n3 || t6 < 0 || 9 < t6 || s3 < 0 || b2 < s3)
return R2(e8, _24);
8 === n3 && (n3 = 9);
var o3 = new H4();
return (e8.state = o3).strm = e8, o3.wrap = a3, o3.gzhead = null, o3.w_bits = n3, o3.w_size = 1 << o3.w_bits, o3.w_mask = o3.w_size - 1, o3.hash_bits = i3 + 7, o3.hash_size = 1 << o3.hash_bits, o3.hash_mask = o3.hash_size - 1, o3.hash_shift = ~~((o3.hash_bits + x2 - 1) / x2), o3.window = new c2.Buf8(2 * o3.w_size), o3.head = new c2.Buf16(o3.hash_size), o3.prev = new c2.Buf16(o3.w_size), o3.lit_bufsize = 1 << i3 + 6, o3.pending_buf_size = 4 * o3.lit_bufsize, o3.pending_buf = new c2.Buf8(o3.pending_buf_size), o3.d_buf = 1 * o3.lit_bufsize, o3.l_buf = 3 * o3.lit_bufsize, o3.level = t6, o3.strategy = s3, o3.method = r3, K2(e8);
}
h2 = [new M2(0, 0, 0, 0, function(e8, t6) {
var r3 = 65535;
for (r3 > e8.pending_buf_size - 5 && (r3 = e8.pending_buf_size - 5); ; ) {
if (e8.lookahead <= 1) {
if (j2(e8), 0 === e8.lookahead && t6 === l2)
return A5;
if (0 === e8.lookahead)
break;
}
e8.strstart += e8.lookahead, e8.lookahead = 0;
var n3 = e8.block_start + r3;
if ((0 === e8.strstart || e8.strstart >= n3) && (e8.lookahead = e8.strstart - n3, e8.strstart = n3, N2(e8, false), 0 === e8.strm.avail_out))
return A5;
if (e8.strstart - e8.block_start >= e8.w_size - z2 && (N2(e8, false), 0 === e8.strm.avail_out))
return A5;
}
return e8.insert = 0, t6 === f2 ? (N2(e8, true), 0 === e8.strm.avail_out ? O2 : B3) : (e8.strstart > e8.block_start && (N2(e8, false), e8.strm.avail_out), A5);
}), new M2(4, 4, 8, 4, Z3), new M2(4, 5, 16, 8, Z3), new M2(4, 6, 32, 32, Z3), new M2(4, 4, 16, 16, W2), new M2(8, 16, 32, 32, W2), new M2(8, 16, 128, 128, W2), new M2(8, 32, 128, 256, W2), new M2(32, 128, 258, 1024, W2), new M2(32, 258, 258, 4096, W2)], r2.deflateInit = function(e8, t6) {
return Y3(e8, t6, v2, 15, 8, 0);
}, r2.deflateInit2 = Y3, r2.deflateReset = K2, r2.deflateResetKeep = G2, r2.deflateSetHeader = function(e8, t6) {
return e8 && e8.state ? 2 !== e8.state.wrap ? _24 : (e8.state.gzhead = t6, m2) : _24;
}, r2.deflate = function(e8, t6) {
var r3, n3, i3, s3;
if (!e8 || !e8.state || 5 < t6 || t6 < 0)
return e8 ? R2(e8, _24) : _24;
if (n3 = e8.state, !e8.output || !e8.input && 0 !== e8.avail_in || 666 === n3.status && t6 !== f2)
return R2(e8, 0 === e8.avail_out ? -5 : _24);
if (n3.strm = e8, r3 = n3.last_flush, n3.last_flush = t6, n3.status === C3)
if (2 === n3.wrap)
e8.adler = 0, U2(n3, 31), U2(n3, 139), U2(n3, 8), n3.gzhead ? (U2(n3, (n3.gzhead.text ? 1 : 0) + (n3.gzhead.hcrc ? 2 : 0) + (n3.gzhead.extra ? 4 : 0) + (n3.gzhead.name ? 8 : 0) + (n3.gzhead.comment ? 16 : 0)), U2(n3, 255 & n3.gzhead.time), U2(n3, n3.gzhead.time >> 8 & 255), U2(n3, n3.gzhead.time >> 16 & 255), U2(n3, n3.gzhead.time >> 24 & 255), U2(n3, 9 === n3.level ? 2 : 2 <= n3.strategy || n3.level < 2 ? 4 : 0), U2(n3, 255 & n3.gzhead.os), n3.gzhead.extra && n3.gzhead.extra.length && (U2(n3, 255 & n3.gzhead.extra.length), U2(n3, n3.gzhead.extra.length >> 8 & 255)), n3.gzhead.hcrc && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending, 0)), n3.gzindex = 0, n3.status = 69) : (U2(n3, 0), U2(n3, 0), U2(n3, 0), U2(n3, 0), U2(n3, 0), U2(n3, 9 === n3.level ? 2 : 2 <= n3.strategy || n3.level < 2 ? 4 : 0), U2(n3, 3), n3.status = E2);
else {
var a3 = v2 + (n3.w_bits - 8 << 4) << 8;
a3 |= (2 <= n3.strategy || n3.level < 2 ? 0 : n3.level < 6 ? 1 : 6 === n3.level ? 2 : 3) << 6, 0 !== n3.strstart && (a3 |= 32), a3 += 31 - a3 % 31, n3.status = E2, P2(n3, a3), 0 !== n3.strstart && (P2(n3, e8.adler >>> 16), P2(n3, 65535 & e8.adler)), e8.adler = 1;
}
if (69 === n3.status)
if (n3.gzhead.extra) {
for (i3 = n3.pending; n3.gzindex < (65535 & n3.gzhead.extra.length) && (n3.pending !== n3.pending_buf_size || (n3.gzhead.hcrc && n3.pending > i3 && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending - i3, i3)), F2(e8), i3 = n3.pending, n3.pending !== n3.pending_buf_size)); )
U2(n3, 255 & n3.gzhead.extra[n3.gzindex]), n3.gzindex++;
n3.gzhead.hcrc && n3.pending > i3 && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending - i3, i3)), n3.gzindex === n3.gzhead.extra.length && (n3.gzindex = 0, n3.status = 73);
} else
n3.status = 73;
if (73 === n3.status)
if (n3.gzhead.name) {
i3 = n3.pending;
do {
if (n3.pending === n3.pending_buf_size && (n3.gzhead.hcrc && n3.pending > i3 && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending - i3, i3)), F2(e8), i3 = n3.pending, n3.pending === n3.pending_buf_size)) {
s3 = 1;
break;
}
s3 = n3.gzindex < n3.gzhead.name.length ? 255 & n3.gzhead.name.charCodeAt(n3.gzindex++) : 0, U2(n3, s3);
} while (0 !== s3);
n3.gzhead.hcrc && n3.pending > i3 && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending - i3, i3)), 0 === s3 && (n3.gzindex = 0, n3.status = 91);
} else
n3.status = 91;
if (91 === n3.status)
if (n3.gzhead.comment) {
i3 = n3.pending;
do {
if (n3.pending === n3.pending_buf_size && (n3.gzhead.hcrc && n3.pending > i3 && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending - i3, i3)), F2(e8), i3 = n3.pending, n3.pending === n3.pending_buf_size)) {
s3 = 1;
break;
}
s3 = n3.gzindex < n3.gzhead.comment.length ? 255 & n3.gzhead.comment.charCodeAt(n3.gzindex++) : 0, U2(n3, s3);
} while (0 !== s3);
n3.gzhead.hcrc && n3.pending > i3 && (e8.adler = p2(e8.adler, n3.pending_buf, n3.pending - i3, i3)), 0 === s3 && (n3.status = 103);
} else
n3.status = 103;
if (103 === n3.status && (n3.gzhead.hcrc ? (n3.pending + 2 > n3.pending_buf_size && F2(e8), n3.pending + 2 <= n3.pending_buf_size && (U2(n3, 255 & e8.adler), U2(n3, e8.adler >> 8 & 255), e8.adler = 0, n3.status = E2)) : n3.status = E2), 0 !== n3.pending) {
if (F2(e8), 0 === e8.avail_out)
return n3.last_flush = -1, m2;
} else if (0 === e8.avail_in && T2(t6) <= T2(r3) && t6 !== f2)
return R2(e8, -5);
if (666 === n3.status && 0 !== e8.avail_in)
return R2(e8, -5);
if (0 !== e8.avail_in || 0 !== n3.lookahead || t6 !== l2 && 666 !== n3.status) {
var o3 = 2 === n3.strategy ? function(e9, t7) {
for (var r4; ; ) {
if (0 === e9.lookahead && (j2(e9), 0 === e9.lookahead)) {
if (t7 === l2)
return A5;
break;
}
if (e9.match_length = 0, r4 = u2._tr_tally(e9, 0, e9.window[e9.strstart]), e9.lookahead--, e9.strstart++, r4 && (N2(e9, false), 0 === e9.strm.avail_out))
return A5;
}
return e9.insert = 0, t7 === f2 ? (N2(e9, true), 0 === e9.strm.avail_out ? O2 : B3) : e9.last_lit && (N2(e9, false), 0 === e9.strm.avail_out) ? A5 : I2;
}(n3, t6) : 3 === n3.strategy ? function(e9, t7) {
for (var r4, n4, i4, s4, a4 = e9.window; ; ) {
if (e9.lookahead <= S2) {
if (j2(e9), e9.lookahead <= S2 && t7 === l2)
return A5;
if (0 === e9.lookahead)
break;
}
if (e9.match_length = 0, e9.lookahead >= x2 && 0 < e9.strstart && (n4 = a4[i4 = e9.strstart - 1]) === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4]) {
s4 = e9.strstart + S2;
do {
} while (n4 === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4] && n4 === a4[++i4] && i4 < s4);
e9.match_length = S2 - (s4 - i4), e9.match_length > e9.lookahead && (e9.match_length = e9.lookahead);
}
if (e9.match_length >= x2 ? (r4 = u2._tr_tally(e9, 1, e9.match_length - x2), e9.lookahead -= e9.match_length, e9.strstart += e9.match_length, e9.match_length = 0) : (r4 = u2._tr_tally(e9, 0, e9.window[e9.strstart]), e9.lookahead--, e9.strstart++), r4 && (N2(e9, false), 0 === e9.strm.avail_out))
return A5;
}
return e9.insert = 0, t7 === f2 ? (N2(e9, true), 0 === e9.strm.avail_out ? O2 : B3) : e9.last_lit && (N2(e9, false), 0 === e9.strm.avail_out) ? A5 : I2;
}(n3, t6) : h2[n3.level].func(n3, t6);
if (o3 !== O2 && o3 !== B3 || (n3.status = 666), o3 === A5 || o3 === O2)
return 0 === e8.avail_out && (n3.last_flush = -1), m2;
if (o3 === I2 && (1 === t6 ? u2._tr_align(n3) : 5 !== t6 && (u2._tr_stored_block(n3, 0, 0, false), 3 === t6 && (D2(n3.head), 0 === n3.lookahead && (n3.strstart = 0, n3.block_start = 0, n3.insert = 0))), F2(e8), 0 === e8.avail_out))
return n3.last_flush = -1, m2;
}
return t6 !== f2 ? m2 : n3.wrap <= 0 ? 1 : (2 === n3.wrap ? (U2(n3, 255 & e8.adler), U2(n3, e8.adler >> 8 & 255), U2(n3, e8.adler >> 16 & 255), U2(n3, e8.adler >> 24 & 255), U2(n3, 255 & e8.total_in), U2(n3, e8.total_in >> 8 & 255), U2(n3, e8.total_in >> 16 & 255), U2(n3, e8.total_in >> 24 & 255)) : (P2(n3, e8.adler >>> 16), P2(n3, 65535 & e8.adler)), F2(e8), 0 < n3.wrap && (n3.wrap = -n3.wrap), 0 !== n3.pending ? m2 : 1);
}, r2.deflateEnd = function(e8) {
var t6;
return e8 && e8.state ? (t6 = e8.state.status) !== C3 && 69 !== t6 && 73 !== t6 && 91 !== t6 && 103 !== t6 && t6 !== E2 && 666 !== t6 ? R2(e8, _24) : (e8.state = null, t6 === E2 ? R2(e8, -3) : m2) : _24;
}, r2.deflateSetDictionary = function(e8, t6) {
var r3, n3, i3, s3, a3, o3, h3, u3, l3 = t6.length;
if (!e8 || !e8.state)
return _24;
if (2 === (s3 = (r3 = e8.state).wrap) || 1 === s3 && r3.status !== C3 || r3.lookahead)
return _24;
for (1 === s3 && (e8.adler = d2(e8.adler, t6, l3, 0)), r3.wrap = 0, l3 >= r3.w_size && (0 === s3 && (D2(r3.head), r3.strstart = 0, r3.block_start = 0, r3.insert = 0), u3 = new c2.Buf8(r3.w_size), c2.arraySet(u3, t6, l3 - r3.w_size, r3.w_size, 0), t6 = u3, l3 = r3.w_size), a3 = e8.avail_in, o3 = e8.next_in, h3 = e8.input, e8.avail_in = l3, e8.next_in = 0, e8.input = t6, j2(r3); r3.lookahead >= x2; ) {
for (n3 = r3.strstart, i3 = r3.lookahead - (x2 - 1); r3.ins_h = (r3.ins_h << r3.hash_shift ^ r3.window[n3 + x2 - 1]) & r3.hash_mask, r3.prev[n3 & r3.w_mask] = r3.head[r3.ins_h], r3.head[r3.ins_h] = n3, n3++, --i3; )
;
r3.strstart = n3, r3.lookahead = x2 - 1, j2(r3);
}
return r3.strstart += r3.lookahead, r3.block_start = r3.strstart, r3.insert = r3.lookahead, r3.lookahead = 0, r3.match_length = r3.prev_length = x2 - 1, r3.match_available = 0, e8.next_in = o3, e8.input = h3, e8.avail_in = a3, r3.wrap = s3, m2;
}, r2.deflateInfo = "pako deflate (from Nodeca project)";
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(e7, t5, r2) {
t5.exports = function() {
this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = false;
};
}, {}], 48: [function(e7, t5, r2) {
t5.exports = function(e8, t6) {
var r3, n2, i2, s2, a2, o2, h2, u2, l2, f2, c2, d2, p2, m2, _24, g2, b2, v2, y2, w2, k2, x2, S2, z2, C3;
r3 = e8.state, n2 = e8.next_in, z2 = e8.input, i2 = n2 + (e8.avail_in - 5), s2 = e8.next_out, C3 = e8.output, a2 = s2 - (t6 - e8.avail_out), o2 = s2 + (e8.avail_out - 257), h2 = r3.dmax, u2 = r3.wsize, l2 = r3.whave, f2 = r3.wnext, c2 = r3.window, d2 = r3.hold, p2 = r3.bits, m2 = r3.lencode, _24 = r3.distcode, g2 = (1 << r3.lenbits) - 1, b2 = (1 << r3.distbits) - 1;
e:
do {
p2 < 15 && (d2 += z2[n2++] << p2, p2 += 8, d2 += z2[n2++] << p2, p2 += 8), v2 = m2[d2 & g2];
t:
for (; ; ) {
if (d2 >>>= y2 = v2 >>> 24, p2 -= y2, 0 === (y2 = v2 >>> 16 & 255))
C3[s2++] = 65535 & v2;
else {
if (!(16 & y2)) {
if (0 == (64 & y2)) {
v2 = m2[(65535 & v2) + (d2 & (1 << y2) - 1)];
continue t;
}
if (32 & y2) {
r3.mode = 12;
break e;
}
e8.msg = "invalid literal/length code", r3.mode = 30;
break e;
}
w2 = 65535 & v2, (y2 &= 15) && (p2 < y2 && (d2 += z2[n2++] << p2, p2 += 8), w2 += d2 & (1 << y2) - 1, d2 >>>= y2, p2 -= y2), p2 < 15 && (d2 += z2[n2++] << p2, p2 += 8, d2 += z2[n2++] << p2, p2 += 8), v2 = _24[d2 & b2];
r:
for (; ; ) {
if (d2 >>>= y2 = v2 >>> 24, p2 -= y2, !(16 & (y2 = v2 >>> 16 & 255))) {
if (0 == (64 & y2)) {
v2 = _24[(65535 & v2) + (d2 & (1 << y2) - 1)];
continue r;
}
e8.msg = "invalid distance code", r3.mode = 30;
break e;
}
if (k2 = 65535 & v2, p2 < (y2 &= 15) && (d2 += z2[n2++] << p2, (p2 += 8) < y2 && (d2 += z2[n2++] << p2, p2 += 8)), h2 < (k2 += d2 & (1 << y2) - 1)) {
e8.msg = "invalid distance too far back", r3.mode = 30;
break e;
}
if (d2 >>>= y2, p2 -= y2, (y2 = s2 - a2) < k2) {
if (l2 < (y2 = k2 - y2) && r3.sane) {
e8.msg = "invalid distance too far back", r3.mode = 30;
break e;
}
if (S2 = c2, (x2 = 0) === f2) {
if (x2 += u2 - y2, y2 < w2) {
for (w2 -= y2; C3[s2++] = c2[x2++], --y2; )
;
x2 = s2 - k2, S2 = C3;
}
} else if (f2 < y2) {
if (x2 += u2 + f2 - y2, (y2 -= f2) < w2) {
for (w2 -= y2; C3[s2++] = c2[x2++], --y2; )
;
if (x2 = 0, f2 < w2) {
for (w2 -= y2 = f2; C3[s2++] = c2[x2++], --y2; )
;
x2 = s2 - k2, S2 = C3;
}
}
} else if (x2 += f2 - y2, y2 < w2) {
for (w2 -= y2; C3[s2++] = c2[x2++], --y2; )
;
x2 = s2 - k2, S2 = C3;
}
for (; 2 < w2; )
C3[s2++] = S2[x2++], C3[s2++] = S2[x2++], C3[s2++] = S2[x2++], w2 -= 3;
w2 && (C3[s2++] = S2[x2++], 1 < w2 && (C3[s2++] = S2[x2++]));
} else {
for (x2 = s2 - k2; C3[s2++] = C3[x2++], C3[s2++] = C3[x2++], C3[s2++] = C3[x2++], 2 < (w2 -= 3); )
;
w2 && (C3[s2++] = C3[x2++], 1 < w2 && (C3[s2++] = C3[x2++]));
}
break;
}
}
break;
}
} while (n2 < i2 && s2 < o2);
n2 -= w2 = p2 >> 3, d2 &= (1 << (p2 -= w2 << 3)) - 1, e8.next_in = n2, e8.next_out = s2, e8.avail_in = n2 < i2 ? i2 - n2 + 5 : 5 - (n2 - i2), e8.avail_out = s2 < o2 ? o2 - s2 + 257 : 257 - (s2 - o2), r3.hold = d2, r3.bits = p2;
};
}, {}], 49: [function(e7, t5, r2) {
var I2 = e7("../utils/common"), O2 = e7("./adler32"), B3 = e7("./crc32"), R2 = e7("./inffast"), T2 = e7("./inftrees"), D2 = 1, F2 = 2, N2 = 0, U2 = -2, P2 = 1, n2 = 852, i2 = 592;
function L2(e8) {
return (e8 >>> 24 & 255) + (e8 >>> 8 & 65280) + ((65280 & e8) << 8) + ((255 & e8) << 24);
}
function s2() {
this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new I2.Buf16(320), this.work = new I2.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
}
function a2(e8) {
var t6;
return e8 && e8.state ? (t6 = e8.state, e8.total_in = e8.total_out = t6.total = 0, e8.msg = "", t6.wrap && (e8.adler = 1 & t6.wrap), t6.mode = P2, t6.last = 0, t6.havedict = 0, t6.dmax = 32768, t6.head = null, t6.hold = 0, t6.bits = 0, t6.lencode = t6.lendyn = new I2.Buf32(n2), t6.distcode = t6.distdyn = new I2.Buf32(i2), t6.sane = 1, t6.back = -1, N2) : U2;
}
function o2(e8) {
var t6;
return e8 && e8.state ? ((t6 = e8.state).wsize = 0, t6.whave = 0, t6.wnext = 0, a2(e8)) : U2;
}
function h2(e8, t6) {
var r3, n3;
return e8 && e8.state ? (n3 = e8.state, t6 < 0 ? (r3 = 0, t6 = -t6) : (r3 = 1 + (t6 >> 4), t6 < 48 && (t6 &= 15)), t6 && (t6 < 8 || 15 < t6) ? U2 : (null !== n3.window && n3.wbits !== t6 && (n3.window = null), n3.wrap = r3, n3.wbits = t6, o2(e8))) : U2;
}
function u2(e8, t6) {
var r3, n3;
return e8 ? (n3 = new s2(), (e8.state = n3).window = null, (r3 = h2(e8, t6)) !== N2 && (e8.state = null), r3) : U2;
}
var l2, f2, c2 = true;
function j2(e8) {
if (c2) {
var t6;
for (l2 = new I2.Buf32(512), f2 = new I2.Buf32(32), t6 = 0; t6 < 144; )
e8.lens[t6++] = 8;
for (; t6 < 256; )
e8.lens[t6++] = 9;
for (; t6 < 280; )
e8.lens[t6++] = 7;
for (; t6 < 288; )
e8.lens[t6++] = 8;
for (T2(D2, e8.lens, 0, 288, l2, 0, e8.work, { bits: 9 }), t6 = 0; t6 < 32; )
e8.lens[t6++] = 5;
T2(F2, e8.lens, 0, 32, f2, 0, e8.work, { bits: 5 }), c2 = false;
}
e8.lencode = l2, e8.lenbits = 9, e8.distcode = f2, e8.distbits = 5;
}
function Z3(e8, t6, r3, n3) {
var i3, s3 = e8.state;
return null === s3.window && (s3.wsize = 1 << s3.wbits, s3.wnext = 0, s3.whave = 0, s3.window = new I2.Buf8(s3.wsize)), n3 >= s3.wsize ? (I2.arraySet(s3.window, t6, r3 - s3.wsize, s3.wsize, 0), s3.wnext = 0, s3.whave = s3.wsize) : (n3 < (i3 = s3.wsize - s3.wnext) && (i3 = n3), I2.arraySet(s3.window, t6, r3 - n3, i3, s3.wnext), (n3 -= i3) ? (I2.arraySet(s3.window, t6, r3 - n3, n3, 0), s3.wnext = n3, s3.whave = s3.wsize) : (s3.wnext += i3, s3.wnext === s3.wsize && (s3.wnext = 0), s3.whave < s3.wsize && (s3.whave += i3))), 0;
}
r2.inflateReset = o2, r2.inflateReset2 = h2, r2.inflateResetKeep = a2, r2.inflateInit = function(e8) {
return u2(e8, 15);
}, r2.inflateInit2 = u2, r2.inflate = function(e8, t6) {
var r3, n3, i3, s3, a3, o3, h3, u3, l3, f3, c3, d2, p2, m2, _24, g2, b2, v2, y2, w2, k2, x2, S2, z2, C3 = 0, E2 = new I2.Buf8(4), A5 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
if (!e8 || !e8.state || !e8.output || !e8.input && 0 !== e8.avail_in)
return U2;
12 === (r3 = e8.state).mode && (r3.mode = 13), a3 = e8.next_out, i3 = e8.output, h3 = e8.avail_out, s3 = e8.next_in, n3 = e8.input, o3 = e8.avail_in, u3 = r3.hold, l3 = r3.bits, f3 = o3, c3 = h3, x2 = N2;
e:
for (; ; )
switch (r3.mode) {
case P2:
if (0 === r3.wrap) {
r3.mode = 13;
break;
}
for (; l3 < 16; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (2 & r3.wrap && 35615 === u3) {
E2[r3.check = 0] = 255 & u3, E2[1] = u3 >>> 8 & 255, r3.check = B3(r3.check, E2, 2, 0), l3 = u3 = 0, r3.mode = 2;
break;
}
if (r3.flags = 0, r3.head && (r3.head.done = false), !(1 & r3.wrap) || (((255 & u3) << 8) + (u3 >> 8)) % 31) {
e8.msg = "incorrect header check", r3.mode = 30;
break;
}
if (8 != (15 & u3)) {
e8.msg = "unknown compression method", r3.mode = 30;
break;
}
if (l3 -= 4, k2 = 8 + (15 & (u3 >>>= 4)), 0 === r3.wbits)
r3.wbits = k2;
else if (k2 > r3.wbits) {
e8.msg = "invalid window size", r3.mode = 30;
break;
}
r3.dmax = 1 << k2, e8.adler = r3.check = 1, r3.mode = 512 & u3 ? 10 : 12, l3 = u3 = 0;
break;
case 2:
for (; l3 < 16; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (r3.flags = u3, 8 != (255 & r3.flags)) {
e8.msg = "unknown compression method", r3.mode = 30;
break;
}
if (57344 & r3.flags) {
e8.msg = "unknown header flags set", r3.mode = 30;
break;
}
r3.head && (r3.head.text = u3 >> 8 & 1), 512 & r3.flags && (E2[0] = 255 & u3, E2[1] = u3 >>> 8 & 255, r3.check = B3(r3.check, E2, 2, 0)), l3 = u3 = 0, r3.mode = 3;
case 3:
for (; l3 < 32; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
r3.head && (r3.head.time = u3), 512 & r3.flags && (E2[0] = 255 & u3, E2[1] = u3 >>> 8 & 255, E2[2] = u3 >>> 16 & 255, E2[3] = u3 >>> 24 & 255, r3.check = B3(r3.check, E2, 4, 0)), l3 = u3 = 0, r3.mode = 4;
case 4:
for (; l3 < 16; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
r3.head && (r3.head.xflags = 255 & u3, r3.head.os = u3 >> 8), 512 & r3.flags && (E2[0] = 255 & u3, E2[1] = u3 >>> 8 & 255, r3.check = B3(r3.check, E2, 2, 0)), l3 = u3 = 0, r3.mode = 5;
case 5:
if (1024 & r3.flags) {
for (; l3 < 16; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
r3.length = u3, r3.head && (r3.head.extra_len = u3), 512 & r3.flags && (E2[0] = 255 & u3, E2[1] = u3 >>> 8 & 255, r3.check = B3(r3.check, E2, 2, 0)), l3 = u3 = 0;
} else
r3.head && (r3.head.extra = null);
r3.mode = 6;
case 6:
if (1024 & r3.flags && (o3 < (d2 = r3.length) && (d2 = o3), d2 && (r3.head && (k2 = r3.head.extra_len - r3.length, r3.head.extra || (r3.head.extra = new Array(r3.head.extra_len)), I2.arraySet(r3.head.extra, n3, s3, d2, k2)), 512 & r3.flags && (r3.check = B3(r3.check, n3, d2, s3)), o3 -= d2, s3 += d2, r3.length -= d2), r3.length))
break e;
r3.length = 0, r3.mode = 7;
case 7:
if (2048 & r3.flags) {
if (0 === o3)
break e;
for (d2 = 0; k2 = n3[s3 + d2++], r3.head && k2 && r3.length < 65536 && (r3.head.name += String.fromCharCode(k2)), k2 && d2 < o3; )
;
if (512 & r3.flags && (r3.check = B3(r3.check, n3, d2, s3)), o3 -= d2, s3 += d2, k2)
break e;
} else
r3.head && (r3.head.name = null);
r3.length = 0, r3.mode = 8;
case 8:
if (4096 & r3.flags) {
if (0 === o3)
break e;
for (d2 = 0; k2 = n3[s3 + d2++], r3.head && k2 && r3.length < 65536 && (r3.head.comment += String.fromCharCode(k2)), k2 && d2 < o3; )
;
if (512 & r3.flags && (r3.check = B3(r3.check, n3, d2, s3)), o3 -= d2, s3 += d2, k2)
break e;
} else
r3.head && (r3.head.comment = null);
r3.mode = 9;
case 9:
if (512 & r3.flags) {
for (; l3 < 16; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (u3 !== (65535 & r3.check)) {
e8.msg = "header crc mismatch", r3.mode = 30;
break;
}
l3 = u3 = 0;
}
r3.head && (r3.head.hcrc = r3.flags >> 9 & 1, r3.head.done = true), e8.adler = r3.check = 0, r3.mode = 12;
break;
case 10:
for (; l3 < 32; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
e8.adler = r3.check = L2(u3), l3 = u3 = 0, r3.mode = 11;
case 11:
if (0 === r3.havedict)
return e8.next_out = a3, e8.avail_out = h3, e8.next_in = s3, e8.avail_in = o3, r3.hold = u3, r3.bits = l3, 2;
e8.adler = r3.check = 1, r3.mode = 12;
case 12:
if (5 === t6 || 6 === t6)
break e;
case 13:
if (r3.last) {
u3 >>>= 7 & l3, l3 -= 7 & l3, r3.mode = 27;
break;
}
for (; l3 < 3; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
switch (r3.last = 1 & u3, l3 -= 1, 3 & (u3 >>>= 1)) {
case 0:
r3.mode = 14;
break;
case 1:
if (j2(r3), r3.mode = 20, 6 !== t6)
break;
u3 >>>= 2, l3 -= 2;
break e;
case 2:
r3.mode = 17;
break;
case 3:
e8.msg = "invalid block type", r3.mode = 30;
}
u3 >>>= 2, l3 -= 2;
break;
case 14:
for (u3 >>>= 7 & l3, l3 -= 7 & l3; l3 < 32; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if ((65535 & u3) != (u3 >>> 16 ^ 65535)) {
e8.msg = "invalid stored block lengths", r3.mode = 30;
break;
}
if (r3.length = 65535 & u3, l3 = u3 = 0, r3.mode = 15, 6 === t6)
break e;
case 15:
r3.mode = 16;
case 16:
if (d2 = r3.length) {
if (o3 < d2 && (d2 = o3), h3 < d2 && (d2 = h3), 0 === d2)
break e;
I2.arraySet(i3, n3, s3, d2, a3), o3 -= d2, s3 += d2, h3 -= d2, a3 += d2, r3.length -= d2;
break;
}
r3.mode = 12;
break;
case 17:
for (; l3 < 14; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (r3.nlen = 257 + (31 & u3), u3 >>>= 5, l3 -= 5, r3.ndist = 1 + (31 & u3), u3 >>>= 5, l3 -= 5, r3.ncode = 4 + (15 & u3), u3 >>>= 4, l3 -= 4, 286 < r3.nlen || 30 < r3.ndist) {
e8.msg = "too many length or distance symbols", r3.mode = 30;
break;
}
r3.have = 0, r3.mode = 18;
case 18:
for (; r3.have < r3.ncode; ) {
for (; l3 < 3; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
r3.lens[A5[r3.have++]] = 7 & u3, u3 >>>= 3, l3 -= 3;
}
for (; r3.have < 19; )
r3.lens[A5[r3.have++]] = 0;
if (r3.lencode = r3.lendyn, r3.lenbits = 7, S2 = { bits: r3.lenbits }, x2 = T2(0, r3.lens, 0, 19, r3.lencode, 0, r3.work, S2), r3.lenbits = S2.bits, x2) {
e8.msg = "invalid code lengths set", r3.mode = 30;
break;
}
r3.have = 0, r3.mode = 19;
case 19:
for (; r3.have < r3.nlen + r3.ndist; ) {
for (; g2 = (C3 = r3.lencode[u3 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C3, !((_24 = C3 >>> 24) <= l3); ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (b2 < 16)
u3 >>>= _24, l3 -= _24, r3.lens[r3.have++] = b2;
else {
if (16 === b2) {
for (z2 = _24 + 2; l3 < z2; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (u3 >>>= _24, l3 -= _24, 0 === r3.have) {
e8.msg = "invalid bit length repeat", r3.mode = 30;
break;
}
k2 = r3.lens[r3.have - 1], d2 = 3 + (3 & u3), u3 >>>= 2, l3 -= 2;
} else if (17 === b2) {
for (z2 = _24 + 3; l3 < z2; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
l3 -= _24, k2 = 0, d2 = 3 + (7 & (u3 >>>= _24)), u3 >>>= 3, l3 -= 3;
} else {
for (z2 = _24 + 7; l3 < z2; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
l3 -= _24, k2 = 0, d2 = 11 + (127 & (u3 >>>= _24)), u3 >>>= 7, l3 -= 7;
}
if (r3.have + d2 > r3.nlen + r3.ndist) {
e8.msg = "invalid bit length repeat", r3.mode = 30;
break;
}
for (; d2--; )
r3.lens[r3.have++] = k2;
}
}
if (30 === r3.mode)
break;
if (0 === r3.lens[256]) {
e8.msg = "invalid code -- missing end-of-block", r3.mode = 30;
break;
}
if (r3.lenbits = 9, S2 = { bits: r3.lenbits }, x2 = T2(D2, r3.lens, 0, r3.nlen, r3.lencode, 0, r3.work, S2), r3.lenbits = S2.bits, x2) {
e8.msg = "invalid literal/lengths set", r3.mode = 30;
break;
}
if (r3.distbits = 6, r3.distcode = r3.distdyn, S2 = { bits: r3.distbits }, x2 = T2(F2, r3.lens, r3.nlen, r3.ndist, r3.distcode, 0, r3.work, S2), r3.distbits = S2.bits, x2) {
e8.msg = "invalid distances set", r3.mode = 30;
break;
}
if (r3.mode = 20, 6 === t6)
break e;
case 20:
r3.mode = 21;
case 21:
if (6 <= o3 && 258 <= h3) {
e8.next_out = a3, e8.avail_out = h3, e8.next_in = s3, e8.avail_in = o3, r3.hold = u3, r3.bits = l3, R2(e8, c3), a3 = e8.next_out, i3 = e8.output, h3 = e8.avail_out, s3 = e8.next_in, n3 = e8.input, o3 = e8.avail_in, u3 = r3.hold, l3 = r3.bits, 12 === r3.mode && (r3.back = -1);
break;
}
for (r3.back = 0; g2 = (C3 = r3.lencode[u3 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C3, !((_24 = C3 >>> 24) <= l3); ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (g2 && 0 == (240 & g2)) {
for (v2 = _24, y2 = g2, w2 = b2; g2 = (C3 = r3.lencode[w2 + ((u3 & (1 << v2 + y2) - 1) >> v2)]) >>> 16 & 255, b2 = 65535 & C3, !(v2 + (_24 = C3 >>> 24) <= l3); ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
u3 >>>= v2, l3 -= v2, r3.back += v2;
}
if (u3 >>>= _24, l3 -= _24, r3.back += _24, r3.length = b2, 0 === g2) {
r3.mode = 26;
break;
}
if (32 & g2) {
r3.back = -1, r3.mode = 12;
break;
}
if (64 & g2) {
e8.msg = "invalid literal/length code", r3.mode = 30;
break;
}
r3.extra = 15 & g2, r3.mode = 22;
case 22:
if (r3.extra) {
for (z2 = r3.extra; l3 < z2; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
r3.length += u3 & (1 << r3.extra) - 1, u3 >>>= r3.extra, l3 -= r3.extra, r3.back += r3.extra;
}
r3.was = r3.length, r3.mode = 23;
case 23:
for (; g2 = (C3 = r3.distcode[u3 & (1 << r3.distbits) - 1]) >>> 16 & 255, b2 = 65535 & C3, !((_24 = C3 >>> 24) <= l3); ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (0 == (240 & g2)) {
for (v2 = _24, y2 = g2, w2 = b2; g2 = (C3 = r3.distcode[w2 + ((u3 & (1 << v2 + y2) - 1) >> v2)]) >>> 16 & 255, b2 = 65535 & C3, !(v2 + (_24 = C3 >>> 24) <= l3); ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
u3 >>>= v2, l3 -= v2, r3.back += v2;
}
if (u3 >>>= _24, l3 -= _24, r3.back += _24, 64 & g2) {
e8.msg = "invalid distance code", r3.mode = 30;
break;
}
r3.offset = b2, r3.extra = 15 & g2, r3.mode = 24;
case 24:
if (r3.extra) {
for (z2 = r3.extra; l3 < z2; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
r3.offset += u3 & (1 << r3.extra) - 1, u3 >>>= r3.extra, l3 -= r3.extra, r3.back += r3.extra;
}
if (r3.offset > r3.dmax) {
e8.msg = "invalid distance too far back", r3.mode = 30;
break;
}
r3.mode = 25;
case 25:
if (0 === h3)
break e;
if (d2 = c3 - h3, r3.offset > d2) {
if ((d2 = r3.offset - d2) > r3.whave && r3.sane) {
e8.msg = "invalid distance too far back", r3.mode = 30;
break;
}
p2 = d2 > r3.wnext ? (d2 -= r3.wnext, r3.wsize - d2) : r3.wnext - d2, d2 > r3.length && (d2 = r3.length), m2 = r3.window;
} else
m2 = i3, p2 = a3 - r3.offset, d2 = r3.length;
for (h3 < d2 && (d2 = h3), h3 -= d2, r3.length -= d2; i3[a3++] = m2[p2++], --d2; )
;
0 === r3.length && (r3.mode = 21);
break;
case 26:
if (0 === h3)
break e;
i3[a3++] = r3.length, h3--, r3.mode = 21;
break;
case 27:
if (r3.wrap) {
for (; l3 < 32; ) {
if (0 === o3)
break e;
o3--, u3 |= n3[s3++] << l3, l3 += 8;
}
if (c3 -= h3, e8.total_out += c3, r3.total += c3, c3 && (e8.adler = r3.check = r3.flags ? B3(r3.check, i3, c3, a3 - c3) : O2(r3.check, i3, c3, a3 - c3)), c3 = h3, (r3.flags ? u3 : L2(u3)) !== r3.check) {
e8.msg = "incorrect data check", r3.mode = 30;
break;
}
l3 = u3 = 0;
}
r3.mode = 28;
case 28:
if (r3.wrap && r3.flags) {
for (; l3 < 32; ) {
if (0 === o3)
break e;
o3--, u3 += n3[s3++] << l3, l3 += 8;
}
if (u3 !== (4294967295 & r3.total)) {
e8.msg = "incorrect length check", r3.mode = 30;
break;
}
l3 = u3 = 0;
}
r3.mode = 29;
case 29:
x2 = 1;
break e;
case 30:
x2 = -3;
break e;
case 31:
return -4;
case 32:
default:
return U2;
}
return e8.next_out = a3, e8.avail_out = h3, e8.next_in = s3, e8.avail_in = o3, r3.hold = u3, r3.bits = l3, (r3.wsize || c3 !== e8.avail_out && r3.mode < 30 && (r3.mode < 27 || 4 !== t6)) && Z3(e8, e8.output, e8.next_out, c3 - e8.avail_out) ? (r3.mode = 31, -4) : (f3 -= e8.avail_in, c3 -= e8.avail_out, e8.total_in += f3, e8.total_out += c3, r3.total += c3, r3.wrap && c3 && (e8.adler = r3.check = r3.flags ? B3(r3.check, i3, c3, e8.next_out - c3) : O2(r3.check, i3, c3, e8.next_out - c3)), e8.data_type = r3.bits + (r3.last ? 64 : 0) + (12 === r3.mode ? 128 : 0) + (20 === r3.mode || 15 === r3.mode ? 256 : 0), (0 == f3 && 0 === c3 || 4 === t6) && x2 === N2 && (x2 = -5), x2);
}, r2.inflateEnd = function(e8) {
if (!e8 || !e8.state)
return U2;
var t6 = e8.state;
return t6.window && (t6.window = null), e8.state = null, N2;
}, r2.inflateGetHeader = function(e8, t6) {
var r3;
return e8 && e8.state ? 0 == (2 & (r3 = e8.state).wrap) ? U2 : ((r3.head = t6).done = false, N2) : U2;
}, r2.inflateSetDictionary = function(e8, t6) {
var r3, n3 = t6.length;
return e8 && e8.state ? 0 !== (r3 = e8.state).wrap && 11 !== r3.mode ? U2 : 11 === r3.mode && O2(1, t6, n3, 0) !== r3.check ? -3 : Z3(e8, t6, n3, n3) ? (r3.mode = 31, -4) : (r3.havedict = 1, N2) : U2;
}, r2.inflateInfo = "pako inflate (from Nodeca project)";
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(e7, t5, r2) {
var D2 = e7("../utils/common"), F2 = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], N2 = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], U2 = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], P2 = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
t5.exports = function(e8, t6, r3, n2, i2, s2, a2, o2) {
var h2, u2, l2, f2, c2, d2, p2, m2, _24, g2 = o2.bits, b2 = 0, v2 = 0, y2 = 0, w2 = 0, k2 = 0, x2 = 0, S2 = 0, z2 = 0, C3 = 0, E2 = 0, A5 = null, I2 = 0, O2 = new D2.Buf16(16), B3 = new D2.Buf16(16), R2 = null, T2 = 0;
for (b2 = 0; b2 <= 15; b2++)
O2[b2] = 0;
for (v2 = 0; v2 < n2; v2++)
O2[t6[r3 + v2]]++;
for (k2 = g2, w2 = 15; 1 <= w2 && 0 === O2[w2]; w2--)
;
if (w2 < k2 && (k2 = w2), 0 === w2)
return i2[s2++] = 20971520, i2[s2++] = 20971520, o2.bits = 1, 0;
for (y2 = 1; y2 < w2 && 0 === O2[y2]; y2++)
;
for (k2 < y2 && (k2 = y2), b2 = z2 = 1; b2 <= 15; b2++)
if (z2 <<= 1, (z2 -= O2[b2]) < 0)
return -1;
if (0 < z2 && (0 === e8 || 1 !== w2))
return -1;
for (B3[1] = 0, b2 = 1; b2 < 15; b2++)
B3[b2 + 1] = B3[b2] + O2[b2];
for (v2 = 0; v2 < n2; v2++)
0 !== t6[r3 + v2] && (a2[B3[t6[r3 + v2]]++] = v2);
if (d2 = 0 === e8 ? (A5 = R2 = a2, 19) : 1 === e8 ? (A5 = F2, I2 -= 257, R2 = N2, T2 -= 257, 256) : (A5 = U2, R2 = P2, -1), b2 = y2, c2 = s2, S2 = v2 = E2 = 0, l2 = -1, f2 = (C3 = 1 << (x2 = k2)) - 1, 1 === e8 && 852 < C3 || 2 === e8 && 592 < C3)
return 1;
for (; ; ) {
for (p2 = b2 - S2, _24 = a2[v2] < d2 ? (m2 = 0, a2[v2]) : a2[v2] > d2 ? (m2 = R2[T2 + a2[v2]], A5[I2 + a2[v2]]) : (m2 = 96, 0), h2 = 1 << b2 - S2, y2 = u2 = 1 << x2; i2[c2 + (E2 >> S2) + (u2 -= h2)] = p2 << 24 | m2 << 16 | _24 | 0, 0 !== u2; )
;
for (h2 = 1 << b2 - 1; E2 & h2; )
h2 >>= 1;
if (0 !== h2 ? (E2 &= h2 - 1, E2 += h2) : E2 = 0, v2++, 0 == --O2[b2]) {
if (b2 === w2)
break;
b2 = t6[r3 + a2[v2]];
}
if (k2 < b2 && (E2 & f2) !== l2) {
for (0 === S2 && (S2 = k2), c2 += y2, z2 = 1 << (x2 = b2 - S2); x2 + S2 < w2 && !((z2 -= O2[x2 + S2]) <= 0); )
x2++, z2 <<= 1;
if (C3 += 1 << x2, 1 === e8 && 852 < C3 || 2 === e8 && 592 < C3)
return 1;
i2[l2 = E2 & f2] = k2 << 24 | x2 << 16 | c2 - s2 | 0;
}
}
return 0 !== E2 && (i2[c2 + E2] = b2 - S2 << 24 | 64 << 16 | 0), o2.bits = k2, 0;
};
}, { "../utils/common": 41 }], 51: [function(e7, t5, r2) {
t5.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" };
}, {}], 52: [function(e7, t5, r2) {
var i2 = e7("../utils/common"), o2 = 0, h2 = 1;
function n2(e8) {
for (var t6 = e8.length; 0 <= --t6; )
e8[t6] = 0;
}
var s2 = 0, a2 = 29, u2 = 256, l2 = u2 + 1 + a2, f2 = 30, c2 = 19, _24 = 2 * l2 + 1, g2 = 15, d2 = 16, p2 = 7, m2 = 256, b2 = 16, v2 = 17, y2 = 18, w2 = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], k2 = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], x2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S2 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z2 = new Array(2 * (l2 + 2));
n2(z2);
var C3 = new Array(2 * f2);
n2(C3);
var E2 = new Array(512);
n2(E2);
var A5 = new Array(256);
n2(A5);
var I2 = new Array(a2);
n2(I2);
var O2, B3, R2, T2 = new Array(f2);
function D2(e8, t6, r3, n3, i3) {
this.static_tree = e8, this.extra_bits = t6, this.extra_base = r3, this.elems = n3, this.max_length = i3, this.has_stree = e8 && e8.length;
}
function F2(e8, t6) {
this.dyn_tree = e8, this.max_code = 0, this.stat_desc = t6;
}
function N2(e8) {
return e8 < 256 ? E2[e8] : E2[256 + (e8 >>> 7)];
}
function U2(e8, t6) {
e8.pending_buf[e8.pending++] = 255 & t6, e8.pending_buf[e8.pending++] = t6 >>> 8 & 255;
}
function P2(e8, t6, r3) {
e8.bi_valid > d2 - r3 ? (e8.bi_buf |= t6 << e8.bi_valid & 65535, U2(e8, e8.bi_buf), e8.bi_buf = t6 >> d2 - e8.bi_valid, e8.bi_valid += r3 - d2) : (e8.bi_buf |= t6 << e8.bi_valid & 65535, e8.bi_valid += r3);
}
function L2(e8, t6, r3) {
P2(e8, r3[2 * t6], r3[2 * t6 + 1]);
}
function j2(e8, t6) {
for (var r3 = 0; r3 |= 1 & e8, e8 >>>= 1, r3 <<= 1, 0 < --t6; )
;
return r3 >>> 1;
}
function Z3(e8, t6, r3) {
var n3, i3, s3 = new Array(g2 + 1), a3 = 0;
for (n3 = 1; n3 <= g2; n3++)
s3[n3] = a3 = a3 + r3[n3 - 1] << 1;
for (i3 = 0; i3 <= t6; i3++) {
var o3 = e8[2 * i3 + 1];
0 !== o3 && (e8[2 * i3] = j2(s3[o3]++, o3));
}
}
function W2(e8) {
var t6;
for (t6 = 0; t6 < l2; t6++)
e8.dyn_ltree[2 * t6] = 0;
for (t6 = 0; t6 < f2; t6++)
e8.dyn_dtree[2 * t6] = 0;
for (t6 = 0; t6 < c2; t6++)
e8.bl_tree[2 * t6] = 0;
e8.dyn_ltree[2 * m2] = 1, e8.opt_len = e8.static_len = 0, e8.last_lit = e8.matches = 0;
}
function M2(e8) {
8 < e8.bi_valid ? U2(e8, e8.bi_buf) : 0 < e8.bi_valid && (e8.pending_buf[e8.pending++] = e8.bi_buf), e8.bi_buf = 0, e8.bi_valid = 0;
}
function H4(e8, t6, r3, n3) {
var i3 = 2 * t6, s3 = 2 * r3;
return e8[i3] < e8[s3] || e8[i3] === e8[s3] && n3[t6] <= n3[r3];
}
function G2(e8, t6, r3) {
for (var n3 = e8.heap[r3], i3 = r3 << 1; i3 <= e8.heap_len && (i3 < e8.heap_len && H4(t6, e8.heap[i3 + 1], e8.heap[i3], e8.depth) && i3++, !H4(t6, n3, e8.heap[i3], e8.depth)); )
e8.heap[r3] = e8.heap[i3], r3 = i3, i3 <<= 1;
e8.heap[r3] = n3;
}
function K2(e8, t6, r3) {
var n3, i3, s3, a3, o3 = 0;
if (0 !== e8.last_lit)
for (; n3 = e8.pending_buf[e8.d_buf + 2 * o3] << 8 | e8.pending_buf[e8.d_buf + 2 * o3 + 1], i3 = e8.pending_buf[e8.l_buf + o3], o3++, 0 === n3 ? L2(e8, i3, t6) : (L2(e8, (s3 = A5[i3]) + u2 + 1, t6), 0 !== (a3 = w2[s3]) && P2(e8, i3 -= I2[s3], a3), L2(e8, s3 = N2(--n3), r3), 0 !== (a3 = k2[s3]) && P2(e8, n3 -= T2[s3], a3)), o3 < e8.last_lit; )
;
L2(e8, m2, t6);
}
function Y3(e8, t6) {
var r3, n3, i3, s3 = t6.dyn_tree, a3 = t6.stat_desc.static_tree, o3 = t6.stat_desc.has_stree, h3 = t6.stat_desc.elems, u3 = -1;
for (e8.heap_len = 0, e8.heap_max = _24, r3 = 0; r3 < h3; r3++)
0 !== s3[2 * r3] ? (e8.heap[++e8.heap_len] = u3 = r3, e8.depth[r3] = 0) : s3[2 * r3 + 1] = 0;
for (; e8.heap_len < 2; )
s3[2 * (i3 = e8.heap[++e8.heap_len] = u3 < 2 ? ++u3 : 0)] = 1, e8.depth[i3] = 0, e8.opt_len--, o3 && (e8.static_len -= a3[2 * i3 + 1]);
for (t6.max_code = u3, r3 = e8.heap_len >> 1; 1 <= r3; r3--)
G2(e8, s3, r3);
for (i3 = h3; r3 = e8.heap[1], e8.heap[1] = e8.heap[e8.heap_len--], G2(e8, s3, 1), n3 = e8.heap[1], e8.heap[--e8.heap_max] = r3, e8.heap[--e8.heap_max] = n3, s3[2 * i3] = s3[2 * r3] + s3[2 * n3], e8.depth[i3] = (e8.depth[r3] >= e8.depth[n3] ? e8.depth[r3] : e8.depth[n3]) + 1, s3[2 * r3 + 1] = s3[2 * n3 + 1] = i3, e8.heap[1] = i3++, G2(e8, s3, 1), 2 <= e8.heap_len; )
;
e8.heap[--e8.heap_max] = e8.heap[1], function(e9, t7) {
var r4, n4, i4, s4, a4, o4, h4 = t7.dyn_tree, u4 = t7.max_code, l3 = t7.stat_desc.static_tree, f3 = t7.stat_desc.has_stree, c3 = t7.stat_desc.extra_bits, d3 = t7.stat_desc.extra_base, p3 = t7.stat_desc.max_length, m3 = 0;
for (s4 = 0; s4 <= g2; s4++)
e9.bl_count[s4] = 0;
for (h4[2 * e9.heap[e9.heap_max] + 1] = 0, r4 = e9.heap_max + 1; r4 < _24; r4++)
p3 < (s4 = h4[2 * h4[2 * (n4 = e9.heap[r4]) + 1] + 1] + 1) && (s4 = p3, m3++), h4[2 * n4 + 1] = s4, u4 < n4 || (e9.bl_count[s4]++, a4 = 0, d3 <= n4 && (a4 = c3[n4 - d3]), o4 = h4[2 * n4], e9.opt_len += o4 * (s4 + a4), f3 && (e9.static_len += o4 * (l3[2 * n4 + 1] + a4)));
if (0 !== m3) {
do {
for (s4 = p3 - 1; 0 === e9.bl_count[s4]; )
s4--;
e9.bl_count[s4]--, e9.bl_count[s4 + 1] += 2, e9.bl_count[p3]--, m3 -= 2;
} while (0 < m3);
for (s4 = p3; 0 !== s4; s4--)
for (n4 = e9.bl_count[s4]; 0 !== n4; )
u4 < (i4 = e9.heap[--r4]) || (h4[2 * i4 + 1] !== s4 && (e9.opt_len += (s4 - h4[2 * i4 + 1]) * h4[2 * i4], h4[2 * i4 + 1] = s4), n4--);
}
}(e8, t6), Z3(s3, u3, e8.bl_count);
}
function X3(e8, t6, r3) {
var n3, i3, s3 = -1, a3 = t6[1], o3 = 0, h3 = 7, u3 = 4;
for (0 === a3 && (h3 = 138, u3 = 3), t6[2 * (r3 + 1) + 1] = 65535, n3 = 0; n3 <= r3; n3++)
i3 = a3, a3 = t6[2 * (n3 + 1) + 1], ++o3 < h3 && i3 === a3 || (o3 < u3 ? e8.bl_tree[2 * i3] += o3 : 0 !== i3 ? (i3 !== s3 && e8.bl_tree[2 * i3]++, e8.bl_tree[2 * b2]++) : o3 <= 10 ? e8.bl_tree[2 * v2]++ : e8.bl_tree[2 * y2]++, s3 = i3, u3 = (o3 = 0) === a3 ? (h3 = 138, 3) : i3 === a3 ? (h3 = 6, 3) : (h3 = 7, 4));
}
function V2(e8, t6, r3) {
var n3, i3, s3 = -1, a3 = t6[1], o3 = 0, h3 = 7, u3 = 4;
for (0 === a3 && (h3 = 138, u3 = 3), n3 = 0; n3 <= r3; n3++)
if (i3 = a3, a3 = t6[2 * (n3 + 1) + 1], !(++o3 < h3 && i3 === a3)) {
if (o3 < u3)
for (; L2(e8, i3, e8.bl_tree), 0 != --o3; )
;
else
0 !== i3 ? (i3 !== s3 && (L2(e8, i3, e8.bl_tree), o3--), L2(e8, b2, e8.bl_tree), P2(e8, o3 - 3, 2)) : o3 <= 10 ? (L2(e8, v2, e8.bl_tree), P2(e8, o3 - 3, 3)) : (L2(e8, y2, e8.bl_tree), P2(e8, o3 - 11, 7));
s3 = i3, u3 = (o3 = 0) === a3 ? (h3 = 138, 3) : i3 === a3 ? (h3 = 6, 3) : (h3 = 7, 4);
}
}
n2(T2);
var q2 = false;
function J2(e8, t6, r3, n3) {
P2(e8, (s2 << 1) + (n3 ? 1 : 0), 3), function(e9, t7, r4, n4) {
M2(e9), n4 && (U2(e9, r4), U2(e9, ~r4)), i2.arraySet(e9.pending_buf, e9.window, t7, r4, e9.pending), e9.pending += r4;
}(e8, t6, r3, true);
}
r2._tr_init = function(e8) {
q2 || (function() {
var e9, t6, r3, n3, i3, s3 = new Array(g2 + 1);
for (n3 = r3 = 0; n3 < a2 - 1; n3++)
for (I2[n3] = r3, e9 = 0; e9 < 1 << w2[n3]; e9++)
A5[r3++] = n3;
for (A5[r3 - 1] = n3, n3 = i3 = 0; n3 < 16; n3++)
for (T2[n3] = i3, e9 = 0; e9 < 1 << k2[n3]; e9++)
E2[i3++] = n3;
for (i3 >>= 7; n3 < f2; n3++)
for (T2[n3] = i3 << 7, e9 = 0; e9 < 1 << k2[n3] - 7; e9++)
E2[256 + i3++] = n3;
for (t6 = 0; t6 <= g2; t6++)
s3[t6] = 0;
for (e9 = 0; e9 <= 143; )
z2[2 * e9 + 1] = 8, e9++, s3[8]++;
for (; e9 <= 255; )
z2[2 * e9 + 1] = 9, e9++, s3[9]++;
for (; e9 <= 279; )
z2[2 * e9 + 1] = 7, e9++, s3[7]++;
for (; e9 <= 287; )
z2[2 * e9 + 1] = 8, e9++, s3[8]++;
for (Z3(z2, l2 + 1, s3), e9 = 0; e9 < f2; e9++)
C3[2 * e9 + 1] = 5, C3[2 * e9] = j2(e9, 5);
O2 = new D2(z2, w2, u2 + 1, l2, g2), B3 = new D2(C3, k2, 0, f2, g2), R2 = new D2(new Array(0), x2, 0, c2, p2);
}(), q2 = true), e8.l_desc = new F2(e8.dyn_ltree, O2), e8.d_desc = new F2(e8.dyn_dtree, B3), e8.bl_desc = new F2(e8.bl_tree, R2), e8.bi_buf = 0, e8.bi_valid = 0, W2(e8);
}, r2._tr_stored_block = J2, r2._tr_flush_block = function(e8, t6, r3, n3) {
var i3, s3, a3 = 0;
0 < e8.level ? (2 === e8.strm.data_type && (e8.strm.data_type = function(e9) {
var t7, r4 = 4093624447;
for (t7 = 0; t7 <= 31; t7++, r4 >>>= 1)
if (1 & r4 && 0 !== e9.dyn_ltree[2 * t7])
return o2;
if (0 !== e9.dyn_ltree[18] || 0 !== e9.dyn_ltree[20] || 0 !== e9.dyn_ltree[26])
return h2;
for (t7 = 32; t7 < u2; t7++)
if (0 !== e9.dyn_ltree[2 * t7])
return h2;
return o2;
}(e8)), Y3(e8, e8.l_desc), Y3(e8, e8.d_desc), a3 = function(e9) {
var t7;
for (X3(e9, e9.dyn_ltree, e9.l_desc.max_code), X3(e9, e9.dyn_dtree, e9.d_desc.max_code), Y3(e9, e9.bl_desc), t7 = c2 - 1; 3 <= t7 && 0 === e9.bl_tree[2 * S2[t7] + 1]; t7--)
;
return e9.opt_len += 3 * (t7 + 1) + 5 + 5 + 4, t7;
}(e8), i3 = e8.opt_len + 3 + 7 >>> 3, (s3 = e8.static_len + 3 + 7 >>> 3) <= i3 && (i3 = s3)) : i3 = s3 = r3 + 5, r3 + 4 <= i3 && -1 !== t6 ? J2(e8, t6, r3, n3) : 4 === e8.strategy || s3 === i3 ? (P2(e8, 2 + (n3 ? 1 : 0), 3), K2(e8, z2, C3)) : (P2(e8, 4 + (n3 ? 1 : 0), 3), function(e9, t7, r4, n4) {
var i4;
for (P2(e9, t7 - 257, 5), P2(e9, r4 - 1, 5), P2(e9, n4 - 4, 4), i4 = 0; i4 < n4; i4++)
P2(e9, e9.bl_tree[2 * S2[i4] + 1], 3);
V2(e9, e9.dyn_ltree, t7 - 1), V2(e9, e9.dyn_dtree, r4 - 1);
}(e8, e8.l_desc.max_code + 1, e8.d_desc.max_code + 1, a3 + 1), K2(e8, e8.dyn_ltree, e8.dyn_dtree)), W2(e8), n3 && M2(e8);
}, r2._tr_tally = function(e8, t6, r3) {
return e8.pending_buf[e8.d_buf + 2 * e8.last_lit] = t6 >>> 8 & 255, e8.pending_buf[e8.d_buf + 2 * e8.last_lit + 1] = 255 & t6, e8.pending_buf[e8.l_buf + e8.last_lit] = 255 & r3, e8.last_lit++, 0 === t6 ? e8.dyn_ltree[2 * r3]++ : (e8.matches++, t6--, e8.dyn_ltree[2 * (A5[r3] + u2 + 1)]++, e8.dyn_dtree[2 * N2(t6)]++), e8.last_lit === e8.lit_bufsize - 1;
}, r2._tr_align = function(e8) {
P2(e8, 2, 3), L2(e8, m2, z2), function(e9) {
16 === e9.bi_valid ? (U2(e9, e9.bi_buf), e9.bi_buf = 0, e9.bi_valid = 0) : 8 <= e9.bi_valid && (e9.pending_buf[e9.pending++] = 255 & e9.bi_buf, e9.bi_buf >>= 8, e9.bi_valid -= 8);
}(e8);
};
}, { "../utils/common": 41 }], 53: [function(e7, t5, r2) {
t5.exports = function() {
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
};
}, {}], 54: [function(e7, t5, r2) {
(function(e8) {
!function(r3, n2) {
if (!r3.setImmediate) {
var i2, s2, t6, a2, o2 = 1, h2 = {}, u2 = false, l2 = r3.document, e9 = Object.getPrototypeOf && Object.getPrototypeOf(r3);
e9 = e9 && e9.setTimeout ? e9 : r3, i2 = "[object process]" === {}.toString.call(r3.process) ? function(e11) {
process.nextTick(function() {
c2(e11);
});
} : function() {
if (r3.postMessage && !r3.importScripts) {
var e11 = true, t7 = r3.onmessage;
return r3.onmessage = function() {
e11 = false;
}, r3.postMessage("", "*"), r3.onmessage = t7, e11;
}
}() ? (a2 = "setImmediate$" + Math.random() + "$", r3.addEventListener ? r3.addEventListener("message", d2, false) : r3.attachEvent("onmessage", d2), function(e11) {
r3.postMessage(a2 + e11, "*");
}) : r3.MessageChannel ? ((t6 = new MessageChannel()).port1.onmessage = function(e11) {
c2(e11.data);
}, function(e11) {
t6.port2.postMessage(e11);
}) : l2 && "onreadystatechange" in l2.createElement("script") ? (s2 = l2.documentElement, function(e11) {
var t7 = l2.createElement("script");
t7.onreadystatechange = function() {
c2(e11), t7.onreadystatechange = null, s2.removeChild(t7), t7 = null;
}, s2.appendChild(t7);
}) : function(e11) {
setTimeout(c2, 0, e11);
}, e9.setImmediate = function(e11) {
"function" != typeof e11 && (e11 = new Function("" + e11));
for (var t7 = new Array(arguments.length - 1), r4 = 0; r4 < t7.length; r4++)
t7[r4] = arguments[r4 + 1];
var n3 = { callback: e11, args: t7 };
return h2[o2] = n3, i2(o2), o2++;
}, e9.clearImmediate = f2;
}
function f2(e11) {
delete h2[e11];
}
function c2(e11) {
if (u2)
setTimeout(c2, 0, e11);
else {
var t7 = h2[e11];
if (t7) {
u2 = true;
try {
!function(e12) {
var t8 = e12.callback, r4 = e12.args;
switch (r4.length) {
case 0:
t8();
break;
case 1:
t8(r4[0]);
break;
case 2:
t8(r4[0], r4[1]);
break;
case 3:
t8(r4[0], r4[1], r4[2]);
break;
default:
t8.apply(n2, r4);
}
}(t7);
} finally {
f2(e11), u2 = false;
}
}
}
}
function d2(e11) {
e11.source === r3 && "string" == typeof e11.data && 0 === e11.data.indexOf(a2) && c2(+e11.data.slice(a2.length));
}
}("undefined" == typeof self ? void 0 === e8 ? this : e8 : self);
}).call(this, "undefined" != typeof commonjsGlobal$1 ? commonjsGlobal$1 : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
}, {}] }, {}, [10])(10);
});
})(jszip_min);
var jszip_minExports = jszip_min.exports;
const JSZip = /* @__PURE__ */ getDefaultExportFromCjs(jszip_minExports);
var assertThisInitializedExports = requireAssertThisInitialized();
const n$9 = /* @__PURE__ */ getDefaultExportFromCjs(assertThisInitializedExports);
var possibleConstructorReturnExports = requirePossibleConstructorReturn();
const i$e = /* @__PURE__ */ getDefaultExportFromCjs(possibleConstructorReturnExports);
var getPrototypeOfExports = requireGetPrototypeOf();
const s$g = /* @__PURE__ */ getDefaultExportFromCjs(getPrototypeOfExports);
function asyncGeneratorStep(gen, resolve3, reject2, _next, _throw, key2, arg) {
try {
var info2 = gen[key2](arg);
var value2 = info2.value;
} catch (error3) {
reject2(error3);
return;
}
if (info2.done) {
resolve3(value2);
} else {
Promise.resolve(value2).then(_next, _throw);
}
}
function _asyncToGenerator(fn8) {
return function() {
var self2 = this, args = arguments;
return new Promise(function(resolve3, reject2) {
var gen = fn8.apply(self2, args);
function _next(value2) {
asyncGeneratorStep(gen, resolve3, reject2, _next, _throw, "next", value2);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve3, reject2, _next, _throw, "throw", err);
}
_next(void 0);
});
};
}
var regeneratorRuntime$1 = { exports: {} };
(function(module) {
var _typeof2 = require_typeof()["default"];
function _regeneratorRuntime() {
module.exports = _regeneratorRuntime = function _regeneratorRuntime2() {
return e7;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
var t5, e7 = {}, r2 = Object.prototype, n2 = r2.hasOwnProperty, o2 = Object.defineProperty || function(t6, e8, r3) {
t6[e8] = r3.value;
}, i2 = "function" == typeof Symbol ? Symbol : {}, a2 = i2.iterator || "@@iterator", c2 = i2.asyncIterator || "@@asyncIterator", u2 = i2.toStringTag || "@@toStringTag";
function define2(t6, e8, r3) {
return Object.defineProperty(t6, e8, {
value: r3,
enumerable: true,
configurable: true,
writable: true
}), t6[e8];
}
try {
define2({}, "");
} catch (t6) {
define2 = function define3(t7, e8, r3) {
return t7[e8] = r3;
};
}
function wrap2(t6, e8, r3, n3) {
var i3 = e8 && e8.prototype instanceof Generator ? e8 : Generator, a3 = Object.create(i3.prototype), c3 = new Context2(n3 || []);
return o2(a3, "_invoke", {
value: makeInvokeMethod(t6, r3, c3)
}), a3;
}
function tryCatch(t6, e8, r3) {
try {
return {
type: "normal",
arg: t6.call(e8, r3)
};
} catch (t7) {
return {
type: "throw",
arg: t7
};
}
}
e7.wrap = wrap2;
var h2 = "suspendedStart", l2 = "suspendedYield", f2 = "executing", s2 = "completed", y2 = {};
function Generator() {
}
function GeneratorFunction() {
}
function GeneratorFunctionPrototype() {
}
var p2 = {};
define2(p2, a2, function() {
return this;
});
var d2 = Object.getPrototypeOf, v2 = d2 && d2(d2(values2([])));
v2 && v2 !== r2 && n2.call(v2, a2) && (p2 = v2);
var g2 = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p2);
function defineIteratorMethods(t6) {
["next", "throw", "return"].forEach(function(e8) {
define2(t6, e8, function(t7) {
return this._invoke(e8, t7);
});
});
}
function AsyncIterator(t6, e8) {
function invoke2(r4, o3, i3, a3) {
var c3 = tryCatch(t6[r4], t6, o3);
if ("throw" !== c3.type) {
var u3 = c3.arg, h3 = u3.value;
return h3 && "object" == _typeof2(h3) && n2.call(h3, "__await") ? e8.resolve(h3.__await).then(function(t7) {
invoke2("next", t7, i3, a3);
}, function(t7) {
invoke2("throw", t7, i3, a3);
}) : e8.resolve(h3).then(function(t7) {
u3.value = t7, i3(u3);
}, function(t7) {
return invoke2("throw", t7, i3, a3);
});
}
a3(c3.arg);
}
var r3;
o2(this, "_invoke", {
value: function value2(t7, n3) {
function callInvokeWithMethodAndArg() {
return new e8(function(e9, r4) {
invoke2(t7, n3, e9, r4);
});
}
return r3 = r3 ? r3.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(e8, r3, n3) {
var o3 = h2;
return function(i3, a3) {
if (o3 === f2)
throw new Error("Generator is already running");
if (o3 === s2) {
if ("throw" === i3)
throw a3;
return {
value: t5,
done: true
};
}
for (n3.method = i3, n3.arg = a3; ; ) {
var c3 = n3.delegate;
if (c3) {
var u3 = maybeInvokeDelegate(c3, n3);
if (u3) {
if (u3 === y2)
continue;
return u3;
}
}
if ("next" === n3.method)
n3.sent = n3._sent = n3.arg;
else if ("throw" === n3.method) {
if (o3 === h2)
throw o3 = s2, n3.arg;
n3.dispatchException(n3.arg);
} else
"return" === n3.method && n3.abrupt("return", n3.arg);
o3 = f2;
var p3 = tryCatch(e8, r3, n3);
if ("normal" === p3.type) {
if (o3 = n3.done ? s2 : l2, p3.arg === y2)
continue;
return {
value: p3.arg,
done: n3.done
};
}
"throw" === p3.type && (o3 = s2, n3.method = "throw", n3.arg = p3.arg);
}
};
}
function maybeInvokeDelegate(e8, r3) {
var n3 = r3.method, o3 = e8.iterator[n3];
if (o3 === t5)
return r3.delegate = null, "throw" === n3 && e8.iterator["return"] && (r3.method = "return", r3.arg = t5, maybeInvokeDelegate(e8, r3), "throw" === r3.method) || "return" !== n3 && (r3.method = "throw", r3.arg = new TypeError("The iterator does not provide a '" + n3 + "' method")), y2;
var i3 = tryCatch(o3, e8.iterator, r3.arg);
if ("throw" === i3.type)
return r3.method = "throw", r3.arg = i3.arg, r3.delegate = null, y2;
var a3 = i3.arg;
return a3 ? a3.done ? (r3[e8.resultName] = a3.value, r3.next = e8.nextLoc, "return" !== r3.method && (r3.method = "next", r3.arg = t5), r3.delegate = null, y2) : a3 : (r3.method = "throw", r3.arg = new TypeError("iterator result is not an object"), r3.delegate = null, y2);
}
function pushTryEntry(t6) {
var e8 = {
tryLoc: t6[0]
};
1 in t6 && (e8.catchLoc = t6[1]), 2 in t6 && (e8.finallyLoc = t6[2], e8.afterLoc = t6[3]), this.tryEntries.push(e8);
}
function resetTryEntry(t6) {
var e8 = t6.completion || {};
e8.type = "normal", delete e8.arg, t6.completion = e8;
}
function Context2(t6) {
this.tryEntries = [{
tryLoc: "root"
}], t6.forEach(pushTryEntry, this), this.reset(true);
}
function values2(e8) {
if (e8 || "" === e8) {
var r3 = e8[a2];
if (r3)
return r3.call(e8);
if ("function" == typeof e8.next)
return e8;
if (!isNaN(e8.length)) {
var o3 = -1, i3 = function next2() {
for (; ++o3 < e8.length; )
if (n2.call(e8, o3))
return next2.value = e8[o3], next2.done = false, next2;
return next2.value = t5, next2.done = true, next2;
};
return i3.next = i3;
}
}
throw new TypeError(_typeof2(e8) + " is not iterable");
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o2(g2, "constructor", {
value: GeneratorFunctionPrototype,
configurable: true
}), o2(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: true
}), GeneratorFunction.displayName = define2(GeneratorFunctionPrototype, u2, "GeneratorFunction"), e7.isGeneratorFunction = function(t6) {
var e8 = "function" == typeof t6 && t6.constructor;
return !!e8 && (e8 === GeneratorFunction || "GeneratorFunction" === (e8.displayName || e8.name));
}, e7.mark = function(t6) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t6, GeneratorFunctionPrototype) : (t6.__proto__ = GeneratorFunctionPrototype, define2(t6, u2, "GeneratorFunction")), t6.prototype = Object.create(g2), t6;
}, e7.awrap = function(t6) {
return {
__await: t6
};
}, defineIteratorMethods(AsyncIterator.prototype), define2(AsyncIterator.prototype, c2, function() {
return this;
}), e7.AsyncIterator = AsyncIterator, e7.async = function(t6, r3, n3, o3, i3) {
void 0 === i3 && (i3 = Promise);
var a3 = new AsyncIterator(wrap2(t6, r3, n3, o3), i3);
return e7.isGeneratorFunction(r3) ? a3 : a3.next().then(function(t7) {
return t7.done ? t7.value : a3.next();
});
}, defineIteratorMethods(g2), define2(g2, u2, "Generator"), define2(g2, a2, function() {
return this;
}), define2(g2, "toString", function() {
return "[object Generator]";
}), e7.keys = function(t6) {
var e8 = Object(t6), r3 = [];
for (var n3 in e8)
r3.push(n3);
return r3.reverse(), function next2() {
for (; r3.length; ) {
var t7 = r3.pop();
if (t7 in e8)
return next2.value = t7, next2.done = false, next2;
}
return next2.done = true, next2;
};
}, e7.values = values2, Context2.prototype = {
constructor: Context2,
reset: function reset2(e8) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = t5, this.done = false, this.delegate = null, this.method = "next", this.arg = t5, this.tryEntries.forEach(resetTryEntry), !e8)
for (var r3 in this)
"t" === r3.charAt(0) && n2.call(this, r3) && !isNaN(+r3.slice(1)) && (this[r3] = t5);
},
stop: function stop2() {
this.done = true;
var t6 = this.tryEntries[0].completion;
if ("throw" === t6.type)
throw t6.arg;
return this.rval;
},
dispatchException: function dispatchException(e8) {
if (this.done)
throw e8;
var r3 = this;
function handle2(n3, o4) {
return a3.type = "throw", a3.arg = e8, r3.next = n3, o4 && (r3.method = "next", r3.arg = t5), !!o4;
}
for (var o3 = this.tryEntries.length - 1; o3 >= 0; --o3) {
var i3 = this.tryEntries[o3], a3 = i3.completion;
if ("root" === i3.tryLoc)
return handle2("end");
if (i3.tryLoc <= this.prev) {
var c3 = n2.call(i3, "catchLoc"), u3 = n2.call(i3, "finallyLoc");
if (c3 && u3) {
if (this.prev < i3.catchLoc)
return handle2(i3.catchLoc, true);
if (this.prev < i3.finallyLoc)
return handle2(i3.finallyLoc);
} else if (c3) {
if (this.prev < i3.catchLoc)
return handle2(i3.catchLoc, true);
} else {
if (!u3)
throw new Error("try statement without catch or finally");
if (this.prev < i3.finallyLoc)
return handle2(i3.finallyLoc);
}
}
}
},
abrupt: function abrupt(t6, e8) {
for (var r3 = this.tryEntries.length - 1; r3 >= 0; --r3) {
var o3 = this.tryEntries[r3];
if (o3.tryLoc <= this.prev && n2.call(o3, "finallyLoc") && this.prev < o3.finallyLoc) {
var i3 = o3;
break;
}
}
i3 && ("break" === t6 || "continue" === t6) && i3.tryLoc <= e8 && e8 <= i3.finallyLoc && (i3 = null);
var a3 = i3 ? i3.completion : {};
return a3.type = t6, a3.arg = e8, i3 ? (this.method = "next", this.next = i3.finallyLoc, y2) : this.complete(a3);
},
complete: function complete(t6, e8) {
if ("throw" === t6.type)
throw t6.arg;
return "break" === t6.type || "continue" === t6.type ? this.next = t6.arg : "return" === t6.type ? (this.rval = this.arg = t6.arg, this.method = "return", this.next = "end") : "normal" === t6.type && e8 && (this.next = e8), y2;
},
finish: function finish(t6) {
for (var e8 = this.tryEntries.length - 1; e8 >= 0; --e8) {
var r3 = this.tryEntries[e8];
if (r3.finallyLoc === t6)
return this.complete(r3.completion, r3.afterLoc), resetTryEntry(r3), y2;
}
},
"catch": function _catch(t6) {
for (var e8 = this.tryEntries.length - 1; e8 >= 0; --e8) {
var r3 = this.tryEntries[e8];
if (r3.tryLoc === t6) {
var n3 = r3.completion;
if ("throw" === n3.type) {
var o3 = n3.arg;
resetTryEntry(r3);
}
return o3;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function delegateYield(e8, r3, n3) {
return this.delegate = {
iterator: values2(e8),
resultName: r3,
nextLoc: n3
}, "next" === this.method && (this.arg = t5), y2;
}
}, e7;
}
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(regeneratorRuntime$1);
var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
var runtime$1 = regeneratorRuntimeExports();
var regenerator = runtime$1;
try {
regeneratorRuntime = runtime$1;
} catch (accidentalStrictMode) {
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime$1;
} else {
Function("r", "regeneratorRuntime = r")(runtime$1);
}
}
const m$k = /* @__PURE__ */ getDefaultExportFromCjs(regenerator);
var f$4 = "object" === ("undefined" == typeof window || "undefined" == typeof window ? "undefined" : _typeof$3(window)), v$3 = f$4 ? document : {}, g$1 = ["mousemove", "keydown", "wheel", "DOMMouseScroll", "mousewheel", "mousedown", "touchstart", "touchmove", "MSPointerDown", "MSPointerMove", "visibilitychange"];
function b$3(e7, t5) {
var n2;
function r2() {
for (var r3 = arguments.length, i2 = new Array(r3), s2 = 0; s2 < r3; s2++)
i2[s2] = arguments[s2];
n2 && clearTimeout(n2), n2 = setTimeout(function() {
e7.apply(void 0, i2), n2 = null;
}, t5);
}
return r2.cancel = function() {
clearTimeout(n2);
}, r2;
}
function T$4(e7, t5) {
var n2 = 0;
return function() {
var r2 = (/* @__PURE__ */ new Date()).getTime();
if (!(r2 - n2 < t5))
return n2 = r2, e7.apply(void 0, arguments);
};
}
var _$3 = 0, y$9 = 0;
function w$3() {
var e7 = (/* @__PURE__ */ new Date()).getTime();
return e7 === _$3 ? 1e3 * e7 + ++y$9 : (_$3 = e7, y$9 = 0, 1e3 * e7);
}
function k$2() {
return Math.random().toString(36).substring(2);
}
function A$4() {
var e7 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return new Promise(function(t5) {
return setTimeout(t5, e7);
});
}
function I$2() {
return (/* @__PURE__ */ new Date()).getTime();
}
var E$4 = { create: function(e7) {
var t5 = { messagesCallback: null, bc: new BroadcastChannel(e7) };
return t5.bc.onmessage = function(e8) {
t5.messagesCallback && t5.messagesCallback(e8.data);
}, t5;
}, close: function(e7) {
e7.bc.close();
}, onMessage: function(e7, t5) {
e7.messagesCallback = t5;
}, postMessage: function(e7, t5) {
try {
return e7.bc.postMessage(t5, false), Promise.resolve();
} catch (e8) {
return Promise.reject(e8);
}
}, canBeUsed: function() {
return "function" == typeof BroadcastChannel;
}, type: "broadcastChannel", averageResponseTime: function() {
return 150;
}, microSeconds: w$3 }, L$3 = function() {
function n2() {
var t5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 6e4;
_classCallCheck$1(this, n2), this.ttl = t5, this.set = /* @__PURE__ */ new Set(), this.timeMap = /* @__PURE__ */ new Map();
}
return _createClass(n2, [{ key: "has", value: function(e7) {
return this.set.has(e7);
} }, { key: "add", value: function(e7) {
this.timeMap.set(e7, I$2()), this.set.add(e7), this._removeTooOldValues();
} }, { key: "clear", value: function() {
this.set.clear(), this.timeMap.clear();
} }, { key: "_removeTooOldValues", value: function() {
for (var e7 = I$2() - this.ttl, t5 = this.set[Symbol.iterator](); ; ) {
var n3 = t5.next().value;
if (!n3)
return;
if (!(this.timeMap.get(n3) < e7))
return;
this.timeMap.delete(n3), this.set.delete(n3);
}
} }]), n2;
}();
function O$3() {
var e7;
if ("undefined" == typeof window)
return null;
try {
e7 = window.localStorage, e7 = window["ie8-eventlistener/storage"] || window.localStorage;
} catch (e8) {
}
return e7;
}
function M$8(e7, t5) {
var n2 = e7, r2 = function(e8) {
e8.key === n2 && t5(JSON.parse(e8.newValue));
};
return window.addEventListener("storage", r2), r2;
}
function D$4() {
var e7 = O$3();
if (!e7)
return false;
try {
var t5 = "__check";
e7.setItem(t5, "works"), e7.removeItem(t5);
} catch (e8) {
return false;
}
return true;
}
var S$2 = { create: function(e7) {
var t5 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if (!D$4())
throw new Error("❌ localStorage cannot be used.");
var n2 = k$2(), r2 = new L$3(t5.removeTimeout), i2 = { channelName: e7, uuid: n2, eMIs: r2 };
return i2.listener = M$8(e7, function(e8) {
i2.messagesCallback && e8.uuid !== n2 && e8.token && !r2.has(e8.token) && (e8.data.time && e8.data.time < i2.messagesCallbackTime || (r2.add(e8.token), i2.messagesCallback(e8.data)));
}), i2;
}, close: function(e7) {
var t5;
t5 = e7.listener, window.removeEventListener("storage", t5);
}, onMessage: function(e7, t5, n2) {
e7.messagesCallbackTime = n2, e7.messagesCallback = t5;
}, postMessage: function(e7, t5) {
return new Promise(function(n2) {
var r2 = e7.channelName, i2 = { token: k$2(), time: (/* @__PURE__ */ new Date()).getTime(), data: t5, uuid: e7.uuid }, s2 = JSON.stringify(i2);
O$3().setItem(r2, s2);
var a2 = document.createEvent("Event");
a2.initEvent("storage", true, true), a2.key = r2, a2.newValue = s2, window.dispatchEvent(a2), n2();
});
}, canBeUsed: D$4, type: "localStorage", averageResponseTime: function() {
var e7 = navigator.userAgent.toLowerCase();
return e7.includes("safari") && !e7.includes("chrome") ? 240 : 120;
}, microSeconds: w$3 }, P$2 = /* @__PURE__ */ new Set();
var C$4 = { create: function(e7) {
var t5 = { name: e7, messagesCallback: null };
return P$2.add(t5), t5;
}, close: function(e7) {
P$2.delete(e7);
}, onMessage: function(e7, t5) {
e7.messagesCallback = t5;
}, postMessage: function(e7, t5) {
return new Promise(function(n2) {
return setTimeout(function() {
Array.from(P$2).filter(function(t6) {
return t6.name === e7.name;
}).filter(function(t6) {
return t6 !== e7;
}).filter(function(e8) {
return !!e8.messagesCallback;
}).forEach(function(e8) {
return e8.messagesCallback(t5);
}), n2();
}, 5);
});
}, canBeUsed: function() {
return true;
}, type: "simulate", averageResponseTime: function() {
return 5;
}, microSeconds: w$3 }, x$7 = [E$4, S$2];
function B$4() {
var e7 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
if (e7.type) {
if ("simulate" === e7.type)
return C$4;
var t5 = x$7.find(function(t6) {
return t6.type === e7.type;
});
if (t5)
return t5;
throw new Error("❌ Method ".concat(e7.type, " is not supported."));
}
var n2 = x$7.find(function(e8) {
return e8.canBeUsed();
});
if (!n2)
throw new Error("❌ No method found ".concat(JSON.stringify(x$7.map(function(e8) {
return e8.type;
}))));
return n2;
}
var R$2 = function() {
function n2(t5) {
var r2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
_classCallCheck$1(this, n2), this.name = t5, this.options = r2, this.method = B$4(this.options), this.closed = false, this._isListening = false, this._onMessageListener = null, this._addEventListeners = { message: [], internal: [] }, this._unSendMessagePromises = /* @__PURE__ */ new Set(), this._beforeClose = [], this._preparePromises = null, j$2(this);
}
return _createClass(n2, [{ key: "postMessage", value: function(e7) {
if (this.closed)
throw new Error("❌ Cannot post message after channel has closed");
return N$3(this, "message", e7);
} }, { key: "postInternal", value: function(e7) {
return N$3(this, "internal", e7);
} }, { key: "onmessage", get: function() {
return this._onMessageListener;
}, set: function(e7) {
var t5 = { time: this.method.microSeconds(), fn: e7 };
U$3(this, "message", this._onMessageListener), e7 && "function" == typeof e7 ? (this._onMessageListener = t5, Y$3(this, "message", t5)) : this._onMessageListener = null;
} }, { key: "addEventListener", value: function(e7, t5) {
Y$3(this, e7, { time: this.method.microSeconds(), fn: t5 });
} }, { key: "removeEventListener", value: function(e7, t5) {
U$3(this, e7, this._addEventListeners[e7].find(function(e8) {
return e8.fn === t5;
}));
} }, { key: "close", value: function() {
var e7 = this;
if (!this.closed) {
this.closed = true;
var t5 = this._preparePromises ? this._preparePromises : Promise.resolve();
return this._onMessageListener = null, this._addEventListeners.message = [], t5.then(function() {
return Promise.all(Array.from(e7._unSendMessagePromises));
}).then(function() {
return Promise.all(e7._beforeClose.map(function(e8) {
return e8();
}));
}).then(function() {
return e7.method.close(e7._state);
});
}
} }, { key: "type", get: function() {
return this.method.type;
} }, { key: "isClosed", value: function() {
return this.closed;
} }]), n2;
}();
function N$3(e7, t5, n2) {
var r2 = { time: e7.method.microSeconds(), type: t5, data: n2 };
return (e7._preparePromises ? e7._preparePromises : Promise.resolve()).then(function() {
var t6 = e7.method.postMessage(e7._state, r2);
return e7._unSendMessagePromises.add(t6), t6.catch().then(function() {
return e7._unSendMessagePromises.delete(t6);
}), t6;
});
}
function j$2(e7) {
var t5, n2 = e7.method.create(e7.name, e7.options);
(t5 = n2) && "function" == typeof t5.then ? (e7._preparePromises = n2, n2.then(function(t6) {
e7._state = t6;
})) : e7._state = n2;
}
function X$3(e7) {
return e7._addEventListeners.message.length > 0 || e7._addEventListeners.internal.length > 0;
}
function Y$3(e7, t5, n2) {
e7._addEventListeners[t5].push(n2), function(e8) {
if (!e8._isListening && X$3(e8)) {
var t6 = function(t7) {
e8._addEventListeners[t7.type].forEach(function(e9) {
t7.time >= e9.time && e9.fn(t7.data);
});
}, n3 = e8.method.microSeconds();
e8._preparePromises ? e8._preparePromises.then(function() {
e8._isListening = true, e8.method.onMessage(e8._state, t6, n3);
}) : (e8._isListening = true, e8.method.onMessage(e8._state, t6, n3));
}
}(e7);
}
function U$3(e7, t5, n2) {
e7._addEventListeners[t5] = e7._addEventListeners[t5].filter(function(e8) {
return e8 !== n2;
}), function(e8) {
if (e8._isListening && !X$3(e8)) {
e8._isListening = false;
var t6 = e8.method.microSeconds();
e8.method.onMessage(e8._state, null, t6);
}
}(e7);
}
var F$3 = function() {
function n2(t5, r3) {
var i2 = this;
_classCallCheck$1(this, n2), this._channel = t5, this._options = r3, this.isLeader = false, this.isDead = false, this.token = k$2(), this._isApplying = false, this._reApply = false, this._unloadFns = [], this._listeners = [], this._intervals = [], this._duplicateListeners = function() {
}, this._duplicateCalled = false, this._onBeforeDie = _asyncToGenerator(m$k.mark(function e7() {
return m$k.wrap(function(e8) {
for (; ; )
switch (e8.prev = e8.next) {
case 0:
case "end":
return e8.stop();
}
}, e7);
}));
var s2 = function() {
var e7 = _asyncToGenerator(m$k.mark(function e8() {
return m$k.wrap(function(e9) {
for (; ; )
switch (e9.prev = e9.next) {
case 0:
return e9.abrupt("return", i2.die());
case 1:
case "end":
return e9.stop();
}
}, e8);
}));
return function() {
return e7.apply(this, arguments);
};
}();
f$4 && (window.addEventListener("beforeUnload", s2), window.addEventListener("unload", s2), this._unloadFns.push(["beforeUnload", s2]), this._unloadFns.push(["unload", s2]));
}
var r2;
return _createClass(n2, [{ key: "applyOnce", value: function() {
var e7 = this;
if (this.isLeader)
return Promise.resolve(false);
if (this.isDead)
return Promise.resolve(false);
if (this._isApplying)
return this._reApply = true, Promise.resolve(false);
this._isApplying = true;
var t5 = false, n3 = function(n4) {
"leader" === n4.context && n4.token !== e7.token && ("apply" === n4.action && n4.token > e7.token && (t5 = true), "tell" === n4.action && (t5 = true));
};
return this._channel.addEventListener("internal", n3), V$3(this, "apply").then(function() {
return A$4(e7._options.responseTime);
}).then(function() {
return t5 ? Promise.reject(new Error()) : V$3(e7, "apply");
}).then(function() {
return A$4(e7._options.responseTime);
}).then(function() {
return t5 ? Promise.reject(new Error()) : V$3(e7);
}).then(function() {
return function(e8) {
e8.isLeader = true;
var t6 = function(t7) {
"leader" === t7.context && "apply" === t7.action && V$3(e8, "tell"), "leader" !== t7.context || "tell" !== t7.action || e8._duplicateCalled || (e8._duplicateCalled = true, e8._duplicateListeners(), V$3(e8, "tell"));
};
return e8._channel.addEventListener("internal", t6), e8._listeners.push(t6), V$3(e8, "tell");
}(e7);
}).then(function() {
return true;
}).catch(function() {
return false;
}).then(function(t6) {
return e7._channel.removeEventListener("internal", n3), e7._isApplying = false, !t6 && e7._reApply ? (e7._reApply = false, e7.applyOnce()) : t6;
});
} }, { key: "awaitLeadership", value: function() {
var e7;
return this._awaitLeadershipPromise || (this._awaitLeadershipPromise = (e7 = this).isLeader ? Promise.resolve() : new Promise(function(t5) {
var n3 = false;
function r3() {
n3 || (n3 = true, clearInterval(i2), e7._channel.removeEventListener("internal", s2), t5(true));
}
e7.applyOnce().then(function() {
e7.isLeader && r3();
});
var i2 = setInterval(function() {
e7.applyOnce().then(function() {
e7.isLeader && r3();
});
}, e7._options.fallbackInterval);
e7._intervals.push(i2);
var s2 = function(t6) {
"leader" === t6.context && "death" === t6.action && e7.applyOnce().then(function() {
e7.isLeader && r3();
});
};
e7._channel.addEventListener("internal", s2), e7._listeners.push(s2);
})), this._awaitLeadershipPromise;
} }, { key: "onDuplicate", get: function() {
return this._duplicateListeners;
}, set: function(e7) {
this._duplicateListeners = e7;
} }, { key: "onBeforeDie", get: function() {
return this._onBeforeDie;
}, set: function(e7) {
this._onBeforeDie = e7;
} }, { key: "die", value: (r2 = _asyncToGenerator(m$k.mark(function e7() {
var t5 = this;
return m$k.wrap(function(e8) {
for (; ; )
switch (e8.prev = e8.next) {
case 0:
if (!this.isDead) {
e8.next = 2;
break;
}
return e8.abrupt("return");
case 2:
return this.isDead = true, e8.next = 5, this.onBeforeDie();
case 5:
return this._listeners.forEach(function(e9) {
return t5._channel.removeEventListener("internal", e9);
}), this._intervals.forEach(function(e9) {
return clearInterval(e9);
}), this._unloadFns.forEach(function(e9) {
f$4 && window.removeEventListener(e9[0], e9[1]);
}), e8.abrupt("return", V$3(this, "death"));
case 9:
case "end":
return e8.stop();
}
}, e7, this);
})), function() {
return r2.apply(this, arguments);
}) }]), n2;
}();
function V$3(e7, t5) {
var n2 = { context: "leader", action: t5, token: e7.token };
return e7._channel.postInternal(n2);
}
var J$2 = function(e7) {
var t5 = e7.type, n2 = e7.channelName, r2 = e7.fallbackInterval, i2 = e7.responseTime, s2 = e7.emitOnAllTabs, a2 = e7.callbacks, o2 = e7.start, u2 = e7.reset, c2 = e7.pause, l2 = e7.resume, p2 = new R$2(n2, { type: t5 }), f2 = function(e8, t6) {
if (e8._leaderElector)
throw new Error("❌ MessageChannel already has a leader-elector");
var n3 = new F$3(e8, t6);
return e8._beforeClose.push(_asyncToGenerator(m$k.mark(function e9() {
return m$k.wrap(function(e11) {
for (; ; )
switch (e11.prev = e11.next) {
case 0:
return e11.abrupt("return", n3.die());
case 1:
case "end":
return e11.stop();
}
}, e9);
}))), e8._leaderElector = n3, n3;
}(p2, { fallbackInterval: r2, responseTime: i2 }), v2 = {};
v2[f2.token] = false;
var g2 = false, b2 = true, T2 = function() {
return g2;
};
f2.awaitLeadership().then(function() {
g2 = true;
}), p2.addEventListener("message", function(e8) {
var t6 = _slicedToArray$2(e8, 2), n3 = t6[0], r3 = t6[1];
switch (n3) {
case "register":
v2[r3] = false;
break;
case "deregister":
delete v2[r3];
break;
case "idle":
_24(r3);
break;
case "active":
y2(r3);
break;
case "emitIdle":
a2.onIdle();
break;
case "emitActive":
a2.onActive();
break;
case "start":
o2(true);
break;
case "reset":
u2(true);
break;
case "pause":
c2(true);
break;
case "resume":
l2(true);
}
});
var _24 = function() {
var e8 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : f2.token;
v2[e8] = true;
var t6 = Object.values(v2).every(function(e9) {
return e9;
});
!b2 && t6 && (b2 = true, T2() ? (a2.onIdle(), s2 && w2("emitIdle")) : w2("idle"));
}, y2 = function() {
var e8 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : f2.token;
v2[e8] = false;
var t6 = Object.values(v2).some(function(e9) {
return !e9;
});
b2 && t6 && (b2 = false, T2() ? (a2.onActive(), s2 && w2("emitActive")) : w2("active"));
};
f2.onDuplicate = _asyncToGenerator(m$k.mark(function e8() {
return m$k.wrap(function(e9) {
for (; ; )
switch (e9.prev = e9.next) {
case 0:
return e9.next = 2, f2.die();
case 2:
return e9.abrupt("return", e9.sent);
case 3:
case "end":
return e9.stop();
}
}, e8);
})), f2.onBeforeDie = _asyncToGenerator(m$k.mark(function e8() {
return m$k.wrap(function(e9) {
for (; ; )
switch (e9.prev = e9.next) {
case 0:
return e9.next = 2, w2("deregister");
case 2:
return e9.abrupt("return", e9.sent);
case 3:
case "end":
return e9.stop();
}
}, e8);
}));
var w2 = function() {
var e8 = _asyncToGenerator(m$k.mark(function e9(t6) {
return m$k.wrap(function(e11) {
for (; ; )
switch (e11.prev = e11.next) {
case 0:
return e11.abrupt("return", p2.postMessage([t6, f2.token]));
case 1:
case "end":
return e11.stop();
}
}, e9);
}));
return function(t6) {
return e8.apply(this, arguments);
};
}(), k2 = function() {
var e8 = _asyncToGenerator(m$k.mark(function e9() {
return m$k.wrap(function(e11) {
for (; ; )
switch (e11.prev = e11.next) {
case 0:
return e11.next = 2, f2.die();
case 2:
return e11.next = 4, p2.close();
case 4:
case "end":
return e11.stop();
}
}, e9);
}));
return function() {
return e8.apply(this, arguments);
};
}();
return w2("register"), { close: k2, send: w2, isLeader: T2, idle: _24, active: y2, isAllIdle: function() {
return b2;
}, setAllIdle: function(e8) {
b2 = e8;
} };
};
function z$4(e7) {
var t5 = function() {
if ("undefined" == typeof Reflect || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if ("function" == typeof Proxy)
return true;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), true;
} catch (e8) {
return false;
}
}();
return function() {
var n2, r2 = s$g(e7);
if (t5) {
var a2 = s$g(this).constructor;
n2 = Reflect.construct(r2, arguments, a2);
} else
n2 = r2.apply(this, arguments);
return i$e(this, n2);
};
}
var G$2 = function(i2) {
r$o(o2, reactExports.Component);
var s2 = z$4(o2);
function o2(t5) {
var r2;
if (_classCallCheck$1(this, o2), (r2 = s2.call(this, t5)).state = { idle: false, oldDate: +/* @__PURE__ */ new Date(), lastActive: +/* @__PURE__ */ new Date(), lastIdle: null, idleTime: 0, remaining: null, pageX: null, pageY: null }, r2.tId = null, r2.eventsBound = false, r2.callbackRefs = {}, t5.debounce > 0 && t5.throttle > 0)
throw new Error("onAction can either be throttled or debounced (not both)");
return t5.debounce > 0 ? r2._onAction = b$3(t5.onAction, t5.debounce) : t5.throttle > 0 ? r2._onAction = T$4(t5.onAction, t5.throttle) : r2._onAction = t5.onAction, t5.eventsThrottle > 0 ? r2.handleEvent = T$4(r2._handleEvent.bind(n$9(r2)), t5.eventsThrottle) : r2.handleEvent = r2._handleEvent.bind(n$9(r2)), t5.startOnMount && !t5.startManually || (r2.state.idle = true), r2._toggleIdleState = r2._toggleIdleState.bind(n$9(r2)), r2.start = r2.start.bind(n$9(r2)), r2.reset = r2.reset.bind(n$9(r2)), r2.pause = r2.pause.bind(n$9(r2)), r2.resume = r2.resume.bind(n$9(r2)), r2.isIdle = r2.isIdle.bind(n$9(r2)), r2.getRemainingTime = r2.getRemainingTime.bind(n$9(r2)), r2.getElapsedTime = r2.getElapsedTime.bind(n$9(r2)), r2.getLastActiveTime = r2.getLastActiveTime.bind(n$9(r2)), r2.getLastIdleTime = r2.getLastIdleTime.bind(n$9(r2)), r2.getTotalIdleTime = r2.getTotalIdleTime.bind(n$9(r2)), r2.getTotalActiveTime = r2.getTotalActiveTime.bind(n$9(r2)), r2;
}
return _createClass(o2, [{ key: "componentDidMount", value: function() {
var e7 = this.props, t5 = e7.startOnMount, n2 = e7.startManually;
this._setupTabManager(), n2 || (t5 ? this.start() : this._bindEvents());
} }, { key: "componentDidUpdate", value: function(e7) {
e7.debounce !== this.props.debounce && this.props.debounce > 0 ? (this._onAction.cancel && this._onAction.cancel(), this._onAction = b$3(this.props.onAction, this.props.debounce)) : e7.throttle !== this.props.throttle && this.props.throttle > 0 ? (this._onAction.cancel && this._onAction.cancel(), this._onAction = T$4(this.props.onAction, this.props.throttle)) : (e7.throttle && 0 === this.props.throttle || e7.debounce && 0 === this.props.debounce) && (this._onAction.cancel && this._onAction.cancel(), this._onAction = this.props.onAction), e7.eventsThrottle !== this.props.eventsThrottle && (this._unbindEvents(), this.handleEvent = T$4(this._handleEvent.bind(this), this.props.eventsThrottle), this._bindEvents()), e7.timeout !== this.props.timeout && this.state.idle && this.reset(), e7.onActive !== this.props.onActive && (this.callbackRefs.onActive = this.props.onActive), e7.onIdle !== this.props.onIdle && (this.callbackRefs.onIdle = this.props.onIdle);
} }, { key: "componentWillUnmount", value: function() {
clearTimeout(this.tId), this._unbindEvents(true), this._onAction.cancel && this._onAction.cancel(), this.manager && this.manager.close().catch(console.error);
} }, { key: "render", value: function() {
return this.props.children || null;
} }, { key: "_setupTabManager", value: function() {
var e7 = this.props, t5 = e7.crossTab, n2 = e7.onIdle, r2 = e7.onActive;
if (this.callbackRefs = { onIdle: n2, onActive: r2 }, t5) {
var i3 = Object.assign({ channelName: "idle-timer", fallbackInterval: 2e3, responseTime: 100, removeTimeout: 6e4, emitOnAllTabs: false }, true === t5 ? {} : t5), s3 = i3.type, a2 = i3.channelName, o3 = i3.fallbackInterval, u2 = i3.responseTime, c2 = i3.emitOnAllTabs;
this.manager = J$2({ type: s3, channelName: a2, fallbackInterval: o3, responseTime: u2, emitOnAllTabs: c2, callbacks: this.callbackRefs, start: this.start, reset: this.reset, pause: this.pause, resume: this.resume });
}
} }, { key: "_bindEvents", value: function() {
var e7 = this;
if (f$4) {
var t5 = this.props, n2 = t5.element, r2 = t5.events, i3 = t5.passive, s3 = t5.capture;
this.eventsBound || (r2.forEach(function(t6) {
n2.addEventListener(t6, e7.handleEvent, { capture: s3, passive: i3 });
}), this.eventsBound = true);
}
} }, { key: "_unbindEvents", value: function() {
var e7 = this, t5 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (f$4) {
var n2 = this.props, r2 = n2.element, i3 = n2.events, s3 = n2.passive, a2 = n2.capture;
(this.eventsBound || t5) && (i3.forEach(function(t6) {
r2.removeEventListener(t6, e7.handleEvent, { capture: a2, passive: s3 });
}), this.eventsBound = false);
}
} }, { key: "_toggleIdleState", value: function(e7) {
var t5 = this;
this.setState(function(e8) {
return { idle: !e8.idle, lastIdle: e8.idle ? e8.lastIdle : +/* @__PURE__ */ new Date() - t5.props.timeout, idleTime: e8.idle ? e8.idleTime + +/* @__PURE__ */ new Date() - e8.lastIdle : e8.idleTime };
}, function() {
var n2 = t5.props, r2 = n2.onActive, i3 = n2.onIdle, s3 = n2.stopOnIdle;
t5.state.idle ? (s3 && (clearTimeout(t5.tId), t5.tId = null, t5._unbindEvents()), t5.manager ? t5.manager.idle() : i3(e7)) : (t5._bindEvents(), t5.manager ? t5.manager.active() : r2(e7));
});
} }, { key: "_handleEvent", value: function(e7) {
var t5 = this.state, n2 = t5.remaining, r2 = t5.pageX, i3 = t5.pageY, s3 = t5.idle, a2 = this.props, o3 = a2.timeout, u2 = a2.stopOnIdle;
if (this._onAction(e7), !n2) {
if ("mousemove" === e7.type) {
if (e7.pageX === r2 && e7.pageY === i3)
return;
if (void 0 === e7.pageX && void 0 === e7.pageY)
return;
if (this.getElapsedTime() < 200)
return;
}
clearTimeout(this.tId), this.tId = null;
var c2 = +/* @__PURE__ */ new Date() - this.getLastActiveTime();
(s3 && !u2 || !s3 && c2 > o3) && this._toggleIdleState(e7), this.setState({ lastActive: +/* @__PURE__ */ new Date(), pageX: e7.pageX, pageY: e7.pageY }), s3 && u2 || (this.tId = setTimeout(this._toggleIdleState, o3));
}
} }, { key: "start", value: function() {
var e7 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
clearTimeout(this.tId), this.tId = null, this._bindEvents(), this.setState({ idle: false, oldDate: +/* @__PURE__ */ new Date(), lastActive: +/* @__PURE__ */ new Date(), remaining: null }), this.manager && (this.manager.setAllIdle(false), !e7 && this.props.crossTab.emitOnAllTabs && this.manager.send("start"));
var t5 = this.props.timeout;
this.tId = setTimeout(this._toggleIdleState, t5);
} }, { key: "reset", value: function() {
var e7 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
clearTimeout(this.tId), this.tId = null, this._bindEvents(), this.state.idle && (this.manager ? this.manager.active() : this.props.onActive()), this.manager && (this.manager.setAllIdle(false), !e7 && this.props.crossTab.emitOnAllTabs && this.manager.send("reset")), this.setState({ idle: false, oldDate: +/* @__PURE__ */ new Date(), lastActive: +/* @__PURE__ */ new Date(), remaining: null });
var t5 = this.props.timeout;
this.tId = setTimeout(this._toggleIdleState, t5);
} }, { key: "pause", value: function() {
var e7 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t5 = this.state.remaining;
null === t5 && (this._unbindEvents(), clearTimeout(this.tId), this.tId = null, this.manager && !e7 && this.props.crossTab.emitOnAllTabs && this.manager.send("pause"), this.setState({ remaining: this.getRemainingTime() }));
} }, { key: "resume", value: function() {
var e7 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t5 = this.state, n2 = t5.remaining, r2 = t5.idle;
null !== n2 && (this._bindEvents(), this.manager && !e7 && this.props.crossTab.emitOnAllTabs && this.manager.send("resume"), r2 || (this.tId = setTimeout(this._toggleIdleState, n2), this.setState({ remaining: null, lastActive: +/* @__PURE__ */ new Date() })));
} }, { key: "getRemainingTime", value: function() {
var e7 = this.state, t5 = e7.remaining, n2 = e7.lastActive, r2 = this.props.timeout;
if (null !== t5)
return t5 < 0 ? 0 : t5;
var i3 = r2 - (+/* @__PURE__ */ new Date() - n2);
return i3 < 0 ? 0 : i3;
} }, { key: "getElapsedTime", value: function() {
var e7 = this.state.oldDate;
return +/* @__PURE__ */ new Date() - e7;
} }, { key: "getLastIdleTime", value: function() {
return this.state.lastIdle;
} }, { key: "getTotalIdleTime", value: function() {
var e7 = this.state, t5 = e7.idle, n2 = e7.lastIdle, r2 = e7.idleTime;
return t5 ? +/* @__PURE__ */ new Date() - n2 + r2 : r2;
} }, { key: "getLastActiveTime", value: function() {
return this.state.lastActive;
} }, { key: "getTotalActiveTime", value: function() {
return this.getElapsedTime() - this.getTotalIdleTime();
} }, { key: "isIdle", value: function() {
return this.state.idle;
} }, { key: "isLeader", value: function() {
return !this.manager || this.manager.isLeader();
} }]), o2;
}();
G$2.propTypes = { timeout: u$9.number, events: u$9.arrayOf(u$9.string), onIdle: u$9.func, onActive: u$9.func, onAction: u$9.func, debounce: u$9.number, throttle: u$9.number, eventsThrottle: u$9.number, element: u$9.oneOfType([u$9.object, u$9.element]), startOnMount: u$9.bool, startManually: u$9.bool, stopOnIdle: u$9.bool, passive: u$9.bool, capture: u$9.bool, crossTab: u$9.oneOfType([u$9.bool, u$9.shape({ type: u$9.oneOf(["broadcastChannel", "localStorage", "simulate"]), channelName: u$9.string, fallbackInterval: u$9.number, responseTime: u$9.number, removeTimeout: u$9.number, emitOnAllTabs: u$9.bool })]) }, G$2.defaultProps = { timeout: 12e5, element: v$3, events: g$1, onIdle: function() {
}, onActive: function() {
}, onAction: function() {
}, debounce: 0, throttle: 0, eventsThrottle: 200, startOnMount: true, startManually: false, stopOnIdle: false, capture: true, passive: true, crossTab: false }, { timeout: u$9.number, events: u$9.arrayOf(u$9.string), onIdle: u$9.func, onActive: u$9.func, onAction: u$9.func, debounce: u$9.number, throttle: u$9.number, eventsThrottle: u$9.number, element: u$9.oneOfType([u$9.object, u$9.element]), startOnMount: u$9.bool, startManually: u$9.bool, stopOnIdle: u$9.bool, passive: u$9.bool, capture: u$9.bool, crossTab: u$9.oneOfType([u$9.bool, u$9.shape({ type: u$9.oneOf(["broadcastChannel", "localStorage", "simulate"]), channelName: u$9.string, fallbackInterval: u$9.number, responseTime: u$9.number, removeTimeout: u$9.number, emitOnAllTabs: u$9.bool })]) };
function accessor(fn8, fields, name) {
fn8.fields = fields || [];
fn8.fname = name;
return fn8;
}
function accessorName(fn8) {
return fn8 == null ? null : fn8.fname;
}
function accessorFields(fn8) {
return fn8 == null ? null : fn8.fields;
}
function getter$1(path2) {
return path2.length === 1 ? get1(path2[0]) : getN(path2);
}
const get1 = (field2) => function(obj) {
return obj[field2];
};
const getN = (path2) => {
const len = path2.length;
return function(obj) {
for (let i2 = 0; i2 < len; ++i2) {
obj = obj[path2[i2]];
}
return obj;
};
};
function error2(message) {
throw Error(message);
}
function splitAccessPath(p2) {
const path2 = [], n2 = p2.length;
let q2 = null, b2 = 0, s2 = "", i2, j2, c2;
p2 = p2 + "";
function push2() {
path2.push(s2 + p2.substring(i2, j2));
s2 = "";
i2 = j2 + 1;
}
for (i2 = j2 = 0; j2 < n2; ++j2) {
c2 = p2[j2];
if (c2 === "\\") {
s2 += p2.substring(i2, j2++);
i2 = j2;
} else if (c2 === q2) {
push2();
q2 = null;
b2 = -1;
} else if (q2) {
continue;
} else if (i2 === b2 && c2 === '"') {
i2 = j2 + 1;
q2 = c2;
} else if (i2 === b2 && c2 === "'") {
i2 = j2 + 1;
q2 = c2;
} else if (c2 === "." && !b2) {
if (j2 > i2) {
push2();
} else {
i2 = j2 + 1;
}
} else if (c2 === "[") {
if (j2 > i2)
push2();
b2 = i2 = j2 + 1;
} else if (c2 === "]") {
if (!b2)
error2("Access path missing open bracket: " + p2);
if (b2 > 0)
push2();
b2 = 0;
i2 = j2 + 1;
}
}
if (b2)
error2("Access path missing closing bracket: " + p2);
if (q2)
error2("Access path missing closing quote: " + p2);
if (j2 > i2) {
j2++;
push2();
}
return path2;
}
function field$1(field2, name, opt) {
const path2 = splitAccessPath(field2);
field2 = path2.length === 1 ? path2[0] : field2;
return accessor((opt && opt.get || getter$1)(path2), [field2], name || field2);
}
const id$2 = field$1("id");
const identity$6 = accessor((_24) => _24, [], "identity");
const zero$7 = accessor(() => 0, [], "zero");
const one$2 = accessor(() => 1, [], "one");
const truthy = accessor(() => true, [], "true");
const falsy = accessor(() => false, [], "false");
function log$1$1(method, level, input) {
const args = [level].concat([].slice.call(input));
console[method].apply(console, args);
}
const None$2 = 0;
const Error$1 = 1;
const Warn = 2;
const Info2 = 3;
const Debug = 4;
function logger(_24, method) {
let handler = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : log$1$1;
let level = _24 || None$2;
return {
level(_25) {
if (arguments.length) {
level = +_25;
return this;
} else {
return level;
}
},
error() {
if (level >= Error$1)
handler(method || "error", "ERROR", arguments);
return this;
},
warn() {
if (level >= Warn)
handler(method || "warn", "WARN", arguments);
return this;
},
info() {
if (level >= Info2)
handler(method || "log", "INFO", arguments);
return this;
},
debug() {
if (level >= Debug)
handler(method || "log", "DEBUG", arguments);
return this;
}
};
}
var isArray$2 = Array.isArray;
function isObject$a(_24) {
return _24 === Object(_24);
}
const isLegalKey = (key2) => key2 !== "__proto__";
function mergeConfig() {
for (var _len = arguments.length, configs = new Array(_len), _key = 0; _key < _len; _key++) {
configs[_key] = arguments[_key];
}
return configs.reduce((out, source2) => {
for (const key2 in source2) {
if (key2 === "signals") {
out.signals = mergeNamed(out.signals, source2.signals);
} else {
const r2 = key2 === "legend" ? {
layout: 1
} : key2 === "style" ? true : null;
writeConfig(out, key2, source2[key2], r2);
}
}
return out;
}, {});
}
function writeConfig(output3, key2, value2, recurse2) {
if (!isLegalKey(key2))
return;
let k2, o2;
if (isObject$a(value2) && !isArray$2(value2)) {
o2 = isObject$a(output3[key2]) ? output3[key2] : output3[key2] = {};
for (k2 in value2) {
if (recurse2 && (recurse2 === true || recurse2[k2])) {
writeConfig(o2, k2, value2[k2]);
} else if (isLegalKey(k2)) {
o2[k2] = value2[k2];
}
}
} else {
output3[key2] = value2;
}
}
function mergeNamed(a2, b2) {
if (a2 == null)
return b2;
const map2 = {}, out = [];
function add3(_24) {
if (!map2[_24.name]) {
map2[_24.name] = 1;
out.push(_24);
}
}
b2.forEach(add3);
a2.forEach(add3);
return out;
}
function peek$1(array2) {
return array2[array2.length - 1];
}
function toNumber2(_24) {
return _24 == null || _24 === "" ? null : +_24;
}
const exp$2 = (sign2) => (x2) => sign2 * Math.exp(x2);
const log$4 = (sign2) => (x2) => Math.log(sign2 * x2);
const symlog$1 = (c2) => (x2) => Math.sign(x2) * Math.log1p(Math.abs(x2 / c2));
const symexp = (c2) => (x2) => Math.sign(x2) * Math.expm1(Math.abs(x2)) * c2;
const pow$4 = (exponent2) => (x2) => x2 < 0 ? -Math.pow(-x2, exponent2) : Math.pow(x2, exponent2);
function pan(domain2, delta, lift, ground) {
const d0 = lift(domain2[0]), d1 = lift(peek$1(domain2)), dd2 = (d1 - d0) * delta;
return [ground(d0 - dd2), ground(d1 - dd2)];
}
function panLinear(domain2, delta) {
return pan(domain2, delta, toNumber2, identity$6);
}
function panLog(domain2, delta) {
var sign2 = Math.sign(domain2[0]);
return pan(domain2, delta, log$4(sign2), exp$2(sign2));
}
function panPow(domain2, delta, exponent2) {
return pan(domain2, delta, pow$4(exponent2), pow$4(1 / exponent2));
}
function panSymlog(domain2, delta, constant2) {
return pan(domain2, delta, symlog$1(constant2), symexp(constant2));
}
function zoom$1(domain2, anchor, scale2, lift, ground) {
const d0 = lift(domain2[0]), d1 = lift(peek$1(domain2)), da2 = anchor != null ? lift(anchor) : (d0 + d1) / 2;
return [ground(da2 + (d0 - da2) * scale2), ground(da2 + (d1 - da2) * scale2)];
}
function zoomLinear(domain2, anchor, scale2) {
return zoom$1(domain2, anchor, scale2, toNumber2, identity$6);
}
function zoomLog(domain2, anchor, scale2) {
const sign2 = Math.sign(domain2[0]);
return zoom$1(domain2, anchor, scale2, log$4(sign2), exp$2(sign2));
}
function zoomPow(domain2, anchor, scale2, exponent2) {
return zoom$1(domain2, anchor, scale2, pow$4(exponent2), pow$4(1 / exponent2));
}
function zoomSymlog(domain2, anchor, scale2, constant2) {
return zoom$1(domain2, anchor, scale2, symlog$1(constant2), symexp(constant2));
}
function quarter(date2) {
return 1 + ~~(new Date(date2).getMonth() / 3);
}
function utcquarter(date2) {
return 1 + ~~(new Date(date2).getUTCMonth() / 3);
}
function array$5(_24) {
return _24 != null ? isArray$2(_24) ? _24 : [_24] : [];
}
function clampRange(range2, min2, max2) {
let lo2 = range2[0], hi2 = range2[1], span2;
if (hi2 < lo2) {
span2 = hi2;
hi2 = lo2;
lo2 = span2;
}
span2 = hi2 - lo2;
return span2 >= max2 - min2 ? [min2, max2] : [lo2 = Math.min(Math.max(lo2, min2), max2 - span2), lo2 + span2];
}
function isFunction(_24) {
return typeof _24 === "function";
}
const DESCENDING = "descending";
function compare$1(fields, orders, opt) {
opt = opt || {};
orders = array$5(orders) || [];
const ord = [], get2 = [], fmap = {}, gen = opt.comparator || comparator;
array$5(fields).forEach((f2, i2) => {
if (f2 == null)
return;
ord.push(orders[i2] === DESCENDING ? -1 : 1);
get2.push(f2 = isFunction(f2) ? f2 : field$1(f2, null, opt));
(accessorFields(f2) || []).forEach((_24) => fmap[_24] = 1);
});
return get2.length === 0 ? null : accessor(gen(get2, ord), Object.keys(fmap));
}
const ascending$8 = (u2, v2) => (u2 < v2 || u2 == null) && v2 != null ? -1 : (u2 > v2 || v2 == null) && u2 != null ? 1 : (v2 = v2 instanceof Date ? +v2 : v2, u2 = u2 instanceof Date ? +u2 : u2) !== u2 && v2 === v2 ? -1 : v2 !== v2 && u2 === u2 ? 1 : 0;
const comparator = (fields, orders) => fields.length === 1 ? compare1(fields[0], orders[0]) : compareN(fields, orders, fields.length);
const compare1 = (field2, order2) => function(a2, b2) {
return ascending$8(field2(a2), field2(b2)) * order2;
};
const compareN = (fields, orders, n2) => {
orders.push(0);
return function(a2, b2) {
let f2, c2 = 0, i2 = -1;
while (c2 === 0 && ++i2 < n2) {
f2 = fields[i2];
c2 = ascending$8(f2(a2), f2(b2));
}
return c2 * orders[i2];
};
};
function constant$6(_24) {
return isFunction(_24) ? _24 : () => _24;
}
function debounce(delay, handler) {
let tid;
return (e7) => {
if (tid)
clearTimeout(tid);
tid = setTimeout(() => (handler(e7), tid = null), delay);
};
}
function extend$2(_24) {
for (let x2, k2, i2 = 1, len = arguments.length; i2 < len; ++i2) {
x2 = arguments[i2];
for (k2 in x2) {
_24[k2] = x2[k2];
}
}
return _24;
}
function extent(array2, f2) {
let i2 = 0, n2, v2, min2, max2;
if (array2 && (n2 = array2.length)) {
if (f2 == null) {
for (v2 = array2[i2]; i2 < n2 && (v2 == null || v2 !== v2); v2 = array2[++i2])
;
min2 = max2 = v2;
for (; i2 < n2; ++i2) {
v2 = array2[i2];
if (v2 != null) {
if (v2 < min2)
min2 = v2;
if (v2 > max2)
max2 = v2;
}
}
} else {
for (v2 = f2(array2[i2]); i2 < n2 && (v2 == null || v2 !== v2); v2 = f2(array2[++i2]))
;
min2 = max2 = v2;
for (; i2 < n2; ++i2) {
v2 = f2(array2[i2]);
if (v2 != null) {
if (v2 < min2)
min2 = v2;
if (v2 > max2)
max2 = v2;
}
}
}
}
return [min2, max2];
}
function extentIndex(array2, f2) {
const n2 = array2.length;
let i2 = -1, a2, b2, c2, u2, v2;
if (f2 == null) {
while (++i2 < n2) {
b2 = array2[i2];
if (b2 != null && b2 >= b2) {
a2 = c2 = b2;
break;
}
}
if (i2 === n2)
return [-1, -1];
u2 = v2 = i2;
while (++i2 < n2) {
b2 = array2[i2];
if (b2 != null) {
if (a2 > b2) {
a2 = b2;
u2 = i2;
}
if (c2 < b2) {
c2 = b2;
v2 = i2;
}
}
}
} else {
while (++i2 < n2) {
b2 = f2(array2[i2], i2, array2);
if (b2 != null && b2 >= b2) {
a2 = c2 = b2;
break;
}
}
if (i2 === n2)
return [-1, -1];
u2 = v2 = i2;
while (++i2 < n2) {
b2 = f2(array2[i2], i2, array2);
if (b2 != null) {
if (a2 > b2) {
a2 = b2;
u2 = i2;
}
if (c2 < b2) {
c2 = b2;
v2 = i2;
}
}
}
}
return [u2, v2];
}
const hop = Object.prototype.hasOwnProperty;
function has$2(object2, property2) {
return hop.call(object2, property2);
}
const NULL$1 = {};
function fastmap(input) {
let obj = {}, test2;
function has$12(key2) {
return has$2(obj, key2) && obj[key2] !== NULL$1;
}
const map2 = {
size: 0,
empty: 0,
object: obj,
has: has$12,
get(key2) {
return has$12(key2) ? obj[key2] : void 0;
},
set(key2, value2) {
if (!has$12(key2)) {
++map2.size;
if (obj[key2] === NULL$1)
--map2.empty;
}
obj[key2] = value2;
return this;
},
delete(key2) {
if (has$12(key2)) {
--map2.size;
++map2.empty;
obj[key2] = NULL$1;
}
return this;
},
clear() {
map2.size = map2.empty = 0;
map2.object = obj = {};
},
test(_24) {
if (arguments.length) {
test2 = _24;
return map2;
} else {
return test2;
}
},
clean() {
const next2 = {};
let size = 0;
for (const key2 in obj) {
const value2 = obj[key2];
if (value2 !== NULL$1 && (!test2 || !test2(value2))) {
next2[key2] = value2;
++size;
}
}
map2.size = size;
map2.empty = 0;
map2.object = obj = next2;
}
};
if (input)
Object.keys(input).forEach((key2) => {
map2.set(key2, input[key2]);
});
return map2;
}
function flush$1(range2, value2, threshold2, left2, right2, center) {
if (!threshold2 && threshold2 !== 0)
return center;
const t5 = +threshold2;
let a2 = range2[0], b2 = peek$1(range2), l2;
if (b2 < a2) {
l2 = a2;
a2 = b2;
b2 = l2;
}
l2 = Math.abs(value2 - a2);
const r2 = Math.abs(b2 - value2);
return l2 < r2 && l2 <= t5 ? left2 : r2 <= t5 ? right2 : center;
}
function inherits(child, parent, members) {
const proto = child.prototype = Object.create(parent.prototype);
Object.defineProperty(proto, "constructor", {
value: child,
writable: true,
enumerable: true,
configurable: true
});
return extend$2(proto, members);
}
function inrange(value2, range2, left2, right2) {
let r0 = range2[0], r1 = range2[range2.length - 1], t5;
if (r0 > r1) {
t5 = r0;
r0 = r1;
r1 = t5;
}
left2 = left2 === void 0 || left2;
right2 = right2 === void 0 || right2;
return (left2 ? r0 <= value2 : r0 < value2) && (right2 ? value2 <= r1 : value2 < r1);
}
function isBoolean$1(_24) {
return typeof _24 === "boolean";
}
function isDate$1(_24) {
return Object.prototype.toString.call(_24) === "[object Date]";
}
function isIterable(_24) {
return _24 && isFunction(_24[Symbol.iterator]);
}
function isNumber$1(_24) {
return typeof _24 === "number";
}
function isRegExp$2(_24) {
return Object.prototype.toString.call(_24) === "[object RegExp]";
}
function isString(_24) {
return typeof _24 === "string";
}
function key(fields, flat, opt) {
if (fields) {
fields = flat ? array$5(fields).map((f2) => f2.replace(/\\(.)/g, "$1")) : array$5(fields);
}
const len = fields && fields.length, gen = opt && opt.get || getter$1, map2 = (f2) => gen(flat ? [f2] : splitAccessPath(f2));
let fn8;
if (!len) {
fn8 = function() {
return "";
};
} else if (len === 1) {
const get2 = map2(fields[0]);
fn8 = function(_24) {
return "" + get2(_24);
};
} else {
const get2 = fields.map(map2);
fn8 = function(_24) {
let s2 = "" + get2[0](_24), i2 = 0;
while (++i2 < len)
s2 += "|" + get2[i2](_24);
return s2;
};
}
return accessor(fn8, fields, "key");
}
function lerp$1(array2, frac) {
const lo2 = array2[0], hi2 = peek$1(array2), f2 = +frac;
return !f2 ? lo2 : f2 === 1 ? hi2 : lo2 + f2 * (hi2 - lo2);
}
const DEFAULT_MAX_SIZE = 1e4;
function lruCache(maxsize) {
maxsize = +maxsize || DEFAULT_MAX_SIZE;
let curr, prev2, size;
const clear2 = () => {
curr = {};
prev2 = {};
size = 0;
};
const update2 = (key2, value2) => {
if (++size > maxsize) {
prev2 = curr;
curr = {};
size = 1;
}
return curr[key2] = value2;
};
clear2();
return {
clear: clear2,
has: (key2) => has$2(curr, key2) || has$2(prev2, key2),
get: (key2) => has$2(curr, key2) ? curr[key2] : has$2(prev2, key2) ? update2(key2, prev2[key2]) : void 0,
set: (key2, value2) => has$2(curr, key2) ? curr[key2] = value2 : update2(key2, value2)
};
}
function merge$3(compare3, array0, array1, output3) {
const n0 = array0.length, n1 = array1.length;
if (!n1)
return array0;
if (!n0)
return array1;
const merged = output3 || new array0.constructor(n0 + n1);
let i0 = 0, i1 = 0, i2 = 0;
for (; i0 < n0 && i1 < n1; ++i2) {
merged[i2] = compare3(array0[i0], array1[i1]) > 0 ? array1[i1++] : array0[i0++];
}
for (; i0 < n0; ++i0, ++i2) {
merged[i2] = array0[i0];
}
for (; i1 < n1; ++i1, ++i2) {
merged[i2] = array1[i1];
}
return merged;
}
function repeat(str, reps) {
let s2 = "";
while (--reps >= 0)
s2 += str;
return s2;
}
function pad$3(str, length2, padchar, align) {
const c2 = padchar || " ", s2 = str + "", n2 = length2 - s2.length;
return n2 <= 0 ? s2 : align === "left" ? repeat(c2, n2) + s2 : align === "center" ? repeat(c2, ~~(n2 / 2)) + s2 + repeat(c2, Math.ceil(n2 / 2)) : s2 + repeat(c2, n2);
}
function span(array2) {
return array2 && peek$1(array2) - array2[0] || 0;
}
function $$h(x2) {
return isArray$2(x2) ? "[" + x2.map($$h) + "]" : isObject$a(x2) || isString(x2) ? (
// Output valid JSON and JS source strings.
// See http://timelessrepo.com/json-isnt-a-javascript-subset
JSON.stringify(x2).replace("\u2028", "\\u2028").replace("\u2029", "\\u2029")
) : x2;
}
function toBoolean(_24) {
return _24 == null || _24 === "" ? null : !_24 || _24 === "false" || _24 === "0" ? false : !!_24;
}
const defaultParser = (_24) => isNumber$1(_24) ? _24 : isDate$1(_24) ? _24 : Date.parse(_24);
function toDate(_24, parser2) {
parser2 = parser2 || defaultParser;
return _24 == null || _24 === "" ? null : parser2(_24);
}
function toString$c(_24) {
return _24 == null || _24 === "" ? null : _24 + "";
}
function toSet(_24) {
const s2 = {}, n2 = _24.length;
for (let i2 = 0; i2 < n2; ++i2)
s2[_24[i2]] = true;
return s2;
}
function truncate$1(str, length2, align, ellipsis) {
const e7 = ellipsis != null ? ellipsis : "…", s2 = str + "", n2 = s2.length, l2 = Math.max(0, length2 - e7.length);
return n2 <= length2 ? s2 : align === "left" ? e7 + s2.slice(n2 - l2) : align === "center" ? s2.slice(0, Math.ceil(l2 / 2)) + e7 + s2.slice(n2 - ~~(l2 / 2)) : s2.slice(0, l2) + e7;
}
function visitArray(array2, filter2, visitor) {
if (array2) {
if (filter2) {
const n2 = array2.length;
for (let i2 = 0; i2 < n2; ++i2) {
const t5 = filter2(array2[i2]);
if (t5)
visitor(t5, i2, array2);
}
} else {
array2.forEach(visitor);
}
}
}
var EOL = {}, EOF$1 = {}, QUOTE = 34, NEWLINE = 10, RETURN = 13;
function objectConverter(columns) {
return new Function("d", "return {" + columns.map(function(name, i2) {
return JSON.stringify(name) + ": d[" + i2 + '] || ""';
}).join(",") + "}");
}
function customConverter(columns, f2) {
var object2 = objectConverter(columns);
return function(row, i2) {
return f2(object2(row), i2, columns);
};
}
function inferColumns(rows) {
var columnSet = /* @__PURE__ */ Object.create(null), columns = [];
rows.forEach(function(row) {
for (var column2 in row) {
if (!(column2 in columnSet)) {
columns.push(columnSet[column2] = column2);
}
}
});
return columns;
}
function pad$2(value2, width2) {
var s2 = value2 + "", length2 = s2.length;
return length2 < width2 ? new Array(width2 - length2 + 1).join(0) + s2 : s2;
}
function formatYear$2(year2) {
return year2 < 0 ? "-" + pad$2(-year2, 6) : year2 > 9999 ? "+" + pad$2(year2, 6) : pad$2(year2, 4);
}
function formatDate(date2) {
var hours = date2.getUTCHours(), minutes = date2.getUTCMinutes(), seconds = date2.getUTCSeconds(), milliseconds = date2.getUTCMilliseconds();
return isNaN(date2) ? "Invalid Date" : formatYear$2(date2.getUTCFullYear()) + "-" + pad$2(date2.getUTCMonth() + 1, 2) + "-" + pad$2(date2.getUTCDate(), 2) + (milliseconds ? "T" + pad$2(hours, 2) + ":" + pad$2(minutes, 2) + ":" + pad$2(seconds, 2) + "." + pad$2(milliseconds, 3) + "Z" : seconds ? "T" + pad$2(hours, 2) + ":" + pad$2(minutes, 2) + ":" + pad$2(seconds, 2) + "Z" : minutes || hours ? "T" + pad$2(hours, 2) + ":" + pad$2(minutes, 2) + "Z" : "");
}
function dsvFormat(delimiter2) {
var reFormat = new RegExp('["' + delimiter2 + "\n\r]"), DELIMITER = delimiter2.charCodeAt(0);
function parse2(text2, f2) {
var convert, columns, rows = parseRows(text2, function(row, i2) {
if (convert)
return convert(row, i2 - 1);
columns = row, convert = f2 ? customConverter(row, f2) : objectConverter(row);
});
rows.columns = columns || [];
return rows;
}
function parseRows(text2, f2) {
var rows = [], N2 = text2.length, I2 = 0, n2 = 0, t5, eof = N2 <= 0, eol = false;
if (text2.charCodeAt(N2 - 1) === NEWLINE)
--N2;
if (text2.charCodeAt(N2 - 1) === RETURN)
--N2;
function token2() {
if (eof)
return EOF$1;
if (eol)
return eol = false, EOL;
var i2, j2 = I2, c2;
if (text2.charCodeAt(j2) === QUOTE) {
while (I2++ < N2 && text2.charCodeAt(I2) !== QUOTE || text2.charCodeAt(++I2) === QUOTE)
;
if ((i2 = I2) >= N2)
eof = true;
else if ((c2 = text2.charCodeAt(I2++)) === NEWLINE)
eol = true;
else if (c2 === RETURN) {
eol = true;
if (text2.charCodeAt(I2) === NEWLINE)
++I2;
}
return text2.slice(j2 + 1, i2 - 1).replace(/""/g, '"');
}
while (I2 < N2) {
if ((c2 = text2.charCodeAt(i2 = I2++)) === NEWLINE)
eol = true;
else if (c2 === RETURN) {
eol = true;
if (text2.charCodeAt(I2) === NEWLINE)
++I2;
} else if (c2 !== DELIMITER)
continue;
return text2.slice(j2, i2);
}
return eof = true, text2.slice(j2, N2);
}
while ((t5 = token2()) !== EOF$1) {
var row = [];
while (t5 !== EOL && t5 !== EOF$1)
row.push(t5), t5 = token2();
if (f2 && (row = f2(row, n2++)) == null)
continue;
rows.push(row);
}
return rows;
}
function preformatBody(rows, columns) {
return rows.map(function(row) {
return columns.map(function(column2) {
return formatValue2(row[column2]);
}).join(delimiter2);
});
}
function format2(rows, columns) {
if (columns == null)
columns = inferColumns(rows);
return [columns.map(formatValue2).join(delimiter2)].concat(preformatBody(rows, columns)).join("\n");
}
function formatBody(rows, columns) {
if (columns == null)
columns = inferColumns(rows);
return preformatBody(rows, columns).join("\n");
}
function formatRows(rows) {
return rows.map(formatRow).join("\n");
}
function formatRow(row) {
return row.map(formatValue2).join(delimiter2);
}
function formatValue2(value2) {
return value2 == null ? "" : value2 instanceof Date ? formatDate(value2) : reFormat.test(value2 += "") ? '"' + value2.replace(/"/g, '""') + '"' : value2;
}
return {
parse: parse2,
parseRows,
format: format2,
formatBody,
formatRows,
formatRow,
formatValue: formatValue2
};
}
function identity$5(x2) {
return x2;
}
function transform$5(transform2) {
if (transform2 == null)
return identity$5;
var x02, y02, kx = transform2.scale[0], ky = transform2.scale[1], dx = transform2.translate[0], dy = transform2.translate[1];
return function(input, i2) {
if (!i2)
x02 = y02 = 0;
var j2 = 2, n2 = input.length, output3 = new Array(n2);
output3[0] = (x02 += input[0]) * kx + dx;
output3[1] = (y02 += input[1]) * ky + dy;
while (j2 < n2)
output3[j2] = input[j2], ++j2;
return output3;
};
}
function reverse$1(array2, n2) {
var t5, j2 = array2.length, i2 = j2 - n2;
while (i2 < --j2)
t5 = array2[i2], array2[i2++] = array2[j2], array2[j2] = t5;
}
function feature(topology, o2) {
if (typeof o2 === "string")
o2 = topology.objects[o2];
return o2.type === "GeometryCollection" ? { type: "FeatureCollection", features: o2.geometries.map(function(o3) {
return feature$1(topology, o3);
}) } : feature$1(topology, o2);
}
function feature$1(topology, o2) {
var id = o2.id, bbox = o2.bbox, properties2 = o2.properties == null ? {} : o2.properties, geometry = object$1(topology, o2);
return id == null && bbox == null ? { type: "Feature", properties: properties2, geometry } : bbox == null ? { type: "Feature", id, properties: properties2, geometry } : { type: "Feature", id, bbox, properties: properties2, geometry };
}
function object$1(topology, o2) {
var transformPoint = transform$5(topology.transform), arcs = topology.arcs;
function arc2(i2, points2) {
if (points2.length)
points2.pop();
for (var a2 = arcs[i2 < 0 ? ~i2 : i2], k2 = 0, n2 = a2.length; k2 < n2; ++k2) {
points2.push(transformPoint(a2[k2], k2));
}
if (i2 < 0)
reverse$1(points2, n2);
}
function point2(p2) {
return transformPoint(p2);
}
function line2(arcs2) {
var points2 = [];
for (var i2 = 0, n2 = arcs2.length; i2 < n2; ++i2)
arc2(arcs2[i2], points2);
if (points2.length < 2)
points2.push(points2[0]);
return points2;
}
function ring(arcs2) {
var points2 = line2(arcs2);
while (points2.length < 4)
points2.push(points2[0]);
return points2;
}
function polygon(arcs2) {
return arcs2.map(ring);
}
function geometry(o3) {
var type2 = o3.type, coordinates;
switch (type2) {
case "GeometryCollection":
return { type: type2, geometries: o3.geometries.map(geometry) };
case "Point":
coordinates = point2(o3.coordinates);
break;
case "MultiPoint":
coordinates = o3.coordinates.map(point2);
break;
case "LineString":
coordinates = line2(o3.arcs);
break;
case "MultiLineString":
coordinates = o3.arcs.map(line2);
break;
case "Polygon":
coordinates = polygon(o3.arcs);
break;
case "MultiPolygon":
coordinates = o3.arcs.map(polygon);
break;
default:
return null;
}
return { type: type2, coordinates };
}
return geometry(o2);
}
function stitch(topology, arcs) {
var stitchedArcs = {}, fragmentByStart = {}, fragmentByEnd = {}, fragments = [], emptyIndex = -1;
arcs.forEach(function(i2, j2) {
var arc2 = topology.arcs[i2 < 0 ? ~i2 : i2], t5;
if (arc2.length < 3 && !arc2[1][0] && !arc2[1][1]) {
t5 = arcs[++emptyIndex], arcs[emptyIndex] = i2, arcs[j2] = t5;
}
});
arcs.forEach(function(i2) {
var e7 = ends(i2), start2 = e7[0], end2 = e7[1], f2, g2;
if (f2 = fragmentByEnd[start2]) {
delete fragmentByEnd[f2.end];
f2.push(i2);
f2.end = end2;
if (g2 = fragmentByStart[end2]) {
delete fragmentByStart[g2.start];
var fg2 = g2 === f2 ? f2 : f2.concat(g2);
fragmentByStart[fg2.start = f2.start] = fragmentByEnd[fg2.end = g2.end] = fg2;
} else {
fragmentByStart[f2.start] = fragmentByEnd[f2.end] = f2;
}
} else if (f2 = fragmentByStart[end2]) {
delete fragmentByStart[f2.start];
f2.unshift(i2);
f2.start = start2;
if (g2 = fragmentByEnd[start2]) {
delete fragmentByEnd[g2.end];
var gf2 = g2 === f2 ? f2 : g2.concat(f2);
fragmentByStart[gf2.start = g2.start] = fragmentByEnd[gf2.end = f2.end] = gf2;
} else {
fragmentByStart[f2.start] = fragmentByEnd[f2.end] = f2;
}
} else {
f2 = [i2];
fragmentByStart[f2.start = start2] = fragmentByEnd[f2.end = end2] = f2;
}
});
function ends(i2) {
var arc2 = topology.arcs[i2 < 0 ? ~i2 : i2], p02 = arc2[0], p1;
if (topology.transform)
p1 = [0, 0], arc2.forEach(function(dp) {
p1[0] += dp[0], p1[1] += dp[1];
});
else
p1 = arc2[arc2.length - 1];
return i2 < 0 ? [p1, p02] : [p02, p1];
}
function flush(fragmentByEnd2, fragmentByStart2) {
for (var k2 in fragmentByEnd2) {
var f2 = fragmentByEnd2[k2];
delete fragmentByStart2[f2.start];
delete f2.start;
delete f2.end;
f2.forEach(function(i2) {
stitchedArcs[i2 < 0 ? ~i2 : i2] = 1;
});
fragments.push(f2);
}
}
flush(fragmentByEnd, fragmentByStart);
flush(fragmentByStart, fragmentByEnd);
arcs.forEach(function(i2) {
if (!stitchedArcs[i2 < 0 ? ~i2 : i2])
fragments.push([i2]);
});
return fragments;
}
function mesh(topology) {
return object$1(topology, meshArcs.apply(this, arguments));
}
function meshArcs(topology, object2, filter2) {
var arcs, i2, n2;
if (arguments.length > 1)
arcs = extractArcs(topology, object2, filter2);
else
for (i2 = 0, arcs = new Array(n2 = topology.arcs.length); i2 < n2; ++i2)
arcs[i2] = i2;
return { type: "MultiLineString", arcs: stitch(topology, arcs) };
}
function extractArcs(topology, object2, filter2) {
var arcs = [], geomsByArc = [], geom;
function extract0(i2) {
var j2 = i2 < 0 ? ~i2 : i2;
(geomsByArc[j2] || (geomsByArc[j2] = [])).push({ i: i2, g: geom });
}
function extract1(arcs2) {
arcs2.forEach(extract0);
}
function extract2(arcs2) {
arcs2.forEach(extract1);
}
function extract3(arcs2) {
arcs2.forEach(extract2);
}
function geometry(o2) {
switch (geom = o2, o2.type) {
case "GeometryCollection":
o2.geometries.forEach(geometry);
break;
case "LineString":
extract1(o2.arcs);
break;
case "MultiLineString":
case "Polygon":
extract2(o2.arcs);
break;
case "MultiPolygon":
extract3(o2.arcs);
break;
}
}
geometry(object2);
geomsByArc.forEach(filter2 == null ? function(geoms) {
arcs.push(geoms[0].i);
} : function(geoms) {
if (filter2(geoms[0].g, geoms[geoms.length - 1].g))
arcs.push(geoms[0].i);
});
return arcs;
}
class InternMap extends Map {
constructor(entries, key2 = keyof) {
super();
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
if (entries != null)
for (const [key3, value2] of entries)
this.set(key3, value2);
}
get(key2) {
return super.get(intern_get(this, key2));
}
has(key2) {
return super.has(intern_get(this, key2));
}
set(key2, value2) {
return super.set(intern_set(this, key2), value2);
}
delete(key2) {
return super.delete(intern_delete(this, key2));
}
}
class InternSet extends Set {
constructor(values2, key2 = keyof) {
super();
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
if (values2 != null)
for (const value2 of values2)
this.add(value2);
}
has(value2) {
return super.has(intern_get(this, value2));
}
add(value2) {
return super.add(intern_set(this, value2));
}
delete(value2) {
return super.delete(intern_delete(this, value2));
}
}
function intern_get({ _intern, _key }, value2) {
const key2 = _key(value2);
return _intern.has(key2) ? _intern.get(key2) : value2;
}
function intern_set({ _intern, _key }, value2) {
const key2 = _key(value2);
if (_intern.has(key2))
return _intern.get(key2);
_intern.set(key2, value2);
return value2;
}
function intern_delete({ _intern, _key }, value2) {
const key2 = _key(value2);
if (_intern.has(key2)) {
value2 = _intern.get(value2);
_intern.delete(key2);
}
return value2;
}
function keyof(value2) {
return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
}
const e10$4 = Math.sqrt(50), e5$4 = Math.sqrt(10), e2$4 = Math.sqrt(2);
function tickSpec$3(start2, stop2, count2) {
const step = (stop2 - start2) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error3 = step / Math.pow(10, power), factor = error3 >= e10$4 ? 10 : error3 >= e5$4 ? 5 : error3 >= e2$4 ? 2 : 1;
let i1, i2, inc;
if (power < 0) {
inc = Math.pow(10, -power) / factor;
i1 = Math.round(start2 * inc);
i2 = Math.round(stop2 * inc);
if (i1 / inc < start2)
++i1;
if (i2 / inc > stop2)
--i2;
inc = -inc;
} else {
inc = Math.pow(10, power) * factor;
i1 = Math.round(start2 / inc);
i2 = Math.round(stop2 / inc);
if (i1 * inc < start2)
++i1;
if (i2 * inc > stop2)
--i2;
}
if (i2 < i1 && 0.5 <= count2 && count2 < 2)
return tickSpec$3(start2, stop2, count2 * 2);
return [i1, i2, inc];
}
function tickIncrement$4(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
return tickSpec$3(start2, stop2, count2)[2];
}
function tickStep$4(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
const reverse3 = stop2 < start2, inc = reverse3 ? tickIncrement$4(stop2, start2, count2) : tickIncrement$4(start2, stop2, count2);
return (reverse3 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}
function formatDecimal(x2) {
return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
}
function formatDecimalParts(x2, p2) {
if ((i2 = (x2 = p2 ? x2.toExponential(p2 - 1) : x2.toExponential()).indexOf("e")) < 0)
return null;
var i2, coefficient = x2.slice(0, i2);
return [
coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
+x2.slice(i2 + 1)
];
}
function exponent(x2) {
return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
}
function formatGroup(grouping, thousands) {
return function(value2, width2) {
var i2 = value2.length, t5 = [], j2 = 0, g2 = grouping[0], length2 = 0;
while (i2 > 0 && g2 > 0) {
if (length2 + g2 + 1 > width2)
g2 = Math.max(1, width2 - length2);
t5.push(value2.substring(i2 -= g2, i2 + g2));
if ((length2 += g2 + 1) > width2)
break;
g2 = grouping[j2 = (j2 + 1) % grouping.length];
}
return t5.reverse().join(thousands);
};
}
function formatNumerals(numerals) {
return function(value2) {
return value2.replace(/[0-9]/g, function(i2) {
return numerals[+i2];
});
};
}
var re$2 = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function formatSpecifier(specifier) {
if (!(match2 = re$2.exec(specifier)))
throw new Error("invalid format: " + specifier);
var match2;
return new FormatSpecifier({
fill: match2[1],
align: match2[2],
sign: match2[3],
symbol: match2[4],
zero: match2[5],
width: match2[6],
comma: match2[7],
precision: match2[8] && match2[8].slice(1),
trim: match2[9],
type: match2[10]
});
}
formatSpecifier.prototype = FormatSpecifier.prototype;
function FormatSpecifier(specifier) {
this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
this.align = specifier.align === void 0 ? ">" : specifier.align + "";
this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
this.zero = !!specifier.zero;
this.width = specifier.width === void 0 ? void 0 : +specifier.width;
this.comma = !!specifier.comma;
this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
this.trim = !!specifier.trim;
this.type = specifier.type === void 0 ? "" : specifier.type + "";
}
FormatSpecifier.prototype.toString = function() {
return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
};
function formatTrim(s2) {
out:
for (var n2 = s2.length, i2 = 1, i0 = -1, i1; i2 < n2; ++i2) {
switch (s2[i2]) {
case ".":
i0 = i1 = i2;
break;
case "0":
if (i0 === 0)
i0 = i2;
i1 = i2;
break;
default:
if (!+s2[i2])
break out;
if (i0 > 0)
i0 = 0;
break;
}
}
return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
}
var prefixExponent;
function formatPrefixAuto(x2, p2) {
var d2 = formatDecimalParts(x2, p2);
if (!d2)
return x2 + "";
var coefficient = d2[0], exponent2 = d2[1], i2 = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n2 = coefficient.length;
return i2 === n2 ? coefficient : i2 > n2 ? coefficient + new Array(i2 - n2 + 1).join("0") : i2 > 0 ? coefficient.slice(0, i2) + "." + coefficient.slice(i2) : "0." + new Array(1 - i2).join("0") + formatDecimalParts(x2, Math.max(0, p2 + i2 - 1))[0];
}
function formatRounded(x2, p2) {
var d2 = formatDecimalParts(x2, p2);
if (!d2)
return x2 + "";
var coefficient = d2[0], exponent2 = d2[1];
return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0");
}
const formatTypes = {
"%": (x2, p2) => (x2 * 100).toFixed(p2),
"b": (x2) => Math.round(x2).toString(2),
"c": (x2) => x2 + "",
"d": formatDecimal,
"e": (x2, p2) => x2.toExponential(p2),
"f": (x2, p2) => x2.toFixed(p2),
"g": (x2, p2) => x2.toPrecision(p2),
"o": (x2) => Math.round(x2).toString(8),
"p": (x2, p2) => formatRounded(x2 * 100, p2),
"r": formatRounded,
"s": formatPrefixAuto,
"X": (x2) => Math.round(x2).toString(16).toUpperCase(),
"x": (x2) => Math.round(x2).toString(16)
};
function identity$4(x2) {
return x2;
}
var map$1 = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
function formatLocale$2(locale2) {
var group2 = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity$4 : formatGroup(map$1.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity$4 : formatNumerals(map$1.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
function newFormat(specifier) {
specifier = formatSpecifier(specifier);
var fill2 = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol2 = specifier.symbol, zero2 = specifier.zero, width2 = specifier.width, comma = specifier.comma, precision = specifier.precision, trim3 = specifier.trim, type2 = specifier.type;
if (type2 === "n")
comma = true, type2 = "g";
else if (!formatTypes[type2])
precision === void 0 && (precision = 12), trim3 = true, type2 = "g";
if (zero2 || fill2 === "0" && align === "=")
zero2 = true, fill2 = "0", align = "=";
var prefix2 = symbol2 === "$" ? currencyPrefix : symbol2 === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix2 = symbol2 === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "";
var formatType = formatTypes[type2], maybeSuffix = /[defgprs%]/.test(type2);
precision = precision === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
function format2(value2) {
var valuePrefix = prefix2, valueSuffix = suffix2, i2, n2, c2;
if (type2 === "c") {
valueSuffix = formatType(value2) + valueSuffix;
value2 = "";
} else {
value2 = +value2;
var valueNegative = value2 < 0 || 1 / value2 < 0;
value2 = isNaN(value2) ? nan : formatType(Math.abs(value2), precision);
if (trim3)
value2 = formatTrim(value2);
if (valueNegative && +value2 === 0 && sign2 !== "+")
valueNegative = false;
valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
if (maybeSuffix) {
i2 = -1, n2 = value2.length;
while (++i2 < n2) {
if (c2 = value2.charCodeAt(i2), 48 > c2 || c2 > 57) {
valueSuffix = (c2 === 46 ? decimal + value2.slice(i2 + 1) : value2.slice(i2)) + valueSuffix;
value2 = value2.slice(0, i2);
break;
}
}
}
}
if (comma && !zero2)
value2 = group2(value2, Infinity);
var length2 = valuePrefix.length + value2.length + valueSuffix.length, padding2 = length2 < width2 ? new Array(width2 - length2 + 1).join(fill2) : "";
if (comma && zero2)
value2 = group2(padding2 + value2, padding2.length ? width2 - valueSuffix.length : Infinity), padding2 = "";
switch (align) {
case "<":
value2 = valuePrefix + value2 + valueSuffix + padding2;
break;
case "=":
value2 = valuePrefix + padding2 + value2 + valueSuffix;
break;
case "^":
value2 = padding2.slice(0, length2 = padding2.length >> 1) + valuePrefix + value2 + valueSuffix + padding2.slice(length2);
break;
default:
value2 = padding2 + valuePrefix + value2 + valueSuffix;
break;
}
return numerals(value2);
}
format2.toString = function() {
return specifier + "";
};
return format2;
}
function formatPrefix2(specifier, value2) {
var f2 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e7 = Math.max(-8, Math.min(8, Math.floor(exponent(value2) / 3))) * 3, k2 = Math.pow(10, -e7), prefix2 = prefixes[8 + e7 / 3];
return function(value3) {
return f2(k2 * value3) + prefix2;
};
}
return {
format: newFormat,
formatPrefix: formatPrefix2
};
}
var locale$3;
var format$3;
var formatPrefix;
defaultLocale$3({
thousands: ",",
grouping: [3],
currency: ["$", ""]
});
function defaultLocale$3(definition2) {
locale$3 = formatLocale$2(definition2);
format$3 = locale$3.format;
formatPrefix = locale$3.formatPrefix;
return locale$3;
}
function precisionFixed(step) {
return Math.max(0, -exponent(Math.abs(step)));
}
function precisionPrefix(step, value2) {
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value2) / 3))) * 3 - exponent(Math.abs(step)));
}
function precisionRound(step, max2) {
step = Math.abs(step), max2 = Math.abs(max2) - step;
return Math.max(0, exponent(max2) - exponent(step)) + 1;
}
const t0$3 = /* @__PURE__ */ new Date(), t1$2 = /* @__PURE__ */ new Date();
function timeInterval$1(floori, offseti, count2, field2) {
function interval2(date2) {
return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
}
interval2.floor = (date2) => {
return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
};
interval2.ceil = (date2) => {
return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
};
interval2.round = (date2) => {
const d0 = interval2(date2), d1 = interval2.ceil(date2);
return date2 - d0 < d1 - date2 ? d0 : d1;
};
interval2.offset = (date2, step) => {
return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
};
interval2.range = (start2, stop2, step) => {
const range2 = [];
start2 = interval2.ceil(start2);
step = step == null ? 1 : Math.floor(step);
if (!(start2 < stop2) || !(step > 0))
return range2;
let previous;
do
range2.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2);
while (previous < start2 && start2 < stop2);
return range2;
};
interval2.filter = (test2) => {
return timeInterval$1((date2) => {
if (date2 >= date2)
while (floori(date2), !test2(date2))
date2.setTime(date2 - 1);
}, (date2, step) => {
if (date2 >= date2) {
if (step < 0)
while (++step <= 0) {
while (offseti(date2, -1), !test2(date2)) {
}
}
else
while (--step >= 0) {
while (offseti(date2, 1), !test2(date2)) {
}
}
}
});
};
if (count2) {
interval2.count = (start2, end2) => {
t0$3.setTime(+start2), t1$2.setTime(+end2);
floori(t0$3), floori(t1$2);
return Math.floor(count2(t0$3, t1$2));
};
interval2.every = (step) => {
step = Math.floor(step);
return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field2 ? (d2) => field2(d2) % step === 0 : (d2) => interval2.count(0, d2) % step === 0);
};
}
return interval2;
}
const millisecond$2 = timeInterval$1(() => {
}, (date2, step) => {
date2.setTime(+date2 + step);
}, (start2, end2) => {
return end2 - start2;
});
millisecond$2.every = (k2) => {
k2 = Math.floor(k2);
if (!isFinite(k2) || !(k2 > 0))
return null;
if (!(k2 > 1))
return millisecond$2;
return timeInterval$1((date2) => {
date2.setTime(Math.floor(date2 / k2) * k2);
}, (date2, step) => {
date2.setTime(+date2 + step * k2);
}, (start2, end2) => {
return (end2 - start2) / k2;
});
};
millisecond$2.range;
const durationSecond$2 = 1e3;
const durationMinute$2 = durationSecond$2 * 60;
const durationHour$2 = durationMinute$2 * 60;
const durationDay$2 = durationHour$2 * 24;
const durationWeek$2 = durationDay$2 * 7;
const second$1 = timeInterval$1((date2) => {
date2.setTime(date2 - date2.getMilliseconds());
}, (date2, step) => {
date2.setTime(+date2 + step * durationSecond$2);
}, (start2, end2) => {
return (end2 - start2) / durationSecond$2;
}, (date2) => {
return date2.getUTCSeconds();
});
second$1.range;
const timeMinute$1 = timeInterval$1((date2) => {
date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond$2);
}, (date2, step) => {
date2.setTime(+date2 + step * durationMinute$2);
}, (start2, end2) => {
return (end2 - start2) / durationMinute$2;
}, (date2) => {
return date2.getMinutes();
});
timeMinute$1.range;
const utcMinute$2 = timeInterval$1((date2) => {
date2.setUTCSeconds(0, 0);
}, (date2, step) => {
date2.setTime(+date2 + step * durationMinute$2);
}, (start2, end2) => {
return (end2 - start2) / durationMinute$2;
}, (date2) => {
return date2.getUTCMinutes();
});
utcMinute$2.range;
const timeHour$1 = timeInterval$1((date2) => {
date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond$2 - date2.getMinutes() * durationMinute$2);
}, (date2, step) => {
date2.setTime(+date2 + step * durationHour$2);
}, (start2, end2) => {
return (end2 - start2) / durationHour$2;
}, (date2) => {
return date2.getHours();
});
timeHour$1.range;
const utcHour$2 = timeInterval$1((date2) => {
date2.setUTCMinutes(0, 0, 0);
}, (date2, step) => {
date2.setTime(+date2 + step * durationHour$2);
}, (start2, end2) => {
return (end2 - start2) / durationHour$2;
}, (date2) => {
return date2.getUTCHours();
});
utcHour$2.range;
const timeDay$1 = timeInterval$1(
(date2) => date2.setHours(0, 0, 0, 0),
(date2, step) => date2.setDate(date2.getDate() + step),
(start2, end2) => (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute$2) / durationDay$2,
(date2) => date2.getDate() - 1
);
timeDay$1.range;
const utcDay$2 = timeInterval$1((date2) => {
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setUTCDate(date2.getUTCDate() + step);
}, (start2, end2) => {
return (end2 - start2) / durationDay$2;
}, (date2) => {
return date2.getUTCDate() - 1;
});
utcDay$2.range;
const unixDay = timeInterval$1((date2) => {
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setUTCDate(date2.getUTCDate() + step);
}, (start2, end2) => {
return (end2 - start2) / durationDay$2;
}, (date2) => {
return Math.floor(date2 / durationDay$2);
});
unixDay.range;
function timeWeekday(i2) {
return timeInterval$1((date2) => {
date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7);
date2.setHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setDate(date2.getDate() + step * 7);
}, (start2, end2) => {
return (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute$2) / durationWeek$2;
});
}
const timeSunday = timeWeekday(0);
const timeMonday = timeWeekday(1);
const timeTuesday = timeWeekday(2);
const timeWednesday = timeWeekday(3);
const timeThursday = timeWeekday(4);
const timeFriday = timeWeekday(5);
const timeSaturday = timeWeekday(6);
timeSunday.range;
timeMonday.range;
timeTuesday.range;
timeWednesday.range;
timeThursday.range;
timeFriday.range;
timeSaturday.range;
function utcWeekday$1(i2) {
return timeInterval$1((date2) => {
date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setUTCDate(date2.getUTCDate() + step * 7);
}, (start2, end2) => {
return (end2 - start2) / durationWeek$2;
});
}
const utcSunday$1 = utcWeekday$1(0);
const utcMonday$1 = utcWeekday$1(1);
const utcTuesday$1 = utcWeekday$1(2);
const utcWednesday$1 = utcWeekday$1(3);
const utcThursday$1 = utcWeekday$1(4);
const utcFriday$1 = utcWeekday$1(5);
const utcSaturday$1 = utcWeekday$1(6);
utcSunday$1.range;
utcMonday$1.range;
utcTuesday$1.range;
utcWednesday$1.range;
utcThursday$1.range;
utcFriday$1.range;
utcSaturday$1.range;
const timeMonth$1 = timeInterval$1((date2) => {
date2.setDate(1);
date2.setHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setMonth(date2.getMonth() + step);
}, (start2, end2) => {
return end2.getMonth() - start2.getMonth() + (end2.getFullYear() - start2.getFullYear()) * 12;
}, (date2) => {
return date2.getMonth();
});
timeMonth$1.range;
const utcMonth$2 = timeInterval$1((date2) => {
date2.setUTCDate(1);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setUTCMonth(date2.getUTCMonth() + step);
}, (start2, end2) => {
return end2.getUTCMonth() - start2.getUTCMonth() + (end2.getUTCFullYear() - start2.getUTCFullYear()) * 12;
}, (date2) => {
return date2.getUTCMonth();
});
utcMonth$2.range;
const timeYear$1 = timeInterval$1((date2) => {
date2.setMonth(0, 1);
date2.setHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setFullYear(date2.getFullYear() + step);
}, (start2, end2) => {
return end2.getFullYear() - start2.getFullYear();
}, (date2) => {
return date2.getFullYear();
});
timeYear$1.every = (k2) => {
return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval$1((date2) => {
date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
date2.setMonth(0, 1);
date2.setHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setFullYear(date2.getFullYear() + step * k2);
});
};
timeYear$1.range;
const utcYear$2 = timeInterval$1((date2) => {
date2.setUTCMonth(0, 1);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setUTCFullYear(date2.getUTCFullYear() + step);
}, (start2, end2) => {
return end2.getUTCFullYear() - start2.getUTCFullYear();
}, (date2) => {
return date2.getUTCFullYear();
});
utcYear$2.every = (k2) => {
return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval$1((date2) => {
date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
date2.setUTCMonth(0, 1);
date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
date2.setUTCFullYear(date2.getUTCFullYear() + step * k2);
});
};
utcYear$2.range;
function ascending$7(a2, b2) {
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function descending$5(a2, b2) {
return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN;
}
function bisector$5(f2) {
let compare12, compare22, delta;
if (f2.length !== 2) {
compare12 = ascending$7;
compare22 = (d2, x2) => ascending$7(f2(d2), x2);
delta = (d2, x2) => f2(d2) - x2;
} else {
compare12 = f2 === ascending$7 || f2 === descending$5 ? f2 : zero$6;
compare22 = f2;
delta = f2;
}
function left2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) < 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function right2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) <= 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function center(a2, x2, lo2 = 0, hi2 = a2.length) {
const i2 = left2(a2, x2, lo2, hi2 - 1);
return i2 > lo2 && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
}
return { left: left2, center, right: right2 };
}
function zero$6() {
return 0;
}
const e10$3 = Math.sqrt(50), e5$3 = Math.sqrt(10), e2$3 = Math.sqrt(2);
function tickSpec$2(start2, stop2, count2) {
const step = (stop2 - start2) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error3 = step / Math.pow(10, power), factor = error3 >= e10$3 ? 10 : error3 >= e5$3 ? 5 : error3 >= e2$3 ? 2 : 1;
let i1, i2, inc;
if (power < 0) {
inc = Math.pow(10, -power) / factor;
i1 = Math.round(start2 * inc);
i2 = Math.round(stop2 * inc);
if (i1 / inc < start2)
++i1;
if (i2 / inc > stop2)
--i2;
inc = -inc;
} else {
inc = Math.pow(10, power) * factor;
i1 = Math.round(start2 / inc);
i2 = Math.round(stop2 / inc);
if (i1 * inc < start2)
++i1;
if (i2 * inc > stop2)
--i2;
}
if (i2 < i1 && 0.5 <= count2 && count2 < 2)
return tickSpec$2(start2, stop2, count2 * 2);
return [i1, i2, inc];
}
function tickIncrement$3(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
return tickSpec$2(start2, stop2, count2)[2];
}
function tickStep$3(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
const reverse3 = stop2 < start2, inc = reverse3 ? tickIncrement$3(stop2, start2, count2) : tickIncrement$3(start2, stop2, count2);
return (reverse3 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}
const YEAR = "year";
const QUARTER = "quarter";
const MONTH = "month";
const WEEK = "week";
const DATE = "date";
const DAY = "day";
const DAYOFYEAR = "dayofyear";
const HOURS = "hours";
const MINUTES = "minutes";
const SECONDS = "seconds";
const MILLISECONDS = "milliseconds";
const TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];
const UNITS = TIME_UNITS.reduce((o2, u2, i2) => (o2[u2] = 1 + i2, o2), {});
function timeUnits(units) {
const u2 = array$5(units).slice(), m2 = {};
if (!u2.length)
error2("Missing time unit.");
u2.forEach((unit2) => {
if (has$2(UNITS, unit2)) {
m2[unit2] = 1;
} else {
error2(`Invalid time unit: ${unit2}.`);
}
});
const numTypes = (m2[WEEK] || m2[DAY] ? 1 : 0) + (m2[QUARTER] || m2[MONTH] || m2[DATE] ? 1 : 0) + (m2[DAYOFYEAR] ? 1 : 0);
if (numTypes > 1) {
error2(`Incompatible time units: ${units}`);
}
u2.sort((a2, b2) => UNITS[a2] - UNITS[b2]);
return u2;
}
const defaultSpecifiers = {
[YEAR]: "%Y ",
[QUARTER]: "Q%q ",
[MONTH]: "%b ",
[DATE]: "%d ",
[WEEK]: "W%U ",
[DAY]: "%a ",
[DAYOFYEAR]: "%j ",
[HOURS]: "%H:00",
[MINUTES]: "00:%M",
[SECONDS]: ":%S",
[MILLISECONDS]: ".%L",
[`${YEAR}-${MONTH}`]: "%Y-%m ",
[`${YEAR}-${MONTH}-${DATE}`]: "%Y-%m-%d ",
[`${HOURS}-${MINUTES}`]: "%H:%M"
};
function timeUnitSpecifier(units, specifiers) {
const s2 = extend$2({}, defaultSpecifiers, specifiers), u2 = timeUnits(units), n2 = u2.length;
let fmt = "", start2 = 0, end2, key2;
for (start2 = 0; start2 < n2; ) {
for (end2 = u2.length; end2 > start2; --end2) {
key2 = u2.slice(start2, end2).join("-");
if (s2[key2] != null) {
fmt += s2[key2];
start2 = end2;
break;
}
}
}
return fmt.trim();
}
const t0$2 = /* @__PURE__ */ new Date();
function localYear(y2) {
t0$2.setFullYear(y2);
t0$2.setMonth(0);
t0$2.setDate(1);
t0$2.setHours(0, 0, 0, 0);
return t0$2;
}
function dayofyear(d2) {
return localDayOfYear(new Date(d2));
}
function week(d2) {
return localWeekNum(new Date(d2));
}
function localDayOfYear(d2) {
return timeDay$1.count(localYear(d2.getFullYear()) - 1, d2);
}
function localWeekNum(d2) {
return timeSunday.count(localYear(d2.getFullYear()) - 1, d2);
}
function localFirst(y2) {
return localYear(y2).getDay();
}
function localDate$2(y2, m2, d2, H4, M2, S2, L2) {
if (0 <= y2 && y2 < 100) {
const date2 = new Date(-1, m2, d2, H4, M2, S2, L2);
date2.setFullYear(y2);
return date2;
}
return new Date(y2, m2, d2, H4, M2, S2, L2);
}
function utcdayofyear(d2) {
return utcDayOfYear(new Date(d2));
}
function utcweek(d2) {
return utcWeekNum(new Date(d2));
}
function utcDayOfYear(d2) {
const y2 = Date.UTC(d2.getUTCFullYear(), 0, 1);
return utcDay$2.count(y2 - 1, d2);
}
function utcWeekNum(d2) {
const y2 = Date.UTC(d2.getUTCFullYear(), 0, 1);
return utcSunday$1.count(y2 - 1, d2);
}
function utcFirst(y2) {
t0$2.setTime(Date.UTC(y2, 0, 1));
return t0$2.getUTCDay();
}
function utcDate$2(y2, m2, d2, H4, M2, S2, L2) {
if (0 <= y2 && y2 < 100) {
const date2 = new Date(Date.UTC(-1, m2, d2, H4, M2, S2, L2));
date2.setUTCFullYear(d2.y);
return date2;
}
return new Date(Date.UTC(y2, m2, d2, H4, M2, S2, L2));
}
function floor$2(units, step, get2, inv, newDate2) {
const s2 = step || 1, b2 = peek$1(units), _24 = (unit2, p2, key2) => {
key2 = key2 || unit2;
return getUnit(get2[key2], inv[key2], unit2 === b2 && s2, p2);
};
const t5 = /* @__PURE__ */ new Date(), u2 = toSet(units), y2 = u2[YEAR] ? _24(YEAR) : constant$6(2012), m2 = u2[MONTH] ? _24(MONTH) : u2[QUARTER] ? _24(QUARTER) : zero$7, d2 = u2[WEEK] && u2[DAY] ? _24(DAY, 1, WEEK + DAY) : u2[WEEK] ? _24(WEEK, 1) : u2[DAY] ? _24(DAY, 1) : u2[DATE] ? _24(DATE, 1) : u2[DAYOFYEAR] ? _24(DAYOFYEAR, 1) : one$2, H4 = u2[HOURS] ? _24(HOURS) : zero$7, M2 = u2[MINUTES] ? _24(MINUTES) : zero$7, S2 = u2[SECONDS] ? _24(SECONDS) : zero$7, L2 = u2[MILLISECONDS] ? _24(MILLISECONDS) : zero$7;
return function(v2) {
t5.setTime(+v2);
const year2 = y2(t5);
return newDate2(year2, m2(t5), d2(t5, year2), H4(t5), M2(t5), S2(t5), L2(t5));
};
}
function getUnit(f2, inv, step, phase) {
const u2 = step <= 1 ? f2 : phase ? (d2, y2) => phase + step * Math.floor((f2(d2, y2) - phase) / step) : (d2, y2) => step * Math.floor(f2(d2, y2) / step);
return inv ? (d2, y2) => inv(u2(d2, y2), y2) : u2;
}
function weekday$1(week2, day2, firstDay) {
return day2 + week2 * 7 - (firstDay + 6) % 7;
}
const localGet = {
[YEAR]: (d2) => d2.getFullYear(),
[QUARTER]: (d2) => Math.floor(d2.getMonth() / 3),
[MONTH]: (d2) => d2.getMonth(),
[DATE]: (d2) => d2.getDate(),
[HOURS]: (d2) => d2.getHours(),
[MINUTES]: (d2) => d2.getMinutes(),
[SECONDS]: (d2) => d2.getSeconds(),
[MILLISECONDS]: (d2) => d2.getMilliseconds(),
[DAYOFYEAR]: (d2) => localDayOfYear(d2),
[WEEK]: (d2) => localWeekNum(d2),
[WEEK + DAY]: (d2, y2) => weekday$1(localWeekNum(d2), d2.getDay(), localFirst(y2)),
[DAY]: (d2, y2) => weekday$1(1, d2.getDay(), localFirst(y2))
};
const localInv = {
[QUARTER]: (q2) => 3 * q2,
[WEEK]: (w2, y2) => weekday$1(w2, 0, localFirst(y2))
};
function timeFloor(units, step) {
return floor$2(units, step || 1, localGet, localInv, localDate$2);
}
const utcGet = {
[YEAR]: (d2) => d2.getUTCFullYear(),
[QUARTER]: (d2) => Math.floor(d2.getUTCMonth() / 3),
[MONTH]: (d2) => d2.getUTCMonth(),
[DATE]: (d2) => d2.getUTCDate(),
[HOURS]: (d2) => d2.getUTCHours(),
[MINUTES]: (d2) => d2.getUTCMinutes(),
[SECONDS]: (d2) => d2.getUTCSeconds(),
[MILLISECONDS]: (d2) => d2.getUTCMilliseconds(),
[DAYOFYEAR]: (d2) => utcDayOfYear(d2),
[WEEK]: (d2) => utcWeekNum(d2),
[DAY]: (d2, y2) => weekday$1(1, d2.getUTCDay(), utcFirst(y2)),
[WEEK + DAY]: (d2, y2) => weekday$1(utcWeekNum(d2), d2.getUTCDay(), utcFirst(y2))
};
const utcInv = {
[QUARTER]: (q2) => 3 * q2,
[WEEK]: (w2, y2) => weekday$1(w2, 0, utcFirst(y2))
};
function utcFloor(units, step) {
return floor$2(units, step || 1, utcGet, utcInv, utcDate$2);
}
const timeIntervals = {
[YEAR]: timeYear$1,
[QUARTER]: timeMonth$1.every(3),
[MONTH]: timeMonth$1,
[WEEK]: timeSunday,
[DATE]: timeDay$1,
[DAY]: timeDay$1,
[DAYOFYEAR]: timeDay$1,
[HOURS]: timeHour$1,
[MINUTES]: timeMinute$1,
[SECONDS]: second$1,
[MILLISECONDS]: millisecond$2
};
const utcIntervals = {
[YEAR]: utcYear$2,
[QUARTER]: utcMonth$2.every(3),
[MONTH]: utcMonth$2,
[WEEK]: utcSunday$1,
[DATE]: utcDay$2,
[DAY]: utcDay$2,
[DAYOFYEAR]: utcDay$2,
[HOURS]: utcHour$2,
[MINUTES]: utcMinute$2,
[SECONDS]: second$1,
[MILLISECONDS]: millisecond$2
};
function timeInterval(unit2) {
return timeIntervals[unit2];
}
function utcInterval(unit2) {
return utcIntervals[unit2];
}
function offset$3(ival, date2, step) {
return ival ? ival.offset(date2, step) : void 0;
}
function timeOffset(unit2, date2, step) {
return offset$3(timeInterval(unit2), date2, step);
}
function utcOffset(unit2, date2, step) {
return offset$3(utcInterval(unit2), date2, step);
}
function sequence$1(ival, start2, stop2, step) {
return ival ? ival.range(start2, stop2, step) : void 0;
}
function timeSequence(unit2, start2, stop2, step) {
return sequence$1(timeInterval(unit2), start2, stop2, step);
}
function utcSequence(unit2, start2, stop2, step) {
return sequence$1(utcInterval(unit2), start2, stop2, step);
}
const durationSecond$1 = 1e3, durationMinute$1 = durationSecond$1 * 60, durationHour$1 = durationMinute$1 * 60, durationDay$1 = durationHour$1 * 24, durationWeek$1 = durationDay$1 * 7, durationMonth$1 = durationDay$1 * 30, durationYear$1 = durationDay$1 * 365;
const Milli = [YEAR, MONTH, DATE, HOURS, MINUTES, SECONDS, MILLISECONDS], Seconds = Milli.slice(0, -1), Minutes = Seconds.slice(0, -1), Hours = Minutes.slice(0, -1), Day = Hours.slice(0, -1), Week = [YEAR, WEEK], Month = [YEAR, MONTH], Year = [YEAR];
const intervals = [[Seconds, 1, durationSecond$1], [Seconds, 5, 5 * durationSecond$1], [Seconds, 15, 15 * durationSecond$1], [Seconds, 30, 30 * durationSecond$1], [Minutes, 1, durationMinute$1], [Minutes, 5, 5 * durationMinute$1], [Minutes, 15, 15 * durationMinute$1], [Minutes, 30, 30 * durationMinute$1], [Hours, 1, durationHour$1], [Hours, 3, 3 * durationHour$1], [Hours, 6, 6 * durationHour$1], [Hours, 12, 12 * durationHour$1], [Day, 1, durationDay$1], [Week, 1, durationWeek$1], [Month, 1, durationMonth$1], [Month, 3, 3 * durationMonth$1], [Year, 1, durationYear$1]];
function bin$1(opt) {
const ext = opt.extent, max2 = opt.maxbins || 40, target2 = Math.abs(span(ext)) / max2;
let i2 = bisector$5((i3) => i3[2]).right(intervals, target2), units, step;
if (i2 === intervals.length) {
units = Year, step = tickStep$3(ext[0] / durationYear$1, ext[1] / durationYear$1, max2);
} else if (i2) {
i2 = intervals[target2 / intervals[i2 - 1][2] < intervals[i2][2] / target2 ? i2 - 1 : i2];
units = i2[0];
step = i2[1];
} else {
units = Milli;
step = Math.max(tickStep$3(ext[0], ext[1], max2), 1);
}
return {
units,
step
};
}
var t0$1 = /* @__PURE__ */ new Date(), t1$1 = /* @__PURE__ */ new Date();
function newInterval(floori, offseti, count2, field2) {
function interval2(date2) {
return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
}
interval2.floor = function(date2) {
return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
};
interval2.ceil = function(date2) {
return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
};
interval2.round = function(date2) {
var d0 = interval2(date2), d1 = interval2.ceil(date2);
return date2 - d0 < d1 - date2 ? d0 : d1;
};
interval2.offset = function(date2, step) {
return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
};
interval2.range = function(start2, stop2, step) {
var range2 = [], previous;
start2 = interval2.ceil(start2);
step = step == null ? 1 : Math.floor(step);
if (!(start2 < stop2) || !(step > 0))
return range2;
do
range2.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2);
while (previous < start2 && start2 < stop2);
return range2;
};
interval2.filter = function(test2) {
return newInterval(function(date2) {
if (date2 >= date2)
while (floori(date2), !test2(date2))
date2.setTime(date2 - 1);
}, function(date2, step) {
if (date2 >= date2) {
if (step < 0)
while (++step <= 0) {
while (offseti(date2, -1), !test2(date2)) {
}
}
else
while (--step >= 0) {
while (offseti(date2, 1), !test2(date2)) {
}
}
}
});
};
if (count2) {
interval2.count = function(start2, end2) {
t0$1.setTime(+start2), t1$1.setTime(+end2);
floori(t0$1), floori(t1$1);
return Math.floor(count2(t0$1, t1$1));
};
interval2.every = function(step) {
step = Math.floor(step);
return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field2 ? function(d2) {
return field2(d2) % step === 0;
} : function(d2) {
return interval2.count(0, d2) % step === 0;
});
};
}
return interval2;
}
var millisecond = newInterval(function() {
}, function(date2, step) {
date2.setTime(+date2 + step);
}, function(start2, end2) {
return end2 - start2;
});
millisecond.every = function(k2) {
k2 = Math.floor(k2);
if (!isFinite(k2) || !(k2 > 0))
return null;
if (!(k2 > 1))
return millisecond;
return newInterval(function(date2) {
date2.setTime(Math.floor(date2 / k2) * k2);
}, function(date2, step) {
date2.setTime(+date2 + step * k2);
}, function(start2, end2) {
return (end2 - start2) / k2;
});
};
const millisecond$1 = millisecond;
millisecond.range;
const durationSecond = 1e3;
const durationMinute = durationSecond * 60;
const durationHour = durationMinute * 60;
const durationDay = durationHour * 24;
const durationWeek = durationDay * 7;
const durationMonth = durationDay * 30;
const durationYear = durationDay * 365;
var second = newInterval(function(date2) {
date2.setTime(date2 - date2.getMilliseconds());
}, function(date2, step) {
date2.setTime(+date2 + step * durationSecond);
}, function(start2, end2) {
return (end2 - start2) / durationSecond;
}, function(date2) {
return date2.getUTCSeconds();
});
const utcSecond = second;
second.range;
var minute = newInterval(function(date2) {
date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
}, function(date2, step) {
date2.setTime(+date2 + step * durationMinute);
}, function(start2, end2) {
return (end2 - start2) / durationMinute;
}, function(date2) {
return date2.getMinutes();
});
const timeMinute = minute;
minute.range;
var hour = newInterval(function(date2) {
date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
}, function(date2, step) {
date2.setTime(+date2 + step * durationHour);
}, function(start2, end2) {
return (end2 - start2) / durationHour;
}, function(date2) {
return date2.getHours();
});
const timeHour = hour;
hour.range;
var day = newInterval(
(date2) => date2.setHours(0, 0, 0, 0),
(date2, step) => date2.setDate(date2.getDate() + step),
(start2, end2) => (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationDay,
(date2) => date2.getDate() - 1
);
const timeDay = day;
day.range;
function weekday(i2) {
return newInterval(function(date2) {
date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7);
date2.setHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setDate(date2.getDate() + step * 7);
}, function(start2, end2) {
return (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek;
});
}
var sunday = weekday(0);
var monday = weekday(1);
var tuesday = weekday(2);
var wednesday = weekday(3);
var thursday = weekday(4);
var friday = weekday(5);
var saturday = weekday(6);
sunday.range;
monday.range;
tuesday.range;
wednesday.range;
thursday.range;
friday.range;
saturday.range;
var month = newInterval(function(date2) {
date2.setDate(1);
date2.setHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setMonth(date2.getMonth() + step);
}, function(start2, end2) {
return end2.getMonth() - start2.getMonth() + (end2.getFullYear() - start2.getFullYear()) * 12;
}, function(date2) {
return date2.getMonth();
});
const timeMonth = month;
month.range;
var year = newInterval(function(date2) {
date2.setMonth(0, 1);
date2.setHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setFullYear(date2.getFullYear() + step);
}, function(start2, end2) {
return end2.getFullYear() - start2.getFullYear();
}, function(date2) {
return date2.getFullYear();
});
year.every = function(k2) {
return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : newInterval(function(date2) {
date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
date2.setMonth(0, 1);
date2.setHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setFullYear(date2.getFullYear() + step * k2);
});
};
const timeYear = year;
year.range;
var utcMinute = newInterval(function(date2) {
date2.setUTCSeconds(0, 0);
}, function(date2, step) {
date2.setTime(+date2 + step * durationMinute);
}, function(start2, end2) {
return (end2 - start2) / durationMinute;
}, function(date2) {
return date2.getUTCMinutes();
});
const utcMinute$1 = utcMinute;
utcMinute.range;
var utcHour = newInterval(function(date2) {
date2.setUTCMinutes(0, 0, 0);
}, function(date2, step) {
date2.setTime(+date2 + step * durationHour);
}, function(start2, end2) {
return (end2 - start2) / durationHour;
}, function(date2) {
return date2.getUTCHours();
});
const utcHour$1 = utcHour;
utcHour.range;
var utcDay = newInterval(function(date2) {
date2.setUTCHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setUTCDate(date2.getUTCDate() + step);
}, function(start2, end2) {
return (end2 - start2) / durationDay;
}, function(date2) {
return date2.getUTCDate() - 1;
});
const utcDay$1 = utcDay;
utcDay.range;
function utcWeekday(i2) {
return newInterval(function(date2) {
date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7);
date2.setUTCHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setUTCDate(date2.getUTCDate() + step * 7);
}, function(start2, end2) {
return (end2 - start2) / durationWeek;
});
}
var utcSunday = utcWeekday(0);
var utcMonday = utcWeekday(1);
var utcTuesday = utcWeekday(2);
var utcWednesday = utcWeekday(3);
var utcThursday = utcWeekday(4);
var utcFriday = utcWeekday(5);
var utcSaturday = utcWeekday(6);
utcSunday.range;
utcMonday.range;
utcTuesday.range;
utcWednesday.range;
utcThursday.range;
utcFriday.range;
utcSaturday.range;
var utcMonth = newInterval(function(date2) {
date2.setUTCDate(1);
date2.setUTCHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setUTCMonth(date2.getUTCMonth() + step);
}, function(start2, end2) {
return end2.getUTCMonth() - start2.getUTCMonth() + (end2.getUTCFullYear() - start2.getUTCFullYear()) * 12;
}, function(date2) {
return date2.getUTCMonth();
});
const utcMonth$1 = utcMonth;
utcMonth.range;
var utcYear = newInterval(function(date2) {
date2.setUTCMonth(0, 1);
date2.setUTCHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setUTCFullYear(date2.getUTCFullYear() + step);
}, function(start2, end2) {
return end2.getUTCFullYear() - start2.getUTCFullYear();
}, function(date2) {
return date2.getUTCFullYear();
});
utcYear.every = function(k2) {
return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : newInterval(function(date2) {
date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
date2.setUTCMonth(0, 1);
date2.setUTCHours(0, 0, 0, 0);
}, function(date2, step) {
date2.setUTCFullYear(date2.getUTCFullYear() + step * k2);
});
};
const utcYear$1 = utcYear;
utcYear.range;
function ascending$6(a2, b2) {
return a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function bisector$4(f2) {
let delta = f2;
let compare3 = f2;
if (f2.length === 1) {
delta = (d2, x2) => f2(d2) - x2;
compare3 = ascendingComparator(f2);
}
function left2(a2, x2, lo2, hi2) {
if (lo2 == null)
lo2 = 0;
if (hi2 == null)
hi2 = a2.length;
while (lo2 < hi2) {
const mid = lo2 + hi2 >>> 1;
if (compare3(a2[mid], x2) < 0)
lo2 = mid + 1;
else
hi2 = mid;
}
return lo2;
}
function right2(a2, x2, lo2, hi2) {
if (lo2 == null)
lo2 = 0;
if (hi2 == null)
hi2 = a2.length;
while (lo2 < hi2) {
const mid = lo2 + hi2 >>> 1;
if (compare3(a2[mid], x2) > 0)
hi2 = mid;
else
lo2 = mid + 1;
}
return lo2;
}
function center(a2, x2, lo2, hi2) {
if (lo2 == null)
lo2 = 0;
if (hi2 == null)
hi2 = a2.length;
const i2 = left2(a2, x2, lo2, hi2 - 1);
return i2 > lo2 && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
}
return { left: left2, center, right: right2 };
}
function ascendingComparator(f2) {
return (d2, x2) => ascending$6(f2(d2), x2);
}
function number$9(x2) {
return x2 === null ? NaN : +x2;
}
const ascendingBisect$2 = bisector$4(ascending$6);
const bisectRight$3 = ascendingBisect$2.right;
bisector$4(number$9).center;
const bisect$2 = bisectRight$3;
class Adder {
constructor() {
this._partials = new Float64Array(32);
this._n = 0;
}
add(x2) {
const p2 = this._partials;
let i2 = 0;
for (let j2 = 0; j2 < this._n && j2 < 32; j2++) {
const y2 = p2[j2], hi2 = x2 + y2, lo2 = Math.abs(x2) < Math.abs(y2) ? x2 - (hi2 - y2) : y2 - (hi2 - x2);
if (lo2)
p2[i2++] = lo2;
x2 = hi2;
}
p2[i2] = x2;
this._n = i2 + 1;
return this;
}
valueOf() {
const p2 = this._partials;
let n2 = this._n, x2, y2, lo2, hi2 = 0;
if (n2 > 0) {
hi2 = p2[--n2];
while (n2 > 0) {
x2 = hi2;
y2 = p2[--n2];
hi2 = x2 + y2;
lo2 = y2 - (hi2 - x2);
if (lo2)
break;
}
if (n2 > 0 && (lo2 < 0 && p2[n2 - 1] < 0 || lo2 > 0 && p2[n2 - 1] > 0)) {
y2 = lo2 * 2;
x2 = hi2 + y2;
if (y2 == x2 - hi2)
hi2 = x2;
}
}
return hi2;
}
}
var e10$2 = Math.sqrt(50), e5$2 = Math.sqrt(10), e2$2 = Math.sqrt(2);
function ticks(start2, stop2, count2) {
var reverse3, i2 = -1, n2, ticks2, step;
stop2 = +stop2, start2 = +start2, count2 = +count2;
if (start2 === stop2 && count2 > 0)
return [start2];
if (reverse3 = stop2 < start2)
n2 = start2, start2 = stop2, stop2 = n2;
if ((step = tickIncrement$2(start2, stop2, count2)) === 0 || !isFinite(step))
return [];
if (step > 0) {
let r0 = Math.round(start2 / step), r1 = Math.round(stop2 / step);
if (r0 * step < start2)
++r0;
if (r1 * step > stop2)
--r1;
ticks2 = new Array(n2 = r1 - r0 + 1);
while (++i2 < n2)
ticks2[i2] = (r0 + i2) * step;
} else {
step = -step;
let r0 = Math.round(start2 * step), r1 = Math.round(stop2 * step);
if (r0 / step < start2)
++r0;
if (r1 / step > stop2)
--r1;
ticks2 = new Array(n2 = r1 - r0 + 1);
while (++i2 < n2)
ticks2[i2] = (r0 + i2) / step;
}
if (reverse3)
ticks2.reverse();
return ticks2;
}
function tickIncrement$2(start2, stop2, count2) {
var step = (stop2 - start2) / Math.max(0, count2), power = Math.floor(Math.log(step) / Math.LN10), error3 = step / Math.pow(10, power);
return power >= 0 ? (error3 >= e10$2 ? 10 : error3 >= e5$2 ? 5 : error3 >= e2$2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error3 >= e10$2 ? 10 : error3 >= e5$2 ? 5 : error3 >= e2$2 ? 2 : 1);
}
function tickStep$2(start2, stop2, count2) {
var step0 = Math.abs(stop2 - start2) / Math.max(0, count2), step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), error3 = step0 / step1;
if (error3 >= e10$2)
step1 *= 10;
else if (error3 >= e5$2)
step1 *= 5;
else if (error3 >= e2$2)
step1 *= 2;
return stop2 < start2 ? -step1 : step1;
}
function quantileSorted$1(values2, p2, valueof = number$9) {
if (!(n2 = values2.length))
return;
if ((p2 = +p2) <= 0 || n2 < 2)
return +valueof(values2[0], 0, values2);
if (p2 >= 1)
return +valueof(values2[n2 - 1], n2 - 1, values2);
var n2, i2 = (n2 - 1) * p2, i0 = Math.floor(i2), value0 = +valueof(values2[i0], i0, values2), value1 = +valueof(values2[i0 + 1], i0 + 1, values2);
return value0 + (value1 - value0) * (i2 - i0);
}
function* flatten(arrays) {
for (const array2 of arrays) {
yield* array2;
}
}
function merge$2(arrays) {
return Array.from(flatten(arrays));
}
function range$8(start2, stop2, step) {
start2 = +start2, stop2 = +stop2, step = (n2 = arguments.length) < 2 ? (stop2 = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop2 - start2) / step)) | 0, range2 = new Array(n2);
while (++i2 < n2) {
range2[i2] = start2 + i2 * step;
}
return range2;
}
function ticker(year2, month2, week2, day2, hour2, minute2) {
const tickIntervals = [
[utcSecond, 1, durationSecond],
[utcSecond, 5, 5 * durationSecond],
[utcSecond, 15, 15 * durationSecond],
[utcSecond, 30, 30 * durationSecond],
[minute2, 1, durationMinute],
[minute2, 5, 5 * durationMinute],
[minute2, 15, 15 * durationMinute],
[minute2, 30, 30 * durationMinute],
[hour2, 1, durationHour],
[hour2, 3, 3 * durationHour],
[hour2, 6, 6 * durationHour],
[hour2, 12, 12 * durationHour],
[day2, 1, durationDay],
[day2, 2, 2 * durationDay],
[week2, 1, durationWeek],
[month2, 1, durationMonth],
[month2, 3, 3 * durationMonth],
[year2, 1, durationYear]
];
function ticks2(start2, stop2, count2) {
const reverse3 = stop2 < start2;
if (reverse3)
[start2, stop2] = [stop2, start2];
const interval2 = count2 && typeof count2.range === "function" ? count2 : tickInterval(start2, stop2, count2);
const ticks3 = interval2 ? interval2.range(start2, +stop2 + 1) : [];
return reverse3 ? ticks3.reverse() : ticks3;
}
function tickInterval(start2, stop2, count2) {
const target2 = Math.abs(stop2 - start2) / count2;
const i2 = bisector$4(([, , step2]) => step2).right(tickIntervals, target2);
if (i2 === tickIntervals.length)
return year2.every(tickStep$2(start2 / durationYear, stop2 / durationYear, count2));
if (i2 === 0)
return millisecond$1.every(Math.max(tickStep$2(start2, stop2, count2), 1));
const [t5, step] = tickIntervals[target2 / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target2 ? i2 - 1 : i2];
return t5.every(step);
}
return [ticks2, tickInterval];
}
const [utcTicks, utcTickInterval] = ticker(utcYear$1, utcMonth$1, utcSunday, utcDay$1, utcHour$1, utcMinute$1);
const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, sunday, timeDay, timeHour, timeMinute);
function localDate$1(d2) {
if (0 <= d2.y && d2.y < 100) {
var date2 = new Date(-1, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L);
date2.setFullYear(d2.y);
return date2;
}
return new Date(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L);
}
function utcDate$1(d2) {
if (0 <= d2.y && d2.y < 100) {
var date2 = new Date(Date.UTC(-1, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L));
date2.setUTCFullYear(d2.y);
return date2;
}
return new Date(Date.UTC(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L));
}
function newDate$1(y2, m2, d2) {
return { y: y2, m: m2, d: d2, H: 0, M: 0, S: 0, L: 0 };
}
function formatLocale$1(locale2) {
var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths;
var periodRe = formatRe$1(locale_periods), periodLookup = formatLookup$1(locale_periods), weekdayRe = formatRe$1(locale_weekdays), weekdayLookup = formatLookup$1(locale_weekdays), shortWeekdayRe = formatRe$1(locale_shortWeekdays), shortWeekdayLookup = formatLookup$1(locale_shortWeekdays), monthRe = formatRe$1(locale_months), monthLookup = formatLookup$1(locale_months), shortMonthRe = formatRe$1(locale_shortMonths), shortMonthLookup = formatLookup$1(locale_shortMonths);
var formats2 = {
"a": formatShortWeekday,
"A": formatWeekday,
"b": formatShortMonth,
"B": formatMonth,
"c": null,
"d": formatDayOfMonth$1,
"e": formatDayOfMonth$1,
"f": formatMicroseconds$1,
"g": formatYearISO$1,
"G": formatFullYearISO$1,
"H": formatHour24$1,
"I": formatHour12$1,
"j": formatDayOfYear$1,
"L": formatMilliseconds$1,
"m": formatMonthNumber$1,
"M": formatMinutes$1,
"p": formatPeriod,
"q": formatQuarter,
"Q": formatUnixTimestamp$1,
"s": formatUnixTimestampSeconds$1,
"S": formatSeconds$1,
"u": formatWeekdayNumberMonday$1,
"U": formatWeekNumberSunday$1,
"V": formatWeekNumberISO$1,
"w": formatWeekdayNumberSunday$1,
"W": formatWeekNumberMonday$1,
"x": null,
"X": null,
"y": formatYear$1,
"Y": formatFullYear$1,
"Z": formatZone$1,
"%": formatLiteralPercent$1
};
var utcFormats = {
"a": formatUTCShortWeekday,
"A": formatUTCWeekday,
"b": formatUTCShortMonth,
"B": formatUTCMonth,
"c": null,
"d": formatUTCDayOfMonth$1,
"e": formatUTCDayOfMonth$1,
"f": formatUTCMicroseconds$1,
"g": formatUTCYearISO$1,
"G": formatUTCFullYearISO$1,
"H": formatUTCHour24$1,
"I": formatUTCHour12$1,
"j": formatUTCDayOfYear$1,
"L": formatUTCMilliseconds$1,
"m": formatUTCMonthNumber$1,
"M": formatUTCMinutes$1,
"p": formatUTCPeriod,
"q": formatUTCQuarter,
"Q": formatUnixTimestamp$1,
"s": formatUnixTimestampSeconds$1,
"S": formatUTCSeconds$1,
"u": formatUTCWeekdayNumberMonday$1,
"U": formatUTCWeekNumberSunday$1,
"V": formatUTCWeekNumberISO$1,
"w": formatUTCWeekdayNumberSunday$1,
"W": formatUTCWeekNumberMonday$1,
"x": null,
"X": null,
"y": formatUTCYear$1,
"Y": formatUTCFullYear$1,
"Z": formatUTCZone$1,
"%": formatLiteralPercent$1
};
var parses = {
"a": parseShortWeekday,
"A": parseWeekday,
"b": parseShortMonth,
"B": parseMonth,
"c": parseLocaleDateTime,
"d": parseDayOfMonth$1,
"e": parseDayOfMonth$1,
"f": parseMicroseconds$1,
"g": parseYear$1,
"G": parseFullYear$1,
"H": parseHour24$1,
"I": parseHour24$1,
"j": parseDayOfYear$1,
"L": parseMilliseconds$1,
"m": parseMonthNumber$1,
"M": parseMinutes$1,
"p": parsePeriod,
"q": parseQuarter$1,
"Q": parseUnixTimestamp$1,
"s": parseUnixTimestampSeconds$1,
"S": parseSeconds$1,
"u": parseWeekdayNumberMonday$1,
"U": parseWeekNumberSunday$1,
"V": parseWeekNumberISO$1,
"w": parseWeekdayNumberSunday$1,
"W": parseWeekNumberMonday$1,
"x": parseLocaleDate,
"X": parseLocaleTime,
"y": parseYear$1,
"Y": parseFullYear$1,
"Z": parseZone$1,
"%": parseLiteralPercent$1
};
formats2.x = newFormat(locale_date, formats2);
formats2.X = newFormat(locale_time, formats2);
formats2.c = newFormat(locale_dateTime, formats2);
utcFormats.x = newFormat(locale_date, utcFormats);
utcFormats.X = newFormat(locale_time, utcFormats);
utcFormats.c = newFormat(locale_dateTime, utcFormats);
function newFormat(specifier, formats3) {
return function(date2) {
var string2 = [], i2 = -1, j2 = 0, n2 = specifier.length, c2, pad2, format2;
if (!(date2 instanceof Date))
date2 = /* @__PURE__ */ new Date(+date2);
while (++i2 < n2) {
if (specifier.charCodeAt(i2) === 37) {
string2.push(specifier.slice(j2, i2));
if ((pad2 = pads$1[c2 = specifier.charAt(++i2)]) != null)
c2 = specifier.charAt(++i2);
else
pad2 = c2 === "e" ? " " : "0";
if (format2 = formats3[c2])
c2 = format2(date2, pad2);
string2.push(c2);
j2 = i2 + 1;
}
}
string2.push(specifier.slice(j2, i2));
return string2.join("");
};
}
function newParse(specifier, Z3) {
return function(string2) {
var d2 = newDate$1(1900, void 0, 1), i2 = parseSpecifier(d2, specifier, string2 += "", 0), week2, day2;
if (i2 != string2.length)
return null;
if ("Q" in d2)
return new Date(d2.Q);
if ("s" in d2)
return new Date(d2.s * 1e3 + ("L" in d2 ? d2.L : 0));
if (Z3 && !("Z" in d2))
d2.Z = 0;
if ("p" in d2)
d2.H = d2.H % 12 + d2.p * 12;
if (d2.m === void 0)
d2.m = "q" in d2 ? d2.q : 0;
if ("V" in d2) {
if (d2.V < 1 || d2.V > 53)
return null;
if (!("w" in d2))
d2.w = 1;
if ("Z" in d2) {
week2 = utcDate$1(newDate$1(d2.y, 0, 1)), day2 = week2.getUTCDay();
week2 = day2 > 4 || day2 === 0 ? utcMonday.ceil(week2) : utcMonday(week2);
week2 = utcDay$1.offset(week2, (d2.V - 1) * 7);
d2.y = week2.getUTCFullYear();
d2.m = week2.getUTCMonth();
d2.d = week2.getUTCDate() + (d2.w + 6) % 7;
} else {
week2 = localDate$1(newDate$1(d2.y, 0, 1)), day2 = week2.getDay();
week2 = day2 > 4 || day2 === 0 ? monday.ceil(week2) : monday(week2);
week2 = timeDay.offset(week2, (d2.V - 1) * 7);
d2.y = week2.getFullYear();
d2.m = week2.getMonth();
d2.d = week2.getDate() + (d2.w + 6) % 7;
}
} else if ("W" in d2 || "U" in d2) {
if (!("w" in d2))
d2.w = "u" in d2 ? d2.u % 7 : "W" in d2 ? 1 : 0;
day2 = "Z" in d2 ? utcDate$1(newDate$1(d2.y, 0, 1)).getUTCDay() : localDate$1(newDate$1(d2.y, 0, 1)).getDay();
d2.m = 0;
d2.d = "W" in d2 ? (d2.w + 6) % 7 + d2.W * 7 - (day2 + 5) % 7 : d2.w + d2.U * 7 - (day2 + 6) % 7;
}
if ("Z" in d2) {
d2.H += d2.Z / 100 | 0;
d2.M += d2.Z % 100;
return utcDate$1(d2);
}
return localDate$1(d2);
};
}
function parseSpecifier(d2, specifier, string2, j2) {
var i2 = 0, n2 = specifier.length, m2 = string2.length, c2, parse2;
while (i2 < n2) {
if (j2 >= m2)
return -1;
c2 = specifier.charCodeAt(i2++);
if (c2 === 37) {
c2 = specifier.charAt(i2++);
parse2 = parses[c2 in pads$1 ? specifier.charAt(i2++) : c2];
if (!parse2 || (j2 = parse2(d2, string2, j2)) < 0)
return -1;
} else if (c2 != string2.charCodeAt(j2++)) {
return -1;
}
}
return j2;
}
function parsePeriod(d2, string2, i2) {
var n2 = periodRe.exec(string2.slice(i2));
return n2 ? (d2.p = periodLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseShortWeekday(d2, string2, i2) {
var n2 = shortWeekdayRe.exec(string2.slice(i2));
return n2 ? (d2.w = shortWeekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseWeekday(d2, string2, i2) {
var n2 = weekdayRe.exec(string2.slice(i2));
return n2 ? (d2.w = weekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseShortMonth(d2, string2, i2) {
var n2 = shortMonthRe.exec(string2.slice(i2));
return n2 ? (d2.m = shortMonthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseMonth(d2, string2, i2) {
var n2 = monthRe.exec(string2.slice(i2));
return n2 ? (d2.m = monthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseLocaleDateTime(d2, string2, i2) {
return parseSpecifier(d2, locale_dateTime, string2, i2);
}
function parseLocaleDate(d2, string2, i2) {
return parseSpecifier(d2, locale_date, string2, i2);
}
function parseLocaleTime(d2, string2, i2) {
return parseSpecifier(d2, locale_time, string2, i2);
}
function formatShortWeekday(d2) {
return locale_shortWeekdays[d2.getDay()];
}
function formatWeekday(d2) {
return locale_weekdays[d2.getDay()];
}
function formatShortMonth(d2) {
return locale_shortMonths[d2.getMonth()];
}
function formatMonth(d2) {
return locale_months[d2.getMonth()];
}
function formatPeriod(d2) {
return locale_periods[+(d2.getHours() >= 12)];
}
function formatQuarter(d2) {
return 1 + ~~(d2.getMonth() / 3);
}
function formatUTCShortWeekday(d2) {
return locale_shortWeekdays[d2.getUTCDay()];
}
function formatUTCWeekday(d2) {
return locale_weekdays[d2.getUTCDay()];
}
function formatUTCShortMonth(d2) {
return locale_shortMonths[d2.getUTCMonth()];
}
function formatUTCMonth(d2) {
return locale_months[d2.getUTCMonth()];
}
function formatUTCPeriod(d2) {
return locale_periods[+(d2.getUTCHours() >= 12)];
}
function formatUTCQuarter(d2) {
return 1 + ~~(d2.getUTCMonth() / 3);
}
return {
format: function(specifier) {
var f2 = newFormat(specifier += "", formats2);
f2.toString = function() {
return specifier;
};
return f2;
},
parse: function(specifier) {
var p2 = newParse(specifier += "", false);
p2.toString = function() {
return specifier;
};
return p2;
},
utcFormat: function(specifier) {
var f2 = newFormat(specifier += "", utcFormats);
f2.toString = function() {
return specifier;
};
return f2;
},
utcParse: function(specifier) {
var p2 = newParse(specifier += "", true);
p2.toString = function() {
return specifier;
};
return p2;
}
};
}
var pads$1 = { "-": "", "_": " ", "0": "0" }, numberRe$1 = /^\s*\d+/, percentRe$1 = /^%/, requoteRe$1 = /[\\^$*+?|[\]().{}]/g;
function pad$1(value2, fill2, width2) {
var sign2 = value2 < 0 ? "-" : "", string2 = (sign2 ? -value2 : value2) + "", length2 = string2.length;
return sign2 + (length2 < width2 ? new Array(width2 - length2 + 1).join(fill2) + string2 : string2);
}
function requote$1(s2) {
return s2.replace(requoteRe$1, "\\$&");
}
function formatRe$1(names) {
return new RegExp("^(?:" + names.map(requote$1).join("|") + ")", "i");
}
function formatLookup$1(names) {
return new Map(names.map((name, i2) => [name.toLowerCase(), i2]));
}
function parseWeekdayNumberSunday$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 1));
return n2 ? (d2.w = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekdayNumberMonday$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 1));
return n2 ? (d2.u = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberSunday$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.U = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberISO$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.V = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberMonday$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.W = +n2[0], i2 + n2[0].length) : -1;
}
function parseFullYear$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 4));
return n2 ? (d2.y = +n2[0], i2 + n2[0].length) : -1;
}
function parseYear$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.y = +n2[0] + (+n2[0] > 68 ? 1900 : 2e3), i2 + n2[0].length) : -1;
}
function parseZone$1(d2, string2, i2) {
var n2 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i2, i2 + 6));
return n2 ? (d2.Z = n2[1] ? 0 : -(n2[2] + (n2[3] || "00")), i2 + n2[0].length) : -1;
}
function parseQuarter$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 1));
return n2 ? (d2.q = n2[0] * 3 - 3, i2 + n2[0].length) : -1;
}
function parseMonthNumber$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.m = n2[0] - 1, i2 + n2[0].length) : -1;
}
function parseDayOfMonth$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseDayOfYear$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 3));
return n2 ? (d2.m = 0, d2.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseHour24$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.H = +n2[0], i2 + n2[0].length) : -1;
}
function parseMinutes$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.M = +n2[0], i2 + n2[0].length) : -1;
}
function parseSeconds$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.S = +n2[0], i2 + n2[0].length) : -1;
}
function parseMilliseconds$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 3));
return n2 ? (d2.L = +n2[0], i2 + n2[0].length) : -1;
}
function parseMicroseconds$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2, i2 + 6));
return n2 ? (d2.L = Math.floor(n2[0] / 1e3), i2 + n2[0].length) : -1;
}
function parseLiteralPercent$1(d2, string2, i2) {
var n2 = percentRe$1.exec(string2.slice(i2, i2 + 1));
return n2 ? i2 + n2[0].length : -1;
}
function parseUnixTimestamp$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2));
return n2 ? (d2.Q = +n2[0], i2 + n2[0].length) : -1;
}
function parseUnixTimestampSeconds$1(d2, string2, i2) {
var n2 = numberRe$1.exec(string2.slice(i2));
return n2 ? (d2.s = +n2[0], i2 + n2[0].length) : -1;
}
function formatDayOfMonth$1(d2, p2) {
return pad$1(d2.getDate(), p2, 2);
}
function formatHour24$1(d2, p2) {
return pad$1(d2.getHours(), p2, 2);
}
function formatHour12$1(d2, p2) {
return pad$1(d2.getHours() % 12 || 12, p2, 2);
}
function formatDayOfYear$1(d2, p2) {
return pad$1(1 + timeDay.count(timeYear(d2), d2), p2, 3);
}
function formatMilliseconds$1(d2, p2) {
return pad$1(d2.getMilliseconds(), p2, 3);
}
function formatMicroseconds$1(d2, p2) {
return formatMilliseconds$1(d2, p2) + "000";
}
function formatMonthNumber$1(d2, p2) {
return pad$1(d2.getMonth() + 1, p2, 2);
}
function formatMinutes$1(d2, p2) {
return pad$1(d2.getMinutes(), p2, 2);
}
function formatSeconds$1(d2, p2) {
return pad$1(d2.getSeconds(), p2, 2);
}
function formatWeekdayNumberMonday$1(d2) {
var day2 = d2.getDay();
return day2 === 0 ? 7 : day2;
}
function formatWeekNumberSunday$1(d2, p2) {
return pad$1(sunday.count(timeYear(d2) - 1, d2), p2, 2);
}
function dISO$1(d2) {
var day2 = d2.getDay();
return day2 >= 4 || day2 === 0 ? thursday(d2) : thursday.ceil(d2);
}
function formatWeekNumberISO$1(d2, p2) {
d2 = dISO$1(d2);
return pad$1(thursday.count(timeYear(d2), d2) + (timeYear(d2).getDay() === 4), p2, 2);
}
function formatWeekdayNumberSunday$1(d2) {
return d2.getDay();
}
function formatWeekNumberMonday$1(d2, p2) {
return pad$1(monday.count(timeYear(d2) - 1, d2), p2, 2);
}
function formatYear$1(d2, p2) {
return pad$1(d2.getFullYear() % 100, p2, 2);
}
function formatYearISO$1(d2, p2) {
d2 = dISO$1(d2);
return pad$1(d2.getFullYear() % 100, p2, 2);
}
function formatFullYear$1(d2, p2) {
return pad$1(d2.getFullYear() % 1e4, p2, 4);
}
function formatFullYearISO$1(d2, p2) {
var day2 = d2.getDay();
d2 = day2 >= 4 || day2 === 0 ? thursday(d2) : thursday.ceil(d2);
return pad$1(d2.getFullYear() % 1e4, p2, 4);
}
function formatZone$1(d2) {
var z2 = d2.getTimezoneOffset();
return (z2 > 0 ? "-" : (z2 *= -1, "+")) + pad$1(z2 / 60 | 0, "0", 2) + pad$1(z2 % 60, "0", 2);
}
function formatUTCDayOfMonth$1(d2, p2) {
return pad$1(d2.getUTCDate(), p2, 2);
}
function formatUTCHour24$1(d2, p2) {
return pad$1(d2.getUTCHours(), p2, 2);
}
function formatUTCHour12$1(d2, p2) {
return pad$1(d2.getUTCHours() % 12 || 12, p2, 2);
}
function formatUTCDayOfYear$1(d2, p2) {
return pad$1(1 + utcDay$1.count(utcYear$1(d2), d2), p2, 3);
}
function formatUTCMilliseconds$1(d2, p2) {
return pad$1(d2.getUTCMilliseconds(), p2, 3);
}
function formatUTCMicroseconds$1(d2, p2) {
return formatUTCMilliseconds$1(d2, p2) + "000";
}
function formatUTCMonthNumber$1(d2, p2) {
return pad$1(d2.getUTCMonth() + 1, p2, 2);
}
function formatUTCMinutes$1(d2, p2) {
return pad$1(d2.getUTCMinutes(), p2, 2);
}
function formatUTCSeconds$1(d2, p2) {
return pad$1(d2.getUTCSeconds(), p2, 2);
}
function formatUTCWeekdayNumberMonday$1(d2) {
var dow = d2.getUTCDay();
return dow === 0 ? 7 : dow;
}
function formatUTCWeekNumberSunday$1(d2, p2) {
return pad$1(utcSunday.count(utcYear$1(d2) - 1, d2), p2, 2);
}
function UTCdISO$1(d2) {
var day2 = d2.getUTCDay();
return day2 >= 4 || day2 === 0 ? utcThursday(d2) : utcThursday.ceil(d2);
}
function formatUTCWeekNumberISO$1(d2, p2) {
d2 = UTCdISO$1(d2);
return pad$1(utcThursday.count(utcYear$1(d2), d2) + (utcYear$1(d2).getUTCDay() === 4), p2, 2);
}
function formatUTCWeekdayNumberSunday$1(d2) {
return d2.getUTCDay();
}
function formatUTCWeekNumberMonday$1(d2, p2) {
return pad$1(utcMonday.count(utcYear$1(d2) - 1, d2), p2, 2);
}
function formatUTCYear$1(d2, p2) {
return pad$1(d2.getUTCFullYear() % 100, p2, 2);
}
function formatUTCYearISO$1(d2, p2) {
d2 = UTCdISO$1(d2);
return pad$1(d2.getUTCFullYear() % 100, p2, 2);
}
function formatUTCFullYear$1(d2, p2) {
return pad$1(d2.getUTCFullYear() % 1e4, p2, 4);
}
function formatUTCFullYearISO$1(d2, p2) {
var day2 = d2.getUTCDay();
d2 = day2 >= 4 || day2 === 0 ? utcThursday(d2) : utcThursday.ceil(d2);
return pad$1(d2.getUTCFullYear() % 1e4, p2, 4);
}
function formatUTCZone$1() {
return "+0000";
}
function formatLiteralPercent$1() {
return "%";
}
function formatUnixTimestamp$1(d2) {
return +d2;
}
function formatUnixTimestampSeconds$1(d2) {
return Math.floor(+d2 / 1e3);
}
var locale$2;
var timeFormat$2;
var timeParse$1;
var utcFormat$2;
var utcParse$1;
defaultLocale$2({
dateTime: "%x, %X",
date: "%-m/%-d/%Y",
time: "%-I:%M:%S %p",
periods: ["AM", "PM"],
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});
function defaultLocale$2(definition2) {
locale$2 = formatLocale$1(definition2);
timeFormat$2 = locale$2.format;
timeParse$1 = locale$2.parse;
utcFormat$2 = locale$2.utcFormat;
utcParse$1 = locale$2.utcParse;
return locale$2;
}
function memoize(method) {
const cache2 = {};
return (spec) => cache2[spec] || (cache2[spec] = method(spec));
}
function trimZeroes(numberFormat, decimalChar) {
return (x2) => {
const str = numberFormat(x2), dec = str.indexOf(decimalChar);
if (dec < 0)
return str;
let idx = rightmostDigit(str, dec);
const end2 = idx < str.length ? str.slice(idx) : "";
while (--idx > dec)
if (str[idx] !== "0") {
++idx;
break;
}
return str.slice(0, idx) + end2;
};
}
function rightmostDigit(str, dec) {
let i2 = str.lastIndexOf("e"), c2;
if (i2 > 0)
return i2;
for (i2 = str.length; --i2 > dec; ) {
c2 = str.charCodeAt(i2);
if (c2 >= 48 && c2 <= 57)
return i2 + 1;
}
}
function numberLocale(locale2) {
const format2 = memoize(locale2.format), formatPrefix2 = locale2.formatPrefix;
return {
format: format2,
formatPrefix: formatPrefix2,
formatFloat(spec) {
const s2 = formatSpecifier(spec || ",");
if (s2.precision == null) {
s2.precision = 12;
switch (s2.type) {
case "%":
s2.precision -= 2;
break;
case "e":
s2.precision -= 1;
break;
}
return trimZeroes(
format2(s2),
// number format
format2(".1f")(1)[1]
// decimal point character
);
} else {
return format2(s2);
}
},
formatSpan(start2, stop2, count2, specifier) {
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
const step = tickStep$4(start2, stop2, count2), value2 = Math.max(Math.abs(start2), Math.abs(stop2));
let precision;
if (specifier.precision == null) {
switch (specifier.type) {
case "s": {
if (!isNaN(precision = precisionPrefix(step, value2))) {
specifier.precision = precision;
}
return formatPrefix2(specifier, value2);
}
case "":
case "e":
case "g":
case "p":
case "r": {
if (!isNaN(precision = precisionRound(step, value2))) {
specifier.precision = precision - (specifier.type === "e");
}
break;
}
case "f":
case "%": {
if (!isNaN(precision = precisionFixed(step))) {
specifier.precision = precision - (specifier.type === "%") * 2;
}
break;
}
}
}
return format2(specifier);
}
};
}
let defaultNumberLocale;
resetNumberFormatDefaultLocale();
function resetNumberFormatDefaultLocale() {
return defaultNumberLocale = numberLocale({
format: format$3,
formatPrefix
});
}
function numberFormatLocale(definition2) {
return numberLocale(formatLocale$2(definition2));
}
function numberFormatDefaultLocale(definition2) {
return arguments.length ? defaultNumberLocale = numberFormatLocale(definition2) : defaultNumberLocale;
}
function timeMultiFormat(format2, interval2, spec) {
spec = spec || {};
if (!isObject$a(spec)) {
error2(`Invalid time multi-format specifier: ${spec}`);
}
const second2 = interval2(SECONDS), minute2 = interval2(MINUTES), hour2 = interval2(HOURS), day2 = interval2(DATE), week2 = interval2(WEEK), month2 = interval2(MONTH), quarter2 = interval2(QUARTER), year2 = interval2(YEAR), L2 = format2(spec[MILLISECONDS] || ".%L"), S2 = format2(spec[SECONDS] || ":%S"), M2 = format2(spec[MINUTES] || "%I:%M"), H4 = format2(spec[HOURS] || "%I %p"), d2 = format2(spec[DATE] || spec[DAY] || "%a %d"), w2 = format2(spec[WEEK] || "%b %d"), m2 = format2(spec[MONTH] || "%B"), q2 = format2(spec[QUARTER] || "%B"), y2 = format2(spec[YEAR] || "%Y");
return (date2) => (second2(date2) < date2 ? L2 : minute2(date2) < date2 ? S2 : hour2(date2) < date2 ? M2 : day2(date2) < date2 ? H4 : month2(date2) < date2 ? week2(date2) < date2 ? d2 : w2 : year2(date2) < date2 ? quarter2(date2) < date2 ? m2 : q2 : y2)(date2);
}
function timeLocale(locale2) {
const timeFormat2 = memoize(locale2.format), utcFormat2 = memoize(locale2.utcFormat);
return {
timeFormat: (spec) => isString(spec) ? timeFormat2(spec) : timeMultiFormat(timeFormat2, timeInterval, spec),
utcFormat: (spec) => isString(spec) ? utcFormat2(spec) : timeMultiFormat(utcFormat2, utcInterval, spec),
timeParse: memoize(locale2.parse),
utcParse: memoize(locale2.utcParse)
};
}
let defaultTimeLocale;
resetTimeFormatDefaultLocale();
function resetTimeFormatDefaultLocale() {
return defaultTimeLocale = timeLocale({
format: timeFormat$2,
parse: timeParse$1,
utcFormat: utcFormat$2,
utcParse: utcParse$1
});
}
function timeFormatLocale(definition2) {
return timeLocale(formatLocale$1(definition2));
}
function timeFormatDefaultLocale(definition2) {
return arguments.length ? defaultTimeLocale = timeFormatLocale(definition2) : defaultTimeLocale;
}
const createLocale = (number2, time2) => extend$2({}, number2, time2);
function locale$1(numberSpec, timeSpec) {
const number2 = numberSpec ? numberFormatLocale(numberSpec) : numberFormatDefaultLocale();
const time2 = timeSpec ? timeFormatLocale(timeSpec) : timeFormatDefaultLocale();
return createLocale(number2, time2);
}
function defaultLocale$1(numberSpec, timeSpec) {
const args = arguments.length;
if (args && args !== 2) {
error2("defaultLocale expects either zero or two arguments.");
}
return args ? createLocale(numberFormatDefaultLocale(numberSpec), timeFormatDefaultLocale(timeSpec)) : createLocale(numberFormatDefaultLocale(), timeFormatDefaultLocale());
}
const protocol_re = /^(data:|([A-Za-z]+:)?\/\/)/;
const allowed_re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;
const whitespace_re = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;
const fileProtocol = "file://";
function loaderFactory(fetch2, fs) {
return (options2) => ({
options: options2 || {},
sanitize,
load: load$1,
fileAccess: !!fs,
file: fileLoader(fs),
http: httpLoader(fetch2)
});
}
async function load$1(uri, options2) {
const opt = await this.sanitize(uri, options2), url2 = opt.href;
return opt.localFile ? this.file(url2) : this.http(url2, options2);
}
async function sanitize(uri, options2) {
options2 = extend$2({}, this.options, options2);
const fileAccess = this.fileAccess, result = {
href: null
};
let isFile, loadFile, base2;
const isAllowed = allowed_re.test(uri.replace(whitespace_re, ""));
if (uri == null || typeof uri !== "string" || !isAllowed) {
error2("Sanitize failure, invalid URI: " + $$h(uri));
}
const hasProtocol = protocol_re.test(uri);
if ((base2 = options2.baseURL) && !hasProtocol) {
if (!uri.startsWith("/") && !base2.endsWith("/")) {
uri = "/" + uri;
}
uri = base2 + uri;
}
loadFile = (isFile = uri.startsWith(fileProtocol)) || options2.mode === "file" || options2.mode !== "http" && !hasProtocol && fileAccess;
if (isFile) {
uri = uri.slice(fileProtocol.length);
} else if (uri.startsWith("//")) {
if (options2.defaultProtocol === "file") {
uri = uri.slice(2);
loadFile = true;
} else {
uri = (options2.defaultProtocol || "http") + ":" + uri;
}
}
Object.defineProperty(result, "localFile", {
value: !!loadFile
});
result.href = uri;
if (options2.target) {
result.target = options2.target + "";
}
if (options2.rel) {
result.rel = options2.rel + "";
}
if (options2.context === "image" && options2.crossOrigin) {
result.crossOrigin = options2.crossOrigin + "";
}
return result;
}
function fileLoader(fs) {
return fs ? (filename) => new Promise((accept, reject2) => {
fs.readFile(filename, (error3, data2) => {
if (error3)
reject2(error3);
else
accept(data2);
});
}) : fileReject;
}
async function fileReject() {
error2("No file system access.");
}
function httpLoader(fetch2) {
return fetch2 ? async function(url2, options2) {
const opt = extend$2({}, this.options.http, options2), type2 = options2 && options2.response, response = await fetch2(url2, opt);
return !response.ok ? error2(response.status + "" + response.statusText) : isFunction(response[type2]) ? response[type2]() : response.text();
} : httpReject;
}
async function httpReject() {
error2("No HTTP fetch method available.");
}
const isValid = (_24) => _24 != null && _24 === _24;
const isBoolean = (_24) => _24 === "true" || _24 === "false" || _24 === true || _24 === false;
const isDate = (_24) => !Number.isNaN(Date.parse(_24));
const isNumber = (_24) => !Number.isNaN(+_24) && !(_24 instanceof Date);
const isInteger = (_24) => isNumber(_24) && Number.isInteger(+_24);
const typeParsers = {
boolean: toBoolean,
integer: toNumber2,
number: toNumber2,
date: toDate,
string: toString$c,
unknown: identity$6
};
const typeTests = [isBoolean, isInteger, isNumber, isDate];
const typeList = ["boolean", "integer", "number", "date"];
function inferType(values2, field2) {
if (!values2 || !values2.length)
return "unknown";
const n2 = values2.length, m2 = typeTests.length, a2 = typeTests.map((_24, i2) => i2 + 1);
for (let i2 = 0, t5 = 0, j2, value2; i2 < n2; ++i2) {
value2 = field2 ? values2[i2][field2] : values2[i2];
for (j2 = 0; j2 < m2; ++j2) {
if (a2[j2] && isValid(value2) && !typeTests[j2](value2)) {
a2[j2] = 0;
++t5;
if (t5 === typeTests.length)
return "string";
}
}
}
return typeList[a2.reduce((u2, v2) => u2 === 0 ? v2 : u2, 0) - 1];
}
function inferTypes(data2, fields) {
return fields.reduce((types2, field2) => {
types2[field2] = inferType(data2, field2);
return types2;
}, {});
}
function delimitedFormat(delimiter2) {
const parse2 = function(data2, format2) {
const delim = {
delimiter: delimiter2
};
return dsv(data2, format2 ? extend$2(format2, delim) : delim);
};
parse2.responseType = "text";
return parse2;
}
function dsv(data2, format2) {
if (format2.header) {
data2 = format2.header.map($$h).join(format2.delimiter) + "\n" + data2;
}
return dsvFormat(format2.delimiter).parse(data2 + "");
}
dsv.responseType = "text";
function isBuffer(_24) {
return typeof Buffer === "function" && isFunction(Buffer.isBuffer) ? Buffer.isBuffer(_24) : false;
}
function json(data2, format2) {
const prop = format2 && format2.property ? field$1(format2.property) : identity$6;
return isObject$a(data2) && !isBuffer(data2) ? parseJSON(prop(data2), format2) : prop(JSON.parse(data2));
}
json.responseType = "json";
function parseJSON(data2, format2) {
if (!isArray$2(data2) && isIterable(data2)) {
data2 = [...data2];
}
return format2 && format2.copy ? JSON.parse(JSON.stringify(data2)) : data2;
}
const filters = {
interior: (a2, b2) => a2 !== b2,
exterior: (a2, b2) => a2 === b2
};
function topojson(data2, format2) {
let method, object2, property2, filter2;
data2 = json(data2, format2);
if (format2 && format2.feature) {
method = feature;
property2 = format2.feature;
} else if (format2 && format2.mesh) {
method = mesh;
property2 = format2.mesh;
filter2 = filters[format2.filter];
} else {
error2("Missing TopoJSON feature or mesh parameter.");
}
object2 = (object2 = data2.objects[property2]) ? method(data2, object2, filter2) : error2("Invalid TopoJSON object: " + property2);
return object2 && object2.features || [object2];
}
topojson.responseType = "json";
const format$2 = {
dsv,
csv: delimitedFormat(","),
tsv: delimitedFormat(" "),
json,
topojson
};
function formats$1(name, reader) {
if (arguments.length > 1) {
format$2[name] = reader;
return this;
} else {
return has$2(format$2, name) ? format$2[name] : null;
}
}
function responseType(type2) {
const f2 = formats$1(type2);
return f2 && f2.responseType || "text";
}
function read2(data2, schema, timeParser, utcParser) {
schema = schema || {};
const reader = formats$1(schema.type || "json");
if (!reader)
error2("Unknown data format type: " + schema.type);
data2 = reader(data2, schema);
if (schema.parse)
parse$7(data2, schema.parse, timeParser, utcParser);
if (has$2(data2, "columns"))
delete data2.columns;
return data2;
}
function parse$7(data2, types2, timeParser, utcParser) {
if (!data2.length)
return;
const locale2 = timeFormatDefaultLocale();
timeParser = timeParser || locale2.timeParse;
utcParser = utcParser || locale2.utcParse;
let fields = data2.columns || Object.keys(data2[0]), datum2, field2, i2, j2, n2, m2;
if (types2 === "auto")
types2 = inferTypes(data2, fields);
fields = Object.keys(types2);
const parsers = fields.map((field3) => {
const type2 = types2[field3];
let parts2, pattern;
if (type2 && (type2.startsWith("date:") || type2.startsWith("utc:"))) {
parts2 = type2.split(/:(.+)?/, 2);
pattern = parts2[1];
if (pattern[0] === "'" && pattern[pattern.length - 1] === "'" || pattern[0] === '"' && pattern[pattern.length - 1] === '"') {
pattern = pattern.slice(1, -1);
}
const parse2 = parts2[0] === "utc" ? utcParser : timeParser;
return parse2(pattern);
}
if (!typeParsers[type2]) {
throw Error("Illegal format pattern: " + field3 + ":" + type2);
}
return typeParsers[type2];
});
for (i2 = 0, n2 = data2.length, m2 = fields.length; i2 < n2; ++i2) {
datum2 = data2[i2];
for (j2 = 0; j2 < m2; ++j2) {
field2 = fields[j2];
datum2[field2] = parsers[j2](datum2[field2]);
}
}
}
const loader = loaderFactory(
typeof fetch !== "undefined" && fetch,
// use built-in fetch API
null
// no file system access
);
function UniqueList(idFunc) {
const $2 = idFunc || identity$6, list = [], ids2 = {};
list.add = (_24) => {
const id = $2(_24);
if (!ids2[id]) {
ids2[id] = 1;
list.push(_24);
}
return list;
};
list.remove = (_24) => {
const id = $2(_24);
if (ids2[id]) {
ids2[id] = 0;
const idx = list.indexOf(_24);
if (idx >= 0)
list.splice(idx, 1);
}
return list;
};
return list;
}
async function asyncCallback(df2, callback) {
try {
await callback(df2);
} catch (err) {
df2.error(err);
}
}
const TUPLE_ID_KEY = Symbol("vega_id");
let TUPLE_ID = 1;
function isTuple(t5) {
return !!(t5 && tupleid(t5));
}
function tupleid(t5) {
return t5[TUPLE_ID_KEY];
}
function setid(t5, id) {
t5[TUPLE_ID_KEY] = id;
return t5;
}
function ingest$1(datum2) {
const t5 = datum2 === Object(datum2) ? datum2 : {
data: datum2
};
return tupleid(t5) ? t5 : setid(t5, TUPLE_ID++);
}
function derive(t5) {
return rederive(t5, ingest$1({}));
}
function rederive(t5, d2) {
for (const k2 in t5)
d2[k2] = t5[k2];
return d2;
}
function replace$5(t5, d2) {
return setid(d2, tupleid(t5));
}
function stableCompare(cmp, f2) {
return !cmp ? null : f2 ? (a2, b2) => cmp(a2, b2) || tupleid(f2(a2)) - tupleid(f2(b2)) : (a2, b2) => cmp(a2, b2) || tupleid(a2) - tupleid(b2);
}
function isChangeSet(v2) {
return v2 && v2.constructor === changeset;
}
function changeset() {
const add3 = [], rem2 = [], mod = [], remp = [], modp = [];
let clean = null, reflow2 = false;
return {
constructor: changeset,
insert(t5) {
const d2 = array$5(t5), n2 = d2.length;
for (let i2 = 0; i2 < n2; ++i2)
add3.push(d2[i2]);
return this;
},
remove(t5) {
const a2 = isFunction(t5) ? remp : rem2, d2 = array$5(t5), n2 = d2.length;
for (let i2 = 0; i2 < n2; ++i2)
a2.push(d2[i2]);
return this;
},
modify(t5, field2, value2) {
const m2 = {
field: field2,
value: constant$6(value2)
};
if (isFunction(t5)) {
m2.filter = t5;
modp.push(m2);
} else {
m2.tuple = t5;
mod.push(m2);
}
return this;
},
encode(t5, set2) {
if (isFunction(t5))
modp.push({
filter: t5,
field: set2
});
else
mod.push({
tuple: t5,
field: set2
});
return this;
},
clean(value2) {
clean = value2;
return this;
},
reflow() {
reflow2 = true;
return this;
},
pulse(pulse2, tuples) {
const cur = {}, out = {};
let i2, n2, m2, f2, t5, id;
for (i2 = 0, n2 = tuples.length; i2 < n2; ++i2) {
cur[tupleid(tuples[i2])] = 1;
}
for (i2 = 0, n2 = rem2.length; i2 < n2; ++i2) {
t5 = rem2[i2];
cur[tupleid(t5)] = -1;
}
for (i2 = 0, n2 = remp.length; i2 < n2; ++i2) {
f2 = remp[i2];
tuples.forEach((t6) => {
if (f2(t6))
cur[tupleid(t6)] = -1;
});
}
for (i2 = 0, n2 = add3.length; i2 < n2; ++i2) {
t5 = add3[i2];
id = tupleid(t5);
if (cur[id]) {
cur[id] = 1;
} else {
pulse2.add.push(ingest$1(add3[i2]));
}
}
for (i2 = 0, n2 = tuples.length; i2 < n2; ++i2) {
t5 = tuples[i2];
if (cur[tupleid(t5)] < 0)
pulse2.rem.push(t5);
}
function modify2(t6, f3, v2) {
if (v2) {
t6[f3] = v2(t6);
} else {
pulse2.encode = f3;
}
if (!reflow2)
out[tupleid(t6)] = t6;
}
for (i2 = 0, n2 = mod.length; i2 < n2; ++i2) {
m2 = mod[i2];
t5 = m2.tuple;
f2 = m2.field;
id = cur[tupleid(t5)];
if (id > 0) {
modify2(t5, f2, m2.value);
pulse2.modifies(f2);
}
}
for (i2 = 0, n2 = modp.length; i2 < n2; ++i2) {
m2 = modp[i2];
f2 = m2.filter;
tuples.forEach((t6) => {
if (f2(t6) && cur[tupleid(t6)] > 0) {
modify2(t6, m2.field, m2.value);
}
});
pulse2.modifies(m2.field);
}
if (reflow2) {
pulse2.mod = rem2.length || remp.length ? tuples.filter((t6) => cur[tupleid(t6)] > 0) : tuples.slice();
} else {
for (id in out)
pulse2.mod.push(out[id]);
}
if (clean || clean == null && (rem2.length || remp.length)) {
pulse2.clean(true);
}
return pulse2;
}
};
}
const CACHE = "_:mod:_";
function Parameters() {
Object.defineProperty(this, CACHE, {
writable: true,
value: {}
});
}
Parameters.prototype = {
/**
* Set a parameter value. If the parameter value changes, the parameter
* will be recorded as modified.
* @param {string} name - The parameter name.
* @param {number} index - The index into an array-value parameter. Ignored if
* the argument is undefined, null or less than zero.
* @param {*} value - The parameter value to set.
* @param {boolean} [force=false] - If true, records the parameter as modified
* even if the value is unchanged.
* @return {Parameters} - This parameter object.
*/
set(name, index2, value2, force2) {
const o2 = this, v2 = o2[name], mod = o2[CACHE];
if (index2 != null && index2 >= 0) {
if (v2[index2] !== value2 || force2) {
v2[index2] = value2;
mod[index2 + ":" + name] = -1;
mod[name] = -1;
}
} else if (v2 !== value2 || force2) {
o2[name] = value2;
mod[name] = isArray$2(value2) ? 1 + value2.length : -1;
}
return o2;
},
/**
* Tests if one or more parameters has been modified. If invoked with no
* arguments, returns true if any parameter value has changed. If the first
* argument is array, returns trues if any parameter name in the array has
* changed. Otherwise, tests if the given name and optional array index has
* changed.
* @param {string} name - The parameter name to test.
* @param {number} [index=undefined] - The parameter array index to test.
* @return {boolean} - Returns true if a queried parameter was modified.
*/
modified(name, index2) {
const mod = this[CACHE];
if (!arguments.length) {
for (const k2 in mod) {
if (mod[k2])
return true;
}
return false;
} else if (isArray$2(name)) {
for (let k2 = 0; k2 < name.length; ++k2) {
if (mod[name[k2]])
return true;
}
return false;
}
return index2 != null && index2 >= 0 ? index2 + 1 < mod[name] || !!mod[index2 + ":" + name] : !!mod[name];
},
/**
* Clears the modification records. After calling this method,
* all parameters are considered unmodified.
*/
clear() {
this[CACHE] = {};
return this;
}
};
let OP_ID = 0;
const PULSE = "pulse", NO_PARAMS = new Parameters();
const SKIP$1$1 = 1, MODIFIED = 2;
function Operator(init3, update2, params2, react2) {
this.id = ++OP_ID;
this.value = init3;
this.stamp = -1;
this.rank = -1;
this.qrank = -1;
this.flags = 0;
if (update2) {
this._update = update2;
}
if (params2)
this.parameters(params2, react2);
}
function flag(bit) {
return function(state) {
const f2 = this.flags;
if (arguments.length === 0)
return !!(f2 & bit);
this.flags = state ? f2 | bit : f2 & ~bit;
return this;
};
}
Operator.prototype = {
/**
* Returns a list of target operators dependent on this operator.
* If this list does not exist, it is created and then returned.
* @return {UniqueList}
*/
targets() {
return this._targets || (this._targets = UniqueList(id$2));
},
/**
* Sets the value of this operator.
* @param {*} value - the value to set.
* @return {Number} Returns 1 if the operator value has changed
* according to strict equality, returns 0 otherwise.
*/
set(value2) {
if (this.value !== value2) {
this.value = value2;
return 1;
} else {
return 0;
}
},
/**
* Indicates that operator evaluation should be skipped on the next pulse.
* This operator will still propagate incoming pulses, but its update function
* will not be invoked. The skip flag is reset after every pulse, so calling
* this method will affect processing of the next pulse only.
*/
skip: flag(SKIP$1$1),
/**
* Indicates that this operator's value has been modified on its most recent
* pulse. Normally modification is checked via strict equality; however, in
* some cases it is more efficient to update the internal state of an object.
* In those cases, the modified flag can be used to trigger propagation. Once
* set, the modification flag persists across pulses until unset. The flag can
* be used with the last timestamp to test if a modification is recent.
*/
modified: flag(MODIFIED),
/**
* Sets the parameters for this operator. The parameter values are analyzed for
* operator instances. If found, this operator will be added as a dependency
* of the parameterizing operator. Operator values are dynamically marshalled
* from each operator parameter prior to evaluation. If a parameter value is
* an array, the array will also be searched for Operator instances. However,
* the search does not recurse into sub-arrays or object properties.
* @param {object} params - A hash of operator parameters.
* @param {boolean} [react=true] - A flag indicating if this operator should
* automatically update (react) when parameter values change. In other words,
* this flag determines if the operator registers itself as a listener on
* any upstream operators included in the parameters.
* @param {boolean} [initonly=false] - A flag indicating if this operator
* should calculate an update only upon its initial evaluation, then
* deregister dependencies and suppress all future update invocations.
* @return {Operator[]} - An array of upstream dependencies.
*/
parameters(params2, react2, initonly) {
react2 = react2 !== false;
const argval = this._argval = this._argval || new Parameters(), argops = this._argops = this._argops || [], deps = [];
let name, value2, n2, i2;
const add3 = (name2, index2, value3) => {
if (value3 instanceof Operator) {
if (value3 !== this) {
if (react2)
value3.targets().add(this);
deps.push(value3);
}
argops.push({
op: value3,
name: name2,
index: index2
});
} else {
argval.set(name2, index2, value3);
}
};
for (name in params2) {
value2 = params2[name];
if (name === PULSE) {
array$5(value2).forEach((op) => {
if (!(op instanceof Operator)) {
error2("Pulse parameters must be operator instances.");
} else if (op !== this) {
op.targets().add(this);
deps.push(op);
}
});
this.source = value2;
} else if (isArray$2(value2)) {
argval.set(name, -1, Array(n2 = value2.length));
for (i2 = 0; i2 < n2; ++i2)
add3(name, i2, value2[i2]);
} else {
add3(name, -1, value2);
}
}
this.marshall().clear();
if (initonly)
argops.initonly = true;
return deps;
},
/**
* Internal method for marshalling parameter values.
* Visits each operator dependency to pull the latest value.
* @return {Parameters} A Parameters object to pass to the update function.
*/
marshall(stamp) {
const argval = this._argval || NO_PARAMS, argops = this._argops;
let item, i2, op, mod;
if (argops) {
const n2 = argops.length;
for (i2 = 0; i2 < n2; ++i2) {
item = argops[i2];
op = item.op;
mod = op.modified() && op.stamp === stamp;
argval.set(item.name, item.index, op.value, mod);
}
if (argops.initonly) {
for (i2 = 0; i2 < n2; ++i2) {
item = argops[i2];
item.op.targets().remove(this);
}
this._argops = null;
this._update = null;
}
}
return argval;
},
/**
* Detach this operator from the dataflow.
* Unregisters listeners on upstream dependencies.
*/
detach() {
const argops = this._argops;
let i2, n2, item, op;
if (argops) {
for (i2 = 0, n2 = argops.length; i2 < n2; ++i2) {
item = argops[i2];
op = item.op;
if (op._targets) {
op._targets.remove(this);
}
}
}
this.pulse = null;
this.source = null;
},
/**
* Delegate method to perform operator processing.
* Subclasses can override this method to perform custom processing.
* By default, it marshalls parameters and calls the update function
* if that function is defined. If the update function does not
* change the operator value then StopPropagation is returned.
* If no update function is defined, this method does nothing.
* @param {Pulse} pulse - the current dataflow pulse.
* @return The output pulse or StopPropagation. A falsy return value
* (including undefined) will let the input pulse pass through.
*/
evaluate(pulse2) {
const update2 = this._update;
if (update2) {
const params2 = this.marshall(pulse2.stamp), v2 = update2.call(this, params2, pulse2);
params2.clear();
if (v2 !== this.value) {
this.value = v2;
} else if (!this.modified()) {
return pulse2.StopPropagation;
}
}
},
/**
* Run this operator for the current pulse. If this operator has already
* been run at (or after) the pulse timestamp, returns StopPropagation.
* Internally, this method calls {@link evaluate} to perform processing.
* If {@link evaluate} returns a falsy value, the input pulse is returned.
* This method should NOT be overridden, instead overrride {@link evaluate}.
* @param {Pulse} pulse - the current dataflow pulse.
* @return the output pulse for this operator (or StopPropagation)
*/
run(pulse2) {
if (pulse2.stamp < this.stamp)
return pulse2.StopPropagation;
let rv;
if (this.skip()) {
this.skip(false);
rv = 0;
} else {
rv = this.evaluate(pulse2);
}
return this.pulse = rv || pulse2;
}
};
function add$3(init3, update2, params2, react2) {
let shift = 1, op;
if (init3 instanceof Operator) {
op = init3;
} else if (init3 && init3.prototype instanceof Operator) {
op = new init3();
} else if (isFunction(init3)) {
op = new Operator(null, init3);
} else {
shift = 0;
op = new Operator(init3, update2);
}
this.rank(op);
if (shift) {
react2 = params2;
params2 = update2;
}
if (params2)
this.connect(op, op.parameters(params2, react2));
this.touch(op);
return op;
}
function connect(target2, sources) {
const targetRank = target2.rank, n2 = sources.length;
for (let i2 = 0; i2 < n2; ++i2) {
if (targetRank < sources[i2].rank) {
this.rerank(target2);
return;
}
}
}
let STREAM_ID = 0;
function EventStream(filter2, apply2, receive) {
this.id = ++STREAM_ID;
this.value = null;
if (receive)
this.receive = receive;
if (filter2)
this._filter = filter2;
if (apply2)
this._apply = apply2;
}
function stream(filter2, apply2, receive) {
return new EventStream(filter2, apply2, receive);
}
EventStream.prototype = {
_filter: truthy,
_apply: identity$6,
targets() {
return this._targets || (this._targets = UniqueList(id$2));
},
consume(_24) {
if (!arguments.length)
return !!this._consume;
this._consume = !!_24;
return this;
},
receive(evt) {
if (this._filter(evt)) {
const val = this.value = this._apply(evt), trg = this._targets, n2 = trg ? trg.length : 0;
for (let i2 = 0; i2 < n2; ++i2)
trg[i2].receive(val);
if (this._consume) {
evt.preventDefault();
evt.stopPropagation();
}
}
},
filter(filter2) {
const s2 = stream(filter2);
this.targets().add(s2);
return s2;
},
apply(apply2) {
const s2 = stream(null, apply2);
this.targets().add(s2);
return s2;
},
merge() {
const s2 = stream();
this.targets().add(s2);
for (let i2 = 0, n2 = arguments.length; i2 < n2; ++i2) {
arguments[i2].targets().add(s2);
}
return s2;
},
throttle(pause) {
let t5 = -1;
return this.filter(() => {
const now2 = Date.now();
if (now2 - t5 > pause) {
t5 = now2;
return 1;
} else {
return 0;
}
});
},
debounce(delay) {
const s2 = stream();
this.targets().add(stream(null, null, debounce(delay, (e7) => {
const df2 = e7.dataflow;
s2.receive(e7);
if (df2 && df2.run)
df2.run();
})));
return s2;
},
between(a2, b2) {
let active = false;
a2.targets().add(stream(null, null, () => active = true));
b2.targets().add(stream(null, null, () => active = false));
return this.filter(() => active);
},
detach() {
this._filter = truthy;
this._targets = null;
}
};
function events$1(source2, type2, filter2, apply2) {
const df2 = this, s2 = stream(filter2, apply2), send = function(e7) {
e7.dataflow = df2;
try {
s2.receive(e7);
} catch (error3) {
df2.error(error3);
} finally {
df2.run();
}
};
let sources;
if (typeof source2 === "string" && typeof document !== "undefined") {
sources = document.querySelectorAll(source2);
} else {
sources = array$5(source2);
}
const n2 = sources.length;
for (let i2 = 0; i2 < n2; ++i2) {
sources[i2].addEventListener(type2, send);
}
return s2;
}
function parse$6(data2, format2) {
const locale2 = this.locale();
return read2(data2, format2, locale2.timeParse, locale2.utcParse);
}
function ingest(target2, data2, format2) {
data2 = this.parse(data2, format2);
return this.pulse(target2, this.changeset().insert(data2));
}
async function request(url2, format2) {
const df2 = this;
let status = 0, data2;
try {
data2 = await df2.loader().load(url2, {
context: "dataflow",
response: responseType(format2 && format2.type)
});
try {
data2 = df2.parse(data2, format2);
} catch (err) {
status = -2;
df2.warn("Data ingestion failed", url2, err);
}
} catch (err) {
status = -1;
df2.warn("Loading failed", url2, err);
}
return {
data: data2,
status
};
}
async function preload2(target2, url2, format2) {
const df2 = this, pending = df2._pending || loadPending(df2);
pending.requests += 1;
const res = await df2.request(url2, format2);
df2.pulse(target2, df2.changeset().remove(truthy).insert(res.data || []));
pending.done();
return res;
}
function loadPending(df2) {
let accept;
const pending = new Promise((a2) => accept = a2);
pending.requests = 0;
pending.done = () => {
if (--pending.requests === 0) {
df2._pending = null;
accept(df2);
}
};
return df2._pending = pending;
}
const SKIP$2 = {
skip: true
};
function on$1(source2, target2, update2, params2, options2) {
const fn8 = source2 instanceof Operator ? onOperator : onStream;
fn8(this, source2, target2, update2, params2, options2);
return this;
}
function onStream(df2, stream2, target2, update2, params2, options2) {
const opt = extend$2({}, options2, SKIP$2);
let func, op;
if (!isFunction(target2))
target2 = constant$6(target2);
if (update2 === void 0) {
func = (e7) => df2.touch(target2(e7));
} else if (isFunction(update2)) {
op = new Operator(null, update2, params2, false);
func = (e7) => {
op.evaluate(e7);
const t5 = target2(e7), v2 = op.value;
isChangeSet(v2) ? df2.pulse(t5, v2, options2) : df2.update(t5, v2, opt);
};
} else {
func = (e7) => df2.update(target2(e7), update2, opt);
}
stream2.apply(func);
}
function onOperator(df2, source2, target2, update2, params2, options2) {
if (update2 === void 0) {
source2.targets().add(target2);
} else {
const opt = options2 || {}, op = new Operator(null, updater(target2, update2), params2, false);
op.modified(opt.force);
op.rank = source2.rank;
source2.targets().add(op);
if (target2) {
op.skip(true);
op.value = target2.value;
op.targets().add(target2);
df2.connect(target2, [op]);
}
}
}
function updater(target2, update2) {
update2 = isFunction(update2) ? update2 : constant$6(update2);
return target2 ? function(_24, pulse2) {
const value2 = update2(_24, pulse2);
if (!target2.skip()) {
target2.skip(value2 !== this.value).value = value2;
}
return value2;
} : update2;
}
function rank(op) {
op.rank = ++this._rank;
}
function rerank(op) {
const queue = [op];
let cur, list, i2;
while (queue.length) {
this.rank(cur = queue.pop());
if (list = cur._targets) {
for (i2 = list.length; --i2 >= 0; ) {
queue.push(cur = list[i2]);
if (cur === op)
error2("Cycle detected in dataflow graph.");
}
}
}
}
const StopPropagation = {};
const ADD = 1 << 0, REM = 1 << 1, MOD$1 = 1 << 2, ADD_REM = ADD | REM, ADD_MOD = ADD | MOD$1, ALL = ADD | REM | MOD$1, REFLOW = 1 << 3, SOURCE = 1 << 4, NO_SOURCE = 1 << 5, NO_FIELDS = 1 << 6;
function Pulse(dataflow, stamp, encode2) {
this.dataflow = dataflow;
this.stamp = stamp == null ? -1 : stamp;
this.add = [];
this.rem = [];
this.mod = [];
this.fields = null;
this.encode = encode2 || null;
}
function materialize(data2, filter2) {
const out = [];
visitArray(data2, filter2, (_24) => out.push(_24));
return out;
}
function filter$1(pulse2, flags) {
const map2 = {};
pulse2.visit(flags, (t5) => {
map2[tupleid(t5)] = 1;
});
return (t5) => map2[tupleid(t5)] ? null : t5;
}
function addFilter(a2, b2) {
return a2 ? (t5, i2) => a2(t5, i2) && b2(t5, i2) : b2;
}
Pulse.prototype = {
/**
* Sentinel value indicating pulse propagation should stop.
*/
StopPropagation,
/**
* Boolean flag indicating ADD (added) tuples.
*/
ADD,
/**
* Boolean flag indicating REM (removed) tuples.
*/
REM,
/**
* Boolean flag indicating MOD (modified) tuples.
*/
MOD: MOD$1,
/**
* Boolean flag indicating ADD (added) and REM (removed) tuples.
*/
ADD_REM,
/**
* Boolean flag indicating ADD (added) and MOD (modified) tuples.
*/
ADD_MOD,
/**
* Boolean flag indicating ADD, REM and MOD tuples.
*/
ALL,
/**
* Boolean flag indicating all tuples in a data source
* except for the ADD, REM and MOD tuples.
*/
REFLOW,
/**
* Boolean flag indicating a 'pass-through' to a
* backing data source, ignoring ADD, REM and MOD tuples.
*/
SOURCE,
/**
* Boolean flag indicating that source data should be
* suppressed when creating a forked pulse.
*/
NO_SOURCE,
/**
* Boolean flag indicating that field modifications should be
* suppressed when creating a forked pulse.
*/
NO_FIELDS,
/**
* Creates a new pulse based on the values of this pulse.
* The dataflow, time stamp and field modification values are copied over.
* By default, new empty ADD, REM and MOD arrays are created.
* @param {number} flags - Integer of boolean flags indicating which (if any)
* tuple arrays should be copied to the new pulse. The supported flag values
* are ADD, REM and MOD. Array references are copied directly: new array
* instances are not created.
* @return {Pulse} - The forked pulse instance.
* @see init
*/
fork(flags) {
return new Pulse(this.dataflow).init(this, flags);
},
/**
* Creates a copy of this pulse with new materialized array
* instances for the ADD, REM, MOD, and SOURCE arrays.
* The dataflow, time stamp and field modification values are copied over.
* @return {Pulse} - The cloned pulse instance.
* @see init
*/
clone() {
const p2 = this.fork(ALL);
p2.add = p2.add.slice();
p2.rem = p2.rem.slice();
p2.mod = p2.mod.slice();
if (p2.source)
p2.source = p2.source.slice();
return p2.materialize(ALL | SOURCE);
},
/**
* Returns a pulse that adds all tuples from a backing source. This is
* useful for cases where operators are added to a dataflow after an
* upstream data pipeline has already been processed, ensuring that
* new operators can observe all tuples within a stream.
* @return {Pulse} - A pulse instance with all source tuples included
* in the add array. If the current pulse already has all source
* tuples in its add array, it is returned directly. If the current
* pulse does not have a backing source, it is returned directly.
*/
addAll() {
let p2 = this;
const reuse = !p2.source || p2.add === p2.rem || !p2.rem.length && p2.source.length === p2.add.length;
if (reuse) {
return p2;
} else {
p2 = new Pulse(this.dataflow).init(this);
p2.add = p2.source;
p2.rem = [];
return p2;
}
},
/**
* Initialize this pulse based on the values of another pulse. This method
* is used internally by {@link fork} to initialize a new forked tuple.
* The dataflow, time stamp and field modification values are copied over.
* By default, new empty ADD, REM and MOD arrays are created.
* @param {Pulse} src - The source pulse to copy from.
* @param {number} flags - Integer of boolean flags indicating which (if any)
* tuple arrays should be copied to the new pulse. The supported flag values
* are ADD, REM and MOD. Array references are copied directly: new array
* instances are not created. By default, source data arrays are copied
* to the new pulse. Use the NO_SOURCE flag to enforce a null source.
* @return {Pulse} - Returns this Pulse instance.
*/
init(src, flags) {
const p2 = this;
p2.stamp = src.stamp;
p2.encode = src.encode;
if (src.fields && !(flags & NO_FIELDS)) {
p2.fields = src.fields;
}
if (flags & ADD) {
p2.addF = src.addF;
p2.add = src.add;
} else {
p2.addF = null;
p2.add = [];
}
if (flags & REM) {
p2.remF = src.remF;
p2.rem = src.rem;
} else {
p2.remF = null;
p2.rem = [];
}
if (flags & MOD$1) {
p2.modF = src.modF;
p2.mod = src.mod;
} else {
p2.modF = null;
p2.mod = [];
}
if (flags & NO_SOURCE) {
p2.srcF = null;
p2.source = null;
} else {
p2.srcF = src.srcF;
p2.source = src.source;
if (src.cleans)
p2.cleans = src.cleans;
}
return p2;
},
/**
* Schedules a function to run after pulse propagation completes.
* @param {function} func - The function to run.
*/
runAfter(func) {
this.dataflow.runAfter(func);
},
/**
* Indicates if tuples have been added, removed or modified.
* @param {number} [flags] - The tuple types (ADD, REM or MOD) to query.
* Defaults to ALL, returning true if any tuple type has changed.
* @return {boolean} - Returns true if one or more queried tuple types have
* changed, false otherwise.
*/
changed(flags) {
const f2 = flags || ALL;
return f2 & ADD && this.add.length || f2 & REM && this.rem.length || f2 & MOD$1 && this.mod.length;
},
/**
* Forces a "reflow" of tuple values, such that all tuples in the backing
* source are added to the MOD set, unless already present in the ADD set.
* @param {boolean} [fork=false] - If true, returns a forked copy of this
* pulse, and invokes reflow on that derived pulse.
* @return {Pulse} - The reflowed pulse instance.
*/
reflow(fork) {
if (fork)
return this.fork(ALL).reflow();
const len = this.add.length, src = this.source && this.source.length;
if (src && src !== len) {
this.mod = this.source;
if (len)
this.filter(MOD$1, filter$1(this, ADD));
}
return this;
},
/**
* Get/set metadata to pulse requesting garbage collection
* to reclaim currently unused resources.
*/
clean(value2) {
if (arguments.length) {
this.cleans = !!value2;
return this;
} else {
return this.cleans;
}
},
/**
* Marks one or more data field names as modified to assist dependency
* tracking and incremental processing by transform operators.
* @param {string|Array<string>} _ - The field(s) to mark as modified.
* @return {Pulse} - This pulse instance.
*/
modifies(_24) {
const hash2 = this.fields || (this.fields = {});
if (isArray$2(_24)) {
_24.forEach((f2) => hash2[f2] = true);
} else {
hash2[_24] = true;
}
return this;
},
/**
* Checks if one or more data fields have been modified during this pulse
* propagation timestamp.
* @param {string|Array<string>} _ - The field(s) to check for modified.
* @param {boolean} nomod - If true, will check the modified flag even if
* no mod tuples exist. If false (default), mod tuples must be present.
* @return {boolean} - Returns true if any of the provided fields has been
* marked as modified, false otherwise.
*/
modified(_24, nomod) {
const fields = this.fields;
return !((nomod || this.mod.length) && fields) ? false : !arguments.length ? !!fields : isArray$2(_24) ? _24.some((f2) => fields[f2]) : fields[_24];
},
/**
* Adds a filter function to one more tuple sets. Filters are applied to
* backing tuple arrays, to determine the actual set of tuples considered
* added, removed or modified. They can be used to delay materialization of
* a tuple set in order to avoid expensive array copies. In addition, the
* filter functions can serve as value transformers: unlike standard predicate
* function (which return boolean values), Pulse filters should return the
* actual tuple value to process. If a tuple set is already filtered, the
* new filter function will be appended into a conjuntive ('and') query.
* @param {number} flags - Flags indicating the tuple set(s) to filter.
* @param {function(*):object} filter - Filter function that will be applied
* to the tuple set array, and should return a data tuple if the value
* should be included in the tuple set, and falsy (or null) otherwise.
* @return {Pulse} - Returns this pulse instance.
*/
filter(flags, filter2) {
const p2 = this;
if (flags & ADD)
p2.addF = addFilter(p2.addF, filter2);
if (flags & REM)
p2.remF = addFilter(p2.remF, filter2);
if (flags & MOD$1)
p2.modF = addFilter(p2.modF, filter2);
if (flags & SOURCE)
p2.srcF = addFilter(p2.srcF, filter2);
return p2;
},
/**
* Materialize one or more tuple sets in this pulse. If the tuple set(s) have
* a registered filter function, it will be applied and the tuple set(s) will
* be replaced with materialized tuple arrays.
* @param {number} flags - Flags indicating the tuple set(s) to materialize.
* @return {Pulse} - Returns this pulse instance.
*/
materialize(flags) {
flags = flags || ALL;
const p2 = this;
if (flags & ADD && p2.addF) {
p2.add = materialize(p2.add, p2.addF);
p2.addF = null;
}
if (flags & REM && p2.remF) {
p2.rem = materialize(p2.rem, p2.remF);
p2.remF = null;
}
if (flags & MOD$1 && p2.modF) {
p2.mod = materialize(p2.mod, p2.modF);
p2.modF = null;
}
if (flags & SOURCE && p2.srcF) {
p2.source = p2.source.filter(p2.srcF);
p2.srcF = null;
}
return p2;
},
/**
* Visit one or more tuple sets in this pulse.
* @param {number} flags - Flags indicating the tuple set(s) to visit.
* Legal values are ADD, REM, MOD and SOURCE (if a backing data source
* has been set).
* @param {function(object):*} - Visitor function invoked per-tuple.
* @return {Pulse} - Returns this pulse instance.
*/
visit(flags, visitor) {
const p2 = this, v2 = visitor;
if (flags & SOURCE) {
visitArray(p2.source, p2.srcF, v2);
return p2;
}
if (flags & ADD)
visitArray(p2.add, p2.addF, v2);
if (flags & REM)
visitArray(p2.rem, p2.remF, v2);
if (flags & MOD$1)
visitArray(p2.mod, p2.modF, v2);
const src = p2.source;
if (flags & REFLOW && src) {
const sum2 = p2.add.length + p2.mod.length;
if (sum2 === src.length)
;
else if (sum2) {
visitArray(src, filter$1(p2, ADD_MOD), v2);
} else {
visitArray(src, p2.srcF, v2);
}
}
return p2;
}
};
function MultiPulse(dataflow, stamp, pulses, encode2) {
const p2 = this;
let c2 = 0;
this.dataflow = dataflow;
this.stamp = stamp;
this.fields = null;
this.encode = encode2 || null;
this.pulses = pulses;
for (const pulse2 of pulses) {
if (pulse2.stamp !== stamp)
continue;
if (pulse2.fields) {
const hash2 = p2.fields || (p2.fields = {});
for (const f2 in pulse2.fields) {
hash2[f2] = 1;
}
}
if (pulse2.changed(p2.ADD))
c2 |= p2.ADD;
if (pulse2.changed(p2.REM))
c2 |= p2.REM;
if (pulse2.changed(p2.MOD))
c2 |= p2.MOD;
}
this.changes = c2;
}
inherits(MultiPulse, Pulse, {
/**
* Creates a new pulse based on the values of this pulse.
* The dataflow, time stamp and field modification values are copied over.
* @return {Pulse}
*/
fork(flags) {
const p2 = new Pulse(this.dataflow).init(this, flags & this.NO_FIELDS);
if (flags !== void 0) {
if (flags & p2.ADD)
this.visit(p2.ADD, (t5) => p2.add.push(t5));
if (flags & p2.REM)
this.visit(p2.REM, (t5) => p2.rem.push(t5));
if (flags & p2.MOD)
this.visit(p2.MOD, (t5) => p2.mod.push(t5));
}
return p2;
},
changed(flags) {
return this.changes & flags;
},
modified(_24) {
const p2 = this, fields = p2.fields;
return !(fields && p2.changes & p2.MOD) ? 0 : isArray$2(_24) ? _24.some((f2) => fields[f2]) : fields[_24];
},
filter() {
error2("MultiPulse does not support filtering.");
},
materialize() {
error2("MultiPulse does not support materialization.");
},
visit(flags, visitor) {
const p2 = this, pulses = p2.pulses, n2 = pulses.length;
let i2 = 0;
if (flags & p2.SOURCE) {
for (; i2 < n2; ++i2) {
pulses[i2].visit(flags, visitor);
}
} else {
for (; i2 < n2; ++i2) {
if (pulses[i2].stamp === p2.stamp) {
pulses[i2].visit(flags, visitor);
}
}
}
return p2;
}
});
async function evaluate(encode2, prerun, postrun) {
const df2 = this, async = [];
if (df2._pulse)
return reentrant(df2);
if (df2._pending)
await df2._pending;
if (prerun)
await asyncCallback(df2, prerun);
if (!df2._touched.length) {
df2.debug("Dataflow invoked, but nothing to do.");
return df2;
}
const stamp = ++df2._clock;
df2._pulse = new Pulse(df2, stamp, encode2);
df2._touched.forEach((op2) => df2._enqueue(op2, true));
df2._touched = UniqueList(id$2);
let count2 = 0, op, next2, error3;
try {
while (df2._heap.size() > 0) {
op = df2._heap.pop();
if (op.rank !== op.qrank) {
df2._enqueue(op, true);
continue;
}
next2 = op.run(df2._getPulse(op, encode2));
if (next2.then) {
next2 = await next2;
} else if (next2.async) {
async.push(next2.async);
next2 = StopPropagation;
}
if (next2 !== StopPropagation) {
if (op._targets)
op._targets.forEach((op2) => df2._enqueue(op2));
}
++count2;
}
} catch (err) {
df2._heap.clear();
error3 = err;
}
df2._input = {};
df2._pulse = null;
df2.debug(`Pulse ${stamp}: ${count2} operators`);
if (error3) {
df2._postrun = [];
df2.error(error3);
}
if (df2._postrun.length) {
const pr2 = df2._postrun.sort((a2, b2) => b2.priority - a2.priority);
df2._postrun = [];
for (let i2 = 0; i2 < pr2.length; ++i2) {
await asyncCallback(df2, pr2[i2].callback);
}
}
if (postrun)
await asyncCallback(df2, postrun);
if (async.length) {
Promise.all(async).then((cb2) => df2.runAsync(null, () => {
cb2.forEach((f2) => {
try {
f2(df2);
} catch (err) {
df2.error(err);
}
});
}));
}
return df2;
}
async function runAsync(encode2, prerun, postrun) {
while (this._running)
await this._running;
const clear2 = () => this._running = null;
(this._running = this.evaluate(encode2, prerun, postrun)).then(clear2, clear2);
return this._running;
}
function run$1(encode2, prerun, postrun) {
return this._pulse ? reentrant(this) : (this.evaluate(encode2, prerun, postrun), this);
}
function runAfter(callback, enqueue2, priority) {
if (this._pulse || enqueue2) {
this._postrun.push({
priority: priority || 0,
callback
});
} else {
try {
callback(this);
} catch (err) {
this.error(err);
}
}
}
function reentrant(df2) {
df2.error("Dataflow already running. Use runAsync() to chain invocations.");
return df2;
}
function enqueue(op, force2) {
const q2 = op.stamp < this._clock;
if (q2)
op.stamp = this._clock;
if (q2 || force2) {
op.qrank = op.rank;
this._heap.push(op);
}
}
function getPulse(op, encode2) {
const s2 = op.source, stamp = this._clock;
return s2 && isArray$2(s2) ? new MultiPulse(this, stamp, s2.map((_24) => _24.pulse), encode2) : this._input[op.id] || singlePulse(this._pulse, s2 && s2.pulse);
}
function singlePulse(p2, s2) {
if (s2 && s2.stamp === p2.stamp) {
return s2;
}
p2 = p2.fork();
if (s2 && s2 !== StopPropagation) {
p2.source = s2.source;
}
return p2;
}
const NO_OPT = {
skip: false,
force: false
};
function touch(op, options2) {
const opt = options2 || NO_OPT;
if (this._pulse) {
this._enqueue(op);
} else {
this._touched.add(op);
}
if (opt.skip)
op.skip(true);
return this;
}
function update$6(op, value2, options2) {
const opt = options2 || NO_OPT;
if (op.set(value2) || opt.force) {
this.touch(op, opt);
}
return this;
}
function pulse(op, changeset2, options2) {
this.touch(op, options2 || NO_OPT);
const p2 = new Pulse(this, this._clock + (this._pulse ? 0 : 1)), t5 = op.pulse && op.pulse.source || [];
p2.target = op;
this._input[op.id] = changeset2.pulse(p2, t5);
return this;
}
function Heap(cmp) {
let nodes = [];
return {
clear: () => nodes = [],
size: () => nodes.length,
peek: () => nodes[0],
push: (x2) => {
nodes.push(x2);
return siftdown(nodes, 0, nodes.length - 1, cmp);
},
pop: () => {
const last = nodes.pop();
let item;
if (nodes.length) {
item = nodes[0];
nodes[0] = last;
siftup(nodes, 0, cmp);
} else {
item = last;
}
return item;
}
};
}
function siftdown(array2, start2, idx, cmp) {
let parent, pidx;
const item = array2[idx];
while (idx > start2) {
pidx = idx - 1 >> 1;
parent = array2[pidx];
if (cmp(item, parent) < 0) {
array2[idx] = parent;
idx = pidx;
continue;
}
break;
}
return array2[idx] = item;
}
function siftup(array2, idx, cmp) {
const start2 = idx, end2 = array2.length, item = array2[idx];
let cidx = (idx << 1) + 1, ridx;
while (cidx < end2) {
ridx = cidx + 1;
if (ridx < end2 && cmp(array2[cidx], array2[ridx]) >= 0) {
cidx = ridx;
}
array2[idx] = array2[cidx];
idx = cidx;
cidx = (idx << 1) + 1;
}
array2[idx] = item;
return siftdown(array2, start2, idx, cmp);
}
function Dataflow() {
this.logger(logger());
this.logLevel(Error$1);
this._clock = 0;
this._rank = 0;
this._locale = defaultLocale$1();
try {
this._loader = loader();
} catch (e7) {
}
this._touched = UniqueList(id$2);
this._input = {};
this._pulse = null;
this._heap = Heap((a2, b2) => a2.qrank - b2.qrank);
this._postrun = [];
}
function logMethod(method) {
return function() {
return this._log[method].apply(this, arguments);
};
}
Dataflow.prototype = {
/**
* The current timestamp of this dataflow. This value reflects the
* timestamp of the previous dataflow run. The dataflow is initialized
* with a stamp value of 0. The initial run of the dataflow will have
* a timestap of 1, and so on. This value will match the
* {@link Pulse.stamp} property.
* @return {number} - The current timestamp value.
*/
stamp() {
return this._clock;
},
/**
* Gets or sets the loader instance to use for data file loading. A
* loader object must provide a "load" method for loading files and a
* "sanitize" method for checking URL/filename validity. Both methods
* should accept a URI and options hash as arguments, and return a Promise
* that resolves to the loaded file contents (load) or a hash containing
* sanitized URI data with the sanitized url assigned to the "href" property
* (sanitize).
* @param {object} _ - The loader instance to use.
* @return {object|Dataflow} - If no arguments are provided, returns
* the current loader instance. Otherwise returns this Dataflow instance.
*/
loader(_24) {
if (arguments.length) {
this._loader = _24;
return this;
} else {
return this._loader;
}
},
/**
* Gets or sets the locale instance to use for formatting and parsing
* string values. The locale object should be provided by the
* vega-format library, and include methods such as format, timeFormat,
* utcFormat, timeParse, and utcParse.
* @param {object} _ - The locale instance to use.
* @return {object|Dataflow} - If no arguments are provided, returns
* the current locale instance. Otherwise returns this Dataflow instance.
*/
locale(_24) {
if (arguments.length) {
this._locale = _24;
return this;
} else {
return this._locale;
}
},
/**
* Get or set the logger instance used to log messages. If no arguments are
* provided, returns the current logger instance. Otherwise, sets the logger
* and return this Dataflow instance. Provided loggers must support the full
* API of logger objects generated by the vega-util logger method. Note that
* by default the log level of the new logger will be used; use the logLevel
* method to adjust the log level as needed.
*/
logger(logger2) {
if (arguments.length) {
this._log = logger2;
return this;
} else {
return this._log;
}
},
/**
* Logs an error message. By default, logged messages are written to console
* output. The message will only be logged if the current log level is high
* enough to permit error messages.
*/
error: logMethod("error"),
/**
* Logs a warning message. By default, logged messages are written to console
* output. The message will only be logged if the current log level is high
* enough to permit warning messages.
*/
warn: logMethod("warn"),
/**
* Logs a information message. By default, logged messages are written to
* console output. The message will only be logged if the current log level is
* high enough to permit information messages.
*/
info: logMethod("info"),
/**
* Logs a debug message. By default, logged messages are written to console
* output. The message will only be logged if the current log level is high
* enough to permit debug messages.
*/
debug: logMethod("debug"),
/**
* Get or set the current log level. If an argument is provided, it
* will be used as the new log level.
* @param {number} [level] - Should be one of None, Warn, Info
* @return {number} - The current log level.
*/
logLevel: logMethod("level"),
/**
* Empty entry threshold for garbage cleaning. Map data structures will
* perform cleaning once the number of empty entries exceeds this value.
*/
cleanThreshold: 1e4,
// OPERATOR REGISTRATION
add: add$3,
connect,
rank,
rerank,
// OPERATOR UPDATES
pulse,
touch,
update: update$6,
changeset,
// DATA LOADING
ingest,
parse: parse$6,
preload: preload2,
request,
// EVENT HANDLING
events: events$1,
on: on$1,
// PULSE PROPAGATION
evaluate,
run: run$1,
runAsync,
runAfter,
_enqueue: enqueue,
_getPulse: getPulse
};
function Transform$1(init3, params2) {
Operator.call(this, init3, null, params2);
}
inherits(Transform$1, Operator, {
/**
* Overrides {@link Operator.evaluate} for transform operators.
* Internally, this method calls {@link evaluate} to perform processing.
* If {@link evaluate} returns a falsy value, the input pulse is returned.
* This method should NOT be overridden, instead overrride {@link evaluate}.
* @param {Pulse} pulse - the current dataflow pulse.
* @return the output pulse for this operator (or StopPropagation)
*/
run(pulse2) {
if (pulse2.stamp < this.stamp)
return pulse2.StopPropagation;
let rv;
if (this.skip()) {
this.skip(false);
} else {
rv = this.evaluate(pulse2);
}
rv = rv || pulse2;
if (rv.then) {
rv = rv.then((_24) => this.pulse = _24);
} else if (rv !== pulse2.StopPropagation) {
this.pulse = rv;
}
return rv;
},
/**
* Overrides {@link Operator.evaluate} for transform operators.
* Marshalls parameter values and then invokes {@link transform}.
* @param {Pulse} pulse - the current dataflow pulse.
* @return {Pulse} The output pulse (or StopPropagation). A falsy return
value (including undefined) will let the input pulse pass through.
*/
evaluate(pulse2) {
const params2 = this.marshall(pulse2.stamp), out = this.transform(params2, pulse2);
params2.clear();
return out;
},
/**
* Process incoming pulses.
* Subclasses should override this method to implement transforms.
* @param {Parameters} _ - The operator parameter values.
* @param {Pulse} pulse - The current dataflow pulse.
* @return {Pulse} The output pulse (or StopPropagation). A falsy return
* value (including undefined) will let the input pulse pass through.
*/
transform() {
}
});
const transforms = {};
function definition$1(type2) {
const t5 = transform$4(type2);
return t5 && t5.Definition || null;
}
function transform$4(type2) {
type2 = type2 && type2.toLowerCase();
return has$2(transforms, type2) ? transforms[type2] : null;
}
function ascending$5(a2, b2) {
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function number$8(x2) {
return x2 === null ? NaN : +x2;
}
function* numbers$3(values2, valueof) {
if (valueof === void 0) {
for (let value2 of values2) {
if (value2 != null && (value2 = +value2) >= value2) {
yield value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (value2 = +value2) >= value2) {
yield value2;
}
}
}
}
function variance(values2, valueof) {
let count2 = 0;
let delta;
let mean2 = 0;
let sum2 = 0;
if (valueof === void 0) {
for (let value2 of values2) {
if (value2 != null && (value2 = +value2) >= value2) {
delta = value2 - mean2;
mean2 += delta / ++count2;
sum2 += delta * (value2 - mean2);
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (value2 = +value2) >= value2) {
delta = value2 - mean2;
mean2 += delta / ++count2;
sum2 += delta * (value2 - mean2);
}
}
}
if (count2 > 1)
return sum2 / (count2 - 1);
}
function deviation(values2, valueof) {
const v2 = variance(values2, valueof);
return v2 ? Math.sqrt(v2) : v2;
}
function compareDefined$1(compare3 = ascending$5) {
if (compare3 === ascending$5)
return ascendingDefined$1;
if (typeof compare3 !== "function")
throw new TypeError("compare is not a function");
return (a2, b2) => {
const x2 = compare3(a2, b2);
if (x2 || x2 === 0)
return x2;
return (compare3(b2, b2) === 0) - (compare3(a2, a2) === 0);
};
}
function ascendingDefined$1(a2, b2) {
return (a2 == null || !(a2 >= a2)) - (b2 == null || !(b2 >= b2)) || (a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
}
function max$8(values2, valueof) {
let max2;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
max2 = value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
max2 = value2;
}
}
}
return max2;
}
function min$9(values2, valueof) {
let min2;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) {
min2 = value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) {
min2 = value2;
}
}
}
return min2;
}
function quickselect$1(array2, k2, left2 = 0, right2 = Infinity, compare3) {
k2 = Math.floor(k2);
left2 = Math.floor(Math.max(0, left2));
right2 = Math.floor(Math.min(array2.length - 1, right2));
if (!(left2 <= k2 && k2 <= right2))
return array2;
compare3 = compare3 === void 0 ? ascendingDefined$1 : compareDefined$1(compare3);
while (right2 > left2) {
if (right2 - left2 > 600) {
const n2 = right2 - left2 + 1;
const m2 = k2 - left2 + 1;
const z2 = Math.log(n2);
const s2 = 0.5 * Math.exp(2 * z2 / 3);
const sd2 = 0.5 * Math.sqrt(z2 * s2 * (n2 - s2) / n2) * (m2 - n2 / 2 < 0 ? -1 : 1);
const newLeft = Math.max(left2, Math.floor(k2 - m2 * s2 / n2 + sd2));
const newRight = Math.min(right2, Math.floor(k2 + (n2 - m2) * s2 / n2 + sd2));
quickselect$1(array2, k2, newLeft, newRight, compare3);
}
const t5 = array2[k2];
let i2 = left2;
let j2 = right2;
swap$2(array2, left2, k2);
if (compare3(array2[right2], t5) > 0)
swap$2(array2, left2, right2);
while (i2 < j2) {
swap$2(array2, i2, j2), ++i2, --j2;
while (compare3(array2[i2], t5) < 0)
++i2;
while (compare3(array2[j2], t5) > 0)
--j2;
}
if (compare3(array2[left2], t5) === 0)
swap$2(array2, left2, j2);
else
++j2, swap$2(array2, j2, right2);
if (j2 <= k2)
left2 = j2 + 1;
if (k2 <= j2)
right2 = j2 - 1;
}
return array2;
}
function swap$2(array2, i2, j2) {
const t5 = array2[i2];
array2[i2] = array2[j2];
array2[j2] = t5;
}
function quantile$2(values2, p2, valueof) {
values2 = Float64Array.from(numbers$3(values2, valueof));
if (!(n2 = values2.length) || isNaN(p2 = +p2))
return;
if (p2 <= 0 || n2 < 2)
return min$9(values2);
if (p2 >= 1)
return max$8(values2);
var n2, i2 = (n2 - 1) * p2, i0 = Math.floor(i2), value0 = max$8(quickselect$1(values2, i0).subarray(0, i0 + 1)), value1 = min$9(values2.subarray(i0 + 1));
return value0 + (value1 - value0) * (i2 - i0);
}
function quantileSorted(values2, p2, valueof = number$8) {
if (!(n2 = values2.length) || isNaN(p2 = +p2))
return;
if (p2 <= 0 || n2 < 2)
return +valueof(values2[0], 0, values2);
if (p2 >= 1)
return +valueof(values2[n2 - 1], n2 - 1, values2);
var n2, i2 = (n2 - 1) * p2, i0 = Math.floor(i2), value0 = +valueof(values2[i0], i0, values2), value1 = +valueof(values2[i0 + 1], i0 + 1, values2);
return value0 + (value1 - value0) * (i2 - i0);
}
function median$1(values2, valueof) {
return quantile$2(values2, 0.5, valueof);
}
function* numbers$2(values2, valueof) {
if (valueof == null) {
for (let value2 of values2) {
if (value2 != null && value2 !== "" && (value2 = +value2) >= value2) {
yield value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
value2 = valueof(value2, ++index2, values2);
if (value2 != null && value2 !== "" && (value2 = +value2) >= value2) {
yield value2;
}
}
}
}
function quantiles(array2, p2, f2) {
const values2 = Float64Array.from(numbers$2(array2, f2));
values2.sort(ascending$5);
return p2.map((_24) => quantileSorted(values2, _24));
}
function quartiles(array2, f2) {
return quantiles(array2, [0.25, 0.5, 0.75], f2);
}
function estimateBandwidth(array2, f2) {
const n2 = array2.length, d2 = deviation(array2, f2), q2 = quartiles(array2, f2), h2 = (q2[2] - q2[0]) / 1.34, v2 = Math.min(d2, h2) || d2 || Math.abs(q2[0]) || 1;
return 1.06 * v2 * Math.pow(n2, -0.2);
}
function bin(_24) {
const maxb = _24.maxbins || 20, base2 = _24.base || 10, logb = Math.log(base2), div2 = _24.divide || [5, 2];
let min2 = _24.extent[0], max2 = _24.extent[1], step, level, minstep, v2, i2, n2;
const span2 = _24.span || max2 - min2 || Math.abs(min2) || 1;
if (_24.step) {
step = _24.step;
} else if (_24.steps) {
v2 = span2 / maxb;
for (i2 = 0, n2 = _24.steps.length; i2 < n2 && _24.steps[i2] < v2; ++i2)
;
step = _24.steps[Math.max(0, i2 - 1)];
} else {
level = Math.ceil(Math.log(maxb) / logb);
minstep = _24.minstep || 0;
step = Math.max(minstep, Math.pow(base2, Math.round(Math.log(span2) / logb) - level));
while (Math.ceil(span2 / step) > maxb) {
step *= base2;
}
for (i2 = 0, n2 = div2.length; i2 < n2; ++i2) {
v2 = step / div2[i2];
if (v2 >= minstep && span2 / v2 <= maxb)
step = v2;
}
}
v2 = Math.log(step);
const precision = v2 >= 0 ? 0 : ~~(-v2 / logb) + 1, eps = Math.pow(base2, -precision - 1);
if (_24.nice || _24.nice === void 0) {
v2 = Math.floor(min2 / step + eps) * step;
min2 = min2 < v2 ? v2 - step : v2;
max2 = Math.ceil(max2 / step) * step;
}
return {
start: min2,
stop: max2 === min2 ? min2 + step : max2,
step
};
}
var random = Math.random;
function bootstrapCI(array2, samples, alpha, f2) {
if (!array2.length)
return [void 0, void 0];
const values2 = Float64Array.from(numbers$2(array2, f2)), n2 = values2.length, m2 = samples;
let a2, i2, j2, mu2;
for (j2 = 0, mu2 = Array(m2); j2 < m2; ++j2) {
for (a2 = 0, i2 = 0; i2 < n2; ++i2) {
a2 += values2[~~(random() * n2)];
}
mu2[j2] = a2 / n2;
}
mu2.sort(ascending$5);
return [quantile$2(mu2, alpha / 2), quantile$2(mu2, 1 - alpha / 2)];
}
function dotbin(array2, step, smooth, f2) {
f2 = f2 || ((_24) => _24);
const n2 = array2.length, v2 = new Float64Array(n2);
let i2 = 0, j2 = 1, a2 = f2(array2[0]), b2 = a2, w2 = a2 + step, x2;
for (; j2 < n2; ++j2) {
x2 = f2(array2[j2]);
if (x2 >= w2) {
b2 = (a2 + b2) / 2;
for (; i2 < j2; ++i2)
v2[i2] = b2;
w2 = x2 + step;
a2 = x2;
}
b2 = x2;
}
b2 = (a2 + b2) / 2;
for (; i2 < j2; ++i2)
v2[i2] = b2;
return smooth ? smoothing(v2, step + step / 4) : v2;
}
function smoothing(v2, thresh) {
const n2 = v2.length;
let a2 = 0, b2 = 1, c2, d2;
while (v2[a2] === v2[b2])
++b2;
while (b2 < n2) {
c2 = b2 + 1;
while (v2[b2] === v2[c2])
++c2;
if (v2[b2] - v2[b2 - 1] < thresh) {
d2 = b2 + (a2 + c2 - b2 - b2 >> 1);
while (d2 < b2)
v2[d2++] = v2[b2];
while (d2 > b2)
v2[d2--] = v2[a2];
}
a2 = b2;
b2 = c2;
}
return v2;
}
const SQRT2PI = Math.sqrt(2 * Math.PI);
const SQRT2 = Math.SQRT2;
let nextSample = NaN;
function sampleNormal(mean2, stdev) {
mean2 = mean2 || 0;
stdev = stdev == null ? 1 : stdev;
let x2 = 0, y2 = 0, rds, c2;
if (nextSample === nextSample) {
x2 = nextSample;
nextSample = NaN;
} else {
do {
x2 = random() * 2 - 1;
y2 = random() * 2 - 1;
rds = x2 * x2 + y2 * y2;
} while (rds === 0 || rds > 1);
c2 = Math.sqrt(-2 * Math.log(rds) / rds);
x2 *= c2;
nextSample = y2 * c2;
}
return mean2 + x2 * stdev;
}
function densityNormal(value2, mean2, stdev) {
stdev = stdev == null ? 1 : stdev;
const z2 = (value2 - (mean2 || 0)) / stdev;
return Math.exp(-0.5 * z2 * z2) / (stdev * SQRT2PI);
}
function cumulativeNormal(value2, mean2, stdev) {
mean2 = mean2 || 0;
stdev = stdev == null ? 1 : stdev;
const z2 = (value2 - mean2) / stdev, Z3 = Math.abs(z2);
let cd2;
if (Z3 > 37) {
cd2 = 0;
} else {
const exp2 = Math.exp(-Z3 * Z3 / 2);
let sum2;
if (Z3 < 7.07106781186547) {
sum2 = 0.0352624965998911 * Z3 + 0.700383064443688;
sum2 = sum2 * Z3 + 6.37396220353165;
sum2 = sum2 * Z3 + 33.912866078383;
sum2 = sum2 * Z3 + 112.079291497871;
sum2 = sum2 * Z3 + 221.213596169931;
sum2 = sum2 * Z3 + 220.206867912376;
cd2 = exp2 * sum2;
sum2 = 0.0883883476483184 * Z3 + 1.75566716318264;
sum2 = sum2 * Z3 + 16.064177579207;
sum2 = sum2 * Z3 + 86.7807322029461;
sum2 = sum2 * Z3 + 296.564248779674;
sum2 = sum2 * Z3 + 637.333633378831;
sum2 = sum2 * Z3 + 793.826512519948;
sum2 = sum2 * Z3 + 440.413735824752;
cd2 = cd2 / sum2;
} else {
sum2 = Z3 + 0.65;
sum2 = Z3 + 4 / sum2;
sum2 = Z3 + 3 / sum2;
sum2 = Z3 + 2 / sum2;
sum2 = Z3 + 1 / sum2;
cd2 = exp2 / sum2 / 2.506628274631;
}
}
return z2 > 0 ? 1 - cd2 : cd2;
}
function quantileNormal(p2, mean2, stdev) {
if (p2 < 0 || p2 > 1)
return NaN;
return (mean2 || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p2 - 1);
}
function erfinv(x2) {
let w2 = -Math.log((1 - x2) * (1 + x2)), p2;
if (w2 < 6.25) {
w2 -= 3.125;
p2 = -364441206401782e-35;
p2 = -16850591381820166e-35 + p2 * w2;
p2 = 128584807152564e-32 + p2 * w2;
p2 = 11157877678025181e-33 + p2 * w2;
p2 = -1333171662854621e-31 + p2 * w2;
p2 = 20972767875968562e-33 + p2 * w2;
p2 = 6637638134358324e-30 + p2 * w2;
p2 = -4054566272975207e-29 + p2 * w2;
p2 = -8151934197605472e-29 + p2 * w2;
p2 = 26335093153082323e-28 + p2 * w2;
p2 = -12975133253453532e-27 + p2 * w2;
p2 = -5415412054294628e-26 + p2 * w2;
p2 = 10512122733215323e-25 + p2 * w2;
p2 = -4112633980346984e-24 + p2 * w2;
p2 = -29070369957882005e-24 + p2 * w2;
p2 = 42347877827932404e-23 + p2 * w2;
p2 = -13654692000834679e-22 + p2 * w2;
p2 = -13882523362786469e-21 + p2 * w2;
p2 = 18673420803405714e-20 + p2 * w2;
p2 = -740702534166267e-18 + p2 * w2;
p2 = -0.006033670871430149 + p2 * w2;
p2 = 0.24015818242558962 + p2 * w2;
p2 = 1.6536545626831027 + p2 * w2;
} else if (w2 < 16) {
w2 = Math.sqrt(w2) - 3.25;
p2 = 22137376921775787e-25;
p2 = 9075656193888539e-23 + p2 * w2;
p2 = -27517406297064545e-23 + p2 * w2;
p2 = 18239629214389228e-24 + p2 * w2;
p2 = 15027403968909828e-22 + p2 * w2;
p2 = -4013867526981546e-21 + p2 * w2;
p2 = 29234449089955446e-22 + p2 * w2;
p2 = 12475304481671779e-21 + p2 * w2;
p2 = -47318229009055734e-21 + p2 * w2;
p2 = 6828485145957318e-20 + p2 * w2;
p2 = 24031110387097894e-21 + p2 * w2;
p2 = -3550375203628475e-19 + p2 * w2;
p2 = 9532893797373805e-19 + p2 * w2;
p2 = -0.0016882755560235047 + p2 * w2;
p2 = 0.002491442096107851 + p2 * w2;
p2 = -0.003751208507569241 + p2 * w2;
p2 = 0.005370914553590064 + p2 * w2;
p2 = 1.0052589676941592 + p2 * w2;
p2 = 3.0838856104922208 + p2 * w2;
} else if (Number.isFinite(w2)) {
w2 = Math.sqrt(w2) - 5;
p2 = -27109920616438573e-27;
p2 = -2555641816996525e-25 + p2 * w2;
p2 = 15076572693500548e-25 + p2 * w2;
p2 = -3789465440126737e-24 + p2 * w2;
p2 = 761570120807834e-23 + p2 * w2;
p2 = -1496002662714924e-23 + p2 * w2;
p2 = 2914795345090108e-23 + p2 * w2;
p2 = -6771199775845234e-23 + p2 * w2;
p2 = 22900482228026655e-23 + p2 * w2;
p2 = -99298272942317e-20 + p2 * w2;
p2 = 4526062597223154e-21 + p2 * w2;
p2 = -1968177810553167e-20 + p2 * w2;
p2 = 7599527703001776e-20 + p2 * w2;
p2 = -21503011930044477e-20 + p2 * w2;
p2 = -13871931833623122e-20 + p2 * w2;
p2 = 1.0103004648645344 + p2 * w2;
p2 = 4.849906401408584 + p2 * w2;
} else {
p2 = Infinity;
}
return p2 * x2;
}
function gaussian(mean2, stdev) {
let mu2, sigma;
const dist2 = {
mean(_24) {
if (arguments.length) {
mu2 = _24 || 0;
return dist2;
} else {
return mu2;
}
},
stdev(_24) {
if (arguments.length) {
sigma = _24 == null ? 1 : _24;
return dist2;
} else {
return sigma;
}
},
sample: () => sampleNormal(mu2, sigma),
pdf: (value2) => densityNormal(value2, mu2, sigma),
cdf: (value2) => cumulativeNormal(value2, mu2, sigma),
icdf: (p2) => quantileNormal(p2, mu2, sigma)
};
return dist2.mean(mean2).stdev(stdev);
}
function kde(support, bandwidth2) {
const kernel = gaussian();
let n2 = 0;
const dist2 = {
data(_24) {
if (arguments.length) {
support = _24;
n2 = _24 ? _24.length : 0;
return dist2.bandwidth(bandwidth2);
} else {
return support;
}
},
bandwidth(_24) {
if (!arguments.length)
return bandwidth2;
bandwidth2 = _24;
if (!bandwidth2 && support)
bandwidth2 = estimateBandwidth(support);
return dist2;
},
sample() {
return support[~~(random() * n2)] + bandwidth2 * kernel.sample();
},
pdf(x2) {
let y2 = 0, i2 = 0;
for (; i2 < n2; ++i2) {
y2 += kernel.pdf((x2 - support[i2]) / bandwidth2);
}
return y2 / bandwidth2 / n2;
},
cdf(x2) {
let y2 = 0, i2 = 0;
for (; i2 < n2; ++i2) {
y2 += kernel.cdf((x2 - support[i2]) / bandwidth2);
}
return y2 / n2;
},
icdf() {
throw Error("KDE icdf not supported.");
}
};
return dist2.data(support);
}
function sampleLogNormal(mean2, stdev) {
mean2 = mean2 || 0;
stdev = stdev == null ? 1 : stdev;
return Math.exp(mean2 + sampleNormal() * stdev);
}
function densityLogNormal(value2, mean2, stdev) {
if (value2 <= 0)
return 0;
mean2 = mean2 || 0;
stdev = stdev == null ? 1 : stdev;
const z2 = (Math.log(value2) - mean2) / stdev;
return Math.exp(-0.5 * z2 * z2) / (stdev * SQRT2PI * value2);
}
function cumulativeLogNormal(value2, mean2, stdev) {
return cumulativeNormal(Math.log(value2), mean2, stdev);
}
function quantileLogNormal(p2, mean2, stdev) {
return Math.exp(quantileNormal(p2, mean2, stdev));
}
function lognormal(mean2, stdev) {
let mu2, sigma;
const dist2 = {
mean(_24) {
if (arguments.length) {
mu2 = _24 || 0;
return dist2;
} else {
return mu2;
}
},
stdev(_24) {
if (arguments.length) {
sigma = _24 == null ? 1 : _24;
return dist2;
} else {
return sigma;
}
},
sample: () => sampleLogNormal(mu2, sigma),
pdf: (value2) => densityLogNormal(value2, mu2, sigma),
cdf: (value2) => cumulativeLogNormal(value2, mu2, sigma),
icdf: (p2) => quantileLogNormal(p2, mu2, sigma)
};
return dist2.mean(mean2).stdev(stdev);
}
function mixture$1(dists, weights) {
let m2 = 0, w2;
function normalize2(x2) {
const w3 = [];
let sum2 = 0, i2;
for (i2 = 0; i2 < m2; ++i2) {
sum2 += w3[i2] = x2[i2] == null ? 1 : +x2[i2];
}
for (i2 = 0; i2 < m2; ++i2) {
w3[i2] /= sum2;
}
return w3;
}
const dist2 = {
weights(_24) {
if (arguments.length) {
w2 = normalize2(weights = _24 || []);
return dist2;
}
return weights;
},
distributions(_24) {
if (arguments.length) {
if (_24) {
m2 = _24.length;
dists = _24;
} else {
m2 = 0;
dists = [];
}
return dist2.weights(weights);
}
return dists;
},
sample() {
const r2 = random();
let d2 = dists[m2 - 1], v2 = w2[0], i2 = 0;
for (; i2 < m2 - 1; v2 += w2[++i2]) {
if (r2 < v2) {
d2 = dists[i2];
break;
}
}
return d2.sample();
},
pdf(x2) {
let p2 = 0, i2 = 0;
for (; i2 < m2; ++i2) {
p2 += w2[i2] * dists[i2].pdf(x2);
}
return p2;
},
cdf(x2) {
let p2 = 0, i2 = 0;
for (; i2 < m2; ++i2) {
p2 += w2[i2] * dists[i2].cdf(x2);
}
return p2;
},
icdf() {
throw Error("Mixture icdf not supported.");
}
};
return dist2.distributions(dists).weights(weights);
}
function sampleUniform(min2, max2) {
if (max2 == null) {
max2 = min2 == null ? 1 : min2;
min2 = 0;
}
return min2 + (max2 - min2) * random();
}
function densityUniform(value2, min2, max2) {
if (max2 == null) {
max2 = min2 == null ? 1 : min2;
min2 = 0;
}
return value2 >= min2 && value2 <= max2 ? 1 / (max2 - min2) : 0;
}
function cumulativeUniform(value2, min2, max2) {
if (max2 == null) {
max2 = min2 == null ? 1 : min2;
min2 = 0;
}
return value2 < min2 ? 0 : value2 > max2 ? 1 : (value2 - min2) / (max2 - min2);
}
function quantileUniform(p2, min2, max2) {
if (max2 == null) {
max2 = min2 == null ? 1 : min2;
min2 = 0;
}
return p2 >= 0 && p2 <= 1 ? min2 + p2 * (max2 - min2) : NaN;
}
function uniform(min2, max2) {
let a2, b2;
const dist2 = {
min(_24) {
if (arguments.length) {
a2 = _24 || 0;
return dist2;
} else {
return a2;
}
},
max(_24) {
if (arguments.length) {
b2 = _24 == null ? 1 : _24;
return dist2;
} else {
return b2;
}
},
sample: () => sampleUniform(a2, b2),
pdf: (value2) => densityUniform(value2, a2, b2),
cdf: (value2) => cumulativeUniform(value2, a2, b2),
icdf: (p2) => quantileUniform(p2, a2, b2)
};
if (max2 == null) {
max2 = min2 == null ? 1 : min2;
min2 = 0;
}
return dist2.min(min2).max(max2);
}
function constant$5(data2, x2, y2) {
let mean2 = 0, n2 = 0;
for (const d2 of data2) {
const val = y2(d2);
if (x2(d2) == null || val == null || isNaN(val))
continue;
mean2 += (val - mean2) / ++n2;
}
return {
coef: [mean2],
predict: () => mean2,
rSquared: 0
};
}
function ols(uX, uY, uXY, uX2) {
const delta = uX2 - uX * uX, slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta, intercept = uY - slope * uX;
return [intercept, slope];
}
function points(data2, x2, y2, sort2) {
data2 = data2.filter((d3) => {
let u2 = x2(d3), v2 = y2(d3);
return u2 != null && (u2 = +u2) >= u2 && v2 != null && (v2 = +v2) >= v2;
});
if (sort2) {
data2.sort((a2, b2) => x2(a2) - x2(b2));
}
const n2 = data2.length, X3 = new Float64Array(n2), Y3 = new Float64Array(n2);
let i2 = 0, ux = 0, uy = 0, xv, yv, d2;
for (d2 of data2) {
X3[i2] = xv = +x2(d2);
Y3[i2] = yv = +y2(d2);
++i2;
ux += (xv - ux) / i2;
uy += (yv - uy) / i2;
}
for (i2 = 0; i2 < n2; ++i2) {
X3[i2] -= ux;
Y3[i2] -= uy;
}
return [X3, Y3, ux, uy];
}
function visitPoints(data2, x2, y2, callback) {
let i2 = -1, u2, v2;
for (const d2 of data2) {
u2 = x2(d2);
v2 = y2(d2);
if (u2 != null && (u2 = +u2) >= u2 && v2 != null && (v2 = +v2) >= v2) {
callback(u2, v2, ++i2);
}
}
}
function rSquared(data2, x2, y2, uY, predict) {
let SSE = 0, SST = 0;
visitPoints(data2, x2, y2, (dx, dy) => {
const sse = dy - predict(dx), sst = dy - uY;
SSE += sse * sse;
SST += sst * sst;
});
return 1 - SSE / SST;
}
function linear$3(data2, x2, y2) {
let X3 = 0, Y3 = 0, XY = 0, X22 = 0, n2 = 0;
visitPoints(data2, x2, y2, (dx, dy) => {
++n2;
X3 += (dx - X3) / n2;
Y3 += (dy - Y3) / n2;
XY += (dx * dy - XY) / n2;
X22 += (dx * dx - X22) / n2;
});
const coef = ols(X3, Y3, XY, X22), predict = (x3) => coef[0] + coef[1] * x3;
return {
coef,
predict,
rSquared: rSquared(data2, x2, y2, Y3, predict)
};
}
function log$3(data2, x2, y2) {
let X3 = 0, Y3 = 0, XY = 0, X22 = 0, n2 = 0;
visitPoints(data2, x2, y2, (dx, dy) => {
++n2;
dx = Math.log(dx);
X3 += (dx - X3) / n2;
Y3 += (dy - Y3) / n2;
XY += (dx * dy - XY) / n2;
X22 += (dx * dx - X22) / n2;
});
const coef = ols(X3, Y3, XY, X22), predict = (x3) => coef[0] + coef[1] * Math.log(x3);
return {
coef,
predict,
rSquared: rSquared(data2, x2, y2, Y3, predict)
};
}
function exp$1(data2, x2, y2) {
const [xv, yv, ux, uy] = points(data2, x2, y2);
let YL = 0, XY = 0, XYL = 0, X2Y = 0, n2 = 0, dx, ly2, xy;
visitPoints(data2, x2, y2, (_24, dy) => {
dx = xv[n2++];
ly2 = Math.log(dy);
xy = dx * dy;
YL += (dy * ly2 - YL) / n2;
XY += (xy - XY) / n2;
XYL += (xy * ly2 - XYL) / n2;
X2Y += (dx * xy - X2Y) / n2;
});
const [c0, c1] = ols(XY / uy, YL / uy, XYL / uy, X2Y / uy), predict = (x3) => Math.exp(c0 + c1 * (x3 - ux));
return {
coef: [Math.exp(c0 - c1 * ux), c1],
predict,
rSquared: rSquared(data2, x2, y2, uy, predict)
};
}
function pow$3(data2, x2, y2) {
let X3 = 0, Y3 = 0, XY = 0, X22 = 0, YS = 0, n2 = 0;
visitPoints(data2, x2, y2, (dx, dy) => {
const lx2 = Math.log(dx), ly2 = Math.log(dy);
++n2;
X3 += (lx2 - X3) / n2;
Y3 += (ly2 - Y3) / n2;
XY += (lx2 * ly2 - XY) / n2;
X22 += (lx2 * lx2 - X22) / n2;
YS += (dy - YS) / n2;
});
const coef = ols(X3, Y3, XY, X22), predict = (x3) => coef[0] * Math.pow(x3, coef[1]);
coef[0] = Math.exp(coef[0]);
return {
coef,
predict,
rSquared: rSquared(data2, x2, y2, YS, predict)
};
}
function quad(data2, x2, y2) {
const [xv, yv, ux, uy] = points(data2, x2, y2), n2 = xv.length;
let X22 = 0, X3 = 0, X4 = 0, XY = 0, X2Y = 0, i2, dx, dy, x22;
for (i2 = 0; i2 < n2; ) {
dx = xv[i2];
dy = yv[i2++];
x22 = dx * dx;
X22 += (x22 - X22) / i2;
X3 += (x22 * dx - X3) / i2;
X4 += (x22 * x22 - X4) / i2;
XY += (dx * dy - XY) / i2;
X2Y += (x22 * dy - X2Y) / i2;
}
const X2X2 = X4 - X22 * X22, d2 = X22 * X2X2 - X3 * X3, a2 = (X2Y * X22 - XY * X3) / d2, b2 = (XY * X2X2 - X2Y * X3) / d2, c2 = -a2 * X22, predict = (x3) => {
x3 = x3 - ux;
return a2 * x3 * x3 + b2 * x3 + c2 + uy;
};
return {
coef: [c2 - b2 * ux + a2 * ux * ux + uy, b2 - 2 * a2 * ux, a2],
predict,
rSquared: rSquared(data2, x2, y2, uy, predict)
};
}
function poly(data2, x2, y2, order2) {
if (order2 === 0)
return constant$5(data2, x2, y2);
if (order2 === 1)
return linear$3(data2, x2, y2);
if (order2 === 2)
return quad(data2, x2, y2);
const [xv, yv, ux, uy] = points(data2, x2, y2), n2 = xv.length, lhs = [], rhs = [], k2 = order2 + 1;
let i2, j2, l2, v2, c2;
for (i2 = 0; i2 < k2; ++i2) {
for (l2 = 0, v2 = 0; l2 < n2; ++l2) {
v2 += Math.pow(xv[l2], i2) * yv[l2];
}
lhs.push(v2);
c2 = new Float64Array(k2);
for (j2 = 0; j2 < k2; ++j2) {
for (l2 = 0, v2 = 0; l2 < n2; ++l2) {
v2 += Math.pow(xv[l2], i2 + j2);
}
c2[j2] = v2;
}
rhs.push(c2);
}
rhs.push(lhs);
const coef = gaussianElimination(rhs), predict = (x3) => {
x3 -= ux;
let y3 = uy + coef[0] + coef[1] * x3 + coef[2] * x3 * x3;
for (i2 = 3; i2 < k2; ++i2)
y3 += coef[i2] * Math.pow(x3, i2);
return y3;
};
return {
coef: uncenter(k2, coef, -ux, uy),
predict,
rSquared: rSquared(data2, x2, y2, uy, predict)
};
}
function uncenter(k2, a2, x2, y2) {
const z2 = Array(k2);
let i2, j2, v2, c2;
for (i2 = 0; i2 < k2; ++i2)
z2[i2] = 0;
for (i2 = k2 - 1; i2 >= 0; --i2) {
v2 = a2[i2];
c2 = 1;
z2[i2] += v2;
for (j2 = 1; j2 <= i2; ++j2) {
c2 *= (i2 + 1 - j2) / j2;
z2[i2 - j2] += v2 * Math.pow(x2, j2) * c2;
}
}
z2[0] += y2;
return z2;
}
function gaussianElimination(matrix2) {
const n2 = matrix2.length - 1, coef = [];
let i2, j2, k2, r2, t5;
for (i2 = 0; i2 < n2; ++i2) {
r2 = i2;
for (j2 = i2 + 1; j2 < n2; ++j2) {
if (Math.abs(matrix2[i2][j2]) > Math.abs(matrix2[i2][r2])) {
r2 = j2;
}
}
for (k2 = i2; k2 < n2 + 1; ++k2) {
t5 = matrix2[k2][i2];
matrix2[k2][i2] = matrix2[k2][r2];
matrix2[k2][r2] = t5;
}
for (j2 = i2 + 1; j2 < n2; ++j2) {
for (k2 = n2; k2 >= i2; k2--) {
matrix2[k2][j2] -= matrix2[k2][i2] * matrix2[i2][j2] / matrix2[i2][i2];
}
}
}
for (j2 = n2 - 1; j2 >= 0; --j2) {
t5 = 0;
for (k2 = j2 + 1; k2 < n2; ++k2) {
t5 += matrix2[k2][j2] * coef[k2];
}
coef[j2] = (matrix2[n2][j2] - t5) / matrix2[j2][j2];
}
return coef;
}
const maxiters = 2, epsilon$6 = 1e-12;
function loess(data2, x2, y2, bandwidth2) {
const [xv, yv, ux, uy] = points(data2, x2, y2, true), n2 = xv.length, bw = Math.max(2, ~~(bandwidth2 * n2)), yhat = new Float64Array(n2), residuals = new Float64Array(n2), robustWeights = new Float64Array(n2).fill(1);
for (let iter = -1; ++iter <= maxiters; ) {
const interval2 = [0, bw - 1];
for (let i2 = 0; i2 < n2; ++i2) {
const dx = xv[i2], i0 = interval2[0], i1 = interval2[1], edge = dx - xv[i0] > xv[i1] - dx ? i0 : i1;
let W2 = 0, X3 = 0, Y3 = 0, XY = 0, X22 = 0;
const denom = 1 / Math.abs(xv[edge] - dx || 1);
for (let k2 = i0; k2 <= i1; ++k2) {
const xk2 = xv[k2], yk = yv[k2], w2 = tricube(Math.abs(dx - xk2) * denom) * robustWeights[k2], xkw = xk2 * w2;
W2 += w2;
X3 += xkw;
Y3 += yk * w2;
XY += yk * xkw;
X22 += xk2 * xkw;
}
const [a2, b2] = ols(X3 / W2, Y3 / W2, XY / W2, X22 / W2);
yhat[i2] = a2 + b2 * dx;
residuals[i2] = Math.abs(yv[i2] - yhat[i2]);
updateInterval(xv, i2 + 1, interval2);
}
if (iter === maxiters) {
break;
}
const medianResidual = median$1(residuals);
if (Math.abs(medianResidual) < epsilon$6)
break;
for (let i2 = 0, arg, w2; i2 < n2; ++i2) {
arg = residuals[i2] / (6 * medianResidual);
robustWeights[i2] = arg >= 1 ? epsilon$6 : (w2 = 1 - arg * arg) * w2;
}
}
return output$1(xv, yhat, ux, uy);
}
function tricube(x2) {
return (x2 = 1 - x2 * x2 * x2) * x2 * x2;
}
function updateInterval(xv, i2, interval2) {
const val = xv[i2];
let left2 = interval2[0], right2 = interval2[1] + 1;
if (right2 >= xv.length)
return;
while (i2 > left2 && xv[right2] - val <= val - xv[left2]) {
interval2[0] = ++left2;
interval2[1] = right2;
++right2;
}
}
function output$1(xv, yhat, ux, uy) {
const n2 = xv.length, out = [];
let i2 = 0, cnt = 0, prev2 = [], v2;
for (; i2 < n2; ++i2) {
v2 = xv[i2] + ux;
if (prev2[0] === v2) {
prev2[1] += (yhat[i2] - prev2[1]) / ++cnt;
} else {
cnt = 0;
prev2[1] += uy;
prev2 = [v2, yhat[i2]];
out.push(prev2);
}
}
prev2[1] += uy;
return out;
}
const MIN_RADIANS = 0.5 * Math.PI / 180;
function sampleCurve(f2, extent2, minSteps, maxSteps) {
minSteps = minSteps || 25;
maxSteps = Math.max(minSteps, maxSteps || 200);
const point2 = (x2) => [x2, f2(x2)], minX = extent2[0], maxX = extent2[1], span2 = maxX - minX, stop2 = span2 / maxSteps, prev2 = [point2(minX)], next2 = [];
if (minSteps === maxSteps) {
for (let i2 = 1; i2 < maxSteps; ++i2) {
prev2.push(point2(minX + i2 / minSteps * span2));
}
prev2.push(point2(maxX));
return prev2;
} else {
next2.push(point2(maxX));
for (let i2 = minSteps; --i2 > 0; ) {
next2.push(point2(minX + i2 / minSteps * span2));
}
}
let p02 = prev2[0];
let p1 = next2[next2.length - 1];
const sx = 1 / span2;
const sy = scaleY(p02[1], next2);
while (p1) {
const pm = point2((p02[0] + p1[0]) / 2);
const dx = pm[0] - p02[0] >= stop2;
if (dx && angleDelta(p02, pm, p1, sx, sy) > MIN_RADIANS) {
next2.push(pm);
} else {
p02 = p1;
prev2.push(p1);
next2.pop();
}
p1 = next2[next2.length - 1];
}
return prev2;
}
function scaleY(init3, points2) {
let ymin = init3;
let ymax = init3;
const n2 = points2.length;
for (let i2 = 0; i2 < n2; ++i2) {
const y2 = points2[i2][1];
if (y2 < ymin)
ymin = y2;
if (y2 > ymax)
ymax = y2;
}
return 1 / (ymax - ymin);
}
function angleDelta(p2, q2, r2, sx, sy) {
const a0 = Math.atan2(sy * (r2[1] - p2[1]), sx * (r2[0] - p2[0])), a1 = Math.atan2(sy * (q2[1] - p2[1]), sx * (q2[0] - p2[0]));
return Math.abs(a0 - a1);
}
function ascending$4(a2, b2) {
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function descending$4(a2, b2) {
return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN;
}
function bisector$3(f2) {
let compare12, compare22, delta;
if (f2.length !== 2) {
compare12 = ascending$4;
compare22 = (d2, x2) => ascending$4(f2(d2), x2);
delta = (d2, x2) => f2(d2) - x2;
} else {
compare12 = f2 === ascending$4 || f2 === descending$4 ? f2 : zero$5;
compare22 = f2;
delta = f2;
}
function left2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) < 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function right2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) <= 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function center(a2, x2, lo2 = 0, hi2 = a2.length) {
const i2 = left2(a2, x2, lo2, hi2 - 1);
return i2 > lo2 && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
}
return { left: left2, center, right: right2 };
}
function zero$5() {
return 0;
}
function* numbers$1(values2, valueof) {
if (valueof === void 0) {
for (let value2 of values2) {
if (value2 != null && (value2 = +value2) >= value2) {
yield value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (value2 = +value2) >= value2) {
yield value2;
}
}
}
}
function compareDefined(compare3 = ascending$4) {
if (compare3 === ascending$4)
return ascendingDefined;
if (typeof compare3 !== "function")
throw new TypeError("compare is not a function");
return (a2, b2) => {
const x2 = compare3(a2, b2);
if (x2 || x2 === 0)
return x2;
return (compare3(b2, b2) === 0) - (compare3(a2, a2) === 0);
};
}
function ascendingDefined(a2, b2) {
return (a2 == null || !(a2 >= a2)) - (b2 == null || !(b2 >= b2)) || (a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
}
function max$7(values2, valueof) {
let max2;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
max2 = value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
max2 = value2;
}
}
}
return max2;
}
function min$8(values2, valueof) {
let min2;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) {
min2 = value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) {
min2 = value2;
}
}
}
return min2;
}
function quickselect(array2, k2, left2 = 0, right2 = Infinity, compare3) {
k2 = Math.floor(k2);
left2 = Math.floor(Math.max(0, left2));
right2 = Math.floor(Math.min(array2.length - 1, right2));
if (!(left2 <= k2 && k2 <= right2))
return array2;
compare3 = compare3 === void 0 ? ascendingDefined : compareDefined(compare3);
while (right2 > left2) {
if (right2 - left2 > 600) {
const n2 = right2 - left2 + 1;
const m2 = k2 - left2 + 1;
const z2 = Math.log(n2);
const s2 = 0.5 * Math.exp(2 * z2 / 3);
const sd2 = 0.5 * Math.sqrt(z2 * s2 * (n2 - s2) / n2) * (m2 - n2 / 2 < 0 ? -1 : 1);
const newLeft = Math.max(left2, Math.floor(k2 - m2 * s2 / n2 + sd2));
const newRight = Math.min(right2, Math.floor(k2 + (n2 - m2) * s2 / n2 + sd2));
quickselect(array2, k2, newLeft, newRight, compare3);
}
const t5 = array2[k2];
let i2 = left2;
let j2 = right2;
swap$1(array2, left2, k2);
if (compare3(array2[right2], t5) > 0)
swap$1(array2, left2, right2);
while (i2 < j2) {
swap$1(array2, i2, j2), ++i2, --j2;
while (compare3(array2[i2], t5) < 0)
++i2;
while (compare3(array2[j2], t5) > 0)
--j2;
}
if (compare3(array2[left2], t5) === 0)
swap$1(array2, left2, j2);
else
++j2, swap$1(array2, j2, right2);
if (j2 <= k2)
left2 = j2 + 1;
if (k2 <= j2)
right2 = j2 - 1;
}
return array2;
}
function swap$1(array2, i2, j2) {
const t5 = array2[i2];
array2[i2] = array2[j2];
array2[j2] = t5;
}
function quantile$1(values2, p2, valueof) {
values2 = Float64Array.from(numbers$1(values2, valueof));
if (!(n2 = values2.length) || isNaN(p2 = +p2))
return;
if (p2 <= 0 || n2 < 2)
return min$8(values2);
if (p2 >= 1)
return max$7(values2);
var n2, i2 = (n2 - 1) * p2, i0 = Math.floor(i2), value0 = max$7(quickselect(values2, i0).subarray(0, i0 + 1)), value1 = min$8(values2.subarray(i0 + 1));
return value0 + (value1 - value0) * (i2 - i0);
}
function mean(values2, valueof) {
let count2 = 0;
let sum2 = 0;
if (valueof === void 0) {
for (let value2 of values2) {
if (value2 != null && (value2 = +value2) >= value2) {
++count2, sum2 += value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (value2 = +value2) >= value2) {
++count2, sum2 += value2;
}
}
}
if (count2)
return sum2 / count2;
}
function median(values2, valueof) {
return quantile$1(values2, 0.5, valueof);
}
function range$7(start2, stop2, step) {
start2 = +start2, stop2 = +stop2, step = (n2 = arguments.length) < 2 ? (stop2 = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop2 - start2) / step)) | 0, range2 = new Array(n2);
while (++i2 < n2) {
range2[i2] = start2 + i2 * step;
}
return range2;
}
function multikey(f2) {
return (x2) => {
const n2 = f2.length;
let i2 = 1, k2 = String(f2[0](x2));
for (; i2 < n2; ++i2) {
k2 += "|" + f2[i2](x2);
}
return k2;
};
}
function groupkey(fields) {
return !fields || !fields.length ? function() {
return "";
} : fields.length === 1 ? fields[0] : multikey(fields);
}
function measureName(op, field2, as) {
return as || op + (!field2 ? "" : "_" + field2);
}
const noop$6 = () => {
};
const base_op = {
init: noop$6,
add: noop$6,
rem: noop$6,
idx: 0
};
const AggregateOps = {
values: {
init: (m2) => m2.cell.store = true,
value: (m2) => m2.cell.data.values(),
idx: -1
},
count: {
value: (m2) => m2.cell.num
},
__count__: {
value: (m2) => m2.missing + m2.valid
},
missing: {
value: (m2) => m2.missing
},
valid: {
value: (m2) => m2.valid
},
sum: {
init: (m2) => m2.sum = 0,
value: (m2) => m2.sum,
add: (m2, v2) => m2.sum += +v2,
rem: (m2, v2) => m2.sum -= v2
},
product: {
init: (m2) => m2.product = 1,
value: (m2) => m2.valid ? m2.product : void 0,
add: (m2, v2) => m2.product *= v2,
rem: (m2, v2) => m2.product /= v2
},
mean: {
init: (m2) => m2.mean = 0,
value: (m2) => m2.valid ? m2.mean : void 0,
add: (m2, v2) => (m2.mean_d = v2 - m2.mean, m2.mean += m2.mean_d / m2.valid),
rem: (m2, v2) => (m2.mean_d = v2 - m2.mean, m2.mean -= m2.valid ? m2.mean_d / m2.valid : m2.mean)
},
average: {
value: (m2) => m2.valid ? m2.mean : void 0,
req: ["mean"],
idx: 1
},
variance: {
init: (m2) => m2.dev = 0,
value: (m2) => m2.valid > 1 ? m2.dev / (m2.valid - 1) : void 0,
add: (m2, v2) => m2.dev += m2.mean_d * (v2 - m2.mean),
rem: (m2, v2) => m2.dev -= m2.mean_d * (v2 - m2.mean),
req: ["mean"],
idx: 1
},
variancep: {
value: (m2) => m2.valid > 1 ? m2.dev / m2.valid : void 0,
req: ["variance"],
idx: 2
},
stdev: {
value: (m2) => m2.valid > 1 ? Math.sqrt(m2.dev / (m2.valid - 1)) : void 0,
req: ["variance"],
idx: 2
},
stdevp: {
value: (m2) => m2.valid > 1 ? Math.sqrt(m2.dev / m2.valid) : void 0,
req: ["variance"],
idx: 2
},
stderr: {
value: (m2) => m2.valid > 1 ? Math.sqrt(m2.dev / (m2.valid * (m2.valid - 1))) : void 0,
req: ["variance"],
idx: 2
},
distinct: {
value: (m2) => m2.cell.data.distinct(m2.get),
req: ["values"],
idx: 3
},
ci0: {
value: (m2) => m2.cell.data.ci0(m2.get),
req: ["values"],
idx: 3
},
ci1: {
value: (m2) => m2.cell.data.ci1(m2.get),
req: ["values"],
idx: 3
},
median: {
value: (m2) => m2.cell.data.q2(m2.get),
req: ["values"],
idx: 3
},
q1: {
value: (m2) => m2.cell.data.q1(m2.get),
req: ["values"],
idx: 3
},
q3: {
value: (m2) => m2.cell.data.q3(m2.get),
req: ["values"],
idx: 3
},
min: {
init: (m2) => m2.min = void 0,
value: (m2) => m2.min = Number.isNaN(m2.min) ? m2.cell.data.min(m2.get) : m2.min,
add: (m2, v2) => {
if (v2 < m2.min || m2.min === void 0)
m2.min = v2;
},
rem: (m2, v2) => {
if (v2 <= m2.min)
m2.min = NaN;
},
req: ["values"],
idx: 4
},
max: {
init: (m2) => m2.max = void 0,
value: (m2) => m2.max = Number.isNaN(m2.max) ? m2.cell.data.max(m2.get) : m2.max,
add: (m2, v2) => {
if (v2 > m2.max || m2.max === void 0)
m2.max = v2;
},
rem: (m2, v2) => {
if (v2 >= m2.max)
m2.max = NaN;
},
req: ["values"],
idx: 4
},
argmin: {
init: (m2) => m2.argmin = void 0,
value: (m2) => m2.argmin || m2.cell.data.argmin(m2.get),
add: (m2, v2, t5) => {
if (v2 < m2.min)
m2.argmin = t5;
},
rem: (m2, v2) => {
if (v2 <= m2.min)
m2.argmin = void 0;
},
req: ["min", "values"],
idx: 3
},
argmax: {
init: (m2) => m2.argmax = void 0,
value: (m2) => m2.argmax || m2.cell.data.argmax(m2.get),
add: (m2, v2, t5) => {
if (v2 > m2.max)
m2.argmax = t5;
},
rem: (m2, v2) => {
if (v2 >= m2.max)
m2.argmax = void 0;
},
req: ["max", "values"],
idx: 3
},
exponential: {
init: (m2, r2) => {
m2.exp = 0;
m2.exp_r = r2;
},
value: (m2) => m2.valid ? m2.exp * (1 - m2.exp_r) / (1 - m2.exp_r ** m2.valid) : void 0,
add: (m2, v2) => m2.exp = m2.exp_r * m2.exp + v2,
rem: (m2, v2) => m2.exp = (m2.exp - v2 / m2.exp_r ** (m2.valid - 1)) / m2.exp_r
},
exponentialb: {
value: (m2) => m2.valid ? m2.exp * (1 - m2.exp_r) : void 0,
req: ["exponential"],
idx: 1
}
};
const ValidAggregateOps = Object.keys(AggregateOps).filter((d2) => d2 !== "__count__");
function measure(key2, value2) {
return (out, aggregate_param) => extend$2({
name: key2,
aggregate_param,
out: out || key2
}, base_op, value2);
}
[...ValidAggregateOps, "__count__"].forEach((key2) => {
AggregateOps[key2] = measure(key2, AggregateOps[key2]);
});
function createMeasure(op, param2, name) {
return AggregateOps[op](name, param2);
}
function compareIndex(a2, b2) {
return a2.idx - b2.idx;
}
function resolve(agg) {
const map2 = {};
agg.forEach((a2) => map2[a2.name] = a2);
const getreqs = (a2) => {
if (!a2.req)
return;
a2.req.forEach((key2) => {
if (!map2[key2])
getreqs(map2[key2] = AggregateOps[key2]());
});
};
agg.forEach(getreqs);
return Object.values(map2).sort(compareIndex);
}
function init2() {
this.valid = 0;
this.missing = 0;
this._ops.forEach((op) => op.aggregate_param == null ? op.init(this) : op.init(this, op.aggregate_param));
}
function add$2(v2, t5) {
if (v2 == null || v2 === "") {
++this.missing;
return;
}
if (v2 !== v2)
return;
++this.valid;
this._ops.forEach((op) => op.add(this, v2, t5));
}
function rem(v2, t5) {
if (v2 == null || v2 === "") {
--this.missing;
return;
}
if (v2 !== v2)
return;
--this.valid;
this._ops.forEach((op) => op.rem(this, v2, t5));
}
function set$6(t5) {
this._out.forEach((op) => t5[op.out] = op.value(this));
return t5;
}
function compileMeasures(agg, field2) {
const get2 = field2 || identity$6, ops2 = resolve(agg), out = agg.slice().sort(compareIndex);
function ctr(cell2) {
this._ops = ops2;
this._out = out;
this.cell = cell2;
this.init();
}
ctr.prototype.init = init2;
ctr.prototype.add = add$2;
ctr.prototype.rem = rem;
ctr.prototype.set = set$6;
ctr.prototype.get = get2;
ctr.fields = agg.map((op) => op.out);
return ctr;
}
function TupleStore(key2) {
this._key = key2 ? field$1(key2) : tupleid;
this.reset();
}
const prototype$1 = TupleStore.prototype;
prototype$1.reset = function() {
this._add = [];
this._rem = [];
this._ext = null;
this._get = null;
this._q = null;
};
prototype$1.add = function(v2) {
this._add.push(v2);
};
prototype$1.rem = function(v2) {
this._rem.push(v2);
};
prototype$1.values = function() {
this._get = null;
if (this._rem.length === 0)
return this._add;
const a2 = this._add, r2 = this._rem, k2 = this._key, n2 = a2.length, m2 = r2.length, x2 = Array(n2 - m2), map2 = {};
let i2, j2, v2;
for (i2 = 0; i2 < m2; ++i2) {
map2[k2(r2[i2])] = 1;
}
for (i2 = 0, j2 = 0; i2 < n2; ++i2) {
if (map2[k2(v2 = a2[i2])]) {
map2[k2(v2)] = 0;
} else {
x2[j2++] = v2;
}
}
this._rem = [];
return this._add = x2;
};
prototype$1.distinct = function(get2) {
const v2 = this.values(), map2 = {};
let n2 = v2.length, count2 = 0, s2;
while (--n2 >= 0) {
s2 = get2(v2[n2]) + "";
if (!has$2(map2, s2)) {
map2[s2] = 1;
++count2;
}
}
return count2;
};
prototype$1.extent = function(get2) {
if (this._get !== get2 || !this._ext) {
const v2 = this.values(), i2 = extentIndex(v2, get2);
this._ext = [v2[i2[0]], v2[i2[1]]];
this._get = get2;
}
return this._ext;
};
prototype$1.argmin = function(get2) {
return this.extent(get2)[0] || {};
};
prototype$1.argmax = function(get2) {
return this.extent(get2)[1] || {};
};
prototype$1.min = function(get2) {
const m2 = this.extent(get2)[0];
return m2 != null ? get2(m2) : void 0;
};
prototype$1.max = function(get2) {
const m2 = this.extent(get2)[1];
return m2 != null ? get2(m2) : void 0;
};
prototype$1.quartile = function(get2) {
if (this._get !== get2 || !this._q) {
this._q = quartiles(this.values(), get2);
this._get = get2;
}
return this._q;
};
prototype$1.q1 = function(get2) {
return this.quartile(get2)[0];
};
prototype$1.q2 = function(get2) {
return this.quartile(get2)[1];
};
prototype$1.q3 = function(get2) {
return this.quartile(get2)[2];
};
prototype$1.ci = function(get2) {
if (this._get !== get2 || !this._ci) {
this._ci = bootstrapCI(this.values(), 1e3, 0.05, get2);
this._get = get2;
}
return this._ci;
};
prototype$1.ci0 = function(get2) {
return this.ci(get2)[0];
};
prototype$1.ci1 = function(get2) {
return this.ci(get2)[1];
};
function Aggregate$1(params2) {
Transform$1.call(this, null, params2);
this._adds = [];
this._mods = [];
this._alen = 0;
this._mlen = 0;
this._drop = true;
this._cross = false;
this._dims = [];
this._dnames = [];
this._measures = [];
this._countOnly = false;
this._counts = null;
this._prev = null;
this._inputs = null;
this._outputs = null;
}
Aggregate$1.Definition = {
"type": "Aggregate",
"metadata": {
"generates": true,
"changes": true
},
"params": [{
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "ops",
"type": "enum",
"array": true,
"values": ValidAggregateOps
}, {
"name": "aggregate_params",
"type": "field",
"null": true,
"array": true,
"default": [null]
}, {
"name": "fields",
"type": "field",
"null": true,
"array": true
}, {
"name": "as",
"type": "string",
"null": true,
"array": true
}, {
"name": "drop",
"type": "boolean",
"default": true
}, {
"name": "cross",
"type": "boolean",
"default": false
}, {
"name": "key",
"type": "field"
}]
};
inherits(Aggregate$1, Transform$1, {
transform(_24, pulse2) {
const aggr = this, out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), mod = _24.modified();
aggr.stamp = out.stamp;
if (aggr.value && (mod || pulse2.modified(aggr._inputs, true))) {
aggr._prev = aggr.value;
aggr.value = mod ? aggr.init(_24) : /* @__PURE__ */ Object.create(null);
pulse2.visit(pulse2.SOURCE, (t5) => aggr.add(t5));
} else {
aggr.value = aggr.value || aggr.init(_24);
pulse2.visit(pulse2.REM, (t5) => aggr.rem(t5));
pulse2.visit(pulse2.ADD, (t5) => aggr.add(t5));
}
out.modifies(aggr._outputs);
aggr._drop = _24.drop !== false;
if (_24.cross && aggr._dims.length > 1) {
aggr._drop = false;
aggr.cross();
}
if (pulse2.clean() && aggr._drop) {
out.clean(true).runAfter(() => this.clean());
}
return aggr.changes(out);
},
cross() {
const aggr = this, curr = aggr.value, dims = aggr._dnames, vals = dims.map(() => ({})), n2 = dims.length;
function collect2(cells) {
let key2, i2, t5, v2;
for (key2 in cells) {
t5 = cells[key2].tuple;
for (i2 = 0; i2 < n2; ++i2) {
vals[i2][v2 = t5[dims[i2]]] = v2;
}
}
}
collect2(aggr._prev);
collect2(curr);
function generate2(base2, tuple, index2) {
const name = dims[index2], v2 = vals[index2++];
for (const k2 in v2) {
const key2 = base2 ? base2 + "|" + k2 : k2;
tuple[name] = v2[k2];
if (index2 < n2)
generate2(key2, tuple, index2);
else if (!curr[key2])
aggr.cell(key2, tuple);
}
}
generate2("", {}, 0);
},
init(_24) {
const inputs = this._inputs = [], outputs = this._outputs = [], inputMap = {};
function inputVisit(get2) {
const fields2 = array$5(accessorFields(get2)), n3 = fields2.length;
let i3 = 0, f2;
for (; i3 < n3; ++i3) {
if (!inputMap[f2 = fields2[i3]]) {
inputMap[f2] = 1;
inputs.push(f2);
}
}
}
this._dims = array$5(_24.groupby);
this._dnames = this._dims.map((d2) => {
const dname = accessorName(d2);
inputVisit(d2);
outputs.push(dname);
return dname;
});
this.cellkey = _24.key ? _24.key : groupkey(this._dims);
this._countOnly = true;
this._counts = [];
this._measures = [];
const fields = _24.fields || [null], ops2 = _24.ops || ["count"], aggregate_params = _24.aggregate_params || [null], as = _24.as || [], n2 = fields.length, map2 = {};
let field2, op, aggregate_param, m2, mname, outname, i2;
if (n2 !== ops2.length) {
error2("Unmatched number of fields and aggregate ops.");
}
for (i2 = 0; i2 < n2; ++i2) {
field2 = fields[i2];
op = ops2[i2];
aggregate_param = aggregate_params[i2] || null;
if (field2 == null && op !== "count") {
error2("Null aggregate field specified.");
}
mname = accessorName(field2);
outname = measureName(op, mname, as[i2]);
outputs.push(outname);
if (op === "count") {
this._counts.push(outname);
continue;
}
m2 = map2[mname];
if (!m2) {
inputVisit(field2);
m2 = map2[mname] = [];
m2.field = field2;
this._measures.push(m2);
}
if (op !== "count")
this._countOnly = false;
m2.push(createMeasure(op, aggregate_param, outname));
}
this._measures = this._measures.map((m3) => compileMeasures(m3, m3.field));
return /* @__PURE__ */ Object.create(null);
},
// -- Cell Management -----
cellkey: groupkey(),
cell(key2, t5) {
let cell2 = this.value[key2];
if (!cell2) {
cell2 = this.value[key2] = this.newcell(key2, t5);
this._adds[this._alen++] = cell2;
} else if (cell2.num === 0 && this._drop && cell2.stamp < this.stamp) {
cell2.stamp = this.stamp;
this._adds[this._alen++] = cell2;
} else if (cell2.stamp < this.stamp) {
cell2.stamp = this.stamp;
this._mods[this._mlen++] = cell2;
}
return cell2;
},
newcell(key2, t5) {
const cell2 = {
key: key2,
num: 0,
agg: null,
tuple: this.newtuple(t5, this._prev && this._prev[key2]),
stamp: this.stamp,
store: false
};
if (!this._countOnly) {
const measures = this._measures, n2 = measures.length;
cell2.agg = Array(n2);
for (let i2 = 0; i2 < n2; ++i2) {
cell2.agg[i2] = new measures[i2](cell2);
}
}
if (cell2.store) {
cell2.data = new TupleStore();
}
return cell2;
},
newtuple(t5, p2) {
const names = this._dnames, dims = this._dims, n2 = dims.length, x2 = {};
for (let i2 = 0; i2 < n2; ++i2) {
x2[names[i2]] = dims[i2](t5);
}
return p2 ? replace$5(p2.tuple, x2) : ingest$1(x2);
},
clean() {
const cells = this.value;
for (const key2 in cells) {
if (cells[key2].num === 0) {
delete cells[key2];
}
}
},
// -- Process Tuples -----
add(t5) {
const key2 = this.cellkey(t5), cell2 = this.cell(key2, t5);
cell2.num += 1;
if (this._countOnly)
return;
if (cell2.store)
cell2.data.add(t5);
const agg = cell2.agg;
for (let i2 = 0, n2 = agg.length; i2 < n2; ++i2) {
agg[i2].add(agg[i2].get(t5), t5);
}
},
rem(t5) {
const key2 = this.cellkey(t5), cell2 = this.cell(key2, t5);
cell2.num -= 1;
if (this._countOnly)
return;
if (cell2.store)
cell2.data.rem(t5);
const agg = cell2.agg;
for (let i2 = 0, n2 = agg.length; i2 < n2; ++i2) {
agg[i2].rem(agg[i2].get(t5), t5);
}
},
celltuple(cell2) {
const tuple = cell2.tuple, counts = this._counts;
if (cell2.store) {
cell2.data.values();
}
for (let i2 = 0, n2 = counts.length; i2 < n2; ++i2) {
tuple[counts[i2]] = cell2.num;
}
if (!this._countOnly) {
const agg = cell2.agg;
for (let i2 = 0, n2 = agg.length; i2 < n2; ++i2) {
agg[i2].set(tuple);
}
}
return tuple;
},
changes(out) {
const adds = this._adds, mods = this._mods, prev2 = this._prev, drop = this._drop, add3 = out.add, rem2 = out.rem, mod = out.mod;
let cell2, key2, i2, n2;
if (prev2)
for (key2 in prev2) {
cell2 = prev2[key2];
if (!drop || cell2.num)
rem2.push(cell2.tuple);
}
for (i2 = 0, n2 = this._alen; i2 < n2; ++i2) {
add3.push(this.celltuple(adds[i2]));
adds[i2] = null;
}
for (i2 = 0, n2 = this._mlen; i2 < n2; ++i2) {
cell2 = mods[i2];
(cell2.num === 0 && drop ? rem2 : mod).push(this.celltuple(cell2));
mods[i2] = null;
}
this._alen = this._mlen = 0;
this._prev = null;
return out;
}
});
const EPSILON$1 = 1e-14;
function Bin(params2) {
Transform$1.call(this, null, params2);
}
Bin.Definition = {
"type": "Bin",
"metadata": {
"modifies": true
},
"params": [{
"name": "field",
"type": "field",
"required": true
}, {
"name": "interval",
"type": "boolean",
"default": true
}, {
"name": "anchor",
"type": "number"
}, {
"name": "maxbins",
"type": "number",
"default": 20
}, {
"name": "base",
"type": "number",
"default": 10
}, {
"name": "divide",
"type": "number",
"array": true,
"default": [5, 2]
}, {
"name": "extent",
"type": "number",
"array": true,
"length": 2,
"required": true
}, {
"name": "span",
"type": "number"
}, {
"name": "step",
"type": "number"
}, {
"name": "steps",
"type": "number",
"array": true
}, {
"name": "minstep",
"type": "number",
"default": 0
}, {
"name": "nice",
"type": "boolean",
"default": true
}, {
"name": "name",
"type": "string"
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": ["bin0", "bin1"]
}]
};
inherits(Bin, Transform$1, {
transform(_24, pulse2) {
const band2 = _24.interval !== false, bins = this._bins(_24), start2 = bins.start, step = bins.step, as = _24.as || ["bin0", "bin1"], b0 = as[0], b1 = as[1];
let flag2;
if (_24.modified()) {
pulse2 = pulse2.reflow(true);
flag2 = pulse2.SOURCE;
} else {
flag2 = pulse2.modified(accessorFields(_24.field)) ? pulse2.ADD_MOD : pulse2.ADD;
}
pulse2.visit(flag2, band2 ? (t5) => {
const v2 = bins(t5);
t5[b0] = v2;
t5[b1] = v2 == null ? null : start2 + step * (1 + (v2 - start2) / step);
} : (t5) => t5[b0] = bins(t5));
return pulse2.modifies(band2 ? as : b0);
},
_bins(_24) {
if (this.value && !_24.modified()) {
return this.value;
}
const field2 = _24.field, bins = bin(_24), step = bins.step;
let start2 = bins.start, stop2 = start2 + Math.ceil((bins.stop - start2) / step) * step, a2, d2;
if ((a2 = _24.anchor) != null) {
d2 = a2 - (start2 + step * Math.floor((a2 - start2) / step));
start2 += d2;
stop2 += d2;
}
const f2 = function(t5) {
let v2 = toNumber2(field2(t5));
return v2 == null ? null : v2 < start2 ? -Infinity : v2 > stop2 ? Infinity : (v2 = Math.max(start2, Math.min(v2, stop2 - step)), start2 + step * Math.floor(EPSILON$1 + (v2 - start2) / step));
};
f2.start = start2;
f2.stop = bins.stop;
f2.step = step;
return this.value = accessor(f2, accessorFields(field2), _24.name || "bin_" + accessorName(field2));
}
});
function SortedList(idFunc, source2, input) {
const $2 = idFunc;
let data2 = source2 || [], add3 = input || [], rem2 = {}, cnt = 0;
return {
add: (t5) => add3.push(t5),
remove: (t5) => rem2[$2(t5)] = ++cnt,
size: () => data2.length,
data: (compare3, resort) => {
if (cnt) {
data2 = data2.filter((t5) => !rem2[$2(t5)]);
rem2 = {};
cnt = 0;
}
if (resort && compare3) {
data2.sort(compare3);
}
if (add3.length) {
data2 = compare3 ? merge$3(compare3, data2, add3.sort(compare3)) : data2.concat(add3);
add3 = [];
}
return data2;
}
};
}
function Collect$1(params2) {
Transform$1.call(this, [], params2);
}
Collect$1.Definition = {
"type": "Collect",
"metadata": {
"source": true
},
"params": [{
"name": "sort",
"type": "compare"
}]
};
inherits(Collect$1, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.ALL), list = SortedList(tupleid, this.value, out.materialize(out.ADD).add), sort2 = _24.sort, mod = pulse2.changed() || sort2 && (_24.modified("sort") || pulse2.modified(sort2.fields));
out.visit(out.REM, list.remove);
this.modified(mod);
this.value = out.source = list.data(stableCompare(sort2), mod);
if (pulse2.source && pulse2.source.root) {
this.value.root = pulse2.source.root;
}
return out;
}
});
function Compare$1(params2) {
Operator.call(this, null, update$5, params2);
}
inherits(Compare$1, Operator);
function update$5(_24) {
return this.value && !_24.modified() ? this.value : compare$1(_24.fields, _24.orders);
}
function CountPattern(params2) {
Transform$1.call(this, null, params2);
}
CountPattern.Definition = {
"type": "CountPattern",
"metadata": {
"generates": true,
"changes": true
},
"params": [{
"name": "field",
"type": "field",
"required": true
}, {
"name": "case",
"type": "enum",
"values": ["upper", "lower", "mixed"],
"default": "mixed"
}, {
"name": "pattern",
"type": "string",
"default": '[\\w"]+'
}, {
"name": "stopwords",
"type": "string",
"default": ""
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": ["text", "count"]
}]
};
function tokenize(text2, tcase, match2) {
switch (tcase) {
case "upper":
text2 = text2.toUpperCase();
break;
case "lower":
text2 = text2.toLowerCase();
break;
}
return text2.match(match2);
}
inherits(CountPattern, Transform$1, {
transform(_24, pulse2) {
const process2 = (update2) => (tuple) => {
var tokens = tokenize(get2(tuple), _24.case, match2) || [], t5;
for (var i2 = 0, n2 = tokens.length; i2 < n2; ++i2) {
if (!stop2.test(t5 = tokens[i2]))
update2(t5);
}
};
const init3 = this._parameterCheck(_24, pulse2), counts = this._counts, match2 = this._match, stop2 = this._stop, get2 = _24.field, as = _24.as || ["text", "count"], add3 = process2((t5) => counts[t5] = 1 + (counts[t5] || 0)), rem2 = process2((t5) => counts[t5] -= 1);
if (init3) {
pulse2.visit(pulse2.SOURCE, add3);
} else {
pulse2.visit(pulse2.ADD, add3);
pulse2.visit(pulse2.REM, rem2);
}
return this._finish(pulse2, as);
},
_parameterCheck(_24, pulse2) {
let init3 = false;
if (_24.modified("stopwords") || !this._stop) {
this._stop = new RegExp("^" + (_24.stopwords || "") + "$", "i");
init3 = true;
}
if (_24.modified("pattern") || !this._match) {
this._match = new RegExp(_24.pattern || "[\\w']+", "g");
init3 = true;
}
if (_24.modified("field") || pulse2.modified(_24.field.fields)) {
init3 = true;
}
if (init3)
this._counts = {};
return init3;
},
_finish(pulse2, as) {
const counts = this._counts, tuples = this._tuples || (this._tuples = {}), text2 = as[0], count2 = as[1], out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
let w2, t5, c2;
for (w2 in counts) {
t5 = tuples[w2];
c2 = counts[w2] || 0;
if (!t5 && c2) {
tuples[w2] = t5 = ingest$1({});
t5[text2] = w2;
t5[count2] = c2;
out.add.push(t5);
} else if (c2 === 0) {
if (t5)
out.rem.push(t5);
counts[w2] = null;
tuples[w2] = null;
} else if (t5[count2] !== c2) {
t5[count2] = c2;
out.mod.push(t5);
}
}
return out.modifies(as);
}
});
function Cross(params2) {
Transform$1.call(this, null, params2);
}
Cross.Definition = {
"type": "Cross",
"metadata": {
"generates": true
},
"params": [{
"name": "filter",
"type": "expr"
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": ["a", "b"]
}]
};
inherits(Cross, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE), as = _24.as || ["a", "b"], a2 = as[0], b2 = as[1], reset2 = !this.value || pulse2.changed(pulse2.ADD_REM) || _24.modified("as") || _24.modified("filter");
let data2 = this.value;
if (reset2) {
if (data2)
out.rem = data2;
data2 = pulse2.materialize(pulse2.SOURCE).source;
out.add = this.value = cross(data2, a2, b2, _24.filter || truthy);
} else {
out.mod = data2;
}
out.source = this.value;
return out.modifies(as);
}
});
function cross(input, a2, b2, filter2) {
var data2 = [], t5 = {}, n2 = input.length, i2 = 0, j2, left2;
for (; i2 < n2; ++i2) {
t5[a2] = left2 = input[i2];
for (j2 = 0; j2 < n2; ++j2) {
t5[b2] = input[j2];
if (filter2(t5)) {
data2.push(ingest$1(t5));
t5 = {};
t5[a2] = left2;
}
}
}
return data2;
}
const Distributions = {
kde,
mixture: mixture$1,
normal: gaussian,
lognormal,
uniform
};
const DISTRIBUTIONS = "distributions", FUNCTION = "function", FIELD = "field";
function parse$5(def2, data2) {
const func = def2[FUNCTION];
if (!has$2(Distributions, func)) {
error2("Unknown distribution function: " + func);
}
const d2 = Distributions[func]();
for (const name in def2) {
if (name === FIELD) {
d2.data((def2.from || data2()).map(def2[name]));
} else if (name === DISTRIBUTIONS) {
d2[name](def2[name].map((_24) => parse$5(_24, data2)));
} else if (typeof d2[name] === FUNCTION) {
d2[name](def2[name]);
}
}
return d2;
}
function Density(params2) {
Transform$1.call(this, null, params2);
}
const distributions = [{
"key": {
"function": "normal"
},
"params": [{
"name": "mean",
"type": "number",
"default": 0
}, {
"name": "stdev",
"type": "number",
"default": 1
}]
}, {
"key": {
"function": "lognormal"
},
"params": [{
"name": "mean",
"type": "number",
"default": 0
}, {
"name": "stdev",
"type": "number",
"default": 1
}]
}, {
"key": {
"function": "uniform"
},
"params": [{
"name": "min",
"type": "number",
"default": 0
}, {
"name": "max",
"type": "number",
"default": 1
}]
}, {
"key": {
"function": "kde"
},
"params": [{
"name": "field",
"type": "field",
"required": true
}, {
"name": "from",
"type": "data"
}, {
"name": "bandwidth",
"type": "number",
"default": 0
}]
}];
const mixture = {
"key": {
"function": "mixture"
},
"params": [{
"name": "distributions",
"type": "param",
"array": true,
"params": distributions
}, {
"name": "weights",
"type": "number",
"array": true
}]
};
Density.Definition = {
"type": "Density",
"metadata": {
"generates": true
},
"params": [{
"name": "extent",
"type": "number",
"array": true,
"length": 2
}, {
"name": "steps",
"type": "number"
}, {
"name": "minsteps",
"type": "number",
"default": 25
}, {
"name": "maxsteps",
"type": "number",
"default": 200
}, {
"name": "method",
"type": "string",
"default": "pdf",
"values": ["pdf", "cdf"]
}, {
"name": "distribution",
"type": "param",
"params": distributions.concat(mixture)
}, {
"name": "as",
"type": "string",
"array": true,
"default": ["value", "density"]
}]
};
inherits(Density, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
if (!this.value || pulse2.changed() || _24.modified()) {
const dist2 = parse$5(_24.distribution, source$1(pulse2)), minsteps = _24.steps || _24.minsteps || 25, maxsteps = _24.steps || _24.maxsteps || 200;
let method = _24.method || "pdf";
if (method !== "pdf" && method !== "cdf") {
error2("Invalid density method: " + method);
}
if (!_24.extent && !dist2.data) {
error2("Missing density extent parameter.");
}
method = dist2[method];
const as = _24.as || ["value", "density"], domain2 = _24.extent || extent(dist2.data()), values2 = sampleCurve(method, domain2, minsteps, maxsteps).map((v2) => {
const tuple = {};
tuple[as[0]] = v2[0];
tuple[as[1]] = v2[1];
return ingest$1(tuple);
});
if (this.value)
out.rem = this.value;
this.value = out.add = out.source = values2;
}
return out;
}
});
function source$1(pulse2) {
return () => pulse2.materialize(pulse2.SOURCE).source;
}
function fieldNames(fields, as) {
if (!fields)
return null;
return fields.map((f2, i2) => as[i2] || accessorName(f2));
}
function partition$1$1(data2, groupby, field2) {
const groups = [], get2 = (f2) => f2(t5);
let map2, i2, n2, t5, k2, g2;
if (groupby == null) {
groups.push(data2.map(field2));
} else {
for (map2 = {}, i2 = 0, n2 = data2.length; i2 < n2; ++i2) {
t5 = data2[i2];
k2 = groupby.map(get2);
g2 = map2[k2];
if (!g2) {
map2[k2] = g2 = [];
g2.dims = k2;
groups.push(g2);
}
g2.push(field2(t5));
}
}
return groups;
}
const Output$5 = "bin";
function DotBin(params2) {
Transform$1.call(this, null, params2);
}
DotBin.Definition = {
"type": "DotBin",
"metadata": {
"modifies": true
},
"params": [{
"name": "field",
"type": "field",
"required": true
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "step",
"type": "number"
}, {
"name": "smooth",
"type": "boolean",
"default": false
}, {
"name": "as",
"type": "string",
"default": Output$5
}]
};
const autostep = (data2, field2) => span(extent(data2, field2)) / 30;
inherits(DotBin, Transform$1, {
transform(_24, pulse2) {
if (this.value && !(_24.modified() || pulse2.changed())) {
return pulse2;
}
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition$1$1(pulse2.source, _24.groupby, identity$6), smooth = _24.smooth || false, field2 = _24.field, step = _24.step || autostep(source2, field2), sort2 = stableCompare((a2, b2) => field2(a2) - field2(b2)), as = _24.as || Output$5, n2 = groups.length;
let min2 = Infinity, max2 = -Infinity, i2 = 0, j2;
for (; i2 < n2; ++i2) {
const g2 = groups[i2].sort(sort2);
j2 = -1;
for (const v2 of dotbin(g2, step, smooth, field2)) {
if (v2 < min2)
min2 = v2;
if (v2 > max2)
max2 = v2;
g2[++j2][as] = v2;
}
}
this.value = {
start: min2,
stop: max2,
step
};
return pulse2.reflow(true).modifies(as);
}
});
function Expression$1(params2) {
Operator.call(this, null, update$4, params2);
this.modified(true);
}
inherits(Expression$1, Operator);
function update$4(_24) {
const expr2 = _24.expr;
return this.value && !_24.modified("expr") ? this.value : accessor((datum2) => expr2(datum2, _24), accessorFields(expr2), accessorName(expr2));
}
function Extent(params2) {
Transform$1.call(this, [void 0, void 0], params2);
}
Extent.Definition = {
"type": "Extent",
"metadata": {},
"params": [{
"name": "field",
"type": "field",
"required": true
}]
};
inherits(Extent, Transform$1, {
transform(_24, pulse2) {
const extent2 = this.value, field2 = _24.field, mod = pulse2.changed() || pulse2.modified(field2.fields) || _24.modified("field");
let min2 = extent2[0], max2 = extent2[1];
if (mod || min2 == null) {
min2 = Infinity;
max2 = -Infinity;
}
pulse2.visit(mod ? pulse2.SOURCE : pulse2.ADD, (t5) => {
const v2 = toNumber2(field2(t5));
if (v2 != null) {
if (v2 < min2)
min2 = v2;
if (v2 > max2)
max2 = v2;
}
});
if (!Number.isFinite(min2) || !Number.isFinite(max2)) {
let name = accessorName(field2);
if (name)
name = ` for field "${name}"`;
pulse2.dataflow.warn(`Infinite extent${name}: [${min2}, ${max2}]`);
min2 = max2 = void 0;
}
this.value = [min2, max2];
}
});
function Subflow(pulse2, parent) {
Operator.call(this, pulse2);
this.parent = parent;
this.count = 0;
}
inherits(Subflow, Operator, {
/**
* Routes pulses from this subflow to a target transform.
* @param {Transform} target - A transform that receives the subflow of tuples.
*/
connect(target2) {
this.detachSubflow = target2.detachSubflow;
this.targets().add(target2);
return target2.source = this;
},
/**
* Add an 'add' tuple to the subflow pulse.
* @param {Tuple} t - The tuple being added.
*/
add(t5) {
this.count += 1;
this.value.add.push(t5);
},
/**
* Add a 'rem' tuple to the subflow pulse.
* @param {Tuple} t - The tuple being removed.
*/
rem(t5) {
this.count -= 1;
this.value.rem.push(t5);
},
/**
* Add a 'mod' tuple to the subflow pulse.
* @param {Tuple} t - The tuple being modified.
*/
mod(t5) {
this.value.mod.push(t5);
},
/**
* Re-initialize this operator's pulse value.
* @param {Pulse} pulse - The pulse to copy from.
* @see Pulse.init
*/
init(pulse2) {
this.value.init(pulse2, pulse2.NO_SOURCE);
},
/**
* Evaluate this operator. This method overrides the
* default behavior to simply return the contained pulse value.
* @return {Pulse}
*/
evaluate() {
return this.value;
}
});
function Facet$1(params2) {
Transform$1.call(this, {}, params2);
this._keys = fastmap();
const a2 = this._targets = [];
a2.active = 0;
a2.forEach = (f2) => {
for (let i2 = 0, n2 = a2.active; i2 < n2; ++i2) {
f2(a2[i2], i2, a2);
}
};
}
inherits(Facet$1, Transform$1, {
activate(flow) {
this._targets[this._targets.active++] = flow;
},
// parent argument provided by PreFacet subclass
subflow(key2, flow, pulse2, parent) {
const flows = this.value;
let sf2 = has$2(flows, key2) && flows[key2], df2, p2;
if (!sf2) {
p2 = parent || (p2 = this._group[key2]) && p2.tuple;
df2 = pulse2.dataflow;
sf2 = new Subflow(pulse2.fork(pulse2.NO_SOURCE), this);
df2.add(sf2).connect(flow(df2, key2, p2));
flows[key2] = sf2;
this.activate(sf2);
} else if (sf2.value.stamp < pulse2.stamp) {
sf2.init(pulse2);
this.activate(sf2);
}
return sf2;
},
clean() {
const flows = this.value;
let detached = 0;
for (const key2 in flows) {
if (flows[key2].count === 0) {
const detach = flows[key2].detachSubflow;
if (detach)
detach();
delete flows[key2];
++detached;
}
}
if (detached) {
const active = this._targets.filter((sf2) => sf2 && sf2.count > 0);
this.initTargets(active);
}
},
initTargets(act) {
const a2 = this._targets, n2 = a2.length, m2 = act ? act.length : 0;
let i2 = 0;
for (; i2 < m2; ++i2) {
a2[i2] = act[i2];
}
for (; i2 < n2 && a2[i2] != null; ++i2) {
a2[i2] = null;
}
a2.active = m2;
},
transform(_24, pulse2) {
const df2 = pulse2.dataflow, key2 = _24.key, flow = _24.subflow, cache2 = this._keys, rekey = _24.modified("key"), subflow = (key3) => this.subflow(key3, flow, pulse2);
this._group = _24.group || {};
this.initTargets();
pulse2.visit(pulse2.REM, (t5) => {
const id = tupleid(t5), k2 = cache2.get(id);
if (k2 !== void 0) {
cache2.delete(id);
subflow(k2).rem(t5);
}
});
pulse2.visit(pulse2.ADD, (t5) => {
const k2 = key2(t5);
cache2.set(tupleid(t5), k2);
subflow(k2).add(t5);
});
if (rekey || pulse2.modified(key2.fields)) {
pulse2.visit(pulse2.MOD, (t5) => {
const id = tupleid(t5), k0 = cache2.get(id), k1 = key2(t5);
if (k0 === k1) {
subflow(k1).mod(t5);
} else {
cache2.set(id, k1);
subflow(k0).rem(t5);
subflow(k1).add(t5);
}
});
} else if (pulse2.changed(pulse2.MOD)) {
pulse2.visit(pulse2.MOD, (t5) => {
subflow(cache2.get(tupleid(t5))).mod(t5);
});
}
if (rekey) {
pulse2.visit(pulse2.REFLOW, (t5) => {
const id = tupleid(t5), k0 = cache2.get(id), k1 = key2(t5);
if (k0 !== k1) {
cache2.set(id, k1);
subflow(k0).rem(t5);
subflow(k1).add(t5);
}
});
}
if (pulse2.clean()) {
df2.runAfter(() => {
this.clean();
cache2.clean();
});
} else if (cache2.empty > df2.cleanThreshold) {
df2.runAfter(cache2.clean);
}
return pulse2;
}
});
function Field$1(params2) {
Operator.call(this, null, update$3, params2);
}
inherits(Field$1, Operator);
function update$3(_24) {
return this.value && !_24.modified() ? this.value : isArray$2(_24.name) ? array$5(_24.name).map((f2) => field$1(f2)) : field$1(_24.name, _24.as);
}
function Filter(params2) {
Transform$1.call(this, fastmap(), params2);
}
Filter.Definition = {
"type": "Filter",
"metadata": {
"changes": true
},
"params": [{
"name": "expr",
"type": "expr",
"required": true
}]
};
inherits(Filter, Transform$1, {
transform(_24, pulse2) {
const df2 = pulse2.dataflow, cache2 = this.value, output3 = pulse2.fork(), add3 = output3.add, rem2 = output3.rem, mod = output3.mod, test2 = _24.expr;
let isMod = true;
pulse2.visit(pulse2.REM, (t5) => {
const id = tupleid(t5);
if (!cache2.has(id))
rem2.push(t5);
else
cache2.delete(id);
});
pulse2.visit(pulse2.ADD, (t5) => {
if (test2(t5, _24))
add3.push(t5);
else
cache2.set(tupleid(t5), 1);
});
function revisit(t5) {
const id = tupleid(t5), b2 = test2(t5, _24), s2 = cache2.get(id);
if (b2 && s2) {
cache2.delete(id);
add3.push(t5);
} else if (!b2 && !s2) {
cache2.set(id, 1);
rem2.push(t5);
} else if (isMod && b2 && !s2) {
mod.push(t5);
}
}
pulse2.visit(pulse2.MOD, revisit);
if (_24.modified()) {
isMod = false;
pulse2.visit(pulse2.REFLOW, revisit);
}
if (cache2.empty > df2.cleanThreshold)
df2.runAfter(cache2.clean);
return output3;
}
});
function Flatten(params2) {
Transform$1.call(this, [], params2);
}
Flatten.Definition = {
"type": "Flatten",
"metadata": {
"generates": true
},
"params": [{
"name": "fields",
"type": "field",
"array": true,
"required": true
}, {
"name": "index",
"type": "string"
}, {
"name": "as",
"type": "string",
"array": true
}]
};
inherits(Flatten, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE), fields = _24.fields, as = fieldNames(fields, _24.as || []), index2 = _24.index || null, m2 = as.length;
out.rem = this.value;
pulse2.visit(pulse2.SOURCE, (t5) => {
const arrays = fields.map((f2) => f2(t5)), maxlen = arrays.reduce((l2, a2) => Math.max(l2, a2.length), 0);
let i2 = 0, j2, d2, v2;
for (; i2 < maxlen; ++i2) {
d2 = derive(t5);
for (j2 = 0; j2 < m2; ++j2) {
d2[as[j2]] = (v2 = arrays[j2][i2]) == null ? null : v2;
}
if (index2) {
d2[index2] = i2;
}
out.add.push(d2);
}
});
this.value = out.source = out.add;
if (index2)
out.modifies(index2);
return out.modifies(as);
}
});
function Fold(params2) {
Transform$1.call(this, [], params2);
}
Fold.Definition = {
"type": "Fold",
"metadata": {
"generates": true
},
"params": [{
"name": "fields",
"type": "field",
"array": true,
"required": true
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": ["key", "value"]
}]
};
inherits(Fold, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE), fields = _24.fields, fnames = fields.map(accessorName), as = _24.as || ["key", "value"], k2 = as[0], v2 = as[1], n2 = fields.length;
out.rem = this.value;
pulse2.visit(pulse2.SOURCE, (t5) => {
for (let i2 = 0, d2; i2 < n2; ++i2) {
d2 = derive(t5);
d2[k2] = fnames[i2];
d2[v2] = fields[i2](t5);
out.add.push(d2);
}
});
this.value = out.source = out.add;
return out.modifies(as);
}
});
function Formula(params2) {
Transform$1.call(this, null, params2);
}
Formula.Definition = {
"type": "Formula",
"metadata": {
"modifies": true
},
"params": [{
"name": "expr",
"type": "expr",
"required": true
}, {
"name": "as",
"type": "string",
"required": true
}, {
"name": "initonly",
"type": "boolean"
}]
};
inherits(Formula, Transform$1, {
transform(_24, pulse2) {
const func = _24.expr, as = _24.as, mod = _24.modified(), flag2 = _24.initonly ? pulse2.ADD : mod ? pulse2.SOURCE : pulse2.modified(func.fields) || pulse2.modified(as) ? pulse2.ADD_MOD : pulse2.ADD;
if (mod) {
pulse2 = pulse2.materialize().reflow(true);
}
if (!_24.initonly) {
pulse2.modifies(as);
}
return pulse2.visit(flag2, (t5) => t5[as] = func(t5, _24));
}
});
function Generate(params2) {
Transform$1.call(this, [], params2);
}
inherits(Generate, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.ALL), gen = _24.generator;
let data2 = this.value, num = _24.size - data2.length, add3, rem2, t5;
if (num > 0) {
for (add3 = []; --num >= 0; ) {
add3.push(t5 = ingest$1(gen(_24)));
data2.push(t5);
}
out.add = out.add.length ? out.materialize(out.ADD).add.concat(add3) : add3;
} else {
rem2 = data2.slice(0, -num);
out.rem = out.rem.length ? out.materialize(out.REM).rem.concat(rem2) : rem2;
data2 = data2.slice(-num);
}
out.source = this.value = data2;
return out;
}
});
const Methods$1 = {
value: "value",
median,
mean,
min: min$8,
max: max$7
};
const Empty$1 = [];
function Impute(params2) {
Transform$1.call(this, [], params2);
}
Impute.Definition = {
"type": "Impute",
"metadata": {
"changes": true
},
"params": [{
"name": "field",
"type": "field",
"required": true
}, {
"name": "key",
"type": "field",
"required": true
}, {
"name": "keyvals",
"array": true
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "method",
"type": "enum",
"default": "value",
"values": ["value", "mean", "median", "max", "min"]
}, {
"name": "value",
"default": 0
}]
};
function getValue(_24) {
var m2 = _24.method || Methods$1.value, v2;
if (Methods$1[m2] == null) {
error2("Unrecognized imputation method: " + m2);
} else if (m2 === Methods$1.value) {
v2 = _24.value !== void 0 ? _24.value : 0;
return () => v2;
} else {
return Methods$1[m2];
}
}
function getField$1(_24) {
const f2 = _24.field;
return (t5) => t5 ? f2(t5) : NaN;
}
inherits(Impute, Transform$1, {
transform(_24, pulse2) {
var out = pulse2.fork(pulse2.ALL), impute = getValue(_24), field2 = getField$1(_24), fName = accessorName(_24.field), kName = accessorName(_24.key), gNames = (_24.groupby || []).map(accessorName), groups = partition$4(pulse2.source, _24.groupby, _24.key, _24.keyvals), curr = [], prev2 = this.value, m2 = groups.domain.length, group2, value2, gVals, kVal, g2, i2, j2, l2, n2, t5;
for (g2 = 0, l2 = groups.length; g2 < l2; ++g2) {
group2 = groups[g2];
gVals = group2.values;
value2 = NaN;
for (j2 = 0; j2 < m2; ++j2) {
if (group2[j2] != null)
continue;
kVal = groups.domain[j2];
t5 = {
_impute: true
};
for (i2 = 0, n2 = gVals.length; i2 < n2; ++i2)
t5[gNames[i2]] = gVals[i2];
t5[kName] = kVal;
t5[fName] = Number.isNaN(value2) ? value2 = impute(group2, field2) : value2;
curr.push(ingest$1(t5));
}
}
if (curr.length)
out.add = out.materialize(out.ADD).add.concat(curr);
if (prev2.length)
out.rem = out.materialize(out.REM).rem.concat(prev2);
this.value = curr;
return out;
}
});
function partition$4(data2, groupby, key2, keyvals) {
var get2 = (f2) => f2(t5), groups = [], domain2 = keyvals ? keyvals.slice() : [], kMap = {}, gMap = {}, gVals, gKey, group2, i2, j2, k2, n2, t5;
domain2.forEach((k3, i3) => kMap[k3] = i3 + 1);
for (i2 = 0, n2 = data2.length; i2 < n2; ++i2) {
t5 = data2[i2];
k2 = key2(t5);
j2 = kMap[k2] || (kMap[k2] = domain2.push(k2));
gKey = (gVals = groupby ? groupby.map(get2) : Empty$1) + "";
if (!(group2 = gMap[gKey])) {
group2 = gMap[gKey] = [];
groups.push(group2);
group2.values = gVals;
}
group2[j2 - 1] = t5;
}
groups.domain = domain2;
return groups;
}
function JoinAggregate(params2) {
Aggregate$1.call(this, params2);
}
JoinAggregate.Definition = {
"type": "JoinAggregate",
"metadata": {
"modifies": true
},
"params": [{
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "fields",
"type": "field",
"null": true,
"array": true
}, {
"name": "ops",
"type": "enum",
"array": true,
"values": ValidAggregateOps
}, {
"name": "as",
"type": "string",
"null": true,
"array": true
}, {
"name": "key",
"type": "field"
}]
};
inherits(JoinAggregate, Aggregate$1, {
transform(_24, pulse2) {
const aggr = this, mod = _24.modified();
let cells;
if (aggr.value && (mod || pulse2.modified(aggr._inputs, true))) {
cells = aggr.value = mod ? aggr.init(_24) : {};
pulse2.visit(pulse2.SOURCE, (t5) => aggr.add(t5));
} else {
cells = aggr.value = aggr.value || this.init(_24);
pulse2.visit(pulse2.REM, (t5) => aggr.rem(t5));
pulse2.visit(pulse2.ADD, (t5) => aggr.add(t5));
}
aggr.changes();
pulse2.visit(pulse2.SOURCE, (t5) => {
extend$2(t5, cells[aggr.cellkey(t5)].tuple);
});
return pulse2.reflow(mod).modifies(this._outputs);
},
changes() {
const adds = this._adds, mods = this._mods;
let i2, n2;
for (i2 = 0, n2 = this._alen; i2 < n2; ++i2) {
this.celltuple(adds[i2]);
adds[i2] = null;
}
for (i2 = 0, n2 = this._mlen; i2 < n2; ++i2) {
this.celltuple(mods[i2]);
mods[i2] = null;
}
this._alen = this._mlen = 0;
}
});
function KDE(params2) {
Transform$1.call(this, null, params2);
}
KDE.Definition = {
"type": "KDE",
"metadata": {
"generates": true
},
"params": [{
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "field",
"type": "field",
"required": true
}, {
"name": "cumulative",
"type": "boolean",
"default": false
}, {
"name": "counts",
"type": "boolean",
"default": false
}, {
"name": "bandwidth",
"type": "number",
"default": 0
}, {
"name": "extent",
"type": "number",
"array": true,
"length": 2
}, {
"name": "resolve",
"type": "enum",
"values": ["shared", "independent"],
"default": "independent"
}, {
"name": "steps",
"type": "number"
}, {
"name": "minsteps",
"type": "number",
"default": 25
}, {
"name": "maxsteps",
"type": "number",
"default": 200
}, {
"name": "as",
"type": "string",
"array": true,
"default": ["value", "density"]
}]
};
inherits(KDE, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
if (!this.value || pulse2.changed() || _24.modified()) {
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition$1$1(source2, _24.groupby, _24.field), names = (_24.groupby || []).map(accessorName), bandwidth2 = _24.bandwidth, method = _24.cumulative ? "cdf" : "pdf", as = _24.as || ["value", "density"], values2 = [];
let domain2 = _24.extent, minsteps = _24.steps || _24.minsteps || 25, maxsteps = _24.steps || _24.maxsteps || 200;
if (method !== "pdf" && method !== "cdf") {
error2("Invalid density method: " + method);
}
if (_24.resolve === "shared") {
if (!domain2)
domain2 = extent(source2, _24.field);
minsteps = maxsteps = _24.steps || maxsteps;
}
groups.forEach((g2) => {
const density = kde(g2, bandwidth2)[method], scale2 = _24.counts ? g2.length : 1, local = domain2 || extent(g2);
sampleCurve(density, local, minsteps, maxsteps).forEach((v2) => {
const t5 = {};
for (let i2 = 0; i2 < names.length; ++i2) {
t5[names[i2]] = g2.dims[i2];
}
t5[as[0]] = v2[0];
t5[as[1]] = v2[1] * scale2;
values2.push(ingest$1(t5));
});
});
if (this.value)
out.rem = this.value;
this.value = out.add = out.source = values2;
}
return out;
}
});
function Key$1(params2) {
Operator.call(this, null, update$2, params2);
}
inherits(Key$1, Operator);
function update$2(_24) {
return this.value && !_24.modified() ? this.value : key(_24.fields, _24.flat);
}
function Load$1(params2) {
Transform$1.call(this, [], params2);
this._pending = null;
}
inherits(Load$1, Transform$1, {
transform(_24, pulse2) {
const df2 = pulse2.dataflow;
if (this._pending) {
return output2(this, pulse2, this._pending);
}
if (stop(_24))
return pulse2.StopPropagation;
if (_24.values) {
return output2(this, pulse2, df2.parse(_24.values, _24.format));
} else if (_24.async) {
const p2 = df2.request(_24.url, _24.format).then((res) => {
this._pending = array$5(res.data);
return (df3) => df3.touch(this);
});
return {
async: p2
};
} else {
return df2.request(_24.url, _24.format).then((res) => output2(this, pulse2, array$5(res.data)));
}
}
});
function stop(_24) {
return _24.modified("async") && !(_24.modified("values") || _24.modified("url") || _24.modified("format"));
}
function output2(op, pulse2, data2) {
data2.forEach(ingest$1);
const out = pulse2.fork(pulse2.NO_FIELDS & pulse2.NO_SOURCE);
out.rem = op.value;
op.value = out.source = out.add = data2;
op._pending = null;
if (out.rem.length)
out.clean(true);
return out;
}
function Lookup(params2) {
Transform$1.call(this, {}, params2);
}
Lookup.Definition = {
"type": "Lookup",
"metadata": {
"modifies": true
},
"params": [{
"name": "index",
"type": "index",
"params": [{
"name": "from",
"type": "data",
"required": true
}, {
"name": "key",
"type": "field",
"required": true
}]
}, {
"name": "values",
"type": "field",
"array": true
}, {
"name": "fields",
"type": "field",
"array": true,
"required": true
}, {
"name": "as",
"type": "string",
"array": true
}, {
"name": "default",
"default": null
}]
};
inherits(Lookup, Transform$1, {
transform(_24, pulse2) {
const keys3 = _24.fields, index2 = _24.index, values2 = _24.values, defaultValue2 = _24.default == null ? null : _24.default, reset2 = _24.modified(), n2 = keys3.length;
let flag2 = reset2 ? pulse2.SOURCE : pulse2.ADD, out = pulse2, as = _24.as, set2, m2, mods;
if (values2) {
m2 = values2.length;
if (n2 > 1 && !as) {
error2('Multi-field lookup requires explicit "as" parameter.');
}
if (as && as.length !== n2 * m2) {
error2('The "as" parameter has too few output field names.');
}
as = as || values2.map(accessorName);
set2 = function(t5) {
for (var i2 = 0, k2 = 0, j2, v2; i2 < n2; ++i2) {
v2 = index2.get(keys3[i2](t5));
if (v2 == null)
for (j2 = 0; j2 < m2; ++j2, ++k2)
t5[as[k2]] = defaultValue2;
else
for (j2 = 0; j2 < m2; ++j2, ++k2)
t5[as[k2]] = values2[j2](v2);
}
};
} else {
if (!as) {
error2("Missing output field names.");
}
set2 = function(t5) {
for (var i2 = 0, v2; i2 < n2; ++i2) {
v2 = index2.get(keys3[i2](t5));
t5[as[i2]] = v2 == null ? defaultValue2 : v2;
}
};
}
if (reset2) {
out = pulse2.reflow(true);
} else {
mods = keys3.some((k2) => pulse2.modified(k2.fields));
flag2 |= mods ? pulse2.MOD : 0;
}
pulse2.visit(flag2, set2);
return out.modifies(as);
}
});
function MultiExtent$1(params2) {
Operator.call(this, null, update$1, params2);
}
inherits(MultiExtent$1, Operator);
function update$1(_24) {
if (this.value && !_24.modified()) {
return this.value;
}
const ext = _24.extents, n2 = ext.length;
let min2 = Infinity, max2 = -Infinity, i2, e7;
for (i2 = 0; i2 < n2; ++i2) {
e7 = ext[i2];
if (e7[0] < min2)
min2 = e7[0];
if (e7[1] > max2)
max2 = e7[1];
}
return [min2, max2];
}
function MultiValues$1(params2) {
Operator.call(this, null, update, params2);
}
inherits(MultiValues$1, Operator);
function update(_24) {
return this.value && !_24.modified() ? this.value : _24.values.reduce((data2, _25) => data2.concat(_25), []);
}
function Params$2(params2) {
Transform$1.call(this, null, params2);
}
inherits(Params$2, Transform$1, {
transform(_24, pulse2) {
this.modified(_24.modified());
this.value = _24;
return pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
}
});
function Pivot(params2) {
Aggregate$1.call(this, params2);
}
Pivot.Definition = {
"type": "Pivot",
"metadata": {
"generates": true,
"changes": true
},
"params": [{
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "field",
"type": "field",
"required": true
}, {
"name": "value",
"type": "field",
"required": true
}, {
"name": "op",
"type": "enum",
"values": ValidAggregateOps,
"default": "sum"
}, {
"name": "limit",
"type": "number",
"default": 0
}, {
"name": "key",
"type": "field"
}]
};
inherits(Pivot, Aggregate$1, {
_transform: Aggregate$1.prototype.transform,
transform(_24, pulse2) {
return this._transform(aggregateParams(_24, pulse2), pulse2);
}
});
function aggregateParams(_24, pulse2) {
const key2 = _24.field, value2 = _24.value, op = (_24.op === "count" ? "__count__" : _24.op) || "sum", fields = accessorFields(key2).concat(accessorFields(value2)), keys3 = pivotKeys(key2, _24.limit || 0, pulse2);
if (pulse2.changed())
_24.set("__pivot__", null, null, true);
return {
key: _24.key,
groupby: _24.groupby,
ops: keys3.map(() => op),
fields: keys3.map((k2) => get$5(k2, key2, value2, fields)),
as: keys3.map((k2) => k2 + ""),
modified: _24.modified.bind(_24)
};
}
function get$5(k2, key2, value2, fields) {
return accessor((d2) => key2(d2) === k2 ? value2(d2) : NaN, fields, k2 + "");
}
function pivotKeys(key2, limit2, pulse2) {
const map2 = {}, list = [];
pulse2.visit(pulse2.SOURCE, (t5) => {
const k2 = key2(t5);
if (!map2[k2]) {
map2[k2] = 1;
list.push(k2);
}
});
list.sort(ascending$8);
return limit2 ? list.slice(0, limit2) : list;
}
function PreFacet$1(params2) {
Facet$1.call(this, params2);
}
inherits(PreFacet$1, Facet$1, {
transform(_24, pulse2) {
const flow = _24.subflow, field2 = _24.field, subflow = (t5) => this.subflow(tupleid(t5), flow, pulse2, t5);
if (_24.modified("field") || field2 && pulse2.modified(accessorFields(field2))) {
error2("PreFacet does not support field modification.");
}
this.initTargets();
if (field2) {
pulse2.visit(pulse2.MOD, (t5) => {
const sf2 = subflow(t5);
field2(t5).forEach((_25) => sf2.mod(_25));
});
pulse2.visit(pulse2.ADD, (t5) => {
const sf2 = subflow(t5);
field2(t5).forEach((_25) => sf2.add(ingest$1(_25)));
});
pulse2.visit(pulse2.REM, (t5) => {
const sf2 = subflow(t5);
field2(t5).forEach((_25) => sf2.rem(_25));
});
} else {
pulse2.visit(pulse2.MOD, (t5) => subflow(t5).mod(t5));
pulse2.visit(pulse2.ADD, (t5) => subflow(t5).add(t5));
pulse2.visit(pulse2.REM, (t5) => subflow(t5).rem(t5));
}
if (pulse2.clean()) {
pulse2.runAfter(() => this.clean());
}
return pulse2;
}
});
function Project(params2) {
Transform$1.call(this, null, params2);
}
Project.Definition = {
"type": "Project",
"metadata": {
"generates": true,
"changes": true
},
"params": [{
"name": "fields",
"type": "field",
"array": true
}, {
"name": "as",
"type": "string",
"null": true,
"array": true
}]
};
inherits(Project, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE), fields = _24.fields, as = fieldNames(_24.fields, _24.as || []), derive2 = fields ? (s2, t5) => project(s2, t5, fields, as) : rederive;
let lut;
if (this.value) {
lut = this.value;
} else {
pulse2 = pulse2.addAll();
lut = this.value = {};
}
pulse2.visit(pulse2.REM, (t5) => {
const id = tupleid(t5);
out.rem.push(lut[id]);
lut[id] = null;
});
pulse2.visit(pulse2.ADD, (t5) => {
const dt2 = derive2(t5, ingest$1({}));
lut[tupleid(t5)] = dt2;
out.add.push(dt2);
});
pulse2.visit(pulse2.MOD, (t5) => {
out.mod.push(derive2(t5, lut[tupleid(t5)]));
});
return out;
}
});
function project(s2, t5, fields, as) {
for (let i2 = 0, n2 = fields.length; i2 < n2; ++i2) {
t5[as[i2]] = fields[i2](s2);
}
return t5;
}
function Proxy$2(params2) {
Transform$1.call(this, null, params2);
}
inherits(Proxy$2, Transform$1, {
transform(_24, pulse2) {
this.value = _24.value;
return _24.modified("value") ? pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS) : pulse2.StopPropagation;
}
});
function Quantile$1(params2) {
Transform$1.call(this, null, params2);
}
Quantile$1.Definition = {
"type": "Quantile",
"metadata": {
"generates": true,
"changes": true
},
"params": [{
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "field",
"type": "field",
"required": true
}, {
"name": "probs",
"type": "number",
"array": true
}, {
"name": "step",
"type": "number",
"default": 0.01
}, {
"name": "as",
"type": "string",
"array": true,
"default": ["prob", "value"]
}]
};
const EPSILON$2 = 1e-14;
inherits(Quantile$1, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), as = _24.as || ["prob", "value"];
if (this.value && !_24.modified() && !pulse2.changed()) {
out.source = this.value;
return out;
}
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition$1$1(source2, _24.groupby, _24.field), names = (_24.groupby || []).map(accessorName), values2 = [], step = _24.step || 0.01, p2 = _24.probs || range$7(step / 2, 1 - EPSILON$2, step), n2 = p2.length;
groups.forEach((g2) => {
const q2 = quantiles(g2, p2);
for (let i2 = 0; i2 < n2; ++i2) {
const t5 = {};
for (let i3 = 0; i3 < names.length; ++i3) {
t5[names[i3]] = g2.dims[i3];
}
t5[as[0]] = p2[i2];
t5[as[1]] = q2[i2];
values2.push(ingest$1(t5));
}
});
if (this.value)
out.rem = this.value;
this.value = out.add = out.source = values2;
return out;
}
});
function Relay$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(Relay$1, Transform$1, {
transform(_24, pulse2) {
let out, lut;
if (this.value) {
lut = this.value;
} else {
out = pulse2 = pulse2.addAll();
lut = this.value = {};
}
if (_24.derive) {
out = pulse2.fork(pulse2.NO_SOURCE);
pulse2.visit(pulse2.REM, (t5) => {
const id = tupleid(t5);
out.rem.push(lut[id]);
lut[id] = null;
});
pulse2.visit(pulse2.ADD, (t5) => {
const dt2 = derive(t5);
lut[tupleid(t5)] = dt2;
out.add.push(dt2);
});
pulse2.visit(pulse2.MOD, (t5) => {
const dt2 = lut[tupleid(t5)];
for (const k2 in t5) {
dt2[k2] = t5[k2];
out.modifies(k2);
}
out.mod.push(dt2);
});
}
return out;
}
});
function Sample(params2) {
Transform$1.call(this, [], params2);
this.count = 0;
}
Sample.Definition = {
"type": "Sample",
"metadata": {},
"params": [{
"name": "size",
"type": "number",
"default": 1e3
}]
};
inherits(Sample, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE), mod = _24.modified("size"), num = _24.size, map2 = this.value.reduce((m2, t5) => (m2[tupleid(t5)] = 1, m2), {});
let res = this.value, cnt = this.count, cap = 0;
function update2(t5) {
let p2, idx;
if (res.length < num) {
res.push(t5);
} else {
idx = ~~((cnt + 1) * random());
if (idx < res.length && idx >= cap) {
p2 = res[idx];
if (map2[tupleid(p2)])
out.rem.push(p2);
res[idx] = t5;
}
}
++cnt;
}
if (pulse2.rem.length) {
pulse2.visit(pulse2.REM, (t5) => {
const id = tupleid(t5);
if (map2[id]) {
map2[id] = -1;
out.rem.push(t5);
}
--cnt;
});
res = res.filter((t5) => map2[tupleid(t5)] !== -1);
}
if ((pulse2.rem.length || mod) && res.length < num && pulse2.source) {
cap = cnt = res.length;
pulse2.visit(pulse2.SOURCE, (t5) => {
if (!map2[tupleid(t5)])
update2(t5);
});
cap = -1;
}
if (mod && res.length > num) {
const n2 = res.length - num;
for (let i2 = 0; i2 < n2; ++i2) {
map2[tupleid(res[i2])] = -1;
out.rem.push(res[i2]);
}
res = res.slice(n2);
}
if (pulse2.mod.length) {
pulse2.visit(pulse2.MOD, (t5) => {
if (map2[tupleid(t5)])
out.mod.push(t5);
});
}
if (pulse2.add.length) {
pulse2.visit(pulse2.ADD, update2);
}
if (pulse2.add.length || cap < 0) {
out.add = res.filter((t5) => !map2[tupleid(t5)]);
}
this.count = cnt;
this.value = out.source = res;
return out;
}
});
function Sequence(params2) {
Transform$1.call(this, null, params2);
}
Sequence.Definition = {
"type": "Sequence",
"metadata": {
"generates": true,
"changes": true
},
"params": [{
"name": "start",
"type": "number",
"required": true
}, {
"name": "stop",
"type": "number",
"required": true
}, {
"name": "step",
"type": "number",
"default": 1
}, {
"name": "as",
"type": "string",
"default": "data"
}]
};
inherits(Sequence, Transform$1, {
transform(_24, pulse2) {
if (this.value && !_24.modified())
return;
const out = pulse2.materialize().fork(pulse2.MOD), as = _24.as || "data";
out.rem = this.value ? pulse2.rem.concat(this.value) : pulse2.rem;
this.value = range$7(_24.start, _24.stop, _24.step || 1).map((v2) => {
const t5 = {};
t5[as] = v2;
return ingest$1(t5);
});
out.add = pulse2.add.concat(this.value);
return out;
}
});
function Sieve$1(params2) {
Transform$1.call(this, null, params2);
this.modified(true);
}
inherits(Sieve$1, Transform$1, {
transform(_24, pulse2) {
this.value = pulse2.source;
return pulse2.changed() ? pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS) : pulse2.StopPropagation;
}
});
function TimeUnit(params2) {
Transform$1.call(this, null, params2);
}
const OUTPUT = ["unit0", "unit1"];
TimeUnit.Definition = {
"type": "TimeUnit",
"metadata": {
"modifies": true
},
"params": [{
"name": "field",
"type": "field",
"required": true
}, {
"name": "interval",
"type": "boolean",
"default": true
}, {
"name": "units",
"type": "enum",
"values": TIME_UNITS,
"array": true
}, {
"name": "step",
"type": "number",
"default": 1
}, {
"name": "maxbins",
"type": "number",
"default": 40
}, {
"name": "extent",
"type": "date",
"array": true
}, {
"name": "timezone",
"type": "enum",
"default": "local",
"values": ["local", "utc"]
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": OUTPUT
}]
};
inherits(TimeUnit, Transform$1, {
transform(_24, pulse2) {
const field2 = _24.field, band2 = _24.interval !== false, utc = _24.timezone === "utc", floor2 = this._floor(_24, pulse2), offset2 = (utc ? utcInterval : timeInterval)(floor2.unit).offset, as = _24.as || OUTPUT, u0 = as[0], u1 = as[1], step = floor2.step;
let min2 = floor2.start || Infinity, max2 = floor2.stop || -Infinity, flag2 = pulse2.ADD;
if (_24.modified() || pulse2.changed(pulse2.REM) || pulse2.modified(accessorFields(field2))) {
pulse2 = pulse2.reflow(true);
flag2 = pulse2.SOURCE;
min2 = Infinity;
max2 = -Infinity;
}
pulse2.visit(flag2, (t5) => {
const v2 = field2(t5);
let a2, b2;
if (v2 == null) {
t5[u0] = null;
if (band2)
t5[u1] = null;
} else {
t5[u0] = a2 = b2 = floor2(v2);
if (band2)
t5[u1] = b2 = offset2(a2, step);
if (a2 < min2)
min2 = a2;
if (b2 > max2)
max2 = b2;
}
});
floor2.start = min2;
floor2.stop = max2;
return pulse2.modifies(band2 ? as : u0);
},
_floor(_24, pulse2) {
const utc = _24.timezone === "utc";
const {
units,
step
} = _24.units ? {
units: _24.units,
step: _24.step || 1
} : bin$1({
extent: _24.extent || extent(pulse2.materialize(pulse2.SOURCE).source, _24.field),
maxbins: _24.maxbins
});
const tunits = timeUnits(units), prev2 = this.value || {}, floor2 = (utc ? utcFloor : timeFloor)(tunits, step);
floor2.unit = peek$1(tunits);
floor2.units = tunits;
floor2.step = step;
floor2.start = prev2.start;
floor2.stop = prev2.stop;
return this.value = floor2;
}
});
function TupleIndex(params2) {
Transform$1.call(this, fastmap(), params2);
}
inherits(TupleIndex, Transform$1, {
transform(_24, pulse2) {
const df2 = pulse2.dataflow, field2 = _24.field, index2 = this.value, set2 = (t5) => index2.set(field2(t5), t5);
let mod = true;
if (_24.modified("field") || pulse2.modified(field2.fields)) {
index2.clear();
pulse2.visit(pulse2.SOURCE, set2);
} else if (pulse2.changed()) {
pulse2.visit(pulse2.REM, (t5) => index2.delete(field2(t5)));
pulse2.visit(pulse2.ADD, set2);
} else {
mod = false;
}
this.modified(mod);
if (index2.empty > df2.cleanThreshold)
df2.runAfter(index2.clean);
return pulse2.fork();
}
});
function Values$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(Values$1, Transform$1, {
transform(_24, pulse2) {
const run2 = !this.value || _24.modified("field") || _24.modified("sort") || pulse2.changed() || _24.sort && pulse2.modified(_24.sort.fields);
if (run2) {
this.value = (_24.sort ? pulse2.source.slice().sort(stableCompare(_24.sort)) : pulse2.source).map(_24.field);
}
}
});
function WindowOp(op, field2, param2, as) {
const fn8 = WindowOps[op](field2, param2);
return {
init: fn8.init || zero$7,
update: function(w2, t5) {
t5[as] = fn8.next(w2);
}
};
}
const WindowOps = {
row_number: function() {
return {
next: (w2) => w2.index + 1
};
},
rank: function() {
let rank2;
return {
init: () => rank2 = 1,
next: (w2) => {
const i2 = w2.index, data2 = w2.data;
return i2 && w2.compare(data2[i2 - 1], data2[i2]) ? rank2 = i2 + 1 : rank2;
}
};
},
dense_rank: function() {
let drank;
return {
init: () => drank = 1,
next: (w2) => {
const i2 = w2.index, d2 = w2.data;
return i2 && w2.compare(d2[i2 - 1], d2[i2]) ? ++drank : drank;
}
};
},
percent_rank: function() {
const rank2 = WindowOps.rank(), next2 = rank2.next;
return {
init: rank2.init,
next: (w2) => (next2(w2) - 1) / (w2.data.length - 1)
};
},
cume_dist: function() {
let cume;
return {
init: () => cume = 0,
next: (w2) => {
const d2 = w2.data, c2 = w2.compare;
let i2 = w2.index;
if (cume < i2) {
while (i2 + 1 < d2.length && !c2(d2[i2], d2[i2 + 1]))
++i2;
cume = i2;
}
return (1 + cume) / d2.length;
}
};
},
ntile: function(field2, num) {
num = +num;
if (!(num > 0))
error2("ntile num must be greater than zero.");
const cume = WindowOps.cume_dist(), next2 = cume.next;
return {
init: cume.init,
next: (w2) => Math.ceil(num * next2(w2))
};
},
lag: function(field2, offset2) {
offset2 = +offset2 || 1;
return {
next: (w2) => {
const i2 = w2.index - offset2;
return i2 >= 0 ? field2(w2.data[i2]) : null;
}
};
},
lead: function(field2, offset2) {
offset2 = +offset2 || 1;
return {
next: (w2) => {
const i2 = w2.index + offset2, d2 = w2.data;
return i2 < d2.length ? field2(d2[i2]) : null;
}
};
},
first_value: function(field2) {
return {
next: (w2) => field2(w2.data[w2.i0])
};
},
last_value: function(field2) {
return {
next: (w2) => field2(w2.data[w2.i1 - 1])
};
},
nth_value: function(field2, nth) {
nth = +nth;
if (!(nth > 0))
error2("nth_value nth must be greater than zero.");
return {
next: (w2) => {
const i2 = w2.i0 + (nth - 1);
return i2 < w2.i1 ? field2(w2.data[i2]) : null;
}
};
},
prev_value: function(field2) {
let prev2;
return {
init: () => prev2 = null,
next: (w2) => {
const v2 = field2(w2.data[w2.index]);
return v2 != null ? prev2 = v2 : prev2;
}
};
},
next_value: function(field2) {
let v2, i2;
return {
init: () => (v2 = null, i2 = -1),
next: (w2) => {
const d2 = w2.data;
return w2.index <= i2 ? v2 : (i2 = find$2(field2, d2, w2.index)) < 0 ? (i2 = d2.length, v2 = null) : v2 = field2(d2[i2]);
}
};
}
};
function find$2(field2, data2, index2) {
for (let n2 = data2.length; index2 < n2; ++index2) {
const v2 = field2(data2[index2]);
if (v2 != null)
return index2;
}
return -1;
}
const ValidWindowOps = Object.keys(WindowOps);
function WindowState(_24) {
const ops2 = array$5(_24.ops), fields = array$5(_24.fields), params2 = array$5(_24.params), aggregate_params = array$5(_24.aggregate_params), as = array$5(_24.as), outputs = this.outputs = [], windows = this.windows = [], inputs = {}, map2 = {}, counts = [], measures = [];
let countOnly = true;
function visitInputs(f2) {
array$5(accessorFields(f2)).forEach((_25) => inputs[_25] = 1);
}
visitInputs(_24.sort);
ops2.forEach((op, i2) => {
const field2 = fields[i2], param2 = params2[i2], aggregate_param = aggregate_params[i2] || null, mname = accessorName(field2), name = measureName(op, mname, as[i2]);
visitInputs(field2);
outputs.push(name);
if (has$2(WindowOps, op)) {
windows.push(WindowOp(op, field2, param2, name));
} else {
if (field2 == null && op !== "count") {
error2("Null aggregate field specified.");
}
if (op === "count") {
counts.push(name);
return;
}
countOnly = false;
let m2 = map2[mname];
if (!m2) {
m2 = map2[mname] = [];
m2.field = field2;
measures.push(m2);
}
m2.push(createMeasure(op, aggregate_param, name));
}
});
if (counts.length || measures.length) {
this.cell = cell(measures, counts, countOnly);
}
this.inputs = Object.keys(inputs);
}
const prototype = WindowState.prototype;
prototype.init = function() {
this.windows.forEach((_24) => _24.init());
if (this.cell)
this.cell.init();
};
prototype.update = function(w2, t5) {
const cell2 = this.cell, wind = this.windows, data2 = w2.data, m2 = wind && wind.length;
let j2;
if (cell2) {
for (j2 = w2.p0; j2 < w2.i0; ++j2)
cell2.rem(data2[j2]);
for (j2 = w2.p1; j2 < w2.i1; ++j2)
cell2.add(data2[j2]);
cell2.set(t5);
}
for (j2 = 0; j2 < m2; ++j2)
wind[j2].update(w2, t5);
};
function cell(measures, counts, countOnly) {
measures = measures.map((m2) => compileMeasures(m2, m2.field));
const cell2 = {
num: 0,
agg: null,
store: false,
count: counts
};
if (!countOnly) {
var n2 = measures.length, a2 = cell2.agg = Array(n2), i2 = 0;
for (; i2 < n2; ++i2)
a2[i2] = new measures[i2](cell2);
}
if (cell2.store) {
var store = cell2.data = new TupleStore();
}
cell2.add = function(t5) {
cell2.num += 1;
if (countOnly)
return;
if (store)
store.add(t5);
for (let i3 = 0; i3 < n2; ++i3) {
a2[i3].add(a2[i3].get(t5), t5);
}
};
cell2.rem = function(t5) {
cell2.num -= 1;
if (countOnly)
return;
if (store)
store.rem(t5);
for (let i3 = 0; i3 < n2; ++i3) {
a2[i3].rem(a2[i3].get(t5), t5);
}
};
cell2.set = function(t5) {
let i3, n3;
if (store)
store.values();
for (i3 = 0, n3 = counts.length; i3 < n3; ++i3)
t5[counts[i3]] = cell2.num;
if (!countOnly)
for (i3 = 0, n3 = a2.length; i3 < n3; ++i3)
a2[i3].set(t5);
};
cell2.init = function() {
cell2.num = 0;
if (store)
store.reset();
for (let i3 = 0; i3 < n2; ++i3)
a2[i3].init();
};
return cell2;
}
function Window(params2) {
Transform$1.call(this, {}, params2);
this._mlen = 0;
this._mods = [];
}
Window.Definition = {
"type": "Window",
"metadata": {
"modifies": true
},
"params": [{
"name": "sort",
"type": "compare"
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "ops",
"type": "enum",
"array": true,
"values": ValidWindowOps.concat(ValidAggregateOps)
}, {
"name": "params",
"type": "number",
"null": true,
"array": true
}, {
"name": "aggregate_params",
"type": "field",
"null": true,
"array": true,
"default": [null]
}, {
"name": "fields",
"type": "field",
"null": true,
"array": true
}, {
"name": "as",
"type": "string",
"null": true,
"array": true
}, {
"name": "frame",
"type": "number",
"null": true,
"array": true,
"length": 2,
"default": [null, 0]
}, {
"name": "ignorePeers",
"type": "boolean",
"default": false
}]
};
inherits(Window, Transform$1, {
transform(_24, pulse2) {
this.stamp = pulse2.stamp;
const mod = _24.modified(), cmp = stableCompare(_24.sort), key2 = groupkey(_24.groupby), group2 = (t5) => this.group(key2(t5));
let state = this.state;
if (!state || mod) {
state = this.state = new WindowState(_24);
}
if (mod || pulse2.modified(state.inputs)) {
this.value = {};
pulse2.visit(pulse2.SOURCE, (t5) => group2(t5).add(t5));
} else {
pulse2.visit(pulse2.REM, (t5) => group2(t5).remove(t5));
pulse2.visit(pulse2.ADD, (t5) => group2(t5).add(t5));
}
for (let i2 = 0, n2 = this._mlen; i2 < n2; ++i2) {
processPartition(this._mods[i2], state, cmp, _24);
}
this._mlen = 0;
this._mods = [];
return pulse2.reflow(mod).modifies(state.outputs);
},
group(key2) {
let group2 = this.value[key2];
if (!group2) {
group2 = this.value[key2] = SortedList(tupleid);
group2.stamp = -1;
}
if (group2.stamp < this.stamp) {
group2.stamp = this.stamp;
this._mods[this._mlen++] = group2;
}
return group2;
}
});
function processPartition(list, state, cmp, _24) {
const sort2 = _24.sort, range2 = sort2 && !_24.ignorePeers, frame2 = _24.frame || [null, 0], data2 = list.data(cmp), n2 = data2.length, b2 = range2 ? bisector$3(sort2) : null, w2 = {
i0: 0,
i1: 0,
p0: 0,
p1: 0,
index: 0,
data: data2,
compare: sort2 || constant$6(-1)
};
state.init();
for (let i2 = 0; i2 < n2; ++i2) {
setWindow(w2, frame2, i2, n2);
if (range2)
adjustRange(w2, b2);
state.update(w2, data2[i2]);
}
}
function setWindow(w2, f2, i2, n2) {
w2.p0 = w2.i0;
w2.p1 = w2.i1;
w2.i0 = f2[0] == null ? 0 : Math.max(0, i2 - Math.abs(f2[0]));
w2.i1 = f2[1] == null ? n2 : Math.min(n2, i2 + Math.abs(f2[1]) + 1);
w2.index = i2;
}
function adjustRange(w2, bisect2) {
const r0 = w2.i0, r1 = w2.i1 - 1, c2 = w2.compare, d2 = w2.data, n2 = d2.length - 1;
if (r0 > 0 && !c2(d2[r0], d2[r0 - 1]))
w2.i0 = bisect2.left(d2, d2[r0]);
if (r1 < n2 && !c2(d2[r1], d2[r1 + 1]))
w2.i1 = bisect2.right(d2, d2[r1]);
}
const tx = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
aggregate: Aggregate$1,
bin: Bin,
collect: Collect$1,
compare: Compare$1,
countpattern: CountPattern,
cross: Cross,
density: Density,
dotbin: DotBin,
expression: Expression$1,
extent: Extent,
facet: Facet$1,
field: Field$1,
filter: Filter,
flatten: Flatten,
fold: Fold,
formula: Formula,
generate: Generate,
impute: Impute,
joinaggregate: JoinAggregate,
kde: KDE,
key: Key$1,
load: Load$1,
lookup: Lookup,
multiextent: MultiExtent$1,
multivalues: MultiValues$1,
params: Params$2,
pivot: Pivot,
prefacet: PreFacet$1,
project: Project,
proxy: Proxy$2,
quantile: Quantile$1,
relay: Relay$1,
sample: Sample,
sequence: Sequence,
sieve: Sieve$1,
subflow: Subflow,
timeunit: TimeUnit,
tupleindex: TupleIndex,
values: Values$1,
window: Window
}, Symbol.toStringTag, { value: "Module" }));
function constant$4(x2) {
return function constant2() {
return x2;
};
}
const abs$2 = Math.abs;
const atan2$1 = Math.atan2;
const cos$2 = Math.cos;
const max$6 = Math.max;
const min$7 = Math.min;
const sin$2 = Math.sin;
const sqrt$3 = Math.sqrt;
const epsilon$5 = 1e-12;
const pi$4 = Math.PI;
const halfPi$2 = pi$4 / 2;
const tau$3 = 2 * pi$4;
function acos$1(x2) {
return x2 > 1 ? 0 : x2 < -1 ? pi$4 : Math.acos(x2);
}
function asin$2(x2) {
return x2 >= 1 ? halfPi$2 : x2 <= -1 ? -halfPi$2 : Math.asin(x2);
}
const pi$3 = Math.PI, tau$2 = 2 * pi$3, epsilon$4 = 1e-6, tauEpsilon = tau$2 - epsilon$4;
function append$1(strings) {
this._ += strings[0];
for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
this._ += arguments[i2] + strings[i2];
}
}
function appendRound$1(digits) {
let d2 = Math.floor(digits);
if (!(d2 >= 0))
throw new Error(`invalid digits: ${digits}`);
if (d2 > 15)
return append$1;
const k2 = 10 ** d2;
return function(strings) {
this._ += strings[0];
for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
this._ += Math.round(arguments[i2] * k2) / k2 + strings[i2];
}
};
}
let Path$1 = class Path {
constructor(digits) {
this._x0 = this._y0 = // start of current subpath
this._x1 = this._y1 = null;
this._ = "";
this._append = digits == null ? append$1 : appendRound$1(digits);
}
moveTo(x2, y2) {
this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
}
closePath() {
if (this._x1 !== null) {
this._x1 = this._x0, this._y1 = this._y0;
this._append`Z`;
}
}
lineTo(x2, y2) {
this._append`L${this._x1 = +x2},${this._y1 = +y2}`;
}
quadraticCurveTo(x12, y12, x2, y2) {
this._append`Q${+x12},${+y12},${this._x1 = +x2},${this._y1 = +y2}`;
}
bezierCurveTo(x12, y12, x2, y2, x3, y3) {
this._append`C${+x12},${+y12},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`;
}
arcTo(x12, y12, x2, y2, r2) {
x12 = +x12, y12 = +y12, x2 = +x2, y2 = +y2, r2 = +r2;
if (r2 < 0)
throw new Error(`negative radius: ${r2}`);
let x02 = this._x1, y02 = this._y1, x21 = x2 - x12, y21 = y2 - y12, x01 = x02 - x12, y01 = y02 - y12, l01_2 = x01 * x01 + y01 * y01;
if (this._x1 === null) {
this._append`M${this._x1 = x12},${this._y1 = y12}`;
} else if (!(l01_2 > epsilon$4))
;
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$4) || !r2) {
this._append`L${this._x1 = x12},${this._y1 = y12}`;
} else {
let x20 = x2 - x02, y20 = y2 - y02, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l2 = r2 * Math.tan((pi$3 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l2 / l01, t21 = l2 / l21;
if (Math.abs(t01 - 1) > epsilon$4) {
this._append`L${x12 + t01 * x01},${y12 + t01 * y01}`;
}
this._append`A${r2},${r2},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x12 + t21 * x21},${this._y1 = y12 + t21 * y21}`;
}
}
arc(x2, y2, r2, a0, a1, ccw) {
x2 = +x2, y2 = +y2, r2 = +r2, ccw = !!ccw;
if (r2 < 0)
throw new Error(`negative radius: ${r2}`);
let dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x02 = x2 + dx, y02 = y2 + dy, cw2 = 1 ^ ccw, da2 = ccw ? a0 - a1 : a1 - a0;
if (this._x1 === null) {
this._append`M${x02},${y02}`;
} else if (Math.abs(this._x1 - x02) > epsilon$4 || Math.abs(this._y1 - y02) > epsilon$4) {
this._append`L${x02},${y02}`;
}
if (!r2)
return;
if (da2 < 0)
da2 = da2 % tau$2 + tau$2;
if (da2 > tauEpsilon) {
this._append`A${r2},${r2},0,1,${cw2},${x2 - dx},${y2 - dy}A${r2},${r2},0,1,${cw2},${this._x1 = x02},${this._y1 = y02}`;
} else if (da2 > epsilon$4) {
this._append`A${r2},${r2},0,${+(da2 >= pi$3)},${cw2},${this._x1 = x2 + r2 * Math.cos(a1)},${this._y1 = y2 + r2 * Math.sin(a1)}`;
}
}
rect(x2, y2, w2, h2) {
this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w2 = +w2}v${+h2}h${-w2}Z`;
}
toString() {
return this._;
}
};
function path$3() {
return new Path$1();
}
path$3.prototype = Path$1.prototype;
function withPath(shape2) {
let digits = 3;
shape2.digits = function(_24) {
if (!arguments.length)
return digits;
if (_24 == null) {
digits = null;
} else {
const d2 = Math.floor(_24);
if (!(d2 >= 0))
throw new RangeError(`invalid digits: ${_24}`);
digits = d2;
}
return shape2;
};
return () => new Path$1(digits);
}
function arcInnerRadius(d2) {
return d2.innerRadius;
}
function arcOuterRadius(d2) {
return d2.outerRadius;
}
function arcStartAngle(d2) {
return d2.startAngle;
}
function arcEndAngle(d2) {
return d2.endAngle;
}
function arcPadAngle(d2) {
return d2 && d2.padAngle;
}
function intersect$3(x02, y02, x12, y12, x2, y2, x3, y3) {
var x10 = x12 - x02, y10 = y12 - y02, x32 = x3 - x2, y32 = y3 - y2, t5 = y32 * x10 - x32 * y10;
if (t5 * t5 < epsilon$5)
return;
t5 = (x32 * (y02 - y2) - y32 * (x02 - x2)) / t5;
return [x02 + t5 * x10, y02 + t5 * y10];
}
function cornerTangents(x02, y02, x12, y12, r1, rc2, cw2) {
var x01 = x02 - x12, y01 = y02 - y12, lo2 = (cw2 ? rc2 : -rc2) / sqrt$3(x01 * x01 + y01 * y01), ox = lo2 * y01, oy = -lo2 * x01, x11 = x02 + ox, y11 = y02 + oy, x10 = x12 + ox, y10 = y12 + oy, x002 = (x11 + x10) / 2, y002 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r2 = r1 - rc2, D2 = x11 * y10 - x10 * y11, d3 = (dy < 0 ? -1 : 1) * sqrt$3(max$6(0, r2 * r2 * d2 - D2 * D2)), cx0 = (D2 * dy - dx * d3) / d2, cy0 = (-D2 * dx - dy * d3) / d2, cx1 = (D2 * dy + dx * d3) / d2, cy1 = (-D2 * dx + dy * d3) / d2, dx0 = cx0 - x002, dy0 = cy0 - y002, dx1 = cx1 - x002, dy1 = cy1 - y002;
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1)
cx0 = cx1, cy0 = cy1;
return {
cx: cx0,
cy: cy0,
x01: -ox,
y01: -oy,
x11: cx0 * (r1 / r2 - 1),
y11: cy0 * (r1 / r2 - 1)
};
}
function arc$2$1() {
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant$4(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context2 = null, path2 = withPath(arc2);
function arc2() {
var buffer, r2, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi$2, a1 = endAngle.apply(this, arguments) - halfPi$2, da2 = abs$2(a1 - a0), cw2 = a1 > a0;
if (!context2)
context2 = buffer = path2();
if (r1 < r0)
r2 = r1, r1 = r0, r0 = r2;
if (!(r1 > epsilon$5))
context2.moveTo(0, 0);
else if (da2 > tau$3 - epsilon$5) {
context2.moveTo(r1 * cos$2(a0), r1 * sin$2(a0));
context2.arc(0, 0, r1, a0, a1, !cw2);
if (r0 > epsilon$5) {
context2.moveTo(r0 * cos$2(a1), r0 * sin$2(a1));
context2.arc(0, 0, r0, a1, a0, cw2);
}
} else {
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da2, da1 = da2, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon$5 && (padRadius ? +padRadius.apply(this, arguments) : sqrt$3(r0 * r0 + r1 * r1)), rc2 = min$7(abs$2(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc2, rc1 = rc2, t02, t12;
if (rp > epsilon$5) {
var p02 = asin$2(rp / r0 * sin$2(ap)), p1 = asin$2(rp / r1 * sin$2(ap));
if ((da0 -= p02 * 2) > epsilon$5)
p02 *= cw2 ? 1 : -1, a00 += p02, a10 -= p02;
else
da0 = 0, a00 = a10 = (a0 + a1) / 2;
if ((da1 -= p1 * 2) > epsilon$5)
p1 *= cw2 ? 1 : -1, a01 += p1, a11 -= p1;
else
da1 = 0, a01 = a11 = (a0 + a1) / 2;
}
var x01 = r1 * cos$2(a01), y01 = r1 * sin$2(a01), x10 = r0 * cos$2(a10), y10 = r0 * sin$2(a10);
if (rc2 > epsilon$5) {
var x11 = r1 * cos$2(a11), y11 = r1 * sin$2(a11), x002 = r0 * cos$2(a00), y002 = r0 * sin$2(a00), oc2;
if (da2 < pi$4) {
if (oc2 = intersect$3(x01, y01, x002, y002, x11, y11, x10, y10)) {
var ax = x01 - oc2[0], ay = y01 - oc2[1], bx = x11 - oc2[0], by = y11 - oc2[1], kc2 = 1 / sin$2(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2), lc2 = sqrt$3(oc2[0] * oc2[0] + oc2[1] * oc2[1]);
rc0 = min$7(rc2, (r0 - lc2) / (kc2 - 1));
rc1 = min$7(rc2, (r1 - lc2) / (kc2 + 1));
} else {
rc0 = rc1 = 0;
}
}
}
if (!(da1 > epsilon$5))
context2.moveTo(x01, y01);
else if (rc1 > epsilon$5) {
t02 = cornerTangents(x002, y002, x01, y01, r1, rc1, cw2);
t12 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw2);
context2.moveTo(t02.cx + t02.x01, t02.cy + t02.y01);
if (rc1 < rc2)
context2.arc(t02.cx, t02.cy, rc1, atan2$1(t02.y01, t02.x01), atan2$1(t12.y01, t12.x01), !cw2);
else {
context2.arc(t02.cx, t02.cy, rc1, atan2$1(t02.y01, t02.x01), atan2$1(t02.y11, t02.x11), !cw2);
context2.arc(0, 0, r1, atan2$1(t02.cy + t02.y11, t02.cx + t02.x11), atan2$1(t12.cy + t12.y11, t12.cx + t12.x11), !cw2);
context2.arc(t12.cx, t12.cy, rc1, atan2$1(t12.y11, t12.x11), atan2$1(t12.y01, t12.x01), !cw2);
}
} else
context2.moveTo(x01, y01), context2.arc(0, 0, r1, a01, a11, !cw2);
if (!(r0 > epsilon$5) || !(da0 > epsilon$5))
context2.lineTo(x10, y10);
else if (rc0 > epsilon$5) {
t02 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw2);
t12 = cornerTangents(x01, y01, x002, y002, r0, -rc0, cw2);
context2.lineTo(t02.cx + t02.x01, t02.cy + t02.y01);
if (rc0 < rc2)
context2.arc(t02.cx, t02.cy, rc0, atan2$1(t02.y01, t02.x01), atan2$1(t12.y01, t12.x01), !cw2);
else {
context2.arc(t02.cx, t02.cy, rc0, atan2$1(t02.y01, t02.x01), atan2$1(t02.y11, t02.x11), !cw2);
context2.arc(0, 0, r0, atan2$1(t02.cy + t02.y11, t02.cx + t02.x11), atan2$1(t12.cy + t12.y11, t12.cx + t12.x11), cw2);
context2.arc(t12.cx, t12.cy, rc0, atan2$1(t12.y11, t12.x11), atan2$1(t12.y01, t12.x01), !cw2);
}
} else
context2.arc(0, 0, r0, a10, a00, cw2);
}
context2.closePath();
if (buffer)
return context2 = null, buffer + "" || null;
}
arc2.centroid = function() {
var r2 = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi$4 / 2;
return [cos$2(a2) * r2, sin$2(a2) * r2];
};
arc2.innerRadius = function(_24) {
return arguments.length ? (innerRadius = typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : innerRadius;
};
arc2.outerRadius = function(_24) {
return arguments.length ? (outerRadius = typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : outerRadius;
};
arc2.cornerRadius = function(_24) {
return arguments.length ? (cornerRadius = typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : cornerRadius;
};
arc2.padRadius = function(_24) {
return arguments.length ? (padRadius = _24 == null ? null : typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : padRadius;
};
arc2.startAngle = function(_24) {
return arguments.length ? (startAngle = typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : startAngle;
};
arc2.endAngle = function(_24) {
return arguments.length ? (endAngle = typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : endAngle;
};
arc2.padAngle = function(_24) {
return arguments.length ? (padAngle = typeof _24 === "function" ? _24 : constant$4(+_24), arc2) : padAngle;
};
arc2.context = function(_24) {
return arguments.length ? (context2 = _24 == null ? null : _24, arc2) : context2;
};
return arc2;
}
function array$4(x2) {
return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
}
function Linear$1(context2) {
this._context = context2;
}
Linear$1.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._line || this._line !== 0 && this._point === 1)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
break;
case 1:
this._point = 2;
default:
this._context.lineTo(x2, y2);
break;
}
}
};
function curveLinear(context2) {
return new Linear$1(context2);
}
function x$6(p2) {
return p2[0];
}
function y$8(p2) {
return p2[1];
}
function line$2$1(x2, y2) {
var defined = constant$4(true), context2 = null, curve2 = curveLinear, output3 = null, path2 = withPath(line2);
x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x$6 : constant$4(x2);
y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y$8 : constant$4(y2);
function line2(data2) {
var i2, n2 = (data2 = array$4(data2)).length, d2, defined0 = false, buffer;
if (context2 == null)
output3 = curve2(buffer = path2());
for (i2 = 0; i2 <= n2; ++i2) {
if (!(i2 < n2 && defined(d2 = data2[i2], i2, data2)) === defined0) {
if (defined0 = !defined0)
output3.lineStart();
else
output3.lineEnd();
}
if (defined0)
output3.point(+x2(d2, i2, data2), +y2(d2, i2, data2));
}
if (buffer)
return output3 = null, buffer + "" || null;
}
line2.x = function(_24) {
return arguments.length ? (x2 = typeof _24 === "function" ? _24 : constant$4(+_24), line2) : x2;
};
line2.y = function(_24) {
return arguments.length ? (y2 = typeof _24 === "function" ? _24 : constant$4(+_24), line2) : y2;
};
line2.defined = function(_24) {
return arguments.length ? (defined = typeof _24 === "function" ? _24 : constant$4(!!_24), line2) : defined;
};
line2.curve = function(_24) {
return arguments.length ? (curve2 = _24, context2 != null && (output3 = curve2(context2)), line2) : curve2;
};
line2.context = function(_24) {
return arguments.length ? (_24 == null ? context2 = output3 = null : output3 = curve2(context2 = _24), line2) : context2;
};
return line2;
}
function area$2$1(x02, y02, y12) {
var x12 = null, defined = constant$4(true), context2 = null, curve2 = curveLinear, output3 = null, path2 = withPath(area2);
x02 = typeof x02 === "function" ? x02 : x02 === void 0 ? x$6 : constant$4(+x02);
y02 = typeof y02 === "function" ? y02 : y02 === void 0 ? constant$4(0) : constant$4(+y02);
y12 = typeof y12 === "function" ? y12 : y12 === void 0 ? y$8 : constant$4(+y12);
function area2(data2) {
var i2, j2, k2, n2 = (data2 = array$4(data2)).length, d2, defined0 = false, buffer, x0z = new Array(n2), y0z = new Array(n2);
if (context2 == null)
output3 = curve2(buffer = path2());
for (i2 = 0; i2 <= n2; ++i2) {
if (!(i2 < n2 && defined(d2 = data2[i2], i2, data2)) === defined0) {
if (defined0 = !defined0) {
j2 = i2;
output3.areaStart();
output3.lineStart();
} else {
output3.lineEnd();
output3.lineStart();
for (k2 = i2 - 1; k2 >= j2; --k2) {
output3.point(x0z[k2], y0z[k2]);
}
output3.lineEnd();
output3.areaEnd();
}
}
if (defined0) {
x0z[i2] = +x02(d2, i2, data2), y0z[i2] = +y02(d2, i2, data2);
output3.point(x12 ? +x12(d2, i2, data2) : x0z[i2], y12 ? +y12(d2, i2, data2) : y0z[i2]);
}
}
if (buffer)
return output3 = null, buffer + "" || null;
}
function arealine() {
return line$2$1().defined(defined).curve(curve2).context(context2);
}
area2.x = function(_24) {
return arguments.length ? (x02 = typeof _24 === "function" ? _24 : constant$4(+_24), x12 = null, area2) : x02;
};
area2.x0 = function(_24) {
return arguments.length ? (x02 = typeof _24 === "function" ? _24 : constant$4(+_24), area2) : x02;
};
area2.x1 = function(_24) {
return arguments.length ? (x12 = _24 == null ? null : typeof _24 === "function" ? _24 : constant$4(+_24), area2) : x12;
};
area2.y = function(_24) {
return arguments.length ? (y02 = typeof _24 === "function" ? _24 : constant$4(+_24), y12 = null, area2) : y02;
};
area2.y0 = function(_24) {
return arguments.length ? (y02 = typeof _24 === "function" ? _24 : constant$4(+_24), area2) : y02;
};
area2.y1 = function(_24) {
return arguments.length ? (y12 = _24 == null ? null : typeof _24 === "function" ? _24 : constant$4(+_24), area2) : y12;
};
area2.lineX0 = area2.lineY0 = function() {
return arealine().x(x02).y(y02);
};
area2.lineY1 = function() {
return arealine().x(x02).y(y12);
};
area2.lineX1 = function() {
return arealine().x(x12).y(y02);
};
area2.defined = function(_24) {
return arguments.length ? (defined = typeof _24 === "function" ? _24 : constant$4(!!_24), area2) : defined;
};
area2.curve = function(_24) {
return arguments.length ? (curve2 = _24, context2 != null && (output3 = curve2(context2)), area2) : curve2;
};
area2.context = function(_24) {
return arguments.length ? (_24 == null ? context2 = output3 = null : output3 = curve2(context2 = _24), area2) : context2;
};
return area2;
}
const circle = {
draw(context2, size) {
const r2 = sqrt$3(size / pi$4);
context2.moveTo(r2, 0);
context2.arc(0, 0, r2, 0, tau$3);
}
};
function Symbol$2(type2, size) {
let context2 = null, path2 = withPath(symbol2);
type2 = typeof type2 === "function" ? type2 : constant$4(type2 || circle);
size = typeof size === "function" ? size : constant$4(size === void 0 ? 64 : +size);
function symbol2() {
let buffer;
if (!context2)
context2 = buffer = path2();
type2.apply(this, arguments).draw(context2, +size.apply(this, arguments));
if (buffer)
return context2 = null, buffer + "" || null;
}
symbol2.type = function(_24) {
return arguments.length ? (type2 = typeof _24 === "function" ? _24 : constant$4(_24), symbol2) : type2;
};
symbol2.size = function(_24) {
return arguments.length ? (size = typeof _24 === "function" ? _24 : constant$4(+_24), symbol2) : size;
};
symbol2.context = function(_24) {
return arguments.length ? (context2 = _24 == null ? null : _24, symbol2) : context2;
};
return symbol2;
}
function noop$5() {
}
function point$5(that, x2, y2) {
that._context.bezierCurveTo(
(2 * that._x0 + that._x1) / 3,
(2 * that._y0 + that._y1) / 3,
(that._x0 + 2 * that._x1) / 3,
(that._y0 + 2 * that._y1) / 3,
(that._x0 + 4 * that._x1 + x2) / 6,
(that._y0 + 4 * that._y1 + y2) / 6
);
}
function Basis(context2) {
this._context = context2;
}
Basis.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._y0 = this._y1 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 3:
point$5(this, this._x1, this._y1);
case 2:
this._context.lineTo(this._x1, this._y1);
break;
}
if (this._line || this._line !== 0 && this._point === 1)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
default:
point$5(this, x2, y2);
break;
}
this._x0 = this._x1, this._x1 = x2;
this._y0 = this._y1, this._y1 = y2;
}
};
function curveBasis(context2) {
return new Basis(context2);
}
function BasisClosed(context2) {
this._context = context2;
}
BasisClosed.prototype = {
areaStart: noop$5,
areaEnd: noop$5,
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 1: {
this._context.moveTo(this._x2, this._y2);
this._context.closePath();
break;
}
case 2: {
this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
this._context.closePath();
break;
}
case 3: {
this.point(this._x2, this._y2);
this.point(this._x3, this._y3);
this.point(this._x4, this._y4);
break;
}
}
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
this._x2 = x2, this._y2 = y2;
break;
case 1:
this._point = 2;
this._x3 = x2, this._y3 = y2;
break;
case 2:
this._point = 3;
this._x4 = x2, this._y4 = y2;
this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6);
break;
default:
point$5(this, x2, y2);
break;
}
this._x0 = this._x1, this._x1 = x2;
this._y0 = this._y1, this._y1 = y2;
}
};
function curveBasisClosed(context2) {
return new BasisClosed(context2);
}
function BasisOpen(context2) {
this._context = context2;
}
BasisOpen.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._y0 = this._y1 = NaN;
this._point = 0;
},
lineEnd: function() {
if (this._line || this._line !== 0 && this._point === 3)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
var x02 = (this._x0 + 4 * this._x1 + x2) / 6, y02 = (this._y0 + 4 * this._y1 + y2) / 6;
this._line ? this._context.lineTo(x02, y02) : this._context.moveTo(x02, y02);
break;
case 3:
this._point = 4;
default:
point$5(this, x2, y2);
break;
}
this._x0 = this._x1, this._x1 = x2;
this._y0 = this._y1, this._y1 = y2;
}
};
function curveBasisOpen(context2) {
return new BasisOpen(context2);
}
function Bundle(context2, beta) {
this._basis = new Basis(context2);
this._beta = beta;
}
Bundle.prototype = {
lineStart: function() {
this._x = [];
this._y = [];
this._basis.lineStart();
},
lineEnd: function() {
var x2 = this._x, y2 = this._y, j2 = x2.length - 1;
if (j2 > 0) {
var x02 = x2[0], y02 = y2[0], dx = x2[j2] - x02, dy = y2[j2] - y02, i2 = -1, t5;
while (++i2 <= j2) {
t5 = i2 / j2;
this._basis.point(
this._beta * x2[i2] + (1 - this._beta) * (x02 + t5 * dx),
this._beta * y2[i2] + (1 - this._beta) * (y02 + t5 * dy)
);
}
}
this._x = this._y = null;
this._basis.lineEnd();
},
point: function(x2, y2) {
this._x.push(+x2);
this._y.push(+y2);
}
};
const curveBundle = function custom(beta) {
function bundle2(context2) {
return beta === 1 ? new Basis(context2) : new Bundle(context2, beta);
}
bundle2.beta = function(beta2) {
return custom(+beta2);
};
return bundle2;
}(0.85);
function point$4(that, x2, y2) {
that._context.bezierCurveTo(
that._x1 + that._k * (that._x2 - that._x0),
that._y1 + that._k * (that._y2 - that._y0),
that._x2 + that._k * (that._x1 - x2),
that._y2 + that._k * (that._y1 - y2),
that._x2,
that._y2
);
}
function Cardinal(context2, tension) {
this._context = context2;
this._k = (1 - tension) / 6;
}
Cardinal.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 2:
this._context.lineTo(this._x2, this._y2);
break;
case 3:
point$4(this, this._x1, this._y1);
break;
}
if (this._line || this._line !== 0 && this._point === 1)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
break;
case 1:
this._point = 2;
this._x1 = x2, this._y1 = y2;
break;
case 2:
this._point = 3;
default:
point$4(this, x2, y2);
break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
}
};
const curveCardinal = function custom2(tension) {
function cardinal(context2) {
return new Cardinal(context2, tension);
}
cardinal.tension = function(tension2) {
return custom2(+tension2);
};
return cardinal;
}(0);
function CardinalClosed(context2, tension) {
this._context = context2;
this._k = (1 - tension) / 6;
}
CardinalClosed.prototype = {
areaStart: noop$5,
areaEnd: noop$5,
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 1: {
this._context.moveTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 2: {
this._context.lineTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 3: {
this.point(this._x3, this._y3);
this.point(this._x4, this._y4);
this.point(this._x5, this._y5);
break;
}
}
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
this._x3 = x2, this._y3 = y2;
break;
case 1:
this._point = 2;
this._context.moveTo(this._x4 = x2, this._y4 = y2);
break;
case 2:
this._point = 3;
this._x5 = x2, this._y5 = y2;
break;
default:
point$4(this, x2, y2);
break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
}
};
const curveCardinalClosed = function custom3(tension) {
function cardinal(context2) {
return new CardinalClosed(context2, tension);
}
cardinal.tension = function(tension2) {
return custom3(+tension2);
};
return cardinal;
}(0);
function CardinalOpen(context2, tension) {
this._context = context2;
this._k = (1 - tension) / 6;
}
CardinalOpen.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
this._point = 0;
},
lineEnd: function() {
if (this._line || this._line !== 0 && this._point === 3)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
break;
case 3:
this._point = 4;
default:
point$4(this, x2, y2);
break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
}
};
const curveCardinalOpen = function custom4(tension) {
function cardinal(context2) {
return new CardinalOpen(context2, tension);
}
cardinal.tension = function(tension2) {
return custom4(+tension2);
};
return cardinal;
}(0);
function point$3(that, x2, y2) {
var x12 = that._x1, y12 = that._y1, x22 = that._x2, y22 = that._y2;
if (that._l01_a > epsilon$5) {
var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n2 = 3 * that._l01_a * (that._l01_a + that._l12_a);
x12 = (x12 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n2;
y12 = (y12 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n2;
}
if (that._l23_a > epsilon$5) {
var b2 = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m2 = 3 * that._l23_a * (that._l23_a + that._l12_a);
x22 = (x22 * b2 + that._x1 * that._l23_2a - x2 * that._l12_2a) / m2;
y22 = (y22 * b2 + that._y1 * that._l23_2a - y2 * that._l12_2a) / m2;
}
that._context.bezierCurveTo(x12, y12, x22, y22, that._x2, that._y2);
}
function CatmullRom(context2, alpha) {
this._context = context2;
this._alpha = alpha;
}
CatmullRom.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 2:
this._context.lineTo(this._x2, this._y2);
break;
case 3:
this.point(this._x2, this._y2);
break;
}
if (this._line || this._line !== 0 && this._point === 1)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
if (this._point) {
var x23 = this._x2 - x2, y23 = this._y2 - y2;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
default:
point$3(this, x2, y2);
break;
}
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
}
};
const curveCatmullRom = function custom5(alpha) {
function catmullRom(context2) {
return alpha ? new CatmullRom(context2, alpha) : new Cardinal(context2, 0);
}
catmullRom.alpha = function(alpha2) {
return custom5(+alpha2);
};
return catmullRom;
}(0.5);
function CatmullRomClosed(context2, alpha) {
this._context = context2;
this._alpha = alpha;
}
CatmullRomClosed.prototype = {
areaStart: noop$5,
areaEnd: noop$5,
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 1: {
this._context.moveTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 2: {
this._context.lineTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 3: {
this.point(this._x3, this._y3);
this.point(this._x4, this._y4);
this.point(this._x5, this._y5);
break;
}
}
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
if (this._point) {
var x23 = this._x2 - x2, y23 = this._y2 - y2;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0:
this._point = 1;
this._x3 = x2, this._y3 = y2;
break;
case 1:
this._point = 2;
this._context.moveTo(this._x4 = x2, this._y4 = y2);
break;
case 2:
this._point = 3;
this._x5 = x2, this._y5 = y2;
break;
default:
point$3(this, x2, y2);
break;
}
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
}
};
const curveCatmullRomClosed = function custom6(alpha) {
function catmullRom(context2) {
return alpha ? new CatmullRomClosed(context2, alpha) : new CardinalClosed(context2, 0);
}
catmullRom.alpha = function(alpha2) {
return custom6(+alpha2);
};
return catmullRom;
}(0.5);
function CatmullRomOpen(context2, alpha) {
this._context = context2;
this._alpha = alpha;
}
CatmullRomOpen.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
},
lineEnd: function() {
if (this._line || this._line !== 0 && this._point === 3)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
if (this._point) {
var x23 = this._x2 - x2, y23 = this._y2 - y2;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0:
this._point = 1;
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
break;
case 3:
this._point = 4;
default:
point$3(this, x2, y2);
break;
}
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
}
};
const curveCatmullRomOpen = function custom7(alpha) {
function catmullRom(context2) {
return alpha ? new CatmullRomOpen(context2, alpha) : new CardinalOpen(context2, 0);
}
catmullRom.alpha = function(alpha2) {
return custom7(+alpha2);
};
return catmullRom;
}(0.5);
function LinearClosed(context2) {
this._context = context2;
}
LinearClosed.prototype = {
areaStart: noop$5,
areaEnd: noop$5,
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._point)
this._context.closePath();
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
if (this._point)
this._context.lineTo(x2, y2);
else
this._point = 1, this._context.moveTo(x2, y2);
}
};
function curveLinearClosed(context2) {
return new LinearClosed(context2);
}
function sign$1(x2) {
return x2 < 0 ? -1 : 1;
}
function slope3(that, x2, y2) {
var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p2 = (s0 * h1 + s1 * h0) / (h0 + h1);
return (sign$1(s0) + sign$1(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p2)) || 0;
}
function slope2(that, t5) {
var h2 = that._x1 - that._x0;
return h2 ? (3 * (that._y1 - that._y0) / h2 - t5) / 2 : t5;
}
function point$2(that, t02, t12) {
var x02 = that._x0, y02 = that._y0, x12 = that._x1, y12 = that._y1, dx = (x12 - x02) / 3;
that._context.bezierCurveTo(x02 + dx, y02 + dx * t02, x12 - dx, y12 - dx * t12, x12, y12);
}
function MonotoneX(context2) {
this._context = context2;
}
MonotoneX.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 2:
this._context.lineTo(this._x1, this._y1);
break;
case 3:
point$2(this, this._t0, slope2(this, this._t0));
break;
}
if (this._line || this._line !== 0 && this._point === 1)
this._context.closePath();
this._line = 1 - this._line;
},
point: function(x2, y2) {
var t12 = NaN;
x2 = +x2, y2 = +y2;
if (x2 === this._x1 && y2 === this._y1)
return;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
break;
case 1:
this._point = 2;
break;
case 2:
this._point = 3;
point$2(this, slope2(this, t12 = slope3(this, x2, y2)), t12);
break;
default:
point$2(this, this._t0, t12 = slope3(this, x2, y2));
break;
}
this._x0 = this._x1, this._x1 = x2;
this._y0 = this._y1, this._y1 = y2;
this._t0 = t12;
}
};
function MonotoneY(context2) {
this._context = new ReflectContext(context2);
}
(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) {
MonotoneX.prototype.point.call(this, y2, x2);
};
function ReflectContext(context2) {
this._context = context2;
}
ReflectContext.prototype = {
moveTo: function(x2, y2) {
this._context.moveTo(y2, x2);
},
closePath: function() {
this._context.closePath();
},
lineTo: function(x2, y2) {
this._context.lineTo(y2, x2);
},
bezierCurveTo: function(x12, y12, x2, y2, x3, y3) {
this._context.bezierCurveTo(y12, x12, y2, x2, y3, x3);
}
};
function monotoneX(context2) {
return new MonotoneX(context2);
}
function monotoneY(context2) {
return new MonotoneY(context2);
}
function Natural(context2) {
this._context = context2;
}
Natural.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x = [];
this._y = [];
},
lineEnd: function() {
var x2 = this._x, y2 = this._y, n2 = x2.length;
if (n2) {
this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]);
if (n2 === 2) {
this._context.lineTo(x2[1], y2[1]);
} else {
var px2 = controlPoints(x2), py2 = controlPoints(y2);
for (var i0 = 0, i1 = 1; i1 < n2; ++i0, ++i1) {
this._context.bezierCurveTo(px2[0][i0], py2[0][i0], px2[1][i0], py2[1][i0], x2[i1], y2[i1]);
}
}
}
if (this._line || this._line !== 0 && n2 === 1)
this._context.closePath();
this._line = 1 - this._line;
this._x = this._y = null;
},
point: function(x2, y2) {
this._x.push(+x2);
this._y.push(+y2);
}
};
function controlPoints(x2) {
var i2, n2 = x2.length - 1, m2, a2 = new Array(n2), b2 = new Array(n2), r2 = new Array(n2);
a2[0] = 0, b2[0] = 2, r2[0] = x2[0] + 2 * x2[1];
for (i2 = 1; i2 < n2 - 1; ++i2)
a2[i2] = 1, b2[i2] = 4, r2[i2] = 4 * x2[i2] + 2 * x2[i2 + 1];
a2[n2 - 1] = 2, b2[n2 - 1] = 7, r2[n2 - 1] = 8 * x2[n2 - 1] + x2[n2];
for (i2 = 1; i2 < n2; ++i2)
m2 = a2[i2] / b2[i2 - 1], b2[i2] -= m2, r2[i2] -= m2 * r2[i2 - 1];
a2[n2 - 1] = r2[n2 - 1] / b2[n2 - 1];
for (i2 = n2 - 2; i2 >= 0; --i2)
a2[i2] = (r2[i2] - a2[i2 + 1]) / b2[i2];
b2[n2 - 1] = (x2[n2] + a2[n2 - 1]) / 2;
for (i2 = 0; i2 < n2 - 1; ++i2)
b2[i2] = 2 * x2[i2 + 1] - a2[i2 + 1];
return [a2, b2];
}
function curveNatural(context2) {
return new Natural(context2);
}
function Step(context2, t5) {
this._context = context2;
this._t = t5;
}
Step.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x = this._y = NaN;
this._point = 0;
},
lineEnd: function() {
if (0 < this._t && this._t < 1 && this._point === 2)
this._context.lineTo(this._x, this._y);
if (this._line || this._line !== 0 && this._point === 1)
this._context.closePath();
if (this._line >= 0)
this._t = 1 - this._t, this._line = 1 - this._line;
},
point: function(x2, y2) {
x2 = +x2, y2 = +y2;
switch (this._point) {
case 0:
this._point = 1;
this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
break;
case 1:
this._point = 2;
default: {
if (this._t <= 0) {
this._context.lineTo(this._x, y2);
this._context.lineTo(x2, y2);
} else {
var x12 = this._x * (1 - this._t) + x2 * this._t;
this._context.lineTo(x12, this._y);
this._context.lineTo(x12, y2);
}
break;
}
}
this._x = x2, this._y = y2;
}
};
function curveStep(context2) {
return new Step(context2, 0.5);
}
function stepBefore(context2) {
return new Step(context2, 0);
}
function stepAfter(context2) {
return new Step(context2, 1);
}
function domCanvas(w2, h2) {
if (typeof document !== "undefined" && document.createElement) {
const c2 = document.createElement("canvas");
if (c2 && c2.getContext) {
c2.width = w2;
c2.height = h2;
return c2;
}
}
return null;
}
const domImage = () => typeof Image !== "undefined" ? Image : null;
function ascending$3(a2, b2) {
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function descending$3(a2, b2) {
return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN;
}
function bisector$2(f2) {
let compare12, compare22, delta;
if (f2.length !== 2) {
compare12 = ascending$3;
compare22 = (d2, x2) => ascending$3(f2(d2), x2);
delta = (d2, x2) => f2(d2) - x2;
} else {
compare12 = f2 === ascending$3 || f2 === descending$3 ? f2 : zero$4;
compare22 = f2;
delta = f2;
}
function left2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) < 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function right2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) <= 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function center(a2, x2, lo2 = 0, hi2 = a2.length) {
const i2 = left2(a2, x2, lo2, hi2 - 1);
return i2 > lo2 && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
}
return { left: left2, center, right: right2 };
}
function zero$4() {
return 0;
}
function number$7(x2) {
return x2 === null ? NaN : +x2;
}
const ascendingBisect$1 = bisector$2(ascending$3);
const bisectRight$2 = ascendingBisect$1.right;
bisector$2(number$7).center;
const bisect$1 = bisectRight$2;
function range$6(start2, stop2, step) {
start2 = +start2, stop2 = +stop2, step = (n2 = arguments.length) < 2 ? (stop2 = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop2 - start2) / step)) | 0, range2 = new Array(n2);
while (++i2 < n2) {
range2[i2] = start2 + i2 * step;
}
return range2;
}
function initRange(domain2, range2) {
switch (arguments.length) {
case 0:
break;
case 1:
this.range(domain2);
break;
default:
this.range(range2).domain(domain2);
break;
}
return this;
}
function initInterpolator(domain2, interpolator) {
switch (arguments.length) {
case 0:
break;
case 1: {
if (typeof domain2 === "function")
this.interpolator(domain2);
else
this.range(domain2);
break;
}
default: {
this.domain(domain2);
if (typeof interpolator === "function")
this.interpolator(interpolator);
else
this.range(interpolator);
break;
}
}
return this;
}
const implicit = Symbol("implicit");
function ordinal() {
var index2 = new InternMap(), domain2 = [], range2 = [], unknown = implicit;
function scale2(d2) {
let i2 = index2.get(d2);
if (i2 === void 0) {
if (unknown !== implicit)
return unknown;
index2.set(d2, i2 = domain2.push(d2) - 1);
}
return range2[i2 % range2.length];
}
scale2.domain = function(_24) {
if (!arguments.length)
return domain2.slice();
domain2 = [], index2 = new InternMap();
for (const value2 of _24) {
if (index2.has(value2))
continue;
index2.set(value2, domain2.push(value2) - 1);
}
return scale2;
};
scale2.range = function(_24) {
return arguments.length ? (range2 = Array.from(_24), scale2) : range2.slice();
};
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
scale2.copy = function() {
return ordinal(domain2, range2).unknown(unknown);
};
initRange.apply(scale2, arguments);
return scale2;
}
function define$1(constructor, factory, prototype2) {
constructor.prototype = factory.prototype = prototype2;
prototype2.constructor = constructor;
}
function extend$1(parent, definition2) {
var prototype2 = Object.create(parent.prototype);
for (var key2 in definition2)
prototype2[key2] = definition2[key2];
return prototype2;
}
function Color$1() {
}
var darker$1 = 0.7;
var brighter$1 = 1 / darker$1;
var reI$1 = "\\s*([+-]?\\d+)\\s*", reN$1 = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP$1 = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex$1 = /^#([0-9a-f]{3,8})$/, reRgbInteger$1 = new RegExp(`^rgb\\(${reI$1},${reI$1},${reI$1}\\)$`), reRgbPercent$1 = new RegExp(`^rgb\\(${reP$1},${reP$1},${reP$1}\\)$`), reRgbaInteger$1 = new RegExp(`^rgba\\(${reI$1},${reI$1},${reI$1},${reN$1}\\)$`), reRgbaPercent$1 = new RegExp(`^rgba\\(${reP$1},${reP$1},${reP$1},${reN$1}\\)$`), reHslPercent$1 = new RegExp(`^hsl\\(${reN$1},${reP$1},${reP$1}\\)$`), reHslaPercent$1 = new RegExp(`^hsla\\(${reN$1},${reP$1},${reP$1},${reN$1}\\)$`);
var named$1 = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
};
define$1(Color$1, color$5, {
copy(channels) {
return Object.assign(new this.constructor(), this, channels);
},
displayable() {
return this.rgb().displayable();
},
hex: color_formatHex$1,
// Deprecated! Use color.formatHex.
formatHex: color_formatHex$1,
formatHex8: color_formatHex8,
formatHsl: color_formatHsl$1,
formatRgb: color_formatRgb$1,
toString: color_formatRgb$1
});
function color_formatHex$1() {
return this.rgb().formatHex();
}
function color_formatHex8() {
return this.rgb().formatHex8();
}
function color_formatHsl$1() {
return hslConvert$1(this).formatHsl();
}
function color_formatRgb$1() {
return this.rgb().formatRgb();
}
function color$5(format2) {
var m2, l2;
format2 = (format2 + "").trim().toLowerCase();
return (m2 = reHex$1.exec(format2)) ? (l2 = m2[1].length, m2 = parseInt(m2[1], 16), l2 === 6 ? rgbn$1(m2) : l2 === 3 ? new Rgb$1(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l2 === 8 ? rgba$1(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l2 === 4 ? rgba$1(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger$1.exec(format2)) ? new Rgb$1(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent$1.exec(format2)) ? new Rgb$1(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger$1.exec(format2)) ? rgba$1(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent$1.exec(format2)) ? rgba$1(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent$1.exec(format2)) ? hsla$1(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent$1.exec(format2)) ? hsla$1(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named$1.hasOwnProperty(format2) ? rgbn$1(named$1[format2]) : format2 === "transparent" ? new Rgb$1(NaN, NaN, NaN, 0) : null;
}
function rgbn$1(n2) {
return new Rgb$1(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
}
function rgba$1(r2, g2, b2, a2) {
if (a2 <= 0)
r2 = g2 = b2 = NaN;
return new Rgb$1(r2, g2, b2, a2);
}
function rgbConvert$1(o2) {
if (!(o2 instanceof Color$1))
o2 = color$5(o2);
if (!o2)
return new Rgb$1();
o2 = o2.rgb();
return new Rgb$1(o2.r, o2.g, o2.b, o2.opacity);
}
function rgb$3(r2, g2, b2, opacity2) {
return arguments.length === 1 ? rgbConvert$1(r2) : new Rgb$1(r2, g2, b2, opacity2 == null ? 1 : opacity2);
}
function Rgb$1(r2, g2, b2, opacity2) {
this.r = +r2;
this.g = +g2;
this.b = +b2;
this.opacity = +opacity2;
}
define$1(Rgb$1, rgb$3, extend$1(Color$1, {
brighter(k2) {
k2 = k2 == null ? brighter$1 : Math.pow(brighter$1, k2);
return new Rgb$1(this.r * k2, this.g * k2, this.b * k2, this.opacity);
},
darker(k2) {
k2 = k2 == null ? darker$1 : Math.pow(darker$1, k2);
return new Rgb$1(this.r * k2, this.g * k2, this.b * k2, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new Rgb$1(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
},
displayable() {
return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
},
hex: rgb_formatHex$1,
// Deprecated! Use color.formatHex.
formatHex: rgb_formatHex$1,
formatHex8: rgb_formatHex8,
formatRgb: rgb_formatRgb$1,
toString: rgb_formatRgb$1
}));
function rgb_formatHex$1() {
return `#${hex$1(this.r)}${hex$1(this.g)}${hex$1(this.b)}`;
}
function rgb_formatHex8() {
return `#${hex$1(this.r)}${hex$1(this.g)}${hex$1(this.b)}${hex$1((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function rgb_formatRgb$1() {
const a2 = clampa(this.opacity);
return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
}
function clampa(opacity2) {
return isNaN(opacity2) ? 1 : Math.max(0, Math.min(1, opacity2));
}
function clampi(value2) {
return Math.max(0, Math.min(255, Math.round(value2) || 0));
}
function hex$1(value2) {
value2 = clampi(value2);
return (value2 < 16 ? "0" : "") + value2.toString(16);
}
function hsla$1(h2, s2, l2, a2) {
if (a2 <= 0)
h2 = s2 = l2 = NaN;
else if (l2 <= 0 || l2 >= 1)
h2 = s2 = NaN;
else if (s2 <= 0)
h2 = NaN;
return new Hsl$1(h2, s2, l2, a2);
}
function hslConvert$1(o2) {
if (o2 instanceof Hsl$1)
return new Hsl$1(o2.h, o2.s, o2.l, o2.opacity);
if (!(o2 instanceof Color$1))
o2 = color$5(o2);
if (!o2)
return new Hsl$1();
if (o2 instanceof Hsl$1)
return o2;
o2 = o2.rgb();
var r2 = o2.r / 255, g2 = o2.g / 255, b2 = o2.b / 255, min2 = Math.min(r2, g2, b2), max2 = Math.max(r2, g2, b2), h2 = NaN, s2 = max2 - min2, l2 = (max2 + min2) / 2;
if (s2) {
if (r2 === max2)
h2 = (g2 - b2) / s2 + (g2 < b2) * 6;
else if (g2 === max2)
h2 = (b2 - r2) / s2 + 2;
else
h2 = (r2 - g2) / s2 + 4;
s2 /= l2 < 0.5 ? max2 + min2 : 2 - max2 - min2;
h2 *= 60;
} else {
s2 = l2 > 0 && l2 < 1 ? 0 : h2;
}
return new Hsl$1(h2, s2, l2, o2.opacity);
}
function hsl$4(h2, s2, l2, opacity2) {
return arguments.length === 1 ? hslConvert$1(h2) : new Hsl$1(h2, s2, l2, opacity2 == null ? 1 : opacity2);
}
function Hsl$1(h2, s2, l2, opacity2) {
this.h = +h2;
this.s = +s2;
this.l = +l2;
this.opacity = +opacity2;
}
define$1(Hsl$1, hsl$4, extend$1(Color$1, {
brighter(k2) {
k2 = k2 == null ? brighter$1 : Math.pow(brighter$1, k2);
return new Hsl$1(this.h, this.s, this.l * k2, this.opacity);
},
darker(k2) {
k2 = k2 == null ? darker$1 : Math.pow(darker$1, k2);
return new Hsl$1(this.h, this.s, this.l * k2, this.opacity);
},
rgb() {
var h2 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h2) || isNaN(this.s) ? 0 : this.s, l2 = this.l, m2 = l2 + (l2 < 0.5 ? l2 : 1 - l2) * s2, m1 = 2 * l2 - m2;
return new Rgb$1(
hsl2rgb$1(h2 >= 240 ? h2 - 240 : h2 + 120, m1, m2),
hsl2rgb$1(h2, m1, m2),
hsl2rgb$1(h2 < 120 ? h2 + 240 : h2 - 120, m1, m2),
this.opacity
);
},
clamp() {
return new Hsl$1(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
},
displayable() {
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
},
formatHsl() {
const a2 = clampa(this.opacity);
return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
}
}));
function clamph(value2) {
value2 = (value2 || 0) % 360;
return value2 < 0 ? value2 + 360 : value2;
}
function clampt(value2) {
return Math.max(0, Math.min(1, value2 || 0));
}
function hsl2rgb$1(h2, m1, m2) {
return (h2 < 60 ? m1 + (m2 - m1) * h2 / 60 : h2 < 180 ? m2 : h2 < 240 ? m1 + (m2 - m1) * (240 - h2) / 60 : m1) * 255;
}
const radians$1 = Math.PI / 180;
const degrees$2 = 180 / Math.PI;
const K$2 = 18, Xn$1 = 0.96422, Yn$1 = 1, Zn$1 = 0.82521, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1;
function labConvert(o2) {
if (o2 instanceof Lab)
return new Lab(o2.l, o2.a, o2.b, o2.opacity);
if (o2 instanceof Hcl)
return hcl2lab(o2);
if (!(o2 instanceof Rgb$1))
o2 = rgbConvert$1(o2);
var r2 = rgb2lrgb(o2.r), g2 = rgb2lrgb(o2.g), b2 = rgb2lrgb(o2.b), y2 = xyz2lab((0.2225045 * r2 + 0.7168786 * g2 + 0.0606169 * b2) / Yn$1), x2, z2;
if (r2 === g2 && g2 === b2)
x2 = z2 = y2;
else {
x2 = xyz2lab((0.4360747 * r2 + 0.3850649 * g2 + 0.1430804 * b2) / Xn$1);
z2 = xyz2lab((0.0139322 * r2 + 0.0971045 * g2 + 0.7141733 * b2) / Zn$1);
}
return new Lab(116 * y2 - 16, 500 * (x2 - y2), 200 * (y2 - z2), o2.opacity);
}
function lab$1(l2, a2, b2, opacity2) {
return arguments.length === 1 ? labConvert(l2) : new Lab(l2, a2, b2, opacity2 == null ? 1 : opacity2);
}
function Lab(l2, a2, b2, opacity2) {
this.l = +l2;
this.a = +a2;
this.b = +b2;
this.opacity = +opacity2;
}
define$1(Lab, lab$1, extend$1(Color$1, {
brighter(k2) {
return new Lab(this.l + K$2 * (k2 == null ? 1 : k2), this.a, this.b, this.opacity);
},
darker(k2) {
return new Lab(this.l - K$2 * (k2 == null ? 1 : k2), this.a, this.b, this.opacity);
},
rgb() {
var y2 = (this.l + 16) / 116, x2 = isNaN(this.a) ? y2 : y2 + this.a / 500, z2 = isNaN(this.b) ? y2 : y2 - this.b / 200;
x2 = Xn$1 * lab2xyz(x2);
y2 = Yn$1 * lab2xyz(y2);
z2 = Zn$1 * lab2xyz(z2);
return new Rgb$1(
lrgb2rgb(3.1338561 * x2 - 1.6168667 * y2 - 0.4906146 * z2),
lrgb2rgb(-0.9787684 * x2 + 1.9161415 * y2 + 0.033454 * z2),
lrgb2rgb(0.0719453 * x2 - 0.2289914 * y2 + 1.4052427 * z2),
this.opacity
);
}
}));
function xyz2lab(t5) {
return t5 > t3 ? Math.pow(t5, 1 / 3) : t5 / t2 + t0;
}
function lab2xyz(t5) {
return t5 > t1 ? t5 * t5 * t5 : t2 * (t5 - t0);
}
function lrgb2rgb(x2) {
return 255 * (x2 <= 31308e-7 ? 12.92 * x2 : 1.055 * Math.pow(x2, 1 / 2.4) - 0.055);
}
function rgb2lrgb(x2) {
return (x2 /= 255) <= 0.04045 ? x2 / 12.92 : Math.pow((x2 + 0.055) / 1.055, 2.4);
}
function hclConvert(o2) {
if (o2 instanceof Hcl)
return new Hcl(o2.h, o2.c, o2.l, o2.opacity);
if (!(o2 instanceof Lab))
o2 = labConvert(o2);
if (o2.a === 0 && o2.b === 0)
return new Hcl(NaN, 0 < o2.l && o2.l < 100 ? 0 : NaN, o2.l, o2.opacity);
var h2 = Math.atan2(o2.b, o2.a) * degrees$2;
return new Hcl(h2 < 0 ? h2 + 360 : h2, Math.sqrt(o2.a * o2.a + o2.b * o2.b), o2.l, o2.opacity);
}
function hcl$2(h2, c2, l2, opacity2) {
return arguments.length === 1 ? hclConvert(h2) : new Hcl(h2, c2, l2, opacity2 == null ? 1 : opacity2);
}
function Hcl(h2, c2, l2, opacity2) {
this.h = +h2;
this.c = +c2;
this.l = +l2;
this.opacity = +opacity2;
}
function hcl2lab(o2) {
if (isNaN(o2.h))
return new Lab(o2.l, 0, 0, o2.opacity);
var h2 = o2.h * radians$1;
return new Lab(o2.l, Math.cos(h2) * o2.c, Math.sin(h2) * o2.c, o2.opacity);
}
define$1(Hcl, hcl$2, extend$1(Color$1, {
brighter(k2) {
return new Hcl(this.h, this.c, this.l + K$2 * (k2 == null ? 1 : k2), this.opacity);
},
darker(k2) {
return new Hcl(this.h, this.c, this.l - K$2 * (k2 == null ? 1 : k2), this.opacity);
},
rgb() {
return hcl2lab(this).rgb();
}
}));
var A$3 = -0.14861, B$3 = 1.78277, C$3 = -0.29227, D$3 = -0.90649, E$3 = 1.97294, ED = E$3 * D$3, EB$1 = E$3 * B$3, BC_DA = B$3 * C$3 - D$3 * A$3;
function cubehelixConvert(o2) {
if (o2 instanceof Cubehelix)
return new Cubehelix(o2.h, o2.s, o2.l, o2.opacity);
if (!(o2 instanceof Rgb$1))
o2 = rgbConvert$1(o2);
var r2 = o2.r / 255, g2 = o2.g / 255, b2 = o2.b / 255, l2 = (BC_DA * b2 + ED * r2 - EB$1 * g2) / (BC_DA + ED - EB$1), bl2 = b2 - l2, k2 = (E$3 * (g2 - l2) - C$3 * bl2) / D$3, s2 = Math.sqrt(k2 * k2 + bl2 * bl2) / (E$3 * l2 * (1 - l2)), h2 = s2 ? Math.atan2(k2, bl2) * degrees$2 - 120 : NaN;
return new Cubehelix(h2 < 0 ? h2 + 360 : h2, s2, l2, o2.opacity);
}
function cubehelix$2(h2, s2, l2, opacity2) {
return arguments.length === 1 ? cubehelixConvert(h2) : new Cubehelix(h2, s2, l2, opacity2 == null ? 1 : opacity2);
}
function Cubehelix(h2, s2, l2, opacity2) {
this.h = +h2;
this.s = +s2;
this.l = +l2;
this.opacity = +opacity2;
}
define$1(Cubehelix, cubehelix$2, extend$1(Color$1, {
brighter(k2) {
k2 = k2 == null ? brighter$1 : Math.pow(brighter$1, k2);
return new Cubehelix(this.h, this.s, this.l * k2, this.opacity);
},
darker(k2) {
k2 = k2 == null ? darker$1 : Math.pow(darker$1, k2);
return new Cubehelix(this.h, this.s, this.l * k2, this.opacity);
},
rgb() {
var h2 = isNaN(this.h) ? 0 : (this.h + 120) * radians$1, l2 = +this.l, a2 = isNaN(this.s) ? 0 : this.s * l2 * (1 - l2), cosh2 = Math.cos(h2), sinh2 = Math.sin(h2);
return new Rgb$1(
255 * (l2 + a2 * (A$3 * cosh2 + B$3 * sinh2)),
255 * (l2 + a2 * (C$3 * cosh2 + D$3 * sinh2)),
255 * (l2 + a2 * (E$3 * cosh2)),
this.opacity
);
}
}));
function basis$2(t12, v0, v1, v2, v3) {
var t22 = t12 * t12, t32 = t22 * t12;
return ((1 - 3 * t12 + 3 * t22 - t32) * v0 + (4 - 6 * t22 + 3 * t32) * v1 + (1 + 3 * t12 + 3 * t22 - 3 * t32) * v2 + t32 * v3) / 6;
}
function basis$3(values2) {
var n2 = values2.length - 1;
return function(t5) {
var i2 = t5 <= 0 ? t5 = 0 : t5 >= 1 ? (t5 = 1, n2 - 1) : Math.floor(t5 * n2), v1 = values2[i2], v2 = values2[i2 + 1], v0 = i2 > 0 ? values2[i2 - 1] : 2 * v1 - v2, v3 = i2 < n2 - 1 ? values2[i2 + 2] : 2 * v2 - v1;
return basis$2((t5 - i2 / n2) * n2, v0, v1, v2, v3);
};
}
function basisClosed(values2) {
var n2 = values2.length;
return function(t5) {
var i2 = Math.floor(((t5 %= 1) < 0 ? ++t5 : t5) * n2), v0 = values2[(i2 + n2 - 1) % n2], v1 = values2[i2 % n2], v2 = values2[(i2 + 1) % n2], v3 = values2[(i2 + 2) % n2];
return basis$2((t5 - i2 / n2) * n2, v0, v1, v2, v3);
};
}
const constant$3 = (x2) => () => x2;
function linear$2(a2, d2) {
return function(t5) {
return a2 + t5 * d2;
};
}
function exponential$1(a2, b2, y2) {
return a2 = Math.pow(a2, y2), b2 = Math.pow(b2, y2) - a2, y2 = 1 / y2, function(t5) {
return Math.pow(a2 + t5 * b2, y2);
};
}
function hue$1(a2, b2) {
var d2 = b2 - a2;
return d2 ? linear$2(a2, d2 > 180 || d2 < -180 ? d2 - 360 * Math.round(d2 / 360) : d2) : constant$3(isNaN(a2) ? b2 : a2);
}
function gamma$1(y2) {
return (y2 = +y2) === 1 ? nogamma$1 : function(a2, b2) {
return b2 - a2 ? exponential$1(a2, b2, y2) : constant$3(isNaN(a2) ? b2 : a2);
};
}
function nogamma$1(a2, b2) {
var d2 = b2 - a2;
return d2 ? linear$2(a2, d2) : constant$3(isNaN(a2) ? b2 : a2);
}
const rgb$2 = function rgbGamma(y2) {
var color2 = gamma$1(y2);
function rgb2(start2, end2) {
var r2 = color2((start2 = rgb$3(start2)).r, (end2 = rgb$3(end2)).r), g2 = color2(start2.g, end2.g), b2 = color2(start2.b, end2.b), opacity2 = nogamma$1(start2.opacity, end2.opacity);
return function(t5) {
start2.r = r2(t5);
start2.g = g2(t5);
start2.b = b2(t5);
start2.opacity = opacity2(t5);
return start2 + "";
};
}
rgb2.gamma = rgbGamma;
return rgb2;
}(1);
function rgbSpline$1(spline) {
return function(colors2) {
var n2 = colors2.length, r2 = new Array(n2), g2 = new Array(n2), b2 = new Array(n2), i2, color2;
for (i2 = 0; i2 < n2; ++i2) {
color2 = rgb$3(colors2[i2]);
r2[i2] = color2.r || 0;
g2[i2] = color2.g || 0;
b2[i2] = color2.b || 0;
}
r2 = spline(r2);
g2 = spline(g2);
b2 = spline(b2);
color2.opacity = 1;
return function(t5) {
color2.r = r2(t5);
color2.g = g2(t5);
color2.b = b2(t5);
return color2 + "";
};
};
}
var rgbBasis$1 = rgbSpline$1(basis$3);
var rgbBasisClosed = rgbSpline$1(basisClosed);
function numberArray(a2, b2) {
if (!b2)
b2 = [];
var n2 = a2 ? Math.min(b2.length, a2.length) : 0, c2 = b2.slice(), i2;
return function(t5) {
for (i2 = 0; i2 < n2; ++i2)
c2[i2] = a2[i2] * (1 - t5) + b2[i2] * t5;
return c2;
};
}
function isNumberArray(x2) {
return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
}
function array$3(a2, b2) {
return (isNumberArray(b2) ? numberArray : genericArray)(a2, b2);
}
function genericArray(a2, b2) {
var nb2 = b2 ? b2.length : 0, na2 = a2 ? Math.min(nb2, a2.length) : 0, x2 = new Array(na2), c2 = new Array(nb2), i2;
for (i2 = 0; i2 < na2; ++i2)
x2[i2] = interpolate$1(a2[i2], b2[i2]);
for (; i2 < nb2; ++i2)
c2[i2] = b2[i2];
return function(t5) {
for (i2 = 0; i2 < na2; ++i2)
c2[i2] = x2[i2](t5);
return c2;
};
}
function date$1(a2, b2) {
var d2 = /* @__PURE__ */ new Date();
return a2 = +a2, b2 = +b2, function(t5) {
return d2.setTime(a2 * (1 - t5) + b2 * t5), d2;
};
}
function interpolateNumber(a2, b2) {
return a2 = +a2, b2 = +b2, function(t5) {
return a2 * (1 - t5) + b2 * t5;
};
}
function object(a2, b2) {
var i2 = {}, c2 = {}, k2;
if (a2 === null || typeof a2 !== "object")
a2 = {};
if (b2 === null || typeof b2 !== "object")
b2 = {};
for (k2 in b2) {
if (k2 in a2) {
i2[k2] = interpolate$1(a2[k2], b2[k2]);
} else {
c2[k2] = b2[k2];
}
}
return function(t5) {
for (k2 in i2)
c2[k2] = i2[k2](t5);
return c2;
};
}
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
function zero$3(b2) {
return function() {
return b2;
};
}
function one$1(b2) {
return function(t5) {
return b2(t5) + "";
};
}
function string(a2, b2) {
var bi2 = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s2 = [], q2 = [];
a2 = a2 + "", b2 = b2 + "";
while ((am = reA.exec(a2)) && (bm = reB.exec(b2))) {
if ((bs = bm.index) > bi2) {
bs = b2.slice(bi2, bs);
if (s2[i2])
s2[i2] += bs;
else
s2[++i2] = bs;
}
if ((am = am[0]) === (bm = bm[0])) {
if (s2[i2])
s2[i2] += bm;
else
s2[++i2] = bm;
} else {
s2[++i2] = null;
q2.push({ i: i2, x: interpolateNumber(am, bm) });
}
bi2 = reB.lastIndex;
}
if (bi2 < b2.length) {
bs = b2.slice(bi2);
if (s2[i2])
s2[i2] += bs;
else
s2[++i2] = bs;
}
return s2.length < 2 ? q2[0] ? one$1(q2[0].x) : zero$3(b2) : (b2 = q2.length, function(t5) {
for (var i3 = 0, o2; i3 < b2; ++i3)
s2[(o2 = q2[i3]).i] = o2.x(t5);
return s2.join("");
});
}
function interpolate$1(a2, b2) {
var t5 = typeof b2, c2;
return b2 == null || t5 === "boolean" ? constant$3(b2) : (t5 === "number" ? interpolateNumber : t5 === "string" ? (c2 = color$5(b2)) ? (b2 = c2, rgb$2) : string : b2 instanceof color$5 ? rgb$2 : b2 instanceof Date ? date$1 : isNumberArray(b2) ? numberArray : Array.isArray(b2) ? genericArray : typeof b2.valueOf !== "function" && typeof b2.toString !== "function" || isNaN(b2) ? object : interpolateNumber)(a2, b2);
}
function discrete$1(range2) {
var n2 = range2.length;
return function(t5) {
return range2[Math.max(0, Math.min(n2 - 1, Math.floor(t5 * n2)))];
};
}
function hue(a2, b2) {
var i2 = hue$1(+a2, +b2);
return function(t5) {
var x2 = i2(t5);
return x2 - 360 * Math.floor(x2 / 360);
};
}
function interpolateRound(a2, b2) {
return a2 = +a2, b2 = +b2, function(t5) {
return Math.round(a2 * (1 - t5) + b2 * t5);
};
}
var degrees$1 = 180 / Math.PI;
var identity$3 = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function decompose(a2, b2, c2, d2, e7, f2) {
var scaleX, scaleY2, skewX;
if (scaleX = Math.sqrt(a2 * a2 + b2 * b2))
a2 /= scaleX, b2 /= scaleX;
if (skewX = a2 * c2 + b2 * d2)
c2 -= a2 * skewX, d2 -= b2 * skewX;
if (scaleY2 = Math.sqrt(c2 * c2 + d2 * d2))
c2 /= scaleY2, d2 /= scaleY2, skewX /= scaleY2;
if (a2 * d2 < b2 * c2)
a2 = -a2, b2 = -b2, skewX = -skewX, scaleX = -scaleX;
return {
translateX: e7,
translateY: f2,
rotate: Math.atan2(b2, a2) * degrees$1,
skewX: Math.atan(skewX) * degrees$1,
scaleX,
scaleY: scaleY2
};
}
var svgNode;
function parseCss(value2) {
const m2 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value2 + "");
return m2.isIdentity ? identity$3 : decompose(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);
}
function parseSvg(value2) {
if (value2 == null)
return identity$3;
if (!svgNode)
svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
svgNode.setAttribute("transform", value2);
if (!(value2 = svgNode.transform.baseVal.consolidate()))
return identity$3;
value2 = value2.matrix;
return decompose(value2.a, value2.b, value2.c, value2.d, value2.e, value2.f);
}
function interpolateTransform(parse2, pxComma, pxParen, degParen) {
function pop(s2) {
return s2.length ? s2.pop() + " " : "";
}
function translate2(xa2, ya2, xb2, yb2, s2, q2) {
if (xa2 !== xb2 || ya2 !== yb2) {
var i2 = s2.push("translate(", null, pxComma, null, pxParen);
q2.push({ i: i2 - 4, x: interpolateNumber(xa2, xb2) }, { i: i2 - 2, x: interpolateNumber(ya2, yb2) });
} else if (xb2 || yb2) {
s2.push("translate(" + xb2 + pxComma + yb2 + pxParen);
}
}
function rotate2(a2, b2, s2, q2) {
if (a2 !== b2) {
if (a2 - b2 > 180)
b2 += 360;
else if (b2 - a2 > 180)
a2 += 360;
q2.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: interpolateNumber(a2, b2) });
} else if (b2) {
s2.push(pop(s2) + "rotate(" + b2 + degParen);
}
}
function skewX(a2, b2, s2, q2) {
if (a2 !== b2) {
q2.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: interpolateNumber(a2, b2) });
} else if (b2) {
s2.push(pop(s2) + "skewX(" + b2 + degParen);
}
}
function scale2(xa2, ya2, xb2, yb2, s2, q2) {
if (xa2 !== xb2 || ya2 !== yb2) {
var i2 = s2.push(pop(s2) + "scale(", null, ",", null, ")");
q2.push({ i: i2 - 4, x: interpolateNumber(xa2, xb2) }, { i: i2 - 2, x: interpolateNumber(ya2, yb2) });
} else if (xb2 !== 1 || yb2 !== 1) {
s2.push(pop(s2) + "scale(" + xb2 + "," + yb2 + ")");
}
}
return function(a2, b2) {
var s2 = [], q2 = [];
a2 = parse2(a2), b2 = parse2(b2);
translate2(a2.translateX, a2.translateY, b2.translateX, b2.translateY, s2, q2);
rotate2(a2.rotate, b2.rotate, s2, q2);
skewX(a2.skewX, b2.skewX, s2, q2);
scale2(a2.scaleX, a2.scaleY, b2.scaleX, b2.scaleY, s2, q2);
a2 = b2 = null;
return function(t5) {
var i2 = -1, n2 = q2.length, o2;
while (++i2 < n2)
s2[(o2 = q2[i2]).i] = o2.x(t5);
return s2.join("");
};
};
}
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
var epsilon2$1 = 1e-12;
function cosh(x2) {
return ((x2 = Math.exp(x2)) + 1 / x2) / 2;
}
function sinh(x2) {
return ((x2 = Math.exp(x2)) - 1 / x2) / 2;
}
function tanh(x2) {
return ((x2 = Math.exp(2 * x2)) - 1) / (x2 + 1);
}
const zoom = function zoomRho(rho, rho2, rho4) {
function zoom2(p02, p1) {
var ux0 = p02[0], uy0 = p02[1], w0 = p02[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i2, S2;
if (d2 < epsilon2$1) {
S2 = Math.log(w1 / w0) / rho;
i2 = function(t5) {
return [
ux0 + t5 * dx,
uy0 + t5 * dy,
w0 * Math.exp(rho * t5 * S2)
];
};
} else {
var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
S2 = (r1 - r0) / rho;
i2 = function(t5) {
var s2 = t5 * S2, coshr0 = cosh(r0), u2 = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
return [
ux0 + u2 * dx,
uy0 + u2 * dy,
w0 * coshr0 / cosh(rho * s2 + r0)
];
};
}
i2.duration = S2 * 1e3 * rho / Math.SQRT2;
return i2;
}
zoom2.rho = function(_24) {
var _1 = Math.max(1e-3, +_24), _25 = _1 * _1, _42 = _25 * _25;
return zoomRho(_1, _25, _42);
};
return zoom2;
}(Math.SQRT2, 2, 4);
function hsl$2(hue2) {
return function(start2, end2) {
var h2 = hue2((start2 = hsl$4(start2)).h, (end2 = hsl$4(end2)).h), s2 = nogamma$1(start2.s, end2.s), l2 = nogamma$1(start2.l, end2.l), opacity2 = nogamma$1(start2.opacity, end2.opacity);
return function(t5) {
start2.h = h2(t5);
start2.s = s2(t5);
start2.l = l2(t5);
start2.opacity = opacity2(t5);
return start2 + "";
};
};
}
const hsl$3 = hsl$2(hue$1);
var hslLong = hsl$2(nogamma$1);
function lab(start2, end2) {
var l2 = nogamma$1((start2 = lab$1(start2)).l, (end2 = lab$1(end2)).l), a2 = nogamma$1(start2.a, end2.a), b2 = nogamma$1(start2.b, end2.b), opacity2 = nogamma$1(start2.opacity, end2.opacity);
return function(t5) {
start2.l = l2(t5);
start2.a = a2(t5);
start2.b = b2(t5);
start2.opacity = opacity2(t5);
return start2 + "";
};
}
function hcl(hue2) {
return function(start2, end2) {
var h2 = hue2((start2 = hcl$2(start2)).h, (end2 = hcl$2(end2)).h), c2 = nogamma$1(start2.c, end2.c), l2 = nogamma$1(start2.l, end2.l), opacity2 = nogamma$1(start2.opacity, end2.opacity);
return function(t5) {
start2.h = h2(t5);
start2.c = c2(t5);
start2.l = l2(t5);
start2.opacity = opacity2(t5);
return start2 + "";
};
};
}
const hcl$1 = hcl(hue$1);
var hclLong = hcl(nogamma$1);
function cubehelix(hue2) {
return function cubehelixGamma(y2) {
y2 = +y2;
function cubehelix2(start2, end2) {
var h2 = hue2((start2 = cubehelix$2(start2)).h, (end2 = cubehelix$2(end2)).h), s2 = nogamma$1(start2.s, end2.s), l2 = nogamma$1(start2.l, end2.l), opacity2 = nogamma$1(start2.opacity, end2.opacity);
return function(t5) {
start2.h = h2(t5);
start2.s = s2(t5);
start2.l = l2(Math.pow(t5, y2));
start2.opacity = opacity2(t5);
return start2 + "";
};
}
cubehelix2.gamma = cubehelixGamma;
return cubehelix2;
}(1);
}
const cubehelix$1 = cubehelix(hue$1);
var cubehelixLong = cubehelix(nogamma$1);
function piecewise(interpolate2, values2) {
if (values2 === void 0)
values2 = interpolate2, interpolate2 = interpolate$1;
var i2 = 0, n2 = values2.length - 1, v2 = values2[0], I2 = new Array(n2 < 0 ? 0 : n2);
while (i2 < n2)
I2[i2] = interpolate2(v2, v2 = values2[++i2]);
return function(t5) {
var i3 = Math.max(0, Math.min(n2 - 1, Math.floor(t5 *= n2)));
return I2[i3](t5 - i3);
};
}
function quantize$2(interpolator, n2) {
var samples = new Array(n2);
for (var i2 = 0; i2 < n2; ++i2)
samples[i2] = interpolator(i2 / (n2 - 1));
return samples;
}
const $$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
interpolate: interpolate$1,
interpolateArray: array$3,
interpolateBasis: basis$3,
interpolateBasisClosed: basisClosed,
interpolateCubehelix: cubehelix$1,
interpolateCubehelixLong: cubehelixLong,
interpolateDate: date$1,
interpolateDiscrete: discrete$1,
interpolateHcl: hcl$1,
interpolateHclLong: hclLong,
interpolateHsl: hsl$3,
interpolateHslLong: hslLong,
interpolateHue: hue,
interpolateLab: lab,
interpolateNumber,
interpolateNumberArray: numberArray,
interpolateObject: object,
interpolateRgb: rgb$2,
interpolateRgbBasis: rgbBasis$1,
interpolateRgbBasisClosed: rgbBasisClosed,
interpolateRound,
interpolateString: string,
interpolateTransformCss,
interpolateTransformSvg,
interpolateZoom: zoom,
piecewise,
quantize: quantize$2
}, Symbol.toStringTag, { value: "Module" }));
function constants(x2) {
return function() {
return x2;
};
}
function number$6(x2) {
return +x2;
}
var unit = [0, 1];
function identity$2(x2) {
return x2;
}
function normalize$2(a2, b2) {
return (b2 -= a2 = +a2) ? function(x2) {
return (x2 - a2) / b2;
} : constants(isNaN(b2) ? NaN : 0.5);
}
function clamper(a2, b2) {
var t5;
if (a2 > b2)
t5 = a2, a2 = b2, b2 = t5;
return function(x2) {
return Math.max(a2, Math.min(b2, x2));
};
}
function bimap(domain2, range2, interpolate2) {
var d0 = domain2[0], d1 = domain2[1], r0 = range2[0], r1 = range2[1];
if (d1 < d0)
d0 = normalize$2(d1, d0), r0 = interpolate2(r1, r0);
else
d0 = normalize$2(d0, d1), r0 = interpolate2(r0, r1);
return function(x2) {
return r0(d0(x2));
};
}
function polymap(domain2, range2, interpolate2) {
var j2 = Math.min(domain2.length, range2.length) - 1, d2 = new Array(j2), r2 = new Array(j2), i2 = -1;
if (domain2[j2] < domain2[0]) {
domain2 = domain2.slice().reverse();
range2 = range2.slice().reverse();
}
while (++i2 < j2) {
d2[i2] = normalize$2(domain2[i2], domain2[i2 + 1]);
r2[i2] = interpolate2(range2[i2], range2[i2 + 1]);
}
return function(x2) {
var i3 = bisect$2(domain2, x2, 1, j2) - 1;
return r2[i3](d2[i3](x2));
};
}
function copy$2(source2, target2) {
return target2.domain(source2.domain()).range(source2.range()).interpolate(source2.interpolate()).clamp(source2.clamp()).unknown(source2.unknown());
}
function transformer$3() {
var domain2 = unit, range2 = unit, interpolate2 = interpolate$1, transform2, untransform, unknown, clamp2 = identity$2, piecewise2, output3, input;
function rescale() {
var n2 = Math.min(domain2.length, range2.length);
if (clamp2 !== identity$2)
clamp2 = clamper(domain2[0], domain2[n2 - 1]);
piecewise2 = n2 > 2 ? polymap : bimap;
output3 = input = null;
return scale2;
}
function scale2(x2) {
return x2 == null || isNaN(x2 = +x2) ? unknown : (output3 || (output3 = piecewise2(domain2.map(transform2), range2, interpolate2)))(transform2(clamp2(x2)));
}
scale2.invert = function(y2) {
return clamp2(untransform((input || (input = piecewise2(range2, domain2.map(transform2), interpolateNumber)))(y2)));
};
scale2.domain = function(_24) {
return arguments.length ? (domain2 = Array.from(_24, number$6), rescale()) : domain2.slice();
};
scale2.range = function(_24) {
return arguments.length ? (range2 = Array.from(_24), rescale()) : range2.slice();
};
scale2.rangeRound = function(_24) {
return range2 = Array.from(_24), interpolate2 = interpolateRound, rescale();
};
scale2.clamp = function(_24) {
return arguments.length ? (clamp2 = _24 ? true : identity$2, rescale()) : clamp2 !== identity$2;
};
scale2.interpolate = function(_24) {
return arguments.length ? (interpolate2 = _24, rescale()) : interpolate2;
};
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
return function(t5, u2) {
transform2 = t5, untransform = u2;
return rescale();
};
}
function continuous$1() {
return transformer$3()(identity$2, identity$2);
}
function tickFormat$1(start2, stop2, count2, specifier) {
var step = tickStep$2(start2, stop2, count2), precision;
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
switch (specifier.type) {
case "s": {
var value2 = Math.max(Math.abs(start2), Math.abs(stop2));
if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value2)))
specifier.precision = precision;
return formatPrefix(specifier, value2);
}
case "":
case "e":
case "g":
case "p":
case "r": {
if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start2), Math.abs(stop2)))))
specifier.precision = precision - (specifier.type === "e");
break;
}
case "f":
case "%": {
if (specifier.precision == null && !isNaN(precision = precisionFixed(step)))
specifier.precision = precision - (specifier.type === "%") * 2;
break;
}
}
return format$3(specifier);
}
function linearish(scale2) {
var domain2 = scale2.domain;
scale2.ticks = function(count2) {
var d2 = domain2();
return ticks(d2[0], d2[d2.length - 1], count2 == null ? 10 : count2);
};
scale2.tickFormat = function(count2, specifier) {
var d2 = domain2();
return tickFormat$1(d2[0], d2[d2.length - 1], count2 == null ? 10 : count2, specifier);
};
scale2.nice = function(count2) {
if (count2 == null)
count2 = 10;
var d2 = domain2();
var i0 = 0;
var i1 = d2.length - 1;
var start2 = d2[i0];
var stop2 = d2[i1];
var prestep;
var step;
var maxIter = 10;
if (stop2 < start2) {
step = start2, start2 = stop2, stop2 = step;
step = i0, i0 = i1, i1 = step;
}
while (maxIter-- > 0) {
step = tickIncrement$2(start2, stop2, count2);
if (step === prestep) {
d2[i0] = start2;
d2[i1] = stop2;
return domain2(d2);
} else if (step > 0) {
start2 = Math.floor(start2 / step) * step;
stop2 = Math.ceil(stop2 / step) * step;
} else if (step < 0) {
start2 = Math.ceil(start2 * step) / step;
stop2 = Math.floor(stop2 * step) / step;
} else {
break;
}
prestep = step;
}
return scale2;
};
return scale2;
}
function linear$1() {
var scale2 = continuous$1();
scale2.copy = function() {
return copy$2(scale2, linear$1());
};
initRange.apply(scale2, arguments);
return linearish(scale2);
}
function identity$1(domain2) {
var unknown;
function scale2(x2) {
return x2 == null || isNaN(x2 = +x2) ? unknown : x2;
}
scale2.invert = scale2;
scale2.domain = scale2.range = function(_24) {
return arguments.length ? (domain2 = Array.from(_24, number$6), scale2) : domain2.slice();
};
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
scale2.copy = function() {
return identity$1(domain2).unknown(unknown);
};
domain2 = arguments.length ? Array.from(domain2, number$6) : [0, 1];
return linearish(scale2);
}
function nice(domain2, interval2) {
domain2 = domain2.slice();
var i0 = 0, i1 = domain2.length - 1, x02 = domain2[i0], x12 = domain2[i1], t5;
if (x12 < x02) {
t5 = i0, i0 = i1, i1 = t5;
t5 = x02, x02 = x12, x12 = t5;
}
domain2[i0] = interval2.floor(x02);
domain2[i1] = interval2.ceil(x12);
return domain2;
}
function transformLog(x2) {
return Math.log(x2);
}
function transformExp(x2) {
return Math.exp(x2);
}
function transformLogn(x2) {
return -Math.log(-x2);
}
function transformExpn(x2) {
return -Math.exp(-x2);
}
function pow10(x2) {
return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2;
}
function powp(base2) {
return base2 === 10 ? pow10 : base2 === Math.E ? Math.exp : (x2) => Math.pow(base2, x2);
}
function logp(base2) {
return base2 === Math.E ? Math.log : base2 === 10 && Math.log10 || base2 === 2 && Math.log2 || (base2 = Math.log(base2), (x2) => Math.log(x2) / base2);
}
function reflect(f2) {
return (x2, k2) => -f2(-x2, k2);
}
function loggish(transform2) {
const scale2 = transform2(transformLog, transformExp);
const domain2 = scale2.domain;
let base2 = 10;
let logs;
let pows;
function rescale() {
logs = logp(base2), pows = powp(base2);
if (domain2()[0] < 0) {
logs = reflect(logs), pows = reflect(pows);
transform2(transformLogn, transformExpn);
} else {
transform2(transformLog, transformExp);
}
return scale2;
}
scale2.base = function(_24) {
return arguments.length ? (base2 = +_24, rescale()) : base2;
};
scale2.domain = function(_24) {
return arguments.length ? (domain2(_24), rescale()) : domain2();
};
scale2.ticks = (count2) => {
const d2 = domain2();
let u2 = d2[0];
let v2 = d2[d2.length - 1];
const r2 = v2 < u2;
if (r2)
[u2, v2] = [v2, u2];
let i2 = logs(u2);
let j2 = logs(v2);
let k2;
let t5;
const n2 = count2 == null ? 10 : +count2;
let z2 = [];
if (!(base2 % 1) && j2 - i2 < n2) {
i2 = Math.floor(i2), j2 = Math.ceil(j2);
if (u2 > 0)
for (; i2 <= j2; ++i2) {
for (k2 = 1; k2 < base2; ++k2) {
t5 = i2 < 0 ? k2 / pows(-i2) : k2 * pows(i2);
if (t5 < u2)
continue;
if (t5 > v2)
break;
z2.push(t5);
}
}
else
for (; i2 <= j2; ++i2) {
for (k2 = base2 - 1; k2 >= 1; --k2) {
t5 = i2 > 0 ? k2 / pows(-i2) : k2 * pows(i2);
if (t5 < u2)
continue;
if (t5 > v2)
break;
z2.push(t5);
}
}
if (z2.length * 2 < n2)
z2 = ticks(u2, v2, n2);
} else {
z2 = ticks(i2, j2, Math.min(j2 - i2, n2)).map(pows);
}
return r2 ? z2.reverse() : z2;
};
scale2.tickFormat = (count2, specifier) => {
if (count2 == null)
count2 = 10;
if (specifier == null)
specifier = base2 === 10 ? "s" : ",";
if (typeof specifier !== "function") {
if (!(base2 % 1) && (specifier = formatSpecifier(specifier)).precision == null)
specifier.trim = true;
specifier = format$3(specifier);
}
if (count2 === Infinity)
return specifier;
const k2 = Math.max(1, base2 * count2 / scale2.ticks().length);
return (d2) => {
let i2 = d2 / pows(Math.round(logs(d2)));
if (i2 * base2 < base2 - 0.5)
i2 *= base2;
return i2 <= k2 ? specifier(d2) : "";
};
};
scale2.nice = () => {
return domain2(nice(domain2(), {
floor: (x2) => pows(Math.floor(logs(x2))),
ceil: (x2) => pows(Math.ceil(logs(x2)))
}));
};
return scale2;
}
function log$2() {
const scale2 = loggish(transformer$3()).domain([1, 10]);
scale2.copy = () => copy$2(scale2, log$2()).base(scale2.base());
initRange.apply(scale2, arguments);
return scale2;
}
function transformSymlog(c2) {
return function(x2) {
return Math.sign(x2) * Math.log1p(Math.abs(x2 / c2));
};
}
function transformSymexp(c2) {
return function(x2) {
return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c2;
};
}
function symlogish(transform2) {
var c2 = 1, scale2 = transform2(transformSymlog(c2), transformSymexp(c2));
scale2.constant = function(_24) {
return arguments.length ? transform2(transformSymlog(c2 = +_24), transformSymexp(c2)) : c2;
};
return linearish(scale2);
}
function symlog() {
var scale2 = symlogish(transformer$3());
scale2.copy = function() {
return copy$2(scale2, symlog()).constant(scale2.constant());
};
return initRange.apply(scale2, arguments);
}
function transformPow(exponent2) {
return function(x2) {
return x2 < 0 ? -Math.pow(-x2, exponent2) : Math.pow(x2, exponent2);
};
}
function transformSqrt(x2) {
return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2);
}
function transformSquare(x2) {
return x2 < 0 ? -x2 * x2 : x2 * x2;
}
function powish(transform2) {
var scale2 = transform2(identity$2, identity$2), exponent2 = 1;
function rescale() {
return exponent2 === 1 ? transform2(identity$2, identity$2) : exponent2 === 0.5 ? transform2(transformSqrt, transformSquare) : transform2(transformPow(exponent2), transformPow(1 / exponent2));
}
scale2.exponent = function(_24) {
return arguments.length ? (exponent2 = +_24, rescale()) : exponent2;
};
return linearish(scale2);
}
function pow$2() {
var scale2 = powish(transformer$3());
scale2.copy = function() {
return copy$2(scale2, pow$2()).exponent(scale2.exponent());
};
initRange.apply(scale2, arguments);
return scale2;
}
function sqrt$2() {
return pow$2.apply(null, arguments).exponent(0.5);
}
function quantile() {
var domain2 = [], range2 = [], thresholds = [], unknown;
function rescale() {
var i2 = 0, n2 = Math.max(1, range2.length);
thresholds = new Array(n2 - 1);
while (++i2 < n2)
thresholds[i2 - 1] = quantileSorted$1(domain2, i2 / n2);
return scale2;
}
function scale2(x2) {
return x2 == null || isNaN(x2 = +x2) ? unknown : range2[bisect$2(thresholds, x2)];
}
scale2.invertExtent = function(y2) {
var i2 = range2.indexOf(y2);
return i2 < 0 ? [NaN, NaN] : [
i2 > 0 ? thresholds[i2 - 1] : domain2[0],
i2 < thresholds.length ? thresholds[i2] : domain2[domain2.length - 1]
];
};
scale2.domain = function(_24) {
if (!arguments.length)
return domain2.slice();
domain2 = [];
for (let d2 of _24)
if (d2 != null && !isNaN(d2 = +d2))
domain2.push(d2);
domain2.sort(ascending$6);
return rescale();
};
scale2.range = function(_24) {
return arguments.length ? (range2 = Array.from(_24), rescale()) : range2.slice();
};
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
scale2.quantiles = function() {
return thresholds.slice();
};
scale2.copy = function() {
return quantile().domain(domain2).range(range2).unknown(unknown);
};
return initRange.apply(scale2, arguments);
}
function quantize$1() {
var x02 = 0, x12 = 1, n2 = 1, domain2 = [0.5], range2 = [0, 1], unknown;
function scale2(x2) {
return x2 != null && x2 <= x2 ? range2[bisect$2(domain2, x2, 0, n2)] : unknown;
}
function rescale() {
var i2 = -1;
domain2 = new Array(n2);
while (++i2 < n2)
domain2[i2] = ((i2 + 1) * x12 - (i2 - n2) * x02) / (n2 + 1);
return scale2;
}
scale2.domain = function(_24) {
return arguments.length ? ([x02, x12] = _24, x02 = +x02, x12 = +x12, rescale()) : [x02, x12];
};
scale2.range = function(_24) {
return arguments.length ? (n2 = (range2 = Array.from(_24)).length - 1, rescale()) : range2.slice();
};
scale2.invertExtent = function(y2) {
var i2 = range2.indexOf(y2);
return i2 < 0 ? [NaN, NaN] : i2 < 1 ? [x02, domain2[0]] : i2 >= n2 ? [domain2[n2 - 1], x12] : [domain2[i2 - 1], domain2[i2]];
};
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : scale2;
};
scale2.thresholds = function() {
return domain2.slice();
};
scale2.copy = function() {
return quantize$1().domain([x02, x12]).range(range2).unknown(unknown);
};
return initRange.apply(linearish(scale2), arguments);
}
function threshold() {
var domain2 = [0.5], range2 = [0, 1], unknown, n2 = 1;
function scale2(x2) {
return x2 != null && x2 <= x2 ? range2[bisect$2(domain2, x2, 0, n2)] : unknown;
}
scale2.domain = function(_24) {
return arguments.length ? (domain2 = Array.from(_24), n2 = Math.min(domain2.length, range2.length - 1), scale2) : domain2.slice();
};
scale2.range = function(_24) {
return arguments.length ? (range2 = Array.from(_24), n2 = Math.min(domain2.length, range2.length - 1), scale2) : range2.slice();
};
scale2.invertExtent = function(y2) {
var i2 = range2.indexOf(y2);
return [domain2[i2 - 1], domain2[i2]];
};
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
scale2.copy = function() {
return threshold().domain(domain2).range(range2).unknown(unknown);
};
return initRange.apply(scale2, arguments);
}
function localDate(d2) {
if (0 <= d2.y && d2.y < 100) {
var date2 = new Date(-1, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L);
date2.setFullYear(d2.y);
return date2;
}
return new Date(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L);
}
function utcDate(d2) {
if (0 <= d2.y && d2.y < 100) {
var date2 = new Date(Date.UTC(-1, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L));
date2.setUTCFullYear(d2.y);
return date2;
}
return new Date(Date.UTC(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L));
}
function newDate(y2, m2, d2) {
return { y: y2, m: m2, d: d2, H: 0, M: 0, S: 0, L: 0 };
}
function formatLocale(locale2) {
var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths;
var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
var formats2 = {
"a": formatShortWeekday,
"A": formatWeekday,
"b": formatShortMonth,
"B": formatMonth,
"c": null,
"d": formatDayOfMonth,
"e": formatDayOfMonth,
"f": formatMicroseconds,
"g": formatYearISO,
"G": formatFullYearISO,
"H": formatHour24,
"I": formatHour12,
"j": formatDayOfYear,
"L": formatMilliseconds,
"m": formatMonthNumber,
"M": formatMinutes,
"p": formatPeriod,
"q": formatQuarter,
"Q": formatUnixTimestamp,
"s": formatUnixTimestampSeconds,
"S": formatSeconds,
"u": formatWeekdayNumberMonday,
"U": formatWeekNumberSunday,
"V": formatWeekNumberISO,
"w": formatWeekdayNumberSunday,
"W": formatWeekNumberMonday,
"x": null,
"X": null,
"y": formatYear,
"Y": formatFullYear,
"Z": formatZone,
"%": formatLiteralPercent
};
var utcFormats = {
"a": formatUTCShortWeekday,
"A": formatUTCWeekday,
"b": formatUTCShortMonth,
"B": formatUTCMonth,
"c": null,
"d": formatUTCDayOfMonth,
"e": formatUTCDayOfMonth,
"f": formatUTCMicroseconds,
"g": formatUTCYearISO,
"G": formatUTCFullYearISO,
"H": formatUTCHour24,
"I": formatUTCHour12,
"j": formatUTCDayOfYear,
"L": formatUTCMilliseconds,
"m": formatUTCMonthNumber,
"M": formatUTCMinutes,
"p": formatUTCPeriod,
"q": formatUTCQuarter,
"Q": formatUnixTimestamp,
"s": formatUnixTimestampSeconds,
"S": formatUTCSeconds,
"u": formatUTCWeekdayNumberMonday,
"U": formatUTCWeekNumberSunday,
"V": formatUTCWeekNumberISO,
"w": formatUTCWeekdayNumberSunday,
"W": formatUTCWeekNumberMonday,
"x": null,
"X": null,
"y": formatUTCYear,
"Y": formatUTCFullYear,
"Z": formatUTCZone,
"%": formatLiteralPercent
};
var parses = {
"a": parseShortWeekday,
"A": parseWeekday,
"b": parseShortMonth,
"B": parseMonth,
"c": parseLocaleDateTime,
"d": parseDayOfMonth,
"e": parseDayOfMonth,
"f": parseMicroseconds,
"g": parseYear,
"G": parseFullYear,
"H": parseHour24,
"I": parseHour24,
"j": parseDayOfYear,
"L": parseMilliseconds,
"m": parseMonthNumber,
"M": parseMinutes,
"p": parsePeriod,
"q": parseQuarter,
"Q": parseUnixTimestamp,
"s": parseUnixTimestampSeconds,
"S": parseSeconds,
"u": parseWeekdayNumberMonday,
"U": parseWeekNumberSunday,
"V": parseWeekNumberISO,
"w": parseWeekdayNumberSunday,
"W": parseWeekNumberMonday,
"x": parseLocaleDate,
"X": parseLocaleTime,
"y": parseYear,
"Y": parseFullYear,
"Z": parseZone,
"%": parseLiteralPercent
};
formats2.x = newFormat(locale_date, formats2);
formats2.X = newFormat(locale_time, formats2);
formats2.c = newFormat(locale_dateTime, formats2);
utcFormats.x = newFormat(locale_date, utcFormats);
utcFormats.X = newFormat(locale_time, utcFormats);
utcFormats.c = newFormat(locale_dateTime, utcFormats);
function newFormat(specifier, formats3) {
return function(date2) {
var string2 = [], i2 = -1, j2 = 0, n2 = specifier.length, c2, pad2, format2;
if (!(date2 instanceof Date))
date2 = /* @__PURE__ */ new Date(+date2);
while (++i2 < n2) {
if (specifier.charCodeAt(i2) === 37) {
string2.push(specifier.slice(j2, i2));
if ((pad2 = pads[c2 = specifier.charAt(++i2)]) != null)
c2 = specifier.charAt(++i2);
else
pad2 = c2 === "e" ? " " : "0";
if (format2 = formats3[c2])
c2 = format2(date2, pad2);
string2.push(c2);
j2 = i2 + 1;
}
}
string2.push(specifier.slice(j2, i2));
return string2.join("");
};
}
function newParse(specifier, Z3) {
return function(string2) {
var d2 = newDate(1900, void 0, 1), i2 = parseSpecifier(d2, specifier, string2 += "", 0), week2, day2;
if (i2 != string2.length)
return null;
if ("Q" in d2)
return new Date(d2.Q);
if ("s" in d2)
return new Date(d2.s * 1e3 + ("L" in d2 ? d2.L : 0));
if (Z3 && !("Z" in d2))
d2.Z = 0;
if ("p" in d2)
d2.H = d2.H % 12 + d2.p * 12;
if (d2.m === void 0)
d2.m = "q" in d2 ? d2.q : 0;
if ("V" in d2) {
if (d2.V < 1 || d2.V > 53)
return null;
if (!("w" in d2))
d2.w = 1;
if ("Z" in d2) {
week2 = utcDate(newDate(d2.y, 0, 1)), day2 = week2.getUTCDay();
week2 = day2 > 4 || day2 === 0 ? utcMonday.ceil(week2) : utcMonday(week2);
week2 = utcDay$1.offset(week2, (d2.V - 1) * 7);
d2.y = week2.getUTCFullYear();
d2.m = week2.getUTCMonth();
d2.d = week2.getUTCDate() + (d2.w + 6) % 7;
} else {
week2 = localDate(newDate(d2.y, 0, 1)), day2 = week2.getDay();
week2 = day2 > 4 || day2 === 0 ? monday.ceil(week2) : monday(week2);
week2 = timeDay.offset(week2, (d2.V - 1) * 7);
d2.y = week2.getFullYear();
d2.m = week2.getMonth();
d2.d = week2.getDate() + (d2.w + 6) % 7;
}
} else if ("W" in d2 || "U" in d2) {
if (!("w" in d2))
d2.w = "u" in d2 ? d2.u % 7 : "W" in d2 ? 1 : 0;
day2 = "Z" in d2 ? utcDate(newDate(d2.y, 0, 1)).getUTCDay() : localDate(newDate(d2.y, 0, 1)).getDay();
d2.m = 0;
d2.d = "W" in d2 ? (d2.w + 6) % 7 + d2.W * 7 - (day2 + 5) % 7 : d2.w + d2.U * 7 - (day2 + 6) % 7;
}
if ("Z" in d2) {
d2.H += d2.Z / 100 | 0;
d2.M += d2.Z % 100;
return utcDate(d2);
}
return localDate(d2);
};
}
function parseSpecifier(d2, specifier, string2, j2) {
var i2 = 0, n2 = specifier.length, m2 = string2.length, c2, parse2;
while (i2 < n2) {
if (j2 >= m2)
return -1;
c2 = specifier.charCodeAt(i2++);
if (c2 === 37) {
c2 = specifier.charAt(i2++);
parse2 = parses[c2 in pads ? specifier.charAt(i2++) : c2];
if (!parse2 || (j2 = parse2(d2, string2, j2)) < 0)
return -1;
} else if (c2 != string2.charCodeAt(j2++)) {
return -1;
}
}
return j2;
}
function parsePeriod(d2, string2, i2) {
var n2 = periodRe.exec(string2.slice(i2));
return n2 ? (d2.p = periodLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseShortWeekday(d2, string2, i2) {
var n2 = shortWeekdayRe.exec(string2.slice(i2));
return n2 ? (d2.w = shortWeekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseWeekday(d2, string2, i2) {
var n2 = weekdayRe.exec(string2.slice(i2));
return n2 ? (d2.w = weekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseShortMonth(d2, string2, i2) {
var n2 = shortMonthRe.exec(string2.slice(i2));
return n2 ? (d2.m = shortMonthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseMonth(d2, string2, i2) {
var n2 = monthRe.exec(string2.slice(i2));
return n2 ? (d2.m = monthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
}
function parseLocaleDateTime(d2, string2, i2) {
return parseSpecifier(d2, locale_dateTime, string2, i2);
}
function parseLocaleDate(d2, string2, i2) {
return parseSpecifier(d2, locale_date, string2, i2);
}
function parseLocaleTime(d2, string2, i2) {
return parseSpecifier(d2, locale_time, string2, i2);
}
function formatShortWeekday(d2) {
return locale_shortWeekdays[d2.getDay()];
}
function formatWeekday(d2) {
return locale_weekdays[d2.getDay()];
}
function formatShortMonth(d2) {
return locale_shortMonths[d2.getMonth()];
}
function formatMonth(d2) {
return locale_months[d2.getMonth()];
}
function formatPeriod(d2) {
return locale_periods[+(d2.getHours() >= 12)];
}
function formatQuarter(d2) {
return 1 + ~~(d2.getMonth() / 3);
}
function formatUTCShortWeekday(d2) {
return locale_shortWeekdays[d2.getUTCDay()];
}
function formatUTCWeekday(d2) {
return locale_weekdays[d2.getUTCDay()];
}
function formatUTCShortMonth(d2) {
return locale_shortMonths[d2.getUTCMonth()];
}
function formatUTCMonth(d2) {
return locale_months[d2.getUTCMonth()];
}
function formatUTCPeriod(d2) {
return locale_periods[+(d2.getUTCHours() >= 12)];
}
function formatUTCQuarter(d2) {
return 1 + ~~(d2.getUTCMonth() / 3);
}
return {
format: function(specifier) {
var f2 = newFormat(specifier += "", formats2);
f2.toString = function() {
return specifier;
};
return f2;
},
parse: function(specifier) {
var p2 = newParse(specifier += "", false);
p2.toString = function() {
return specifier;
};
return p2;
},
utcFormat: function(specifier) {
var f2 = newFormat(specifier += "", utcFormats);
f2.toString = function() {
return specifier;
};
return f2;
},
utcParse: function(specifier) {
var p2 = newParse(specifier += "", true);
p2.toString = function() {
return specifier;
};
return p2;
}
};
}
var pads = { "-": "", "_": " ", "0": "0" }, numberRe = /^\s*\d+/, percentRe = /^%/, requoteRe = /[\\^$*+?|[\]().{}]/g;
function pad(value2, fill2, width2) {
var sign2 = value2 < 0 ? "-" : "", string2 = (sign2 ? -value2 : value2) + "", length2 = string2.length;
return sign2 + (length2 < width2 ? new Array(width2 - length2 + 1).join(fill2) + string2 : string2);
}
function requote(s2) {
return s2.replace(requoteRe, "\\$&");
}
function formatRe(names) {
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
}
function formatLookup(names) {
return new Map(names.map((name, i2) => [name.toLowerCase(), i2]));
}
function parseWeekdayNumberSunday(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
return n2 ? (d2.w = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekdayNumberMonday(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
return n2 ? (d2.u = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberSunday(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.U = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberISO(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.V = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberMonday(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.W = +n2[0], i2 + n2[0].length) : -1;
}
function parseFullYear(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 4));
return n2 ? (d2.y = +n2[0], i2 + n2[0].length) : -1;
}
function parseYear(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.y = +n2[0] + (+n2[0] > 68 ? 1900 : 2e3), i2 + n2[0].length) : -1;
}
function parseZone(d2, string2, i2) {
var n2 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i2, i2 + 6));
return n2 ? (d2.Z = n2[1] ? 0 : -(n2[2] + (n2[3] || "00")), i2 + n2[0].length) : -1;
}
function parseQuarter(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
return n2 ? (d2.q = n2[0] * 3 - 3, i2 + n2[0].length) : -1;
}
function parseMonthNumber(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.m = n2[0] - 1, i2 + n2[0].length) : -1;
}
function parseDayOfMonth(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseDayOfYear(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 3));
return n2 ? (d2.m = 0, d2.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseHour24(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.H = +n2[0], i2 + n2[0].length) : -1;
}
function parseMinutes(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.M = +n2[0], i2 + n2[0].length) : -1;
}
function parseSeconds(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
return n2 ? (d2.S = +n2[0], i2 + n2[0].length) : -1;
}
function parseMilliseconds(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 3));
return n2 ? (d2.L = +n2[0], i2 + n2[0].length) : -1;
}
function parseMicroseconds(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2, i2 + 6));
return n2 ? (d2.L = Math.floor(n2[0] / 1e3), i2 + n2[0].length) : -1;
}
function parseLiteralPercent(d2, string2, i2) {
var n2 = percentRe.exec(string2.slice(i2, i2 + 1));
return n2 ? i2 + n2[0].length : -1;
}
function parseUnixTimestamp(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2));
return n2 ? (d2.Q = +n2[0], i2 + n2[0].length) : -1;
}
function parseUnixTimestampSeconds(d2, string2, i2) {
var n2 = numberRe.exec(string2.slice(i2));
return n2 ? (d2.s = +n2[0], i2 + n2[0].length) : -1;
}
function formatDayOfMonth(d2, p2) {
return pad(d2.getDate(), p2, 2);
}
function formatHour24(d2, p2) {
return pad(d2.getHours(), p2, 2);
}
function formatHour12(d2, p2) {
return pad(d2.getHours() % 12 || 12, p2, 2);
}
function formatDayOfYear(d2, p2) {
return pad(1 + timeDay.count(timeYear(d2), d2), p2, 3);
}
function formatMilliseconds(d2, p2) {
return pad(d2.getMilliseconds(), p2, 3);
}
function formatMicroseconds(d2, p2) {
return formatMilliseconds(d2, p2) + "000";
}
function formatMonthNumber(d2, p2) {
return pad(d2.getMonth() + 1, p2, 2);
}
function formatMinutes(d2, p2) {
return pad(d2.getMinutes(), p2, 2);
}
function formatSeconds(d2, p2) {
return pad(d2.getSeconds(), p2, 2);
}
function formatWeekdayNumberMonday(d2) {
var day2 = d2.getDay();
return day2 === 0 ? 7 : day2;
}
function formatWeekNumberSunday(d2, p2) {
return pad(sunday.count(timeYear(d2) - 1, d2), p2, 2);
}
function dISO(d2) {
var day2 = d2.getDay();
return day2 >= 4 || day2 === 0 ? thursday(d2) : thursday.ceil(d2);
}
function formatWeekNumberISO(d2, p2) {
d2 = dISO(d2);
return pad(thursday.count(timeYear(d2), d2) + (timeYear(d2).getDay() === 4), p2, 2);
}
function formatWeekdayNumberSunday(d2) {
return d2.getDay();
}
function formatWeekNumberMonday(d2, p2) {
return pad(monday.count(timeYear(d2) - 1, d2), p2, 2);
}
function formatYear(d2, p2) {
return pad(d2.getFullYear() % 100, p2, 2);
}
function formatYearISO(d2, p2) {
d2 = dISO(d2);
return pad(d2.getFullYear() % 100, p2, 2);
}
function formatFullYear(d2, p2) {
return pad(d2.getFullYear() % 1e4, p2, 4);
}
function formatFullYearISO(d2, p2) {
var day2 = d2.getDay();
d2 = day2 >= 4 || day2 === 0 ? thursday(d2) : thursday.ceil(d2);
return pad(d2.getFullYear() % 1e4, p2, 4);
}
function formatZone(d2) {
var z2 = d2.getTimezoneOffset();
return (z2 > 0 ? "-" : (z2 *= -1, "+")) + pad(z2 / 60 | 0, "0", 2) + pad(z2 % 60, "0", 2);
}
function formatUTCDayOfMonth(d2, p2) {
return pad(d2.getUTCDate(), p2, 2);
}
function formatUTCHour24(d2, p2) {
return pad(d2.getUTCHours(), p2, 2);
}
function formatUTCHour12(d2, p2) {
return pad(d2.getUTCHours() % 12 || 12, p2, 2);
}
function formatUTCDayOfYear(d2, p2) {
return pad(1 + utcDay$1.count(utcYear$1(d2), d2), p2, 3);
}
function formatUTCMilliseconds(d2, p2) {
return pad(d2.getUTCMilliseconds(), p2, 3);
}
function formatUTCMicroseconds(d2, p2) {
return formatUTCMilliseconds(d2, p2) + "000";
}
function formatUTCMonthNumber(d2, p2) {
return pad(d2.getUTCMonth() + 1, p2, 2);
}
function formatUTCMinutes(d2, p2) {
return pad(d2.getUTCMinutes(), p2, 2);
}
function formatUTCSeconds(d2, p2) {
return pad(d2.getUTCSeconds(), p2, 2);
}
function formatUTCWeekdayNumberMonday(d2) {
var dow = d2.getUTCDay();
return dow === 0 ? 7 : dow;
}
function formatUTCWeekNumberSunday(d2, p2) {
return pad(utcSunday.count(utcYear$1(d2) - 1, d2), p2, 2);
}
function UTCdISO(d2) {
var day2 = d2.getUTCDay();
return day2 >= 4 || day2 === 0 ? utcThursday(d2) : utcThursday.ceil(d2);
}
function formatUTCWeekNumberISO(d2, p2) {
d2 = UTCdISO(d2);
return pad(utcThursday.count(utcYear$1(d2), d2) + (utcYear$1(d2).getUTCDay() === 4), p2, 2);
}
function formatUTCWeekdayNumberSunday(d2) {
return d2.getUTCDay();
}
function formatUTCWeekNumberMonday(d2, p2) {
return pad(utcMonday.count(utcYear$1(d2) - 1, d2), p2, 2);
}
function formatUTCYear(d2, p2) {
return pad(d2.getUTCFullYear() % 100, p2, 2);
}
function formatUTCYearISO(d2, p2) {
d2 = UTCdISO(d2);
return pad(d2.getUTCFullYear() % 100, p2, 2);
}
function formatUTCFullYear(d2, p2) {
return pad(d2.getUTCFullYear() % 1e4, p2, 4);
}
function formatUTCFullYearISO(d2, p2) {
var day2 = d2.getUTCDay();
d2 = day2 >= 4 || day2 === 0 ? utcThursday(d2) : utcThursday.ceil(d2);
return pad(d2.getUTCFullYear() % 1e4, p2, 4);
}
function formatUTCZone() {
return "+0000";
}
function formatLiteralPercent() {
return "%";
}
function formatUnixTimestamp(d2) {
return +d2;
}
function formatUnixTimestampSeconds(d2) {
return Math.floor(+d2 / 1e3);
}
var locale;
var timeFormat$1;
var utcFormat$1;
defaultLocale({
dateTime: "%x, %X",
date: "%-m/%-d/%Y",
time: "%-I:%M:%S %p",
periods: ["AM", "PM"],
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});
function defaultLocale(definition2) {
locale = formatLocale(definition2);
timeFormat$1 = locale.format;
locale.parse;
utcFormat$1 = locale.utcFormat;
locale.utcParse;
return locale;
}
function date(t5) {
return new Date(t5);
}
function number$5(t5) {
return t5 instanceof Date ? +t5 : +/* @__PURE__ */ new Date(+t5);
}
function calendar(ticks2, tickInterval, year2, month2, week2, day2, hour2, minute2, second2, format2) {
var scale2 = continuous$1(), invert2 = scale2.invert, domain2 = scale2.domain;
var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y");
function tickFormat2(date2) {
return (second2(date2) < date2 ? formatMillisecond : minute2(date2) < date2 ? formatSecond : hour2(date2) < date2 ? formatMinute : day2(date2) < date2 ? formatHour : month2(date2) < date2 ? week2(date2) < date2 ? formatDay : formatWeek : year2(date2) < date2 ? formatMonth : formatYear2)(date2);
}
scale2.invert = function(y2) {
return new Date(invert2(y2));
};
scale2.domain = function(_24) {
return arguments.length ? domain2(Array.from(_24, number$5)) : domain2().map(date);
};
scale2.ticks = function(interval2) {
var d2 = domain2();
return ticks2(d2[0], d2[d2.length - 1], interval2 == null ? 10 : interval2);
};
scale2.tickFormat = function(count2, specifier) {
return specifier == null ? tickFormat2 : format2(specifier);
};
scale2.nice = function(interval2) {
var d2 = domain2();
if (!interval2 || typeof interval2.range !== "function")
interval2 = tickInterval(d2[0], d2[d2.length - 1], interval2 == null ? 10 : interval2);
return interval2 ? domain2(nice(d2, interval2)) : scale2;
};
scale2.copy = function() {
return copy$2(scale2, calendar(ticks2, tickInterval, year2, month2, week2, day2, hour2, minute2, second2, format2));
};
return scale2;
}
function time$2() {
return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, sunday, timeDay, timeHour, timeMinute, utcSecond, timeFormat$1).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}
function utcTime() {
return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear$1, utcMonth$1, utcSunday, utcDay$1, utcHour$1, utcMinute$1, utcSecond, utcFormat$1).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
}
function transformer$2() {
var x02 = 0, x12 = 1, t02, t12, k10, transform2, interpolator = identity$2, clamp2 = false, unknown;
function scale2(x2) {
return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform2(x2) - t02) * k10, clamp2 ? Math.max(0, Math.min(1, x2)) : x2));
}
scale2.domain = function(_24) {
return arguments.length ? ([x02, x12] = _24, t02 = transform2(x02 = +x02), t12 = transform2(x12 = +x12), k10 = t02 === t12 ? 0 : 1 / (t12 - t02), scale2) : [x02, x12];
};
scale2.clamp = function(_24) {
return arguments.length ? (clamp2 = !!_24, scale2) : clamp2;
};
scale2.interpolator = function(_24) {
return arguments.length ? (interpolator = _24, scale2) : interpolator;
};
function range2(interpolate2) {
return function(_24) {
var r0, r1;
return arguments.length ? ([r0, r1] = _24, interpolator = interpolate2(r0, r1), scale2) : [interpolator(0), interpolator(1)];
};
}
scale2.range = range2(interpolate$1);
scale2.rangeRound = range2(interpolateRound);
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
return function(t5) {
transform2 = t5, t02 = t5(x02), t12 = t5(x12), k10 = t02 === t12 ? 0 : 1 / (t12 - t02);
return scale2;
};
}
function copy$1(source2, target2) {
return target2.domain(source2.domain()).interpolator(source2.interpolator()).clamp(source2.clamp()).unknown(source2.unknown());
}
function sequential() {
var scale2 = linearish(transformer$2()(identity$2));
scale2.copy = function() {
return copy$1(scale2, sequential());
};
return initInterpolator.apply(scale2, arguments);
}
function sequentialLog() {
var scale2 = loggish(transformer$2()).domain([1, 10]);
scale2.copy = function() {
return copy$1(scale2, sequentialLog()).base(scale2.base());
};
return initInterpolator.apply(scale2, arguments);
}
function sequentialSymlog() {
var scale2 = symlogish(transformer$2());
scale2.copy = function() {
return copy$1(scale2, sequentialSymlog()).constant(scale2.constant());
};
return initInterpolator.apply(scale2, arguments);
}
function sequentialPow() {
var scale2 = powish(transformer$2());
scale2.copy = function() {
return copy$1(scale2, sequentialPow()).exponent(scale2.exponent());
};
return initInterpolator.apply(scale2, arguments);
}
function sequentialSqrt() {
return sequentialPow.apply(null, arguments).exponent(0.5);
}
function transformer$1() {
var x02 = 0, x12 = 0.5, x2 = 1, s2 = 1, t02, t12, t22, k10, k21, interpolator = identity$2, transform2, clamp2 = false, unknown;
function scale2(x3) {
return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform2(x3)) - t12) * (s2 * x3 < s2 * t12 ? k10 : k21), interpolator(clamp2 ? Math.max(0, Math.min(1, x3)) : x3));
}
scale2.domain = function(_24) {
return arguments.length ? ([x02, x12, x2] = _24, t02 = transform2(x02 = +x02), t12 = transform2(x12 = +x12), t22 = transform2(x2 = +x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t22 ? 0 : 0.5 / (t22 - t12), s2 = t12 < t02 ? -1 : 1, scale2) : [x02, x12, x2];
};
scale2.clamp = function(_24) {
return arguments.length ? (clamp2 = !!_24, scale2) : clamp2;
};
scale2.interpolator = function(_24) {
return arguments.length ? (interpolator = _24, scale2) : interpolator;
};
function range2(interpolate2) {
return function(_24) {
var r0, r1, r2;
return arguments.length ? ([r0, r1, r2] = _24, interpolator = piecewise(interpolate2, [r0, r1, r2]), scale2) : [interpolator(0), interpolator(0.5), interpolator(1)];
};
}
scale2.range = range2(interpolate$1);
scale2.rangeRound = range2(interpolateRound);
scale2.unknown = function(_24) {
return arguments.length ? (unknown = _24, scale2) : unknown;
};
return function(t5) {
transform2 = t5, t02 = t5(x02), t12 = t5(x12), t22 = t5(x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t22 ? 0 : 0.5 / (t22 - t12), s2 = t12 < t02 ? -1 : 1;
return scale2;
};
}
function diverging() {
var scale2 = linearish(transformer$1()(identity$2));
scale2.copy = function() {
return copy$1(scale2, diverging());
};
return initInterpolator.apply(scale2, arguments);
}
function divergingLog() {
var scale2 = loggish(transformer$1()).domain([0.1, 1, 10]);
scale2.copy = function() {
return copy$1(scale2, divergingLog()).base(scale2.base());
};
return initInterpolator.apply(scale2, arguments);
}
function divergingSymlog() {
var scale2 = symlogish(transformer$1());
scale2.copy = function() {
return copy$1(scale2, divergingSymlog()).constant(scale2.constant());
};
return initInterpolator.apply(scale2, arguments);
}
function divergingPow() {
var scale2 = powish(transformer$1());
scale2.copy = function() {
return copy$1(scale2, divergingPow()).exponent(scale2.exponent());
};
return initInterpolator.apply(scale2, arguments);
}
function divergingSqrt() {
return divergingPow.apply(null, arguments).exponent(0.5);
}
function bandSpace(count2, paddingInner, paddingOuter) {
const space = count2 - paddingInner + paddingOuter * 2;
return count2 ? space > 0 ? space : 1 : 0;
}
const Identity = "identity";
const Linear = "linear";
const Log = "log";
const Pow = "pow";
const Sqrt = "sqrt";
const Symlog = "symlog";
const Time = "time";
const UTC = "utc";
const Sequential = "sequential";
const Diverging = "diverging";
const Quantile = "quantile";
const Quantize = "quantize";
const Threshold = "threshold";
const Ordinal = "ordinal";
const Point$1 = "point";
const Band = "band";
const BinOrdinal = "bin-ordinal";
const Continuous = "continuous";
const Discrete$1 = "discrete";
const Discretizing = "discretizing";
const Interpolating = "interpolating";
const Temporal = "temporal";
function invertRange(scale2) {
return function(_24) {
let lo2 = _24[0], hi2 = _24[1], t5;
if (hi2 < lo2) {
t5 = lo2;
lo2 = hi2;
hi2 = t5;
}
return [scale2.invert(lo2), scale2.invert(hi2)];
};
}
function invertRangeExtent(scale2) {
return function(_24) {
const range2 = scale2.range();
let lo2 = _24[0], hi2 = _24[1], min2 = -1, max2, t5, i2, n2;
if (hi2 < lo2) {
t5 = lo2;
lo2 = hi2;
hi2 = t5;
}
for (i2 = 0, n2 = range2.length; i2 < n2; ++i2) {
if (range2[i2] >= lo2 && range2[i2] <= hi2) {
if (min2 < 0)
min2 = i2;
max2 = i2;
}
}
if (min2 < 0)
return void 0;
lo2 = scale2.invertExtent(range2[min2]);
hi2 = scale2.invertExtent(range2[max2]);
return [lo2[0] === void 0 ? lo2[1] : lo2[0], hi2[1] === void 0 ? hi2[0] : hi2[1]];
};
}
function band() {
const scale2 = ordinal().unknown(void 0), domain2 = scale2.domain, ordinalRange = scale2.range;
let range$12 = [0, 1], step, bandwidth2, round2 = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
delete scale2.unknown;
function rescale() {
const n2 = domain2().length, reverse3 = range$12[1] < range$12[0], stop2 = range$12[1 - reverse3], space = bandSpace(n2, paddingInner, paddingOuter);
let start2 = range$12[reverse3 - 0];
step = (stop2 - start2) / (space || 1);
if (round2) {
step = Math.floor(step);
}
start2 += (stop2 - start2 - step * (n2 - paddingInner)) * align;
bandwidth2 = step * (1 - paddingInner);
if (round2) {
start2 = Math.round(start2);
bandwidth2 = Math.round(bandwidth2);
}
const values2 = range$6(n2).map((i2) => start2 + step * i2);
return ordinalRange(reverse3 ? values2.reverse() : values2);
}
scale2.domain = function(_24) {
if (arguments.length) {
domain2(_24);
return rescale();
} else {
return domain2();
}
};
scale2.range = function(_24) {
if (arguments.length) {
range$12 = [+_24[0], +_24[1]];
return rescale();
} else {
return range$12.slice();
}
};
scale2.rangeRound = function(_24) {
range$12 = [+_24[0], +_24[1]];
round2 = true;
return rescale();
};
scale2.bandwidth = function() {
return bandwidth2;
};
scale2.step = function() {
return step;
};
scale2.round = function(_24) {
if (arguments.length) {
round2 = !!_24;
return rescale();
} else {
return round2;
}
};
scale2.padding = function(_24) {
if (arguments.length) {
paddingOuter = Math.max(0, Math.min(1, _24));
paddingInner = paddingOuter;
return rescale();
} else {
return paddingInner;
}
};
scale2.paddingInner = function(_24) {
if (arguments.length) {
paddingInner = Math.max(0, Math.min(1, _24));
return rescale();
} else {
return paddingInner;
}
};
scale2.paddingOuter = function(_24) {
if (arguments.length) {
paddingOuter = Math.max(0, Math.min(1, _24));
return rescale();
} else {
return paddingOuter;
}
};
scale2.align = function(_24) {
if (arguments.length) {
align = Math.max(0, Math.min(1, _24));
return rescale();
} else {
return align;
}
};
scale2.invertRange = function(_24) {
if (_24[0] == null || _24[1] == null)
return;
const reverse3 = range$12[1] < range$12[0], values2 = reverse3 ? ordinalRange().reverse() : ordinalRange(), n2 = values2.length - 1;
let lo2 = +_24[0], hi2 = +_24[1], a2, b2, t5;
if (lo2 !== lo2 || hi2 !== hi2)
return;
if (hi2 < lo2) {
t5 = lo2;
lo2 = hi2;
hi2 = t5;
}
if (hi2 < values2[0] || lo2 > range$12[1 - reverse3])
return;
a2 = Math.max(0, bisectRight$2(values2, lo2) - 1);
b2 = lo2 === hi2 ? a2 : bisectRight$2(values2, hi2) - 1;
if (lo2 - values2[a2] > bandwidth2 + 1e-10)
++a2;
if (reverse3) {
t5 = a2;
a2 = n2 - b2;
b2 = n2 - t5;
}
return a2 > b2 ? void 0 : domain2().slice(a2, b2 + 1);
};
scale2.invert = function(_24) {
const value2 = scale2.invertRange([_24, _24]);
return value2 ? value2[0] : value2;
};
scale2.copy = function() {
return band().domain(domain2()).range(range$12).round(round2).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
};
return rescale();
}
function pointish(scale2) {
const copy2 = scale2.copy;
scale2.padding = scale2.paddingOuter;
delete scale2.paddingInner;
scale2.copy = function() {
return pointish(copy2());
};
return scale2;
}
function point$1() {
return pointish(band().paddingInner(1));
}
var map = Array.prototype.map;
function numbers(_24) {
return map.call(_24, toNumber2);
}
const slice$2 = Array.prototype.slice;
function scaleBinOrdinal() {
let domain2 = [], range2 = [];
function scale2(x2) {
return x2 == null || x2 !== x2 ? void 0 : range2[(bisect$1(domain2, x2) - 1) % range2.length];
}
scale2.domain = function(_24) {
if (arguments.length) {
domain2 = numbers(_24);
return scale2;
} else {
return domain2.slice();
}
};
scale2.range = function(_24) {
if (arguments.length) {
range2 = slice$2.call(_24);
return scale2;
} else {
return range2.slice();
}
};
scale2.tickFormat = function(count2, specifier) {
return tickFormat$1(domain2[0], peek$1(domain2), count2 == null ? 10 : count2, specifier);
};
scale2.copy = function() {
return scaleBinOrdinal().domain(scale2.domain()).range(scale2.range());
};
return scale2;
}
const scales = /* @__PURE__ */ new Map();
const VEGA_SCALE = Symbol("vega_scale");
function registerScale(scale2) {
scale2[VEGA_SCALE] = true;
return scale2;
}
function isRegisteredScale(scale2) {
return scale2 && scale2[VEGA_SCALE] === true;
}
function create$6(type2, constructor, metadata2) {
const ctr = function scale2() {
const s2 = constructor();
if (!s2.invertRange) {
s2.invertRange = s2.invert ? invertRange(s2) : s2.invertExtent ? invertRangeExtent(s2) : void 0;
}
s2.type = type2;
return registerScale(s2);
};
ctr.metadata = toSet(array$5(metadata2));
return ctr;
}
function scale$4(type2, scale2, metadata2) {
if (arguments.length > 1) {
scales.set(type2, create$6(type2, scale2, metadata2));
return this;
} else {
return isValidScaleType(type2) ? scales.get(type2) : void 0;
}
}
scale$4(Identity, identity$1);
scale$4(Linear, linear$1, Continuous);
scale$4(Log, log$2, [Continuous, Log]);
scale$4(Pow, pow$2, Continuous);
scale$4(Sqrt, sqrt$2, Continuous);
scale$4(Symlog, symlog, Continuous);
scale$4(Time, time$2, [Continuous, Temporal]);
scale$4(UTC, utcTime, [Continuous, Temporal]);
scale$4(Sequential, sequential, [Continuous, Interpolating]);
scale$4(`${Sequential}-${Linear}`, sequential, [Continuous, Interpolating]);
scale$4(`${Sequential}-${Log}`, sequentialLog, [Continuous, Interpolating, Log]);
scale$4(`${Sequential}-${Pow}`, sequentialPow, [Continuous, Interpolating]);
scale$4(`${Sequential}-${Sqrt}`, sequentialSqrt, [Continuous, Interpolating]);
scale$4(`${Sequential}-${Symlog}`, sequentialSymlog, [Continuous, Interpolating]);
scale$4(`${Diverging}-${Linear}`, diverging, [Continuous, Interpolating]);
scale$4(`${Diverging}-${Log}`, divergingLog, [Continuous, Interpolating, Log]);
scale$4(`${Diverging}-${Pow}`, divergingPow, [Continuous, Interpolating]);
scale$4(`${Diverging}-${Sqrt}`, divergingSqrt, [Continuous, Interpolating]);
scale$4(`${Diverging}-${Symlog}`, divergingSymlog, [Continuous, Interpolating]);
scale$4(Quantile, quantile, [Discretizing, Quantile]);
scale$4(Quantize, quantize$1, Discretizing);
scale$4(Threshold, threshold, Discretizing);
scale$4(BinOrdinal, scaleBinOrdinal, [Discrete$1, Discretizing]);
scale$4(Ordinal, ordinal, Discrete$1);
scale$4(Band, band, Discrete$1);
scale$4(Point$1, point$1, Discrete$1);
function isValidScaleType(type2) {
return scales.has(type2);
}
function hasType(key2, type2) {
const s2 = scales.get(key2);
return s2 && s2.metadata[type2];
}
function isContinuous(key2) {
return hasType(key2, Continuous);
}
function isDiscrete(key2) {
return hasType(key2, Discrete$1);
}
function isDiscretizing(key2) {
return hasType(key2, Discretizing);
}
function isLogarithmic(key2) {
return hasType(key2, Log);
}
function isTemporal(key2) {
return hasType(key2, Temporal);
}
function isInterpolating(key2) {
return hasType(key2, Interpolating);
}
function isQuantile(key2) {
return hasType(key2, Quantile);
}
const scaleProps = ["clamp", "base", "constant", "exponent"];
function interpolateRange(interpolator, range2) {
const start2 = range2[0], span2 = peek$1(range2) - start2;
return function(i2) {
return interpolator(start2 + i2 * span2);
};
}
function interpolateColors(colors2, type2, gamma2) {
return piecewise(interpolate(type2 || "rgb", gamma2), colors2);
}
function quantizeInterpolator(interpolator, count2) {
const samples = new Array(count2), n2 = count2 + 1;
for (let i2 = 0; i2 < count2; )
samples[i2] = interpolator(++i2 / n2);
return samples;
}
function scaleFraction(scale$12, min2, max2) {
const delta = max2 - min2;
let i2, t5, s2;
if (!delta || !Number.isFinite(delta)) {
return constant$6(0.5);
} else {
i2 = (t5 = scale$12.type).indexOf("-");
t5 = i2 < 0 ? t5 : t5.slice(i2 + 1);
s2 = scale$4(t5)().domain([min2, max2]).range([0, 1]);
scaleProps.forEach((m2) => scale$12[m2] ? s2[m2](scale$12[m2]()) : 0);
return s2;
}
}
function interpolate(type2, gamma2) {
const interp = $$1$1[method$1(type2)];
return gamma2 != null && interp && interp.gamma ? interp.gamma(gamma2) : interp;
}
function method$1(type2) {
return "interpolate" + type2.toLowerCase().split("-").map((s2) => s2[0].toUpperCase() + s2.slice(1)).join("");
}
const continuous = {
blues: "cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",
greens: "d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",
greys: "e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",
oranges: "fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",
purples: "e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",
reds: "fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",
blueGreen: "d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",
bluePurple: "ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",
greenBlue: "d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",
orangeRed: "fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",
purpleBlue: "dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",
purpleBlueGreen: "dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",
purpleRed: "dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",
redPurple: "fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",
yellowGreen: "e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",
yellowOrangeBrown: "feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",
yellowOrangeRed: "fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",
blueOrange: "134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",
brownBlueGreen: "704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",
purpleGreen: "5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",
purpleOrange: "4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",
redBlue: "8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",
redGrey: "8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",
yellowGreenBlue: "eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",
redYellowBlue: "a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",
redYellowGreen: "a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",
pinkYellowGreen: "8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",
spectral: "9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",
viridis: "440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",
magma: "0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",
inferno: "0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",
plasma: "0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",
cividis: "00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",
rainbow: "6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",
sinebow: "ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",
turbo: "23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",
browns: "eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",
tealBlues: "bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",
teals: "bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",
warmGreys: "dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",
goldGreen: "f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",
goldOrange: "f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",
goldRed: "f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",
lightGreyRed: "efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",
lightGreyTeal: "e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",
lightMulti: "e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",
lightOrange: "f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",
lightTealBlue: "e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",
darkBlue: "3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",
darkGold: "3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",
darkGreen: "3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",
darkMulti: "3737371f5287197d8c29a86995ce3fffe800ffffff",
darkRed: "3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"
};
const discrete = {
category10: "1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",
category20: "1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",
category20b: "393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",
category20c: "3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",
tableau10: "4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",
tableau20: "4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",
accent: "7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",
dark2: "1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",
paired: "a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",
pastel1: "fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",
pastel2: "b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",
set1: "e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",
set2: "66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",
set3: "8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"
};
function colors(palette) {
const n2 = palette.length / 6 | 0, c2 = new Array(n2);
for (let i2 = 0; i2 < n2; ) {
c2[i2] = "#" + palette.slice(i2 * 6, ++i2 * 6);
}
return c2;
}
function apply$5(_24, f2) {
for (const k2 in _24)
scheme(k2, f2(_24[k2]));
}
const schemes = {};
apply$5(discrete, colors);
apply$5(continuous, (_24) => interpolateColors(colors(_24)));
function scheme(name, scheme2) {
name = name && name.toLowerCase();
if (arguments.length > 1) {
schemes[name] = scheme2;
return this;
} else {
return schemes[name];
}
}
const SymbolLegend = "symbol";
const DiscreteLegend = "discrete";
const GradientLegend = "gradient";
const defaultFormatter = (value2) => isArray$2(value2) ? value2.map((v2) => String(v2)) : String(value2);
const ascending$2 = (a2, b2) => a2[1] - b2[1];
const descending$2 = (a2, b2) => b2[1] - a2[1];
function tickCount(scale2, count2, minStep) {
let step;
if (isNumber$1(count2)) {
if (scale2.bins) {
count2 = Math.max(count2, scale2.bins.length);
}
if (minStep != null) {
count2 = Math.min(count2, Math.floor(span(scale2.domain()) / minStep || 1) + 1);
}
}
if (isObject$a(count2)) {
step = count2.step;
count2 = count2.interval;
}
if (isString(count2)) {
count2 = scale2.type === Time ? timeInterval(count2) : scale2.type == UTC ? utcInterval(count2) : error2("Only time and utc scales accept interval strings.");
if (step)
count2 = count2.every(step);
}
return count2;
}
function validTicks(scale2, ticks2, count2) {
let range2 = scale2.range(), lo2 = range2[0], hi2 = peek$1(range2), cmp = ascending$2;
if (lo2 > hi2) {
range2 = hi2;
hi2 = lo2;
lo2 = range2;
cmp = descending$2;
}
lo2 = Math.floor(lo2);
hi2 = Math.ceil(hi2);
ticks2 = ticks2.map((v2) => [v2, scale2(v2)]).filter((_24) => lo2 <= _24[1] && _24[1] <= hi2).sort(cmp).map((_24) => _24[0]);
if (count2 > 0 && ticks2.length > 1) {
const endpoints = [ticks2[0], peek$1(ticks2)];
while (ticks2.length > count2 && ticks2.length >= 3) {
ticks2 = ticks2.filter((_24, i2) => !(i2 % 2));
}
if (ticks2.length < 3) {
ticks2 = endpoints;
}
}
return ticks2;
}
function tickValues(scale2, count2) {
return scale2.bins ? validTicks(scale2, scale2.bins) : scale2.ticks ? scale2.ticks(count2) : scale2.domain();
}
function tickFormat(locale2, scale2, count2, specifier, formatType, noSkip) {
const type2 = scale2.type;
let format2 = defaultFormatter;
if (type2 === Time || formatType === Time) {
format2 = locale2.timeFormat(specifier);
} else if (type2 === UTC || formatType === UTC) {
format2 = locale2.utcFormat(specifier);
} else if (isLogarithmic(type2)) {
const varfmt = locale2.formatFloat(specifier);
if (noSkip || scale2.bins) {
format2 = varfmt;
} else {
const test2 = tickLog(scale2, count2, false);
format2 = (_24) => test2(_24) ? varfmt(_24) : "";
}
} else if (scale2.tickFormat) {
const d2 = scale2.domain();
format2 = locale2.formatSpan(d2[0], d2[d2.length - 1], count2, specifier);
} else if (specifier) {
format2 = locale2.format(specifier);
}
return format2;
}
function tickLog(scale2, count2, values2) {
const ticks2 = tickValues(scale2, count2), base2 = scale2.base(), logb = Math.log(base2), k2 = Math.max(1, base2 * count2 / ticks2.length);
const test2 = (d2) => {
let i2 = d2 / Math.pow(base2, Math.round(Math.log(d2) / logb));
if (i2 * base2 < base2 - 0.5)
i2 *= base2;
return i2 <= k2;
};
return values2 ? ticks2.filter(test2) : test2;
}
const symbols$1 = {
[Quantile]: "quantiles",
[Quantize]: "thresholds",
[Threshold]: "domain"
};
const formats = {
[Quantile]: "quantiles",
[Quantize]: "domain"
};
function labelValues(scale2, count2) {
return scale2.bins ? binValues(scale2.bins) : scale2.type === Log ? tickLog(scale2, count2, true) : symbols$1[scale2.type] ? thresholdValues(scale2[symbols$1[scale2.type]]()) : tickValues(scale2, count2);
}
function thresholdFormat(locale2, scale2, specifier) {
const _24 = scale2[formats[scale2.type]](), n2 = _24.length;
let d2 = n2 > 1 ? _24[1] - _24[0] : _24[0], i2;
for (i2 = 1; i2 < n2; ++i2) {
d2 = Math.min(d2, _24[i2] - _24[i2 - 1]);
}
return locale2.formatSpan(0, d2, 3 * 10, specifier);
}
function thresholdValues(thresholds) {
const values2 = [-Infinity].concat(thresholds);
values2.max = Infinity;
return values2;
}
function binValues(bins) {
const values2 = bins.slice(0, -1);
values2.max = peek$1(bins);
return values2;
}
const isDiscreteRange = (scale2) => symbols$1[scale2.type] || scale2.bins;
function labelFormat(locale2, scale2, count2, type2, specifier, formatType, noSkip) {
const format2 = formats[scale2.type] && formatType !== Time && formatType !== UTC ? thresholdFormat(locale2, scale2, specifier) : tickFormat(locale2, scale2, count2, specifier, formatType, noSkip);
return type2 === SymbolLegend && isDiscreteRange(scale2) ? formatRange(format2) : type2 === DiscreteLegend ? formatDiscrete(format2) : formatPoint(format2);
}
const formatRange = (format2) => (value2, index2, array2) => {
const limit2 = get$4(array2[index2 + 1], get$4(array2.max, Infinity)), lo2 = formatValue$2(value2, format2), hi2 = formatValue$2(limit2, format2);
return lo2 && hi2 ? lo2 + " – " + hi2 : hi2 ? "< " + hi2 : "≥ " + lo2;
};
const get$4 = (value2, dflt2) => value2 != null ? value2 : dflt2;
const formatDiscrete = (format2) => (value2, index2) => index2 ? format2(value2) : null;
const formatPoint = (format2) => (value2) => format2(value2);
const formatValue$2 = (value2, format2) => Number.isFinite(value2) ? format2(value2) : null;
function labelFraction(scale2) {
const domain2 = scale2.domain(), count2 = domain2.length - 1;
let lo2 = +domain2[0], hi2 = +peek$1(domain2), span2 = hi2 - lo2;
if (scale2.type === Threshold) {
const adjust = count2 ? span2 / count2 : 0.1;
lo2 -= adjust;
hi2 += adjust;
span2 = hi2 - lo2;
}
return (value2) => (value2 - lo2) / span2;
}
function format$1(locale2, scale2, specifier, formatType) {
const type2 = formatType || scale2.type;
if (isString(specifier) && isTemporal(type2)) {
specifier = specifier.replace(/%a/g, "%A").replace(/%b/g, "%B");
}
return !specifier && type2 === Time ? locale2.timeFormat("%A, %d %B %Y, %X") : !specifier && type2 === UTC ? locale2.utcFormat("%A, %d %B %Y, %X UTC") : labelFormat(locale2, scale2, 5, null, specifier, formatType, true);
}
function domainCaption(locale2, scale2, opt) {
opt = opt || {};
const max2 = Math.max(3, opt.maxlen || 7), fmt = format$1(locale2, scale2, opt.format, opt.formatType);
if (isDiscretizing(scale2.type)) {
const v2 = labelValues(scale2).slice(1).map(fmt), n2 = v2.length;
return `${n2} boundar${n2 === 1 ? "y" : "ies"}: ${v2.join(", ")}`;
} else if (isDiscrete(scale2.type)) {
const d2 = scale2.domain(), n2 = d2.length, v2 = n2 > max2 ? d2.slice(0, max2 - 2).map(fmt).join(", ") + ", ending with " + d2.slice(-1).map(fmt) : d2.map(fmt).join(", ");
return `${n2} value${n2 === 1 ? "" : "s"}: ${v2}`;
} else {
const d2 = scale2.domain();
return `values from ${fmt(d2[0])} to ${fmt(peek$1(d2))}`;
}
}
let gradient_id = 0;
const patternPrefix = "p_";
function isGradient(value2) {
return value2 && value2.gradient;
}
function gradientRef(g2, defs, base2) {
const type2 = g2.gradient;
let id = g2.id, prefix2 = type2 === "radial" ? patternPrefix : "";
if (!id) {
id = g2.id = "gradient_" + gradient_id++;
if (type2 === "radial") {
g2.x1 = get$3(g2.x1, 0.5);
g2.y1 = get$3(g2.y1, 0.5);
g2.r1 = get$3(g2.r1, 0);
g2.x2 = get$3(g2.x2, 0.5);
g2.y2 = get$3(g2.y2, 0.5);
g2.r2 = get$3(g2.r2, 0.5);
prefix2 = patternPrefix;
} else {
g2.x1 = get$3(g2.x1, 0);
g2.y1 = get$3(g2.y1, 0);
g2.x2 = get$3(g2.x2, 1);
g2.y2 = get$3(g2.y2, 0);
}
}
defs[id] = g2;
return "url(" + (base2 || "") + "#" + prefix2 + id + ")";
}
function get$3(val, def2) {
return val != null ? val : def2;
}
function Gradient$1(p02, p1) {
var stops = [], gradient2;
return gradient2 = {
gradient: "linear",
x1: p02 ? p02[0] : 0,
y1: p02 ? p02[1] : 0,
x2: p1 ? p1[0] : 1,
y2: p1 ? p1[1] : 0,
stops,
stop: function(offset2, color2) {
stops.push({
offset: offset2,
color: color2
});
return gradient2;
}
};
}
const lookup$8 = {
"basis": {
curve: curveBasis
},
"basis-closed": {
curve: curveBasisClosed
},
"basis-open": {
curve: curveBasisOpen
},
"bundle": {
curve: curveBundle,
tension: "beta",
value: 0.85
},
"cardinal": {
curve: curveCardinal,
tension: "tension",
value: 0
},
"cardinal-open": {
curve: curveCardinalOpen,
tension: "tension",
value: 0
},
"cardinal-closed": {
curve: curveCardinalClosed,
tension: "tension",
value: 0
},
"catmull-rom": {
curve: curveCatmullRom,
tension: "alpha",
value: 0.5
},
"catmull-rom-closed": {
curve: curveCatmullRomClosed,
tension: "alpha",
value: 0.5
},
"catmull-rom-open": {
curve: curveCatmullRomOpen,
tension: "alpha",
value: 0.5
},
"linear": {
curve: curveLinear
},
"linear-closed": {
curve: curveLinearClosed
},
"monotone": {
horizontal: monotoneY,
vertical: monotoneX
},
"natural": {
curve: curveNatural
},
"step": {
curve: curveStep
},
"step-after": {
curve: stepAfter
},
"step-before": {
curve: stepBefore
}
};
function curves(type2, orientation, tension) {
var entry2 = has$2(lookup$8, type2) && lookup$8[type2], curve2 = null;
if (entry2) {
curve2 = entry2.curve || entry2[orientation || "vertical"];
if (entry2.tension && tension != null) {
curve2 = curve2[entry2.tension](tension);
}
}
return curve2;
}
const paramCounts = {
m: 2,
l: 2,
h: 1,
v: 1,
z: 0,
c: 6,
s: 4,
q: 4,
t: 2,
a: 7
};
const commandPattern = /[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;
const numberPattern = /^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/;
const spacePattern = /^((\s+,?\s*)|(,\s*))/;
const flagPattern = /^[01]/;
function parse$4(path2) {
const commands = [];
const matches = path2.match(commandPattern) || [];
matches.forEach((str) => {
let cmd = str[0];
const type2 = cmd.toLowerCase();
const paramCount = paramCounts[type2];
const params2 = parseParams(type2, paramCount, str.slice(1).trim());
const count2 = params2.length;
if (count2 < paramCount || count2 && count2 % paramCount !== 0) {
throw Error("Invalid SVG path, incorrect parameter count");
}
commands.push([cmd, ...params2.slice(0, paramCount)]);
if (count2 === paramCount) {
return;
}
if (type2 === "m") {
cmd = cmd === "M" ? "L" : "l";
}
for (let i2 = paramCount; i2 < count2; i2 += paramCount) {
commands.push([cmd, ...params2.slice(i2, i2 + paramCount)]);
}
});
return commands;
}
function parseParams(type2, paramCount, segment) {
const params2 = [];
for (let index2 = 0; paramCount && index2 < segment.length; ) {
for (let i2 = 0; i2 < paramCount; ++i2) {
const pattern = type2 === "a" && (i2 === 3 || i2 === 4) ? flagPattern : numberPattern;
const match2 = segment.slice(index2).match(pattern);
if (match2 === null) {
throw Error("Invalid SVG path, incorrect parameter type");
}
index2 += match2[0].length;
params2.push(+match2[0]);
const ws = segment.slice(index2).match(spacePattern);
if (ws !== null) {
index2 += ws[0].length;
}
}
}
return params2;
}
const DegToRad = Math.PI / 180;
const Epsilon = 1e-14;
const HalfPi = Math.PI / 2;
const Tau = Math.PI * 2;
const HalfSqrt3 = Math.sqrt(3) / 2;
var segmentCache = {};
var bezierCache = {};
var join$2 = [].join;
function segments(x2, y2, rx, ry, large, sweep, rotateX, ox, oy) {
const key2 = join$2.call(arguments);
if (segmentCache[key2]) {
return segmentCache[key2];
}
const th2 = rotateX * DegToRad;
const sin_th = Math.sin(th2);
const cos_th = Math.cos(th2);
rx = Math.abs(rx);
ry = Math.abs(ry);
const px2 = cos_th * (ox - x2) * 0.5 + sin_th * (oy - y2) * 0.5;
const py2 = cos_th * (oy - y2) * 0.5 - sin_th * (ox - x2) * 0.5;
let pl2 = px2 * px2 / (rx * rx) + py2 * py2 / (ry * ry);
if (pl2 > 1) {
pl2 = Math.sqrt(pl2);
rx *= pl2;
ry *= pl2;
}
const a00 = cos_th / rx;
const a01 = sin_th / rx;
const a10 = -sin_th / ry;
const a11 = cos_th / ry;
const x02 = a00 * ox + a01 * oy;
const y02 = a10 * ox + a11 * oy;
const x12 = a00 * x2 + a01 * y2;
const y12 = a10 * x2 + a11 * y2;
const d2 = (x12 - x02) * (x12 - x02) + (y12 - y02) * (y12 - y02);
let sfactor_sq = 1 / d2 - 0.25;
if (sfactor_sq < 0)
sfactor_sq = 0;
let sfactor = Math.sqrt(sfactor_sq);
if (sweep == large)
sfactor = -sfactor;
const xc2 = 0.5 * (x02 + x12) - sfactor * (y12 - y02);
const yc2 = 0.5 * (y02 + y12) + sfactor * (x12 - x02);
const th0 = Math.atan2(y02 - yc2, x02 - xc2);
const th1 = Math.atan2(y12 - yc2, x12 - xc2);
let th_arc = th1 - th0;
if (th_arc < 0 && sweep === 1) {
th_arc += Tau;
} else if (th_arc > 0 && sweep === 0) {
th_arc -= Tau;
}
const segs = Math.ceil(Math.abs(th_arc / (HalfPi + 1e-3)));
const result = [];
for (let i2 = 0; i2 < segs; ++i2) {
const th22 = th0 + i2 * th_arc / segs;
const th3 = th0 + (i2 + 1) * th_arc / segs;
result[i2] = [xc2, yc2, th22, th3, rx, ry, sin_th, cos_th];
}
return segmentCache[key2] = result;
}
function bezier(params2) {
const key2 = join$2.call(params2);
if (bezierCache[key2]) {
return bezierCache[key2];
}
var cx = params2[0], cy = params2[1], th0 = params2[2], th1 = params2[3], rx = params2[4], ry = params2[5], sin_th = params2[6], cos_th = params2[7];
const a00 = cos_th * rx;
const a01 = -sin_th * ry;
const a10 = sin_th * rx;
const a11 = cos_th * ry;
const cos_th0 = Math.cos(th0);
const sin_th0 = Math.sin(th0);
const cos_th1 = Math.cos(th1);
const sin_th1 = Math.sin(th1);
const th_half = 0.5 * (th1 - th0);
const sin_th_h2 = Math.sin(th_half * 0.5);
const t5 = 8 / 3 * sin_th_h2 * sin_th_h2 / Math.sin(th_half);
const x12 = cx + cos_th0 - t5 * sin_th0;
const y12 = cy + sin_th0 + t5 * cos_th0;
const x3 = cx + cos_th1;
const y3 = cy + sin_th1;
const x2 = x3 + t5 * sin_th1;
const y2 = y3 - t5 * cos_th1;
return bezierCache[key2] = [a00 * x12 + a01 * y12, a10 * x12 + a11 * y12, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];
}
const temp = ["l", 0, 0, 0, 0, 0, 0, 0];
function scale$1$1(current, sX, sY) {
const c2 = temp[0] = current[0];
if (c2 === "a" || c2 === "A") {
temp[1] = sX * current[1];
temp[2] = sY * current[2];
temp[3] = current[3];
temp[4] = current[4];
temp[5] = current[5];
temp[6] = sX * current[6];
temp[7] = sY * current[7];
} else if (c2 === "h" || c2 === "H") {
temp[1] = sX * current[1];
} else if (c2 === "v" || c2 === "V") {
temp[1] = sY * current[1];
} else {
for (var i2 = 1, n2 = current.length; i2 < n2; ++i2) {
temp[i2] = (i2 % 2 == 1 ? sX : sY) * current[i2];
}
}
return temp;
}
function pathRender(context2, path2, l2, t5, sX, sY) {
var current, previous = null, x2 = 0, y2 = 0, controlX = 0, controlY = 0, tempX, tempY, tempControlX, tempControlY, anchorX = 0, anchorY = 0;
if (l2 == null)
l2 = 0;
if (t5 == null)
t5 = 0;
if (sX == null)
sX = 1;
if (sY == null)
sY = sX;
if (context2.beginPath)
context2.beginPath();
for (var i2 = 0, len = path2.length; i2 < len; ++i2) {
current = path2[i2];
if (sX !== 1 || sY !== 1) {
current = scale$1$1(current, sX, sY);
}
switch (current[0]) {
case "l":
x2 += current[1];
y2 += current[2];
context2.lineTo(x2 + l2, y2 + t5);
break;
case "L":
x2 = current[1];
y2 = current[2];
context2.lineTo(x2 + l2, y2 + t5);
break;
case "h":
x2 += current[1];
context2.lineTo(x2 + l2, y2 + t5);
break;
case "H":
x2 = current[1];
context2.lineTo(x2 + l2, y2 + t5);
break;
case "v":
y2 += current[1];
context2.lineTo(x2 + l2, y2 + t5);
break;
case "V":
y2 = current[1];
context2.lineTo(x2 + l2, y2 + t5);
break;
case "m":
x2 += current[1];
y2 += current[2];
anchorX = x2;
anchorY = y2;
context2.moveTo(x2 + l2, y2 + t5);
break;
case "M":
x2 = current[1];
y2 = current[2];
anchorX = x2;
anchorY = y2;
context2.moveTo(x2 + l2, y2 + t5);
break;
case "c":
tempX = x2 + current[5];
tempY = y2 + current[6];
controlX = x2 + current[3];
controlY = y2 + current[4];
context2.bezierCurveTo(
x2 + current[1] + l2,
// x1
y2 + current[2] + t5,
// y1
controlX + l2,
// x2
controlY + t5,
// y2
tempX + l2,
tempY + t5
);
x2 = tempX;
y2 = tempY;
break;
case "C":
x2 = current[5];
y2 = current[6];
controlX = current[3];
controlY = current[4];
context2.bezierCurveTo(current[1] + l2, current[2] + t5, controlX + l2, controlY + t5, x2 + l2, y2 + t5);
break;
case "s":
tempX = x2 + current[3];
tempY = y2 + current[4];
controlX = 2 * x2 - controlX;
controlY = 2 * y2 - controlY;
context2.bezierCurveTo(controlX + l2, controlY + t5, x2 + current[1] + l2, y2 + current[2] + t5, tempX + l2, tempY + t5);
controlX = x2 + current[1];
controlY = y2 + current[2];
x2 = tempX;
y2 = tempY;
break;
case "S":
tempX = current[3];
tempY = current[4];
controlX = 2 * x2 - controlX;
controlY = 2 * y2 - controlY;
context2.bezierCurveTo(controlX + l2, controlY + t5, current[1] + l2, current[2] + t5, tempX + l2, tempY + t5);
x2 = tempX;
y2 = tempY;
controlX = current[1];
controlY = current[2];
break;
case "q":
tempX = x2 + current[3];
tempY = y2 + current[4];
controlX = x2 + current[1];
controlY = y2 + current[2];
context2.quadraticCurveTo(controlX + l2, controlY + t5, tempX + l2, tempY + t5);
x2 = tempX;
y2 = tempY;
break;
case "Q":
tempX = current[3];
tempY = current[4];
context2.quadraticCurveTo(current[1] + l2, current[2] + t5, tempX + l2, tempY + t5);
x2 = tempX;
y2 = tempY;
controlX = current[1];
controlY = current[2];
break;
case "t":
tempX = x2 + current[1];
tempY = y2 + current[2];
if (previous[0].match(/[QqTt]/) === null) {
controlX = x2;
controlY = y2;
} else if (previous[0] === "t") {
controlX = 2 * x2 - tempControlX;
controlY = 2 * y2 - tempControlY;
} else if (previous[0] === "q") {
controlX = 2 * x2 - controlX;
controlY = 2 * y2 - controlY;
}
tempControlX = controlX;
tempControlY = controlY;
context2.quadraticCurveTo(controlX + l2, controlY + t5, tempX + l2, tempY + t5);
x2 = tempX;
y2 = tempY;
controlX = x2 + current[1];
controlY = y2 + current[2];
break;
case "T":
tempX = current[1];
tempY = current[2];
controlX = 2 * x2 - controlX;
controlY = 2 * y2 - controlY;
context2.quadraticCurveTo(controlX + l2, controlY + t5, tempX + l2, tempY + t5);
x2 = tempX;
y2 = tempY;
break;
case "a":
drawArc(context2, x2 + l2, y2 + t5, [current[1], current[2], current[3], current[4], current[5], current[6] + x2 + l2, current[7] + y2 + t5]);
x2 += current[6];
y2 += current[7];
break;
case "A":
drawArc(context2, x2 + l2, y2 + t5, [current[1], current[2], current[3], current[4], current[5], current[6] + l2, current[7] + t5]);
x2 = current[6];
y2 = current[7];
break;
case "z":
case "Z":
x2 = anchorX;
y2 = anchorY;
context2.closePath();
break;
}
previous = current;
}
}
function drawArc(context2, x2, y2, coords) {
const seg = segments(
coords[5],
// end x
coords[6],
// end y
coords[0],
// radius x
coords[1],
// radius y
coords[3],
// large flag
coords[4],
// sweep flag
coords[2],
// rotation
x2,
y2
);
for (let i2 = 0; i2 < seg.length; ++i2) {
const bez = bezier(seg[i2]);
context2.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
}
}
const Tan30 = 0.5773502691896257;
const builtins = {
"circle": {
draw: function(context2, size) {
const r2 = Math.sqrt(size) / 2;
context2.moveTo(r2, 0);
context2.arc(0, 0, r2, 0, Tau);
}
},
"cross": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, s2 = r2 / 2.5;
context2.moveTo(-r2, -s2);
context2.lineTo(-r2, s2);
context2.lineTo(-s2, s2);
context2.lineTo(-s2, r2);
context2.lineTo(s2, r2);
context2.lineTo(s2, s2);
context2.lineTo(r2, s2);
context2.lineTo(r2, -s2);
context2.lineTo(s2, -s2);
context2.lineTo(s2, -r2);
context2.lineTo(-s2, -r2);
context2.lineTo(-s2, -s2);
context2.closePath();
}
},
"diamond": {
draw: function(context2, size) {
const r2 = Math.sqrt(size) / 2;
context2.moveTo(-r2, 0);
context2.lineTo(0, -r2);
context2.lineTo(r2, 0);
context2.lineTo(0, r2);
context2.closePath();
}
},
"square": {
draw: function(context2, size) {
var w2 = Math.sqrt(size), x2 = -w2 / 2;
context2.rect(x2, x2, w2, w2);
}
},
"arrow": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, s2 = r2 / 7, t5 = r2 / 2.5, v2 = r2 / 8;
context2.moveTo(-s2, r2);
context2.lineTo(s2, r2);
context2.lineTo(s2, -v2);
context2.lineTo(t5, -v2);
context2.lineTo(0, -r2);
context2.lineTo(-t5, -v2);
context2.lineTo(-s2, -v2);
context2.closePath();
}
},
"wedge": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, h2 = HalfSqrt3 * r2, o2 = h2 - r2 * Tan30, b2 = r2 / 4;
context2.moveTo(0, -h2 - o2);
context2.lineTo(-b2, h2 - o2);
context2.lineTo(b2, h2 - o2);
context2.closePath();
}
},
"triangle": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, h2 = HalfSqrt3 * r2, o2 = h2 - r2 * Tan30;
context2.moveTo(0, -h2 - o2);
context2.lineTo(-r2, h2 - o2);
context2.lineTo(r2, h2 - o2);
context2.closePath();
}
},
"triangle-up": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, h2 = HalfSqrt3 * r2;
context2.moveTo(0, -h2);
context2.lineTo(-r2, h2);
context2.lineTo(r2, h2);
context2.closePath();
}
},
"triangle-down": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, h2 = HalfSqrt3 * r2;
context2.moveTo(0, h2);
context2.lineTo(-r2, -h2);
context2.lineTo(r2, -h2);
context2.closePath();
}
},
"triangle-right": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, h2 = HalfSqrt3 * r2;
context2.moveTo(h2, 0);
context2.lineTo(-h2, -r2);
context2.lineTo(-h2, r2);
context2.closePath();
}
},
"triangle-left": {
draw: function(context2, size) {
var r2 = Math.sqrt(size) / 2, h2 = HalfSqrt3 * r2;
context2.moveTo(-h2, 0);
context2.lineTo(h2, -r2);
context2.lineTo(h2, r2);
context2.closePath();
}
},
"stroke": {
draw: function(context2, size) {
const r2 = Math.sqrt(size) / 2;
context2.moveTo(-r2, 0);
context2.lineTo(r2, 0);
}
}
};
function symbols(_24) {
return has$2(builtins, _24) ? builtins[_24] : customSymbol(_24);
}
var custom8 = {};
function customSymbol(path2) {
if (!has$2(custom8, path2)) {
const parsed = parse$4(path2);
custom8[path2] = {
draw: function(context2, size) {
pathRender(context2, parsed, 0, 0, Math.sqrt(size) / 2);
}
};
}
return custom8[path2];
}
const C$2 = 0.448084975506;
function rectangleX(d2) {
return d2.x;
}
function rectangleY(d2) {
return d2.y;
}
function rectangleWidth(d2) {
return d2.width;
}
function rectangleHeight(d2) {
return d2.height;
}
function number$4(_24) {
return typeof _24 === "function" ? _24 : () => +_24;
}
function clamp(value2, min2, max2) {
return Math.max(min2, Math.min(value2, max2));
}
function vg_rect() {
var x2 = rectangleX, y2 = rectangleY, width2 = rectangleWidth, height2 = rectangleHeight, crTL = number$4(0), crTR = crTL, crBL = crTL, crBR = crTL, context2 = null;
function rectangle2(_24, x02, y02) {
var buffer, x12 = x02 != null ? x02 : +x2.call(this, _24), y12 = y02 != null ? y02 : +y2.call(this, _24), w2 = +width2.call(this, _24), h2 = +height2.call(this, _24), s2 = Math.min(w2, h2) / 2, tl2 = clamp(+crTL.call(this, _24), 0, s2), tr2 = clamp(+crTR.call(this, _24), 0, s2), bl2 = clamp(+crBL.call(this, _24), 0, s2), br2 = clamp(+crBR.call(this, _24), 0, s2);
if (!context2)
context2 = buffer = path$3();
if (tl2 <= 0 && tr2 <= 0 && bl2 <= 0 && br2 <= 0) {
context2.rect(x12, y12, w2, h2);
} else {
var x22 = x12 + w2, y22 = y12 + h2;
context2.moveTo(x12 + tl2, y12);
context2.lineTo(x22 - tr2, y12);
context2.bezierCurveTo(x22 - C$2 * tr2, y12, x22, y12 + C$2 * tr2, x22, y12 + tr2);
context2.lineTo(x22, y22 - br2);
context2.bezierCurveTo(x22, y22 - C$2 * br2, x22 - C$2 * br2, y22, x22 - br2, y22);
context2.lineTo(x12 + bl2, y22);
context2.bezierCurveTo(x12 + C$2 * bl2, y22, x12, y22 - C$2 * bl2, x12, y22 - bl2);
context2.lineTo(x12, y12 + tl2);
context2.bezierCurveTo(x12, y12 + C$2 * tl2, x12 + C$2 * tl2, y12, x12 + tl2, y12);
context2.closePath();
}
if (buffer) {
context2 = null;
return buffer + "" || null;
}
}
rectangle2.x = function(_24) {
if (arguments.length) {
x2 = number$4(_24);
return rectangle2;
} else {
return x2;
}
};
rectangle2.y = function(_24) {
if (arguments.length) {
y2 = number$4(_24);
return rectangle2;
} else {
return y2;
}
};
rectangle2.width = function(_24) {
if (arguments.length) {
width2 = number$4(_24);
return rectangle2;
} else {
return width2;
}
};
rectangle2.height = function(_24) {
if (arguments.length) {
height2 = number$4(_24);
return rectangle2;
} else {
return height2;
}
};
rectangle2.cornerRadius = function(tl2, tr2, br2, bl2) {
if (arguments.length) {
crTL = number$4(tl2);
crTR = tr2 != null ? number$4(tr2) : crTL;
crBR = br2 != null ? number$4(br2) : crTL;
crBL = bl2 != null ? number$4(bl2) : crTR;
return rectangle2;
} else {
return crTL;
}
};
rectangle2.context = function(_24) {
if (arguments.length) {
context2 = _24 == null ? null : _24;
return rectangle2;
} else {
return context2;
}
};
return rectangle2;
}
function vg_trail() {
var x2, y2, size, defined, context2 = null, ready, x12, y12, r1;
function point2(x22, y22, w2) {
const r2 = w2 / 2;
if (ready) {
var ux = y12 - y22, uy = x22 - x12;
if (ux || uy) {
var ud2 = Math.hypot(ux, uy), rx = (ux /= ud2) * r1, ry = (uy /= ud2) * r1, t5 = Math.atan2(uy, ux);
context2.moveTo(x12 - rx, y12 - ry);
context2.lineTo(x22 - ux * r2, y22 - uy * r2);
context2.arc(x22, y22, r2, t5 - Math.PI, t5);
context2.lineTo(x12 + rx, y12 + ry);
context2.arc(x12, y12, r1, t5, t5 + Math.PI);
} else {
context2.arc(x22, y22, r2, 0, Tau);
}
context2.closePath();
} else {
ready = 1;
}
x12 = x22;
y12 = y22;
r1 = r2;
}
function trail2(data2) {
var i2, n2 = data2.length, d2, defined0 = false, buffer;
if (context2 == null)
context2 = buffer = path$3();
for (i2 = 0; i2 <= n2; ++i2) {
if (!(i2 < n2 && defined(d2 = data2[i2], i2, data2)) === defined0) {
if (defined0 = !defined0)
ready = 0;
}
if (defined0)
point2(+x2(d2, i2, data2), +y2(d2, i2, data2), +size(d2, i2, data2));
}
if (buffer) {
context2 = null;
return buffer + "" || null;
}
}
trail2.x = function(_24) {
if (arguments.length) {
x2 = _24;
return trail2;
} else {
return x2;
}
};
trail2.y = function(_24) {
if (arguments.length) {
y2 = _24;
return trail2;
} else {
return y2;
}
};
trail2.size = function(_24) {
if (arguments.length) {
size = _24;
return trail2;
} else {
return size;
}
};
trail2.defined = function(_24) {
if (arguments.length) {
defined = _24;
return trail2;
} else {
return defined;
}
};
trail2.context = function(_24) {
if (arguments.length) {
if (_24 == null) {
context2 = null;
} else {
context2 = _24;
}
return trail2;
} else {
return context2;
}
};
return trail2;
}
function value$1$1(a2, b2) {
return a2 != null ? a2 : b2;
}
const x$5 = (item) => item.x || 0, y$7 = (item) => item.y || 0, w$2 = (item) => item.width || 0, h$7 = (item) => item.height || 0, xw = (item) => (item.x || 0) + (item.width || 0), yh = (item) => (item.y || 0) + (item.height || 0), sa$1 = (item) => item.startAngle || 0, ea$1 = (item) => item.endAngle || 0, pa$1 = (item) => item.padAngle || 0, ir$1 = (item) => item.innerRadius || 0, or$1 = (item) => item.outerRadius || 0, cr$1 = (item) => item.cornerRadius || 0, tl = (item) => value$1$1(item.cornerRadiusTopLeft, item.cornerRadius) || 0, tr$1 = (item) => value$1$1(item.cornerRadiusTopRight, item.cornerRadius) || 0, br$1 = (item) => value$1$1(item.cornerRadiusBottomRight, item.cornerRadius) || 0, bl = (item) => value$1$1(item.cornerRadiusBottomLeft, item.cornerRadius) || 0, sz = (item) => value$1$1(item.size, 64), ts = (item) => item.size || 1, def = (item) => !(item.defined === false), type = (item) => symbols(item.shape || "circle");
const arcShape = arc$2$1().startAngle(sa$1).endAngle(ea$1).padAngle(pa$1).innerRadius(ir$1).outerRadius(or$1).cornerRadius(cr$1), areavShape = area$2$1().x(x$5).y1(y$7).y0(yh).defined(def), areahShape = area$2$1().y(y$7).x1(x$5).x0(xw).defined(def), lineShape = line$2$1().x(x$5).y(y$7).defined(def), rectShape = vg_rect().x(x$5).y(y$7).width(w$2).height(h$7).cornerRadius(tl, tr$1, br$1, bl), symbolShape = Symbol$2().type(type).size(sz), trailShape = vg_trail().x(x$5).y(y$7).defined(def).size(ts);
function hasCornerRadius(item) {
return item.cornerRadius || item.cornerRadiusTopLeft || item.cornerRadiusTopRight || item.cornerRadiusBottomRight || item.cornerRadiusBottomLeft;
}
function arc$1(context2, item) {
return arcShape.context(context2)(item);
}
function area$1(context2, items) {
const item = items[0], interp = item.interpolate || "linear";
return (item.orient === "horizontal" ? areahShape : areavShape).curve(curves(interp, item.orient, item.tension)).context(context2)(items);
}
function line$1(context2, items) {
const item = items[0], interp = item.interpolate || "linear";
return lineShape.curve(curves(interp, item.orient, item.tension)).context(context2)(items);
}
function rectangle(context2, item, x2, y2) {
return rectShape.context(context2)(item, x2, y2);
}
function shape$1(context2, item) {
return (item.mark.shape || item.shape).context(context2)(item);
}
function symbol$1(context2, item) {
return symbolShape.context(context2)(item);
}
function trail$1(context2, items) {
return trailShape.context(context2)(items);
}
var clip_id = 1;
function clip$1$1(renderer, item, size) {
var clip2 = item.clip, defs = renderer._defs, id = item.clip_id || (item.clip_id = "clip" + clip_id++), c2 = defs.clipping[id] || (defs.clipping[id] = {
id
});
if (isFunction(clip2)) {
c2.path = clip2(null);
} else if (hasCornerRadius(size)) {
c2.path = rectangle(null, size, 0, 0);
} else {
c2.width = size.width || 0;
c2.height = size.height || 0;
}
return "url(#" + id + ")";
}
function Bounds$1(b2) {
this.clear();
if (b2)
this.union(b2);
}
Bounds$1.prototype = {
clone() {
return new Bounds$1(this);
},
clear() {
this.x1 = +Number.MAX_VALUE;
this.y1 = +Number.MAX_VALUE;
this.x2 = -Number.MAX_VALUE;
this.y2 = -Number.MAX_VALUE;
return this;
},
empty() {
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
},
equals(b2) {
return this.x1 === b2.x1 && this.y1 === b2.y1 && this.x2 === b2.x2 && this.y2 === b2.y2;
},
set(x12, y12, x2, y2) {
if (x2 < x12) {
this.x2 = x12;
this.x1 = x2;
} else {
this.x1 = x12;
this.x2 = x2;
}
if (y2 < y12) {
this.y2 = y12;
this.y1 = y2;
} else {
this.y1 = y12;
this.y2 = y2;
}
return this;
},
add(x2, y2) {
if (x2 < this.x1)
this.x1 = x2;
if (y2 < this.y1)
this.y1 = y2;
if (x2 > this.x2)
this.x2 = x2;
if (y2 > this.y2)
this.y2 = y2;
return this;
},
expand(d2) {
this.x1 -= d2;
this.y1 -= d2;
this.x2 += d2;
this.y2 += d2;
return this;
},
round() {
this.x1 = Math.floor(this.x1);
this.y1 = Math.floor(this.y1);
this.x2 = Math.ceil(this.x2);
this.y2 = Math.ceil(this.y2);
return this;
},
scale(s2) {
this.x1 *= s2;
this.y1 *= s2;
this.x2 *= s2;
this.y2 *= s2;
return this;
},
translate(dx, dy) {
this.x1 += dx;
this.x2 += dx;
this.y1 += dy;
this.y2 += dy;
return this;
},
rotate(angle2, x2, y2) {
const p2 = this.rotatedPoints(angle2, x2, y2);
return this.clear().add(p2[0], p2[1]).add(p2[2], p2[3]).add(p2[4], p2[5]).add(p2[6], p2[7]);
},
rotatedPoints(angle2, x2, y2) {
var {
x1: x12,
y1: y12,
x2: x22,
y2: y22
} = this, cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), cx = x2 - x2 * cos2 + y2 * sin2, cy = y2 - x2 * sin2 - y2 * cos2;
return [cos2 * x12 - sin2 * y12 + cx, sin2 * x12 + cos2 * y12 + cy, cos2 * x12 - sin2 * y22 + cx, sin2 * x12 + cos2 * y22 + cy, cos2 * x22 - sin2 * y12 + cx, sin2 * x22 + cos2 * y12 + cy, cos2 * x22 - sin2 * y22 + cx, sin2 * x22 + cos2 * y22 + cy];
},
union(b2) {
if (b2.x1 < this.x1)
this.x1 = b2.x1;
if (b2.y1 < this.y1)
this.y1 = b2.y1;
if (b2.x2 > this.x2)
this.x2 = b2.x2;
if (b2.y2 > this.y2)
this.y2 = b2.y2;
return this;
},
intersect(b2) {
if (b2.x1 > this.x1)
this.x1 = b2.x1;
if (b2.y1 > this.y1)
this.y1 = b2.y1;
if (b2.x2 < this.x2)
this.x2 = b2.x2;
if (b2.y2 < this.y2)
this.y2 = b2.y2;
return this;
},
encloses(b2) {
return b2 && this.x1 <= b2.x1 && this.x2 >= b2.x2 && this.y1 <= b2.y1 && this.y2 >= b2.y2;
},
alignsWith(b2) {
return b2 && (this.x1 == b2.x1 || this.x2 == b2.x2 || this.y1 == b2.y1 || this.y2 == b2.y2);
},
intersects(b2) {
return b2 && !(this.x2 < b2.x1 || this.x1 > b2.x2 || this.y2 < b2.y1 || this.y1 > b2.y2);
},
contains(x2, y2) {
return !(x2 < this.x1 || x2 > this.x2 || y2 < this.y1 || y2 > this.y2);
},
width() {
return this.x2 - this.x1;
},
height() {
return this.y2 - this.y1;
}
};
function Item(mark) {
this.mark = mark;
this.bounds = this.bounds || new Bounds$1();
}
function GroupItem(mark) {
Item.call(this, mark);
this.items = this.items || [];
}
inherits(GroupItem, Item);
function ResourceLoader(customLoader) {
this._pending = 0;
this._loader = customLoader || loader();
}
function increment(loader2) {
loader2._pending += 1;
}
function decrement(loader2) {
loader2._pending -= 1;
}
ResourceLoader.prototype = {
pending() {
return this._pending;
},
sanitizeURL(uri) {
const loader2 = this;
increment(loader2);
return loader2._loader.sanitize(uri, {
context: "href"
}).then((opt) => {
decrement(loader2);
return opt;
}).catch(() => {
decrement(loader2);
return null;
});
},
loadImage(uri) {
const loader2 = this, Image2 = domImage();
increment(loader2);
return loader2._loader.sanitize(uri, {
context: "image"
}).then((opt) => {
const url2 = opt.href;
if (!url2 || !Image2)
throw {
url: url2
};
const img = new Image2();
const cors = has$2(opt, "crossOrigin") ? opt.crossOrigin : "anonymous";
if (cors != null)
img.crossOrigin = cors;
img.onload = () => decrement(loader2);
img.onerror = () => decrement(loader2);
img.src = url2;
return img;
}).catch((e7) => {
decrement(loader2);
return {
complete: false,
width: 0,
height: 0,
src: e7 && e7.url || ""
};
});
},
ready() {
const loader2 = this;
return new Promise((accept) => {
function poll(value2) {
if (!loader2.pending())
accept(value2);
else
setTimeout(() => {
poll(true);
}, 10);
}
poll(false);
});
}
};
function boundStroke(bounds2, item, miter) {
if (item.stroke && item.opacity !== 0 && item.strokeOpacity !== 0) {
const sw = item.strokeWidth != null ? +item.strokeWidth : 1;
bounds2.expand(sw + (miter ? miterAdjustment(item, sw) : 0));
}
return bounds2;
}
function miterAdjustment(item, strokeWidth) {
return item.strokeJoin && item.strokeJoin !== "miter" ? 0 : strokeWidth;
}
const circleThreshold = Tau - 1e-8;
let bounds, lx, ly, rot, ma$1, mb, mc$1, md;
const add$1 = (x2, y2) => bounds.add(x2, y2);
const addL = (x2, y2) => add$1(lx = x2, ly = y2);
const addX = (x2) => add$1(x2, bounds.y1);
const addY = (y2) => add$1(bounds.x1, y2);
const px = (x2, y2) => ma$1 * x2 + mc$1 * y2;
const py = (x2, y2) => mb * x2 + md * y2;
const addp = (x2, y2) => add$1(px(x2, y2), py(x2, y2));
const addpL = (x2, y2) => addL(px(x2, y2), py(x2, y2));
function boundContext(_24, deg2) {
bounds = _24;
if (deg2) {
rot = deg2 * DegToRad;
ma$1 = md = Math.cos(rot);
mb = Math.sin(rot);
mc$1 = -mb;
} else {
ma$1 = md = 1;
rot = mb = mc$1 = 0;
}
return context$1;
}
const context$1 = {
beginPath() {
},
closePath() {
},
moveTo: addpL,
lineTo: addpL,
rect(x2, y2, w2, h2) {
if (rot) {
addp(x2 + w2, y2);
addp(x2 + w2, y2 + h2);
addp(x2, y2 + h2);
addpL(x2, y2);
} else {
add$1(x2 + w2, y2 + h2);
addL(x2, y2);
}
},
quadraticCurveTo(x12, y12, x2, y2) {
const px1 = px(x12, y12), py1 = py(x12, y12), px2 = px(x2, y2), py2 = py(x2, y2);
quadExtrema(lx, px1, px2, addX);
quadExtrema(ly, py1, py2, addY);
addL(px2, py2);
},
bezierCurveTo(x12, y12, x2, y2, x3, y3) {
const px1 = px(x12, y12), py1 = py(x12, y12), px2 = px(x2, y2), py2 = py(x2, y2), px3 = px(x3, y3), py3 = py(x3, y3);
cubicExtrema(lx, px1, px2, px3, addX);
cubicExtrema(ly, py1, py2, py3, addY);
addL(px3, py3);
},
arc(cx, cy, r2, sa2, ea2, ccw) {
sa2 += rot;
ea2 += rot;
lx = r2 * Math.cos(ea2) + cx;
ly = r2 * Math.sin(ea2) + cy;
if (Math.abs(ea2 - sa2) > circleThreshold) {
add$1(cx - r2, cy - r2);
add$1(cx + r2, cy + r2);
} else {
const update2 = (a2) => add$1(r2 * Math.cos(a2) + cx, r2 * Math.sin(a2) + cy);
let s2, i2;
update2(sa2);
update2(ea2);
if (ea2 !== sa2) {
sa2 = sa2 % Tau;
if (sa2 < 0)
sa2 += Tau;
ea2 = ea2 % Tau;
if (ea2 < 0)
ea2 += Tau;
if (ea2 < sa2) {
ccw = !ccw;
s2 = sa2;
sa2 = ea2;
ea2 = s2;
}
if (ccw) {
ea2 -= Tau;
s2 = sa2 - sa2 % HalfPi;
for (i2 = 0; i2 < 4 && s2 > ea2; ++i2, s2 -= HalfPi)
update2(s2);
} else {
s2 = sa2 - sa2 % HalfPi + HalfPi;
for (i2 = 0; i2 < 4 && s2 < ea2; ++i2, s2 = s2 + HalfPi)
update2(s2);
}
}
}
}
};
function quadExtrema(x02, x12, x2, cb2) {
const t5 = (x02 - x12) / (x02 + x2 - 2 * x12);
if (0 < t5 && t5 < 1)
cb2(x02 + (x12 - x02) * t5);
}
function cubicExtrema(x02, x12, x2, x3, cb2) {
const a2 = x3 - x02 + 3 * x12 - 3 * x2, b2 = x02 + x2 - 2 * x12, c2 = x02 - x12;
let t02 = 0, t12 = 0, r2;
if (Math.abs(a2) > Epsilon) {
r2 = b2 * b2 + c2 * a2;
if (r2 >= 0) {
r2 = Math.sqrt(r2);
t02 = (-b2 + r2) / a2;
t12 = (-b2 - r2) / a2;
}
} else {
t02 = 0.5 * c2 / b2;
}
if (0 < t02 && t02 < 1)
cb2(cubic(t02, x02, x12, x2, x3));
if (0 < t12 && t12 < 1)
cb2(cubic(t12, x02, x12, x2, x3));
}
function cubic(t5, x02, x12, x2, x3) {
const s2 = 1 - t5, s22 = s2 * s2, t22 = t5 * t5;
return s22 * s2 * x02 + 3 * s22 * t5 * x12 + 3 * s2 * t22 * x2 + t22 * t5 * x3;
}
var context$2 = (context$2 = domCanvas(1, 1)) ? context$2.getContext("2d") : null;
const b$2 = new Bounds$1();
function intersectPath(draw2) {
return function(item, brush) {
if (!context$2)
return true;
draw2(context$2, item);
b$2.clear().union(item.bounds).intersect(brush).round();
const {
x1: x12,
y1: y12,
x2,
y2
} = b$2;
for (let y3 = y12; y3 <= y2; ++y3) {
for (let x3 = x12; x3 <= x2; ++x3) {
if (context$2.isPointInPath(x3, y3)) {
return true;
}
}
}
return false;
};
}
function intersectPoint(item, box) {
return box.contains(item.x || 0, item.y || 0);
}
function intersectRect(item, box) {
const x2 = item.x || 0, y2 = item.y || 0, w2 = item.width || 0, h2 = item.height || 0;
return box.intersects(b$2.set(x2, y2, x2 + w2, y2 + h2));
}
function intersectRule(item, box) {
const x2 = item.x || 0, y2 = item.y || 0, x22 = item.x2 != null ? item.x2 : x2, y22 = item.y2 != null ? item.y2 : y2;
return intersectBoxLine(box, x2, y2, x22, y22);
}
function intersectBoxLine(box, x2, y2, u2, v2) {
const {
x1: x12,
y1: y12,
x2: x22,
y2: y22
} = box, dx = u2 - x2, dy = v2 - y2;
let t02 = 0, t12 = 1, p2, q2, r2, e7;
for (e7 = 0; e7 < 4; ++e7) {
if (e7 === 0) {
p2 = -dx;
q2 = -(x12 - x2);
}
if (e7 === 1) {
p2 = dx;
q2 = x22 - x2;
}
if (e7 === 2) {
p2 = -dy;
q2 = -(y12 - y2);
}
if (e7 === 3) {
p2 = dy;
q2 = y22 - y2;
}
if (Math.abs(p2) < 1e-10 && q2 < 0)
return false;
r2 = q2 / p2;
if (p2 < 0) {
if (r2 > t12)
return false;
else if (r2 > t02)
t02 = r2;
} else if (p2 > 0) {
if (r2 < t02)
return false;
else if (r2 < t12)
t12 = r2;
}
}
return true;
}
function blend(context2, item) {
context2.globalCompositeOperation = item.blend || "source-over";
}
function value$2(value2, dflt2) {
return value2 == null ? dflt2 : value2;
}
function addStops(gradient2, stops) {
const n2 = stops.length;
for (let i2 = 0; i2 < n2; ++i2) {
gradient2.addColorStop(stops[i2].offset, stops[i2].color);
}
return gradient2;
}
function gradient$1(context2, spec, bounds2) {
const w2 = bounds2.width(), h2 = bounds2.height();
let gradient2;
if (spec.gradient === "radial") {
gradient2 = context2.createRadialGradient(bounds2.x1 + value$2(spec.x1, 0.5) * w2, bounds2.y1 + value$2(spec.y1, 0.5) * h2, Math.max(w2, h2) * value$2(spec.r1, 0), bounds2.x1 + value$2(spec.x2, 0.5) * w2, bounds2.y1 + value$2(spec.y2, 0.5) * h2, Math.max(w2, h2) * value$2(spec.r2, 0.5));
} else {
const x12 = value$2(spec.x1, 0), y12 = value$2(spec.y1, 0), x2 = value$2(spec.x2, 1), y2 = value$2(spec.y2, 0);
if (x12 === x2 || y12 === y2 || w2 === h2) {
gradient2 = context2.createLinearGradient(bounds2.x1 + x12 * w2, bounds2.y1 + y12 * h2, bounds2.x1 + x2 * w2, bounds2.y1 + y2 * h2);
} else {
const image2 = domCanvas(Math.ceil(w2), Math.ceil(h2)), ictx = image2.getContext("2d");
ictx.scale(w2, h2);
ictx.fillStyle = addStops(ictx.createLinearGradient(x12, y12, x2, y2), spec.stops);
ictx.fillRect(0, 0, w2, h2);
return context2.createPattern(image2, "no-repeat");
}
}
return addStops(gradient2, spec.stops);
}
function color$4(context2, item, value2) {
return isGradient(value2) ? gradient$1(context2, value2, item.bounds) : value2;
}
function fill(context2, item, opacity2) {
opacity2 *= item.fillOpacity == null ? 1 : item.fillOpacity;
if (opacity2 > 0) {
context2.globalAlpha = opacity2;
context2.fillStyle = color$4(context2, item, item.fill);
return true;
} else {
return false;
}
}
var Empty = [];
function stroke(context2, item, opacity2) {
var lw = (lw = item.strokeWidth) != null ? lw : 1;
if (lw <= 0)
return false;
opacity2 *= item.strokeOpacity == null ? 1 : item.strokeOpacity;
if (opacity2 > 0) {
context2.globalAlpha = opacity2;
context2.strokeStyle = color$4(context2, item, item.stroke);
context2.lineWidth = lw;
context2.lineCap = item.strokeCap || "butt";
context2.lineJoin = item.strokeJoin || "miter";
context2.miterLimit = item.strokeMiterLimit || 10;
if (context2.setLineDash) {
context2.setLineDash(item.strokeDash || Empty);
context2.lineDashOffset = item.strokeDashOffset || 0;
}
return true;
} else {
return false;
}
}
function compare2(a2, b2) {
return a2.zindex - b2.zindex || a2.index - b2.index;
}
function zorder(scene) {
if (!scene.zdirty)
return scene.zitems;
var items = scene.items, output3 = [], item, i2, n2;
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
item = items[i2];
item.index = i2;
if (item.zindex)
output3.push(item);
}
scene.zdirty = false;
return scene.zitems = output3.sort(compare2);
}
function visit(scene, visitor) {
var items = scene.items, i2, n2;
if (!items || !items.length)
return;
const zitems = zorder(scene);
if (zitems && zitems.length) {
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
if (!items[i2].zindex)
visitor(items[i2]);
}
items = zitems;
}
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
visitor(items[i2]);
}
}
function pickVisit(scene, visitor) {
var items = scene.items, hit2, i2;
if (!items || !items.length)
return null;
const zitems = zorder(scene);
if (zitems && zitems.length)
items = zitems;
for (i2 = items.length; --i2 >= 0; ) {
if (hit2 = visitor(items[i2]))
return hit2;
}
if (items === zitems) {
for (items = scene.items, i2 = items.length; --i2 >= 0; ) {
if (!items[i2].zindex) {
if (hit2 = visitor(items[i2]))
return hit2;
}
}
}
return null;
}
function drawAll(path2) {
return function(context2, scene, bounds2) {
visit(scene, (item) => {
if (!bounds2 || bounds2.intersects(item.bounds)) {
drawPath(path2, context2, item, item);
}
});
};
}
function drawOne(path2) {
return function(context2, scene, bounds2) {
if (scene.items.length && (!bounds2 || bounds2.intersects(scene.bounds))) {
drawPath(path2, context2, scene.items[0], scene.items);
}
};
}
function drawPath(path2, context2, item, items) {
var opacity2 = item.opacity == null ? 1 : item.opacity;
if (opacity2 === 0)
return;
if (path2(context2, items))
return;
blend(context2, item);
if (item.fill && fill(context2, item, opacity2)) {
context2.fill();
}
if (item.stroke && stroke(context2, item, opacity2)) {
context2.stroke();
}
}
function pick$1(test2) {
test2 = test2 || truthy;
return function(context2, scene, x2, y2, gx, gy) {
x2 *= context2.pixelRatio;
y2 *= context2.pixelRatio;
return pickVisit(scene, (item) => {
const b2 = item.bounds;
if (b2 && !b2.contains(gx, gy) || !b2)
return;
if (test2(context2, item, x2, y2, gx, gy))
return item;
});
};
}
function hitPath(path2, filled) {
return function(context2, o2, x2, y2) {
var item = Array.isArray(o2) ? o2[0] : o2, fill2 = filled == null ? item.fill : filled, stroke2 = item.stroke && context2.isPointInStroke, lw, lc2;
if (stroke2) {
lw = item.strokeWidth;
lc2 = item.strokeCap;
context2.lineWidth = lw != null ? lw : 1;
context2.lineCap = lc2 != null ? lc2 : "butt";
}
return path2(context2, o2) ? false : fill2 && context2.isPointInPath(x2, y2) || stroke2 && context2.isPointInStroke(x2, y2);
};
}
function pickPath(path2) {
return pick$1(hitPath(path2));
}
function translate$1(x2, y2) {
return "translate(" + x2 + "," + y2 + ")";
}
function rotate(a2) {
return "rotate(" + a2 + ")";
}
function scale$3(scaleX, scaleY2) {
return "scale(" + scaleX + "," + scaleY2 + ")";
}
function translateItem(item) {
return translate$1(item.x || 0, item.y || 0);
}
function rotateItem(item) {
return translate$1(item.x || 0, item.y || 0) + (item.angle ? " " + rotate(item.angle) : "");
}
function transformItem(item) {
return translate$1(item.x || 0, item.y || 0) + (item.angle ? " " + rotate(item.angle) : "") + (item.scaleX || item.scaleY ? " " + scale$3(item.scaleX || 1, item.scaleY || 1) : "");
}
function markItemPath(type2, shape2, isect) {
function attr2(emit2, item) {
emit2("transform", rotateItem(item));
emit2("d", shape2(null, item));
}
function bound2(bounds2, item) {
shape2(boundContext(bounds2, item.angle), item);
return boundStroke(bounds2, item).translate(item.x || 0, item.y || 0);
}
function draw2(context2, item) {
var x2 = item.x || 0, y2 = item.y || 0, a2 = item.angle || 0;
context2.translate(x2, y2);
if (a2)
context2.rotate(a2 *= DegToRad);
context2.beginPath();
shape2(context2, item);
if (a2)
context2.rotate(-a2);
context2.translate(-x2, -y2);
}
return {
type: type2,
tag: "path",
nested: false,
attr: attr2,
bound: bound2,
draw: drawAll(draw2),
pick: pickPath(draw2),
isect: isect || intersectPath(draw2)
};
}
var arc$2 = markItemPath("arc", arc$1);
function pickArea(a2, p2) {
var v2 = a2[0].orient === "horizontal" ? p2[1] : p2[0], z2 = a2[0].orient === "horizontal" ? "y" : "x", i2 = a2.length, min2 = Infinity, hit2, d2;
while (--i2 >= 0) {
if (a2[i2].defined === false)
continue;
d2 = Math.abs(a2[i2][z2] - v2);
if (d2 < min2) {
min2 = d2;
hit2 = a2[i2];
}
}
return hit2;
}
function pickLine(a2, p2) {
var t5 = Math.pow(a2[0].strokeWidth || 1, 2), i2 = a2.length, dx, dy, dd2;
while (--i2 >= 0) {
if (a2[i2].defined === false)
continue;
dx = a2[i2].x - p2[0];
dy = a2[i2].y - p2[1];
dd2 = dx * dx + dy * dy;
if (dd2 < t5)
return a2[i2];
}
return null;
}
function pickTrail(a2, p2) {
var i2 = a2.length, dx, dy, dd2;
while (--i2 >= 0) {
if (a2[i2].defined === false)
continue;
dx = a2[i2].x - p2[0];
dy = a2[i2].y - p2[1];
dd2 = dx * dx + dy * dy;
dx = a2[i2].size || 1;
if (dd2 < dx * dx)
return a2[i2];
}
return null;
}
function markMultiItemPath(type2, shape2, tip) {
function attr2(emit2, item) {
var items = item.mark.items;
if (items.length)
emit2("d", shape2(null, items));
}
function bound2(bounds2, mark) {
var items = mark.items;
if (items.length === 0) {
return bounds2;
} else {
shape2(boundContext(bounds2), items);
return boundStroke(bounds2, items[0]);
}
}
function draw2(context2, items) {
context2.beginPath();
shape2(context2, items);
}
const hit2 = hitPath(draw2);
function pick2(context2, scene, x2, y2, gx, gy) {
var items = scene.items, b2 = scene.bounds;
if (!items || !items.length || b2 && !b2.contains(gx, gy)) {
return null;
}
x2 *= context2.pixelRatio;
y2 *= context2.pixelRatio;
return hit2(context2, items, x2, y2) ? items[0] : null;
}
return {
type: type2,
tag: "path",
nested: true,
attr: attr2,
bound: bound2,
draw: drawOne(draw2),
pick: pick2,
isect: intersectPoint,
tip
};
}
var area$2 = markMultiItemPath("area", area$1, pickArea);
function clip$2(context2, scene) {
var clip2 = scene.clip;
context2.save();
if (isFunction(clip2)) {
context2.beginPath();
clip2(context2);
context2.clip();
} else {
clipGroup(context2, scene.group);
}
}
function clipGroup(context2, group2) {
context2.beginPath();
hasCornerRadius(group2) ? rectangle(context2, group2, 0, 0) : context2.rect(0, 0, group2.width || 0, group2.height || 0);
context2.clip();
}
function offset$1(item) {
const sw = value$2(item.strokeWidth, 1);
return item.strokeOffset != null ? item.strokeOffset : item.stroke && sw > 0.5 && sw < 1.5 ? 0.5 - Math.abs(sw - 1) : 0;
}
function attr$5(emit2, item) {
emit2("transform", translateItem(item));
}
function emitRectangle(emit2, item) {
const off = offset$1(item);
emit2("d", rectangle(null, item, off, off));
}
function background$1(emit2, item) {
emit2("class", "background");
emit2("aria-hidden", true);
emitRectangle(emit2, item);
}
function foreground(emit2, item) {
emit2("class", "foreground");
emit2("aria-hidden", true);
if (item.strokeForeground) {
emitRectangle(emit2, item);
} else {
emit2("d", "");
}
}
function content$1(emit2, item, renderer) {
const url2 = item.clip ? clip$1$1(renderer, item, item) : null;
emit2("clip-path", url2);
}
function bound$5(bounds2, group2) {
if (!group2.clip && group2.items) {
const items = group2.items, m2 = items.length;
for (let j2 = 0; j2 < m2; ++j2) {
bounds2.union(items[j2].bounds);
}
}
if ((group2.clip || group2.width || group2.height) && !group2.noBound) {
bounds2.add(0, 0).add(group2.width || 0, group2.height || 0);
}
boundStroke(bounds2, group2);
return bounds2.translate(group2.x || 0, group2.y || 0);
}
function rectanglePath(context2, group2, x2, y2) {
const off = offset$1(group2);
context2.beginPath();
rectangle(context2, group2, (x2 || 0) + off, (y2 || 0) + off);
}
const hitBackground = hitPath(rectanglePath);
const hitForeground = hitPath(rectanglePath, false);
const hitCorner = hitPath(rectanglePath, true);
function draw$4(context2, scene, bounds2, markTypes) {
visit(scene, (group2) => {
const gx = group2.x || 0, gy = group2.y || 0, fore = group2.strokeForeground, opacity2 = group2.opacity == null ? 1 : group2.opacity;
if ((group2.stroke || group2.fill) && opacity2) {
rectanglePath(context2, group2, gx, gy);
blend(context2, group2);
if (group2.fill && fill(context2, group2, opacity2)) {
context2.fill();
}
if (group2.stroke && !fore && stroke(context2, group2, opacity2)) {
context2.stroke();
}
}
context2.save();
context2.translate(gx, gy);
if (group2.clip)
clipGroup(context2, group2);
if (bounds2)
bounds2.translate(-gx, -gy);
visit(group2, (item) => {
if (item.marktype === "group" || markTypes == null || markTypes.includes(item.marktype)) {
this.draw(context2, item, bounds2, markTypes);
}
});
if (bounds2)
bounds2.translate(gx, gy);
context2.restore();
if (fore && group2.stroke && opacity2) {
rectanglePath(context2, group2, gx, gy);
blend(context2, group2);
if (stroke(context2, group2, opacity2)) {
context2.stroke();
}
}
});
}
function pick(context2, scene, x2, y2, gx, gy) {
if (scene.bounds && !scene.bounds.contains(gx, gy) || !scene.items) {
return null;
}
const cx = x2 * context2.pixelRatio, cy = y2 * context2.pixelRatio;
return pickVisit(scene, (group2) => {
let hit2, dx, dy;
const b2 = group2.bounds;
if (b2 && !b2.contains(gx, gy))
return;
dx = group2.x || 0;
dy = group2.y || 0;
const dw = dx + (group2.width || 0), dh2 = dy + (group2.height || 0), c2 = group2.clip;
if (c2 && (gx < dx || gx > dw || gy < dy || gy > dh2))
return;
context2.save();
context2.translate(dx, dy);
dx = gx - dx;
dy = gy - dy;
if (c2 && hasCornerRadius(group2) && !hitCorner(context2, group2, cx, cy)) {
context2.restore();
return null;
}
const fore = group2.strokeForeground, ix = scene.interactive !== false;
if (ix && fore && group2.stroke && hitForeground(context2, group2, cx, cy)) {
context2.restore();
return group2;
}
hit2 = pickVisit(group2, (mark) => pickMark(mark, dx, dy) ? this.pick(mark, x2, y2, dx, dy) : null);
if (!hit2 && ix && (group2.fill || !fore && group2.stroke) && hitBackground(context2, group2, cx, cy)) {
hit2 = group2;
}
context2.restore();
return hit2 || null;
});
}
function pickMark(mark, x2, y2) {
return (mark.interactive !== false || mark.marktype === "group") && mark.bounds && mark.bounds.contains(x2, y2);
}
var group = {
type: "group",
tag: "g",
nested: false,
attr: attr$5,
bound: bound$5,
draw: draw$4,
pick,
isect: intersectRect,
content: content$1,
background: background$1,
foreground
};
var metadata = {
"xmlns": "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
"version": "1.1"
};
function getImage(item, renderer) {
var image2 = item.image;
if (!image2 || item.url && item.url !== image2.url) {
image2 = {
complete: false,
width: 0,
height: 0
};
renderer.loadImage(item.url).then((image3) => {
item.image = image3;
item.image.url = item.url;
});
}
return image2;
}
function imageWidth(item, image2) {
return item.width != null ? item.width : !image2 || !image2.width ? 0 : item.aspect !== false && item.height ? item.height * image2.width / image2.height : image2.width;
}
function imageHeight(item, image2) {
return item.height != null ? item.height : !image2 || !image2.height ? 0 : item.aspect !== false && item.width ? item.width * image2.height / image2.width : image2.height;
}
function imageXOffset(align, w2) {
return align === "center" ? w2 / 2 : align === "right" ? w2 : 0;
}
function imageYOffset(baseline2, h2) {
return baseline2 === "middle" ? h2 / 2 : baseline2 === "bottom" ? h2 : 0;
}
function attr$4(emit2, item, renderer) {
const img = getImage(item, renderer), w2 = imageWidth(item, img), h2 = imageHeight(item, img), x2 = (item.x || 0) - imageXOffset(item.align, w2), y2 = (item.y || 0) - imageYOffset(item.baseline, h2), i2 = !img.src && img.toDataURL ? img.toDataURL() : img.src || "";
emit2("href", i2, metadata["xmlns:xlink"], "xlink:href");
emit2("transform", translate$1(x2, y2));
emit2("width", w2);
emit2("height", h2);
emit2("preserveAspectRatio", item.aspect === false ? "none" : "xMidYMid");
}
function bound$4(bounds2, item) {
const img = item.image, w2 = imageWidth(item, img), h2 = imageHeight(item, img), x2 = (item.x || 0) - imageXOffset(item.align, w2), y2 = (item.y || 0) - imageYOffset(item.baseline, h2);
return bounds2.set(x2, y2, x2 + w2, y2 + h2);
}
function draw$3(context2, scene, bounds2) {
visit(scene, (item) => {
if (bounds2 && !bounds2.intersects(item.bounds))
return;
const img = getImage(item, this);
let w2 = imageWidth(item, img);
let h2 = imageHeight(item, img);
if (w2 === 0 || h2 === 0)
return;
let x2 = (item.x || 0) - imageXOffset(item.align, w2), y2 = (item.y || 0) - imageYOffset(item.baseline, h2), opacity2, ar0, ar1, t5;
if (item.aspect !== false) {
ar0 = img.width / img.height;
ar1 = item.width / item.height;
if (ar0 === ar0 && ar1 === ar1 && ar0 !== ar1) {
if (ar1 < ar0) {
t5 = w2 / ar0;
y2 += (h2 - t5) / 2;
h2 = t5;
} else {
t5 = h2 * ar0;
x2 += (w2 - t5) / 2;
w2 = t5;
}
}
}
if (img.complete || img.toDataURL) {
blend(context2, item);
context2.globalAlpha = (opacity2 = item.opacity) != null ? opacity2 : 1;
context2.imageSmoothingEnabled = item.smooth !== false;
context2.drawImage(img, x2, y2, w2, h2);
}
});
}
var image$1 = {
type: "image",
tag: "image",
nested: false,
attr: attr$4,
bound: bound$4,
draw: draw$3,
pick: pick$1(),
isect: truthy,
// bounds check is sufficient
get: getImage,
xOffset: imageXOffset,
yOffset: imageYOffset
};
var line$2 = markMultiItemPath("line", line$1, pickLine);
function attr$3(emit2, item) {
var sx = item.scaleX || 1, sy = item.scaleY || 1;
if (sx !== 1 || sy !== 1) {
emit2("vector-effect", "non-scaling-stroke");
}
emit2("transform", transformItem(item));
emit2("d", item.path);
}
function path$1(context2, item) {
var path2 = item.path;
if (path2 == null)
return true;
var x2 = item.x || 0, y2 = item.y || 0, sx = item.scaleX || 1, sy = item.scaleY || 1, a2 = (item.angle || 0) * DegToRad, cache2 = item.pathCache;
if (!cache2 || cache2.path !== path2) {
(item.pathCache = cache2 = parse$4(path2)).path = path2;
}
if (a2 && context2.rotate && context2.translate) {
context2.translate(x2, y2);
context2.rotate(a2);
pathRender(context2, cache2, 0, 0, sx, sy);
context2.rotate(-a2);
context2.translate(-x2, -y2);
} else {
pathRender(context2, cache2, x2, y2, sx, sy);
}
}
function bound$3(bounds2, item) {
return path$1(boundContext(bounds2, item.angle), item) ? bounds2.set(0, 0, 0, 0) : boundStroke(bounds2, item, true);
}
var path$2 = {
type: "path",
tag: "path",
nested: false,
attr: attr$3,
bound: bound$3,
draw: drawAll(path$1),
pick: pickPath(path$1),
isect: intersectPath(path$1)
};
function attr$2(emit2, item) {
emit2("d", rectangle(null, item));
}
function bound$2(bounds2, item) {
var x2, y2;
return boundStroke(bounds2.set(x2 = item.x || 0, y2 = item.y || 0, x2 + item.width || 0, y2 + item.height || 0), item);
}
function draw$2(context2, item) {
context2.beginPath();
rectangle(context2, item);
}
var rect = {
type: "rect",
tag: "path",
nested: false,
attr: attr$2,
bound: bound$2,
draw: drawAll(draw$2),
pick: pickPath(draw$2),
isect: intersectRect
};
function attr$1(emit2, item) {
emit2("transform", translateItem(item));
emit2("x2", item.x2 != null ? item.x2 - (item.x || 0) : 0);
emit2("y2", item.y2 != null ? item.y2 - (item.y || 0) : 0);
}
function bound$1(bounds2, item) {
var x12, y12;
return boundStroke(bounds2.set(x12 = item.x || 0, y12 = item.y || 0, item.x2 != null ? item.x2 : x12, item.y2 != null ? item.y2 : y12), item);
}
function path(context2, item, opacity2) {
var x12, y12, x2, y2;
if (item.stroke && stroke(context2, item, opacity2)) {
x12 = item.x || 0;
y12 = item.y || 0;
x2 = item.x2 != null ? item.x2 : x12;
y2 = item.y2 != null ? item.y2 : y12;
context2.beginPath();
context2.moveTo(x12, y12);
context2.lineTo(x2, y2);
return true;
}
return false;
}
function draw$1(context2, scene, bounds2) {
visit(scene, (item) => {
if (bounds2 && !bounds2.intersects(item.bounds))
return;
var opacity2 = item.opacity == null ? 1 : item.opacity;
if (opacity2 && path(context2, item, opacity2)) {
blend(context2, item);
context2.stroke();
}
});
}
function hit$1(context2, item, x2, y2) {
if (!context2.isPointInStroke)
return false;
return path(context2, item, 1) && context2.isPointInStroke(x2, y2);
}
var rule$1 = {
type: "rule",
tag: "line",
nested: false,
attr: attr$1,
bound: bound$1,
draw: draw$1,
pick: pick$1(hit$1),
isect: intersectRule
};
var shape = markItemPath("shape", shape$1);
var symbol = markItemPath("symbol", symbol$1, intersectPoint);
const widthCache = lruCache();
var textMetrics = {
height: fontSize$1,
measureWidth,
estimateWidth,
width: estimateWidth,
canvas: useCanvas
};
useCanvas(true);
function useCanvas(use) {
textMetrics.width = use && context$2 ? measureWidth : estimateWidth;
}
function estimateWidth(item, text2) {
return _estimateWidth(textValue(item, text2), fontSize$1(item));
}
function _estimateWidth(text2, currentFontHeight) {
return ~~(0.8 * text2.length * currentFontHeight);
}
function measureWidth(item, text2) {
return fontSize$1(item) <= 0 || !(text2 = textValue(item, text2)) ? 0 : _measureWidth(text2, font(item));
}
function _measureWidth(text2, currentFont) {
const key2 = `(${currentFont}) ${text2}`;
let width2 = widthCache.get(key2);
if (width2 === void 0) {
context$2.font = currentFont;
width2 = context$2.measureText(text2).width;
widthCache.set(key2, width2);
}
return width2;
}
function fontSize$1(item) {
return item.fontSize != null ? +item.fontSize || 0 : 11;
}
function lineHeight$1(item) {
return item.lineHeight != null ? item.lineHeight : fontSize$1(item) + 2;
}
function lineArray(_24) {
return isArray$2(_24) ? _24.length > 1 ? _24 : _24[0] : _24;
}
function textLines(item) {
return lineArray(item.lineBreak && item.text && !isArray$2(item.text) ? item.text.split(item.lineBreak) : item.text);
}
function multiLineOffset(item) {
const tl2 = textLines(item);
return (isArray$2(tl2) ? tl2.length - 1 : 0) * lineHeight$1(item);
}
function textValue(item, line2) {
const text2 = line2 == null ? "" : (line2 + "").trim();
return item.limit > 0 && text2.length ? truncate(item, text2) : text2;
}
function widthGetter(item) {
if (textMetrics.width === measureWidth) {
const currentFont = font(item);
return (text2) => _measureWidth(text2, currentFont);
} else if (textMetrics.width === estimateWidth) {
const currentFontHeight = fontSize$1(item);
return (text2) => _estimateWidth(text2, currentFontHeight);
} else {
return (text2) => textMetrics.width(item, text2);
}
}
function truncate(item, text2) {
var limit2 = +item.limit, width2 = widthGetter(item);
if (width2(text2) < limit2)
return text2;
var ellipsis = item.ellipsis || "…", rtl = item.dir === "rtl", lo2 = 0, hi2 = text2.length, mid;
limit2 -= width2(ellipsis);
if (rtl) {
while (lo2 < hi2) {
mid = lo2 + hi2 >>> 1;
if (width2(text2.slice(mid)) > limit2)
lo2 = mid + 1;
else
hi2 = mid;
}
return ellipsis + text2.slice(lo2);
} else {
while (lo2 < hi2) {
mid = 1 + (lo2 + hi2 >>> 1);
if (width2(text2.slice(0, mid)) < limit2)
lo2 = mid;
else
hi2 = mid - 1;
}
return text2.slice(0, lo2) + ellipsis;
}
}
function fontFamily$1(item, quote) {
var font2 = item.font;
return (quote && font2 ? String(font2).replace(/"/g, "'") : font2) || "sans-serif";
}
function font(item, quote) {
return (item.fontStyle ? item.fontStyle + " " : "") + (item.fontVariant ? item.fontVariant + " " : "") + (item.fontWeight ? item.fontWeight + " " : "") + fontSize$1(item) + "px " + fontFamily$1(item, quote);
}
function offset$2(item) {
var baseline2 = item.baseline, h2 = fontSize$1(item);
return Math.round(baseline2 === "top" ? 0.79 * h2 : baseline2 === "middle" ? 0.3 * h2 : baseline2 === "bottom" ? -0.21 * h2 : baseline2 === "line-top" ? 0.29 * h2 + 0.5 * lineHeight$1(item) : baseline2 === "line-bottom" ? 0.29 * h2 - 0.5 * lineHeight$1(item) : 0);
}
const textAlign$1 = {
"left": "start",
"center": "middle",
"right": "end"
};
const tempBounds$1 = new Bounds$1();
function anchorPoint(item) {
var x2 = item.x || 0, y2 = item.y || 0, r2 = item.radius || 0, t5;
if (r2) {
t5 = (item.theta || 0) - HalfPi;
x2 += r2 * Math.cos(t5);
y2 += r2 * Math.sin(t5);
}
tempBounds$1.x1 = x2;
tempBounds$1.y1 = y2;
return tempBounds$1;
}
function attr(emit2, item) {
var dx = item.dx || 0, dy = (item.dy || 0) + offset$2(item), p2 = anchorPoint(item), x2 = p2.x1, y2 = p2.y1, a2 = item.angle || 0, t5;
emit2("text-anchor", textAlign$1[item.align] || "start");
if (a2) {
t5 = translate$1(x2, y2) + " " + rotate(a2);
if (dx || dy)
t5 += " " + translate$1(dx, dy);
} else {
t5 = translate$1(x2 + dx, y2 + dy);
}
emit2("transform", t5);
}
function bound(bounds2, item, mode) {
var h2 = textMetrics.height(item), a2 = item.align, p2 = anchorPoint(item), x2 = p2.x1, y2 = p2.y1, dx = item.dx || 0, dy = (item.dy || 0) + offset$2(item) - Math.round(0.8 * h2), tl2 = textLines(item), w2;
if (isArray$2(tl2)) {
h2 += lineHeight$1(item) * (tl2.length - 1);
w2 = tl2.reduce((w3, t5) => Math.max(w3, textMetrics.width(item, t5)), 0);
} else {
w2 = textMetrics.width(item, tl2);
}
if (a2 === "center") {
dx -= w2 / 2;
} else if (a2 === "right") {
dx -= w2;
} else
;
bounds2.set(dx += x2, dy += y2, dx + w2, dy + h2);
if (item.angle && !mode) {
bounds2.rotate(item.angle * DegToRad, x2, y2);
} else if (mode === 2) {
return bounds2.rotatedPoints(item.angle * DegToRad, x2, y2);
}
return bounds2;
}
function draw$5(context2, scene, bounds2) {
visit(scene, (item) => {
var opacity2 = item.opacity == null ? 1 : item.opacity, p2, x2, y2, i2, lh2, tl2, str;
if (bounds2 && !bounds2.intersects(item.bounds) || // bounds check
opacity2 === 0 || item.fontSize <= 0 || item.text == null || item.text.length === 0)
return;
context2.font = font(item);
context2.textAlign = item.align || "left";
p2 = anchorPoint(item);
x2 = p2.x1, y2 = p2.y1;
if (item.angle) {
context2.save();
context2.translate(x2, y2);
context2.rotate(item.angle * DegToRad);
x2 = y2 = 0;
}
x2 += item.dx || 0;
y2 += (item.dy || 0) + offset$2(item);
tl2 = textLines(item);
blend(context2, item);
if (isArray$2(tl2)) {
lh2 = lineHeight$1(item);
for (i2 = 0; i2 < tl2.length; ++i2) {
str = textValue(item, tl2[i2]);
if (item.fill && fill(context2, item, opacity2)) {
context2.fillText(str, x2, y2);
}
if (item.stroke && stroke(context2, item, opacity2)) {
context2.strokeText(str, x2, y2);
}
y2 += lh2;
}
} else {
str = textValue(item, tl2);
if (item.fill && fill(context2, item, opacity2)) {
context2.fillText(str, x2, y2);
}
if (item.stroke && stroke(context2, item, opacity2)) {
context2.strokeText(str, x2, y2);
}
}
if (item.angle)
context2.restore();
});
}
function hit(context2, item, x2, y2, gx, gy) {
if (item.fontSize <= 0)
return false;
if (!item.angle)
return true;
var p2 = anchorPoint(item), ax = p2.x1, ay = p2.y1, b2 = bound(tempBounds$1, item, 1), a2 = -item.angle * DegToRad, cos2 = Math.cos(a2), sin2 = Math.sin(a2), px2 = cos2 * gx - sin2 * gy + (ax - cos2 * ax + sin2 * ay), py2 = sin2 * gx + cos2 * gy + (ay - sin2 * ax - cos2 * ay);
return b2.contains(px2, py2);
}
function intersectText(item, box) {
const p2 = bound(tempBounds$1, item, 2);
return intersectBoxLine(box, p2[0], p2[1], p2[2], p2[3]) || intersectBoxLine(box, p2[0], p2[1], p2[4], p2[5]) || intersectBoxLine(box, p2[4], p2[5], p2[6], p2[7]) || intersectBoxLine(box, p2[2], p2[3], p2[6], p2[7]);
}
var text$1 = {
type: "text",
tag: "text",
nested: false,
attr,
bound,
draw: draw$5,
pick: pick$1(hit),
isect: intersectText
};
var trail = markMultiItemPath("trail", trail$1, pickTrail);
var Marks = {
arc: arc$2,
area: area$2,
group,
image: image$1,
line: line$2,
path: path$2,
rect,
rule: rule$1,
shape,
symbol,
text: text$1,
trail
};
function boundItem$1(item, func, opt) {
var type2 = Marks[item.mark.marktype], bound2 = func || type2.bound;
if (type2.nested)
item = item.mark;
return bound2(item.bounds || (item.bounds = new Bounds$1()), item, opt);
}
var DUMMY = {
mark: null
};
function boundMark(mark, bounds2, opt) {
var type2 = Marks[mark.marktype], bound2 = type2.bound, items = mark.items, hasItems = items && items.length, i2, n2, item, b2;
if (type2.nested) {
if (hasItems) {
item = items[0];
} else {
DUMMY.mark = mark;
item = DUMMY;
}
b2 = boundItem$1(item, bound2, opt);
bounds2 = bounds2 && bounds2.union(b2) || b2;
return bounds2;
}
bounds2 = bounds2 || mark.bounds && mark.bounds.clear() || new Bounds$1();
if (hasItems) {
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
bounds2.union(boundItem$1(items[i2], bound2, opt));
}
}
return mark.bounds = bounds2;
}
const keys$2 = [
"marktype",
"name",
"role",
"interactive",
"clip",
"items",
"zindex",
"x",
"y",
"width",
"height",
"align",
"baseline",
// layout
"fill",
"fillOpacity",
"opacity",
"blend",
// fill
"stroke",
"strokeOpacity",
"strokeWidth",
"strokeCap",
// stroke
"strokeDash",
"strokeDashOffset",
// stroke dash
"strokeForeground",
"strokeOffset",
// group
"startAngle",
"endAngle",
"innerRadius",
"outerRadius",
// arc
"cornerRadius",
"padAngle",
// arc, rect
"cornerRadiusTopLeft",
"cornerRadiusTopRight",
// rect, group
"cornerRadiusBottomLeft",
"cornerRadiusBottomRight",
"interpolate",
"tension",
"orient",
"defined",
// area, line
"url",
"aspect",
"smooth",
// image
"path",
"scaleX",
"scaleY",
// path
"x2",
"y2",
// rule
"size",
"shape",
// symbol
"text",
"angle",
"theta",
"radius",
"dir",
"dx",
"dy",
// text
"ellipsis",
"limit",
"lineBreak",
"lineHeight",
"font",
"fontSize",
"fontWeight",
"fontStyle",
"fontVariant",
// font
"description",
"aria",
"ariaRole",
"ariaRoleDescription"
// aria
];
function sceneToJSON(scene, indent) {
return JSON.stringify(scene, keys$2, indent);
}
function sceneFromJSON(json2) {
const scene = typeof json2 === "string" ? JSON.parse(json2) : json2;
return initialize$1(scene);
}
function initialize$1(scene) {
var type2 = scene.marktype, items = scene.items, parent, i2, n2;
if (items) {
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
parent = type2 ? "mark" : "group";
items[i2][parent] = scene;
if (items[i2].zindex)
items[i2][parent].zdirty = true;
if ("group" === (type2 || parent))
initialize$1(items[i2]);
}
}
if (type2)
boundMark(scene);
return scene;
}
function Scenegraph(scene) {
if (arguments.length) {
this.root = sceneFromJSON(scene);
} else {
this.root = createMark({
marktype: "group",
name: "root",
role: "frame"
});
this.root.items = [new GroupItem(this.root)];
}
}
Scenegraph.prototype = {
toJSON(indent) {
return sceneToJSON(this.root, indent || 0);
},
mark(markdef, group2, index2) {
group2 = group2 || this.root.items[0];
const mark = createMark(markdef, group2);
group2.items[index2] = mark;
if (mark.zindex)
mark.group.zdirty = true;
return mark;
}
};
function createMark(def2, group2) {
const mark = {
bounds: new Bounds$1(),
clip: !!def2.clip,
group: group2,
interactive: def2.interactive === false ? false : true,
items: [],
marktype: def2.marktype,
name: def2.name || void 0,
role: def2.role || void 0,
zindex: def2.zindex || 0
};
if (def2.aria != null) {
mark.aria = def2.aria;
}
if (def2.description) {
mark.description = def2.description;
}
return mark;
}
function domCreate(doc, tag, ns) {
if (!doc && typeof document !== "undefined" && document.createElement) {
doc = document;
}
return doc ? ns ? doc.createElementNS(ns, tag) : doc.createElement(tag) : null;
}
function domFind(el, tag) {
tag = tag.toLowerCase();
var nodes = el.childNodes, i2 = 0, n2 = nodes.length;
for (; i2 < n2; ++i2)
if (nodes[i2].tagName.toLowerCase() === tag) {
return nodes[i2];
}
}
function domChild(el, index2, tag, ns) {
var a2 = el.childNodes[index2], b2;
if (!a2 || a2.tagName.toLowerCase() !== tag.toLowerCase()) {
b2 = a2 || null;
a2 = domCreate(el.ownerDocument, tag, ns);
el.insertBefore(a2, b2);
}
return a2;
}
function domClear(el, index2) {
var nodes = el.childNodes, curr = nodes.length;
while (curr > index2)
el.removeChild(nodes[--curr]);
return el;
}
function cssClass(mark) {
return "mark-" + mark.marktype + (mark.role ? " role-" + mark.role : "") + (mark.name ? " " + mark.name : "");
}
function point(event2, el) {
const rect2 = el.getBoundingClientRect();
return [event2.clientX - rect2.left - (el.clientLeft || 0), event2.clientY - rect2.top - (el.clientTop || 0)];
}
function resolveItem(item, event2, el, origin) {
var mark = item && item.mark, mdef, p2;
if (mark && (mdef = Marks[mark.marktype]).tip) {
p2 = point(event2, el);
p2[0] -= origin[0];
p2[1] -= origin[1];
while (item = item.mark.group) {
p2[0] -= item.x || 0;
p2[1] -= item.y || 0;
}
item = mdef.tip(mark.items, p2);
}
return item;
}
function Handler$1(customLoader, customTooltip) {
this._active = null;
this._handlers = {};
this._loader = customLoader || loader();
this._tooltip = customTooltip || defaultTooltip$1;
}
function defaultTooltip$1(handler, event2, item, value2) {
handler.element().setAttribute("title", value2 || "");
}
Handler$1.prototype = {
/**
* Initialize a new Handler instance.
* @param {DOMElement} el - The containing DOM element for the display.
* @param {Array<number>} origin - The origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {object} [obj] - Optional context object that should serve as
* the "this" context for event callbacks.
* @return {Handler} - This handler instance.
*/
initialize(el, origin, obj) {
this._el = el;
this._obj = obj || null;
return this.origin(origin);
},
/**
* Returns the parent container element for a visualization.
* @return {DOMElement} - The containing DOM element.
*/
element() {
return this._el;
},
/**
* Returns the scene element (e.g., canvas or SVG) of the visualization
* Subclasses must override if the first child is not the scene element.
* @return {DOMElement} - The scene (e.g., canvas or SVG) element.
*/
canvas() {
return this._el && this._el.firstChild;
},
/**
* Get / set the origin coordinates of the visualization.
*/
origin(origin) {
if (arguments.length) {
this._origin = origin || [0, 0];
return this;
} else {
return this._origin.slice();
}
},
/**
* Get / set the scenegraph root.
*/
scene(scene) {
if (!arguments.length)
return this._scene;
this._scene = scene;
return this;
},
/**
* Add an event handler. Subclasses should override this method.
*/
on() {
},
/**
* Remove an event handler. Subclasses should override this method.
*/
off() {
},
/**
* Utility method for finding the array index of an event handler.
* @param {Array} h - An array of registered event handlers.
* @param {string} type - The event type.
* @param {function} handler - The event handler instance to find.
* @return {number} - The handler's array index or -1 if not registered.
*/
_handlerIndex(h2, type2, handler) {
for (let i2 = h2 ? h2.length : 0; --i2 >= 0; ) {
if (h2[i2].type === type2 && (!handler || h2[i2].handler === handler)) {
return i2;
}
}
return -1;
},
/**
* Returns an array with registered event handlers.
* @param {string} [type] - The event type to query. Any annotations
* are ignored; for example, for the argument "click.foo", ".foo" will
* be ignored and the method returns all "click" handlers. If type is
* null or unspecified, this method returns handlers for all types.
* @return {Array} - A new array containing all registered event handlers.
*/
handlers(type2) {
const h2 = this._handlers, a2 = [];
if (type2) {
a2.push(...h2[this.eventName(type2)]);
} else {
for (const k2 in h2) {
a2.push(...h2[k2]);
}
}
return a2;
},
/**
* Parses an event name string to return the specific event type.
* For example, given "click.foo" returns "click"
* @param {string} name - The input event type string.
* @return {string} - A string with the event type only.
*/
eventName(name) {
const i2 = name.indexOf(".");
return i2 < 0 ? name : name.slice(0, i2);
},
/**
* Handle hyperlink navigation in response to an item.href value.
* @param {Event} event - The event triggering hyperlink navigation.
* @param {Item} item - The scenegraph item.
* @param {string} href - The URL to navigate to.
*/
handleHref(event2, item, href2) {
this._loader.sanitize(href2, {
context: "href"
}).then((opt) => {
const e7 = new MouseEvent(event2.type, event2), a2 = domCreate(null, "a");
for (const name in opt)
a2.setAttribute(name, opt[name]);
a2.dispatchEvent(e7);
}).catch(() => {
});
},
/**
* Handle tooltip display in response to an item.tooltip value.
* @param {Event} event - The event triggering tooltip display.
* @param {Item} item - The scenegraph item.
* @param {boolean} show - A boolean flag indicating whether
* to show or hide a tooltip for the given item.
*/
handleTooltip(event2, item, show) {
if (item && item.tooltip != null) {
item = resolveItem(item, event2, this.canvas(), this._origin);
const value2 = show && item && item.tooltip || null;
this._tooltip.call(this._obj, this, event2, item, value2);
}
},
/**
* Returns the size of a scenegraph item and its position relative
* to the viewport.
* @param {Item} item - The scenegraph item.
* @return {object} - A bounding box object (compatible with the
* DOMRect type) consisting of x, y, width, heigh, top, left,
* right, and bottom properties.
*/
getItemBoundingClientRect(item) {
const el = this.canvas();
if (!el)
return;
const rect2 = el.getBoundingClientRect(), origin = this._origin, bounds2 = item.bounds, width2 = bounds2.width(), height2 = bounds2.height();
let x2 = bounds2.x1 + origin[0] + rect2.left, y2 = bounds2.y1 + origin[1] + rect2.top;
while (item.mark && (item = item.mark.group)) {
x2 += item.x || 0;
y2 += item.y || 0;
}
return {
x: x2,
y: y2,
width: width2,
height: height2,
left: x2,
top: y2,
right: x2 + width2,
bottom: y2 + height2
};
}
};
function Renderer$1(loader2) {
this._el = null;
this._bgcolor = null;
this._loader = new ResourceLoader(loader2);
}
Renderer$1.prototype = {
/**
* Initialize a new Renderer instance.
* @param {DOMElement} el - The containing DOM element for the display.
* @param {number} width - The coordinate width of the display, in pixels.
* @param {number} height - The coordinate height of the display, in pixels.
* @param {Array<number>} origin - The origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {Renderer} - This renderer instance.
*/
initialize(el, width2, height2, origin, scaleFactor) {
this._el = el;
return this.resize(width2, height2, origin, scaleFactor);
},
/**
* Returns the parent container element for a visualization.
* @return {DOMElement} - The containing DOM element.
*/
element() {
return this._el;
},
/**
* Returns the scene element (e.g., canvas or SVG) of the visualization
* Subclasses must override if the first child is not the scene element.
* @return {DOMElement} - The scene (e.g., canvas or SVG) element.
*/
canvas() {
return this._el && this._el.firstChild;
},
/**
* Get / set the background color.
*/
background(bgcolor) {
if (arguments.length === 0)
return this._bgcolor;
this._bgcolor = bgcolor;
return this;
},
/**
* Resize the display.
* @param {number} width - The new coordinate width of the display, in pixels.
* @param {number} height - The new coordinate height of the display, in pixels.
* @param {Array<number>} origin - The new origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {Renderer} - This renderer instance;
*/
resize(width2, height2, origin, scaleFactor) {
this._width = width2;
this._height = height2;
this._origin = origin || [0, 0];
this._scale = scaleFactor || 1;
return this;
},
/**
* Report a dirty item whose bounds should be redrawn.
* This base class method does nothing. Subclasses that perform
* incremental should implement this method.
* @param {Item} item - The dirty item whose bounds should be redrawn.
*/
dirty() {
},
/**
* Render an input scenegraph, potentially with a set of dirty items.
* This method will perform an immediate rendering with available resources.
* The renderer may also need to perform image loading to perform a complete
* render. This process can lead to asynchronous re-rendering of the scene
* after this method returns. To receive notification when rendering is
* complete, use the renderAsync method instead.
* @param {object} scene - The root mark of a scenegraph to render.
* @param {Array} markTypes - Array of the mark types to render.
* If undefined, render all mark types
* @return {Renderer} - This renderer instance.
*/
render(scene, markTypes) {
const r2 = this;
r2._call = function() {
r2._render(scene, markTypes);
};
r2._call();
r2._call = null;
return r2;
},
/**
* Internal rendering method. Renderer subclasses should override this
* method to actually perform rendering.
* @param {object} scene - The root mark of a scenegraph to render.
* @param {Array} markTypes - Array of the mark types to render.
* If undefined, render all mark types
*/
_render() {
},
/**
* Asynchronous rendering method. Similar to render, but returns a Promise
* that resolves when all rendering is completed. Sometimes a renderer must
* perform image loading to get a complete rendering. The returned
* Promise will not resolve until this process completes.
* @param {object} scene - The root mark of a scenegraph to render.
* @param {Array} markTypes - Array of the mark types to render.
* If undefined, render all mark types
* @return {Promise} - A Promise that resolves when rendering is complete.
*/
renderAsync(scene, markTypes) {
const r2 = this.render(scene, markTypes);
return this._ready ? this._ready.then(() => r2) : Promise.resolve(r2);
},
/**
* Internal method for asynchronous resource loading.
* Proxies method calls to the ImageLoader, and tracks loading
* progress to invoke a re-render once complete.
* @param {string} method - The method name to invoke on the ImageLoader.
* @param {string} uri - The URI for the requested resource.
* @return {Promise} - A Promise that resolves to the requested resource.
*/
_load(method, uri) {
var r2 = this, p2 = r2._loader[method](uri);
if (!r2._ready) {
const call2 = r2._call;
r2._ready = r2._loader.ready().then((redraw) => {
if (redraw)
call2();
r2._ready = null;
});
}
return p2;
},
/**
* Sanitize a URL to include as a hyperlink in the rendered scene.
* This method proxies a call to ImageLoader.sanitizeURL, but also tracks
* image loading progress and invokes a re-render once complete.
* @param {string} uri - The URI string to sanitize.
* @return {Promise} - A Promise that resolves to the sanitized URL.
*/
sanitizeURL(uri) {
return this._load("sanitizeURL", uri);
},
/**
* Requests an image to include in the rendered scene.
* This method proxies a call to ImageLoader.loadImage, but also tracks
* image loading progress and invokes a re-render once complete.
* @param {string} uri - The URI string of the image.
* @return {Promise} - A Promise that resolves to the loaded Image.
*/
loadImage(uri) {
return this._load("loadImage", uri);
}
};
const KeyDownEvent = "keydown";
const KeyPressEvent = "keypress";
const KeyUpEvent = "keyup";
const DragEnterEvent = "dragenter";
const DragLeaveEvent = "dragleave";
const DragOverEvent = "dragover";
const PointerDownEvent = "pointerdown";
const PointerUpEvent = "pointerup";
const PointerMoveEvent = "pointermove";
const PointerOutEvent = "pointerout";
const PointerOverEvent = "pointerover";
const ClickEvent = "click";
const DoubleClickEvent = "dblclick";
const WheelEvent = "wheel";
const MouseWheelEvent = "mousewheel";
const TouchStartEvent = "touchstart";
const TouchMoveEvent = "touchmove";
const TouchEndEvent = "touchend";
const Events = [KeyDownEvent, KeyPressEvent, KeyUpEvent, DragEnterEvent, DragLeaveEvent, DragOverEvent, PointerDownEvent, PointerUpEvent, PointerMoveEvent, PointerOutEvent, PointerOverEvent, ClickEvent, DoubleClickEvent, WheelEvent, MouseWheelEvent, TouchStartEvent, TouchMoveEvent, TouchEndEvent];
const TooltipShowEvent = PointerMoveEvent;
const TooltipHideEvent = PointerOutEvent;
const HrefEvent = ClickEvent;
function CanvasHandler(loader2, tooltip) {
Handler$1.call(this, loader2, tooltip);
this._down = null;
this._touch = null;
this._first = true;
this._events = {};
}
const eventBundle = (type2) => type2 === TouchStartEvent || type2 === TouchMoveEvent || type2 === TouchEndEvent ? [TouchStartEvent, TouchMoveEvent, TouchEndEvent] : [type2];
function eventListenerCheck(handler, type2) {
eventBundle(type2).forEach((_24) => addEventListener$1(handler, _24));
}
function addEventListener$1(handler, type2) {
const canvas = handler.canvas();
if (canvas && !handler._events[type2]) {
handler._events[type2] = 1;
canvas.addEventListener(type2, handler[type2] ? (evt) => handler[type2](evt) : (evt) => handler.fire(type2, evt));
}
}
function move(moveEvent, overEvent, outEvent) {
return function(evt) {
const a2 = this._active, p2 = this.pickEvent(evt);
if (p2 === a2) {
this.fire(moveEvent, evt);
} else {
if (!a2 || !a2.exit) {
this.fire(outEvent, evt);
}
this._active = p2;
this.fire(overEvent, evt);
this.fire(moveEvent, evt);
}
};
}
function inactive(type2) {
return function(evt) {
this.fire(type2, evt);
this._active = null;
};
}
inherits(CanvasHandler, Handler$1, {
initialize(el, origin, obj) {
this._canvas = el && domFind(el, "canvas");
[ClickEvent, PointerDownEvent, PointerMoveEvent, PointerOutEvent, DragLeaveEvent].forEach((type2) => eventListenerCheck(this, type2));
return Handler$1.prototype.initialize.call(this, el, origin, obj);
},
// return the backing canvas instance
canvas() {
return this._canvas;
},
// retrieve the current canvas context
context() {
return this._canvas.getContext("2d");
},
// supported events
events: Events,
// to keep old versions of firefox happy
DOMMouseScroll(evt) {
this.fire(MouseWheelEvent, evt);
},
pointermove: move(PointerMoveEvent, PointerOverEvent, PointerOutEvent),
dragover: move(DragOverEvent, DragEnterEvent, DragLeaveEvent),
pointerout: inactive(PointerOutEvent),
dragleave: inactive(DragLeaveEvent),
pointerdown(evt) {
this._down = this._active;
this.fire(PointerDownEvent, evt);
},
click(evt) {
if (this._down === this._active) {
this.fire(ClickEvent, evt);
this._down = null;
}
},
touchstart(evt) {
this._touch = this.pickEvent(evt.changedTouches[0]);
if (this._first) {
this._active = this._touch;
this._first = false;
}
this.fire(TouchStartEvent, evt, true);
},
touchmove(evt) {
this.fire(TouchMoveEvent, evt, true);
},
touchend(evt) {
this.fire(TouchEndEvent, evt, true);
this._touch = null;
},
// fire an event
fire(type2, evt, touch2) {
const a2 = touch2 ? this._touch : this._active, h2 = this._handlers[type2];
evt.vegaType = type2;
if (type2 === HrefEvent && a2 && a2.href) {
this.handleHref(evt, a2, a2.href);
} else if (type2 === TooltipShowEvent || type2 === TooltipHideEvent) {
this.handleTooltip(evt, a2, type2 !== TooltipHideEvent);
}
if (h2) {
for (let i2 = 0, len = h2.length; i2 < len; ++i2) {
h2[i2].handler.call(this._obj, evt, a2);
}
}
},
// add an event handler
on(type2, handler) {
const name = this.eventName(type2), h2 = this._handlers, i2 = this._handlerIndex(h2[name], type2, handler);
if (i2 < 0) {
eventListenerCheck(this, type2);
(h2[name] || (h2[name] = [])).push({
type: type2,
handler
});
}
return this;
},
// remove an event handler
off(type2, handler) {
const name = this.eventName(type2), h2 = this._handlers[name], i2 = this._handlerIndex(h2, type2, handler);
if (i2 >= 0) {
h2.splice(i2, 1);
}
return this;
},
pickEvent(evt) {
const p2 = point(evt, this._canvas), o2 = this._origin;
return this.pick(this._scene, p2[0], p2[1], p2[0] - o2[0], p2[1] - o2[1]);
},
// find the scenegraph item at the current pointer position
// x, y -- the absolute x, y pointer coordinates on the canvas element
// gx, gy -- the relative coordinates within the current group
pick(scene, x2, y2, gx, gy) {
const g2 = this.context(), mark = Marks[scene.marktype];
return mark.pick.call(this, g2, scene, x2, y2, gx, gy);
}
});
function devicePixelRatio() {
return typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
}
var pixelRatio = devicePixelRatio();
function resize(canvas, width2, height2, origin, scaleFactor, opt) {
const inDOM = typeof HTMLElement !== "undefined" && canvas instanceof HTMLElement && canvas.parentNode != null, context2 = canvas.getContext("2d"), ratio = inDOM ? pixelRatio : scaleFactor;
canvas.width = width2 * ratio;
canvas.height = height2 * ratio;
for (const key2 in opt) {
context2[key2] = opt[key2];
}
if (inDOM && ratio !== 1) {
canvas.style.width = width2 + "px";
canvas.style.height = height2 + "px";
}
context2.pixelRatio = ratio;
context2.setTransform(ratio, 0, 0, ratio, ratio * origin[0], ratio * origin[1]);
return canvas;
}
function CanvasRenderer$1(loader2) {
Renderer$1.call(this, loader2);
this._options = {};
this._redraw = false;
this._dirty = new Bounds$1();
this._tempb = new Bounds$1();
}
const base$2 = Renderer$1.prototype;
const viewBounds = (origin, width2, height2) => new Bounds$1().set(0, 0, width2, height2).translate(-origin[0], -origin[1]);
function clipToBounds(g2, b2, origin) {
b2.expand(1).round();
if (g2.pixelRatio % 1) {
b2.scale(g2.pixelRatio).round().scale(1 / g2.pixelRatio);
}
b2.translate(-(origin[0] % 1), -(origin[1] % 1));
g2.beginPath();
g2.rect(b2.x1, b2.y1, b2.width(), b2.height());
g2.clip();
return b2;
}
inherits(CanvasRenderer$1, Renderer$1, {
initialize(el, width2, height2, origin, scaleFactor, options2) {
this._options = options2 || {};
this._canvas = this._options.externalContext ? null : domCanvas(1, 1, this._options.type);
if (el && this._canvas) {
domClear(el, 0).appendChild(this._canvas);
this._canvas.setAttribute("class", "marks");
}
return base$2.initialize.call(this, el, width2, height2, origin, scaleFactor);
},
resize(width2, height2, origin, scaleFactor) {
base$2.resize.call(this, width2, height2, origin, scaleFactor);
if (this._canvas) {
resize(this._canvas, this._width, this._height, this._origin, this._scale, this._options.context);
} else {
const ctx = this._options.externalContext;
if (!ctx)
error2("CanvasRenderer is missing a valid canvas or context");
ctx.scale(this._scale, this._scale);
ctx.translate(this._origin[0], this._origin[1]);
}
this._redraw = true;
return this;
},
canvas() {
return this._canvas;
},
context() {
return this._options.externalContext || (this._canvas ? this._canvas.getContext("2d") : null);
},
dirty(item) {
const b2 = this._tempb.clear().union(item.bounds);
let g2 = item.mark.group;
while (g2) {
b2.translate(g2.x || 0, g2.y || 0);
g2 = g2.mark.group;
}
this._dirty.union(b2);
},
_render(scene, markTypes) {
const g2 = this.context(), o2 = this._origin, w2 = this._width, h2 = this._height, db2 = this._dirty, vb2 = viewBounds(o2, w2, h2);
g2.save();
const b2 = this._redraw || db2.empty() ? (this._redraw = false, vb2.expand(1)) : clipToBounds(g2, vb2.intersect(db2), o2);
this.clear(-o2[0], -o2[1], w2, h2);
this.draw(g2, scene, b2, markTypes);
g2.restore();
db2.clear();
return this;
},
draw(ctx, scene, bounds2, markTypes) {
if (scene.marktype !== "group" && markTypes != null && !markTypes.includes(scene.marktype)) {
return;
}
const mark = Marks[scene.marktype];
if (scene.clip)
clip$2(ctx, scene);
mark.draw.call(this, ctx, scene, bounds2, markTypes);
if (scene.clip)
ctx.restore();
},
clear(x2, y2, w2, h2) {
const opt = this._options, g2 = this.context();
if (opt.type !== "pdf" && !opt.externalContext) {
g2.clearRect(x2, y2, w2, h2);
}
if (this._bgcolor != null) {
g2.fillStyle = this._bgcolor;
g2.fillRect(x2, y2, w2, h2);
}
}
});
function SVGHandler(loader2, tooltip) {
Handler$1.call(this, loader2, tooltip);
const h2 = this;
h2._hrefHandler = listener(h2, (evt, item) => {
if (item && item.href)
h2.handleHref(evt, item, item.href);
});
h2._tooltipHandler = listener(h2, (evt, item) => {
h2.handleTooltip(evt, item, evt.type !== TooltipHideEvent);
});
}
const listener = (context2, handler) => (evt) => {
let item = evt.target.__data__;
item = Array.isArray(item) ? item[0] : item;
evt.vegaType = evt.type;
handler.call(context2._obj, evt, item);
};
inherits(SVGHandler, Handler$1, {
initialize(el, origin, obj) {
let svg2 = this._svg;
if (svg2) {
svg2.removeEventListener(HrefEvent, this._hrefHandler);
svg2.removeEventListener(TooltipShowEvent, this._tooltipHandler);
svg2.removeEventListener(TooltipHideEvent, this._tooltipHandler);
}
this._svg = svg2 = el && domFind(el, "svg");
if (svg2) {
svg2.addEventListener(HrefEvent, this._hrefHandler);
svg2.addEventListener(TooltipShowEvent, this._tooltipHandler);
svg2.addEventListener(TooltipHideEvent, this._tooltipHandler);
}
return Handler$1.prototype.initialize.call(this, el, origin, obj);
},
canvas() {
return this._svg;
},
// add an event handler
on(type2, handler) {
const name = this.eventName(type2), h2 = this._handlers, i2 = this._handlerIndex(h2[name], type2, handler);
if (i2 < 0) {
const x2 = {
type: type2,
handler,
listener: listener(this, handler)
};
(h2[name] || (h2[name] = [])).push(x2);
if (this._svg) {
this._svg.addEventListener(name, x2.listener);
}
}
return this;
},
// remove an event handler
off(type2, handler) {
const name = this.eventName(type2), h2 = this._handlers[name], i2 = this._handlerIndex(h2, type2, handler);
if (i2 >= 0) {
if (this._svg) {
this._svg.removeEventListener(name, h2[i2].listener);
}
h2.splice(i2, 1);
}
return this;
}
});
const ARIA_HIDDEN = "aria-hidden";
const ARIA_LABEL = "aria-label";
const ARIA_ROLE = "role";
const ARIA_ROLEDESCRIPTION = "aria-roledescription";
const GRAPHICS_OBJECT = "graphics-object";
const GRAPHICS_SYMBOL = "graphics-symbol";
const bundle = (role, roledesc, label2) => ({
[ARIA_ROLE]: role,
[ARIA_ROLEDESCRIPTION]: roledesc,
[ARIA_LABEL]: label2 || void 0
});
const AriaIgnore = toSet(["axis-domain", "axis-grid", "axis-label", "axis-tick", "axis-title", "legend-band", "legend-entry", "legend-gradient", "legend-label", "legend-title", "legend-symbol", "title"]);
const AriaGuides = {
"axis": {
desc: "axis",
caption: axisCaption
},
"legend": {
desc: "legend",
caption: legendCaption
},
"title-text": {
desc: "title",
caption: (item) => `Title text '${titleCaption(item)}'`
},
"title-subtitle": {
desc: "subtitle",
caption: (item) => `Subtitle text '${titleCaption(item)}'`
}
};
const AriaEncode = {
ariaRole: ARIA_ROLE,
ariaRoleDescription: ARIA_ROLEDESCRIPTION,
description: ARIA_LABEL
};
function ariaItemAttributes(emit2, item) {
const hide2 = item.aria === false;
emit2(ARIA_HIDDEN, hide2 || void 0);
if (hide2 || item.description == null) {
for (const prop in AriaEncode) {
emit2(AriaEncode[prop], void 0);
}
} else {
const type2 = item.mark.marktype;
emit2(ARIA_LABEL, item.description);
emit2(ARIA_ROLE, item.ariaRole || (type2 === "group" ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL));
emit2(ARIA_ROLEDESCRIPTION, item.ariaRoleDescription || `${type2} mark`);
}
}
function ariaMarkAttributes(mark) {
return mark.aria === false ? {
[ARIA_HIDDEN]: true
} : AriaIgnore[mark.role] ? null : AriaGuides[mark.role] ? ariaGuide(mark, AriaGuides[mark.role]) : ariaMark(mark);
}
function ariaMark(mark) {
const type2 = mark.marktype;
const recurse2 = type2 === "group" || type2 === "text" || mark.items.some((_24) => _24.description != null && _24.aria !== false);
return bundle(recurse2 ? GRAPHICS_OBJECT : GRAPHICS_SYMBOL, `${type2} mark container`, mark.description);
}
function ariaGuide(mark, opt) {
try {
const item = mark.items[0], caption = opt.caption || (() => "");
return bundle(opt.role || GRAPHICS_SYMBOL, opt.desc, item.description || caption(item));
} catch (err) {
return null;
}
}
function titleCaption(item) {
return array$5(item.text).join(" ");
}
function axisCaption(item) {
const datum2 = item.datum, orient = item.orient, title = datum2.title ? extractTitle(item) : null, ctx = item.context, scale2 = ctx.scales[datum2.scale].value, locale2 = ctx.dataflow.locale(), type2 = scale2.type, xy = orient === "left" || orient === "right" ? "Y" : "X";
return `${xy}-axis` + (title ? ` titled '${title}'` : "") + ` for a ${isDiscrete(type2) ? "discrete" : type2} scale with ${domainCaption(locale2, scale2, item)}`;
}
function legendCaption(item) {
const datum2 = item.datum, title = datum2.title ? extractTitle(item) : null, type2 = `${datum2.type || ""} legend`.trim(), scales2 = datum2.scales, props = Object.keys(scales2), ctx = item.context, scale2 = ctx.scales[scales2[props[0]]].value, locale2 = ctx.dataflow.locale();
return capitalize$1(type2) + (title ? ` titled '${title}'` : "") + ` for ${channelCaption(props)} with ${domainCaption(locale2, scale2, item)}`;
}
function extractTitle(item) {
try {
return array$5(peek$1(item.items).items[0].text).join(" ");
} catch (err) {
return null;
}
}
function channelCaption(props) {
props = props.map((p2) => p2 + (p2 === "fill" || p2 === "stroke" ? " color" : ""));
return props.length < 2 ? props[0] : props.slice(0, -1).join(", ") + " and " + peek$1(props);
}
function capitalize$1(s2) {
return s2.length ? s2[0].toUpperCase() + s2.slice(1) : s2;
}
const innerText = (val) => (val + "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
const attrText = (val) => innerText(val).replace(/"/g, """).replace(/\t/g, "	").replace(/\n/g, "
").replace(/\r/g, "
");
function markup() {
let buf = "", outer = "", inner = "";
const stack = [], clear2 = () => outer = inner = "", push2 = (tag) => {
if (outer) {
buf += `${outer}>${inner}`;
clear2();
}
stack.push(tag);
}, attr2 = (name, value2) => {
if (value2 != null)
outer += ` ${name}="${attrText(value2)}"`;
return m2;
}, m2 = {
open(tag) {
push2(tag);
outer = "<" + tag;
for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
attrs[_key - 1] = arguments[_key];
}
for (const set2 of attrs) {
for (const key2 in set2)
attr2(key2, set2[key2]);
}
return m2;
},
close() {
const tag = stack.pop();
if (outer) {
buf += outer + (inner ? `>${inner}</${tag}>` : "/>");
} else {
buf += `</${tag}>`;
}
clear2();
return m2;
},
attr: attr2,
text: (t5) => (inner += innerText(t5), m2),
toString: () => buf
};
return m2;
}
const serializeXML = (node2) => _serialize(markup(), node2) + "";
function _serialize(m2, node2) {
m2.open(node2.tagName);
if (node2.hasAttributes()) {
const attrs = node2.attributes, n2 = attrs.length;
for (let i2 = 0; i2 < n2; ++i2) {
m2.attr(attrs[i2].name, attrs[i2].value);
}
}
if (node2.hasChildNodes()) {
const children2 = node2.childNodes;
for (const child of children2) {
child.nodeType === 3 ? m2.text(child.nodeValue) : _serialize(m2, child);
}
}
return m2.close();
}
const stylesAttr = {
fill: "fill",
fillOpacity: "fill-opacity",
stroke: "stroke",
strokeOpacity: "stroke-opacity",
strokeWidth: "stroke-width",
strokeCap: "stroke-linecap",
strokeJoin: "stroke-linejoin",
strokeDash: "stroke-dasharray",
strokeDashOffset: "stroke-dashoffset",
strokeMiterLimit: "stroke-miterlimit",
opacity: "opacity"
};
const stylesCss = {
blend: "mix-blend-mode"
};
const rootAttributes = {
"fill": "none",
"stroke-miterlimit": 10
};
const RootIndex = 0, xmlns = "http://www.w3.org/2000/xmlns/", svgns = metadata.xmlns;
function SVGRenderer(loader2) {
Renderer$1.call(this, loader2);
this._dirtyID = 0;
this._dirty = [];
this._svg = null;
this._root = null;
this._defs = null;
}
const base$1 = Renderer$1.prototype;
inherits(SVGRenderer, Renderer$1, {
/**
* Initialize a new SVGRenderer instance.
* @param {DOMElement} el - The containing DOM element for the display.
* @param {number} width - The coordinate width of the display, in pixels.
* @param {number} height - The coordinate height of the display, in pixels.
* @param {Array<number>} origin - The origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {SVGRenderer} - This renderer instance.
*/
initialize(el, width2, height2, origin, scaleFactor) {
this._defs = {};
this._clearDefs();
if (el) {
this._svg = domChild(el, 0, "svg", svgns);
this._svg.setAttributeNS(xmlns, "xmlns", svgns);
this._svg.setAttributeNS(xmlns, "xmlns:xlink", metadata["xmlns:xlink"]);
this._svg.setAttribute("version", metadata["version"]);
this._svg.setAttribute("class", "marks");
domClear(el, 1);
this._root = domChild(this._svg, RootIndex, "g", svgns);
setAttributes(this._root, rootAttributes);
domClear(this._svg, RootIndex + 1);
}
this.background(this._bgcolor);
return base$1.initialize.call(this, el, width2, height2, origin, scaleFactor);
},
/**
* Get / set the background color.
*/
background(bgcolor) {
if (arguments.length && this._svg) {
this._svg.style.setProperty("background-color", bgcolor);
}
return base$1.background.apply(this, arguments);
},
/**
* Resize the display.
* @param {number} width - The new coordinate width of the display, in pixels.
* @param {number} height - The new coordinate height of the display, in pixels.
* @param {Array<number>} origin - The new origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {SVGRenderer} - This renderer instance;
*/
resize(width2, height2, origin, scaleFactor) {
base$1.resize.call(this, width2, height2, origin, scaleFactor);
if (this._svg) {
setAttributes(this._svg, {
width: this._width * this._scale,
height: this._height * this._scale,
viewBox: `0 0 ${this._width} ${this._height}`
});
this._root.setAttribute("transform", `translate(${this._origin})`);
}
this._dirty = [];
return this;
},
/**
* Returns the SVG element of the visualization.
* @return {DOMElement} - The SVG element.
*/
canvas() {
return this._svg;
},
/**
* Returns an SVG text string for the rendered content,
* or null if this renderer is currently headless.
*/
svg() {
const svg2 = this._svg, bg2 = this._bgcolor;
if (!svg2)
return null;
let node2;
if (bg2) {
svg2.removeAttribute("style");
node2 = domChild(svg2, RootIndex, "rect", svgns);
setAttributes(node2, {
width: this._width,
height: this._height,
fill: bg2
});
}
const text2 = serializeXML(svg2);
if (bg2) {
svg2.removeChild(node2);
this._svg.style.setProperty("background-color", bg2);
}
return text2;
},
/**
* Internal rendering method.
* @param {object} scene - The root mark of a scenegraph to render.
* @param {Array} markTypes - Array of the mark types to render.
* If undefined, render all mark types
*/
_render(scene, markTypes) {
if (this._dirtyCheck()) {
if (this._dirtyAll)
this._clearDefs();
this.mark(this._root, scene, void 0, markTypes);
domClear(this._root, 1);
}
this.defs();
this._dirty = [];
++this._dirtyID;
return this;
},
// -- Manage rendering of items marked as dirty --
/**
* Flag a mark item as dirty.
* @param {Item} item - The mark item.
*/
dirty(item) {
if (item.dirty !== this._dirtyID) {
item.dirty = this._dirtyID;
this._dirty.push(item);
}
},
/**
* Check if a mark item is considered dirty.
* @param {Item} item - The mark item.
*/
isDirty(item) {
return this._dirtyAll || !item._svg || !item._svg.ownerSVGElement || item.dirty === this._dirtyID;
},
/**
* Internal method to check dirty status and, if possible,
* make targetted updates without a full rendering pass.
*/
_dirtyCheck() {
this._dirtyAll = true;
const items = this._dirty;
if (!items.length || !this._dirtyID)
return true;
const id = ++this._dirtyID;
let item, mark, type2, mdef, i2, n2, o2;
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
item = items[i2];
mark = item.mark;
if (mark.marktype !== type2) {
type2 = mark.marktype;
mdef = Marks[type2];
}
if (mark.zdirty && mark.dirty !== id) {
this._dirtyAll = false;
dirtyParents(item, id);
mark.items.forEach((i3) => {
i3.dirty = id;
});
}
if (mark.zdirty)
continue;
if (item.exit) {
if (mdef.nested && mark.items.length) {
o2 = mark.items[0];
if (o2._svg)
this._update(mdef, o2._svg, o2);
} else if (item._svg) {
o2 = item._svg.parentNode;
if (o2)
o2.removeChild(item._svg);
}
item._svg = null;
continue;
}
item = mdef.nested ? mark.items[0] : item;
if (item._update === id)
continue;
if (!item._svg || !item._svg.ownerSVGElement) {
this._dirtyAll = false;
dirtyParents(item, id);
} else {
this._update(mdef, item._svg, item);
}
item._update = id;
}
return !this._dirtyAll;
},
// -- Construct & maintain scenegraph to SVG mapping ---
/**
* Render a set of mark items.
* @param {SVGElement} el - The parent element in the SVG tree.
* @param {object} scene - The mark parent to render.
* @param {SVGElement} prev - The previous sibling in the SVG tree.
* @param {Array} markTypes - Array of the mark types to render.
* If undefined, render all mark types
*/
mark(el, scene, prev2, markTypes) {
if (!this.isDirty(scene)) {
return scene._svg;
}
const svg2 = this._svg, markType2 = scene.marktype, mdef = Marks[markType2], events2 = scene.interactive === false ? "none" : null, isGroup = mdef.tag === "g";
const parent = bind$6(scene, el, prev2, "g", svg2);
if (markType2 !== "group" && markTypes != null && !markTypes.includes(markType2)) {
domClear(parent, 0);
return scene._svg;
}
parent.setAttribute("class", cssClass(scene));
const aria = ariaMarkAttributes(scene);
for (const key2 in aria)
setAttribute(parent, key2, aria[key2]);
if (!isGroup) {
setAttribute(parent, "pointer-events", events2);
}
setAttribute(parent, "clip-path", scene.clip ? clip$1$1(this, scene, scene.group) : null);
let sibling = null, i2 = 0;
const process2 = (item) => {
const dirty = this.isDirty(item), node2 = bind$6(item, parent, sibling, mdef.tag, svg2);
if (dirty) {
this._update(mdef, node2, item);
if (isGroup)
recurse(this, node2, item, markTypes);
}
sibling = node2;
++i2;
};
if (mdef.nested) {
if (scene.items.length)
process2(scene.items[0]);
} else {
visit(scene, process2);
}
domClear(parent, i2);
return parent;
},
/**
* Update the attributes of an SVG element for a mark item.
* @param {object} mdef - The mark definition object
* @param {SVGElement} el - The SVG element.
* @param {Item} item - The mark item.
*/
_update(mdef, el, item) {
element$1 = el;
values$1 = el.__values__;
ariaItemAttributes(emit, item);
mdef.attr(emit, item, this);
const extra = mark_extras[mdef.type];
if (extra)
extra.call(this, mdef, el, item);
if (element$1)
this.style(element$1, item);
},
/**
* Update the presentation attributes of an SVG element for a mark item.
* @param {SVGElement} el - The SVG element.
* @param {Item} item - The mark item.
*/
style(el, item) {
if (item == null)
return;
for (const prop in stylesAttr) {
let value2 = prop === "font" ? fontFamily$1(item) : item[prop];
if (value2 === values$1[prop])
continue;
const name = stylesAttr[prop];
if (value2 == null) {
el.removeAttribute(name);
} else {
if (isGradient(value2)) {
value2 = gradientRef(value2, this._defs.gradient, href());
}
el.setAttribute(name, value2 + "");
}
values$1[prop] = value2;
}
for (const prop in stylesCss) {
setStyle(el, stylesCss[prop], item[prop]);
}
},
/**
* Render SVG defs, as needed.
* Must be called *after* marks have been processed to ensure the
* collected state is current and accurate.
*/
defs() {
const svg2 = this._svg, defs = this._defs;
let el = defs.el, index2 = 0;
for (const id in defs.gradient) {
if (!el)
defs.el = el = domChild(svg2, RootIndex + 1, "defs", svgns);
index2 = updateGradient(el, defs.gradient[id], index2);
}
for (const id in defs.clipping) {
if (!el)
defs.el = el = domChild(svg2, RootIndex + 1, "defs", svgns);
index2 = updateClipping(el, defs.clipping[id], index2);
}
if (el) {
index2 === 0 ? (svg2.removeChild(el), defs.el = null) : domClear(el, index2);
}
},
/**
* Clear defs caches.
*/
_clearDefs() {
const def2 = this._defs;
def2.gradient = {};
def2.clipping = {};
}
});
function dirtyParents(item, id) {
for (; item && item.dirty !== id; item = item.mark.group) {
item.dirty = id;
if (item.mark && item.mark.dirty !== id) {
item.mark.dirty = id;
} else
return;
}
}
function updateGradient(el, grad, index2) {
let i2, n2, stop2;
if (grad.gradient === "radial") {
let pt2 = domChild(el, index2++, "pattern", svgns);
setAttributes(pt2, {
id: patternPrefix + grad.id,
viewBox: "0,0,1,1",
width: "100%",
height: "100%",
preserveAspectRatio: "xMidYMid slice"
});
pt2 = domChild(pt2, 0, "rect", svgns);
setAttributes(pt2, {
width: 1,
height: 1,
fill: `url(${href()}#${grad.id})`
});
el = domChild(el, index2++, "radialGradient", svgns);
setAttributes(el, {
id: grad.id,
fx: grad.x1,
fy: grad.y1,
fr: grad.r1,
cx: grad.x2,
cy: grad.y2,
r: grad.r2
});
} else {
el = domChild(el, index2++, "linearGradient", svgns);
setAttributes(el, {
id: grad.id,
x1: grad.x1,
x2: grad.x2,
y1: grad.y1,
y2: grad.y2
});
}
for (i2 = 0, n2 = grad.stops.length; i2 < n2; ++i2) {
stop2 = domChild(el, i2, "stop", svgns);
stop2.setAttribute("offset", grad.stops[i2].offset);
stop2.setAttribute("stop-color", grad.stops[i2].color);
}
domClear(el, i2);
return index2;
}
function updateClipping(el, clip2, index2) {
let mask;
el = domChild(el, index2, "clipPath", svgns);
el.setAttribute("id", clip2.id);
if (clip2.path) {
mask = domChild(el, 0, "path", svgns);
mask.setAttribute("d", clip2.path);
} else {
mask = domChild(el, 0, "rect", svgns);
setAttributes(mask, {
x: 0,
y: 0,
width: clip2.width,
height: clip2.height
});
}
domClear(el, 1);
return index2 + 1;
}
function recurse(renderer, el, group2, markTypes) {
el = el.lastChild.previousSibling;
let prev2, idx = 0;
visit(group2, (item) => {
prev2 = renderer.mark(el, item, prev2, markTypes);
++idx;
});
domClear(el, 1 + idx);
}
function bind$6(item, el, sibling, tag, svg2) {
let node2 = item._svg, doc;
if (!node2) {
doc = el.ownerDocument;
node2 = domCreate(doc, tag, svgns);
item._svg = node2;
if (item.mark) {
node2.__data__ = item;
node2.__values__ = {
fill: "default"
};
if (tag === "g") {
const bg2 = domCreate(doc, "path", svgns);
node2.appendChild(bg2);
bg2.__data__ = item;
const cg2 = domCreate(doc, "g", svgns);
node2.appendChild(cg2);
cg2.__data__ = item;
const fg2 = domCreate(doc, "path", svgns);
node2.appendChild(fg2);
fg2.__data__ = item;
fg2.__values__ = {
fill: "default"
};
}
}
}
if (node2.ownerSVGElement !== svg2 || siblingCheck(node2, sibling)) {
el.insertBefore(node2, sibling ? sibling.nextSibling : el.firstChild);
}
return node2;
}
function siblingCheck(node2, sibling) {
return node2.parentNode && node2.parentNode.childNodes.length > 1 && node2.previousSibling != sibling;
}
let element$1 = null, values$1 = null;
const mark_extras = {
group(mdef, el, item) {
const fg2 = element$1 = el.childNodes[2];
values$1 = fg2.__values__;
mdef.foreground(emit, item, this);
values$1 = el.__values__;
element$1 = el.childNodes[1];
mdef.content(emit, item, this);
const bg2 = element$1 = el.childNodes[0];
mdef.background(emit, item, this);
const value2 = item.mark.interactive === false ? "none" : null;
if (value2 !== values$1.events) {
setAttribute(fg2, "pointer-events", value2);
setAttribute(bg2, "pointer-events", value2);
values$1.events = value2;
}
if (item.strokeForeground && item.stroke) {
const fill2 = item.fill;
setAttribute(fg2, "display", null);
this.style(bg2, item);
setAttribute(bg2, "stroke", null);
if (fill2)
item.fill = null;
values$1 = fg2.__values__;
this.style(fg2, item);
if (fill2)
item.fill = fill2;
element$1 = null;
} else {
setAttribute(fg2, "display", "none");
}
},
image(mdef, el, item) {
if (item.smooth === false) {
setStyle(el, "image-rendering", "optimizeSpeed");
setStyle(el, "image-rendering", "pixelated");
} else {
setStyle(el, "image-rendering", null);
}
},
text(mdef, el, item) {
const tl2 = textLines(item);
let key2, value2, doc, lh2;
if (isArray$2(tl2)) {
value2 = tl2.map((_24) => textValue(item, _24));
key2 = value2.join("\n");
if (key2 !== values$1.text) {
domClear(el, 0);
doc = el.ownerDocument;
lh2 = lineHeight$1(item);
value2.forEach((t5, i2) => {
const ts2 = domCreate(doc, "tspan", svgns);
ts2.__data__ = item;
ts2.textContent = t5;
if (i2) {
ts2.setAttribute("x", 0);
ts2.setAttribute("dy", lh2);
}
el.appendChild(ts2);
});
values$1.text = key2;
}
} else {
value2 = textValue(item, tl2);
if (value2 !== values$1.text) {
el.textContent = value2;
values$1.text = value2;
}
}
setAttribute(el, "font-family", fontFamily$1(item));
setAttribute(el, "font-size", fontSize$1(item) + "px");
setAttribute(el, "font-style", item.fontStyle);
setAttribute(el, "font-variant", item.fontVariant);
setAttribute(el, "font-weight", item.fontWeight);
}
};
function emit(name, value2, ns) {
if (value2 === values$1[name])
return;
if (ns) {
setAttributeNS(element$1, name, value2, ns);
} else {
setAttribute(element$1, name, value2);
}
values$1[name] = value2;
}
function setStyle(el, name, value2) {
if (value2 !== values$1[name]) {
if (value2 == null) {
el.style.removeProperty(name);
} else {
el.style.setProperty(name, value2 + "");
}
values$1[name] = value2;
}
}
function setAttributes(el, attrs) {
for (const key2 in attrs) {
setAttribute(el, key2, attrs[key2]);
}
}
function setAttribute(el, name, value2) {
if (value2 != null) {
el.setAttribute(name, value2);
} else {
el.removeAttribute(name);
}
}
function setAttributeNS(el, name, value2, ns) {
if (value2 != null) {
el.setAttributeNS(ns, name, value2);
} else {
el.removeAttributeNS(ns, name);
}
}
function href() {
let loc;
return typeof window === "undefined" ? "" : (loc = window.location).hash ? loc.href.slice(0, -loc.hash.length) : loc.href;
}
function SVGStringRenderer(loader2) {
Renderer$1.call(this, loader2);
this._text = null;
this._defs = {
gradient: {},
clipping: {}
};
}
inherits(SVGStringRenderer, Renderer$1, {
/**
* Returns the rendered SVG text string,
* or null if rendering has not yet occurred.
*/
svg() {
return this._text;
},
/**
* Internal rendering method.
* @param {object} scene - The root mark of a scenegraph to render.
*/
_render(scene) {
const m2 = markup();
m2.open("svg", extend$2({}, metadata, {
class: "marks",
width: this._width * this._scale,
height: this._height * this._scale,
viewBox: `0 0 ${this._width} ${this._height}`
}));
const bg2 = this._bgcolor;
if (bg2 && bg2 !== "transparent" && bg2 !== "none") {
m2.open("rect", {
width: this._width,
height: this._height,
fill: bg2
}).close();
}
m2.open("g", rootAttributes, {
transform: "translate(" + this._origin + ")"
});
this.mark(m2, scene);
m2.close();
this.defs(m2);
this._text = m2.close() + "";
return this;
},
/**
* Render a set of mark items.
* @param {object} m - The markup context.
* @param {object} scene - The mark parent to render.
*/
mark(m2, scene) {
const mdef = Marks[scene.marktype], tag = mdef.tag, attrList = [ariaItemAttributes, mdef.attr];
m2.open("g", {
"class": cssClass(scene),
"clip-path": scene.clip ? clip$1$1(this, scene, scene.group) : null
}, ariaMarkAttributes(scene), {
"pointer-events": tag !== "g" && scene.interactive === false ? "none" : null
});
const process2 = (item) => {
const href2 = this.href(item);
if (href2)
m2.open("a", href2);
m2.open(tag, this.attr(scene, item, attrList, tag !== "g" ? tag : null));
if (tag === "text") {
const tl2 = textLines(item);
if (isArray$2(tl2)) {
const attrs = {
x: 0,
dy: lineHeight$1(item)
};
for (let i2 = 0; i2 < tl2.length; ++i2) {
m2.open("tspan", i2 ? attrs : null).text(textValue(item, tl2[i2])).close();
}
} else {
m2.text(textValue(item, tl2));
}
} else if (tag === "g") {
const fore = item.strokeForeground, fill2 = item.fill, stroke2 = item.stroke;
if (fore && stroke2) {
item.stroke = null;
}
m2.open("path", this.attr(scene, item, mdef.background, "bgrect")).close();
m2.open("g", this.attr(scene, item, mdef.content));
visit(item, (scene2) => this.mark(m2, scene2));
m2.close();
if (fore && stroke2) {
if (fill2)
item.fill = null;
item.stroke = stroke2;
m2.open("path", this.attr(scene, item, mdef.foreground, "bgrect")).close();
if (fill2)
item.fill = fill2;
} else {
m2.open("path", this.attr(scene, item, mdef.foreground, "bgfore")).close();
}
}
m2.close();
if (href2)
m2.close();
};
if (mdef.nested) {
if (scene.items && scene.items.length)
process2(scene.items[0]);
} else {
visit(scene, process2);
}
return m2.close();
},
/**
* Get href attributes for a hyperlinked mark item.
* @param {Item} item - The mark item.
*/
href(item) {
const href2 = item.href;
let attr2;
if (href2) {
if (attr2 = this._hrefs && this._hrefs[href2]) {
return attr2;
} else {
this.sanitizeURL(href2).then((attr3) => {
attr3["xlink:href"] = attr3.href;
attr3.href = null;
(this._hrefs || (this._hrefs = {}))[href2] = attr3;
});
}
}
return null;
},
/**
* Get an object of SVG attributes for a mark item.
* @param {object} scene - The mark parent.
* @param {Item} item - The mark item.
* @param {array|function} attrs - One or more attribute emitters.
* @param {string} tag - The tag being rendered.
*/
attr(scene, item, attrs, tag) {
const object2 = {}, emit2 = (name, value2, ns, prefixed) => {
object2[prefixed || name] = value2;
};
if (Array.isArray(attrs)) {
attrs.forEach((fn8) => fn8(emit2, item, this));
} else {
attrs(emit2, item, this);
}
if (tag) {
style(object2, item, scene, tag, this._defs);
}
return object2;
},
/**
* Render SVG defs, as needed.
* Must be called *after* marks have been processed to ensure the
* collected state is current and accurate.
* @param {object} m - The markup context.
*/
defs(m2) {
const gradient2 = this._defs.gradient, clipping = this._defs.clipping, count2 = Object.keys(gradient2).length + Object.keys(clipping).length;
if (count2 === 0)
return;
m2.open("defs");
for (const id in gradient2) {
const def2 = gradient2[id], stops = def2.stops;
if (def2.gradient === "radial") {
m2.open("pattern", {
id: patternPrefix + id,
viewBox: "0,0,1,1",
width: "100%",
height: "100%",
preserveAspectRatio: "xMidYMid slice"
});
m2.open("rect", {
width: "1",
height: "1",
fill: "url(#" + id + ")"
}).close();
m2.close();
m2.open("radialGradient", {
id,
fx: def2.x1,
fy: def2.y1,
fr: def2.r1,
cx: def2.x2,
cy: def2.y2,
r: def2.r2
});
} else {
m2.open("linearGradient", {
id,
x1: def2.x1,
x2: def2.x2,
y1: def2.y1,
y2: def2.y2
});
}
for (let i2 = 0; i2 < stops.length; ++i2) {
m2.open("stop", {
offset: stops[i2].offset,
"stop-color": stops[i2].color
}).close();
}
m2.close();
}
for (const id in clipping) {
const def2 = clipping[id];
m2.open("clipPath", {
id
});
if (def2.path) {
m2.open("path", {
d: def2.path
}).close();
} else {
m2.open("rect", {
x: 0,
y: 0,
width: def2.width,
height: def2.height
}).close();
}
m2.close();
}
m2.close();
}
});
function style(s2, item, scene, tag, defs) {
let styleList;
if (item == null)
return s2;
if (tag === "bgrect" && scene.interactive === false) {
s2["pointer-events"] = "none";
}
if (tag === "bgfore") {
if (scene.interactive === false) {
s2["pointer-events"] = "none";
}
s2.display = "none";
if (item.fill !== null)
return s2;
}
if (tag === "image" && item.smooth === false) {
styleList = ["image-rendering: optimizeSpeed;", "image-rendering: pixelated;"];
}
if (tag === "text") {
s2["font-family"] = fontFamily$1(item);
s2["font-size"] = fontSize$1(item) + "px";
s2["font-style"] = item.fontStyle;
s2["font-variant"] = item.fontVariant;
s2["font-weight"] = item.fontWeight;
}
for (const prop in stylesAttr) {
let value2 = item[prop];
const name = stylesAttr[prop];
if (value2 === "transparent" && (name === "fill" || name === "stroke"))
;
else if (value2 != null) {
if (isGradient(value2)) {
value2 = gradientRef(value2, defs.gradient, "");
}
s2[name] = value2;
}
}
for (const prop in stylesCss) {
const value2 = item[prop];
if (value2 != null) {
styleList = styleList || [];
styleList.push(`${stylesCss[prop]}: ${value2};`);
}
}
if (styleList) {
s2.style = styleList.join(" ");
}
return s2;
}
const OPTS = {
svgMarkTypes: ["text"],
svgOnTop: true,
debug: false
};
function HybridRenderer(loader2) {
Renderer$1.call(this, loader2);
this._svgRenderer = new SVGRenderer(loader2);
this._canvasRenderer = new CanvasRenderer$1(loader2);
}
const base = Renderer$1.prototype;
inherits(HybridRenderer, Renderer$1, {
/**
* Initialize a new HybridRenderer instance.
* @param {DOMElement} el - The containing DOM element for the display.
* @param {number} width - The coordinate width of the display, in pixels.
* @param {number} height - The coordinate height of the display, in pixels.
* @param {Array<number>} origin - The origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {HybridRenderer} - This renderer instance.
*/
initialize(el, width2, height2, origin, scaleFactor) {
this._root_el = domChild(el, 0, "div");
const bottomEl = domChild(this._root_el, 0, "div");
const topEl = domChild(this._root_el, 1, "div");
this._root_el.style.position = "relative";
{
bottomEl.style.height = "100%";
topEl.style.position = "absolute";
topEl.style.top = "0";
topEl.style.left = "0";
topEl.style.height = "100%";
topEl.style.width = "100%";
}
this._svgEl = topEl;
this._canvasEl = bottomEl;
this._svgEl.style.pointerEvents = "none";
this._canvasRenderer.initialize(this._canvasEl, width2, height2, origin, scaleFactor);
this._svgRenderer.initialize(this._svgEl, width2, height2, origin, scaleFactor);
return base.initialize.call(this, el, width2, height2, origin, scaleFactor);
},
/**
* Flag a mark item as dirty.
* @param {Item} item - The mark item.
*/
dirty(item) {
if (OPTS.svgMarkTypes.includes(item.mark.marktype)) {
this._svgRenderer.dirty(item);
} else {
this._canvasRenderer.dirty(item);
}
return this;
},
/**
* Internal rendering method.
* @param {object} scene - The root mark of a scenegraph to render.
* @param {Array} markTypes - Array of the mark types to render.
* If undefined, render all mark types
*/
_render(scene, markTypes) {
const allMarkTypes = markTypes ?? ["arc", "area", "image", "line", "path", "rect", "rule", "shape", "symbol", "text", "trail"];
const canvasMarkTypes = allMarkTypes.filter((m2) => !OPTS.svgMarkTypes.includes(m2));
this._svgRenderer.render(scene, OPTS.svgMarkTypes);
this._canvasRenderer.render(scene, canvasMarkTypes);
},
/**
* Resize the display.
* @param {number} width - The new coordinate width of the display, in pixels.
* @param {number} height - The new coordinate height of the display, in pixels.
* @param {Array<number>} origin - The new origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {SVGRenderer} - This renderer instance;
*/
resize(width2, height2, origin, scaleFactor) {
base.resize.call(this, width2, height2, origin, scaleFactor);
this._svgRenderer.resize(width2, height2, origin, scaleFactor);
this._canvasRenderer.resize(width2, height2, origin, scaleFactor);
return this;
},
background(bgcolor) {
{
this._canvasRenderer.background(bgcolor);
}
return this;
}
});
function HybridHandler(loader2, tooltip) {
CanvasHandler.call(this, loader2, tooltip);
}
inherits(HybridHandler, CanvasHandler, {
initialize(el, origin, obj) {
const canvas = domChild(domChild(el, 0, "div"), 0, "div");
return CanvasHandler.prototype.initialize.call(this, canvas, origin, obj);
}
});
const Canvas = "canvas";
const Hybrid = "hybrid";
const PNG = "png";
const SVG = "svg";
const None$1 = "none";
const RenderType = {
Canvas,
PNG,
SVG,
Hybrid,
None: None$1
};
const modules = {};
modules[Canvas] = modules[PNG] = {
renderer: CanvasRenderer$1,
headless: CanvasRenderer$1,
handler: CanvasHandler
};
modules[SVG] = {
renderer: SVGRenderer,
headless: SVGStringRenderer,
handler: SVGHandler
};
modules[Hybrid] = {
renderer: HybridRenderer,
headless: HybridRenderer,
handler: HybridHandler
};
modules[None$1] = {};
function renderModule(name, _24) {
name = String(name || "").toLowerCase();
if (arguments.length > 1) {
modules[name] = _24;
return this;
} else {
return modules[name];
}
}
function intersect$2(scene, bounds2, filter2) {
const hits = [], box = new Bounds$1().union(bounds2), type2 = scene.marktype;
return type2 ? intersectMark(scene, box, filter2, hits) : type2 === "group" ? intersectGroup(scene, box, filter2, hits) : error2("Intersect scene must be mark node or group item.");
}
function intersectMark(mark, box, filter2, hits) {
if (visitMark(mark, box, filter2)) {
const items = mark.items, type2 = mark.marktype, n2 = items.length;
let i2 = 0;
if (type2 === "group") {
for (; i2 < n2; ++i2) {
intersectGroup(items[i2], box, filter2, hits);
}
} else {
for (const test2 = Marks[type2].isect; i2 < n2; ++i2) {
const item = items[i2];
if (intersectItem(item, box, test2))
hits.push(item);
}
}
}
return hits;
}
function visitMark(mark, box, filter2) {
return mark.bounds && box.intersects(mark.bounds) && (mark.marktype === "group" || mark.interactive !== false && (!filter2 || filter2(mark)));
}
function intersectGroup(group2, box, filter2, hits) {
if (filter2 && filter2(group2.mark) && intersectItem(group2, box, Marks.group.isect)) {
hits.push(group2);
}
const marks = group2.items, n2 = marks && marks.length;
if (n2) {
const x2 = group2.x || 0, y2 = group2.y || 0;
box.translate(-x2, -y2);
for (let i2 = 0; i2 < n2; ++i2) {
intersectMark(marks[i2], box, filter2, hits);
}
box.translate(x2, y2);
}
return hits;
}
function intersectItem(item, box, test2) {
const bounds2 = item.bounds;
return box.encloses(bounds2) || box.intersects(bounds2) && test2(item, box);
}
const clipBounds = new Bounds$1();
function boundClip(mark) {
const clip2 = mark.clip;
if (isFunction(clip2)) {
clip2(boundContext(clipBounds.clear()));
} else if (clip2) {
clipBounds.set(0, 0, mark.group.width, mark.group.height);
} else
return;
mark.bounds.intersect(clipBounds);
}
const Top$1 = "top";
const Left$1 = "left";
const Right$1 = "right";
const Bottom$1 = "bottom";
const TopLeft = "top-left";
const TopRight = "top-right";
const BottomLeft = "bottom-left";
const BottomRight = "bottom-right";
const Start$1 = "start";
const Middle$1 = "middle";
const End$1 = "end";
const X$2 = "x";
const Y$2 = "y";
const Group2 = "group";
const AxisRole$1 = "axis";
const TitleRole$1 = "title";
const FrameRole$1 = "frame";
const ScopeRole$1 = "scope";
const LegendRole$1 = "legend";
const RowHeader = "row-header";
const RowFooter = "row-footer";
const RowTitle = "row-title";
const ColHeader = "column-header";
const ColFooter = "column-footer";
const ColTitle = "column-title";
const Padding$1 = "padding";
const Symbols$1 = "symbol";
const Fit = "fit";
const FitX = "fit-x";
const FitY = "fit-y";
const Pad = "pad";
const None = "none";
const All = "all";
const Each = "each";
const Flush = "flush";
const Column = "column";
const Row = "row";
function Bound$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(Bound$1, Transform$1, {
transform(_24, pulse2) {
const view = pulse2.dataflow, mark = _24.mark, type2 = mark.marktype, entry2 = Marks[type2], bound2 = entry2.bound;
let markBounds = mark.bounds, rebound;
if (entry2.nested) {
if (mark.items.length)
view.dirty(mark.items[0]);
markBounds = boundItem(mark, bound2);
mark.items.forEach((item) => {
item.bounds.clear().union(markBounds);
});
} else if (type2 === Group2 || _24.modified()) {
pulse2.visit(pulse2.MOD, (item) => view.dirty(item));
markBounds.clear();
mark.items.forEach((item) => markBounds.union(boundItem(item, bound2)));
switch (mark.role) {
case AxisRole$1:
case LegendRole$1:
case TitleRole$1:
pulse2.reflow();
}
} else {
rebound = pulse2.changed(pulse2.REM);
pulse2.visit(pulse2.ADD, (item) => {
markBounds.union(boundItem(item, bound2));
});
pulse2.visit(pulse2.MOD, (item) => {
rebound = rebound || markBounds.alignsWith(item.bounds);
view.dirty(item);
markBounds.union(boundItem(item, bound2));
});
if (rebound) {
markBounds.clear();
mark.items.forEach((item) => markBounds.union(item.bounds));
}
}
boundClip(mark);
return pulse2.modifies("bounds");
}
});
function boundItem(item, bound2, opt) {
return bound2(item.bounds.clear(), item, opt);
}
const COUNTER_NAME = ":vega_identifier:";
function Identifier$1(params2) {
Transform$1.call(this, 0, params2);
}
Identifier$1.Definition = {
"type": "Identifier",
"metadata": {
"modifies": true
},
"params": [{
"name": "as",
"type": "string",
"required": true
}]
};
inherits(Identifier$1, Transform$1, {
transform(_24, pulse2) {
const counter2 = getCounter(pulse2.dataflow), as = _24.as;
let id = counter2.value;
pulse2.visit(pulse2.ADD, (t5) => t5[as] = t5[as] || ++id);
counter2.set(this.value = id);
return pulse2;
}
});
function getCounter(view) {
return view._signals[COUNTER_NAME] || (view._signals[COUNTER_NAME] = view.add(0));
}
function Mark$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(Mark$1, Transform$1, {
transform(_24, pulse2) {
let mark = this.value;
if (!mark) {
mark = pulse2.dataflow.scenegraph().mark(_24.markdef, lookup$1$2(_24), _24.index);
mark.group.context = _24.context;
if (!_24.context.group)
_24.context.group = mark.group;
mark.source = this.source;
mark.clip = _24.clip;
mark.interactive = _24.interactive;
this.value = mark;
}
const Init = mark.marktype === Group2 ? GroupItem : Item;
pulse2.visit(pulse2.ADD, (item) => Init.call(item, mark));
if (_24.modified("clip") || _24.modified("interactive")) {
mark.clip = _24.clip;
mark.interactive = !!_24.interactive;
mark.zdirty = true;
pulse2.reflow();
}
mark.items = pulse2.source;
return pulse2;
}
});
function lookup$1$2(_24) {
const g2 = _24.groups, p2 = _24.parent;
return g2 && g2.size === 1 ? g2.get(Object.keys(g2.object)[0]) : g2 && p2 ? g2.lookup(p2) : null;
}
function Overlap$1(params2) {
Transform$1.call(this, null, params2);
}
const methods = {
parity: (items) => items.filter((item, i2) => i2 % 2 ? item.opacity = 0 : 1),
greedy: (items, sep) => {
let a2;
return items.filter((b2, i2) => !i2 || !intersect$1(a2.bounds, b2.bounds, sep) ? (a2 = b2, 1) : b2.opacity = 0);
}
};
const intersect$1 = (a2, b2, sep) => sep > Math.max(b2.x1 - a2.x2, a2.x1 - b2.x2, b2.y1 - a2.y2, a2.y1 - b2.y2);
const hasOverlap = (items, pad2) => {
for (var i2 = 1, n2 = items.length, a2 = items[0].bounds, b2; i2 < n2; a2 = b2, ++i2) {
if (intersect$1(a2, b2 = items[i2].bounds, pad2))
return true;
}
};
const hasBounds = (item) => {
const b2 = item.bounds;
return b2.width() > 1 && b2.height() > 1;
};
const boundTest = (scale2, orient, tolerance) => {
var range2 = scale2.range(), b2 = new Bounds$1();
if (orient === Top$1 || orient === Bottom$1) {
b2.set(range2[0], -Infinity, range2[1], Infinity);
} else {
b2.set(-Infinity, range2[0], Infinity, range2[1]);
}
b2.expand(tolerance || 1);
return (item) => b2.encloses(item.bounds);
};
const reset = (source2) => {
source2.forEach((item) => item.opacity = 1);
return source2;
};
const reflow = (pulse2, _24) => pulse2.reflow(_24.modified()).modifies("opacity");
inherits(Overlap$1, Transform$1, {
transform(_24, pulse2) {
const reduce2 = methods[_24.method] || methods.parity, sep = _24.separation || 0;
let source2 = pulse2.materialize(pulse2.SOURCE).source, items, test2;
if (!source2 || !source2.length)
return;
if (!_24.method) {
if (_24.modified("method")) {
reset(source2);
pulse2 = reflow(pulse2, _24);
}
return pulse2;
}
source2 = source2.filter(hasBounds);
if (!source2.length)
return;
if (_24.sort) {
source2 = source2.slice().sort(_24.sort);
}
items = reset(source2);
pulse2 = reflow(pulse2, _24);
if (items.length >= 3 && hasOverlap(items, sep)) {
do {
items = reduce2(items, sep);
} while (items.length >= 3 && hasOverlap(items, sep));
if (items.length < 3 && !peek$1(source2).opacity) {
if (items.length > 1)
peek$1(items).opacity = 0;
peek$1(source2).opacity = 1;
}
}
if (_24.boundScale && _24.boundTolerance >= 0) {
test2 = boundTest(_24.boundScale, _24.boundOrient, +_24.boundTolerance);
source2.forEach((item) => {
if (!test2(item))
item.opacity = 0;
});
}
const bounds2 = items[0].mark.bounds.clear();
source2.forEach((item) => {
if (item.opacity)
bounds2.union(item.bounds);
});
return pulse2;
}
});
function Render$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(Render$1, Transform$1, {
transform(_24, pulse2) {
const view = pulse2.dataflow;
pulse2.visit(pulse2.ALL, (item) => view.dirty(item));
if (pulse2.fields && pulse2.fields["zindex"]) {
const item = pulse2.source && pulse2.source[0];
if (item)
item.mark.zdirty = true;
}
}
});
const tempBounds = new Bounds$1();
function set$5(item, property2, value2) {
return item[property2] === value2 ? 0 : (item[property2] = value2, 1);
}
function isYAxis(mark) {
var orient = mark.items[0].orient;
return orient === Left$1 || orient === Right$1;
}
function axisIndices(datum2) {
let index2 = +datum2.grid;
return [
datum2.ticks ? index2++ : -1,
// ticks index
datum2.labels ? index2++ : -1,
// labels index
index2 + +datum2.domain
// title index
];
}
function axisLayout(view, axis, width2, height2) {
var item = axis.items[0], datum2 = item.datum, delta = item.translate != null ? item.translate : 0.5, orient = item.orient, indices = axisIndices(datum2), range2 = item.range, offset2 = item.offset, position2 = item.position, minExtent = item.minExtent, maxExtent = item.maxExtent, title = datum2.title && item.items[indices[2]].items[0], titlePadding = item.titlePadding, bounds2 = item.bounds, dl = title && multiLineOffset(title), x2 = 0, y2 = 0, i2, s2;
tempBounds.clear().union(bounds2);
bounds2.clear();
if ((i2 = indices[0]) > -1)
bounds2.union(item.items[i2].bounds);
if ((i2 = indices[1]) > -1)
bounds2.union(item.items[i2].bounds);
switch (orient) {
case Top$1:
x2 = position2 || 0;
y2 = -offset2;
s2 = Math.max(minExtent, Math.min(maxExtent, -bounds2.y1));
bounds2.add(0, -s2).add(range2, 0);
if (title)
axisTitleLayout(view, title, s2, titlePadding, dl, 0, -1, bounds2);
break;
case Left$1:
x2 = -offset2;
y2 = position2 || 0;
s2 = Math.max(minExtent, Math.min(maxExtent, -bounds2.x1));
bounds2.add(-s2, 0).add(0, range2);
if (title)
axisTitleLayout(view, title, s2, titlePadding, dl, 1, -1, bounds2);
break;
case Right$1:
x2 = width2 + offset2;
y2 = position2 || 0;
s2 = Math.max(minExtent, Math.min(maxExtent, bounds2.x2));
bounds2.add(0, 0).add(s2, range2);
if (title)
axisTitleLayout(view, title, s2, titlePadding, dl, 1, 1, bounds2);
break;
case Bottom$1:
x2 = position2 || 0;
y2 = height2 + offset2;
s2 = Math.max(minExtent, Math.min(maxExtent, bounds2.y2));
bounds2.add(0, 0).add(range2, s2);
if (title)
axisTitleLayout(view, title, s2, titlePadding, 0, 0, 1, bounds2);
break;
default:
x2 = item.x;
y2 = item.y;
}
boundStroke(bounds2.translate(x2, y2), item);
if (set$5(item, "x", x2 + delta) | set$5(item, "y", y2 + delta)) {
item.bounds = tempBounds;
view.dirty(item);
item.bounds = bounds2;
view.dirty(item);
}
return item.mark.bounds.clear().union(bounds2);
}
function axisTitleLayout(view, title, offset2, pad2, dl, isYAxis2, sign2, bounds2) {
const b2 = title.bounds;
if (title.auto) {
const v2 = sign2 * (offset2 + dl + pad2);
let dx = 0, dy = 0;
view.dirty(title);
isYAxis2 ? dx = (title.x || 0) - (title.x = v2) : dy = (title.y || 0) - (title.y = v2);
title.mark.bounds.clear().union(b2.translate(-dx, -dy));
view.dirty(title);
}
bounds2.union(b2);
}
const min$6 = (a2, b2) => Math.floor(Math.min(a2, b2));
const max$5 = (a2, b2) => Math.ceil(Math.max(a2, b2));
function gridLayoutGroups(group2) {
var groups = group2.items, n2 = groups.length, i2 = 0, mark, items;
const views = {
marks: [],
rowheaders: [],
rowfooters: [],
colheaders: [],
colfooters: [],
rowtitle: null,
coltitle: null
};
for (; i2 < n2; ++i2) {
mark = groups[i2];
items = mark.items;
if (mark.marktype === Group2) {
switch (mark.role) {
case AxisRole$1:
case LegendRole$1:
case TitleRole$1:
break;
case RowHeader:
views.rowheaders.push(...items);
break;
case RowFooter:
views.rowfooters.push(...items);
break;
case ColHeader:
views.colheaders.push(...items);
break;
case ColFooter:
views.colfooters.push(...items);
break;
case RowTitle:
views.rowtitle = items[0];
break;
case ColTitle:
views.coltitle = items[0];
break;
default:
views.marks.push(...items);
}
}
}
return views;
}
function bboxFlush(item) {
return new Bounds$1().set(0, 0, item.width || 0, item.height || 0);
}
function bboxFull(item) {
const b2 = item.bounds.clone();
return b2.empty() ? b2.set(0, 0, 0, 0) : b2.translate(-(item.x || 0), -(item.y || 0));
}
function get$2(opt, key2, d2) {
const v2 = isObject$a(opt) ? opt[key2] : opt;
return v2 != null ? v2 : d2 !== void 0 ? d2 : 0;
}
function offsetValue$1(v2) {
return v2 < 0 ? Math.ceil(-v2) : 0;
}
function gridLayout(view, groups, opt) {
var dirty = !opt.nodirty, bbox = opt.bounds === Flush ? bboxFlush : bboxFull, bounds2 = tempBounds.set(0, 0, 0, 0), alignCol = get$2(opt.align, Column), alignRow = get$2(opt.align, Row), padCol = get$2(opt.padding, Column), padRow = get$2(opt.padding, Row), ncols = opt.columns || groups.length, nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols), n2 = groups.length, xOffset = Array(n2), xExtent = Array(ncols), xMax = 0, yOffset = Array(n2), yExtent = Array(nrows), yMax = 0, dx = Array(n2), dy = Array(n2), boxes = Array(n2), m2, i2, c2, r2, b2, g2, px2, py2, x2, y2, offset2;
for (i2 = 0; i2 < ncols; ++i2)
xExtent[i2] = 0;
for (i2 = 0; i2 < nrows; ++i2)
yExtent[i2] = 0;
for (i2 = 0; i2 < n2; ++i2) {
g2 = groups[i2];
b2 = boxes[i2] = bbox(g2);
g2.x = g2.x || 0;
dx[i2] = 0;
g2.y = g2.y || 0;
dy[i2] = 0;
c2 = i2 % ncols;
r2 = ~~(i2 / ncols);
xMax = Math.max(xMax, px2 = Math.ceil(b2.x2));
yMax = Math.max(yMax, py2 = Math.ceil(b2.y2));
xExtent[c2] = Math.max(xExtent[c2], px2);
yExtent[r2] = Math.max(yExtent[r2], py2);
xOffset[i2] = padCol + offsetValue$1(b2.x1);
yOffset[i2] = padRow + offsetValue$1(b2.y1);
if (dirty)
view.dirty(groups[i2]);
}
for (i2 = 0; i2 < n2; ++i2) {
if (i2 % ncols === 0)
xOffset[i2] = 0;
if (i2 < ncols)
yOffset[i2] = 0;
}
if (alignCol === Each) {
for (c2 = 1; c2 < ncols; ++c2) {
for (offset2 = 0, i2 = c2; i2 < n2; i2 += ncols) {
if (offset2 < xOffset[i2])
offset2 = xOffset[i2];
}
for (i2 = c2; i2 < n2; i2 += ncols) {
xOffset[i2] = offset2 + xExtent[c2 - 1];
}
}
} else if (alignCol === All) {
for (offset2 = 0, i2 = 0; i2 < n2; ++i2) {
if (i2 % ncols && offset2 < xOffset[i2])
offset2 = xOffset[i2];
}
for (i2 = 0; i2 < n2; ++i2) {
if (i2 % ncols)
xOffset[i2] = offset2 + xMax;
}
} else {
for (alignCol = false, c2 = 1; c2 < ncols; ++c2) {
for (i2 = c2; i2 < n2; i2 += ncols) {
xOffset[i2] += xExtent[c2 - 1];
}
}
}
if (alignRow === Each) {
for (r2 = 1; r2 < nrows; ++r2) {
for (offset2 = 0, i2 = r2 * ncols, m2 = i2 + ncols; i2 < m2; ++i2) {
if (offset2 < yOffset[i2])
offset2 = yOffset[i2];
}
for (i2 = r2 * ncols; i2 < m2; ++i2) {
yOffset[i2] = offset2 + yExtent[r2 - 1];
}
}
} else if (alignRow === All) {
for (offset2 = 0, i2 = ncols; i2 < n2; ++i2) {
if (offset2 < yOffset[i2])
offset2 = yOffset[i2];
}
for (i2 = ncols; i2 < n2; ++i2) {
yOffset[i2] = offset2 + yMax;
}
} else {
for (alignRow = false, r2 = 1; r2 < nrows; ++r2) {
for (i2 = r2 * ncols, m2 = i2 + ncols; i2 < m2; ++i2) {
yOffset[i2] += yExtent[r2 - 1];
}
}
}
for (x2 = 0, i2 = 0; i2 < n2; ++i2) {
x2 = xOffset[i2] + (i2 % ncols ? x2 : 0);
dx[i2] += x2 - groups[i2].x;
}
for (c2 = 0; c2 < ncols; ++c2) {
for (y2 = 0, i2 = c2; i2 < n2; i2 += ncols) {
y2 += yOffset[i2];
dy[i2] += y2 - groups[i2].y;
}
}
if (alignCol && get$2(opt.center, Column) && nrows > 1) {
for (i2 = 0; i2 < n2; ++i2) {
b2 = alignCol === All ? xMax : xExtent[i2 % ncols];
x2 = b2 - boxes[i2].x2 - groups[i2].x - dx[i2];
if (x2 > 0)
dx[i2] += x2 / 2;
}
}
if (alignRow && get$2(opt.center, Row) && ncols !== 1) {
for (i2 = 0; i2 < n2; ++i2) {
b2 = alignRow === All ? yMax : yExtent[~~(i2 / ncols)];
y2 = b2 - boxes[i2].y2 - groups[i2].y - dy[i2];
if (y2 > 0)
dy[i2] += y2 / 2;
}
}
for (i2 = 0; i2 < n2; ++i2) {
bounds2.union(boxes[i2].translate(dx[i2], dy[i2]));
}
x2 = get$2(opt.anchor, X$2);
y2 = get$2(opt.anchor, Y$2);
switch (get$2(opt.anchor, Column)) {
case End$1:
x2 -= bounds2.width();
break;
case Middle$1:
x2 -= bounds2.width() / 2;
}
switch (get$2(opt.anchor, Row)) {
case End$1:
y2 -= bounds2.height();
break;
case Middle$1:
y2 -= bounds2.height() / 2;
}
x2 = Math.round(x2);
y2 = Math.round(y2);
bounds2.clear();
for (i2 = 0; i2 < n2; ++i2) {
groups[i2].mark.bounds.clear();
}
for (i2 = 0; i2 < n2; ++i2) {
g2 = groups[i2];
g2.x += dx[i2] += x2;
g2.y += dy[i2] += y2;
bounds2.union(g2.mark.bounds.union(g2.bounds.translate(dx[i2], dy[i2])));
if (dirty)
view.dirty(g2);
}
return bounds2;
}
function trellisLayout(view, group2, opt) {
var views = gridLayoutGroups(group2), groups = views.marks, bbox = opt.bounds === Flush ? boundFlush : boundFull, off = opt.offset, ncols = opt.columns || groups.length, nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols), cells = nrows * ncols, x2, y2, x22, y22, anchor, band2, offset2;
const bounds2 = gridLayout(view, groups, opt);
if (bounds2.empty())
bounds2.set(0, 0, 0, 0);
if (views.rowheaders) {
band2 = get$2(opt.headerBand, Row, null);
x2 = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get$2(off, "rowHeader"), min$6, 0, bbox, "x1", 0, ncols, 1, band2);
}
if (views.colheaders) {
band2 = get$2(opt.headerBand, Column, null);
y2 = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get$2(off, "columnHeader"), min$6, 1, bbox, "y1", 0, 1, ncols, band2);
}
if (views.rowfooters) {
band2 = get$2(opt.footerBand, Row, null);
x22 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get$2(off, "rowFooter"), max$5, 0, bbox, "x2", ncols - 1, ncols, 1, band2);
}
if (views.colfooters) {
band2 = get$2(opt.footerBand, Column, null);
y22 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get$2(off, "columnFooter"), max$5, 1, bbox, "y2", cells - ncols, 1, ncols, band2);
}
if (views.rowtitle) {
anchor = get$2(opt.titleAnchor, Row);
offset2 = get$2(off, "rowTitle");
offset2 = anchor === End$1 ? x22 + offset2 : x2 - offset2;
band2 = get$2(opt.titleBand, Row, 0.5);
layoutTitle(view, views.rowtitle, offset2, 0, bounds2, band2);
}
if (views.coltitle) {
anchor = get$2(opt.titleAnchor, Column);
offset2 = get$2(off, "columnTitle");
offset2 = anchor === End$1 ? y22 + offset2 : y2 - offset2;
band2 = get$2(opt.titleBand, Column, 0.5);
layoutTitle(view, views.coltitle, offset2, 1, bounds2, band2);
}
}
function boundFlush(item, field2) {
return field2 === "x1" ? item.x || 0 : field2 === "y1" ? item.y || 0 : field2 === "x2" ? (item.x || 0) + (item.width || 0) : field2 === "y2" ? (item.y || 0) + (item.height || 0) : void 0;
}
function boundFull(item, field2) {
return item.bounds[field2];
}
function layoutHeaders(view, headers, groups, ncols, limit2, offset2, agg, isX2, bound2, bf2, start2, stride, back, band2) {
var n2 = groups.length, init3 = 0, edge = 0, i2, j2, k2, m2, b2, h2, g2, x2, y2;
if (!n2)
return init3;
for (i2 = start2; i2 < n2; i2 += stride) {
if (groups[i2])
init3 = agg(init3, bound2(groups[i2], bf2));
}
if (!headers.length)
return init3;
if (headers.length > limit2) {
view.warn("Grid headers exceed limit: " + limit2);
headers = headers.slice(0, limit2);
}
init3 += offset2;
for (j2 = 0, m2 = headers.length; j2 < m2; ++j2) {
view.dirty(headers[j2]);
headers[j2].mark.bounds.clear();
}
for (i2 = start2, j2 = 0, m2 = headers.length; j2 < m2; ++j2, i2 += stride) {
h2 = headers[j2];
b2 = h2.mark.bounds;
for (k2 = i2; k2 >= 0 && (g2 = groups[k2]) == null; k2 -= back)
;
if (isX2) {
x2 = band2 == null ? g2.x : Math.round(g2.bounds.x1 + band2 * g2.bounds.width());
y2 = init3;
} else {
x2 = init3;
y2 = band2 == null ? g2.y : Math.round(g2.bounds.y1 + band2 * g2.bounds.height());
}
b2.union(h2.bounds.translate(x2 - (h2.x || 0), y2 - (h2.y || 0)));
h2.x = x2;
h2.y = y2;
view.dirty(h2);
edge = agg(edge, b2[bf2]);
}
return edge;
}
function layoutTitle(view, g2, offset2, isX2, bounds2, band2) {
if (!g2)
return;
view.dirty(g2);
var x2 = offset2, y2 = offset2;
isX2 ? x2 = Math.round(bounds2.x1 + band2 * bounds2.width()) : y2 = Math.round(bounds2.y1 + band2 * bounds2.height());
g2.bounds.translate(x2 - (g2.x || 0), y2 - (g2.y || 0));
g2.mark.bounds.clear().union(g2.bounds);
g2.x = x2;
g2.y = y2;
view.dirty(g2);
}
function lookup$7(config2, orient) {
const opt = config2[orient] || {};
return (key2, d2) => opt[key2] != null ? opt[key2] : config2[key2] != null ? config2[key2] : d2;
}
function offsets(legends, value2) {
let max2 = -Infinity;
legends.forEach((item) => {
if (item.offset != null)
max2 = Math.max(max2, item.offset);
});
return max2 > -Infinity ? max2 : value2;
}
function legendParams(g2, orient, config2, xb2, yb2, w2, h2) {
const _24 = lookup$7(config2, orient), offset2 = offsets(g2, _24("offset", 0)), anchor = _24("anchor", Start$1), mult2 = anchor === End$1 ? 1 : anchor === Middle$1 ? 0.5 : 0;
const p2 = {
align: Each,
bounds: _24("bounds", Flush),
columns: _24("direction") === "vertical" ? 1 : g2.length,
padding: _24("margin", 8),
center: _24("center"),
nodirty: true
};
switch (orient) {
case Left$1:
p2.anchor = {
x: Math.floor(xb2.x1) - offset2,
column: End$1,
y: mult2 * (h2 || xb2.height() + 2 * xb2.y1),
row: anchor
};
break;
case Right$1:
p2.anchor = {
x: Math.ceil(xb2.x2) + offset2,
y: mult2 * (h2 || xb2.height() + 2 * xb2.y1),
row: anchor
};
break;
case Top$1:
p2.anchor = {
y: Math.floor(yb2.y1) - offset2,
row: End$1,
x: mult2 * (w2 || yb2.width() + 2 * yb2.x1),
column: anchor
};
break;
case Bottom$1:
p2.anchor = {
y: Math.ceil(yb2.y2) + offset2,
x: mult2 * (w2 || yb2.width() + 2 * yb2.x1),
column: anchor
};
break;
case TopLeft:
p2.anchor = {
x: offset2,
y: offset2
};
break;
case TopRight:
p2.anchor = {
x: w2 - offset2,
y: offset2,
column: End$1
};
break;
case BottomLeft:
p2.anchor = {
x: offset2,
y: h2 - offset2,
row: End$1
};
break;
case BottomRight:
p2.anchor = {
x: w2 - offset2,
y: h2 - offset2,
column: End$1,
row: End$1
};
break;
}
return p2;
}
function legendLayout(view, legend) {
var item = legend.items[0], datum2 = item.datum, orient = item.orient, bounds2 = item.bounds, x2 = item.x, y2 = item.y, w2, h2;
item._bounds ? item._bounds.clear().union(bounds2) : item._bounds = bounds2.clone();
bounds2.clear();
legendGroupLayout(view, item, item.items[0].items[0]);
bounds2 = legendBounds(item, bounds2);
w2 = 2 * item.padding;
h2 = 2 * item.padding;
if (!bounds2.empty()) {
w2 = Math.ceil(bounds2.width() + w2);
h2 = Math.ceil(bounds2.height() + h2);
}
if (datum2.type === Symbols$1) {
legendEntryLayout(item.items[0].items[0].items[0].items);
}
if (orient !== None) {
item.x = x2 = 0;
item.y = y2 = 0;
}
item.width = w2;
item.height = h2;
boundStroke(bounds2.set(x2, y2, x2 + w2, y2 + h2), item);
item.mark.bounds.clear().union(bounds2);
return item;
}
function legendBounds(item, b2) {
item.items.forEach((_24) => b2.union(_24.bounds));
b2.x1 = item.padding;
b2.y1 = item.padding;
return b2;
}
function legendGroupLayout(view, item, entry2) {
var pad2 = item.padding, ex = pad2 - entry2.x, ey = pad2 - entry2.y;
if (!item.datum.title) {
if (ex || ey)
translate(view, entry2, ex, ey);
} else {
var title = item.items[1].items[0], anchor = title.anchor, tpad = item.titlePadding || 0, tx2 = pad2 - title.x, ty = pad2 - title.y;
switch (title.orient) {
case Left$1:
ex += Math.ceil(title.bounds.width()) + tpad;
break;
case Right$1:
case Bottom$1:
break;
default:
ey += title.bounds.height() + tpad;
}
if (ex || ey)
translate(view, entry2, ex, ey);
switch (title.orient) {
case Left$1:
ty += legendTitleOffset(item, entry2, title, anchor, 1, 1);
break;
case Right$1:
tx2 += legendTitleOffset(item, entry2, title, End$1, 0, 0) + tpad;
ty += legendTitleOffset(item, entry2, title, anchor, 1, 1);
break;
case Bottom$1:
tx2 += legendTitleOffset(item, entry2, title, anchor, 0, 0);
ty += legendTitleOffset(item, entry2, title, End$1, -1, 0, 1) + tpad;
break;
default:
tx2 += legendTitleOffset(item, entry2, title, anchor, 0, 0);
}
if (tx2 || ty)
translate(view, title, tx2, ty);
if ((tx2 = Math.round(title.bounds.x1 - pad2)) < 0) {
translate(view, entry2, -tx2, 0);
translate(view, title, -tx2, 0);
}
}
}
function legendTitleOffset(item, entry2, title, anchor, y2, lr2, noBar) {
const grad = item.datum.type !== "symbol", vgrad = title.datum.vgrad, e7 = grad && (lr2 || !vgrad) && !noBar ? entry2.items[0] : entry2, s2 = e7.bounds[y2 ? "y2" : "x2"] - item.padding, u2 = vgrad && lr2 ? s2 : 0, v2 = vgrad && lr2 ? 0 : s2, o2 = y2 <= 0 ? 0 : multiLineOffset(title);
return Math.round(anchor === Start$1 ? u2 : anchor === End$1 ? v2 - o2 : 0.5 * (s2 - o2));
}
function translate(view, item, dx, dy) {
item.x += dx;
item.y += dy;
item.bounds.translate(dx, dy);
item.mark.bounds.translate(dx, dy);
view.dirty(item);
}
function legendEntryLayout(entries) {
const widths = entries.reduce((w2, g2) => {
w2[g2.column] = Math.max(g2.bounds.x2 - g2.x, w2[g2.column] || 0);
return w2;
}, {});
entries.forEach((g2) => {
g2.width = widths[g2.column];
g2.height = g2.bounds.y2 - g2.y;
});
}
function titleLayout(view, mark, width2, height2, viewBounds2) {
var group2 = mark.items[0], frame2 = group2.frame, orient = group2.orient, anchor = group2.anchor, offset2 = group2.offset, padding2 = group2.padding, title = group2.items[0].items[0], subtitle = group2.items[1] && group2.items[1].items[0], end2 = orient === Left$1 || orient === Right$1 ? height2 : width2, start2 = 0, x2 = 0, y2 = 0, sx = 0, sy = 0, pos;
if (frame2 !== Group2) {
orient === Left$1 ? (start2 = viewBounds2.y2, end2 = viewBounds2.y1) : orient === Right$1 ? (start2 = viewBounds2.y1, end2 = viewBounds2.y2) : (start2 = viewBounds2.x1, end2 = viewBounds2.x2);
} else if (orient === Left$1) {
start2 = height2, end2 = 0;
}
pos = anchor === Start$1 ? start2 : anchor === End$1 ? end2 : (start2 + end2) / 2;
if (subtitle && subtitle.text) {
switch (orient) {
case Top$1:
case Bottom$1:
sy = title.bounds.height() + padding2;
break;
case Left$1:
sx = title.bounds.width() + padding2;
break;
case Right$1:
sx = -title.bounds.width() - padding2;
break;
}
tempBounds.clear().union(subtitle.bounds);
tempBounds.translate(sx - (subtitle.x || 0), sy - (subtitle.y || 0));
if (set$5(subtitle, "x", sx) | set$5(subtitle, "y", sy)) {
view.dirty(subtitle);
subtitle.bounds.clear().union(tempBounds);
subtitle.mark.bounds.clear().union(tempBounds);
view.dirty(subtitle);
}
tempBounds.clear().union(subtitle.bounds);
} else {
tempBounds.clear();
}
tempBounds.union(title.bounds);
switch (orient) {
case Top$1:
x2 = pos;
y2 = viewBounds2.y1 - tempBounds.height() - offset2;
break;
case Left$1:
x2 = viewBounds2.x1 - tempBounds.width() - offset2;
y2 = pos;
break;
case Right$1:
x2 = viewBounds2.x2 + tempBounds.width() + offset2;
y2 = pos;
break;
case Bottom$1:
x2 = pos;
y2 = viewBounds2.y2 + offset2;
break;
default:
x2 = group2.x;
y2 = group2.y;
}
if (set$5(group2, "x", x2) | set$5(group2, "y", y2)) {
tempBounds.translate(x2, y2);
view.dirty(group2);
group2.bounds.clear().union(tempBounds);
mark.bounds.clear().union(tempBounds);
view.dirty(group2);
}
return group2.bounds;
}
function ViewLayout$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(ViewLayout$1, Transform$1, {
transform(_24, pulse2) {
const view = pulse2.dataflow;
_24.mark.items.forEach((group2) => {
if (_24.layout)
trellisLayout(view, group2, _24.layout);
layoutGroup(view, group2, _24);
});
return shouldReflow(_24.mark.group) ? pulse2.reflow() : pulse2;
}
});
function shouldReflow(group2) {
return group2 && group2.mark.role !== "legend-entry";
}
function layoutGroup(view, group2, _24) {
var items = group2.items, width2 = Math.max(0, group2.width || 0), height2 = Math.max(0, group2.height || 0), viewBounds2 = new Bounds$1().set(0, 0, width2, height2), xBounds = viewBounds2.clone(), yBounds = viewBounds2.clone(), legends = [], title, mark, orient, b2, i2, n2;
for (i2 = 0, n2 = items.length; i2 < n2; ++i2) {
mark = items[i2];
switch (mark.role) {
case AxisRole$1:
b2 = isYAxis(mark) ? xBounds : yBounds;
b2.union(axisLayout(view, mark, width2, height2));
break;
case TitleRole$1:
title = mark;
break;
case LegendRole$1:
legends.push(legendLayout(view, mark));
break;
case FrameRole$1:
case ScopeRole$1:
case RowHeader:
case RowFooter:
case RowTitle:
case ColHeader:
case ColFooter:
case ColTitle:
xBounds.union(mark.bounds);
yBounds.union(mark.bounds);
break;
default:
viewBounds2.union(mark.bounds);
}
}
if (legends.length) {
const l2 = {};
legends.forEach((item) => {
orient = item.orient || Right$1;
if (orient !== None)
(l2[orient] || (l2[orient] = [])).push(item);
});
for (const orient2 in l2) {
const g2 = l2[orient2];
gridLayout(view, g2, legendParams(g2, orient2, _24.legends, xBounds, yBounds, width2, height2));
}
legends.forEach((item) => {
const b3 = item.bounds;
if (!b3.equals(item._bounds)) {
item.bounds = item._bounds;
view.dirty(item);
item.bounds = b3;
view.dirty(item);
}
if (_24.autosize && (_24.autosize.type === Fit || _24.autosize.type === FitX || _24.autosize.type === FitY)) {
switch (item.orient) {
case Left$1:
case Right$1:
viewBounds2.add(b3.x1, 0).add(b3.x2, 0);
break;
case Top$1:
case Bottom$1:
viewBounds2.add(0, b3.y1).add(0, b3.y2);
}
} else {
viewBounds2.union(b3);
}
});
}
viewBounds2.union(xBounds).union(yBounds);
if (title) {
viewBounds2.union(titleLayout(view, title, width2, height2, viewBounds2));
}
if (group2.clip) {
viewBounds2.set(0, 0, group2.width || 0, group2.height || 0);
}
viewSizeLayout(view, group2, viewBounds2, _24);
}
function viewSizeLayout(view, group2, viewBounds2, _24) {
const auto2 = _24.autosize || {}, type2 = auto2.type;
if (view._autosize < 1 || !type2)
return;
let viewWidth2 = view._width, viewHeight2 = view._height, width2 = Math.max(0, group2.width || 0), left2 = Math.max(0, Math.ceil(-viewBounds2.x1)), height2 = Math.max(0, group2.height || 0), top2 = Math.max(0, Math.ceil(-viewBounds2.y1));
const right2 = Math.max(0, Math.ceil(viewBounds2.x2 - width2)), bottom2 = Math.max(0, Math.ceil(viewBounds2.y2 - height2));
if (auto2.contains === Padding$1) {
const padding2 = view.padding();
viewWidth2 -= padding2.left + padding2.right;
viewHeight2 -= padding2.top + padding2.bottom;
}
if (type2 === None) {
left2 = 0;
top2 = 0;
width2 = viewWidth2;
height2 = viewHeight2;
} else if (type2 === Fit) {
width2 = Math.max(0, viewWidth2 - left2 - right2);
height2 = Math.max(0, viewHeight2 - top2 - bottom2);
} else if (type2 === FitX) {
width2 = Math.max(0, viewWidth2 - left2 - right2);
viewHeight2 = height2 + top2 + bottom2;
} else if (type2 === FitY) {
viewWidth2 = width2 + left2 + right2;
height2 = Math.max(0, viewHeight2 - top2 - bottom2);
} else if (type2 === Pad) {
viewWidth2 = width2 + left2 + right2;
viewHeight2 = height2 + top2 + bottom2;
}
view._resizeView(viewWidth2, viewHeight2, width2, height2, [left2, top2], auto2.resize);
}
const vtx = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
bound: Bound$1,
identifier: Identifier$1,
mark: Mark$1,
overlap: Overlap$1,
render: Render$1,
viewlayout: ViewLayout$1
}, Symbol.toStringTag, { value: "Module" }));
function range$5(start2, stop2, step) {
start2 = +start2, stop2 = +stop2, step = (n2 = arguments.length) < 2 ? (stop2 = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop2 - start2) / step)) | 0, range2 = new Array(n2);
while (++i2 < n2) {
range2[i2] = start2 + i2 * step;
}
return range2;
}
function sum$2(values2, valueof) {
let sum2 = 0;
if (valueof === void 0) {
for (let value2 of values2) {
if (value2 = +value2) {
sum2 += value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if (value2 = +valueof(value2, ++index2, values2)) {
sum2 += value2;
}
}
}
return sum2;
}
function AxisTicks$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(AxisTicks$1, Transform$1, {
transform(_24, pulse2) {
if (this.value && !_24.modified()) {
return pulse2.StopPropagation;
}
var locale2 = pulse2.dataflow.locale(), out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), ticks2 = this.value, scale2 = _24.scale, tally = _24.count == null ? _24.values ? _24.values.length : 10 : _24.count, count2 = tickCount(scale2, tally, _24.minstep), format2 = _24.format || tickFormat(locale2, scale2, count2, _24.formatSpecifier, _24.formatType, !!_24.values), values2 = _24.values ? validTicks(scale2, _24.values, count2) : tickValues(scale2, count2);
if (ticks2)
out.rem = ticks2;
ticks2 = values2.map((value2, i2) => ingest$1({
index: i2 / (values2.length - 1 || 1),
value: value2,
label: format2(value2)
}));
if (_24.extra && ticks2.length) {
ticks2.push(ingest$1({
index: -1,
extra: {
value: ticks2[0].value
},
label: ""
}));
}
out.source = ticks2;
out.add = ticks2;
this.value = ticks2;
return out;
}
});
function DataJoin$1(params2) {
Transform$1.call(this, null, params2);
}
function defaultItemCreate() {
return ingest$1({});
}
function newMap(key2) {
const map2 = fastmap().test((t5) => t5.exit);
map2.lookup = (t5) => map2.get(key2(t5));
return map2;
}
inherits(DataJoin$1, Transform$1, {
transform(_24, pulse2) {
var df2 = pulse2.dataflow, out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), item = _24.item || defaultItemCreate, key2 = _24.key || tupleid, map2 = this.value;
if (isArray$2(out.encode)) {
out.encode = null;
}
if (map2 && (_24.modified("key") || pulse2.modified(key2))) {
error2("DataJoin does not support modified key function or fields.");
}
if (!map2) {
pulse2 = pulse2.addAll();
this.value = map2 = newMap(key2);
}
pulse2.visit(pulse2.ADD, (t5) => {
const k2 = key2(t5);
let x2 = map2.get(k2);
if (x2) {
if (x2.exit) {
map2.empty--;
out.add.push(x2);
} else {
out.mod.push(x2);
}
} else {
x2 = item(t5);
map2.set(k2, x2);
out.add.push(x2);
}
x2.datum = t5;
x2.exit = false;
});
pulse2.visit(pulse2.MOD, (t5) => {
const k2 = key2(t5), x2 = map2.get(k2);
if (x2) {
x2.datum = t5;
out.mod.push(x2);
}
});
pulse2.visit(pulse2.REM, (t5) => {
const k2 = key2(t5), x2 = map2.get(k2);
if (t5 === x2.datum && !x2.exit) {
out.rem.push(x2);
x2.exit = true;
++map2.empty;
}
});
if (pulse2.changed(pulse2.ADD_MOD))
out.modifies("datum");
if (pulse2.clean() || _24.clean && map2.empty > df2.cleanThreshold) {
df2.runAfter(map2.clean);
}
return out;
}
});
function Encode$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(Encode$1, Transform$1, {
transform(_24, pulse2) {
var out = pulse2.fork(pulse2.ADD_REM), fmod = _24.mod || false, encoders = _24.encoders, encode2 = pulse2.encode;
if (isArray$2(encode2)) {
if (out.changed() || encode2.every((e7) => encoders[e7])) {
encode2 = encode2[0];
out.encode = null;
} else {
return pulse2.StopPropagation;
}
}
var reenter = encode2 === "enter", update2 = encoders.update || falsy, enter = encoders.enter || falsy, exit = encoders.exit || falsy, set2 = (encode2 && !reenter ? encoders[encode2] : update2) || falsy;
if (pulse2.changed(pulse2.ADD)) {
pulse2.visit(pulse2.ADD, (t5) => {
enter(t5, _24);
update2(t5, _24);
});
out.modifies(enter.output);
out.modifies(update2.output);
if (set2 !== falsy && set2 !== update2) {
pulse2.visit(pulse2.ADD, (t5) => {
set2(t5, _24);
});
out.modifies(set2.output);
}
}
if (pulse2.changed(pulse2.REM) && exit !== falsy) {
pulse2.visit(pulse2.REM, (t5) => {
exit(t5, _24);
});
out.modifies(exit.output);
}
if (reenter || set2 !== falsy) {
const flag2 = pulse2.MOD | (_24.modified() ? pulse2.REFLOW : 0);
if (reenter) {
pulse2.visit(flag2, (t5) => {
const mod = enter(t5, _24) || fmod;
if (set2(t5, _24) || mod)
out.mod.push(t5);
});
if (out.mod.length)
out.modifies(enter.output);
} else {
pulse2.visit(flag2, (t5) => {
if (set2(t5, _24) || fmod)
out.mod.push(t5);
});
}
if (out.mod.length)
out.modifies(set2.output);
}
return out.changed() ? out : pulse2.StopPropagation;
}
});
function LegendEntries$1(params2) {
Transform$1.call(this, [], params2);
}
inherits(LegendEntries$1, Transform$1, {
transform(_24, pulse2) {
if (this.value != null && !_24.modified()) {
return pulse2.StopPropagation;
}
var locale2 = pulse2.dataflow.locale(), out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), items = this.value, type2 = _24.type || SymbolLegend, scale2 = _24.scale, limit2 = +_24.limit, count2 = tickCount(scale2, _24.count == null ? 5 : _24.count, _24.minstep), lskip = !!_24.values || type2 === SymbolLegend, format2 = _24.format || labelFormat(locale2, scale2, count2, type2, _24.formatSpecifier, _24.formatType, lskip), values2 = _24.values || labelValues(scale2, count2), domain2, fraction, size, offset2, ellipsis;
if (items)
out.rem = items;
if (type2 === SymbolLegend) {
if (limit2 && values2.length > limit2) {
pulse2.dataflow.warn("Symbol legend count exceeds limit, filtering items.");
items = values2.slice(0, limit2 - 1);
ellipsis = true;
} else {
items = values2;
}
if (isFunction(size = _24.size)) {
if (!_24.values && scale2(items[0]) === 0) {
items = items.slice(1);
}
offset2 = items.reduce((max2, value2) => Math.max(max2, size(value2, _24)), 0);
} else {
size = constant$6(offset2 = size || 8);
}
items = items.map((value2, index2) => ingest$1({
index: index2,
label: format2(value2, index2, items),
value: value2,
offset: offset2,
size: size(value2, _24)
}));
if (ellipsis) {
ellipsis = values2[items.length];
items.push(ingest$1({
index: items.length,
label: `…${values2.length - items.length} entries`,
value: ellipsis,
offset: offset2,
size: size(ellipsis, _24)
}));
}
} else if (type2 === GradientLegend) {
domain2 = scale2.domain(), fraction = scaleFraction(scale2, domain2[0], peek$1(domain2));
if (values2.length < 3 && !_24.values && domain2[0] !== peek$1(domain2)) {
values2 = [domain2[0], peek$1(domain2)];
}
items = values2.map((value2, index2) => ingest$1({
index: index2,
label: format2(value2, index2, values2),
value: value2,
perc: fraction(value2)
}));
} else {
size = values2.length - 1;
fraction = labelFraction(scale2);
items = values2.map((value2, index2) => ingest$1({
index: index2,
label: format2(value2, index2, values2),
value: value2,
perc: index2 ? fraction(value2) : 0,
perc2: index2 === size ? 1 : fraction(values2[index2 + 1])
}));
}
out.source = items;
out.add = items;
this.value = items;
return out;
}
});
const sourceX = (t5) => t5.source.x;
const sourceY = (t5) => t5.source.y;
const targetX = (t5) => t5.target.x;
const targetY = (t5) => t5.target.y;
function LinkPath(params2) {
Transform$1.call(this, {}, params2);
}
LinkPath.Definition = {
"type": "LinkPath",
"metadata": {
"modifies": true
},
"params": [{
"name": "sourceX",
"type": "field",
"default": "source.x"
}, {
"name": "sourceY",
"type": "field",
"default": "source.y"
}, {
"name": "targetX",
"type": "field",
"default": "target.x"
}, {
"name": "targetY",
"type": "field",
"default": "target.y"
}, {
"name": "orient",
"type": "enum",
"default": "vertical",
"values": ["horizontal", "vertical", "radial"]
}, {
"name": "shape",
"type": "enum",
"default": "line",
"values": ["line", "arc", "curve", "diagonal", "orthogonal"]
}, {
"name": "require",
"type": "signal"
}, {
"name": "as",
"type": "string",
"default": "path"
}]
};
inherits(LinkPath, Transform$1, {
transform(_24, pulse2) {
var sx = _24.sourceX || sourceX, sy = _24.sourceY || sourceY, tx2 = _24.targetX || targetX, ty = _24.targetY || targetY, as = _24.as || "path", orient = _24.orient || "vertical", shape2 = _24.shape || "line", path2 = Paths.get(shape2 + "-" + orient) || Paths.get(shape2);
if (!path2) {
error2("LinkPath unsupported type: " + _24.shape + (_24.orient ? "-" + _24.orient : ""));
}
pulse2.visit(pulse2.SOURCE, (t5) => {
t5[as] = path2(sx(t5), sy(t5), tx2(t5), ty(t5));
});
return pulse2.reflow(_24.modified()).modifies(as);
}
});
const line = (sx, sy, tx2, ty) => "M" + sx + "," + sy + "L" + tx2 + "," + ty;
const lineR = (sa2, sr2, ta2, tr2) => line(sr2 * Math.cos(sa2), sr2 * Math.sin(sa2), tr2 * Math.cos(ta2), tr2 * Math.sin(ta2));
const arc = (sx, sy, tx2, ty) => {
var dx = tx2 - sx, dy = ty - sy, rr2 = Math.hypot(dx, dy) / 2, ra2 = 180 * Math.atan2(dy, dx) / Math.PI;
return "M" + sx + "," + sy + "A" + rr2 + "," + rr2 + " " + ra2 + " 0 1 " + tx2 + "," + ty;
};
const arcR = (sa2, sr2, ta2, tr2) => arc(sr2 * Math.cos(sa2), sr2 * Math.sin(sa2), tr2 * Math.cos(ta2), tr2 * Math.sin(ta2));
const curve = (sx, sy, tx2, ty) => {
const dx = tx2 - sx, dy = ty - sy, ix = 0.2 * (dx + dy), iy = 0.2 * (dy - dx);
return "M" + sx + "," + sy + "C" + (sx + ix) + "," + (sy + iy) + " " + (tx2 + iy) + "," + (ty - ix) + " " + tx2 + "," + ty;
};
const curveR = (sa2, sr2, ta2, tr2) => curve(sr2 * Math.cos(sa2), sr2 * Math.sin(sa2), tr2 * Math.cos(ta2), tr2 * Math.sin(ta2));
const orthoX = (sx, sy, tx2, ty) => "M" + sx + "," + sy + "V" + ty + "H" + tx2;
const orthoY = (sx, sy, tx2, ty) => "M" + sx + "," + sy + "H" + tx2 + "V" + ty;
const orthoR = (sa2, sr2, ta2, tr2) => {
const sc2 = Math.cos(sa2), ss = Math.sin(sa2), tc2 = Math.cos(ta2), ts2 = Math.sin(ta2), sf2 = Math.abs(ta2 - sa2) > Math.PI ? ta2 <= sa2 : ta2 > sa2;
return "M" + sr2 * sc2 + "," + sr2 * ss + "A" + sr2 + "," + sr2 + " 0 0," + (sf2 ? 1 : 0) + " " + sr2 * tc2 + "," + sr2 * ts2 + "L" + tr2 * tc2 + "," + tr2 * ts2;
};
const diagonalX = (sx, sy, tx2, ty) => {
const m2 = (sx + tx2) / 2;
return "M" + sx + "," + sy + "C" + m2 + "," + sy + " " + m2 + "," + ty + " " + tx2 + "," + ty;
};
const diagonalY = (sx, sy, tx2, ty) => {
const m2 = (sy + ty) / 2;
return "M" + sx + "," + sy + "C" + sx + "," + m2 + " " + tx2 + "," + m2 + " " + tx2 + "," + ty;
};
const diagonalR = (sa2, sr2, ta2, tr2) => {
const sc2 = Math.cos(sa2), ss = Math.sin(sa2), tc2 = Math.cos(ta2), ts2 = Math.sin(ta2), mr2 = (sr2 + tr2) / 2;
return "M" + sr2 * sc2 + "," + sr2 * ss + "C" + mr2 * sc2 + "," + mr2 * ss + " " + mr2 * tc2 + "," + mr2 * ts2 + " " + tr2 * tc2 + "," + tr2 * ts2;
};
const Paths = fastmap({
"line": line,
"line-radial": lineR,
"arc": arc,
"arc-radial": arcR,
"curve": curve,
"curve-radial": curveR,
"orthogonal-horizontal": orthoX,
"orthogonal-vertical": orthoY,
"orthogonal-radial": orthoR,
"diagonal-horizontal": diagonalX,
"diagonal-vertical": diagonalY,
"diagonal-radial": diagonalR
});
function Pie(params2) {
Transform$1.call(this, null, params2);
}
Pie.Definition = {
"type": "Pie",
"metadata": {
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "startAngle",
"type": "number",
"default": 0
}, {
"name": "endAngle",
"type": "number",
"default": 6.283185307179586
}, {
"name": "sort",
"type": "boolean",
"default": false
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": ["startAngle", "endAngle"]
}]
};
inherits(Pie, Transform$1, {
transform(_24, pulse2) {
var as = _24.as || ["startAngle", "endAngle"], startAngle = as[0], endAngle = as[1], field2 = _24.field || one$2, start2 = _24.startAngle || 0, stop2 = _24.endAngle != null ? _24.endAngle : 2 * Math.PI, data2 = pulse2.source, values2 = data2.map(field2), n2 = values2.length, a2 = start2, k2 = (stop2 - start2) / sum$2(values2), index2 = range$5(n2), i2, t5, v2;
if (_24.sort) {
index2.sort((a3, b2) => values2[a3] - values2[b2]);
}
for (i2 = 0; i2 < n2; ++i2) {
v2 = values2[index2[i2]];
t5 = data2[index2[i2]];
t5[startAngle] = a2;
t5[endAngle] = a2 += v2 * k2;
}
this.value = values2;
return pulse2.reflow(_24.modified()).modifies(as);
}
});
const DEFAULT_COUNT = 5;
function includeZero(scale2) {
const type2 = scale2.type;
return !scale2.bins && (type2 === Linear || type2 === Pow || type2 === Sqrt);
}
function includePad(type2) {
return isContinuous(type2) && type2 !== Sequential;
}
const SKIP$1 = toSet(["set", "modified", "clear", "type", "scheme", "schemeExtent", "schemeCount", "domain", "domainMin", "domainMid", "domainMax", "domainRaw", "domainImplicit", "nice", "zero", "bins", "range", "rangeStep", "round", "reverse", "interpolate", "interpolateGamma"]);
function Scale$2(params2) {
Transform$1.call(this, null, params2);
this.modified(true);
}
inherits(Scale$2, Transform$1, {
transform(_24, pulse2) {
var df2 = pulse2.dataflow, scale$12 = this.value, key2 = scaleKey(_24);
if (!scale$12 || key2 !== scale$12.type) {
this.value = scale$12 = scale$4(key2)();
}
for (key2 in _24)
if (!SKIP$1[key2]) {
if (key2 === "padding" && includePad(scale$12.type))
continue;
isFunction(scale$12[key2]) ? scale$12[key2](_24[key2]) : df2.warn("Unsupported scale property: " + key2);
}
configureRange(scale$12, _24, configureBins(scale$12, _24, configureDomain(scale$12, _24, df2)));
return pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
}
});
function scaleKey(_24) {
var t5 = _24.type, d2 = "", n2;
if (t5 === Sequential)
return Sequential + "-" + Linear;
if (isContinuousColor(_24)) {
n2 = _24.rawDomain ? _24.rawDomain.length : _24.domain ? _24.domain.length + +(_24.domainMid != null) : 0;
d2 = n2 === 2 ? Sequential + "-" : n2 === 3 ? Diverging + "-" : "";
}
return (d2 + t5 || Linear).toLowerCase();
}
function isContinuousColor(_24) {
const t5 = _24.type;
return isContinuous(t5) && t5 !== Time && t5 !== UTC && (_24.scheme || _24.range && _24.range.length && _24.range.every(isString));
}
function configureDomain(scale2, _24, df2) {
const raw = rawDomain(scale2, _24.domainRaw, df2);
if (raw > -1)
return raw;
var domain2 = _24.domain, type2 = scale2.type, zero2 = _24.zero || _24.zero === void 0 && includeZero(scale2), n2, mid;
if (!domain2)
return 0;
if (includePad(type2) && _24.padding && domain2[0] !== peek$1(domain2)) {
domain2 = padDomain(type2, domain2, _24.range, _24.padding, _24.exponent, _24.constant);
}
if (zero2 || _24.domainMin != null || _24.domainMax != null || _24.domainMid != null) {
n2 = (domain2 = domain2.slice()).length - 1 || 1;
if (zero2) {
if (domain2[0] > 0)
domain2[0] = 0;
if (domain2[n2] < 0)
domain2[n2] = 0;
}
if (_24.domainMin != null)
domain2[0] = _24.domainMin;
if (_24.domainMax != null)
domain2[n2] = _24.domainMax;
if (_24.domainMid != null) {
mid = _24.domainMid;
const i2 = mid > domain2[n2] ? n2 + 1 : mid < domain2[0] ? 0 : n2;
if (i2 !== n2)
df2.warn("Scale domainMid exceeds domain min or max.", mid);
domain2.splice(i2, 0, mid);
}
}
scale2.domain(domainCheck(type2, domain2, df2));
if (type2 === Ordinal) {
scale2.unknown(_24.domainImplicit ? implicit : void 0);
}
if (_24.nice && scale2.nice) {
scale2.nice(_24.nice !== true && tickCount(scale2, _24.nice) || null);
}
return domain2.length;
}
function rawDomain(scale2, raw, df2) {
if (raw) {
scale2.domain(domainCheck(scale2.type, raw, df2));
return raw.length;
} else {
return -1;
}
}
function padDomain(type2, domain2, range2, pad2, exponent2, constant2) {
var span2 = Math.abs(peek$1(range2) - range2[0]), frac = span2 / (span2 - 2 * pad2), d2 = type2 === Log ? zoomLog(domain2, null, frac) : type2 === Sqrt ? zoomPow(domain2, null, frac, 0.5) : type2 === Pow ? zoomPow(domain2, null, frac, exponent2 || 1) : type2 === Symlog ? zoomSymlog(domain2, null, frac, constant2 || 1) : zoomLinear(domain2, null, frac);
domain2 = domain2.slice();
domain2[0] = d2[0];
domain2[domain2.length - 1] = d2[1];
return domain2;
}
function domainCheck(type2, domain2, df2) {
if (isLogarithmic(type2)) {
var s2 = Math.abs(domain2.reduce((s3, v2) => s3 + (v2 < 0 ? -1 : v2 > 0 ? 1 : 0), 0));
if (s2 !== domain2.length) {
df2.warn("Log scale domain includes zero: " + $$h(domain2));
}
}
return domain2;
}
function configureBins(scale2, _24, count2) {
let bins = _24.bins;
if (bins && !isArray$2(bins)) {
const domain2 = scale2.domain(), lo2 = domain2[0], hi2 = peek$1(domain2), step = bins.step;
let start2 = bins.start == null ? lo2 : bins.start, stop2 = bins.stop == null ? hi2 : bins.stop;
if (!step)
error2("Scale bins parameter missing step property.");
if (start2 < lo2)
start2 = step * Math.ceil(lo2 / step);
if (stop2 > hi2)
stop2 = step * Math.floor(hi2 / step);
bins = range$5(start2, stop2 + step / 2, step);
}
if (bins) {
scale2.bins = bins;
} else if (scale2.bins) {
delete scale2.bins;
}
if (scale2.type === BinOrdinal) {
if (!bins) {
scale2.bins = scale2.domain();
} else if (!_24.domain && !_24.domainRaw) {
scale2.domain(bins);
count2 = bins.length;
}
}
return count2;
}
function configureRange(scale2, _24, count2) {
var type2 = scale2.type, round2 = _24.round || false, range2 = _24.range;
if (_24.rangeStep != null) {
range2 = configureRangeStep(type2, _24, count2);
} else if (_24.scheme) {
range2 = configureScheme(type2, _24, count2);
if (isFunction(range2)) {
if (scale2.interpolator) {
return scale2.interpolator(range2);
} else {
error2(`Scale type ${type2} does not support interpolating color schemes.`);
}
}
}
if (range2 && isInterpolating(type2)) {
return scale2.interpolator(interpolateColors(flip(range2, _24.reverse), _24.interpolate, _24.interpolateGamma));
}
if (range2 && _24.interpolate && scale2.interpolate) {
scale2.interpolate(interpolate(_24.interpolate, _24.interpolateGamma));
} else if (isFunction(scale2.round)) {
scale2.round(round2);
} else if (isFunction(scale2.rangeRound)) {
scale2.interpolate(round2 ? interpolateRound : interpolate$1);
}
if (range2)
scale2.range(flip(range2, _24.reverse));
}
function configureRangeStep(type2, _24, count2) {
if (type2 !== Band && type2 !== Point$1) {
error2("Only band and point scales support rangeStep.");
}
var outer = (_24.paddingOuter != null ? _24.paddingOuter : _24.padding) || 0, inner = type2 === Point$1 ? 1 : (_24.paddingInner != null ? _24.paddingInner : _24.padding) || 0;
return [0, _24.rangeStep * bandSpace(count2, inner, outer)];
}
function configureScheme(type2, _24, count2) {
var extent2 = _24.schemeExtent, name, scheme$1;
if (isArray$2(_24.scheme)) {
scheme$1 = interpolateColors(_24.scheme, _24.interpolate, _24.interpolateGamma);
} else {
name = _24.scheme.toLowerCase();
scheme$1 = scheme(name);
if (!scheme$1)
error2(`Unrecognized scheme name: ${_24.scheme}`);
}
count2 = type2 === Threshold ? count2 + 1 : type2 === BinOrdinal ? count2 - 1 : type2 === Quantile || type2 === Quantize ? +_24.schemeCount || DEFAULT_COUNT : count2;
return isInterpolating(type2) ? adjustScheme(scheme$1, extent2, _24.reverse) : isFunction(scheme$1) ? quantizeInterpolator(adjustScheme(scheme$1, extent2), count2) : type2 === Ordinal ? scheme$1 : scheme$1.slice(0, count2);
}
function adjustScheme(scheme2, extent2, reverse3) {
return isFunction(scheme2) && (extent2 || reverse3) ? interpolateRange(scheme2, flip(extent2 || [0, 1], reverse3)) : scheme2;
}
function flip(array2, reverse3) {
return reverse3 ? array2.slice().reverse() : array2;
}
function SortItems$1(params2) {
Transform$1.call(this, null, params2);
}
inherits(SortItems$1, Transform$1, {
transform(_24, pulse2) {
const mod = _24.modified("sort") || pulse2.changed(pulse2.ADD) || pulse2.modified(_24.sort.fields) || pulse2.modified("datum");
if (mod)
pulse2.source.sort(stableCompare(_24.sort));
this.modified(mod);
return pulse2;
}
});
const Zero = "zero", Center$1 = "center", Normalize = "normalize", DefOutput = ["y0", "y1"];
function Stack(params2) {
Transform$1.call(this, null, params2);
}
Stack.Definition = {
"type": "Stack",
"metadata": {
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "sort",
"type": "compare"
}, {
"name": "offset",
"type": "enum",
"default": Zero,
"values": [Zero, Center$1, Normalize]
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": DefOutput
}]
};
inherits(Stack, Transform$1, {
transform(_24, pulse2) {
var as = _24.as || DefOutput, y02 = as[0], y12 = as[1], sort2 = stableCompare(_24.sort), field2 = _24.field || one$2, stack = _24.offset === Center$1 ? stackCenter : _24.offset === Normalize ? stackNormalize : stackZero, groups, i2, n2, max2;
groups = partition$3(pulse2.source, _24.groupby, sort2, field2);
for (i2 = 0, n2 = groups.length, max2 = groups.max; i2 < n2; ++i2) {
stack(groups[i2], max2, field2, y02, y12);
}
return pulse2.reflow(_24.modified()).modifies(as);
}
});
function stackCenter(group2, max2, field2, y02, y12) {
var last = (max2 - group2.sum) / 2, m2 = group2.length, j2 = 0, t5;
for (; j2 < m2; ++j2) {
t5 = group2[j2];
t5[y02] = last;
t5[y12] = last += Math.abs(field2(t5));
}
}
function stackNormalize(group2, max2, field2, y02, y12) {
var scale2 = 1 / group2.sum, last = 0, m2 = group2.length, j2 = 0, v2 = 0, t5;
for (; j2 < m2; ++j2) {
t5 = group2[j2];
t5[y02] = last;
t5[y12] = last = scale2 * (v2 += Math.abs(field2(t5)));
}
}
function stackZero(group2, max2, field2, y02, y12) {
var lastPos = 0, lastNeg = 0, m2 = group2.length, j2 = 0, v2, t5;
for (; j2 < m2; ++j2) {
t5 = group2[j2];
v2 = +field2(t5);
if (v2 < 0) {
t5[y02] = lastNeg;
t5[y12] = lastNeg += v2;
} else {
t5[y02] = lastPos;
t5[y12] = lastPos += v2;
}
}
}
function partition$3(data2, groupby, sort2, field2) {
var groups = [], get2 = (f2) => f2(t5), map2, i2, n2, m2, t5, k2, g2, s2, max2;
if (groupby == null) {
groups.push(data2.slice());
} else {
for (map2 = {}, i2 = 0, n2 = data2.length; i2 < n2; ++i2) {
t5 = data2[i2];
k2 = groupby.map(get2);
g2 = map2[k2];
if (!g2) {
map2[k2] = g2 = [];
groups.push(g2);
}
g2.push(t5);
}
}
for (k2 = 0, max2 = 0, m2 = groups.length; k2 < m2; ++k2) {
g2 = groups[k2];
for (i2 = 0, s2 = 0, n2 = g2.length; i2 < n2; ++i2) {
s2 += Math.abs(field2(g2[i2]));
}
g2.sum = s2;
if (s2 > max2)
max2 = s2;
if (sort2)
g2.sort(sort2);
}
groups.max = max2;
return groups;
}
const encode$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
axisticks: AxisTicks$1,
datajoin: DataJoin$1,
encode: Encode$1,
legendentries: LegendEntries$1,
linkpath: LinkPath,
pie: Pie,
scale: Scale$2,
sortitems: SortItems$1,
stack: Stack
}, Symbol.toStringTag, { value: "Module" }));
const e10$1 = Math.sqrt(50), e5$1 = Math.sqrt(10), e2$1 = Math.sqrt(2);
function tickSpec$1(start2, stop2, count2) {
const step = (stop2 - start2) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error3 = step / Math.pow(10, power), factor = error3 >= e10$1 ? 10 : error3 >= e5$1 ? 5 : error3 >= e2$1 ? 2 : 1;
let i1, i2, inc;
if (power < 0) {
inc = Math.pow(10, -power) / factor;
i1 = Math.round(start2 * inc);
i2 = Math.round(stop2 * inc);
if (i1 / inc < start2)
++i1;
if (i2 / inc > stop2)
--i2;
inc = -inc;
} else {
inc = Math.pow(10, power) * factor;
i1 = Math.round(start2 / inc);
i2 = Math.round(stop2 / inc);
if (i1 * inc < start2)
++i1;
if (i2 * inc > stop2)
--i2;
}
if (i2 < i1 && 0.5 <= count2 && count2 < 2)
return tickSpec$1(start2, stop2, count2 * 2);
return [i1, i2, inc];
}
function tickIncrement$1(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
return tickSpec$1(start2, stop2, count2)[2];
}
function tickStep$1(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
const reverse3 = stop2 < start2, inc = reverse3 ? tickIncrement$1(stop2, start2, count2) : tickIncrement$1(start2, stop2, count2);
return (reverse3 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}
function max$4(values2, valueof) {
let max2;
if (valueof === void 0) {
for (const value2 of values2) {
if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
max2 = value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if ((value2 = valueof(value2, ++index2, values2)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
max2 = value2;
}
}
}
return max2;
}
function range$4(start2, stop2, step) {
start2 = +start2, stop2 = +stop2, step = (n2 = arguments.length) < 2 ? (stop2 = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop2 - start2) / step)) | 0, range2 = new Array(n2);
while (++i2 < n2) {
range2[i2] = start2 + i2 * step;
}
return range2;
}
function sum$1(values2, valueof) {
let sum2 = 0;
if (valueof === void 0) {
for (let value2 of values2) {
if (value2 = +value2) {
sum2 += value2;
}
}
} else {
let index2 = -1;
for (let value2 of values2) {
if (value2 = +valueof(value2, ++index2, values2)) {
sum2 += value2;
}
}
}
return sum2;
}
var epsilon$3 = 1e-6;
var epsilon2 = 1e-12;
var pi$2 = Math.PI;
var halfPi$1 = pi$2 / 2;
var quarterPi = pi$2 / 4;
var tau$1 = pi$2 * 2;
var degrees = 180 / pi$2;
var radians = pi$2 / 180;
var abs$1 = Math.abs;
var atan = Math.atan;
var atan2 = Math.atan2;
var cos$1 = Math.cos;
var ceil$1 = Math.ceil;
var exp = Math.exp;
var hypot = Math.hypot;
var log$1 = Math.log;
var pow$1 = Math.pow;
var sin$1 = Math.sin;
var sign = Math.sign || function(x2) {
return x2 > 0 ? 1 : x2 < 0 ? -1 : 0;
};
var sqrt$1 = Math.sqrt;
var tan = Math.tan;
function acos(x2) {
return x2 > 1 ? 0 : x2 < -1 ? pi$2 : Math.acos(x2);
}
function asin$1(x2) {
return x2 > 1 ? halfPi$1 : x2 < -1 ? -halfPi$1 : Math.asin(x2);
}
function noop$4() {
}
function streamGeometry(geometry, stream2) {
if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
streamGeometryType[geometry.type](geometry, stream2);
}
}
var streamObjectType = {
Feature: function(object2, stream2) {
streamGeometry(object2.geometry, stream2);
},
FeatureCollection: function(object2, stream2) {
var features2 = object2.features, i2 = -1, n2 = features2.length;
while (++i2 < n2)
streamGeometry(features2[i2].geometry, stream2);
}
};
var streamGeometryType = {
Sphere: function(object2, stream2) {
stream2.sphere();
},
Point: function(object2, stream2) {
object2 = object2.coordinates;
stream2.point(object2[0], object2[1], object2[2]);
},
MultiPoint: function(object2, stream2) {
var coordinates = object2.coordinates, i2 = -1, n2 = coordinates.length;
while (++i2 < n2)
object2 = coordinates[i2], stream2.point(object2[0], object2[1], object2[2]);
},
LineString: function(object2, stream2) {
streamLine(object2.coordinates, stream2, 0);
},
MultiLineString: function(object2, stream2) {
var coordinates = object2.coordinates, i2 = -1, n2 = coordinates.length;
while (++i2 < n2)
streamLine(coordinates[i2], stream2, 0);
},
Polygon: function(object2, stream2) {
streamPolygon(object2.coordinates, stream2);
},
MultiPolygon: function(object2, stream2) {
var coordinates = object2.coordinates, i2 = -1, n2 = coordinates.length;
while (++i2 < n2)
streamPolygon(coordinates[i2], stream2);
},
GeometryCollection: function(object2, stream2) {
var geometries = object2.geometries, i2 = -1, n2 = geometries.length;
while (++i2 < n2)
streamGeometry(geometries[i2], stream2);
}
};
function streamLine(coordinates, stream2, closed) {
var i2 = -1, n2 = coordinates.length - closed, coordinate;
stream2.lineStart();
while (++i2 < n2)
coordinate = coordinates[i2], stream2.point(coordinate[0], coordinate[1], coordinate[2]);
stream2.lineEnd();
}
function streamPolygon(coordinates, stream2) {
var i2 = -1, n2 = coordinates.length;
stream2.polygonStart();
while (++i2 < n2)
streamLine(coordinates[i2], stream2, 1);
stream2.polygonEnd();
}
function geoStream(object2, stream2) {
if (object2 && streamObjectType.hasOwnProperty(object2.type)) {
streamObjectType[object2.type](object2, stream2);
} else {
streamGeometry(object2, stream2);
}
}
var areaRingSum$1 = new Adder();
var areaSum$1 = new Adder(), lambda00$2, phi00$2, lambda0$1, cosPhi0, sinPhi0;
var areaStream$1 = {
point: noop$4,
lineStart: noop$4,
lineEnd: noop$4,
polygonStart: function() {
areaRingSum$1 = new Adder();
areaStream$1.lineStart = areaRingStart$1;
areaStream$1.lineEnd = areaRingEnd$1;
},
polygonEnd: function() {
var areaRing = +areaRingSum$1;
areaSum$1.add(areaRing < 0 ? tau$1 + areaRing : areaRing);
this.lineStart = this.lineEnd = this.point = noop$4;
},
sphere: function() {
areaSum$1.add(tau$1);
}
};
function areaRingStart$1() {
areaStream$1.point = areaPointFirst$1;
}
function areaRingEnd$1() {
areaPoint$1(lambda00$2, phi00$2);
}
function areaPointFirst$1(lambda, phi2) {
areaStream$1.point = areaPoint$1;
lambda00$2 = lambda, phi00$2 = phi2;
lambda *= radians, phi2 *= radians;
lambda0$1 = lambda, cosPhi0 = cos$1(phi2 = phi2 / 2 + quarterPi), sinPhi0 = sin$1(phi2);
}
function areaPoint$1(lambda, phi2) {
lambda *= radians, phi2 *= radians;
phi2 = phi2 / 2 + quarterPi;
var dLambda = lambda - lambda0$1, sdLambda = dLambda >= 0 ? 1 : -1, adLambda = sdLambda * dLambda, cosPhi = cos$1(phi2), sinPhi = sin$1(phi2), k2 = sinPhi0 * sinPhi, u2 = cosPhi0 * cosPhi + k2 * cos$1(adLambda), v2 = k2 * sdLambda * sin$1(adLambda);
areaRingSum$1.add(atan2(v2, u2));
lambda0$1 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
}
function geoArea$1(object2) {
areaSum$1 = new Adder();
geoStream(object2, areaStream$1);
return areaSum$1 * 2;
}
function spherical(cartesian2) {
return [atan2(cartesian2[1], cartesian2[0]), asin$1(cartesian2[2])];
}
function cartesian(spherical2) {
var lambda = spherical2[0], phi2 = spherical2[1], cosPhi = cos$1(phi2);
return [cosPhi * cos$1(lambda), cosPhi * sin$1(lambda), sin$1(phi2)];
}
function cartesianDot(a2, b2) {
return a2[0] * b2[0] + a2[1] * b2[1] + a2[2] * b2[2];
}
function cartesianCross(a2, b2) {
return [a2[1] * b2[2] - a2[2] * b2[1], a2[2] * b2[0] - a2[0] * b2[2], a2[0] * b2[1] - a2[1] * b2[0]];
}
function cartesianAddInPlace(a2, b2) {
a2[0] += b2[0], a2[1] += b2[1], a2[2] += b2[2];
}
function cartesianScale(vector, k2) {
return [vector[0] * k2, vector[1] * k2, vector[2] * k2];
}
function cartesianNormalizeInPlace(d2) {
var l2 = sqrt$1(d2[0] * d2[0] + d2[1] * d2[1] + d2[2] * d2[2]);
d2[0] /= l2, d2[1] /= l2, d2[2] /= l2;
}
var lambda0, phi0, lambda1, phi1, lambda2, lambda00$1, phi00$1, p0, deltaSum, ranges, range$3;
var boundsStream$2 = {
point: boundsPoint$1,
lineStart: boundsLineStart,
lineEnd: boundsLineEnd,
polygonStart: function() {
boundsStream$2.point = boundsRingPoint;
boundsStream$2.lineStart = boundsRingStart;
boundsStream$2.lineEnd = boundsRingEnd;
deltaSum = new Adder();
areaStream$1.polygonStart();
},
polygonEnd: function() {
areaStream$1.polygonEnd();
boundsStream$2.point = boundsPoint$1;
boundsStream$2.lineStart = boundsLineStart;
boundsStream$2.lineEnd = boundsLineEnd;
if (areaRingSum$1 < 0)
lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
else if (deltaSum > epsilon$3)
phi1 = 90;
else if (deltaSum < -epsilon$3)
phi0 = -90;
range$3[0] = lambda0, range$3[1] = lambda1;
},
sphere: function() {
lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
}
};
function boundsPoint$1(lambda, phi2) {
ranges.push(range$3 = [lambda0 = lambda, lambda1 = lambda]);
if (phi2 < phi0)
phi0 = phi2;
if (phi2 > phi1)
phi1 = phi2;
}
function linePoint(lambda, phi2) {
var p2 = cartesian([lambda * radians, phi2 * radians]);
if (p0) {
var normal = cartesianCross(p0, p2), equatorial = [normal[1], -normal[0], 0], inflection = cartesianCross(equatorial, normal);
cartesianNormalizeInPlace(inflection);
inflection = spherical(inflection);
var delta = lambda - lambda2, sign2 = delta > 0 ? 1 : -1, lambdai = inflection[0] * degrees * sign2, phii, antimeridian = abs$1(delta) > 180;
if (antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
phii = inflection[1] * degrees;
if (phii > phi1)
phi1 = phii;
} else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
phii = -inflection[1] * degrees;
if (phii < phi0)
phi0 = phii;
} else {
if (phi2 < phi0)
phi0 = phi2;
if (phi2 > phi1)
phi1 = phi2;
}
if (antimeridian) {
if (lambda < lambda2) {
if (angle$1(lambda0, lambda) > angle$1(lambda0, lambda1))
lambda1 = lambda;
} else {
if (angle$1(lambda, lambda1) > angle$1(lambda0, lambda1))
lambda0 = lambda;
}
} else {
if (lambda1 >= lambda0) {
if (lambda < lambda0)
lambda0 = lambda;
if (lambda > lambda1)
lambda1 = lambda;
} else {
if (lambda > lambda2) {
if (angle$1(lambda0, lambda) > angle$1(lambda0, lambda1))
lambda1 = lambda;
} else {
if (angle$1(lambda, lambda1) > angle$1(lambda0, lambda1))
lambda0 = lambda;
}
}
}
} else {
ranges.push(range$3 = [lambda0 = lambda, lambda1 = lambda]);
}
if (phi2 < phi0)
phi0 = phi2;
if (phi2 > phi1)
phi1 = phi2;
p0 = p2, lambda2 = lambda;
}
function boundsLineStart() {
boundsStream$2.point = linePoint;
}
function boundsLineEnd() {
range$3[0] = lambda0, range$3[1] = lambda1;
boundsStream$2.point = boundsPoint$1;
p0 = null;
}
function boundsRingPoint(lambda, phi2) {
if (p0) {
var delta = lambda - lambda2;
deltaSum.add(abs$1(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
} else {
lambda00$1 = lambda, phi00$1 = phi2;
}
areaStream$1.point(lambda, phi2);
linePoint(lambda, phi2);
}
function boundsRingStart() {
areaStream$1.lineStart();
}
function boundsRingEnd() {
boundsRingPoint(lambda00$1, phi00$1);
areaStream$1.lineEnd();
if (abs$1(deltaSum) > epsilon$3)
lambda0 = -(lambda1 = 180);
range$3[0] = lambda0, range$3[1] = lambda1;
p0 = null;
}
function angle$1(lambda02, lambda12) {
return (lambda12 -= lambda02) < 0 ? lambda12 + 360 : lambda12;
}
function rangeCompare(a2, b2) {
return a2[0] - b2[0];
}
function rangeContains(range2, x2) {
return range2[0] <= range2[1] ? range2[0] <= x2 && x2 <= range2[1] : x2 < range2[0] || range2[1] < x2;
}
function geoBounds$1(feature2) {
var i2, n2, a2, b2, merged, deltaMax, delta;
phi1 = lambda1 = -(lambda0 = phi0 = Infinity);
ranges = [];
geoStream(feature2, boundsStream$2);
if (n2 = ranges.length) {
ranges.sort(rangeCompare);
for (i2 = 1, a2 = ranges[0], merged = [a2]; i2 < n2; ++i2) {
b2 = ranges[i2];
if (rangeContains(a2, b2[0]) || rangeContains(a2, b2[1])) {
if (angle$1(a2[0], b2[1]) > angle$1(a2[0], a2[1]))
a2[1] = b2[1];
if (angle$1(b2[0], a2[1]) > angle$1(a2[0], a2[1]))
a2[0] = b2[0];
} else {
merged.push(a2 = b2);
}
}
for (deltaMax = -Infinity, n2 = merged.length - 1, i2 = 0, a2 = merged[n2]; i2 <= n2; a2 = b2, ++i2) {
b2 = merged[i2];
if ((delta = angle$1(a2[1], b2[0])) > deltaMax)
deltaMax = delta, lambda0 = b2[0], lambda1 = a2[1];
}
}
ranges = range$3 = null;
return lambda0 === Infinity || phi0 === Infinity ? [[NaN, NaN], [NaN, NaN]] : [[lambda0, phi0], [lambda1, phi1]];
}
var W0, W1, X0$1, Y0$1, Z0$1, X1$1, Y1$1, Z1$1, X2$1, Y2$1, Z2$1, lambda00, phi00, x0$4, y0$4, z0;
var centroidStream$1 = {
sphere: noop$4,
point: centroidPoint$1,
lineStart: centroidLineStart$1,
lineEnd: centroidLineEnd$1,
polygonStart: function() {
centroidStream$1.lineStart = centroidRingStart$1;
centroidStream$1.lineEnd = centroidRingEnd$1;
},
polygonEnd: function() {
centroidStream$1.lineStart = centroidLineStart$1;
centroidStream$1.lineEnd = centroidLineEnd$1;
}
};
function centroidPoint$1(lambda, phi2) {
lambda *= radians, phi2 *= radians;
var cosPhi = cos$1(phi2);
centroidPointCartesian(cosPhi * cos$1(lambda), cosPhi * sin$1(lambda), sin$1(phi2));
}
function centroidPointCartesian(x2, y2, z2) {
++W0;
X0$1 += (x2 - X0$1) / W0;
Y0$1 += (y2 - Y0$1) / W0;
Z0$1 += (z2 - Z0$1) / W0;
}
function centroidLineStart$1() {
centroidStream$1.point = centroidLinePointFirst;
}
function centroidLinePointFirst(lambda, phi2) {
lambda *= radians, phi2 *= radians;
var cosPhi = cos$1(phi2);
x0$4 = cosPhi * cos$1(lambda);
y0$4 = cosPhi * sin$1(lambda);
z0 = sin$1(phi2);
centroidStream$1.point = centroidLinePoint;
centroidPointCartesian(x0$4, y0$4, z0);
}
function centroidLinePoint(lambda, phi2) {
lambda *= radians, phi2 *= radians;
var cosPhi = cos$1(phi2), x2 = cosPhi * cos$1(lambda), y2 = cosPhi * sin$1(lambda), z2 = sin$1(phi2), w2 = atan2(sqrt$1((w2 = y0$4 * z2 - z0 * y2) * w2 + (w2 = z0 * x2 - x0$4 * z2) * w2 + (w2 = x0$4 * y2 - y0$4 * x2) * w2), x0$4 * x2 + y0$4 * y2 + z0 * z2);
W1 += w2;
X1$1 += w2 * (x0$4 + (x0$4 = x2));
Y1$1 += w2 * (y0$4 + (y0$4 = y2));
Z1$1 += w2 * (z0 + (z0 = z2));
centroidPointCartesian(x0$4, y0$4, z0);
}
function centroidLineEnd$1() {
centroidStream$1.point = centroidPoint$1;
}
function centroidRingStart$1() {
centroidStream$1.point = centroidRingPointFirst;
}
function centroidRingEnd$1() {
centroidRingPoint(lambda00, phi00);
centroidStream$1.point = centroidPoint$1;
}
function centroidRingPointFirst(lambda, phi2) {
lambda00 = lambda, phi00 = phi2;
lambda *= radians, phi2 *= radians;
centroidStream$1.point = centroidRingPoint;
var cosPhi = cos$1(phi2);
x0$4 = cosPhi * cos$1(lambda);
y0$4 = cosPhi * sin$1(lambda);
z0 = sin$1(phi2);
centroidPointCartesian(x0$4, y0$4, z0);
}
function centroidRingPoint(lambda, phi2) {
lambda *= radians, phi2 *= radians;
var cosPhi = cos$1(phi2), x2 = cosPhi * cos$1(lambda), y2 = cosPhi * sin$1(lambda), z2 = sin$1(phi2), cx = y0$4 * z2 - z0 * y2, cy = z0 * x2 - x0$4 * z2, cz = x0$4 * y2 - y0$4 * x2, m2 = hypot(cx, cy, cz), w2 = asin$1(m2), v2 = m2 && -w2 / m2;
X2$1.add(v2 * cx);
Y2$1.add(v2 * cy);
Z2$1.add(v2 * cz);
W1 += w2;
X1$1 += w2 * (x0$4 + (x0$4 = x2));
Y1$1 += w2 * (y0$4 + (y0$4 = y2));
Z1$1 += w2 * (z0 + (z0 = z2));
centroidPointCartesian(x0$4, y0$4, z0);
}
function geoCentroid$1(object2) {
W0 = W1 = X0$1 = Y0$1 = Z0$1 = X1$1 = Y1$1 = Z1$1 = 0;
X2$1 = new Adder();
Y2$1 = new Adder();
Z2$1 = new Adder();
geoStream(object2, centroidStream$1);
var x2 = +X2$1, y2 = +Y2$1, z2 = +Z2$1, m2 = hypot(x2, y2, z2);
if (m2 < epsilon2) {
x2 = X1$1, y2 = Y1$1, z2 = Z1$1;
if (W1 < epsilon$3)
x2 = X0$1, y2 = Y0$1, z2 = Z0$1;
m2 = hypot(x2, y2, z2);
if (m2 < epsilon2)
return [NaN, NaN];
}
return [atan2(y2, x2) * degrees, asin$1(z2 / m2) * degrees];
}
function compose(a2, b2) {
function compose2(x2, y2) {
return x2 = a2(x2, y2), b2(x2[0], x2[1]);
}
if (a2.invert && b2.invert)
compose2.invert = function(x2, y2) {
return x2 = b2.invert(x2, y2), x2 && a2.invert(x2[0], x2[1]);
};
return compose2;
}
function rotationIdentity(lambda, phi2) {
if (abs$1(lambda) > pi$2)
lambda -= Math.round(lambda / tau$1) * tau$1;
return [lambda, phi2];
}
rotationIdentity.invert = rotationIdentity;
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
return (deltaLambda %= tau$1) ? deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
}
function forwardRotationLambda(deltaLambda) {
return function(lambda, phi2) {
lambda += deltaLambda;
if (abs$1(lambda) > pi$2)
lambda -= Math.round(lambda / tau$1) * tau$1;
return [lambda, phi2];
};
}
function rotationLambda(deltaLambda) {
var rotation2 = forwardRotationLambda(deltaLambda);
rotation2.invert = forwardRotationLambda(-deltaLambda);
return rotation2;
}
function rotationPhiGamma(deltaPhi, deltaGamma) {
var cosDeltaPhi = cos$1(deltaPhi), sinDeltaPhi = sin$1(deltaPhi), cosDeltaGamma = cos$1(deltaGamma), sinDeltaGamma = sin$1(deltaGamma);
function rotation2(lambda, phi2) {
var cosPhi = cos$1(phi2), x2 = cos$1(lambda) * cosPhi, y2 = sin$1(lambda) * cosPhi, z2 = sin$1(phi2), k2 = z2 * cosDeltaPhi + x2 * sinDeltaPhi;
return [
atan2(y2 * cosDeltaGamma - k2 * sinDeltaGamma, x2 * cosDeltaPhi - z2 * sinDeltaPhi),
asin$1(k2 * cosDeltaGamma + y2 * sinDeltaGamma)
];
}
rotation2.invert = function(lambda, phi2) {
var cosPhi = cos$1(phi2), x2 = cos$1(lambda) * cosPhi, y2 = sin$1(lambda) * cosPhi, z2 = sin$1(phi2), k2 = z2 * cosDeltaGamma - y2 * sinDeltaGamma;
return [
atan2(y2 * cosDeltaGamma + z2 * sinDeltaGamma, x2 * cosDeltaPhi + k2 * sinDeltaPhi),
asin$1(k2 * cosDeltaPhi - x2 * sinDeltaPhi)
];
};
return rotation2;
}
function rotation(rotate2) {
rotate2 = rotateRadians(rotate2[0] * radians, rotate2[1] * radians, rotate2.length > 2 ? rotate2[2] * radians : 0);
function forward(coordinates) {
coordinates = rotate2(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
}
forward.invert = function(coordinates) {
coordinates = rotate2.invert(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
};
return forward;
}
function circleStream(stream2, radius2, delta, direction2, t02, t12) {
if (!delta)
return;
var cosRadius = cos$1(radius2), sinRadius = sin$1(radius2), step = direction2 * delta;
if (t02 == null) {
t02 = radius2 + direction2 * tau$1;
t12 = radius2 - step / 2;
} else {
t02 = circleRadius(cosRadius, t02);
t12 = circleRadius(cosRadius, t12);
if (direction2 > 0 ? t02 < t12 : t02 > t12)
t02 += direction2 * tau$1;
}
for (var point2, t5 = t02; direction2 > 0 ? t5 > t12 : t5 < t12; t5 -= step) {
point2 = spherical([cosRadius, -sinRadius * cos$1(t5), -sinRadius * sin$1(t5)]);
stream2.point(point2[0], point2[1]);
}
}
function circleRadius(cosRadius, point2) {
point2 = cartesian(point2), point2[0] -= cosRadius;
cartesianNormalizeInPlace(point2);
var radius2 = acos(-point2[1]);
return ((-point2[2] < 0 ? -radius2 : radius2) + tau$1 - epsilon$3) % tau$1;
}
function clipBuffer() {
var lines = [], line2;
return {
point: function(x2, y2, m2) {
line2.push([x2, y2, m2]);
},
lineStart: function() {
lines.push(line2 = []);
},
lineEnd: noop$4,
rejoin: function() {
if (lines.length > 1)
lines.push(lines.pop().concat(lines.shift()));
},
result: function() {
var result = lines;
lines = [];
line2 = null;
return result;
}
};
}
function pointEqual(a2, b2) {
return abs$1(a2[0] - b2[0]) < epsilon$3 && abs$1(a2[1] - b2[1]) < epsilon$3;
}
function Intersection(point2, points2, other, entry2) {
this.x = point2;
this.z = points2;
this.o = other;
this.e = entry2;
this.v = false;
this.n = this.p = null;
}
function clipRejoin(segments2, compareIntersection2, startInside, interpolate2, stream2) {
var subject = [], clip2 = [], i2, n2;
segments2.forEach(function(segment) {
if ((n3 = segment.length - 1) <= 0)
return;
var n3, p02 = segment[0], p1 = segment[n3], x2;
if (pointEqual(p02, p1)) {
if (!p02[2] && !p1[2]) {
stream2.lineStart();
for (i2 = 0; i2 < n3; ++i2)
stream2.point((p02 = segment[i2])[0], p02[1]);
stream2.lineEnd();
return;
}
p1[0] += 2 * epsilon$3;
}
subject.push(x2 = new Intersection(p02, segment, null, true));
clip2.push(x2.o = new Intersection(p02, null, x2, false));
subject.push(x2 = new Intersection(p1, segment, null, false));
clip2.push(x2.o = new Intersection(p1, null, x2, true));
});
if (!subject.length)
return;
clip2.sort(compareIntersection2);
link(subject);
link(clip2);
for (i2 = 0, n2 = clip2.length; i2 < n2; ++i2) {
clip2[i2].e = startInside = !startInside;
}
var start2 = subject[0], points2, point2;
while (1) {
var current = start2, isSubject = true;
while (current.v)
if ((current = current.n) === start2)
return;
points2 = current.z;
stream2.lineStart();
do {
current.v = current.o.v = true;
if (current.e) {
if (isSubject) {
for (i2 = 0, n2 = points2.length; i2 < n2; ++i2)
stream2.point((point2 = points2[i2])[0], point2[1]);
} else {
interpolate2(current.x, current.n.x, 1, stream2);
}
current = current.n;
} else {
if (isSubject) {
points2 = current.p.z;
for (i2 = points2.length - 1; i2 >= 0; --i2)
stream2.point((point2 = points2[i2])[0], point2[1]);
} else {
interpolate2(current.x, current.p.x, -1, stream2);
}
current = current.p;
}
current = current.o;
points2 = current.z;
isSubject = !isSubject;
} while (!current.v);
stream2.lineEnd();
}
}
function link(array2) {
if (!(n2 = array2.length))
return;
var n2, i2 = 0, a2 = array2[0], b2;
while (++i2 < n2) {
a2.n = b2 = array2[i2];
b2.p = a2;
a2 = b2;
}
a2.n = b2 = array2[0];
b2.p = a2;
}
function longitude(point2) {
return abs$1(point2[0]) <= pi$2 ? point2[0] : sign(point2[0]) * ((abs$1(point2[0]) + pi$2) % tau$1 - pi$2);
}
function polygonContains(polygon, point2) {
var lambda = longitude(point2), phi2 = point2[1], sinPhi = sin$1(phi2), normal = [sin$1(lambda), -cos$1(lambda), 0], angle2 = 0, winding = 0;
var sum2 = new Adder();
if (sinPhi === 1)
phi2 = halfPi$1 + epsilon$3;
else if (sinPhi === -1)
phi2 = -halfPi$1 - epsilon$3;
for (var i2 = 0, n2 = polygon.length; i2 < n2; ++i2) {
if (!(m2 = (ring = polygon[i2]).length))
continue;
var ring, m2, point0 = ring[m2 - 1], lambda02 = longitude(point0), phi02 = point0[1] / 2 + quarterPi, sinPhi02 = sin$1(phi02), cosPhi02 = cos$1(phi02);
for (var j2 = 0; j2 < m2; ++j2, lambda02 = lambda12, sinPhi02 = sinPhi1, cosPhi02 = cosPhi1, point0 = point1) {
var point1 = ring[j2], lambda12 = longitude(point1), phi12 = point1[1] / 2 + quarterPi, sinPhi1 = sin$1(phi12), cosPhi1 = cos$1(phi12), delta = lambda12 - lambda02, sign2 = delta >= 0 ? 1 : -1, absDelta = sign2 * delta, antimeridian = absDelta > pi$2, k2 = sinPhi02 * sinPhi1;
sum2.add(atan2(k2 * sign2 * sin$1(absDelta), cosPhi02 * cosPhi1 + k2 * cos$1(absDelta)));
angle2 += antimeridian ? delta + sign2 * tau$1 : delta;
if (antimeridian ^ lambda02 >= lambda ^ lambda12 >= lambda) {
var arc2 = cartesianCross(cartesian(point0), cartesian(point1));
cartesianNormalizeInPlace(arc2);
var intersection2 = cartesianCross(normal, arc2);
cartesianNormalizeInPlace(intersection2);
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin$1(intersection2[2]);
if (phi2 > phiArc || phi2 === phiArc && (arc2[0] || arc2[1])) {
winding += antimeridian ^ delta >= 0 ? 1 : -1;
}
}
}
}
return (angle2 < -epsilon$3 || angle2 < epsilon$3 && sum2 < -epsilon2) ^ winding & 1;
}
function clip$1(pointVisible, clipLine2, interpolate2, start2) {
return function(sink) {
var line2 = clipLine2(sink), ringBuffer = clipBuffer(), ringSink = clipLine2(ringBuffer), polygonStarted = false, polygon, segments2, ring;
var clip2 = {
point: point2,
lineStart,
lineEnd,
polygonStart: function() {
clip2.point = pointRing;
clip2.lineStart = ringStart;
clip2.lineEnd = ringEnd;
segments2 = [];
polygon = [];
},
polygonEnd: function() {
clip2.point = point2;
clip2.lineStart = lineStart;
clip2.lineEnd = lineEnd;
segments2 = merge$2(segments2);
var startInside = polygonContains(polygon, start2);
if (segments2.length) {
if (!polygonStarted)
sink.polygonStart(), polygonStarted = true;
clipRejoin(segments2, compareIntersection, startInside, interpolate2, sink);
} else if (startInside) {
if (!polygonStarted)
sink.polygonStart(), polygonStarted = true;
sink.lineStart();
interpolate2(null, null, 1, sink);
sink.lineEnd();
}
if (polygonStarted)
sink.polygonEnd(), polygonStarted = false;
segments2 = polygon = null;
},
sphere: function() {
sink.polygonStart();
sink.lineStart();
interpolate2(null, null, 1, sink);
sink.lineEnd();
sink.polygonEnd();
}
};
function point2(lambda, phi2) {
if (pointVisible(lambda, phi2))
sink.point(lambda, phi2);
}
function pointLine(lambda, phi2) {
line2.point(lambda, phi2);
}
function lineStart() {
clip2.point = pointLine;
line2.lineStart();
}
function lineEnd() {
clip2.point = point2;
line2.lineEnd();
}
function pointRing(lambda, phi2) {
ring.push([lambda, phi2]);
ringSink.point(lambda, phi2);
}
function ringStart() {
ringSink.lineStart();
ring = [];
}
function ringEnd() {
pointRing(ring[0][0], ring[0][1]);
ringSink.lineEnd();
var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i2, n2 = ringSegments.length, m2, segment, point3;
ring.pop();
polygon.push(ring);
ring = null;
if (!n2)
return;
if (clean & 1) {
segment = ringSegments[0];
if ((m2 = segment.length - 1) > 0) {
if (!polygonStarted)
sink.polygonStart(), polygonStarted = true;
sink.lineStart();
for (i2 = 0; i2 < m2; ++i2)
sink.point((point3 = segment[i2])[0], point3[1]);
sink.lineEnd();
}
return;
}
if (n2 > 1 && clean & 2)
ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
segments2.push(ringSegments.filter(validSegment));
}
return clip2;
};
}
function validSegment(segment) {
return segment.length > 1;
}
function compareIntersection(a2, b2) {
return ((a2 = a2.x)[0] < 0 ? a2[1] - halfPi$1 - epsilon$3 : halfPi$1 - a2[1]) - ((b2 = b2.x)[0] < 0 ? b2[1] - halfPi$1 - epsilon$3 : halfPi$1 - b2[1]);
}
const clipAntimeridian = clip$1(
function() {
return true;
},
clipAntimeridianLine,
clipAntimeridianInterpolate,
[-pi$2, -halfPi$1]
);
function clipAntimeridianLine(stream2) {
var lambda02 = NaN, phi02 = NaN, sign0 = NaN, clean;
return {
lineStart: function() {
stream2.lineStart();
clean = 1;
},
point: function(lambda12, phi12) {
var sign1 = lambda12 > 0 ? pi$2 : -pi$2, delta = abs$1(lambda12 - lambda02);
if (abs$1(delta - pi$2) < epsilon$3) {
stream2.point(lambda02, phi02 = (phi02 + phi12) / 2 > 0 ? halfPi$1 : -halfPi$1);
stream2.point(sign0, phi02);
stream2.lineEnd();
stream2.lineStart();
stream2.point(sign1, phi02);
stream2.point(lambda12, phi02);
clean = 0;
} else if (sign0 !== sign1 && delta >= pi$2) {
if (abs$1(lambda02 - sign0) < epsilon$3)
lambda02 -= sign0 * epsilon$3;
if (abs$1(lambda12 - sign1) < epsilon$3)
lambda12 -= sign1 * epsilon$3;
phi02 = clipAntimeridianIntersect(lambda02, phi02, lambda12, phi12);
stream2.point(sign0, phi02);
stream2.lineEnd();
stream2.lineStart();
stream2.point(sign1, phi02);
clean = 0;
}
stream2.point(lambda02 = lambda12, phi02 = phi12);
sign0 = sign1;
},
lineEnd: function() {
stream2.lineEnd();
lambda02 = phi02 = NaN;
},
clean: function() {
return 2 - clean;
}
};
}
function clipAntimeridianIntersect(lambda02, phi02, lambda12, phi12) {
var cosPhi02, cosPhi1, sinLambda0Lambda1 = sin$1(lambda02 - lambda12);
return abs$1(sinLambda0Lambda1) > epsilon$3 ? atan((sin$1(phi02) * (cosPhi1 = cos$1(phi12)) * sin$1(lambda12) - sin$1(phi12) * (cosPhi02 = cos$1(phi02)) * sin$1(lambda02)) / (cosPhi02 * cosPhi1 * sinLambda0Lambda1)) : (phi02 + phi12) / 2;
}
function clipAntimeridianInterpolate(from2, to2, direction2, stream2) {
var phi2;
if (from2 == null) {
phi2 = direction2 * halfPi$1;
stream2.point(-pi$2, phi2);
stream2.point(0, phi2);
stream2.point(pi$2, phi2);
stream2.point(pi$2, 0);
stream2.point(pi$2, -phi2);
stream2.point(0, -phi2);
stream2.point(-pi$2, -phi2);
stream2.point(-pi$2, 0);
stream2.point(-pi$2, phi2);
} else if (abs$1(from2[0] - to2[0]) > epsilon$3) {
var lambda = from2[0] < to2[0] ? pi$2 : -pi$2;
phi2 = direction2 * lambda / 2;
stream2.point(-lambda, phi2);
stream2.point(0, phi2);
stream2.point(lambda, phi2);
} else {
stream2.point(to2[0], to2[1]);
}
}
function clipCircle(radius2) {
var cr2 = cos$1(radius2), delta = 6 * radians, smallRadius = cr2 > 0, notHemisphere = abs$1(cr2) > epsilon$3;
function interpolate2(from2, to2, direction2, stream2) {
circleStream(stream2, radius2, delta, direction2, from2, to2);
}
function visible(lambda, phi2) {
return cos$1(lambda) * cos$1(phi2) > cr2;
}
function clipLine2(stream2) {
var point0, c0, v0, v00, clean;
return {
lineStart: function() {
v00 = v0 = false;
clean = 1;
},
point: function(lambda, phi2) {
var point1 = [lambda, phi2], point2, v2 = visible(lambda, phi2), c2 = smallRadius ? v2 ? 0 : code(lambda, phi2) : v2 ? code(lambda + (lambda < 0 ? pi$2 : -pi$2), phi2) : 0;
if (!point0 && (v00 = v0 = v2))
stream2.lineStart();
if (v2 !== v0) {
point2 = intersect2(point0, point1);
if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))
point1[2] = 1;
}
if (v2 !== v0) {
clean = 0;
if (v2) {
stream2.lineStart();
point2 = intersect2(point1, point0);
stream2.point(point2[0], point2[1]);
} else {
point2 = intersect2(point0, point1);
stream2.point(point2[0], point2[1], 2);
stream2.lineEnd();
}
point0 = point2;
} else if (notHemisphere && point0 && smallRadius ^ v2) {
var t5;
if (!(c2 & c0) && (t5 = intersect2(point1, point0, true))) {
clean = 0;
if (smallRadius) {
stream2.lineStart();
stream2.point(t5[0][0], t5[0][1]);
stream2.point(t5[1][0], t5[1][1]);
stream2.lineEnd();
} else {
stream2.point(t5[1][0], t5[1][1]);
stream2.lineEnd();
stream2.lineStart();
stream2.point(t5[0][0], t5[0][1], 3);
}
}
}
if (v2 && (!point0 || !pointEqual(point0, point1))) {
stream2.point(point1[0], point1[1]);
}
point0 = point1, v0 = v2, c0 = c2;
},
lineEnd: function() {
if (v0)
stream2.lineEnd();
point0 = null;
},
// Rejoin first and last segments if there were intersections and the first
// and last points were visible.
clean: function() {
return clean | (v00 && v0) << 1;
}
};
}
function intersect2(a2, b2, two) {
var pa2 = cartesian(a2), pb2 = cartesian(b2);
var n1 = [1, 0, 0], n2 = cartesianCross(pa2, pb2), n2n2 = cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
if (!determinant)
return !two && a2;
var c1 = cr2 * n2n2 / determinant, c2 = -cr2 * n1n2 / determinant, n1xn2 = cartesianCross(n1, n2), A5 = cartesianScale(n1, c1), B3 = cartesianScale(n2, c2);
cartesianAddInPlace(A5, B3);
var u2 = n1xn2, w2 = cartesianDot(A5, u2), uu2 = cartesianDot(u2, u2), t22 = w2 * w2 - uu2 * (cartesianDot(A5, A5) - 1);
if (t22 < 0)
return;
var t5 = sqrt$1(t22), q2 = cartesianScale(u2, (-w2 - t5) / uu2);
cartesianAddInPlace(q2, A5);
q2 = spherical(q2);
if (!two)
return q2;
var lambda02 = a2[0], lambda12 = b2[0], phi02 = a2[1], phi12 = b2[1], z2;
if (lambda12 < lambda02)
z2 = lambda02, lambda02 = lambda12, lambda12 = z2;
var delta2 = lambda12 - lambda02, polar = abs$1(delta2 - pi$2) < epsilon$3, meridian = polar || delta2 < epsilon$3;
if (!polar && phi12 < phi02)
z2 = phi02, phi02 = phi12, phi12 = z2;
if (meridian ? polar ? phi02 + phi12 > 0 ^ q2[1] < (abs$1(q2[0] - lambda02) < epsilon$3 ? phi02 : phi12) : phi02 <= q2[1] && q2[1] <= phi12 : delta2 > pi$2 ^ (lambda02 <= q2[0] && q2[0] <= lambda12)) {
var q1 = cartesianScale(u2, (-w2 + t5) / uu2);
cartesianAddInPlace(q1, A5);
return [q2, spherical(q1)];
}
}
function code(lambda, phi2) {
var r2 = smallRadius ? radius2 : pi$2 - radius2, code2 = 0;
if (lambda < -r2)
code2 |= 1;
else if (lambda > r2)
code2 |= 2;
if (phi2 < -r2)
code2 |= 4;
else if (phi2 > r2)
code2 |= 8;
return code2;
}
return clip$1(visible, clipLine2, interpolate2, smallRadius ? [0, -radius2] : [-pi$2, radius2 - pi$2]);
}
function clipLine(a2, b2, x02, y02, x12, y12) {
var ax = a2[0], ay = a2[1], bx = b2[0], by = b2[1], t02 = 0, t12 = 1, dx = bx - ax, dy = by - ay, r2;
r2 = x02 - ax;
if (!dx && r2 > 0)
return;
r2 /= dx;
if (dx < 0) {
if (r2 < t02)
return;
if (r2 < t12)
t12 = r2;
} else if (dx > 0) {
if (r2 > t12)
return;
if (r2 > t02)
t02 = r2;
}
r2 = x12 - ax;
if (!dx && r2 < 0)
return;
r2 /= dx;
if (dx < 0) {
if (r2 > t12)
return;
if (r2 > t02)
t02 = r2;
} else if (dx > 0) {
if (r2 < t02)
return;
if (r2 < t12)
t12 = r2;
}
r2 = y02 - ay;
if (!dy && r2 > 0)
return;
r2 /= dy;
if (dy < 0) {
if (r2 < t02)
return;
if (r2 < t12)
t12 = r2;
} else if (dy > 0) {
if (r2 > t12)
return;
if (r2 > t02)
t02 = r2;
}
r2 = y12 - ay;
if (!dy && r2 < 0)
return;
r2 /= dy;
if (dy < 0) {
if (r2 > t12)
return;
if (r2 > t02)
t02 = r2;
} else if (dy > 0) {
if (r2 < t02)
return;
if (r2 < t12)
t12 = r2;
}
if (t02 > 0)
a2[0] = ax + t02 * dx, a2[1] = ay + t02 * dy;
if (t12 < 1)
b2[0] = ax + t12 * dx, b2[1] = ay + t12 * dy;
return true;
}
var clipMax = 1e9, clipMin = -clipMax;
function clipRectangle(x02, y02, x12, y12) {
function visible(x2, y2) {
return x02 <= x2 && x2 <= x12 && y02 <= y2 && y2 <= y12;
}
function interpolate2(from2, to2, direction2, stream2) {
var a2 = 0, a1 = 0;
if (from2 == null || (a2 = corner(from2, direction2)) !== (a1 = corner(to2, direction2)) || comparePoint(from2, to2) < 0 ^ direction2 > 0) {
do
stream2.point(a2 === 0 || a2 === 3 ? x02 : x12, a2 > 1 ? y12 : y02);
while ((a2 = (a2 + direction2 + 4) % 4) !== a1);
} else {
stream2.point(to2[0], to2[1]);
}
}
function corner(p2, direction2) {
return abs$1(p2[0] - x02) < epsilon$3 ? direction2 > 0 ? 0 : 3 : abs$1(p2[0] - x12) < epsilon$3 ? direction2 > 0 ? 2 : 1 : abs$1(p2[1] - y02) < epsilon$3 ? direction2 > 0 ? 1 : 0 : direction2 > 0 ? 3 : 2;
}
function compareIntersection2(a2, b2) {
return comparePoint(a2.x, b2.x);
}
function comparePoint(a2, b2) {
var ca2 = corner(a2, 1), cb2 = corner(b2, 1);
return ca2 !== cb2 ? ca2 - cb2 : ca2 === 0 ? b2[1] - a2[1] : ca2 === 1 ? a2[0] - b2[0] : ca2 === 2 ? a2[1] - b2[1] : b2[0] - a2[0];
}
return function(stream2) {
var activeStream = stream2, bufferStream = clipBuffer(), segments2, polygon, ring, x__, y__, v__, x_, y_, v_, first, clean;
var clipStream = {
point: point2,
lineStart,
lineEnd,
polygonStart,
polygonEnd
};
function point2(x2, y2) {
if (visible(x2, y2))
activeStream.point(x2, y2);
}
function polygonInside() {
var winding = 0;
for (var i2 = 0, n2 = polygon.length; i2 < n2; ++i2) {
for (var ring2 = polygon[i2], j2 = 1, m2 = ring2.length, point3 = ring2[0], a0, a1, b0 = point3[0], b1 = point3[1]; j2 < m2; ++j2) {
a0 = b0, a1 = b1, point3 = ring2[j2], b0 = point3[0], b1 = point3[1];
if (a1 <= y12) {
if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x02 - a0))
++winding;
} else {
if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x02 - a0))
--winding;
}
}
}
return winding;
}
function polygonStart() {
activeStream = bufferStream, segments2 = [], polygon = [], clean = true;
}
function polygonEnd() {
var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments2 = merge$2(segments2)).length;
if (cleanInside || visible2) {
stream2.polygonStart();
if (cleanInside) {
stream2.lineStart();
interpolate2(null, null, 1, stream2);
stream2.lineEnd();
}
if (visible2) {
clipRejoin(segments2, compareIntersection2, startInside, interpolate2, stream2);
}
stream2.polygonEnd();
}
activeStream = stream2, segments2 = polygon = ring = null;
}
function lineStart() {
clipStream.point = linePoint2;
if (polygon)
polygon.push(ring = []);
first = true;
v_ = false;
x_ = y_ = NaN;
}
function lineEnd() {
if (segments2) {
linePoint2(x__, y__);
if (v__ && v_)
bufferStream.rejoin();
segments2.push(bufferStream.result());
}
clipStream.point = point2;
if (v_)
activeStream.lineEnd();
}
function linePoint2(x2, y2) {
var v2 = visible(x2, y2);
if (polygon)
ring.push([x2, y2]);
if (first) {
x__ = x2, y__ = y2, v__ = v2;
first = false;
if (v2) {
activeStream.lineStart();
activeStream.point(x2, y2);
}
} else {
if (v2 && v_)
activeStream.point(x2, y2);
else {
var a2 = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b2 = [x2 = Math.max(clipMin, Math.min(clipMax, x2)), y2 = Math.max(clipMin, Math.min(clipMax, y2))];
if (clipLine(a2, b2, x02, y02, x12, y12)) {
if (!v_) {
activeStream.lineStart();
activeStream.point(a2[0], a2[1]);
}
activeStream.point(b2[0], b2[1]);
if (!v2)
activeStream.lineEnd();
clean = false;
} else if (v2) {
activeStream.lineStart();
activeStream.point(x2, y2);
clean = false;
}
}
}
x_ = x2, y_ = y2, v_ = v2;
}
return clipStream;
};
}
function graticuleX(y02, y12, dy) {
var y2 = range$8(y02, y12 - epsilon$3, dy).concat(y12);
return function(x2) {
return y2.map(function(y3) {
return [x2, y3];
});
};
}
function graticuleY(x02, x12, dx) {
var x2 = range$8(x02, x12 - epsilon$3, dx).concat(x12);
return function(y2) {
return x2.map(function(x3) {
return [x3, y2];
});
};
}
function graticule() {
var x12, x02, X12, X02, y12, y02, Y12, Y02, dx = 10, dy = dx, DX = 90, DY = 360, x2, y2, X3, Y3, precision = 2.5;
function graticule2() {
return { type: "MultiLineString", coordinates: lines() };
}
function lines() {
return range$8(ceil$1(X02 / DX) * DX, X12, DX).map(X3).concat(range$8(ceil$1(Y02 / DY) * DY, Y12, DY).map(Y3)).concat(range$8(ceil$1(x02 / dx) * dx, x12, dx).filter(function(x3) {
return abs$1(x3 % DX) > epsilon$3;
}).map(x2)).concat(range$8(ceil$1(y02 / dy) * dy, y12, dy).filter(function(y3) {
return abs$1(y3 % DY) > epsilon$3;
}).map(y2));
}
graticule2.lines = function() {
return lines().map(function(coordinates) {
return { type: "LineString", coordinates };
});
};
graticule2.outline = function() {
return {
type: "Polygon",
coordinates: [
X3(X02).concat(
Y3(Y12).slice(1),
X3(X12).reverse().slice(1),
Y3(Y02).reverse().slice(1)
)
]
};
};
graticule2.extent = function(_24) {
if (!arguments.length)
return graticule2.extentMinor();
return graticule2.extentMajor(_24).extentMinor(_24);
};
graticule2.extentMajor = function(_24) {
if (!arguments.length)
return [[X02, Y02], [X12, Y12]];
X02 = +_24[0][0], X12 = +_24[1][0];
Y02 = +_24[0][1], Y12 = +_24[1][1];
if (X02 > X12)
_24 = X02, X02 = X12, X12 = _24;
if (Y02 > Y12)
_24 = Y02, Y02 = Y12, Y12 = _24;
return graticule2.precision(precision);
};
graticule2.extentMinor = function(_24) {
if (!arguments.length)
return [[x02, y02], [x12, y12]];
x02 = +_24[0][0], x12 = +_24[1][0];
y02 = +_24[0][1], y12 = +_24[1][1];
if (x02 > x12)
_24 = x02, x02 = x12, x12 = _24;
if (y02 > y12)
_24 = y02, y02 = y12, y12 = _24;
return graticule2.precision(precision);
};
graticule2.step = function(_24) {
if (!arguments.length)
return graticule2.stepMinor();
return graticule2.stepMajor(_24).stepMinor(_24);
};
graticule2.stepMajor = function(_24) {
if (!arguments.length)
return [DX, DY];
DX = +_24[0], DY = +_24[1];
return graticule2;
};
graticule2.stepMinor = function(_24) {
if (!arguments.length)
return [dx, dy];
dx = +_24[0], dy = +_24[1];
return graticule2;
};
graticule2.precision = function(_24) {
if (!arguments.length)
return precision;
precision = +_24;
x2 = graticuleX(y02, y12, 90);
y2 = graticuleY(x02, x12, precision);
X3 = graticuleX(Y02, Y12, 90);
Y3 = graticuleY(X02, X12, precision);
return graticule2;
};
return graticule2.extentMajor([[-180, -90 + epsilon$3], [180, 90 - epsilon$3]]).extentMinor([[-180, -80 - epsilon$3], [180, 80 + epsilon$3]]);
}
const identity = (x2) => x2;
var areaSum = new Adder(), areaRingSum = new Adder(), x00$2, y00$2, x0$3, y0$3;
var areaStream = {
point: noop$4,
lineStart: noop$4,
lineEnd: noop$4,
polygonStart: function() {
areaStream.lineStart = areaRingStart;
areaStream.lineEnd = areaRingEnd;
},
polygonEnd: function() {
areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop$4;
areaSum.add(abs$1(areaRingSum));
areaRingSum = new Adder();
},
result: function() {
var area2 = areaSum / 2;
areaSum = new Adder();
return area2;
}
};
function areaRingStart() {
areaStream.point = areaPointFirst;
}
function areaPointFirst(x2, y2) {
areaStream.point = areaPoint;
x00$2 = x0$3 = x2, y00$2 = y0$3 = y2;
}
function areaPoint(x2, y2) {
areaRingSum.add(y0$3 * x2 - x0$3 * y2);
x0$3 = x2, y0$3 = y2;
}
function areaRingEnd() {
areaPoint(x00$2, y00$2);
}
const pathArea = areaStream;
var x0$2 = Infinity, y0$2 = x0$2, x1 = -x0$2, y1 = x1;
var boundsStream = {
point: boundsPoint,
lineStart: noop$4,
lineEnd: noop$4,
polygonStart: noop$4,
polygonEnd: noop$4,
result: function() {
var bounds2 = [[x0$2, y0$2], [x1, y1]];
x1 = y1 = -(y0$2 = x0$2 = Infinity);
return bounds2;
}
};
function boundsPoint(x2, y2) {
if (x2 < x0$2)
x0$2 = x2;
if (x2 > x1)
x1 = x2;
if (y2 < y0$2)
y0$2 = y2;
if (y2 > y1)
y1 = y2;
}
const boundsStream$1 = boundsStream;
var X0 = 0, Y0 = 0, Z0 = 0, X1 = 0, Y1 = 0, Z1 = 0, X2 = 0, Y2 = 0, Z2 = 0, x00$1, y00$1, x0$1, y0$1;
var centroidStream = {
point: centroidPoint,
lineStart: centroidLineStart,
lineEnd: centroidLineEnd,
polygonStart: function() {
centroidStream.lineStart = centroidRingStart;
centroidStream.lineEnd = centroidRingEnd;
},
polygonEnd: function() {
centroidStream.point = centroidPoint;
centroidStream.lineStart = centroidLineStart;
centroidStream.lineEnd = centroidLineEnd;
},
result: function() {
var centroid = Z2 ? [X2 / Z2, Y2 / Z2] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN];
X0 = Y0 = Z0 = X1 = Y1 = Z1 = X2 = Y2 = Z2 = 0;
return centroid;
}
};
function centroidPoint(x2, y2) {
X0 += x2;
Y0 += y2;
++Z0;
}
function centroidLineStart() {
centroidStream.point = centroidPointFirstLine;
}
function centroidPointFirstLine(x2, y2) {
centroidStream.point = centroidPointLine;
centroidPoint(x0$1 = x2, y0$1 = y2);
}
function centroidPointLine(x2, y2) {
var dx = x2 - x0$1, dy = y2 - y0$1, z2 = sqrt$1(dx * dx + dy * dy);
X1 += z2 * (x0$1 + x2) / 2;
Y1 += z2 * (y0$1 + y2) / 2;
Z1 += z2;
centroidPoint(x0$1 = x2, y0$1 = y2);
}
function centroidLineEnd() {
centroidStream.point = centroidPoint;
}
function centroidRingStart() {
centroidStream.point = centroidPointFirstRing;
}
function centroidRingEnd() {
centroidPointRing(x00$1, y00$1);
}
function centroidPointFirstRing(x2, y2) {
centroidStream.point = centroidPointRing;
centroidPoint(x00$1 = x0$1 = x2, y00$1 = y0$1 = y2);
}
function centroidPointRing(x2, y2) {
var dx = x2 - x0$1, dy = y2 - y0$1, z2 = sqrt$1(dx * dx + dy * dy);
X1 += z2 * (x0$1 + x2) / 2;
Y1 += z2 * (y0$1 + y2) / 2;
Z1 += z2;
z2 = y0$1 * x2 - x0$1 * y2;
X2 += z2 * (x0$1 + x2);
Y2 += z2 * (y0$1 + y2);
Z2 += z2 * 3;
centroidPoint(x0$1 = x2, y0$1 = y2);
}
const pathCentroid = centroidStream;
function PathContext(context2) {
this._context = context2;
}
PathContext.prototype = {
_radius: 4.5,
pointRadius: function(_24) {
return this._radius = _24, this;
},
polygonStart: function() {
this._line = 0;
},
polygonEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._line === 0)
this._context.closePath();
this._point = NaN;
},
point: function(x2, y2) {
switch (this._point) {
case 0: {
this._context.moveTo(x2, y2);
this._point = 1;
break;
}
case 1: {
this._context.lineTo(x2, y2);
break;
}
default: {
this._context.moveTo(x2 + this._radius, y2);
this._context.arc(x2, y2, this._radius, 0, tau$1);
break;
}
}
},
result: noop$4
};
var lengthSum = new Adder(), lengthRing, x00, y00, x0, y0;
var lengthStream = {
point: noop$4,
lineStart: function() {
lengthStream.point = lengthPointFirst;
},
lineEnd: function() {
if (lengthRing)
lengthPoint(x00, y00);
lengthStream.point = noop$4;
},
polygonStart: function() {
lengthRing = true;
},
polygonEnd: function() {
lengthRing = null;
},
result: function() {
var length2 = +lengthSum;
lengthSum = new Adder();
return length2;
}
};
function lengthPointFirst(x2, y2) {
lengthStream.point = lengthPoint;
x00 = x0 = x2, y00 = y0 = y2;
}
function lengthPoint(x2, y2) {
x0 -= x2, y0 -= y2;
lengthSum.add(sqrt$1(x0 * x0 + y0 * y0));
x0 = x2, y0 = y2;
}
const pathMeasure = lengthStream;
let cacheDigits, cacheAppend, cacheRadius, cacheCircle;
class PathString {
constructor(digits) {
this._append = digits == null ? append : appendRound(digits);
this._radius = 4.5;
this._ = "";
}
pointRadius(_24) {
this._radius = +_24;
return this;
}
polygonStart() {
this._line = 0;
}
polygonEnd() {
this._line = NaN;
}
lineStart() {
this._point = 0;
}
lineEnd() {
if (this._line === 0)
this._ += "Z";
this._point = NaN;
}
point(x2, y2) {
switch (this._point) {
case 0: {
this._append`M${x2},${y2}`;
this._point = 1;
break;
}
case 1: {
this._append`L${x2},${y2}`;
break;
}
default: {
this._append`M${x2},${y2}`;
if (this._radius !== cacheRadius || this._append !== cacheAppend) {
const r2 = this._radius;
const s2 = this._;
this._ = "";
this._append`m0,${r2}a${r2},${r2} 0 1,1 0,${-2 * r2}a${r2},${r2} 0 1,1 0,${2 * r2}z`;
cacheRadius = r2;
cacheAppend = this._append;
cacheCircle = this._;
this._ = s2;
}
this._ += cacheCircle;
break;
}
}
}
result() {
const result = this._;
this._ = "";
return result.length ? result : null;
}
}
function append(strings) {
let i2 = 1;
this._ += strings[0];
for (const j2 = strings.length; i2 < j2; ++i2) {
this._ += arguments[i2] + strings[i2];
}
}
function appendRound(digits) {
const d2 = Math.floor(digits);
if (!(d2 >= 0))
throw new RangeError(`invalid digits: ${digits}`);
if (d2 > 15)
return append;
if (d2 !== cacheDigits) {
const k2 = 10 ** d2;
cacheDigits = d2;
cacheAppend = function append2(strings) {
let i2 = 1;
this._ += strings[0];
for (const j2 = strings.length; i2 < j2; ++i2) {
this._ += Math.round(arguments[i2] * k2) / k2 + strings[i2];
}
};
}
return cacheAppend;
}
function geoPath(projection2, context2) {
let digits = 3, pointRadius = 4.5, projectionStream, contextStream;
function path2(object2) {
if (object2) {
if (typeof pointRadius === "function")
contextStream.pointRadius(+pointRadius.apply(this, arguments));
geoStream(object2, projectionStream(contextStream));
}
return contextStream.result();
}
path2.area = function(object2) {
geoStream(object2, projectionStream(pathArea));
return pathArea.result();
};
path2.measure = function(object2) {
geoStream(object2, projectionStream(pathMeasure));
return pathMeasure.result();
};
path2.bounds = function(object2) {
geoStream(object2, projectionStream(boundsStream$1));
return boundsStream$1.result();
};
path2.centroid = function(object2) {
geoStream(object2, projectionStream(pathCentroid));
return pathCentroid.result();
};
path2.projection = function(_24) {
if (!arguments.length)
return projection2;
projectionStream = _24 == null ? (projection2 = null, identity) : (projection2 = _24).stream;
return path2;
};
path2.context = function(_24) {
if (!arguments.length)
return context2;
contextStream = _24 == null ? (context2 = null, new PathString(digits)) : new PathContext(context2 = _24);
if (typeof pointRadius !== "function")
contextStream.pointRadius(pointRadius);
return path2;
};
path2.pointRadius = function(_24) {
if (!arguments.length)
return pointRadius;
pointRadius = typeof _24 === "function" ? _24 : (contextStream.pointRadius(+_24), +_24);
return path2;
};
path2.digits = function(_24) {
if (!arguments.length)
return digits;
if (_24 == null)
digits = null;
else {
const d2 = Math.floor(_24);
if (!(d2 >= 0))
throw new RangeError(`invalid digits: ${_24}`);
digits = d2;
}
if (context2 === null)
contextStream = new PathString(digits);
return path2;
};
return path2.projection(projection2).digits(digits).context(context2);
}
function transformer(methods2) {
return function(stream2) {
var s2 = new TransformStream$1();
for (var key2 in methods2)
s2[key2] = methods2[key2];
s2.stream = stream2;
return s2;
};
}
function TransformStream$1() {
}
TransformStream$1.prototype = {
constructor: TransformStream$1,
point: function(x2, y2) {
this.stream.point(x2, y2);
},
sphere: function() {
this.stream.sphere();
},
lineStart: function() {
this.stream.lineStart();
},
lineEnd: function() {
this.stream.lineEnd();
},
polygonStart: function() {
this.stream.polygonStart();
},
polygonEnd: function() {
this.stream.polygonEnd();
}
};
function fit$1(projection2, fitBounds, object2) {
var clip2 = projection2.clipExtent && projection2.clipExtent();
projection2.scale(150).translate([0, 0]);
if (clip2 != null)
projection2.clipExtent(null);
geoStream(object2, projection2.stream(boundsStream$1));
fitBounds(boundsStream$1.result());
if (clip2 != null)
projection2.clipExtent(clip2);
return projection2;
}
function fitExtent(projection2, extent2, object2) {
return fit$1(projection2, function(b2) {
var w2 = extent2[1][0] - extent2[0][0], h2 = extent2[1][1] - extent2[0][1], k2 = Math.min(w2 / (b2[1][0] - b2[0][0]), h2 / (b2[1][1] - b2[0][1])), x2 = +extent2[0][0] + (w2 - k2 * (b2[1][0] + b2[0][0])) / 2, y2 = +extent2[0][1] + (h2 - k2 * (b2[1][1] + b2[0][1])) / 2;
projection2.scale(150 * k2).translate([x2, y2]);
}, object2);
}
function fitSize(projection2, size, object2) {
return fitExtent(projection2, [[0, 0], size], object2);
}
function fitWidth(projection2, width2, object2) {
return fit$1(projection2, function(b2) {
var w2 = +width2, k2 = w2 / (b2[1][0] - b2[0][0]), x2 = (w2 - k2 * (b2[1][0] + b2[0][0])) / 2, y2 = -k2 * b2[0][1];
projection2.scale(150 * k2).translate([x2, y2]);
}, object2);
}
function fitHeight(projection2, height2, object2) {
return fit$1(projection2, function(b2) {
var h2 = +height2, k2 = h2 / (b2[1][1] - b2[0][1]), x2 = -k2 * b2[0][0], y2 = (h2 - k2 * (b2[1][1] + b2[0][1])) / 2;
projection2.scale(150 * k2).translate([x2, y2]);
}, object2);
}
var maxDepth = 16, cosMinDistance = cos$1(30 * radians);
function resample(project2, delta2) {
return +delta2 ? resample$1(project2, delta2) : resampleNone(project2);
}
function resampleNone(project2) {
return transformer({
point: function(x2, y2) {
x2 = project2(x2, y2);
this.stream.point(x2[0], x2[1]);
}
});
}
function resample$1(project2, delta2) {
function resampleLineTo(x02, y02, lambda02, a0, b0, c0, x12, y12, lambda12, a1, b1, c1, depth, stream2) {
var dx = x12 - x02, dy = y12 - y02, d2 = dx * dx + dy * dy;
if (d2 > 4 * delta2 && depth--) {
var a2 = a0 + a1, b2 = b0 + b1, c2 = c0 + c1, m2 = sqrt$1(a2 * a2 + b2 * b2 + c2 * c2), phi2 = asin$1(c2 /= m2), lambda22 = abs$1(abs$1(c2) - 1) < epsilon$3 || abs$1(lambda02 - lambda12) < epsilon$3 ? (lambda02 + lambda12) / 2 : atan2(b2, a2), p2 = project2(lambda22, phi2), x2 = p2[0], y2 = p2[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
if (dz * dz / d2 > delta2 || abs$1((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
resampleLineTo(x02, y02, lambda02, a0, b0, c0, x2, y2, lambda22, a2 /= m2, b2 /= m2, c2, depth, stream2);
stream2.point(x2, y2);
resampleLineTo(x2, y2, lambda22, a2, b2, c2, x12, y12, lambda12, a1, b1, c1, depth, stream2);
}
}
}
return function(stream2) {
var lambda002, x002, y002, a00, b00, c00, lambda02, x02, y02, a0, b0, c0;
var resampleStream = {
point: point2,
lineStart,
lineEnd,
polygonStart: function() {
stream2.polygonStart();
resampleStream.lineStart = ringStart;
},
polygonEnd: function() {
stream2.polygonEnd();
resampleStream.lineStart = lineStart;
}
};
function point2(x2, y2) {
x2 = project2(x2, y2);
stream2.point(x2[0], x2[1]);
}
function lineStart() {
x02 = NaN;
resampleStream.point = linePoint2;
stream2.lineStart();
}
function linePoint2(lambda, phi2) {
var c2 = cartesian([lambda, phi2]), p2 = project2(lambda, phi2);
resampleLineTo(x02, y02, lambda02, a0, b0, c0, x02 = p2[0], y02 = p2[1], lambda02 = lambda, a0 = c2[0], b0 = c2[1], c0 = c2[2], maxDepth, stream2);
stream2.point(x02, y02);
}
function lineEnd() {
resampleStream.point = point2;
stream2.lineEnd();
}
function ringStart() {
lineStart();
resampleStream.point = ringPoint;
resampleStream.lineEnd = ringEnd;
}
function ringPoint(lambda, phi2) {
linePoint2(lambda002 = lambda, phi2), x002 = x02, y002 = y02, a00 = a0, b00 = b0, c00 = c0;
resampleStream.point = linePoint2;
}
function ringEnd() {
resampleLineTo(x02, y02, lambda02, a0, b0, c0, x002, y002, lambda002, a00, b00, c00, maxDepth, stream2);
resampleStream.lineEnd = lineEnd;
lineEnd();
}
return resampleStream;
};
}
var transformRadians = transformer({
point: function(x2, y2) {
this.stream.point(x2 * radians, y2 * radians);
}
});
function transformRotate(rotate2) {
return transformer({
point: function(x2, y2) {
var r2 = rotate2(x2, y2);
return this.stream.point(r2[0], r2[1]);
}
});
}
function scaleTranslate(k2, dx, dy, sx, sy) {
function transform2(x2, y2) {
x2 *= sx;
y2 *= sy;
return [dx + k2 * x2, dy - k2 * y2];
}
transform2.invert = function(x2, y2) {
return [(x2 - dx) / k2 * sx, (dy - y2) / k2 * sy];
};
return transform2;
}
function scaleTranslateRotate(k2, dx, dy, sx, sy, alpha) {
if (!alpha)
return scaleTranslate(k2, dx, dy, sx, sy);
var cosAlpha = cos$1(alpha), sinAlpha = sin$1(alpha), a2 = cosAlpha * k2, b2 = sinAlpha * k2, ai2 = cosAlpha / k2, bi2 = sinAlpha / k2, ci2 = (sinAlpha * dy - cosAlpha * dx) / k2, fi2 = (sinAlpha * dx + cosAlpha * dy) / k2;
function transform2(x2, y2) {
x2 *= sx;
y2 *= sy;
return [a2 * x2 - b2 * y2 + dx, dy - b2 * x2 - a2 * y2];
}
transform2.invert = function(x2, y2) {
return [sx * (ai2 * x2 - bi2 * y2 + ci2), sy * (fi2 - bi2 * x2 - ai2 * y2)];
};
return transform2;
}
function projection$1(project2) {
return projectionMutator(function() {
return project2;
})();
}
function projectionMutator(projectAt) {
var project2, k2 = 150, x2 = 480, y2 = 250, lambda = 0, phi2 = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate2, alpha = 0, sx = 1, sy = 1, theta = null, preclip = clipAntimeridian, x02 = null, y02, x12, y12, postclip = identity, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache2, cacheStream;
function projection2(point2) {
return projectRotateTransform(point2[0] * radians, point2[1] * radians);
}
function invert2(point2) {
point2 = projectRotateTransform.invert(point2[0], point2[1]);
return point2 && [point2[0] * degrees, point2[1] * degrees];
}
projection2.stream = function(stream2) {
return cache2 && cacheStream === stream2 ? cache2 : cache2 = transformRadians(transformRotate(rotate2)(preclip(projectResample(postclip(cacheStream = stream2)))));
};
projection2.preclip = function(_24) {
return arguments.length ? (preclip = _24, theta = void 0, reset2()) : preclip;
};
projection2.postclip = function(_24) {
return arguments.length ? (postclip = _24, x02 = y02 = x12 = y12 = null, reset2()) : postclip;
};
projection2.clipAngle = function(_24) {
return arguments.length ? (preclip = +_24 ? clipCircle(theta = _24 * radians) : (theta = null, clipAntimeridian), reset2()) : theta * degrees;
};
projection2.clipExtent = function(_24) {
return arguments.length ? (postclip = _24 == null ? (x02 = y02 = x12 = y12 = null, identity) : clipRectangle(x02 = +_24[0][0], y02 = +_24[0][1], x12 = +_24[1][0], y12 = +_24[1][1]), reset2()) : x02 == null ? null : [[x02, y02], [x12, y12]];
};
projection2.scale = function(_24) {
return arguments.length ? (k2 = +_24, recenter()) : k2;
};
projection2.translate = function(_24) {
return arguments.length ? (x2 = +_24[0], y2 = +_24[1], recenter()) : [x2, y2];
};
projection2.center = function(_24) {
return arguments.length ? (lambda = _24[0] % 360 * radians, phi2 = _24[1] % 360 * radians, recenter()) : [lambda * degrees, phi2 * degrees];
};
projection2.rotate = function(_24) {
return arguments.length ? (deltaLambda = _24[0] % 360 * radians, deltaPhi = _24[1] % 360 * radians, deltaGamma = _24.length > 2 ? _24[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
};
projection2.angle = function(_24) {
return arguments.length ? (alpha = _24 % 360 * radians, recenter()) : alpha * degrees;
};
projection2.reflectX = function(_24) {
return arguments.length ? (sx = _24 ? -1 : 1, recenter()) : sx < 0;
};
projection2.reflectY = function(_24) {
return arguments.length ? (sy = _24 ? -1 : 1, recenter()) : sy < 0;
};
projection2.precision = function(_24) {
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _24 * _24), reset2()) : sqrt$1(delta2);
};
projection2.fitExtent = function(extent2, object2) {
return fitExtent(projection2, extent2, object2);
};
projection2.fitSize = function(size, object2) {
return fitSize(projection2, size, object2);
};
projection2.fitWidth = function(width2, object2) {
return fitWidth(projection2, width2, object2);
};
projection2.fitHeight = function(height2, object2) {
return fitHeight(projection2, height2, object2);
};
function recenter() {
var center = scaleTranslateRotate(k2, 0, 0, sx, sy, alpha).apply(null, project2(lambda, phi2)), transform2 = scaleTranslateRotate(k2, x2 - center[0], y2 - center[1], sx, sy, alpha);
rotate2 = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
projectTransform = compose(project2, transform2);
projectRotateTransform = compose(rotate2, projectTransform);
projectResample = resample(projectTransform, delta2);
return reset2();
}
function reset2() {
cache2 = cacheStream = null;
return projection2;
}
return function() {
project2 = projectAt.apply(this, arguments);
projection2.invert = project2.invert && invert2;
return recenter();
};
}
function conicProjection(projectAt) {
var phi02 = 0, phi12 = pi$2 / 3, m2 = projectionMutator(projectAt), p2 = m2(phi02, phi12);
p2.parallels = function(_24) {
return arguments.length ? m2(phi02 = _24[0] * radians, phi12 = _24[1] * radians) : [phi02 * degrees, phi12 * degrees];
};
return p2;
}
function cylindricalEqualAreaRaw(phi02) {
var cosPhi02 = cos$1(phi02);
function forward(lambda, phi2) {
return [lambda * cosPhi02, sin$1(phi2) / cosPhi02];
}
forward.invert = function(x2, y2) {
return [x2 / cosPhi02, asin$1(y2 * cosPhi02)];
};
return forward;
}
function conicEqualAreaRaw(y02, y12) {
var sy0 = sin$1(y02), n2 = (sy0 + sin$1(y12)) / 2;
if (abs$1(n2) < epsilon$3)
return cylindricalEqualAreaRaw(y02);
var c2 = 1 + sy0 * (2 * n2 - sy0), r0 = sqrt$1(c2) / n2;
function project2(x2, y2) {
var r2 = sqrt$1(c2 - 2 * n2 * sin$1(y2)) / n2;
return [r2 * sin$1(x2 *= n2), r0 - r2 * cos$1(x2)];
}
project2.invert = function(x2, y2) {
var r0y = r0 - y2, l2 = atan2(x2, abs$1(r0y)) * sign(r0y);
if (r0y * n2 < 0)
l2 -= pi$2 * sign(x2) * sign(r0y);
return [l2 / n2, asin$1((c2 - (x2 * x2 + r0y * r0y) * n2 * n2) / (2 * n2))];
};
return project2;
}
function geoConicEqualArea() {
return conicProjection(conicEqualAreaRaw).scale(155.424).center([0, 33.6442]);
}
function geoAlbers() {
return geoConicEqualArea().parallels([29.5, 45.5]).scale(1070).translate([480, 250]).rotate([96, 0]).center([-0.6, 38.7]);
}
function multiplex(streams) {
var n2 = streams.length;
return {
point: function(x2, y2) {
var i2 = -1;
while (++i2 < n2)
streams[i2].point(x2, y2);
},
sphere: function() {
var i2 = -1;
while (++i2 < n2)
streams[i2].sphere();
},
lineStart: function() {
var i2 = -1;
while (++i2 < n2)
streams[i2].lineStart();
},
lineEnd: function() {
var i2 = -1;
while (++i2 < n2)
streams[i2].lineEnd();
},
polygonStart: function() {
var i2 = -1;
while (++i2 < n2)
streams[i2].polygonStart();
},
polygonEnd: function() {
var i2 = -1;
while (++i2 < n2)
streams[i2].polygonEnd();
}
};
}
function geoAlbersUsa() {
var cache2, cacheStream, lower48 = geoAlbers(), lower48Point, alaska = geoConicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, hawaii = geoConicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, point2, pointStream = { point: function(x2, y2) {
point2 = [x2, y2];
} };
function albersUsa(coordinates) {
var x2 = coordinates[0], y2 = coordinates[1];
return point2 = null, (lower48Point.point(x2, y2), point2) || (alaskaPoint.point(x2, y2), point2) || (hawaiiPoint.point(x2, y2), point2);
}
albersUsa.invert = function(coordinates) {
var k2 = lower48.scale(), t5 = lower48.translate(), x2 = (coordinates[0] - t5[0]) / k2, y2 = (coordinates[1] - t5[1]) / k2;
return (y2 >= 0.12 && y2 < 0.234 && x2 >= -0.425 && x2 < -0.214 ? alaska : y2 >= 0.166 && y2 < 0.234 && x2 >= -0.214 && x2 < -0.115 ? hawaii : lower48).invert(coordinates);
};
albersUsa.stream = function(stream2) {
return cache2 && cacheStream === stream2 ? cache2 : cache2 = multiplex([lower48.stream(cacheStream = stream2), alaska.stream(stream2), hawaii.stream(stream2)]);
};
albersUsa.precision = function(_24) {
if (!arguments.length)
return lower48.precision();
lower48.precision(_24), alaska.precision(_24), hawaii.precision(_24);
return reset2();
};
albersUsa.scale = function(_24) {
if (!arguments.length)
return lower48.scale();
lower48.scale(_24), alaska.scale(_24 * 0.35), hawaii.scale(_24);
return albersUsa.translate(lower48.translate());
};
albersUsa.translate = function(_24) {
if (!arguments.length)
return lower48.translate();
var k2 = lower48.scale(), x2 = +_24[0], y2 = +_24[1];
lower48Point = lower48.translate(_24).clipExtent([[x2 - 0.455 * k2, y2 - 0.238 * k2], [x2 + 0.455 * k2, y2 + 0.238 * k2]]).stream(pointStream);
alaskaPoint = alaska.translate([x2 - 0.307 * k2, y2 + 0.201 * k2]).clipExtent([[x2 - 0.425 * k2 + epsilon$3, y2 + 0.12 * k2 + epsilon$3], [x2 - 0.214 * k2 - epsilon$3, y2 + 0.234 * k2 - epsilon$3]]).stream(pointStream);
hawaiiPoint = hawaii.translate([x2 - 0.205 * k2, y2 + 0.212 * k2]).clipExtent([[x2 - 0.214 * k2 + epsilon$3, y2 + 0.166 * k2 + epsilon$3], [x2 - 0.115 * k2 - epsilon$3, y2 + 0.234 * k2 - epsilon$3]]).stream(pointStream);
return reset2();
};
albersUsa.fitExtent = function(extent2, object2) {
return fitExtent(albersUsa, extent2, object2);
};
albersUsa.fitSize = function(size, object2) {
return fitSize(albersUsa, size, object2);
};
albersUsa.fitWidth = function(width2, object2) {
return fitWidth(albersUsa, width2, object2);
};
albersUsa.fitHeight = function(height2, object2) {
return fitHeight(albersUsa, height2, object2);
};
function reset2() {
cache2 = cacheStream = null;
return albersUsa;
}
return albersUsa.scale(1070);
}
function azimuthalRaw(scale2) {
return function(x2, y2) {
var cx = cos$1(x2), cy = cos$1(y2), k2 = scale2(cx * cy);
if (k2 === Infinity)
return [2, 0];
return [
k2 * cy * sin$1(x2),
k2 * sin$1(y2)
];
};
}
function azimuthalInvert(angle2) {
return function(x2, y2) {
var z2 = sqrt$1(x2 * x2 + y2 * y2), c2 = angle2(z2), sc2 = sin$1(c2), cc2 = cos$1(c2);
return [
atan2(x2 * sc2, z2 * cc2),
asin$1(z2 && y2 * sc2 / z2)
];
};
}
var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {
return sqrt$1(2 / (1 + cxcy));
});
azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z2) {
return 2 * asin$1(z2 / 2);
});
function geoAzimuthalEqualArea() {
return projection$1(azimuthalEqualAreaRaw).scale(124.75).clipAngle(180 - 1e-3);
}
var azimuthalEquidistantRaw = azimuthalRaw(function(c2) {
return (c2 = acos(c2)) && c2 / sin$1(c2);
});
azimuthalEquidistantRaw.invert = azimuthalInvert(function(z2) {
return z2;
});
function geoAzimuthalEquidistant() {
return projection$1(azimuthalEquidistantRaw).scale(79.4188).clipAngle(180 - 1e-3);
}
function mercatorRaw(lambda, phi2) {
return [lambda, log$1(tan((halfPi$1 + phi2) / 2))];
}
mercatorRaw.invert = function(x2, y2) {
return [x2, 2 * atan(exp(y2)) - halfPi$1];
};
function geoMercator() {
return mercatorProjection(mercatorRaw).scale(961 / tau$1);
}
function mercatorProjection(project2) {
var m2 = projection$1(project2), center = m2.center, scale2 = m2.scale, translate2 = m2.translate, clipExtent = m2.clipExtent, x02 = null, y02, x12, y12;
m2.scale = function(_24) {
return arguments.length ? (scale2(_24), reclip()) : scale2();
};
m2.translate = function(_24) {
return arguments.length ? (translate2(_24), reclip()) : translate2();
};
m2.center = function(_24) {
return arguments.length ? (center(_24), reclip()) : center();
};
m2.clipExtent = function(_24) {
return arguments.length ? (_24 == null ? x02 = y02 = x12 = y12 = null : (x02 = +_24[0][0], y02 = +_24[0][1], x12 = +_24[1][0], y12 = +_24[1][1]), reclip()) : x02 == null ? null : [[x02, y02], [x12, y12]];
};
function reclip() {
var k2 = pi$2 * scale2(), t5 = m2(rotation(m2.rotate()).invert([0, 0]));
return clipExtent(x02 == null ? [[t5[0] - k2, t5[1] - k2], [t5[0] + k2, t5[1] + k2]] : project2 === mercatorRaw ? [[Math.max(t5[0] - k2, x02), y02], [Math.min(t5[0] + k2, x12), y12]] : [[x02, Math.max(t5[1] - k2, y02)], [x12, Math.min(t5[1] + k2, y12)]]);
}
return reclip();
}
function tany(y2) {
return tan((halfPi$1 + y2) / 2);
}
function conicConformalRaw(y02, y12) {
var cy0 = cos$1(y02), n2 = y02 === y12 ? sin$1(y02) : log$1(cy0 / cos$1(y12)) / log$1(tany(y12) / tany(y02)), f2 = cy0 * pow$1(tany(y02), n2) / n2;
if (!n2)
return mercatorRaw;
function project2(x2, y2) {
if (f2 > 0) {
if (y2 < -halfPi$1 + epsilon$3)
y2 = -halfPi$1 + epsilon$3;
} else {
if (y2 > halfPi$1 - epsilon$3)
y2 = halfPi$1 - epsilon$3;
}
var r2 = f2 / pow$1(tany(y2), n2);
return [r2 * sin$1(n2 * x2), f2 - r2 * cos$1(n2 * x2)];
}
project2.invert = function(x2, y2) {
var fy = f2 - y2, r2 = sign(n2) * sqrt$1(x2 * x2 + fy * fy), l2 = atan2(x2, abs$1(fy)) * sign(fy);
if (fy * n2 < 0)
l2 -= pi$2 * sign(x2) * sign(fy);
return [l2 / n2, 2 * atan(pow$1(f2 / r2, 1 / n2)) - halfPi$1];
};
return project2;
}
function geoConicConformal() {
return conicProjection(conicConformalRaw).scale(109.5).parallels([30, 30]);
}
function equirectangularRaw(lambda, phi2) {
return [lambda, phi2];
}
equirectangularRaw.invert = equirectangularRaw;
function geoEquirectangular() {
return projection$1(equirectangularRaw).scale(152.63);
}
function conicEquidistantRaw(y02, y12) {
var cy0 = cos$1(y02), n2 = y02 === y12 ? sin$1(y02) : (cy0 - cos$1(y12)) / (y12 - y02), g2 = cy0 / n2 + y02;
if (abs$1(n2) < epsilon$3)
return equirectangularRaw;
function project2(x2, y2) {
var gy = g2 - y2, nx = n2 * x2;
return [gy * sin$1(nx), g2 - gy * cos$1(nx)];
}
project2.invert = function(x2, y2) {
var gy = g2 - y2, l2 = atan2(x2, abs$1(gy)) * sign(gy);
if (gy * n2 < 0)
l2 -= pi$2 * sign(x2) * sign(gy);
return [l2 / n2, g2 - sign(n2) * sqrt$1(x2 * x2 + gy * gy)];
};
return project2;
}
function geoConicEquidistant() {
return conicProjection(conicEquidistantRaw).scale(131.154).center([0, 13.9389]);
}
var A1 = 1.340264, A2 = -0.081106, A3 = 893e-6, A4 = 3796e-6, M$7 = sqrt$1(3) / 2, iterations = 12;
function equalEarthRaw(lambda, phi2) {
var l2 = asin$1(M$7 * sin$1(phi2)), l22 = l2 * l2, l6 = l22 * l22 * l22;
return [
lambda * cos$1(l2) / (M$7 * (A1 + 3 * A2 * l22 + l6 * (7 * A3 + 9 * A4 * l22))),
l2 * (A1 + A2 * l22 + l6 * (A3 + A4 * l22))
];
}
equalEarthRaw.invert = function(x2, y2) {
var l2 = y2, l22 = l2 * l2, l6 = l22 * l22 * l22;
for (var i2 = 0, delta, fy, fpy; i2 < iterations; ++i2) {
fy = l2 * (A1 + A2 * l22 + l6 * (A3 + A4 * l22)) - y2;
fpy = A1 + 3 * A2 * l22 + l6 * (7 * A3 + 9 * A4 * l22);
l2 -= delta = fy / fpy, l22 = l2 * l2, l6 = l22 * l22 * l22;
if (abs$1(delta) < epsilon2)
break;
}
return [
M$7 * x2 * (A1 + 3 * A2 * l22 + l6 * (7 * A3 + 9 * A4 * l22)) / cos$1(l2),
asin$1(sin$1(l2) / M$7)
];
};
function geoEqualEarth() {
return projection$1(equalEarthRaw).scale(177.158);
}
function gnomonicRaw(x2, y2) {
var cy = cos$1(y2), k2 = cos$1(x2) * cy;
return [cy * sin$1(x2) / k2, sin$1(y2) / k2];
}
gnomonicRaw.invert = azimuthalInvert(atan);
function geoGnomonic() {
return projection$1(gnomonicRaw).scale(144.049).clipAngle(60);
}
function geoIdentity() {
var k2 = 1, tx2 = 0, ty = 0, sx = 1, sy = 1, alpha = 0, ca2, sa2, x02 = null, y02, x12, y12, kx = 1, ky = 1, transform2 = transformer({
point: function(x2, y2) {
var p2 = projection2([x2, y2]);
this.stream.point(p2[0], p2[1]);
}
}), postclip = identity, cache2, cacheStream;
function reset2() {
kx = k2 * sx;
ky = k2 * sy;
cache2 = cacheStream = null;
return projection2;
}
function projection2(p2) {
var x2 = p2[0] * kx, y2 = p2[1] * ky;
if (alpha) {
var t5 = y2 * ca2 - x2 * sa2;
x2 = x2 * ca2 + y2 * sa2;
y2 = t5;
}
return [x2 + tx2, y2 + ty];
}
projection2.invert = function(p2) {
var x2 = p2[0] - tx2, y2 = p2[1] - ty;
if (alpha) {
var t5 = y2 * ca2 + x2 * sa2;
x2 = x2 * ca2 - y2 * sa2;
y2 = t5;
}
return [x2 / kx, y2 / ky];
};
projection2.stream = function(stream2) {
return cache2 && cacheStream === stream2 ? cache2 : cache2 = transform2(postclip(cacheStream = stream2));
};
projection2.postclip = function(_24) {
return arguments.length ? (postclip = _24, x02 = y02 = x12 = y12 = null, reset2()) : postclip;
};
projection2.clipExtent = function(_24) {
return arguments.length ? (postclip = _24 == null ? (x02 = y02 = x12 = y12 = null, identity) : clipRectangle(x02 = +_24[0][0], y02 = +_24[0][1], x12 = +_24[1][0], y12 = +_24[1][1]), reset2()) : x02 == null ? null : [[x02, y02], [x12, y12]];
};
projection2.scale = function(_24) {
return arguments.length ? (k2 = +_24, reset2()) : k2;
};
projection2.translate = function(_24) {
return arguments.length ? (tx2 = +_24[0], ty = +_24[1], reset2()) : [tx2, ty];
};
projection2.angle = function(_24) {
return arguments.length ? (alpha = _24 % 360 * radians, sa2 = sin$1(alpha), ca2 = cos$1(alpha), reset2()) : alpha * degrees;
};
projection2.reflectX = function(_24) {
return arguments.length ? (sx = _24 ? -1 : 1, reset2()) : sx < 0;
};
projection2.reflectY = function(_24) {
return arguments.length ? (sy = _24 ? -1 : 1, reset2()) : sy < 0;
};
projection2.fitExtent = function(extent2, object2) {
return fitExtent(projection2, extent2, object2);
};
projection2.fitSize = function(size, object2) {
return fitSize(projection2, size, object2);
};
projection2.fitWidth = function(width2, object2) {
return fitWidth(projection2, width2, object2);
};
projection2.fitHeight = function(height2, object2) {
return fitHeight(projection2, height2, object2);
};
return projection2;
}
function naturalEarth1Raw(lambda, phi2) {
var phi22 = phi2 * phi2, phi4 = phi22 * phi22;
return [
lambda * (0.8707 - 0.131979 * phi22 + phi4 * (-0.013791 + phi4 * (3971e-6 * phi22 - 1529e-6 * phi4))),
phi2 * (1.007226 + phi22 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi22 - 5916e-6 * phi4)))
];
}
naturalEarth1Raw.invert = function(x2, y2) {
var phi2 = y2, i2 = 25, delta;
do {
var phi22 = phi2 * phi2, phi4 = phi22 * phi22;
phi2 -= delta = (phi2 * (1.007226 + phi22 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi22 - 5916e-6 * phi4))) - y2) / (1.007226 + phi22 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi22 - 5916e-6 * 11 * phi4)));
} while (abs$1(delta) > epsilon$3 && --i2 > 0);
return [
x2 / (0.8707 + (phi22 = phi2 * phi2) * (-0.131979 + phi22 * (-0.013791 + phi22 * phi22 * phi22 * (3971e-6 - 1529e-6 * phi22)))),
phi2
];
};
function geoNaturalEarth1() {
return projection$1(naturalEarth1Raw).scale(175.295);
}
function orthographicRaw(x2, y2) {
return [cos$1(y2) * sin$1(x2), sin$1(y2)];
}
orthographicRaw.invert = azimuthalInvert(asin$1);
function geoOrthographic() {
return projection$1(orthographicRaw).scale(249.5).clipAngle(90 + epsilon$3);
}
function stereographicRaw(x2, y2) {
var cy = cos$1(y2), k2 = 1 + cos$1(x2) * cy;
return [cy * sin$1(x2) / k2, sin$1(y2) / k2];
}
stereographicRaw.invert = azimuthalInvert(function(z2) {
return 2 * atan(z2);
});
function geoStereographic() {
return projection$1(stereographicRaw).scale(250).clipAngle(142);
}
function transverseMercatorRaw(lambda, phi2) {
return [log$1(tan((halfPi$1 + phi2) / 2)), -lambda];
}
transverseMercatorRaw.invert = function(x2, y2) {
return [-y2, 2 * atan(exp(x2)) - halfPi$1];
};
function geoTransverseMercator() {
var m2 = mercatorProjection(transverseMercatorRaw), center = m2.center, rotate2 = m2.rotate;
m2.center = function(_24) {
return arguments.length ? center([-_24[1], _24[0]]) : (_24 = center(), [_24[1], -_24[0]]);
};
m2.rotate = function(_24) {
return arguments.length ? rotate2([_24[0], _24[1], _24.length > 2 ? _24[2] + 90 : 90]) : (_24 = rotate2(), [_24[0], _24[1], _24[2] - 90]);
};
return rotate2([0, 0, 90]).scale(159.155);
}
var abs = Math.abs;
var cos = Math.cos;
var sin = Math.sin;
var epsilon$2 = 1e-6;
var pi$1 = Math.PI;
var halfPi = pi$1 / 2;
var sqrt2 = sqrt(2);
function asin(x2) {
return x2 > 1 ? halfPi : x2 < -1 ? -halfPi : Math.asin(x2);
}
function sqrt(x2) {
return x2 > 0 ? Math.sqrt(x2) : 0;
}
function mollweideBromleyTheta(cp, phi2) {
var cpsinPhi = cp * sin(phi2), i2 = 30, delta;
do
phi2 -= delta = (phi2 + sin(phi2) - cpsinPhi) / (1 + cos(phi2));
while (abs(delta) > epsilon$2 && --i2 > 0);
return phi2 / 2;
}
function mollweideBromleyRaw(cx, cy, cp) {
function forward(lambda, phi2) {
return [cx * lambda * cos(phi2 = mollweideBromleyTheta(cp, phi2)), cy * sin(phi2)];
}
forward.invert = function(x2, y2) {
return y2 = asin(y2 / cy), [x2 / (cx * cos(y2)), asin((2 * y2 + sin(2 * y2)) / cp)];
};
return forward;
}
var mollweideRaw = mollweideBromleyRaw(sqrt2 / halfPi, sqrt2, pi$1);
function geoMollweide() {
return projection$1(mollweideRaw).scale(169.529);
}
const defaultPath = geoPath();
const projectionProperties = [
// standard properties in d3-geo
"clipAngle",
"clipExtent",
"scale",
"translate",
"center",
"rotate",
"parallels",
"precision",
"reflectX",
"reflectY",
// extended properties in d3-geo-projections
"coefficient",
"distance",
"fraction",
"lobes",
"parallel",
"radius",
"ratio",
"spacing",
"tilt"
];
function create$5(type2, constructor) {
return function projection2() {
const p2 = constructor();
p2.type = type2;
p2.path = geoPath().projection(p2);
p2.copy = p2.copy || function() {
const c2 = projection2();
projectionProperties.forEach((prop) => {
if (p2[prop])
c2[prop](p2[prop]());
});
c2.path.pointRadius(p2.path.pointRadius());
return c2;
};
return registerScale(p2);
};
}
function projection(type2, proj) {
if (!type2 || typeof type2 !== "string") {
throw new Error("Projection type must be a name string.");
}
type2 = type2.toLowerCase();
if (arguments.length > 1) {
projections[type2] = create$5(type2, proj);
return this;
} else {
return projections[type2] || null;
}
}
function getProjectionPath(proj) {
return proj && proj.path || defaultPath;
}
const projections = {
// base d3-geo projection types
albers: geoAlbers,
albersusa: geoAlbersUsa,
azimuthalequalarea: geoAzimuthalEqualArea,
azimuthalequidistant: geoAzimuthalEquidistant,
conicconformal: geoConicConformal,
conicequalarea: geoConicEqualArea,
conicequidistant: geoConicEquidistant,
equalEarth: geoEqualEarth,
equirectangular: geoEquirectangular,
gnomonic: geoGnomonic,
identity: geoIdentity,
mercator: geoMercator,
mollweide: geoMollweide,
naturalEarth1: geoNaturalEarth1,
orthographic: geoOrthographic,
stereographic: geoStereographic,
transversemercator: geoTransverseMercator
};
for (const key2 in projections) {
projection(key2, projections[key2]);
}
function noop$3() {
}
const cases = [[], [[[1, 1.5], [0.5, 1]]], [[[1.5, 1], [1, 1.5]]], [[[1.5, 1], [0.5, 1]]], [[[1, 0.5], [1.5, 1]]], [[[1, 1.5], [0.5, 1]], [[1, 0.5], [1.5, 1]]], [[[1, 0.5], [1, 1.5]]], [[[1, 0.5], [0.5, 1]]], [[[0.5, 1], [1, 0.5]]], [[[1, 1.5], [1, 0.5]]], [[[0.5, 1], [1, 0.5]], [[1.5, 1], [1, 1.5]]], [[[1.5, 1], [1, 0.5]]], [[[0.5, 1], [1.5, 1]]], [[[1, 1.5], [1.5, 1]]], [[[0.5, 1], [1, 1.5]]], []];
function contours() {
var dx = 1, dy = 1, smooth = smoothLinear;
function contours2(values2, tz) {
return tz.map((value2) => contour(values2, value2));
}
function contour(values2, value2) {
var polygons = [], holes = [];
isorings(values2, value2, (ring) => {
smooth(ring, values2, value2);
if (area(ring) > 0)
polygons.push([ring]);
else
holes.push(ring);
});
holes.forEach((hole) => {
for (var i2 = 0, n2 = polygons.length, polygon; i2 < n2; ++i2) {
if (contains$1((polygon = polygons[i2])[0], hole) !== -1) {
polygon.push(hole);
return;
}
}
});
return {
type: "MultiPolygon",
value: value2,
coordinates: polygons
};
}
function isorings(values2, value2, callback) {
var fragmentByStart = new Array(), fragmentByEnd = new Array(), x2, y2, t02, t12, t22, t32;
x2 = y2 = -1;
t12 = values2[0] >= value2;
cases[t12 << 1].forEach(stitch2);
while (++x2 < dx - 1) {
t02 = t12, t12 = values2[x2 + 1] >= value2;
cases[t02 | t12 << 1].forEach(stitch2);
}
cases[t12 << 0].forEach(stitch2);
while (++y2 < dy - 1) {
x2 = -1;
t12 = values2[y2 * dx + dx] >= value2;
t22 = values2[y2 * dx] >= value2;
cases[t12 << 1 | t22 << 2].forEach(stitch2);
while (++x2 < dx - 1) {
t02 = t12, t12 = values2[y2 * dx + dx + x2 + 1] >= value2;
t32 = t22, t22 = values2[y2 * dx + x2 + 1] >= value2;
cases[t02 | t12 << 1 | t22 << 2 | t32 << 3].forEach(stitch2);
}
cases[t12 | t22 << 3].forEach(stitch2);
}
x2 = -1;
t22 = values2[y2 * dx] >= value2;
cases[t22 << 2].forEach(stitch2);
while (++x2 < dx - 1) {
t32 = t22, t22 = values2[y2 * dx + x2 + 1] >= value2;
cases[t22 << 2 | t32 << 3].forEach(stitch2);
}
cases[t22 << 3].forEach(stitch2);
function stitch2(line2) {
var start2 = [line2[0][0] + x2, line2[0][1] + y2], end2 = [line2[1][0] + x2, line2[1][1] + y2], startIndex = index2(start2), endIndex = index2(end2), f2, g2;
if (f2 = fragmentByEnd[startIndex]) {
if (g2 = fragmentByStart[endIndex]) {
delete fragmentByEnd[f2.end];
delete fragmentByStart[g2.start];
if (f2 === g2) {
f2.ring.push(end2);
callback(f2.ring);
} else {
fragmentByStart[f2.start] = fragmentByEnd[g2.end] = {
start: f2.start,
end: g2.end,
ring: f2.ring.concat(g2.ring)
};
}
} else {
delete fragmentByEnd[f2.end];
f2.ring.push(end2);
fragmentByEnd[f2.end = endIndex] = f2;
}
} else if (f2 = fragmentByStart[endIndex]) {
if (g2 = fragmentByEnd[startIndex]) {
delete fragmentByStart[f2.start];
delete fragmentByEnd[g2.end];
if (f2 === g2) {
f2.ring.push(end2);
callback(f2.ring);
} else {
fragmentByStart[g2.start] = fragmentByEnd[f2.end] = {
start: g2.start,
end: f2.end,
ring: g2.ring.concat(f2.ring)
};
}
} else {
delete fragmentByStart[f2.start];
f2.ring.unshift(start2);
fragmentByStart[f2.start = startIndex] = f2;
}
} else {
fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {
start: startIndex,
end: endIndex,
ring: [start2, end2]
};
}
}
}
function index2(point2) {
return point2[0] * 2 + point2[1] * (dx + 1) * 4;
}
function smoothLinear(ring, values2, value2) {
ring.forEach((point2) => {
var x2 = point2[0], y2 = point2[1], xt2 = x2 | 0, yt2 = y2 | 0, v0, v1 = values2[yt2 * dx + xt2];
if (x2 > 0 && x2 < dx && xt2 === x2) {
v0 = values2[yt2 * dx + xt2 - 1];
point2[0] = x2 + (value2 - v0) / (v1 - v0) - 0.5;
}
if (y2 > 0 && y2 < dy && yt2 === y2) {
v0 = values2[(yt2 - 1) * dx + xt2];
point2[1] = y2 + (value2 - v0) / (v1 - v0) - 0.5;
}
});
}
contours2.contour = contour;
contours2.size = function(_24) {
if (!arguments.length)
return [dx, dy];
var _0 = Math.floor(_24[0]), _1 = Math.floor(_24[1]);
if (!(_0 >= 0 && _1 >= 0))
error2("invalid size");
return dx = _0, dy = _1, contours2;
};
contours2.smooth = function(_24) {
return arguments.length ? (smooth = _24 ? smoothLinear : noop$3, contours2) : smooth === smoothLinear;
};
return contours2;
}
function area(ring) {
var i2 = 0, n2 = ring.length, area2 = ring[n2 - 1][1] * ring[0][0] - ring[n2 - 1][0] * ring[0][1];
while (++i2 < n2)
area2 += ring[i2 - 1][1] * ring[i2][0] - ring[i2 - 1][0] * ring[i2][1];
return area2;
}
function contains$1(ring, hole) {
var i2 = -1, n2 = hole.length, c2;
while (++i2 < n2)
if (c2 = ringContains(ring, hole[i2]))
return c2;
return 0;
}
function ringContains(ring, point2) {
var x2 = point2[0], y2 = point2[1], contains2 = -1;
for (var i2 = 0, n2 = ring.length, j2 = n2 - 1; i2 < n2; j2 = i2++) {
var pi2 = ring[i2], xi2 = pi2[0], yi2 = pi2[1], pj2 = ring[j2], xj2 = pj2[0], yj2 = pj2[1];
if (segmentContains(pi2, pj2, point2))
return 0;
if (yi2 > y2 !== yj2 > y2 && x2 < (xj2 - xi2) * (y2 - yi2) / (yj2 - yi2) + xi2)
contains2 = -contains2;
}
return contains2;
}
function segmentContains(a2, b2, c2) {
var i2;
return collinear$1(a2, b2, c2) && within(a2[i2 = +(a2[0] === b2[0])], c2[i2], b2[i2]);
}
function collinear$1(a2, b2, c2) {
return (b2[0] - a2[0]) * (c2[1] - a2[1]) === (c2[0] - a2[0]) * (b2[1] - a2[1]);
}
function within(p2, q2, r2) {
return p2 <= q2 && q2 <= r2 || r2 <= q2 && q2 <= p2;
}
function quantize(k2, nice2, zero2) {
return function(values2) {
var ex = extent(values2), start2 = zero2 ? Math.min(ex[0], 0) : ex[0], stop2 = ex[1], span2 = stop2 - start2, step = nice2 ? tickStep$1(start2, stop2, k2) : span2 / (k2 + 1);
return range$4(start2 + step, stop2, step);
};
}
function Isocontour(params2) {
Transform$1.call(this, null, params2);
}
Isocontour.Definition = {
"type": "Isocontour",
"metadata": {
"generates": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "thresholds",
"type": "number",
"array": true
}, {
"name": "levels",
"type": "number"
}, {
"name": "nice",
"type": "boolean",
"default": false
}, {
"name": "resolve",
"type": "enum",
"values": ["shared", "independent"],
"default": "independent"
}, {
"name": "zero",
"type": "boolean",
"default": true
}, {
"name": "smooth",
"type": "boolean",
"default": true
}, {
"name": "scale",
"type": "number",
"expr": true
}, {
"name": "translate",
"type": "number",
"array": true,
"expr": true
}, {
"name": "as",
"type": "string",
"null": true,
"default": "contour"
}]
};
inherits(Isocontour, Transform$1, {
transform(_24, pulse2) {
if (this.value && !pulse2.changed() && !_24.modified()) {
return pulse2.StopPropagation;
}
var out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), source2 = pulse2.materialize(pulse2.SOURCE).source, field2 = _24.field || identity$6, contour = contours().smooth(_24.smooth !== false), tz = _24.thresholds || levels(source2, field2, _24), as = _24.as === null ? null : _24.as || "contour", values2 = [];
source2.forEach((t5) => {
const grid = field2(t5);
const paths = contour.size([grid.width, grid.height])(grid.values, isArray$2(tz) ? tz : tz(grid.values));
transformPaths(paths, grid, t5, _24);
paths.forEach((p2) => {
values2.push(rederive(t5, ingest$1(as != null ? {
[as]: p2
} : p2)));
});
});
if (this.value)
out.rem = this.value;
this.value = out.source = out.add = values2;
return out;
}
});
function levels(values2, f2, _24) {
const q2 = quantize(_24.levels || 10, _24.nice, _24.zero !== false);
return _24.resolve !== "shared" ? q2 : q2(values2.map((t5) => max$4(f2(t5).values)));
}
function transformPaths(paths, grid, datum2, _24) {
let s2 = _24.scale || grid.scale, t5 = _24.translate || grid.translate;
if (isFunction(s2))
s2 = s2(datum2, _24);
if (isFunction(t5))
t5 = t5(datum2, _24);
if ((s2 === 1 || s2 == null) && !t5)
return;
const sx = (isNumber$1(s2) ? s2 : s2[0]) || 1, sy = (isNumber$1(s2) ? s2 : s2[1]) || 1, tx2 = t5 && t5[0] || 0, ty = t5 && t5[1] || 0;
paths.forEach(transform$3(grid, sx, sy, tx2, ty));
}
function transform$3(grid, sx, sy, tx2, ty) {
const x12 = grid.x1 || 0, y12 = grid.y1 || 0, flip2 = sx * sy < 0;
function transformPolygon(coordinates) {
coordinates.forEach(transformRing);
}
function transformRing(coordinates) {
if (flip2)
coordinates.reverse();
coordinates.forEach(transformPoint);
}
function transformPoint(coordinates) {
coordinates[0] = (coordinates[0] - x12) * sx + tx2;
coordinates[1] = (coordinates[1] - y12) * sy + ty;
}
return function(geometry) {
geometry.coordinates.forEach(transformPolygon);
return geometry;
};
}
function radius(bw, data2, f2) {
const v2 = bw >= 0 ? bw : estimateBandwidth(data2, f2);
return Math.round((Math.sqrt(4 * v2 * v2 + 1) - 1) / 2);
}
function number$3(_24) {
return isFunction(_24) ? _24 : constant$6(+_24);
}
function density2D() {
var x2 = (d2) => d2[0], y2 = (d2) => d2[1], weight = one$2, bandwidth2 = [-1, -1], dx = 960, dy = 500, k2 = 2;
function density(data2, counts) {
const rx = radius(bandwidth2[0], data2, x2) >> k2, ry = radius(bandwidth2[1], data2, y2) >> k2, ox = rx ? rx + 2 : 0, oy = ry ? ry + 2 : 0, n2 = 2 * ox + (dx >> k2), m2 = 2 * oy + (dy >> k2), values0 = new Float32Array(n2 * m2), values1 = new Float32Array(n2 * m2);
let values2 = values0;
data2.forEach((d2) => {
const xi2 = ox + (+x2(d2) >> k2), yi2 = oy + (+y2(d2) >> k2);
if (xi2 >= 0 && xi2 < n2 && yi2 >= 0 && yi2 < m2) {
values0[xi2 + yi2 * n2] += +weight(d2);
}
});
if (rx > 0 && ry > 0) {
blurX(n2, m2, values0, values1, rx);
blurY(n2, m2, values1, values0, ry);
blurX(n2, m2, values0, values1, rx);
blurY(n2, m2, values1, values0, ry);
blurX(n2, m2, values0, values1, rx);
blurY(n2, m2, values1, values0, ry);
} else if (rx > 0) {
blurX(n2, m2, values0, values1, rx);
blurX(n2, m2, values1, values0, rx);
blurX(n2, m2, values0, values1, rx);
values2 = values1;
} else if (ry > 0) {
blurY(n2, m2, values0, values1, ry);
blurY(n2, m2, values1, values0, ry);
blurY(n2, m2, values0, values1, ry);
values2 = values1;
}
const s2 = counts ? Math.pow(2, -2 * k2) : 1 / sum$1(values2);
for (let i2 = 0, sz2 = n2 * m2; i2 < sz2; ++i2)
values2[i2] *= s2;
return {
values: values2,
scale: 1 << k2,
width: n2,
height: m2,
x1: ox,
y1: oy,
x2: ox + (dx >> k2),
y2: oy + (dy >> k2)
};
}
density.x = function(_24) {
return arguments.length ? (x2 = number$3(_24), density) : x2;
};
density.y = function(_24) {
return arguments.length ? (y2 = number$3(_24), density) : y2;
};
density.weight = function(_24) {
return arguments.length ? (weight = number$3(_24), density) : weight;
};
density.size = function(_24) {
if (!arguments.length)
return [dx, dy];
var _0 = +_24[0], _1 = +_24[1];
if (!(_0 >= 0 && _1 >= 0))
error2("invalid size");
return dx = _0, dy = _1, density;
};
density.cellSize = function(_24) {
if (!arguments.length)
return 1 << k2;
if (!((_24 = +_24) >= 1))
error2("invalid cell size");
k2 = Math.floor(Math.log(_24) / Math.LN2);
return density;
};
density.bandwidth = function(_24) {
if (!arguments.length)
return bandwidth2;
_24 = array$5(_24);
if (_24.length === 1)
_24 = [+_24[0], +_24[0]];
if (_24.length !== 2)
error2("invalid bandwidth");
return bandwidth2 = _24, density;
};
return density;
}
function blurX(n2, m2, source2, target2, r2) {
const w2 = (r2 << 1) + 1;
for (let j2 = 0; j2 < m2; ++j2) {
for (let i2 = 0, sr2 = 0; i2 < n2 + r2; ++i2) {
if (i2 < n2) {
sr2 += source2[i2 + j2 * n2];
}
if (i2 >= r2) {
if (i2 >= w2) {
sr2 -= source2[i2 - w2 + j2 * n2];
}
target2[i2 - r2 + j2 * n2] = sr2 / Math.min(i2 + 1, n2 - 1 + w2 - i2, w2);
}
}
}
}
function blurY(n2, m2, source2, target2, r2) {
const w2 = (r2 << 1) + 1;
for (let i2 = 0; i2 < n2; ++i2) {
for (let j2 = 0, sr2 = 0; j2 < m2 + r2; ++j2) {
if (j2 < m2) {
sr2 += source2[i2 + j2 * n2];
}
if (j2 >= r2) {
if (j2 >= w2) {
sr2 -= source2[i2 + (j2 - w2) * n2];
}
target2[i2 + (j2 - r2) * n2] = sr2 / Math.min(j2 + 1, m2 - 1 + w2 - j2, w2);
}
}
}
}
function KDE2D(params2) {
Transform$1.call(this, null, params2);
}
KDE2D.Definition = {
"type": "KDE2D",
"metadata": {
"generates": true
},
"params": [{
"name": "size",
"type": "number",
"array": true,
"length": 2,
"required": true
}, {
"name": "x",
"type": "field",
"required": true
}, {
"name": "y",
"type": "field",
"required": true
}, {
"name": "weight",
"type": "field"
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "cellSize",
"type": "number"
}, {
"name": "bandwidth",
"type": "number",
"array": true,
"length": 2
}, {
"name": "counts",
"type": "boolean",
"default": false
}, {
"name": "as",
"type": "string",
"default": "grid"
}]
};
const PARAMS = ["x", "y", "weight", "size", "cellSize", "bandwidth"];
function params(obj, _24) {
PARAMS.forEach((param2) => _24[param2] != null ? obj[param2](_24[param2]) : 0);
return obj;
}
inherits(KDE2D, Transform$1, {
transform(_24, pulse2) {
if (this.value && !pulse2.changed() && !_24.modified())
return pulse2.StopPropagation;
var out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition$2(source2, _24.groupby), names = (_24.groupby || []).map(accessorName), kde2 = params(density2D(), _24), as = _24.as || "grid", values2 = [];
function set2(t5, vals) {
for (let i2 = 0; i2 < names.length; ++i2)
t5[names[i2]] = vals[i2];
return t5;
}
values2 = groups.map((g2) => ingest$1(set2({
[as]: kde2(g2, _24.counts)
}, g2.dims)));
if (this.value)
out.rem = this.value;
this.value = out.source = out.add = values2;
return out;
}
});
function partition$2(data2, groupby) {
var groups = [], get2 = (f2) => f2(t5), map2, i2, n2, t5, k2, g2;
if (groupby == null) {
groups.push(data2);
} else {
for (map2 = {}, i2 = 0, n2 = data2.length; i2 < n2; ++i2) {
t5 = data2[i2];
k2 = groupby.map(get2);
g2 = map2[k2];
if (!g2) {
map2[k2] = g2 = [];
g2.dims = k2;
groups.push(g2);
}
g2.push(t5);
}
}
return groups;
}
function Contour(params2) {
Transform$1.call(this, null, params2);
}
Contour.Definition = {
"type": "Contour",
"metadata": {
"generates": true
},
"params": [{
"name": "size",
"type": "number",
"array": true,
"length": 2,
"required": true
}, {
"name": "values",
"type": "number",
"array": true
}, {
"name": "x",
"type": "field"
}, {
"name": "y",
"type": "field"
}, {
"name": "weight",
"type": "field"
}, {
"name": "cellSize",
"type": "number"
}, {
"name": "bandwidth",
"type": "number"
}, {
"name": "count",
"type": "number"
}, {
"name": "nice",
"type": "boolean",
"default": false
}, {
"name": "thresholds",
"type": "number",
"array": true
}, {
"name": "smooth",
"type": "boolean",
"default": true
}]
};
inherits(Contour, Transform$1, {
transform(_24, pulse2) {
if (this.value && !pulse2.changed() && !_24.modified()) {
return pulse2.StopPropagation;
}
var out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS), contour = contours().smooth(_24.smooth !== false), values2 = _24.values, thresh = _24.thresholds || quantize(_24.count || 10, _24.nice, !!values2), size = _24.size, grid, post;
if (!values2) {
values2 = pulse2.materialize(pulse2.SOURCE).source;
grid = params(density2D(), _24)(values2, true);
post = transform$3(grid, grid.scale || 1, grid.scale || 1, 0, 0);
size = [grid.width, grid.height];
values2 = grid.values;
}
thresh = isArray$2(thresh) ? thresh : thresh(values2);
values2 = contour.size(size)(values2, thresh);
if (post)
values2.forEach(post);
if (this.value)
out.rem = this.value;
this.value = out.source = out.add = (values2 || []).map(ingest$1);
return out;
}
});
const Feature = "Feature";
const FeatureCollection = "FeatureCollection";
const MultiPoint = "MultiPoint";
function GeoJSON(params2) {
Transform$1.call(this, null, params2);
}
GeoJSON.Definition = {
"type": "GeoJSON",
"metadata": {},
"params": [{
"name": "fields",
"type": "field",
"array": true,
"length": 2
}, {
"name": "geojson",
"type": "field"
}]
};
inherits(GeoJSON, Transform$1, {
transform(_24, pulse2) {
var features2 = this._features, points2 = this._points, fields = _24.fields, lon = fields && fields[0], lat = fields && fields[1], geojson = _24.geojson || !fields && identity$6, flag2 = pulse2.ADD, mod;
mod = _24.modified() || pulse2.changed(pulse2.REM) || pulse2.modified(accessorFields(geojson)) || lon && pulse2.modified(accessorFields(lon)) || lat && pulse2.modified(accessorFields(lat));
if (!this.value || mod) {
flag2 = pulse2.SOURCE;
this._features = features2 = [];
this._points = points2 = [];
}
if (geojson) {
pulse2.visit(flag2, (t5) => features2.push(geojson(t5)));
}
if (lon && lat) {
pulse2.visit(flag2, (t5) => {
var x2 = lon(t5), y2 = lat(t5);
if (x2 != null && y2 != null && (x2 = +x2) === x2 && (y2 = +y2) === y2) {
points2.push([x2, y2]);
}
});
features2 = features2.concat({
type: Feature,
geometry: {
type: MultiPoint,
coordinates: points2
}
});
}
this.value = {
type: FeatureCollection,
features: features2
};
}
});
function GeoPath(params2) {
Transform$1.call(this, null, params2);
}
GeoPath.Definition = {
"type": "GeoPath",
"metadata": {
"modifies": true
},
"params": [{
"name": "projection",
"type": "projection"
}, {
"name": "field",
"type": "field"
}, {
"name": "pointRadius",
"type": "number",
"expr": true
}, {
"name": "as",
"type": "string",
"default": "path"
}]
};
inherits(GeoPath, Transform$1, {
transform(_24, pulse2) {
var out = pulse2.fork(pulse2.ALL), path2 = this.value, field2 = _24.field || identity$6, as = _24.as || "path", flag2 = out.SOURCE;
if (!path2 || _24.modified()) {
this.value = path2 = getProjectionPath(_24.projection);
out.materialize().reflow();
} else {
flag2 = field2 === identity$6 || pulse2.modified(field2.fields) ? out.ADD_MOD : out.ADD;
}
const prev2 = initPath(path2, _24.pointRadius);
out.visit(flag2, (t5) => t5[as] = path2(field2(t5)));
path2.pointRadius(prev2);
return out.modifies(as);
}
});
function initPath(path2, pointRadius) {
const prev2 = path2.pointRadius();
path2.context(null);
if (pointRadius != null) {
path2.pointRadius(pointRadius);
}
return prev2;
}
function GeoPoint(params2) {
Transform$1.call(this, null, params2);
}
GeoPoint.Definition = {
"type": "GeoPoint",
"metadata": {
"modifies": true
},
"params": [{
"name": "projection",
"type": "projection",
"required": true
}, {
"name": "fields",
"type": "field",
"array": true,
"required": true,
"length": 2
}, {
"name": "as",
"type": "string",
"array": true,
"length": 2,
"default": ["x", "y"]
}]
};
inherits(GeoPoint, Transform$1, {
transform(_24, pulse2) {
var proj = _24.projection, lon = _24.fields[0], lat = _24.fields[1], as = _24.as || ["x", "y"], x2 = as[0], y2 = as[1], mod;
function set2(t5) {
const xy = proj([lon(t5), lat(t5)]);
if (xy) {
t5[x2] = xy[0];
t5[y2] = xy[1];
} else {
t5[x2] = void 0;
t5[y2] = void 0;
}
}
if (_24.modified()) {
pulse2 = pulse2.materialize().reflow(true).visit(pulse2.SOURCE, set2);
} else {
mod = pulse2.modified(lon.fields) || pulse2.modified(lat.fields);
pulse2.visit(mod ? pulse2.ADD_MOD : pulse2.ADD, set2);
}
return pulse2.modifies(as);
}
});
function GeoShape(params2) {
Transform$1.call(this, null, params2);
}
GeoShape.Definition = {
"type": "GeoShape",
"metadata": {
"modifies": true,
"nomod": true
},
"params": [{
"name": "projection",
"type": "projection"
}, {
"name": "field",
"type": "field",
"default": "datum"
}, {
"name": "pointRadius",
"type": "number",
"expr": true
}, {
"name": "as",
"type": "string",
"default": "shape"
}]
};
inherits(GeoShape, Transform$1, {
transform(_24, pulse2) {
var out = pulse2.fork(pulse2.ALL), shape2 = this.value, as = _24.as || "shape", flag2 = out.ADD;
if (!shape2 || _24.modified()) {
this.value = shape2 = shapeGenerator(getProjectionPath(_24.projection), _24.field || field$1("datum"), _24.pointRadius);
out.materialize().reflow();
flag2 = out.SOURCE;
}
out.visit(flag2, (t5) => t5[as] = shape2);
return out.modifies(as);
}
});
function shapeGenerator(path2, field2, pointRadius) {
const shape2 = pointRadius == null ? (_24) => path2(field2(_24)) : (_24) => {
var prev2 = path2.pointRadius(), value2 = path2.pointRadius(pointRadius)(field2(_24));
path2.pointRadius(prev2);
return value2;
};
shape2.context = (_24) => {
path2.context(_24);
return shape2;
};
return shape2;
}
function Graticule(params2) {
Transform$1.call(this, [], params2);
this.generator = graticule();
}
Graticule.Definition = {
"type": "Graticule",
"metadata": {
"changes": true,
"generates": true
},
"params": [{
"name": "extent",
"type": "array",
"array": true,
"length": 2,
"content": {
"type": "number",
"array": true,
"length": 2
}
}, {
"name": "extentMajor",
"type": "array",
"array": true,
"length": 2,
"content": {
"type": "number",
"array": true,
"length": 2
}
}, {
"name": "extentMinor",
"type": "array",
"array": true,
"length": 2,
"content": {
"type": "number",
"array": true,
"length": 2
}
}, {
"name": "step",
"type": "number",
"array": true,
"length": 2
}, {
"name": "stepMajor",
"type": "number",
"array": true,
"length": 2,
"default": [90, 360]
}, {
"name": "stepMinor",
"type": "number",
"array": true,
"length": 2,
"default": [10, 10]
}, {
"name": "precision",
"type": "number",
"default": 2.5
}]
};
inherits(Graticule, Transform$1, {
transform(_24, pulse2) {
var src = this.value, gen = this.generator, t5;
if (!src.length || _24.modified()) {
for (const prop in _24) {
if (isFunction(gen[prop])) {
gen[prop](_24[prop]);
}
}
}
t5 = gen();
if (src.length) {
pulse2.mod.push(replace$5(src[0], t5));
} else {
pulse2.add.push(ingest$1(t5));
}
src[0] = t5;
return pulse2;
}
});
function Heatmap(params2) {
Transform$1.call(this, null, params2);
}
Heatmap.Definition = {
"type": "heatmap",
"metadata": {
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "color",
"type": "string",
"expr": true
}, {
"name": "opacity",
"type": "number",
"expr": true
}, {
"name": "resolve",
"type": "enum",
"values": ["shared", "independent"],
"default": "independent"
}, {
"name": "as",
"type": "string",
"default": "image"
}]
};
inherits(Heatmap, Transform$1, {
transform(_24, pulse2) {
if (!pulse2.changed() && !_24.modified()) {
return pulse2.StopPropagation;
}
var source2 = pulse2.materialize(pulse2.SOURCE).source, shared2 = _24.resolve === "shared", field2 = _24.field || identity$6, opacity2 = opacity_(_24.opacity, _24), color2 = color_(_24.color, _24), as = _24.as || "image", obj = {
$x: 0,
$y: 0,
$value: 0,
$max: shared2 ? max$4(source2.map((t5) => max$4(field2(t5).values))) : 0
};
source2.forEach((t5) => {
const v2 = field2(t5);
const o2 = extend$2({}, t5, obj);
if (!shared2)
o2.$max = max$4(v2.values || []);
t5[as] = toCanvas(v2, o2, color2.dep ? color2 : constant$6(color2(o2)), opacity2.dep ? opacity2 : constant$6(opacity2(o2)));
});
return pulse2.reflow(true).modifies(as);
}
});
function color_(color2, _24) {
let f2;
if (isFunction(color2)) {
f2 = (obj) => rgb$3(color2(obj, _24));
f2.dep = dependency(color2);
} else {
f2 = constant$6(rgb$3(color2 || "#888"));
}
return f2;
}
function opacity_(opacity2, _24) {
let f2;
if (isFunction(opacity2)) {
f2 = (obj) => opacity2(obj, _24);
f2.dep = dependency(opacity2);
} else if (opacity2) {
f2 = constant$6(opacity2);
} else {
f2 = (obj) => obj.$value / obj.$max || 0;
f2.dep = true;
}
return f2;
}
function dependency(f2) {
if (!isFunction(f2))
return false;
const set2 = toSet(accessorFields(f2));
return set2.$x || set2.$y || set2.$value || set2.$max;
}
function toCanvas(grid, obj, color2, opacity2) {
const n2 = grid.width, m2 = grid.height, x12 = grid.x1 || 0, y12 = grid.y1 || 0, x2 = grid.x2 || n2, y2 = grid.y2 || m2, val = grid.values, value2 = val ? (i2) => val[i2] : zero$7, can = domCanvas(x2 - x12, y2 - y12), ctx = can.getContext("2d"), img = ctx.getImageData(0, 0, x2 - x12, y2 - y12), pix = img.data;
for (let j2 = y12, k2 = 0; j2 < y2; ++j2) {
obj.$y = j2 - y12;
for (let i2 = x12, r2 = j2 * n2; i2 < x2; ++i2, k2 += 4) {
obj.$x = i2 - x12;
obj.$value = value2(i2 + r2);
const v2 = color2(obj);
pix[k2 + 0] = v2.r;
pix[k2 + 1] = v2.g;
pix[k2 + 2] = v2.b;
pix[k2 + 3] = ~~(255 * opacity2(obj));
}
}
ctx.putImageData(img, 0, 0);
return can;
}
function Projection$1(params2) {
Transform$1.call(this, null, params2);
this.modified(true);
}
inherits(Projection$1, Transform$1, {
transform(_24, pulse2) {
let proj = this.value;
if (!proj || _24.modified("type")) {
this.value = proj = create$4(_24.type);
projectionProperties.forEach((prop) => {
if (_24[prop] != null)
set$4(proj, prop, _24[prop]);
});
} else {
projectionProperties.forEach((prop) => {
if (_24.modified(prop))
set$4(proj, prop, _24[prop]);
});
}
if (_24.pointRadius != null)
proj.path.pointRadius(_24.pointRadius);
if (_24.fit)
fit(proj, _24);
return pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
}
});
function fit(proj, _24) {
const data2 = collectGeoJSON(_24.fit);
_24.extent ? proj.fitExtent(_24.extent, data2) : _24.size ? proj.fitSize(_24.size, data2) : 0;
}
function create$4(type2) {
const constructor = projection((type2 || "mercator").toLowerCase());
if (!constructor)
error2("Unrecognized projection type: " + type2);
return constructor();
}
function set$4(proj, key2, value2) {
if (isFunction(proj[key2]))
proj[key2](value2);
}
function collectGeoJSON(data2) {
data2 = array$5(data2);
return data2.length === 1 ? data2[0] : {
type: FeatureCollection,
features: data2.reduce((a2, f2) => a2.concat(featurize(f2)), [])
};
}
function featurize(f2) {
return f2.type === FeatureCollection ? f2.features : array$5(f2).filter((d2) => d2 != null).map((d2) => d2.type === Feature ? d2 : {
type: Feature,
geometry: d2
});
}
const geo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
contour: Contour,
geojson: GeoJSON,
geopath: GeoPath,
geopoint: GeoPoint,
geoshape: GeoShape,
graticule: Graticule,
heatmap: Heatmap,
isocontour: Isocontour,
kde2d: KDE2D,
projection: Projection$1
}, Symbol.toStringTag, { value: "Module" }));
function forceCenter(x2, y2) {
var nodes, strength = 1;
if (x2 == null)
x2 = 0;
if (y2 == null)
y2 = 0;
function force2() {
var i2, n2 = nodes.length, node2, sx = 0, sy = 0;
for (i2 = 0; i2 < n2; ++i2) {
node2 = nodes[i2], sx += node2.x, sy += node2.y;
}
for (sx = (sx / n2 - x2) * strength, sy = (sy / n2 - y2) * strength, i2 = 0; i2 < n2; ++i2) {
node2 = nodes[i2], node2.x -= sx, node2.y -= sy;
}
}
force2.initialize = function(_24) {
nodes = _24;
};
force2.x = function(_24) {
return arguments.length ? (x2 = +_24, force2) : x2;
};
force2.y = function(_24) {
return arguments.length ? (y2 = +_24, force2) : y2;
};
force2.strength = function(_24) {
return arguments.length ? (strength = +_24, force2) : strength;
};
return force2;
}
function tree_add(d2) {
const x2 = +this._x.call(null, d2), y2 = +this._y.call(null, d2);
return add2(this.cover(x2, y2), x2, y2, d2);
}
function add2(tree2, x2, y2, d2) {
if (isNaN(x2) || isNaN(y2))
return tree2;
var parent, node2 = tree2._root, leaf = { data: d2 }, x02 = tree2._x0, y02 = tree2._y0, x12 = tree2._x1, y12 = tree2._y1, xm, ym, xp, yp, right2, bottom2, i2, j2;
if (!node2)
return tree2._root = leaf, tree2;
while (node2.length) {
if (right2 = x2 >= (xm = (x02 + x12) / 2))
x02 = xm;
else
x12 = xm;
if (bottom2 = y2 >= (ym = (y02 + y12) / 2))
y02 = ym;
else
y12 = ym;
if (parent = node2, !(node2 = node2[i2 = bottom2 << 1 | right2]))
return parent[i2] = leaf, tree2;
}
xp = +tree2._x.call(null, node2.data);
yp = +tree2._y.call(null, node2.data);
if (x2 === xp && y2 === yp)
return leaf.next = node2, parent ? parent[i2] = leaf : tree2._root = leaf, tree2;
do {
parent = parent ? parent[i2] = new Array(4) : tree2._root = new Array(4);
if (right2 = x2 >= (xm = (x02 + x12) / 2))
x02 = xm;
else
x12 = xm;
if (bottom2 = y2 >= (ym = (y02 + y12) / 2))
y02 = ym;
else
y12 = ym;
} while ((i2 = bottom2 << 1 | right2) === (j2 = (yp >= ym) << 1 | xp >= xm));
return parent[j2] = node2, parent[i2] = leaf, tree2;
}
function addAll(data2) {
var d2, i2, n2 = data2.length, x2, y2, xz = new Array(n2), yz = new Array(n2), x02 = Infinity, y02 = Infinity, x12 = -Infinity, y12 = -Infinity;
for (i2 = 0; i2 < n2; ++i2) {
if (isNaN(x2 = +this._x.call(null, d2 = data2[i2])) || isNaN(y2 = +this._y.call(null, d2)))
continue;
xz[i2] = x2;
yz[i2] = y2;
if (x2 < x02)
x02 = x2;
if (x2 > x12)
x12 = x2;
if (y2 < y02)
y02 = y2;
if (y2 > y12)
y12 = y2;
}
if (x02 > x12 || y02 > y12)
return this;
this.cover(x02, y02).cover(x12, y12);
for (i2 = 0; i2 < n2; ++i2) {
add2(this, xz[i2], yz[i2], data2[i2]);
}
return this;
}
function tree_cover(x2, y2) {
if (isNaN(x2 = +x2) || isNaN(y2 = +y2))
return this;
var x02 = this._x0, y02 = this._y0, x12 = this._x1, y12 = this._y1;
if (isNaN(x02)) {
x12 = (x02 = Math.floor(x2)) + 1;
y12 = (y02 = Math.floor(y2)) + 1;
} else {
var z2 = x12 - x02 || 1, node2 = this._root, parent, i2;
while (x02 > x2 || x2 >= x12 || y02 > y2 || y2 >= y12) {
i2 = (y2 < y02) << 1 | x2 < x02;
parent = new Array(4), parent[i2] = node2, node2 = parent, z2 *= 2;
switch (i2) {
case 0:
x12 = x02 + z2, y12 = y02 + z2;
break;
case 1:
x02 = x12 - z2, y12 = y02 + z2;
break;
case 2:
x12 = x02 + z2, y02 = y12 - z2;
break;
case 3:
x02 = x12 - z2, y02 = y12 - z2;
break;
}
}
if (this._root && this._root.length)
this._root = node2;
}
this._x0 = x02;
this._y0 = y02;
this._x1 = x12;
this._y1 = y12;
return this;
}
function tree_data() {
var data2 = [];
this.visit(function(node2) {
if (!node2.length)
do
data2.push(node2.data);
while (node2 = node2.next);
});
return data2;
}
function tree_extent(_24) {
return arguments.length ? this.cover(+_24[0][0], +_24[0][1]).cover(+_24[1][0], +_24[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
}
function Quad(node2, x02, y02, x12, y12) {
this.node = node2;
this.x0 = x02;
this.y0 = y02;
this.x1 = x12;
this.y1 = y12;
}
function tree_find(x2, y2, radius2) {
var data2, x02 = this._x0, y02 = this._y0, x12, y12, x22, y22, x3 = this._x1, y3 = this._y1, quads = [], node2 = this._root, q2, i2;
if (node2)
quads.push(new Quad(node2, x02, y02, x3, y3));
if (radius2 == null)
radius2 = Infinity;
else {
x02 = x2 - radius2, y02 = y2 - radius2;
x3 = x2 + radius2, y3 = y2 + radius2;
radius2 *= radius2;
}
while (q2 = quads.pop()) {
if (!(node2 = q2.node) || (x12 = q2.x0) > x3 || (y12 = q2.y0) > y3 || (x22 = q2.x1) < x02 || (y22 = q2.y1) < y02)
continue;
if (node2.length) {
var xm = (x12 + x22) / 2, ym = (y12 + y22) / 2;
quads.push(
new Quad(node2[3], xm, ym, x22, y22),
new Quad(node2[2], x12, ym, xm, y22),
new Quad(node2[1], xm, y12, x22, ym),
new Quad(node2[0], x12, y12, xm, ym)
);
if (i2 = (y2 >= ym) << 1 | x2 >= xm) {
q2 = quads[quads.length - 1];
quads[quads.length - 1] = quads[quads.length - 1 - i2];
quads[quads.length - 1 - i2] = q2;
}
} else {
var dx = x2 - +this._x.call(null, node2.data), dy = y2 - +this._y.call(null, node2.data), d2 = dx * dx + dy * dy;
if (d2 < radius2) {
var d3 = Math.sqrt(radius2 = d2);
x02 = x2 - d3, y02 = y2 - d3;
x3 = x2 + d3, y3 = y2 + d3;
data2 = node2.data;
}
}
}
return data2;
}
function tree_remove(d2) {
if (isNaN(x2 = +this._x.call(null, d2)) || isNaN(y2 = +this._y.call(null, d2)))
return this;
var parent, node2 = this._root, retainer, previous, next2, x02 = this._x0, y02 = this._y0, x12 = this._x1, y12 = this._y1, x2, y2, xm, ym, right2, bottom2, i2, j2;
if (!node2)
return this;
if (node2.length)
while (true) {
if (right2 = x2 >= (xm = (x02 + x12) / 2))
x02 = xm;
else
x12 = xm;
if (bottom2 = y2 >= (ym = (y02 + y12) / 2))
y02 = ym;
else
y12 = ym;
if (!(parent = node2, node2 = node2[i2 = bottom2 << 1 | right2]))
return this;
if (!node2.length)
break;
if (parent[i2 + 1 & 3] || parent[i2 + 2 & 3] || parent[i2 + 3 & 3])
retainer = parent, j2 = i2;
}
while (node2.data !== d2)
if (!(previous = node2, node2 = node2.next))
return this;
if (next2 = node2.next)
delete node2.next;
if (previous)
return next2 ? previous.next = next2 : delete previous.next, this;
if (!parent)
return this._root = next2, this;
next2 ? parent[i2] = next2 : delete parent[i2];
if ((node2 = parent[0] || parent[1] || parent[2] || parent[3]) && node2 === (parent[3] || parent[2] || parent[1] || parent[0]) && !node2.length) {
if (retainer)
retainer[j2] = node2;
else
this._root = node2;
}
return this;
}
function removeAll(data2) {
for (var i2 = 0, n2 = data2.length; i2 < n2; ++i2)
this.remove(data2[i2]);
return this;
}
function tree_root() {
return this._root;
}
function tree_size() {
var size = 0;
this.visit(function(node2) {
if (!node2.length)
do
++size;
while (node2 = node2.next);
});
return size;
}
function tree_visit(callback) {
var quads = [], q2, node2 = this._root, child, x02, y02, x12, y12;
if (node2)
quads.push(new Quad(node2, this._x0, this._y0, this._x1, this._y1));
while (q2 = quads.pop()) {
if (!callback(node2 = q2.node, x02 = q2.x0, y02 = q2.y0, x12 = q2.x1, y12 = q2.y1) && node2.length) {
var xm = (x02 + x12) / 2, ym = (y02 + y12) / 2;
if (child = node2[3])
quads.push(new Quad(child, xm, ym, x12, y12));
if (child = node2[2])
quads.push(new Quad(child, x02, ym, xm, y12));
if (child = node2[1])
quads.push(new Quad(child, xm, y02, x12, ym));
if (child = node2[0])
quads.push(new Quad(child, x02, y02, xm, ym));
}
}
return this;
}
function tree_visitAfter(callback) {
var quads = [], next2 = [], q2;
if (this._root)
quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));
while (q2 = quads.pop()) {
var node2 = q2.node;
if (node2.length) {
var child, x02 = q2.x0, y02 = q2.y0, x12 = q2.x1, y12 = q2.y1, xm = (x02 + x12) / 2, ym = (y02 + y12) / 2;
if (child = node2[0])
quads.push(new Quad(child, x02, y02, xm, ym));
if (child = node2[1])
quads.push(new Quad(child, xm, y02, x12, ym));
if (child = node2[2])
quads.push(new Quad(child, x02, ym, xm, y12));
if (child = node2[3])
quads.push(new Quad(child, xm, ym, x12, y12));
}
next2.push(q2);
}
while (q2 = next2.pop()) {
callback(q2.node, q2.x0, q2.y0, q2.x1, q2.y1);
}
return this;
}
function defaultX(d2) {
return d2[0];
}
function tree_x(_24) {
return arguments.length ? (this._x = _24, this) : this._x;
}
function defaultY(d2) {
return d2[1];
}
function tree_y(_24) {
return arguments.length ? (this._y = _24, this) : this._y;
}
function quadtree(nodes, x2, y2) {
var tree2 = new Quadtree(x2 == null ? defaultX : x2, y2 == null ? defaultY : y2, NaN, NaN, NaN, NaN);
return nodes == null ? tree2 : tree2.addAll(nodes);
}
function Quadtree(x2, y2, x02, y02, x12, y12) {
this._x = x2;
this._y = y2;
this._x0 = x02;
this._y0 = y02;
this._x1 = x12;
this._y1 = y12;
this._root = void 0;
}
function leaf_copy(leaf) {
var copy2 = { data: leaf.data }, next2 = copy2;
while (leaf = leaf.next)
next2 = next2.next = { data: leaf.data };
return copy2;
}
var treeProto = quadtree.prototype = Quadtree.prototype;
treeProto.copy = function() {
var copy2 = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), node2 = this._root, nodes, child;
if (!node2)
return copy2;
if (!node2.length)
return copy2._root = leaf_copy(node2), copy2;
nodes = [{ source: node2, target: copy2._root = new Array(4) }];
while (node2 = nodes.pop()) {
for (var i2 = 0; i2 < 4; ++i2) {
if (child = node2.source[i2]) {
if (child.length)
nodes.push({ source: child, target: node2.target[i2] = new Array(4) });
else
node2.target[i2] = leaf_copy(child);
}
}
}
return copy2;
};
treeProto.add = tree_add;
treeProto.addAll = addAll;
treeProto.cover = tree_cover;
treeProto.data = tree_data;
treeProto.extent = tree_extent;
treeProto.find = tree_find;
treeProto.remove = tree_remove;
treeProto.removeAll = removeAll;
treeProto.root = tree_root;
treeProto.size = tree_size;
treeProto.visit = tree_visit;
treeProto.visitAfter = tree_visitAfter;
treeProto.x = tree_x;
treeProto.y = tree_y;
function constant$2(x2) {
return function() {
return x2;
};
}
function jiggle(random2) {
return (random2() - 0.5) * 1e-6;
}
function x$4(d2) {
return d2.x + d2.vx;
}
function y$6(d2) {
return d2.y + d2.vy;
}
function forceCollide(radius2) {
var nodes, radii, random2, strength = 1, iterations2 = 1;
if (typeof radius2 !== "function")
radius2 = constant$2(radius2 == null ? 1 : +radius2);
function force2() {
var i2, n2 = nodes.length, tree2, node2, xi2, yi2, ri2, ri22;
for (var k2 = 0; k2 < iterations2; ++k2) {
tree2 = quadtree(nodes, x$4, y$6).visitAfter(prepare2);
for (i2 = 0; i2 < n2; ++i2) {
node2 = nodes[i2];
ri2 = radii[node2.index], ri22 = ri2 * ri2;
xi2 = node2.x + node2.vx;
yi2 = node2.y + node2.vy;
tree2.visit(apply2);
}
}
function apply2(quad2, x02, y02, x12, y12) {
var data2 = quad2.data, rj2 = quad2.r, r2 = ri2 + rj2;
if (data2) {
if (data2.index > node2.index) {
var x2 = xi2 - data2.x - data2.vx, y2 = yi2 - data2.y - data2.vy, l2 = x2 * x2 + y2 * y2;
if (l2 < r2 * r2) {
if (x2 === 0)
x2 = jiggle(random2), l2 += x2 * x2;
if (y2 === 0)
y2 = jiggle(random2), l2 += y2 * y2;
l2 = (r2 - (l2 = Math.sqrt(l2))) / l2 * strength;
node2.vx += (x2 *= l2) * (r2 = (rj2 *= rj2) / (ri22 + rj2));
node2.vy += (y2 *= l2) * r2;
data2.vx -= x2 * (r2 = 1 - r2);
data2.vy -= y2 * r2;
}
}
return;
}
return x02 > xi2 + r2 || x12 < xi2 - r2 || y02 > yi2 + r2 || y12 < yi2 - r2;
}
}
function prepare2(quad2) {
if (quad2.data)
return quad2.r = radii[quad2.data.index];
for (var i2 = quad2.r = 0; i2 < 4; ++i2) {
if (quad2[i2] && quad2[i2].r > quad2.r) {
quad2.r = quad2[i2].r;
}
}
}
function initialize2() {
if (!nodes)
return;
var i2, n2 = nodes.length, node2;
radii = new Array(n2);
for (i2 = 0; i2 < n2; ++i2)
node2 = nodes[i2], radii[node2.index] = +radius2(node2, i2, nodes);
}
force2.initialize = function(_nodes, _random) {
nodes = _nodes;
random2 = _random;
initialize2();
};
force2.iterations = function(_24) {
return arguments.length ? (iterations2 = +_24, force2) : iterations2;
};
force2.strength = function(_24) {
return arguments.length ? (strength = +_24, force2) : strength;
};
force2.radius = function(_24) {
return arguments.length ? (radius2 = typeof _24 === "function" ? _24 : constant$2(+_24), initialize2(), force2) : radius2;
};
return force2;
}
function index$2(d2) {
return d2.index;
}
function find$1(nodeById, nodeId) {
var node2 = nodeById.get(nodeId);
if (!node2)
throw new Error("node not found: " + nodeId);
return node2;
}
function forceLink(links) {
var id = index$2, strength = defaultStrength, strengths, distance2 = constant$2(30), distances, nodes, count2, bias, random2, iterations2 = 1;
if (links == null)
links = [];
function defaultStrength(link2) {
return 1 / Math.min(count2[link2.source.index], count2[link2.target.index]);
}
function force2(alpha) {
for (var k2 = 0, n2 = links.length; k2 < iterations2; ++k2) {
for (var i2 = 0, link2, source2, target2, x2, y2, l2, b2; i2 < n2; ++i2) {
link2 = links[i2], source2 = link2.source, target2 = link2.target;
x2 = target2.x + target2.vx - source2.x - source2.vx || jiggle(random2);
y2 = target2.y + target2.vy - source2.y - source2.vy || jiggle(random2);
l2 = Math.sqrt(x2 * x2 + y2 * y2);
l2 = (l2 - distances[i2]) / l2 * alpha * strengths[i2];
x2 *= l2, y2 *= l2;
target2.vx -= x2 * (b2 = bias[i2]);
target2.vy -= y2 * b2;
source2.vx += x2 * (b2 = 1 - b2);
source2.vy += y2 * b2;
}
}
}
function initialize2() {
if (!nodes)
return;
var i2, n2 = nodes.length, m2 = links.length, nodeById = new Map(nodes.map((d2, i3) => [id(d2, i3, nodes), d2])), link2;
for (i2 = 0, count2 = new Array(n2); i2 < m2; ++i2) {
link2 = links[i2], link2.index = i2;
if (typeof link2.source !== "object")
link2.source = find$1(nodeById, link2.source);
if (typeof link2.target !== "object")
link2.target = find$1(nodeById, link2.target);
count2[link2.source.index] = (count2[link2.source.index] || 0) + 1;
count2[link2.target.index] = (count2[link2.target.index] || 0) + 1;
}
for (i2 = 0, bias = new Array(m2); i2 < m2; ++i2) {
link2 = links[i2], bias[i2] = count2[link2.source.index] / (count2[link2.source.index] + count2[link2.target.index]);
}
strengths = new Array(m2), initializeStrength();
distances = new Array(m2), initializeDistance();
}
function initializeStrength() {
if (!nodes)
return;
for (var i2 = 0, n2 = links.length; i2 < n2; ++i2) {
strengths[i2] = +strength(links[i2], i2, links);
}
}
function initializeDistance() {
if (!nodes)
return;
for (var i2 = 0, n2 = links.length; i2 < n2; ++i2) {
distances[i2] = +distance2(links[i2], i2, links);
}
}
force2.initialize = function(_nodes, _random) {
nodes = _nodes;
random2 = _random;
initialize2();
};
force2.links = function(_24) {
return arguments.length ? (links = _24, initialize2(), force2) : links;
};
force2.id = function(_24) {
return arguments.length ? (id = _24, force2) : id;
};
force2.iterations = function(_24) {
return arguments.length ? (iterations2 = +_24, force2) : iterations2;
};
force2.strength = function(_24) {
return arguments.length ? (strength = typeof _24 === "function" ? _24 : constant$2(+_24), initializeStrength(), force2) : strength;
};
force2.distance = function(_24) {
return arguments.length ? (distance2 = typeof _24 === "function" ? _24 : constant$2(+_24), initializeDistance(), force2) : distance2;
};
return force2;
}
var noop$2 = { value: () => {
} };
function dispatch() {
for (var i2 = 0, n2 = arguments.length, _24 = {}, t5; i2 < n2; ++i2) {
if (!(t5 = arguments[i2] + "") || t5 in _24 || /[\s.]/.test(t5))
throw new Error("illegal type: " + t5);
_24[t5] = [];
}
return new Dispatch$1(_24);
}
function Dispatch$1(_24) {
this._ = _24;
}
function parseTypenames(typenames, types2) {
return typenames.trim().split(/^|\s+/).map(function(t5) {
var name = "", i2 = t5.indexOf(".");
if (i2 >= 0)
name = t5.slice(i2 + 1), t5 = t5.slice(0, i2);
if (t5 && !types2.hasOwnProperty(t5))
throw new Error("unknown type: " + t5);
return { type: t5, name };
});
}
Dispatch$1.prototype = dispatch.prototype = {
constructor: Dispatch$1,
on: function(typename, callback) {
var _24 = this._, T2 = parseTypenames(typename + "", _24), t5, i2 = -1, n2 = T2.length;
if (arguments.length < 2) {
while (++i2 < n2)
if ((t5 = (typename = T2[i2]).type) && (t5 = get$1(_24[t5], typename.name)))
return t5;
return;
}
if (callback != null && typeof callback !== "function")
throw new Error("invalid callback: " + callback);
while (++i2 < n2) {
if (t5 = (typename = T2[i2]).type)
_24[t5] = set$3(_24[t5], typename.name, callback);
else if (callback == null)
for (t5 in _24)
_24[t5] = set$3(_24[t5], typename.name, null);
}
return this;
},
copy: function() {
var copy2 = {}, _24 = this._;
for (var t5 in _24)
copy2[t5] = _24[t5].slice();
return new Dispatch$1(copy2);
},
call: function(type2, that) {
if ((n2 = arguments.length - 2) > 0)
for (var args = new Array(n2), i2 = 0, n2, t5; i2 < n2; ++i2)
args[i2] = arguments[i2 + 2];
if (!this._.hasOwnProperty(type2))
throw new Error("unknown type: " + type2);
for (t5 = this._[type2], i2 = 0, n2 = t5.length; i2 < n2; ++i2)
t5[i2].value.apply(that, args);
},
apply: function(type2, that, args) {
if (!this._.hasOwnProperty(type2))
throw new Error("unknown type: " + type2);
for (var t5 = this._[type2], i2 = 0, n2 = t5.length; i2 < n2; ++i2)
t5[i2].value.apply(that, args);
}
};
function get$1(type2, name) {
for (var i2 = 0, n2 = type2.length, c2; i2 < n2; ++i2) {
if ((c2 = type2[i2]).name === name) {
return c2.value;
}
}
}
function set$3(type2, name, callback) {
for (var i2 = 0, n2 = type2.length; i2 < n2; ++i2) {
if (type2[i2].name === name) {
type2[i2] = noop$2, type2 = type2.slice(0, i2).concat(type2.slice(i2 + 1));
break;
}
}
if (callback != null)
type2.push({ name, value: callback });
return type2;
}
var frame = 0, timeout = 0, interval$1 = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f2) {
setTimeout(f2, 17);
};
function now$1() {
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
}
function clearNow() {
clockNow = 0;
}
function Timer$1() {
this._call = this._time = this._next = null;
}
Timer$1.prototype = timer$1.prototype = {
constructor: Timer$1,
restart: function(callback, delay, time2) {
if (typeof callback !== "function")
throw new TypeError("callback is not a function");
time2 = (time2 == null ? now$1() : +time2) + (delay == null ? 0 : +delay);
if (!this._next && taskTail !== this) {
if (taskTail)
taskTail._next = this;
else
taskHead = this;
taskTail = this;
}
this._call = callback;
this._time = time2;
sleep();
},
stop: function() {
if (this._call) {
this._call = null;
this._time = Infinity;
sleep();
}
}
};
function timer$1(callback, delay, time2) {
var t5 = new Timer$1();
t5.restart(callback, delay, time2);
return t5;
}
function timerFlush() {
now$1();
++frame;
var t5 = taskHead, e7;
while (t5) {
if ((e7 = clockNow - t5._time) >= 0)
t5._call.call(void 0, e7);
t5 = t5._next;
}
--frame;
}
function wake() {
clockNow = (clockLast = clock.now()) + clockSkew;
frame = timeout = 0;
try {
timerFlush();
} finally {
frame = 0;
nap();
clockNow = 0;
}
}
function poke() {
var now2 = clock.now(), delay = now2 - clockLast;
if (delay > pokeDelay)
clockSkew -= delay, clockLast = now2;
}
function nap() {
var t02, t12 = taskHead, t22, time2 = Infinity;
while (t12) {
if (t12._call) {
if (time2 > t12._time)
time2 = t12._time;
t02 = t12, t12 = t12._next;
} else {
t22 = t12._next, t12._next = null;
t12 = t02 ? t02._next = t22 : taskHead = t22;
}
}
taskTail = t02;
sleep(time2);
}
function sleep(time2) {
if (frame)
return;
if (timeout)
timeout = clearTimeout(timeout);
var delay = time2 - clockNow;
if (delay > 24) {
if (time2 < Infinity)
timeout = setTimeout(wake, time2 - clock.now() - clockSkew);
if (interval$1)
interval$1 = clearInterval(interval$1);
} else {
if (!interval$1)
clockLast = clock.now(), interval$1 = setInterval(poke, pokeDelay);
frame = 1, setFrame(wake);
}
}
function interval(callback, delay, time2) {
var t5 = new Timer$1(), total = delay;
if (delay == null)
return t5.restart(callback, delay, time2), t5;
t5._restart = t5.restart;
t5.restart = function(callback2, delay2, time3) {
delay2 = +delay2, time3 = time3 == null ? now$1() : +time3;
t5._restart(function tick(elapsed) {
elapsed += total;
t5._restart(tick, total += delay2, time3);
callback2(elapsed);
}, delay2, time3);
};
t5.restart(callback, delay, time2);
return t5;
}
const a$o = 1664525;
const c$4 = 1013904223;
const m$j = 4294967296;
function lcg$1() {
let s2 = 1;
return () => (s2 = (a$o * s2 + c$4) % m$j) / m$j;
}
function x$3(d2) {
return d2.x;
}
function y$5(d2) {
return d2.y;
}
var initialRadius = 10, initialAngle = Math.PI * (3 - Math.sqrt(5));
function forceSimulation(nodes) {
var simulation2, alpha = 1, alphaMin = 1e-3, alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), alphaTarget = 0, velocityDecay = 0.6, forces = /* @__PURE__ */ new Map(), stepper = timer$1(step), event2 = dispatch("tick", "end"), random2 = lcg$1();
if (nodes == null)
nodes = [];
function step() {
tick();
event2.call("tick", simulation2);
if (alpha < alphaMin) {
stepper.stop();
event2.call("end", simulation2);
}
}
function tick(iterations2) {
var i2, n2 = nodes.length, node2;
if (iterations2 === void 0)
iterations2 = 1;
for (var k2 = 0; k2 < iterations2; ++k2) {
alpha += (alphaTarget - alpha) * alphaDecay;
forces.forEach(function(force2) {
force2(alpha);
});
for (i2 = 0; i2 < n2; ++i2) {
node2 = nodes[i2];
if (node2.fx == null)
node2.x += node2.vx *= velocityDecay;
else
node2.x = node2.fx, node2.vx = 0;
if (node2.fy == null)
node2.y += node2.vy *= velocityDecay;
else
node2.y = node2.fy, node2.vy = 0;
}
}
return simulation2;
}
function initializeNodes() {
for (var i2 = 0, n2 = nodes.length, node2; i2 < n2; ++i2) {
node2 = nodes[i2], node2.index = i2;
if (node2.fx != null)
node2.x = node2.fx;
if (node2.fy != null)
node2.y = node2.fy;
if (isNaN(node2.x) || isNaN(node2.y)) {
var radius2 = initialRadius * Math.sqrt(0.5 + i2), angle2 = i2 * initialAngle;
node2.x = radius2 * Math.cos(angle2);
node2.y = radius2 * Math.sin(angle2);
}
if (isNaN(node2.vx) || isNaN(node2.vy)) {
node2.vx = node2.vy = 0;
}
}
}
function initializeForce(force2) {
if (force2.initialize)
force2.initialize(nodes, random2);
return force2;
}
initializeNodes();
return simulation2 = {
tick,
restart: function() {
return stepper.restart(step), simulation2;
},
stop: function() {
return stepper.stop(), simulation2;
},
nodes: function(_24) {
return arguments.length ? (nodes = _24, initializeNodes(), forces.forEach(initializeForce), simulation2) : nodes;
},
alpha: function(_24) {
return arguments.length ? (alpha = +_24, simulation2) : alpha;
},
alphaMin: function(_24) {
return arguments.length ? (alphaMin = +_24, simulation2) : alphaMin;
},
alphaDecay: function(_24) {
return arguments.length ? (alphaDecay = +_24, simulation2) : +alphaDecay;
},
alphaTarget: function(_24) {
return arguments.length ? (alphaTarget = +_24, simulation2) : alphaTarget;
},
velocityDecay: function(_24) {
return arguments.length ? (velocityDecay = 1 - _24, simulation2) : 1 - velocityDecay;
},
randomSource: function(_24) {
return arguments.length ? (random2 = _24, forces.forEach(initializeForce), simulation2) : random2;
},
force: function(name, _24) {
return arguments.length > 1 ? (_24 == null ? forces.delete(name) : forces.set(name, initializeForce(_24)), simulation2) : forces.get(name);
},
find: function(x2, y2, radius2) {
var i2 = 0, n2 = nodes.length, dx, dy, d2, node2, closest2;
if (radius2 == null)
radius2 = Infinity;
else
radius2 *= radius2;
for (i2 = 0; i2 < n2; ++i2) {
node2 = nodes[i2];
dx = x2 - node2.x;
dy = y2 - node2.y;
d2 = dx * dx + dy * dy;
if (d2 < radius2)
closest2 = node2, radius2 = d2;
}
return closest2;
},
on: function(name, _24) {
return arguments.length > 1 ? (event2.on(name, _24), simulation2) : event2.on(name);
}
};
}
function forceManyBody() {
var nodes, node2, random2, alpha, strength = constant$2(-30), strengths, distanceMin2 = 1, distanceMax2 = Infinity, theta2 = 0.81;
function force2(_24) {
var i2, n2 = nodes.length, tree2 = quadtree(nodes, x$3, y$5).visitAfter(accumulate);
for (alpha = _24, i2 = 0; i2 < n2; ++i2)
node2 = nodes[i2], tree2.visit(apply2);
}
function initialize2() {
if (!nodes)
return;
var i2, n2 = nodes.length, node3;
strengths = new Array(n2);
for (i2 = 0; i2 < n2; ++i2)
node3 = nodes[i2], strengths[node3.index] = +strength(node3, i2, nodes);
}
function accumulate(quad2) {
var strength2 = 0, q2, c2, weight = 0, x2, y2, i2;
if (quad2.length) {
for (x2 = y2 = i2 = 0; i2 < 4; ++i2) {
if ((q2 = quad2[i2]) && (c2 = Math.abs(q2.value))) {
strength2 += q2.value, weight += c2, x2 += c2 * q2.x, y2 += c2 * q2.y;
}
}
quad2.x = x2 / weight;
quad2.y = y2 / weight;
} else {
q2 = quad2;
q2.x = q2.data.x;
q2.y = q2.data.y;
do
strength2 += strengths[q2.data.index];
while (q2 = q2.next);
}
quad2.value = strength2;
}
function apply2(quad2, x12, _24, x2) {
if (!quad2.value)
return true;
var x3 = quad2.x - node2.x, y2 = quad2.y - node2.y, w2 = x2 - x12, l2 = x3 * x3 + y2 * y2;
if (w2 * w2 / theta2 < l2) {
if (l2 < distanceMax2) {
if (x3 === 0)
x3 = jiggle(random2), l2 += x3 * x3;
if (y2 === 0)
y2 = jiggle(random2), l2 += y2 * y2;
if (l2 < distanceMin2)
l2 = Math.sqrt(distanceMin2 * l2);
node2.vx += x3 * quad2.value * alpha / l2;
node2.vy += y2 * quad2.value * alpha / l2;
}
return true;
} else if (quad2.length || l2 >= distanceMax2)
return;
if (quad2.data !== node2 || quad2.next) {
if (x3 === 0)
x3 = jiggle(random2), l2 += x3 * x3;
if (y2 === 0)
y2 = jiggle(random2), l2 += y2 * y2;
if (l2 < distanceMin2)
l2 = Math.sqrt(distanceMin2 * l2);
}
do
if (quad2.data !== node2) {
w2 = strengths[quad2.data.index] * alpha / l2;
node2.vx += x3 * w2;
node2.vy += y2 * w2;
}
while (quad2 = quad2.next);
}
force2.initialize = function(_nodes, _random) {
nodes = _nodes;
random2 = _random;
initialize2();
};
force2.strength = function(_24) {
return arguments.length ? (strength = typeof _24 === "function" ? _24 : constant$2(+_24), initialize2(), force2) : strength;
};
force2.distanceMin = function(_24) {
return arguments.length ? (distanceMin2 = _24 * _24, force2) : Math.sqrt(distanceMin2);
};
force2.distanceMax = function(_24) {
return arguments.length ? (distanceMax2 = _24 * _24, force2) : Math.sqrt(distanceMax2);
};
force2.theta = function(_24) {
return arguments.length ? (theta2 = _24 * _24, force2) : Math.sqrt(theta2);
};
return force2;
}
function forceX(x2) {
var strength = constant$2(0.1), nodes, strengths, xz;
if (typeof x2 !== "function")
x2 = constant$2(x2 == null ? 0 : +x2);
function force2(alpha) {
for (var i2 = 0, n2 = nodes.length, node2; i2 < n2; ++i2) {
node2 = nodes[i2], node2.vx += (xz[i2] - node2.x) * strengths[i2] * alpha;
}
}
function initialize2() {
if (!nodes)
return;
var i2, n2 = nodes.length;
strengths = new Array(n2);
xz = new Array(n2);
for (i2 = 0; i2 < n2; ++i2) {
strengths[i2] = isNaN(xz[i2] = +x2(nodes[i2], i2, nodes)) ? 0 : +strength(nodes[i2], i2, nodes);
}
}
force2.initialize = function(_24) {
nodes = _24;
initialize2();
};
force2.strength = function(_24) {
return arguments.length ? (strength = typeof _24 === "function" ? _24 : constant$2(+_24), initialize2(), force2) : strength;
};
force2.x = function(_24) {
return arguments.length ? (x2 = typeof _24 === "function" ? _24 : constant$2(+_24), initialize2(), force2) : x2;
};
return force2;
}
function forceY(y2) {
var strength = constant$2(0.1), nodes, strengths, yz;
if (typeof y2 !== "function")
y2 = constant$2(y2 == null ? 0 : +y2);
function force2(alpha) {
for (var i2 = 0, n2 = nodes.length, node2; i2 < n2; ++i2) {
node2 = nodes[i2], node2.vy += (yz[i2] - node2.y) * strengths[i2] * alpha;
}
}
function initialize2() {
if (!nodes)
return;
var i2, n2 = nodes.length;
strengths = new Array(n2);
yz = new Array(n2);
for (i2 = 0; i2 < n2; ++i2) {
strengths[i2] = isNaN(yz[i2] = +y2(nodes[i2], i2, nodes)) ? 0 : +strength(nodes[i2], i2, nodes);
}
}
force2.initialize = function(_24) {
nodes = _24;
initialize2();
};
force2.strength = function(_24) {
return arguments.length ? (strength = typeof _24 === "function" ? _24 : constant$2(+_24), initialize2(), force2) : strength;
};
force2.y = function(_24) {
return arguments.length ? (y2 = typeof _24 === "function" ? _24 : constant$2(+_24), initialize2(), force2) : y2;
};
return force2;
}
const ForceMap = {
center: forceCenter,
collide: forceCollide,
nbody: forceManyBody,
link: forceLink,
x: forceX,
y: forceY
};
const Forces = "forces", ForceParams = ["alpha", "alphaMin", "alphaTarget", "velocityDecay", "forces"], ForceConfig = ["static", "iterations"], ForceOutput = ["x", "y", "vx", "vy"];
function Force(params2) {
Transform$1.call(this, null, params2);
}
Force.Definition = {
"type": "Force",
"metadata": {
"modifies": true
},
"params": [{
"name": "static",
"type": "boolean",
"default": false
}, {
"name": "restart",
"type": "boolean",
"default": false
}, {
"name": "iterations",
"type": "number",
"default": 300
}, {
"name": "alpha",
"type": "number",
"default": 1
}, {
"name": "alphaMin",
"type": "number",
"default": 1e-3
}, {
"name": "alphaTarget",
"type": "number",
"default": 0
}, {
"name": "velocityDecay",
"type": "number",
"default": 0.4
}, {
"name": "forces",
"type": "param",
"array": true,
"params": [{
"key": {
"force": "center"
},
"params": [{
"name": "x",
"type": "number",
"default": 0
}, {
"name": "y",
"type": "number",
"default": 0
}]
}, {
"key": {
"force": "collide"
},
"params": [{
"name": "radius",
"type": "number",
"expr": true
}, {
"name": "strength",
"type": "number",
"default": 0.7
}, {
"name": "iterations",
"type": "number",
"default": 1
}]
}, {
"key": {
"force": "nbody"
},
"params": [{
"name": "strength",
"type": "number",
"default": -30,
"expr": true
}, {
"name": "theta",
"type": "number",
"default": 0.9
}, {
"name": "distanceMin",
"type": "number",
"default": 1
}, {
"name": "distanceMax",
"type": "number"
}]
}, {
"key": {
"force": "link"
},
"params": [{
"name": "links",
"type": "data"
}, {
"name": "id",
"type": "field"
}, {
"name": "distance",
"type": "number",
"default": 30,
"expr": true
}, {
"name": "strength",
"type": "number",
"expr": true
}, {
"name": "iterations",
"type": "number",
"default": 1
}]
}, {
"key": {
"force": "x"
},
"params": [{
"name": "strength",
"type": "number",
"default": 0.1
}, {
"name": "x",
"type": "field"
}]
}, {
"key": {
"force": "y"
},
"params": [{
"name": "strength",
"type": "number",
"default": 0.1
}, {
"name": "y",
"type": "field"
}]
}]
}, {
"name": "as",
"type": "string",
"array": true,
"modify": false,
"default": ForceOutput
}]
};
inherits(Force, Transform$1, {
transform(_24, pulse2) {
var sim = this.value, change2 = pulse2.changed(pulse2.ADD_REM), params2 = _24.modified(ForceParams), iters = _24.iterations || 300;
if (!sim) {
this.value = sim = simulation(pulse2.source, _24);
sim.on("tick", rerun(pulse2.dataflow, this));
if (!_24.static) {
change2 = true;
sim.tick();
}
pulse2.modifies("index");
} else {
if (change2) {
pulse2.modifies("index");
sim.nodes(pulse2.source);
}
if (params2 || pulse2.changed(pulse2.MOD)) {
setup(sim, _24, 0, pulse2);
}
}
if (params2 || change2 || _24.modified(ForceConfig) || pulse2.changed() && _24.restart) {
sim.alpha(Math.max(sim.alpha(), _24.alpha || 1)).alphaDecay(1 - Math.pow(sim.alphaMin(), 1 / iters));
if (_24.static) {
for (sim.stop(); --iters >= 0; )
sim.tick();
} else {
if (sim.stopped())
sim.restart();
if (!change2)
return pulse2.StopPropagation;
}
}
return this.finish(_24, pulse2);
},
finish(_24, pulse2) {
const dataflow = pulse2.dataflow;
for (let args = this._argops, j2 = 0, m2 = args.length, arg; j2 < m2; ++j2) {
arg = args[j2];
if (arg.name !== Forces || arg.op._argval.force !== "link") {
continue;
}
for (var ops2 = arg.op._argops, i2 = 0, n2 = ops2.length, op; i2 < n2; ++i2) {
if (ops2[i2].name === "links" && (op = ops2[i2].op.source)) {
dataflow.pulse(op, dataflow.changeset().reflow());
break;
}
}
}
return pulse2.reflow(_24.modified()).modifies(ForceOutput);
}
});
function rerun(df2, op) {
return () => df2.touch(op).run();
}
function simulation(nodes, _24) {
const sim = forceSimulation(nodes), stop2 = sim.stop, restart = sim.restart;
let stopped = false;
sim.stopped = () => stopped;
sim.restart = () => (stopped = false, restart());
sim.stop = () => (stopped = true, stop2());
return setup(sim, _24, true).on("end", () => stopped = true);
}
function setup(sim, _24, init3, pulse2) {
var f2 = array$5(_24.forces), i2, n2, p2, name;
for (i2 = 0, n2 = ForceParams.length; i2 < n2; ++i2) {
p2 = ForceParams[i2];
if (p2 !== Forces && _24.modified(p2))
sim[p2](_24[p2]);
}
for (i2 = 0, n2 = f2.length; i2 < n2; ++i2) {
name = Forces + i2;
p2 = init3 || _24.modified(Forces, i2) ? getForce(f2[i2]) : pulse2 && modified(f2[i2], pulse2) ? sim.force(name) : null;
if (p2)
sim.force(name, p2);
}
for (n2 = sim.numForces || 0; i2 < n2; ++i2) {
sim.force(Forces + i2, null);
}
sim.numForces = f2.length;
return sim;
}
function modified(f2, pulse2) {
var k2, v2;
for (k2 in f2) {
if (isFunction(v2 = f2[k2]) && pulse2.modified(accessorFields(v2)))
return 1;
}
return 0;
}
function getForce(_24) {
var f2, p2;
if (!has$2(ForceMap, _24.force)) {
error2("Unrecognized force: " + _24.force);
}
f2 = ForceMap[_24.force]();
for (p2 in _24) {
if (isFunction(f2[p2]))
setForceParam(f2[p2], _24[p2], _24);
}
return f2;
}
function setForceParam(f2, v2, _24) {
f2(isFunction(v2) ? (d2) => v2(d2, _24) : v2);
}
const force = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
force: Force
}, Symbol.toStringTag, { value: "Module" }));
function defaultSeparation$2(a2, b2) {
return a2.parent === b2.parent ? 1 : 2;
}
function meanX(children2) {
return children2.reduce(meanXReduce, 0) / children2.length;
}
function meanXReduce(x2, c2) {
return x2 + c2.x;
}
function maxY(children2) {
return 1 + children2.reduce(maxYReduce, 0);
}
function maxYReduce(y2, c2) {
return Math.max(y2, c2.y);
}
function leafLeft(node2) {
var children2;
while (children2 = node2.children)
node2 = children2[0];
return node2;
}
function leafRight(node2) {
var children2;
while (children2 = node2.children)
node2 = children2[children2.length - 1];
return node2;
}
function cluster() {
var separation = defaultSeparation$2, dx = 1, dy = 1, nodeSize = false;
function cluster2(root2) {
var previousNode, x2 = 0;
root2.eachAfter(function(node2) {
var children2 = node2.children;
if (children2) {
node2.x = meanX(children2);
node2.y = maxY(children2);
} else {
node2.x = previousNode ? x2 += separation(node2, previousNode) : 0;
node2.y = 0;
previousNode = node2;
}
});
var left2 = leafLeft(root2), right2 = leafRight(root2), x02 = left2.x - separation(left2, right2) / 2, x12 = right2.x + separation(right2, left2) / 2;
return root2.eachAfter(nodeSize ? function(node2) {
node2.x = (node2.x - root2.x) * dx;
node2.y = (root2.y - node2.y) * dy;
} : function(node2) {
node2.x = (node2.x - x02) / (x12 - x02) * dx;
node2.y = (1 - (root2.y ? node2.y / root2.y : 1)) * dy;
});
}
cluster2.separation = function(x2) {
return arguments.length ? (separation = x2, cluster2) : separation;
};
cluster2.size = function(x2) {
return arguments.length ? (nodeSize = false, dx = +x2[0], dy = +x2[1], cluster2) : nodeSize ? null : [dx, dy];
};
cluster2.nodeSize = function(x2) {
return arguments.length ? (nodeSize = true, dx = +x2[0], dy = +x2[1], cluster2) : nodeSize ? [dx, dy] : null;
};
return cluster2;
}
function count(node2) {
var sum2 = 0, children2 = node2.children, i2 = children2 && children2.length;
if (!i2)
sum2 = 1;
else
while (--i2 >= 0)
sum2 += children2[i2].value;
node2.value = sum2;
}
function node_count() {
return this.eachAfter(count);
}
function node_each(callback, that) {
let index2 = -1;
for (const node2 of this) {
callback.call(that, node2, ++index2, this);
}
return this;
}
function node_eachBefore(callback, that) {
var node2 = this, nodes = [node2], children2, i2, index2 = -1;
while (node2 = nodes.pop()) {
callback.call(that, node2, ++index2, this);
if (children2 = node2.children) {
for (i2 = children2.length - 1; i2 >= 0; --i2) {
nodes.push(children2[i2]);
}
}
}
return this;
}
function node_eachAfter(callback, that) {
var node2 = this, nodes = [node2], next2 = [], children2, i2, n2, index2 = -1;
while (node2 = nodes.pop()) {
next2.push(node2);
if (children2 = node2.children) {
for (i2 = 0, n2 = children2.length; i2 < n2; ++i2) {
nodes.push(children2[i2]);
}
}
}
while (node2 = next2.pop()) {
callback.call(that, node2, ++index2, this);
}
return this;
}
function node_find(callback, that) {
let index2 = -1;
for (const node2 of this) {
if (callback.call(that, node2, ++index2, this)) {
return node2;
}
}
}
function node_sum(value2) {
return this.eachAfter(function(node2) {
var sum2 = +value2(node2.data) || 0, children2 = node2.children, i2 = children2 && children2.length;
while (--i2 >= 0)
sum2 += children2[i2].value;
node2.value = sum2;
});
}
function node_sort(compare3) {
return this.eachBefore(function(node2) {
if (node2.children) {
node2.children.sort(compare3);
}
});
}
function node_path(end2) {
var start2 = this, ancestor = leastCommonAncestor(start2, end2), nodes = [start2];
while (start2 !== ancestor) {
start2 = start2.parent;
nodes.push(start2);
}
var k2 = nodes.length;
while (end2 !== ancestor) {
nodes.splice(k2, 0, end2);
end2 = end2.parent;
}
return nodes;
}
function leastCommonAncestor(a2, b2) {
if (a2 === b2)
return a2;
var aNodes = a2.ancestors(), bNodes = b2.ancestors(), c2 = null;
a2 = aNodes.pop();
b2 = bNodes.pop();
while (a2 === b2) {
c2 = a2;
a2 = aNodes.pop();
b2 = bNodes.pop();
}
return c2;
}
function node_ancestors() {
var node2 = this, nodes = [node2];
while (node2 = node2.parent) {
nodes.push(node2);
}
return nodes;
}
function node_descendants() {
return Array.from(this);
}
function node_leaves() {
var leaves = [];
this.eachBefore(function(node2) {
if (!node2.children) {
leaves.push(node2);
}
});
return leaves;
}
function node_links() {
var root2 = this, links = [];
root2.each(function(node2) {
if (node2 !== root2) {
links.push({ source: node2.parent, target: node2 });
}
});
return links;
}
function* node_iterator() {
var node2 = this, current, next2 = [node2], children2, i2, n2;
do {
current = next2.reverse(), next2 = [];
while (node2 = current.pop()) {
yield node2;
if (children2 = node2.children) {
for (i2 = 0, n2 = children2.length; i2 < n2; ++i2) {
next2.push(children2[i2]);
}
}
}
} while (next2.length);
}
function hierarchy(data2, children2) {
if (data2 instanceof Map) {
data2 = [void 0, data2];
if (children2 === void 0)
children2 = mapChildren;
} else if (children2 === void 0) {
children2 = objectChildren;
}
var root2 = new Node$2(data2), node2, nodes = [root2], child, childs, i2, n2;
while (node2 = nodes.pop()) {
if ((childs = children2(node2.data)) && (n2 = (childs = Array.from(childs)).length)) {
node2.children = childs;
for (i2 = n2 - 1; i2 >= 0; --i2) {
nodes.push(child = childs[i2] = new Node$2(childs[i2]));
child.parent = node2;
child.depth = node2.depth + 1;
}
}
}
return root2.eachBefore(computeHeight);
}
function node_copy() {
return hierarchy(this).eachBefore(copyData);
}
function objectChildren(d2) {
return d2.children;
}
function mapChildren(d2) {
return Array.isArray(d2) ? d2[1] : null;
}
function copyData(node2) {
if (node2.data.value !== void 0)
node2.value = node2.data.value;
node2.data = node2.data.data;
}
function computeHeight(node2) {
var height2 = 0;
do
node2.height = height2;
while ((node2 = node2.parent) && node2.height < ++height2);
}
function Node$2(data2) {
this.data = data2;
this.depth = this.height = 0;
this.parent = null;
}
Node$2.prototype = hierarchy.prototype = {
constructor: Node$2,
count: node_count,
each: node_each,
eachAfter: node_eachAfter,
eachBefore: node_eachBefore,
find: node_find,
sum: node_sum,
sort: node_sort,
path: node_path,
ancestors: node_ancestors,
descendants: node_descendants,
leaves: node_leaves,
links: node_links,
copy: node_copy,
[Symbol.iterator]: node_iterator
};
function optional(f2) {
return f2 == null ? null : required(f2);
}
function required(f2) {
if (typeof f2 !== "function")
throw new Error();
return f2;
}
function constantZero() {
return 0;
}
function constant$1(x2) {
return function() {
return x2;
};
}
const a$n = 1664525;
const c$3 = 1013904223;
const m$i = 4294967296;
function lcg() {
let s2 = 1;
return () => (s2 = (a$n * s2 + c$3) % m$i) / m$i;
}
function array$2(x2) {
return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
}
function shuffle(array2, random2) {
let m2 = array2.length, t5, i2;
while (m2) {
i2 = random2() * m2-- | 0;
t5 = array2[m2];
array2[m2] = array2[i2];
array2[i2] = t5;
}
return array2;
}
function packEncloseRandom(circles, random2) {
var i2 = 0, n2 = (circles = shuffle(Array.from(circles), random2)).length, B3 = [], p2, e7;
while (i2 < n2) {
p2 = circles[i2];
if (e7 && enclosesWeak(e7, p2))
++i2;
else
e7 = encloseBasis(B3 = extendBasis(B3, p2)), i2 = 0;
}
return e7;
}
function extendBasis(B3, p2) {
var i2, j2;
if (enclosesWeakAll(p2, B3))
return [p2];
for (i2 = 0; i2 < B3.length; ++i2) {
if (enclosesNot(p2, B3[i2]) && enclosesWeakAll(encloseBasis2(B3[i2], p2), B3)) {
return [B3[i2], p2];
}
}
for (i2 = 0; i2 < B3.length - 1; ++i2) {
for (j2 = i2 + 1; j2 < B3.length; ++j2) {
if (enclosesNot(encloseBasis2(B3[i2], B3[j2]), p2) && enclosesNot(encloseBasis2(B3[i2], p2), B3[j2]) && enclosesNot(encloseBasis2(B3[j2], p2), B3[i2]) && enclosesWeakAll(encloseBasis3(B3[i2], B3[j2], p2), B3)) {
return [B3[i2], B3[j2], p2];
}
}
}
throw new Error();
}
function enclosesNot(a2, b2) {
var dr2 = a2.r - b2.r, dx = b2.x - a2.x, dy = b2.y - a2.y;
return dr2 < 0 || dr2 * dr2 < dx * dx + dy * dy;
}
function enclosesWeak(a2, b2) {
var dr2 = a2.r - b2.r + Math.max(a2.r, b2.r, 1) * 1e-9, dx = b2.x - a2.x, dy = b2.y - a2.y;
return dr2 > 0 && dr2 * dr2 > dx * dx + dy * dy;
}
function enclosesWeakAll(a2, B3) {
for (var i2 = 0; i2 < B3.length; ++i2) {
if (!enclosesWeak(a2, B3[i2])) {
return false;
}
}
return true;
}
function encloseBasis(B3) {
switch (B3.length) {
case 1:
return encloseBasis1(B3[0]);
case 2:
return encloseBasis2(B3[0], B3[1]);
case 3:
return encloseBasis3(B3[0], B3[1], B3[2]);
}
}
function encloseBasis1(a2) {
return {
x: a2.x,
y: a2.y,
r: a2.r
};
}
function encloseBasis2(a2, b2) {
var x12 = a2.x, y12 = a2.y, r1 = a2.r, x2 = b2.x, y2 = b2.y, r2 = b2.r, x21 = x2 - x12, y21 = y2 - y12, r21 = r2 - r1, l2 = Math.sqrt(x21 * x21 + y21 * y21);
return {
x: (x12 + x2 + x21 / l2 * r21) / 2,
y: (y12 + y2 + y21 / l2 * r21) / 2,
r: (l2 + r1 + r2) / 2
};
}
function encloseBasis3(a2, b2, c2) {
var x12 = a2.x, y12 = a2.y, r1 = a2.r, x2 = b2.x, y2 = b2.y, r2 = b2.r, x3 = c2.x, y3 = c2.y, r3 = c2.r, a22 = x12 - x2, a3 = x12 - x3, b22 = y12 - y2, b3 = y12 - y3, c22 = r2 - r1, c3 = r3 - r1, d1 = x12 * x12 + y12 * y12 - r1 * r1, d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2, d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3, ab2 = a3 * b22 - a22 * b3, xa2 = (b22 * d3 - b3 * d2) / (ab2 * 2) - x12, xb2 = (b3 * c22 - b22 * c3) / ab2, ya2 = (a3 * d2 - a22 * d3) / (ab2 * 2) - y12, yb2 = (a22 * c3 - a3 * c22) / ab2, A5 = xb2 * xb2 + yb2 * yb2 - 1, B3 = 2 * (r1 + xa2 * xb2 + ya2 * yb2), C3 = xa2 * xa2 + ya2 * ya2 - r1 * r1, r4 = -(Math.abs(A5) > 1e-6 ? (B3 + Math.sqrt(B3 * B3 - 4 * A5 * C3)) / (2 * A5) : C3 / B3);
return {
x: x12 + xa2 + xb2 * r4,
y: y12 + ya2 + yb2 * r4,
r: r4
};
}
function place(b2, a2, c2) {
var dx = b2.x - a2.x, x2, a22, dy = b2.y - a2.y, y2, b22, d2 = dx * dx + dy * dy;
if (d2) {
a22 = a2.r + c2.r, a22 *= a22;
b22 = b2.r + c2.r, b22 *= b22;
if (a22 > b22) {
x2 = (d2 + b22 - a22) / (2 * d2);
y2 = Math.sqrt(Math.max(0, b22 / d2 - x2 * x2));
c2.x = b2.x - x2 * dx - y2 * dy;
c2.y = b2.y - x2 * dy + y2 * dx;
} else {
x2 = (d2 + a22 - b22) / (2 * d2);
y2 = Math.sqrt(Math.max(0, a22 / d2 - x2 * x2));
c2.x = a2.x + x2 * dx - y2 * dy;
c2.y = a2.y + x2 * dy + y2 * dx;
}
} else {
c2.x = a2.x + c2.r;
c2.y = a2.y;
}
}
function intersects(a2, b2) {
var dr2 = a2.r + b2.r - 1e-6, dx = b2.x - a2.x, dy = b2.y - a2.y;
return dr2 > 0 && dr2 * dr2 > dx * dx + dy * dy;
}
function score(node2) {
var a2 = node2._, b2 = node2.next._, ab2 = a2.r + b2.r, dx = (a2.x * b2.r + b2.x * a2.r) / ab2, dy = (a2.y * b2.r + b2.y * a2.r) / ab2;
return dx * dx + dy * dy;
}
function Node$1(circle2) {
this._ = circle2;
this.next = null;
this.previous = null;
}
function packSiblingsRandom(circles, random2) {
if (!(n2 = (circles = array$2(circles)).length))
return 0;
var a2, b2, c2, n2, aa2, ca2, i2, j2, k2, sj2, sk2;
a2 = circles[0], a2.x = 0, a2.y = 0;
if (!(n2 > 1))
return a2.r;
b2 = circles[1], a2.x = -b2.r, b2.x = a2.r, b2.y = 0;
if (!(n2 > 2))
return a2.r + b2.r;
place(b2, a2, c2 = circles[2]);
a2 = new Node$1(a2), b2 = new Node$1(b2), c2 = new Node$1(c2);
a2.next = c2.previous = b2;
b2.next = a2.previous = c2;
c2.next = b2.previous = a2;
pack:
for (i2 = 3; i2 < n2; ++i2) {
place(a2._, b2._, c2 = circles[i2]), c2 = new Node$1(c2);
j2 = b2.next, k2 = a2.previous, sj2 = b2._.r, sk2 = a2._.r;
do {
if (sj2 <= sk2) {
if (intersects(j2._, c2._)) {
b2 = j2, a2.next = b2, b2.previous = a2, --i2;
continue pack;
}
sj2 += j2._.r, j2 = j2.next;
} else {
if (intersects(k2._, c2._)) {
a2 = k2, a2.next = b2, b2.previous = a2, --i2;
continue pack;
}
sk2 += k2._.r, k2 = k2.previous;
}
} while (j2 !== k2.next);
c2.previous = a2, c2.next = b2, a2.next = b2.previous = b2 = c2;
aa2 = score(a2);
while ((c2 = c2.next) !== b2) {
if ((ca2 = score(c2)) < aa2) {
a2 = c2, aa2 = ca2;
}
}
b2 = a2.next;
}
a2 = [b2._], c2 = b2;
while ((c2 = c2.next) !== b2)
a2.push(c2._);
c2 = packEncloseRandom(a2, random2);
for (i2 = 0; i2 < n2; ++i2)
a2 = circles[i2], a2.x -= c2.x, a2.y -= c2.y;
return c2.r;
}
function defaultRadius(d2) {
return Math.sqrt(d2.value);
}
function pack$1() {
var radius2 = null, dx = 1, dy = 1, padding2 = constantZero;
function pack2(root2) {
const random2 = lcg();
root2.x = dx / 2, root2.y = dy / 2;
if (radius2) {
root2.eachBefore(radiusLeaf(radius2)).eachAfter(packChildrenRandom(padding2, 0.5, random2)).eachBefore(translateChild(1));
} else {
root2.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildrenRandom(constantZero, 1, random2)).eachAfter(packChildrenRandom(padding2, root2.r / Math.min(dx, dy), random2)).eachBefore(translateChild(Math.min(dx, dy) / (2 * root2.r)));
}
return root2;
}
pack2.radius = function(x2) {
return arguments.length ? (radius2 = optional(x2), pack2) : radius2;
};
pack2.size = function(x2) {
return arguments.length ? (dx = +x2[0], dy = +x2[1], pack2) : [dx, dy];
};
pack2.padding = function(x2) {
return arguments.length ? (padding2 = typeof x2 === "function" ? x2 : constant$1(+x2), pack2) : padding2;
};
return pack2;
}
function radiusLeaf(radius2) {
return function(node2) {
if (!node2.children) {
node2.r = Math.max(0, +radius2(node2) || 0);
}
};
}
function packChildrenRandom(padding2, k2, random2) {
return function(node2) {
if (children2 = node2.children) {
var children2, i2, n2 = children2.length, r2 = padding2(node2) * k2 || 0, e7;
if (r2)
for (i2 = 0; i2 < n2; ++i2)
children2[i2].r += r2;
e7 = packSiblingsRandom(children2, random2);
if (r2)
for (i2 = 0; i2 < n2; ++i2)
children2[i2].r -= r2;
node2.r = e7 + r2;
}
};
}
function translateChild(k2) {
return function(node2) {
var parent = node2.parent;
node2.r *= k2;
if (parent) {
node2.x = parent.x + k2 * node2.x;
node2.y = parent.y + k2 * node2.y;
}
};
}
function roundNode(node2) {
node2.x0 = Math.round(node2.x0);
node2.y0 = Math.round(node2.y0);
node2.x1 = Math.round(node2.x1);
node2.y1 = Math.round(node2.y1);
}
function treemapDice(parent, x02, y02, x12, y12) {
var nodes = parent.children, node2, i2 = -1, n2 = nodes.length, k2 = parent.value && (x12 - x02) / parent.value;
while (++i2 < n2) {
node2 = nodes[i2], node2.y0 = y02, node2.y1 = y12;
node2.x0 = x02, node2.x1 = x02 += node2.value * k2;
}
}
function partition$1() {
var dx = 1, dy = 1, padding2 = 0, round2 = false;
function partition2(root2) {
var n2 = root2.height + 1;
root2.x0 = root2.y0 = padding2;
root2.x1 = dx;
root2.y1 = dy / n2;
root2.eachBefore(positionNode(dy, n2));
if (round2)
root2.eachBefore(roundNode);
return root2;
}
function positionNode(dy2, n2) {
return function(node2) {
if (node2.children) {
treemapDice(node2, node2.x0, dy2 * (node2.depth + 1) / n2, node2.x1, dy2 * (node2.depth + 2) / n2);
}
var x02 = node2.x0, y02 = node2.y0, x12 = node2.x1 - padding2, y12 = node2.y1 - padding2;
if (x12 < x02)
x02 = x12 = (x02 + x12) / 2;
if (y12 < y02)
y02 = y12 = (y02 + y12) / 2;
node2.x0 = x02;
node2.y0 = y02;
node2.x1 = x12;
node2.y1 = y12;
};
}
partition2.round = function(x2) {
return arguments.length ? (round2 = !!x2, partition2) : round2;
};
partition2.size = function(x2) {
return arguments.length ? (dx = +x2[0], dy = +x2[1], partition2) : [dx, dy];
};
partition2.padding = function(x2) {
return arguments.length ? (padding2 = +x2, partition2) : padding2;
};
return partition2;
}
var preroot = { depth: -1 }, ambiguous = {}, imputed = {};
function defaultId(d2) {
return d2.id;
}
function defaultParentId(d2) {
return d2.parentId;
}
function stratify() {
var id = defaultId, parentId = defaultParentId, path2;
function stratify2(data2) {
var nodes = Array.from(data2), currentId = id, currentParentId = parentId, n2, d2, i2, root2, parent, node2, nodeId, nodeKey, nodeByKey = /* @__PURE__ */ new Map();
if (path2 != null) {
const I2 = nodes.map((d3, i3) => normalize$1(path2(d3, i3, data2)));
const P2 = I2.map(parentof);
const S2 = new Set(I2).add("");
for (const i3 of P2) {
if (!S2.has(i3)) {
S2.add(i3);
I2.push(i3);
P2.push(parentof(i3));
nodes.push(imputed);
}
}
currentId = (_24, i3) => I2[i3];
currentParentId = (_24, i3) => P2[i3];
}
for (i2 = 0, n2 = nodes.length; i2 < n2; ++i2) {
d2 = nodes[i2], node2 = nodes[i2] = new Node$2(d2);
if ((nodeId = currentId(d2, i2, data2)) != null && (nodeId += "")) {
nodeKey = node2.id = nodeId;
nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node2);
}
if ((nodeId = currentParentId(d2, i2, data2)) != null && (nodeId += "")) {
node2.parent = nodeId;
}
}
for (i2 = 0; i2 < n2; ++i2) {
node2 = nodes[i2];
if (nodeId = node2.parent) {
parent = nodeByKey.get(nodeId);
if (!parent)
throw new Error("missing: " + nodeId);
if (parent === ambiguous)
throw new Error("ambiguous: " + nodeId);
if (parent.children)
parent.children.push(node2);
else
parent.children = [node2];
node2.parent = parent;
} else {
if (root2)
throw new Error("multiple roots");
root2 = node2;
}
}
if (!root2)
throw new Error("no root");
if (path2 != null) {
while (root2.data === imputed && root2.children.length === 1) {
root2 = root2.children[0], --n2;
}
for (let i3 = nodes.length - 1; i3 >= 0; --i3) {
node2 = nodes[i3];
if (node2.data !== imputed)
break;
node2.data = null;
}
}
root2.parent = preroot;
root2.eachBefore(function(node3) {
node3.depth = node3.parent.depth + 1;
--n2;
}).eachBefore(computeHeight);
root2.parent = null;
if (n2 > 0)
throw new Error("cycle");
return root2;
}
stratify2.id = function(x2) {
return arguments.length ? (id = optional(x2), stratify2) : id;
};
stratify2.parentId = function(x2) {
return arguments.length ? (parentId = optional(x2), stratify2) : parentId;
};
stratify2.path = function(x2) {
return arguments.length ? (path2 = optional(x2), stratify2) : path2;
};
return stratify2;
}
function normalize$1(path2) {
path2 = `${path2}`;
let i2 = path2.length;
if (slash(path2, i2 - 1) && !slash(path2, i2 - 2))
path2 = path2.slice(0, -1);
return path2[0] === "/" ? path2 : `/${path2}`;
}
function parentof(path2) {
let i2 = path2.length;
if (i2 < 2)
return "";
while (--i2 > 1)
if (slash(path2, i2))
break;
return path2.slice(0, i2);
}
function slash(path2, i2) {
if (path2[i2] === "/") {
let k2 = 0;
while (i2 > 0 && path2[--i2] === "\\")
++k2;
if ((k2 & 1) === 0)
return true;
}
return false;
}
function defaultSeparation$1(a2, b2) {
return a2.parent === b2.parent ? 1 : 2;
}
function nextLeft(v2) {
var children2 = v2.children;
return children2 ? children2[0] : v2.t;
}
function nextRight(v2) {
var children2 = v2.children;
return children2 ? children2[children2.length - 1] : v2.t;
}
function moveSubtree(wm, wp, shift) {
var change2 = shift / (wp.i - wm.i);
wp.c -= change2;
wp.s += shift;
wm.c += change2;
wp.z += shift;
wp.m += shift;
}
function executeShifts(v2) {
var shift = 0, change2 = 0, children2 = v2.children, i2 = children2.length, w2;
while (--i2 >= 0) {
w2 = children2[i2];
w2.z += shift;
w2.m += shift;
shift += w2.s + (change2 += w2.c);
}
}
function nextAncestor(vim, v2, ancestor) {
return vim.a.parent === v2.parent ? vim.a : ancestor;
}
function TreeNode(node2, i2) {
this._ = node2;
this.parent = null;
this.children = null;
this.A = null;
this.a = this;
this.z = 0;
this.m = 0;
this.c = 0;
this.s = 0;
this.t = null;
this.i = i2;
}
TreeNode.prototype = Object.create(Node$2.prototype);
function treeRoot(root2) {
var tree2 = new TreeNode(root2, 0), node2, nodes = [tree2], child, children2, i2, n2;
while (node2 = nodes.pop()) {
if (children2 = node2._.children) {
node2.children = new Array(n2 = children2.length);
for (i2 = n2 - 1; i2 >= 0; --i2) {
nodes.push(child = node2.children[i2] = new TreeNode(children2[i2], i2));
child.parent = node2;
}
}
}
(tree2.parent = new TreeNode(null, 0)).children = [tree2];
return tree2;
}
function tree$1() {
var separation = defaultSeparation$1, dx = 1, dy = 1, nodeSize = null;
function tree2(root2) {
var t5 = treeRoot(root2);
t5.eachAfter(firstWalk), t5.parent.m = -t5.z;
t5.eachBefore(secondWalk);
if (nodeSize)
root2.eachBefore(sizeNode);
else {
var left2 = root2, right2 = root2, bottom2 = root2;
root2.eachBefore(function(node2) {
if (node2.x < left2.x)
left2 = node2;
if (node2.x > right2.x)
right2 = node2;
if (node2.depth > bottom2.depth)
bottom2 = node2;
});
var s2 = left2 === right2 ? 1 : separation(left2, right2) / 2, tx2 = s2 - left2.x, kx = dx / (right2.x + s2 + tx2), ky = dy / (bottom2.depth || 1);
root2.eachBefore(function(node2) {
node2.x = (node2.x + tx2) * kx;
node2.y = node2.depth * ky;
});
}
return root2;
}
function firstWalk(v2) {
var children2 = v2.children, siblings = v2.parent.children, w2 = v2.i ? siblings[v2.i - 1] : null;
if (children2) {
executeShifts(v2);
var midpoint = (children2[0].z + children2[children2.length - 1].z) / 2;
if (w2) {
v2.z = w2.z + separation(v2._, w2._);
v2.m = v2.z - midpoint;
} else {
v2.z = midpoint;
}
} else if (w2) {
v2.z = w2.z + separation(v2._, w2._);
}
v2.parent.A = apportion(v2, w2, v2.parent.A || siblings[0]);
}
function secondWalk(v2) {
v2._.x = v2.z + v2.parent.m;
v2.m += v2.parent.m;
}
function apportion(v2, w2, ancestor) {
if (w2) {
var vip = v2, vop = v2, vim = w2, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
vom = nextLeft(vom);
vop = nextRight(vop);
vop.a = v2;
shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
if (shift > 0) {
moveSubtree(nextAncestor(vim, v2, ancestor), v2, shift);
sip += shift;
sop += shift;
}
sim += vim.m;
sip += vip.m;
som += vom.m;
sop += vop.m;
}
if (vim && !nextRight(vop)) {
vop.t = vim;
vop.m += sim - sop;
}
if (vip && !nextLeft(vom)) {
vom.t = vip;
vom.m += sip - som;
ancestor = v2;
}
}
return ancestor;
}
function sizeNode(node2) {
node2.x *= dx;
node2.y = node2.depth * dy;
}
tree2.separation = function(x2) {
return arguments.length ? (separation = x2, tree2) : separation;
};
tree2.size = function(x2) {
return arguments.length ? (nodeSize = false, dx = +x2[0], dy = +x2[1], tree2) : nodeSize ? null : [dx, dy];
};
tree2.nodeSize = function(x2) {
return arguments.length ? (nodeSize = true, dx = +x2[0], dy = +x2[1], tree2) : nodeSize ? [dx, dy] : null;
};
return tree2;
}
function treemapSlice(parent, x02, y02, x12, y12) {
var nodes = parent.children, node2, i2 = -1, n2 = nodes.length, k2 = parent.value && (y12 - y02) / parent.value;
while (++i2 < n2) {
node2 = nodes[i2], node2.x0 = x02, node2.x1 = x12;
node2.y0 = y02, node2.y1 = y02 += node2.value * k2;
}
}
var phi = (1 + Math.sqrt(5)) / 2;
function squarifyRatio(ratio, parent, x02, y02, x12, y12) {
var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n2 = nodes.length, dx, dy, value2 = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
while (i0 < n2) {
dx = x12 - x02, dy = y12 - y02;
do
sumValue = nodes[i1++].value;
while (!sumValue && i1 < n2);
minValue = maxValue = sumValue;
alpha = Math.max(dy / dx, dx / dy) / (value2 * ratio);
beta = sumValue * sumValue * alpha;
minRatio = Math.max(maxValue / beta, beta / minValue);
for (; i1 < n2; ++i1) {
sumValue += nodeValue = nodes[i1].value;
if (nodeValue < minValue)
minValue = nodeValue;
if (nodeValue > maxValue)
maxValue = nodeValue;
beta = sumValue * sumValue * alpha;
newRatio = Math.max(maxValue / beta, beta / minValue);
if (newRatio > minRatio) {
sumValue -= nodeValue;
break;
}
minRatio = newRatio;
}
rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
if (row.dice)
treemapDice(row, x02, y02, x12, value2 ? y02 += dy * sumValue / value2 : y12);
else
treemapSlice(row, x02, y02, value2 ? x02 += dx * sumValue / value2 : x12, y12);
value2 -= sumValue, i0 = i1;
}
return rows;
}
const treemapSquarify = function custom9(ratio) {
function squarify(parent, x02, y02, x12, y12) {
squarifyRatio(ratio, parent, x02, y02, x12, y12);
}
squarify.ratio = function(x2) {
return custom9((x2 = +x2) > 1 ? x2 : 1);
};
return squarify;
}(phi);
function treemap() {
var tile = treemapSquarify, round2 = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop2 = constantZero, paddingRight2 = constantZero, paddingBottom2 = constantZero, paddingLeft2 = constantZero;
function treemap2(root2) {
root2.x0 = root2.y0 = 0;
root2.x1 = dx;
root2.y1 = dy;
root2.eachBefore(positionNode);
paddingStack = [0];
if (round2)
root2.eachBefore(roundNode);
return root2;
}
function positionNode(node2) {
var p2 = paddingStack[node2.depth], x02 = node2.x0 + p2, y02 = node2.y0 + p2, x12 = node2.x1 - p2, y12 = node2.y1 - p2;
if (x12 < x02)
x02 = x12 = (x02 + x12) / 2;
if (y12 < y02)
y02 = y12 = (y02 + y12) / 2;
node2.x0 = x02;
node2.y0 = y02;
node2.x1 = x12;
node2.y1 = y12;
if (node2.children) {
p2 = paddingStack[node2.depth + 1] = paddingInner(node2) / 2;
x02 += paddingLeft2(node2) - p2;
y02 += paddingTop2(node2) - p2;
x12 -= paddingRight2(node2) - p2;
y12 -= paddingBottom2(node2) - p2;
if (x12 < x02)
x02 = x12 = (x02 + x12) / 2;
if (y12 < y02)
y02 = y12 = (y02 + y12) / 2;
tile(node2, x02, y02, x12, y12);
}
}
treemap2.round = function(x2) {
return arguments.length ? (round2 = !!x2, treemap2) : round2;
};
treemap2.size = function(x2) {
return arguments.length ? (dx = +x2[0], dy = +x2[1], treemap2) : [dx, dy];
};
treemap2.tile = function(x2) {
return arguments.length ? (tile = required(x2), treemap2) : tile;
};
treemap2.padding = function(x2) {
return arguments.length ? treemap2.paddingInner(x2).paddingOuter(x2) : treemap2.paddingInner();
};
treemap2.paddingInner = function(x2) {
return arguments.length ? (paddingInner = typeof x2 === "function" ? x2 : constant$1(+x2), treemap2) : paddingInner;
};
treemap2.paddingOuter = function(x2) {
return arguments.length ? treemap2.paddingTop(x2).paddingRight(x2).paddingBottom(x2).paddingLeft(x2) : treemap2.paddingTop();
};
treemap2.paddingTop = function(x2) {
return arguments.length ? (paddingTop2 = typeof x2 === "function" ? x2 : constant$1(+x2), treemap2) : paddingTop2;
};
treemap2.paddingRight = function(x2) {
return arguments.length ? (paddingRight2 = typeof x2 === "function" ? x2 : constant$1(+x2), treemap2) : paddingRight2;
};
treemap2.paddingBottom = function(x2) {
return arguments.length ? (paddingBottom2 = typeof x2 === "function" ? x2 : constant$1(+x2), treemap2) : paddingBottom2;
};
treemap2.paddingLeft = function(x2) {
return arguments.length ? (paddingLeft2 = typeof x2 === "function" ? x2 : constant$1(+x2), treemap2) : paddingLeft2;
};
return treemap2;
}
function treemapBinary(parent, x02, y02, x12, y12) {
var nodes = parent.children, i2, n2 = nodes.length, sum2, sums = new Array(n2 + 1);
for (sums[0] = sum2 = i2 = 0; i2 < n2; ++i2) {
sums[i2 + 1] = sum2 += nodes[i2].value;
}
partition2(0, n2, parent.value, x02, y02, x12, y12);
function partition2(i3, j2, value2, x03, y03, x13, y13) {
if (i3 >= j2 - 1) {
var node2 = nodes[i3];
node2.x0 = x03, node2.y0 = y03;
node2.x1 = x13, node2.y1 = y13;
return;
}
var valueOffset = sums[i3], valueTarget = value2 / 2 + valueOffset, k2 = i3 + 1, hi2 = j2 - 1;
while (k2 < hi2) {
var mid = k2 + hi2 >>> 1;
if (sums[mid] < valueTarget)
k2 = mid + 1;
else
hi2 = mid;
}
if (valueTarget - sums[k2 - 1] < sums[k2] - valueTarget && i3 + 1 < k2)
--k2;
var valueLeft = sums[k2] - valueOffset, valueRight = value2 - valueLeft;
if (x13 - x03 > y13 - y03) {
var xk2 = value2 ? (x03 * valueRight + x13 * valueLeft) / value2 : x13;
partition2(i3, k2, valueLeft, x03, y03, xk2, y13);
partition2(k2, j2, valueRight, xk2, y03, x13, y13);
} else {
var yk = value2 ? (y03 * valueRight + y13 * valueLeft) / value2 : y13;
partition2(i3, k2, valueLeft, x03, y03, x13, yk);
partition2(k2, j2, valueRight, x03, yk, x13, y13);
}
}
}
function treemapSliceDice(parent, x02, y02, x12, y12) {
(parent.depth & 1 ? treemapSlice : treemapDice)(parent, x02, y02, x12, y12);
}
const treemapResquarify = function custom10(ratio) {
function resquarify(parent, x02, y02, x12, y12) {
if ((rows = parent._squarify) && rows.ratio === ratio) {
var rows, row, nodes, i2, j2 = -1, n2, m2 = rows.length, value2 = parent.value;
while (++j2 < m2) {
row = rows[j2], nodes = row.children;
for (i2 = row.value = 0, n2 = nodes.length; i2 < n2; ++i2)
row.value += nodes[i2].value;
if (row.dice)
treemapDice(row, x02, y02, x12, value2 ? y02 += (y12 - y02) * row.value / value2 : y12);
else
treemapSlice(row, x02, y02, value2 ? x02 += (x12 - x02) * row.value / value2 : x12, y12);
value2 -= row.value;
}
} else {
parent._squarify = rows = squarifyRatio(ratio, parent, x02, y02, x12, y12);
rows.ratio = ratio;
}
}
resquarify.ratio = function(x2) {
return custom10((x2 = +x2) > 1 ? x2 : 1);
};
return resquarify;
}(phi);
function lookup$6(tree2, key2, filter2) {
const map2 = {};
tree2.each((node2) => {
const t5 = node2.data;
if (filter2(t5))
map2[key2(t5)] = node2;
});
tree2.lookup = map2;
return tree2;
}
function Nest(params2) {
Transform$1.call(this, null, params2);
}
Nest.Definition = {
"type": "Nest",
"metadata": {
"treesource": true,
"changes": true
},
"params": [{
"name": "keys",
"type": "field",
"array": true
}, {
"name": "generate",
"type": "boolean"
}]
};
const children$1 = (n2) => n2.values;
inherits(Nest, Transform$1, {
transform(_24, pulse2) {
if (!pulse2.source) {
error2("Nest transform requires an upstream data source.");
}
var gen = _24.generate, mod = _24.modified(), out = pulse2.clone(), tree2 = this.value;
if (!tree2 || mod || pulse2.changed()) {
if (tree2) {
tree2.each((node2) => {
if (node2.children && isTuple(node2.data)) {
out.rem.push(node2.data);
}
});
}
this.value = tree2 = hierarchy({
values: array$5(_24.keys).reduce((n2, k2) => {
n2.key(k2);
return n2;
}, nest()).entries(out.source)
}, children$1);
if (gen) {
tree2.each((node2) => {
if (node2.children) {
node2 = ingest$1(node2.data);
out.add.push(node2);
out.source.push(node2);
}
});
}
lookup$6(tree2, tupleid, tupleid);
}
out.source.root = tree2;
return out;
}
});
function nest() {
const keys3 = [], nest2 = {
entries: (array2) => entries(apply2(array2, 0), 0),
key: (d2) => (keys3.push(d2), nest2)
};
function apply2(array2, depth) {
if (depth >= keys3.length) {
return array2;
}
const n2 = array2.length, key2 = keys3[depth++], valuesByKey = {}, result = {};
let i2 = -1, keyValue, value2, values2;
while (++i2 < n2) {
keyValue = key2(value2 = array2[i2]) + "";
if (values2 = valuesByKey[keyValue]) {
values2.push(value2);
} else {
valuesByKey[keyValue] = [value2];
}
}
for (keyValue in valuesByKey) {
result[keyValue] = apply2(valuesByKey[keyValue], depth);
}
return result;
}
function entries(map2, depth) {
if (++depth > keys3.length)
return map2;
const array2 = [];
for (const key2 in map2) {
array2.push({
key: key2,
values: entries(map2[key2], depth)
});
}
return array2;
}
return nest2;
}
function HierarchyLayout(params2) {
Transform$1.call(this, null, params2);
}
const defaultSeparation = (a2, b2) => a2.parent === b2.parent ? 1 : 2;
inherits(HierarchyLayout, Transform$1, {
transform(_24, pulse2) {
if (!pulse2.source || !pulse2.source.root) {
error2(this.constructor.name + " transform requires a backing tree data source.");
}
const layout = this.layout(_24.method), fields = this.fields, root2 = pulse2.source.root, as = _24.as || fields;
if (_24.field)
root2.sum(_24.field);
else
root2.count();
if (_24.sort)
root2.sort(stableCompare(_24.sort, (d2) => d2.data));
setParams(layout, this.params, _24);
if (layout.separation) {
layout.separation(_24.separation !== false ? defaultSeparation : one$2);
}
try {
this.value = layout(root2);
} catch (err) {
error2(err);
}
root2.each((node2) => setFields(node2, fields, as));
return pulse2.reflow(_24.modified()).modifies(as).modifies("leaf");
}
});
function setParams(layout, params2, _24) {
for (let p2, i2 = 0, n2 = params2.length; i2 < n2; ++i2) {
p2 = params2[i2];
if (p2 in _24)
layout[p2](_24[p2]);
}
}
function setFields(node2, fields, as) {
const t5 = node2.data, n2 = fields.length - 1;
for (let i2 = 0; i2 < n2; ++i2) {
t5[as[i2]] = node2[fields[i2]];
}
t5[as[n2]] = node2.children ? node2.children.length : 0;
}
const Output$3 = ["x", "y", "r", "depth", "children"];
function Pack(params2) {
HierarchyLayout.call(this, params2);
}
Pack.Definition = {
"type": "Pack",
"metadata": {
"tree": true,
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "sort",
"type": "compare"
}, {
"name": "padding",
"type": "number",
"default": 0
}, {
"name": "radius",
"type": "field",
"default": null
}, {
"name": "size",
"type": "number",
"array": true,
"length": 2
}, {
"name": "as",
"type": "string",
"array": true,
"length": Output$3.length,
"default": Output$3
}]
};
inherits(Pack, HierarchyLayout, {
layout: pack$1,
params: ["radius", "size", "padding"],
fields: Output$3
});
const Output$2 = ["x0", "y0", "x1", "y1", "depth", "children"];
function Partition(params2) {
HierarchyLayout.call(this, params2);
}
Partition.Definition = {
"type": "Partition",
"metadata": {
"tree": true,
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "sort",
"type": "compare"
}, {
"name": "padding",
"type": "number",
"default": 0
}, {
"name": "round",
"type": "boolean",
"default": false
}, {
"name": "size",
"type": "number",
"array": true,
"length": 2
}, {
"name": "as",
"type": "string",
"array": true,
"length": Output$2.length,
"default": Output$2
}]
};
inherits(Partition, HierarchyLayout, {
layout: partition$1,
params: ["size", "round", "padding"],
fields: Output$2
});
function Stratify(params2) {
Transform$1.call(this, null, params2);
}
Stratify.Definition = {
"type": "Stratify",
"metadata": {
"treesource": true
},
"params": [{
"name": "key",
"type": "field",
"required": true
}, {
"name": "parentKey",
"type": "field",
"required": true
}]
};
inherits(Stratify, Transform$1, {
transform(_24, pulse2) {
if (!pulse2.source) {
error2("Stratify transform requires an upstream data source.");
}
let tree2 = this.value;
const mod = _24.modified(), out = pulse2.fork(pulse2.ALL).materialize(pulse2.SOURCE), run2 = !tree2 || mod || pulse2.changed(pulse2.ADD_REM) || pulse2.modified(_24.key.fields) || pulse2.modified(_24.parentKey.fields);
out.source = out.source.slice();
if (run2) {
tree2 = out.source.length ? lookup$6(stratify().id(_24.key).parentId(_24.parentKey)(out.source), _24.key, truthy) : lookup$6(stratify()([{}]), _24.key, _24.key);
}
out.source.root = this.value = tree2;
return out;
}
});
const Layouts = {
tidy: tree$1,
cluster
};
const Output$1$1 = ["x", "y", "depth", "children"];
function Tree(params2) {
HierarchyLayout.call(this, params2);
}
Tree.Definition = {
"type": "Tree",
"metadata": {
"tree": true,
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "sort",
"type": "compare"
}, {
"name": "method",
"type": "enum",
"default": "tidy",
"values": ["tidy", "cluster"]
}, {
"name": "size",
"type": "number",
"array": true,
"length": 2
}, {
"name": "nodeSize",
"type": "number",
"array": true,
"length": 2
}, {
"name": "separation",
"type": "boolean",
"default": true
}, {
"name": "as",
"type": "string",
"array": true,
"length": Output$1$1.length,
"default": Output$1$1
}]
};
inherits(Tree, HierarchyLayout, {
/**
* Tree layout generator. Supports both 'tidy' and 'cluster' layouts.
*/
layout(method) {
const m2 = method || "tidy";
if (has$2(Layouts, m2))
return Layouts[m2]();
else
error2("Unrecognized Tree layout method: " + m2);
},
params: ["size", "nodeSize"],
fields: Output$1$1
});
function TreeLinks(params2) {
Transform$1.call(this, [], params2);
}
TreeLinks.Definition = {
"type": "TreeLinks",
"metadata": {
"tree": true,
"generates": true,
"changes": true
},
"params": []
};
inherits(TreeLinks, Transform$1, {
transform(_24, pulse2) {
const links = this.value, tree2 = pulse2.source && pulse2.source.root, out = pulse2.fork(pulse2.NO_SOURCE), lut = {};
if (!tree2)
error2("TreeLinks transform requires a tree data source.");
if (pulse2.changed(pulse2.ADD_REM)) {
out.rem = links;
pulse2.visit(pulse2.SOURCE, (t5) => lut[tupleid(t5)] = 1);
tree2.each((node2) => {
const t5 = node2.data, p2 = node2.parent && node2.parent.data;
if (p2 && lut[tupleid(t5)] && lut[tupleid(p2)]) {
out.add.push(ingest$1({
source: p2,
target: t5
}));
}
});
this.value = out.add;
} else if (pulse2.changed(pulse2.MOD)) {
pulse2.visit(pulse2.MOD, (t5) => lut[tupleid(t5)] = 1);
links.forEach((link2) => {
if (lut[tupleid(link2.source)] || lut[tupleid(link2.target)]) {
out.mod.push(link2);
}
});
}
return out;
}
});
const Tiles = {
binary: treemapBinary,
dice: treemapDice,
slice: treemapSlice,
slicedice: treemapSliceDice,
squarify: treemapSquarify,
resquarify: treemapResquarify
};
const Output$4 = ["x0", "y0", "x1", "y1", "depth", "children"];
function Treemap(params2) {
HierarchyLayout.call(this, params2);
}
Treemap.Definition = {
"type": "Treemap",
"metadata": {
"tree": true,
"modifies": true
},
"params": [{
"name": "field",
"type": "field"
}, {
"name": "sort",
"type": "compare"
}, {
"name": "method",
"type": "enum",
"default": "squarify",
"values": ["squarify", "resquarify", "binary", "dice", "slice", "slicedice"]
}, {
"name": "padding",
"type": "number",
"default": 0
}, {
"name": "paddingInner",
"type": "number",
"default": 0
}, {
"name": "paddingOuter",
"type": "number",
"default": 0
}, {
"name": "paddingTop",
"type": "number",
"default": 0
}, {
"name": "paddingRight",
"type": "number",
"default": 0
}, {
"name": "paddingBottom",
"type": "number",
"default": 0
}, {
"name": "paddingLeft",
"type": "number",
"default": 0
}, {
"name": "ratio",
"type": "number",
"default": 1.618033988749895
}, {
"name": "round",
"type": "boolean",
"default": false
}, {
"name": "size",
"type": "number",
"array": true,
"length": 2
}, {
"name": "as",
"type": "string",
"array": true,
"length": Output$4.length,
"default": Output$4
}]
};
inherits(Treemap, HierarchyLayout, {
/**
* Treemap layout generator. Adds 'method' and 'ratio' parameters
* to configure the underlying tile method.
*/
layout() {
const x2 = treemap();
x2.ratio = (_24) => {
const t5 = x2.tile();
if (t5.ratio)
x2.tile(t5.ratio(_24));
};
x2.method = (_24) => {
if (has$2(Tiles, _24))
x2.tile(Tiles[_24]);
else
error2("Unrecognized Treemap layout method: " + _24);
};
return x2;
},
params: ["method", "ratio", "size", "round", "padding", "paddingInner", "paddingOuter", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
fields: Output$4
});
const tree = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
nest: Nest,
pack: Pack,
partition: Partition,
stratify: Stratify,
tree: Tree,
treelinks: TreeLinks,
treemap: Treemap
}, Symbol.toStringTag, { value: "Module" }));
const ALPHA_MASK = 4278190080;
function baseBitmaps($2, data2) {
const bitmap = $2.bitmap();
(data2 || []).forEach((d2) => bitmap.set($2(d2.boundary[0]), $2(d2.boundary[3])));
return [bitmap, void 0];
}
function markBitmaps($2, baseMark, avoidMarks, labelInside, isGroupArea) {
const width2 = $2.width, height2 = $2.height, border = labelInside || isGroupArea, context2 = domCanvas(width2, height2).getContext("2d"), baseMarkContext = domCanvas(width2, height2).getContext("2d"), strokeContext = border && domCanvas(width2, height2).getContext("2d");
avoidMarks.forEach((items) => draw(context2, items, false));
draw(baseMarkContext, baseMark, false);
if (border) {
draw(strokeContext, baseMark, true);
}
const buffer = getBuffer(context2, width2, height2), baseMarkBuffer = getBuffer(baseMarkContext, width2, height2), strokeBuffer = border && getBuffer(strokeContext, width2, height2), layer1 = $2.bitmap(), layer2 = border && $2.bitmap();
let x2, y2, u2, v2, index2, alpha, strokeAlpha, baseMarkAlpha;
for (y2 = 0; y2 < height2; ++y2) {
for (x2 = 0; x2 < width2; ++x2) {
index2 = y2 * width2 + x2;
alpha = buffer[index2] & ALPHA_MASK;
baseMarkAlpha = baseMarkBuffer[index2] & ALPHA_MASK;
strokeAlpha = border && strokeBuffer[index2] & ALPHA_MASK;
if (alpha || strokeAlpha || baseMarkAlpha) {
u2 = $2(x2);
v2 = $2(y2);
if (!isGroupArea && (alpha || baseMarkAlpha))
layer1.set(u2, v2);
if (border && (alpha || strokeAlpha))
layer2.set(u2, v2);
}
}
}
return [layer1, layer2];
}
function getBuffer(context2, width2, height2) {
return new Uint32Array(context2.getImageData(0, 0, width2, height2).data.buffer);
}
function draw(context2, items, interior) {
if (!items.length)
return;
const type2 = items[0].mark.marktype;
if (type2 === "group") {
items.forEach((group2) => {
group2.items.forEach((mark) => draw(context2, mark.items, interior));
});
} else {
Marks[type2].draw(context2, {
items: interior ? items.map(prepare) : items
});
}
}
function prepare(source2) {
const item = rederive(source2, {});
if (item.stroke && item.strokeOpacity !== 0 || item.fill && item.fillOpacity !== 0) {
return {
...item,
strokeOpacity: 1,
stroke: "#000",
fillOpacity: 0
};
}
return item;
}
const DIV = 5, MOD = 31, SIZE = 32, RIGHT0 = new Uint32Array(SIZE + 1), RIGHT1 = new Uint32Array(SIZE + 1);
RIGHT1[0] = 0;
RIGHT0[0] = ~RIGHT1[0];
for (let i2 = 1; i2 <= SIZE; ++i2) {
RIGHT1[i2] = RIGHT1[i2 - 1] << 1 | 1;
RIGHT0[i2] = ~RIGHT1[i2];
}
function Bitmap(w2, h2) {
const array2 = new Uint32Array(~~((w2 * h2 + SIZE) / SIZE));
function _set(index2, mask) {
array2[index2] |= mask;
}
function _clear(index2, mask) {
array2[index2] &= mask;
}
return {
array: array2,
get: (x2, y2) => {
const index2 = y2 * w2 + x2;
return array2[index2 >>> DIV] & 1 << (index2 & MOD);
},
set: (x2, y2) => {
const index2 = y2 * w2 + x2;
_set(index2 >>> DIV, 1 << (index2 & MOD));
},
clear: (x2, y2) => {
const index2 = y2 * w2 + x2;
_clear(index2 >>> DIV, ~(1 << (index2 & MOD)));
},
getRange: (x2, y2, x22, y22) => {
let r2 = y22, start2, end2, indexStart, indexEnd;
for (; r2 >= y2; --r2) {
start2 = r2 * w2 + x2;
end2 = r2 * w2 + x22;
indexStart = start2 >>> DIV;
indexEnd = end2 >>> DIV;
if (indexStart === indexEnd) {
if (array2[indexStart] & RIGHT0[start2 & MOD] & RIGHT1[(end2 & MOD) + 1]) {
return true;
}
} else {
if (array2[indexStart] & RIGHT0[start2 & MOD])
return true;
if (array2[indexEnd] & RIGHT1[(end2 & MOD) + 1])
return true;
for (let i2 = indexStart + 1; i2 < indexEnd; ++i2) {
if (array2[i2])
return true;
}
}
}
return false;
},
setRange: (x2, y2, x22, y22) => {
let start2, end2, indexStart, indexEnd, i2;
for (; y2 <= y22; ++y2) {
start2 = y2 * w2 + x2;
end2 = y2 * w2 + x22;
indexStart = start2 >>> DIV;
indexEnd = end2 >>> DIV;
if (indexStart === indexEnd) {
_set(indexStart, RIGHT0[start2 & MOD] & RIGHT1[(end2 & MOD) + 1]);
} else {
_set(indexStart, RIGHT0[start2 & MOD]);
_set(indexEnd, RIGHT1[(end2 & MOD) + 1]);
for (i2 = indexStart + 1; i2 < indexEnd; ++i2)
_set(i2, 4294967295);
}
}
},
clearRange: (x2, y2, x22, y22) => {
let start2, end2, indexStart, indexEnd, i2;
for (; y2 <= y22; ++y2) {
start2 = y2 * w2 + x2;
end2 = y2 * w2 + x22;
indexStart = start2 >>> DIV;
indexEnd = end2 >>> DIV;
if (indexStart === indexEnd) {
_clear(indexStart, RIGHT1[start2 & MOD] | RIGHT0[(end2 & MOD) + 1]);
} else {
_clear(indexStart, RIGHT1[start2 & MOD]);
_clear(indexEnd, RIGHT0[(end2 & MOD) + 1]);
for (i2 = indexStart + 1; i2 < indexEnd; ++i2)
_clear(i2, 0);
}
}
},
outOfBounds: (x2, y2, x22, y22) => x2 < 0 || y2 < 0 || y22 >= h2 || x22 >= w2
};
}
function scaler(width2, height2, padding2) {
const ratio = Math.max(1, Math.sqrt(width2 * height2 / 1e6)), w2 = ~~((width2 + 2 * padding2 + ratio) / ratio), h2 = ~~((height2 + 2 * padding2 + ratio) / ratio), scale2 = (_24) => ~~((_24 + padding2) / ratio);
scale2.invert = (_24) => _24 * ratio - padding2;
scale2.bitmap = () => Bitmap(w2, h2);
scale2.ratio = ratio;
scale2.padding = padding2;
scale2.width = width2;
scale2.height = height2;
return scale2;
}
function placeAreaLabelNaive($2, bitmaps, avoidBaseMark, markIndex) {
const width2 = $2.width, height2 = $2.height;
return function(d2) {
const items = d2.datum.datum.items[markIndex].items, n2 = items.length, textHeight = d2.datum.fontSize, textWidth = textMetrics.width(d2.datum, d2.datum.text);
let maxAreaWidth = 0, x12, x2, y12, y2, x3, y3, areaWidth;
for (let i2 = 0; i2 < n2; ++i2) {
x12 = items[i2].x;
y12 = items[i2].y;
x2 = items[i2].x2 === void 0 ? x12 : items[i2].x2;
y2 = items[i2].y2 === void 0 ? y12 : items[i2].y2;
x3 = (x12 + x2) / 2;
y3 = (y12 + y2) / 2;
areaWidth = Math.abs(x2 - x12 + y2 - y12);
if (areaWidth >= maxAreaWidth) {
maxAreaWidth = areaWidth;
d2.x = x3;
d2.y = y3;
}
}
x3 = textWidth / 2;
y3 = textHeight / 2;
x12 = d2.x - x3;
x2 = d2.x + x3;
y12 = d2.y - y3;
y2 = d2.y + y3;
d2.align = "center";
if (x12 < 0 && x2 <= width2) {
d2.align = "left";
} else if (0 <= x12 && width2 < x2) {
d2.align = "right";
}
d2.baseline = "middle";
if (y12 < 0 && y2 <= height2) {
d2.baseline = "top";
} else if (0 <= y12 && height2 < y2) {
d2.baseline = "bottom";
}
return true;
};
}
function outOfBounds(x2, y2, textWidth, textHeight, width2, height2) {
let r2 = textWidth / 2;
return x2 - r2 < 0 || x2 + r2 > width2 || y2 - (r2 = textHeight / 2) < 0 || y2 + r2 > height2;
}
function collision($2, x2, y2, textHeight, textWidth, h2, bm0, bm1) {
const w2 = textWidth * h2 / (textHeight * 2), x12 = $2(x2 - w2), x22 = $2(x2 + w2), y12 = $2(y2 - (h2 = h2 / 2)), y22 = $2(y2 + h2);
return bm0.outOfBounds(x12, y12, x22, y22) || bm0.getRange(x12, y12, x22, y22) || bm1 && bm1.getRange(x12, y12, x22, y22);
}
function placeAreaLabelReducedSearch($2, bitmaps, avoidBaseMark, markIndex) {
const width2 = $2.width, height2 = $2.height, bm0 = bitmaps[0], bm1 = bitmaps[1];
function tryLabel(_x, _y, maxSize, textWidth, textHeight) {
const x2 = $2.invert(_x), y2 = $2.invert(_y);
let lo2 = maxSize, hi2 = height2, mid;
if (!outOfBounds(x2, y2, textWidth, textHeight, width2, height2) && !collision($2, x2, y2, textHeight, textWidth, lo2, bm0, bm1) && !collision($2, x2, y2, textHeight, textWidth, textHeight, bm0, null)) {
while (hi2 - lo2 >= 1) {
mid = (lo2 + hi2) / 2;
if (collision($2, x2, y2, textHeight, textWidth, mid, bm0, bm1)) {
hi2 = mid;
} else {
lo2 = mid;
}
}
if (lo2 > maxSize) {
return [x2, y2, lo2, true];
}
}
}
return function(d2) {
const items = d2.datum.datum.items[markIndex].items, n2 = items.length, textHeight = d2.datum.fontSize, textWidth = textMetrics.width(d2.datum, d2.datum.text);
let maxSize = avoidBaseMark ? textHeight : 0, labelPlaced = false, labelPlaced2 = false, maxAreaWidth = 0, x12, x2, y12, y2, x3, y3, _x, _y, _x1, _xMid, _x2, _y1, _yMid, _y2, areaWidth, result, swapTmp;
for (let i2 = 0; i2 < n2; ++i2) {
x12 = items[i2].x;
y12 = items[i2].y;
x2 = items[i2].x2 === void 0 ? x12 : items[i2].x2;
y2 = items[i2].y2 === void 0 ? y12 : items[i2].y2;
if (x12 > x2) {
swapTmp = x12;
x12 = x2;
x2 = swapTmp;
}
if (y12 > y2) {
swapTmp = y12;
y12 = y2;
y2 = swapTmp;
}
_x1 = $2(x12);
_x2 = $2(x2);
_xMid = ~~((_x1 + _x2) / 2);
_y1 = $2(y12);
_y2 = $2(y2);
_yMid = ~~((_y1 + _y2) / 2);
for (_x = _xMid; _x >= _x1; --_x) {
for (_y = _yMid; _y >= _y1; --_y) {
result = tryLabel(_x, _y, maxSize, textWidth, textHeight);
if (result) {
[d2.x, d2.y, maxSize, labelPlaced] = result;
}
}
}
for (_x = _xMid; _x <= _x2; ++_x) {
for (_y = _yMid; _y <= _y2; ++_y) {
result = tryLabel(_x, _y, maxSize, textWidth, textHeight);
if (result) {
[d2.x, d2.y, maxSize, labelPlaced] = result;
}
}
}
if (!labelPlaced && !avoidBaseMark) {
areaWidth = Math.abs(x2 - x12 + y2 - y12);
x3 = (x12 + x2) / 2;
y3 = (y12 + y2) / 2;
if (areaWidth >= maxAreaWidth && !outOfBounds(x3, y3, textWidth, textHeight, width2, height2) && !collision($2, x3, y3, textHeight, textWidth, textHeight, bm0, null)) {
maxAreaWidth = areaWidth;
d2.x = x3;
d2.y = y3;
labelPlaced2 = true;
}
}
}
if (labelPlaced || labelPlaced2) {
x3 = textWidth / 2;
y3 = textHeight / 2;
bm0.setRange($2(d2.x - x3), $2(d2.y - y3), $2(d2.x + x3), $2(d2.y + y3));
d2.align = "center";
d2.baseline = "middle";
return true;
} else {
return false;
}
};
}
const X_DIR = [-1, -1, 1, 1];
const Y_DIR = [-1, 1, -1, 1];
function placeAreaLabelFloodFill($2, bitmaps, avoidBaseMark, markIndex) {
const width2 = $2.width, height2 = $2.height, bm0 = bitmaps[0], bm1 = bitmaps[1], bm2 = $2.bitmap();
return function(d2) {
const items = d2.datum.datum.items[markIndex].items, n2 = items.length, textHeight = d2.datum.fontSize, textWidth = textMetrics.width(d2.datum, d2.datum.text), stack = [];
let maxSize = avoidBaseMark ? textHeight : 0, labelPlaced = false, labelPlaced2 = false, maxAreaWidth = 0, x12, x2, y12, y2, x3, y3, _x, _y, lo2, hi2, mid, areaWidth;
for (let i2 = 0; i2 < n2; ++i2) {
x12 = items[i2].x;
y12 = items[i2].y;
x2 = items[i2].x2 === void 0 ? x12 : items[i2].x2;
y2 = items[i2].y2 === void 0 ? y12 : items[i2].y2;
stack.push([$2((x12 + x2) / 2), $2((y12 + y2) / 2)]);
while (stack.length) {
[_x, _y] = stack.pop();
if (bm0.get(_x, _y) || bm1.get(_x, _y) || bm2.get(_x, _y))
continue;
bm2.set(_x, _y);
for (let j2 = 0; j2 < 4; ++j2) {
x3 = _x + X_DIR[j2];
y3 = _y + Y_DIR[j2];
if (!bm2.outOfBounds(x3, y3, x3, y3))
stack.push([x3, y3]);
}
x3 = $2.invert(_x);
y3 = $2.invert(_y);
lo2 = maxSize;
hi2 = height2;
if (!outOfBounds(x3, y3, textWidth, textHeight, width2, height2) && !collision($2, x3, y3, textHeight, textWidth, lo2, bm0, bm1) && !collision($2, x3, y3, textHeight, textWidth, textHeight, bm0, null)) {
while (hi2 - lo2 >= 1) {
mid = (lo2 + hi2) / 2;
if (collision($2, x3, y3, textHeight, textWidth, mid, bm0, bm1)) {
hi2 = mid;
} else {
lo2 = mid;
}
}
if (lo2 > maxSize) {
d2.x = x3;
d2.y = y3;
maxSize = lo2;
labelPlaced = true;
}
}
}
if (!labelPlaced && !avoidBaseMark) {
areaWidth = Math.abs(x2 - x12 + y2 - y12);
x3 = (x12 + x2) / 2;
y3 = (y12 + y2) / 2;
if (areaWidth >= maxAreaWidth && !outOfBounds(x3, y3, textWidth, textHeight, width2, height2) && !collision($2, x3, y3, textHeight, textWidth, textHeight, bm0, null)) {
maxAreaWidth = areaWidth;
d2.x = x3;
d2.y = y3;
labelPlaced2 = true;
}
}
}
if (labelPlaced || labelPlaced2) {
x3 = textWidth / 2;
y3 = textHeight / 2;
bm0.setRange($2(d2.x - x3), $2(d2.y - y3), $2(d2.x + x3), $2(d2.y + y3));
d2.align = "center";
d2.baseline = "middle";
return true;
} else {
return false;
}
};
}
const Aligns = ["right", "center", "left"], Baselines = ["bottom", "middle", "top"];
function placeMarkLabel($2, bitmaps, anchors, offsets2) {
const width2 = $2.width, height2 = $2.height, bm0 = bitmaps[0], bm1 = bitmaps[1], n2 = offsets2.length;
return function(d2) {
const boundary = d2.boundary, textHeight = d2.datum.fontSize;
if (boundary[2] < 0 || boundary[5] < 0 || boundary[0] > width2 || boundary[3] > height2) {
return false;
}
let textWidth = d2.textWidth ?? 0, dx, dy, isInside, sizeFactor, insideFactor, x12, x2, y12, y2, xc2, yc2, _x1, _x2, _y1, _y2;
for (let i2 = 0; i2 < n2; ++i2) {
dx = (anchors[i2] & 3) - 1;
dy = (anchors[i2] >>> 2 & 3) - 1;
isInside = dx === 0 && dy === 0 || offsets2[i2] < 0;
sizeFactor = dx && dy ? Math.SQRT1_2 : 1;
insideFactor = offsets2[i2] < 0 ? -1 : 1;
x12 = boundary[1 + dx] + offsets2[i2] * dx * sizeFactor;
yc2 = boundary[4 + dy] + insideFactor * textHeight * dy / 2 + offsets2[i2] * dy * sizeFactor;
y12 = yc2 - textHeight / 2;
y2 = yc2 + textHeight / 2;
_x1 = $2(x12);
_y1 = $2(y12);
_y2 = $2(y2);
if (!textWidth) {
if (!test$2(_x1, _x1, _y1, _y2, bm0, bm1, x12, x12, y12, y2, boundary, isInside)) {
continue;
} else {
textWidth = textMetrics.width(d2.datum, d2.datum.text);
}
}
xc2 = x12 + insideFactor * textWidth * dx / 2;
x12 = xc2 - textWidth / 2;
x2 = xc2 + textWidth / 2;
_x1 = $2(x12);
_x2 = $2(x2);
if (test$2(_x1, _x2, _y1, _y2, bm0, bm1, x12, x2, y12, y2, boundary, isInside)) {
d2.x = !dx ? xc2 : dx * insideFactor < 0 ? x2 : x12;
d2.y = !dy ? yc2 : dy * insideFactor < 0 ? y2 : y12;
d2.align = Aligns[dx * insideFactor + 1];
d2.baseline = Baselines[dy * insideFactor + 1];
bm0.setRange(_x1, _y1, _x2, _y2);
return true;
}
}
return false;
};
}
function test$2(_x1, _x2, _y1, _y2, bm0, bm1, x12, x2, y12, y2, boundary, isInside) {
return !(bm0.outOfBounds(_x1, _y1, _x2, _y2) || (isInside && bm1 || bm0).getRange(_x1, _y1, _x2, _y2));
}
const TOP = 0, MIDDLE = 4, BOTTOM = 8, LEFT = 0, CENTER = 1, RIGHT = 2;
const anchorCode = {
"top-left": TOP + LEFT,
"top": TOP + CENTER,
"top-right": TOP + RIGHT,
"left": MIDDLE + LEFT,
"middle": MIDDLE + CENTER,
"right": MIDDLE + RIGHT,
"bottom-left": BOTTOM + LEFT,
"bottom": BOTTOM + CENTER,
"bottom-right": BOTTOM + RIGHT
};
const placeAreaLabel = {
"naive": placeAreaLabelNaive,
"reduced-search": placeAreaLabelReducedSearch,
"floodfill": placeAreaLabelFloodFill
};
function labelLayout(texts, size, compare3, offset2, anchor, avoidMarks, avoidBaseMark, lineAnchor, markIndex, padding2, method) {
if (!texts.length)
return texts;
const positions = Math.max(offset2.length, anchor.length), offsets2 = getOffsets(offset2, positions), anchors = getAnchors(anchor, positions), marktype = markType(texts[0].datum), grouptype = marktype === "group" && texts[0].datum.items[markIndex].marktype, isGroupArea = grouptype === "area", boundary = markBoundary(marktype, grouptype, lineAnchor, markIndex), infPadding = padding2 === null || padding2 === Infinity, isNaiveGroupArea = isGroupArea && method === "naive";
let maxTextWidth = -1, maxTextHeight = -1;
const data2 = texts.map((d2) => {
const textWidth = infPadding ? textMetrics.width(d2, d2.text) : void 0;
maxTextWidth = Math.max(maxTextWidth, textWidth);
maxTextHeight = Math.max(maxTextHeight, d2.fontSize);
return {
datum: d2,
opacity: 0,
x: void 0,
y: void 0,
align: void 0,
baseline: void 0,
boundary: boundary(d2),
textWidth
};
});
padding2 = padding2 === null || padding2 === Infinity ? Math.max(maxTextWidth, maxTextHeight) + Math.max(...offset2) : padding2;
const $2 = scaler(size[0], size[1], padding2);
let bitmaps;
if (!isNaiveGroupArea) {
if (compare3) {
data2.sort((a2, b2) => compare3(a2.datum, b2.datum));
}
let labelInside = false;
for (let i2 = 0; i2 < anchors.length && !labelInside; ++i2) {
labelInside = anchors[i2] === 5 || offsets2[i2] < 0;
}
const baseMark = (marktype && avoidBaseMark || isGroupArea) && texts.map((d2) => d2.datum);
bitmaps = avoidMarks.length || baseMark ? markBitmaps($2, baseMark || [], avoidMarks, labelInside, isGroupArea) : baseBitmaps($2, avoidBaseMark && data2);
}
const place2 = isGroupArea ? placeAreaLabel[method]($2, bitmaps, avoidBaseMark, markIndex) : placeMarkLabel($2, bitmaps, anchors, offsets2);
data2.forEach((d2) => d2.opacity = +place2(d2));
return data2;
}
function getOffsets(_24, count2) {
const offsets2 = new Float64Array(count2), n2 = _24.length;
for (let i2 = 0; i2 < n2; ++i2)
offsets2[i2] = _24[i2] || 0;
for (let i2 = n2; i2 < count2; ++i2)
offsets2[i2] = offsets2[n2 - 1];
return offsets2;
}
function getAnchors(_24, count2) {
const anchors = new Int8Array(count2), n2 = _24.length;
for (let i2 = 0; i2 < n2; ++i2)
anchors[i2] |= anchorCode[_24[i2]];
for (let i2 = n2; i2 < count2; ++i2)
anchors[i2] = anchors[n2 - 1];
return anchors;
}
function markType(item) {
return item && item.mark && item.mark.marktype;
}
function markBoundary(marktype, grouptype, lineAnchor, markIndex) {
const xy = (d2) => [d2.x, d2.x, d2.x, d2.y, d2.y, d2.y];
if (!marktype) {
return xy;
} else if (marktype === "line" || marktype === "area") {
return (d2) => xy(d2.datum);
} else if (grouptype === "line") {
return (d2) => {
const items = d2.datum.items[markIndex].items;
return xy(items.length ? items[lineAnchor === "start" ? 0 : items.length - 1] : {
x: NaN,
y: NaN
});
};
} else {
return (d2) => {
const b2 = d2.datum.bounds;
return [b2.x1, (b2.x1 + b2.x2) / 2, b2.x2, b2.y1, (b2.y1 + b2.y2) / 2, b2.y2];
};
}
}
const Output$1 = ["x", "y", "opacity", "align", "baseline"];
const Anchors = ["top-left", "left", "bottom-left", "top", "bottom", "top-right", "right", "bottom-right"];
function Label$1(params2) {
Transform$1.call(this, null, params2);
}
Label$1.Definition = {
type: "Label",
metadata: {
modifies: true
},
params: [{
name: "size",
type: "number",
array: true,
length: 2,
required: true
}, {
name: "sort",
type: "compare"
}, {
name: "anchor",
type: "string",
array: true,
default: Anchors
}, {
name: "offset",
type: "number",
array: true,
default: [1]
}, {
name: "padding",
type: "number",
default: 0,
null: true
}, {
name: "lineAnchor",
type: "string",
values: ["start", "end"],
default: "end"
}, {
name: "markIndex",
type: "number",
default: 0
}, {
name: "avoidBaseMark",
type: "boolean",
default: true
}, {
name: "avoidMarks",
type: "data",
array: true
}, {
name: "method",
type: "string",
default: "naive"
}, {
name: "as",
type: "string",
array: true,
length: Output$1.length,
default: Output$1
}]
};
inherits(Label$1, Transform$1, {
transform(_24, pulse2) {
function modp(param2) {
const p2 = _24[param2];
return isFunction(p2) && pulse2.modified(p2.fields);
}
const mod = _24.modified();
if (!(mod || pulse2.changed(pulse2.ADD_REM) || modp("sort")))
return;
if (!_24.size || _24.size.length !== 2) {
error2("Size parameter should be specified as a [width, height] array.");
}
const as = _24.as || Output$1;
labelLayout(pulse2.materialize(pulse2.SOURCE).source || [], _24.size, _24.sort, array$5(_24.offset == null ? 1 : _24.offset), array$5(_24.anchor || Anchors), _24.avoidMarks || [], _24.avoidBaseMark !== false, _24.lineAnchor || "end", _24.markIndex || 0, _24.padding === void 0 ? 0 : _24.padding, _24.method || "naive").forEach((l2) => {
const t5 = l2.datum;
t5[as[0]] = l2.x;
t5[as[1]] = l2.y;
t5[as[2]] = l2.opacity;
t5[as[3]] = l2.align;
t5[as[4]] = l2.baseline;
});
return pulse2.reflow(mod).modifies(as);
}
});
const label = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
label: Label$1
}, Symbol.toStringTag, { value: "Module" }));
function partition(data2, groupby) {
var groups = [], get2 = function(f2) {
return f2(t5);
}, map2, i2, n2, t5, k2, g2;
if (groupby == null) {
groups.push(data2);
} else {
for (map2 = {}, i2 = 0, n2 = data2.length; i2 < n2; ++i2) {
t5 = data2[i2];
k2 = groupby.map(get2);
g2 = map2[k2];
if (!g2) {
map2[k2] = g2 = [];
g2.dims = k2;
groups.push(g2);
}
g2.push(t5);
}
}
return groups;
}
function Loess(params2) {
Transform$1.call(this, null, params2);
}
Loess.Definition = {
"type": "Loess",
"metadata": {
"generates": true
},
"params": [{
"name": "x",
"type": "field",
"required": true
}, {
"name": "y",
"type": "field",
"required": true
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "bandwidth",
"type": "number",
"default": 0.3
}, {
"name": "as",
"type": "string",
"array": true
}]
};
inherits(Loess, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
if (!this.value || pulse2.changed() || _24.modified()) {
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition(source2, _24.groupby), names = (_24.groupby || []).map(accessorName), m2 = names.length, as = _24.as || [accessorName(_24.x), accessorName(_24.y)], values2 = [];
groups.forEach((g2) => {
loess(g2, _24.x, _24.y, _24.bandwidth || 0.3).forEach((p2) => {
const t5 = {};
for (let i2 = 0; i2 < m2; ++i2) {
t5[names[i2]] = g2.dims[i2];
}
t5[as[0]] = p2[0];
t5[as[1]] = p2[1];
values2.push(ingest$1(t5));
});
});
if (this.value)
out.rem = this.value;
this.value = out.add = out.source = values2;
}
return out;
}
});
const Methods = {
constant: constant$5,
linear: linear$3,
log: log$3,
exp: exp$1,
pow: pow$3,
quad,
poly
};
const degreesOfFreedom = (method, order2) => method === "poly" ? order2 : method === "quad" ? 2 : 1;
function Regression(params2) {
Transform$1.call(this, null, params2);
}
Regression.Definition = {
"type": "Regression",
"metadata": {
"generates": true
},
"params": [{
"name": "x",
"type": "field",
"required": true
}, {
"name": "y",
"type": "field",
"required": true
}, {
"name": "groupby",
"type": "field",
"array": true
}, {
"name": "method",
"type": "string",
"default": "linear",
"values": Object.keys(Methods)
}, {
"name": "order",
"type": "number",
"default": 3
}, {
"name": "extent",
"type": "number",
"array": true,
"length": 2
}, {
"name": "params",
"type": "boolean",
"default": false
}, {
"name": "as",
"type": "string",
"array": true
}]
};
inherits(Regression, Transform$1, {
transform(_24, pulse2) {
const out = pulse2.fork(pulse2.NO_SOURCE | pulse2.NO_FIELDS);
if (!this.value || pulse2.changed() || _24.modified()) {
const source2 = pulse2.materialize(pulse2.SOURCE).source, groups = partition(source2, _24.groupby), names = (_24.groupby || []).map(accessorName), method = _24.method || "linear", order2 = _24.order == null ? 3 : _24.order, dof = degreesOfFreedom(method, order2), as = _24.as || [accessorName(_24.x), accessorName(_24.y)], fit2 = Methods[method], values2 = [];
let domain2 = _24.extent;
if (!has$2(Methods, method)) {
error2("Invalid regression method: " + method);
}
if (domain2 != null) {
if (method === "log" && domain2[0] <= 0) {
pulse2.dataflow.warn("Ignoring extent with values <= 0 for log regression.");
domain2 = null;
}
}
groups.forEach((g2) => {
const n2 = g2.length;
if (n2 <= dof) {
pulse2.dataflow.warn("Skipping regression with more parameters than data points.");
return;
}
const model = fit2(g2, _24.x, _24.y, order2);
if (_24.params) {
values2.push(ingest$1({
keys: g2.dims,
coef: model.coef,
rSquared: model.rSquared
}));
return;
}
const dom = domain2 || extent(g2, _24.x), add3 = (p2) => {
const t5 = {};
for (let i2 = 0; i2 < names.length; ++i2) {
t5[names[i2]] = g2.dims[i2];
}
t5[as[0]] = p2[0];
t5[as[1]] = p2[1];
values2.push(ingest$1(t5));
};
if (method === "linear" || method === "constant") {
dom.forEach((x2) => add3([x2, model.predict(x2)]));
} else {
sampleCurve(model.predict, dom, 25, 200).forEach(add3);
}
});
if (this.value)
out.rem = this.value;
this.value = out.add = out.source = values2;
}
return out;
}
});
const reg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
loess: Loess,
regression: Regression
}, Symbol.toStringTag, { value: "Module" }));
const epsilon$1 = 11102230246251565e-32;
const splitter = 134217729;
const resulterrbound = (3 + 8 * epsilon$1) * epsilon$1;
function sum(elen, e7, flen, f2, h2) {
let Q2, Qnew, hh2, bvirt;
let enow = e7[0];
let fnow = f2[0];
let eindex = 0;
let findex = 0;
if (fnow > enow === fnow > -enow) {
Q2 = enow;
enow = e7[++eindex];
} else {
Q2 = fnow;
fnow = f2[++findex];
}
let hindex = 0;
if (eindex < elen && findex < flen) {
if (fnow > enow === fnow > -enow) {
Qnew = enow + Q2;
hh2 = Q2 - (Qnew - enow);
enow = e7[++eindex];
} else {
Qnew = fnow + Q2;
hh2 = Q2 - (Qnew - fnow);
fnow = f2[++findex];
}
Q2 = Qnew;
if (hh2 !== 0) {
h2[hindex++] = hh2;
}
while (eindex < elen && findex < flen) {
if (fnow > enow === fnow > -enow) {
Qnew = Q2 + enow;
bvirt = Qnew - Q2;
hh2 = Q2 - (Qnew - bvirt) + (enow - bvirt);
enow = e7[++eindex];
} else {
Qnew = Q2 + fnow;
bvirt = Qnew - Q2;
hh2 = Q2 - (Qnew - bvirt) + (fnow - bvirt);
fnow = f2[++findex];
}
Q2 = Qnew;
if (hh2 !== 0) {
h2[hindex++] = hh2;
}
}
}
while (eindex < elen) {
Qnew = Q2 + enow;
bvirt = Qnew - Q2;
hh2 = Q2 - (Qnew - bvirt) + (enow - bvirt);
enow = e7[++eindex];
Q2 = Qnew;
if (hh2 !== 0) {
h2[hindex++] = hh2;
}
}
while (findex < flen) {
Qnew = Q2 + fnow;
bvirt = Qnew - Q2;
hh2 = Q2 - (Qnew - bvirt) + (fnow - bvirt);
fnow = f2[++findex];
Q2 = Qnew;
if (hh2 !== 0) {
h2[hindex++] = hh2;
}
}
if (Q2 !== 0 || hindex === 0) {
h2[hindex++] = Q2;
}
return hindex;
}
function estimate(elen, e7) {
let Q2 = e7[0];
for (let i2 = 1; i2 < elen; i2++)
Q2 += e7[i2];
return Q2;
}
function vec(n2) {
return new Float64Array(n2);
}
const ccwerrboundA = (3 + 16 * epsilon$1) * epsilon$1;
const ccwerrboundB = (2 + 12 * epsilon$1) * epsilon$1;
const ccwerrboundC = (9 + 64 * epsilon$1) * epsilon$1 * epsilon$1;
const B$2 = vec(4);
const C1 = vec(8);
const C2 = vec(12);
const D$2 = vec(16);
const u$8 = vec(4);
function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
let acxtail, acytail, bcxtail, bcytail;
let bvirt, c2, ahi, alo, bhi, blo, _i2, _j, _0, s1, s0, t12, t02, u3;
const acx = ax - cx;
const bcx = bx - cx;
const acy = ay - cy;
const bcy = by - cy;
s1 = acx * bcy;
c2 = splitter * acx;
ahi = c2 - (c2 - acx);
alo = acx - ahi;
c2 = splitter * bcy;
bhi = c2 - (c2 - bcy);
blo = bcy - bhi;
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
t12 = acy * bcx;
c2 = splitter * acy;
ahi = c2 - (c2 - acy);
alo = acy - ahi;
c2 = splitter * bcx;
bhi = c2 - (c2 - bcx);
blo = bcx - bhi;
t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
_i2 = s0 - t02;
bvirt = s0 - _i2;
B$2[0] = s0 - (_i2 + bvirt) + (bvirt - t02);
_j = s1 + _i2;
bvirt = _j - s1;
_0 = s1 - (_j - bvirt) + (_i2 - bvirt);
_i2 = _0 - t12;
bvirt = _0 - _i2;
B$2[1] = _0 - (_i2 + bvirt) + (bvirt - t12);
u3 = _j + _i2;
bvirt = u3 - _j;
B$2[2] = _j - (u3 - bvirt) + (_i2 - bvirt);
B$2[3] = u3;
let det = estimate(4, B$2);
let errbound = ccwerrboundB * detsum;
if (det >= errbound || -det >= errbound) {
return det;
}
bvirt = ax - acx;
acxtail = ax - (acx + bvirt) + (bvirt - cx);
bvirt = bx - bcx;
bcxtail = bx - (bcx + bvirt) + (bvirt - cx);
bvirt = ay - acy;
acytail = ay - (acy + bvirt) + (bvirt - cy);
bvirt = by - bcy;
bcytail = by - (bcy + bvirt) + (bvirt - cy);
if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {
return det;
}
errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);
det += acx * bcytail + bcy * acxtail - (acy * bcxtail + bcx * acytail);
if (det >= errbound || -det >= errbound)
return det;
s1 = acxtail * bcy;
c2 = splitter * acxtail;
ahi = c2 - (c2 - acxtail);
alo = acxtail - ahi;
c2 = splitter * bcy;
bhi = c2 - (c2 - bcy);
blo = bcy - bhi;
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
t12 = acytail * bcx;
c2 = splitter * acytail;
ahi = c2 - (c2 - acytail);
alo = acytail - ahi;
c2 = splitter * bcx;
bhi = c2 - (c2 - bcx);
blo = bcx - bhi;
t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
_i2 = s0 - t02;
bvirt = s0 - _i2;
u$8[0] = s0 - (_i2 + bvirt) + (bvirt - t02);
_j = s1 + _i2;
bvirt = _j - s1;
_0 = s1 - (_j - bvirt) + (_i2 - bvirt);
_i2 = _0 - t12;
bvirt = _0 - _i2;
u$8[1] = _0 - (_i2 + bvirt) + (bvirt - t12);
u3 = _j + _i2;
bvirt = u3 - _j;
u$8[2] = _j - (u3 - bvirt) + (_i2 - bvirt);
u$8[3] = u3;
const C1len = sum(4, B$2, 4, u$8, C1);
s1 = acx * bcytail;
c2 = splitter * acx;
ahi = c2 - (c2 - acx);
alo = acx - ahi;
c2 = splitter * bcytail;
bhi = c2 - (c2 - bcytail);
blo = bcytail - bhi;
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
t12 = acy * bcxtail;
c2 = splitter * acy;
ahi = c2 - (c2 - acy);
alo = acy - ahi;
c2 = splitter * bcxtail;
bhi = c2 - (c2 - bcxtail);
blo = bcxtail - bhi;
t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
_i2 = s0 - t02;
bvirt = s0 - _i2;
u$8[0] = s0 - (_i2 + bvirt) + (bvirt - t02);
_j = s1 + _i2;
bvirt = _j - s1;
_0 = s1 - (_j - bvirt) + (_i2 - bvirt);
_i2 = _0 - t12;
bvirt = _0 - _i2;
u$8[1] = _0 - (_i2 + bvirt) + (bvirt - t12);
u3 = _j + _i2;
bvirt = u3 - _j;
u$8[2] = _j - (u3 - bvirt) + (_i2 - bvirt);
u$8[3] = u3;
const C2len = sum(C1len, C1, 4, u$8, C2);
s1 = acxtail * bcytail;
c2 = splitter * acxtail;
ahi = c2 - (c2 - acxtail);
alo = acxtail - ahi;
c2 = splitter * bcytail;
bhi = c2 - (c2 - bcytail);
blo = bcytail - bhi;
s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
t12 = acytail * bcxtail;
c2 = splitter * acytail;
ahi = c2 - (c2 - acytail);
alo = acytail - ahi;
c2 = splitter * bcxtail;
bhi = c2 - (c2 - bcxtail);
blo = bcxtail - bhi;
t02 = alo * blo - (t12 - ahi * bhi - alo * bhi - ahi * blo);
_i2 = s0 - t02;
bvirt = s0 - _i2;
u$8[0] = s0 - (_i2 + bvirt) + (bvirt - t02);
_j = s1 + _i2;
bvirt = _j - s1;
_0 = s1 - (_j - bvirt) + (_i2 - bvirt);
_i2 = _0 - t12;
bvirt = _0 - _i2;
u$8[1] = _0 - (_i2 + bvirt) + (bvirt - t12);
u3 = _j + _i2;
bvirt = u3 - _j;
u$8[2] = _j - (u3 - bvirt) + (_i2 - bvirt);
u$8[3] = u3;
const Dlen = sum(C2len, C2, 4, u$8, D$2);
return D$2[Dlen - 1];
}
function orient2d(ax, ay, bx, by, cx, cy) {
const detleft = (ay - cy) * (bx - cx);
const detright = (ax - cx) * (by - cy);
const det = detleft - detright;
const detsum = Math.abs(detleft + detright);
if (Math.abs(det) >= ccwerrboundA * detsum)
return det;
return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);
}
const EPSILON = Math.pow(2, -52);
const EDGE_STACK = new Uint32Array(512);
class Delaunator {
static from(points2, getX = defaultGetX, getY = defaultGetY) {
const n2 = points2.length;
const coords = new Float64Array(n2 * 2);
for (let i2 = 0; i2 < n2; i2++) {
const p2 = points2[i2];
coords[2 * i2] = getX(p2);
coords[2 * i2 + 1] = getY(p2);
}
return new Delaunator(coords);
}
constructor(coords) {
const n2 = coords.length >> 1;
if (n2 > 0 && typeof coords[0] !== "number")
throw new Error("Expected coords to contain numbers.");
this.coords = coords;
const maxTriangles = Math.max(2 * n2 - 5, 0);
this._triangles = new Uint32Array(maxTriangles * 3);
this._halfedges = new Int32Array(maxTriangles * 3);
this._hashSize = Math.ceil(Math.sqrt(n2));
this._hullPrev = new Uint32Array(n2);
this._hullNext = new Uint32Array(n2);
this._hullTri = new Uint32Array(n2);
this._hullHash = new Int32Array(this._hashSize).fill(-1);
this._ids = new Uint32Array(n2);
this._dists = new Float64Array(n2);
this.update();
}
update() {
const { coords, _hullPrev: hullPrev, _hullNext: hullNext, _hullTri: hullTri, _hullHash: hullHash } = this;
const n2 = coords.length >> 1;
let minX = Infinity;
let minY = Infinity;
let maxX = -Infinity;
let maxY2 = -Infinity;
for (let i3 = 0; i3 < n2; i3++) {
const x2 = coords[2 * i3];
const y2 = coords[2 * i3 + 1];
if (x2 < minX)
minX = x2;
if (y2 < minY)
minY = y2;
if (x2 > maxX)
maxX = x2;
if (y2 > maxY2)
maxY2 = y2;
this._ids[i3] = i3;
}
const cx = (minX + maxX) / 2;
const cy = (minY + maxY2) / 2;
let minDist = Infinity;
let i0, i1, i2;
for (let i3 = 0; i3 < n2; i3++) {
const d2 = dist(cx, cy, coords[2 * i3], coords[2 * i3 + 1]);
if (d2 < minDist) {
i0 = i3;
minDist = d2;
}
}
const i0x = coords[2 * i0];
const i0y = coords[2 * i0 + 1];
minDist = Infinity;
for (let i3 = 0; i3 < n2; i3++) {
if (i3 === i0)
continue;
const d2 = dist(i0x, i0y, coords[2 * i3], coords[2 * i3 + 1]);
if (d2 < minDist && d2 > 0) {
i1 = i3;
minDist = d2;
}
}
let i1x = coords[2 * i1];
let i1y = coords[2 * i1 + 1];
let minRadius = Infinity;
for (let i3 = 0; i3 < n2; i3++) {
if (i3 === i0 || i3 === i1)
continue;
const r2 = circumradius(i0x, i0y, i1x, i1y, coords[2 * i3], coords[2 * i3 + 1]);
if (r2 < minRadius) {
i2 = i3;
minRadius = r2;
}
}
let i2x = coords[2 * i2];
let i2y = coords[2 * i2 + 1];
if (minRadius === Infinity) {
for (let i3 = 0; i3 < n2; i3++) {
this._dists[i3] = coords[2 * i3] - coords[0] || coords[2 * i3 + 1] - coords[1];
}
quicksort(this._ids, this._dists, 0, n2 - 1);
const hull = new Uint32Array(n2);
let j2 = 0;
for (let i3 = 0, d0 = -Infinity; i3 < n2; i3++) {
const id = this._ids[i3];
if (this._dists[id] > d0) {
hull[j2++] = id;
d0 = this._dists[id];
}
}
this.hull = hull.subarray(0, j2);
this.triangles = new Uint32Array(0);
this.halfedges = new Uint32Array(0);
return;
}
if (orient2d(i0x, i0y, i1x, i1y, i2x, i2y) < 0) {
const i3 = i1;
const x2 = i1x;
const y2 = i1y;
i1 = i2;
i1x = i2x;
i1y = i2y;
i2 = i3;
i2x = x2;
i2y = y2;
}
const center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);
this._cx = center.x;
this._cy = center.y;
for (let i3 = 0; i3 < n2; i3++) {
this._dists[i3] = dist(coords[2 * i3], coords[2 * i3 + 1], center.x, center.y);
}
quicksort(this._ids, this._dists, 0, n2 - 1);
this._hullStart = i0;
let hullSize = 3;
hullNext[i0] = hullPrev[i2] = i1;
hullNext[i1] = hullPrev[i0] = i2;
hullNext[i2] = hullPrev[i1] = i0;
hullTri[i0] = 0;
hullTri[i1] = 1;
hullTri[i2] = 2;
hullHash.fill(-1);
hullHash[this._hashKey(i0x, i0y)] = i0;
hullHash[this._hashKey(i1x, i1y)] = i1;
hullHash[this._hashKey(i2x, i2y)] = i2;
this.trianglesLen = 0;
this._addTriangle(i0, i1, i2, -1, -1, -1);
for (let k2 = 0, xp, yp; k2 < this._ids.length; k2++) {
const i3 = this._ids[k2];
const x2 = coords[2 * i3];
const y2 = coords[2 * i3 + 1];
if (k2 > 0 && Math.abs(x2 - xp) <= EPSILON && Math.abs(y2 - yp) <= EPSILON)
continue;
xp = x2;
yp = y2;
if (i3 === i0 || i3 === i1 || i3 === i2)
continue;
let start2 = 0;
for (let j2 = 0, key2 = this._hashKey(x2, y2); j2 < this._hashSize; j2++) {
start2 = hullHash[(key2 + j2) % this._hashSize];
if (start2 !== -1 && start2 !== hullNext[start2])
break;
}
start2 = hullPrev[start2];
let e7 = start2, q2;
while (q2 = hullNext[e7], orient2d(x2, y2, coords[2 * e7], coords[2 * e7 + 1], coords[2 * q2], coords[2 * q2 + 1]) >= 0) {
e7 = q2;
if (e7 === start2) {
e7 = -1;
break;
}
}
if (e7 === -1)
continue;
let t5 = this._addTriangle(e7, i3, hullNext[e7], -1, -1, hullTri[e7]);
hullTri[i3] = this._legalize(t5 + 2);
hullTri[e7] = t5;
hullSize++;
let n3 = hullNext[e7];
while (q2 = hullNext[n3], orient2d(x2, y2, coords[2 * n3], coords[2 * n3 + 1], coords[2 * q2], coords[2 * q2 + 1]) < 0) {
t5 = this._addTriangle(n3, i3, q2, hullTri[i3], -1, hullTri[n3]);
hullTri[i3] = this._legalize(t5 + 2);
hullNext[n3] = n3;
hullSize--;
n3 = q2;
}
if (e7 === start2) {
while (q2 = hullPrev[e7], orient2d(x2, y2, coords[2 * q2], coords[2 * q2 + 1], coords[2 * e7], coords[2 * e7 + 1]) < 0) {
t5 = this._addTriangle(q2, i3, e7, -1, hullTri[e7], hullTri[q2]);
this._legalize(t5 + 2);
hullTri[q2] = t5;
hullNext[e7] = e7;
hullSize--;
e7 = q2;
}
}
this._hullStart = hullPrev[i3] = e7;
hullNext[e7] = hullPrev[n3] = i3;
hullNext[i3] = n3;
hullHash[this._hashKey(x2, y2)] = i3;
hullHash[this._hashKey(coords[2 * e7], coords[2 * e7 + 1])] = e7;
}
this.hull = new Uint32Array(hullSize);
for (let i3 = 0, e7 = this._hullStart; i3 < hullSize; i3++) {
this.hull[i3] = e7;
e7 = hullNext[e7];
}
this.triangles = this._triangles.subarray(0, this.trianglesLen);
this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
}
_hashKey(x2, y2) {
return Math.floor(pseudoAngle(x2 - this._cx, y2 - this._cy) * this._hashSize) % this._hashSize;
}
_legalize(a2) {
const { _triangles: triangles, _halfedges: halfedges, coords } = this;
let i2 = 0;
let ar2 = 0;
while (true) {
const b2 = halfedges[a2];
const a0 = a2 - a2 % 3;
ar2 = a0 + (a2 + 2) % 3;
if (b2 === -1) {
if (i2 === 0)
break;
a2 = EDGE_STACK[--i2];
continue;
}
const b0 = b2 - b2 % 3;
const al = a0 + (a2 + 1) % 3;
const bl2 = b0 + (b2 + 2) % 3;
const p02 = triangles[ar2];
const pr2 = triangles[a2];
const pl2 = triangles[al];
const p1 = triangles[bl2];
const illegal = inCircle(
coords[2 * p02],
coords[2 * p02 + 1],
coords[2 * pr2],
coords[2 * pr2 + 1],
coords[2 * pl2],
coords[2 * pl2 + 1],
coords[2 * p1],
coords[2 * p1 + 1]
);
if (illegal) {
triangles[a2] = p1;
triangles[b2] = p02;
const hbl = halfedges[bl2];
if (hbl === -1) {
let e7 = this._hullStart;
do {
if (this._hullTri[e7] === bl2) {
this._hullTri[e7] = a2;
break;
}
e7 = this._hullPrev[e7];
} while (e7 !== this._hullStart);
}
this._link(a2, hbl);
this._link(b2, halfedges[ar2]);
this._link(ar2, bl2);
const br2 = b0 + (b2 + 1) % 3;
if (i2 < EDGE_STACK.length) {
EDGE_STACK[i2++] = br2;
}
} else {
if (i2 === 0)
break;
a2 = EDGE_STACK[--i2];
}
}
return ar2;
}
_link(a2, b2) {
this._halfedges[a2] = b2;
if (b2 !== -1)
this._halfedges[b2] = a2;
}
// add a new triangle given vertex indices and adjacent half-edge ids
_addTriangle(i0, i1, i2, a2, b2, c2) {
const t5 = this.trianglesLen;
this._triangles[t5] = i0;
this._triangles[t5 + 1] = i1;
this._triangles[t5 + 2] = i2;
this._link(t5, a2);
this._link(t5 + 1, b2);
this._link(t5 + 2, c2);
this.trianglesLen += 3;
return t5;
}
}
function pseudoAngle(dx, dy) {
const p2 = dx / (Math.abs(dx) + Math.abs(dy));
return (dy > 0 ? 3 - p2 : 1 + p2) / 4;
}
function dist(ax, ay, bx, by) {
const dx = ax - bx;
const dy = ay - by;
return dx * dx + dy * dy;
}
function inCircle(ax, ay, bx, by, cx, cy, px2, py2) {
const dx = ax - px2;
const dy = ay - py2;
const ex = bx - px2;
const ey = by - py2;
const fx = cx - px2;
const fy = cy - py2;
const ap = dx * dx + dy * dy;
const bp = ex * ex + ey * ey;
const cp = fx * fx + fy * fy;
return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) < 0;
}
function circumradius(ax, ay, bx, by, cx, cy) {
const dx = bx - ax;
const dy = by - ay;
const ex = cx - ax;
const ey = cy - ay;
const bl2 = dx * dx + dy * dy;
const cl = ex * ex + ey * ey;
const d2 = 0.5 / (dx * ey - dy * ex);
const x2 = (ey * bl2 - dy * cl) * d2;
const y2 = (dx * cl - ex * bl2) * d2;
return x2 * x2 + y2 * y2;
}
function circumcenter(ax, ay, bx, by, cx, cy) {
const dx = bx - ax;
const dy = by - ay;
const ex = cx - ax;
const ey = cy - ay;
const bl2 = dx * dx + dy * dy;
const cl = ex * ex + ey * ey;
const d2 = 0.5 / (dx * ey - dy * ex);
const x2 = ax + (ey * bl2 - dy * cl) * d2;
const y2 = ay + (dx * cl - ex * bl2) * d2;
return { x: x2, y: y2 };
}
function quicksort(ids2, dists, left2, right2) {
if (right2 - left2 <= 20) {
for (let i2 = left2 + 1; i2 <= right2; i2++) {
const temp2 = ids2[i2];
const tempDist = dists[temp2];
let j2 = i2 - 1;
while (j2 >= left2 && dists[ids2[j2]] > tempDist)
ids2[j2 + 1] = ids2[j2--];
ids2[j2 + 1] = temp2;
}
} else {
const median2 = left2 + right2 >> 1;
let i2 = left2 + 1;
let j2 = right2;
swap(ids2, median2, i2);
if (dists[ids2[left2]] > dists[ids2[right2]])
swap(ids2, left2, right2);
if (dists[ids2[i2]] > dists[ids2[right2]])
swap(ids2, i2, right2);
if (dists[ids2[left2]] > dists[ids2[i2]])
swap(ids2, left2, i2);
const temp2 = ids2[i2];
const tempDist = dists[temp2];
while (true) {
do
i2++;
while (dists[ids2[i2]] < tempDist);
do
j2--;
while (dists[ids2[j2]] > tempDist);
if (j2 < i2)
break;
swap(ids2, i2, j2);
}
ids2[left2 + 1] = ids2[j2];
ids2[j2] = temp2;
if (right2 - i2 + 1 >= j2 - left2) {
quicksort(ids2, dists, i2, right2);
quicksort(ids2, dists, left2, j2 - 1);
} else {
quicksort(ids2, dists, left2, j2 - 1);
quicksort(ids2, dists, i2, right2);
}
}
}
function swap(arr2, i2, j2) {
const tmp = arr2[i2];
arr2[i2] = arr2[j2];
arr2[j2] = tmp;
}
function defaultGetX(p2) {
return p2[0];
}
function defaultGetY(p2) {
return p2[1];
}
const epsilon = 1e-6;
class Path2 {
constructor() {
this._x0 = this._y0 = // start of current subpath
this._x1 = this._y1 = null;
this._ = "";
}
moveTo(x2, y2) {
this._ += `M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
}
closePath() {
if (this._x1 !== null) {
this._x1 = this._x0, this._y1 = this._y0;
this._ += "Z";
}
}
lineTo(x2, y2) {
this._ += `L${this._x1 = +x2},${this._y1 = +y2}`;
}
arc(x2, y2, r2) {
x2 = +x2, y2 = +y2, r2 = +r2;
const x02 = x2 + r2;
const y02 = y2;
if (r2 < 0)
throw new Error("negative radius");
if (this._x1 === null)
this._ += `M${x02},${y02}`;
else if (Math.abs(this._x1 - x02) > epsilon || Math.abs(this._y1 - y02) > epsilon)
this._ += "L" + x02 + "," + y02;
if (!r2)
return;
this._ += `A${r2},${r2},0,1,1,${x2 - r2},${y2}A${r2},${r2},0,1,1,${this._x1 = x02},${this._y1 = y02}`;
}
rect(x2, y2, w2, h2) {
this._ += `M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${+w2}v${+h2}h${-w2}Z`;
}
value() {
return this._ || null;
}
}
class Polygon {
constructor() {
this._ = [];
}
moveTo(x2, y2) {
this._.push([x2, y2]);
}
closePath() {
this._.push(this._[0].slice());
}
lineTo(x2, y2) {
this._.push([x2, y2]);
}
value() {
return this._.length ? this._ : null;
}
}
let Voronoi$1 = class Voronoi {
constructor(delaunay, [xmin, ymin, xmax, ymax] = [0, 0, 960, 500]) {
if (!((xmax = +xmax) >= (xmin = +xmin)) || !((ymax = +ymax) >= (ymin = +ymin)))
throw new Error("invalid bounds");
this.delaunay = delaunay;
this._circumcenters = new Float64Array(delaunay.points.length * 2);
this.vectors = new Float64Array(delaunay.points.length * 2);
this.xmax = xmax, this.xmin = xmin;
this.ymax = ymax, this.ymin = ymin;
this._init();
}
update() {
this.delaunay.update();
this._init();
return this;
}
_init() {
const { delaunay: { points: points2, hull, triangles }, vectors } = this;
let bx, by;
const circumcenters = this.circumcenters = this._circumcenters.subarray(0, triangles.length / 3 * 2);
for (let i2 = 0, j2 = 0, n2 = triangles.length, x2, y2; i2 < n2; i2 += 3, j2 += 2) {
const t12 = triangles[i2] * 2;
const t22 = triangles[i2 + 1] * 2;
const t32 = triangles[i2 + 2] * 2;
const x13 = points2[t12];
const y13 = points2[t12 + 1];
const x22 = points2[t22];
const y22 = points2[t22 + 1];
const x3 = points2[t32];
const y3 = points2[t32 + 1];
const dx = x22 - x13;
const dy = y22 - y13;
const ex = x3 - x13;
const ey = y3 - y13;
const ab2 = (dx * ey - dy * ex) * 2;
if (Math.abs(ab2) < 1e-9) {
if (bx === void 0) {
bx = by = 0;
for (const i3 of hull)
bx += points2[i3 * 2], by += points2[i3 * 2 + 1];
bx /= hull.length, by /= hull.length;
}
const a2 = 1e9 * Math.sign((bx - x13) * ey - (by - y13) * ex);
x2 = (x13 + x3) / 2 - a2 * ey;
y2 = (y13 + y3) / 2 + a2 * ex;
} else {
const d2 = 1 / ab2;
const bl2 = dx * dx + dy * dy;
const cl = ex * ex + ey * ey;
x2 = x13 + (ey * bl2 - dy * cl) * d2;
y2 = y13 + (dx * cl - ex * bl2) * d2;
}
circumcenters[j2] = x2;
circumcenters[j2 + 1] = y2;
}
let h2 = hull[hull.length - 1];
let p02, p1 = h2 * 4;
let x02, x12 = points2[2 * h2];
let y02, y12 = points2[2 * h2 + 1];
vectors.fill(0);
for (let i2 = 0; i2 < hull.length; ++i2) {
h2 = hull[i2];
p02 = p1, x02 = x12, y02 = y12;
p1 = h2 * 4, x12 = points2[2 * h2], y12 = points2[2 * h2 + 1];
vectors[p02 + 2] = vectors[p1] = y02 - y12;
vectors[p02 + 3] = vectors[p1 + 1] = x12 - x02;
}
}
render(context2) {
const buffer = context2 == null ? context2 = new Path2() : void 0;
const { delaunay: { halfedges, inedges, hull }, circumcenters, vectors } = this;
if (hull.length <= 1)
return null;
for (let i2 = 0, n2 = halfedges.length; i2 < n2; ++i2) {
const j2 = halfedges[i2];
if (j2 < i2)
continue;
const ti2 = Math.floor(i2 / 3) * 2;
const tj2 = Math.floor(j2 / 3) * 2;
const xi2 = circumcenters[ti2];
const yi2 = circumcenters[ti2 + 1];
const xj2 = circumcenters[tj2];
const yj2 = circumcenters[tj2 + 1];
this._renderSegment(xi2, yi2, xj2, yj2, context2);
}
let h0, h1 = hull[hull.length - 1];
for (let i2 = 0; i2 < hull.length; ++i2) {
h0 = h1, h1 = hull[i2];
const t5 = Math.floor(inedges[h1] / 3) * 2;
const x2 = circumcenters[t5];
const y2 = circumcenters[t5 + 1];
const v2 = h0 * 4;
const p2 = this._project(x2, y2, vectors[v2 + 2], vectors[v2 + 3]);
if (p2)
this._renderSegment(x2, y2, p2[0], p2[1], context2);
}
return buffer && buffer.value();
}
renderBounds(context2) {
const buffer = context2 == null ? context2 = new Path2() : void 0;
context2.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin);
return buffer && buffer.value();
}
renderCell(i2, context2) {
const buffer = context2 == null ? context2 = new Path2() : void 0;
const points2 = this._clip(i2);
if (points2 === null || !points2.length)
return;
context2.moveTo(points2[0], points2[1]);
let n2 = points2.length;
while (points2[0] === points2[n2 - 2] && points2[1] === points2[n2 - 1] && n2 > 1)
n2 -= 2;
for (let i3 = 2; i3 < n2; i3 += 2) {
if (points2[i3] !== points2[i3 - 2] || points2[i3 + 1] !== points2[i3 - 1])
context2.lineTo(points2[i3], points2[i3 + 1]);
}
context2.closePath();
return buffer && buffer.value();
}
*cellPolygons() {
const { delaunay: { points: points2 } } = this;
for (let i2 = 0, n2 = points2.length / 2; i2 < n2; ++i2) {
const cell2 = this.cellPolygon(i2);
if (cell2)
cell2.index = i2, yield cell2;
}
}
cellPolygon(i2) {
const polygon = new Polygon();
this.renderCell(i2, polygon);
return polygon.value();
}
_renderSegment(x02, y02, x12, y12, context2) {
let S2;
const c0 = this._regioncode(x02, y02);
const c1 = this._regioncode(x12, y12);
if (c0 === 0 && c1 === 0) {
context2.moveTo(x02, y02);
context2.lineTo(x12, y12);
} else if (S2 = this._clipSegment(x02, y02, x12, y12, c0, c1)) {
context2.moveTo(S2[0], S2[1]);
context2.lineTo(S2[2], S2[3]);
}
}
contains(i2, x2, y2) {
if ((x2 = +x2, x2 !== x2) || (y2 = +y2, y2 !== y2))
return false;
return this.delaunay._step(i2, x2, y2) === i2;
}
*neighbors(i2) {
const ci2 = this._clip(i2);
if (ci2)
for (const j2 of this.delaunay.neighbors(i2)) {
const cj2 = this._clip(j2);
if (cj2)
loop:
for (let ai2 = 0, li2 = ci2.length; ai2 < li2; ai2 += 2) {
for (let aj2 = 0, lj2 = cj2.length; aj2 < lj2; aj2 += 2) {
if (ci2[ai2] === cj2[aj2] && ci2[ai2 + 1] === cj2[aj2 + 1] && ci2[(ai2 + 2) % li2] === cj2[(aj2 + lj2 - 2) % lj2] && ci2[(ai2 + 3) % li2] === cj2[(aj2 + lj2 - 1) % lj2]) {
yield j2;
break loop;
}
}
}
}
}
_cell(i2) {
const { circumcenters, delaunay: { inedges, halfedges, triangles } } = this;
const e0 = inedges[i2];
if (e0 === -1)
return null;
const points2 = [];
let e7 = e0;
do {
const t5 = Math.floor(e7 / 3);
points2.push(circumcenters[t5 * 2], circumcenters[t5 * 2 + 1]);
e7 = e7 % 3 === 2 ? e7 - 2 : e7 + 1;
if (triangles[e7] !== i2)
break;
e7 = halfedges[e7];
} while (e7 !== e0 && e7 !== -1);
return points2;
}
_clip(i2) {
if (i2 === 0 && this.delaunay.hull.length === 1) {
return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];
}
const points2 = this._cell(i2);
if (points2 === null)
return null;
const { vectors: V2 } = this;
const v2 = i2 * 4;
return this._simplify(V2[v2] || V2[v2 + 1] ? this._clipInfinite(i2, points2, V2[v2], V2[v2 + 1], V2[v2 + 2], V2[v2 + 3]) : this._clipFinite(i2, points2));
}
_clipFinite(i2, points2) {
const n2 = points2.length;
let P2 = null;
let x02, y02, x12 = points2[n2 - 2], y12 = points2[n2 - 1];
let c0, c1 = this._regioncode(x12, y12);
let e0, e1 = 0;
for (let j2 = 0; j2 < n2; j2 += 2) {
x02 = x12, y02 = y12, x12 = points2[j2], y12 = points2[j2 + 1];
c0 = c1, c1 = this._regioncode(x12, y12);
if (c0 === 0 && c1 === 0) {
e0 = e1, e1 = 0;
if (P2)
P2.push(x12, y12);
else
P2 = [x12, y12];
} else {
let S2, sx0, sy0, sx1, sy1;
if (c0 === 0) {
if ((S2 = this._clipSegment(x02, y02, x12, y12, c0, c1)) === null)
continue;
[sx0, sy0, sx1, sy1] = S2;
} else {
if ((S2 = this._clipSegment(x12, y12, x02, y02, c1, c0)) === null)
continue;
[sx1, sy1, sx0, sy0] = S2;
e0 = e1, e1 = this._edgecode(sx0, sy0);
if (e0 && e1)
this._edge(i2, e0, e1, P2, P2.length);
if (P2)
P2.push(sx0, sy0);
else
P2 = [sx0, sy0];
}
e0 = e1, e1 = this._edgecode(sx1, sy1);
if (e0 && e1)
this._edge(i2, e0, e1, P2, P2.length);
if (P2)
P2.push(sx1, sy1);
else
P2 = [sx1, sy1];
}
}
if (P2) {
e0 = e1, e1 = this._edgecode(P2[0], P2[1]);
if (e0 && e1)
this._edge(i2, e0, e1, P2, P2.length);
} else if (this.contains(i2, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {
return [this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax, this.xmin, this.ymin];
}
return P2;
}
_clipSegment(x02, y02, x12, y12, c0, c1) {
const flip2 = c0 < c1;
if (flip2)
[x02, y02, x12, y12, c0, c1] = [x12, y12, x02, y02, c1, c0];
while (true) {
if (c0 === 0 && c1 === 0)
return flip2 ? [x12, y12, x02, y02] : [x02, y02, x12, y12];
if (c0 & c1)
return null;
let x2, y2, c2 = c0 || c1;
if (c2 & 8)
x2 = x02 + (x12 - x02) * (this.ymax - y02) / (y12 - y02), y2 = this.ymax;
else if (c2 & 4)
x2 = x02 + (x12 - x02) * (this.ymin - y02) / (y12 - y02), y2 = this.ymin;
else if (c2 & 2)
y2 = y02 + (y12 - y02) * (this.xmax - x02) / (x12 - x02), x2 = this.xmax;
else
y2 = y02 + (y12 - y02) * (this.xmin - x02) / (x12 - x02), x2 = this.xmin;
if (c0)
x02 = x2, y02 = y2, c0 = this._regioncode(x02, y02);
else
x12 = x2, y12 = y2, c1 = this._regioncode(x12, y12);
}
}
_clipInfinite(i2, points2, vx0, vy0, vxn, vyn) {
let P2 = Array.from(points2), p2;
if (p2 = this._project(P2[0], P2[1], vx0, vy0))
P2.unshift(p2[0], p2[1]);
if (p2 = this._project(P2[P2.length - 2], P2[P2.length - 1], vxn, vyn))
P2.push(p2[0], p2[1]);
if (P2 = this._clipFinite(i2, P2)) {
for (let j2 = 0, n2 = P2.length, c0, c1 = this._edgecode(P2[n2 - 2], P2[n2 - 1]); j2 < n2; j2 += 2) {
c0 = c1, c1 = this._edgecode(P2[j2], P2[j2 + 1]);
if (c0 && c1)
j2 = this._edge(i2, c0, c1, P2, j2), n2 = P2.length;
}
} else if (this.contains(i2, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) {
P2 = [this.xmin, this.ymin, this.xmax, this.ymin, this.xmax, this.ymax, this.xmin, this.ymax];
}
return P2;
}
_edge(i2, e0, e1, P2, j2) {
while (e0 !== e1) {
let x2, y2;
switch (e0) {
case 5:
e0 = 4;
continue;
case 4:
e0 = 6, x2 = this.xmax, y2 = this.ymin;
break;
case 6:
e0 = 2;
continue;
case 2:
e0 = 10, x2 = this.xmax, y2 = this.ymax;
break;
case 10:
e0 = 8;
continue;
case 8:
e0 = 9, x2 = this.xmin, y2 = this.ymax;
break;
case 9:
e0 = 1;
continue;
case 1:
e0 = 5, x2 = this.xmin, y2 = this.ymin;
break;
}
if ((P2[j2] !== x2 || P2[j2 + 1] !== y2) && this.contains(i2, x2, y2)) {
P2.splice(j2, 0, x2, y2), j2 += 2;
}
}
return j2;
}
_project(x02, y02, vx, vy) {
let t5 = Infinity, c2, x2, y2;
if (vy < 0) {
if (y02 <= this.ymin)
return null;
if ((c2 = (this.ymin - y02) / vy) < t5)
y2 = this.ymin, x2 = x02 + (t5 = c2) * vx;
} else if (vy > 0) {
if (y02 >= this.ymax)
return null;
if ((c2 = (this.ymax - y02) / vy) < t5)
y2 = this.ymax, x2 = x02 + (t5 = c2) * vx;
}
if (vx > 0) {
if (x02 >= this.xmax)
return null;
if ((c2 = (this.xmax - x02) / vx) < t5)
x2 = this.xmax, y2 = y02 + (t5 = c2) * vy;
} else if (vx < 0) {
if (x02 <= this.xmin)
return null;
if ((c2 = (this.xmin - x02) / vx) < t5)
x2 = this.xmin, y2 = y02 + (t5 = c2) * vy;
}
return [x2, y2];
}
_edgecode(x2, y2) {
return (x2 === this.xmin ? 1 : x2 === this.xmax ? 2 : 0) | (y2 === this.ymin ? 4 : y2 === this.ymax ? 8 : 0);
}
_regioncode(x2, y2) {
return (x2 < this.xmin ? 1 : x2 > this.xmax ? 2 : 0) | (y2 < this.ymin ? 4 : y2 > this.ymax ? 8 : 0);
}
_simplify(P2) {
if (P2 && P2.length > 4) {
for (let i2 = 0; i2 < P2.length; i2 += 2) {
const j2 = (i2 + 2) % P2.length, k2 = (i2 + 4) % P2.length;
if (P2[i2] === P2[j2] && P2[j2] === P2[k2] || P2[i2 + 1] === P2[j2 + 1] && P2[j2 + 1] === P2[k2 + 1]) {
P2.splice(j2, 2), i2 -= 2;
}
}
if (!P2.length)
P2 = null;
}
return P2;
}
};
const tau = 2 * Math.PI, pow = Math.pow;
function pointX(p2) {
return p2[0];
}
function pointY(p2) {
return p2[1];
}
function collinear(d2) {
const { triangles, coords } = d2;
for (let i2 = 0; i2 < triangles.length; i2 += 3) {
const a2 = 2 * triangles[i2], b2 = 2 * triangles[i2 + 1], c2 = 2 * triangles[i2 + 2], cross2 = (coords[c2] - coords[a2]) * (coords[b2 + 1] - coords[a2 + 1]) - (coords[b2] - coords[a2]) * (coords[c2 + 1] - coords[a2 + 1]);
if (cross2 > 1e-10)
return false;
}
return true;
}
function jitter(x2, y2, r2) {
return [x2 + Math.sin(x2 + y2) * r2, y2 + Math.cos(x2 - y2) * r2];
}
class Delaunay {
static from(points2, fx = pointX, fy = pointY, that) {
return new Delaunay("length" in points2 ? flatArray(points2, fx, fy, that) : Float64Array.from(flatIterable(points2, fx, fy, that)));
}
constructor(points2) {
this._delaunator = new Delaunator(points2);
this.inedges = new Int32Array(points2.length / 2);
this._hullIndex = new Int32Array(points2.length / 2);
this.points = this._delaunator.coords;
this._init();
}
update() {
this._delaunator.update();
this._init();
return this;
}
_init() {
const d2 = this._delaunator, points2 = this.points;
if (d2.hull && d2.hull.length > 2 && collinear(d2)) {
this.collinear = Int32Array.from({ length: points2.length / 2 }, (_24, i2) => i2).sort((i2, j2) => points2[2 * i2] - points2[2 * j2] || points2[2 * i2 + 1] - points2[2 * j2 + 1]);
const e7 = this.collinear[0], f2 = this.collinear[this.collinear.length - 1], bounds2 = [points2[2 * e7], points2[2 * e7 + 1], points2[2 * f2], points2[2 * f2 + 1]], r2 = 1e-8 * Math.hypot(bounds2[3] - bounds2[1], bounds2[2] - bounds2[0]);
for (let i2 = 0, n2 = points2.length / 2; i2 < n2; ++i2) {
const p2 = jitter(points2[2 * i2], points2[2 * i2 + 1], r2);
points2[2 * i2] = p2[0];
points2[2 * i2 + 1] = p2[1];
}
this._delaunator = new Delaunator(points2);
} else {
delete this.collinear;
}
const halfedges = this.halfedges = this._delaunator.halfedges;
const hull = this.hull = this._delaunator.hull;
const triangles = this.triangles = this._delaunator.triangles;
const inedges = this.inedges.fill(-1);
const hullIndex = this._hullIndex.fill(-1);
for (let e7 = 0, n2 = halfedges.length; e7 < n2; ++e7) {
const p2 = triangles[e7 % 3 === 2 ? e7 - 2 : e7 + 1];
if (halfedges[e7] === -1 || inedges[p2] === -1)
inedges[p2] = e7;
}
for (let i2 = 0, n2 = hull.length; i2 < n2; ++i2) {
hullIndex[hull[i2]] = i2;
}
if (hull.length <= 2 && hull.length > 0) {
this.triangles = new Int32Array(3).fill(-1);
this.halfedges = new Int32Array(3).fill(-1);
this.triangles[0] = hull[0];
inedges[hull[0]] = 1;
if (hull.length === 2) {
inedges[hull[1]] = 0;
this.triangles[1] = hull[1];
this.triangles[2] = hull[1];
}
}
}
voronoi(bounds2) {
return new Voronoi$1(this, bounds2);
}
*neighbors(i2) {
const { inedges, hull, _hullIndex, halfedges, triangles, collinear: collinear2 } = this;
if (collinear2) {
const l2 = collinear2.indexOf(i2);
if (l2 > 0)
yield collinear2[l2 - 1];
if (l2 < collinear2.length - 1)
yield collinear2[l2 + 1];
return;
}
const e0 = inedges[i2];
if (e0 === -1)
return;
let e7 = e0, p02 = -1;
do {
yield p02 = triangles[e7];
e7 = e7 % 3 === 2 ? e7 - 2 : e7 + 1;
if (triangles[e7] !== i2)
return;
e7 = halfedges[e7];
if (e7 === -1) {
const p2 = hull[(_hullIndex[i2] + 1) % hull.length];
if (p2 !== p02)
yield p2;
return;
}
} while (e7 !== e0);
}
find(x2, y2, i2 = 0) {
if ((x2 = +x2, x2 !== x2) || (y2 = +y2, y2 !== y2))
return -1;
const i0 = i2;
let c2;
while ((c2 = this._step(i2, x2, y2)) >= 0 && c2 !== i2 && c2 !== i0)
i2 = c2;
return c2;
}
_step(i2, x2, y2) {
const { inedges, hull, _hullIndex, halfedges, triangles, points: points2 } = this;
if (inedges[i2] === -1 || !points2.length)
return (i2 + 1) % (points2.length >> 1);
let c2 = i2;
let dc2 = pow(x2 - points2[i2 * 2], 2) + pow(y2 - points2[i2 * 2 + 1], 2);
const e0 = inedges[i2];
let e7 = e0;
do {
let t5 = triangles[e7];
const dt2 = pow(x2 - points2[t5 * 2], 2) + pow(y2 - points2[t5 * 2 + 1], 2);
if (dt2 < dc2)
dc2 = dt2, c2 = t5;
e7 = e7 % 3 === 2 ? e7 - 2 : e7 + 1;
if (triangles[e7] !== i2)
break;
e7 = halfedges[e7];
if (e7 === -1) {
e7 = hull[(_hullIndex[i2] + 1) % hull.length];
if (e7 !== t5) {
if (pow(x2 - points2[e7 * 2], 2) + pow(y2 - points2[e7 * 2 + 1], 2) < dc2)
return e7;
}
break;
}
} while (e7 !== e0);
return c2;
}
render(context2) {
const buffer = context2 == null ? context2 = new Path2() : void 0;
const { points: points2, halfedges, triangles } = this;
for (let i2 = 0, n2 = halfedges.length; i2 < n2; ++i2) {
const j2 = halfedges[i2];
if (j2 < i2)
continue;
const ti2 = triangles[i2] * 2;
const tj2 = triangles[j2] * 2;
context2.moveTo(points2[ti2], points2[ti2 + 1]);
context2.lineTo(points2[tj2], points2[tj2 + 1]);
}
this.renderHull(context2);
return buffer && buffer.value();
}
renderPoints(context2, r2) {
if (r2 === void 0 && (!context2 || typeof context2.moveTo !== "function"))
r2 = context2, context2 = null;
r2 = r2 == void 0 ? 2 : +r2;
const buffer = context2 == null ? context2 = new Path2() : void 0;
const { points: points2 } = this;
for (let i2 = 0, n2 = points2.length; i2 < n2; i2 += 2) {
const x2 = points2[i2], y2 = points2[i2 + 1];
context2.moveTo(x2 + r2, y2);
context2.arc(x2, y2, r2, 0, tau);
}
return buffer && buffer.value();
}
renderHull(context2) {
const buffer = context2 == null ? context2 = new Path2() : void 0;
const { hull, points: points2 } = this;
const h2 = hull[0] * 2, n2 = hull.length;
context2.moveTo(points2[h2], points2[h2 + 1]);
for (let i2 = 1; i2 < n2; ++i2) {
const h3 = 2 * hull[i2];
context2.lineTo(points2[h3], points2[h3 + 1]);
}
context2.closePath();
return buffer && buffer.value();
}
hullPolygon() {
const polygon = new Polygon();
this.renderHull(polygon);
return polygon.value();
}
renderTriangle(i2, context2) {
const buffer = context2 == null ? context2 = new Path2() : void 0;
const { points: points2, triangles } = this;
const t02 = triangles[i2 *= 3] * 2;
const t12 = triangles[i2 + 1] * 2;
const t22 = triangles[i2 + 2] * 2;
context2.moveTo(points2[t02], points2[t02 + 1]);
context2.lineTo(points2[t12], points2[t12 + 1]);
context2.lineTo(points2[t22], points2[t22 + 1]);
context2.closePath();
return buffer && buffer.value();
}
*trianglePolygons() {
const { triangles } = this;
for (let i2 = 0, n2 = triangles.length / 3; i2 < n2; ++i2) {
yield this.trianglePolygon(i2);
}
}
trianglePolygon(i2) {
const polygon = new Polygon();
this.renderTriangle(i2, polygon);
return polygon.value();
}
}
function flatArray(points2, fx, fy, that) {
const n2 = points2.length;
const array2 = new Float64Array(n2 * 2);
for (let i2 = 0; i2 < n2; ++i2) {
const p2 = points2[i2];
array2[i2 * 2] = fx.call(that, p2, i2, points2);
array2[i2 * 2 + 1] = fy.call(that, p2, i2, points2);
}
return array2;
}
function* flatIterable(points2, fx, fy, that) {
let i2 = 0;
for (const p2 of points2) {
yield fx.call(that, p2, i2, points2);
yield fy.call(that, p2, i2, points2);
++i2;
}
}
function Voronoi2(params2) {
Transform$1.call(this, null, params2);
}
Voronoi2.Definition = {
"type": "Voronoi",
"metadata": {
"modifies": true
},
"params": [{
"name": "x",
"type": "field",
"required": true
}, {
"name": "y",
"type": "field",
"required": true
}, {
"name": "size",
"type": "number",
"array": true,
"length": 2
}, {
"name": "extent",
"type": "array",
"array": true,
"length": 2,
"default": [[-1e5, -1e5], [1e5, 1e5]],
"content": {
"type": "number",
"array": true,
"length": 2
}
}, {
"name": "as",
"type": "string",
"default": "path"
}]
};
const defaultExtent = [-1e5, -1e5, 1e5, 1e5];
inherits(Voronoi2, Transform$1, {
transform(_24, pulse2) {
const as = _24.as || "path", data2 = pulse2.source;
if (!data2 || !data2.length)
return pulse2;
let s2 = _24.size;
s2 = s2 ? [0, 0, s2[0], s2[1]] : (s2 = _24.extent) ? [s2[0][0], s2[0][1], s2[1][0], s2[1][1]] : defaultExtent;
const voronoi2 = this.value = Delaunay.from(data2, _24.x, _24.y).voronoi(s2);
for (let i2 = 0, n2 = data2.length; i2 < n2; ++i2) {
const polygon = voronoi2.cellPolygon(i2);
data2[i2][as] = polygon && !isPoint(polygon) ? toPathString(polygon) : null;
}
return pulse2.reflow(_24.modified()).modifies(as);
}
});
function toPathString(p2) {
const x2 = p2[0][0], y2 = p2[0][1];
let n2 = p2.length - 1;
for (; p2[n2][0] === x2 && p2[n2][1] === y2; --n2)
;
return "M" + p2.slice(0, n2 + 1).join("L") + "Z";
}
function isPoint(p2) {
return p2.length === 2 && p2[0][0] === p2[1][0] && p2[0][1] === p2[1][1];
}
const voronoi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
voronoi: Voronoi2
}, Symbol.toStringTag, { value: "Module" }));
var cloudRadians = Math.PI / 180, cw = 1 << 11 >> 5, ch = 1 << 11;
function cloud() {
var size = [256, 256], text2, font2, fontSize2, fontStyle2, fontWeight2, rotate2, padding2, spiral = archimedeanSpiral, words = [], random2 = Math.random, cloud2 = {};
cloud2.layout = function() {
var contextAndRatio = getContext2(domCanvas()), board = zeroArray((size[0] >> 5) * size[1]), bounds2 = null, n2 = words.length, i2 = -1, tags = [], data2 = words.map((d3) => ({
text: text2(d3),
font: font2(d3),
style: fontStyle2(d3),
weight: fontWeight2(d3),
rotate: rotate2(d3),
size: ~~(fontSize2(d3) + 1e-14),
padding: padding2(d3),
xoff: 0,
yoff: 0,
x1: 0,
y1: 0,
x0: 0,
y0: 0,
hasText: false,
sprite: null,
datum: d3
})).sort((a2, b2) => b2.size - a2.size);
while (++i2 < n2) {
var d2 = data2[i2];
d2.x = size[0] * (random2() + 0.5) >> 1;
d2.y = size[1] * (random2() + 0.5) >> 1;
cloudSprite(contextAndRatio, d2, data2, i2);
if (d2.hasText && place2(board, d2, bounds2)) {
tags.push(d2);
if (bounds2)
cloudBounds(bounds2, d2);
else
bounds2 = [{
x: d2.x + d2.x0,
y: d2.y + d2.y0
}, {
x: d2.x + d2.x1,
y: d2.y + d2.y1
}];
d2.x -= size[0] >> 1;
d2.y -= size[1] >> 1;
}
}
return tags;
};
function getContext2(canvas) {
canvas.width = canvas.height = 1;
var ratio = Math.sqrt(canvas.getContext("2d").getImageData(0, 0, 1, 1).data.length >> 2);
canvas.width = (cw << 5) / ratio;
canvas.height = ch / ratio;
var context2 = canvas.getContext("2d");
context2.fillStyle = context2.strokeStyle = "red";
context2.textAlign = "center";
return {
context: context2,
ratio
};
}
function place2(board, tag, bounds2) {
var startX = tag.x, startY = tag.y, maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]), s2 = spiral(size), dt2 = random2() < 0.5 ? 1 : -1, t5 = -dt2, dxdy, dx, dy;
while (dxdy = s2(t5 += dt2)) {
dx = ~~dxdy[0];
dy = ~~dxdy[1];
if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta)
break;
tag.x = startX + dx;
tag.y = startY + dy;
if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1])
continue;
if (!bounds2 || !cloudCollide(tag, board, size[0])) {
if (!bounds2 || collideRects(tag, bounds2)) {
var sprite = tag.sprite, w2 = tag.width >> 5, sw = size[0] >> 5, lx2 = tag.x - (w2 << 4), sx = lx2 & 127, msx = 32 - sx, h2 = tag.y1 - tag.y0, x2 = (tag.y + tag.y0) * sw + (lx2 >> 5), last;
for (var j2 = 0; j2 < h2; j2++) {
last = 0;
for (var i2 = 0; i2 <= w2; i2++) {
board[x2 + i2] |= last << msx | (i2 < w2 ? (last = sprite[j2 * w2 + i2]) >>> sx : 0);
}
x2 += sw;
}
tag.sprite = null;
return true;
}
}
}
return false;
}
cloud2.words = function(_24) {
if (arguments.length) {
words = _24;
return cloud2;
} else {
return words;
}
};
cloud2.size = function(_24) {
if (arguments.length) {
size = [+_24[0], +_24[1]];
return cloud2;
} else {
return size;
}
};
cloud2.font = function(_24) {
if (arguments.length) {
font2 = functor(_24);
return cloud2;
} else {
return font2;
}
};
cloud2.fontStyle = function(_24) {
if (arguments.length) {
fontStyle2 = functor(_24);
return cloud2;
} else {
return fontStyle2;
}
};
cloud2.fontWeight = function(_24) {
if (arguments.length) {
fontWeight2 = functor(_24);
return cloud2;
} else {
return fontWeight2;
}
};
cloud2.rotate = function(_24) {
if (arguments.length) {
rotate2 = functor(_24);
return cloud2;
} else {
return rotate2;
}
};
cloud2.text = function(_24) {
if (arguments.length) {
text2 = functor(_24);
return cloud2;
} else {
return text2;
}
};
cloud2.spiral = function(_24) {
if (arguments.length) {
spiral = spirals[_24] || _24;
return cloud2;
} else {
return spiral;
}
};
cloud2.fontSize = function(_24) {
if (arguments.length) {
fontSize2 = functor(_24);
return cloud2;
} else {
return fontSize2;
}
};
cloud2.padding = function(_24) {
if (arguments.length) {
padding2 = functor(_24);
return cloud2;
} else {
return padding2;
}
};
cloud2.random = function(_24) {
if (arguments.length) {
random2 = _24;
return cloud2;
} else {
return random2;
}
};
return cloud2;
}
function cloudSprite(contextAndRatio, d2, data2, di2) {
if (d2.sprite)
return;
var c2 = contextAndRatio.context, ratio = contextAndRatio.ratio;
c2.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);
var x2 = 0, y2 = 0, maxh = 0, n2 = data2.length, w2, w32, h2, i2, j2;
--di2;
while (++di2 < n2) {
d2 = data2[di2];
c2.save();
c2.font = d2.style + " " + d2.weight + " " + ~~((d2.size + 1) / ratio) + "px " + d2.font;
w2 = c2.measureText(d2.text + "m").width * ratio;
h2 = d2.size << 1;
if (d2.rotate) {
var sr2 = Math.sin(d2.rotate * cloudRadians), cr2 = Math.cos(d2.rotate * cloudRadians), wcr = w2 * cr2, wsr = w2 * sr2, hcr = h2 * cr2, hsr = h2 * sr2;
w2 = Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 31 >> 5 << 5;
h2 = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));
} else {
w2 = w2 + 31 >> 5 << 5;
}
if (h2 > maxh)
maxh = h2;
if (x2 + w2 >= cw << 5) {
x2 = 0;
y2 += maxh;
maxh = 0;
}
if (y2 + h2 >= ch)
break;
c2.translate((x2 + (w2 >> 1)) / ratio, (y2 + (h2 >> 1)) / ratio);
if (d2.rotate)
c2.rotate(d2.rotate * cloudRadians);
c2.fillText(d2.text, 0, 0);
if (d2.padding) {
c2.lineWidth = 2 * d2.padding;
c2.strokeText(d2.text, 0, 0);
}
c2.restore();
d2.width = w2;
d2.height = h2;
d2.xoff = x2;
d2.yoff = y2;
d2.x1 = w2 >> 1;
d2.y1 = h2 >> 1;
d2.x0 = -d2.x1;
d2.y0 = -d2.y1;
d2.hasText = true;
x2 += w2;
}
var pixels = c2.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data, sprite = [];
while (--di2 >= 0) {
d2 = data2[di2];
if (!d2.hasText)
continue;
w2 = d2.width;
w32 = w2 >> 5;
h2 = d2.y1 - d2.y0;
for (i2 = 0; i2 < h2 * w32; i2++)
sprite[i2] = 0;
x2 = d2.xoff;
if (x2 == null)
return;
y2 = d2.yoff;
var seen2 = 0, seenRow = -1;
for (j2 = 0; j2 < h2; j2++) {
for (i2 = 0; i2 < w2; i2++) {
var k2 = w32 * j2 + (i2 >> 5), m2 = pixels[(y2 + j2) * (cw << 5) + (x2 + i2) << 2] ? 1 << 31 - i2 % 32 : 0;
sprite[k2] |= m2;
seen2 |= m2;
}
if (seen2)
seenRow = j2;
else {
d2.y0++;
h2--;
j2--;
y2++;
}
}
d2.y1 = d2.y0 + seenRow;
d2.sprite = sprite.slice(0, (d2.y1 - d2.y0) * w32);
}
}
function cloudCollide(tag, board, sw) {
sw >>= 5;
var sprite = tag.sprite, w2 = tag.width >> 5, lx2 = tag.x - (w2 << 4), sx = lx2 & 127, msx = 32 - sx, h2 = tag.y1 - tag.y0, x2 = (tag.y + tag.y0) * sw + (lx2 >> 5), last;
for (var j2 = 0; j2 < h2; j2++) {
last = 0;
for (var i2 = 0; i2 <= w2; i2++) {
if ((last << msx | (i2 < w2 ? (last = sprite[j2 * w2 + i2]) >>> sx : 0)) & board[x2 + i2])
return true;
}
x2 += sw;
}
return false;
}
function cloudBounds(bounds2, d2) {
var b0 = bounds2[0], b1 = bounds2[1];
if (d2.x + d2.x0 < b0.x)
b0.x = d2.x + d2.x0;
if (d2.y + d2.y0 < b0.y)
b0.y = d2.y + d2.y0;
if (d2.x + d2.x1 > b1.x)
b1.x = d2.x + d2.x1;
if (d2.y + d2.y1 > b1.y)
b1.y = d2.y + d2.y1;
}
function collideRects(a2, b2) {
return a2.x + a2.x1 > b2[0].x && a2.x + a2.x0 < b2[1].x && a2.y + a2.y1 > b2[0].y && a2.y + a2.y0 < b2[1].y;
}
function archimedeanSpiral(size) {
var e7 = size[0] / size[1];
return function(t5) {
return [e7 * (t5 *= 0.1) * Math.cos(t5), t5 * Math.sin(t5)];
};
}
function rectangularSpiral(size) {
var dy = 4, dx = dy * size[0] / size[1], x2 = 0, y2 = 0;
return function(t5) {
var sign2 = t5 < 0 ? -1 : 1;
switch (Math.sqrt(1 + 4 * sign2 * t5) - sign2 & 3) {
case 0:
x2 += dx;
break;
case 1:
y2 += dy;
break;
case 2:
x2 -= dx;
break;
default:
y2 -= dy;
break;
}
return [x2, y2];
};
}
function zeroArray(n2) {
var a2 = [], i2 = -1;
while (++i2 < n2)
a2[i2] = 0;
return a2;
}
function functor(d2) {
return typeof d2 === "function" ? d2 : function() {
return d2;
};
}
var spirals = {
archimedean: archimedeanSpiral,
rectangular: rectangularSpiral
};
const Output = ["x", "y", "font", "fontSize", "fontStyle", "fontWeight", "angle"];
const Params$1 = ["text", "font", "rotate", "fontSize", "fontStyle", "fontWeight"];
function Wordcloud(params2) {
Transform$1.call(this, cloud(), params2);
}
Wordcloud.Definition = {
"type": "Wordcloud",
"metadata": {
"modifies": true
},
"params": [{
"name": "size",
"type": "number",
"array": true,
"length": 2
}, {
"name": "font",
"type": "string",
"expr": true,
"default": "sans-serif"
}, {
"name": "fontStyle",
"type": "string",
"expr": true,
"default": "normal"
}, {
"name": "fontWeight",
"type": "string",
"expr": true,
"default": "normal"
}, {
"name": "fontSize",
"type": "number",
"expr": true,
"default": 14
}, {
"name": "fontSizeRange",
"type": "number",
"array": "nullable",
"default": [10, 50]
}, {
"name": "rotate",
"type": "number",
"expr": true,
"default": 0
}, {
"name": "text",
"type": "field"
}, {
"name": "spiral",
"type": "string",
"values": ["archimedean", "rectangular"]
}, {
"name": "padding",
"type": "number",
"expr": true
}, {
"name": "as",
"type": "string",
"array": true,
"length": 7,
"default": Output
}]
};
inherits(Wordcloud, Transform$1, {
transform(_24, pulse2) {
if (_24.size && !(_24.size[0] && _24.size[1])) {
error2("Wordcloud size dimensions must be non-zero.");
}
function modp(param2) {
const p2 = _24[param2];
return isFunction(p2) && pulse2.modified(p2.fields);
}
const mod = _24.modified();
if (!(mod || pulse2.changed(pulse2.ADD_REM) || Params$1.some(modp)))
return;
const data2 = pulse2.materialize(pulse2.SOURCE).source, layout = this.value, as = _24.as || Output;
let fontSize2 = _24.fontSize || 14, range2;
isFunction(fontSize2) ? range2 = _24.fontSizeRange : fontSize2 = constant$6(fontSize2);
if (range2) {
const fsize = fontSize2, sizeScale = scale$4("sqrt")().domain(extent(data2, fsize)).range(range2);
fontSize2 = (x2) => sizeScale(fsize(x2));
}
data2.forEach((t5) => {
t5[as[0]] = NaN;
t5[as[1]] = NaN;
t5[as[3]] = 0;
});
const words = layout.words(data2).text(_24.text).size(_24.size || [500, 500]).padding(_24.padding || 1).spiral(_24.spiral || "archimedean").rotate(_24.rotate || 0).font(_24.font || "sans-serif").fontStyle(_24.fontStyle || "normal").fontWeight(_24.fontWeight || "normal").fontSize(fontSize2).random(random).layout();
const size = layout.size(), dx = size[0] >> 1, dy = size[1] >> 1, n2 = words.length;
for (let i2 = 0, w2, t5; i2 < n2; ++i2) {
w2 = words[i2];
t5 = w2.datum;
t5[as[0]] = w2.x + dx;
t5[as[1]] = w2.y + dy;
t5[as[2]] = w2.font;
t5[as[3]] = w2.size;
t5[as[4]] = w2.style;
t5[as[5]] = w2.weight;
t5[as[6]] = w2.rotate;
}
return pulse2.reflow(mod).modifies(as);
}
});
const wordcloud = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
wordcloud: Wordcloud
}, Symbol.toStringTag, { value: "Module" }));
function ascending$1(a2, b2) {
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function descending$1(a2, b2) {
return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN;
}
function bisector$1(f2) {
let compare12, compare22, delta;
if (f2.length !== 2) {
compare12 = ascending$1;
compare22 = (d2, x2) => ascending$1(f2(d2), x2);
delta = (d2, x2) => f2(d2) - x2;
} else {
compare12 = f2 === ascending$1 || f2 === descending$1 ? f2 : zero$2;
compare22 = f2;
delta = f2;
}
function left2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) < 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function right2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) <= 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function center(a2, x2, lo2 = 0, hi2 = a2.length) {
const i2 = left2(a2, x2, lo2, hi2 - 1);
return i2 > lo2 && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
}
return { left: left2, center, right: right2 };
}
function zero$2() {
return 0;
}
function number$2(x2) {
return x2 === null ? NaN : +x2;
}
const ascendingBisect = bisector$1(ascending$1);
const bisectRight$1 = ascendingBisect.right;
const bisectLeft$1 = ascendingBisect.left;
bisector$1(number$2).center;
function permute(source2, keys3) {
return Array.from(keys3, (key2) => source2[key2]);
}
const array8 = (n2) => new Uint8Array(n2);
const array16 = (n2) => new Uint16Array(n2);
const array32 = (n2) => new Uint32Array(n2);
function Bitmaps() {
let width2 = 8, data2 = [], seen2 = array32(0), curr = array$1(0, width2), prev2 = array$1(0, width2);
return {
data: () => data2,
seen: () => seen2 = lengthen(seen2, data2.length),
add(array2) {
for (let i2 = 0, j2 = data2.length, n2 = array2.length, t5; i2 < n2; ++i2) {
t5 = array2[i2];
t5._index = j2++;
data2.push(t5);
}
},
remove(num, map2) {
const n2 = data2.length, copy2 = Array(n2 - num), reindex = data2;
let t5, i2, j2;
for (i2 = 0; !map2[i2] && i2 < n2; ++i2) {
copy2[i2] = data2[i2];
reindex[i2] = i2;
}
for (j2 = i2; i2 < n2; ++i2) {
t5 = data2[i2];
if (!map2[i2]) {
reindex[i2] = j2;
curr[j2] = curr[i2];
prev2[j2] = prev2[i2];
copy2[j2] = t5;
t5._index = j2++;
} else {
reindex[i2] = -1;
}
curr[i2] = 0;
}
data2 = copy2;
return reindex;
},
size: () => data2.length,
curr: () => curr,
prev: () => prev2,
reset: (k2) => prev2[k2] = curr[k2],
all: () => width2 < 257 ? 255 : width2 < 65537 ? 65535 : 4294967295,
set(k2, one2) {
curr[k2] |= one2;
},
clear(k2, one2) {
curr[k2] &= ~one2;
},
resize(n2, m2) {
const k2 = curr.length;
if (n2 > k2 || m2 > width2) {
width2 = Math.max(m2, width2);
curr = array$1(n2, width2, curr);
prev2 = array$1(n2, width2);
}
}
};
}
function lengthen(array2, length2, copy2) {
if (array2.length >= length2)
return array2;
copy2 = copy2 || new array2.constructor(length2);
copy2.set(array2);
return copy2;
}
function array$1(n2, m2, array2) {
const copy2 = (m2 < 257 ? array8 : m2 < 65537 ? array16 : array32)(n2);
if (array2)
copy2.set(array2);
return copy2;
}
function Dimension(index2, i2, query) {
const bit = 1 << i2;
return {
one: bit,
zero: ~bit,
range: query.slice(),
bisect: index2.bisect,
index: index2.index,
size: index2.size,
onAdd(added, curr) {
const dim = this, range2 = dim.bisect(dim.range, added.value), idx = added.index, lo2 = range2[0], hi2 = range2[1], n1 = idx.length;
let i3;
for (i3 = 0; i3 < lo2; ++i3)
curr[idx[i3]] |= bit;
for (i3 = hi2; i3 < n1; ++i3)
curr[idx[i3]] |= bit;
return dim;
}
};
}
function SortedIndex() {
let index2 = array32(0), value2 = [], size = 0;
function insert2(key2, data2, base2) {
if (!data2.length)
return [];
const n0 = size, n1 = data2.length, addi = array32(n1);
let addv = Array(n1), oldv, oldi, i2;
for (i2 = 0; i2 < n1; ++i2) {
addv[i2] = key2(data2[i2]);
addi[i2] = i2;
}
addv = sort(addv, addi);
if (n0) {
oldv = value2;
oldi = index2;
value2 = Array(n0 + n1);
index2 = array32(n0 + n1);
merge$1(base2, oldv, oldi, n0, addv, addi, n1, value2, index2);
} else {
if (base2 > 0)
for (i2 = 0; i2 < n1; ++i2) {
addi[i2] += base2;
}
value2 = addv;
index2 = addi;
}
size = n0 + n1;
return {
index: addi,
value: addv
};
}
function remove3(num, map2) {
const n2 = size;
let idx, i2, j2;
for (i2 = 0; !map2[index2[i2]] && i2 < n2; ++i2)
;
for (j2 = i2; i2 < n2; ++i2) {
if (!map2[idx = index2[i2]]) {
index2[j2] = idx;
value2[j2] = value2[i2];
++j2;
}
}
size = n2 - num;
}
function reindex(map2) {
for (let i2 = 0, n2 = size; i2 < n2; ++i2) {
index2[i2] = map2[index2[i2]];
}
}
function bisect2(range2, array2) {
let n2;
if (array2) {
n2 = array2.length;
} else {
array2 = value2;
n2 = size;
}
return [bisectLeft$1(array2, range2[0], 0, n2), bisectRight$1(array2, range2[1], 0, n2)];
}
return {
insert: insert2,
remove: remove3,
bisect: bisect2,
reindex,
index: () => index2,
size: () => size
};
}
function sort(values2, index2) {
values2.sort.call(index2, (a2, b2) => {
const x2 = values2[a2], y2 = values2[b2];
return x2 < y2 ? -1 : x2 > y2 ? 1 : 0;
});
return permute(values2, index2);
}
function merge$1(base2, value0, index0, n0, value1, index1, n1, value2, index2) {
let i0 = 0, i1 = 0, i2;
for (i2 = 0; i0 < n0 && i1 < n1; ++i2) {
if (value0[i0] < value1[i1]) {
value2[i2] = value0[i0];
index2[i2] = index0[i0++];
} else {
value2[i2] = value1[i1];
index2[i2] = index1[i1++] + base2;
}
}
for (; i0 < n0; ++i0, ++i2) {
value2[i2] = value0[i0];
index2[i2] = index0[i0];
}
for (; i1 < n1; ++i1, ++i2) {
value2[i2] = value1[i1];
index2[i2] = index1[i1] + base2;
}
}
function CrossFilter(params2) {
Transform$1.call(this, Bitmaps(), params2);
this._indices = null;
this._dims = null;
}
CrossFilter.Definition = {
"type": "CrossFilter",
"metadata": {},
"params": [{
"name": "fields",
"type": "field",
"array": true,
"required": true
}, {
"name": "query",
"type": "array",
"array": true,
"required": true,
"content": {
"type": "number",
"array": true,
"length": 2
}
}]
};
inherits(CrossFilter, Transform$1, {
transform(_24, pulse2) {
if (!this._dims) {
return this.init(_24, pulse2);
} else {
var init3 = _24.modified("fields") || _24.fields.some((f2) => pulse2.modified(f2.fields));
return init3 ? this.reinit(_24, pulse2) : this.eval(_24, pulse2);
}
},
init(_24, pulse2) {
const fields = _24.fields, query = _24.query, indices = this._indices = {}, dims = this._dims = [], m2 = query.length;
let i2 = 0, key2, index2;
for (; i2 < m2; ++i2) {
key2 = fields[i2].fname;
index2 = indices[key2] || (indices[key2] = SortedIndex());
dims.push(Dimension(index2, i2, query[i2]));
}
return this.eval(_24, pulse2);
},
reinit(_24, pulse2) {
const output3 = pulse2.materialize().fork(), fields = _24.fields, query = _24.query, indices = this._indices, dims = this._dims, bits2 = this.value, curr = bits2.curr(), prev2 = bits2.prev(), all3 = bits2.all(), out = output3.rem = output3.add, mod = output3.mod, m2 = query.length, adds = {};
let add3, index2, key2, mods, remMap, modMap, i2, n2, f2;
prev2.set(curr);
if (pulse2.rem.length) {
remMap = this.remove(_24, pulse2, output3);
}
if (pulse2.add.length) {
bits2.add(pulse2.add);
}
if (pulse2.mod.length) {
modMap = {};
for (mods = pulse2.mod, i2 = 0, n2 = mods.length; i2 < n2; ++i2) {
modMap[mods[i2]._index] = 1;
}
}
for (i2 = 0; i2 < m2; ++i2) {
f2 = fields[i2];
if (!dims[i2] || _24.modified("fields", i2) || pulse2.modified(f2.fields)) {
key2 = f2.fname;
if (!(add3 = adds[key2])) {
indices[key2] = index2 = SortedIndex();
adds[key2] = add3 = index2.insert(f2, pulse2.source, 0);
}
dims[i2] = Dimension(index2, i2, query[i2]).onAdd(add3, curr);
}
}
for (i2 = 0, n2 = bits2.data().length; i2 < n2; ++i2) {
if (remMap[i2]) {
continue;
} else if (prev2[i2] !== curr[i2]) {
out.push(i2);
} else if (modMap[i2] && curr[i2] !== all3) {
mod.push(i2);
}
}
bits2.mask = (1 << m2) - 1;
return output3;
},
eval(_24, pulse2) {
const output3 = pulse2.materialize().fork(), m2 = this._dims.length;
let mask = 0;
if (pulse2.rem.length) {
this.remove(_24, pulse2, output3);
mask |= (1 << m2) - 1;
}
if (_24.modified("query") && !_24.modified("fields")) {
mask |= this.update(_24, pulse2, output3);
}
if (pulse2.add.length) {
this.insert(_24, pulse2, output3);
mask |= (1 << m2) - 1;
}
if (pulse2.mod.length) {
this.modify(pulse2, output3);
mask |= (1 << m2) - 1;
}
this.value.mask = mask;
return output3;
},
insert(_24, pulse2, output3) {
const tuples = pulse2.add, bits2 = this.value, dims = this._dims, indices = this._indices, fields = _24.fields, adds = {}, out = output3.add, n2 = bits2.size() + tuples.length, m2 = dims.length;
let k2 = bits2.size(), j2, key2, add3;
bits2.resize(n2, m2);
bits2.add(tuples);
const curr = bits2.curr(), prev2 = bits2.prev(), all3 = bits2.all();
for (j2 = 0; j2 < m2; ++j2) {
key2 = fields[j2].fname;
add3 = adds[key2] || (adds[key2] = indices[key2].insert(fields[j2], tuples, k2));
dims[j2].onAdd(add3, curr);
}
for (; k2 < n2; ++k2) {
prev2[k2] = all3;
if (curr[k2] !== all3)
out.push(k2);
}
},
modify(pulse2, output3) {
const out = output3.mod, bits2 = this.value, curr = bits2.curr(), all3 = bits2.all(), tuples = pulse2.mod;
let i2, n2, k2;
for (i2 = 0, n2 = tuples.length; i2 < n2; ++i2) {
k2 = tuples[i2]._index;
if (curr[k2] !== all3)
out.push(k2);
}
},
remove(_24, pulse2, output3) {
const indices = this._indices, bits2 = this.value, curr = bits2.curr(), prev2 = bits2.prev(), all3 = bits2.all(), map2 = {}, out = output3.rem, tuples = pulse2.rem;
let i2, n2, k2, f2;
for (i2 = 0, n2 = tuples.length; i2 < n2; ++i2) {
k2 = tuples[i2]._index;
map2[k2] = 1;
prev2[k2] = f2 = curr[k2];
curr[k2] = all3;
if (f2 !== all3)
out.push(k2);
}
for (k2 in indices) {
indices[k2].remove(n2, map2);
}
this.reindex(pulse2, n2, map2);
return map2;
},
// reindex filters and indices after propagation completes
reindex(pulse2, num, map2) {
const indices = this._indices, bits2 = this.value;
pulse2.runAfter(() => {
const indexMap = bits2.remove(num, map2);
for (const key2 in indices)
indices[key2].reindex(indexMap);
});
},
update(_24, pulse2, output3) {
const dims = this._dims, query = _24.query, stamp = pulse2.stamp, m2 = dims.length;
let mask = 0, i2, q2;
output3.filters = 0;
for (q2 = 0; q2 < m2; ++q2) {
if (_24.modified("query", q2)) {
i2 = q2;
++mask;
}
}
if (mask === 1) {
mask = dims[i2].one;
this.incrementOne(dims[i2], query[i2], output3.add, output3.rem);
} else {
for (q2 = 0, mask = 0; q2 < m2; ++q2) {
if (!_24.modified("query", q2))
continue;
mask |= dims[q2].one;
this.incrementAll(dims[q2], query[q2], stamp, output3.add);
output3.rem = output3.add;
}
}
return mask;
},
incrementAll(dim, query, stamp, out) {
const bits2 = this.value, seen2 = bits2.seen(), curr = bits2.curr(), prev2 = bits2.prev(), index2 = dim.index(), old = dim.bisect(dim.range), range2 = dim.bisect(query), lo1 = range2[0], hi1 = range2[1], lo0 = old[0], hi0 = old[1], one2 = dim.one;
let i2, j2, k2;
if (lo1 < lo0) {
for (i2 = lo1, j2 = Math.min(lo0, hi1); i2 < j2; ++i2) {
k2 = index2[i2];
if (seen2[k2] !== stamp) {
prev2[k2] = curr[k2];
seen2[k2] = stamp;
out.push(k2);
}
curr[k2] ^= one2;
}
} else if (lo1 > lo0) {
for (i2 = lo0, j2 = Math.min(lo1, hi0); i2 < j2; ++i2) {
k2 = index2[i2];
if (seen2[k2] !== stamp) {
prev2[k2] = curr[k2];
seen2[k2] = stamp;
out.push(k2);
}
curr[k2] ^= one2;
}
}
if (hi1 > hi0) {
for (i2 = Math.max(lo1, hi0), j2 = hi1; i2 < j2; ++i2) {
k2 = index2[i2];
if (seen2[k2] !== stamp) {
prev2[k2] = curr[k2];
seen2[k2] = stamp;
out.push(k2);
}
curr[k2] ^= one2;
}
} else if (hi1 < hi0) {
for (i2 = Math.max(lo0, hi1), j2 = hi0; i2 < j2; ++i2) {
k2 = index2[i2];
if (seen2[k2] !== stamp) {
prev2[k2] = curr[k2];
seen2[k2] = stamp;
out.push(k2);
}
curr[k2] ^= one2;
}
}
dim.range = query.slice();
},
incrementOne(dim, query, add3, rem2) {
const bits2 = this.value, curr = bits2.curr(), index2 = dim.index(), old = dim.bisect(dim.range), range2 = dim.bisect(query), lo1 = range2[0], hi1 = range2[1], lo0 = old[0], hi0 = old[1], one2 = dim.one;
let i2, j2, k2;
if (lo1 < lo0) {
for (i2 = lo1, j2 = Math.min(lo0, hi1); i2 < j2; ++i2) {
k2 = index2[i2];
curr[k2] ^= one2;
add3.push(k2);
}
} else if (lo1 > lo0) {
for (i2 = lo0, j2 = Math.min(lo1, hi0); i2 < j2; ++i2) {
k2 = index2[i2];
curr[k2] ^= one2;
rem2.push(k2);
}
}
if (hi1 > hi0) {
for (i2 = Math.max(lo1, hi0), j2 = hi1; i2 < j2; ++i2) {
k2 = index2[i2];
curr[k2] ^= one2;
add3.push(k2);
}
} else if (hi1 < hi0) {
for (i2 = Math.max(lo0, hi1), j2 = hi0; i2 < j2; ++i2) {
k2 = index2[i2];
curr[k2] ^= one2;
rem2.push(k2);
}
}
dim.range = query.slice();
}
});
function ResolveFilter(params2) {
Transform$1.call(this, null, params2);
}
ResolveFilter.Definition = {
"type": "ResolveFilter",
"metadata": {},
"params": [{
"name": "ignore",
"type": "number",
"required": true,
"description": "A bit mask indicating which filters to ignore."
}, {
"name": "filter",
"type": "object",
"required": true,
"description": "Per-tuple filter bitmaps from a CrossFilter transform."
}]
};
inherits(ResolveFilter, Transform$1, {
transform(_24, pulse2) {
const ignore = ~(_24.ignore || 0), bitmap = _24.filter, mask = bitmap.mask;
if ((mask & ignore) === 0)
return pulse2.StopPropagation;
const output3 = pulse2.fork(pulse2.ALL), data2 = bitmap.data(), curr = bitmap.curr(), prev2 = bitmap.prev(), pass = (k2) => !(curr[k2] & ignore) ? data2[k2] : null;
output3.filter(output3.MOD, pass);
if (!(mask & mask - 1)) {
output3.filter(output3.ADD, pass);
output3.filter(output3.REM, (k2) => (curr[k2] & ignore) === mask ? data2[k2] : null);
} else {
output3.filter(output3.ADD, (k2) => {
const c2 = curr[k2] & ignore, f2 = !c2 && c2 ^ prev2[k2] & ignore;
return f2 ? data2[k2] : null;
});
output3.filter(output3.REM, (k2) => {
const c2 = curr[k2] & ignore, f2 = c2 && !(c2 ^ (c2 ^ prev2[k2] & ignore));
return f2 ? data2[k2] : null;
});
}
return output3.filter(output3.SOURCE, (t5) => pass(t5._index));
}
});
const xf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
crossfilter: CrossFilter,
resolvefilter: ResolveFilter
}, Symbol.toStringTag, { value: "Module" }));
const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
function tickSpec(start2, stop2, count2) {
const step = (stop2 - start2) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error3 = step / Math.pow(10, power), factor = error3 >= e10 ? 10 : error3 >= e5 ? 5 : error3 >= e2 ? 2 : 1;
let i1, i2, inc;
if (power < 0) {
inc = Math.pow(10, -power) / factor;
i1 = Math.round(start2 * inc);
i2 = Math.round(stop2 * inc);
if (i1 / inc < start2)
++i1;
if (i2 / inc > stop2)
--i2;
inc = -inc;
} else {
inc = Math.pow(10, power) * factor;
i1 = Math.round(start2 / inc);
i2 = Math.round(stop2 / inc);
if (i1 * inc < start2)
++i1;
if (i2 * inc > stop2)
--i2;
}
if (i2 < i1 && 0.5 <= count2 && count2 < 2)
return tickSpec(start2, stop2, count2 * 2);
return [i1, i2, inc];
}
function tickIncrement(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
return tickSpec(start2, stop2, count2)[2];
}
function tickStep(start2, stop2, count2) {
stop2 = +stop2, start2 = +start2, count2 = +count2;
const reverse3 = stop2 < start2, inc = reverse3 ? tickIncrement(stop2, start2, count2) : tickIncrement(start2, stop2, count2);
return (reverse3 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}
const RawCode = "RawCode";
const Literal = "Literal";
const Property$1 = "Property";
const Identifier = "Identifier";
const ArrayExpression = "ArrayExpression";
const BinaryExpression = "BinaryExpression";
const CallExpression = "CallExpression";
const ConditionalExpression = "ConditionalExpression";
const LogicalExpression = "LogicalExpression";
const MemberExpression = "MemberExpression";
const ObjectExpression = "ObjectExpression";
const UnaryExpression = "UnaryExpression";
function ASTNode(type2) {
this.type = type2;
}
ASTNode.prototype.visit = function(visitor) {
let c2, i2, n2;
if (visitor(this))
return 1;
for (c2 = children(this), i2 = 0, n2 = c2.length; i2 < n2; ++i2) {
if (c2[i2].visit(visitor))
return 1;
}
};
function children(node2) {
switch (node2.type) {
case ArrayExpression:
return node2.elements;
case BinaryExpression:
case LogicalExpression:
return [node2.left, node2.right];
case CallExpression:
return [node2.callee].concat(node2.arguments);
case ConditionalExpression:
return [node2.test, node2.consequent, node2.alternate];
case MemberExpression:
return [node2.object, node2.property];
case ObjectExpression:
return node2.properties;
case Property$1:
return [node2.key, node2.value];
case UnaryExpression:
return [node2.argument];
case Identifier:
case Literal:
case RawCode:
default:
return [];
}
}
var TokenName, source, index$1, length, lookahead;
var TokenBooleanLiteral = 1, TokenEOF = 2, TokenIdentifier = 3, TokenKeyword = 4, TokenNullLiteral = 5, TokenNumericLiteral = 6, TokenPunctuator = 7, TokenStringLiteral = 8, TokenRegularExpression = 9;
TokenName = {};
TokenName[TokenBooleanLiteral] = "Boolean";
TokenName[TokenEOF] = "<end>";
TokenName[TokenIdentifier] = "Identifier";
TokenName[TokenKeyword] = "Keyword";
TokenName[TokenNullLiteral] = "Null";
TokenName[TokenNumericLiteral] = "Numeric";
TokenName[TokenPunctuator] = "Punctuator";
TokenName[TokenStringLiteral] = "String";
TokenName[TokenRegularExpression] = "RegularExpression";
var SyntaxArrayExpression = "ArrayExpression", SyntaxBinaryExpression = "BinaryExpression", SyntaxCallExpression = "CallExpression", SyntaxConditionalExpression = "ConditionalExpression", SyntaxIdentifier = "Identifier", SyntaxLiteral = "Literal", SyntaxLogicalExpression = "LogicalExpression", SyntaxMemberExpression = "MemberExpression", SyntaxObjectExpression = "ObjectExpression", SyntaxProperty = "Property", SyntaxUnaryExpression = "UnaryExpression";
var MessageUnexpectedToken = "Unexpected token %0", MessageUnexpectedNumber = "Unexpected number", MessageUnexpectedString = "Unexpected string", MessageUnexpectedIdentifier = "Unexpected identifier", MessageUnexpectedReserved = "Unexpected reserved word", MessageUnexpectedEOS = "Unexpected end of input", MessageInvalidRegExp = "Invalid regular expression", MessageUnterminatedRegExp = "Invalid regular expression: missing /", MessageStrictOctalLiteral = "Octal literals are not allowed in strict mode.", MessageStrictDuplicateProperty = "Duplicate data property in object literal not allowed in strict mode";
var ILLEGAL$1 = "ILLEGAL", DISABLED = "Disabled.";
var RegexNonAsciiIdentifierStart = new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), RegexNonAsciiIdentifierPart = new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");
function assert(condition, message) {
if (!condition) {
throw new Error("ASSERT: " + message);
}
}
function isDecimalDigit(ch2) {
return ch2 >= 48 && ch2 <= 57;
}
function isHexDigit(ch2) {
return "0123456789abcdefABCDEF".indexOf(ch2) >= 0;
}
function isOctalDigit(ch2) {
return "01234567".indexOf(ch2) >= 0;
}
function isWhiteSpace$1(ch2) {
return ch2 === 32 || ch2 === 9 || ch2 === 11 || ch2 === 12 || ch2 === 160 || ch2 >= 5760 && [5760, 6158, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(ch2) >= 0;
}
function isLineTerminator(ch2) {
return ch2 === 10 || ch2 === 13 || ch2 === 8232 || ch2 === 8233;
}
function isIdentifierStart$1(ch2) {
return ch2 === 36 || ch2 === 95 || // $ (dollar) and _ (underscore)
ch2 >= 65 && ch2 <= 90 || // A..Z
ch2 >= 97 && ch2 <= 122 || // a..z
ch2 === 92 || // \ (backslash)
ch2 >= 128 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch2));
}
function isIdentifierPart(ch2) {
return ch2 === 36 || ch2 === 95 || // $ (dollar) and _ (underscore)
ch2 >= 65 && ch2 <= 90 || // A..Z
ch2 >= 97 && ch2 <= 122 || // a..z
ch2 >= 48 && ch2 <= 57 || // 0..9
ch2 === 92 || // \ (backslash)
ch2 >= 128 && RegexNonAsciiIdentifierPart.test(String.fromCharCode(ch2));
}
const keywords = {
"if": 1,
"in": 1,
"do": 1,
"var": 1,
"for": 1,
"new": 1,
"try": 1,
"let": 1,
"this": 1,
"else": 1,
"case": 1,
"void": 1,
"with": 1,
"enum": 1,
"while": 1,
"break": 1,
"catch": 1,
"throw": 1,
"const": 1,
"yield": 1,
"class": 1,
"super": 1,
"return": 1,
"typeof": 1,
"delete": 1,
"switch": 1,
"export": 1,
"import": 1,
"public": 1,
"static": 1,
"default": 1,
"finally": 1,
"extends": 1,
"package": 1,
"private": 1,
"function": 1,
"continue": 1,
"debugger": 1,
"interface": 1,
"protected": 1,
"instanceof": 1,
"implements": 1
};
function skipComment() {
while (index$1 < length) {
const ch2 = source.charCodeAt(index$1);
if (isWhiteSpace$1(ch2) || isLineTerminator(ch2)) {
++index$1;
} else {
break;
}
}
}
function scanHexEscape(prefix2) {
var i2, len, ch2, code = 0;
len = prefix2 === "u" ? 4 : 2;
for (i2 = 0; i2 < len; ++i2) {
if (index$1 < length && isHexDigit(source[index$1])) {
ch2 = source[index$1++];
code = code * 16 + "0123456789abcdef".indexOf(ch2.toLowerCase());
} else {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
}
return String.fromCharCode(code);
}
function scanUnicodeCodePointEscape() {
var ch2, code, cu1, cu2;
ch2 = source[index$1];
code = 0;
if (ch2 === "}") {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
while (index$1 < length) {
ch2 = source[index$1++];
if (!isHexDigit(ch2)) {
break;
}
code = code * 16 + "0123456789abcdef".indexOf(ch2.toLowerCase());
}
if (code > 1114111 || ch2 !== "}") {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
if (code <= 65535) {
return String.fromCharCode(code);
}
cu1 = (code - 65536 >> 10) + 55296;
cu2 = (code - 65536 & 1023) + 56320;
return String.fromCharCode(cu1, cu2);
}
function getEscapedIdentifier() {
var ch2, id;
ch2 = source.charCodeAt(index$1++);
id = String.fromCharCode(ch2);
if (ch2 === 92) {
if (source.charCodeAt(index$1) !== 117) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
++index$1;
ch2 = scanHexEscape("u");
if (!ch2 || ch2 === "\\" || !isIdentifierStart$1(ch2.charCodeAt(0))) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
id = ch2;
}
while (index$1 < length) {
ch2 = source.charCodeAt(index$1);
if (!isIdentifierPart(ch2)) {
break;
}
++index$1;
id += String.fromCharCode(ch2);
if (ch2 === 92) {
id = id.substr(0, id.length - 1);
if (source.charCodeAt(index$1) !== 117) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
++index$1;
ch2 = scanHexEscape("u");
if (!ch2 || ch2 === "\\" || !isIdentifierPart(ch2.charCodeAt(0))) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
id += ch2;
}
}
return id;
}
function getIdentifier() {
var start2, ch2;
start2 = index$1++;
while (index$1 < length) {
ch2 = source.charCodeAt(index$1);
if (ch2 === 92) {
index$1 = start2;
return getEscapedIdentifier();
}
if (isIdentifierPart(ch2)) {
++index$1;
} else {
break;
}
}
return source.slice(start2, index$1);
}
function scanIdentifier() {
var start2, id, type2;
start2 = index$1;
id = source.charCodeAt(index$1) === 92 ? getEscapedIdentifier() : getIdentifier();
if (id.length === 1) {
type2 = TokenIdentifier;
} else if (keywords.hasOwnProperty(id)) {
type2 = TokenKeyword;
} else if (id === "null") {
type2 = TokenNullLiteral;
} else if (id === "true" || id === "false") {
type2 = TokenBooleanLiteral;
} else {
type2 = TokenIdentifier;
}
return {
type: type2,
value: id,
start: start2,
end: index$1
};
}
function scanPunctuator() {
var start2 = index$1, code = source.charCodeAt(index$1), code2, ch1 = source[index$1], ch2, ch3, ch4;
switch (code) {
case 46:
case 40:
case 41:
case 59:
case 44:
case 123:
case 125:
case 91:
case 93:
case 58:
case 63:
case 126:
++index$1;
return {
type: TokenPunctuator,
value: String.fromCharCode(code),
start: start2,
end: index$1
};
default:
code2 = source.charCodeAt(index$1 + 1);
if (code2 === 61) {
switch (code) {
case 43:
case 45:
case 47:
case 60:
case 62:
case 94:
case 124:
case 37:
case 38:
case 42:
index$1 += 2;
return {
type: TokenPunctuator,
value: String.fromCharCode(code) + String.fromCharCode(code2),
start: start2,
end: index$1
};
case 33:
case 61:
index$1 += 2;
if (source.charCodeAt(index$1) === 61) {
++index$1;
}
return {
type: TokenPunctuator,
value: source.slice(start2, index$1),
start: start2,
end: index$1
};
}
}
}
ch4 = source.substr(index$1, 4);
if (ch4 === ">>>=") {
index$1 += 4;
return {
type: TokenPunctuator,
value: ch4,
start: start2,
end: index$1
};
}
ch3 = ch4.substr(0, 3);
if (ch3 === ">>>" || ch3 === "<<=" || ch3 === ">>=") {
index$1 += 3;
return {
type: TokenPunctuator,
value: ch3,
start: start2,
end: index$1
};
}
ch2 = ch3.substr(0, 2);
if (ch1 === ch2[1] && "+-<>&|".indexOf(ch1) >= 0 || ch2 === "=>") {
index$1 += 2;
return {
type: TokenPunctuator,
value: ch2,
start: start2,
end: index$1
};
}
if (ch2 === "//") {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
if ("<>=!+-*%&|^/".indexOf(ch1) >= 0) {
++index$1;
return {
type: TokenPunctuator,
value: ch1,
start: start2,
end: index$1
};
}
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
function scanHexLiteral(start2) {
let number2 = "";
while (index$1 < length) {
if (!isHexDigit(source[index$1])) {
break;
}
number2 += source[index$1++];
}
if (number2.length === 0) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
if (isIdentifierStart$1(source.charCodeAt(index$1))) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
return {
type: TokenNumericLiteral,
value: parseInt("0x" + number2, 16),
start: start2,
end: index$1
};
}
function scanOctalLiteral(start2) {
let number2 = "0" + source[index$1++];
while (index$1 < length) {
if (!isOctalDigit(source[index$1])) {
break;
}
number2 += source[index$1++];
}
if (isIdentifierStart$1(source.charCodeAt(index$1)) || isDecimalDigit(source.charCodeAt(index$1))) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
return {
type: TokenNumericLiteral,
value: parseInt(number2, 8),
octal: true,
start: start2,
end: index$1
};
}
function scanNumericLiteral() {
var number2, start2, ch2;
ch2 = source[index$1];
assert(isDecimalDigit(ch2.charCodeAt(0)) || ch2 === ".", "Numeric literal must start with a decimal digit or a decimal point");
start2 = index$1;
number2 = "";
if (ch2 !== ".") {
number2 = source[index$1++];
ch2 = source[index$1];
if (number2 === "0") {
if (ch2 === "x" || ch2 === "X") {
++index$1;
return scanHexLiteral(start2);
}
if (isOctalDigit(ch2)) {
return scanOctalLiteral(start2);
}
if (ch2 && isDecimalDigit(ch2.charCodeAt(0))) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
}
while (isDecimalDigit(source.charCodeAt(index$1))) {
number2 += source[index$1++];
}
ch2 = source[index$1];
}
if (ch2 === ".") {
number2 += source[index$1++];
while (isDecimalDigit(source.charCodeAt(index$1))) {
number2 += source[index$1++];
}
ch2 = source[index$1];
}
if (ch2 === "e" || ch2 === "E") {
number2 += source[index$1++];
ch2 = source[index$1];
if (ch2 === "+" || ch2 === "-") {
number2 += source[index$1++];
}
if (isDecimalDigit(source.charCodeAt(index$1))) {
while (isDecimalDigit(source.charCodeAt(index$1))) {
number2 += source[index$1++];
}
} else {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
}
if (isIdentifierStart$1(source.charCodeAt(index$1))) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
return {
type: TokenNumericLiteral,
value: parseFloat(number2),
start: start2,
end: index$1
};
}
function scanStringLiteral() {
var str = "", quote, start2, ch2, code, octal = false;
quote = source[index$1];
assert(quote === "'" || quote === '"', "String literal must starts with a quote");
start2 = index$1;
++index$1;
while (index$1 < length) {
ch2 = source[index$1++];
if (ch2 === quote) {
quote = "";
break;
} else if (ch2 === "\\") {
ch2 = source[index$1++];
if (!ch2 || !isLineTerminator(ch2.charCodeAt(0))) {
switch (ch2) {
case "u":
case "x":
if (source[index$1] === "{") {
++index$1;
str += scanUnicodeCodePointEscape();
} else {
str += scanHexEscape(ch2);
}
break;
case "n":
str += "\n";
break;
case "r":
str += "\r";
break;
case "t":
str += " ";
break;
case "b":
str += "\b";
break;
case "f":
str += "\f";
break;
case "v":
str += "\v";
break;
default:
if (isOctalDigit(ch2)) {
code = "01234567".indexOf(ch2);
if (code !== 0) {
octal = true;
}
if (index$1 < length && isOctalDigit(source[index$1])) {
octal = true;
code = code * 8 + "01234567".indexOf(source[index$1++]);
if ("0123".indexOf(ch2) >= 0 && index$1 < length && isOctalDigit(source[index$1])) {
code = code * 8 + "01234567".indexOf(source[index$1++]);
}
}
str += String.fromCharCode(code);
} else {
str += ch2;
}
break;
}
} else {
if (ch2 === "\r" && source[index$1] === "\n") {
++index$1;
}
}
} else if (isLineTerminator(ch2.charCodeAt(0))) {
break;
} else {
str += ch2;
}
}
if (quote !== "") {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
}
return {
type: TokenStringLiteral,
value: str,
octal,
start: start2,
end: index$1
};
}
function testRegExp(pattern, flags) {
let tmp = pattern;
if (flags.indexOf("u") >= 0) {
tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}/g, ($0, $1) => {
if (parseInt($1, 16) <= 1114111) {
return "x";
}
throwError({}, MessageInvalidRegExp);
}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x");
}
try {
new RegExp(tmp);
} catch (e7) {
throwError({}, MessageInvalidRegExp);
}
try {
return new RegExp(pattern, flags);
} catch (exception) {
return null;
}
}
function scanRegExpBody() {
var ch2, str, classMarker, terminated, body;
ch2 = source[index$1];
assert(ch2 === "/", "Regular expression literal must start with a slash");
str = source[index$1++];
classMarker = false;
terminated = false;
while (index$1 < length) {
ch2 = source[index$1++];
str += ch2;
if (ch2 === "\\") {
ch2 = source[index$1++];
if (isLineTerminator(ch2.charCodeAt(0))) {
throwError({}, MessageUnterminatedRegExp);
}
str += ch2;
} else if (isLineTerminator(ch2.charCodeAt(0))) {
throwError({}, MessageUnterminatedRegExp);
} else if (classMarker) {
if (ch2 === "]") {
classMarker = false;
}
} else {
if (ch2 === "/") {
terminated = true;
break;
} else if (ch2 === "[") {
classMarker = true;
}
}
}
if (!terminated) {
throwError({}, MessageUnterminatedRegExp);
}
body = str.substr(1, str.length - 2);
return {
value: body,
literal: str
};
}
function scanRegExpFlags() {
var ch2, str, flags;
str = "";
flags = "";
while (index$1 < length) {
ch2 = source[index$1];
if (!isIdentifierPart(ch2.charCodeAt(0))) {
break;
}
++index$1;
if (ch2 === "\\" && index$1 < length) {
throwError({}, MessageUnexpectedToken, ILLEGAL$1);
} else {
flags += ch2;
str += ch2;
}
}
if (flags.search(/[^gimuy]/g) >= 0) {
throwError({}, MessageInvalidRegExp, flags);
}
return {
value: flags,
literal: str
};
}
function scanRegExp() {
var start2, body, flags, value2;
lookahead = null;
skipComment();
start2 = index$1;
body = scanRegExpBody();
flags = scanRegExpFlags();
value2 = testRegExp(body.value, flags.value);
return {
literal: body.literal + flags.literal,
value: value2,
regex: {
pattern: body.value,
flags: flags.value
},
start: start2,
end: index$1
};
}
function isIdentifierName(token2) {
return token2.type === TokenIdentifier || token2.type === TokenKeyword || token2.type === TokenBooleanLiteral || token2.type === TokenNullLiteral;
}
function advance() {
skipComment();
if (index$1 >= length) {
return {
type: TokenEOF,
start: index$1,
end: index$1
};
}
const ch2 = source.charCodeAt(index$1);
if (isIdentifierStart$1(ch2)) {
return scanIdentifier();
}
if (ch2 === 40 || ch2 === 41 || ch2 === 59) {
return scanPunctuator();
}
if (ch2 === 39 || ch2 === 34) {
return scanStringLiteral();
}
if (ch2 === 46) {
if (isDecimalDigit(source.charCodeAt(index$1 + 1))) {
return scanNumericLiteral();
}
return scanPunctuator();
}
if (isDecimalDigit(ch2)) {
return scanNumericLiteral();
}
return scanPunctuator();
}
function lex() {
const token2 = lookahead;
index$1 = token2.end;
lookahead = advance();
index$1 = token2.end;
return token2;
}
function peek() {
const pos = index$1;
lookahead = advance();
index$1 = pos;
}
function finishArrayExpression(elements2) {
const node2 = new ASTNode(SyntaxArrayExpression);
node2.elements = elements2;
return node2;
}
function finishBinaryExpression(operator2, left2, right2) {
const node2 = new ASTNode(operator2 === "||" || operator2 === "&&" ? SyntaxLogicalExpression : SyntaxBinaryExpression);
node2.operator = operator2;
node2.left = left2;
node2.right = right2;
return node2;
}
function finishCallExpression(callee, args) {
const node2 = new ASTNode(SyntaxCallExpression);
node2.callee = callee;
node2.arguments = args;
return node2;
}
function finishConditionalExpression(test2, consequent, alternate) {
const node2 = new ASTNode(SyntaxConditionalExpression);
node2.test = test2;
node2.consequent = consequent;
node2.alternate = alternate;
return node2;
}
function finishIdentifier(name) {
const node2 = new ASTNode(SyntaxIdentifier);
node2.name = name;
return node2;
}
function finishLiteral(token2) {
const node2 = new ASTNode(SyntaxLiteral);
node2.value = token2.value;
node2.raw = source.slice(token2.start, token2.end);
if (token2.regex) {
if (node2.raw === "//") {
node2.raw = "/(?:)/";
}
node2.regex = token2.regex;
}
return node2;
}
function finishMemberExpression(accessor2, object2, property2) {
const node2 = new ASTNode(SyntaxMemberExpression);
node2.computed = accessor2 === "[";
node2.object = object2;
node2.property = property2;
if (!node2.computed)
property2.member = true;
return node2;
}
function finishObjectExpression(properties2) {
const node2 = new ASTNode(SyntaxObjectExpression);
node2.properties = properties2;
return node2;
}
function finishProperty(kind, key2, value2) {
const node2 = new ASTNode(SyntaxProperty);
node2.key = key2;
node2.value = value2;
node2.kind = kind;
return node2;
}
function finishUnaryExpression(operator2, argument) {
const node2 = new ASTNode(SyntaxUnaryExpression);
node2.operator = operator2;
node2.argument = argument;
node2.prefix = true;
return node2;
}
function throwError(token2, messageFormat) {
var error3, args = Array.prototype.slice.call(arguments, 2), msg = messageFormat.replace(/%(\d)/g, (whole, index2) => {
assert(index2 < args.length, "Message reference must be in range");
return args[index2];
});
error3 = new Error(msg);
error3.index = index$1;
error3.description = msg;
throw error3;
}
function throwUnexpected(token2) {
if (token2.type === TokenEOF) {
throwError(token2, MessageUnexpectedEOS);
}
if (token2.type === TokenNumericLiteral) {
throwError(token2, MessageUnexpectedNumber);
}
if (token2.type === TokenStringLiteral) {
throwError(token2, MessageUnexpectedString);
}
if (token2.type === TokenIdentifier) {
throwError(token2, MessageUnexpectedIdentifier);
}
if (token2.type === TokenKeyword) {
throwError(token2, MessageUnexpectedReserved);
}
throwError(token2, MessageUnexpectedToken, token2.value);
}
function expect(value2) {
const token2 = lex();
if (token2.type !== TokenPunctuator || token2.value !== value2) {
throwUnexpected(token2);
}
}
function match$1(value2) {
return lookahead.type === TokenPunctuator && lookahead.value === value2;
}
function matchKeyword(keyword) {
return lookahead.type === TokenKeyword && lookahead.value === keyword;
}
function parseArrayInitialiser() {
const elements2 = [];
index$1 = lookahead.start;
expect("[");
while (!match$1("]")) {
if (match$1(",")) {
lex();
elements2.push(null);
} else {
elements2.push(parseConditionalExpression());
if (!match$1("]")) {
expect(",");
}
}
}
lex();
return finishArrayExpression(elements2);
}
function parseObjectPropertyKey() {
index$1 = lookahead.start;
const token2 = lex();
if (token2.type === TokenStringLiteral || token2.type === TokenNumericLiteral) {
if (token2.octal) {
throwError(token2, MessageStrictOctalLiteral);
}
return finishLiteral(token2);
}
return finishIdentifier(token2.value);
}
function parseObjectProperty() {
var token2, key2, id, value2;
index$1 = lookahead.start;
token2 = lookahead;
if (token2.type === TokenIdentifier) {
id = parseObjectPropertyKey();
expect(":");
value2 = parseConditionalExpression();
return finishProperty("init", id, value2);
}
if (token2.type === TokenEOF || token2.type === TokenPunctuator) {
throwUnexpected(token2);
} else {
key2 = parseObjectPropertyKey();
expect(":");
value2 = parseConditionalExpression();
return finishProperty("init", key2, value2);
}
}
function parseObjectInitialiser() {
var properties2 = [], property2, name, key2, map2 = {}, toString4 = String;
index$1 = lookahead.start;
expect("{");
while (!match$1("}")) {
property2 = parseObjectProperty();
if (property2.key.type === SyntaxIdentifier) {
name = property2.key.name;
} else {
name = toString4(property2.key.value);
}
key2 = "$" + name;
if (Object.prototype.hasOwnProperty.call(map2, key2)) {
throwError({}, MessageStrictDuplicateProperty);
} else {
map2[key2] = true;
}
properties2.push(property2);
if (!match$1("}")) {
expect(",");
}
}
expect("}");
return finishObjectExpression(properties2);
}
function parseGroupExpression() {
expect("(");
const expr2 = parseExpression();
expect(")");
return expr2;
}
const legalKeywords = {
"if": 1
};
function parsePrimaryExpression() {
var type2, token2, expr2;
if (match$1("(")) {
return parseGroupExpression();
}
if (match$1("[")) {
return parseArrayInitialiser();
}
if (match$1("{")) {
return parseObjectInitialiser();
}
type2 = lookahead.type;
index$1 = lookahead.start;
if (type2 === TokenIdentifier || legalKeywords[lookahead.value]) {
expr2 = finishIdentifier(lex().value);
} else if (type2 === TokenStringLiteral || type2 === TokenNumericLiteral) {
if (lookahead.octal) {
throwError(lookahead, MessageStrictOctalLiteral);
}
expr2 = finishLiteral(lex());
} else if (type2 === TokenKeyword) {
throw new Error(DISABLED);
} else if (type2 === TokenBooleanLiteral) {
token2 = lex();
token2.value = token2.value === "true";
expr2 = finishLiteral(token2);
} else if (type2 === TokenNullLiteral) {
token2 = lex();
token2.value = null;
expr2 = finishLiteral(token2);
} else if (match$1("/") || match$1("/=")) {
expr2 = finishLiteral(scanRegExp());
peek();
} else {
throwUnexpected(lex());
}
return expr2;
}
function parseArguments() {
const args = [];
expect("(");
if (!match$1(")")) {
while (index$1 < length) {
args.push(parseConditionalExpression());
if (match$1(")")) {
break;
}
expect(",");
}
}
expect(")");
return args;
}
function parseNonComputedProperty() {
index$1 = lookahead.start;
const token2 = lex();
if (!isIdentifierName(token2)) {
throwUnexpected(token2);
}
return finishIdentifier(token2.value);
}
function parseNonComputedMember() {
expect(".");
return parseNonComputedProperty();
}
function parseComputedMember() {
expect("[");
const expr2 = parseExpression();
expect("]");
return expr2;
}
function parseLeftHandSideExpressionAllowCall() {
var expr2, args, property2;
expr2 = parsePrimaryExpression();
for (; ; ) {
if (match$1(".")) {
property2 = parseNonComputedMember();
expr2 = finishMemberExpression(".", expr2, property2);
} else if (match$1("(")) {
args = parseArguments();
expr2 = finishCallExpression(expr2, args);
} else if (match$1("[")) {
property2 = parseComputedMember();
expr2 = finishMemberExpression("[", expr2, property2);
} else {
break;
}
}
return expr2;
}
function parsePostfixExpression() {
const expr2 = parseLeftHandSideExpressionAllowCall();
if (lookahead.type === TokenPunctuator) {
if (match$1("++") || match$1("--")) {
throw new Error(DISABLED);
}
}
return expr2;
}
function parseUnaryExpression() {
var token2, expr2;
if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) {
expr2 = parsePostfixExpression();
} else if (match$1("++") || match$1("--")) {
throw new Error(DISABLED);
} else if (match$1("+") || match$1("-") || match$1("~") || match$1("!")) {
token2 = lex();
expr2 = parseUnaryExpression();
expr2 = finishUnaryExpression(token2.value, expr2);
} else if (matchKeyword("delete") || matchKeyword("void") || matchKeyword("typeof")) {
throw new Error(DISABLED);
} else {
expr2 = parsePostfixExpression();
}
return expr2;
}
function binaryPrecedence(token2) {
let prec = 0;
if (token2.type !== TokenPunctuator && token2.type !== TokenKeyword) {
return 0;
}
switch (token2.value) {
case "||":
prec = 1;
break;
case "&&":
prec = 2;
break;
case "|":
prec = 3;
break;
case "^":
prec = 4;
break;
case "&":
prec = 5;
break;
case "==":
case "!=":
case "===":
case "!==":
prec = 6;
break;
case "<":
case ">":
case "<=":
case ">=":
case "instanceof":
case "in":
prec = 7;
break;
case "<<":
case ">>":
case ">>>":
prec = 8;
break;
case "+":
case "-":
prec = 9;
break;
case "*":
case "/":
case "%":
prec = 11;
break;
}
return prec;
}
function parseBinaryExpression() {
var marker, markers, expr2, token2, prec, stack, right2, operator2, left2, i2;
marker = lookahead;
left2 = parseUnaryExpression();
token2 = lookahead;
prec = binaryPrecedence(token2);
if (prec === 0) {
return left2;
}
token2.prec = prec;
lex();
markers = [marker, lookahead];
right2 = parseUnaryExpression();
stack = [left2, token2, right2];
while ((prec = binaryPrecedence(lookahead)) > 0) {
while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {
right2 = stack.pop();
operator2 = stack.pop().value;
left2 = stack.pop();
markers.pop();
expr2 = finishBinaryExpression(operator2, left2, right2);
stack.push(expr2);
}
token2 = lex();
token2.prec = prec;
stack.push(token2);
markers.push(lookahead);
expr2 = parseUnaryExpression();
stack.push(expr2);
}
i2 = stack.length - 1;
expr2 = stack[i2];
markers.pop();
while (i2 > 1) {
markers.pop();
expr2 = finishBinaryExpression(stack[i2 - 1].value, stack[i2 - 2], expr2);
i2 -= 2;
}
return expr2;
}
function parseConditionalExpression() {
var expr2, consequent, alternate;
expr2 = parseBinaryExpression();
if (match$1("?")) {
lex();
consequent = parseConditionalExpression();
expect(":");
alternate = parseConditionalExpression();
expr2 = finishConditionalExpression(expr2, consequent, alternate);
}
return expr2;
}
function parseExpression() {
const expr2 = parseConditionalExpression();
if (match$1(",")) {
throw new Error(DISABLED);
}
return expr2;
}
function parser$1(code) {
source = code;
index$1 = 0;
length = source.length;
lookahead = null;
peek();
const expr2 = parseExpression();
if (lookahead.type !== TokenEOF) {
throw new Error("Unexpect token after expression.");
}
return expr2;
}
var Constants = {
NaN: "NaN",
E: "Math.E",
LN2: "Math.LN2",
LN10: "Math.LN10",
LOG2E: "Math.LOG2E",
LOG10E: "Math.LOG10E",
PI: "Math.PI",
SQRT1_2: "Math.SQRT1_2",
SQRT2: "Math.SQRT2",
MIN_VALUE: "Number.MIN_VALUE",
MAX_VALUE: "Number.MAX_VALUE"
};
function Functions(codegen2) {
function fncall(name, args, cast, type2) {
let obj = codegen2(args[0]);
if (cast) {
obj = cast + "(" + obj + ")";
if (cast.lastIndexOf("new ", 0) === 0)
obj = "(" + obj + ")";
}
return obj + "." + name + (type2 < 0 ? "" : type2 === 0 ? "()" : "(" + args.slice(1).map(codegen2).join(",") + ")");
}
function fn8(name, cast, type2) {
return (args) => fncall(name, args, cast, type2);
}
const DATE2 = "new Date", STRING2 = "String", REGEXP = "RegExp";
return {
// MATH functions
isNaN: "Number.isNaN",
isFinite: "Number.isFinite",
abs: "Math.abs",
acos: "Math.acos",
asin: "Math.asin",
atan: "Math.atan",
atan2: "Math.atan2",
ceil: "Math.ceil",
cos: "Math.cos",
exp: "Math.exp",
floor: "Math.floor",
hypot: "Math.hypot",
log: "Math.log",
max: "Math.max",
min: "Math.min",
pow: "Math.pow",
random: "Math.random",
round: "Math.round",
sin: "Math.sin",
sqrt: "Math.sqrt",
tan: "Math.tan",
clamp: function(args) {
if (args.length < 3)
error2("Missing arguments to clamp function.");
if (args.length > 3)
error2("Too many arguments to clamp function.");
const a2 = args.map(codegen2);
return "Math.max(" + a2[1] + ", Math.min(" + a2[2] + "," + a2[0] + "))";
},
// DATE functions
now: "Date.now",
utc: "Date.UTC",
datetime: DATE2,
date: fn8("getDate", DATE2, 0),
day: fn8("getDay", DATE2, 0),
year: fn8("getFullYear", DATE2, 0),
month: fn8("getMonth", DATE2, 0),
hours: fn8("getHours", DATE2, 0),
minutes: fn8("getMinutes", DATE2, 0),
seconds: fn8("getSeconds", DATE2, 0),
milliseconds: fn8("getMilliseconds", DATE2, 0),
time: fn8("getTime", DATE2, 0),
timezoneoffset: fn8("getTimezoneOffset", DATE2, 0),
utcdate: fn8("getUTCDate", DATE2, 0),
utcday: fn8("getUTCDay", DATE2, 0),
utcyear: fn8("getUTCFullYear", DATE2, 0),
utcmonth: fn8("getUTCMonth", DATE2, 0),
utchours: fn8("getUTCHours", DATE2, 0),
utcminutes: fn8("getUTCMinutes", DATE2, 0),
utcseconds: fn8("getUTCSeconds", DATE2, 0),
utcmilliseconds: fn8("getUTCMilliseconds", DATE2, 0),
// sequence functions
length: fn8("length", null, -1),
// STRING functions
parseFloat: "parseFloat",
parseInt: "parseInt",
upper: fn8("toUpperCase", STRING2, 0),
lower: fn8("toLowerCase", STRING2, 0),
substring: fn8("substring", STRING2),
split: fn8("split", STRING2),
trim: fn8("trim", STRING2, 0),
// REGEXP functions
regexp: REGEXP,
test: fn8("test", REGEXP),
// Control Flow functions
if: function(args) {
if (args.length < 3)
error2("Missing arguments to if function.");
if (args.length > 3)
error2("Too many arguments to if function.");
const a2 = args.map(codegen2);
return "(" + a2[0] + "?" + a2[1] + ":" + a2[2] + ")";
}
};
}
function stripQuotes(s2) {
const n2 = s2 && s2.length - 1;
return n2 && (s2[0] === '"' && s2[n2] === '"' || s2[0] === "'" && s2[n2] === "'") ? s2.slice(1, -1) : s2;
}
function codegen(opt) {
opt = opt || {};
const allowed = opt.allowed ? toSet(opt.allowed) : {}, forbidden = opt.forbidden ? toSet(opt.forbidden) : {}, constants2 = opt.constants || Constants, functions = (opt.functions || Functions)(visit2), globalvar = opt.globalvar, fieldvar = opt.fieldvar, outputGlobal = isFunction(globalvar) ? globalvar : (id) => `${globalvar}["${id}"]`;
let globals = {}, fields = {}, memberDepth = 0;
function visit2(ast) {
if (isString(ast))
return ast;
const generator = Generators[ast.type];
if (generator == null)
error2("Unsupported type: " + ast.type);
return generator(ast);
}
const Generators = {
Literal: (n2) => n2.raw,
Identifier: (n2) => {
const id = n2.name;
if (memberDepth > 0) {
return id;
} else if (has$2(forbidden, id)) {
return error2("Illegal identifier: " + id);
} else if (has$2(constants2, id)) {
return constants2[id];
} else if (has$2(allowed, id)) {
return id;
} else {
globals[id] = 1;
return outputGlobal(id);
}
},
MemberExpression: (n2) => {
const d2 = !n2.computed, o2 = visit2(n2.object);
if (d2)
memberDepth += 1;
const p2 = visit2(n2.property);
if (o2 === fieldvar) {
fields[stripQuotes(p2)] = 1;
}
if (d2)
memberDepth -= 1;
return o2 + (d2 ? "." + p2 : "[" + p2 + "]");
},
CallExpression: (n2) => {
if (n2.callee.type !== "Identifier") {
error2("Illegal callee type: " + n2.callee.type);
}
const callee = n2.callee.name, args = n2.arguments, fn8 = has$2(functions, callee) && functions[callee];
if (!fn8)
error2("Unrecognized function: " + callee);
return isFunction(fn8) ? fn8(args) : fn8 + "(" + args.map(visit2).join(",") + ")";
},
ArrayExpression: (n2) => "[" + n2.elements.map(visit2).join(",") + "]",
BinaryExpression: (n2) => "(" + visit2(n2.left) + " " + n2.operator + " " + visit2(n2.right) + ")",
UnaryExpression: (n2) => "(" + n2.operator + visit2(n2.argument) + ")",
ConditionalExpression: (n2) => "(" + visit2(n2.test) + "?" + visit2(n2.consequent) + ":" + visit2(n2.alternate) + ")",
LogicalExpression: (n2) => "(" + visit2(n2.left) + n2.operator + visit2(n2.right) + ")",
ObjectExpression: (n2) => "{" + n2.properties.map(visit2).join(",") + "}",
Property: (n2) => {
memberDepth += 1;
const k2 = visit2(n2.key);
memberDepth -= 1;
return k2 + ":" + visit2(n2.value);
}
};
function codegen2(ast) {
const result = {
code: visit2(ast),
globals: Object.keys(globals),
fields: Object.keys(fields)
};
globals = {};
fields = {};
return result;
}
codegen2.functions = functions;
codegen2.constants = constants2;
return codegen2;
}
function ascending(a2, b2) {
return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
}
function descending(a2, b2) {
return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN;
}
function bisector(f2) {
let compare12, compare22, delta;
if (f2.length !== 2) {
compare12 = ascending;
compare22 = (d2, x2) => ascending(f2(d2), x2);
delta = (d2, x2) => f2(d2) - x2;
} else {
compare12 = f2 === ascending || f2 === descending ? f2 : zero$1;
compare22 = f2;
delta = f2;
}
function left2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) < 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function right2(a2, x2, lo2 = 0, hi2 = a2.length) {
if (lo2 < hi2) {
if (compare12(x2, x2) !== 0)
return hi2;
do {
const mid = lo2 + hi2 >>> 1;
if (compare22(a2[mid], x2) <= 0)
lo2 = mid + 1;
else
hi2 = mid;
} while (lo2 < hi2);
}
return lo2;
}
function center(a2, x2, lo2 = 0, hi2 = a2.length) {
const i2 = left2(a2, x2, lo2, hi2 - 1);
return i2 > lo2 && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
}
return { left: left2, center, right: right2 };
}
function zero$1() {
return 0;
}
function intersection(values2, ...others) {
values2 = new InternSet(values2);
others = others.map(set$2);
out:
for (const value2 of values2) {
for (const other of others) {
if (!other.has(value2)) {
values2.delete(value2);
continue out;
}
}
}
return values2;
}
function set$2(values2) {
return values2 instanceof InternSet ? values2 : new InternSet(values2);
}
function union(...others) {
const set2 = new InternSet();
for (const other of others) {
for (const o2 of other) {
set2.add(o2);
}
}
return set2;
}
const SELECTION_GETTER = Symbol("vega_selection_getter");
function getter(f2) {
if (!f2.getter || !f2.getter[SELECTION_GETTER]) {
f2.getter = field$1(f2.field);
f2.getter[SELECTION_GETTER] = true;
}
return f2.getter;
}
const Intersect = "intersect";
const Union = "union";
const VlMulti = "vlMulti";
const VlPoint = "vlPoint";
const Or$1 = "or";
const And = "and";
const SelectionId = "_vgsid_";
const $selectionId = field$1(SelectionId);
const TYPE_ENUM = "E", TYPE_RANGE_INC = "R", TYPE_RANGE_EXC = "R-E", TYPE_RANGE_LE = "R-LE", TYPE_RANGE_RE = "R-RE", UNIT_INDEX = "index:unit";
function testPoint(datum2, entry2) {
var fields = entry2.fields, values2 = entry2.values, n2 = fields.length, i2 = 0, dval, f2;
for (; i2 < n2; ++i2) {
f2 = fields[i2];
dval = getter(f2)(datum2);
if (isDate$1(dval))
dval = toNumber2(dval);
if (isDate$1(values2[i2]))
values2[i2] = toNumber2(values2[i2]);
if (isArray$2(values2[i2]) && isDate$1(values2[i2][0]))
values2[i2] = values2[i2].map(toNumber2);
if (f2.type === TYPE_ENUM) {
if (isArray$2(values2[i2]) ? values2[i2].indexOf(dval) < 0 : dval !== values2[i2]) {
return false;
}
} else {
if (f2.type === TYPE_RANGE_INC) {
if (!inrange(dval, values2[i2]))
return false;
} else if (f2.type === TYPE_RANGE_RE) {
if (!inrange(dval, values2[i2], true, false))
return false;
} else if (f2.type === TYPE_RANGE_EXC) {
if (!inrange(dval, values2[i2], false, false))
return false;
} else if (f2.type === TYPE_RANGE_LE) {
if (!inrange(dval, values2[i2], false, true))
return false;
}
}
}
return true;
}
function selectionTest(name, datum2, op) {
var data2 = this.context.data[name], entries = data2 ? data2.values.value : [], unitIdx = data2 ? data2[UNIT_INDEX] && data2[UNIT_INDEX].value : void 0, intersect2 = op === Intersect, n2 = entries.length, i2 = 0, entry2, miss, count2, unit2, b2;
for (; i2 < n2; ++i2) {
entry2 = entries[i2];
if (unitIdx && intersect2) {
miss = miss || {};
count2 = miss[unit2 = entry2.unit] || 0;
if (count2 === -1)
continue;
b2 = testPoint(datum2, entry2);
miss[unit2] = b2 ? -1 : ++count2;
if (b2 && unitIdx.size === 1)
return true;
if (!b2 && count2 === unitIdx.get(unit2).count)
return false;
} else {
b2 = testPoint(datum2, entry2);
if (intersect2 ^ b2)
return b2;
}
}
return n2 && intersect2;
}
const bisect = bisector($selectionId), bisectLeft = bisect.left, bisectRight = bisect.right;
function selectionIdTest(name, datum2, op) {
const data2 = this.context.data[name], entries = data2 ? data2.values.value : [], unitIdx = data2 ? data2[UNIT_INDEX] && data2[UNIT_INDEX].value : void 0, intersect2 = op === Intersect, value2 = $selectionId(datum2), index2 = bisectLeft(entries, value2);
if (index2 === entries.length)
return false;
if ($selectionId(entries[index2]) !== value2)
return false;
if (unitIdx && intersect2) {
if (unitIdx.size === 1)
return true;
if (bisectRight(entries, value2) - index2 < unitIdx.size)
return false;
}
return true;
}
function selectionTuples(array2, base2) {
return array2.map((x2) => extend$2(base2.fields ? {
values: base2.fields.map((f2) => getter(f2)(x2.datum))
} : {
[SelectionId]: $selectionId(x2.datum)
}, base2));
}
function selectionResolve(name, op, isMulti, vl5) {
var data2 = this.context.data[name], entries = data2 ? data2.values.value : [], resolved = {}, multiRes = {}, types2 = {}, entry2, fields, values2, unit2, field2, value2, res, resUnit, type2, union2, n2 = entries.length, i2 = 0, j2, m2;
for (; i2 < n2; ++i2) {
entry2 = entries[i2];
unit2 = entry2.unit;
fields = entry2.fields;
values2 = entry2.values;
if (fields && values2) {
for (j2 = 0, m2 = fields.length; j2 < m2; ++j2) {
field2 = fields[j2];
res = resolved[field2.field] || (resolved[field2.field] = {});
resUnit = res[unit2] || (res[unit2] = []);
types2[field2.field] = type2 = field2.type.charAt(0);
union2 = ops[`${type2}_union`];
res[unit2] = union2(resUnit, array$5(values2[j2]));
}
if (isMulti) {
resUnit = multiRes[unit2] || (multiRes[unit2] = []);
resUnit.push(array$5(values2).reduce((obj, curr, j3) => (obj[fields[j3].field] = curr, obj), {}));
}
} else {
field2 = SelectionId;
value2 = $selectionId(entry2);
res = resolved[field2] || (resolved[field2] = {});
resUnit = res[unit2] || (res[unit2] = []);
resUnit.push(value2);
if (isMulti) {
resUnit = multiRes[unit2] || (multiRes[unit2] = []);
resUnit.push({
[SelectionId]: value2
});
}
}
}
op = op || Union;
if (resolved[SelectionId]) {
resolved[SelectionId] = ops[`${SelectionId}_${op}`](...Object.values(resolved[SelectionId]));
} else {
Object.keys(resolved).forEach((field3) => {
resolved[field3] = Object.keys(resolved[field3]).map((unit3) => resolved[field3][unit3]).reduce((acc, curr) => acc === void 0 ? curr : ops[`${types2[field3]}_${op}`](acc, curr));
});
}
entries = Object.keys(multiRes);
if (isMulti && entries.length) {
const key2 = vl5 ? VlPoint : VlMulti;
resolved[key2] = op === Union ? {
[Or$1]: entries.reduce((acc, k2) => (acc.push(...multiRes[k2]), acc), [])
} : {
[And]: entries.map((k2) => ({
[Or$1]: multiRes[k2]
}))
};
}
return resolved;
}
var ops = {
[`${SelectionId}_union`]: union,
[`${SelectionId}_intersect`]: intersection,
E_union: function(base2, value2) {
if (!base2.length)
return value2;
var i2 = 0, n2 = value2.length;
for (; i2 < n2; ++i2)
if (base2.indexOf(value2[i2]) < 0)
base2.push(value2[i2]);
return base2;
},
E_intersect: function(base2, value2) {
return !base2.length ? value2 : base2.filter((v2) => value2.indexOf(v2) >= 0);
},
R_union: function(base2, value2) {
var lo2 = toNumber2(value2[0]), hi2 = toNumber2(value2[1]);
if (lo2 > hi2) {
lo2 = value2[1];
hi2 = value2[0];
}
if (!base2.length)
return [lo2, hi2];
if (base2[0] > lo2)
base2[0] = lo2;
if (base2[1] < hi2)
base2[1] = hi2;
return base2;
},
R_intersect: function(base2, value2) {
var lo2 = toNumber2(value2[0]), hi2 = toNumber2(value2[1]);
if (lo2 > hi2) {
lo2 = value2[1];
hi2 = value2[0];
}
if (!base2.length)
return [lo2, hi2];
if (hi2 < base2[0] || base2[1] < lo2) {
return [];
} else {
if (base2[0] < lo2)
base2[0] = lo2;
if (base2[1] > hi2)
base2[1] = hi2;
}
return base2;
}
};
const DataPrefix$1 = ":", IndexPrefix$1 = "@";
function selectionVisitor(name, args, scope, params2) {
if (args[0].type !== Literal)
error2("First argument to selection functions must be a string literal.");
const data2 = args[0].value, op = args.length >= 2 && peek$1(args).value, field2 = "unit", indexName = IndexPrefix$1 + field2, dataName = DataPrefix$1 + data2;
if (op === Intersect && !has$2(params2, indexName)) {
params2[indexName] = scope.getData(data2).indataRef(scope, field2);
}
if (!has$2(params2, dataName)) {
params2[dataName] = scope.getData(data2).tuplesRef();
}
}
function range$2(start2, stop2, step) {
start2 = +start2, stop2 = +stop2, step = (n2 = arguments.length) < 2 ? (stop2 = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
var i2 = -1, n2 = Math.max(0, Math.ceil((stop2 - start2) / step)) | 0, range2 = new Array(n2);
while (++i2 < n2) {
range2[i2] = start2 + i2 * step;
}
return range2;
}
function data$2(name) {
const data2 = this.context.data[name];
return data2 ? data2.values.value : [];
}
function indata(name, field2, value2) {
const index2 = this.context.data[name]["index:" + field2], entry2 = index2 ? index2.value.get(value2) : void 0;
return entry2 ? entry2.count : entry2;
}
function setdata(name, tuples) {
const df2 = this.context.dataflow, data2 = this.context.data[name], input = data2.input;
df2.pulse(input, df2.changeset().remove(truthy).insert(tuples));
return 1;
}
function encode(item, name, retval) {
if (item) {
const df2 = this.context.dataflow, target2 = item.mark.source;
df2.pulse(target2, df2.changeset().encode(item, name));
}
return retval !== void 0 ? retval : item;
}
const wrap = (method) => function(value2, spec) {
const locale2 = this.context.dataflow.locale();
return locale2[method](spec)(value2);
};
const format = wrap("format");
const timeFormat = wrap("timeFormat");
const utcFormat = wrap("utcFormat");
const timeParse = wrap("timeParse");
const utcParse = wrap("utcParse");
const dateObj = new Date(2e3, 0, 1);
function time$1(month2, day2, specifier) {
if (!Number.isInteger(month2) || !Number.isInteger(day2))
return "";
dateObj.setYear(2e3);
dateObj.setMonth(month2);
dateObj.setDate(day2);
return timeFormat.call(this, dateObj, specifier);
}
function monthFormat(month2) {
return time$1.call(this, month2, 1, "%B");
}
function monthAbbrevFormat(month2) {
return time$1.call(this, month2, 1, "%b");
}
function dayFormat(day2) {
return time$1.call(this, 0, 2 + day2, "%A");
}
function dayAbbrevFormat(day2) {
return time$1.call(this, 0, 2 + day2, "%a");
}
const DataPrefix = ":";
const IndexPrefix = "@";
const ScalePrefix = "%";
const SignalPrefix = "$";
function dataVisitor(name, args, scope, params2) {
if (args[0].type !== Literal) {
error2("First argument to data functions must be a string literal.");
}
const data2 = args[0].value, dataName = DataPrefix + data2;
if (!has$2(dataName, params2)) {
try {
params2[dataName] = scope.getData(data2).tuplesRef();
} catch (err) {
}
}
}
function indataVisitor(name, args, scope, params2) {
if (args[0].type !== Literal)
error2("First argument to indata must be a string literal.");
if (args[1].type !== Literal)
error2("Second argument to indata must be a string literal.");
const data2 = args[0].value, field2 = args[1].value, indexName = IndexPrefix + field2;
if (!has$2(indexName, params2)) {
params2[indexName] = scope.getData(data2).indataRef(scope, field2);
}
}
function scaleVisitor(name, args, scope, params2) {
if (args[0].type === Literal) {
addScaleDependency(scope, params2, args[0].value);
} else {
for (name in scope.scales) {
addScaleDependency(scope, params2, name);
}
}
}
function addScaleDependency(scope, params2, name) {
const scaleName = ScalePrefix + name;
if (!has$2(params2, scaleName)) {
try {
params2[scaleName] = scope.scaleRef(name);
} catch (err) {
}
}
}
function getScale(nameOrFunction, ctx) {
if (isFunction(nameOrFunction)) {
return nameOrFunction;
}
if (isString(nameOrFunction)) {
const maybeScale = ctx.scales[nameOrFunction];
return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : void 0;
}
return void 0;
}
function internalScaleFunctions(codegen2, fnctx, visitors) {
fnctx.__bandwidth = (s2) => s2 && s2.bandwidth ? s2.bandwidth() : 0;
visitors._bandwidth = scaleVisitor;
visitors._range = scaleVisitor;
visitors._scale = scaleVisitor;
const ref2 = (arg) => "_[" + (arg.type === Literal ? $$h(ScalePrefix + arg.value) : $$h(ScalePrefix) + "+" + codegen2(arg)) + "]";
return {
_bandwidth: (args) => `this.__bandwidth(${ref2(args[0])})`,
_range: (args) => `${ref2(args[0])}.range()`,
_scale: (args) => `${ref2(args[0])}(${codegen2(args[1])})`
};
}
function geoMethod(methodName, globalMethod) {
return function(projection2, geojson, group2) {
if (projection2) {
const p2 = getScale(projection2, (group2 || this).context);
return p2 && p2.path[methodName](geojson);
} else {
return globalMethod(geojson);
}
};
}
const geoArea = geoMethod("area", geoArea$1);
const geoBounds = geoMethod("bounds", geoBounds$1);
const geoCentroid = geoMethod("centroid", geoCentroid$1);
function geoScale(projection2, group2) {
const p2 = getScale(projection2, (group2 || this).context);
return p2 && p2.scale();
}
function inScope(item) {
const group2 = this.context.group;
let value2 = false;
if (group2)
while (item) {
if (item === group2) {
value2 = true;
break;
}
item = item.mark.group;
}
return value2;
}
function log2(df2, method, args) {
try {
df2[method].apply(df2, ["EXPRESSION"].concat([].slice.call(args)));
} catch (err) {
df2.warn(err);
}
return args[args.length - 1];
}
function warn2() {
return log2(this.context.dataflow, "warn", arguments);
}
function info() {
return log2(this.context.dataflow, "info", arguments);
}
function debug() {
return log2(this.context.dataflow, "debug", arguments);
}
function channel_luminance_value(channelValue) {
const val = channelValue / 255;
if (val <= 0.03928) {
return val / 12.92;
}
return Math.pow((val + 0.055) / 1.055, 2.4);
}
function luminance(color2) {
const c2 = rgb$3(color2), r2 = channel_luminance_value(c2.r), g2 = channel_luminance_value(c2.g), b2 = channel_luminance_value(c2.b);
return 0.2126 * r2 + 0.7152 * g2 + 0.0722 * b2;
}
function contrast(color1, color2) {
const lum1 = luminance(color1), lum2 = luminance(color2), lumL = Math.max(lum1, lum2), lumD = Math.min(lum1, lum2);
return (lumL + 0.05) / (lumD + 0.05);
}
function merge() {
const args = [].slice.call(arguments);
args.unshift({});
return extend$2(...args);
}
function equal(a2, b2) {
return a2 === b2 || a2 !== a2 && b2 !== b2 ? true : isArray$2(a2) ? isArray$2(b2) && a2.length === b2.length ? equalArray(a2, b2) : false : isObject$a(a2) && isObject$a(b2) ? equalObject(a2, b2) : false;
}
function equalArray(a2, b2) {
for (let i2 = 0, n2 = a2.length; i2 < n2; ++i2) {
if (!equal(a2[i2], b2[i2]))
return false;
}
return true;
}
function equalObject(a2, b2) {
for (const key2 in a2) {
if (!equal(a2[key2], b2[key2]))
return false;
}
return true;
}
function removePredicate(props) {
return (_24) => equalObject(props, _24);
}
function modify(name, insert2, remove3, toggle2, modify2, values2) {
const df2 = this.context.dataflow, data2 = this.context.data[name], input = data2.input, stamp = df2.stamp();
let changes = data2.changes, predicate, key2;
if (df2._trigger === false || !(input.value.length || insert2 || toggle2)) {
return 0;
}
if (!changes || changes.stamp < stamp) {
data2.changes = changes = df2.changeset();
changes.stamp = stamp;
df2.runAfter(() => {
data2.modified = true;
df2.pulse(input, changes).run();
}, true, 1);
}
if (remove3) {
predicate = remove3 === true ? truthy : isArray$2(remove3) || isTuple(remove3) ? remove3 : removePredicate(remove3);
changes.remove(predicate);
}
if (insert2) {
changes.insert(insert2);
}
if (toggle2) {
predicate = removePredicate(toggle2);
if (input.value.some(predicate)) {
changes.remove(predicate);
} else {
changes.insert(toggle2);
}
}
if (modify2) {
for (key2 in values2) {
changes.modify(modify2, key2, values2[key2]);
}
}
return 1;
}
function pinchDistance(event2) {
const t5 = event2.touches, dx = t5[0].clientX - t5[1].clientX, dy = t5[0].clientY - t5[1].clientY;
return Math.hypot(dx, dy);
}
function pinchAngle(event2) {
const t5 = event2.touches;
return Math.atan2(t5[0].clientY - t5[1].clientY, t5[0].clientX - t5[1].clientX);
}
const accessors = {};
function pluck(data2, name) {
const accessor2 = accessors[name] || (accessors[name] = field$1(name));
return isArray$2(data2) ? data2.map(accessor2) : accessor2(data2);
}
function array(seq) {
return isArray$2(seq) || ArrayBuffer.isView(seq) ? seq : null;
}
function sequence(seq) {
return array(seq) || (isString(seq) ? seq : null);
}
function join$1(seq) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return array(seq).join(...args);
}
function indexof(seq) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return sequence(seq).indexOf(...args);
}
function lastindexof(seq) {
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = arguments[_key3];
}
return sequence(seq).lastIndexOf(...args);
}
function slice$1(seq) {
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
args[_key4 - 1] = arguments[_key4];
}
return sequence(seq).slice(...args);
}
function replace$4(str, pattern, repl) {
if (isFunction(repl))
error2("Function argument passed to replace.");
return String(str).replace(pattern, repl);
}
function reverse(seq) {
return array(seq).slice().reverse();
}
function bandspace(count2, paddingInner, paddingOuter) {
return bandSpace(count2 || 0, paddingInner || 0, paddingOuter || 0);
}
function bandwidth(name, group2) {
const s2 = getScale(name, (group2 || this).context);
return s2 && s2.bandwidth ? s2.bandwidth() : 0;
}
function copy(name, group2) {
const s2 = getScale(name, (group2 || this).context);
return s2 ? s2.copy() : void 0;
}
function domain(name, group2) {
const s2 = getScale(name, (group2 || this).context);
return s2 ? s2.domain() : [];
}
function invert(name, range2, group2) {
const s2 = getScale(name, (group2 || this).context);
return !s2 ? void 0 : isArray$2(range2) ? (s2.invertRange || s2.invert)(range2) : (s2.invert || s2.invertExtent)(range2);
}
function range$1(name, group2) {
const s2 = getScale(name, (group2 || this).context);
return s2 && s2.range ? s2.range() : [];
}
function scale$2(name, value2, group2) {
const s2 = getScale(name, (group2 || this).context);
return s2 ? s2(value2) : void 0;
}
function scaleGradient(scale2, p02, p1, count2, group2) {
scale2 = getScale(scale2, (group2 || this).context);
const gradient2 = Gradient$1(p02, p1);
let stops = scale2.domain(), min2 = stops[0], max2 = peek$1(stops), fraction = identity$6;
if (!(max2 - min2)) {
scale2 = (scale2.interpolator ? scale$4("sequential")().interpolator(scale2.interpolator()) : scale$4("linear")().interpolate(scale2.interpolate()).range(scale2.range())).domain([min2 = 0, max2 = 1]);
} else {
fraction = scaleFraction(scale2, min2, max2);
}
if (scale2.ticks) {
stops = scale2.ticks(+count2 || 15);
if (min2 !== stops[0])
stops.unshift(min2);
if (max2 !== peek$1(stops))
stops.push(max2);
}
stops.forEach((_24) => gradient2.stop(fraction(_24), scale2(_24)));
return gradient2;
}
function geoShape(projection2, geojson, group2) {
const p2 = getScale(projection2, (group2 || this).context);
return function(context2) {
return p2 ? p2.path.context(context2)(geojson) : "";
};
}
function pathShape(path2) {
let p2 = null;
return function(context2) {
return context2 ? pathRender(context2, p2 = p2 || parse$4(path2)) : path2;
};
}
const datum = (d2) => d2.data;
function treeNodes(name, context2) {
const tree2 = data$2.call(context2, name);
return tree2.root && tree2.root.lookup || {};
}
function treePath(name, source2, target2) {
const nodes = treeNodes(name, this), s2 = nodes[source2], t5 = nodes[target2];
return s2 && t5 ? s2.path(t5).map(datum) : void 0;
}
function treeAncestors(name, node2) {
const n2 = treeNodes(name, this)[node2];
return n2 ? n2.ancestors().map(datum) : void 0;
}
const _window = () => typeof window !== "undefined" && window || null;
function screen() {
const w2 = _window();
return w2 ? w2.screen : {};
}
function windowSize() {
const w2 = _window();
return w2 ? [w2.innerWidth, w2.innerHeight] : [void 0, void 0];
}
function containerSize() {
const view = this.context.dataflow, el = view.container && view.container();
return el ? [el.clientWidth, el.clientHeight] : [void 0, void 0];
}
function intersect(b2, opt, group2) {
if (!b2)
return [];
const [u2, v2] = b2, box = new Bounds$1().set(u2[0], u2[1], v2[0], v2[1]), scene = group2 || this.context.dataflow.scenegraph().root;
return intersect$2(scene, box, filter(opt));
}
function filter(opt) {
let p2 = null;
if (opt) {
const types2 = array$5(opt.marktype), names = array$5(opt.markname);
p2 = (_24) => (!types2.length || types2.some((t5) => _24.marktype === t5)) && (!names.length || names.some((s2) => _24.name === s2));
}
return p2;
}
function lassoAppend(lasso, x2, y2) {
let minDist = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 5;
lasso = array$5(lasso);
const last = lasso[lasso.length - 1];
return last === void 0 || Math.hypot(last[0] - x2, last[1] - y2) > minDist ? [...lasso, [x2, y2]] : lasso;
}
function lassoPath(lasso) {
return array$5(lasso).reduce((svg2, _ref3, i2) => {
let [x2, y2] = _ref3;
return svg2 += i2 == 0 ? `M ${x2},${y2} ` : i2 === lasso.length - 1 ? " Z" : `L ${x2},${y2} `;
}, "");
}
function intersectLasso(markname, pixelLasso, unit2) {
const {
x: x2,
y: y2,
mark
} = unit2;
const bb2 = new Bounds$1().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
for (const [px2, py2] of pixelLasso) {
if (px2 < bb2.x1)
bb2.x1 = px2;
if (px2 > bb2.x2)
bb2.x2 = px2;
if (py2 < bb2.y1)
bb2.y1 = py2;
if (py2 > bb2.y2)
bb2.y2 = py2;
}
bb2.translate(x2, y2);
const intersection2 = intersect([[bb2.x1, bb2.y1], [bb2.x2, bb2.y2]], markname, mark);
return intersection2.filter((tuple) => pointInPolygon(tuple.x, tuple.y, pixelLasso));
}
function pointInPolygon(testx, testy, polygon) {
let intersections = 0;
for (let i2 = 0, j2 = polygon.length - 1; i2 < polygon.length; j2 = i2++) {
const [prevX, prevY] = polygon[j2];
const [x2, y2] = polygon[i2];
if (y2 > testy != prevY > testy && testx < (prevX - x2) * (testy - y2) / (prevY - y2) + x2) {
intersections++;
}
}
return intersections & 1;
}
const functionContext = {
random() {
return random();
},
// override default
cumulativeNormal,
cumulativeLogNormal,
cumulativeUniform,
densityNormal,
densityLogNormal,
densityUniform,
quantileNormal,
quantileLogNormal,
quantileUniform,
sampleNormal,
sampleLogNormal,
sampleUniform,
isArray: isArray$2,
isBoolean: isBoolean$1,
isDate: isDate$1,
isDefined(_24) {
return _24 !== void 0;
},
isNumber: isNumber$1,
isObject: isObject$a,
isRegExp: isRegExp$2,
isString,
isTuple,
isValid(_24) {
return _24 != null && _24 === _24;
},
toBoolean,
toDate(_24) {
return toDate(_24);
},
// suppress extra arguments
toNumber: toNumber2,
toString: toString$c,
indexof,
join: join$1,
lastindexof,
replace: replace$4,
reverse,
slice: slice$1,
flush: flush$1,
lerp: lerp$1,
merge,
pad: pad$3,
peek: peek$1,
pluck,
span,
inrange,
truncate: truncate$1,
rgb: rgb$3,
lab: lab$1,
hcl: hcl$2,
hsl: hsl$4,
luminance,
contrast,
sequence: range$2,
format,
utcFormat,
utcParse,
utcOffset,
utcSequence,
timeFormat,
timeParse,
timeOffset,
timeSequence,
timeUnitSpecifier,
monthFormat,
monthAbbrevFormat,
dayFormat,
dayAbbrevFormat,
quarter,
utcquarter,
week,
utcweek,
dayofyear,
utcdayofyear,
warn: warn2,
info,
debug,
extent(_24) {
return extent(_24);
},
// suppress extra arguments
inScope,
intersect,
clampRange,
pinchDistance,
pinchAngle,
screen,
containerSize,
windowSize,
bandspace,
setdata,
pathShape,
panLinear,
panLog,
panPow,
panSymlog,
zoomLinear,
zoomLog,
zoomPow,
zoomSymlog,
encode,
modify,
lassoAppend,
lassoPath,
intersectLasso
};
const eventFunctions = ["view", "item", "group", "xy", "x", "y"], eventPrefix = "event.vega.", thisPrefix = "this.", astVisitors = {};
const codegenParams = {
forbidden: ["_"],
allowed: ["datum", "event", "item"],
fieldvar: "datum",
globalvar: (id) => `_[${$$h(SignalPrefix + id)}]`,
functions: buildFunctions,
constants: Constants,
visitors: astVisitors
};
const codeGenerator = codegen(codegenParams);
function buildFunctions(codegen2) {
const fn8 = Functions(codegen2);
eventFunctions.forEach((name) => fn8[name] = eventPrefix + name);
for (const name in functionContext) {
fn8[name] = thisPrefix + name;
}
extend$2(fn8, internalScaleFunctions(codegen2, functionContext, astVisitors));
return fn8;
}
function expressionFunction(name, fn8, visitor) {
if (arguments.length === 1) {
return functionContext[name];
}
functionContext[name] = fn8;
if (visitor)
astVisitors[name] = visitor;
if (codeGenerator)
codeGenerator.functions[name] = thisPrefix + name;
return this;
}
expressionFunction("bandwidth", bandwidth, scaleVisitor);
expressionFunction("copy", copy, scaleVisitor);
expressionFunction("domain", domain, scaleVisitor);
expressionFunction("range", range$1, scaleVisitor);
expressionFunction("invert", invert, scaleVisitor);
expressionFunction("scale", scale$2, scaleVisitor);
expressionFunction("gradient", scaleGradient, scaleVisitor);
expressionFunction("geoArea", geoArea, scaleVisitor);
expressionFunction("geoBounds", geoBounds, scaleVisitor);
expressionFunction("geoCentroid", geoCentroid, scaleVisitor);
expressionFunction("geoShape", geoShape, scaleVisitor);
expressionFunction("geoScale", geoScale, scaleVisitor);
expressionFunction("indata", indata, indataVisitor);
expressionFunction("data", data$2, dataVisitor);
expressionFunction("treePath", treePath, dataVisitor);
expressionFunction("treeAncestors", treeAncestors, dataVisitor);
expressionFunction("vlSelectionTest", selectionTest, selectionVisitor);
expressionFunction("vlSelectionIdTest", selectionIdTest, selectionVisitor);
expressionFunction("vlSelectionResolve", selectionResolve, selectionVisitor);
expressionFunction("vlSelectionTuples", selectionTuples);
function parser(expr2, scope) {
const params2 = {};
let ast;
try {
expr2 = isString(expr2) ? expr2 : $$h(expr2) + "";
ast = parser$1(expr2);
} catch (err) {
error2("Expression parse error: " + expr2);
}
ast.visit((node2) => {
if (node2.type !== CallExpression)
return;
const name = node2.callee.name, visit2 = codegenParams.visitors[name];
if (visit2)
visit2(name, node2.arguments, scope, params2);
});
const gen = codeGenerator(ast);
gen.globals.forEach((name) => {
const signalName = SignalPrefix + name;
if (!has$2(params2, signalName) && scope.getSignal(name)) {
params2[signalName] = scope.signalRef(name);
}
});
return {
$expr: extend$2({
code: gen.code
}, scope.options.ast ? {
ast
} : null),
$fields: gen.fields,
$params: params2
};
}
function parse$3(spec) {
const ctx = this, operators = spec.operators || [];
if (spec.background) {
ctx.background = spec.background;
}
if (spec.eventConfig) {
ctx.eventConfig = spec.eventConfig;
}
if (spec.locale) {
ctx.locale = spec.locale;
}
operators.forEach((entry2) => ctx.parseOperator(entry2));
operators.forEach((entry2) => ctx.parseOperatorParameters(entry2));
(spec.streams || []).forEach((entry2) => ctx.parseStream(entry2));
(spec.updates || []).forEach((entry2) => ctx.parseUpdate(entry2));
return ctx.resolve();
}
const Skip$2 = toSet(["rule"]), Swap = toSet(["group", "image", "rect"]);
function adjustSpatial(encode2, marktype) {
let code = "";
if (Skip$2[marktype])
return code;
if (encode2.x2) {
if (encode2.x) {
if (Swap[marktype]) {
code += "if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;";
}
code += "o.width=o.x2-o.x;";
} else {
code += "o.x=o.x2-(o.width||0);";
}
}
if (encode2.xc) {
code += "o.x=o.xc-(o.width||0)/2;";
}
if (encode2.y2) {
if (encode2.y) {
if (Swap[marktype]) {
code += "if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;";
}
code += "o.height=o.y2-o.y;";
} else {
code += "o.y=o.y2-(o.height||0);";
}
}
if (encode2.yc) {
code += "o.y=o.yc-(o.height||0)/2;";
}
return code;
}
function canonicalType(type2) {
return (type2 + "").toLowerCase();
}
function isOperator(type2) {
return canonicalType(type2) === "operator";
}
function isCollect(type2) {
return canonicalType(type2) === "collect";
}
function expression(ctx, args, code) {
if (!code.endsWith(";")) {
code = "return(" + code + ");";
}
const fn8 = Function(...args.concat(code));
return ctx && ctx.functions ? fn8.bind(ctx.functions) : fn8;
}
function _compare(u2, v2, lt2, gt2) {
return `((u = ${u2}) < (v = ${v2}) || u == null) && v != null ? ${lt2}
: (u > v || v == null) && u != null ? ${gt2}
: ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${lt2}
: v !== v && u === u ? ${gt2} : `;
}
var expressionCodegen = {
/**
* Parse an expression used to update an operator value.
*/
operator: (ctx, expr2) => expression(ctx, ["_"], expr2.code),
/**
* Parse an expression provided as an operator parameter value.
*/
parameter: (ctx, expr2) => expression(ctx, ["datum", "_"], expr2.code),
/**
* Parse an expression applied to an event stream.
*/
event: (ctx, expr2) => expression(ctx, ["event"], expr2.code),
/**
* Parse an expression used to handle an event-driven operator update.
*/
handler: (ctx, expr2) => {
const code = `var datum=event.item&&event.item.datum;return ${expr2.code};`;
return expression(ctx, ["_", "event"], code);
},
/**
* Parse an expression that performs visual encoding.
*/
encode: (ctx, encode2) => {
const {
marktype,
channels
} = encode2;
let code = "var o=item,datum=o.datum,m=0,$;";
for (const name in channels) {
const o2 = "o[" + $$h(name) + "]";
code += `$=${channels[name].code};if(${o2}!==$)${o2}=$,m=1;`;
}
code += adjustSpatial(channels, marktype);
code += "return m;";
return expression(ctx, ["item", "_"], code);
},
/**
* Optimized code generators for access and comparison.
*/
codegen: {
get(path2) {
const ref2 = `[${path2.map($$h).join("][")}]`;
const get2 = Function("_", `return _${ref2};`);
get2.path = ref2;
return get2;
},
comparator(fields, orders) {
let t5;
const map2 = (f2, i2) => {
const o2 = orders[i2];
let u2, v2;
if (f2.path) {
u2 = `a${f2.path}`;
v2 = `b${f2.path}`;
} else {
(t5 = t5 || {})["f" + i2] = f2;
u2 = `this.f${i2}(a)`;
v2 = `this.f${i2}(b)`;
}
return _compare(u2, v2, -o2, o2);
};
const fn8 = Function("a", "b", "var u, v; return " + fields.map(map2).join("") + "0;");
return t5 ? fn8.bind(t5) : fn8;
}
}
};
function parseOperator(spec) {
const ctx = this;
if (isOperator(spec.type) || !spec.type) {
ctx.operator(spec, spec.update ? ctx.operatorExpression(spec.update) : null);
} else {
ctx.transform(spec, spec.type);
}
}
function parseOperatorParameters(spec) {
const ctx = this;
if (spec.params) {
const op = ctx.get(spec.id);
if (!op)
error2("Invalid operator id: " + spec.id);
ctx.dataflow.connect(op, op.parameters(ctx.parseParameters(spec.params), spec.react, spec.initonly));
}
}
function parseParameters$1(spec, params2) {
params2 = params2 || {};
const ctx = this;
for (const key2 in spec) {
const value2 = spec[key2];
params2[key2] = isArray$2(value2) ? value2.map((v2) => parseParameter$2(v2, ctx, params2)) : parseParameter$2(value2, ctx, params2);
}
return params2;
}
function parseParameter$2(spec, ctx, params2) {
if (!spec || !isObject$a(spec))
return spec;
for (let i2 = 0, n2 = PARSERS.length, p2; i2 < n2; ++i2) {
p2 = PARSERS[i2];
if (has$2(spec, p2.key)) {
return p2.parse(spec, ctx, params2);
}
}
return spec;
}
var PARSERS = [{
key: "$ref",
parse: getOperator
}, {
key: "$key",
parse: getKey
}, {
key: "$expr",
parse: getExpression
}, {
key: "$field",
parse: getField
}, {
key: "$encode",
parse: getEncode
}, {
key: "$compare",
parse: getCompare
}, {
key: "$context",
parse: getContext
}, {
key: "$subflow",
parse: getSubflow
}, {
key: "$tupleid",
parse: getTupleId
}];
function getOperator(_24, ctx) {
return ctx.get(_24.$ref) || error2("Operator not defined: " + _24.$ref);
}
function getExpression(_24, ctx, params2) {
if (_24.$params) {
ctx.parseParameters(_24.$params, params2);
}
const k2 = "e:" + _24.$expr.code;
return ctx.fn[k2] || (ctx.fn[k2] = accessor(ctx.parameterExpression(_24.$expr), _24.$fields));
}
function getKey(_24, ctx) {
const k2 = "k:" + _24.$key + "_" + !!_24.$flat;
return ctx.fn[k2] || (ctx.fn[k2] = key(_24.$key, _24.$flat, ctx.expr.codegen));
}
function getField(_24, ctx) {
if (!_24.$field)
return null;
const k2 = "f:" + _24.$field + "_" + _24.$name;
return ctx.fn[k2] || (ctx.fn[k2] = field$1(_24.$field, _24.$name, ctx.expr.codegen));
}
function getCompare(_24, ctx) {
const k2 = "c:" + _24.$compare + "_" + _24.$order, c2 = array$5(_24.$compare).map((_25) => _25 && _25.$tupleid ? tupleid : _25);
return ctx.fn[k2] || (ctx.fn[k2] = compare$1(c2, _24.$order, ctx.expr.codegen));
}
function getEncode(_24, ctx) {
const spec = _24.$encode, encode2 = {};
for (const name in spec) {
const enc = spec[name];
encode2[name] = accessor(ctx.encodeExpression(enc.$expr), enc.$fields);
encode2[name].output = enc.$output;
}
return encode2;
}
function getContext(_24, ctx) {
return ctx;
}
function getSubflow(_24, ctx) {
const spec = _24.$subflow;
return function(dataflow, key2, parent) {
const subctx = ctx.fork().parse(spec), op = subctx.get(spec.operators[0].id), p2 = subctx.signals.parent;
if (p2)
p2.set(parent);
op.detachSubflow = () => ctx.detach(subctx);
return op;
};
}
function getTupleId() {
return tupleid;
}
function parseStream$2(spec) {
var ctx = this, filter2 = spec.filter != null ? ctx.eventExpression(spec.filter) : void 0, stream2 = spec.stream != null ? ctx.get(spec.stream) : void 0, args;
if (spec.source) {
stream2 = ctx.events(spec.source, spec.type, filter2);
} else if (spec.merge) {
args = spec.merge.map((_24) => ctx.get(_24));
stream2 = args[0].merge.apply(args[0], args.slice(1));
}
if (spec.between) {
args = spec.between.map((_24) => ctx.get(_24));
stream2 = stream2.between(args[0], args[1]);
}
if (spec.filter) {
stream2 = stream2.filter(filter2);
}
if (spec.throttle != null) {
stream2 = stream2.throttle(+spec.throttle);
}
if (spec.debounce != null) {
stream2 = stream2.debounce(+spec.debounce);
}
if (stream2 == null) {
error2("Invalid stream definition: " + JSON.stringify(spec));
}
if (spec.consume)
stream2.consume(true);
ctx.stream(spec, stream2);
}
function parseUpdate$1(spec) {
var ctx = this, srcid = isObject$a(srcid = spec.source) ? srcid.$ref : srcid, source2 = ctx.get(srcid), target2 = null, update2 = spec.update, params2 = void 0;
if (!source2)
error2("Source not defined: " + spec.source);
target2 = spec.target && spec.target.$expr ? ctx.eventExpression(spec.target.$expr) : ctx.get(spec.target);
if (update2 && update2.$expr) {
if (update2.$params) {
params2 = ctx.parseParameters(update2.$params);
}
update2 = ctx.handlerExpression(update2.$expr);
}
ctx.update(spec, source2, target2, update2, params2);
}
const SKIP = {
skip: true
};
function getState$1(options2) {
var ctx = this, state = {};
if (options2.signals) {
var signals = state.signals = {};
Object.keys(ctx.signals).forEach((key2) => {
const op = ctx.signals[key2];
if (options2.signals(key2, op)) {
signals[key2] = op.value;
}
});
}
if (options2.data) {
var data2 = state.data = {};
Object.keys(ctx.data).forEach((key2) => {
const dataset = ctx.data[key2];
if (options2.data(key2, dataset)) {
data2[key2] = dataset.input.value;
}
});
}
if (ctx.subcontext && options2.recurse !== false) {
state.subcontext = ctx.subcontext.map((ctx2) => ctx2.getState(options2));
}
return state;
}
function setState$1(state) {
var ctx = this, df2 = ctx.dataflow, data2 = state.data, signals = state.signals;
Object.keys(signals || {}).forEach((key2) => {
df2.update(ctx.signals[key2], signals[key2], SKIP);
});
Object.keys(data2 || {}).forEach((key2) => {
df2.pulse(ctx.data[key2].input, df2.changeset().remove(truthy).insert(data2[key2]));
});
(state.subcontext || []).forEach((substate, i2) => {
const subctx = ctx.subcontext[i2];
if (subctx)
subctx.setState(substate);
});
}
function context(df2, transforms2, functions, expr2) {
return new Context$1(df2, transforms2, functions, expr2);
}
function Context$1(df2, transforms2, functions, expr2) {
this.dataflow = df2;
this.transforms = transforms2;
this.events = df2.events.bind(df2);
this.expr = expr2 || expressionCodegen, this.signals = {};
this.scales = {};
this.nodes = {};
this.data = {};
this.fn = {};
if (functions) {
this.functions = Object.create(functions);
this.functions.context = this;
}
}
function Subcontext(ctx) {
this.dataflow = ctx.dataflow;
this.transforms = ctx.transforms;
this.events = ctx.events;
this.expr = ctx.expr;
this.signals = Object.create(ctx.signals);
this.scales = Object.create(ctx.scales);
this.nodes = Object.create(ctx.nodes);
this.data = Object.create(ctx.data);
this.fn = Object.create(ctx.fn);
if (ctx.functions) {
this.functions = Object.create(ctx.functions);
this.functions.context = this;
}
}
Context$1.prototype = Subcontext.prototype = {
fork() {
const ctx = new Subcontext(this);
(this.subcontext || (this.subcontext = [])).push(ctx);
return ctx;
},
detach(ctx) {
this.subcontext = this.subcontext.filter((c2) => c2 !== ctx);
const keys3 = Object.keys(ctx.nodes);
for (const key2 of keys3)
ctx.nodes[key2]._targets = null;
for (const key2 of keys3)
ctx.nodes[key2].detach();
ctx.nodes = null;
},
get(id) {
return this.nodes[id];
},
set(id, node2) {
return this.nodes[id] = node2;
},
add(spec, op) {
const ctx = this, df2 = ctx.dataflow, data2 = spec.value;
ctx.set(spec.id, op);
if (isCollect(spec.type) && data2) {
if (data2.$ingest) {
df2.ingest(op, data2.$ingest, data2.$format);
} else if (data2.$request) {
df2.preload(op, data2.$request, data2.$format);
} else {
df2.pulse(op, df2.changeset().insert(data2));
}
}
if (spec.root) {
ctx.root = op;
}
if (spec.parent) {
let p2 = ctx.get(spec.parent.$ref);
if (p2) {
df2.connect(p2, [op]);
op.targets().add(p2);
} else {
(ctx.unresolved = ctx.unresolved || []).push(() => {
p2 = ctx.get(spec.parent.$ref);
df2.connect(p2, [op]);
op.targets().add(p2);
});
}
}
if (spec.signal) {
ctx.signals[spec.signal] = op;
}
if (spec.scale) {
ctx.scales[spec.scale] = op;
}
if (spec.data) {
for (const name in spec.data) {
const data3 = ctx.data[name] || (ctx.data[name] = {});
spec.data[name].forEach((role) => data3[role] = op);
}
}
},
resolve() {
(this.unresolved || []).forEach((fn8) => fn8());
delete this.unresolved;
return this;
},
operator(spec, update2) {
this.add(spec, this.dataflow.add(spec.value, update2));
},
transform(spec, type2) {
this.add(spec, this.dataflow.add(this.transforms[canonicalType(type2)]));
},
stream(spec, stream2) {
this.set(spec.id, stream2);
},
update(spec, stream2, target2, update2, params2) {
this.dataflow.on(stream2, target2, update2, params2, spec.options);
},
// expression parsing
operatorExpression(expr2) {
return this.expr.operator(this, expr2);
},
parameterExpression(expr2) {
return this.expr.parameter(this, expr2);
},
eventExpression(expr2) {
return this.expr.event(this, expr2);
},
handlerExpression(expr2) {
return this.expr.handler(this, expr2);
},
encodeExpression(encode2) {
return this.expr.encode(this, encode2);
},
// parse methods
parse: parse$3,
parseOperator,
parseOperatorParameters,
parseParameters: parseParameters$1,
parseStream: parseStream$2,
parseUpdate: parseUpdate$1,
// state methods
getState: getState$1,
setState: setState$1
};
function initializeAria(view) {
const el = view.container();
if (el) {
el.setAttribute("role", "graphics-document");
el.setAttribute("aria-roleDescription", "visualization");
ariaLabel(el, view.description());
}
}
function ariaLabel(el, desc) {
if (el)
desc == null ? el.removeAttribute("aria-label") : el.setAttribute("aria-label", desc);
}
function background(view) {
view.add(null, (_24) => {
view._background = _24.bg;
view._resize = 1;
return _24.bg;
}, {
bg: view._signals.background
});
}
const Default = "default";
function cursor(view) {
const cursor2 = view._signals.cursor || (view._signals.cursor = view.add({
user: Default,
item: null
}));
view.on(view.events("view", "mousemove"), cursor2, (_24, event2) => {
const value2 = cursor2.value, user = value2 ? isString(value2) ? value2 : value2.user : Default, item = event2.item && event2.item.cursor || null;
return value2 && user === value2.user && item == value2.item ? value2 : {
user,
item
};
});
view.add(null, function(_24) {
let user = _24.cursor, item = this.value;
if (!isString(user)) {
item = user.item;
user = user.user;
}
setCursor(view, user && user !== Default ? user : item || user);
return item;
}, {
cursor: cursor2
});
}
function setCursor(view, cursor2) {
const el = view.globalCursor() ? typeof document !== "undefined" && document.body : view.container();
if (el) {
return cursor2 == null ? el.style.removeProperty("cursor") : el.style.cursor = cursor2;
}
}
function dataref(view, name) {
var data2 = view._runtime.data;
if (!has$2(data2, name)) {
error2("Unrecognized data set: " + name);
}
return data2[name];
}
function data$1(name, values2) {
return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values2));
}
function change(name, changes) {
if (!isChangeSet(changes)) {
error2("Second argument to changes must be a changeset.");
}
const dataset = dataref(this, name);
dataset.modified = true;
return this.pulse(dataset.input, changes);
}
function insert(name, _24) {
return change.call(this, name, changeset().insert(_24));
}
function remove2(name, _24) {
return change.call(this, name, changeset().remove(_24));
}
function width(view) {
var padding2 = view.padding();
return Math.max(0, view._viewWidth + padding2.left + padding2.right);
}
function height(view) {
var padding2 = view.padding();
return Math.max(0, view._viewHeight + padding2.top + padding2.bottom);
}
function offset(view) {
var padding2 = view.padding(), origin = view._origin;
return [padding2.left + origin[0], padding2.top + origin[1]];
}
function resizeRenderer(view) {
var origin = offset(view), w2 = width(view), h2 = height(view);
view._renderer.background(view.background());
view._renderer.resize(w2, h2, origin);
view._handler.origin(origin);
view._resizeListeners.forEach((handler) => {
try {
handler(w2, h2);
} catch (error3) {
view.error(error3);
}
});
}
function eventExtend(view, event2, item) {
var r2 = view._renderer, el = r2 && r2.canvas(), p2, e7, translate2;
if (el) {
translate2 = offset(view);
e7 = event2.changedTouches ? event2.changedTouches[0] : event2;
p2 = point(e7, el);
p2[0] -= translate2[0];
p2[1] -= translate2[1];
}
event2.dataflow = view;
event2.item = item;
event2.vega = extension(view, item, p2);
return event2;
}
function extension(view, item, point2) {
const itemGroup = item ? item.mark.marktype === "group" ? item : item.mark.group : null;
function group2(name) {
var g2 = itemGroup, i2;
if (name)
for (i2 = item; i2; i2 = i2.mark.group) {
if (i2.mark.name === name) {
g2 = i2;
break;
}
}
return g2 && g2.mark && g2.mark.interactive ? g2 : {};
}
function xy(item2) {
if (!item2)
return point2;
if (isString(item2))
item2 = group2(item2);
const p2 = point2.slice();
while (item2) {
p2[0] -= item2.x || 0;
p2[1] -= item2.y || 0;
item2 = item2.mark && item2.mark.group;
}
return p2;
}
return {
view: constant$6(view),
item: constant$6(item || {}),
group: group2,
xy,
x: (item2) => xy(item2)[0],
y: (item2) => xy(item2)[1]
};
}
const VIEW$1 = "view", TIMER = "timer", WINDOW = "window", NO_TRAP = {
trap: false
};
function initializeEventConfig(config2) {
const events2 = extend$2({
defaults: {}
}, config2);
const unpack = (obj, keys3) => {
keys3.forEach((k2) => {
if (isArray$2(obj[k2]))
obj[k2] = toSet(obj[k2]);
});
};
unpack(events2.defaults, ["prevent", "allow"]);
unpack(events2, ["view", "window", "selector"]);
return events2;
}
function trackEventListener(view, sources, type2, handler) {
view._eventListeners.push({
type: type2,
sources: array$5(sources),
handler
});
}
function prevent(view, type2) {
var def2 = view._eventConfig.defaults, prevent2 = def2.prevent, allow = def2.allow;
return prevent2 === false || allow === true ? false : prevent2 === true || allow === false ? true : prevent2 ? prevent2[type2] : allow ? !allow[type2] : view.preventDefault();
}
function permit(view, key2, type2) {
const rule2 = view._eventConfig && view._eventConfig[key2];
if (rule2 === false || isObject$a(rule2) && !rule2[type2]) {
view.warn(`Blocked ${key2} ${type2} event listener.`);
return false;
}
return true;
}
function events(source2, type2, filter2) {
var view = this, s2 = new EventStream(filter2), send = function(e7, item) {
view.runAsync(null, () => {
if (source2 === VIEW$1 && prevent(view, type2)) {
e7.preventDefault();
}
s2.receive(eventExtend(view, e7, item));
});
}, sources;
if (source2 === TIMER) {
if (permit(view, "timer", type2)) {
view.timer(send, type2);
}
} else if (source2 === VIEW$1) {
if (permit(view, "view", type2)) {
view.addEventListener(type2, send, NO_TRAP);
}
} else {
if (source2 === WINDOW) {
if (permit(view, "window", type2) && typeof window !== "undefined") {
sources = [window];
}
} else if (typeof document !== "undefined") {
if (permit(view, "selector", type2)) {
sources = Array.from(document.querySelectorAll(source2));
}
}
if (!sources) {
view.warn("Can not resolve event source: " + source2);
} else {
for (var i2 = 0, n2 = sources.length; i2 < n2; ++i2) {
sources[i2].addEventListener(type2, send);
}
trackEventListener(view, sources, type2, send);
}
}
return s2;
}
function itemFilter(event2) {
return event2.item;
}
function markTarget(event2) {
return event2.item.mark.source;
}
function invoke(name) {
return function(_24, event2) {
return event2.vega.view().changeset().encode(event2.item, name);
};
}
function hover(hoverSet, leaveSet) {
hoverSet = [hoverSet || "hover"];
leaveSet = [leaveSet || "update", hoverSet[0]];
this.on(this.events("view", "mouseover", itemFilter), markTarget, invoke(hoverSet));
this.on(this.events("view", "mouseout", itemFilter), markTarget, invoke(leaveSet));
return this;
}
function finalize() {
var tooltip = this._tooltip, timers = this._timers, listeners = this._eventListeners, n2, m2, e7;
n2 = timers.length;
while (--n2 >= 0) {
timers[n2].stop();
}
n2 = listeners.length;
while (--n2 >= 0) {
e7 = listeners[n2];
m2 = e7.sources.length;
while (--m2 >= 0) {
e7.sources[m2].removeEventListener(e7.type, e7.handler);
}
}
if (tooltip) {
tooltip.call(this, this._handler, null, null, null);
}
return this;
}
function element(tag, attr2, text2) {
const el = document.createElement(tag);
for (const key2 in attr2)
el.setAttribute(key2, attr2[key2]);
if (text2 != null)
el.textContent = text2;
return el;
}
const BindClass = "vega-bind", NameClass = "vega-bind-name", RadioClass = "vega-bind-radio";
function bind$5(view, el, binding) {
if (!el)
return;
const param2 = binding.param;
let bind2 = binding.state;
if (!bind2) {
bind2 = binding.state = {
elements: null,
active: false,
set: null,
update: (value2) => {
if (value2 != view.signal(param2.signal)) {
view.runAsync(null, () => {
bind2.source = true;
view.signal(param2.signal, value2);
});
}
}
};
if (param2.debounce) {
bind2.update = debounce(param2.debounce, bind2.update);
}
}
const create4 = param2.input == null && param2.element ? target : generate;
create4(bind2, el, param2, view);
if (!bind2.active) {
view.on(view._signals[param2.signal], null, () => {
bind2.source ? bind2.source = false : bind2.set(view.signal(param2.signal));
});
bind2.active = true;
}
return bind2;
}
function target(bind2, node2, param2, view) {
const type2 = param2.event || "input";
const handler = () => bind2.update(node2.value);
view.signal(param2.signal, node2.value);
node2.addEventListener(type2, handler);
trackEventListener(view, node2, type2, handler);
bind2.set = (value2) => {
node2.value = value2;
node2.dispatchEvent(event(type2));
};
}
function event(type2) {
return typeof Event !== "undefined" ? new Event(type2) : {
type: type2
};
}
function generate(bind2, el, param2, view) {
const value2 = view.signal(param2.signal);
const div2 = element("div", {
"class": BindClass
});
const wrapper = param2.input === "radio" ? div2 : div2.appendChild(element("label"));
wrapper.appendChild(element("span", {
"class": NameClass
}, param2.name || param2.signal));
el.appendChild(div2);
let input = form;
switch (param2.input) {
case "checkbox":
input = checkbox;
break;
case "select":
input = select;
break;
case "radio":
input = radio;
break;
case "range":
input = range;
break;
}
input(bind2, wrapper, param2, value2);
}
function form(bind2, el, param2, value2) {
const node2 = element("input");
for (const key2 in param2) {
if (key2 !== "signal" && key2 !== "element") {
node2.setAttribute(key2 === "input" ? "type" : key2, param2[key2]);
}
}
node2.setAttribute("name", param2.signal);
node2.value = value2;
el.appendChild(node2);
node2.addEventListener("input", () => bind2.update(node2.value));
bind2.elements = [node2];
bind2.set = (value3) => node2.value = value3;
}
function checkbox(bind2, el, param2, value2) {
const attr2 = {
type: "checkbox",
name: param2.signal
};
if (value2)
attr2.checked = true;
const node2 = element("input", attr2);
el.appendChild(node2);
node2.addEventListener("change", () => bind2.update(node2.checked));
bind2.elements = [node2];
bind2.set = (value3) => node2.checked = !!value3 || null;
}
function select(bind2, el, param2, value2) {
const node2 = element("select", {
name: param2.signal
}), labels = param2.labels || [];
param2.options.forEach((option, i2) => {
const attr2 = {
value: option
};
if (valuesEqual(option, value2))
attr2.selected = true;
node2.appendChild(element("option", attr2, (labels[i2] || option) + ""));
});
el.appendChild(node2);
node2.addEventListener("change", () => {
bind2.update(param2.options[node2.selectedIndex]);
});
bind2.elements = [node2];
bind2.set = (value3) => {
for (let i2 = 0, n2 = param2.options.length; i2 < n2; ++i2) {
if (valuesEqual(param2.options[i2], value3)) {
node2.selectedIndex = i2;
return;
}
}
};
}
function radio(bind2, el, param2, value2) {
const group2 = element("span", {
"class": RadioClass
}), labels = param2.labels || [];
el.appendChild(group2);
bind2.elements = param2.options.map((option, i2) => {
const attr2 = {
type: "radio",
name: param2.signal,
value: option
};
if (valuesEqual(option, value2))
attr2.checked = true;
const input = element("input", attr2);
input.addEventListener("change", () => bind2.update(option));
const label2 = element("label", {}, (labels[i2] || option) + "");
label2.prepend(input);
group2.appendChild(label2);
return input;
});
bind2.set = (value3) => {
const nodes = bind2.elements, n2 = nodes.length;
for (let i2 = 0; i2 < n2; ++i2) {
if (valuesEqual(nodes[i2].value, value3))
nodes[i2].checked = true;
}
};
}
function range(bind2, el, param2, value2) {
value2 = value2 !== void 0 ? value2 : (+param2.max + +param2.min) / 2;
const max2 = param2.max != null ? param2.max : Math.max(100, +value2) || 100, min2 = param2.min || Math.min(0, max2, +value2) || 0, step = param2.step || tickStep(min2, max2, 100);
const node2 = element("input", {
type: "range",
name: param2.signal,
min: min2,
max: max2,
step
});
node2.value = value2;
const span2 = element("span", {}, +value2);
el.appendChild(node2);
el.appendChild(span2);
const update2 = () => {
span2.textContent = node2.value;
bind2.update(+node2.value);
};
node2.addEventListener("input", update2);
node2.addEventListener("change", update2);
bind2.elements = [node2];
bind2.set = (value3) => {
node2.value = value3;
span2.textContent = value3;
};
}
function valuesEqual(a2, b2) {
return a2 === b2 || a2 + "" === b2 + "";
}
function initializeRenderer(view, r2, el, constructor, scaleFactor, opt) {
r2 = r2 || new constructor(view.loader());
return r2.initialize(el, width(view), height(view), offset(view), scaleFactor, opt).background(view.background());
}
function trap(view, fn8) {
return !fn8 ? null : function() {
try {
fn8.apply(this, arguments);
} catch (error3) {
view.error(error3);
}
};
}
function initializeHandler(view, prevHandler, el, constructor) {
const handler = new constructor(view.loader(), trap(view, view.tooltip())).scene(view.scenegraph().root).initialize(el, offset(view), view);
if (prevHandler) {
prevHandler.handlers().forEach((h2) => {
handler.on(h2.type, h2.handler);
});
}
return handler;
}
function initialize(el, elBind) {
const view = this, type2 = view._renderType, config2 = view._eventConfig.bind, module = renderModule(type2);
el = view._el = el ? lookup$5(view, el, true) : null;
initializeAria(view);
if (!module)
view.error("Unrecognized renderer type: " + type2);
const Handler2 = module.handler || CanvasHandler, Renderer2 = el ? module.renderer : module.headless;
view._renderer = !Renderer2 ? null : initializeRenderer(view, view._renderer, el, Renderer2);
view._handler = initializeHandler(view, view._handler, el, Handler2);
view._redraw = true;
if (el && config2 !== "none") {
elBind = elBind ? view._elBind = lookup$5(view, elBind, true) : el.appendChild(element("form", {
"class": "vega-bindings"
}));
view._bind.forEach((_24) => {
if (_24.param.element && config2 !== "container") {
_24.element = lookup$5(view, _24.param.element, !!_24.param.input);
}
});
view._bind.forEach((_24) => {
bind$5(view, _24.element || elBind, _24);
});
}
return view;
}
function lookup$5(view, el, clear2) {
if (typeof el === "string") {
if (typeof document !== "undefined") {
el = document.querySelector(el);
if (!el) {
view.error("Signal bind element not found: " + el);
return null;
}
} else {
view.error("DOM document instance not found.");
return null;
}
}
if (el && clear2) {
try {
el.textContent = "";
} catch (e7) {
el = null;
view.error(e7);
}
}
return el;
}
const number$1 = (_24) => +_24 || 0;
const paddingObject$1 = (_24) => ({
top: _24,
bottom: _24,
left: _24,
right: _24
});
function padding(_24) {
return isObject$a(_24) ? {
top: number$1(_24.top),
bottom: number$1(_24.bottom),
left: number$1(_24.left),
right: number$1(_24.right)
} : paddingObject$1(number$1(_24));
}
async function renderHeadless(view, type2, scaleFactor, opt) {
const module = renderModule(type2), ctr = module && module.headless;
if (!ctr)
error2("Unrecognized renderer type: " + type2);
await view.runAsync();
return initializeRenderer(view, null, null, ctr, scaleFactor, opt).renderAsync(view._scenegraph.root);
}
async function renderToImageURL(type2, scaleFactor) {
if (type2 !== RenderType.Canvas && type2 !== RenderType.SVG && type2 !== RenderType.PNG) {
error2("Unrecognized image type: " + type2);
}
const r2 = await renderHeadless(this, type2, scaleFactor);
return type2 === RenderType.SVG ? toBlobURL(r2.svg(), "image/svg+xml") : r2.canvas().toDataURL("image/png");
}
function toBlobURL(data2, mime) {
const blob = new Blob([data2], {
type: mime
});
return window.URL.createObjectURL(blob);
}
async function renderToCanvas(scaleFactor, opt) {
const r2 = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);
return r2.canvas();
}
async function renderToSVG(scaleFactor) {
const r2 = await renderHeadless(this, RenderType.SVG, scaleFactor);
return r2.svg();
}
function runtime(view, spec, expr2) {
return context(view, transforms, functionContext, expr2).parse(spec);
}
function scale$1(name) {
var scales2 = this._runtime.scales;
if (!has$2(scales2, name)) {
error2("Unrecognized scale or projection: " + name);
}
return scales2[name].value;
}
var Width = "width", Height = "height", Padding = "padding", Skip$1 = {
skip: true
};
function viewWidth(view, width2) {
var a2 = view.autosize(), p2 = view.padding();
return width2 - (a2 && a2.contains === Padding ? p2.left + p2.right : 0);
}
function viewHeight(view, height2) {
var a2 = view.autosize(), p2 = view.padding();
return height2 - (a2 && a2.contains === Padding ? p2.top + p2.bottom : 0);
}
function initializeResize(view) {
var s2 = view._signals, w2 = s2[Width], h2 = s2[Height], p2 = s2[Padding];
function resetSize() {
view._autosize = view._resize = 1;
}
view._resizeWidth = view.add(null, (_24) => {
view._width = _24.size;
view._viewWidth = viewWidth(view, _24.size);
resetSize();
}, {
size: w2
});
view._resizeHeight = view.add(null, (_24) => {
view._height = _24.size;
view._viewHeight = viewHeight(view, _24.size);
resetSize();
}, {
size: h2
});
const resizePadding = view.add(null, resetSize, {
pad: p2
});
view._resizeWidth.rank = w2.rank + 1;
view._resizeHeight.rank = h2.rank + 1;
resizePadding.rank = p2.rank + 1;
}
function resizeView(viewWidth2, viewHeight2, width2, height2, origin, auto2) {
this.runAfter((view) => {
let rerun2 = 0;
view._autosize = 0;
if (view.width() !== width2) {
rerun2 = 1;
view.signal(Width, width2, Skip$1);
view._resizeWidth.skip(true);
}
if (view.height() !== height2) {
rerun2 = 1;
view.signal(Height, height2, Skip$1);
view._resizeHeight.skip(true);
}
if (view._viewWidth !== viewWidth2) {
view._resize = 1;
view._viewWidth = viewWidth2;
}
if (view._viewHeight !== viewHeight2) {
view._resize = 1;
view._viewHeight = viewHeight2;
}
if (view._origin[0] !== origin[0] || view._origin[1] !== origin[1]) {
view._resize = 1;
view._origin = origin;
}
if (rerun2)
view.run("enter");
if (auto2)
view.runAfter((v2) => v2.resize());
}, false, 1);
}
function getState(options2) {
return this._runtime.getState(options2 || {
data: dataTest,
signals: signalTest,
recurse: true
});
}
function dataTest(name, data2) {
return data2.modified && isArray$2(data2.input.value) && name.indexOf("_:vega:_");
}
function signalTest(name, op) {
return !(name === "parent" || op instanceof transforms.proxy);
}
function setState(state) {
this.runAsync(null, (v2) => {
v2._trigger = false;
v2._runtime.setState(state);
}, (v2) => {
v2._trigger = true;
});
return this;
}
function timer(callback, delay) {
function tick(elapsed) {
callback({
timestamp: Date.now(),
elapsed
});
}
this._timers.push(interval(tick, delay));
}
function defaultTooltip(handler, event2, item, value2) {
const el = handler.element();
if (el)
el.setAttribute("title", formatTooltip(value2));
}
function formatTooltip(value2) {
return value2 == null ? "" : isArray$2(value2) ? formatArray(value2) : isObject$a(value2) && !isDate$1(value2) ? formatObject(value2) : value2 + "";
}
function formatObject(obj) {
return Object.keys(obj).map((key2) => {
const v2 = obj[key2];
return key2 + ": " + (isArray$2(v2) ? formatArray(v2) : formatValue$1(v2));
}).join("\n");
}
function formatArray(value2) {
return "[" + value2.map(formatValue$1).join(", ") + "]";
}
function formatValue$1(value2) {
return isArray$2(value2) ? "[…]" : isObject$a(value2) && !isDate$1(value2) ? "{…}" : value2;
}
function View$1(spec, options2) {
const view = this;
options2 = options2 || {};
Dataflow.call(view);
if (options2.loader)
view.loader(options2.loader);
if (options2.logger)
view.logger(options2.logger);
if (options2.logLevel != null)
view.logLevel(options2.logLevel);
if (options2.locale || spec.locale) {
const loc = extend$2({}, spec.locale, options2.locale);
view.locale(locale$1(loc.number, loc.time));
}
view._el = null;
view._elBind = null;
view._renderType = options2.renderer || RenderType.Canvas;
view._scenegraph = new Scenegraph();
const root2 = view._scenegraph.root;
view._renderer = null;
view._tooltip = options2.tooltip || defaultTooltip, view._redraw = true;
view._handler = new CanvasHandler().scene(root2);
view._globalCursor = false;
view._preventDefault = false;
view._timers = [];
view._eventListeners = [];
view._resizeListeners = [];
view._eventConfig = initializeEventConfig(spec.eventConfig);
view.globalCursor(view._eventConfig.globalCursor);
const ctx = runtime(view, spec, options2.expr);
view._runtime = ctx;
view._signals = ctx.signals;
view._bind = (spec.bindings || []).map((_24) => ({
state: null,
param: extend$2({}, _24)
}));
if (ctx.root)
ctx.root.set(root2);
root2.source = ctx.data.root.input;
view.pulse(ctx.data.root.input, view.changeset().insert(root2.items));
view._width = view.width();
view._height = view.height();
view._viewWidth = viewWidth(view, view._width);
view._viewHeight = viewHeight(view, view._height);
view._origin = [0, 0];
view._resize = 0;
view._autosize = 1;
initializeResize(view);
background(view);
cursor(view);
view.description(spec.description);
if (options2.hover)
view.hover();
if (options2.container)
view.initialize(options2.container, options2.bind);
}
function lookupSignal(view, name) {
return has$2(view._signals, name) ? view._signals[name] : error2("Unrecognized signal name: " + $$h(name));
}
function findOperatorHandler(op, handler) {
const h2 = (op._targets || []).filter((op2) => op2._update && op2._update.handler === handler);
return h2.length ? h2[0] : null;
}
function addOperatorListener(view, name, op, handler) {
let h2 = findOperatorHandler(op, handler);
if (!h2) {
h2 = trap(view, () => handler(name, op.value));
h2.handler = handler;
view.on(op, null, h2);
}
return view;
}
function removeOperatorListener(view, op, handler) {
const h2 = findOperatorHandler(op, handler);
if (h2)
op._targets.remove(h2);
return view;
}
inherits(View$1, Dataflow, {
// -- DATAFLOW / RENDERING ----
async evaluate(encode2, prerun, postrun) {
await Dataflow.prototype.evaluate.call(this, encode2, prerun);
if (this._redraw || this._resize) {
try {
if (this._renderer) {
if (this._resize) {
this._resize = 0;
resizeRenderer(this);
}
await this._renderer.renderAsync(this._scenegraph.root);
}
this._redraw = false;
} catch (e7) {
this.error(e7);
}
}
if (postrun)
asyncCallback(this, postrun);
return this;
},
dirty(item) {
this._redraw = true;
this._renderer && this._renderer.dirty(item);
},
// -- GET / SET ----
description(text2) {
if (arguments.length) {
const desc = text2 != null ? text2 + "" : null;
if (desc !== this._desc)
ariaLabel(this._el, this._desc = desc);
return this;
}
return this._desc;
},
container() {
return this._el;
},
scenegraph() {
return this._scenegraph;
},
origin() {
return this._origin.slice();
},
signal(name, value2, options2) {
const op = lookupSignal(this, name);
return arguments.length === 1 ? op.value : this.update(op, value2, options2);
},
width(_24) {
return arguments.length ? this.signal("width", _24) : this.signal("width");
},
height(_24) {
return arguments.length ? this.signal("height", _24) : this.signal("height");
},
padding(_24) {
return arguments.length ? this.signal("padding", padding(_24)) : padding(this.signal("padding"));
},
autosize(_24) {
return arguments.length ? this.signal("autosize", _24) : this.signal("autosize");
},
background(_24) {
return arguments.length ? this.signal("background", _24) : this.signal("background");
},
renderer(type2) {
if (!arguments.length)
return this._renderType;
if (!renderModule(type2))
error2("Unrecognized renderer type: " + type2);
if (type2 !== this._renderType) {
this._renderType = type2;
this._resetRenderer();
}
return this;
},
tooltip(handler) {
if (!arguments.length)
return this._tooltip;
if (handler !== this._tooltip) {
this._tooltip = handler;
this._resetRenderer();
}
return this;
},
loader(loader2) {
if (!arguments.length)
return this._loader;
if (loader2 !== this._loader) {
Dataflow.prototype.loader.call(this, loader2);
this._resetRenderer();
}
return this;
},
resize() {
this._autosize = 1;
return this.touch(lookupSignal(this, "autosize"));
},
_resetRenderer() {
if (this._renderer) {
this._renderer = null;
this.initialize(this._el, this._elBind);
}
},
// -- SIZING ----
_resizeView: resizeView,
// -- EVENT HANDLING ----
addEventListener(type2, handler, options2) {
let callback = handler;
if (!(options2 && options2.trap === false)) {
callback = trap(this, handler);
callback.raw = handler;
}
this._handler.on(type2, callback);
return this;
},
removeEventListener(type2, handler) {
var handlers = this._handler.handlers(type2), i2 = handlers.length, h2, t5;
while (--i2 >= 0) {
t5 = handlers[i2].type;
h2 = handlers[i2].handler;
if (type2 === t5 && (handler === h2 || handler === h2.raw)) {
this._handler.off(t5, h2);
break;
}
}
return this;
},
addResizeListener(handler) {
const l2 = this._resizeListeners;
if (l2.indexOf(handler) < 0) {
l2.push(handler);
}
return this;
},
removeResizeListener(handler) {
var l2 = this._resizeListeners, i2 = l2.indexOf(handler);
if (i2 >= 0) {
l2.splice(i2, 1);
}
return this;
},
addSignalListener(name, handler) {
return addOperatorListener(this, name, lookupSignal(this, name), handler);
},
removeSignalListener(name, handler) {
return removeOperatorListener(this, lookupSignal(this, name), handler);
},
addDataListener(name, handler) {
return addOperatorListener(this, name, dataref(this, name).values, handler);
},
removeDataListener(name, handler) {
return removeOperatorListener(this, dataref(this, name).values, handler);
},
globalCursor(_24) {
if (arguments.length) {
if (this._globalCursor !== !!_24) {
const prev2 = setCursor(this, null);
this._globalCursor = !!_24;
if (prev2)
setCursor(this, prev2);
}
return this;
} else {
return this._globalCursor;
}
},
preventDefault(_24) {
if (arguments.length) {
this._preventDefault = _24;
return this;
} else {
return this._preventDefault;
}
},
timer,
events,
finalize,
hover,
// -- DATA ----
data: data$1,
change,
insert,
remove: remove2,
// -- SCALES --
scale: scale$1,
// -- INITIALIZATION ----
initialize,
// -- HEADLESS RENDERING ----
toImageURL: renderToImageURL,
toCanvas: renderToCanvas,
toSVG: renderToSVG,
// -- SAVE / RESTORE STATE ----
getState,
setState
});
const VIEW = "view", LBRACK = "[", RBRACK = "]", LBRACE = "{", RBRACE = "}", COLON$1 = ":", COMMA$1 = ",", NAME = "@", GT$1 = ">", ILLEGAL = /[[\]{}]/, DEFAULT_MARKS = {
"*": 1,
arc: 1,
area: 1,
group: 1,
image: 1,
line: 1,
path: 1,
rect: 1,
rule: 1,
shape: 1,
symbol: 1,
text: 1,
trail: 1
};
let DEFAULT_SOURCE, MARKS;
function eventSelector(selector, source2, marks) {
DEFAULT_SOURCE = source2 || VIEW;
MARKS = marks || DEFAULT_MARKS;
return parseMerge(selector.trim()).map(parseSelector);
}
function isMarkType(type2) {
return MARKS[type2];
}
function find(s2, i2, endChar, pushChar, popChar) {
const n2 = s2.length;
let count2 = 0, c2;
for (; i2 < n2; ++i2) {
c2 = s2[i2];
if (!count2 && c2 === endChar)
return i2;
else if (popChar && popChar.indexOf(c2) >= 0)
--count2;
else if (pushChar && pushChar.indexOf(c2) >= 0)
++count2;
}
return i2;
}
function parseMerge(s2) {
const output3 = [], n2 = s2.length;
let start2 = 0, i2 = 0;
while (i2 < n2) {
i2 = find(s2, i2, COMMA$1, LBRACK + LBRACE, RBRACK + RBRACE);
output3.push(s2.substring(start2, i2).trim());
start2 = ++i2;
}
if (output3.length === 0) {
throw "Empty event selector: " + s2;
}
return output3;
}
function parseSelector(s2) {
return s2[0] === "[" ? parseBetween(s2) : parseStream$1(s2);
}
function parseBetween(s2) {
const n2 = s2.length;
let i2 = 1, b2;
i2 = find(s2, i2, RBRACK, LBRACK, RBRACK);
if (i2 === n2) {
throw "Empty between selector: " + s2;
}
b2 = parseMerge(s2.substring(1, i2));
if (b2.length !== 2) {
throw "Between selector must have two elements: " + s2;
}
s2 = s2.slice(i2 + 1).trim();
if (s2[0] !== GT$1) {
throw "Expected '>' after between selector: " + s2;
}
b2 = b2.map(parseSelector);
const stream2 = parseSelector(s2.slice(1).trim());
if (stream2.between) {
return {
between: b2,
stream: stream2
};
} else {
stream2.between = b2;
}
return stream2;
}
function parseStream$1(s2) {
const stream2 = {
source: DEFAULT_SOURCE
}, source2 = [];
let throttle2 = [0, 0], markname = 0, start2 = 0, n2 = s2.length, i2 = 0, j2, filter2;
if (s2[n2 - 1] === RBRACE) {
i2 = s2.lastIndexOf(LBRACE);
if (i2 >= 0) {
try {
throttle2 = parseThrottle(s2.substring(i2 + 1, n2 - 1));
} catch (e7) {
throw "Invalid throttle specification: " + s2;
}
s2 = s2.slice(0, i2).trim();
n2 = s2.length;
} else
throw "Unmatched right brace: " + s2;
i2 = 0;
}
if (!n2)
throw s2;
if (s2[0] === NAME)
markname = ++i2;
j2 = find(s2, i2, COLON$1);
if (j2 < n2) {
source2.push(s2.substring(start2, j2).trim());
start2 = i2 = ++j2;
}
i2 = find(s2, i2, LBRACK);
if (i2 === n2) {
source2.push(s2.substring(start2, n2).trim());
} else {
source2.push(s2.substring(start2, i2).trim());
filter2 = [];
start2 = ++i2;
if (start2 === n2)
throw "Unmatched left bracket: " + s2;
}
while (i2 < n2) {
i2 = find(s2, i2, RBRACK);
if (i2 === n2)
throw "Unmatched left bracket: " + s2;
filter2.push(s2.substring(start2, i2).trim());
if (i2 < n2 - 1 && s2[++i2] !== LBRACK)
throw "Expected left bracket: " + s2;
start2 = ++i2;
}
if (!(n2 = source2.length) || ILLEGAL.test(source2[n2 - 1])) {
throw "Invalid event selector: " + s2;
}
if (n2 > 1) {
stream2.type = source2[1];
if (markname) {
stream2.markname = source2[0].slice(1);
} else if (isMarkType(source2[0])) {
stream2.marktype = source2[0];
} else {
stream2.source = source2[0];
}
} else {
stream2.type = source2[0];
}
if (stream2.type.slice(-1) === "!") {
stream2.consume = true;
stream2.type = stream2.type.slice(0, -1);
}
if (filter2 != null)
stream2.filter = filter2;
if (throttle2[0])
stream2.throttle = throttle2[0];
if (throttle2[1])
stream2.debounce = throttle2[1];
return stream2;
}
function parseThrottle(s2) {
const a2 = s2.split(COMMA$1);
if (!s2.length || a2.length > 2)
throw s2;
return a2.map((_24) => {
const x2 = +_24;
if (x2 !== x2)
throw s2;
return x2;
});
}
function parseAutosize(spec) {
return isObject$a(spec) ? spec : {
type: spec || "pad"
};
}
const number = (_24) => +_24 || 0;
const paddingObject = (_24) => ({
top: _24,
bottom: _24,
left: _24,
right: _24
});
function parsePadding(spec) {
return !isObject$a(spec) ? paddingObject(number(spec)) : spec.signal ? spec : {
top: number(spec.top),
bottom: number(spec.bottom),
left: number(spec.left),
right: number(spec.right)
};
}
const encoder = (_24) => isObject$a(_24) && !isArray$2(_24) ? extend$2({}, _24) : {
value: _24
};
function addEncode(object2, name, value2, set2) {
if (value2 != null) {
const isEncoder = isObject$a(value2) && !isArray$2(value2) || isArray$2(value2) && value2.length && isObject$a(value2[0]);
if (isEncoder) {
object2.update[name] = value2;
} else {
object2[set2 || "enter"][name] = {
value: value2
};
}
return 1;
} else {
return 0;
}
}
function addEncoders(object2, enter, update2) {
for (const name in enter) {
addEncode(object2, name, enter[name]);
}
for (const name in update2) {
addEncode(object2, name, update2[name], "update");
}
}
function extendEncode(encode2, extra, skip) {
for (const name in extra) {
if (skip && has$2(skip, name))
continue;
encode2[name] = extend$2(encode2[name] || {}, extra[name]);
}
return encode2;
}
function has$1(key2, encode2) {
return encode2 && (encode2.enter && encode2.enter[key2] || encode2.update && encode2.update[key2]);
}
const MarkRole = "mark";
const FrameRole = "frame";
const ScopeRole = "scope";
const AxisRole = "axis";
const AxisDomainRole = "axis-domain";
const AxisGridRole = "axis-grid";
const AxisLabelRole = "axis-label";
const AxisTickRole = "axis-tick";
const AxisTitleRole = "axis-title";
const LegendRole = "legend";
const LegendBandRole = "legend-band";
const LegendEntryRole = "legend-entry";
const LegendGradientRole = "legend-gradient";
const LegendLabelRole = "legend-label";
const LegendSymbolRole = "legend-symbol";
const LegendTitleRole = "legend-title";
const TitleRole = "title";
const TitleTextRole = "title-text";
const TitleSubtitleRole = "title-subtitle";
function applyDefaults(encode2, type2, role, style2, config2) {
const defaults2 = {}, enter = {};
let update2, key2, skip, props;
key2 = "lineBreak";
if (type2 === "text" && config2[key2] != null && !has$1(key2, encode2)) {
applyDefault(defaults2, key2, config2[key2]);
}
if (role == "legend" || String(role).startsWith("axis")) {
role = null;
}
props = role === FrameRole ? config2.group : role === MarkRole ? extend$2({}, config2.mark, config2[type2]) : null;
for (key2 in props) {
skip = has$1(key2, encode2) || (key2 === "fill" || key2 === "stroke") && (has$1("fill", encode2) || has$1("stroke", encode2));
if (!skip)
applyDefault(defaults2, key2, props[key2]);
}
array$5(style2).forEach((name) => {
const props2 = config2.style && config2.style[name];
for (const key3 in props2) {
if (!has$1(key3, encode2)) {
applyDefault(defaults2, key3, props2[key3]);
}
}
});
encode2 = extend$2({}, encode2);
for (key2 in defaults2) {
props = defaults2[key2];
if (props.signal) {
(update2 = update2 || {})[key2] = props;
} else {
enter[key2] = props;
}
}
encode2.enter = extend$2(enter, encode2.enter);
if (update2)
encode2.update = extend$2(update2, encode2.update);
return encode2;
}
function applyDefault(defaults2, key2, value2) {
defaults2[key2] = value2 && value2.signal ? {
signal: value2.signal
} : {
value: value2
};
}
const scaleRef = (scale2) => isString(scale2) ? $$h(scale2) : scale2.signal ? `(${scale2.signal})` : field(scale2);
function entry$1(enc) {
if (enc.gradient != null) {
return gradient(enc);
}
let value2 = enc.signal ? `(${enc.signal})` : enc.color ? color$3(enc.color) : enc.field != null ? field(enc.field) : enc.value !== void 0 ? $$h(enc.value) : void 0;
if (enc.scale != null) {
value2 = scale(enc, value2);
}
if (value2 === void 0) {
value2 = null;
}
if (enc.exponent != null) {
value2 = `pow(${value2},${property(enc.exponent)})`;
}
if (enc.mult != null) {
value2 += `*${property(enc.mult)}`;
}
if (enc.offset != null) {
value2 += `+${property(enc.offset)}`;
}
if (enc.round) {
value2 = `round(${value2})`;
}
return value2;
}
const _color = (type2, x2, y2, z2) => `(${type2}(${[x2, y2, z2].map(entry$1).join(",")})+'')`;
function color$3(enc) {
return enc.c ? _color("hcl", enc.h, enc.c, enc.l) : enc.h || enc.s ? _color("hsl", enc.h, enc.s, enc.l) : enc.l || enc.a ? _color("lab", enc.l, enc.a, enc.b) : enc.r || enc.g || enc.b ? _color("rgb", enc.r, enc.g, enc.b) : null;
}
function gradient(enc) {
const args = [enc.start, enc.stop, enc.count].map((_24) => _24 == null ? null : $$h(_24));
while (args.length && peek$1(args) == null)
args.pop();
args.unshift(scaleRef(enc.gradient));
return `gradient(${args.join(",")})`;
}
function property(property2) {
return isObject$a(property2) ? "(" + entry$1(property2) + ")" : property2;
}
function field(ref2) {
return resolveField(isObject$a(ref2) ? ref2 : {
datum: ref2
});
}
function resolveField(ref2) {
let object2, level, field2;
if (ref2.signal) {
object2 = "datum";
field2 = ref2.signal;
} else if (ref2.group || ref2.parent) {
level = Math.max(1, ref2.level || 1);
object2 = "item";
while (level-- > 0) {
object2 += ".mark.group";
}
if (ref2.parent) {
field2 = ref2.parent;
object2 += ".datum";
} else {
field2 = ref2.group;
}
} else if (ref2.datum) {
object2 = "datum";
field2 = ref2.datum;
} else {
error2("Invalid field reference: " + $$h(ref2));
}
if (!ref2.signal) {
field2 = isString(field2) ? splitAccessPath(field2).map($$h).join("][") : resolveField(field2);
}
return object2 + "[" + field2 + "]";
}
function scale(enc, value2) {
const scale2 = scaleRef(enc.scale);
if (enc.range != null) {
value2 = `lerp(_range(${scale2}), ${+enc.range})`;
} else {
if (value2 !== void 0)
value2 = `_scale(${scale2}, ${value2})`;
if (enc.band) {
value2 = (value2 ? value2 + "+" : "") + `_bandwidth(${scale2})` + (+enc.band === 1 ? "" : "*" + property(enc.band));
if (enc.extra) {
value2 = `(datum.extra ? _scale(${scale2}, datum.extra.value) : ${value2})`;
}
}
if (value2 == null)
value2 = "0";
}
return value2;
}
function rule(enc) {
let code = "";
enc.forEach((rule2) => {
const value2 = entry$1(rule2);
code += rule2.test ? `(${rule2.test})?${value2}:` : value2;
});
if (peek$1(code) === ":") {
code += "null";
}
return code;
}
function parseEncode(encode2, type2, role, style2, scope, params2) {
const enc = {};
params2 = params2 || {};
params2.encoders = {
$encode: enc
};
encode2 = applyDefaults(encode2, type2, role, style2, scope.config);
for (const key2 in encode2) {
enc[key2] = parseBlock(encode2[key2], type2, params2, scope);
}
return params2;
}
function parseBlock(block, marktype, params2, scope) {
const channels = {}, fields = {};
for (const name in block) {
if (block[name] != null) {
channels[name] = parse$1(expr(block[name]), scope, params2, fields);
}
}
return {
$expr: {
marktype,
channels
},
$fields: Object.keys(fields),
$output: Object.keys(block)
};
}
function expr(enc) {
return isArray$2(enc) ? rule(enc) : entry$1(enc);
}
function parse$1(code, scope, params2, fields) {
const expr2 = parser(code, scope);
expr2.$fields.forEach((name) => fields[name] = 1);
extend$2(params2, expr2.$params);
return expr2.$expr;
}
const OUTER = "outer", OUTER_INVALID = ["value", "update", "init", "react", "bind"];
function outerError(prefix2, name) {
error2(prefix2 + ' for "outer" push: ' + $$h(name));
}
function parseSignal(signal, scope) {
const name = signal.name;
if (signal.push === OUTER) {
if (!scope.signals[name])
outerError("No prior signal definition", name);
OUTER_INVALID.forEach((prop) => {
if (signal[prop] !== void 0)
outerError("Invalid property ", prop);
});
} else {
const op = scope.addSignal(name, signal.value);
if (signal.react === false)
op.react = false;
if (signal.bind)
scope.addBinding(name, signal.bind);
}
}
function Entry(type2, value2, params2, parent) {
this.id = -1;
this.type = type2;
this.value = value2;
this.params = params2;
if (parent)
this.parent = parent;
}
function entry(type2, value2, params2, parent) {
return new Entry(type2, value2, params2, parent);
}
function operator(value2, params2) {
return entry("operator", value2, params2);
}
function ref(op) {
const ref2 = {
$ref: op.id
};
if (op.id < 0)
(op.refs = op.refs || []).push(ref2);
return ref2;
}
function fieldRef$1(field2, name) {
return name ? {
$field: field2,
$name: name
} : {
$field: field2
};
}
const keyFieldRef = fieldRef$1("key");
function compareRef(fields, orders) {
return {
$compare: fields,
$order: orders
};
}
function keyRef(fields, flat) {
const ref2 = {
$key: fields
};
if (flat)
ref2.$flat = true;
return ref2;
}
const Ascending = "ascending";
const Descending = "descending";
function sortKey(sort2) {
return !isObject$a(sort2) ? "" : (sort2.order === Descending ? "-" : "+") + aggrField(sort2.op, sort2.field);
}
function aggrField(op, field2) {
return (op && op.signal ? "$" + op.signal : op || "") + (op && field2 ? "_" : "") + (field2 && field2.signal ? "$" + field2.signal : field2 || "");
}
const Scope$1 = "scope";
const View = "view";
function isSignal(_24) {
return _24 && _24.signal;
}
function isExpr$1(_24) {
return _24 && _24.expr;
}
function hasSignal(_24) {
if (isSignal(_24))
return true;
if (isObject$a(_24))
for (const key2 in _24) {
if (hasSignal(_24[key2]))
return true;
}
return false;
}
function value$1(specValue, defaultValue2) {
return specValue != null ? specValue : defaultValue2;
}
function deref(v2) {
return v2 && v2.signal || v2;
}
const Timer = "timer";
function parseStream(stream2, scope) {
const method = stream2.merge ? mergeStream : stream2.stream ? nestedStream : stream2.type ? eventStream : error2("Invalid stream specification: " + $$h(stream2));
return method(stream2, scope);
}
function eventSource(source2) {
return source2 === Scope$1 ? View : source2 || View;
}
function mergeStream(stream2, scope) {
const list = stream2.merge.map((s2) => parseStream(s2, scope)), entry2 = streamParameters({
merge: list
}, stream2, scope);
return scope.addStream(entry2).id;
}
function nestedStream(stream2, scope) {
const id = parseStream(stream2.stream, scope), entry2 = streamParameters({
stream: id
}, stream2, scope);
return scope.addStream(entry2).id;
}
function eventStream(stream2, scope) {
let id;
if (stream2.type === Timer) {
id = scope.event(Timer, stream2.throttle);
stream2 = {
between: stream2.between,
filter: stream2.filter
};
} else {
id = scope.event(eventSource(stream2.source), stream2.type);
}
const entry2 = streamParameters({
stream: id
}, stream2, scope);
return Object.keys(entry2).length === 1 ? id : scope.addStream(entry2).id;
}
function streamParameters(entry2, stream2, scope) {
let param2 = stream2.between;
if (param2) {
if (param2.length !== 2) {
error2('Stream "between" parameter must have 2 entries: ' + $$h(stream2));
}
entry2.between = [parseStream(param2[0], scope), parseStream(param2[1], scope)];
}
param2 = stream2.filter ? [].concat(stream2.filter) : [];
if (stream2.marktype || stream2.markname || stream2.markrole) {
param2.push(filterMark(stream2.marktype, stream2.markname, stream2.markrole));
}
if (stream2.source === Scope$1) {
param2.push("inScope(event.item)");
}
if (param2.length) {
entry2.filter = parser("(" + param2.join(")&&(") + ")", scope).$expr;
}
if ((param2 = stream2.throttle) != null) {
entry2.throttle = +param2;
}
if ((param2 = stream2.debounce) != null) {
entry2.debounce = +param2;
}
if (stream2.consume) {
entry2.consume = true;
}
return entry2;
}
function filterMark(type2, name, role) {
const item = "event.item";
return item + (type2 && type2 !== "*" ? "&&" + item + ".mark.marktype==='" + type2 + "'" : "") + (role ? "&&" + item + ".mark.role==='" + role + "'" : "") + (name ? "&&" + item + ".mark.name==='" + name + "'" : "");
}
const OP_VALUE_EXPR = {
code: "_.$value",
ast: {
type: "Identifier",
value: "value"
}
};
function parseUpdate(spec, scope, target2) {
const encode2 = spec.encode, entry2 = {
target: target2
};
let events2 = spec.events, update2 = spec.update, sources = [];
if (!events2) {
error2("Signal update missing events specification.");
}
if (isString(events2)) {
events2 = eventSelector(events2, scope.isSubscope() ? Scope$1 : View);
}
events2 = array$5(events2).filter((s2) => s2.signal || s2.scale ? (sources.push(s2), 0) : 1);
if (sources.length > 1) {
sources = [mergeSources(sources)];
}
if (events2.length) {
sources.push(events2.length > 1 ? {
merge: events2
} : events2[0]);
}
if (encode2 != null) {
if (update2)
error2("Signal encode and update are mutually exclusive.");
update2 = "encode(item()," + $$h(encode2) + ")";
}
entry2.update = isString(update2) ? parser(update2, scope) : update2.expr != null ? parser(update2.expr, scope) : update2.value != null ? update2.value : update2.signal != null ? {
$expr: OP_VALUE_EXPR,
$params: {
$value: scope.signalRef(update2.signal)
}
} : error2("Invalid signal update specification.");
if (spec.force) {
entry2.options = {
force: true
};
}
sources.forEach((source2) => scope.addUpdate(extend$2(streamSource(source2, scope), entry2)));
}
function streamSource(stream2, scope) {
return {
source: stream2.signal ? scope.signalRef(stream2.signal) : stream2.scale ? scope.scaleRef(stream2.scale) : parseStream(stream2, scope)
};
}
function mergeSources(sources) {
return {
signal: "[" + sources.map((s2) => s2.scale ? 'scale("' + s2.scale + '")' : s2.signal) + "]"
};
}
function parseSignalUpdates(signal, scope) {
const op = scope.getSignal(signal.name);
let expr2 = signal.update;
if (signal.init) {
if (expr2) {
error2("Signals can not include both init and update expressions.");
} else {
expr2 = signal.init;
op.initonly = true;
}
}
if (expr2) {
expr2 = parser(expr2, scope);
op.update = expr2.$expr;
op.params = expr2.$params;
}
if (signal.on) {
signal.on.forEach((_24) => parseUpdate(_24, scope, op.id));
}
}
const transform$2 = (name) => (params2, value2, parent) => entry(name, value2, params2 || void 0, parent);
const Aggregate = transform$2("aggregate");
const AxisTicks = transform$2("axisticks");
const Bound = transform$2("bound");
const Collect = transform$2("collect");
const Compare = transform$2("compare");
const DataJoin = transform$2("datajoin");
const Encode = transform$2("encode");
const Expression = transform$2("expression");
const Facet = transform$2("facet");
const Field = transform$2("field");
const Key = transform$2("key");
const LegendEntries = transform$2("legendentries");
const Load = transform$2("load");
const Mark = transform$2("mark");
const MultiExtent = transform$2("multiextent");
const MultiValues = transform$2("multivalues");
const Overlap = transform$2("overlap");
const Params = transform$2("params");
const PreFacet = transform$2("prefacet");
const Projection = transform$2("projection");
const Proxy$1 = transform$2("proxy");
const Relay = transform$2("relay");
const Render = transform$2("render");
const Scale$1 = transform$2("scale");
const Sieve = transform$2("sieve");
const SortItems = transform$2("sortitems");
const ViewLayout = transform$2("viewlayout");
const Values = transform$2("values");
let FIELD_REF_ID = 0;
const MULTIDOMAIN_SORT_OPS = {
min: "min",
max: "max",
count: "sum"
};
function initScale(spec, scope) {
const type2 = spec.type || "linear";
if (!isValidScaleType(type2)) {
error2("Unrecognized scale type: " + $$h(type2));
}
scope.addScale(spec.name, {
type: type2,
domain: void 0
});
}
function parseScale(spec, scope) {
const params2 = scope.getScale(spec.name).params;
let key2;
params2.domain = parseScaleDomain(spec.domain, spec, scope);
if (spec.range != null) {
params2.range = parseScaleRange(spec, scope, params2);
}
if (spec.interpolate != null) {
parseScaleInterpolate(spec.interpolate, params2);
}
if (spec.nice != null) {
params2.nice = parseScaleNice(spec.nice);
}
if (spec.bins != null) {
params2.bins = parseScaleBins(spec.bins, scope);
}
for (key2 in spec) {
if (has$2(params2, key2) || key2 === "name")
continue;
params2[key2] = parseLiteral(spec[key2], scope);
}
}
function parseLiteral(v2, scope) {
return !isObject$a(v2) ? v2 : v2.signal ? scope.signalRef(v2.signal) : error2("Unsupported object: " + $$h(v2));
}
function parseArray(v2, scope) {
return v2.signal ? scope.signalRef(v2.signal) : v2.map((v3) => parseLiteral(v3, scope));
}
function dataLookupError(name) {
error2("Can not find data set: " + $$h(name));
}
function parseScaleDomain(domain2, spec, scope) {
if (!domain2) {
if (spec.domainMin != null || spec.domainMax != null) {
error2("No scale domain defined for domainMin/domainMax to override.");
}
return;
}
return domain2.signal ? scope.signalRef(domain2.signal) : (isArray$2(domain2) ? explicitDomain : domain2.fields ? multipleDomain : singularDomain)(domain2, spec, scope);
}
function explicitDomain(domain2, spec, scope) {
return domain2.map((v2) => parseLiteral(v2, scope));
}
function singularDomain(domain2, spec, scope) {
const data2 = scope.getData(domain2.data);
if (!data2)
dataLookupError(domain2.data);
return isDiscrete(spec.type) ? data2.valuesRef(scope, domain2.field, parseSort(domain2.sort, false)) : isQuantile(spec.type) ? data2.domainRef(scope, domain2.field) : data2.extentRef(scope, domain2.field);
}
function multipleDomain(domain2, spec, scope) {
const data2 = domain2.data, fields = domain2.fields.reduce((dom, d2) => {
d2 = isString(d2) ? {
data: data2,
field: d2
} : isArray$2(d2) || d2.signal ? fieldRef(d2, scope) : d2;
dom.push(d2);
return dom;
}, []);
return (isDiscrete(spec.type) ? ordinalMultipleDomain : isQuantile(spec.type) ? quantileMultipleDomain : numericMultipleDomain)(domain2, scope, fields);
}
function fieldRef(data2, scope) {
const name = "_:vega:_" + FIELD_REF_ID++, coll = Collect({});
if (isArray$2(data2)) {
coll.value = {
$ingest: data2
};
} else if (data2.signal) {
const code = "setdata(" + $$h(name) + "," + data2.signal + ")";
coll.params.input = scope.signalRef(code);
}
scope.addDataPipeline(name, [coll, Sieve({})]);
return {
data: name,
field: "data"
};
}
function ordinalMultipleDomain(domain2, scope, fields) {
const sort2 = parseSort(domain2.sort, true);
let a2, v2;
const counts = fields.map((f2) => {
const data2 = scope.getData(f2.data);
if (!data2)
dataLookupError(f2.data);
return data2.countsRef(scope, f2.field, sort2);
});
const p2 = {
groupby: keyFieldRef,
pulse: counts
};
if (sort2) {
a2 = sort2.op || "count";
v2 = sort2.field ? aggrField(a2, sort2.field) : "count";
p2.ops = [MULTIDOMAIN_SORT_OPS[a2]];
p2.fields = [scope.fieldRef(v2)];
p2.as = [v2];
}
a2 = scope.add(Aggregate(p2));
const c2 = scope.add(Collect({
pulse: ref(a2)
}));
v2 = scope.add(Values({
field: keyFieldRef,
sort: scope.sortRef(sort2),
pulse: ref(c2)
}));
return ref(v2);
}
function parseSort(sort2, multidomain) {
if (sort2) {
if (!sort2.field && !sort2.op) {
if (isObject$a(sort2))
sort2.field = "key";
else
sort2 = {
field: "key"
};
} else if (!sort2.field && sort2.op !== "count") {
error2("No field provided for sort aggregate op: " + sort2.op);
} else if (multidomain && sort2.field) {
if (sort2.op && !MULTIDOMAIN_SORT_OPS[sort2.op]) {
error2("Multiple domain scales can not be sorted using " + sort2.op);
}
}
}
return sort2;
}
function quantileMultipleDomain(domain2, scope, fields) {
const values2 = fields.map((f2) => {
const data2 = scope.getData(f2.data);
if (!data2)
dataLookupError(f2.data);
return data2.domainRef(scope, f2.field);
});
return ref(scope.add(MultiValues({
values: values2
})));
}
function numericMultipleDomain(domain2, scope, fields) {
const extents = fields.map((f2) => {
const data2 = scope.getData(f2.data);
if (!data2)
dataLookupError(f2.data);
return data2.extentRef(scope, f2.field);
});
return ref(scope.add(MultiExtent({
extents
})));
}
function parseScaleBins(v2, scope) {
return v2.signal || isArray$2(v2) ? parseArray(v2, scope) : scope.objectProperty(v2);
}
function parseScaleNice(nice2) {
return isObject$a(nice2) ? {
interval: parseLiteral(nice2.interval),
step: parseLiteral(nice2.step)
} : parseLiteral(nice2);
}
function parseScaleInterpolate(interpolate2, params2) {
params2.interpolate = parseLiteral(interpolate2.type || interpolate2);
if (interpolate2.gamma != null) {
params2.interpolateGamma = parseLiteral(interpolate2.gamma);
}
}
function parseScaleRange(spec, scope, params2) {
const config2 = scope.config.range;
let range2 = spec.range;
if (range2.signal) {
return scope.signalRef(range2.signal);
} else if (isString(range2)) {
if (config2 && has$2(config2, range2)) {
spec = extend$2({}, spec, {
range: config2[range2]
});
return parseScaleRange(spec, scope, params2);
} else if (range2 === "width") {
range2 = [0, {
signal: "width"
}];
} else if (range2 === "height") {
range2 = isDiscrete(spec.type) ? [0, {
signal: "height"
}] : [{
signal: "height"
}, 0];
} else {
error2("Unrecognized scale range value: " + $$h(range2));
}
} else if (range2.scheme) {
params2.scheme = isArray$2(range2.scheme) ? parseArray(range2.scheme, scope) : parseLiteral(range2.scheme, scope);
if (range2.extent)
params2.schemeExtent = parseArray(range2.extent, scope);
if (range2.count)
params2.schemeCount = parseLiteral(range2.count, scope);
return;
} else if (range2.step) {
params2.rangeStep = parseLiteral(range2.step, scope);
return;
} else if (isDiscrete(spec.type) && !isArray$2(range2)) {
return parseScaleDomain(range2, spec, scope);
} else if (!isArray$2(range2)) {
error2("Unsupported range type: " + $$h(range2));
}
return range2.map((v2) => (isArray$2(v2) ? parseArray : parseLiteral)(v2, scope));
}
function parseProjection(proj, scope) {
const config2 = scope.config.projection || {}, params2 = {};
for (const name in proj) {
if (name === "name")
continue;
params2[name] = parseParameter$1(proj[name], name, scope);
}
for (const name in config2) {
if (params2[name] == null) {
params2[name] = parseParameter$1(config2[name], name, scope);
}
}
scope.addProjection(proj.name, params2);
}
function parseParameter$1(_24, name, scope) {
return isArray$2(_24) ? _24.map((_25) => parseParameter$1(_25, name, scope)) : !isObject$a(_24) ? _24 : _24.signal ? scope.signalRef(_24.signal) : name === "fit" ? _24 : error2("Unsupported parameter object: " + $$h(_24));
}
const Top = "top";
const Left = "left";
const Right = "right";
const Bottom = "bottom";
const Center = "center";
const Vertical = "vertical";
const Start = "start";
const Middle = "middle";
const End = "end";
const Index = "index";
const Label = "label";
const Offset = "offset";
const Perc = "perc";
const Perc2 = "perc2";
const Value = "value";
const GuideLabelStyle = "guide-label";
const GuideTitleStyle = "guide-title";
const GroupTitleStyle = "group-title";
const GroupSubtitleStyle = "group-subtitle";
const Symbols = "symbol";
const Gradient = "gradient";
const Discrete = "discrete";
const Size = "size";
const Shape = "shape";
const Fill = "fill";
const Stroke = "stroke";
const StrokeWidth = "strokeWidth";
const StrokeDash = "strokeDash";
const Opacity = "opacity";
const LegendScales = [Size, Shape, Fill, Stroke, StrokeWidth, StrokeDash, Opacity];
const Skip = {
name: 1,
style: 1,
interactive: 1
};
const zero = {
value: 0
};
const one = {
value: 1
};
const GroupMark = "group";
const RectMark = "rect";
const RuleMark = "rule";
const SymbolMark = "symbol";
const TextMark = "text";
function guideGroup(mark) {
mark.type = GroupMark;
mark.interactive = mark.interactive || false;
return mark;
}
function lookup$4(spec, config2) {
const _24 = (name, dflt2) => value$1(spec[name], value$1(config2[name], dflt2));
_24.isVertical = (s2) => Vertical === value$1(spec.direction, config2.direction || (s2 ? config2.symbolDirection : config2.gradientDirection));
_24.gradientLength = () => value$1(spec.gradientLength, config2.gradientLength || config2.gradientWidth);
_24.gradientThickness = () => value$1(spec.gradientThickness, config2.gradientThickness || config2.gradientHeight);
_24.entryColumns = () => value$1(spec.columns, value$1(config2.columns, +_24.isVertical(true)));
return _24;
}
function getEncoding(name, encode2) {
const v2 = encode2 && (encode2.update && encode2.update[name] || encode2.enter && encode2.enter[name]);
return v2 && v2.signal ? v2 : v2 ? v2.value : null;
}
function getStyle(name, scope, style2) {
const s2 = scope.config.style[style2];
return s2 && s2[name];
}
function anchorExpr(s2, e7, m2) {
return `item.anchor === '${Start}' ? ${s2} : item.anchor === '${End}' ? ${e7} : ${m2}`;
}
const alignExpr$1 = anchorExpr($$h(Left), $$h(Right), $$h(Center));
function tickBand(_24) {
const v2 = _24("tickBand");
let offset2 = _24("tickOffset"), band2, extra;
if (!v2) {
band2 = _24("bandPosition");
extra = _24("tickExtra");
} else if (v2.signal) {
band2 = {
signal: `(${v2.signal}) === 'extent' ? 1 : 0.5`
};
extra = {
signal: `(${v2.signal}) === 'extent'`
};
if (!isObject$a(offset2)) {
offset2 = {
signal: `(${v2.signal}) === 'extent' ? 0 : ${offset2}`
};
}
} else if (v2 === "extent") {
band2 = 1;
extra = true;
offset2 = 0;
} else {
band2 = 0.5;
extra = false;
}
return {
extra,
band: band2,
offset: offset2
};
}
function extendOffset(value2, offset2) {
return !offset2 ? value2 : !value2 ? offset2 : !isObject$a(value2) ? {
value: value2,
offset: offset2
} : Object.assign({}, value2, {
offset: extendOffset(value2.offset, offset2)
});
}
function guideMark(mark, extras) {
if (extras) {
mark.name = extras.name;
mark.style = extras.style || mark.style;
mark.interactive = !!extras.interactive;
mark.encode = extendEncode(mark.encode, extras, Skip);
} else {
mark.interactive = false;
}
return mark;
}
function legendGradient(spec, scale2, config2, userEncode) {
const _24 = lookup$4(spec, config2), vertical = _24.isVertical(), thickness = _24.gradientThickness(), length2 = _24.gradientLength();
let enter, start2, stop2, width2, height2;
if (vertical) {
start2 = [0, 1];
stop2 = [0, 0];
width2 = thickness;
height2 = length2;
} else {
start2 = [0, 0];
stop2 = [1, 0];
width2 = length2;
height2 = thickness;
}
const encode2 = {
enter: enter = {
opacity: zero,
x: zero,
y: zero,
width: encoder(width2),
height: encoder(height2)
},
update: extend$2({}, enter, {
opacity: one,
fill: {
gradient: scale2,
start: start2,
stop: stop2
}
}),
exit: {
opacity: zero
}
};
addEncoders(encode2, {
stroke: _24("gradientStrokeColor"),
strokeWidth: _24("gradientStrokeWidth")
}, {
// update
opacity: _24("gradientOpacity")
});
return guideMark({
type: RectMark,
role: LegendGradientRole,
encode: encode2
}, userEncode);
}
function legendGradientDiscrete(spec, scale2, config2, userEncode, dataRef) {
const _24 = lookup$4(spec, config2), vertical = _24.isVertical(), thickness = _24.gradientThickness(), length2 = _24.gradientLength();
let u2, v2, uu2, vv, adjust = "";
vertical ? (u2 = "y", uu2 = "y2", v2 = "x", vv = "width", adjust = "1-") : (u2 = "x", uu2 = "x2", v2 = "y", vv = "height");
const enter = {
opacity: zero,
fill: {
scale: scale2,
field: Value
}
};
enter[u2] = {
signal: adjust + "datum." + Perc,
mult: length2
};
enter[v2] = zero;
enter[uu2] = {
signal: adjust + "datum." + Perc2,
mult: length2
};
enter[vv] = encoder(thickness);
const encode2 = {
enter,
update: extend$2({}, enter, {
opacity: one
}),
exit: {
opacity: zero
}
};
addEncoders(encode2, {
stroke: _24("gradientStrokeColor"),
strokeWidth: _24("gradientStrokeWidth")
}, {
// update
opacity: _24("gradientOpacity")
});
return guideMark({
type: RectMark,
role: LegendBandRole,
key: Value,
from: dataRef,
encode: encode2
}, userEncode);
}
const alignExpr = `datum.${Perc}<=0?"${Left}":datum.${Perc}>=1?"${Right}":"${Center}"`, baselineExpr = `datum.${Perc}<=0?"${Bottom}":datum.${Perc}>=1?"${Top}":"${Middle}"`;
function legendGradientLabels(spec, config2, userEncode, dataRef) {
const _24 = lookup$4(spec, config2), vertical = _24.isVertical(), thickness = encoder(_24.gradientThickness()), length2 = _24.gradientLength();
let overlap = _24("labelOverlap"), enter, update2, u2, v2, adjust = "";
const encode2 = {
enter: enter = {
opacity: zero
},
update: update2 = {
opacity: one,
text: {
field: Label
}
},
exit: {
opacity: zero
}
};
addEncoders(encode2, {
fill: _24("labelColor"),
fillOpacity: _24("labelOpacity"),
font: _24("labelFont"),
fontSize: _24("labelFontSize"),
fontStyle: _24("labelFontStyle"),
fontWeight: _24("labelFontWeight"),
limit: value$1(spec.labelLimit, config2.gradientLabelLimit)
});
if (vertical) {
enter.align = {
value: "left"
};
enter.baseline = update2.baseline = {
signal: baselineExpr
};
u2 = "y";
v2 = "x";
adjust = "1-";
} else {
enter.align = update2.align = {
signal: alignExpr
};
enter.baseline = {
value: "top"
};
u2 = "x";
v2 = "y";
}
enter[u2] = update2[u2] = {
signal: adjust + "datum." + Perc,
mult: length2
};
enter[v2] = update2[v2] = thickness;
thickness.offset = value$1(spec.labelOffset, config2.gradientLabelOffset) || 0;
overlap = overlap ? {
separation: _24("labelSeparation"),
method: overlap,
order: "datum." + Index
} : void 0;
return guideMark({
type: TextMark,
role: LegendLabelRole,
style: GuideLabelStyle,
key: Value,
from: dataRef,
encode: encode2,
overlap
}, userEncode);
}
function legendSymbolGroups(spec, config2, userEncode, dataRef, columns) {
const _24 = lookup$4(spec, config2), entries = userEncode.entries, interactive2 = !!(entries && entries.interactive), name = entries ? entries.name : void 0, height2 = _24("clipHeight"), symbolOffset = _24("symbolOffset"), valueRef = {
data: "value"
}, xSignal = `(${columns}) ? datum.${Offset} : datum.${Size}`, yEncode = height2 ? encoder(height2) : {
field: Size
}, index2 = `datum.${Index}`, ncols = `max(1, ${columns})`;
let encode2, enter, update2, nrows, sort2;
yEncode.mult = 0.5;
encode2 = {
enter: enter = {
opacity: zero,
x: {
signal: xSignal,
mult: 0.5,
offset: symbolOffset
},
y: yEncode
},
update: update2 = {
opacity: one,
x: enter.x,
y: enter.y
},
exit: {
opacity: zero
}
};
let baseFill = null, baseStroke = null;
if (!spec.fill) {
baseFill = config2.symbolBaseFillColor;
baseStroke = config2.symbolBaseStrokeColor;
}
addEncoders(encode2, {
fill: _24("symbolFillColor", baseFill),
shape: _24("symbolType"),
size: _24("symbolSize"),
stroke: _24("symbolStrokeColor", baseStroke),
strokeDash: _24("symbolDash"),
strokeDashOffset: _24("symbolDashOffset"),
strokeWidth: _24("symbolStrokeWidth")
}, {
// update
opacity: _24("symbolOpacity")
});
LegendScales.forEach((scale2) => {
if (spec[scale2]) {
update2[scale2] = enter[scale2] = {
scale: spec[scale2],
field: Value
};
}
});
const symbols2 = guideMark({
type: SymbolMark,
role: LegendSymbolRole,
key: Value,
from: valueRef,
clip: height2 ? true : void 0,
encode: encode2
}, userEncode.symbols);
const labelOffset = encoder(symbolOffset);
labelOffset.offset = _24("labelOffset");
encode2 = {
enter: enter = {
opacity: zero,
x: {
signal: xSignal,
offset: labelOffset
},
y: yEncode
},
update: update2 = {
opacity: one,
text: {
field: Label
},
x: enter.x,
y: enter.y
},
exit: {
opacity: zero
}
};
addEncoders(encode2, {
align: _24("labelAlign"),
baseline: _24("labelBaseline"),
fill: _24("labelColor"),
fillOpacity: _24("labelOpacity"),
font: _24("labelFont"),
fontSize: _24("labelFontSize"),
fontStyle: _24("labelFontStyle"),
fontWeight: _24("labelFontWeight"),
limit: _24("labelLimit")
});
const labels = guideMark({
type: TextMark,
role: LegendLabelRole,
style: GuideLabelStyle,
key: Value,
from: valueRef,
encode: encode2
}, userEncode.labels);
encode2 = {
enter: {
noBound: {
value: !height2
},
// ignore width/height in bounds calc
width: zero,
height: height2 ? encoder(height2) : zero,
opacity: zero
},
exit: {
opacity: zero
},
update: update2 = {
opacity: one,
row: {
signal: null
},
column: {
signal: null
}
}
};
if (_24.isVertical(true)) {
nrows = `ceil(item.mark.items.length / ${ncols})`;
update2.row.signal = `${index2}%${nrows}`;
update2.column.signal = `floor(${index2} / ${nrows})`;
sort2 = {
field: ["row", index2]
};
} else {
update2.row.signal = `floor(${index2} / ${ncols})`;
update2.column.signal = `${index2} % ${ncols}`;
sort2 = {
field: index2
};
}
update2.column.signal = `(${columns})?${update2.column.signal}:${index2}`;
dataRef = {
facet: {
data: dataRef,
name: "value",
groupby: Index
}
};
return guideGroup({
role: ScopeRole,
from: dataRef,
encode: extendEncode(encode2, entries, Skip),
marks: [symbols2, labels],
name,
interactive: interactive2,
sort: sort2
});
}
function legendSymbolLayout(spec, config2) {
const _24 = lookup$4(spec, config2);
return {
align: _24("gridAlign"),
columns: _24.entryColumns(),
center: {
row: true,
column: false
},
padding: {
row: _24("rowPadding"),
column: _24("columnPadding")
}
};
}
const isL = 'item.orient === "left"', isR = 'item.orient === "right"', isLR = `(${isL} || ${isR})`, isVG = `datum.vgrad && ${isLR}`, baseline = anchorExpr('"top"', '"bottom"', '"middle"'), alignFlip = anchorExpr('"right"', '"left"', '"center"'), exprAlign = `datum.vgrad && ${isR} ? (${alignFlip}) : (${isLR} && !(datum.vgrad && ${isL})) ? "left" : ${alignExpr$1}`, exprAnchor = `item._anchor || (${isLR} ? "middle" : "start")`, exprAngle = `${isVG} ? (${isL} ? -90 : 90) : 0`, exprBaseline = `${isLR} ? (datum.vgrad ? (${isR} ? "bottom" : "top") : ${baseline}) : "top"`;
function legendTitle(spec, config2, userEncode, dataRef) {
const _24 = lookup$4(spec, config2);
const encode2 = {
enter: {
opacity: zero
},
update: {
opacity: one,
x: {
field: {
group: "padding"
}
},
y: {
field: {
group: "padding"
}
}
},
exit: {
opacity: zero
}
};
addEncoders(encode2, {
orient: _24("titleOrient"),
_anchor: _24("titleAnchor"),
anchor: {
signal: exprAnchor
},
angle: {
signal: exprAngle
},
align: {
signal: exprAlign
},
baseline: {
signal: exprBaseline
},
text: spec.title,
fill: _24("titleColor"),
fillOpacity: _24("titleOpacity"),
font: _24("titleFont"),
fontSize: _24("titleFontSize"),
fontStyle: _24("titleFontStyle"),
fontWeight: _24("titleFontWeight"),
limit: _24("titleLimit"),
lineHeight: _24("titleLineHeight")
}, {
// require update
align: _24("titleAlign"),
baseline: _24("titleBaseline")
});
return guideMark({
type: TextMark,
role: LegendTitleRole,
style: GuideTitleStyle,
from: dataRef,
encode: encode2
}, userEncode);
}
function clip(clip2, scope) {
let expr2;
if (isObject$a(clip2)) {
if (clip2.signal) {
expr2 = clip2.signal;
} else if (clip2.path) {
expr2 = "pathShape(" + param(clip2.path) + ")";
} else if (clip2.sphere) {
expr2 = "geoShape(" + param(clip2.sphere) + ', {type: "Sphere"})';
}
}
return expr2 ? scope.signalRef(expr2) : !!clip2;
}
function param(value2) {
return isObject$a(value2) && value2.signal ? value2.signal : $$h(value2);
}
function getRole(spec) {
const role = spec.role || "";
return !role.indexOf("axis") || !role.indexOf("legend") || !role.indexOf("title") ? role : spec.type === GroupMark ? ScopeRole : role || MarkRole;
}
function definition(spec) {
return {
marktype: spec.type,
name: spec.name || void 0,
role: spec.role || getRole(spec),
zindex: +spec.zindex || void 0,
aria: spec.aria,
description: spec.description
};
}
function interactive(spec, scope) {
return spec && spec.signal ? scope.signalRef(spec.signal) : spec === false ? false : true;
}
function parseTransform$1(spec, scope) {
const def2 = definition$1(spec.type);
if (!def2)
error2("Unrecognized transform type: " + $$h(spec.type));
const t5 = entry(def2.type.toLowerCase(), null, parseParameters(def2, spec, scope));
if (spec.signal)
scope.addSignal(spec.signal, scope.proxy(t5));
t5.metadata = def2.metadata || {};
return t5;
}
function parseParameters(def2, spec, scope) {
const params2 = {}, n2 = def2.params.length;
for (let i2 = 0; i2 < n2; ++i2) {
const pdef = def2.params[i2];
params2[pdef.name] = parseParameter(pdef, spec, scope);
}
return params2;
}
function parseParameter(def2, spec, scope) {
const type2 = def2.type, value2 = spec[def2.name];
if (type2 === "index") {
return parseIndexParameter(def2, spec, scope);
} else if (value2 === void 0) {
if (def2.required) {
error2("Missing required " + $$h(spec.type) + " parameter: " + $$h(def2.name));
}
return;
} else if (type2 === "param") {
return parseSubParameters(def2, spec, scope);
} else if (type2 === "projection") {
return scope.projectionRef(spec[def2.name]);
}
return def2.array && !isSignal(value2) ? value2.map((v2) => parameterValue(def2, v2, scope)) : parameterValue(def2, value2, scope);
}
function parameterValue(def2, value2, scope) {
const type2 = def2.type;
if (isSignal(value2)) {
return isExpr(type2) ? error2("Expression references can not be signals.") : isField(type2) ? scope.fieldRef(value2) : isCompare(type2) ? scope.compareRef(value2) : scope.signalRef(value2.signal);
} else {
const expr2 = def2.expr || isField(type2);
return expr2 && outerExpr(value2) ? scope.exprRef(value2.expr, value2.as) : expr2 && outerField(value2) ? fieldRef$1(value2.field, value2.as) : isExpr(type2) ? parser(value2, scope) : isData(type2) ? ref(scope.getData(value2).values) : isField(type2) ? fieldRef$1(value2) : isCompare(type2) ? scope.compareRef(value2) : value2;
}
}
function parseIndexParameter(def2, spec, scope) {
if (!isString(spec.from)) {
error2('Lookup "from" parameter must be a string literal.');
}
return scope.getData(spec.from).lookupRef(scope, spec.key);
}
function parseSubParameters(def2, spec, scope) {
const value2 = spec[def2.name];
if (def2.array) {
if (!isArray$2(value2)) {
error2("Expected an array of sub-parameters. Instead: " + $$h(value2));
}
return value2.map((v2) => parseSubParameter(def2, v2, scope));
} else {
return parseSubParameter(def2, value2, scope);
}
}
function parseSubParameter(def2, value2, scope) {
const n2 = def2.params.length;
let pdef;
for (let i2 = 0; i2 < n2; ++i2) {
pdef = def2.params[i2];
for (const k2 in pdef.key) {
if (pdef.key[k2] !== value2[k2]) {
pdef = null;
break;
}
}
if (pdef)
break;
}
if (!pdef)
error2("Unsupported parameter: " + $$h(value2));
const params2 = extend$2(parseParameters(pdef, value2, scope), pdef.key);
return ref(scope.add(Params(params2)));
}
const outerExpr = (_24) => _24 && _24.expr;
const outerField = (_24) => _24 && _24.field;
const isData = (_24) => _24 === "data";
const isExpr = (_24) => _24 === "expr";
const isField = (_24) => _24 === "field";
const isCompare = (_24) => _24 === "compare";
function parseData$1(from2, group2, scope) {
let facet, key2, op, dataRef, parent;
if (!from2) {
dataRef = ref(scope.add(Collect(null, [{}])));
} else if (facet = from2.facet) {
if (!group2)
error2("Only group marks can be faceted.");
if (facet.field != null) {
dataRef = parent = getDataRef(facet, scope);
} else {
if (!from2.data) {
op = parseTransform$1(extend$2({
type: "aggregate",
groupby: array$5(facet.groupby)
}, facet.aggregate), scope);
op.params.key = scope.keyRef(facet.groupby);
op.params.pulse = getDataRef(facet, scope);
dataRef = parent = ref(scope.add(op));
} else {
parent = ref(scope.getData(from2.data).aggregate);
}
key2 = scope.keyRef(facet.groupby, true);
}
}
if (!dataRef) {
dataRef = getDataRef(from2, scope);
}
return {
key: key2,
pulse: dataRef,
parent
};
}
function getDataRef(from2, scope) {
return from2.$ref ? from2 : from2.data && from2.data.$ref ? from2.data : ref(scope.getData(from2.data).output);
}
function DataScope(scope, input, output3, values2, aggr) {
this.scope = scope;
this.input = input;
this.output = output3;
this.values = values2;
this.aggregate = aggr;
this.index = {};
}
DataScope.fromEntries = function(scope, entries) {
const n2 = entries.length, values2 = entries[n2 - 1], output3 = entries[n2 - 2];
let input = entries[0], aggr = null, i2 = 1;
if (input && input.type === "load") {
input = entries[1];
}
scope.add(entries[0]);
for (; i2 < n2; ++i2) {
entries[i2].params.pulse = ref(entries[i2 - 1]);
scope.add(entries[i2]);
if (entries[i2].type === "aggregate")
aggr = entries[i2];
}
return new DataScope(scope, input, output3, values2, aggr);
};
function fieldKey(field2) {
return isString(field2) ? field2 : null;
}
function addSortField(scope, p2, sort2) {
const as = aggrField(sort2.op, sort2.field);
let s2;
if (p2.ops) {
for (let i2 = 0, n2 = p2.as.length; i2 < n2; ++i2) {
if (p2.as[i2] === as)
return;
}
} else {
p2.ops = ["count"];
p2.fields = [null];
p2.as = ["count"];
}
if (sort2.op) {
p2.ops.push((s2 = sort2.op.signal) ? scope.signalRef(s2) : sort2.op);
p2.fields.push(scope.fieldRef(sort2.field));
p2.as.push(as);
}
}
function cache(scope, ds, name, optype, field2, counts, index2) {
const cache2 = ds[name] || (ds[name] = {}), sort2 = sortKey(counts);
let k2 = fieldKey(field2), v2, op;
if (k2 != null) {
scope = ds.scope;
k2 = k2 + (sort2 ? "|" + sort2 : "");
v2 = cache2[k2];
}
if (!v2) {
const params2 = counts ? {
field: keyFieldRef,
pulse: ds.countsRef(scope, field2, counts)
} : {
field: scope.fieldRef(field2),
pulse: ref(ds.output)
};
if (sort2)
params2.sort = scope.sortRef(counts);
op = scope.add(entry(optype, void 0, params2));
if (index2)
ds.index[field2] = op;
v2 = ref(op);
if (k2 != null)
cache2[k2] = v2;
}
return v2;
}
DataScope.prototype = {
countsRef(scope, field2, sort2) {
const ds = this, cache2 = ds.counts || (ds.counts = {}), k2 = fieldKey(field2);
let v2, a2, p2;
if (k2 != null) {
scope = ds.scope;
v2 = cache2[k2];
}
if (!v2) {
p2 = {
groupby: scope.fieldRef(field2, "key"),
pulse: ref(ds.output)
};
if (sort2 && sort2.field)
addSortField(scope, p2, sort2);
a2 = scope.add(Aggregate(p2));
v2 = scope.add(Collect({
pulse: ref(a2)
}));
v2 = {
agg: a2,
ref: ref(v2)
};
if (k2 != null)
cache2[k2] = v2;
} else if (sort2 && sort2.field) {
addSortField(scope, v2.agg.params, sort2);
}
return v2.ref;
},
tuplesRef() {
return ref(this.values);
},
extentRef(scope, field2) {
return cache(scope, this, "extent", "extent", field2, false);
},
domainRef(scope, field2) {
return cache(scope, this, "domain", "values", field2, false);
},
valuesRef(scope, field2, sort2) {
return cache(scope, this, "vals", "values", field2, sort2 || true);
},
lookupRef(scope, field2) {
return cache(scope, this, "lookup", "tupleindex", field2, false);
},
indataRef(scope, field2) {
return cache(scope, this, "indata", "tupleindex", field2, true, true);
}
};
function parseFacet(spec, scope, group2) {
const facet = spec.from.facet, name = facet.name, data2 = getDataRef(facet, scope);
let op;
if (!facet.name) {
error2("Facet must have a name: " + $$h(facet));
}
if (!facet.data) {
error2("Facet must reference a data set: " + $$h(facet));
}
if (facet.field) {
op = scope.add(PreFacet({
field: scope.fieldRef(facet.field),
pulse: data2
}));
} else if (facet.groupby) {
op = scope.add(Facet({
key: scope.keyRef(facet.groupby),
group: ref(scope.proxy(group2.parent)),
pulse: data2
}));
} else {
error2("Facet must specify groupby or field: " + $$h(facet));
}
const subscope = scope.fork(), source2 = subscope.add(Collect()), values2 = subscope.add(Sieve({
pulse: ref(source2)
}));
subscope.addData(name, new DataScope(subscope, source2, source2, values2));
subscope.addSignal("parent", null);
op.params.subflow = {
$subflow: subscope.parse(spec).toRuntime()
};
}
function parseSubflow(spec, scope, input) {
const op = scope.add(PreFacet({
pulse: input.pulse
})), subscope = scope.fork();
subscope.add(Sieve());
subscope.addSignal("parent", null);
op.params.subflow = {
$subflow: subscope.parse(spec).toRuntime()
};
}
function parseTrigger(spec, scope, name) {
const remove3 = spec.remove, insert2 = spec.insert, toggle2 = spec.toggle, modify2 = spec.modify, values2 = spec.values, op = scope.add(operator());
const update2 = "if(" + spec.trigger + ',modify("' + name + '",' + [insert2, remove3, toggle2, modify2, values2].map((_24) => _24 == null ? "null" : _24).join(",") + "),0)";
const expr2 = parser(update2, scope);
op.update = expr2.$expr;
op.params = expr2.$params;
}
function parseMark(spec, scope) {
const role = getRole(spec), group2 = spec.type === GroupMark, facet = spec.from && spec.from.facet, overlap = spec.overlap;
let layout = spec.layout || role === ScopeRole || role === FrameRole, ops2, op, store, enc, name, layoutRef, boundRef;
const nested = role === MarkRole || layout || facet;
const input = parseData$1(spec.from, group2, scope);
op = scope.add(DataJoin({
key: input.key || (spec.key ? fieldRef$1(spec.key) : void 0),
pulse: input.pulse,
clean: !group2
}));
const joinRef = ref(op);
op = store = scope.add(Collect({
pulse: joinRef
}));
op = scope.add(Mark({
markdef: definition(spec),
interactive: interactive(spec.interactive, scope),
clip: clip(spec.clip, scope),
context: {
$context: true
},
groups: scope.lookup(),
parent: scope.signals.parent ? scope.signalRef("parent") : null,
index: scope.markpath(),
pulse: ref(op)
}));
const markRef = ref(op);
op = enc = scope.add(Encode(parseEncode(spec.encode, spec.type, role, spec.style, scope, {
mod: false,
pulse: markRef
})));
op.params.parent = scope.encode();
if (spec.transform) {
spec.transform.forEach((_24) => {
const tx2 = parseTransform$1(_24, scope), md2 = tx2.metadata;
if (md2.generates || md2.changes) {
error2("Mark transforms should not generate new data.");
}
if (!md2.nomod)
enc.params.mod = true;
tx2.params.pulse = ref(op);
scope.add(op = tx2);
});
}
if (spec.sort) {
op = scope.add(SortItems({
sort: scope.compareRef(spec.sort),
pulse: ref(op)
}));
}
const encodeRef = ref(op);
if (facet || layout) {
layout = scope.add(ViewLayout({
layout: scope.objectProperty(spec.layout),
legends: scope.legends,
mark: markRef,
pulse: encodeRef
}));
layoutRef = ref(layout);
}
const bound2 = scope.add(Bound({
mark: markRef,
pulse: layoutRef || encodeRef
}));
boundRef = ref(bound2);
if (group2) {
if (nested) {
ops2 = scope.operators;
ops2.pop();
if (layout)
ops2.pop();
}
scope.pushState(encodeRef, layoutRef || boundRef, joinRef);
facet ? parseFacet(spec, scope, input) : nested ? parseSubflow(spec, scope, input) : scope.parse(spec);
scope.popState();
if (nested) {
if (layout)
ops2.push(layout);
ops2.push(bound2);
}
}
if (overlap) {
boundRef = parseOverlap(overlap, boundRef, scope);
}
const render3 = scope.add(Render({
pulse: boundRef
})), sieve = scope.add(Sieve({
pulse: ref(render3)
}, void 0, scope.parent()));
if (spec.name != null) {
name = spec.name;
scope.addData(name, new DataScope(scope, store, render3, sieve));
if (spec.on)
spec.on.forEach((on2) => {
if (on2.insert || on2.remove || on2.toggle) {
error2("Marks only support modify triggers.");
}
parseTrigger(on2, scope, name);
});
}
}
function parseOverlap(overlap, source2, scope) {
const method = overlap.method, bound2 = overlap.bound, sep = overlap.separation;
const params2 = {
separation: isSignal(sep) ? scope.signalRef(sep.signal) : sep,
method: isSignal(method) ? scope.signalRef(method.signal) : method,
pulse: source2
};
if (overlap.order) {
params2.sort = scope.compareRef({
field: overlap.order
});
}
if (bound2) {
const tol = bound2.tolerance;
params2.boundTolerance = isSignal(tol) ? scope.signalRef(tol.signal) : +tol;
params2.boundScale = scope.scaleRef(bound2.scale);
params2.boundOrient = bound2.orient;
}
return ref(scope.add(Overlap(params2)));
}
function parseLegend(spec, scope) {
const config2 = scope.config.legend, encode2 = spec.encode || {}, _24 = lookup$4(spec, config2), legendEncode = encode2.legend || {}, name = legendEncode.name || void 0, interactive2 = legendEncode.interactive, style2 = legendEncode.style, scales2 = {};
let scale2 = 0, entryLayout, params2, children2;
LegendScales.forEach((s2) => spec[s2] ? (scales2[s2] = spec[s2], scale2 = scale2 || spec[s2]) : 0);
if (!scale2)
error2("Missing valid scale for legend.");
const type2 = legendType(spec, scope.scaleType(scale2));
const datum2 = {
title: spec.title != null,
scales: scales2,
type: type2,
vgrad: type2 !== "symbol" && _24.isVertical()
};
const dataRef = ref(scope.add(Collect(null, [datum2])));
const entryEncode = {
enter: {
x: {
value: 0
},
y: {
value: 0
}
}
};
const entryRef = ref(scope.add(LegendEntries(params2 = {
type: type2,
scale: scope.scaleRef(scale2),
count: scope.objectProperty(_24("tickCount")),
limit: scope.property(_24("symbolLimit")),
values: scope.objectProperty(spec.values),
minstep: scope.property(spec.tickMinStep),
formatType: scope.property(spec.formatType),
formatSpecifier: scope.property(spec.format)
})));
if (type2 === Gradient) {
children2 = [legendGradient(spec, scale2, config2, encode2.gradient), legendGradientLabels(spec, config2, encode2.labels, entryRef)];
params2.count = params2.count || scope.signalRef(`max(2,2*floor((${deref(_24.gradientLength())})/100))`);
} else if (type2 === Discrete) {
children2 = [legendGradientDiscrete(spec, scale2, config2, encode2.gradient, entryRef), legendGradientLabels(spec, config2, encode2.labels, entryRef)];
} else {
entryLayout = legendSymbolLayout(spec, config2);
children2 = [legendSymbolGroups(spec, config2, encode2, entryRef, deref(entryLayout.columns))];
params2.size = sizeExpression(spec, scope, children2[0].marks);
}
children2 = [guideGroup({
role: LegendEntryRole,
from: dataRef,
encode: entryEncode,
marks: children2,
layout: entryLayout,
interactive: interactive2
})];
if (datum2.title) {
children2.push(legendTitle(spec, config2, encode2.title, dataRef));
}
return parseMark(guideGroup({
role: LegendRole,
from: dataRef,
encode: extendEncode(buildLegendEncode(_24, spec, config2), legendEncode, Skip),
marks: children2,
aria: _24("aria"),
description: _24("description"),
zindex: _24("zindex"),
name,
interactive: interactive2,
style: style2
}), scope);
}
function legendType(spec, scaleType) {
let type2 = spec.type || Symbols;
if (!spec.type && scaleCount(spec) === 1 && (spec.fill || spec.stroke)) {
type2 = isContinuous(scaleType) ? Gradient : isDiscretizing(scaleType) ? Discrete : Symbols;
}
return type2 !== Gradient ? type2 : isDiscretizing(scaleType) ? Discrete : Gradient;
}
function scaleCount(spec) {
return LegendScales.reduce((count2, type2) => count2 + (spec[type2] ? 1 : 0), 0);
}
function buildLegendEncode(_24, spec, config2) {
const encode2 = {
enter: {},
update: {}
};
addEncoders(encode2, {
orient: _24("orient"),
offset: _24("offset"),
padding: _24("padding"),
titlePadding: _24("titlePadding"),
cornerRadius: _24("cornerRadius"),
fill: _24("fillColor"),
stroke: _24("strokeColor"),
strokeWidth: config2.strokeWidth,
strokeDash: config2.strokeDash,
x: _24("legendX"),
y: _24("legendY"),
// accessibility support
format: spec.format,
formatType: spec.formatType
});
return encode2;
}
function sizeExpression(spec, scope, marks) {
const size = deref(getChannel("size", spec, marks)), strokeWidth = deref(getChannel("strokeWidth", spec, marks)), fontSize2 = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));
return parser(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize2})`, scope);
}
function getChannel(name, spec, marks) {
return spec[name] ? `scale("${spec[name]}",datum)` : getEncoding(name, marks[0].encode);
}
function getFontSize(encode2, scope, style2) {
return getEncoding("fontSize", encode2) || getStyle("fontSize", scope, style2);
}
const angleExpr = `item.orient==="${Left}"?-90:item.orient==="${Right}"?90:0`;
function parseTitle(spec, scope) {
spec = isString(spec) ? {
text: spec
} : spec;
const _24 = lookup$4(spec, scope.config.title), encode2 = spec.encode || {}, userEncode = encode2.group || {}, name = userEncode.name || void 0, interactive2 = userEncode.interactive, style2 = userEncode.style, children2 = [];
const datum2 = {}, dataRef = ref(scope.add(Collect(null, [datum2])));
children2.push(buildTitle(spec, _24, titleEncode(spec), dataRef));
if (spec.subtitle) {
children2.push(buildSubTitle(spec, _24, encode2.subtitle, dataRef));
}
return parseMark(guideGroup({
role: TitleRole,
from: dataRef,
encode: groupEncode(_24, userEncode),
marks: children2,
aria: _24("aria"),
description: _24("description"),
zindex: _24("zindex"),
name,
interactive: interactive2,
style: style2
}), scope);
}
function titleEncode(spec) {
const encode2 = spec.encode;
return encode2 && encode2.title || extend$2({
name: spec.name,
interactive: spec.interactive,
style: spec.style
}, encode2);
}
function groupEncode(_24, userEncode) {
const encode2 = {
enter: {},
update: {}
};
addEncoders(encode2, {
orient: _24("orient"),
anchor: _24("anchor"),
align: {
signal: alignExpr$1
},
angle: {
signal: angleExpr
},
limit: _24("limit"),
frame: _24("frame"),
offset: _24("offset") || 0,
padding: _24("subtitlePadding")
});
return extendEncode(encode2, userEncode, Skip);
}
function buildTitle(spec, _24, userEncode, dataRef) {
const zero2 = {
value: 0
}, text2 = spec.text, encode2 = {
enter: {
opacity: zero2
},
update: {
opacity: {
value: 1
}
},
exit: {
opacity: zero2
}
};
addEncoders(encode2, {
text: text2,
align: {
signal: "item.mark.group.align"
},
angle: {
signal: "item.mark.group.angle"
},
limit: {
signal: "item.mark.group.limit"
},
baseline: "top",
dx: _24("dx"),
dy: _24("dy"),
fill: _24("color"),
font: _24("font"),
fontSize: _24("fontSize"),
fontStyle: _24("fontStyle"),
fontWeight: _24("fontWeight"),
lineHeight: _24("lineHeight")
}, {
// update
align: _24("align"),
angle: _24("angle"),
baseline: _24("baseline")
});
return guideMark({
type: TextMark,
role: TitleTextRole,
style: GroupTitleStyle,
from: dataRef,
encode: encode2
}, userEncode);
}
function buildSubTitle(spec, _24, userEncode, dataRef) {
const zero2 = {
value: 0
}, text2 = spec.subtitle, encode2 = {
enter: {
opacity: zero2
},
update: {
opacity: {
value: 1
}
},
exit: {
opacity: zero2
}
};
addEncoders(encode2, {
text: text2,
align: {
signal: "item.mark.group.align"
},
angle: {
signal: "item.mark.group.angle"
},
limit: {
signal: "item.mark.group.limit"
},
baseline: "top",
dx: _24("dx"),
dy: _24("dy"),
fill: _24("subtitleColor"),
font: _24("subtitleFont"),
fontSize: _24("subtitleFontSize"),
fontStyle: _24("subtitleFontStyle"),
fontWeight: _24("subtitleFontWeight"),
lineHeight: _24("subtitleLineHeight")
}, {
// update
align: _24("align"),
angle: _24("angle"),
baseline: _24("baseline")
});
return guideMark({
type: TextMark,
role: TitleSubtitleRole,
style: GroupSubtitleStyle,
from: dataRef,
encode: encode2
}, userEncode);
}
function parseData(data2, scope) {
const transforms2 = [];
if (data2.transform) {
data2.transform.forEach((tx2) => {
transforms2.push(parseTransform$1(tx2, scope));
});
}
if (data2.on) {
data2.on.forEach((on2) => {
parseTrigger(on2, scope, data2.name);
});
}
scope.addDataPipeline(data2.name, analyze(data2, scope, transforms2));
}
function analyze(data2, scope, ops2) {
const output3 = [];
let source2 = null, modify2 = false, generate2 = false, upstream, i2, n2, t5, m2;
if (data2.values) {
if (isSignal(data2.values) || hasSignal(data2.format)) {
output3.push(load(scope, data2));
output3.push(source2 = collect());
} else {
output3.push(source2 = collect({
$ingest: data2.values,
$format: data2.format
}));
}
} else if (data2.url) {
if (hasSignal(data2.url) || hasSignal(data2.format)) {
output3.push(load(scope, data2));
output3.push(source2 = collect());
} else {
output3.push(source2 = collect({
$request: data2.url,
$format: data2.format
}));
}
} else if (data2.source) {
source2 = upstream = array$5(data2.source).map((d2) => ref(scope.getData(d2).output));
output3.push(null);
}
for (i2 = 0, n2 = ops2.length; i2 < n2; ++i2) {
t5 = ops2[i2];
m2 = t5.metadata;
if (!source2 && !m2.source) {
output3.push(source2 = collect());
}
output3.push(t5);
if (m2.generates)
generate2 = true;
if (m2.modifies && !generate2)
modify2 = true;
if (m2.source)
source2 = t5;
else if (m2.changes)
source2 = null;
}
if (upstream) {
n2 = upstream.length - 1;
output3[0] = Relay({
derive: modify2,
pulse: n2 ? upstream : upstream[0]
});
if (modify2 || n2) {
output3.splice(1, 0, collect());
}
}
if (!source2)
output3.push(collect());
output3.push(Sieve({}));
return output3;
}
function collect(values2) {
const s2 = Collect({}, values2);
s2.metadata = {
source: true
};
return s2;
}
function load(scope, data2) {
return Load({
url: data2.url ? scope.property(data2.url) : void 0,
async: data2.async ? scope.property(data2.async) : void 0,
values: data2.values ? scope.property(data2.values) : void 0,
format: scope.objectProperty(data2.format)
});
}
const isX = (orient) => orient === Bottom || orient === Top;
const getSign = (orient, a2, b2) => isSignal(orient) ? ifLeftTopExpr(orient.signal, a2, b2) : orient === Left || orient === Top ? a2 : b2;
const ifX = (orient, a2, b2) => isSignal(orient) ? ifXEnc(orient.signal, a2, b2) : isX(orient) ? a2 : b2;
const ifY = (orient, a2, b2) => isSignal(orient) ? ifYEnc(orient.signal, a2, b2) : isX(orient) ? b2 : a2;
const ifTop = (orient, a2, b2) => isSignal(orient) ? ifTopExpr(orient.signal, a2, b2) : orient === Top ? {
value: a2
} : {
value: b2
};
const ifRight = (orient, a2, b2) => isSignal(orient) ? ifRightExpr(orient.signal, a2, b2) : orient === Right ? {
value: a2
} : {
value: b2
};
const ifXEnc = ($orient, a2, b2) => ifEnc(`${$orient} === '${Top}' || ${$orient} === '${Bottom}'`, a2, b2);
const ifYEnc = ($orient, a2, b2) => ifEnc(`${$orient} !== '${Top}' && ${$orient} !== '${Bottom}'`, a2, b2);
const ifLeftTopExpr = ($orient, a2, b2) => ifExpr(`${$orient} === '${Left}' || ${$orient} === '${Top}'`, a2, b2);
const ifTopExpr = ($orient, a2, b2) => ifExpr(`${$orient} === '${Top}'`, a2, b2);
const ifRightExpr = ($orient, a2, b2) => ifExpr(`${$orient} === '${Right}'`, a2, b2);
const ifEnc = (test2, a2, b2) => {
a2 = a2 != null ? encoder(a2) : a2;
b2 = b2 != null ? encoder(b2) : b2;
if (isSimple(a2) && isSimple(b2)) {
a2 = a2 ? a2.signal || $$h(a2.value) : null;
b2 = b2 ? b2.signal || $$h(b2.value) : null;
return {
signal: `${test2} ? (${a2}) : (${b2})`
};
} else {
return [extend$2({
test: test2
}, a2)].concat(b2 || []);
}
};
const isSimple = (enc) => enc == null || Object.keys(enc).length === 1;
const ifExpr = (test2, a2, b2) => ({
signal: `${test2} ? (${toExpr(a2)}) : (${toExpr(b2)})`
});
const ifOrient = ($orient, t5, b2, l2, r2) => ({
signal: (l2 != null ? `${$orient} === '${Left}' ? (${toExpr(l2)}) : ` : "") + (b2 != null ? `${$orient} === '${Bottom}' ? (${toExpr(b2)}) : ` : "") + (r2 != null ? `${$orient} === '${Right}' ? (${toExpr(r2)}) : ` : "") + (t5 != null ? `${$orient} === '${Top}' ? (${toExpr(t5)}) : ` : "") + "(null)"
});
const toExpr = (v2) => isSignal(v2) ? v2.signal : v2 == null ? null : $$h(v2);
const mult = (sign2, value2) => value2 === 0 ? 0 : isSignal(sign2) ? {
signal: `(${sign2.signal}) * ${value2}`
} : {
value: sign2 * value2
};
const patch = (value2, base2) => {
const s2 = value2.signal;
return s2 && s2.endsWith("(null)") ? {
signal: s2.slice(0, -6) + base2.signal
} : value2;
};
function fallback(prop, config2, axisConfig2, style2) {
let styleProp;
if (config2 && has$2(config2, prop)) {
return config2[prop];
} else if (has$2(axisConfig2, prop)) {
return axisConfig2[prop];
} else if (prop.startsWith("title")) {
switch (prop) {
case "titleColor":
styleProp = "fill";
break;
case "titleFont":
case "titleFontSize":
case "titleFontWeight":
styleProp = prop[5].toLowerCase() + prop.slice(6);
}
return style2[GuideTitleStyle][styleProp];
} else if (prop.startsWith("label")) {
switch (prop) {
case "labelColor":
styleProp = "fill";
break;
case "labelFont":
case "labelFontSize":
styleProp = prop[5].toLowerCase() + prop.slice(6);
}
return style2[GuideLabelStyle][styleProp];
}
return null;
}
function keys$1(objects) {
const map2 = {};
for (const obj of objects) {
if (!obj)
continue;
for (const key2 in obj)
map2[key2] = 1;
}
return Object.keys(map2);
}
function axisConfig(spec, scope) {
var config2 = scope.config, style2 = config2.style, axis = config2.axis, band2 = scope.scaleType(spec.scale) === "band" && config2.axisBand, orient = spec.orient, xy, or3, key2;
if (isSignal(orient)) {
const xyKeys = keys$1([config2.axisX, config2.axisY]), orientKeys = keys$1([config2.axisTop, config2.axisBottom, config2.axisLeft, config2.axisRight]);
xy = {};
for (key2 of xyKeys) {
xy[key2] = ifX(orient, fallback(key2, config2.axisX, axis, style2), fallback(key2, config2.axisY, axis, style2));
}
or3 = {};
for (key2 of orientKeys) {
or3[key2] = ifOrient(orient.signal, fallback(key2, config2.axisTop, axis, style2), fallback(key2, config2.axisBottom, axis, style2), fallback(key2, config2.axisLeft, axis, style2), fallback(key2, config2.axisRight, axis, style2));
}
} else {
xy = orient === Top || orient === Bottom ? config2.axisX : config2.axisY;
or3 = config2["axis" + orient[0].toUpperCase() + orient.slice(1)];
}
const result = xy || or3 || band2 ? extend$2({}, axis, xy, or3, band2) : axis;
return result;
}
function axisDomain(spec, config2, userEncode, dataRef) {
const _24 = lookup$4(spec, config2), orient = spec.orient;
let enter, update2;
const encode2 = {
enter: enter = {
opacity: zero
},
update: update2 = {
opacity: one
},
exit: {
opacity: zero
}
};
addEncoders(encode2, {
stroke: _24("domainColor"),
strokeCap: _24("domainCap"),
strokeDash: _24("domainDash"),
strokeDashOffset: _24("domainDashOffset"),
strokeWidth: _24("domainWidth"),
strokeOpacity: _24("domainOpacity")
});
const pos0 = position$1(spec, 0);
const pos1 = position$1(spec, 1);
enter.x = update2.x = ifX(orient, pos0, zero);
enter.x2 = update2.x2 = ifX(orient, pos1);
enter.y = update2.y = ifY(orient, pos0, zero);
enter.y2 = update2.y2 = ifY(orient, pos1);
return guideMark({
type: RuleMark,
role: AxisDomainRole,
from: dataRef,
encode: encode2
}, userEncode);
}
function position$1(spec, pos) {
return {
scale: spec.scale,
range: pos
};
}
function axisGrid(spec, config2, userEncode, dataRef, band2) {
const _24 = lookup$4(spec, config2), orient = spec.orient, vscale = spec.gridScale, sign2 = getSign(orient, 1, -1), offset2 = offsetValue(spec.offset, sign2);
let enter, exit, update2;
const encode2 = {
enter: enter = {
opacity: zero
},
update: update2 = {
opacity: one
},
exit: exit = {
opacity: zero
}
};
addEncoders(encode2, {
stroke: _24("gridColor"),
strokeCap: _24("gridCap"),
strokeDash: _24("gridDash"),
strokeDashOffset: _24("gridDashOffset"),
strokeOpacity: _24("gridOpacity"),
strokeWidth: _24("gridWidth")
});
const tickPos = {
scale: spec.scale,
field: Value,
band: band2.band,
extra: band2.extra,
offset: band2.offset,
round: _24("tickRound")
};
const sz2 = ifX(orient, {
signal: "height"
}, {
signal: "width"
});
const gridStart = vscale ? {
scale: vscale,
range: 0,
mult: sign2,
offset: offset2
} : {
value: 0,
offset: offset2
};
const gridEnd = vscale ? {
scale: vscale,
range: 1,
mult: sign2,
offset: offset2
} : extend$2(sz2, {
mult: sign2,
offset: offset2
});
enter.x = update2.x = ifX(orient, tickPos, gridStart);
enter.y = update2.y = ifY(orient, tickPos, gridStart);
enter.x2 = update2.x2 = ifY(orient, gridEnd);
enter.y2 = update2.y2 = ifX(orient, gridEnd);
exit.x = ifX(orient, tickPos);
exit.y = ifY(orient, tickPos);
return guideMark({
type: RuleMark,
role: AxisGridRole,
key: Value,
from: dataRef,
encode: encode2
}, userEncode);
}
function offsetValue(offset2, sign2) {
if (sign2 === 1)
;
else if (!isObject$a(offset2)) {
offset2 = isSignal(sign2) ? {
signal: `(${sign2.signal}) * (${offset2 || 0})`
} : sign2 * (offset2 || 0);
} else {
let entry2 = offset2 = extend$2({}, offset2);
while (entry2.mult != null) {
if (!isObject$a(entry2.mult)) {
entry2.mult = isSignal(sign2) ? {
signal: `(${entry2.mult}) * (${sign2.signal})`
} : entry2.mult * sign2;
return offset2;
} else {
entry2 = entry2.mult = extend$2({}, entry2.mult);
}
}
entry2.mult = sign2;
}
return offset2;
}
function axisTicks(spec, config2, userEncode, dataRef, size, band2) {
const _24 = lookup$4(spec, config2), orient = spec.orient, sign2 = getSign(orient, -1, 1);
let enter, exit, update2;
const encode2 = {
enter: enter = {
opacity: zero
},
update: update2 = {
opacity: one
},
exit: exit = {
opacity: zero
}
};
addEncoders(encode2, {
stroke: _24("tickColor"),
strokeCap: _24("tickCap"),
strokeDash: _24("tickDash"),
strokeDashOffset: _24("tickDashOffset"),
strokeOpacity: _24("tickOpacity"),
strokeWidth: _24("tickWidth")
});
const tickSize = encoder(size);
tickSize.mult = sign2;
const tickPos = {
scale: spec.scale,
field: Value,
band: band2.band,
extra: band2.extra,
offset: band2.offset,
round: _24("tickRound")
};
update2.y = enter.y = ifX(orient, zero, tickPos);
update2.y2 = enter.y2 = ifX(orient, tickSize);
exit.x = ifX(orient, tickPos);
update2.x = enter.x = ifY(orient, zero, tickPos);
update2.x2 = enter.x2 = ifY(orient, tickSize);
exit.y = ifY(orient, tickPos);
return guideMark({
type: RuleMark,
role: AxisTickRole,
key: Value,
from: dataRef,
encode: encode2
}, userEncode);
}
function flushExpr(scale2, threshold2, a2, b2, c2) {
return {
signal: 'flush(range("' + scale2 + '"), scale("' + scale2 + '", datum.value), ' + threshold2 + "," + a2 + "," + b2 + "," + c2 + ")"
};
}
function axisLabels(spec, config2, userEncode, dataRef, size, band2) {
const _24 = lookup$4(spec, config2), orient = spec.orient, scale2 = spec.scale, sign2 = getSign(orient, -1, 1), flush = deref(_24("labelFlush")), flushOffset = deref(_24("labelFlushOffset")), labelAlign = _24("labelAlign"), labelBaseline = _24("labelBaseline");
let flushOn = flush === 0 || !!flush, update2;
const tickSize = encoder(size);
tickSize.mult = sign2;
tickSize.offset = encoder(_24("labelPadding") || 0);
tickSize.offset.mult = sign2;
const tickPos = {
scale: scale2,
field: Value,
band: 0.5,
offset: extendOffset(band2.offset, _24("labelOffset"))
};
const align = ifX(orient, flushOn ? flushExpr(scale2, flush, '"left"', '"right"', '"center"') : {
value: "center"
}, ifRight(orient, "left", "right"));
const baseline2 = ifX(orient, ifTop(orient, "bottom", "top"), flushOn ? flushExpr(scale2, flush, '"top"', '"bottom"', '"middle"') : {
value: "middle"
});
const offsetExpr = flushExpr(scale2, flush, `-(${flushOffset})`, flushOffset, 0);
flushOn = flushOn && flushOffset;
const enter = {
opacity: zero,
x: ifX(orient, tickPos, tickSize),
y: ifY(orient, tickPos, tickSize)
};
const encode2 = {
enter,
update: update2 = {
opacity: one,
text: {
field: Label
},
x: enter.x,
y: enter.y,
align,
baseline: baseline2
},
exit: {
opacity: zero,
x: enter.x,
y: enter.y
}
};
addEncoders(encode2, {
dx: !labelAlign && flushOn ? ifX(orient, offsetExpr) : null,
dy: !labelBaseline && flushOn ? ifY(orient, offsetExpr) : null
});
addEncoders(encode2, {
angle: _24("labelAngle"),
fill: _24("labelColor"),
fillOpacity: _24("labelOpacity"),
font: _24("labelFont"),
fontSize: _24("labelFontSize"),
fontWeight: _24("labelFontWeight"),
fontStyle: _24("labelFontStyle"),
limit: _24("labelLimit"),
lineHeight: _24("labelLineHeight")
}, {
align: labelAlign,
baseline: labelBaseline
});
const bound2 = _24("labelBound");
let overlap = _24("labelOverlap");
overlap = overlap || bound2 ? {
separation: _24("labelSeparation"),
method: overlap,
order: "datum.index",
bound: bound2 ? {
scale: scale2,
orient,
tolerance: bound2
} : null
} : void 0;
if (update2.align !== align) {
update2.align = patch(update2.align, align);
}
if (update2.baseline !== baseline2) {
update2.baseline = patch(update2.baseline, baseline2);
}
return guideMark({
type: TextMark,
role: AxisLabelRole,
style: GuideLabelStyle,
key: Value,
from: dataRef,
encode: encode2,
overlap
}, userEncode);
}
function axisTitle(spec, config2, userEncode, dataRef) {
const _24 = lookup$4(spec, config2), orient = spec.orient, sign2 = getSign(orient, -1, 1);
let enter, update2;
const encode2 = {
enter: enter = {
opacity: zero,
anchor: encoder(_24("titleAnchor", null)),
align: {
signal: alignExpr$1
}
},
update: update2 = extend$2({}, enter, {
opacity: one,
text: encoder(spec.title)
}),
exit: {
opacity: zero
}
};
const titlePos = {
signal: `lerp(range("${spec.scale}"), ${anchorExpr(0, 1, 0.5)})`
};
update2.x = ifX(orient, titlePos);
update2.y = ifY(orient, titlePos);
enter.angle = ifX(orient, zero, mult(sign2, 90));
enter.baseline = ifX(orient, ifTop(orient, Bottom, Top), {
value: Bottom
});
update2.angle = enter.angle;
update2.baseline = enter.baseline;
addEncoders(encode2, {
fill: _24("titleColor"),
fillOpacity: _24("titleOpacity"),
font: _24("titleFont"),
fontSize: _24("titleFontSize"),
fontStyle: _24("titleFontStyle"),
fontWeight: _24("titleFontWeight"),
limit: _24("titleLimit"),
lineHeight: _24("titleLineHeight")
}, {
// require update
align: _24("titleAlign"),
angle: _24("titleAngle"),
baseline: _24("titleBaseline")
});
autoLayout(_24, orient, encode2, userEncode);
encode2.update.align = patch(encode2.update.align, enter.align);
encode2.update.angle = patch(encode2.update.angle, enter.angle);
encode2.update.baseline = patch(encode2.update.baseline, enter.baseline);
return guideMark({
type: TextMark,
role: AxisTitleRole,
style: GuideTitleStyle,
from: dataRef,
encode: encode2
}, userEncode);
}
function autoLayout(_24, orient, encode2, userEncode) {
const auto2 = (value2, dim) => value2 != null ? (encode2.update[dim] = patch(encoder(value2), encode2.update[dim]), false) : !has$1(dim, userEncode) ? true : false;
const autoY = auto2(_24("titleX"), "x"), autoX = auto2(_24("titleY"), "y");
encode2.enter.auto = autoX === autoY ? encoder(autoX) : ifX(orient, encoder(autoX), encoder(autoY));
}
function parseAxis(spec, scope) {
const config2 = axisConfig(spec, scope), encode2 = spec.encode || {}, axisEncode = encode2.axis || {}, name = axisEncode.name || void 0, interactive2 = axisEncode.interactive, style2 = axisEncode.style, _24 = lookup$4(spec, config2), band2 = tickBand(_24);
const datum2 = {
scale: spec.scale,
ticks: !!_24("ticks"),
labels: !!_24("labels"),
grid: !!_24("grid"),
domain: !!_24("domain"),
title: spec.title != null
};
const dataRef = ref(scope.add(Collect({}, [datum2])));
const ticksRef = ref(scope.add(AxisTicks({
scale: scope.scaleRef(spec.scale),
extra: scope.property(band2.extra),
count: scope.objectProperty(spec.tickCount),
values: scope.objectProperty(spec.values),
minstep: scope.property(spec.tickMinStep),
formatType: scope.property(spec.formatType),
formatSpecifier: scope.property(spec.format)
})));
const children2 = [];
let size;
if (datum2.grid) {
children2.push(axisGrid(spec, config2, encode2.grid, ticksRef, band2));
}
if (datum2.ticks) {
size = _24("tickSize");
children2.push(axisTicks(spec, config2, encode2.ticks, ticksRef, size, band2));
}
if (datum2.labels) {
size = datum2.ticks ? size : 0;
children2.push(axisLabels(spec, config2, encode2.labels, ticksRef, size, band2));
}
if (datum2.domain) {
children2.push(axisDomain(spec, config2, encode2.domain, dataRef));
}
if (datum2.title) {
children2.push(axisTitle(spec, config2, encode2.title, dataRef));
}
return parseMark(guideGroup({
role: AxisRole,
from: dataRef,
encode: extendEncode(buildAxisEncode(_24, spec), axisEncode, Skip),
marks: children2,
aria: _24("aria"),
description: _24("description"),
zindex: _24("zindex"),
name,
interactive: interactive2,
style: style2
}), scope);
}
function buildAxisEncode(_24, spec) {
const encode2 = {
enter: {},
update: {}
};
addEncoders(encode2, {
orient: _24("orient"),
offset: _24("offset") || 0,
position: value$1(spec.position, 0),
titlePadding: _24("titlePadding"),
minExtent: _24("minExtent"),
maxExtent: _24("maxExtent"),
range: {
signal: `abs(span(range("${spec.scale}")))`
},
translate: _24("translate"),
// accessibility support
format: spec.format,
formatType: spec.formatType
});
return encode2;
}
function parseScope(spec, scope, preprocessed) {
const signals = array$5(spec.signals), scales2 = array$5(spec.scales);
if (!preprocessed)
signals.forEach((_24) => parseSignal(_24, scope));
array$5(spec.projections).forEach((_24) => parseProjection(_24, scope));
scales2.forEach((_24) => initScale(_24, scope));
array$5(spec.data).forEach((_24) => parseData(_24, scope));
scales2.forEach((_24) => parseScale(_24, scope));
(preprocessed || signals).forEach((_24) => parseSignalUpdates(_24, scope));
array$5(spec.axes).forEach((_24) => parseAxis(_24, scope));
array$5(spec.marks).forEach((_24) => parseMark(_24, scope));
array$5(spec.legends).forEach((_24) => parseLegend(_24, scope));
if (spec.title)
parseTitle(spec.title, scope);
scope.parseLambdas();
return scope;
}
const rootEncode = (spec) => extendEncode({
enter: {
x: {
value: 0
},
y: {
value: 0
}
},
update: {
width: {
signal: "width"
},
height: {
signal: "height"
}
}
}, spec);
function parseView(spec, scope) {
const config2 = scope.config;
const root2 = ref(scope.root = scope.add(operator()));
const signals = collectSignals(spec, config2);
signals.forEach((_24) => parseSignal(_24, scope));
scope.description = spec.description || config2.description;
scope.eventConfig = config2.events;
scope.legends = scope.objectProperty(config2.legend && config2.legend.layout);
scope.locale = config2.locale;
const input = scope.add(Collect());
const encode2 = scope.add(Encode(parseEncode(rootEncode(spec.encode), GroupMark, FrameRole, spec.style, scope, {
pulse: ref(input)
})));
const parent = scope.add(ViewLayout({
layout: scope.objectProperty(spec.layout),
legends: scope.legends,
autosize: scope.signalRef("autosize"),
mark: root2,
pulse: ref(encode2)
}));
scope.operators.pop();
scope.pushState(ref(encode2), ref(parent), null);
parseScope(spec, scope, signals);
scope.operators.push(parent);
let op = scope.add(Bound({
mark: root2,
pulse: ref(parent)
}));
op = scope.add(Render({
pulse: ref(op)
}));
op = scope.add(Sieve({
pulse: ref(op)
}));
scope.addData("root", new DataScope(scope, input, input, op));
return scope;
}
function signalObject(name, value2) {
return value2 && value2.signal ? {
name,
update: value2.signal
} : {
name,
value: value2
};
}
function collectSignals(spec, config2) {
const _24 = (name) => value$1(spec[name], config2[name]), signals = [signalObject("background", _24("background")), signalObject("autosize", parseAutosize(_24("autosize"))), signalObject("padding", parsePadding(_24("padding"))), signalObject("width", _24("width") || 0), signalObject("height", _24("height") || 0)], pre = signals.reduce((p2, s2) => (p2[s2.name] = s2, p2), {}), map2 = {};
array$5(spec.signals).forEach((s2) => {
if (has$2(pre, s2.name)) {
s2 = extend$2(pre[s2.name], s2);
} else {
signals.push(s2);
}
map2[s2.name] = s2;
});
array$5(config2.signals).forEach((s2) => {
if (!has$2(map2, s2.name) && !has$2(pre, s2.name)) {
signals.push(s2);
}
});
return signals;
}
function Scope(config2, options2) {
this.config = config2 || {};
this.options = options2 || {};
this.bindings = [];
this.field = {};
this.signals = {};
this.lambdas = {};
this.scales = {};
this.events = {};
this.data = {};
this.streams = [];
this.updates = [];
this.operators = [];
this.eventConfig = null;
this.locale = null;
this._id = 0;
this._subid = 0;
this._nextsub = [0];
this._parent = [];
this._encode = [];
this._lookup = [];
this._markpath = [];
}
function Subscope(scope) {
this.config = scope.config;
this.options = scope.options;
this.legends = scope.legends;
this.field = Object.create(scope.field);
this.signals = Object.create(scope.signals);
this.lambdas = Object.create(scope.lambdas);
this.scales = Object.create(scope.scales);
this.events = Object.create(scope.events);
this.data = Object.create(scope.data);
this.streams = [];
this.updates = [];
this.operators = [];
this._id = 0;
this._subid = ++scope._nextsub[0];
this._nextsub = scope._nextsub;
this._parent = scope._parent.slice();
this._encode = scope._encode.slice();
this._lookup = scope._lookup.slice();
this._markpath = scope._markpath;
}
Scope.prototype = Subscope.prototype = {
parse(spec) {
return parseScope(spec, this);
},
fork() {
return new Subscope(this);
},
isSubscope() {
return this._subid > 0;
},
toRuntime() {
this.finish();
return {
description: this.description,
operators: this.operators,
streams: this.streams,
updates: this.updates,
bindings: this.bindings,
eventConfig: this.eventConfig,
locale: this.locale
};
},
id() {
return (this._subid ? this._subid + ":" : 0) + this._id++;
},
add(op) {
this.operators.push(op);
op.id = this.id();
if (op.refs) {
op.refs.forEach((ref2) => {
ref2.$ref = op.id;
});
op.refs = null;
}
return op;
},
proxy(op) {
const vref = op instanceof Entry ? ref(op) : op;
return this.add(Proxy$1({
value: vref
}));
},
addStream(stream2) {
this.streams.push(stream2);
stream2.id = this.id();
return stream2;
},
addUpdate(update2) {
this.updates.push(update2);
return update2;
},
// Apply metadata
finish() {
let name, ds;
if (this.root)
this.root.root = true;
for (name in this.signals) {
this.signals[name].signal = name;
}
for (name in this.scales) {
this.scales[name].scale = name;
}
function annotate(op, name2, type2) {
let data2, list;
if (op) {
data2 = op.data || (op.data = {});
list = data2[name2] || (data2[name2] = []);
list.push(type2);
}
}
for (name in this.data) {
ds = this.data[name];
annotate(ds.input, name, "input");
annotate(ds.output, name, "output");
annotate(ds.values, name, "values");
for (const field2 in ds.index) {
annotate(ds.index[field2], name, "index:" + field2);
}
}
return this;
},
// ----
pushState(encode2, parent, lookup10) {
this._encode.push(ref(this.add(Sieve({
pulse: encode2
}))));
this._parent.push(parent);
this._lookup.push(lookup10 ? ref(this.proxy(lookup10)) : null);
this._markpath.push(-1);
},
popState() {
this._encode.pop();
this._parent.pop();
this._lookup.pop();
this._markpath.pop();
},
parent() {
return peek$1(this._parent);
},
encode() {
return peek$1(this._encode);
},
lookup() {
return peek$1(this._lookup);
},
markpath() {
const p2 = this._markpath;
return ++p2[p2.length - 1];
},
// ----
fieldRef(field2, name) {
if (isString(field2))
return fieldRef$1(field2, name);
if (!field2.signal) {
error2("Unsupported field reference: " + $$h(field2));
}
const s2 = field2.signal;
let f2 = this.field[s2];
if (!f2) {
const params2 = {
name: this.signalRef(s2)
};
if (name)
params2.as = name;
this.field[s2] = f2 = ref(this.add(Field(params2)));
}
return f2;
},
compareRef(cmp) {
let signal = false;
const check2 = (_24) => isSignal(_24) ? (signal = true, this.signalRef(_24.signal)) : isExpr$1(_24) ? (signal = true, this.exprRef(_24.expr)) : _24;
const fields = array$5(cmp.field).map(check2), orders = array$5(cmp.order).map(check2);
return signal ? ref(this.add(Compare({
fields,
orders
}))) : compareRef(fields, orders);
},
keyRef(fields, flat) {
let signal = false;
const check2 = (_24) => isSignal(_24) ? (signal = true, ref(sig[_24.signal])) : _24;
const sig = this.signals;
fields = array$5(fields).map(check2);
return signal ? ref(this.add(Key({
fields,
flat
}))) : keyRef(fields, flat);
},
sortRef(sort2) {
if (!sort2)
return sort2;
const a2 = aggrField(sort2.op, sort2.field), o2 = sort2.order || Ascending;
return o2.signal ? ref(this.add(Compare({
fields: a2,
orders: this.signalRef(o2.signal)
}))) : compareRef(a2, o2);
},
// ----
event(source2, type2) {
const key2 = source2 + ":" + type2;
if (!this.events[key2]) {
const id = this.id();
this.streams.push({
id,
source: source2,
type: type2
});
this.events[key2] = id;
}
return this.events[key2];
},
// ----
hasOwnSignal(name) {
return has$2(this.signals, name);
},
addSignal(name, value2) {
if (this.hasOwnSignal(name)) {
error2("Duplicate signal name: " + $$h(name));
}
const op = value2 instanceof Entry ? value2 : this.add(operator(value2));
return this.signals[name] = op;
},
getSignal(name) {
if (!this.signals[name]) {
error2("Unrecognized signal name: " + $$h(name));
}
return this.signals[name];
},
signalRef(s2) {
if (this.signals[s2]) {
return ref(this.signals[s2]);
} else if (!has$2(this.lambdas, s2)) {
this.lambdas[s2] = this.add(operator(null));
}
return ref(this.lambdas[s2]);
},
parseLambdas() {
const code = Object.keys(this.lambdas);
for (let i2 = 0, n2 = code.length; i2 < n2; ++i2) {
const s2 = code[i2], e7 = parser(s2, this), op = this.lambdas[s2];
op.params = e7.$params;
op.update = e7.$expr;
}
},
property(spec) {
return spec && spec.signal ? this.signalRef(spec.signal) : spec;
},
objectProperty(spec) {
return !spec || !isObject$a(spec) ? spec : this.signalRef(spec.signal || propertyLambda(spec));
},
exprRef(code, name) {
const params2 = {
expr: parser(code, this)
};
if (name)
params2.expr.$name = name;
return ref(this.add(Expression(params2)));
},
addBinding(name, bind2) {
if (!this.bindings) {
error2("Nested signals do not support binding: " + $$h(name));
}
this.bindings.push(extend$2({
signal: name
}, bind2));
},
// ----
addScaleProj(name, transform2) {
if (has$2(this.scales, name)) {
error2("Duplicate scale or projection name: " + $$h(name));
}
this.scales[name] = this.add(transform2);
},
addScale(name, params2) {
this.addScaleProj(name, Scale$1(params2));
},
addProjection(name, params2) {
this.addScaleProj(name, Projection(params2));
},
getScale(name) {
if (!this.scales[name]) {
error2("Unrecognized scale name: " + $$h(name));
}
return this.scales[name];
},
scaleRef(name) {
return ref(this.getScale(name));
},
scaleType(name) {
return this.getScale(name).params.type;
},
projectionRef(name) {
return this.scaleRef(name);
},
projectionType(name) {
return this.scaleType(name);
},
// ----
addData(name, dataScope) {
if (has$2(this.data, name)) {
error2("Duplicate data set name: " + $$h(name));
}
return this.data[name] = dataScope;
},
getData(name) {
if (!this.data[name]) {
error2("Undefined data set name: " + $$h(name));
}
return this.data[name];
},
addDataPipeline(name, entries) {
if (has$2(this.data, name)) {
error2("Duplicate data set name: " + $$h(name));
}
return this.addData(name, DataScope.fromEntries(this, entries));
}
};
function propertyLambda(spec) {
return (isArray$2(spec) ? arrayLambda : objectLambda)(spec);
}
function arrayLambda(array2) {
const n2 = array2.length;
let code = "[";
for (let i2 = 0; i2 < n2; ++i2) {
const value2 = array2[i2];
code += (i2 > 0 ? "," : "") + (isObject$a(value2) ? value2.signal || propertyLambda(value2) : $$h(value2));
}
return code + "]";
}
function objectLambda(obj) {
let code = "{", i2 = 0, key2, value2;
for (key2 in obj) {
value2 = obj[key2];
code += (++i2 > 1 ? "," : "") + $$h(key2) + ":" + (isObject$a(value2) ? value2.signal || propertyLambda(value2) : $$h(value2));
}
return code + "}";
}
function defaults() {
const defaultFont = "sans-serif", defaultSymbolSize = 30, defaultStrokeWidth = 2, defaultColor = "#4c78a8", black = "#000", gray = "#888", lightGray = "#ddd";
return {
// default visualization description
description: "Vega visualization",
// default padding around visualization
padding: 0,
// default for automatic sizing; options: 'none', 'pad', 'fit'
// or provide an object (e.g., {'type': 'pad', 'resize': true})
autosize: "pad",
// default view background color
// covers the entire view component
background: null,
// default event handling configuration
// preventDefault for view-sourced event types except 'wheel'
events: {
defaults: {
allow: ["wheel"]
}
},
// defaults for top-level group marks
// accepts mark properties (fill, stroke, etc)
// covers the data rectangle within group width/height
group: null,
// defaults for basic mark types
// each subset accepts mark properties (fill, stroke, etc)
mark: null,
arc: {
fill: defaultColor
},
area: {
fill: defaultColor
},
image: null,
line: {
stroke: defaultColor,
strokeWidth: defaultStrokeWidth
},
path: {
stroke: defaultColor
},
rect: {
fill: defaultColor
},
rule: {
stroke: black
},
shape: {
stroke: defaultColor
},
symbol: {
fill: defaultColor,
size: 64
},
text: {
fill: black,
font: defaultFont,
fontSize: 11
},
trail: {
fill: defaultColor,
size: defaultStrokeWidth
},
// style definitions
style: {
// axis & legend labels
"guide-label": {
fill: black,
font: defaultFont,
fontSize: 10
},
// axis & legend titles
"guide-title": {
fill: black,
font: defaultFont,
fontSize: 11,
fontWeight: "bold"
},
// headers, including chart title
"group-title": {
fill: black,
font: defaultFont,
fontSize: 13,
fontWeight: "bold"
},
// chart subtitle
"group-subtitle": {
fill: black,
font: defaultFont,
fontSize: 12
},
// defaults for styled point marks in Vega-Lite
point: {
size: defaultSymbolSize,
strokeWidth: defaultStrokeWidth,
shape: "circle"
},
circle: {
size: defaultSymbolSize,
strokeWidth: defaultStrokeWidth
},
square: {
size: defaultSymbolSize,
strokeWidth: defaultStrokeWidth,
shape: "square"
},
// defaults for styled group marks in Vega-Lite
cell: {
fill: "transparent",
stroke: lightGray
},
view: {
fill: "transparent"
}
},
// defaults for title
title: {
orient: "top",
anchor: "middle",
offset: 4,
subtitlePadding: 3
},
// defaults for axes
axis: {
minExtent: 0,
maxExtent: 200,
bandPosition: 0.5,
domain: true,
domainWidth: 1,
domainColor: gray,
grid: false,
gridWidth: 1,
gridColor: lightGray,
labels: true,
labelAngle: 0,
labelLimit: 180,
labelOffset: 0,
labelPadding: 2,
ticks: true,
tickColor: gray,
tickOffset: 0,
tickRound: true,
tickSize: 5,
tickWidth: 1,
titlePadding: 4
},
// correction for centering bias
axisBand: {
tickOffset: -0.5
},
// defaults for cartographic projection
projection: {
type: "mercator"
},
// defaults for legends
legend: {
orient: "right",
padding: 0,
gridAlign: "each",
columnPadding: 10,
rowPadding: 2,
symbolDirection: "vertical",
gradientDirection: "vertical",
gradientLength: 200,
gradientThickness: 16,
gradientStrokeColor: lightGray,
gradientStrokeWidth: 0,
gradientLabelOffset: 2,
labelAlign: "left",
labelBaseline: "middle",
labelLimit: 160,
labelOffset: 4,
labelOverlap: true,
symbolLimit: 30,
symbolType: "circle",
symbolSize: 100,
symbolOffset: 0,
symbolStrokeWidth: 1.5,
symbolBaseFillColor: "transparent",
symbolBaseStrokeColor: gray,
titleLimit: 180,
titleOrient: "top",
titlePadding: 5,
layout: {
offset: 18,
direction: "horizontal",
left: {
direction: "vertical"
},
right: {
direction: "vertical"
}
}
},
// defaults for scale ranges
range: {
category: {
scheme: "tableau10"
},
ordinal: {
scheme: "blues"
},
heatmap: {
scheme: "yellowgreenblue"
},
ramp: {
scheme: "blues"
},
diverging: {
scheme: "blueorange",
extent: [1, 0]
},
symbol: ["circle", "square", "triangle-up", "cross", "diamond", "triangle-right", "triangle-down", "triangle-left"]
}
};
}
function parse$2(spec, config2, options2) {
if (!isObject$a(spec)) {
error2("Input Vega specification must be an object.");
}
config2 = mergeConfig(defaults(), config2, spec.config);
return parseView(spec, new Scope(config2, options2)).toRuntime();
}
extend$2(transforms, tx, vtx, encode$1, geo, force, label, tree, reg, voronoi, wordcloud, xf);
var u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;
var fleb = new u8([
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
2,
2,
2,
2,
3,
3,
3,
3,
4,
4,
4,
4,
5,
5,
5,
5,
0,
/* unused */
0,
0,
/* impossible */
0
]);
var fdeb = new u8([
0,
0,
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
11,
11,
12,
12,
13,
13,
/* unused */
0,
0
]);
var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
var freb = function(eb2, start2) {
var b2 = new u16(31);
for (var i2 = 0; i2 < 31; ++i2) {
b2[i2] = start2 += 1 << eb2[i2 - 1];
}
var r2 = new u32(b2[30]);
for (var i2 = 1; i2 < 30; ++i2) {
for (var j2 = b2[i2]; j2 < b2[i2 + 1]; ++j2) {
r2[j2] = j2 - b2[i2] << 5 | i2;
}
}
return [b2, r2];
};
var _a$1 = freb(fleb, 2), fl = _a$1[0], revfl = _a$1[1];
fl[28] = 258, revfl[258] = 28;
var _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];
var rev = new u16(32768);
for (var i$d = 0; i$d < 32768; ++i$d) {
var x$2 = (i$d & 43690) >>> 1 | (i$d & 21845) << 1;
x$2 = (x$2 & 52428) >>> 2 | (x$2 & 13107) << 2;
x$2 = (x$2 & 61680) >>> 4 | (x$2 & 3855) << 4;
rev[i$d] = ((x$2 & 65280) >>> 8 | (x$2 & 255) << 8) >>> 1;
}
var hMap = function(cd2, mb2, r2) {
var s2 = cd2.length;
var i2 = 0;
var l2 = new u16(mb2);
for (; i2 < s2; ++i2)
++l2[cd2[i2] - 1];
var le2 = new u16(mb2);
for (i2 = 0; i2 < mb2; ++i2) {
le2[i2] = le2[i2 - 1] + l2[i2 - 1] << 1;
}
var co2;
if (r2) {
co2 = new u16(1 << mb2);
var rvb = 15 - mb2;
for (i2 = 0; i2 < s2; ++i2) {
if (cd2[i2]) {
var sv = i2 << 4 | cd2[i2];
var r_1 = mb2 - cd2[i2];
var v2 = le2[cd2[i2] - 1]++ << r_1;
for (var m2 = v2 | (1 << r_1) - 1; v2 <= m2; ++v2) {
co2[rev[v2] >>> rvb] = sv;
}
}
}
} else {
co2 = new u16(s2);
for (i2 = 0; i2 < s2; ++i2)
co2[i2] = rev[le2[cd2[i2] - 1]++] >>> 15 - cd2[i2];
}
return co2;
};
var flt = new u8(288);
for (var i$d = 0; i$d < 144; ++i$d)
flt[i$d] = 8;
for (var i$d = 144; i$d < 256; ++i$d)
flt[i$d] = 9;
for (var i$d = 256; i$d < 280; ++i$d)
flt[i$d] = 7;
for (var i$d = 280; i$d < 288; ++i$d)
flt[i$d] = 8;
var fdt = new u8(32);
for (var i$d = 0; i$d < 32; ++i$d)
fdt[i$d] = 5;
var flm = /* @__PURE__ */ hMap(flt, 9, 0), flrm = /* @__PURE__ */ hMap(flt, 9, 1);
var fdm = /* @__PURE__ */ hMap(fdt, 5, 0), fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
var max$3 = function(a2) {
var m2 = a2[0];
for (var i2 = 1; i2 < a2.length; ++i2) {
if (a2[i2] > m2)
m2 = a2[i2];
}
return m2;
};
var bits = function(d2, p2, m2) {
var o2 = p2 / 8 >> 0;
return (d2[o2] | d2[o2 + 1] << 8) >>> (p2 & 7) & m2;
};
var bits16 = function(d2, p2) {
var o2 = p2 / 8 >> 0;
return (d2[o2] | d2[o2 + 1] << 8 | d2[o2 + 2] << 16) >>> (p2 & 7);
};
var shft = function(p2) {
return (p2 / 8 >> 0) + (p2 & 7 && 1);
};
var slc = function(v2, s2, e7) {
if (s2 == null || s2 < 0)
s2 = 0;
if (e7 == null || e7 > v2.length)
e7 = v2.length;
var n2 = new (v2 instanceof u16 ? u16 : v2 instanceof u32 ? u32 : u8)(e7 - s2);
n2.set(v2.subarray(s2, e7));
return n2;
};
var inflt = function(dat, buf, st2) {
var sl2 = dat.length;
var noBuf = !buf || st2;
var noSt = !st2 || st2.i;
if (!st2)
st2 = {};
if (!buf)
buf = new u8(sl2 * 3);
var cbuf = function(l3) {
var bl2 = buf.length;
if (l3 > bl2) {
var nbuf = new u8(Math.max(bl2 * 2, l3));
nbuf.set(buf);
buf = nbuf;
}
};
var final = st2.f || 0, pos = st2.p || 0, bt2 = st2.b || 0, lm = st2.l, dm = st2.d, lbt = st2.m, dbt = st2.n;
var tbts = sl2 * 8;
do {
if (!lm) {
st2.f = final = bits(dat, pos, 1);
var type2 = bits(dat, pos + 1, 3);
pos += 3;
if (!type2) {
var s2 = shft(pos) + 4, l2 = dat[s2 - 4] | dat[s2 - 3] << 8, t5 = s2 + l2;
if (t5 > sl2) {
if (noSt)
throw "unexpected EOF";
break;
}
if (noBuf)
cbuf(bt2 + l2);
buf.set(dat.subarray(s2, t5), bt2);
st2.b = bt2 += l2, st2.p = pos = t5 * 8;
continue;
} else if (type2 == 1)
lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
else if (type2 == 2) {
var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
var tl2 = hLit + bits(dat, pos + 5, 31) + 1;
pos += 14;
var ldt = new u8(tl2);
var clt = new u8(19);
for (var i2 = 0; i2 < hcLen; ++i2) {
clt[clim[i2]] = bits(dat, pos + i2 * 3, 7);
}
pos += hcLen * 3;
var clb = max$3(clt), clbmsk = (1 << clb) - 1;
if (!noSt && pos + tl2 * (clb + 7) > tbts)
break;
var clm = hMap(clt, clb, 1);
for (var i2 = 0; i2 < tl2; ) {
var r2 = clm[bits(dat, pos, clbmsk)];
pos += r2 & 15;
var s2 = r2 >>> 4;
if (s2 < 16) {
ldt[i2++] = s2;
} else {
var c2 = 0, n2 = 0;
if (s2 == 16)
n2 = 3 + bits(dat, pos, 3), pos += 2, c2 = ldt[i2 - 1];
else if (s2 == 17)
n2 = 3 + bits(dat, pos, 7), pos += 3;
else if (s2 == 18)
n2 = 11 + bits(dat, pos, 127), pos += 7;
while (n2--)
ldt[i2++] = c2;
}
}
var lt2 = ldt.subarray(0, hLit), dt2 = ldt.subarray(hLit);
lbt = max$3(lt2);
dbt = max$3(dt2);
lm = hMap(lt2, lbt, 1);
dm = hMap(dt2, dbt, 1);
} else
throw "invalid block type";
if (pos > tbts)
throw "unexpected EOF";
}
if (noBuf)
cbuf(bt2 + 131072);
var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
var mxa = lbt + dbt + 18;
while (noSt || pos + mxa < tbts) {
var c2 = lm[bits16(dat, pos) & lms], sym = c2 >>> 4;
pos += c2 & 15;
if (pos > tbts)
throw "unexpected EOF";
if (!c2)
throw "invalid length/literal";
if (sym < 256)
buf[bt2++] = sym;
else if (sym == 256) {
lm = null;
break;
} else {
var add3 = sym - 254;
if (sym > 264) {
var i2 = sym - 257, b2 = fleb[i2];
add3 = bits(dat, pos, (1 << b2) - 1) + fl[i2];
pos += b2;
}
var d2 = dm[bits16(dat, pos) & dms], dsym = d2 >>> 4;
if (!d2)
throw "invalid distance";
pos += d2 & 15;
var dt2 = fd[dsym];
if (dsym > 3) {
var b2 = fdeb[dsym];
dt2 += bits16(dat, pos) & (1 << b2) - 1, pos += b2;
}
if (pos > tbts)
throw "unexpected EOF";
if (noBuf)
cbuf(bt2 + 131072);
var end2 = bt2 + add3;
for (; bt2 < end2; bt2 += 4) {
buf[bt2] = buf[bt2 - dt2];
buf[bt2 + 1] = buf[bt2 + 1 - dt2];
buf[bt2 + 2] = buf[bt2 + 2 - dt2];
buf[bt2 + 3] = buf[bt2 + 3 - dt2];
}
bt2 = end2;
}
}
st2.l = lm, st2.p = pos, st2.b = bt2;
if (lm)
final = 1, st2.m = lbt, st2.d = dm, st2.n = dbt;
} while (!final);
return bt2 == buf.length ? buf : slc(buf, 0, bt2);
};
var wbits = function(d2, p2, v2) {
v2 <<= p2 & 7;
var o2 = p2 / 8 >> 0;
d2[o2] |= v2;
d2[o2 + 1] |= v2 >>> 8;
};
var wbits16 = function(d2, p2, v2) {
v2 <<= p2 & 7;
var o2 = p2 / 8 >> 0;
d2[o2] |= v2;
d2[o2 + 1] |= v2 >>> 8;
d2[o2 + 2] |= v2 >>> 16;
};
var hTree = function(d2, mb2) {
var t5 = [];
for (var i2 = 0; i2 < d2.length; ++i2) {
if (d2[i2])
t5.push({ s: i2, f: d2[i2] });
}
var s2 = t5.length;
var t22 = t5.slice();
if (!s2)
return [new u8(0), 0];
if (s2 == 1) {
var v2 = new u8(t5[0].s + 1);
v2[t5[0].s] = 1;
return [v2, 1];
}
t5.sort(function(a2, b2) {
return a2.f - b2.f;
});
t5.push({ s: -1, f: 25001 });
var l2 = t5[0], r2 = t5[1], i0 = 0, i1 = 1, i22 = 2;
t5[0] = { s: -1, f: l2.f + r2.f, l: l2, r: r2 };
while (i1 != s2 - 1) {
l2 = t5[t5[i0].f < t5[i22].f ? i0++ : i22++];
r2 = t5[i0 != i1 && t5[i0].f < t5[i22].f ? i0++ : i22++];
t5[i1++] = { s: -1, f: l2.f + r2.f, l: l2, r: r2 };
}
var maxSym = t22[0].s;
for (var i2 = 1; i2 < s2; ++i2) {
if (t22[i2].s > maxSym)
maxSym = t22[i2].s;
}
var tr2 = new u16(maxSym + 1);
var mbt = ln$1(t5[i1 - 1], tr2, 0);
if (mbt > mb2) {
var i2 = 0, dt2 = 0;
var lft = mbt - mb2, cst = 1 << lft;
t22.sort(function(a2, b2) {
return tr2[b2.s] - tr2[a2.s] || a2.f - b2.f;
});
for (; i2 < s2; ++i2) {
var i2_1 = t22[i2].s;
if (tr2[i2_1] > mb2) {
dt2 += cst - (1 << mbt - tr2[i2_1]);
tr2[i2_1] = mb2;
} else
break;
}
dt2 >>>= lft;
while (dt2 > 0) {
var i2_2 = t22[i2].s;
if (tr2[i2_2] < mb2)
dt2 -= 1 << mb2 - tr2[i2_2]++ - 1;
else
++i2;
}
for (; i2 >= 0 && dt2; --i2) {
var i2_3 = t22[i2].s;
if (tr2[i2_3] == mb2) {
--tr2[i2_3];
++dt2;
}
}
mbt = mb2;
}
return [new u8(tr2), mbt];
};
var ln$1 = function(n2, l2, d2) {
return n2.s == -1 ? Math.max(ln$1(n2.l, l2, d2 + 1), ln$1(n2.r, l2, d2 + 1)) : l2[n2.s] = d2;
};
var lc$1 = function(c2) {
var s2 = c2.length;
while (s2 && !c2[--s2])
;
var cl = new u16(++s2);
var cli = 0, cln = c2[0], cls = 1;
var w2 = function(v2) {
cl[cli++] = v2;
};
for (var i2 = 1; i2 <= s2; ++i2) {
if (c2[i2] == cln && i2 != s2)
++cls;
else {
if (!cln && cls > 2) {
for (; cls > 138; cls -= 138)
w2(32754);
if (cls > 2) {
w2(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
cls = 0;
}
} else if (cls > 3) {
w2(cln), --cls;
for (; cls > 6; cls -= 6)
w2(8304);
if (cls > 2)
w2(cls - 3 << 5 | 8208), cls = 0;
}
while (cls--)
w2(cln);
cls = 1;
cln = c2[i2];
}
}
return [cl.subarray(0, cli), s2];
};
var clen = function(cf2, cl) {
var l2 = 0;
for (var i2 = 0; i2 < cl.length; ++i2)
l2 += cf2[i2] * cl[i2];
return l2;
};
var wfblk = function(out, pos, dat) {
var s2 = dat.length;
var o2 = shft(pos + 2);
out[o2] = s2 & 255;
out[o2 + 1] = s2 >>> 8;
out[o2 + 2] = out[o2] ^ 255;
out[o2 + 3] = out[o2 + 1] ^ 255;
for (var i2 = 0; i2 < s2; ++i2)
out[o2 + i2 + 4] = dat[i2];
return (o2 + 4 + s2) * 8;
};
var wblk = function(dat, out, final, syms, lf2, df2, eb2, li2, bs, bl2, p2) {
wbits(out, p2++, final);
++lf2[256];
var _a2 = hTree(lf2, 15), dlt = _a2[0], mlb = _a2[1];
var _b2 = hTree(df2, 15), ddt = _b2[0], mdb = _b2[1];
var _c2 = lc$1(dlt), lclt = _c2[0], nlc = _c2[1];
var _d = lc$1(ddt), lcdt = _d[0], ndc = _d[1];
var lcfreq = new u16(19);
for (var i2 = 0; i2 < lclt.length; ++i2)
lcfreq[lclt[i2] & 31]++;
for (var i2 = 0; i2 < lcdt.length; ++i2)
lcfreq[lcdt[i2] & 31]++;
var _e2 = hTree(lcfreq, 7), lct = _e2[0], mlcb = _e2[1];
var nlcc = 19;
for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
;
var flen = bl2 + 5 << 3;
var ftlen = clen(lf2, flt) + clen(df2, fdt) + eb2;
var dtlen = clen(lf2, dlt) + clen(df2, ddt) + eb2 + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);
if (flen <= ftlen && flen <= dtlen)
return wfblk(out, p2, dat.subarray(bs, bs + bl2));
var lm, ll, dm, dl;
wbits(out, p2, 1 + (dtlen < ftlen)), p2 += 2;
if (dtlen < ftlen) {
lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
var llm = hMap(lct, mlcb, 0);
wbits(out, p2, nlc - 257);
wbits(out, p2 + 5, ndc - 1);
wbits(out, p2 + 10, nlcc - 4);
p2 += 14;
for (var i2 = 0; i2 < nlcc; ++i2)
wbits(out, p2 + 3 * i2, lct[clim[i2]]);
p2 += 3 * nlcc;
var lcts = [lclt, lcdt];
for (var it2 = 0; it2 < 2; ++it2) {
var clct = lcts[it2];
for (var i2 = 0; i2 < clct.length; ++i2) {
var len = clct[i2] & 31;
wbits(out, p2, llm[len]), p2 += lct[len];
if (len > 15)
wbits(out, p2, clct[i2] >>> 5 & 127), p2 += clct[i2] >>> 12;
}
}
} else {
lm = flm, ll = flt, dm = fdm, dl = fdt;
}
for (var i2 = 0; i2 < li2; ++i2) {
if (syms[i2] > 255) {
var len = syms[i2] >>> 18 & 31;
wbits16(out, p2, lm[len + 257]), p2 += ll[len + 257];
if (len > 7)
wbits(out, p2, syms[i2] >>> 23 & 31), p2 += fleb[len];
var dst = syms[i2] & 31;
wbits16(out, p2, dm[dst]), p2 += dl[dst];
if (dst > 3)
wbits16(out, p2, syms[i2] >>> 5 & 8191), p2 += fdeb[dst];
} else {
wbits16(out, p2, lm[syms[i2]]), p2 += ll[syms[i2]];
}
}
wbits16(out, p2, lm[256]);
return p2 + ll[256];
};
var deo = /* @__PURE__ */ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
var et$2 = /* @__PURE__ */ new u8(0);
var dflt = function(dat, lvl, plvl, pre, post, lst) {
var s2 = dat.length;
var o2 = new u8(pre + s2 + 5 * (1 + Math.floor(s2 / 7e3)) + post);
var w2 = o2.subarray(pre, o2.length - post);
var pos = 0;
if (!lvl || s2 < 8) {
for (var i2 = 0; i2 <= s2; i2 += 65535) {
var e7 = i2 + 65535;
if (e7 < s2) {
pos = wfblk(w2, pos, dat.subarray(i2, e7));
} else {
w2[i2] = lst;
pos = wfblk(w2, pos, dat.subarray(i2, s2));
}
}
} else {
var opt = deo[lvl - 1];
var n2 = opt >>> 13, c2 = opt & 8191;
var msk_1 = (1 << plvl) - 1;
var prev2 = new u16(32768), head = new u16(msk_1 + 1);
var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
var hsh = function(i3) {
return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
};
var syms = new u32(25e3);
var lf2 = new u16(288), df2 = new u16(32);
var lc_1 = 0, eb2 = 0, i2 = 0, li2 = 0, wi2 = 0, bs = 0;
for (; i2 < s2; ++i2) {
var hv = hsh(i2);
var imod = i2 & 32767;
var pimod = head[hv];
prev2[imod] = pimod;
head[hv] = imod;
if (wi2 <= i2) {
var rem2 = s2 - i2;
if ((lc_1 > 7e3 || li2 > 24576) && rem2 > 423) {
pos = wblk(dat, w2, 0, syms, lf2, df2, eb2, li2, bs, i2 - bs, pos);
li2 = lc_1 = eb2 = 0, bs = i2;
for (var j2 = 0; j2 < 286; ++j2)
lf2[j2] = 0;
for (var j2 = 0; j2 < 30; ++j2)
df2[j2] = 0;
}
var l2 = 2, d2 = 0, ch_1 = c2, dif = imod - pimod & 32767;
if (rem2 > 2 && hv == hsh(i2 - dif)) {
var maxn = Math.min(n2, rem2) - 1;
var maxd = Math.min(32767, i2);
var ml = Math.min(258, rem2);
while (dif <= maxd && --ch_1 && imod != pimod) {
if (dat[i2 + l2] == dat[i2 + l2 - dif]) {
var nl = 0;
for (; nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
;
if (nl > l2) {
l2 = nl, d2 = dif;
if (nl > maxn)
break;
var mmd = Math.min(dif, nl - 2);
var md2 = 0;
for (var j2 = 0; j2 < mmd; ++j2) {
var ti2 = i2 - dif + j2 + 32768 & 32767;
var pti = prev2[ti2];
var cd2 = ti2 - pti + 32768 & 32767;
if (cd2 > md2)
md2 = cd2, pimod = ti2;
}
}
}
imod = pimod, pimod = prev2[imod];
dif += imod - pimod + 32768 & 32767;
}
}
if (d2) {
syms[li2++] = 268435456 | revfl[l2] << 18 | revfd[d2];
var lin = revfl[l2] & 31, din = revfd[d2] & 31;
eb2 += fleb[lin] + fdeb[din];
++lf2[257 + lin];
++df2[din];
wi2 = i2 + l2;
++lc_1;
} else {
syms[li2++] = dat[i2];
++lf2[dat[i2]];
}
}
}
pos = wblk(dat, w2, lst, syms, lf2, df2, eb2, li2, bs, i2 - bs, pos);
if (!lst)
pos = wfblk(w2, pos, et$2);
}
return slc(o2, 0, pre + shft(pos) + post);
};
var adler = function() {
var a2 = 1, b2 = 0;
return {
p: function(d2) {
var n2 = a2, m2 = b2;
var l2 = d2.length;
for (var i2 = 0; i2 != l2; ) {
var e7 = Math.min(i2 + 5552, l2);
for (; i2 < e7; ++i2)
n2 += d2[i2], m2 += n2;
n2 %= 65521, m2 %= 65521;
}
a2 = n2, b2 = m2;
},
d: function() {
return (a2 >>> 8 << 16 | (b2 & 255) << 8 | b2 >>> 8) + ((a2 & 255) << 23) * 2;
}
};
};
var dopt = function(dat, opt, pre, post, st2) {
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 12 + opt.mem, pre, post, !st2);
};
var wbytes = function(d2, b2, v2) {
for (; v2; ++b2)
d2[b2] = v2, v2 >>>= 8;
};
var zlh = function(c2, o2) {
var lv = o2.level, fl2 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;
c2[0] = 120, c2[1] = fl2 << 6 | (fl2 ? 32 - 2 * fl2 : 1);
};
var zlv = function(d2) {
if ((d2[0] & 15) != 8 || d2[0] >>> 4 > 7 || (d2[0] << 8 | d2[1]) % 31)
throw "invalid zlib data";
if (d2[1] & 32)
throw "invalid zlib data: preset dictionaries not supported";
};
function zlibSync(data2, opts) {
if (opts === void 0) {
opts = {};
}
var a2 = adler();
a2.p(data2);
var d2 = dopt(data2, opts, 2, 4);
return zlh(d2, opts), wbytes(d2, d2.length - 4, a2.d()), d2;
}
function unzlibSync(data2, out) {
return inflt((zlv(data2), data2.subarray(2, -4)), out);
}
var n$8 = function() {
return "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this;
}();
function i$c() {
n$8.console && "function" == typeof n$8.console.log && n$8.console.log.apply(n$8.console, arguments);
}
var a$m = { log: i$c, warn: function(t5) {
n$8.console && ("function" == typeof n$8.console.warn ? n$8.console.warn.apply(n$8.console, arguments) : i$c.call(null, arguments));
}, error: function(t5) {
n$8.console && ("function" == typeof n$8.console.error ? n$8.console.error.apply(n$8.console, arguments) : i$c(t5));
} };
function o$k(t5, e7, r2) {
var n2 = new XMLHttpRequest();
n2.open("GET", t5), n2.responseType = "blob", n2.onload = function() {
l$1(n2.response, e7, r2);
}, n2.onerror = function() {
a$m.error("could not download file");
}, n2.send();
}
function s$f(t5) {
var e7 = new XMLHttpRequest();
e7.open("HEAD", t5, false);
try {
e7.send();
} catch (t6) {
}
return e7.status >= 200 && e7.status <= 299;
}
function c$2(t5) {
try {
t5.dispatchEvent(new MouseEvent("click"));
} catch (r2) {
var e7 = document.createEvent("MouseEvents");
e7.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), t5.dispatchEvent(e7);
}
}
var u$7, h$6, l$1 = n$8.saveAs || ("object" !== ("undefined" == typeof window ? "undefined" : _typeof$3(window)) || window !== n$8 ? function() {
} : "undefined" != typeof HTMLAnchorElement && "download" in HTMLAnchorElement.prototype ? function(t5, e7, r2) {
var i2 = n$8.URL || n$8.webkitURL, a2 = document.createElement("a");
e7 = e7 || t5.name || "download", a2.download = e7, a2.rel = "noopener", "string" == typeof t5 ? (a2.href = t5, a2.origin !== location.origin ? s$f(a2.href) ? o$k(t5, e7, r2) : c$2(a2, a2.target = "_blank") : c$2(a2)) : (a2.href = i2.createObjectURL(t5), setTimeout(function() {
i2.revokeObjectURL(a2.href);
}, 4e4), setTimeout(function() {
c$2(a2);
}, 0));
} : "msSaveOrOpenBlob" in navigator ? function(e7, r2, n2) {
if (r2 = r2 || e7.name || "download", "string" == typeof e7)
if (s$f(e7))
o$k(e7, r2, n2);
else {
var i2 = document.createElement("a");
i2.href = e7, i2.target = "_blank", setTimeout(function() {
c$2(i2);
});
}
else
navigator.msSaveOrOpenBlob(function(e8, r3) {
return void 0 === r3 ? r3 = { autoBom: false } : "object" !== _typeof$3(r3) && (a$m.warn("Deprecated: Expected third argument to be a object"), r3 = { autoBom: !r3 }), r3.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e8.type) ? new Blob([String.fromCharCode(65279), e8], { type: e8.type }) : e8;
}(e7, n2), r2);
} : function(e7, r2, i2, a2) {
if ((a2 = a2 || open("", "_blank")) && (a2.document.title = a2.document.body.innerText = "downloading..."), "string" == typeof e7)
return o$k(e7, r2, i2);
var s2 = "application/octet-stream" === e7.type, c2 = /constructor/i.test(n$8.HTMLElement) || n$8.safari, u2 = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((u2 || s2 && c2) && "object" === ("undefined" == typeof FileReader ? "undefined" : _typeof$3(FileReader))) {
var h2 = new FileReader();
h2.onloadend = function() {
var t5 = h2.result;
t5 = u2 ? t5 : t5.replace(/^data:[^;]*;/, "data:attachment/file;"), a2 ? a2.location.href = t5 : location = t5, a2 = null;
}, h2.readAsDataURL(e7);
} else {
var l2 = n$8.URL || n$8.webkitURL, f2 = l2.createObjectURL(e7);
a2 ? a2.location = f2 : location.href = f2, a2 = null, setTimeout(function() {
l2.revokeObjectURL(f2);
}, 4e4);
}
});
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/
function f$3(t5) {
var e7;
t5 = t5 || "", this.ok = false, "#" == t5.charAt(0) && (t5 = t5.substr(1, 6));
t5 = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }[t5 = (t5 = t5.replace(/ /g, "")).toLowerCase()] || t5;
for (var r2 = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(t6) {
return [parseInt(t6[1]), parseInt(t6[2]), parseInt(t6[3])];
} }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(t6) {
return [parseInt(t6[1], 16), parseInt(t6[2], 16), parseInt(t6[3], 16)];
} }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(t6) {
return [parseInt(t6[1] + t6[1], 16), parseInt(t6[2] + t6[2], 16), parseInt(t6[3] + t6[3], 16)];
} }], n2 = 0; n2 < r2.length; n2++) {
var i2 = r2[n2].re, a2 = r2[n2].process, o2 = i2.exec(t5);
o2 && (e7 = a2(o2), this.r = e7[0], this.g = e7[1], this.b = e7[2], this.ok = true);
}
this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.toRGB = function() {
return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
}, this.toHex = function() {
var t6 = this.r.toString(16), e8 = this.g.toString(16), r3 = this.b.toString(16);
return 1 == t6.length && (t6 = "0" + t6), 1 == e8.length && (e8 = "0" + e8), 1 == r3.length && (r3 = "0" + r3), "#" + t6 + e8 + r3;
};
}
/**
* @license
* Joseph Myers does not specify a particular license for his work.
*
* Author: Joseph Myers
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
*
* Modified by: Owen Leong
*/
function d$j(t5, e7) {
var r2 = t5[0], n2 = t5[1], i2 = t5[2], a2 = t5[3];
r2 = g(r2, n2, i2, a2, e7[0], 7, -680876936), a2 = g(a2, r2, n2, i2, e7[1], 12, -389564586), i2 = g(i2, a2, r2, n2, e7[2], 17, 606105819), n2 = g(n2, i2, a2, r2, e7[3], 22, -1044525330), r2 = g(r2, n2, i2, a2, e7[4], 7, -176418897), a2 = g(a2, r2, n2, i2, e7[5], 12, 1200080426), i2 = g(i2, a2, r2, n2, e7[6], 17, -1473231341), n2 = g(n2, i2, a2, r2, e7[7], 22, -45705983), r2 = g(r2, n2, i2, a2, e7[8], 7, 1770035416), a2 = g(a2, r2, n2, i2, e7[9], 12, -1958414417), i2 = g(i2, a2, r2, n2, e7[10], 17, -42063), n2 = g(n2, i2, a2, r2, e7[11], 22, -1990404162), r2 = g(r2, n2, i2, a2, e7[12], 7, 1804603682), a2 = g(a2, r2, n2, i2, e7[13], 12, -40341101), i2 = g(i2, a2, r2, n2, e7[14], 17, -1502002290), r2 = m$h(r2, n2 = g(n2, i2, a2, r2, e7[15], 22, 1236535329), i2, a2, e7[1], 5, -165796510), a2 = m$h(a2, r2, n2, i2, e7[6], 9, -1069501632), i2 = m$h(i2, a2, r2, n2, e7[11], 14, 643717713), n2 = m$h(n2, i2, a2, r2, e7[0], 20, -373897302), r2 = m$h(r2, n2, i2, a2, e7[5], 5, -701558691), a2 = m$h(a2, r2, n2, i2, e7[10], 9, 38016083), i2 = m$h(i2, a2, r2, n2, e7[15], 14, -660478335), n2 = m$h(n2, i2, a2, r2, e7[4], 20, -405537848), r2 = m$h(r2, n2, i2, a2, e7[9], 5, 568446438), a2 = m$h(a2, r2, n2, i2, e7[14], 9, -1019803690), i2 = m$h(i2, a2, r2, n2, e7[3], 14, -187363961), n2 = m$h(n2, i2, a2, r2, e7[8], 20, 1163531501), r2 = m$h(r2, n2, i2, a2, e7[13], 5, -1444681467), a2 = m$h(a2, r2, n2, i2, e7[2], 9, -51403784), i2 = m$h(i2, a2, r2, n2, e7[7], 14, 1735328473), r2 = v$2(r2, n2 = m$h(n2, i2, a2, r2, e7[12], 20, -1926607734), i2, a2, e7[5], 4, -378558), a2 = v$2(a2, r2, n2, i2, e7[8], 11, -2022574463), i2 = v$2(i2, a2, r2, n2, e7[11], 16, 1839030562), n2 = v$2(n2, i2, a2, r2, e7[14], 23, -35309556), r2 = v$2(r2, n2, i2, a2, e7[1], 4, -1530992060), a2 = v$2(a2, r2, n2, i2, e7[4], 11, 1272893353), i2 = v$2(i2, a2, r2, n2, e7[7], 16, -155497632), n2 = v$2(n2, i2, a2, r2, e7[10], 23, -1094730640), r2 = v$2(r2, n2, i2, a2, e7[13], 4, 681279174), a2 = v$2(a2, r2, n2, i2, e7[0], 11, -358537222), i2 = v$2(i2, a2, r2, n2, e7[3], 16, -722521979), n2 = v$2(n2, i2, a2, r2, e7[6], 23, 76029189), r2 = v$2(r2, n2, i2, a2, e7[9], 4, -640364487), a2 = v$2(a2, r2, n2, i2, e7[12], 11, -421815835), i2 = v$2(i2, a2, r2, n2, e7[15], 16, 530742520), r2 = b$1(r2, n2 = v$2(n2, i2, a2, r2, e7[2], 23, -995338651), i2, a2, e7[0], 6, -198630844), a2 = b$1(a2, r2, n2, i2, e7[7], 10, 1126891415), i2 = b$1(i2, a2, r2, n2, e7[14], 15, -1416354905), n2 = b$1(n2, i2, a2, r2, e7[5], 21, -57434055), r2 = b$1(r2, n2, i2, a2, e7[12], 6, 1700485571), a2 = b$1(a2, r2, n2, i2, e7[3], 10, -1894986606), i2 = b$1(i2, a2, r2, n2, e7[10], 15, -1051523), n2 = b$1(n2, i2, a2, r2, e7[1], 21, -2054922799), r2 = b$1(r2, n2, i2, a2, e7[8], 6, 1873313359), a2 = b$1(a2, r2, n2, i2, e7[15], 10, -30611744), i2 = b$1(i2, a2, r2, n2, e7[6], 15, -1560198380), n2 = b$1(n2, i2, a2, r2, e7[13], 21, 1309151649), r2 = b$1(r2, n2, i2, a2, e7[4], 6, -145523070), a2 = b$1(a2, r2, n2, i2, e7[11], 10, -1120210379), i2 = b$1(i2, a2, r2, n2, e7[2], 15, 718787259), n2 = b$1(n2, i2, a2, r2, e7[9], 21, -343485551), t5[0] = _$2(r2, t5[0]), t5[1] = _$2(n2, t5[1]), t5[2] = _$2(i2, t5[2]), t5[3] = _$2(a2, t5[3]);
}
function p$4(t5, e7, r2, n2, i2, a2) {
return e7 = _$2(_$2(e7, t5), _$2(n2, a2)), _$2(e7 << i2 | e7 >>> 32 - i2, r2);
}
function g(t5, e7, r2, n2, i2, a2, o2) {
return p$4(e7 & r2 | ~e7 & n2, t5, e7, i2, a2, o2);
}
function m$h(t5, e7, r2, n2, i2, a2, o2) {
return p$4(e7 & n2 | r2 & ~n2, t5, e7, i2, a2, o2);
}
function v$2(t5, e7, r2, n2, i2, a2, o2) {
return p$4(e7 ^ r2 ^ n2, t5, e7, i2, a2, o2);
}
function b$1(t5, e7, r2, n2, i2, a2, o2) {
return p$4(r2 ^ (e7 | ~n2), t5, e7, i2, a2, o2);
}
function y$4(t5) {
var e7, r2 = t5.length, n2 = [1732584193, -271733879, -1732584194, 271733878];
for (e7 = 64; e7 <= t5.length; e7 += 64)
d$j(n2, w$1(t5.substring(e7 - 64, e7)));
t5 = t5.substring(e7 - 64);
var i2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (e7 = 0; e7 < t5.length; e7++)
i2[e7 >> 2] |= t5.charCodeAt(e7) << (e7 % 4 << 3);
if (i2[e7 >> 2] |= 128 << (e7 % 4 << 3), e7 > 55)
for (d$j(n2, i2), e7 = 0; e7 < 16; e7++)
i2[e7] = 0;
return i2[14] = 8 * r2, d$j(n2, i2), n2;
}
function w$1(t5) {
var e7, r2 = [];
for (e7 = 0; e7 < 64; e7 += 4)
r2[e7 >> 2] = t5.charCodeAt(e7) + (t5.charCodeAt(e7 + 1) << 8) + (t5.charCodeAt(e7 + 2) << 16) + (t5.charCodeAt(e7 + 3) << 24);
return r2;
}
u$7 = n$8.atob.bind(n$8), h$6 = n$8.btoa.bind(n$8);
var N$2 = "0123456789abcdef".split("");
function L$2(t5) {
for (var e7 = "", r2 = 0; r2 < 4; r2++)
e7 += N$2[t5 >> 8 * r2 + 4 & 15] + N$2[t5 >> 8 * r2 & 15];
return e7;
}
function A$2(t5) {
return String.fromCharCode((255 & t5) >> 0, (65280 & t5) >> 8, (16711680 & t5) >> 16, (4278190080 & t5) >> 24);
}
function x$1(t5) {
return y$4(t5).map(A$2).join("");
}
var S$1 = "5d41402abc4b2a76b9719d911017c592" != function(t5) {
for (var e7 = 0; e7 < t5.length; e7++)
t5[e7] = L$2(t5[e7]);
return t5.join("");
}(y$4("hello"));
function _$2(t5, e7) {
if (S$1) {
var r2 = (65535 & t5) + (65535 & e7);
return (t5 >> 16) + (e7 >> 16) + (r2 >> 16) << 16 | 65535 & r2;
}
return t5 + e7 & 4294967295;
}
/**
* @license
* FPDF is released under a permissive license: there is no usage restriction.
* You may embed it freely in your application (commercial or not), with or
* without modifications.
*
* Reference: http://www.fpdf.org/en/script/script37.php
*/
function P$1(t5, e7) {
var r2, n2, i2, a2;
if (t5 !== r2) {
for (var o2 = (i2 = t5, a2 = 1 + (256 / t5.length >> 0), new Array(a2 + 1).join(i2)), s2 = [], c2 = 0; c2 < 256; c2++)
s2[c2] = c2;
var u2 = 0;
for (c2 = 0; c2 < 256; c2++) {
var h2 = s2[c2];
u2 = (u2 + h2 + o2.charCodeAt(c2)) % 256, s2[c2] = s2[u2], s2[u2] = h2;
}
r2 = t5, n2 = s2;
} else
s2 = n2;
var l2 = e7.length, f2 = 0, d2 = 0, p2 = "";
for (c2 = 0; c2 < l2; c2++)
d2 = (d2 + (h2 = s2[f2 = (f2 + 1) % 256])) % 256, s2[f2] = s2[d2], s2[d2] = h2, o2 = s2[(s2[f2] + s2[d2]) % 256], p2 += String.fromCharCode(e7.charCodeAt(c2) ^ o2);
return p2;
}
/**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
* Author: Owen Leong (@owenl131)
* Date: 15 Oct 2020
* References:
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
* http://www.fpdf.org/en/script/script37.php
*/
var k$1 = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function I$1(t5, e7, r2, n2) {
this.v = 1, this.r = 2;
var i2 = 192;
t5.forEach(function(t6) {
if (void 0 !== k$1.perm)
throw new Error("Invalid permission: " + t6);
i2 += k$1[t6];
}), this.padding = "(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";
var a2 = (e7 + this.padding).substr(0, 32), o2 = (r2 + this.padding).substr(0, 32);
this.O = this.processOwnerPassword(a2, o2), this.P = -(1 + (255 ^ i2)), this.encryptionKey = x$1(a2 + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(n2)).substr(0, 5), this.U = P$1(this.encryptionKey, this.padding);
}
function F$2(t5) {
if (/[^\u0000-\u00ff]/.test(t5))
throw new Error("Invalid PDF Name Object: " + t5 + ", Only accept ASCII characters.");
for (var e7 = "", r2 = t5.length, n2 = 0; n2 < r2; n2++) {
var i2 = t5.charCodeAt(n2);
if (i2 < 33 || 35 === i2 || 37 === i2 || 40 === i2 || 41 === i2 || 47 === i2 || 60 === i2 || 62 === i2 || 91 === i2 || 93 === i2 || 123 === i2 || 125 === i2 || i2 > 126)
e7 += "#" + ("0" + i2.toString(16)).slice(-2);
else
e7 += t5[n2];
}
return e7;
}
function C$1(e7) {
if ("object" !== _typeof$3(e7))
throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
var r2 = {};
this.subscribe = function(t5, e8, n2) {
if (n2 = n2 || false, "string" != typeof t5 || "function" != typeof e8 || "boolean" != typeof n2)
throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
r2.hasOwnProperty(t5) || (r2[t5] = {});
var i2 = Math.random().toString(35);
return r2[t5][i2] = [e8, !!n2], i2;
}, this.unsubscribe = function(t5) {
for (var e8 in r2)
if (r2[e8][t5])
return delete r2[e8][t5], 0 === Object.keys(r2[e8]).length && delete r2[e8], true;
return false;
}, this.publish = function(t5) {
if (r2.hasOwnProperty(t5)) {
var i2 = Array.prototype.slice.call(arguments, 1), o2 = [];
for (var s2 in r2[t5]) {
var c2 = r2[t5][s2];
try {
c2[0].apply(e7, i2);
} catch (t6) {
n$8.console && a$m.error("jsPDF PubSub Error", t6.message, t6);
}
c2[1] && o2.push(s2);
}
o2.length && o2.forEach(this.unsubscribe);
}
}, this.getTopics = function() {
return r2;
};
}
function j$1(t5) {
if (!(this instanceof j$1))
return new j$1(t5);
var e7 = "opacity,stroke-opacity".split(",");
for (var r2 in t5)
t5.hasOwnProperty(r2) && e7.indexOf(r2) >= 0 && (this[r2] = t5[r2]);
this.id = "", this.objectNumber = -1;
}
function O$2(t5, e7) {
this.gState = t5, this.matrix = e7, this.id = "", this.objectNumber = -1;
}
function B$1(t5, e7, r2, n2, i2) {
if (!(this instanceof B$1))
return new B$1(t5, e7, r2, n2, i2);
this.type = "axial" === t5 ? 2 : 3, this.coords = e7, this.colors = r2, O$2.call(this, n2, i2);
}
function M$6(t5, e7, r2, n2, i2) {
if (!(this instanceof M$6))
return new M$6(t5, e7, r2, n2, i2);
this.boundingBox = t5, this.xStep = e7, this.yStep = r2, this.stream = "", this.cloneIndex = 0, O$2.call(this, n2, i2);
}
function E$2(e7) {
var r2, i2 = "string" == typeof arguments[0] ? arguments[0] : "p", o2 = arguments[1], s2 = arguments[2], c2 = arguments[3], u2 = [], d2 = 1, p2 = 16, g2 = "S", m2 = null;
"object" === _typeof$3(e7 = e7 || {}) && (i2 = e7.orientation, o2 = e7.unit || o2, s2 = e7.format || s2, c2 = e7.compress || e7.compressPdf || c2, null !== (m2 = e7.encryption || null) && (m2.userPassword = m2.userPassword || "", m2.ownerPassword = m2.ownerPassword || "", m2.userPermissions = m2.userPermissions || []), d2 = "number" == typeof e7.userUnit ? Math.abs(e7.userUnit) : 1, void 0 !== e7.precision && (r2 = e7.precision), void 0 !== e7.floatPrecision && (p2 = e7.floatPrecision), g2 = e7.defaultPathOperation || "S"), u2 = e7.filters || (true === c2 ? ["FlateEncode"] : u2), o2 = o2 || "mm", i2 = ("" + (i2 || "P")).toLowerCase();
var v2 = e7.putOnlyUsedFonts || false, b2 = {}, y2 = { internal: {}, __private__: {} };
y2.__private__.PubSub = C$1;
var w2 = "1.3", N2 = y2.__private__.getPdfVersion = function() {
return w2;
};
y2.__private__.setPdfVersion = function(t5) {
w2 = t5;
};
var L2 = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
y2.__private__.getPageFormats = function() {
return L2;
};
var A5 = y2.__private__.getPageFormat = function(t5) {
return L2[t5];
};
s2 = s2 || "a4";
var x2 = { COMPAT: "compat", ADVANCED: "advanced" }, S2 = x2.COMPAT;
function _24() {
this.saveGraphicsState(), lt2(new Vt2(_t2, 0, 0, -_t2, 0, Rr2() * _t2).toString() + " cm"), this.setFontSize(this.getFontSize() / _t2), g2 = "n", S2 = x2.ADVANCED;
}
function P2() {
this.restoreGraphicsState(), g2 = "S", S2 = x2.COMPAT;
}
var k2 = y2.__private__.combineFontStyleAndFontWeight = function(t5, e8) {
if ("bold" == t5 && "normal" == e8 || "bold" == t5 && 400 == e8 || "normal" == t5 && "italic" == e8 || "bold" == t5 && "italic" == e8)
throw new Error("Invalid Combination of fontweight and fontstyle");
return e8 && (t5 = 400 == e8 || "normal" === e8 ? "italic" === t5 ? "italic" : "normal" : 700 != e8 && "bold" !== e8 || "normal" !== t5 ? (700 == e8 ? "bold" : e8) + "" + t5 : "bold"), t5;
};
y2.advancedAPI = function(t5) {
var e8 = S2 === x2.COMPAT;
return e8 && _24.call(this), "function" != typeof t5 || (t5(this), e8 && P2.call(this)), this;
}, y2.compatAPI = function(t5) {
var e8 = S2 === x2.ADVANCED;
return e8 && P2.call(this), "function" != typeof t5 || (t5(this), e8 && _24.call(this)), this;
}, y2.isAdvancedAPI = function() {
return S2 === x2.ADVANCED;
};
var O2, q2 = function(t5) {
if (S2 !== x2.ADVANCED)
throw new Error(t5 + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
}, D2 = y2.roundToPrecision = y2.__private__.roundToPrecision = function(t5, e8) {
var n2 = r2 || e8;
if (isNaN(t5) || isNaN(n2))
throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
return t5.toFixed(n2).replace(/0+$/, "");
};
O2 = y2.hpf = y2.__private__.hpf = "number" == typeof p2 ? function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.hpf");
return D2(t5, p2);
} : "smart" === p2 ? function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.hpf");
return D2(t5, t5 > -1 && t5 < 1 ? 16 : 5);
} : function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.hpf");
return D2(t5, 16);
};
var R2 = y2.f2 = y2.__private__.f2 = function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.f2");
return D2(t5, 2);
}, T2 = y2.__private__.f3 = function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.f3");
return D2(t5, 3);
}, U2 = y2.scale = y2.__private__.scale = function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.scale");
return S2 === x2.COMPAT ? t5 * _t2 : S2 === x2.ADVANCED ? t5 : void 0;
}, z2 = function(t5) {
return S2 === x2.COMPAT ? Rr2() - t5 : S2 === x2.ADVANCED ? t5 : void 0;
}, H4 = function(t5) {
return U2(z2(t5));
};
y2.__private__.setPrecision = y2.setPrecision = function(t5) {
"number" == typeof parseInt(t5, 10) && (r2 = parseInt(t5, 10));
};
var W2, V2 = "00000000000000000000000000000000", G2 = y2.__private__.getFileId = function() {
return V2;
}, Y3 = y2.__private__.setFileId = function(t5) {
return V2 = void 0 !== t5 && /^[a-fA-F0-9]{32}$/.test(t5) ? t5.toUpperCase() : V2.split("").map(function() {
return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
}).join(""), null !== m2 && (Ye2 = new I$1(m2.userPermissions, m2.userPassword, m2.ownerPassword, V2)), V2;
};
y2.setFileId = function(t5) {
return Y3(t5), this;
}, y2.getFileId = function() {
return G2();
};
var J2 = y2.__private__.convertDateToPDFDate = function(t5) {
var e8 = t5.getTimezoneOffset(), r3 = e8 < 0 ? "+" : "-", n2 = Math.floor(Math.abs(e8 / 60)), i3 = Math.abs(e8 % 60), a2 = [r3, Q2(n2), "'", Q2(i3), "'"].join("");
return ["D:", t5.getFullYear(), Q2(t5.getMonth() + 1), Q2(t5.getDate()), Q2(t5.getHours()), Q2(t5.getMinutes()), Q2(t5.getSeconds()), a2].join("");
}, X3 = y2.__private__.convertPDFDateToDate = function(t5) {
var e8 = parseInt(t5.substr(2, 4), 10), r3 = parseInt(t5.substr(6, 2), 10) - 1, n2 = parseInt(t5.substr(8, 2), 10), i3 = parseInt(t5.substr(10, 2), 10), a2 = parseInt(t5.substr(12, 2), 10), o3 = parseInt(t5.substr(14, 2), 10);
return new Date(e8, r3, n2, i3, a2, o3, 0);
}, K2 = y2.__private__.setCreationDate = function(t5) {
var e8;
if (void 0 === t5 && (t5 = /* @__PURE__ */ new Date()), t5 instanceof Date)
e8 = J2(t5);
else {
if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t5))
throw new Error("Invalid argument passed to jsPDF.setCreationDate");
e8 = t5;
}
return W2 = e8;
}, Z3 = y2.__private__.getCreationDate = function(t5) {
var e8 = W2;
return "jsDate" === t5 && (e8 = X3(W2)), e8;
};
y2.setCreationDate = function(t5) {
return K2(t5), this;
}, y2.getCreationDate = function(t5) {
return Z3(t5);
};
var $2, Q2 = y2.__private__.padd2 = function(t5) {
return ("0" + parseInt(t5)).slice(-2);
}, tt2 = y2.__private__.padd2Hex = function(t5) {
return ("00" + (t5 = t5.toString())).substr(t5.length);
}, et2 = 0, rt2 = [], nt2 = [], it2 = 0, at2 = [], ot2 = [], st2 = false, ct2 = nt2, ut2 = function() {
et2 = 0, it2 = 0, nt2 = [], rt2 = [], at2 = [], Qt2 = Kt2(), te2 = Kt2();
};
y2.__private__.setCustomOutputDestination = function(t5) {
st2 = true, ct2 = t5;
};
var ht2 = function(t5) {
st2 || (ct2 = t5);
};
y2.__private__.resetCustomOutputDestination = function() {
st2 = false, ct2 = nt2;
};
var lt2 = y2.__private__.out = function(t5) {
return t5 = t5.toString(), it2 += t5.length + 1, ct2.push(t5), ct2;
}, ft2 = y2.__private__.write = function(t5) {
return lt2(1 === arguments.length ? t5.toString() : Array.prototype.join.call(arguments, " "));
}, dt2 = y2.__private__.getArrayBuffer = function(t5) {
for (var e8 = t5.length, r3 = new ArrayBuffer(e8), n2 = new Uint8Array(r3); e8--; )
n2[e8] = t5.charCodeAt(e8);
return r3;
}, pt2 = [["Helvetica", "helvetica", "normal", "WinAnsiEncoding"], ["Helvetica-Bold", "helvetica", "bold", "WinAnsiEncoding"], ["Helvetica-Oblique", "helvetica", "italic", "WinAnsiEncoding"], ["Helvetica-BoldOblique", "helvetica", "bolditalic", "WinAnsiEncoding"], ["Courier", "courier", "normal", "WinAnsiEncoding"], ["Courier-Bold", "courier", "bold", "WinAnsiEncoding"], ["Courier-Oblique", "courier", "italic", "WinAnsiEncoding"], ["Courier-BoldOblique", "courier", "bolditalic", "WinAnsiEncoding"], ["Times-Roman", "times", "normal", "WinAnsiEncoding"], ["Times-Bold", "times", "bold", "WinAnsiEncoding"], ["Times-Italic", "times", "italic", "WinAnsiEncoding"], ["Times-BoldItalic", "times", "bolditalic", "WinAnsiEncoding"], ["ZapfDingbats", "zapfdingbats", "normal", null], ["Symbol", "symbol", "normal", null]];
y2.__private__.getStandardFonts = function() {
return pt2;
};
var gt2 = e7.fontSize || 16;
y2.__private__.setFontSize = y2.setFontSize = function(t5) {
return gt2 = S2 === x2.ADVANCED ? t5 / _t2 : t5, this;
};
var mt2, vt2 = y2.__private__.getFontSize = y2.getFontSize = function() {
return S2 === x2.COMPAT ? gt2 : gt2 * _t2;
}, bt2 = e7.R2L || false;
y2.__private__.setR2L = y2.setR2L = function(t5) {
return bt2 = t5, this;
}, y2.__private__.getR2L = y2.getR2L = function() {
return bt2;
};
var yt2, wt2 = y2.__private__.setZoomMode = function(t5) {
var e8 = [void 0, null, "fullwidth", "fullheight", "fullpage", "original"];
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t5))
mt2 = t5;
else if (isNaN(t5)) {
if (-1 === e8.indexOf(t5))
throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + t5 + '" is not recognized.');
mt2 = t5;
} else
mt2 = parseInt(t5, 10);
};
y2.__private__.getZoomMode = function() {
return mt2;
};
var Nt2, Lt2 = y2.__private__.setPageMode = function(t5) {
if (-1 == [void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(t5))
throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + t5 + '" is not recognized.');
yt2 = t5;
};
y2.__private__.getPageMode = function() {
return yt2;
};
var At2 = y2.__private__.setLayoutMode = function(t5) {
if (-1 == [void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(t5))
throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + t5 + '" is not recognized.');
Nt2 = t5;
};
y2.__private__.getLayoutMode = function() {
return Nt2;
}, y2.__private__.setDisplayMode = y2.setDisplayMode = function(t5, e8, r3) {
return wt2(t5), At2(e8), Lt2(r3), this;
};
var xt2 = { title: "", subject: "", author: "", keywords: "", creator: "" };
y2.__private__.getDocumentProperty = function(t5) {
if (-1 === Object.keys(xt2).indexOf(t5))
throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
return xt2[t5];
}, y2.__private__.getDocumentProperties = function() {
return xt2;
}, y2.__private__.setDocumentProperties = y2.setProperties = y2.setDocumentProperties = function(t5) {
for (var e8 in xt2)
xt2.hasOwnProperty(e8) && t5[e8] && (xt2[e8] = t5[e8]);
return this;
}, y2.__private__.setDocumentProperty = function(t5, e8) {
if (-1 === Object.keys(xt2).indexOf(t5))
throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
return xt2[t5] = e8;
};
var St2, _t2, Pt2, kt2, It2, Ft2 = {}, Ct2 = {}, jt2 = [], Ot2 = {}, Bt2 = {}, Mt2 = {}, Et2 = {}, qt2 = null, Dt2 = 0, Rt2 = [], Tt2 = new C$1(y2), Ut2 = e7.hotfixes || [], zt2 = {}, Ht2 = {}, Wt2 = [], Vt2 = function t5(e8, r3, n2, i3, a2, o3) {
if (!(this instanceof t5))
return new t5(e8, r3, n2, i3, a2, o3);
isNaN(e8) && (e8 = 1), isNaN(r3) && (r3 = 0), isNaN(n2) && (n2 = 0), isNaN(i3) && (i3 = 1), isNaN(a2) && (a2 = 0), isNaN(o3) && (o3 = 0), this._matrix = [e8, r3, n2, i3, a2, o3];
};
Object.defineProperty(Vt2.prototype, "sx", { get: function() {
return this._matrix[0];
}, set: function(t5) {
this._matrix[0] = t5;
} }), Object.defineProperty(Vt2.prototype, "shy", { get: function() {
return this._matrix[1];
}, set: function(t5) {
this._matrix[1] = t5;
} }), Object.defineProperty(Vt2.prototype, "shx", { get: function() {
return this._matrix[2];
}, set: function(t5) {
this._matrix[2] = t5;
} }), Object.defineProperty(Vt2.prototype, "sy", { get: function() {
return this._matrix[3];
}, set: function(t5) {
this._matrix[3] = t5;
} }), Object.defineProperty(Vt2.prototype, "tx", { get: function() {
return this._matrix[4];
}, set: function(t5) {
this._matrix[4] = t5;
} }), Object.defineProperty(Vt2.prototype, "ty", { get: function() {
return this._matrix[5];
}, set: function(t5) {
this._matrix[5] = t5;
} }), Object.defineProperty(Vt2.prototype, "a", { get: function() {
return this._matrix[0];
}, set: function(t5) {
this._matrix[0] = t5;
} }), Object.defineProperty(Vt2.prototype, "b", { get: function() {
return this._matrix[1];
}, set: function(t5) {
this._matrix[1] = t5;
} }), Object.defineProperty(Vt2.prototype, "c", { get: function() {
return this._matrix[2];
}, set: function(t5) {
this._matrix[2] = t5;
} }), Object.defineProperty(Vt2.prototype, "d", { get: function() {
return this._matrix[3];
}, set: function(t5) {
this._matrix[3] = t5;
} }), Object.defineProperty(Vt2.prototype, "e", { get: function() {
return this._matrix[4];
}, set: function(t5) {
this._matrix[4] = t5;
} }), Object.defineProperty(Vt2.prototype, "f", { get: function() {
return this._matrix[5];
}, set: function(t5) {
this._matrix[5] = t5;
} }), Object.defineProperty(Vt2.prototype, "rotation", { get: function() {
return Math.atan2(this.shx, this.sx);
} }), Object.defineProperty(Vt2.prototype, "scaleX", { get: function() {
return this.decompose().scale.sx;
} }), Object.defineProperty(Vt2.prototype, "scaleY", { get: function() {
return this.decompose().scale.sy;
} }), Object.defineProperty(Vt2.prototype, "isIdentity", { get: function() {
return 1 === this.sx && (0 === this.shy && (0 === this.shx && (1 === this.sy && (0 === this.tx && 0 === this.ty))));
} }), Vt2.prototype.join = function(t5) {
return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(O2).join(t5);
}, Vt2.prototype.multiply = function(t5) {
var e8 = t5.sx * this.sx + t5.shy * this.shx, r3 = t5.sx * this.shy + t5.shy * this.sy, n2 = t5.shx * this.sx + t5.sy * this.shx, i3 = t5.shx * this.shy + t5.sy * this.sy, a2 = t5.tx * this.sx + t5.ty * this.shx + this.tx, o3 = t5.tx * this.shy + t5.ty * this.sy + this.ty;
return new Vt2(e8, r3, n2, i3, a2, o3);
}, Vt2.prototype.decompose = function() {
var t5 = this.sx, e8 = this.shy, r3 = this.shx, n2 = this.sy, i3 = this.tx, a2 = this.ty, o3 = Math.sqrt(t5 * t5 + e8 * e8), s3 = (t5 /= o3) * r3 + (e8 /= o3) * n2;
r3 -= t5 * s3, n2 -= e8 * s3;
var c3 = Math.sqrt(r3 * r3 + n2 * n2);
return s3 /= c3, t5 * (n2 /= c3) < e8 * (r3 /= c3) && (t5 = -t5, e8 = -e8, s3 = -s3, o3 = -o3), { scale: new Vt2(o3, 0, 0, c3, 0, 0), translate: new Vt2(1, 0, 0, 1, i3, a2), rotate: new Vt2(t5, e8, -e8, t5, 0, 0), skew: new Vt2(1, 0, s3, 1, 0, 0) };
}, Vt2.prototype.toString = function(t5) {
return this.join(" ");
}, Vt2.prototype.inversed = function() {
var t5 = this.sx, e8 = this.shy, r3 = this.shx, n2 = this.sy, i3 = this.tx, a2 = this.ty, o3 = 1 / (t5 * n2 - e8 * r3), s3 = n2 * o3, c3 = -e8 * o3, u3 = -r3 * o3, h2 = t5 * o3;
return new Vt2(s3, c3, u3, h2, -s3 * i3 - u3 * a2, -c3 * i3 - h2 * a2);
}, Vt2.prototype.applyToPoint = function(t5) {
var e8 = t5.x * this.sx + t5.y * this.shx + this.tx, r3 = t5.x * this.shy + t5.y * this.sy + this.ty;
return new Cr2(e8, r3);
}, Vt2.prototype.applyToRectangle = function(t5) {
var e8 = this.applyToPoint(t5), r3 = this.applyToPoint(new Cr2(t5.x + t5.w, t5.y + t5.h));
return new jr2(e8.x, e8.y, r3.x - e8.x, r3.y - e8.y);
}, Vt2.prototype.clone = function() {
var t5 = this.sx, e8 = this.shy, r3 = this.shx, n2 = this.sy, i3 = this.tx, a2 = this.ty;
return new Vt2(t5, e8, r3, n2, i3, a2);
}, y2.Matrix = Vt2;
var Gt2 = y2.matrixMult = function(t5, e8) {
return e8.multiply(t5);
}, Yt2 = new Vt2(1, 0, 0, 1, 0, 0);
y2.unitMatrix = y2.identityMatrix = Yt2;
var Jt2 = function(t5, e8) {
if (!Bt2[t5]) {
var r3 = (e8 instanceof B$1 ? "Sh" : "P") + (Object.keys(Ot2).length + 1).toString(10);
e8.id = r3, Bt2[t5] = r3, Ot2[r3] = e8, Tt2.publish("addPattern", e8);
}
};
y2.ShadingPattern = B$1, y2.TilingPattern = M$6, y2.addShadingPattern = function(t5, e8) {
return q2("addShadingPattern()"), Jt2(t5, e8), this;
}, y2.beginTilingPattern = function(t5) {
q2("beginTilingPattern()"), Br2(t5.boundingBox[0], t5.boundingBox[1], t5.boundingBox[2] - t5.boundingBox[0], t5.boundingBox[3] - t5.boundingBox[1], t5.matrix);
}, y2.endTilingPattern = function(t5, e8) {
q2("endTilingPattern()"), e8.stream = ot2[$2].join("\n"), Jt2(t5, e8), Tt2.publish("endTilingPattern", e8), Wt2.pop().restore();
};
var Xt2 = y2.__private__.newObject = function() {
var t5 = Kt2();
return Zt2(t5, true), t5;
}, Kt2 = y2.__private__.newObjectDeferred = function() {
return et2++, rt2[et2] = function() {
return it2;
}, et2;
}, Zt2 = function(t5, e8) {
return e8 = "boolean" == typeof e8 && e8, rt2[t5] = it2, e8 && lt2(t5 + " 0 obj"), t5;
}, $t2 = y2.__private__.newAdditionalObject = function() {
var t5 = { objId: Kt2(), content: "" };
return at2.push(t5), t5;
}, Qt2 = Kt2(), te2 = Kt2(), ee2 = y2.__private__.decodeColorString = function(t5) {
var e8 = t5.split(" ");
if (2 !== e8.length || "g" !== e8[1] && "G" !== e8[1]) {
if (5 === e8.length && ("k" === e8[4] || "K" === e8[4])) {
e8 = [(1 - e8[0]) * (1 - e8[3]), (1 - e8[1]) * (1 - e8[3]), (1 - e8[2]) * (1 - e8[3]), "r"];
}
} else {
var r3 = parseFloat(e8[0]);
e8 = [r3, r3, r3, "r"];
}
for (var n2 = "#", i3 = 0; i3 < 3; i3++)
n2 += ("0" + Math.floor(255 * parseFloat(e8[i3])).toString(16)).slice(-2);
return n2;
}, re2 = y2.__private__.encodeColorString = function(e8) {
var r3;
"string" == typeof e8 && (e8 = { ch1: e8 });
var n2 = e8.ch1, i3 = e8.ch2, a2 = e8.ch3, o3 = e8.ch4, s3 = "draw" === e8.pdfColorType ? ["G", "RG", "K"] : ["g", "rg", "k"];
if ("string" == typeof n2 && "#" !== n2.charAt(0)) {
var c3 = new f$3(n2);
if (c3.ok)
n2 = c3.toHex();
else if (!/^\d*\.?\d*$/.test(n2))
throw new Error('Invalid color "' + n2 + '" passed to jsPDF.encodeColorString.');
}
if ("string" == typeof n2 && /^#[0-9A-Fa-f]{3}$/.test(n2) && (n2 = "#" + n2[1] + n2[1] + n2[2] + n2[2] + n2[3] + n2[3]), "string" == typeof n2 && /^#[0-9A-Fa-f]{6}$/.test(n2)) {
var u3 = parseInt(n2.substr(1), 16);
n2 = u3 >> 16 & 255, i3 = u3 >> 8 & 255, a2 = 255 & u3;
}
if (void 0 === i3 || void 0 === o3 && n2 === i3 && i3 === a2)
if ("string" == typeof n2)
r3 = n2 + " " + s3[0];
else
switch (e8.precision) {
case 2:
r3 = R2(n2 / 255) + " " + s3[0];
break;
case 3:
default:
r3 = T2(n2 / 255) + " " + s3[0];
}
else if (void 0 === o3 || "object" === _typeof$3(o3)) {
if (o3 && !isNaN(o3.a) && 0 === o3.a)
return r3 = ["1.", "1.", "1.", s3[1]].join(" ");
if ("string" == typeof n2)
r3 = [n2, i3, a2, s3[1]].join(" ");
else
switch (e8.precision) {
case 2:
r3 = [R2(n2 / 255), R2(i3 / 255), R2(a2 / 255), s3[1]].join(" ");
break;
default:
case 3:
r3 = [T2(n2 / 255), T2(i3 / 255), T2(a2 / 255), s3[1]].join(" ");
}
} else if ("string" == typeof n2)
r3 = [n2, i3, a2, o3, s3[2]].join(" ");
else
switch (e8.precision) {
case 2:
r3 = [R2(n2), R2(i3), R2(a2), R2(o3), s3[2]].join(" ");
break;
case 3:
default:
r3 = [T2(n2), T2(i3), T2(a2), T2(o3), s3[2]].join(" ");
}
return r3;
}, ne2 = y2.__private__.getFilters = function() {
return u2;
}, ie2 = y2.__private__.putStream = function(t5) {
var e8 = (t5 = t5 || {}).data || "", r3 = t5.filters || ne2(), n2 = t5.alreadyAppliedFilters || [], i3 = t5.addLength1 || false, a2 = e8.length, o3 = t5.objectId, s3 = function(t6) {
return t6;
};
if (null !== m2 && void 0 === o3)
throw new Error("ObjectId must be passed to putStream for file encryption");
null !== m2 && (s3 = Ye2.encryptor(o3, 0));
var c3 = {};
true === r3 && (r3 = ["FlateEncode"]);
var u3 = t5.additionalKeyValues || [], h2 = (c3 = void 0 !== E$2.API.processDataByFilters ? E$2.API.processDataByFilters(e8, r3) : { data: e8, reverseChain: [] }).reverseChain + (Array.isArray(n2) ? n2.join(" ") : n2.toString());
if (0 !== c3.data.length && (u3.push({ key: "Length", value: c3.data.length }), true === i3 && u3.push({ key: "Length1", value: a2 })), 0 != h2.length)
if (h2.split("/").length - 1 == 1)
u3.push({ key: "Filter", value: h2 });
else {
u3.push({ key: "Filter", value: "[" + h2 + "]" });
for (var l2 = 0; l2 < u3.length; l2 += 1)
if ("DecodeParms" === u3[l2].key) {
for (var f2 = [], d3 = 0; d3 < c3.reverseChain.split("/").length - 1; d3 += 1)
f2.push("null");
f2.push(u3[l2].value), u3[l2].value = "[" + f2.join(" ") + "]";
}
}
lt2("<<");
for (var p3 = 0; p3 < u3.length; p3++)
lt2("/" + u3[p3].key + " " + u3[p3].value);
lt2(">>"), 0 !== c3.data.length && (lt2("stream"), lt2(s3(c3.data)), lt2("endstream"));
}, ae2 = y2.__private__.putPage = function(t5) {
var e8 = t5.number, r3 = t5.data, n2 = t5.objId, i3 = t5.contentsObjId;
Zt2(n2, true), lt2("<</Type /Page"), lt2("/Parent " + t5.rootDictionaryObjId + " 0 R"), lt2("/Resources " + t5.resourceDictionaryObjId + " 0 R"), lt2("/MediaBox [" + parseFloat(O2(t5.mediaBox.bottomLeftX)) + " " + parseFloat(O2(t5.mediaBox.bottomLeftY)) + " " + O2(t5.mediaBox.topRightX) + " " + O2(t5.mediaBox.topRightY) + "]"), null !== t5.cropBox && lt2("/CropBox [" + O2(t5.cropBox.bottomLeftX) + " " + O2(t5.cropBox.bottomLeftY) + " " + O2(t5.cropBox.topRightX) + " " + O2(t5.cropBox.topRightY) + "]"), null !== t5.bleedBox && lt2("/BleedBox [" + O2(t5.bleedBox.bottomLeftX) + " " + O2(t5.bleedBox.bottomLeftY) + " " + O2(t5.bleedBox.topRightX) + " " + O2(t5.bleedBox.topRightY) + "]"), null !== t5.trimBox && lt2("/TrimBox [" + O2(t5.trimBox.bottomLeftX) + " " + O2(t5.trimBox.bottomLeftY) + " " + O2(t5.trimBox.topRightX) + " " + O2(t5.trimBox.topRightY) + "]"), null !== t5.artBox && lt2("/ArtBox [" + O2(t5.artBox.bottomLeftX) + " " + O2(t5.artBox.bottomLeftY) + " " + O2(t5.artBox.topRightX) + " " + O2(t5.artBox.topRightY) + "]"), "number" == typeof t5.userUnit && 1 !== t5.userUnit && lt2("/UserUnit " + t5.userUnit), Tt2.publish("putPage", { objId: n2, pageContext: Rt2[e8], pageNumber: e8, page: r3 }), lt2("/Contents " + i3 + " 0 R"), lt2(">>"), lt2("endobj");
var a2 = r3.join("\n");
return S2 === x2.ADVANCED && (a2 += "\nQ"), Zt2(i3, true), ie2({ data: a2, filters: ne2(), objectId: i3 }), lt2("endobj"), n2;
}, oe2 = y2.__private__.putPages = function() {
var t5, e8, r3 = [];
for (t5 = 1; t5 <= Dt2; t5++)
Rt2[t5].objId = Kt2(), Rt2[t5].contentsObjId = Kt2();
for (t5 = 1; t5 <= Dt2; t5++)
r3.push(ae2({ number: t5, data: ot2[t5], objId: Rt2[t5].objId, contentsObjId: Rt2[t5].contentsObjId, mediaBox: Rt2[t5].mediaBox, cropBox: Rt2[t5].cropBox, bleedBox: Rt2[t5].bleedBox, trimBox: Rt2[t5].trimBox, artBox: Rt2[t5].artBox, userUnit: Rt2[t5].userUnit, rootDictionaryObjId: Qt2, resourceDictionaryObjId: te2 }));
Zt2(Qt2, true), lt2("<</Type /Pages");
var n2 = "/Kids [";
for (e8 = 0; e8 < Dt2; e8++)
n2 += r3[e8] + " 0 R ";
lt2(n2 + "]"), lt2("/Count " + Dt2), lt2(">>"), lt2("endobj"), Tt2.publish("postPutPages");
}, se2 = function(t5) {
Tt2.publish("putFont", { font: t5, out: lt2, newObject: Xt2, putStream: ie2 }), true !== t5.isAlreadyPutted && (t5.objectNumber = Xt2(), lt2("<<"), lt2("/Type /Font"), lt2("/BaseFont /" + F$2(t5.postScriptName)), lt2("/Subtype /Type1"), "string" == typeof t5.encoding && lt2("/Encoding /" + t5.encoding), lt2("/FirstChar 32"), lt2("/LastChar 255"), lt2(">>"), lt2("endobj"));
}, ce2 = function() {
for (var t5 in Ft2)
Ft2.hasOwnProperty(t5) && (false === v2 || true === v2 && b2.hasOwnProperty(t5)) && se2(Ft2[t5]);
}, ue2 = function(t5) {
t5.objectNumber = Xt2();
var e8 = [];
e8.push({ key: "Type", value: "/XObject" }), e8.push({ key: "Subtype", value: "/Form" }), e8.push({ key: "BBox", value: "[" + [O2(t5.x), O2(t5.y), O2(t5.x + t5.width), O2(t5.y + t5.height)].join(" ") + "]" }), e8.push({ key: "Matrix", value: "[" + t5.matrix.toString() + "]" });
var r3 = t5.pages[1].join("\n");
ie2({ data: r3, additionalKeyValues: e8, objectId: t5.objectNumber }), lt2("endobj");
}, he2 = function() {
for (var t5 in zt2)
zt2.hasOwnProperty(t5) && ue2(zt2[t5]);
}, le2 = function(t5, e8) {
var r3, n2 = [], i3 = 1 / (e8 - 1);
for (r3 = 0; r3 < 1; r3 += i3)
n2.push(r3);
if (n2.push(1), 0 != t5[0].offset) {
var a2 = { offset: 0, color: t5[0].color };
t5.unshift(a2);
}
if (1 != t5[t5.length - 1].offset) {
var o3 = { offset: 1, color: t5[t5.length - 1].color };
t5.push(o3);
}
for (var s3 = "", c3 = 0, u3 = 0; u3 < n2.length; u3++) {
for (r3 = n2[u3]; r3 > t5[c3 + 1].offset; )
c3++;
var h2 = t5[c3].offset, l2 = (r3 - h2) / (t5[c3 + 1].offset - h2), f2 = t5[c3].color, d3 = t5[c3 + 1].color;
s3 += tt2(Math.round((1 - l2) * f2[0] + l2 * d3[0]).toString(16)) + tt2(Math.round((1 - l2) * f2[1] + l2 * d3[1]).toString(16)) + tt2(Math.round((1 - l2) * f2[2] + l2 * d3[2]).toString(16));
}
return s3.trim();
}, fe2 = function(t5, e8) {
e8 || (e8 = 21);
var r3 = Xt2(), n2 = le2(t5.colors, e8), i3 = [];
i3.push({ key: "FunctionType", value: "0" }), i3.push({ key: "Domain", value: "[0.0 1.0]" }), i3.push({ key: "Size", value: "[" + e8 + "]" }), i3.push({ key: "BitsPerSample", value: "8" }), i3.push({ key: "Range", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), i3.push({ key: "Decode", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), ie2({ data: n2, additionalKeyValues: i3, alreadyAppliedFilters: ["/ASCIIHexDecode"], objectId: r3 }), lt2("endobj"), t5.objectNumber = Xt2(), lt2("<< /ShadingType " + t5.type), lt2("/ColorSpace /DeviceRGB");
var a2 = "/Coords [" + O2(parseFloat(t5.coords[0])) + " " + O2(parseFloat(t5.coords[1])) + " ";
2 === t5.type ? a2 += O2(parseFloat(t5.coords[2])) + " " + O2(parseFloat(t5.coords[3])) : a2 += O2(parseFloat(t5.coords[2])) + " " + O2(parseFloat(t5.coords[3])) + " " + O2(parseFloat(t5.coords[4])) + " " + O2(parseFloat(t5.coords[5])), lt2(a2 += "]"), t5.matrix && lt2("/Matrix [" + t5.matrix.toString() + "]"), lt2("/Function " + r3 + " 0 R"), lt2("/Extend [true true]"), lt2(">>"), lt2("endobj");
}, de2 = function(t5, e8) {
var r3 = Kt2(), n2 = Xt2();
e8.push({ resourcesOid: r3, objectOid: n2 }), t5.objectNumber = n2;
var i3 = [];
i3.push({ key: "Type", value: "/Pattern" }), i3.push({ key: "PatternType", value: "1" }), i3.push({ key: "PaintType", value: "1" }), i3.push({ key: "TilingType", value: "1" }), i3.push({ key: "BBox", value: "[" + t5.boundingBox.map(O2).join(" ") + "]" }), i3.push({ key: "XStep", value: O2(t5.xStep) }), i3.push({ key: "YStep", value: O2(t5.yStep) }), i3.push({ key: "Resources", value: r3 + " 0 R" }), t5.matrix && i3.push({ key: "Matrix", value: "[" + t5.matrix.toString() + "]" }), ie2({ data: t5.stream, additionalKeyValues: i3, objectId: t5.objectNumber }), lt2("endobj");
}, pe2 = function(t5) {
var e8;
for (e8 in Ot2)
Ot2.hasOwnProperty(e8) && (Ot2[e8] instanceof B$1 ? fe2(Ot2[e8]) : Ot2[e8] instanceof M$6 && de2(Ot2[e8], t5));
}, ge2 = function(t5) {
for (var e8 in t5.objectNumber = Xt2(), lt2("<<"), t5)
switch (e8) {
case "opacity":
lt2("/ca " + R2(t5[e8]));
break;
case "stroke-opacity":
lt2("/CA " + R2(t5[e8]));
}
lt2(">>"), lt2("endobj");
}, me2 = function() {
var t5;
for (t5 in Mt2)
Mt2.hasOwnProperty(t5) && ge2(Mt2[t5]);
}, ve2 = function() {
for (var t5 in lt2("/XObject <<"), zt2)
zt2.hasOwnProperty(t5) && zt2[t5].objectNumber >= 0 && lt2("/" + t5 + " " + zt2[t5].objectNumber + " 0 R");
Tt2.publish("putXobjectDict"), lt2(">>");
}, be2 = function() {
Ye2.oid = Xt2(), lt2("<<"), lt2("/Filter /Standard"), lt2("/V " + Ye2.v), lt2("/R " + Ye2.r), lt2("/U <" + Ye2.toHexString(Ye2.U) + ">"), lt2("/O <" + Ye2.toHexString(Ye2.O) + ">"), lt2("/P " + Ye2.P), lt2(">>"), lt2("endobj");
}, ye2 = function() {
for (var t5 in lt2("/Font <<"), Ft2)
Ft2.hasOwnProperty(t5) && (false === v2 || true === v2 && b2.hasOwnProperty(t5)) && lt2("/" + t5 + " " + Ft2[t5].objectNumber + " 0 R");
lt2(">>");
}, we2 = function() {
if (Object.keys(Ot2).length > 0) {
for (var t5 in lt2("/Shading <<"), Ot2)
Ot2.hasOwnProperty(t5) && Ot2[t5] instanceof B$1 && Ot2[t5].objectNumber >= 0 && lt2("/" + t5 + " " + Ot2[t5].objectNumber + " 0 R");
Tt2.publish("putShadingPatternDict"), lt2(">>");
}
}, Ne2 = function(t5) {
if (Object.keys(Ot2).length > 0) {
for (var e8 in lt2("/Pattern <<"), Ot2)
Ot2.hasOwnProperty(e8) && Ot2[e8] instanceof y2.TilingPattern && Ot2[e8].objectNumber >= 0 && Ot2[e8].objectNumber < t5 && lt2("/" + e8 + " " + Ot2[e8].objectNumber + " 0 R");
Tt2.publish("putTilingPatternDict"), lt2(">>");
}
}, Le2 = function() {
if (Object.keys(Mt2).length > 0) {
var t5;
for (t5 in lt2("/ExtGState <<"), Mt2)
Mt2.hasOwnProperty(t5) && Mt2[t5].objectNumber >= 0 && lt2("/" + t5 + " " + Mt2[t5].objectNumber + " 0 R");
Tt2.publish("putGStateDict"), lt2(">>");
}
}, Ae2 = function(t5) {
Zt2(t5.resourcesOid, true), lt2("<<"), lt2("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), ye2(), we2(), Ne2(t5.objectOid), Le2(), ve2(), lt2(">>"), lt2("endobj");
}, xe2 = function() {
var t5 = [];
ce2(), me2(), he2(), pe2(t5), Tt2.publish("putResources"), t5.forEach(Ae2), Ae2({ resourcesOid: te2, objectOid: Number.MAX_SAFE_INTEGER }), Tt2.publish("postPutResources");
}, Se2 = function() {
Tt2.publish("putAdditionalObjects");
for (var t5 = 0; t5 < at2.length; t5++) {
var e8 = at2[t5];
Zt2(e8.objId, true), lt2(e8.content), lt2("endobj");
}
Tt2.publish("postPutAdditionalObjects");
}, _e2 = function(t5) {
Ct2[t5.fontName] = Ct2[t5.fontName] || {}, Ct2[t5.fontName][t5.fontStyle] = t5.id;
}, Pe2 = function(t5, e8, r3, n2, i3) {
var a2 = { id: "F" + (Object.keys(Ft2).length + 1).toString(10), postScriptName: t5, fontName: e8, fontStyle: r3, encoding: n2, isStandardFont: i3 || false, metadata: {} };
return Tt2.publish("addFont", { font: a2, instance: this }), Ft2[a2.id] = a2, _e2(a2), a2.id;
}, ke2 = function(t5) {
for (var e8 = 0, r3 = pt2.length; e8 < r3; e8++) {
var n2 = Pe2.call(this, t5[e8][0], t5[e8][1], t5[e8][2], pt2[e8][3], true);
false === v2 && (b2[n2] = true);
var i3 = t5[e8][0].split("-");
_e2({ id: n2, fontName: i3[0], fontStyle: i3[1] || "" });
}
Tt2.publish("addFonts", { fonts: Ft2, dictionary: Ct2 });
}, Ie2 = function(t5) {
return t5.foo = function() {
try {
return t5.apply(this, arguments);
} catch (t6) {
var e8 = t6.stack || "";
~e8.indexOf(" at ") && (e8 = e8.split(" at ")[1]);
var r3 = "Error in function " + e8.split("\n")[0].split("<")[0] + ": " + t6.message;
if (!n$8.console)
throw new Error(r3);
n$8.console.error(r3, t6), n$8.alert && alert(r3);
}
}, t5.foo.bar = t5, t5.foo;
}, Fe2 = function(t5, e8) {
var r3, n2, i3, a2, o3, s3, c3, u3, h2;
if (i3 = (e8 = e8 || {}).sourceEncoding || "Unicode", o3 = e8.outputEncoding, (e8.autoencode || o3) && Ft2[St2].metadata && Ft2[St2].metadata[i3] && Ft2[St2].metadata[i3].encoding && (a2 = Ft2[St2].metadata[i3].encoding, !o3 && Ft2[St2].encoding && (o3 = Ft2[St2].encoding), !o3 && a2.codePages && (o3 = a2.codePages[0]), "string" == typeof o3 && (o3 = a2[o3]), o3)) {
for (c3 = false, s3 = [], r3 = 0, n2 = t5.length; r3 < n2; r3++)
(u3 = o3[t5.charCodeAt(r3)]) ? s3.push(String.fromCharCode(u3)) : s3.push(t5[r3]), s3[r3].charCodeAt(0) >> 8 && (c3 = true);
t5 = s3.join("");
}
for (r3 = t5.length; void 0 === c3 && 0 !== r3; )
t5.charCodeAt(r3 - 1) >> 8 && (c3 = true), r3--;
if (!c3)
return t5;
for (s3 = e8.noBOM ? [] : [254, 255], r3 = 0, n2 = t5.length; r3 < n2; r3++) {
if ((h2 = (u3 = t5.charCodeAt(r3)) >> 8) >> 8)
throw new Error("Character at position " + r3 + " of string '" + t5 + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
s3.push(h2), s3.push(u3 - (h2 << 8));
}
return String.fromCharCode.apply(void 0, s3);
}, Ce2 = y2.__private__.pdfEscape = y2.pdfEscape = function(t5, e8) {
return Fe2(t5, e8).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, je2 = y2.__private__.beginPage = function(t5) {
ot2[++Dt2] = [], Rt2[Dt2] = { objId: 0, contentsObjId: 0, userUnit: Number(d2), artBox: null, bleedBox: null, cropBox: null, trimBox: null, mediaBox: { bottomLeftX: 0, bottomLeftY: 0, topRightX: Number(t5[0]), topRightY: Number(t5[1]) } }, Me2(Dt2), ht2(ot2[$2]);
}, Oe2 = function(t5, e8) {
var r3, n2, o3;
switch (i2 = e8 || i2, "string" == typeof t5 && (r3 = A5(t5.toLowerCase()), Array.isArray(r3) && (n2 = r3[0], o3 = r3[1])), Array.isArray(t5) && (n2 = t5[0] * _t2, o3 = t5[1] * _t2), isNaN(n2) && (n2 = s2[0], o3 = s2[1]), (n2 > 14400 || o3 > 14400) && (a$m.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"), n2 = Math.min(14400, n2), o3 = Math.min(14400, o3)), s2 = [n2, o3], i2.substr(0, 1)) {
case "l":
o3 > n2 && (s2 = [o3, n2]);
break;
case "p":
n2 > o3 && (s2 = [o3, n2]);
}
je2(s2), pr2(fr2), lt2(Lr2), 0 !== kr && lt2(kr + " J"), 0 !== Ir2 && lt2(Ir2 + " j"), Tt2.publish("addPage", { pageNumber: Dt2 });
}, Be2 = function(t5) {
t5 > 0 && t5 <= Dt2 && (ot2.splice(t5, 1), Rt2.splice(t5, 1), Dt2--, $2 > Dt2 && ($2 = Dt2), this.setPage($2));
}, Me2 = function(t5) {
t5 > 0 && t5 <= Dt2 && ($2 = t5);
}, Ee2 = y2.__private__.getNumberOfPages = y2.getNumberOfPages = function() {
return ot2.length - 1;
}, qe2 = function(t5, e8, r3) {
var n2, i3 = void 0;
return r3 = r3 || {}, t5 = void 0 !== t5 ? t5 : Ft2[St2].fontName, e8 = void 0 !== e8 ? e8 : Ft2[St2].fontStyle, n2 = t5.toLowerCase(), void 0 !== Ct2[n2] && void 0 !== Ct2[n2][e8] ? i3 = Ct2[n2][e8] : void 0 !== Ct2[t5] && void 0 !== Ct2[t5][e8] ? i3 = Ct2[t5][e8] : false === r3.disableWarning && a$m.warn("Unable to look up font label for font '" + t5 + "', '" + e8 + "'. Refer to getFontList() for available fonts."), i3 || r3.noFallback || null == (i3 = Ct2.times[e8]) && (i3 = Ct2.times.normal), i3;
}, De2 = y2.__private__.putInfo = function() {
var t5 = Xt2(), e8 = function(t6) {
return t6;
};
for (var r3 in null !== m2 && (e8 = Ye2.encryptor(t5, 0)), lt2("<<"), lt2("/Producer (" + Ce2(e8("jsPDF " + E$2.version)) + ")"), xt2)
xt2.hasOwnProperty(r3) && xt2[r3] && lt2("/" + r3.substr(0, 1).toUpperCase() + r3.substr(1) + " (" + Ce2(e8(xt2[r3])) + ")");
lt2("/CreationDate (" + Ce2(e8(W2)) + ")"), lt2(">>"), lt2("endobj");
}, Re2 = y2.__private__.putCatalog = function(t5) {
var e8 = (t5 = t5 || {}).rootDictionaryObjId || Qt2;
switch (Xt2(), lt2("<<"), lt2("/Type /Catalog"), lt2("/Pages " + e8 + " 0 R"), mt2 || (mt2 = "fullwidth"), mt2) {
case "fullwidth":
lt2("/OpenAction [3 0 R /FitH null]");
break;
case "fullheight":
lt2("/OpenAction [3 0 R /FitV null]");
break;
case "fullpage":
lt2("/OpenAction [3 0 R /Fit]");
break;
case "original":
lt2("/OpenAction [3 0 R /XYZ null null 1]");
break;
default:
var r3 = "" + mt2;
"%" === r3.substr(r3.length - 1) && (mt2 = parseInt(mt2) / 100), "number" == typeof mt2 && lt2("/OpenAction [3 0 R /XYZ null null " + R2(mt2) + "]");
}
switch (Nt2 || (Nt2 = "continuous"), Nt2) {
case "continuous":
lt2("/PageLayout /OneColumn");
break;
case "single":
lt2("/PageLayout /SinglePage");
break;
case "two":
case "twoleft":
lt2("/PageLayout /TwoColumnLeft");
break;
case "tworight":
lt2("/PageLayout /TwoColumnRight");
}
yt2 && lt2("/PageMode /" + yt2), Tt2.publish("putCatalog"), lt2(">>"), lt2("endobj");
}, Te2 = y2.__private__.putTrailer = function() {
lt2("trailer"), lt2("<<"), lt2("/Size " + (et2 + 1)), lt2("/Root " + et2 + " 0 R"), lt2("/Info " + (et2 - 1) + " 0 R"), null !== m2 && lt2("/Encrypt " + Ye2.oid + " 0 R"), lt2("/ID [ <" + V2 + "> <" + V2 + "> ]"), lt2(">>");
}, Ue2 = y2.__private__.putHeader = function() {
lt2("%PDF-" + w2), lt2("%ºß¬à");
}, ze2 = y2.__private__.putXRef = function() {
var t5 = "0000000000";
lt2("xref"), lt2("0 " + (et2 + 1)), lt2("0000000000 65535 f ");
for (var e8 = 1; e8 <= et2; e8++) {
"function" == typeof rt2[e8] ? lt2((t5 + rt2[e8]()).slice(-10) + " 00000 n ") : void 0 !== rt2[e8] ? lt2((t5 + rt2[e8]).slice(-10) + " 00000 n ") : lt2("0000000000 00000 n ");
}
}, He2 = y2.__private__.buildDocument = function() {
ut2(), ht2(nt2), Tt2.publish("buildDocument"), Ue2(), oe2(), Se2(), xe2(), null !== m2 && be2(), De2(), Re2();
var t5 = it2;
return ze2(), Te2(), lt2("startxref"), lt2("" + t5), lt2("%%EOF"), ht2(ot2[$2]), nt2.join("\n");
}, We2 = y2.__private__.getBlob = function(t5) {
return new Blob([dt2(t5)], { type: "application/pdf" });
}, Ve2 = y2.output = y2.__private__.output = Ie2(function(t5, e8) {
switch ("string" == typeof (e8 = e8 || {}) ? e8 = { filename: e8 } : e8.filename = e8.filename || "generated.pdf", t5) {
case void 0:
return He2();
case "save":
y2.save(e8.filename);
break;
case "arraybuffer":
return dt2(He2());
case "blob":
return We2(He2());
case "bloburi":
case "bloburl":
if (void 0 !== n$8.URL && "function" == typeof n$8.URL.createObjectURL)
return n$8.URL && n$8.URL.createObjectURL(We2(He2())) || void 0;
a$m.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
break;
case "datauristring":
case "dataurlstring":
var r3 = "", i3 = He2();
try {
r3 = h$6(i3);
} catch (t6) {
r3 = h$6(unescape(encodeURIComponent(i3)));
}
return "data:application/pdf;filename=" + e8.filename + ";base64," + r3;
case "pdfobjectnewwindow":
if ("[object Window]" === Object.prototype.toString.call(n$8)) {
var o3 = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js", s3 = ' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
e8.pdfObjectUrl && (o3 = e8.pdfObjectUrl, s3 = "");
var c3 = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + o3 + '"' + s3 + '><\/script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(e8) + ");<\/script></body></html>", u3 = n$8.open();
return null !== u3 && u3.document.write(c3), u3;
}
throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
case "pdfjsnewwindow":
if ("[object Window]" === Object.prototype.toString.call(n$8)) {
var l2 = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="' + (e8.pdfJsUrl || "examples/PDF.js/web/viewer.html") + "?file=&downloadName=" + e8.filename + '" width="500px" height="400px" /></body></html>', f2 = n$8.open();
if (null !== f2) {
f2.document.write(l2);
var d3 = this;
f2.document.documentElement.querySelector("#pdfViewer").onload = function() {
f2.document.title = e8.filename, f2.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(d3.output("bloburl"));
};
}
return f2;
}
throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
case "dataurlnewwindow":
if ("[object Window]" !== Object.prototype.toString.call(n$8))
throw new Error("The option dataurlnewwindow just works in a browser-environment.");
var p3 = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="' + this.output("datauristring", e8) + '"></iframe></body></html>', g3 = n$8.open();
if (null !== g3 && (g3.document.write(p3), g3.document.title = e8.filename), g3 || "undefined" == typeof safari)
return g3;
break;
case "datauri":
case "dataurl":
return n$8.document.location.href = this.output("datauristring", e8);
default:
return null;
}
}), Ge2 = function(t5) {
return true === Array.isArray(Ut2) && Ut2.indexOf(t5) > -1;
};
switch (o2) {
case "pt":
_t2 = 1;
break;
case "mm":
_t2 = 72 / 25.4;
break;
case "cm":
_t2 = 72 / 2.54;
break;
case "in":
_t2 = 72;
break;
case "px":
_t2 = 1 == Ge2("px_scaling") ? 0.75 : 96 / 72;
break;
case "pc":
case "em":
_t2 = 12;
break;
case "ex":
_t2 = 6;
break;
default:
if ("number" != typeof o2)
throw new Error("Invalid unit: " + o2);
_t2 = o2;
}
var Ye2 = null;
K2(), Y3();
var Je2 = function(t5) {
return null !== m2 ? Ye2.encryptor(t5, 0) : function(t6) {
return t6;
};
}, Xe2 = y2.__private__.getPageInfo = y2.getPageInfo = function(t5) {
if (isNaN(t5) || t5 % 1 != 0)
throw new Error("Invalid argument passed to jsPDF.getPageInfo");
return { objId: Rt2[t5].objId, pageNumber: t5, pageContext: Rt2[t5] };
}, Ke2 = y2.__private__.getPageInfoByObjId = function(t5) {
if (isNaN(t5) || t5 % 1 != 0)
throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
for (var e8 in Rt2)
if (Rt2[e8].objId === t5)
break;
return Xe2(e8);
}, Ze2 = y2.__private__.getCurrentPageInfo = y2.getCurrentPageInfo = function() {
return { objId: Rt2[$2].objId, pageNumber: $2, pageContext: Rt2[$2] };
};
y2.addPage = function() {
return Oe2.apply(this, arguments), this;
}, y2.setPage = function() {
return Me2.apply(this, arguments), ht2.call(this, ot2[$2]), this;
}, y2.insertPage = function(t5) {
return this.addPage(), this.movePage($2, t5), this;
}, y2.movePage = function(t5, e8) {
var r3, n2;
if (t5 > e8) {
r3 = ot2[t5], n2 = Rt2[t5];
for (var i3 = t5; i3 > e8; i3--)
ot2[i3] = ot2[i3 - 1], Rt2[i3] = Rt2[i3 - 1];
ot2[e8] = r3, Rt2[e8] = n2, this.setPage(e8);
} else if (t5 < e8) {
r3 = ot2[t5], n2 = Rt2[t5];
for (var a2 = t5; a2 < e8; a2++)
ot2[a2] = ot2[a2 + 1], Rt2[a2] = Rt2[a2 + 1];
ot2[e8] = r3, Rt2[e8] = n2, this.setPage(e8);
}
return this;
}, y2.deletePage = function() {
return Be2.apply(this, arguments), this;
}, y2.__private__.text = y2.text = function(e8, r3, n2, i3, a2) {
var o3, s3, c3, u3, h2, l2, f2, d3, p3, g3 = (i3 = i3 || {}).scope || this;
if ("number" == typeof e8 && "number" == typeof r3 && ("string" == typeof n2 || Array.isArray(n2))) {
var m3 = n2;
n2 = r3, r3 = e8, e8 = m3;
}
if (arguments[3] instanceof Vt2 == false ? (c3 = arguments[4], u3 = arguments[5], "object" === _typeof$3(f2 = arguments[3]) && null !== f2 || ("string" == typeof c3 && (u3 = c3, c3 = null), "string" == typeof f2 && (u3 = f2, f2 = null), "number" == typeof f2 && (c3 = f2, f2 = null), i3 = { flags: f2, angle: c3, align: u3 })) : (q2("The transform parameter of text() with a Matrix value"), p3 = a2), isNaN(r3) || isNaN(n2) || null == e8)
throw new Error("Invalid arguments passed to jsPDF.text");
if (0 === e8.length)
return g3;
var v3 = "", y3 = false, w3 = "number" == typeof i3.lineHeightFactor ? i3.lineHeightFactor : lr2, N3 = g3.internal.scaleFactor;
function L3(t5) {
return t5 = t5.split(" ").join(Array(i3.TabLen || 9).join(" ")), Ce2(t5, f2);
}
function A6(t5) {
for (var e9, r4 = t5.concat(), n3 = [], i4 = r4.length; i4--; )
"string" == typeof (e9 = r4.shift()) ? n3.push(e9) : Array.isArray(t5) && (1 === e9.length || void 0 === e9[1] && void 0 === e9[2]) ? n3.push(e9[0]) : n3.push([e9[0], e9[1], e9[2]]);
return n3;
}
function _25(t5, e9) {
var r4;
if ("string" == typeof t5)
r4 = e9(t5)[0];
else if (Array.isArray(t5)) {
for (var n3, i4, a3 = t5.concat(), o4 = [], s4 = a3.length; s4--; )
"string" == typeof (n3 = a3.shift()) ? o4.push(e9(n3)[0]) : Array.isArray(n3) && "string" == typeof n3[0] && (i4 = e9(n3[0], n3[1], n3[2]), o4.push([i4[0], i4[1], i4[2]]));
r4 = o4;
}
return r4;
}
var P3 = false, k3 = true;
if ("string" == typeof e8)
P3 = true;
else if (Array.isArray(e8)) {
var I2 = e8.concat();
s3 = [];
for (var F2, C3 = I2.length; C3--; )
("string" != typeof (F2 = I2.shift()) || Array.isArray(F2) && "string" != typeof F2[0]) && (k3 = false);
P3 = k3;
}
if (false === P3)
throw new Error('Type of text must be string or Array. "' + e8 + '" is not recognized.');
"string" == typeof e8 && (e8 = e8.match(/[\r?\n]/) ? e8.split(/\r\n|\r|\n/g) : [e8]);
var j2 = gt2 / g3.internal.scaleFactor, B3 = j2 * (w3 - 1);
switch (i3.baseline) {
case "bottom":
n2 -= B3;
break;
case "top":
n2 += j2 - B3;
break;
case "hanging":
n2 += j2 - 2 * B3;
break;
case "middle":
n2 += j2 / 2 - B3;
}
if ((l2 = i3.maxWidth || 0) > 0 && ("string" == typeof e8 ? e8 = g3.splitTextToSize(e8, l2) : "[object Array]" === Object.prototype.toString.call(e8) && (e8 = e8.reduce(function(t5, e9) {
return t5.concat(g3.splitTextToSize(e9, l2));
}, []))), o3 = { text: e8, x: r3, y: n2, options: i3, mutex: { pdfEscape: Ce2, activeFontKey: St2, fonts: Ft2, activeFontSize: gt2 } }, Tt2.publish("preProcessText", o3), e8 = o3.text, c3 = (i3 = o3.options).angle, p3 instanceof Vt2 == false && c3 && "number" == typeof c3) {
c3 *= Math.PI / 180, 0 === i3.rotationDirection && (c3 = -c3), S2 === x2.ADVANCED && (c3 = -c3);
var M2 = Math.cos(c3), E2 = Math.sin(c3);
p3 = new Vt2(M2, E2, -E2, M2, 0, 0);
} else
c3 && c3 instanceof Vt2 && (p3 = c3);
S2 !== x2.ADVANCED || p3 || (p3 = Yt2), void 0 !== (h2 = i3.charSpace || _r2) && (v3 += O2(U2(h2)) + " Tc\n", this.setCharSpace(this.getCharSpace() || 0)), void 0 !== (d3 = i3.horizontalScale) && (v3 += O2(100 * d3) + " Tz\n");
i3.lang;
var D3 = -1, R3 = void 0 !== i3.renderingMode ? i3.renderingMode : i3.stroke, T3 = g3.internal.getCurrentPageInfo().pageContext;
switch (R3) {
case 0:
case false:
case "fill":
D3 = 0;
break;
case 1:
case true:
case "stroke":
D3 = 1;
break;
case 2:
case "fillThenStroke":
D3 = 2;
break;
case 3:
case "invisible":
D3 = 3;
break;
case 4:
case "fillAndAddForClipping":
D3 = 4;
break;
case 5:
case "strokeAndAddPathForClipping":
D3 = 5;
break;
case 6:
case "fillThenStrokeAndAddToPathForClipping":
D3 = 6;
break;
case 7:
case "addToPathForClipping":
D3 = 7;
}
var z3 = void 0 !== T3.usedRenderingMode ? T3.usedRenderingMode : -1;
-1 !== D3 ? v3 += D3 + " Tr\n" : -1 !== z3 && (v3 += "0 Tr\n"), -1 !== D3 && (T3.usedRenderingMode = D3), u3 = i3.align || "left";
var H5, W3 = gt2 * w3, V3 = g3.internal.pageSize.getWidth(), G3 = Ft2[St2];
h2 = i3.charSpace || _r2, l2 = i3.maxWidth || 0, f2 = Object.assign({ autoencode: true, noBOM: true }, i3.flags);
var Y4 = [];
if ("[object Array]" === Object.prototype.toString.call(e8)) {
var J3;
s3 = A6(e8), "left" !== u3 && (H5 = s3.map(function(t5) {
return g3.getStringUnitWidth(t5, { font: G3, charSpace: h2, fontSize: gt2, doKerning: false }) * gt2 / N3;
}));
var X4, K3 = 0;
if ("right" === u3) {
r3 -= H5[0], e8 = [], C3 = s3.length;
for (var Z4 = 0; Z4 < C3; Z4++)
0 === Z4 ? (X4 = br2(r3), J3 = yr2(n2)) : (X4 = U2(K3 - H5[Z4]), J3 = -W3), e8.push([s3[Z4], X4, J3]), K3 = H5[Z4];
} else if ("center" === u3) {
r3 -= H5[0] / 2, e8 = [], C3 = s3.length;
for (var $3 = 0; $3 < C3; $3++)
0 === $3 ? (X4 = br2(r3), J3 = yr2(n2)) : (X4 = U2((K3 - H5[$3]) / 2), J3 = -W3), e8.push([s3[$3], X4, J3]), K3 = H5[$3];
} else if ("left" === u3) {
e8 = [], C3 = s3.length;
for (var Q3 = 0; Q3 < C3; Q3++)
e8.push(s3[Q3]);
} else {
if ("justify" !== u3)
throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
e8 = [], C3 = s3.length, l2 = 0 !== l2 ? l2 : V3;
for (var tt3 = 0; tt3 < C3; tt3++)
J3 = 0 === tt3 ? yr2(n2) : -W3, X4 = 0 === tt3 ? br2(r3) : 0, tt3 < C3 - 1 ? Y4.push(O2(U2((l2 - H5[tt3]) / (s3[tt3].split(" ").length - 1)))) : Y4.push(0), e8.push([s3[tt3], X4, J3]);
}
}
var et3 = "boolean" == typeof i3.R2L ? i3.R2L : bt2;
true === et3 && (e8 = _25(e8, function(t5, e9, r4) {
return [t5.split("").reverse().join(""), e9, r4];
})), o3 = { text: e8, x: r3, y: n2, options: i3, mutex: { pdfEscape: Ce2, activeFontKey: St2, fonts: Ft2, activeFontSize: gt2 } }, Tt2.publish("postProcessText", o3), e8 = o3.text, y3 = o3.mutex.isHex || false;
var rt3 = Ft2[St2].encoding;
"WinAnsiEncoding" !== rt3 && "StandardEncoding" !== rt3 || (e8 = _25(e8, function(t5, e9, r4) {
return [L3(t5), e9, r4];
})), s3 = A6(e8), e8 = [];
for (var nt3, it3, at3, ot3 = 0, st3 = 1, ct3 = Array.isArray(s3[0]) ? st3 : ot3, ut3 = "", ht3 = function(t5, e9, r4) {
var n3 = "";
return r4 instanceof Vt2 ? (r4 = "number" == typeof i3.angle ? Gt2(r4, new Vt2(1, 0, 0, 1, t5, e9)) : Gt2(new Vt2(1, 0, 0, 1, t5, e9), r4), S2 === x2.ADVANCED && (r4 = Gt2(new Vt2(1, 0, 0, -1, 0, 0), r4)), n3 = r4.join(" ") + " Tm\n") : n3 = O2(t5) + " " + O2(e9) + " Td\n", n3;
}, ft3 = 0; ft3 < s3.length; ft3++) {
switch (ut3 = "", ct3) {
case st3:
at3 = (y3 ? "<" : "(") + s3[ft3][0] + (y3 ? ">" : ")"), nt3 = parseFloat(s3[ft3][1]), it3 = parseFloat(s3[ft3][2]);
break;
case ot3:
at3 = (y3 ? "<" : "(") + s3[ft3] + (y3 ? ">" : ")"), nt3 = br2(r3), it3 = yr2(n2);
}
void 0 !== Y4 && void 0 !== Y4[ft3] && (ut3 = Y4[ft3] + " Tw\n"), 0 === ft3 ? e8.push(ut3 + ht3(nt3, it3, p3) + at3) : ct3 === ot3 ? e8.push(ut3 + at3) : ct3 === st3 && e8.push(ut3 + ht3(nt3, it3, p3) + at3);
}
e8 = ct3 === ot3 ? e8.join(" Tj\nT* ") : e8.join(" Tj\n"), e8 += " Tj\n";
var dt3 = "BT\n/";
return dt3 += St2 + " " + gt2 + " Tf\n", dt3 += O2(gt2 * w3) + " TL\n", dt3 += xr2 + "\n", dt3 += v3, dt3 += e8, lt2(dt3 += "ET"), b2[St2] = true, g3;
};
var $e2 = y2.__private__.clip = y2.clip = function(t5) {
return lt2("evenodd" === t5 ? "W*" : "W"), this;
};
y2.clipEvenOdd = function() {
return $e2("evenodd");
}, y2.__private__.discardPath = y2.discardPath = function() {
return lt2("n"), this;
};
var Qe2 = y2.__private__.isValidStyle = function(t5) {
var e8 = false;
return -1 !== [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(t5) && (e8 = true), e8;
};
y2.__private__.setDefaultPathOperation = y2.setDefaultPathOperation = function(t5) {
return Qe2(t5) && (g2 = t5), this;
};
var tr2 = y2.__private__.getStyle = y2.getStyle = function(t5) {
var e8 = g2;
switch (t5) {
case "D":
case "S":
e8 = "S";
break;
case "F":
e8 = "f";
break;
case "FD":
case "DF":
e8 = "B";
break;
case "f":
case "f*":
case "B":
case "B*":
e8 = t5;
}
return e8;
}, er2 = y2.close = function() {
return lt2("h"), this;
};
y2.stroke = function() {
return lt2("S"), this;
}, y2.fill = function(t5) {
return rr2("f", t5), this;
}, y2.fillEvenOdd = function(t5) {
return rr2("f*", t5), this;
}, y2.fillStroke = function(t5) {
return rr2("B", t5), this;
}, y2.fillStrokeEvenOdd = function(t5) {
return rr2("B*", t5), this;
};
var rr2 = function(e8, r3) {
"object" === _typeof$3(r3) ? ar2(r3, e8) : lt2(e8);
}, nr2 = function(t5) {
null === t5 || S2 === x2.ADVANCED && void 0 === t5 || (t5 = tr2(t5), lt2(t5));
};
function ir2(t5, e8, r3, n2, i3) {
var a2 = new M$6(e8 || this.boundingBox, r3 || this.xStep, n2 || this.yStep, this.gState, i3 || this.matrix);
a2.stream = this.stream;
var o3 = t5 + "$$" + this.cloneIndex++ + "$$";
return Jt2(o3, a2), a2;
}
var ar2 = function(t5, e8) {
var r3 = Bt2[t5.key], n2 = Ot2[r3];
if (n2 instanceof B$1)
lt2("q"), lt2(or3(e8)), n2.gState && y2.setGState(n2.gState), lt2(t5.matrix.toString() + " cm"), lt2("/" + r3 + " sh"), lt2("Q");
else if (n2 instanceof M$6) {
var i3 = new Vt2(1, 0, 0, -1, 0, Rr2());
t5.matrix && (i3 = i3.multiply(t5.matrix || Yt2), r3 = ir2.call(n2, t5.key, t5.boundingBox, t5.xStep, t5.yStep, i3).id), lt2("q"), lt2("/Pattern cs"), lt2("/" + r3 + " scn"), n2.gState && y2.setGState(n2.gState), lt2(e8), lt2("Q");
}
}, or3 = function(t5) {
switch (t5) {
case "f":
case "F":
return "W n";
case "f*":
return "W* n";
case "B":
return "W S";
case "B*":
return "W* S";
case "S":
return "W S";
case "n":
return "W n";
}
}, sr2 = y2.moveTo = function(t5, e8) {
return lt2(O2(U2(t5)) + " " + O2(H4(e8)) + " m"), this;
}, cr2 = y2.lineTo = function(t5, e8) {
return lt2(O2(U2(t5)) + " " + O2(H4(e8)) + " l"), this;
}, ur2 = y2.curveTo = function(t5, e8, r3, n2, i3, a2) {
return lt2([O2(U2(t5)), O2(H4(e8)), O2(U2(r3)), O2(H4(n2)), O2(U2(i3)), O2(H4(a2)), "c"].join(" ")), this;
};
y2.__private__.line = y2.line = function(t5, e8, r3, n2, i3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n2) || !Qe2(i3))
throw new Error("Invalid arguments passed to jsPDF.line");
return S2 === x2.COMPAT ? this.lines([[r3 - t5, n2 - e8]], t5, e8, [1, 1], i3 || "S") : this.lines([[r3 - t5, n2 - e8]], t5, e8, [1, 1]).stroke();
}, y2.__private__.lines = y2.lines = function(t5, e8, r3, n2, i3, a2) {
var o3, s3, c3, u3, h2, l2, f2, d3, p3, g3, m3, v3;
if ("number" == typeof t5 && (v3 = r3, r3 = e8, e8 = t5, t5 = v3), n2 = n2 || [1, 1], a2 = a2 || false, isNaN(e8) || isNaN(r3) || !Array.isArray(t5) || !Array.isArray(n2) || !Qe2(i3) || "boolean" != typeof a2)
throw new Error("Invalid arguments passed to jsPDF.lines");
for (sr2(e8, r3), o3 = n2[0], s3 = n2[1], u3 = t5.length, g3 = e8, m3 = r3, c3 = 0; c3 < u3; c3++)
2 === (h2 = t5[c3]).length ? (g3 = h2[0] * o3 + g3, m3 = h2[1] * s3 + m3, cr2(g3, m3)) : (l2 = h2[0] * o3 + g3, f2 = h2[1] * s3 + m3, d3 = h2[2] * o3 + g3, p3 = h2[3] * s3 + m3, g3 = h2[4] * o3 + g3, m3 = h2[5] * s3 + m3, ur2(l2, f2, d3, p3, g3, m3));
return a2 && er2(), nr2(i3), this;
}, y2.path = function(t5) {
for (var e8 = 0; e8 < t5.length; e8++) {
var r3 = t5[e8], n2 = r3.c;
switch (r3.op) {
case "m":
sr2(n2[0], n2[1]);
break;
case "l":
cr2(n2[0], n2[1]);
break;
case "c":
ur2.apply(this, n2);
break;
case "h":
er2();
}
}
return this;
}, y2.__private__.rect = y2.rect = function(t5, e8, r3, n2, i3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n2) || !Qe2(i3))
throw new Error("Invalid arguments passed to jsPDF.rect");
return S2 === x2.COMPAT && (n2 = -n2), lt2([O2(U2(t5)), O2(H4(e8)), O2(U2(r3)), O2(U2(n2)), "re"].join(" ")), nr2(i3), this;
}, y2.__private__.triangle = y2.triangle = function(t5, e8, r3, n2, i3, a2, o3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n2) || isNaN(i3) || isNaN(a2) || !Qe2(o3))
throw new Error("Invalid arguments passed to jsPDF.triangle");
return this.lines([[r3 - t5, n2 - e8], [i3 - r3, a2 - n2], [t5 - i3, e8 - a2]], t5, e8, [1, 1], o3, true), this;
}, y2.__private__.roundedRect = y2.roundedRect = function(t5, e8, r3, n2, i3, a2, o3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n2) || isNaN(i3) || isNaN(a2) || !Qe2(o3))
throw new Error("Invalid arguments passed to jsPDF.roundedRect");
var s3 = 4 / 3 * (Math.SQRT2 - 1);
return i3 = Math.min(i3, 0.5 * r3), a2 = Math.min(a2, 0.5 * n2), this.lines([[r3 - 2 * i3, 0], [i3 * s3, 0, i3, a2 - a2 * s3, i3, a2], [0, n2 - 2 * a2], [0, a2 * s3, -i3 * s3, a2, -i3, a2], [2 * i3 - r3, 0], [-i3 * s3, 0, -i3, -a2 * s3, -i3, -a2], [0, 2 * a2 - n2], [0, -a2 * s3, i3 * s3, -a2, i3, -a2]], t5 + i3, e8, [1, 1], o3, true), this;
}, y2.__private__.ellipse = y2.ellipse = function(t5, e8, r3, n2, i3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n2) || !Qe2(i3))
throw new Error("Invalid arguments passed to jsPDF.ellipse");
var a2 = 4 / 3 * (Math.SQRT2 - 1) * r3, o3 = 4 / 3 * (Math.SQRT2 - 1) * n2;
return sr2(t5 + r3, e8), ur2(t5 + r3, e8 - o3, t5 + a2, e8 - n2, t5, e8 - n2), ur2(t5 - a2, e8 - n2, t5 - r3, e8 - o3, t5 - r3, e8), ur2(t5 - r3, e8 + o3, t5 - a2, e8 + n2, t5, e8 + n2), ur2(t5 + a2, e8 + n2, t5 + r3, e8 + o3, t5 + r3, e8), nr2(i3), this;
}, y2.__private__.circle = y2.circle = function(t5, e8, r3, n2) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || !Qe2(n2))
throw new Error("Invalid arguments passed to jsPDF.circle");
return this.ellipse(t5, e8, r3, r3, n2);
}, y2.setFont = function(t5, e8, r3) {
return r3 && (e8 = k2(e8, r3)), St2 = qe2(t5, e8, { disableWarning: false }), this;
};
var hr2 = y2.__private__.getFont = y2.getFont = function() {
return Ft2[qe2.apply(y2, arguments)];
};
y2.__private__.getFontList = y2.getFontList = function() {
var t5, e8, r3 = {};
for (t5 in Ct2)
if (Ct2.hasOwnProperty(t5))
for (e8 in r3[t5] = [], Ct2[t5])
Ct2[t5].hasOwnProperty(e8) && r3[t5].push(e8);
return r3;
}, y2.addFont = function(t5, e8, r3, n2, i3) {
var a2 = ["StandardEncoding", "MacRomanEncoding", "Identity-H", "WinAnsiEncoding"];
return arguments[3] && -1 !== a2.indexOf(arguments[3]) ? i3 = arguments[3] : arguments[3] && -1 == a2.indexOf(arguments[3]) && (r3 = k2(r3, n2)), i3 = i3 || "Identity-H", Pe2.call(this, t5, e8, r3, i3);
};
var lr2, fr2 = e7.lineWidth || 0.200025, dr2 = y2.__private__.getLineWidth = y2.getLineWidth = function() {
return fr2;
}, pr2 = y2.__private__.setLineWidth = y2.setLineWidth = function(t5) {
return fr2 = t5, lt2(O2(U2(t5)) + " w"), this;
};
y2.__private__.setLineDash = E$2.API.setLineDash = E$2.API.setLineDashPattern = function(t5, e8) {
if (t5 = t5 || [], e8 = e8 || 0, isNaN(e8) || !Array.isArray(t5))
throw new Error("Invalid arguments passed to jsPDF.setLineDash");
return t5 = t5.map(function(t6) {
return O2(U2(t6));
}).join(" "), e8 = O2(U2(e8)), lt2("[" + t5 + "] " + e8 + " d"), this;
};
var gr2 = y2.__private__.getLineHeight = y2.getLineHeight = function() {
return gt2 * lr2;
};
y2.__private__.getLineHeight = y2.getLineHeight = function() {
return gt2 * lr2;
};
var mr2 = y2.__private__.setLineHeightFactor = y2.setLineHeightFactor = function(t5) {
return "number" == typeof (t5 = t5 || 1.15) && (lr2 = t5), this;
}, vr2 = y2.__private__.getLineHeightFactor = y2.getLineHeightFactor = function() {
return lr2;
};
mr2(e7.lineHeight);
var br2 = y2.__private__.getHorizontalCoordinate = function(t5) {
return U2(t5);
}, yr2 = y2.__private__.getVerticalCoordinate = function(t5) {
return S2 === x2.ADVANCED ? t5 : Rt2[$2].mediaBox.topRightY - Rt2[$2].mediaBox.bottomLeftY - U2(t5);
}, wr2 = y2.__private__.getHorizontalCoordinateString = y2.getHorizontalCoordinateString = function(t5) {
return O2(br2(t5));
}, Nr2 = y2.__private__.getVerticalCoordinateString = y2.getVerticalCoordinateString = function(t5) {
return O2(yr2(t5));
}, Lr2 = e7.strokeColor || "0 G";
y2.__private__.getStrokeColor = y2.getDrawColor = function() {
return ee2(Lr2);
}, y2.__private__.setStrokeColor = y2.setDrawColor = function(t5, e8, r3, n2) {
return Lr2 = re2({ ch1: t5, ch2: e8, ch3: r3, ch4: n2, pdfColorType: "draw", precision: 2 }), lt2(Lr2), this;
};
var Ar2 = e7.fillColor || "0 g";
y2.__private__.getFillColor = y2.getFillColor = function() {
return ee2(Ar2);
}, y2.__private__.setFillColor = y2.setFillColor = function(t5, e8, r3, n2) {
return Ar2 = re2({ ch1: t5, ch2: e8, ch3: r3, ch4: n2, pdfColorType: "fill", precision: 2 }), lt2(Ar2), this;
};
var xr2 = e7.textColor || "0 g", Sr2 = y2.__private__.getTextColor = y2.getTextColor = function() {
return ee2(xr2);
};
y2.__private__.setTextColor = y2.setTextColor = function(t5, e8, r3, n2) {
return xr2 = re2({ ch1: t5, ch2: e8, ch3: r3, ch4: n2, pdfColorType: "text", precision: 3 }), this;
};
var _r2 = e7.charSpace, Pr2 = y2.__private__.getCharSpace = y2.getCharSpace = function() {
return parseFloat(_r2 || 0);
};
y2.__private__.setCharSpace = y2.setCharSpace = function(t5) {
if (isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.setCharSpace");
return _r2 = t5, this;
};
var kr = 0;
y2.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, y2.__private__.setLineCap = y2.setLineCap = function(t5) {
var e8 = y2.CapJoinStyles[t5];
if (void 0 === e8)
throw new Error("Line cap style of '" + t5 + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
return kr = e8, lt2(e8 + " J"), this;
};
var Ir2 = 0;
y2.__private__.setLineJoin = y2.setLineJoin = function(t5) {
var e8 = y2.CapJoinStyles[t5];
if (void 0 === e8)
throw new Error("Line join style of '" + t5 + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
return Ir2 = e8, lt2(e8 + " j"), this;
}, y2.__private__.setLineMiterLimit = y2.__private__.setMiterLimit = y2.setLineMiterLimit = y2.setMiterLimit = function(t5) {
if (t5 = t5 || 0, isNaN(t5))
throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
return lt2(O2(U2(t5)) + " M"), this;
}, y2.GState = j$1, y2.setGState = function(t5) {
(t5 = "string" == typeof t5 ? Mt2[Et2[t5]] : Fr2(null, t5)).equals(qt2) || (lt2("/" + t5.id + " gs"), qt2 = t5);
};
var Fr2 = function(t5, e8) {
if (!t5 || !Et2[t5]) {
var r3 = false;
for (var n2 in Mt2)
if (Mt2.hasOwnProperty(n2) && Mt2[n2].equals(e8)) {
r3 = true;
break;
}
if (r3)
e8 = Mt2[n2];
else {
var i3 = "GS" + (Object.keys(Mt2).length + 1).toString(10);
Mt2[i3] = e8, e8.id = i3;
}
return t5 && (Et2[t5] = e8.id), Tt2.publish("addGState", e8), e8;
}
};
y2.addGState = function(t5, e8) {
return Fr2(t5, e8), this;
}, y2.saveGraphicsState = function() {
return lt2("q"), jt2.push({ key: St2, size: gt2, color: xr2 }), this;
}, y2.restoreGraphicsState = function() {
lt2("Q");
var t5 = jt2.pop();
return St2 = t5.key, gt2 = t5.size, xr2 = t5.color, qt2 = null, this;
}, y2.setCurrentTransformationMatrix = function(t5) {
return lt2(t5.toString() + " cm"), this;
}, y2.comment = function(t5) {
return lt2("#" + t5), this;
};
var Cr2 = function(t5, e8) {
var r3 = t5 || 0;
Object.defineProperty(this, "x", { enumerable: true, get: function() {
return r3;
}, set: function(t6) {
isNaN(t6) || (r3 = parseFloat(t6));
} });
var n2 = e8 || 0;
Object.defineProperty(this, "y", { enumerable: true, get: function() {
return n2;
}, set: function(t6) {
isNaN(t6) || (n2 = parseFloat(t6));
} });
var i3 = "pt";
return Object.defineProperty(this, "type", { enumerable: true, get: function() {
return i3;
}, set: function(t6) {
i3 = t6.toString();
} }), this;
}, jr2 = function(t5, e8, r3, n2) {
Cr2.call(this, t5, e8), this.type = "rect";
var i3 = r3 || 0;
Object.defineProperty(this, "w", { enumerable: true, get: function() {
return i3;
}, set: function(t6) {
isNaN(t6) || (i3 = parseFloat(t6));
} });
var a2 = n2 || 0;
return Object.defineProperty(this, "h", { enumerable: true, get: function() {
return a2;
}, set: function(t6) {
isNaN(t6) || (a2 = parseFloat(t6));
} }), this;
}, Or2 = function() {
this.page = Dt2, this.currentPage = $2, this.pages = ot2.slice(0), this.pagesContext = Rt2.slice(0), this.x = Pt2, this.y = kt2, this.matrix = It2, this.width = qr2($2), this.height = Rr2($2), this.outputDestination = ct2, this.id = "", this.objectNumber = -1;
};
Or2.prototype.restore = function() {
Dt2 = this.page, $2 = this.currentPage, Rt2 = this.pagesContext, ot2 = this.pages, Pt2 = this.x, kt2 = this.y, It2 = this.matrix, Dr2($2, this.width), Tr2($2, this.height), ct2 = this.outputDestination;
};
var Br2 = function(t5, e8, r3, n2, i3) {
Wt2.push(new Or2()), Dt2 = $2 = 0, ot2 = [], Pt2 = t5, kt2 = e8, It2 = i3, je2([r3, n2]);
}, Mr2 = function(t5) {
if (Ht2[t5])
Wt2.pop().restore();
else {
var e8 = new Or2(), r3 = "Xo" + (Object.keys(zt2).length + 1).toString(10);
e8.id = r3, Ht2[t5] = r3, zt2[r3] = e8, Tt2.publish("addFormObject", e8), Wt2.pop().restore();
}
};
for (var Er2 in y2.beginFormObject = function(t5, e8, r3, n2, i3) {
return Br2(t5, e8, r3, n2, i3), this;
}, y2.endFormObject = function(t5) {
return Mr2(t5), this;
}, y2.doFormObject = function(t5, e8) {
var r3 = zt2[Ht2[t5]];
return lt2("q"), lt2(e8.toString() + " cm"), lt2("/" + r3.id + " Do"), lt2("Q"), this;
}, y2.getFormObject = function(t5) {
var e8 = zt2[Ht2[t5]];
return { x: e8.x, y: e8.y, width: e8.width, height: e8.height, matrix: e8.matrix };
}, y2.save = function(t5, e8) {
return t5 = t5 || "generated.pdf", (e8 = e8 || {}).returnPromise = e8.returnPromise || false, false === e8.returnPromise ? (l$1(We2(He2()), t5), "function" == typeof l$1.unload && n$8.setTimeout && setTimeout(l$1.unload, 911), this) : new Promise(function(e9, r3) {
try {
var i3 = l$1(We2(He2()), t5);
"function" == typeof l$1.unload && n$8.setTimeout && setTimeout(l$1.unload, 911), e9(i3);
} catch (t6) {
r3(t6.message);
}
});
}, E$2.API)
E$2.API.hasOwnProperty(Er2) && ("events" === Er2 && E$2.API.events.length ? function(t5, e8) {
var r3, n2, i3;
for (i3 = e8.length - 1; -1 !== i3; i3--)
r3 = e8[i3][0], n2 = e8[i3][1], t5.subscribe.apply(t5, [r3].concat("function" == typeof n2 ? [n2] : n2));
}(Tt2, E$2.API.events) : y2[Er2] = E$2.API[Er2]);
var qr2 = y2.getPageWidth = function(t5) {
return (Rt2[t5 = t5 || $2].mediaBox.topRightX - Rt2[t5].mediaBox.bottomLeftX) / _t2;
}, Dr2 = y2.setPageWidth = function(t5, e8) {
Rt2[t5].mediaBox.topRightX = e8 * _t2 + Rt2[t5].mediaBox.bottomLeftX;
}, Rr2 = y2.getPageHeight = function(t5) {
return (Rt2[t5 = t5 || $2].mediaBox.topRightY - Rt2[t5].mediaBox.bottomLeftY) / _t2;
}, Tr2 = y2.setPageHeight = function(t5, e8) {
Rt2[t5].mediaBox.topRightY = e8 * _t2 + Rt2[t5].mediaBox.bottomLeftY;
};
return y2.internal = { pdfEscape: Ce2, getStyle: tr2, getFont: hr2, getFontSize: vt2, getCharSpace: Pr2, getTextColor: Sr2, getLineHeight: gr2, getLineHeightFactor: vr2, getLineWidth: dr2, write: ft2, getHorizontalCoordinate: br2, getVerticalCoordinate: yr2, getCoordinateString: wr2, getVerticalCoordinateString: Nr2, collections: {}, newObject: Xt2, newAdditionalObject: $t2, newObjectDeferred: Kt2, newObjectDeferredBegin: Zt2, getFilters: ne2, putStream: ie2, events: Tt2, scaleFactor: _t2, pageSize: { getWidth: function() {
return qr2($2);
}, setWidth: function(t5) {
Dr2($2, t5);
}, getHeight: function() {
return Rr2($2);
}, setHeight: function(t5) {
Tr2($2, t5);
} }, encryptionOptions: m2, encryption: Ye2, getEncryptor: Je2, output: Ve2, getNumberOfPages: Ee2, pages: ot2, out: lt2, f2: R2, f3: T2, getPageInfo: Xe2, getPageInfoByObjId: Ke2, getCurrentPageInfo: Ze2, getPDFVersion: N2, Point: Cr2, Rectangle: jr2, Matrix: Vt2, hasHotfix: Ge2 }, Object.defineProperty(y2.internal.pageSize, "width", { get: function() {
return qr2($2);
}, set: function(t5) {
Dr2($2, t5);
}, enumerable: true, configurable: true }), Object.defineProperty(y2.internal.pageSize, "height", { get: function() {
return Rr2($2);
}, set: function(t5) {
Tr2($2, t5);
}, enumerable: true, configurable: true }), ke2.call(y2, pt2), St2 = "F1", Oe2(s2, i2), Tt2.publish("initialized"), y2;
}
I$1.prototype.lsbFirstWord = function(t5) {
return String.fromCharCode(t5 >> 0 & 255, t5 >> 8 & 255, t5 >> 16 & 255, t5 >> 24 & 255);
}, I$1.prototype.toHexString = function(t5) {
return t5.split("").map(function(t6) {
return ("0" + (255 & t6.charCodeAt(0)).toString(16)).slice(-2);
}).join("");
}, I$1.prototype.hexToBytes = function(t5) {
for (var e7 = [], r2 = 0; r2 < t5.length; r2 += 2)
e7.push(String.fromCharCode(parseInt(t5.substr(r2, 2), 16)));
return e7.join("");
}, I$1.prototype.processOwnerPassword = function(t5, e7) {
return P$1(x$1(e7).substr(0, 5), t5);
}, I$1.prototype.encryptor = function(t5, e7) {
var r2 = x$1(this.encryptionKey + String.fromCharCode(255 & t5, t5 >> 8 & 255, t5 >> 16 & 255, 255 & e7, e7 >> 8 & 255)).substr(0, 10);
return function(t6) {
return P$1(r2, t6);
};
}, j$1.prototype.equals = function(e7) {
var r2, n2 = "id,objectNumber,equals";
if (!e7 || _typeof$3(e7) !== _typeof$3(this))
return false;
var i2 = 0;
for (r2 in this)
if (!(n2.indexOf(r2) >= 0)) {
if (this.hasOwnProperty(r2) && !e7.hasOwnProperty(r2))
return false;
if (this[r2] !== e7[r2])
return false;
i2++;
}
for (r2 in e7)
e7.hasOwnProperty(r2) && n2.indexOf(r2) < 0 && i2--;
return 0 === i2;
}, E$2.API = { events: [] }, E$2.version = "2.5.1";
var q$1 = E$2.API, D$1 = 1, R$1 = function(t5) {
return t5.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, T$3 = function(t5) {
return t5.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
}, U$2 = function(t5) {
return t5.toFixed(2);
}, z$3 = function(t5) {
return t5.toFixed(5);
};
q$1.__acroform__ = {};
var H$1 = function(t5, e7) {
t5.prototype = Object.create(e7.prototype), t5.prototype.constructor = t5;
}, W$1 = function(t5) {
return t5 * D$1;
}, V$2 = function(t5) {
var e7 = new ut$1(), r2 = At$1.internal.getHeight(t5) || 0, n2 = At$1.internal.getWidth(t5) || 0;
return e7.BBox = [0, 0, Number(U$2(n2)), Number(U$2(r2))], e7;
}, G$1 = q$1.__acroform__.setBit = function(t5, e7) {
if (t5 = t5 || 0, e7 = e7 || 0, isNaN(t5) || isNaN(e7))
throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
return t5 |= 1 << e7;
}, Y$1 = q$1.__acroform__.clearBit = function(t5, e7) {
if (t5 = t5 || 0, e7 = e7 || 0, isNaN(t5) || isNaN(e7))
throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
return t5 &= ~(1 << e7);
}, J$1 = q$1.__acroform__.getBit = function(t5, e7) {
if (isNaN(t5) || isNaN(e7))
throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
return 0 == (t5 & 1 << e7) ? 0 : 1;
}, X$1 = q$1.__acroform__.getBitForPdf = function(t5, e7) {
if (isNaN(t5) || isNaN(e7))
throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
return J$1(t5, e7 - 1);
}, K$1 = q$1.__acroform__.setBitForPdf = function(t5, e7) {
if (isNaN(t5) || isNaN(e7))
throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
return G$1(t5, e7 - 1);
}, Z$2 = q$1.__acroform__.clearBitForPdf = function(t5, e7) {
if (isNaN(t5) || isNaN(e7))
throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
return Y$1(t5, e7 - 1);
}, $$g = q$1.__acroform__.calculateCoordinates = function(t5, e7) {
var r2 = e7.internal.getHorizontalCoordinate, n2 = e7.internal.getVerticalCoordinate, i2 = t5[0], a2 = t5[1], o2 = t5[2], s2 = t5[3], c2 = {};
return c2.lowerLeft_X = r2(i2) || 0, c2.lowerLeft_Y = n2(a2 + s2) || 0, c2.upperRight_X = r2(i2 + o2) || 0, c2.upperRight_Y = n2(a2) || 0, [Number(U$2(c2.lowerLeft_X)), Number(U$2(c2.lowerLeft_Y)), Number(U$2(c2.upperRight_X)), Number(U$2(c2.upperRight_Y))];
}, Q$1 = function(t5) {
if (t5.appearanceStreamContent)
return t5.appearanceStreamContent;
if (t5.V || t5.DV) {
var e7 = [], r2 = t5._V || t5.DV, n2 = tt$1(t5, r2), i2 = t5.scope.internal.getFont(t5.fontName, t5.fontStyle).id;
e7.push("/Tx BMC"), e7.push("q"), e7.push("BT"), e7.push(t5.scope.__private__.encodeColorString(t5.color)), e7.push("/" + i2 + " " + U$2(n2.fontSize) + " Tf"), e7.push("1 0 0 1 0 0 Tm"), e7.push(n2.text), e7.push("ET"), e7.push("Q"), e7.push("EMC");
var a2 = V$2(t5);
return a2.scope = t5.scope, a2.stream = e7.join("\n"), a2;
}
}, tt$1 = function(t5, e7) {
var r2 = 0 === t5.fontSize ? t5.maxFontSize : t5.fontSize, n2 = { text: "", fontSize: "" }, i2 = (e7 = ")" == (e7 = "(" == e7.substr(0, 1) ? e7.substr(1) : e7).substr(e7.length - 1) ? e7.substr(0, e7.length - 1) : e7).split(" ");
i2 = t5.multiline ? i2.map(function(t6) {
return t6.split("\n");
}) : i2.map(function(t6) {
return [t6];
});
var a2 = r2, o2 = At$1.internal.getHeight(t5) || 0;
o2 = o2 < 0 ? -o2 : o2;
var s2 = At$1.internal.getWidth(t5) || 0;
s2 = s2 < 0 ? -s2 : s2;
var c2 = function(e8, r3, n3) {
if (e8 + 1 < i2.length) {
var a3 = r3 + " " + i2[e8 + 1][0];
return et$1(a3, t5, n3).width <= s2 - 4;
}
return false;
};
a2++;
t:
for (; a2 > 0; ) {
e7 = "", a2--;
var u2, h2, l2 = et$1("3", t5, a2).height, f2 = t5.multiline ? o2 - a2 : (o2 - l2) / 2, d2 = f2 += 2, p2 = 0, g2 = 0, m2 = 0;
if (a2 <= 0) {
e7 = "(...) Tj\n", e7 += "% Width of Text: " + et$1(e7, t5, a2 = 12).width + ", FieldWidth:" + s2 + "\n";
break;
}
for (var v2 = "", b2 = 0, y2 = 0; y2 < i2.length; y2++)
if (i2.hasOwnProperty(y2)) {
var w2 = false;
if (1 !== i2[y2].length && m2 !== i2[y2].length - 1) {
if ((l2 + 2) * (b2 + 2) + 2 > o2)
continue t;
v2 += i2[y2][m2], w2 = true, g2 = y2, y2--;
} else {
v2 = " " == (v2 += i2[y2][m2] + " ").substr(v2.length - 1) ? v2.substr(0, v2.length - 1) : v2;
var N2 = parseInt(y2), L2 = c2(N2, v2, a2), A5 = y2 >= i2.length - 1;
if (L2 && !A5) {
v2 += " ", m2 = 0;
continue;
}
if (L2 || A5) {
if (A5)
g2 = N2;
else if (t5.multiline && (l2 + 2) * (b2 + 2) + 2 > o2)
continue t;
} else {
if (!t5.multiline)
continue t;
if ((l2 + 2) * (b2 + 2) + 2 > o2)
continue t;
g2 = N2;
}
}
for (var x2 = "", S2 = p2; S2 <= g2; S2++) {
var _24 = i2[S2];
if (t5.multiline) {
if (S2 === g2) {
x2 += _24[m2] + " ", m2 = (m2 + 1) % _24.length;
continue;
}
if (S2 === p2) {
x2 += _24[_24.length - 1] + " ";
continue;
}
}
x2 += _24[0] + " ";
}
switch (x2 = " " == x2.substr(x2.length - 1) ? x2.substr(0, x2.length - 1) : x2, h2 = et$1(x2, t5, a2).width, t5.textAlign) {
case "right":
u2 = s2 - h2 - 2;
break;
case "center":
u2 = (s2 - h2) / 2;
break;
case "left":
default:
u2 = 2;
}
e7 += U$2(u2) + " " + U$2(d2) + " Td\n", e7 += "(" + R$1(x2) + ") Tj\n", e7 += -U$2(u2) + " 0 Td\n", d2 = -(a2 + 2), h2 = 0, p2 = w2 ? g2 : g2 + 1, b2++, v2 = "";
}
break;
}
return n2.text = e7, n2.fontSize = a2, n2;
}, et$1 = function(t5, e7, r2) {
var n2 = e7.scope.internal.getFont(e7.fontName, e7.fontStyle), i2 = e7.scope.getStringUnitWidth(t5, { font: n2, fontSize: parseFloat(r2), charSpace: 0 }) * parseFloat(r2);
return { height: e7.scope.getStringUnitWidth("3", { font: n2, fontSize: parseFloat(r2), charSpace: 0 }) * parseFloat(r2) * 1.5, width: i2 };
}, rt$1 = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: false, internal: null, isInitialized: false }, nt$1 = function(t5, e7) {
var r2 = { type: "reference", object: t5 };
void 0 === e7.internal.getPageInfo(t5.page).pageContext.annotations.find(function(t6) {
return t6.type === r2.type && t6.object === r2.object;
}) && e7.internal.getPageInfo(t5.page).pageContext.annotations.push(r2);
}, it$1 = function(e7, r2) {
for (var n2 in e7)
if (e7.hasOwnProperty(n2)) {
var i2 = n2, a2 = e7[n2];
r2.internal.newObjectDeferredBegin(a2.objId, true), "object" === _typeof$3(a2) && "function" == typeof a2.putStream && a2.putStream(), delete e7[i2];
}
}, at$1 = function(e7, r2) {
if (r2.scope = e7, void 0 !== e7.internal && (void 0 === e7.internal.acroformPlugin || false === e7.internal.acroformPlugin.isInitialized)) {
if (lt$1.FieldNum = 0, e7.internal.acroformPlugin = JSON.parse(JSON.stringify(rt$1)), e7.internal.acroformPlugin.acroFormDictionaryRoot)
throw new Error("Exception while creating AcroformDictionary");
D$1 = e7.internal.scaleFactor, e7.internal.acroformPlugin.acroFormDictionaryRoot = new ht$1(), e7.internal.acroformPlugin.acroFormDictionaryRoot.scope = e7, e7.internal.acroformPlugin.acroFormDictionaryRoot._eventID = e7.internal.events.subscribe("postPutResources", function() {
!function(t5) {
t5.internal.events.unsubscribe(t5.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete t5.internal.acroformPlugin.acroFormDictionaryRoot._eventID, t5.internal.acroformPlugin.printedOut = true;
}(e7);
}), e7.internal.events.subscribe("buildDocument", function() {
!function(t5) {
t5.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
var e8 = t5.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
for (var r3 in e8)
if (e8.hasOwnProperty(r3)) {
var n2 = e8[r3];
n2.objId = void 0, n2.hasAnnotation && nt$1(n2, t5);
}
}(e7);
}), e7.internal.events.subscribe("putCatalog", function() {
!function(t5) {
if (void 0 === t5.internal.acroformPlugin.acroFormDictionaryRoot)
throw new Error("putCatalogCallback: Root missing.");
t5.internal.write("/AcroForm " + t5.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R");
}(e7);
}), e7.internal.events.subscribe("postPutPages", function(r3) {
!function(e8, r4) {
var n2 = !e8;
for (var i2 in e8 || (r4.internal.newObjectDeferredBegin(r4.internal.acroformPlugin.acroFormDictionaryRoot.objId, true), r4.internal.acroformPlugin.acroFormDictionaryRoot.putStream()), e8 = e8 || r4.internal.acroformPlugin.acroFormDictionaryRoot.Kids)
if (e8.hasOwnProperty(i2)) {
var a2 = e8[i2], o2 = [], s2 = a2.Rect;
if (a2.Rect && (a2.Rect = $$g(a2.Rect, r4)), r4.internal.newObjectDeferredBegin(a2.objId, true), a2.DA = At$1.createDefaultAppearanceStream(a2), "object" === _typeof$3(a2) && "function" == typeof a2.getKeyValueListForStream && (o2 = a2.getKeyValueListForStream()), a2.Rect = s2, a2.hasAppearanceStream && !a2.appearanceStreamContent) {
var c2 = Q$1(a2);
o2.push({ key: "AP", value: "<</N " + c2 + ">>" }), r4.internal.acroformPlugin.xForms.push(c2);
}
if (a2.appearanceStreamContent) {
var u2 = "";
for (var h2 in a2.appearanceStreamContent)
if (a2.appearanceStreamContent.hasOwnProperty(h2)) {
var l2 = a2.appearanceStreamContent[h2];
if (u2 += "/" + h2 + " ", u2 += "<<", Object.keys(l2).length >= 1 || Array.isArray(l2)) {
for (var i2 in l2)
if (l2.hasOwnProperty(i2)) {
var f2 = l2[i2];
"function" == typeof f2 && (f2 = f2.call(r4, a2)), u2 += "/" + i2 + " " + f2 + " ", r4.internal.acroformPlugin.xForms.indexOf(f2) >= 0 || r4.internal.acroformPlugin.xForms.push(f2);
}
} else
"function" == typeof (f2 = l2) && (f2 = f2.call(r4, a2)), u2 += "/" + i2 + " " + f2, r4.internal.acroformPlugin.xForms.indexOf(f2) >= 0 || r4.internal.acroformPlugin.xForms.push(f2);
u2 += ">>";
}
o2.push({ key: "AP", value: "<<\n" + u2 + ">>" });
}
r4.internal.putStream({ additionalKeyValues: o2, objectId: a2.objId }), r4.internal.out("endobj");
}
n2 && it$1(r4.internal.acroformPlugin.xForms, r4);
}(r3, e7);
}), e7.internal.acroformPlugin.isInitialized = true;
}
}, ot$1 = q$1.__acroform__.arrayToPdfArray = function(e7, r2, n2) {
var i2 = function(t5) {
return t5;
};
if (Array.isArray(e7)) {
for (var a2 = "[", o2 = 0; o2 < e7.length; o2++)
switch (0 !== o2 && (a2 += " "), _typeof$3(e7[o2])) {
case "boolean":
case "number":
case "object":
a2 += e7[o2].toString();
break;
case "string":
"/" !== e7[o2].substr(0, 1) ? (void 0 !== r2 && n2 && (i2 = n2.internal.getEncryptor(r2)), a2 += "(" + R$1(i2(e7[o2].toString())) + ")") : a2 += e7[o2].toString();
}
return a2 += "]";
}
throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray");
};
var st$1 = function(t5, e7, r2) {
var n2 = function(t6) {
return t6;
};
return void 0 !== e7 && r2 && (n2 = r2.internal.getEncryptor(e7)), (t5 = t5 || "").toString(), t5 = "(" + R$1(n2(t5)) + ")";
}, ct$1 = function() {
this._objId = void 0, this._scope = void 0, Object.defineProperty(this, "objId", { get: function() {
if (void 0 === this._objId) {
if (void 0 === this.scope)
return;
this._objId = this.scope.internal.newObjectDeferred();
}
return this._objId;
}, set: function(t5) {
this._objId = t5;
} }), Object.defineProperty(this, "scope", { value: this._scope, writable: true });
};
ct$1.prototype.toString = function() {
return this.objId + " 0 R";
}, ct$1.prototype.putStream = function() {
var t5 = this.getKeyValueListForStream();
this.scope.internal.putStream({ data: this.stream, additionalKeyValues: t5, objectId: this.objId }), this.scope.internal.out("endobj");
}, ct$1.prototype.getKeyValueListForStream = function() {
var t5 = [], e7 = Object.getOwnPropertyNames(this).filter(function(t6) {
return "content" != t6 && "appearanceStreamContent" != t6 && "scope" != t6 && "objId" != t6 && "_" != t6.substring(0, 1);
});
for (var r2 in e7)
if (false === Object.getOwnPropertyDescriptor(this, e7[r2]).configurable) {
var n2 = e7[r2], i2 = this[n2];
i2 && (Array.isArray(i2) ? t5.push({ key: n2, value: ot$1(i2, this.objId, this.scope) }) : i2 instanceof ct$1 ? (i2.scope = this.scope, t5.push({ key: n2, value: i2.objId + " 0 R" })) : "function" != typeof i2 && t5.push({ key: n2, value: i2 }));
}
return t5;
};
var ut$1 = function() {
ct$1.call(this), Object.defineProperty(this, "Type", { value: "/XObject", configurable: false, writable: true }), Object.defineProperty(this, "Subtype", { value: "/Form", configurable: false, writable: true }), Object.defineProperty(this, "FormType", { value: 1, configurable: false, writable: true });
var t5, e7 = [];
Object.defineProperty(this, "BBox", { configurable: false, get: function() {
return e7;
}, set: function(t6) {
e7 = t6;
} }), Object.defineProperty(this, "Resources", { value: "2 0 R", configurable: false, writable: true }), Object.defineProperty(this, "stream", { enumerable: false, configurable: true, set: function(e8) {
t5 = e8.trim();
}, get: function() {
return t5 || null;
} });
};
H$1(ut$1, ct$1);
var ht$1 = function() {
ct$1.call(this);
var t5, e7 = [];
Object.defineProperty(this, "Kids", { enumerable: false, configurable: true, get: function() {
return e7.length > 0 ? e7 : void 0;
} }), Object.defineProperty(this, "Fields", { enumerable: false, configurable: false, get: function() {
return e7;
} }), Object.defineProperty(this, "DA", { enumerable: false, configurable: false, get: function() {
if (t5) {
var e8 = function(t6) {
return t6;
};
return this.scope && (e8 = this.scope.internal.getEncryptor(this.objId)), "(" + R$1(e8(t5)) + ")";
}
}, set: function(e8) {
t5 = e8;
} });
};
H$1(ht$1, ct$1);
var lt$1 = function t() {
ct$1.call(this);
var e7 = 4;
Object.defineProperty(this, "F", { enumerable: false, configurable: false, get: function() {
return e7;
}, set: function(t5) {
if (isNaN(t5))
throw new Error('Invalid value "' + t5 + '" for attribute F supplied.');
e7 = t5;
} }), Object.defineProperty(this, "showWhenPrinted", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(e7, 3));
}, set: function(t5) {
true === Boolean(t5) ? this.F = K$1(e7, 3) : this.F = Z$2(e7, 3);
} });
var r2 = 0;
Object.defineProperty(this, "Ff", { enumerable: false, configurable: false, get: function() {
return r2;
}, set: function(t5) {
if (isNaN(t5))
throw new Error('Invalid value "' + t5 + '" for attribute Ff supplied.');
r2 = t5;
} });
var n2 = [];
Object.defineProperty(this, "Rect", { enumerable: false, configurable: false, get: function() {
if (0 !== n2.length)
return n2;
}, set: function(t5) {
n2 = void 0 !== t5 ? t5 : [];
} }), Object.defineProperty(this, "x", { enumerable: true, configurable: true, get: function() {
return !n2 || isNaN(n2[0]) ? 0 : n2[0];
}, set: function(t5) {
n2[0] = t5;
} }), Object.defineProperty(this, "y", { enumerable: true, configurable: true, get: function() {
return !n2 || isNaN(n2[1]) ? 0 : n2[1];
}, set: function(t5) {
n2[1] = t5;
} }), Object.defineProperty(this, "width", { enumerable: true, configurable: true, get: function() {
return !n2 || isNaN(n2[2]) ? 0 : n2[2];
}, set: function(t5) {
n2[2] = t5;
} }), Object.defineProperty(this, "height", { enumerable: true, configurable: true, get: function() {
return !n2 || isNaN(n2[3]) ? 0 : n2[3];
}, set: function(t5) {
n2[3] = t5;
} });
var i2 = "";
Object.defineProperty(this, "FT", { enumerable: true, configurable: false, get: function() {
return i2;
}, set: function(t5) {
switch (t5) {
case "/Btn":
case "/Tx":
case "/Ch":
case "/Sig":
i2 = t5;
break;
default:
throw new Error('Invalid value "' + t5 + '" for attribute FT supplied.');
}
} });
var a2 = null;
Object.defineProperty(this, "T", { enumerable: true, configurable: false, get: function() {
if (!a2 || a2.length < 1) {
if (this instanceof yt$1)
return;
a2 = "FieldObject" + t.FieldNum++;
}
var e8 = function(t5) {
return t5;
};
return this.scope && (e8 = this.scope.internal.getEncryptor(this.objId)), "(" + R$1(e8(a2)) + ")";
}, set: function(t5) {
a2 = t5.toString();
} }), Object.defineProperty(this, "fieldName", { configurable: true, enumerable: true, get: function() {
return a2;
}, set: function(t5) {
a2 = t5;
} });
var o2 = "helvetica";
Object.defineProperty(this, "fontName", { enumerable: true, configurable: true, get: function() {
return o2;
}, set: function(t5) {
o2 = t5;
} });
var s2 = "normal";
Object.defineProperty(this, "fontStyle", { enumerable: true, configurable: true, get: function() {
return s2;
}, set: function(t5) {
s2 = t5;
} });
var c2 = 0;
Object.defineProperty(this, "fontSize", { enumerable: true, configurable: true, get: function() {
return c2;
}, set: function(t5) {
c2 = t5;
} });
var u2 = void 0;
Object.defineProperty(this, "maxFontSize", { enumerable: true, configurable: true, get: function() {
return void 0 === u2 ? 50 / D$1 : u2;
}, set: function(t5) {
u2 = t5;
} });
var h2 = "black";
Object.defineProperty(this, "color", { enumerable: true, configurable: true, get: function() {
return h2;
}, set: function(t5) {
h2 = t5;
} });
var l2 = "/F1 0 Tf 0 g";
Object.defineProperty(this, "DA", { enumerable: true, configurable: false, get: function() {
if (!(!l2 || this instanceof yt$1 || this instanceof Nt$1))
return st$1(l2, this.objId, this.scope);
}, set: function(t5) {
t5 = t5.toString(), l2 = t5;
} });
var f2 = null;
Object.defineProperty(this, "DV", { enumerable: false, configurable: false, get: function() {
if (f2)
return this instanceof mt$1 == false ? st$1(f2, this.objId, this.scope) : f2;
}, set: function(t5) {
t5 = t5.toString(), f2 = this instanceof mt$1 == false ? "(" === t5.substr(0, 1) ? T$3(t5.substr(1, t5.length - 2)) : T$3(t5) : t5;
} }), Object.defineProperty(this, "defaultValue", { enumerable: true, configurable: true, get: function() {
return this instanceof mt$1 == true ? T$3(f2.substr(1, f2.length - 1)) : f2;
}, set: function(t5) {
t5 = t5.toString(), f2 = this instanceof mt$1 == true ? "/" + t5 : t5;
} });
var d2 = null;
Object.defineProperty(this, "_V", { enumerable: false, configurable: false, get: function() {
if (d2)
return d2;
}, set: function(t5) {
this.V = t5;
} }), Object.defineProperty(this, "V", { enumerable: false, configurable: false, get: function() {
if (d2)
return this instanceof mt$1 == false ? st$1(d2, this.objId, this.scope) : d2;
}, set: function(t5) {
t5 = t5.toString(), d2 = this instanceof mt$1 == false ? "(" === t5.substr(0, 1) ? T$3(t5.substr(1, t5.length - 2)) : T$3(t5) : t5;
} }), Object.defineProperty(this, "value", { enumerable: true, configurable: true, get: function() {
return this instanceof mt$1 == true ? T$3(d2.substr(1, d2.length - 1)) : d2;
}, set: function(t5) {
t5 = t5.toString(), d2 = this instanceof mt$1 == true ? "/" + t5 : t5;
} }), Object.defineProperty(this, "hasAnnotation", { enumerable: true, configurable: true, get: function() {
return this.Rect;
} }), Object.defineProperty(this, "Type", { enumerable: true, configurable: false, get: function() {
return this.hasAnnotation ? "/Annot" : null;
} }), Object.defineProperty(this, "Subtype", { enumerable: true, configurable: false, get: function() {
return this.hasAnnotation ? "/Widget" : null;
} });
var p2, g2 = false;
Object.defineProperty(this, "hasAppearanceStream", { enumerable: true, configurable: true, get: function() {
return g2;
}, set: function(t5) {
t5 = Boolean(t5), g2 = t5;
} }), Object.defineProperty(this, "page", { enumerable: true, configurable: true, get: function() {
if (p2)
return p2;
}, set: function(t5) {
p2 = t5;
} }), Object.defineProperty(this, "readOnly", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 1));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 1) : this.Ff = Z$2(this.Ff, 1);
} }), Object.defineProperty(this, "required", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 2));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 2) : this.Ff = Z$2(this.Ff, 2);
} }), Object.defineProperty(this, "noExport", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 3));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 3) : this.Ff = Z$2(this.Ff, 3);
} });
var m2 = null;
Object.defineProperty(this, "Q", { enumerable: true, configurable: false, get: function() {
if (null !== m2)
return m2;
}, set: function(t5) {
if (-1 === [0, 1, 2].indexOf(t5))
throw new Error('Invalid value "' + t5 + '" for attribute Q supplied.');
m2 = t5;
} }), Object.defineProperty(this, "textAlign", { get: function() {
var t5;
switch (m2) {
case 0:
default:
t5 = "left";
break;
case 1:
t5 = "center";
break;
case 2:
t5 = "right";
}
return t5;
}, configurable: true, enumerable: true, set: function(t5) {
switch (t5) {
case "right":
case 2:
m2 = 2;
break;
case "center":
case 1:
m2 = 1;
break;
case "left":
case 0:
default:
m2 = 0;
}
} });
};
H$1(lt$1, ct$1);
var ft$1 = function() {
lt$1.call(this), this.FT = "/Ch", this.V = "()", this.fontName = "zapfdingbats";
var t5 = 0;
Object.defineProperty(this, "TI", { enumerable: true, configurable: false, get: function() {
return t5;
}, set: function(e8) {
t5 = e8;
} }), Object.defineProperty(this, "topIndex", { enumerable: true, configurable: true, get: function() {
return t5;
}, set: function(e8) {
t5 = e8;
} });
var e7 = [];
Object.defineProperty(this, "Opt", { enumerable: true, configurable: false, get: function() {
return ot$1(e7, this.objId, this.scope);
}, set: function(t6) {
var r2, n2;
n2 = [], "string" == typeof (r2 = t6) && (n2 = function(t7, e8, r3) {
r3 || (r3 = 1);
for (var n3, i2 = []; n3 = e8.exec(t7); )
i2.push(n3[r3]);
return i2;
}(r2, /\((.*?)\)/g)), e7 = n2;
} }), this.getOptions = function() {
return e7;
}, this.setOptions = function(t6) {
e7 = t6, this.sort && e7.sort();
}, this.addOption = function(t6) {
t6 = (t6 = t6 || "").toString(), e7.push(t6), this.sort && e7.sort();
}, this.removeOption = function(t6, r2) {
for (r2 = r2 || false, t6 = (t6 = t6 || "").toString(); -1 !== e7.indexOf(t6) && (e7.splice(e7.indexOf(t6), 1), false !== r2); )
;
}, Object.defineProperty(this, "combo", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 18));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 18) : this.Ff = Z$2(this.Ff, 18);
} }), Object.defineProperty(this, "edit", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 19));
}, set: function(t6) {
true === this.combo && (true === Boolean(t6) ? this.Ff = K$1(this.Ff, 19) : this.Ff = Z$2(this.Ff, 19));
} }), Object.defineProperty(this, "sort", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 20));
}, set: function(t6) {
true === Boolean(t6) ? (this.Ff = K$1(this.Ff, 20), e7.sort()) : this.Ff = Z$2(this.Ff, 20);
} }), Object.defineProperty(this, "multiSelect", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 22));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 22) : this.Ff = Z$2(this.Ff, 22);
} }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 23));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 23) : this.Ff = Z$2(this.Ff, 23);
} }), Object.defineProperty(this, "commitOnSelChange", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 27));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 27) : this.Ff = Z$2(this.Ff, 27);
} }), this.hasAppearanceStream = false;
};
H$1(ft$1, lt$1);
var dt$1 = function() {
ft$1.call(this), this.fontName = "helvetica", this.combo = false;
};
H$1(dt$1, ft$1);
var pt$1 = function() {
dt$1.call(this), this.combo = true;
};
H$1(pt$1, dt$1);
var gt$1 = function() {
pt$1.call(this), this.edit = true;
};
H$1(gt$1, pt$1);
var mt$1 = function() {
lt$1.call(this), this.FT = "/Btn", Object.defineProperty(this, "noToggleToOff", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 15));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 15) : this.Ff = Z$2(this.Ff, 15);
} }), Object.defineProperty(this, "radio", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 16));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 16) : this.Ff = Z$2(this.Ff, 16);
} }), Object.defineProperty(this, "pushButton", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 17));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 17) : this.Ff = Z$2(this.Ff, 17);
} }), Object.defineProperty(this, "radioIsUnison", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 26));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 26) : this.Ff = Z$2(this.Ff, 26);
} });
var e7, r2 = {};
Object.defineProperty(this, "MK", { enumerable: false, configurable: false, get: function() {
var t5 = function(t6) {
return t6;
};
if (this.scope && (t5 = this.scope.internal.getEncryptor(this.objId)), 0 !== Object.keys(r2).length) {
var e8, n2 = [];
for (e8 in n2.push("<<"), r2)
n2.push("/" + e8 + " (" + R$1(t5(r2[e8])) + ")");
return n2.push(">>"), n2.join("\n");
}
}, set: function(e8) {
"object" === _typeof$3(e8) && (r2 = e8);
} }), Object.defineProperty(this, "caption", { enumerable: true, configurable: true, get: function() {
return r2.CA || "";
}, set: function(t5) {
"string" == typeof t5 && (r2.CA = t5);
} }), Object.defineProperty(this, "AS", { enumerable: false, configurable: false, get: function() {
return e7;
}, set: function(t5) {
e7 = t5;
} }), Object.defineProperty(this, "appearanceState", { enumerable: true, configurable: true, get: function() {
return e7.substr(1, e7.length - 1);
}, set: function(t5) {
e7 = "/" + t5;
} });
};
H$1(mt$1, lt$1);
var vt$1 = function() {
mt$1.call(this), this.pushButton = true;
};
H$1(vt$1, mt$1);
var bt$1 = function() {
mt$1.call(this), this.radio = true, this.pushButton = false;
var t5 = [];
Object.defineProperty(this, "Kids", { enumerable: true, configurable: false, get: function() {
return t5;
}, set: function(e7) {
t5 = void 0 !== e7 ? e7 : [];
} });
};
H$1(bt$1, mt$1);
var yt$1 = function() {
var e7, r2;
lt$1.call(this), Object.defineProperty(this, "Parent", { enumerable: false, configurable: false, get: function() {
return e7;
}, set: function(t5) {
e7 = t5;
} }), Object.defineProperty(this, "optionName", { enumerable: false, configurable: true, get: function() {
return r2;
}, set: function(t5) {
r2 = t5;
} });
var n2, i2 = {};
Object.defineProperty(this, "MK", { enumerable: false, configurable: false, get: function() {
var t5 = function(t6) {
return t6;
};
this.scope && (t5 = this.scope.internal.getEncryptor(this.objId));
var e8, r3 = [];
for (e8 in r3.push("<<"), i2)
r3.push("/" + e8 + " (" + R$1(t5(i2[e8])) + ")");
return r3.push(">>"), r3.join("\n");
}, set: function(e8) {
"object" === _typeof$3(e8) && (i2 = e8);
} }), Object.defineProperty(this, "caption", { enumerable: true, configurable: true, get: function() {
return i2.CA || "";
}, set: function(t5) {
"string" == typeof t5 && (i2.CA = t5);
} }), Object.defineProperty(this, "AS", { enumerable: false, configurable: false, get: function() {
return n2;
}, set: function(t5) {
n2 = t5;
} }), Object.defineProperty(this, "appearanceState", { enumerable: true, configurable: true, get: function() {
return n2.substr(1, n2.length - 1);
}, set: function(t5) {
n2 = "/" + t5;
} }), this.caption = "l", this.appearanceState = "Off", this._AppearanceType = At$1.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName);
};
H$1(yt$1, lt$1), bt$1.prototype.setAppearance = function(t5) {
if (!("createAppearanceStream" in t5) || !("getCA" in t5))
throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
for (var e7 in this.Kids)
if (this.Kids.hasOwnProperty(e7)) {
var r2 = this.Kids[e7];
r2.appearanceStreamContent = t5.createAppearanceStream(r2.optionName), r2.caption = t5.getCA();
}
}, bt$1.prototype.createOption = function(t5) {
var e7 = new yt$1();
return e7.Parent = this, e7.optionName = t5, this.Kids.push(e7), xt$1.call(this.scope, e7), e7;
};
var wt$1 = function() {
mt$1.call(this), this.fontName = "zapfdingbats", this.caption = "3", this.appearanceState = "On", this.value = "On", this.textAlign = "center", this.appearanceStreamContent = At$1.CheckBox.createAppearanceStream();
};
H$1(wt$1, mt$1);
var Nt$1 = function() {
lt$1.call(this), this.FT = "/Tx", Object.defineProperty(this, "multiline", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 13));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 13) : this.Ff = Z$2(this.Ff, 13);
} }), Object.defineProperty(this, "fileSelect", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 21));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 21) : this.Ff = Z$2(this.Ff, 21);
} }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 23));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 23) : this.Ff = Z$2(this.Ff, 23);
} }), Object.defineProperty(this, "doNotScroll", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 24));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 24) : this.Ff = Z$2(this.Ff, 24);
} }), Object.defineProperty(this, "comb", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 25));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 25) : this.Ff = Z$2(this.Ff, 25);
} }), Object.defineProperty(this, "richText", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 26));
}, set: function(t6) {
true === Boolean(t6) ? this.Ff = K$1(this.Ff, 26) : this.Ff = Z$2(this.Ff, 26);
} });
var t5 = null;
Object.defineProperty(this, "MaxLen", { enumerable: true, configurable: false, get: function() {
return t5;
}, set: function(e7) {
t5 = e7;
} }), Object.defineProperty(this, "maxLength", { enumerable: true, configurable: true, get: function() {
return t5;
}, set: function(e7) {
Number.isInteger(e7) && (t5 = e7);
} }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: true, configurable: true, get: function() {
return this.V || this.DV;
} });
};
H$1(Nt$1, lt$1);
var Lt$1 = function() {
Nt$1.call(this), Object.defineProperty(this, "password", { enumerable: true, configurable: true, get: function() {
return Boolean(X$1(this.Ff, 14));
}, set: function(t5) {
true === Boolean(t5) ? this.Ff = K$1(this.Ff, 14) : this.Ff = Z$2(this.Ff, 14);
} }), this.password = true;
};
H$1(Lt$1, Nt$1);
var At$1 = { CheckBox: { createAppearanceStream: function() {
return { N: { On: At$1.CheckBox.YesNormal }, D: { On: At$1.CheckBox.YesPushDown, Off: At$1.CheckBox.OffPushDown } };
}, YesPushDown: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [], n2 = t5.scope.internal.getFont(t5.fontName, t5.fontStyle).id, i2 = t5.scope.__private__.encodeColorString(t5.color), a2 = tt$1(t5, t5.caption);
return r2.push("0.749023 g"), r2.push("0 0 " + U$2(At$1.internal.getWidth(t5)) + " " + U$2(At$1.internal.getHeight(t5)) + " re"), r2.push("f"), r2.push("BMC"), r2.push("q"), r2.push("0 0 1 rg"), r2.push("/" + n2 + " " + U$2(a2.fontSize) + " Tf " + i2), r2.push("BT"), r2.push(a2.text), r2.push("ET"), r2.push("Q"), r2.push("EMC"), e7.stream = r2.join("\n"), e7;
}, YesNormal: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = t5.scope.internal.getFont(t5.fontName, t5.fontStyle).id, n2 = t5.scope.__private__.encodeColorString(t5.color), i2 = [], a2 = At$1.internal.getHeight(t5), o2 = At$1.internal.getWidth(t5), s2 = tt$1(t5, t5.caption);
return i2.push("1 g"), i2.push("0 0 " + U$2(o2) + " " + U$2(a2) + " re"), i2.push("f"), i2.push("q"), i2.push("0 0 1 rg"), i2.push("0 0 " + U$2(o2 - 1) + " " + U$2(a2 - 1) + " re"), i2.push("W"), i2.push("n"), i2.push("0 g"), i2.push("BT"), i2.push("/" + r2 + " " + U$2(s2.fontSize) + " Tf " + n2), i2.push(s2.text), i2.push("ET"), i2.push("Q"), e7.stream = i2.join("\n"), e7;
}, OffPushDown: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [];
return r2.push("0.749023 g"), r2.push("0 0 " + U$2(At$1.internal.getWidth(t5)) + " " + U$2(At$1.internal.getHeight(t5)) + " re"), r2.push("f"), e7.stream = r2.join("\n"), e7;
} }, RadioButton: { Circle: { createAppearanceStream: function(t5) {
var e7 = { D: { Off: At$1.RadioButton.Circle.OffPushDown }, N: {} };
return e7.N[t5] = At$1.RadioButton.Circle.YesNormal, e7.D[t5] = At$1.RadioButton.Circle.YesPushDown, e7;
}, getCA: function() {
return "l";
}, YesNormal: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [], n2 = At$1.internal.getWidth(t5) <= At$1.internal.getHeight(t5) ? At$1.internal.getWidth(t5) / 4 : At$1.internal.getHeight(t5) / 4;
n2 = Number((0.9 * n2).toFixed(5));
var i2 = At$1.internal.Bezier_C, a2 = Number((n2 * i2).toFixed(5));
return r2.push("q"), r2.push("1 0 0 1 " + z$3(At$1.internal.getWidth(t5) / 2) + " " + z$3(At$1.internal.getHeight(t5) / 2) + " cm"), r2.push(n2 + " 0 m"), r2.push(n2 + " " + a2 + " " + a2 + " " + n2 + " 0 " + n2 + " c"), r2.push("-" + a2 + " " + n2 + " -" + n2 + " " + a2 + " -" + n2 + " 0 c"), r2.push("-" + n2 + " -" + a2 + " -" + a2 + " -" + n2 + " 0 -" + n2 + " c"), r2.push(a2 + " -" + n2 + " " + n2 + " -" + a2 + " " + n2 + " 0 c"), r2.push("f"), r2.push("Q"), e7.stream = r2.join("\n"), e7;
}, YesPushDown: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [], n2 = At$1.internal.getWidth(t5) <= At$1.internal.getHeight(t5) ? At$1.internal.getWidth(t5) / 4 : At$1.internal.getHeight(t5) / 4;
n2 = Number((0.9 * n2).toFixed(5));
var i2 = Number((2 * n2).toFixed(5)), a2 = Number((i2 * At$1.internal.Bezier_C).toFixed(5)), o2 = Number((n2 * At$1.internal.Bezier_C).toFixed(5));
return r2.push("0.749023 g"), r2.push("q"), r2.push("1 0 0 1 " + z$3(At$1.internal.getWidth(t5) / 2) + " " + z$3(At$1.internal.getHeight(t5) / 2) + " cm"), r2.push(i2 + " 0 m"), r2.push(i2 + " " + a2 + " " + a2 + " " + i2 + " 0 " + i2 + " c"), r2.push("-" + a2 + " " + i2 + " -" + i2 + " " + a2 + " -" + i2 + " 0 c"), r2.push("-" + i2 + " -" + a2 + " -" + a2 + " -" + i2 + " 0 -" + i2 + " c"), r2.push(a2 + " -" + i2 + " " + i2 + " -" + a2 + " " + i2 + " 0 c"), r2.push("f"), r2.push("Q"), r2.push("0 g"), r2.push("q"), r2.push("1 0 0 1 " + z$3(At$1.internal.getWidth(t5) / 2) + " " + z$3(At$1.internal.getHeight(t5) / 2) + " cm"), r2.push(n2 + " 0 m"), r2.push(n2 + " " + o2 + " " + o2 + " " + n2 + " 0 " + n2 + " c"), r2.push("-" + o2 + " " + n2 + " -" + n2 + " " + o2 + " -" + n2 + " 0 c"), r2.push("-" + n2 + " -" + o2 + " -" + o2 + " -" + n2 + " 0 -" + n2 + " c"), r2.push(o2 + " -" + n2 + " " + n2 + " -" + o2 + " " + n2 + " 0 c"), r2.push("f"), r2.push("Q"), e7.stream = r2.join("\n"), e7;
}, OffPushDown: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [], n2 = At$1.internal.getWidth(t5) <= At$1.internal.getHeight(t5) ? At$1.internal.getWidth(t5) / 4 : At$1.internal.getHeight(t5) / 4;
n2 = Number((0.9 * n2).toFixed(5));
var i2 = Number((2 * n2).toFixed(5)), a2 = Number((i2 * At$1.internal.Bezier_C).toFixed(5));
return r2.push("0.749023 g"), r2.push("q"), r2.push("1 0 0 1 " + z$3(At$1.internal.getWidth(t5) / 2) + " " + z$3(At$1.internal.getHeight(t5) / 2) + " cm"), r2.push(i2 + " 0 m"), r2.push(i2 + " " + a2 + " " + a2 + " " + i2 + " 0 " + i2 + " c"), r2.push("-" + a2 + " " + i2 + " -" + i2 + " " + a2 + " -" + i2 + " 0 c"), r2.push("-" + i2 + " -" + a2 + " -" + a2 + " -" + i2 + " 0 -" + i2 + " c"), r2.push(a2 + " -" + i2 + " " + i2 + " -" + a2 + " " + i2 + " 0 c"), r2.push("f"), r2.push("Q"), e7.stream = r2.join("\n"), e7;
} }, Cross: { createAppearanceStream: function(t5) {
var e7 = { D: { Off: At$1.RadioButton.Cross.OffPushDown }, N: {} };
return e7.N[t5] = At$1.RadioButton.Cross.YesNormal, e7.D[t5] = At$1.RadioButton.Cross.YesPushDown, e7;
}, getCA: function() {
return "8";
}, YesNormal: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [], n2 = At$1.internal.calculateCross(t5);
return r2.push("q"), r2.push("1 1 " + U$2(At$1.internal.getWidth(t5) - 2) + " " + U$2(At$1.internal.getHeight(t5) - 2) + " re"), r2.push("W"), r2.push("n"), r2.push(U$2(n2.x1.x) + " " + U$2(n2.x1.y) + " m"), r2.push(U$2(n2.x2.x) + " " + U$2(n2.x2.y) + " l"), r2.push(U$2(n2.x4.x) + " " + U$2(n2.x4.y) + " m"), r2.push(U$2(n2.x3.x) + " " + U$2(n2.x3.y) + " l"), r2.push("s"), r2.push("Q"), e7.stream = r2.join("\n"), e7;
}, YesPushDown: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = At$1.internal.calculateCross(t5), n2 = [];
return n2.push("0.749023 g"), n2.push("0 0 " + U$2(At$1.internal.getWidth(t5)) + " " + U$2(At$1.internal.getHeight(t5)) + " re"), n2.push("f"), n2.push("q"), n2.push("1 1 " + U$2(At$1.internal.getWidth(t5) - 2) + " " + U$2(At$1.internal.getHeight(t5) - 2) + " re"), n2.push("W"), n2.push("n"), n2.push(U$2(r2.x1.x) + " " + U$2(r2.x1.y) + " m"), n2.push(U$2(r2.x2.x) + " " + U$2(r2.x2.y) + " l"), n2.push(U$2(r2.x4.x) + " " + U$2(r2.x4.y) + " m"), n2.push(U$2(r2.x3.x) + " " + U$2(r2.x3.y) + " l"), n2.push("s"), n2.push("Q"), e7.stream = n2.join("\n"), e7;
}, OffPushDown: function(t5) {
var e7 = V$2(t5);
e7.scope = t5.scope;
var r2 = [];
return r2.push("0.749023 g"), r2.push("0 0 " + U$2(At$1.internal.getWidth(t5)) + " " + U$2(At$1.internal.getHeight(t5)) + " re"), r2.push("f"), e7.stream = r2.join("\n"), e7;
} } }, createDefaultAppearanceStream: function(t5) {
var e7 = t5.scope.internal.getFont(t5.fontName, t5.fontStyle).id, r2 = t5.scope.__private__.encodeColorString(t5.color);
return "/" + e7 + " " + t5.fontSize + " Tf " + r2;
} };
At$1.internal = { Bezier_C: 0.551915024494, calculateCross: function(t5) {
var e7 = At$1.internal.getWidth(t5), r2 = At$1.internal.getHeight(t5), n2 = Math.min(e7, r2);
return { x1: { x: (e7 - n2) / 2, y: (r2 - n2) / 2 + n2 }, x2: { x: (e7 - n2) / 2 + n2, y: (r2 - n2) / 2 }, x3: { x: (e7 - n2) / 2, y: (r2 - n2) / 2 }, x4: { x: (e7 - n2) / 2 + n2, y: (r2 - n2) / 2 + n2 } };
} }, At$1.internal.getWidth = function(e7) {
var r2 = 0;
return "object" === _typeof$3(e7) && (r2 = W$1(e7.Rect[2])), r2;
}, At$1.internal.getHeight = function(e7) {
var r2 = 0;
return "object" === _typeof$3(e7) && (r2 = W$1(e7.Rect[3])), r2;
};
var xt$1 = q$1.addField = function(t5) {
if (at$1(this, t5), !(t5 instanceof lt$1))
throw new Error("Invalid argument passed to jsPDF.addField.");
var e7;
return (e7 = t5).scope.internal.acroformPlugin.printedOut && (e7.scope.internal.acroformPlugin.printedOut = false, e7.scope.internal.acroformPlugin.acroFormDictionaryRoot = null), e7.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e7), t5.page = t5.scope.internal.getCurrentPageInfo().pageNumber, this;
};
q$1.AcroFormChoiceField = ft$1, q$1.AcroFormListBox = dt$1, q$1.AcroFormComboBox = pt$1, q$1.AcroFormEditBox = gt$1, q$1.AcroFormButton = mt$1, q$1.AcroFormPushButton = vt$1, q$1.AcroFormRadioButton = bt$1, q$1.AcroFormCheckBox = wt$1, q$1.AcroFormTextField = Nt$1, q$1.AcroFormPasswordField = Lt$1, q$1.AcroFormAppearance = At$1, q$1.AcroForm = { ChoiceField: ft$1, ListBox: dt$1, ComboBox: pt$1, EditBox: gt$1, Button: mt$1, PushButton: vt$1, RadioButton: bt$1, CheckBox: wt$1, TextField: Nt$1, PasswordField: Lt$1, Appearance: At$1 }, E$2.AcroForm = { ChoiceField: ft$1, ListBox: dt$1, ComboBox: pt$1, EditBox: gt$1, Button: mt$1, PushButton: vt$1, RadioButton: bt$1, CheckBox: wt$1, TextField: Nt$1, PasswordField: Lt$1, Appearance: At$1 };
function _t$1(t5) {
return t5.reduce(function(t6, e7, r2) {
return t6[e7] = r2, t6;
}, {});
}
!function(e7) {
e7.__addimage__ = {};
var r2 = "UNKNOWN", n2 = { PNG: [[137, 80, 78, 71]], TIFF: [[77, 77, 0, 42], [73, 73, 42, 0]], JPEG: [[255, 216, 255, 224, void 0, void 0, 74, 70, 73, 70, 0], [255, 216, 255, 225, void 0, void 0, 69, 120, 105, 102, 0, 0], [255, 216, 255, 219], [255, 216, 255, 238]], JPEG2000: [[0, 0, 0, 12, 106, 80, 32, 32]], GIF87a: [[71, 73, 70, 56, 55, 97]], GIF89a: [[71, 73, 70, 56, 57, 97]], WEBP: [[82, 73, 70, 70, void 0, void 0, void 0, void 0, 87, 69, 66, 80]], BMP: [[66, 77], [66, 65], [67, 73], [67, 80], [73, 67], [80, 84]] }, i2 = e7.__addimage__.getImageFileTypeByImageData = function(t5, e8) {
var i3, a3, o3, s3, c3, u2 = r2;
if ("RGBA" === (e8 = e8 || r2) || void 0 !== t5.data && t5.data instanceof Uint8ClampedArray && "height" in t5 && "width" in t5)
return "RGBA";
if (x2(t5))
for (c3 in n2)
for (o3 = n2[c3], i3 = 0; i3 < o3.length; i3 += 1) {
for (s3 = true, a3 = 0; a3 < o3[i3].length; a3 += 1)
if (void 0 !== o3[i3][a3] && o3[i3][a3] !== t5[a3]) {
s3 = false;
break;
}
if (true === s3) {
u2 = c3;
break;
}
}
else
for (c3 in n2)
for (o3 = n2[c3], i3 = 0; i3 < o3.length; i3 += 1) {
for (s3 = true, a3 = 0; a3 < o3[i3].length; a3 += 1)
if (void 0 !== o3[i3][a3] && o3[i3][a3] !== t5.charCodeAt(a3)) {
s3 = false;
break;
}
if (true === s3) {
u2 = c3;
break;
}
}
return u2 === r2 && e8 !== r2 && (u2 = e8), u2;
}, a2 = function t5(e8) {
for (var r3 = this.internal.write, n3 = this.internal.putStream, i3 = (0, this.internal.getFilters)(); -1 !== i3.indexOf("FlateEncode"); )
i3.splice(i3.indexOf("FlateEncode"), 1);
e8.objectId = this.internal.newObject();
var a3 = [];
if (a3.push({ key: "Type", value: "/XObject" }), a3.push({ key: "Subtype", value: "/Image" }), a3.push({ key: "Width", value: e8.width }), a3.push({ key: "Height", value: e8.height }), e8.colorSpace === b2.INDEXED ? a3.push({ key: "ColorSpace", value: "[/Indexed /DeviceRGB " + (e8.palette.length / 3 - 1) + " " + ("sMask" in e8 && void 0 !== e8.sMask ? e8.objectId + 2 : e8.objectId + 1) + " 0 R]" }) : (a3.push({ key: "ColorSpace", value: "/" + e8.colorSpace }), e8.colorSpace === b2.DEVICE_CMYK && a3.push({ key: "Decode", value: "[1 0 1 0 1 0 1 0]" })), a3.push({ key: "BitsPerComponent", value: e8.bitsPerComponent }), "decodeParameters" in e8 && void 0 !== e8.decodeParameters && a3.push({ key: "DecodeParms", value: "<<" + e8.decodeParameters + ">>" }), "transparency" in e8 && Array.isArray(e8.transparency)) {
for (var o3 = "", s3 = 0, c3 = e8.transparency.length; s3 < c3; s3++)
o3 += e8.transparency[s3] + " " + e8.transparency[s3] + " ";
a3.push({ key: "Mask", value: "[" + o3 + "]" });
}
void 0 !== e8.sMask && a3.push({ key: "SMask", value: e8.objectId + 1 + " 0 R" });
var u2 = void 0 !== e8.filter ? ["/" + e8.filter] : void 0;
if (n3({ data: e8.data, additionalKeyValues: a3, alreadyAppliedFilters: u2, objectId: e8.objectId }), r3("endobj"), "sMask" in e8 && void 0 !== e8.sMask) {
var h3 = "/Predictor " + e8.predictor + " /Colors 1 /BitsPerComponent " + e8.bitsPerComponent + " /Columns " + e8.width, l3 = { width: e8.width, height: e8.height, colorSpace: "DeviceGray", bitsPerComponent: e8.bitsPerComponent, decodeParameters: h3, data: e8.sMask };
"filter" in e8 && (l3.filter = e8.filter), t5.call(this, l3);
}
if (e8.colorSpace === b2.INDEXED) {
var f3 = this.internal.newObject();
n3({ data: _24(new Uint8Array(e8.palette)), objectId: f3 }), r3("endobj");
}
}, o2 = function() {
var t5 = this.internal.collections.addImage_images;
for (var e8 in t5)
a2.call(this, t5[e8]);
}, s2 = function() {
var t5, e8 = this.internal.collections.addImage_images, r3 = this.internal.write;
for (var n3 in e8)
r3("/I" + (t5 = e8[n3]).index, t5.objectId, "0", "R");
}, c2 = function() {
this.internal.collections.addImage_images || (this.internal.collections.addImage_images = {}, this.internal.events.subscribe("putResources", o2), this.internal.events.subscribe("putXobjectDict", s2));
}, h2 = function() {
var t5 = this.internal.collections.addImage_images;
return c2.call(this), t5;
}, l2 = function() {
return Object.keys(this.internal.collections.addImage_images).length;
}, f2 = function(t5) {
return "function" == typeof e7["process" + t5.toUpperCase()];
}, d2 = function(e8) {
return "object" === _typeof$3(e8) && 1 === e8.nodeType;
}, p2 = function(t5, r3) {
if ("IMG" === t5.nodeName && t5.hasAttribute("src")) {
var n3 = "" + t5.getAttribute("src");
if (0 === n3.indexOf("data:image/"))
return u$7(unescape(n3).split("base64,").pop());
var i3 = e7.loadFile(n3, true);
if (void 0 !== i3)
return i3;
}
if ("CANVAS" === t5.nodeName) {
if (0 === t5.width || 0 === t5.height)
throw new Error("Given canvas must have data. Canvas width: " + t5.width + ", height: " + t5.height);
var a3;
switch (r3) {
case "PNG":
a3 = "image/png";
break;
case "WEBP":
a3 = "image/webp";
break;
case "JPEG":
case "JPG":
default:
a3 = "image/jpeg";
}
return u$7(t5.toDataURL(a3, 1).split("base64,").pop());
}
}, g2 = function(t5) {
var e8 = this.internal.collections.addImage_images;
if (e8) {
for (var r3 in e8)
if (t5 === e8[r3].alias)
return e8[r3];
}
}, m2 = function(t5, e8, r3) {
return t5 || e8 || (t5 = -96, e8 = -96), t5 < 0 && (t5 = -1 * r3.width * 72 / t5 / this.internal.scaleFactor), e8 < 0 && (e8 = -1 * r3.height * 72 / e8 / this.internal.scaleFactor), 0 === t5 && (t5 = e8 * r3.width / r3.height), 0 === e8 && (e8 = t5 * r3.height / r3.width), [t5, e8];
}, v2 = function(t5, e8, r3, n3, i3, a3) {
var o3 = m2.call(this, r3, n3, i3), s3 = this.internal.getCoordinateString, c3 = this.internal.getVerticalCoordinateString, u2 = h2.call(this);
if (r3 = o3[0], n3 = o3[1], u2[i3.index] = i3, a3) {
a3 *= Math.PI / 180;
var l3 = Math.cos(a3), f3 = Math.sin(a3), d3 = function(t6) {
return t6.toFixed(4);
}, p3 = [d3(l3), d3(f3), d3(-1 * f3), d3(l3), 0, 0, "cm"];
}
this.internal.write("q"), a3 ? (this.internal.write([1, "0", "0", 1, s3(t5), c3(e8 + n3), "cm"].join(" ")), this.internal.write(p3.join(" ")), this.internal.write([s3(r3), "0", "0", s3(n3), "0", "0", "cm"].join(" "))) : this.internal.write([s3(r3), "0", "0", s3(n3), s3(t5), c3(e8 + n3), "cm"].join(" ")), this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")), this.internal.write("/I" + i3.index + " Do"), this.internal.write("Q");
}, b2 = e7.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPARATION: "Separation", DEVICE_N: "DeviceN" };
e7.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" };
var y2 = e7.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, w2 = e7.__addimage__.sHashCode = function(t5) {
var e8, r3, n3 = 0;
if ("string" == typeof t5)
for (r3 = t5.length, e8 = 0; e8 < r3; e8++)
n3 = (n3 << 5) - n3 + t5.charCodeAt(e8), n3 |= 0;
else if (x2(t5))
for (r3 = t5.byteLength / 2, e8 = 0; e8 < r3; e8++)
n3 = (n3 << 5) - n3 + t5[e8], n3 |= 0;
return n3;
}, N2 = e7.__addimage__.validateStringAsBase64 = function(t5) {
(t5 = t5 || "").toString().trim();
var e8 = true;
return 0 === t5.length && (e8 = false), t5.length % 4 != 0 && (e8 = false), false === /^[A-Za-z0-9+/]+$/.test(t5.substr(0, t5.length - 2)) && (e8 = false), false === /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t5.substr(-2)) && (e8 = false), e8;
}, L2 = e7.__addimage__.extractImageFromDataUrl = function(t5) {
var e8 = (t5 = t5 || "").split("base64,"), r3 = null;
if (2 === e8.length) {
var n3 = /^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(e8[0]);
Array.isArray(n3) && (r3 = { mimeType: n3[1], charset: n3[2], data: e8[1] });
}
return r3;
}, A5 = e7.__addimage__.supportsArrayBuffer = function() {
return "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array;
};
e7.__addimage__.isArrayBuffer = function(t5) {
return A5() && t5 instanceof ArrayBuffer;
};
var x2 = e7.__addimage__.isArrayBufferView = function(t5) {
return A5() && "undefined" != typeof Uint32Array && (t5 instanceof Int8Array || t5 instanceof Uint8Array || "undefined" != typeof Uint8ClampedArray && t5 instanceof Uint8ClampedArray || t5 instanceof Int16Array || t5 instanceof Uint16Array || t5 instanceof Int32Array || t5 instanceof Uint32Array || t5 instanceof Float32Array || t5 instanceof Float64Array);
}, S2 = e7.__addimage__.binaryStringToUint8Array = function(t5) {
for (var e8 = t5.length, r3 = new Uint8Array(e8), n3 = 0; n3 < e8; n3++)
r3[n3] = t5.charCodeAt(n3);
return r3;
}, _24 = e7.__addimage__.arrayBufferToBinaryString = function(t5) {
for (var e8 = "", r3 = x2(t5) ? t5 : new Uint8Array(t5), n3 = 0; n3 < r3.length; n3 += 8192)
e8 += String.fromCharCode.apply(null, r3.subarray(n3, n3 + 8192));
return e8;
};
e7.addImage = function() {
var e8, n3, i3, a3, o3, s3, u2, h3, l3;
if ("number" == typeof arguments[1] ? (n3 = r2, i3 = arguments[1], a3 = arguments[2], o3 = arguments[3], s3 = arguments[4], u2 = arguments[5], h3 = arguments[6], l3 = arguments[7]) : (n3 = arguments[1], i3 = arguments[2], a3 = arguments[3], o3 = arguments[4], s3 = arguments[5], u2 = arguments[6], h3 = arguments[7], l3 = arguments[8]), "object" === _typeof$3(e8 = arguments[0]) && !d2(e8) && "imageData" in e8) {
var f3 = e8;
e8 = f3.imageData, n3 = f3.format || n3 || r2, i3 = f3.x || i3 || 0, a3 = f3.y || a3 || 0, o3 = f3.w || f3.width || o3, s3 = f3.h || f3.height || s3, u2 = f3.alias || u2, h3 = f3.compression || h3, l3 = f3.rotation || f3.angle || l3;
}
var p3 = this.internal.getFilters();
if (void 0 === h3 && -1 !== p3.indexOf("FlateEncode") && (h3 = "SLOW"), isNaN(i3) || isNaN(a3))
throw new Error("Invalid coordinates passed to jsPDF.addImage");
c2.call(this);
var g3 = P2.call(this, e8, n3, u2, h3);
return v2.call(this, i3, a3, o3, s3, g3, l3), this;
};
var P2 = function(t5, n3, a3, o3) {
var s3, c3, u2;
if ("string" == typeof t5 && i2(t5) === r2) {
t5 = unescape(t5);
var h3 = k2(t5, false);
("" !== h3 || void 0 !== (h3 = e7.loadFile(t5, true))) && (t5 = h3);
}
if (d2(t5) && (t5 = p2(t5, n3)), n3 = i2(t5, n3), !f2(n3))
throw new Error("addImage does not support files of type '" + n3 + "', please ensure that a plugin for '" + n3 + "' support is added.");
if ((null == (u2 = a3) || 0 === u2.length) && (a3 = function(t6) {
return "string" == typeof t6 || x2(t6) ? w2(t6) : x2(t6.data) ? w2(t6.data) : null;
}(t5)), (s3 = g2.call(this, a3)) || (A5() && (t5 instanceof Uint8Array || "RGBA" === n3 || (c3 = t5, t5 = S2(t5))), s3 = this["process" + n3.toUpperCase()](t5, l2.call(this), a3, function(t6) {
return t6 && "string" == typeof t6 && (t6 = t6.toUpperCase()), t6 in e7.image_compression ? t6 : y2.NONE;
}(o3), c3)), !s3)
throw new Error("An unknown error occurred whilst processing the image.");
return s3;
}, k2 = e7.__addimage__.convertBase64ToBinaryString = function(t5, e8) {
var r3;
e8 = "boolean" != typeof e8 || e8;
var n3, i3 = "";
if ("string" == typeof t5) {
n3 = null !== (r3 = L2(t5)) ? r3.data : t5;
try {
i3 = u$7(n3);
} catch (t6) {
if (e8)
throw N2(n3) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + t6.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ");
}
}
return i3;
};
e7.getImageProperties = function(t5) {
var n3, a3, o3 = "";
if (d2(t5) && (t5 = p2(t5)), "string" == typeof t5 && i2(t5) === r2 && ("" === (o3 = k2(t5, false)) && (o3 = e7.loadFile(t5) || ""), t5 = o3), a3 = i2(t5), !f2(a3))
throw new Error("addImage does not support files of type '" + a3 + "', please ensure that a plugin for '" + a3 + "' support is added.");
if (!A5() || t5 instanceof Uint8Array || (t5 = S2(t5)), !(n3 = this["process" + a3.toUpperCase()](t5)))
throw new Error("An unknown error occurred whilst processing the image");
return n3.fileType = a3, n3;
};
}(E$2.API), /**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7 = function(t6) {
if (void 0 !== t6 && "" != t6)
return true;
};
E$2.API.events.push(["addPage", function(t6) {
this.internal.getPageInfo(t6.pageNumber).pageContext.annotations = [];
}]), t5.events.push(["putPage", function(t6) {
for (var r2, n2, i2, a2 = this.internal.getCoordinateString, o2 = this.internal.getVerticalCoordinateString, s2 = this.internal.getPageInfoByObjId(t6.objId), c2 = t6.pageContext.annotations, u2 = false, h2 = 0; h2 < c2.length && !u2; h2++)
switch ((r2 = c2[h2]).type) {
case "link":
(e7(r2.options.url) || e7(r2.options.pageNumber)) && (u2 = true);
break;
case "reference":
case "text":
case "freetext":
u2 = true;
}
if (0 != u2) {
this.internal.write("/Annots [");
for (var l2 = 0; l2 < c2.length; l2++) {
r2 = c2[l2];
var f2 = this.internal.pdfEscape, d2 = this.internal.getEncryptor(t6.objId);
switch (r2.type) {
case "reference":
this.internal.write(" " + r2.object.objId + " 0 R ");
break;
case "text":
var p2 = this.internal.newAdditionalObject(), g2 = this.internal.newAdditionalObject(), m2 = this.internal.getEncryptor(p2.objId), v2 = r2.title || "Note";
i2 = "<</Type /Annot /Subtype /Text " + (n2 = "/Rect [" + a2(r2.bounds.x) + " " + o2(r2.bounds.y + r2.bounds.h) + " " + a2(r2.bounds.x + r2.bounds.w) + " " + o2(r2.bounds.y) + "] ") + "/Contents (" + f2(m2(r2.contents)) + ")", i2 += " /Popup " + g2.objId + " 0 R", i2 += " /P " + s2.objId + " 0 R", i2 += " /T (" + f2(m2(v2)) + ") >>", p2.content = i2;
var b2 = p2.objId + " 0 R";
i2 = "<</Type /Annot /Subtype /Popup " + (n2 = "/Rect [" + a2(r2.bounds.x + 30) + " " + o2(r2.bounds.y + r2.bounds.h) + " " + a2(r2.bounds.x + r2.bounds.w + 30) + " " + o2(r2.bounds.y) + "] ") + " /Parent " + b2, r2.open && (i2 += " /Open true"), i2 += " >>", g2.content = i2, this.internal.write(p2.objId, "0 R", g2.objId, "0 R");
break;
case "freetext":
n2 = "/Rect [" + a2(r2.bounds.x) + " " + o2(r2.bounds.y) + " " + a2(r2.bounds.x + r2.bounds.w) + " " + o2(r2.bounds.y + r2.bounds.h) + "] ";
var y2 = r2.color || "#000000";
i2 = "<</Type /Annot /Subtype /FreeText " + n2 + "/Contents (" + f2(d2(r2.contents)) + ")", i2 += " /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + y2 + ")", i2 += " /Border [0 0 0]", i2 += " >>", this.internal.write(i2);
break;
case "link":
if (r2.options.name) {
var w2 = this.annotations._nameMap[r2.options.name];
r2.options.pageNumber = w2.page, r2.options.top = w2.y;
} else
r2.options.top || (r2.options.top = 0);
if (n2 = "/Rect [" + r2.finalBounds.x + " " + r2.finalBounds.y + " " + r2.finalBounds.w + " " + r2.finalBounds.h + "] ", i2 = "", r2.options.url)
i2 = "<</Type /Annot /Subtype /Link " + n2 + "/Border [0 0 0] /A <</S /URI /URI (" + f2(d2(r2.options.url)) + ") >>";
else if (r2.options.pageNumber) {
switch (i2 = "<</Type /Annot /Subtype /Link " + n2 + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(r2.options.pageNumber).objId + " 0 R", r2.options.magFactor = r2.options.magFactor || "XYZ", r2.options.magFactor) {
case "Fit":
i2 += " /Fit]";
break;
case "FitH":
i2 += " /FitH " + r2.options.top + "]";
break;
case "FitV":
r2.options.left = r2.options.left || 0, i2 += " /FitV " + r2.options.left + "]";
break;
case "XYZ":
default:
var N2 = o2(r2.options.top);
r2.options.left = r2.options.left || 0, void 0 === r2.options.zoom && (r2.options.zoom = 0), i2 += " /XYZ " + r2.options.left + " " + N2 + " " + r2.options.zoom + "]";
}
}
"" != i2 && (i2 += " >>", this.internal.write(i2));
}
}
this.internal.write("]");
}
}]), t5.createAnnotation = function(t6) {
var e8 = this.internal.getCurrentPageInfo();
switch (t6.type) {
case "link":
this.link(t6.bounds.x, t6.bounds.y, t6.bounds.w, t6.bounds.h, t6);
break;
case "text":
case "freetext":
e8.pageContext.annotations.push(t6);
}
}, t5.link = function(t6, e8, r2, n2, i2) {
var a2 = this.internal.getCurrentPageInfo(), o2 = this.internal.getCoordinateString, s2 = this.internal.getVerticalCoordinateString;
a2.pageContext.annotations.push({ finalBounds: { x: o2(t6), y: s2(e8), w: o2(t6 + r2), h: s2(e8 + n2) }, options: i2, type: "link" });
}, t5.textWithLink = function(t6, e8, r2, n2) {
var i2, a2, o2 = this.getTextWidth(t6), s2 = this.internal.getLineHeight() / this.internal.scaleFactor;
if (void 0 !== n2.maxWidth) {
a2 = n2.maxWidth;
var c2 = this.splitTextToSize(t6, a2).length;
i2 = Math.ceil(s2 * c2);
} else
a2 = o2, i2 = s2;
return this.text(t6, e8, r2, n2), r2 += 0.2 * s2, "center" === n2.align && (e8 -= o2 / 2), "right" === n2.align && (e8 -= o2), this.link(e8, r2 - s2, a2, i2, n2), o2;
}, t5.getTextWidth = function(t6) {
var e8 = this.internal.getFontSize();
return this.getStringUnitWidth(t6) * e8 / this.internal.scaleFactor;
};
}(E$2.API), /**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7 = { 1569: [65152], 1570: [65153, 65154], 1571: [65155, 65156], 1572: [65157, 65158], 1573: [65159, 65160], 1574: [65161, 65162, 65163, 65164], 1575: [65165, 65166], 1576: [65167, 65168, 65169, 65170], 1577: [65171, 65172], 1578: [65173, 65174, 65175, 65176], 1579: [65177, 65178, 65179, 65180], 1580: [65181, 65182, 65183, 65184], 1581: [65185, 65186, 65187, 65188], 1582: [65189, 65190, 65191, 65192], 1583: [65193, 65194], 1584: [65195, 65196], 1585: [65197, 65198], 1586: [65199, 65200], 1587: [65201, 65202, 65203, 65204], 1588: [65205, 65206, 65207, 65208], 1589: [65209, 65210, 65211, 65212], 1590: [65213, 65214, 65215, 65216], 1591: [65217, 65218, 65219, 65220], 1592: [65221, 65222, 65223, 65224], 1593: [65225, 65226, 65227, 65228], 1594: [65229, 65230, 65231, 65232], 1601: [65233, 65234, 65235, 65236], 1602: [65237, 65238, 65239, 65240], 1603: [65241, 65242, 65243, 65244], 1604: [65245, 65246, 65247, 65248], 1605: [65249, 65250, 65251, 65252], 1606: [65253, 65254, 65255, 65256], 1607: [65257, 65258, 65259, 65260], 1608: [65261, 65262], 1609: [65263, 65264, 64488, 64489], 1610: [65265, 65266, 65267, 65268], 1649: [64336, 64337], 1655: [64477], 1657: [64358, 64359, 64360, 64361], 1658: [64350, 64351, 64352, 64353], 1659: [64338, 64339, 64340, 64341], 1662: [64342, 64343, 64344, 64345], 1663: [64354, 64355, 64356, 64357], 1664: [64346, 64347, 64348, 64349], 1667: [64374, 64375, 64376, 64377], 1668: [64370, 64371, 64372, 64373], 1670: [64378, 64379, 64380, 64381], 1671: [64382, 64383, 64384, 64385], 1672: [64392, 64393], 1676: [64388, 64389], 1677: [64386, 64387], 1678: [64390, 64391], 1681: [64396, 64397], 1688: [64394, 64395], 1700: [64362, 64363, 64364, 64365], 1702: [64366, 64367, 64368, 64369], 1705: [64398, 64399, 64400, 64401], 1709: [64467, 64468, 64469, 64470], 1711: [64402, 64403, 64404, 64405], 1713: [64410, 64411, 64412, 64413], 1715: [64406, 64407, 64408, 64409], 1722: [64414, 64415], 1723: [64416, 64417, 64418, 64419], 1726: [64426, 64427, 64428, 64429], 1728: [64420, 64421], 1729: [64422, 64423, 64424, 64425], 1733: [64480, 64481], 1734: [64473, 64474], 1735: [64471, 64472], 1736: [64475, 64476], 1737: [64482, 64483], 1739: [64478, 64479], 1740: [64508, 64509, 64510, 64511], 1744: [64484, 64485, 64486, 64487], 1746: [64430, 64431], 1747: [64432, 64433] }, r2 = { 65247: { 65154: 65269, 65156: 65271, 65160: 65273, 65166: 65275 }, 65248: { 65154: 65270, 65156: 65272, 65160: 65274, 65166: 65276 }, 65165: { 65247: { 65248: { 65258: 65010 } } }, 1617: { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 } }, n2 = { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 }, i2 = [1570, 1571, 1573, 1575];
t5.__arabicParser__ = {};
var a2 = t5.__arabicParser__.isInArabicSubstitutionA = function(t6) {
return void 0 !== e7[t6.charCodeAt(0)];
}, o2 = t5.__arabicParser__.isArabicLetter = function(t6) {
return "string" == typeof t6 && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t6);
}, s2 = t5.__arabicParser__.isArabicEndLetter = function(t6) {
return o2(t6) && a2(t6) && e7[t6.charCodeAt(0)].length <= 2;
}, c2 = t5.__arabicParser__.isArabicAlfLetter = function(t6) {
return o2(t6) && i2.indexOf(t6.charCodeAt(0)) >= 0;
};
t5.__arabicParser__.arabicLetterHasIsolatedForm = function(t6) {
return o2(t6) && a2(t6) && e7[t6.charCodeAt(0)].length >= 1;
};
var u2 = t5.__arabicParser__.arabicLetterHasFinalForm = function(t6) {
return o2(t6) && a2(t6) && e7[t6.charCodeAt(0)].length >= 2;
};
t5.__arabicParser__.arabicLetterHasInitialForm = function(t6) {
return o2(t6) && a2(t6) && e7[t6.charCodeAt(0)].length >= 3;
};
var h2 = t5.__arabicParser__.arabicLetterHasMedialForm = function(t6) {
return o2(t6) && a2(t6) && 4 == e7[t6.charCodeAt(0)].length;
}, l2 = t5.__arabicParser__.resolveLigatures = function(t6) {
var e8 = 0, n3 = r2, i3 = "", a3 = 0;
for (e8 = 0; e8 < t6.length; e8 += 1)
void 0 !== n3[t6.charCodeAt(e8)] ? (a3++, "number" == typeof (n3 = n3[t6.charCodeAt(e8)]) && (i3 += String.fromCharCode(n3), n3 = r2, a3 = 0), e8 === t6.length - 1 && (n3 = r2, i3 += t6.charAt(e8 - (a3 - 1)), e8 -= a3 - 1, a3 = 0)) : (n3 = r2, i3 += t6.charAt(e8 - a3), e8 -= a3, a3 = 0);
return i3;
};
t5.__arabicParser__.isArabicDiacritic = function(t6) {
return void 0 !== t6 && void 0 !== n2[t6.charCodeAt(0)];
};
var f2 = t5.__arabicParser__.getCorrectForm = function(t6, e8, r3) {
return o2(t6) ? false === a2(t6) ? -1 : !u2(t6) || !o2(e8) && !o2(r3) || !o2(r3) && s2(e8) || s2(t6) && !o2(e8) || s2(t6) && c2(e8) || s2(t6) && s2(e8) ? 0 : h2(t6) && o2(e8) && !s2(e8) && o2(r3) && u2(r3) ? 3 : s2(t6) || !o2(r3) ? 1 : 2 : -1;
}, d2 = function(t6) {
var r3 = 0, n3 = 0, i3 = 0, a3 = "", s3 = "", c3 = "", u3 = (t6 = t6 || "").split("\\s+"), h3 = [];
for (r3 = 0; r3 < u3.length; r3 += 1) {
for (h3.push(""), n3 = 0; n3 < u3[r3].length; n3 += 1)
a3 = u3[r3][n3], s3 = u3[r3][n3 - 1], c3 = u3[r3][n3 + 1], o2(a3) ? (i3 = f2(a3, s3, c3), h3[r3] += -1 !== i3 ? String.fromCharCode(e7[a3.charCodeAt(0)][i3]) : a3) : h3[r3] += a3;
h3[r3] = l2(h3[r3]);
}
return h3.join(" ");
}, p2 = t5.__arabicParser__.processArabic = t5.processArabic = function() {
var t6, e8 = "string" == typeof arguments[0] ? arguments[0] : arguments[0].text, r3 = [];
if (Array.isArray(e8)) {
var n3 = 0;
for (r3 = [], n3 = 0; n3 < e8.length; n3 += 1)
Array.isArray(e8[n3]) ? r3.push([d2(e8[n3][0]), e8[n3][1], e8[n3][2]]) : r3.push([d2(e8[n3])]);
t6 = r3;
} else
t6 = d2(e8);
return "string" == typeof arguments[0] ? t6 : (arguments[0].text = t6, arguments[0]);
};
t5.events.push(["preProcessText", p2]);
}(E$2.API), E$2.API.autoPrint = function(t5) {
var e7;
switch ((t5 = t5 || {}).variant = t5.variant || "non-conform", t5.variant) {
case "javascript":
this.addJS("print({});");
break;
case "non-conform":
default:
this.internal.events.subscribe("postPutResources", function() {
e7 = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");
}), this.internal.events.subscribe("putCatalog", function() {
this.internal.out("/OpenAction " + e7 + " 0 R");
});
}
return this;
}, /**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7 = function() {
var t6 = void 0;
Object.defineProperty(this, "pdf", { get: function() {
return t6;
}, set: function(e9) {
t6 = e9;
} });
var e8 = 150;
Object.defineProperty(this, "width", { get: function() {
return e8;
}, set: function(t7) {
e8 = isNaN(t7) || false === Number.isInteger(t7) || t7 < 0 ? 150 : t7, this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = e8 + 1);
} });
var r2 = 300;
Object.defineProperty(this, "height", { get: function() {
return r2;
}, set: function(t7) {
r2 = isNaN(t7) || false === Number.isInteger(t7) || t7 < 0 ? 300 : t7, this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = r2 + 1);
} });
var n2 = [];
Object.defineProperty(this, "childNodes", { get: function() {
return n2;
}, set: function(t7) {
n2 = t7;
} });
var i2 = {};
Object.defineProperty(this, "style", { get: function() {
return i2;
}, set: function(t7) {
i2 = t7;
} }), Object.defineProperty(this, "parentNode", {});
};
e7.prototype.getContext = function(t6, e8) {
var r2;
if ("2d" !== (t6 = t6 || "2d"))
return null;
for (r2 in e8)
this.pdf.context2d.hasOwnProperty(r2) && (this.pdf.context2d[r2] = e8[r2]);
return this.pdf.context2d._canvas = this, this.pdf.context2d;
}, e7.prototype.toDataURL = function() {
throw new Error("toDataURL is not implemented.");
}, t5.events.push(["initialized", function() {
this.canvas = new e7(), this.canvas.pdf = this;
}]);
}(E$2.API), function(e7) {
var r2 = { left: 0, top: 0, bottom: 0, right: 0 }, n2 = false, i2 = function() {
void 0 === this.internal.__cell__ && (this.internal.__cell__ = {}, this.internal.__cell__.padding = 3, this.internal.__cell__.headerFunction = void 0, this.internal.__cell__.margins = Object.assign({}, r2), this.internal.__cell__.margins.width = this.getPageWidth(), a2.call(this));
}, a2 = function() {
this.internal.__cell__.lastCell = new o2(), this.internal.__cell__.pages = 1;
}, o2 = function() {
var t5 = arguments[0];
Object.defineProperty(this, "x", { enumerable: true, get: function() {
return t5;
}, set: function(e9) {
t5 = e9;
} });
var e8 = arguments[1];
Object.defineProperty(this, "y", { enumerable: true, get: function() {
return e8;
}, set: function(t6) {
e8 = t6;
} });
var r3 = arguments[2];
Object.defineProperty(this, "width", { enumerable: true, get: function() {
return r3;
}, set: function(t6) {
r3 = t6;
} });
var n3 = arguments[3];
Object.defineProperty(this, "height", { enumerable: true, get: function() {
return n3;
}, set: function(t6) {
n3 = t6;
} });
var i3 = arguments[4];
Object.defineProperty(this, "text", { enumerable: true, get: function() {
return i3;
}, set: function(t6) {
i3 = t6;
} });
var a3 = arguments[5];
Object.defineProperty(this, "lineNumber", { enumerable: true, get: function() {
return a3;
}, set: function(t6) {
a3 = t6;
} });
var o3 = arguments[6];
return Object.defineProperty(this, "align", { enumerable: true, get: function() {
return o3;
}, set: function(t6) {
o3 = t6;
} }), this;
};
o2.prototype.clone = function() {
return new o2(this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align);
}, o2.prototype.toArray = function() {
return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align];
}, e7.setHeaderFunction = function(t5) {
return i2.call(this), this.internal.__cell__.headerFunction = "function" == typeof t5 ? t5 : void 0, this;
}, e7.getTextDimensions = function(t5, e8) {
i2.call(this);
var r3 = (e8 = e8 || {}).fontSize || this.getFontSize(), n3 = e8.font || this.getFont(), a3 = e8.scaleFactor || this.internal.scaleFactor, o3 = 0, s3 = 0, c3 = 0, u2 = this;
if (!Array.isArray(t5) && "string" != typeof t5) {
if ("number" != typeof t5)
throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");
t5 = String(t5);
}
var h2 = e8.maxWidth;
h2 > 0 ? "string" == typeof t5 ? t5 = this.splitTextToSize(t5, h2) : "[object Array]" === Object.prototype.toString.call(t5) && (t5 = t5.reduce(function(t6, e9) {
return t6.concat(u2.splitTextToSize(e9, h2));
}, [])) : t5 = Array.isArray(t5) ? t5 : [t5];
for (var l2 = 0; l2 < t5.length; l2++)
o3 < (c3 = this.getStringUnitWidth(t5[l2], { font: n3 }) * r3) && (o3 = c3);
return 0 !== o3 && (s3 = t5.length), { w: o3 /= a3, h: Math.max((s3 * r3 * this.getLineHeightFactor() - r3 * (this.getLineHeightFactor() - 1)) / a3, 0) };
}, e7.cellAddPage = function() {
i2.call(this), this.addPage();
var t5 = this.internal.__cell__.margins || r2;
return this.internal.__cell__.lastCell = new o2(t5.left, t5.top, void 0, void 0), this.internal.__cell__.pages += 1, this;
};
var s2 = e7.cell = function() {
var t5;
t5 = arguments[0] instanceof o2 ? arguments[0] : new o2(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]), i2.call(this);
var e8 = this.internal.__cell__.lastCell, a3 = this.internal.__cell__.padding, s3 = this.internal.__cell__.margins || r2, c3 = this.internal.__cell__.tableHeaderRow, u2 = this.internal.__cell__.printHeaders;
return void 0 !== e8.lineNumber && (e8.lineNumber === t5.lineNumber ? (t5.x = (e8.x || 0) + (e8.width || 0), t5.y = e8.y || 0) : e8.y + e8.height + t5.height + s3.bottom > this.getPageHeight() ? (this.cellAddPage(), t5.y = s3.top, u2 && c3 && (this.printHeaderRow(t5.lineNumber, true), t5.y += c3[0].height)) : t5.y = e8.y + e8.height || t5.y), void 0 !== t5.text[0] && (this.rect(t5.x, t5.y, t5.width, t5.height, true === n2 ? "FD" : void 0), "right" === t5.align ? this.text(t5.text, t5.x + t5.width - a3, t5.y + a3, { align: "right", baseline: "top" }) : "center" === t5.align ? this.text(t5.text, t5.x + t5.width / 2, t5.y + a3, { align: "center", baseline: "top", maxWidth: t5.width - a3 - a3 }) : this.text(t5.text, t5.x + a3, t5.y + a3, { align: "left", baseline: "top", maxWidth: t5.width - a3 - a3 })), this.internal.__cell__.lastCell = t5, this;
};
e7.table = function(e8, n3, u2, h2, l2) {
if (i2.call(this), !u2)
throw new Error("No data for PDF table.");
var f2, d2, p2, g2, m2 = [], v2 = [], b2 = [], y2 = {}, w2 = {}, N2 = [], L2 = [], A5 = (l2 = l2 || {}).autoSize || false, x2 = false !== l2.printHeaders, S2 = l2.css && void 0 !== l2.css["font-size"] ? 16 * l2.css["font-size"] : l2.fontSize || 12, _24 = l2.margins || Object.assign({ width: this.getPageWidth() }, r2), P2 = "number" == typeof l2.padding ? l2.padding : 3, k2 = l2.headerBackgroundColor || "#c8c8c8", I2 = l2.headerTextColor || "#000";
if (a2.call(this), this.internal.__cell__.printHeaders = x2, this.internal.__cell__.margins = _24, this.internal.__cell__.table_font_size = S2, this.internal.__cell__.padding = P2, this.internal.__cell__.headerBackgroundColor = k2, this.internal.__cell__.headerTextColor = I2, this.setFontSize(S2), null == h2)
v2 = m2 = Object.keys(u2[0]), b2 = m2.map(function() {
return "left";
});
else if (Array.isArray(h2) && "object" === _typeof$3(h2[0]))
for (m2 = h2.map(function(t5) {
return t5.name;
}), v2 = h2.map(function(t5) {
return t5.prompt || t5.name || "";
}), b2 = h2.map(function(t5) {
return t5.align || "left";
}), f2 = 0; f2 < h2.length; f2 += 1)
w2[h2[f2].name] = h2[f2].width * (19.049976 / 25.4);
else
Array.isArray(h2) && "string" == typeof h2[0] && (v2 = m2 = h2, b2 = m2.map(function() {
return "left";
}));
if (A5 || Array.isArray(h2) && "string" == typeof h2[0])
for (f2 = 0; f2 < m2.length; f2 += 1) {
for (y2[g2 = m2[f2]] = u2.map(function(t5) {
return t5[g2];
}), this.setFont(void 0, "bold"), N2.push(this.getTextDimensions(v2[f2], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w), d2 = y2[g2], this.setFont(void 0, "normal"), p2 = 0; p2 < d2.length; p2 += 1)
N2.push(this.getTextDimensions(d2[p2], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w);
w2[g2] = Math.max.apply(null, N2) + P2 + P2, N2 = [];
}
if (x2) {
var F2 = {};
for (f2 = 0; f2 < m2.length; f2 += 1)
F2[m2[f2]] = {}, F2[m2[f2]].text = v2[f2], F2[m2[f2]].align = b2[f2];
var C3 = c2.call(this, F2, w2);
L2 = m2.map(function(t5) {
return new o2(e8, n3, w2[t5], C3, F2[t5].text, void 0, F2[t5].align);
}), this.setTableHeaderRow(L2), this.printHeaderRow(1, false);
}
var j2 = h2.reduce(function(t5, e9) {
return t5[e9.name] = e9.align, t5;
}, {});
for (f2 = 0; f2 < u2.length; f2 += 1) {
"rowStart" in l2 && l2.rowStart instanceof Function && l2.rowStart({ row: f2, data: u2[f2] }, this);
var O2 = c2.call(this, u2[f2], w2);
for (p2 = 0; p2 < m2.length; p2 += 1) {
var B3 = u2[f2][m2[p2]];
"cellStart" in l2 && l2.cellStart instanceof Function && l2.cellStart({ row: f2, col: p2, data: B3 }, this), s2.call(this, new o2(e8, n3, w2[m2[p2]], O2, B3, f2 + 2, j2[m2[p2]]));
}
}
return this.internal.__cell__.table_x = e8, this.internal.__cell__.table_y = n3, this;
};
var c2 = function(t5, e8) {
var r3 = this.internal.__cell__.padding, n3 = this.internal.__cell__.table_font_size, i3 = this.internal.scaleFactor;
return Object.keys(t5).map(function(n4) {
var i4 = t5[n4];
return this.splitTextToSize(i4.hasOwnProperty("text") ? i4.text : i4, e8[n4] - r3 - r3);
}, this).map(function(t6) {
return this.getLineHeightFactor() * t6.length * n3 / i3 + r3 + r3;
}, this).reduce(function(t6, e9) {
return Math.max(t6, e9);
}, 0);
};
e7.setTableHeaderRow = function(t5) {
i2.call(this), this.internal.__cell__.tableHeaderRow = t5;
}, e7.printHeaderRow = function(t5, e8) {
if (i2.call(this), !this.internal.__cell__.tableHeaderRow)
throw new Error("Property tableHeaderRow does not exist.");
var r3;
if (n2 = true, "function" == typeof this.internal.__cell__.headerFunction) {
var a3 = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
this.internal.__cell__.lastCell = new o2(a3[0], a3[1], a3[2], a3[3], void 0, -1);
}
this.setFont(void 0, "bold");
for (var c3 = [], u2 = 0; u2 < this.internal.__cell__.tableHeaderRow.length; u2 += 1) {
r3 = this.internal.__cell__.tableHeaderRow[u2].clone(), e8 && (r3.y = this.internal.__cell__.margins.top || 0, c3.push(r3)), r3.lineNumber = t5;
var h2 = this.getTextColor();
this.setTextColor(this.internal.__cell__.headerTextColor), this.setFillColor(this.internal.__cell__.headerBackgroundColor), s2.call(this, r3), this.setTextColor(h2);
}
c3.length > 0 && this.setTableHeaderRow(c3), this.setFont(void 0, "normal"), n2 = false;
};
}(E$2.API);
var Pt$1 = { italic: ["italic", "oblique", "normal"], oblique: ["oblique", "italic", "normal"], normal: ["normal", "oblique", "italic"] }, kt$1 = ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"], It$1 = _t$1(kt$1), Ft$1 = [100, 200, 300, 400, 500, 600, 700, 800, 900], Ct$1 = _t$1(Ft$1);
function jt$1(t5) {
var e7 = t5.family.replace(/"|'/g, "").toLowerCase(), r2 = function(t6) {
return Pt$1[t6 = t6 || "normal"] ? t6 : "normal";
}(t5.style), n2 = function(t6) {
if (!t6)
return 400;
if ("number" == typeof t6)
return t6 >= 100 && t6 <= 900 && t6 % 100 == 0 ? t6 : 400;
if (/^\d00$/.test(t6))
return parseInt(t6);
switch (t6) {
case "bold":
return 700;
case "normal":
default:
return 400;
}
}(t5.weight), i2 = function(t6) {
return "number" == typeof It$1[t6 = t6 || "normal"] ? t6 : "normal";
}(t5.stretch);
return { family: e7, style: r2, weight: n2, stretch: i2, src: t5.src || [], ref: t5.ref || { name: e7, style: [i2, r2, n2].join(" ") } };
}
function Ot$1(t5, e7, r2, n2) {
var i2;
for (i2 = r2; i2 >= 0 && i2 < e7.length; i2 += n2)
if (t5[e7[i2]])
return t5[e7[i2]];
for (i2 = r2; i2 >= 0 && i2 < e7.length; i2 -= n2)
if (t5[e7[i2]])
return t5[e7[i2]];
}
var Bt$1 = { "sans-serif": "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", cursive: "times", fantasy: "times", serif: "times" }, Mt$1 = { caption: "times", icon: "times", menu: "times", "message-box": "times", "small-caption": "times", "status-bar": "times" };
function Et$1(t5) {
return [t5.stretch, t5.style, t5.weight, t5.family].join(" ");
}
function qt$1(t5, e7, r2) {
for (var n2 = (r2 = r2 || {}).defaultFontFamily || "times", i2 = Object.assign({}, Bt$1, r2.genericFontFamilies || {}), a2 = null, o2 = null, s2 = 0; s2 < e7.length; ++s2)
if (i2[(a2 = jt$1(e7[s2])).family] && (a2.family = i2[a2.family]), t5.hasOwnProperty(a2.family)) {
o2 = t5[a2.family];
break;
}
if (!(o2 = o2 || t5[n2]))
throw new Error("Could not find a font-family for the rule '" + Et$1(a2) + "' and default family '" + n2 + "'.");
if (o2 = function(t6, e8) {
if (e8[t6])
return e8[t6];
var r3 = It$1[t6], n3 = r3 <= It$1.normal ? -1 : 1, i3 = Ot$1(e8, kt$1, r3, n3);
if (!i3)
throw new Error("Could not find a matching font-stretch value for " + t6);
return i3;
}(a2.stretch, o2), o2 = function(t6, e8) {
if (e8[t6])
return e8[t6];
for (var r3 = Pt$1[t6], n3 = 0; n3 < r3.length; ++n3)
if (e8[r3[n3]])
return e8[r3[n3]];
throw new Error("Could not find a matching font-style for " + t6);
}(a2.style, o2), !(o2 = function(t6, e8) {
if (e8[t6])
return e8[t6];
if (400 === t6 && e8[500])
return e8[500];
if (500 === t6 && e8[400])
return e8[400];
var r3 = Ct$1[t6], n3 = Ot$1(e8, Ft$1, r3, t6 < 400 ? -1 : 1);
if (!n3)
throw new Error("Could not find a matching font-weight for value " + t6);
return n3;
}(a2.weight, o2)))
throw new Error("Failed to resolve a font for the rule '" + Et$1(a2) + "'.");
return o2;
}
function Dt$1(t5) {
return t5.trimLeft();
}
function Rt$1(t5, e7) {
for (var r2 = 0; r2 < t5.length; ) {
if (t5.charAt(r2) === e7)
return [t5.substring(0, r2), t5.substring(r2 + 1)];
r2 += 1;
}
return null;
}
function Tt$1(t5) {
var e7 = t5.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);
return null === e7 ? null : [e7[0], t5.substring(e7[0].length)];
}
var Ut$1, zt$1, Ht$1, Wt$1 = ["times"];
!function(e7) {
var r2, n2, i2, o2, s2, c2, u2, h2, l2, d2 = function(t5) {
return t5 = t5 || {}, this.isStrokeTransparent = t5.isStrokeTransparent || false, this.strokeOpacity = t5.strokeOpacity || 1, this.strokeStyle = t5.strokeStyle || "#000000", this.fillStyle = t5.fillStyle || "#000000", this.isFillTransparent = t5.isFillTransparent || false, this.fillOpacity = t5.fillOpacity || 1, this.font = t5.font || "10px sans-serif", this.textBaseline = t5.textBaseline || "alphabetic", this.textAlign = t5.textAlign || "left", this.lineWidth = t5.lineWidth || 1, this.lineJoin = t5.lineJoin || "miter", this.lineCap = t5.lineCap || "butt", this.path = t5.path || [], this.transform = void 0 !== t5.transform ? t5.transform.clone() : new h2(), this.globalCompositeOperation = t5.globalCompositeOperation || "normal", this.globalAlpha = t5.globalAlpha || 1, this.clip_path = t5.clip_path || [], this.currentPoint = t5.currentPoint || new c2(), this.miterLimit = t5.miterLimit || 10, this.lastPoint = t5.lastPoint || new c2(), this.lineDashOffset = t5.lineDashOffset || 0, this.lineDash = t5.lineDash || [], this.margin = t5.margin || [0, 0, 0, 0], this.prevPageLastElemOffset = t5.prevPageLastElemOffset || 0, this.ignoreClearRect = "boolean" != typeof t5.ignoreClearRect || t5.ignoreClearRect, this;
};
e7.events.push(["initialized", function() {
this.context2d = new p2(this), r2 = this.internal.f2, n2 = this.internal.getCoordinateString, i2 = this.internal.getVerticalCoordinateString, o2 = this.internal.getHorizontalCoordinate, s2 = this.internal.getVerticalCoordinate, c2 = this.internal.Point, u2 = this.internal.Rectangle, h2 = this.internal.Matrix, l2 = new d2();
}]);
var p2 = function(t5) {
Object.defineProperty(this, "canvas", { get: function() {
return { parentNode: false, style: false };
} });
var e8 = t5;
Object.defineProperty(this, "pdf", { get: function() {
return e8;
} });
var r3 = false;
Object.defineProperty(this, "pageWrapXEnabled", { get: function() {
return r3;
}, set: function(t6) {
r3 = Boolean(t6);
} });
var n3 = false;
Object.defineProperty(this, "pageWrapYEnabled", { get: function() {
return n3;
}, set: function(t6) {
n3 = Boolean(t6);
} });
var i3 = 0;
Object.defineProperty(this, "posX", { get: function() {
return i3;
}, set: function(t6) {
isNaN(t6) || (i3 = t6);
} });
var a2 = 0;
Object.defineProperty(this, "posY", { get: function() {
return a2;
}, set: function(t6) {
isNaN(t6) || (a2 = t6);
} }), Object.defineProperty(this, "margin", { get: function() {
return l2.margin;
}, set: function(t6) {
var e9;
"number" == typeof t6 ? e9 = [t6, t6, t6, t6] : ((e9 = new Array(4))[0] = t6[0], e9[1] = t6.length >= 2 ? t6[1] : e9[0], e9[2] = t6.length >= 3 ? t6[2] : e9[0], e9[3] = t6.length >= 4 ? t6[3] : e9[1]), l2.margin = e9;
} });
var o3 = false;
Object.defineProperty(this, "autoPaging", { get: function() {
return o3;
}, set: function(t6) {
o3 = t6;
} });
var s3 = 0;
Object.defineProperty(this, "lastBreak", { get: function() {
return s3;
}, set: function(t6) {
s3 = t6;
} });
var c3 = [];
Object.defineProperty(this, "pageBreaks", { get: function() {
return c3;
}, set: function(t6) {
c3 = t6;
} }), Object.defineProperty(this, "ctx", { get: function() {
return l2;
}, set: function(t6) {
t6 instanceof d2 && (l2 = t6);
} }), Object.defineProperty(this, "path", { get: function() {
return l2.path;
}, set: function(t6) {
l2.path = t6;
} });
var u3 = [];
Object.defineProperty(this, "ctxStack", { get: function() {
return u3;
}, set: function(t6) {
u3 = t6;
} }), Object.defineProperty(this, "fillStyle", { get: function() {
return this.ctx.fillStyle;
}, set: function(t6) {
var e9;
e9 = g2(t6), this.ctx.fillStyle = e9.style, this.ctx.isFillTransparent = 0 === e9.a, this.ctx.fillOpacity = e9.a, this.pdf.setFillColor(e9.r, e9.g, e9.b, { a: e9.a }), this.pdf.setTextColor(e9.r, e9.g, e9.b, { a: e9.a });
} }), Object.defineProperty(this, "strokeStyle", { get: function() {
return this.ctx.strokeStyle;
}, set: function(t6) {
var e9 = g2(t6);
this.ctx.strokeStyle = e9.style, this.ctx.isStrokeTransparent = 0 === e9.a, this.ctx.strokeOpacity = e9.a, 0 === e9.a ? this.pdf.setDrawColor(255, 255, 255) : (e9.a, this.pdf.setDrawColor(e9.r, e9.g, e9.b));
} }), Object.defineProperty(this, "lineCap", { get: function() {
return this.ctx.lineCap;
}, set: function(t6) {
-1 !== ["butt", "round", "square"].indexOf(t6) && (this.ctx.lineCap = t6, this.pdf.setLineCap(t6));
} }), Object.defineProperty(this, "lineWidth", { get: function() {
return this.ctx.lineWidth;
}, set: function(t6) {
isNaN(t6) || (this.ctx.lineWidth = t6, this.pdf.setLineWidth(t6));
} }), Object.defineProperty(this, "lineJoin", { get: function() {
return this.ctx.lineJoin;
}, set: function(t6) {
-1 !== ["bevel", "round", "miter"].indexOf(t6) && (this.ctx.lineJoin = t6, this.pdf.setLineJoin(t6));
} }), Object.defineProperty(this, "miterLimit", { get: function() {
return this.ctx.miterLimit;
}, set: function(t6) {
isNaN(t6) || (this.ctx.miterLimit = t6, this.pdf.setMiterLimit(t6));
} }), Object.defineProperty(this, "textBaseline", { get: function() {
return this.ctx.textBaseline;
}, set: function(t6) {
this.ctx.textBaseline = t6;
} }), Object.defineProperty(this, "textAlign", { get: function() {
return this.ctx.textAlign;
}, set: function(t6) {
-1 !== ["right", "end", "center", "left", "start"].indexOf(t6) && (this.ctx.textAlign = t6);
} });
var h3 = null;
function f2(t6, e9) {
if (null === h3) {
var r4 = function(t7) {
var e11 = [];
return Object.keys(t7).forEach(function(r5) {
t7[r5].forEach(function(t8) {
var n4 = null;
switch (t8) {
case "bold":
n4 = { family: r5, weight: "bold" };
break;
case "italic":
n4 = { family: r5, style: "italic" };
break;
case "bolditalic":
n4 = { family: r5, weight: "bold", style: "italic" };
break;
case "":
case "normal":
n4 = { family: r5 };
}
null !== n4 && (n4.ref = { name: r5, style: t8 }, e11.push(n4));
});
}), e11;
}(t6.getFontList());
h3 = function(t7) {
for (var e11 = {}, r5 = 0; r5 < t7.length; ++r5) {
var n4 = jt$1(t7[r5]), i4 = n4.family, a3 = n4.stretch, o4 = n4.style, s4 = n4.weight;
e11[i4] = e11[i4] || {}, e11[i4][a3] = e11[i4][a3] || {}, e11[i4][a3][o4] = e11[i4][a3][o4] || {}, e11[i4][a3][o4][s4] = n4;
}
return e11;
}(r4.concat(e9));
}
return h3;
}
var p3 = null;
Object.defineProperty(this, "fontFaces", { get: function() {
return p3;
}, set: function(t6) {
h3 = null, p3 = t6;
} }), Object.defineProperty(this, "font", { get: function() {
return this.ctx.font;
}, set: function(t6) {
var e9;
if (this.ctx.font = t6, null !== (e9 = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(t6))) {
var r4 = e9[1], n4 = (e9[2], e9[3]), i4 = e9[4], a3 = (e9[5], e9[6]), o4 = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i4)[2];
i4 = "px" === o4 ? Math.floor(parseFloat(i4) * this.pdf.internal.scaleFactor) : "em" === o4 ? Math.floor(parseFloat(i4) * this.pdf.getFontSize()) : Math.floor(parseFloat(i4) * this.pdf.internal.scaleFactor), this.pdf.setFontSize(i4);
var s4 = function(t7) {
var e11, r5, n5 = [], i5 = t7.trim();
if ("" === i5)
return Wt$1;
if (i5 in Mt$1)
return [Mt$1[i5]];
for (; "" !== i5; ) {
switch (r5 = null, e11 = (i5 = Dt$1(i5)).charAt(0)) {
case '"':
case "'":
r5 = Rt$1(i5.substring(1), e11);
break;
default:
r5 = Tt$1(i5);
}
if (null === r5)
return Wt$1;
if (n5.push(r5[0]), "" !== (i5 = Dt$1(r5[1])) && "," !== i5.charAt(0))
return Wt$1;
i5 = i5.replace(/^,/, "");
}
return n5;
}(a3);
if (this.fontFaces) {
var c4 = qt$1(f2(this.pdf, this.fontFaces), s4.map(function(t7) {
return { family: t7, stretch: "normal", weight: n4, style: r4 };
}));
this.pdf.setFont(c4.ref.name, c4.ref.style);
} else {
var u4 = "";
("bold" === n4 || parseInt(n4, 10) >= 700 || "bold" === r4) && (u4 = "bold"), "italic" === r4 && (u4 += "italic"), 0 === u4.length && (u4 = "normal");
for (var h4 = "", l3 = { arial: "Helvetica", Arial: "Helvetica", verdana: "Helvetica", Verdana: "Helvetica", helvetica: "Helvetica", Helvetica: "Helvetica", "sans-serif": "Helvetica", fixed: "Courier", monospace: "Courier", terminal: "Courier", cursive: "Times", fantasy: "Times", serif: "Times" }, d3 = 0; d3 < s4.length; d3++) {
if (void 0 !== this.pdf.internal.getFont(s4[d3], u4, { noFallback: true, disableWarning: true })) {
h4 = s4[d3];
break;
}
if ("bolditalic" === u4 && void 0 !== this.pdf.internal.getFont(s4[d3], "bold", { noFallback: true, disableWarning: true }))
h4 = s4[d3], u4 = "bold";
else if (void 0 !== this.pdf.internal.getFont(s4[d3], "normal", { noFallback: true, disableWarning: true })) {
h4 = s4[d3], u4 = "normal";
break;
}
}
if ("" === h4) {
for (var p4 = 0; p4 < s4.length; p4++)
if (l3[s4[p4]]) {
h4 = l3[s4[p4]];
break;
}
}
h4 = "" === h4 ? "Times" : h4, this.pdf.setFont(h4, u4);
}
}
} }), Object.defineProperty(this, "globalCompositeOperation", { get: function() {
return this.ctx.globalCompositeOperation;
}, set: function(t6) {
this.ctx.globalCompositeOperation = t6;
} }), Object.defineProperty(this, "globalAlpha", { get: function() {
return this.ctx.globalAlpha;
}, set: function(t6) {
this.ctx.globalAlpha = t6;
} }), Object.defineProperty(this, "lineDashOffset", { get: function() {
return this.ctx.lineDashOffset;
}, set: function(t6) {
this.ctx.lineDashOffset = t6, T2.call(this);
} }), Object.defineProperty(this, "lineDash", { get: function() {
return this.ctx.lineDash;
}, set: function(t6) {
this.ctx.lineDash = t6, T2.call(this);
} }), Object.defineProperty(this, "ignoreClearRect", { get: function() {
return this.ctx.ignoreClearRect;
}, set: function(t6) {
this.ctx.ignoreClearRect = Boolean(t6);
} });
};
p2.prototype.setLineDash = function(t5) {
this.lineDash = t5;
}, p2.prototype.getLineDash = function() {
return this.lineDash.length % 2 ? this.lineDash.concat(this.lineDash) : this.lineDash.slice();
}, p2.prototype.fill = function() {
A5.call(this, "fill", false);
}, p2.prototype.stroke = function() {
A5.call(this, "stroke", false);
}, p2.prototype.beginPath = function() {
this.path = [{ type: "begin" }];
}, p2.prototype.moveTo = function(t5, e8) {
if (isNaN(t5) || isNaN(e8))
throw a$m.error("jsPDF.context2d.moveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
var r3 = this.ctx.transform.applyToPoint(new c2(t5, e8));
this.path.push({ type: "mt", x: r3.x, y: r3.y }), this.ctx.lastPoint = new c2(t5, e8);
}, p2.prototype.closePath = function() {
var e8 = new c2(0, 0), r3 = 0;
for (r3 = this.path.length - 1; -1 !== r3; r3--)
if ("begin" === this.path[r3].type && "object" === _typeof$3(this.path[r3 + 1]) && "number" == typeof this.path[r3 + 1].x) {
e8 = new c2(this.path[r3 + 1].x, this.path[r3 + 1].y);
break;
}
this.path.push({ type: "close" }), this.ctx.lastPoint = new c2(e8.x, e8.y);
}, p2.prototype.lineTo = function(t5, e8) {
if (isNaN(t5) || isNaN(e8))
throw a$m.error("jsPDF.context2d.lineTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
var r3 = this.ctx.transform.applyToPoint(new c2(t5, e8));
this.path.push({ type: "lt", x: r3.x, y: r3.y }), this.ctx.lastPoint = new c2(r3.x, r3.y);
}, p2.prototype.clip = function() {
this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)), A5.call(this, null, true);
}, p2.prototype.quadraticCurveTo = function(t5, e8, r3, n3) {
if (isNaN(r3) || isNaN(n3) || isNaN(t5) || isNaN(e8))
throw a$m.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
var i3 = this.ctx.transform.applyToPoint(new c2(r3, n3)), o3 = this.ctx.transform.applyToPoint(new c2(t5, e8));
this.path.push({ type: "qct", x1: o3.x, y1: o3.y, x: i3.x, y: i3.y }), this.ctx.lastPoint = new c2(i3.x, i3.y);
}, p2.prototype.bezierCurveTo = function(t5, e8, r3, n3, i3, o3) {
if (isNaN(i3) || isNaN(o3) || isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3))
throw a$m.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
var s3 = this.ctx.transform.applyToPoint(new c2(i3, o3)), u3 = this.ctx.transform.applyToPoint(new c2(t5, e8)), h3 = this.ctx.transform.applyToPoint(new c2(r3, n3));
this.path.push({ type: "bct", x1: u3.x, y1: u3.y, x2: h3.x, y2: h3.y, x: s3.x, y: s3.y }), this.ctx.lastPoint = new c2(s3.x, s3.y);
}, p2.prototype.arc = function(t5, e8, r3, n3, i3, o3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3) || isNaN(i3))
throw a$m.error("jsPDF.context2d.arc: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.arc");
if (o3 = Boolean(o3), !this.ctx.transform.isIdentity) {
var s3 = this.ctx.transform.applyToPoint(new c2(t5, e8));
t5 = s3.x, e8 = s3.y;
var u3 = this.ctx.transform.applyToPoint(new c2(0, r3)), h3 = this.ctx.transform.applyToPoint(new c2(0, 0));
r3 = Math.sqrt(Math.pow(u3.x - h3.x, 2) + Math.pow(u3.y - h3.y, 2));
}
Math.abs(i3 - n3) >= 2 * Math.PI && (n3 = 0, i3 = 2 * Math.PI), this.path.push({ type: "arc", x: t5, y: e8, radius: r3, startAngle: n3, endAngle: i3, counterclockwise: o3 });
}, p2.prototype.arcTo = function(t5, e8, r3, n3, i3) {
throw new Error("arcTo not implemented.");
}, p2.prototype.rect = function(t5, e8, r3, n3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3))
throw a$m.error("jsPDF.context2d.rect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rect");
this.moveTo(t5, e8), this.lineTo(t5 + r3, e8), this.lineTo(t5 + r3, e8 + n3), this.lineTo(t5, e8 + n3), this.lineTo(t5, e8), this.lineTo(t5 + r3, e8), this.lineTo(t5, e8);
}, p2.prototype.fillRect = function(t5, e8, r3, n3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3))
throw a$m.error("jsPDF.context2d.fillRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillRect");
if (!m2.call(this)) {
var i3 = {};
"butt" !== this.lineCap && (i3.lineCap = this.lineCap, this.lineCap = "butt"), "miter" !== this.lineJoin && (i3.lineJoin = this.lineJoin, this.lineJoin = "miter"), this.beginPath(), this.rect(t5, e8, r3, n3), this.fill(), i3.hasOwnProperty("lineCap") && (this.lineCap = i3.lineCap), i3.hasOwnProperty("lineJoin") && (this.lineJoin = i3.lineJoin);
}
}, p2.prototype.strokeRect = function(t5, e8, r3, n3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3))
throw a$m.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
v2.call(this) || (this.beginPath(), this.rect(t5, e8, r3, n3), this.stroke());
}, p2.prototype.clearRect = function(t5, e8, r3, n3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3))
throw a$m.error("jsPDF.context2d.clearRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
this.ignoreClearRect || (this.fillStyle = "#ffffff", this.fillRect(t5, e8, r3, n3));
}, p2.prototype.save = function(t5) {
t5 = "boolean" != typeof t5 || t5;
for (var e8 = this.pdf.internal.getCurrentPageInfo().pageNumber, r3 = 0; r3 < this.pdf.internal.getNumberOfPages(); r3++)
this.pdf.setPage(r3 + 1), this.pdf.internal.out("q");
if (this.pdf.setPage(e8), t5) {
this.ctx.fontSize = this.pdf.internal.getFontSize();
var n3 = new d2(this.ctx);
this.ctxStack.push(this.ctx), this.ctx = n3;
}
}, p2.prototype.restore = function(t5) {
t5 = "boolean" != typeof t5 || t5;
for (var e8 = this.pdf.internal.getCurrentPageInfo().pageNumber, r3 = 0; r3 < this.pdf.internal.getNumberOfPages(); r3++)
this.pdf.setPage(r3 + 1), this.pdf.internal.out("Q");
this.pdf.setPage(e8), t5 && 0 !== this.ctxStack.length && (this.ctx = this.ctxStack.pop(), this.fillStyle = this.ctx.fillStyle, this.strokeStyle = this.ctx.strokeStyle, this.font = this.ctx.font, this.lineCap = this.ctx.lineCap, this.lineWidth = this.ctx.lineWidth, this.lineJoin = this.ctx.lineJoin, this.lineDash = this.ctx.lineDash, this.lineDashOffset = this.ctx.lineDashOffset);
}, p2.prototype.toDataURL = function() {
throw new Error("toDataUrl not implemented.");
};
var g2 = function(t5) {
var e8, r3, n3, i3;
if (true === t5.isCanvasGradient && (t5 = t5.getColor()), !t5)
return { r: 0, g: 0, b: 0, a: 0, style: t5 };
if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t5))
e8 = 0, r3 = 0, n3 = 0, i3 = 0;
else {
var a2 = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t5);
if (null !== a2)
e8 = parseInt(a2[1]), r3 = parseInt(a2[2]), n3 = parseInt(a2[3]), i3 = 1;
else if (null !== (a2 = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(t5)))
e8 = parseInt(a2[1]), r3 = parseInt(a2[2]), n3 = parseInt(a2[3]), i3 = parseFloat(a2[4]);
else {
if (i3 = 1, "string" == typeof t5 && "#" !== t5.charAt(0)) {
var o3 = new f$3(t5);
t5 = o3.ok ? o3.toHex() : "#000000";
}
4 === t5.length ? (e8 = t5.substring(1, 2), e8 += e8, r3 = t5.substring(2, 3), r3 += r3, n3 = t5.substring(3, 4), n3 += n3) : (e8 = t5.substring(1, 3), r3 = t5.substring(3, 5), n3 = t5.substring(5, 7)), e8 = parseInt(e8, 16), r3 = parseInt(r3, 16), n3 = parseInt(n3, 16);
}
}
return { r: e8, g: r3, b: n3, a: i3, style: t5 };
}, m2 = function() {
return this.ctx.isFillTransparent || 0 == this.globalAlpha;
}, v2 = function() {
return Boolean(this.ctx.isStrokeTransparent || 0 == this.globalAlpha);
};
p2.prototype.fillText = function(t5, e8, r3, n3) {
if (isNaN(e8) || isNaN(r3) || "string" != typeof t5)
throw a$m.error("jsPDF.context2d.fillText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillText");
if (n3 = isNaN(n3) ? void 0 : n3, !m2.call(this)) {
var i3 = q2(this.ctx.transform.rotation), o3 = this.ctx.transform.scaleX;
C3.call(this, { text: t5, x: e8, y: r3, scale: o3, angle: i3, align: this.textAlign, maxWidth: n3 });
}
}, p2.prototype.strokeText = function(t5, e8, r3, n3) {
if (isNaN(e8) || isNaN(r3) || "string" != typeof t5)
throw a$m.error("jsPDF.context2d.strokeText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
if (!v2.call(this)) {
n3 = isNaN(n3) ? void 0 : n3;
var i3 = q2(this.ctx.transform.rotation), o3 = this.ctx.transform.scaleX;
C3.call(this, { text: t5, x: e8, y: r3, scale: o3, renderingMode: "stroke", angle: i3, align: this.textAlign, maxWidth: n3 });
}
}, p2.prototype.measureText = function(t5) {
if ("string" != typeof t5)
throw a$m.error("jsPDF.context2d.measureText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.measureText");
var e8 = this.pdf, r3 = this.pdf.internal.scaleFactor, n3 = e8.internal.getFontSize(), i3 = e8.getStringUnitWidth(t5) * n3 / e8.internal.scaleFactor, o3 = function(t6) {
var e9 = (t6 = t6 || {}).width || 0;
return Object.defineProperty(this, "width", { get: function() {
return e9;
} }), this;
};
return new o3({ width: i3 *= Math.round(96 * r3 / 72 * 1e4) / 1e4 });
}, p2.prototype.scale = function(t5, e8) {
if (isNaN(t5) || isNaN(e8))
throw a$m.error("jsPDF.context2d.scale: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.scale");
var r3 = new h2(t5, 0, 0, e8, 0, 0);
this.ctx.transform = this.ctx.transform.multiply(r3);
}, p2.prototype.rotate = function(t5) {
if (isNaN(t5))
throw a$m.error("jsPDF.context2d.rotate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rotate");
var e8 = new h2(Math.cos(t5), Math.sin(t5), -Math.sin(t5), Math.cos(t5), 0, 0);
this.ctx.transform = this.ctx.transform.multiply(e8);
}, p2.prototype.translate = function(t5, e8) {
if (isNaN(t5) || isNaN(e8))
throw a$m.error("jsPDF.context2d.translate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.translate");
var r3 = new h2(1, 0, 0, 1, t5, e8);
this.ctx.transform = this.ctx.transform.multiply(r3);
}, p2.prototype.transform = function(t5, e8, r3, n3, i3, o3) {
if (isNaN(t5) || isNaN(e8) || isNaN(r3) || isNaN(n3) || isNaN(i3) || isNaN(o3))
throw a$m.error("jsPDF.context2d.transform: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.transform");
var s3 = new h2(t5, e8, r3, n3, i3, o3);
this.ctx.transform = this.ctx.transform.multiply(s3);
}, p2.prototype.setTransform = function(t5, e8, r3, n3, i3, a2) {
t5 = isNaN(t5) ? 1 : t5, e8 = isNaN(e8) ? 0 : e8, r3 = isNaN(r3) ? 0 : r3, n3 = isNaN(n3) ? 1 : n3, i3 = isNaN(i3) ? 0 : i3, a2 = isNaN(a2) ? 0 : a2, this.ctx.transform = new h2(t5, e8, r3, n3, i3, a2);
};
var b2 = function() {
return this.margin[0] > 0 || this.margin[1] > 0 || this.margin[2] > 0 || this.margin[3] > 0;
};
p2.prototype.drawImage = function(t5, e8, r3, n3, i3, a2, o3, s3, c3) {
var l3 = this.pdf.getImageProperties(t5), f2 = 1, d3 = 1, p3 = 1, g3 = 1;
void 0 !== n3 && void 0 !== s3 && (p3 = s3 / n3, g3 = c3 / i3, f2 = l3.width / n3 * s3 / n3, d3 = l3.height / i3 * c3 / i3), void 0 === a2 && (a2 = e8, o3 = r3, e8 = 0, r3 = 0), void 0 !== n3 && void 0 === s3 && (s3 = n3, c3 = i3), void 0 === n3 && void 0 === s3 && (s3 = l3.width, c3 = l3.height);
for (var m3, v3 = this.ctx.transform.decompose(), w3 = q2(v3.rotate.shx), A6 = new h2(), S3 = (A6 = (A6 = (A6 = A6.multiply(v3.translate)).multiply(v3.skew)).multiply(v3.scale)).applyToRectangle(new u2(a2 - e8 * p3, o3 - r3 * g3, n3 * f2, i3 * d3)), _25 = y2.call(this, S3), P3 = [], k3 = 0; k3 < _25.length; k3 += 1)
-1 === P3.indexOf(_25[k3]) && P3.push(_25[k3]);
if (L2(P3), this.autoPaging)
for (var I3 = P3[0], F3 = P3[P3.length - 1], C4 = I3; C4 < F3 + 1; C4++) {
this.pdf.setPage(C4);
var j3 = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], O3 = 1 === C4 ? this.posY + this.margin[0] : this.margin[0], B4 = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], M3 = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], E3 = 1 === C4 ? 0 : B4 + (C4 - 2) * M3;
if (0 !== this.ctx.clip_path.length) {
var D3 = this.path;
m3 = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = N2(m3, this.posX + this.margin[3], -E3 + O3 + this.ctx.prevPageLastElemOffset), x2.call(this, "fill", true), this.path = D3;
}
var R3 = JSON.parse(JSON.stringify(S3));
R3 = N2([R3], this.posX + this.margin[3], -E3 + O3 + this.ctx.prevPageLastElemOffset)[0];
var T3 = (C4 > I3 || C4 < F3) && b2.call(this);
T3 && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], j3, M3, null).clip().discardPath()), this.pdf.addImage(t5, "JPEG", R3.x, R3.y, R3.w, R3.h, null, null, w3), T3 && this.pdf.restoreGraphicsState();
}
else
this.pdf.addImage(t5, "JPEG", S3.x, S3.y, S3.w, S3.h, null, null, w3);
};
var y2 = function(t5, e8, r3) {
var n3 = [];
e8 = e8 || this.pdf.internal.pageSize.width, r3 = r3 || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
var i3 = this.posY + this.ctx.prevPageLastElemOffset;
switch (t5.type) {
default:
case "mt":
case "lt":
n3.push(Math.floor((t5.y + i3) / r3) + 1);
break;
case "arc":
n3.push(Math.floor((t5.y + i3 - t5.radius) / r3) + 1), n3.push(Math.floor((t5.y + i3 + t5.radius) / r3) + 1);
break;
case "qct":
var a2 = D2(this.ctx.lastPoint.x, this.ctx.lastPoint.y, t5.x1, t5.y1, t5.x, t5.y);
n3.push(Math.floor((a2.y + i3) / r3) + 1), n3.push(Math.floor((a2.y + a2.h + i3) / r3) + 1);
break;
case "bct":
var o3 = R2(this.ctx.lastPoint.x, this.ctx.lastPoint.y, t5.x1, t5.y1, t5.x2, t5.y2, t5.x, t5.y);
n3.push(Math.floor((o3.y + i3) / r3) + 1), n3.push(Math.floor((o3.y + o3.h + i3) / r3) + 1);
break;
case "rect":
n3.push(Math.floor((t5.y + i3) / r3) + 1), n3.push(Math.floor((t5.y + t5.h + i3) / r3) + 1);
}
for (var s3 = 0; s3 < n3.length; s3 += 1)
for (; this.pdf.internal.getNumberOfPages() < n3[s3]; )
w2.call(this);
return n3;
}, w2 = function() {
var t5 = this.fillStyle, e8 = this.strokeStyle, r3 = this.font, n3 = this.lineCap, i3 = this.lineWidth, a2 = this.lineJoin;
this.pdf.addPage(), this.fillStyle = t5, this.strokeStyle = e8, this.font = r3, this.lineCap = n3, this.lineWidth = i3, this.lineJoin = a2;
}, N2 = function(t5, e8, r3) {
for (var n3 = 0; n3 < t5.length; n3++)
switch (t5[n3].type) {
case "bct":
t5[n3].x2 += e8, t5[n3].y2 += r3;
case "qct":
t5[n3].x1 += e8, t5[n3].y1 += r3;
case "mt":
case "lt":
case "arc":
default:
t5[n3].x += e8, t5[n3].y += r3;
}
return t5;
}, L2 = function(t5) {
return t5.sort(function(t6, e8) {
return t6 - e8;
});
}, A5 = function(t5, e8) {
for (var r3, n3, i3 = this.fillStyle, a2 = this.strokeStyle, o3 = this.lineCap, s3 = this.lineWidth, c3 = Math.abs(s3 * this.ctx.transform.scaleX), u3 = this.lineJoin, h3 = JSON.parse(JSON.stringify(this.path)), l3 = JSON.parse(JSON.stringify(this.path)), f2 = [], d3 = 0; d3 < l3.length; d3++)
if (void 0 !== l3[d3].x)
for (var p3 = y2.call(this, l3[d3]), g3 = 0; g3 < p3.length; g3 += 1)
-1 === f2.indexOf(p3[g3]) && f2.push(p3[g3]);
for (var m3 = 0; m3 < f2.length; m3++)
for (; this.pdf.internal.getNumberOfPages() < f2[m3]; )
w2.call(this);
if (L2(f2), this.autoPaging)
for (var v3 = f2[0], A6 = f2[f2.length - 1], S3 = v3; S3 < A6 + 1; S3++) {
this.pdf.setPage(S3), this.fillStyle = i3, this.strokeStyle = a2, this.lineCap = o3, this.lineWidth = c3, this.lineJoin = u3;
var _25 = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], P3 = 1 === S3 ? this.posY + this.margin[0] : this.margin[0], k3 = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], I3 = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], F3 = 1 === S3 ? 0 : k3 + (S3 - 2) * I3;
if (0 !== this.ctx.clip_path.length) {
var C4 = this.path;
r3 = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = N2(r3, this.posX + this.margin[3], -F3 + P3 + this.ctx.prevPageLastElemOffset), x2.call(this, t5, true), this.path = C4;
}
if (n3 = JSON.parse(JSON.stringify(h3)), this.path = N2(n3, this.posX + this.margin[3], -F3 + P3 + this.ctx.prevPageLastElemOffset), false === e8 || 0 === S3) {
var j3 = (S3 > v3 || S3 < A6) && b2.call(this);
j3 && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], _25, I3, null).clip().discardPath()), x2.call(this, t5, e8), j3 && this.pdf.restoreGraphicsState();
}
this.lineWidth = s3;
}
else
this.lineWidth = c3, x2.call(this, t5, e8), this.lineWidth = s3;
this.path = h3;
}, x2 = function(t5, e8) {
if (("stroke" !== t5 || e8 || !v2.call(this)) && ("stroke" === t5 || e8 || !m2.call(this))) {
for (var r3, n3, i3 = [], a2 = this.path, o3 = 0; o3 < a2.length; o3++) {
var s3 = a2[o3];
switch (s3.type) {
case "begin":
i3.push({ begin: true });
break;
case "close":
i3.push({ close: true });
break;
case "mt":
i3.push({ start: s3, deltas: [], abs: [] });
break;
case "lt":
var c3 = i3.length;
if (a2[o3 - 1] && !isNaN(a2[o3 - 1].x) && (r3 = [s3.x - a2[o3 - 1].x, s3.y - a2[o3 - 1].y], c3 > 0)) {
for (; c3 >= 0; c3--)
if (true !== i3[c3 - 1].close && true !== i3[c3 - 1].begin) {
i3[c3 - 1].deltas.push(r3), i3[c3 - 1].abs.push(s3);
break;
}
}
break;
case "bct":
r3 = [s3.x1 - a2[o3 - 1].x, s3.y1 - a2[o3 - 1].y, s3.x2 - a2[o3 - 1].x, s3.y2 - a2[o3 - 1].y, s3.x - a2[o3 - 1].x, s3.y - a2[o3 - 1].y], i3[i3.length - 1].deltas.push(r3);
break;
case "qct":
var u3 = a2[o3 - 1].x + 2 / 3 * (s3.x1 - a2[o3 - 1].x), h3 = a2[o3 - 1].y + 2 / 3 * (s3.y1 - a2[o3 - 1].y), l3 = s3.x + 2 / 3 * (s3.x1 - s3.x), f2 = s3.y + 2 / 3 * (s3.y1 - s3.y), d3 = s3.x, p3 = s3.y;
r3 = [u3 - a2[o3 - 1].x, h3 - a2[o3 - 1].y, l3 - a2[o3 - 1].x, f2 - a2[o3 - 1].y, d3 - a2[o3 - 1].x, p3 - a2[o3 - 1].y], i3[i3.length - 1].deltas.push(r3);
break;
case "arc":
i3.push({ deltas: [], abs: [], arc: true }), Array.isArray(i3[i3.length - 1].abs) && i3[i3.length - 1].abs.push(s3);
}
}
n3 = e8 ? null : "stroke" === t5 ? "stroke" : "fill";
for (var g3 = false, b3 = 0; b3 < i3.length; b3++)
if (i3[b3].arc)
for (var y3 = i3[b3].abs, w3 = 0; w3 < y3.length; w3++) {
var N3 = y3[w3];
"arc" === N3.type ? P2.call(this, N3.x, N3.y, N3.radius, N3.startAngle, N3.endAngle, N3.counterclockwise, void 0, e8, !g3) : j2.call(this, N3.x, N3.y), g3 = true;
}
else if (true === i3[b3].close)
this.pdf.internal.out("h"), g3 = false;
else if (true !== i3[b3].begin) {
var L3 = i3[b3].start.x, A6 = i3[b3].start.y;
O2.call(this, i3[b3].deltas, L3, A6), g3 = true;
}
n3 && k2.call(this, n3), e8 && I2.call(this);
}
}, S2 = function(t5) {
var e8 = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor, r3 = e8 * (this.pdf.internal.getLineHeightFactor() - 1);
switch (this.ctx.textBaseline) {
case "bottom":
return t5 - r3;
case "top":
return t5 + e8 - r3;
case "hanging":
return t5 + e8 - 2 * r3;
case "middle":
return t5 + e8 / 2 - r3;
case "ideographic":
return t5;
case "alphabetic":
default:
return t5;
}
}, _24 = function(t5) {
return t5 + this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor * (this.pdf.internal.getLineHeightFactor() - 1);
};
p2.prototype.createLinearGradient = function() {
var t5 = function() {
};
return t5.colorStops = [], t5.addColorStop = function(t6, e8) {
this.colorStops.push([t6, e8]);
}, t5.getColor = function() {
return 0 === this.colorStops.length ? "#000000" : this.colorStops[0][1];
}, t5.isCanvasGradient = true, t5;
}, p2.prototype.createPattern = function() {
return this.createLinearGradient();
}, p2.prototype.createRadialGradient = function() {
return this.createLinearGradient();
};
var P2 = function(t5, e8, r3, n3, i3, a2, o3, s3, c3) {
for (var u3 = M2.call(this, r3, n3, i3, a2), h3 = 0; h3 < u3.length; h3++) {
var l3 = u3[h3];
0 === h3 && (c3 ? F2.call(this, l3.x1 + t5, l3.y1 + e8) : j2.call(this, l3.x1 + t5, l3.y1 + e8)), B3.call(this, t5, e8, l3.x2, l3.y2, l3.x3, l3.y3, l3.x4, l3.y4);
}
s3 ? I2.call(this) : k2.call(this, o3);
}, k2 = function(t5) {
switch (t5) {
case "stroke":
this.pdf.internal.out("S");
break;
case "fill":
this.pdf.internal.out("f");
}
}, I2 = function() {
this.pdf.clip(), this.pdf.discardPath();
}, F2 = function(t5, e8) {
this.pdf.internal.out(n2(t5) + " " + i2(e8) + " m");
}, C3 = function(t5) {
var e8;
switch (t5.align) {
case "right":
case "end":
e8 = "right";
break;
case "center":
e8 = "center";
break;
case "left":
case "start":
default:
e8 = "left";
}
var r3 = this.pdf.getTextDimensions(t5.text), n3 = S2.call(this, t5.y), i3 = _24.call(this, n3) - r3.h, a2 = this.ctx.transform.applyToPoint(new c2(t5.x, n3)), o3 = this.ctx.transform.decompose(), s3 = new h2();
s3 = (s3 = (s3 = s3.multiply(o3.translate)).multiply(o3.skew)).multiply(o3.scale);
for (var l3, f2, d3, p3 = this.ctx.transform.applyToRectangle(new u2(t5.x, n3, r3.w, r3.h)), g3 = s3.applyToRectangle(new u2(t5.x, i3, r3.w, r3.h)), m3 = y2.call(this, g3), v3 = [], w3 = 0; w3 < m3.length; w3 += 1)
-1 === v3.indexOf(m3[w3]) && v3.push(m3[w3]);
if (L2(v3), this.autoPaging)
for (var A6 = v3[0], P3 = v3[v3.length - 1], k3 = A6; k3 < P3 + 1; k3++) {
this.pdf.setPage(k3);
var I3 = 1 === k3 ? this.posY + this.margin[0] : this.margin[0], F3 = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], C4 = this.pdf.internal.pageSize.height - this.margin[2], j3 = C4 - this.margin[0], O3 = this.pdf.internal.pageSize.width - this.margin[1], B4 = O3 - this.margin[3], M3 = 1 === k3 ? 0 : F3 + (k3 - 2) * j3;
if (0 !== this.ctx.clip_path.length) {
var E3 = this.path;
l3 = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = N2(l3, this.posX + this.margin[3], -1 * M3 + I3), x2.call(this, "fill", true), this.path = E3;
}
var q3 = N2([JSON.parse(JSON.stringify(g3))], this.posX + this.margin[3], -M3 + I3 + this.ctx.prevPageLastElemOffset)[0];
t5.scale >= 0.01 && (f2 = this.pdf.internal.getFontSize(), this.pdf.setFontSize(f2 * t5.scale), d3 = this.lineWidth, this.lineWidth = d3 * t5.scale);
var D3 = "text" !== this.autoPaging;
if (D3 || q3.y + q3.h <= C4) {
if (D3 || q3.y >= I3 && q3.x <= O3) {
var R3 = D3 ? t5.text : this.pdf.splitTextToSize(t5.text, t5.maxWidth || O3 - q3.x)[0], T3 = N2([JSON.parse(JSON.stringify(p3))], this.posX + this.margin[3], -M3 + I3 + this.ctx.prevPageLastElemOffset)[0], U2 = D3 && (k3 > A6 || k3 < P3) && b2.call(this);
U2 && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], B4, j3, null).clip().discardPath()), this.pdf.text(R3, T3.x, T3.y, { angle: t5.angle, align: e8, renderingMode: t5.renderingMode }), U2 && this.pdf.restoreGraphicsState();
}
} else
q3.y < C4 && (this.ctx.prevPageLastElemOffset += C4 - q3.y);
t5.scale >= 0.01 && (this.pdf.setFontSize(f2), this.lineWidth = d3);
}
else
t5.scale >= 0.01 && (f2 = this.pdf.internal.getFontSize(), this.pdf.setFontSize(f2 * t5.scale), d3 = this.lineWidth, this.lineWidth = d3 * t5.scale), this.pdf.text(t5.text, a2.x + this.posX, a2.y + this.posY, { angle: t5.angle, align: e8, renderingMode: t5.renderingMode, maxWidth: t5.maxWidth }), t5.scale >= 0.01 && (this.pdf.setFontSize(f2), this.lineWidth = d3);
}, j2 = function(t5, e8, r3, a2) {
r3 = r3 || 0, a2 = a2 || 0, this.pdf.internal.out(n2(t5 + r3) + " " + i2(e8 + a2) + " l");
}, O2 = function(t5, e8, r3) {
return this.pdf.lines(t5, e8, r3, null, null);
}, B3 = function(t5, e8, n3, i3, a2, c3, u3, h3) {
this.pdf.internal.out([r2(o2(n3 + t5)), r2(s2(i3 + e8)), r2(o2(a2 + t5)), r2(s2(c3 + e8)), r2(o2(u3 + t5)), r2(s2(h3 + e8)), "c"].join(" "));
}, M2 = function(t5, e8, r3, n3) {
for (var i3 = 2 * Math.PI, a2 = Math.PI / 2; e8 > r3; )
e8 -= i3;
var o3 = Math.abs(r3 - e8);
o3 < i3 && n3 && (o3 = i3 - o3);
for (var s3 = [], c3 = n3 ? -1 : 1, u3 = e8; o3 > 1e-5; ) {
var h3 = u3 + c3 * Math.min(o3, a2);
s3.push(E2.call(this, t5, u3, h3)), o3 -= Math.abs(h3 - u3), u3 = h3;
}
return s3;
}, E2 = function(t5, e8, r3) {
var n3 = (r3 - e8) / 2, i3 = t5 * Math.cos(n3), a2 = t5 * Math.sin(n3), o3 = i3, s3 = -a2, c3 = o3 * o3 + s3 * s3, u3 = c3 + o3 * i3 + s3 * a2, h3 = 4 / 3 * (Math.sqrt(2 * c3 * u3) - u3) / (o3 * a2 - s3 * i3), l3 = o3 - h3 * s3, f2 = s3 + h3 * o3, d3 = l3, p3 = -f2, g3 = n3 + e8, m3 = Math.cos(g3), v3 = Math.sin(g3);
return { x1: t5 * Math.cos(e8), y1: t5 * Math.sin(e8), x2: l3 * m3 - f2 * v3, y2: l3 * v3 + f2 * m3, x3: d3 * m3 - p3 * v3, y3: d3 * v3 + p3 * m3, x4: t5 * Math.cos(r3), y4: t5 * Math.sin(r3) };
}, q2 = function(t5) {
return 180 * t5 / Math.PI;
}, D2 = function(t5, e8, r3, n3, i3, a2) {
var o3 = t5 + 0.5 * (r3 - t5), s3 = e8 + 0.5 * (n3 - e8), c3 = i3 + 0.5 * (r3 - i3), h3 = a2 + 0.5 * (n3 - a2), l3 = Math.min(t5, i3, o3, c3), f2 = Math.max(t5, i3, o3, c3), d3 = Math.min(e8, a2, s3, h3), p3 = Math.max(e8, a2, s3, h3);
return new u2(l3, d3, f2 - l3, p3 - d3);
}, R2 = function(t5, e8, r3, n3, i3, a2, o3, s3) {
var c3, h3, l3, f2, d3, p3, g3, m3, v3, b3, y3, w3, N3, L3, A6 = r3 - t5, x3 = n3 - e8, S3 = i3 - r3, _25 = a2 - n3, P3 = o3 - i3, k3 = s3 - a2;
for (h3 = 0; h3 < 41; h3++)
v3 = (g3 = (l3 = t5 + (c3 = h3 / 40) * A6) + c3 * ((d3 = r3 + c3 * S3) - l3)) + c3 * (d3 + c3 * (i3 + c3 * P3 - d3) - g3), b3 = (m3 = (f2 = e8 + c3 * x3) + c3 * ((p3 = n3 + c3 * _25) - f2)) + c3 * (p3 + c3 * (a2 + c3 * k3 - p3) - m3), 0 == h3 ? (y3 = v3, w3 = b3, N3 = v3, L3 = b3) : (y3 = Math.min(y3, v3), w3 = Math.min(w3, b3), N3 = Math.max(N3, v3), L3 = Math.max(L3, b3));
return new u2(Math.round(y3), Math.round(w3), Math.round(N3 - y3), Math.round(L3 - w3));
}, T2 = function() {
if (this.prevLineDash || this.ctx.lineDash.length || this.ctx.lineDashOffset) {
var t5, e8, r3 = (t5 = this.ctx.lineDash, e8 = this.ctx.lineDashOffset, JSON.stringify({ lineDash: t5, lineDashOffset: e8 }));
this.prevLineDash !== r3 && (this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset), this.prevLineDash = r3);
}
};
}(E$2.API), /**
* @license
* jsPDF filters PlugIn
* Copyright (c) 2014 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var r2 = function(t6) {
var e7, r3, n3, i3, a3, o2, s2, c2, u2, h2;
for (r3 = [], n3 = 0, i3 = (t6 += e7 = "\0\0\0\0".slice(t6.length % 4 || 4)).length; i3 > n3; n3 += 4)
0 !== (a3 = (t6.charCodeAt(n3) << 24) + (t6.charCodeAt(n3 + 1) << 16) + (t6.charCodeAt(n3 + 2) << 8) + t6.charCodeAt(n3 + 3)) ? (o2 = (a3 = ((a3 = ((a3 = ((a3 = (a3 - (h2 = a3 % 85)) / 85) - (u2 = a3 % 85)) / 85) - (c2 = a3 % 85)) / 85) - (s2 = a3 % 85)) / 85) % 85, r3.push(o2 + 33, s2 + 33, c2 + 33, u2 + 33, h2 + 33)) : r3.push(122);
return function(t7, e8) {
for (var r4 = e8; r4 > 0; r4--)
t7.pop();
}(r3, e7.length), String.fromCharCode.apply(String, r3) + "~>";
}, n2 = function(t6) {
var e7, r3, n3, i3, a3, o2 = String, s2 = "length", c2 = 255, u2 = "charCodeAt", h2 = "slice", l2 = "replace";
for (t6[h2](-2), t6 = t6[h2](0, -2)[l2](/\s/g, "")[l2]("z", "!!!!!"), n3 = [], i3 = 0, a3 = (t6 += e7 = "uuuuu"[h2](t6[s2] % 5 || 5))[s2]; a3 > i3; i3 += 5)
r3 = 52200625 * (t6[u2](i3) - 33) + 614125 * (t6[u2](i3 + 1) - 33) + 7225 * (t6[u2](i3 + 2) - 33) + 85 * (t6[u2](i3 + 3) - 33) + (t6[u2](i3 + 4) - 33), n3.push(c2 & r3 >> 24, c2 & r3 >> 16, c2 & r3 >> 8, c2 & r3);
return function(t7, e8) {
for (var r4 = e8; r4 > 0; r4--)
t7.pop();
}(n3, e7[s2]), o2.fromCharCode.apply(o2, n3);
}, i2 = function(t6) {
var e7 = new RegExp(/^([0-9A-Fa-f]{2})+$/);
if (-1 !== (t6 = t6.replace(/\s/g, "")).indexOf(">") && (t6 = t6.substr(0, t6.indexOf(">"))), t6.length % 2 && (t6 += "0"), false === e7.test(t6))
return "";
for (var r3 = "", n3 = 0; n3 < t6.length; n3 += 2)
r3 += String.fromCharCode("0x" + (t6[n3] + t6[n3 + 1]));
return r3;
}, a2 = function(t6) {
for (var r3 = new Uint8Array(t6.length), n3 = t6.length; n3--; )
r3[n3] = t6.charCodeAt(n3);
return t6 = (r3 = zlibSync(r3)).reduce(function(t7, e7) {
return t7 + String.fromCharCode(e7);
}, "");
};
t5.processDataByFilters = function(t6, e7) {
var o2 = 0, s2 = t6 || "", c2 = [];
for ("string" == typeof (e7 = e7 || []) && (e7 = [e7]), o2 = 0; o2 < e7.length; o2 += 1)
switch (e7[o2]) {
case "ASCII85Decode":
case "/ASCII85Decode":
s2 = n2(s2), c2.push("/ASCII85Encode");
break;
case "ASCII85Encode":
case "/ASCII85Encode":
s2 = r2(s2), c2.push("/ASCII85Decode");
break;
case "ASCIIHexDecode":
case "/ASCIIHexDecode":
s2 = i2(s2), c2.push("/ASCIIHexEncode");
break;
case "ASCIIHexEncode":
case "/ASCIIHexEncode":
s2 = s2.split("").map(function(t7) {
return ("0" + t7.charCodeAt().toString(16)).slice(-2);
}).join("") + ">", c2.push("/ASCIIHexDecode");
break;
case "FlateEncode":
case "/FlateEncode":
s2 = a2(s2), c2.push("/FlateDecode");
break;
default:
throw new Error('The filter: "' + e7[o2] + '" is not implemented');
}
return { data: s2, reverseChain: c2.reverse().join(" ") };
};
}(E$2.API), /**
* @license
* jsPDF fileloading PlugIn
* Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
t5.loadFile = function(t6, e7, r2) {
return function(t7, e8, r3) {
e8 = false !== e8, r3 = "function" == typeof r3 ? r3 : function() {
};
var n2 = void 0;
try {
n2 = function(t8, e9, r4) {
var n3 = new XMLHttpRequest(), i2 = 0, a2 = function(t9) {
var e11 = t9.length, r5 = [], n4 = String.fromCharCode;
for (i2 = 0; i2 < e11; i2 += 1)
r5.push(n4(255 & t9.charCodeAt(i2)));
return r5.join("");
};
if (n3.open("GET", t8, !e9), n3.overrideMimeType("text/plain; charset=x-user-defined"), false === e9 && (n3.onload = function() {
200 === n3.status ? r4(a2(this.responseText)) : r4(void 0);
}), n3.send(null), e9 && 200 === n3.status)
return a2(n3.responseText);
}(t7, e8, r3);
} catch (t8) {
}
return n2;
}(t6, e7, r2);
}, t5.loadImageFile = t5.loadFile;
}(E$2.API), function(e7) {
function r2() {
return (n$8.html2canvas ? Promise.resolve(n$8.html2canvas) : __vitePreload(() => Promise.resolve().then(() => html2canvas_esm), true ? void 0 : void 0)).catch(function(t5) {
return Promise.reject(new Error("Could not load html2canvas: " + t5));
}).then(function(t5) {
return t5.default ? t5.default : t5;
});
}
function i2() {
return (n$8.DOMPurify ? Promise.resolve(n$8.DOMPurify) : __vitePreload(() => Promise.resolve().then(() => purify_es), true ? void 0 : void 0)).catch(function(t5) {
return Promise.reject(new Error("Could not load dompurify: " + t5));
}).then(function(t5) {
return t5.default ? t5.default : t5;
});
}
var a2 = function(e8) {
var r3 = _typeof$3(e8);
return "undefined" === r3 ? "undefined" : "string" === r3 || e8 instanceof String ? "string" : "number" === r3 || e8 instanceof Number ? "number" : "function" === r3 || e8 instanceof Function ? "function" : e8 && e8.constructor === Array ? "array" : e8 && 1 === e8.nodeType ? "element" : "object" === r3 ? "object" : "unknown";
}, o2 = function(t5, e8) {
var r3 = document.createElement(t5);
for (var n2 in e8.className && (r3.className = e8.className), e8.innerHTML && e8.dompurify && (r3.innerHTML = e8.dompurify.sanitize(e8.innerHTML)), e8.style)
r3.style[n2] = e8.style[n2];
return r3;
}, s2 = function t5(e8) {
var r3 = Object.assign(t5.convert(Promise.resolve()), JSON.parse(JSON.stringify(t5.template))), n2 = t5.convert(Promise.resolve(), r3);
return n2 = (n2 = n2.setProgress(1, t5, 1, [t5])).set(e8);
};
(s2.prototype = Object.create(Promise.prototype)).constructor = s2, s2.convert = function(t5, e8) {
return t5.__proto__ = e8 || s2.prototype, t5;
}, s2.template = { prop: { src: null, container: null, overlay: null, canvas: null, img: null, pdf: null, pageSize: null, callback: function() {
} }, progress: { val: 0, state: null, n: 0, stack: [] }, opt: { filename: "file.pdf", margin: [0, 0, 0, 0], enableLinks: true, x: 0, y: 0, html2canvas: {}, jsPDF: {}, backgroundColor: "transparent" } }, s2.prototype.from = function(t5, e8) {
return this.then(function() {
switch (e8 = e8 || function(t6) {
switch (a2(t6)) {
case "string":
return "string";
case "element":
return "canvas" === t6.nodeName.toLowerCase() ? "canvas" : "element";
default:
return "unknown";
}
}(t5)) {
case "string":
return this.then(i2).then(function(e9) {
return this.set({ src: o2("div", { innerHTML: t5, dompurify: e9 }) });
});
case "element":
return this.set({ src: t5 });
case "canvas":
return this.set({ canvas: t5 });
case "img":
return this.set({ img: t5 });
default:
return this.error("Unknown source type.");
}
});
}, s2.prototype.to = function(t5) {
switch (t5) {
case "container":
return this.toContainer();
case "canvas":
return this.toCanvas();
case "img":
return this.toImg();
case "pdf":
return this.toPdf();
default:
return this.error("Invalid target.");
}
}, s2.prototype.toContainer = function() {
return this.thenList([function() {
return this.prop.src || this.error("Cannot duplicate - no source HTML.");
}, function() {
return this.prop.pageSize || this.setPageSize();
}]).then(function() {
var t5 = { position: "relative", display: "inline-block", width: ("number" != typeof this.opt.width || isNaN(this.opt.width) || "number" != typeof this.opt.windowWidth || isNaN(this.opt.windowWidth) ? Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) : this.opt.windowWidth) + "px", left: 0, right: 0, top: 0, margin: "auto", backgroundColor: this.opt.backgroundColor }, e8 = function t6(e9, r3) {
for (var n2 = 3 === e9.nodeType ? document.createTextNode(e9.nodeValue) : e9.cloneNode(false), i3 = e9.firstChild; i3; i3 = i3.nextSibling)
true !== r3 && 1 === i3.nodeType && "SCRIPT" === i3.nodeName || n2.appendChild(t6(i3, r3));
return 1 === e9.nodeType && ("CANVAS" === e9.nodeName ? (n2.width = e9.width, n2.height = e9.height, n2.getContext("2d").drawImage(e9, 0, 0)) : "TEXTAREA" !== e9.nodeName && "SELECT" !== e9.nodeName || (n2.value = e9.value), n2.addEventListener("load", function() {
n2.scrollTop = e9.scrollTop, n2.scrollLeft = e9.scrollLeft;
}, true)), n2;
}(this.prop.src, this.opt.html2canvas.javascriptEnabled);
"BODY" === e8.tagName && (t5.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"), this.prop.overlay = o2("div", { className: "html2pdf__overlay", style: { position: "fixed", overflow: "hidden", zIndex: 1e3, left: "-100000px", right: 0, bottom: 0, top: 0 } }), this.prop.container = o2("div", { className: "html2pdf__container", style: t5 }), this.prop.container.appendChild(e8), this.prop.container.firstChild.appendChild(o2("div", { style: { clear: "both", border: "0 none transparent", margin: 0, padding: 0, height: 0 } })), this.prop.container.style.float = "none", this.prop.overlay.appendChild(this.prop.container), document.body.appendChild(this.prop.overlay), this.prop.container.firstChild.style.position = "relative", this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + "px";
});
}, s2.prototype.toCanvas = function() {
var t5 = [function() {
return document.body.contains(this.prop.container) || this.toContainer();
}];
return this.thenList(t5).then(r2).then(function(t6) {
var e8 = Object.assign({}, this.opt.html2canvas);
return delete e8.onrendered, t6(this.prop.container, e8);
}).then(function(t6) {
(this.opt.html2canvas.onrendered || function() {
})(t6), this.prop.canvas = t6, document.body.removeChild(this.prop.overlay);
});
}, s2.prototype.toContext2d = function() {
var t5 = [function() {
return document.body.contains(this.prop.container) || this.toContainer();
}];
return this.thenList(t5).then(r2).then(function(t6) {
var e8 = this.opt.jsPDF, r3 = this.opt.fontFaces, n2 = "number" != typeof this.opt.width || isNaN(this.opt.width) || "number" != typeof this.opt.windowWidth || isNaN(this.opt.windowWidth) ? 1 : this.opt.width / this.opt.windowWidth, i3 = Object.assign({ async: true, allowTaint: true, scale: n2, scrollX: this.opt.scrollX || 0, scrollY: this.opt.scrollY || 0, backgroundColor: "#ffffff", imageTimeout: 15e3, logging: true, proxy: null, removeContainer: true, foreignObjectRendering: false, useCORS: false }, this.opt.html2canvas);
if (delete i3.onrendered, e8.context2d.autoPaging = void 0 === this.opt.autoPaging || this.opt.autoPaging, e8.context2d.posX = this.opt.x, e8.context2d.posY = this.opt.y, e8.context2d.margin = this.opt.margin, e8.context2d.fontFaces = r3, r3)
for (var a3 = 0; a3 < r3.length; ++a3) {
var o3 = r3[a3], s3 = o3.src.find(function(t7) {
return "truetype" === t7.format;
});
s3 && e8.addFont(s3.url, o3.ref.name, o3.ref.style);
}
return i3.windowHeight = i3.windowHeight || 0, i3.windowHeight = 0 == i3.windowHeight ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : i3.windowHeight, e8.context2d.save(true), t6(this.prop.container, i3);
}).then(function(t6) {
this.opt.jsPDF.context2d.restore(true), (this.opt.html2canvas.onrendered || function() {
})(t6), this.prop.canvas = t6, document.body.removeChild(this.prop.overlay);
});
}, s2.prototype.toImg = function() {
return this.thenList([function() {
return this.prop.canvas || this.toCanvas();
}]).then(function() {
var t5 = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
this.prop.img = document.createElement("img"), this.prop.img.src = t5;
});
}, s2.prototype.toPdf = function() {
return this.thenList([function() {
return this.toContext2d();
}]).then(function() {
this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
});
}, s2.prototype.output = function(t5, e8, r3) {
return "img" === (r3 = r3 || "pdf").toLowerCase() || "image" === r3.toLowerCase() ? this.outputImg(t5, e8) : this.outputPdf(t5, e8);
}, s2.prototype.outputPdf = function(t5, e8) {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).then(function() {
return this.prop.pdf.output(t5, e8);
});
}, s2.prototype.outputImg = function(t5) {
return this.thenList([function() {
return this.prop.img || this.toImg();
}]).then(function() {
switch (t5) {
case void 0:
case "img":
return this.prop.img;
case "datauristring":
case "dataurlstring":
return this.prop.img.src;
case "datauri":
case "dataurl":
return document.location.href = this.prop.img.src;
default:
throw 'Image output type "' + t5 + '" is not supported.';
}
});
}, s2.prototype.save = function(t5) {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).set(t5 ? { filename: t5 } : null).then(function() {
this.prop.pdf.save(this.opt.filename);
});
}, s2.prototype.doCallback = function() {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).then(function() {
this.prop.callback(this.prop.pdf);
});
}, s2.prototype.set = function(t5) {
if ("object" !== a2(t5))
return this;
var e8 = Object.keys(t5 || {}).map(function(e9) {
if (e9 in s2.template.prop)
return function() {
this.prop[e9] = t5[e9];
};
switch (e9) {
case "margin":
return this.setMargin.bind(this, t5.margin);
case "jsPDF":
return function() {
return this.opt.jsPDF = t5.jsPDF, this.setPageSize();
};
case "pageSize":
return this.setPageSize.bind(this, t5.pageSize);
default:
return function() {
this.opt[e9] = t5[e9];
};
}
}, this);
return this.then(function() {
return this.thenList(e8);
});
}, s2.prototype.get = function(t5, e8) {
return this.then(function() {
var r3 = t5 in s2.template.prop ? this.prop[t5] : this.opt[t5];
return e8 ? e8(r3) : r3;
});
}, s2.prototype.setMargin = function(t5) {
return this.then(function() {
switch (a2(t5)) {
case "number":
t5 = [t5, t5, t5, t5];
case "array":
if (2 === t5.length && (t5 = [t5[0], t5[1], t5[0], t5[1]]), 4 === t5.length)
break;
default:
return this.error("Invalid margin array.");
}
this.opt.margin = t5;
}).then(this.setPageSize);
}, s2.prototype.setPageSize = function(t5) {
function e8(t6, e9) {
return Math.floor(t6 * e9 / 72 * 96);
}
return this.then(function() {
(t5 = t5 || E$2.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (t5.inner = { width: t5.width - this.opt.margin[1] - this.opt.margin[3], height: t5.height - this.opt.margin[0] - this.opt.margin[2] }, t5.inner.px = { width: e8(t5.inner.width, t5.k), height: e8(t5.inner.height, t5.k) }, t5.inner.ratio = t5.inner.height / t5.inner.width), this.prop.pageSize = t5;
});
}, s2.prototype.setProgress = function(t5, e8, r3, n2) {
return null != t5 && (this.progress.val = t5), null != e8 && (this.progress.state = e8), null != r3 && (this.progress.n = r3), null != n2 && (this.progress.stack = n2), this.progress.ratio = this.progress.val / this.progress.state, this;
}, s2.prototype.updateProgress = function(t5, e8, r3, n2) {
return this.setProgress(t5 ? this.progress.val + t5 : null, e8 || null, r3 ? this.progress.n + r3 : null, n2 ? this.progress.stack.concat(n2) : null);
}, s2.prototype.then = function(t5, e8) {
var r3 = this;
return this.thenCore(t5, e8, function(t6, e9) {
return r3.updateProgress(null, null, 1, [t6]), Promise.prototype.then.call(this, function(e11) {
return r3.updateProgress(null, t6), e11;
}).then(t6, e9).then(function(t7) {
return r3.updateProgress(1), t7;
});
});
}, s2.prototype.thenCore = function(t5, e8, r3) {
r3 = r3 || Promise.prototype.then;
t5 && (t5 = t5.bind(this)), e8 && (e8 = e8.bind(this));
var n2 = -1 !== Promise.toString().indexOf("[native code]") && "Promise" === Promise.name ? this : s2.convert(Object.assign({}, this), Promise.prototype), i3 = r3.call(n2, t5, e8);
return s2.convert(i3, this.__proto__);
}, s2.prototype.thenExternal = function(t5, e8) {
return Promise.prototype.then.call(this, t5, e8);
}, s2.prototype.thenList = function(t5) {
var e8 = this;
return t5.forEach(function(t6) {
e8 = e8.thenCore(t6);
}), e8;
}, s2.prototype.catch = function(t5) {
t5 && (t5 = t5.bind(this));
var e8 = Promise.prototype.catch.call(this, t5);
return s2.convert(e8, this);
}, s2.prototype.catchExternal = function(t5) {
return Promise.prototype.catch.call(this, t5);
}, s2.prototype.error = function(t5) {
return this.then(function() {
throw new Error(t5);
});
}, s2.prototype.using = s2.prototype.set, s2.prototype.saveAs = s2.prototype.save, s2.prototype.export = s2.prototype.output, s2.prototype.run = s2.prototype.then, E$2.getPageSize = function(e8, r3, n2) {
if ("object" === _typeof$3(e8)) {
var i3 = e8;
e8 = i3.orientation, r3 = i3.unit || r3, n2 = i3.format || n2;
}
r3 = r3 || "mm", n2 = n2 || "a4", e8 = ("" + (e8 || "P")).toLowerCase();
var a3, o3 = ("" + n2).toLowerCase(), s3 = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
switch (r3) {
case "pt":
a3 = 1;
break;
case "mm":
a3 = 72 / 25.4;
break;
case "cm":
a3 = 72 / 2.54;
break;
case "in":
a3 = 72;
break;
case "px":
a3 = 0.75;
break;
case "pc":
case "em":
a3 = 12;
break;
case "ex":
a3 = 6;
break;
default:
throw "Invalid unit: " + r3;
}
var c2, u2 = 0, h2 = 0;
if (s3.hasOwnProperty(o3))
u2 = s3[o3][1] / a3, h2 = s3[o3][0] / a3;
else
try {
u2 = n2[1], h2 = n2[0];
} catch (t5) {
throw new Error("Invalid format: " + n2);
}
if ("p" === e8 || "portrait" === e8)
e8 = "p", h2 > u2 && (c2 = h2, h2 = u2, u2 = c2);
else {
if ("l" !== e8 && "landscape" !== e8)
throw "Invalid orientation: " + e8;
e8 = "l", u2 > h2 && (c2 = h2, h2 = u2, u2 = c2);
}
return { width: h2, height: u2, unit: r3, k: a3, orientation: e8 };
}, e7.html = function(t5, e8) {
(e8 = e8 || {}).callback = e8.callback || function() {
}, e8.html2canvas = e8.html2canvas || {}, e8.html2canvas.canvas = e8.html2canvas.canvas || this.canvas, e8.jsPDF = e8.jsPDF || this, e8.fontFaces = e8.fontFaces ? e8.fontFaces.map(jt$1) : null;
var r3 = new s2(e8);
return e8.worker ? r3 : r3.from(t5).doCallback();
};
}(E$2.API), E$2.API.addJS = function(t5) {
return Ht$1 = t5, this.internal.events.subscribe("postPutResources", function() {
Ut$1 = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) " + (Ut$1 + 1) + " 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), zt$1 = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS (" + Ht$1 + ")"), this.internal.out(">>"), this.internal.out("endobj");
}), this.internal.events.subscribe("putCatalog", function() {
void 0 !== Ut$1 && void 0 !== zt$1 && this.internal.out("/Names <</JavaScript " + Ut$1 + " 0 R>>");
}), this;
}, /**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7;
t5.events.push(["postPutResources", function() {
var t6 = this, r2 = /^(\d+) 0 obj$/;
if (this.outline.root.children.length > 0)
for (var n2 = t6.outline.render().split(/\r\n/), i2 = 0; i2 < n2.length; i2++) {
var a2 = n2[i2], o2 = r2.exec(a2);
if (null != o2) {
var s2 = o2[1];
t6.internal.newObjectDeferredBegin(s2, false);
}
t6.internal.write(a2);
}
if (this.outline.createNamedDestinations) {
var c2 = this.internal.pages.length, u2 = [];
for (i2 = 0; i2 < c2; i2++) {
var h2 = t6.internal.newObject();
u2.push(h2);
var l2 = t6.internal.getPageInfo(i2 + 1);
t6.internal.write("<< /D[" + l2.objId + " 0 R /XYZ null null null]>> endobj");
}
var f2 = t6.internal.newObject();
t6.internal.write("<< /Names [ ");
for (i2 = 0; i2 < u2.length; i2++)
t6.internal.write("(page_" + (i2 + 1) + ")" + u2[i2] + " 0 R");
t6.internal.write(" ] >>", "endobj"), e7 = t6.internal.newObject(), t6.internal.write("<< /Dests " + f2 + " 0 R"), t6.internal.write(">>", "endobj");
}
}]), t5.events.push(["putCatalog", function() {
this.outline.root.children.length > 0 && (this.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && this.internal.write("/Names " + e7 + " 0 R"));
}]), t5.events.push(["initialized", function() {
var t6 = this;
t6.outline = { createNamedDestinations: false, root: { children: [] } }, t6.outline.add = function(t7, e8, r2) {
var n2 = { title: e8, options: r2, children: [] };
return null == t7 && (t7 = this.root), t7.children.push(n2), n2;
}, t6.outline.render = function() {
return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = t6, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val;
}, t6.outline.genIds_r = function(e8) {
e8.id = t6.internal.newObjectDeferred();
for (var r2 = 0; r2 < e8.children.length; r2++)
this.genIds_r(e8.children[r2]);
}, t6.outline.renderRoot = function(t7) {
this.objStart(t7), this.line("/Type /Outlines"), t7.children.length > 0 && (this.line("/First " + this.makeRef(t7.children[0])), this.line("/Last " + this.makeRef(t7.children[t7.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, t7)), this.objEnd();
}, t6.outline.renderItems = function(e8) {
for (var r2 = this.ctx.pdf.internal.getVerticalCoordinateString, n2 = 0; n2 < e8.children.length; n2++) {
var i2 = e8.children[n2];
this.objStart(i2), this.line("/Title " + this.makeString(i2.title)), this.line("/Parent " + this.makeRef(e8)), n2 > 0 && this.line("/Prev " + this.makeRef(e8.children[n2 - 1])), n2 < e8.children.length - 1 && this.line("/Next " + this.makeRef(e8.children[n2 + 1])), i2.children.length > 0 && (this.line("/First " + this.makeRef(i2.children[0])), this.line("/Last " + this.makeRef(i2.children[i2.children.length - 1])));
var a2 = this.count = this.count_r({ count: 0 }, i2);
if (a2 > 0 && this.line("/Count " + a2), i2.options && i2.options.pageNumber) {
var o2 = t6.internal.getPageInfo(i2.options.pageNumber);
this.line("/Dest [" + o2.objId + " 0 R /XYZ 0 " + r2(0) + " 0]");
}
this.objEnd();
}
for (var s2 = 0; s2 < e8.children.length; s2++)
this.renderItems(e8.children[s2]);
}, t6.outline.line = function(t7) {
this.ctx.val += t7 + "\r\n";
}, t6.outline.makeRef = function(t7) {
return t7.id + " 0 R";
}, t6.outline.makeString = function(e8) {
return "(" + t6.internal.pdfEscape(e8) + ")";
}, t6.outline.objStart = function(t7) {
this.ctx.val += "\r\n" + t7.id + " 0 obj\r\n<<\r\n";
}, t6.outline.objEnd = function() {
this.ctx.val += ">> \r\nendobj\r\n";
}, t6.outline.count_r = function(t7, e8) {
for (var r2 = 0; r2 < e8.children.length; r2++)
t7.count++, this.count_r(t7, e8.children[r2]);
return t7.count;
};
}]);
}(E$2.API), /**
* @license
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7 = [192, 193, 194, 195, 196, 197, 198, 199];
t5.processJPEG = function(t6, r2, n2, i2, a2, o2) {
var s2, c2 = this.decode.DCT_DECODE, u2 = null;
if ("string" == typeof t6 || this.__addimage__.isArrayBuffer(t6) || this.__addimage__.isArrayBufferView(t6)) {
switch (t6 = a2 || t6, t6 = this.__addimage__.isArrayBuffer(t6) ? new Uint8Array(t6) : t6, (s2 = function(t7) {
for (var r3, n3 = 256 * t7.charCodeAt(4) + t7.charCodeAt(5), i3 = t7.length, a3 = { width: 0, height: 0, numcomponents: 1 }, o3 = 4; o3 < i3; o3 += 2) {
if (o3 += n3, -1 !== e7.indexOf(t7.charCodeAt(o3 + 1))) {
r3 = 256 * t7.charCodeAt(o3 + 5) + t7.charCodeAt(o3 + 6), a3 = { width: 256 * t7.charCodeAt(o3 + 7) + t7.charCodeAt(o3 + 8), height: r3, numcomponents: t7.charCodeAt(o3 + 9) };
break;
}
n3 = 256 * t7.charCodeAt(o3 + 2) + t7.charCodeAt(o3 + 3);
}
return a3;
}(t6 = this.__addimage__.isArrayBufferView(t6) ? this.__addimage__.arrayBufferToBinaryString(t6) : t6)).numcomponents) {
case 1:
o2 = this.color_spaces.DEVICE_GRAY;
break;
case 4:
o2 = this.color_spaces.DEVICE_CMYK;
break;
case 3:
o2 = this.color_spaces.DEVICE_RGB;
}
u2 = { data: t6, width: s2.width, height: s2.height, colorSpace: o2, bitsPerComponent: 8, filter: c2, index: r2, alias: n2 };
}
return u2;
};
}(E$2.API);
var Vt$1, Gt$1, Yt$1, Jt$1, Xt$1, Kt$1 = function() {
var t5, e7, i2;
function a2(t6) {
var e8, r2, n2, i3, a3, o3, s2, c2, u2, h2, l2, f2, d2, p2;
for (this.data = t6, this.pos = 8, this.palette = [], this.imgData = [], this.transparency = {}, this.animation = null, this.text = {}, o3 = null; ; ) {
switch (e8 = this.readUInt32(), u2 = (function() {
var t7, e9;
for (e9 = [], t7 = 0; t7 < 4; ++t7)
e9.push(String.fromCharCode(this.data[this.pos++]));
return e9;
}).call(this).join("")) {
case "IHDR":
this.width = this.readUInt32(), this.height = this.readUInt32(), this.bits = this.data[this.pos++], this.colorType = this.data[this.pos++], this.compressionMethod = this.data[this.pos++], this.filterMethod = this.data[this.pos++], this.interlaceMethod = this.data[this.pos++];
break;
case "acTL":
this.animation = { numFrames: this.readUInt32(), numPlays: this.readUInt32() || 1 / 0, frames: [] };
break;
case "PLTE":
this.palette = this.read(e8);
break;
case "fcTL":
o3 && this.animation.frames.push(o3), this.pos += 4, o3 = { width: this.readUInt32(), height: this.readUInt32(), xOffset: this.readUInt32(), yOffset: this.readUInt32() }, a3 = this.readUInt16(), i3 = this.readUInt16() || 100, o3.delay = 1e3 * a3 / i3, o3.disposeOp = this.data[this.pos++], o3.blendOp = this.data[this.pos++], o3.data = [];
break;
case "IDAT":
case "fdAT":
for ("fdAT" === u2 && (this.pos += 4, e8 -= 4), t6 = (null != o3 ? o3.data : void 0) || this.imgData, f2 = 0; 0 <= e8 ? f2 < e8 : f2 > e8; 0 <= e8 ? ++f2 : --f2)
t6.push(this.data[this.pos++]);
break;
case "tRNS":
switch (this.transparency = {}, this.colorType) {
case 3:
if (n2 = this.palette.length / 3, this.transparency.indexed = this.read(e8), this.transparency.indexed.length > n2)
throw new Error("More transparent colors than palette size");
if ((h2 = n2 - this.transparency.indexed.length) > 0)
for (d2 = 0; 0 <= h2 ? d2 < h2 : d2 > h2; 0 <= h2 ? ++d2 : --d2)
this.transparency.indexed.push(255);
break;
case 0:
this.transparency.grayscale = this.read(e8)[0];
break;
case 2:
this.transparency.rgb = this.read(e8);
}
break;
case "tEXt":
s2 = (l2 = this.read(e8)).indexOf(0), c2 = String.fromCharCode.apply(String, l2.slice(0, s2)), this.text[c2] = String.fromCharCode.apply(String, l2.slice(s2 + 1));
break;
case "IEND":
return o3 && this.animation.frames.push(o3), this.colors = (function() {
switch (this.colorType) {
case 0:
case 3:
case 4:
return 1;
case 2:
case 6:
return 3;
}
}).call(this), this.hasAlphaChannel = 4 === (p2 = this.colorType) || 6 === p2, r2 = this.colors + (this.hasAlphaChannel ? 1 : 0), this.pixelBitlength = this.bits * r2, this.colorSpace = (function() {
switch (this.colors) {
case 1:
return "DeviceGray";
case 3:
return "DeviceRGB";
}
}).call(this), void (this.imgData = new Uint8Array(this.imgData));
default:
this.pos += e8;
}
if (this.pos += 4, this.pos > this.data.length)
throw new Error("Incomplete or corrupt PNG file");
}
}
a2.prototype.read = function(t6) {
var e8, r2;
for (r2 = [], e8 = 0; 0 <= t6 ? e8 < t6 : e8 > t6; 0 <= t6 ? ++e8 : --e8)
r2.push(this.data[this.pos++]);
return r2;
}, a2.prototype.readUInt32 = function() {
return this.data[this.pos++] << 24 | this.data[this.pos++] << 16 | this.data[this.pos++] << 8 | this.data[this.pos++];
}, a2.prototype.readUInt16 = function() {
return this.data[this.pos++] << 8 | this.data[this.pos++];
}, a2.prototype.decodePixels = function(t6) {
var e8 = this.pixelBitlength / 8, n2 = new Uint8Array(this.width * this.height * e8), i3 = 0, a3 = this;
if (null == t6 && (t6 = this.imgData), 0 === t6.length)
return new Uint8Array(0);
function o3(r2, o4, s2, c2) {
var u2, h2, l2, f2, d2, p2, g2, m2, v2, b2, y2, w2, N2, L2, A5, x2, S2, _24, P2, k2, I2, F2 = Math.ceil((a3.width - r2) / s2), C3 = Math.ceil((a3.height - o4) / c2), j2 = a3.width == F2 && a3.height == C3;
for (L2 = e8 * F2, w2 = j2 ? n2 : new Uint8Array(L2 * C3), p2 = t6.length, N2 = 0, h2 = 0; N2 < C3 && i3 < p2; ) {
switch (t6[i3++]) {
case 0:
for (f2 = S2 = 0; S2 < L2; f2 = S2 += 1)
w2[h2++] = t6[i3++];
break;
case 1:
for (f2 = _24 = 0; _24 < L2; f2 = _24 += 1)
u2 = t6[i3++], d2 = f2 < e8 ? 0 : w2[h2 - e8], w2[h2++] = (u2 + d2) % 256;
break;
case 2:
for (f2 = P2 = 0; P2 < L2; f2 = P2 += 1)
u2 = t6[i3++], l2 = (f2 - f2 % e8) / e8, A5 = N2 && w2[(N2 - 1) * L2 + l2 * e8 + f2 % e8], w2[h2++] = (A5 + u2) % 256;
break;
case 3:
for (f2 = k2 = 0; k2 < L2; f2 = k2 += 1)
u2 = t6[i3++], l2 = (f2 - f2 % e8) / e8, d2 = f2 < e8 ? 0 : w2[h2 - e8], A5 = N2 && w2[(N2 - 1) * L2 + l2 * e8 + f2 % e8], w2[h2++] = (u2 + Math.floor((d2 + A5) / 2)) % 256;
break;
case 4:
for (f2 = I2 = 0; I2 < L2; f2 = I2 += 1)
u2 = t6[i3++], l2 = (f2 - f2 % e8) / e8, d2 = f2 < e8 ? 0 : w2[h2 - e8], 0 === N2 ? A5 = x2 = 0 : (A5 = w2[(N2 - 1) * L2 + l2 * e8 + f2 % e8], x2 = l2 && w2[(N2 - 1) * L2 + (l2 - 1) * e8 + f2 % e8]), g2 = d2 + A5 - x2, m2 = Math.abs(g2 - d2), b2 = Math.abs(g2 - A5), y2 = Math.abs(g2 - x2), v2 = m2 <= b2 && m2 <= y2 ? d2 : b2 <= y2 ? A5 : x2, w2[h2++] = (u2 + v2) % 256;
break;
default:
throw new Error("Invalid filter algorithm: " + t6[i3 - 1]);
}
if (!j2) {
var O2 = ((o4 + N2 * c2) * a3.width + r2) * e8, B3 = N2 * L2;
for (f2 = 0; f2 < F2; f2 += 1) {
for (var M2 = 0; M2 < e8; M2 += 1)
n2[O2++] = w2[B3++];
O2 += (s2 - 1) * e8;
}
}
N2++;
}
}
return t6 = unzlibSync(t6), 1 == a3.interlaceMethod ? (o3(0, 0, 8, 8), o3(4, 0, 8, 8), o3(0, 4, 4, 8), o3(2, 0, 4, 4), o3(0, 2, 2, 4), o3(1, 0, 2, 2), o3(0, 1, 1, 2)) : o3(0, 0, 1, 1), n2;
}, a2.prototype.decodePalette = function() {
var t6, e8, r2, n2, i3, a3, o3, s2, c2;
for (r2 = this.palette, a3 = this.transparency.indexed || [], i3 = new Uint8Array((a3.length || 0) + r2.length), n2 = 0, t6 = 0, e8 = o3 = 0, s2 = r2.length; o3 < s2; e8 = o3 += 3)
i3[n2++] = r2[e8], i3[n2++] = r2[e8 + 1], i3[n2++] = r2[e8 + 2], i3[n2++] = null != (c2 = a3[t6++]) ? c2 : 255;
return i3;
}, a2.prototype.copyToImageData = function(t6, e8) {
var r2, n2, i3, a3, o3, s2, c2, u2, h2, l2, f2;
if (n2 = this.colors, h2 = null, r2 = this.hasAlphaChannel, this.palette.length && (h2 = null != (f2 = this._decodedPalette) ? f2 : this._decodedPalette = this.decodePalette(), n2 = 4, r2 = true), u2 = (i3 = t6.data || t6).length, o3 = h2 || e8, a3 = s2 = 0, 1 === n2)
for (; a3 < u2; )
c2 = h2 ? 4 * e8[a3 / 4] : s2, l2 = o3[c2++], i3[a3++] = l2, i3[a3++] = l2, i3[a3++] = l2, i3[a3++] = r2 ? o3[c2++] : 255, s2 = c2;
else
for (; a3 < u2; )
c2 = h2 ? 4 * e8[a3 / 4] : s2, i3[a3++] = o3[c2++], i3[a3++] = o3[c2++], i3[a3++] = o3[c2++], i3[a3++] = r2 ? o3[c2++] : 255, s2 = c2;
}, a2.prototype.decode = function() {
var t6;
return t6 = new Uint8Array(this.width * this.height * 4), this.copyToImageData(t6, this.decodePixels()), t6;
};
var o2 = function() {
if ("[object Window]" === Object.prototype.toString.call(n$8)) {
try {
e7 = n$8.document.createElement("canvas"), i2 = e7.getContext("2d");
} catch (t6) {
return false;
}
return true;
}
return false;
};
return o2(), t5 = function(t6) {
var r2;
if (true === o2())
return i2.width = t6.width, i2.height = t6.height, i2.clearRect(0, 0, t6.width, t6.height), i2.putImageData(t6, 0, 0), (r2 = new Image()).src = e7.toDataURL(), r2;
throw new Error("This method requires a Browser with Canvas-capability.");
}, a2.prototype.decodeFrames = function(e8) {
var r2, n2, i3, a3, o3, s2, c2, u2;
if (this.animation) {
for (u2 = [], n2 = o3 = 0, s2 = (c2 = this.animation.frames).length; o3 < s2; n2 = ++o3)
r2 = c2[n2], i3 = e8.createImageData(r2.width, r2.height), a3 = this.decodePixels(new Uint8Array(r2.data)), this.copyToImageData(i3, a3), r2.imageData = i3, u2.push(r2.image = t5(i3));
return u2;
}
}, a2.prototype.renderFrame = function(t6, e8) {
var r2, n2, i3;
return r2 = (n2 = this.animation.frames)[e8], i3 = n2[e8 - 1], 0 === e8 && t6.clearRect(0, 0, this.width, this.height), 1 === (null != i3 ? i3.disposeOp : void 0) ? t6.clearRect(i3.xOffset, i3.yOffset, i3.width, i3.height) : 2 === (null != i3 ? i3.disposeOp : void 0) && t6.putImageData(i3.imageData, i3.xOffset, i3.yOffset), 0 === r2.blendOp && t6.clearRect(r2.xOffset, r2.yOffset, r2.width, r2.height), t6.drawImage(r2.image, r2.xOffset, r2.yOffset);
}, a2.prototype.animate = function(t6) {
var e8, r2, n2, i3, a3, o3, s2 = this;
return r2 = 0, o3 = this.animation, i3 = o3.numFrames, n2 = o3.frames, a3 = o3.numPlays, (e8 = function() {
var o4, c2;
if (o4 = r2++ % i3, c2 = n2[o4], s2.renderFrame(t6, o4), i3 > 1 && r2 / i3 < a3)
return s2.animation._timeout = setTimeout(e8, c2.delay);
})();
}, a2.prototype.stopAnimation = function() {
var t6;
return clearTimeout(null != (t6 = this.animation) ? t6._timeout : void 0);
}, a2.prototype.render = function(t6) {
var e8, r2;
return t6._png && t6._png.stopAnimation(), t6._png = this, t6.width = this.width, t6.height = this.height, e8 = t6.getContext("2d"), this.animation ? (this.decodeFrames(e8), this.animate(e8)) : (r2 = e8.createImageData(this.width, this.height), this.copyToImageData(r2, this.decodePixels()), e8.putImageData(r2, 0, 0));
}, a2;
}();
/**
* @license
*
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
/**
* @license
* (c) Dean McNamee <dean@gmail.com>, 2013.
*
* https://github.com/deanm/omggif
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
* including animation and compression. It does not rely on any specific
* underlying system, so should run in the browser, Node, or Plask.
*/
function Zt$1(t5) {
var e7 = 0;
if (71 !== t5[e7++] || 73 !== t5[e7++] || 70 !== t5[e7++] || 56 !== t5[e7++] || 56 != (t5[e7++] + 1 & 253) || 97 !== t5[e7++])
throw new Error("Invalid GIF 87a/89a header.");
var r2 = t5[e7++] | t5[e7++] << 8, n2 = t5[e7++] | t5[e7++] << 8, i2 = t5[e7++], a2 = i2 >> 7, o2 = 1 << (7 & i2) + 1;
t5[e7++];
t5[e7++];
var s2 = null, c2 = null;
a2 && (s2 = e7, c2 = o2, e7 += 3 * o2);
var u2 = true, h2 = [], l2 = 0, f2 = null, d2 = 0, p2 = null;
for (this.width = r2, this.height = n2; u2 && e7 < t5.length; )
switch (t5[e7++]) {
case 33:
switch (t5[e7++]) {
case 255:
if (11 !== t5[e7] || 78 == t5[e7 + 1] && 69 == t5[e7 + 2] && 84 == t5[e7 + 3] && 83 == t5[e7 + 4] && 67 == t5[e7 + 5] && 65 == t5[e7 + 6] && 80 == t5[e7 + 7] && 69 == t5[e7 + 8] && 50 == t5[e7 + 9] && 46 == t5[e7 + 10] && 48 == t5[e7 + 11] && 3 == t5[e7 + 12] && 1 == t5[e7 + 13] && 0 == t5[e7 + 16])
e7 += 14, p2 = t5[e7++] | t5[e7++] << 8, e7++;
else
for (e7 += 12; ; ) {
if (!((P2 = t5[e7++]) >= 0))
throw Error("Invalid block size");
if (0 === P2)
break;
e7 += P2;
}
break;
case 249:
if (4 !== t5[e7++] || 0 !== t5[e7 + 4])
throw new Error("Invalid graphics extension block.");
var g2 = t5[e7++];
l2 = t5[e7++] | t5[e7++] << 8, f2 = t5[e7++], 0 == (1 & g2) && (f2 = null), d2 = g2 >> 2 & 7, e7++;
break;
case 254:
for (; ; ) {
if (!((P2 = t5[e7++]) >= 0))
throw Error("Invalid block size");
if (0 === P2)
break;
e7 += P2;
}
break;
default:
throw new Error("Unknown graphic control label: 0x" + t5[e7 - 1].toString(16));
}
break;
case 44:
var m2 = t5[e7++] | t5[e7++] << 8, v2 = t5[e7++] | t5[e7++] << 8, b2 = t5[e7++] | t5[e7++] << 8, y2 = t5[e7++] | t5[e7++] << 8, w2 = t5[e7++], N2 = w2 >> 6 & 1, L2 = 1 << (7 & w2) + 1, A5 = s2, x2 = c2, S2 = false;
if (w2 >> 7) {
S2 = true;
A5 = e7, x2 = L2, e7 += 3 * L2;
}
var _24 = e7;
for (e7++; ; ) {
var P2;
if (!((P2 = t5[e7++]) >= 0))
throw Error("Invalid block size");
if (0 === P2)
break;
e7 += P2;
}
h2.push({ x: m2, y: v2, width: b2, height: y2, has_local_palette: S2, palette_offset: A5, palette_size: x2, data_offset: _24, data_length: e7 - _24, transparent_index: f2, interlaced: !!N2, delay: l2, disposal: d2 });
break;
case 59:
u2 = false;
break;
default:
throw new Error("Unknown gif block: 0x" + t5[e7 - 1].toString(16));
}
this.numFrames = function() {
return h2.length;
}, this.loopCount = function() {
return p2;
}, this.frameInfo = function(t6) {
if (t6 < 0 || t6 >= h2.length)
throw new Error("Frame index out of range.");
return h2[t6];
}, this.decodeAndBlitFrameBGRA = function(e8, n3) {
var i3 = this.frameInfo(e8), a3 = i3.width * i3.height, o3 = new Uint8Array(a3);
$t$1(t5, i3.data_offset, o3, a3);
var s3 = i3.palette_offset, c3 = i3.transparent_index;
null === c3 && (c3 = 256);
var u3 = i3.width, h3 = r2 - u3, l3 = u3, f3 = 4 * (i3.y * r2 + i3.x), d3 = 4 * ((i3.y + i3.height) * r2 + i3.x), p3 = f3, g3 = 4 * h3;
true === i3.interlaced && (g3 += 4 * r2 * 7);
for (var m3 = 8, v3 = 0, b3 = o3.length; v3 < b3; ++v3) {
var y3 = o3[v3];
if (0 === l3 && (l3 = u3, (p3 += g3) >= d3 && (g3 = 4 * h3 + 4 * r2 * (m3 - 1), p3 = f3 + (u3 + h3) * (m3 << 1), m3 >>= 1)), y3 === c3)
p3 += 4;
else {
var w3 = t5[s3 + 3 * y3], N3 = t5[s3 + 3 * y3 + 1], L3 = t5[s3 + 3 * y3 + 2];
n3[p3++] = L3, n3[p3++] = N3, n3[p3++] = w3, n3[p3++] = 255;
}
--l3;
}
}, this.decodeAndBlitFrameRGBA = function(e8, n3) {
var i3 = this.frameInfo(e8), a3 = i3.width * i3.height, o3 = new Uint8Array(a3);
$t$1(t5, i3.data_offset, o3, a3);
var s3 = i3.palette_offset, c3 = i3.transparent_index;
null === c3 && (c3 = 256);
var u3 = i3.width, h3 = r2 - u3, l3 = u3, f3 = 4 * (i3.y * r2 + i3.x), d3 = 4 * ((i3.y + i3.height) * r2 + i3.x), p3 = f3, g3 = 4 * h3;
true === i3.interlaced && (g3 += 4 * r2 * 7);
for (var m3 = 8, v3 = 0, b3 = o3.length; v3 < b3; ++v3) {
var y3 = o3[v3];
if (0 === l3 && (l3 = u3, (p3 += g3) >= d3 && (g3 = 4 * h3 + 4 * r2 * (m3 - 1), p3 = f3 + (u3 + h3) * (m3 << 1), m3 >>= 1)), y3 === c3)
p3 += 4;
else {
var w3 = t5[s3 + 3 * y3], N3 = t5[s3 + 3 * y3 + 1], L3 = t5[s3 + 3 * y3 + 2];
n3[p3++] = w3, n3[p3++] = N3, n3[p3++] = L3, n3[p3++] = 255;
}
--l3;
}
};
}
function $t$1(t5, e7, r2, n2) {
for (var i2 = t5[e7++], o2 = 1 << i2, s2 = o2 + 1, c2 = s2 + 1, u2 = i2 + 1, h2 = (1 << u2) - 1, l2 = 0, f2 = 0, d2 = 0, p2 = t5[e7++], g2 = new Int32Array(4096), m2 = null; ; ) {
for (; l2 < 16 && 0 !== p2; )
f2 |= t5[e7++] << l2, l2 += 8, 1 === p2 ? p2 = t5[e7++] : --p2;
if (l2 < u2)
break;
var v2 = f2 & h2;
if (f2 >>= u2, l2 -= u2, v2 !== o2) {
if (v2 === s2)
break;
for (var b2 = v2 < c2 ? v2 : m2, y2 = 0, w2 = b2; w2 > o2; )
w2 = g2[w2] >> 8, ++y2;
var N2 = w2;
if (d2 + y2 + (b2 !== v2 ? 1 : 0) > n2)
return void a$m.log("Warning, gif stream longer than expected.");
r2[d2++] = N2;
var L2 = d2 += y2;
for (b2 !== v2 && (r2[d2++] = N2), w2 = b2; y2--; )
w2 = g2[w2], r2[--L2] = 255 & w2, w2 >>= 8;
null !== m2 && c2 < 4096 && (g2[c2++] = m2 << 8 | N2, c2 >= h2 + 1 && u2 < 12 && (++u2, h2 = h2 << 1 | 1)), m2 = v2;
} else
c2 = s2 + 1, h2 = (1 << (u2 = i2 + 1)) - 1, m2 = null;
}
return d2 !== n2 && a$m.log("Warning, gif stream shorter than expected."), r2;
}
/**
* @license
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Qt$1(t5) {
var e7, r2, n2, i2, a2, o2 = Math.floor, s2 = new Array(64), c2 = new Array(64), u2 = new Array(64), h2 = new Array(64), l2 = new Array(65535), f2 = new Array(65535), d2 = new Array(64), p2 = new Array(64), g2 = [], m2 = 0, v2 = 7, b2 = new Array(64), y2 = new Array(64), w2 = new Array(64), N2 = new Array(256), L2 = new Array(2048), A5 = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], x2 = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], S2 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], _24 = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], P2 = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], k2 = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], I2 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], F2 = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], C3 = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
function j2(t6, e8) {
for (var r3 = 0, n3 = 0, i3 = new Array(), a3 = 1; a3 <= 16; a3++) {
for (var o3 = 1; o3 <= t6[a3]; o3++)
i3[e8[n3]] = [], i3[e8[n3]][0] = r3, i3[e8[n3]][1] = a3, n3++, r3++;
r3 *= 2;
}
return i3;
}
function O2(t6) {
for (var e8 = t6[0], r3 = t6[1] - 1; r3 >= 0; )
e8 & 1 << r3 && (m2 |= 1 << v2), r3--, --v2 < 0 && (255 == m2 ? (B3(255), B3(0)) : B3(m2), v2 = 7, m2 = 0);
}
function B3(t6) {
g2.push(t6);
}
function M2(t6) {
B3(t6 >> 8 & 255), B3(255 & t6);
}
function E2(t6, e8, r3, n3, i3) {
for (var a3, o3 = i3[0], s3 = i3[240], c3 = function(t7, e9) {
var r4, n4, i4, a4, o4, s4, c4, u4, h4, l3, f3 = 0;
for (h4 = 0; h4 < 8; ++h4) {
r4 = t7[f3], n4 = t7[f3 + 1], i4 = t7[f3 + 2], a4 = t7[f3 + 3], o4 = t7[f3 + 4], s4 = t7[f3 + 5], c4 = t7[f3 + 6];
var p3 = r4 + (u4 = t7[f3 + 7]), g4 = r4 - u4, m4 = n4 + c4, v5 = n4 - c4, b4 = i4 + s4, y4 = i4 - s4, w4 = a4 + o4, N3 = a4 - o4, L3 = p3 + w4, A6 = p3 - w4, x3 = m4 + b4, S3 = m4 - b4;
t7[f3] = L3 + x3, t7[f3 + 4] = L3 - x3;
var _25 = 0.707106781 * (S3 + A6);
t7[f3 + 2] = A6 + _25, t7[f3 + 6] = A6 - _25;
var P3 = 0.382683433 * ((L3 = N3 + y4) - (S3 = v5 + g4)), k3 = 0.5411961 * L3 + P3, I3 = 1.306562965 * S3 + P3, F3 = 0.707106781 * (x3 = y4 + v5), C4 = g4 + F3, j3 = g4 - F3;
t7[f3 + 5] = j3 + k3, t7[f3 + 3] = j3 - k3, t7[f3 + 1] = C4 + I3, t7[f3 + 7] = C4 - I3, f3 += 8;
}
for (f3 = 0, h4 = 0; h4 < 8; ++h4) {
r4 = t7[f3], n4 = t7[f3 + 8], i4 = t7[f3 + 16], a4 = t7[f3 + 24], o4 = t7[f3 + 32], s4 = t7[f3 + 40], c4 = t7[f3 + 48];
var O3 = r4 + (u4 = t7[f3 + 56]), B4 = r4 - u4, M3 = n4 + c4, E3 = n4 - c4, q3 = i4 + s4, D2 = i4 - s4, R2 = a4 + o4, T2 = a4 - o4, U2 = O3 + R2, z2 = O3 - R2, H4 = M3 + q3, W2 = M3 - q3;
t7[f3] = U2 + H4, t7[f3 + 32] = U2 - H4;
var V2 = 0.707106781 * (W2 + z2);
t7[f3 + 16] = z2 + V2, t7[f3 + 48] = z2 - V2;
var G2 = 0.382683433 * ((U2 = T2 + D2) - (W2 = E3 + B4)), Y3 = 0.5411961 * U2 + G2, J2 = 1.306562965 * W2 + G2, X3 = 0.707106781 * (H4 = D2 + E3), K2 = B4 + X3, Z3 = B4 - X3;
t7[f3 + 40] = Z3 + Y3, t7[f3 + 24] = Z3 - Y3, t7[f3 + 8] = K2 + J2, t7[f3 + 56] = K2 - J2, f3++;
}
for (h4 = 0; h4 < 64; ++h4)
l3 = t7[h4] * e9[h4], d2[h4] = l3 > 0 ? l3 + 0.5 | 0 : l3 - 0.5 | 0;
return d2;
}(t6, e8), u3 = 0; u3 < 64; ++u3)
p2[A5[u3]] = c3[u3];
var h3 = p2[0] - r3;
r3 = p2[0], 0 == h3 ? O2(n3[0]) : (O2(n3[f2[a3 = 32767 + h3]]), O2(l2[a3]));
for (var g3 = 63; g3 > 0 && 0 == p2[g3]; )
g3--;
if (0 == g3)
return O2(o3), r3;
for (var m3, v3 = 1; v3 <= g3; ) {
for (var b3 = v3; 0 == p2[v3] && v3 <= g3; )
++v3;
var y3 = v3 - b3;
if (y3 >= 16) {
m3 = y3 >> 4;
for (var w3 = 1; w3 <= m3; ++w3)
O2(s3);
y3 &= 15;
}
a3 = 32767 + p2[v3], O2(i3[(y3 << 4) + f2[a3]]), O2(l2[a3]), v3++;
}
return 63 != g3 && O2(o3), r3;
}
function q2(t6) {
(t6 = Math.min(Math.max(t6, 1), 100), a2 != t6) && (!function(t7) {
for (var e8 = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], r3 = 0; r3 < 64; r3++) {
var n3 = o2((e8[r3] * t7 + 50) / 100);
n3 = Math.min(Math.max(n3, 1), 255), s2[A5[r3]] = n3;
}
for (var i3 = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], a3 = 0; a3 < 64; a3++) {
var l3 = o2((i3[a3] * t7 + 50) / 100);
l3 = Math.min(Math.max(l3, 1), 255), c2[A5[a3]] = l3;
}
for (var f3 = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], d3 = 0, p3 = 0; p3 < 8; p3++)
for (var g3 = 0; g3 < 8; g3++)
u2[d3] = 1 / (s2[A5[d3]] * f3[p3] * f3[g3] * 8), h2[d3] = 1 / (c2[A5[d3]] * f3[p3] * f3[g3] * 8), d3++;
}(t6 < 50 ? Math.floor(5e3 / t6) : Math.floor(200 - 2 * t6)), a2 = t6);
}
this.encode = function(t6, a3) {
a3 && q2(a3), g2 = new Array(), m2 = 0, v2 = 7, M2(65496), M2(65504), M2(16), B3(74), B3(70), B3(73), B3(70), B3(0), B3(1), B3(1), B3(0), M2(1), M2(1), B3(0), B3(0), function() {
M2(65499), M2(132), B3(0);
for (var t7 = 0; t7 < 64; t7++)
B3(s2[t7]);
B3(1);
for (var e8 = 0; e8 < 64; e8++)
B3(c2[e8]);
}(), function(t7, e8) {
M2(65472), M2(17), B3(8), M2(e8), M2(t7), B3(3), B3(1), B3(17), B3(0), B3(2), B3(17), B3(1), B3(3), B3(17), B3(1);
}(t6.width, t6.height), function() {
M2(65476), M2(418), B3(0);
for (var t7 = 0; t7 < 16; t7++)
B3(x2[t7 + 1]);
for (var e8 = 0; e8 <= 11; e8++)
B3(S2[e8]);
B3(16);
for (var r3 = 0; r3 < 16; r3++)
B3(_24[r3 + 1]);
for (var n3 = 0; n3 <= 161; n3++)
B3(P2[n3]);
B3(1);
for (var i3 = 0; i3 < 16; i3++)
B3(k2[i3 + 1]);
for (var a4 = 0; a4 <= 11; a4++)
B3(I2[a4]);
B3(17);
for (var o4 = 0; o4 < 16; o4++)
B3(F2[o4 + 1]);
for (var s3 = 0; s3 <= 161; s3++)
B3(C3[s3]);
}(), M2(65498), M2(12), B3(3), B3(1), B3(0), B3(2), B3(17), B3(3), B3(17), B3(0), B3(63), B3(0);
var o3 = 0, l3 = 0, f3 = 0;
m2 = 0, v2 = 7, this.encode.displayName = "_encode_";
for (var d3, p3, N3, A6, j3, D2, R2, T2, U2, z2 = t6.data, H4 = t6.width, W2 = t6.height, V2 = 4 * H4, G2 = 0; G2 < W2; ) {
for (d3 = 0; d3 < V2; ) {
for (j3 = V2 * G2 + d3, R2 = -1, T2 = 0, U2 = 0; U2 < 64; U2++)
D2 = j3 + (T2 = U2 >> 3) * V2 + (R2 = 4 * (7 & U2)), G2 + T2 >= W2 && (D2 -= V2 * (G2 + 1 + T2 - W2)), d3 + R2 >= V2 && (D2 -= d3 + R2 - V2 + 4), p3 = z2[D2++], N3 = z2[D2++], A6 = z2[D2++], b2[U2] = (L2[p3] + L2[N3 + 256 >> 0] + L2[A6 + 512 >> 0] >> 16) - 128, y2[U2] = (L2[p3 + 768 >> 0] + L2[N3 + 1024 >> 0] + L2[A6 + 1280 >> 0] >> 16) - 128, w2[U2] = (L2[p3 + 1280 >> 0] + L2[N3 + 1536 >> 0] + L2[A6 + 1792 >> 0] >> 16) - 128;
o3 = E2(b2, u2, o3, e7, n2), l3 = E2(y2, h2, l3, r2, i2), f3 = E2(w2, h2, f3, r2, i2), d3 += 32;
}
G2 += 8;
}
if (v2 >= 0) {
var Y3 = [];
Y3[1] = v2 + 1, Y3[0] = (1 << v2 + 1) - 1, O2(Y3);
}
return M2(65497), new Uint8Array(g2);
}, t5 = t5 || 50, function() {
for (var t6 = String.fromCharCode, e8 = 0; e8 < 256; e8++)
N2[e8] = t6(e8);
}(), e7 = j2(x2, S2), r2 = j2(k2, I2), n2 = j2(_24, P2), i2 = j2(F2, C3), function() {
for (var t6 = 1, e8 = 2, r3 = 1; r3 <= 15; r3++) {
for (var n3 = t6; n3 < e8; n3++)
f2[32767 + n3] = r3, l2[32767 + n3] = [], l2[32767 + n3][1] = r3, l2[32767 + n3][0] = n3;
for (var i3 = -(e8 - 1); i3 <= -t6; i3++)
f2[32767 + i3] = r3, l2[32767 + i3] = [], l2[32767 + i3][1] = r3, l2[32767 + i3][0] = e8 - 1 + i3;
t6 <<= 1, e8 <<= 1;
}
}(), function() {
for (var t6 = 0; t6 < 256; t6++)
L2[t6] = 19595 * t6, L2[t6 + 256 >> 0] = 38470 * t6, L2[t6 + 512 >> 0] = 7471 * t6 + 32768, L2[t6 + 768 >> 0] = -11059 * t6, L2[t6 + 1024 >> 0] = -21709 * t6, L2[t6 + 1280 >> 0] = 32768 * t6 + 8421375, L2[t6 + 1536 >> 0] = -27439 * t6, L2[t6 + 1792 >> 0] = -5329 * t6;
}(), q2(t5);
}
/**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function te$1(t5, e7) {
if (this.pos = 0, this.buffer = t5, this.datav = new DataView(t5.buffer), this.is_with_alpha = !!e7, this.bottom_up = true, this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]), this.pos += 2, -1 === ["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag))
throw new Error("Invalid BMP File");
this.parseHeader(), this.parseBGR();
}
function ee$1(t5) {
function e7(t6) {
if (!t6)
throw Error("assert :P");
}
function r2(t6, e8, r3) {
for (var n3 = 0; 4 > n3; n3++)
if (t6[e8 + n3] != r3.charCodeAt(n3))
return true;
return false;
}
function n2(t6, e8, r3, n3, i3) {
for (var a3 = 0; a3 < i3; a3++)
t6[e8 + a3] = r3[n3 + a3];
}
function i2(t6, e8, r3, n3) {
for (var i3 = 0; i3 < n3; i3++)
t6[e8 + i3] = r3;
}
function a2(t6) {
return new Int32Array(t6);
}
function o2(t6, e8) {
for (var r3 = [], n3 = 0; n3 < t6; n3++)
r3.push(new e8());
return r3;
}
function s2(t6, e8) {
var r3 = [];
return function t7(r4, n3, i3) {
for (var a3 = i3[n3], o3 = 0; o3 < a3 && (r4.push(i3.length > n3 + 1 ? [] : new e8()), !(i3.length < n3 + 1)); o3++)
t7(r4[o3], n3 + 1, i3);
}(r3, 0, t6), r3;
}
var c2 = function() {
var t6 = this;
function c3(t7, e8) {
for (var r3 = 1 << e8 - 1 >>> 0; t7 & r3; )
r3 >>>= 1;
return r3 ? (t7 & r3 - 1) + r3 : t7;
}
function u3(t7, r3, n3, i3, a3) {
e7(!(i3 % n3));
do {
t7[r3 + (i3 -= n3)] = a3;
} while (0 < i3);
}
function h3(t7, r3, n3, i3, o3) {
if (e7(2328 >= o3), 512 >= o3)
var s3 = a2(512);
else if (null == (s3 = a2(o3)))
return 0;
return function(t8, r4, n4, i4, o4, s4) {
var h4, f4, d4 = r4, p4 = 1 << n4, g4 = a2(16), m4 = a2(16);
for (e7(0 != o4), e7(null != i4), e7(null != t8), e7(0 < n4), f4 = 0; f4 < o4; ++f4) {
if (15 < i4[f4])
return 0;
++g4[i4[f4]];
}
if (g4[0] == o4)
return 0;
for (m4[1] = 0, h4 = 1; 15 > h4; ++h4) {
if (g4[h4] > 1 << h4)
return 0;
m4[h4 + 1] = m4[h4] + g4[h4];
}
for (f4 = 0; f4 < o4; ++f4)
h4 = i4[f4], 0 < i4[f4] && (s4[m4[h4]++] = f4);
if (1 == m4[15])
return (i4 = new l3()).g = 0, i4.value = s4[0], u3(t8, d4, 1, p4, i4), p4;
var v5, b4 = -1, y4 = p4 - 1, w4 = 0, N4 = 1, L4 = 1, A7 = 1 << n4;
for (f4 = 0, h4 = 1, o4 = 2; h4 <= n4; ++h4, o4 <<= 1) {
if (N4 += L4 <<= 1, 0 > (L4 -= g4[h4]))
return 0;
for (; 0 < g4[h4]; --g4[h4])
(i4 = new l3()).g = h4, i4.value = s4[f4++], u3(t8, d4 + w4, o4, A7, i4), w4 = c3(w4, h4);
}
for (h4 = n4 + 1, o4 = 2; 15 >= h4; ++h4, o4 <<= 1) {
if (N4 += L4 <<= 1, 0 > (L4 -= g4[h4]))
return 0;
for (; 0 < g4[h4]; --g4[h4]) {
if (i4 = new l3(), (w4 & y4) != b4) {
for (d4 += A7, v5 = 1 << (b4 = h4) - n4; 15 > b4 && !(0 >= (v5 -= g4[b4])); )
++b4, v5 <<= 1;
p4 += A7 = 1 << (v5 = b4 - n4), t8[r4 + (b4 = w4 & y4)].g = v5 + n4, t8[r4 + b4].value = d4 - r4 - b4;
}
i4.g = h4 - n4, i4.value = s4[f4++], u3(t8, d4 + (w4 >> n4), o4, A7, i4), w4 = c3(w4, h4);
}
}
return N4 != 2 * m4[15] - 1 ? 0 : p4;
}(t7, r3, n3, i3, o3, s3);
}
function l3() {
this.value = this.g = 0;
}
function f3() {
this.value = this.g = 0;
}
function d3() {
this.G = o2(5, l3), this.H = a2(5), this.jc = this.Qb = this.qb = this.nd = 0, this.pd = o2(Dr2, f3);
}
function p3(t7, r3, n3, i3) {
e7(null != t7), e7(null != r3), e7(2147483648 > i3), t7.Ca = 254, t7.I = 0, t7.b = -8, t7.Ka = 0, t7.oa = r3, t7.pa = n3, t7.Jd = r3, t7.Yc = n3 + i3, t7.Zc = 4 <= i3 ? n3 + i3 - 4 + 1 : n3, _24(t7);
}
function g3(t7, e8) {
for (var r3 = 0; 0 < e8--; )
r3 |= k2(t7, 128) << e8;
return r3;
}
function m3(t7, e8) {
var r3 = g3(t7, e8);
return P2(t7) ? -r3 : r3;
}
function v3(t7, r3, n3, i3) {
var a3, o3 = 0;
for (e7(null != t7), e7(null != r3), e7(4294967288 > i3), t7.Sb = i3, t7.Ra = 0, t7.u = 0, t7.h = 0, 4 < i3 && (i3 = 4), a3 = 0; a3 < i3; ++a3)
o3 += r3[n3 + a3] << 8 * a3;
t7.Ra = o3, t7.bb = i3, t7.oa = r3, t7.pa = n3;
}
function b3(t7) {
for (; 8 <= t7.u && t7.bb < t7.Sb; )
t7.Ra >>>= 8, t7.Ra += t7.oa[t7.pa + t7.bb] << Ur2 - 8 >>> 0, ++t7.bb, t7.u -= 8;
A6(t7) && (t7.h = 1, t7.u = 0);
}
function y3(t7, r3) {
if (e7(0 <= r3), !t7.h && r3 <= Tr2) {
var n3 = L3(t7) & Rr2[r3];
return t7.u += r3, b3(t7), n3;
}
return t7.h = 1, t7.u = 0;
}
function w3() {
this.b = this.Ca = this.I = 0, this.oa = [], this.pa = 0, this.Jd = [], this.Yc = 0, this.Zc = [], this.Ka = 0;
}
function N3() {
this.Ra = 0, this.oa = [], this.h = this.u = this.bb = this.Sb = this.pa = 0;
}
function L3(t7) {
return t7.Ra >>> (t7.u & Ur2 - 1) >>> 0;
}
function A6(t7) {
return e7(t7.bb <= t7.Sb), t7.h || t7.bb == t7.Sb && t7.u > Ur2;
}
function x2(t7, e8) {
t7.u = e8, t7.h = A6(t7);
}
function S2(t7) {
t7.u >= zr2 && (e7(t7.u >= zr2), b3(t7));
}
function _24(t7) {
e7(null != t7 && null != t7.oa), t7.pa < t7.Zc ? (t7.I = (t7.oa[t7.pa++] | t7.I << 8) >>> 0, t7.b += 8) : (e7(null != t7 && null != t7.oa), t7.pa < t7.Yc ? (t7.b += 8, t7.I = t7.oa[t7.pa++] | t7.I << 8) : t7.Ka ? t7.b = 0 : (t7.I <<= 8, t7.b += 8, t7.Ka = 1));
}
function P2(t7) {
return g3(t7, 1);
}
function k2(t7, e8) {
var r3 = t7.Ca;
0 > t7.b && _24(t7);
var n3 = t7.b, i3 = r3 * e8 >>> 8, a3 = (t7.I >>> n3 > i3) + 0;
for (a3 ? (r3 -= i3, t7.I -= i3 + 1 << n3 >>> 0) : r3 = i3 + 1, n3 = r3, i3 = 0; 256 <= n3; )
i3 += 8, n3 >>= 8;
return n3 = 7 ^ i3 + Hr2[n3], t7.b -= n3, t7.Ca = (r3 << n3) - 1, a3;
}
function I2(t7, e8, r3) {
t7[e8 + 0] = r3 >> 24 & 255, t7[e8 + 1] = r3 >> 16 & 255, t7[e8 + 2] = r3 >> 8 & 255, t7[e8 + 3] = r3 >> 0 & 255;
}
function F2(t7, e8) {
return t7[e8 + 0] << 0 | t7[e8 + 1] << 8;
}
function C3(t7, e8) {
return F2(t7, e8) | t7[e8 + 2] << 16;
}
function j2(t7, e8) {
return F2(t7, e8) | F2(t7, e8 + 2) << 16;
}
function O2(t7, r3) {
var n3 = 1 << r3;
return e7(null != t7), e7(0 < r3), t7.X = a2(n3), null == t7.X ? 0 : (t7.Mb = 32 - r3, t7.Xa = r3, 1);
}
function B3(t7, r3) {
e7(null != t7), e7(null != r3), e7(t7.Xa == r3.Xa), n2(r3.X, 0, t7.X, 0, 1 << r3.Xa);
}
function M2() {
this.X = [], this.Xa = this.Mb = 0;
}
function E2(t7, r3, n3, i3) {
e7(null != n3), e7(null != i3);
var a3 = n3[0], o3 = i3[0];
return 0 == a3 && (a3 = (t7 * o3 + r3 / 2) / r3), 0 == o3 && (o3 = (r3 * a3 + t7 / 2) / t7), 0 >= a3 || 0 >= o3 ? 0 : (n3[0] = a3, i3[0] = o3, 1);
}
function q2(t7, e8) {
return t7 + (1 << e8) - 1 >>> e8;
}
function D2(t7, e8) {
return ((4278255360 & t7) + (4278255360 & e8) >>> 0 & 4278255360) + ((16711935 & t7) + (16711935 & e8) >>> 0 & 16711935) >>> 0;
}
function R2(e8, r3) {
t6[r3] = function(r4, n3, i3, a3, o3, s3, c4) {
var u4;
for (u4 = 0; u4 < o3; ++u4) {
var h4 = t6[e8](s3[c4 + u4 - 1], i3, a3 + u4);
s3[c4 + u4] = D2(r4[n3 + u4], h4);
}
};
}
function T2() {
this.ud = this.hd = this.jd = 0;
}
function U2(t7, e8) {
return ((4278124286 & (t7 ^ e8)) >>> 1) + (t7 & e8) >>> 0;
}
function z2(t7) {
return 0 <= t7 && 256 > t7 ? t7 : 0 > t7 ? 0 : 255 < t7 ? 255 : void 0;
}
function H4(t7, e8) {
return z2(t7 + (t7 - e8 + 0.5 >> 1));
}
function W2(t7, e8, r3) {
return Math.abs(e8 - r3) - Math.abs(t7 - r3);
}
function V2(t7, e8, r3, n3, i3, a3, o3) {
for (n3 = a3[o3 - 1], r3 = 0; r3 < i3; ++r3)
a3[o3 + r3] = n3 = D2(t7[e8 + r3], n3);
}
function G2(t7, e8, r3, n3, i3) {
var a3;
for (a3 = 0; a3 < r3; ++a3) {
var o3 = t7[e8 + a3], s3 = o3 >> 8 & 255, c4 = 16711935 & (c4 = (c4 = 16711935 & o3) + ((s3 << 16) + s3));
n3[i3 + a3] = (4278255360 & o3) + c4 >>> 0;
}
}
function Y3(t7, e8) {
e8.jd = t7 >> 0 & 255, e8.hd = t7 >> 8 & 255, e8.ud = t7 >> 16 & 255;
}
function J2(t7, e8, r3, n3, i3, a3) {
var o3;
for (o3 = 0; o3 < n3; ++o3) {
var s3 = e8[r3 + o3], c4 = s3 >>> 8, u4 = s3, h4 = 255 & (h4 = (h4 = s3 >>> 16) + ((t7.jd << 24 >> 24) * (c4 << 24 >> 24) >>> 5));
u4 = 255 & (u4 = (u4 = u4 + ((t7.hd << 24 >> 24) * (c4 << 24 >> 24) >>> 5)) + ((t7.ud << 24 >> 24) * (h4 << 24 >> 24) >>> 5));
i3[a3 + o3] = (4278255360 & s3) + (h4 << 16) + u4;
}
}
function X3(e8, r3, n3, i3, a3) {
t6[r3] = function(t7, e9, r4, n4, o3, s3, c4, u4, h4) {
for (n4 = c4; n4 < u4; ++n4)
for (c4 = 0; c4 < h4; ++c4)
o3[s3++] = a3(r4[i3(t7[e9++])]);
}, t6[e8] = function(e9, r4, o3, s3, c4, u4, h4) {
var l4 = 8 >> e9.b, f4 = e9.Ea, d4 = e9.K[0], p4 = e9.w;
if (8 > l4)
for (e9 = (1 << e9.b) - 1, p4 = (1 << l4) - 1; r4 < o3; ++r4) {
var g4, m4 = 0;
for (g4 = 0; g4 < f4; ++g4)
g4 & e9 || (m4 = i3(s3[c4++])), u4[h4++] = a3(d4[m4 & p4]), m4 >>= l4;
}
else
t6["VP8LMapColor" + n3](s3, c4, d4, p4, u4, h4, r4, o3, f4);
};
}
function K2(t7, e8, r3, n3, i3) {
for (r3 = e8 + r3; e8 < r3; ) {
var a3 = t7[e8++];
n3[i3++] = a3 >> 16 & 255, n3[i3++] = a3 >> 8 & 255, n3[i3++] = a3 >> 0 & 255;
}
}
function Z3(t7, e8, r3, n3, i3) {
for (r3 = e8 + r3; e8 < r3; ) {
var a3 = t7[e8++];
n3[i3++] = a3 >> 16 & 255, n3[i3++] = a3 >> 8 & 255, n3[i3++] = a3 >> 0 & 255, n3[i3++] = a3 >> 24 & 255;
}
}
function $2(t7, e8, r3, n3, i3) {
for (r3 = e8 + r3; e8 < r3; ) {
var a3 = (o3 = t7[e8++]) >> 16 & 240 | o3 >> 12 & 15, o3 = o3 >> 0 & 240 | o3 >> 28 & 15;
n3[i3++] = a3, n3[i3++] = o3;
}
}
function Q2(t7, e8, r3, n3, i3) {
for (r3 = e8 + r3; e8 < r3; ) {
var a3 = (o3 = t7[e8++]) >> 16 & 248 | o3 >> 13 & 7, o3 = o3 >> 5 & 224 | o3 >> 3 & 31;
n3[i3++] = a3, n3[i3++] = o3;
}
}
function tt2(t7, e8, r3, n3, i3) {
for (r3 = e8 + r3; e8 < r3; ) {
var a3 = t7[e8++];
n3[i3++] = a3 >> 0 & 255, n3[i3++] = a3 >> 8 & 255, n3[i3++] = a3 >> 16 & 255;
}
}
function et2(t7, e8, r3, i3, a3, o3) {
if (0 == o3)
for (r3 = e8 + r3; e8 < r3; )
I2(i3, ((o3 = t7[e8++])[0] >> 24 | o3[1] >> 8 & 65280 | o3[2] << 8 & 16711680 | o3[3] << 24) >>> 0), a3 += 32;
else
n2(i3, a3, t7, e8, r3);
}
function rt2(e8, r3) {
t6[r3][0] = t6[e8 + "0"], t6[r3][1] = t6[e8 + "1"], t6[r3][2] = t6[e8 + "2"], t6[r3][3] = t6[e8 + "3"], t6[r3][4] = t6[e8 + "4"], t6[r3][5] = t6[e8 + "5"], t6[r3][6] = t6[e8 + "6"], t6[r3][7] = t6[e8 + "7"], t6[r3][8] = t6[e8 + "8"], t6[r3][9] = t6[e8 + "9"], t6[r3][10] = t6[e8 + "10"], t6[r3][11] = t6[e8 + "11"], t6[r3][12] = t6[e8 + "12"], t6[r3][13] = t6[e8 + "13"], t6[r3][14] = t6[e8 + "0"], t6[r3][15] = t6[e8 + "0"];
}
function nt2(t7) {
return t7 == Hn2 || t7 == Wn2 || t7 == Vn2 || t7 == Gn2;
}
function it2() {
this.eb = [], this.size = this.A = this.fb = 0;
}
function at2() {
this.y = [], this.f = [], this.ea = [], this.F = [], this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;
}
function ot2() {
this.Rd = this.height = this.width = this.S = 0, this.f = {}, this.f.RGBA = new it2(), this.f.kb = new at2(), this.sd = null;
}
function st2() {
this.width = [0], this.height = [0], this.Pd = [0], this.Qd = [0], this.format = [0];
}
function ct2() {
this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;
}
function ut2(t7) {
return alert("todo:WebPSamplerProcessPlane"), t7.T;
}
function ht2(t7, e8) {
var r3 = t7.T, i3 = e8.ba.f.RGBA, a3 = i3.eb, o3 = i3.fb + t7.ka * i3.A, s3 = vi2[e8.ba.S], c4 = t7.y, u4 = t7.O, h4 = t7.f, l4 = t7.N, f4 = t7.ea, d4 = t7.W, p4 = e8.cc, g4 = e8.dc, m4 = e8.Mc, v5 = e8.Nc, b4 = t7.ka, y4 = t7.ka + t7.T, w4 = t7.U, N4 = w4 + 1 >> 1;
for (0 == b4 ? s3(c4, u4, null, null, h4, l4, f4, d4, h4, l4, f4, d4, a3, o3, null, null, w4) : (s3(e8.ec, e8.fc, c4, u4, p4, g4, m4, v5, h4, l4, f4, d4, a3, o3 - i3.A, a3, o3, w4), ++r3); b4 + 2 < y4; b4 += 2)
p4 = h4, g4 = l4, m4 = f4, v5 = d4, l4 += t7.Rc, d4 += t7.Rc, o3 += 2 * i3.A, s3(c4, (u4 += 2 * t7.fa) - t7.fa, c4, u4, p4, g4, m4, v5, h4, l4, f4, d4, a3, o3 - i3.A, a3, o3, w4);
return u4 += t7.fa, t7.j + y4 < t7.o ? (n2(e8.ec, e8.fc, c4, u4, w4), n2(e8.cc, e8.dc, h4, l4, N4), n2(e8.Mc, e8.Nc, f4, d4, N4), r3--) : 1 & y4 || s3(c4, u4, null, null, h4, l4, f4, d4, h4, l4, f4, d4, a3, o3 + i3.A, null, null, w4), r3;
}
function lt2(t7, r3, n3) {
var i3 = t7.F, a3 = [t7.J];
if (null != i3) {
var o3 = t7.U, s3 = r3.ba.S, c4 = s3 == Tn2 || s3 == Vn2;
r3 = r3.ba.f.RGBA;
var u4 = [0], h4 = t7.ka;
u4[0] = t7.T, t7.Kb && (0 == h4 ? --u4[0] : (--h4, a3[0] -= t7.width), t7.j + t7.ka + t7.T == t7.o && (u4[0] = t7.o - t7.j - h4));
var l4 = r3.eb;
h4 = r3.fb + h4 * r3.A;
t7 = Sn2(i3, a3[0], t7.width, o3, u4, l4, h4 + (c4 ? 0 : 3), r3.A), e7(n3 == u4), t7 && nt2(s3) && An2(l4, h4, c4, o3, u4, r3.A);
}
return 0;
}
function ft2(t7) {
var e8 = t7.ma, r3 = e8.ba.S, n3 = 11 > r3, i3 = r3 == qn2 || r3 == Rn2 || r3 == Tn2 || r3 == Un2 || 12 == r3 || nt2(r3);
if (e8.memory = null, e8.Ib = null, e8.Jb = null, e8.Nd = null, !Mr2(e8.Oa, t7, i3 ? 11 : 12))
return 0;
if (i3 && nt2(r3) && br2(), t7.da)
alert("todo:use_scaling");
else {
if (n3) {
if (e8.Ib = ut2, t7.Kb) {
if (r3 = t7.U + 1 >> 1, e8.memory = a2(t7.U + 2 * r3), null == e8.memory)
return 0;
e8.ec = e8.memory, e8.fc = 0, e8.cc = e8.ec, e8.dc = e8.fc + t7.U, e8.Mc = e8.cc, e8.Nc = e8.dc + r3, e8.Ib = ht2, br2();
}
} else
alert("todo:EmitYUV");
i3 && (e8.Jb = lt2, n3 && mr2());
}
if (n3 && !Ci2) {
for (t7 = 0; 256 > t7; ++t7)
ji2[t7] = 89858 * (t7 - 128) + _i2 >> Si2, Mi2[t7] = -22014 * (t7 - 128) + _i2, Bi2[t7] = -45773 * (t7 - 128), Oi2[t7] = 113618 * (t7 - 128) + _i2 >> Si2;
for (t7 = Pi2; t7 < ki2; ++t7)
e8 = 76283 * (t7 - 16) + _i2 >> Si2, Ei2[t7 - Pi2] = Vt2(e8, 255), qi2[t7 - Pi2] = Vt2(e8 + 8 >> 4, 15);
Ci2 = 1;
}
return 1;
}
function dt2(t7) {
var r3 = t7.ma, n3 = t7.U, i3 = t7.T;
return e7(!(1 & t7.ka)), 0 >= n3 || 0 >= i3 ? 0 : (n3 = r3.Ib(t7, r3), null != r3.Jb && r3.Jb(t7, r3, n3), r3.Dc += n3, 1);
}
function pt2(t7) {
t7.ma.memory = null;
}
function gt2(t7, e8, r3, n3) {
return 47 != y3(t7, 8) ? 0 : (e8[0] = y3(t7, 14) + 1, r3[0] = y3(t7, 14) + 1, n3[0] = y3(t7, 1), 0 != y3(t7, 3) ? 0 : !t7.h);
}
function mt2(t7, e8) {
if (4 > t7)
return t7 + 1;
var r3 = t7 - 2 >> 1;
return (2 + (1 & t7) << r3) + y3(e8, r3) + 1;
}
function vt2(t7, e8) {
return 120 < e8 ? e8 - 120 : 1 <= (r3 = ((r3 = $n2[e8 - 1]) >> 4) * t7 + (8 - (15 & r3))) ? r3 : 1;
var r3;
}
function bt2(t7, e8, r3) {
var n3 = L3(r3), i3 = t7[e8 += 255 & n3].g - 8;
return 0 < i3 && (x2(r3, r3.u + 8), n3 = L3(r3), e8 += t7[e8].value, e8 += n3 & (1 << i3) - 1), x2(r3, r3.u + t7[e8].g), t7[e8].value;
}
function yt2(t7, r3, n3) {
return n3.g += t7.g, n3.value += t7.value << r3 >>> 0, e7(8 >= n3.g), t7.g;
}
function wt2(t7, r3, n3) {
var i3 = t7.xc;
return e7((r3 = 0 == i3 ? 0 : t7.vc[t7.md * (n3 >> i3) + (r3 >> i3)]) < t7.Wb), t7.Ya[r3];
}
function Nt2(t7, r3, i3, a3) {
var o3 = t7.ab, s3 = t7.c * r3, c4 = t7.C;
r3 = c4 + r3;
var u4 = i3, h4 = a3;
for (a3 = t7.Ta, i3 = t7.Ua; 0 < o3--; ) {
var l4 = t7.gc[o3], f4 = c4, d4 = r3, p4 = u4, g4 = h4, m4 = (h4 = a3, u4 = i3, l4.Ea);
switch (e7(f4 < d4), e7(d4 <= l4.nc), l4.hc) {
case 2:
Gr2(p4, g4, (d4 - f4) * m4, h4, u4);
break;
case 0:
var v5 = f4, b4 = d4, y4 = h4, w4 = u4, N4 = (_25 = l4).Ea;
0 == v5 && (Wr2(p4, g4, null, null, 1, y4, w4), V2(p4, g4 + 1, 0, 0, N4 - 1, y4, w4 + 1), g4 += N4, w4 += N4, ++v5);
for (var L4 = 1 << _25.b, A7 = L4 - 1, x3 = q2(N4, _25.b), S3 = _25.K, _25 = _25.w + (v5 >> _25.b) * x3; v5 < b4; ) {
var P3 = S3, k3 = _25, I3 = 1;
for (Vr2(p4, g4, y4, w4 - N4, 1, y4, w4); I3 < N4; ) {
var F3 = (I3 & ~A7) + L4;
F3 > N4 && (F3 = N4), (0, Zr2[P3[k3++] >> 8 & 15])(p4, g4 + +I3, y4, w4 + I3 - N4, F3 - I3, y4, w4 + I3), I3 = F3;
}
g4 += N4, w4 += N4, ++v5 & A7 || (_25 += x3);
}
d4 != l4.nc && n2(h4, u4 - m4, h4, u4 + (d4 - f4 - 1) * m4, m4);
break;
case 1:
for (m4 = p4, b4 = g4, N4 = (p4 = l4.Ea) - (w4 = p4 & ~(y4 = (g4 = 1 << l4.b) - 1)), v5 = q2(p4, l4.b), L4 = l4.K, l4 = l4.w + (f4 >> l4.b) * v5; f4 < d4; ) {
for (A7 = L4, x3 = l4, S3 = new T2(), _25 = b4 + w4, P3 = b4 + p4; b4 < _25; )
Y3(A7[x3++], S3), $r2(S3, m4, b4, g4, h4, u4), b4 += g4, u4 += g4;
b4 < P3 && (Y3(A7[x3++], S3), $r2(S3, m4, b4, N4, h4, u4), b4 += N4, u4 += N4), ++f4 & y4 || (l4 += v5);
}
break;
case 3:
if (p4 == h4 && g4 == u4 && 0 < l4.b) {
for (b4 = h4, p4 = m4 = u4 + (d4 - f4) * m4 - (w4 = (d4 - f4) * q2(l4.Ea, l4.b)), g4 = h4, y4 = u4, v5 = [], w4 = (N4 = w4) - 1; 0 <= w4; --w4)
v5[w4] = g4[y4 + w4];
for (w4 = N4 - 1; 0 <= w4; --w4)
b4[p4 + w4] = v5[w4];
Yr2(l4, f4, d4, h4, m4, h4, u4);
} else
Yr2(l4, f4, d4, p4, g4, h4, u4);
}
u4 = a3, h4 = i3;
}
h4 != i3 && n2(a3, i3, u4, h4, s3);
}
function Lt2(t7, r3) {
var n3 = t7.V, i3 = t7.Ba + t7.c * t7.C, a3 = r3 - t7.C;
if (e7(r3 <= t7.l.o), e7(16 >= a3), 0 < a3) {
var o3 = t7.l, s3 = t7.Ta, c4 = t7.Ua, u4 = o3.width;
if (Nt2(t7, a3, n3, i3), a3 = c4 = [c4], e7((n3 = t7.C) < (i3 = r3)), e7(o3.v < o3.va), i3 > o3.o && (i3 = o3.o), n3 < o3.j) {
var h4 = o3.j - n3;
n3 = o3.j;
a3[0] += h4 * u4;
}
if (n3 >= i3 ? n3 = 0 : (a3[0] += 4 * o3.v, o3.ka = n3 - o3.j, o3.U = o3.va - o3.v, o3.T = i3 - n3, n3 = 1), n3) {
if (c4 = c4[0], 11 > (n3 = t7.ca).S) {
var l4 = n3.f.RGBA, f4 = (i3 = n3.S, a3 = o3.U, o3 = o3.T, h4 = l4.eb, l4.A), d4 = o3;
for (l4 = l4.fb + t7.Ma * l4.A; 0 < d4--; ) {
var p4 = s3, g4 = c4, m4 = a3, v5 = h4, b4 = l4;
switch (i3) {
case En2:
Qr2(p4, g4, m4, v5, b4);
break;
case qn2:
tn2(p4, g4, m4, v5, b4);
break;
case Hn2:
tn2(p4, g4, m4, v5, b4), An2(v5, b4, 0, m4, 1, 0);
break;
case Dn2:
nn2(p4, g4, m4, v5, b4);
break;
case Rn2:
et2(p4, g4, m4, v5, b4, 1);
break;
case Wn2:
et2(p4, g4, m4, v5, b4, 1), An2(v5, b4, 0, m4, 1, 0);
break;
case Tn2:
et2(p4, g4, m4, v5, b4, 0);
break;
case Vn2:
et2(p4, g4, m4, v5, b4, 0), An2(v5, b4, 1, m4, 1, 0);
break;
case Un2:
en2(p4, g4, m4, v5, b4);
break;
case Gn2:
en2(p4, g4, m4, v5, b4), xn2(v5, b4, m4, 1, 0);
break;
case zn2:
rn2(p4, g4, m4, v5, b4);
break;
default:
e7(0);
}
c4 += u4, l4 += f4;
}
t7.Ma += o3;
} else
alert("todo:EmitRescaledRowsYUVA");
e7(t7.Ma <= n3.height);
}
}
t7.C = r3, e7(t7.C <= t7.i);
}
function At2(t7) {
var e8;
if (0 < t7.ua)
return 0;
for (e8 = 0; e8 < t7.Wb; ++e8) {
var r3 = t7.Ya[e8].G, n3 = t7.Ya[e8].H;
if (0 < r3[1][n3[1] + 0].g || 0 < r3[2][n3[2] + 0].g || 0 < r3[3][n3[3] + 0].g)
return 0;
}
return 1;
}
function xt2(t7, r3, n3, i3, a3, o3) {
if (0 != t7.Z) {
var s3 = t7.qd, c4 = t7.rd;
for (e7(null != mi2[t7.Z]); r3 < n3; ++r3)
mi2[t7.Z](s3, c4, i3, a3, i3, a3, o3), s3 = i3, c4 = a3, a3 += o3;
t7.qd = s3, t7.rd = c4;
}
}
function St2(t7, r3) {
var n3 = t7.l.ma, i3 = 0 == n3.Z || 1 == n3.Z ? t7.l.j : t7.C;
i3 = t7.C < i3 ? i3 : t7.C;
if (e7(r3 <= t7.l.o), r3 > i3) {
var a3 = t7.l.width, o3 = n3.ca, s3 = n3.tb + a3 * i3, c4 = t7.V, u4 = t7.Ba + t7.c * i3, h4 = t7.gc;
e7(1 == t7.ab), e7(3 == h4[0].hc), Xr2(h4[0], i3, r3, c4, u4, o3, s3), xt2(n3, i3, r3, o3, s3, a3);
}
t7.C = t7.Ma = r3;
}
function _t2(t7, r3, n3, i3, a3, o3, s3) {
var c4 = t7.$ / i3, u4 = t7.$ % i3, h4 = t7.m, l4 = t7.s, f4 = n3 + t7.$, d4 = f4;
a3 = n3 + i3 * a3;
var p4 = n3 + i3 * o3, g4 = 280 + l4.ua, m4 = t7.Pb ? c4 : 16777216, v5 = 0 < l4.ua ? l4.Wa : null, b4 = l4.wc, y4 = f4 < p4 ? wt2(l4, u4, c4) : null;
e7(t7.C < o3), e7(p4 <= a3);
var w4 = false;
t:
for (; ; ) {
for (; w4 || f4 < p4; ) {
var N4 = 0;
if (c4 >= m4) {
var _25 = f4 - n3;
e7((m4 = t7).Pb), m4.wd = m4.m, m4.xd = _25, 0 < m4.s.ua && B3(m4.s.Wa, m4.s.vb), m4 = c4 + ti2;
}
if (u4 & b4 || (y4 = wt2(l4, u4, c4)), e7(null != y4), y4.Qb && (r3[f4] = y4.qb, w4 = true), !w4)
if (S2(h4), y4.jc) {
N4 = h4, _25 = r3;
var P3 = f4, k3 = y4.pd[L3(N4) & Dr2 - 1];
e7(y4.jc), 256 > k3.g ? (x2(N4, N4.u + k3.g), _25[P3] = k3.value, N4 = 0) : (x2(N4, N4.u + k3.g - 256), e7(256 <= k3.value), N4 = k3.value), 0 == N4 && (w4 = true);
} else
N4 = bt2(y4.G[0], y4.H[0], h4);
if (h4.h)
break;
if (w4 || 256 > N4) {
if (!w4)
if (y4.nd)
r3[f4] = (y4.qb | N4 << 8) >>> 0;
else {
if (S2(h4), w4 = bt2(y4.G[1], y4.H[1], h4), S2(h4), _25 = bt2(y4.G[2], y4.H[2], h4), P3 = bt2(y4.G[3], y4.H[3], h4), h4.h)
break;
r3[f4] = (P3 << 24 | w4 << 16 | N4 << 8 | _25) >>> 0;
}
if (w4 = false, ++f4, ++u4 >= i3 && (u4 = 0, ++c4, null != s3 && c4 <= o3 && !(c4 % 16) && s3(t7, c4), null != v5))
for (; d4 < f4; )
N4 = r3[d4++], v5.X[(506832829 * N4 & 4294967295) >>> v5.Mb] = N4;
} else if (280 > N4) {
if (N4 = mt2(N4 - 256, h4), _25 = bt2(y4.G[4], y4.H[4], h4), S2(h4), _25 = vt2(i3, _25 = mt2(_25, h4)), h4.h)
break;
if (f4 - n3 < _25 || a3 - f4 < N4)
break t;
for (P3 = 0; P3 < N4; ++P3)
r3[f4 + P3] = r3[f4 + P3 - _25];
for (f4 += N4, u4 += N4; u4 >= i3; )
u4 -= i3, ++c4, null != s3 && c4 <= o3 && !(c4 % 16) && s3(t7, c4);
if (e7(f4 <= a3), u4 & b4 && (y4 = wt2(l4, u4, c4)), null != v5)
for (; d4 < f4; )
N4 = r3[d4++], v5.X[(506832829 * N4 & 4294967295) >>> v5.Mb] = N4;
} else {
if (!(N4 < g4))
break t;
for (w4 = N4 - 280, e7(null != v5); d4 < f4; )
N4 = r3[d4++], v5.X[(506832829 * N4 & 4294967295) >>> v5.Mb] = N4;
N4 = f4, e7(!(w4 >>> (_25 = v5).Xa)), r3[N4] = _25.X[w4], w4 = true;
}
w4 || e7(h4.h == A6(h4));
}
if (t7.Pb && h4.h && f4 < a3)
e7(t7.m.h), t7.a = 5, t7.m = t7.wd, t7.$ = t7.xd, 0 < t7.s.ua && B3(t7.s.vb, t7.s.Wa);
else {
if (h4.h)
break t;
null != s3 && s3(t7, c4 > o3 ? o3 : c4), t7.a = 0, t7.$ = f4 - n3;
}
return 1;
}
return t7.a = 3, 0;
}
function Pt2(t7) {
e7(null != t7), t7.vc = null, t7.yc = null, t7.Ya = null;
var r3 = t7.Wa;
null != r3 && (r3.X = null), t7.vb = null, e7(null != t7);
}
function kt2() {
var e8 = new or3();
return null == e8 ? null : (e8.a = 0, e8.xb = gi2, rt2("Predictor", "VP8LPredictors"), rt2("Predictor", "VP8LPredictors_C"), rt2("PredictorAdd", "VP8LPredictorsAdd"), rt2("PredictorAdd", "VP8LPredictorsAdd_C"), Gr2 = G2, $r2 = J2, Qr2 = K2, tn2 = Z3, en2 = $2, rn2 = Q2, nn2 = tt2, t6.VP8LMapColor32b = Jr2, t6.VP8LMapColor8b = Kr2, e8);
}
function It2(t7, r3, n3, s3, c4) {
var u4 = 1, f4 = [t7], p4 = [r3], g4 = s3.m, m4 = s3.s, v5 = null, b4 = 0;
t:
for (; ; ) {
if (n3)
for (; u4 && y3(g4, 1); ) {
var w4 = f4, N4 = p4, A7 = s3, _25 = 1, P3 = A7.m, k3 = A7.gc[A7.ab], I3 = y3(P3, 2);
if (A7.Oc & 1 << I3)
u4 = 0;
else {
switch (A7.Oc |= 1 << I3, k3.hc = I3, k3.Ea = w4[0], k3.nc = N4[0], k3.K = [null], ++A7.ab, e7(4 >= A7.ab), I3) {
case 0:
case 1:
k3.b = y3(P3, 3) + 2, _25 = It2(q2(k3.Ea, k3.b), q2(k3.nc, k3.b), 0, A7, k3.K), k3.K = k3.K[0];
break;
case 3:
var F3, C4 = y3(P3, 8) + 1, j3 = 16 < C4 ? 0 : 4 < C4 ? 1 : 2 < C4 ? 2 : 3;
if (w4[0] = q2(k3.Ea, j3), k3.b = j3, F3 = _25 = It2(C4, 1, 0, A7, k3.K)) {
var B4, M3 = C4, E3 = k3, R3 = 1 << (8 >> E3.b), T3 = a2(R3);
if (null == T3)
F3 = 0;
else {
var U3 = E3.K[0], z3 = E3.w;
for (T3[0] = E3.K[0][0], B4 = 1; B4 < 1 * M3; ++B4)
T3[B4] = D2(U3[z3 + B4], T3[B4 - 1]);
for (; B4 < 4 * R3; ++B4)
T3[B4] = 0;
E3.K[0] = null, E3.K[0] = T3, F3 = 1;
}
}
_25 = F3;
break;
case 2:
break;
default:
e7(0);
}
u4 = _25;
}
}
if (f4 = f4[0], p4 = p4[0], u4 && y3(g4, 1) && !(u4 = 1 <= (b4 = y3(g4, 4)) && 11 >= b4)) {
s3.a = 3;
break t;
}
var H5;
if (H5 = u4)
e: {
var W3, V3, G3, Y4 = s3, J3 = f4, X4 = p4, K3 = b4, Z4 = n3, $3 = Y4.m, Q3 = Y4.s, tt3 = [null], et3 = 1, rt3 = 0, nt3 = Qn2[K3];
r:
for (; ; ) {
if (Z4 && y3($3, 1)) {
var it3 = y3($3, 3) + 2, at3 = q2(J3, it3), ot3 = q2(X4, it3), st3 = at3 * ot3;
if (!It2(at3, ot3, 0, Y4, tt3))
break r;
for (tt3 = tt3[0], Q3.xc = it3, W3 = 0; W3 < st3; ++W3) {
var ct3 = tt3[W3] >> 8 & 65535;
tt3[W3] = ct3, ct3 >= et3 && (et3 = ct3 + 1);
}
}
if ($3.h)
break r;
for (V3 = 0; 5 > V3; ++V3) {
var ut3 = Xn2[V3];
!V3 && 0 < K3 && (ut3 += 1 << K3), rt3 < ut3 && (rt3 = ut3);
}
var ht3 = o2(et3 * nt3, l3), lt3 = et3, ft3 = o2(lt3, d3);
if (null == ft3)
var dt3 = null;
else
e7(65536 >= lt3), dt3 = ft3;
var pt3 = a2(rt3);
if (null == dt3 || null == pt3 || null == ht3) {
Y4.a = 1;
break r;
}
var gt3 = ht3;
for (W3 = G3 = 0; W3 < et3; ++W3) {
var mt3 = dt3[W3], vt3 = mt3.G, bt3 = mt3.H, wt3 = 0, Nt3 = 1, Lt3 = 0;
for (V3 = 0; 5 > V3; ++V3) {
ut3 = Xn2[V3], vt3[V3] = gt3, bt3[V3] = G3, !V3 && 0 < K3 && (ut3 += 1 << K3);
n: {
var At3, xt3 = ut3, St3 = Y4, kt3 = pt3, Ft3 = gt3, Ct3 = G3, jt3 = 0, Ot3 = St3.m, Bt3 = y3(Ot3, 1);
if (i2(kt3, 0, 0, xt3), Bt3) {
var Mt3 = y3(Ot3, 1) + 1, Et3 = y3(Ot3, 1), qt3 = y3(Ot3, 0 == Et3 ? 1 : 8);
kt3[qt3] = 1, 2 == Mt3 && (kt3[qt3 = y3(Ot3, 8)] = 1);
var Dt3 = 1;
} else {
var Rt3 = a2(19), Tt3 = y3(Ot3, 4) + 4;
if (19 < Tt3) {
St3.a = 3;
var Ut3 = 0;
break n;
}
for (At3 = 0; At3 < Tt3; ++At3)
Rt3[Zn2[At3]] = y3(Ot3, 3);
var zt3 = void 0, Ht3 = void 0, Wt3 = St3, Vt3 = Rt3, Gt3 = xt3, Yt3 = kt3, Jt3 = 0, Xt3 = Wt3.m, Kt3 = 8, Zt3 = o2(128, l3);
i:
for (; h3(Zt3, 0, 7, Vt3, 19); ) {
if (y3(Xt3, 1)) {
var $t3 = 2 + 2 * y3(Xt3, 3);
if ((zt3 = 2 + y3(Xt3, $t3)) > Gt3)
break i;
} else
zt3 = Gt3;
for (Ht3 = 0; Ht3 < Gt3 && zt3--; ) {
S2(Xt3);
var Qt3 = Zt3[0 + (127 & L3(Xt3))];
x2(Xt3, Xt3.u + Qt3.g);
var te3 = Qt3.value;
if (16 > te3)
Yt3[Ht3++] = te3, 0 != te3 && (Kt3 = te3);
else {
var ee3 = 16 == te3, re3 = te3 - 16, ne3 = Jn2[re3], ie3 = y3(Xt3, Yn2[re3]) + ne3;
if (Ht3 + ie3 > Gt3)
break i;
for (var ae3 = ee3 ? Kt3 : 0; 0 < ie3--; )
Yt3[Ht3++] = ae3;
}
}
Jt3 = 1;
break i;
}
Jt3 || (Wt3.a = 3), Dt3 = Jt3;
}
(Dt3 = Dt3 && !Ot3.h) && (jt3 = h3(Ft3, Ct3, 8, kt3, xt3)), Dt3 && 0 != jt3 ? Ut3 = jt3 : (St3.a = 3, Ut3 = 0);
}
if (0 == Ut3)
break r;
if (Nt3 && 1 == Kn2[V3] && (Nt3 = 0 == gt3[G3].g), wt3 += gt3[G3].g, G3 += Ut3, 3 >= V3) {
var oe3, se3 = pt3[0];
for (oe3 = 1; oe3 < ut3; ++oe3)
pt3[oe3] > se3 && (se3 = pt3[oe3]);
Lt3 += se3;
}
}
if (mt3.nd = Nt3, mt3.Qb = 0, Nt3 && (mt3.qb = (vt3[3][bt3[3] + 0].value << 24 | vt3[1][bt3[1] + 0].value << 16 | vt3[2][bt3[2] + 0].value) >>> 0, 0 == wt3 && 256 > vt3[0][bt3[0] + 0].value && (mt3.Qb = 1, mt3.qb += vt3[0][bt3[0] + 0].value << 8)), mt3.jc = !mt3.Qb && 6 > Lt3, mt3.jc) {
var ce3, ue3 = mt3;
for (ce3 = 0; ce3 < Dr2; ++ce3) {
var he3 = ce3, le3 = ue3.pd[he3], fe3 = ue3.G[0][ue3.H[0] + he3];
256 <= fe3.value ? (le3.g = fe3.g + 256, le3.value = fe3.value) : (le3.g = 0, le3.value = 0, he3 >>= yt2(fe3, 8, le3), he3 >>= yt2(ue3.G[1][ue3.H[1] + he3], 16, le3), he3 >>= yt2(ue3.G[2][ue3.H[2] + he3], 0, le3), yt2(ue3.G[3][ue3.H[3] + he3], 24, le3));
}
}
}
Q3.vc = tt3, Q3.Wb = et3, Q3.Ya = dt3, Q3.yc = ht3, H5 = 1;
break e;
}
H5 = 0;
}
if (!(u4 = H5)) {
s3.a = 3;
break t;
}
if (0 < b4) {
if (m4.ua = 1 << b4, !O2(m4.Wa, b4)) {
s3.a = 1, u4 = 0;
break t;
}
} else
m4.ua = 0;
var de3 = s3, pe3 = f4, ge3 = p4, me3 = de3.s, ve3 = me3.xc;
if (de3.c = pe3, de3.i = ge3, me3.md = q2(pe3, ve3), me3.wc = 0 == ve3 ? -1 : (1 << ve3) - 1, n3) {
s3.xb = pi2;
break t;
}
if (null == (v5 = a2(f4 * p4))) {
s3.a = 1, u4 = 0;
break t;
}
u4 = (u4 = _t2(s3, v5, 0, f4, p4, p4, null)) && !g4.h;
break t;
}
return u4 ? (null != c4 ? c4[0] = v5 : (e7(null == v5), e7(n3)), s3.$ = 0, n3 || Pt2(m4)) : Pt2(m4), u4;
}
function Ft2(t7, r3) {
var n3 = t7.c * t7.i, i3 = n3 + r3 + 16 * r3;
return e7(t7.c <= r3), t7.V = a2(i3), null == t7.V ? (t7.Ta = null, t7.Ua = 0, t7.a = 1, 0) : (t7.Ta = t7.V, t7.Ua = t7.Ba + n3 + r3, 1);
}
function Ct2(t7, r3) {
var n3 = t7.C, i3 = r3 - n3, a3 = t7.V, o3 = t7.Ba + t7.c * n3;
for (e7(r3 <= t7.l.o); 0 < i3; ) {
var s3 = 16 < i3 ? 16 : i3, c4 = t7.l.ma, u4 = t7.l.width, h4 = u4 * s3, l4 = c4.ca, f4 = c4.tb + u4 * n3, d4 = t7.Ta, p4 = t7.Ua;
Nt2(t7, s3, a3, o3), _n2(d4, p4, l4, f4, h4), xt2(c4, n3, n3 + s3, l4, f4, u4), i3 -= s3, a3 += s3 * t7.c, n3 += s3;
}
e7(n3 == r3), t7.C = t7.Ma = r3;
}
function jt2() {
this.ub = this.yd = this.td = this.Rb = 0;
}
function Ot2() {
this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;
}
function Bt2() {
this.Fb = this.Bb = this.Cb = 0, this.Zb = a2(4), this.Lb = a2(4);
}
function Mt2() {
this.Yb = function() {
var t7 = [];
return function t8(e8, r3, n3) {
for (var i3 = n3[r3], a3 = 0; a3 < i3 && (e8.push(n3.length > r3 + 1 ? [] : 0), !(n3.length < r3 + 1)); a3++)
t8(e8[a3], r3 + 1, n3);
}(t7, 0, [3, 11]), t7;
}();
}
function Et2() {
this.jb = a2(3), this.Wc = s2([4, 8], Mt2), this.Xc = s2([4, 17], Mt2);
}
function qt2() {
this.Pc = this.wb = this.Tb = this.zd = 0, this.vd = new a2(4), this.od = new a2(4);
}
function Dt2() {
this.ld = this.La = this.dd = this.tc = 0;
}
function Rt2() {
this.Na = this.la = 0;
}
function Tt2() {
this.Sc = [0, 0], this.Eb = [0, 0], this.Qc = [0, 0], this.ia = this.lc = 0;
}
function Ut2() {
this.ad = a2(384), this.Za = 0, this.Ob = a2(16), this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;
}
function zt2() {
this.uc = this.M = this.Nb = 0, this.wa = Array(new Dt2()), this.Y = 0, this.ya = Array(new Ut2()), this.aa = 0, this.l = new Gt2();
}
function Ht2() {
this.y = a2(16), this.f = a2(8), this.ea = a2(8);
}
function Wt2() {
this.cb = this.a = 0, this.sc = "", this.m = new w3(), this.Od = new jt2(), this.Kc = new Ot2(), this.ed = new qt2(), this.Qa = new Bt2(), this.Ic = this.$c = this.Aa = 0, this.D = new zt2(), this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0, this.Jc = o2(8, w3), this.ia = 0, this.pb = o2(4, Tt2), this.Pa = new Et2(), this.Bd = this.kc = 0, this.Ac = [], this.Bc = 0, this.zc = [0, 0, 0, 0], this.Gd = Array(new Ht2()), this.Hd = 0, this.rb = Array(new Rt2()), this.sb = 0, this.wa = Array(new Dt2()), this.Y = 0, this.oc = [], this.pc = 0, this.sa = [], this.ta = 0, this.qa = [], this.ra = 0, this.Ha = [], this.B = this.R = this.Ia = 0, this.Ec = [], this.M = this.ja = this.Vb = this.Fc = 0, this.ya = Array(new Ut2()), this.L = this.aa = 0, this.gd = s2([4, 2], Dt2), this.ga = null, this.Fa = [], this.Cc = this.qc = this.P = 0, this.Gb = [], this.Uc = 0, this.mb = [], this.nb = 0, this.rc = [], this.Ga = this.Vc = 0;
}
function Vt2(t7, e8) {
return 0 > t7 ? 0 : t7 > e8 ? e8 : t7;
}
function Gt2() {
this.T = this.U = this.ka = this.height = this.width = 0, this.y = [], this.f = [], this.ea = [], this.Rc = this.fa = this.W = this.N = this.O = 0, this.ma = "void", this.put = "VP8IoPutHook", this.ac = "VP8IoSetupHook", this.bc = "VP8IoTeardownHook", this.ha = this.Kb = 0, this.data = [], this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0, this.F = [], this.J = 0;
}
function Yt2() {
var t7 = new Wt2();
return null != t7 && (t7.a = 0, t7.sc = "OK", t7.cb = 0, t7.Xb = 0, ni2 || (ni2 = Zt2)), t7;
}
function Jt2(t7, e8, r3) {
return 0 == t7.a && (t7.a = e8, t7.sc = r3, t7.cb = 0), 0;
}
function Xt2(t7, e8, r3) {
return 3 <= r3 && 157 == t7[e8 + 0] && 1 == t7[e8 + 1] && 42 == t7[e8 + 2];
}
function Kt2(t7, r3) {
if (null == t7)
return 0;
if (t7.a = 0, t7.sc = "OK", null == r3)
return Jt2(t7, 2, "null VP8Io passed to VP8GetHeaders()");
var n3 = r3.data, a3 = r3.w, o3 = r3.ha;
if (4 > o3)
return Jt2(t7, 7, "Truncated header.");
var s3 = n3[a3 + 0] | n3[a3 + 1] << 8 | n3[a3 + 2] << 16, c4 = t7.Od;
if (c4.Rb = !(1 & s3), c4.td = s3 >> 1 & 7, c4.yd = s3 >> 4 & 1, c4.ub = s3 >> 5, 3 < c4.td)
return Jt2(t7, 3, "Incorrect keyframe parameters.");
if (!c4.yd)
return Jt2(t7, 4, "Frame not displayable.");
a3 += 3, o3 -= 3;
var u4 = t7.Kc;
if (c4.Rb) {
if (7 > o3)
return Jt2(t7, 7, "cannot parse picture header");
if (!Xt2(n3, a3, o3))
return Jt2(t7, 3, "Bad code word");
u4.c = 16383 & (n3[a3 + 4] << 8 | n3[a3 + 3]), u4.Td = n3[a3 + 4] >> 6, u4.i = 16383 & (n3[a3 + 6] << 8 | n3[a3 + 5]), u4.Ud = n3[a3 + 6] >> 6, a3 += 7, o3 -= 7, t7.za = u4.c + 15 >> 4, t7.Ub = u4.i + 15 >> 4, r3.width = u4.c, r3.height = u4.i, r3.Da = 0, r3.j = 0, r3.v = 0, r3.va = r3.width, r3.o = r3.height, r3.da = 0, r3.ib = r3.width, r3.hb = r3.height, r3.U = r3.width, r3.T = r3.height, i2((s3 = t7.Pa).jb, 0, 255, s3.jb.length), e7(null != (s3 = t7.Qa)), s3.Cb = 0, s3.Bb = 0, s3.Fb = 1, i2(s3.Zb, 0, 0, s3.Zb.length), i2(s3.Lb, 0, 0, s3.Lb);
}
if (c4.ub > o3)
return Jt2(t7, 7, "bad partition length");
p3(s3 = t7.m, n3, a3, c4.ub), a3 += c4.ub, o3 -= c4.ub, c4.Rb && (u4.Ld = P2(s3), u4.Kd = P2(s3)), u4 = t7.Qa;
var h4, l4 = t7.Pa;
if (e7(null != s3), e7(null != u4), u4.Cb = P2(s3), u4.Cb) {
if (u4.Bb = P2(s3), P2(s3)) {
for (u4.Fb = P2(s3), h4 = 0; 4 > h4; ++h4)
u4.Zb[h4] = P2(s3) ? m3(s3, 7) : 0;
for (h4 = 0; 4 > h4; ++h4)
u4.Lb[h4] = P2(s3) ? m3(s3, 6) : 0;
}
if (u4.Bb)
for (h4 = 0; 3 > h4; ++h4)
l4.jb[h4] = P2(s3) ? g3(s3, 8) : 255;
} else
u4.Bb = 0;
if (s3.Ka)
return Jt2(t7, 3, "cannot parse segment header");
if ((u4 = t7.ed).zd = P2(s3), u4.Tb = g3(s3, 6), u4.wb = g3(s3, 3), u4.Pc = P2(s3), u4.Pc && P2(s3)) {
for (l4 = 0; 4 > l4; ++l4)
P2(s3) && (u4.vd[l4] = m3(s3, 6));
for (l4 = 0; 4 > l4; ++l4)
P2(s3) && (u4.od[l4] = m3(s3, 6));
}
if (t7.L = 0 == u4.Tb ? 0 : u4.zd ? 1 : 2, s3.Ka)
return Jt2(t7, 3, "cannot parse filter header");
var f4 = o3;
if (o3 = h4 = a3, a3 = h4 + f4, u4 = f4, t7.Xb = (1 << g3(t7.m, 2)) - 1, f4 < 3 * (l4 = t7.Xb))
n3 = 7;
else {
for (h4 += 3 * l4, u4 -= 3 * l4, f4 = 0; f4 < l4; ++f4) {
var d4 = n3[o3 + 0] | n3[o3 + 1] << 8 | n3[o3 + 2] << 16;
d4 > u4 && (d4 = u4), p3(t7.Jc[+f4], n3, h4, d4), h4 += d4, u4 -= d4, o3 += 3;
}
p3(t7.Jc[+l4], n3, h4, u4), n3 = h4 < a3 ? 0 : 5;
}
if (0 != n3)
return Jt2(t7, n3, "cannot parse partitions");
for (n3 = g3(h4 = t7.m, 7), o3 = P2(h4) ? m3(h4, 4) : 0, a3 = P2(h4) ? m3(h4, 4) : 0, u4 = P2(h4) ? m3(h4, 4) : 0, l4 = P2(h4) ? m3(h4, 4) : 0, h4 = P2(h4) ? m3(h4, 4) : 0, f4 = t7.Qa, d4 = 0; 4 > d4; ++d4) {
if (f4.Cb) {
var v5 = f4.Zb[d4];
f4.Fb || (v5 += n3);
} else {
if (0 < d4) {
t7.pb[d4] = t7.pb[0];
continue;
}
v5 = n3;
}
var b4 = t7.pb[d4];
b4.Sc[0] = ei2[Vt2(v5 + o3, 127)], b4.Sc[1] = ri2[Vt2(v5 + 0, 127)], b4.Eb[0] = 2 * ei2[Vt2(v5 + a3, 127)], b4.Eb[1] = 101581 * ri2[Vt2(v5 + u4, 127)] >> 16, 8 > b4.Eb[1] && (b4.Eb[1] = 8), b4.Qc[0] = ei2[Vt2(v5 + l4, 117)], b4.Qc[1] = ri2[Vt2(v5 + h4, 127)], b4.lc = v5 + h4;
}
if (!c4.Rb)
return Jt2(t7, 4, "Not a key frame.");
for (P2(s3), c4 = t7.Pa, n3 = 0; 4 > n3; ++n3) {
for (o3 = 0; 8 > o3; ++o3)
for (a3 = 0; 3 > a3; ++a3)
for (u4 = 0; 11 > u4; ++u4)
l4 = k2(s3, ui2[n3][o3][a3][u4]) ? g3(s3, 8) : si2[n3][o3][a3][u4], c4.Wc[n3][o3].Yb[a3][u4] = l4;
for (o3 = 0; 17 > o3; ++o3)
c4.Xc[n3][o3] = c4.Wc[n3][hi2[o3]];
}
return t7.kc = P2(s3), t7.kc && (t7.Bd = g3(s3, 8)), t7.cb = 1;
}
function Zt2(t7, e8, r3, n3, i3, a3, o3) {
var s3 = e8[i3].Yb[r3];
for (r3 = 0; 16 > i3; ++i3) {
if (!k2(t7, s3[r3 + 0]))
return i3;
for (; !k2(t7, s3[r3 + 1]); )
if (s3 = e8[++i3].Yb[0], r3 = 0, 16 == i3)
return 16;
var c4 = e8[i3 + 1].Yb;
if (k2(t7, s3[r3 + 2])) {
var u4 = t7, h4 = 0;
if (k2(u4, (f4 = s3)[(l4 = r3) + 3]))
if (k2(u4, f4[l4 + 6])) {
for (s3 = 0, l4 = 2 * (h4 = k2(u4, f4[l4 + 8])) + (f4 = k2(u4, f4[l4 + 9 + h4])), h4 = 0, f4 = ii2[l4]; f4[s3]; ++s3)
h4 += h4 + k2(u4, f4[s3]);
h4 += 3 + (8 << l4);
} else
k2(u4, f4[l4 + 7]) ? (h4 = 7 + 2 * k2(u4, 165), h4 += k2(u4, 145)) : h4 = 5 + k2(u4, 159);
else
h4 = k2(u4, f4[l4 + 4]) ? 3 + k2(u4, f4[l4 + 5]) : 2;
s3 = c4[2];
} else
h4 = 1, s3 = c4[1];
c4 = o3 + ai2[i3], 0 > (u4 = t7).b && _24(u4);
var l4, f4 = u4.b, d4 = (l4 = u4.Ca >> 1) - (u4.I >> f4) >> 31;
--u4.b, u4.Ca += d4, u4.Ca |= 1, u4.I -= (l4 + 1 & d4) << f4, a3[c4] = ((h4 ^ d4) - d4) * n3[(0 < i3) + 0];
}
return 16;
}
function $t2(t7) {
var e8 = t7.rb[t7.sb - 1];
e8.la = 0, e8.Na = 0, i2(t7.zc, 0, 0, t7.zc.length), t7.ja = 0;
}
function Qt2(t7, r3) {
if (null == t7)
return 0;
if (null == r3)
return Jt2(t7, 2, "NULL VP8Io parameter in VP8Decode().");
if (!t7.cb && !Kt2(t7, r3))
return 0;
if (e7(t7.cb), null == r3.ac || r3.ac(r3)) {
r3.ob && (t7.L = 0);
var s3 = Ri2[t7.L];
if (2 == t7.L ? (t7.yb = 0, t7.zb = 0) : (t7.yb = r3.v - s3 >> 4, t7.zb = r3.j - s3 >> 4, 0 > t7.yb && (t7.yb = 0), 0 > t7.zb && (t7.zb = 0)), t7.Va = r3.o + 15 + s3 >> 4, t7.Hb = r3.va + 15 + s3 >> 4, t7.Hb > t7.za && (t7.Hb = t7.za), t7.Va > t7.Ub && (t7.Va = t7.Ub), 0 < t7.L) {
var c4 = t7.ed;
for (s3 = 0; 4 > s3; ++s3) {
var u4;
if (t7.Qa.Cb) {
var h4 = t7.Qa.Lb[s3];
t7.Qa.Fb || (h4 += c4.Tb);
} else
h4 = c4.Tb;
for (u4 = 0; 1 >= u4; ++u4) {
var l4 = t7.gd[s3][u4], f4 = h4;
if (c4.Pc && (f4 += c4.vd[0], u4 && (f4 += c4.od[0])), 0 < (f4 = 0 > f4 ? 0 : 63 < f4 ? 63 : f4)) {
var d4 = f4;
0 < c4.wb && ((d4 = 4 < c4.wb ? d4 >> 2 : d4 >> 1) > 9 - c4.wb && (d4 = 9 - c4.wb)), 1 > d4 && (d4 = 1), l4.dd = d4, l4.tc = 2 * f4 + d4, l4.ld = 40 <= f4 ? 2 : 15 <= f4 ? 1 : 0;
} else
l4.tc = 0;
l4.La = u4;
}
}
}
s3 = 0;
} else
Jt2(t7, 6, "Frame setup failed"), s3 = t7.a;
if (s3 = 0 == s3) {
if (s3) {
t7.$c = 0, 0 < t7.Aa || (t7.Ic = Ui2);
t: {
s3 = t7.Ic;
c4 = 4 * (d4 = t7.za);
var p4 = 32 * d4, g4 = d4 + 1, m4 = 0 < t7.L ? d4 * (0 < t7.Aa ? 2 : 1) : 0, v5 = (2 == t7.Aa ? 2 : 1) * d4;
if ((l4 = c4 + 832 + (u4 = 3 * (16 * s3 + Ri2[t7.L]) / 2 * p4) + (h4 = null != t7.Fa && 0 < t7.Fa.length ? t7.Kc.c * t7.Kc.i : 0)) != l4)
s3 = 0;
else {
if (l4 > t7.Vb) {
if (t7.Vb = 0, t7.Ec = a2(l4), t7.Fc = 0, null == t7.Ec) {
s3 = Jt2(t7, 1, "no memory during frame initialization.");
break t;
}
t7.Vb = l4;
}
l4 = t7.Ec, f4 = t7.Fc, t7.Ac = l4, t7.Bc = f4, f4 += c4, t7.Gd = o2(p4, Ht2), t7.Hd = 0, t7.rb = o2(g4 + 1, Rt2), t7.sb = 1, t7.wa = m4 ? o2(m4, Dt2) : null, t7.Y = 0, t7.D.Nb = 0, t7.D.wa = t7.wa, t7.D.Y = t7.Y, 0 < t7.Aa && (t7.D.Y += d4), e7(true), t7.oc = l4, t7.pc = f4, f4 += 832, t7.ya = o2(v5, Ut2), t7.aa = 0, t7.D.ya = t7.ya, t7.D.aa = t7.aa, 2 == t7.Aa && (t7.D.aa += d4), t7.R = 16 * d4, t7.B = 8 * d4, d4 = (p4 = Ri2[t7.L]) * t7.R, p4 = p4 / 2 * t7.B, t7.sa = l4, t7.ta = f4 + d4, t7.qa = t7.sa, t7.ra = t7.ta + 16 * s3 * t7.R + p4, t7.Ha = t7.qa, t7.Ia = t7.ra + 8 * s3 * t7.B + p4, t7.$c = 0, f4 += u4, t7.mb = h4 ? l4 : null, t7.nb = h4 ? f4 : null, e7(f4 + h4 <= t7.Fc + t7.Vb), $t2(t7), i2(t7.Ac, t7.Bc, 0, c4), s3 = 1;
}
}
if (s3) {
if (r3.ka = 0, r3.y = t7.sa, r3.O = t7.ta, r3.f = t7.qa, r3.N = t7.ra, r3.ea = t7.Ha, r3.Vd = t7.Ia, r3.fa = t7.R, r3.Rc = t7.B, r3.F = null, r3.J = 0, !Cn2) {
for (s3 = -255; 255 >= s3; ++s3)
Pn2[255 + s3] = 0 > s3 ? -s3 : s3;
for (s3 = -1020; 1020 >= s3; ++s3)
kn2[1020 + s3] = -128 > s3 ? -128 : 127 < s3 ? 127 : s3;
for (s3 = -112; 112 >= s3; ++s3)
In2[112 + s3] = -16 > s3 ? -16 : 15 < s3 ? 15 : s3;
for (s3 = -255; 510 >= s3; ++s3)
Fn2[255 + s3] = 0 > s3 ? 0 : 255 < s3 ? 255 : s3;
Cn2 = 1;
}
an2 = ue2, on2 = ae2, cn2 = oe2, un2 = se2, hn2 = ce2, sn2 = ie2, ln2 = Je2, fn8 = Xe2, dn2 = $e2, pn2 = Qe2, gn2 = Ke2, mn2 = Ze2, vn2 = tr2, bn2 = er2, yn2 = ze2, wn2 = He2, Nn2 = We2, Ln2 = Ve2, fi2[0] = xe2, fi2[1] = le2, fi2[2] = Le2, fi2[3] = Ae2, fi2[4] = Se2, fi2[5] = Pe2, fi2[6] = _e2, fi2[7] = ke2, fi2[8] = Fe2, fi2[9] = Ie2, li2[0] = ve2, li2[1] = de2, li2[2] = pe2, li2[3] = ge2, li2[4] = be2, li2[5] = ye2, li2[6] = we2, di2[0] = Be2, di2[1] = fe2, di2[2] = Ce2, di2[3] = je2, di2[4] = Ee2, di2[5] = Me2, di2[6] = qe2, s3 = 1;
} else
s3 = 0;
}
s3 && (s3 = function(t8, r4) {
for (t8.M = 0; t8.M < t8.Va; ++t8.M) {
var o3, s4 = t8.Jc[t8.M & t8.Xb], c5 = t8.m, u5 = t8;
for (o3 = 0; o3 < u5.za; ++o3) {
var h5 = c5, l5 = u5, f5 = l5.Ac, d5 = l5.Bc + 4 * o3, p5 = l5.zc, g5 = l5.ya[l5.aa + o3];
if (l5.Qa.Bb ? g5.$b = k2(h5, l5.Pa.jb[0]) ? 2 + k2(h5, l5.Pa.jb[2]) : k2(h5, l5.Pa.jb[1]) : g5.$b = 0, l5.kc && (g5.Ad = k2(h5, l5.Bd)), g5.Za = !k2(h5, 145) + 0, g5.Za) {
var m5 = g5.Ob, v6 = 0;
for (l5 = 0; 4 > l5; ++l5) {
var b4, y4 = p5[0 + l5];
for (b4 = 0; 4 > b4; ++b4) {
y4 = ci2[f5[d5 + b4]][y4];
for (var w4 = oi2[k2(h5, y4[0])]; 0 < w4; )
w4 = oi2[2 * w4 + k2(h5, y4[w4])];
y4 = -w4, f5[d5 + b4] = y4;
}
n2(m5, v6, f5, d5, 4), v6 += 4, p5[0 + l5] = y4;
}
} else
y4 = k2(h5, 156) ? k2(h5, 128) ? 1 : 3 : k2(h5, 163) ? 2 : 0, g5.Ob[0] = y4, i2(f5, d5, y4, 4), i2(p5, 0, y4, 4);
g5.Dd = k2(h5, 142) ? k2(h5, 114) ? k2(h5, 183) ? 1 : 3 : 2 : 0;
}
if (u5.m.Ka)
return Jt2(t8, 7, "Premature end-of-partition0 encountered.");
for (; t8.ja < t8.za; ++t8.ja) {
if (u5 = s4, h5 = (c5 = t8).rb[c5.sb - 1], f5 = c5.rb[c5.sb + c5.ja], o3 = c5.ya[c5.aa + c5.ja], d5 = c5.kc ? o3.Ad : 0)
h5.la = f5.la = 0, o3.Za || (h5.Na = f5.Na = 0), o3.Hc = 0, o3.Gc = 0, o3.ia = 0;
else {
var N4, L4;
h5 = f5, f5 = u5, d5 = c5.Pa.Xc, p5 = c5.ya[c5.aa + c5.ja], g5 = c5.pb[p5.$b];
if (l5 = p5.ad, m5 = 0, v6 = c5.rb[c5.sb - 1], y4 = b4 = 0, i2(l5, m5, 0, 384), p5.Za)
var A7 = 0, x3 = d5[3];
else {
w4 = a2(16);
var S3 = h5.Na + v6.Na;
if (S3 = ni2(f5, d5[1], S3, g5.Eb, 0, w4, 0), h5.Na = v6.Na = (0 < S3) + 0, 1 < S3)
an2(w4, 0, l5, m5);
else {
var _25 = w4[0] + 3 >> 3;
for (w4 = 0; 256 > w4; w4 += 16)
l5[m5 + w4] = _25;
}
A7 = 1, x3 = d5[0];
}
var P3 = 15 & h5.la, I3 = 15 & v6.la;
for (w4 = 0; 4 > w4; ++w4) {
var F3 = 1 & I3;
for (_25 = L4 = 0; 4 > _25; ++_25)
P3 = P3 >> 1 | (F3 = (S3 = ni2(f5, x3, S3 = F3 + (1 & P3), g5.Sc, A7, l5, m5)) > A7) << 7, L4 = L4 << 2 | (3 < S3 ? 3 : 1 < S3 ? 2 : 0 != l5[m5 + 0]), m5 += 16;
P3 >>= 4, I3 = I3 >> 1 | F3 << 7, b4 = (b4 << 8 | L4) >>> 0;
}
for (x3 = P3, A7 = I3 >> 4, N4 = 0; 4 > N4; N4 += 2) {
for (L4 = 0, P3 = h5.la >> 4 + N4, I3 = v6.la >> 4 + N4, w4 = 0; 2 > w4; ++w4) {
for (F3 = 1 & I3, _25 = 0; 2 > _25; ++_25)
S3 = F3 + (1 & P3), P3 = P3 >> 1 | (F3 = 0 < (S3 = ni2(f5, d5[2], S3, g5.Qc, 0, l5, m5))) << 3, L4 = L4 << 2 | (3 < S3 ? 3 : 1 < S3 ? 2 : 0 != l5[m5 + 0]), m5 += 16;
P3 >>= 2, I3 = I3 >> 1 | F3 << 5;
}
y4 |= L4 << 4 * N4, x3 |= P3 << 4 << N4, A7 |= (240 & I3) << N4;
}
h5.la = x3, v6.la = A7, p5.Hc = b4, p5.Gc = y4, p5.ia = 43690 & y4 ? 0 : g5.ia, d5 = !(b4 | y4);
}
if (0 < c5.L && (c5.wa[c5.Y + c5.ja] = c5.gd[o3.$b][o3.Za], c5.wa[c5.Y + c5.ja].La |= !d5), u5.Ka)
return Jt2(t8, 7, "Premature end-of-file encountered.");
}
if ($t2(t8), c5 = r4, u5 = 1, o3 = (s4 = t8).D, h5 = 0 < s4.L && s4.M >= s4.zb && s4.M <= s4.Va, 0 == s4.Aa)
t: {
if (o3.M = s4.M, o3.uc = h5, Or2(s4, o3), u5 = 1, o3 = (L4 = s4.D).Nb, h5 = (y4 = Ri2[s4.L]) * s4.R, f5 = y4 / 2 * s4.B, w4 = 16 * o3 * s4.R, _25 = 8 * o3 * s4.B, d5 = s4.sa, p5 = s4.ta - h5 + w4, g5 = s4.qa, l5 = s4.ra - f5 + _25, m5 = s4.Ha, v6 = s4.Ia - f5 + _25, I3 = 0 == (P3 = L4.M), b4 = P3 >= s4.Va - 1, 2 == s4.Aa && Or2(s4, L4), L4.uc)
for (F3 = (S3 = s4).D.M, e7(S3.D.uc), L4 = S3.yb; L4 < S3.Hb; ++L4) {
A7 = L4, x3 = F3;
var C4 = (j3 = (U3 = S3).D).Nb;
N4 = U3.R;
var j3 = j3.wa[j3.Y + A7], O3 = U3.sa, B4 = U3.ta + 16 * C4 * N4 + 16 * A7, M3 = j3.dd, E3 = j3.tc;
if (0 != E3)
if (e7(3 <= E3), 1 == U3.L)
0 < A7 && wn2(O3, B4, N4, E3 + 4), j3.La && Ln2(O3, B4, N4, E3), 0 < x3 && yn2(O3, B4, N4, E3 + 4), j3.La && Nn2(O3, B4, N4, E3);
else {
var q3 = U3.B, D3 = U3.qa, R3 = U3.ra + 8 * C4 * q3 + 8 * A7, T3 = U3.Ha, U3 = U3.Ia + 8 * C4 * q3 + 8 * A7;
C4 = j3.ld;
0 < A7 && (fn8(O3, B4, N4, E3 + 4, M3, C4), pn2(D3, R3, T3, U3, q3, E3 + 4, M3, C4)), j3.La && (mn2(O3, B4, N4, E3, M3, C4), bn2(D3, R3, T3, U3, q3, E3, M3, C4)), 0 < x3 && (ln2(O3, B4, N4, E3 + 4, M3, C4), dn2(D3, R3, T3, U3, q3, E3 + 4, M3, C4)), j3.La && (gn2(O3, B4, N4, E3, M3, C4), vn2(D3, R3, T3, U3, q3, E3, M3, C4));
}
}
if (s4.ia && alert("todo:DitherRow"), null != c5.put) {
if (L4 = 16 * P3, P3 = 16 * (P3 + 1), I3 ? (c5.y = s4.sa, c5.O = s4.ta + w4, c5.f = s4.qa, c5.N = s4.ra + _25, c5.ea = s4.Ha, c5.W = s4.Ia + _25) : (L4 -= y4, c5.y = d5, c5.O = p5, c5.f = g5, c5.N = l5, c5.ea = m5, c5.W = v6), b4 || (P3 -= y4), P3 > c5.o && (P3 = c5.o), c5.F = null, c5.J = null, null != s4.Fa && 0 < s4.Fa.length && L4 < P3 && (c5.J = lr2(s4, c5, L4, P3 - L4), c5.F = s4.mb, null == c5.F && 0 == c5.F.length)) {
u5 = Jt2(s4, 3, "Could not decode alpha data.");
break t;
}
L4 < c5.j && (y4 = c5.j - L4, L4 = c5.j, e7(!(1 & y4)), c5.O += s4.R * y4, c5.N += s4.B * (y4 >> 1), c5.W += s4.B * (y4 >> 1), null != c5.F && (c5.J += c5.width * y4)), L4 < P3 && (c5.O += c5.v, c5.N += c5.v >> 1, c5.W += c5.v >> 1, null != c5.F && (c5.J += c5.v), c5.ka = L4 - c5.j, c5.U = c5.va - c5.v, c5.T = P3 - L4, u5 = c5.put(c5));
}
o3 + 1 != s4.Ic || b4 || (n2(s4.sa, s4.ta - h5, d5, p5 + 16 * s4.R, h5), n2(s4.qa, s4.ra - f5, g5, l5 + 8 * s4.B, f5), n2(s4.Ha, s4.Ia - f5, m5, v6 + 8 * s4.B, f5));
}
if (!u5)
return Jt2(t8, 6, "Output aborted.");
}
return 1;
}(t7, r3)), null != r3.bc && r3.bc(r3), s3 &= 1;
}
return s3 ? (t7.cb = 0, s3) : 0;
}
function te2(t7, e8, r3, n3, i3) {
i3 = t7[e8 + r3 + 32 * n3] + (i3 >> 3), t7[e8 + r3 + 32 * n3] = -256 & i3 ? 0 > i3 ? 0 : 255 : i3;
}
function ee2(t7, e8, r3, n3, i3, a3) {
te2(t7, e8, 0, r3, n3 + i3), te2(t7, e8, 1, r3, n3 + a3), te2(t7, e8, 2, r3, n3 - a3), te2(t7, e8, 3, r3, n3 - i3);
}
function re2(t7) {
return (20091 * t7 >> 16) + t7;
}
function ne2(t7, e8, r3, n3) {
var i3, o3 = 0, s3 = a2(16);
for (i3 = 0; 4 > i3; ++i3) {
var c4 = t7[e8 + 0] + t7[e8 + 8], u4 = t7[e8 + 0] - t7[e8 + 8], h4 = (35468 * t7[e8 + 4] >> 16) - re2(t7[e8 + 12]), l4 = re2(t7[e8 + 4]) + (35468 * t7[e8 + 12] >> 16);
s3[o3 + 0] = c4 + l4, s3[o3 + 1] = u4 + h4, s3[o3 + 2] = u4 - h4, s3[o3 + 3] = c4 - l4, o3 += 4, e8++;
}
for (i3 = o3 = 0; 4 > i3; ++i3)
c4 = (t7 = s3[o3 + 0] + 4) + s3[o3 + 8], u4 = t7 - s3[o3 + 8], h4 = (35468 * s3[o3 + 4] >> 16) - re2(s3[o3 + 12]), te2(r3, n3, 0, 0, c4 + (l4 = re2(s3[o3 + 4]) + (35468 * s3[o3 + 12] >> 16))), te2(r3, n3, 1, 0, u4 + h4), te2(r3, n3, 2, 0, u4 - h4), te2(r3, n3, 3, 0, c4 - l4), o3++, n3 += 32;
}
function ie2(t7, e8, r3, n3) {
var i3 = t7[e8 + 0] + 4, a3 = 35468 * t7[e8 + 4] >> 16, o3 = re2(t7[e8 + 4]), s3 = 35468 * t7[e8 + 1] >> 16;
ee2(r3, n3, 0, i3 + o3, t7 = re2(t7[e8 + 1]), s3), ee2(r3, n3, 1, i3 + a3, t7, s3), ee2(r3, n3, 2, i3 - a3, t7, s3), ee2(r3, n3, 3, i3 - o3, t7, s3);
}
function ae2(t7, e8, r3, n3, i3) {
ne2(t7, e8, r3, n3), i3 && ne2(t7, e8 + 16, r3, n3 + 4);
}
function oe2(t7, e8, r3, n3) {
on2(t7, e8 + 0, r3, n3, 1), on2(t7, e8 + 32, r3, n3 + 128, 1);
}
function se2(t7, e8, r3, n3) {
var i3;
for (t7 = t7[e8 + 0] + 4, i3 = 0; 4 > i3; ++i3)
for (e8 = 0; 4 > e8; ++e8)
te2(r3, n3, e8, i3, t7);
}
function ce2(t7, e8, r3, n3) {
t7[e8 + 0] && un2(t7, e8 + 0, r3, n3), t7[e8 + 16] && un2(t7, e8 + 16, r3, n3 + 4), t7[e8 + 32] && un2(t7, e8 + 32, r3, n3 + 128), t7[e8 + 48] && un2(t7, e8 + 48, r3, n3 + 128 + 4);
}
function ue2(t7, e8, r3, n3) {
var i3, o3 = a2(16);
for (i3 = 0; 4 > i3; ++i3) {
var s3 = t7[e8 + 0 + i3] + t7[e8 + 12 + i3], c4 = t7[e8 + 4 + i3] + t7[e8 + 8 + i3], u4 = t7[e8 + 4 + i3] - t7[e8 + 8 + i3], h4 = t7[e8 + 0 + i3] - t7[e8 + 12 + i3];
o3[0 + i3] = s3 + c4, o3[8 + i3] = s3 - c4, o3[4 + i3] = h4 + u4, o3[12 + i3] = h4 - u4;
}
for (i3 = 0; 4 > i3; ++i3)
s3 = (t7 = o3[0 + 4 * i3] + 3) + o3[3 + 4 * i3], c4 = o3[1 + 4 * i3] + o3[2 + 4 * i3], u4 = o3[1 + 4 * i3] - o3[2 + 4 * i3], h4 = t7 - o3[3 + 4 * i3], r3[n3 + 0] = s3 + c4 >> 3, r3[n3 + 16] = h4 + u4 >> 3, r3[n3 + 32] = s3 - c4 >> 3, r3[n3 + 48] = h4 - u4 >> 3, n3 += 64;
}
function he2(t7, e8, r3) {
var n3, i3 = e8 - 32, a3 = Bn2, o3 = 255 - t7[i3 - 1];
for (n3 = 0; n3 < r3; ++n3) {
var s3, c4 = a3, u4 = o3 + t7[e8 - 1];
for (s3 = 0; s3 < r3; ++s3)
t7[e8 + s3] = c4[u4 + t7[i3 + s3]];
e8 += 32;
}
}
function le2(t7, e8) {
he2(t7, e8, 4);
}
function fe2(t7, e8) {
he2(t7, e8, 8);
}
function de2(t7, e8) {
he2(t7, e8, 16);
}
function pe2(t7, e8) {
var r3;
for (r3 = 0; 16 > r3; ++r3)
n2(t7, e8 + 32 * r3, t7, e8 - 32, 16);
}
function ge2(t7, e8) {
var r3;
for (r3 = 16; 0 < r3; --r3)
i2(t7, e8, t7[e8 - 1], 16), e8 += 32;
}
function me2(t7, e8, r3) {
var n3;
for (n3 = 0; 16 > n3; ++n3)
i2(e8, r3 + 32 * n3, t7, 16);
}
function ve2(t7, e8) {
var r3, n3 = 16;
for (r3 = 0; 16 > r3; ++r3)
n3 += t7[e8 - 1 + 32 * r3] + t7[e8 + r3 - 32];
me2(n3 >> 5, t7, e8);
}
function be2(t7, e8) {
var r3, n3 = 8;
for (r3 = 0; 16 > r3; ++r3)
n3 += t7[e8 - 1 + 32 * r3];
me2(n3 >> 4, t7, e8);
}
function ye2(t7, e8) {
var r3, n3 = 8;
for (r3 = 0; 16 > r3; ++r3)
n3 += t7[e8 + r3 - 32];
me2(n3 >> 4, t7, e8);
}
function we2(t7, e8) {
me2(128, t7, e8);
}
function Ne2(t7, e8, r3) {
return t7 + 2 * e8 + r3 + 2 >> 2;
}
function Le2(t7, e8) {
var r3, i3 = e8 - 32;
i3 = new Uint8Array([Ne2(t7[i3 - 1], t7[i3 + 0], t7[i3 + 1]), Ne2(t7[i3 + 0], t7[i3 + 1], t7[i3 + 2]), Ne2(t7[i3 + 1], t7[i3 + 2], t7[i3 + 3]), Ne2(t7[i3 + 2], t7[i3 + 3], t7[i3 + 4])]);
for (r3 = 0; 4 > r3; ++r3)
n2(t7, e8 + 32 * r3, i3, 0, i3.length);
}
function Ae2(t7, e8) {
var r3 = t7[e8 - 1], n3 = t7[e8 - 1 + 32], i3 = t7[e8 - 1 + 64], a3 = t7[e8 - 1 + 96];
I2(t7, e8 + 0, 16843009 * Ne2(t7[e8 - 1 - 32], r3, n3)), I2(t7, e8 + 32, 16843009 * Ne2(r3, n3, i3)), I2(t7, e8 + 64, 16843009 * Ne2(n3, i3, a3)), I2(t7, e8 + 96, 16843009 * Ne2(i3, a3, a3));
}
function xe2(t7, e8) {
var r3, n3 = 4;
for (r3 = 0; 4 > r3; ++r3)
n3 += t7[e8 + r3 - 32] + t7[e8 - 1 + 32 * r3];
for (n3 >>= 3, r3 = 0; 4 > r3; ++r3)
i2(t7, e8 + 32 * r3, n3, 4);
}
function Se2(t7, e8) {
var r3 = t7[e8 - 1 + 0], n3 = t7[e8 - 1 + 32], i3 = t7[e8 - 1 + 64], a3 = t7[e8 - 1 - 32], o3 = t7[e8 + 0 - 32], s3 = t7[e8 + 1 - 32], c4 = t7[e8 + 2 - 32], u4 = t7[e8 + 3 - 32];
t7[e8 + 0 + 96] = Ne2(n3, i3, t7[e8 - 1 + 96]), t7[e8 + 1 + 96] = t7[e8 + 0 + 64] = Ne2(r3, n3, i3), t7[e8 + 2 + 96] = t7[e8 + 1 + 64] = t7[e8 + 0 + 32] = Ne2(a3, r3, n3), t7[e8 + 3 + 96] = t7[e8 + 2 + 64] = t7[e8 + 1 + 32] = t7[e8 + 0 + 0] = Ne2(o3, a3, r3), t7[e8 + 3 + 64] = t7[e8 + 2 + 32] = t7[e8 + 1 + 0] = Ne2(s3, o3, a3), t7[e8 + 3 + 32] = t7[e8 + 2 + 0] = Ne2(c4, s3, o3), t7[e8 + 3 + 0] = Ne2(u4, c4, s3);
}
function _e2(t7, e8) {
var r3 = t7[e8 + 1 - 32], n3 = t7[e8 + 2 - 32], i3 = t7[e8 + 3 - 32], a3 = t7[e8 + 4 - 32], o3 = t7[e8 + 5 - 32], s3 = t7[e8 + 6 - 32], c4 = t7[e8 + 7 - 32];
t7[e8 + 0 + 0] = Ne2(t7[e8 + 0 - 32], r3, n3), t7[e8 + 1 + 0] = t7[e8 + 0 + 32] = Ne2(r3, n3, i3), t7[e8 + 2 + 0] = t7[e8 + 1 + 32] = t7[e8 + 0 + 64] = Ne2(n3, i3, a3), t7[e8 + 3 + 0] = t7[e8 + 2 + 32] = t7[e8 + 1 + 64] = t7[e8 + 0 + 96] = Ne2(i3, a3, o3), t7[e8 + 3 + 32] = t7[e8 + 2 + 64] = t7[e8 + 1 + 96] = Ne2(a3, o3, s3), t7[e8 + 3 + 64] = t7[e8 + 2 + 96] = Ne2(o3, s3, c4), t7[e8 + 3 + 96] = Ne2(s3, c4, c4);
}
function Pe2(t7, e8) {
var r3 = t7[e8 - 1 + 0], n3 = t7[e8 - 1 + 32], i3 = t7[e8 - 1 + 64], a3 = t7[e8 - 1 - 32], o3 = t7[e8 + 0 - 32], s3 = t7[e8 + 1 - 32], c4 = t7[e8 + 2 - 32], u4 = t7[e8 + 3 - 32];
t7[e8 + 0 + 0] = t7[e8 + 1 + 64] = a3 + o3 + 1 >> 1, t7[e8 + 1 + 0] = t7[e8 + 2 + 64] = o3 + s3 + 1 >> 1, t7[e8 + 2 + 0] = t7[e8 + 3 + 64] = s3 + c4 + 1 >> 1, t7[e8 + 3 + 0] = c4 + u4 + 1 >> 1, t7[e8 + 0 + 96] = Ne2(i3, n3, r3), t7[e8 + 0 + 64] = Ne2(n3, r3, a3), t7[e8 + 0 + 32] = t7[e8 + 1 + 96] = Ne2(r3, a3, o3), t7[e8 + 1 + 32] = t7[e8 + 2 + 96] = Ne2(a3, o3, s3), t7[e8 + 2 + 32] = t7[e8 + 3 + 96] = Ne2(o3, s3, c4), t7[e8 + 3 + 32] = Ne2(s3, c4, u4);
}
function ke2(t7, e8) {
var r3 = t7[e8 + 0 - 32], n3 = t7[e8 + 1 - 32], i3 = t7[e8 + 2 - 32], a3 = t7[e8 + 3 - 32], o3 = t7[e8 + 4 - 32], s3 = t7[e8 + 5 - 32], c4 = t7[e8 + 6 - 32], u4 = t7[e8 + 7 - 32];
t7[e8 + 0 + 0] = r3 + n3 + 1 >> 1, t7[e8 + 1 + 0] = t7[e8 + 0 + 64] = n3 + i3 + 1 >> 1, t7[e8 + 2 + 0] = t7[e8 + 1 + 64] = i3 + a3 + 1 >> 1, t7[e8 + 3 + 0] = t7[e8 + 2 + 64] = a3 + o3 + 1 >> 1, t7[e8 + 0 + 32] = Ne2(r3, n3, i3), t7[e8 + 1 + 32] = t7[e8 + 0 + 96] = Ne2(n3, i3, a3), t7[e8 + 2 + 32] = t7[e8 + 1 + 96] = Ne2(i3, a3, o3), t7[e8 + 3 + 32] = t7[e8 + 2 + 96] = Ne2(a3, o3, s3), t7[e8 + 3 + 64] = Ne2(o3, s3, c4), t7[e8 + 3 + 96] = Ne2(s3, c4, u4);
}
function Ie2(t7, e8) {
var r3 = t7[e8 - 1 + 0], n3 = t7[e8 - 1 + 32], i3 = t7[e8 - 1 + 64], a3 = t7[e8 - 1 + 96];
t7[e8 + 0 + 0] = r3 + n3 + 1 >> 1, t7[e8 + 2 + 0] = t7[e8 + 0 + 32] = n3 + i3 + 1 >> 1, t7[e8 + 2 + 32] = t7[e8 + 0 + 64] = i3 + a3 + 1 >> 1, t7[e8 + 1 + 0] = Ne2(r3, n3, i3), t7[e8 + 3 + 0] = t7[e8 + 1 + 32] = Ne2(n3, i3, a3), t7[e8 + 3 + 32] = t7[e8 + 1 + 64] = Ne2(i3, a3, a3), t7[e8 + 3 + 64] = t7[e8 + 2 + 64] = t7[e8 + 0 + 96] = t7[e8 + 1 + 96] = t7[e8 + 2 + 96] = t7[e8 + 3 + 96] = a3;
}
function Fe2(t7, e8) {
var r3 = t7[e8 - 1 + 0], n3 = t7[e8 - 1 + 32], i3 = t7[e8 - 1 + 64], a3 = t7[e8 - 1 + 96], o3 = t7[e8 - 1 - 32], s3 = t7[e8 + 0 - 32], c4 = t7[e8 + 1 - 32], u4 = t7[e8 + 2 - 32];
t7[e8 + 0 + 0] = t7[e8 + 2 + 32] = r3 + o3 + 1 >> 1, t7[e8 + 0 + 32] = t7[e8 + 2 + 64] = n3 + r3 + 1 >> 1, t7[e8 + 0 + 64] = t7[e8 + 2 + 96] = i3 + n3 + 1 >> 1, t7[e8 + 0 + 96] = a3 + i3 + 1 >> 1, t7[e8 + 3 + 0] = Ne2(s3, c4, u4), t7[e8 + 2 + 0] = Ne2(o3, s3, c4), t7[e8 + 1 + 0] = t7[e8 + 3 + 32] = Ne2(r3, o3, s3), t7[e8 + 1 + 32] = t7[e8 + 3 + 64] = Ne2(n3, r3, o3), t7[e8 + 1 + 64] = t7[e8 + 3 + 96] = Ne2(i3, n3, r3), t7[e8 + 1 + 96] = Ne2(a3, i3, n3);
}
function Ce2(t7, e8) {
var r3;
for (r3 = 0; 8 > r3; ++r3)
n2(t7, e8 + 32 * r3, t7, e8 - 32, 8);
}
function je2(t7, e8) {
var r3;
for (r3 = 0; 8 > r3; ++r3)
i2(t7, e8, t7[e8 - 1], 8), e8 += 32;
}
function Oe2(t7, e8, r3) {
var n3;
for (n3 = 0; 8 > n3; ++n3)
i2(e8, r3 + 32 * n3, t7, 8);
}
function Be2(t7, e8) {
var r3, n3 = 8;
for (r3 = 0; 8 > r3; ++r3)
n3 += t7[e8 + r3 - 32] + t7[e8 - 1 + 32 * r3];
Oe2(n3 >> 4, t7, e8);
}
function Me2(t7, e8) {
var r3, n3 = 4;
for (r3 = 0; 8 > r3; ++r3)
n3 += t7[e8 + r3 - 32];
Oe2(n3 >> 3, t7, e8);
}
function Ee2(t7, e8) {
var r3, n3 = 4;
for (r3 = 0; 8 > r3; ++r3)
n3 += t7[e8 - 1 + 32 * r3];
Oe2(n3 >> 3, t7, e8);
}
function qe2(t7, e8) {
Oe2(128, t7, e8);
}
function De2(t7, e8, r3) {
var n3 = t7[e8 - r3], i3 = t7[e8 + 0], a3 = 3 * (i3 - n3) + jn2[1020 + t7[e8 - 2 * r3] - t7[e8 + r3]], o3 = On2[112 + (a3 + 4 >> 3)];
t7[e8 - r3] = Bn2[255 + n3 + On2[112 + (a3 + 3 >> 3)]], t7[e8 + 0] = Bn2[255 + i3 - o3];
}
function Re2(t7, e8, r3, n3) {
var i3 = t7[e8 + 0], a3 = t7[e8 + r3];
return Mn2[255 + t7[e8 - 2 * r3] - t7[e8 - r3]] > n3 || Mn2[255 + a3 - i3] > n3;
}
function Te2(t7, e8, r3, n3) {
return 4 * Mn2[255 + t7[e8 - r3] - t7[e8 + 0]] + Mn2[255 + t7[e8 - 2 * r3] - t7[e8 + r3]] <= n3;
}
function Ue2(t7, e8, r3, n3, i3) {
var a3 = t7[e8 - 3 * r3], o3 = t7[e8 - 2 * r3], s3 = t7[e8 - r3], c4 = t7[e8 + 0], u4 = t7[e8 + r3], h4 = t7[e8 + 2 * r3], l4 = t7[e8 + 3 * r3];
return 4 * Mn2[255 + s3 - c4] + Mn2[255 + o3 - u4] > n3 ? 0 : Mn2[255 + t7[e8 - 4 * r3] - a3] <= i3 && Mn2[255 + a3 - o3] <= i3 && Mn2[255 + o3 - s3] <= i3 && Mn2[255 + l4 - h4] <= i3 && Mn2[255 + h4 - u4] <= i3 && Mn2[255 + u4 - c4] <= i3;
}
function ze2(t7, e8, r3, n3) {
var i3 = 2 * n3 + 1;
for (n3 = 0; 16 > n3; ++n3)
Te2(t7, e8 + n3, r3, i3) && De2(t7, e8 + n3, r3);
}
function He2(t7, e8, r3, n3) {
var i3 = 2 * n3 + 1;
for (n3 = 0; 16 > n3; ++n3)
Te2(t7, e8 + n3 * r3, 1, i3) && De2(t7, e8 + n3 * r3, 1);
}
function We2(t7, e8, r3, n3) {
var i3;
for (i3 = 3; 0 < i3; --i3)
ze2(t7, e8 += 4 * r3, r3, n3);
}
function Ve2(t7, e8, r3, n3) {
var i3;
for (i3 = 3; 0 < i3; --i3)
He2(t7, e8 += 4, r3, n3);
}
function Ge2(t7, e8, r3, n3, i3, a3, o3, s3) {
for (a3 = 2 * a3 + 1; 0 < i3--; ) {
if (Ue2(t7, e8, r3, a3, o3))
if (Re2(t7, e8, r3, s3))
De2(t7, e8, r3);
else {
var c4 = t7, u4 = e8, h4 = r3, l4 = c4[u4 - 2 * h4], f4 = c4[u4 - h4], d4 = c4[u4 + 0], p4 = c4[u4 + h4], g4 = c4[u4 + 2 * h4], m4 = 27 * (b4 = jn2[1020 + 3 * (d4 - f4) + jn2[1020 + l4 - p4]]) + 63 >> 7, v5 = 18 * b4 + 63 >> 7, b4 = 9 * b4 + 63 >> 7;
c4[u4 - 3 * h4] = Bn2[255 + c4[u4 - 3 * h4] + b4], c4[u4 - 2 * h4] = Bn2[255 + l4 + v5], c4[u4 - h4] = Bn2[255 + f4 + m4], c4[u4 + 0] = Bn2[255 + d4 - m4], c4[u4 + h4] = Bn2[255 + p4 - v5], c4[u4 + 2 * h4] = Bn2[255 + g4 - b4];
}
e8 += n3;
}
}
function Ye2(t7, e8, r3, n3, i3, a3, o3, s3) {
for (a3 = 2 * a3 + 1; 0 < i3--; ) {
if (Ue2(t7, e8, r3, a3, o3))
if (Re2(t7, e8, r3, s3))
De2(t7, e8, r3);
else {
var c4 = t7, u4 = e8, h4 = r3, l4 = c4[u4 - h4], f4 = c4[u4 + 0], d4 = c4[u4 + h4], p4 = On2[112 + ((g4 = 3 * (f4 - l4)) + 4 >> 3)], g4 = On2[112 + (g4 + 3 >> 3)], m4 = p4 + 1 >> 1;
c4[u4 - 2 * h4] = Bn2[255 + c4[u4 - 2 * h4] + m4], c4[u4 - h4] = Bn2[255 + l4 + g4], c4[u4 + 0] = Bn2[255 + f4 - p4], c4[u4 + h4] = Bn2[255 + d4 - m4];
}
e8 += n3;
}
}
function Je2(t7, e8, r3, n3, i3, a3) {
Ge2(t7, e8, r3, 1, 16, n3, i3, a3);
}
function Xe2(t7, e8, r3, n3, i3, a3) {
Ge2(t7, e8, 1, r3, 16, n3, i3, a3);
}
function Ke2(t7, e8, r3, n3, i3, a3) {
var o3;
for (o3 = 3; 0 < o3; --o3)
Ye2(t7, e8 += 4 * r3, r3, 1, 16, n3, i3, a3);
}
function Ze2(t7, e8, r3, n3, i3, a3) {
var o3;
for (o3 = 3; 0 < o3; --o3)
Ye2(t7, e8 += 4, 1, r3, 16, n3, i3, a3);
}
function $e2(t7, e8, r3, n3, i3, a3, o3, s3) {
Ge2(t7, e8, i3, 1, 8, a3, o3, s3), Ge2(r3, n3, i3, 1, 8, a3, o3, s3);
}
function Qe2(t7, e8, r3, n3, i3, a3, o3, s3) {
Ge2(t7, e8, 1, i3, 8, a3, o3, s3), Ge2(r3, n3, 1, i3, 8, a3, o3, s3);
}
function tr2(t7, e8, r3, n3, i3, a3, o3, s3) {
Ye2(t7, e8 + 4 * i3, i3, 1, 8, a3, o3, s3), Ye2(r3, n3 + 4 * i3, i3, 1, 8, a3, o3, s3);
}
function er2(t7, e8, r3, n3, i3, a3, o3, s3) {
Ye2(t7, e8 + 4, 1, i3, 8, a3, o3, s3), Ye2(r3, n3 + 4, 1, i3, 8, a3, o3, s3);
}
function rr2() {
this.ba = new ot2(), this.ec = [], this.cc = [], this.Mc = [], this.Dc = this.Nc = this.dc = this.fc = 0, this.Oa = new ct2(), this.memory = 0, this.Ib = "OutputFunc", this.Jb = "OutputAlphaFunc", this.Nd = "OutputRowFunc";
}
function nr2() {
this.data = [], this.offset = this.kd = this.ha = this.w = 0, this.na = [], this.xa = this.gb = this.Ja = this.Sa = this.P = 0;
}
function ir2() {
this.nc = this.Ea = this.b = this.hc = 0, this.K = [], this.w = 0;
}
function ar2() {
this.ua = 0, this.Wa = new M2(), this.vb = new M2(), this.md = this.xc = this.wc = 0, this.vc = [], this.Wb = 0, this.Ya = new d3(), this.yc = new l3();
}
function or3() {
this.xb = this.a = 0, this.l = new Gt2(), this.ca = new ot2(), this.V = [], this.Ba = 0, this.Ta = [], this.Ua = 0, this.m = new N3(), this.Pb = 0, this.wd = new N3(), this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0, this.s = new ar2(), this.ab = 0, this.gc = o2(4, ir2), this.Oc = 0;
}
function sr2() {
this.Lc = this.Z = this.$a = this.i = this.c = 0, this.l = new Gt2(), this.ic = 0, this.ca = [], this.tb = 0, this.qd = null, this.rd = 0;
}
function cr2(t7, e8, r3, n3, i3, a3, o3) {
for (t7 = null == t7 ? 0 : t7[e8 + 0], e8 = 0; e8 < o3; ++e8)
i3[a3 + e8] = t7 + r3[n3 + e8] & 255, t7 = i3[a3 + e8];
}
function ur2(t7, e8, r3, n3, i3, a3, o3) {
var s3;
if (null == t7)
cr2(null, null, r3, n3, i3, a3, o3);
else
for (s3 = 0; s3 < o3; ++s3)
i3[a3 + s3] = t7[e8 + s3] + r3[n3 + s3] & 255;
}
function hr2(t7, e8, r3, n3, i3, a3, o3) {
if (null == t7)
cr2(null, null, r3, n3, i3, a3, o3);
else {
var s3, c4 = t7[e8 + 0], u4 = c4, h4 = c4;
for (s3 = 0; s3 < o3; ++s3)
u4 = h4 + (c4 = t7[e8 + s3]) - u4, h4 = r3[n3 + s3] + (-256 & u4 ? 0 > u4 ? 0 : 255 : u4) & 255, u4 = c4, i3[a3 + s3] = h4;
}
}
function lr2(t7, r3, i3, o3) {
var s3 = r3.width, c4 = r3.o;
if (e7(null != t7 && null != r3), 0 > i3 || 0 >= o3 || i3 + o3 > c4)
return null;
if (!t7.Cc) {
if (null == t7.ga) {
var u4;
if (t7.ga = new sr2(), (u4 = null == t7.ga) || (u4 = r3.width * r3.o, e7(0 == t7.Gb.length), t7.Gb = a2(u4), t7.Uc = 0, null == t7.Gb ? u4 = 0 : (t7.mb = t7.Gb, t7.nb = t7.Uc, t7.rc = null, u4 = 1), u4 = !u4), !u4) {
u4 = t7.ga;
var h4 = t7.Fa, l4 = t7.P, f4 = t7.qc, d4 = t7.mb, p4 = t7.nb, g4 = l4 + 1, m4 = f4 - 1, b4 = u4.l;
if (e7(null != h4 && null != d4 && null != r3), mi2[0] = null, mi2[1] = cr2, mi2[2] = ur2, mi2[3] = hr2, u4.ca = d4, u4.tb = p4, u4.c = r3.width, u4.i = r3.height, e7(0 < u4.c && 0 < u4.i), 1 >= f4)
r3 = 0;
else if (u4.$a = h4[l4 + 0] >> 0 & 3, u4.Z = h4[l4 + 0] >> 2 & 3, u4.Lc = h4[l4 + 0] >> 4 & 3, l4 = h4[l4 + 0] >> 6 & 3, 0 > u4.$a || 1 < u4.$a || 4 <= u4.Z || 1 < u4.Lc || l4)
r3 = 0;
else if (b4.put = dt2, b4.ac = ft2, b4.bc = pt2, b4.ma = u4, b4.width = r3.width, b4.height = r3.height, b4.Da = r3.Da, b4.v = r3.v, b4.va = r3.va, b4.j = r3.j, b4.o = r3.o, u4.$a)
t: {
e7(1 == u4.$a), r3 = kt2();
e:
for (; ; ) {
if (null == r3) {
r3 = 0;
break t;
}
if (e7(null != u4), u4.mc = r3, r3.c = u4.c, r3.i = u4.i, r3.l = u4.l, r3.l.ma = u4, r3.l.width = u4.c, r3.l.height = u4.i, r3.a = 0, v3(r3.m, h4, g4, m4), !It2(u4.c, u4.i, 1, r3, null))
break e;
if (1 == r3.ab && 3 == r3.gc[0].hc && At2(r3.s) ? (u4.ic = 1, h4 = r3.c * r3.i, r3.Ta = null, r3.Ua = 0, r3.V = a2(h4), r3.Ba = 0, null == r3.V ? (r3.a = 1, r3 = 0) : r3 = 1) : (u4.ic = 0, r3 = Ft2(r3, u4.c)), !r3)
break e;
r3 = 1;
break t;
}
u4.mc = null, r3 = 0;
}
else
r3 = m4 >= u4.c * u4.i;
u4 = !r3;
}
if (u4)
return null;
1 != t7.ga.Lc ? t7.Ga = 0 : o3 = c4 - i3;
}
e7(null != t7.ga), e7(i3 + o3 <= c4);
t: {
if (r3 = (h4 = t7.ga).c, c4 = h4.l.o, 0 == h4.$a) {
if (g4 = t7.rc, m4 = t7.Vc, b4 = t7.Fa, l4 = t7.P + 1 + i3 * r3, f4 = t7.mb, d4 = t7.nb + i3 * r3, e7(l4 <= t7.P + t7.qc), 0 != h4.Z)
for (e7(null != mi2[h4.Z]), u4 = 0; u4 < o3; ++u4)
mi2[h4.Z](g4, m4, b4, l4, f4, d4, r3), g4 = f4, m4 = d4, d4 += r3, l4 += r3;
else
for (u4 = 0; u4 < o3; ++u4)
n2(f4, d4, b4, l4, r3), g4 = f4, m4 = d4, d4 += r3, l4 += r3;
t7.rc = g4, t7.Vc = m4;
} else {
if (e7(null != h4.mc), r3 = i3 + o3, e7(null != (u4 = h4.mc)), e7(r3 <= u4.i), u4.C >= r3)
r3 = 1;
else if (h4.ic || mr2(), h4.ic) {
h4 = u4.V, g4 = u4.Ba, m4 = u4.c;
var y4 = u4.i, w4 = (b4 = 1, l4 = u4.$ / m4, f4 = u4.$ % m4, d4 = u4.m, p4 = u4.s, u4.$), N4 = m4 * y4, L4 = m4 * r3, x3 = p4.wc, _25 = w4 < L4 ? wt2(p4, f4, l4) : null;
e7(w4 <= N4), e7(r3 <= y4), e7(At2(p4));
e:
for (; ; ) {
for (; !d4.h && w4 < L4; ) {
if (f4 & x3 || (_25 = wt2(p4, f4, l4)), e7(null != _25), S2(d4), 256 > (y4 = bt2(_25.G[0], _25.H[0], d4)))
h4[g4 + w4] = y4, ++w4, ++f4 >= m4 && (f4 = 0, ++l4 <= r3 && !(l4 % 16) && St2(u4, l4));
else {
if (!(280 > y4)) {
b4 = 0;
break e;
}
y4 = mt2(y4 - 256, d4);
var P3, k3 = bt2(_25.G[4], _25.H[4], d4);
if (S2(d4), !(w4 >= (k3 = vt2(m4, k3 = mt2(k3, d4))) && N4 - w4 >= y4)) {
b4 = 0;
break e;
}
for (P3 = 0; P3 < y4; ++P3)
h4[g4 + w4 + P3] = h4[g4 + w4 + P3 - k3];
for (w4 += y4, f4 += y4; f4 >= m4; )
f4 -= m4, ++l4 <= r3 && !(l4 % 16) && St2(u4, l4);
w4 < L4 && f4 & x3 && (_25 = wt2(p4, f4, l4));
}
e7(d4.h == A6(d4));
}
St2(u4, l4 > r3 ? r3 : l4);
break e;
}
!b4 || d4.h && w4 < N4 ? (b4 = 0, u4.a = d4.h ? 5 : 3) : u4.$ = w4, r3 = b4;
} else
r3 = _t2(u4, u4.V, u4.Ba, u4.c, u4.i, r3, Ct2);
if (!r3) {
o3 = 0;
break t;
}
}
i3 + o3 >= c4 && (t7.Cc = 1), o3 = 1;
}
if (!o3)
return null;
if (t7.Cc && (null != (o3 = t7.ga) && (o3.mc = null), t7.ga = null, 0 < t7.Ga))
return alert("todo:WebPDequantizeLevels"), null;
}
return t7.nb + i3 * s3;
}
function fr2(t7, e8, r3, n3, i3, a3) {
for (; 0 < i3--; ) {
var o3, s3 = t7, c4 = e8 + (r3 ? 1 : 0), u4 = t7, h4 = e8 + (r3 ? 0 : 3);
for (o3 = 0; o3 < n3; ++o3) {
var l4 = u4[h4 + 4 * o3];
255 != l4 && (l4 *= 32897, s3[c4 + 4 * o3 + 0] = s3[c4 + 4 * o3 + 0] * l4 >> 23, s3[c4 + 4 * o3 + 1] = s3[c4 + 4 * o3 + 1] * l4 >> 23, s3[c4 + 4 * o3 + 2] = s3[c4 + 4 * o3 + 2] * l4 >> 23);
}
e8 += a3;
}
}
function dr2(t7, e8, r3, n3, i3) {
for (; 0 < n3--; ) {
var a3;
for (a3 = 0; a3 < r3; ++a3) {
var o3 = t7[e8 + 2 * a3 + 0], s3 = 15 & (u4 = t7[e8 + 2 * a3 + 1]), c4 = 4369 * s3, u4 = (240 & u4 | u4 >> 4) * c4 >> 16;
t7[e8 + 2 * a3 + 0] = (240 & o3 | o3 >> 4) * c4 >> 16 & 240 | (15 & o3 | o3 << 4) * c4 >> 16 >> 4 & 15, t7[e8 + 2 * a3 + 1] = 240 & u4 | s3;
}
e8 += i3;
}
}
function pr2(t7, e8, r3, n3, i3, a3, o3, s3) {
var c4, u4, h4 = 255;
for (u4 = 0; u4 < i3; ++u4) {
for (c4 = 0; c4 < n3; ++c4) {
var l4 = t7[e8 + c4];
a3[o3 + 4 * c4] = l4, h4 &= l4;
}
e8 += r3, o3 += s3;
}
return 255 != h4;
}
function gr2(t7, e8, r3, n3, i3) {
var a3;
for (a3 = 0; a3 < i3; ++a3)
r3[n3 + a3] = t7[e8 + a3] >> 8;
}
function mr2() {
An2 = fr2, xn2 = dr2, Sn2 = pr2, _n2 = gr2;
}
function vr2(r3, n3, i3) {
t6[r3] = function(t7, r4, a3, o3, s3, c4, u4, h4, l4, f4, d4, p4, g4, m4, v5, b4, y4) {
var w4, N4 = y4 - 1 >> 1, L4 = s3[c4 + 0] | u4[h4 + 0] << 16, A7 = l4[f4 + 0] | d4[p4 + 0] << 16;
e7(null != t7);
var x3 = 3 * L4 + A7 + 131074 >> 2;
for (n3(t7[r4 + 0], 255 & x3, x3 >> 16, g4, m4), null != a3 && (x3 = 3 * A7 + L4 + 131074 >> 2, n3(a3[o3 + 0], 255 & x3, x3 >> 16, v5, b4)), w4 = 1; w4 <= N4; ++w4) {
var S3 = s3[c4 + w4] | u4[h4 + w4] << 16, _25 = l4[f4 + w4] | d4[p4 + w4] << 16, P3 = L4 + S3 + A7 + _25 + 524296, k3 = P3 + 2 * (S3 + A7) >> 3;
x3 = k3 + L4 >> 1, L4 = (P3 = P3 + 2 * (L4 + _25) >> 3) + S3 >> 1, n3(t7[r4 + 2 * w4 - 1], 255 & x3, x3 >> 16, g4, m4 + (2 * w4 - 1) * i3), n3(t7[r4 + 2 * w4 - 0], 255 & L4, L4 >> 16, g4, m4 + (2 * w4 - 0) * i3), null != a3 && (x3 = P3 + A7 >> 1, L4 = k3 + _25 >> 1, n3(a3[o3 + 2 * w4 - 1], 255 & x3, x3 >> 16, v5, b4 + (2 * w4 - 1) * i3), n3(a3[o3 + 2 * w4 + 0], 255 & L4, L4 >> 16, v5, b4 + (2 * w4 + 0) * i3)), L4 = S3, A7 = _25;
}
1 & y4 || (x3 = 3 * L4 + A7 + 131074 >> 2, n3(t7[r4 + y4 - 1], 255 & x3, x3 >> 16, g4, m4 + (y4 - 1) * i3), null != a3 && (x3 = 3 * A7 + L4 + 131074 >> 2, n3(a3[o3 + y4 - 1], 255 & x3, x3 >> 16, v5, b4 + (y4 - 1) * i3)));
};
}
function br2() {
vi2[En2] = bi2, vi2[qn2] = wi2, vi2[Dn2] = yi2, vi2[Rn2] = Ni2, vi2[Tn2] = Li2, vi2[Un2] = Ai2, vi2[zn2] = xi2, vi2[Hn2] = wi2, vi2[Wn2] = Ni2, vi2[Vn2] = Li2, vi2[Gn2] = Ai2;
}
function yr2(t7) {
return t7 & ~Fi2 ? 0 > t7 ? 0 : 255 : t7 >> Ii2;
}
function wr2(t7, e8) {
return yr2((19077 * t7 >> 8) + (26149 * e8 >> 8) - 14234);
}
function Nr2(t7, e8, r3) {
return yr2((19077 * t7 >> 8) - (6419 * e8 >> 8) - (13320 * r3 >> 8) + 8708);
}
function Lr2(t7, e8) {
return yr2((19077 * t7 >> 8) + (33050 * e8 >> 8) - 17685);
}
function Ar2(t7, e8, r3, n3, i3) {
n3[i3 + 0] = wr2(t7, r3), n3[i3 + 1] = Nr2(t7, e8, r3), n3[i3 + 2] = Lr2(t7, e8);
}
function xr2(t7, e8, r3, n3, i3) {
n3[i3 + 0] = Lr2(t7, e8), n3[i3 + 1] = Nr2(t7, e8, r3), n3[i3 + 2] = wr2(t7, r3);
}
function Sr2(t7, e8, r3, n3, i3) {
var a3 = Nr2(t7, e8, r3);
e8 = a3 << 3 & 224 | Lr2(t7, e8) >> 3, n3[i3 + 0] = 248 & wr2(t7, r3) | a3 >> 5, n3[i3 + 1] = e8;
}
function _r2(t7, e8, r3, n3, i3) {
var a3 = 240 & Lr2(t7, e8) | 15;
n3[i3 + 0] = 240 & wr2(t7, r3) | Nr2(t7, e8, r3) >> 4, n3[i3 + 1] = a3;
}
function Pr2(t7, e8, r3, n3, i3) {
n3[i3 + 0] = 255, Ar2(t7, e8, r3, n3, i3 + 1);
}
function kr(t7, e8, r3, n3, i3) {
xr2(t7, e8, r3, n3, i3), n3[i3 + 3] = 255;
}
function Ir2(t7, e8, r3, n3, i3) {
Ar2(t7, e8, r3, n3, i3), n3[i3 + 3] = 255;
}
function Vt2(t7, e8) {
return 0 > t7 ? 0 : t7 > e8 ? e8 : t7;
}
function Fr2(e8, r3, n3) {
t6[e8] = function(t7, e9, i3, a3, o3, s3, c4, u4, h4) {
for (var l4 = u4 + (-2 & h4) * n3; u4 != l4; )
r3(t7[e9 + 0], i3[a3 + 0], o3[s3 + 0], c4, u4), r3(t7[e9 + 1], i3[a3 + 0], o3[s3 + 0], c4, u4 + n3), e9 += 2, ++a3, ++s3, u4 += 2 * n3;
1 & h4 && r3(t7[e9 + 0], i3[a3 + 0], o3[s3 + 0], c4, u4);
};
}
function Cr2(t7, e8, r3) {
return 0 == r3 ? 0 == t7 ? 0 == e8 ? 6 : 5 : 0 == e8 ? 4 : 0 : r3;
}
function jr2(t7, e8, r3, n3, i3) {
switch (t7 >>> 30) {
case 3:
on2(e8, r3, n3, i3, 0);
break;
case 2:
sn2(e8, r3, n3, i3);
break;
case 1:
un2(e8, r3, n3, i3);
}
}
function Or2(t7, e8) {
var r3, a3, o3 = e8.M, s3 = e8.Nb, c4 = t7.oc, u4 = t7.pc + 40, h4 = t7.oc, l4 = t7.pc + 584, f4 = t7.oc, d4 = t7.pc + 600;
for (r3 = 0; 16 > r3; ++r3)
c4[u4 + 32 * r3 - 1] = 129;
for (r3 = 0; 8 > r3; ++r3)
h4[l4 + 32 * r3 - 1] = 129, f4[d4 + 32 * r3 - 1] = 129;
for (0 < o3 ? c4[u4 - 1 - 32] = h4[l4 - 1 - 32] = f4[d4 - 1 - 32] = 129 : (i2(c4, u4 - 32 - 1, 127, 21), i2(h4, l4 - 32 - 1, 127, 9), i2(f4, d4 - 32 - 1, 127, 9)), a3 = 0; a3 < t7.za; ++a3) {
var p4 = e8.ya[e8.aa + a3];
if (0 < a3) {
for (r3 = -1; 16 > r3; ++r3)
n2(c4, u4 + 32 * r3 - 4, c4, u4 + 32 * r3 + 12, 4);
for (r3 = -1; 8 > r3; ++r3)
n2(h4, l4 + 32 * r3 - 4, h4, l4 + 32 * r3 + 4, 4), n2(f4, d4 + 32 * r3 - 4, f4, d4 + 32 * r3 + 4, 4);
}
var g4 = t7.Gd, m4 = t7.Hd + a3, v5 = p4.ad, b4 = p4.Hc;
if (0 < o3 && (n2(c4, u4 - 32, g4[m4].y, 0, 16), n2(h4, l4 - 32, g4[m4].f, 0, 8), n2(f4, d4 - 32, g4[m4].ea, 0, 8)), p4.Za) {
var y4 = c4, w4 = u4 - 32 + 16;
for (0 < o3 && (a3 >= t7.za - 1 ? i2(y4, w4, g4[m4].y[15], 4) : n2(y4, w4, g4[m4 + 1].y, 0, 4)), r3 = 0; 4 > r3; r3++)
y4[w4 + 128 + r3] = y4[w4 + 256 + r3] = y4[w4 + 384 + r3] = y4[w4 + 0 + r3];
for (r3 = 0; 16 > r3; ++r3, b4 <<= 2)
y4 = c4, w4 = u4 + Di2[r3], fi2[p4.Ob[r3]](y4, w4), jr2(b4, v5, 16 * +r3, y4, w4);
} else if (y4 = Cr2(a3, o3, p4.Ob[0]), li2[y4](c4, u4), 0 != b4)
for (r3 = 0; 16 > r3; ++r3, b4 <<= 2)
jr2(b4, v5, 16 * +r3, c4, u4 + Di2[r3]);
for (r3 = p4.Gc, y4 = Cr2(a3, o3, p4.Dd), di2[y4](h4, l4), di2[y4](f4, d4), b4 = v5, y4 = h4, w4 = l4, 255 & (p4 = r3 >> 0) && (170 & p4 ? cn2(b4, 256, y4, w4) : hn2(b4, 256, y4, w4)), p4 = f4, b4 = d4, 255 & (r3 >>= 8) && (170 & r3 ? cn2(v5, 320, p4, b4) : hn2(v5, 320, p4, b4)), o3 < t7.Ub - 1 && (n2(g4[m4].y, 0, c4, u4 + 480, 16), n2(g4[m4].f, 0, h4, l4 + 224, 8), n2(g4[m4].ea, 0, f4, d4 + 224, 8)), r3 = 8 * s3 * t7.B, g4 = t7.sa, m4 = t7.ta + 16 * a3 + 16 * s3 * t7.R, v5 = t7.qa, p4 = t7.ra + 8 * a3 + r3, b4 = t7.Ha, y4 = t7.Ia + 8 * a3 + r3, r3 = 0; 16 > r3; ++r3)
n2(g4, m4 + r3 * t7.R, c4, u4 + 32 * r3, 16);
for (r3 = 0; 8 > r3; ++r3)
n2(v5, p4 + r3 * t7.B, h4, l4 + 32 * r3, 8), n2(b4, y4 + r3 * t7.B, f4, d4 + 32 * r3, 8);
}
}
function Br2(t7, n3, i3, a3, o3, s3, c4, u4, h4) {
var l4 = [0], f4 = [0], d4 = 0, p4 = null != h4 ? h4.kd : 0, g4 = null != h4 ? h4 : new nr2();
if (null == t7 || 12 > i3)
return 7;
g4.data = t7, g4.w = n3, g4.ha = i3, n3 = [n3], i3 = [i3], g4.gb = [g4.gb];
t: {
var m4 = n3, b4 = i3, y4 = g4.gb;
if (e7(null != t7), e7(null != b4), e7(null != y4), y4[0] = 0, 12 <= b4[0] && !r2(t7, m4[0], "RIFF")) {
if (r2(t7, m4[0] + 8, "WEBP")) {
y4 = 3;
break t;
}
var w4 = j2(t7, m4[0] + 4);
if (12 > w4 || 4294967286 < w4) {
y4 = 3;
break t;
}
if (p4 && w4 > b4[0] - 8) {
y4 = 7;
break t;
}
y4[0] = w4, m4[0] += 12, b4[0] -= 12;
}
y4 = 0;
}
if (0 != y4)
return y4;
for (w4 = 0 < g4.gb[0], i3 = i3[0]; ; ) {
t: {
var L4 = t7;
b4 = n3, y4 = i3;
var A7 = l4, x3 = f4, S3 = m4 = [0];
if ((k3 = d4 = [d4])[0] = 0, 8 > y4[0])
y4 = 7;
else {
if (!r2(L4, b4[0], "VP8X")) {
if (10 != j2(L4, b4[0] + 4)) {
y4 = 3;
break t;
}
if (18 > y4[0]) {
y4 = 7;
break t;
}
var _25 = j2(L4, b4[0] + 8), P3 = 1 + C3(L4, b4[0] + 12);
if (2147483648 <= P3 * (L4 = 1 + C3(L4, b4[0] + 15))) {
y4 = 3;
break t;
}
null != S3 && (S3[0] = _25), null != A7 && (A7[0] = P3), null != x3 && (x3[0] = L4), b4[0] += 18, y4[0] -= 18, k3[0] = 1;
}
y4 = 0;
}
}
if (d4 = d4[0], m4 = m4[0], 0 != y4)
return y4;
if (b4 = !!(2 & m4), !w4 && d4)
return 3;
if (null != s3 && (s3[0] = !!(16 & m4)), null != c4 && (c4[0] = b4), null != u4 && (u4[0] = 0), c4 = l4[0], m4 = f4[0], d4 && b4 && null == h4) {
y4 = 0;
break;
}
if (4 > i3) {
y4 = 7;
break;
}
if (w4 && d4 || !w4 && !d4 && !r2(t7, n3[0], "ALPH")) {
i3 = [i3], g4.na = [g4.na], g4.P = [g4.P], g4.Sa = [g4.Sa];
t: {
_25 = t7, y4 = n3, w4 = i3;
var k3 = g4.gb;
A7 = g4.na, x3 = g4.P, S3 = g4.Sa;
P3 = 22, e7(null != _25), e7(null != w4), L4 = y4[0];
var I3 = w4[0];
for (e7(null != A7), e7(null != S3), A7[0] = null, x3[0] = null, S3[0] = 0; ; ) {
if (y4[0] = L4, w4[0] = I3, 8 > I3) {
y4 = 7;
break t;
}
var F3 = j2(_25, L4 + 4);
if (4294967286 < F3) {
y4 = 3;
break t;
}
var O3 = 8 + F3 + 1 & -2;
if (P3 += O3, 0 < k3 && P3 > k3) {
y4 = 3;
break t;
}
if (!r2(_25, L4, "VP8 ") || !r2(_25, L4, "VP8L")) {
y4 = 0;
break t;
}
if (I3[0] < O3) {
y4 = 7;
break t;
}
r2(_25, L4, "ALPH") || (A7[0] = _25, x3[0] = L4 + 8, S3[0] = F3), L4 += O3, I3 -= O3;
}
}
if (i3 = i3[0], g4.na = g4.na[0], g4.P = g4.P[0], g4.Sa = g4.Sa[0], 0 != y4)
break;
}
i3 = [i3], g4.Ja = [g4.Ja], g4.xa = [g4.xa];
t:
if (k3 = t7, y4 = n3, w4 = i3, A7 = g4.gb[0], x3 = g4.Ja, S3 = g4.xa, _25 = y4[0], L4 = !r2(k3, _25, "VP8 "), P3 = !r2(k3, _25, "VP8L"), e7(null != k3), e7(null != w4), e7(null != x3), e7(null != S3), 8 > w4[0])
y4 = 7;
else {
if (L4 || P3) {
if (k3 = j2(k3, _25 + 4), 12 <= A7 && k3 > A7 - 12) {
y4 = 3;
break t;
}
if (p4 && k3 > w4[0] - 8) {
y4 = 7;
break t;
}
x3[0] = k3, y4[0] += 8, w4[0] -= 8, S3[0] = P3;
} else
S3[0] = 5 <= w4[0] && 47 == k3[_25 + 0] && !(k3[_25 + 4] >> 5), x3[0] = w4[0];
y4 = 0;
}
if (i3 = i3[0], g4.Ja = g4.Ja[0], g4.xa = g4.xa[0], n3 = n3[0], 0 != y4)
break;
if (4294967286 < g4.Ja)
return 3;
if (null == u4 || b4 || (u4[0] = g4.xa ? 2 : 1), c4 = [c4], m4 = [m4], g4.xa) {
if (5 > i3) {
y4 = 7;
break;
}
u4 = c4, p4 = m4, b4 = s3, null == t7 || 5 > i3 ? t7 = 0 : 5 <= i3 && 47 == t7[n3 + 0] && !(t7[n3 + 4] >> 5) ? (w4 = [0], k3 = [0], A7 = [0], v3(x3 = new N3(), t7, n3, i3), gt2(x3, w4, k3, A7) ? (null != u4 && (u4[0] = w4[0]), null != p4 && (p4[0] = k3[0]), null != b4 && (b4[0] = A7[0]), t7 = 1) : t7 = 0) : t7 = 0;
} else {
if (10 > i3) {
y4 = 7;
break;
}
u4 = m4, null == t7 || 10 > i3 || !Xt2(t7, n3 + 3, i3 - 3) ? t7 = 0 : (p4 = t7[n3 + 0] | t7[n3 + 1] << 8 | t7[n3 + 2] << 16, b4 = 16383 & (t7[n3 + 7] << 8 | t7[n3 + 6]), t7 = 16383 & (t7[n3 + 9] << 8 | t7[n3 + 8]), 1 & p4 || 3 < (p4 >> 1 & 7) || !(p4 >> 4 & 1) || p4 >> 5 >= g4.Ja || !b4 || !t7 ? t7 = 0 : (c4 && (c4[0] = b4), u4 && (u4[0] = t7), t7 = 1));
}
if (!t7)
return 3;
if (c4 = c4[0], m4 = m4[0], d4 && (l4[0] != c4 || f4[0] != m4))
return 3;
null != h4 && (h4[0] = g4, h4.offset = n3 - h4.w, e7(4294967286 > n3 - h4.w), e7(h4.offset == h4.ha - i3));
break;
}
return 0 == y4 || 7 == y4 && d4 && null == h4 ? (null != s3 && (s3[0] |= null != g4.na && 0 < g4.na.length), null != a3 && (a3[0] = c4), null != o3 && (o3[0] = m4), 0) : y4;
}
function Mr2(t7, e8, r3) {
var n3 = e8.width, i3 = e8.height, a3 = 0, o3 = 0, s3 = n3, c4 = i3;
if (e8.Da = null != t7 && 0 < t7.Da, e8.Da && (s3 = t7.cd, c4 = t7.bd, a3 = t7.v, o3 = t7.j, 11 > r3 || (a3 &= -2, o3 &= -2), 0 > a3 || 0 > o3 || 0 >= s3 || 0 >= c4 || a3 + s3 > n3 || o3 + c4 > i3))
return 0;
if (e8.v = a3, e8.j = o3, e8.va = a3 + s3, e8.o = o3 + c4, e8.U = s3, e8.T = c4, e8.da = null != t7 && 0 < t7.da, e8.da) {
if (!E2(s3, c4, r3 = [t7.ib], a3 = [t7.hb]))
return 0;
e8.ib = r3[0], e8.hb = a3[0];
}
return e8.ob = null != t7 && t7.ob, e8.Kb = null == t7 || !t7.Sd, e8.da && (e8.ob = e8.ib < 3 * n3 / 4 && e8.hb < 3 * i3 / 4, e8.Kb = 0), 1;
}
function Er2(t7) {
if (null == t7)
return 2;
if (11 > t7.S) {
var e8 = t7.f.RGBA;
e8.fb += (t7.height - 1) * e8.A, e8.A = -e8.A;
} else
e8 = t7.f.kb, t7 = t7.height, e8.O += (t7 - 1) * e8.fa, e8.fa = -e8.fa, e8.N += (t7 - 1 >> 1) * e8.Ab, e8.Ab = -e8.Ab, e8.W += (t7 - 1 >> 1) * e8.Db, e8.Db = -e8.Db, null != e8.F && (e8.J += (t7 - 1) * e8.lb, e8.lb = -e8.lb);
return 0;
}
function qr2(t7, e8, r3, n3) {
if (null == n3 || 0 >= t7 || 0 >= e8)
return 2;
if (null != r3) {
if (r3.Da) {
var i3 = r3.cd, o3 = r3.bd, s3 = -2 & r3.v, c4 = -2 & r3.j;
if (0 > s3 || 0 > c4 || 0 >= i3 || 0 >= o3 || s3 + i3 > t7 || c4 + o3 > e8)
return 2;
t7 = i3, e8 = o3;
}
if (r3.da) {
if (!E2(t7, e8, i3 = [r3.ib], o3 = [r3.hb]))
return 2;
t7 = i3[0], e8 = o3[0];
}
}
n3.width = t7, n3.height = e8;
t: {
var u4 = n3.width, h4 = n3.height;
if (t7 = n3.S, 0 >= u4 || 0 >= h4 || !(t7 >= En2 && 13 > t7))
t7 = 2;
else {
if (0 >= n3.Rd && null == n3.sd) {
s3 = o3 = i3 = e8 = 0;
var l4 = (c4 = u4 * zi2[t7]) * h4;
if (11 > t7 || (o3 = (h4 + 1) / 2 * (e8 = (u4 + 1) / 2), 12 == t7 && (s3 = (i3 = u4) * h4)), null == (h4 = a2(l4 + 2 * o3 + s3))) {
t7 = 1;
break t;
}
n3.sd = h4, 11 > t7 ? ((u4 = n3.f.RGBA).eb = h4, u4.fb = 0, u4.A = c4, u4.size = l4) : ((u4 = n3.f.kb).y = h4, u4.O = 0, u4.fa = c4, u4.Fd = l4, u4.f = h4, u4.N = 0 + l4, u4.Ab = e8, u4.Cd = o3, u4.ea = h4, u4.W = 0 + l4 + o3, u4.Db = e8, u4.Ed = o3, 12 == t7 && (u4.F = h4, u4.J = 0 + l4 + 2 * o3), u4.Tc = s3, u4.lb = i3);
}
if (e8 = 1, i3 = n3.S, o3 = n3.width, s3 = n3.height, i3 >= En2 && 13 > i3)
if (11 > i3)
t7 = n3.f.RGBA, e8 &= (c4 = Math.abs(t7.A)) * (s3 - 1) + o3 <= t7.size, e8 &= c4 >= o3 * zi2[i3], e8 &= null != t7.eb;
else {
t7 = n3.f.kb, c4 = (o3 + 1) / 2, l4 = (s3 + 1) / 2, u4 = Math.abs(t7.fa);
h4 = Math.abs(t7.Ab);
var f4 = Math.abs(t7.Db), d4 = Math.abs(t7.lb), p4 = d4 * (s3 - 1) + o3;
e8 &= u4 * (s3 - 1) + o3 <= t7.Fd, e8 &= h4 * (l4 - 1) + c4 <= t7.Cd, e8 = (e8 &= f4 * (l4 - 1) + c4 <= t7.Ed) & u4 >= o3 & h4 >= c4 & f4 >= c4, e8 &= null != t7.y, e8 &= null != t7.f, e8 &= null != t7.ea, 12 == i3 && (e8 &= d4 >= o3, e8 &= p4 <= t7.Tc, e8 &= null != t7.F);
}
else
e8 = 0;
t7 = e8 ? 0 : 2;
}
}
return 0 != t7 || null != r3 && r3.fd && (t7 = Er2(n3)), t7;
}
var Dr2 = 64, Rr2 = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215], Tr2 = 24, Ur2 = 32, zr2 = 8, Hr2 = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
R2("Predictor0", "PredictorAdd0"), t6.Predictor0 = function() {
return 4278190080;
}, t6.Predictor1 = function(t7) {
return t7;
}, t6.Predictor2 = function(t7, e8, r3) {
return e8[r3 + 0];
}, t6.Predictor3 = function(t7, e8, r3) {
return e8[r3 + 1];
}, t6.Predictor4 = function(t7, e8, r3) {
return e8[r3 - 1];
}, t6.Predictor5 = function(t7, e8, r3) {
return U2(U2(t7, e8[r3 + 1]), e8[r3 + 0]);
}, t6.Predictor6 = function(t7, e8, r3) {
return U2(t7, e8[r3 - 1]);
}, t6.Predictor7 = function(t7, e8, r3) {
return U2(t7, e8[r3 + 0]);
}, t6.Predictor8 = function(t7, e8, r3) {
return U2(e8[r3 - 1], e8[r3 + 0]);
}, t6.Predictor9 = function(t7, e8, r3) {
return U2(e8[r3 + 0], e8[r3 + 1]);
}, t6.Predictor10 = function(t7, e8, r3) {
return U2(U2(t7, e8[r3 - 1]), U2(e8[r3 + 0], e8[r3 + 1]));
}, t6.Predictor11 = function(t7, e8, r3) {
var n3 = e8[r3 + 0];
return 0 >= W2(n3 >> 24 & 255, t7 >> 24 & 255, (e8 = e8[r3 - 1]) >> 24 & 255) + W2(n3 >> 16 & 255, t7 >> 16 & 255, e8 >> 16 & 255) + W2(n3 >> 8 & 255, t7 >> 8 & 255, e8 >> 8 & 255) + W2(255 & n3, 255 & t7, 255 & e8) ? n3 : t7;
}, t6.Predictor12 = function(t7, e8, r3) {
var n3 = e8[r3 + 0];
return (z2((t7 >> 24 & 255) + (n3 >> 24 & 255) - ((e8 = e8[r3 - 1]) >> 24 & 255)) << 24 | z2((t7 >> 16 & 255) + (n3 >> 16 & 255) - (e8 >> 16 & 255)) << 16 | z2((t7 >> 8 & 255) + (n3 >> 8 & 255) - (e8 >> 8 & 255)) << 8 | z2((255 & t7) + (255 & n3) - (255 & e8))) >>> 0;
}, t6.Predictor13 = function(t7, e8, r3) {
var n3 = e8[r3 - 1];
return (H4((t7 = U2(t7, e8[r3 + 0])) >> 24 & 255, n3 >> 24 & 255) << 24 | H4(t7 >> 16 & 255, n3 >> 16 & 255) << 16 | H4(t7 >> 8 & 255, n3 >> 8 & 255) << 8 | H4(t7 >> 0 & 255, n3 >> 0 & 255)) >>> 0;
};
var Wr2 = t6.PredictorAdd0;
t6.PredictorAdd1 = V2, R2("Predictor2", "PredictorAdd2"), R2("Predictor3", "PredictorAdd3"), R2("Predictor4", "PredictorAdd4"), R2("Predictor5", "PredictorAdd5"), R2("Predictor6", "PredictorAdd6"), R2("Predictor7", "PredictorAdd7"), R2("Predictor8", "PredictorAdd8"), R2("Predictor9", "PredictorAdd9"), R2("Predictor10", "PredictorAdd10"), R2("Predictor11", "PredictorAdd11"), R2("Predictor12", "PredictorAdd12"), R2("Predictor13", "PredictorAdd13");
var Vr2 = t6.PredictorAdd2;
X3("ColorIndexInverseTransform", "MapARGB", "32b", function(t7) {
return t7 >> 8 & 255;
}, function(t7) {
return t7;
}), X3("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", function(t7) {
return t7;
}, function(t7) {
return t7 >> 8 & 255;
});
var Gr2, Yr2 = t6.ColorIndexInverseTransform, Jr2 = t6.MapARGB, Xr2 = t6.VP8LColorIndexInverseTransformAlpha, Kr2 = t6.MapAlpha, Zr2 = t6.VP8LPredictorsAdd = [];
Zr2.length = 16, (t6.VP8LPredictors = []).length = 16, (t6.VP8LPredictorsAdd_C = []).length = 16, (t6.VP8LPredictors_C = []).length = 16;
var $r2, Qr2, tn2, en2, rn2, nn2, an2, on2, sn2, cn2, un2, hn2, ln2, fn8, dn2, pn2, gn2, mn2, vn2, bn2, yn2, wn2, Nn2, Ln2, An2, xn2, Sn2, _n2, Pn2 = a2(511), kn2 = a2(2041), In2 = a2(225), Fn2 = a2(767), Cn2 = 0, jn2 = kn2, On2 = In2, Bn2 = Fn2, Mn2 = Pn2, En2 = 0, qn2 = 1, Dn2 = 2, Rn2 = 3, Tn2 = 4, Un2 = 5, zn2 = 6, Hn2 = 7, Wn2 = 8, Vn2 = 9, Gn2 = 10, Yn2 = [2, 3, 7], Jn2 = [3, 3, 11], Xn2 = [280, 256, 256, 256, 40], Kn2 = [0, 1, 1, 1, 0], Zn2 = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], $n2 = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112], Qn2 = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], ti2 = 8, ei2 = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157], ri2 = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284], ni2 = null, ii2 = [[173, 148, 140, 0], [176, 155, 140, 135, 0], [180, 157, 141, 134, 130, 0], [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]], ai2 = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], oi2 = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], si2 = [[[[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]], [[253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128], [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128], [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]], [[1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128], [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128], [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]], [[1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128], [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128], [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]], [[1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128], [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128], [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]], [[1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128], [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128], [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]], [[1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128], [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128], [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62], [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1], [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]], [[1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128], [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128], [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]], [[1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128], [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128], [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]], [[1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128], [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128], [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]], [[1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128], [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128], [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]], [[1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128], [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128], [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]], [[1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128], [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128], [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]], [[1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128], [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128], [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]]], [[[253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128], [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128], [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]], [[1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128], [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128], [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]], [[1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128], [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128], [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]], [[1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128], [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128], [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]], [[1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128], [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128], [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128], [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128], [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128], [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128], [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255], [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128], [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]], [[1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128], [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128], [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]], [[1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128], [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128], [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]], [[1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128], [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128], [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]], [[1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128], [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128], [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]], [[1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128], [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128], [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]], [[1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128], [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128], [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]]]], ci2 = [[[231, 120, 48, 89, 115, 113, 120, 152, 112], [152, 179, 64, 126, 170, 118, 46, 70, 95], [175, 69, 143, 80, 85, 82, 72, 155, 103], [56, 58, 10, 171, 218, 189, 17, 13, 152], [114, 26, 17, 163, 44, 195, 21, 10, 173], [121, 24, 80, 195, 26, 62, 44, 64, 85], [144, 71, 10, 38, 171, 213, 144, 34, 26], [170, 46, 55, 19, 136, 160, 33, 206, 71], [63, 20, 8, 114, 114, 208, 12, 9, 226], [81, 40, 11, 96, 182, 84, 29, 16, 36]], [[134, 183, 89, 137, 98, 101, 106, 165, 148], [72, 187, 100, 130, 157, 111, 32, 75, 80], [66, 102, 167, 99, 74, 62, 40, 234, 128], [41, 53, 9, 178, 241, 141, 26, 8, 107], [74, 43, 26, 146, 73, 166, 49, 23, 157], [65, 38, 105, 160, 51, 52, 31, 115, 128], [104, 79, 12, 27, 217, 255, 87, 17, 7], [87, 68, 71, 44, 114, 51, 15, 186, 23], [47, 41, 14, 110, 182, 183, 21, 17, 194], [66, 45, 25, 102, 197, 189, 23, 18, 22]], [[88, 88, 147, 150, 42, 46, 45, 196, 205], [43, 97, 183, 117, 85, 38, 35, 179, 61], [39, 53, 200, 87, 26, 21, 43, 232, 171], [56, 34, 51, 104, 114, 102, 29, 93, 77], [39, 28, 85, 171, 58, 165, 90, 98, 64], [34, 22, 116, 206, 23, 34, 43, 166, 73], [107, 54, 32, 26, 51, 1, 81, 43, 31], [68, 25, 106, 22, 64, 171, 36, 225, 114], [34, 19, 21, 102, 132, 188, 16, 76, 124], [62, 18, 78, 95, 85, 57, 50, 48, 51]], [[193, 101, 35, 159, 215, 111, 89, 46, 111], [60, 148, 31, 172, 219, 228, 21, 18, 111], [112, 113, 77, 85, 179, 255, 38, 120, 114], [40, 42, 1, 196, 245, 209, 10, 25, 109], [88, 43, 29, 140, 166, 213, 37, 43, 154], [61, 63, 30, 155, 67, 45, 68, 1, 209], [100, 80, 8, 43, 154, 1, 51, 26, 71], [142, 78, 78, 16, 255, 128, 34, 197, 171], [41, 40, 5, 102, 211, 183, 4, 1, 221], [51, 50, 17, 168, 209, 192, 23, 25, 82]], [[138, 31, 36, 171, 27, 166, 38, 44, 229], [67, 87, 58, 169, 82, 115, 26, 59, 179], [63, 59, 90, 180, 59, 166, 93, 73, 154], [40, 40, 21, 116, 143, 209, 34, 39, 175], [47, 15, 16, 183, 34, 223, 49, 45, 183], [46, 17, 33, 183, 6, 98, 15, 32, 183], [57, 46, 22, 24, 128, 1, 54, 17, 37], [65, 32, 73, 115, 28, 128, 23, 128, 205], [40, 3, 9, 115, 51, 192, 18, 6, 223], [87, 37, 9, 115, 59, 77, 64, 21, 47]], [[104, 55, 44, 218, 9, 54, 53, 130, 226], [64, 90, 70, 205, 40, 41, 23, 26, 57], [54, 57, 112, 184, 5, 41, 38, 166, 213], [30, 34, 26, 133, 152, 116, 10, 32, 134], [39, 19, 53, 221, 26, 114, 32, 73, 255], [31, 9, 65, 234, 2, 15, 1, 118, 73], [75, 32, 12, 51, 192, 255, 160, 43, 51], [88, 31, 35, 67, 102, 85, 55, 186, 85], [56, 21, 23, 111, 59, 205, 45, 37, 192], [55, 38, 70, 124, 73, 102, 1, 34, 98]], [[125, 98, 42, 88, 104, 85, 117, 175, 82], [95, 84, 53, 89, 128, 100, 113, 101, 45], [75, 79, 123, 47, 51, 128, 81, 171, 1], [57, 17, 5, 71, 102, 57, 53, 41, 49], [38, 33, 13, 121, 57, 73, 26, 1, 85], [41, 10, 67, 138, 77, 110, 90, 47, 114], [115, 21, 2, 10, 102, 255, 166, 23, 6], [101, 29, 16, 10, 85, 128, 101, 196, 26], [57, 18, 10, 102, 102, 213, 34, 20, 43], [117, 20, 15, 36, 163, 128, 68, 1, 26]], [[102, 61, 71, 37, 34, 53, 31, 243, 192], [69, 60, 71, 38, 73, 119, 28, 222, 37], [68, 45, 128, 34, 1, 47, 11, 245, 171], [62, 17, 19, 70, 146, 85, 55, 62, 70], [37, 43, 37, 154, 100, 163, 85, 160, 1], [63, 9, 92, 136, 28, 64, 32, 201, 85], [75, 15, 9, 9, 64, 255, 184, 119, 16], [86, 6, 28, 5, 64, 255, 25, 248, 1], [56, 8, 17, 132, 137, 255, 55, 116, 128], [58, 15, 20, 82, 135, 57, 26, 121, 40]], [[164, 50, 31, 137, 154, 133, 25, 35, 218], [51, 103, 44, 131, 131, 123, 31, 6, 158], [86, 40, 64, 135, 148, 224, 45, 183, 128], [22, 26, 17, 131, 240, 154, 14, 1, 209], [45, 16, 21, 91, 64, 222, 7, 1, 197], [56, 21, 39, 155, 60, 138, 23, 102, 213], [83, 12, 13, 54, 192, 255, 68, 47, 28], [85, 26, 85, 85, 128, 128, 32, 146, 171], [18, 11, 7, 63, 144, 171, 4, 4, 246], [35, 27, 10, 146, 174, 171, 12, 26, 128]], [[190, 80, 35, 99, 180, 80, 126, 54, 45], [85, 126, 47, 87, 176, 51, 41, 20, 32], [101, 75, 128, 139, 118, 146, 116, 128, 85], [56, 41, 15, 176, 236, 85, 37, 9, 62], [71, 30, 17, 119, 118, 255, 17, 18, 138], [101, 38, 60, 138, 55, 70, 43, 26, 142], [146, 36, 19, 30, 171, 255, 97, 27, 20], [138, 45, 61, 62, 219, 1, 81, 188, 64], [32, 41, 20, 117, 151, 142, 20, 21, 163], [112, 19, 12, 61, 195, 128, 48, 4, 24]]], ui2 = [[[[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255], [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255], [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255], [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255], [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255], [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255], [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255], [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255], [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255], [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255], [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255], [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]]], hi2 = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], li2 = [], fi2 = [], di2 = [], pi2 = 1, gi2 = 2, mi2 = [], vi2 = [];
vr2("UpsampleRgbLinePair", Ar2, 3), vr2("UpsampleBgrLinePair", xr2, 3), vr2("UpsampleRgbaLinePair", Ir2, 4), vr2("UpsampleBgraLinePair", kr, 4), vr2("UpsampleArgbLinePair", Pr2, 4), vr2("UpsampleRgba4444LinePair", _r2, 2), vr2("UpsampleRgb565LinePair", Sr2, 2);
var bi2 = t6.UpsampleRgbLinePair, yi2 = t6.UpsampleBgrLinePair, wi2 = t6.UpsampleRgbaLinePair, Ni2 = t6.UpsampleBgraLinePair, Li2 = t6.UpsampleArgbLinePair, Ai2 = t6.UpsampleRgba4444LinePair, xi2 = t6.UpsampleRgb565LinePair, Si2 = 16, _i2 = 1 << Si2 - 1, Pi2 = -227, ki2 = 482, Ii2 = 6, Fi2 = (256 << Ii2) - 1, Ci2 = 0, ji2 = a2(256), Oi2 = a2(256), Bi2 = a2(256), Mi2 = a2(256), Ei2 = a2(ki2 - Pi2), qi2 = a2(ki2 - Pi2);
Fr2("YuvToRgbRow", Ar2, 3), Fr2("YuvToBgrRow", xr2, 3), Fr2("YuvToRgbaRow", Ir2, 4), Fr2("YuvToBgraRow", kr, 4), Fr2("YuvToArgbRow", Pr2, 4), Fr2("YuvToRgba4444Row", _r2, 2), Fr2("YuvToRgb565Row", Sr2, 2);
var Di2 = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396], Ri2 = [0, 2, 8], Ti2 = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1], Ui2 = 1;
this.WebPDecodeRGBA = function(t7, r3, n3, i3, a3) {
var o3 = qn2, s3 = new rr2(), c4 = new ot2();
s3.ba = c4, c4.S = o3, c4.width = [c4.width], c4.height = [c4.height];
var u4 = c4.width, h4 = c4.height, l4 = new st2();
if (null == l4 || null == t7)
var f4 = 2;
else
e7(null != l4), f4 = Br2(t7, r3, n3, l4.width, l4.height, l4.Pd, l4.Qd, l4.format, null);
if (0 != f4 ? u4 = 0 : (null != u4 && (u4[0] = l4.width[0]), null != h4 && (h4[0] = l4.height[0]), u4 = 1), u4) {
c4.width = c4.width[0], c4.height = c4.height[0], null != i3 && (i3[0] = c4.width), null != a3 && (a3[0] = c4.height);
t: {
if (i3 = new Gt2(), (a3 = new nr2()).data = t7, a3.w = r3, a3.ha = n3, a3.kd = 1, r3 = [0], e7(null != a3), (0 == (t7 = Br2(a3.data, a3.w, a3.ha, null, null, null, r3, null, a3)) || 7 == t7) && r3[0] && (t7 = 4), 0 == (r3 = t7)) {
if (e7(null != s3), i3.data = a3.data, i3.w = a3.w + a3.offset, i3.ha = a3.ha - a3.offset, i3.put = dt2, i3.ac = ft2, i3.bc = pt2, i3.ma = s3, a3.xa) {
if (null == (t7 = kt2())) {
s3 = 1;
break t;
}
if (function(t8, r4) {
var n4 = [0], i4 = [0], a4 = [0];
e:
for (; ; ) {
if (null == t8)
return 0;
if (null == r4)
return t8.a = 2, 0;
if (t8.l = r4, t8.a = 0, v3(t8.m, r4.data, r4.w, r4.ha), !gt2(t8.m, n4, i4, a4)) {
t8.a = 3;
break e;
}
if (t8.xb = gi2, r4.width = n4[0], r4.height = i4[0], !It2(n4[0], i4[0], 1, t8, null))
break e;
return 1;
}
return e7(0 != t8.a), 0;
}(t7, i3)) {
if (i3 = 0 == (r3 = qr2(i3.width, i3.height, s3.Oa, s3.ba))) {
e: {
i3 = t7;
r:
for (; ; ) {
if (null == i3) {
i3 = 0;
break e;
}
if (e7(null != i3.s.yc), e7(null != i3.s.Ya), e7(0 < i3.s.Wb), e7(null != (n3 = i3.l)), e7(null != (a3 = n3.ma)), 0 != i3.xb) {
if (i3.ca = a3.ba, i3.tb = a3.tb, e7(null != i3.ca), !Mr2(a3.Oa, n3, Rn2)) {
i3.a = 2;
break r;
}
if (!Ft2(i3, n3.width))
break r;
if (n3.da)
break r;
if ((n3.da || nt2(i3.ca.S)) && mr2(), 11 > i3.ca.S || (alert("todo:WebPInitConvertARGBToYUV"), null != i3.ca.f.kb.F && mr2()), i3.Pb && 0 < i3.s.ua && null == i3.s.vb.X && !O2(i3.s.vb, i3.s.Wa.Xa)) {
i3.a = 1;
break r;
}
i3.xb = 0;
}
if (!_t2(i3, i3.V, i3.Ba, i3.c, i3.i, n3.o, Lt2))
break r;
a3.Dc = i3.Ma, i3 = 1;
break e;
}
e7(0 != i3.a), i3 = 0;
}
i3 = !i3;
}
i3 && (r3 = t7.a);
} else
r3 = t7.a;
} else {
if (null == (t7 = new Yt2())) {
s3 = 1;
break t;
}
if (t7.Fa = a3.na, t7.P = a3.P, t7.qc = a3.Sa, Kt2(t7, i3)) {
if (0 == (r3 = qr2(i3.width, i3.height, s3.Oa, s3.ba))) {
if (t7.Aa = 0, n3 = s3.Oa, e7(null != (a3 = t7)), null != n3) {
if (0 < (u4 = 0 > (u4 = n3.Md) ? 0 : 100 < u4 ? 255 : 255 * u4 / 100)) {
for (h4 = l4 = 0; 4 > h4; ++h4)
12 > (f4 = a3.pb[h4]).lc && (f4.ia = u4 * Ti2[0 > f4.lc ? 0 : f4.lc] >> 3), l4 |= f4.ia;
l4 && (alert("todo:VP8InitRandom"), a3.ia = 1);
}
a3.Ga = n3.Id, 100 < a3.Ga ? a3.Ga = 100 : 0 > a3.Ga && (a3.Ga = 0);
}
Qt2(t7, i3) || (r3 = t7.a);
}
} else
r3 = t7.a;
}
0 == r3 && null != s3.Oa && s3.Oa.fd && (r3 = Er2(s3.ba));
}
s3 = r3;
}
o3 = 0 != s3 ? null : 11 > o3 ? c4.f.RGBA.eb : c4.f.kb.y;
} else
o3 = null;
return o3;
};
var zi2 = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];
};
function u2(t6, e8) {
for (var r3 = "", n3 = 0; n3 < 4; n3++)
r3 += String.fromCharCode(t6[e8++]);
return r3;
}
function h2(t6, e8) {
return (t6[e8 + 0] << 0 | t6[e8 + 1] << 8 | t6[e8 + 2] << 16) >>> 0;
}
function l2(t6, e8) {
return (t6[e8 + 0] << 0 | t6[e8 + 1] << 8 | t6[e8 + 2] << 16 | t6[e8 + 3] << 24) >>> 0;
}
new c2();
var f2 = [0], d2 = [0], p2 = [], g2 = new c2(), m2 = t5, v2 = function(t6, e8) {
var r3 = {}, n3 = 0, i3 = false, a3 = 0, o3 = 0;
if (r3.frames = [], !/** @license
* Copyright (c) 2017 Dominik Homberger
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
https://webpjs.appspot.com
WebPRiffParser dominikhlbg@gmail.com
*/
function(t7, e9, r4, n4) {
for (var i4 = 0; i4 < n4; i4++)
if (t7[e9 + i4] != r4.charCodeAt(i4))
return true;
return false;
}(t6, e8, "RIFF", 4)) {
var s3, c3;
l2(t6, e8 += 4);
for (e8 += 8; e8 < t6.length; ) {
var f3 = u2(t6, e8), d3 = l2(t6, e8 += 4);
e8 += 4;
var p3 = d3 + (1 & d3);
switch (f3) {
case "VP8 ":
case "VP8L":
void 0 === r3.frames[n3] && (r3.frames[n3] = {});
(v3 = r3.frames[n3]).src_off = i3 ? o3 : e8 - 8, v3.src_size = a3 + d3 + 8, n3++, i3 && (i3 = false, a3 = 0, o3 = 0);
break;
case "VP8X":
(v3 = r3.header = {}).feature_flags = t6[e8];
var g3 = e8 + 4;
v3.canvas_width = 1 + h2(t6, g3);
g3 += 3;
v3.canvas_height = 1 + h2(t6, g3);
g3 += 3;
break;
case "ALPH":
i3 = true, a3 = p3 + 8, o3 = e8 - 8;
break;
case "ANIM":
(v3 = r3.header).bgcolor = l2(t6, e8);
g3 = e8 + 4;
v3.loop_count = (s3 = t6)[(c3 = g3) + 0] << 0 | s3[c3 + 1] << 8;
g3 += 2;
break;
case "ANMF":
var m3, v3;
(v3 = r3.frames[n3] = {}).offset_x = 2 * h2(t6, e8), e8 += 3, v3.offset_y = 2 * h2(t6, e8), e8 += 3, v3.width = 1 + h2(t6, e8), e8 += 3, v3.height = 1 + h2(t6, e8), e8 += 3, v3.duration = h2(t6, e8), e8 += 3, m3 = t6[e8++], v3.dispose = 1 & m3, v3.blend = m3 >> 1 & 1;
}
"ANMF" != f3 && (e8 += p3);
}
return r3;
}
}(m2, 0);
v2.response = m2, v2.rgbaoutput = true, v2.dataurl = false;
var b2 = v2.header ? v2.header : null, y2 = v2.frames ? v2.frames : null;
if (b2) {
b2.loop_counter = b2.loop_count, f2 = [b2.canvas_height], d2 = [b2.canvas_width];
for (var w2 = 0; w2 < y2.length && 0 != y2[w2].blend; w2++)
;
}
var N2 = y2[0], L2 = g2.WebPDecodeRGBA(m2, N2.src_off, N2.src_size, d2, f2);
N2.rgba = L2, N2.imgwidth = d2[0], N2.imgheight = f2[0];
for (var A5 = 0; A5 < d2[0] * f2[0] * 4; A5++)
p2[A5] = L2[A5];
return this.width = d2, this.height = f2, this.data = p2, this;
}
!function(t5) {
var r2 = function() {
return "function" == typeof zlibSync;
}, n2 = function(r3, n3, a3, h3) {
var l3 = 4, f3 = s2;
switch (h3) {
case t5.image_compression.FAST:
l3 = 1, f3 = o2;
break;
case t5.image_compression.MEDIUM:
l3 = 6, f3 = c2;
break;
case t5.image_compression.SLOW:
l3 = 9, f3 = u2;
}
r3 = i2(r3, n3, a3, f3);
var d2 = zlibSync(r3, { level: l3 });
return t5.__addimage__.arrayBufferToBinaryString(d2);
}, i2 = function(t6, e7, r3, n3) {
for (var i3, a3, o3, s3 = t6.length / e7, c3 = new Uint8Array(t6.length + s3), u3 = l2(), h3 = 0; h3 < s3; h3 += 1) {
if (o3 = h3 * e7, i3 = t6.subarray(o3, o3 + e7), n3)
c3.set(n3(i3, r3, a3), o3 + h3);
else {
for (var d2, p2 = u3.length, g2 = []; d2 < p2; d2 += 1)
g2[d2] = u3[d2](i3, r3, a3);
var m2 = f2(g2.concat());
c3.set(g2[m2], o3 + h3);
}
a3 = i3;
}
return c3;
}, a2 = function(t6) {
var e7 = Array.apply([], t6);
return e7.unshift(0), e7;
}, o2 = function(t6, e7) {
var r3, n3 = [], i3 = t6.length;
n3[0] = 1;
for (var a3 = 0; a3 < i3; a3 += 1)
r3 = t6[a3 - e7] || 0, n3[a3 + 1] = t6[a3] - r3 + 256 & 255;
return n3;
}, s2 = function(t6, e7, r3) {
var n3, i3 = [], a3 = t6.length;
i3[0] = 2;
for (var o3 = 0; o3 < a3; o3 += 1)
n3 = r3 && r3[o3] || 0, i3[o3 + 1] = t6[o3] - n3 + 256 & 255;
return i3;
}, c2 = function(t6, e7, r3) {
var n3, i3, a3 = [], o3 = t6.length;
a3[0] = 3;
for (var s3 = 0; s3 < o3; s3 += 1)
n3 = t6[s3 - e7] || 0, i3 = r3 && r3[s3] || 0, a3[s3 + 1] = t6[s3] + 256 - (n3 + i3 >>> 1) & 255;
return a3;
}, u2 = function(t6, e7, r3) {
var n3, i3, a3, o3, s3 = [], c3 = t6.length;
s3[0] = 4;
for (var u3 = 0; u3 < c3; u3 += 1)
n3 = t6[u3 - e7] || 0, i3 = r3 && r3[u3] || 0, a3 = r3 && r3[u3 - e7] || 0, o3 = h2(n3, i3, a3), s3[u3 + 1] = t6[u3] - o3 + 256 & 255;
return s3;
}, h2 = function(t6, e7, r3) {
if (t6 === e7 && e7 === r3)
return t6;
var n3 = Math.abs(e7 - r3), i3 = Math.abs(t6 - r3), a3 = Math.abs(t6 + e7 - r3 - r3);
return n3 <= i3 && n3 <= a3 ? t6 : i3 <= a3 ? e7 : r3;
}, l2 = function() {
return [a2, o2, s2, c2, u2];
}, f2 = function(t6) {
var e7 = t6.map(function(t7) {
return t7.reduce(function(t8, e8) {
return t8 + Math.abs(e8);
}, 0);
});
return e7.indexOf(Math.min.apply(null, e7));
};
t5.processPNG = function(e7, i3, a3, o3) {
var s3, c3, u3, h3, l3, f3, d2, p2, g2, m2, v2, b2, y2, w2, N2, L2 = this.decode.FLATE_DECODE, A5 = "";
if (this.__addimage__.isArrayBuffer(e7) && (e7 = new Uint8Array(e7)), this.__addimage__.isArrayBufferView(e7)) {
if (e7 = (u3 = new Kt$1(e7)).imgData, c3 = u3.bits, s3 = u3.colorSpace, l3 = u3.colors, -1 !== [4, 6].indexOf(u3.colorType)) {
if (8 === u3.bits) {
g2 = (p2 = 32 == u3.pixelBitlength ? new Uint32Array(u3.decodePixels().buffer) : 16 == u3.pixelBitlength ? new Uint16Array(u3.decodePixels().buffer) : new Uint8Array(u3.decodePixels().buffer)).length, v2 = new Uint8Array(g2 * u3.colors), m2 = new Uint8Array(g2);
var x2, S2 = u3.pixelBitlength - u3.bits;
for (w2 = 0, N2 = 0; w2 < g2; w2++) {
for (y2 = p2[w2], x2 = 0; x2 < S2; )
v2[N2++] = y2 >>> x2 & 255, x2 += u3.bits;
m2[w2] = y2 >>> x2 & 255;
}
}
if (16 === u3.bits) {
g2 = (p2 = new Uint32Array(u3.decodePixels().buffer)).length, v2 = new Uint8Array(g2 * (32 / u3.pixelBitlength) * u3.colors), m2 = new Uint8Array(g2 * (32 / u3.pixelBitlength)), b2 = u3.colors > 1, w2 = 0, N2 = 0;
for (var _24 = 0; w2 < g2; )
y2 = p2[w2++], v2[N2++] = y2 >>> 0 & 255, b2 && (v2[N2++] = y2 >>> 16 & 255, y2 = p2[w2++], v2[N2++] = y2 >>> 0 & 255), m2[_24++] = y2 >>> 16 & 255;
c3 = 8;
}
o3 !== t5.image_compression.NONE && r2() ? (e7 = n2(v2, u3.width * u3.colors, u3.colors, o3), d2 = n2(m2, u3.width, 1, o3)) : (e7 = v2, d2 = m2, L2 = void 0);
}
if (3 === u3.colorType && (s3 = this.color_spaces.INDEXED, f3 = u3.palette, u3.transparency.indexed)) {
var P2 = u3.transparency.indexed, k2 = 0;
for (w2 = 0, g2 = P2.length; w2 < g2; ++w2)
k2 += P2[w2];
if ((k2 /= 255) === g2 - 1 && -1 !== P2.indexOf(0))
h3 = [P2.indexOf(0)];
else if (k2 !== g2) {
for (p2 = u3.decodePixels(), m2 = new Uint8Array(p2.length), w2 = 0, g2 = p2.length; w2 < g2; w2++)
m2[w2] = P2[p2[w2]];
d2 = n2(m2, u3.width, 1);
}
}
var I2 = function(e8) {
var r3;
switch (e8) {
case t5.image_compression.FAST:
r3 = 11;
break;
case t5.image_compression.MEDIUM:
r3 = 13;
break;
case t5.image_compression.SLOW:
r3 = 14;
break;
default:
r3 = 12;
}
return r3;
}(o3);
return L2 === this.decode.FLATE_DECODE && (A5 = "/Predictor " + I2 + " "), A5 += "/Colors " + l3 + " /BitsPerComponent " + c3 + " /Columns " + u3.width, (this.__addimage__.isArrayBuffer(e7) || this.__addimage__.isArrayBufferView(e7)) && (e7 = this.__addimage__.arrayBufferToBinaryString(e7)), (d2 && this.__addimage__.isArrayBuffer(d2) || this.__addimage__.isArrayBufferView(d2)) && (d2 = this.__addimage__.arrayBufferToBinaryString(d2)), { alias: a3, data: e7, index: i3, filter: L2, decodeParameters: A5, transparency: h3, palette: f3, sMask: d2, predictor: I2, width: u3.width, height: u3.height, bitsPerComponent: c3, colorSpace: s3 };
}
};
}(E$2.API), function(t5) {
t5.processGIF89A = function(e7, r2, n2, i2) {
var a2 = new Zt$1(e7), o2 = a2.width, s2 = a2.height, c2 = [];
a2.decodeAndBlitFrameRGBA(0, c2);
var u2 = { data: c2, width: o2, height: s2 }, h2 = new Qt$1(100).encode(u2, 100);
return t5.processJPEG.call(this, h2, r2, n2, i2);
}, t5.processGIF87A = t5.processGIF89A;
}(E$2.API), te$1.prototype.parseHeader = function() {
if (this.fileSize = this.datav.getUint32(this.pos, true), this.pos += 4, this.reserved = this.datav.getUint32(this.pos, true), this.pos += 4, this.offset = this.datav.getUint32(this.pos, true), this.pos += 4, this.headerSize = this.datav.getUint32(this.pos, true), this.pos += 4, this.width = this.datav.getUint32(this.pos, true), this.pos += 4, this.height = this.datav.getInt32(this.pos, true), this.pos += 4, this.planes = this.datav.getUint16(this.pos, true), this.pos += 2, this.bitPP = this.datav.getUint16(this.pos, true), this.pos += 2, this.compress = this.datav.getUint32(this.pos, true), this.pos += 4, this.rawSize = this.datav.getUint32(this.pos, true), this.pos += 4, this.hr = this.datav.getUint32(this.pos, true), this.pos += 4, this.vr = this.datav.getUint32(this.pos, true), this.pos += 4, this.colors = this.datav.getUint32(this.pos, true), this.pos += 4, this.importantColors = this.datav.getUint32(this.pos, true), this.pos += 4, 16 === this.bitPP && this.is_with_alpha && (this.bitPP = 15), this.bitPP < 15) {
var t5 = 0 === this.colors ? 1 << this.bitPP : this.colors;
this.palette = new Array(t5);
for (var e7 = 0; e7 < t5; e7++) {
var r2 = this.datav.getUint8(this.pos++, true), n2 = this.datav.getUint8(this.pos++, true), i2 = this.datav.getUint8(this.pos++, true), a2 = this.datav.getUint8(this.pos++, true);
this.palette[e7] = { red: i2, green: n2, blue: r2, quad: a2 };
}
}
this.height < 0 && (this.height *= -1, this.bottom_up = false);
}, te$1.prototype.parseBGR = function() {
this.pos = this.offset;
try {
var t5 = "bit" + this.bitPP, e7 = this.width * this.height * 4;
this.data = new Uint8Array(e7), this[t5]();
} catch (t6) {
a$m.log("bit decode error:" + t6);
}
}, te$1.prototype.bit1 = function() {
var t5, e7 = Math.ceil(this.width / 8), r2 = e7 % 4;
for (t5 = this.height - 1; t5 >= 0; t5--) {
for (var n2 = this.bottom_up ? t5 : this.height - 1 - t5, i2 = 0; i2 < e7; i2++)
for (var a2 = this.datav.getUint8(this.pos++, true), o2 = n2 * this.width * 4 + 8 * i2 * 4, s2 = 0; s2 < 8 && 8 * i2 + s2 < this.width; s2++) {
var c2 = this.palette[a2 >> 7 - s2 & 1];
this.data[o2 + 4 * s2] = c2.blue, this.data[o2 + 4 * s2 + 1] = c2.green, this.data[o2 + 4 * s2 + 2] = c2.red, this.data[o2 + 4 * s2 + 3] = 255;
}
0 !== r2 && (this.pos += 4 - r2);
}
}, te$1.prototype.bit4 = function() {
for (var t5 = Math.ceil(this.width / 2), e7 = t5 % 4, r2 = this.height - 1; r2 >= 0; r2--) {
for (var n2 = this.bottom_up ? r2 : this.height - 1 - r2, i2 = 0; i2 < t5; i2++) {
var a2 = this.datav.getUint8(this.pos++, true), o2 = n2 * this.width * 4 + 2 * i2 * 4, s2 = a2 >> 4, c2 = 15 & a2, u2 = this.palette[s2];
if (this.data[o2] = u2.blue, this.data[o2 + 1] = u2.green, this.data[o2 + 2] = u2.red, this.data[o2 + 3] = 255, 2 * i2 + 1 >= this.width)
break;
u2 = this.palette[c2], this.data[o2 + 4] = u2.blue, this.data[o2 + 4 + 1] = u2.green, this.data[o2 + 4 + 2] = u2.red, this.data[o2 + 4 + 3] = 255;
}
0 !== e7 && (this.pos += 4 - e7);
}
}, te$1.prototype.bit8 = function() {
for (var t5 = this.width % 4, e7 = this.height - 1; e7 >= 0; e7--) {
for (var r2 = this.bottom_up ? e7 : this.height - 1 - e7, n2 = 0; n2 < this.width; n2++) {
var i2 = this.datav.getUint8(this.pos++, true), a2 = r2 * this.width * 4 + 4 * n2;
if (i2 < this.palette.length) {
var o2 = this.palette[i2];
this.data[a2] = o2.red, this.data[a2 + 1] = o2.green, this.data[a2 + 2] = o2.blue, this.data[a2 + 3] = 255;
} else
this.data[a2] = 255, this.data[a2 + 1] = 255, this.data[a2 + 2] = 255, this.data[a2 + 3] = 255;
}
0 !== t5 && (this.pos += 4 - t5);
}
}, te$1.prototype.bit15 = function() {
for (var t5 = this.width % 3, e7 = parseInt("11111", 2), r2 = this.height - 1; r2 >= 0; r2--) {
for (var n2 = this.bottom_up ? r2 : this.height - 1 - r2, i2 = 0; i2 < this.width; i2++) {
var a2 = this.datav.getUint16(this.pos, true);
this.pos += 2;
var o2 = (a2 & e7) / e7 * 255 | 0, s2 = (a2 >> 5 & e7) / e7 * 255 | 0, c2 = (a2 >> 10 & e7) / e7 * 255 | 0, u2 = a2 >> 15 ? 255 : 0, h2 = n2 * this.width * 4 + 4 * i2;
this.data[h2] = c2, this.data[h2 + 1] = s2, this.data[h2 + 2] = o2, this.data[h2 + 3] = u2;
}
this.pos += t5;
}
}, te$1.prototype.bit16 = function() {
for (var t5 = this.width % 3, e7 = parseInt("11111", 2), r2 = parseInt("111111", 2), n2 = this.height - 1; n2 >= 0; n2--) {
for (var i2 = this.bottom_up ? n2 : this.height - 1 - n2, a2 = 0; a2 < this.width; a2++) {
var o2 = this.datav.getUint16(this.pos, true);
this.pos += 2;
var s2 = (o2 & e7) / e7 * 255 | 0, c2 = (o2 >> 5 & r2) / r2 * 255 | 0, u2 = (o2 >> 11) / e7 * 255 | 0, h2 = i2 * this.width * 4 + 4 * a2;
this.data[h2] = u2, this.data[h2 + 1] = c2, this.data[h2 + 2] = s2, this.data[h2 + 3] = 255;
}
this.pos += t5;
}
}, te$1.prototype.bit24 = function() {
for (var t5 = this.height - 1; t5 >= 0; t5--) {
for (var e7 = this.bottom_up ? t5 : this.height - 1 - t5, r2 = 0; r2 < this.width; r2++) {
var n2 = this.datav.getUint8(this.pos++, true), i2 = this.datav.getUint8(this.pos++, true), a2 = this.datav.getUint8(this.pos++, true), o2 = e7 * this.width * 4 + 4 * r2;
this.data[o2] = a2, this.data[o2 + 1] = i2, this.data[o2 + 2] = n2, this.data[o2 + 3] = 255;
}
this.pos += this.width % 4;
}
}, te$1.prototype.bit32 = function() {
for (var t5 = this.height - 1; t5 >= 0; t5--)
for (var e7 = this.bottom_up ? t5 : this.height - 1 - t5, r2 = 0; r2 < this.width; r2++) {
var n2 = this.datav.getUint8(this.pos++, true), i2 = this.datav.getUint8(this.pos++, true), a2 = this.datav.getUint8(this.pos++, true), o2 = this.datav.getUint8(this.pos++, true), s2 = e7 * this.width * 4 + 4 * r2;
this.data[s2] = a2, this.data[s2 + 1] = i2, this.data[s2 + 2] = n2, this.data[s2 + 3] = o2;
}
}, te$1.prototype.getData = function() {
return this.data;
}, /**
* @license
* Copyright (c) 2018 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
t5.processBMP = function(e7, r2, n2, i2) {
var a2 = new te$1(e7, false), o2 = a2.width, s2 = a2.height, c2 = { data: a2.getData(), width: o2, height: s2 }, u2 = new Qt$1(100).encode(c2, 100);
return t5.processJPEG.call(this, u2, r2, n2, i2);
};
}(E$2.API), ee$1.prototype.getData = function() {
return this.data;
}, /**
* @license
* Copyright (c) 2019 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
t5.processWEBP = function(e7, r2, n2, i2) {
var a2 = new ee$1(e7), o2 = a2.width, s2 = a2.height, c2 = { data: a2.getData(), width: o2, height: s2 }, u2 = new Qt$1(100).encode(c2, 100);
return t5.processJPEG.call(this, u2, r2, n2, i2);
};
}(E$2.API), E$2.API.processRGBA = function(t5, e7, r2) {
for (var n2 = t5.data, i2 = n2.length, a2 = new Uint8Array(i2 / 4 * 3), o2 = new Uint8Array(i2 / 4), s2 = 0, c2 = 0, u2 = 0; u2 < i2; u2 += 4) {
var h2 = n2[u2], l2 = n2[u2 + 1], f2 = n2[u2 + 2], d2 = n2[u2 + 3];
a2[s2++] = h2, a2[s2++] = l2, a2[s2++] = f2, o2[c2++] = d2;
}
var p2 = this.__addimage__.arrayBufferToBinaryString(a2);
return { alpha: this.__addimage__.arrayBufferToBinaryString(o2), data: p2, index: e7, alias: r2, colorSpace: "DeviceRGB", bitsPerComponent: 8, width: t5.width, height: t5.height };
}, E$2.API.setLanguage = function(t5) {
return void 0 === this.internal.languageSettings && (this.internal.languageSettings = {}, this.internal.languageSettings.isSubscribed = false), void 0 !== { af: "Afrikaans", sq: "Albanian", ar: "Arabic (Standard)", "ar-DZ": "Arabic (Algeria)", "ar-BH": "Arabic (Bahrain)", "ar-EG": "Arabic (Egypt)", "ar-IQ": "Arabic (Iraq)", "ar-JO": "Arabic (Jordan)", "ar-KW": "Arabic (Kuwait)", "ar-LB": "Arabic (Lebanon)", "ar-LY": "Arabic (Libya)", "ar-MA": "Arabic (Morocco)", "ar-OM": "Arabic (Oman)", "ar-QA": "Arabic (Qatar)", "ar-SA": "Arabic (Saudi Arabia)", "ar-SY": "Arabic (Syria)", "ar-TN": "Arabic (Tunisia)", "ar-AE": "Arabic (U.A.E.)", "ar-YE": "Arabic (Yemen)", an: "Aragonese", hy: "Armenian", as: "Assamese", ast: "Asturian", az: "Azerbaijani", eu: "Basque", be: "Belarusian", bn: "Bengali", bs: "Bosnian", br: "Breton", bg: "Bulgarian", my: "Burmese", ca: "Catalan", ch: "Chamorro", ce: "Chechen", zh: "Chinese", "zh-HK": "Chinese (Hong Kong)", "zh-CN": "Chinese (PRC)", "zh-SG": "Chinese (Singapore)", "zh-TW": "Chinese (Taiwan)", cv: "Chuvash", co: "Corsican", cr: "Cree", hr: "Croatian", cs: "Czech", da: "Danish", nl: "Dutch (Standard)", "nl-BE": "Dutch (Belgian)", en: "English", "en-AU": "English (Australia)", "en-BZ": "English (Belize)", "en-CA": "English (Canada)", "en-IE": "English (Ireland)", "en-JM": "English (Jamaica)", "en-NZ": "English (New Zealand)", "en-PH": "English (Philippines)", "en-ZA": "English (South Africa)", "en-TT": "English (Trinidad & Tobago)", "en-GB": "English (United Kingdom)", "en-US": "English (United States)", "en-ZW": "English (Zimbabwe)", eo: "Esperanto", et: "Estonian", fo: "Faeroese", fj: "Fijian", fi: "Finnish", fr: "French (Standard)", "fr-BE": "French (Belgium)", "fr-CA": "French (Canada)", "fr-FR": "French (France)", "fr-LU": "French (Luxembourg)", "fr-MC": "French (Monaco)", "fr-CH": "French (Switzerland)", fy: "Frisian", fur: "Friulian", gd: "Gaelic (Scots)", "gd-IE": "Gaelic (Irish)", gl: "Galacian", ka: "Georgian", de: "German (Standard)", "de-AT": "German (Austria)", "de-DE": "German (Germany)", "de-LI": "German (Liechtenstein)", "de-LU": "German (Luxembourg)", "de-CH": "German (Switzerland)", el: "Greek", gu: "Gujurati", ht: "Haitian", he: "Hebrew", hi: "Hindi", hu: "Hungarian", is: "Icelandic", id: "Indonesian", iu: "Inuktitut", ga: "Irish", it: "Italian (Standard)", "it-CH": "Italian (Switzerland)", ja: "Japanese", kn: "Kannada", ks: "Kashmiri", kk: "Kazakh", km: "Khmer", ky: "Kirghiz", tlh: "Klingon", ko: "Korean", "ko-KP": "Korean (North Korea)", "ko-KR": "Korean (South Korea)", la: "Latin", lv: "Latvian", lt: "Lithuanian", lb: "Luxembourgish", mk: "North Macedonia", ms: "Malay", ml: "Malayalam", mt: "Maltese", mi: "Maori", mr: "Marathi", mo: "Moldavian", nv: "Navajo", ng: "Ndonga", ne: "Nepali", no: "Norwegian", nb: "Norwegian (Bokmal)", nn: "Norwegian (Nynorsk)", oc: "Occitan", or: "Oriya", om: "Oromo", fa: "Persian", "fa-IR": "Persian/Iran", pl: "Polish", pt: "Portuguese", "pt-BR": "Portuguese (Brazil)", pa: "Punjabi", "pa-IN": "Punjabi (India)", "pa-PK": "Punjabi (Pakistan)", qu: "Quechua", rm: "Rhaeto-Romanic", ro: "Romanian", "ro-MO": "Romanian (Moldavia)", ru: "Russian", "ru-MO": "Russian (Moldavia)", sz: "Sami (Lappish)", sg: "Sango", sa: "Sanskrit", sc: "Sardinian", sd: "Sindhi", si: "Singhalese", sr: "Serbian", sk: "Slovak", sl: "Slovenian", so: "Somani", sb: "Sorbian", es: "Spanish", "es-AR": "Spanish (Argentina)", "es-BO": "Spanish (Bolivia)", "es-CL": "Spanish (Chile)", "es-CO": "Spanish (Colombia)", "es-CR": "Spanish (Costa Rica)", "es-DO": "Spanish (Dominican Republic)", "es-EC": "Spanish (Ecuador)", "es-SV": "Spanish (El Salvador)", "es-GT": "Spanish (Guatemala)", "es-HN": "Spanish (Honduras)", "es-MX": "Spanish (Mexico)", "es-NI": "Spanish (Nicaragua)", "es-PA": "Spanish (Panama)", "es-PY": "Spanish (Paraguay)", "es-PE": "Spanish (Peru)", "es-PR": "Spanish (Puerto Rico)", "es-ES": "Spanish (Spain)", "es-UY": "Spanish (Uruguay)", "es-VE": "Spanish (Venezuela)", sx: "Sutu", sw: "Swahili", sv: "Swedish", "sv-FI": "Swedish (Finland)", "sv-SV": "Swedish (Sweden)", ta: "Tamil", tt: "Tatar", te: "Teluga", th: "Thai", tig: "Tigre", ts: "Tsonga", tn: "Tswana", tr: "Turkish", tk: "Turkmen", uk: "Ukrainian", hsb: "Upper Sorbian", ur: "Urdu", ve: "Venda", vi: "Vietnamese", vo: "Volapuk", wa: "Walloon", cy: "Welsh", xh: "Xhosa", ji: "Yiddish", zu: "Zulu" }[t5] && (this.internal.languageSettings.languageCode = t5, false === this.internal.languageSettings.isSubscribed && (this.internal.events.subscribe("putCatalog", function() {
this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")");
}), this.internal.languageSettings.isSubscribed = true)), this;
}, Vt$1 = E$2.API, Gt$1 = Vt$1.getCharWidthsArray = function(e7, r2) {
var n2, i2, a2 = (r2 = r2 || {}).font || this.internal.getFont(), o2 = r2.fontSize || this.internal.getFontSize(), s2 = r2.charSpace || this.internal.getCharSpace(), c2 = r2.widths ? r2.widths : a2.metadata.Unicode.widths, u2 = c2.fof ? c2.fof : 1, h2 = r2.kerning ? r2.kerning : a2.metadata.Unicode.kerning, l2 = h2.fof ? h2.fof : 1, f2 = false !== r2.doKerning, d2 = 0, p2 = e7.length, g2 = 0, m2 = c2[0] || u2, v2 = [];
for (n2 = 0; n2 < p2; n2++)
i2 = e7.charCodeAt(n2), "function" == typeof a2.metadata.widthOfString ? v2.push((a2.metadata.widthOfGlyph(a2.metadata.characterToGlyph(i2)) + s2 * (1e3 / o2) || 0) / 1e3) : (d2 = f2 && "object" === _typeof$3(h2[i2]) && !isNaN(parseInt(h2[i2][g2], 10)) ? h2[i2][g2] / l2 : 0, v2.push((c2[i2] || m2) / u2 + d2)), g2 = i2;
return v2;
}, Yt$1 = Vt$1.getStringUnitWidth = function(t5, e7) {
var r2 = (e7 = e7 || {}).fontSize || this.internal.getFontSize(), n2 = e7.font || this.internal.getFont(), i2 = e7.charSpace || this.internal.getCharSpace();
return Vt$1.processArabic && (t5 = Vt$1.processArabic(t5)), "function" == typeof n2.metadata.widthOfString ? n2.metadata.widthOfString(t5, r2, i2) / r2 : Gt$1.apply(this, arguments).reduce(function(t6, e8) {
return t6 + e8;
}, 0);
}, Jt$1 = function(t5, e7, r2, n2) {
for (var i2 = [], a2 = 0, o2 = t5.length, s2 = 0; a2 !== o2 && s2 + e7[a2] < r2; )
s2 += e7[a2], a2++;
i2.push(t5.slice(0, a2));
var c2 = a2;
for (s2 = 0; a2 !== o2; )
s2 + e7[a2] > n2 && (i2.push(t5.slice(c2, a2)), s2 = 0, c2 = a2), s2 += e7[a2], a2++;
return c2 !== a2 && i2.push(t5.slice(c2, a2)), i2;
}, Xt$1 = function(t5, e7, r2) {
r2 || (r2 = {});
var n2, i2, a2, o2, s2, c2, u2, h2 = [], l2 = [h2], f2 = r2.textIndent || 0, d2 = 0, p2 = 0, g2 = t5.split(" "), m2 = Gt$1.apply(this, [" ", r2])[0];
if (c2 = -1 === r2.lineIndent ? g2[0].length + 2 : r2.lineIndent || 0) {
var v2 = Array(c2).join(" "), b2 = [];
g2.map(function(t6) {
(t6 = t6.split(/\s*\n/)).length > 1 ? b2 = b2.concat(t6.map(function(t7, e8) {
return (e8 && t7.length ? "\n" : "") + t7;
})) : b2.push(t6[0]);
}), g2 = b2, c2 = Yt$1.apply(this, [v2, r2]);
}
for (a2 = 0, o2 = g2.length; a2 < o2; a2++) {
var y2 = 0;
if (n2 = g2[a2], c2 && "\n" == n2[0] && (n2 = n2.substr(1), y2 = 1), f2 + d2 + (p2 = (i2 = Gt$1.apply(this, [n2, r2])).reduce(function(t6, e8) {
return t6 + e8;
}, 0)) > e7 || y2) {
if (p2 > e7) {
for (s2 = Jt$1.apply(this, [n2, i2, e7 - (f2 + d2), e7]), h2.push(s2.shift()), h2 = [s2.pop()]; s2.length; )
l2.push([s2.shift()]);
p2 = i2.slice(n2.length - (h2[0] ? h2[0].length : 0)).reduce(function(t6, e8) {
return t6 + e8;
}, 0);
} else
h2 = [n2];
l2.push(h2), f2 = p2 + c2, d2 = m2;
} else
h2.push(n2), f2 += d2 + p2, d2 = m2;
}
return u2 = c2 ? function(t6, e8) {
return (e8 ? v2 : "") + t6.join(" ");
} : function(t6) {
return t6.join(" ");
}, l2.map(u2);
}, Vt$1.splitTextToSize = function(t5, e7, r2) {
var n2, i2 = (r2 = r2 || {}).fontSize || this.internal.getFontSize(), a2 = (function(t6) {
if (t6.widths && t6.kerning)
return { widths: t6.widths, kerning: t6.kerning };
var e8 = this.internal.getFont(t6.fontName, t6.fontStyle);
return e8.metadata.Unicode ? { widths: e8.metadata.Unicode.widths || { 0: 1 }, kerning: e8.metadata.Unicode.kerning || {} } : { font: e8.metadata, fontSize: this.internal.getFontSize(), charSpace: this.internal.getCharSpace() };
}).call(this, r2);
n2 = Array.isArray(t5) ? t5 : String(t5).split(/\r?\n/);
var o2 = 1 * this.internal.scaleFactor * e7 / i2;
a2.textIndent = r2.textIndent ? 1 * r2.textIndent * this.internal.scaleFactor / i2 : 0, a2.lineIndent = r2.lineIndent;
var s2, c2, u2 = [];
for (s2 = 0, c2 = n2.length; s2 < c2; s2++)
u2 = u2.concat(Xt$1.apply(this, [n2[s2], o2, a2]));
return u2;
}, function(e7) {
e7.__fontmetrics__ = e7.__fontmetrics__ || {};
for (var r2 = "klmnopqrstuvwxyz", n2 = {}, i2 = {}, a2 = 0; a2 < r2.length; a2++)
n2[r2[a2]] = "0123456789abcdef"[a2], i2["0123456789abcdef"[a2]] = r2[a2];
var o2 = function(t5) {
return "0x" + parseInt(t5, 10).toString(16);
}, s2 = e7.__fontmetrics__.compress = function(e8) {
var r3, n3, a3, c3, u3 = ["{"];
for (var h3 in e8) {
if (r3 = e8[h3], isNaN(parseInt(h3, 10)) ? n3 = "'" + h3 + "'" : (h3 = parseInt(h3, 10), n3 = (n3 = o2(h3).slice(2)).slice(0, -1) + i2[n3.slice(-1)]), "number" == typeof r3)
r3 < 0 ? (a3 = o2(r3).slice(3), c3 = "-") : (a3 = o2(r3).slice(2), c3 = ""), a3 = c3 + a3.slice(0, -1) + i2[a3.slice(-1)];
else {
if ("object" !== _typeof$3(r3))
throw new Error("Don't know what to do with value type " + _typeof$3(r3) + ".");
a3 = s2(r3);
}
u3.push(n3 + a3);
}
return u3.push("}"), u3.join("");
}, c2 = e7.__fontmetrics__.uncompress = function(t5) {
if ("string" != typeof t5)
throw new Error("Invalid argument passed to uncompress.");
for (var e8, r3, i3, a3, o3 = {}, s3 = 1, c3 = o3, u3 = [], h3 = "", l3 = "", f2 = t5.length - 1, d2 = 1; d2 < f2; d2 += 1)
"'" == (a3 = t5[d2]) ? e8 ? (i3 = e8.join(""), e8 = void 0) : e8 = [] : e8 ? e8.push(a3) : "{" == a3 ? (u3.push([c3, i3]), c3 = {}, i3 = void 0) : "}" == a3 ? ((r3 = u3.pop())[0][r3[1]] = c3, i3 = void 0, c3 = r3[0]) : "-" == a3 ? s3 = -1 : void 0 === i3 ? n2.hasOwnProperty(a3) ? (h3 += n2[a3], i3 = parseInt(h3, 16) * s3, s3 = 1, h3 = "") : h3 += a3 : n2.hasOwnProperty(a3) ? (l3 += n2[a3], c3[i3] = parseInt(l3, 16) * s3, s3 = 1, i3 = void 0, l3 = "") : l3 += a3;
return o3;
}, u2 = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: c2("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, h2 = { Unicode: { Courier: u2, "Courier-Bold": u2, "Courier-BoldOblique": u2, "Courier-Oblique": u2, Helvetica: u2, "Helvetica-Bold": u2, "Helvetica-BoldOblique": u2, "Helvetica-Oblique": u2, "Times-Roman": u2, "Times-Bold": u2, "Times-BoldItalic": u2, "Times-Italic": u2 } }, l2 = { Unicode: { "Courier-Oblique": c2("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": c2("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"), "Helvetica-Bold": c2("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), Courier: c2("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": c2("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": c2("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"), Symbol: c2("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"), Helvetica: c2("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"), "Helvetica-BoldOblique": c2("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), ZapfDingbats: c2("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-Bold": c2("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": c2("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"), "Times-Roman": c2("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"), "Helvetica-Oblique": c2("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } };
e7.events.push(["addFont", function(t5) {
var e8 = t5.font, r3 = l2.Unicode[e8.postScriptName];
r3 && (e8.metadata.Unicode = {}, e8.metadata.Unicode.widths = r3.widths, e8.metadata.Unicode.kerning = r3.kerning);
var n3 = h2.Unicode[e8.postScriptName];
n3 && (e8.metadata.Unicode.encoding = n3, e8.encoding = n3.codePages[0]);
}]);
}(E$2.API), /**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7 = function(t6) {
for (var e8 = t6.length, r2 = new Uint8Array(e8), n2 = 0; n2 < e8; n2++)
r2[n2] = t6.charCodeAt(n2);
return r2;
};
t5.API.events.push(["addFont", function(r2) {
var n2 = void 0, i2 = r2.font, a2 = r2.instance;
if (!i2.isStandardFont) {
if (void 0 === a2)
throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + i2.postScriptName + "').");
if ("string" != typeof (n2 = false === a2.existsFileInVFS(i2.postScriptName) ? a2.loadFile(i2.postScriptName) : a2.getFileFromVFS(i2.postScriptName)))
throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + i2.postScriptName + "').");
!function(r3, n3) {
n3 = /^\x00\x01\x00\x00/.test(n3) ? e7(n3) : e7(u$7(n3)), r3.metadata = t5.API.TTFFont.open(n3), r3.metadata.Unicode = r3.metadata.Unicode || { encoding: {}, kerning: {}, widths: [] }, r3.metadata.glyIdsUsed = [0];
}(i2, n2);
}
}]);
}(E$2), /** @license
* Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
function(t5) {
function e7() {
return (n$8.canvg ? Promise.resolve(n$8.canvg) : __vitePreload(() => Promise.resolve().then(() => index_es), true ? void 0 : void 0)).catch(function(t6) {
return Promise.reject(new Error("Could not load canvg: " + t6));
}).then(function(t6) {
return t6.default ? t6.default : t6;
});
}
E$2.API.addSvgAsImage = function(t6, r2, n2, i2, o2, s2, c2, u2) {
if (isNaN(r2) || isNaN(n2))
throw a$m.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
if (isNaN(i2) || isNaN(o2))
throw a$m.error("jsPDF.addSvgAsImage: Invalid measurements", arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
var h2 = document.createElement("canvas");
h2.width = i2, h2.height = o2;
var l2 = h2.getContext("2d");
l2.fillStyle = "#fff", l2.fillRect(0, 0, h2.width, h2.height);
var f2 = { ignoreMouse: true, ignoreAnimation: true, ignoreDimensions: true }, d2 = this;
return e7().then(function(e8) {
return e8.fromString(l2, t6, f2);
}, function() {
return Promise.reject(new Error("Could not load canvg."));
}).then(function(t7) {
return t7.render(f2);
}).then(function() {
d2.addImage(h2.toDataURL("image/jpeg", 1), r2, n2, i2, o2, c2, u2);
});
};
}(), E$2.API.putTotalPages = function(t5) {
var e7, r2 = 0;
parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (e7 = new RegExp(t5, "g"), r2 = this.internal.getNumberOfPages()) : (e7 = new RegExp(this.pdfEscape16(t5, this.internal.getFont()), "g"), r2 = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
for (var n2 = 1; n2 <= this.internal.getNumberOfPages(); n2++)
for (var i2 = 0; i2 < this.internal.pages[n2].length; i2++)
this.internal.pages[n2][i2] = this.internal.pages[n2][i2].replace(e7, r2);
return this;
}, E$2.API.viewerPreferences = function(e7, r2) {
var n2;
e7 = e7 || {}, r2 = r2 || false;
var i2, a2, o2, s2 = { HideToolbar: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, HideMenubar: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, HideWindowUI: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, FitWindow: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, CenterWindow: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.3 }, DisplayDocTitle: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.4 }, NonFullScreenPageMode: { defaultValue: "UseNone", value: "UseNone", type: "name", explicitSet: false, valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"], pdfVersion: 1.3 }, Direction: { defaultValue: "L2R", value: "L2R", type: "name", explicitSet: false, valueSet: ["L2R", "R2L"], pdfVersion: 1.3 }, ViewArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, ViewClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: false, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintScaling: { defaultValue: "AppDefault", value: "AppDefault", type: "name", explicitSet: false, valueSet: ["AppDefault", "None"], pdfVersion: 1.6 }, Duplex: { defaultValue: "", value: "none", type: "name", explicitSet: false, valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"], pdfVersion: 1.7 }, PickTrayByPDFSize: { defaultValue: false, value: false, type: "boolean", explicitSet: false, valueSet: [true, false], pdfVersion: 1.7 }, PrintPageRange: { defaultValue: "", value: "", type: "array", explicitSet: false, valueSet: null, pdfVersion: 1.7 }, NumCopies: { defaultValue: 1, value: 1, type: "integer", explicitSet: false, valueSet: null, pdfVersion: 1.7 } }, c2 = Object.keys(s2), u2 = [], h2 = 0, l2 = 0, f2 = 0;
function d2(t5, e8) {
var r3, n3 = false;
for (r3 = 0; r3 < t5.length; r3 += 1)
t5[r3] === e8 && (n3 = true);
return n3;
}
if (void 0 === this.internal.viewerpreferences && (this.internal.viewerpreferences = {}, this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(s2)), this.internal.viewerpreferences.isSubscribed = false), n2 = this.internal.viewerpreferences.configuration, "reset" === e7 || true === r2) {
var p2 = c2.length;
for (f2 = 0; f2 < p2; f2 += 1)
n2[c2[f2]].value = n2[c2[f2]].defaultValue, n2[c2[f2]].explicitSet = false;
}
if ("object" === _typeof$3(e7)) {
for (a2 in e7)
if (o2 = e7[a2], d2(c2, a2) && void 0 !== o2) {
if ("boolean" === n2[a2].type && "boolean" == typeof o2)
n2[a2].value = o2;
else if ("name" === n2[a2].type && d2(n2[a2].valueSet, o2))
n2[a2].value = o2;
else if ("integer" === n2[a2].type && Number.isInteger(o2))
n2[a2].value = o2;
else if ("array" === n2[a2].type) {
for (h2 = 0; h2 < o2.length; h2 += 1)
if (i2 = true, 1 === o2[h2].length && "number" == typeof o2[h2][0])
u2.push(String(o2[h2] - 1));
else if (o2[h2].length > 1) {
for (l2 = 0; l2 < o2[h2].length; l2 += 1)
"number" != typeof o2[h2][l2] && (i2 = false);
true === i2 && u2.push([o2[h2][0] - 1, o2[h2][1] - 1].join(" "));
}
n2[a2].value = "[" + u2.join(" ") + "]";
} else
n2[a2].value = n2[a2].defaultValue;
n2[a2].explicitSet = true;
}
}
return false === this.internal.viewerpreferences.isSubscribed && (this.internal.events.subscribe("putCatalog", function() {
var t5, e8 = [];
for (t5 in n2)
true === n2[t5].explicitSet && ("name" === n2[t5].type ? e8.push("/" + t5 + " /" + n2[t5].value) : e8.push("/" + t5 + " " + n2[t5].value));
0 !== e8.length && this.internal.write("/ViewerPreferences\n<<\n" + e8.join("\n") + "\n>>");
}), this.internal.viewerpreferences.isSubscribed = true), this.internal.viewerpreferences.configuration = n2, this;
}, /** ====================================================================
* @license
* jsPDF XMP metadata plugin
* Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
function(t5) {
var e7 = function() {
var t6 = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + this.internal.__metadata__.namespaceuri + '"><jspdf:metadata>', e8 = unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')), r3 = unescape(encodeURIComponent(t6)), n2 = unescape(encodeURIComponent(this.internal.__metadata__.metadata)), i2 = unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")), a2 = unescape(encodeURIComponent("</x:xmpmeta>")), o2 = r3.length + n2.length + i2.length + e8.length + a2.length;
this.internal.__metadata__.metadata_object_number = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + o2 + " >>"), this.internal.write("stream"), this.internal.write(e8 + r3 + n2 + i2 + a2), this.internal.write("endstream"), this.internal.write("endobj");
}, r2 = function() {
this.internal.__metadata__.metadata_object_number && this.internal.write("/Metadata " + this.internal.__metadata__.metadata_object_number + " 0 R");
};
t5.addMetadata = function(t6, n2) {
return void 0 === this.internal.__metadata__ && (this.internal.__metadata__ = { metadata: t6, namespaceuri: n2 || "http://jspdf.default.namespaceuri/" }, this.internal.events.subscribe("putCatalog", r2), this.internal.events.subscribe("postPutResources", e7)), this;
};
}(E$2.API), function(t5) {
var e7 = t5.API, r2 = e7.pdfEscape16 = function(t6, e8) {
for (var r3, n3 = e8.metadata.Unicode.widths, i3 = ["", "0", "00", "000", "0000"], a2 = [""], o2 = 0, s2 = t6.length; o2 < s2; ++o2) {
if (r3 = e8.metadata.characterToGlyph(t6.charCodeAt(o2)), e8.metadata.glyIdsUsed.push(r3), e8.metadata.toUnicode[r3] = t6.charCodeAt(o2), -1 == n3.indexOf(r3) && (n3.push(r3), n3.push([parseInt(e8.metadata.widthOfGlyph(r3), 10)])), "0" == r3)
return a2.join("");
r3 = r3.toString(16), a2.push(i3[4 - r3.length], r3);
}
return a2.join("");
}, n2 = function(t6) {
var e8, r3, n3, i3, a2, o2, s2;
for (a2 = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange", n3 = [], o2 = 0, s2 = (r3 = Object.keys(t6).sort(function(t7, e9) {
return t7 - e9;
})).length; o2 < s2; o2++)
e8 = r3[o2], n3.length >= 100 && (a2 += "\n" + n3.length + " beginbfchar\n" + n3.join("\n") + "\nendbfchar", n3 = []), void 0 !== t6[e8] && null !== t6[e8] && "function" == typeof t6[e8].toString && (i3 = ("0000" + t6[e8].toString(16)).slice(-4), e8 = ("0000" + (+e8).toString(16)).slice(-4), n3.push("<" + e8 + "><" + i3 + ">"));
return n3.length && (a2 += "\n" + n3.length + " beginbfchar\n" + n3.join("\n") + "\nendbfchar\n"), a2 += "endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend";
};
e7.events.push(["putFont", function(e8) {
!function(e9) {
var r3 = e9.font, i3 = e9.out, a2 = e9.newObject, o2 = e9.putStream;
if (r3.metadata instanceof t5.API.TTFFont && "Identity-H" === r3.encoding) {
for (var s2 = r3.metadata.Unicode.widths, c2 = r3.metadata.subset.encode(r3.metadata.glyIdsUsed, 1), u2 = "", h2 = 0; h2 < c2.length; h2++)
u2 += String.fromCharCode(c2[h2]);
var l2 = a2();
o2({ data: u2, addLength1: true, objectId: l2 }), i3("endobj");
var f2 = a2();
o2({ data: n2(r3.metadata.toUnicode), addLength1: true, objectId: f2 }), i3("endobj");
var d2 = a2();
i3("<<"), i3("/Type /FontDescriptor"), i3("/FontName /" + F$2(r3.fontName)), i3("/FontFile2 " + l2 + " 0 R"), i3("/FontBBox " + t5.API.PDFObject.convert(r3.metadata.bbox)), i3("/Flags " + r3.metadata.flags), i3("/StemV " + r3.metadata.stemV), i3("/ItalicAngle " + r3.metadata.italicAngle), i3("/Ascent " + r3.metadata.ascender), i3("/Descent " + r3.metadata.decender), i3("/CapHeight " + r3.metadata.capHeight), i3(">>"), i3("endobj");
var p2 = a2();
i3("<<"), i3("/Type /Font"), i3("/BaseFont /" + F$2(r3.fontName)), i3("/FontDescriptor " + d2 + " 0 R"), i3("/W " + t5.API.PDFObject.convert(s2)), i3("/CIDToGIDMap /Identity"), i3("/DW 1000"), i3("/Subtype /CIDFontType2"), i3("/CIDSystemInfo"), i3("<<"), i3("/Supplement 0"), i3("/Registry (Adobe)"), i3("/Ordering (" + r3.encoding + ")"), i3(">>"), i3(">>"), i3("endobj"), r3.objectNumber = a2(), i3("<<"), i3("/Type /Font"), i3("/Subtype /Type0"), i3("/ToUnicode " + f2 + " 0 R"), i3("/BaseFont /" + F$2(r3.fontName)), i3("/Encoding /" + r3.encoding), i3("/DescendantFonts [" + p2 + " 0 R]"), i3(">>"), i3("endobj"), r3.isAlreadyPutted = true;
}
}(e8);
}]);
e7.events.push(["putFont", function(e8) {
!function(e9) {
var r3 = e9.font, i3 = e9.out, a2 = e9.newObject, o2 = e9.putStream;
if (r3.metadata instanceof t5.API.TTFFont && "WinAnsiEncoding" === r3.encoding) {
for (var s2 = r3.metadata.rawData, c2 = "", u2 = 0; u2 < s2.length; u2++)
c2 += String.fromCharCode(s2[u2]);
var h2 = a2();
o2({ data: c2, addLength1: true, objectId: h2 }), i3("endobj");
var l2 = a2();
o2({ data: n2(r3.metadata.toUnicode), addLength1: true, objectId: l2 }), i3("endobj");
var f2 = a2();
i3("<<"), i3("/Descent " + r3.metadata.decender), i3("/CapHeight " + r3.metadata.capHeight), i3("/StemV " + r3.metadata.stemV), i3("/Type /FontDescriptor"), i3("/FontFile2 " + h2 + " 0 R"), i3("/Flags 96"), i3("/FontBBox " + t5.API.PDFObject.convert(r3.metadata.bbox)), i3("/FontName /" + F$2(r3.fontName)), i3("/ItalicAngle " + r3.metadata.italicAngle), i3("/Ascent " + r3.metadata.ascender), i3(">>"), i3("endobj"), r3.objectNumber = a2();
for (var d2 = 0; d2 < r3.metadata.hmtx.widths.length; d2++)
r3.metadata.hmtx.widths[d2] = parseInt(r3.metadata.hmtx.widths[d2] * (1e3 / r3.metadata.head.unitsPerEm));
i3("<</Subtype/TrueType/Type/Font/ToUnicode " + l2 + " 0 R/BaseFont/" + F$2(r3.fontName) + "/FontDescriptor " + f2 + " 0 R/Encoding/" + r3.encoding + " /FirstChar 29 /LastChar 255 /Widths " + t5.API.PDFObject.convert(r3.metadata.hmtx.widths) + ">>"), i3("endobj"), r3.isAlreadyPutted = true;
}
}(e8);
}]);
var i2 = function(t6) {
var e8, n3 = t6.text || "", i3 = t6.x, a2 = t6.y, o2 = t6.options || {}, s2 = t6.mutex || {}, c2 = s2.pdfEscape, u2 = s2.activeFontKey, h2 = s2.fonts, l2 = u2, f2 = "", d2 = 0, p2 = "", g2 = h2[l2].encoding;
if ("Identity-H" !== h2[l2].encoding)
return { text: n3, x: i3, y: a2, options: o2, mutex: s2 };
for (p2 = n3, l2 = u2, Array.isArray(n3) && (p2 = n3[0]), d2 = 0; d2 < p2.length; d2 += 1)
h2[l2].metadata.hasOwnProperty("cmap") && (e8 = h2[l2].metadata.cmap.unicode.codeMap[p2[d2].charCodeAt(0)]), e8 || p2[d2].charCodeAt(0) < 256 && h2[l2].metadata.hasOwnProperty("Unicode") ? f2 += p2[d2] : f2 += "";
var m2 = "";
return parseInt(l2.slice(1)) < 14 || "WinAnsiEncoding" === g2 ? m2 = c2(f2, l2).split("").map(function(t7) {
return t7.charCodeAt(0).toString(16);
}).join("") : "Identity-H" === g2 && (m2 = r2(f2, h2[l2])), s2.isHex = true, { text: m2, x: i3, y: a2, options: o2, mutex: s2 };
};
e7.events.push(["postProcessText", function(t6) {
var e8 = t6.text || "", r3 = [], n3 = { text: e8, x: t6.x, y: t6.y, options: t6.options, mutex: t6.mutex };
if (Array.isArray(e8)) {
var a2 = 0;
for (a2 = 0; a2 < e8.length; a2 += 1)
Array.isArray(e8[a2]) && 3 === e8[a2].length ? r3.push([i2(Object.assign({}, n3, { text: e8[a2][0] })).text, e8[a2][1], e8[a2][2]]) : r3.push(i2(Object.assign({}, n3, { text: e8[a2] })).text);
t6.text = r3;
} else
t6.text = i2(Object.assign({}, n3, { text: e8 })).text;
}]);
}(E$2), /**
* @license
* jsPDF virtual FileSystem functionality
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(t5) {
var e7 = function() {
return void 0 === this.internal.vFS && (this.internal.vFS = {}), true;
};
t5.existsFileInVFS = function(t6) {
return e7.call(this), void 0 !== this.internal.vFS[t6];
}, t5.addFileToVFS = function(t6, r2) {
return e7.call(this), this.internal.vFS[t6] = r2, this;
}, t5.getFileFromVFS = function(t6) {
return e7.call(this), void 0 !== this.internal.vFS[t6] ? this.internal.vFS[t6] : null;
};
}(E$2.API), /**
* @license
* Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
* MIT License
*/
function(t5) {
t5.__bidiEngine__ = t5.prototype.__bidiEngine__ = function(t6) {
var r3, n2, i2, a2, o2, s2, c2, u2 = e7, h2 = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], l2 = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], f2 = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 }, d2 = { 0: 0, 5: 1, 6: 2, 7: 3, 32: 4, 251: 5, 254: 6, 255: 7 }, p2 = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "«", "»", "«", "‹", "›", "‹", "⁅", "⁆", "⁅", "⁽", "⁾", "⁽", "₍", "₎", "₍", "≤", "≥", "≤", "〈", "〉", "〈", "﹙", "﹚", "﹙", "﹛", "﹜", "﹛", "﹝", "﹞", "﹝", "﹤", "﹥", "﹤"], g2 = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/), m2 = false, v2 = 0;
this.__bidiEngine__ = {};
var b2 = function(t7) {
var e8 = t7.charCodeAt(), r4 = e8 >> 8, n3 = d2[r4];
return void 0 !== n3 ? u2[256 * n3 + (255 & e8)] : 252 === r4 || 253 === r4 ? "AL" : g2.test(r4) ? "L" : 8 === r4 ? "R" : "N";
}, y2 = function(t7) {
for (var e8, r4 = 0; r4 < t7.length; r4++) {
if ("L" === (e8 = b2(t7.charAt(r4))))
return false;
if ("R" === e8)
return true;
}
return false;
}, w2 = function(t7, e8, o3, s3) {
var c3, u3, h3, l3, f3 = e8[s3];
switch (f3) {
case "L":
case "R":
m2 = false;
break;
case "N":
case "AN":
break;
case "EN":
m2 && (f3 = "AN");
break;
case "AL":
m2 = true, f3 = "R";
break;
case "WS":
f3 = "N";
break;
case "CS":
s3 < 1 || s3 + 1 >= e8.length || "EN" !== (c3 = o3[s3 - 1]) && "AN" !== c3 || "EN" !== (u3 = e8[s3 + 1]) && "AN" !== u3 ? f3 = "N" : m2 && (u3 = "AN"), f3 = u3 === c3 ? u3 : "N";
break;
case "ES":
f3 = "EN" === (c3 = s3 > 0 ? o3[s3 - 1] : "B") && s3 + 1 < e8.length && "EN" === e8[s3 + 1] ? "EN" : "N";
break;
case "ET":
if (s3 > 0 && "EN" === o3[s3 - 1]) {
f3 = "EN";
break;
}
if (m2) {
f3 = "N";
break;
}
for (h3 = s3 + 1, l3 = e8.length; h3 < l3 && "ET" === e8[h3]; )
h3++;
f3 = h3 < l3 && "EN" === e8[h3] ? "EN" : "N";
break;
case "NSM":
if (i2 && !a2) {
for (l3 = e8.length, h3 = s3 + 1; h3 < l3 && "NSM" === e8[h3]; )
h3++;
if (h3 < l3) {
var d3 = t7[s3], p3 = d3 >= 1425 && d3 <= 2303 || 64286 === d3;
if (c3 = e8[h3], p3 && ("R" === c3 || "AL" === c3)) {
f3 = "R";
break;
}
}
}
f3 = s3 < 1 || "B" === (c3 = e8[s3 - 1]) ? "N" : o3[s3 - 1];
break;
case "B":
m2 = false, r3 = true, f3 = v2;
break;
case "S":
n2 = true, f3 = "N";
break;
case "LRE":
case "RLE":
case "LRO":
case "RLO":
case "PDF":
m2 = false;
break;
case "BN":
f3 = "N";
}
return f3;
}, N2 = function(t7, e8, r4) {
var n3 = t7.split("");
return r4 && L2(n3, r4, { hiLevel: v2 }), n3.reverse(), e8 && e8.reverse(), n3.join("");
}, L2 = function(t7, e8, i3) {
var a3, o3, s3, c3, u3, d3 = -1, p3 = t7.length, g3 = 0, y3 = [], N3 = v2 ? l2 : h2, L3 = [];
for (m2 = false, r3 = false, n2 = false, o3 = 0; o3 < p3; o3++)
L3[o3] = b2(t7[o3]);
for (s3 = 0; s3 < p3; s3++) {
if (u3 = g3, y3[s3] = w2(t7, L3, y3, s3), a3 = 240 & (g3 = N3[u3][f2[y3[s3]]]), g3 &= 15, e8[s3] = c3 = N3[g3][5], a3 > 0)
if (16 === a3) {
for (o3 = d3; o3 < s3; o3++)
e8[o3] = 1;
d3 = -1;
} else
d3 = -1;
if (N3[g3][6])
-1 === d3 && (d3 = s3);
else if (d3 > -1) {
for (o3 = d3; o3 < s3; o3++)
e8[o3] = c3;
d3 = -1;
}
"B" === L3[s3] && (e8[s3] = 0), i3.hiLevel |= c3;
}
n2 && function(t8, e9, r4) {
for (var n3 = 0; n3 < r4; n3++)
if ("S" === t8[n3]) {
e9[n3] = v2;
for (var i4 = n3 - 1; i4 >= 0 && "WS" === t8[i4]; i4--)
e9[i4] = v2;
}
}(L3, e8, p3);
}, A5 = function(t7, e8, n3, i3, a3) {
if (!(a3.hiLevel < t7)) {
if (1 === t7 && 1 === v2 && !r3)
return e8.reverse(), void (n3 && n3.reverse());
for (var o3, s3, c3, u3, h3 = e8.length, l3 = 0; l3 < h3; ) {
if (i3[l3] >= t7) {
for (c3 = l3 + 1; c3 < h3 && i3[c3] >= t7; )
c3++;
for (u3 = l3, s3 = c3 - 1; u3 < s3; u3++, s3--)
o3 = e8[u3], e8[u3] = e8[s3], e8[s3] = o3, n3 && (o3 = n3[u3], n3[u3] = n3[s3], n3[s3] = o3);
l3 = c3;
}
l3++;
}
}
}, x2 = function(t7, e8, r4) {
var n3 = t7.split(""), i3 = { hiLevel: v2 };
return r4 || (r4 = []), L2(n3, r4, i3), function(t8, e9, r5) {
if (0 !== r5.hiLevel && c2)
for (var n4, i4 = 0; i4 < t8.length; i4++)
1 === e9[i4] && (n4 = p2.indexOf(t8[i4])) >= 0 && (t8[i4] = p2[n4 + 1]);
}(n3, r4, i3), A5(2, n3, e8, r4, i3), A5(1, n3, e8, r4, i3), n3.join("");
};
return this.__bidiEngine__.doBidiReorder = function(t7, e8, r4) {
if (function(t8, e9) {
if (e9)
for (var r5 = 0; r5 < t8.length; r5++)
e9[r5] = r5;
void 0 === a2 && (a2 = y2(t8)), void 0 === s2 && (s2 = y2(t8));
}(t7, e8), i2 || !o2 || s2)
if (i2 && o2 && a2 ^ s2)
v2 = a2 ? 1 : 0, t7 = N2(t7, e8, r4);
else if (!i2 && o2 && s2)
v2 = a2 ? 1 : 0, t7 = x2(t7, e8, r4), t7 = N2(t7, e8);
else if (!i2 || a2 || o2 || s2) {
if (i2 && !o2 && a2 ^ s2)
t7 = N2(t7, e8), a2 ? (v2 = 0, t7 = x2(t7, e8, r4)) : (v2 = 1, t7 = x2(t7, e8, r4), t7 = N2(t7, e8));
else if (i2 && a2 && !o2 && s2)
v2 = 1, t7 = x2(t7, e8, r4), t7 = N2(t7, e8);
else if (!i2 && !o2 && a2 ^ s2) {
var n3 = c2;
a2 ? (v2 = 1, t7 = x2(t7, e8, r4), v2 = 0, c2 = false, t7 = x2(t7, e8, r4), c2 = n3) : (v2 = 0, t7 = x2(t7, e8, r4), t7 = N2(t7, e8), v2 = 1, c2 = false, t7 = x2(t7, e8, r4), c2 = n3, t7 = N2(t7, e8));
}
} else
v2 = 0, t7 = x2(t7, e8, r4);
else
v2 = a2 ? 1 : 0, t7 = x2(t7, e8, r4);
return t7;
}, this.__bidiEngine__.setOptions = function(t7) {
t7 && (i2 = t7.isInputVisual, o2 = t7.isOutputVisual, a2 = t7.isInputRtl, s2 = t7.isOutputRtl, c2 = t7.isSymmetricSwapping);
}, this.__bidiEngine__.setOptions(t6), this.__bidiEngine__;
};
var e7 = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"], r2 = new t5.__bidiEngine__({ isInputVisual: true });
t5.API.events.push(["postProcessText", function(t6) {
var e8 = t6.text, n2 = (t6.x, t6.y, t6.options || {}), i2 = (t6.mutex, n2.lang, []);
if (n2.isInputVisual = "boolean" != typeof n2.isInputVisual || n2.isInputVisual, r2.setOptions(n2), "[object Array]" === Object.prototype.toString.call(e8)) {
var a2 = 0;
for (i2 = [], a2 = 0; a2 < e8.length; a2 += 1)
"[object Array]" === Object.prototype.toString.call(e8[a2]) ? i2.push([r2.doBidiReorder(e8[a2][0]), e8[a2][1], e8[a2][2]]) : i2.push([r2.doBidiReorder(e8[a2])]);
t6.text = i2;
} else
t6.text = r2.doBidiReorder(e8);
r2.setOptions({ isInputVisual: true });
}]);
}(E$2), E$2.API.TTFFont = function() {
function t5(t6) {
var e7;
if (this.rawData = t6, e7 = this.contents = new ne$1(t6), this.contents.pos = 4, "ttcf" === e7.readString(4))
throw new Error("TTCF not supported.");
e7.pos = 0, this.parse(), this.subset = new Le$1(this), this.registerTTF();
}
return t5.open = function(e7) {
return new t5(e7);
}, t5.prototype.parse = function() {
return this.directory = new ie$1(this.contents), this.head = new se$1(this), this.name = new pe$1(this), this.cmap = new ue$1(this), this.toUnicode = {}, this.hhea = new he$1(this), this.maxp = new ge$1(this), this.hmtx = new me$1(this), this.post = new fe$1(this), this.os2 = new le$1(this), this.loca = new Ne$1(this), this.glyf = new be$1(this), this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender, this.decender = this.os2.exists && this.os2.decender || this.hhea.decender, this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap, this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax];
}, t5.prototype.registerTTF = function() {
var t6, e7, r2, n2, i2;
if (this.scaleFactor = 1e3 / this.head.unitsPerEm, this.bbox = (function() {
var e8, r3, n3, i3;
for (i3 = [], e8 = 0, r3 = (n3 = this.bbox).length; e8 < r3; e8++)
t6 = n3[e8], i3.push(Math.round(t6 * this.scaleFactor));
return i3;
}).call(this), this.stemV = 0, this.post.exists ? (r2 = 255 & (n2 = this.post.italic_angle), 0 != (32768 & (e7 = n2 >> 16)) && (e7 = -(1 + (65535 ^ e7))), this.italicAngle = +(e7 + "." + r2)) : this.italicAngle = 0, this.ascender = Math.round(this.ascender * this.scaleFactor), this.decender = Math.round(this.decender * this.scaleFactor), this.lineGap = Math.round(this.lineGap * this.scaleFactor), this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender, this.xHeight = this.os2.exists && this.os2.xHeight || 0, this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8, this.isSerif = 1 === (i2 = this.familyClass) || 2 === i2 || 3 === i2 || 4 === i2 || 5 === i2 || 7 === i2, this.isScript = 10 === this.familyClass, this.flags = 0, this.post.isFixedPitch && (this.flags |= 1), this.isSerif && (this.flags |= 2), this.isScript && (this.flags |= 8), 0 !== this.italicAngle && (this.flags |= 64), this.flags |= 32, !this.cmap.unicode)
throw new Error("No unicode cmap for font");
}, t5.prototype.characterToGlyph = function(t6) {
var e7;
return (null != (e7 = this.cmap.unicode) ? e7.codeMap[t6] : void 0) || 0;
}, t5.prototype.widthOfGlyph = function(t6) {
var e7;
return e7 = 1e3 / this.head.unitsPerEm, this.hmtx.forGlyph(t6).advance * e7;
}, t5.prototype.widthOfString = function(t6, e7, r2) {
var n2, i2, a2, o2;
for (a2 = 0, i2 = 0, o2 = (t6 = "" + t6).length; 0 <= o2 ? i2 < o2 : i2 > o2; i2 = 0 <= o2 ? ++i2 : --i2)
n2 = t6.charCodeAt(i2), a2 += this.widthOfGlyph(this.characterToGlyph(n2)) + r2 * (1e3 / e7) || 0;
return a2 * (e7 / 1e3);
}, t5.prototype.lineHeight = function(t6, e7) {
var r2;
return null == e7 && (e7 = false), r2 = e7 ? this.lineGap : 0, (this.ascender + r2 - this.decender) / 1e3 * t6;
}, t5;
}();
var re$1, ne$1 = function() {
function t5(t6) {
this.data = null != t6 ? t6 : [], this.pos = 0, this.length = this.data.length;
}
return t5.prototype.readByte = function() {
return this.data[this.pos++];
}, t5.prototype.writeByte = function(t6) {
return this.data[this.pos++] = t6;
}, t5.prototype.readUInt32 = function() {
return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte();
}, t5.prototype.writeUInt32 = function(t6) {
return this.writeByte(t6 >>> 24 & 255), this.writeByte(t6 >> 16 & 255), this.writeByte(t6 >> 8 & 255), this.writeByte(255 & t6);
}, t5.prototype.readInt32 = function() {
var t6;
return (t6 = this.readUInt32()) >= 2147483648 ? t6 - 4294967296 : t6;
}, t5.prototype.writeInt32 = function(t6) {
return t6 < 0 && (t6 += 4294967296), this.writeUInt32(t6);
}, t5.prototype.readUInt16 = function() {
return this.readByte() << 8 | this.readByte();
}, t5.prototype.writeUInt16 = function(t6) {
return this.writeByte(t6 >> 8 & 255), this.writeByte(255 & t6);
}, t5.prototype.readInt16 = function() {
var t6;
return (t6 = this.readUInt16()) >= 32768 ? t6 - 65536 : t6;
}, t5.prototype.writeInt16 = function(t6) {
return t6 < 0 && (t6 += 65536), this.writeUInt16(t6);
}, t5.prototype.readString = function(t6) {
var e7, r2;
for (r2 = [], e7 = 0; 0 <= t6 ? e7 < t6 : e7 > t6; e7 = 0 <= t6 ? ++e7 : --e7)
r2[e7] = String.fromCharCode(this.readByte());
return r2.join("");
}, t5.prototype.writeString = function(t6) {
var e7, r2, n2;
for (n2 = [], e7 = 0, r2 = t6.length; 0 <= r2 ? e7 < r2 : e7 > r2; e7 = 0 <= r2 ? ++e7 : --e7)
n2.push(this.writeByte(t6.charCodeAt(e7)));
return n2;
}, t5.prototype.readShort = function() {
return this.readInt16();
}, t5.prototype.writeShort = function(t6) {
return this.writeInt16(t6);
}, t5.prototype.readLongLong = function() {
var t6, e7, r2, n2, i2, a2, o2, s2;
return t6 = this.readByte(), e7 = this.readByte(), r2 = this.readByte(), n2 = this.readByte(), i2 = this.readByte(), a2 = this.readByte(), o2 = this.readByte(), s2 = this.readByte(), 128 & t6 ? -1 * (72057594037927940 * (255 ^ t6) + 281474976710656 * (255 ^ e7) + 1099511627776 * (255 ^ r2) + 4294967296 * (255 ^ n2) + 16777216 * (255 ^ i2) + 65536 * (255 ^ a2) + 256 * (255 ^ o2) + (255 ^ s2) + 1) : 72057594037927940 * t6 + 281474976710656 * e7 + 1099511627776 * r2 + 4294967296 * n2 + 16777216 * i2 + 65536 * a2 + 256 * o2 + s2;
}, t5.prototype.writeLongLong = function(t6) {
var e7, r2;
return e7 = Math.floor(t6 / 4294967296), r2 = 4294967295 & t6, this.writeByte(e7 >> 24 & 255), this.writeByte(e7 >> 16 & 255), this.writeByte(e7 >> 8 & 255), this.writeByte(255 & e7), this.writeByte(r2 >> 24 & 255), this.writeByte(r2 >> 16 & 255), this.writeByte(r2 >> 8 & 255), this.writeByte(255 & r2);
}, t5.prototype.readInt = function() {
return this.readInt32();
}, t5.prototype.writeInt = function(t6) {
return this.writeInt32(t6);
}, t5.prototype.read = function(t6) {
var e7, r2;
for (e7 = [], r2 = 0; 0 <= t6 ? r2 < t6 : r2 > t6; r2 = 0 <= t6 ? ++r2 : --r2)
e7.push(this.readByte());
return e7;
}, t5.prototype.write = function(t6) {
var e7, r2, n2, i2;
for (i2 = [], r2 = 0, n2 = t6.length; r2 < n2; r2++)
e7 = t6[r2], i2.push(this.writeByte(e7));
return i2;
}, t5;
}(), ie$1 = function() {
var t5;
function e7(t6) {
var e8, r2, n2;
for (this.scalarType = t6.readInt(), this.tableCount = t6.readShort(), this.searchRange = t6.readShort(), this.entrySelector = t6.readShort(), this.rangeShift = t6.readShort(), this.tables = {}, r2 = 0, n2 = this.tableCount; 0 <= n2 ? r2 < n2 : r2 > n2; r2 = 0 <= n2 ? ++r2 : --r2)
e8 = { tag: t6.readString(4), checksum: t6.readInt(), offset: t6.readInt(), length: t6.readInt() }, this.tables[e8.tag] = e8;
}
return e7.prototype.encode = function(e8) {
var r2, n2, i2, a2, o2, s2, c2, u2, h2, l2, f2, d2, p2;
for (p2 in f2 = Object.keys(e8).length, s2 = Math.log(2), h2 = 16 * Math.floor(Math.log(f2) / s2), a2 = Math.floor(h2 / s2), u2 = 16 * f2 - h2, (n2 = new ne$1()).writeInt(this.scalarType), n2.writeShort(f2), n2.writeShort(h2), n2.writeShort(a2), n2.writeShort(u2), i2 = 16 * f2, c2 = n2.pos + i2, o2 = null, d2 = [], e8)
for (l2 = e8[p2], n2.writeString(p2), n2.writeInt(t5(l2)), n2.writeInt(c2), n2.writeInt(l2.length), d2 = d2.concat(l2), "head" === p2 && (o2 = c2), c2 += l2.length; c2 % 4; )
d2.push(0), c2++;
return n2.write(d2), r2 = 2981146554 - t5(n2.data), n2.pos = o2 + 8, n2.writeUInt32(r2), n2.data;
}, t5 = function(t6) {
var e8, r2, n2, i2;
for (t6 = ve$1.call(t6); t6.length % 4; )
t6.push(0);
for (n2 = new ne$1(t6), r2 = 0, e8 = 0, i2 = t6.length; e8 < i2; e8 = e8 += 4)
r2 += n2.readUInt32();
return 4294967295 & r2;
}, e7;
}(), ae$1 = {}.hasOwnProperty, oe$1 = function(t5, e7) {
for (var r2 in e7)
ae$1.call(e7, r2) && (t5[r2] = e7[r2]);
function n2() {
this.constructor = t5;
}
return n2.prototype = e7.prototype, t5.prototype = new n2(), t5.__super__ = e7.prototype, t5;
};
re$1 = function() {
function t5(t6) {
var e7;
this.file = t6, e7 = this.file.directory.tables[this.tag], this.exists = !!e7, e7 && (this.offset = e7.offset, this.length = e7.length, this.parse(this.file.contents));
}
return t5.prototype.parse = function() {
}, t5.prototype.encode = function() {
}, t5.prototype.raw = function() {
return this.exists ? (this.file.contents.pos = this.offset, this.file.contents.read(this.length)) : null;
}, t5;
}();
var se$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "head", e7.prototype.parse = function(t6) {
return t6.pos = this.offset, this.version = t6.readInt(), this.revision = t6.readInt(), this.checkSumAdjustment = t6.readInt(), this.magicNumber = t6.readInt(), this.flags = t6.readShort(), this.unitsPerEm = t6.readShort(), this.created = t6.readLongLong(), this.modified = t6.readLongLong(), this.xMin = t6.readShort(), this.yMin = t6.readShort(), this.xMax = t6.readShort(), this.yMax = t6.readShort(), this.macStyle = t6.readShort(), this.lowestRecPPEM = t6.readShort(), this.fontDirectionHint = t6.readShort(), this.indexToLocFormat = t6.readShort(), this.glyphDataFormat = t6.readShort();
}, e7.prototype.encode = function(t6) {
var e8;
return (e8 = new ne$1()).writeInt(this.version), e8.writeInt(this.revision), e8.writeInt(this.checkSumAdjustment), e8.writeInt(this.magicNumber), e8.writeShort(this.flags), e8.writeShort(this.unitsPerEm), e8.writeLongLong(this.created), e8.writeLongLong(this.modified), e8.writeShort(this.xMin), e8.writeShort(this.yMin), e8.writeShort(this.xMax), e8.writeShort(this.yMax), e8.writeShort(this.macStyle), e8.writeShort(this.lowestRecPPEM), e8.writeShort(this.fontDirectionHint), e8.writeShort(t6), e8.writeShort(this.glyphDataFormat), e8.data;
}, e7;
}(), ce$1 = function() {
function t5(t6, e7) {
var r2, n2, i2, a2, o2, s2, c2, u2, h2, l2, f2, d2, p2, g2, m2, v2, b2;
switch (this.platformID = t6.readUInt16(), this.encodingID = t6.readShort(), this.offset = e7 + t6.readInt(), h2 = t6.pos, t6.pos = this.offset, this.format = t6.readUInt16(), this.length = t6.readUInt16(), this.language = t6.readUInt16(), this.isUnicode = 3 === this.platformID && 1 === this.encodingID && 4 === this.format || 0 === this.platformID && 4 === this.format, this.codeMap = {}, this.format) {
case 0:
for (s2 = 0; s2 < 256; ++s2)
this.codeMap[s2] = t6.readByte();
break;
case 4:
for (f2 = t6.readUInt16(), l2 = f2 / 2, t6.pos += 6, i2 = function() {
var e8, r3;
for (r3 = [], s2 = e8 = 0; 0 <= l2 ? e8 < l2 : e8 > l2; s2 = 0 <= l2 ? ++e8 : --e8)
r3.push(t6.readUInt16());
return r3;
}(), t6.pos += 2, p2 = function() {
var e8, r3;
for (r3 = [], s2 = e8 = 0; 0 <= l2 ? e8 < l2 : e8 > l2; s2 = 0 <= l2 ? ++e8 : --e8)
r3.push(t6.readUInt16());
return r3;
}(), c2 = function() {
var e8, r3;
for (r3 = [], s2 = e8 = 0; 0 <= l2 ? e8 < l2 : e8 > l2; s2 = 0 <= l2 ? ++e8 : --e8)
r3.push(t6.readUInt16());
return r3;
}(), u2 = function() {
var e8, r3;
for (r3 = [], s2 = e8 = 0; 0 <= l2 ? e8 < l2 : e8 > l2; s2 = 0 <= l2 ? ++e8 : --e8)
r3.push(t6.readUInt16());
return r3;
}(), n2 = (this.length - t6.pos + this.offset) / 2, o2 = function() {
var e8, r3;
for (r3 = [], s2 = e8 = 0; 0 <= n2 ? e8 < n2 : e8 > n2; s2 = 0 <= n2 ? ++e8 : --e8)
r3.push(t6.readUInt16());
return r3;
}(), s2 = m2 = 0, b2 = i2.length; m2 < b2; s2 = ++m2)
for (g2 = i2[s2], r2 = v2 = d2 = p2[s2]; d2 <= g2 ? v2 <= g2 : v2 >= g2; r2 = d2 <= g2 ? ++v2 : --v2)
0 === u2[s2] ? a2 = r2 + c2[s2] : 0 !== (a2 = o2[u2[s2] / 2 + (r2 - d2) - (l2 - s2)] || 0) && (a2 += c2[s2]), this.codeMap[r2] = 65535 & a2;
}
t6.pos = h2;
}
return t5.encode = function(t6, e7) {
var r2, n2, i2, a2, o2, s2, c2, u2, h2, l2, f2, d2, p2, g2, m2, v2, b2, y2, w2, N2, L2, A5, x2, S2, _24, P2, k2, I2, F2, C3, j2, O2, B3, M2, E2, q2, D2, R2, T2, U2, z2, H4, W2, V2, G2, Y3;
switch (I2 = new ne$1(), a2 = Object.keys(t6).sort(function(t7, e8) {
return t7 - e8;
}), e7) {
case "macroman":
for (p2 = 0, g2 = function() {
var t7 = [];
for (d2 = 0; d2 < 256; ++d2)
t7.push(0);
return t7;
}(), v2 = { 0: 0 }, i2 = {}, F2 = 0, B3 = a2.length; F2 < B3; F2++)
null == v2[W2 = t6[n2 = a2[F2]]] && (v2[W2] = ++p2), i2[n2] = { old: t6[n2], new: v2[t6[n2]] }, g2[n2] = v2[t6[n2]];
return I2.writeUInt16(1), I2.writeUInt16(0), I2.writeUInt32(12), I2.writeUInt16(0), I2.writeUInt16(262), I2.writeUInt16(0), I2.write(g2), { charMap: i2, subtable: I2.data, maxGlyphID: p2 + 1 };
case "unicode":
for (P2 = [], h2 = [], b2 = 0, v2 = {}, r2 = {}, m2 = c2 = null, C3 = 0, M2 = a2.length; C3 < M2; C3++)
null == v2[w2 = t6[n2 = a2[C3]]] && (v2[w2] = ++b2), r2[n2] = { old: w2, new: v2[w2] }, o2 = v2[w2] - n2, null != m2 && o2 === c2 || (m2 && h2.push(m2), P2.push(n2), c2 = o2), m2 = n2;
for (m2 && h2.push(m2), h2.push(65535), P2.push(65535), S2 = 2 * (x2 = P2.length), A5 = 2 * Math.pow(Math.log(x2) / Math.LN2, 2), l2 = Math.log(A5 / 2) / Math.LN2, L2 = 2 * x2 - A5, s2 = [], N2 = [], f2 = [], d2 = j2 = 0, E2 = P2.length; j2 < E2; d2 = ++j2) {
if (_24 = P2[d2], u2 = h2[d2], 65535 === _24) {
s2.push(0), N2.push(0);
break;
}
if (_24 - (k2 = r2[_24].new) >= 32768)
for (s2.push(0), N2.push(2 * (f2.length + x2 - d2)), n2 = O2 = _24; _24 <= u2 ? O2 <= u2 : O2 >= u2; n2 = _24 <= u2 ? ++O2 : --O2)
f2.push(r2[n2].new);
else
s2.push(k2 - _24), N2.push(0);
}
for (I2.writeUInt16(3), I2.writeUInt16(1), I2.writeUInt32(12), I2.writeUInt16(4), I2.writeUInt16(16 + 8 * x2 + 2 * f2.length), I2.writeUInt16(0), I2.writeUInt16(S2), I2.writeUInt16(A5), I2.writeUInt16(l2), I2.writeUInt16(L2), z2 = 0, q2 = h2.length; z2 < q2; z2++)
n2 = h2[z2], I2.writeUInt16(n2);
for (I2.writeUInt16(0), H4 = 0, D2 = P2.length; H4 < D2; H4++)
n2 = P2[H4], I2.writeUInt16(n2);
for (V2 = 0, R2 = s2.length; V2 < R2; V2++)
o2 = s2[V2], I2.writeUInt16(o2);
for (G2 = 0, T2 = N2.length; G2 < T2; G2++)
y2 = N2[G2], I2.writeUInt16(y2);
for (Y3 = 0, U2 = f2.length; Y3 < U2; Y3++)
p2 = f2[Y3], I2.writeUInt16(p2);
return { charMap: r2, subtable: I2.data, maxGlyphID: b2 + 1 };
}
}, t5;
}(), ue$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "cmap", e7.prototype.parse = function(t6) {
var e8, r2, n2;
for (t6.pos = this.offset, this.version = t6.readUInt16(), n2 = t6.readUInt16(), this.tables = [], this.unicode = null, r2 = 0; 0 <= n2 ? r2 < n2 : r2 > n2; r2 = 0 <= n2 ? ++r2 : --r2)
e8 = new ce$1(t6, this.offset), this.tables.push(e8), e8.isUnicode && null == this.unicode && (this.unicode = e8);
return true;
}, e7.encode = function(t6, e8) {
var r2, n2;
return null == e8 && (e8 = "macroman"), r2 = ce$1.encode(t6, e8), (n2 = new ne$1()).writeUInt16(0), n2.writeUInt16(1), r2.table = n2.data.concat(r2.subtable), r2;
}, e7;
}(), he$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "hhea", e7.prototype.parse = function(t6) {
return t6.pos = this.offset, this.version = t6.readInt(), this.ascender = t6.readShort(), this.decender = t6.readShort(), this.lineGap = t6.readShort(), this.advanceWidthMax = t6.readShort(), this.minLeftSideBearing = t6.readShort(), this.minRightSideBearing = t6.readShort(), this.xMaxExtent = t6.readShort(), this.caretSlopeRise = t6.readShort(), this.caretSlopeRun = t6.readShort(), this.caretOffset = t6.readShort(), t6.pos += 8, this.metricDataFormat = t6.readShort(), this.numberOfMetrics = t6.readUInt16();
}, e7;
}(), le$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "OS/2", e7.prototype.parse = function(t6) {
if (t6.pos = this.offset, this.version = t6.readUInt16(), this.averageCharWidth = t6.readShort(), this.weightClass = t6.readUInt16(), this.widthClass = t6.readUInt16(), this.type = t6.readShort(), this.ySubscriptXSize = t6.readShort(), this.ySubscriptYSize = t6.readShort(), this.ySubscriptXOffset = t6.readShort(), this.ySubscriptYOffset = t6.readShort(), this.ySuperscriptXSize = t6.readShort(), this.ySuperscriptYSize = t6.readShort(), this.ySuperscriptXOffset = t6.readShort(), this.ySuperscriptYOffset = t6.readShort(), this.yStrikeoutSize = t6.readShort(), this.yStrikeoutPosition = t6.readShort(), this.familyClass = t6.readShort(), this.panose = function() {
var e8, r2;
for (r2 = [], e8 = 0; e8 < 10; ++e8)
r2.push(t6.readByte());
return r2;
}(), this.charRange = function() {
var e8, r2;
for (r2 = [], e8 = 0; e8 < 4; ++e8)
r2.push(t6.readInt());
return r2;
}(), this.vendorID = t6.readString(4), this.selection = t6.readShort(), this.firstCharIndex = t6.readShort(), this.lastCharIndex = t6.readShort(), this.version > 0 && (this.ascent = t6.readShort(), this.descent = t6.readShort(), this.lineGap = t6.readShort(), this.winAscent = t6.readShort(), this.winDescent = t6.readShort(), this.codePageRange = function() {
var e8, r2;
for (r2 = [], e8 = 0; e8 < 2; e8 = ++e8)
r2.push(t6.readInt());
return r2;
}(), this.version > 1))
return this.xHeight = t6.readShort(), this.capHeight = t6.readShort(), this.defaultChar = t6.readShort(), this.breakChar = t6.readShort(), this.maxContext = t6.readShort();
}, e7;
}(), fe$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "post", e7.prototype.parse = function(t6) {
var e8, r2, n2;
switch (t6.pos = this.offset, this.format = t6.readInt(), this.italicAngle = t6.readInt(), this.underlinePosition = t6.readShort(), this.underlineThickness = t6.readShort(), this.isFixedPitch = t6.readInt(), this.minMemType42 = t6.readInt(), this.maxMemType42 = t6.readInt(), this.minMemType1 = t6.readInt(), this.maxMemType1 = t6.readInt(), this.format) {
case 65536:
break;
case 131072:
var i2;
for (r2 = t6.readUInt16(), this.glyphNameIndex = [], i2 = 0; 0 <= r2 ? i2 < r2 : i2 > r2; i2 = 0 <= r2 ? ++i2 : --i2)
this.glyphNameIndex.push(t6.readUInt16());
for (this.names = [], n2 = []; t6.pos < this.offset + this.length; )
e8 = t6.readByte(), n2.push(this.names.push(t6.readString(e8)));
return n2;
case 151552:
return r2 = t6.readUInt16(), this.offsets = t6.read(r2);
case 196608:
break;
case 262144:
return this.map = (function() {
var e9, r3, n3;
for (n3 = [], i2 = e9 = 0, r3 = this.file.maxp.numGlyphs; 0 <= r3 ? e9 < r3 : e9 > r3; i2 = 0 <= r3 ? ++e9 : --e9)
n3.push(t6.readUInt32());
return n3;
}).call(this);
}
}, e7;
}(), de$1 = function(t5, e7) {
this.raw = t5, this.length = t5.length, this.platformID = e7.platformID, this.encodingID = e7.encodingID, this.languageID = e7.languageID;
}, pe$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "name", e7.prototype.parse = function(t6) {
var e8, r2, n2, i2, a2, o2, s2, c2, u2, h2, l2;
for (t6.pos = this.offset, t6.readShort(), e8 = t6.readShort(), o2 = t6.readShort(), r2 = [], i2 = 0; 0 <= e8 ? i2 < e8 : i2 > e8; i2 = 0 <= e8 ? ++i2 : --i2)
r2.push({ platformID: t6.readShort(), encodingID: t6.readShort(), languageID: t6.readShort(), nameID: t6.readShort(), length: t6.readShort(), offset: this.offset + o2 + t6.readShort() });
for (s2 = {}, i2 = u2 = 0, h2 = r2.length; u2 < h2; i2 = ++u2)
n2 = r2[i2], t6.pos = n2.offset, c2 = t6.readString(n2.length), a2 = new de$1(c2, n2), null == s2[l2 = n2.nameID] && (s2[l2] = []), s2[n2.nameID].push(a2);
this.strings = s2, this.copyright = s2[0], this.fontFamily = s2[1], this.fontSubfamily = s2[2], this.uniqueSubfamily = s2[3], this.fontName = s2[4], this.version = s2[5];
try {
this.postscriptName = s2[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
} catch (t7) {
this.postscriptName = s2[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
}
return this.trademark = s2[7], this.manufacturer = s2[8], this.designer = s2[9], this.description = s2[10], this.vendorUrl = s2[11], this.designerUrl = s2[12], this.license = s2[13], this.licenseUrl = s2[14], this.preferredFamily = s2[15], this.preferredSubfamily = s2[17], this.compatibleFull = s2[18], this.sampleText = s2[19];
}, e7;
}(), ge$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "maxp", e7.prototype.parse = function(t6) {
return t6.pos = this.offset, this.version = t6.readInt(), this.numGlyphs = t6.readUInt16(), this.maxPoints = t6.readUInt16(), this.maxContours = t6.readUInt16(), this.maxCompositePoints = t6.readUInt16(), this.maxComponentContours = t6.readUInt16(), this.maxZones = t6.readUInt16(), this.maxTwilightPoints = t6.readUInt16(), this.maxStorage = t6.readUInt16(), this.maxFunctionDefs = t6.readUInt16(), this.maxInstructionDefs = t6.readUInt16(), this.maxStackElements = t6.readUInt16(), this.maxSizeOfInstructions = t6.readUInt16(), this.maxComponentElements = t6.readUInt16(), this.maxComponentDepth = t6.readUInt16();
}, e7;
}(), me$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "hmtx", e7.prototype.parse = function(t6) {
var e8, r2, n2, i2, a2, o2, s2;
for (t6.pos = this.offset, this.metrics = [], e8 = 0, o2 = this.file.hhea.numberOfMetrics; 0 <= o2 ? e8 < o2 : e8 > o2; e8 = 0 <= o2 ? ++e8 : --e8)
this.metrics.push({ advance: t6.readUInt16(), lsb: t6.readInt16() });
for (n2 = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics, this.leftSideBearings = function() {
var r3, i3;
for (i3 = [], e8 = r3 = 0; 0 <= n2 ? r3 < n2 : r3 > n2; e8 = 0 <= n2 ? ++r3 : --r3)
i3.push(t6.readInt16());
return i3;
}(), this.widths = (function() {
var t7, e9, r3, n3;
for (n3 = [], t7 = 0, e9 = (r3 = this.metrics).length; t7 < e9; t7++)
i2 = r3[t7], n3.push(i2.advance);
return n3;
}).call(this), r2 = this.widths[this.widths.length - 1], s2 = [], e8 = a2 = 0; 0 <= n2 ? a2 < n2 : a2 > n2; e8 = 0 <= n2 ? ++a2 : --a2)
s2.push(this.widths.push(r2));
return s2;
}, e7.prototype.forGlyph = function(t6) {
return t6 in this.metrics ? this.metrics[t6] : { advance: this.metrics[this.metrics.length - 1].advance, lsb: this.leftSideBearings[t6 - this.metrics.length] };
}, e7;
}(), ve$1 = [].slice, be$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "glyf", e7.prototype.parse = function() {
return this.cache = {};
}, e7.prototype.glyphFor = function(t6) {
var e8, r2, n2, i2, a2, o2, s2, c2, u2, h2;
return t6 in this.cache ? this.cache[t6] : (i2 = this.file.loca, e8 = this.file.contents, r2 = i2.indexOf(t6), 0 === (n2 = i2.lengthOf(t6)) ? this.cache[t6] = null : (e8.pos = this.offset + r2, a2 = (o2 = new ne$1(e8.read(n2))).readShort(), c2 = o2.readShort(), h2 = o2.readShort(), s2 = o2.readShort(), u2 = o2.readShort(), this.cache[t6] = -1 === a2 ? new we$1(o2, c2, h2, s2, u2) : new ye$1(o2, a2, c2, h2, s2, u2), this.cache[t6]));
}, e7.prototype.encode = function(t6, e8, r2) {
var n2, i2, a2, o2, s2;
for (a2 = [], i2 = [], o2 = 0, s2 = e8.length; o2 < s2; o2++)
n2 = t6[e8[o2]], i2.push(a2.length), n2 && (a2 = a2.concat(n2.encode(r2)));
return i2.push(a2.length), { table: a2, offsets: i2 };
}, e7;
}(), ye$1 = function() {
function t5(t6, e7, r2, n2, i2, a2) {
this.raw = t6, this.numberOfContours = e7, this.xMin = r2, this.yMin = n2, this.xMax = i2, this.yMax = a2, this.compound = false;
}
return t5.prototype.encode = function() {
return this.raw.data;
}, t5;
}(), we$1 = function() {
function t5(t6, e7, r2, n2, i2) {
var a2, o2;
for (this.raw = t6, this.xMin = e7, this.yMin = r2, this.xMax = n2, this.yMax = i2, this.compound = true, this.glyphIDs = [], this.glyphOffsets = [], a2 = this.raw; o2 = a2.readShort(), this.glyphOffsets.push(a2.pos), this.glyphIDs.push(a2.readUInt16()), 32 & o2; )
a2.pos += 1 & o2 ? 4 : 2, 128 & o2 ? a2.pos += 8 : 64 & o2 ? a2.pos += 4 : 8 & o2 && (a2.pos += 2);
}
return t5.prototype.encode = function() {
var t6, e7, r2;
for (e7 = new ne$1(ve$1.call(this.raw.data)), t6 = 0, r2 = this.glyphIDs.length; t6 < r2; ++t6)
e7.pos = this.glyphOffsets[t6];
return e7.data;
}, t5;
}(), Ne$1 = function(t5) {
function e7() {
return e7.__super__.constructor.apply(this, arguments);
}
return oe$1(e7, re$1), e7.prototype.tag = "loca", e7.prototype.parse = function(t6) {
var e8, r2;
return t6.pos = this.offset, e8 = this.file.head.indexToLocFormat, this.offsets = 0 === e8 ? (function() {
var e9, n2;
for (n2 = [], r2 = 0, e9 = this.length; r2 < e9; r2 += 2)
n2.push(2 * t6.readUInt16());
return n2;
}).call(this) : (function() {
var e9, n2;
for (n2 = [], r2 = 0, e9 = this.length; r2 < e9; r2 += 4)
n2.push(t6.readUInt32());
return n2;
}).call(this);
}, e7.prototype.indexOf = function(t6) {
return this.offsets[t6];
}, e7.prototype.lengthOf = function(t6) {
return this.offsets[t6 + 1] - this.offsets[t6];
}, e7.prototype.encode = function(t6, e8) {
for (var r2 = new Uint32Array(this.offsets.length), n2 = 0, i2 = 0, a2 = 0; a2 < r2.length; ++a2)
if (r2[a2] = n2, i2 < e8.length && e8[i2] == a2) {
++i2, r2[a2] = n2;
var o2 = this.offsets[a2], s2 = this.offsets[a2 + 1] - o2;
s2 > 0 && (n2 += s2);
}
for (var c2 = new Array(4 * r2.length), u2 = 0; u2 < r2.length; ++u2)
c2[4 * u2 + 3] = 255 & r2[u2], c2[4 * u2 + 2] = (65280 & r2[u2]) >> 8, c2[4 * u2 + 1] = (16711680 & r2[u2]) >> 16, c2[4 * u2] = (4278190080 & r2[u2]) >> 24;
return c2;
}, e7;
}(), Le$1 = function() {
function t5(t6) {
this.font = t6, this.subset = {}, this.unicodes = {}, this.next = 33;
}
return t5.prototype.generateCmap = function() {
var t6, e7, r2, n2, i2;
for (e7 in n2 = this.font.cmap.tables[0].codeMap, t6 = {}, i2 = this.subset)
r2 = i2[e7], t6[e7] = n2[r2];
return t6;
}, t5.prototype.glyphsFor = function(t6) {
var e7, r2, n2, i2, a2, o2, s2;
for (n2 = {}, a2 = 0, o2 = t6.length; a2 < o2; a2++)
n2[i2 = t6[a2]] = this.font.glyf.glyphFor(i2);
for (i2 in e7 = [], n2)
(null != (r2 = n2[i2]) ? r2.compound : void 0) && e7.push.apply(e7, r2.glyphIDs);
if (e7.length > 0)
for (i2 in s2 = this.glyphsFor(e7))
r2 = s2[i2], n2[i2] = r2;
return n2;
}, t5.prototype.encode = function(t6, e7) {
var r2, n2, i2, a2, o2, s2, c2, u2, h2, l2, f2, d2, p2, g2, m2;
for (n2 in r2 = ue$1.encode(this.generateCmap(), "unicode"), a2 = this.glyphsFor(t6), f2 = { 0: 0 }, m2 = r2.charMap)
f2[(s2 = m2[n2]).old] = s2.new;
for (d2 in l2 = r2.maxGlyphID, a2)
d2 in f2 || (f2[d2] = l2++);
return u2 = function(t7) {
var e8, r3;
for (e8 in r3 = {}, t7)
r3[t7[e8]] = e8;
return r3;
}(f2), h2 = Object.keys(u2).sort(function(t7, e8) {
return t7 - e8;
}), p2 = function() {
var t7, e8, r3;
for (r3 = [], t7 = 0, e8 = h2.length; t7 < e8; t7++)
o2 = h2[t7], r3.push(u2[o2]);
return r3;
}(), i2 = this.font.glyf.encode(a2, p2, f2), c2 = this.font.loca.encode(i2.offsets, p2), g2 = { cmap: this.font.cmap.raw(), glyf: i2.table, loca: c2, hmtx: this.font.hmtx.raw(), hhea: this.font.hhea.raw(), maxp: this.font.maxp.raw(), post: this.font.post.raw(), name: this.font.name.raw(), head: this.font.head.encode(e7) }, this.font.os2.exists && (g2["OS/2"] = this.font.os2.raw()), this.font.directory.encode(g2);
}, t5;
}();
E$2.API.PDFObject = function() {
var t5;
function e7() {
}
return t5 = function(t6, e8) {
return (Array(e8 + 1).join("0") + t6).slice(-e8);
}, e7.convert = function(r2) {
var n2, i2, a2, o2;
if (Array.isArray(r2))
return "[" + function() {
var t6, i3, a3;
for (a3 = [], t6 = 0, i3 = r2.length; t6 < i3; t6++)
n2 = r2[t6], a3.push(e7.convert(n2));
return a3;
}().join(" ") + "]";
if ("string" == typeof r2)
return "/" + r2;
if (null != r2 ? r2.isString : void 0)
return "(" + r2 + ")";
if (r2 instanceof Date)
return "(D:" + t5(r2.getUTCFullYear(), 4) + t5(r2.getUTCMonth(), 2) + t5(r2.getUTCDate(), 2) + t5(r2.getUTCHours(), 2) + t5(r2.getUTCMinutes(), 2) + t5(r2.getUTCSeconds(), 2) + "Z)";
if ("[object Object]" === {}.toString.call(r2)) {
for (i2 in a2 = ["<<"], r2)
o2 = r2[i2], a2.push("/" + i2 + " " + e7.convert(o2));
return a2.push(">>"), a2.join("\n");
}
return "" + r2;
}, e7;
}();
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __rest(s2, e7) {
var t5 = {};
for (var p2 in s2)
if (Object.prototype.hasOwnProperty.call(s2, p2) && e7.indexOf(p2) < 0)
t5[p2] = s2[p2];
if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) {
if (e7.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]))
t5[p2[i2]] = s2[p2[i2]];
}
return t5;
}
function formatValue(value2, valueToHtml, maxDepth2) {
if (isArray$2(value2)) {
return `[${value2.map((v2) => valueToHtml(isString(v2) ? v2 : stringify(v2, maxDepth2))).join(", ")}]`;
}
if (isObject$a(value2)) {
let content2 = "";
const _a2 = value2, { title, image: image2 } = _a2, rest = __rest(_a2, ["title", "image"]);
if (title) {
content2 += `<h2>${valueToHtml(title)}</h2>`;
}
if (image2) {
content2 += `<img src="${valueToHtml(image2)}">`;
}
const keys3 = Object.keys(rest);
if (keys3.length > 0) {
content2 += "<table>";
for (const key2 of keys3) {
let val = rest[key2];
if (val === void 0) {
continue;
}
if (isObject$a(val)) {
val = stringify(val, maxDepth2);
}
content2 += `<tr><td class="key">${valueToHtml(key2)}:</td><td class="value">${valueToHtml(val)}</td></tr>`;
}
content2 += `</table>`;
}
return content2 || "{}";
}
return valueToHtml(value2);
}
function replacer(maxDepth2) {
const stack = [];
return function(key2, value2) {
if (typeof value2 !== "object" || value2 === null) {
return value2;
}
const pos = stack.indexOf(this) + 1;
stack.length = pos;
if (stack.length > maxDepth2) {
return "[Object]";
}
if (stack.indexOf(value2) >= 0) {
return "[Circular]";
}
stack.push(value2);
return value2;
};
}
function stringify(obj, maxDepth2) {
return JSON.stringify(obj, replacer(maxDepth2));
}
var defaultStyle = `#vg-tooltip-element {
visibility: hidden;
padding: 8px;
position: fixed;
z-index: 1000;
font-family: sans-serif;
font-size: 11px;
border-radius: 3px;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
/* The default theme is the light theme. */
background-color: rgba(255, 255, 255, 0.95);
border: 1px solid #d9d9d9;
color: black;
}
#vg-tooltip-element.visible {
visibility: visible;
}
#vg-tooltip-element h2 {
margin-top: 0;
margin-bottom: 10px;
font-size: 13px;
}
#vg-tooltip-element img {
max-width: 200px;
max-height: 200px;
}
#vg-tooltip-element table {
border-spacing: 0;
}
#vg-tooltip-element table tr {
border: none;
}
#vg-tooltip-element table tr td {
overflow: hidden;
text-overflow: ellipsis;
padding-top: 2px;
padding-bottom: 2px;
}
#vg-tooltip-element table tr td.key {
color: #808080;
max-width: 150px;
text-align: right;
padding-right: 4px;
}
#vg-tooltip-element table tr td.value {
display: block;
max-width: 300px;
max-height: 7em;
text-align: left;
}
#vg-tooltip-element.dark-theme {
background-color: rgba(32, 32, 32, 0.9);
border: 1px solid #f5f5f5;
color: white;
}
#vg-tooltip-element.dark-theme td.key {
color: #bfbfbf;
}
`;
const EL_ID = "vg-tooltip-element";
const DEFAULT_OPTIONS = {
/**
* X offset.
*/
offsetX: 10,
/**
* Y offset.
*/
offsetY: 10,
/**
* ID of the tooltip element.
*/
id: EL_ID,
/**
* ID of the tooltip CSS style.
*/
styleId: "vega-tooltip-style",
/**
* The name of the theme. You can use the CSS class called [THEME]-theme to style the tooltips.
*
* There are two predefined themes: "light" (default) and "dark".
*/
theme: "light",
/**
* Do not use the default styles provided by Vega Tooltip. If you enable this option, you need to use your own styles. It is not necessary to disable the default style when using a custom theme.
*/
disableDefaultStyle: false,
/**
* HTML sanitizer function that removes dangerous HTML to prevent XSS.
*
* This should be a function from string to string. You may replace it with a formatter such as a markdown formatter.
*/
sanitize: escapeHTML,
/**
* The maximum recursion depth when printing objects in the tooltip.
*/
maxDepth: 2,
/**
* A function to customize the rendered HTML of the tooltip.
* @param value A value string, or object of value strings keyed by field
* @param sanitize The `sanitize` function from `options.sanitize`
* @returns {string} The returned string will become the `innerHTML` of the tooltip element
*/
formatTooltip: formatValue
};
function escapeHTML(value2) {
return String(value2).replace(/&/g, "&").replace(/</g, "<");
}
function createDefaultStyle(id) {
if (!/^[A-Za-z]+[-:.\w]*$/.test(id)) {
throw new Error("Invalid HTML ID");
}
return defaultStyle.toString().replace(EL_ID, id);
}
function calculatePosition(event2, tooltipBox, offsetX, offsetY) {
let x2 = event2.clientX + offsetX;
if (x2 + tooltipBox.width > window.innerWidth) {
x2 = +event2.clientX - offsetX - tooltipBox.width;
}
let y2 = event2.clientY + offsetY;
if (y2 + tooltipBox.height > window.innerHeight) {
y2 = +event2.clientY - offsetY - tooltipBox.height;
}
return { x: x2, y: y2 };
}
class Handler {
/**
* Create the tooltip handler and initialize the element and style.
*
* @param options Tooltip Options
*/
constructor(options2) {
this.options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options2);
const elementId = this.options.id;
this.el = null;
this.call = this.tooltipHandler.bind(this);
if (!this.options.disableDefaultStyle && !document.getElementById(this.options.styleId)) {
const style2 = document.createElement("style");
style2.setAttribute("id", this.options.styleId);
style2.innerHTML = createDefaultStyle(elementId);
const head = document.head;
if (head.childNodes.length > 0) {
head.insertBefore(style2, head.childNodes[0]);
} else {
head.appendChild(style2);
}
}
}
/**
* The tooltip handler function.
*/
tooltipHandler(handler, event2, item, value2) {
var _a2;
this.el = document.getElementById(this.options.id);
if (!this.el) {
this.el = document.createElement("div");
this.el.setAttribute("id", this.options.id);
this.el.classList.add("vg-tooltip");
const tooltipContainer = (_a2 = document.fullscreenElement) !== null && _a2 !== void 0 ? _a2 : document.body;
tooltipContainer.appendChild(this.el);
}
if (value2 == null || value2 === "") {
this.el.classList.remove("visible", `${this.options.theme}-theme`);
return;
}
this.el.innerHTML = this.options.formatTooltip(value2, this.options.sanitize, this.options.maxDepth);
this.el.classList.add("visible", `${this.options.theme}-theme`);
const { x: x2, y: y2 } = calculatePosition(event2, this.el.getBoundingClientRect(), this.options.offsetX, this.options.offsetY);
this.el.setAttribute("style", `top: ${y2}px; left: ${x2}px`);
}
}
function define(constructor, factory, prototype2) {
constructor.prototype = factory.prototype = prototype2;
prototype2.constructor = constructor;
}
function extend(parent, definition2) {
var prototype2 = Object.create(parent.prototype);
for (var key2 in definition2)
prototype2[key2] = definition2[key2];
return prototype2;
}
function Color() {
}
var darker = 0.7;
var brighter = 1 / darker;
var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
var named = {
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgreen: 25600,
darkgrey: 11119017,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
green: 32768,
greenyellow: 11403055,
grey: 8421504,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgreen: 9498256,
lightgrey: 13882323,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
};
define(Color, color$2, {
copy: function(channels) {
return Object.assign(new this.constructor(), this, channels);
},
displayable: function() {
return this.rgb().displayable();
},
hex: color_formatHex,
// Deprecated! Use color.formatHex.
formatHex: color_formatHex,
formatHsl: color_formatHsl,
formatRgb: color_formatRgb,
toString: color_formatRgb
});
function color_formatHex() {
return this.rgb().formatHex();
}
function color_formatHsl() {
return hslConvert(this).formatHsl();
}
function color_formatRgb() {
return this.rgb().formatRgb();
}
function color$2(format2) {
var m2, l2;
format2 = (format2 + "").trim().toLowerCase();
return (m2 = reHex.exec(format2)) ? (l2 = m2[1].length, m2 = parseInt(m2[1], 16), l2 === 6 ? rgbn(m2) : l2 === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l2 === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l2 === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format2)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format2)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format2)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format2)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
}
function rgbn(n2) {
return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
}
function rgba(r2, g2, b2, a2) {
if (a2 <= 0)
r2 = g2 = b2 = NaN;
return new Rgb(r2, g2, b2, a2);
}
function rgbConvert(o2) {
if (!(o2 instanceof Color))
o2 = color$2(o2);
if (!o2)
return new Rgb();
o2 = o2.rgb();
return new Rgb(o2.r, o2.g, o2.b, o2.opacity);
}
function rgb$1(r2, g2, b2, opacity2) {
return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g2, b2, opacity2 == null ? 1 : opacity2);
}
function Rgb(r2, g2, b2, opacity2) {
this.r = +r2;
this.g = +g2;
this.b = +b2;
this.opacity = +opacity2;
}
define(Rgb, rgb$1, extend(Color, {
brighter: function(k2) {
k2 = k2 == null ? brighter : Math.pow(brighter, k2);
return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
},
darker: function(k2) {
k2 = k2 == null ? darker : Math.pow(darker, k2);
return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
},
rgb: function() {
return this;
},
displayable: function() {
return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
},
hex: rgb_formatHex,
// Deprecated! Use color.formatHex.
formatHex: rgb_formatHex,
formatRgb: rgb_formatRgb,
toString: rgb_formatRgb
}));
function rgb_formatHex() {
return "#" + hex(this.r) + hex(this.g) + hex(this.b);
}
function rgb_formatRgb() {
var a2 = this.opacity;
a2 = isNaN(a2) ? 1 : Math.max(0, Math.min(1, a2));
return (a2 === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a2 === 1 ? ")" : ", " + a2 + ")");
}
function hex(value2) {
value2 = Math.max(0, Math.min(255, Math.round(value2) || 0));
return (value2 < 16 ? "0" : "") + value2.toString(16);
}
function hsla(h2, s2, l2, a2) {
if (a2 <= 0)
h2 = s2 = l2 = NaN;
else if (l2 <= 0 || l2 >= 1)
h2 = s2 = NaN;
else if (s2 <= 0)
h2 = NaN;
return new Hsl(h2, s2, l2, a2);
}
function hslConvert(o2) {
if (o2 instanceof Hsl)
return new Hsl(o2.h, o2.s, o2.l, o2.opacity);
if (!(o2 instanceof Color))
o2 = color$2(o2);
if (!o2)
return new Hsl();
if (o2 instanceof Hsl)
return o2;
o2 = o2.rgb();
var r2 = o2.r / 255, g2 = o2.g / 255, b2 = o2.b / 255, min2 = Math.min(r2, g2, b2), max2 = Math.max(r2, g2, b2), h2 = NaN, s2 = max2 - min2, l2 = (max2 + min2) / 2;
if (s2) {
if (r2 === max2)
h2 = (g2 - b2) / s2 + (g2 < b2) * 6;
else if (g2 === max2)
h2 = (b2 - r2) / s2 + 2;
else
h2 = (r2 - g2) / s2 + 4;
s2 /= l2 < 0.5 ? max2 + min2 : 2 - max2 - min2;
h2 *= 60;
} else {
s2 = l2 > 0 && l2 < 1 ? 0 : h2;
}
return new Hsl(h2, s2, l2, o2.opacity);
}
function hsl$1(h2, s2, l2, opacity2) {
return arguments.length === 1 ? hslConvert(h2) : new Hsl(h2, s2, l2, opacity2 == null ? 1 : opacity2);
}
function Hsl(h2, s2, l2, opacity2) {
this.h = +h2;
this.s = +s2;
this.l = +l2;
this.opacity = +opacity2;
}
define(Hsl, hsl$1, extend(Color, {
brighter: function(k2) {
k2 = k2 == null ? brighter : Math.pow(brighter, k2);
return new Hsl(this.h, this.s, this.l * k2, this.opacity);
},
darker: function(k2) {
k2 = k2 == null ? darker : Math.pow(darker, k2);
return new Hsl(this.h, this.s, this.l * k2, this.opacity);
},
rgb: function() {
var h2 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h2) || isNaN(this.s) ? 0 : this.s, l2 = this.l, m2 = l2 + (l2 < 0.5 ? l2 : 1 - l2) * s2, m1 = 2 * l2 - m2;
return new Rgb(
hsl2rgb(h2 >= 240 ? h2 - 240 : h2 + 120, m1, m2),
hsl2rgb(h2, m1, m2),
hsl2rgb(h2 < 120 ? h2 + 240 : h2 - 120, m1, m2),
this.opacity
);
},
displayable: function() {
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
},
formatHsl: function() {
var a2 = this.opacity;
a2 = isNaN(a2) ? 1 : Math.max(0, Math.min(1, a2));
return (a2 === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a2 === 1 ? ")" : ", " + a2 + ")");
}
}));
function hsl2rgb(h2, m1, m2) {
return (h2 < 60 ? m1 + (m2 - m1) * h2 / 60 : h2 < 180 ? m2 : h2 < 240 ? m1 + (m2 - m1) * (240 - h2) / 60 : m1) * 255;
}
function basis(t12, v0, v1, v2, v3) {
var t22 = t12 * t12, t32 = t22 * t12;
return ((1 - 3 * t12 + 3 * t22 - t32) * v0 + (4 - 6 * t22 + 3 * t32) * v1 + (1 + 3 * t12 + 3 * t22 - 3 * t32) * v2 + t32 * v3) / 6;
}
function basis$1(values2) {
var n2 = values2.length - 1;
return function(t5) {
var i2 = t5 <= 0 ? t5 = 0 : t5 >= 1 ? (t5 = 1, n2 - 1) : Math.floor(t5 * n2), v1 = values2[i2], v2 = values2[i2 + 1], v0 = i2 > 0 ? values2[i2 - 1] : 2 * v1 - v2, v3 = i2 < n2 - 1 ? values2[i2 + 2] : 2 * v2 - v1;
return basis((t5 - i2 / n2) * n2, v0, v1, v2, v3);
};
}
const constant = (x2) => () => x2;
function linear(a2, d2) {
return function(t5) {
return a2 + t5 * d2;
};
}
function exponential(a2, b2, y2) {
return a2 = Math.pow(a2, y2), b2 = Math.pow(b2, y2) - a2, y2 = 1 / y2, function(t5) {
return Math.pow(a2 + t5 * b2, y2);
};
}
function gamma(y2) {
return (y2 = +y2) === 1 ? nogamma : function(a2, b2) {
return b2 - a2 ? exponential(a2, b2, y2) : constant(isNaN(a2) ? b2 : a2);
};
}
function nogamma(a2, b2) {
var d2 = b2 - a2;
return d2 ? linear(a2, d2) : constant(isNaN(a2) ? b2 : a2);
}
(function rgbGamma2(y2) {
var color2 = gamma(y2);
function rgb2(start2, end2) {
var r2 = color2((start2 = rgb$1(start2)).r, (end2 = rgb$1(end2)).r), g2 = color2(start2.g, end2.g), b2 = color2(start2.b, end2.b), opacity2 = nogamma(start2.opacity, end2.opacity);
return function(t5) {
start2.r = r2(t5);
start2.g = g2(t5);
start2.b = b2(t5);
start2.opacity = opacity2(t5);
return start2 + "";
};
}
rgb2.gamma = rgbGamma2;
return rgb2;
})(1);
function rgbSpline(spline) {
return function(colors2) {
var n2 = colors2.length, r2 = new Array(n2), g2 = new Array(n2), b2 = new Array(n2), i2, color2;
for (i2 = 0; i2 < n2; ++i2) {
color2 = rgb$1(colors2[i2]);
r2[i2] = color2.r || 0;
g2[i2] = color2.g || 0;
b2[i2] = color2.b || 0;
}
r2 = spline(r2);
g2 = spline(g2);
b2 = spline(b2);
color2.opacity = 1;
return function(t5) {
color2.r = r2(t5);
color2.g = g2(t5);
color2.b = b2(t5);
return color2 + "";
};
};
}
var rgbBasis = rgbSpline(basis$1);
function I(e7, t5) {
var n2 = Object.keys(e7);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(e7);
t5 && (r2 = r2.filter(function(t6) {
return Object.getOwnPropertyDescriptor(e7, t6).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function b(e7) {
for (var t5 = 1; t5 < arguments.length; t5++) {
var n2 = null != arguments[t5] ? arguments[t5] : {};
t5 % 2 ? I(Object(n2), true).forEach(function(t6) {
A$1(e7, t6, n2[t6]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e7, Object.getOwnPropertyDescriptors(n2)) : I(Object(n2)).forEach(function(t6) {
Object.defineProperty(e7, t6, Object.getOwnPropertyDescriptor(n2, t6));
});
}
return e7;
}
function C(e7, t5) {
if (!(e7 instanceof t5))
throw new TypeError("Cannot call a class as a function");
}
function p$3(e7, t5) {
for (var n2 = 0; n2 < t5.length; n2++) {
var r2 = t5[n2];
r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(e7, r2.key, r2);
}
}
function d$i(e7, t5, n2) {
return t5 && p$3(e7.prototype, t5), n2 && p$3(e7, n2), e7;
}
function A$1(e7, t5, n2) {
return t5 in e7 ? Object.defineProperty(e7, t5, { value: n2, enumerable: true, configurable: true, writable: true }) : e7[t5] = n2, e7;
}
function f$2(e7, t5) {
if ("function" != typeof t5 && null !== t5)
throw new TypeError("Super expression must either be null or a function");
e7.prototype = Object.create(t5 && t5.prototype, { constructor: { value: e7, writable: true, configurable: true } }), t5 && y$3(e7, t5);
}
function m$g(e7) {
return (m$g = Object.setPrototypeOf ? Object.getPrototypeOf : function(e8) {
return e8.__proto__ || Object.getPrototypeOf(e8);
})(e7);
}
function y$3(e7, t5) {
return (y$3 = Object.setPrototypeOf || function(e8, t6) {
return e8.__proto__ = t6, e8;
})(e7, t5);
}
function h$5(e7, t5) {
return !t5 || "object" != typeof t5 && "function" != typeof t5 ? function(e8) {
if (void 0 === e8)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e8;
}(e7) : t5;
}
function v$1(e7) {
var t5 = function() {
if ("undefined" == typeof Reflect || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if ("function" == typeof Proxy)
return true;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), true;
} catch (e8) {
return false;
}
}();
return function() {
var n2, r2 = m$g(e7);
if (t5) {
var c2 = m$g(this).constructor;
n2 = Reflect.construct(r2, arguments, c2);
} else
n2 = r2.apply(this, arguments);
return h$5(this, n2);
};
}
var G = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, B = Array.isArray, x = "object" == typeof G && G && G.Object === Object && G, X = x, w = "object" == typeof self && self && self.Object === Object && self, Z$1 = X || w || Function("return this")(), j = Z$1.Symbol, Y = j, N$1 = Object.prototype, W = N$1.hasOwnProperty, z$2 = N$1.toString, H = Y ? Y.toStringTag : void 0;
var F$1 = function(e7) {
var t5 = W.call(e7, H), n2 = e7[H];
try {
e7[H] = void 0;
var r2 = true;
} catch (e8) {
}
var c2 = z$2.call(e7);
return r2 && (t5 ? e7[H] = n2 : delete e7[H]), c2;
}, V$1 = Object.prototype.toString;
var J = F$1, L$1 = function(e7) {
return V$1.call(e7);
}, O$1 = j ? j.toStringTag : void 0;
var S = function(e7) {
return null == e7 ? void 0 === e7 ? "[object Undefined]" : "[object Null]" : O$1 && O$1 in Object(e7) ? J(e7) : L$1(e7);
};
var R = function(e7) {
return null != e7 && "object" == typeof e7;
}, k = S, M$5 = R;
var D = function(e7) {
return "symbol" == typeof e7 || M$5(e7) && "[object Symbol]" == k(e7);
}, E$1 = B, U$1 = D, Q = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, T$2 = /^\w*$/;
var P = function(e7, t5) {
if (E$1(e7))
return false;
var n2 = typeof e7;
return !("number" != n2 && "symbol" != n2 && "boolean" != n2 && null != e7 && !U$1(e7)) || (T$2.test(e7) || !Q.test(e7) || null != t5 && e7 in Object(t5));
};
var _$1 = function(e7) {
var t5 = typeof e7;
return null != e7 && ("object" == t5 || "function" == t5);
}, $$f = S, K = _$1;
var q, ee = function(e7) {
if (!K(e7))
return false;
var t5 = $$f(e7);
return "[object Function]" == t5 || "[object GeneratorFunction]" == t5 || "[object AsyncFunction]" == t5 || "[object Proxy]" == t5;
}, te = Z$1["__core-js_shared__"], ne = (q = /[^.]+$/.exec(te && te.keys && te.keys.IE_PROTO || "")) ? "Symbol(src)_1." + q : "";
var re = function(e7) {
return !!ne && ne in e7;
}, ce = Function.prototype.toString;
var ie = function(e7) {
if (null != e7) {
try {
return ce.call(e7);
} catch (e8) {
}
try {
return e7 + "";
} catch (e8) {
}
}
return "";
}, ae = ee, oe = re, ue = _$1, ge = ie, se = /^\[object .+?Constructor\]$/, le = Function.prototype, Ie = Object.prototype, be = le.toString, Ce = Ie.hasOwnProperty, pe = RegExp("^" + be.call(Ce).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
var de = function(e7) {
return !(!ue(e7) || oe(e7)) && (ae(e7) ? pe : se).test(ge(e7));
}, Ae = function(e7, t5) {
return null == e7 ? void 0 : e7[t5];
};
var fe = function(e7, t5) {
var n2 = Ae(e7, t5);
return de(n2) ? n2 : void 0;
}, me = fe(Object, "create"), ye = me;
var he = function() {
this.__data__ = ye ? ye(null) : {}, this.size = 0;
};
var ve = function(e7) {
var t5 = this.has(e7) && delete this.__data__[e7];
return this.size -= t5 ? 1 : 0, t5;
}, Ge = me, Be = Object.prototype.hasOwnProperty;
var xe = function(e7) {
var t5 = this.__data__;
if (Ge) {
var n2 = t5[e7];
return "__lodash_hash_undefined__" === n2 ? void 0 : n2;
}
return Be.call(t5, e7) ? t5[e7] : void 0;
}, Xe = me, we = Object.prototype.hasOwnProperty;
var Ze = me;
var je = he, Ye = ve, Ne = xe, We = function(e7) {
var t5 = this.__data__;
return Xe ? void 0 !== t5[e7] : we.call(t5, e7);
}, ze = function(e7, t5) {
var n2 = this.__data__;
return this.size += this.has(e7) ? 0 : 1, n2[e7] = Ze && void 0 === t5 ? "__lodash_hash_undefined__" : t5, this;
};
function He(e7) {
var t5 = -1, n2 = null == e7 ? 0 : e7.length;
for (this.clear(); ++t5 < n2; ) {
var r2 = e7[t5];
this.set(r2[0], r2[1]);
}
}
He.prototype.clear = je, He.prototype.delete = Ye, He.prototype.get = Ne, He.prototype.has = We, He.prototype.set = ze;
var Fe = He;
var Ve = function() {
this.__data__ = [], this.size = 0;
};
var Je = function(e7, t5) {
return e7 === t5 || e7 != e7 && t5 != t5;
}, Le = Je;
var Oe = function(e7, t5) {
for (var n2 = e7.length; n2--; )
if (Le(e7[n2][0], t5))
return n2;
return -1;
}, Se = Oe, Re = Array.prototype.splice;
var ke = Oe;
var Me = Oe;
var De = Oe;
var Ee = Ve, Ue = function(e7) {
var t5 = this.__data__, n2 = Se(t5, e7);
return !(n2 < 0) && (n2 == t5.length - 1 ? t5.pop() : Re.call(t5, n2, 1), --this.size, true);
}, Qe = function(e7) {
var t5 = this.__data__, n2 = ke(t5, e7);
return n2 < 0 ? void 0 : t5[n2][1];
}, Te = function(e7) {
return Me(this.__data__, e7) > -1;
}, Pe = function(e7, t5) {
var n2 = this.__data__, r2 = De(n2, e7);
return r2 < 0 ? (++this.size, n2.push([e7, t5])) : n2[r2][1] = t5, this;
};
function _e(e7) {
var t5 = -1, n2 = null == e7 ? 0 : e7.length;
for (this.clear(); ++t5 < n2; ) {
var r2 = e7[t5];
this.set(r2[0], r2[1]);
}
}
_e.prototype.clear = Ee, _e.prototype.delete = Ue, _e.prototype.get = Qe, _e.prototype.has = Te, _e.prototype.set = Pe;
var $e = _e, Ke = fe(Z$1, "Map"), qe = Fe, et = $e, tt = Ke;
var nt = function(e7) {
var t5 = typeof e7;
return "string" == t5 || "number" == t5 || "symbol" == t5 || "boolean" == t5 ? "__proto__" !== e7 : null === e7;
};
var rt = function(e7, t5) {
var n2 = e7.__data__;
return nt(t5) ? n2["string" == typeof t5 ? "string" : "hash"] : n2.map;
}, ct = rt;
var it = rt;
var at = rt;
var ot = rt;
var ut = function() {
this.size = 0, this.__data__ = { hash: new qe(), map: new (tt || et)(), string: new qe() };
}, gt = function(e7) {
var t5 = ct(this, e7).delete(e7);
return this.size -= t5 ? 1 : 0, t5;
}, st = function(e7) {
return it(this, e7).get(e7);
}, lt = function(e7) {
return at(this, e7).has(e7);
}, It = function(e7, t5) {
var n2 = ot(this, e7), r2 = n2.size;
return n2.set(e7, t5), this.size += n2.size == r2 ? 0 : 1, this;
};
function bt(e7) {
var t5 = -1, n2 = null == e7 ? 0 : e7.length;
for (this.clear(); ++t5 < n2; ) {
var r2 = e7[t5];
this.set(r2[0], r2[1]);
}
}
bt.prototype.clear = ut, bt.prototype.delete = gt, bt.prototype.get = st, bt.prototype.has = lt, bt.prototype.set = It;
var Ct = bt, pt = Ct;
function dt(e7, t5) {
if ("function" != typeof e7 || null != t5 && "function" != typeof t5)
throw new TypeError("Expected a function");
var n2 = function() {
var r2 = arguments, c2 = t5 ? t5.apply(this, r2) : r2[0], i2 = n2.cache;
if (i2.has(c2))
return i2.get(c2);
var a2 = e7.apply(this, r2);
return n2.cache = i2.set(c2, a2) || i2, a2;
};
return n2.cache = new (dt.Cache || pt)(), n2;
}
dt.Cache = pt;
var At = dt;
var ft = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, mt = /\\(\\)?/g, yt = function(e7) {
var t5 = At(e7, function(e8) {
return 500 === n2.size && n2.clear(), e8;
}), n2 = t5.cache;
return t5;
}(function(e7) {
var t5 = [];
return 46 === e7.charCodeAt(0) && t5.push(""), e7.replace(ft, function(e8, n2, r2, c2) {
t5.push(r2 ? c2.replace(mt, "$1") : n2 || e8);
}), t5;
});
var ht = function(e7, t5) {
for (var n2 = -1, r2 = null == e7 ? 0 : e7.length, c2 = Array(r2); ++n2 < r2; )
c2[n2] = t5(e7[n2], n2, e7);
return c2;
}, vt = ht, Gt = B, Bt = D, xt = j ? j.prototype : void 0, Xt = xt ? xt.toString : void 0;
var wt = function e(t5) {
if ("string" == typeof t5)
return t5;
if (Gt(t5))
return vt(t5, e) + "";
if (Bt(t5))
return Xt ? Xt.call(t5) : "";
var n2 = t5 + "";
return "0" == n2 && 1 / t5 == -Infinity ? "-0" : n2;
};
var Zt = function(e7) {
return null == e7 ? "" : wt(e7);
}, jt = B, Yt = P, Nt = yt, Wt = Zt;
var zt = function(e7, t5) {
return jt(e7) ? e7 : Yt(e7, t5) ? [e7] : Nt(Wt(e7));
}, Ht = D;
var Ft = function(e7) {
if ("string" == typeof e7 || Ht(e7))
return e7;
var t5 = e7 + "";
return "0" == t5 && 1 / e7 == -Infinity ? "-0" : t5;
}, Vt = zt, Jt = Ft;
var Lt = function(e7, t5) {
for (var n2 = 0, r2 = (t5 = Vt(t5, e7)).length; null != e7 && n2 < r2; )
e7 = e7[Jt(t5[n2++])];
return n2 && n2 == r2 ? e7 : void 0;
}, Ot = Lt;
var St = function(e7, t5, n2) {
var r2 = null == e7 ? void 0 : Ot(e7, t5);
return void 0 === r2 ? n2 : r2;
};
function Rt(e7, t5, n2) {
var r2 = St(e7, t5, n2);
return "" === r2 ? n2 : r2;
}
var kt = S, Mt = B, Dt = R;
var Et = function(e7) {
return "string" == typeof e7 || !Mt(e7) && Dt(e7) && "[object String]" == kt(e7);
};
var Ut = function() {
function e7(e8) {
var t6 = this;
this._insertTag = function(e9) {
var n2;
n2 = 0 === t6.tags.length ? t6.prepend ? t6.container.firstChild : t6.before : t6.tags[t6.tags.length - 1].nextSibling, t6.container.insertBefore(e9, n2), t6.tags.push(e9);
}, this.isSpeedy = void 0 === e8.speedy || e8.speedy, this.tags = [], this.ctr = 0, this.nonce = e8.nonce, this.key = e8.key, this.container = e8.container, this.prepend = e8.prepend, this.before = null;
}
var t5 = e7.prototype;
return t5.hydrate = function(e8) {
e8.forEach(this._insertTag);
}, t5.insert = function(e8) {
this.ctr % (this.isSpeedy ? 65e3 : 1) == 0 && this._insertTag(function(e9) {
var t7 = document.createElement("style");
return t7.setAttribute("data-emotion", e9.key), void 0 !== e9.nonce && t7.setAttribute("nonce", e9.nonce), t7.appendChild(document.createTextNode("")), t7.setAttribute("data-s", ""), t7;
}(this));
var t6 = this.tags[this.tags.length - 1];
if (this.isSpeedy) {
var n2 = function(e9) {
if (e9.sheet)
return e9.sheet;
for (var t7 = 0; t7 < document.styleSheets.length; t7++)
if (document.styleSheets[t7].ownerNode === e9)
return document.styleSheets[t7];
}(t6);
try {
n2.insertRule(e8, n2.cssRules.length);
} catch (e9) {
}
} else
t6.appendChild(document.createTextNode(e8));
this.ctr++;
}, t5.flush = function() {
this.tags.forEach(function(e8) {
return e8.parentNode.removeChild(e8);
}), this.tags = [], this.ctr = 0;
}, e7;
}(), Qt = "-ms-", Tt = "-moz-", Pt = "-webkit-", _t = Math.abs, $t = String.fromCharCode;
function Kt(e7) {
return e7.trim();
}
function qt(e7, t5, n2) {
return e7.replace(t5, n2);
}
function en(e7, t5) {
return e7.indexOf(t5);
}
function tn(e7, t5) {
return 0 | e7.charCodeAt(t5);
}
function nn(e7, t5, n2) {
return e7.slice(t5, n2);
}
function rn(e7) {
return e7.length;
}
function cn(e7) {
return e7.length;
}
function an(e7, t5) {
return t5.push(e7), e7;
}
var on = 1, un = 1, gn = 0, sn = 0, ln = 0, In = "";
function bn(e7, t5, n2, r2, c2, i2, a2) {
return { value: e7, root: t5, parent: n2, type: r2, props: c2, children: i2, line: on, column: un, length: a2, return: "" };
}
function Cn(e7, t5, n2) {
return bn(e7, t5.root, t5.parent, n2, t5.props, t5.children, 0);
}
function pn() {
return ln = sn > 0 ? tn(In, --sn) : 0, un--, 10 === ln && (un = 1, on--), ln;
}
function dn() {
return ln = sn < gn ? tn(In, sn++) : 0, un++, 10 === ln && (un = 1, on++), ln;
}
function An() {
return tn(In, sn);
}
function fn7() {
return sn;
}
function mn(e7, t5) {
return nn(In, e7, t5);
}
function yn(e7) {
switch (e7) {
case 0:
case 9:
case 10:
case 13:
case 32:
return 5;
case 33:
case 43:
case 44:
case 47:
case 62:
case 64:
case 126:
case 59:
case 123:
case 125:
return 4;
case 58:
return 3;
case 34:
case 39:
case 40:
case 91:
return 2;
case 41:
case 93:
return 1;
}
return 0;
}
function hn(e7) {
return on = un = 1, gn = rn(In = e7), sn = 0, [];
}
function vn(e7) {
return In = "", e7;
}
function Gn(e7) {
return Kt(mn(sn - 1, Xn(91 === e7 ? e7 + 2 : 40 === e7 ? e7 + 1 : e7)));
}
function Bn(e7) {
for (; (ln = An()) && ln < 33; )
dn();
return yn(e7) > 2 || yn(ln) > 3 ? "" : " ";
}
function xn(e7, t5) {
for (; --t5 && dn() && !(ln < 48 || ln > 102 || ln > 57 && ln < 65 || ln > 70 && ln < 97); )
;
return mn(e7, fn7() + (t5 < 6 && 32 == An() && 32 == dn()));
}
function Xn(e7) {
for (; dn(); )
switch (ln) {
case e7:
return sn;
case 34:
case 39:
return Xn(34 === e7 || 39 === e7 ? e7 : ln);
case 40:
41 === e7 && Xn(e7);
break;
case 92:
dn();
}
return sn;
}
function wn(e7, t5) {
for (; dn() && e7 + ln !== 57 && (e7 + ln !== 84 || 47 !== An()); )
;
return "/*" + mn(t5, sn - 1) + "*" + $t(47 === e7 ? e7 : dn());
}
function Zn(e7) {
for (; !yn(An()); )
dn();
return mn(e7, sn);
}
function jn(e7) {
return vn(Yn("", null, null, null, [""], e7 = hn(e7), 0, [0], e7));
}
function Yn(e7, t5, n2, r2, c2, i2, a2, o2, u2) {
for (var g2 = 0, s2 = 0, l2 = a2, I2 = 0, b2 = 0, C3 = 0, p2 = 1, d2 = 1, A5 = 1, f2 = 0, m2 = "", y2 = c2, h2 = i2, v2 = r2, G2 = m2; d2; )
switch (C3 = f2, f2 = dn()) {
case 34:
case 39:
case 91:
case 40:
G2 += Gn(f2);
break;
case 9:
case 10:
case 13:
case 32:
G2 += Bn(C3);
break;
case 92:
G2 += xn(fn7() - 1, 7);
continue;
case 47:
switch (An()) {
case 42:
case 47:
an(Wn(wn(dn(), fn7()), t5, n2), u2);
break;
default:
G2 += "/";
}
break;
case 123 * p2:
o2[g2++] = rn(G2) * A5;
case 125 * p2:
case 59:
case 0:
switch (f2) {
case 0:
case 125:
d2 = 0;
case 59 + s2:
b2 > 0 && rn(G2) - l2 && an(b2 > 32 ? zn(G2 + ";", r2, n2, l2 - 1) : zn(qt(G2, " ", "") + ";", r2, n2, l2 - 2), u2);
break;
case 59:
G2 += ";";
default:
if (an(v2 = Nn(G2, t5, n2, g2, s2, c2, o2, m2, y2 = [], h2 = [], l2), i2), 123 === f2)
if (0 === s2)
Yn(G2, t5, v2, v2, y2, i2, l2, o2, h2);
else
switch (I2) {
case 100:
case 109:
case 115:
Yn(e7, v2, v2, r2 && an(Nn(e7, v2, v2, 0, 0, c2, o2, m2, c2, y2 = [], l2), h2), c2, h2, l2, o2, r2 ? y2 : h2);
break;
default:
Yn(G2, v2, v2, v2, [""], h2, l2, o2, h2);
}
}
g2 = s2 = b2 = 0, p2 = A5 = 1, m2 = G2 = "", l2 = a2;
break;
case 58:
l2 = 1 + rn(G2), b2 = C3;
default:
if (p2 < 1) {
if (123 == f2)
--p2;
else if (125 == f2 && 0 == p2++ && 125 == pn())
continue;
}
switch (G2 += $t(f2), f2 * p2) {
case 38:
A5 = s2 > 0 ? 1 : (G2 += "\f", -1);
break;
case 44:
o2[g2++] = (rn(G2) - 1) * A5, A5 = 1;
break;
case 64:
45 === An() && (G2 += Gn(dn())), I2 = An(), s2 = rn(m2 = G2 += Zn(fn7())), f2++;
break;
case 45:
45 === C3 && 2 == rn(G2) && (p2 = 0);
}
}
return i2;
}
function Nn(e7, t5, n2, r2, c2, i2, a2, o2, u2, g2, s2) {
for (var l2 = c2 - 1, I2 = 0 === c2 ? i2 : [""], b2 = cn(I2), C3 = 0, p2 = 0, d2 = 0; C3 < r2; ++C3)
for (var A5 = 0, f2 = nn(e7, l2 + 1, l2 = _t(p2 = a2[C3])), m2 = e7; A5 < b2; ++A5)
(m2 = Kt(p2 > 0 ? I2[A5] + " " + f2 : qt(f2, /&\f/g, I2[A5]))) && (u2[d2++] = m2);
return bn(e7, t5, n2, 0 === c2 ? "rule" : o2, u2, g2, s2);
}
function Wn(e7, t5, n2) {
return bn(e7, t5, n2, "comm", $t(ln), nn(e7, 2, -2), 0);
}
function zn(e7, t5, n2, r2) {
return bn(e7, t5, n2, "decl", nn(e7, 0, r2), nn(e7, r2 + 1, -1), r2);
}
function Hn(e7, t5) {
switch (function(e8, t6) {
return (((t6 << 2 ^ tn(e8, 0)) << 2 ^ tn(e8, 1)) << 2 ^ tn(e8, 2)) << 2 ^ tn(e8, 3);
}(e7, t5)) {
case 5103:
return Pt + "print-" + e7 + e7;
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921:
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005:
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855:
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
return Pt + e7 + e7;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return Pt + e7 + Tt + e7 + Qt + e7 + e7;
case 6828:
case 4268:
return Pt + e7 + Qt + e7 + e7;
case 6165:
return Pt + e7 + Qt + "flex-" + e7 + e7;
case 5187:
return Pt + e7 + qt(e7, /(\w+).+(:[^]+)/, "-webkit-box-$1$2-ms-flex-$1$2") + e7;
case 5443:
return Pt + e7 + Qt + "flex-item-" + qt(e7, /flex-|-self/, "") + e7;
case 4675:
return Pt + e7 + Qt + "flex-line-pack" + qt(e7, /align-content|flex-|-self/, "") + e7;
case 5548:
return Pt + e7 + Qt + qt(e7, "shrink", "negative") + e7;
case 5292:
return Pt + e7 + Qt + qt(e7, "basis", "preferred-size") + e7;
case 6060:
return Pt + "box-" + qt(e7, "-grow", "") + Pt + e7 + Qt + qt(e7, "grow", "positive") + e7;
case 4554:
return Pt + qt(e7, /([^-])(transform)/g, "$1-webkit-$2") + e7;
case 6187:
return qt(qt(qt(e7, /(zoom-|grab)/, Pt + "$1"), /(image-set)/, Pt + "$1"), e7, "") + e7;
case 5495:
case 3959:
return qt(e7, /(image-set\([^]*)/, Pt + "$1$`$1");
case 4968:
return qt(qt(e7, /(.+:)(flex-)?(.*)/, "-webkit-box-pack:$3-ms-flex-pack:$3"), /s.+-b[^;]+/, "justify") + Pt + e7 + e7;
case 4095:
case 3583:
case 4068:
case 2532:
return qt(e7, /(.+)-inline(.+)/, Pt + "$1$2") + e7;
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
if (rn(e7) - 1 - t5 > 6)
switch (tn(e7, t5 + 1)) {
case 109:
if (45 !== tn(e7, t5 + 4))
break;
case 102:
return qt(e7, /(.+:)(.+)-([^]+)/, "$1-webkit-$2-$3$1" + Tt + (108 == tn(e7, t5 + 3) ? "$3" : "$2-$3")) + e7;
case 115:
return ~en(e7, "stretch") ? Hn(qt(e7, "stretch", "fill-available"), t5) + e7 : e7;
}
break;
case 4949:
if (115 !== tn(e7, t5 + 1))
break;
case 6444:
switch (tn(e7, rn(e7) - 3 - (~en(e7, "!important") && 10))) {
case 107:
return qt(e7, ":", ":" + Pt) + e7;
case 101:
return qt(e7, /(.+:)([^;!]+)(;|!.+)?/, "$1" + Pt + (45 === tn(e7, 14) ? "inline-" : "") + "box$3$1" + Pt + "$2$3$1" + Qt + "$2box$3") + e7;
}
break;
case 5936:
switch (tn(e7, t5 + 11)) {
case 114:
return Pt + e7 + Qt + qt(e7, /[svh]\w+-[tblr]{2}/, "tb") + e7;
case 108:
return Pt + e7 + Qt + qt(e7, /[svh]\w+-[tblr]{2}/, "tb-rl") + e7;
case 45:
return Pt + e7 + Qt + qt(e7, /[svh]\w+-[tblr]{2}/, "lr") + e7;
}
return Pt + e7 + Qt + e7 + e7;
}
return e7;
}
function Fn(e7, t5) {
for (var n2 = "", r2 = cn(e7), c2 = 0; c2 < r2; c2++)
n2 += t5(e7[c2], c2, e7, t5) || "";
return n2;
}
function Vn(e7, t5, n2, r2) {
switch (e7.type) {
case "@import":
case "decl":
return e7.return = e7.return || e7.value;
case "comm":
return "";
case "rule":
e7.value = e7.props.join(",");
}
return rn(n2 = Fn(e7.children, r2)) ? e7.return = e7.value + "{" + n2 + "}" : "";
}
function Jn(e7) {
var t5 = cn(e7);
return function(n2, r2, c2, i2) {
for (var a2 = "", o2 = 0; o2 < t5; o2++)
a2 += e7[o2](n2, r2, c2, i2) || "";
return a2;
};
}
function Ln(e7) {
var t5 = /* @__PURE__ */ Object.create(null);
return function(n2) {
return void 0 === t5[n2] && (t5[n2] = e7(n2)), t5[n2];
};
}
var On = function(e7, t5) {
return vn(function(e8, t6) {
var n2 = -1, r2 = 44;
do {
switch (yn(r2)) {
case 0:
38 === r2 && 12 === An() && (t6[n2] = 1), e8[n2] += Zn(sn - 1);
break;
case 2:
e8[n2] += Gn(r2);
break;
case 4:
if (44 === r2) {
e8[++n2] = 58 === An() ? "&\f" : "", t6[n2] = e8[n2].length;
break;
}
default:
e8[n2] += $t(r2);
}
} while (r2 = dn());
return e8;
}(hn(e7), t5));
}, Sn = /* @__PURE__ */ new WeakMap(), Rn = function(e7) {
if ("rule" === e7.type && e7.parent && e7.length) {
for (var t5 = e7.value, n2 = e7.parent, r2 = e7.column === n2.column && e7.line === n2.line; "rule" !== n2.type; )
if (!(n2 = n2.parent))
return;
if ((1 !== e7.props.length || 58 === t5.charCodeAt(0) || Sn.get(n2)) && !r2) {
Sn.set(e7, true);
for (var c2 = [], i2 = On(t5, c2), a2 = n2.props, o2 = 0, u2 = 0; o2 < i2.length; o2++)
for (var g2 = 0; g2 < a2.length; g2++, u2++)
e7.props[u2] = c2[o2] ? i2[o2].replace(/&\f/g, a2[g2]) : a2[g2] + " " + i2[o2];
}
}
}, kn = function(e7) {
if ("decl" === e7.type) {
var t5 = e7.value;
108 === t5.charCodeAt(0) && 98 === t5.charCodeAt(2) && (e7.return = "", e7.value = "");
}
}, Mn = "undefined" != typeof document, Dn = Mn ? void 0 : function(e7) {
var t5 = /* @__PURE__ */ new WeakMap();
return function(n2) {
if (t5.has(n2))
return t5.get(n2);
var r2 = e7(n2);
return t5.set(n2, r2), r2;
};
}(function() {
return Ln(function() {
var e7 = {};
return function(t5) {
return e7[t5];
};
});
}), En = [function(e7, t5, n2, r2) {
if (!e7.return)
switch (e7.type) {
case "decl":
e7.return = Hn(e7.value, e7.length);
break;
case "@keyframes":
return Fn([Cn(qt(e7.value, "@", "@" + Pt), e7, "")], r2);
case "rule":
if (e7.length)
return function(e8, t6) {
return e8.map(t6).join("");
}(e7.props, function(t6) {
switch (function(e8, t7) {
return (e8 = t7.exec(e8)) ? e8[0] : e8;
}(t6, /(::plac\w+|:read-\w+)/)) {
case ":read-only":
case ":read-write":
return Fn([Cn(qt(t6, /:(read-\w+)/, ":-moz-$1"), e7, "")], r2);
case "::placeholder":
return Fn([Cn(qt(t6, /:(plac\w+)/, ":-webkit-input-$1"), e7, ""), Cn(qt(t6, /:(plac\w+)/, ":-moz-$1"), e7, ""), Cn(qt(t6, /:(plac\w+)/, Qt + "input-$1"), e7, "")], r2);
}
return "";
});
}
}], Un = function(e7) {
var t5 = e7.key;
if (Mn && "css" === t5) {
var n2 = document.querySelectorAll("style[data-emotion]:not([data-s])");
Array.prototype.forEach.call(n2, function(e8) {
-1 !== e8.getAttribute("data-emotion").indexOf(" ") && (document.head.appendChild(e8), e8.setAttribute("data-s", ""));
});
}
var r2, c2, i2 = e7.stylisPlugins || En, a2 = {}, o2 = [];
Mn && (r2 = e7.container || document.head, Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="' + t5 + ' "]'), function(e8) {
for (var t6 = e8.getAttribute("data-emotion").split(" "), n3 = 1; n3 < t6.length; n3++)
a2[t6[n3]] = true;
o2.push(e8);
}));
var u2, g2 = [Rn, kn];
if (Mn) {
var s2, l2 = [Vn, (u2 = function(e8) {
s2.insert(e8);
}, function(e8) {
e8.root || (e8 = e8.return) && u2(e8);
})], I2 = Jn(g2.concat(i2, l2));
c2 = function(e8, t6, n3, r3) {
s2 = n3, Fn(jn(e8 ? e8 + "{" + t6.styles + "}" : t6.styles), I2), r3 && (A5.inserted[t6.name] = true);
};
} else {
var b2 = [Vn], C3 = Jn(g2.concat(i2, b2)), p2 = Dn(i2)(t5), d2 = function(e8, t6) {
var n3 = t6.name;
return void 0 === p2[n3] && (p2[n3] = Fn(jn(e8 ? e8 + "{" + t6.styles + "}" : t6.styles), C3)), p2[n3];
};
c2 = function(e8, t6, n3, r3) {
var c3 = t6.name, i3 = d2(e8, t6);
return void 0 === A5.compat ? (r3 && (A5.inserted[c3] = true), i3) : r3 ? void (A5.inserted[c3] = i3) : i3;
};
}
var A5 = { key: t5, sheet: new Ut({ key: t5, container: r2, nonce: e7.nonce, speedy: e7.speedy, prepend: e7.prepend }), nonce: e7.nonce, inserted: a2, registered: {}, insert: c2 };
return A5.sheet.hydrate(o2), A5;
}, Qn = { exports: {} }, Tn = {}, Pn = "function" == typeof Symbol && Symbol.for, _n = Pn ? Symbol.for("react.element") : 60103, $n = Pn ? Symbol.for("react.portal") : 60106, Kn = Pn ? Symbol.for("react.fragment") : 60107, qn = Pn ? Symbol.for("react.strict_mode") : 60108, er = Pn ? Symbol.for("react.profiler") : 60114, tr = Pn ? Symbol.for("react.provider") : 60109, nr = Pn ? Symbol.for("react.context") : 60110, rr = Pn ? Symbol.for("react.async_mode") : 60111, cr = Pn ? Symbol.for("react.concurrent_mode") : 60111, ir = Pn ? Symbol.for("react.forward_ref") : 60112, ar = Pn ? Symbol.for("react.suspense") : 60113, or2 = Pn ? Symbol.for("react.suspense_list") : 60120, ur = Pn ? Symbol.for("react.memo") : 60115, gr = Pn ? Symbol.for("react.lazy") : 60116, sr = Pn ? Symbol.for("react.block") : 60121, lr = Pn ? Symbol.for("react.fundamental") : 60117, Ir = Pn ? Symbol.for("react.responder") : 60118, br = Pn ? Symbol.for("react.scope") : 60119;
function Cr(e7) {
if ("object" == typeof e7 && null !== e7) {
var t5 = e7.$$typeof;
switch (t5) {
case _n:
switch (e7 = e7.type) {
case rr:
case cr:
case Kn:
case er:
case qn:
case ar:
return e7;
default:
switch (e7 = e7 && e7.$$typeof) {
case nr:
case ir:
case gr:
case ur:
case tr:
return e7;
default:
return t5;
}
}
case $n:
return t5;
}
}
}
function pr(e7) {
return Cr(e7) === cr;
}
Tn.AsyncMode = rr, Tn.ConcurrentMode = cr, Tn.ContextConsumer = nr, Tn.ContextProvider = tr, Tn.Element = _n, Tn.ForwardRef = ir, Tn.Fragment = Kn, Tn.Lazy = gr, Tn.Memo = ur, Tn.Portal = $n, Tn.Profiler = er, Tn.StrictMode = qn, Tn.Suspense = ar, Tn.isAsyncMode = function(e7) {
return pr(e7) || Cr(e7) === rr;
}, Tn.isConcurrentMode = pr, Tn.isContextConsumer = function(e7) {
return Cr(e7) === nr;
}, Tn.isContextProvider = function(e7) {
return Cr(e7) === tr;
}, Tn.isElement = function(e7) {
return "object" == typeof e7 && null !== e7 && e7.$$typeof === _n;
}, Tn.isForwardRef = function(e7) {
return Cr(e7) === ir;
}, Tn.isFragment = function(e7) {
return Cr(e7) === Kn;
}, Tn.isLazy = function(e7) {
return Cr(e7) === gr;
}, Tn.isMemo = function(e7) {
return Cr(e7) === ur;
}, Tn.isPortal = function(e7) {
return Cr(e7) === $n;
}, Tn.isProfiler = function(e7) {
return Cr(e7) === er;
}, Tn.isStrictMode = function(e7) {
return Cr(e7) === qn;
}, Tn.isSuspense = function(e7) {
return Cr(e7) === ar;
}, Tn.isValidElementType = function(e7) {
return "string" == typeof e7 || "function" == typeof e7 || e7 === Kn || e7 === cr || e7 === er || e7 === qn || e7 === ar || e7 === or2 || "object" == typeof e7 && null !== e7 && (e7.$$typeof === gr || e7.$$typeof === ur || e7.$$typeof === tr || e7.$$typeof === nr || e7.$$typeof === ir || e7.$$typeof === lr || e7.$$typeof === Ir || e7.$$typeof === br || e7.$$typeof === sr);
}, Tn.typeOf = Cr, Qn.exports = Tn;
var dr = Qn.exports, Ar = {};
Ar[dr.ForwardRef] = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }, Ar[dr.Memo] = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true };
var fr = "undefined" != typeof document;
var mr = function(e7, t5, n2) {
var r2 = e7.key + "-" + t5.name;
if ((false === n2 || false === fr && void 0 !== e7.compat) && void 0 === e7.registered[r2] && (e7.registered[r2] = t5.styles), void 0 === e7.inserted[t5.name]) {
var c2 = "", i2 = t5;
do {
var a2 = e7.insert(t5 === i2 ? "." + r2 : "", i2, e7.sheet, true);
fr || void 0 === a2 || (c2 += a2), i2 = i2.next;
} while (void 0 !== i2);
if (!fr && 0 !== c2.length)
return c2;
}
};
var yr = { animationIterationCount: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }, hr = /[A-Z]|^ms/g, vr = /_EMO_([^_]+?)_([^]*?)_EMO_/g, Gr = function(e7) {
return 45 === e7.charCodeAt(1);
}, Br = function(e7) {
return null != e7 && "boolean" != typeof e7;
}, xr = Ln(function(e7) {
return Gr(e7) ? e7 : e7.replace(hr, "-$&").toLowerCase();
}), Xr = function(e7, t5) {
switch (e7) {
case "animation":
case "animationName":
if ("string" == typeof t5)
return t5.replace(vr, function(e8, t6, n2) {
return Zr = { name: t6, styles: n2, next: Zr }, t6;
});
}
return 1 === yr[e7] || Gr(e7) || "number" != typeof t5 || 0 === t5 ? t5 : t5 + "px";
};
function wr(e7, t5, n2) {
if (null == n2)
return "";
if (void 0 !== n2.__emotion_styles)
return n2;
switch (typeof n2) {
case "boolean":
return "";
case "object":
if (1 === n2.anim)
return Zr = { name: n2.name, styles: n2.styles, next: Zr }, n2.name;
if (void 0 !== n2.styles) {
var r2 = n2.next;
if (void 0 !== r2)
for (; void 0 !== r2; )
Zr = { name: r2.name, styles: r2.styles, next: Zr }, r2 = r2.next;
return n2.styles + ";";
}
return function(e8, t6, n3) {
var r3 = "";
if (Array.isArray(n3))
for (var c3 = 0; c3 < n3.length; c3++)
r3 += wr(e8, t6, n3[c3]) + ";";
else
for (var i3 in n3) {
var a3 = n3[i3];
if ("object" != typeof a3)
null != t6 && void 0 !== t6[a3] ? r3 += i3 + "{" + t6[a3] + "}" : Br(a3) && (r3 += xr(i3) + ":" + Xr(i3, a3) + ";");
else if (!Array.isArray(a3) || "string" != typeof a3[0] || null != t6 && void 0 !== t6[a3[0]]) {
var o2 = wr(e8, t6, a3);
switch (i3) {
case "animation":
case "animationName":
r3 += xr(i3) + ":" + o2 + ";";
break;
default:
r3 += i3 + "{" + o2 + "}";
}
} else
for (var u2 = 0; u2 < a3.length; u2++)
Br(a3[u2]) && (r3 += xr(i3) + ":" + Xr(i3, a3[u2]) + ";");
}
return r3;
}(e7, t5, n2);
case "function":
if (void 0 !== e7) {
var c2 = Zr, i2 = n2(e7);
return Zr = c2, wr(e7, t5, i2);
}
}
if (null == t5)
return n2;
var a2 = t5[n2];
return void 0 !== a2 ? a2 : n2;
}
var Zr, jr = /label:\s*([^\s;\n{]+)\s*(;|$)/g, Yr = function(e7, t5, n2) {
if (1 === e7.length && "object" == typeof e7[0] && null !== e7[0] && void 0 !== e7[0].styles)
return e7[0];
var r2 = true, c2 = "";
Zr = void 0;
var i2 = e7[0];
null == i2 || void 0 === i2.raw ? (r2 = false, c2 += wr(n2, t5, i2)) : c2 += i2[0];
for (var a2 = 1; a2 < e7.length; a2++)
c2 += wr(n2, t5, e7[a2]), r2 && (c2 += i2[a2]);
jr.lastIndex = 0;
for (var o2, u2 = ""; null !== (o2 = jr.exec(c2)); )
u2 += "-" + o2[1];
return { name: function(e8) {
for (var t6, n3 = 0, r3 = 0, c3 = e8.length; c3 >= 4; ++r3, c3 -= 4)
t6 = 1540483477 * (65535 & (t6 = 255 & e8.charCodeAt(r3) | (255 & e8.charCodeAt(++r3)) << 8 | (255 & e8.charCodeAt(++r3)) << 16 | (255 & e8.charCodeAt(++r3)) << 24)) + (59797 * (t6 >>> 16) << 16), n3 = 1540483477 * (65535 & (t6 ^= t6 >>> 24)) + (59797 * (t6 >>> 16) << 16) ^ 1540483477 * (65535 & n3) + (59797 * (n3 >>> 16) << 16);
switch (c3) {
case 3:
n3 ^= (255 & e8.charCodeAt(r3 + 2)) << 16;
case 2:
n3 ^= (255 & e8.charCodeAt(r3 + 1)) << 8;
case 1:
n3 = 1540483477 * (65535 & (n3 ^= 255 & e8.charCodeAt(r3))) + (59797 * (n3 >>> 16) << 16);
}
return (((n3 = 1540483477 * (65535 & (n3 ^= n3 >>> 13)) + (59797 * (n3 >>> 16) << 16)) ^ n3 >>> 15) >>> 0).toString(36);
}(c2) + u2, styles: c2, next: Zr };
}, Nr = "undefined" != typeof document, Wr = Object.prototype.hasOwnProperty, zr = reactExports.createContext("undefined" != typeof HTMLElement ? Un({ key: "css" }) : null);
zr.Provider;
var Hr = function(e7) {
return reactExports.forwardRef(function(n2, r2) {
var c2 = reactExports.useContext(zr);
return e7(n2, c2, r2);
});
};
Nr || (Hr = function(e7) {
return function(r2) {
var c2 = reactExports.useContext(zr);
return null === c2 ? (c2 = Un({ key: "css" }), reactExports.createElement(zr.Provider, { value: c2 }, e7(r2, c2))) : e7(r2, c2);
};
});
var Fr = reactExports.createContext({}), Vr = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", Jr = function(e7, t5) {
var n2 = {};
for (var r2 in t5)
Wr.call(t5, r2) && (n2[r2] = t5[r2]);
return n2[Vr] = e7, n2;
}, Lr = Hr(function(e7, c2, i2) {
var a2 = e7.css;
"string" == typeof a2 && void 0 !== c2.registered[a2] && (a2 = c2.registered[a2]);
var o2 = e7[Vr], u2 = [a2], g2 = "";
"string" == typeof e7.className ? g2 = function(e8, t5, n2) {
var r2 = "";
return n2.split(" ").forEach(function(n3) {
void 0 !== e8[n3] ? t5.push(e8[n3] + ";") : r2 += n3 + " ";
}), r2;
}(c2.registered, u2, e7.className) : null != e7.className && (g2 = e7.className + " ");
var s2 = Yr(u2, void 0, "function" == typeof a2 || Array.isArray(a2) ? reactExports.useContext(Fr) : void 0), l2 = mr(c2, s2, "string" == typeof o2);
g2 += c2.key + "-" + s2.name;
var I2 = {};
for (var b2 in e7)
Wr.call(e7, b2) && "css" !== b2 && b2 !== Vr && (I2[b2] = e7[b2]);
I2.ref = i2, I2.className = g2;
var C3 = reactExports.createElement(o2, I2);
if (!Nr && void 0 !== l2) {
for (var p2, d2 = s2.name, A5 = s2.next; void 0 !== A5; )
d2 += " " + A5.name, A5 = A5.next;
return reactExports.createElement(reactExports.Fragment, null, reactExports.createElement("style", ((p2 = {})["data-emotion"] = c2.key + " " + d2, p2.dangerouslySetInnerHTML = { __html: l2 }, p2.nonce = c2.sheet.nonce, p2)), C3);
}
return C3;
}), Or = function(e7, t5) {
var r2 = arguments;
if (null == t5 || !Wr.call(t5, "css"))
return reactExports.createElement.apply(void 0, r2);
var c2 = r2.length, i2 = new Array(c2);
i2[0] = Lr, i2[1] = Jr(e7, t5);
for (var a2 = 2; a2 < c2; a2++)
i2[a2] = r2[a2];
return reactExports.createElement.apply(null, i2);
}, Sr = Hr(function(e7, r2) {
var c2 = e7.styles, i2 = Yr([c2], void 0, "function" == typeof c2 || Array.isArray(c2) ? reactExports.useContext(Fr) : void 0);
if (!Nr) {
for (var u2, g2 = i2.name, s2 = i2.styles, l2 = i2.next; void 0 !== l2; )
g2 += " " + l2.name, s2 += l2.styles, l2 = l2.next;
var I2 = true === r2.compat, b2 = r2.insert("", { name: g2, styles: s2 }, r2.sheet, I2);
return I2 ? null : reactExports.createElement("style", ((u2 = {})["data-emotion"] = r2.key + "-global " + g2, u2.dangerouslySetInnerHTML = { __html: b2 }, u2.nonce = r2.sheet.nonce, u2));
}
var C3 = reactExports.useRef();
return reactExports.useLayoutEffect(function() {
var e8 = r2.key + "-global", t5 = new Ut({ key: e8, nonce: r2.sheet.nonce, container: r2.sheet.container, speedy: r2.sheet.isSpeedy }), n2 = false, c3 = document.querySelector('style[data-emotion="' + e8 + " " + i2.name + '"]');
return r2.sheet.tags.length && (t5.before = r2.sheet.tags[0]), null !== c3 && (n2 = true, c3.setAttribute("data-emotion", e8), t5.hydrate([c3])), C3.current = [t5, n2], function() {
t5.flush();
};
}, [r2]), reactExports.useLayoutEffect(function() {
var e8 = C3.current, t5 = e8[0];
if (e8[1])
e8[1] = false;
else {
if (void 0 !== i2.next && mr(r2, i2.next, true), t5.tags.length) {
var n2 = t5.tags[t5.tags.length - 1].nextElementSibling;
t5.before = n2, t5.flush();
}
r2.insert("", i2, t5, false);
}
}, [r2, i2.name]), null;
}), Rr = function() {
function e7() {
C(this, e7);
}
return d$i(e7, null, [{ key: "type", value: function(e8, t5) {
return { name: e8, lib: t5, isRequired: { name: e8, lib: t5.isRequired, required: true } };
} }, { key: "renderNameWithType", value: function(e8, t5, n2) {
var r2 = Or("span", null, Or("span", { className: "typeLimitStart" }, e8, "("), Or("span", null, t5), Or("span", { className: "typeLimitEnd" }, ")"));
return Or(n2 ? "div" : "span", null, r2);
} }]), e7;
}();
Rr.any = Rr.type("any", u$9.any), Rr.array = Rr.type("array", u$9.array), Rr.arrayOf = function(e7) {
return Rr.type(Rr.renderNameWithType("arrayOf", e7.name), u$9.arrayOf(e7.lib));
}, Rr.bool = Rr.type("bool", u$9.bool), Rr.element = Rr.type("element", u$9.element), Rr.func = Rr.type("function", u$9.func), Rr.instanceOf = function(e7, t5) {
return Rr.type(Rr.renderNameWithType("instanceOf", t5 || e7.name), u$9.instanceOf(e7));
}, Rr.node = Rr.type("node", u$9.node), Rr.number = Rr.type("number", u$9.number), Rr.object = Rr.type("object", u$9.object), Rr.objectOf = function(e7) {
return Rr.type(Rr.renderNameWithType("objectOf", e7.name), u$9.objectOf(e7.lib));
}, Rr.oneOf = function(e7) {
return Rr.type(e7.map(function(e8) {
return e8 ? '"' + e8 + '"' : "" + e8;
}).join(" / "), u$9.oneOf(e7));
}, Rr.oneOfItems = function(e7) {
return Rr.type(e7.join(", "), u$9.oneOf(e7));
}, Rr.oneOfType = function(e7) {
return Rr.type(e7.some(function(e8) {
return !Et(e8.name);
}) ? Rr.renderNameWithType("oneOfType", e7.map(function(t5, n2) {
return Or("div", { className: "typeNoIntentation", key: n2 }, t5.name, n2 < e7.length - 1 ? "," : "");
}), true) : e7.map(function(e8) {
return e8.name;
}).join(" / "), u$9.oneOfType(e7.map(function(e8) {
return e8.lib;
})));
}, Rr.shape = function(e7) {
var t5 = [], n2 = {};
return Object.keys(e7).sort().forEach(function(r2) {
var c2 = "__" === r2.substring(0, 2) ? r2.substring(2) : r2;
t5.push(Or("div", { key: r2, className: "__" === r2.substring(0, 2) ? "deprecated" : void 0 }, true === e7[r2].required ? Or("strong", { title: "required", className: "requiredMark" }, c2) : c2, ": ", e7[r2].name)), n2[r2] = e7[r2].lib;
}), Rr.type(Rr.renderNameWithType("shape", t5, true), u$9.shape(n2));
}, Rr.string = Rr.type("string", u$9.string), Rr.symbol = Rr.type("symbol", u$9.symbol), Rr.custom = function(e7, t5) {
return Rr.type(e7, t5);
}, Rr.childrenOfType = function(e7, t5) {
return Rr.custom("childrenOfType(".concat(t5 || Rt(e7, "name"), ")"), function(n2, r2) {
if ("children" !== r2)
return new Error('expected propName "children", but propName is "'.concat(r2, '"'));
var c2 = function(n3, r3) {
var c3 = Rt(e7, "name"), i3 = Rt(n3, "type.name");
if (c3 !== i3)
return new Error("child".concat(void 0 !== r3 ? "[".concat(r3, "]") : "", " is not of type '").concat(t5 || c3, "' - it is '").concat(i3, "'"));
}, i2 = n2[r2];
if (Array.isArray(i2))
for (var a2 = 0; a2 < i2.length; a2++) {
var o2 = c2(i2[a2], a2);
if (o2)
return o2;
}
else
c2(i2);
});
}, Rr.childrenExact = function(e7) {
return Rr.custom("childrenExact(".concat(e7.map(function(e8) {
return e8.displayed || Rt(e8.type, "name");
}).join(", "), ")"), function(t5, n2) {
if ("children" !== n2)
return new Error('expected propName "children", but propName is "'.concat(n2, '"'));
var r2 = function(t6, n3) {
var r3 = Rt(e7[n3], "type.name"), c3 = Rt(t6, "type.name");
if (r3 !== c3)
return new Error("child".concat(void 0 !== n3 ? "[".concat(n3, "]") : "", " is not of type '").concat(Rt(e7[n3], "displayed") || r3, "' - it is '").concat(c3, "'"));
}, c2 = t5[n2];
if (Array.isArray(c2))
for (var i2 = 0; i2 < Math.max(c2.length, e7.length); i2++) {
var a2 = r2(c2[i2], i2);
if (a2)
return a2;
}
else
r2(c2, e7[0]);
});
}, Rr.matchRegex = function(e7) {
return Rr.custom("string", function(t5, n2) {
if (!(e7 instanceof RegExp))
throw new Error("You have to provide valid regular expression");
if (!e7.test(t5[n2]))
return new Error("Invalid prop `" + n2 + "` supplied. Validation failed.");
});
};
var Mr = { name: "1xw71br", styles: "p{margin:0;}code{margin-bottom:0;}" }, Dr = { name: "wzss3d", styles: "font-weight:bold;margin:15px 0 10px 0" }, Er = { name: "1r0yqr6", styles: "margin-top:10px" }, Ur = { name: "1pzd1cu", styles: "color:rgba(51, 51, 51, 0.9)" }, Qr = { name: "gicw1p", styles: "color:#000080" }, Tr = { name: "yuhgai", styles: "color:#266d90" }, Pr = { name: "4om4fj", styles: "color:#d14" }, _r = { name: "vnst0l", styles: "padding-left:10px" }, $r = { name: "ht9b8z", styles: "font-family:var(--font-family);font-size:14px;padding-left:10px" }, Kr = { name: "1jwcxx3", styles: "font-style:italic" }, qr = function(t5) {
f$2(r2, React.Component);
var n2 = v$1(r2);
function r2() {
return C(this, r2), n2.apply(this, arguments);
}
return d$i(r2, [{ key: "render", value: function() {
var e7 = this;
return Or("div", { id: this.props.id, css: Mr, className: this.props.className }, Or("div", { css: $r }, this.props.text), Or("div", { css: Dr }, "Signature:"), Or("code", null, Or("span", { css: [Qr, Kr, "", ""] }, "function"), "(", this.props.params.map(function(t6, n3) {
return Or("span", { key: n3 }, Or("span", { css: Tr }, t6.name), e7.props.params.length !== n3 + 1 && Or("span", { css: Ur }, ", "));
}), ") =>", Or("span", { css: [_r, Pr, "", ""] }, this.props.return), Or("div", { css: Er }, this.props.params.map(function(e8, t6) {
return Or("div", { key: t6 }, Or("span", { css: Tr }, e8.name), !!e8.type && Or("span", { css: Pr }, Or("span", { css: Ur }, ":"), e8.type), Or("span", { css: [$r, Ur, "", ""] }, e8.description));
}))));
} }]), r2;
}();
qr.defaultProps = { className: void 0, id: void 0, params: [], return: "void" };
var ec = function() {
function e7() {
C(this, e7);
}
return d$i(e7, null, [{ key: "buildPropTypes", value: function(e8) {
var t5 = {};
return Object.keys(e8).sort().map(function(n2) {
t5[n2] = e8[n2].type.lib;
}), t5;
} }, { key: "buildPropTypeDefaults", value: function(e8) {
var t5 = {};
return Object.keys(e8).sort().map(function(n2) {
e8[n2].hasOwnProperty("default") && (t5[n2] = e8[n2].default);
}), t5;
} }]), e7;
}();
ec.PropFunc = qr, ec.props = { children: { type: Rr.node, default: void 0, description: "Standard children nodes of a react component" }, className: { type: Rr.string, default: void 0, description: "Classname for custom styling" }, id: { type: Rr.oneOfType([Rr.string, Rr.number]), default: void 0, description: "Custom ID selector for targeting or handling dom element" }, portalTarget: { type: Rr.object, description: "HTMLElement where suggestions menu should be attached using react portal", default: document.querySelector("#modal-root") }, onMethod: { type: Rr.func, default: void 0 }, style: { type: Rr.object, default: void 0, description: "Style object" } };
var tc = function(e7, t5, n2) {
var r2 = -1, c2 = e7.length;
t5 < 0 && (t5 = -t5 > c2 ? 0 : c2 + t5), (n2 = n2 > c2 ? c2 : n2) < 0 && (n2 += c2), c2 = t5 > n2 ? 0 : n2 - t5 >>> 0, t5 >>>= 0;
for (var i2 = Array(c2); ++r2 < c2; )
i2[r2] = e7[r2 + t5];
return i2;
}, nc = tc;
var rc = function(e7, t5, n2) {
var r2 = e7.length;
return n2 = void 0 === n2 ? r2 : n2, !t5 && n2 >= r2 ? e7 : nc(e7, t5, n2);
}, cc = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
var ic = function(e7) {
return cc.test(e7);
};
var ac = function(e7) {
return e7.split("");
}, oc = "[\\ud800-\\udfff]", uc = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", gc = "\\ud83c[\\udffb-\\udfff]", sc = "[^\\ud800-\\udfff]", lc = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ic = "[\\ud800-\\udbff][\\udc00-\\udfff]", bc = "(?:" + uc + "|" + gc + ")?", Cc = "[\\ufe0e\\ufe0f]?" + bc + ("(?:\\u200d(?:" + [sc, lc, Ic].join("|") + ")[\\ufe0e\\ufe0f]?" + bc + ")*"), pc = "(?:" + [sc + uc + "?", uc, lc, Ic, oc].join("|") + ")", dc = RegExp(gc + "(?=" + gc + ")|" + pc + Cc, "g");
var Ac = ac, fc = ic, mc = function(e7) {
return e7.match(dc) || [];
};
var yc = rc, hc = ic, vc = function(e7) {
return fc(e7) ? mc(e7) : Ac(e7);
}, Gc = Zt;
var Bc = function(e7) {
return function(t5) {
t5 = Gc(t5);
var n2 = hc(t5) ? vc(t5) : void 0, r2 = n2 ? n2[0] : t5.charAt(0), c2 = n2 ? yc(n2, 1).join("") : t5.slice(1);
return r2[e7]() + c2;
};
}("toUpperCase"), xc = S, Xc = R;
var wc = function(e7) {
return "number" == typeof e7 || Xc(e7) && "[object Number]" == xc(e7);
};
function Zc(e7) {
return wc(e7) ? { top: e7, right: e7, bottom: e7, left: e7 } : e7;
}
var jc = { name: "1tgnihn", styles: ".vg-tooltip.eset-theme{font-size:12px!important;line-height:15px!important;box-shadow:2px 2px 0 rgba(0, 0, 0, 0.15)!important;border:1px solid #222222!important;border-radius:4px!important;color:#ffffff!important;background-color:#222222!important;}" };
var Yc = function(t5) {
f$2(r2, React.Component);
var n2 = v$1(r2);
function r2(e7) {
var t6;
return C(this, r2), (t6 = n2.call(this, e7)).tooltipHandler = new Handler({ theme: "eset" }).call, t6;
}
return d$i(r2, [{ key: "componentDidMount", value: function() {
scheme("esetShadesRed", rgbBasis(["rgb(249,221,220)", "rgb(224,66,57)", "rgb(106,21,17)"])), this.setLocale(), this.createView();
} }, { key: "componentDidUpdate", value: function(e7) {
var t6 = this;
if (this.props.spec !== e7.spec)
this.clearView(), this.createView();
else if (this.view) {
var n3 = this.props, r3 = n3.spec, c2 = n3.data, i2 = false;
(null == r3 ? void 0 : r3.data) && c2 && r3.data.forEach(function(n4) {
var r4 = e7.data[n4.name], a2 = c2[n4.name];
(function(e8, t7) {
return e8 === t7 && !ee(e8);
})(r4, a2) || (t6.updateData(n4.name, a2), i2 = true);
}), ["width", "height"].filter(function(n4) {
return t6.props[n4] !== e7[n4];
}).forEach(function(e8) {
t6.view[e8](t6.props[e8]), i2 = true;
}), function(e8, t7) {
return R(e8) && R(t7) ? e8.top === t7.top && e8.left === t7.left && e8.right === t7.right && e8.bottom === t7.bottom : (wc(e8) && wc(t7), e8 === t7);
}(this.props.padding, e7.padding) || (this.view.padding(this.props.padding), i2 = true), this.props.enableTooltip !== e7.enableTooltip && (i2 = true), i2 && (this.props.enableTooltip && this.view.tooltip(this.tooltipHandler), this.view.run());
}
this.props.locale !== e7.locale && this.setLocale();
} }, { key: "componentWillUnmount", value: function() {
this.clearView();
} }, { key: "setLocale", value: function() {
var e7 = this, t6 = this.props.locale;
if (t6)
try {
!function(e8, t7) {
switch (e8) {
case "ar_EG":
return __vitePreload(() => Promise.resolve().then(() => arEG9493241f), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "en_US":
case "hr_HR":
case "id_ID":
case "sk_SK":
return __vitePreload(() => Promise.resolve().then(() => enUS23d755af), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "ko_KR":
return __vitePreload(() => Promise.resolve().then(() => koKRBe318f61), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "zh_TW":
return __vitePreload(() => Promise.resolve().then(() => zhTW621da244), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "cs_CZ":
return __vitePreload(() => Promise.resolve().then(() => csCZ30efb375), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "de_DE":
return __vitePreload(() => Promise.resolve().then(() => deDEA0091fbc), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "en-gb":
return __vitePreload(() => Promise.resolve().then(() => enGBC19b7b16), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "es_CL":
return __vitePreload(() => Promise.resolve().then(() => esMXD306ac47), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "es_ES":
return __vitePreload(() => Promise.resolve().then(() => esESAd876f76), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "fr_CA":
return __vitePreload(() => Promise.resolve().then(() => frCAAa5f7683), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "fr_FR":
return __vitePreload(() => Promise.resolve().then(() => frFRDe084dfd), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "hu_HU":
return __vitePreload(() => Promise.resolve().then(() => huHU5b8b0299), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "it_IT":
return __vitePreload(() => Promise.resolve().then(() => itIT7aecce64), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "ja_JP":
return __vitePreload(() => Promise.resolve().then(() => jaJPF6e79415), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "pl_PL":
return __vitePreload(() => Promise.resolve().then(() => plPL6f3759a6), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "pt_BR":
return __vitePreload(() => Promise.resolve().then(() => ptBR2f3b21ed), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "ru_RU":
return __vitePreload(() => Promise.resolve().then(() => ruRU33f5a0a6), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "tr_TR":
return __vitePreload(() => Promise.resolve().then(() => trTR53a550f8), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "uk_UA":
return __vitePreload(() => Promise.resolve().then(() => ukUAC2f4115b), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
case "zh_CN":
return __vitePreload(() => Promise.resolve().then(() => zhCN70c2b37c), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
default:
__vitePreload(() => Promise.resolve().then(() => enUS23d755af), true ? void 0 : void 0).then(function(e9) {
return t7(e9);
});
}
}(t6, function(t7) {
var n3 = t7.default;
timeFormatDefaultLocale(n3), e7.clearView(), e7.createView();
});
} catch (e8) {
console.error(e8);
}
} }, { key: "createView", value: function() {
var e7 = this, t6 = this.props, n3 = t6.spec, r3 = t6.data, c2 = t6.enableHover, i2 = t6.enableTooltip, a2 = t6.onError;
if (n3)
try {
var o2 = parse$2(n3), u2 = new View$1(o2).initialize(this.container);
this.view = u2, ["width", "height", "padding"].forEach(function(t7) {
e7.props[t7] && u2[t7](e7.props[t7]);
}), n3.data && r3 && n3.data.filter(function(e8) {
return r3[e8.name];
}).forEach(function(t7) {
e7.updateData(t7.name, r3[t7.name]);
}), c2 && u2.hover(), i2 && u2.tooltip(this.tooltipHandler), u2.run(), n3.signals && n3.signals.forEach(function(t7) {
u2.addSignalListener(t7.name, function(n4, r4) {
var c3, i3 = e7.props[c3 = t7.name, "onSignal".concat(Bc(c3))];
ee(i3) && i3(r4);
});
});
} catch (e8) {
if (this.clearView(), !ee(a2))
throw e8;
a2(e8);
}
else
this.clearView();
} }, { key: "updateData", value: function(e7, t6) {
if (t6)
if (ee(t6))
t6(this.view.data(e7));
else {
var n3 = changeset().remove(function() {
return true;
}).insert(t6);
this.view.change(e7, n3);
}
} }, { key: "clearView", value: function() {
this.view && (this.view.finalize(), this.view = void 0);
} }, { key: "render", value: function() {
var t6 = this;
return React.createElement(React.Fragment, null, React.createElement(Sr, { styles: jc }), React.createElement("div", { id: this.props.id, ref: function(e7) {
t6.container = e7;
} }));
} }]), r2;
}();
Yc.COLOR_SCHEMES = ["esetShadesRed", "category10", "tableau10", "accent", "dark2", "paired", "set1", "set2", "set3"], Yc.ExtendedProps = { data: { type: Rr.object, default: void 0, description: "" }, spec: { type: Rr.object.isRequired, default: {}, description: "" }, colorScheme: { type: Rr.oneOfType([Rr.oneOfItems(Yc.COLOR_SCHEMES), Rr.arrayOf(Rr.string)]), default: "tableau10", description: "" }, id: ec.props.id, enableHover: { type: Rr.bool, default: true, description: "Enable processing of hover events defined in spec. This prop should be set only once (during first render), if you need to change it, change also prop spec" }, enableTooltip: { type: Rr.bool, default: true, description: "" }, locale: { type: Rr.string, default: void 0, description: React.createElement(React.Fragment, null, React.createElement("a", { href: "https://github.com/d3/d3-time-format/tree/master/locale" }, "Locale"), " abbreviation") }, onError: { type: Rr.func.isRequired, description: React.createElement(ec.PropFunc, { text: "Callback function fired when there is an error in provided Vega spec", params: [{ name: "e", type: "object", description: "Exception thrown in Vega spec parser" }] }) }, padding: { type: Rr.shape({ top: Rr.number, right: Rr.number, bottom: Rr.number, left: Rr.number }), default: void 0, description: "" }, height: { type: Rr.number, default: void 0, description: "" }, width: { type: Rr.number, default: void 0, description: "" } }, Yc.defaultProps = ec.buildPropTypeDefaults(Yc.ExtendedProps);
var Nc = function() {
function e7(t5, n2, r2) {
C(this, e7), this.spec = { $schema: "https://vega.github.io/schema/vega/v5.json", width: t5, height: n2, padding: r2, autosize: "fit", signals: [], data: [], scales: [], axes: [], legends: [], marks: [] };
}
return d$i(e7, [{ key: "build", value: function() {
return this.spec;
} }, { key: "data", value: function(e8, t5, n2) {
return this.spec.data || (this.spec.data = []), this.spec.data.push({ name: e8, values: t5, transform: n2 }), this;
} }, { key: "scaleX", value: function(e8, t5) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "band", r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0.5;
return this.spec.scales || (this.spec.scales = []), this.spec.scales.push(b({ name: "scaleX", type: n2, range: "width", domain: { data: e8, field: t5 } }, r2 && { padding: r2 })), this;
} }, { key: "scaleY", value: function(e8, t5) {
var n2 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
return this.spec.scales || (this.spec.scales = []), this.spec.scales.push({ name: "scaleY", type: "linear", range: "height", domain: { data: e8, field: t5 }, nice: true, zero: n2 }), this;
} }, { key: "scaleColor", value: function(e8, t5, n2) {
return this.spec.scales || (this.spec.scales = []), this.spec.scales.push({ name: "scaleColor", type: "ordinal", range: Et(n2) ? { scheme: n2 } : n2, domain: { data: e8, field: t5 } }), this;
} }, { key: "axisX", value: function(e8) {
var t5 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0;
return this.spec.axes || (this.spec.axes = []), this.spec.axes.push(b(b({ scale: "scaleX", orient: "bottom", titlePadding: 10, grid: t5 }, e8 && { title: e8 }), n2 && { titleLimit: n2 })), this;
} }, { key: "axisY", value: function(e8) {
var t5 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0;
return this.spec.axes || (this.spec.axes = []), this.spec.axes.push(b(b({ scale: "scaleY", orient: "left", titlePadding: 10, grid: t5 }, e8 && { title: e8 }), n2 && { titleLimit: n2 })), this;
} }, { key: "legend", value: function(e8) {
return this.spec.legends || (this.spec.legends = []), this.spec.legends.push({ fill: "scaleColor", title: e8, encode: { title: { enter: { fontSize: { value: 12 } } }, labels: { enter: { fontSize: { value: 12 } } } } }), this;
} }, { key: "onRectClick", value: function() {
return this.spec.signals || (this.spec.signals = []), this.spec.signals.push({ name: "click", on: [{ events: "rect:click!", update: "{datum: datum, event: event}", force: true }] }), this;
} }]), e7;
}(), Wc = $e;
var zc = $e, Hc = Ke, Fc = Ct;
var Vc = $e, Jc = function() {
this.__data__ = new Wc(), this.size = 0;
}, Lc = function(e7) {
var t5 = this.__data__, n2 = t5.delete(e7);
return this.size = t5.size, n2;
}, Oc = function(e7) {
return this.__data__.get(e7);
}, Sc = function(e7) {
return this.__data__.has(e7);
}, Rc = function(e7, t5) {
var n2 = this.__data__;
if (n2 instanceof zc) {
var r2 = n2.__data__;
if (!Hc || r2.length < 199)
return r2.push([e7, t5]), this.size = ++n2.size, this;
n2 = this.__data__ = new Fc(r2);
}
return n2.set(e7, t5), this.size = n2.size, this;
};
function kc(e7) {
var t5 = this.__data__ = new Vc(e7);
this.size = t5.size;
}
kc.prototype.clear = Jc, kc.prototype.delete = Lc, kc.prototype.get = Oc, kc.prototype.has = Sc, kc.prototype.set = Rc;
var Mc = kc;
var Dc = function(e7, t5) {
for (var n2 = -1, r2 = null == e7 ? 0 : e7.length; ++n2 < r2 && false !== t5(e7[n2], n2, e7); )
;
return e7;
}, Ec = fe, Uc = function() {
try {
var e7 = Ec(Object, "defineProperty");
return e7({}, "", {}), e7;
} catch (e8) {
}
}(), Qc = Uc;
var Tc = function(e7, t5, n2) {
"__proto__" == t5 && Qc ? Qc(e7, t5, { configurable: true, enumerable: true, value: n2, writable: true }) : e7[t5] = n2;
}, Pc = Tc, _c = Je, $c = Object.prototype.hasOwnProperty;
var Kc = function(e7, t5, n2) {
var r2 = e7[t5];
$c.call(e7, t5) && _c(r2, n2) && (void 0 !== n2 || t5 in e7) || Pc(e7, t5, n2);
}, qc = Kc, ei = Tc;
var ti = function(e7, t5, n2, r2) {
var c2 = !n2;
n2 || (n2 = {});
for (var i2 = -1, a2 = t5.length; ++i2 < a2; ) {
var o2 = t5[i2], u2 = r2 ? r2(n2[o2], e7[o2], o2, n2, e7) : void 0;
void 0 === u2 && (u2 = e7[o2]), c2 ? ei(n2, o2, u2) : qc(n2, o2, u2);
}
return n2;
};
var ni = function(e7, t5) {
for (var n2 = -1, r2 = Array(e7); ++n2 < e7; )
r2[n2] = t5(n2);
return r2;
}, ri = S, ci = R;
var ii = function(e7) {
return ci(e7) && "[object Arguments]" == ri(e7);
}, ai = R, oi = Object.prototype, ui = oi.hasOwnProperty, gi = oi.propertyIsEnumerable, si = ii(function() {
return arguments;
}()) ? ii : function(e7) {
return ai(e7) && ui.call(e7, "callee") && !gi.call(e7, "callee");
}, li = { exports: {} };
var Ii = function() {
return false;
};
!function(e7, t5) {
var n2 = Z$1, r2 = Ii, c2 = t5 && !t5.nodeType && t5, i2 = c2 && e7 && !e7.nodeType && e7, a2 = i2 && i2.exports === c2 ? n2.Buffer : void 0, o2 = (a2 ? a2.isBuffer : void 0) || r2;
e7.exports = o2;
}(li, li.exports);
var bi = /^(?:0|[1-9]\d*)$/;
var Ci = function(e7, t5) {
var n2 = typeof e7;
return !!(t5 = null == t5 ? 9007199254740991 : t5) && ("number" == n2 || "symbol" != n2 && bi.test(e7)) && e7 > -1 && e7 % 1 == 0 && e7 < t5;
};
var pi = function(e7) {
return "number" == typeof e7 && e7 > -1 && e7 % 1 == 0 && e7 <= 9007199254740991;
}, di = S, Ai = pi, fi = R, mi = {};
mi["[object Float32Array]"] = mi["[object Float64Array]"] = mi["[object Int8Array]"] = mi["[object Int16Array]"] = mi["[object Int32Array]"] = mi["[object Uint8Array]"] = mi["[object Uint8ClampedArray]"] = mi["[object Uint16Array]"] = mi["[object Uint32Array]"] = true, mi["[object Arguments]"] = mi["[object Array]"] = mi["[object ArrayBuffer]"] = mi["[object Boolean]"] = mi["[object DataView]"] = mi["[object Date]"] = mi["[object Error]"] = mi["[object Function]"] = mi["[object Map]"] = mi["[object Number]"] = mi["[object Object]"] = mi["[object RegExp]"] = mi["[object Set]"] = mi["[object String]"] = mi["[object WeakMap]"] = false;
var yi = function(e7) {
return fi(e7) && Ai(e7.length) && !!mi[di(e7)];
};
var hi = function(e7) {
return function(t5) {
return e7(t5);
};
}, vi = { exports: {} };
!function(e7, t5) {
var n2 = x, r2 = t5 && !t5.nodeType && t5, c2 = r2 && e7 && !e7.nodeType && e7, i2 = c2 && c2.exports === r2 && n2.process, a2 = function() {
try {
var e8 = c2 && c2.require && c2.require("util").types;
return e8 || i2 && i2.binding && i2.binding("util");
} catch (e9) {
}
}();
e7.exports = a2;
}(vi, vi.exports);
var Gi = yi, Bi = hi, xi = vi.exports, Xi = xi && xi.isTypedArray, wi = Xi ? Bi(Xi) : Gi, Zi = ni, ji = si, Yi = B, Ni = li.exports, Wi = Ci, zi = wi, Hi = Object.prototype.hasOwnProperty;
var Fi = function(e7, t5) {
var n2 = Yi(e7), r2 = !n2 && ji(e7), c2 = !n2 && !r2 && Ni(e7), i2 = !n2 && !r2 && !c2 && zi(e7), a2 = n2 || r2 || c2 || i2, o2 = a2 ? Zi(e7.length, String) : [], u2 = o2.length;
for (var g2 in e7)
!t5 && !Hi.call(e7, g2) || a2 && ("length" == g2 || c2 && ("offset" == g2 || "parent" == g2) || i2 && ("buffer" == g2 || "byteLength" == g2 || "byteOffset" == g2) || Wi(g2, u2)) || o2.push(g2);
return o2;
}, Vi = Object.prototype;
var Ji = function(e7) {
var t5 = e7 && e7.constructor;
return e7 === ("function" == typeof t5 && t5.prototype || Vi);
};
var Li = function(e7, t5) {
return function(n2) {
return e7(t5(n2));
};
}, Oi = Li(Object.keys, Object), Si = Ji, Ri = Oi, ki = Object.prototype.hasOwnProperty;
var Mi = ee, Di = pi;
var Ei = function(e7) {
return null != e7 && Di(e7.length) && !Mi(e7);
}, Ui = Fi, Qi = function(e7) {
if (!Si(e7))
return Ri(e7);
var t5 = [];
for (var n2 in Object(e7))
ki.call(e7, n2) && "constructor" != n2 && t5.push(n2);
return t5;
}, Ti = Ei;
var Pi = function(e7) {
return Ti(e7) ? Ui(e7) : Qi(e7);
}, _i = ti, $i = Pi;
var Ki = function(e7, t5) {
return e7 && _i(t5, $i(t5), e7);
};
var qi = _$1, ea = Ji, ta = function(e7) {
var t5 = [];
if (null != e7)
for (var n2 in Object(e7))
t5.push(n2);
return t5;
}, na = Object.prototype.hasOwnProperty;
var ra = Fi, ca = function(e7) {
if (!qi(e7))
return ta(e7);
var t5 = ea(e7), n2 = [];
for (var r2 in e7)
("constructor" != r2 || !t5 && na.call(e7, r2)) && n2.push(r2);
return n2;
}, ia = Ei;
var aa = function(e7) {
return ia(e7) ? ra(e7, true) : ca(e7);
}, oa = ti, ua = aa;
var ga = function(e7, t5) {
return e7 && oa(t5, ua(t5), e7);
}, sa = { exports: {} };
!function(e7, t5) {
var n2 = Z$1, r2 = t5 && !t5.nodeType && t5, c2 = r2 && e7 && !e7.nodeType && e7, i2 = c2 && c2.exports === r2 ? n2.Buffer : void 0, a2 = i2 ? i2.allocUnsafe : void 0;
e7.exports = function(e8, t6) {
if (t6)
return e8.slice();
var n3 = e8.length, r3 = a2 ? a2(n3) : new e8.constructor(n3);
return e8.copy(r3), r3;
};
}(sa, sa.exports);
var la = function(e7, t5) {
var n2 = -1, r2 = e7.length;
for (t5 || (t5 = Array(r2)); ++n2 < r2; )
t5[n2] = e7[n2];
return t5;
};
var Ia = function() {
return [];
}, ba = function(e7, t5) {
for (var n2 = -1, r2 = null == e7 ? 0 : e7.length, c2 = 0, i2 = []; ++n2 < r2; ) {
var a2 = e7[n2];
t5(a2, n2, e7) && (i2[c2++] = a2);
}
return i2;
}, Ca = Ia, pa = Object.prototype.propertyIsEnumerable, da = Object.getOwnPropertySymbols, Aa = da ? function(e7) {
return null == e7 ? [] : (e7 = Object(e7), ba(da(e7), function(t5) {
return pa.call(e7, t5);
}));
} : Ca, fa = ti, ma = Aa;
var ya = function(e7, t5) {
return fa(e7, ma(e7), t5);
};
var ha = function(e7, t5) {
for (var n2 = -1, r2 = t5.length, c2 = e7.length; ++n2 < r2; )
e7[c2 + n2] = t5[n2];
return e7;
}, va = Li(Object.getPrototypeOf, Object), Ga = ha, Ba = va, xa = Aa, Xa = Ia, wa = Object.getOwnPropertySymbols ? function(e7) {
for (var t5 = []; e7; )
Ga(t5, xa(e7)), e7 = Ba(e7);
return t5;
} : Xa, Za = ti, ja = wa;
var Ya = function(e7, t5) {
return Za(e7, ja(e7), t5);
}, Na = ha, Wa = B;
var za = function(e7, t5, n2) {
var r2 = t5(e7);
return Wa(e7) ? r2 : Na(r2, n2(e7));
}, Ha = za, Fa = Aa, Va = Pi;
var Ja = function(e7) {
return Ha(e7, Va, Fa);
}, La = za, Oa = wa, Sa = aa;
var Ra = function(e7) {
return La(e7, Sa, Oa);
}, ka = fe(Z$1, "DataView"), Ma = Ke, Da = fe(Z$1, "Promise"), Ea = fe(Z$1, "Set"), Ua = fe(Z$1, "WeakMap"), Qa = S, Ta = ie, Pa = Ta(ka), _a = Ta(Ma), $a = Ta(Da), Ka = Ta(Ea), qa = Ta(Ua), eo = Qa;
(ka && "[object DataView]" != eo(new ka(new ArrayBuffer(1))) || Ma && "[object Map]" != eo(new Ma()) || Da && "[object Promise]" != eo(Da.resolve()) || Ea && "[object Set]" != eo(new Ea()) || Ua && "[object WeakMap]" != eo(new Ua())) && (eo = function(e7) {
var t5 = Qa(e7), n2 = "[object Object]" == t5 ? e7.constructor : void 0, r2 = n2 ? Ta(n2) : "";
if (r2)
switch (r2) {
case Pa:
return "[object DataView]";
case _a:
return "[object Map]";
case $a:
return "[object Promise]";
case Ka:
return "[object Set]";
case qa:
return "[object WeakMap]";
}
return t5;
});
var to = eo, no = Object.prototype.hasOwnProperty;
var ro = function(e7) {
var t5 = e7.length, n2 = new e7.constructor(t5);
return t5 && "string" == typeof e7[0] && no.call(e7, "index") && (n2.index = e7.index, n2.input = e7.input), n2;
}, co = Z$1.Uint8Array;
var io = function(e7) {
var t5 = new e7.constructor(e7.byteLength);
return new co(t5).set(new co(e7)), t5;
}, ao = io;
var oo = function(e7, t5) {
var n2 = t5 ? ao(e7.buffer) : e7.buffer;
return new e7.constructor(n2, e7.byteOffset, e7.byteLength);
}, uo = /\w*$/;
var go = function(e7) {
var t5 = new e7.constructor(e7.source, uo.exec(e7));
return t5.lastIndex = e7.lastIndex, t5;
}, so = j ? j.prototype : void 0, lo = so ? so.valueOf : void 0;
var Io = io;
var bo = io, Co = oo, po = go, Ao = function(e7) {
return lo ? Object(lo.call(e7)) : {};
}, fo = function(e7, t5) {
var n2 = t5 ? Io(e7.buffer) : e7.buffer;
return new e7.constructor(n2, e7.byteOffset, e7.length);
};
var mo = function(e7, t5, n2) {
var r2 = e7.constructor;
switch (t5) {
case "[object ArrayBuffer]":
return bo(e7);
case "[object Boolean]":
case "[object Date]":
return new r2(+e7);
case "[object DataView]":
return Co(e7, n2);
case "[object Float32Array]":
case "[object Float64Array]":
case "[object Int8Array]":
case "[object Int16Array]":
case "[object Int32Array]":
case "[object Uint8Array]":
case "[object Uint8ClampedArray]":
case "[object Uint16Array]":
case "[object Uint32Array]":
return fo(e7, n2);
case "[object Map]":
return new r2();
case "[object Number]":
case "[object String]":
return new r2(e7);
case "[object RegExp]":
return po(e7);
case "[object Set]":
return new r2();
case "[object Symbol]":
return Ao(e7);
}
}, yo = _$1, ho = Object.create, vo = function() {
function e7() {
}
return function(t5) {
if (!yo(t5))
return {};
if (ho)
return ho(t5);
e7.prototype = t5;
var n2 = new e7();
return e7.prototype = void 0, n2;
};
}(), Go = va, Bo = Ji;
var xo = function(e7) {
return "function" != typeof e7.constructor || Bo(e7) ? {} : vo(Go(e7));
}, Xo = to, wo = R;
var Zo = function(e7) {
return wo(e7) && "[object Map]" == Xo(e7);
}, jo = hi, Yo = vi.exports, No = Yo && Yo.isMap, Wo = No ? jo(No) : Zo, zo = to, Ho = R;
var Fo = function(e7) {
return Ho(e7) && "[object Set]" == zo(e7);
}, Vo = hi, Jo = vi.exports, Lo = Jo && Jo.isSet, Oo = Lo ? Vo(Lo) : Fo, So = Mc, Ro = Dc, ko = Kc, Mo = Ki, Do = ga, Eo = sa.exports, Uo = la, Qo = ya, To = Ya, Po = Ja, _o = Ra, $o = to, Ko = ro, qo = mo, eu = xo, tu = B, nu = li.exports, ru = Wo, cu = _$1, iu = Oo, au = Pi, ou = aa, uu = {};
uu["[object Arguments]"] = uu["[object Array]"] = uu["[object ArrayBuffer]"] = uu["[object DataView]"] = uu["[object Boolean]"] = uu["[object Date]"] = uu["[object Float32Array]"] = uu["[object Float64Array]"] = uu["[object Int8Array]"] = uu["[object Int16Array]"] = uu["[object Int32Array]"] = uu["[object Map]"] = uu["[object Number]"] = uu["[object Object]"] = uu["[object RegExp]"] = uu["[object Set]"] = uu["[object String]"] = uu["[object Symbol]"] = uu["[object Uint8Array]"] = uu["[object Uint8ClampedArray]"] = uu["[object Uint16Array]"] = uu["[object Uint32Array]"] = true, uu["[object Error]"] = uu["[object Function]"] = uu["[object WeakMap]"] = false;
var gu = function e3(t5, n2, r2, c2, i2, a2) {
var o2, u2 = 1 & n2, g2 = 2 & n2, s2 = 4 & n2;
if (r2 && (o2 = i2 ? r2(t5, c2, i2, a2) : r2(t5)), void 0 !== o2)
return o2;
if (!cu(t5))
return t5;
var l2 = tu(t5);
if (l2) {
if (o2 = Ko(t5), !u2)
return Uo(t5, o2);
} else {
var I2 = $o(t5), b2 = "[object Function]" == I2 || "[object GeneratorFunction]" == I2;
if (nu(t5))
return Eo(t5, u2);
if ("[object Object]" == I2 || "[object Arguments]" == I2 || b2 && !i2) {
if (o2 = g2 || b2 ? {} : eu(t5), !u2)
return g2 ? To(t5, Do(o2, t5)) : Qo(t5, Mo(o2, t5));
} else {
if (!uu[I2])
return i2 ? t5 : {};
o2 = qo(t5, I2, u2);
}
}
a2 || (a2 = new So());
var C3 = a2.get(t5);
if (C3)
return C3;
a2.set(t5, o2), iu(t5) ? t5.forEach(function(c3) {
o2.add(e3(c3, n2, r2, c3, t5, a2));
}) : ru(t5) && t5.forEach(function(c3, i3) {
o2.set(i3, e3(c3, n2, r2, i3, t5, a2));
});
var p2 = l2 ? void 0 : (s2 ? g2 ? _o : Po : g2 ? ou : au)(t5);
return Ro(p2 || t5, function(c3, i3) {
p2 && (c3 = t5[i3 = c3]), ko(o2, i3, e3(c3, n2, r2, i3, t5, a2));
}), o2;
};
var su = Lt, lu = tc;
var Iu = zt, bu = function(e7) {
var t5 = null == e7 ? 0 : e7.length;
return t5 ? e7[t5 - 1] : void 0;
}, Cu = function(e7, t5) {
return t5.length < 2 ? e7 : su(e7, lu(t5, 0, -1));
}, pu = Ft;
var du = function(e7, t5) {
return t5 = Iu(t5, e7), null == (e7 = Cu(e7, t5)) || delete e7[pu(bu(t5))];
}, Au = S, fu = va, mu = R, yu = Function.prototype, hu = Object.prototype, vu = yu.toString, Gu = hu.hasOwnProperty, Bu = vu.call(Object);
var xu = function(e7) {
if (!mu(e7) || "[object Object]" != Au(e7))
return false;
var t5 = fu(e7);
if (null === t5)
return true;
var n2 = Gu.call(t5, "constructor") && t5.constructor;
return "function" == typeof n2 && n2 instanceof n2 && vu.call(n2) == Bu;
};
var Xu = function(e7) {
return xu(e7) ? void 0 : e7;
}, wu = si, Zu = B, ju = j ? j.isConcatSpreadable : void 0;
var Yu = ha, Nu = function(e7) {
return Zu(e7) || wu(e7) || !!(ju && e7 && e7[ju]);
};
var Wu = function e4(t5, n2, r2, c2, i2) {
var a2 = -1, o2 = t5.length;
for (r2 || (r2 = Nu), i2 || (i2 = []); ++a2 < o2; ) {
var u2 = t5[a2];
n2 > 0 && r2(u2) ? n2 > 1 ? e4(u2, n2 - 1, r2, c2, i2) : Yu(i2, u2) : c2 || (i2[i2.length] = u2);
}
return i2;
};
var zu = function(e7) {
return (null == e7 ? 0 : e7.length) ? Wu(e7, 1) : [];
};
var Hu = function(e7, t5, n2) {
switch (n2.length) {
case 0:
return e7.call(t5);
case 1:
return e7.call(t5, n2[0]);
case 2:
return e7.call(t5, n2[0], n2[1]);
case 3:
return e7.call(t5, n2[0], n2[1], n2[2]);
}
return e7.apply(t5, n2);
}, Fu = Math.max;
var Vu = function(e7, t5, n2) {
return t5 = Fu(void 0 === t5 ? e7.length - 1 : t5, 0), function() {
for (var r2 = arguments, c2 = -1, i2 = Fu(r2.length - t5, 0), a2 = Array(i2); ++c2 < i2; )
a2[c2] = r2[t5 + c2];
c2 = -1;
for (var o2 = Array(t5 + 1); ++c2 < t5; )
o2[c2] = r2[c2];
return o2[t5] = n2(a2), Hu(e7, this, o2);
};
};
var Ju = function(e7) {
return function() {
return e7;
};
}, Lu = Uc, Ou = Lu ? function(e7, t5) {
return Lu(e7, "toString", { configurable: true, enumerable: false, value: Ju(t5), writable: true });
} : function(e7) {
return e7;
}, Su = Date.now;
var Ru = function(e7) {
var t5 = 0, n2 = 0;
return function() {
var r2 = Su(), c2 = 16 - (r2 - n2);
if (n2 = r2, c2 > 0) {
if (++t5 >= 800)
return arguments[0];
} else
t5 = 0;
return e7.apply(void 0, arguments);
};
}(Ou), ku = zu, Mu = Vu, Du = Ru;
var Eu = ht, Uu = gu, Qu = du, Tu = zt, Pu = ti, _u = Xu, $u = Ra, Ku = function(e7) {
return Du(Mu(e7, void 0, ku), e7 + "");
}(function(e7, t5) {
var n2 = {};
if (null == e7)
return n2;
var r2 = false;
t5 = Eu(t5, function(t6) {
return t6 = Tu(t6, e7), r2 || (r2 = t6.length > 1), t6;
}), Pu(e7, $u(e7), n2), r2 && (n2 = Uu(n2, 7, _u));
for (var c2 = t5.length; c2--; )
Qu(n2, t5[c2]);
return n2;
}), qu = function(t5) {
f$2(r2, React.Component);
var n2 = v$1(r2);
function r2(e7) {
var t6;
return C(this, r2), (t6 = n2.call(this, e7)).state = { spec: t6.buildSpec() }, t6;
}
return d$i(r2, [{ key: "componentDidUpdate", value: function(e7) {
var t6 = this;
["titleX", "titleY", "titleLimitX", "titleLimitY", "legend", "colorScheme", "enableHover", "enableTooltip", "gridX", "gridY", "onClick"].filter(function(n3) {
return t6.props[n3] !== e7[n3];
}).length > 0 && this.setState({ spec: this.buildSpec() });
} }, { key: "render", value: function() {
var t6 = this.props, n3 = t6.id, r3 = t6.data, c2 = t6.onError, i2 = t6.width, a2 = t6.height, o2 = t6.padding, u2 = t6.enableTooltip, g2 = t6.enableHover, s2 = t6.onClick;
return React.createElement(Yc, { id: n3, spec: this.state.spec, data: A$1({}, "table", r3), onError: c2, width: i2, height: a2, padding: Zc(o2), enableHover: g2, enableTooltip: u2, onSignalClick: ee(s2) ? function(e7) {
return s2(e7.datum, e7.event);
} : void 0 });
} }, { key: "buildSpec", value: function() {
var e7, t6 = new Nc(this.props.width, this.props.height, this.props.padding).data("table", this.props.data).scaleX("table", "x").scaleY("table", "y").scaleColor("table", "x", this.props.colorScheme).axisX(this.props.titleX, this.props.gridX, this.props.titleLimitX).axisY(this.props.titleY, this.props.gridY, this.props.titleLimitY);
this.props.legend && t6.legend(this.props.legend), ee(this.props.onClick) && t6.onRectClick();
var n3 = t6.build();
return null === (e7 = n3.marks) || void 0 === e7 || e7.push(r2.buildMarks(this.props.enableTooltip)), n3;
} }], [{ key: "buildMarks", value: function(e7) {
return { type: "rect", from: { data: "table" }, encode: { enter: b({ x: { scale: "scaleX", field: "x" }, width: { scale: "scaleX", band: 1 }, y: { scale: "scaleY", field: "y" }, y2: { scale: "scaleY", value: 0 }, fill: { scale: "scaleColor", field: "x" } }, e7 && { tooltip: { signal: "datum.x + ' (' + format(datum.y, 0.2) + ')'" } }), update: { fillOpacity: { value: 1 } }, hover: { fillOpacity: { value: 0.7 } } } };
} }]), r2;
}();
qu.ExtendedProps = Ku(b(b({}, Yc.ExtendedProps), {}, { data: { type: Rr.arrayOf(Rr.shape({ x: Rr.oneOfType([Rr.number, Rr.string]).isRequired, y: Rr.oneOfType([Rr.number, Rr.string]).isRequired })).isRequired, description: "Array of data" }, gridX: { type: Rr.bool, default: false, description: "Toggles grid on X axis" }, gridY: { type: Rr.bool, default: true, description: "Toggles grid on Y axis" }, height: { type: Yc.ExtendedProps.height.type.isRequired, description: Yc.ExtendedProps.height.description }, legend: { type: Rr.string, default: void 0, description: "Title for a legend. Leave this undefined if you don't want any legend" }, onClick: { type: Rr.func, default: void 0, description: React.createElement(ec.PropFunc, { text: "Callback function fired when chart elements are clicked", params: [{ name: "datum", type: "object", description: "Data from clicked chart element" }, { name: "event", type: "object", description: "Event from trigger" }] }) }, padding: { type: Rr.oneOfType([Rr.number, Yc.ExtendedProps.padding.type]), default: 8, description: "Padding of the chart's canvas" }, titleLimitX: { type: Rr.number, default: void 0, description: "The maximum allowed length in pixels of the X axis title" }, titleLimitY: { type: Rr.number, default: void 0, description: "The maximum allowed length in pixels of the Y axis title" }, titleX: { type: Rr.string, default: void 0, description: "Title for X axis. Leave undefined if you don't want any title" }, titleY: { type: Rr.string, default: void 0, description: "Title for Y axis. Leave undefined if you don't want any title" }, width: { type: Yc.ExtendedProps.width.type.isRequired, description: Yc.ExtendedProps.width.description } }), ["spec"]), qu.defaultProps = ec.buildPropTypeDefaults(qu.ExtendedProps);
var eg = function(t5) {
f$2(r2, React.Component);
var n2 = v$1(r2);
function r2(e7) {
var t6;
return C(this, r2), (t6 = n2.call(this, e7)).state = { spec: t6.buildSpec() }, t6;
}
return d$i(r2, [{ key: "componentDidUpdate", value: function(e7) {
var t6 = this;
["titleX", "titleY", "titleLimitX", "titleLimitY", "shape", "legend", "colorScheme", "enableHover", "enableTooltip", "gridX", "gridY"].filter(function(n3) {
return t6.props[n3] !== e7[n3];
}).length > 0 && this.setState({ spec: this.buildSpec() });
} }, { key: "render", value: function() {
var t6 = this.props, n3 = t6.id, r3 = t6.data, c2 = t6.onError, i2 = t6.width, a2 = t6.height, o2 = t6.padding, u2 = t6.enableTooltip, g2 = t6.enableHover, s2 = t6.onClick;
return React.createElement(Yc, { id: n3, spec: this.state.spec, data: A$1({}, "table", r3), width: i2, height: a2, padding: Zc(o2), enableHover: g2, enableTooltip: u2, onError: c2, onSignalClick: ee(s2) ? function(e7) {
return s2(e7.datum, e7.event);
} : void 0 });
} }, { key: "buildSpec", value: function() {
var e7, t6 = new Nc(this.props.width, this.props.height, this.props.padding).data("table", this.props.data).scaleX("table", "x", "point").scaleY("table", "y", false).scaleColor("table", "c", this.props.colorScheme).axisX(this.props.titleX, this.props.gridX, this.props.titleLimitX).axisY(this.props.titleY, this.props.gridY, this.props.titleLimitY);
this.props.legend && t6.legend(this.props.legend);
var n3 = t6.build();
return null === (e7 = n3.marks) || void 0 === e7 || e7.push(r2.buildMarks("straight" === this.props.shape ? "linear" : "monotone", this.props.enableTooltip)), n3;
} }], [{ key: "buildMarks", value: function(e7, t6) {
var n3 = { type: "group", from: { facet: { name: "series", data: "table", groupby: "c" } }, marks: [{ type: "line", from: { data: "series" }, encode: { enter: { x: { scale: "scaleX", field: "x" }, y: { scale: "scaleY", field: "y" }, stroke: { scale: "scaleColor", field: "c" }, strokeWidth: { value: 2 } }, update: { interpolate: { value: e7 }, fillOpacity: { value: 1 } }, hover: { fillOpacity: { value: 0.7 } } } }] };
return t6 && n3.marks.push({ type: "symbol", from: { data: "series" }, encode: { enter: { xc: { scale: "scaleX", field: "x" }, yc: { scale: "scaleY", field: "y" }, size: { value: 50 }, stroke: { scale: "scaleColor", field: "c" }, strokeWidth: { value: 1 }, tooltip: { signal: "{'c': datum.c, 'x': datum.x, 'y': datum.y}" } }, update: { fill: { value: "white" } }, hover: { fill: { scale: "scaleColor", field: "c" } } } }), n3;
} }]), r2;
}();
eg.ExtendedProps = b(b({}, qu.ExtendedProps), {}, { data: { type: Rr.arrayOf(Rr.shape({ x: Rr.oneOfType([Rr.number, Rr.string]).isRequired, y: Rr.oneOfType([Rr.number, Rr.string]).isRequired, c: Rr.oneOfType([Rr.number, Rr.string]).isRequired })).isRequired, description: React.createElement("div", null, "Array of data. Values are grouped into lines by field ", React.createElement("strong", null, "c")) }, shape: { type: Rr.oneOf(["curved", "straight"]), default: "curved", description: "Shape of lines. Choose between straight lines with sharp edges or curved lines with smooth edges" } }), eg.defaultProps = ec.buildPropTypeDefaults(eg.ExtendedProps);
var tg = function(t5) {
f$2(r2, React.Component);
var n2 = v$1(r2);
function r2(e7) {
var t6;
return C(this, r2), (t6 = n2.call(this, e7)).state = { spec: t6.buildSpec() }, t6;
}
return d$i(r2, [{ key: "componentDidUpdate", value: function(e7) {
var t6 = this;
["titleX", "titleY", "titleLimitX", "titleLimitY", "legend", "colorScheme", "enableHover", "enableTooltip", "gridX", "gridY", "onClick"].filter(function(n3) {
return t6.props[n3] !== e7[n3];
}).length > 0 && this.setState({ spec: this.buildSpec() });
} }, { key: "render", value: function() {
var t6 = this.props, n3 = t6.id, r3 = t6.data, c2 = t6.onError, i2 = t6.width, a2 = t6.height, o2 = t6.padding, u2 = t6.enableTooltip, g2 = t6.enableHover, s2 = t6.onClick;
return React.createElement(Yc, { id: n3, spec: this.state.spec, data: A$1({}, "table", r3), onError: c2, width: i2, height: a2, padding: Zc(o2), enableHover: g2, enableTooltip: u2, onSignalClick: ee(s2) ? function(e7) {
return s2(e7.datum, e7.event);
} : void 0 });
} }, { key: "buildSpec", value: function() {
var e7, t6 = new Nc(this.props.width, this.props.height, this.props.padding).data("table", this.props.data, [{ type: "stack", groupby: ["x"], sort: { field: "c" }, field: "y" }]).scaleX("table", "x").scaleY("table", "y1").scaleColor("table", "c", this.props.colorScheme).axisX(this.props.titleX, this.props.gridX, this.props.titleLimitX).axisY(this.props.titleY, this.props.gridY, this.props.titleLimitY);
this.props.legend && t6.legend(this.props.legend), ee(this.props.onClick) && t6.onRectClick();
var n3 = t6.build();
return null === (e7 = n3.marks) || void 0 === e7 || e7.push(r2.buildMarks(this.props.enableTooltip)), n3;
} }], [{ key: "buildMarks", value: function(e7) {
return { type: "rect", from: { data: "table" }, encode: { enter: b({ x: { scale: "scaleX", field: "x" }, width: { scale: "scaleX", band: 1 }, y: { scale: "scaleY", field: "y0" }, y2: { scale: "scaleY", field: "y1" }, fill: { scale: "scaleColor", field: "c" } }, e7 && { tooltip: { signal: "datum.x + ' (' + format(datum.y, 0.2) + ')'" } }), update: { fillOpacity: { value: 1 } }, hover: { fillOpacity: { value: 0.7 } } } };
} }]), r2;
}();
tg.ExtendedProps = b(b({}, qu.ExtendedProps), {}, { data: { type: Rr.arrayOf(Rr.shape({ x: Rr.oneOfType([Rr.number, Rr.string]).isRequired, y: Rr.oneOfType([Rr.number, Rr.string]).isRequired, c: Rr.oneOfType([Rr.number, Rr.string]).isRequired })).isRequired, description: "Array of data" } }), tg.defaultProps = ec.buildPropTypeDefaults(tg.ExtendedProps);
function r$l(r2, e7, n2) {
var i2, t5, o2;
void 0 === e7 && (e7 = 50), void 0 === n2 && (n2 = {});
var a2 = null != (i2 = n2.isImmediate) && i2, u2 = null != (t5 = n2.callback) && t5, c2 = n2.maxWait, v2 = Date.now(), l2 = [];
function f2() {
if (void 0 !== c2) {
var r3 = Date.now() - v2;
if (r3 + e7 >= c2)
return c2 - r3;
}
return e7;
}
var d2 = function() {
var e8 = [].slice.call(arguments), n3 = this;
return new Promise(function(i3, t6) {
var c3 = a2 && void 0 === o2;
if (void 0 !== o2 && clearTimeout(o2), o2 = setTimeout(function() {
if (o2 = void 0, v2 = Date.now(), !a2) {
var i4 = r2.apply(n3, e8);
u2 && u2(i4), l2.forEach(function(r3) {
return (0, r3.resolve)(i4);
}), l2 = [];
}
}, f2()), c3) {
var d3 = r2.apply(n3, e8);
return u2 && u2(d3), i3(d3);
}
l2.push({ resolve: i3, reject: t6 });
});
};
return d2.cancel = function(r3) {
void 0 !== o2 && clearTimeout(o2), l2.forEach(function(e8) {
return (0, e8.reject)(r3);
}), l2 = [];
}, d2;
}
/*!
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var extendStatics = function(d2, b2) {
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
d3.__proto__ = b3;
} || function(d3, b3) {
for (var p2 in b3)
if (Object.prototype.hasOwnProperty.call(b3, p2))
d3[p2] = b3[p2];
};
return extendStatics(d2, b2);
};
function __extends(d2, b2) {
if (typeof b2 !== "function" && b2 !== null)
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
extendStatics(d2, b2);
function __() {
this.constructor = d2;
}
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign2(t5) {
for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
s2 = arguments[i2];
for (var p2 in s2)
if (Object.prototype.hasOwnProperty.call(s2, p2))
t5[p2] = s2[p2];
}
return t5;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P2, generator) {
function adopt(value2) {
return value2 instanceof P2 ? value2 : new P2(function(resolve3) {
resolve3(value2);
});
}
return new (P2 || (P2 = Promise))(function(resolve3, reject2) {
function fulfilled(value2) {
try {
step(generator.next(value2));
} catch (e7) {
reject2(e7);
}
}
function rejected(value2) {
try {
step(generator["throw"](value2));
} catch (e7) {
reject2(e7);
}
}
function step(result) {
result.done ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _24 = { label: 0, sent: function() {
if (t5[0] & 1)
throw t5[1];
return t5[1];
}, trys: [], ops: [] }, f2, y2, t5, g2;
return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
return this;
}), g2;
function verb(n2) {
return function(v2) {
return step([n2, v2]);
};
}
function step(op) {
if (f2)
throw new TypeError("Generator is already executing.");
while (_24)
try {
if (f2 = 1, y2 && (t5 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t5 = y2["return"]) && t5.call(y2), 0) : y2.next) && !(t5 = t5.call(y2, op[1])).done)
return t5;
if (y2 = 0, t5)
op = [op[0] & 2, t5.value];
switch (op[0]) {
case 0:
case 1:
t5 = op;
break;
case 4:
_24.label++;
return { value: op[1], done: false };
case 5:
_24.label++;
y2 = op[1];
op = [0];
continue;
case 7:
op = _24.ops.pop();
_24.trys.pop();
continue;
default:
if (!(t5 = _24.trys, t5 = t5.length > 0 && t5[t5.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_24 = 0;
continue;
}
if (op[0] === 3 && (!t5 || op[1] > t5[0] && op[1] < t5[3])) {
_24.label = op[1];
break;
}
if (op[0] === 6 && _24.label < t5[1]) {
_24.label = t5[1];
t5 = op;
break;
}
if (t5 && _24.label < t5[2]) {
_24.label = t5[2];
_24.ops.push(op);
break;
}
if (t5[2])
_24.ops.pop();
_24.trys.pop();
continue;
}
op = body.call(thisArg, _24);
} catch (e7) {
op = [6, e7];
y2 = 0;
} finally {
f2 = t5 = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __spreadArray(to2, from2, pack2) {
if (pack2 || arguments.length === 2)
for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) {
if (ar2 || !(i2 in from2)) {
if (!ar2)
ar2 = Array.prototype.slice.call(from2, 0, i2);
ar2[i2] = from2[i2];
}
}
return to2.concat(ar2 || from2);
}
var Bounds = (
/** @class */
function() {
function Bounds2(left2, top2, width2, height2) {
this.left = left2;
this.top = top2;
this.width = width2;
this.height = height2;
}
Bounds2.prototype.add = function(x2, y2, w2, h2) {
return new Bounds2(this.left + x2, this.top + y2, this.width + w2, this.height + h2);
};
Bounds2.fromClientRect = function(context2, clientRect) {
return new Bounds2(clientRect.left + context2.windowBounds.left, clientRect.top + context2.windowBounds.top, clientRect.width, clientRect.height);
};
Bounds2.fromDOMRectList = function(context2, domRectList) {
var domRect = Array.from(domRectList).find(function(rect2) {
return rect2.width !== 0;
});
return domRect ? new Bounds2(domRect.left + context2.windowBounds.left, domRect.top + context2.windowBounds.top, domRect.width, domRect.height) : Bounds2.EMPTY;
};
Bounds2.EMPTY = new Bounds2(0, 0, 0, 0);
return Bounds2;
}()
);
var parseBounds = function(context2, node2) {
return Bounds.fromClientRect(context2, node2.getBoundingClientRect());
};
var parseDocumentSize = function(document2) {
var body = document2.body;
var documentElement = document2.documentElement;
if (!body || !documentElement) {
throw new Error("Unable to get document size");
}
var width2 = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
var height2 = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
return new Bounds(0, 0, width2, height2);
};
var toCodePoints$1 = function(str) {
var codePoints = [];
var i2 = 0;
var length2 = str.length;
while (i2 < length2) {
var value2 = str.charCodeAt(i2++);
if (value2 >= 55296 && value2 <= 56319 && i2 < length2) {
var extra = str.charCodeAt(i2++);
if ((extra & 64512) === 56320) {
codePoints.push(((value2 & 1023) << 10) + (extra & 1023) + 65536);
} else {
codePoints.push(value2);
i2--;
}
} else {
codePoints.push(value2);
}
}
return codePoints;
};
var fromCodePoint$1 = function() {
var codePoints = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
codePoints[_i2] = arguments[_i2];
}
if (String.fromCodePoint) {
return String.fromCodePoint.apply(String, codePoints);
}
var length2 = codePoints.length;
if (!length2) {
return "";
}
var codeUnits = [];
var index2 = -1;
var result = "";
while (++index2 < length2) {
var codePoint = codePoints[index2];
if (codePoint <= 65535) {
codeUnits.push(codePoint);
} else {
codePoint -= 65536;
codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
}
if (index2 + 1 === length2 || codeUnits.length > 16384) {
result += String.fromCharCode.apply(String, codeUnits);
codeUnits.length = 0;
}
}
return result;
};
var chars$2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var lookup$2 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for (var i$2$1 = 0; i$2$1 < chars$2.length; i$2$1++) {
lookup$2[chars$2.charCodeAt(i$2$1)] = i$2$1;
}
var chars$1$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var lookup$1$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for (var i$1$1 = 0; i$1$1 < chars$1$1.length; i$1$1++) {
lookup$1$1[chars$1$1.charCodeAt(i$1$1)] = i$1$1;
}
var decode$1 = function(base642) {
var bufferLength = base642.length * 0.75, len = base642.length, i2, p2 = 0, encoded1, encoded2, encoded3, encoded4;
if (base642[base642.length - 1] === "=") {
bufferLength--;
if (base642[base642.length - 2] === "=") {
bufferLength--;
}
}
var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
for (i2 = 0; i2 < len; i2 += 4) {
encoded1 = lookup$1$1[base642.charCodeAt(i2)];
encoded2 = lookup$1$1[base642.charCodeAt(i2 + 1)];
encoded3 = lookup$1$1[base642.charCodeAt(i2 + 2)];
encoded4 = lookup$1$1[base642.charCodeAt(i2 + 3)];
bytes[p2++] = encoded1 << 2 | encoded2 >> 4;
bytes[p2++] = (encoded2 & 15) << 4 | encoded3 >> 2;
bytes[p2++] = (encoded3 & 3) << 6 | encoded4 & 63;
}
return buffer;
};
var polyUint16Array$1 = function(buffer) {
var length2 = buffer.length;
var bytes = [];
for (var i2 = 0; i2 < length2; i2 += 2) {
bytes.push(buffer[i2 + 1] << 8 | buffer[i2]);
}
return bytes;
};
var polyUint32Array$1 = function(buffer) {
var length2 = buffer.length;
var bytes = [];
for (var i2 = 0; i2 < length2; i2 += 4) {
bytes.push(buffer[i2 + 3] << 24 | buffer[i2 + 2] << 16 | buffer[i2 + 1] << 8 | buffer[i2]);
}
return bytes;
};
var UTRIE2_SHIFT_2$1 = 5;
var UTRIE2_SHIFT_1$1 = 6 + 5;
var UTRIE2_INDEX_SHIFT$1 = 2;
var UTRIE2_SHIFT_1_2$1 = UTRIE2_SHIFT_1$1 - UTRIE2_SHIFT_2$1;
var UTRIE2_LSCP_INDEX_2_OFFSET$1 = 65536 >> UTRIE2_SHIFT_2$1;
var UTRIE2_DATA_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_2$1;
var UTRIE2_DATA_MASK$1 = UTRIE2_DATA_BLOCK_LENGTH$1 - 1;
var UTRIE2_LSCP_INDEX_2_LENGTH$1 = 1024 >> UTRIE2_SHIFT_2$1;
var UTRIE2_INDEX_2_BMP_LENGTH$1 = UTRIE2_LSCP_INDEX_2_OFFSET$1 + UTRIE2_LSCP_INDEX_2_LENGTH$1;
var UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 = UTRIE2_INDEX_2_BMP_LENGTH$1;
var UTRIE2_UTF8_2B_INDEX_2_LENGTH$1 = 2048 >> 6;
var UTRIE2_INDEX_1_OFFSET$1 = UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 + UTRIE2_UTF8_2B_INDEX_2_LENGTH$1;
var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 = 65536 >> UTRIE2_SHIFT_1$1;
var UTRIE2_INDEX_2_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_1_2$1;
var UTRIE2_INDEX_2_MASK$1 = UTRIE2_INDEX_2_BLOCK_LENGTH$1 - 1;
var slice16$1 = function(view, start2, end2) {
if (view.slice) {
return view.slice(start2, end2);
}
return new Uint16Array(Array.prototype.slice.call(view, start2, end2));
};
var slice32$1 = function(view, start2, end2) {
if (view.slice) {
return view.slice(start2, end2);
}
return new Uint32Array(Array.prototype.slice.call(view, start2, end2));
};
var createTrieFromBase64$1 = function(base642, _byteLength) {
var buffer = decode$1(base642);
var view32 = Array.isArray(buffer) ? polyUint32Array$1(buffer) : new Uint32Array(buffer);
var view16 = Array.isArray(buffer) ? polyUint16Array$1(buffer) : new Uint16Array(buffer);
var headerLength = 24;
var index2 = slice16$1(view16, headerLength / 2, view32[4] / 2);
var data2 = view32[5] === 2 ? slice16$1(view16, (headerLength + view32[4]) / 2) : slice32$1(view32, Math.ceil((headerLength + view32[4]) / 4));
return new Trie$1(view32[0], view32[1], view32[2], view32[3], index2, data2);
};
var Trie$1 = (
/** @class */
function() {
function Trie2(initialValue, errorValue, highStart, highValueIndex, index2, data2) {
this.initialValue = initialValue;
this.errorValue = errorValue;
this.highStart = highStart;
this.highValueIndex = highValueIndex;
this.index = index2;
this.data = data2;
}
Trie2.prototype.get = function(codePoint) {
var ix;
if (codePoint >= 0) {
if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
ix = this.index[codePoint >> UTRIE2_SHIFT_2$1];
ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
return this.data[ix];
}
if (codePoint <= 65535) {
ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET$1 + (codePoint - 55296 >> UTRIE2_SHIFT_2$1)];
ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
return this.data[ix];
}
if (codePoint < this.highStart) {
ix = UTRIE2_INDEX_1_OFFSET$1 - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 + (codePoint >> UTRIE2_SHIFT_1$1);
ix = this.index[ix];
ix += codePoint >> UTRIE2_SHIFT_2$1 & UTRIE2_INDEX_2_MASK$1;
ix = this.index[ix];
ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
return this.data[ix];
}
if (codePoint <= 1114111) {
return this.data[this.highValueIndex];
}
}
return this.errorValue;
};
return Trie2;
}()
);
var chars$3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var lookup$3 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for (var i$3$1 = 0; i$3$1 < chars$3.length; i$3$1++) {
lookup$3[chars$3.charCodeAt(i$3$1)] = i$3$1;
}
var base64$1 = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==";
var LETTER_NUMBER_MODIFIER = 50;
var BK = 1;
var CR$1 = 2;
var LF$1 = 3;
var CM = 4;
var NL = 5;
var WJ = 7;
var ZW = 8;
var GL = 9;
var SP = 10;
var ZWJ$1 = 11;
var B2 = 12;
var BA = 13;
var BB = 14;
var HY = 15;
var CB = 16;
var CL = 17;
var CP = 18;
var EX = 19;
var IN = 20;
var NS = 21;
var OP = 22;
var QU = 23;
var IS = 24;
var NU = 25;
var PO = 26;
var PR = 27;
var SY = 28;
var AI = 29;
var AL = 30;
var CJ = 31;
var EB = 32;
var EM = 33;
var H2 = 34;
var H3 = 35;
var HL = 36;
var ID = 37;
var JL = 38;
var JV = 39;
var JT = 40;
var RI$1 = 41;
var SA = 42;
var XX = 43;
var ea_OP = [9001, 65288];
var BREAK_MANDATORY = "!";
var BREAK_NOT_ALLOWED$1 = "×";
var BREAK_ALLOWED$1 = "÷";
var UnicodeTrie$1 = createTrieFromBase64$1(base64$1);
var ALPHABETICS = [AL, HL];
var HARD_LINE_BREAKS = [BK, CR$1, LF$1, NL];
var SPACE$1 = [SP, ZW];
var PREFIX_POSTFIX = [PR, PO];
var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1);
var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
var HYPHEN = [HY, BA];
var codePointsToCharacterClasses = function(codePoints, lineBreak2) {
if (lineBreak2 === void 0) {
lineBreak2 = "strict";
}
var types2 = [];
var indices = [];
var categories = [];
codePoints.forEach(function(codePoint, index2) {
var classType = UnicodeTrie$1.get(codePoint);
if (classType > LETTER_NUMBER_MODIFIER) {
categories.push(true);
classType -= LETTER_NUMBER_MODIFIER;
} else {
categories.push(false);
}
if (["normal", "auto", "loose"].indexOf(lineBreak2) !== -1) {
if ([8208, 8211, 12316, 12448].indexOf(codePoint) !== -1) {
indices.push(index2);
return types2.push(CB);
}
}
if (classType === CM || classType === ZWJ$1) {
if (index2 === 0) {
indices.push(index2);
return types2.push(AL);
}
var prev2 = types2[index2 - 1];
if (LINE_BREAKS.indexOf(prev2) === -1) {
indices.push(indices[index2 - 1]);
return types2.push(prev2);
}
indices.push(index2);
return types2.push(AL);
}
indices.push(index2);
if (classType === CJ) {
return types2.push(lineBreak2 === "strict" ? NS : ID);
}
if (classType === SA) {
return types2.push(AL);
}
if (classType === AI) {
return types2.push(AL);
}
if (classType === XX) {
if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) {
return types2.push(ID);
} else {
return types2.push(AL);
}
}
types2.push(classType);
});
return [indices, types2, categories];
};
var isAdjacentWithSpaceIgnored = function(a2, b2, currentIndex, classTypes) {
var current = classTypes[currentIndex];
if (Array.isArray(a2) ? a2.indexOf(current) !== -1 : a2 === current) {
var i2 = currentIndex;
while (i2 <= classTypes.length) {
i2++;
var next2 = classTypes[i2];
if (next2 === b2) {
return true;
}
if (next2 !== SP) {
break;
}
}
}
if (current === SP) {
var i2 = currentIndex;
while (i2 > 0) {
i2--;
var prev2 = classTypes[i2];
if (Array.isArray(a2) ? a2.indexOf(prev2) !== -1 : a2 === prev2) {
var n2 = currentIndex;
while (n2 <= classTypes.length) {
n2++;
var next2 = classTypes[n2];
if (next2 === b2) {
return true;
}
if (next2 !== SP) {
break;
}
}
}
if (prev2 !== SP) {
break;
}
}
}
return false;
};
var previousNonSpaceClassType = function(currentIndex, classTypes) {
var i2 = currentIndex;
while (i2 >= 0) {
var type2 = classTypes[i2];
if (type2 === SP) {
i2--;
} else {
return type2;
}
}
return 0;
};
var _lineBreakAtIndex = function(codePoints, classTypes, indicies, index2, forbiddenBreaks) {
if (indicies[index2] === 0) {
return BREAK_NOT_ALLOWED$1;
}
var currentIndex = index2 - 1;
if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
return BREAK_NOT_ALLOWED$1;
}
var beforeIndex = currentIndex - 1;
var afterIndex = currentIndex + 1;
var current = classTypes[currentIndex];
var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
var next2 = classTypes[afterIndex];
if (current === CR$1 && next2 === LF$1) {
return BREAK_NOT_ALLOWED$1;
}
if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
return BREAK_MANDATORY;
}
if (HARD_LINE_BREAKS.indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (SPACE$1.indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
return BREAK_ALLOWED$1;
}
if (UnicodeTrie$1.get(codePoints[currentIndex]) === ZWJ$1) {
return BREAK_NOT_ALLOWED$1;
}
if ((current === EB || current === EM) && UnicodeTrie$1.get(codePoints[afterIndex]) === ZWJ$1) {
return BREAK_NOT_ALLOWED$1;
}
if (current === WJ || next2 === WJ) {
return BREAK_NOT_ALLOWED$1;
}
if (current === GL) {
return BREAK_NOT_ALLOWED$1;
}
if ([SP, BA, HY].indexOf(current) === -1 && next2 === GL) {
return BREAK_NOT_ALLOWED$1;
}
if ([CL, CP, EX, IS, SY].indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
return BREAK_NOT_ALLOWED$1;
}
if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
return BREAK_NOT_ALLOWED$1;
}
if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
return BREAK_NOT_ALLOWED$1;
}
if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
return BREAK_NOT_ALLOWED$1;
}
if (current === SP) {
return BREAK_ALLOWED$1;
}
if (current === QU || next2 === QU) {
return BREAK_NOT_ALLOWED$1;
}
if (next2 === CB || current === CB) {
return BREAK_ALLOWED$1;
}
if ([BA, HY, NS].indexOf(next2) !== -1 || current === BB) {
return BREAK_NOT_ALLOWED$1;
}
if (before === HL && HYPHEN.indexOf(current) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (current === SY && next2 === HL) {
return BREAK_NOT_ALLOWED$1;
}
if (next2 === IN) {
return BREAK_NOT_ALLOWED$1;
}
if (ALPHABETICS.indexOf(next2) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next2 === NU) {
return BREAK_NOT_ALLOWED$1;
}
if (current === PR && [ID, EB, EM].indexOf(next2) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next2 === PO) {
return BREAK_NOT_ALLOWED$1;
}
if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next2) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (
// (PR | PO) × ( OP | HY )? NU
[PR, PO].indexOf(current) !== -1 && (next2 === NU || [OP, HY].indexOf(next2) !== -1 && classTypes[afterIndex + 1] === NU) || // ( OP | HY ) × NU
[OP, HY].indexOf(current) !== -1 && next2 === NU || // NU × (NU | SY | IS)
current === NU && [NU, SY, IS].indexOf(next2) !== -1
) {
return BREAK_NOT_ALLOWED$1;
}
if ([NU, SY, IS, CL, CP].indexOf(next2) !== -1) {
var prevIndex = currentIndex;
while (prevIndex >= 0) {
var type2 = classTypes[prevIndex];
if (type2 === NU) {
return BREAK_NOT_ALLOWED$1;
} else if ([SY, IS].indexOf(type2) !== -1) {
prevIndex--;
} else {
break;
}
}
}
if ([PR, PO].indexOf(next2) !== -1) {
var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
while (prevIndex >= 0) {
var type2 = classTypes[prevIndex];
if (type2 === NU) {
return BREAK_NOT_ALLOWED$1;
} else if ([SY, IS].indexOf(type2) !== -1) {
prevIndex--;
} else {
break;
}
}
}
if (JL === current && [JL, JV, H2, H3].indexOf(next2) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next2) !== -1 || [JT, H3].indexOf(current) !== -1 && next2 === JT) {
return BREAK_NOT_ALLOWED$1;
}
if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next2) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next2) !== -1 && current === PR) {
return BREAK_NOT_ALLOWED$1;
}
if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (current === IS && ALPHABETICS.indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED$1;
}
if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next2 === OP && ea_OP.indexOf(codePoints[afterIndex]) === -1 || ALPHABETICS.concat(NU).indexOf(next2) !== -1 && current === CP) {
return BREAK_NOT_ALLOWED$1;
}
if (current === RI$1 && next2 === RI$1) {
var i2 = indicies[currentIndex];
var count2 = 1;
while (i2 > 0) {
i2--;
if (classTypes[i2] === RI$1) {
count2++;
} else {
break;
}
}
if (count2 % 2 !== 0) {
return BREAK_NOT_ALLOWED$1;
}
}
if (current === EB && next2 === EM) {
return BREAK_NOT_ALLOWED$1;
}
return BREAK_ALLOWED$1;
};
var cssFormattedClasses = function(codePoints, options2) {
if (!options2) {
options2 = { lineBreak: "normal", wordBreak: "normal" };
}
var _a2 = codePointsToCharacterClasses(codePoints, options2.lineBreak), indicies = _a2[0], classTypes = _a2[1], isLetterNumber = _a2[2];
if (options2.wordBreak === "break-all" || options2.wordBreak === "break-word") {
classTypes = classTypes.map(function(type2) {
return [NU, AL, SA].indexOf(type2) !== -1 ? ID : type2;
});
}
var forbiddenBreakpoints = options2.wordBreak === "keep-all" ? isLetterNumber.map(function(letterNumber, i2) {
return letterNumber && codePoints[i2] >= 19968 && codePoints[i2] <= 40959;
}) : void 0;
return [indicies, classTypes, forbiddenBreakpoints];
};
var Break = (
/** @class */
function() {
function Break2(codePoints, lineBreak2, start2, end2) {
this.codePoints = codePoints;
this.required = lineBreak2 === BREAK_MANDATORY;
this.start = start2;
this.end = end2;
}
Break2.prototype.slice = function() {
return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end));
};
return Break2;
}()
);
var LineBreaker = function(str, options2) {
var codePoints = toCodePoints$1(str);
var _a2 = cssFormattedClasses(codePoints, options2), indicies = _a2[0], classTypes = _a2[1], forbiddenBreakpoints = _a2[2];
var length2 = codePoints.length;
var lastEnd = 0;
var nextIndex = 0;
return {
next: function() {
if (nextIndex >= length2) {
return { done: true, value: null };
}
var lineBreak2 = BREAK_NOT_ALLOWED$1;
while (nextIndex < length2 && (lineBreak2 = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED$1) {
}
if (lineBreak2 !== BREAK_NOT_ALLOWED$1 || nextIndex === length2) {
var value2 = new Break(codePoints, lineBreak2, lastEnd, nextIndex);
lastEnd = nextIndex;
return { value: value2, done: false };
}
return { done: true, value: null };
}
};
};
var FLAG_UNRESTRICTED = 1 << 0;
var FLAG_ID = 1 << 1;
var FLAG_INTEGER = 1 << 2;
var FLAG_NUMBER = 1 << 3;
var LINE_FEED = 10;
var SOLIDUS = 47;
var REVERSE_SOLIDUS = 92;
var CHARACTER_TABULATION = 9;
var SPACE = 32;
var QUOTATION_MARK = 34;
var EQUALS_SIGN = 61;
var NUMBER_SIGN = 35;
var DOLLAR_SIGN = 36;
var PERCENTAGE_SIGN = 37;
var APOSTROPHE = 39;
var LEFT_PARENTHESIS = 40;
var RIGHT_PARENTHESIS = 41;
var LOW_LINE = 95;
var HYPHEN_MINUS = 45;
var EXCLAMATION_MARK = 33;
var LESS_THAN_SIGN = 60;
var GREATER_THAN_SIGN = 62;
var COMMERCIAL_AT = 64;
var LEFT_SQUARE_BRACKET = 91;
var RIGHT_SQUARE_BRACKET = 93;
var CIRCUMFLEX_ACCENT = 61;
var LEFT_CURLY_BRACKET = 123;
var QUESTION_MARK = 63;
var RIGHT_CURLY_BRACKET = 125;
var VERTICAL_LINE = 124;
var TILDE = 126;
var CONTROL = 128;
var REPLACEMENT_CHARACTER = 65533;
var ASTERISK = 42;
var PLUS_SIGN = 43;
var COMMA = 44;
var COLON = 58;
var SEMICOLON = 59;
var FULL_STOP = 46;
var NULL = 0;
var BACKSPACE = 8;
var LINE_TABULATION = 11;
var SHIFT_OUT = 14;
var INFORMATION_SEPARATOR_ONE = 31;
var DELETE = 127;
var EOF = -1;
var ZERO = 48;
var a$l = 97;
var e$l = 101;
var f$1 = 102;
var u$6 = 117;
var z$1 = 122;
var A = 65;
var E = 69;
var F = 70;
var U = 85;
var Z = 90;
var isDigit = function(codePoint) {
return codePoint >= ZERO && codePoint <= 57;
};
var isSurrogateCodePoint = function(codePoint) {
return codePoint >= 55296 && codePoint <= 57343;
};
var isHex = function(codePoint) {
return isDigit(codePoint) || codePoint >= A && codePoint <= F || codePoint >= a$l && codePoint <= f$1;
};
var isLowerCaseLetter = function(codePoint) {
return codePoint >= a$l && codePoint <= z$1;
};
var isUpperCaseLetter = function(codePoint) {
return codePoint >= A && codePoint <= Z;
};
var isLetter = function(codePoint) {
return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);
};
var isNonASCIICodePoint = function(codePoint) {
return codePoint >= CONTROL;
};
var isWhiteSpace = function(codePoint) {
return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;
};
var isNameStartCodePoint = function(codePoint) {
return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;
};
var isNameCodePoint = function(codePoint) {
return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;
};
var isNonPrintableCodePoint = function(codePoint) {
return codePoint >= NULL && codePoint <= BACKSPACE || codePoint === LINE_TABULATION || codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE || codePoint === DELETE;
};
var isValidEscape = function(c1, c2) {
if (c1 !== REVERSE_SOLIDUS) {
return false;
}
return c2 !== LINE_FEED;
};
var isIdentifierStart = function(c1, c2, c3) {
if (c1 === HYPHEN_MINUS) {
return isNameStartCodePoint(c2) || isValidEscape(c2, c3);
} else if (isNameStartCodePoint(c1)) {
return true;
} else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {
return true;
}
return false;
};
var isNumberStart = function(c1, c2, c3) {
if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
if (isDigit(c2)) {
return true;
}
return c2 === FULL_STOP && isDigit(c3);
}
if (c1 === FULL_STOP) {
return isDigit(c2);
}
return isDigit(c1);
};
var stringToNumber = function(codePoints) {
var c2 = 0;
var sign2 = 1;
if (codePoints[c2] === PLUS_SIGN || codePoints[c2] === HYPHEN_MINUS) {
if (codePoints[c2] === HYPHEN_MINUS) {
sign2 = -1;
}
c2++;
}
var integers = [];
while (isDigit(codePoints[c2])) {
integers.push(codePoints[c2++]);
}
var int2 = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0;
if (codePoints[c2] === FULL_STOP) {
c2++;
}
var fraction = [];
while (isDigit(codePoints[c2])) {
fraction.push(codePoints[c2++]);
}
var fracd = fraction.length;
var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;
if (codePoints[c2] === E || codePoints[c2] === e$l) {
c2++;
}
var expsign = 1;
if (codePoints[c2] === PLUS_SIGN || codePoints[c2] === HYPHEN_MINUS) {
if (codePoints[c2] === HYPHEN_MINUS) {
expsign = -1;
}
c2++;
}
var exponent2 = [];
while (isDigit(codePoints[c2])) {
exponent2.push(codePoints[c2++]);
}
var exp2 = exponent2.length ? parseInt(fromCodePoint$1.apply(void 0, exponent2), 10) : 0;
return sign2 * (int2 + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp2);
};
var LEFT_PARENTHESIS_TOKEN = {
type: 2
/* LEFT_PARENTHESIS_TOKEN */
};
var RIGHT_PARENTHESIS_TOKEN = {
type: 3
/* RIGHT_PARENTHESIS_TOKEN */
};
var COMMA_TOKEN = {
type: 4
/* COMMA_TOKEN */
};
var SUFFIX_MATCH_TOKEN = {
type: 13
/* SUFFIX_MATCH_TOKEN */
};
var PREFIX_MATCH_TOKEN = {
type: 8
/* PREFIX_MATCH_TOKEN */
};
var COLUMN_TOKEN = {
type: 21
/* COLUMN_TOKEN */
};
var DASH_MATCH_TOKEN = {
type: 9
/* DASH_MATCH_TOKEN */
};
var INCLUDE_MATCH_TOKEN = {
type: 10
/* INCLUDE_MATCH_TOKEN */
};
var LEFT_CURLY_BRACKET_TOKEN = {
type: 11
/* LEFT_CURLY_BRACKET_TOKEN */
};
var RIGHT_CURLY_BRACKET_TOKEN = {
type: 12
/* RIGHT_CURLY_BRACKET_TOKEN */
};
var SUBSTRING_MATCH_TOKEN = {
type: 14
/* SUBSTRING_MATCH_TOKEN */
};
var BAD_URL_TOKEN = {
type: 23
/* BAD_URL_TOKEN */
};
var BAD_STRING_TOKEN = {
type: 1
/* BAD_STRING_TOKEN */
};
var CDO_TOKEN = {
type: 25
/* CDO_TOKEN */
};
var CDC_TOKEN = {
type: 24
/* CDC_TOKEN */
};
var COLON_TOKEN = {
type: 26
/* COLON_TOKEN */
};
var SEMICOLON_TOKEN = {
type: 27
/* SEMICOLON_TOKEN */
};
var LEFT_SQUARE_BRACKET_TOKEN = {
type: 28
/* LEFT_SQUARE_BRACKET_TOKEN */
};
var RIGHT_SQUARE_BRACKET_TOKEN = {
type: 29
/* RIGHT_SQUARE_BRACKET_TOKEN */
};
var WHITESPACE_TOKEN = {
type: 31
/* WHITESPACE_TOKEN */
};
var EOF_TOKEN = {
type: 32
/* EOF_TOKEN */
};
var Tokenizer = (
/** @class */
function() {
function Tokenizer2() {
this._value = [];
}
Tokenizer2.prototype.write = function(chunk) {
this._value = this._value.concat(toCodePoints$1(chunk));
};
Tokenizer2.prototype.read = function() {
var tokens = [];
var token2 = this.consumeToken();
while (token2 !== EOF_TOKEN) {
tokens.push(token2);
token2 = this.consumeToken();
}
return tokens;
};
Tokenizer2.prototype.consumeToken = function() {
var codePoint = this.consumeCodePoint();
switch (codePoint) {
case QUOTATION_MARK:
return this.consumeStringToken(QUOTATION_MARK);
case NUMBER_SIGN:
var c1 = this.peekCodePoint(0);
var c2 = this.peekCodePoint(1);
var c3 = this.peekCodePoint(2);
if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {
var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;
var value2 = this.consumeName();
return { type: 5, value: value2, flags };
}
break;
case DOLLAR_SIGN:
if (this.peekCodePoint(0) === EQUALS_SIGN) {
this.consumeCodePoint();
return SUFFIX_MATCH_TOKEN;
}
break;
case APOSTROPHE:
return this.consumeStringToken(APOSTROPHE);
case LEFT_PARENTHESIS:
return LEFT_PARENTHESIS_TOKEN;
case RIGHT_PARENTHESIS:
return RIGHT_PARENTHESIS_TOKEN;
case ASTERISK:
if (this.peekCodePoint(0) === EQUALS_SIGN) {
this.consumeCodePoint();
return SUBSTRING_MATCH_TOKEN;
}
break;
case PLUS_SIGN:
if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
this.reconsumeCodePoint(codePoint);
return this.consumeNumericToken();
}
break;
case COMMA:
return COMMA_TOKEN;
case HYPHEN_MINUS:
var e1 = codePoint;
var e22 = this.peekCodePoint(0);
var e32 = this.peekCodePoint(1);
if (isNumberStart(e1, e22, e32)) {
this.reconsumeCodePoint(codePoint);
return this.consumeNumericToken();
}
if (isIdentifierStart(e1, e22, e32)) {
this.reconsumeCodePoint(codePoint);
return this.consumeIdentLikeToken();
}
if (e22 === HYPHEN_MINUS && e32 === GREATER_THAN_SIGN) {
this.consumeCodePoint();
this.consumeCodePoint();
return CDC_TOKEN;
}
break;
case FULL_STOP:
if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
this.reconsumeCodePoint(codePoint);
return this.consumeNumericToken();
}
break;
case SOLIDUS:
if (this.peekCodePoint(0) === ASTERISK) {
this.consumeCodePoint();
while (true) {
var c4 = this.consumeCodePoint();
if (c4 === ASTERISK) {
c4 = this.consumeCodePoint();
if (c4 === SOLIDUS) {
return this.consumeToken();
}
}
if (c4 === EOF) {
return this.consumeToken();
}
}
}
break;
case COLON:
return COLON_TOKEN;
case SEMICOLON:
return SEMICOLON_TOKEN;
case LESS_THAN_SIGN:
if (this.peekCodePoint(0) === EXCLAMATION_MARK && this.peekCodePoint(1) === HYPHEN_MINUS && this.peekCodePoint(2) === HYPHEN_MINUS) {
this.consumeCodePoint();
this.consumeCodePoint();
return CDO_TOKEN;
}
break;
case COMMERCIAL_AT:
var a1 = this.peekCodePoint(0);
var a2 = this.peekCodePoint(1);
var a3 = this.peekCodePoint(2);
if (isIdentifierStart(a1, a2, a3)) {
var value2 = this.consumeName();
return { type: 7, value: value2 };
}
break;
case LEFT_SQUARE_BRACKET:
return LEFT_SQUARE_BRACKET_TOKEN;
case REVERSE_SOLIDUS:
if (isValidEscape(codePoint, this.peekCodePoint(0))) {
this.reconsumeCodePoint(codePoint);
return this.consumeIdentLikeToken();
}
break;
case RIGHT_SQUARE_BRACKET:
return RIGHT_SQUARE_BRACKET_TOKEN;
case CIRCUMFLEX_ACCENT:
if (this.peekCodePoint(0) === EQUALS_SIGN) {
this.consumeCodePoint();
return PREFIX_MATCH_TOKEN;
}
break;
case LEFT_CURLY_BRACKET:
return LEFT_CURLY_BRACKET_TOKEN;
case RIGHT_CURLY_BRACKET:
return RIGHT_CURLY_BRACKET_TOKEN;
case u$6:
case U:
var u1 = this.peekCodePoint(0);
var u2 = this.peekCodePoint(1);
if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {
this.consumeCodePoint();
this.consumeUnicodeRangeToken();
}
this.reconsumeCodePoint(codePoint);
return this.consumeIdentLikeToken();
case VERTICAL_LINE:
if (this.peekCodePoint(0) === EQUALS_SIGN) {
this.consumeCodePoint();
return DASH_MATCH_TOKEN;
}
if (this.peekCodePoint(0) === VERTICAL_LINE) {
this.consumeCodePoint();
return COLUMN_TOKEN;
}
break;
case TILDE:
if (this.peekCodePoint(0) === EQUALS_SIGN) {
this.consumeCodePoint();
return INCLUDE_MATCH_TOKEN;
}
break;
case EOF:
return EOF_TOKEN;
}
if (isWhiteSpace(codePoint)) {
this.consumeWhiteSpace();
return WHITESPACE_TOKEN;
}
if (isDigit(codePoint)) {
this.reconsumeCodePoint(codePoint);
return this.consumeNumericToken();
}
if (isNameStartCodePoint(codePoint)) {
this.reconsumeCodePoint(codePoint);
return this.consumeIdentLikeToken();
}
return { type: 6, value: fromCodePoint$1(codePoint) };
};
Tokenizer2.prototype.consumeCodePoint = function() {
var value2 = this._value.shift();
return typeof value2 === "undefined" ? -1 : value2;
};
Tokenizer2.prototype.reconsumeCodePoint = function(codePoint) {
this._value.unshift(codePoint);
};
Tokenizer2.prototype.peekCodePoint = function(delta) {
if (delta >= this._value.length) {
return -1;
}
return this._value[delta];
};
Tokenizer2.prototype.consumeUnicodeRangeToken = function() {
var digits = [];
var codePoint = this.consumeCodePoint();
while (isHex(codePoint) && digits.length < 6) {
digits.push(codePoint);
codePoint = this.consumeCodePoint();
}
var questionMarks = false;
while (codePoint === QUESTION_MARK && digits.length < 6) {
digits.push(codePoint);
codePoint = this.consumeCodePoint();
questionMarks = true;
}
if (questionMarks) {
var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) {
return digit === QUESTION_MARK ? ZERO : digit;
})), 16);
var end2 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) {
return digit === QUESTION_MARK ? F : digit;
})), 16);
return { type: 30, start: start_1, end: end2 };
}
var start2 = parseInt(fromCodePoint$1.apply(void 0, digits), 16);
if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {
this.consumeCodePoint();
codePoint = this.consumeCodePoint();
var endDigits = [];
while (isHex(codePoint) && endDigits.length < 6) {
endDigits.push(codePoint);
codePoint = this.consumeCodePoint();
}
var end2 = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16);
return { type: 30, start: start2, end: end2 };
} else {
return { type: 30, start: start2, end: start2 };
}
};
Tokenizer2.prototype.consumeIdentLikeToken = function() {
var value2 = this.consumeName();
if (value2.toLowerCase() === "url" && this.peekCodePoint(0) === LEFT_PARENTHESIS) {
this.consumeCodePoint();
return this.consumeUrlToken();
} else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {
this.consumeCodePoint();
return { type: 19, value: value2 };
}
return { type: 20, value: value2 };
};
Tokenizer2.prototype.consumeUrlToken = function() {
var value2 = [];
this.consumeWhiteSpace();
if (this.peekCodePoint(0) === EOF) {
return { type: 22, value: "" };
}
var next2 = this.peekCodePoint(0);
if (next2 === APOSTROPHE || next2 === QUOTATION_MARK) {
var stringToken = this.consumeStringToken(this.consumeCodePoint());
if (stringToken.type === 0) {
this.consumeWhiteSpace();
if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
this.consumeCodePoint();
return { type: 22, value: stringToken.value };
}
}
this.consumeBadUrlRemnants();
return BAD_URL_TOKEN;
}
while (true) {
var codePoint = this.consumeCodePoint();
if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {
return { type: 22, value: fromCodePoint$1.apply(void 0, value2) };
} else if (isWhiteSpace(codePoint)) {
this.consumeWhiteSpace();
if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
this.consumeCodePoint();
return { type: 22, value: fromCodePoint$1.apply(void 0, value2) };
}
this.consumeBadUrlRemnants();
return BAD_URL_TOKEN;
} else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
this.consumeBadUrlRemnants();
return BAD_URL_TOKEN;
} else if (codePoint === REVERSE_SOLIDUS) {
if (isValidEscape(codePoint, this.peekCodePoint(0))) {
value2.push(this.consumeEscapedCodePoint());
} else {
this.consumeBadUrlRemnants();
return BAD_URL_TOKEN;
}
} else {
value2.push(codePoint);
}
}
};
Tokenizer2.prototype.consumeWhiteSpace = function() {
while (isWhiteSpace(this.peekCodePoint(0))) {
this.consumeCodePoint();
}
};
Tokenizer2.prototype.consumeBadUrlRemnants = function() {
while (true) {
var codePoint = this.consumeCodePoint();
if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {
return;
}
if (isValidEscape(codePoint, this.peekCodePoint(0))) {
this.consumeEscapedCodePoint();
}
}
};
Tokenizer2.prototype.consumeStringSlice = function(count2) {
var SLICE_STACK_SIZE = 5e4;
var value2 = "";
while (count2 > 0) {
var amount = Math.min(SLICE_STACK_SIZE, count2);
value2 += fromCodePoint$1.apply(void 0, this._value.splice(0, amount));
count2 -= amount;
}
this._value.shift();
return value2;
};
Tokenizer2.prototype.consumeStringToken = function(endingCodePoint) {
var value2 = "";
var i2 = 0;
do {
var codePoint = this._value[i2];
if (codePoint === EOF || codePoint === void 0 || codePoint === endingCodePoint) {
value2 += this.consumeStringSlice(i2);
return { type: 0, value: value2 };
}
if (codePoint === LINE_FEED) {
this._value.splice(0, i2);
return BAD_STRING_TOKEN;
}
if (codePoint === REVERSE_SOLIDUS) {
var next2 = this._value[i2 + 1];
if (next2 !== EOF && next2 !== void 0) {
if (next2 === LINE_FEED) {
value2 += this.consumeStringSlice(i2);
i2 = -1;
this._value.shift();
} else if (isValidEscape(codePoint, next2)) {
value2 += this.consumeStringSlice(i2);
value2 += fromCodePoint$1(this.consumeEscapedCodePoint());
i2 = -1;
}
}
}
i2++;
} while (true);
};
Tokenizer2.prototype.consumeNumber = function() {
var repr = [];
var type2 = FLAG_INTEGER;
var c1 = this.peekCodePoint(0);
if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
repr.push(this.consumeCodePoint());
}
while (isDigit(this.peekCodePoint(0))) {
repr.push(this.consumeCodePoint());
}
c1 = this.peekCodePoint(0);
var c2 = this.peekCodePoint(1);
if (c1 === FULL_STOP && isDigit(c2)) {
repr.push(this.consumeCodePoint(), this.consumeCodePoint());
type2 = FLAG_NUMBER;
while (isDigit(this.peekCodePoint(0))) {
repr.push(this.consumeCodePoint());
}
}
c1 = this.peekCodePoint(0);
c2 = this.peekCodePoint(1);
var c3 = this.peekCodePoint(2);
if ((c1 === E || c1 === e$l) && ((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3) || isDigit(c2))) {
repr.push(this.consumeCodePoint(), this.consumeCodePoint());
type2 = FLAG_NUMBER;
while (isDigit(this.peekCodePoint(0))) {
repr.push(this.consumeCodePoint());
}
}
return [stringToNumber(repr), type2];
};
Tokenizer2.prototype.consumeNumericToken = function() {
var _a2 = this.consumeNumber(), number2 = _a2[0], flags = _a2[1];
var c1 = this.peekCodePoint(0);
var c2 = this.peekCodePoint(1);
var c3 = this.peekCodePoint(2);
if (isIdentifierStart(c1, c2, c3)) {
var unit2 = this.consumeName();
return { type: 15, number: number2, flags, unit: unit2 };
}
if (c1 === PERCENTAGE_SIGN) {
this.consumeCodePoint();
return { type: 16, number: number2, flags };
}
return { type: 17, number: number2, flags };
};
Tokenizer2.prototype.consumeEscapedCodePoint = function() {
var codePoint = this.consumeCodePoint();
if (isHex(codePoint)) {
var hex2 = fromCodePoint$1(codePoint);
while (isHex(this.peekCodePoint(0)) && hex2.length < 6) {
hex2 += fromCodePoint$1(this.consumeCodePoint());
}
if (isWhiteSpace(this.peekCodePoint(0))) {
this.consumeCodePoint();
}
var hexCodePoint = parseInt(hex2, 16);
if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 1114111) {
return REPLACEMENT_CHARACTER;
}
return hexCodePoint;
}
if (codePoint === EOF) {
return REPLACEMENT_CHARACTER;
}
return codePoint;
};
Tokenizer2.prototype.consumeName = function() {
var result = "";
while (true) {
var codePoint = this.consumeCodePoint();
if (isNameCodePoint(codePoint)) {
result += fromCodePoint$1(codePoint);
} else if (isValidEscape(codePoint, this.peekCodePoint(0))) {
result += fromCodePoint$1(this.consumeEscapedCodePoint());
} else {
this.reconsumeCodePoint(codePoint);
return result;
}
}
};
return Tokenizer2;
}()
);
var Parser$1 = (
/** @class */
function() {
function Parser2(tokens) {
this._tokens = tokens;
}
Parser2.create = function(value2) {
var tokenizer = new Tokenizer();
tokenizer.write(value2);
return new Parser2(tokenizer.read());
};
Parser2.parseValue = function(value2) {
return Parser2.create(value2).parseComponentValue();
};
Parser2.parseValues = function(value2) {
return Parser2.create(value2).parseComponentValues();
};
Parser2.prototype.parseComponentValue = function() {
var token2 = this.consumeToken();
while (token2.type === 31) {
token2 = this.consumeToken();
}
if (token2.type === 32) {
throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
}
this.reconsumeToken(token2);
var value2 = this.consumeComponentValue();
do {
token2 = this.consumeToken();
} while (token2.type === 31);
if (token2.type === 32) {
return value2;
}
throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
};
Parser2.prototype.parseComponentValues = function() {
var values2 = [];
while (true) {
var value2 = this.consumeComponentValue();
if (value2.type === 32) {
return values2;
}
values2.push(value2);
values2.push();
}
};
Parser2.prototype.consumeComponentValue = function() {
var token2 = this.consumeToken();
switch (token2.type) {
case 11:
case 28:
case 2:
return this.consumeSimpleBlock(token2.type);
case 19:
return this.consumeFunction(token2);
}
return token2;
};
Parser2.prototype.consumeSimpleBlock = function(type2) {
var block = { type: type2, values: [] };
var token2 = this.consumeToken();
while (true) {
if (token2.type === 32 || isEndingTokenFor(token2, type2)) {
return block;
}
this.reconsumeToken(token2);
block.values.push(this.consumeComponentValue());
token2 = this.consumeToken();
}
};
Parser2.prototype.consumeFunction = function(functionToken) {
var cssFunction = {
name: functionToken.value,
values: [],
type: 18
/* FUNCTION */
};
while (true) {
var token2 = this.consumeToken();
if (token2.type === 32 || token2.type === 3) {
return cssFunction;
}
this.reconsumeToken(token2);
cssFunction.values.push(this.consumeComponentValue());
}
};
Parser2.prototype.consumeToken = function() {
var token2 = this._tokens.shift();
return typeof token2 === "undefined" ? EOF_TOKEN : token2;
};
Parser2.prototype.reconsumeToken = function(token2) {
this._tokens.unshift(token2);
};
return Parser2;
}()
);
var isDimensionToken = function(token2) {
return token2.type === 15;
};
var isNumberToken = function(token2) {
return token2.type === 17;
};
var isIdentToken = function(token2) {
return token2.type === 20;
};
var isStringToken = function(token2) {
return token2.type === 0;
};
var isIdentWithValue = function(token2, value2) {
return isIdentToken(token2) && token2.value === value2;
};
var nonWhiteSpace = function(token2) {
return token2.type !== 31;
};
var nonFunctionArgSeparator = function(token2) {
return token2.type !== 31 && token2.type !== 4;
};
var parseFunctionArgs = function(tokens) {
var args = [];
var arg = [];
tokens.forEach(function(token2) {
if (token2.type === 4) {
if (arg.length === 0) {
throw new Error("Error parsing function args, zero tokens for arg");
}
args.push(arg);
arg = [];
return;
}
if (token2.type !== 31) {
arg.push(token2);
}
});
if (arg.length) {
args.push(arg);
}
return args;
};
var isEndingTokenFor = function(token2, type2) {
if (type2 === 11 && token2.type === 12) {
return true;
}
if (type2 === 28 && token2.type === 29) {
return true;
}
return type2 === 2 && token2.type === 3;
};
var isLength = function(token2) {
return token2.type === 17 || token2.type === 15;
};
var isLengthPercentage = function(token2) {
return token2.type === 16 || isLength(token2);
};
var parseLengthPercentageTuple = function(tokens) {
return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];
};
var ZERO_LENGTH = {
type: 17,
number: 0,
flags: FLAG_INTEGER
};
var FIFTY_PERCENT = {
type: 16,
number: 50,
flags: FLAG_INTEGER
};
var HUNDRED_PERCENT = {
type: 16,
number: 100,
flags: FLAG_INTEGER
};
var getAbsoluteValueForTuple = function(tuple, width2, height2) {
var x2 = tuple[0], y2 = tuple[1];
return [getAbsoluteValue(x2, width2), getAbsoluteValue(typeof y2 !== "undefined" ? y2 : x2, height2)];
};
var getAbsoluteValue = function(token2, parent) {
if (token2.type === 16) {
return token2.number / 100 * parent;
}
if (isDimensionToken(token2)) {
switch (token2.unit) {
case "rem":
case "em":
return 16 * token2.number;
case "px":
default:
return token2.number;
}
}
return token2.number;
};
var DEG = "deg";
var GRAD = "grad";
var RAD = "rad";
var TURN = "turn";
var angle = {
name: "angle",
parse: function(_context, value2) {
if (value2.type === 15) {
switch (value2.unit) {
case DEG:
return Math.PI * value2.number / 180;
case GRAD:
return Math.PI / 200 * value2.number;
case RAD:
return value2.number;
case TURN:
return Math.PI * 2 * value2.number;
}
}
throw new Error("Unsupported angle type");
}
};
var isAngle = function(value2) {
if (value2.type === 15) {
if (value2.unit === DEG || value2.unit === GRAD || value2.unit === RAD || value2.unit === TURN) {
return true;
}
}
return false;
};
var parseNamedSide = function(tokens) {
var sideOrCorner = tokens.filter(isIdentToken).map(function(ident) {
return ident.value;
}).join(" ");
switch (sideOrCorner) {
case "to bottom right":
case "to right bottom":
case "left top":
case "top left":
return [ZERO_LENGTH, ZERO_LENGTH];
case "to top":
case "bottom":
return deg(0);
case "to bottom left":
case "to left bottom":
case "right top":
case "top right":
return [ZERO_LENGTH, HUNDRED_PERCENT];
case "to right":
case "left":
return deg(90);
case "to top left":
case "to left top":
case "right bottom":
case "bottom right":
return [HUNDRED_PERCENT, HUNDRED_PERCENT];
case "to bottom":
case "top":
return deg(180);
case "to top right":
case "to right top":
case "left bottom":
case "bottom left":
return [HUNDRED_PERCENT, ZERO_LENGTH];
case "to left":
case "right":
return deg(270);
}
return 0;
};
var deg = function(deg2) {
return Math.PI * deg2 / 180;
};
var color$1 = {
name: "color",
parse: function(context2, value2) {
if (value2.type === 18) {
var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value2.name];
if (typeof colorFunction === "undefined") {
throw new Error('Attempting to parse an unsupported color function "' + value2.name + '"');
}
return colorFunction(context2, value2.values);
}
if (value2.type === 5) {
if (value2.value.length === 3) {
var r2 = value2.value.substring(0, 1);
var g2 = value2.value.substring(1, 2);
var b2 = value2.value.substring(2, 3);
return pack(parseInt(r2 + r2, 16), parseInt(g2 + g2, 16), parseInt(b2 + b2, 16), 1);
}
if (value2.value.length === 4) {
var r2 = value2.value.substring(0, 1);
var g2 = value2.value.substring(1, 2);
var b2 = value2.value.substring(2, 3);
var a2 = value2.value.substring(3, 4);
return pack(parseInt(r2 + r2, 16), parseInt(g2 + g2, 16), parseInt(b2 + b2, 16), parseInt(a2 + a2, 16) / 255);
}
if (value2.value.length === 6) {
var r2 = value2.value.substring(0, 2);
var g2 = value2.value.substring(2, 4);
var b2 = value2.value.substring(4, 6);
return pack(parseInt(r2, 16), parseInt(g2, 16), parseInt(b2, 16), 1);
}
if (value2.value.length === 8) {
var r2 = value2.value.substring(0, 2);
var g2 = value2.value.substring(2, 4);
var b2 = value2.value.substring(4, 6);
var a2 = value2.value.substring(6, 8);
return pack(parseInt(r2, 16), parseInt(g2, 16), parseInt(b2, 16), parseInt(a2, 16) / 255);
}
}
if (value2.type === 20) {
var namedColor = COLORS[value2.value.toUpperCase()];
if (typeof namedColor !== "undefined") {
return namedColor;
}
}
return COLORS.TRANSPARENT;
}
};
var isTransparent = function(color2) {
return (255 & color2) === 0;
};
var asString = function(color2) {
var alpha = 255 & color2;
var blue = 255 & color2 >> 8;
var green = 255 & color2 >> 16;
var red = 255 & color2 >> 24;
return alpha < 255 ? "rgba(" + red + "," + green + "," + blue + "," + alpha / 255 + ")" : "rgb(" + red + "," + green + "," + blue + ")";
};
var pack = function(r2, g2, b2, a2) {
return (r2 << 24 | g2 << 16 | b2 << 8 | Math.round(a2 * 255) << 0) >>> 0;
};
var getTokenColorValue = function(token2, i2) {
if (token2.type === 17) {
return token2.number;
}
if (token2.type === 16) {
var max2 = i2 === 3 ? 1 : 255;
return i2 === 3 ? token2.number / 100 * max2 : Math.round(token2.number / 100 * max2);
}
return 0;
};
var rgb = function(_context, args) {
var tokens = args.filter(nonFunctionArgSeparator);
if (tokens.length === 3) {
var _a2 = tokens.map(getTokenColorValue), r2 = _a2[0], g2 = _a2[1], b2 = _a2[2];
return pack(r2, g2, b2, 1);
}
if (tokens.length === 4) {
var _b2 = tokens.map(getTokenColorValue), r2 = _b2[0], g2 = _b2[1], b2 = _b2[2], a2 = _b2[3];
return pack(r2, g2, b2, a2);
}
return 0;
};
function hue2rgb(t12, t22, hue2) {
if (hue2 < 0) {
hue2 += 1;
}
if (hue2 >= 1) {
hue2 -= 1;
}
if (hue2 < 1 / 6) {
return (t22 - t12) * hue2 * 6 + t12;
} else if (hue2 < 1 / 2) {
return t22;
} else if (hue2 < 2 / 3) {
return (t22 - t12) * 6 * (2 / 3 - hue2) + t12;
} else {
return t12;
}
}
var hsl = function(context2, args) {
var tokens = args.filter(nonFunctionArgSeparator);
var hue2 = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];
var h2 = (hue2.type === 17 ? deg(hue2.number) : angle.parse(context2, hue2)) / (Math.PI * 2);
var s2 = isLengthPercentage(saturation) ? saturation.number / 100 : 0;
var l2 = isLengthPercentage(lightness) ? lightness.number / 100 : 0;
var a2 = typeof alpha !== "undefined" && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;
if (s2 === 0) {
return pack(l2 * 255, l2 * 255, l2 * 255, 1);
}
var t22 = l2 <= 0.5 ? l2 * (s2 + 1) : l2 + s2 - l2 * s2;
var t12 = l2 * 2 - t22;
var r2 = hue2rgb(t12, t22, h2 + 1 / 3);
var g2 = hue2rgb(t12, t22, h2);
var b2 = hue2rgb(t12, t22, h2 - 1 / 3);
return pack(r2 * 255, g2 * 255, b2 * 255, a2);
};
var SUPPORTED_COLOR_FUNCTIONS = {
hsl,
hsla: hsl,
rgb,
rgba: rgb
};
var parseColor = function(context2, value2) {
return color$1.parse(context2, Parser$1.create(value2).parseComponentValue());
};
var COLORS = {
ALICEBLUE: 4042850303,
ANTIQUEWHITE: 4209760255,
AQUA: 16777215,
AQUAMARINE: 2147472639,
AZURE: 4043309055,
BEIGE: 4126530815,
BISQUE: 4293182719,
BLACK: 255,
BLANCHEDALMOND: 4293643775,
BLUE: 65535,
BLUEVIOLET: 2318131967,
BROWN: 2771004159,
BURLYWOOD: 3736635391,
CADETBLUE: 1604231423,
CHARTREUSE: 2147418367,
CHOCOLATE: 3530104575,
CORAL: 4286533887,
CORNFLOWERBLUE: 1687547391,
CORNSILK: 4294499583,
CRIMSON: 3692313855,
CYAN: 16777215,
DARKBLUE: 35839,
DARKCYAN: 9145343,
DARKGOLDENROD: 3095837695,
DARKGRAY: 2846468607,
DARKGREEN: 6553855,
DARKGREY: 2846468607,
DARKKHAKI: 3182914559,
DARKMAGENTA: 2332068863,
DARKOLIVEGREEN: 1433087999,
DARKORANGE: 4287365375,
DARKORCHID: 2570243327,
DARKRED: 2332033279,
DARKSALMON: 3918953215,
DARKSEAGREEN: 2411499519,
DARKSLATEBLUE: 1211993087,
DARKSLATEGRAY: 793726975,
DARKSLATEGREY: 793726975,
DARKTURQUOISE: 13554175,
DARKVIOLET: 2483082239,
DEEPPINK: 4279538687,
DEEPSKYBLUE: 12582911,
DIMGRAY: 1768516095,
DIMGREY: 1768516095,
DODGERBLUE: 512819199,
FIREBRICK: 2988581631,
FLORALWHITE: 4294635775,
FORESTGREEN: 579543807,
FUCHSIA: 4278255615,
GAINSBORO: 3705462015,
GHOSTWHITE: 4177068031,
GOLD: 4292280575,
GOLDENROD: 3668254975,
GRAY: 2155905279,
GREEN: 8388863,
GREENYELLOW: 2919182335,
GREY: 2155905279,
HONEYDEW: 4043305215,
HOTPINK: 4285117695,
INDIANRED: 3445382399,
INDIGO: 1258324735,
IVORY: 4294963455,
KHAKI: 4041641215,
LAVENDER: 3873897215,
LAVENDERBLUSH: 4293981695,
LAWNGREEN: 2096890111,
LEMONCHIFFON: 4294626815,
LIGHTBLUE: 2916673279,
LIGHTCORAL: 4034953471,
LIGHTCYAN: 3774873599,
LIGHTGOLDENRODYELLOW: 4210742015,
LIGHTGRAY: 3553874943,
LIGHTGREEN: 2431553791,
LIGHTGREY: 3553874943,
LIGHTPINK: 4290167295,
LIGHTSALMON: 4288707327,
LIGHTSEAGREEN: 548580095,
LIGHTSKYBLUE: 2278488831,
LIGHTSLATEGRAY: 2005441023,
LIGHTSLATEGREY: 2005441023,
LIGHTSTEELBLUE: 2965692159,
LIGHTYELLOW: 4294959359,
LIME: 16711935,
LIMEGREEN: 852308735,
LINEN: 4210091775,
MAGENTA: 4278255615,
MAROON: 2147483903,
MEDIUMAQUAMARINE: 1724754687,
MEDIUMBLUE: 52735,
MEDIUMORCHID: 3126187007,
MEDIUMPURPLE: 2473647103,
MEDIUMSEAGREEN: 1018393087,
MEDIUMSLATEBLUE: 2070474495,
MEDIUMSPRINGGREEN: 16423679,
MEDIUMTURQUOISE: 1221709055,
MEDIUMVIOLETRED: 3340076543,
MIDNIGHTBLUE: 421097727,
MINTCREAM: 4127193855,
MISTYROSE: 4293190143,
MOCCASIN: 4293178879,
NAVAJOWHITE: 4292783615,
NAVY: 33023,
OLDLACE: 4260751103,
OLIVE: 2155872511,
OLIVEDRAB: 1804477439,
ORANGE: 4289003775,
ORANGERED: 4282712319,
ORCHID: 3664828159,
PALEGOLDENROD: 4008225535,
PALEGREEN: 2566625535,
PALETURQUOISE: 2951671551,
PALEVIOLETRED: 3681588223,
PAPAYAWHIP: 4293907967,
PEACHPUFF: 4292524543,
PERU: 3448061951,
PINK: 4290825215,
PLUM: 3718307327,
POWDERBLUE: 2967529215,
PURPLE: 2147516671,
REBECCAPURPLE: 1714657791,
RED: 4278190335,
ROSYBROWN: 3163525119,
ROYALBLUE: 1097458175,
SADDLEBROWN: 2336560127,
SALMON: 4202722047,
SANDYBROWN: 4104413439,
SEAGREEN: 780883967,
SEASHELL: 4294307583,
SIENNA: 2689740287,
SILVER: 3233857791,
SKYBLUE: 2278484991,
SLATEBLUE: 1784335871,
SLATEGRAY: 1887473919,
SLATEGREY: 1887473919,
SNOW: 4294638335,
SPRINGGREEN: 16744447,
STEELBLUE: 1182971135,
TAN: 3535047935,
TEAL: 8421631,
THISTLE: 3636451583,
TOMATO: 4284696575,
TRANSPARENT: 0,
TURQUOISE: 1088475391,
VIOLET: 4001558271,
WHEAT: 4125012991,
WHITE: 4294967295,
WHITESMOKE: 4126537215,
YELLOW: 4294902015,
YELLOWGREEN: 2597139199
};
var backgroundClip = {
name: "background-clip",
initialValue: "border-box",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return tokens.map(function(token2) {
if (isIdentToken(token2)) {
switch (token2.value) {
case "padding-box":
return 1;
case "content-box":
return 2;
}
}
return 0;
});
}
};
var backgroundColor = {
name: "background-color",
initialValue: "transparent",
prefix: false,
type: 3,
format: "color"
};
var parseColorStop = function(context2, args) {
var color2 = color$1.parse(context2, args[0]);
var stop2 = args[1];
return stop2 && isLengthPercentage(stop2) ? { color: color2, stop: stop2 } : { color: color2, stop: null };
};
var processColorStops = function(stops, lineLength) {
var first = stops[0];
var last = stops[stops.length - 1];
if (first.stop === null) {
first.stop = ZERO_LENGTH;
}
if (last.stop === null) {
last.stop = HUNDRED_PERCENT;
}
var processStops = [];
var previous = 0;
for (var i2 = 0; i2 < stops.length; i2++) {
var stop_1 = stops[i2].stop;
if (stop_1 !== null) {
var absoluteValue = getAbsoluteValue(stop_1, lineLength);
if (absoluteValue > previous) {
processStops.push(absoluteValue);
} else {
processStops.push(previous);
}
previous = absoluteValue;
} else {
processStops.push(null);
}
}
var gapBegin = null;
for (var i2 = 0; i2 < processStops.length; i2++) {
var stop_2 = processStops[i2];
if (stop_2 === null) {
if (gapBegin === null) {
gapBegin = i2;
}
} else if (gapBegin !== null) {
var gapLength = i2 - gapBegin;
var beforeGap = processStops[gapBegin - 1];
var gapValue = (stop_2 - beforeGap) / (gapLength + 1);
for (var g2 = 1; g2 <= gapLength; g2++) {
processStops[gapBegin + g2 - 1] = gapValue * g2;
}
gapBegin = null;
}
}
return stops.map(function(_a2, i3) {
var color2 = _a2.color;
return { color: color2, stop: Math.max(Math.min(1, processStops[i3] / lineLength), 0) };
});
};
var getAngleFromCorner = function(corner, width2, height2) {
var centerX = width2 / 2;
var centerY = height2 / 2;
var x2 = getAbsoluteValue(corner[0], width2) - centerX;
var y2 = centerY - getAbsoluteValue(corner[1], height2);
return (Math.atan2(y2, x2) + Math.PI * 2) % (Math.PI * 2);
};
var calculateGradientDirection = function(angle2, width2, height2) {
var radian = typeof angle2 === "number" ? angle2 : getAngleFromCorner(angle2, width2, height2);
var lineLength = Math.abs(width2 * Math.sin(radian)) + Math.abs(height2 * Math.cos(radian));
var halfWidth = width2 / 2;
var halfHeight = height2 / 2;
var halfLineLength = lineLength / 2;
var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;
var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;
return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];
};
var distance = function(a2, b2) {
return Math.sqrt(a2 * a2 + b2 * b2);
};
var findCorner = function(width2, height2, x2, y2, closest2) {
var corners = [
[0, 0],
[0, height2],
[width2, 0],
[width2, height2]
];
return corners.reduce(function(stat, corner) {
var cx = corner[0], cy = corner[1];
var d2 = distance(x2 - cx, y2 - cy);
if (closest2 ? d2 < stat.optimumDistance : d2 > stat.optimumDistance) {
return {
optimumCorner: corner,
optimumDistance: d2
};
}
return stat;
}, {
optimumDistance: closest2 ? Infinity : -Infinity,
optimumCorner: null
}).optimumCorner;
};
var calculateRadius = function(gradient2, x2, y2, width2, height2) {
var rx = 0;
var ry = 0;
switch (gradient2.size) {
case 0:
if (gradient2.shape === 0) {
rx = ry = Math.min(Math.abs(x2), Math.abs(x2 - width2), Math.abs(y2), Math.abs(y2 - height2));
} else if (gradient2.shape === 1) {
rx = Math.min(Math.abs(x2), Math.abs(x2 - width2));
ry = Math.min(Math.abs(y2), Math.abs(y2 - height2));
}
break;
case 2:
if (gradient2.shape === 0) {
rx = ry = Math.min(distance(x2, y2), distance(x2, y2 - height2), distance(x2 - width2, y2), distance(x2 - width2, y2 - height2));
} else if (gradient2.shape === 1) {
var c2 = Math.min(Math.abs(y2), Math.abs(y2 - height2)) / Math.min(Math.abs(x2), Math.abs(x2 - width2));
var _a2 = findCorner(width2, height2, x2, y2, true), cx = _a2[0], cy = _a2[1];
rx = distance(cx - x2, (cy - y2) / c2);
ry = c2 * rx;
}
break;
case 1:
if (gradient2.shape === 0) {
rx = ry = Math.max(Math.abs(x2), Math.abs(x2 - width2), Math.abs(y2), Math.abs(y2 - height2));
} else if (gradient2.shape === 1) {
rx = Math.max(Math.abs(x2), Math.abs(x2 - width2));
ry = Math.max(Math.abs(y2), Math.abs(y2 - height2));
}
break;
case 3:
if (gradient2.shape === 0) {
rx = ry = Math.max(distance(x2, y2), distance(x2, y2 - height2), distance(x2 - width2, y2), distance(x2 - width2, y2 - height2));
} else if (gradient2.shape === 1) {
var c2 = Math.max(Math.abs(y2), Math.abs(y2 - height2)) / Math.max(Math.abs(x2), Math.abs(x2 - width2));
var _b2 = findCorner(width2, height2, x2, y2, false), cx = _b2[0], cy = _b2[1];
rx = distance(cx - x2, (cy - y2) / c2);
ry = c2 * rx;
}
break;
}
if (Array.isArray(gradient2.size)) {
rx = getAbsoluteValue(gradient2.size[0], width2);
ry = gradient2.size.length === 2 ? getAbsoluteValue(gradient2.size[1], height2) : rx;
}
return [rx, ry];
};
var linearGradient = function(context2, tokens) {
var angle$12 = deg(180);
var stops = [];
parseFunctionArgs(tokens).forEach(function(arg, i2) {
if (i2 === 0) {
var firstToken = arg[0];
if (firstToken.type === 20 && firstToken.value === "to") {
angle$12 = parseNamedSide(arg);
return;
} else if (isAngle(firstToken)) {
angle$12 = angle.parse(context2, firstToken);
return;
}
}
var colorStop = parseColorStop(context2, arg);
stops.push(colorStop);
});
return {
angle: angle$12,
stops,
type: 1
/* LINEAR_GRADIENT */
};
};
var prefixLinearGradient = function(context2, tokens) {
var angle$12 = deg(180);
var stops = [];
parseFunctionArgs(tokens).forEach(function(arg, i2) {
if (i2 === 0) {
var firstToken = arg[0];
if (firstToken.type === 20 && ["top", "left", "right", "bottom"].indexOf(firstToken.value) !== -1) {
angle$12 = parseNamedSide(arg);
return;
} else if (isAngle(firstToken)) {
angle$12 = (angle.parse(context2, firstToken) + deg(270)) % deg(360);
return;
}
}
var colorStop = parseColorStop(context2, arg);
stops.push(colorStop);
});
return {
angle: angle$12,
stops,
type: 1
/* LINEAR_GRADIENT */
};
};
var webkitGradient = function(context2, tokens) {
var angle2 = deg(180);
var stops = [];
var type2 = 1;
var shape2 = 0;
var size = 3;
var position2 = [];
parseFunctionArgs(tokens).forEach(function(arg, i2) {
var firstToken = arg[0];
if (i2 === 0) {
if (isIdentToken(firstToken) && firstToken.value === "linear") {
type2 = 1;
return;
} else if (isIdentToken(firstToken) && firstToken.value === "radial") {
type2 = 2;
return;
}
}
if (firstToken.type === 18) {
if (firstToken.name === "from") {
var color2 = color$1.parse(context2, firstToken.values[0]);
stops.push({ stop: ZERO_LENGTH, color: color2 });
} else if (firstToken.name === "to") {
var color2 = color$1.parse(context2, firstToken.values[0]);
stops.push({ stop: HUNDRED_PERCENT, color: color2 });
} else if (firstToken.name === "color-stop") {
var values2 = firstToken.values.filter(nonFunctionArgSeparator);
if (values2.length === 2) {
var color2 = color$1.parse(context2, values2[1]);
var stop_1 = values2[0];
if (isNumberToken(stop_1)) {
stops.push({
stop: { type: 16, number: stop_1.number * 100, flags: stop_1.flags },
color: color2
});
}
}
}
}
});
return type2 === 1 ? {
angle: (angle2 + deg(180)) % deg(360),
stops,
type: type2
} : { size, shape: shape2, stops, position: position2, type: type2 };
};
var CLOSEST_SIDE = "closest-side";
var FARTHEST_SIDE = "farthest-side";
var CLOSEST_CORNER = "closest-corner";
var FARTHEST_CORNER = "farthest-corner";
var CIRCLE = "circle";
var ELLIPSE = "ellipse";
var COVER = "cover";
var CONTAIN = "contain";
var radialGradient = function(context2, tokens) {
var shape2 = 0;
var size = 3;
var stops = [];
var position2 = [];
parseFunctionArgs(tokens).forEach(function(arg, i2) {
var isColorStop = true;
if (i2 === 0) {
var isAtPosition_1 = false;
isColorStop = arg.reduce(function(acc, token2) {
if (isAtPosition_1) {
if (isIdentToken(token2)) {
switch (token2.value) {
case "center":
position2.push(FIFTY_PERCENT);
return acc;
case "top":
case "left":
position2.push(ZERO_LENGTH);
return acc;
case "right":
case "bottom":
position2.push(HUNDRED_PERCENT);
return acc;
}
} else if (isLengthPercentage(token2) || isLength(token2)) {
position2.push(token2);
}
} else if (isIdentToken(token2)) {
switch (token2.value) {
case CIRCLE:
shape2 = 0;
return false;
case ELLIPSE:
shape2 = 1;
return false;
case "at":
isAtPosition_1 = true;
return false;
case CLOSEST_SIDE:
size = 0;
return false;
case COVER:
case FARTHEST_SIDE:
size = 1;
return false;
case CONTAIN:
case CLOSEST_CORNER:
size = 2;
return false;
case FARTHEST_CORNER:
size = 3;
return false;
}
} else if (isLength(token2) || isLengthPercentage(token2)) {
if (!Array.isArray(size)) {
size = [];
}
size.push(token2);
return false;
}
return acc;
}, isColorStop);
}
if (isColorStop) {
var colorStop = parseColorStop(context2, arg);
stops.push(colorStop);
}
});
return {
size,
shape: shape2,
stops,
position: position2,
type: 2
/* RADIAL_GRADIENT */
};
};
var prefixRadialGradient = function(context2, tokens) {
var shape2 = 0;
var size = 3;
var stops = [];
var position2 = [];
parseFunctionArgs(tokens).forEach(function(arg, i2) {
var isColorStop = true;
if (i2 === 0) {
isColorStop = arg.reduce(function(acc, token2) {
if (isIdentToken(token2)) {
switch (token2.value) {
case "center":
position2.push(FIFTY_PERCENT);
return false;
case "top":
case "left":
position2.push(ZERO_LENGTH);
return false;
case "right":
case "bottom":
position2.push(HUNDRED_PERCENT);
return false;
}
} else if (isLengthPercentage(token2) || isLength(token2)) {
position2.push(token2);
return false;
}
return acc;
}, isColorStop);
} else if (i2 === 1) {
isColorStop = arg.reduce(function(acc, token2) {
if (isIdentToken(token2)) {
switch (token2.value) {
case CIRCLE:
shape2 = 0;
return false;
case ELLIPSE:
shape2 = 1;
return false;
case CONTAIN:
case CLOSEST_SIDE:
size = 0;
return false;
case FARTHEST_SIDE:
size = 1;
return false;
case CLOSEST_CORNER:
size = 2;
return false;
case COVER:
case FARTHEST_CORNER:
size = 3;
return false;
}
} else if (isLength(token2) || isLengthPercentage(token2)) {
if (!Array.isArray(size)) {
size = [];
}
size.push(token2);
return false;
}
return acc;
}, isColorStop);
}
if (isColorStop) {
var colorStop = parseColorStop(context2, arg);
stops.push(colorStop);
}
});
return {
size,
shape: shape2,
stops,
position: position2,
type: 2
/* RADIAL_GRADIENT */
};
};
var isLinearGradient = function(background2) {
return background2.type === 1;
};
var isRadialGradient = function(background2) {
return background2.type === 2;
};
var image = {
name: "image",
parse: function(context2, value2) {
if (value2.type === 22) {
var image_1 = {
url: value2.value,
type: 0
/* URL */
};
context2.cache.addImage(value2.value);
return image_1;
}
if (value2.type === 18) {
var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value2.name];
if (typeof imageFunction === "undefined") {
throw new Error('Attempting to parse an unsupported image function "' + value2.name + '"');
}
return imageFunction(context2, value2.values);
}
throw new Error("Unsupported image type " + value2.type);
}
};
function isSupportedImage(value2) {
return !(value2.type === 20 && value2.value === "none") && (value2.type !== 18 || !!SUPPORTED_IMAGE_FUNCTIONS[value2.name]);
}
var SUPPORTED_IMAGE_FUNCTIONS = {
"linear-gradient": linearGradient,
"-moz-linear-gradient": prefixLinearGradient,
"-ms-linear-gradient": prefixLinearGradient,
"-o-linear-gradient": prefixLinearGradient,
"-webkit-linear-gradient": prefixLinearGradient,
"radial-gradient": radialGradient,
"-moz-radial-gradient": prefixRadialGradient,
"-ms-radial-gradient": prefixRadialGradient,
"-o-radial-gradient": prefixRadialGradient,
"-webkit-radial-gradient": prefixRadialGradient,
"-webkit-gradient": webkitGradient
};
var backgroundImage = {
name: "background-image",
initialValue: "none",
type: 1,
prefix: false,
parse: function(context2, tokens) {
if (tokens.length === 0) {
return [];
}
var first = tokens[0];
if (first.type === 20 && first.value === "none") {
return [];
}
return tokens.filter(function(value2) {
return nonFunctionArgSeparator(value2) && isSupportedImage(value2);
}).map(function(value2) {
return image.parse(context2, value2);
});
}
};
var backgroundOrigin = {
name: "background-origin",
initialValue: "border-box",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return tokens.map(function(token2) {
if (isIdentToken(token2)) {
switch (token2.value) {
case "padding-box":
return 1;
case "content-box":
return 2;
}
}
return 0;
});
}
};
var backgroundPosition = {
name: "background-position",
initialValue: "0% 0%",
type: 1,
prefix: false,
parse: function(_context, tokens) {
return parseFunctionArgs(tokens).map(function(values2) {
return values2.filter(isLengthPercentage);
}).map(parseLengthPercentageTuple);
}
};
var backgroundRepeat = {
name: "background-repeat",
initialValue: "repeat",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return parseFunctionArgs(tokens).map(function(values2) {
return values2.filter(isIdentToken).map(function(token2) {
return token2.value;
}).join(" ");
}).map(parseBackgroundRepeat);
}
};
var parseBackgroundRepeat = function(value2) {
switch (value2) {
case "no-repeat":
return 1;
case "repeat-x":
case "repeat no-repeat":
return 2;
case "repeat-y":
case "no-repeat repeat":
return 3;
case "repeat":
default:
return 0;
}
};
var BACKGROUND_SIZE;
(function(BACKGROUND_SIZE2) {
BACKGROUND_SIZE2["AUTO"] = "auto";
BACKGROUND_SIZE2["CONTAIN"] = "contain";
BACKGROUND_SIZE2["COVER"] = "cover";
})(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));
var backgroundSize = {
name: "background-size",
initialValue: "0",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return parseFunctionArgs(tokens).map(function(values2) {
return values2.filter(isBackgroundSizeInfoToken);
});
}
};
var isBackgroundSizeInfoToken = function(value2) {
return isIdentToken(value2) || isLengthPercentage(value2);
};
var borderColorForSide = function(side) {
return {
name: "border-" + side + "-color",
initialValue: "transparent",
prefix: false,
type: 3,
format: "color"
};
};
var borderTopColor = borderColorForSide("top");
var borderRightColor = borderColorForSide("right");
var borderBottomColor = borderColorForSide("bottom");
var borderLeftColor = borderColorForSide("left");
var borderRadiusForSide = function(side) {
return {
name: "border-radius-" + side,
initialValue: "0 0",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return parseLengthPercentageTuple(tokens.filter(isLengthPercentage));
}
};
};
var borderTopLeftRadius = borderRadiusForSide("top-left");
var borderTopRightRadius = borderRadiusForSide("top-right");
var borderBottomRightRadius = borderRadiusForSide("bottom-right");
var borderBottomLeftRadius = borderRadiusForSide("bottom-left");
var borderStyleForSide = function(side) {
return {
name: "border-" + side + "-style",
initialValue: "solid",
prefix: false,
type: 2,
parse: function(_context, style2) {
switch (style2) {
case "none":
return 0;
case "dashed":
return 2;
case "dotted":
return 3;
case "double":
return 4;
}
return 1;
}
};
};
var borderTopStyle = borderStyleForSide("top");
var borderRightStyle = borderStyleForSide("right");
var borderBottomStyle = borderStyleForSide("bottom");
var borderLeftStyle = borderStyleForSide("left");
var borderWidthForSide = function(side) {
return {
name: "border-" + side + "-width",
initialValue: "0",
type: 0,
prefix: false,
parse: function(_context, token2) {
if (isDimensionToken(token2)) {
return token2.number;
}
return 0;
}
};
};
var borderTopWidth = borderWidthForSide("top");
var borderRightWidth = borderWidthForSide("right");
var borderBottomWidth = borderWidthForSide("bottom");
var borderLeftWidth = borderWidthForSide("left");
var color = {
name: "color",
initialValue: "transparent",
prefix: false,
type: 3,
format: "color"
};
var direction = {
name: "direction",
initialValue: "ltr",
prefix: false,
type: 2,
parse: function(_context, direction2) {
switch (direction2) {
case "rtl":
return 1;
case "ltr":
default:
return 0;
}
}
};
var display = {
name: "display",
initialValue: "inline-block",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return tokens.filter(isIdentToken).reduce(
function(bit, token2) {
return bit | parseDisplayValue(token2.value);
},
0
/* NONE */
);
}
};
var parseDisplayValue = function(display2) {
switch (display2) {
case "block":
case "-webkit-box":
return 2;
case "inline":
return 4;
case "run-in":
return 8;
case "flow":
return 16;
case "flow-root":
return 32;
case "table":
return 64;
case "flex":
case "-webkit-flex":
return 128;
case "grid":
case "-ms-grid":
return 256;
case "ruby":
return 512;
case "subgrid":
return 1024;
case "list-item":
return 2048;
case "table-row-group":
return 4096;
case "table-header-group":
return 8192;
case "table-footer-group":
return 16384;
case "table-row":
return 32768;
case "table-cell":
return 65536;
case "table-column-group":
return 131072;
case "table-column":
return 262144;
case "table-caption":
return 524288;
case "ruby-base":
return 1048576;
case "ruby-text":
return 2097152;
case "ruby-base-container":
return 4194304;
case "ruby-text-container":
return 8388608;
case "contents":
return 16777216;
case "inline-block":
return 33554432;
case "inline-list-item":
return 67108864;
case "inline-table":
return 134217728;
case "inline-flex":
return 268435456;
case "inline-grid":
return 536870912;
}
return 0;
};
var float = {
name: "float",
initialValue: "none",
prefix: false,
type: 2,
parse: function(_context, float2) {
switch (float2) {
case "left":
return 1;
case "right":
return 2;
case "inline-start":
return 3;
case "inline-end":
return 4;
}
return 0;
}
};
var letterSpacing = {
name: "letter-spacing",
initialValue: "0",
prefix: false,
type: 0,
parse: function(_context, token2) {
if (token2.type === 20 && token2.value === "normal") {
return 0;
}
if (token2.type === 17) {
return token2.number;
}
if (token2.type === 15) {
return token2.number;
}
return 0;
}
};
var LINE_BREAK;
(function(LINE_BREAK2) {
LINE_BREAK2["NORMAL"] = "normal";
LINE_BREAK2["STRICT"] = "strict";
})(LINE_BREAK || (LINE_BREAK = {}));
var lineBreak = {
name: "line-break",
initialValue: "normal",
prefix: false,
type: 2,
parse: function(_context, lineBreak2) {
switch (lineBreak2) {
case "strict":
return LINE_BREAK.STRICT;
case "normal":
default:
return LINE_BREAK.NORMAL;
}
}
};
var lineHeight = {
name: "line-height",
initialValue: "normal",
prefix: false,
type: 4
/* TOKEN_VALUE */
};
var computeLineHeight = function(token2, fontSize2) {
if (isIdentToken(token2) && token2.value === "normal") {
return 1.2 * fontSize2;
} else if (token2.type === 17) {
return fontSize2 * token2.number;
} else if (isLengthPercentage(token2)) {
return getAbsoluteValue(token2, fontSize2);
}
return fontSize2;
};
var listStyleImage = {
name: "list-style-image",
initialValue: "none",
type: 0,
prefix: false,
parse: function(context2, token2) {
if (token2.type === 20 && token2.value === "none") {
return null;
}
return image.parse(context2, token2);
}
};
var listStylePosition = {
name: "list-style-position",
initialValue: "outside",
prefix: false,
type: 2,
parse: function(_context, position2) {
switch (position2) {
case "inside":
return 0;
case "outside":
default:
return 1;
}
}
};
var listStyleType = {
name: "list-style-type",
initialValue: "none",
prefix: false,
type: 2,
parse: function(_context, type2) {
switch (type2) {
case "disc":
return 0;
case "circle":
return 1;
case "square":
return 2;
case "decimal":
return 3;
case "cjk-decimal":
return 4;
case "decimal-leading-zero":
return 5;
case "lower-roman":
return 6;
case "upper-roman":
return 7;
case "lower-greek":
return 8;
case "lower-alpha":
return 9;
case "upper-alpha":
return 10;
case "arabic-indic":
return 11;
case "armenian":
return 12;
case "bengali":
return 13;
case "cambodian":
return 14;
case "cjk-earthly-branch":
return 15;
case "cjk-heavenly-stem":
return 16;
case "cjk-ideographic":
return 17;
case "devanagari":
return 18;
case "ethiopic-numeric":
return 19;
case "georgian":
return 20;
case "gujarati":
return 21;
case "gurmukhi":
return 22;
case "hebrew":
return 22;
case "hiragana":
return 23;
case "hiragana-iroha":
return 24;
case "japanese-formal":
return 25;
case "japanese-informal":
return 26;
case "kannada":
return 27;
case "katakana":
return 28;
case "katakana-iroha":
return 29;
case "khmer":
return 30;
case "korean-hangul-formal":
return 31;
case "korean-hanja-formal":
return 32;
case "korean-hanja-informal":
return 33;
case "lao":
return 34;
case "lower-armenian":
return 35;
case "malayalam":
return 36;
case "mongolian":
return 37;
case "myanmar":
return 38;
case "oriya":
return 39;
case "persian":
return 40;
case "simp-chinese-formal":
return 41;
case "simp-chinese-informal":
return 42;
case "tamil":
return 43;
case "telugu":
return 44;
case "thai":
return 45;
case "tibetan":
return 46;
case "trad-chinese-formal":
return 47;
case "trad-chinese-informal":
return 48;
case "upper-armenian":
return 49;
case "disclosure-open":
return 50;
case "disclosure-closed":
return 51;
case "none":
default:
return -1;
}
}
};
var marginForSide = function(side) {
return {
name: "margin-" + side,
initialValue: "0",
prefix: false,
type: 4
/* TOKEN_VALUE */
};
};
var marginTop = marginForSide("top");
var marginRight = marginForSide("right");
var marginBottom = marginForSide("bottom");
var marginLeft = marginForSide("left");
var overflow = {
name: "overflow",
initialValue: "visible",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return tokens.filter(isIdentToken).map(function(overflow2) {
switch (overflow2.value) {
case "hidden":
return 1;
case "scroll":
return 2;
case "clip":
return 3;
case "auto":
return 4;
case "visible":
default:
return 0;
}
});
}
};
var overflowWrap = {
name: "overflow-wrap",
initialValue: "normal",
prefix: false,
type: 2,
parse: function(_context, overflow2) {
switch (overflow2) {
case "break-word":
return "break-word";
case "normal":
default:
return "normal";
}
}
};
var paddingForSide = function(side) {
return {
name: "padding-" + side,
initialValue: "0",
prefix: false,
type: 3,
format: "length-percentage"
};
};
var paddingTop = paddingForSide("top");
var paddingRight = paddingForSide("right");
var paddingBottom = paddingForSide("bottom");
var paddingLeft = paddingForSide("left");
var textAlign = {
name: "text-align",
initialValue: "left",
prefix: false,
type: 2,
parse: function(_context, textAlign2) {
switch (textAlign2) {
case "right":
return 2;
case "center":
case "justify":
return 1;
case "left":
default:
return 0;
}
}
};
var position = {
name: "position",
initialValue: "static",
prefix: false,
type: 2,
parse: function(_context, position2) {
switch (position2) {
case "relative":
return 1;
case "absolute":
return 2;
case "fixed":
return 3;
case "sticky":
return 4;
}
return 0;
}
};
var textShadow = {
name: "text-shadow",
initialValue: "none",
type: 1,
prefix: false,
parse: function(context2, tokens) {
if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
return [];
}
return parseFunctionArgs(tokens).map(function(values2) {
var shadow = {
color: COLORS.TRANSPARENT,
offsetX: ZERO_LENGTH,
offsetY: ZERO_LENGTH,
blur: ZERO_LENGTH
};
var c2 = 0;
for (var i2 = 0; i2 < values2.length; i2++) {
var token2 = values2[i2];
if (isLength(token2)) {
if (c2 === 0) {
shadow.offsetX = token2;
} else if (c2 === 1) {
shadow.offsetY = token2;
} else {
shadow.blur = token2;
}
c2++;
} else {
shadow.color = color$1.parse(context2, token2);
}
}
return shadow;
});
}
};
var textTransform = {
name: "text-transform",
initialValue: "none",
prefix: false,
type: 2,
parse: function(_context, textTransform2) {
switch (textTransform2) {
case "uppercase":
return 2;
case "lowercase":
return 1;
case "capitalize":
return 3;
}
return 0;
}
};
var transform$1 = {
name: "transform",
initialValue: "none",
prefix: true,
type: 0,
parse: function(_context, token2) {
if (token2.type === 20 && token2.value === "none") {
return null;
}
if (token2.type === 18) {
var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token2.name];
if (typeof transformFunction === "undefined") {
throw new Error('Attempting to parse an unsupported transform function "' + token2.name + '"');
}
return transformFunction(token2.values);
}
return null;
}
};
var matrix = function(args) {
var values2 = args.filter(function(arg) {
return arg.type === 17;
}).map(function(arg) {
return arg.number;
});
return values2.length === 6 ? values2 : null;
};
var matrix3d = function(args) {
var values2 = args.filter(function(arg) {
return arg.type === 17;
}).map(function(arg) {
return arg.number;
});
var a1 = values2[0], b1 = values2[1];
values2[2];
values2[3];
var a2 = values2[4], b2 = values2[5];
values2[6];
values2[7];
values2[8];
values2[9];
values2[10];
values2[11];
var a4 = values2[12], b4 = values2[13];
values2[14];
values2[15];
return values2.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;
};
var SUPPORTED_TRANSFORM_FUNCTIONS = {
matrix,
matrix3d
};
var DEFAULT_VALUE = {
type: 16,
number: 50,
flags: FLAG_INTEGER
};
var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];
var transformOrigin = {
name: "transform-origin",
initialValue: "50% 50%",
prefix: true,
type: 1,
parse: function(_context, tokens) {
var origins = tokens.filter(isLengthPercentage);
if (origins.length !== 2) {
return DEFAULT;
}
return [origins[0], origins[1]];
}
};
var visibility = {
name: "visible",
initialValue: "none",
prefix: false,
type: 2,
parse: function(_context, visibility2) {
switch (visibility2) {
case "hidden":
return 1;
case "collapse":
return 2;
case "visible":
default:
return 0;
}
}
};
var WORD_BREAK;
(function(WORD_BREAK2) {
WORD_BREAK2["NORMAL"] = "normal";
WORD_BREAK2["BREAK_ALL"] = "break-all";
WORD_BREAK2["KEEP_ALL"] = "keep-all";
})(WORD_BREAK || (WORD_BREAK = {}));
var wordBreak = {
name: "word-break",
initialValue: "normal",
prefix: false,
type: 2,
parse: function(_context, wordBreak2) {
switch (wordBreak2) {
case "break-all":
return WORD_BREAK.BREAK_ALL;
case "keep-all":
return WORD_BREAK.KEEP_ALL;
case "normal":
default:
return WORD_BREAK.NORMAL;
}
}
};
var zIndex = {
name: "z-index",
initialValue: "auto",
prefix: false,
type: 0,
parse: function(_context, token2) {
if (token2.type === 20) {
return { auto: true, order: 0 };
}
if (isNumberToken(token2)) {
return { auto: false, order: token2.number };
}
throw new Error("Invalid z-index number parsed");
}
};
var time = {
name: "time",
parse: function(_context, value2) {
if (value2.type === 15) {
switch (value2.unit.toLowerCase()) {
case "s":
return 1e3 * value2.number;
case "ms":
return value2.number;
}
}
throw new Error("Unsupported time type");
}
};
var opacity = {
name: "opacity",
initialValue: "1",
type: 0,
prefix: false,
parse: function(_context, token2) {
if (isNumberToken(token2)) {
return token2.number;
}
return 1;
}
};
var textDecorationColor = {
name: "text-decoration-color",
initialValue: "transparent",
prefix: false,
type: 3,
format: "color"
};
var textDecorationLine = {
name: "text-decoration-line",
initialValue: "none",
prefix: false,
type: 1,
parse: function(_context, tokens) {
return tokens.filter(isIdentToken).map(function(token2) {
switch (token2.value) {
case "underline":
return 1;
case "overline":
return 2;
case "line-through":
return 3;
case "none":
return 4;
}
return 0;
}).filter(function(line2) {
return line2 !== 0;
});
}
};
var fontFamily = {
name: "font-family",
initialValue: "",
prefix: false,
type: 1,
parse: function(_context, tokens) {
var accumulator = [];
var results = [];
tokens.forEach(function(token2) {
switch (token2.type) {
case 20:
case 0:
accumulator.push(token2.value);
break;
case 17:
accumulator.push(token2.number.toString());
break;
case 4:
results.push(accumulator.join(" "));
accumulator.length = 0;
break;
}
});
if (accumulator.length) {
results.push(accumulator.join(" "));
}
return results.map(function(result) {
return result.indexOf(" ") === -1 ? result : "'" + result + "'";
});
}
};
var fontSize = {
name: "font-size",
initialValue: "0",
prefix: false,
type: 3,
format: "length"
};
var fontWeight = {
name: "font-weight",
initialValue: "normal",
type: 0,
prefix: false,
parse: function(_context, token2) {
if (isNumberToken(token2)) {
return token2.number;
}
if (isIdentToken(token2)) {
switch (token2.value) {
case "bold":
return 700;
case "normal":
default:
return 400;
}
}
return 400;
}
};
var fontVariant = {
name: "font-variant",
initialValue: "none",
type: 1,
prefix: false,
parse: function(_context, tokens) {
return tokens.filter(isIdentToken).map(function(token2) {
return token2.value;
});
}
};
var fontStyle = {
name: "font-style",
initialValue: "normal",
prefix: false,
type: 2,
parse: function(_context, overflow2) {
switch (overflow2) {
case "oblique":
return "oblique";
case "italic":
return "italic";
case "normal":
default:
return "normal";
}
}
};
var contains = function(bit, value2) {
return (bit & value2) !== 0;
};
var content = {
name: "content",
initialValue: "none",
type: 1,
prefix: false,
parse: function(_context, tokens) {
if (tokens.length === 0) {
return [];
}
var first = tokens[0];
if (first.type === 20 && first.value === "none") {
return [];
}
return tokens;
}
};
var counterIncrement = {
name: "counter-increment",
initialValue: "none",
prefix: true,
type: 1,
parse: function(_context, tokens) {
if (tokens.length === 0) {
return null;
}
var first = tokens[0];
if (first.type === 20 && first.value === "none") {
return null;
}
var increments = [];
var filtered = tokens.filter(nonWhiteSpace);
for (var i2 = 0; i2 < filtered.length; i2++) {
var counter2 = filtered[i2];
var next2 = filtered[i2 + 1];
if (counter2.type === 20) {
var increment2 = next2 && isNumberToken(next2) ? next2.number : 1;
increments.push({ counter: counter2.value, increment: increment2 });
}
}
return increments;
}
};
var counterReset = {
name: "counter-reset",
initialValue: "none",
prefix: true,
type: 1,
parse: function(_context, tokens) {
if (tokens.length === 0) {
return [];
}
var resets = [];
var filtered = tokens.filter(nonWhiteSpace);
for (var i2 = 0; i2 < filtered.length; i2++) {
var counter2 = filtered[i2];
var next2 = filtered[i2 + 1];
if (isIdentToken(counter2) && counter2.value !== "none") {
var reset2 = next2 && isNumberToken(next2) ? next2.number : 0;
resets.push({ counter: counter2.value, reset: reset2 });
}
}
return resets;
}
};
var duration = {
name: "duration",
initialValue: "0s",
prefix: false,
type: 1,
parse: function(context2, tokens) {
return tokens.filter(isDimensionToken).map(function(token2) {
return time.parse(context2, token2);
});
}
};
var quotes = {
name: "quotes",
initialValue: "none",
prefix: true,
type: 1,
parse: function(_context, tokens) {
if (tokens.length === 0) {
return null;
}
var first = tokens[0];
if (first.type === 20 && first.value === "none") {
return null;
}
var quotes2 = [];
var filtered = tokens.filter(isStringToken);
if (filtered.length % 2 !== 0) {
return null;
}
for (var i2 = 0; i2 < filtered.length; i2 += 2) {
var open_1 = filtered[i2].value;
var close_1 = filtered[i2 + 1].value;
quotes2.push({ open: open_1, close: close_1 });
}
return quotes2;
}
};
var getQuote = function(quotes2, depth, open2) {
if (!quotes2) {
return "";
}
var quote = quotes2[Math.min(depth, quotes2.length - 1)];
if (!quote) {
return "";
}
return open2 ? quote.open : quote.close;
};
var boxShadow = {
name: "box-shadow",
initialValue: "none",
type: 1,
prefix: false,
parse: function(context2, tokens) {
if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
return [];
}
return parseFunctionArgs(tokens).map(function(values2) {
var shadow = {
color: 255,
offsetX: ZERO_LENGTH,
offsetY: ZERO_LENGTH,
blur: ZERO_LENGTH,
spread: ZERO_LENGTH,
inset: false
};
var c2 = 0;
for (var i2 = 0; i2 < values2.length; i2++) {
var token2 = values2[i2];
if (isIdentWithValue(token2, "inset")) {
shadow.inset = true;
} else if (isLength(token2)) {
if (c2 === 0) {
shadow.offsetX = token2;
} else if (c2 === 1) {
shadow.offsetY = token2;
} else if (c2 === 2) {
shadow.blur = token2;
} else {
shadow.spread = token2;
}
c2++;
} else {
shadow.color = color$1.parse(context2, token2);
}
}
return shadow;
});
}
};
var paintOrder = {
name: "paint-order",
initialValue: "normal",
prefix: false,
type: 1,
parse: function(_context, tokens) {
var DEFAULT_VALUE2 = [
0,
1,
2
/* MARKERS */
];
var layers = [];
tokens.filter(isIdentToken).forEach(function(token2) {
switch (token2.value) {
case "stroke":
layers.push(
1
/* STROKE */
);
break;
case "fill":
layers.push(
0
/* FILL */
);
break;
case "markers":
layers.push(
2
/* MARKERS */
);
break;
}
});
DEFAULT_VALUE2.forEach(function(value2) {
if (layers.indexOf(value2) === -1) {
layers.push(value2);
}
});
return layers;
}
};
var webkitTextStrokeColor = {
name: "-webkit-text-stroke-color",
initialValue: "currentcolor",
prefix: false,
type: 3,
format: "color"
};
var webkitTextStrokeWidth = {
name: "-webkit-text-stroke-width",
initialValue: "0",
type: 0,
prefix: false,
parse: function(_context, token2) {
if (isDimensionToken(token2)) {
return token2.number;
}
return 0;
}
};
var CSSParsedDeclaration = (
/** @class */
function() {
function CSSParsedDeclaration2(context2, declaration2) {
var _a2, _b2;
this.animationDuration = parse(context2, duration, declaration2.animationDuration);
this.backgroundClip = parse(context2, backgroundClip, declaration2.backgroundClip);
this.backgroundColor = parse(context2, backgroundColor, declaration2.backgroundColor);
this.backgroundImage = parse(context2, backgroundImage, declaration2.backgroundImage);
this.backgroundOrigin = parse(context2, backgroundOrigin, declaration2.backgroundOrigin);
this.backgroundPosition = parse(context2, backgroundPosition, declaration2.backgroundPosition);
this.backgroundRepeat = parse(context2, backgroundRepeat, declaration2.backgroundRepeat);
this.backgroundSize = parse(context2, backgroundSize, declaration2.backgroundSize);
this.borderTopColor = parse(context2, borderTopColor, declaration2.borderTopColor);
this.borderRightColor = parse(context2, borderRightColor, declaration2.borderRightColor);
this.borderBottomColor = parse(context2, borderBottomColor, declaration2.borderBottomColor);
this.borderLeftColor = parse(context2, borderLeftColor, declaration2.borderLeftColor);
this.borderTopLeftRadius = parse(context2, borderTopLeftRadius, declaration2.borderTopLeftRadius);
this.borderTopRightRadius = parse(context2, borderTopRightRadius, declaration2.borderTopRightRadius);
this.borderBottomRightRadius = parse(context2, borderBottomRightRadius, declaration2.borderBottomRightRadius);
this.borderBottomLeftRadius = parse(context2, borderBottomLeftRadius, declaration2.borderBottomLeftRadius);
this.borderTopStyle = parse(context2, borderTopStyle, declaration2.borderTopStyle);
this.borderRightStyle = parse(context2, borderRightStyle, declaration2.borderRightStyle);
this.borderBottomStyle = parse(context2, borderBottomStyle, declaration2.borderBottomStyle);
this.borderLeftStyle = parse(context2, borderLeftStyle, declaration2.borderLeftStyle);
this.borderTopWidth = parse(context2, borderTopWidth, declaration2.borderTopWidth);
this.borderRightWidth = parse(context2, borderRightWidth, declaration2.borderRightWidth);
this.borderBottomWidth = parse(context2, borderBottomWidth, declaration2.borderBottomWidth);
this.borderLeftWidth = parse(context2, borderLeftWidth, declaration2.borderLeftWidth);
this.boxShadow = parse(context2, boxShadow, declaration2.boxShadow);
this.color = parse(context2, color, declaration2.color);
this.direction = parse(context2, direction, declaration2.direction);
this.display = parse(context2, display, declaration2.display);
this.float = parse(context2, float, declaration2.cssFloat);
this.fontFamily = parse(context2, fontFamily, declaration2.fontFamily);
this.fontSize = parse(context2, fontSize, declaration2.fontSize);
this.fontStyle = parse(context2, fontStyle, declaration2.fontStyle);
this.fontVariant = parse(context2, fontVariant, declaration2.fontVariant);
this.fontWeight = parse(context2, fontWeight, declaration2.fontWeight);
this.letterSpacing = parse(context2, letterSpacing, declaration2.letterSpacing);
this.lineBreak = parse(context2, lineBreak, declaration2.lineBreak);
this.lineHeight = parse(context2, lineHeight, declaration2.lineHeight);
this.listStyleImage = parse(context2, listStyleImage, declaration2.listStyleImage);
this.listStylePosition = parse(context2, listStylePosition, declaration2.listStylePosition);
this.listStyleType = parse(context2, listStyleType, declaration2.listStyleType);
this.marginTop = parse(context2, marginTop, declaration2.marginTop);
this.marginRight = parse(context2, marginRight, declaration2.marginRight);
this.marginBottom = parse(context2, marginBottom, declaration2.marginBottom);
this.marginLeft = parse(context2, marginLeft, declaration2.marginLeft);
this.opacity = parse(context2, opacity, declaration2.opacity);
var overflowTuple = parse(context2, overflow, declaration2.overflow);
this.overflowX = overflowTuple[0];
this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];
this.overflowWrap = parse(context2, overflowWrap, declaration2.overflowWrap);
this.paddingTop = parse(context2, paddingTop, declaration2.paddingTop);
this.paddingRight = parse(context2, paddingRight, declaration2.paddingRight);
this.paddingBottom = parse(context2, paddingBottom, declaration2.paddingBottom);
this.paddingLeft = parse(context2, paddingLeft, declaration2.paddingLeft);
this.paintOrder = parse(context2, paintOrder, declaration2.paintOrder);
this.position = parse(context2, position, declaration2.position);
this.textAlign = parse(context2, textAlign, declaration2.textAlign);
this.textDecorationColor = parse(context2, textDecorationColor, (_a2 = declaration2.textDecorationColor) !== null && _a2 !== void 0 ? _a2 : declaration2.color);
this.textDecorationLine = parse(context2, textDecorationLine, (_b2 = declaration2.textDecorationLine) !== null && _b2 !== void 0 ? _b2 : declaration2.textDecoration);
this.textShadow = parse(context2, textShadow, declaration2.textShadow);
this.textTransform = parse(context2, textTransform, declaration2.textTransform);
this.transform = parse(context2, transform$1, declaration2.transform);
this.transformOrigin = parse(context2, transformOrigin, declaration2.transformOrigin);
this.visibility = parse(context2, visibility, declaration2.visibility);
this.webkitTextStrokeColor = parse(context2, webkitTextStrokeColor, declaration2.webkitTextStrokeColor);
this.webkitTextStrokeWidth = parse(context2, webkitTextStrokeWidth, declaration2.webkitTextStrokeWidth);
this.wordBreak = parse(context2, wordBreak, declaration2.wordBreak);
this.zIndex = parse(context2, zIndex, declaration2.zIndex);
}
CSSParsedDeclaration2.prototype.isVisible = function() {
return this.display > 0 && this.opacity > 0 && this.visibility === 0;
};
CSSParsedDeclaration2.prototype.isTransparent = function() {
return isTransparent(this.backgroundColor);
};
CSSParsedDeclaration2.prototype.isTransformed = function() {
return this.transform !== null;
};
CSSParsedDeclaration2.prototype.isPositioned = function() {
return this.position !== 0;
};
CSSParsedDeclaration2.prototype.isPositionedWithZIndex = function() {
return this.isPositioned() && !this.zIndex.auto;
};
CSSParsedDeclaration2.prototype.isFloating = function() {
return this.float !== 0;
};
CSSParsedDeclaration2.prototype.isInlineLevel = function() {
return contains(
this.display,
4
/* INLINE */
) || contains(
this.display,
33554432
/* INLINE_BLOCK */
) || contains(
this.display,
268435456
/* INLINE_FLEX */
) || contains(
this.display,
536870912
/* INLINE_GRID */
) || contains(
this.display,
67108864
/* INLINE_LIST_ITEM */
) || contains(
this.display,
134217728
/* INLINE_TABLE */
);
};
return CSSParsedDeclaration2;
}()
);
var CSSParsedPseudoDeclaration = (
/** @class */
function() {
function CSSParsedPseudoDeclaration2(context2, declaration2) {
this.content = parse(context2, content, declaration2.content);
this.quotes = parse(context2, quotes, declaration2.quotes);
}
return CSSParsedPseudoDeclaration2;
}()
);
var CSSParsedCounterDeclaration = (
/** @class */
function() {
function CSSParsedCounterDeclaration2(context2, declaration2) {
this.counterIncrement = parse(context2, counterIncrement, declaration2.counterIncrement);
this.counterReset = parse(context2, counterReset, declaration2.counterReset);
}
return CSSParsedCounterDeclaration2;
}()
);
var parse = function(context2, descriptor, style2) {
var tokenizer = new Tokenizer();
var value2 = style2 !== null && typeof style2 !== "undefined" ? style2.toString() : descriptor.initialValue;
tokenizer.write(value2);
var parser2 = new Parser$1(tokenizer.read());
switch (descriptor.type) {
case 2:
var token2 = parser2.parseComponentValue();
return descriptor.parse(context2, isIdentToken(token2) ? token2.value : descriptor.initialValue);
case 0:
return descriptor.parse(context2, parser2.parseComponentValue());
case 1:
return descriptor.parse(context2, parser2.parseComponentValues());
case 4:
return parser2.parseComponentValue();
case 3:
switch (descriptor.format) {
case "angle":
return angle.parse(context2, parser2.parseComponentValue());
case "color":
return color$1.parse(context2, parser2.parseComponentValue());
case "image":
return image.parse(context2, parser2.parseComponentValue());
case "length":
var length_1 = parser2.parseComponentValue();
return isLength(length_1) ? length_1 : ZERO_LENGTH;
case "length-percentage":
var value_1 = parser2.parseComponentValue();
return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
case "time":
return time.parse(context2, parser2.parseComponentValue());
}
break;
}
};
var elementDebuggerAttribute = "data-html2canvas-debug";
var getElementDebugType = function(element2) {
var attribute = element2.getAttribute(elementDebuggerAttribute);
switch (attribute) {
case "all":
return 1;
case "clone":
return 2;
case "parse":
return 3;
case "render":
return 4;
default:
return 0;
}
};
var isDebugging = function(element2, type2) {
var elementType = getElementDebugType(element2);
return elementType === 1 || type2 === elementType;
};
var ElementContainer = (
/** @class */
function() {
function ElementContainer2(context2, element2) {
this.context = context2;
this.textNodes = [];
this.elements = [];
this.flags = 0;
if (isDebugging(
element2,
3
/* PARSE */
)) {
debugger;
}
this.styles = new CSSParsedDeclaration(context2, window.getComputedStyle(element2, null));
if (isHTMLElementNode(element2)) {
if (this.styles.animationDuration.some(function(duration2) {
return duration2 > 0;
})) {
element2.style.animationDuration = "0s";
}
if (this.styles.transform !== null) {
element2.style.transform = "none";
}
}
this.bounds = parseBounds(this.context, element2);
if (isDebugging(
element2,
4
/* RENDER */
)) {
this.flags |= 16;
}
}
return ElementContainer2;
}()
);
var base64 = "AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=";
var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var lookup$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for (var i$1$2 = 0; i$1$2 < chars$1.length; i$1$2++) {
lookup$1[chars$1.charCodeAt(i$1$2)] = i$1$2;
}
var decode = function(base642) {
var bufferLength = base642.length * 0.75, len = base642.length, i2, p2 = 0, encoded1, encoded2, encoded3, encoded4;
if (base642[base642.length - 1] === "=") {
bufferLength--;
if (base642[base642.length - 2] === "=") {
bufferLength--;
}
}
var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
for (i2 = 0; i2 < len; i2 += 4) {
encoded1 = lookup$1[base642.charCodeAt(i2)];
encoded2 = lookup$1[base642.charCodeAt(i2 + 1)];
encoded3 = lookup$1[base642.charCodeAt(i2 + 2)];
encoded4 = lookup$1[base642.charCodeAt(i2 + 3)];
bytes[p2++] = encoded1 << 2 | encoded2 >> 4;
bytes[p2++] = (encoded2 & 15) << 4 | encoded3 >> 2;
bytes[p2++] = (encoded3 & 3) << 6 | encoded4 & 63;
}
return buffer;
};
var polyUint16Array = function(buffer) {
var length2 = buffer.length;
var bytes = [];
for (var i2 = 0; i2 < length2; i2 += 2) {
bytes.push(buffer[i2 + 1] << 8 | buffer[i2]);
}
return bytes;
};
var polyUint32Array = function(buffer) {
var length2 = buffer.length;
var bytes = [];
for (var i2 = 0; i2 < length2; i2 += 4) {
bytes.push(buffer[i2 + 3] << 24 | buffer[i2 + 2] << 16 | buffer[i2 + 1] << 8 | buffer[i2]);
}
return bytes;
};
var UTRIE2_SHIFT_2 = 5;
var UTRIE2_SHIFT_1 = 6 + 5;
var UTRIE2_INDEX_SHIFT = 2;
var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
var UTRIE2_LSCP_INDEX_2_OFFSET = 65536 >> UTRIE2_SHIFT_2;
var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
var UTRIE2_LSCP_INDEX_2_LENGTH = 1024 >> UTRIE2_SHIFT_2;
var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 2048 >> 6;
var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 65536 >> UTRIE2_SHIFT_1;
var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
var slice16 = function(view, start2, end2) {
if (view.slice) {
return view.slice(start2, end2);
}
return new Uint16Array(Array.prototype.slice.call(view, start2, end2));
};
var slice32 = function(view, start2, end2) {
if (view.slice) {
return view.slice(start2, end2);
}
return new Uint32Array(Array.prototype.slice.call(view, start2, end2));
};
var createTrieFromBase64 = function(base642, _byteLength) {
var buffer = decode(base642);
var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);
var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);
var headerLength = 24;
var index2 = slice16(view16, headerLength / 2, view32[4] / 2);
var data2 = view32[5] === 2 ? slice16(view16, (headerLength + view32[4]) / 2) : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));
return new Trie(view32[0], view32[1], view32[2], view32[3], index2, data2);
};
var Trie = (
/** @class */
function() {
function Trie2(initialValue, errorValue, highStart, highValueIndex, index2, data2) {
this.initialValue = initialValue;
this.errorValue = errorValue;
this.highStart = highStart;
this.highValueIndex = highValueIndex;
this.index = index2;
this.data = data2;
}
Trie2.prototype.get = function(codePoint) {
var ix;
if (codePoint >= 0) {
if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
ix = this.index[codePoint >> UTRIE2_SHIFT_2];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
return this.data[ix];
}
if (codePoint <= 65535) {
ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 55296 >> UTRIE2_SHIFT_2)];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
return this.data[ix];
}
if (codePoint < this.highStart) {
ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
ix = this.index[ix];
ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
ix = this.index[ix];
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
return this.data[ix];
}
if (codePoint <= 1114111) {
return this.data[this.highValueIndex];
}
}
return this.errorValue;
};
return Trie2;
}()
);
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var lookup9 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
for (var i$b = 0; i$b < chars.length; i$b++) {
lookup9[chars.charCodeAt(i$b)] = i$b;
}
var Prepend = 1;
var CR = 2;
var LF = 3;
var Control2 = 4;
var Extend = 5;
var SpacingMark = 7;
var L = 8;
var V = 9;
var T$1 = 10;
var LV = 11;
var LVT = 12;
var ZWJ = 13;
var Extended_Pictographic = 14;
var RI = 15;
var toCodePoints = function(str) {
var codePoints = [];
var i2 = 0;
var length2 = str.length;
while (i2 < length2) {
var value2 = str.charCodeAt(i2++);
if (value2 >= 55296 && value2 <= 56319 && i2 < length2) {
var extra = str.charCodeAt(i2++);
if ((extra & 64512) === 56320) {
codePoints.push(((value2 & 1023) << 10) + (extra & 1023) + 65536);
} else {
codePoints.push(value2);
i2--;
}
} else {
codePoints.push(value2);
}
}
return codePoints;
};
var fromCodePoint = function() {
var codePoints = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
codePoints[_i2] = arguments[_i2];
}
if (String.fromCodePoint) {
return String.fromCodePoint.apply(String, codePoints);
}
var length2 = codePoints.length;
if (!length2) {
return "";
}
var codeUnits = [];
var index2 = -1;
var result = "";
while (++index2 < length2) {
var codePoint = codePoints[index2];
if (codePoint <= 65535) {
codeUnits.push(codePoint);
} else {
codePoint -= 65536;
codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
}
if (index2 + 1 === length2 || codeUnits.length > 16384) {
result += String.fromCharCode.apply(String, codeUnits);
codeUnits.length = 0;
}
}
return result;
};
var UnicodeTrie = createTrieFromBase64(base64);
var BREAK_NOT_ALLOWED = "×";
var BREAK_ALLOWED = "÷";
var codePointToClass = function(codePoint) {
return UnicodeTrie.get(codePoint);
};
var _graphemeBreakAtIndex = function(_codePoints, classTypes, index2) {
var prevIndex = index2 - 2;
var prev2 = classTypes[prevIndex];
var current = classTypes[index2 - 1];
var next2 = classTypes[index2];
if (current === CR && next2 === LF) {
return BREAK_NOT_ALLOWED;
}
if (current === CR || current === LF || current === Control2) {
return BREAK_ALLOWED;
}
if (next2 === CR || next2 === LF || next2 === Control2) {
return BREAK_ALLOWED;
}
if (current === L && [L, V, LV, LVT].indexOf(next2) !== -1) {
return BREAK_NOT_ALLOWED;
}
if ((current === LV || current === V) && (next2 === V || next2 === T$1)) {
return BREAK_NOT_ALLOWED;
}
if ((current === LVT || current === T$1) && next2 === T$1) {
return BREAK_NOT_ALLOWED;
}
if (next2 === ZWJ || next2 === Extend) {
return BREAK_NOT_ALLOWED;
}
if (next2 === SpacingMark) {
return BREAK_NOT_ALLOWED;
}
if (current === Prepend) {
return BREAK_NOT_ALLOWED;
}
if (current === ZWJ && next2 === Extended_Pictographic) {
while (prev2 === Extend) {
prev2 = classTypes[--prevIndex];
}
if (prev2 === Extended_Pictographic) {
return BREAK_NOT_ALLOWED;
}
}
if (current === RI && next2 === RI) {
var countRI = 0;
while (prev2 === RI) {
countRI++;
prev2 = classTypes[--prevIndex];
}
if (countRI % 2 === 0) {
return BREAK_NOT_ALLOWED;
}
}
return BREAK_ALLOWED;
};
var GraphemeBreaker = function(str) {
var codePoints = toCodePoints(str);
var length2 = codePoints.length;
var index2 = 0;
var lastEnd = 0;
var classTypes = codePoints.map(codePointToClass);
return {
next: function() {
if (index2 >= length2) {
return { done: true, value: null };
}
var graphemeBreak = BREAK_NOT_ALLOWED;
while (index2 < length2 && (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index2)) === BREAK_NOT_ALLOWED) {
}
if (graphemeBreak !== BREAK_NOT_ALLOWED || index2 === length2) {
var value2 = fromCodePoint.apply(null, codePoints.slice(lastEnd, index2));
lastEnd = index2;
return { value: value2, done: false };
}
return { done: true, value: null };
}
};
};
var splitGraphemes = function(str) {
var breaker = GraphemeBreaker(str);
var graphemes = [];
var bk2;
while (!(bk2 = breaker.next()).done) {
if (bk2.value) {
graphemes.push(bk2.value.slice());
}
}
return graphemes;
};
var testRangeBounds = function(document2) {
var TEST_HEIGHT = 123;
if (document2.createRange) {
var range2 = document2.createRange();
if (range2.getBoundingClientRect) {
var testElement = document2.createElement("boundtest");
testElement.style.height = TEST_HEIGHT + "px";
testElement.style.display = "block";
document2.body.appendChild(testElement);
range2.selectNode(testElement);
var rangeBounds = range2.getBoundingClientRect();
var rangeHeight = Math.round(rangeBounds.height);
document2.body.removeChild(testElement);
if (rangeHeight === TEST_HEIGHT) {
return true;
}
}
}
return false;
};
var testIOSLineBreak = function(document2) {
var testElement = document2.createElement("boundtest");
testElement.style.width = "50px";
testElement.style.display = "block";
testElement.style.fontSize = "12px";
testElement.style.letterSpacing = "0px";
testElement.style.wordSpacing = "0px";
document2.body.appendChild(testElement);
var range2 = document2.createRange();
testElement.innerHTML = typeof "".repeat === "function" ? "👨".repeat(10) : "";
var node2 = testElement.firstChild;
var textList = toCodePoints$1(node2.data).map(function(i2) {
return fromCodePoint$1(i2);
});
var offset2 = 0;
var prev2 = {};
var supports = textList.every(function(text2, i2) {
range2.setStart(node2, offset2);
range2.setEnd(node2, offset2 + text2.length);
var rect2 = range2.getBoundingClientRect();
offset2 += text2.length;
var boundAhead = rect2.x > prev2.x || rect2.y > prev2.y;
prev2 = rect2;
if (i2 === 0) {
return true;
}
return boundAhead;
});
document2.body.removeChild(testElement);
return supports;
};
var testCORS = function() {
return typeof new Image().crossOrigin !== "undefined";
};
var testResponseType = function() {
return typeof new XMLHttpRequest().responseType === "string";
};
var testSVG = function(document2) {
var img = new Image();
var canvas = document2.createElement("canvas");
var ctx = canvas.getContext("2d");
if (!ctx) {
return false;
}
img.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
try {
ctx.drawImage(img, 0, 0);
canvas.toDataURL();
} catch (e7) {
return false;
}
return true;
};
var isGreenPixel = function(data2) {
return data2[0] === 0 && data2[1] === 255 && data2[2] === 0 && data2[3] === 255;
};
var testForeignObject = function(document2) {
var canvas = document2.createElement("canvas");
var size = 100;
canvas.width = size;
canvas.height = size;
var ctx = canvas.getContext("2d");
if (!ctx) {
return Promise.reject(false);
}
ctx.fillStyle = "rgb(0, 255, 0)";
ctx.fillRect(0, 0, size, size);
var img = new Image();
var greenImageSrc = canvas.toDataURL();
img.src = greenImageSrc;
var svg2 = createForeignObjectSVG(size, size, 0, 0, img);
ctx.fillStyle = "red";
ctx.fillRect(0, 0, size, size);
return loadSerializedSVG$1(svg2).then(function(img2) {
ctx.drawImage(img2, 0, 0);
var data2 = ctx.getImageData(0, 0, size, size).data;
ctx.fillStyle = "red";
ctx.fillRect(0, 0, size, size);
var node2 = document2.createElement("div");
node2.style.backgroundImage = "url(" + greenImageSrc + ")";
node2.style.height = size + "px";
return isGreenPixel(data2) ? loadSerializedSVG$1(createForeignObjectSVG(size, size, 0, 0, node2)) : Promise.reject(false);
}).then(function(img2) {
ctx.drawImage(img2, 0, 0);
return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
}).catch(function() {
return false;
});
};
var createForeignObjectSVG = function(width2, height2, x2, y2, node2) {
var xmlns2 = "http://www.w3.org/2000/svg";
var svg2 = document.createElementNS(xmlns2, "svg");
var foreignObject = document.createElementNS(xmlns2, "foreignObject");
svg2.setAttributeNS(null, "width", width2.toString());
svg2.setAttributeNS(null, "height", height2.toString());
foreignObject.setAttributeNS(null, "width", "100%");
foreignObject.setAttributeNS(null, "height", "100%");
foreignObject.setAttributeNS(null, "x", x2.toString());
foreignObject.setAttributeNS(null, "y", y2.toString());
foreignObject.setAttributeNS(null, "externalResourcesRequired", "true");
svg2.appendChild(foreignObject);
foreignObject.appendChild(node2);
return svg2;
};
var loadSerializedSVG$1 = function(svg2) {
return new Promise(function(resolve3, reject2) {
var img = new Image();
img.onload = function() {
return resolve3(img);
};
img.onerror = reject2;
img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg2));
});
};
var FEATURES = {
get SUPPORT_RANGE_BOUNDS() {
var value2 = testRangeBounds(document);
Object.defineProperty(FEATURES, "SUPPORT_RANGE_BOUNDS", { value: value2 });
return value2;
},
get SUPPORT_WORD_BREAKING() {
var value2 = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);
Object.defineProperty(FEATURES, "SUPPORT_WORD_BREAKING", { value: value2 });
return value2;
},
get SUPPORT_SVG_DRAWING() {
var value2 = testSVG(document);
Object.defineProperty(FEATURES, "SUPPORT_SVG_DRAWING", { value: value2 });
return value2;
},
get SUPPORT_FOREIGNOBJECT_DRAWING() {
var value2 = typeof Array.from === "function" && typeof window.fetch === "function" ? testForeignObject(document) : Promise.resolve(false);
Object.defineProperty(FEATURES, "SUPPORT_FOREIGNOBJECT_DRAWING", { value: value2 });
return value2;
},
get SUPPORT_CORS_IMAGES() {
var value2 = testCORS();
Object.defineProperty(FEATURES, "SUPPORT_CORS_IMAGES", { value: value2 });
return value2;
},
get SUPPORT_RESPONSE_TYPE() {
var value2 = testResponseType();
Object.defineProperty(FEATURES, "SUPPORT_RESPONSE_TYPE", { value: value2 });
return value2;
},
get SUPPORT_CORS_XHR() {
var value2 = "withCredentials" in new XMLHttpRequest();
Object.defineProperty(FEATURES, "SUPPORT_CORS_XHR", { value: value2 });
return value2;
},
get SUPPORT_NATIVE_TEXT_SEGMENTATION() {
var value2 = !!(typeof Intl !== "undefined" && Intl.Segmenter);
Object.defineProperty(FEATURES, "SUPPORT_NATIVE_TEXT_SEGMENTATION", { value: value2 });
return value2;
}
};
var TextBounds = (
/** @class */
function() {
function TextBounds2(text2, bounds2) {
this.text = text2;
this.bounds = bounds2;
}
return TextBounds2;
}()
);
var parseTextBounds = function(context2, value2, styles2, node2) {
var textList = breakText(value2, styles2);
var textBounds = [];
var offset2 = 0;
textList.forEach(function(text2) {
if (styles2.textDecorationLine.length || text2.trim().length > 0) {
if (FEATURES.SUPPORT_RANGE_BOUNDS) {
var clientRects = createRange(node2, offset2, text2.length).getClientRects();
if (clientRects.length > 1) {
var subSegments = segmentGraphemes(text2);
var subOffset_1 = 0;
subSegments.forEach(function(subSegment) {
textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context2, createRange(node2, subOffset_1 + offset2, subSegment.length).getClientRects())));
subOffset_1 += subSegment.length;
});
} else {
textBounds.push(new TextBounds(text2, Bounds.fromDOMRectList(context2, clientRects)));
}
} else {
var replacementNode = node2.splitText(text2.length);
textBounds.push(new TextBounds(text2, getWrapperBounds(context2, node2)));
node2 = replacementNode;
}
} else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {
node2 = node2.splitText(text2.length);
}
offset2 += text2.length;
});
return textBounds;
};
var getWrapperBounds = function(context2, node2) {
var ownerDocument = node2.ownerDocument;
if (ownerDocument) {
var wrapper = ownerDocument.createElement("html2canvaswrapper");
wrapper.appendChild(node2.cloneNode(true));
var parentNode = node2.parentNode;
if (parentNode) {
parentNode.replaceChild(wrapper, node2);
var bounds2 = parseBounds(context2, wrapper);
if (wrapper.firstChild) {
parentNode.replaceChild(wrapper.firstChild, wrapper);
}
return bounds2;
}
}
return Bounds.EMPTY;
};
var createRange = function(node2, offset2, length2) {
var ownerDocument = node2.ownerDocument;
if (!ownerDocument) {
throw new Error("Node has no owner document");
}
var range2 = ownerDocument.createRange();
range2.setStart(node2, offset2);
range2.setEnd(node2, offset2 + length2);
return range2;
};
var segmentGraphemes = function(value2) {
if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
var segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
return Array.from(segmenter.segment(value2)).map(function(segment) {
return segment.segment;
});
}
return splitGraphemes(value2);
};
var segmentWords = function(value2, styles2) {
if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
var segmenter = new Intl.Segmenter(void 0, {
granularity: "word"
});
return Array.from(segmenter.segment(value2)).map(function(segment) {
return segment.segment;
});
}
return breakWords(value2, styles2);
};
var breakText = function(value2, styles2) {
return styles2.letterSpacing !== 0 ? segmentGraphemes(value2) : segmentWords(value2, styles2);
};
var wordSeparators = [32, 160, 4961, 65792, 65793, 4153, 4241];
var breakWords = function(str, styles2) {
var breaker = LineBreaker(str, {
lineBreak: styles2.lineBreak,
wordBreak: styles2.overflowWrap === "break-word" ? "break-word" : styles2.wordBreak
});
var words = [];
var bk2;
var _loop_1 = function() {
if (bk2.value) {
var value2 = bk2.value.slice();
var codePoints = toCodePoints$1(value2);
var word_1 = "";
codePoints.forEach(function(codePoint) {
if (wordSeparators.indexOf(codePoint) === -1) {
word_1 += fromCodePoint$1(codePoint);
} else {
if (word_1.length) {
words.push(word_1);
}
words.push(fromCodePoint$1(codePoint));
word_1 = "";
}
});
if (word_1.length) {
words.push(word_1);
}
}
};
while (!(bk2 = breaker.next()).done) {
_loop_1();
}
return words;
};
var TextContainer = (
/** @class */
function() {
function TextContainer2(context2, node2, styles2) {
this.text = transform(node2.data, styles2.textTransform);
this.textBounds = parseTextBounds(context2, this.text, styles2, node2);
}
return TextContainer2;
}()
);
var transform = function(text2, transform2) {
switch (transform2) {
case 1:
return text2.toLowerCase();
case 3:
return text2.replace(CAPITALIZE, capitalize);
case 2:
return text2.toUpperCase();
default:
return text2;
}
};
var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
var capitalize = function(m2, p1, p2) {
if (m2.length > 0) {
return p1 + p2.toUpperCase();
}
return m2;
};
var ImageElementContainer = (
/** @class */
function(_super) {
__extends(ImageElementContainer2, _super);
function ImageElementContainer2(context2, img) {
var _this = _super.call(this, context2, img) || this;
_this.src = img.currentSrc || img.src;
_this.intrinsicWidth = img.naturalWidth;
_this.intrinsicHeight = img.naturalHeight;
_this.context.cache.addImage(_this.src);
return _this;
}
return ImageElementContainer2;
}(ElementContainer)
);
var CanvasElementContainer = (
/** @class */
function(_super) {
__extends(CanvasElementContainer2, _super);
function CanvasElementContainer2(context2, canvas) {
var _this = _super.call(this, context2, canvas) || this;
_this.canvas = canvas;
_this.intrinsicWidth = canvas.width;
_this.intrinsicHeight = canvas.height;
return _this;
}
return CanvasElementContainer2;
}(ElementContainer)
);
var SVGElementContainer = (
/** @class */
function(_super) {
__extends(SVGElementContainer2, _super);
function SVGElementContainer2(context2, img) {
var _this = _super.call(this, context2, img) || this;
var s2 = new XMLSerializer();
var bounds2 = parseBounds(context2, img);
img.setAttribute("width", bounds2.width + "px");
img.setAttribute("height", bounds2.height + "px");
_this.svg = "data:image/svg+xml," + encodeURIComponent(s2.serializeToString(img));
_this.intrinsicWidth = img.width.baseVal.value;
_this.intrinsicHeight = img.height.baseVal.value;
_this.context.cache.addImage(_this.svg);
return _this;
}
return SVGElementContainer2;
}(ElementContainer)
);
var LIElementContainer = (
/** @class */
function(_super) {
__extends(LIElementContainer2, _super);
function LIElementContainer2(context2, element2) {
var _this = _super.call(this, context2, element2) || this;
_this.value = element2.value;
return _this;
}
return LIElementContainer2;
}(ElementContainer)
);
var OLElementContainer = (
/** @class */
function(_super) {
__extends(OLElementContainer2, _super);
function OLElementContainer2(context2, element2) {
var _this = _super.call(this, context2, element2) || this;
_this.start = element2.start;
_this.reversed = typeof element2.reversed === "boolean" && element2.reversed === true;
return _this;
}
return OLElementContainer2;
}(ElementContainer)
);
var CHECKBOX_BORDER_RADIUS = [
{
type: 15,
flags: 0,
unit: "px",
number: 3
}
];
var RADIO_BORDER_RADIUS = [
{
type: 16,
flags: 0,
number: 50
}
];
var reformatInputBounds = function(bounds2) {
if (bounds2.width > bounds2.height) {
return new Bounds(bounds2.left + (bounds2.width - bounds2.height) / 2, bounds2.top, bounds2.height, bounds2.height);
} else if (bounds2.width < bounds2.height) {
return new Bounds(bounds2.left, bounds2.top + (bounds2.height - bounds2.width) / 2, bounds2.width, bounds2.width);
}
return bounds2;
};
var getInputValue = function(node2) {
var value2 = node2.type === PASSWORD ? new Array(node2.value.length + 1).join("•") : node2.value;
return value2.length === 0 ? node2.placeholder || "" : value2;
};
var CHECKBOX = "checkbox";
var RADIO = "radio";
var PASSWORD = "password";
var INPUT_COLOR = 707406591;
var InputElementContainer = (
/** @class */
function(_super) {
__extends(InputElementContainer2, _super);
function InputElementContainer2(context2, input) {
var _this = _super.call(this, context2, input) || this;
_this.type = input.type.toLowerCase();
_this.checked = input.checked;
_this.value = getInputValue(input);
if (_this.type === CHECKBOX || _this.type === RADIO) {
_this.styles.backgroundColor = 3739148031;
_this.styles.borderTopColor = _this.styles.borderRightColor = _this.styles.borderBottomColor = _this.styles.borderLeftColor = 2779096575;
_this.styles.borderTopWidth = _this.styles.borderRightWidth = _this.styles.borderBottomWidth = _this.styles.borderLeftWidth = 1;
_this.styles.borderTopStyle = _this.styles.borderRightStyle = _this.styles.borderBottomStyle = _this.styles.borderLeftStyle = 1;
_this.styles.backgroundClip = [
0
/* BORDER_BOX */
];
_this.styles.backgroundOrigin = [
0
/* BORDER_BOX */
];
_this.bounds = reformatInputBounds(_this.bounds);
}
switch (_this.type) {
case CHECKBOX:
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
break;
case RADIO:
_this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
break;
}
return _this;
}
return InputElementContainer2;
}(ElementContainer)
);
var SelectElementContainer = (
/** @class */
function(_super) {
__extends(SelectElementContainer2, _super);
function SelectElementContainer2(context2, element2) {
var _this = _super.call(this, context2, element2) || this;
var option = element2.options[element2.selectedIndex || 0];
_this.value = option ? option.text || "" : "";
return _this;
}
return SelectElementContainer2;
}(ElementContainer)
);
var TextareaElementContainer = (
/** @class */
function(_super) {
__extends(TextareaElementContainer2, _super);
function TextareaElementContainer2(context2, element2) {
var _this = _super.call(this, context2, element2) || this;
_this.value = element2.value;
return _this;
}
return TextareaElementContainer2;
}(ElementContainer)
);
var IFrameElementContainer = (
/** @class */
function(_super) {
__extends(IFrameElementContainer2, _super);
function IFrameElementContainer2(context2, iframe) {
var _this = _super.call(this, context2, iframe) || this;
_this.src = iframe.src;
_this.width = parseInt(iframe.width, 10) || 0;
_this.height = parseInt(iframe.height, 10) || 0;
_this.backgroundColor = _this.styles.backgroundColor;
try {
if (iframe.contentWindow && iframe.contentWindow.document && iframe.contentWindow.document.documentElement) {
_this.tree = parseTree(context2, iframe.contentWindow.document.documentElement);
var documentBackgroundColor = iframe.contentWindow.document.documentElement ? parseColor(context2, getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor) : COLORS.TRANSPARENT;
var bodyBackgroundColor = iframe.contentWindow.document.body ? parseColor(context2, getComputedStyle(iframe.contentWindow.document.body).backgroundColor) : COLORS.TRANSPARENT;
_this.backgroundColor = isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? _this.styles.backgroundColor : bodyBackgroundColor : documentBackgroundColor;
}
} catch (e7) {
}
return _this;
}
return IFrameElementContainer2;
}(ElementContainer)
);
var LIST_OWNERS = ["OL", "UL", "MENU"];
var parseNodeTree = function(context2, node2, parent, root2) {
for (var childNode = node2.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
nextNode = childNode.nextSibling;
if (isTextNode(childNode) && childNode.data.trim().length > 0) {
parent.textNodes.push(new TextContainer(context2, childNode, parent.styles));
} else if (isElementNode(childNode)) {
if (isSlotElement(childNode) && childNode.assignedNodes) {
childNode.assignedNodes().forEach(function(childNode2) {
return parseNodeTree(context2, childNode2, parent, root2);
});
} else {
var container = createContainer(context2, childNode);
if (container.styles.isVisible()) {
if (createsRealStackingContext(childNode, container, root2)) {
container.flags |= 4;
} else if (createsStackingContext(container.styles)) {
container.flags |= 2;
}
if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {
container.flags |= 8;
}
parent.elements.push(container);
childNode.slot;
if (childNode.shadowRoot) {
parseNodeTree(context2, childNode.shadowRoot, container, root2);
} else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) {
parseNodeTree(context2, childNode, container, root2);
}
}
}
}
}
};
var createContainer = function(context2, element2) {
if (isImageElement(element2)) {
return new ImageElementContainer(context2, element2);
}
if (isCanvasElement(element2)) {
return new CanvasElementContainer(context2, element2);
}
if (isSVGElement(element2)) {
return new SVGElementContainer(context2, element2);
}
if (isLIElement(element2)) {
return new LIElementContainer(context2, element2);
}
if (isOLElement(element2)) {
return new OLElementContainer(context2, element2);
}
if (isInputElement(element2)) {
return new InputElementContainer(context2, element2);
}
if (isSelectElement(element2)) {
return new SelectElementContainer(context2, element2);
}
if (isTextareaElement(element2)) {
return new TextareaElementContainer(context2, element2);
}
if (isIFrameElement(element2)) {
return new IFrameElementContainer(context2, element2);
}
return new ElementContainer(context2, element2);
};
var parseTree = function(context2, element2) {
var container = createContainer(context2, element2);
container.flags |= 4;
parseNodeTree(context2, element2, container, container);
return container;
};
var createsRealStackingContext = function(node2, container, root2) {
return container.styles.isPositionedWithZIndex() || container.styles.opacity < 1 || container.styles.isTransformed() || isBodyElement(node2) && root2.styles.isTransparent();
};
var createsStackingContext = function(styles2) {
return styles2.isPositioned() || styles2.isFloating();
};
var isTextNode = function(node2) {
return node2.nodeType === Node.TEXT_NODE;
};
var isElementNode = function(node2) {
return node2.nodeType === Node.ELEMENT_NODE;
};
var isHTMLElementNode = function(node2) {
return isElementNode(node2) && typeof node2.style !== "undefined" && !isSVGElementNode(node2);
};
var isSVGElementNode = function(element2) {
return typeof element2.className === "object";
};
var isLIElement = function(node2) {
return node2.tagName === "LI";
};
var isOLElement = function(node2) {
return node2.tagName === "OL";
};
var isInputElement = function(node2) {
return node2.tagName === "INPUT";
};
var isHTMLElement = function(node2) {
return node2.tagName === "HTML";
};
var isSVGElement = function(node2) {
return node2.tagName === "svg";
};
var isBodyElement = function(node2) {
return node2.tagName === "BODY";
};
var isCanvasElement = function(node2) {
return node2.tagName === "CANVAS";
};
var isVideoElement = function(node2) {
return node2.tagName === "VIDEO";
};
var isImageElement = function(node2) {
return node2.tagName === "IMG";
};
var isIFrameElement = function(node2) {
return node2.tagName === "IFRAME";
};
var isStyleElement = function(node2) {
return node2.tagName === "STYLE";
};
var isScriptElement = function(node2) {
return node2.tagName === "SCRIPT";
};
var isTextareaElement = function(node2) {
return node2.tagName === "TEXTAREA";
};
var isSelectElement = function(node2) {
return node2.tagName === "SELECT";
};
var isSlotElement = function(node2) {
return node2.tagName === "SLOT";
};
var isCustomElement = function(node2) {
return node2.tagName.indexOf("-") > 0;
};
var CounterState = (
/** @class */
function() {
function CounterState2() {
this.counters = {};
}
CounterState2.prototype.getCounterValue = function(name) {
var counter2 = this.counters[name];
if (counter2 && counter2.length) {
return counter2[counter2.length - 1];
}
return 1;
};
CounterState2.prototype.getCounterValues = function(name) {
var counter2 = this.counters[name];
return counter2 ? counter2 : [];
};
CounterState2.prototype.pop = function(counters) {
var _this = this;
counters.forEach(function(counter2) {
return _this.counters[counter2].pop();
});
};
CounterState2.prototype.parse = function(style2) {
var _this = this;
var counterIncrement2 = style2.counterIncrement;
var counterReset2 = style2.counterReset;
var canReset = true;
if (counterIncrement2 !== null) {
counterIncrement2.forEach(function(entry2) {
var counter2 = _this.counters[entry2.counter];
if (counter2 && entry2.increment !== 0) {
canReset = false;
if (!counter2.length) {
counter2.push(1);
}
counter2[Math.max(0, counter2.length - 1)] += entry2.increment;
}
});
}
var counterNames = [];
if (canReset) {
counterReset2.forEach(function(entry2) {
var counter2 = _this.counters[entry2.counter];
counterNames.push(entry2.counter);
if (!counter2) {
counter2 = _this.counters[entry2.counter] = [];
}
counter2.push(entry2.reset);
});
}
return counterNames;
};
return CounterState2;
}()
);
var ROMAN_UPPER = {
integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
};
var ARMENIAN = {
integers: [
9e3,
8e3,
7e3,
6e3,
5e3,
4e3,
3e3,
2e3,
1e3,
900,
800,
700,
600,
500,
400,
300,
200,
100,
90,
80,
70,
60,
50,
40,
30,
20,
10,
9,
8,
7,
6,
5,
4,
3,
2,
1
],
values: [
"Ք",
"Փ",
"Ւ",
"Ց",
"Ր",
"Տ",
"Վ",
"Ս",
"Ռ",
"Ջ",
"Պ",
"Չ",
"Ո",
"Շ",
"Ն",
"Յ",
"Մ",
"Ճ",
"Ղ",
"Ձ",
"Հ",
"Կ",
"Ծ",
"Խ",
"Լ",
"Ի",
"Ժ",
"Թ",
"Ը",
"Է",
"Զ",
"Ե",
"Դ",
"Գ",
"Բ",
"Ա"
]
};
var HEBREW = {
integers: [
1e4,
9e3,
8e3,
7e3,
6e3,
5e3,
4e3,
3e3,
2e3,
1e3,
400,
300,
200,
100,
90,
80,
70,
60,
50,
40,
30,
20,
19,
18,
17,
16,
15,
10,
9,
8,
7,
6,
5,
4,
3,
2,
1
],
values: [
"י׳",
"ט׳",
"ח׳",
"ז׳",
"ו׳",
"ה׳",
"ד׳",
"ג׳",
"ב׳",
"א׳",
"ת",
"ש",
"ר",
"ק",
"צ",
"פ",
"ע",
"ס",
"נ",
"מ",
"ל",
"כ",
"יט",
"יח",
"יז",
"טז",
"טו",
"י",
"ט",
"ח",
"ז",
"ו",
"ה",
"ד",
"ג",
"ב",
"א"
]
};
var GEORGIAN = {
integers: [
1e4,
9e3,
8e3,
7e3,
6e3,
5e3,
4e3,
3e3,
2e3,
1e3,
900,
800,
700,
600,
500,
400,
300,
200,
100,
90,
80,
70,
60,
50,
40,
30,
20,
10,
9,
8,
7,
6,
5,
4,
3,
2,
1
],
values: [
"ჵ",
"ჰ",
"ჯ",
"ჴ",
"ხ",
"ჭ",
"წ",
"ძ",
"ც",
"ჩ",
"შ",
"ყ",
"ღ",
"ქ",
"ფ",
"ჳ",
"ტ",
"ს",
"რ",
"ჟ",
"პ",
"ო",
"ჲ",
"ნ",
"მ",
"ლ",
"კ",
"ი",
"თ",
"ჱ",
"ზ",
"ვ",
"ე",
"დ",
"გ",
"ბ",
"ა"
]
};
var createAdditiveCounter = function(value2, min2, max2, symbols2, fallback2, suffix2) {
if (value2 < min2 || value2 > max2) {
return createCounterText(value2, fallback2, suffix2.length > 0);
}
return symbols2.integers.reduce(function(string2, integer, index2) {
while (value2 >= integer) {
value2 -= integer;
string2 += symbols2.values[index2];
}
return string2;
}, "") + suffix2;
};
var createCounterStyleWithSymbolResolver = function(value2, codePointRangeLength, isNumeric, resolver) {
var string2 = "";
do {
if (!isNumeric) {
value2--;
}
string2 = resolver(value2) + string2;
value2 /= codePointRangeLength;
} while (value2 * codePointRangeLength >= codePointRangeLength);
return string2;
};
var createCounterStyleFromRange = function(value2, codePointRangeStart, codePointRangeEnd, isNumeric, suffix2) {
var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
return (value2 < 0 ? "-" : "") + (createCounterStyleWithSymbolResolver(Math.abs(value2), codePointRangeLength, isNumeric, function(codePoint) {
return fromCodePoint$1(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
}) + suffix2);
};
var createCounterStyleFromSymbols = function(value2, symbols2, suffix2) {
if (suffix2 === void 0) {
suffix2 = ". ";
}
var codePointRangeLength = symbols2.length;
return createCounterStyleWithSymbolResolver(Math.abs(value2), codePointRangeLength, false, function(codePoint) {
return symbols2[Math.floor(codePoint % codePointRangeLength)];
}) + suffix2;
};
var CJK_ZEROS = 1 << 0;
var CJK_TEN_COEFFICIENTS = 1 << 1;
var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
var createCJKCounter = function(value2, numbers2, multipliers, negativeSign, suffix2, flags) {
if (value2 < -9999 || value2 > 9999) {
return createCounterText(value2, 4, suffix2.length > 0);
}
var tmp = Math.abs(value2);
var string2 = suffix2;
if (tmp === 0) {
return numbers2[0] + string2;
}
for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
var coefficient = tmp % 10;
if (coefficient === 0 && contains(flags, CJK_ZEROS) && string2 !== "") {
string2 = numbers2[coefficient] + string2;
} else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value2 > 100 || coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS)) {
string2 = numbers2[coefficient] + (digit > 0 ? multipliers[digit - 1] : "") + string2;
} else if (coefficient === 1 && digit > 0) {
string2 = multipliers[digit - 1] + string2;
}
tmp = Math.floor(tmp / 10);
}
return (value2 < 0 ? negativeSign : "") + string2;
};
var CHINESE_INFORMAL_MULTIPLIERS = "十百千萬";
var CHINESE_FORMAL_MULTIPLIERS = "拾佰仟萬";
var JAPANESE_NEGATIVE = "マイナス";
var KOREAN_NEGATIVE = "마이너스";
var createCounterText = function(value2, type2, appendSuffix) {
var defaultSuffix = appendSuffix ? ". " : "";
var cjkSuffix = appendSuffix ? "、" : "";
var koreanSuffix = appendSuffix ? ", " : "";
var spaceSuffix = appendSuffix ? " " : "";
switch (type2) {
case 0:
return "•" + spaceSuffix;
case 1:
return "◦" + spaceSuffix;
case 2:
return "◾" + spaceSuffix;
case 5:
var string2 = createCounterStyleFromRange(value2, 48, 57, true, defaultSuffix);
return string2.length < 4 ? "0" + string2 : string2;
case 4:
return createCounterStyleFromSymbols(value2, "〇一二三四五六七八九", cjkSuffix);
case 6:
return createAdditiveCounter(value2, 1, 3999, ROMAN_UPPER, 3, defaultSuffix).toLowerCase();
case 7:
return createAdditiveCounter(value2, 1, 3999, ROMAN_UPPER, 3, defaultSuffix);
case 8:
return createCounterStyleFromRange(value2, 945, 969, false, defaultSuffix);
case 9:
return createCounterStyleFromRange(value2, 97, 122, false, defaultSuffix);
case 10:
return createCounterStyleFromRange(value2, 65, 90, false, defaultSuffix);
case 11:
return createCounterStyleFromRange(value2, 1632, 1641, true, defaultSuffix);
case 12:
case 49:
return createAdditiveCounter(value2, 1, 9999, ARMENIAN, 3, defaultSuffix);
case 35:
return createAdditiveCounter(value2, 1, 9999, ARMENIAN, 3, defaultSuffix).toLowerCase();
case 13:
return createCounterStyleFromRange(value2, 2534, 2543, true, defaultSuffix);
case 14:
case 30:
return createCounterStyleFromRange(value2, 6112, 6121, true, defaultSuffix);
case 15:
return createCounterStyleFromSymbols(value2, "子丑寅卯辰巳午未申酉戌亥", cjkSuffix);
case 16:
return createCounterStyleFromSymbols(value2, "甲乙丙丁戊己庚辛壬癸", cjkSuffix);
case 17:
case 48:
return createCJKCounter(value2, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "負", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
case 47:
return createCJKCounter(value2, "零壹貳參肆伍陸柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "負", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
case 42:
return createCJKCounter(value2, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "负", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
case 41:
return createCJKCounter(value2, "零壹贰叁肆伍陆柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "负", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
case 26:
return createCJKCounter(value2, "〇一二三四五六七八九", "十百千万", JAPANESE_NEGATIVE, cjkSuffix, 0);
case 25:
return createCJKCounter(value2, "零壱弐参四伍六七八九", "拾百千万", JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
case 31:
return createCJKCounter(value2, "영일이삼사오육칠팔구", "십백천만", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
case 33:
return createCJKCounter(value2, "零一二三四五六七八九", "十百千萬", KOREAN_NEGATIVE, koreanSuffix, 0);
case 32:
return createCJKCounter(value2, "零壹貳參四五六七八九", "拾百千", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
case 18:
return createCounterStyleFromRange(value2, 2406, 2415, true, defaultSuffix);
case 20:
return createAdditiveCounter(value2, 1, 19999, GEORGIAN, 3, defaultSuffix);
case 21:
return createCounterStyleFromRange(value2, 2790, 2799, true, defaultSuffix);
case 22:
return createCounterStyleFromRange(value2, 2662, 2671, true, defaultSuffix);
case 22:
return createAdditiveCounter(value2, 1, 10999, HEBREW, 3, defaultSuffix);
case 23:
return createCounterStyleFromSymbols(value2, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");
case 24:
return createCounterStyleFromSymbols(value2, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");
case 27:
return createCounterStyleFromRange(value2, 3302, 3311, true, defaultSuffix);
case 28:
return createCounterStyleFromSymbols(value2, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン", cjkSuffix);
case 29:
return createCounterStyleFromSymbols(value2, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス", cjkSuffix);
case 34:
return createCounterStyleFromRange(value2, 3792, 3801, true, defaultSuffix);
case 37:
return createCounterStyleFromRange(value2, 6160, 6169, true, defaultSuffix);
case 38:
return createCounterStyleFromRange(value2, 4160, 4169, true, defaultSuffix);
case 39:
return createCounterStyleFromRange(value2, 2918, 2927, true, defaultSuffix);
case 40:
return createCounterStyleFromRange(value2, 1776, 1785, true, defaultSuffix);
case 43:
return createCounterStyleFromRange(value2, 3046, 3055, true, defaultSuffix);
case 44:
return createCounterStyleFromRange(value2, 3174, 3183, true, defaultSuffix);
case 45:
return createCounterStyleFromRange(value2, 3664, 3673, true, defaultSuffix);
case 46:
return createCounterStyleFromRange(value2, 3872, 3881, true, defaultSuffix);
case 3:
default:
return createCounterStyleFromRange(value2, 48, 57, true, defaultSuffix);
}
};
var IGNORE_ATTRIBUTE = "data-html2canvas-ignore";
var DocumentCloner = (
/** @class */
function() {
function DocumentCloner2(context2, element2, options2) {
this.context = context2;
this.options = options2;
this.scrolledElements = [];
this.referenceElement = element2;
this.counters = new CounterState();
this.quoteDepth = 0;
if (!element2.ownerDocument) {
throw new Error("Cloned element does not have an owner document");
}
this.documentElement = this.cloneNode(element2.ownerDocument.documentElement, false);
}
DocumentCloner2.prototype.toIFrame = function(ownerDocument, windowSize2) {
var _this = this;
var iframe = createIFrameContainer(ownerDocument, windowSize2);
if (!iframe.contentWindow) {
return Promise.reject("Unable to find iframe window");
}
var scrollX = ownerDocument.defaultView.pageXOffset;
var scrollY = ownerDocument.defaultView.pageYOffset;
var cloneWindow = iframe.contentWindow;
var documentClone = cloneWindow.document;
var iframeLoad = iframeLoader(iframe).then(function() {
return __awaiter(_this, void 0, void 0, function() {
var onclone, referenceElement;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
this.scrolledElements.forEach(restoreNodeScroll);
if (cloneWindow) {
cloneWindow.scrollTo(windowSize2.left, windowSize2.top);
if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== windowSize2.top || cloneWindow.scrollX !== windowSize2.left)) {
this.context.logger.warn("Unable to restore scroll position for cloned document");
this.context.windowBounds = this.context.windowBounds.add(cloneWindow.scrollX - windowSize2.left, cloneWindow.scrollY - windowSize2.top, 0, 0);
}
}
onclone = this.options.onclone;
referenceElement = this.clonedReferenceElement;
if (typeof referenceElement === "undefined") {
return [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")];
}
if (!(documentClone.fonts && documentClone.fonts.ready))
return [3, 2];
return [4, documentClone.fonts.ready];
case 1:
_a2.sent();
_a2.label = 2;
case 2:
if (!/(AppleWebKit)/g.test(navigator.userAgent))
return [3, 4];
return [4, imagesReady(documentClone)];
case 3:
_a2.sent();
_a2.label = 4;
case 4:
if (typeof onclone === "function") {
return [2, Promise.resolve().then(function() {
return onclone(documentClone, referenceElement);
}).then(function() {
return iframe;
})];
}
return [2, iframe];
}
});
});
});
documentClone.open();
documentClone.write(serializeDoctype(document.doctype) + "<html></html>");
restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);
documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);
documentClone.close();
return iframeLoad;
};
DocumentCloner2.prototype.createElementClone = function(node2) {
if (isDebugging(
node2,
2
/* CLONE */
)) {
debugger;
}
if (isCanvasElement(node2)) {
return this.createCanvasClone(node2);
}
if (isVideoElement(node2)) {
return this.createVideoClone(node2);
}
if (isStyleElement(node2)) {
return this.createStyleClone(node2);
}
var clone2 = node2.cloneNode(false);
if (isImageElement(clone2)) {
if (isImageElement(node2) && node2.currentSrc && node2.currentSrc !== node2.src) {
clone2.src = node2.currentSrc;
clone2.srcset = "";
}
if (clone2.loading === "lazy") {
clone2.loading = "eager";
}
}
if (isCustomElement(clone2)) {
return this.createCustomElementClone(clone2);
}
return clone2;
};
DocumentCloner2.prototype.createCustomElementClone = function(node2) {
var clone2 = document.createElement("html2canvascustomelement");
copyCSSStyles(node2.style, clone2);
return clone2;
};
DocumentCloner2.prototype.createStyleClone = function(node2) {
try {
var sheet = node2.sheet;
if (sheet && sheet.cssRules) {
var css4 = [].slice.call(sheet.cssRules, 0).reduce(function(css5, rule2) {
if (rule2 && typeof rule2.cssText === "string") {
return css5 + rule2.cssText;
}
return css5;
}, "");
var style2 = node2.cloneNode(false);
style2.textContent = css4;
return style2;
}
} catch (e7) {
this.context.logger.error("Unable to access cssRules property", e7);
if (e7.name !== "SecurityError") {
throw e7;
}
}
return node2.cloneNode(false);
};
DocumentCloner2.prototype.createCanvasClone = function(canvas) {
var _a2;
if (this.options.inlineImages && canvas.ownerDocument) {
var img = canvas.ownerDocument.createElement("img");
try {
img.src = canvas.toDataURL();
return img;
} catch (e7) {
this.context.logger.info("Unable to inline canvas contents, canvas is tainted", canvas);
}
}
var clonedCanvas = canvas.cloneNode(false);
try {
clonedCanvas.width = canvas.width;
clonedCanvas.height = canvas.height;
var ctx = canvas.getContext("2d");
var clonedCtx = clonedCanvas.getContext("2d");
if (clonedCtx) {
if (!this.options.allowTaint && ctx) {
clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
} else {
var gl = (_a2 = canvas.getContext("webgl2")) !== null && _a2 !== void 0 ? _a2 : canvas.getContext("webgl");
if (gl) {
var attribs = gl.getContextAttributes();
if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) {
this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
}
}
clonedCtx.drawImage(canvas, 0, 0);
}
}
return clonedCanvas;
} catch (e7) {
this.context.logger.info("Unable to clone canvas as it is tainted", canvas);
}
return clonedCanvas;
};
DocumentCloner2.prototype.createVideoClone = function(video) {
var canvas = video.ownerDocument.createElement("canvas");
canvas.width = video.offsetWidth;
canvas.height = video.offsetHeight;
var ctx = canvas.getContext("2d");
try {
if (ctx) {
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
if (!this.options.allowTaint) {
ctx.getImageData(0, 0, canvas.width, canvas.height);
}
}
return canvas;
} catch (e7) {
this.context.logger.info("Unable to clone video as it is tainted", video);
}
var blankCanvas = video.ownerDocument.createElement("canvas");
blankCanvas.width = video.offsetWidth;
blankCanvas.height = video.offsetHeight;
return blankCanvas;
};
DocumentCloner2.prototype.appendChildNode = function(clone2, child, copyStyles) {
if (!isElementNode(child) || !isScriptElement(child) && !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== "function" || !this.options.ignoreElements(child))) {
if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {
clone2.appendChild(this.cloneNode(child, copyStyles));
}
}
};
DocumentCloner2.prototype.cloneChildNodes = function(node2, clone2, copyStyles) {
var _this = this;
for (var child = node2.shadowRoot ? node2.shadowRoot.firstChild : node2.firstChild; child; child = child.nextSibling) {
if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === "function") {
var assignedNodes = child.assignedNodes();
if (assignedNodes.length) {
assignedNodes.forEach(function(assignedNode) {
return _this.appendChildNode(clone2, assignedNode, copyStyles);
});
}
} else {
this.appendChildNode(clone2, child, copyStyles);
}
}
};
DocumentCloner2.prototype.cloneNode = function(node2, copyStyles) {
if (isTextNode(node2)) {
return document.createTextNode(node2.data);
}
if (!node2.ownerDocument) {
return node2.cloneNode(false);
}
var window2 = node2.ownerDocument.defaultView;
if (window2 && isElementNode(node2) && (isHTMLElementNode(node2) || isSVGElementNode(node2))) {
var clone2 = this.createElementClone(node2);
clone2.style.transitionProperty = "none";
var style2 = window2.getComputedStyle(node2);
var styleBefore = window2.getComputedStyle(node2, ":before");
var styleAfter = window2.getComputedStyle(node2, ":after");
if (this.referenceElement === node2 && isHTMLElementNode(clone2)) {
this.clonedReferenceElement = clone2;
}
if (isBodyElement(clone2)) {
createPseudoHideStyles(clone2);
}
var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style2));
var before = this.resolvePseudoContent(node2, clone2, styleBefore, PseudoElementType.BEFORE);
if (isCustomElement(node2)) {
copyStyles = true;
}
if (!isVideoElement(node2)) {
this.cloneChildNodes(node2, clone2, copyStyles);
}
if (before) {
clone2.insertBefore(before, clone2.firstChild);
}
var after = this.resolvePseudoContent(node2, clone2, styleAfter, PseudoElementType.AFTER);
if (after) {
clone2.appendChild(after);
}
this.counters.pop(counters);
if (style2 && (this.options.copyStyles || isSVGElementNode(node2)) && !isIFrameElement(node2) || copyStyles) {
copyCSSStyles(style2, clone2);
}
if (node2.scrollTop !== 0 || node2.scrollLeft !== 0) {
this.scrolledElements.push([clone2, node2.scrollLeft, node2.scrollTop]);
}
if ((isTextareaElement(node2) || isSelectElement(node2)) && (isTextareaElement(clone2) || isSelectElement(clone2))) {
clone2.value = node2.value;
}
return clone2;
}
return node2.cloneNode(false);
};
DocumentCloner2.prototype.resolvePseudoContent = function(node2, clone2, style2, pseudoElt) {
var _this = this;
if (!style2) {
return;
}
var value2 = style2.content;
var document2 = clone2.ownerDocument;
if (!document2 || !value2 || value2 === "none" || value2 === "-moz-alt-content" || style2.display === "none") {
return;
}
this.counters.parse(new CSSParsedCounterDeclaration(this.context, style2));
var declaration2 = new CSSParsedPseudoDeclaration(this.context, style2);
var anonymousReplacedElement = document2.createElement("html2canvaspseudoelement");
copyCSSStyles(style2, anonymousReplacedElement);
declaration2.content.forEach(function(token2) {
if (token2.type === 0) {
anonymousReplacedElement.appendChild(document2.createTextNode(token2.value));
} else if (token2.type === 22) {
var img = document2.createElement("img");
img.src = token2.value;
img.style.opacity = "1";
anonymousReplacedElement.appendChild(img);
} else if (token2.type === 18) {
if (token2.name === "attr") {
var attr2 = token2.values.filter(isIdentToken);
if (attr2.length) {
anonymousReplacedElement.appendChild(document2.createTextNode(node2.getAttribute(attr2[0].value) || ""));
}
} else if (token2.name === "counter") {
var _a2 = token2.values.filter(nonFunctionArgSeparator), counter2 = _a2[0], counterStyle = _a2[1];
if (counter2 && isIdentToken(counter2)) {
var counterState = _this.counters.getCounterValue(counter2.value);
var counterType = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
anonymousReplacedElement.appendChild(document2.createTextNode(createCounterText(counterState, counterType, false)));
}
} else if (token2.name === "counters") {
var _b2 = token2.values.filter(nonFunctionArgSeparator), counter2 = _b2[0], delim = _b2[1], counterStyle = _b2[2];
if (counter2 && isIdentToken(counter2)) {
var counterStates = _this.counters.getCounterValues(counter2.value);
var counterType_1 = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
var separator = delim && delim.type === 0 ? delim.value : "";
var text2 = counterStates.map(function(value3) {
return createCounterText(value3, counterType_1, false);
}).join(separator);
anonymousReplacedElement.appendChild(document2.createTextNode(text2));
}
} else
;
} else if (token2.type === 20) {
switch (token2.value) {
case "open-quote":
anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration2.quotes, _this.quoteDepth++, true)));
break;
case "close-quote":
anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration2.quotes, --_this.quoteDepth, false)));
break;
default:
anonymousReplacedElement.appendChild(document2.createTextNode(token2.value));
}
}
});
anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
var newClassName = pseudoElt === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
if (isSVGElementNode(clone2)) {
clone2.className.baseValue += newClassName;
} else {
clone2.className += newClassName;
}
return anonymousReplacedElement;
};
DocumentCloner2.destroy = function(container) {
if (container.parentNode) {
container.parentNode.removeChild(container);
return true;
}
return false;
};
return DocumentCloner2;
}()
);
var PseudoElementType;
(function(PseudoElementType2) {
PseudoElementType2[PseudoElementType2["BEFORE"] = 0] = "BEFORE";
PseudoElementType2[PseudoElementType2["AFTER"] = 1] = "AFTER";
})(PseudoElementType || (PseudoElementType = {}));
var createIFrameContainer = function(ownerDocument, bounds2) {
var cloneIframeContainer = ownerDocument.createElement("iframe");
cloneIframeContainer.className = "html2canvas-container";
cloneIframeContainer.style.visibility = "hidden";
cloneIframeContainer.style.position = "fixed";
cloneIframeContainer.style.left = "-10000px";
cloneIframeContainer.style.top = "0px";
cloneIframeContainer.style.border = "0";
cloneIframeContainer.width = bounds2.width.toString();
cloneIframeContainer.height = bounds2.height.toString();
cloneIframeContainer.scrolling = "no";
cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, "true");
ownerDocument.body.appendChild(cloneIframeContainer);
return cloneIframeContainer;
};
var imageReady = function(img) {
return new Promise(function(resolve3) {
if (img.complete) {
resolve3();
return;
}
if (!img.src) {
resolve3();
return;
}
img.onload = resolve3;
img.onerror = resolve3;
});
};
var imagesReady = function(document2) {
return Promise.all([].slice.call(document2.images, 0).map(imageReady));
};
var iframeLoader = function(iframe) {
return new Promise(function(resolve3, reject2) {
var cloneWindow = iframe.contentWindow;
if (!cloneWindow) {
return reject2("No window assigned for iframe");
}
var documentClone = cloneWindow.document;
cloneWindow.onload = iframe.onload = function() {
cloneWindow.onload = iframe.onload = null;
var interval2 = setInterval(function() {
if (documentClone.body.childNodes.length > 0 && documentClone.readyState === "complete") {
clearInterval(interval2);
resolve3(iframe);
}
}, 50);
};
});
};
var ignoredStyleProperties = [
"all",
"d",
"content"
// Safari shows pseudoelements if content is set
];
var copyCSSStyles = function(style2, target2) {
for (var i2 = style2.length - 1; i2 >= 0; i2--) {
var property2 = style2.item(i2);
if (ignoredStyleProperties.indexOf(property2) === -1) {
target2.style.setProperty(property2, style2.getPropertyValue(property2));
}
}
return target2;
};
var serializeDoctype = function(doctype) {
var str = "";
if (doctype) {
str += "<!DOCTYPE ";
if (doctype.name) {
str += doctype.name;
}
if (doctype.internalSubset) {
str += doctype.internalSubset;
}
if (doctype.publicId) {
str += '"' + doctype.publicId + '"';
}
if (doctype.systemId) {
str += '"' + doctype.systemId + '"';
}
str += ">";
}
return str;
};
var restoreOwnerScroll = function(ownerDocument, x2, y2) {
if (ownerDocument && ownerDocument.defaultView && (x2 !== ownerDocument.defaultView.pageXOffset || y2 !== ownerDocument.defaultView.pageYOffset)) {
ownerDocument.defaultView.scrollTo(x2, y2);
}
};
var restoreNodeScroll = function(_a2) {
var element2 = _a2[0], x2 = _a2[1], y2 = _a2[2];
element2.scrollLeft = x2;
element2.scrollTop = y2;
};
var PSEUDO_BEFORE = ":before";
var PSEUDO_AFTER = ":after";
var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before";
var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after";
var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}';
var createPseudoHideStyles = function(body) {
createStyles(body, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
};
var createStyles = function(body, styles2) {
var document2 = body.ownerDocument;
if (document2) {
var style2 = document2.createElement("style");
style2.textContent = styles2;
body.appendChild(style2);
}
};
var CacheStorage = (
/** @class */
function() {
function CacheStorage2() {
}
CacheStorage2.getOrigin = function(url2) {
var link2 = CacheStorage2._link;
if (!link2) {
return "about:blank";
}
link2.href = url2;
link2.href = link2.href;
return link2.protocol + link2.hostname + link2.port;
};
CacheStorage2.isSameOrigin = function(src) {
return CacheStorage2.getOrigin(src) === CacheStorage2._origin;
};
CacheStorage2.setContext = function(window2) {
CacheStorage2._link = window2.document.createElement("a");
CacheStorage2._origin = CacheStorage2.getOrigin(window2.location.href);
};
CacheStorage2._origin = "about:blank";
return CacheStorage2;
}()
);
var Cache = (
/** @class */
function() {
function Cache2(context2, _options) {
this.context = context2;
this._options = _options;
this._cache = {};
}
Cache2.prototype.addImage = function(src) {
var result = Promise.resolve();
if (this.has(src)) {
return result;
}
if (isBlobImage(src) || isRenderable(src)) {
(this._cache[src] = this.loadImage(src)).catch(function() {
});
return result;
}
return result;
};
Cache2.prototype.match = function(src) {
return this._cache[src];
};
Cache2.prototype.loadImage = function(key2) {
return __awaiter(this, void 0, void 0, function() {
var isSameOrigin, useCORS, useProxy, src;
var _this = this;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
isSameOrigin = CacheStorage.isSameOrigin(key2);
useCORS = !isInlineImage(key2) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;
useProxy = !isInlineImage(key2) && !isSameOrigin && !isBlobImage(key2) && typeof this._options.proxy === "string" && FEATURES.SUPPORT_CORS_XHR && !useCORS;
if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key2) && !isBlobImage(key2) && !useProxy && !useCORS) {
return [
2
/*return*/
];
}
src = key2;
if (!useProxy)
return [3, 2];
return [4, this.proxy(src)];
case 1:
src = _a2.sent();
_a2.label = 2;
case 2:
this.context.logger.debug("Added image " + key2.substring(0, 256));
return [4, new Promise(function(resolve3, reject2) {
var img = new Image();
img.onload = function() {
return resolve3(img);
};
img.onerror = reject2;
if (isInlineBase64Image(src) || useCORS) {
img.crossOrigin = "anonymous";
}
img.src = src;
if (img.complete === true) {
setTimeout(function() {
return resolve3(img);
}, 500);
}
if (_this._options.imageTimeout > 0) {
setTimeout(function() {
return reject2("Timed out (" + _this._options.imageTimeout + "ms) loading image");
}, _this._options.imageTimeout);
}
})];
case 3:
return [2, _a2.sent()];
}
});
});
};
Cache2.prototype.has = function(key2) {
return typeof this._cache[key2] !== "undefined";
};
Cache2.prototype.keys = function() {
return Promise.resolve(Object.keys(this._cache));
};
Cache2.prototype.proxy = function(src) {
var _this = this;
var proxy = this._options.proxy;
if (!proxy) {
throw new Error("No proxy defined");
}
var key2 = src.substring(0, 256);
return new Promise(function(resolve3, reject2) {
var responseType2 = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
var xhr = new XMLHttpRequest();
xhr.onload = function() {
if (xhr.status === 200) {
if (responseType2 === "text") {
resolve3(xhr.response);
} else {
var reader_1 = new FileReader();
reader_1.addEventListener("load", function() {
return resolve3(reader_1.result);
}, false);
reader_1.addEventListener("error", function(e7) {
return reject2(e7);
}, false);
reader_1.readAsDataURL(xhr.response);
}
} else {
reject2("Failed to proxy resource " + key2 + " with status code " + xhr.status);
}
};
xhr.onerror = reject2;
var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
xhr.open("GET", "" + proxy + queryString + "url=" + encodeURIComponent(src) + "&responseType=" + responseType2);
if (responseType2 !== "text" && xhr instanceof XMLHttpRequest) {
xhr.responseType = responseType2;
}
if (_this._options.imageTimeout) {
var timeout_1 = _this._options.imageTimeout;
xhr.timeout = timeout_1;
xhr.ontimeout = function() {
return reject2("Timed out (" + timeout_1 + "ms) proxying " + key2);
};
}
xhr.send();
});
};
return Cache2;
}()
);
var INLINE_SVG = /^data:image\/svg\+xml/i;
var INLINE_BASE64 = /^data:image\/.*;base64,/i;
var INLINE_IMG = /^data:image\/.*/i;
var isRenderable = function(src) {
return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);
};
var isInlineImage = function(src) {
return INLINE_IMG.test(src);
};
var isInlineBase64Image = function(src) {
return INLINE_BASE64.test(src);
};
var isBlobImage = function(src) {
return src.substr(0, 4) === "blob";
};
var isSVG = function(src) {
return src.substr(-3).toLowerCase() === "svg" || INLINE_SVG.test(src);
};
var Vector = (
/** @class */
function() {
function Vector2(x2, y2) {
this.type = 0;
this.x = x2;
this.y = y2;
}
Vector2.prototype.add = function(deltaX, deltaY) {
return new Vector2(this.x + deltaX, this.y + deltaY);
};
return Vector2;
}()
);
var lerp = function(a2, b2, t5) {
return new Vector(a2.x + (b2.x - a2.x) * t5, a2.y + (b2.y - a2.y) * t5);
};
var BezierCurve = (
/** @class */
function() {
function BezierCurve2(start2, startControl, endControl, end2) {
this.type = 1;
this.start = start2;
this.startControl = startControl;
this.endControl = endControl;
this.end = end2;
}
BezierCurve2.prototype.subdivide = function(t5, firstHalf) {
var ab2 = lerp(this.start, this.startControl, t5);
var bc2 = lerp(this.startControl, this.endControl, t5);
var cd2 = lerp(this.endControl, this.end, t5);
var abbc = lerp(ab2, bc2, t5);
var bccd = lerp(bc2, cd2, t5);
var dest = lerp(abbc, bccd, t5);
return firstHalf ? new BezierCurve2(this.start, ab2, abbc, dest) : new BezierCurve2(dest, bccd, cd2, this.end);
};
BezierCurve2.prototype.add = function(deltaX, deltaY) {
return new BezierCurve2(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY));
};
BezierCurve2.prototype.reverse = function() {
return new BezierCurve2(this.end, this.endControl, this.startControl, this.start);
};
return BezierCurve2;
}()
);
var isBezierCurve = function(path2) {
return path2.type === 1;
};
var BoundCurves = (
/** @class */
function() {
function BoundCurves2(element2) {
var styles2 = element2.styles;
var bounds2 = element2.bounds;
var _a2 = getAbsoluteValueForTuple(styles2.borderTopLeftRadius, bounds2.width, bounds2.height), tlh = _a2[0], tlv = _a2[1];
var _b2 = getAbsoluteValueForTuple(styles2.borderTopRightRadius, bounds2.width, bounds2.height), trh = _b2[0], trv = _b2[1];
var _c2 = getAbsoluteValueForTuple(styles2.borderBottomRightRadius, bounds2.width, bounds2.height), brh = _c2[0], brv = _c2[1];
var _d = getAbsoluteValueForTuple(styles2.borderBottomLeftRadius, bounds2.width, bounds2.height), blh = _d[0], blv = _d[1];
var factors = [];
factors.push((tlh + trh) / bounds2.width);
factors.push((blh + brh) / bounds2.width);
factors.push((tlv + blv) / bounds2.height);
factors.push((trv + brv) / bounds2.height);
var maxFactor = Math.max.apply(Math, factors);
if (maxFactor > 1) {
tlh /= maxFactor;
tlv /= maxFactor;
trh /= maxFactor;
trv /= maxFactor;
brh /= maxFactor;
brv /= maxFactor;
blh /= maxFactor;
blv /= maxFactor;
}
var topWidth = bounds2.width - trh;
var rightHeight = bounds2.height - brv;
var bottomWidth = bounds2.width - brh;
var leftHeight = bounds2.height - blv;
var borderTopWidth2 = styles2.borderTopWidth;
var borderRightWidth2 = styles2.borderRightWidth;
var borderBottomWidth2 = styles2.borderBottomWidth;
var borderLeftWidth2 = styles2.borderLeftWidth;
var paddingTop2 = getAbsoluteValue(styles2.paddingTop, element2.bounds.width);
var paddingRight2 = getAbsoluteValue(styles2.paddingRight, element2.bounds.width);
var paddingBottom2 = getAbsoluteValue(styles2.paddingBottom, element2.bounds.width);
var paddingLeft2 = getAbsoluteValue(styles2.paddingLeft, element2.bounds.width);
this.topLeftBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 / 3, bounds2.top + borderTopWidth2 / 3, tlh - borderLeftWidth2 / 3, tlv - borderTopWidth2 / 3, CORNER.TOP_LEFT) : new Vector(bounds2.left + borderLeftWidth2 / 3, bounds2.top + borderTopWidth2 / 3);
this.topRightBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + topWidth, bounds2.top + borderTopWidth2 / 3, trh - borderRightWidth2 / 3, trv - borderTopWidth2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2 / 3, bounds2.top + borderTopWidth2 / 3);
this.bottomRightBorderDoubleOuterBox = brh > 0 || brv > 0 ? getCurvePoints(bounds2.left + bottomWidth, bounds2.top + rightHeight, brh - borderRightWidth2 / 3, brv - borderBottomWidth2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2 / 3, bounds2.top + bounds2.height - borderBottomWidth2 / 3);
this.bottomLeftBorderDoubleOuterBox = blh > 0 || blv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 / 3, bounds2.top + leftHeight, blh - borderLeftWidth2 / 3, blv - borderBottomWidth2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds2.left + borderLeftWidth2 / 3, bounds2.top + bounds2.height - borderBottomWidth2 / 3);
this.topLeftBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 * 2 / 3, bounds2.top + borderTopWidth2 * 2 / 3, tlh - borderLeftWidth2 * 2 / 3, tlv - borderTopWidth2 * 2 / 3, CORNER.TOP_LEFT) : new Vector(bounds2.left + borderLeftWidth2 * 2 / 3, bounds2.top + borderTopWidth2 * 2 / 3);
this.topRightBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + topWidth, bounds2.top + borderTopWidth2 * 2 / 3, trh - borderRightWidth2 * 2 / 3, trv - borderTopWidth2 * 2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2 * 2 / 3, bounds2.top + borderTopWidth2 * 2 / 3);
this.bottomRightBorderDoubleInnerBox = brh > 0 || brv > 0 ? getCurvePoints(bounds2.left + bottomWidth, bounds2.top + rightHeight, brh - borderRightWidth2 * 2 / 3, brv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2 * 2 / 3, bounds2.top + bounds2.height - borderBottomWidth2 * 2 / 3);
this.bottomLeftBorderDoubleInnerBox = blh > 0 || blv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 * 2 / 3, bounds2.top + leftHeight, blh - borderLeftWidth2 * 2 / 3, blv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds2.left + borderLeftWidth2 * 2 / 3, bounds2.top + bounds2.height - borderBottomWidth2 * 2 / 3);
this.topLeftBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 / 2, bounds2.top + borderTopWidth2 / 2, tlh - borderLeftWidth2 / 2, tlv - borderTopWidth2 / 2, CORNER.TOP_LEFT) : new Vector(bounds2.left + borderLeftWidth2 / 2, bounds2.top + borderTopWidth2 / 2);
this.topRightBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + topWidth, bounds2.top + borderTopWidth2 / 2, trh - borderRightWidth2 / 2, trv - borderTopWidth2 / 2, CORNER.TOP_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2 / 2, bounds2.top + borderTopWidth2 / 2);
this.bottomRightBorderStroke = brh > 0 || brv > 0 ? getCurvePoints(bounds2.left + bottomWidth, bounds2.top + rightHeight, brh - borderRightWidth2 / 2, brv - borderBottomWidth2 / 2, CORNER.BOTTOM_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2 / 2, bounds2.top + bounds2.height - borderBottomWidth2 / 2);
this.bottomLeftBorderStroke = blh > 0 || blv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 / 2, bounds2.top + leftHeight, blh - borderLeftWidth2 / 2, blv - borderBottomWidth2 / 2, CORNER.BOTTOM_LEFT) : new Vector(bounds2.left + borderLeftWidth2 / 2, bounds2.top + bounds2.height - borderBottomWidth2 / 2);
this.topLeftBorderBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left, bounds2.top, tlh, tlv, CORNER.TOP_LEFT) : new Vector(bounds2.left, bounds2.top);
this.topRightBorderBox = trh > 0 || trv > 0 ? getCurvePoints(bounds2.left + topWidth, bounds2.top, trh, trv, CORNER.TOP_RIGHT) : new Vector(bounds2.left + bounds2.width, bounds2.top);
this.bottomRightBorderBox = brh > 0 || brv > 0 ? getCurvePoints(bounds2.left + bottomWidth, bounds2.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new Vector(bounds2.left + bounds2.width, bounds2.top + bounds2.height);
this.bottomLeftBorderBox = blh > 0 || blv > 0 ? getCurvePoints(bounds2.left, bounds2.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new Vector(bounds2.left, bounds2.top + bounds2.height);
this.topLeftPaddingBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2, bounds2.top + borderTopWidth2, Math.max(0, tlh - borderLeftWidth2), Math.max(0, tlv - borderTopWidth2), CORNER.TOP_LEFT) : new Vector(bounds2.left + borderLeftWidth2, bounds2.top + borderTopWidth2);
this.topRightPaddingBox = trh > 0 || trv > 0 ? getCurvePoints(bounds2.left + Math.min(topWidth, bounds2.width - borderRightWidth2), bounds2.top + borderTopWidth2, topWidth > bounds2.width + borderRightWidth2 ? 0 : Math.max(0, trh - borderRightWidth2), Math.max(0, trv - borderTopWidth2), CORNER.TOP_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2, bounds2.top + borderTopWidth2);
this.bottomRightPaddingBox = brh > 0 || brv > 0 ? getCurvePoints(bounds2.left + Math.min(bottomWidth, bounds2.width - borderLeftWidth2), bounds2.top + Math.min(rightHeight, bounds2.height - borderBottomWidth2), Math.max(0, brh - borderRightWidth2), Math.max(0, brv - borderBottomWidth2), CORNER.BOTTOM_RIGHT) : new Vector(bounds2.left + bounds2.width - borderRightWidth2, bounds2.top + bounds2.height - borderBottomWidth2);
this.bottomLeftPaddingBox = blh > 0 || blv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2, bounds2.top + Math.min(leftHeight, bounds2.height - borderBottomWidth2), Math.max(0, blh - borderLeftWidth2), Math.max(0, blv - borderBottomWidth2), CORNER.BOTTOM_LEFT) : new Vector(bounds2.left + borderLeftWidth2, bounds2.top + bounds2.height - borderBottomWidth2);
this.topLeftContentBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 + paddingLeft2, bounds2.top + borderTopWidth2 + paddingTop2, Math.max(0, tlh - (borderLeftWidth2 + paddingLeft2)), Math.max(0, tlv - (borderTopWidth2 + paddingTop2)), CORNER.TOP_LEFT) : new Vector(bounds2.left + borderLeftWidth2 + paddingLeft2, bounds2.top + borderTopWidth2 + paddingTop2);
this.topRightContentBox = trh > 0 || trv > 0 ? getCurvePoints(bounds2.left + Math.min(topWidth, bounds2.width + borderLeftWidth2 + paddingLeft2), bounds2.top + borderTopWidth2 + paddingTop2, topWidth > bounds2.width + borderLeftWidth2 + paddingLeft2 ? 0 : trh - borderLeftWidth2 + paddingLeft2, trv - (borderTopWidth2 + paddingTop2), CORNER.TOP_RIGHT) : new Vector(bounds2.left + bounds2.width - (borderRightWidth2 + paddingRight2), bounds2.top + borderTopWidth2 + paddingTop2);
this.bottomRightContentBox = brh > 0 || brv > 0 ? getCurvePoints(bounds2.left + Math.min(bottomWidth, bounds2.width - (borderLeftWidth2 + paddingLeft2)), bounds2.top + Math.min(rightHeight, bounds2.height + borderTopWidth2 + paddingTop2), Math.max(0, brh - (borderRightWidth2 + paddingRight2)), brv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_RIGHT) : new Vector(bounds2.left + bounds2.width - (borderRightWidth2 + paddingRight2), bounds2.top + bounds2.height - (borderBottomWidth2 + paddingBottom2));
this.bottomLeftContentBox = blh > 0 || blv > 0 ? getCurvePoints(bounds2.left + borderLeftWidth2 + paddingLeft2, bounds2.top + leftHeight, Math.max(0, blh - (borderLeftWidth2 + paddingLeft2)), blv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_LEFT) : new Vector(bounds2.left + borderLeftWidth2 + paddingLeft2, bounds2.top + bounds2.height - (borderBottomWidth2 + paddingBottom2));
}
return BoundCurves2;
}()
);
var CORNER;
(function(CORNER2) {
CORNER2[CORNER2["TOP_LEFT"] = 0] = "TOP_LEFT";
CORNER2[CORNER2["TOP_RIGHT"] = 1] = "TOP_RIGHT";
CORNER2[CORNER2["BOTTOM_RIGHT"] = 2] = "BOTTOM_RIGHT";
CORNER2[CORNER2["BOTTOM_LEFT"] = 3] = "BOTTOM_LEFT";
})(CORNER || (CORNER = {}));
var getCurvePoints = function(x2, y2, r1, r2, position2) {
var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
var ox = r1 * kappa;
var oy = r2 * kappa;
var xm = x2 + r1;
var ym = y2 + r2;
switch (position2) {
case CORNER.TOP_LEFT:
return new BezierCurve(new Vector(x2, ym), new Vector(x2, ym - oy), new Vector(xm - ox, y2), new Vector(xm, y2));
case CORNER.TOP_RIGHT:
return new BezierCurve(new Vector(x2, y2), new Vector(x2 + ox, y2), new Vector(xm, ym - oy), new Vector(xm, ym));
case CORNER.BOTTOM_RIGHT:
return new BezierCurve(new Vector(xm, y2), new Vector(xm, y2 + oy), new Vector(x2 + ox, ym), new Vector(x2, ym));
case CORNER.BOTTOM_LEFT:
default:
return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x2, y2 + oy), new Vector(x2, y2));
}
};
var calculateBorderBoxPath = function(curves2) {
return [curves2.topLeftBorderBox, curves2.topRightBorderBox, curves2.bottomRightBorderBox, curves2.bottomLeftBorderBox];
};
var calculateContentBoxPath = function(curves2) {
return [
curves2.topLeftContentBox,
curves2.topRightContentBox,
curves2.bottomRightContentBox,
curves2.bottomLeftContentBox
];
};
var calculatePaddingBoxPath = function(curves2) {
return [
curves2.topLeftPaddingBox,
curves2.topRightPaddingBox,
curves2.bottomRightPaddingBox,
curves2.bottomLeftPaddingBox
];
};
var TransformEffect = (
/** @class */
function() {
function TransformEffect2(offsetX, offsetY, matrix2) {
this.offsetX = offsetX;
this.offsetY = offsetY;
this.matrix = matrix2;
this.type = 0;
this.target = 2 | 4;
}
return TransformEffect2;
}()
);
var ClipEffect = (
/** @class */
function() {
function ClipEffect2(path2, target2) {
this.path = path2;
this.target = target2;
this.type = 1;
}
return ClipEffect2;
}()
);
var OpacityEffect = (
/** @class */
function() {
function OpacityEffect2(opacity2) {
this.opacity = opacity2;
this.type = 2;
this.target = 2 | 4;
}
return OpacityEffect2;
}()
);
var isTransformEffect = function(effect4) {
return effect4.type === 0;
};
var isClipEffect = function(effect4) {
return effect4.type === 1;
};
var isOpacityEffect = function(effect4) {
return effect4.type === 2;
};
var equalPath = function(a2, b2) {
if (a2.length === b2.length) {
return a2.some(function(v2, i2) {
return v2 === b2[i2];
});
}
return false;
};
var transformPath = function(path2, deltaX, deltaY, deltaW, deltaH) {
return path2.map(function(point2, index2) {
switch (index2) {
case 0:
return point2.add(deltaX, deltaY);
case 1:
return point2.add(deltaX + deltaW, deltaY);
case 2:
return point2.add(deltaX + deltaW, deltaY + deltaH);
case 3:
return point2.add(deltaX, deltaY + deltaH);
}
return point2;
});
};
var StackingContext = (
/** @class */
function() {
function StackingContext2(container) {
this.element = container;
this.inlineLevel = [];
this.nonInlineLevel = [];
this.negativeZIndex = [];
this.zeroOrAutoZIndexOrTransformedOrOpacity = [];
this.positiveZIndex = [];
this.nonPositionedFloats = [];
this.nonPositionedInlineLevel = [];
}
return StackingContext2;
}()
);
var ElementPaint = (
/** @class */
function() {
function ElementPaint2(container, parent) {
this.container = container;
this.parent = parent;
this.effects = [];
this.curves = new BoundCurves(this.container);
if (this.container.styles.opacity < 1) {
this.effects.push(new OpacityEffect(this.container.styles.opacity));
}
if (this.container.styles.transform !== null) {
var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number;
var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number;
var matrix2 = this.container.styles.transform;
this.effects.push(new TransformEffect(offsetX, offsetY, matrix2));
}
if (this.container.styles.overflowX !== 0) {
var borderBox = calculateBorderBoxPath(this.curves);
var paddingBox2 = calculatePaddingBoxPath(this.curves);
if (equalPath(borderBox, paddingBox2)) {
this.effects.push(new ClipEffect(
borderBox,
2 | 4
/* CONTENT */
));
} else {
this.effects.push(new ClipEffect(
borderBox,
2
/* BACKGROUND_BORDERS */
));
this.effects.push(new ClipEffect(
paddingBox2,
4
/* CONTENT */
));
}
}
}
ElementPaint2.prototype.getEffects = function(target2) {
var inFlow = [
2,
3
/* FIXED */
].indexOf(this.container.styles.position) === -1;
var parent = this.parent;
var effects = this.effects.slice(0);
while (parent) {
var croplessEffects = parent.effects.filter(function(effect4) {
return !isClipEffect(effect4);
});
if (inFlow || parent.container.styles.position !== 0 || !parent.parent) {
effects.unshift.apply(effects, croplessEffects);
inFlow = [
2,
3
/* FIXED */
].indexOf(parent.container.styles.position) === -1;
if (parent.container.styles.overflowX !== 0) {
var borderBox = calculateBorderBoxPath(parent.curves);
var paddingBox2 = calculatePaddingBoxPath(parent.curves);
if (!equalPath(borderBox, paddingBox2)) {
effects.unshift(new ClipEffect(
paddingBox2,
2 | 4
/* CONTENT */
));
}
}
} else {
effects.unshift.apply(effects, croplessEffects);
}
parent = parent.parent;
}
return effects.filter(function(effect4) {
return contains(effect4.target, target2);
});
};
return ElementPaint2;
}()
);
var parseStackTree = function(parent, stackingContext, realStackingContext, listItems) {
parent.container.elements.forEach(function(child) {
var treatAsRealStackingContext = contains(
child.flags,
4
/* CREATES_REAL_STACKING_CONTEXT */
);
var createsStackingContext2 = contains(
child.flags,
2
/* CREATES_STACKING_CONTEXT */
);
var paintContainer = new ElementPaint(child, parent);
if (contains(
child.styles.display,
2048
/* LIST_ITEM */
)) {
listItems.push(paintContainer);
}
var listOwnerItems = contains(
child.flags,
8
/* IS_LIST_OWNER */
) ? [] : listItems;
if (treatAsRealStackingContext || createsStackingContext2) {
var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;
var stack = new StackingContext(paintContainer);
if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {
var order_1 = child.styles.zIndex.order;
if (order_1 < 0) {
var index_1 = 0;
parentStack.negativeZIndex.some(function(current, i2) {
if (order_1 > current.element.container.styles.zIndex.order) {
index_1 = i2;
return false;
} else if (index_1 > 0) {
return true;
}
return false;
});
parentStack.negativeZIndex.splice(index_1, 0, stack);
} else if (order_1 > 0) {
var index_2 = 0;
parentStack.positiveZIndex.some(function(current, i2) {
if (order_1 >= current.element.container.styles.zIndex.order) {
index_2 = i2 + 1;
return false;
} else if (index_2 > 0) {
return true;
}
return false;
});
parentStack.positiveZIndex.splice(index_2, 0, stack);
} else {
parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);
}
} else {
if (child.styles.isFloating()) {
parentStack.nonPositionedFloats.push(stack);
} else {
parentStack.nonPositionedInlineLevel.push(stack);
}
}
parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems);
} else {
if (child.styles.isInlineLevel()) {
stackingContext.inlineLevel.push(paintContainer);
} else {
stackingContext.nonInlineLevel.push(paintContainer);
}
parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);
}
if (contains(
child.flags,
8
/* IS_LIST_OWNER */
)) {
processListItems(child, listOwnerItems);
}
});
};
var processListItems = function(owner, elements2) {
var numbering = owner instanceof OLElementContainer ? owner.start : 1;
var reversed = owner instanceof OLElementContainer ? owner.reversed : false;
for (var i2 = 0; i2 < elements2.length; i2++) {
var item = elements2[i2];
if (item.container instanceof LIElementContainer && typeof item.container.value === "number" && item.container.value !== 0) {
numbering = item.container.value;
}
item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);
numbering += reversed ? -1 : 1;
}
};
var parseStackingContexts = function(container) {
var paintContainer = new ElementPaint(container, null);
var root2 = new StackingContext(paintContainer);
var listItems = [];
parseStackTree(paintContainer, root2, root2, listItems);
processListItems(paintContainer.container, listItems);
return root2;
};
var parsePathForBorder = function(curves2, borderSide) {
switch (borderSide) {
case 0:
return createPathFromCurves(curves2.topLeftBorderBox, curves2.topLeftPaddingBox, curves2.topRightBorderBox, curves2.topRightPaddingBox);
case 1:
return createPathFromCurves(curves2.topRightBorderBox, curves2.topRightPaddingBox, curves2.bottomRightBorderBox, curves2.bottomRightPaddingBox);
case 2:
return createPathFromCurves(curves2.bottomRightBorderBox, curves2.bottomRightPaddingBox, curves2.bottomLeftBorderBox, curves2.bottomLeftPaddingBox);
case 3:
default:
return createPathFromCurves(curves2.bottomLeftBorderBox, curves2.bottomLeftPaddingBox, curves2.topLeftBorderBox, curves2.topLeftPaddingBox);
}
};
var parsePathForBorderDoubleOuter = function(curves2, borderSide) {
switch (borderSide) {
case 0:
return createPathFromCurves(curves2.topLeftBorderBox, curves2.topLeftBorderDoubleOuterBox, curves2.topRightBorderBox, curves2.topRightBorderDoubleOuterBox);
case 1:
return createPathFromCurves(curves2.topRightBorderBox, curves2.topRightBorderDoubleOuterBox, curves2.bottomRightBorderBox, curves2.bottomRightBorderDoubleOuterBox);
case 2:
return createPathFromCurves(curves2.bottomRightBorderBox, curves2.bottomRightBorderDoubleOuterBox, curves2.bottomLeftBorderBox, curves2.bottomLeftBorderDoubleOuterBox);
case 3:
default:
return createPathFromCurves(curves2.bottomLeftBorderBox, curves2.bottomLeftBorderDoubleOuterBox, curves2.topLeftBorderBox, curves2.topLeftBorderDoubleOuterBox);
}
};
var parsePathForBorderDoubleInner = function(curves2, borderSide) {
switch (borderSide) {
case 0:
return createPathFromCurves(curves2.topLeftBorderDoubleInnerBox, curves2.topLeftPaddingBox, curves2.topRightBorderDoubleInnerBox, curves2.topRightPaddingBox);
case 1:
return createPathFromCurves(curves2.topRightBorderDoubleInnerBox, curves2.topRightPaddingBox, curves2.bottomRightBorderDoubleInnerBox, curves2.bottomRightPaddingBox);
case 2:
return createPathFromCurves(curves2.bottomRightBorderDoubleInnerBox, curves2.bottomRightPaddingBox, curves2.bottomLeftBorderDoubleInnerBox, curves2.bottomLeftPaddingBox);
case 3:
default:
return createPathFromCurves(curves2.bottomLeftBorderDoubleInnerBox, curves2.bottomLeftPaddingBox, curves2.topLeftBorderDoubleInnerBox, curves2.topLeftPaddingBox);
}
};
var parsePathForBorderStroke = function(curves2, borderSide) {
switch (borderSide) {
case 0:
return createStrokePathFromCurves(curves2.topLeftBorderStroke, curves2.topRightBorderStroke);
case 1:
return createStrokePathFromCurves(curves2.topRightBorderStroke, curves2.bottomRightBorderStroke);
case 2:
return createStrokePathFromCurves(curves2.bottomRightBorderStroke, curves2.bottomLeftBorderStroke);
case 3:
default:
return createStrokePathFromCurves(curves2.bottomLeftBorderStroke, curves2.topLeftBorderStroke);
}
};
var createStrokePathFromCurves = function(outer1, outer2) {
var path2 = [];
if (isBezierCurve(outer1)) {
path2.push(outer1.subdivide(0.5, false));
} else {
path2.push(outer1);
}
if (isBezierCurve(outer2)) {
path2.push(outer2.subdivide(0.5, true));
} else {
path2.push(outer2);
}
return path2;
};
var createPathFromCurves = function(outer1, inner1, outer2, inner2) {
var path2 = [];
if (isBezierCurve(outer1)) {
path2.push(outer1.subdivide(0.5, false));
} else {
path2.push(outer1);
}
if (isBezierCurve(outer2)) {
path2.push(outer2.subdivide(0.5, true));
} else {
path2.push(outer2);
}
if (isBezierCurve(inner2)) {
path2.push(inner2.subdivide(0.5, true).reverse());
} else {
path2.push(inner2);
}
if (isBezierCurve(inner1)) {
path2.push(inner1.subdivide(0.5, false).reverse());
} else {
path2.push(inner1);
}
return path2;
};
var paddingBox = function(element2) {
var bounds2 = element2.bounds;
var styles2 = element2.styles;
return bounds2.add(styles2.borderLeftWidth, styles2.borderTopWidth, -(styles2.borderRightWidth + styles2.borderLeftWidth), -(styles2.borderTopWidth + styles2.borderBottomWidth));
};
var contentBox = function(element2) {
var styles2 = element2.styles;
var bounds2 = element2.bounds;
var paddingLeft2 = getAbsoluteValue(styles2.paddingLeft, bounds2.width);
var paddingRight2 = getAbsoluteValue(styles2.paddingRight, bounds2.width);
var paddingTop2 = getAbsoluteValue(styles2.paddingTop, bounds2.width);
var paddingBottom2 = getAbsoluteValue(styles2.paddingBottom, bounds2.width);
return bounds2.add(paddingLeft2 + styles2.borderLeftWidth, paddingTop2 + styles2.borderTopWidth, -(styles2.borderRightWidth + styles2.borderLeftWidth + paddingLeft2 + paddingRight2), -(styles2.borderTopWidth + styles2.borderBottomWidth + paddingTop2 + paddingBottom2));
};
var calculateBackgroundPositioningArea = function(backgroundOrigin2, element2) {
if (backgroundOrigin2 === 0) {
return element2.bounds;
}
if (backgroundOrigin2 === 2) {
return contentBox(element2);
}
return paddingBox(element2);
};
var calculateBackgroundPaintingArea = function(backgroundClip2, element2) {
if (backgroundClip2 === 0) {
return element2.bounds;
}
if (backgroundClip2 === 2) {
return contentBox(element2);
}
return paddingBox(element2);
};
var calculateBackgroundRendering = function(container, index2, intrinsicSize) {
var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index2), container);
var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index2), container);
var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index2), intrinsicSize, backgroundPositioningArea);
var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];
var position2 = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index2), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);
var path2 = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index2), position2, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);
var offsetX = Math.round(backgroundPositioningArea.left + position2[0]);
var offsetY = Math.round(backgroundPositioningArea.top + position2[1]);
return [path2, offsetX, offsetY, sizeWidth, sizeHeight];
};
var isAuto = function(token2) {
return isIdentToken(token2) && token2.value === BACKGROUND_SIZE.AUTO;
};
var hasIntrinsicValue = function(value2) {
return typeof value2 === "number";
};
var calculateBackgroundSize = function(size, _a2, bounds2) {
var intrinsicWidth = _a2[0], intrinsicHeight = _a2[1], intrinsicProportion = _a2[2];
var first = size[0], second2 = size[1];
if (!first) {
return [0, 0];
}
if (isLengthPercentage(first) && second2 && isLengthPercentage(second2)) {
return [getAbsoluteValue(first, bounds2.width), getAbsoluteValue(second2, bounds2.height)];
}
var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);
if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {
if (hasIntrinsicValue(intrinsicProportion)) {
var targetRatio = bounds2.width / bounds2.height;
return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER) ? [bounds2.width, bounds2.width / intrinsicProportion] : [bounds2.height * intrinsicProportion, bounds2.height];
}
return [bounds2.width, bounds2.height];
}
var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);
var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);
var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;
if (isAuto(first) && (!second2 || isAuto(second2))) {
if (hasIntrinsicWidth && hasIntrinsicHeight) {
return [intrinsicWidth, intrinsicHeight];
}
if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {
return [bounds2.width, bounds2.height];
}
if (hasIntrinsicDimensions && hasIntrinsicProportion) {
var width_1 = hasIntrinsicWidth ? intrinsicWidth : intrinsicHeight * intrinsicProportion;
var height_1 = hasIntrinsicHeight ? intrinsicHeight : intrinsicWidth / intrinsicProportion;
return [width_1, height_1];
}
var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds2.width;
var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds2.height;
return [width_2, height_2];
}
if (hasIntrinsicProportion) {
var width_3 = 0;
var height_3 = 0;
if (isLengthPercentage(first)) {
width_3 = getAbsoluteValue(first, bounds2.width);
} else if (isLengthPercentage(second2)) {
height_3 = getAbsoluteValue(second2, bounds2.height);
}
if (isAuto(first)) {
width_3 = height_3 * intrinsicProportion;
} else if (!second2 || isAuto(second2)) {
height_3 = width_3 / intrinsicProportion;
}
return [width_3, height_3];
}
var width2 = null;
var height2 = null;
if (isLengthPercentage(first)) {
width2 = getAbsoluteValue(first, bounds2.width);
} else if (second2 && isLengthPercentage(second2)) {
height2 = getAbsoluteValue(second2, bounds2.height);
}
if (width2 !== null && (!second2 || isAuto(second2))) {
height2 = hasIntrinsicWidth && hasIntrinsicHeight ? width2 / intrinsicWidth * intrinsicHeight : bounds2.height;
}
if (height2 !== null && isAuto(first)) {
width2 = hasIntrinsicWidth && hasIntrinsicHeight ? height2 / intrinsicHeight * intrinsicWidth : bounds2.width;
}
if (width2 !== null && height2 !== null) {
return [width2, height2];
}
throw new Error("Unable to calculate background-size for element");
};
var getBackgroundValueForIndex = function(values2, index2) {
var value2 = values2[index2];
if (typeof value2 === "undefined") {
return values2[0];
}
return value2;
};
var calculateBackgroundRepeatPath = function(repeat2, _a2, _b2, backgroundPositioningArea, backgroundPaintingArea) {
var x2 = _a2[0], y2 = _a2[1];
var width2 = _b2[0], height2 = _b2[1];
switch (repeat2) {
case 2:
return [
new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y2)),
new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y2)),
new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height2 + backgroundPositioningArea.top + y2)),
new Vector(Math.round(backgroundPositioningArea.left), Math.round(height2 + backgroundPositioningArea.top + y2))
];
case 3:
return [
new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.top)),
new Vector(Math.round(backgroundPositioningArea.left + x2 + width2), Math.round(backgroundPositioningArea.top)),
new Vector(Math.round(backgroundPositioningArea.left + x2 + width2), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)),
new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top))
];
case 1:
return [
new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.top + y2)),
new Vector(Math.round(backgroundPositioningArea.left + x2 + width2), Math.round(backgroundPositioningArea.top + y2)),
new Vector(Math.round(backgroundPositioningArea.left + x2 + width2), Math.round(backgroundPositioningArea.top + y2 + height2)),
new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.top + y2 + height2))
];
default:
return [
new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),
new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)),
new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)),
new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top))
];
}
};
var SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
var SAMPLE_TEXT = "Hidden Text";
var FontMetrics = (
/** @class */
function() {
function FontMetrics2(document2) {
this._data = {};
this._document = document2;
}
FontMetrics2.prototype.parseMetrics = function(fontFamily2, fontSize2) {
var container = this._document.createElement("div");
var img = this._document.createElement("img");
var span2 = this._document.createElement("span");
var body = this._document.body;
container.style.visibility = "hidden";
container.style.fontFamily = fontFamily2;
container.style.fontSize = fontSize2;
container.style.margin = "0";
container.style.padding = "0";
container.style.whiteSpace = "nowrap";
body.appendChild(container);
img.src = SMALL_IMAGE;
img.width = 1;
img.height = 1;
img.style.margin = "0";
img.style.padding = "0";
img.style.verticalAlign = "baseline";
span2.style.fontFamily = fontFamily2;
span2.style.fontSize = fontSize2;
span2.style.margin = "0";
span2.style.padding = "0";
span2.appendChild(this._document.createTextNode(SAMPLE_TEXT));
container.appendChild(span2);
container.appendChild(img);
var baseline2 = img.offsetTop - span2.offsetTop + 2;
container.removeChild(span2);
container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
container.style.lineHeight = "normal";
img.style.verticalAlign = "super";
var middle = img.offsetTop - container.offsetTop + 2;
body.removeChild(container);
return { baseline: baseline2, middle };
};
FontMetrics2.prototype.getMetrics = function(fontFamily2, fontSize2) {
var key2 = fontFamily2 + " " + fontSize2;
if (typeof this._data[key2] === "undefined") {
this._data[key2] = this.parseMetrics(fontFamily2, fontSize2);
}
return this._data[key2];
};
return FontMetrics2;
}()
);
var Renderer = (
/** @class */
function() {
function Renderer2(context2, options2) {
this.context = context2;
this.options = options2;
}
return Renderer2;
}()
);
var MASK_OFFSET = 1e4;
var CanvasRenderer = (
/** @class */
function(_super) {
__extends(CanvasRenderer2, _super);
function CanvasRenderer2(context2, options2) {
var _this = _super.call(this, context2, options2) || this;
_this._activeEffects = [];
_this.canvas = options2.canvas ? options2.canvas : document.createElement("canvas");
_this.ctx = _this.canvas.getContext("2d");
if (!options2.canvas) {
_this.canvas.width = Math.floor(options2.width * options2.scale);
_this.canvas.height = Math.floor(options2.height * options2.scale);
_this.canvas.style.width = options2.width + "px";
_this.canvas.style.height = options2.height + "px";
}
_this.fontMetrics = new FontMetrics(document);
_this.ctx.scale(_this.options.scale, _this.options.scale);
_this.ctx.translate(-options2.x, -options2.y);
_this.ctx.textBaseline = "bottom";
_this._activeEffects = [];
_this.context.logger.debug("Canvas renderer initialized (" + options2.width + "x" + options2.height + ") with scale " + options2.scale);
return _this;
}
CanvasRenderer2.prototype.applyEffects = function(effects) {
var _this = this;
while (this._activeEffects.length) {
this.popEffect();
}
effects.forEach(function(effect4) {
return _this.applyEffect(effect4);
});
};
CanvasRenderer2.prototype.applyEffect = function(effect4) {
this.ctx.save();
if (isOpacityEffect(effect4)) {
this.ctx.globalAlpha = effect4.opacity;
}
if (isTransformEffect(effect4)) {
this.ctx.translate(effect4.offsetX, effect4.offsetY);
this.ctx.transform(effect4.matrix[0], effect4.matrix[1], effect4.matrix[2], effect4.matrix[3], effect4.matrix[4], effect4.matrix[5]);
this.ctx.translate(-effect4.offsetX, -effect4.offsetY);
}
if (isClipEffect(effect4)) {
this.path(effect4.path);
this.ctx.clip();
}
this._activeEffects.push(effect4);
};
CanvasRenderer2.prototype.popEffect = function() {
this._activeEffects.pop();
this.ctx.restore();
};
CanvasRenderer2.prototype.renderStack = function(stack) {
return __awaiter(this, void 0, void 0, function() {
var styles2;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
styles2 = stack.element.container.styles;
if (!styles2.isVisible())
return [3, 2];
return [4, this.renderStackContent(stack)];
case 1:
_a2.sent();
_a2.label = 2;
case 2:
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.renderNode = function(paint) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
if (contains(
paint.container.flags,
16
/* DEBUG_RENDER */
)) {
debugger;
}
if (!paint.container.styles.isVisible())
return [3, 3];
return [4, this.renderNodeBackgroundAndBorders(paint)];
case 1:
_a2.sent();
return [4, this.renderNodeContent(paint)];
case 2:
_a2.sent();
_a2.label = 3;
case 3:
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.renderTextWithLetterSpacing = function(text2, letterSpacing2, baseline2) {
var _this = this;
if (letterSpacing2 === 0) {
this.ctx.fillText(text2.text, text2.bounds.left, text2.bounds.top + baseline2);
} else {
var letters = segmentGraphemes(text2.text);
letters.reduce(function(left2, letter) {
_this.ctx.fillText(letter, left2, text2.bounds.top + baseline2);
return left2 + _this.ctx.measureText(letter).width;
}, text2.bounds.left);
}
};
CanvasRenderer2.prototype.createFontStyle = function(styles2) {
var fontVariant2 = styles2.fontVariant.filter(function(variant) {
return variant === "normal" || variant === "small-caps";
}).join("");
var fontFamily2 = fixIOSSystemFonts(styles2.fontFamily).join(", ");
var fontSize2 = isDimensionToken(styles2.fontSize) ? "" + styles2.fontSize.number + styles2.fontSize.unit : styles2.fontSize.number + "px";
return [
[styles2.fontStyle, fontVariant2, styles2.fontWeight, fontSize2, fontFamily2].join(" "),
fontFamily2,
fontSize2
];
};
CanvasRenderer2.prototype.renderTextNode = function(text2, styles2) {
return __awaiter(this, void 0, void 0, function() {
var _a2, font2, fontFamily2, fontSize2, _b2, baseline2, middle, paintOrder2;
var _this = this;
return __generator(this, function(_c2) {
_a2 = this.createFontStyle(styles2), font2 = _a2[0], fontFamily2 = _a2[1], fontSize2 = _a2[2];
this.ctx.font = font2;
this.ctx.direction = styles2.direction === 1 ? "rtl" : "ltr";
this.ctx.textAlign = "left";
this.ctx.textBaseline = "alphabetic";
_b2 = this.fontMetrics.getMetrics(fontFamily2, fontSize2), baseline2 = _b2.baseline, middle = _b2.middle;
paintOrder2 = styles2.paintOrder;
text2.textBounds.forEach(function(text3) {
paintOrder2.forEach(function(paintOrderLayer) {
switch (paintOrderLayer) {
case 0:
_this.ctx.fillStyle = asString(styles2.color);
_this.renderTextWithLetterSpacing(text3, styles2.letterSpacing, baseline2);
var textShadows = styles2.textShadow;
if (textShadows.length && text3.text.trim().length) {
textShadows.slice(0).reverse().forEach(function(textShadow2) {
_this.ctx.shadowColor = asString(textShadow2.color);
_this.ctx.shadowOffsetX = textShadow2.offsetX.number * _this.options.scale;
_this.ctx.shadowOffsetY = textShadow2.offsetY.number * _this.options.scale;
_this.ctx.shadowBlur = textShadow2.blur.number;
_this.renderTextWithLetterSpacing(text3, styles2.letterSpacing, baseline2);
});
_this.ctx.shadowColor = "";
_this.ctx.shadowOffsetX = 0;
_this.ctx.shadowOffsetY = 0;
_this.ctx.shadowBlur = 0;
}
if (styles2.textDecorationLine.length) {
_this.ctx.fillStyle = asString(styles2.textDecorationColor || styles2.color);
styles2.textDecorationLine.forEach(function(textDecorationLine2) {
switch (textDecorationLine2) {
case 1:
_this.ctx.fillRect(text3.bounds.left, Math.round(text3.bounds.top + baseline2), text3.bounds.width, 1);
break;
case 2:
_this.ctx.fillRect(text3.bounds.left, Math.round(text3.bounds.top), text3.bounds.width, 1);
break;
case 3:
_this.ctx.fillRect(text3.bounds.left, Math.ceil(text3.bounds.top + middle), text3.bounds.width, 1);
break;
}
});
}
break;
case 1:
if (styles2.webkitTextStrokeWidth && text3.text.trim().length) {
_this.ctx.strokeStyle = asString(styles2.webkitTextStrokeColor);
_this.ctx.lineWidth = styles2.webkitTextStrokeWidth;
_this.ctx.lineJoin = !!window.chrome ? "miter" : "round";
_this.ctx.strokeText(text3.text, text3.bounds.left, text3.bounds.top + baseline2);
}
_this.ctx.strokeStyle = "";
_this.ctx.lineWidth = 0;
_this.ctx.lineJoin = "miter";
break;
}
});
});
return [
2
/*return*/
];
});
});
};
CanvasRenderer2.prototype.renderReplacedElement = function(container, curves2, image2) {
if (image2 && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
var box = contentBox(container);
var path2 = calculatePaddingBoxPath(curves2);
this.path(path2);
this.ctx.save();
this.ctx.clip();
this.ctx.drawImage(image2, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);
this.ctx.restore();
}
};
CanvasRenderer2.prototype.renderNodeContent = function(paint) {
return __awaiter(this, void 0, void 0, function() {
var container, curves2, styles2, _i2, _a2, child, image2, image2, iframeRenderer, canvas, size, _b2, fontFamily2, fontSize2, baseline2, bounds2, x2, textBounds, img, image2, url2, fontFamily2, bounds2;
return __generator(this, function(_c2) {
switch (_c2.label) {
case 0:
this.applyEffects(paint.getEffects(
4
/* CONTENT */
));
container = paint.container;
curves2 = paint.curves;
styles2 = container.styles;
_i2 = 0, _a2 = container.textNodes;
_c2.label = 1;
case 1:
if (!(_i2 < _a2.length))
return [3, 4];
child = _a2[_i2];
return [4, this.renderTextNode(child, styles2)];
case 2:
_c2.sent();
_c2.label = 3;
case 3:
_i2++;
return [3, 1];
case 4:
if (!(container instanceof ImageElementContainer))
return [3, 8];
_c2.label = 5;
case 5:
_c2.trys.push([5, 7, , 8]);
return [4, this.context.cache.match(container.src)];
case 6:
image2 = _c2.sent();
this.renderReplacedElement(container, curves2, image2);
return [3, 8];
case 7:
_c2.sent();
this.context.logger.error("Error loading image " + container.src);
return [3, 8];
case 8:
if (container instanceof CanvasElementContainer) {
this.renderReplacedElement(container, curves2, container.canvas);
}
if (!(container instanceof SVGElementContainer))
return [3, 12];
_c2.label = 9;
case 9:
_c2.trys.push([9, 11, , 12]);
return [4, this.context.cache.match(container.svg)];
case 10:
image2 = _c2.sent();
this.renderReplacedElement(container, curves2, image2);
return [3, 12];
case 11:
_c2.sent();
this.context.logger.error("Error loading svg " + container.svg.substring(0, 255));
return [3, 12];
case 12:
if (!(container instanceof IFrameElementContainer && container.tree))
return [3, 14];
iframeRenderer = new CanvasRenderer2(this.context, {
scale: this.options.scale,
backgroundColor: container.backgroundColor,
x: 0,
y: 0,
width: container.width,
height: container.height
});
return [4, iframeRenderer.render(container.tree)];
case 13:
canvas = _c2.sent();
if (container.width && container.height) {
this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);
}
_c2.label = 14;
case 14:
if (container instanceof InputElementContainer) {
size = Math.min(container.bounds.width, container.bounds.height);
if (container.type === CHECKBOX) {
if (container.checked) {
this.ctx.save();
this.path([
new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),
new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),
new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),
new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),
new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),
new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),
new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)
]);
this.ctx.fillStyle = asString(INPUT_COLOR);
this.ctx.fill();
this.ctx.restore();
}
} else if (container.type === RADIO) {
if (container.checked) {
this.ctx.save();
this.ctx.beginPath();
this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true);
this.ctx.fillStyle = asString(INPUT_COLOR);
this.ctx.fill();
this.ctx.restore();
}
}
}
if (isTextInputElement(container) && container.value.length) {
_b2 = this.createFontStyle(styles2), fontFamily2 = _b2[0], fontSize2 = _b2[1];
baseline2 = this.fontMetrics.getMetrics(fontFamily2, fontSize2).baseline;
this.ctx.font = fontFamily2;
this.ctx.fillStyle = asString(styles2.color);
this.ctx.textBaseline = "alphabetic";
this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);
bounds2 = contentBox(container);
x2 = 0;
switch (container.styles.textAlign) {
case 1:
x2 += bounds2.width / 2;
break;
case 2:
x2 += bounds2.width;
break;
}
textBounds = bounds2.add(x2, 0, 0, -bounds2.height / 2 + 1);
this.ctx.save();
this.path([
new Vector(bounds2.left, bounds2.top),
new Vector(bounds2.left + bounds2.width, bounds2.top),
new Vector(bounds2.left + bounds2.width, bounds2.top + bounds2.height),
new Vector(bounds2.left, bounds2.top + bounds2.height)
]);
this.ctx.clip();
this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles2.letterSpacing, baseline2);
this.ctx.restore();
this.ctx.textBaseline = "alphabetic";
this.ctx.textAlign = "left";
}
if (!contains(
container.styles.display,
2048
/* LIST_ITEM */
))
return [3, 20];
if (!(container.styles.listStyleImage !== null))
return [3, 19];
img = container.styles.listStyleImage;
if (!(img.type === 0))
return [3, 18];
image2 = void 0;
url2 = img.url;
_c2.label = 15;
case 15:
_c2.trys.push([15, 17, , 18]);
return [4, this.context.cache.match(url2)];
case 16:
image2 = _c2.sent();
this.ctx.drawImage(image2, container.bounds.left - (image2.width + 10), container.bounds.top);
return [3, 18];
case 17:
_c2.sent();
this.context.logger.error("Error loading list-style-image " + url2);
return [3, 18];
case 18:
return [3, 20];
case 19:
if (paint.listValue && container.styles.listStyleType !== -1) {
fontFamily2 = this.createFontStyle(styles2)[0];
this.ctx.font = fontFamily2;
this.ctx.fillStyle = asString(styles2.color);
this.ctx.textBaseline = "middle";
this.ctx.textAlign = "right";
bounds2 = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles2.lineHeight, styles2.fontSize.number) / 2 + 1);
this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds2), styles2.letterSpacing, computeLineHeight(styles2.lineHeight, styles2.fontSize.number) / 2 + 2);
this.ctx.textBaseline = "bottom";
this.ctx.textAlign = "left";
}
_c2.label = 20;
case 20:
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.renderStackContent = function(stack) {
return __awaiter(this, void 0, void 0, function() {
var _i2, _a2, child, _b2, _c2, child, _d, _e2, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o2, child;
return __generator(this, function(_p) {
switch (_p.label) {
case 0:
if (contains(
stack.element.container.flags,
16
/* DEBUG_RENDER */
)) {
debugger;
}
return [4, this.renderNodeBackgroundAndBorders(stack.element)];
case 1:
_p.sent();
_i2 = 0, _a2 = stack.negativeZIndex;
_p.label = 2;
case 2:
if (!(_i2 < _a2.length))
return [3, 5];
child = _a2[_i2];
return [4, this.renderStack(child)];
case 3:
_p.sent();
_p.label = 4;
case 4:
_i2++;
return [3, 2];
case 5:
return [4, this.renderNodeContent(stack.element)];
case 6:
_p.sent();
_b2 = 0, _c2 = stack.nonInlineLevel;
_p.label = 7;
case 7:
if (!(_b2 < _c2.length))
return [3, 10];
child = _c2[_b2];
return [4, this.renderNode(child)];
case 8:
_p.sent();
_p.label = 9;
case 9:
_b2++;
return [3, 7];
case 10:
_d = 0, _e2 = stack.nonPositionedFloats;
_p.label = 11;
case 11:
if (!(_d < _e2.length))
return [3, 14];
child = _e2[_d];
return [4, this.renderStack(child)];
case 12:
_p.sent();
_p.label = 13;
case 13:
_d++;
return [3, 11];
case 14:
_f = 0, _g = stack.nonPositionedInlineLevel;
_p.label = 15;
case 15:
if (!(_f < _g.length))
return [3, 18];
child = _g[_f];
return [4, this.renderStack(child)];
case 16:
_p.sent();
_p.label = 17;
case 17:
_f++;
return [3, 15];
case 18:
_h = 0, _j = stack.inlineLevel;
_p.label = 19;
case 19:
if (!(_h < _j.length))
return [3, 22];
child = _j[_h];
return [4, this.renderNode(child)];
case 20:
_p.sent();
_p.label = 21;
case 21:
_h++;
return [3, 19];
case 22:
_k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity;
_p.label = 23;
case 23:
if (!(_k < _l.length))
return [3, 26];
child = _l[_k];
return [4, this.renderStack(child)];
case 24:
_p.sent();
_p.label = 25;
case 25:
_k++;
return [3, 23];
case 26:
_m = 0, _o2 = stack.positiveZIndex;
_p.label = 27;
case 27:
if (!(_m < _o2.length))
return [3, 30];
child = _o2[_m];
return [4, this.renderStack(child)];
case 28:
_p.sent();
_p.label = 29;
case 29:
_m++;
return [3, 27];
case 30:
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.mask = function(paths) {
this.ctx.beginPath();
this.ctx.moveTo(0, 0);
this.ctx.lineTo(this.canvas.width, 0);
this.ctx.lineTo(this.canvas.width, this.canvas.height);
this.ctx.lineTo(0, this.canvas.height);
this.ctx.lineTo(0, 0);
this.formatPath(paths.slice(0).reverse());
this.ctx.closePath();
};
CanvasRenderer2.prototype.path = function(paths) {
this.ctx.beginPath();
this.formatPath(paths);
this.ctx.closePath();
};
CanvasRenderer2.prototype.formatPath = function(paths) {
var _this = this;
paths.forEach(function(point2, index2) {
var start2 = isBezierCurve(point2) ? point2.start : point2;
if (index2 === 0) {
_this.ctx.moveTo(start2.x, start2.y);
} else {
_this.ctx.lineTo(start2.x, start2.y);
}
if (isBezierCurve(point2)) {
_this.ctx.bezierCurveTo(point2.startControl.x, point2.startControl.y, point2.endControl.x, point2.endControl.y, point2.end.x, point2.end.y);
}
});
};
CanvasRenderer2.prototype.renderRepeat = function(path2, pattern, offsetX, offsetY) {
this.path(path2);
this.ctx.fillStyle = pattern;
this.ctx.translate(offsetX, offsetY);
this.ctx.fill();
this.ctx.translate(-offsetX, -offsetY);
};
CanvasRenderer2.prototype.resizeImage = function(image2, width2, height2) {
var _a2;
if (image2.width === width2 && image2.height === height2) {
return image2;
}
var ownerDocument = (_a2 = this.canvas.ownerDocument) !== null && _a2 !== void 0 ? _a2 : document;
var canvas = ownerDocument.createElement("canvas");
canvas.width = Math.max(1, width2);
canvas.height = Math.max(1, height2);
var ctx = canvas.getContext("2d");
ctx.drawImage(image2, 0, 0, image2.width, image2.height, 0, 0, width2, height2);
return canvas;
};
CanvasRenderer2.prototype.renderBackgroundImage = function(container) {
return __awaiter(this, void 0, void 0, function() {
var index2, _loop_1, this_1, _i2, _a2, backgroundImage2;
return __generator(this, function(_b2) {
switch (_b2.label) {
case 0:
index2 = container.styles.backgroundImage.length - 1;
_loop_1 = function(backgroundImage3) {
var image2, url2, _c2, path2, x2, y2, width2, height2, pattern, _d, path2, x2, y2, width2, height2, _e2, lineLength, x02, x12, y02, y12, canvas, ctx, gradient_1, pattern, _f, path2, left2, top_1, width2, height2, position2, x2, y2, _g, rx, ry, radialGradient_1, midX, midY, f2, invF;
return __generator(this, function(_h) {
switch (_h.label) {
case 0:
if (!(backgroundImage3.type === 0))
return [3, 5];
image2 = void 0;
url2 = backgroundImage3.url;
_h.label = 1;
case 1:
_h.trys.push([1, 3, , 4]);
return [4, this_1.context.cache.match(url2)];
case 2:
image2 = _h.sent();
return [3, 4];
case 3:
_h.sent();
this_1.context.logger.error("Error loading background-image " + url2);
return [3, 4];
case 4:
if (image2) {
_c2 = calculateBackgroundRendering(container, index2, [
image2.width,
image2.height,
image2.width / image2.height
]), path2 = _c2[0], x2 = _c2[1], y2 = _c2[2], width2 = _c2[3], height2 = _c2[4];
pattern = this_1.ctx.createPattern(this_1.resizeImage(image2, width2, height2), "repeat");
this_1.renderRepeat(path2, pattern, x2, y2);
}
return [3, 6];
case 5:
if (isLinearGradient(backgroundImage3)) {
_d = calculateBackgroundRendering(container, index2, [null, null, null]), path2 = _d[0], x2 = _d[1], y2 = _d[2], width2 = _d[3], height2 = _d[4];
_e2 = calculateGradientDirection(backgroundImage3.angle, width2, height2), lineLength = _e2[0], x02 = _e2[1], x12 = _e2[2], y02 = _e2[3], y12 = _e2[4];
canvas = document.createElement("canvas");
canvas.width = width2;
canvas.height = height2;
ctx = canvas.getContext("2d");
gradient_1 = ctx.createLinearGradient(x02, y02, x12, y12);
processColorStops(backgroundImage3.stops, lineLength).forEach(function(colorStop) {
return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
});
ctx.fillStyle = gradient_1;
ctx.fillRect(0, 0, width2, height2);
if (width2 > 0 && height2 > 0) {
pattern = this_1.ctx.createPattern(canvas, "repeat");
this_1.renderRepeat(path2, pattern, x2, y2);
}
} else if (isRadialGradient(backgroundImage3)) {
_f = calculateBackgroundRendering(container, index2, [
null,
null,
null
]), path2 = _f[0], left2 = _f[1], top_1 = _f[2], width2 = _f[3], height2 = _f[4];
position2 = backgroundImage3.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage3.position;
x2 = getAbsoluteValue(position2[0], width2);
y2 = getAbsoluteValue(position2[position2.length - 1], height2);
_g = calculateRadius(backgroundImage3, x2, y2, width2, height2), rx = _g[0], ry = _g[1];
if (rx > 0 && ry > 0) {
radialGradient_1 = this_1.ctx.createRadialGradient(left2 + x2, top_1 + y2, 0, left2 + x2, top_1 + y2, rx);
processColorStops(backgroundImage3.stops, rx * 2).forEach(function(colorStop) {
return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
});
this_1.path(path2);
this_1.ctx.fillStyle = radialGradient_1;
if (rx !== ry) {
midX = container.bounds.left + 0.5 * container.bounds.width;
midY = container.bounds.top + 0.5 * container.bounds.height;
f2 = ry / rx;
invF = 1 / f2;
this_1.ctx.save();
this_1.ctx.translate(midX, midY);
this_1.ctx.transform(1, 0, 0, f2, 0, 0);
this_1.ctx.translate(-midX, -midY);
this_1.ctx.fillRect(left2, invF * (top_1 - midY) + midY, width2, height2 * invF);
this_1.ctx.restore();
} else {
this_1.ctx.fill();
}
}
}
_h.label = 6;
case 6:
index2--;
return [
2
/*return*/
];
}
});
};
this_1 = this;
_i2 = 0, _a2 = container.styles.backgroundImage.slice(0).reverse();
_b2.label = 1;
case 1:
if (!(_i2 < _a2.length))
return [3, 4];
backgroundImage2 = _a2[_i2];
return [5, _loop_1(backgroundImage2)];
case 2:
_b2.sent();
_b2.label = 3;
case 3:
_i2++;
return [3, 1];
case 4:
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.renderSolidBorder = function(color2, side, curvePoints) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
this.path(parsePathForBorder(curvePoints, side));
this.ctx.fillStyle = asString(color2);
this.ctx.fill();
return [
2
/*return*/
];
});
});
};
CanvasRenderer2.prototype.renderDoubleBorder = function(color2, width2, side, curvePoints) {
return __awaiter(this, void 0, void 0, function() {
var outerPaths, innerPaths;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
if (!(width2 < 3))
return [3, 2];
return [4, this.renderSolidBorder(color2, side, curvePoints)];
case 1:
_a2.sent();
return [
2
/*return*/
];
case 2:
outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);
this.path(outerPaths);
this.ctx.fillStyle = asString(color2);
this.ctx.fill();
innerPaths = parsePathForBorderDoubleInner(curvePoints, side);
this.path(innerPaths);
this.ctx.fill();
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.renderNodeBackgroundAndBorders = function(paint) {
return __awaiter(this, void 0, void 0, function() {
var styles2, hasBackground, borders, backgroundPaintingArea, side, _i2, borders_1, border;
var _this = this;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
this.applyEffects(paint.getEffects(
2
/* BACKGROUND_BORDERS */
));
styles2 = paint.container.styles;
hasBackground = !isTransparent(styles2.backgroundColor) || styles2.backgroundImage.length;
borders = [
{ style: styles2.borderTopStyle, color: styles2.borderTopColor, width: styles2.borderTopWidth },
{ style: styles2.borderRightStyle, color: styles2.borderRightColor, width: styles2.borderRightWidth },
{ style: styles2.borderBottomStyle, color: styles2.borderBottomColor, width: styles2.borderBottomWidth },
{ style: styles2.borderLeftStyle, color: styles2.borderLeftColor, width: styles2.borderLeftWidth }
];
backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles2.backgroundClip, 0), paint.curves);
if (!(hasBackground || styles2.boxShadow.length))
return [3, 2];
this.ctx.save();
this.path(backgroundPaintingArea);
this.ctx.clip();
if (!isTransparent(styles2.backgroundColor)) {
this.ctx.fillStyle = asString(styles2.backgroundColor);
this.ctx.fill();
}
return [4, this.renderBackgroundImage(paint.container)];
case 1:
_a2.sent();
this.ctx.restore();
styles2.boxShadow.slice(0).reverse().forEach(function(shadow) {
_this.ctx.save();
var borderBoxArea = calculateBorderBoxPath(paint.curves);
var maskOffset = shadow.inset ? 0 : MASK_OFFSET;
var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));
if (shadow.inset) {
_this.path(borderBoxArea);
_this.ctx.clip();
_this.mask(shadowPaintingArea);
} else {
_this.mask(borderBoxArea);
_this.ctx.clip();
_this.path(shadowPaintingArea);
}
_this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;
_this.ctx.shadowOffsetY = shadow.offsetY.number;
_this.ctx.shadowColor = asString(shadow.color);
_this.ctx.shadowBlur = shadow.blur.number;
_this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : "rgba(0,0,0,1)";
_this.ctx.fill();
_this.ctx.restore();
});
_a2.label = 2;
case 2:
side = 0;
_i2 = 0, borders_1 = borders;
_a2.label = 3;
case 3:
if (!(_i2 < borders_1.length))
return [3, 13];
border = borders_1[_i2];
if (!(border.style !== 0 && !isTransparent(border.color) && border.width > 0))
return [3, 11];
if (!(border.style === 2))
return [3, 5];
return [4, this.renderDashedDottedBorder(
border.color,
border.width,
side,
paint.curves,
2
/* DASHED */
)];
case 4:
_a2.sent();
return [3, 11];
case 5:
if (!(border.style === 3))
return [3, 7];
return [4, this.renderDashedDottedBorder(
border.color,
border.width,
side,
paint.curves,
3
/* DOTTED */
)];
case 6:
_a2.sent();
return [3, 11];
case 7:
if (!(border.style === 4))
return [3, 9];
return [4, this.renderDoubleBorder(border.color, border.width, side, paint.curves)];
case 8:
_a2.sent();
return [3, 11];
case 9:
return [4, this.renderSolidBorder(border.color, side, paint.curves)];
case 10:
_a2.sent();
_a2.label = 11;
case 11:
side++;
_a2.label = 12;
case 12:
_i2++;
return [3, 3];
case 13:
return [
2
/*return*/
];
}
});
});
};
CanvasRenderer2.prototype.renderDashedDottedBorder = function(color2, width2, side, curvePoints, style2) {
return __awaiter(this, void 0, void 0, function() {
var strokePaths, boxPaths, startX, startY, endX, endY, length2, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;
return __generator(this, function(_a2) {
this.ctx.save();
strokePaths = parsePathForBorderStroke(curvePoints, side);
boxPaths = parsePathForBorder(curvePoints, side);
if (style2 === 2) {
this.path(boxPaths);
this.ctx.clip();
}
if (isBezierCurve(boxPaths[0])) {
startX = boxPaths[0].start.x;
startY = boxPaths[0].start.y;
} else {
startX = boxPaths[0].x;
startY = boxPaths[0].y;
}
if (isBezierCurve(boxPaths[1])) {
endX = boxPaths[1].end.x;
endY = boxPaths[1].end.y;
} else {
endX = boxPaths[1].x;
endY = boxPaths[1].y;
}
if (side === 0 || side === 2) {
length2 = Math.abs(startX - endX);
} else {
length2 = Math.abs(startY - endY);
}
this.ctx.beginPath();
if (style2 === 3) {
this.formatPath(strokePaths);
} else {
this.formatPath(boxPaths.slice(0, 2));
}
dashLength = width2 < 3 ? width2 * 3 : width2 * 2;
spaceLength = width2 < 3 ? width2 * 2 : width2;
if (style2 === 3) {
dashLength = width2;
spaceLength = width2;
}
useLineDash = true;
if (length2 <= dashLength * 2) {
useLineDash = false;
} else if (length2 <= dashLength * 2 + spaceLength) {
multiplier = length2 / (2 * dashLength + spaceLength);
dashLength *= multiplier;
spaceLength *= multiplier;
} else {
numberOfDashes = Math.floor((length2 + spaceLength) / (dashLength + spaceLength));
minSpace = (length2 - numberOfDashes * dashLength) / (numberOfDashes - 1);
maxSpace = (length2 - (numberOfDashes + 1) * dashLength) / numberOfDashes;
spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
}
if (useLineDash) {
if (style2 === 3) {
this.ctx.setLineDash([0, dashLength + spaceLength]);
} else {
this.ctx.setLineDash([dashLength, spaceLength]);
}
}
if (style2 === 3) {
this.ctx.lineCap = "round";
this.ctx.lineWidth = width2;
} else {
this.ctx.lineWidth = width2 * 2 + 1.1;
}
this.ctx.strokeStyle = asString(color2);
this.ctx.stroke();
this.ctx.setLineDash([]);
if (style2 === 2) {
if (isBezierCurve(boxPaths[0])) {
path1 = boxPaths[3];
path2 = boxPaths[0];
this.ctx.beginPath();
this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
this.ctx.stroke();
}
if (isBezierCurve(boxPaths[1])) {
path1 = boxPaths[1];
path2 = boxPaths[2];
this.ctx.beginPath();
this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
this.ctx.stroke();
}
}
this.ctx.restore();
return [
2
/*return*/
];
});
});
};
CanvasRenderer2.prototype.render = function(element2) {
return __awaiter(this, void 0, void 0, function() {
var stack;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
if (this.options.backgroundColor) {
this.ctx.fillStyle = asString(this.options.backgroundColor);
this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);
}
stack = parseStackingContexts(element2);
return [4, this.renderStack(stack)];
case 1:
_a2.sent();
this.applyEffects([]);
return [2, this.canvas];
}
});
});
};
return CanvasRenderer2;
}(Renderer)
);
var isTextInputElement = function(container) {
if (container instanceof TextareaElementContainer) {
return true;
} else if (container instanceof SelectElementContainer) {
return true;
} else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {
return true;
}
return false;
};
var calculateBackgroundCurvedPaintingArea = function(clip2, curves2) {
switch (clip2) {
case 0:
return calculateBorderBoxPath(curves2);
case 2:
return calculateContentBoxPath(curves2);
case 1:
default:
return calculatePaddingBoxPath(curves2);
}
};
var canvasTextAlign = function(textAlign2) {
switch (textAlign2) {
case 1:
return "center";
case 2:
return "right";
case 0:
default:
return "left";
}
};
var iOSBrokenFonts = ["-apple-system", "system-ui"];
var fixIOSSystemFonts = function(fontFamilies) {
return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent) ? fontFamilies.filter(function(fontFamily2) {
return iOSBrokenFonts.indexOf(fontFamily2) === -1;
}) : fontFamilies;
};
var ForeignObjectRenderer = (
/** @class */
function(_super) {
__extends(ForeignObjectRenderer2, _super);
function ForeignObjectRenderer2(context2, options2) {
var _this = _super.call(this, context2, options2) || this;
_this.canvas = options2.canvas ? options2.canvas : document.createElement("canvas");
_this.ctx = _this.canvas.getContext("2d");
_this.options = options2;
_this.canvas.width = Math.floor(options2.width * options2.scale);
_this.canvas.height = Math.floor(options2.height * options2.scale);
_this.canvas.style.width = options2.width + "px";
_this.canvas.style.height = options2.height + "px";
_this.ctx.scale(_this.options.scale, _this.options.scale);
_this.ctx.translate(-options2.x, -options2.y);
_this.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (" + options2.width + "x" + options2.height + " at " + options2.x + "," + options2.y + ") with scale " + options2.scale);
return _this;
}
ForeignObjectRenderer2.prototype.render = function(element2) {
return __awaiter(this, void 0, void 0, function() {
var svg2, img;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
svg2 = createForeignObjectSVG(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, element2);
return [4, loadSerializedSVG(svg2)];
case 1:
img = _a2.sent();
if (this.options.backgroundColor) {
this.ctx.fillStyle = asString(this.options.backgroundColor);
this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);
}
this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);
return [2, this.canvas];
}
});
});
};
return ForeignObjectRenderer2;
}(Renderer)
);
var loadSerializedSVG = function(svg2) {
return new Promise(function(resolve3, reject2) {
var img = new Image();
img.onload = function() {
resolve3(img);
};
img.onerror = reject2;
img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg2));
});
};
var Logger = (
/** @class */
function() {
function Logger2(_a2) {
var id = _a2.id, enabled = _a2.enabled;
this.id = id;
this.enabled = enabled;
this.start = Date.now();
}
Logger2.prototype.debug = function() {
var args = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
args[_i2] = arguments[_i2];
}
if (this.enabled) {
if (typeof window !== "undefined" && window.console && typeof console.debug === "function") {
console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
} else {
this.info.apply(this, args);
}
}
};
Logger2.prototype.getTime = function() {
return Date.now() - this.start;
};
Logger2.prototype.info = function() {
var args = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
args[_i2] = arguments[_i2];
}
if (this.enabled) {
if (typeof window !== "undefined" && window.console && typeof console.info === "function") {
console.info.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
}
}
};
Logger2.prototype.warn = function() {
var args = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
args[_i2] = arguments[_i2];
}
if (this.enabled) {
if (typeof window !== "undefined" && window.console && typeof console.warn === "function") {
console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
} else {
this.info.apply(this, args);
}
}
};
Logger2.prototype.error = function() {
var args = [];
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
args[_i2] = arguments[_i2];
}
if (this.enabled) {
if (typeof window !== "undefined" && window.console && typeof console.error === "function") {
console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
} else {
this.info.apply(this, args);
}
}
};
Logger2.instances = {};
return Logger2;
}()
);
var Context = (
/** @class */
function() {
function Context2(options2, windowBounds) {
var _a2;
this.windowBounds = windowBounds;
this.instanceName = "#" + Context2.instanceCount++;
this.logger = new Logger({ id: this.instanceName, enabled: options2.logging });
this.cache = (_a2 = options2.cache) !== null && _a2 !== void 0 ? _a2 : new Cache(this, options2);
}
Context2.instanceCount = 1;
return Context2;
}()
);
var html2canvas = function(element2, options2) {
if (options2 === void 0) {
options2 = {};
}
return renderElement(element2, options2);
};
if (typeof window !== "undefined") {
CacheStorage.setContext(window);
}
var renderElement = function(element2, opts) {
return __awaiter(void 0, void 0, void 0, function() {
var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context2, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a2, width2, height2, left2, top2, backgroundColor2, renderOptions, canvas, renderer, root2, renderer;
var _b2, _c2, _d, _e2, _f, _g, _h, _j, _k, _l, _m, _o2, _p, _q, _r2, _s, _t2;
return __generator(this, function(_u2) {
switch (_u2.label) {
case 0:
if (!element2 || typeof element2 !== "object") {
return [2, Promise.reject("Invalid element provided as first argument")];
}
ownerDocument = element2.ownerDocument;
if (!ownerDocument) {
throw new Error("Element is not attached to a Document");
}
defaultView = ownerDocument.defaultView;
if (!defaultView) {
throw new Error("Document is not attached to a Window");
}
resourceOptions = {
allowTaint: (_b2 = opts.allowTaint) !== null && _b2 !== void 0 ? _b2 : false,
imageTimeout: (_c2 = opts.imageTimeout) !== null && _c2 !== void 0 ? _c2 : 15e3,
proxy: opts.proxy,
useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false
};
contextOptions = __assign({ logging: (_e2 = opts.logging) !== null && _e2 !== void 0 ? _e2 : true, cache: opts.cache }, resourceOptions);
windowOptions = {
windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth,
windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight,
scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset,
scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset
};
windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight);
context2 = new Context(contextOptions, windowBounds);
foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false;
cloneOptions = {
allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false,
onclone: opts.onclone,
ignoreElements: opts.ignoreElements,
inlineImages: foreignObjectRendering,
copyStyles: foreignObjectRendering
};
context2.logger.debug("Starting document clone with size " + windowBounds.width + "x" + windowBounds.height + " scrolled to " + -windowBounds.left + "," + -windowBounds.top);
documentCloner = new DocumentCloner(context2, element2, cloneOptions);
clonedElement = documentCloner.clonedReferenceElement;
if (!clonedElement) {
return [2, Promise.reject("Unable to find element in cloned iframe")];
}
return [4, documentCloner.toIFrame(ownerDocument, windowBounds)];
case 1:
container = _u2.sent();
_a2 = isBodyElement(clonedElement) || isHTMLElement(clonedElement) ? parseDocumentSize(clonedElement.ownerDocument) : parseBounds(context2, clonedElement), width2 = _a2.width, height2 = _a2.height, left2 = _a2.left, top2 = _a2.top;
backgroundColor2 = parseBackgroundColor(context2, clonedElement, opts.backgroundColor);
renderOptions = {
canvas: opts.canvas,
backgroundColor: backgroundColor2,
scale: (_o2 = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o2 !== void 0 ? _o2 : 1,
x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left2,
y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top2,
width: (_r2 = opts.width) !== null && _r2 !== void 0 ? _r2 : Math.ceil(width2),
height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height2)
};
if (!foreignObjectRendering)
return [3, 3];
context2.logger.debug("Document cloned, using foreign object rendering");
renderer = new ForeignObjectRenderer(context2, renderOptions);
return [4, renderer.render(clonedElement)];
case 2:
canvas = _u2.sent();
return [3, 5];
case 3:
context2.logger.debug("Document cloned, element located at " + left2 + "," + top2 + " with size " + width2 + "x" + height2 + " using computed rendering");
context2.logger.debug("Starting DOM parsing");
root2 = parseTree(context2, clonedElement);
if (backgroundColor2 === root2.styles.backgroundColor) {
root2.styles.backgroundColor = COLORS.TRANSPARENT;
}
context2.logger.debug("Starting renderer for element at " + renderOptions.x + "," + renderOptions.y + " with size " + renderOptions.width + "x" + renderOptions.height);
renderer = new CanvasRenderer(context2, renderOptions);
return [4, renderer.render(root2)];
case 4:
canvas = _u2.sent();
_u2.label = 5;
case 5:
if ((_t2 = opts.removeContainer) !== null && _t2 !== void 0 ? _t2 : true) {
if (!DocumentCloner.destroy(container)) {
context2.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore");
}
}
context2.logger.debug("Finished rendering");
return [2, canvas];
}
});
});
};
var parseBackgroundColor = function(context2, element2, backgroundColorOverride) {
var ownerDocument = element2.ownerDocument;
var documentBackgroundColor = ownerDocument.documentElement ? parseColor(context2, getComputedStyle(ownerDocument.documentElement).backgroundColor) : COLORS.TRANSPARENT;
var bodyBackgroundColor = ownerDocument.body ? parseColor(context2, getComputedStyle(ownerDocument.body).backgroundColor) : COLORS.TRANSPARENT;
var defaultBackgroundColor = typeof backgroundColorOverride === "string" ? parseColor(context2, backgroundColorOverride) : backgroundColorOverride === null ? COLORS.TRANSPARENT : 4294967295;
return element2 === ownerDocument.documentElement ? isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? defaultBackgroundColor : bodyBackgroundColor : documentBackgroundColor : defaultBackgroundColor;
};
const html2canvas_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: html2canvas
}, Symbol.toStringTag, { value: "Module" }));
/*! @license DOMPurify 2.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.5/LICENSE */
function _typeof$1(obj) {
"@babel/helpers - typeof";
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof$1(obj);
}
function _setPrototypeOf(o2, p2) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
o3.__proto__ = p3;
return o3;
};
return _setPrototypeOf(o2, p2);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e7) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct;
} else {
_construct = function _construct2(Parent2, args2, Class2) {
var a2 = [null];
a2.push.apply(a2, args2);
var Constructor = Function.bind.apply(Parent2, a2);
var instance2 = new Constructor();
if (Class2)
_setPrototypeOf(instance2, Class2.prototype);
return instance2;
};
}
return _construct.apply(null, arguments);
}
function _toConsumableArray(arr2) {
return _arrayWithoutHoles(arr2) || _iterableToArray(arr2) || _unsupportedIterableToArray(arr2) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr2) {
if (Array.isArray(arr2))
return _arrayLikeToArray(arr2);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
function _unsupportedIterableToArray(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray(o2, minLen);
}
function _arrayLikeToArray(arr2, len) {
if (len == null || len > arr2.length)
len = arr2.length;
for (var i2 = 0, arr22 = new Array(len); i2 < len; i2++)
arr22[i2] = arr2[i2];
return arr22;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var hasOwnProperty$1 = Object.hasOwnProperty, setPrototypeOf$2 = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf$2 = Object.getPrototypeOf, getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
var freeze = Object.freeze, seal = Object.seal, create$3 = Object.create;
var _ref = typeof Reflect !== "undefined" && Reflect, apply$4 = _ref.apply, construct$1 = _ref.construct;
if (!apply$4) {
apply$4 = function apply2(fun, thisValue, args) {
return fun.apply(thisValue, args);
};
}
if (!freeze) {
freeze = function freeze2(x2) {
return x2;
};
}
if (!seal) {
seal = function seal2(x2) {
return x2;
};
}
if (!construct$1) {
construct$1 = function construct2(Func, args) {
return _construct(Func, _toConsumableArray(args));
};
}
var arrayForEach = unapply(Array.prototype.forEach);
var arrayPop = unapply(Array.prototype.pop);
var arrayPush = unapply(Array.prototype.push);
var stringToLowerCase = unapply(String.prototype.toLowerCase);
var stringToString = unapply(String.prototype.toString);
var stringMatch = unapply(String.prototype.match);
var stringReplace = unapply(String.prototype.replace);
var stringIndexOf$2 = unapply(String.prototype.indexOf);
var stringTrim$1 = unapply(String.prototype.trim);
var regExpTest = unapply(RegExp.prototype.test);
var typeErrorCreate = unconstruct(TypeError);
function unapply(func) {
return function(thisArg) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return apply$4(func, thisArg, args);
};
}
function unconstruct(func) {
return function() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return construct$1(func, args);
};
}
function addToSet(set2, array2, transformCaseFunc) {
transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase;
if (setPrototypeOf$2) {
setPrototypeOf$2(set2, null);
}
var l2 = array2.length;
while (l2--) {
var element2 = array2[l2];
if (typeof element2 === "string") {
var lcElement = transformCaseFunc(element2);
if (lcElement !== element2) {
if (!isFrozen(array2)) {
array2[l2] = lcElement;
}
element2 = lcElement;
}
}
set2[element2] = true;
}
return set2;
}
function clone(object2) {
var newObject = create$3(null);
var property2;
for (property2 in object2) {
if (apply$4(hasOwnProperty$1, object2, [property2]) === true) {
newObject[property2] = object2[property2];
}
}
return newObject;
}
function lookupGetter(object2, prop) {
while (object2 !== null) {
var desc = getOwnPropertyDescriptor$5(object2, prop);
if (desc) {
if (desc.get) {
return unapply(desc.get);
}
if (typeof desc.value === "function") {
return unapply(desc.value);
}
}
object2 = getPrototypeOf$2(object2);
}
function fallbackValue(element2) {
console.warn("fallback value for", element2);
return null;
}
return fallbackValue;
}
var html$1$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
var svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
var svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
var svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
var mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]);
var mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
var text = freeze(["#text"]);
var html$3 = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
var svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
var mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
var xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
var TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
var IS_ALLOWED_URI = seal(
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
// eslint-disable-line no-useless-escape
);
var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
var ATTR_WHITESPACE = seal(
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
// eslint-disable-line no-control-regex
);
var DOCTYPE_NAME = seal(/^html$/i);
var getGlobal = function getGlobal2() {
return typeof window === "undefined" ? null : window;
};
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, document2) {
if (_typeof$1(trustedTypes) !== "object" || typeof trustedTypes.createPolicy !== "function") {
return null;
}
var suffix2 = null;
var ATTR_NAME = "data-tt-policy-suffix";
if (document2.currentScript && document2.currentScript.hasAttribute(ATTR_NAME)) {
suffix2 = document2.currentScript.getAttribute(ATTR_NAME);
}
var policyName = "dompurify" + (suffix2 ? "#" + suffix2 : "");
try {
return trustedTypes.createPolicy(policyName, {
createHTML: function createHTML(html2) {
return html2;
},
createScriptURL: function createScriptURL(scriptUrl) {
return scriptUrl;
}
});
} catch (_24) {
console.warn("TrustedTypes policy " + policyName + " could not be created.");
return null;
}
};
function createDOMPurify() {
var window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
var DOMPurify = function DOMPurify2(root2) {
return createDOMPurify(root2);
};
DOMPurify.version = "2.4.5";
DOMPurify.removed = [];
if (!window2 || !window2.document || window2.document.nodeType !== 9) {
DOMPurify.isSupported = false;
return DOMPurify;
}
var originalDocument = window2.document;
var document2 = window2.document;
var DocumentFragment = window2.DocumentFragment, HTMLTemplateElement = window2.HTMLTemplateElement, Node2 = window2.Node, Element3 = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap, HTMLFormElement = window2.HTMLFormElement, DOMParser2 = window2.DOMParser, trustedTypes = window2.trustedTypes;
var ElementPrototype = Element3.prototype;
var cloneNode2 = lookupGetter(ElementPrototype, "cloneNode");
var getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
var getChildNodes = lookupGetter(ElementPrototype, "childNodes");
var getParentNode2 = lookupGetter(ElementPrototype, "parentNode");
if (typeof HTMLTemplateElement === "function") {
var template = document2.createElement("template");
if (template.content && template.content.ownerDocument) {
document2 = template.content.ownerDocument;
}
}
var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML("") : "";
var _document = document2, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
var importNode = originalDocument.importNode;
var documentMode = {};
try {
documentMode = clone(document2).documentMode ? document2.documentMode : {};
} catch (_24) {
}
var hooks = {};
DOMPurify.isSupported = typeof getParentNode2 === "function" && implementation && typeof implementation.createHTMLDocument !== "undefined" && documentMode !== 9;
var MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE;
var IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
var ALLOWED_TAGS = null;
var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text)));
var ALLOWED_ATTR = null;
var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html$3), _toConsumableArray(svg), _toConsumableArray(mathMl), _toConsumableArray(xml)));
var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
tagNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
attributeNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
allowCustomizedBuiltInElements: {
writable: true,
configurable: false,
enumerable: true,
value: false
}
}));
var FORBID_TAGS = null;
var FORBID_ATTR = null;
var ALLOW_ARIA_ATTR = true;
var ALLOW_DATA_ATTR = true;
var ALLOW_UNKNOWN_PROTOCOLS = false;
var ALLOW_SELF_CLOSE_IN_ATTR = true;
var SAFE_FOR_TEMPLATES = false;
var WHOLE_DOCUMENT = false;
var SET_CONFIG = false;
var FORCE_BODY = false;
var RETURN_DOM = false;
var RETURN_DOM_FRAGMENT = false;
var RETURN_TRUSTED_TYPE = false;
var SANITIZE_DOM = true;
var SANITIZE_NAMED_PROPS = false;
var SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
var KEEP_CONTENT = true;
var IN_PLACE = false;
var USE_PROFILES = {};
var FORBID_CONTENTS = null;
var DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
var DATA_URI_TAGS = null;
var DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
var URI_SAFE_ATTRIBUTES = null;
var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
var MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
var NAMESPACE = HTML_NAMESPACE;
var IS_EMPTY_INPUT = false;
var ALLOWED_NAMESPACES = null;
var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
var PARSER_MEDIA_TYPE;
var SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
var DEFAULT_PARSER_MEDIA_TYPE = "text/html";
var transformCaseFunc;
var CONFIG = null;
var formElement = document2.createElement("form");
var isRegexOrFunction = function isRegexOrFunction2(testValue) {
return testValue instanceof RegExp || testValue instanceof Function;
};
var _parseConfig = function _parseConfig2(cfg) {
if (CONFIG && CONFIG === cfg) {
return;
}
if (!cfg || _typeof$1(cfg) !== "object") {
cfg = {};
}
cfg = clone(cfg);
PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE;
transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
ALLOWED_TAGS = "ALLOWED_TAGS" in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
ALLOWED_ATTR = "ALLOWED_ATTR" in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
ALLOWED_NAMESPACES = "ALLOWED_NAMESPACES" in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
URI_SAFE_ATTRIBUTES = "ADD_URI_SAFE_ATTR" in cfg ? addToSet(
clone(DEFAULT_URI_SAFE_ATTRIBUTES),
// eslint-disable-line indent
cfg.ADD_URI_SAFE_ATTR,
// eslint-disable-line indent
transformCaseFunc
// eslint-disable-line indent
) : DEFAULT_URI_SAFE_ATTRIBUTES;
DATA_URI_TAGS = "ADD_DATA_URI_TAGS" in cfg ? addToSet(
clone(DEFAULT_DATA_URI_TAGS),
// eslint-disable-line indent
cfg.ADD_DATA_URI_TAGS,
// eslint-disable-line indent
transformCaseFunc
// eslint-disable-line indent
) : DEFAULT_DATA_URI_TAGS;
FORBID_CONTENTS = "FORBID_CONTENTS" in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
FORBID_TAGS = "FORBID_TAGS" in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
FORBID_ATTR = "FORBID_ATTR" in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
USE_PROFILES = "USE_PROFILES" in cfg ? cfg.USE_PROFILES : false;
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
RETURN_DOM = cfg.RETURN_DOM || false;
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
FORCE_BODY = cfg.FORCE_BODY || false;
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
IN_PLACE = cfg.IN_PLACE || false;
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1;
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
}
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
}
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
}
if (SAFE_FOR_TEMPLATES) {
ALLOW_DATA_ATTR = false;
}
if (RETURN_DOM_FRAGMENT) {
RETURN_DOM = true;
}
if (USE_PROFILES) {
ALLOWED_TAGS = addToSet({}, _toConsumableArray(text));
ALLOWED_ATTR = [];
if (USE_PROFILES.html === true) {
addToSet(ALLOWED_TAGS, html$1$1);
addToSet(ALLOWED_ATTR, html$3);
}
if (USE_PROFILES.svg === true) {
addToSet(ALLOWED_TAGS, svg$1);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.svgFilters === true) {
addToSet(ALLOWED_TAGS, svgFilters);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.mathMl === true) {
addToSet(ALLOWED_TAGS, mathMl$1);
addToSet(ALLOWED_ATTR, mathMl);
addToSet(ALLOWED_ATTR, xml);
}
}
if (cfg.ADD_TAGS) {
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
ALLOWED_TAGS = clone(ALLOWED_TAGS);
}
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
}
if (cfg.ADD_ATTR) {
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
ALLOWED_ATTR = clone(ALLOWED_ATTR);
}
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
}
if (cfg.ADD_URI_SAFE_ATTR) {
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
}
if (cfg.FORBID_CONTENTS) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
}
if (KEEP_CONTENT) {
ALLOWED_TAGS["#text"] = true;
}
if (WHOLE_DOCUMENT) {
addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
}
if (ALLOWED_TAGS.table) {
addToSet(ALLOWED_TAGS, ["tbody"]);
delete FORBID_TAGS.tbody;
}
if (freeze) {
freeze(cfg);
}
CONFIG = cfg;
};
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
var HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
var ALL_SVG_TAGS = addToSet({}, svg$1);
addToSet(ALL_SVG_TAGS, svgFilters);
addToSet(ALL_SVG_TAGS, svgDisallowed);
var ALL_MATHML_TAGS = addToSet({}, mathMl$1);
addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
var _checkValidNamespace = function _checkValidNamespace2(element2) {
var parent = getParentNode2(element2);
if (!parent || !parent.tagName) {
parent = {
namespaceURI: NAMESPACE,
tagName: "template"
};
}
var tagName = stringToLowerCase(element2.tagName);
var parentTagName = stringToLowerCase(parent.tagName);
if (!ALLOWED_NAMESPACES[element2.namespaceURI]) {
return false;
}
if (element2.namespaceURI === SVG_NAMESPACE) {
if (parent.namespaceURI === HTML_NAMESPACE) {
return tagName === "svg";
}
if (parent.namespaceURI === MATHML_NAMESPACE) {
return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
}
return Boolean(ALL_SVG_TAGS[tagName]);
}
if (element2.namespaceURI === MATHML_NAMESPACE) {
if (parent.namespaceURI === HTML_NAMESPACE) {
return tagName === "math";
}
if (parent.namespaceURI === SVG_NAMESPACE) {
return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
}
return Boolean(ALL_MATHML_TAGS[tagName]);
}
if (element2.namespaceURI === HTML_NAMESPACE) {
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
return false;
}
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
return false;
}
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
}
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element2.namespaceURI]) {
return true;
}
return false;
};
var _forceRemove = function _forceRemove2(node2) {
arrayPush(DOMPurify.removed, {
element: node2
});
try {
node2.parentNode.removeChild(node2);
} catch (_24) {
try {
node2.outerHTML = emptyHTML;
} catch (_25) {
node2.remove();
}
}
};
var _removeAttribute = function _removeAttribute2(name, node2) {
try {
arrayPush(DOMPurify.removed, {
attribute: node2.getAttributeNode(name),
from: node2
});
} catch (_24) {
arrayPush(DOMPurify.removed, {
attribute: null,
from: node2
});
}
node2.removeAttribute(name);
if (name === "is" && !ALLOWED_ATTR[name]) {
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
try {
_forceRemove(node2);
} catch (_24) {
}
} else {
try {
node2.setAttribute(name, "");
} catch (_24) {
}
}
}
};
var _initDocument = function _initDocument2(dirty) {
var doc;
var leadingWhitespace;
if (FORCE_BODY) {
dirty = "<remove></remove>" + dirty;
} else {
var matches = stringMatch(dirty, /^[\r\n\t ]+/);
leadingWhitespace = matches && matches[0];
}
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
}
var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
if (NAMESPACE === HTML_NAMESPACE) {
try {
doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
} catch (_24) {
}
}
if (!doc || !doc.documentElement) {
doc = implementation.createDocument(NAMESPACE, "template", null);
try {
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
} catch (_24) {
}
}
var body = doc.body || doc.documentElement;
if (dirty && leadingWhitespace) {
body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
}
if (NAMESPACE === HTML_NAMESPACE) {
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
}
return WHOLE_DOCUMENT ? doc.documentElement : body;
};
var _createIterator = function _createIterator2(root2) {
return createNodeIterator.call(
root2.ownerDocument || root2,
root2,
// eslint-disable-next-line no-bitwise
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,
null,
false
);
};
var _isClobbered = function _isClobbered2(elm) {
return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
};
var _isNode = function _isNode2(object2) {
return _typeof$1(Node2) === "object" ? object2 instanceof Node2 : object2 && _typeof$1(object2) === "object" && typeof object2.nodeType === "number" && typeof object2.nodeName === "string";
};
var _executeHook = function _executeHook2(entryPoint, currentNode, data2) {
if (!hooks[entryPoint]) {
return;
}
arrayForEach(hooks[entryPoint], function(hook) {
hook.call(DOMPurify, currentNode, data2, CONFIG);
});
};
var _sanitizeElements = function _sanitizeElements2(currentNode) {
var content2;
_executeHook("beforeSanitizeElements", currentNode, null);
if (_isClobbered(currentNode)) {
_forceRemove(currentNode);
return true;
}
if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
_forceRemove(currentNode);
return true;
}
var tagName = transformCaseFunc(currentNode.nodeName);
_executeHook("uponSanitizeElement", currentNode, {
tagName,
allowedTags: ALLOWED_TAGS
});
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
_forceRemove(currentNode);
return true;
}
if (tagName === "select" && regExpTest(/<template/i, currentNode.innerHTML)) {
_forceRemove(currentNode);
return true;
}
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
if (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName))
return false;
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))
return false;
}
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
var parentNode = getParentNode2(currentNode) || currentNode.parentNode;
var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
if (childNodes && parentNode) {
var childCount = childNodes.length;
for (var i2 = childCount - 1; i2 >= 0; --i2) {
parentNode.insertBefore(cloneNode2(childNodes[i2], true), getNextSibling(currentNode));
}
}
}
_forceRemove(currentNode);
return true;
}
if (currentNode instanceof Element3 && !_checkValidNamespace(currentNode)) {
_forceRemove(currentNode);
return true;
}
if ((tagName === "noscript" || tagName === "noembed") && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
_forceRemove(currentNode);
return true;
}
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
content2 = currentNode.textContent;
content2 = stringReplace(content2, MUSTACHE_EXPR$1, " ");
content2 = stringReplace(content2, ERB_EXPR$1, " ");
content2 = stringReplace(content2, TMPLIT_EXPR$1, " ");
if (currentNode.textContent !== content2) {
arrayPush(DOMPurify.removed, {
element: currentNode.cloneNode()
});
currentNode.textContent = content2;
}
}
_executeHook("afterSanitizeElements", currentNode, null);
return false;
};
var _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value2) {
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value2 in document2 || value2 in formElement)) {
return false;
}
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$1, lcName))
;
else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName))
;
else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
if (
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
_basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value2) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value2))
)
;
else {
return false;
}
} else if (URI_SAFE_ATTRIBUTES[lcName])
;
else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value2, ATTR_WHITESPACE$1, "")))
;
else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf$2(value2, "data:") === 0 && DATA_URI_TAGS[lcTag])
;
else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value2, ATTR_WHITESPACE$1, "")))
;
else if (!value2)
;
else {
return false;
}
return true;
};
var _basicCustomElementTest = function _basicCustomElementTest2(tagName) {
return tagName.indexOf("-") > 0;
};
var _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
var attr2;
var value2;
var lcName;
var l2;
_executeHook("beforeSanitizeAttributes", currentNode, null);
var attributes = currentNode.attributes;
if (!attributes) {
return;
}
var hookEvent = {
attrName: "",
attrValue: "",
keepAttr: true,
allowedAttributes: ALLOWED_ATTR
};
l2 = attributes.length;
while (l2--) {
attr2 = attributes[l2];
var _attr = attr2, name = _attr.name, namespaceURI = _attr.namespaceURI;
value2 = name === "value" ? attr2.value : stringTrim$1(attr2.value);
lcName = transformCaseFunc(name);
hookEvent.attrName = lcName;
hookEvent.attrValue = value2;
hookEvent.keepAttr = true;
hookEvent.forceKeepAttr = void 0;
_executeHook("uponSanitizeAttribute", currentNode, hookEvent);
value2 = hookEvent.attrValue;
if (hookEvent.forceKeepAttr) {
continue;
}
_removeAttribute(name, currentNode);
if (!hookEvent.keepAttr) {
continue;
}
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value2)) {
_removeAttribute(name, currentNode);
continue;
}
if (SAFE_FOR_TEMPLATES) {
value2 = stringReplace(value2, MUSTACHE_EXPR$1, " ");
value2 = stringReplace(value2, ERB_EXPR$1, " ");
value2 = stringReplace(value2, TMPLIT_EXPR$1, " ");
}
var lcTag = transformCaseFunc(currentNode.nodeName);
if (!_isValidAttribute(lcTag, lcName, value2)) {
continue;
}
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
_removeAttribute(name, currentNode);
value2 = SANITIZE_NAMED_PROPS_PREFIX + value2;
}
if (trustedTypesPolicy && _typeof$1(trustedTypes) === "object" && typeof trustedTypes.getAttributeType === "function") {
if (namespaceURI)
;
else {
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
case "TrustedHTML":
value2 = trustedTypesPolicy.createHTML(value2);
break;
case "TrustedScriptURL":
value2 = trustedTypesPolicy.createScriptURL(value2);
break;
}
}
}
try {
if (namespaceURI) {
currentNode.setAttributeNS(namespaceURI, name, value2);
} else {
currentNode.setAttribute(name, value2);
}
arrayPop(DOMPurify.removed);
} catch (_24) {
}
}
_executeHook("afterSanitizeAttributes", currentNode, null);
};
var _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
var shadowNode;
var shadowIterator = _createIterator(fragment);
_executeHook("beforeSanitizeShadowDOM", fragment, null);
while (shadowNode = shadowIterator.nextNode()) {
_executeHook("uponSanitizeShadowNode", shadowNode, null);
if (_sanitizeElements(shadowNode)) {
continue;
}
if (shadowNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM2(shadowNode.content);
}
_sanitizeAttributes(shadowNode);
}
_executeHook("afterSanitizeShadowDOM", fragment, null);
};
DOMPurify.sanitize = function(dirty) {
var cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var body;
var importedNode;
var currentNode;
var oldNode;
var returnNode;
IS_EMPTY_INPUT = !dirty;
if (IS_EMPTY_INPUT) {
dirty = "<!-->";
}
if (typeof dirty !== "string" && !_isNode(dirty)) {
if (typeof dirty.toString !== "function") {
throw typeErrorCreate("toString is not a function");
} else {
dirty = dirty.toString();
if (typeof dirty !== "string") {
throw typeErrorCreate("dirty is not a string, aborting");
}
}
}
if (!DOMPurify.isSupported) {
if (_typeof$1(window2.toStaticHTML) === "object" || typeof window2.toStaticHTML === "function") {
if (typeof dirty === "string") {
return window2.toStaticHTML(dirty);
}
if (_isNode(dirty)) {
return window2.toStaticHTML(dirty.outerHTML);
}
}
return dirty;
}
if (!SET_CONFIG) {
_parseConfig(cfg);
}
DOMPurify.removed = [];
if (typeof dirty === "string") {
IN_PLACE = false;
}
if (IN_PLACE) {
if (dirty.nodeName) {
var tagName = transformCaseFunc(dirty.nodeName);
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
}
}
} else if (dirty instanceof Node2) {
body = _initDocument("<!---->");
importedNode = body.ownerDocument.importNode(dirty, true);
if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
body = importedNode;
} else if (importedNode.nodeName === "HTML") {
body = importedNode;
} else {
body.appendChild(importedNode);
}
} else {
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
dirty.indexOf("<") === -1) {
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
}
body = _initDocument(dirty);
if (!body) {
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
}
}
if (body && FORCE_BODY) {
_forceRemove(body.firstChild);
}
var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
while (currentNode = nodeIterator.nextNode()) {
if (currentNode.nodeType === 3 && currentNode === oldNode) {
continue;
}
if (_sanitizeElements(currentNode)) {
continue;
}
if (currentNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM(currentNode.content);
}
_sanitizeAttributes(currentNode);
oldNode = currentNode;
}
oldNode = null;
if (IN_PLACE) {
return dirty;
}
if (RETURN_DOM) {
if (RETURN_DOM_FRAGMENT) {
returnNode = createDocumentFragment.call(body.ownerDocument);
while (body.firstChild) {
returnNode.appendChild(body.firstChild);
}
} else {
returnNode = body;
}
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {
returnNode = importNode.call(originalDocument, returnNode, true);
}
return returnNode;
}
var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
}
if (SAFE_FOR_TEMPLATES) {
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$1, " ");
serializedHTML = stringReplace(serializedHTML, ERB_EXPR$1, " ");
serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR$1, " ");
}
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
};
DOMPurify.setConfig = function(cfg) {
_parseConfig(cfg);
SET_CONFIG = true;
};
DOMPurify.clearConfig = function() {
CONFIG = null;
SET_CONFIG = false;
};
DOMPurify.isValidAttribute = function(tag, attr2, value2) {
if (!CONFIG) {
_parseConfig({});
}
var lcTag = transformCaseFunc(tag);
var lcName = transformCaseFunc(attr2);
return _isValidAttribute(lcTag, lcName, value2);
};
DOMPurify.addHook = function(entryPoint, hookFunction) {
if (typeof hookFunction !== "function") {
return;
}
hooks[entryPoint] = hooks[entryPoint] || [];
arrayPush(hooks[entryPoint], hookFunction);
};
DOMPurify.removeHook = function(entryPoint) {
if (hooks[entryPoint]) {
return arrayPop(hooks[entryPoint]);
}
};
DOMPurify.removeHooks = function(entryPoint) {
if (hooks[entryPoint]) {
hooks[entryPoint] = [];
}
};
DOMPurify.removeAllHooks = function() {
hooks = {};
};
return DOMPurify;
}
var purify = createDOMPurify();
const purify_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: purify
}, Symbol.toStringTag, { value: "Module" }));
var check = function(it2) {
return it2 && it2.Math == Math && it2;
};
var global$k = (
// eslint-disable-next-line es/no-global-this -- safe
check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
check(typeof self == "object" && self) || check(typeof commonjsGlobal$1 == "object" && commonjsGlobal$1) || // eslint-disable-next-line no-new-func -- fallback
function() {
return this;
}() || commonjsGlobal$1 || Function("return this")()
);
var objectGetOwnPropertyDescriptor = {};
var fails$l = function(exec2) {
try {
return !!exec2();
} catch (error3) {
return true;
}
};
var fails$k = fails$l;
var descriptors = !fails$k(function() {
return Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1] != 7;
});
var fails$j = fails$l;
var functionBindNative = !fails$j(function() {
var test2 = (function() {
}).bind();
return typeof test2 != "function" || test2.hasOwnProperty("prototype");
});
var NATIVE_BIND$3 = functionBindNative;
var call$j = Function.prototype.call;
var functionCall = NATIVE_BIND$3 ? call$j.bind(call$j) : function() {
return call$j.apply(call$j, arguments);
};
var objectPropertyIsEnumerable = {};
var $propertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor$4 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable2(V2) {
var descriptor = getOwnPropertyDescriptor$4(this, V2);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
var createPropertyDescriptor$4 = function(bitmap, value2) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value2
};
};
var NATIVE_BIND$2 = functionBindNative;
var FunctionPrototype$2 = Function.prototype;
var call$i = FunctionPrototype$2.call;
var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$i, call$i);
var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function(fn8) {
return function() {
return call$i.apply(fn8, arguments);
};
};
var uncurryThis$p = functionUncurryThis;
var toString$b = uncurryThis$p({}.toString);
var stringSlice$7 = uncurryThis$p("".slice);
var classofRaw$2 = function(it2) {
return stringSlice$7(toString$b(it2), 8, -1);
};
var uncurryThis$o = functionUncurryThis;
var fails$i = fails$l;
var classof$8 = classofRaw$2;
var $Object$4 = Object;
var split = uncurryThis$o("".split);
var indexedObject = fails$i(function() {
return !$Object$4("z").propertyIsEnumerable(0);
}) ? function(it2) {
return classof$8(it2) == "String" ? split(it2, "") : $Object$4(it2);
} : $Object$4;
var isNullOrUndefined$7 = function(it2) {
return it2 === null || it2 === void 0;
};
var isNullOrUndefined$6 = isNullOrUndefined$7;
var $TypeError$f = TypeError;
var requireObjectCoercible$a = function(it2) {
if (isNullOrUndefined$6(it2))
throw $TypeError$f("Can't call method on " + it2);
return it2;
};
var IndexedObject$1 = indexedObject;
var requireObjectCoercible$9 = requireObjectCoercible$a;
var toIndexedObject$5 = function(it2) {
return IndexedObject$1(requireObjectCoercible$9(it2));
};
var documentAll$2 = typeof document == "object" && document.all;
var IS_HTMLDDA = typeof documentAll$2 == "undefined" && documentAll$2 !== void 0;
var documentAll_1 = {
all: documentAll$2,
IS_HTMLDDA
};
var $documentAll$1 = documentAll_1;
var documentAll$1 = $documentAll$1.all;
var isCallable$m = $documentAll$1.IS_HTMLDDA ? function(argument) {
return typeof argument == "function" || argument === documentAll$1;
} : function(argument) {
return typeof argument == "function";
};
var isCallable$l = isCallable$m;
var $documentAll = documentAll_1;
var documentAll = $documentAll.all;
var isObject$9 = $documentAll.IS_HTMLDDA ? function(it2) {
return typeof it2 == "object" ? it2 !== null : isCallable$l(it2) || it2 === documentAll;
} : function(it2) {
return typeof it2 == "object" ? it2 !== null : isCallable$l(it2);
};
var global$j = global$k;
var isCallable$k = isCallable$m;
var aFunction = function(argument) {
return isCallable$k(argument) ? argument : void 0;
};
var getBuiltIn$7 = function(namespace, method) {
return arguments.length < 2 ? aFunction(global$j[namespace]) : global$j[namespace] && global$j[namespace][method];
};
var uncurryThis$n = functionUncurryThis;
var objectIsPrototypeOf = uncurryThis$n({}.isPrototypeOf);
var engineUserAgent = typeof navigator != "undefined" && String(navigator.userAgent) || "";
var global$i = global$k;
var userAgent$3 = engineUserAgent;
var process$4 = global$i.process;
var Deno$1 = global$i.Deno;
var versions = process$4 && process$4.versions || Deno$1 && Deno$1.version;
var v8 = versions && versions.v8;
var match, version;
if (v8) {
match = v8.split(".");
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
}
if (!version && userAgent$3) {
match = userAgent$3.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = userAgent$3.match(/Chrome\/(\d+)/);
if (match)
version = +match[1];
}
}
var engineV8Version = version;
var V8_VERSION$1 = engineV8Version;
var fails$h = fails$l;
var global$h = global$k;
var $String$5 = global$h.String;
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$h(function() {
var symbol2 = Symbol();
return !$String$5(symbol2) || !(Object(symbol2) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
!Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
});
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == "symbol";
var getBuiltIn$6 = getBuiltIn$7;
var isCallable$j = isCallable$m;
var isPrototypeOf$3 = objectIsPrototypeOf;
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
var $Object$3 = Object;
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function(it2) {
return typeof it2 == "symbol";
} : function(it2) {
var $Symbol = getBuiltIn$6("Symbol");
return isCallable$j($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it2));
};
var $String$4 = String;
var tryToString$4 = function(argument) {
try {
return $String$4(argument);
} catch (error3) {
return "Object";
}
};
var isCallable$i = isCallable$m;
var tryToString$3 = tryToString$4;
var $TypeError$e = TypeError;
var aCallable$9 = function(argument) {
if (isCallable$i(argument))
return argument;
throw $TypeError$e(tryToString$3(argument) + " is not a function");
};
var aCallable$8 = aCallable$9;
var isNullOrUndefined$5 = isNullOrUndefined$7;
var getMethod$6 = function(V2, P2) {
var func = V2[P2];
return isNullOrUndefined$5(func) ? void 0 : aCallable$8(func);
};
var call$h = functionCall;
var isCallable$h = isCallable$m;
var isObject$8 = isObject$9;
var $TypeError$d = TypeError;
var ordinaryToPrimitive$1 = function(input, pref) {
var fn8, val;
if (pref === "string" && isCallable$h(fn8 = input.toString) && !isObject$8(val = call$h(fn8, input)))
return val;
if (isCallable$h(fn8 = input.valueOf) && !isObject$8(val = call$h(fn8, input)))
return val;
if (pref !== "string" && isCallable$h(fn8 = input.toString) && !isObject$8(val = call$h(fn8, input)))
return val;
throw $TypeError$d("Can't convert object to primitive value");
};
var shared$4 = { exports: {} };
var global$g = global$k;
var defineProperty$5 = Object.defineProperty;
var defineGlobalProperty$3 = function(key2, value2) {
try {
defineProperty$5(global$g, key2, { value: value2, configurable: true, writable: true });
} catch (error3) {
global$g[key2] = value2;
}
return value2;
};
var global$f = global$k;
var defineGlobalProperty$2 = defineGlobalProperty$3;
var SHARED = "__core-js_shared__";
var store$3 = global$f[SHARED] || defineGlobalProperty$2(SHARED, {});
var sharedStore = store$3;
var store$2 = sharedStore;
(shared$4.exports = function(key2, value2) {
return store$2[key2] || (store$2[key2] = value2 !== void 0 ? value2 : {});
})("versions", []).push({
version: "3.31.0",
mode: "global",
copyright: "© 2014-2023 Denis Pushkarev (zloirock.ru)",
license: "https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",
source: "https://github.com/zloirock/core-js"
});
var sharedExports = shared$4.exports;
var requireObjectCoercible$8 = requireObjectCoercible$a;
var $Object$2 = Object;
var toObject$4 = function(argument) {
return $Object$2(requireObjectCoercible$8(argument));
};
var uncurryThis$m = functionUncurryThis;
var toObject$3 = toObject$4;
var hasOwnProperty = uncurryThis$m({}.hasOwnProperty);
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it2, key2) {
return hasOwnProperty(toObject$3(it2), key2);
};
var uncurryThis$l = functionUncurryThis;
var id$1 = 0;
var postfix = Math.random();
var toString$a = uncurryThis$l(1 .toString);
var uid$2 = function(key2) {
return "Symbol(" + (key2 === void 0 ? "" : key2) + ")_" + toString$a(++id$1 + postfix, 36);
};
var global$e = global$k;
var shared$3 = sharedExports;
var hasOwn$a = hasOwnProperty_1;
var uid$1 = uid$2;
var NATIVE_SYMBOL = symbolConstructorDetection;
var USE_SYMBOL_AS_UID = useSymbolAsUid;
var Symbol$1 = global$e.Symbol;
var WellKnownSymbolsStore = shared$3("wks");
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1["for"] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
var wellKnownSymbol$i = function(name) {
if (!hasOwn$a(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$a(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol("Symbol." + name);
}
return WellKnownSymbolsStore[name];
};
var call$g = functionCall;
var isObject$7 = isObject$9;
var isSymbol$1 = isSymbol$2;
var getMethod$5 = getMethod$6;
var ordinaryToPrimitive = ordinaryToPrimitive$1;
var wellKnownSymbol$h = wellKnownSymbol$i;
var $TypeError$c = TypeError;
var TO_PRIMITIVE = wellKnownSymbol$h("toPrimitive");
var toPrimitive$1 = function(input, pref) {
if (!isObject$7(input) || isSymbol$1(input))
return input;
var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === void 0)
pref = "default";
result = call$g(exoticToPrim, input, pref);
if (!isObject$7(result) || isSymbol$1(result))
return result;
throw $TypeError$c("Can't convert object to primitive value");
}
if (pref === void 0)
pref = "number";
return ordinaryToPrimitive(input, pref);
};
var toPrimitive = toPrimitive$1;
var isSymbol = isSymbol$2;
var toPropertyKey$3 = function(argument) {
var key2 = toPrimitive(argument, "string");
return isSymbol(key2) ? key2 : key2 + "";
};
var global$d = global$k;
var isObject$6 = isObject$9;
var document$3 = global$d.document;
var EXISTS$1 = isObject$6(document$3) && isObject$6(document$3.createElement);
var documentCreateElement$2 = function(it2) {
return EXISTS$1 ? document$3.createElement(it2) : {};
};
var DESCRIPTORS$9 = descriptors;
var fails$g = fails$l;
var createElement$1 = documentCreateElement$2;
var ie8DomDefine = !DESCRIPTORS$9 && !fails$g(function() {
return Object.defineProperty(createElement$1("div"), "a", {
get: function() {
return 7;
}
}).a != 7;
});
var DESCRIPTORS$8 = descriptors;
var call$f = functionCall;
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
var createPropertyDescriptor$3 = createPropertyDescriptor$4;
var toIndexedObject$4 = toIndexedObject$5;
var toPropertyKey$2 = toPropertyKey$3;
var hasOwn$9 = hasOwnProperty_1;
var IE8_DOM_DEFINE$1 = ie8DomDefine;
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O2, P2) {
O2 = toIndexedObject$4(O2);
P2 = toPropertyKey$2(P2);
if (IE8_DOM_DEFINE$1)
try {
return $getOwnPropertyDescriptor$1(O2, P2);
} catch (error3) {
}
if (hasOwn$9(O2, P2))
return createPropertyDescriptor$3(!call$f(propertyIsEnumerableModule.f, O2, P2), O2[P2]);
};
var objectDefineProperty = {};
var DESCRIPTORS$7 = descriptors;
var fails$f = fails$l;
var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$f(function() {
return Object.defineProperty(function() {
}, "prototype", {
value: 42,
writable: false
}).prototype != 42;
});
var isObject$5 = isObject$9;
var $String$3 = String;
var $TypeError$b = TypeError;
var anObject$g = function(argument) {
if (isObject$5(argument))
return argument;
throw $TypeError$b($String$3(argument) + " is not an object");
};
var DESCRIPTORS$6 = descriptors;
var IE8_DOM_DEFINE = ie8DomDefine;
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
var anObject$f = anObject$g;
var toPropertyKey$1 = toPropertyKey$3;
var $TypeError$a = TypeError;
var $defineProperty = Object.defineProperty;
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = "enumerable";
var CONFIGURABLE$1 = "configurable";
var WRITABLE = "writable";
objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O2, P2, Attributes) {
anObject$f(O2);
P2 = toPropertyKey$1(P2);
anObject$f(Attributes);
if (typeof O2 === "function" && P2 === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
var current = $getOwnPropertyDescriptor(O2, P2);
if (current && current[WRITABLE]) {
O2[P2] = Attributes.value;
Attributes = {
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
}
return $defineProperty(O2, P2, Attributes);
} : $defineProperty : function defineProperty2(O2, P2, Attributes) {
anObject$f(O2);
P2 = toPropertyKey$1(P2);
anObject$f(Attributes);
if (IE8_DOM_DEFINE)
try {
return $defineProperty(O2, P2, Attributes);
} catch (error3) {
}
if ("get" in Attributes || "set" in Attributes)
throw $TypeError$a("Accessors not supported");
if ("value" in Attributes)
O2[P2] = Attributes.value;
return O2;
};
var DESCRIPTORS$5 = descriptors;
var definePropertyModule$4 = objectDefineProperty;
var createPropertyDescriptor$2 = createPropertyDescriptor$4;
var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function(object2, key2, value2) {
return definePropertyModule$4.f(object2, key2, createPropertyDescriptor$2(1, value2));
} : function(object2, key2, value2) {
object2[key2] = value2;
return object2;
};
var makeBuiltIn$3 = { exports: {} };
var DESCRIPTORS$4 = descriptors;
var hasOwn$8 = hasOwnProperty_1;
var FunctionPrototype$1 = Function.prototype;
var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn$8(FunctionPrototype$1, "name");
var PROPER = EXISTS && (function something() {
}).name === "something";
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, "name").configurable);
var functionName = {
EXISTS,
PROPER,
CONFIGURABLE
};
var uncurryThis$k = functionUncurryThis;
var isCallable$g = isCallable$m;
var store$1 = sharedStore;
var functionToString = uncurryThis$k(Function.toString);
if (!isCallable$g(store$1.inspectSource)) {
store$1.inspectSource = function(it2) {
return functionToString(it2);
};
}
var inspectSource$3 = store$1.inspectSource;
var global$c = global$k;
var isCallable$f = isCallable$m;
var WeakMap$2 = global$c.WeakMap;
var weakMapBasicDetection = isCallable$f(WeakMap$2) && /native code/.test(String(WeakMap$2));
var shared$2 = sharedExports;
var uid = uid$2;
var keys = shared$2("keys");
var sharedKey$3 = function(key2) {
return keys[key2] || (keys[key2] = uid(key2));
};
var hiddenKeys$4 = {};
var NATIVE_WEAK_MAP = weakMapBasicDetection;
var global$b = global$k;
var isObject$4 = isObject$9;
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
var hasOwn$7 = hasOwnProperty_1;
var shared$1 = sharedStore;
var sharedKey$2 = sharedKey$3;
var hiddenKeys$3 = hiddenKeys$4;
var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
var TypeError$2 = global$b.TypeError;
var WeakMap$1 = global$b.WeakMap;
var set$1, get, has;
var enforce = function(it2) {
return has(it2) ? get(it2) : set$1(it2, {});
};
var getterFor = function(TYPE) {
return function(it2) {
var state;
if (!isObject$4(it2) || (state = get(it2)).type !== TYPE) {
throw TypeError$2("Incompatible receiver, " + TYPE + " required");
}
return state;
};
};
if (NATIVE_WEAK_MAP || shared$1.state) {
var store = shared$1.state || (shared$1.state = new WeakMap$1());
store.get = store.get;
store.has = store.has;
store.set = store.set;
set$1 = function(it2, metadata2) {
if (store.has(it2))
throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
metadata2.facade = it2;
store.set(it2, metadata2);
return metadata2;
};
get = function(it2) {
return store.get(it2) || {};
};
has = function(it2) {
return store.has(it2);
};
} else {
var STATE = sharedKey$2("state");
hiddenKeys$3[STATE] = true;
set$1 = function(it2, metadata2) {
if (hasOwn$7(it2, STATE))
throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
metadata2.facade = it2;
createNonEnumerableProperty$4(it2, STATE, metadata2);
return metadata2;
};
get = function(it2) {
return hasOwn$7(it2, STATE) ? it2[STATE] : {};
};
has = function(it2) {
return hasOwn$7(it2, STATE);
};
}
var internalState = {
set: set$1,
get,
has,
enforce,
getterFor
};
var uncurryThis$j = functionUncurryThis;
var fails$e = fails$l;
var isCallable$e = isCallable$m;
var hasOwn$6 = hasOwnProperty_1;
var DESCRIPTORS$3 = descriptors;
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
var inspectSource$2 = inspectSource$3;
var InternalStateModule$2 = internalState;
var enforceInternalState = InternalStateModule$2.enforce;
var getInternalState$2 = InternalStateModule$2.get;
var $String$2 = String;
var defineProperty$4 = Object.defineProperty;
var stringSlice$6 = uncurryThis$j("".slice);
var replace$3 = uncurryThis$j("".replace);
var join = uncurryThis$j([].join);
var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$e(function() {
return defineProperty$4(function() {
}, "length", { value: 8 }).length !== 8;
});
var TEMPLATE = String(String).split("String");
var makeBuiltIn$2 = makeBuiltIn$3.exports = function(value2, name, options2) {
if (stringSlice$6($String$2(name), 0, 7) === "Symbol(") {
name = "[" + replace$3($String$2(name), /^Symbol\(([^)]*)\)/, "$1") + "]";
}
if (options2 && options2.getter)
name = "get " + name;
if (options2 && options2.setter)
name = "set " + name;
if (!hasOwn$6(value2, "name") || CONFIGURABLE_FUNCTION_NAME$1 && value2.name !== name) {
if (DESCRIPTORS$3)
defineProperty$4(value2, "name", { value: name, configurable: true });
else
value2.name = name;
}
if (CONFIGURABLE_LENGTH && options2 && hasOwn$6(options2, "arity") && value2.length !== options2.arity) {
defineProperty$4(value2, "length", { value: options2.arity });
}
try {
if (options2 && hasOwn$6(options2, "constructor") && options2.constructor) {
if (DESCRIPTORS$3)
defineProperty$4(value2, "prototype", { writable: false });
} else if (value2.prototype)
value2.prototype = void 0;
} catch (error3) {
}
var state = enforceInternalState(value2);
if (!hasOwn$6(state, "source")) {
state.source = join(TEMPLATE, typeof name == "string" ? name : "");
}
return value2;
};
Function.prototype.toString = makeBuiltIn$2(function toString2() {
return isCallable$e(this) && getInternalState$2(this).source || inspectSource$2(this);
}, "toString");
var makeBuiltInExports = makeBuiltIn$3.exports;
var isCallable$d = isCallable$m;
var definePropertyModule$3 = objectDefineProperty;
var makeBuiltIn$1 = makeBuiltInExports;
var defineGlobalProperty$1 = defineGlobalProperty$3;
var defineBuiltIn$7 = function(O2, key2, value2, options2) {
if (!options2)
options2 = {};
var simple2 = options2.enumerable;
var name = options2.name !== void 0 ? options2.name : key2;
if (isCallable$d(value2))
makeBuiltIn$1(value2, name, options2);
if (options2.global) {
if (simple2)
O2[key2] = value2;
else
defineGlobalProperty$1(key2, value2);
} else {
try {
if (!options2.unsafe)
delete O2[key2];
else if (O2[key2])
simple2 = true;
} catch (error3) {
}
if (simple2)
O2[key2] = value2;
else
definePropertyModule$3.f(O2, key2, {
value: value2,
enumerable: false,
configurable: !options2.nonConfigurable,
writable: !options2.nonWritable
});
}
return O2;
};
var objectGetOwnPropertyNames = {};
var ceil = Math.ceil;
var floor$1 = Math.floor;
var mathTrunc = Math.trunc || function trunc(x2) {
var n2 = +x2;
return (n2 > 0 ? floor$1 : ceil)(n2);
};
var trunc2 = mathTrunc;
var toIntegerOrInfinity$4 = function(argument) {
var number2 = +argument;
return number2 !== number2 || number2 === 0 ? 0 : trunc2(number2);
};
var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
var max$2 = Math.max;
var min$5 = Math.min;
var toAbsoluteIndex$2 = function(index2, length2) {
var integer = toIntegerOrInfinity$3(index2);
return integer < 0 ? max$2(integer + length2, 0) : min$5(integer, length2);
};
var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
var min$4 = Math.min;
var toLength$6 = function(argument) {
return argument > 0 ? min$4(toIntegerOrInfinity$2(argument), 9007199254740991) : 0;
};
var toLength$5 = toLength$6;
var lengthOfArrayLike$4 = function(obj) {
return toLength$5(obj.length);
};
var toIndexedObject$3 = toIndexedObject$5;
var toAbsoluteIndex$1 = toAbsoluteIndex$2;
var lengthOfArrayLike$3 = lengthOfArrayLike$4;
var createMethod$3 = function(IS_INCLUDES) {
return function($this, el, fromIndex) {
var O2 = toIndexedObject$3($this);
var length2 = lengthOfArrayLike$3(O2);
var index2 = toAbsoluteIndex$1(fromIndex, length2);
var value2;
if (IS_INCLUDES && el != el)
while (length2 > index2) {
value2 = O2[index2++];
if (value2 != value2)
return true;
}
else
for (; length2 > index2; index2++) {
if ((IS_INCLUDES || index2 in O2) && O2[index2] === el)
return IS_INCLUDES || index2 || 0;
}
return !IS_INCLUDES && -1;
};
};
var arrayIncludes = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod$3(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod$3(false)
};
var uncurryThis$i = functionUncurryThis;
var hasOwn$5 = hasOwnProperty_1;
var toIndexedObject$2 = toIndexedObject$5;
var indexOf$1 = arrayIncludes.indexOf;
var hiddenKeys$2 = hiddenKeys$4;
var push$2 = uncurryThis$i([].push);
var objectKeysInternal = function(object2, names) {
var O2 = toIndexedObject$2(object2);
var i2 = 0;
var result = [];
var key2;
for (key2 in O2)
!hasOwn$5(hiddenKeys$2, key2) && hasOwn$5(O2, key2) && push$2(result, key2);
while (names.length > i2)
if (hasOwn$5(O2, key2 = names[i2++])) {
~indexOf$1(result, key2) || push$2(result, key2);
}
return result;
};
var enumBugKeys$3 = [
"constructor",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"valueOf"
];
var internalObjectKeys$1 = objectKeysInternal;
var enumBugKeys$2 = enumBugKeys$3;
var hiddenKeys$1 = enumBugKeys$2.concat("length", "prototype");
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames2(O2) {
return internalObjectKeys$1(O2, hiddenKeys$1);
};
var objectGetOwnPropertySymbols = {};
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
var getBuiltIn$5 = getBuiltIn$7;
var uncurryThis$h = functionUncurryThis;
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
var anObject$e = anObject$g;
var concat$1 = uncurryThis$h([].concat);
var ownKeys$4 = getBuiltIn$5("Reflect", "ownKeys") || function ownKeys(it2) {
var keys3 = getOwnPropertyNamesModule.f(anObject$e(it2));
var getOwnPropertySymbols2 = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols2 ? concat$1(keys3, getOwnPropertySymbols2(it2)) : keys3;
};
var hasOwn$4 = hasOwnProperty_1;
var ownKeys$3 = ownKeys$4;
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
var definePropertyModule$2 = objectDefineProperty;
var copyConstructorProperties$1 = function(target2, source2, exceptions) {
var keys3 = ownKeys$3(source2);
var defineProperty4 = definePropertyModule$2.f;
var getOwnPropertyDescriptor3 = getOwnPropertyDescriptorModule.f;
for (var i2 = 0; i2 < keys3.length; i2++) {
var key2 = keys3[i2];
if (!hasOwn$4(target2, key2) && !(exceptions && hasOwn$4(exceptions, key2))) {
defineProperty4(target2, key2, getOwnPropertyDescriptor3(source2, key2));
}
}
};
var fails$d = fails$l;
var isCallable$c = isCallable$m;
var replacement = /#|\.prototype\./;
var isForced$2 = function(feature2, detection) {
var value2 = data[normalize(feature2)];
return value2 == POLYFILL ? true : value2 == NATIVE ? false : isCallable$c(detection) ? fails$d(detection) : !!detection;
};
var normalize = isForced$2.normalize = function(string2) {
return String(string2).replace(replacement, ".").toLowerCase();
};
var data = isForced$2.data = {};
var NATIVE = isForced$2.NATIVE = "N";
var POLYFILL = isForced$2.POLYFILL = "P";
var isForced_1 = isForced$2;
var global$a = global$k;
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
var defineBuiltIn$6 = defineBuiltIn$7;
var defineGlobalProperty = defineGlobalProperty$3;
var copyConstructorProperties = copyConstructorProperties$1;
var isForced$1 = isForced_1;
var _export = function(options2, source2) {
var TARGET = options2.target;
var GLOBAL = options2.global;
var STATIC = options2.stat;
var FORCED2, target2, key2, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target2 = global$a;
} else if (STATIC) {
target2 = global$a[TARGET] || defineGlobalProperty(TARGET, {});
} else {
target2 = (global$a[TARGET] || {}).prototype;
}
if (target2)
for (key2 in source2) {
sourceProperty = source2[key2];
if (options2.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor$3(target2, key2);
targetProperty = descriptor && descriptor.value;
} else
targetProperty = target2[key2];
FORCED2 = isForced$1(GLOBAL ? key2 : TARGET + (STATIC ? "." : "#") + key2, options2.forced);
if (!FORCED2 && targetProperty !== void 0) {
if (typeof sourceProperty == typeof targetProperty)
continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
if (options2.sham || targetProperty && targetProperty.sham) {
createNonEnumerableProperty$3(sourceProperty, "sham", true);
}
defineBuiltIn$6(target2, key2, sourceProperty, options2);
}
};
var classof$7 = classofRaw$2;
var engineIsNode = typeof process != "undefined" && classof$7(process) == "process";
var uncurryThis$g = functionUncurryThis;
var aCallable$7 = aCallable$9;
var functionUncurryThisAccessor = function(object2, key2, method) {
try {
return uncurryThis$g(aCallable$7(Object.getOwnPropertyDescriptor(object2, key2)[method]));
} catch (error3) {
}
};
var isCallable$b = isCallable$m;
var $String$1 = String;
var $TypeError$9 = TypeError;
var aPossiblePrototype$1 = function(argument) {
if (typeof argument == "object" || isCallable$b(argument))
return argument;
throw $TypeError$9("Can't set " + $String$1(argument) + " as a prototype");
};
var uncurryThisAccessor = functionUncurryThisAccessor;
var anObject$d = anObject$g;
var aPossiblePrototype = aPossiblePrototype$1;
var objectSetPrototypeOf = Object.setPrototypeOf || ("__proto__" in {} ? function() {
var CORRECT_SETTER = false;
var test2 = {};
var setter;
try {
setter = uncurryThisAccessor(Object.prototype, "__proto__", "set");
setter(test2, []);
CORRECT_SETTER = test2 instanceof Array;
} catch (error3) {
}
return function setPrototypeOf2(O2, proto) {
anObject$d(O2);
aPossiblePrototype(proto);
if (CORRECT_SETTER)
setter(O2, proto);
else
O2.__proto__ = proto;
return O2;
};
}() : void 0);
var defineProperty$3 = objectDefineProperty.f;
var hasOwn$3 = hasOwnProperty_1;
var wellKnownSymbol$g = wellKnownSymbol$i;
var TO_STRING_TAG$3 = wellKnownSymbol$g("toStringTag");
var setToStringTag$3 = function(target2, TAG, STATIC) {
if (target2 && !STATIC)
target2 = target2.prototype;
if (target2 && !hasOwn$3(target2, TO_STRING_TAG$3)) {
defineProperty$3(target2, TO_STRING_TAG$3, { configurable: true, value: TAG });
}
};
var makeBuiltIn = makeBuiltInExports;
var defineProperty$2 = objectDefineProperty;
var defineBuiltInAccessor$1 = function(target2, name, descriptor) {
if (descriptor.get)
makeBuiltIn(descriptor.get, name, { getter: true });
if (descriptor.set)
makeBuiltIn(descriptor.set, name, { setter: true });
return defineProperty$2.f(target2, name, descriptor);
};
var getBuiltIn$4 = getBuiltIn$7;
var defineBuiltInAccessor = defineBuiltInAccessor$1;
var wellKnownSymbol$f = wellKnownSymbol$i;
var DESCRIPTORS$2 = descriptors;
var SPECIES$3 = wellKnownSymbol$f("species");
var setSpecies$1 = function(CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
if (DESCRIPTORS$2 && Constructor && !Constructor[SPECIES$3]) {
defineBuiltInAccessor(Constructor, SPECIES$3, {
configurable: true,
get: function() {
return this;
}
});
}
};
var isPrototypeOf$2 = objectIsPrototypeOf;
var $TypeError$8 = TypeError;
var anInstance$1 = function(it2, Prototype) {
if (isPrototypeOf$2(Prototype, it2))
return it2;
throw $TypeError$8("Incorrect invocation");
};
var wellKnownSymbol$e = wellKnownSymbol$i;
var TO_STRING_TAG$2 = wellKnownSymbol$e("toStringTag");
var test$1 = {};
test$1[TO_STRING_TAG$2] = "z";
var toStringTagSupport = String(test$1) === "[object z]";
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
var isCallable$a = isCallable$m;
var classofRaw$1 = classofRaw$2;
var wellKnownSymbol$d = wellKnownSymbol$i;
var TO_STRING_TAG$1 = wellKnownSymbol$d("toStringTag");
var $Object$1 = Object;
var CORRECT_ARGUMENTS = classofRaw$1(function() {
return arguments;
}()) == "Arguments";
var tryGet = function(it2, key2) {
try {
return it2[key2];
} catch (error3) {
}
};
var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function(it2) {
var O2, tag, result;
return it2 === void 0 ? "Undefined" : it2 === null ? "Null" : typeof (tag = tryGet(O2 = $Object$1(it2), TO_STRING_TAG$1)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw$1(O2) : (result = classofRaw$1(O2)) == "Object" && isCallable$a(O2.callee) ? "Arguments" : result;
};
var uncurryThis$f = functionUncurryThis;
var fails$c = fails$l;
var isCallable$9 = isCallable$m;
var classof$5 = classof$6;
var getBuiltIn$3 = getBuiltIn$7;
var inspectSource$1 = inspectSource$3;
var noop$1 = function() {
};
var empty = [];
var construct = getBuiltIn$3("Reflect", "construct");
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec$2 = uncurryThis$f(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable$9(argument))
return false;
try {
construct(noop$1, empty, argument);
return true;
} catch (error3) {
return false;
}
};
var isConstructorLegacy = function isConstructor2(argument) {
if (!isCallable$9(argument))
return false;
switch (classof$5(argument)) {
case "AsyncFunction":
case "GeneratorFunction":
case "AsyncGeneratorFunction":
return false;
}
try {
return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource$1(argument));
} catch (error3) {
return true;
}
};
isConstructorLegacy.sham = true;
var isConstructor$1 = !construct || fails$c(function() {
var called;
return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
called = true;
}) || called;
}) ? isConstructorLegacy : isConstructorModern;
var isConstructor3 = isConstructor$1;
var tryToString$2 = tryToString$4;
var $TypeError$7 = TypeError;
var aConstructor$1 = function(argument) {
if (isConstructor3(argument))
return argument;
throw $TypeError$7(tryToString$2(argument) + " is not a constructor");
};
var anObject$c = anObject$g;
var aConstructor = aConstructor$1;
var isNullOrUndefined$4 = isNullOrUndefined$7;
var wellKnownSymbol$c = wellKnownSymbol$i;
var SPECIES$2 = wellKnownSymbol$c("species");
var speciesConstructor$2 = function(O2, defaultConstructor) {
var C3 = anObject$c(O2).constructor;
var S2;
return C3 === void 0 || isNullOrUndefined$4(S2 = anObject$c(C3)[SPECIES$2]) ? defaultConstructor : aConstructor(S2);
};
var NATIVE_BIND$1 = functionBindNative;
var FunctionPrototype = Function.prototype;
var apply$3 = FunctionPrototype.apply;
var call$e = FunctionPrototype.call;
var functionApply = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND$1 ? call$e.bind(apply$3) : function() {
return call$e.apply(apply$3, arguments);
});
var classofRaw = classofRaw$2;
var uncurryThis$e = functionUncurryThis;
var functionUncurryThisClause = function(fn8) {
if (classofRaw(fn8) === "Function")
return uncurryThis$e(fn8);
};
var uncurryThis$d = functionUncurryThisClause;
var aCallable$6 = aCallable$9;
var NATIVE_BIND = functionBindNative;
var bind$4 = uncurryThis$d(uncurryThis$d.bind);
var functionBindContext = function(fn8, that) {
aCallable$6(fn8);
return that === void 0 ? fn8 : NATIVE_BIND ? bind$4(fn8, that) : function() {
return fn8.apply(that, arguments);
};
};
var getBuiltIn$2 = getBuiltIn$7;
var html$2 = getBuiltIn$2("document", "documentElement");
var uncurryThis$c = functionUncurryThis;
var arraySlice$2 = uncurryThis$c([].slice);
var $TypeError$6 = TypeError;
var validateArgumentsLength$1 = function(passed, required2) {
if (passed < required2)
throw $TypeError$6("Not enough arguments");
return passed;
};
var userAgent$2 = engineUserAgent;
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
var global$9 = global$k;
var apply$2 = functionApply;
var bind$3 = functionBindContext;
var isCallable$8 = isCallable$m;
var hasOwn$2 = hasOwnProperty_1;
var fails$b = fails$l;
var html$1 = html$2;
var arraySlice$1 = arraySlice$2;
var createElement = documentCreateElement$2;
var validateArgumentsLength = validateArgumentsLength$1;
var IS_IOS$1 = engineIsIos;
var IS_NODE$4 = engineIsNode;
var set = global$9.setImmediate;
var clear = global$9.clearImmediate;
var process$3 = global$9.process;
var Dispatch = global$9.Dispatch;
var Function$1 = global$9.Function;
var MessageChannel$1 = global$9.MessageChannel;
var String$1 = global$9.String;
var counter = 0;
var queue$3 = {};
var ONREADYSTATECHANGE = "onreadystatechange";
var $location, defer, channel, port;
fails$b(function() {
$location = global$9.location;
});
var run = function(id) {
if (hasOwn$2(queue$3, id)) {
var fn8 = queue$3[id];
delete queue$3[id];
fn8();
}
};
var runner = function(id) {
return function() {
run(id);
};
};
var eventListener = function(event2) {
run(event2.data);
};
var globalPostMessageDefer = function(id) {
global$9.postMessage(String$1(id), $location.protocol + "//" + $location.host);
};
if (!set || !clear) {
set = function setImmediate2(handler) {
validateArgumentsLength(arguments.length, 1);
var fn8 = isCallable$8(handler) ? handler : Function$1(handler);
var args = arraySlice$1(arguments, 1);
queue$3[++counter] = function() {
apply$2(fn8, void 0, args);
};
defer(counter);
return counter;
};
clear = function clearImmediate(id) {
delete queue$3[id];
};
if (IS_NODE$4) {
defer = function(id) {
process$3.nextTick(runner(id));
};
} else if (Dispatch && Dispatch.now) {
defer = function(id) {
Dispatch.now(runner(id));
};
} else if (MessageChannel$1 && !IS_IOS$1) {
channel = new MessageChannel$1();
port = channel.port2;
channel.port1.onmessage = eventListener;
defer = bind$3(port.postMessage, port);
} else if (global$9.addEventListener && isCallable$8(global$9.postMessage) && !global$9.importScripts && $location && $location.protocol !== "file:" && !fails$b(globalPostMessageDefer)) {
defer = globalPostMessageDefer;
global$9.addEventListener("message", eventListener, false);
} else if (ONREADYSTATECHANGE in createElement("script")) {
defer = function(id) {
html$1.appendChild(createElement("script"))[ONREADYSTATECHANGE] = function() {
html$1.removeChild(this);
run(id);
};
};
} else {
defer = function(id) {
setTimeout(runner(id), 0);
};
}
}
var task$1 = {
set,
clear
};
var Queue$2 = function() {
this.head = null;
this.tail = null;
};
Queue$2.prototype = {
add: function(item) {
var entry2 = { item, next: null };
var tail = this.tail;
if (tail)
tail.next = entry2;
else
this.head = entry2;
this.tail = entry2;
},
get: function() {
var entry2 = this.head;
if (entry2) {
var next2 = this.head = entry2.next;
if (next2 === null)
this.tail = null;
return entry2.item;
}
}
};
var queue$2 = Queue$2;
var userAgent$1 = engineUserAgent;
var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && typeof Pebble != "undefined";
var userAgent = engineUserAgent;
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
var global$8 = global$k;
var bind$2 = functionBindContext;
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
var macrotask = task$1.set;
var Queue$1 = queue$2;
var IS_IOS = engineIsIos;
var IS_IOS_PEBBLE = engineIsIosPebble;
var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
var IS_NODE$3 = engineIsNode;
var MutationObserver = global$8.MutationObserver || global$8.WebKitMutationObserver;
var document$2 = global$8.document;
var process$2 = global$8.process;
var Promise$1 = global$8.Promise;
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(global$8, "queueMicrotask");
var microtask$1 = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
var notify$1, toggle, node$1, promise, then;
if (!microtask$1) {
var queue$1 = new Queue$1();
var flush = function() {
var parent, fn8;
if (IS_NODE$3 && (parent = process$2.domain))
parent.exit();
while (fn8 = queue$1.get())
try {
fn8();
} catch (error3) {
if (queue$1.head)
notify$1();
throw error3;
}
if (parent)
parent.enter();
};
if (!IS_IOS && !IS_NODE$3 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
toggle = true;
node$1 = document$2.createTextNode("");
new MutationObserver(flush).observe(node$1, { characterData: true });
notify$1 = function() {
node$1.data = toggle = !toggle;
};
} else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
promise = Promise$1.resolve(void 0);
promise.constructor = Promise$1;
then = bind$2(promise.then, promise);
notify$1 = function() {
then(flush);
};
} else if (IS_NODE$3) {
notify$1 = function() {
process$2.nextTick(flush);
};
} else {
macrotask = bind$2(macrotask, global$8);
notify$1 = function() {
macrotask(flush);
};
}
microtask$1 = function(fn8) {
if (!queue$1.head)
notify$1();
queue$1.add(fn8);
};
}
var microtask_1 = microtask$1;
var hostReportErrors$1 = function(a2, b2) {
try {
arguments.length == 1 ? console.error(a2) : console.error(a2, b2);
} catch (error3) {
}
};
var perform$3 = function(exec2) {
try {
return { error: false, value: exec2() };
} catch (error3) {
return { error: true, value: error3 };
}
};
var global$7 = global$k;
var promiseNativeConstructor = global$7.Promise;
var engineIsDeno = typeof Deno == "object" && Deno && typeof Deno.version == "object";
var IS_DENO$1 = engineIsDeno;
var IS_NODE$2 = engineIsNode;
var engineIsBrowser = !IS_DENO$1 && !IS_NODE$2 && typeof window == "object" && typeof document == "object";
var global$6 = global$k;
var NativePromiseConstructor$3 = promiseNativeConstructor;
var isCallable$7 = isCallable$m;
var isForced = isForced_1;
var inspectSource = inspectSource$3;
var wellKnownSymbol$b = wellKnownSymbol$i;
var IS_BROWSER = engineIsBrowser;
var IS_DENO = engineIsDeno;
var V8_VERSION = engineV8Version;
NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
var SPECIES$1 = wellKnownSymbol$b("species");
var SUBCLASSING = false;
var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$7(global$6.PromiseRejectionEvent);
var FORCED_PROMISE_CONSTRUCTOR$5 = isForced("Promise", function() {
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)
return true;
if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
var promise2 = new NativePromiseConstructor$3(function(resolve3) {
resolve3(1);
});
var FakePromise = function(exec2) {
exec2(function() {
}, function() {
});
};
var constructor = promise2.constructor = {};
constructor[SPECIES$1] = FakePromise;
SUBCLASSING = promise2.then(function() {
}) instanceof FakePromise;
if (!SUBCLASSING)
return true;
}
return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
});
var promiseConstructorDetection = {
CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
SUBCLASSING
};
var newPromiseCapability$2 = {};
var aCallable$5 = aCallable$9;
var $TypeError$5 = TypeError;
var PromiseCapability = function(C3) {
var resolve3, reject2;
this.promise = new C3(function($$resolve, $$reject) {
if (resolve3 !== void 0 || reject2 !== void 0)
throw $TypeError$5("Bad Promise constructor");
resolve3 = $$resolve;
reject2 = $$reject;
});
this.resolve = aCallable$5(resolve3);
this.reject = aCallable$5(reject2);
};
newPromiseCapability$2.f = function(C3) {
return new PromiseCapability(C3);
};
var $$e = _export;
var IS_NODE$1 = engineIsNode;
var global$5 = global$k;
var call$d = functionCall;
var defineBuiltIn$5 = defineBuiltIn$7;
var setPrototypeOf$1 = objectSetPrototypeOf;
var setToStringTag$2 = setToStringTag$3;
var setSpecies = setSpecies$1;
var aCallable$4 = aCallable$9;
var isCallable$6 = isCallable$m;
var isObject$3 = isObject$9;
var anInstance = anInstance$1;
var speciesConstructor$1 = speciesConstructor$2;
var task = task$1.set;
var microtask = microtask_1;
var hostReportErrors = hostReportErrors$1;
var perform$2 = perform$3;
var Queue = queue$2;
var InternalStateModule$1 = internalState;
var NativePromiseConstructor$2 = promiseNativeConstructor;
var PromiseConstructorDetection = promiseConstructorDetection;
var newPromiseCapabilityModule$3 = newPromiseCapability$2;
var PROMISE = "Promise";
var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
var getInternalPromiseState = InternalStateModule$1.getterFor(PROMISE);
var setInternalState$1 = InternalStateModule$1.set;
var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
var PromiseConstructor = NativePromiseConstructor$2;
var PromisePrototype = NativePromisePrototype$1;
var TypeError$1 = global$5.TypeError;
var document$1 = global$5.document;
var process$1 = global$5.process;
var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
var newGenericPromiseCapability = newPromiseCapability$1;
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$5.dispatchEvent);
var UNHANDLED_REJECTION = "unhandledrejection";
var REJECTION_HANDLED = "rejectionhandled";
var PENDING = 0;
var FULFILLED = 1;
var REJECTED = 2;
var HANDLED = 1;
var UNHANDLED = 2;
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
var isThenable = function(it2) {
var then2;
return isObject$3(it2) && isCallable$6(then2 = it2.then) ? then2 : false;
};
var callReaction = function(reaction, state) {
var value2 = state.value;
var ok2 = state.state == FULFILLED;
var handler = ok2 ? reaction.ok : reaction.fail;
var resolve3 = reaction.resolve;
var reject2 = reaction.reject;
var domain2 = reaction.domain;
var result, then2, exited;
try {
if (handler) {
if (!ok2) {
if (state.rejection === UNHANDLED)
onHandleUnhandled(state);
state.rejection = HANDLED;
}
if (handler === true)
result = value2;
else {
if (domain2)
domain2.enter();
result = handler(value2);
if (domain2) {
domain2.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject2(TypeError$1("Promise-chain cycle"));
} else if (then2 = isThenable(result)) {
call$d(then2, result, resolve3, reject2);
} else
resolve3(result);
} else
reject2(value2);
} catch (error3) {
if (domain2 && !exited)
domain2.exit();
reject2(error3);
}
};
var notify = function(state, isReject) {
if (state.notified)
return;
state.notified = true;
microtask(function() {
var reactions = state.reactions;
var reaction;
while (reaction = reactions.get()) {
callReaction(reaction, state);
}
state.notified = false;
if (isReject && !state.rejection)
onUnhandled(state);
});
};
var dispatchEvent = function(name, promise2, reason) {
var event2, handler;
if (DISPATCH_EVENT) {
event2 = document$1.createEvent("Event");
event2.promise = promise2;
event2.reason = reason;
event2.initEvent(name, false, true);
global$5.dispatchEvent(event2);
} else
event2 = { promise: promise2, reason };
if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$5["on" + name]))
handler(event2);
else if (name === UNHANDLED_REJECTION)
hostReportErrors("Unhandled promise rejection", reason);
};
var onUnhandled = function(state) {
call$d(task, global$5, function() {
var promise2 = state.facade;
var value2 = state.value;
var IS_UNHANDLED = isUnhandled(state);
var result;
if (IS_UNHANDLED) {
result = perform$2(function() {
if (IS_NODE$1) {
process$1.emit("unhandledRejection", value2, promise2);
} else
dispatchEvent(UNHANDLED_REJECTION, promise2, value2);
});
state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
if (result.error)
throw result.value;
}
});
};
var isUnhandled = function(state) {
return state.rejection !== HANDLED && !state.parent;
};
var onHandleUnhandled = function(state) {
call$d(task, global$5, function() {
var promise2 = state.facade;
if (IS_NODE$1) {
process$1.emit("rejectionHandled", promise2);
} else
dispatchEvent(REJECTION_HANDLED, promise2, state.value);
});
};
var bind$1 = function(fn8, state, unwrap) {
return function(value2) {
fn8(state, value2, unwrap);
};
};
var internalReject = function(state, value2, unwrap) {
if (state.done)
return;
state.done = true;
if (unwrap)
state = unwrap;
state.value = value2;
state.state = REJECTED;
notify(state, true);
};
var internalResolve = function(state, value2, unwrap) {
if (state.done)
return;
state.done = true;
if (unwrap)
state = unwrap;
try {
if (state.facade === value2)
throw TypeError$1("Promise can't be resolved itself");
var then2 = isThenable(value2);
if (then2) {
microtask(function() {
var wrapper = { done: false };
try {
call$d(
then2,
value2,
bind$1(internalResolve, wrapper, state),
bind$1(internalReject, wrapper, state)
);
} catch (error3) {
internalReject(wrapper, error3, state);
}
});
} else {
state.value = value2;
state.state = FULFILLED;
notify(state, false);
}
} catch (error3) {
internalReject({ done: false }, error3, state);
}
};
if (FORCED_PROMISE_CONSTRUCTOR$4) {
PromiseConstructor = function Promise2(executor) {
anInstance(this, PromisePrototype);
aCallable$4(executor);
call$d(Internal, this);
var state = getInternalPromiseState(this);
try {
executor(bind$1(internalResolve, state), bind$1(internalReject, state));
} catch (error3) {
internalReject(state, error3);
}
};
PromisePrototype = PromiseConstructor.prototype;
Internal = function Promise2(executor) {
setInternalState$1(this, {
type: PROMISE,
done: false,
notified: false,
parent: false,
reactions: new Queue(),
rejection: false,
state: PENDING,
value: void 0
});
};
Internal.prototype = defineBuiltIn$5(PromisePrototype, "then", function then2(onFulfilled, onRejected) {
var state = getInternalPromiseState(this);
var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
state.parent = true;
reaction.ok = isCallable$6(onFulfilled) ? onFulfilled : true;
reaction.fail = isCallable$6(onRejected) && onRejected;
reaction.domain = IS_NODE$1 ? process$1.domain : void 0;
if (state.state == PENDING)
state.reactions.add(reaction);
else
microtask(function() {
callReaction(reaction, state);
});
return reaction.promise;
});
OwnPromiseCapability = function() {
var promise2 = new Internal();
var state = getInternalPromiseState(promise2);
this.promise = promise2;
this.resolve = bind$1(internalResolve, state);
this.reject = bind$1(internalReject, state);
};
newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function(C3) {
return C3 === PromiseConstructor || C3 === PromiseWrapper ? new OwnPromiseCapability(C3) : newGenericPromiseCapability(C3);
};
if (isCallable$6(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
nativeThen = NativePromisePrototype$1.then;
if (!NATIVE_PROMISE_SUBCLASSING) {
defineBuiltIn$5(NativePromisePrototype$1, "then", function then2(onFulfilled, onRejected) {
var that = this;
return new PromiseConstructor(function(resolve3, reject2) {
call$d(nativeThen, that, resolve3, reject2);
}).then(onFulfilled, onRejected);
}, { unsafe: true });
}
try {
delete NativePromisePrototype$1.constructor;
} catch (error3) {
}
if (setPrototypeOf$1) {
setPrototypeOf$1(NativePromisePrototype$1, PromisePrototype);
}
}
}
$$e({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
Promise: PromiseConstructor
});
setToStringTag$2(PromiseConstructor, PROMISE, false);
setSpecies(PROMISE);
var iterators = {};
var wellKnownSymbol$a = wellKnownSymbol$i;
var Iterators$4 = iterators;
var ITERATOR$5 = wellKnownSymbol$a("iterator");
var ArrayPrototype$1 = Array.prototype;
var isArrayIteratorMethod$1 = function(it2) {
return it2 !== void 0 && (Iterators$4.Array === it2 || ArrayPrototype$1[ITERATOR$5] === it2);
};
var classof$4 = classof$6;
var getMethod$4 = getMethod$6;
var isNullOrUndefined$3 = isNullOrUndefined$7;
var Iterators$3 = iterators;
var wellKnownSymbol$9 = wellKnownSymbol$i;
var ITERATOR$4 = wellKnownSymbol$9("iterator");
var getIteratorMethod$2 = function(it2) {
if (!isNullOrUndefined$3(it2))
return getMethod$4(it2, ITERATOR$4) || getMethod$4(it2, "@@iterator") || Iterators$3[classof$4(it2)];
};
var call$c = functionCall;
var aCallable$3 = aCallable$9;
var anObject$b = anObject$g;
var tryToString$1 = tryToString$4;
var getIteratorMethod$1 = getIteratorMethod$2;
var $TypeError$4 = TypeError;
var getIterator$1 = function(argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
if (aCallable$3(iteratorMethod))
return anObject$b(call$c(iteratorMethod, argument));
throw $TypeError$4(tryToString$1(argument) + " is not iterable");
};
var call$b = functionCall;
var anObject$a = anObject$g;
var getMethod$3 = getMethod$6;
var iteratorClose$1 = function(iterator2, kind, value2) {
var innerResult, innerError;
anObject$a(iterator2);
try {
innerResult = getMethod$3(iterator2, "return");
if (!innerResult) {
if (kind === "throw")
throw value2;
return value2;
}
innerResult = call$b(innerResult, iterator2);
} catch (error3) {
innerError = true;
innerResult = error3;
}
if (kind === "throw")
throw value2;
if (innerError)
throw innerResult;
anObject$a(innerResult);
return value2;
};
var bind = functionBindContext;
var call$a = functionCall;
var anObject$9 = anObject$g;
var tryToString = tryToString$4;
var isArrayIteratorMethod = isArrayIteratorMethod$1;
var lengthOfArrayLike$2 = lengthOfArrayLike$4;
var isPrototypeOf$1 = objectIsPrototypeOf;
var getIterator = getIterator$1;
var getIteratorMethod = getIteratorMethod$2;
var iteratorClose = iteratorClose$1;
var $TypeError$3 = TypeError;
var Result = function(stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
var iterate$2 = function(iterable, unboundFunction, options2) {
var that = options2 && options2.that;
var AS_ENTRIES = !!(options2 && options2.AS_ENTRIES);
var IS_RECORD = !!(options2 && options2.IS_RECORD);
var IS_ITERATOR = !!(options2 && options2.IS_ITERATOR);
var INTERRUPTED = !!(options2 && options2.INTERRUPTED);
var fn8 = bind(unboundFunction, that);
var iterator2, iterFn, index2, length2, result, next2, step;
var stop2 = function(condition) {
if (iterator2)
iteratorClose(iterator2, "normal", condition);
return new Result(true, condition);
};
var callFn = function(value2) {
if (AS_ENTRIES) {
anObject$9(value2);
return INTERRUPTED ? fn8(value2[0], value2[1], stop2) : fn8(value2[0], value2[1]);
}
return INTERRUPTED ? fn8(value2, stop2) : fn8(value2);
};
if (IS_RECORD) {
iterator2 = iterable.iterator;
} else if (IS_ITERATOR) {
iterator2 = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn)
throw $TypeError$3(tryToString(iterable) + " is not iterable");
if (isArrayIteratorMethod(iterFn)) {
for (index2 = 0, length2 = lengthOfArrayLike$2(iterable); length2 > index2; index2++) {
result = callFn(iterable[index2]);
if (result && isPrototypeOf$1(ResultPrototype, result))
return result;
}
return new Result(false);
}
iterator2 = getIterator(iterable, iterFn);
}
next2 = IS_RECORD ? iterable.next : iterator2.next;
while (!(step = call$a(next2, iterator2)).done) {
try {
result = callFn(step.value);
} catch (error3) {
iteratorClose(iterator2, "throw", error3);
}
if (typeof result == "object" && result && isPrototypeOf$1(ResultPrototype, result))
return result;
}
return new Result(false);
};
var wellKnownSymbol$8 = wellKnownSymbol$i;
var ITERATOR$3 = wellKnownSymbol$8("iterator");
var SAFE_CLOSING = false;
try {
var called = 0;
var iteratorWithReturn = {
next: function() {
return { done: !!called++ };
},
"return": function() {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR$3] = function() {
return this;
};
Array.from(iteratorWithReturn, function() {
throw 2;
});
} catch (error3) {
}
var checkCorrectnessOfIteration$1 = function(exec2, SKIP_CLOSING) {
if (!SKIP_CLOSING && !SAFE_CLOSING)
return false;
var ITERATION_SUPPORT = false;
try {
var object2 = {};
object2[ITERATOR$3] = function() {
return {
next: function() {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec2(object2);
} catch (error3) {
}
return ITERATION_SUPPORT;
};
var NativePromiseConstructor$1 = promiseNativeConstructor;
var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function(iterable) {
NativePromiseConstructor$1.all(iterable).then(void 0, function() {
});
});
var $$d = _export;
var call$9 = functionCall;
var aCallable$2 = aCallable$9;
var newPromiseCapabilityModule$2 = newPromiseCapability$2;
var perform$1 = perform$3;
var iterate$1 = iterate$2;
var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
$$d({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
all: function all2(iterable) {
var C3 = this;
var capability = newPromiseCapabilityModule$2.f(C3);
var resolve3 = capability.resolve;
var reject2 = capability.reject;
var result = perform$1(function() {
var $promiseResolve = aCallable$2(C3.resolve);
var values2 = [];
var counter2 = 0;
var remaining = 1;
iterate$1(iterable, function(promise2) {
var index2 = counter2++;
var alreadyCalled = false;
remaining++;
call$9($promiseResolve, C3, promise2).then(function(value2) {
if (alreadyCalled)
return;
alreadyCalled = true;
values2[index2] = value2;
--remaining || resolve3(values2);
}, reject2);
});
--remaining || resolve3(values2);
});
if (result.error)
reject2(result.value);
return capability.promise;
}
});
var $$c = _export;
var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
var NativePromiseConstructor = promiseNativeConstructor;
var getBuiltIn$1 = getBuiltIn$7;
var isCallable$5 = isCallable$m;
var defineBuiltIn$4 = defineBuiltIn$7;
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
$$c({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
"catch": function(onRejected) {
return this.then(void 0, onRejected);
}
});
if (isCallable$5(NativePromiseConstructor)) {
var method = getBuiltIn$1("Promise").prototype["catch"];
if (NativePromisePrototype["catch"] !== method) {
defineBuiltIn$4(NativePromisePrototype, "catch", method, { unsafe: true });
}
}
var $$b = _export;
var call$8 = functionCall;
var aCallable$1 = aCallable$9;
var newPromiseCapabilityModule$1 = newPromiseCapability$2;
var perform = perform$3;
var iterate = iterate$2;
var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
$$b({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
race: function race(iterable) {
var C3 = this;
var capability = newPromiseCapabilityModule$1.f(C3);
var reject2 = capability.reject;
var result = perform(function() {
var $promiseResolve = aCallable$1(C3.resolve);
iterate(iterable, function(promise2) {
call$8($promiseResolve, C3, promise2).then(capability.resolve, reject2);
});
});
if (result.error)
reject2(result.value);
return capability.promise;
}
});
var $$a = _export;
var call$7 = functionCall;
var newPromiseCapabilityModule = newPromiseCapability$2;
var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
$$a({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
reject: function reject(r2) {
var capability = newPromiseCapabilityModule.f(this);
call$7(capability.reject, void 0, r2);
return capability.promise;
}
});
var anObject$8 = anObject$g;
var isObject$2 = isObject$9;
var newPromiseCapability = newPromiseCapability$2;
var promiseResolve$1 = function(C3, x2) {
anObject$8(C3);
if (isObject$2(x2) && x2.constructor === C3)
return x2;
var promiseCapability = newPromiseCapability.f(C3);
var resolve3 = promiseCapability.resolve;
resolve3(x2);
return promiseCapability.promise;
};
var $$9 = _export;
var getBuiltIn = getBuiltIn$7;
var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
var promiseResolve = promiseResolve$1;
getBuiltIn("Promise");
$$9({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
resolve: function resolve2(x2) {
return promiseResolve(this, x2);
}
});
var classof$3 = classof$6;
var $String = String;
var toString$9 = function(argument) {
if (classof$3(argument) === "Symbol")
throw TypeError("Cannot convert a Symbol value to a string");
return $String(argument);
};
var anObject$7 = anObject$g;
var regexpFlags$1 = function() {
var that = anObject$7(this);
var result = "";
if (that.hasIndices)
result += "d";
if (that.global)
result += "g";
if (that.ignoreCase)
result += "i";
if (that.multiline)
result += "m";
if (that.dotAll)
result += "s";
if (that.unicode)
result += "u";
if (that.unicodeSets)
result += "v";
if (that.sticky)
result += "y";
return result;
};
var fails$a = fails$l;
var global$4 = global$k;
var $RegExp$2 = global$4.RegExp;
var UNSUPPORTED_Y$2 = fails$a(function() {
var re2 = $RegExp$2("a", "y");
re2.lastIndex = 2;
return re2.exec("abcd") != null;
});
var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$a(function() {
return !$RegExp$2("a", "y").sticky;
});
var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$a(function() {
var re2 = $RegExp$2("^r", "gy");
re2.lastIndex = 2;
return re2.exec("str") != null;
});
var regexpStickyHelpers = {
BROKEN_CARET,
MISSED_STICKY,
UNSUPPORTED_Y: UNSUPPORTED_Y$2
};
var objectDefineProperties = {};
var internalObjectKeys = objectKeysInternal;
var enumBugKeys$1 = enumBugKeys$3;
var objectKeys$1 = Object.keys || function keys2(O2) {
return internalObjectKeys(O2, enumBugKeys$1);
};
var DESCRIPTORS$1 = descriptors;
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
var definePropertyModule$1 = objectDefineProperty;
var anObject$6 = anObject$g;
var toIndexedObject$1 = toIndexedObject$5;
var objectKeys = objectKeys$1;
objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O2, Properties) {
anObject$6(O2);
var props = toIndexedObject$1(Properties);
var keys3 = objectKeys(Properties);
var length2 = keys3.length;
var index2 = 0;
var key2;
while (length2 > index2)
definePropertyModule$1.f(O2, key2 = keys3[index2++], props[key2]);
return O2;
};
var anObject$5 = anObject$g;
var definePropertiesModule = objectDefineProperties;
var enumBugKeys = enumBugKeys$3;
var hiddenKeys = hiddenKeys$4;
var html = html$2;
var documentCreateElement$1 = documentCreateElement$2;
var sharedKey$1 = sharedKey$3;
var GT = ">";
var LT = "<";
var PROTOTYPE = "prototype";
var SCRIPT = "script";
var IE_PROTO$1 = sharedKey$1("IE_PROTO");
var EmptyConstructor = function() {
};
var scriptTag = function(content2) {
return LT + SCRIPT + GT + content2 + LT + "/" + SCRIPT + GT;
};
var NullProtoObjectViaActiveX = function(activeXDocument2) {
activeXDocument2.write(scriptTag(""));
activeXDocument2.close();
var temp2 = activeXDocument2.parentWindow.Object;
activeXDocument2 = null;
return temp2;
};
var NullProtoObjectViaIFrame = function() {
var iframe = documentCreateElement$1("iframe");
var JS = "java" + SCRIPT + ":";
var iframeDocument;
iframe.style.display = "none";
html.appendChild(iframe);
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag("document.F=Object"));
iframeDocument.close();
return iframeDocument.F;
};
var activeXDocument;
var NullProtoObject = function() {
try {
activeXDocument = new ActiveXObject("htmlfile");
} catch (error3) {
}
NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
var length2 = enumBugKeys.length;
while (length2--)
delete NullProtoObject[PROTOTYPE][enumBugKeys[length2]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO$1] = true;
var objectCreate = Object.create || function create2(O2, Properties) {
var result;
if (O2 !== null) {
EmptyConstructor[PROTOTYPE] = anObject$5(O2);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
result[IE_PROTO$1] = O2;
} else
result = NullProtoObject();
return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
};
var fails$9 = fails$l;
var global$3 = global$k;
var $RegExp$1 = global$3.RegExp;
var regexpUnsupportedDotAll = fails$9(function() {
var re2 = $RegExp$1(".", "s");
return !(re2.dotAll && re2.exec("\n") && re2.flags === "s");
});
var fails$8 = fails$l;
var global$2 = global$k;
var $RegExp = global$2.RegExp;
var regexpUnsupportedNcg = fails$8(function() {
var re2 = $RegExp("(?<a>b)", "g");
return re2.exec("b").groups.a !== "b" || "b".replace(re2, "$<a>c") !== "bc";
});
var call$6 = functionCall;
var uncurryThis$b = functionUncurryThis;
var toString$8 = toString$9;
var regexpFlags = regexpFlags$1;
var stickyHelpers$1 = regexpStickyHelpers;
var shared = sharedExports;
var create$2 = objectCreate;
var getInternalState$1 = internalState.get;
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
var nativeReplace = shared("native-string-replace", String.prototype.replace);
var nativeExec = RegExp.prototype.exec;
var patchedExec = nativeExec;
var charAt$3 = uncurryThis$b("".charAt);
var indexOf = uncurryThis$b("".indexOf);
var replace$2 = uncurryThis$b("".replace);
var stringSlice$5 = uncurryThis$b("".slice);
var UPDATES_LAST_INDEX_WRONG = function() {
var re1 = /a/;
var re2 = /b*/g;
call$6(nativeExec, re1, "a");
call$6(nativeExec, re2, "a");
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
}();
var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
if (PATCH) {
patchedExec = function exec2(string2) {
var re2 = this;
var state = getInternalState$1(re2);
var str = toString$8(string2);
var raw = state.raw;
var result, reCopy, lastIndex, match2, i2, object2, group2;
if (raw) {
raw.lastIndex = re2.lastIndex;
result = call$6(patchedExec, raw, str);
re2.lastIndex = raw.lastIndex;
return result;
}
var groups = state.groups;
var sticky2 = UNSUPPORTED_Y$1 && re2.sticky;
var flags = call$6(regexpFlags, re2);
var source2 = re2.source;
var charsAdded = 0;
var strCopy = str;
if (sticky2) {
flags = replace$2(flags, "y", "");
if (indexOf(flags, "g") === -1) {
flags += "g";
}
strCopy = stringSlice$5(str, re2.lastIndex);
if (re2.lastIndex > 0 && (!re2.multiline || re2.multiline && charAt$3(str, re2.lastIndex - 1) !== "\n")) {
source2 = "(?: " + source2 + ")";
strCopy = " " + strCopy;
charsAdded++;
}
reCopy = new RegExp("^(?:" + source2 + ")", flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp("^" + source2 + "$(?!\\s)", flags);
}
if (UPDATES_LAST_INDEX_WRONG)
lastIndex = re2.lastIndex;
match2 = call$6(nativeExec, sticky2 ? reCopy : re2, strCopy);
if (sticky2) {
if (match2) {
match2.input = stringSlice$5(match2.input, charsAdded);
match2[0] = stringSlice$5(match2[0], charsAdded);
match2.index = re2.lastIndex;
re2.lastIndex += match2[0].length;
} else
re2.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match2) {
re2.lastIndex = re2.global ? match2.index + match2[0].length : lastIndex;
}
if (NPCG_INCLUDED && match2 && match2.length > 1) {
call$6(nativeReplace, match2[0], reCopy, function() {
for (i2 = 1; i2 < arguments.length - 2; i2++) {
if (arguments[i2] === void 0)
match2[i2] = void 0;
}
});
}
if (match2 && groups) {
match2.groups = object2 = create$2(null);
for (i2 = 0; i2 < groups.length; i2++) {
group2 = groups[i2];
object2[group2[0]] = match2[group2[1]];
}
}
return match2;
};
}
var regexpExec$3 = patchedExec;
var $$8 = _export;
var exec$1 = regexpExec$3;
$$8({ target: "RegExp", proto: true, forced: /./.exec !== exec$1 }, {
exec: exec$1
});
var uncurryThis$a = functionUncurryThisClause;
var defineBuiltIn$3 = defineBuiltIn$7;
var regexpExec$2 = regexpExec$3;
var fails$7 = fails$l;
var wellKnownSymbol$7 = wellKnownSymbol$i;
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
var SPECIES = wellKnownSymbol$7("species");
var RegExpPrototype$2 = RegExp.prototype;
var fixRegexpWellKnownSymbolLogic = function(KEY, exec2, FORCED2, SHAM) {
var SYMBOL = wellKnownSymbol$7(KEY);
var DELEGATES_TO_SYMBOL = !fails$7(function() {
var O2 = {};
O2[SYMBOL] = function() {
return 7;
};
return ""[KEY](O2) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$7(function() {
var execCalled = false;
var re2 = /a/;
if (KEY === "split") {
re2 = {};
re2.constructor = {};
re2.constructor[SPECIES] = function() {
return re2;
};
re2.flags = "";
re2[SYMBOL] = /./[SYMBOL];
}
re2.exec = function() {
execCalled = true;
return null;
};
re2[SYMBOL]("");
return !execCalled;
});
if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED2) {
var uncurriedNativeRegExpMethod = uncurryThis$a(/./[SYMBOL]);
var methods2 = exec2(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
var uncurriedNativeMethod = uncurryThis$a(nativeMethod);
var $exec = regexp.exec;
if ($exec === regexpExec$2 || $exec === RegExpPrototype$2.exec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
}
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
}
return { done: false };
});
defineBuiltIn$3(String.prototype, KEY, methods2[0]);
defineBuiltIn$3(RegExpPrototype$2, SYMBOL, methods2[1]);
}
if (SHAM)
createNonEnumerableProperty$2(RegExpPrototype$2[SYMBOL], "sham", true);
};
var uncurryThis$9 = functionUncurryThis;
var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
var toString$7 = toString$9;
var requireObjectCoercible$7 = requireObjectCoercible$a;
var charAt$2 = uncurryThis$9("".charAt);
var charCodeAt = uncurryThis$9("".charCodeAt);
var stringSlice$4 = uncurryThis$9("".slice);
var createMethod$2 = function(CONVERT_TO_STRING) {
return function($this, pos) {
var S2 = toString$7(requireObjectCoercible$7($this));
var position2 = toIntegerOrInfinity$1(pos);
var size = S2.length;
var first, second2;
if (position2 < 0 || position2 >= size)
return CONVERT_TO_STRING ? "" : void 0;
first = charCodeAt(S2, position2);
return first < 55296 || first > 56319 || position2 + 1 === size || (second2 = charCodeAt(S2, position2 + 1)) < 56320 || second2 > 57343 ? CONVERT_TO_STRING ? charAt$2(S2, position2) : first : CONVERT_TO_STRING ? stringSlice$4(S2, position2, position2 + 2) : (first - 55296 << 10) + (second2 - 56320) + 65536;
};
};
var stringMultibyte = {
// `String.prototype.codePointAt` method
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod$2(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod$2(true)
};
var charAt$1 = stringMultibyte.charAt;
var advanceStringIndex$3 = function(S2, index2, unicode) {
return index2 + (unicode ? charAt$1(S2, index2).length : 1);
};
var call$5 = functionCall;
var anObject$4 = anObject$g;
var isCallable$4 = isCallable$m;
var classof$2 = classofRaw$2;
var regexpExec$1 = regexpExec$3;
var $TypeError$2 = TypeError;
var regexpExecAbstract = function(R2, S2) {
var exec2 = R2.exec;
if (isCallable$4(exec2)) {
var result = call$5(exec2, R2, S2);
if (result !== null)
anObject$4(result);
return result;
}
if (classof$2(R2) === "RegExp")
return call$5(regexpExec$1, R2, S2);
throw $TypeError$2("RegExp#exec called on incompatible receiver");
};
var call$4 = functionCall;
var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
var anObject$3 = anObject$g;
var isNullOrUndefined$2 = isNullOrUndefined$7;
var toLength$4 = toLength$6;
var toString$6 = toString$9;
var requireObjectCoercible$6 = requireObjectCoercible$a;
var getMethod$2 = getMethod$6;
var advanceStringIndex$2 = advanceStringIndex$3;
var regExpExec$1 = regexpExecAbstract;
fixRegExpWellKnownSymbolLogic$2("match", function(MATCH2, nativeMatch, maybeCallNative) {
return [
// `String.prototype.match` method
// https://tc39.es/ecma262/#sec-string.prototype.match
function match2(regexp) {
var O2 = requireObjectCoercible$6(this);
var matcher = isNullOrUndefined$2(regexp) ? void 0 : getMethod$2(regexp, MATCH2);
return matcher ? call$4(matcher, regexp, O2) : new RegExp(regexp)[MATCH2](toString$6(O2));
},
// `RegExp.prototype[@@match]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
function(string2) {
var rx = anObject$3(this);
var S2 = toString$6(string2);
var res = maybeCallNative(nativeMatch, rx, S2);
if (res.done)
return res.value;
if (!rx.global)
return regExpExec$1(rx, S2);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A5 = [];
var n2 = 0;
var result;
while ((result = regExpExec$1(rx, S2)) !== null) {
var matchStr = toString$6(result[0]);
A5[n2] = matchStr;
if (matchStr === "")
rx.lastIndex = advanceStringIndex$2(S2, toLength$4(rx.lastIndex), fullUnicode);
n2++;
}
return n2 === 0 ? null : A5;
}
];
});
var uncurryThis$8 = functionUncurryThis;
var toObject$2 = toObject$4;
var floor = Math.floor;
var charAt = uncurryThis$8("".charAt);
var replace$1 = uncurryThis$8("".replace);
var stringSlice$3 = uncurryThis$8("".slice);
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
var getSubstitution$1 = function(matched, str, position2, captures, namedCaptures, replacement2) {
var tailPos = position2 + matched.length;
var m2 = captures.length;
var symbols2 = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== void 0) {
namedCaptures = toObject$2(namedCaptures);
symbols2 = SUBSTITUTION_SYMBOLS;
}
return replace$1(replacement2, symbols2, function(match2, ch2) {
var capture;
switch (charAt(ch2, 0)) {
case "$":
return "$";
case "&":
return matched;
case "`":
return stringSlice$3(str, 0, position2);
case "'":
return stringSlice$3(str, tailPos);
case "<":
capture = namedCaptures[stringSlice$3(ch2, 1, -1)];
break;
default:
var n2 = +ch2;
if (n2 === 0)
return match2;
if (n2 > m2) {
var f2 = floor(n2 / 10);
if (f2 === 0)
return match2;
if (f2 <= m2)
return captures[f2 - 1] === void 0 ? charAt(ch2, 1) : captures[f2 - 1] + charAt(ch2, 1);
return match2;
}
capture = captures[n2 - 1];
}
return capture === void 0 ? "" : capture;
});
};
var apply$1 = functionApply;
var call$3 = functionCall;
var uncurryThis$7 = functionUncurryThis;
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
var fails$6 = fails$l;
var anObject$2 = anObject$g;
var isCallable$3 = isCallable$m;
var isNullOrUndefined$1 = isNullOrUndefined$7;
var toIntegerOrInfinity = toIntegerOrInfinity$4;
var toLength$3 = toLength$6;
var toString$5 = toString$9;
var requireObjectCoercible$5 = requireObjectCoercible$a;
var advanceStringIndex$1 = advanceStringIndex$3;
var getMethod$1 = getMethod$6;
var getSubstitution = getSubstitution$1;
var regExpExec = regexpExecAbstract;
var wellKnownSymbol$6 = wellKnownSymbol$i;
var REPLACE = wellKnownSymbol$6("replace");
var max$1 = Math.max;
var min$3 = Math.min;
var concat = uncurryThis$7([].concat);
var push$1 = uncurryThis$7([].push);
var stringIndexOf$1 = uncurryThis$7("".indexOf);
var stringSlice$2 = uncurryThis$7("".slice);
var maybeToString = function(it2) {
return it2 === void 0 ? it2 : String(it2);
};
var REPLACE_KEEPS_$0 = function() {
return "a".replace(/./, "$0") === "$0";
}();
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
if (/./[REPLACE]) {
return /./[REPLACE]("a", "$0") === "";
}
return false;
}();
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function() {
var re2 = /./;
re2.exec = function() {
var result = [];
result.groups = { a: "7" };
return result;
};
return "".replace(re2, "$<a>") !== "7";
});
fixRegExpWellKnownSymbolLogic$1("replace", function(_24, nativeReplace2, maybeCallNative) {
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
return [
// `String.prototype.replace` method
// https://tc39.es/ecma262/#sec-string.prototype.replace
function replace2(searchValue, replaceValue) {
var O2 = requireObjectCoercible$5(this);
var replacer2 = isNullOrUndefined$1(searchValue) ? void 0 : getMethod$1(searchValue, REPLACE);
return replacer2 ? call$3(replacer2, searchValue, O2, replaceValue) : call$3(nativeReplace2, toString$5(O2), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
function(string2, replaceValue) {
var rx = anObject$2(this);
var S2 = toString$5(string2);
if (typeof replaceValue == "string" && stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf$1(replaceValue, "$<") === -1) {
var res = maybeCallNative(nativeReplace2, rx, S2, replaceValue);
if (res.done)
return res.value;
}
var functionalReplace = isCallable$3(replaceValue);
if (!functionalReplace)
replaceValue = toString$5(replaceValue);
var global2 = rx.global;
if (global2) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S2);
if (result === null)
break;
push$1(results, result);
if (!global2)
break;
var matchStr = toString$5(result[0]);
if (matchStr === "")
rx.lastIndex = advanceStringIndex$1(S2, toLength$3(rx.lastIndex), fullUnicode);
}
var accumulatedResult = "";
var nextSourcePosition = 0;
for (var i2 = 0; i2 < results.length; i2++) {
result = results[i2];
var matched = toString$5(result[0]);
var position2 = max$1(min$3(toIntegerOrInfinity(result.index), S2.length), 0);
var captures = [];
for (var j2 = 1; j2 < result.length; j2++)
push$1(captures, maybeToString(result[j2]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = concat([matched], captures, position2, S2);
if (namedCaptures !== void 0)
push$1(replacerArgs, namedCaptures);
var replacement2 = toString$5(apply$1(replaceValue, void 0, replacerArgs));
} else {
replacement2 = getSubstitution(matched, S2, position2, captures, namedCaptures, replaceValue);
}
if (position2 >= nextSourcePosition) {
accumulatedResult += stringSlice$2(S2, nextSourcePosition, position2) + replacement2;
nextSourcePosition = position2 + matched.length;
}
}
return accumulatedResult + stringSlice$2(S2, nextSourcePosition);
}
];
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
var isObject$1 = isObject$9;
var classof$1 = classofRaw$2;
var wellKnownSymbol$5 = wellKnownSymbol$i;
var MATCH$1 = wellKnownSymbol$5("match");
var isRegexp = function(it2) {
var isRegExp2;
return isObject$1(it2) && ((isRegExp2 = it2[MATCH$1]) !== void 0 ? !!isRegExp2 : classof$1(it2) == "RegExp");
};
var isRegExp$1 = isRegexp;
var $TypeError$1 = TypeError;
var notARegexp = function(it2) {
if (isRegExp$1(it2)) {
throw $TypeError$1("The method doesn't accept regular expressions");
}
return it2;
};
var wellKnownSymbol$4 = wellKnownSymbol$i;
var MATCH = wellKnownSymbol$4("match");
var correctIsRegexpLogic = function(METHOD_NAME) {
var regexp = /./;
try {
"/./"[METHOD_NAME](regexp);
} catch (error1) {
try {
regexp[MATCH] = false;
return "/./"[METHOD_NAME](regexp);
} catch (error22) {
}
}
return false;
};
var $$7 = _export;
var uncurryThis$6 = functionUncurryThisClause;
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
var toLength$2 = toLength$6;
var toString$4 = toString$9;
var notARegExp$2 = notARegexp;
var requireObjectCoercible$4 = requireObjectCoercible$a;
var correctIsRegExpLogic$2 = correctIsRegexpLogic;
var nativeStartsWith = uncurryThis$6("".startsWith);
var stringSlice$1 = uncurryThis$6("".slice);
var min$2 = Math.min;
var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$2("startsWith");
var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function() {
var descriptor = getOwnPropertyDescriptor$1(String.prototype, "startsWith");
return descriptor && !descriptor.writable;
}();
$$7({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
startsWith: function startsWith(searchString) {
var that = toString$4(requireObjectCoercible$4(this));
notARegExp$2(searchString);
var index2 = toLength$2(min$2(arguments.length > 1 ? arguments[1] : void 0, that.length));
var search = toString$4(searchString);
return nativeStartsWith ? nativeStartsWith(that, search, index2) : stringSlice$1(that, index2, index2 + search.length) === search;
}
});
var wellKnownSymbol$3 = wellKnownSymbol$i;
var create$1 = objectCreate;
var defineProperty$1 = objectDefineProperty.f;
var UNSCOPABLES = wellKnownSymbol$3("unscopables");
var ArrayPrototype = Array.prototype;
if (ArrayPrototype[UNSCOPABLES] == void 0) {
defineProperty$1(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create$1(null)
});
}
var addToUnscopables$1 = function(key2) {
ArrayPrototype[UNSCOPABLES][key2] = true;
};
var fails$5 = fails$l;
var correctPrototypeGetter = !fails$5(function() {
function F2() {
}
F2.prototype.constructor = null;
return Object.getPrototypeOf(new F2()) !== F2.prototype;
});
var hasOwn$1 = hasOwnProperty_1;
var isCallable$2 = isCallable$m;
var toObject$1 = toObject$4;
var sharedKey = sharedKey$3;
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
var IE_PROTO = sharedKey("IE_PROTO");
var $Object = Object;
var ObjectPrototype = $Object.prototype;
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O2) {
var object2 = toObject$1(O2);
if (hasOwn$1(object2, IE_PROTO))
return object2[IE_PROTO];
var constructor = object2.constructor;
if (isCallable$2(constructor) && object2 instanceof constructor) {
return constructor.prototype;
}
return object2 instanceof $Object ? ObjectPrototype : null;
};
var fails$4 = fails$l;
var isCallable$1 = isCallable$m;
var isObject = isObject$9;
var getPrototypeOf$1 = objectGetPrototypeOf;
var defineBuiltIn$2 = defineBuiltIn$7;
var wellKnownSymbol$2 = wellKnownSymbol$i;
var ITERATOR$2 = wellKnownSymbol$2("iterator");
var BUGGY_SAFARI_ITERATORS$1 = false;
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
if ([].keys) {
arrayIterator = [].keys();
if (!("next" in arrayIterator))
BUGGY_SAFARI_ITERATORS$1 = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$4(function() {
var test2 = {};
return IteratorPrototype$2[ITERATOR$2].call(test2) !== test2;
});
if (NEW_ITERATOR_PROTOTYPE)
IteratorPrototype$2 = {};
if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function() {
return this;
});
}
var iteratorsCore = {
IteratorPrototype: IteratorPrototype$2,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
};
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
var create3 = objectCreate;
var createPropertyDescriptor$1 = createPropertyDescriptor$4;
var setToStringTag$1 = setToStringTag$3;
var Iterators$2 = iterators;
var returnThis$1 = function() {
return this;
};
var iteratorCreateConstructor = function(IteratorConstructor, NAME2, next2, ENUMERABLE_NEXT) {
var TO_STRING_TAG2 = NAME2 + " Iterator";
IteratorConstructor.prototype = create3(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next2) });
setToStringTag$1(IteratorConstructor, TO_STRING_TAG2, false);
Iterators$2[TO_STRING_TAG2] = returnThis$1;
return IteratorConstructor;
};
var $$6 = _export;
var call$2 = functionCall;
var FunctionName = functionName;
var isCallable = isCallable$m;
var createIteratorConstructor = iteratorCreateConstructor;
var getPrototypeOf = objectGetPrototypeOf;
var setPrototypeOf = objectSetPrototypeOf;
var setToStringTag = setToStringTag$3;
var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
var defineBuiltIn$1 = defineBuiltIn$7;
var wellKnownSymbol$1 = wellKnownSymbol$i;
var Iterators$1 = iterators;
var IteratorsCore = iteratorsCore;
var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR$1 = wellKnownSymbol$1("iterator");
var KEYS = "keys";
var VALUES = "values";
var ENTRIES = "entries";
var returnThis = function() {
return this;
};
var iteratorDefine = function(Iterable, NAME2, IteratorConstructor, next2, DEFAULT2, IS_SET, FORCED2) {
createIteratorConstructor(IteratorConstructor, NAME2, next2);
var getIterationMethod = function(KIND) {
if (KIND === DEFAULT2 && defaultIterator)
return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
return IterablePrototype[KIND];
switch (KIND) {
case KEYS:
return function keys3() {
return new IteratorConstructor(this, KIND);
};
case VALUES:
return function values2() {
return new IteratorConstructor(this, KIND);
};
case ENTRIES:
return function entries() {
return new IteratorConstructor(this, KIND);
};
}
return function() {
return new IteratorConstructor(this);
};
};
var TO_STRING_TAG2 = NAME2 + " Iterator";
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR$1] || IterablePrototype["@@iterator"] || DEFAULT2 && IterablePrototype[DEFAULT2];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT2);
var anyNativeIterator = NAME2 == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods2, KEY;
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
}
}
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG2, true);
}
}
if (PROPER_FUNCTION_NAME$2 && DEFAULT2 == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty$1(IterablePrototype, "name", VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values2() {
return call$2(nativeIterator, this);
};
}
}
if (DEFAULT2) {
methods2 = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED2)
for (KEY in methods2) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn$1(IterablePrototype, KEY, methods2[KEY]);
}
}
else
$$6({ target: NAME2, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods2);
}
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT2 });
}
Iterators$1[NAME2] = defaultIterator;
return methods2;
};
var createIterResultObject$1 = function(value2, done) {
return { value: value2, done };
};
var toIndexedObject = toIndexedObject$5;
var addToUnscopables = addToUnscopables$1;
var Iterators = iterators;
var InternalStateModule = internalState;
var defineProperty3 = objectDefineProperty.f;
var defineIterator = iteratorDefine;
var createIterResultObject = createIterResultObject$1;
var DESCRIPTORS = descriptors;
var ARRAY_ITERATOR = "Array Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
var es_array_iterator = defineIterator(Array, "Array", function(iterated, kind) {
setInternalState(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated),
// target
index: 0,
// next index
kind
// kind
});
}, function() {
var state = getInternalState(this);
var target2 = state.target;
var kind = state.kind;
var index2 = state.index++;
if (!target2 || index2 >= target2.length) {
state.target = void 0;
return createIterResultObject(void 0, true);
}
if (kind == "keys")
return createIterResultObject(index2, false);
if (kind == "values")
return createIterResultObject(target2[index2], false);
return createIterResultObject([index2, target2[index2]], false);
}, "values");
var values = Iterators.Arguments = Iterators.Array;
addToUnscopables("keys");
addToUnscopables("values");
addToUnscopables("entries");
if (DESCRIPTORS && values.name !== "values")
try {
defineProperty3(values, "name", { value: "values" });
} catch (error3) {
}
var domIterables = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
var documentCreateElement = documentCreateElement$2;
var classList = documentCreateElement("span").classList;
var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? void 0 : DOMTokenListPrototype$1;
var global$1 = global$k;
var DOMIterables = domIterables;
var DOMTokenListPrototype = domTokenListPrototype;
var ArrayIteratorMethods = es_array_iterator;
var createNonEnumerableProperty = createNonEnumerableProperty$5;
var wellKnownSymbol = wellKnownSymbol$i;
var ITERATOR = wellKnownSymbol("iterator");
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var ArrayValues = ArrayIteratorMethods.values;
var handlePrototype = function(CollectionPrototype, COLLECTION_NAME) {
if (CollectionPrototype) {
if (CollectionPrototype[ITERATOR] !== ArrayValues)
try {
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
} catch (error3) {
CollectionPrototype[ITERATOR] = ArrayValues;
}
if (!CollectionPrototype[TO_STRING_TAG]) {
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
}
if (DOMIterables[COLLECTION_NAME])
for (var METHOD_NAME in ArrayIteratorMethods) {
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
try {
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
} catch (error3) {
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
}
}
}
};
for (var COLLECTION_NAME in DOMIterables) {
handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
}
handlePrototype(DOMTokenListPrototype, "DOMTokenList");
var aCallable = aCallable$9;
var toObject = toObject$4;
var IndexedObject = indexedObject;
var lengthOfArrayLike$1 = lengthOfArrayLike$4;
var $TypeError = TypeError;
var createMethod$1 = function(IS_RIGHT) {
return function(that, callbackfn, argumentsLength, memo) {
aCallable(callbackfn);
var O2 = toObject(that);
var self2 = IndexedObject(O2);
var length2 = lengthOfArrayLike$1(O2);
var index2 = IS_RIGHT ? length2 - 1 : 0;
var i2 = IS_RIGHT ? -1 : 1;
if (argumentsLength < 2)
while (true) {
if (index2 in self2) {
memo = self2[index2];
index2 += i2;
break;
}
index2 += i2;
if (IS_RIGHT ? index2 < 0 : length2 <= index2) {
throw $TypeError("Reduce of empty array with no initial value");
}
}
for (; IS_RIGHT ? index2 >= 0 : length2 > index2; index2 += i2)
if (index2 in self2) {
memo = callbackfn(memo, self2[index2], index2, O2);
}
return memo;
};
};
var arrayReduce = {
// `Array.prototype.reduce` method
// https://tc39.es/ecma262/#sec-array.prototype.reduce
left: createMethod$1(false),
// `Array.prototype.reduceRight` method
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
right: createMethod$1(true)
};
var fails$3 = fails$l;
var arrayMethodIsStrict$2 = function(METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails$3(function() {
method.call(null, argument || function() {
return 1;
}, 1);
});
};
var $$5 = _export;
var $reduce = arrayReduce.left;
var arrayMethodIsStrict$1 = arrayMethodIsStrict$2;
var CHROME_VERSION = engineV8Version;
var IS_NODE = engineIsNode;
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict$1("reduce");
$$5({ target: "Array", proto: true, forced: FORCED$1 }, {
reduce: function reduce(callbackfn) {
var length2 = arguments.length;
return $reduce(this, callbackfn, length2, length2 > 1 ? arguments[1] : void 0);
}
});
var $$4 = _export;
var uncurryThis$5 = functionUncurryThisClause;
var getOwnPropertyDescriptor2 = objectGetOwnPropertyDescriptor.f;
var toLength$1 = toLength$6;
var toString$3 = toString$9;
var notARegExp$1 = notARegexp;
var requireObjectCoercible$3 = requireObjectCoercible$a;
var correctIsRegExpLogic$1 = correctIsRegexpLogic;
var nativeEndsWith = uncurryThis$5("".endsWith);
var slice = uncurryThis$5("".slice);
var min$1 = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic$1("endsWith");
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function() {
var descriptor = getOwnPropertyDescriptor2(String.prototype, "endsWith");
return descriptor && !descriptor.writable;
}();
$$4({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
endsWith: function endsWith(searchString) {
var that = toString$3(requireObjectCoercible$3(this));
notARegExp$1(searchString);
var endPosition = arguments.length > 1 ? arguments[1] : void 0;
var len = that.length;
var end2 = endPosition === void 0 ? len : min$1(toLength$1(endPosition), len);
var search = toString$3(searchString);
return nativeEndsWith ? nativeEndsWith(that, search, end2) : slice(that, end2 - search.length, end2) === search;
}
});
var toPropertyKey = toPropertyKey$3;
var definePropertyModule = objectDefineProperty;
var createPropertyDescriptor = createPropertyDescriptor$4;
var createProperty$1 = function(object2, key2, value2) {
var propertyKey = toPropertyKey(key2);
if (propertyKey in object2)
definePropertyModule.f(object2, propertyKey, createPropertyDescriptor(0, value2));
else
object2[propertyKey] = value2;
};
var toAbsoluteIndex = toAbsoluteIndex$2;
var lengthOfArrayLike = lengthOfArrayLike$4;
var createProperty = createProperty$1;
var $Array = Array;
var max = Math.max;
var arraySliceSimple = function(O2, start2, end2) {
var length2 = lengthOfArrayLike(O2);
var k2 = toAbsoluteIndex(start2, length2);
var fin = toAbsoluteIndex(end2 === void 0 ? length2 : end2, length2);
var result = $Array(max(fin - k2, 0));
for (var n2 = 0; k2 < fin; k2++, n2++)
createProperty(result, n2, O2[k2]);
result.length = n2;
return result;
};
var apply = functionApply;
var call$1 = functionCall;
var uncurryThis$4 = functionUncurryThis;
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
var anObject$1 = anObject$g;
var isNullOrUndefined = isNullOrUndefined$7;
var isRegExp = isRegexp;
var requireObjectCoercible$2 = requireObjectCoercible$a;
var speciesConstructor = speciesConstructor$2;
var advanceStringIndex = advanceStringIndex$3;
var toLength = toLength$6;
var toString$2 = toString$9;
var getMethod = getMethod$6;
var arraySlice = arraySliceSimple;
var callRegExpExec = regexpExecAbstract;
var regexpExec = regexpExec$3;
var stickyHelpers = regexpStickyHelpers;
var fails$2 = fails$l;
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var MAX_UINT32 = 4294967295;
var min = Math.min;
var $push = [].push;
var exec = uncurryThis$4(/./.exec);
var push = uncurryThis$4($push);
var stringSlice = uncurryThis$4("".slice);
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$2(function() {
var re2 = /(?:)/;
var originalExec = re2.exec;
re2.exec = function() {
return originalExec.apply(this, arguments);
};
var result = "ab".split(re2);
return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
});
fixRegExpWellKnownSymbolLogic("split", function(SPLIT, nativeSplit, maybeCallNative) {
var internalSplit;
if ("abbc".split(/(b)*/)[1] == "c" || // eslint-disable-next-line regexp/no-empty-group -- required for testing
"test".split(/(?:)/, -1).length != 4 || "ab".split(/(?:ab)*/).length != 2 || ".".split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
".".split(/()()/).length > 1 || "".split(/.?/).length) {
internalSplit = function(separator, limit2) {
var string2 = toString$2(requireObjectCoercible$2(this));
var lim = limit2 === void 0 ? MAX_UINT32 : limit2 >>> 0;
if (lim === 0)
return [];
if (separator === void 0)
return [string2];
if (!isRegExp(separator)) {
return call$1(nativeSplit, string2, separator, lim);
}
var output3 = [];
var flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : "");
var lastLastIndex = 0;
var separatorCopy = new RegExp(separator.source, flags + "g");
var match2, lastIndex, lastLength;
while (match2 = call$1(regexpExec, separatorCopy, string2)) {
lastIndex = separatorCopy.lastIndex;
if (lastIndex > lastLastIndex) {
push(output3, stringSlice(string2, lastLastIndex, match2.index));
if (match2.length > 1 && match2.index < string2.length)
apply($push, output3, arraySlice(match2, 1));
lastLength = match2[0].length;
lastLastIndex = lastIndex;
if (output3.length >= lim)
break;
}
if (separatorCopy.lastIndex === match2.index)
separatorCopy.lastIndex++;
}
if (lastLastIndex === string2.length) {
if (lastLength || !exec(separatorCopy, ""))
push(output3, "");
} else
push(output3, stringSlice(string2, lastLastIndex));
return output3.length > lim ? arraySlice(output3, 0, lim) : output3;
};
} else if ("0".split(void 0, 0).length) {
internalSplit = function(separator, limit2) {
return separator === void 0 && limit2 === 0 ? [] : call$1(nativeSplit, this, separator, limit2);
};
} else
internalSplit = nativeSplit;
return [
// `String.prototype.split` method
// https://tc39.es/ecma262/#sec-string.prototype.split
function split2(separator, limit2) {
var O2 = requireObjectCoercible$2(this);
var splitter2 = isNullOrUndefined(separator) ? void 0 : getMethod(separator, SPLIT);
return splitter2 ? call$1(splitter2, separator, O2, limit2) : call$1(internalSplit, toString$2(O2), separator, limit2);
},
// `RegExp.prototype[@@split]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
//
// NOTE: This cannot be properly polyfilled in engines that don't support
// the 'y' flag.
function(string2, limit2) {
var rx = anObject$1(this);
var S2 = toString$2(string2);
var res = maybeCallNative(internalSplit, rx, S2, limit2, internalSplit !== nativeSplit);
if (res.done)
return res.value;
var C3 = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
var splitter2 = new C3(UNSUPPORTED_Y ? "^(?:" + rx.source + ")" : rx, flags);
var lim = limit2 === void 0 ? MAX_UINT32 : limit2 >>> 0;
if (lim === 0)
return [];
if (S2.length === 0)
return callRegExpExec(splitter2, S2) === null ? [S2] : [];
var p2 = 0;
var q2 = 0;
var A5 = [];
while (q2 < S2.length) {
splitter2.lastIndex = UNSUPPORTED_Y ? 0 : q2;
var z2 = callRegExpExec(splitter2, UNSUPPORTED_Y ? stringSlice(S2, q2) : S2);
var e7;
if (z2 === null || (e7 = min(toLength(splitter2.lastIndex + (UNSUPPORTED_Y ? q2 : 0)), S2.length)) === p2) {
q2 = advanceStringIndex(S2, q2, unicodeMatching);
} else {
push(A5, stringSlice(S2, p2, q2));
if (A5.length === lim)
return A5;
for (var i2 = 1; i2 <= z2.length - 1; i2++) {
push(A5, z2[i2]);
if (A5.length === lim)
return A5;
}
q2 = p2 = e7;
}
}
push(A5, stringSlice(S2, p2));
return A5;
}
];
}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
var raf$1 = { exports: {} };
var performanceNow = { exports: {} };
(function() {
var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
if (typeof performance !== "undefined" && performance !== null && performance.now) {
performanceNow.exports = function() {
return performance.now();
};
} else if (typeof process !== "undefined" && process !== null && process.hrtime) {
performanceNow.exports = function() {
return (getNanoSeconds() - nodeLoadTime) / 1e6;
};
hrtime = process.hrtime;
getNanoSeconds = function() {
var hr2;
hr2 = hrtime();
return hr2[0] * 1e9 + hr2[1];
};
moduleLoadTime = getNanoSeconds();
upTime = process.uptime() * 1e9;
nodeLoadTime = moduleLoadTime - upTime;
} else if (Date.now) {
performanceNow.exports = function() {
return Date.now() - loadTime;
};
loadTime = Date.now();
} else {
performanceNow.exports = function() {
return (/* @__PURE__ */ new Date()).getTime() - loadTime;
};
loadTime = (/* @__PURE__ */ new Date()).getTime();
}
}).call(commonjsGlobal$1);
var performanceNowExports = performanceNow.exports;
var now = performanceNowExports, root = typeof window === "undefined" ? commonjsGlobal$1 : window, vendors = ["moz", "webkit"], suffix = "AnimationFrame", raf = root["request" + suffix], caf = root["cancel" + suffix] || root["cancelRequest" + suffix];
for (var i$a = 0; !raf && i$a < vendors.length; i$a++) {
raf = root[vendors[i$a] + "Request" + suffix];
caf = root[vendors[i$a] + "Cancel" + suffix] || root[vendors[i$a] + "CancelRequest" + suffix];
}
if (!raf || !caf) {
var last = 0, id = 0, queue = [], frameDuration = 1e3 / 60;
raf = function(callback) {
if (queue.length === 0) {
var _now = now(), next2 = Math.max(0, frameDuration - (_now - last));
last = next2 + _now;
setTimeout(function() {
var cp = queue.slice(0);
queue.length = 0;
for (var i2 = 0; i2 < cp.length; i2++) {
if (!cp[i2].cancelled) {
try {
cp[i2].callback(last);
} catch (e7) {
setTimeout(function() {
throw e7;
}, 0);
}
}
}
}, Math.round(next2));
}
queue.push({
handle: ++id,
callback,
cancelled: false
});
return id;
};
caf = function(handle2) {
for (var i2 = 0; i2 < queue.length; i2++) {
if (queue[i2].handle === handle2) {
queue[i2].cancelled = true;
}
}
};
}
raf$1.exports = function(fn8) {
return raf.call(root, fn8);
};
raf$1.exports.cancel = function() {
caf.apply(root, arguments);
};
raf$1.exports.polyfill = function(object2) {
if (!object2) {
object2 = root;
}
object2.requestAnimationFrame = raf;
object2.cancelAnimationFrame = caf;
};
var rafExports = raf$1.exports;
const requestAnimationFrame$1 = /* @__PURE__ */ getDefaultExportFromCjs(rafExports);
var whitespaces$2 = " \n\v\f\r \u2028\u2029\uFEFF";
var uncurryThis$3 = functionUncurryThis;
var requireObjectCoercible$1 = requireObjectCoercible$a;
var toString$1 = toString$9;
var whitespaces$1 = whitespaces$2;
var replace = uncurryThis$3("".replace);
var ltrim = RegExp("^[" + whitespaces$1 + "]+");
var rtrim = RegExp("(^|[^" + whitespaces$1 + "])[" + whitespaces$1 + "]+$");
var createMethod = function(TYPE) {
return function($this) {
var string2 = toString$1(requireObjectCoercible$1($this));
if (TYPE & 1)
string2 = replace(string2, ltrim, "");
if (TYPE & 2)
string2 = replace(string2, rtrim, "$1");
return string2;
};
};
var stringTrim = {
// `String.prototype.{ trimLeft, trimStart }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
start: createMethod(1),
// `String.prototype.{ trimRight, trimEnd }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimend
end: createMethod(2),
// `String.prototype.trim` method
// https://tc39.es/ecma262/#sec-string.prototype.trim
trim: createMethod(3)
};
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
var fails$1 = fails$l;
var whitespaces = whitespaces$2;
var non = "
";
var stringTrimForced = function(METHOD_NAME) {
return fails$1(function() {
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME$1 && whitespaces[METHOD_NAME].name !== METHOD_NAME;
});
};
var $$3 = _export;
var $trim = stringTrim.trim;
var forcedStringTrimMethod = stringTrimForced;
$$3({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
trim: function trim2() {
return $trim(this);
}
});
var rgbcolor = function(color_string) {
this.ok = false;
this.alpha = 1;
if (color_string.charAt(0) == "#") {
color_string = color_string.substr(1, 6);
}
color_string = color_string.replace(/ /g, "");
color_string = color_string.toLowerCase();
var simple_colors = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "00ffff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000000",
blanchedalmond: "ffebcd",
blue: "0000ff",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "00ffff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dodgerblue: "1e90ff",
feldspar: "d19275",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "ff00ff",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgrey: "d3d3d3",
lightgreen: "90ee90",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslateblue: "8470ff",
lightslategray: "778899",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "00ff00",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "ff00ff",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370d8",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "d87093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "ff0000",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
violetred: "d02090",
wheat: "f5deb3",
white: "ffffff",
whitesmoke: "f5f5f5",
yellow: "ffff00",
yellowgreen: "9acd32"
};
color_string = simple_colors[color_string] || color_string;
var color_defs = [
{
re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
example: ["rgba(123, 234, 45, 0.8)", "rgba(255,234,245,1.0)"],
process: function(bits3) {
return [
parseInt(bits3[1]),
parseInt(bits3[2]),
parseInt(bits3[3]),
parseFloat(bits3[4])
];
}
},
{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
process: function(bits3) {
return [
parseInt(bits3[1]),
parseInt(bits3[2]),
parseInt(bits3[3])
];
}
},
{
re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
example: ["#00ff00", "336699"],
process: function(bits3) {
return [
parseInt(bits3[1], 16),
parseInt(bits3[2], 16),
parseInt(bits3[3], 16)
];
}
},
{
re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
example: ["#fb0", "f0f"],
process: function(bits3) {
return [
parseInt(bits3[1] + bits3[1], 16),
parseInt(bits3[2] + bits3[2], 16),
parseInt(bits3[3] + bits3[3], 16)
];
}
}
];
for (var i2 = 0; i2 < color_defs.length; i2++) {
var re2 = color_defs[i2].re;
var processor = color_defs[i2].process;
var bits2 = re2.exec(color_string);
if (bits2) {
var channels = processor(bits2);
this.r = channels[0];
this.g = channels[1];
this.b = channels[2];
if (channels.length > 3) {
this.alpha = channels[3];
}
this.ok = true;
}
}
this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;
this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;
this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;
this.alpha = this.alpha < 0 ? 0 : this.alpha > 1 || isNaN(this.alpha) ? 1 : this.alpha;
this.toRGB = function() {
return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
};
this.toRGBA = function() {
return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + this.alpha + ")";
};
this.toHex = function() {
var r2 = this.r.toString(16);
var g2 = this.g.toString(16);
var b2 = this.b.toString(16);
if (r2.length == 1)
r2 = "0" + r2;
if (g2.length == 1)
g2 = "0" + g2;
if (b2.length == 1)
b2 = "0" + b2;
return "#" + r2 + g2 + b2;
};
this.getHelpXML = function() {
var examples = new Array();
for (var i3 = 0; i3 < color_defs.length; i3++) {
var example = color_defs[i3].example;
for (var j2 = 0; j2 < example.length; j2++) {
examples[examples.length] = example[j2];
}
}
for (var sc2 in simple_colors) {
examples[examples.length] = sc2;
}
var xml2 = document.createElement("ul");
xml2.setAttribute("id", "rgbcolor-examples");
for (var i3 = 0; i3 < examples.length; i3++) {
try {
var list_item = document.createElement("li");
var list_color = new RGBColor(examples[i3]);
var example_div = document.createElement("div");
example_div.style.cssText = "margin: 3px; border: 1px solid black; background:" + list_color.toHex() + "; color:" + list_color.toHex();
example_div.appendChild(document.createTextNode("test"));
var list_item_value = document.createTextNode(
" " + examples[i3] + " -> " + list_color.toRGB() + " -> " + list_color.toHex()
);
list_item.appendChild(example_div);
list_item.appendChild(list_item_value);
xml2.appendChild(list_item);
} catch (e7) {
}
}
return xml2;
};
};
const RGBColor$1 = /* @__PURE__ */ getDefaultExportFromCjs(rgbcolor);
var $$2 = _export;
var uncurryThis$2 = functionUncurryThisClause;
var $indexOf = arrayIncludes.indexOf;
var arrayMethodIsStrict = arrayMethodIsStrict$2;
var nativeIndexOf = uncurryThis$2([].indexOf);
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict("indexOf");
$$2({ target: "Array", proto: true, forced: FORCED }, {
indexOf: function indexOf2(searchElement) {
var fromIndex = arguments.length > 1 ? arguments[1] : void 0;
return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
}
});
var $$1 = _export;
var uncurryThis$1 = functionUncurryThis;
var notARegExp = notARegexp;
var requireObjectCoercible = requireObjectCoercible$a;
var toString3 = toString$9;
var correctIsRegExpLogic = correctIsRegexpLogic;
var stringIndexOf = uncurryThis$1("".indexOf);
$$1({ target: "String", proto: true, forced: !correctIsRegExpLogic("includes") }, {
includes: function includes(searchString) {
return !!~stringIndexOf(
toString3(requireObjectCoercible(this)),
toString3(notARegExp(searchString)),
arguments.length > 1 ? arguments[1] : void 0
);
}
});
var classof = classofRaw$2;
var isArray$1 = Array.isArray || function isArray(argument) {
return classof(argument) == "Array";
};
var $ = _export;
var uncurryThis = functionUncurryThis;
var isArray2 = isArray$1;
var nativeReverse = uncurryThis([].reverse);
var test = [1, 2];
$({ target: "Array", proto: true, forced: String(test) === String(test.reverse()) }, {
reverse: function reverse2() {
if (isArray2(this))
this.length = this.length;
return nativeReverse(this);
}
});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var t$k = function(r2, e7) {
return (t$k = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t5, r3) {
t5.__proto__ = r3;
} || function(t5, r3) {
for (var e8 in r3)
Object.prototype.hasOwnProperty.call(r3, e8) && (t5[e8] = r3[e8]);
})(r2, e7);
};
function r$k(r2, e7) {
if ("function" != typeof e7 && null !== e7)
throw new TypeError("Class extends value " + String(e7) + " is not a constructor or null");
function i2() {
this.constructor = r2;
}
t$k(r2, e7), r2.prototype = null === e7 ? Object.create(e7) : (i2.prototype = e7.prototype, new i2());
}
function e$k(t5) {
var r2 = "";
Array.isArray(t5) || (t5 = [t5]);
for (var e7 = 0; e7 < t5.length; e7++) {
var i2 = t5[e7];
if (i2.type === _23.CLOSE_PATH)
r2 += "z";
else if (i2.type === _23.HORIZ_LINE_TO)
r2 += (i2.relative ? "h" : "H") + i2.x;
else if (i2.type === _23.VERT_LINE_TO)
r2 += (i2.relative ? "v" : "V") + i2.y;
else if (i2.type === _23.MOVE_TO)
r2 += (i2.relative ? "m" : "M") + i2.x + " " + i2.y;
else if (i2.type === _23.LINE_TO)
r2 += (i2.relative ? "l" : "L") + i2.x + " " + i2.y;
else if (i2.type === _23.CURVE_TO)
r2 += (i2.relative ? "c" : "C") + i2.x1 + " " + i2.y1 + " " + i2.x2 + " " + i2.y2 + " " + i2.x + " " + i2.y;
else if (i2.type === _23.SMOOTH_CURVE_TO)
r2 += (i2.relative ? "s" : "S") + i2.x2 + " " + i2.y2 + " " + i2.x + " " + i2.y;
else if (i2.type === _23.QUAD_TO)
r2 += (i2.relative ? "q" : "Q") + i2.x1 + " " + i2.y1 + " " + i2.x + " " + i2.y;
else if (i2.type === _23.SMOOTH_QUAD_TO)
r2 += (i2.relative ? "t" : "T") + i2.x + " " + i2.y;
else {
if (i2.type !== _23.ARC)
throw new Error('Unexpected command type "' + i2.type + '" at index ' + e7 + ".");
r2 += (i2.relative ? "a" : "A") + i2.rX + " " + i2.rY + " " + i2.xRot + " " + +i2.lArcFlag + " " + +i2.sweepFlag + " " + i2.x + " " + i2.y;
}
}
return r2;
}
function i$9(t5, r2) {
var e7 = t5[0], i2 = t5[1];
return [e7 * Math.cos(r2) - i2 * Math.sin(r2), e7 * Math.sin(r2) + i2 * Math.cos(r2)];
}
function a$k() {
for (var t5 = [], r2 = 0; r2 < arguments.length; r2++)
t5[r2] = arguments[r2];
for (var e7 = 0; e7 < t5.length; e7++)
if ("number" != typeof t5[e7])
throw new Error("assertNumbers arguments[" + e7 + "] is not a number. " + typeof t5[e7] + " == typeof " + t5[e7]);
return true;
}
var n$7 = Math.PI;
function o$j(t5, r2, e7) {
t5.lArcFlag = 0 === t5.lArcFlag ? 0 : 1, t5.sweepFlag = 0 === t5.sweepFlag ? 0 : 1;
var a2 = t5.rX, o2 = t5.rY, s2 = t5.x, u2 = t5.y;
a2 = Math.abs(t5.rX), o2 = Math.abs(t5.rY);
var h2 = i$9([(r2 - s2) / 2, (e7 - u2) / 2], -t5.xRot / 180 * n$7), c2 = h2[0], y2 = h2[1], p2 = Math.pow(c2, 2) / Math.pow(a2, 2) + Math.pow(y2, 2) / Math.pow(o2, 2);
1 < p2 && (a2 *= Math.sqrt(p2), o2 *= Math.sqrt(p2)), t5.rX = a2, t5.rY = o2;
var m2 = Math.pow(a2, 2) * Math.pow(y2, 2) + Math.pow(o2, 2) * Math.pow(c2, 2), O2 = (t5.lArcFlag !== t5.sweepFlag ? 1 : -1) * Math.sqrt(Math.max(0, (Math.pow(a2, 2) * Math.pow(o2, 2) - m2) / m2)), l2 = a2 * y2 / o2 * O2, T2 = -o2 * c2 / a2 * O2, v2 = i$9([l2, T2], t5.xRot / 180 * n$7);
t5.cX = v2[0] + (r2 + s2) / 2, t5.cY = v2[1] + (e7 + u2) / 2, t5.phi1 = Math.atan2((y2 - T2) / o2, (c2 - l2) / a2), t5.phi2 = Math.atan2((-y2 - T2) / o2, (-c2 - l2) / a2), 0 === t5.sweepFlag && t5.phi2 > t5.phi1 && (t5.phi2 -= 2 * n$7), 1 === t5.sweepFlag && t5.phi2 < t5.phi1 && (t5.phi2 += 2 * n$7), t5.phi1 *= 180 / n$7, t5.phi2 *= 180 / n$7;
}
function s$e(t5, r2, e7) {
a$k(t5, r2, e7);
var i2 = t5 * t5 + r2 * r2 - e7 * e7;
if (0 > i2)
return [];
if (0 === i2)
return [[t5 * e7 / (t5 * t5 + r2 * r2), r2 * e7 / (t5 * t5 + r2 * r2)]];
var n2 = Math.sqrt(i2);
return [[(t5 * e7 + r2 * n2) / (t5 * t5 + r2 * r2), (r2 * e7 - t5 * n2) / (t5 * t5 + r2 * r2)], [(t5 * e7 - r2 * n2) / (t5 * t5 + r2 * r2), (r2 * e7 + t5 * n2) / (t5 * t5 + r2 * r2)]];
}
var u$5, h$4 = Math.PI / 180;
function c$1(t5, r2, e7) {
return (1 - e7) * t5 + e7 * r2;
}
function y$2(t5, r2, e7, i2) {
return t5 + Math.cos(i2 / 180 * n$7) * r2 + Math.sin(i2 / 180 * n$7) * e7;
}
function p$2(t5, r2, e7, i2) {
var a2 = 1e-6, n2 = r2 - t5, o2 = e7 - r2, s2 = 3 * n2 + 3 * (i2 - e7) - 6 * o2, u2 = 6 * (o2 - n2), h2 = 3 * n2;
return Math.abs(s2) < a2 ? [-h2 / u2] : function(t6, r3, e8) {
void 0 === e8 && (e8 = 1e-6);
var i3 = t6 * t6 / 4 - r3;
if (i3 < -e8)
return [];
if (i3 <= e8)
return [-t6 / 2];
var a3 = Math.sqrt(i3);
return [-t6 / 2 - a3, -t6 / 2 + a3];
}(u2 / s2, h2 / s2, a2);
}
function m$f(t5, r2, e7, i2, a2) {
var n2 = 1 - a2;
return t5 * (n2 * n2 * n2) + r2 * (3 * n2 * n2 * a2) + e7 * (3 * n2 * a2 * a2) + i2 * (a2 * a2 * a2);
}
!function(t5) {
function r2() {
return u2(function(t6, r3, e8) {
return t6.relative && (void 0 !== t6.x1 && (t6.x1 += r3), void 0 !== t6.y1 && (t6.y1 += e8), void 0 !== t6.x2 && (t6.x2 += r3), void 0 !== t6.y2 && (t6.y2 += e8), void 0 !== t6.x && (t6.x += r3), void 0 !== t6.y && (t6.y += e8), t6.relative = false), t6;
});
}
function e7() {
var t6 = NaN, r3 = NaN, e8 = NaN, i2 = NaN;
return u2(function(a2, n3, o2) {
return a2.type & _23.SMOOTH_CURVE_TO && (a2.type = _23.CURVE_TO, t6 = isNaN(t6) ? n3 : t6, r3 = isNaN(r3) ? o2 : r3, a2.x1 = a2.relative ? n3 - t6 : 2 * n3 - t6, a2.y1 = a2.relative ? o2 - r3 : 2 * o2 - r3), a2.type & _23.CURVE_TO ? (t6 = a2.relative ? n3 + a2.x2 : a2.x2, r3 = a2.relative ? o2 + a2.y2 : a2.y2) : (t6 = NaN, r3 = NaN), a2.type & _23.SMOOTH_QUAD_TO && (a2.type = _23.QUAD_TO, e8 = isNaN(e8) ? n3 : e8, i2 = isNaN(i2) ? o2 : i2, a2.x1 = a2.relative ? n3 - e8 : 2 * n3 - e8, a2.y1 = a2.relative ? o2 - i2 : 2 * o2 - i2), a2.type & _23.QUAD_TO ? (e8 = a2.relative ? n3 + a2.x1 : a2.x1, i2 = a2.relative ? o2 + a2.y1 : a2.y1) : (e8 = NaN, i2 = NaN), a2;
});
}
function n2() {
var t6 = NaN, r3 = NaN;
return u2(function(e8, i2, a2) {
if (e8.type & _23.SMOOTH_QUAD_TO && (e8.type = _23.QUAD_TO, t6 = isNaN(t6) ? i2 : t6, r3 = isNaN(r3) ? a2 : r3, e8.x1 = e8.relative ? i2 - t6 : 2 * i2 - t6, e8.y1 = e8.relative ? a2 - r3 : 2 * a2 - r3), e8.type & _23.QUAD_TO) {
t6 = e8.relative ? i2 + e8.x1 : e8.x1, r3 = e8.relative ? a2 + e8.y1 : e8.y1;
var n3 = e8.x1, o2 = e8.y1;
e8.type = _23.CURVE_TO, e8.x1 = ((e8.relative ? 0 : i2) + 2 * n3) / 3, e8.y1 = ((e8.relative ? 0 : a2) + 2 * o2) / 3, e8.x2 = (e8.x + 2 * n3) / 3, e8.y2 = (e8.y + 2 * o2) / 3;
} else
t6 = NaN, r3 = NaN;
return e8;
});
}
function u2(t6) {
var r3 = 0, e8 = 0, i2 = NaN, a2 = NaN;
return function(n3) {
if (isNaN(i2) && !(n3.type & _23.MOVE_TO))
throw new Error("path must start with moveto");
var o2 = t6(n3, r3, e8, i2, a2);
return n3.type & _23.CLOSE_PATH && (r3 = i2, e8 = a2), void 0 !== n3.x && (r3 = n3.relative ? r3 + n3.x : n3.x), void 0 !== n3.y && (e8 = n3.relative ? e8 + n3.y : n3.y), n3.type & _23.MOVE_TO && (i2 = r3, a2 = e8), o2;
};
}
function O2(t6, r3, e8, i2, n3, o2) {
return a$k(t6, r3, e8, i2, n3, o2), u2(function(a2, s2, u3, h2) {
var c2 = a2.x1, y2 = a2.x2, p2 = a2.relative && !isNaN(h2), m2 = void 0 !== a2.x ? a2.x : p2 ? 0 : s2, O3 = void 0 !== a2.y ? a2.y : p2 ? 0 : u3;
function l3(t7) {
return t7 * t7;
}
a2.type & _23.HORIZ_LINE_TO && 0 !== r3 && (a2.type = _23.LINE_TO, a2.y = a2.relative ? 0 : u3), a2.type & _23.VERT_LINE_TO && 0 !== e8 && (a2.type = _23.LINE_TO, a2.x = a2.relative ? 0 : s2), void 0 !== a2.x && (a2.x = a2.x * t6 + O3 * e8 + (p2 ? 0 : n3)), void 0 !== a2.y && (a2.y = m2 * r3 + a2.y * i2 + (p2 ? 0 : o2)), void 0 !== a2.x1 && (a2.x1 = a2.x1 * t6 + a2.y1 * e8 + (p2 ? 0 : n3)), void 0 !== a2.y1 && (a2.y1 = c2 * r3 + a2.y1 * i2 + (p2 ? 0 : o2)), void 0 !== a2.x2 && (a2.x2 = a2.x2 * t6 + a2.y2 * e8 + (p2 ? 0 : n3)), void 0 !== a2.y2 && (a2.y2 = y2 * r3 + a2.y2 * i2 + (p2 ? 0 : o2));
var T2 = t6 * i2 - r3 * e8;
if (void 0 !== a2.xRot && (1 !== t6 || 0 !== r3 || 0 !== e8 || 1 !== i2))
if (0 === T2)
delete a2.rX, delete a2.rY, delete a2.xRot, delete a2.lArcFlag, delete a2.sweepFlag, a2.type = _23.LINE_TO;
else {
var v2 = a2.xRot * Math.PI / 180, f2 = Math.sin(v2), N2 = Math.cos(v2), x2 = 1 / l3(a2.rX), d2 = 1 / l3(a2.rY), E2 = l3(N2) * x2 + l3(f2) * d2, A5 = 2 * f2 * N2 * (x2 - d2), C3 = l3(f2) * x2 + l3(N2) * d2, M2 = E2 * i2 * i2 - A5 * r3 * i2 + C3 * r3 * r3, R2 = A5 * (t6 * i2 + r3 * e8) - 2 * (E2 * e8 * i2 + C3 * t6 * r3), g2 = E2 * e8 * e8 - A5 * t6 * e8 + C3 * t6 * t6, I2 = (Math.atan2(R2, M2 - g2) + Math.PI) % Math.PI / 2, S2 = Math.sin(I2), L2 = Math.cos(I2);
a2.rX = Math.abs(T2) / Math.sqrt(M2 * l3(L2) + R2 * S2 * L2 + g2 * l3(S2)), a2.rY = Math.abs(T2) / Math.sqrt(M2 * l3(S2) - R2 * S2 * L2 + g2 * l3(L2)), a2.xRot = 180 * I2 / Math.PI;
}
return void 0 !== a2.sweepFlag && 0 > T2 && (a2.sweepFlag = +!a2.sweepFlag), a2;
});
}
function l2() {
return function(t6) {
var r3 = {};
for (var e8 in t6)
r3[e8] = t6[e8];
return r3;
};
}
t5.ROUND = function(t6) {
function r3(r4) {
return Math.round(r4 * t6) / t6;
}
return void 0 === t6 && (t6 = 1e13), a$k(t6), function(t7) {
return void 0 !== t7.x1 && (t7.x1 = r3(t7.x1)), void 0 !== t7.y1 && (t7.y1 = r3(t7.y1)), void 0 !== t7.x2 && (t7.x2 = r3(t7.x2)), void 0 !== t7.y2 && (t7.y2 = r3(t7.y2)), void 0 !== t7.x && (t7.x = r3(t7.x)), void 0 !== t7.y && (t7.y = r3(t7.y)), void 0 !== t7.rX && (t7.rX = r3(t7.rX)), void 0 !== t7.rY && (t7.rY = r3(t7.rY)), t7;
};
}, t5.TO_ABS = r2, t5.TO_REL = function() {
return u2(function(t6, r3, e8) {
return t6.relative || (void 0 !== t6.x1 && (t6.x1 -= r3), void 0 !== t6.y1 && (t6.y1 -= e8), void 0 !== t6.x2 && (t6.x2 -= r3), void 0 !== t6.y2 && (t6.y2 -= e8), void 0 !== t6.x && (t6.x -= r3), void 0 !== t6.y && (t6.y -= e8), t6.relative = true), t6;
});
}, t5.NORMALIZE_HVZ = function(t6, r3, e8) {
return void 0 === t6 && (t6 = true), void 0 === r3 && (r3 = true), void 0 === e8 && (e8 = true), u2(function(i2, a2, n3, o2, s2) {
if (isNaN(o2) && !(i2.type & _23.MOVE_TO))
throw new Error("path must start with moveto");
return r3 && i2.type & _23.HORIZ_LINE_TO && (i2.type = _23.LINE_TO, i2.y = i2.relative ? 0 : n3), e8 && i2.type & _23.VERT_LINE_TO && (i2.type = _23.LINE_TO, i2.x = i2.relative ? 0 : a2), t6 && i2.type & _23.CLOSE_PATH && (i2.type = _23.LINE_TO, i2.x = i2.relative ? o2 - a2 : o2, i2.y = i2.relative ? s2 - n3 : s2), i2.type & _23.ARC && (0 === i2.rX || 0 === i2.rY) && (i2.type = _23.LINE_TO, delete i2.rX, delete i2.rY, delete i2.xRot, delete i2.lArcFlag, delete i2.sweepFlag), i2;
});
}, t5.NORMALIZE_ST = e7, t5.QT_TO_C = n2, t5.INFO = u2, t5.SANITIZE = function(t6) {
void 0 === t6 && (t6 = 0), a$k(t6);
var r3 = NaN, e8 = NaN, i2 = NaN, n3 = NaN;
return u2(function(a2, o2, s2, u3, h2) {
var c2 = Math.abs, y2 = false, p2 = 0, m2 = 0;
if (a2.type & _23.SMOOTH_CURVE_TO && (p2 = isNaN(r3) ? 0 : o2 - r3, m2 = isNaN(e8) ? 0 : s2 - e8), a2.type & (_23.CURVE_TO | _23.SMOOTH_CURVE_TO) ? (r3 = a2.relative ? o2 + a2.x2 : a2.x2, e8 = a2.relative ? s2 + a2.y2 : a2.y2) : (r3 = NaN, e8 = NaN), a2.type & _23.SMOOTH_QUAD_TO ? (i2 = isNaN(i2) ? o2 : 2 * o2 - i2, n3 = isNaN(n3) ? s2 : 2 * s2 - n3) : a2.type & _23.QUAD_TO ? (i2 = a2.relative ? o2 + a2.x1 : a2.x1, n3 = a2.relative ? s2 + a2.y1 : a2.y2) : (i2 = NaN, n3 = NaN), a2.type & _23.LINE_COMMANDS || a2.type & _23.ARC && (0 === a2.rX || 0 === a2.rY || !a2.lArcFlag) || a2.type & _23.CURVE_TO || a2.type & _23.SMOOTH_CURVE_TO || a2.type & _23.QUAD_TO || a2.type & _23.SMOOTH_QUAD_TO) {
var O3 = void 0 === a2.x ? 0 : a2.relative ? a2.x : a2.x - o2, l3 = void 0 === a2.y ? 0 : a2.relative ? a2.y : a2.y - s2;
p2 = isNaN(i2) ? void 0 === a2.x1 ? p2 : a2.relative ? a2.x : a2.x1 - o2 : i2 - o2, m2 = isNaN(n3) ? void 0 === a2.y1 ? m2 : a2.relative ? a2.y : a2.y1 - s2 : n3 - s2;
var T2 = void 0 === a2.x2 ? 0 : a2.relative ? a2.x : a2.x2 - o2, v2 = void 0 === a2.y2 ? 0 : a2.relative ? a2.y : a2.y2 - s2;
c2(O3) <= t6 && c2(l3) <= t6 && c2(p2) <= t6 && c2(m2) <= t6 && c2(T2) <= t6 && c2(v2) <= t6 && (y2 = true);
}
return a2.type & _23.CLOSE_PATH && c2(o2 - u3) <= t6 && c2(s2 - h2) <= t6 && (y2 = true), y2 ? [] : a2;
});
}, t5.MATRIX = O2, t5.ROTATE = function(t6, r3, e8) {
void 0 === r3 && (r3 = 0), void 0 === e8 && (e8 = 0), a$k(t6, r3, e8);
var i2 = Math.sin(t6), n3 = Math.cos(t6);
return O2(n3, i2, -i2, n3, r3 - r3 * n3 + e8 * i2, e8 - r3 * i2 - e8 * n3);
}, t5.TRANSLATE = function(t6, r3) {
return void 0 === r3 && (r3 = 0), a$k(t6, r3), O2(1, 0, 0, 1, t6, r3);
}, t5.SCALE = function(t6, r3) {
return void 0 === r3 && (r3 = t6), a$k(t6, r3), O2(t6, 0, 0, r3, 0, 0);
}, t5.SKEW_X = function(t6) {
return a$k(t6), O2(1, 0, Math.atan(t6), 1, 0, 0);
}, t5.SKEW_Y = function(t6) {
return a$k(t6), O2(1, Math.atan(t6), 0, 1, 0, 0);
}, t5.X_AXIS_SYMMETRY = function(t6) {
return void 0 === t6 && (t6 = 0), a$k(t6), O2(-1, 0, 0, 1, t6, 0);
}, t5.Y_AXIS_SYMMETRY = function(t6) {
return void 0 === t6 && (t6 = 0), a$k(t6), O2(1, 0, 0, -1, 0, t6);
}, t5.A_TO_C = function() {
return u2(function(t6, r3, e8) {
return _23.ARC === t6.type ? function(t7, r4, e9) {
var a2, n3, s2, u3;
t7.cX || o$j(t7, r4, e9);
for (var y2 = Math.min(t7.phi1, t7.phi2), p2 = Math.max(t7.phi1, t7.phi2) - y2, m2 = Math.ceil(p2 / 90), O3 = new Array(m2), l3 = r4, T2 = e9, v2 = 0; v2 < m2; v2++) {
var f2 = c$1(t7.phi1, t7.phi2, v2 / m2), N2 = c$1(t7.phi1, t7.phi2, (v2 + 1) / m2), x2 = N2 - f2, d2 = 4 / 3 * Math.tan(x2 * h$4 / 4), E2 = [Math.cos(f2 * h$4) - d2 * Math.sin(f2 * h$4), Math.sin(f2 * h$4) + d2 * Math.cos(f2 * h$4)], A5 = E2[0], C3 = E2[1], M2 = [Math.cos(N2 * h$4), Math.sin(N2 * h$4)], R2 = M2[0], g2 = M2[1], I2 = [R2 + d2 * Math.sin(N2 * h$4), g2 - d2 * Math.cos(N2 * h$4)], S2 = I2[0], L2 = I2[1];
O3[v2] = { relative: t7.relative, type: _23.CURVE_TO };
var H4 = function(r5, e11) {
var a3 = i$9([r5 * t7.rX, e11 * t7.rY], t7.xRot), n4 = a3[0], o2 = a3[1];
return [t7.cX + n4, t7.cY + o2];
};
a2 = H4(A5, C3), O3[v2].x1 = a2[0], O3[v2].y1 = a2[1], n3 = H4(S2, L2), O3[v2].x2 = n3[0], O3[v2].y2 = n3[1], s2 = H4(R2, g2), O3[v2].x = s2[0], O3[v2].y = s2[1], t7.relative && (O3[v2].x1 -= l3, O3[v2].y1 -= T2, O3[v2].x2 -= l3, O3[v2].y2 -= T2, O3[v2].x -= l3, O3[v2].y -= T2), l3 = (u3 = [O3[v2].x, O3[v2].y])[0], T2 = u3[1];
}
return O3;
}(t6, t6.relative ? 0 : r3, t6.relative ? 0 : e8) : t6;
});
}, t5.ANNOTATE_ARCS = function() {
return u2(function(t6, r3, e8) {
return t6.relative && (r3 = 0, e8 = 0), _23.ARC === t6.type && o$j(t6, r3, e8), t6;
});
}, t5.CLONE = l2, t5.CALCULATE_BOUNDS = function() {
var t6 = function(t7) {
var r3 = {};
for (var e8 in t7)
r3[e8] = t7[e8];
return r3;
}, i2 = r2(), a2 = n2(), h2 = e7(), c2 = u2(function(r3, e8, n3) {
var u3 = h2(a2(i2(t6(r3))));
function O3(t7) {
t7 > c2.maxX && (c2.maxX = t7), t7 < c2.minX && (c2.minX = t7);
}
function l3(t7) {
t7 > c2.maxY && (c2.maxY = t7), t7 < c2.minY && (c2.minY = t7);
}
if (u3.type & _23.DRAWING_COMMANDS && (O3(e8), l3(n3)), u3.type & _23.HORIZ_LINE_TO && O3(u3.x), u3.type & _23.VERT_LINE_TO && l3(u3.y), u3.type & _23.LINE_TO && (O3(u3.x), l3(u3.y)), u3.type & _23.CURVE_TO) {
O3(u3.x), l3(u3.y);
for (var T2 = 0, v2 = p$2(e8, u3.x1, u3.x2, u3.x); T2 < v2.length; T2++) {
0 < (w2 = v2[T2]) && 1 > w2 && O3(m$f(e8, u3.x1, u3.x2, u3.x, w2));
}
for (var f2 = 0, N2 = p$2(n3, u3.y1, u3.y2, u3.y); f2 < N2.length; f2++) {
0 < (w2 = N2[f2]) && 1 > w2 && l3(m$f(n3, u3.y1, u3.y2, u3.y, w2));
}
}
if (u3.type & _23.ARC) {
O3(u3.x), l3(u3.y), o$j(u3, e8, n3);
for (var x2 = u3.xRot / 180 * Math.PI, d2 = Math.cos(x2) * u3.rX, E2 = Math.sin(x2) * u3.rX, A5 = -Math.sin(x2) * u3.rY, C3 = Math.cos(x2) * u3.rY, M2 = u3.phi1 < u3.phi2 ? [u3.phi1, u3.phi2] : -180 > u3.phi2 ? [u3.phi2 + 360, u3.phi1 + 360] : [u3.phi2, u3.phi1], R2 = M2[0], g2 = M2[1], I2 = function(t7) {
var r4 = t7[0], e9 = t7[1], i3 = 180 * Math.atan2(e9, r4) / Math.PI;
return i3 < R2 ? i3 + 360 : i3;
}, S2 = 0, L2 = s$e(A5, -d2, 0).map(I2); S2 < L2.length; S2++) {
(w2 = L2[S2]) > R2 && w2 < g2 && O3(y$2(u3.cX, d2, A5, w2));
}
for (var H4 = 0, U2 = s$e(C3, -E2, 0).map(I2); H4 < U2.length; H4++) {
var w2;
(w2 = U2[H4]) > R2 && w2 < g2 && l3(y$2(u3.cY, E2, C3, w2));
}
}
return r3;
});
return c2.minX = 1 / 0, c2.maxX = -1 / 0, c2.minY = 1 / 0, c2.maxY = -1 / 0, c2;
};
}(u$5 || (u$5 = {}));
var O, l = function() {
function t5() {
}
return t5.prototype.round = function(t6) {
return this.transform(u$5.ROUND(t6));
}, t5.prototype.toAbs = function() {
return this.transform(u$5.TO_ABS());
}, t5.prototype.toRel = function() {
return this.transform(u$5.TO_REL());
}, t5.prototype.normalizeHVZ = function(t6, r2, e7) {
return this.transform(u$5.NORMALIZE_HVZ(t6, r2, e7));
}, t5.prototype.normalizeST = function() {
return this.transform(u$5.NORMALIZE_ST());
}, t5.prototype.qtToC = function() {
return this.transform(u$5.QT_TO_C());
}, t5.prototype.aToC = function() {
return this.transform(u$5.A_TO_C());
}, t5.prototype.sanitize = function(t6) {
return this.transform(u$5.SANITIZE(t6));
}, t5.prototype.translate = function(t6, r2) {
return this.transform(u$5.TRANSLATE(t6, r2));
}, t5.prototype.scale = function(t6, r2) {
return this.transform(u$5.SCALE(t6, r2));
}, t5.prototype.rotate = function(t6, r2, e7) {
return this.transform(u$5.ROTATE(t6, r2, e7));
}, t5.prototype.matrix = function(t6, r2, e7, i2, a2, n2) {
return this.transform(u$5.MATRIX(t6, r2, e7, i2, a2, n2));
}, t5.prototype.skewX = function(t6) {
return this.transform(u$5.SKEW_X(t6));
}, t5.prototype.skewY = function(t6) {
return this.transform(u$5.SKEW_Y(t6));
}, t5.prototype.xSymmetry = function(t6) {
return this.transform(u$5.X_AXIS_SYMMETRY(t6));
}, t5.prototype.ySymmetry = function(t6) {
return this.transform(u$5.Y_AXIS_SYMMETRY(t6));
}, t5.prototype.annotateArcs = function() {
return this.transform(u$5.ANNOTATE_ARCS());
}, t5;
}(), T = function(t5) {
return " " === t5 || " " === t5 || "\r" === t5 || "\n" === t5;
}, v = function(t5) {
return "0".charCodeAt(0) <= t5.charCodeAt(0) && t5.charCodeAt(0) <= "9".charCodeAt(0);
}, f = function(t5) {
function e7() {
var r2 = t5.call(this) || this;
return r2.curNumber = "", r2.curCommandType = -1, r2.curCommandRelative = false, r2.canParseCommandOrComma = true, r2.curNumberHasExp = false, r2.curNumberHasExpDigits = false, r2.curNumberHasDecimal = false, r2.curArgs = [], r2;
}
return r$k(e7, t5), e7.prototype.finish = function(t6) {
if (void 0 === t6 && (t6 = []), this.parse(" ", t6), 0 !== this.curArgs.length || !this.canParseCommandOrComma)
throw new SyntaxError("Unterminated command at the path end.");
return t6;
}, e7.prototype.parse = function(t6, r2) {
var e8 = this;
void 0 === r2 && (r2 = []);
for (var i2 = function(t7) {
r2.push(t7), e8.curArgs.length = 0, e8.canParseCommandOrComma = true;
}, a2 = 0; a2 < t6.length; a2++) {
var n2 = t6[a2], o2 = !(this.curCommandType !== _23.ARC || 3 !== this.curArgs.length && 4 !== this.curArgs.length || 1 !== this.curNumber.length || "0" !== this.curNumber && "1" !== this.curNumber), s2 = v(n2) && ("0" === this.curNumber && "0" === n2 || o2);
if (!v(n2) || s2)
if ("e" !== n2 && "E" !== n2)
if ("-" !== n2 && "+" !== n2 || !this.curNumberHasExp || this.curNumberHasExpDigits)
if ("." !== n2 || this.curNumberHasExp || this.curNumberHasDecimal || o2) {
if (this.curNumber && -1 !== this.curCommandType) {
var u2 = Number(this.curNumber);
if (isNaN(u2))
throw new SyntaxError("Invalid number ending at " + a2);
if (this.curCommandType === _23.ARC) {
if (0 === this.curArgs.length || 1 === this.curArgs.length) {
if (0 > u2)
throw new SyntaxError('Expected positive number, got "' + u2 + '" at index "' + a2 + '"');
} else if ((3 === this.curArgs.length || 4 === this.curArgs.length) && "0" !== this.curNumber && "1" !== this.curNumber)
throw new SyntaxError('Expected a flag, got "' + this.curNumber + '" at index "' + a2 + '"');
}
this.curArgs.push(u2), this.curArgs.length === N[this.curCommandType] && (_23.HORIZ_LINE_TO === this.curCommandType ? i2({ type: _23.HORIZ_LINE_TO, relative: this.curCommandRelative, x: u2 }) : _23.VERT_LINE_TO === this.curCommandType ? i2({ type: _23.VERT_LINE_TO, relative: this.curCommandRelative, y: u2 }) : this.curCommandType === _23.MOVE_TO || this.curCommandType === _23.LINE_TO || this.curCommandType === _23.SMOOTH_QUAD_TO ? (i2({ type: this.curCommandType, relative: this.curCommandRelative, x: this.curArgs[0], y: this.curArgs[1] }), _23.MOVE_TO === this.curCommandType && (this.curCommandType = _23.LINE_TO)) : this.curCommandType === _23.CURVE_TO ? i2({ type: _23.CURVE_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x2: this.curArgs[2], y2: this.curArgs[3], x: this.curArgs[4], y: this.curArgs[5] }) : this.curCommandType === _23.SMOOTH_CURVE_TO ? i2({ type: _23.SMOOTH_CURVE_TO, relative: this.curCommandRelative, x2: this.curArgs[0], y2: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === _23.QUAD_TO ? i2({ type: _23.QUAD_TO, relative: this.curCommandRelative, x1: this.curArgs[0], y1: this.curArgs[1], x: this.curArgs[2], y: this.curArgs[3] }) : this.curCommandType === _23.ARC && i2({ type: _23.ARC, relative: this.curCommandRelative, rX: this.curArgs[0], rY: this.curArgs[1], xRot: this.curArgs[2], lArcFlag: this.curArgs[3], sweepFlag: this.curArgs[4], x: this.curArgs[5], y: this.curArgs[6] })), this.curNumber = "", this.curNumberHasExpDigits = false, this.curNumberHasExp = false, this.curNumberHasDecimal = false, this.canParseCommandOrComma = true;
}
if (!T(n2))
if ("," === n2 && this.canParseCommandOrComma)
this.canParseCommandOrComma = false;
else if ("+" !== n2 && "-" !== n2 && "." !== n2)
if (s2)
this.curNumber = n2, this.curNumberHasDecimal = false;
else {
if (0 !== this.curArgs.length)
throw new SyntaxError("Unterminated command at index " + a2 + ".");
if (!this.canParseCommandOrComma)
throw new SyntaxError('Unexpected character "' + n2 + '" at index ' + a2 + ". Command cannot follow comma");
if (this.canParseCommandOrComma = false, "z" !== n2 && "Z" !== n2)
if ("h" === n2 || "H" === n2)
this.curCommandType = _23.HORIZ_LINE_TO, this.curCommandRelative = "h" === n2;
else if ("v" === n2 || "V" === n2)
this.curCommandType = _23.VERT_LINE_TO, this.curCommandRelative = "v" === n2;
else if ("m" === n2 || "M" === n2)
this.curCommandType = _23.MOVE_TO, this.curCommandRelative = "m" === n2;
else if ("l" === n2 || "L" === n2)
this.curCommandType = _23.LINE_TO, this.curCommandRelative = "l" === n2;
else if ("c" === n2 || "C" === n2)
this.curCommandType = _23.CURVE_TO, this.curCommandRelative = "c" === n2;
else if ("s" === n2 || "S" === n2)
this.curCommandType = _23.SMOOTH_CURVE_TO, this.curCommandRelative = "s" === n2;
else if ("q" === n2 || "Q" === n2)
this.curCommandType = _23.QUAD_TO, this.curCommandRelative = "q" === n2;
else if ("t" === n2 || "T" === n2)
this.curCommandType = _23.SMOOTH_QUAD_TO, this.curCommandRelative = "t" === n2;
else {
if ("a" !== n2 && "A" !== n2)
throw new SyntaxError('Unexpected character "' + n2 + '" at index ' + a2 + ".");
this.curCommandType = _23.ARC, this.curCommandRelative = "a" === n2;
}
else
r2.push({ type: _23.CLOSE_PATH }), this.canParseCommandOrComma = true, this.curCommandType = -1;
}
else
this.curNumber = n2, this.curNumberHasDecimal = "." === n2;
} else
this.curNumber += n2, this.curNumberHasDecimal = true;
else
this.curNumber += n2;
else
this.curNumber += n2, this.curNumberHasExp = true;
else
this.curNumber += n2, this.curNumberHasExpDigits = this.curNumberHasExp;
}
return r2;
}, e7.prototype.transform = function(t6) {
return Object.create(this, { parse: { value: function(r2, e8) {
void 0 === e8 && (e8 = []);
for (var i2 = 0, a2 = Object.getPrototypeOf(this).parse.call(this, r2); i2 < a2.length; i2++) {
var n2 = a2[i2], o2 = t6(n2);
Array.isArray(o2) ? e8.push.apply(e8, o2) : e8.push(o2);
}
return e8;
} } });
}, e7;
}(l), _23 = function(t5) {
function i2(r2) {
var e7 = t5.call(this) || this;
return e7.commands = "string" == typeof r2 ? i2.parse(r2) : r2, e7;
}
return r$k(i2, t5), i2.prototype.encode = function() {
return i2.encode(this.commands);
}, i2.prototype.getBounds = function() {
var t6 = u$5.CALCULATE_BOUNDS();
return this.transform(t6), t6;
}, i2.prototype.transform = function(t6) {
for (var r2 = [], e7 = 0, i3 = this.commands; e7 < i3.length; e7++) {
var a2 = t6(i3[e7]);
Array.isArray(a2) ? r2.push.apply(r2, a2) : r2.push(a2);
}
return this.commands = r2, this;
}, i2.encode = function(t6) {
return e$k(t6);
}, i2.parse = function(t6) {
var r2 = new f(), e7 = [];
return r2.parse(t6, e7), r2.finish(e7), e7;
}, i2.CLOSE_PATH = 1, i2.MOVE_TO = 2, i2.HORIZ_LINE_TO = 4, i2.VERT_LINE_TO = 8, i2.LINE_TO = 16, i2.CURVE_TO = 32, i2.SMOOTH_CURVE_TO = 64, i2.QUAD_TO = 128, i2.SMOOTH_QUAD_TO = 256, i2.ARC = 512, i2.LINE_COMMANDS = i2.LINE_TO | i2.HORIZ_LINE_TO | i2.VERT_LINE_TO, i2.DRAWING_COMMANDS = i2.HORIZ_LINE_TO | i2.VERT_LINE_TO | i2.LINE_TO | i2.CURVE_TO | i2.SMOOTH_CURVE_TO | i2.QUAD_TO | i2.SMOOTH_QUAD_TO | i2.ARC, i2;
}(l), N = ((O = {})[_23.MOVE_TO] = 2, O[_23.LINE_TO] = 2, O[_23.HORIZ_LINE_TO] = 1, O[_23.VERT_LINE_TO] = 1, O[_23.CLOSE_PATH] = 0, O[_23.QUAD_TO] = 4, O[_23.SMOOTH_QUAD_TO] = 2, O[_23.CURVE_TO] = 6, O[_23.SMOOTH_CURVE_TO] = 4, O[_23.ARC] = 7, O);
var call = functionCall;
var hasOwn2 = hasOwnProperty_1;
var isPrototypeOf = objectIsPrototypeOf;
var regExpFlags = regexpFlags$1;
var RegExpPrototype$1 = RegExp.prototype;
var regexpGetFlags = function(R2) {
var flags = R2.flags;
return flags === void 0 && !("flags" in RegExpPrototype$1) && !hasOwn2(R2, "flags") && isPrototypeOf(RegExpPrototype$1, R2) ? call(regExpFlags, R2) : flags;
};
var PROPER_FUNCTION_NAME = functionName.PROPER;
var defineBuiltIn = defineBuiltIn$7;
var anObject = anObject$g;
var $toString = toString$9;
var fails = fails$l;
var getRegExpFlags = regexpGetFlags;
var TO_STRING = "toString";
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function() {
return nativeToString.call({ source: "a", flags: "b" }) != "/a/b";
});
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
if (NOT_GENERIC || INCORRECT_NAME) {
defineBuiltIn(RegExp.prototype, TO_STRING, function toString4() {
var R2 = anObject(this);
var pattern = $toString(R2.source);
var flags = $toString(getRegExpFlags(R2));
return "/" + pattern + "/" + flags;
}, { unsafe: true });
}
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function(obj2) {
return typeof obj2;
};
} else {
_typeof = function(obj2) {
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
};
}
return _typeof(obj);
}
function _classCallCheck(instance2, Constructor) {
if (!(instance2 instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var mulTable = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259];
var shgTable = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
function getImageDataFromCanvas(canvas, topX, topY, width2, height2) {
if (typeof canvas === "string") {
canvas = document.getElementById(canvas);
}
if (!canvas || _typeof(canvas) !== "object" || !("getContext" in canvas)) {
throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");
}
var context2 = canvas.getContext("2d");
try {
return context2.getImageData(topX, topY, width2, height2);
} catch (e7) {
throw new Error("unable to access image data: " + e7);
}
}
function processCanvasRGBA(canvas, topX, topY, width2, height2, radius2) {
if (isNaN(radius2) || radius2 < 1) {
return;
}
radius2 |= 0;
var imageData = getImageDataFromCanvas(canvas, topX, topY, width2, height2);
imageData = processImageDataRGBA(imageData, topX, topY, width2, height2, radius2);
canvas.getContext("2d").putImageData(imageData, topX, topY);
}
function processImageDataRGBA(imageData, topX, topY, width2, height2, radius2) {
var pixels = imageData.data;
var div2 = 2 * radius2 + 1;
var widthMinus1 = width2 - 1;
var heightMinus1 = height2 - 1;
var radiusPlus1 = radius2 + 1;
var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
var stackStart = new BlurStack();
var stack = stackStart;
var stackEnd;
for (var i2 = 1; i2 < div2; i2++) {
stack = stack.next = new BlurStack();
if (i2 === radiusPlus1) {
stackEnd = stack;
}
}
stack.next = stackStart;
var stackIn = null, stackOut = null, yw = 0, yi2 = 0;
var mulSum = mulTable[radius2];
var shgSum = shgTable[radius2];
for (var y2 = 0; y2 < height2; y2++) {
stack = stackStart;
var pr2 = pixels[yi2], pg2 = pixels[yi2 + 1], pb2 = pixels[yi2 + 2], pa2 = pixels[yi2 + 3];
for (var _i2 = 0; _i2 < radiusPlus1; _i2++) {
stack.r = pr2;
stack.g = pg2;
stack.b = pb2;
stack.a = pa2;
stack = stack.next;
}
var rInSum = 0, gInSum = 0, bInSum = 0, aInSum = 0, rOutSum = radiusPlus1 * pr2, gOutSum = radiusPlus1 * pg2, bOutSum = radiusPlus1 * pb2, aOutSum = radiusPlus1 * pa2, rSum = sumFactor * pr2, gSum = sumFactor * pg2, bSum = sumFactor * pb2, aSum = sumFactor * pa2;
for (var _i22 = 1; _i22 < radiusPlus1; _i22++) {
var p2 = yi2 + ((widthMinus1 < _i22 ? widthMinus1 : _i22) << 2);
var r2 = pixels[p2], g2 = pixels[p2 + 1], b2 = pixels[p2 + 2], a2 = pixels[p2 + 3];
var rbs = radiusPlus1 - _i22;
rSum += (stack.r = r2) * rbs;
gSum += (stack.g = g2) * rbs;
bSum += (stack.b = b2) * rbs;
aSum += (stack.a = a2) * rbs;
rInSum += r2;
gInSum += g2;
bInSum += b2;
aInSum += a2;
stack = stack.next;
}
stackIn = stackStart;
stackOut = stackEnd;
for (var x2 = 0; x2 < width2; x2++) {
var paInitial = aSum * mulSum >> shgSum;
pixels[yi2 + 3] = paInitial;
if (paInitial !== 0) {
var _a2 = 255 / paInitial;
pixels[yi2] = (rSum * mulSum >> shgSum) * _a2;
pixels[yi2 + 1] = (gSum * mulSum >> shgSum) * _a2;
pixels[yi2 + 2] = (bSum * mulSum >> shgSum) * _a2;
} else {
pixels[yi2] = pixels[yi2 + 1] = pixels[yi2 + 2] = 0;
}
rSum -= rOutSum;
gSum -= gOutSum;
bSum -= bOutSum;
aSum -= aOutSum;
rOutSum -= stackIn.r;
gOutSum -= stackIn.g;
bOutSum -= stackIn.b;
aOutSum -= stackIn.a;
var _p = x2 + radius2 + 1;
_p = yw + (_p < widthMinus1 ? _p : widthMinus1) << 2;
rInSum += stackIn.r = pixels[_p];
gInSum += stackIn.g = pixels[_p + 1];
bInSum += stackIn.b = pixels[_p + 2];
aInSum += stackIn.a = pixels[_p + 3];
rSum += rInSum;
gSum += gInSum;
bSum += bInSum;
aSum += aInSum;
stackIn = stackIn.next;
var _stackOut = stackOut, _r2 = _stackOut.r, _g = _stackOut.g, _b2 = _stackOut.b, _a3 = _stackOut.a;
rOutSum += _r2;
gOutSum += _g;
bOutSum += _b2;
aOutSum += _a3;
rInSum -= _r2;
gInSum -= _g;
bInSum -= _b2;
aInSum -= _a3;
stackOut = stackOut.next;
yi2 += 4;
}
yw += width2;
}
for (var _x = 0; _x < width2; _x++) {
yi2 = _x << 2;
var _pr = pixels[yi2], _pg = pixels[yi2 + 1], _pb = pixels[yi2 + 2], _pa = pixels[yi2 + 3], _rOutSum = radiusPlus1 * _pr, _gOutSum = radiusPlus1 * _pg, _bOutSum = radiusPlus1 * _pb, _aOutSum = radiusPlus1 * _pa, _rSum = sumFactor * _pr, _gSum = sumFactor * _pg, _bSum = sumFactor * _pb, _aSum = sumFactor * _pa;
stack = stackStart;
for (var _i3 = 0; _i3 < radiusPlus1; _i3++) {
stack.r = _pr;
stack.g = _pg;
stack.b = _pb;
stack.a = _pa;
stack = stack.next;
}
var yp = width2;
var _gInSum = 0, _bInSum = 0, _aInSum = 0, _rInSum = 0;
for (var _i4 = 1; _i4 <= radius2; _i4++) {
yi2 = yp + _x << 2;
var _rbs = radiusPlus1 - _i4;
_rSum += (stack.r = _pr = pixels[yi2]) * _rbs;
_gSum += (stack.g = _pg = pixels[yi2 + 1]) * _rbs;
_bSum += (stack.b = _pb = pixels[yi2 + 2]) * _rbs;
_aSum += (stack.a = _pa = pixels[yi2 + 3]) * _rbs;
_rInSum += _pr;
_gInSum += _pg;
_bInSum += _pb;
_aInSum += _pa;
stack = stack.next;
if (_i4 < heightMinus1) {
yp += width2;
}
}
yi2 = _x;
stackIn = stackStart;
stackOut = stackEnd;
for (var _y = 0; _y < height2; _y++) {
var _p2 = yi2 << 2;
pixels[_p2 + 3] = _pa = _aSum * mulSum >> shgSum;
if (_pa > 0) {
_pa = 255 / _pa;
pixels[_p2] = (_rSum * mulSum >> shgSum) * _pa;
pixels[_p2 + 1] = (_gSum * mulSum >> shgSum) * _pa;
pixels[_p2 + 2] = (_bSum * mulSum >> shgSum) * _pa;
} else {
pixels[_p2] = pixels[_p2 + 1] = pixels[_p2 + 2] = 0;
}
_rSum -= _rOutSum;
_gSum -= _gOutSum;
_bSum -= _bOutSum;
_aSum -= _aOutSum;
_rOutSum -= stackIn.r;
_gOutSum -= stackIn.g;
_bOutSum -= stackIn.b;
_aOutSum -= stackIn.a;
_p2 = _x + ((_p2 = _y + radiusPlus1) < heightMinus1 ? _p2 : heightMinus1) * width2 << 2;
_rSum += _rInSum += stackIn.r = pixels[_p2];
_gSum += _gInSum += stackIn.g = pixels[_p2 + 1];
_bSum += _bInSum += stackIn.b = pixels[_p2 + 2];
_aSum += _aInSum += stackIn.a = pixels[_p2 + 3];
stackIn = stackIn.next;
_rOutSum += _pr = stackOut.r;
_gOutSum += _pg = stackOut.g;
_bOutSum += _pb = stackOut.b;
_aOutSum += _pa = stackOut.a;
_rInSum -= _pr;
_gInSum -= _pg;
_bInSum -= _pb;
_aInSum -= _pa;
stackOut = stackOut.next;
yi2 += width2;
}
}
return imageData;
}
var BlurStack = (
/**
* Set properties.
*/
function BlurStack2() {
_classCallCheck(this, BlurStack2);
this.r = 0;
this.g = 0;
this.b = 0;
this.a = 0;
this.next = null;
}
);
function offscreen() {
var {
DOMParser: DOMParserFallback
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var preset = {
window: null,
ignoreAnimation: true,
ignoreMouse: true,
DOMParser: DOMParserFallback,
createCanvas(width2, height2) {
return new OffscreenCanvas(width2, height2);
},
createImage(url2) {
return _asyncToGenerator(function* () {
var response = yield fetch(url2);
var blob = yield response.blob();
var img = yield createImageBitmap(blob);
return img;
})();
}
};
if (typeof DOMParser !== "undefined" || typeof DOMParserFallback === "undefined") {
Reflect.deleteProperty(preset, "DOMParser");
}
return preset;
}
function node(_ref3) {
var {
DOMParser: DOMParser2,
canvas,
fetch: fetch2
} = _ref3;
return {
window: null,
ignoreAnimation: true,
ignoreMouse: true,
DOMParser: DOMParser2,
fetch: fetch2,
createCanvas: canvas.createCanvas,
createImage: canvas.loadImage
};
}
var index = /* @__PURE__ */ Object.freeze({
__proto__: null,
offscreen,
node
});
function compressSpaces(str) {
return str.replace(/(?!\u3000)\s+/gm, " ");
}
function trimLeft(str) {
return str.replace(/^[\n \t]+/, "");
}
function trimRight(str) {
return str.replace(/[\n \t]+$/, "");
}
function toNumbers(str) {
var matches = (str || "").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
return matches.map(parseFloat);
}
var allUppercase = /^[A-Z-]+$/;
function normalizeAttributeName(name) {
if (allUppercase.test(name)) {
return name.toLowerCase();
}
return name;
}
function parseExternalUrl(url2) {
var urlMatch = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(url2) || [];
return urlMatch[2] || urlMatch[3] || urlMatch[4];
}
function normalizeColor(color2) {
if (!color2.startsWith("rgb")) {
return color2;
}
var rgbParts = 3;
var normalizedColor = color2.replace(/\d+(\.\d+)?/g, (num, isFloat) => rgbParts-- && isFloat ? String(Math.round(parseFloat(num))) : num);
return normalizedColor;
}
var attributeRegex = /(\[[^\]]+\])/g;
var idRegex = /(#[^\s+>~.[:]+)/g;
var classRegex = /(\.[^\s+>~.[:]+)/g;
var pseudoElementRegex = /(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi;
var pseudoClassWithBracketsRegex = /(:[\w-]+\([^)]*\))/gi;
var pseudoClassRegex = /(:[^\s+>~.[:]+)/g;
var elementRegex = /([^\s+>~.[:]+)/g;
function findSelectorMatch(selector, regex) {
var matches = regex.exec(selector);
if (!matches) {
return [selector, 0];
}
return [selector.replace(regex, " "), matches.length];
}
function getSelectorSpecificity(selector) {
var specificity = [0, 0, 0];
var currentSelector = selector.replace(/:not\(([^)]*)\)/g, " $1 ").replace(/{[\s\S]*/gm, " ");
var delta = 0;
[currentSelector, delta] = findSelectorMatch(currentSelector, attributeRegex);
specificity[1] += delta;
[currentSelector, delta] = findSelectorMatch(currentSelector, idRegex);
specificity[0] += delta;
[currentSelector, delta] = findSelectorMatch(currentSelector, classRegex);
specificity[1] += delta;
[currentSelector, delta] = findSelectorMatch(currentSelector, pseudoElementRegex);
specificity[2] += delta;
[currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassWithBracketsRegex);
specificity[1] += delta;
[currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassRegex);
specificity[1] += delta;
currentSelector = currentSelector.replace(/[*\s+>~]/g, " ").replace(/[#.]/g, " ");
[currentSelector, delta] = findSelectorMatch(currentSelector, elementRegex);
specificity[2] += delta;
return specificity.join("");
}
var PSEUDO_ZERO = 1e-8;
function vectorMagnitude(v2) {
return Math.sqrt(Math.pow(v2[0], 2) + Math.pow(v2[1], 2));
}
function vectorsRatio(u2, v2) {
return (u2[0] * v2[0] + u2[1] * v2[1]) / (vectorMagnitude(u2) * vectorMagnitude(v2));
}
function vectorsAngle(u2, v2) {
return (u2[0] * v2[1] < u2[1] * v2[0] ? -1 : 1) * Math.acos(vectorsRatio(u2, v2));
}
function CB1(t5) {
return t5 * t5 * t5;
}
function CB2(t5) {
return 3 * t5 * t5 * (1 - t5);
}
function CB3(t5) {
return 3 * t5 * (1 - t5) * (1 - t5);
}
function CB4(t5) {
return (1 - t5) * (1 - t5) * (1 - t5);
}
function QB1(t5) {
return t5 * t5;
}
function QB2(t5) {
return 2 * t5 * (1 - t5);
}
function QB3(t5) {
return (1 - t5) * (1 - t5);
}
class Property {
constructor(document2, name, value2) {
this.document = document2;
this.name = name;
this.value = value2;
this.isNormalizedColor = false;
}
static empty(document2) {
return new Property(document2, "EMPTY", "");
}
split() {
var separator = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : " ";
var {
document: document2,
name
} = this;
return compressSpaces(this.getString()).trim().split(separator).map((value2) => new Property(document2, name, value2));
}
hasValue(zeroIsValue) {
var {
value: value2
} = this;
return value2 !== null && value2 !== "" && (zeroIsValue || value2 !== 0) && typeof value2 !== "undefined";
}
isString(regexp) {
var {
value: value2
} = this;
var result = typeof value2 === "string";
if (!result || !regexp) {
return result;
}
return regexp.test(value2);
}
isUrlDefinition() {
return this.isString(/^url\(/);
}
isPixels() {
if (!this.hasValue()) {
return false;
}
var asString2 = this.getString();
switch (true) {
case asString2.endsWith("px"):
case /^[0-9]+$/.test(asString2):
return true;
default:
return false;
}
}
setValue(value2) {
this.value = value2;
return this;
}
getValue(def2) {
if (typeof def2 === "undefined" || this.hasValue()) {
return this.value;
}
return def2;
}
getNumber(def2) {
if (!this.hasValue()) {
if (typeof def2 === "undefined") {
return 0;
}
return parseFloat(def2);
}
var {
value: value2
} = this;
var n2 = parseFloat(value2);
if (this.isString(/%$/)) {
n2 /= 100;
}
return n2;
}
getString(def2) {
if (typeof def2 === "undefined" || this.hasValue()) {
return typeof this.value === "undefined" ? "" : String(this.value);
}
return String(def2);
}
getColor(def2) {
var color2 = this.getString(def2);
if (this.isNormalizedColor) {
return color2;
}
this.isNormalizedColor = true;
color2 = normalizeColor(color2);
this.value = color2;
return color2;
}
getDpi() {
return 96;
}
getRem() {
return this.document.rootEmSize;
}
getEm() {
return this.document.emSize;
}
getUnits() {
return this.getString().replace(/[0-9.-]/g, "");
}
getPixels(axisOrIsFontSize) {
var processPercent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
if (!this.hasValue()) {
return 0;
}
var [axis, isFontSize] = typeof axisOrIsFontSize === "boolean" ? [void 0, axisOrIsFontSize] : [axisOrIsFontSize];
var {
viewPort
} = this.document.screen;
switch (true) {
case this.isString(/vmin$/):
return this.getNumber() / 100 * Math.min(viewPort.computeSize("x"), viewPort.computeSize("y"));
case this.isString(/vmax$/):
return this.getNumber() / 100 * Math.max(viewPort.computeSize("x"), viewPort.computeSize("y"));
case this.isString(/vw$/):
return this.getNumber() / 100 * viewPort.computeSize("x");
case this.isString(/vh$/):
return this.getNumber() / 100 * viewPort.computeSize("y");
case this.isString(/rem$/):
return this.getNumber() * this.getRem();
case this.isString(/em$/):
return this.getNumber() * this.getEm();
case this.isString(/ex$/):
return this.getNumber() * this.getEm() / 2;
case this.isString(/px$/):
return this.getNumber();
case this.isString(/pt$/):
return this.getNumber() * this.getDpi() * (1 / 72);
case this.isString(/pc$/):
return this.getNumber() * 15;
case this.isString(/cm$/):
return this.getNumber() * this.getDpi() / 2.54;
case this.isString(/mm$/):
return this.getNumber() * this.getDpi() / 25.4;
case this.isString(/in$/):
return this.getNumber() * this.getDpi();
case (this.isString(/%$/) && isFontSize):
return this.getNumber() * this.getEm();
case this.isString(/%$/):
return this.getNumber() * viewPort.computeSize(axis);
default: {
var n2 = this.getNumber();
if (processPercent && n2 < 1) {
return n2 * viewPort.computeSize(axis);
}
return n2;
}
}
}
getMilliseconds() {
if (!this.hasValue()) {
return 0;
}
if (this.isString(/ms$/)) {
return this.getNumber();
}
return this.getNumber() * 1e3;
}
getRadians() {
if (!this.hasValue()) {
return 0;
}
switch (true) {
case this.isString(/deg$/):
return this.getNumber() * (Math.PI / 180);
case this.isString(/grad$/):
return this.getNumber() * (Math.PI / 200);
case this.isString(/rad$/):
return this.getNumber();
default:
return this.getNumber() * (Math.PI / 180);
}
}
getDefinition() {
var asString2 = this.getString();
var name = /#([^)'"]+)/.exec(asString2);
if (name) {
name = name[1];
}
if (!name) {
name = asString2;
}
return this.document.definitions[name];
}
getFillStyleDefinition(element2, opacity2) {
var def2 = this.getDefinition();
if (!def2) {
return null;
}
if (typeof def2.createGradient === "function") {
return def2.createGradient(this.document.ctx, element2, opacity2);
}
if (typeof def2.createPattern === "function") {
if (def2.getHrefAttribute().hasValue()) {
var patternTransform = def2.getAttribute("patternTransform");
def2 = def2.getHrefAttribute().getDefinition();
if (patternTransform.hasValue()) {
def2.getAttribute("patternTransform", true).setValue(patternTransform.value);
}
}
return def2.createPattern(this.document.ctx, element2, opacity2);
}
return null;
}
getTextBaseline() {
if (!this.hasValue()) {
return null;
}
return Property.textBaselineMapping[this.getString()];
}
addOpacity(opacity2) {
var value2 = this.getColor();
var len = value2.length;
var commas = 0;
for (var i2 = 0; i2 < len; i2++) {
if (value2[i2] === ",") {
commas++;
}
if (commas === 3) {
break;
}
}
if (opacity2.hasValue() && this.isString() && commas !== 3) {
var color2 = new RGBColor$1(value2);
if (color2.ok) {
color2.alpha = opacity2.getNumber();
value2 = color2.toRGBA();
}
}
return new Property(this.document, this.name, value2);
}
}
Property.textBaselineMapping = {
"baseline": "alphabetic",
"before-edge": "top",
"text-before-edge": "top",
"middle": "middle",
"central": "middle",
"after-edge": "bottom",
"text-after-edge": "bottom",
"ideographic": "ideographic",
"alphabetic": "alphabetic",
"hanging": "hanging",
"mathematical": "alphabetic"
};
class ViewPort {
constructor() {
this.viewPorts = [];
}
clear() {
this.viewPorts = [];
}
setCurrent(width2, height2) {
this.viewPorts.push({
width: width2,
height: height2
});
}
removeCurrent() {
this.viewPorts.pop();
}
getCurrent() {
var {
viewPorts
} = this;
return viewPorts[viewPorts.length - 1];
}
get width() {
return this.getCurrent().width;
}
get height() {
return this.getCurrent().height;
}
computeSize(d2) {
if (typeof d2 === "number") {
return d2;
}
if (d2 === "x") {
return this.width;
}
if (d2 === "y") {
return this.height;
}
return Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
}
}
class Point {
constructor(x2, y2) {
this.x = x2;
this.y = y2;
}
static parse(point2) {
var defaultValue2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
var [x2 = defaultValue2, y2 = defaultValue2] = toNumbers(point2);
return new Point(x2, y2);
}
static parseScale(scale2) {
var defaultValue2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
var [x2 = defaultValue2, y2 = x2] = toNumbers(scale2);
return new Point(x2, y2);
}
static parsePath(path2) {
var points2 = toNumbers(path2);
var len = points2.length;
var pathPoints = [];
for (var i2 = 0; i2 < len; i2 += 2) {
pathPoints.push(new Point(points2[i2], points2[i2 + 1]));
}
return pathPoints;
}
angleTo(point2) {
return Math.atan2(point2.y - this.y, point2.x - this.x);
}
applyTransform(transform2) {
var {
x: x2,
y: y2
} = this;
var xp = x2 * transform2[0] + y2 * transform2[2] + transform2[4];
var yp = x2 * transform2[1] + y2 * transform2[3] + transform2[5];
this.x = xp;
this.y = yp;
}
}
class Mouse {
constructor(screen2) {
this.screen = screen2;
this.working = false;
this.events = [];
this.eventElements = [];
this.onClick = this.onClick.bind(this);
this.onMouseMove = this.onMouseMove.bind(this);
}
isWorking() {
return this.working;
}
start() {
if (this.working) {
return;
}
var {
screen: screen2,
onClick,
onMouseMove
} = this;
var canvas = screen2.ctx.canvas;
canvas.onclick = onClick;
canvas.onmousemove = onMouseMove;
this.working = true;
}
stop() {
if (!this.working) {
return;
}
var canvas = this.screen.ctx.canvas;
this.working = false;
canvas.onclick = null;
canvas.onmousemove = null;
}
hasEvents() {
return this.working && this.events.length > 0;
}
runEvents() {
if (!this.working) {
return;
}
var {
screen: document2,
events: events2,
eventElements
} = this;
var {
style: style2
} = document2.ctx.canvas;
if (style2) {
style2.cursor = "";
}
events2.forEach((_ref3, i2) => {
var {
run: run2
} = _ref3;
var element2 = eventElements[i2];
while (element2) {
run2(element2);
element2 = element2.parent;
}
});
this.events = [];
this.eventElements = [];
}
checkPath(element2, ctx) {
if (!this.working || !ctx) {
return;
}
var {
events: events2,
eventElements
} = this;
events2.forEach((_ref22, i2) => {
var {
x: x2,
y: y2
} = _ref22;
if (!eventElements[i2] && ctx.isPointInPath && ctx.isPointInPath(x2, y2)) {
eventElements[i2] = element2;
}
});
}
checkBoundingBox(element2, boundingBox) {
if (!this.working || !boundingBox) {
return;
}
var {
events: events2,
eventElements
} = this;
events2.forEach((_ref3, i2) => {
var {
x: x2,
y: y2
} = _ref3;
if (!eventElements[i2] && boundingBox.isPointInBox(x2, y2)) {
eventElements[i2] = element2;
}
});
}
mapXY(x2, y2) {
var {
window: window2,
ctx
} = this.screen;
var point2 = new Point(x2, y2);
var element2 = ctx.canvas;
while (element2) {
point2.x -= element2.offsetLeft;
point2.y -= element2.offsetTop;
element2 = element2.offsetParent;
}
if (window2.scrollX) {
point2.x += window2.scrollX;
}
if (window2.scrollY) {
point2.y += window2.scrollY;
}
return point2;
}
onClick(event2) {
var {
x: x2,
y: y2
} = this.mapXY(event2.clientX, event2.clientY);
this.events.push({
type: "onclick",
x: x2,
y: y2,
run(eventTarget) {
if (eventTarget.onClick) {
eventTarget.onClick();
}
}
});
}
onMouseMove(event2) {
var {
x: x2,
y: y2
} = this.mapXY(event2.clientX, event2.clientY);
this.events.push({
type: "onmousemove",
x: x2,
y: y2,
run(eventTarget) {
if (eventTarget.onMouseMove) {
eventTarget.onMouseMove();
}
}
});
}
}
var defaultWindow = typeof window !== "undefined" ? window : null;
var defaultFetch$1 = typeof fetch !== "undefined" ? fetch.bind(void 0) : null;
class Screen {
constructor(ctx) {
var {
fetch: fetch2 = defaultFetch$1,
window: window2 = defaultWindow
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
this.ctx = ctx;
this.FRAMERATE = 30;
this.MAX_VIRTUAL_PIXELS = 3e4;
this.CLIENT_WIDTH = 800;
this.CLIENT_HEIGHT = 600;
this.viewPort = new ViewPort();
this.mouse = new Mouse(this);
this.animations = [];
this.waits = [];
this.frameDuration = 0;
this.isReadyLock = false;
this.isFirstRender = true;
this.intervalId = null;
this.window = window2;
this.fetch = fetch2;
}
wait(checker) {
this.waits.push(checker);
}
ready() {
if (!this.readyPromise) {
return Promise.resolve();
}
return this.readyPromise;
}
isReady() {
if (this.isReadyLock) {
return true;
}
var isReadyLock = this.waits.every((_24) => _24());
if (isReadyLock) {
this.waits = [];
if (this.resolveReady) {
this.resolveReady();
}
}
this.isReadyLock = isReadyLock;
return isReadyLock;
}
setDefaults(ctx) {
ctx.strokeStyle = "rgba(0,0,0,0)";
ctx.lineCap = "butt";
ctx.lineJoin = "miter";
ctx.miterLimit = 4;
}
setViewBox(_ref3) {
var {
document: document2,
ctx,
aspectRatio,
width: width2,
desiredWidth,
height: height2,
desiredHeight,
minX = 0,
minY = 0,
refX,
refY,
clip: clip2 = false,
clipX = 0,
clipY = 0
} = _ref3;
var cleanAspectRatio = compressSpaces(aspectRatio).replace(/^defer\s/, "");
var [aspectRatioAlign, aspectRatioMeetOrSlice] = cleanAspectRatio.split(" ");
var align = aspectRatioAlign || "xMidYMid";
var meetOrSlice = aspectRatioMeetOrSlice || "meet";
var scaleX = width2 / desiredWidth;
var scaleY2 = height2 / desiredHeight;
var scaleMin = Math.min(scaleX, scaleY2);
var scaleMax = Math.max(scaleX, scaleY2);
var finalDesiredWidth = desiredWidth;
var finalDesiredHeight = desiredHeight;
if (meetOrSlice === "meet") {
finalDesiredWidth *= scaleMin;
finalDesiredHeight *= scaleMin;
}
if (meetOrSlice === "slice") {
finalDesiredWidth *= scaleMax;
finalDesiredHeight *= scaleMax;
}
var refXProp = new Property(document2, "refX", refX);
var refYProp = new Property(document2, "refY", refY);
var hasRefs = refXProp.hasValue() && refYProp.hasValue();
if (hasRefs) {
ctx.translate(-scaleMin * refXProp.getPixels("x"), -scaleMin * refYProp.getPixels("y"));
}
if (clip2) {
var scaledClipX = scaleMin * clipX;
var scaledClipY = scaleMin * clipY;
ctx.beginPath();
ctx.moveTo(scaledClipX, scaledClipY);
ctx.lineTo(width2, scaledClipY);
ctx.lineTo(width2, height2);
ctx.lineTo(scaledClipX, height2);
ctx.closePath();
ctx.clip();
}
if (!hasRefs) {
var isMeetMinY = meetOrSlice === "meet" && scaleMin === scaleY2;
var isSliceMaxY = meetOrSlice === "slice" && scaleMax === scaleY2;
var isMeetMinX = meetOrSlice === "meet" && scaleMin === scaleX;
var isSliceMaxX = meetOrSlice === "slice" && scaleMax === scaleX;
if (align.startsWith("xMid") && (isMeetMinY || isSliceMaxY)) {
ctx.translate(width2 / 2 - finalDesiredWidth / 2, 0);
}
if (align.endsWith("YMid") && (isMeetMinX || isSliceMaxX)) {
ctx.translate(0, height2 / 2 - finalDesiredHeight / 2);
}
if (align.startsWith("xMax") && (isMeetMinY || isSliceMaxY)) {
ctx.translate(width2 - finalDesiredWidth, 0);
}
if (align.endsWith("YMax") && (isMeetMinX || isSliceMaxX)) {
ctx.translate(0, height2 - finalDesiredHeight);
}
}
switch (true) {
case align === "none":
ctx.scale(scaleX, scaleY2);
break;
case meetOrSlice === "meet":
ctx.scale(scaleMin, scaleMin);
break;
case meetOrSlice === "slice":
ctx.scale(scaleMax, scaleMax);
break;
}
ctx.translate(-minX, -minY);
}
start(element2) {
var {
enableRedraw = false,
ignoreMouse = false,
ignoreAnimation = false,
ignoreDimensions = false,
ignoreClear = false,
forceRedraw,
scaleWidth,
scaleHeight,
offsetX,
offsetY
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var {
FRAMERATE,
mouse
} = this;
var frameDuration = 1e3 / FRAMERATE;
this.frameDuration = frameDuration;
this.readyPromise = new Promise((resolve3) => {
this.resolveReady = resolve3;
});
if (this.isReady()) {
this.render(element2, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
}
if (!enableRedraw) {
return;
}
var now2 = Date.now();
var then2 = now2;
var delta = 0;
var tick = () => {
now2 = Date.now();
delta = now2 - then2;
if (delta >= frameDuration) {
then2 = now2 - delta % frameDuration;
if (this.shouldUpdate(ignoreAnimation, forceRedraw)) {
this.render(element2, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
mouse.runEvents();
}
}
this.intervalId = requestAnimationFrame$1(tick);
};
if (!ignoreMouse) {
mouse.start();
}
this.intervalId = requestAnimationFrame$1(tick);
}
stop() {
if (this.intervalId) {
requestAnimationFrame$1.cancel(this.intervalId);
this.intervalId = null;
}
this.mouse.stop();
}
shouldUpdate(ignoreAnimation, forceRedraw) {
if (!ignoreAnimation) {
var {
frameDuration
} = this;
var shouldUpdate = this.animations.reduce((shouldUpdate2, animation) => animation.update(frameDuration) || shouldUpdate2, false);
if (shouldUpdate) {
return true;
}
}
if (typeof forceRedraw === "function" && forceRedraw()) {
return true;
}
if (!this.isReadyLock && this.isReady()) {
return true;
}
if (this.mouse.hasEvents()) {
return true;
}
return false;
}
render(element2, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY) {
var {
CLIENT_WIDTH,
CLIENT_HEIGHT,
viewPort,
ctx,
isFirstRender
} = this;
var canvas = ctx.canvas;
viewPort.clear();
if (canvas.width && canvas.height) {
viewPort.setCurrent(canvas.width, canvas.height);
} else {
viewPort.setCurrent(CLIENT_WIDTH, CLIENT_HEIGHT);
}
var widthStyle = element2.getStyle("width");
var heightStyle = element2.getStyle("height");
if (!ignoreDimensions && (isFirstRender || typeof scaleWidth !== "number" && typeof scaleHeight !== "number")) {
if (widthStyle.hasValue()) {
canvas.width = widthStyle.getPixels("x");
if (canvas.style) {
canvas.style.width = "".concat(canvas.width, "px");
}
}
if (heightStyle.hasValue()) {
canvas.height = heightStyle.getPixels("y");
if (canvas.style) {
canvas.style.height = "".concat(canvas.height, "px");
}
}
}
var cWidth = canvas.clientWidth || canvas.width;
var cHeight = canvas.clientHeight || canvas.height;
if (ignoreDimensions && widthStyle.hasValue() && heightStyle.hasValue()) {
cWidth = widthStyle.getPixels("x");
cHeight = heightStyle.getPixels("y");
}
viewPort.setCurrent(cWidth, cHeight);
if (typeof offsetX === "number") {
element2.getAttribute("x", true).setValue(offsetX);
}
if (typeof offsetY === "number") {
element2.getAttribute("y", true).setValue(offsetY);
}
if (typeof scaleWidth === "number" || typeof scaleHeight === "number") {
var viewBox = toNumbers(element2.getAttribute("viewBox").getString());
var xRatio = 0;
var yRatio = 0;
if (typeof scaleWidth === "number") {
var _widthStyle = element2.getStyle("width");
if (_widthStyle.hasValue()) {
xRatio = _widthStyle.getPixels("x") / scaleWidth;
} else if (!isNaN(viewBox[2])) {
xRatio = viewBox[2] / scaleWidth;
}
}
if (typeof scaleHeight === "number") {
var _heightStyle = element2.getStyle("height");
if (_heightStyle.hasValue()) {
yRatio = _heightStyle.getPixels("y") / scaleHeight;
} else if (!isNaN(viewBox[3])) {
yRatio = viewBox[3] / scaleHeight;
}
}
if (!xRatio) {
xRatio = yRatio;
}
if (!yRatio) {
yRatio = xRatio;
}
element2.getAttribute("width", true).setValue(scaleWidth);
element2.getAttribute("height", true).setValue(scaleHeight);
var transformStyle = element2.getStyle("transform", true, true);
transformStyle.setValue("".concat(transformStyle.getString(), " scale(").concat(1 / xRatio, ", ").concat(1 / yRatio, ")"));
}
if (!ignoreClear) {
ctx.clearRect(0, 0, cWidth, cHeight);
}
element2.render(ctx);
if (isFirstRender) {
this.isFirstRender = false;
}
}
}
Screen.defaultWindow = defaultWindow;
Screen.defaultFetch = defaultFetch$1;
var {
defaultFetch
} = Screen;
var DefaultDOMParser = typeof DOMParser !== "undefined" ? DOMParser : null;
class Parser {
constructor() {
var {
fetch: fetch2 = defaultFetch,
DOMParser: DOMParser2 = DefaultDOMParser
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
this.fetch = fetch2;
this.DOMParser = DOMParser2;
}
parse(resource) {
var _this = this;
return _asyncToGenerator(function* () {
if (resource.startsWith("<")) {
return _this.parseFromString(resource);
}
return _this.load(resource);
})();
}
parseFromString(xml2) {
var parser2 = new this.DOMParser();
try {
return this.checkDocument(parser2.parseFromString(xml2, "image/svg+xml"));
} catch (err) {
return this.checkDocument(parser2.parseFromString(xml2, "text/xml"));
}
}
checkDocument(document2) {
var parserError = document2.getElementsByTagName("parsererror")[0];
if (parserError) {
throw new Error(parserError.textContent);
}
return document2;
}
load(url2) {
var _this2 = this;
return _asyncToGenerator(function* () {
var response = yield _this2.fetch(url2);
var xml2 = yield response.text();
return _this2.parseFromString(xml2);
})();
}
}
class Translate {
constructor(_24, point2) {
this.type = "translate";
this.point = null;
this.point = Point.parse(point2);
}
apply(ctx) {
var {
x: x2,
y: y2
} = this.point;
ctx.translate(x2 || 0, y2 || 0);
}
unapply(ctx) {
var {
x: x2,
y: y2
} = this.point;
ctx.translate(-1 * x2 || 0, -1 * y2 || 0);
}
applyToPoint(point2) {
var {
x: x2,
y: y2
} = this.point;
point2.applyTransform([1, 0, 0, 1, x2 || 0, y2 || 0]);
}
}
class Rotate {
constructor(document2, rotate2, transformOrigin2) {
this.type = "rotate";
this.angle = null;
this.originX = null;
this.originY = null;
this.cx = 0;
this.cy = 0;
var numbers2 = toNumbers(rotate2);
this.angle = new Property(document2, "angle", numbers2[0]);
this.originX = transformOrigin2[0];
this.originY = transformOrigin2[1];
this.cx = numbers2[1] || 0;
this.cy = numbers2[2] || 0;
}
apply(ctx) {
var {
cx,
cy,
originX,
originY,
angle: angle2
} = this;
var tx2 = cx + originX.getPixels("x");
var ty = cy + originY.getPixels("y");
ctx.translate(tx2, ty);
ctx.rotate(angle2.getRadians());
ctx.translate(-tx2, -ty);
}
unapply(ctx) {
var {
cx,
cy,
originX,
originY,
angle: angle2
} = this;
var tx2 = cx + originX.getPixels("x");
var ty = cy + originY.getPixels("y");
ctx.translate(tx2, ty);
ctx.rotate(-1 * angle2.getRadians());
ctx.translate(-tx2, -ty);
}
applyToPoint(point2) {
var {
cx,
cy,
angle: angle2
} = this;
var rad = angle2.getRadians();
point2.applyTransform([
1,
0,
0,
1,
cx || 0,
cy || 0
// this.p.y
]);
point2.applyTransform([Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad), 0, 0]);
point2.applyTransform([
1,
0,
0,
1,
-cx || 0,
-cy || 0
// -this.p.y
]);
}
}
class Scale {
constructor(_24, scale2, transformOrigin2) {
this.type = "scale";
this.scale = null;
this.originX = null;
this.originY = null;
var scaleSize = Point.parseScale(scale2);
if (scaleSize.x === 0 || scaleSize.y === 0) {
scaleSize.x = PSEUDO_ZERO;
scaleSize.y = PSEUDO_ZERO;
}
this.scale = scaleSize;
this.originX = transformOrigin2[0];
this.originY = transformOrigin2[1];
}
apply(ctx) {
var {
scale: {
x: x2,
y: y2
},
originX,
originY
} = this;
var tx2 = originX.getPixels("x");
var ty = originY.getPixels("y");
ctx.translate(tx2, ty);
ctx.scale(x2, y2 || x2);
ctx.translate(-tx2, -ty);
}
unapply(ctx) {
var {
scale: {
x: x2,
y: y2
},
originX,
originY
} = this;
var tx2 = originX.getPixels("x");
var ty = originY.getPixels("y");
ctx.translate(tx2, ty);
ctx.scale(1 / x2, 1 / y2 || x2);
ctx.translate(-tx2, -ty);
}
applyToPoint(point2) {
var {
x: x2,
y: y2
} = this.scale;
point2.applyTransform([x2 || 0, 0, 0, y2 || 0, 0, 0]);
}
}
class Matrix {
constructor(_24, matrix2, transformOrigin2) {
this.type = "matrix";
this.matrix = [];
this.originX = null;
this.originY = null;
this.matrix = toNumbers(matrix2);
this.originX = transformOrigin2[0];
this.originY = transformOrigin2[1];
}
apply(ctx) {
var {
originX,
originY,
matrix: matrix2
} = this;
var tx2 = originX.getPixels("x");
var ty = originY.getPixels("y");
ctx.translate(tx2, ty);
ctx.transform(matrix2[0], matrix2[1], matrix2[2], matrix2[3], matrix2[4], matrix2[5]);
ctx.translate(-tx2, -ty);
}
unapply(ctx) {
var {
originX,
originY,
matrix: matrix2
} = this;
var a2 = matrix2[0];
var b2 = matrix2[2];
var c2 = matrix2[4];
var d2 = matrix2[1];
var e7 = matrix2[3];
var f2 = matrix2[5];
var g2 = 0;
var h2 = 0;
var i2 = 1;
var det = 1 / (a2 * (e7 * i2 - f2 * h2) - b2 * (d2 * i2 - f2 * g2) + c2 * (d2 * h2 - e7 * g2));
var tx2 = originX.getPixels("x");
var ty = originY.getPixels("y");
ctx.translate(tx2, ty);
ctx.transform(det * (e7 * i2 - f2 * h2), det * (f2 * g2 - d2 * i2), det * (c2 * h2 - b2 * i2), det * (a2 * i2 - c2 * g2), det * (b2 * f2 - c2 * e7), det * (c2 * d2 - a2 * f2));
ctx.translate(-tx2, -ty);
}
applyToPoint(point2) {
point2.applyTransform(this.matrix);
}
}
class Skew extends Matrix {
constructor(document2, skew, transformOrigin2) {
super(document2, skew, transformOrigin2);
this.type = "skew";
this.angle = null;
this.angle = new Property(document2, "angle", skew);
}
}
class SkewX extends Skew {
constructor(document2, skew, transformOrigin2) {
super(document2, skew, transformOrigin2);
this.type = "skewX";
this.matrix = [1, 0, Math.tan(this.angle.getRadians()), 1, 0, 0];
}
}
class SkewY extends Skew {
constructor(document2, skew, transformOrigin2) {
super(document2, skew, transformOrigin2);
this.type = "skewY";
this.matrix = [1, Math.tan(this.angle.getRadians()), 0, 1, 0, 0];
}
}
function parseTransforms(transform2) {
return compressSpaces(transform2).trim().replace(/\)([a-zA-Z])/g, ") $1").replace(/\)(\s?,\s?)/g, ") ").split(/\s(?=[a-z])/);
}
function parseTransform(transform2) {
var [type2, value2] = transform2.split("(");
return [type2.trim(), value2.trim().replace(")", "")];
}
class Transform {
constructor(document2, transform2, transformOrigin2) {
this.document = document2;
this.transforms = [];
var data2 = parseTransforms(transform2);
data2.forEach((transform3) => {
if (transform3 === "none") {
return;
}
var [type2, value2] = parseTransform(transform3);
var TransformType = Transform.transformTypes[type2];
if (typeof TransformType !== "undefined") {
this.transforms.push(new TransformType(this.document, value2, transformOrigin2));
}
});
}
static fromElement(document2, element2) {
var transformStyle = element2.getStyle("transform", false, true);
var [transformOriginXProperty, transformOriginYProperty = transformOriginXProperty] = element2.getStyle("transform-origin", false, true).split();
var transformOrigin2 = [transformOriginXProperty, transformOriginYProperty];
if (transformStyle.hasValue()) {
return new Transform(document2, transformStyle.getString(), transformOrigin2);
}
return null;
}
apply(ctx) {
var {
transforms: transforms2
} = this;
var len = transforms2.length;
for (var i2 = 0; i2 < len; i2++) {
transforms2[i2].apply(ctx);
}
}
unapply(ctx) {
var {
transforms: transforms2
} = this;
var len = transforms2.length;
for (var i2 = len - 1; i2 >= 0; i2--) {
transforms2[i2].unapply(ctx);
}
}
// TODO: applyToPoint unused ... remove?
applyToPoint(point2) {
var {
transforms: transforms2
} = this;
var len = transforms2.length;
for (var i2 = 0; i2 < len; i2++) {
transforms2[i2].applyToPoint(point2);
}
}
}
Transform.transformTypes = {
translate: Translate,
rotate: Rotate,
scale: Scale,
matrix: Matrix,
skewX: SkewX,
skewY: SkewY
};
let Element$1 = class Element2 {
constructor(document2, node2) {
var captureTextNodes = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
this.document = document2;
this.node = node2;
this.captureTextNodes = captureTextNodes;
this.attributes = {};
this.styles = {};
this.stylesSpecificity = {};
this.animationFrozen = false;
this.animationFrozenValue = "";
this.parent = null;
this.children = [];
if (!node2 || node2.nodeType !== 1) {
return;
}
Array.from(node2.attributes).forEach((attribute) => {
var nodeName = normalizeAttributeName(attribute.nodeName);
this.attributes[nodeName] = new Property(document2, nodeName, attribute.value);
});
this.addStylesFromStyleDefinition();
if (this.getAttribute("style").hasValue()) {
var styles2 = this.getAttribute("style").getString().split(";").map((_24) => _24.trim());
styles2.forEach((style2) => {
if (!style2) {
return;
}
var [name, value2] = style2.split(":").map((_24) => _24.trim());
this.styles[name] = new Property(document2, name, value2);
});
}
var {
definitions
} = document2;
var id = this.getAttribute("id");
if (id.hasValue()) {
if (!definitions[id.getString()]) {
definitions[id.getString()] = this;
}
}
Array.from(node2.childNodes).forEach((childNode) => {
if (childNode.nodeType === 1) {
this.addChild(childNode);
} else if (captureTextNodes && (childNode.nodeType === 3 || childNode.nodeType === 4)) {
var textNode = document2.createTextNode(childNode);
if (textNode.getText().length > 0) {
this.addChild(textNode);
}
}
});
}
getAttribute(name) {
var createIfNotExists = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var attr2 = this.attributes[name];
if (!attr2 && createIfNotExists) {
var _attr = new Property(this.document, name, "");
this.attributes[name] = _attr;
return _attr;
}
return attr2 || Property.empty(this.document);
}
getHrefAttribute() {
for (var key2 in this.attributes) {
if (key2 === "href" || key2.endsWith(":href")) {
return this.attributes[key2];
}
}
return Property.empty(this.document);
}
getStyle(name) {
var createIfNotExists = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var skipAncestors = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
var style2 = this.styles[name];
if (style2) {
return style2;
}
var attr2 = this.getAttribute(name);
if (attr2 !== null && attr2 !== void 0 && attr2.hasValue()) {
this.styles[name] = attr2;
return attr2;
}
if (!skipAncestors) {
var {
parent
} = this;
if (parent) {
var parentStyle = parent.getStyle(name);
if (parentStyle !== null && parentStyle !== void 0 && parentStyle.hasValue()) {
return parentStyle;
}
}
}
if (createIfNotExists) {
var _style = new Property(this.document, name, "");
this.styles[name] = _style;
return _style;
}
return style2 || Property.empty(this.document);
}
render(ctx) {
if (this.getStyle("display").getString() === "none" || this.getStyle("visibility").getString() === "hidden") {
return;
}
ctx.save();
if (this.getStyle("mask").hasValue()) {
var mask = this.getStyle("mask").getDefinition();
if (mask) {
this.applyEffects(ctx);
mask.apply(ctx, this);
}
} else if (this.getStyle("filter").getValue("none") !== "none") {
var filter2 = this.getStyle("filter").getDefinition();
if (filter2) {
this.applyEffects(ctx);
filter2.apply(ctx, this);
}
} else {
this.setContext(ctx);
this.renderChildren(ctx);
this.clearContext(ctx);
}
ctx.restore();
}
setContext(_24) {
}
applyEffects(ctx) {
var transform2 = Transform.fromElement(this.document, this);
if (transform2) {
transform2.apply(ctx);
}
var clipPathStyleProp = this.getStyle("clip-path", false, true);
if (clipPathStyleProp.hasValue()) {
var clip2 = clipPathStyleProp.getDefinition();
if (clip2) {
clip2.apply(ctx);
}
}
}
clearContext(_24) {
}
renderChildren(ctx) {
this.children.forEach((child) => {
child.render(ctx);
});
}
addChild(childNode) {
var child = childNode instanceof Element2 ? childNode : this.document.createElement(childNode);
child.parent = this;
if (!Element2.ignoreChildTypes.includes(child.type)) {
this.children.push(child);
}
}
matchesSelector(selector) {
var _node$getAttribute;
var {
node: node2
} = this;
if (typeof node2.matches === "function") {
return node2.matches(selector);
}
var styleClasses = (_node$getAttribute = node2.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node2, "class");
if (!styleClasses || styleClasses === "") {
return false;
}
return styleClasses.split(" ").some((styleClass) => ".".concat(styleClass) === selector);
}
addStylesFromStyleDefinition() {
var {
styles: styles2,
stylesSpecificity
} = this.document;
for (var selector in styles2) {
if (!selector.startsWith("@") && this.matchesSelector(selector)) {
var style2 = styles2[selector];
var specificity = stylesSpecificity[selector];
if (style2) {
for (var name in style2) {
var existingSpecificity = this.stylesSpecificity[name];
if (typeof existingSpecificity === "undefined") {
existingSpecificity = "000";
}
if (specificity >= existingSpecificity) {
this.styles[name] = style2[name];
this.stylesSpecificity[name] = specificity;
}
}
}
}
}
}
removeStyles(element2, ignoreStyles) {
var toRestore = ignoreStyles.reduce((toRestore2, name) => {
var styleProp = element2.getStyle(name);
if (!styleProp.hasValue()) {
return toRestore2;
}
var value2 = styleProp.getString();
styleProp.setValue("");
return [...toRestore2, [name, value2]];
}, []);
return toRestore;
}
restoreStyles(element2, styles2) {
styles2.forEach((_ref3) => {
var [name, value2] = _ref3;
element2.getStyle(name, true).setValue(value2);
});
}
isFirstChild() {
var _this$parent;
return ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.children.indexOf(this)) === 0;
}
};
Element$1.ignoreChildTypes = ["title"];
class UnknownElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
}
}
function wrapFontFamily(fontFamily2) {
var trimmed = fontFamily2.trim();
return /^('|")/.test(trimmed) ? trimmed : '"'.concat(trimmed, '"');
}
function prepareFontFamily(fontFamily2) {
return typeof process === "undefined" ? fontFamily2 : fontFamily2.trim().split(",").map(wrapFontFamily).join(",");
}
function prepareFontStyle(fontStyle2) {
if (!fontStyle2) {
return "";
}
var targetFontStyle = fontStyle2.trim().toLowerCase();
switch (targetFontStyle) {
case "normal":
case "italic":
case "oblique":
case "inherit":
case "initial":
case "unset":
return targetFontStyle;
default:
if (/^oblique\s+(-|)\d+deg$/.test(targetFontStyle)) {
return targetFontStyle;
}
return "";
}
}
function prepareFontWeight(fontWeight2) {
if (!fontWeight2) {
return "";
}
var targetFontWeight = fontWeight2.trim().toLowerCase();
switch (targetFontWeight) {
case "normal":
case "bold":
case "lighter":
case "bolder":
case "inherit":
case "initial":
case "unset":
return targetFontWeight;
default:
if (/^[\d.]+$/.test(targetFontWeight)) {
return targetFontWeight;
}
return "";
}
}
class Font {
constructor(fontStyle2, fontVariant2, fontWeight2, fontSize2, fontFamily2, inherit) {
var inheritFont = inherit ? typeof inherit === "string" ? Font.parse(inherit) : inherit : {};
this.fontFamily = fontFamily2 || inheritFont.fontFamily;
this.fontSize = fontSize2 || inheritFont.fontSize;
this.fontStyle = fontStyle2 || inheritFont.fontStyle;
this.fontWeight = fontWeight2 || inheritFont.fontWeight;
this.fontVariant = fontVariant2 || inheritFont.fontVariant;
}
static parse() {
var font2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
var inherit = arguments.length > 1 ? arguments[1] : void 0;
var fontStyle2 = "";
var fontVariant2 = "";
var fontWeight2 = "";
var fontSize2 = "";
var fontFamily2 = "";
var parts2 = compressSpaces(font2).trim().split(" ");
var set2 = {
fontSize: false,
fontStyle: false,
fontWeight: false,
fontVariant: false
};
parts2.forEach((part) => {
switch (true) {
case (!set2.fontStyle && Font.styles.includes(part)):
if (part !== "inherit") {
fontStyle2 = part;
}
set2.fontStyle = true;
break;
case (!set2.fontVariant && Font.variants.includes(part)):
if (part !== "inherit") {
fontVariant2 = part;
}
set2.fontStyle = true;
set2.fontVariant = true;
break;
case (!set2.fontWeight && Font.weights.includes(part)):
if (part !== "inherit") {
fontWeight2 = part;
}
set2.fontStyle = true;
set2.fontVariant = true;
set2.fontWeight = true;
break;
case !set2.fontSize:
if (part !== "inherit") {
[fontSize2] = part.split("/");
}
set2.fontStyle = true;
set2.fontVariant = true;
set2.fontWeight = true;
set2.fontSize = true;
break;
default:
if (part !== "inherit") {
fontFamily2 += part;
}
}
});
return new Font(fontStyle2, fontVariant2, fontWeight2, fontSize2, fontFamily2, inherit);
}
toString() {
return [
prepareFontStyle(this.fontStyle),
this.fontVariant,
prepareFontWeight(this.fontWeight),
this.fontSize,
// Wrap fontFamily only on nodejs and only for canvas.ctx
prepareFontFamily(this.fontFamily)
].join(" ").trim();
}
}
Font.styles = "normal|italic|oblique|inherit";
Font.variants = "normal|small-caps|inherit";
Font.weights = "normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";
class BoundingBox {
constructor() {
var x12 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Number.NaN;
var y12 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.NaN;
var x2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Number.NaN;
var y2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Number.NaN;
this.x1 = x12;
this.y1 = y12;
this.x2 = x2;
this.y2 = y2;
this.addPoint(x12, y12);
this.addPoint(x2, y2);
}
get x() {
return this.x1;
}
get y() {
return this.y1;
}
get width() {
return this.x2 - this.x1;
}
get height() {
return this.y2 - this.y1;
}
addPoint(x2, y2) {
if (typeof x2 !== "undefined") {
if (isNaN(this.x1) || isNaN(this.x2)) {
this.x1 = x2;
this.x2 = x2;
}
if (x2 < this.x1) {
this.x1 = x2;
}
if (x2 > this.x2) {
this.x2 = x2;
}
}
if (typeof y2 !== "undefined") {
if (isNaN(this.y1) || isNaN(this.y2)) {
this.y1 = y2;
this.y2 = y2;
}
if (y2 < this.y1) {
this.y1 = y2;
}
if (y2 > this.y2) {
this.y2 = y2;
}
}
}
addX(x2) {
this.addPoint(x2, null);
}
addY(y2) {
this.addPoint(null, y2);
}
addBoundingBox(boundingBox) {
if (!boundingBox) {
return;
}
var {
x1: x12,
y1: y12,
x2,
y2
} = boundingBox;
this.addPoint(x12, y12);
this.addPoint(x2, y2);
}
sumCubic(t5, p02, p1, p2, p3) {
return Math.pow(1 - t5, 3) * p02 + 3 * Math.pow(1 - t5, 2) * t5 * p1 + 3 * (1 - t5) * Math.pow(t5, 2) * p2 + Math.pow(t5, 3) * p3;
}
bezierCurveAdd(forX, p02, p1, p2, p3) {
var b2 = 6 * p02 - 12 * p1 + 6 * p2;
var a2 = -3 * p02 + 9 * p1 - 9 * p2 + 3 * p3;
var c2 = 3 * p1 - 3 * p02;
if (a2 === 0) {
if (b2 === 0) {
return;
}
var t5 = -c2 / b2;
if (0 < t5 && t5 < 1) {
if (forX) {
this.addX(this.sumCubic(t5, p02, p1, p2, p3));
} else {
this.addY(this.sumCubic(t5, p02, p1, p2, p3));
}
}
return;
}
var b2ac = Math.pow(b2, 2) - 4 * c2 * a2;
if (b2ac < 0) {
return;
}
var t12 = (-b2 + Math.sqrt(b2ac)) / (2 * a2);
if (0 < t12 && t12 < 1) {
if (forX) {
this.addX(this.sumCubic(t12, p02, p1, p2, p3));
} else {
this.addY(this.sumCubic(t12, p02, p1, p2, p3));
}
}
var t22 = (-b2 - Math.sqrt(b2ac)) / (2 * a2);
if (0 < t22 && t22 < 1) {
if (forX) {
this.addX(this.sumCubic(t22, p02, p1, p2, p3));
} else {
this.addY(this.sumCubic(t22, p02, p1, p2, p3));
}
}
}
// from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
addBezierCurve(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
this.addPoint(p0x, p0y);
this.addPoint(p3x, p3y);
this.bezierCurveAdd(true, p0x, p1x, p2x, p3x);
this.bezierCurveAdd(false, p0y, p1y, p2y, p3y);
}
addQuadraticCurve(p0x, p0y, p1x, p1y, p2x, p2y) {
var cp1x = p0x + 2 / 3 * (p1x - p0x);
var cp1y = p0y + 2 / 3 * (p1y - p0y);
var cp2x = cp1x + 1 / 3 * (p2x - p0x);
var cp2y = cp1y + 1 / 3 * (p2y - p0y);
this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y);
}
isPointInBox(x2, y2) {
var {
x1: x12,
y1: y12,
x2: x22,
y2: y22
} = this;
return x12 <= x2 && x2 <= x22 && y12 <= y2 && y2 <= y22;
}
}
class PathParser extends _23 {
constructor(path2) {
super(path2.replace(/([+\-.])\s+/gm, "$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g, ""));
this.control = null;
this.start = null;
this.current = null;
this.command = null;
this.commands = this.commands;
this.i = -1;
this.previousCommand = null;
this.points = [];
this.angles = [];
}
reset() {
this.i = -1;
this.command = null;
this.previousCommand = null;
this.start = new Point(0, 0);
this.control = new Point(0, 0);
this.current = new Point(0, 0);
this.points = [];
this.angles = [];
}
isEnd() {
var {
i: i2,
commands
} = this;
return i2 >= commands.length - 1;
}
next() {
var command = this.commands[++this.i];
this.previousCommand = this.command;
this.command = command;
return command;
}
getPoint() {
var xProp = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "x";
var yProp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "y";
var point2 = new Point(this.command[xProp], this.command[yProp]);
return this.makeAbsolute(point2);
}
getAsControlPoint(xProp, yProp) {
var point2 = this.getPoint(xProp, yProp);
this.control = point2;
return point2;
}
getAsCurrentPoint(xProp, yProp) {
var point2 = this.getPoint(xProp, yProp);
this.current = point2;
return point2;
}
getReflectedControlPoint() {
var previousCommand = this.previousCommand.type;
if (previousCommand !== _23.CURVE_TO && previousCommand !== _23.SMOOTH_CURVE_TO && previousCommand !== _23.QUAD_TO && previousCommand !== _23.SMOOTH_QUAD_TO) {
return this.current;
}
var {
current: {
x: cx,
y: cy
},
control: {
x: ox,
y: oy
}
} = this;
var point2 = new Point(2 * cx - ox, 2 * cy - oy);
return point2;
}
makeAbsolute(point2) {
if (this.command.relative) {
var {
x: x2,
y: y2
} = this.current;
point2.x += x2;
point2.y += y2;
}
return point2;
}
addMarker(point2, from2, priorTo) {
var {
points: points2,
angles
} = this;
if (priorTo && angles.length > 0 && !angles[angles.length - 1]) {
angles[angles.length - 1] = points2[points2.length - 1].angleTo(priorTo);
}
this.addMarkerAngle(point2, from2 ? from2.angleTo(point2) : null);
}
addMarkerAngle(point2, angle2) {
this.points.push(point2);
this.angles.push(angle2);
}
getMarkerPoints() {
return this.points;
}
getMarkerAngles() {
var {
angles
} = this;
var len = angles.length;
for (var i2 = 0; i2 < len; i2++) {
if (!angles[i2]) {
for (var j2 = i2 + 1; j2 < len; j2++) {
if (angles[j2]) {
angles[i2] = angles[j2];
break;
}
}
}
}
return angles;
}
}
class RenderedElement extends Element$1 {
constructor() {
super(...arguments);
this.modifiedEmSizeStack = false;
}
calculateOpacity() {
var opacity2 = 1;
var element2 = this;
while (element2) {
var opacityStyle = element2.getStyle("opacity", false, true);
if (opacityStyle.hasValue(true)) {
opacity2 *= opacityStyle.getNumber();
}
element2 = element2.parent;
}
return opacity2;
}
setContext(ctx) {
var fromMeasure = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
if (!fromMeasure) {
var fillStyleProp = this.getStyle("fill");
var fillOpacityStyleProp = this.getStyle("fill-opacity");
var strokeStyleProp = this.getStyle("stroke");
var strokeOpacityProp = this.getStyle("stroke-opacity");
if (fillStyleProp.isUrlDefinition()) {
var fillStyle = fillStyleProp.getFillStyleDefinition(this, fillOpacityStyleProp);
if (fillStyle) {
ctx.fillStyle = fillStyle;
}
} else if (fillStyleProp.hasValue()) {
if (fillStyleProp.getString() === "currentColor") {
fillStyleProp.setValue(this.getStyle("color").getColor());
}
var _fillStyle = fillStyleProp.getColor();
if (_fillStyle !== "inherit") {
ctx.fillStyle = _fillStyle === "none" ? "rgba(0,0,0,0)" : _fillStyle;
}
}
if (fillOpacityStyleProp.hasValue()) {
var _fillStyle2 = new Property(this.document, "fill", ctx.fillStyle).addOpacity(fillOpacityStyleProp).getColor();
ctx.fillStyle = _fillStyle2;
}
if (strokeStyleProp.isUrlDefinition()) {
var strokeStyle = strokeStyleProp.getFillStyleDefinition(this, strokeOpacityProp);
if (strokeStyle) {
ctx.strokeStyle = strokeStyle;
}
} else if (strokeStyleProp.hasValue()) {
if (strokeStyleProp.getString() === "currentColor") {
strokeStyleProp.setValue(this.getStyle("color").getColor());
}
var _strokeStyle = strokeStyleProp.getString();
if (_strokeStyle !== "inherit") {
ctx.strokeStyle = _strokeStyle === "none" ? "rgba(0,0,0,0)" : _strokeStyle;
}
}
if (strokeOpacityProp.hasValue()) {
var _strokeStyle2 = new Property(this.document, "stroke", ctx.strokeStyle).addOpacity(strokeOpacityProp).getString();
ctx.strokeStyle = _strokeStyle2;
}
var strokeWidthStyleProp = this.getStyle("stroke-width");
if (strokeWidthStyleProp.hasValue()) {
var newLineWidth = strokeWidthStyleProp.getPixels();
ctx.lineWidth = !newLineWidth ? PSEUDO_ZERO : newLineWidth;
}
var strokeLinecapStyleProp = this.getStyle("stroke-linecap");
var strokeLinejoinStyleProp = this.getStyle("stroke-linejoin");
var strokeMiterlimitProp = this.getStyle("stroke-miterlimit");
var strokeDasharrayStyleProp = this.getStyle("stroke-dasharray");
var strokeDashoffsetProp = this.getStyle("stroke-dashoffset");
if (strokeLinecapStyleProp.hasValue()) {
ctx.lineCap = strokeLinecapStyleProp.getString();
}
if (strokeLinejoinStyleProp.hasValue()) {
ctx.lineJoin = strokeLinejoinStyleProp.getString();
}
if (strokeMiterlimitProp.hasValue()) {
ctx.miterLimit = strokeMiterlimitProp.getNumber();
}
if (strokeDasharrayStyleProp.hasValue() && strokeDasharrayStyleProp.getString() !== "none") {
var gaps = toNumbers(strokeDasharrayStyleProp.getString());
if (typeof ctx.setLineDash !== "undefined") {
ctx.setLineDash(gaps);
} else if (typeof ctx.webkitLineDash !== "undefined") {
ctx.webkitLineDash = gaps;
} else if (typeof ctx.mozDash !== "undefined" && !(gaps.length === 1 && gaps[0] === 0)) {
ctx.mozDash = gaps;
}
var offset2 = strokeDashoffsetProp.getPixels();
if (typeof ctx.lineDashOffset !== "undefined") {
ctx.lineDashOffset = offset2;
} else if (typeof ctx.webkitLineDashOffset !== "undefined") {
ctx.webkitLineDashOffset = offset2;
} else if (typeof ctx.mozDashOffset !== "undefined") {
ctx.mozDashOffset = offset2;
}
}
}
this.modifiedEmSizeStack = false;
if (typeof ctx.font !== "undefined") {
var fontStyleProp = this.getStyle("font");
var fontStyleStyleProp = this.getStyle("font-style");
var fontVariantStyleProp = this.getStyle("font-variant");
var fontWeightStyleProp = this.getStyle("font-weight");
var fontSizeStyleProp = this.getStyle("font-size");
var fontFamilyStyleProp = this.getStyle("font-family");
var font2 = new Font(fontStyleStyleProp.getString(), fontVariantStyleProp.getString(), fontWeightStyleProp.getString(), fontSizeStyleProp.hasValue() ? "".concat(fontSizeStyleProp.getPixels(true), "px") : "", fontFamilyStyleProp.getString(), Font.parse(fontStyleProp.getString(), ctx.font));
fontStyleStyleProp.setValue(font2.fontStyle);
fontVariantStyleProp.setValue(font2.fontVariant);
fontWeightStyleProp.setValue(font2.fontWeight);
fontSizeStyleProp.setValue(font2.fontSize);
fontFamilyStyleProp.setValue(font2.fontFamily);
ctx.font = font2.toString();
if (fontSizeStyleProp.isPixels()) {
this.document.emSize = fontSizeStyleProp.getPixels();
this.modifiedEmSizeStack = true;
}
}
if (!fromMeasure) {
this.applyEffects(ctx);
ctx.globalAlpha = this.calculateOpacity();
}
}
clearContext(ctx) {
super.clearContext(ctx);
if (this.modifiedEmSizeStack) {
this.document.popEmSize();
}
}
}
class PathElement extends RenderedElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "path";
this.pathParser = null;
this.pathParser = new PathParser(this.getAttribute("d").getString());
}
path(ctx) {
var {
pathParser
} = this;
var boundingBox = new BoundingBox();
pathParser.reset();
if (ctx) {
ctx.beginPath();
}
while (!pathParser.isEnd()) {
switch (pathParser.next().type) {
case PathParser.MOVE_TO:
this.pathM(ctx, boundingBox);
break;
case PathParser.LINE_TO:
this.pathL(ctx, boundingBox);
break;
case PathParser.HORIZ_LINE_TO:
this.pathH(ctx, boundingBox);
break;
case PathParser.VERT_LINE_TO:
this.pathV(ctx, boundingBox);
break;
case PathParser.CURVE_TO:
this.pathC(ctx, boundingBox);
break;
case PathParser.SMOOTH_CURVE_TO:
this.pathS(ctx, boundingBox);
break;
case PathParser.QUAD_TO:
this.pathQ(ctx, boundingBox);
break;
case PathParser.SMOOTH_QUAD_TO:
this.pathT(ctx, boundingBox);
break;
case PathParser.ARC:
this.pathA(ctx, boundingBox);
break;
case PathParser.CLOSE_PATH:
this.pathZ(ctx, boundingBox);
break;
}
}
return boundingBox;
}
getBoundingBox(_24) {
return this.path();
}
getMarkers() {
var {
pathParser
} = this;
var points2 = pathParser.getMarkerPoints();
var angles = pathParser.getMarkerAngles();
var markers = points2.map((point2, i2) => [point2, angles[i2]]);
return markers;
}
renderChildren(ctx) {
this.path(ctx);
this.document.screen.mouse.checkPath(this, ctx);
var fillRuleStyleProp = this.getStyle("fill-rule");
if (ctx.fillStyle !== "") {
if (fillRuleStyleProp.getString("inherit") !== "inherit") {
ctx.fill(fillRuleStyleProp.getString());
} else {
ctx.fill();
}
}
if (ctx.strokeStyle !== "") {
if (this.getAttribute("vector-effect").getString() === "non-scaling-stroke") {
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.stroke();
ctx.restore();
} else {
ctx.stroke();
}
}
var markers = this.getMarkers();
if (markers) {
var markersLastIndex = markers.length - 1;
var markerStartStyleProp = this.getStyle("marker-start");
var markerMidStyleProp = this.getStyle("marker-mid");
var markerEndStyleProp = this.getStyle("marker-end");
if (markerStartStyleProp.isUrlDefinition()) {
var marker = markerStartStyleProp.getDefinition();
var [point2, angle2] = markers[0];
marker.render(ctx, point2, angle2);
}
if (markerMidStyleProp.isUrlDefinition()) {
var _marker = markerMidStyleProp.getDefinition();
for (var i2 = 1; i2 < markersLastIndex; i2++) {
var [_point, _angle] = markers[i2];
_marker.render(ctx, _point, _angle);
}
}
if (markerEndStyleProp.isUrlDefinition()) {
var _marker2 = markerEndStyleProp.getDefinition();
var [_point2, _angle2] = markers[markersLastIndex];
_marker2.render(ctx, _point2, _angle2);
}
}
}
static pathM(pathParser) {
var point2 = pathParser.getAsCurrentPoint();
pathParser.start = pathParser.current;
return {
point: point2
};
}
pathM(ctx, boundingBox) {
var {
pathParser
} = this;
var {
point: point2
} = PathElement.pathM(pathParser);
var {
x: x2,
y: y2
} = point2;
pathParser.addMarker(point2);
boundingBox.addPoint(x2, y2);
if (ctx) {
ctx.moveTo(x2, y2);
}
}
static pathL(pathParser) {
var {
current
} = pathParser;
var point2 = pathParser.getAsCurrentPoint();
return {
current,
point: point2
};
}
pathL(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
point: point2
} = PathElement.pathL(pathParser);
var {
x: x2,
y: y2
} = point2;
pathParser.addMarker(point2, current);
boundingBox.addPoint(x2, y2);
if (ctx) {
ctx.lineTo(x2, y2);
}
}
static pathH(pathParser) {
var {
current,
command
} = pathParser;
var point2 = new Point((command.relative ? current.x : 0) + command.x, current.y);
pathParser.current = point2;
return {
current,
point: point2
};
}
pathH(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
point: point2
} = PathElement.pathH(pathParser);
var {
x: x2,
y: y2
} = point2;
pathParser.addMarker(point2, current);
boundingBox.addPoint(x2, y2);
if (ctx) {
ctx.lineTo(x2, y2);
}
}
static pathV(pathParser) {
var {
current,
command
} = pathParser;
var point2 = new Point(current.x, (command.relative ? current.y : 0) + command.y);
pathParser.current = point2;
return {
current,
point: point2
};
}
pathV(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
point: point2
} = PathElement.pathV(pathParser);
var {
x: x2,
y: y2
} = point2;
pathParser.addMarker(point2, current);
boundingBox.addPoint(x2, y2);
if (ctx) {
ctx.lineTo(x2, y2);
}
}
static pathC(pathParser) {
var {
current
} = pathParser;
var point2 = pathParser.getPoint("x1", "y1");
var controlPoint = pathParser.getAsControlPoint("x2", "y2");
var currentPoint = pathParser.getAsCurrentPoint();
return {
current,
point: point2,
controlPoint,
currentPoint
};
}
pathC(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
point: point2,
controlPoint,
currentPoint
} = PathElement.pathC(pathParser);
pathParser.addMarker(currentPoint, controlPoint, point2);
boundingBox.addBezierCurve(current.x, current.y, point2.x, point2.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.bezierCurveTo(point2.x, point2.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
static pathS(pathParser) {
var {
current
} = pathParser;
var point2 = pathParser.getReflectedControlPoint();
var controlPoint = pathParser.getAsControlPoint("x2", "y2");
var currentPoint = pathParser.getAsCurrentPoint();
return {
current,
point: point2,
controlPoint,
currentPoint
};
}
pathS(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
point: point2,
controlPoint,
currentPoint
} = PathElement.pathS(pathParser);
pathParser.addMarker(currentPoint, controlPoint, point2);
boundingBox.addBezierCurve(current.x, current.y, point2.x, point2.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.bezierCurveTo(point2.x, point2.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
static pathQ(pathParser) {
var {
current
} = pathParser;
var controlPoint = pathParser.getAsControlPoint("x1", "y1");
var currentPoint = pathParser.getAsCurrentPoint();
return {
current,
controlPoint,
currentPoint
};
}
pathQ(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
controlPoint,
currentPoint
} = PathElement.pathQ(pathParser);
pathParser.addMarker(currentPoint, controlPoint, controlPoint);
boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
static pathT(pathParser) {
var {
current
} = pathParser;
var controlPoint = pathParser.getReflectedControlPoint();
pathParser.control = controlPoint;
var currentPoint = pathParser.getAsCurrentPoint();
return {
current,
controlPoint,
currentPoint
};
}
pathT(ctx, boundingBox) {
var {
pathParser
} = this;
var {
current,
controlPoint,
currentPoint
} = PathElement.pathT(pathParser);
pathParser.addMarker(currentPoint, controlPoint, controlPoint);
boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
if (ctx) {
ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
}
static pathA(pathParser) {
var {
current,
command
} = pathParser;
var {
rX,
rY,
xRot,
lArcFlag,
sweepFlag
} = command;
var xAxisRotation = xRot * (Math.PI / 180);
var currentPoint = pathParser.getAsCurrentPoint();
var currp = new Point(Math.cos(xAxisRotation) * (current.x - currentPoint.x) / 2 + Math.sin(xAxisRotation) * (current.y - currentPoint.y) / 2, -Math.sin(xAxisRotation) * (current.x - currentPoint.x) / 2 + Math.cos(xAxisRotation) * (current.y - currentPoint.y) / 2);
var l2 = Math.pow(currp.x, 2) / Math.pow(rX, 2) + Math.pow(currp.y, 2) / Math.pow(rY, 2);
if (l2 > 1) {
rX *= Math.sqrt(l2);
rY *= Math.sqrt(l2);
}
var s2 = (lArcFlag === sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rX, 2) * Math.pow(rY, 2) - Math.pow(rX, 2) * Math.pow(currp.y, 2) - Math.pow(rY, 2) * Math.pow(currp.x, 2)) / (Math.pow(rX, 2) * Math.pow(currp.y, 2) + Math.pow(rY, 2) * Math.pow(currp.x, 2)));
if (isNaN(s2)) {
s2 = 0;
}
var cpp = new Point(s2 * rX * currp.y / rY, s2 * -rY * currp.x / rX);
var centp = new Point((current.x + currentPoint.x) / 2 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (current.y + currentPoint.y) / 2 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y);
var a1 = vectorsAngle([1, 0], [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY]);
var u2 = [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY];
var v2 = [(-currp.x - cpp.x) / rX, (-currp.y - cpp.y) / rY];
var ad2 = vectorsAngle(u2, v2);
if (vectorsRatio(u2, v2) <= -1) {
ad2 = Math.PI;
}
if (vectorsRatio(u2, v2) >= 1) {
ad2 = 0;
}
return {
currentPoint,
rX,
rY,
sweepFlag,
xAxisRotation,
centp,
a1,
ad: ad2
};
}
pathA(ctx, boundingBox) {
var {
pathParser
} = this;
var {
currentPoint,
rX,
rY,
sweepFlag,
xAxisRotation,
centp,
a1,
ad: ad2
} = PathElement.pathA(pathParser);
var dir = 1 - sweepFlag ? 1 : -1;
var ah2 = a1 + dir * (ad2 / 2);
var halfWay = new Point(centp.x + rX * Math.cos(ah2), centp.y + rY * Math.sin(ah2));
pathParser.addMarkerAngle(halfWay, ah2 - dir * Math.PI / 2);
pathParser.addMarkerAngle(currentPoint, ah2 - dir * Math.PI);
boundingBox.addPoint(currentPoint.x, currentPoint.y);
if (ctx && !isNaN(a1) && !isNaN(ad2)) {
var r2 = rX > rY ? rX : rY;
var sx = rX > rY ? 1 : rX / rY;
var sy = rX > rY ? rY / rX : 1;
ctx.translate(centp.x, centp.y);
ctx.rotate(xAxisRotation);
ctx.scale(sx, sy);
ctx.arc(0, 0, r2, a1, a1 + ad2, Boolean(1 - sweepFlag));
ctx.scale(1 / sx, 1 / sy);
ctx.rotate(-xAxisRotation);
ctx.translate(-centp.x, -centp.y);
}
}
static pathZ(pathParser) {
pathParser.current = pathParser.start;
}
pathZ(ctx, boundingBox) {
PathElement.pathZ(this.pathParser);
if (ctx) {
if (boundingBox.x1 !== boundingBox.x2 && boundingBox.y1 !== boundingBox.y2) {
ctx.closePath();
}
}
}
}
class GlyphElement extends PathElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "glyph";
this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber();
this.unicode = this.getAttribute("unicode").getString();
this.arabicForm = this.getAttribute("arabic-form").getString();
}
}
class TextElement extends RenderedElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, new.target === TextElement ? true : captureTextNodes);
this.type = "text";
this.x = 0;
this.y = 0;
this.measureCache = -1;
}
setContext(ctx) {
var fromMeasure = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
super.setContext(ctx, fromMeasure);
var textBaseline = this.getStyle("dominant-baseline").getTextBaseline() || this.getStyle("alignment-baseline").getTextBaseline();
if (textBaseline) {
ctx.textBaseline = textBaseline;
}
}
initializeCoordinates() {
this.x = 0;
this.y = 0;
this.leafTexts = [];
this.textChunkStart = 0;
this.minX = Number.POSITIVE_INFINITY;
this.maxX = Number.NEGATIVE_INFINITY;
}
getBoundingBox(ctx) {
if (this.type !== "text") {
return this.getTElementBoundingBox(ctx);
}
this.initializeCoordinates();
this.adjustChildCoordinatesRecursive(ctx);
var boundingBox = null;
this.children.forEach((_24, i2) => {
var childBoundingBox = this.getChildBoundingBox(ctx, this, this, i2);
if (!boundingBox) {
boundingBox = childBoundingBox;
} else {
boundingBox.addBoundingBox(childBoundingBox);
}
});
return boundingBox;
}
getFontSize() {
var {
document: document2,
parent
} = this;
var inheritFontSize = Font.parse(document2.ctx.font).fontSize;
var fontSize2 = parent.getStyle("font-size").getNumber(inheritFontSize);
return fontSize2;
}
getTElementBoundingBox(ctx) {
var fontSize2 = this.getFontSize();
return new BoundingBox(this.x, this.y - fontSize2, this.x + this.measureText(ctx), this.y);
}
getGlyph(font2, text2, i2) {
var char2 = text2[i2];
var glyph = null;
if (font2.isArabic) {
var len = text2.length;
var prevChar = text2[i2 - 1];
var nextChar = text2[i2 + 1];
var arabicForm = "isolated";
if ((i2 === 0 || prevChar === " ") && i2 < len - 1 && nextChar !== " ") {
arabicForm = "terminal";
}
if (i2 > 0 && prevChar !== " " && i2 < len - 1 && nextChar !== " ") {
arabicForm = "medial";
}
if (i2 > 0 && prevChar !== " " && (i2 === len - 1 || nextChar === " ")) {
arabicForm = "initial";
}
if (typeof font2.glyphs[char2] !== "undefined") {
var maybeGlyph = font2.glyphs[char2];
glyph = maybeGlyph instanceof GlyphElement ? maybeGlyph : maybeGlyph[arabicForm];
}
} else {
glyph = font2.glyphs[char2];
}
if (!glyph) {
glyph = font2.missingGlyph;
}
return glyph;
}
getText() {
return "";
}
getTextFromNode(node2) {
var textNode = node2 || this.node;
var childNodes = Array.from(textNode.parentNode.childNodes);
var index2 = childNodes.indexOf(textNode);
var lastIndex = childNodes.length - 1;
var text2 = compressSpaces(
// textNode.value
// || textNode.text
textNode.textContent || ""
);
if (index2 === 0) {
text2 = trimLeft(text2);
}
if (index2 === lastIndex) {
text2 = trimRight(text2);
}
return text2;
}
renderChildren(ctx) {
if (this.type !== "text") {
this.renderTElementChildren(ctx);
return;
}
this.initializeCoordinates();
this.adjustChildCoordinatesRecursive(ctx);
this.children.forEach((_24, i2) => {
this.renderChild(ctx, this, this, i2);
});
var {
mouse
} = this.document.screen;
if (mouse.isWorking()) {
mouse.checkBoundingBox(this, this.getBoundingBox(ctx));
}
}
renderTElementChildren(ctx) {
var {
document: document2,
parent
} = this;
var renderText = this.getText();
var customFont = parent.getStyle("font-family").getDefinition();
if (customFont) {
var {
unitsPerEm
} = customFont.fontFace;
var ctxFont = Font.parse(document2.ctx.font);
var fontSize2 = parent.getStyle("font-size").getNumber(ctxFont.fontSize);
var fontStyle2 = parent.getStyle("font-style").getString(ctxFont.fontStyle);
var scale2 = fontSize2 / unitsPerEm;
var text2 = customFont.isRTL ? renderText.split("").reverse().join("") : renderText;
var dx = toNumbers(parent.getAttribute("dx").getString());
var len = text2.length;
for (var i2 = 0; i2 < len; i2++) {
var glyph = this.getGlyph(customFont, text2, i2);
ctx.translate(this.x, this.y);
ctx.scale(scale2, -scale2);
var lw = ctx.lineWidth;
ctx.lineWidth = ctx.lineWidth * unitsPerEm / fontSize2;
if (fontStyle2 === "italic") {
ctx.transform(1, 0, 0.4, 1, 0, 0);
}
glyph.render(ctx);
if (fontStyle2 === "italic") {
ctx.transform(1, 0, -0.4, 1, 0, 0);
}
ctx.lineWidth = lw;
ctx.scale(1 / scale2, -1 / scale2);
ctx.translate(-this.x, -this.y);
this.x += fontSize2 * (glyph.horizAdvX || customFont.horizAdvX) / unitsPerEm;
if (typeof dx[i2] !== "undefined" && !isNaN(dx[i2])) {
this.x += dx[i2];
}
}
return;
}
var {
x: x2,
y: y2
} = this;
if (ctx.fillStyle) {
ctx.fillText(renderText, x2, y2);
}
if (ctx.strokeStyle) {
ctx.strokeText(renderText, x2, y2);
}
}
applyAnchoring() {
if (this.textChunkStart >= this.leafTexts.length) {
return;
}
var firstElement = this.leafTexts[this.textChunkStart];
var textAnchor = firstElement.getStyle("text-anchor").getString("start");
var isRTL = false;
var shift = 0;
if (textAnchor === "start" && !isRTL || textAnchor === "end" && isRTL) {
shift = firstElement.x - this.minX;
} else if (textAnchor === "end" && !isRTL || textAnchor === "start" && isRTL) {
shift = firstElement.x - this.maxX;
} else {
shift = firstElement.x - (this.minX + this.maxX) / 2;
}
for (var i2 = this.textChunkStart; i2 < this.leafTexts.length; i2++) {
this.leafTexts[i2].x += shift;
}
this.minX = Number.POSITIVE_INFINITY;
this.maxX = Number.NEGATIVE_INFINITY;
this.textChunkStart = this.leafTexts.length;
}
adjustChildCoordinatesRecursive(ctx) {
this.children.forEach((_24, i2) => {
this.adjustChildCoordinatesRecursiveCore(ctx, this, this, i2);
});
this.applyAnchoring();
}
adjustChildCoordinatesRecursiveCore(ctx, textParent, parent, i2) {
var child = parent.children[i2];
if (child.children.length > 0) {
child.children.forEach((_24, i3) => {
textParent.adjustChildCoordinatesRecursiveCore(ctx, textParent, child, i3);
});
} else {
this.adjustChildCoordinates(ctx, textParent, parent, i2);
}
}
adjustChildCoordinates(ctx, textParent, parent, i2) {
var child = parent.children[i2];
if (typeof child.measureText !== "function") {
return child;
}
ctx.save();
child.setContext(ctx, true);
var xAttr = child.getAttribute("x");
var yAttr = child.getAttribute("y");
var dxAttr = child.getAttribute("dx");
var dyAttr = child.getAttribute("dy");
var customFont = child.getStyle("font-family").getDefinition();
var isRTL = Boolean(customFont) && customFont.isRTL;
if (i2 === 0) {
if (!xAttr.hasValue()) {
xAttr.setValue(child.getInheritedAttribute("x"));
}
if (!yAttr.hasValue()) {
yAttr.setValue(child.getInheritedAttribute("y"));
}
if (!dxAttr.hasValue()) {
dxAttr.setValue(child.getInheritedAttribute("dx"));
}
if (!dyAttr.hasValue()) {
dyAttr.setValue(child.getInheritedAttribute("dy"));
}
}
var width2 = child.measureText(ctx);
if (isRTL) {
textParent.x -= width2;
}
if (xAttr.hasValue()) {
textParent.applyAnchoring();
child.x = xAttr.getPixels("x");
if (dxAttr.hasValue()) {
child.x += dxAttr.getPixels("x");
}
} else {
if (dxAttr.hasValue()) {
textParent.x += dxAttr.getPixels("x");
}
child.x = textParent.x;
}
textParent.x = child.x;
if (!isRTL) {
textParent.x += width2;
}
if (yAttr.hasValue()) {
child.y = yAttr.getPixels("y");
if (dyAttr.hasValue()) {
child.y += dyAttr.getPixels("y");
}
} else {
if (dyAttr.hasValue()) {
textParent.y += dyAttr.getPixels("y");
}
child.y = textParent.y;
}
textParent.y = child.y;
textParent.leafTexts.push(child);
textParent.minX = Math.min(textParent.minX, child.x, child.x + width2);
textParent.maxX = Math.max(textParent.maxX, child.x, child.x + width2);
child.clearContext(ctx);
ctx.restore();
return child;
}
getChildBoundingBox(ctx, textParent, parent, i2) {
var child = parent.children[i2];
if (typeof child.getBoundingBox !== "function") {
return null;
}
var boundingBox = child.getBoundingBox(ctx);
if (!boundingBox) {
return null;
}
child.children.forEach((_24, i3) => {
var childBoundingBox = textParent.getChildBoundingBox(ctx, textParent, child, i3);
boundingBox.addBoundingBox(childBoundingBox);
});
return boundingBox;
}
renderChild(ctx, textParent, parent, i2) {
var child = parent.children[i2];
child.render(ctx);
child.children.forEach((_24, i3) => {
textParent.renderChild(ctx, textParent, child, i3);
});
}
measureText(ctx) {
var {
measureCache
} = this;
if (~measureCache) {
return measureCache;
}
var renderText = this.getText();
var measure2 = this.measureTargetText(ctx, renderText);
this.measureCache = measure2;
return measure2;
}
measureTargetText(ctx, targetText) {
if (!targetText.length) {
return 0;
}
var {
parent
} = this;
var customFont = parent.getStyle("font-family").getDefinition();
if (customFont) {
var fontSize2 = this.getFontSize();
var text2 = customFont.isRTL ? targetText.split("").reverse().join("") : targetText;
var dx = toNumbers(parent.getAttribute("dx").getString());
var len = text2.length;
var _measure = 0;
for (var i2 = 0; i2 < len; i2++) {
var glyph = this.getGlyph(customFont, text2, i2);
_measure += (glyph.horizAdvX || customFont.horizAdvX) * fontSize2 / customFont.fontFace.unitsPerEm;
if (typeof dx[i2] !== "undefined" && !isNaN(dx[i2])) {
_measure += dx[i2];
}
}
return _measure;
}
if (!ctx.measureText) {
return targetText.length * 10;
}
ctx.save();
this.setContext(ctx, true);
var {
width: measure2
} = ctx.measureText(targetText);
this.clearContext(ctx);
ctx.restore();
return measure2;
}
/**
* Inherits positional attributes from {@link TextElement} parent(s). Attributes
* are only inherited from a parent to its first child.
* @param name - The attribute name.
* @returns The attribute value or null.
*/
getInheritedAttribute(name) {
var current = this;
while (current instanceof TextElement && current.isFirstChild()) {
var parentAttr = current.parent.getAttribute(name);
if (parentAttr.hasValue(true)) {
return parentAttr.getValue("0");
}
current = current.parent;
}
return null;
}
}
class TSpanElement extends TextElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, new.target === TSpanElement ? true : captureTextNodes);
this.type = "tspan";
this.text = this.children.length > 0 ? "" : this.getTextFromNode();
}
getText() {
return this.text;
}
}
class TextNode extends TSpanElement {
constructor() {
super(...arguments);
this.type = "textNode";
}
}
class SVGElement extends RenderedElement {
constructor() {
super(...arguments);
this.type = "svg";
this.root = false;
}
setContext(ctx) {
var _this$node$parentNode;
var {
document: document2
} = this;
var {
screen: screen2,
window: window2
} = document2;
var canvas = ctx.canvas;
screen2.setDefaults(ctx);
if (canvas.style && typeof ctx.font !== "undefined" && window2 && typeof window2.getComputedStyle !== "undefined") {
ctx.font = window2.getComputedStyle(canvas).getPropertyValue("font");
var fontSizeProp = new Property(document2, "fontSize", Font.parse(ctx.font).fontSize);
if (fontSizeProp.hasValue()) {
document2.rootEmSize = fontSizeProp.getPixels("y");
document2.emSize = document2.rootEmSize;
}
}
if (!this.getAttribute("x").hasValue()) {
this.getAttribute("x", true).setValue(0);
}
if (!this.getAttribute("y").hasValue()) {
this.getAttribute("y", true).setValue(0);
}
var {
width: width2,
height: height2
} = screen2.viewPort;
if (!this.getStyle("width").hasValue()) {
this.getStyle("width", true).setValue("100%");
}
if (!this.getStyle("height").hasValue()) {
this.getStyle("height", true).setValue("100%");
}
if (!this.getStyle("color").hasValue()) {
this.getStyle("color", true).setValue("black");
}
var refXAttr = this.getAttribute("refX");
var refYAttr = this.getAttribute("refY");
var viewBoxAttr = this.getAttribute("viewBox");
var viewBox = viewBoxAttr.hasValue() ? toNumbers(viewBoxAttr.getString()) : null;
var clip2 = !this.root && this.getStyle("overflow").getValue("hidden") !== "visible";
var minX = 0;
var minY = 0;
var clipX = 0;
var clipY = 0;
if (viewBox) {
minX = viewBox[0];
minY = viewBox[1];
}
if (!this.root) {
width2 = this.getStyle("width").getPixels("x");
height2 = this.getStyle("height").getPixels("y");
if (this.type === "marker") {
clipX = minX;
clipY = minY;
minX = 0;
minY = 0;
}
}
screen2.viewPort.setCurrent(width2, height2);
if (this.node && (!this.parent || ((_this$node$parentNode = this.node.parentNode) === null || _this$node$parentNode === void 0 ? void 0 : _this$node$parentNode.nodeName) === "foreignObject") && this.getStyle("transform", false, true).hasValue() && !this.getStyle("transform-origin", false, true).hasValue()) {
this.getStyle("transform-origin", true, true).setValue("50% 50%");
}
super.setContext(ctx);
ctx.translate(this.getAttribute("x").getPixels("x"), this.getAttribute("y").getPixels("y"));
if (viewBox) {
width2 = viewBox[2];
height2 = viewBox[3];
}
document2.setViewBox({
ctx,
aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
width: screen2.viewPort.width,
desiredWidth: width2,
height: screen2.viewPort.height,
desiredHeight: height2,
minX,
minY,
refX: refXAttr.getValue(),
refY: refYAttr.getValue(),
clip: clip2,
clipX,
clipY
});
if (viewBox) {
screen2.viewPort.removeCurrent();
screen2.viewPort.setCurrent(width2, height2);
}
}
clearContext(ctx) {
super.clearContext(ctx);
this.document.screen.viewPort.removeCurrent();
}
/**
* Resize SVG to fit in given size.
* @param width
* @param height
* @param preserveAspectRatio
*/
resize(width2) {
var height2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : width2;
var preserveAspectRatio = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
var widthAttr = this.getAttribute("width", true);
var heightAttr = this.getAttribute("height", true);
var viewBoxAttr = this.getAttribute("viewBox");
var styleAttr = this.getAttribute("style");
var originWidth = widthAttr.getNumber(0);
var originHeight = heightAttr.getNumber(0);
if (preserveAspectRatio) {
if (typeof preserveAspectRatio === "string") {
this.getAttribute("preserveAspectRatio", true).setValue(preserveAspectRatio);
} else {
var preserveAspectRatioAttr = this.getAttribute("preserveAspectRatio");
if (preserveAspectRatioAttr.hasValue()) {
preserveAspectRatioAttr.setValue(preserveAspectRatioAttr.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"));
}
}
}
widthAttr.setValue(width2);
heightAttr.setValue(height2);
if (!viewBoxAttr.hasValue()) {
viewBoxAttr.setValue("0 0 ".concat(originWidth || width2, " ").concat(originHeight || height2));
}
if (styleAttr.hasValue()) {
var widthStyle = this.getStyle("width");
var heightStyle = this.getStyle("height");
if (widthStyle.hasValue()) {
widthStyle.setValue("".concat(width2, "px"));
}
if (heightStyle.hasValue()) {
heightStyle.setValue("".concat(height2, "px"));
}
}
}
}
class RectElement extends PathElement {
constructor() {
super(...arguments);
this.type = "rect";
}
path(ctx) {
var x2 = this.getAttribute("x").getPixels("x");
var y2 = this.getAttribute("y").getPixels("y");
var width2 = this.getStyle("width", false, true).getPixels("x");
var height2 = this.getStyle("height", false, true).getPixels("y");
var rxAttr = this.getAttribute("rx");
var ryAttr = this.getAttribute("ry");
var rx = rxAttr.getPixels("x");
var ry = ryAttr.getPixels("y");
if (rxAttr.hasValue() && !ryAttr.hasValue()) {
ry = rx;
}
if (ryAttr.hasValue() && !rxAttr.hasValue()) {
rx = ry;
}
rx = Math.min(rx, width2 / 2);
ry = Math.min(ry, height2 / 2);
if (ctx) {
var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
ctx.beginPath();
if (height2 > 0 && width2 > 0) {
ctx.moveTo(x2 + rx, y2);
ctx.lineTo(x2 + width2 - rx, y2);
ctx.bezierCurveTo(x2 + width2 - rx + KAPPA * rx, y2, x2 + width2, y2 + ry - KAPPA * ry, x2 + width2, y2 + ry);
ctx.lineTo(x2 + width2, y2 + height2 - ry);
ctx.bezierCurveTo(x2 + width2, y2 + height2 - ry + KAPPA * ry, x2 + width2 - rx + KAPPA * rx, y2 + height2, x2 + width2 - rx, y2 + height2);
ctx.lineTo(x2 + rx, y2 + height2);
ctx.bezierCurveTo(x2 + rx - KAPPA * rx, y2 + height2, x2, y2 + height2 - ry + KAPPA * ry, x2, y2 + height2 - ry);
ctx.lineTo(x2, y2 + ry);
ctx.bezierCurveTo(x2, y2 + ry - KAPPA * ry, x2 + rx - KAPPA * rx, y2, x2 + rx, y2);
ctx.closePath();
}
}
return new BoundingBox(x2, y2, x2 + width2, y2 + height2);
}
getMarkers() {
return null;
}
}
class CircleElement extends PathElement {
constructor() {
super(...arguments);
this.type = "circle";
}
path(ctx) {
var cx = this.getAttribute("cx").getPixels("x");
var cy = this.getAttribute("cy").getPixels("y");
var r2 = this.getAttribute("r").getPixels();
if (ctx && r2 > 0) {
ctx.beginPath();
ctx.arc(cx, cy, r2, 0, Math.PI * 2, false);
ctx.closePath();
}
return new BoundingBox(cx - r2, cy - r2, cx + r2, cy + r2);
}
getMarkers() {
return null;
}
}
class EllipseElement extends PathElement {
constructor() {
super(...arguments);
this.type = "ellipse";
}
path(ctx) {
var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
var rx = this.getAttribute("rx").getPixels("x");
var ry = this.getAttribute("ry").getPixels("y");
var cx = this.getAttribute("cx").getPixels("x");
var cy = this.getAttribute("cy").getPixels("y");
if (ctx && rx > 0 && ry > 0) {
ctx.beginPath();
ctx.moveTo(cx + rx, cy);
ctx.bezierCurveTo(cx + rx, cy + KAPPA * ry, cx + KAPPA * rx, cy + ry, cx, cy + ry);
ctx.bezierCurveTo(cx - KAPPA * rx, cy + ry, cx - rx, cy + KAPPA * ry, cx - rx, cy);
ctx.bezierCurveTo(cx - rx, cy - KAPPA * ry, cx - KAPPA * rx, cy - ry, cx, cy - ry);
ctx.bezierCurveTo(cx + KAPPA * rx, cy - ry, cx + rx, cy - KAPPA * ry, cx + rx, cy);
ctx.closePath();
}
return new BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry);
}
getMarkers() {
return null;
}
}
class LineElement extends PathElement {
constructor() {
super(...arguments);
this.type = "line";
}
getPoints() {
return [new Point(this.getAttribute("x1").getPixels("x"), this.getAttribute("y1").getPixels("y")), new Point(this.getAttribute("x2").getPixels("x"), this.getAttribute("y2").getPixels("y"))];
}
path(ctx) {
var [{
x: x02,
y: y02
}, {
x: x12,
y: y12
}] = this.getPoints();
if (ctx) {
ctx.beginPath();
ctx.moveTo(x02, y02);
ctx.lineTo(x12, y12);
}
return new BoundingBox(x02, y02, x12, y12);
}
getMarkers() {
var [p02, p1] = this.getPoints();
var a2 = p02.angleTo(p1);
return [[p02, a2], [p1, a2]];
}
}
class PolylineElement extends PathElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "polyline";
this.points = [];
this.points = Point.parsePath(this.getAttribute("points").getString());
}
path(ctx) {
var {
points: points2
} = this;
var [{
x: x02,
y: y02
}] = points2;
var boundingBox = new BoundingBox(x02, y02);
if (ctx) {
ctx.beginPath();
ctx.moveTo(x02, y02);
}
points2.forEach((_ref3) => {
var {
x: x2,
y: y2
} = _ref3;
boundingBox.addPoint(x2, y2);
if (ctx) {
ctx.lineTo(x2, y2);
}
});
return boundingBox;
}
getMarkers() {
var {
points: points2
} = this;
var lastIndex = points2.length - 1;
var markers = [];
points2.forEach((point2, i2) => {
if (i2 === lastIndex) {
return;
}
markers.push([point2, point2.angleTo(points2[i2 + 1])]);
});
if (markers.length > 0) {
markers.push([points2[points2.length - 1], markers[markers.length - 1][1]]);
}
return markers;
}
}
class PolygonElement extends PolylineElement {
constructor() {
super(...arguments);
this.type = "polygon";
}
path(ctx) {
var boundingBox = super.path(ctx);
var [{
x: x2,
y: y2
}] = this.points;
if (ctx) {
ctx.lineTo(x2, y2);
ctx.closePath();
}
return boundingBox;
}
}
class PatternElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "pattern";
}
createPattern(ctx, _24, parentOpacityProp) {
var width2 = this.getStyle("width").getPixels("x", true);
var height2 = this.getStyle("height").getPixels("y", true);
var patternSvg = new SVGElement(this.document, null);
patternSvg.attributes.viewBox = new Property(this.document, "viewBox", this.getAttribute("viewBox").getValue());
patternSvg.attributes.width = new Property(this.document, "width", "".concat(width2, "px"));
patternSvg.attributes.height = new Property(this.document, "height", "".concat(height2, "px"));
patternSvg.attributes.transform = new Property(this.document, "transform", this.getAttribute("patternTransform").getValue());
patternSvg.children = this.children;
var patternCanvas = this.document.createCanvas(width2, height2);
var patternCtx = patternCanvas.getContext("2d");
var xAttr = this.getAttribute("x");
var yAttr = this.getAttribute("y");
if (xAttr.hasValue() && yAttr.hasValue()) {
patternCtx.translate(xAttr.getPixels("x", true), yAttr.getPixels("y", true));
}
if (parentOpacityProp.hasValue()) {
this.styles["fill-opacity"] = parentOpacityProp;
} else {
Reflect.deleteProperty(this.styles, "fill-opacity");
}
for (var x2 = -1; x2 <= 1; x2++) {
for (var y2 = -1; y2 <= 1; y2++) {
patternCtx.save();
patternSvg.attributes.x = new Property(this.document, "x", x2 * patternCanvas.width);
patternSvg.attributes.y = new Property(this.document, "y", y2 * patternCanvas.height);
patternSvg.render(patternCtx);
patternCtx.restore();
}
}
var pattern = ctx.createPattern(patternCanvas, "repeat");
return pattern;
}
}
class MarkerElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "marker";
}
render(ctx, point2, angle2) {
if (!point2) {
return;
}
var {
x: x2,
y: y2
} = point2;
var orient = this.getAttribute("orient").getString("auto");
var markerUnits = this.getAttribute("markerUnits").getString("strokeWidth");
ctx.translate(x2, y2);
if (orient === "auto") {
ctx.rotate(angle2);
}
if (markerUnits === "strokeWidth") {
ctx.scale(ctx.lineWidth, ctx.lineWidth);
}
ctx.save();
var markerSvg = new SVGElement(this.document, null);
markerSvg.type = this.type;
markerSvg.attributes.viewBox = new Property(this.document, "viewBox", this.getAttribute("viewBox").getValue());
markerSvg.attributes.refX = new Property(this.document, "refX", this.getAttribute("refX").getValue());
markerSvg.attributes.refY = new Property(this.document, "refY", this.getAttribute("refY").getValue());
markerSvg.attributes.width = new Property(this.document, "width", this.getAttribute("markerWidth").getValue());
markerSvg.attributes.height = new Property(this.document, "height", this.getAttribute("markerHeight").getValue());
markerSvg.attributes.overflow = new Property(this.document, "overflow", this.getAttribute("overflow").getValue());
markerSvg.attributes.fill = new Property(this.document, "fill", this.getAttribute("fill").getColor("black"));
markerSvg.attributes.stroke = new Property(this.document, "stroke", this.getAttribute("stroke").getValue("none"));
markerSvg.children = this.children;
markerSvg.render(ctx);
ctx.restore();
if (markerUnits === "strokeWidth") {
ctx.scale(1 / ctx.lineWidth, 1 / ctx.lineWidth);
}
if (orient === "auto") {
ctx.rotate(-angle2);
}
ctx.translate(-x2, -y2);
}
}
class DefsElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "defs";
}
render() {
}
}
class GElement extends RenderedElement {
constructor() {
super(...arguments);
this.type = "g";
}
getBoundingBox(ctx) {
var boundingBox = new BoundingBox();
this.children.forEach((child) => {
boundingBox.addBoundingBox(child.getBoundingBox(ctx));
});
return boundingBox;
}
}
class GradientElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.attributesToInherit = ["gradientUnits"];
this.stops = [];
var {
stops,
children: children2
} = this;
children2.forEach((child) => {
if (child.type === "stop") {
stops.push(child);
}
});
}
getGradientUnits() {
return this.getAttribute("gradientUnits").getString("objectBoundingBox");
}
createGradient(ctx, element2, parentOpacityProp) {
var stopsContainer = this;
if (this.getHrefAttribute().hasValue()) {
stopsContainer = this.getHrefAttribute().getDefinition();
this.inheritStopContainer(stopsContainer);
}
var {
stops
} = stopsContainer;
var gradient2 = this.getGradient(ctx, element2);
if (!gradient2) {
return this.addParentOpacity(parentOpacityProp, stops[stops.length - 1].color);
}
stops.forEach((stop2) => {
gradient2.addColorStop(stop2.offset, this.addParentOpacity(parentOpacityProp, stop2.color));
});
if (this.getAttribute("gradientTransform").hasValue()) {
var {
document: document2
} = this;
var {
MAX_VIRTUAL_PIXELS,
viewPort
} = document2.screen;
var [rootView] = viewPort.viewPorts;
var rect2 = new RectElement(document2, null);
rect2.attributes.x = new Property(document2, "x", -MAX_VIRTUAL_PIXELS / 3);
rect2.attributes.y = new Property(document2, "y", -MAX_VIRTUAL_PIXELS / 3);
rect2.attributes.width = new Property(document2, "width", MAX_VIRTUAL_PIXELS);
rect2.attributes.height = new Property(document2, "height", MAX_VIRTUAL_PIXELS);
var group2 = new GElement(document2, null);
group2.attributes.transform = new Property(document2, "transform", this.getAttribute("gradientTransform").getValue());
group2.children = [rect2];
var patternSvg = new SVGElement(document2, null);
patternSvg.attributes.x = new Property(document2, "x", 0);
patternSvg.attributes.y = new Property(document2, "y", 0);
patternSvg.attributes.width = new Property(document2, "width", rootView.width);
patternSvg.attributes.height = new Property(document2, "height", rootView.height);
patternSvg.children = [group2];
var patternCanvas = document2.createCanvas(rootView.width, rootView.height);
var patternCtx = patternCanvas.getContext("2d");
patternCtx.fillStyle = gradient2;
patternSvg.render(patternCtx);
return patternCtx.createPattern(patternCanvas, "no-repeat");
}
return gradient2;
}
inheritStopContainer(stopsContainer) {
this.attributesToInherit.forEach((attributeToInherit) => {
if (!this.getAttribute(attributeToInherit).hasValue() && stopsContainer.getAttribute(attributeToInherit).hasValue()) {
this.getAttribute(attributeToInherit, true).setValue(stopsContainer.getAttribute(attributeToInherit).getValue());
}
});
}
addParentOpacity(parentOpacityProp, color2) {
if (parentOpacityProp.hasValue()) {
var colorProp = new Property(this.document, "color", color2);
return colorProp.addOpacity(parentOpacityProp).getColor();
}
return color2;
}
}
class LinearGradientElement extends GradientElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "linearGradient";
this.attributesToInherit.push("x1", "y1", "x2", "y2");
}
getGradient(ctx, element2) {
var isBoundingBoxUnits = this.getGradientUnits() === "objectBoundingBox";
var boundingBox = isBoundingBoxUnits ? element2.getBoundingBox(ctx) : null;
if (isBoundingBoxUnits && !boundingBox) {
return null;
}
if (!this.getAttribute("x1").hasValue() && !this.getAttribute("y1").hasValue() && !this.getAttribute("x2").hasValue() && !this.getAttribute("y2").hasValue()) {
this.getAttribute("x1", true).setValue(0);
this.getAttribute("y1", true).setValue(0);
this.getAttribute("x2", true).setValue(1);
this.getAttribute("y2", true).setValue(0);
}
var x12 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("x1").getNumber() : this.getAttribute("x1").getPixels("x");
var y12 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("y1").getNumber() : this.getAttribute("y1").getPixels("y");
var x2 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("x2").getNumber() : this.getAttribute("x2").getPixels("x");
var y2 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("y2").getNumber() : this.getAttribute("y2").getPixels("y");
if (x12 === x2 && y12 === y2) {
return null;
}
return ctx.createLinearGradient(x12, y12, x2, y2);
}
}
class RadialGradientElement extends GradientElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "radialGradient";
this.attributesToInherit.push("cx", "cy", "r", "fx", "fy", "fr");
}
getGradient(ctx, element2) {
var isBoundingBoxUnits = this.getGradientUnits() === "objectBoundingBox";
var boundingBox = element2.getBoundingBox(ctx);
if (isBoundingBoxUnits && !boundingBox) {
return null;
}
if (!this.getAttribute("cx").hasValue()) {
this.getAttribute("cx", true).setValue("50%");
}
if (!this.getAttribute("cy").hasValue()) {
this.getAttribute("cy", true).setValue("50%");
}
if (!this.getAttribute("r").hasValue()) {
this.getAttribute("r", true).setValue("50%");
}
var cx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("cx").getNumber() : this.getAttribute("cx").getPixels("x");
var cy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("cy").getNumber() : this.getAttribute("cy").getPixels("y");
var fx = cx;
var fy = cy;
if (this.getAttribute("fx").hasValue()) {
fx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute("fx").getNumber() : this.getAttribute("fx").getPixels("x");
}
if (this.getAttribute("fy").hasValue()) {
fy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute("fy").getNumber() : this.getAttribute("fy").getPixels("y");
}
var r2 = isBoundingBoxUnits ? (boundingBox.width + boundingBox.height) / 2 * this.getAttribute("r").getNumber() : this.getAttribute("r").getPixels();
var fr2 = this.getAttribute("fr").getPixels();
return ctx.createRadialGradient(fx, fy, fr2, cx, cy, r2);
}
}
class StopElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "stop";
var offset2 = Math.max(0, Math.min(1, this.getAttribute("offset").getNumber()));
var stopOpacity = this.getStyle("stop-opacity");
var stopColor = this.getStyle("stop-color", true);
if (stopColor.getString() === "") {
stopColor.setValue("#000");
}
if (stopOpacity.hasValue()) {
stopColor = stopColor.addOpacity(stopOpacity);
}
this.offset = offset2;
this.color = stopColor.getColor();
}
}
class AnimateElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "animate";
this.duration = 0;
this.initialValue = null;
this.initialUnits = "";
this.removed = false;
this.frozen = false;
document2.screen.animations.push(this);
this.begin = this.getAttribute("begin").getMilliseconds();
this.maxDuration = this.begin + this.getAttribute("dur").getMilliseconds();
this.from = this.getAttribute("from");
this.to = this.getAttribute("to");
this.values = new Property(document2, "values", null);
var valuesAttr = this.getAttribute("values");
if (valuesAttr.hasValue()) {
this.values.setValue(valuesAttr.getString().split(";"));
}
}
getProperty() {
var attributeType = this.getAttribute("attributeType").getString();
var attributeName = this.getAttribute("attributeName").getString();
if (attributeType === "CSS") {
return this.parent.getStyle(attributeName, true);
}
return this.parent.getAttribute(attributeName, true);
}
calcValue() {
var {
initialUnits
} = this;
var {
progress,
from: from2,
to: to2
} = this.getProgress();
var newValue = from2.getNumber() + (to2.getNumber() - from2.getNumber()) * progress;
if (initialUnits === "%") {
newValue *= 100;
}
return "".concat(newValue).concat(initialUnits);
}
update(delta) {
var {
parent
} = this;
var prop = this.getProperty();
if (!this.initialValue) {
this.initialValue = prop.getString();
this.initialUnits = prop.getUnits();
}
if (this.duration > this.maxDuration) {
var fill2 = this.getAttribute("fill").getString("remove");
if (this.getAttribute("repeatCount").getString() === "indefinite" || this.getAttribute("repeatDur").getString() === "indefinite") {
this.duration = 0;
} else if (fill2 === "freeze" && !this.frozen) {
this.frozen = true;
parent.animationFrozen = true;
parent.animationFrozenValue = prop.getString();
} else if (fill2 === "remove" && !this.removed) {
this.removed = true;
prop.setValue(parent.animationFrozen ? parent.animationFrozenValue : this.initialValue);
return true;
}
return false;
}
this.duration += delta;
var updated = false;
if (this.begin < this.duration) {
var newValue = this.calcValue();
var typeAttr = this.getAttribute("type");
if (typeAttr.hasValue()) {
var type2 = typeAttr.getString();
newValue = "".concat(type2, "(").concat(newValue, ")");
}
prop.setValue(newValue);
updated = true;
}
return updated;
}
getProgress() {
var {
document: document2,
values: values2
} = this;
var result = {
progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
};
if (values2.hasValue()) {
var p2 = result.progress * (values2.getValue().length - 1);
var lb2 = Math.floor(p2);
var ub2 = Math.ceil(p2);
result.from = new Property(document2, "from", parseFloat(values2.getValue()[lb2]));
result.to = new Property(document2, "to", parseFloat(values2.getValue()[ub2]));
result.progress = (p2 - lb2) / (ub2 - lb2);
} else {
result.from = this.from;
result.to = this.to;
}
return result;
}
}
class AnimateColorElement extends AnimateElement {
constructor() {
super(...arguments);
this.type = "animateColor";
}
calcValue() {
var {
progress,
from: from2,
to: to2
} = this.getProgress();
var colorFrom = new RGBColor$1(from2.getColor());
var colorTo = new RGBColor$1(to2.getColor());
if (colorFrom.ok && colorTo.ok) {
var r2 = colorFrom.r + (colorTo.r - colorFrom.r) * progress;
var g2 = colorFrom.g + (colorTo.g - colorFrom.g) * progress;
var b2 = colorFrom.b + (colorTo.b - colorFrom.b) * progress;
return "rgb(".concat(Math.floor(r2), ", ").concat(Math.floor(g2), ", ").concat(Math.floor(b2), ")");
}
return this.getAttribute("from").getColor();
}
}
class AnimateTransformElement extends AnimateElement {
constructor() {
super(...arguments);
this.type = "animateTransform";
}
calcValue() {
var {
progress,
from: from2,
to: to2
} = this.getProgress();
var transformFrom = toNumbers(from2.getString());
var transformTo = toNumbers(to2.getString());
var newValue = transformFrom.map((from3, i2) => {
var to3 = transformTo[i2];
return from3 + (to3 - from3) * progress;
}).join(" ");
return newValue;
}
}
class FontElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "font";
this.glyphs = {};
this.horizAdvX = this.getAttribute("horiz-adv-x").getNumber();
var {
definitions
} = document2;
var {
children: children2
} = this;
for (var child of children2) {
switch (child.type) {
case "font-face": {
this.fontFace = child;
var fontFamilyStyle = child.getStyle("font-family");
if (fontFamilyStyle.hasValue()) {
definitions[fontFamilyStyle.getString()] = this;
}
break;
}
case "missing-glyph":
this.missingGlyph = child;
break;
case "glyph": {
var glyph = child;
if (glyph.arabicForm) {
this.isRTL = true;
this.isArabic = true;
if (typeof this.glyphs[glyph.unicode] === "undefined") {
this.glyphs[glyph.unicode] = {};
}
this.glyphs[glyph.unicode][glyph.arabicForm] = glyph;
} else {
this.glyphs[glyph.unicode] = glyph;
}
break;
}
}
}
}
render() {
}
}
class FontFaceElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "font-face";
this.ascent = this.getAttribute("ascent").getNumber();
this.descent = this.getAttribute("descent").getNumber();
this.unitsPerEm = this.getAttribute("units-per-em").getNumber();
}
}
class MissingGlyphElement extends PathElement {
constructor() {
super(...arguments);
this.type = "missing-glyph";
this.horizAdvX = 0;
}
}
class TRefElement extends TextElement {
constructor() {
super(...arguments);
this.type = "tref";
}
getText() {
var element2 = this.getHrefAttribute().getDefinition();
if (element2) {
var firstChild = element2.children[0];
if (firstChild) {
return firstChild.getText();
}
}
return "";
}
}
class AElement extends TextElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "a";
var {
childNodes
} = node2;
var firstChild = childNodes[0];
var hasText = childNodes.length > 0 && Array.from(childNodes).every((node3) => node3.nodeType === 3);
this.hasText = hasText;
this.text = hasText ? this.getTextFromNode(firstChild) : "";
}
getText() {
return this.text;
}
renderChildren(ctx) {
if (this.hasText) {
super.renderChildren(ctx);
var {
document: document2,
x: x2,
y: y2
} = this;
var {
mouse
} = document2.screen;
var fontSize2 = new Property(document2, "fontSize", Font.parse(document2.ctx.font).fontSize);
if (mouse.isWorking()) {
mouse.checkBoundingBox(this, new BoundingBox(x2, y2 - fontSize2.getPixels("y"), x2 + this.measureText(ctx), y2));
}
} else if (this.children.length > 0) {
var g2 = new GElement(this.document, null);
g2.children = this.children;
g2.parent = this;
g2.render(ctx);
}
}
onClick() {
var {
window: window2
} = this.document;
if (window2) {
window2.open(this.getHrefAttribute().getString());
}
}
onMouseMove() {
var ctx = this.document.ctx;
ctx.canvas.style.cursor = "pointer";
}
}
function ownKeys$2(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$2(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$2(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$2(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
class TextPathElement extends TextElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "textPath";
this.textWidth = 0;
this.textHeight = 0;
this.pathLength = -1;
this.glyphInfo = null;
this.letterSpacingCache = [];
this.measuresCache = /* @__PURE__ */ new Map([["", 0]]);
var pathElement = this.getHrefAttribute().getDefinition();
this.text = this.getTextFromNode();
this.dataArray = this.parsePathData(pathElement);
}
getText() {
return this.text;
}
path(ctx) {
var {
dataArray
} = this;
if (ctx) {
ctx.beginPath();
}
dataArray.forEach((_ref3) => {
var {
type: type2,
points: points2
} = _ref3;
switch (type2) {
case PathParser.LINE_TO:
if (ctx) {
ctx.lineTo(points2[0], points2[1]);
}
break;
case PathParser.MOVE_TO:
if (ctx) {
ctx.moveTo(points2[0], points2[1]);
}
break;
case PathParser.CURVE_TO:
if (ctx) {
ctx.bezierCurveTo(points2[0], points2[1], points2[2], points2[3], points2[4], points2[5]);
}
break;
case PathParser.QUAD_TO:
if (ctx) {
ctx.quadraticCurveTo(points2[0], points2[1], points2[2], points2[3]);
}
break;
case PathParser.ARC: {
var [cx, cy, rx, ry, theta, dTheta, psi, fs] = points2;
var r2 = rx > ry ? rx : ry;
var scaleX = rx > ry ? 1 : rx / ry;
var scaleY2 = rx > ry ? ry / rx : 1;
if (ctx) {
ctx.translate(cx, cy);
ctx.rotate(psi);
ctx.scale(scaleX, scaleY2);
ctx.arc(0, 0, r2, theta, theta + dTheta, Boolean(1 - fs));
ctx.scale(1 / scaleX, 1 / scaleY2);
ctx.rotate(-psi);
ctx.translate(-cx, -cy);
}
break;
}
case PathParser.CLOSE_PATH:
if (ctx) {
ctx.closePath();
}
break;
}
});
}
renderChildren(ctx) {
this.setTextData(ctx);
ctx.save();
var textDecoration = this.parent.getStyle("text-decoration").getString();
var fontSize2 = this.getFontSize();
var {
glyphInfo
} = this;
var fill2 = ctx.fillStyle;
if (textDecoration === "underline") {
ctx.beginPath();
}
glyphInfo.forEach((glyph, i2) => {
var {
p0: p02,
p1,
rotation: rotation2,
text: partialText
} = glyph;
ctx.save();
ctx.translate(p02.x, p02.y);
ctx.rotate(rotation2);
if (ctx.fillStyle) {
ctx.fillText(partialText, 0, 0);
}
if (ctx.strokeStyle) {
ctx.strokeText(partialText, 0, 0);
}
ctx.restore();
if (textDecoration === "underline") {
if (i2 === 0) {
ctx.moveTo(p02.x, p02.y + fontSize2 / 8);
}
ctx.lineTo(p1.x, p1.y + fontSize2 / 5);
}
});
if (textDecoration === "underline") {
ctx.lineWidth = fontSize2 / 20;
ctx.strokeStyle = fill2;
ctx.stroke();
ctx.closePath();
}
ctx.restore();
}
getLetterSpacingAt() {
var idx = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
return this.letterSpacingCache[idx] || 0;
}
findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, inputOffset, dy, c2, charI) {
var offset2 = inputOffset;
var glyphWidth = this.measureText(ctx, c2);
if (c2 === " " && anchor === "justify" && textFullWidth < fullPathWidth) {
glyphWidth += (fullPathWidth - textFullWidth) / spacesNumber;
}
if (charI > -1) {
offset2 += this.getLetterSpacingAt(charI);
}
var splineStep = this.textHeight / 20;
var p02 = this.getEquidistantPointOnPath(offset2, splineStep, 0);
var p1 = this.getEquidistantPointOnPath(offset2 + glyphWidth, splineStep, 0);
var segment = {
p0: p02,
p1
};
var rotation2 = p02 && p1 ? Math.atan2(p1.y - p02.y, p1.x - p02.x) : 0;
if (dy) {
var dyX = Math.cos(Math.PI / 2 + rotation2) * dy;
var dyY = Math.cos(-rotation2) * dy;
segment.p0 = _objectSpread$2(_objectSpread$2({}, p02), {}, {
x: p02.x + dyX,
y: p02.y + dyY
});
segment.p1 = _objectSpread$2(_objectSpread$2({}, p1), {}, {
x: p1.x + dyX,
y: p1.y + dyY
});
}
offset2 += glyphWidth;
return {
offset: offset2,
segment,
rotation: rotation2
};
}
measureText(ctx, text2) {
var {
measuresCache
} = this;
var targetText = text2 || this.getText();
if (measuresCache.has(targetText)) {
return measuresCache.get(targetText);
}
var measure2 = this.measureTargetText(ctx, targetText);
measuresCache.set(targetText, measure2);
return measure2;
}
// This method supposes what all custom fonts already loaded.
// If some font will be loaded after this method call, <textPath> will not be rendered correctly.
// You need to call this method manually to update glyphs cache.
setTextData(ctx) {
if (this.glyphInfo) {
return;
}
var renderText = this.getText();
var chars2 = renderText.split("");
var spacesNumber = renderText.split(" ").length - 1;
var dx = this.parent.getAttribute("dx").split().map((_24) => _24.getPixels("x"));
var dy = this.parent.getAttribute("dy").getPixels("y");
var anchor = this.parent.getStyle("text-anchor").getString("start");
var thisSpacing = this.getStyle("letter-spacing");
var parentSpacing = this.parent.getStyle("letter-spacing");
var letterSpacing2 = 0;
if (!thisSpacing.hasValue() || thisSpacing.getValue() === "inherit") {
letterSpacing2 = parentSpacing.getPixels();
} else if (thisSpacing.hasValue()) {
if (thisSpacing.getValue() !== "initial" && thisSpacing.getValue() !== "unset") {
letterSpacing2 = thisSpacing.getPixels();
}
}
var letterSpacingCache = [];
var textLen = renderText.length;
this.letterSpacingCache = letterSpacingCache;
for (var i2 = 0; i2 < textLen; i2++) {
letterSpacingCache.push(typeof dx[i2] !== "undefined" ? dx[i2] : letterSpacing2);
}
var dxSum = letterSpacingCache.reduce((acc, cur, i3) => i3 === 0 ? 0 : acc + cur || 0, 0);
var textWidth = this.measureText(ctx);
var textFullWidth = Math.max(textWidth + dxSum, 0);
this.textWidth = textWidth;
this.textHeight = this.getFontSize();
this.glyphInfo = [];
var fullPathWidth = this.getPathLength();
var startOffset = this.getStyle("startOffset").getNumber(0) * fullPathWidth;
var offset2 = 0;
if (anchor === "middle" || anchor === "center") {
offset2 = -textFullWidth / 2;
}
if (anchor === "end" || anchor === "right") {
offset2 = -textFullWidth;
}
offset2 += startOffset;
chars2.forEach((char2, i3) => {
var {
offset: nextOffset,
segment,
rotation: rotation2
} = this.findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, offset2, dy, char2, i3);
offset2 = nextOffset;
if (!segment.p0 || !segment.p1) {
return;
}
this.glyphInfo.push({
// transposeX: midpoint.x,
// transposeY: midpoint.y,
text: chars2[i3],
p0: segment.p0,
p1: segment.p1,
rotation: rotation2
});
});
}
parsePathData(path2) {
this.pathLength = -1;
if (!path2) {
return [];
}
var pathCommands = [];
var {
pathParser
} = path2;
pathParser.reset();
while (!pathParser.isEnd()) {
var {
current
} = pathParser;
var startX = current ? current.x : 0;
var startY = current ? current.y : 0;
var command = pathParser.next();
var nextCommandType = command.type;
var points2 = [];
switch (command.type) {
case PathParser.MOVE_TO:
this.pathM(pathParser, points2);
break;
case PathParser.LINE_TO:
nextCommandType = this.pathL(pathParser, points2);
break;
case PathParser.HORIZ_LINE_TO:
nextCommandType = this.pathH(pathParser, points2);
break;
case PathParser.VERT_LINE_TO:
nextCommandType = this.pathV(pathParser, points2);
break;
case PathParser.CURVE_TO:
this.pathC(pathParser, points2);
break;
case PathParser.SMOOTH_CURVE_TO:
nextCommandType = this.pathS(pathParser, points2);
break;
case PathParser.QUAD_TO:
this.pathQ(pathParser, points2);
break;
case PathParser.SMOOTH_QUAD_TO:
nextCommandType = this.pathT(pathParser, points2);
break;
case PathParser.ARC:
points2 = this.pathA(pathParser);
break;
case PathParser.CLOSE_PATH:
PathElement.pathZ(pathParser);
break;
}
if (command.type !== PathParser.CLOSE_PATH) {
pathCommands.push({
type: nextCommandType,
points: points2,
start: {
x: startX,
y: startY
},
pathLength: this.calcLength(startX, startY, nextCommandType, points2)
});
} else {
pathCommands.push({
type: PathParser.CLOSE_PATH,
points: [],
pathLength: 0
});
}
}
return pathCommands;
}
pathM(pathParser, points2) {
var {
x: x2,
y: y2
} = PathElement.pathM(pathParser).point;
points2.push(x2, y2);
}
pathL(pathParser, points2) {
var {
x: x2,
y: y2
} = PathElement.pathL(pathParser).point;
points2.push(x2, y2);
return PathParser.LINE_TO;
}
pathH(pathParser, points2) {
var {
x: x2,
y: y2
} = PathElement.pathH(pathParser).point;
points2.push(x2, y2);
return PathParser.LINE_TO;
}
pathV(pathParser, points2) {
var {
x: x2,
y: y2
} = PathElement.pathV(pathParser).point;
points2.push(x2, y2);
return PathParser.LINE_TO;
}
pathC(pathParser, points2) {
var {
point: point2,
controlPoint,
currentPoint
} = PathElement.pathC(pathParser);
points2.push(point2.x, point2.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
pathS(pathParser, points2) {
var {
point: point2,
controlPoint,
currentPoint
} = PathElement.pathS(pathParser);
points2.push(point2.x, point2.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
return PathParser.CURVE_TO;
}
pathQ(pathParser, points2) {
var {
controlPoint,
currentPoint
} = PathElement.pathQ(pathParser);
points2.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
}
pathT(pathParser, points2) {
var {
controlPoint,
currentPoint
} = PathElement.pathT(pathParser);
points2.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
return PathParser.QUAD_TO;
}
pathA(pathParser) {
var {
rX,
rY,
sweepFlag,
xAxisRotation,
centp,
a1,
ad: ad2
} = PathElement.pathA(pathParser);
if (sweepFlag === 0 && ad2 > 0) {
ad2 -= 2 * Math.PI;
}
if (sweepFlag === 1 && ad2 < 0) {
ad2 += 2 * Math.PI;
}
return [centp.x, centp.y, rX, rY, a1, ad2, xAxisRotation, sweepFlag];
}
calcLength(x2, y2, commandType, points2) {
var len = 0;
var p1 = null;
var p2 = null;
var t5 = 0;
switch (commandType) {
case PathParser.LINE_TO:
return this.getLineLength(x2, y2, points2[0], points2[1]);
case PathParser.CURVE_TO:
len = 0;
p1 = this.getPointOnCubicBezier(0, x2, y2, points2[0], points2[1], points2[2], points2[3], points2[4], points2[5]);
for (t5 = 0.01; t5 <= 1; t5 += 0.01) {
p2 = this.getPointOnCubicBezier(t5, x2, y2, points2[0], points2[1], points2[2], points2[3], points2[4], points2[5]);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
return len;
case PathParser.QUAD_TO:
len = 0;
p1 = this.getPointOnQuadraticBezier(0, x2, y2, points2[0], points2[1], points2[2], points2[3]);
for (t5 = 0.01; t5 <= 1; t5 += 0.01) {
p2 = this.getPointOnQuadraticBezier(t5, x2, y2, points2[0], points2[1], points2[2], points2[3]);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
return len;
case PathParser.ARC: {
len = 0;
var start2 = points2[4];
var dTheta = points2[5];
var end2 = points2[4] + dTheta;
var inc = Math.PI / 180;
if (Math.abs(start2 - end2) < inc) {
inc = Math.abs(start2 - end2);
}
p1 = this.getPointOnEllipticalArc(points2[0], points2[1], points2[2], points2[3], start2, 0);
if (dTheta < 0) {
for (t5 = start2 - inc; t5 > end2; t5 -= inc) {
p2 = this.getPointOnEllipticalArc(points2[0], points2[1], points2[2], points2[3], t5, 0);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
} else {
for (t5 = start2 + inc; t5 < end2; t5 += inc) {
p2 = this.getPointOnEllipticalArc(points2[0], points2[1], points2[2], points2[3], t5, 0);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
p1 = p2;
}
}
p2 = this.getPointOnEllipticalArc(points2[0], points2[1], points2[2], points2[3], end2, 0);
len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
return len;
}
}
return 0;
}
getPointOnLine(dist2, p1x, p1y, p2x, p2y) {
var fromX = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : p1x;
var fromY = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : p1y;
var m2 = (p2y - p1y) / (p2x - p1x + PSEUDO_ZERO);
var run2 = Math.sqrt(dist2 * dist2 / (1 + m2 * m2));
if (p2x < p1x) {
run2 *= -1;
}
var rise = m2 * run2;
var pt2 = null;
if (p2x === p1x) {
pt2 = {
x: fromX,
y: fromY + rise
};
} else if ((fromY - p1y) / (fromX - p1x + PSEUDO_ZERO) === m2) {
pt2 = {
x: fromX + run2,
y: fromY + rise
};
} else {
var ix = 0;
var iy = 0;
var len = this.getLineLength(p1x, p1y, p2x, p2y);
if (len < PSEUDO_ZERO) {
return null;
}
var u2 = (fromX - p1x) * (p2x - p1x) + (fromY - p1y) * (p2y - p1y);
u2 /= len * len;
ix = p1x + u2 * (p2x - p1x);
iy = p1y + u2 * (p2y - p1y);
var pRise = this.getLineLength(fromX, fromY, ix, iy);
var pRun = Math.sqrt(dist2 * dist2 - pRise * pRise);
run2 = Math.sqrt(pRun * pRun / (1 + m2 * m2));
if (p2x < p1x) {
run2 *= -1;
}
rise = m2 * run2;
pt2 = {
x: ix + run2,
y: iy + rise
};
}
return pt2;
}
getPointOnPath(distance2) {
var fullLen = this.getPathLength();
var cumulativePathLength = 0;
var p2 = null;
if (distance2 < -5e-5 || distance2 - 5e-5 > fullLen) {
return null;
}
var {
dataArray
} = this;
for (var command of dataArray) {
if (command && (command.pathLength < 5e-5 || cumulativePathLength + command.pathLength + 5e-5 < distance2)) {
cumulativePathLength += command.pathLength;
continue;
}
var delta = distance2 - cumulativePathLength;
var currentT = 0;
switch (command.type) {
case PathParser.LINE_TO:
p2 = this.getPointOnLine(delta, command.start.x, command.start.y, command.points[0], command.points[1], command.start.x, command.start.y);
break;
case PathParser.ARC: {
var start2 = command.points[4];
var dTheta = command.points[5];
var end2 = command.points[4] + dTheta;
currentT = start2 + delta / command.pathLength * dTheta;
if (dTheta < 0 && currentT < end2 || dTheta >= 0 && currentT > end2) {
break;
}
p2 = this.getPointOnEllipticalArc(command.points[0], command.points[1], command.points[2], command.points[3], currentT, command.points[6]);
break;
}
case PathParser.CURVE_TO:
currentT = delta / command.pathLength;
if (currentT > 1) {
currentT = 1;
}
p2 = this.getPointOnCubicBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3], command.points[4], command.points[5]);
break;
case PathParser.QUAD_TO:
currentT = delta / command.pathLength;
if (currentT > 1) {
currentT = 1;
}
p2 = this.getPointOnQuadraticBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3]);
break;
}
if (p2) {
return p2;
}
break;
}
return null;
}
getLineLength(x12, y12, x2, y2) {
return Math.sqrt((x2 - x12) * (x2 - x12) + (y2 - y12) * (y2 - y12));
}
getPathLength() {
if (this.pathLength === -1) {
this.pathLength = this.dataArray.reduce((length2, command) => command.pathLength > 0 ? length2 + command.pathLength : length2, 0);
}
return this.pathLength;
}
getPointOnCubicBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y) {
var x2 = p4x * CB1(pct) + p3x * CB2(pct) + p2x * CB3(pct) + p1x * CB4(pct);
var y2 = p4y * CB1(pct) + p3y * CB2(pct) + p2y * CB3(pct) + p1y * CB4(pct);
return {
x: x2,
y: y2
};
}
getPointOnQuadraticBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y) {
var x2 = p3x * QB1(pct) + p2x * QB2(pct) + p1x * QB3(pct);
var y2 = p3y * QB1(pct) + p2y * QB2(pct) + p1y * QB3(pct);
return {
x: x2,
y: y2
};
}
getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
var cosPsi = Math.cos(psi);
var sinPsi = Math.sin(psi);
var pt2 = {
x: rx * Math.cos(theta),
y: ry * Math.sin(theta)
};
return {
x: cx + (pt2.x * cosPsi - pt2.y * sinPsi),
y: cy + (pt2.x * sinPsi + pt2.y * cosPsi)
};
}
// TODO need some optimisations. possibly build cache only for curved segments?
buildEquidistantCache(inputStep, inputPrecision) {
var fullLen = this.getPathLength();
var precision = inputPrecision || 0.25;
var step = inputStep || fullLen / 100;
if (!this.equidistantCache || this.equidistantCache.step !== step || this.equidistantCache.precision !== precision) {
this.equidistantCache = {
step,
precision,
points: []
};
var s2 = 0;
for (var l2 = 0; l2 <= fullLen; l2 += precision) {
var p02 = this.getPointOnPath(l2);
var p1 = this.getPointOnPath(l2 + precision);
if (!p02 || !p1) {
continue;
}
s2 += this.getLineLength(p02.x, p02.y, p1.x, p1.y);
if (s2 >= step) {
this.equidistantCache.points.push({
x: p02.x,
y: p02.y,
distance: l2
});
s2 -= step;
}
}
}
}
getEquidistantPointOnPath(targetDistance, step, precision) {
this.buildEquidistantCache(step, precision);
if (targetDistance < 0 || targetDistance - this.getPathLength() > 5e-5) {
return null;
}
var idx = Math.round(targetDistance / this.getPathLength() * (this.equidistantCache.points.length - 1));
return this.equidistantCache.points[idx] || null;
}
}
var dataUriRegex = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;
class ImageElement extends RenderedElement {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "image";
this.loaded = false;
var href2 = this.getHrefAttribute().getString();
if (!href2) {
return;
}
var isSvg = href2.endsWith(".svg") || /^\s*data:image\/svg\+xml/i.test(href2);
document2.images.push(this);
if (!isSvg) {
void this.loadImage(href2);
} else {
void this.loadSvg(href2);
}
this.isSvg = isSvg;
}
loadImage(href2) {
var _this = this;
return _asyncToGenerator(function* () {
try {
var image2 = yield _this.document.createImage(href2);
_this.image = image2;
} catch (err) {
console.error('Error while loading image "'.concat(href2, '":'), err);
}
_this.loaded = true;
})();
}
loadSvg(href2) {
var _this2 = this;
return _asyncToGenerator(function* () {
var match2 = dataUriRegex.exec(href2);
if (match2) {
var data2 = match2[5];
if (match2[4] === "base64") {
_this2.image = atob(data2);
} else {
_this2.image = decodeURIComponent(data2);
}
} else {
try {
var response = yield _this2.document.fetch(href2);
var svg2 = yield response.text();
_this2.image = svg2;
} catch (err) {
console.error('Error while loading image "'.concat(href2, '":'), err);
}
}
_this2.loaded = true;
})();
}
renderChildren(ctx) {
var {
document: document2,
image: image2,
loaded
} = this;
var x2 = this.getAttribute("x").getPixels("x");
var y2 = this.getAttribute("y").getPixels("y");
var width2 = this.getStyle("width").getPixels("x");
var height2 = this.getStyle("height").getPixels("y");
if (!loaded || !image2 || !width2 || !height2) {
return;
}
ctx.save();
ctx.translate(x2, y2);
if (this.isSvg) {
var subDocument = document2.canvg.forkString(ctx, this.image, {
ignoreMouse: true,
ignoreAnimation: true,
ignoreDimensions: true,
ignoreClear: true,
offsetX: 0,
offsetY: 0,
scaleWidth: width2,
scaleHeight: height2
});
subDocument.document.documentElement.parent = this;
void subDocument.render();
} else {
var _image = this.image;
document2.setViewBox({
ctx,
aspectRatio: this.getAttribute("preserveAspectRatio").getString(),
width: width2,
desiredWidth: _image.width,
height: height2,
desiredHeight: _image.height
});
if (this.loaded) {
if (typeof _image.complete === "undefined" || _image.complete) {
ctx.drawImage(_image, 0, 0);
}
}
}
ctx.restore();
}
getBoundingBox() {
var x2 = this.getAttribute("x").getPixels("x");
var y2 = this.getAttribute("y").getPixels("y");
var width2 = this.getStyle("width").getPixels("x");
var height2 = this.getStyle("height").getPixels("y");
return new BoundingBox(x2, y2, x2 + width2, y2 + height2);
}
}
class SymbolElement extends RenderedElement {
constructor() {
super(...arguments);
this.type = "symbol";
}
render(_24) {
}
}
class SVGFontLoader {
constructor(document2) {
this.document = document2;
this.loaded = false;
document2.fonts.push(this);
}
load(fontFamily2, url2) {
var _this = this;
return _asyncToGenerator(function* () {
try {
var {
document: document2
} = _this;
var svgDocument = yield document2.canvg.parser.load(url2);
var fonts = svgDocument.getElementsByTagName("font");
Array.from(fonts).forEach((fontNode) => {
var font2 = document2.createElement(fontNode);
document2.definitions[fontFamily2] = font2;
});
} catch (err) {
console.error('Error while loading font "'.concat(url2, '":'), err);
}
_this.loaded = true;
})();
}
}
class StyleElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "style";
var css4 = compressSpaces(
Array.from(node2.childNodes).map((_24) => _24.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, "").replace(/@import.*;/g, "")
// remove imports
);
var cssDefs = css4.split("}");
cssDefs.forEach((_24) => {
var def2 = _24.trim();
if (!def2) {
return;
}
var cssParts = def2.split("{");
var cssClasses = cssParts[0].split(",");
var cssProps = cssParts[1].split(";");
cssClasses.forEach((_25) => {
var cssClass2 = _25.trim();
if (!cssClass2) {
return;
}
var props = document2.styles[cssClass2] || {};
cssProps.forEach((cssProp) => {
var prop = cssProp.indexOf(":");
var name = cssProp.substr(0, prop).trim();
var value2 = cssProp.substr(prop + 1, cssProp.length - prop).trim();
if (name && value2) {
props[name] = new Property(document2, name, value2);
}
});
document2.styles[cssClass2] = props;
document2.stylesSpecificity[cssClass2] = getSelectorSpecificity(cssClass2);
if (cssClass2 === "@font-face") {
var fontFamily2 = props["font-family"].getString().replace(/"|'/g, "");
var srcs = props.src.getString().split(",");
srcs.forEach((src) => {
if (src.indexOf('format("svg")') > 0) {
var url2 = parseExternalUrl(src);
if (url2) {
void new SVGFontLoader(document2).load(fontFamily2, url2);
}
}
});
}
});
});
}
}
StyleElement.parseExternalUrl = parseExternalUrl;
class UseElement extends RenderedElement {
constructor() {
super(...arguments);
this.type = "use";
}
setContext(ctx) {
super.setContext(ctx);
var xAttr = this.getAttribute("x");
var yAttr = this.getAttribute("y");
if (xAttr.hasValue()) {
ctx.translate(xAttr.getPixels("x"), 0);
}
if (yAttr.hasValue()) {
ctx.translate(0, yAttr.getPixels("y"));
}
}
path(ctx) {
var {
element: element2
} = this;
if (element2) {
element2.path(ctx);
}
}
renderChildren(ctx) {
var {
document: document2,
element: element2
} = this;
if (element2) {
var tempSvg = element2;
if (element2.type === "symbol") {
tempSvg = new SVGElement(document2, null);
tempSvg.attributes.viewBox = new Property(document2, "viewBox", element2.getAttribute("viewBox").getString());
tempSvg.attributes.preserveAspectRatio = new Property(document2, "preserveAspectRatio", element2.getAttribute("preserveAspectRatio").getString());
tempSvg.attributes.overflow = new Property(document2, "overflow", element2.getAttribute("overflow").getString());
tempSvg.children = element2.children;
element2.styles.opacity = new Property(document2, "opacity", this.calculateOpacity());
}
if (tempSvg.type === "svg") {
var widthStyle = this.getStyle("width", false, true);
var heightStyle = this.getStyle("height", false, true);
if (widthStyle.hasValue()) {
tempSvg.attributes.width = new Property(document2, "width", widthStyle.getString());
}
if (heightStyle.hasValue()) {
tempSvg.attributes.height = new Property(document2, "height", heightStyle.getString());
}
}
var oldParent = tempSvg.parent;
tempSvg.parent = this;
tempSvg.render(ctx);
tempSvg.parent = oldParent;
}
}
getBoundingBox(ctx) {
var {
element: element2
} = this;
if (element2) {
return element2.getBoundingBox(ctx);
}
return null;
}
elementTransform() {
var {
document: document2,
element: element2
} = this;
return Transform.fromElement(document2, element2);
}
get element() {
if (!this.cachedElement) {
this.cachedElement = this.getHrefAttribute().getDefinition();
}
return this.cachedElement;
}
}
function imGet(img, x2, y2, width2, _height, rgba2) {
return img[y2 * width2 * 4 + x2 * 4 + rgba2];
}
function imSet(img, x2, y2, width2, _height, rgba2, val) {
img[y2 * width2 * 4 + x2 * 4 + rgba2] = val;
}
function m$e(matrix2, i2, v2) {
var mi2 = matrix2[i2];
return mi2 * v2;
}
function c(a2, m1, m2, m3) {
return m1 + Math.cos(a2) * m2 + Math.sin(a2) * m3;
}
class FeColorMatrixElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "feColorMatrix";
var matrix2 = toNumbers(this.getAttribute("values").getString());
switch (this.getAttribute("type").getString("matrix")) {
case "saturate": {
var s2 = matrix2[0];
matrix2 = [0.213 + 0.787 * s2, 0.715 - 0.715 * s2, 0.072 - 0.072 * s2, 0, 0, 0.213 - 0.213 * s2, 0.715 + 0.285 * s2, 0.072 - 0.072 * s2, 0, 0, 0.213 - 0.213 * s2, 0.715 - 0.715 * s2, 0.072 + 0.928 * s2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
break;
}
case "hueRotate": {
var a2 = matrix2[0] * Math.PI / 180;
matrix2 = [c(a2, 0.213, 0.787, -0.213), c(a2, 0.715, -0.715, -0.715), c(a2, 0.072, -0.072, 0.928), 0, 0, c(a2, 0.213, -0.213, 0.143), c(a2, 0.715, 0.285, 0.14), c(a2, 0.072, -0.072, -0.283), 0, 0, c(a2, 0.213, -0.213, -0.787), c(a2, 0.715, -0.715, 0.715), c(a2, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
break;
}
case "luminanceToAlpha":
matrix2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
break;
}
this.matrix = matrix2;
this.includeOpacity = this.getAttribute("includeOpacity").hasValue();
}
apply(ctx, _x, _y, width2, height2) {
var {
includeOpacity,
matrix: matrix2
} = this;
var srcData = ctx.getImageData(0, 0, width2, height2);
for (var y2 = 0; y2 < height2; y2++) {
for (var x2 = 0; x2 < width2; x2++) {
var r2 = imGet(srcData.data, x2, y2, width2, height2, 0);
var g2 = imGet(srcData.data, x2, y2, width2, height2, 1);
var b2 = imGet(srcData.data, x2, y2, width2, height2, 2);
var a2 = imGet(srcData.data, x2, y2, width2, height2, 3);
var nr2 = m$e(matrix2, 0, r2) + m$e(matrix2, 1, g2) + m$e(matrix2, 2, b2) + m$e(matrix2, 3, a2) + m$e(matrix2, 4, 1);
var ng2 = m$e(matrix2, 5, r2) + m$e(matrix2, 6, g2) + m$e(matrix2, 7, b2) + m$e(matrix2, 8, a2) + m$e(matrix2, 9, 1);
var nb2 = m$e(matrix2, 10, r2) + m$e(matrix2, 11, g2) + m$e(matrix2, 12, b2) + m$e(matrix2, 13, a2) + m$e(matrix2, 14, 1);
var na2 = m$e(matrix2, 15, r2) + m$e(matrix2, 16, g2) + m$e(matrix2, 17, b2) + m$e(matrix2, 18, a2) + m$e(matrix2, 19, 1);
if (includeOpacity) {
nr2 = 0;
ng2 = 0;
nb2 = 0;
na2 *= a2 / 255;
}
imSet(srcData.data, x2, y2, width2, height2, 0, nr2);
imSet(srcData.data, x2, y2, width2, height2, 1, ng2);
imSet(srcData.data, x2, y2, width2, height2, 2, nb2);
imSet(srcData.data, x2, y2, width2, height2, 3, na2);
}
}
ctx.clearRect(0, 0, width2, height2);
ctx.putImageData(srcData, 0, 0);
}
}
class MaskElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "mask";
}
apply(ctx, element2) {
var {
document: document2
} = this;
var x2 = this.getAttribute("x").getPixels("x");
var y2 = this.getAttribute("y").getPixels("y");
var width2 = this.getStyle("width").getPixels("x");
var height2 = this.getStyle("height").getPixels("y");
if (!width2 && !height2) {
var boundingBox = new BoundingBox();
this.children.forEach((child) => {
boundingBox.addBoundingBox(child.getBoundingBox(ctx));
});
x2 = Math.floor(boundingBox.x1);
y2 = Math.floor(boundingBox.y1);
width2 = Math.floor(boundingBox.width);
height2 = Math.floor(boundingBox.height);
}
var ignoredStyles = this.removeStyles(element2, MaskElement.ignoreStyles);
var maskCanvas = document2.createCanvas(x2 + width2, y2 + height2);
var maskCtx = maskCanvas.getContext("2d");
document2.screen.setDefaults(maskCtx);
this.renderChildren(maskCtx);
new FeColorMatrixElement(document2, {
nodeType: 1,
childNodes: [],
attributes: [{
nodeName: "type",
value: "luminanceToAlpha"
}, {
nodeName: "includeOpacity",
value: "true"
}]
}).apply(maskCtx, 0, 0, x2 + width2, y2 + height2);
var tmpCanvas = document2.createCanvas(x2 + width2, y2 + height2);
var tmpCtx = tmpCanvas.getContext("2d");
document2.screen.setDefaults(tmpCtx);
element2.render(tmpCtx);
tmpCtx.globalCompositeOperation = "destination-in";
tmpCtx.fillStyle = maskCtx.createPattern(maskCanvas, "no-repeat");
tmpCtx.fillRect(0, 0, x2 + width2, y2 + height2);
ctx.fillStyle = tmpCtx.createPattern(tmpCanvas, "no-repeat");
ctx.fillRect(0, 0, x2 + width2, y2 + height2);
this.restoreStyles(element2, ignoredStyles);
}
render(_24) {
}
}
MaskElement.ignoreStyles = ["mask", "transform", "clip-path"];
var noop2 = () => {
};
class ClipPathElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "clipPath";
}
apply(ctx) {
var {
document: document2
} = this;
var contextProto = Reflect.getPrototypeOf(ctx);
var {
beginPath,
closePath
} = ctx;
if (contextProto) {
contextProto.beginPath = noop2;
contextProto.closePath = noop2;
}
Reflect.apply(beginPath, ctx, []);
this.children.forEach((child) => {
if (typeof child.path === "undefined") {
return;
}
var transform2 = typeof child.elementTransform !== "undefined" ? child.elementTransform() : null;
if (!transform2) {
transform2 = Transform.fromElement(document2, child);
}
if (transform2) {
transform2.apply(ctx);
}
child.path(ctx);
if (contextProto) {
contextProto.closePath = closePath;
}
if (transform2) {
transform2.unapply(ctx);
}
});
Reflect.apply(closePath, ctx, []);
ctx.clip();
if (contextProto) {
contextProto.beginPath = beginPath;
contextProto.closePath = closePath;
}
}
render(_24) {
}
}
class FilterElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "filter";
}
apply(ctx, element2) {
var {
document: document2,
children: children2
} = this;
var boundingBox = element2.getBoundingBox(ctx);
if (!boundingBox) {
return;
}
var px2 = 0;
var py2 = 0;
children2.forEach((child) => {
var efd = child.extraFilterDistance || 0;
px2 = Math.max(px2, efd);
py2 = Math.max(py2, efd);
});
var width2 = Math.floor(boundingBox.width);
var height2 = Math.floor(boundingBox.height);
var tmpCanvasWidth = width2 + 2 * px2;
var tmpCanvasHeight = height2 + 2 * py2;
if (tmpCanvasWidth < 1 || tmpCanvasHeight < 1) {
return;
}
var x2 = Math.floor(boundingBox.x);
var y2 = Math.floor(boundingBox.y);
var ignoredStyles = this.removeStyles(element2, FilterElement.ignoreStyles);
var tmpCanvas = document2.createCanvas(tmpCanvasWidth, tmpCanvasHeight);
var tmpCtx = tmpCanvas.getContext("2d");
document2.screen.setDefaults(tmpCtx);
tmpCtx.translate(-x2 + px2, -y2 + py2);
element2.render(tmpCtx);
children2.forEach((child) => {
if (typeof child.apply === "function") {
child.apply(tmpCtx, 0, 0, tmpCanvasWidth, tmpCanvasHeight);
}
});
ctx.drawImage(tmpCanvas, 0, 0, tmpCanvasWidth, tmpCanvasHeight, x2 - px2, y2 - py2, tmpCanvasWidth, tmpCanvasHeight);
this.restoreStyles(element2, ignoredStyles);
}
render(_24) {
}
}
FilterElement.ignoreStyles = ["filter", "transform", "clip-path"];
class FeDropShadowElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "feDropShadow";
this.addStylesFromStyleDefinition();
}
apply(_24, _x, _y, _width, _height) {
}
}
class FeMorphologyElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "feMorphology";
}
apply(_24, _x, _y, _width, _height) {
}
}
class FeCompositeElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "feComposite";
}
apply(_24, _x, _y, _width, _height) {
}
}
class FeGaussianBlurElement extends Element$1 {
constructor(document2, node2, captureTextNodes) {
super(document2, node2, captureTextNodes);
this.type = "feGaussianBlur";
this.blurRadius = Math.floor(this.getAttribute("stdDeviation").getNumber());
this.extraFilterDistance = this.blurRadius;
}
apply(ctx, x2, y2, width2, height2) {
var {
document: document2,
blurRadius
} = this;
var body = document2.window ? document2.window.document.body : null;
var canvas = ctx.canvas;
canvas.id = document2.getUniqueId();
if (body) {
canvas.style.display = "none";
body.appendChild(canvas);
}
processCanvasRGBA(canvas, x2, y2, width2, height2, blurRadius);
if (body) {
body.removeChild(canvas);
}
}
}
class TitleElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "title";
}
}
class DescElement extends Element$1 {
constructor() {
super(...arguments);
this.type = "desc";
}
}
var elements = {
"svg": SVGElement,
"rect": RectElement,
"circle": CircleElement,
"ellipse": EllipseElement,
"line": LineElement,
"polyline": PolylineElement,
"polygon": PolygonElement,
"path": PathElement,
"pattern": PatternElement,
"marker": MarkerElement,
"defs": DefsElement,
"linearGradient": LinearGradientElement,
"radialGradient": RadialGradientElement,
"stop": StopElement,
"animate": AnimateElement,
"animateColor": AnimateColorElement,
"animateTransform": AnimateTransformElement,
"font": FontElement,
"font-face": FontFaceElement,
"missing-glyph": MissingGlyphElement,
"glyph": GlyphElement,
"text": TextElement,
"tspan": TSpanElement,
"tref": TRefElement,
"a": AElement,
"textPath": TextPathElement,
"image": ImageElement,
"g": GElement,
"symbol": SymbolElement,
"style": StyleElement,
"use": UseElement,
"mask": MaskElement,
"clipPath": ClipPathElement,
"filter": FilterElement,
"feDropShadow": FeDropShadowElement,
"feMorphology": FeMorphologyElement,
"feComposite": FeCompositeElement,
"feColorMatrix": FeColorMatrixElement,
"feGaussianBlur": FeGaussianBlurElement,
"title": TitleElement,
"desc": DescElement
};
function ownKeys$1(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread$1(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys$1(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys$1(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
function createCanvas(width2, height2) {
var canvas = document.createElement("canvas");
canvas.width = width2;
canvas.height = height2;
return canvas;
}
function createImage(_x) {
return _createImage.apply(this, arguments);
}
function _createImage() {
_createImage = _asyncToGenerator(function* (src) {
var anonymousCrossOrigin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var image2 = document.createElement("img");
if (anonymousCrossOrigin) {
image2.crossOrigin = "Anonymous";
}
return new Promise((resolve3, reject2) => {
image2.onload = () => {
resolve3(image2);
};
image2.onerror = (_event, _source, _lineno, _colno, error3) => {
reject2(error3);
};
image2.src = src;
});
});
return _createImage.apply(this, arguments);
}
class Document {
constructor(canvg) {
var {
rootEmSize = 12,
emSize = 12,
createCanvas: createCanvas2 = Document.createCanvas,
createImage: createImage2 = Document.createImage,
anonymousCrossOrigin
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
this.canvg = canvg;
this.definitions = {};
this.styles = {};
this.stylesSpecificity = {};
this.images = [];
this.fonts = [];
this.emSizeStack = [];
this.uniqueId = 0;
this.screen = canvg.screen;
this.rootEmSize = rootEmSize;
this.emSize = emSize;
this.createCanvas = createCanvas2;
this.createImage = this.bindCreateImage(createImage2, anonymousCrossOrigin);
this.screen.wait(this.isImagesLoaded.bind(this));
this.screen.wait(this.isFontsLoaded.bind(this));
}
bindCreateImage(createImage2, anonymousCrossOrigin) {
if (typeof anonymousCrossOrigin === "boolean") {
return (source2, forceAnonymousCrossOrigin) => createImage2(source2, typeof forceAnonymousCrossOrigin === "boolean" ? forceAnonymousCrossOrigin : anonymousCrossOrigin);
}
return createImage2;
}
get window() {
return this.screen.window;
}
get fetch() {
return this.screen.fetch;
}
get ctx() {
return this.screen.ctx;
}
get emSize() {
var {
emSizeStack
} = this;
return emSizeStack[emSizeStack.length - 1];
}
set emSize(value2) {
var {
emSizeStack
} = this;
emSizeStack.push(value2);
}
popEmSize() {
var {
emSizeStack
} = this;
emSizeStack.pop();
}
getUniqueId() {
return "canvg".concat(++this.uniqueId);
}
isImagesLoaded() {
return this.images.every((_24) => _24.loaded);
}
isFontsLoaded() {
return this.fonts.every((_24) => _24.loaded);
}
createDocumentElement(document2) {
var documentElement = this.createElement(document2.documentElement);
documentElement.root = true;
documentElement.addStylesFromStyleDefinition();
this.documentElement = documentElement;
return documentElement;
}
createElement(node2) {
var elementType = node2.nodeName.replace(/^[^:]+:/, "");
var ElementType = Document.elementTypes[elementType];
if (typeof ElementType !== "undefined") {
return new ElementType(this, node2);
}
return new UnknownElement(this, node2);
}
createTextNode(node2) {
return new TextNode(this, node2);
}
setViewBox(config2) {
this.screen.setViewBox(_objectSpread$1({
document: this
}, config2));
}
}
Document.createCanvas = createCanvas;
Document.createImage = createImage;
Document.elementTypes = elements;
function ownKeys2(object2, enumerableOnly) {
var keys3 = Object.keys(object2);
if (Object.getOwnPropertySymbols) {
var symbols2 = Object.getOwnPropertySymbols(object2);
if (enumerableOnly) {
symbols2 = symbols2.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
});
}
keys3.push.apply(keys3, symbols2);
}
return keys3;
}
function _objectSpread(target2) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source2 = arguments[i2] != null ? arguments[i2] : {};
if (i2 % 2) {
ownKeys2(Object(source2), true).forEach(function(key2) {
_defineProperty$3(target2, key2, source2[key2]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target2, Object.getOwnPropertyDescriptors(source2));
} else {
ownKeys2(Object(source2)).forEach(function(key2) {
Object.defineProperty(target2, key2, Object.getOwnPropertyDescriptor(source2, key2));
});
}
}
return target2;
}
class Canvg {
/**
* Main constructor.
* @param ctx - Rendering context.
* @param svg - SVG Document.
* @param options - Rendering options.
*/
constructor(ctx, svg2) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
this.parser = new Parser(options2);
this.screen = new Screen(ctx, options2);
this.options = options2;
var document2 = new Document(this, options2);
var documentElement = document2.createDocumentElement(svg2);
this.document = document2;
this.documentElement = documentElement;
}
/**
* Create Canvg instance from SVG source string or URL.
* @param ctx - Rendering context.
* @param svg - SVG source string or URL.
* @param options - Rendering options.
* @returns Canvg instance.
*/
static from(ctx, svg2) {
var _arguments = arguments;
return _asyncToGenerator(function* () {
var options2 = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
var parser2 = new Parser(options2);
var svgDocument = yield parser2.parse(svg2);
return new Canvg(ctx, svgDocument, options2);
})();
}
/**
* Create Canvg instance from SVG source string.
* @param ctx - Rendering context.
* @param svg - SVG source string.
* @param options - Rendering options.
* @returns Canvg instance.
*/
static fromString(ctx, svg2) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var parser2 = new Parser(options2);
var svgDocument = parser2.parseFromString(svg2);
return new Canvg(ctx, svgDocument, options2);
}
/**
* Create new Canvg instance with inherited options.
* @param ctx - Rendering context.
* @param svg - SVG source string or URL.
* @param options - Rendering options.
* @returns Canvg instance.
*/
fork(ctx, svg2) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return Canvg.from(ctx, svg2, _objectSpread(_objectSpread({}, this.options), options2));
}
/**
* Create new Canvg instance with inherited options.
* @param ctx - Rendering context.
* @param svg - SVG source string.
* @param options - Rendering options.
* @returns Canvg instance.
*/
forkString(ctx, svg2) {
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return Canvg.fromString(ctx, svg2, _objectSpread(_objectSpread({}, this.options), options2));
}
/**
* Document is ready promise.
* @returns Ready promise.
*/
ready() {
return this.screen.ready();
}
/**
* Document is ready value.
* @returns Is ready or not.
*/
isReady() {
return this.screen.isReady();
}
/**
* Render only first frame, ignoring animations and mouse.
* @param options - Rendering options.
*/
render() {
var _arguments2 = arguments, _this = this;
return _asyncToGenerator(function* () {
var options2 = _arguments2.length > 0 && _arguments2[0] !== void 0 ? _arguments2[0] : {};
_this.start(_objectSpread({
enableRedraw: true,
ignoreAnimation: true,
ignoreMouse: true
}, options2));
yield _this.ready();
_this.stop();
})();
}
/**
* Start rendering.
* @param options - Render options.
*/
start() {
var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var {
documentElement,
screen: screen2,
options: baseOptions
} = this;
screen2.start(documentElement, _objectSpread(_objectSpread({
enableRedraw: true
}, baseOptions), options2));
}
/**
* Stop rendering.
*/
stop() {
this.screen.stop();
}
/**
* Resize SVG to fit in given size.
* @param width
* @param height
* @param preserveAspectRatio
*/
resize(width2) {
var height2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : width2;
var preserveAspectRatio = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
this.documentElement.resize(width2, height2, preserveAspectRatio);
}
}
const index_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
AElement,
AnimateColorElement,
AnimateElement,
AnimateTransformElement,
BoundingBox,
CB1,
CB2,
CB3,
CB4,
Canvg,
CircleElement,
ClipPathElement,
DefsElement,
DescElement,
Document,
Element: Element$1,
EllipseElement,
FeColorMatrixElement,
FeCompositeElement,
FeDropShadowElement,
FeGaussianBlurElement,
FeMorphologyElement,
FilterElement,
Font,
FontElement,
FontFaceElement,
GElement,
GlyphElement,
GradientElement,
ImageElement,
LineElement,
LinearGradientElement,
MarkerElement,
MaskElement,
Matrix,
MissingGlyphElement,
Mouse,
PSEUDO_ZERO,
Parser,
PathElement,
PathParser,
PatternElement,
Point,
PolygonElement,
PolylineElement,
Property,
QB1,
QB2,
QB3,
RadialGradientElement,
RectElement,
RenderedElement,
Rotate,
SVGElement,
SVGFontLoader,
Scale,
Screen,
Skew,
SkewX,
SkewY,
StopElement,
StyleElement,
SymbolElement,
TRefElement,
TSpanElement,
TextElement,
TextPathElement,
TitleElement,
Transform,
Translate,
UnknownElement,
UseElement,
ViewPort,
compressSpaces,
default: Canvg,
getSelectorSpecificity,
normalizeAttributeName,
normalizeColor,
parseExternalUrl,
presets: index,
toNumbers,
trimLeft,
trimRight,
vectorMagnitude,
vectorsAngle,
vectorsRatio
}, Symbol.toStringTag, { value: "Module" }));
var t$j = "%x, %X", e$j = "%-d/%-m/%Y", d$h = "%-I:%M:%S %p", o$i = ["ص", "م"], s$d = ["الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"], a$j = ["أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"], r$j = ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], m$d = ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], p$1 = { dateTime: "%x, %X", date: "%-d/%-m/%Y", time: "%-I:%M:%S %p", periods: o$i, days: s$d, shortDays: a$j, months: r$j, shortMonths: m$d };
const arEG9493241f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: e$j,
dateTime: t$j,
days: s$d,
default: p$1,
months: r$j,
periods: o$i,
shortDays: a$j,
shortMonths: m$d,
time: d$h
}, Symbol.toStringTag, { value: "Module" }));
var e$i = "%x, %X", a$i = "%-m/%-d/%Y", r$i = "%-I:%M:%S %p", u$4 = ["AM", "PM"], d$g = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], t$i = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], y$1 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], o$h = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], n$6 = { dateTime: "%x, %X", date: "%-m/%-d/%Y", time: "%-I:%M:%S %p", periods: u$4, days: d$g, shortDays: t$i, months: y$1, shortMonths: o$h };
const enUS23d755af = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: a$i,
dateTime: e$i,
days: d$g,
default: n$6,
months: y$1,
periods: u$4,
shortDays: t$i,
shortMonths: o$h,
time: r$i
}, Symbol.toStringTag, { value: "Module" }));
var t$h = "%Y/%m/%d %a %X", d$f = "%Y/%m/%d", a$h = "%H:%M:%S", e$h = ["오전", "오후"], m$c = ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"], o$g = ["일", "월", "화", "수", "목", "금", "토"], s$c = ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], r$h = ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], h$3 = { dateTime: "%Y/%m/%d %a %X", date: "%Y/%m/%d", time: "%H:%M:%S", periods: e$h, days: m$c, shortDays: o$g, months: s$c, shortMonths: r$h };
const koKRBe318f61 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: d$f,
dateTime: t$h,
days: m$c,
default: h$3,
months: s$c,
periods: e$h,
shortDays: o$g,
shortMonths: r$h,
time: a$h
}, Symbol.toStringTag, { value: "Module" }));
var t$g = "%x %A %X", e$g = "%Y年%-m月%-d日", d$e = "%H:%M:%S", o$f = ["上午", "下午"], s$b = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], a$g = ["日", "一", "二", "三", "四", "五", "六"], r$g = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], m$b = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], h$2 = { dateTime: "%x %A %X", date: "%Y年%-m月%-d日", time: "%H:%M:%S", periods: o$f, days: s$b, shortDays: a$g, months: r$g, shortMonths: m$b };
const zhTW621da244 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: e$g,
dateTime: t$g,
days: s$b,
default: h$2,
months: r$g,
periods: o$f,
shortDays: a$g,
shortMonths: m$b,
time: d$e
}, Symbol.toStringTag, { value: "Module" }));
var e$f = "%A,%e.%B %Y, %X", t$f = "%-d.%-m.%Y", o$e = "%H:%M:%S", r$f = ["AM", "PM"], s$a = ["neděle", "pondělí", "úterý", "středa", "čvrtek", "pátek", "sobota"], n$5 = ["ne.", "po.", "út.", "st.", "čt.", "pá.", "so."], d$d = ["leden", "únor", "březen", "duben", "květen", "červen", "červenec", "srpen", "září", "říjen", "listopad", "prosinec"], p = ["led", "úno", "břez", "dub", "kvě", "čer", "červ", "srp", "zář", "říj", "list", "pros"], a$f = { dateTime: "%A,%e.%B %Y, %X", date: "%-d.%-m.%Y", time: "%H:%M:%S", periods: r$f, days: s$a, shortDays: n$5, months: d$d, shortMonths: p };
const csCZ30efb375 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: t$f,
dateTime: e$f,
days: s$a,
default: a$f,
months: d$d,
periods: r$f,
shortDays: n$5,
shortMonths: p,
time: o$e
}, Symbol.toStringTag, { value: "Module" }));
var e$e = "%A, der %e. %B %Y, %X", r$e = "%d.%m.%Y", t$e = "%H:%M:%S", a$e = ["AM", "PM"], o$d = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], i$8 = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], M$4 = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], n$4 = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], s$9 = { dateTime: "%A, der %e. %B %Y, %X", date: "%d.%m.%Y", time: "%H:%M:%S", periods: a$e, days: o$d, shortDays: i$8, months: M$4, shortMonths: n$4 };
const deDEA0091fbc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: r$e,
dateTime: e$e,
days: o$d,
default: s$9,
months: M$4,
periods: a$e,
shortDays: i$8,
shortMonths: n$4,
time: t$e
}, Symbol.toStringTag, { value: "Module" }));
var e$d = "%a %e %b %X %Y", a$d = "%d/%m/%Y", r$d = "%H:%M:%S", u$3 = ["AM", "PM"], d$c = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], t$d = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], y = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], o$c = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], n$3 = { dateTime: "%a %e %b %X %Y", date: "%d/%m/%Y", time: "%H:%M:%S", periods: u$3, days: d$c, shortDays: t$d, months: y, shortMonths: o$c };
const enGBC19b7b16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: a$d,
dateTime: e$d,
days: d$c,
default: n$3,
months: y,
periods: u$3,
shortDays: t$d,
shortMonths: o$c,
time: r$d
}, Symbol.toStringTag, { value: "Module" }));
var e$c = "%x, %X", o$b = "%d/%m/%Y", r$c = "%-I:%M:%S %p", m$a = ["AM", "PM"], a$c = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], s$8 = ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"], i$7 = ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], t$c = ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"], d$b = { dateTime: "%x, %X", date: "%d/%m/%Y", time: "%-I:%M:%S %p", periods: m$a, days: a$c, shortDays: s$8, months: i$7, shortMonths: t$c };
const esMXD306ac47 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: o$b,
dateTime: e$c,
days: a$c,
default: d$b,
months: i$7,
periods: m$a,
shortDays: s$8,
shortMonths: t$c,
time: r$c
}, Symbol.toStringTag, { value: "Module" }));
var e$b = "%A, %e de %B de %Y, %X", o$a = "%d/%m/%Y", r$b = "%H:%M:%S", m$9 = ["AM", "PM"], a$b = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], s$7 = ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"], d$a = ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], i$6 = ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"], t$b = { dateTime: "%A, %e de %B de %Y, %X", date: "%d/%m/%Y", time: "%H:%M:%S", periods: m$9, days: a$b, shortDays: s$7, months: d$a, shortMonths: i$6 };
const esESAd876f76 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: o$a,
dateTime: e$b,
days: a$b,
default: t$b,
months: d$a,
periods: m$9,
shortDays: s$7,
shortMonths: i$6,
time: r$b
}, Symbol.toStringTag, { value: "Module" }));
var e$a = "%a %e %b %Y %X", a$a = "%Y-%m-%d", r$a = "%H:%M:%S", m$8 = ["", ""], i$5 = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], d$9 = ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"], t$a = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], o$9 = ["jan", "fév", "mar", "avr", "mai", "jui", "jul", "aoû", "sep", "oct", "nov", "déc"], n$2 = { dateTime: "%a %e %b %Y %X", date: "%Y-%m-%d", time: "%H:%M:%S", periods: m$8, days: i$5, shortDays: d$9, months: t$a, shortMonths: o$9 };
const frCAAa5f7683 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: a$a,
dateTime: e$a,
days: i$5,
default: n$2,
months: t$a,
periods: m$8,
shortDays: d$9,
shortMonths: o$9,
time: r$a
}, Symbol.toStringTag, { value: "Module" }));
var e$9 = "%A %e %B %Y à %X", r$9 = "%d/%m/%Y", a$9 = "%H:%M:%S", i$4 = ["AM", "PM"], m$7 = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], d$8 = ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."], t$9 = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], o$8 = ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], n$1 = { dateTime: "%A %e %B %Y à %X", date: "%d/%m/%Y", time: "%H:%M:%S", periods: i$4, days: m$7, shortDays: d$8, months: t$9, shortMonths: o$8 };
const frFRDe084dfd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: r$9,
dateTime: e$9,
days: m$7,
default: n$1,
months: t$9,
periods: i$4,
shortDays: d$8,
shortMonths: o$8,
time: a$9
}, Symbol.toStringTag, { value: "Module" }));
var e$8 = "%Y. %B %-e., %A %X", s$6 = "%Y. %m. %d.", r$8 = "%H:%M:%S", t$8 = ["de.", "du."], a$8 = ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"], d$7 = ["V", "H", "K", "Sze", "Cs", "P", "Szo"], m$6 = ["január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"], o$7 = ["jan.", "feb.", "már.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec."], u$2 = { dateTime: "%Y. %B %-e., %A %X", date: "%Y. %m. %d.", time: "%H:%M:%S", periods: t$8, days: a$8, shortDays: d$7, months: m$6, shortMonths: o$7 };
const huHU5b8b0299 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: s$6,
dateTime: e$8,
days: a$8,
default: u$2,
months: m$6,
periods: t$8,
shortDays: d$7,
shortMonths: o$7,
time: r$8
}, Symbol.toStringTag, { value: "Module" }));
var e$7 = "%A %e %B %Y, %X", o$6 = "%d/%m/%Y", r$7 = "%H:%M:%S", t$7 = ["AM", "PM"], a$7 = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], i$3 = ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], M$3 = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], d$6 = ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], n = { dateTime: "%A %e %B %Y, %X", date: "%d/%m/%Y", time: "%H:%M:%S", periods: t$7, days: a$7, shortDays: i$3, months: M$3, shortMonths: d$6 };
const itIT7aecce64 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: o$6,
dateTime: e$7,
days: a$7,
default: n,
months: M$3,
periods: t$7,
shortDays: i$3,
shortMonths: d$6,
time: r$7
}, Symbol.toStringTag, { value: "Module" }));
var t$6 = "%x %a %X", a$6 = "%Y/%m/%d", e$6 = "%H:%M:%S", d$5 = ["AM", "PM"], o$5 = ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], s$5 = ["日", "月", "火", "水", "木", "金", "土"], r$6 = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], m$5 = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], M$2 = { dateTime: "%x %a %X", date: "%Y/%m/%d", time: "%H:%M:%S", periods: d$5, days: o$5, shortDays: s$5, months: r$6, shortMonths: m$5 };
const jaJPF6e79415 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: a$6,
dateTime: t$6,
days: o$5,
default: M$2,
months: r$6,
periods: d$5,
shortDays: s$5,
shortMonths: m$5,
time: e$6
}, Symbol.toStringTag, { value: "Module" }));
var e$5 = "%A, %e %B %Y, %X", i$2 = "%d/%m/%Y", t$5 = "%H:%M:%S", r$5 = ["AM", "PM"], a$5 = ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], z = ["Niedz.", "Pon.", "Wt.", "Śr.", "Czw.", "Pt.", "Sob."], d$4 = ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], o$4 = ["Stycz.", "Luty", "Marz.", "Kwie.", "Maj", "Czerw.", "Lipc.", "Sierp.", "Wrz.", "Paźdz.", "Listop.", "Grudz."], s$4 = { dateTime: "%A, %e %B %Y, %X", date: "%d/%m/%Y", time: "%H:%M:%S", periods: r$5, days: a$5, shortDays: z, months: d$4, shortMonths: o$4 };
const plPL6f3759a6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: i$2,
dateTime: e$5,
days: a$5,
default: s$4,
months: d$4,
periods: r$5,
shortDays: z,
shortMonths: o$4,
time: t$5
}, Symbol.toStringTag, { value: "Module" }));
var e$4 = "%A, %e de %B de %Y. %X", o$3 = "%d/%m/%Y", a$4 = "%H:%M:%S", r$4 = ["AM", "PM"], t$4 = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], d$3 = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"], u$1 = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], i$1 = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], m$4 = { dateTime: "%A, %e de %B de %Y. %X", date: "%d/%m/%Y", time: "%H:%M:%S", periods: r$4, days: t$4, shortDays: d$3, months: u$1, shortMonths: i$1 };
const ptBR2f3b21ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: o$3,
dateTime: e$4,
days: t$4,
default: m$4,
months: u$1,
periods: r$4,
shortDays: d$3,
shortMonths: i$1,
time: a$4
}, Symbol.toStringTag, { value: "Module" }));
var e$3 = "%A, %e %B %Y г. %X", t$3 = "%d.%m.%Y", d$2 = "%H:%M:%S", o$2 = ["AM", "PM"], s$3 = ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], a$3 = ["вс", "пн", "вт", "ср", "чт", "пт", "сб"], r$3 = ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"], m$3 = ["янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"], M$1 = { dateTime: "%A, %e %B %Y г. %X", date: "%d.%m.%Y", time: "%H:%M:%S", periods: o$2, days: s$3, shortDays: a$3, months: r$3, shortMonths: m$3 };
const ruRU33f5a0a6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: t$3,
dateTime: e$3,
days: s$3,
default: M$1,
months: r$3,
periods: o$2,
shortDays: a$3,
shortMonths: m$3,
time: d$2
}, Symbol.toStringTag, { value: "Module" }));
var a$2 = "%a %e %b %X %Y", e$2 = "%d/%m/%Y", r$2 = "%H:%M:%S", t$2 = ["AM", "PM"], m$2 = ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], s$2 = ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"], i = ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], u = ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], M = { dateTime: "%a %e %b %X %Y", date: "%d/%m/%Y", time: "%H:%M:%S", periods: t$2, days: m$2, shortDays: s$2, months: i, shortMonths: u };
const trTR53a550f8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: e$2,
dateTime: a$2,
days: m$2,
default: M,
months: i,
periods: t$2,
shortDays: s$2,
shortMonths: u,
time: r$2
}, Symbol.toStringTag, { value: "Module" }));
var e$1 = "%A, %e %B %Y р. %X", t$1 = "%d.%m.%Y", d$1 = "%H:%M:%S", o$1 = ["дп", "пп"], s$1 = ["неділя", "понеділок", "вівторок", "середа", "четвер", "п'ятниця", "субота"], a$1 = ["нд", "пн", "вт", "ср", "чт", "пт", "сб"], r$1 = ["січня", "лютого", "березня", "квітня", "травня", "червня", "липня", "серпня", "вересня", "жовтня", "листопада", "грудня"], m$1 = ["січ.", "лют.", "бер.", "квіт.", "трав.", "черв.", "лип.", "серп.", "вер.", "жовт.", "лист.", "груд."], h$1 = { dateTime: "%A, %e %B %Y р. %X", date: "%d.%m.%Y", time: "%H:%M:%S", periods: o$1, days: s$1, shortDays: a$1, months: r$1, shortMonths: m$1 };
const ukUAC2f4115b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: t$1,
dateTime: e$1,
days: s$1,
default: h$1,
months: r$1,
periods: o$1,
shortDays: a$1,
shortMonths: m$1,
time: d$1
}, Symbol.toStringTag, { value: "Module" }));
var t4 = "%x %A %X", e6 = "%Y年%-m月%-d日", d = "%H:%M:%S", o = ["上午", "下午"], s = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], a = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], r = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], m = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], h = { dateTime: "%x %A %X", date: "%Y年%-m月%-d日", time: "%H:%M:%S", periods: o, days: s, shortDays: a, months: r, shortMonths: m };
const zhCN70c2b37c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
date: e6,
dateTime: t4,
days: s,
default: h,
months: r,
periods: o,
shortDays: a,
shortMonths: m,
time: d
}, Symbol.toStringTag, { value: "Module" }));
export {
requireCapitalize as $,
require$$1$1 as A,
requireColor as B,
require$$1 as C,
requireDist as D,
requireClassnames as E,
require$$4$1 as F,
require$$5$2 as G,
requireInherits as H,
requirePossibleConstructorReturn as I,
requireGetPrototypeOf as J,
requirePropTypes$1 as K,
require$$4 as L,
require$$11$2 as M,
require$$12 as N,
require$$13 as O,
requireUniqueId as P,
requireFindIndex as Q,
require$$18 as R,
require$$9$2 as S,
require$$9$1 as T,
requireUnion as U,
require$$9 as V,
require$$2$2 as W,
require$$5$1 as X,
require$$6 as Y,
requireCloneDeep as Z,
require$$5 as _,
require$$2$4 as a,
v4 as a$,
requireReactToastify as a0,
requirePick as a1,
requireIsNumber as a2,
requireDebounce as a3,
require$$3 as a4,
requireUtils$1 as a5,
requireGroupBy as a6,
requireResponsiveUtils as a7,
requireReactGridLayout as a8,
require$$11$1 as a9,
requireSk as aA,
requireRu as aB,
requirePtBr as aC,
requirePl as aD,
requireJa as aE,
requireIt as aF,
requireVi as aG,
requireHu as aH,
requireSl as aI,
requireFr as aJ,
requireFrCa as aK,
requireEsEs as aL,
requireDe as aM,
requireCs as aN,
requireNumeral as aO,
requireCjs as aP,
sprintf as aQ,
createBrowserHistory as aR,
DateTime as aS,
jsxRuntimeExports as aT,
React as aU,
__vitePreload as aV,
humanizeDuration as aW,
colors$2 as aX,
filesize as aY,
t$m as aZ,
Long as a_,
requireDefer as aa,
require$$14$1 as ab,
require$$14 as ac,
require$$17 as ad,
requireSortBy as ae,
requireIsEqual as af,
requireIsObject as ag,
requireTransform as ah,
require$$11 as ai,
requireFind as aj,
requireAssertThisInitialized as ak,
requireIncludes as al,
requireRemove as am,
requireRange as an,
requireGet as ao,
requireThrottle as ap,
requireIsNil as aq,
requireEs as ar,
require$$8 as as,
require$$2 as at,
requireSplide_cjs as au,
requireUpperFirst as av,
requireEnGb as aw,
requireChs as ax,
requireRuUa as ay,
requireTr as az,
requireCssjanus as b,
combineReducers as b0,
applyMiddleware as b1,
composeWithDevTools as b2,
createStore as b3,
thunkMiddleware as b4,
Settings as b5,
instance as b6,
Backend as b7,
Browser as b8,
initReactI18next as b9,
Route as bA,
Routes as bB,
Provider as bC,
HistoryRouter as bD,
withTranslation as ba,
isDeepEqual as bb,
connect$1 as bc,
useTranslation as bd,
useSelector as be,
useNavigate as bf,
useLocation as bg,
copy$4 as bh,
pick$3 as bi,
omit$1 as bj,
JSZip as bk,
lookup$9 as bl,
Subject as bm,
combineLatest as bn,
G$2 as bo,
Trans as bp,
useDispatch as bq,
scheme as br,
View$1 as bs,
parse$2 as bt,
Yc as bu,
E$2 as bv,
r$l as bw,
matchRoutes as bx,
useParams as by,
Navigate as bz,
require$$3$2 as c,
requireIsFunction as d,
requireIsBoolean as e,
requireIsString as f,
requireIsObjectLike as g,
requirePickBy as h,
interopRequireDefaultExports as i,
requireIdentity as j,
requireGet$1 as k,
requireIsEmpty as l,
reactExports as m,
reactDomExports as n,
requireClipboard as o,
require$$7$1 as p,
require$$0 as q,
require_extends as r,
getDefaultExportFromCjs as s,
require$$1$2 as t,
require$$7 as u,
require$$3$1 as v,
requireMerge as w,
require$$2$3 as x,
validateExports as y,
requireToConsumableArray as z
};
//# sourceMappingURL=vendor-a489d579.js.map