@rive-app/canvas 2.39.2 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rive.js CHANGED
@@ -349,3402 +349,143 @@ __webpack_require__.r(__webpack_exports__);
349
349
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
350
350
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
351
351
  /* harmony export */ });
352
-
353
- var Rive = (() => {
354
- var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
355
-
356
- return (
357
- function(moduleArg = {}) {
358
- var moduleRtn;
359
-
360
- var k = moduleArg, ba, ca, da = new Promise((a, b) => {
361
- ba = a;
362
- ca = b;
363
- }), ea = "object" == typeof window, ha = "function" == typeof importScripts;
364
- function ia() {
365
- function a(g) {
366
- const h = d;
367
- c = b = 0;
368
- d = new Map();
369
- h.forEach(n => {
370
- try {
371
- n(g);
372
- } catch (m) {
373
- console.error(m);
374
- }
375
- });
376
- this.gb();
377
- e && e.Hb();
378
- }
379
- let b = 0, c = 0, d = new Map(), e = null, f = null;
380
- this.requestAnimationFrame = function(g) {
381
- b ||= requestAnimationFrame(a.bind(this));
382
- const h = ++c;
383
- d.set(h, g);
384
- return h;
385
- };
386
- this.cancelAnimationFrame = function(g) {
387
- d.delete(g);
388
- b && 0 == d.size && (cancelAnimationFrame(b), b = 0);
389
- };
390
- this.Fb = function(g) {
391
- f && (document.body.remove(f), f = null);
392
- 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(h) {
393
- f.innerHTML = "RIVE FPS " + h.toFixed(1);
394
- }, document.body.appendChild(f));
395
- e = new function() {
396
- let h = 0, n = 0;
397
- this.Hb = function() {
398
- var m = performance.now();
399
- n ? (++h, m -= n, 1000 < m && (g(1000 * h / m), h = n = 0)) : (n = m, h = 0);
400
- };
401
- }();
402
- };
403
- this.Cb = function() {
404
- f && (document.body.remove(f), f = null);
405
- e = null;
406
- };
407
- this.gb = function() {
408
- };
409
- }
410
- function ja(a) {
411
- console.assert(!0);
412
- const b = new Map();
413
- let c = -Infinity;
414
- this.push = function(d) {
415
- d = d + ((1 << a) - 1) >> a;
416
- b.has(d) && clearTimeout(b.get(d));
417
- b.set(d, setTimeout(function() {
418
- b.delete(d);
419
- 0 == b.length ? c = -Infinity : d == c && (c = Math.max(...b.keys()), console.assert(c < d));
420
- }, 1000));
421
- c = Math.max(d, c);
422
- return c << a;
423
- };
424
- }
425
- const ka = k.onRuntimeInitialized;
426
- k.onRuntimeInitialized = function() {
427
- ka && ka();
428
- let a = k.decodeAudio;
429
- k.decodeAudio = function(f, g) {
430
- f = a(f);
431
- g(f);
432
- };
433
- let b = k.decodeFont;
434
- k.decodeFont = function(f, g) {
435
- f = b(f);
436
- g(f);
437
- };
438
- let c = k.setFallbackFontCb;
439
- k.setFallbackFontCallback = "function" === typeof c ? function(f) {
440
- c(f);
441
- } : function() {
442
- console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.");
443
- };
444
- const d = k.FileAssetLoader;
445
- k.ptrToAsset = f => {
446
- let g = k.ptrToFileAsset(f);
447
- return g.isImage ? k.ptrToImageAsset(f) : g.isFont ? k.ptrToFontAsset(f) : g.isAudio ? k.ptrToAudioAsset(f) : g;
448
- };
449
- k.CustomFileAssetLoader = d.extend("CustomFileAssetLoader", {__construct:function({loadContents:f}) {
450
- this.__parent.__construct.call(this);
451
- this.ub = f;
452
- }, loadContents:function(f, g) {
453
- f = k.ptrToAsset(f);
454
- return this.ub(f, g);
455
- },});
456
- k.CDNFileAssetLoader = d.extend("CDNFileAssetLoader", {__construct:function() {
457
- this.__parent.__construct.call(this);
458
- }, loadContents:function(f) {
459
- let g = k.ptrToAsset(f);
460
- f = g.cdnUuid;
461
- if ("" === f) {
462
- return !1;
463
- }
464
- (function(h, n) {
465
- var m = new XMLHttpRequest();
466
- m.responseType = "arraybuffer";
467
- m.onreadystatechange = function() {
468
- 4 == m.readyState && 200 == m.status && n(m);
469
- };
470
- m.open("GET", h, !0);
471
- m.send(null);
472
- })(g.cdnBaseUrl + "/" + f, h => {
473
- g.decode(new Uint8Array(h.response));
474
- });
475
- return !0;
476
- },});
477
- k.FallbackFileAssetLoader = d.extend("FallbackFileAssetLoader", {__construct:function() {
478
- this.__parent.__construct.call(this);
479
- this.bb = [];
480
- }, addLoader:function(f) {
481
- this.bb.push(f);
482
- }, loadContents:function(f, g) {
483
- for (let h of this.bb) {
484
- if (h.loadContents(f, g)) {
485
- return !0;
486
- }
487
- }
488
- return !1;
489
- },});
490
- let e = k.computeAlignment;
491
- k.computeAlignment = function(f, g, h, n, m = 1.0) {
492
- return e.call(this, f, g, h, n, m);
493
- };
494
- };
495
- const la = "createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "), ma = new function() {
496
- function a() {
497
- if (!b) {
498
- var l = document.createElement("canvas"), t = {alpha:1, depth:0, stencil:0, antialias:0, premultipliedAlpha:1, preserveDrawingBuffer:0, powerPreference:"high-performance", failIfMajorPerformanceCaveat:0, enableExtensionsByDefault:1, explicitSwapControl:1, renderViaOffscreenBackBuffer:1,};
499
- let q;
500
- if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
501
- if (q = l.getContext("webgl", t), c = 1, !q) {
502
- return console.log("No WebGL support. Image mesh will not be drawn."), !1;
503
- }
504
- } else {
505
- if (q = l.getContext("webgl2", t)) {
506
- c = 2;
507
- } else {
508
- if (q = l.getContext("webgl", t)) {
509
- c = 1;
510
- } else {
511
- return console.log("No WebGL support. Image mesh will not be drawn."), !1;
512
- }
513
- }
514
- }
515
- q = new Proxy(q, {get(H, v) {
516
- if (H.isContextLost()) {
517
- if (n || (console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ", v), n = !0), "function" === typeof H[v]) {
518
- return function() {
519
- };
520
- }
521
- } else {
522
- return "function" === typeof H[v] ? function(...K) {
523
- return H[v].apply(H, K);
524
- } : H[v];
525
- }
526
- }, set(H, v, K) {
527
- if (H.isContextLost()) {
528
- n || (console.error("Cannot render the mesh because the GL Context was lost. Tried to set property " + v), n = !0);
529
- } else {
530
- return H[v] = K, !0;
531
- }
532
- },});
533
- d = Math.min(q.getParameter(q.MAX_RENDERBUFFER_SIZE), q.getParameter(q.MAX_TEXTURE_SIZE));
534
- function C(H, v, K) {
535
- v = q.createShader(v);
536
- q.shaderSource(v, K);
537
- q.compileShader(v);
538
- K = q.getShaderInfoLog(v);
539
- if (0 < (K || "").length) {
540
- throw K;
541
- }
542
- q.attachShader(H, v);
543
- }
544
- l = q.createProgram();
545
- C(l, q.VERTEX_SHADER, "attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }");
546
- C(l, q.FRAGMENT_SHADER, "precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }");
547
- q.bindAttribLocation(l, 0, "vertex");
548
- q.bindAttribLocation(l, 1, "uv");
549
- q.linkProgram(l);
550
- t = q.getProgramInfoLog(l);
551
- if (0 < (t || "").trim().length) {
552
- throw t;
553
- }
554
- e = q.getUniformLocation(l, "mat");
555
- f = q.getUniformLocation(l, "translate");
556
- q.useProgram(l);
557
- q.bindBuffer(q.ARRAY_BUFFER, q.createBuffer());
558
- q.enableVertexAttribArray(0);
559
- q.enableVertexAttribArray(1);
560
- q.bindBuffer(q.ELEMENT_ARRAY_BUFFER, q.createBuffer());
561
- q.uniform1i(q.getUniformLocation(l, "image"), 0);
562
- q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
563
- b = q;
564
- }
565
- return !0;
566
- }
567
- let b = null, c = 0, d = 0, e = null, f = null, g = 0, h = 0, n = !1;
568
- a();
569
- this.Tb = function() {
570
- a();
571
- return d;
572
- };
573
- this.Bb = function(l) {
574
- b.deleteTexture && b.deleteTexture(l);
575
- };
576
- this.Ab = function(l) {
577
- if (!a()) {
578
- return null;
579
- }
580
- const t = b.createTexture();
581
- if (!t) {
582
- return null;
583
- }
584
- b.bindTexture(b.TEXTURE_2D, t);
585
- b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, l);
586
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
587
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
588
- b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
589
- 2 == c ? (b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR_MIPMAP_LINEAR), b.generateMipmap(b.TEXTURE_2D)) : b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
590
- return t;
591
- };
592
- const m = new ja(8), r = new ja(8), w = new ja(10), x = new ja(10);
593
- this.Eb = function(l, t, q, C, H) {
594
- if (a()) {
595
- var v = m.push(l), K = r.push(t);
596
- if (b.canvas) {
597
- if (b.canvas.width != v || b.canvas.height != K) {
598
- b.canvas.width = v, b.canvas.height = K;
599
- }
600
- b.viewport(0, K - t, l, t);
601
- b.disable(b.SCISSOR_TEST);
602
- b.clearColor(0, 0, 0, 0);
603
- b.clear(b.COLOR_BUFFER_BIT);
604
- b.enable(b.SCISSOR_TEST);
605
- q.sort((J, Z) => Z.nb - J.nb);
606
- v = w.push(C);
607
- g != v && (b.bufferData(b.ARRAY_BUFFER, 8 * v, b.DYNAMIC_DRAW), g = v);
608
- v = 0;
609
- for (var Q of q) {
610
- b.bufferSubData(b.ARRAY_BUFFER, v, Q.La), v += 4 * Q.La.length;
611
- }
612
- console.assert(v == 4 * C);
613
- for (var U of q) {
614
- b.bufferSubData(b.ARRAY_BUFFER, v, U.rb), v += 4 * U.rb.length;
615
- }
616
- console.assert(v == 8 * C);
617
- v = x.push(H);
618
- h != v && (b.bufferData(b.ELEMENT_ARRAY_BUFFER, 2 * v, b.DYNAMIC_DRAW), h = v);
619
- Q = 0;
620
- for (var pa of q) {
621
- b.bufferSubData(b.ELEMENT_ARRAY_BUFFER, Q, pa.indices), Q += 2 * pa.indices.length;
622
- }
623
- console.assert(Q == 2 * H);
624
- pa = 0;
625
- U = !0;
626
- v = Q = 0;
627
- for (const J of q) {
628
- J.image.Da != pa && (b.bindTexture(b.TEXTURE_2D, J.image.Ca || null), pa = J.image.Da);
629
- J.Yb ? (b.scissor(J.Ra, K - J.Sa - J.ab, J.kc, J.ab), U = !0) : U && (b.scissor(0, K - t, l, t), U = !1);
630
- q = 2 / l;
631
- const Z = -2 / t;
632
- b.uniform4f(e, J.da[0] * q * J.ua, J.da[1] * Z * J.va, J.da[2] * q * J.ua, J.da[3] * Z * J.va);
633
- b.uniform2f(f, J.da[4] * q * J.ua + q * (J.Ra - J.Ub * J.ua) - 1, J.da[5] * Z * J.va + Z * (J.Sa - J.Vb * J.va) + 1);
634
- b.vertexAttribPointer(0, 2, b.FLOAT, !1, 0, v);
635
- b.vertexAttribPointer(1, 2, b.FLOAT, !1, 0, v + 4 * C);
636
- b.drawElements(b.TRIANGLES, J.indices.length, b.UNSIGNED_SHORT, Q);
637
- v += 4 * J.La.length;
638
- Q += 2 * J.indices.length;
639
- }
640
- console.assert(v == 4 * C);
641
- console.assert(Q == 2 * H);
642
- }
643
- }
644
- };
645
- this.canvas = function() {
646
- return a() && b.canvas;
647
- };
648
- }(), na = k.onRuntimeInitialized;
649
- k.onRuntimeInitialized = function() {
650
- function a(p) {
651
- switch(p) {
652
- case m.srcOver:
653
- return "source-over";
654
- case m.screen:
655
- return "screen";
656
- case m.overlay:
657
- return "overlay";
658
- case m.darken:
659
- return "darken";
660
- case m.lighten:
661
- return "lighten";
662
- case m.colorDodge:
663
- return "color-dodge";
664
- case m.colorBurn:
665
- return "color-burn";
666
- case m.hardLight:
667
- return "hard-light";
668
- case m.softLight:
669
- return "soft-light";
670
- case m.difference:
671
- return "difference";
672
- case m.exclusion:
673
- return "exclusion";
674
- case m.multiply:
675
- return "multiply";
676
- case m.hue:
677
- return "hue";
678
- case m.saturation:
679
- return "saturation";
680
- case m.color:
681
- return "color";
682
- case m.luminosity:
683
- return "luminosity";
684
- }
685
- }
686
- function b(p) {
687
- return "rgba(" + ((16711680 & p) >>> 16) + "," + ((65280 & p) >>> 8) + "," + ((255 & p) >>> 0) + "," + ((4278190080 & p) >>> 24) / 255 + ")";
688
- }
689
- function c() {
690
- 0 < K.length && (ma.Eb(v.drawWidth(), v.drawHeight(), K, Q, U), K = [], U = Q = 0, v.reset(512, 512));
691
- for (const p of H) {
692
- for (const u of p.G) {
693
- u();
694
- }
695
- p.G = [];
696
- }
697
- H.clear();
698
- }
699
- na && na();
700
- var d = k.RenderPaintStyle;
701
- const e = k.RenderPath, f = k.RenderPaint, g = k.Renderer, h = k.StrokeCap, n = k.StrokeJoin, m = k.BlendMode, r = d.fill, w = d.stroke, x = k.FillRule.evenOdd;
702
- let l = 1;
703
- var t = k.RenderImage.extend("CanvasRenderImage", {__construct:function({ha:p, sa:u} = {}) {
704
- this.__parent.__construct.call(this);
705
- this.Da = l;
706
- l = l + 1 & 2147483647 || 1;
707
- this.ha = p;
708
- this.sa = u;
709
- }, __destruct:function() {
710
- this.Ca && (ma.Bb(this.Ca), URL.revokeObjectURL(this.Oa));
711
- this.__parent.__destruct.call(this);
712
- }, decode:function(p) {
713
- var u = this;
714
- u.sa && u.sa(u);
715
- var I = new Image();
716
- u.Oa = URL.createObjectURL(new Blob([p], {type:"image/png",}));
717
- I.onload = function() {
718
- u.tb = I;
719
- u.Ca = ma.Ab(I);
720
- u.size(I.width, I.height);
721
- u.ha && u.ha(u);
722
- };
723
- I.src = u.Oa;
724
- },}), q = e.extend("CanvasRenderPath", {__construct:function() {
725
- this.__parent.__construct.call(this);
726
- this.R = new Path2D();
727
- }, rewind:function() {
728
- this.R = new Path2D();
729
- }, addPath:function(p, u, I, F, z, G, D) {
730
- var L = this.R, xa = L.addPath;
731
- p = p.R;
732
- const S = new DOMMatrix();
733
- S.a = u;
734
- S.b = I;
735
- S.c = F;
736
- S.d = z;
737
- S.e = G;
738
- S.f = D;
739
- xa.call(L, p, S);
740
- }, fillRule:function(p) {
741
- this.Na = p;
742
- }, moveTo:function(p, u) {
743
- this.R.moveTo(p, u);
744
- }, lineTo:function(p, u) {
745
- this.R.lineTo(p, u);
746
- }, cubicTo:function(p, u, I, F, z, G) {
747
- this.R.bezierCurveTo(p, u, I, F, z, G);
748
- }, close:function() {
749
- this.R.closePath();
750
- },}), C = f.extend("CanvasRenderPaint", {color:function(p) {
751
- this.Pa = b(p);
752
- }, thickness:function(p) {
753
- this.xb = p;
754
- }, join:function(p) {
755
- switch(p) {
756
- case n.miter:
757
- this.Ba = "miter";
758
- break;
759
- case n.round:
760
- this.Ba = "round";
761
- break;
762
- case n.bevel:
763
- this.Ba = "bevel";
764
- }
765
- }, cap:function(p) {
766
- switch(p) {
767
- case h.butt:
768
- this.Aa = "butt";
769
- break;
770
- case h.round:
771
- this.Aa = "round";
772
- break;
773
- case h.square:
774
- this.Aa = "square";
775
- }
776
- }, style:function(p) {
777
- this.wb = p;
778
- }, blendMode:function(p) {
779
- this.sb = a(p);
780
- }, clearGradient:function() {
781
- this.fa = null;
782
- }, linearGradient:function(p, u, I, F) {
783
- this.fa = {ob:p, pb:u, Va:I, Wa:F, Ja:[],};
784
- }, radialGradient:function(p, u, I, F) {
785
- this.fa = {ob:p, pb:u, Va:I, Wa:F, Ja:[], Sb:!0,};
786
- }, addStop:function(p, u) {
787
- this.fa.Ja.push({color:p, stop:u,});
788
- }, completeGradient:function() {
789
- }, draw:function(p, u, I, F) {
790
- let z = this.wb;
791
- var G = this.Pa, D = this.fa;
792
- const L = p.globalCompositeOperation, xa = p.globalAlpha;
793
- p.globalCompositeOperation = this.sb;
794
- p.globalAlpha = F;
795
- if (null != D) {
796
- G = D.ob;
797
- const W = D.pb, fa = D.Va;
798
- var S = D.Wa;
799
- F = D.Ja;
800
- D.Sb ? (D = fa - G, S -= W, G = p.createRadialGradient(G, W, 0, G, W, Math.sqrt(D * D + S * S))) : G = p.createLinearGradient(G, W, fa, S);
801
- for (let X = 0, aa = F.length; X < aa; X++) {
802
- D = F[X], G.addColorStop(D.stop, b(D.color));
803
- }
804
- this.Pa = G;
805
- this.fa = null;
806
- }
807
- switch(z) {
808
- case w:
809
- p.strokeStyle = G;
810
- p.lineWidth = this.xb;
811
- p.lineCap = this.Aa;
812
- p.lineJoin = this.Ba;
813
- p.stroke(u);
814
- break;
815
- case r:
816
- p.fillStyle = G, p.fill(u, I);
817
- }
818
- p.globalCompositeOperation = L;
819
- p.globalAlpha = xa;
820
- },});
821
- const H = new Set();
822
- let v = null, K = [], Q = 0, U = 0;
823
- var pa = k.CanvasRenderer = g.extend("Renderer", {__construct:function(p) {
824
- this.__parent.__construct.call(this);
825
- this.P = [1, 0, 0, 1, 0, 0];
826
- this.D = [1.0];
827
- this.A = p.getContext("2d");
828
- this.Ma = p;
829
- this.G = [];
830
- }, save:function() {
831
- this.P.push(...this.P.slice(this.P.length - 6));
832
- this.D.push(this.D[this.D.length - 1]);
833
- this.G.push(this.A.save.bind(this.A));
834
- }, restore:function() {
835
- const p = this.P.length - 6;
836
- if (6 > p) {
837
- throw "restore() called without matching save().";
838
- }
839
- this.P.splice(p);
840
- this.D.pop();
841
- this.G.push(this.A.restore.bind(this.A));
842
- }, transform:function(p, u, I, F, z, G) {
843
- const D = this.P, L = D.length - 6;
844
- D.splice(L, 6, D[L] * p + D[L + 2] * u, D[L + 1] * p + D[L + 3] * u, D[L] * I + D[L + 2] * F, D[L + 1] * I + D[L + 3] * F, D[L] * z + D[L + 2] * G + D[L + 4], D[L + 1] * z + D[L + 3] * G + D[L + 5]);
845
- this.G.push(this.A.transform.bind(this.A, p, u, I, F, z, G));
846
- }, rotate:function(p) {
847
- const u = Math.sin(p);
848
- p = Math.cos(p);
849
- this.transform(p, u, -u, p, 0, 0);
850
- }, modulateOpacity:function(p) {
851
- this.D[this.D.length - 1] *= p;
852
- }, _drawPath:function(p, u) {
853
- this.G.push(u.draw.bind(u, this.A, p.R, p.Na === x ? "evenodd" : "nonzero", Math.max(0, this.D[this.D.length - 1])));
854
- }, _drawRiveImage:function(p, u, I, F) {
855
- var z = p.tb;
856
- if (z) {
857
- var G = this.A, D = a(I), L = Math.max(0, F * this.D[this.D.length - 1]);
858
- this.G.push(function() {
859
- G.globalCompositeOperation = D;
860
- G.globalAlpha = L;
861
- G.drawImage(z, 0, 0);
862
- G.globalAlpha = 1;
863
- });
864
- }
865
- }, _getMatrix:function(p) {
866
- const u = this.P, I = u.length - 6;
867
- for (let F = 0; 6 > F; ++F) {
868
- p[F] = u[I + F];
869
- }
870
- }, _drawImageMesh:function(p, u, I, F, z, G, D, L, xa, S, W, fa, X, aa) {
871
- let $b, ac, bc;
872
- try {
873
- $b = k.HEAPF32.slice(z >> 2, (z >> 2) + G), ac = k.HEAPF32.slice(D >> 2, (D >> 2) + L), bc = k.HEAPU16.slice(xa >> 1, (xa >> 1) + S);
874
- } catch (sb) {
875
- console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");
876
- return;
877
- }
878
- u = this.A.canvas.width;
879
- z = this.A.canvas.height;
880
- D = X - W;
881
- L = aa - fa;
882
- W = Math.max(W, 0);
883
- fa = Math.max(fa, 0);
884
- X = Math.min(X, u);
885
- aa = Math.min(aa, z);
886
- const Fa = X - W, Ga = aa - fa;
887
- console.assert(Fa <= Math.min(D, u));
888
- console.assert(Ga <= Math.min(L, z));
889
- if (!(0 >= Fa || 0 >= Ga)) {
890
- X = Fa < D || Ga < L;
891
- u = aa = 1;
892
- var qa = Math.ceil(Fa * aa), ra = Math.ceil(Ga * u);
893
- z = ma.Tb();
894
- qa > z && (aa *= z / qa, qa = z);
895
- ra > z && (u *= z / ra, ra = z);
896
- v || (v = new k.DynamicRectanizer(z), v.reset(512, 512));
897
- z = v.addRect(qa, ra);
898
- 0 > z && (c(), H.add(this), z = v.addRect(qa, ra), console.assert(0 <= z));
899
- var cc = z & 65535, dc = z >> 16;
900
- K.push({da:this.P.slice(this.P.length - 6), image:p, Ra:cc, Sa:dc, Ub:W, Vb:fa, kc:qa, ab:ra, ua:aa, va:u, La:$b, rb:ac, indices:bc, Yb:X, nb:p.Da << 1 | (X ? 1 : 0),});
901
- Q += G;
902
- U += S;
903
- var ya = this.A, qd = a(I), rd = Math.max(0, F * this.D[this.D.length - 1]);
904
- this.G.push(function() {
905
- ya.save();
906
- ya.resetTransform();
907
- ya.globalCompositeOperation = qd;
908
- ya.globalAlpha = rd;
909
- const sb = ma.canvas();
910
- sb && ya.drawImage(sb, cc, dc, qa, ra, W, fa, Fa, Ga);
911
- ya.restore();
912
- });
913
- }
914
- }, _clipPath:function(p) {
915
- this.G.push(this.A.clip.bind(this.A, p.R, p.Na === x ? "evenodd" : "nonzero"));
916
- }, clear:function() {
917
- H.add(this);
918
- this.G.push(this.A.clearRect.bind(this.A, 0, 0, this.Ma.width, this.Ma.height));
919
- }, flush:function() {
920
- }, translate:function(p, u) {
921
- this.transform(1, 0, 0, 1, p, u);
922
- },});
923
- k.makeRenderer = function(p) {
924
- const u = new pa(p), I = u.A;
925
- return new Proxy(u, {get(F, z) {
926
- if ("function" === typeof F[z]) {
927
- return function(...G) {
928
- return F[z].apply(F, G);
929
- };
930
- }
931
- if ("function" === typeof I[z]) {
932
- if (-1 < la.indexOf(z)) {
933
- throw Error("RiveException: Method call to '" + z + "()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");
934
- }
935
- return function(...G) {
936
- u.G.push(I[z].bind(I, ...G));
937
- };
938
- }
939
- return F[z];
940
- }, set(F, z, G) {
941
- if (z in I) {
942
- return u.G.push(() => {
943
- I[z] = G;
944
- }), !0;
945
- }
946
- },});
947
- };
948
- k.decodeImage = function(p, u) {
949
- (new t({ha:u})).decode(p);
950
- };
951
- k.renderFactory = {makeRenderPaint:function() {
952
- return new C();
953
- }, makeRenderPath:function() {
954
- return new q();
955
- }, makeRenderImage:function() {
956
- let p = Z;
957
- return new t({sa:() => {
958
- p.total++;
959
- }, ha:() => {
960
- p.loaded++;
961
- if (p.loaded === p.total) {
962
- const u = p.ready;
963
- u && (u(), p.ready = null);
964
- }
965
- },});
966
- },};
967
- let J = k.load, Z = null;
968
- k.load = function(p, u, I = !0) {
969
- const F = new k.FallbackFileAssetLoader();
970
- void 0 !== u && F.addLoader(u);
971
- I && (u = new k.CDNFileAssetLoader(), F.addLoader(u));
972
- return new Promise(function(z) {
973
- let G = null;
974
- Z = {total:0, loaded:0, ready:function() {
975
- z(G);
976
- },};
977
- G = J(p, F);
978
- 0 == Z.total && z(G);
979
- });
980
- };
981
- let sd = k.RendererWrapper.prototype.align;
982
- k.RendererWrapper.prototype.align = function(p, u, I, F, z = 1.0) {
983
- sd.call(this, p, u, I, F, z);
984
- };
985
- d = new ia();
986
- k.requestAnimationFrame = d.requestAnimationFrame.bind(d);
987
- k.cancelAnimationFrame = d.cancelAnimationFrame.bind(d);
988
- k.enableFPSCounter = d.Fb.bind(d);
989
- k.disableFPSCounter = d.Cb;
990
- d.gb = c;
991
- k.resolveAnimationFrame = c;
992
- k.cleanup = function() {
993
- v && v.delete();
994
- };
995
- };
996
- var oa = Object.assign({}, k), sa = "./this.program", ta = "", ua, va;
997
- if (ea || ha) {
998
- ha ? ta = self.location.href : "undefined" != typeof document && document.currentScript && (ta = document.currentScript.src), _scriptName && (ta = _scriptName), ta.startsWith("blob:") ? ta = "" : ta = ta.substr(0, ta.replace(/[?#].*/, "").lastIndexOf("/") + 1), ha && (va = a => {
999
- var b = new XMLHttpRequest();
1000
- b.open("GET", a, !1);
1001
- b.responseType = "arraybuffer";
1002
- b.send(null);
1003
- return new Uint8Array(b.response);
1004
- }), ua = (a, b, c) => {
1005
- if (wa(a)) {
1006
- var d = new XMLHttpRequest();
1007
- d.open("GET", a, !0);
1008
- d.responseType = "arraybuffer";
1009
- d.onload = () => {
1010
- 200 == d.status || 0 == d.status && d.response ? b(d.response) : c();
1011
- };
1012
- d.onerror = c;
1013
- d.send(null);
1014
- } else {
1015
- fetch(a, {credentials:"same-origin"}).then(e => e.ok ? e.arrayBuffer() : Promise.reject(Error(e.status + " : " + e.url))).then(b, c);
1016
- }
1017
- };
1018
- }
1019
- var za = k.print || console.log.bind(console), Aa = k.printErr || console.error.bind(console);
1020
- Object.assign(k, oa);
1021
- oa = null;
1022
- k.thisProgram && (sa = k.thisProgram);
1023
- var Ba;
1024
- k.wasmBinary && (Ba = k.wasmBinary);
1025
- var Ca, Da = !1, y, A, Ea, Ha, B, E, Ia, Ja;
1026
- function Ka() {
1027
- var a = Ca.buffer;
1028
- k.HEAP8 = y = new Int8Array(a);
1029
- k.HEAP16 = Ea = new Int16Array(a);
1030
- k.HEAPU8 = A = new Uint8Array(a);
1031
- k.HEAPU16 = Ha = new Uint16Array(a);
1032
- k.HEAP32 = B = new Int32Array(a);
1033
- k.HEAPU32 = E = new Uint32Array(a);
1034
- k.HEAPF32 = Ia = new Float32Array(a);
1035
- k.HEAPF64 = Ja = new Float64Array(a);
1036
- }
1037
- var La = [], Ma = [], Na = [];
1038
- function Oa() {
1039
- var a = k.preRun.shift();
1040
- La.unshift(a);
1041
- }
1042
- var Pa = 0, Qa = null, Ra = null;
1043
- function Sa(a) {
1044
- k.onAbort?.(a);
1045
- a = "Aborted(" + a + ")";
1046
- Aa(a);
1047
- Da = !0;
1048
- a = new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info.");
1049
- ca(a);
1050
- throw a;
1051
- }
1052
- var Ta = a => a.startsWith("data:application/octet-stream;base64,"), wa = a => a.startsWith("file://"), Ua;
1053
- function Va(a) {
1054
- if (a == Ua && Ba) {
1055
- return new Uint8Array(Ba);
1056
- }
1057
- if (va) {
1058
- return va(a);
1059
- }
1060
- throw "both async and sync fetching of the wasm failed";
1061
- }
1062
- function Wa(a) {
1063
- return Ba ? Promise.resolve().then(() => Va(a)) : new Promise((b, c) => {
1064
- ua(a, d => b(new Uint8Array(d)), () => {
1065
- try {
1066
- b(Va(a));
1067
- } catch (d) {
1068
- c(d);
1069
- }
1070
- });
1071
- });
1072
- }
1073
- function Xa(a, b, c) {
1074
- return Wa(a).then(d => WebAssembly.instantiate(d, b)).then(c, d => {
1075
- Aa(`failed to asynchronously prepare wasm: ${d}`);
1076
- Sa(d);
1077
- });
1078
- }
1079
- function Ya(a, b) {
1080
- var c = Ua;
1081
- return Ba || "function" != typeof WebAssembly.instantiateStreaming || Ta(c) || wa(c) || "function" != typeof fetch ? Xa(c, a, b) : fetch(c, {credentials:"same-origin"}).then(d => WebAssembly.instantiateStreaming(d, a).then(b, function(e) {
1082
- Aa(`wasm streaming compile failed: ${e}`);
1083
- Aa("falling back to ArrayBuffer instantiation");
1084
- return Xa(c, a, b);
1085
- }));
1086
- }
1087
- var Za, $a, db = {494893:(a, b, c, d, e) => {
1088
- if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
1089
- return 0;
1090
- }
1091
- if ("undefined" === typeof window.miniaudio) {
1092
- window.miniaudio = {referenceCount:0};
1093
- window.miniaudio.device_type = {};
1094
- window.miniaudio.device_type.playback = a;
1095
- window.miniaudio.device_type.capture = b;
1096
- window.miniaudio.device_type.duplex = c;
1097
- window.miniaudio.device_state = {};
1098
- window.miniaudio.device_state.stopped = d;
1099
- window.miniaudio.device_state.started = e;
1100
- let f = window.miniaudio;
1101
- f.devices = [];
1102
- f.track_device = function(g) {
1103
- for (var h = 0; h < f.devices.length; ++h) {
1104
- if (null == f.devices[h]) {
1105
- return f.devices[h] = g, h;
1106
- }
1107
- }
1108
- f.devices.push(g);
1109
- return f.devices.length - 1;
1110
- };
1111
- f.untrack_device_by_index = function(g) {
1112
- for (f.devices[g] = null; 0 < f.devices.length;) {
1113
- if (null == f.devices[f.devices.length - 1]) {
1114
- f.devices.pop();
1115
- } else {
1116
- break;
1117
- }
1118
- }
1119
- };
1120
- f.untrack_device = function(g) {
1121
- for (var h = 0; h < f.devices.length; ++h) {
1122
- if (f.devices[h] == g) {
1123
- return f.untrack_device_by_index(h);
1124
- }
1125
- }
1126
- };
1127
- f.get_device_by_index = function(g) {
1128
- return f.devices[g];
1129
- };
1130
- f.unlock_event_types = ["touchend", "click"];
1131
- f.unlock = function() {
1132
- for (var g = 0; g < f.devices.length; ++g) {
1133
- var h = f.devices[g];
1134
- null != h && null != h.I && h.state === f.device_state.started && h.I.resume().then(() => {
1135
- ab(h.hb);
1136
- }, n => {
1137
- console.error("Failed to resume audiocontext", n);
1138
- });
1139
- }
1140
- f.unlock_event_types.map(function(n) {
1141
- document.removeEventListener(n, f.unlock, !0);
1142
- });
1143
- };
1144
- f.unlock_event_types.map(function(g) {
1145
- document.addEventListener(g, f.unlock, !0);
1146
- });
1147
- }
1148
- window.miniaudio.referenceCount += 1;
1149
- return 1;
1150
- }, 497071:() => {
1151
- "undefined" !== typeof window.miniaudio && (window.miniaudio.unlock_event_types.map(function(a) {
1152
- document.removeEventListener(a, window.miniaudio.unlock, !0);
1153
- }), --window.miniaudio.referenceCount, 0 === window.miniaudio.referenceCount && delete window.miniaudio);
1154
- }, 497375:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 497479:() => {
1155
- try {
1156
- var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
1157
- a.close();
1158
- return b;
1159
- } catch (c) {
1160
- return 0;
1161
- }
1162
- }, 497650:(a, b, c, d, e, f) => {
1163
- if ("undefined" === typeof window.miniaudio) {
1164
- return -1;
1165
- }
1166
- var g = {}, h = {};
1167
- a == window.miniaudio.device_type.playback && 0 != c && (h.sampleRate = c);
1168
- g.I = new (window.AudioContext || window.webkitAudioContext)(h);
1169
- g.I.suspend();
1170
- g.state = window.miniaudio.device_state.stopped;
1171
- c = 0;
1172
- a != window.miniaudio.device_type.playback && (c = b);
1173
- g.W = g.I.createScriptProcessor(d, c, b);
1174
- g.W.onaudioprocess = function(n) {
1175
- if (null == g.na || 0 == g.na.length) {
1176
- g.na = new Float32Array(Ia.buffer, e, d * b);
1177
- }
1178
- if (a == window.miniaudio.device_type.capture || a == window.miniaudio.device_type.duplex) {
1179
- for (var m = 0; m < b; m += 1) {
1180
- for (var r = n.inputBuffer.getChannelData(m), w = g.na, x = 0; x < d; x += 1) {
1181
- w[x * b + m] = r[x];
1182
- }
1183
- }
1184
- bb(f, d, e);
1185
- }
1186
- if (a == window.miniaudio.device_type.playback || a == window.miniaudio.device_type.duplex) {
1187
- for (cb(f, d, e), m = 0; m < n.outputBuffer.numberOfChannels; ++m) {
1188
- for (r = n.outputBuffer.getChannelData(m), w = g.na, x = 0; x < d; x += 1) {
1189
- r[x] = w[x * b + m];
1190
- }
1191
- }
1192
- } else {
1193
- for (m = 0; m < n.outputBuffer.numberOfChannels; ++m) {
1194
- n.outputBuffer.getChannelData(m).fill(0.0);
1195
- }
1196
- }
1197
- };
1198
- a != window.miniaudio.device_type.capture && a != window.miniaudio.device_type.duplex || navigator.mediaDevices.getUserMedia({audio:!0, video:!1}).then(function(n) {
1199
- g.wa = g.I.createMediaStreamSource(n);
1200
- g.wa.connect(g.W);
1201
- g.W.connect(g.I.destination);
1202
- }).catch(function(n) {
1203
- console.log("Failed to get user media: " + n);
1204
- });
1205
- a == window.miniaudio.device_type.playback && g.W.connect(g.I.destination);
1206
- g.hb = f;
1207
- return window.miniaudio.track_device(g);
1208
- }, 500527:a => window.miniaudio.get_device_by_index(a).I.sampleRate, 500600:a => {
1209
- a = window.miniaudio.get_device_by_index(a);
1210
- void 0 !== a.W && (a.W.onaudioprocess = function() {
1211
- }, a.W.disconnect(), a.W = void 0);
1212
- void 0 !== a.wa && (a.wa.disconnect(), a.wa = void 0);
1213
- a.I.close();
1214
- a.I = void 0;
1215
- a.hb = void 0;
1216
- }, 501E3:a => {
1217
- window.miniaudio.untrack_device_by_index(a);
1218
- }, 501050:a => {
1219
- a = window.miniaudio.get_device_by_index(a);
1220
- a.I.resume();
1221
- a.state = window.miniaudio.device_state.started;
1222
- }, 501189:a => {
1223
- a = window.miniaudio.get_device_by_index(a);
1224
- a.I.suspend();
1225
- a.state = window.miniaudio.device_state.stopped;
1226
- }}, eb = a => {
1227
- for (; 0 < a.length;) {
1228
- a.shift()(k);
1229
- }
1230
- };
1231
- function fb() {
1232
- var a = B[+gb >> 2];
1233
- gb += 4;
1234
- return a;
1235
- }
1236
- var hb = (a, b) => {
1237
- for (var c = 0, d = a.length - 1; 0 <= d; d--) {
1238
- var e = a[d];
1239
- "." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--);
1240
- }
1241
- if (b) {
1242
- for (; c; c--) {
1243
- a.unshift("..");
1244
- }
1245
- }
1246
- return a;
1247
- }, ib = a => {
1248
- var b = "/" === a.charAt(0), c = "/" === a.substr(-1);
1249
- (a = hb(a.split("/").filter(d => !!d), !b).join("/")) || b || (a = ".");
1250
- a && c && (a += "/");
1251
- return (b ? "/" : "") + a;
1252
- }, jb = a => {
1253
- var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
1254
- a = b[0];
1255
- b = b[1];
1256
- if (!a && !b) {
1257
- return ".";
1258
- }
1259
- b &&= b.substr(0, b.length - 1);
1260
- return a + b;
1261
- }, kb = a => {
1262
- if ("/" === a) {
1263
- return "/";
1264
- }
1265
- a = ib(a);
1266
- a = a.replace(/\/$/, "");
1267
- var b = a.lastIndexOf("/");
1268
- return -1 === b ? a : a.substr(b + 1);
1269
- }, lb = () => {
1270
- if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) {
1271
- return a => crypto.getRandomValues(a);
1272
- }
1273
- Sa("initRandomDevice");
1274
- }, mb = a => (mb = lb())(a), nb = (...a) => {
1275
- for (var b = "", c = !1, d = a.length - 1; -1 <= d && !c; d--) {
1276
- c = 0 <= d ? a[d] : "/";
1277
- if ("string" != typeof c) {
1278
- throw new TypeError("Arguments to path.resolve must be strings");
1279
- }
1280
- if (!c) {
1281
- return "";
1282
- }
1283
- b = c + "/" + b;
1284
- c = "/" === c.charAt(0);
1285
- }
1286
- b = hb(b.split("/").filter(e => !!e), !c).join("/");
1287
- return (c ? "/" : "") + b || ".";
1288
- }, ob = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, pb = (a, b, c) => {
1289
- var d = b + c;
1290
- for (c = b; a[c] && !(c >= d);) {
1291
- ++c;
1292
- }
1293
- if (16 < c - b && a.buffer && ob) {
1294
- return ob.decode(a.subarray(b, c));
1295
- }
1296
- for (d = ""; b < c;) {
1297
- var e = a[b++];
1298
- if (e & 128) {
1299
- var f = a[b++] & 63;
1300
- if (192 == (e & 224)) {
1301
- d += String.fromCharCode((e & 31) << 6 | f);
1302
- } else {
1303
- var g = a[b++] & 63;
1304
- e = 224 == (e & 240) ? (e & 15) << 12 | f << 6 | g : (e & 7) << 18 | f << 12 | g << 6 | a[b++] & 63;
1305
- 65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));
1306
- }
1307
- } else {
1308
- d += String.fromCharCode(e);
1309
- }
1310
- }
1311
- return d;
1312
- }, qb = [], rb = a => {
1313
- for (var b = 0, c = 0; c < a.length; ++c) {
1314
- var d = a.charCodeAt(c);
1315
- 127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3;
1316
- }
1317
- return b;
1318
- }, tb = (a, b, c, d) => {
1319
- if (!(0 < d)) {
1320
- return 0;
1321
- }
1322
- var e = c;
1323
- d = c + d - 1;
1324
- for (var f = 0; f < a.length; ++f) {
1325
- var g = a.charCodeAt(f);
1326
- if (55296 <= g && 57343 >= g) {
1327
- var h = a.charCodeAt(++f);
1328
- g = 65536 + ((g & 1023) << 10) | h & 1023;
1329
- }
1330
- if (127 >= g) {
1331
- if (c >= d) {
1332
- break;
1333
- }
1334
- b[c++] = g;
1335
- } else {
1336
- if (2047 >= g) {
1337
- if (c + 1 >= d) {
1338
- break;
1339
- }
1340
- b[c++] = 192 | g >> 6;
1341
- } else {
1342
- if (65535 >= g) {
1343
- if (c + 2 >= d) {
1344
- break;
1345
- }
1346
- b[c++] = 224 | g >> 12;
1347
- } else {
1348
- if (c + 3 >= d) {
1349
- break;
1350
- }
1351
- b[c++] = 240 | g >> 18;
1352
- b[c++] = 128 | g >> 12 & 63;
1353
- }
1354
- b[c++] = 128 | g >> 6 & 63;
1355
- }
1356
- b[c++] = 128 | g & 63;
1357
- }
1358
- }
1359
- b[c] = 0;
1360
- return c - e;
1361
- };
1362
- function ub(a, b) {
1363
- var c = Array(rb(a) + 1);
1364
- a = tb(a, c, 0, c.length);
1365
- b && (c.length = a);
1366
- return c;
1367
- }
1368
- var vb = [];
1369
- function wb(a, b) {
1370
- vb[a] = {input:[], F:[], T:b};
1371
- xb(a, yb);
1372
- }
1373
- var yb = {open(a) {
1374
- var b = vb[a.node.ta];
1375
- if (!b) {
1376
- throw new M(43);
1377
- }
1378
- a.o = b;
1379
- a.seekable = !1;
1380
- }, close(a) {
1381
- a.o.T.la(a.o);
1382
- }, la(a) {
1383
- a.o.T.la(a.o);
1384
- }, read(a, b, c, d) {
1385
- if (!a.o || !a.o.T.$a) {
1386
- throw new M(60);
1387
- }
1388
- for (var e = 0, f = 0; f < d; f++) {
1389
- try {
1390
- var g = a.o.T.$a(a.o);
1391
- } catch (h) {
1392
- throw new M(29);
1393
- }
1394
- if (void 0 === g && 0 === e) {
1395
- throw new M(6);
1396
- }
1397
- if (null === g || void 0 === g) {
1398
- break;
1399
- }
1400
- e++;
1401
- b[c + f] = g;
1402
- }
1403
- e && (a.node.timestamp = Date.now());
1404
- return e;
1405
- }, write(a, b, c, d) {
1406
- if (!a.o || !a.o.T.Ga) {
1407
- throw new M(60);
1408
- }
1409
- try {
1410
- for (var e = 0; e < d; e++) {
1411
- a.o.T.Ga(a.o, b[c + e]);
1412
- }
1413
- } catch (f) {
1414
- throw new M(29);
1415
- }
1416
- d && (a.node.timestamp = Date.now());
1417
- return e;
1418
- },}, zb = {$a() {
1419
- a: {
1420
- if (!qb.length) {
1421
- var a = null;
1422
- "undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n"));
1423
- if (!a) {
1424
- a = null;
1425
- break a;
1426
- }
1427
- qb = ub(a, !0);
1428
- }
1429
- a = qb.shift();
1430
- }
1431
- return a;
1432
- }, Ga(a, b) {
1433
- null === b || 10 === b ? (za(pb(a.F, 0)), a.F = []) : 0 != b && a.F.push(b);
1434
- }, la(a) {
1435
- a.F && 0 < a.F.length && (za(pb(a.F, 0)), a.F = []);
1436
- }, Pb() {
1437
- return {uc:25856, wc:5, tc:191, vc:35387, sc:[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,]};
1438
- }, Qb() {
1439
- return 0;
1440
- }, Rb() {
1441
- return [24, 80];
1442
- },}, Ab = {Ga(a, b) {
1443
- null === b || 10 === b ? (Aa(pb(a.F, 0)), a.F = []) : 0 != b && a.F.push(b);
1444
- }, la(a) {
1445
- a.F && 0 < a.F.length && (Aa(pb(a.F, 0)), a.F = []);
1446
- },};
1447
- function Bb(a, b) {
1448
- var c = a.j ? a.j.length : 0;
1449
- c >= b || (b = Math.max(b, c * (1048576 > c ? 2.0 : 1.125) >>> 0), 0 != c && (b = Math.max(b, 256)), c = a.j, a.j = new Uint8Array(b), 0 < a.u && a.j.set(c.subarray(0, a.u), 0));
1450
- }
1451
- var N = {L:null, S() {
1452
- return N.createNode(null, "/", 16895, 0);
1453
- }, createNode(a, b, c, d) {
1454
- if (24576 === (c & 61440) || 4096 === (c & 61440)) {
1455
- throw new M(63);
1456
- }
1457
- N.L || (N.L = {dir:{node:{V:N.i.V, N:N.i.N, ga:N.i.ga, qa:N.i.qa, lb:N.i.lb, qb:N.i.qb, mb:N.i.mb, kb:N.i.kb, xa:N.i.xa}, stream:{Z:N.l.Z}}, file:{node:{V:N.i.V, N:N.i.N}, stream:{Z:N.l.Z, read:N.l.read, write:N.l.write, Qa:N.l.Qa, cb:N.l.cb, fb:N.l.fb}}, link:{node:{V:N.i.V, N:N.i.N, ia:N.i.ia}, stream:{}}, Ta:{node:{V:N.i.V, N:N.i.N}, stream:Cb}});
1458
- c = Db(a, b, c, d);
1459
- 16384 === (c.mode & 61440) ? (c.i = N.L.dir.node, c.l = N.L.dir.stream, c.j = {}) : 32768 === (c.mode & 61440) ? (c.i = N.L.file.node, c.l = N.L.file.stream, c.u = 0, c.j = null) : 40960 === (c.mode & 61440) ? (c.i = N.L.link.node, c.l = N.L.link.stream) : 8192 === (c.mode & 61440) && (c.i = N.L.Ta.node, c.l = N.L.Ta.stream);
1460
- c.timestamp = Date.now();
1461
- a && (a.j[b] = c, a.timestamp = c.timestamp);
1462
- return c;
1463
- }, Ac(a) {
1464
- return a.j ? a.j.subarray ? a.j.subarray(0, a.u) : new Uint8Array(a.j) : new Uint8Array(0);
1465
- }, i:{V(a) {
1466
- var b = {};
1467
- b.yc = 8192 === (a.mode & 61440) ? a.id : 1;
1468
- b.Cc = a.id;
1469
- b.mode = a.mode;
1470
- b.Gc = 1;
1471
- b.uid = 0;
1472
- b.Bc = 0;
1473
- b.ta = a.ta;
1474
- 16384 === (a.mode & 61440) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.u : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
1475
- b.qc = new Date(a.timestamp);
1476
- b.Fc = new Date(a.timestamp);
1477
- b.xc = new Date(a.timestamp);
1478
- b.yb = 4096;
1479
- b.rc = Math.ceil(b.size / b.yb);
1480
- return b;
1481
- }, N(a, b) {
1482
- void 0 !== b.mode && (a.mode = b.mode);
1483
- void 0 !== b.timestamp && (a.timestamp = b.timestamp);
1484
- if (void 0 !== b.size && (b = b.size, a.u != b)) {
1485
- if (0 == b) {
1486
- a.j = null, a.u = 0;
1487
- } else {
1488
- var c = a.j;
1489
- a.j = new Uint8Array(b);
1490
- c && a.j.set(c.subarray(0, Math.min(b, a.u)));
1491
- a.u = b;
1492
- }
1493
- }
1494
- }, ga() {
1495
- throw Eb[44];
1496
- }, qa(a, b, c, d) {
1497
- return N.createNode(a, b, c, d);
1498
- }, lb(a, b, c) {
1499
- if (16384 === (a.mode & 61440)) {
1500
- try {
1501
- var d = Fb(b, c);
1502
- } catch (f) {
1503
- }
1504
- if (d) {
1505
- for (var e in d.j) {
1506
- throw new M(55);
1507
- }
1508
- }
1509
- }
1510
- delete a.parent.j[a.name];
1511
- a.parent.timestamp = Date.now();
1512
- a.name = c;
1513
- b.j[c] = a;
1514
- b.timestamp = a.parent.timestamp;
1515
- }, qb(a, b) {
1516
- delete a.j[b];
1517
- a.timestamp = Date.now();
1518
- }, mb(a, b) {
1519
- var c = Fb(a, b), d;
1520
- for (d in c.j) {
1521
- throw new M(55);
1522
- }
1523
- delete a.j[b];
1524
- a.timestamp = Date.now();
1525
- }, kb(a) {
1526
- var b = [".", ".."], c;
1527
- for (c of Object.keys(a.j)) {
1528
- b.push(c);
1529
- }
1530
- return b;
1531
- }, xa(a, b, c) {
1532
- a = N.createNode(a, b, 41471, 0);
1533
- a.link = c;
1534
- return a;
1535
- }, ia(a) {
1536
- if (40960 !== (a.mode & 61440)) {
1537
- throw new M(28);
1538
- }
1539
- return a.link;
1540
- },}, l:{read(a, b, c, d, e) {
1541
- var f = a.node.j;
1542
- if (e >= a.node.u) {
1543
- return 0;
1544
- }
1545
- a = Math.min(a.node.u - e, d);
1546
- if (8 < a && f.subarray) {
1547
- b.set(f.subarray(e, e + a), c);
1548
- } else {
1549
- for (d = 0; d < a; d++) {
1550
- b[c + d] = f[e + d];
1551
- }
1552
- }
1553
- return a;
1554
- }, write(a, b, c, d, e, f) {
1555
- b.buffer === y.buffer && (f = !1);
1556
- if (!d) {
1557
- return 0;
1558
- }
1559
- a = a.node;
1560
- a.timestamp = Date.now();
1561
- if (b.subarray && (!a.j || a.j.subarray)) {
1562
- if (f) {
1563
- return a.j = b.subarray(c, c + d), a.u = d;
1564
- }
1565
- if (0 === a.u && 0 === e) {
1566
- return a.j = b.slice(c, c + d), a.u = d;
1567
- }
1568
- if (e + d <= a.u) {
1569
- return a.j.set(b.subarray(c, c + d), e), d;
1570
- }
1571
- }
1572
- Bb(a, e + d);
1573
- if (a.j.subarray && b.subarray) {
1574
- a.j.set(b.subarray(c, c + d), e);
1575
- } else {
1576
- for (f = 0; f < d; f++) {
1577
- a.j[e + f] = b[c + f];
1578
- }
1579
- }
1580
- a.u = Math.max(a.u, e + d);
1581
- return d;
1582
- }, Z(a, b, c) {
1583
- 1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.u);
1584
- if (0 > b) {
1585
- throw new M(28);
1586
- }
1587
- return b;
1588
- }, Qa(a, b, c) {
1589
- Bb(a.node, b + c);
1590
- a.node.u = Math.max(a.node.u, b + c);
1591
- }, cb(a, b, c, d, e) {
1592
- if (32768 !== (a.node.mode & 61440)) {
1593
- throw new M(43);
1594
- }
1595
- a = a.node.j;
1596
- if (e & 2 || a.buffer !== y.buffer) {
1597
- if (0 < c || c + b < a.length) {
1598
- a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b);
1599
- }
1600
- c = !0;
1601
- Sa();
1602
- b = void 0;
1603
- if (!b) {
1604
- throw new M(48);
1605
- }
1606
- y.set(a, b);
1607
- } else {
1608
- c = !1, b = a.byteOffset;
1609
- }
1610
- return {m:b, pc:c};
1611
- }, fb(a, b, c, d) {
1612
- N.l.write(a, b, 0, d, c, !1);
1613
- return 0;
1614
- },},}, Gb = (a, b) => {
1615
- var c = 0;
1616
- a && (c |= 365);
1617
- b && (c |= 146);
1618
- return c;
1619
- }, Hb = null, Ib = {}, Jb = [], Kb = 1, Lb = null, Mb = !0, M = class {
1620
- constructor(a) {
1621
- this.name = "ErrnoError";
1622
- this.Y = a;
1623
- }
1624
- }, Eb = {}, Nb = class {
1625
- constructor() {
1626
- this.ma = {};
1627
- this.node = null;
1628
- }
1629
- get flags() {
1630
- return this.ma.flags;
1631
- }
1632
- set flags(a) {
1633
- this.ma.flags = a;
1634
- }
1635
- get position() {
1636
- return this.ma.position;
1637
- }
1638
- set position(a) {
1639
- this.ma.position = a;
1640
- }
1641
- }, Ob = class {
1642
- constructor(a, b, c, d) {
1643
- a ||= this;
1644
- this.parent = a;
1645
- this.S = a.S;
1646
- this.ra = null;
1647
- this.id = Kb++;
1648
- this.name = b;
1649
- this.mode = c;
1650
- this.i = {};
1651
- this.l = {};
1652
- this.ta = d;
1653
- }
1654
- get read() {
1655
- return 365 === (this.mode & 365);
1656
- }
1657
- set read(a) {
1658
- a ? this.mode |= 365 : this.mode &= -366;
1659
- }
1660
- get write() {
1661
- return 146 === (this.mode & 146);
1662
- }
1663
- set write(a) {
1664
- a ? this.mode |= 146 : this.mode &= -147;
1665
- }
1666
- };
1667
- function Pb(a, b = {}) {
1668
- a = nb(a);
1669
- if (!a) {
1670
- return {path:"", node:null};
1671
- }
1672
- b = Object.assign({Za:!0, Ia:0}, b);
1673
- if (8 < b.Ia) {
1674
- throw new M(32);
1675
- }
1676
- a = a.split("/").filter(g => !!g);
1677
- for (var c = Hb, d = "/", e = 0; e < a.length; e++) {
1678
- var f = e === a.length - 1;
1679
- if (f && b.parent) {
1680
- break;
1681
- }
1682
- c = Fb(c, a[e]);
1683
- d = ib(d + "/" + a[e]);
1684
- c.ra && (!f || f && b.Za) && (c = c.ra.root);
1685
- if (!f || b.Ya) {
1686
- for (f = 0; 40960 === (c.mode & 61440);) {
1687
- if (c = Qb(d), d = nb(jb(d), c), c = Pb(d, {Ia:b.Ia + 1}).node, 40 < f++) {
1688
- throw new M(32);
1689
- }
1690
- }
1691
- }
1692
- }
1693
- return {path:d, node:c};
1694
- }
1695
- function Rb(a) {
1696
- for (var b;;) {
1697
- if (a === a.parent) {
1698
- return a = a.S.eb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
1699
- }
1700
- b = b ? `${a.name}/${b}` : a.name;
1701
- a = a.parent;
1702
- }
1703
- }
1704
- function Sb(a, b) {
1705
- for (var c = 0, d = 0; d < b.length; d++) {
1706
- c = (c << 5) - c + b.charCodeAt(d) | 0;
1707
- }
1708
- return (a + c >>> 0) % Lb.length;
1709
- }
1710
- function Fb(a, b) {
1711
- var c = 16384 === (a.mode & 61440) ? (c = Tb(a, "x")) ? c : a.i.ga ? 0 : 2 : 54;
1712
- if (c) {
1713
- throw new M(c);
1714
- }
1715
- for (c = Lb[Sb(a.id, b)]; c; c = c.Xb) {
1716
- var d = c.name;
1717
- if (c.parent.id === a.id && d === b) {
1718
- return c;
1719
- }
1720
- }
1721
- return a.i.ga(a, b);
1722
- }
1723
- function Db(a, b, c, d) {
1724
- a = new Ob(a, b, c, d);
1725
- b = Sb(a.parent.id, a.name);
1726
- a.Xb = Lb[b];
1727
- return Lb[b] = a;
1728
- }
1729
- function Ub(a) {
1730
- var b = ["r", "w", "rw"][a & 3];
1731
- a & 512 && (b += "w");
1732
- return b;
1733
- }
1734
- function Tb(a, b) {
1735
- if (Mb) {
1736
- return 0;
1737
- }
1738
- if (!b.includes("r") || a.mode & 292) {
1739
- if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) {
1740
- return 2;
1741
- }
1742
- } else {
1743
- return 2;
1744
- }
1745
- return 0;
1746
- }
1747
- function Vb(a, b) {
1748
- try {
1749
- return Fb(a, b), 20;
1750
- } catch (c) {
1751
- }
1752
- return Tb(a, "wx");
1753
- }
1754
- function Wb(a) {
1755
- a = Jb[a];
1756
- if (!a) {
1757
- throw new M(8);
1758
- }
1759
- return a;
1760
- }
1761
- function Xb(a, b = -1) {
1762
- a = Object.assign(new Nb(), a);
1763
- if (-1 == b) {
1764
- a: {
1765
- for (b = 0; 4096 >= b; b++) {
1766
- if (!Jb[b]) {
1767
- break a;
1768
- }
1769
- }
1770
- throw new M(33);
1771
- }
1772
- }
1773
- a.U = b;
1774
- return Jb[b] = a;
1775
- }
1776
- function Yb(a, b = -1) {
1777
- a = Xb(a, b);
1778
- a.l?.zc?.(a);
1779
- return a;
1780
- }
1781
- var Cb = {open(a) {
1782
- a.l = Ib[a.node.ta].l;
1783
- a.l.open?.(a);
1784
- }, Z() {
1785
- throw new M(70);
1786
- },};
1787
- function xb(a, b) {
1788
- Ib[a] = {l:b};
1789
- }
1790
- function Zb(a, b) {
1791
- var c = "/" === b;
1792
- if (c && Hb) {
1793
- throw new M(10);
1794
- }
1795
- if (!c && b) {
1796
- var d = Pb(b, {Za:!1});
1797
- b = d.path;
1798
- d = d.node;
1799
- if (d.ra) {
1800
- throw new M(10);
1801
- }
1802
- if (16384 !== (d.mode & 61440)) {
1803
- throw new M(54);
1804
- }
1805
- }
1806
- b = {type:a, Ic:{}, eb:b, Wb:[]};
1807
- a = a.S(b);
1808
- a.S = b;
1809
- b.root = a;
1810
- c ? Hb = a : d && (d.ra = b, d.S && d.S.Wb.push(b));
1811
- }
1812
- function ec(a, b, c) {
1813
- var d = Pb(a, {parent:!0}).node;
1814
- a = kb(a);
1815
- if (!a || "." === a || ".." === a) {
1816
- throw new M(28);
1817
- }
1818
- var e = Vb(d, a);
1819
- if (e) {
1820
- throw new M(e);
1821
- }
1822
- if (!d.i.qa) {
1823
- throw new M(63);
1824
- }
1825
- return d.i.qa(d, a, b, c);
1826
- }
1827
- function fc(a) {
1828
- return ec(a, 16895, 0);
1829
- }
1830
- function gc(a, b, c) {
1831
- "undefined" == typeof c && (c = b, b = 438);
1832
- ec(a, b | 8192, c);
1833
- }
1834
- function hc(a, b) {
1835
- if (!nb(a)) {
1836
- throw new M(44);
1837
- }
1838
- var c = Pb(b, {parent:!0}).node;
1839
- if (!c) {
1840
- throw new M(44);
1841
- }
1842
- b = kb(b);
1843
- var d = Vb(c, b);
1844
- if (d) {
1845
- throw new M(d);
1846
- }
1847
- if (!c.i.xa) {
1848
- throw new M(63);
1849
- }
1850
- c.i.xa(c, b, a);
1851
- }
1852
- function Qb(a) {
1853
- a = Pb(a).node;
1854
- if (!a) {
1855
- throw new M(44);
1856
- }
1857
- if (!a.i.ia) {
1858
- throw new M(28);
1859
- }
1860
- return nb(Rb(a.parent), a.i.ia(a));
1861
- }
1862
- function ic(a, b, c) {
1863
- if ("" === a) {
1864
- throw new M(44);
1865
- }
1866
- if ("string" == typeof b) {
1867
- var d = {r:0, "r+":2, w:577, "w+":578, a:1089, "a+":1090,}[b];
1868
- if ("undefined" == typeof d) {
1869
- throw Error(`Unknown file open mode: ${b}`);
1870
- }
1871
- b = d;
1872
- }
1873
- c = b & 64 ? ("undefined" == typeof c ? 438 : c) & 4095 | 32768 : 0;
1874
- if ("object" == typeof a) {
1875
- var e = a;
1876
- } else {
1877
- a = ib(a);
1878
- try {
1879
- e = Pb(a, {Ya:!(b & 131072)}).node;
1880
- } catch (f) {
1881
- }
1882
- }
1883
- d = !1;
1884
- if (b & 64) {
1885
- if (e) {
1886
- if (b & 128) {
1887
- throw new M(20);
1888
- }
1889
- } else {
1890
- e = ec(a, c, 0), d = !0;
1891
- }
1892
- }
1893
- if (!e) {
1894
- throw new M(44);
1895
- }
1896
- 8192 === (e.mode & 61440) && (b &= -513);
1897
- if (b & 65536 && 16384 !== (e.mode & 61440)) {
1898
- throw new M(54);
1899
- }
1900
- if (!d && (c = e ? 40960 === (e.mode & 61440) ? 32 : 16384 === (e.mode & 61440) && ("r" !== Ub(b) || b & 512) ? 31 : Tb(e, Ub(b)) : 44)) {
1901
- throw new M(c);
1902
- }
1903
- if (b & 512 && !d) {
1904
- c = e;
1905
- c = "string" == typeof c ? Pb(c, {Ya:!0}).node : c;
1906
- if (!c.i.N) {
1907
- throw new M(63);
1908
- }
1909
- if (16384 === (c.mode & 61440)) {
1910
- throw new M(31);
1911
- }
1912
- if (32768 !== (c.mode & 61440)) {
1913
- throw new M(28);
1914
- }
1915
- if (d = Tb(c, "w")) {
1916
- throw new M(d);
1917
- }
1918
- c.i.N(c, {size:0, timestamp:Date.now()});
1919
- }
1920
- b &= -131713;
1921
- e = Xb({node:e, path:Rb(e), flags:b, seekable:!0, position:0, l:e.l, jc:[], error:!1});
1922
- e.l.open && e.l.open(e);
1923
- !k.logReadFiles || b & 1 || (jc ||= {}, a in jc || (jc[a] = 1));
1924
- return e;
1925
- }
1926
- function kc(a, b, c) {
1927
- if (null === a.U) {
1928
- throw new M(8);
1929
- }
1930
- if (!a.seekable || !a.l.Z) {
1931
- throw new M(70);
1932
- }
1933
- if (0 != c && 1 != c && 2 != c) {
1934
- throw new M(28);
1935
- }
1936
- a.position = a.l.Z(a, b, c);
1937
- a.jc = [];
1938
- }
1939
- var lc;
1940
- function mc(a, b, c) {
1941
- a = ib("/dev/" + a);
1942
- var d = Gb(!!b, !!c);
1943
- nc ||= 64;
1944
- var e = nc++ << 8 | 0;
1945
- xb(e, {open(f) {
1946
- f.seekable = !1;
1947
- }, close() {
1948
- c?.buffer?.length && c(10);
1949
- }, read(f, g, h, n) {
1950
- for (var m = 0, r = 0; r < n; r++) {
1951
- try {
1952
- var w = b();
1953
- } catch (x) {
1954
- throw new M(29);
1955
- }
1956
- if (void 0 === w && 0 === m) {
1957
- throw new M(6);
1958
- }
1959
- if (null === w || void 0 === w) {
1960
- break;
1961
- }
1962
- m++;
1963
- g[h + r] = w;
1964
- }
1965
- m && (f.node.timestamp = Date.now());
1966
- return m;
1967
- }, write(f, g, h, n) {
1968
- for (var m = 0; m < n; m++) {
1969
- try {
1970
- c(g[h + m]);
1971
- } catch (r) {
1972
- throw new M(29);
1973
- }
1974
- }
1975
- n && (f.node.timestamp = Date.now());
1976
- return m;
1977
- }});
1978
- gc(a, d, e);
1979
- }
1980
- var nc, oc = {}, jc, gb = void 0, pc = (a, b) => Object.defineProperty(b, "name", {value:a}), qc = [], rc = [], O, P = a => {
1981
- if (!a) {
1982
- throw new O("Cannot use deleted val. handle = " + a);
1983
- }
1984
- return rc[a];
1985
- }, sc = a => {
1986
- switch(a) {
1987
- case void 0:
1988
- return 2;
1989
- case null:
1990
- return 4;
1991
- case !0:
1992
- return 6;
1993
- case !1:
1994
- return 8;
1995
- default:
1996
- const b = qc.pop() || rc.length;
1997
- rc[b] = a;
1998
- rc[b + 1] = 1;
1999
- return b;
2000
- }
2001
- }, tc = a => {
2002
- var b = Error, c = pc(a, function(d) {
2003
- this.name = a;
2004
- this.message = d;
2005
- d = Error(d).stack;
2006
- void 0 !== d && (this.stack = this.toString() + "\n" + d.replace(/^Error(:[^\n]*)?\n/, ""));
2007
- });
2008
- c.prototype = Object.create(b.prototype);
2009
- c.prototype.constructor = c;
2010
- c.prototype.toString = function() {
2011
- return void 0 === this.message ? this.name : `${this.name}: ${this.message}`;
2012
- };
2013
- return c;
2014
- }, uc, vc, R = a => {
2015
- for (var b = ""; A[a];) {
2016
- b += vc[A[a++]];
2017
- }
2018
- return b;
2019
- }, wc = [], xc = () => {
2020
- for (; wc.length;) {
2021
- var a = wc.pop();
2022
- a.g.ca = !1;
2023
- a["delete"]();
2024
- }
2025
- }, yc, zc = {}, Ac = (a, b) => {
2026
- if (void 0 === b) {
2027
- throw new O("ptr should not be undefined");
2028
- }
2029
- for (; a.B;) {
2030
- b = a.ja(b), a = a.B;
2031
- }
2032
- return b;
2033
- }, Bc = {}, Ec = a => {
2034
- a = Cc(a);
2035
- var b = R(a);
2036
- Dc(a);
2037
- return b;
2038
- }, Fc = (a, b) => {
2039
- var c = Bc[a];
2040
- if (void 0 === c) {
2041
- throw a = `${b} has unknown type ${Ec(a)}`, new O(a);
2042
- }
2043
- return c;
2044
- }, Gc = () => {
2045
- }, Hc = !1, Ic = (a, b, c) => {
2046
- if (b === c) {
2047
- return a;
2048
- }
2049
- if (void 0 === c.B) {
2050
- return null;
2051
- }
2052
- a = Ic(a, b, c.B);
2053
- return null === a ? null : c.Db(a);
2054
- }, Jc = {}, Kc = (a, b) => {
2055
- b = Ac(a, b);
2056
- return zc[b];
2057
- }, Lc, Nc = (a, b) => {
2058
- if (!b.s || !b.m) {
2059
- throw new Lc("makeClassHandle requires ptr and ptrType");
2060
- }
2061
- if (!!b.H !== !!b.C) {
2062
- throw new Lc("Both smartPtrType and smartPtr must be specified");
2063
- }
2064
- b.count = {value:1};
2065
- return Mc(Object.create(a, {g:{value:b, writable:!0,},}));
2066
- }, Mc = a => {
2067
- if ("undefined" === typeof FinalizationRegistry) {
2068
- return Mc = b => b, a;
2069
- }
2070
- Hc = new FinalizationRegistry(b => {
2071
- b = b.g;
2072
- --b.count.value;
2073
- 0 === b.count.value && (b.C ? b.H.M(b.C) : b.s.h.M(b.m));
2074
- });
2075
- Mc = b => {
2076
- var c = b.g;
2077
- c.C && Hc.register(b, {g:c}, b);
2078
- return b;
2079
- };
2080
- Gc = b => {
2081
- Hc.unregister(b);
2082
- };
2083
- return Mc(a);
2084
- }, Oc = {}, Pc = a => {
2085
- for (; a.length;) {
2086
- var b = a.pop();
2087
- a.pop()(b);
2088
- }
2089
- };
2090
- function Qc(a) {
2091
- return this.fromWireType(E[a >> 2]);
2092
- }
2093
- var Rc = {}, Sc = {}, T = (a, b, c) => {
2094
- function d(h) {
2095
- h = c(h);
2096
- if (h.length !== a.length) {
2097
- throw new Lc("Mismatched type converter count");
2098
- }
2099
- for (var n = 0; n < a.length; ++n) {
2100
- Tc(a[n], h[n]);
2101
- }
2102
- }
2103
- a.forEach(function(h) {
2104
- Sc[h] = b;
2105
- });
2106
- var e = Array(b.length), f = [], g = 0;
2107
- b.forEach((h, n) => {
2108
- Bc.hasOwnProperty(h) ? e[n] = Bc[h] : (f.push(h), Rc.hasOwnProperty(h) || (Rc[h] = []), Rc[h].push(() => {
2109
- e[n] = Bc[h];
2110
- ++g;
2111
- g === f.length && d(e);
2112
- }));
2113
- });
2114
- 0 === f.length && d(e);
2115
- };
2116
- function Uc(a, b, c = {}) {
2117
- var d = b.name;
2118
- if (!a) {
2119
- throw new O(`type "${d}" must have a positive integer typeid pointer`);
2120
- }
2121
- if (Bc.hasOwnProperty(a)) {
2122
- if (c.Nb) {
2123
- return;
2124
- }
2125
- throw new O(`Cannot register type '${d}' twice`);
2126
- }
2127
- Bc[a] = b;
2128
- delete Sc[a];
2129
- Rc.hasOwnProperty(a) && (b = Rc[a], delete Rc[a], b.forEach(e => e()));
2130
- }
2131
- function Tc(a, b, c = {}) {
2132
- if (!("argPackAdvance" in b)) {
2133
- throw new TypeError("registerType registeredInstance requires argPackAdvance");
2134
- }
2135
- return Uc(a, b, c);
2136
- }
2137
- var Vc = a => {
2138
- throw new O(a.g.s.h.name + " instance already deleted");
2139
- };
2140
- function Wc() {
2141
- }
2142
- var Xc = (a, b, c) => {
2143
- if (void 0 === a[b].v) {
2144
- var d = a[b];
2145
- a[b] = function(...e) {
2146
- if (!a[b].v.hasOwnProperty(e.length)) {
2147
- throw new O(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${a[b].v})!`);
2148
- }
2149
- return a[b].v[e.length].apply(this, e);
2150
- };
2151
- a[b].v = [];
2152
- a[b].v[d.ba] = d;
2153
- }
2154
- }, Yc = (a, b, c) => {
2155
- if (k.hasOwnProperty(a)) {
2156
- if (void 0 === c || void 0 !== k[a].v && void 0 !== k[a].v[c]) {
2157
- throw new O(`Cannot register public name '${a}' twice`);
2158
- }
2159
- Xc(k, a, a);
2160
- if (k.hasOwnProperty(c)) {
2161
- throw new O(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
2162
- }
2163
- k[a].v[c] = b;
2164
- } else {
2165
- k[a] = b, void 0 !== c && (k[a].Hc = c);
2166
- }
2167
- }, Zc = a => {
2168
- if (void 0 === a) {
2169
- return "_unknown";
2170
- }
2171
- a = a.replace(/[^a-zA-Z0-9_]/g, "$");
2172
- var b = a.charCodeAt(0);
2173
- return 48 <= b && 57 >= b ? `_${a}` : a;
2174
- };
2175
- function $c(a, b, c, d, e, f, g, h) {
2176
- this.name = a;
2177
- this.constructor = b;
2178
- this.K = c;
2179
- this.M = d;
2180
- this.B = e;
2181
- this.Ib = f;
2182
- this.ja = g;
2183
- this.Db = h;
2184
- this.ib = [];
2185
- }
2186
- var ad = (a, b, c) => {
2187
- for (; b !== c;) {
2188
- if (!b.ja) {
2189
- throw new O(`Expected null or instance of ${c.name}, got an instance of ${b.name}`);
2190
- }
2191
- a = b.ja(a);
2192
- b = b.B;
2193
- }
2194
- return a;
2195
- };
2196
- function bd(a, b) {
2197
- if (null === b) {
2198
- if (this.Fa) {
2199
- throw new O(`null is not a valid ${this.name}`);
2200
- }
2201
- return 0;
2202
- }
2203
- if (!b.g) {
2204
- throw new O(`Cannot pass "${cd(b)}" as a ${this.name}`);
2205
- }
2206
- if (!b.g.m) {
2207
- throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);
2208
- }
2209
- return ad(b.g.m, b.g.s.h, this.h);
2210
- }
2211
- function dd(a, b) {
2212
- if (null === b) {
2213
- if (this.Fa) {
2214
- throw new O(`null is not a valid ${this.name}`);
2215
- }
2216
- if (this.pa) {
2217
- var c = this.Ha();
2218
- null !== a && a.push(this.M, c);
2219
- return c;
2220
- }
2221
- return 0;
2222
- }
2223
- if (!b || !b.g) {
2224
- throw new O(`Cannot pass "${cd(b)}" as a ${this.name}`);
2225
- }
2226
- if (!b.g.m) {
2227
- throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);
2228
- }
2229
- if (!this.oa && b.g.s.oa) {
2230
- throw new O(`Cannot convert argument of type ${b.g.H ? b.g.H.name : b.g.s.name} to parameter type ${this.name}`);
2231
- }
2232
- c = ad(b.g.m, b.g.s.h, this.h);
2233
- if (this.pa) {
2234
- if (void 0 === b.g.C) {
2235
- throw new O("Passing raw pointer to smart pointer is illegal");
2236
- }
2237
- switch(this.dc) {
2238
- case 0:
2239
- if (b.g.H === this) {
2240
- c = b.g.C;
2241
- } else {
2242
- throw new O(`Cannot convert argument of type ${b.g.H ? b.g.H.name : b.g.s.name} to parameter type ${this.name}`);
2243
- }
2244
- break;
2245
- case 1:
2246
- c = b.g.C;
2247
- break;
2248
- case 2:
2249
- if (b.g.H === this) {
2250
- c = b.g.C;
2251
- } else {
2252
- var d = b.clone();
2253
- c = this.$b(c, sc(() => d["delete"]()));
2254
- null !== a && a.push(this.M, c);
2255
- }
2256
- break;
2257
- default:
2258
- throw new O("Unsupporting sharing policy");
2259
- }
2260
- }
2261
- return c;
2262
- }
2263
- function ed(a, b) {
2264
- if (null === b) {
2265
- if (this.Fa) {
2266
- throw new O(`null is not a valid ${this.name}`);
2267
- }
2268
- return 0;
2269
- }
2270
- if (!b.g) {
2271
- throw new O(`Cannot pass "${cd(b)}" as a ${this.name}`);
2272
- }
2273
- if (!b.g.m) {
2274
- throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);
2275
- }
2276
- if (b.g.s.oa) {
2277
- throw new O(`Cannot convert argument of type ${b.g.s.name} to parameter type ${this.name}`);
2278
- }
2279
- return ad(b.g.m, b.g.s.h, this.h);
2280
- }
2281
- function fd(a, b, c, d, e, f, g, h, n, m, r) {
2282
- this.name = a;
2283
- this.h = b;
2284
- this.Fa = c;
2285
- this.oa = d;
2286
- this.pa = e;
2287
- this.Zb = f;
2288
- this.dc = g;
2289
- this.jb = h;
2290
- this.Ha = n;
2291
- this.$b = m;
2292
- this.M = r;
2293
- e || void 0 !== b.B ? this.toWireType = dd : (this.toWireType = d ? bd : ed, this.J = null);
2294
- }
2295
- var gd = (a, b, c) => {
2296
- if (!k.hasOwnProperty(a)) {
2297
- throw new Lc("Replacing nonexistent public symbol");
2298
- }
2299
- void 0 !== k[a].v && void 0 !== c ? k[a].v[c] = b : (k[a] = b, k[a].ba = c);
2300
- }, hd = [], jd, kd = a => {
2301
- var b = hd[a];
2302
- b || (a >= hd.length && (hd.length = a + 1), hd[a] = b = jd.get(a));
2303
- return b;
2304
- }, ld = (a, b, c = []) => {
2305
- a.includes("j") ? (a = a.replace(/p/g, "i"), b = (0,k["dynCall_" + a])(b, ...c)) : b = kd(b)(...c);
2306
- return b;
2307
- }, md = (a, b) => (...c) => ld(a, b, c), V = (a, b) => {
2308
- a = R(a);
2309
- var c = a.includes("j") ? md(a, b) : kd(b);
2310
- if ("function" != typeof c) {
2311
- throw new O(`unknown function pointer with signature ${a}: ${b}`);
2312
- }
2313
- return c;
2314
- }, nd, od = (a, b) => {
2315
- function c(f) {
2316
- e[f] || Bc[f] || (Sc[f] ? Sc[f].forEach(c) : (d.push(f), e[f] = !0));
2317
- }
2318
- var d = [], e = {};
2319
- b.forEach(c);
2320
- throw new nd(`${a}: ` + d.map(Ec).join([", "]));
2321
- };
2322
- function pd(a) {
2323
- for (var b = 1; b < a.length; ++b) {
2324
- if (null !== a[b] && void 0 === a[b].J) {
2325
- return !0;
2326
- }
2327
- }
2328
- return !1;
2329
- }
2330
- function td(a, b, c, d, e) {
2331
- var f = b.length;
2332
- if (2 > f) {
2333
- throw new O("argTypes array size mismatch! Must at least get return value and 'this' types!");
2334
- }
2335
- var g = null !== b[1] && null !== c, h = pd(b), n = "void" !== b[0].name, m = f - 2, r = Array(m), w = [], x = [];
2336
- return pc(a, function(...l) {
2337
- if (l.length !== m) {
2338
- throw new O(`function ${a} called with ${l.length} arguments, expected ${m}`);
2339
- }
2340
- x.length = 0;
2341
- w.length = g ? 2 : 1;
2342
- w[0] = e;
2343
- if (g) {
2344
- var t = b[1].toWireType(x, this);
2345
- w[1] = t;
2346
- }
2347
- for (var q = 0; q < m; ++q) {
2348
- r[q] = b[q + 2].toWireType(x, l[q]), w.push(r[q]);
2349
- }
2350
- l = d(...w);
2351
- if (h) {
2352
- Pc(x);
2353
- } else {
2354
- for (q = g ? 1 : 2; q < b.length; q++) {
2355
- var C = 1 === q ? t : r[q - 2];
2356
- null !== b[q].J && b[q].J(C);
2357
- }
2358
- }
2359
- t = n ? b[0].fromWireType(l) : void 0;
2360
- return t;
2361
- });
2362
- }
2363
- var ud = (a, b) => {
2364
- for (var c = [], d = 0; d < a; d++) {
2365
- c.push(E[b + 4 * d >> 2]);
2366
- }
2367
- return c;
2368
- }, vd = a => {
2369
- a = a.trim();
2370
- const b = a.indexOf("(");
2371
- return -1 !== b ? a.substr(0, b) : a;
2372
- }, wd = (a, b, c) => {
2373
- if (!(a instanceof Object)) {
2374
- throw new O(`${c} with invalid "this": ${a}`);
2375
- }
2376
- if (!(a instanceof b.h.constructor)) {
2377
- throw new O(`${c} incompatible with "this" of type ${a.constructor.name}`);
2378
- }
2379
- if (!a.g.m) {
2380
- throw new O(`cannot call emscripten binding method ${c} on deleted object`);
2381
- }
2382
- return ad(a.g.m, a.g.s.h, b.h);
2383
- }, xd = a => {
2384
- 9 < a && 0 === --rc[a + 1] && (rc[a] = void 0, qc.push(a));
2385
- }, yd = {name:"emscripten::val", fromWireType:a => {
2386
- var b = P(a);
2387
- xd(a);
2388
- return b;
2389
- }, toWireType:(a, b) => sc(b), argPackAdvance:8, readValueFromPointer:Qc, J:null,}, zd = (a, b, c) => {
2390
- switch(b) {
2391
- case 1:
2392
- return c ? function(d) {
2393
- return this.fromWireType(y[d]);
2394
- } : function(d) {
2395
- return this.fromWireType(A[d]);
2396
- };
2397
- case 2:
2398
- return c ? function(d) {
2399
- return this.fromWireType(Ea[d >> 1]);
2400
- } : function(d) {
2401
- return this.fromWireType(Ha[d >> 1]);
2402
- };
2403
- case 4:
2404
- return c ? function(d) {
2405
- return this.fromWireType(B[d >> 2]);
2406
- } : function(d) {
2407
- return this.fromWireType(E[d >> 2]);
2408
- };
2409
- default:
2410
- throw new TypeError(`invalid integer width (${b}): ${a}`);
2411
- }
2412
- }, cd = a => {
2413
- if (null === a) {
2414
- return "null";
2415
- }
2416
- var b = typeof a;
2417
- return "object" === b || "array" === b || "function" === b ? a.toString() : "" + a;
2418
- }, Ad = (a, b) => {
2419
- switch(b) {
2420
- case 4:
2421
- return function(c) {
2422
- return this.fromWireType(Ia[c >> 2]);
2423
- };
2424
- case 8:
2425
- return function(c) {
2426
- return this.fromWireType(Ja[c >> 3]);
2427
- };
2428
- default:
2429
- throw new TypeError(`invalid float width (${b}): ${a}`);
2430
- }
2431
- }, Bd = (a, b, c) => {
2432
- switch(b) {
2433
- case 1:
2434
- return c ? d => y[d] : d => A[d];
2435
- case 2:
2436
- return c ? d => Ea[d >> 1] : d => Ha[d >> 1];
2437
- case 4:
2438
- return c ? d => B[d >> 2] : d => E[d >> 2];
2439
- default:
2440
- throw new TypeError(`invalid integer width (${b}): ${a}`);
2441
- }
2442
- }, Cd = "undefined" != typeof TextDecoder ? new TextDecoder("utf-16le") : void 0, Dd = (a, b) => {
2443
- var c = a >> 1;
2444
- for (var d = c + b / 2; !(c >= d) && Ha[c];) {
2445
- ++c;
2446
- }
2447
- c <<= 1;
2448
- if (32 < c - a && Cd) {
2449
- return Cd.decode(A.subarray(a, c));
2450
- }
2451
- c = "";
2452
- for (d = 0; !(d >= b / 2); ++d) {
2453
- var e = Ea[a + 2 * d >> 1];
2454
- if (0 == e) {
2455
- break;
2456
- }
2457
- c += String.fromCharCode(e);
2458
- }
2459
- return c;
2460
- }, Ed = (a, b, c) => {
2461
- c ??= 2147483647;
2462
- if (2 > c) {
2463
- return 0;
2464
- }
2465
- c -= 2;
2466
- var d = b;
2467
- c = c < 2 * a.length ? c / 2 : a.length;
2468
- for (var e = 0; e < c; ++e) {
2469
- Ea[b >> 1] = a.charCodeAt(e), b += 2;
2470
- }
2471
- Ea[b >> 1] = 0;
2472
- return b - d;
2473
- }, Fd = a => 2 * a.length, Gd = (a, b) => {
2474
- for (var c = 0, d = ""; !(c >= b / 4);) {
2475
- var e = B[a + 4 * c >> 2];
2476
- if (0 == e) {
2477
- break;
2478
- }
2479
- ++c;
2480
- 65536 <= e ? (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023)) : d += String.fromCharCode(e);
2481
- }
2482
- return d;
2483
- }, Hd = (a, b, c) => {
2484
- c ??= 2147483647;
2485
- if (4 > c) {
2486
- return 0;
2487
- }
2488
- var d = b;
2489
- c = d + c - 4;
2490
- for (var e = 0; e < a.length; ++e) {
2491
- var f = a.charCodeAt(e);
2492
- if (55296 <= f && 57343 >= f) {
2493
- var g = a.charCodeAt(++e);
2494
- f = 65536 + ((f & 1023) << 10) | g & 1023;
2495
- }
2496
- B[b >> 2] = f;
2497
- b += 4;
2498
- if (b + 4 > c) {
2499
- break;
2500
- }
2501
- }
2502
- B[b >> 2] = 0;
2503
- return b - d;
2504
- }, Id = a => {
2505
- for (var b = 0, c = 0; c < a.length; ++c) {
2506
- var d = a.charCodeAt(c);
2507
- 55296 <= d && 57343 >= d && ++c;
2508
- b += 4;
2509
- }
2510
- return b;
2511
- }, Jd = (a, b, c) => {
2512
- var d = [];
2513
- a = a.toWireType(d, c);
2514
- d.length && (E[b >> 2] = sc(d));
2515
- return a;
2516
- }, Kd = [], Ld = {}, Md = a => {
2517
- var b = Ld[a];
2518
- return void 0 === b ? R(a) : b;
2519
- }, Nd = a => {
2520
- var b = Kd.length;
2521
- Kd.push(a);
2522
- return b;
2523
- }, Od = (a, b) => {
2524
- for (var c = Array(a), d = 0; d < a; ++d) {
2525
- c[d] = Fc(E[b + 4 * d >> 2], "parameter " + d);
2526
- }
2527
- return c;
2528
- }, Pd = Reflect.construct, Qd = a => 0 === a % 4 && (0 !== a % 100 || 0 === a % 400), Rd = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], Sd = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Td = [], Ud = {}, Wd = () => {
2529
- if (!Vd) {
2530
- var a = {USER:"web_user", LOGNAME:"web_user", PATH:"/", PWD:"/", HOME:"/home/web_user", LANG:("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _:sa || "./this.program"}, b;
2531
- for (b in Ud) {
2532
- void 0 === Ud[b] ? delete a[b] : a[b] = Ud[b];
2533
- }
2534
- var c = [];
2535
- for (b in a) {
2536
- c.push(`${b}=${a[b]}`);
2537
- }
2538
- Vd = c;
2539
- }
2540
- return Vd;
2541
- }, Vd, Xd = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Yd = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Zd = (a, b, c, d) => {
2542
- function e(l, t, q) {
2543
- for (l = "number" == typeof l ? l.toString() : l || ""; l.length < t;) {
2544
- l = q[0] + l;
2545
- }
2546
- return l;
2547
- }
2548
- function f(l, t) {
2549
- return e(l, t, "0");
2550
- }
2551
- function g(l, t) {
2552
- function q(H) {
2553
- return 0 > H ? -1 : 0 < H ? 1 : 0;
2554
- }
2555
- var C;
2556
- 0 === (C = q(l.getFullYear() - t.getFullYear())) && 0 === (C = q(l.getMonth() - t.getMonth())) && (C = q(l.getDate() - t.getDate()));
2557
- return C;
2558
- }
2559
- function h(l) {
2560
- switch(l.getDay()) {
2561
- case 0:
2562
- return new Date(l.getFullYear() - 1, 11, 29);
2563
- case 1:
2564
- return l;
2565
- case 2:
2566
- return new Date(l.getFullYear(), 0, 3);
2567
- case 3:
2568
- return new Date(l.getFullYear(), 0, 2);
2569
- case 4:
2570
- return new Date(l.getFullYear(), 0, 1);
2571
- case 5:
2572
- return new Date(l.getFullYear() - 1, 11, 31);
2573
- case 6:
2574
- return new Date(l.getFullYear() - 1, 11, 30);
2575
- }
2576
- }
2577
- function n(l) {
2578
- var t = l.$;
2579
- for (l = new Date((new Date(l.aa + 1900, 0, 1)).getTime()); 0 < t;) {
2580
- var q = l.getMonth(), C = (Qd(l.getFullYear()) ? Xd : Yd)[q];
2581
- if (t > C - l.getDate()) {
2582
- t -= C - l.getDate() + 1, l.setDate(1), 11 > q ? l.setMonth(q + 1) : (l.setMonth(0), l.setFullYear(l.getFullYear() + 1));
2583
- } else {
2584
- l.setDate(l.getDate() + t);
2585
- break;
2586
- }
2587
- }
2588
- q = new Date(l.getFullYear() + 1, 0, 4);
2589
- t = h(new Date(l.getFullYear(), 0, 4));
2590
- q = h(q);
2591
- return 0 >= g(t, l) ? 0 >= g(q, l) ? l.getFullYear() + 1 : l.getFullYear() : l.getFullYear() - 1;
2592
- }
2593
- var m = E[d + 40 >> 2];
2594
- d = {hc:B[d >> 2], fc:B[d + 4 >> 2], ya:B[d + 8 >> 2], Ka:B[d + 12 >> 2], za:B[d + 16 >> 2], aa:B[d + 20 >> 2], O:B[d + 24 >> 2], $:B[d + 28 >> 2], Kc:B[d + 32 >> 2], ec:B[d + 36 >> 2], ic:m ? m ? pb(A, m) : "" : ""};
2595
- c = c ? pb(A, c) : "";
2596
- m = {"%c":"%a %b %d %H:%M:%S %Y", "%D":"%m/%d/%y", "%F":"%Y-%m-%d", "%h":"%b", "%r":"%I:%M:%S %p", "%R":"%H:%M", "%T":"%H:%M:%S", "%x":"%m/%d/%y", "%X":"%H:%M:%S", "%Ec":"%c", "%EC":"%C", "%Ex":"%m/%d/%y", "%EX":"%H:%M:%S", "%Ey":"%y", "%EY":"%Y", "%Od":"%d", "%Oe":"%e", "%OH":"%H", "%OI":"%I", "%Om":"%m", "%OM":"%M", "%OS":"%S", "%Ou":"%u", "%OU":"%U", "%OV":"%V", "%Ow":"%w", "%OW":"%W", "%Oy":"%y",};
2597
- for (var r in m) {
2598
- c = c.replace(new RegExp(r, "g"), m[r]);
2599
- }
2600
- var w = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), x = "January February March April May June July August September October November December".split(" ");
2601
- m = {"%a":l => w[l.O].substring(0, 3), "%A":l => w[l.O], "%b":l => x[l.za].substring(0, 3), "%B":l => x[l.za], "%C":l => f((l.aa + 1900) / 100 | 0, 2), "%d":l => f(l.Ka, 2), "%e":l => e(l.Ka, 2, " "), "%g":l => n(l).toString().substring(2), "%G":n, "%H":l => f(l.ya, 2), "%I":l => {
2602
- l = l.ya;
2603
- 0 == l ? l = 12 : 12 < l && (l -= 12);
2604
- return f(l, 2);
2605
- }, "%j":l => {
2606
- for (var t = 0, q = 0; q <= l.za - 1; t += (Qd(l.aa + 1900) ? Xd : Yd)[q++]) {
2607
- }
2608
- return f(l.Ka + t, 3);
2609
- }, "%m":l => f(l.za + 1, 2), "%M":l => f(l.fc, 2), "%n":() => "\n", "%p":l => 0 <= l.ya && 12 > l.ya ? "AM" : "PM", "%S":l => f(l.hc, 2), "%t":() => "\t", "%u":l => l.O || 7, "%U":l => f(Math.floor((l.$ + 7 - l.O) / 7), 2), "%V":l => {
2610
- var t = Math.floor((l.$ + 7 - (l.O + 6) % 7) / 7);
2611
- 2 >= (l.O + 371 - l.$ - 2) % 7 && t++;
2612
- if (t) {
2613
- 53 == t && (q = (l.O + 371 - l.$) % 7, 4 == q || 3 == q && Qd(l.aa) || (t = 1));
2614
- } else {
2615
- t = 52;
2616
- var q = (l.O + 7 - l.$ - 1) % 7;
2617
- (4 == q || 5 == q && Qd(l.aa % 400 - 1)) && t++;
2618
- }
2619
- return f(t, 2);
2620
- }, "%w":l => l.O, "%W":l => f(Math.floor((l.$ + 7 - (l.O + 6) % 7) / 7), 2), "%y":l => (l.aa + 1900).toString().substring(2), "%Y":l => l.aa + 1900, "%z":l => {
2621
- l = l.ec;
2622
- var t = 0 <= l;
2623
- l = Math.abs(l) / 60;
2624
- return (t ? "+" : "-") + String("0000" + (l / 60 * 100 + l % 60)).slice(-4);
2625
- }, "%Z":l => l.ic, "%%":() => "%"};
2626
- c = c.replace(/%%/g, "\x00\x00");
2627
- for (r in m) {
2628
- c.includes(r) && (c = c.replace(new RegExp(r, "g"), m[r](d)));
2629
- }
2630
- c = c.replace(/\0\0/g, "%");
2631
- r = ub(c, !1);
2632
- if (r.length > b) {
2633
- return 0;
2634
- }
2635
- y.set(r, a);
2636
- return r.length - 1;
2637
- };
2638
- [44].forEach(a => {
2639
- Eb[a] = new M(a);
2640
- Eb[a].stack = "<generic error, no stack>";
2641
- });
2642
- Lb = Array(4096);
2643
- Zb(N, "/");
2644
- fc("/tmp");
2645
- fc("/home");
2646
- fc("/home/web_user");
2647
- (function() {
2648
- fc("/dev");
2649
- xb(259, {read:() => 0, write:(d, e, f, g) => g,});
2650
- gc("/dev/null", 259);
2651
- wb(1280, zb);
2652
- wb(1536, Ab);
2653
- gc("/dev/tty", 1280);
2654
- gc("/dev/tty1", 1536);
2655
- var a = new Uint8Array(1024), b = 0, c = () => {
2656
- 0 === b && (b = mb(a).byteLength);
2657
- return a[--b];
2658
- };
2659
- mc("random", c);
2660
- mc("urandom", c);
2661
- fc("/dev/shm");
2662
- fc("/dev/shm/tmp");
2663
- })();
2664
- (function() {
2665
- fc("/proc");
2666
- var a = fc("/proc/self");
2667
- fc("/proc/self/fd");
2668
- Zb({S() {
2669
- var b = Db(a, "fd", 16895, 73);
2670
- b.i = {ga(c, d) {
2671
- var e = Wb(+d);
2672
- c = {parent:null, S:{eb:"fake"}, i:{ia:() => e.path},};
2673
- return c.parent = c;
2674
- }};
2675
- return b;
2676
- }}, "/proc/self/fd");
2677
- })();
2678
- O = k.BindingError = class extends Error {
2679
- constructor(a) {
2680
- super(a);
2681
- this.name = "BindingError";
2682
- }
2683
- };
2684
- rc.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1,);
2685
- k.count_emval_handles = () => rc.length / 2 - 5 - qc.length;
2686
- uc = k.PureVirtualError = tc("PureVirtualError");
2687
- for (var $d = Array(256), ae = 0; 256 > ae; ++ae) {
2688
- $d[ae] = String.fromCharCode(ae);
2689
- }
2690
- vc = $d;
2691
- k.getInheritedInstanceCount = () => Object.keys(zc).length;
2692
- k.getLiveInheritedInstances = () => {
2693
- var a = [], b;
2694
- for (b in zc) {
2695
- zc.hasOwnProperty(b) && a.push(zc[b]);
2696
- }
2697
- return a;
2698
- };
2699
- k.flushPendingDeletes = xc;
2700
- k.setDelayFunction = a => {
2701
- yc = a;
2702
- wc.length && yc && yc(xc);
2703
- };
2704
- Lc = k.InternalError = class extends Error {
2705
- constructor(a) {
2706
- super(a);
2707
- this.name = "InternalError";
2708
- }
2709
- };
2710
- Object.assign(Wc.prototype, {isAliasOf:function(a) {
2711
- if (!(this instanceof Wc && a instanceof Wc)) {
2712
- return !1;
2713
- }
2714
- var b = this.g.s.h, c = this.g.m;
2715
- a.g = a.g;
2716
- var d = a.g.s.h;
2717
- for (a = a.g.m; b.B;) {
2718
- c = b.ja(c), b = b.B;
2719
- }
2720
- for (; d.B;) {
2721
- a = d.ja(a), d = d.B;
2722
- }
2723
- return b === d && c === a;
2724
- }, clone:function() {
2725
- this.g.m || Vc(this);
2726
- if (this.g.ea) {
2727
- return this.g.count.value += 1, this;
2728
- }
2729
- var a = Mc, b = Object, c = b.create, d = Object.getPrototypeOf(this), e = this.g;
2730
- a = a(c.call(b, d, {g:{value:{count:e.count, ca:e.ca, ea:e.ea, m:e.m, s:e.s, C:e.C, H:e.H,},}}));
2731
- a.g.count.value += 1;
2732
- a.g.ca = !1;
2733
- return a;
2734
- }, ["delete"]() {
2735
- this.g.m || Vc(this);
2736
- if (this.g.ca && !this.g.ea) {
2737
- throw new O("Object already scheduled for deletion");
2738
- }
2739
- Gc(this);
2740
- var a = this.g;
2741
- --a.count.value;
2742
- 0 === a.count.value && (a.C ? a.H.M(a.C) : a.s.h.M(a.m));
2743
- this.g.ea || (this.g.C = void 0, this.g.m = void 0);
2744
- }, isDeleted:function() {
2745
- return !this.g.m;
2746
- }, deleteLater:function() {
2747
- this.g.m || Vc(this);
2748
- if (this.g.ca && !this.g.ea) {
2749
- throw new O("Object already scheduled for deletion");
2750
- }
2751
- wc.push(this);
2752
- 1 === wc.length && yc && yc(xc);
2753
- this.g.ca = !0;
2754
- return this;
2755
- },});
2756
- Object.assign(fd.prototype, {Jb(a) {
2757
- this.jb && (a = this.jb(a));
2758
- return a;
2759
- }, Ua(a) {
2760
- this.M?.(a);
2761
- }, argPackAdvance:8, readValueFromPointer:Qc, fromWireType:function(a) {
2762
- function b() {
2763
- return this.pa ? Nc(this.h.K, {s:this.Zb, m:c, H:this, C:a,}) : Nc(this.h.K, {s:this, m:a,});
2764
- }
2765
- var c = this.Jb(a);
2766
- if (!c) {
2767
- return this.Ua(a), null;
2768
- }
2769
- var d = Kc(this.h, c);
2770
- if (void 0 !== d) {
2771
- if (0 === d.g.count.value) {
2772
- return d.g.m = c, d.g.C = a, d.clone();
2773
- }
2774
- d = d.clone();
2775
- this.Ua(a);
2776
- return d;
2777
- }
2778
- d = this.h.Ib(c);
2779
- d = Jc[d];
2780
- if (!d) {
2781
- return b.call(this);
2782
- }
2783
- d = this.oa ? d.zb : d.pointerType;
2784
- var e = Ic(c, this.h, d.h);
2785
- return null === e ? b.call(this) : this.pa ? Nc(d.h.K, {s:d, m:e, H:this, C:a,}) : Nc(d.h.K, {s:d, m:e,});
2786
- },});
2787
- nd = k.UnboundTypeError = tc("UnboundTypeError");
2788
- var de = {__syscall_fcntl64:function(a, b, c) {
2789
- gb = c;
2790
- try {
2791
- var d = Wb(a);
2792
- switch(b) {
2793
- case 0:
2794
- var e = fb();
2795
- if (0 > e) {
2796
- break;
2797
- }
2798
- for (; Jb[e];) {
2799
- e++;
2800
- }
2801
- return Yb(d, e).U;
2802
- case 1:
2803
- case 2:
2804
- return 0;
2805
- case 3:
2806
- return d.flags;
2807
- case 4:
2808
- return e = fb(), d.flags |= e, 0;
2809
- case 12:
2810
- return e = fb(), Ea[e + 0 >> 1] = 2, 0;
2811
- case 13:
2812
- case 14:
2813
- return 0;
2814
- }
2815
- return -28;
2816
- } catch (f) {
2817
- if ("undefined" == typeof oc || "ErrnoError" !== f.name) {
2818
- throw f;
2819
- }
2820
- return -f.Y;
2821
- }
2822
- }, __syscall_ioctl:function(a, b, c) {
2823
- gb = c;
2824
- try {
2825
- var d = Wb(a);
2826
- switch(b) {
2827
- case 21509:
2828
- return d.o ? 0 : -59;
2829
- case 21505:
2830
- if (!d.o) {
2831
- return -59;
2832
- }
2833
- if (d.o.T.Pb) {
2834
- a = [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,];
2835
- var e = fb();
2836
- B[e >> 2] = 25856;
2837
- B[e + 4 >> 2] = 5;
2838
- B[e + 8 >> 2] = 191;
2839
- B[e + 12 >> 2] = 35387;
2840
- for (var f = 0; 32 > f; f++) {
2841
- y[e + f + 17] = a[f] || 0;
2842
- }
2843
- }
2844
- return 0;
2845
- case 21510:
2846
- case 21511:
2847
- case 21512:
2848
- return d.o ? 0 : -59;
2849
- case 21506:
2850
- case 21507:
2851
- case 21508:
2852
- if (!d.o) {
2853
- return -59;
2854
- }
2855
- if (d.o.T.Qb) {
2856
- for (e = fb(), a = [], f = 0; 32 > f; f++) {
2857
- a.push(y[e + f + 17]);
2858
- }
2859
- }
2860
- return 0;
2861
- case 21519:
2862
- if (!d.o) {
2863
- return -59;
2864
- }
2865
- e = fb();
2866
- return B[e >> 2] = 0;
2867
- case 21520:
2868
- return d.o ? -28 : -59;
2869
- case 21531:
2870
- e = fb();
2871
- if (!d.l.Ob) {
2872
- throw new M(59);
2873
- }
2874
- return d.l.Ob(d, b, e);
2875
- case 21523:
2876
- if (!d.o) {
2877
- return -59;
2878
- }
2879
- d.o.T.Rb && (f = [24, 80], e = fb(), Ea[e >> 1] = f[0], Ea[e + 2 >> 1] = f[1]);
2880
- return 0;
2881
- case 21524:
2882
- return d.o ? 0 : -59;
2883
- case 21515:
2884
- return d.o ? 0 : -59;
2885
- default:
2886
- return -28;
2887
- }
2888
- } catch (g) {
2889
- if ("undefined" == typeof oc || "ErrnoError" !== g.name) {
2890
- throw g;
2891
- }
2892
- return -g.Y;
2893
- }
2894
- }, __syscall_openat:function(a, b, c, d) {
2895
- gb = d;
2896
- try {
2897
- b = b ? pb(A, b) : "";
2898
- var e = b;
2899
- if ("/" === e.charAt(0)) {
2900
- b = e;
2901
- } else {
2902
- var f = -100 === a ? "/" : Wb(a).path;
2903
- if (0 == e.length) {
2904
- throw new M(44);
2905
- }
2906
- b = ib(f + "/" + e);
2907
- }
2908
- var g = d ? fb() : 0;
2909
- return ic(b, c, g).U;
2910
- } catch (h) {
2911
- if ("undefined" == typeof oc || "ErrnoError" !== h.name) {
2912
- throw h;
2913
- }
2914
- return -h.Y;
2915
- }
2916
- }, _abort_js:() => {
2917
- Sa("");
2918
- }, _embind_create_inheriting_constructor:(a, b, c) => {
2919
- a = R(a);
2920
- b = Fc(b, "wrapper");
2921
- c = P(c);
2922
- var d = b.h, e = d.K, f = d.B.K, g = d.B.constructor;
2923
- a = pc(a, function(...h) {
2924
- d.B.ib.forEach(function(n) {
2925
- if (this[n] === f[n]) {
2926
- throw new uc(`Pure virtual function ${n} must be implemented in JavaScript`);
2927
- }
2928
- }.bind(this));
2929
- Object.defineProperty(this, "__parent", {value:e});
2930
- this.__construct(...h);
2931
- });
2932
- e.__construct = function(...h) {
2933
- if (this === e) {
2934
- throw new O("Pass correct 'this' to __construct");
2935
- }
2936
- h = g.implement(this, ...h);
2937
- Gc(h);
2938
- var n = h.g;
2939
- h.notifyOnDestruction();
2940
- n.ea = !0;
2941
- Object.defineProperties(this, {g:{value:n}});
2942
- Mc(this);
2943
- h = n.m;
2944
- h = Ac(d, h);
2945
- if (zc.hasOwnProperty(h)) {
2946
- throw new O(`Tried to register registered instance: ${h}`);
2947
- }
2948
- zc[h] = this;
2949
- };
2950
- e.__destruct = function() {
2951
- if (this === e) {
2952
- throw new O("Pass correct 'this' to __destruct");
2953
- }
2954
- Gc(this);
2955
- var h = this.g.m;
2956
- h = Ac(d, h);
2957
- if (zc.hasOwnProperty(h)) {
2958
- delete zc[h];
2959
- } else {
2960
- throw new O(`Tried to unregister unregistered instance: ${h}`);
2961
- }
2962
- };
2963
- a.prototype = Object.create(e);
2964
- Object.assign(a.prototype, c);
2965
- return sc(a);
2966
- }, _embind_finalize_value_object:a => {
2967
- var b = Oc[a];
2968
- delete Oc[a];
2969
- var c = b.Ha, d = b.M, e = b.Xa, f = e.map(g => g.Mb).concat(e.map(g => g.bc));
2970
- T([a], f, g => {
2971
- var h = {};
2972
- e.forEach((n, m) => {
2973
- var r = g[m], w = n.Kb, x = n.Lb, l = g[m + e.length], t = n.ac, q = n.cc;
2974
- h[n.Gb] = {read:C => r.fromWireType(w(x, C)), write:(C, H) => {
2975
- var v = [];
2976
- t(q, C, l.toWireType(v, H));
2977
- Pc(v);
2978
- }};
2979
- });
2980
- return [{name:b.name, fromWireType:n => {
2981
- var m = {}, r;
2982
- for (r in h) {
2983
- m[r] = h[r].read(n);
2984
- }
2985
- d(n);
2986
- return m;
2987
- }, toWireType:(n, m) => {
2988
- for (var r in h) {
2989
- if (!(r in m)) {
2990
- throw new TypeError(`Missing field: "${r}"`);
2991
- }
2992
- }
2993
- var w = c();
2994
- for (r in h) {
2995
- h[r].write(w, m[r]);
2996
- }
2997
- null !== n && n.push(d, w);
2998
- return w;
2999
- }, argPackAdvance:8, readValueFromPointer:Qc, J:d,}];
3000
- });
3001
- }, _embind_register_bigint:() => {
3002
- }, _embind_register_bool:(a, b, c, d) => {
3003
- b = R(b);
3004
- Tc(a, {name:b, fromWireType:function(e) {
3005
- return !!e;
3006
- }, toWireType:function(e, f) {
3007
- return f ? c : d;
3008
- }, argPackAdvance:8, readValueFromPointer:function(e) {
3009
- return this.fromWireType(A[e]);
3010
- }, J:null,});
3011
- }, _embind_register_class:(a, b, c, d, e, f, g, h, n, m, r, w, x) => {
3012
- r = R(r);
3013
- f = V(e, f);
3014
- h &&= V(g, h);
3015
- m &&= V(n, m);
3016
- x = V(w, x);
3017
- var l = Zc(r);
3018
- Yc(l, function() {
3019
- od(`Cannot construct ${r} due to unbound types`, [d]);
3020
- });
3021
- T([a, b, c], d ? [d] : [], t => {
3022
- t = t[0];
3023
- if (d) {
3024
- var q = t.h;
3025
- var C = q.K;
3026
- } else {
3027
- C = Wc.prototype;
3028
- }
3029
- t = pc(r, function(...Q) {
3030
- if (Object.getPrototypeOf(this) !== H) {
3031
- throw new O("Use 'new' to construct " + r);
3032
- }
3033
- if (void 0 === v.X) {
3034
- throw new O(r + " has no accessible constructor");
3035
- }
3036
- var U = v.X[Q.length];
3037
- if (void 0 === U) {
3038
- throw new O(`Tried to invoke ctor of ${r} with invalid number of parameters (${Q.length}) - expected (${Object.keys(v.X).toString()}) parameters instead!`);
3039
- }
3040
- return U.apply(this, Q);
3041
- });
3042
- var H = Object.create(C, {constructor:{value:t},});
3043
- t.prototype = H;
3044
- var v = new $c(r, t, H, x, q, f, h, m);
3045
- if (v.B) {
3046
- var K;
3047
- (K = v.B).ka ?? (K.ka = []);
3048
- v.B.ka.push(v);
3049
- }
3050
- q = new fd(r, v, !0, !1, !1);
3051
- K = new fd(r + "*", v, !1, !1, !1);
3052
- C = new fd(r + " const*", v, !1, !0, !1);
3053
- Jc[a] = {pointerType:K, zb:C};
3054
- gd(l, t);
3055
- return [q, K, C];
3056
- });
3057
- }, _embind_register_class_class_function:(a, b, c, d, e, f, g) => {
3058
- var h = ud(c, d);
3059
- b = R(b);
3060
- b = vd(b);
3061
- f = V(e, f);
3062
- T([], [a], n => {
3063
- function m() {
3064
- od(`Cannot call ${r} due to unbound types`, h);
3065
- }
3066
- n = n[0];
3067
- var r = `${n.name}.${b}`;
3068
- b.startsWith("@@") && (b = Symbol[b.substring(2)]);
3069
- var w = n.h.constructor;
3070
- void 0 === w[b] ? (m.ba = c - 1, w[b] = m) : (Xc(w, b, r), w[b].v[c - 1] = m);
3071
- T([], h, x => {
3072
- x = td(r, [x[0], null].concat(x.slice(1)), null, f, g);
3073
- void 0 === w[b].v ? (x.ba = c - 1, w[b] = x) : w[b].v[c - 1] = x;
3074
- if (n.h.ka) {
3075
- for (const l of n.h.ka) {
3076
- l.constructor.hasOwnProperty(b) || (l.constructor[b] = x);
3077
- }
3078
- }
3079
- return [];
3080
- });
3081
- return [];
3082
- });
3083
- }, _embind_register_class_class_property:(a, b, c, d, e, f, g, h) => {
3084
- b = R(b);
3085
- f = V(e, f);
3086
- T([], [a], n => {
3087
- n = n[0];
3088
- var m = `${n.name}.${b}`, r = {get() {
3089
- od(`Cannot access ${m} due to unbound types`, [c]);
3090
- }, enumerable:!0, configurable:!0};
3091
- r.set = h ? () => {
3092
- od(`Cannot access ${m} due to unbound types`, [c]);
3093
- } : () => {
3094
- throw new O(`${m} is a read-only property`);
3095
- };
3096
- Object.defineProperty(n.h.constructor, b, r);
3097
- T([], [c], w => {
3098
- w = w[0];
3099
- var x = {get() {
3100
- return w.fromWireType(f(d));
3101
- }, enumerable:!0};
3102
- h && (h = V(g, h), x.set = l => {
3103
- var t = [];
3104
- h(d, w.toWireType(t, l));
3105
- Pc(t);
3106
- });
3107
- Object.defineProperty(n.h.constructor, b, x);
3108
- return [];
3109
- });
3110
- return [];
3111
- });
3112
- }, _embind_register_class_constructor:(a, b, c, d, e, f) => {
3113
- var g = ud(b, c);
3114
- e = V(d, e);
3115
- T([], [a], h => {
3116
- h = h[0];
3117
- var n = `constructor ${h.name}`;
3118
- void 0 === h.h.X && (h.h.X = []);
3119
- if (void 0 !== h.h.X[b - 1]) {
3120
- throw new O(`Cannot register multiple constructors with identical number of parameters (${b - 1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
3121
- }
3122
- h.h.X[b - 1] = () => {
3123
- od(`Cannot construct ${h.name} due to unbound types`, g);
3124
- };
3125
- T([], g, m => {
3126
- m.splice(1, 0, null);
3127
- h.h.X[b - 1] = td(n, m, null, e, f);
3128
- return [];
3129
- });
3130
- return [];
3131
- });
3132
- }, _embind_register_class_function:(a, b, c, d, e, f, g, h) => {
3133
- var n = ud(c, d);
3134
- b = R(b);
3135
- b = vd(b);
3136
- f = V(e, f);
3137
- T([], [a], m => {
3138
- function r() {
3139
- od(`Cannot call ${w} due to unbound types`, n);
3140
- }
3141
- m = m[0];
3142
- var w = `${m.name}.${b}`;
3143
- b.startsWith("@@") && (b = Symbol[b.substring(2)]);
3144
- h && m.h.ib.push(b);
3145
- var x = m.h.K, l = x[b];
3146
- void 0 === l || void 0 === l.v && l.className !== m.name && l.ba === c - 2 ? (r.ba = c - 2, r.className = m.name, x[b] = r) : (Xc(x, b, w), x[b].v[c - 2] = r);
3147
- T([], n, t => {
3148
- t = td(w, t, m, f, g);
3149
- void 0 === x[b].v ? (t.ba = c - 2, x[b] = t) : x[b].v[c - 2] = t;
3150
- return [];
3151
- });
3152
- return [];
3153
- });
3154
- }, _embind_register_class_property:(a, b, c, d, e, f, g, h, n, m) => {
3155
- b = R(b);
3156
- e = V(d, e);
3157
- T([], [a], r => {
3158
- r = r[0];
3159
- var w = `${r.name}.${b}`, x = {get() {
3160
- od(`Cannot access ${w} due to unbound types`, [c, g]);
3161
- }, enumerable:!0, configurable:!0};
3162
- x.set = n ? () => od(`Cannot access ${w} due to unbound types`, [c, g]) : () => {
3163
- throw new O(w + " is a read-only property");
3164
- };
3165
- Object.defineProperty(r.h.K, b, x);
3166
- T([], n ? [c, g] : [c], l => {
3167
- var t = l[0], q = {get() {
3168
- var H = wd(this, r, w + " getter");
3169
- return t.fromWireType(e(f, H));
3170
- }, enumerable:!0};
3171
- if (n) {
3172
- n = V(h, n);
3173
- var C = l[1];
3174
- q.set = function(H) {
3175
- var v = wd(this, r, w + " setter"), K = [];
3176
- n(m, v, C.toWireType(K, H));
3177
- Pc(K);
3178
- };
3179
- }
3180
- Object.defineProperty(r.h.K, b, q);
3181
- return [];
3182
- });
3183
- return [];
3184
- });
3185
- }, _embind_register_emval:a => Tc(a, yd), _embind_register_enum:(a, b, c, d) => {
3186
- function e() {
3187
- }
3188
- b = R(b);
3189
- e.values = {};
3190
- Tc(a, {name:b, constructor:e, fromWireType:function(f) {
3191
- return this.constructor.values[f];
3192
- }, toWireType:(f, g) => g.value, argPackAdvance:8, readValueFromPointer:zd(b, c, d), J:null,});
3193
- Yc(b, e);
3194
- }, _embind_register_enum_value:(a, b, c) => {
3195
- var d = Fc(a, "enum");
3196
- b = R(b);
3197
- a = d.constructor;
3198
- d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:pc(`${d.name}_${b}`, function() {
3199
- })},});
3200
- a.values[c] = d;
3201
- a[b] = d;
3202
- }, _embind_register_float:(a, b, c) => {
3203
- b = R(b);
3204
- Tc(a, {name:b, fromWireType:d => d, toWireType:(d, e) => e, argPackAdvance:8, readValueFromPointer:Ad(b, c), J:null,});
3205
- }, _embind_register_function:(a, b, c, d, e, f) => {
3206
- var g = ud(b, c);
3207
- a = R(a);
3208
- a = vd(a);
3209
- e = V(d, e);
3210
- Yc(a, function() {
3211
- od(`Cannot call ${a} due to unbound types`, g);
3212
- }, b - 1);
3213
- T([], g, h => {
3214
- gd(a, td(a, [h[0], null].concat(h.slice(1)), null, e, f), b - 1);
3215
- return [];
3216
- });
3217
- }, _embind_register_integer:(a, b, c, d, e) => {
3218
- b = R(b);
3219
- -1 === e && (e = 4294967295);
3220
- e = h => h;
3221
- if (0 === d) {
3222
- var f = 32 - 8 * c;
3223
- e = h => h << f >>> f;
3224
- }
3225
- var g = b.includes("unsigned") ? function(h, n) {
3226
- return n >>> 0;
3227
- } : function(h, n) {
3228
- return n;
3229
- };
3230
- Tc(a, {name:b, fromWireType:e, toWireType:g, argPackAdvance:8, readValueFromPointer:Bd(b, c, 0 !== d), J:null,});
3231
- }, _embind_register_memory_view:(a, b, c) => {
3232
- function d(f) {
3233
- return new e(y.buffer, E[f + 4 >> 2], E[f >> 2]);
3234
- }
3235
- var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][b];
3236
- c = R(c);
3237
- Tc(a, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Nb:!0,});
3238
- }, _embind_register_std_string:(a, b) => {
3239
- b = R(b);
3240
- var c = "std::string" === b;
3241
- Tc(a, {name:b, fromWireType:function(d) {
3242
- var e = E[d >> 2], f = d + 4;
3243
- if (c) {
3244
- for (var g = f, h = 0; h <= e; ++h) {
3245
- var n = f + h;
3246
- if (h == e || 0 == A[n]) {
3247
- g = g ? pb(A, g, n - g) : "";
3248
- if (void 0 === m) {
3249
- var m = g;
3250
- } else {
3251
- m += String.fromCharCode(0), m += g;
3252
- }
3253
- g = n + 1;
3254
- }
3255
- }
3256
- } else {
3257
- m = Array(e);
3258
- for (h = 0; h < e; ++h) {
3259
- m[h] = String.fromCharCode(A[f + h]);
3260
- }
3261
- m = m.join("");
3262
- }
3263
- Dc(d);
3264
- return m;
3265
- }, toWireType:function(d, e) {
3266
- e instanceof ArrayBuffer && (e = new Uint8Array(e));
3267
- var f = "string" == typeof e;
3268
- if (!(f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array)) {
3269
- throw new O("Cannot pass non-string to std::string");
3270
- }
3271
- var g = c && f ? rb(e) : e.length;
3272
- var h = be(4 + g + 1), n = h + 4;
3273
- E[h >> 2] = g;
3274
- if (c && f) {
3275
- tb(e, A, n, g + 1);
3276
- } else {
3277
- if (f) {
3278
- for (f = 0; f < g; ++f) {
3279
- var m = e.charCodeAt(f);
3280
- if (255 < m) {
3281
- throw Dc(n), new O("String has UTF-16 code units that do not fit in 8 bits");
3282
- }
3283
- A[n + f] = m;
3284
- }
3285
- } else {
3286
- for (f = 0; f < g; ++f) {
3287
- A[n + f] = e[f];
3288
- }
3289
- }
3290
- }
3291
- null !== d && d.push(Dc, h);
3292
- return h;
3293
- }, argPackAdvance:8, readValueFromPointer:Qc, J(d) {
3294
- Dc(d);
3295
- },});
3296
- }, _embind_register_std_wstring:(a, b, c) => {
3297
- c = R(c);
3298
- if (2 === b) {
3299
- var d = Dd;
3300
- var e = Ed;
3301
- var f = Fd;
3302
- var g = h => Ha[h >> 1];
3303
- } else {
3304
- 4 === b && (d = Gd, e = Hd, f = Id, g = h => E[h >> 2]);
3305
- }
3306
- Tc(a, {name:c, fromWireType:h => {
3307
- for (var n = E[h >> 2], m, r = h + 4, w = 0; w <= n; ++w) {
3308
- var x = h + 4 + w * b;
3309
- if (w == n || 0 == g(x)) {
3310
- r = d(r, x - r), void 0 === m ? m = r : (m += String.fromCharCode(0), m += r), r = x + b;
3311
- }
3312
- }
3313
- Dc(h);
3314
- return m;
3315
- }, toWireType:(h, n) => {
3316
- if ("string" != typeof n) {
3317
- throw new O(`Cannot pass non-string to C++ string type ${c}`);
3318
- }
3319
- var m = f(n), r = be(4 + m + b);
3320
- E[r >> 2] = m / b;
3321
- e(n, r + 4, m + b);
3322
- null !== h && h.push(Dc, r);
3323
- return r;
3324
- }, argPackAdvance:8, readValueFromPointer:Qc, J(h) {
3325
- Dc(h);
3326
- }});
3327
- }, _embind_register_value_object:(a, b, c, d, e, f) => {
3328
- Oc[a] = {name:R(b), Ha:V(c, d), M:V(e, f), Xa:[],};
3329
- }, _embind_register_value_object_field:(a, b, c, d, e, f, g, h, n, m) => {
3330
- Oc[a].Xa.push({Gb:R(b), Mb:c, Kb:V(d, e), Lb:f, bc:g, ac:V(h, n), cc:m,});
3331
- }, _embind_register_void:(a, b) => {
3332
- b = R(b);
3333
- Tc(a, {Dc:!0, name:b, argPackAdvance:0, fromWireType:() => {
3334
- }, toWireType:() => {
3335
- },});
3336
- }, _emscripten_get_now_is_monotonic:() => 1, _emscripten_memcpy_js:(a, b, c) => A.copyWithin(a, b, b + c), _emscripten_throw_longjmp:() => {
3337
- throw Infinity;
3338
- }, _emval_as:(a, b, c) => {
3339
- a = P(a);
3340
- b = Fc(b, "emval::as");
3341
- return Jd(b, c, a);
3342
- }, _emval_call:(a, b, c, d) => {
3343
- a = Kd[a];
3344
- b = P(b);
3345
- return a(null, b, c, d);
3346
- }, _emval_call_method:(a, b, c, d, e) => {
3347
- a = Kd[a];
3348
- b = P(b);
3349
- c = Md(c);
3350
- return a(b, b[c], d, e);
3351
- }, _emval_decref:xd, _emval_get_method_caller:(a, b, c) => {
3352
- var d = Od(a, b), e = d.shift();
3353
- a--;
3354
- var f = Array(a);
3355
- b = `methodCaller<(${d.map(g => g.name).join(", ")}) => ${e.name}>`;
3356
- return Nd(pc(b, (g, h, n, m) => {
3357
- for (var r = 0, w = 0; w < a; ++w) {
3358
- f[w] = d[w].readValueFromPointer(m + r), r += d[w].argPackAdvance;
3359
- }
3360
- g = 1 === c ? Pd(h, f) : h.apply(g, f);
3361
- return Jd(e, n, g);
3362
- }));
3363
- }, _emval_get_module_property:a => {
3364
- a = Md(a);
3365
- return sc(k[a]);
3366
- }, _emval_get_property:(a, b) => {
3367
- a = P(a);
3368
- b = P(b);
3369
- return sc(a[b]);
3370
- }, _emval_incref:a => {
3371
- 9 < a && (rc[a + 1] += 1);
3372
- }, _emval_new_array:() => sc([]), _emval_new_cstring:a => sc(Md(a)), _emval_new_object:() => sc({}), _emval_run_destructors:a => {
3373
- var b = P(a);
3374
- Pc(b);
3375
- xd(a);
3376
- }, _emval_set_property:(a, b, c) => {
3377
- a = P(a);
3378
- b = P(b);
3379
- c = P(c);
3380
- a[b] = c;
3381
- }, _emval_take_value:(a, b) => {
3382
- a = Fc(a, "_emval_take_value");
3383
- a = a.readValueFromPointer(b);
3384
- return sc(a);
3385
- }, _gmtime_js:function(a, b, c) {
3386
- a = new Date(1000 * (b + 2097152 >>> 0 < 4194305 - !!a ? (a >>> 0) + 4294967296 * b : NaN));
3387
- B[c >> 2] = a.getUTCSeconds();
3388
- B[c + 4 >> 2] = a.getUTCMinutes();
3389
- B[c + 8 >> 2] = a.getUTCHours();
3390
- B[c + 12 >> 2] = a.getUTCDate();
3391
- B[c + 16 >> 2] = a.getUTCMonth();
3392
- B[c + 20 >> 2] = a.getUTCFullYear() - 1900;
3393
- B[c + 24 >> 2] = a.getUTCDay();
3394
- B[c + 28 >> 2] = (a.getTime() - Date.UTC(a.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864E5 | 0;
3395
- }, _localtime_js:function(a, b, c) {
3396
- a = new Date(1000 * (b + 2097152 >>> 0 < 4194305 - !!a ? (a >>> 0) + 4294967296 * b : NaN));
3397
- B[c >> 2] = a.getSeconds();
3398
- B[c + 4 >> 2] = a.getMinutes();
3399
- B[c + 8 >> 2] = a.getHours();
3400
- B[c + 12 >> 2] = a.getDate();
3401
- B[c + 16 >> 2] = a.getMonth();
3402
- B[c + 20 >> 2] = a.getFullYear() - 1900;
3403
- B[c + 24 >> 2] = a.getDay();
3404
- B[c + 28 >> 2] = (Qd(a.getFullYear()) ? Rd : Sd)[a.getMonth()] + a.getDate() - 1 | 0;
3405
- B[c + 36 >> 2] = -(60 * a.getTimezoneOffset());
3406
- b = (new Date(a.getFullYear(), 6, 1)).getTimezoneOffset();
3407
- var d = (new Date(a.getFullYear(), 0, 1)).getTimezoneOffset();
3408
- B[c + 32 >> 2] = (b != d && a.getTimezoneOffset() == Math.min(d, b)) | 0;
3409
- }, _tzset_js:(a, b, c, d) => {
3410
- var e = (new Date()).getFullYear(), f = new Date(e, 0, 1), g = new Date(e, 6, 1);
3411
- e = f.getTimezoneOffset();
3412
- var h = g.getTimezoneOffset();
3413
- E[a >> 2] = 60 * Math.max(e, h);
3414
- B[b >> 2] = Number(e != h);
3415
- a = n => n.toLocaleTimeString(void 0, {hour12:!1, timeZoneName:"short"}).split(" ")[1];
3416
- f = a(f);
3417
- g = a(g);
3418
- h < e ? (tb(f, A, c, 17), tb(g, A, d, 17)) : (tb(f, A, d, 17), tb(g, A, c, 17));
3419
- }, emscripten_asm_const_int:(a, b, c) => {
3420
- Td.length = 0;
3421
- for (var d; d = A[b++];) {
3422
- var e = 105 != d;
3423
- e &= 112 != d;
3424
- c += e && c % 8 ? 4 : 0;
3425
- Td.push(112 == d ? E[c >> 2] : 105 == d ? B[c >> 2] : Ja[c >> 3]);
3426
- c += e ? 8 : 4;
3427
- }
3428
- return db[a](...Td);
3429
- }, emscripten_date_now:() => Date.now(), emscripten_get_now:() => performance.now(), emscripten_resize_heap:a => {
3430
- var b = A.length;
3431
- a >>>= 0;
3432
- if (2147483648 < a) {
3433
- return !1;
3434
- }
3435
- for (var c = 1; 4 >= c; c *= 2) {
3436
- var d = b * (1 + 0.2 / c);
3437
- d = Math.min(d, a + 100663296);
3438
- var e = Math;
3439
- d = Math.max(a, d);
3440
- a: {
3441
- e = (e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) - Ca.buffer.byteLength + 65535) / 65536;
3442
- try {
3443
- Ca.grow(e);
3444
- Ka();
3445
- var f = 1;
3446
- break a;
3447
- } catch (g) {
3448
- }
3449
- f = void 0;
3450
- }
3451
- if (f) {
3452
- return !0;
3453
- }
3454
- }
3455
- return !1;
3456
- }, environ_get:(a, b) => {
3457
- var c = 0;
3458
- Wd().forEach((d, e) => {
3459
- var f = b + c;
3460
- e = E[a + 4 * e >> 2] = f;
3461
- for (f = 0; f < d.length; ++f) {
3462
- y[e++] = d.charCodeAt(f);
3463
- }
3464
- y[e] = 0;
3465
- c += d.length + 1;
3466
- });
3467
- return 0;
3468
- }, environ_sizes_get:(a, b) => {
3469
- var c = Wd();
3470
- E[a >> 2] = c.length;
3471
- var d = 0;
3472
- c.forEach(e => d += e.length + 1);
3473
- E[b >> 2] = d;
3474
- return 0;
3475
- }, fd_close:function(a) {
3476
- try {
3477
- var b = Wb(a);
3478
- if (null === b.U) {
3479
- throw new M(8);
3480
- }
3481
- b.Ea && (b.Ea = null);
3482
- try {
3483
- b.l.close && b.l.close(b);
3484
- } catch (c) {
3485
- throw c;
3486
- } finally {
3487
- Jb[b.U] = null;
3488
- }
3489
- b.U = null;
3490
- return 0;
3491
- } catch (c) {
3492
- if ("undefined" == typeof oc || "ErrnoError" !== c.name) {
3493
- throw c;
3494
- }
3495
- return c.Y;
3496
- }
3497
- }, fd_read:function(a, b, c, d) {
3498
- try {
3499
- a: {
3500
- var e = Wb(a);
3501
- a = b;
3502
- for (var f, g = b = 0; g < c; g++) {
3503
- var h = E[a >> 2], n = E[a + 4 >> 2];
3504
- a += 8;
3505
- var m = e, r = f, w = y;
3506
- if (0 > n || 0 > r) {
3507
- throw new M(28);
3508
- }
3509
- if (null === m.U) {
3510
- throw new M(8);
3511
- }
3512
- if (1 === (m.flags & 2097155)) {
3513
- throw new M(8);
3514
- }
3515
- if (16384 === (m.node.mode & 61440)) {
3516
- throw new M(31);
3517
- }
3518
- if (!m.l.read) {
3519
- throw new M(28);
3520
- }
3521
- var x = "undefined" != typeof r;
3522
- if (!x) {
3523
- r = m.position;
3524
- } else if (!m.seekable) {
3525
- throw new M(70);
3526
- }
3527
- var l = m.l.read(m, w, h, n, r);
3528
- x || (m.position += l);
3529
- var t = l;
3530
- if (0 > t) {
3531
- var q = -1;
3532
- break a;
3533
- }
3534
- b += t;
3535
- if (t < n) {
3536
- break;
3537
- }
3538
- "undefined" != typeof f && (f += t);
3539
- }
3540
- q = b;
3541
- }
3542
- E[d >> 2] = q;
3543
- return 0;
3544
- } catch (C) {
3545
- if ("undefined" == typeof oc || "ErrnoError" !== C.name) {
3546
- throw C;
3547
- }
3548
- return C.Y;
3549
- }
3550
- }, fd_seek:function(a, b, c, d, e) {
3551
- b = c + 2097152 >>> 0 < 4194305 - !!b ? (b >>> 0) + 4294967296 * c : NaN;
3552
- try {
3553
- if (isNaN(b)) {
3554
- return 61;
3555
- }
3556
- var f = Wb(a);
3557
- kc(f, b, d);
3558
- $a = [f.position >>> 0, (Za = f.position, 1.0 <= +Math.abs(Za) ? 0.0 < Za ? +Math.floor(Za / 4294967296.0) >>> 0 : ~~+Math.ceil((Za - +(~~Za >>> 0)) / 4294967296.0) >>> 0 : 0)];
3559
- B[e >> 2] = $a[0];
3560
- B[e + 4 >> 2] = $a[1];
3561
- f.Ea && 0 === b && 0 === d && (f.Ea = null);
3562
- return 0;
3563
- } catch (g) {
3564
- if ("undefined" == typeof oc || "ErrnoError" !== g.name) {
3565
- throw g;
3566
- }
3567
- return g.Y;
3568
- }
3569
- }, fd_write:function(a, b, c, d) {
3570
- try {
3571
- a: {
3572
- var e = Wb(a);
3573
- a = b;
3574
- for (var f, g = b = 0; g < c; g++) {
3575
- var h = E[a >> 2], n = E[a + 4 >> 2];
3576
- a += 8;
3577
- var m = e, r = h, w = n, x = f, l = y;
3578
- if (0 > w || 0 > x) {
3579
- throw new M(28);
3580
- }
3581
- if (null === m.U) {
3582
- throw new M(8);
3583
- }
3584
- if (0 === (m.flags & 2097155)) {
3585
- throw new M(8);
3586
- }
3587
- if (16384 === (m.node.mode & 61440)) {
3588
- throw new M(31);
3589
- }
3590
- if (!m.l.write) {
3591
- throw new M(28);
3592
- }
3593
- m.seekable && m.flags & 1024 && kc(m, 0, 2);
3594
- var t = "undefined" != typeof x;
3595
- if (!t) {
3596
- x = m.position;
3597
- } else if (!m.seekable) {
3598
- throw new M(70);
3599
- }
3600
- var q = m.l.write(m, l, r, w, x, void 0);
3601
- t || (m.position += q);
3602
- var C = q;
3603
- if (0 > C) {
3604
- var H = -1;
3605
- break a;
3606
- }
3607
- b += C;
3608
- "undefined" != typeof f && (f += C);
3609
- }
3610
- H = b;
3611
- }
3612
- E[d >> 2] = H;
3613
- return 0;
3614
- } catch (v) {
3615
- if ("undefined" == typeof oc || "ErrnoError" !== v.name) {
3616
- throw v;
3617
- }
3618
- return v.Y;
3619
- }
3620
- }, invoke_vii:ce, isWindowsBrowser:function() {
3621
- return -1 < navigator.platform.indexOf("Win");
3622
- }, strftime:Zd, strftime_l:(a, b, c, d) => Zd(a, b, c, d), wasm_start_image_decode:function(a, b, c) {
3623
- b = k.HEAP8.subarray(b, b + c);
3624
- c = new Uint8Array(c);
3625
- c.set(b);
3626
- createImageBitmap(new Blob([c])).then(function(d) {
3627
- var e = (new OffscreenCanvas(d.width, d.height)).getContext("2d");
3628
- e.drawImage(d, 0, 0);
3629
- e = e.getImageData(0, 0, d.width, d.height);
3630
- var f = e.data.length, g = k.vb(f);
3631
- k.lc.set(e.data, g);
3632
- k.nc(a, d.width, d.height, g, f);
3633
- }).catch(function(d) {
3634
- d = d.message || "decode failed";
3635
- var e = k.Ec(d) + 1, f = k.vb(e);
3636
- k.Jc(d, f, e);
3637
- k.oc(a, f);
3638
- k.mc(f);
3639
- });
3640
- }}, Y = function() {
3641
- function a(c) {
3642
- Y = c.exports;
3643
- Ca = Y.memory;
3644
- Ka();
3645
- jd = Y.__indirect_function_table;
3646
- Ma.unshift(Y.__wasm_call_ctors);
3647
- Pa--;
3648
- k.monitorRunDependencies?.(Pa);
3649
- 0 == Pa && (null !== Qa && (clearInterval(Qa), Qa = null), Ra && (c = Ra, Ra = null, c()));
3650
- return Y;
3651
- }
3652
- var b = {env:de, wasi_snapshot_preview1:de,};
3653
- Pa++;
3654
- k.monitorRunDependencies?.(Pa);
3655
- if (k.instantiateWasm) {
3656
- try {
3657
- return k.instantiateWasm(b, a);
3658
- } catch (c) {
3659
- Aa(`Module.instantiateWasm callback failed with error: ${c}`), ca(c);
3660
- }
3661
- }
3662
- Ua ||= Ta("canvas_advanced.wasm") ? "canvas_advanced.wasm" : k.locateFile ? k.locateFile("canvas_advanced.wasm", ta) : ta + "canvas_advanced.wasm";
3663
- Ya(b, function(c) {
3664
- a(c.instance);
3665
- }).catch(ca);
3666
- return {};
3667
- }(), Dc = a => (Dc = Y.free)(a), be = a => (be = Y.malloc)(a), Cc = a => (Cc = Y.__getTypeName)(a);
3668
- k._wasm_image_decode_complete = (a, b, c, d, e) => (k._wasm_image_decode_complete = Y.wasm_image_decode_complete)(a, b, c, d, e);
3669
- k._wasm_image_decode_error = (a, b) => (k._wasm_image_decode_error = Y.wasm_image_decode_error)(a, b);
3670
- var ab = k._ma_device__on_notification_unlocked = a => (ab = k._ma_device__on_notification_unlocked = Y.ma_device__on_notification_unlocked)(a);
3671
- k._ma_malloc_emscripten = (a, b) => (k._ma_malloc_emscripten = Y.ma_malloc_emscripten)(a, b);
3672
- k._ma_free_emscripten = (a, b) => (k._ma_free_emscripten = Y.ma_free_emscripten)(a, b);
3673
- var bb = k._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (bb = k._ma_device_process_pcm_frames_capture__webaudio = Y.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), cb = k._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (cb = k._ma_device_process_pcm_frames_playback__webaudio = Y.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), ee = (a, b) => (ee = Y.setThrew)(a, b), fe = a => (fe = Y._emscripten_stack_restore)(a), ge = () => (ge = Y.emscripten_stack_get_current)();
3674
- k.dynCall_iiji = (a, b, c, d, e) => (k.dynCall_iiji = Y.dynCall_iiji)(a, b, c, d, e);
3675
- k.dynCall_jiji = (a, b, c, d, e) => (k.dynCall_jiji = Y.dynCall_jiji)(a, b, c, d, e);
3676
- k.dynCall_iiiji = (a, b, c, d, e, f) => (k.dynCall_iiiji = Y.dynCall_iiiji)(a, b, c, d, e, f);
3677
- k.dynCall_iij = (a, b, c, d) => (k.dynCall_iij = Y.dynCall_iij)(a, b, c, d);
3678
- k.dynCall_jii = (a, b, c) => (k.dynCall_jii = Y.dynCall_jii)(a, b, c);
3679
- k.dynCall_viijii = (a, b, c, d, e, f, g) => (k.dynCall_viijii = Y.dynCall_viijii)(a, b, c, d, e, f, g);
3680
- k.dynCall_iiiiij = (a, b, c, d, e, f, g) => (k.dynCall_iiiiij = Y.dynCall_iiiiij)(a, b, c, d, e, f, g);
3681
- k.dynCall_iiiiijj = (a, b, c, d, e, f, g, h, n) => (k.dynCall_iiiiijj = Y.dynCall_iiiiijj)(a, b, c, d, e, f, g, h, n);
3682
- k.dynCall_iiiiiijj = (a, b, c, d, e, f, g, h, n, m) => (k.dynCall_iiiiiijj = Y.dynCall_iiiiiijj)(a, b, c, d, e, f, g, h, n, m);
3683
- function ce(a, b, c) {
3684
- var d = ge();
3685
- try {
3686
- kd(a)(b, c);
3687
- } catch (e) {
3688
- fe(d);
3689
- if (e !== e + 0) {
3690
- throw e;
3691
- }
3692
- ee(1, 0);
3693
- }
3694
- }
3695
- var he;
3696
- Ra = function ie() {
3697
- he || je();
3698
- he || (Ra = ie);
3699
- };
3700
- function je() {
3701
- function a() {
3702
- if (!he && (he = !0, k.calledRun = !0, !Da)) {
3703
- k.noFSInit || lc || (lc = !0, k.stdin = k.stdin, k.stdout = k.stdout, k.stderr = k.stderr, k.stdin ? mc("stdin", k.stdin) : hc("/dev/tty", "/dev/stdin"), k.stdout ? mc("stdout", null, k.stdout) : hc("/dev/tty", "/dev/stdout"), k.stderr ? mc("stderr", null, k.stderr) : hc("/dev/tty1", "/dev/stderr"), ic("/dev/stdin", 0), ic("/dev/stdout", 1), ic("/dev/stderr", 1));
3704
- Mb = !1;
3705
- eb(Ma);
3706
- ba(k);
3707
- if (k.onRuntimeInitialized) {
3708
- k.onRuntimeInitialized();
3709
- }
3710
- if (k.postRun) {
3711
- for ("function" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length;) {
3712
- var b = k.postRun.shift();
3713
- Na.unshift(b);
3714
- }
3715
- }
3716
- eb(Na);
3717
- }
3718
- }
3719
- if (!(0 < Pa)) {
3720
- if (k.preRun) {
3721
- for ("function" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length;) {
3722
- Oa();
3723
- }
3724
- }
3725
- eb(La);
3726
- 0 < Pa || (k.setStatus ? (k.setStatus("Running..."), setTimeout(function() {
3727
- setTimeout(function() {
3728
- k.setStatus("");
3729
- }, 1);
3730
- a();
3731
- }, 1)) : a());
3732
- }
3733
- }
3734
- if (k.preInit) {
3735
- for ("function" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length;) {
3736
- k.preInit.pop()();
3737
- }
3738
- }
3739
- je();
3740
- moduleRtn = da;
3741
-
3742
-
3743
-
3744
- return moduleRtn;
3745
- }
3746
- );
3747
- })();
352
+ var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var k=moduleArg,ca=!!globalThis.window,da=!!globalThis.WorkerGlobalScope;
353
+ function ea(){function a(g){const h=d;c=b=0;d=new Map;h.forEach(m=>{try{m(g)}catch(l){console.error(l)}});this.mc();e&&e.Oc()}let b=0,c=0,d=new Map,e=null,f=null;this.requestAnimationFrame=function(g){b||=requestAnimationFrame(a.bind(this));const h=++c;d.set(h,g);return h};this.cancelAnimationFrame=function(g){d.delete(g);b&&0==d.size&&(cancelAnimationFrame(b),b=0)};this.Mc=function(g){f&&(document.body.remove(f),f=null);g||(f=document.createElement("div"),f.style.backgroundColor="black",f.style.position=
354
+ "fixed",f.style.right=0,f.style.top=0,f.style.color="white",f.style.padding="4px",f.innerHTML="RIVE FPS",g=function(h){f.innerHTML="RIVE FPS "+h.toFixed(1)},document.body.appendChild(f));e=new function(){let h=0,m=0;this.Oc=function(){var l=performance.now();m?(++h,l-=m,1E3<l&&(g(1E3*h/l),h=m=0)):(m=l,h=0)}}};this.Jc=function(){f&&(document.body.remove(f),f=null);e=null};this.mc=function(){}}
355
+ function fa(a){console.assert(!0);const b=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<a)-1)>>a;b.has(d)&&clearTimeout(b.get(d));b.set(d,setTimeout(function(){b.delete(d);0==b.length?c=-Infinity:d==c&&(c=Math.max(...b.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<a}}const ha=k.onRuntimeInitialized;
356
+ k.onRuntimeInitialized=function(){ha&&ha();let a=k.decodeAudio;k.decodeAudio=function(f,g){f=a(f);g(f)};let b=k.decodeFont;k.decodeFont=function(f,g){f=b(f);g(f)};let c=k.setFallbackFontCb;k.setFallbackFontCallback="function"===typeof c?function(f){c(f)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const d=k.FileAssetLoader;k.ptrToAsset=f=>{let g=k.ptrToFileAsset(f);return g.isImage?k.ptrToImageAsset(f):g.isFont?k.ptrToFontAsset(f):
357
+ g.isAudio?k.ptrToAudioAsset(f):g};k.CustomFileAssetLoader=d.extend("CustomFileAssetLoader",{__construct:function({loadContents:f}){this.__parent.__construct.call(this);this.Bc=f},loadContents:function(f,g){f=k.ptrToAsset(f);return this.Bc(f,g)}});k.CDNFileAssetLoader=d.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(f){let g=k.ptrToAsset(f);f=g.cdnUuid;if(""===f)return!1;(function(h,m){var l=new XMLHttpRequest;l.responseType="arraybuffer";
358
+ l.onreadystatechange=function(){4==l.readyState&&200==l.status&&m(l)};l.open("GET",h,!0);l.send(null)})(g.cdnBaseUrl+"/"+f,h=>{g.decode(new Uint8Array(h.response))});return!0}});k.FallbackFileAssetLoader=d.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);this.hc=[]},addLoader:function(f){this.hc.push(f)},loadContents:function(f,g){for(let h of this.hc)if(h.loadContents(f,g))return!0;return!1}});let e=k.computeAlignment;k.computeAlignment=function(f,g,h,
359
+ m,l=1){return e.call(this,f,g,h,m,l)}};
360
+ const ia="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),ja=new function(){function a(){if(!b){var w=document.createElement("canvas"),x={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,
361
+ renderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=w.getContext("webgl",x),c=1,!p)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(p=w.getContext("webgl2",x))c=2;else if(p=w.getContext("webgl",x))c=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;p=new Proxy(p,{get(F,q){if(F.isContextLost()){if(m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",q),m=!0),
362
+ "function"===typeof F[q])return function(){}}else return"function"===typeof F[q]?function(...K){return F[q].apply(F,K)}:F[q]},set(F,q,K){if(F.isContextLost())m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+q),m=!0);else return F[q]=K,!0}});d=Math.min(p.getParameter(p.MAX_RENDERBUFFER_SIZE),p.getParameter(p.MAX_TEXTURE_SIZE));function H(F,q,K){q=p.createShader(q);p.shaderSource(q,K);p.compileShader(q);K=p.getShaderInfoLog(q);if(0<(K||"").length)throw K;
363
+ p.attachShader(F,q)}w=p.createProgram();H(w,p.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }");H(w,p.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }");
364
+ p.bindAttribLocation(w,0,"vertex");p.bindAttribLocation(w,1,"uv");p.linkProgram(w);x=p.getProgramInfoLog(w);if(0<(x||"").trim().length)throw x;e=p.getUniformLocation(w,"mat");f=p.getUniformLocation(w,"translate");p.useProgram(w);p.bindBuffer(p.ARRAY_BUFFER,p.createBuffer());p.enableVertexAttribArray(0);p.enableVertexAttribArray(1);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,p.createBuffer());p.uniform1i(p.getUniformLocation(w,"image"),0);p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);b=p}return!0}let b=
365
+ null,c=0,d=0,e=null,f=null,g=0,h=0,m=!1;a();this.ad=function(){a();return d};this.Ic=function(w){b.deleteTexture&&b.deleteTexture(w)};this.Hc=function(w){if(!a())return null;const x=b.createTexture();if(!x)return null;b.bindTexture(b.TEXTURE_2D,x);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,w);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);2==c?(b.texParameteri(b.TEXTURE_2D,
366
+ b.TEXTURE_MIN_FILTER,b.LINEAR_MIPMAP_LINEAR),b.generateMipmap(b.TEXTURE_2D)):b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);return x};const l=new fa(8),u=new fa(8),y=new fa(10),t=new fa(10);this.Lc=function(w,x,p,H,F){if(a()){var q=l.push(w),K=u.push(x);if(b.canvas){if(b.canvas.width!=q||b.canvas.height!=K)b.canvas.width=q,b.canvas.height=K;b.viewport(0,K-x,w,x);b.disable(b.SCISSOR_TEST);b.clearColor(0,0,0,0);b.clear(b.COLOR_BUFFER_BIT);b.enable(b.SCISSOR_TEST);p.sort((I,Z)=>Z.tc-I.tc);
367
+ q=y.push(H);g!=q&&(b.bufferData(b.ARRAY_BUFFER,8*q,b.DYNAMIC_DRAW),g=q);q=0;for(var O of p)b.bufferSubData(b.ARRAY_BUFFER,q,O.Tb),q+=4*O.Tb.length;console.assert(q==4*H);for(var S of p)b.bufferSubData(b.ARRAY_BUFFER,q,S.xc),q+=4*S.xc.length;console.assert(q==8*H);q=t.push(F);h!=q&&(b.bufferData(b.ELEMENT_ARRAY_BUFFER,2*q,b.DYNAMIC_DRAW),h=q);O=0;for(var na of p)b.bufferSubData(b.ELEMENT_ARRAY_BUFFER,O,na.indices),O+=2*na.indices.length;console.assert(O==2*F);na=0;S=!0;q=O=0;for(const I of p){I.image.Ib!=
368
+ na&&(b.bindTexture(b.TEXTURE_2D,I.image.Hb||null),na=I.image.Ib);I.ed?(b.scissor(I.Yb,K-I.Zb-I.fc,I.od,I.fc),S=!0):S&&(b.scissor(0,K-x,w,x),S=!1);p=2/w;const Z=-2/x;b.uniform4f(e,I.ib[0]*p*I.Ab,I.ib[1]*Z*I.Bb,I.ib[2]*p*I.Ab,I.ib[3]*Z*I.Bb);b.uniform2f(f,I.ib[4]*p*I.Ab+p*(I.Yb-I.bd*I.Ab)-1,I.ib[5]*Z*I.Bb+Z*(I.Zb-I.cd*I.Bb)+1);b.vertexAttribPointer(0,2,b.FLOAT,!1,0,q);b.vertexAttribPointer(1,2,b.FLOAT,!1,0,q+4*H);b.drawElements(b.TRIANGLES,I.indices.length,b.UNSIGNED_SHORT,O);q+=4*I.Tb.length;O+=2*
369
+ I.indices.length}console.assert(q==4*H);console.assert(O==2*F)}}};this.canvas=function(){return a()&&b.canvas}},ka=k.onRuntimeInitialized;
370
+ k.onRuntimeInitialized=function(){function a(n){switch(n){case l.srcOver:return"source-over";case l.screen:return"screen";case l.overlay:return"overlay";case l.darken:return"darken";case l.lighten:return"lighten";case l.colorDodge:return"color-dodge";case l.colorBurn:return"color-burn";case l.hardLight:return"hard-light";case l.softLight:return"soft-light";case l.difference:return"difference";case l.exclusion:return"exclusion";case l.multiply:return"multiply";case l.hue:return"hue";case l.saturation:return"saturation";
371
+ case l.color:return"color";case l.luminosity:return"luminosity"}}function b(n){return"rgba("+((16711680&n)>>>16)+","+((65280&n)>>>8)+","+((255&n)>>>0)+","+((4278190080&n)>>>24)/255+")"}function c(){0<K.length&&(ja.Lc(q.drawWidth(),q.drawHeight(),K,O,S),K=[],S=O=0,q.reset(512,512));for(const n of F){for(const r of n.Na)r();n.Na=[]}F.clear()}ka&&ka();var d=k.RenderPaintStyle;const e=k.RenderPath,f=k.RenderPaint,g=k.Renderer,h=k.StrokeCap,m=k.StrokeJoin,l=k.BlendMode,u=d.fill,y=d.stroke,t=k.FillRule.evenOdd;
372
+ let w=1;var x=k.RenderImage.extend("CanvasRenderImage",{__construct:function({ob:n,yb:r}={}){this.__parent.__construct.call(this);this.Ib=w;w=w+1&2147483647||1;this.ob=n;this.yb=r},__destruct:function(){this.Hb&&(ja.Ic(this.Hb),URL.revokeObjectURL(this.Wb));this.__parent.__destruct.call(this)},decode:function(n){var r=this;r.yb&&r.yb(r);var G=new Image;r.Wb=URL.createObjectURL(new Blob([n],{type:"image/png"}));G.onload=function(){r.Ac=G;r.Hb=ja.Hc(G);r.size(G.width,G.height);r.ob&&r.ob(r)};G.src=
373
+ r.Wb}}),p=e.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this);this.Ya=new Path2D},rewind:function(){this.Ya=new Path2D},addPath:function(n,r,G,D,z,E,C){var L=this.Ya,ua=L.addPath;n=n.Ya;const R=new DOMMatrix;R.a=r;R.b=G;R.c=D;R.d=z;R.e=E;R.f=C;ua.call(L,n,R)},fillRule:function(n){this.Vb=n},moveTo:function(n,r){this.Ya.moveTo(n,r)},lineTo:function(n,r){this.Ya.lineTo(n,r)},cubicTo:function(n,r,G,D,z,E){this.Ya.bezierCurveTo(n,r,G,D,z,E)},close:function(){this.Ya.closePath()}}),
374
+ H=f.extend("CanvasRenderPaint",{color:function(n){this.Xb=b(n)},thickness:function(n){this.Ec=n},join:function(n){switch(n){case m.miter:this.Gb="miter";break;case m.round:this.Gb="round";break;case m.bevel:this.Gb="bevel"}},cap:function(n){switch(n){case h.butt:this.Fb="butt";break;case h.round:this.Fb="round";break;case h.square:this.Fb="square"}},style:function(n){this.Dc=n},blendMode:function(n){this.zc=a(n)},clearGradient:function(){this.lb=null},linearGradient:function(n,r,G,D){this.lb={uc:n,
375
+ vc:r,bc:G,cc:D,Sb:[]}},radialGradient:function(n,r,G,D){this.lb={uc:n,vc:r,bc:G,cc:D,Sb:[],Zc:!0}},addStop:function(n,r){this.lb.Sb.push({color:n,stop:r})},completeGradient:function(){},draw:function(n,r,G,D){let z=this.Dc;var E=this.Xb,C=this.lb;const L=n.globalCompositeOperation,ua=n.globalAlpha;n.globalCompositeOperation=this.zc;n.globalAlpha=D;if(null!=C){E=C.uc;const V=C.vc,ba=C.bc;var R=C.cc;D=C.Sb;C.Zc?(C=ba-E,R-=V,E=n.createRadialGradient(E,V,0,E,V,Math.sqrt(C*C+R*R))):E=n.createLinearGradient(E,
376
+ V,ba,R);for(let W=0,aa=D.length;W<aa;W++)C=D[W],E.addColorStop(C.stop,b(C.color));this.Xb=E;this.lb=null}switch(z){case y:n.strokeStyle=E;n.lineWidth=this.Ec;n.lineCap=this.Fb;n.lineJoin=this.Gb;n.stroke(r);break;case u:n.fillStyle=E,n.fill(r,G)}n.globalCompositeOperation=L;n.globalAlpha=ua}});const F=new Set;let q=null,K=[],O=0,S=0;var na=k.CanvasRenderer=g.extend("Renderer",{__construct:function(n){this.__parent.__construct.call(this);this.Xa=[1,0,0,1,0,0];this.Ka=[1];this.Ha=n.getContext("2d");
377
+ this.Ub=n;this.Na=[]},save:function(){this.Xa.push(...this.Xa.slice(this.Xa.length-6));this.Ka.push(this.Ka[this.Ka.length-1]);this.Na.push(this.Ha.save.bind(this.Ha))},restore:function(){const n=this.Xa.length-6;if(6>n)throw"restore() called without matching save().";this.Xa.splice(n);this.Ka.pop();this.Na.push(this.Ha.restore.bind(this.Ha))},transform:function(n,r,G,D,z,E){const C=this.Xa,L=C.length-6;C.splice(L,6,C[L]*n+C[L+2]*r,C[L+1]*n+C[L+3]*r,C[L]*G+C[L+2]*D,C[L+1]*G+C[L+3]*D,C[L]*z+C[L+2]*
378
+ E+C[L+4],C[L+1]*z+C[L+3]*E+C[L+5]);this.Na.push(this.Ha.transform.bind(this.Ha,n,r,G,D,z,E))},rotate:function(n){const r=Math.sin(n);n=Math.cos(n);this.transform(n,r,-r,n,0,0)},modulateOpacity:function(n){this.Ka[this.Ka.length-1]*=n},_drawPath:function(n,r){this.Na.push(r.draw.bind(r,this.Ha,n.Ya,n.Vb===t?"evenodd":"nonzero",Math.max(0,this.Ka[this.Ka.length-1])))},_drawRiveImage:function(n,r,G,D){var z=n.Ac;if(z){var E=this.Ha,C=a(G),L=Math.max(0,D*this.Ka[this.Ka.length-1]);this.Na.push(function(){E.globalCompositeOperation=
379
+ C;E.globalAlpha=L;E.drawImage(z,0,0);E.globalAlpha=1})}},_getMatrix:function(n){const r=this.Xa,G=r.length-6;for(let D=0;6>D;++D)n[D]=r[G+D]},_drawImageMesh:function(n,r,G,D,z,E,C,L,ua,R,V,ba,W,aa){let Qb,Rb,Sb;try{Qb=k.HEAPF32.slice(z>>2,(z>>2)+E),Rb=k.HEAPF32.slice(C>>2,(C>>2)+L),Sb=k.HEAPU16.slice(ua>>1,(ua>>1)+R)}catch(hb){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}r=this.Ha.canvas.width;z=this.Ha.canvas.height;C=W-V;L=
380
+ aa-ba;V=Math.max(V,0);ba=Math.max(ba,0);W=Math.min(W,r);aa=Math.min(aa,z);const Da=W-V,Ea=aa-ba;console.assert(Da<=Math.min(C,r));console.assert(Ea<=Math.min(L,z));if(!(0>=Da||0>=Ea)){W=Da<C||Ea<L;r=aa=1;var oa=Math.ceil(Da*aa),pa=Math.ceil(Ea*r);z=ja.ad();oa>z&&(aa*=z/oa,oa=z);pa>z&&(r*=z/pa,pa=z);q||(q=new k.DynamicRectanizer(z),q.reset(512,512));z=q.addRect(oa,pa);0>z&&(c(),F.add(this),z=q.addRect(oa,pa),console.assert(0<=z));var Tb=z&65535,Ub=z>>16;K.push({ib:this.Xa.slice(this.Xa.length-6),image:n,
381
+ Yb:Tb,Zb:Ub,bd:V,cd:ba,od:oa,fc:pa,Ab:aa,Bb:r,Tb:Qb,xc:Rb,indices:Sb,ed:W,tc:n.Ib<<1|(W?1:0)});O+=E;S+=R;var va=this.Ha,Vc=a(G),Wc=Math.max(0,D*this.Ka[this.Ka.length-1]);this.Na.push(function(){va.save();va.resetTransform();va.globalCompositeOperation=Vc;va.globalAlpha=Wc;const hb=ja.canvas();hb&&va.drawImage(hb,Tb,Ub,oa,pa,V,ba,Da,Ea);va.restore()})}},_clipPath:function(n){this.Na.push(this.Ha.clip.bind(this.Ha,n.Ya,n.Vb===t?"evenodd":"nonzero"))},clear:function(){F.add(this);this.Na.push(this.Ha.clearRect.bind(this.Ha,
382
+ 0,0,this.Ub.width,this.Ub.height))},flush:function(){},translate:function(n,r){this.transform(1,0,0,1,n,r)}});k.makeRenderer=function(n){const r=new na(n),G=r.Ha;return new Proxy(r,{get(D,z){if("function"===typeof D[z])return function(...E){return D[z].apply(D,E)};if("function"===typeof G[z]){if(-1<ia.indexOf(z))throw Error("RiveException: Method call to '"+z+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");
383
+ return function(...E){r.Na.push(G[z].bind(G,...E))}}return D[z]},set(D,z,E){if(z in G)return r.Na.push(()=>{G[z]=E}),!0}})};k.decodeImage=function(n,r){(new x({ob:r})).decode(n)};k.renderFactory={makeRenderPaint:function(){return new H},makeRenderPath:function(){return new p},makeRenderImage:function(){let n=Z;return new x({yb:()=>{n.total++},ob:()=>{n.loaded++;if(n.loaded===n.total){const r=n.ready;r&&(r(),n.ready=null)}}})}};let I=k.load,Z=null;k.load=function(n,r,G=!0){const D=new k.FallbackFileAssetLoader;
384
+ void 0!==r&&D.addLoader(r);G&&(r=new k.CDNFileAssetLoader,D.addLoader(r));return new Promise(function(z){let E=null;Z={total:0,loaded:0,ready:function(){z(E)}};E=I(n,D);0==Z.total&&z(E)})};let Xc=k.RendererWrapper.prototype.align;k.RendererWrapper.prototype.align=function(n,r,G,D,z=1){Xc.call(this,n,r,G,D,z)};d=new ea;k.requestAnimationFrame=d.requestAnimationFrame.bind(d);k.cancelAnimationFrame=d.cancelAnimationFrame.bind(d);k.enableFPSCounter=d.Mc.bind(d);k.disableFPSCounter=d.Jc;d.mc=c;k.resolveAnimationFrame=
385
+ c;k.cleanup=function(){q&&q.delete()}};var la="./this.program";da&&(_scriptName=self.location.href);var ma="",qa,ra;
386
+ if(ca||da){try{ma=(new URL(".",_scriptName)).href}catch{}da&&(ra=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});qa=async a=>{if(sa(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+
387
+ " : "+b.url);}}var ta=console.log.bind(console),wa=console.error.bind(console),xa,ya=!1,za,sa=a=>a.startsWith("file://"),Aa,Ba,v,A,Ca,Fa,B,J,Ga,Ha,Ia,Ja,Ka=!1;function La(){var a=Ma.buffer;k.HEAP8=v=new Int8Array(a);Ca=new Int16Array(a);k.HEAPU8=A=new Uint8Array(a);k.HEAPU16=Fa=new Uint16Array(a);k.HEAP32=B=new Int32Array(a);k.HEAPU32=J=new Uint32Array(a);k.HEAPF32=Ga=new Float32Array(a);Ha=new Float64Array(a);Ia=new BigInt64Array(a);Ja=new BigUint64Array(a)}
388
+ function Na(a){k.onAbort?.(a);a="Aborted("+a+")";wa(a);ya=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");Ba?.(a);throw a;}var Oa;async function Pa(a){if(!xa)try{var b=await qa(a);return new Uint8Array(b)}catch{}if(a==Oa&&xa)a=new Uint8Array(xa);else if(ra)a=ra(a);else throw"both async and sync fetching of the wasm failed";return a}
389
+ async function Qa(a,b){try{var c=await Pa(a);return await WebAssembly.instantiate(c,b)}catch(d){wa(`failed to asynchronously prepare wasm: ${d}`),Na(d)}}async function Ra(a){var b=Oa;if(!xa&&!sa(b))try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){wa(`wasm streaming compile failed: ${d}`),wa("falling back to ArrayBuffer instantiation")}return Qa(b,a)}
390
+ class Sa{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
391
+ var Ta=a=>{for(;0<a.length;)a.shift()(k)},Ua=[],Va=[],Wa=()=>{var a=k.preRun.shift();Va.push(a)},Xa=!0,Za=()=>{var a=B[+Ya>>2];Ya+=4;return a},$a=(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},ab=a=>{var b="/"===a.charAt(0),c="/"===a.slice(-1);(a=$a(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},bb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
392
+ a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},cb=()=>a=>crypto.getRandomValues(a),db=a=>{(db=cb())(a)},eb=(...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=$a(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+b||"."},fb=globalThis.TextDecoder&&new TextDecoder,gb=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;
393
+ return b},ib=(a,b=0,c,d)=>{c=gb(a,b,c,d);if(16<c-b&&a.buffer&&fb)return fb.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},jb=[],kb=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:
394
+ 2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},lb=(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.codePointAt(f);if(127>=g){if(c>=d)break;b[c++]=g}else if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6;b[c++]=128|g&63}else if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12;b[c++]=128|g>>6&63;b[c++]=128|g&63}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;f++}}b[c]=0;return c-e},mb=[];
395
+ function nb(a,b){mb[a]={input:[],output:[],ab:b};ob(a,pb)}
396
+ var pb={open(a){var b=mb[a.node.zb];if(!b)throw new M(43);a.Ca=b;a.seekable=!1},close(a){a.Ca.ab.sb(a.Ca)},sb(a){a.Ca.ab.sb(a.Ca)},read(a,b,c,d){if(!a.Ca||!a.Ca.ab.ec)throw new M(60);for(var e=0,f=0;f<d;f++){try{var g=a.Ca.ab.ec(a.Ca)}catch(h){throw new M(29);}if(void 0===g&&0===e)throw new M(6);if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.gb=Date.now());return e},write(a,b,c,d){if(!a.Ca||!a.Ca.ab.Pb)throw new M(60);try{for(var e=0;e<d;e++)a.Ca.ab.Pb(a.Ca,b[c+e])}catch(f){throw new M(29);
397
+ }d&&(a.node.Ra=a.node.Oa=Date.now());return e}},qb={ec(){a:{if(!jb.length){var a=null;globalThis.window?.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(kb(a)+1);a=lb(a,b,0,b.length);b.length=a;jb=b}b=jb.shift()}return b},Pb(a,b){null===b||10===b?(ta(ib(a.output)),a.output=[]):0!=b&&a.output.push(b)},sb(a){0<a.output?.length&&(ta(ib(a.output)),a.output=[])},Wc(){return{xd:25856,zd:5,wd:191,yd:35387,vd:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,
398
+ 0,0,0,0,0,0,0,0,0,0,0]}},Xc(){return 0},Yc(){return[24,80]}},rb={Pb(a,b){null===b||10===b?(wa(ib(a.output)),a.output=[]):0!=b&&a.output.push(b)},sb(a){0<a.output?.length&&(wa(ib(a.output)),a.output=[])}},N={Ua:null,$a(){return N.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new M(63);N.Ua||(N.Ua={dir:{node:{eb:N.za.eb,Wa:N.za.Wa,nb:N.za.nb,wb:N.za.wb,qc:N.za.qc,wc:N.za.wc,sc:N.za.sc,Rb:N.za.Rb,Db:N.za.Db},stream:{Ta:N.xa.Ta}},file:{node:{eb:N.za.eb,
399
+ Wa:N.za.Wa},stream:{Ta:N.xa.Ta,read:N.xa.read,write:N.xa.write,jc:N.xa.jc,lc:N.xa.lc}},link:{node:{eb:N.za.eb,Wa:N.za.Wa,pb:N.za.pb},stream:{}},$b:{node:{eb:N.za.eb,Wa:N.za.Wa},stream:sb}});c=tb(a,b,c,d);16384===(c.mode&61440)?(c.za=N.Ua.dir.node,c.xa=N.Ua.dir.stream,c.ya={}):32768===(c.mode&61440)?(c.za=N.Ua.file.node,c.xa=N.Ua.file.stream,c.Ga=0,c.ya=null):40960===(c.mode&61440)?(c.za=N.Ua.link.node,c.xa=N.Ua.link.stream):8192===(c.mode&61440)&&(c.za=N.Ua.$b.node,c.xa=N.Ua.$b.stream);c.gb=c.Ra=
400
+ c.Oa=Date.now();a&&(a.ya[b]=c,a.gb=a.Ra=a.Oa=c.gb);return c},Dd(a){return a.ya?a.ya.subarray?a.ya.subarray(0,a.Ga):new Uint8Array(a.ya):new Uint8Array(0)},za:{eb(a){var b={};b.Ad=8192===(a.mode&61440)?a.id:1;b.Fd=a.id;b.mode=a.mode;b.Hd=1;b.uid=0;b.Ed=0;b.zb=a.zb;16384===(a.mode&61440)?b.size=4096:32768===(a.mode&61440)?b.size=a.Ga:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.gb=new Date(a.gb);b.Ra=new Date(a.Ra);b.Oa=new Date(a.Oa);b.Fc=4096;b.ud=Math.ceil(b.size/b.Fc);return b},Wa(a,b){for(var c of["mode",
401
+ "atime","mtime","ctime"])null!=b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.Ga!=b&&(0==b?(a.ya=null,a.Ga=0):(c=a.ya,a.ya=new Uint8Array(b),c&&a.ya.set(c.subarray(0,Math.min(b,a.Ga))),a.Ga=b)))},nb(){N.Jb||(N.Jb=new M(44),N.Jb.stack="<generic error, no stack>");throw N.Jb;},wb(a,b,c,d){return N.createNode(a,b,c,d)},qc(a,b,c){try{var d=ub(b,c)}catch(f){}if(d){if(16384===(a.mode&61440))for(var e in d.ya)throw new M(55);e=vb(d.parent.id,d.name);if(wb[e]===d)wb[e]=d.jb;else for(e=wb[e];e;){if(e.jb===
402
+ d){e.jb=d.jb;break}e=e.jb}}delete a.parent.ya[a.name];b.ya[c]=a;a.name=c;b.Oa=b.Ra=a.parent.Oa=a.parent.Ra=Date.now()},wc(a,b){delete a.ya[b];a.Oa=a.Ra=Date.now()},sc(a,b){var c=ub(a,b),d;for(d in c.ya)throw new M(55);delete a.ya[b];a.Oa=a.Ra=Date.now()},Rb(a){return[".","..",...Object.keys(a.ya)]},Db(a,b,c){a=N.createNode(a,b,41471,0);a.link=c;return a},pb(a){if(40960!==(a.mode&61440))throw new M(28);return a.link}},xa:{read(a,b,c,d,e){var f=a.node.ya;if(e>=a.node.Ga)return 0;a=Math.min(a.node.Ga-
403
+ 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===v.buffer&&(f=!1);if(!d)return 0;a=a.node;a.Ra=a.Oa=Date.now();if(b.subarray&&(!a.ya||a.ya.subarray)){if(f)return a.ya=b.subarray(c,c+d),a.Ga=d;if(0===a.Ga&&0===e)return a.ya=b.slice(c,c+d),a.Ga=d;if(e+d<=a.Ga)return a.ya.set(b.subarray(c,c+d),e),d}f=e+d;var g=a.ya?a.ya.length:0;g>=f||(f=Math.max(f,g*(1048576>g?2:1.125)>>>0),0!=g&&(f=Math.max(f,256)),g=a.ya,a.ya=new Uint8Array(f),
404
+ 0<a.Ga&&a.ya.set(g.subarray(0,a.Ga),0));if(a.ya.subarray&&b.subarray)a.ya.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.ya[e+f]=b[c+f];a.Ga=Math.max(a.Ga,e+d);return d},Ta(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Ga);if(0>b)throw new M(28);return b},jc(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new M(43);a=a.node.ya;if(e&2||!a||a.buffer!==v.buffer){d=!0;Na();e=void 0;if(!e)throw new M(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,
405
+ c,c+b);v.set(a,e)}}else d=!1,e=a.byteOffset;return{Ba:e,td:d}},lc(a,b,c,d){N.xa.write(a,b,0,d,c,!1);return 0}}},xb=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},yb=null,zb={},Ab=[],Bb=1,wb=null,Cb=!1,Db=!0,Eb={},M=class{name="ErrnoError";constructor(a){this.bb=a}},Fb=class{Eb={};node=null;get flags(){return this.Eb.flags}set flags(a){this.Eb.flags=a}get position(){return this.Eb.position}set position(a){this.Eb.position=a}},Gb=class{za={};xa={};xb=null;constructor(a,b,c,d){a||=this;this.parent=
406
+ a;this.$a=a.$a;this.id=Bb++;this.name=b;this.mode=c;this.zb=d;this.gb=this.Ra=this.Oa=Date.now()}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}};
407
+ function Hb(a,b={}){if(!a)throw new M(44);b.Lb??(b.Lb=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(h=>!!h);for(var d=yb,e="/",f=0;f<a.length;f++){var g=f===a.length-1;if(g&&b.parent)break;if("."!==a[f])if(".."===a[f])if(e=bb(e),d===d.parent){a=e+"/"+a.slice(f+1).join("/");c--;continue a}else d=d.parent;else{e=ab(e+"/"+a[f]);try{d=ub(d,a[f])}catch(h){if(44===h?.bb&&g&&b.fd)return{path:e};throw h;}!d.xb||g&&!b.Lb||(d=d.xb.root);if(40960===(d.mode&61440)&&(!g||b.Kb)){if(!d.za.pb)throw new M(52);
408
+ d=d.za.pb(d);"/"===d.charAt(0)||(d=bb(e)+"/"+d);a=d+"/"+a.slice(f+1).join("/");continue a}}}return{path:e,node:d}}throw new M(32);}function vb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%wb.length}function ub(a,b){var c=16384===(a.mode&61440)?(c=Ib(a,"x"))?c:a.za.nb?0:2:54;if(c)throw new M(c);for(c=wb[vb(a.id,b)];c;c=c.jb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.za.nb(a,b)}
409
+ function tb(a,b,c,d){a=new Gb(a,b,c,d);b=vb(a.parent.id,a.name);a.jb=wb[b];return wb[b]=a}function Jb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}function Ib(a,b){if(Db)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 Kb(a,b){if(16384!==(a.mode&61440))return 54;try{return ub(a,b),20}catch(c){}return Ib(a,"wx")}function Lb(a){a=Ab[a];if(!a)throw new M(8);return a}
410
+ function Mb(a,b=-1){a=Object.assign(new Fb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Ab[b])break a;throw new M(33);}a.cb=b;return Ab[b]=a}function Nb(a,b=-1){a=Mb(a,b);a.xa?.Cd?.(a);return a}function Ob(a,b){var c= undefined,d=c?null:a;c??=a.za.Wa;if(!c)throw new M(63);c(d,b)}var sb={open(a){a.xa=zb[a.node.zb].xa;a.xa.open?.(a)},Ta(){throw new M(70);}};function ob(a,b){zb[a]={xa:b}}
411
+ function Pb(a,b){var c="/"===b;if(c&&yb)throw new M(10);if(!c&&b){var d=Hb(b,{Lb:!1});b=d.path;d=d.node;if(d.xb)throw new M(10);if(16384!==(d.mode&61440))throw new M(54);}b={type:a,Id:{},kc:b,dd:[]};a=a.$a(b);a.$a=b;b.root=a;c?yb=a:d&&(d.xb=b,d.$a&&d.$a.dd.push(b))}function Vb(a,b,c){var d=Hb(a,{parent:!0}).node;a=a&&a.match(/([^\/]+|\/)\/*$/)[1];if(!a)throw new M(28);if("."===a||".."===a)throw new M(20);var e=Kb(d,a);if(e)throw new M(e);if(!d.za.wb)throw new M(63);return d.za.wb(d,a,b,c)}
412
+ function Wb(a){return Vb(a,16895,0)}function Xb(a,b,c){"undefined"==typeof c&&(c=b,b=438);Vb(a,b|8192,c)}function Yb(a,b){if(!eb(a))throw new M(44);var c=Hb(b,{parent:!0}).node;if(!c)throw new M(44);b=b&&b.match(/([^\/]+|\/)\/*$/)[1];var d=Kb(c,b);if(d)throw new M(d);if(!c.za.Db)throw new M(63);c.za.Db(c,b,a)}
413
+ function Zb(a,b,c=438){if(""===a)throw new M(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?c&4095|32768:0;if("object"==typeof a)d=a;else{var e=a.endsWith("/");a=Hb(a,{Kb:!(b&131072),fd:!0});d=a.node;a=a.path}var f=!1;if(b&64)if(d){if(b&128)throw new M(20);}else{if(e)throw new M(31);d=Vb(a,c|511,0);f=!0}if(!d)throw new M(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&16384!==(d.mode&
414
+ 61440))throw new M(54);if(!f&&(e=d?40960===(d.mode&61440)?32:16384===(d.mode&61440)&&("r"!==Jb(b)||b&576)?31:Ib(d,Jb(b)):44))throw new M(e);if(b&512&&!f){e=d;e="string"==typeof e?Hb(e,{Kb:!0}).node:e;if(16384===(e.mode&61440))throw new M(31);if(32768!==(e.mode&61440))throw new M(28);var g=Ib(e,"w");if(g)throw new M(g);Ob(e,{size:0,timestamp:Date.now()})}b&=-131713;a:for(e=d;;){if(e===e.parent){e=e.$a.kc;var h=h?"/"!==e[e.length-1]?`${e}/${h}`:e+h:e;break a}h=h?`${e.name}/${h}`:e.name;e=e.parent}h=
415
+ Mb({node:d,path:h,flags:b,seekable:!0,position:0,xa:d.xa,nd:[],error:!1});h.xa.open&&h.xa.open(h);f&&(c&=511,d="string"==typeof d?Hb(d,{Kb:!0}).node:d,Ob(d,{mode:c&4095|d.mode&-4096,Oa:Date.now(),Bd:void 0}));!k.logReadFiles||b&1||a in Eb||(Eb[a]=1);return h}function $b(a,b,c){if(null===a.cb)throw new M(8);if(!a.seekable||!a.xa.Ta)throw new M(70);if(0!=c&&1!=c&&2!=c)throw new M(28);a.position=a.xa.Ta(a,b,c);a.nd=[]}
416
+ function ac(a,b,c){a=ab("/dev/"+a);var d=xb(!!b,!!c);ac.ic??(ac.ic=64);var e=ac.ic++<<8|0;ob(e,{open(f){f.seekable=!1},close(){c?.buffer?.length&&c(10)},read(f,g,h,m){for(var l=0,u=0;u<m;u++){try{var y=b()}catch(t){throw new M(29);}if(void 0===y&&0===l)throw new M(6);if(null===y||void 0===y)break;l++;g[h+u]=y}l&&(f.node.gb=Date.now());return l},write(f,g,h,m){for(var l=0;l<m;l++)try{c(g[h+l])}catch(u){throw new M(29);}m&&(f.node.Ra=f.node.Oa=Date.now());return l}});Xb(a,d,e)}
417
+ var bc={},Ya=void 0,cc=(a,b)=>Object.defineProperty(b,"name",{value:a}),dc=[],ec=[0,1,,1,null,1,!0,1,!1,1],P=class extends Error{constructor(a){super(a);this.name="BindingError"}},Q=a=>{if(!a)throw new P(`Cannot use deleted val. handle = ${a}`);return ec[a]},fc=a=>{switch(a){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const b=dc.pop()||ec.length;ec[b]=a;ec[b+1]=1;return b}};class gc extends Error{}
418
+ var T=a=>{for(var b="";;){var c=A[a++];if(!c)return b;b+=String.fromCharCode(c)}},hc={},ic=(a,b)=>{if(void 0===b)throw new P("ptr should not be undefined");for(;a.Ia;)b=a.qb(b),a=a.Ia;return b},jc={},mc=a=>{a=kc(a);var b=T(a);lc(a);return b},nc=(a,b)=>{var c=jc[a];if(void 0===c)throw a=`${b} has unknown type ${mc(a)}`,new P(a);return c},oc=()=>{},pc=!1,qc=a=>{if(!globalThis.FinalizationRegistry)return qc=b=>b,a;pc=new FinalizationRegistry(b=>{b=b.va;--b.count.value;0===b.count.value&&(b.Ja?b.Pa.Va(b.Ja):
419
+ b.Da.wa.Va(b.Ba))});qc=b=>{var c=b.va;c.Ja&&pc.register(b,{va:c},b);return b};oc=b=>{pc.unregister(b)};return qc(a)},rc={},sc=a=>{for(;a.length;){var b=a.pop();a.pop()(b)}};function tc(a){return this.Aa(J[a>>2])}
420
+ var uc={},vc={},wc=class extends Error{constructor(a){super(a);this.name="InternalError"}},X=(a,b,c)=>{function d(h){h=c(h);if(h.length!==a.length)throw new wc("Mismatched type converter count");for(var m=0;m<a.length;++m)U(a[m],h[m])}a.forEach(h=>vc[h]=b);var e=Array(b.length),f=[],g=0;for(let [h,m]of b.entries())jc.hasOwnProperty(m)?e[h]=jc[m]:(f.push(m),uc.hasOwnProperty(m)||(uc[m]=[]),uc[m].push(()=>{e[h]=jc[m];++g;g===f.length&&d(e)}));0===f.length&&d(e)};
421
+ function xc(a,b,c={}){var d=b.name;if(!a)throw new P(`type "${d}" must have a positive integer typeid pointer`);if(jc.hasOwnProperty(a)){if(c.Uc)return;throw new P(`Cannot register type '${d}' twice`);}jc[a]=b;delete vc[a];uc.hasOwnProperty(a)&&(b=uc[a],delete uc[a],b.forEach(e=>e()))}function U(a,b,c={}){return xc(a,b,c)}
422
+ var yc=(a,b,c)=>{switch(b){case 1:return c?d=>v[d]:d=>A[d];case 2:return c?d=>Ca[d>>1]:d=>Fa[d>>1];case 4:return c?d=>B[d>>2]:d=>J[d>>2];case 8:return c?d=>Ia[d>>3]:d=>Ja[d>>3];default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},zc=a=>{throw new P(a.va.Da.wa.name+" instance already deleted");},Ac=[];function Bc(){}
423
+ var Cc={},Dc=(a,b,c)=>{if(void 0===a[b].Fa){var d=a[b];a[b]=function(...e){if(!a[b].Fa.hasOwnProperty(e.length))throw new P(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${a[b].Fa})!`);return a[b].Fa[e.length].apply(this,e)};a[b].Fa=[];a[b].Fa[d.Za]=d}},Ec=(a,b,c)=>{if(k.hasOwnProperty(a)){if(void 0===c||void 0!==k[a].Fa&&void 0!==k[a].Fa[c])throw new P(`Cannot register public name '${a}' twice`);Dc(k,a,a);if(k[a].Fa.hasOwnProperty(c))throw new P(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
424
+ k[a].Fa[c]=b}else k[a]=b,k[a].Za=c},Fc=a=>{a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?`_${a}`:a};function Gc(a,b,c,d,e,f,g,h){this.name=a;this.constructor=b;this.Sa=c;this.Va=d;this.Ia=e;this.Pc=f;this.qb=g;this.Kc=h;this.oc=[]}
425
+ var Hc=(a,b,c)=>{for(;b!==c;){if(!b.qb)throw new P(`Expected null or instance of ${c.name}, got an instance of ${b.name}`);a=b.qb(a);b=b.Ia}return a},Ic=a=>{if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a};
426
+ function Jc(a,b){if(null===b){if(this.Nb)throw new P(`null is not a valid ${this.name}`);return 0}if(!b.va)throw new P(`Cannot pass "${Ic(b)}" as a ${this.name}`);if(!b.va.Ba)throw new P(`Cannot pass deleted object as a pointer of type ${this.name}`);return Hc(b.va.Ba,b.va.Da.wa,this.wa)}
427
+ function Kc(a,b){if(null===b){if(this.Nb)throw new P(`null is not a valid ${this.name}`);if(this.vb){var c=this.Qb();null!==a&&a.push(this.Va,c);return c}return 0}if(!b||!b.va)throw new P(`Cannot pass "${Ic(b)}" as a ${this.name}`);if(!b.va.Ba)throw new P(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ub&&b.va.Da.ub)throw new P(`Cannot convert argument of type ${b.va.Pa?b.va.Pa.name:b.va.Da.name} to parameter type ${this.name}`);c=Hc(b.va.Ba,b.va.Da.wa,this.wa);if(this.vb){if(void 0===
428
+ b.va.Ja)throw new P("Passing raw pointer to smart pointer is illegal");switch(this.md){case 0:if(b.va.Pa===this)c=b.va.Ja;else throw new P(`Cannot convert argument of type ${b.va.Pa?b.va.Pa.name:b.va.Da.name} to parameter type ${this.name}`);break;case 1:c=b.va.Ja;break;case 2:if(b.va.Pa===this)c=b.va.Ja;else{var d=b.clone();c=this.hd(c,fc(()=>d["delete"]()));null!==a&&a.push(this.Va,c)}break;default:throw new P("Unsupported sharing policy");}}return c}
429
+ function Lc(a,b){if(null===b){if(this.Nb)throw new P(`null is not a valid ${this.name}`);return 0}if(!b.va)throw new P(`Cannot pass "${Ic(b)}" as a ${this.name}`);if(!b.va.Ba)throw new P(`Cannot pass deleted object as a pointer of type ${this.name}`);if(b.va.Da.ub)throw new P(`Cannot convert argument of type ${b.va.Da.name} to parameter type ${this.name}`);return Hc(b.va.Ba,b.va.Da.wa,this.wa)}
430
+ var Mc=(a,b,c)=>{if(b===c)return a;if(void 0===c.Ia)return null;a=Mc(a,b,c.Ia);return null===a?null:c.Kc(a)},Nc=(a,b)=>{b=ic(a,b);return hc[b]},Oc=(a,b)=>{if(!b.Da||!b.Ba)throw new wc("makeClassHandle requires ptr and ptrType");if(!!b.Pa!==!!b.Ja)throw new wc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return qc(Object.create(a,{va:{value:b,writable:!0}}))};
431
+ function Pc(a,b,c,d,e,f,g,h,m,l,u){this.name=a;this.wa=b;this.Nb=c;this.ub=d;this.vb=e;this.gd=f;this.md=g;this.pc=h;this.Qb=m;this.hd=l;this.Va=u;e||void 0!==b.Ia?this.Ea=Kc:(this.Ea=d?Jc:Lc,this.La=null)}var Qc=(a,b,c)=>{if(!k.hasOwnProperty(a))throw new wc("Replacing nonexistent public symbol");void 0!==k[a].Fa&&void 0!==c?k[a].Fa[c]=b:(k[a]=b,k[a].Za=c)},Y=(a,b)=>{a=T(a);var c=Rc.get(b);if("function"!=typeof c)throw new P(`unknown function pointer with signature ${a}: ${b}`);return c};
432
+ class Sc extends Error{}var Tc=(a,b)=>{function c(f){e[f]||jc[f]||(vc[f]?vc[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};b.forEach(c);throw new Sc(`${a}: `+d.map(mc).join([", "]));};function Uc(a){for(var b=1;b<a.length;++b)if(null!==a[b]&&void 0===a[b].La)return!0;return!1}
433
+ function Yc(a,b,c,d,e){var f=b.length;if(2>f)throw new P("argTypes array size mismatch! Must at least get return value and 'this' types!");var g=null!==b[1]&&null!==c,h=Uc(b),m=!b[0].$c,l=f-2,u=Array(l),y=[],t=[];return cc(a,function(...w){t.length=0;y.length=g?2:1;y[0]=e;if(g){var x=b[1].Ea(t,this);y[1]=x}for(var p=0;p<l;++p)u[p]=b[p+2].Ea(t,w[p]),y.push(u[p]);w=d(...y);if(h)sc(t);else for(p=g?1:2;p<b.length;p++){var H=1===p?x:u[p-2];null!==b[p].La&&b[p].La(H)}x=m?b[0].Aa(w):void 0;return x})}
434
+ var Zc=(a,b)=>{for(var c=[],d=0;d<a;d++)c.push(J[b+4*d>>2]);return c},$c=a=>{a=a.trim();const b=a.indexOf("(");return-1===b?a:a.slice(0,b)},ad=(a,b,c)=>{if(!(a instanceof Object))throw new P(`${c} with invalid "this": ${a}`);if(!(a instanceof b.wa.constructor))throw new P(`${c} incompatible with "this" of type ${a.constructor.name}`);if(!a.va.Ba)throw new P(`cannot call emscripten binding method ${c} on deleted object`);return Hc(a.va.Ba,a.va.Da.wa,b.wa)},bd=a=>{9<a&&0===--ec[a+1]&&(ec[a]=void 0,
435
+ dc.push(a))},cd={name:"emscripten::val",Aa:a=>{var b=Q(a);bd(a);return b},Ea:(a,b)=>fc(b),Ma:tc,La:null},dd=(a,b,c)=>{switch(b){case 1:return c?function(d){return this.Aa(v[d])}:function(d){return this.Aa(A[d])};case 2:return c?function(d){return this.Aa(Ca[d>>1])}:function(d){return this.Aa(Fa[d>>1])};case 4:return c?function(d){return this.Aa(B[d>>2])}:function(d){return this.Aa(J[d>>2])};default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},ed=(a,b)=>{switch(b){case 4:return function(c){return this.Aa(Ga[c>>
436
+ 2])};case 8:return function(c){return this.Aa(Ha[c>>3])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}},fd=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,gd=(a,b,c)=>{a>>=1;b=gb(Fa,a,b/2,c);if(16<b-a&&fd)return fd.decode(Fa.subarray(a,b));for(c="";a<b;++a)c+=String.fromCharCode(Fa[a]);return c},hd=(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)Ca[b>>1]=a.charCodeAt(e),b+=2;Ca[b>>1]=0;return b-d},jd=a=>2*a.length,
437
+ kd=(a,b,c)=>{var d="";a>>=2;for(var e=0;!(e>=b/4);e++){var f=J[a+e];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},ld=(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.codePointAt(e);65535<f&&e++;B[b>>2]=f;b+=4;if(b+4>c)break}B[b>>2]=0;return b-d},md=a=>{for(var b=0,c=0;c<a.length;++c)65535<a.codePointAt(c)&&c++,b+=4;return b},nd=0,od=[],pd=a=>{var b=od.length;od.push(a);return b},qd=(a,b)=>{for(var c=Array(a),d=0;d<a;++d)c[d]=nc(J[b+4*d>>2],`parameter ${d}`);
438
+ return c},rd={},sd=a=>{var b=rd[a];return void 0===b?T(a):b},td=[0,31,60,91,121,152,182,213,244,274,305,335],ud=[0,31,59,90,120,151,181,212,243,273,304,334],vd={},wd=a=>{if(!(a instanceof Sa||"unwind"==a))throw a;},xd=a=>{za=a;Xa||0<nd||(k.onExit?.(a),ya=!0);throw new Sa(a);},yd=a=>{if(!ya)try{if(a(),!(Xa||0<nd))try{za=a=za,xd(a)}catch(b){wd(b)}}catch(b){wd(b)}},zd=[],Ad={},Cd=()=>{if(!Bd){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
439
+ "C").replace("-","_")+".UTF-8",_:la||"./this.program"},b;for(b in Ad)void 0===Ad[b]?delete a[b]:a[b]=Ad[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Bd=c}return Bd},Bd;wb=Array(4096);Pb(N,"/");Wb("/tmp");Wb("/home");Wb("/home/web_user");
440
+ (function(){Wb("/dev");ob(259,{read:()=>0,write:(d,e,f,g)=>g,Ta:()=>0});Xb("/dev/null",259);nb(1280,qb);nb(1536,rb);Xb("/dev/tty",1280);Xb("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(db(a),b=a.byteLength);return a[--b]};ac("random",c);ac("urandom",c);Wb("/dev/shm");Wb("/dev/shm/tmp")})();
441
+ (function(){Wb("/proc");var a=Wb("/proc/self");Wb("/proc/self/fd");Pb({$a(){var b=tb(a,"fd",16895,73);b.xa={Ta:N.xa.Ta};b.za={nb(c,d){c=+d;var e=Lb(c);c={parent:null,$a:{kc:"fake"},za:{pb:()=>e.path},id:c+1};return c.parent=c},Rb(){return Array.from(Ab.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();
442
+ (()=>{let a=Bc.prototype;Object.assign(a,{isAliasOf:function(c){if(!(this instanceof Bc&&c instanceof Bc))return!1;var d=this.va.Da.wa,e=this.va.Ba;c.va=c.va;var f=c.va.Da.wa;for(c=c.va.Ba;d.Ia;)e=d.qb(e),d=d.Ia;for(;f.Ia;)c=f.qb(c),f=f.Ia;return d===f&&e===c},clone:function(){this.va.Ba||zc(this);if(this.va.kb)return this.va.count.value+=1,this;var c=qc,d=Object,e=d.create,f=Object.getPrototypeOf(this),g=this.va;c=c(e.call(d,f,{va:{value:{count:g.count,mb:g.mb,kb:g.kb,Ba:g.Ba,Da:g.Da,Ja:g.Ja,Pa:g.Pa}}}));
443
+ c.va.count.value+=1;c.va.mb=!1;return c},["delete"](){this.va.Ba||zc(this);if(this.va.mb&&!this.va.kb)throw new P("Object already scheduled for deletion");oc(this);var c=this.va;--c.count.value;0===c.count.value&&(c.Ja?c.Pa.Va(c.Ja):c.Da.wa.Va(c.Ba));this.va.kb||(this.va.Ja=void 0,this.va.Ba=void 0)},isDeleted:function(){return!this.va.Ba},deleteLater:function(){this.va.Ba||zc(this);if(this.va.mb&&!this.va.kb)throw new P("Object already scheduled for deletion");Ac.push(this);this.va.mb=!0;return this}});
444
+ const b=Symbol.dispose;b&&(a[b]=a["delete"])})();
445
+ Object.assign(Pc.prototype,{Qc(a){this.pc&&(a=this.pc(a));return a},ac(a){this.Va?.(a)},Ma:tc,Aa:function(a){function b(){return this.vb?Oc(this.wa.Sa,{Da:this.gd,Ba:c,Pa:this,Ja:a}):Oc(this.wa.Sa,{Da:this,Ba:a})}var c=this.Qc(a);if(!c)return this.ac(a),null;var d=Nc(this.wa,c);if(void 0!==d){if(0===d.va.count.value)return d.va.Ba=c,d.va.Ja=a,d.clone();d=d.clone();this.ac(a);return d}d=this.wa.Pc(c);d=Cc[d];if(!d)return b.call(this);d=this.ub?d.Gc:d.pointerType;var e=Mc(c,this.wa,d.wa);return null===
446
+ e?b.call(this):this.vb?Oc(d.wa.Sa,{Da:d,Ba:e,Pa:this,Ja:a}):Oc(d.wa.Sa,{Da:d,Ba:e})}});k.noExitRuntime&&(Xa=k.noExitRuntime);k.print&&(ta=k.print);k.printErr&&(wa=k.printErr);k.wasmBinary&&(xa=k.wasmBinary);k.thisProgram&&(la=k.thisProgram);if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();
447
+ var Gd={236669:(a,b,c,d,e)=>{if("undefined"===typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if("undefined"===typeof window.miniaudio){window.miniaudio={referenceCount:0};window.miniaudio.device_type={};window.miniaudio.device_type.playback=a;window.miniaudio.device_type.capture=b;window.miniaudio.device_type.duplex=c;window.miniaudio.device_state={};window.miniaudio.device_state.stopped=d;window.miniaudio.device_state.started=e;let f=window.miniaudio;f.devices=
448
+ [];f.track_device=function(g){for(var h=0;h<f.devices.length;++h)if(null==f.devices[h])return f.devices[h]=g,h;f.devices.push(g);return f.devices.length-1};f.untrack_device_by_index=function(g){for(f.devices[g]=null;0<f.devices.length;)if(null==f.devices[f.devices.length-1])f.devices.pop();else break};f.untrack_device=function(g){for(var h=0;h<f.devices.length;++h)if(f.devices[h]==g)return f.untrack_device_by_index(h)};f.get_device_by_index=function(g){return f.devices[g]};f.unlock_event_types=["touchend",
449
+ "click"];f.unlock=function(){for(var g=0;g<f.devices.length;++g){var h=f.devices[g];null!=h&&null!=h.Qa&&h.state===f.device_state.started&&h.Qa.resume().then(()=>{Dd(h.nc)},m=>{console.error("Failed to resume audiocontext",m)})}f.unlock_event_types.map(function(m){document.removeEventListener(m,f.unlock,!0)})};f.unlock_event_types.map(function(g){document.addEventListener(g,f.unlock,!0)})}window.miniaudio.referenceCount+=1;return 1},238847:()=>{"undefined"!==typeof window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(a){document.removeEventListener(a,
450
+ window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},239151:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,239255:()=>{try{var a=new (window.AudioContext||window.webkitAudioContext),b=a.sampleRate;a.close();return b}catch(c){return 0}},239426:(a,b,c,d,e,f)=>{if("undefined"===typeof window.miniaudio)return-1;var g={},h={};a==window.miniaudio.device_type.playback&&0!=c&&(h.sampleRate=c);g.Qa=
451
+ new (window.AudioContext||window.webkitAudioContext)(h);g.Qa.suspend();g.state=window.miniaudio.device_state.stopped;c=0;a!=window.miniaudio.device_type.playback&&(c=b);g.fb=g.Qa.createScriptProcessor(d,c,b);g.fb.onaudioprocess=function(m){if(null==g.tb||0==g.tb.length)g.tb=new Float32Array(Ga.buffer,e,d*b);if(a==window.miniaudio.device_type.capture||a==window.miniaudio.device_type.duplex){for(var l=0;l<b;l+=1)for(var u=m.inputBuffer.getChannelData(l),y=g.tb,t=0;t<d;t+=1)y[t*b+l]=u[t];Ed(f,d,e)}if(a==
452
+ window.miniaudio.device_type.playback||a==window.miniaudio.device_type.duplex)for(Fd(f,d,e),l=0;l<m.outputBuffer.numberOfChannels;++l)for(u=m.outputBuffer.getChannelData(l),y=g.tb,t=0;t<d;t+=1)u[t]=y[t*b+l];else for(l=0;l<m.outputBuffer.numberOfChannels;++l)m.outputBuffer.getChannelData(l).fill(0)};a!=window.miniaudio.device_type.capture&&a!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(m){g.Cb=g.Qa.createMediaStreamSource(m);g.Cb.connect(g.fb);
453
+ g.fb.connect(g.Qa.destination)}).catch(function(m){console.log("Failed to get user media: "+m)});a==window.miniaudio.device_type.playback&&g.fb.connect(g.Qa.destination);g.nc=f;return window.miniaudio.track_device(g)},242303:a=>window.miniaudio.get_device_by_index(a).Qa.sampleRate,242376:a=>{a=window.miniaudio.get_device_by_index(a);void 0!==a.fb&&(a.fb.onaudioprocess=function(){},a.fb.disconnect(),a.fb=void 0);void 0!==a.Cb&&(a.Cb.disconnect(),a.Cb=void 0);a.Qa.close();a.Qa=void 0;a.nc=void 0},242776:a=>
454
+ {window.miniaudio.untrack_device_by_index(a)},242826:a=>{a=window.miniaudio.get_device_by_index(a);a.Qa.resume();a.state=window.miniaudio.device_state.started},242965:a=>{a=window.miniaudio.get_device_by_index(a);a.Qa.suspend();a.state=window.miniaudio.device_state.stopped}},lc,Hd,kc,Dd,Ed,Fd,Id,Jd,Kd,Ld,Ma,Rc,Nd={s:function(a,b,c){Ya=c;try{var d=Lb(a);switch(b){case 0:var e=Za();if(0>e)break;for(;Ab[e];)e++;return Nb(d,e).cb;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Za(),d.flags|=
455
+ e,0;case 12:return e=Za(),Ca[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(f){if("undefined"==typeof bc||"ErrnoError"!==f.name)throw f;return-f.bb}},L:function(a,b,c){Ya=c;try{var d=Lb(a);switch(b){case 21509:return d.Ca?0:-59;case 21505:if(!d.Ca)return-59;if(d.Ca.ab.Wc){a=[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];var e=Za();B[e>>2]=25856;B[e+4>>2]=5;B[e+8>>2]=191;B[e+12>>2]=35387;for(var f=0;32>f;f++)v[e+f+17]=a[f]||0}return 0;case 21510:case 21511:case 21512:return d.Ca?
456
+ 0:-59;case 21506:case 21507:case 21508:if(!d.Ca)return-59;if(d.Ca.ab.Xc)for(e=Za(),a=[],f=0;32>f;f++)a.push(v[e+f+17]);return 0;case 21519:if(!d.Ca)return-59;e=Za();return B[e>>2]=0;case 21520:return d.Ca?-28:-59;case 21537:case 21531:e=Za();if(!d.xa.Vc)throw new M(59);return d.xa.Vc(d,b,e);case 21523:if(!d.Ca)return-59;d.Ca.ab.Yc&&(f=[24,80],e=Za(),Ca[e>>1]=f[0],Ca[e+2>>1]=f[1]);return 0;case 21524:return d.Ca?0:-59;case 21515:return d.Ca?0:-59;default:return-28}}catch(g){if("undefined"==typeof bc||
457
+ "ErrnoError"!==g.name)throw g;return-g.bb}},M:function(a,b,c,d){Ya=d;try{b=b?ib(A,b):"";var e=b;if("/"===e.charAt(0))b=e;else{var f=-100===a?"/":Lb(a).path;if(0==e.length)throw new M(44);b=f+"/"+e}var g=d?Za():0;return Zb(b,c,g).cb}catch(h){if("undefined"==typeof bc||"ErrnoError"!==h.name)throw h;return-h.bb}},P:()=>Na(""),o:(a,b,c)=>{a=T(a);b=nc(b,"wrapper");c=Q(c);var d=b.wa,e=d.Sa,f=d.Ia.Sa,g=d.Ia.constructor;a=cc(a,function(...h){for(var m of d.Ia.oc)if(this[m]===f[m])throw new gc(`Pure virtual function ${m} must be implemented in JavaScript`);
458
+ Object.defineProperty(this,"__parent",{value:e});this.__construct(...h)});e.__construct=function(...h){if(this===e)throw new P("Pass correct 'this' to __construct");h=g.implement(this,...h);oc(h);var m=h.va;h.notifyOnDestruction();m.kb=!0;Object.defineProperties(this,{va:{value:m}});qc(this);h=m.Ba;h=ic(d,h);if(hc.hasOwnProperty(h))throw new P(`Tried to register registered instance: ${h}`);hc[h]=this};e.__destruct=function(){if(this===e)throw new P("Pass correct 'this' to __destruct");oc(this);var h=
459
+ this.va.Ba;h=ic(d,h);if(hc.hasOwnProperty(h))delete hc[h];else throw new P(`Tried to unregister unregistered instance: ${h}`);};a.prototype=Object.create(e);Object.assign(a.prototype,c);return fc(a)},_:a=>{var b=rc[a];delete rc[a];var c=b.Qb,d=b.Va,e=b.dc,f=e.map(g=>g.Tc).concat(e.map(g=>g.kd));X([a],f,g=>{var h={},m,l;for([m,l]of e.entries()){const u=g[m],y=l.Rc,t=l.Sc,w=g[m+e.length],x=l.jd,p=l.ld;h[l.Nc]={read:H=>u.Aa(y(t,H)),write:(H,F)=>{var q=[];x(p,H,w.Ea(q,F));sc(q)},optional:u.optional}}return[{name:b.name,
460
+ Aa:u=>{var y={},t;for(t in h)y[t]=h[t].read(u);d(u);return y},Ea:(u,y)=>{for(var t in h)if(!(t in y||h[t].optional))throw new TypeError(`Missing field: "${t}"`);var w=c();for(t in h)h[t].write(w,y[t]);null!==u&&u.push(d,w);return w},Ma:tc,La:d}]})},u:(a,b,c,d,e)=>{b=T(b);d=0n===d;let f=g=>g;if(d){const g=8*c;f=h=>BigInt.asUintN(g,h);e=f(e)}U(a,{name:b,Aa:f,Ea:(g,h)=>{"number"==typeof h&&(h=BigInt(h));return h},Ma:yc(b,c,!d),La:null})},V:(a,b,c,d)=>{b=T(b);U(a,{name:b,Aa:function(e){return!!e},Ea:function(e,
461
+ f){return f?c:d},Ma:function(e){return this.Aa(A[e])},La:null})},c:(a,b,c,d,e,f,g,h,m,l,u,y,t)=>{u=T(u);f=Y(e,f);h&&=Y(g,h);l&&=Y(m,l);t=Y(y,t);var w=Fc(u);Ec(w,function(){Tc(`Cannot construct ${u} due to unbound types`,[d])});X([a,b,c],d?[d]:[],x=>{x=x[0];if(d){var p=x.wa;var H=p.Sa}else H=Bc.prototype;x=cc(u,function(...O){if(Object.getPrototypeOf(this)!==F)throw new P(`Use 'new' to construct ${u}`);if(void 0===q.hb)throw new P(`${u} has no accessible constructor`);var S=q.hb[O.length];if(void 0===
462
+ S)throw new P(`Tried to invoke ctor of ${u} with invalid number of parameters (${O.length}) - expected (${Object.keys(q.hb).toString()}) parameters instead!`);return S.apply(this,O)});var F=Object.create(H,{constructor:{value:x}});x.prototype=F;var q=new Gc(u,x,F,t,p,f,h,l);if(q.Ia){var K;(K=q.Ia).rb??(K.rb=[]);q.Ia.rb.push(q)}p=new Pc(u,q,!0,!1,!1);K=new Pc(u+"*",q,!1,!1,!1);H=new Pc(u+" const*",q,!1,!0,!1);Cc[a]={pointerType:K,Gc:H};Qc(w,x);return[p,K,H]})},k:(a,b,c,d,e,f,g)=>{var h=Zc(c,d);b=T(b);
463
+ b=$c(b);f=Y(e,f);X([],[a],m=>{function l(){Tc(`Cannot call ${u} due to unbound types`,h)}m=m[0];var u=`${m.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var y=m.wa.constructor;void 0===y[b]?(l.Za=c-1,y[b]=l):(Dc(y,b,u),y[b].Fa[c-1]=l);X([],h,t=>{t=Yc(u,[t[0],null].concat(t.slice(1)),null,f,g);void 0===y[b].Fa?(t.Za=c-1,y[b]=t):y[b].Fa[c-1]=t;if(m.wa.rb)for(const w of m.wa.rb)w.constructor.hasOwnProperty(b)||(w.constructor[b]=t);return[]});return[]})},q:(a,b,c,d,e,f,g,h)=>{b=T(b);f=Y(e,
464
+ f);X([],[a],m=>{m=m[0];var l=`${m.name}.${b}`,u={get(){Tc(`Cannot access ${l} due to unbound types`,[c])},enumerable:!0,configurable:!0};u.set=h?()=>{Tc(`Cannot access ${l} due to unbound types`,[c])}:()=>{throw new P(`${l} is a read-only property`);};Object.defineProperty(m.wa.constructor,b,u);X([],[c],y=>{y=y[0];var t={get(){return y.Aa(f(d))},enumerable:!0};h&&(h=Y(g,h),t.set=w=>{var x=[];h(d,y.Ea(x,w));sc(x)});Object.defineProperty(m.wa.constructor,b,t);return[]});return[]})},n:(a,b,c,d,e,f)=>
465
+ {var g=Zc(b,c);e=Y(d,e);X([],[a],h=>{h=h[0];var m=`constructor ${h.name}`;void 0===h.wa.hb&&(h.wa.hb=[]);if(void 0!==h.wa.hb[b-1])throw new P(`Cannot register multiple constructors with identical number of parameters (${b-1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.wa.hb[b-1]=()=>{Tc(`Cannot construct ${h.name} due to unbound types`,g)};X([],g,l=>{l.splice(1,0,null);h.wa.hb[b-1]=Yc(m,l,null,e,f);return[]});return[]})},
466
+ a:(a,b,c,d,e,f,g,h)=>{var m=Zc(c,d);b=T(b);b=$c(b);f=Y(e,f);X([],[a],l=>{function u(){Tc(`Cannot call ${y} due to unbound types`,m)}l=l[0];var y=`${l.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);h&&l.wa.oc.push(b);var t=l.wa.Sa,w=t[b];void 0===w||void 0===w.Fa&&w.className!==l.name&&w.Za===c-2?(u.Za=c-2,u.className=l.name,t[b]=u):(Dc(t,b,y),t[b].Fa[c-2]=u);X([],m,x=>{x=Yc(y,x,l,f,g);void 0===t[b].Fa?(x.Za=c-2,t[b]=x):t[b].Fa[c-2]=x;return[]});return[]})},b:(a,b,c,d,e,f,g,h,m,l)=>{b=
467
+ T(b);e=Y(d,e);X([],[a],u=>{u=u[0];var y=`${u.name}.${b}`,t={get(){Tc(`Cannot access ${y} due to unbound types`,[c,g])},enumerable:!0,configurable:!0};t.set=m?()=>Tc(`Cannot access ${y} due to unbound types`,[c,g]):()=>{throw new P(y+" is a read-only property");};Object.defineProperty(u.wa.Sa,b,t);X([],m?[c,g]:[c],w=>{var x=w[0],p={get(){var F=ad(this,u,y+" getter");return x.Aa(e(f,F))},enumerable:!0};if(m){m=Y(h,m);var H=w[1];p.set=function(F){var q=ad(this,u,y+" setter"),K=[];m(l,q,H.Ea(K,F));sc(K)}}Object.defineProperty(u.wa.Sa,
468
+ b,p);return[]});return[]})},T:a=>U(a,cd),m:(a,b,c,d,e)=>{b=T(b);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function g(){}g.values={};U(a,{name:b,constructor:g,valueType:e,Aa:function(h){return this.constructor.values[h]},Ea:(h,m)=>m.value,Ma:dd(b,c,d),La:null});Ec(b,g);break;case "number":var f={};U(a,{name:b,Ob:f,valueType:e,Aa:h=>h,Ea:(h,m)=>m,Ma:dd(b,c,d),La:null});Ec(b,f);delete k[b].Za;break;case "string":f={},U(a,{name:b,yc:{},rc:{},Ob:f,valueType:e,Aa:function(h){return this.rc[h]},
469
+ Ea:function(h,m){return this.yc[m]},Ma:dd(b,c,d),La:null}),Ec(b,f),delete k[b].Za}},d:(a,b,c)=>{var d=nc(a,"enum");b=T(b);switch(d.valueType){case "object":a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:cc(`${d.name}_${b}`,function(){})}});a.values[c]=d;a[b]=d;break;case "number":d.Ob[b]=c;break;case "string":d.yc[b]=c,d.rc[c]=b,d.Ob[b]=b}},t:(a,b,c)=>{b=T(b);U(a,{name:b,Aa:d=>d,Ea:(d,e)=>e,Ma:ed(b,c),La:null})},i:(a,b,c,d,e,f)=>{var g=Zc(b,c);a=T(a);a=
470
+ $c(a);e=Y(d,e);Ec(a,function(){Tc(`Cannot call ${a} due to unbound types`,g)},b-1);X([],g,h=>{Qc(a,Yc(a,[h[0],null].concat(h.slice(1)),null,e,f),b-1);return[]})},l:(a,b,c,d,e)=>{b=T(b);let f=h=>h;if(0===d){var g=32-8*c;f=h=>h<<g>>>g;e=f(e)}U(a,{name:b,Aa:f,Ea:(h,m)=>m,Ma:yc(b,c,0!==d),La:null})},h:(a,b,c)=>{function d(f){return new e(v.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=T(c);
471
+ U(a,{name:c,Aa:d,Ma:d},{Uc:!0})},U:(a,b)=>{b=T(b);U(a,{name:b,Aa(c){var d=(d=c+4)?ib(A,d,J[c>>2],!0):"";lc(c);return d},Ea(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new P("Cannot pass non-string to std::string");var f=e?kb(d):d.length;var g=Hd(4+f+1),h=g+4;J[g>>2]=f;e?lb(d,A,h,f+1):A.set(d,h);null!==c&&c.push(lc,g);return g},Ma:tc,La(c){lc(c)}})},p:(a,b,c)=>{c=T(c);if(2===b){var d=gd;var e=hd;var f=jd}else d=
472
+ kd,e=ld,f=md;U(a,{name:c,Aa:g=>{var h=d(g+4,J[g>>2]*b,!0);lc(g);return h},Ea:(g,h)=>{if("string"!=typeof h)throw new P(`Cannot pass non-string to C++ string type ${c}`);var m=f(h),l=Hd(4+m+b);J[l>>2]=m/b;e(h,l+4,m+b);null!==g&&g.push(lc,l);return l},Ma:tc,La(g){lc(g)}})},aa:(a,b,c,d,e,f)=>{rc[a]={name:T(b),Qb:Y(c,d),Va:Y(e,f),dc:[]}},$:(a,b,c,d,e,f,g,h,m,l)=>{rc[a].dc.push({Nc:T(b),Tc:c,Rc:Y(d,e),Sc:f,kd:g,jd:Y(h,m),ld:l})},W:(a,b)=>{b=T(b);U(a,{$c:!0,name:b,Aa:()=>{},Ea:()=>{}})},A:()=>{Xa=!1;nd=
473
+ 0},y:()=>{throw Infinity;},f:(a,b,c)=>{var [d,...e]=qd(a,b),f=d.Ea.bind(d),g=e.map(m=>m.Ma.bind(m));a--;var h=Array(a);b=`methodCaller<(${e.map(m=>m.name)}) => ${d.name}>`;return pd(cc(b,(m,l,u,y)=>{for(var t=0,w=0;w<a;++w)h[w]=g[w](y+t),t+=8;switch(c){case 0:var x=Q(m).apply(null,h);break;case 2:x=Reflect.construct(Q(m),h);break;case 3:x=h[0];break;case 1:x=Q(m)[sd(l)](...h)}m=[];x=f(m,x);m.length&&(J[u>>2]=fc(m));return x}))},ca:bd,X:a=>{a=sd(a);return fc(k[a])},Y:(a,b)=>{a=Q(a);b=Q(b);return fc(a[b])},
474
+ v:a=>{9<a&&(ec[a+1]+=1)},e:(a,b,c,d,e)=>od[a](b,c,d,e),Z:()=>fc([]),ba:a=>fc(sd(a)),da:()=>fc({}),w:a=>{var b=Q(a);sc(b);bd(a)},g:(a,b,c)=>{a=Q(a);b=Q(b);c=Q(c);a[b]=c},F:function(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);B[b>>2]=a.getUTCSeconds();B[b+4>>2]=a.getUTCMinutes();B[b+8>>2]=a.getUTCHours();B[b+12>>2]=a.getUTCDate();B[b+16>>2]=a.getUTCMonth();B[b+20>>2]=a.getUTCFullYear()-1900;B[b+24>>2]=a.getUTCDay();B[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),
475
+ 0,1,0,0,0,0))/864E5|0},G:function(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);B[b>>2]=a.getSeconds();B[b+4>>2]=a.getMinutes();B[b+8>>2]=a.getHours();B[b+12>>2]=a.getDate();B[b+16>>2]=a.getMonth();B[b+20>>2]=a.getFullYear()-1900;B[b+24>>2]=a.getDay();var c=a.getFullYear();B[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?ud:td)[a.getMonth()]+a.getDate()-1|0;B[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),
476
+ 0,1)).getTimezoneOffset();B[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},B:(a,b)=>{vd[a]&&(clearTimeout(vd[a].id),delete vd[a]);if(!b)return 0;var c=setTimeout(()=>{delete vd[a];yd(()=>Id(a,performance.now()))},b);vd[a]={id:c,Kd:b};return 0},H:(a,b,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();J[a>>2]=60*Math.max(f,e);B[b>>2]=Number(f!=e);b=g=>{var h=Math.abs(g);return`UTC${0<=g?"-":"+"}${String(Math.floor(h/60)).padStart(2,
477
+ "0")}${String(h%60).padStart(2,"0")}`};a=b(f);b=b(e);e<f?(lb(a,A,c,17),lb(b,A,d,17)):(lb(a,A,d,17),lb(b,A,c,17))},O:function(a,b,c){if(!(0<=a&&3>=a))return 28;Ia[c>>3]=BigInt(Math.round(1E6*(0===a?Date.now():performance.now())));return 0},j:(a,b,c)=>{zd.length=0;for(var d;d=A[b++];){var e=105!=d;e&=112!=d;c+=e&&c%8?4:0;zd.push(112==d?J[c>>2]:106==d?Ia[c>>3]:105==d?B[c>>2]:Ha[c>>3]);c+=e?8:4}return Gd[a](...zd)},N:()=>Date.now(),Q:()=>performance.now(),E:a=>{var b=A.length;a>>>=0;if(2147483648<a)return!1;
478
+ for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-Ma.buffer.byteLength+65535)/65536|0;try{Ma.grow(d);La();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},C:(a,b)=>{var c=0,d=0,e;for(e of Cd()){var f=b+c;J[a+d>>2]=f;c+=lb(e,A,f,Infinity)+1;d+=4}return 0},D:(a,b)=>{var c=Cd();J[a>>2]=c.length;a=0;for(var d of c)a+=kb(d)+1;J[b>>2]=a;return 0},r:function(a){try{var b=Lb(a);if(null===b.cb)throw new M(8);b.Mb&&(b.Mb=
479
+ null);try{b.xa.close&&b.xa.close(b)}catch(c){throw c;}finally{Ab[b.cb]=null}b.cb=null;return 0}catch(c){if("undefined"==typeof bc||"ErrnoError"!==c.name)throw c;return c.bb}},K:function(a,b,c,d){try{a:{var e=Lb(a);a=b;for(var f,g=b=0;g<c;g++){var h=J[a>>2],m=J[a+4>>2];a+=8;var l=e,u=h,y=m,t=f,w=v;if(0>y||0>t)throw new M(28);if(null===l.cb)throw new M(8);if(1===(l.flags&2097155))throw new M(8);if(16384===(l.node.mode&61440))throw new M(31);if(!l.xa.read)throw new M(28);var x="undefined"!=typeof t;
480
+ if(!x)t=l.position;else if(!l.seekable)throw new M(70);var p=l.xa.read(l,w,u,y,t);x||(l.position+=p);var H=p;if(0>H){var F=-1;break a}b+=H;if(H<m)break;"undefined"!=typeof f&&(f+=H)}F=b}J[d>>2]=F;return 0}catch(q){if("undefined"==typeof bc||"ErrnoError"!==q.name)throw q;return q.bb}},I:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var e=Lb(a);$b(e,b,c);Ia[d>>3]=BigInt(e.position);e.Mb&&0===b&&0===c&&(e.Mb=null);return 0}catch(f){if("undefined"==
481
+ typeof bc||"ErrnoError"!==f.name)throw f;return f.bb}},J:function(a,b,c,d){try{a:{var e=Lb(a);a=b;for(var f,g=b=0;g<c;g++){var h=J[a>>2],m=J[a+4>>2];a+=8;var l=e,u=h,y=m,t=f,w=v;if(0>y||0>t)throw new M(28);if(null===l.cb)throw new M(8);if(0===(l.flags&2097155))throw new M(8);if(16384===(l.node.mode&61440))throw new M(31);if(!l.xa.write)throw new M(28);l.seekable&&l.flags&1024&&$b(l,0,2);var x="undefined"!=typeof t;if(!x)t=l.position;else if(!l.seekable)throw new M(70);var p=l.xa.write(l,w,u,y,t,void 0);
482
+ x||(l.position+=p);var H=p;if(0>H){var F=-1;break a}b+=H;if(H<m)break;"undefined"!=typeof f&&(f+=H)}F=b}J[d>>2]=F;return 0}catch(q){if("undefined"==typeof bc||"ErrnoError"!==q.name)throw q;return q.bb}},x:Md,R:function(){return-1<navigator.platform.indexOf("Win")},z:xd,S:function(a,b,c){b=k.HEAP8.subarray(b,b+c);c=new Uint8Array(c);c.set(b);createImageBitmap(new Blob([c])).then(function(d){var e=(new OffscreenCanvas(d.width,d.height)).getContext("2d");e.drawImage(d,0,0);e=e.getImageData(0,0,d.width,
483
+ d.height);var f=e.data.length,g=k.Cc(f);k.pd.set(e.data,g);k.rd(a,d.width,d.height,g,f)}).catch(function(d){d=d.message||"decode failed";var e=k.Gd(d)+1,f=k.Cc(e);k.Jd(d,f,e);k.sd(a,f);k.qd(f)})}};function Md(a,b,c){var d=Ld();try{Rc.get(a)(b,c)}catch(e){Kd(d);if(e!==e+0)throw e;Jd(1,0)}}var Od;
484
+ Od=await (async function(){function a(c){c=Od=c.exports;lc=c.ga;Hd=c.ha;kc=c.ia;k._wasm_image_decode_complete=c.ja;k._wasm_image_decode_error=c.ka;Dd=k._ma_device__on_notification_unlocked=c.la;k._ma_malloc_emscripten=c.ma;k._ma_free_emscripten=c.na;Ed=k._ma_device_process_pcm_frames_capture__webaudio=c.oa;Fd=k._ma_device_process_pcm_frames_playback__webaudio=c.pa;Id=c.ra;Jd=c.sa;Kd=c.ta;Ld=c.ua;Ma=c.ea;Rc=c.qa;La();return Od}var b={a:Nd};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,
485
+ (d,e)=>{c(a(d,e))})});Oa??=k.locateFile?k.locateFile("canvas_advanced.wasm",ma):ma+"canvas_advanced.wasm";return a((await Ra(b)).instance)}());
486
+ (function(){function a(){k.calledRun=!0;if(!ya){Ka=!0;if(!k.noFSInit&&!Cb){var b,c;Cb=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?ac("stdin",b):Yb("/dev/tty","/dev/stdin");c?ac("stdout",null,c):Yb("/dev/tty","/dev/stdout");d?ac("stderr",null,d):Yb("/dev/tty1","/dev/stderr");Zb("/dev/stdin",0);Zb("/dev/stdout",1);Zb("/dev/stderr",1)}Od.fa();Db=!1;Aa?.(k);k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();Ua.push(d)}Ta(Ua)}}
487
+ if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Wa();Ta(Va);k.setStatus?(k.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>k.setStatus(""),1);a()},1)):a()})();Ka?moduleRtn=k:moduleRtn=new Promise((a,b)=>{Aa=a;Ba=b});
488
+ ;return moduleRtn}})();
3748
489
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
3749
490
 
3750
491
 
@@ -3752,7 +493,7 @@ moduleRtn = da;
3752
493
  /* 5 */
3753
494
  /***/ ((module) => {
3754
495
 
3755
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.39.2","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
496
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.40.0","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3756
497
 
3757
498
  /***/ }),
3758
499
  /* 6 */