@p5-wrapper/react
Version:
A wrapper component that allows you to utilise P5 sketches within React apps.
1,215 lines (1,213 loc) • 1.41 MB
JavaScript
import _n, { useRef as gn, useEffect as Ar, memo as zn } from "react";
const Hn = { Date: !0, RegExp: !0, String: !0, Number: !0 };
function xn(yt, Et, Vt = { cyclesFix: !0 }, t = []) {
var y, u;
let H = [];
const C = Array.isArray(yt);
for (const h in yt) {
const g = yt[h], f = C ? +h : h;
if (!(h in Et)) {
H.push({
type: "REMOVE",
path: [f],
oldValue: yt[h]
});
continue;
}
const r = Et[h], s = typeof g == "object" && typeof r == "object" && Array.isArray(g) === Array.isArray(r);
if (g && r && s && !Hn[(u = (y = Object.getPrototypeOf(g)) == null ? void 0 : y.constructor) == null ? void 0 : u.name] && (!Vt.cyclesFix || !t.includes(g))) {
const o = xn(g, r, Vt, Vt.cyclesFix ? t.concat([g]) : []);
H.push.apply(H, o.map((i) => (i.path.unshift(f), i)));
} else
g !== r && // treat NaN values as equivalent
!(Number.isNaN(g) && Number.isNaN(r)) && !(s && (isNaN(g) ? g + "" == r + "" : +g == +r)) && H.push({
path: [f],
type: "CHANGE",
value: r,
oldValue: g
});
}
const m = Array.isArray(Et);
for (const h in Et)
h in yt || H.push({
type: "CREATE",
path: [m ? +h : h],
value: Et[h]
});
return H;
}
function Wn(yt, Et) {
return xn(yt, Et).length === 0;
}
var _r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function qn(yt) {
return yt && yt.__esModule && Object.prototype.hasOwnProperty.call(yt, "default") ? yt.default : yt;
}
var Pr = { exports: {} }, pr = {};
/**
* @license React
* 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 vn;
function Xn() {
if (vn)
return pr;
vn = 1;
var yt = _n, Et = Symbol.for("react.element"), Vt = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, H = yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
function m(y, u, h) {
var g, f = {}, r = null, s = null;
h !== void 0 && (r = "" + h), u.key !== void 0 && (r = "" + u.key), u.ref !== void 0 && (s = u.ref);
for (g in u)
t.call(u, g) && !C.hasOwnProperty(g) && (f[g] = u[g]);
if (y && y.defaultProps)
for (g in u = y.defaultProps, u)
f[g] === void 0 && (f[g] = u[g]);
return { $$typeof: Et, type: y, key: r, ref: s, props: f, _owner: H.current };
}
return pr.Fragment = Vt, pr.jsx = m, pr.jsxs = m, pr;
}
var mr = {};
/**
* @license React
* react-jsx-runtime.development.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 bn;
function Yn() {
return bn || (bn = 1, process.env.NODE_ENV !== "production" && function() {
var yt = _n, Et = Symbol.for("react.element"), Vt = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), H = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), y = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), r = Symbol.for("react.lazy"), s = Symbol.for("react.offscreen"), o = Symbol.iterator, i = "@@iterator";
function l(me) {
if (me === null || typeof me != "object")
return null;
var Ue = o && me[o] || me[i];
return typeof Ue == "function" ? Ue : null;
}
var n = yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function a(me) {
{
for (var Ue = arguments.length, Ye = new Array(Ue > 1 ? Ue - 1 : 0), it = 1; it < Ue; it++)
Ye[it - 1] = arguments[it];
c("error", me, Ye);
}
}
function c(me, Ue, Ye) {
{
var it = n.ReactDebugCurrentFrame, ft = it.getStackAddendum();
ft !== "" && (Ue += "%s", Ye = Ye.concat([ft]));
var pt = Ye.map(function(ie) {
return String(ie);
});
pt.unshift("Warning: " + Ue), Function.prototype.apply.call(console[me], console, pt);
}
}
var p = !1, j = !1, T = !1, _ = !1, S = !1, E;
E = Symbol.for("react.module.reference");
function A(me) {
return !!(typeof me == "string" || typeof me == "function" || me === t || me === C || S || me === H || me === h || me === g || _ || me === s || p || j || T || typeof me == "object" && me !== null && (me.$$typeof === r || me.$$typeof === f || me.$$typeof === m || me.$$typeof === y || me.$$typeof === u || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
me.$$typeof === E || me.getModuleId !== void 0));
}
function x(me, Ue, Ye) {
var it = me.displayName;
if (it)
return it;
var ft = Ue.displayName || Ue.name || "";
return ft !== "" ? Ye + "(" + ft + ")" : Ye;
}
function P(me) {
return me.displayName || "Context";
}
function M(me) {
if (me == null)
return null;
if (typeof me.tag == "number" && a("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof me == "function")
return me.displayName || me.name || null;
if (typeof me == "string")
return me;
switch (me) {
case t:
return "Fragment";
case Vt:
return "Portal";
case C:
return "Profiler";
case H:
return "StrictMode";
case h:
return "Suspense";
case g:
return "SuspenseList";
}
if (typeof me == "object")
switch (me.$$typeof) {
case y:
var Ue = me;
return P(Ue) + ".Consumer";
case m:
var Ye = me;
return P(Ye._context) + ".Provider";
case u:
return x(me, me.render, "ForwardRef");
case f:
var it = me.displayName || null;
return it !== null ? it : M(me.type) || "Memo";
case r: {
var ft = me, pt = ft._payload, ie = ft._init;
try {
return M(ie(pt));
} catch {
return null;
}
}
}
return null;
}
var R = Object.assign, L = 0, F, V, G, U, W, X, ne;
function b() {
}
b.__reactDisabledLog = !0;
function O() {
{
if (L === 0) {
F = console.log, V = console.info, G = console.warn, U = console.error, W = console.group, X = console.groupCollapsed, ne = console.groupEnd;
var me = {
configurable: !0,
enumerable: !0,
value: b,
writable: !0
};
Object.defineProperties(console, {
info: me,
log: me,
warn: me,
error: me,
group: me,
groupCollapsed: me,
groupEnd: me
});
}
L++;
}
}
function D() {
{
if (L--, L === 0) {
var me = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: R({}, me, {
value: F
}),
info: R({}, me, {
value: V
}),
warn: R({}, me, {
value: G
}),
error: R({}, me, {
value: U
}),
group: R({}, me, {
value: W
}),
groupCollapsed: R({}, me, {
value: X
}),
groupEnd: R({}, me, {
value: ne
})
});
}
L < 0 && a("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var B = n.ReactCurrentDispatcher, Y;
function J(me, Ue, Ye) {
{
if (Y === void 0)
try {
throw Error();
} catch (ft) {
var it = ft.stack.trim().match(/\n( *(at )?)/);
Y = it && it[1] || "";
}
return `
` + Y + me;
}
}
var te = !1, ce;
{
var re = typeof WeakMap == "function" ? WeakMap : Map;
ce = new re();
}
function ue(me, Ue) {
if (!me || te)
return "";
{
var Ye = ce.get(me);
if (Ye !== void 0)
return Ye;
}
var it;
te = !0;
var ft = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var pt;
pt = B.current, B.current = null, O();
try {
if (Ue) {
var ie = function() {
throw Error();
};
if (Object.defineProperty(ie.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(ie, []);
} catch (ut) {
it = ut;
}
Reflect.construct(me, [], ie);
} else {
try {
ie.call();
} catch (ut) {
it = ut;
}
me.call(ie.prototype);
}
} else {
try {
throw Error();
} catch (ut) {
it = ut;
}
me();
}
} catch (ut) {
if (ut && it && typeof ut.stack == "string") {
for (var Oe = ut.stack.split(`
`), Ge = it.stack.split(`
`), Le = Oe.length - 1, rt = Ge.length - 1; Le >= 1 && rt >= 0 && Oe[Le] !== Ge[rt]; )
rt--;
for (; Le >= 1 && rt >= 0; Le--, rt--)
if (Oe[Le] !== Ge[rt]) {
if (Le !== 1 || rt !== 1)
do
if (Le--, rt--, rt < 0 || Oe[Le] !== Ge[rt]) {
var Pe = `
` + Oe[Le].replace(" at new ", " at ");
return me.displayName && Pe.includes("<anonymous>") && (Pe = Pe.replace("<anonymous>", me.displayName)), typeof me == "function" && ce.set(me, Pe), Pe;
}
while (Le >= 1 && rt >= 0);
break;
}
}
} finally {
te = !1, B.current = pt, D(), Error.prepareStackTrace = ft;
}
var ct = me ? me.displayName || me.name : "", qe = ct ? J(ct) : "";
return typeof me == "function" && ce.set(me, qe), qe;
}
function le(me, Ue, Ye) {
return ue(me, !1);
}
function K(me) {
var Ue = me.prototype;
return !!(Ue && Ue.isReactComponent);
}
function ae(me, Ue, Ye) {
if (me == null)
return "";
if (typeof me == "function")
return ue(me, K(me));
if (typeof me == "string")
return J(me);
switch (me) {
case h:
return J("Suspense");
case g:
return J("SuspenseList");
}
if (typeof me == "object")
switch (me.$$typeof) {
case u:
return le(me.render);
case f:
return ae(me.type, Ue, Ye);
case r: {
var it = me, ft = it._payload, pt = it._init;
try {
return ae(pt(ft), Ue, Ye);
} catch {
}
}
}
return "";
}
var he = Object.prototype.hasOwnProperty, _e = {}, fe = n.ReactDebugCurrentFrame;
function ge(me) {
if (me) {
var Ue = me._owner, Ye = ae(me.type, me._source, Ue ? Ue.type : null);
fe.setExtraStackFrame(Ye);
} else
fe.setExtraStackFrame(null);
}
function xe(me, Ue, Ye, it, ft) {
{
var pt = Function.call.bind(he);
for (var ie in me)
if (pt(me, ie)) {
var Oe = void 0;
try {
if (typeof me[ie] != "function") {
var Ge = Error((it || "React class") + ": " + Ye + " type `" + ie + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof me[ie] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw Ge.name = "Invariant Violation", Ge;
}
Oe = me[ie](Ue, ie, it, Ye, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (Le) {
Oe = Le;
}
Oe && !(Oe instanceof Error) && (ge(ft), a("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", it || "React class", Ye, ie, typeof Oe), ge(null)), Oe instanceof Error && !(Oe.message in _e) && (_e[Oe.message] = !0, ge(ft), a("Failed %s type: %s", Ye, Oe.message), ge(null));
}
}
}
var De = Array.isArray;
function Me(me) {
return De(me);
}
function Qe(me) {
{
var Ue = typeof Symbol == "function" && Symbol.toStringTag, Ye = Ue && me[Symbol.toStringTag] || me.constructor.name || "Object";
return Ye;
}
}
function ze(me) {
try {
return Ve(me), !1;
} catch {
return !0;
}
}
function Ve(me) {
return "" + me;
}
function Xe(me) {
if (ze(me))
return a("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(me)), Ve(me);
}
var He = n.ReactCurrentOwner, ve = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Re, we, Z;
Z = {};
function $(me) {
if (he.call(me, "ref")) {
var Ue = Object.getOwnPropertyDescriptor(me, "ref").get;
if (Ue && Ue.isReactWarning)
return !1;
}
return me.ref !== void 0;
}
function q(me) {
if (he.call(me, "key")) {
var Ue = Object.getOwnPropertyDescriptor(me, "key").get;
if (Ue && Ue.isReactWarning)
return !1;
}
return me.key !== void 0;
}
function ee(me, Ue) {
if (typeof me.ref == "string" && He.current && Ue && He.current.stateNode !== Ue) {
var Ye = M(He.current.type);
Z[Ye] || (a('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', M(He.current.type), me.ref), Z[Ye] = !0);
}
}
function pe(me, Ue) {
{
var Ye = function() {
Re || (Re = !0, a("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Ue));
};
Ye.isReactWarning = !0, Object.defineProperty(me, "key", {
get: Ye,
configurable: !0
});
}
}
function je(me, Ue) {
{
var Ye = function() {
we || (we = !0, a("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Ue));
};
Ye.isReactWarning = !0, Object.defineProperty(me, "ref", {
get: Ye,
configurable: !0
});
}
}
var Ce = function(me, Ue, Ye, it, ft, pt, ie) {
var Oe = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: Et,
// Built-in properties that belong on the element
type: me,
key: Ue,
ref: Ye,
props: ie,
// Record the component responsible for creating this element.
_owner: pt
};
return Oe._store = {}, Object.defineProperty(Oe._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(Oe, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: it
}), Object.defineProperty(Oe, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: ft
}), Object.freeze && (Object.freeze(Oe.props), Object.freeze(Oe)), Oe;
};
function Fe(me, Ue, Ye, it, ft) {
{
var pt, ie = {}, Oe = null, Ge = null;
Ye !== void 0 && (Xe(Ye), Oe = "" + Ye), q(Ue) && (Xe(Ue.key), Oe = "" + Ue.key), $(Ue) && (Ge = Ue.ref, ee(Ue, ft));
for (pt in Ue)
he.call(Ue, pt) && !ve.hasOwnProperty(pt) && (ie[pt] = Ue[pt]);
if (me && me.defaultProps) {
var Le = me.defaultProps;
for (pt in Le)
ie[pt] === void 0 && (ie[pt] = Le[pt]);
}
if (Oe || Ge) {
var rt = typeof me == "function" ? me.displayName || me.name || "Unknown" : me;
Oe && pe(ie, rt), Ge && je(ie, rt);
}
return Ce(me, Oe, Ge, ft, it, He.current, ie);
}
}
var Ne = n.ReactCurrentOwner, Be = n.ReactDebugCurrentFrame;
function We(me) {
if (me) {
var Ue = me._owner, Ye = ae(me.type, me._source, Ue ? Ue.type : null);
Be.setExtraStackFrame(Ye);
} else
Be.setExtraStackFrame(null);
}
var st;
st = !1;
function nt(me) {
return typeof me == "object" && me !== null && me.$$typeof === Et;
}
function Ke() {
{
if (Ne.current) {
var me = M(Ne.current.type);
if (me)
return `
Check the render method of \`` + me + "`.";
}
return "";
}
}
function at(me) {
return "";
}
var ot = {};
function bt(me) {
{
var Ue = Ke();
if (!Ue) {
var Ye = typeof me == "string" ? me : me.displayName || me.name;
Ye && (Ue = `
Check the top-level render call using <` + Ye + ">.");
}
return Ue;
}
}
function It(me, Ue) {
{
if (!me._store || me._store.validated || me.key != null)
return;
me._store.validated = !0;
var Ye = bt(Ue);
if (ot[Ye])
return;
ot[Ye] = !0;
var it = "";
me && me._owner && me._owner !== Ne.current && (it = " It was passed a child from " + M(me._owner.type) + "."), We(me), a('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', Ye, it), We(null);
}
}
function Mt(me, Ue) {
{
if (typeof me != "object")
return;
if (Me(me))
for (var Ye = 0; Ye < me.length; Ye++) {
var it = me[Ye];
nt(it) && It(it, Ue);
}
else if (nt(me))
me._store && (me._store.validated = !0);
else if (me) {
var ft = l(me);
if (typeof ft == "function" && ft !== me.entries)
for (var pt = ft.call(me), ie; !(ie = pt.next()).done; )
nt(ie.value) && It(ie.value, Ue);
}
}
}
function mt(me) {
{
var Ue = me.type;
if (Ue == null || typeof Ue == "string")
return;
var Ye;
if (typeof Ue == "function")
Ye = Ue.propTypes;
else if (typeof Ue == "object" && (Ue.$$typeof === u || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
Ue.$$typeof === f))
Ye = Ue.propTypes;
else
return;
if (Ye) {
var it = M(Ue);
xe(Ye, me.props, "prop", it, me);
} else if (Ue.PropTypes !== void 0 && !st) {
st = !0;
var ft = M(Ue);
a("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ft || "Unknown");
}
typeof Ue.getDefaultProps == "function" && !Ue.getDefaultProps.isReactClassApproved && a("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function jt(me) {
{
for (var Ue = Object.keys(me.props), Ye = 0; Ye < Ue.length; Ye++) {
var it = Ue[Ye];
if (it !== "children" && it !== "key") {
We(me), a("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", it), We(null);
break;
}
}
me.ref !== null && (We(me), a("Invalid attribute `ref` supplied to `React.Fragment`."), We(null));
}
}
function ht(me, Ue, Ye, it, ft, pt) {
{
var ie = A(me);
if (!ie) {
var Oe = "";
(me === void 0 || typeof me == "object" && me !== null && Object.keys(me).length === 0) && (Oe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var Ge = at();
Ge ? Oe += Ge : Oe += Ke();
var Le;
me === null ? Le = "null" : Me(me) ? Le = "array" : me !== void 0 && me.$$typeof === Et ? (Le = "<" + (M(me.type) || "Unknown") + " />", Oe = " Did you accidentally export a JSX literal instead of a component?") : Le = typeof me, a("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Le, Oe);
}
var rt = Fe(me, Ue, Ye, ft, pt);
if (rt == null)
return rt;
if (ie) {
var Pe = Ue.children;
if (Pe !== void 0)
if (it)
if (Me(Pe)) {
for (var ct = 0; ct < Pe.length; ct++)
Mt(Pe[ct], me);
Object.freeze && Object.freeze(Pe);
} else
a("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Mt(Pe, me);
}
return me === t ? jt(rt) : mt(rt), rt;
}
}
function Dt(me, Ue, Ye) {
return ht(me, Ue, Ye, !0);
}
function Pt(me, Ue, Ye) {
return ht(me, Ue, Ye, !1);
}
var gt = Pt, Ft = Dt;
mr.Fragment = t, mr.jsx = gt, mr.jsxs = Ft;
}()), mr;
}
process.env.NODE_ENV === "production" ? Pr.exports = Xn() : Pr.exports = Yn();
var wr = Pr.exports;
const Zn = "react-p5-wrapper";
function xr(yt) {
throw new Error('Could not dynamically require "' + yt + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var wn = { exports: {} };
/*! p5.js v1.9.4 May 21, 2024 */
(function(yt, Et) {
(function(Vt) {
yt.exports = Vt();
})(function() {
var Vt;
return function t(H, C, m) {
function y(g, f) {
if (!C[g]) {
if (!H[g]) {
var r = typeof xr == "function" && xr;
if (!f && r)
return r(g, !0);
if (u)
return u(g, !0);
throw (f = new Error("Cannot find module '" + g + "'")).code = "MODULE_NOT_FOUND", f;
}
r = C[g] = { exports: {} }, H[g][0].call(r.exports, function(s) {
return y(H[g][1][s] || s);
}, r, r.exports, t, H, C, m);
}
return C[g].exports;
}
for (var u = typeof xr == "function" && xr, h = 0; h < m.length; h++)
y(m[h]);
return y;
}({ 1: [function(t, H, C) {
C.byteLength = function(i) {
var i = r(i), o = i[0], i = i[1];
return 3 * (o + i) / 4 - i;
}, C.toByteArray = function(s) {
var o, i, n = r(s), l = n[0], n = n[1], a = new u(function(j, T) {
return 3 * (j + T) / 4 - T;
}(l, n)), c = 0, p = 0 < n ? l - 4 : l;
for (i = 0; i < p; i += 4)
o = y[s.charCodeAt(i)] << 18 | y[s.charCodeAt(i + 1)] << 12 | y[s.charCodeAt(i + 2)] << 6 | y[s.charCodeAt(i + 3)], a[c++] = o >> 16 & 255, a[c++] = o >> 8 & 255, a[c++] = 255 & o;
return n === 2 && (o = y[s.charCodeAt(i)] << 2 | y[s.charCodeAt(i + 1)] >> 4, a[c++] = 255 & o), n === 1 && (o = y[s.charCodeAt(i)] << 10 | y[s.charCodeAt(i + 1)] << 4 | y[s.charCodeAt(i + 2)] >> 2, a[c++] = o >> 8 & 255, a[c++] = 255 & o), a;
}, C.fromByteArray = function(s) {
for (var o, i = s.length, l = i % 3, n = [], a = 0, c = i - l; a < c; a += 16383)
n.push(function(p, j, T) {
for (var _, S = [], E = j; E < T; E += 3)
_ = (p[E] << 16 & 16711680) + (p[E + 1] << 8 & 65280) + (255 & p[E + 2]), S.push(function(A) {
return m[A >> 18 & 63] + m[A >> 12 & 63] + m[A >> 6 & 63] + m[63 & A];
}(_));
return S.join("");
}(s, a, c < a + 16383 ? c : a + 16383));
return l == 1 ? (o = s[i - 1], n.push(m[o >> 2] + m[o << 4 & 63] + "==")) : l == 2 && (o = (s[i - 2] << 8) + s[i - 1], n.push(m[o >> 10] + m[o >> 4 & 63] + m[o << 2 & 63] + "=")), n.join("");
};
for (var m = [], y = [], u = typeof Uint8Array < "u" ? Uint8Array : Array, h = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", g = 0, f = h.length; g < f; ++g)
m[g] = h[g], y[h.charCodeAt(g)] = g;
function r(s) {
var o = s.length;
if (0 < o % 4)
throw new Error("Invalid string. Length must be a multiple of 4");
return s = s.indexOf("="), o = (s = s === -1 ? o : s) === o ? 0 : 4 - s % 4, [s, o];
}
y[45] = 62, y[95] = 63;
}, {}], 2: [function(t, H, C) {
}, {}], 3: [function(t, H, C) {
}, {}], 4: [function(t, H, C) {
(function(r) {
var y = t("base64-js"), u = t("ieee754"), h = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null, g = (C.Buffer = r, C.SlowBuffer = function(b) {
return +b != b && (b = 0), r.alloc(+b);
}, C.INSPECT_MAX_BYTES = 50, 2147483647);
function f(b) {
if (g < b)
throw new RangeError('The value "' + b + '" is invalid for option "size"');
return b = new Uint8Array(b), Object.setPrototypeOf(b, r.prototype), b;
}
function r(b, O, D) {
if (typeof b != "number")
return s(b, O, D);
if (typeof O == "string")
throw new TypeError('The "string" argument must be of type string. Received type number');
return i(b);
}
function s(b, O, D) {
if (typeof b == "string") {
var B = b, Y = O;
if (r.isEncoding(Y = typeof Y == "string" && Y !== "" ? Y : "utf8"))
return J = 0 | a(B, Y), te = f(J), te = (B = te.write(B, Y)) !== J ? te.slice(0, B) : te;
throw new TypeError("Unknown encoding: " + Y);
}
if (ArrayBuffer.isView(b))
return l(b);
if (b != null) {
if (W(b, ArrayBuffer) || b && W(b.buffer, ArrayBuffer)) {
var J = b, B = O, te = D;
if (B < 0 || J.byteLength < B)
throw new RangeError('"offset" is outside of buffer bounds');
if (J.byteLength < B + (te || 0))
throw new RangeError('"length" is outside of buffer bounds');
return J = B === void 0 && te === void 0 ? new Uint8Array(J) : te === void 0 ? new Uint8Array(J, B) : new Uint8Array(J, B, te), Object.setPrototypeOf(J, r.prototype), J;
}
if (typeof b == "number")
throw new TypeError('The "value" argument must not be of type number. Received type number');
if (Y = b.valueOf && b.valueOf(), Y != null && Y !== b)
return r.from(Y, O, D);
var ce = function(re) {
{
var ue, le;
if (r.isBuffer(re))
return ue = 0 | n(re.length), (le = f(ue)).length !== 0 && re.copy(le, 0, 0, ue), le;
}
if (re.length !== void 0)
return typeof re.length != "number" || X(re.length) ? f(0) : l(re);
if (re.type === "Buffer" && Array.isArray(re.data))
return l(re.data);
}(b);
if (ce)
return ce;
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof b[Symbol.toPrimitive] == "function")
return r.from(b[Symbol.toPrimitive]("string"), O, D);
}
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof b);
}
function o(b) {
if (typeof b != "number")
throw new TypeError('"size" argument must be of type number');
if (b < 0)
throw new RangeError('The value "' + b + '" is invalid for option "size"');
}
function i(b) {
return o(b), f(b < 0 ? 0 : 0 | n(b));
}
function l(b) {
for (var O = b.length < 0 ? 0 : 0 | n(b.length), D = f(O), B = 0; B < O; B += 1)
D[B] = 255 & b[B];
return D;
}
function n(b) {
if (g <= b)
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + g.toString(16) + " bytes");
return 0 | b;
}
function a(b, O) {
if (r.isBuffer(b))
return b.length;
if (ArrayBuffer.isView(b) || W(b, ArrayBuffer))
return b.byteLength;
if (typeof b != "string")
throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof b);
var D = b.length, B = 2 < arguments.length && arguments[2] === !0;
if (!B && D === 0)
return 0;
for (var Y = !1; ; )
switch (O) {
case "ascii":
case "latin1":
case "binary":
return D;
case "utf8":
case "utf-8":
return V(b).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * D;
case "hex":
return D >>> 1;
case "base64":
return G(b).length;
default:
if (Y)
return B ? -1 : V(b).length;
O = ("" + O).toLowerCase(), Y = !0;
}
}
function c(b, O, D) {
var B, Y = !1;
if ((O = O === void 0 || O < 0 ? 0 : O) > this.length || (D = D === void 0 || D > this.length ? this.length : D) <= 0 || (D >>>= 0) <= (O >>>= 0))
return "";
for (b = b || "utf8"; ; )
switch (b) {
case "hex":
var J = this, fe = O, te = D, le = J.length;
(!te || te < 0 || le < te) && (te = le);
for (var ce = "", re = fe = !fe || fe < 0 ? 0 : fe; re < te; ++re)
ce += ne[J[re]];
return ce;
case "utf8":
case "utf-8":
return E(this, O, D);
case "ascii":
var ue = this, le = O, K = D, ae = "";
K = Math.min(ue.length, K);
for (var he = le; he < K; ++he)
ae += String.fromCharCode(127 & ue[he]);
return ae;
case "latin1":
case "binary":
var _e = this, fe = O, ge = D, xe = "";
ge = Math.min(_e.length, ge);
for (var De = fe; De < ge; ++De)
xe += String.fromCharCode(_e[De]);
return xe;
case "base64":
return Me = this, B = D, (Qe = O) === 0 && B === Me.length ? y.fromByteArray(Me) : y.fromByteArray(Me.slice(Qe, B));
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
for (var Me = O, Qe = D, ze = this.slice(Me, Qe), Ve = "", Xe = 0; Xe < ze.length; Xe += 2)
Ve += String.fromCharCode(ze[Xe] + 256 * ze[Xe + 1]);
return Ve;
default:
if (Y)
throw new TypeError("Unknown encoding: " + b);
b = (b + "").toLowerCase(), Y = !0;
}
}
function p(b, O, D) {
var B = b[O];
b[O] = b[D], b[D] = B;
}
function j(b, O, D, B, Y) {
if (b.length === 0)
return -1;
if (typeof D == "string" ? (B = D, D = 0) : 2147483647 < D ? D = 2147483647 : D < -2147483648 && (D = -2147483648), (D = (D = X(D = +D) ? Y ? 0 : b.length - 1 : D) < 0 ? b.length + D : D) >= b.length) {
if (Y)
return -1;
D = b.length - 1;
} else if (D < 0) {
if (!Y)
return -1;
D = 0;
}
if (typeof O == "string" && (O = r.from(O, B)), r.isBuffer(O))
return O.length === 0 ? -1 : T(b, O, D, B, Y);
if (typeof O == "number")
return O &= 255, typeof Uint8Array.prototype.indexOf == "function" ? (Y ? Uint8Array.prototype.indexOf : Uint8Array.prototype.lastIndexOf).call(b, O, D) : T(b, [O], D, B, Y);
throw new TypeError("val must be string, number or Buffer");
}
function T(b, O, D, B, Y) {
var J = 1, te = b.length, ce = O.length;
if (B !== void 0 && ((B = String(B).toLowerCase()) === "ucs2" || B === "ucs-2" || B === "utf16le" || B === "utf-16le")) {
if (b.length < 2 || O.length < 2)
return -1;
te /= J = 2, ce /= 2, D /= 2;
}
function re(he, _e) {
return J === 1 ? he[_e] : he.readUInt16BE(_e * J);
}
if (Y)
for (var ue = -1, le = D; le < te; le++)
if (re(b, le) === re(O, ue === -1 ? 0 : le - ue)) {
if (le - (ue = ue === -1 ? le : ue) + 1 === ce)
return ue * J;
} else
ue !== -1 && (le -= le - ue), ue = -1;
else
for (le = D = te < D + ce ? te - ce : D; 0 <= le; le--) {
for (var K = !0, ae = 0; ae < ce; ae++)
if (re(b, le + ae) !== re(O, ae)) {
K = !1;
break;
}
if (K)
return le;
}
return -1;
}
function _(b, O, D, B) {
return U(function(Y) {
for (var J = [], te = 0; te < Y.length; ++te)
J.push(255 & Y.charCodeAt(te));
return J;
}(O), b, D, B);
}
function S(b, O, D, B) {
return U(function(Y, J) {
for (var te, ce, re = [], ue = 0; ue < Y.length && !((J -= 2) < 0); ++ue)
ce = Y.charCodeAt(ue), te = ce >> 8, ce = ce % 256, re.push(ce), re.push(te);
return re;
}(O, b.length - D), b, D, B);
}
function E(b, O, D) {
D = Math.min(b.length, D);
for (var B = [], Y = O; Y < D; ) {
var J, te, ce, re, ue = b[Y], le = null, K = 239 < ue ? 4 : 223 < ue ? 3 : 191 < ue ? 2 : 1;
if (Y + K <= D)
switch (K) {
case 1:
ue < 128 && (le = ue);
break;
case 2:
(192 & (J = b[Y + 1])) == 128 && 127 < (re = (31 & ue) << 6 | 63 & J) && (le = re);
break;
case 3:
J = b[Y + 1], te = b[Y + 2], (192 & J) == 128 && (192 & te) == 128 && 2047 < (re = (15 & ue) << 12 | (63 & J) << 6 | 63 & te) && (re < 55296 || 57343 < re) && (le = re);
break;
case 4:
J = b[Y + 1], te = b[Y + 2], ce = b[Y + 3], (192 & J) == 128 && (192 & te) == 128 && (192 & ce) == 128 && 65535 < (re = (15 & ue) << 18 | (63 & J) << 12 | (63 & te) << 6 | 63 & ce) && re < 1114112 && (le = re);
}
le === null ? (le = 65533, K = 1) : 65535 < le && (le -= 65536, B.push(le >>> 10 & 1023 | 55296), le = 56320 | 1023 & le), B.push(le), Y += K;
}
var ae = B, he = ae.length;
if (he <= A)
return String.fromCharCode.apply(String, ae);
for (var _e = "", fe = 0; fe < he; )
_e += String.fromCharCode.apply(String, ae.slice(fe, fe += A));
return _e;
}
C.kMaxLength = g, (r.TYPED_ARRAY_SUPPORT = function() {
try {
var b = new Uint8Array(1), O = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(O, Uint8Array.prototype), Object.setPrototypeOf(b, O), b.foo() === 42;
} catch {
return !1;
}
}()) || typeof console > "u" || typeof console.error != "function" || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(r.prototype, "parent", { enumerable: !0, get: function() {
if (r.isBuffer(this))
return this.buffer;
} }), Object.defineProperty(r.prototype, "offset", { enumerable: !0, get: function() {
if (r.isBuffer(this))
return this.byteOffset;
} }), typeof Symbol < "u" && Symbol.species != null && r[Symbol.species] === r && Object.defineProperty(r, Symbol.species, { value: null, configurable: !0, enumerable: !1, writable: !1 }), r.poolSize = 8192, r.from = s, Object.setPrototypeOf(r.prototype, Uint8Array.prototype), Object.setPrototypeOf(r, Uint8Array), r.alloc = function(b, O, D) {
return O = O, D = D, o(b = b), !(b <= 0) && O !== void 0 ? typeof D == "string" ? f(b).fill(O, D) : f(b).fill(O) : f(b);
}, r.allocUnsafe = i, r.allocUnsafeSlow = i, r.isBuffer = function(b) {
return b != null && b._isBuffer === !0 && b !== r.prototype;
}, r.compare = function(b, O) {
if (W(b, Uint8Array) && (b = r.from(b, b.offset, b.byteLength)), W(O, Uint8Array) && (O = r.from(O, O.offset, O.byteLength)), !r.isBuffer(b) || !r.isBuffer(O))
throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
if (b === O)
return 0;
for (var D = b.length, B = O.length, Y = 0, J = Math.min(D, B); Y < J; ++Y)
if (b[Y] !== O[Y]) {
D = b[Y], B = O[Y];
break;
}
return D < B ? -1 : B < D ? 1 : 0;
}, r.isEncoding = function(b) {
switch (String(b).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1;
}
}, r.concat = function(b, O) {
if (!Array.isArray(b))
throw new TypeError('"list" argument must be an Array of Buffers');
if (b.length === 0)
return r.alloc(0);
if (O === void 0)
for (Y = O = 0; Y < b.length; ++Y)
O += b[Y].length;
for (var D = r.allocUnsafe(O), B = 0, Y = 0; Y < b.length; ++Y) {
var J = b[Y];
if (W(J, Uint8Array) && (J = r.from(J)), !r.isBuffer(J))
throw new TypeError('"list" argument must be an Array of Buffers');
J.copy(D, B), B += J.length;
}
return D;
}, r.byteLength = a, r.prototype._isBuffer = !0, r.prototype.swap16 = function() {
var b = this.length;
if (b % 2 != 0)
throw new RangeError("Buffer size must be a multiple of 16-bits");
for (var O = 0; O < b; O += 2)
p(this, O, O + 1);
return this;
}, r.prototype.swap32 = function() {
var b = this.length;
if (b % 4 != 0)
throw new RangeError("Buffer size must be a multiple of 32-bits");
for (var O = 0; O < b; O += 4)
p(this, O, O + 3), p(this, O + 1, O + 2);
return this;
}, r.prototype.swap64 = function() {
var b = this.length;
if (b % 8 != 0)
throw new RangeError("Buffer size must be a multiple of 64-bits");
for (var O = 0; O < b; O += 8)
p(this, O, O + 7), p(this, O + 1, O + 6), p(this, O + 2, O + 5), p(this, O + 3, O + 4);
return this;
}, r.prototype.toLocaleString = r.prototype.toString = function() {
var b = this.length;
return b === 0 ? "" : arguments.length === 0 ? E(this, 0, b) : c.apply(this, arguments);
}, r.prototype.equals = function(b) {
if (r.isBuffer(b))
return this === b || r.compare(this, b) === 0;
throw new TypeError("Argument must be a Buffer");
}, r.prototype.inspect = function() {
var O = "", b = C.INSPECT_MAX_BYTES, O = this.toString("hex", 0, b).replace(/(.{2})/g, "$1 ").trim();
return this.length > b && (O += " ... "), "<Buffer " + O + ">";
}, h && (r.prototype[h] = r.prototype.inspect), r.prototype.compare = function(b, O, D, B, Y) {
if (W(b, Uint8Array) && (b = r.from(b, b.offset, b.byteLength)), !r.isBuffer(b))
throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof b);
if (D === void 0 && (D = b ? b.length : 0), B === void 0 && (B = 0), Y === void 0 && (Y = this.length), (O = O === void 0 ? 0 : O) < 0 || D > b.length || B < 0 || Y > this.length)
throw new RangeError("out of range index");
if (Y <= B && D <= O)
return 0;
if (Y <= B)
return -1;
if (D <= O)
return 1;
if (this === b)
return 0;
for (var J = (Y >>>= 0) - (B >>>= 0), te = (D >>>= 0) - (O >>>= 0), ce = Math.min(J, te), re = this.slice(B, Y), ue = b.slice(O, D), le = 0; le < ce; ++le)
if (re[le] !== ue[le]) {
J = re[le], te = ue[le];
break;
}
return J < te ? -1 : te < J ? 1 : 0;
}, r.prototype.includes = function(b, O, D) {
return this.indexOf(b, O, D) !== -1;
}, r.prototype.indexOf = function(b, O, D) {
return j(this, b, O, D, !0);
}, r.prototype.lastIndexOf = function(b, O, D) {
return j(this, b, O, D, !1);
}, r.prototype.write = function(b, O, D, B) {
if (O === void 0)
B = "utf8", D = this.length, O = 0;
else if (D === void 0 && typeof O == "string")
B = O, D = this.length, O = 0;
else {
if (!isFinite(O))
throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
O >>>= 0, isFinite(D) ? (D >>>= 0, B === void 0 && (B = "utf8")) : (B = D, D = void 0);
}
var Y = this.length - O;
if ((D === void 0 || Y < D) && (D = Y), 0 < b.length && (D < 0 || O < 0) || O > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
B = B || "utf8";
for (var J, te, ce, re = !1; ; )
switch (B) {
case "hex":
var ue = this, le = b, K = O, ae = D, he = (K = Number(K) || 0, ue.length - K);
(!ae || he < (ae = Number(ae))) && (ae = he), (he = le.length) / 2 < ae && (ae = he / 2);
for (var _e = 0; _e < ae; ++_e) {
var fe = parseInt(le.substr(2 * _e, 2), 16);
if (X(fe))
return _e;
ue[K + _e] = fe;
}
return _e;
case "utf8":
case "utf-8":
return he = O, ce = D, U(V(b, (te = this).length - he), te, he, ce);
case "ascii":
return _(this, b, O, D);
case "latin1":
case "binary":
return _(this, b, O, D);
case "base64":
return te = this, ce = O, J = D, U(G(b), te, ce, J);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return S(this, b, O, D);
default:
if (re)
throw new TypeError("Unknown encoding: " + B);
B = ("" + B).toLowerCase(), re = !0;
}
}, r.prototype.toJSON = function() {
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
};
var A = 4096;
function x(b, O, D) {
if (b % 1 != 0 || b < 0)
throw new RangeError("offset is not uint");
if (D < b + O)
throw new RangeError("Trying to access beyond buffer length");
}
function P(b, O, D, B, Y, J) {
if (!r.isBuffer(b))
throw new TypeError('"buffer" argument must be a Buffer instance');
if (Y < O || O < J)
throw new RangeError('"value" argument is out of bounds');
if (D + B > b.length)
throw new RangeError("Index out of range");
}
function M(b, O, D, B) {
if (D + B > b.length)
throw new RangeError("Index out of range");
if (D < 0)
throw new RangeError("Index out of range");
}
function R(b, O, D, B, Y) {
return O = +O, D >>>= 0, Y || M(b, 0, D, 4), u.write(b, O, D, B, 23, 4), D + 4;
}
function L(b, O, D, B, Y) {
return O = +O, D >>>= 0, Y || M(b, 0, D, 8), u.write(b, O, D, B, 52, 8), D + 8;
}
r.prototype.slice = function(b, O) {
var D = this.length, D = ((b = ~~b) < 0 ? (b += D) < 0 && (b = 0) : D < b && (b = D), (O = O === void 0 ? D : ~~O) < 0 ? (O += D) < 0 && (O = 0) : D < O && (O = D), O < b && (O = b), this.subarray(b, O));
return Object.setPrototypeOf(D, r.prototype), D;
}, r.prototype.readUIntLE = function(b, O, D) {
b >>>= 0, O >>>= 0, D || x(b, O, this.length);
for (var B = this[b], Y = 1, J = 0; ++J < O && (Y *= 256); )
B += this[b + J] * Y;
return B;
}, r.prototype.readUIntBE = function(b, O, D) {
b >>>= 0, O >>>= 0, D || x(b, O, this.length);
for (var B = this[b + --O], Y = 1; 0 < O && (Y *= 256); )
B += this[b + --O] * Y;
return B;
}, r.prototype.readUInt8 = function(b, O) {
return b >>>= 0, O || x(b, 1, this.length), this[b];
}, r.prototype.readUInt16LE = function(b, O) {
return b >>>= 0, O || x(b, 2, this.length), this[b] | this[b + 1] << 8;
}, r.prototype.readUInt16BE = function(b, O) {
return b >>>= 0, O || x(b, 2, this.length), this[b] << 8 | this[b + 1];
}, r.prototype.readUInt32LE = function(b, O) {
return b >>>= 0, O || x(b, 4, this.length), (this[b] | this[b + 1] << 8 | this[b + 2] << 16) + 16777216 * this[b + 3];
}, r.prototype.readUInt32BE = function(b, O) {
return b >>>= 0, O || x(b, 4, this.length), 16777216 * this[b] + (this[b + 1] << 16 | this[b + 2] << 8 | this[b + 3]);
}, r.prototype.readIntLE = function(b, O, D) {
b >>>= 0, O >>>= 0, D || x(b, O, this.length);
for (var B = this[b], Y = 1, J = 0; ++J < O && (Y *= 256); )
B += this[b + J] * Y;
return (Y *= 128) <= B && (B -= Math.pow(2, 8 * O)), B;
}, r.prototype.readIntBE = function(b, O, D) {
b >>>= 0, O >>>= 0, D || x(b, O, this.length);
for (var B = O, Y = 1, J = this[b + --B]; 0 < B && (Y *= 256); )
J += this[b + --B] * Y;
return (Y *= 128) <= J && (J -= Math.pow(2, 8 * O)), J;
}, r.prototype.readInt8 = function(b, O) {
return b >>>= 0, O || x(b, 1, this.length), 128 & this[b] ? -1 * (255 - this[b] + 1) : this[b];
}, r.prototype.readInt16LE = function(b, O) {
return b >>>= 0, O || x(b, 2, this.length), O = this[b] | this[b + 1] << 8, 32768 & O ? 4294901760 | O : O;
}, r.prototype.readInt16BE = function(b, O) {
return b >>>= 0, O || x(b, 2, this.length), O = this[b + 1] | this[b] << 8, 32768 & O ? 4294901760 | O : O;
}, r.prototype.readInt32LE = function(b, O) {
return b >>>= 0, O || x(b, 4, this.length), this[b] | this[b + 1] << 8 | this[b + 2] << 16 | this[b + 3] << 24;
}, r.prototype.readInt32BE = function(b, O) {
return b >>>= 0, O || x(b, 4, this.length), this[b] << 24 | this[b + 1] << 16 | this[b + 2] << 8 | this[b + 3];
}, r.prototype.readFloatLE = function(b, O) {
return b >>>= 0, O || x(b, 4, this.length), u.read(this, b, !0, 23, 4);
}, r.prototype.readFloatBE = function(b, O) {
return b >>>= 0, O || x(b, 4, this.length), u.read(this, b, !1, 23, 4);
}, r.prototype.readDoubleLE = function(