@rive-app/webgl
Version:
Rive's webgl based web api.
1,864 lines (1,860 loc) • 310 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["rive"] = factory();
else
root["rive"] = factory();
})(this, () => {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
var Rive = (() => {
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
return (
function(moduleArg = {}) {
var moduleRtn;
var l = moduleArg, aa, ba, ca = new Promise((a, b) => {
aa = a;
ba = b;
}), da = "object" == typeof window, ea = "function" == typeof importScripts;
function fa() {
function a(g) {
const k = d;
c = b = 0;
d = new Map();
k.forEach(m => {
try {
m(g);
} catch (p) {
console.error(p);
}
});
this.jb();
e && e.Ib();
}
let b = 0, c = 0, d = new Map(), e = null, f = null;
this.requestAnimationFrame = function(g) {
b ||= requestAnimationFrame(a.bind(this));
const k = ++c;
d.set(k, g);
return k;
};
this.cancelAnimationFrame = function(g) {
d.delete(g);
b && 0 == d.size && (cancelAnimationFrame(b), b = 0);
};
this.Gb = function(g) {
f && (document.body.remove(f), f = null);
g || (f = document.createElement("div"), f.style.backgroundColor = "black", f.style.position = "fixed", f.style.right = 0, f.style.top = 0, f.style.color = "white", f.style.padding = "4px", f.innerHTML = "RIVE FPS", g = function(k) {
f.innerHTML = "RIVE FPS " + k.toFixed(1);
}, document.body.appendChild(f));
e = new function() {
let k = 0, m = 0;
this.Ib = function() {
var p = performance.now();
m ? (++k, p -= m, 1000 < p && (g(1000 * k / p), k = m = 0)) : (m = p, k = 0);
};
}();
};
this.jb = function() {
};
}
function ia() {
console.assert(!0);
const a = new Map();
let b = -Infinity;
this.push = function(c) {
c = c + 255 >> 8;
a.has(c) && clearTimeout(a.get(c));
a.set(c, setTimeout(function() {
a.delete(c);
0 == a.length ? b = -Infinity : c == b && (b = Math.max(...a.keys()), console.assert(b < c));
}, 1000));
b = Math.max(c, b);
return b << 8;
};
}
const ja = l.onRuntimeInitialized;
l.onRuntimeInitialized = function() {
ja && ja();
let a = l.decodeAudio;
l.decodeAudio = function(e, f) {
e = a(e);
f(e);
};
let b = l.decodeFont;
l.decodeFont = function(e, f) {
e = b(e);
f(e);
};
const c = l.FileAssetLoader;
l.ptrToAsset = e => {
let f = l.ptrToFileAsset(e);
return f.isImage ? l.ptrToImageAsset(e) : f.isFont ? l.ptrToFontAsset(e) : f.isAudio ? l.ptrToAudioAsset(e) : f;
};
l.CustomFileAssetLoader = c.extend("CustomFileAssetLoader", {__construct:function({loadContents:e}) {
this.__parent.__construct.call(this);
this.yb = e;
}, loadContents:function(e, f) {
e = l.ptrToAsset(e);
return this.yb(e, f);
},});
l.CDNFileAssetLoader = c.extend("CDNFileAssetLoader", {__construct:function() {
this.__parent.__construct.call(this);
}, loadContents:function(e) {
let f = l.ptrToAsset(e);
e = f.cdnUuid;
if ("" === e) {
return !1;
}
(function(g, k) {
var m = new XMLHttpRequest();
m.responseType = "arraybuffer";
m.onreadystatechange = function() {
4 == m.readyState && 200 == m.status && k(m);
};
m.open("GET", g, !0);
m.send(null);
})(f.cdnBaseUrl + "/" + e, g => {
f.decode(new Uint8Array(g.response));
});
return !0;
},});
l.FallbackFileAssetLoader = c.extend("FallbackFileAssetLoader", {__construct:function() {
this.__parent.__construct.call(this);
this.eb = [];
}, addLoader:function(e) {
this.eb.push(e);
}, loadContents:function(e, f) {
for (let g of this.eb) {
if (g.loadContents(e, f)) {
return !0;
}
}
return !1;
},});
let d = l.computeAlignment;
l.computeAlignment = function(e, f, g, k, m = 1.0) {
return d.call(this, e, f, g, k, m);
};
};
const ka = l.onRuntimeInitialized;
l.onRuntimeInitialized = function() {
function a(t) {
this.G = t;
this.vb = t.getContext("2d");
this.Ab = e;
this.R = [];
this.ia = 0;
this.clear = function() {
console.assert(0 == this.ia);
this.R = [];
f.delete(this);
};
this.save = function() {
++this.ia;
this.R.push(e.save.bind(e));
};
this.restore = function() {
0 < this.ia && (this.R.push(e.restore.bind(e)), --this.ia);
};
this.transform = function(u) {
this.R.push(e.transform.bind(e, u));
};
this.align = function(u, z, C, E, M = 1.0) {
this.R.push(e.align.bind(e, u, z, C, E, M));
};
this.flush = function() {
console.assert(0 == this.ia);
f.add(this);
d && c();
};
}
function b(t) {
var u = {alpha:1, depth:0, stencil:8, antialias:0, premultipliedAlpha:1, preserveDrawingBuffer:0, powerPreference:"high-performance", failIfMajorPerformanceCaveat:0, enableExtensionsByDefault:1, explicitSwapControl:0, renderViaOffscreenBackBuffer:0,}, z = t.getContext("webgl2", u);
z ||= t.getContext("webgl", u);
var C = z, E = la(ma), M = {handle:E, attributes:u, version:u.zc, Sa:C};
C.canvas && (C.canvas.ic = M);
ma[E] = M;
("undefined" == typeof u.Fb || u.Fb) && na(M);
oa(E);
u = g(t.width, t.height);
u.xb = E;
u.G = t;
u.Ua = t.width;
u.Ta = t.height;
u.wb = z;
return u;
}
function c() {
if (e) {
var t = e.zb, u = 0, z = 0, C = 0, E = Array(f.size), M = 0;
for (var N of f) {
N.ca = Math.min(N.G.width, t), N.ba = Math.min(N.G.height, t), N.Ha = N.ba * N.ca, u = Math.max(u, N.ca), z = Math.max(z, N.ba), C += N.Ha, E[M++] = N;
}
f.clear();
if (!(0 >= C)) {
u = 1 << (0 >= u ? 0 : 32 - Math.clz32(u - 1));
for (z = 1 << (0 >= z ? 0 : 32 - Math.clz32(z - 1)); z * u < C;) {
u <= z ? u *= 2 : z *= 2;
}
u = Math.min(u, t);
u = Math.min(z, t);
E.sort((ha, yb) => yb.Ha - ha.Ha);
C = new l.DynamicRectanizer(t);
for (N = 0; N < E.length;) {
C.reset(u, z);
for (M = N; M < E.length; ++M) {
var O = E[M], L = C.addRect(O.ca, O.ba);
if (0 > L) {
console.assert(M > N);
break;
}
O.oa = L & 65535;
O.pa = L >> 16;
}
O = m.push(C.drawWidth());
L = p.push(C.drawHeight());
console.assert(O >= C.drawWidth());
console.assert(L >= C.drawHeight());
console.assert(O <= t);
console.assert(L <= t);
e.G.width != O && (e.G.width = O);
e.G.height != L && (e.G.height = L);
e.clear();
for (O = N; O < M; ++O) {
L = E[O];
e.saveClipRect(L.oa, L.pa, L.oa + L.ca, L.pa + L.ba);
let ha = new l.Mat2D();
ha.xx = L.ca / L.G.width;
ha.yy = L.ba / L.G.height;
ha.xy = ha.yx = 0;
ha.tx = L.oa;
ha.ty = L.pa;
e.transform(ha);
for (const yb of L.R) {
yb();
}
e.restoreClipRect();
L.R = [];
}
for (e.flush(); N < M; ++N) {
O = E[N], L = O.vb, L.globalCompositeOperation = "copy", L.drawImage(e.G, O.oa, O.pa, O.ca, O.ba, 0, 0, O.G.width, O.G.height);
}
N = M;
}
}
}
}
ka && ka();
const d = navigator.userAgent.match(/firefox|fxios/i);
let e = null;
const f = new Set(), g = l.makeRenderer;
l.makeRenderer = function(t, u) {
return u ? (e || (e = b(document.createElement("canvas")), u = e.wb, e.zb = Math.min(u.getParameter(u.MAX_RENDERBUFFER_SIZE), u.getParameter(u.MAX_TEXTURE_SIZE))), new a(t)) : b(t);
};
const k = l.Artboard.prototype.draw;
l.Artboard.prototype.draw = function(t) {
t.R ? t.R.push(k.bind(this, t.Ab)) : k.call(this, t);
};
const m = new ia(), p = new ia(), r = new fa();
l.requestAnimationFrame = r.requestAnimationFrame.bind(r);
l.cancelAnimationFrame = r.cancelAnimationFrame.bind(r);
l.enableFPSCounter = r.Gb.bind(r);
r.jb = c;
l.resolveAnimationFrame = c;
let w = l.load;
l.load = function(t, u, z = !0) {
const C = new l.FallbackFileAssetLoader();
void 0 !== u && C.addLoader(u);
z && (u = new l.CDNFileAssetLoader(), C.addLoader(u));
return Promise.resolve(w(t, C));
};
const y = l.WebGLRenderer.prototype.clear;
l.WebGLRenderer.prototype.clear = function() {
oa(this.xb);
const t = this.G;
if (this.Ua != t.width || this.Ta != t.height) {
this.resize(t.width, t.height), this.Ua = t.width, this.Ta = t.height;
}
y.call(this);
};
l.decodeImage = function(t, u) {
t = l.decodeImageSkia(t);
u(t);
};
let q = l.Renderer.prototype.align;
l.Renderer.prototype.align = function(t, u, z, C, E = 1.0) {
q.call(this, t, u, z, C, E);
};
};
var pa = Object.assign({}, l), qa = "./this.program", ra = "", sa, ta;
if (da || ea) {
ea ? ra = self.location.href : "undefined" != typeof document && document.currentScript && (ra = document.currentScript.src), _scriptName && (ra = _scriptName), ra.startsWith("blob:") ? ra = "" : ra = ra.substr(0, ra.replace(/[?#].*/, "").lastIndexOf("/") + 1), ea && (ta = a => {
var b = new XMLHttpRequest();
b.open("GET", a, !1);
b.responseType = "arraybuffer";
b.send(null);
return new Uint8Array(b.response);
}), sa = (a, b, c) => {
if (ua(a)) {
var d = new XMLHttpRequest();
d.open("GET", a, !0);
d.responseType = "arraybuffer";
d.onload = () => {
200 == d.status || 0 == d.status && d.response ? b(d.response) : c();
};
d.onerror = c;
d.send(null);
} else {
fetch(a, {credentials:"same-origin"}).then(e => e.ok ? e.arrayBuffer() : Promise.reject(Error(e.status + " : " + e.url))).then(b, c);
}
};
}
var va = l.print || console.log.bind(console), wa = l.printErr || console.error.bind(console);
Object.assign(l, pa);
pa = null;
l.thisProgram && (qa = l.thisProgram);
var xa;
l.wasmBinary && (xa = l.wasmBinary);
var ya, za = !1, n, v, Aa, Ba, x, A, B, Ca;
function Da() {
var a = ya.buffer;
l.HEAP8 = n = new Int8Array(a);
l.HEAP16 = Aa = new Int16Array(a);
l.HEAPU8 = v = new Uint8Array(a);
l.HEAPU16 = Ba = new Uint16Array(a);
l.HEAP32 = x = new Int32Array(a);
l.HEAPU32 = A = new Uint32Array(a);
l.HEAPF32 = B = new Float32Array(a);
l.HEAPF64 = Ca = new Float64Array(a);
}
var Ea = [], Fa = [], Ga = [];
function Ha() {
var a = l.preRun.shift();
Ea.unshift(a);
}
var Ia = 0, Ja = null, Ka = null;
function La(a) {
l.onAbort?.(a);
a = "Aborted(" + a + ")";
wa(a);
za = !0;
a = new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info.");
ba(a);
throw a;
}
var Ma = a => a.startsWith("data:application/octet-stream;base64,"), ua = a => a.startsWith("file://"), Na;
function Oa(a) {
if (a == Na && xa) {
return new Uint8Array(xa);
}
if (ta) {
return ta(a);
}
throw "both async and sync fetching of the wasm failed";
}
function Pa(a) {
return xa ? Promise.resolve().then(() => Oa(a)) : new Promise((b, c) => {
sa(a, d => b(new Uint8Array(d)), () => {
try {
b(Oa(a));
} catch (d) {
c(d);
}
});
});
}
function Qa(a, b, c) {
return Pa(a).then(d => WebAssembly.instantiate(d, b)).then(c, d => {
wa(`failed to asynchronously prepare wasm: ${d}`);
La(d);
});
}
function Ra(a, b) {
var c = Na;
return xa || "function" != typeof WebAssembly.instantiateStreaming || Ma(c) || ua(c) || "function" != typeof fetch ? Qa(c, a, b) : fetch(c, {credentials:"same-origin"}).then(d => WebAssembly.instantiateStreaming(d, a).then(b, function(e) {
wa(`wasm streaming compile failed: ${e}`);
wa("falling back to ArrayBuffer instantiation");
return Qa(c, a, b);
}));
}
var Sa, Ta, Xa = {719040:(a, b, c, d, e) => {
if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
return 0;
}
if ("undefined" === typeof window.h) {
window.h = {Ca:0};
window.h.H = {};
window.h.H.Aa = a;
window.h.H.capture = b;
window.h.H.Ja = c;
window.h.ga = {};
window.h.ga.stopped = d;
window.h.ga.qb = e;
let f = window.h;
f.C = [];
f.fc = function(g) {
for (var k = 0; k < f.C.length; ++k) {
if (null == f.C[k]) {
return f.C[k] = g, k;
}
}
f.C.push(g);
return f.C.length - 1;
};
f.ub = function(g) {
for (f.C[g] = null; 0 < f.C.length;) {
if (null == f.C[f.C.length - 1]) {
f.C.pop();
} else {
break;
}
}
};
f.Gc = function(g) {
for (var k = 0; k < f.C.length; ++k) {
if (f.C[k] == g) {
return f.ub(k);
}
}
};
f.ra = function(g) {
return f.C[g];
};
f.Ra = ["touchend", "click"];
f.unlock = function() {
for (var g = 0; g < f.C.length; ++g) {
var k = f.C[g];
null != k && null != k.J && k.state === f.ga.qb && k.J.resume().then(() => {
Ua(k.kb);
}, m => {
console.error("Failed to resume audiocontext", m);
});
}
f.Ra.map(function(m) {
document.removeEventListener(m, f.unlock, !0);
});
};
f.Ra.map(function(g) {
document.addEventListener(g, f.unlock, !0);
});
}
window.h.Ca += 1;
return 1;
}, 721218:() => {
"undefined" !== typeof window.h && (window.h.Ra.map(function(a) {
document.removeEventListener(a, window.h.unlock, !0);
}), --window.h.Ca, 0 === window.h.Ca && delete window.h);
}, 721522:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 721626:() => {
try {
var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
a.close();
return b;
} catch (c) {
return 0;
}
}, 721797:(a, b, c, d, e, f) => {
if ("undefined" === typeof window.h) {
return -1;
}
var g = {}, k = {};
a == window.h.H.Aa && 0 != c && (k.sampleRate = c);
g.J = new (window.AudioContext || window.webkitAudioContext)(k);
g.J.suspend();
g.state = window.h.ga.stopped;
c = 0;
a != window.h.H.Aa && (c = b);
g.W = g.J.createScriptProcessor(d, c, b);
g.W.onaudioprocess = function(m) {
if (null == g.sa || 0 == g.sa.length) {
g.sa = new Float32Array(B.buffer, e, d * b);
}
if (a == window.h.H.capture || a == window.h.H.Ja) {
for (var p = 0; p < b; p += 1) {
for (var r = m.inputBuffer.getChannelData(p), w = g.sa, y = 0; y < d; y += 1) {
w[y * b + p] = r[y];
}
}
Va(f, d, e);
}
if (a == window.h.H.Aa || a == window.h.H.Ja) {
for (Wa(f, d, e), p = 0; p < m.outputBuffer.numberOfChannels; ++p) {
for (r = m.outputBuffer.getChannelData(p), w = g.sa, y = 0; y < d; y += 1) {
r[y] = w[y * b + p];
}
}
} else {
for (p = 0; p < m.outputBuffer.numberOfChannels; ++p) {
m.outputBuffer.getChannelData(p).fill(0.0);
}
}
};
a != window.h.H.capture && a != window.h.H.Ja || navigator.mediaDevices.getUserMedia({audio:!0, video:!1}).then(function(m) {
g.Da = g.J.createMediaStreamSource(m);
g.Da.connect(g.W);
g.W.connect(g.J.destination);
}).catch(function(m) {
console.log("Failed to get user media: " + m);
});
a == window.h.H.Aa && g.W.connect(g.J.destination);
g.kb = f;
return window.h.fc(g);
}, 724674:a => window.h.ra(a).J.sampleRate, 724747:a => {
a = window.h.ra(a);
void 0 !== a.W && (a.W.onaudioprocess = function() {
}, a.W.disconnect(), a.W = void 0);
void 0 !== a.Da && (a.Da.disconnect(), a.Da = void 0);
a.J.close();
a.J = void 0;
a.kb = void 0;
}, 725147:a => {
window.h.ub(a);
}, 725197:a => {
a = window.h.ra(a);
a.J.resume();
a.state = window.h.ga.qb;
}, 725336:a => {
a = window.h.ra(a);
a.J.suspend();
a.state = window.h.ga.stopped;
}}, Ya = a => {
for (; 0 < a.length;) {
a.shift()(l);
}
};
function Za() {
var a = x[+$a >> 2];
$a += 4;
return a;
}
var ab = (a, b) => {
for (var c = 0, d = a.length - 1; 0 <= d; d--) {
var e = a[d];
"." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--);
}
if (b) {
for (; c; c--) {
a.unshift("..");
}
}
return a;
}, bb = a => {
var b = "/" === a.charAt(0), c = "/" === a.substr(-1);
(a = ab(a.split("/").filter(d => !!d), !b).join("/")) || b || (a = ".");
a && c && (a += "/");
return (b ? "/" : "") + a;
}, cb = a => {
var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
a = b[0];
b = b[1];
if (!a && !b) {
return ".";
}
b &&= b.substr(0, b.length - 1);
return a + b;
}, db = a => {
if ("/" === a) {
return "/";
}
a = bb(a);
a = a.replace(/\/$/, "");
var b = a.lastIndexOf("/");
return -1 === b ? a : a.substr(b + 1);
}, eb = () => {
if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) {
return a => crypto.getRandomValues(a);
}
La("initRandomDevice");
}, fb = a => (fb = eb())(a), gb = (...a) => {
for (var b = "", c = !1, d = a.length - 1; -1 <= d && !c; d--) {
c = 0 <= d ? a[d] : "/";
if ("string" != typeof c) {
throw new TypeError("Arguments to path.resolve must be strings");
}
if (!c) {
return "";
}
b = c + "/" + b;
c = "/" === c.charAt(0);
}
b = ab(b.split("/").filter(e => !!e), !c).join("/");
return (c ? "/" : "") + b || ".";
}, hb = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, D = (a, b, c) => {
var d = b + c;
for (c = b; a[c] && !(c >= d);) {
++c;
}
if (16 < c - b && a.buffer && hb) {
return hb.decode(a.subarray(b, c));
}
for (d = ""; b < c;) {
var e = a[b++];
if (e & 128) {
var f = a[b++] & 63;
if (192 == (e & 224)) {
d += String.fromCharCode((e & 31) << 6 | f);
} else {
var g = a[b++] & 63;
e = 224 == (e & 240) ? (e & 15) << 12 | f << 6 | g : (e & 7) << 18 | f << 12 | g << 6 | a[b++] & 63;
65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));
}
} else {
d += String.fromCharCode(e);
}
}
return d;
}, ib = [], jb = a => {
for (var b = 0, c = 0; c < a.length; ++c) {
var d = a.charCodeAt(c);
127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3;
}
return b;
}, kb = (a, b, c, d) => {
if (!(0 < d)) {
return 0;
}
var e = c;
d = c + d - 1;
for (var f = 0; f < a.length; ++f) {
var g = a.charCodeAt(f);
if (55296 <= g && 57343 >= g) {
var k = a.charCodeAt(++f);
g = 65536 + ((g & 1023) << 10) | k & 1023;
}
if (127 >= g) {
if (c >= d) {
break;
}
b[c++] = g;
} else {
if (2047 >= g) {
if (c + 1 >= d) {
break;
}
b[c++] = 192 | g >> 6;
} else {
if (65535 >= g) {
if (c + 2 >= d) {
break;
}
b[c++] = 224 | g >> 12;
} else {
if (c + 3 >= d) {
break;
}
b[c++] = 240 | g >> 18;
b[c++] = 128 | g >> 12 & 63;
}
b[c++] = 128 | g >> 6 & 63;
}
b[c++] = 128 | g & 63;
}
}
b[c] = 0;
return c - e;
};
function lb(a, b) {
var c = Array(jb(a) + 1);
a = kb(a, c, 0, c.length);
b && (c.length = a);
return c;
}
var mb = [];
function nb(a, b) {
mb[a] = {input:[], F:[], T:b};
ob(a, pb);
}
var pb = {open(a) {
var b = mb[a.node.Ba];
if (!b) {
throw new F(43);
}
a.s = b;
a.seekable = !1;
}, close(a) {
a.s.T.qa(a.s);
}, qa(a) {
a.s.T.qa(a.s);
}, read(a, b, c, d) {
if (!a.s || !a.s.T.cb) {
throw new F(60);
}
for (var e = 0, f = 0; f < d; f++) {
try {
var g = a.s.T.cb(a.s);
} catch (k) {
throw new F(29);
}
if (void 0 === g && 0 === e) {
throw new F(6);
}
if (null === g || void 0 === g) {
break;
}
e++;
b[c + f] = g;
}
e && (a.node.timestamp = Date.now());
return e;
}, write(a, b, c, d) {
if (!a.s || !a.s.T.Ma) {
throw new F(60);
}
try {
for (var e = 0; e < d; e++) {
a.s.T.Ma(a.s, b[c + e]);
}
} catch (f) {
throw new F(29);
}
d && (a.node.timestamp = Date.now());
return e;
},}, qb = {cb() {
a: {
if (!ib.length) {
var a = null;
"undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n"));
if (!a) {
a = null;
break a;
}
ib = lb(a, !0);
}
a = ib.shift();
}
return a;
}, Ma(a, b) {
null === b || 10 === b ? (va(D(a.F, 0)), a.F = []) : 0 != b && a.F.push(b);
}, qa(a) {
a.F && 0 < a.F.length && (va(D(a.F, 0)), a.F = []);
}, Rb() {
return {oc:25856, qc:5, nc:191, pc:35387, mc:[3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]};
}, Sb() {
return 0;
}, Tb() {
return [24, 80];
},}, rb = {Ma(a, b) {
null === b || 10 === b ? (wa(D(a.F, 0)), a.F = []) : 0 != b && a.F.push(b);
}, qa(a) {
a.F && 0 < a.F.length && (wa(D(a.F, 0)), a.F = []);
},};
function sb(a, b) {
var c = a.l ? a.l.length : 0;
c >= b || (b = Math.max(b, c * (1048576 > c ? 2.0 : 1.125) >>> 0), 0 != c && (b = Math.max(b, 256)), c = a.l, a.l = new Uint8Array(b), 0 < a.v && a.l.set(c.subarray(0, a.v), 0));
}
var G = {M:null, S() {
return G.createNode(null, "/", 16895, 0);
}, createNode(a, b, c, d) {
if (24576 === (c & 61440) || 4096 === (c & 61440)) {
throw new F(63);
}
G.M || (G.M = {dir:{node:{V:G.j.V, O:G.j.O, ja:G.j.ja, ya:G.j.ya, ob:G.j.ob, tb:G.j.tb, pb:G.j.pb, nb:G.j.nb, Ea:G.j.Ea}, stream:{Z:G.m.Z}}, file:{node:{V:G.j.V, O:G.j.O}, stream:{Z:G.m.Z, read:G.m.read, write:G.m.write, Va:G.m.Va, gb:G.m.gb, ib:G.m.ib}}, link:{node:{V:G.j.V, O:G.j.O, ka:G.j.ka}, stream:{}}, Wa:{node:{V:G.j.V, O:G.j.O}, stream:tb}});
c = ub(a, b, c, d);
16384 === (c.mode & 61440) ? (c.j = G.M.dir.node, c.m = G.M.dir.stream, c.l = {}) : 32768 === (c.mode & 61440) ? (c.j = G.M.file.node, c.m = G.M.file.stream, c.v = 0, c.l = null) : 40960 === (c.mode & 61440) ? (c.j = G.M.link.node, c.m = G.M.link.stream) : 8192 === (c.mode & 61440) && (c.j = G.M.Wa.node, c.m = G.M.Wa.stream);
c.timestamp = Date.now();
a && (a.l[b] = c, a.timestamp = c.timestamp);
return c;
}, vc(a) {
return a.l ? a.l.subarray ? a.l.subarray(0, a.v) : new Uint8Array(a.l) : new Uint8Array(0);
}, j:{V(a) {
var b = {};
b.tc = 8192 === (a.mode & 61440) ? a.id : 1;
b.xc = a.id;
b.mode = a.mode;
b.Cc = 1;
b.uid = 0;
b.wc = 0;
b.Ba = a.Ba;
16384 === (a.mode & 61440) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.v : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
b.kc = new Date(a.timestamp);
b.Ac = new Date(a.timestamp);
b.rc = new Date(a.timestamp);
b.Bb = 4096;
b.lc = Math.ceil(b.size / b.Bb);
return b;
}, O(a, b) {
void 0 !== b.mode && (a.mode = b.mode);
void 0 !== b.timestamp && (a.timestamp = b.timestamp);
if (void 0 !== b.size && (b = b.size, a.v != b)) {
if (0 == b) {
a.l = null, a.v = 0;
} else {
var c = a.l;
a.l = new Uint8Array(b);
c && a.l.set(c.subarray(0, Math.min(b, a.v)));
a.v = b;
}
}
}, ja() {
throw vb[44];
}, ya(a, b, c, d) {
return G.createNode(a, b, c, d);
}, ob(a, b, c) {
if (16384 === (a.mode & 61440)) {
try {
var d = wb(b, c);
} catch (f) {
}
if (d) {
for (var e in d.l) {
throw new F(55);
}
}
}
delete a.parent.l[a.name];
a.parent.timestamp = Date.now();
a.name = c;
b.l[c] = a;
b.timestamp = a.parent.timestamp;
}, tb(a, b) {
delete a.l[b];
a.timestamp = Date.now();
}, pb(a, b) {
var c = wb(a, b), d;
for (d in c.l) {
throw new F(55);
}
delete a.l[b];
a.timestamp = Date.now();
}, nb(a) {
var b = [".", ".."], c;
for (c of Object.keys(a.l)) {
b.push(c);
}
return b;
}, Ea(a, b, c) {
a = G.createNode(a, b, 41471, 0);
a.link = c;
return a;
}, ka(a) {
if (40960 !== (a.mode & 61440)) {
throw new F(28);
}
return a.link;
},}, m:{read(a, b, c, d, e) {
var f = a.node.l;
if (e >= a.node.v) {
return 0;
}
a = Math.min(a.node.v - e, d);
if (8 < a && f.subarray) {
b.set(f.subarray(e, e + a), c);
} else {
for (d = 0; d < a; d++) {
b[c + d] = f[e + d];
}
}
return a;
}, write(a, b, c, d, e, f) {
b.buffer === n.buffer && (f = !1);
if (!d) {
return 0;
}
a = a.node;
a.timestamp = Date.now();
if (b.subarray && (!a.l || a.l.subarray)) {
if (f) {
return a.l = b.subarray(c, c + d), a.v = d;
}
if (0 === a.v && 0 === e) {
return a.l = b.slice(c, c + d), a.v = d;
}
if (e + d <= a.v) {
return a.l.set(b.subarray(c, c + d), e), d;
}
}
sb(a, e + d);
if (a.l.subarray && b.subarray) {
a.l.set(b.subarray(c, c + d), e);
} else {
for (f = 0; f < d; f++) {
a.l[e + f] = b[c + f];
}
}
a.v = Math.max(a.v, e + d);
return d;
}, Z(a, b, c) {
1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.v);
if (0 > b) {
throw new F(28);
}
return b;
}, Va(a, b, c) {
sb(a.node, b + c);
a.node.v = Math.max(a.node.v, b + c);
}, gb(a, b, c, d, e) {
if (32768 !== (a.node.mode & 61440)) {
throw new F(43);
}
a = a.node.l;
if (e & 2 || a.buffer !== n.buffer) {
if (0 < c || c + b < a.length) {
a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b);
}
c = !0;
b = 65536 * Math.ceil(b / 65536);
(e = xb(65536, b)) ? (v.fill(0, e, e + b), b = e) : b = 0;
if (!b) {
throw new F(48);
}
n.set(a, b);
} else {
c = !1, b = a.byteOffset;
}
return {o:b, jc:c};
}, ib(a, b, c, d) {
G.m.write(a, b, 0, d, c, !1);
return 0;
},},}, zb = (a, b) => {
var c = 0;
a && (c |= 365);
b && (c |= 146);
return c;
}, Ab = null, Bb = {}, Cb = [], Db = 1, Eb = null, Fb = !0, F = class {
constructor(a) {
this.name = "ErrnoError";
this.Y = a;
}
}, vb = {}, Gb = class {
constructor() {
this.h = {};
this.node = null;
}
get flags() {
return this.h.flags;
}
set flags(a) {
this.h.flags = a;
}
get position() {
return this.h.position;
}
set position(a) {
this.h.position = a;
}
}, Hb = class {
constructor(a, b, c, d) {
a ||= this;
this.parent = a;
this.S = a.S;
this.za = null;
this.id = Db++;
this.name = b;
this.mode = c;
this.j = {};
this.m = {};
this.Ba = d;
}
get read() {
return 365 === (this.mode & 365);
}
set read(a) {
a ? this.mode |= 365 : this.mode &= -366;
}
get write() {
return 146 === (this.mode & 146);
}
set write(a) {
a ? this.mode |= 146 : this.mode &= -147;
}
};
function Ib(a, b = {}) {
a = gb(a);
if (!a) {
return {path:"", node:null};
}
b = Object.assign({bb:!0, Oa:0}, b);
if (8 < b.Oa) {
throw new F(32);
}
a = a.split("/").filter(g => !!g);
for (var c = Ab, d = "/", e = 0; e < a.length; e++) {
var f = e === a.length - 1;
if (f && b.parent) {
break;
}
c = wb(c, a[e]);
d = bb(d + "/" + a[e]);
c.za && (!f || f && b.bb) && (c = c.za.root);
if (!f || b.ab) {
for (f = 0; 40960 === (c.mode & 61440);) {
if (c = Jb(d), d = gb(cb(d), c), c = Ib(d, {Oa:b.Oa + 1}).node, 40 < f++) {
throw new F(32);
}
}
}
}
return {path:d, node:c};
}
function Kb(a) {
for (var b;;) {
if (a === a.parent) {
return a = a.S.hb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
}
b = b ? `${a.name}/${b}` : a.name;
a = a.parent;
}
}
function Lb(a, b) {
for (var c = 0, d = 0; d < b.length; d++) {
c = (c << 5) - c + b.charCodeAt(d) | 0;
}
return (a + c >>> 0) % Eb.length;
}
function wb(a, b) {
var c = 16384 === (a.mode & 61440) ? (c = Mb(a, "x")) ? c : a.j.ja ? 0 : 2 : 54;
if (c) {
throw new F(c);
}
for (c = Eb[Lb(a.id, b)]; c; c = c.Vb) {
var d = c.name;
if (c.parent.id === a.id && d === b) {
return c;
}
}
return a.j.ja(a, b);
}
function ub(a, b, c, d) {
a = new Hb(a, b, c, d);
b = Lb(a.parent.id, a.name);
a.Vb = Eb[b];
return Eb[b] = a;
}
function Nb(a) {
var b = ["r", "w", "rw"][a & 3];
a & 512 && (b += "w");
return b;
}
function Mb(a, b) {
if (Fb) {
return 0;
}
if (!b.includes("r") || a.mode & 292) {
if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) {
return 2;
}
} else {
return 2;
}
return 0;
}
function Ob(a, b) {
try {
return wb(a, b), 20;
} catch (c) {
}
return Mb(a, "wx");
}
function Pb(a) {
a = Cb[a];
if (!a) {
throw new F(8);
}
return a;
}
function Qb(a, b = -1) {
a = Object.assign(new Gb(), a);
if (-1 == b) {
a: {
for (b = 0; 4096 >= b; b++) {
if (!Cb[b]) {
break a;
}
}
throw new F(33);
}
}
a.U = b;
return Cb[b] = a;
}
function Rb(a, b = -1) {
a = Qb(a, b);
a.m?.uc?.(a);
return a;
}
var tb = {open(a) {
a.m = Bb[a.node.Ba].m;
a.m.open?.(a);
}, Z() {
throw new F(70);
},};
function ob(a, b) {
Bb[a] = {m:b};
}
function Sb(a, b) {
var c = "/" === b;
if (c && Ab) {
throw new F(10);
}
if (!c && b) {
var d = Ib(b, {bb:!1});
b = d.path;
d = d.node;
if (d.za) {
throw new F(10);
}
if (16384 !== (d.mode & 61440)) {
throw new F(54);
}
}
b = {type:a, Ec:{}, hb:b, Ub:[]};
a = a.S(b);
a.S = b;
b.root = a;
c ? Ab = a : d && (d.za = b, d.S && d.S.Ub.push(b));
}
function Tb(a, b, c) {
var d = Ib(a, {parent:!0}).node;
a = db(a);
if (!a || "." === a || ".." === a) {
throw new F(28);
}
var e = Ob(d, a);
if (e) {
throw new F(e);
}
if (!d.j.ya) {
throw new F(63);
}
return d.j.ya(d, a, b, c);
}
function Ub(a) {
return Tb(a, 16895, 0);
}
function Vb(a, b, c) {
"undefined" == typeof c && (c = b, b = 438);
Tb(a, b | 8192, c);
}
function Wb(a, b) {
if (!gb(a)) {
throw new F(44);
}
var c = Ib(b, {parent:!0}).node;
if (!c) {
throw new F(44);
}
b = db(b);
var d = Ob(c, b);
if (d) {
throw new F(d);
}
if (!c.j.Ea) {
throw new F(63);
}
c.j.Ea(c, b, a);
}
function Jb(a) {
a = Ib(a).node;
if (!a) {
throw new F(44);
}
if (!a.j.ka) {
throw new F(28);
}
return gb(Kb(a.parent), a.j.ka(a));
}
function Xb(a, b, c) {
if ("" === a) {
throw new F(44);
}
if ("string" == typeof b) {
var d = {r:0, "r+":2, w:577, "w+":578, a:1089, "a+":1090,}[b];
if ("undefined" == typeof d) {
throw Error(`Unknown file open mode: ${b}`);
}
b = d;
}
c = b & 64 ? ("undefined" == typeof c ? 438 : c) & 4095 | 32768 : 0;
if ("object" == typeof a) {
var e = a;
} else {
a = bb(a);
try {
e = Ib(a, {ab:!(b & 131072)}).node;
} catch (f) {
}
}
d = !1;
if (b & 64) {
if (e) {
if (b & 128) {
throw new F(20);
}
} else {
e = Tb(a, c, 0), d = !0;
}
}
if (!e) {
throw new F(44);
}
8192 === (e.mode & 61440) && (b &= -513);
if (b & 65536 && 16384 !== (e.mode & 61440)) {
throw new F(54);
}
if (!d && (c = e ? 40960 === (e.mode & 61440) ? 32 : 16384 === (e.mode & 61440) && ("r" !== Nb(b) || b & 512) ? 31 : Mb(e, Nb(b)) : 44)) {
throw new F(c);
}
if (b & 512 && !d) {
c = e;
c = "string" == typeof c ? Ib(c, {ab:!0}).node : c;
if (!c.j.O) {
throw new F(63);
}
if (16384 === (c.mode & 61440)) {
throw new F(31);
}
if (32768 !== (c.mode & 61440)) {
throw new F(28);
}
if (d = Mb(c, "w")) {
throw new F(d);
}
c.j.O(c, {size:0, timestamp:Date.now()});
}
b &= -131713;
e = Qb({node:e, path:Kb(e), flags:b, seekable:!0, position:0, m:e.m, hc:[], error:!1});
e.m.open && e.m.open(e);
!l.logReadFiles || b & 1 || (Yb ||= {}, a in Yb || (Yb[a] = 1));
return e;
}
function Zb(a, b, c) {
if (null === a.U) {
throw new F(8);
}
if (!a.seekable || !a.m.Z) {
throw new F(70);
}
if (0 != c && 1 != c && 2 != c) {
throw new F(28);
}
a.position = a.m.Z(a, b, c);
a.hc = [];
}
var $b;
function ac(a, b, c) {
a = bb("/dev/" + a);
var d = zb(!!b, !!c);
bc ||= 64;
var e = bc++ << 8 | 0;
ob(e, {open(f) {
f.seekable = !1;
}, close() {
c?.buffer?.length && c(10);
}, read(f, g, k, m) {
for (var p = 0, r = 0; r < m; r++) {
try {
var w = b();
} catch (y) {
throw new F(29);
}
if (void 0 === w && 0 === p) {
throw new F(6);
}
if (null === w || void 0 === w) {
break;
}
p++;
g[k + r] = w;
}
p && (f.node.timestamp = Date.now());
return p;
}, write(f, g, k, m) {
for (var p = 0; p < m; p++) {
try {
c(g[k + p]);
} catch (r) {
throw new F(29);
}
}
m && (f.node.timestamp = Date.now());
return p;
}});
Vb(a, d, e);
}
var bc, cc = {}, Yb, $a = void 0, dc = (a, b) => Object.defineProperty(b, "name", {value:a}), ec = [], fc = [], H, gc = a => {
if (!a) {
throw new H("Cannot use deleted val. handle = " + a);
}
return fc[a];
}, hc = a => {
switch(a) {
case void 0:
return 2;
case null:
return 4;
case !0:
return 6;
case !1:
return 8;
default:
const b = ec.pop() || fc.length;
fc[b] = a;
fc[b + 1] = 1;
return b;
}
}, ic = a => {
var b = Error, c = dc(a, function(d) {
this.name = a;
this.message = d;
d = Error(d).stack;
void 0 !== d && (this.stack = this.toString() + "\n" + d.replace(/^Error(:[^\n]*)?\n/, ""));
});
c.prototype = Object.create(b.prototype);
c.prototype.constructor = c;
c.prototype.toString = function() {
return void 0 === this.message ? this.name : `${this.name}: ${this.message}`;
};
return c;
}, jc, kc, I = a => {
for (var b = ""; v[a];) {
b += kc[v[a++]];
}
return b;
}, lc = [], mc = () => {
for (; lc.length;) {
var a = lc.pop();
a.g.fa = !1;
a["delete"]();
}
}, nc, oc = {}, pc = (a, b) => {
if (void 0 === b) {
throw new H("ptr should not be undefined");
}
for (; a.B;) {
b = a.ma(b), a = a.B;
}
return b;
}, qc = {}, tc = a => {
a = rc(a);
var b = I(a);
sc(a);
return b;
}, uc = (a, b) => {
var c = qc[a];
if (void 0 === c) {
throw a = `${b} has unknown type ${tc(a)}`, new H(a);
}
return c;
}, vc = () => {
}, wc = !1, xc = (a, b, c) => {
if (b === c) {
return a;
}
if (void 0 === c.B) {
return null;
}
a = xc(a, b, c.B);
return null === a ? null : c.Eb(a);
}, yc = {}, zc = (a, b) => {
b = pc(a, b);
return oc[b];
}, Ac, Cc = (a, b) => {
if (!b.u || !b.o) {
throw new Ac("makeClassHandle requires ptr and ptrType");
}
if (!!b.I !== !!b.D) {
throw new Ac("Both smartPtrType and smartPtr must be specified");
}
b.count = {value:1};
return Bc(Object.create(a, {g:{value:b, writable:!0,},}));
}, Bc = a => {
if ("undefined" === typeof FinalizationRegistry) {
return Bc = b => b, a;
}
wc = new FinalizationRegistry(b => {
b = b.g;
--b.count.value;
0 === b.count.value && (b.D ? b.I.N(b.D) : b.u.i.N(b.o));
});
Bc = b => {
var c = b.g;
c.D && wc.register(b, {g:c}, b);
return b;
};
vc = b => {
wc.unregister(b);
};
return Bc(a);
}, Dc = {}, Ec = a => {
for (; a.length;) {
var b = a.pop();
a.pop()(b);
}
};
function Fc(a) {
return this.fromWireType(A[a >> 2]);
}
var Gc = {}, Hc = {}, J = (a, b, c) => {
function d(k) {
k = c(k);
if (k.length !== a.length) {
throw new Ac("Mismatched type converter count");
}
for (var m = 0; m < a.length; ++m) {
Ic(a[m], k[m]);
}
}
a.forEach(function(k) {
Hc[k] = b;
});
var e = Array(b.length), f = [], g = 0;
b.forEach((k, m) => {
qc.hasOwnProperty(k) ? e[m] = qc[k] : (f.push(k), Gc.hasOwnProperty(k) || (Gc[k] = []), Gc[k].push(() => {
e[m] = qc[k];
++g;
g === f.length && d(e);
}));
});
0 === f.length && d(e);
};
function Jc(a, b, c = {}) {
var d = b.name;
if (!a) {
throw new H(`type "${d}" must have a positive integer typeid pointer`);
}
if (qc.hasOwnProperty(a)) {
if (c.Ob) {
return;
}
throw new H(`Cannot register type '${d}' twice`);
}
qc[a] = b;
delete Hc[a];
Gc.hasOwnProperty(a) && (b = Gc[a], delete Gc[a], b.forEach(e => e()));
}
function Ic(a, b, c = {}) {
if (!("argPackAdvance" in b)) {
throw new TypeError("registerType registeredInstance requires argPackAdvance");
}
return Jc(a, b, c);
}
var Kc = a => {
throw new H(a.g.u.i.name + " instance already deleted");
};
function Lc() {
}
var Mc = (a, b, c) => {
if (void 0 === a[b].A) {
var d = a[b];
a[b] = function(...e) {
if (!a[b].A.hasOwnProperty(e.length)) {
throw new H(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${a[b].A})!`);
}
return a[b].A[e.length].apply(this, e);
};
a[b].A = [];
a[b].A[d.da] = d;
}
}, Nc = (a, b, c) => {
if (l.hasOwnProperty(a)) {
if (void 0 === c || void 0 !== l[a].A && void 0 !== l[a].A[c]) {
throw new H(`Cannot register public name '${a}' twice`);
}
Mc(l, a, a);
if (l.hasOwnProperty(c)) {
throw new H(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
}
l[a].A[c] = b;
} else {
l[a] = b, void 0 !== c && (l[a].Dc = c);
}
}, Oc = a => {
if (void 0 === a) {
return "_unknown";
}
a = a.replace(/[^a-zA-Z0-9_]/g, "$");
var b = a.charCodeAt(0);
return 48 <= b && 57 >= b ? `_${a}` : a;
};
function Pc(a, b, c, d, e, f, g, k) {
this.name = a;
this.constructor = b;
this.L = c;
this.N = d;
this.B = e;
this.Jb = f;
this.ma = g;
this.Eb = k;
this.lb = [];
}
var Qc = (a, b, c) => {
for (; b !== c;) {
if (!b.ma) {
throw new H(`Expected null or instance of ${c.name}, got an instance of ${b.name}`);
}
a = b.ma(a);
b = b.B;
}
return a;
};
function Rc(a, b) {
if (null === b) {
if (this.La) {
throw new H(`null is not a valid ${this.name}`);
}
return 0;
}
if (!b.g) {
throw new H(`Cannot pass "${Sc(b)}" as a ${this.name}`);
}
if (!b.g.o) {
throw new H(`Cannot pass deleted object as a pointer of type ${this.name}`);
}
return Qc(b.g.o, b.g.u.i, this.i);
}
function Tc(a, b) {
if (null === b) {
if (this.La) {
throw new H(`null is not a valid ${this.name}`);
}
if (this.ua) {
var c = this.Na();
null !== a && a.push(this.N, c);
return c;
}
return 0;
}
if (!b || !b.g) {
throw new H(`Cannot pass "${Sc(b)}" as a ${this.name}`);
}
if (!b.g.o) {
throw new H(`Cannot pass deleted object as a pointer of type ${this.name}`);
}
if (!this.ta && b.g.u.ta) {
throw new H(`Cannot convert argument of type ${b.g.I ? b.g.I.name : b.g.u.name} to parameter type ${this.name}`);
}
c = Qc(b.g.o, b.g.u.i, this.i);
if (this.ua) {
if (void 0 === b.g.D) {
throw new H("Passing raw pointer to smart pointer is illegal");
}
switch(this.ac) {
case 0:
if (b.g.I === this) {
c = b.g.D;
} else {
throw new H(`Cannot convert argument of type ${b.g.I ? b.g.I.name : b.g.u.name} to parameter type ${this.name}`);
}
break;
case 1:
c = b.g.D;
break;
case 2:
if (b.g.I === this) {
c = b.g.D;
} else {
var d = b.clone();
c = this.Xb(c, hc(() => d["delete"]()));
null !== a && a.push(this.N, c);
}
break;
default:
throw new H("Unsupporting sharing policy");
}
}
return c;
}
function Uc(a, b) {
if (null === b) {
if (this.La) {
throw new H(`null is not a valid ${this.name}`);
}
return 0;
}
if (!b.g) {
throw new H(`Cannot pass "${Sc(b)}" as a ${this.name}`);
}
if (!b.g.o) {
throw new H(`Cannot pass deleted object as a pointer of type ${this.name}`);
}
if (b.g.u.ta) {
throw new H(`Cannot convert argument of type ${b.g.u.name} to parameter type ${this.name}`);
}
return Qc(b.g.o, b.g.u.i, this.i);
}
function Vc(a, b, c, d, e, f, g, k, m, p, r) {
this.name = a;
this.i = b;
this.La = c;
this.ta = d;
this.ua = e;
this.Wb = f;
this.ac = g;
this.mb = k;
this.Na = m;
this.Xb = p;
this.N = r;
e || void 0 !== b.B ? this.toWireType = Tc : (this.toWireType = d ? Rc : Uc, this.K = null);
}
var Wc = (a, b, c) => {
if (!l.hasOwnProperty(a)) {
throw new Ac("Replacing nonexistent public symbol");
}
void 0 !== l[a].A && void 0 !== c ? l[a].A[c] = b : (l[a] = b, l[a].da = c);
}, Xc = [], Yc, K = a => {
var b = Xc[a];
b || (a >= Xc.length && (Xc.length = a + 1), Xc[a] = b = Yc.get(a));
return b;
}, Zc = (a, b, c = []) => {
a.includes("j") ? (a = a.replace(/p/g, "i"), b = (0,l["dynCall_" + a])(b, ...c)) : b = K(b)(...c);
return b;
}, $c = (a, b) => (...c) => Zc(a, b, c), P = (a, b) => {
a = I(a);
var c = a.includes("j") ? $c(a, b) : K(b);
if ("function" != typeof c) {
throw new H(`unknown function pointer with signature ${a}: ${b}`);
}
return c;
}, ad, bd = (a, b) => {
function c(f) {
e[f] || qc[f] || (Hc[f] ? Hc[f].forEach(c) : (d.push(f), e[f] = !0));
}
var d = [], e = {};
b.forEach(c);
throw new ad(`${a}: ` + d.map(tc).join([", "]));
};
function cd(a) {
for (var b = 1; b < a.length; ++b) {
if (null !== a[b] && void 0 === a[b].K) {
return !0;
}
}
return !1;
}
function dd(a, b, c, d, e) {
var f = b.length;
if (2 > f) {
throw new H("argTypes array size mismatch! Must at least get return value and 'this' types!");
}
var g = null !== b[1] && null !== c, k = cd(b), m = "void" !== b[0].name, p = f - 2, r = Array(p), w = [], y = [];
return dc(a, function(...q) {
if (q.length !== p) {
throw new H(`function ${a} called with ${q.length} arguments, expected ${p}`);
}
y.length = 0;
w.length = g ? 2 : 1;
w[0] = e;
if (g) {
var t = b[1].toWireType(y, this);
w[1] = t;
}
for (var u = 0; u < p; ++u) {
r[u] = b[u + 2].toWireType(y, q[u]), w.push(r[u]);
}
q = d(...w);
if (k) {
Ec(y);
} else {
for (u = g ? 1 : 2; u < b.length; u++) {
var z = 1 === u ? t : r[u - 2];
null !== b[u].K && b[u].K(z);
}
}
t = m ? b[0].fromWireType(q) : void 0;
return t;
});
}
var ed = (a, b) => {
for (var c = [], d = 0; d < a; d++) {
c.push(A[b + 4 * d >> 2]);
}
return c;
}, fd = a => {
a = a.trim();
const b = a.indexOf("(");
return -1 !== b ? a.substr(0, b) : a;
}, gd = (a, b, c) => {
if (!(a instanceof Object)) {
throw new H(`${c} with invalid "this": ${a}`);
}
if (!(a instanceof b.i.constructor)) {
throw new H(`${c} incompatible with "this" of type ${a.constructor.name}`);
}
if (!a.g.o) {
throw new H(`cannot call emscripten binding method ${c} on deleted object`);
}
return Qc(a.g.o, a.g.u.i, b.i);
}, hd = a => {
9 < a && 0 === --fc[a + 1] && (fc[a] = void 0, ec.push(a));
}, jd = {name:"emscripten::val", fromWireType:a => {
var b = gc(a);
hd(a);
return b;
}, toWireType:(a, b) => hc(b), argPackAdvance:8, readValueFromPointer:Fc, K:null,}, kd = (a, b, c) => {
switch(b) {
case 1:
return c ? function(d) {
return this.fromWireType(n[d]);
} : function(d) {
return this.fromWireType(v[d]);
};
case 2:
return c ? function(d) {
return this.fromWireType(Aa[d >> 1]);
} : function(d) {
return this.fromWireType(Ba[d >> 1]);
};
case 4:
return c ? function(d) {
return this.fromWireType(x[d >> 2]);
} : function(d) {
return this.fromWireType(A[d >> 2]);
};
default:
throw new TypeError(`invalid integer width (${b}): ${a}`);
}
}, Sc = a => {
if (null === a) {
return "null";
}
var b = typeof a;
return "object" === b || "array" === b || "function" === b ? a.toString() : "" + a;
}, ld = (a, b) => {
switch(b) {
case 4:
return function(c) {
return this.fromWireType(B[c >> 2]);
};
case 8:
return function(c) {
return this.fromWireType(Ca[c >> 3]);
};
default:
throw new TypeError(`invalid float width (${b}): ${a}`);
}
}, md = (a, b, c) => {
switch(b) {
case 1:
return c ? d => n[d] : d => v[d];
case 2:
return c ? d => Aa[d >> 1] : d => Ba[d >> 1];
case 4:
return c ? d => x[d >> 2] : d => A[d >> 2];
default:
throw new TypeError(`invalid integer width (${b}): ${a}`);
}
}, nd = "undefined" != typeof TextDecoder ? new TextDecoder("utf-16le") : void 0, od = (a, b) => {
var c = a >> 1;
for (var d = c + b / 2; !(c >= d) && Ba[c];) {
++c;
}
c <<= 1;
if (32 < c - a && nd) {
return nd.decode(v.subarray(a, c));
}
c = "";
for (d = 0; !(d >= b / 2); ++d) {
var e = Aa[a + 2 * d >> 1];
if (0 == e) {
break;
}
c += String.fromCharCode(e);
}
return c;
}, pd = (a, b, c) => {
c ??= 2147483647;
if (2 > c) {
return 0;
}
c -= 2;
var d = b;
c = c < 2 * a.length ? c / 2 : a.length;
for (var e = 0; e < c; ++e) {
Aa[b >> 1] = a.charCodeAt(e), b += 2;
}
Aa[b >> 1] = 0;
return b - d;
}, qd = a => 2 * a.length, rd = (a, b) => {
for (var c = 0, d = ""; !(c >= b / 4);) {
var e = x[a + 4 * c >> 2];
if (0 == e) {
break;
}
++c;
65536 <= e ? (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023)) : d += String.fromCharCode(e);
}
return d;
}, sd = (a, b, c) => {
c ??= 2147483647;
if (4 > c) {
return 0;
}
var d = b;
c = d + c - 4;
for (var e = 0; e < a.length; ++e) {
var f = a.charCodeAt(e);
if (55296 <= f && 57343 >= f) {
var g = a.charCodeAt(++e);
f = 65536 + ((f & 1023) << 10) | g & 1023;
}
x[b >> 2] = f;
b += 4;
if (b + 4 > c) {
break;
}
}
x[b >> 2] = 0;
return b - d;
}, td = a => {
for (var b = 0, c = 0; c < a.length; ++c) {
var d = a.charCodeAt(c);
55296 <= d && 57343 >= d && ++c;
b += 4;
}
return b;
}, ud = (a, b, c) => {
var d = [];
a = a.toWireType(d, c);
d.length && (A[b >> 2] = hc(d));
return a;
}, vd = {}, wd = a => {
var b = vd[a];
return void 0 === b ? I(a) : b;
}, xd = [], yd = a => {
var b = xd.length;
xd.push(a);
return b;
}, zd = (a, b) => {
for (var c = Array(a), d = 0; d < a; ++d) {
c[d] = uc(A[b + 4 * d >> 2], "parameter " + d);
}
return c;
}, Ad = Reflect.construct, Bd = [], Cd = a => {
var b = a.getExtension("ANGLE_instanced_arrays");
b && (a.vertexAttribDivisor = (c, d) => b.vertexAttribDivisorANGLE(c, d), a.drawArraysInstanced = (c, d, e, f) => b.drawArraysInstancedANGLE(c, d, e, f), a.drawElementsInstanced = (c, d, e, f, g) => b.drawElementsInstancedANGLE(c, d, e, f, g));
}, Dd = a => {
var b = a.getExtension("OES_vertex_array_object");
b && (a.createVertexArray = () => b.createVertexArrayOES(), a.deleteVertexArray = c => b.deleteVertexArrayOES(c), a.bindVertexArray = c => b.bindVertexArrayOES(c), a.isVertexArray = c => b.isVertexArrayOES(c));
}, Ed = a => {
var b = a.getExtension("WEBGL_draw_buffers");
b && (a.drawBuffers = (c, d) => b.drawBuffersWEBGL(c, d));
}, Fd = a => {
var b = "ANGLE_instanced_arrays EXT_blend_minmax EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_sRGB OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_depth_texture WEBGL_draw_buffers EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw".split(" ");
return (a.getSupportedExtensions() || []).filter(c => b.includes(c));
}, Gd = 1, Hd = [], Q = [], Id = [], Jd = [], Kd = [], Ld = [], Md = [], ma = [], Nd = [], Od = [], Pd = {}, Qd = {}, Rd = 4, Sd = 0, la = a => {
for (var b = Gd++, c = a.length; c < b; c++) {
a[c] = null;
}
return b;
}, Td = (a, b, c, d) => {
for (var e = 0; e < a; e++) {
var f = R[c](), g = f && la(d);
f ? (f.name = g, d[g] = f) : S ||= 1282;
x[b + 4 * e >> 2] = g;
}
}, oa = a => {
T = ma[a];
l.sc = R = T?.Sa;
return !(a && !R);
}, na = a =>