@rive-app/canvas 2.35.4 → 2.37.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
@@ -13,6 +13,264 @@ return /******/ (() => { // webpackBootstrap
13
13
  /******/ var __webpack_modules__ = ([
14
14
  /* 0 */,
15
15
  /* 1 */
16
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17
+
18
+ __webpack_require__.r(__webpack_exports__);
19
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
+ /* harmony export */ Animation: () => (/* reexport safe */ _Animation__WEBPACK_IMPORTED_MODULE_0__.Animation)
21
+ /* harmony export */ });
22
+ /* harmony import */ var _Animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
23
+
24
+
25
+
26
+ /***/ }),
27
+ /* 2 */
28
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
29
+
30
+ __webpack_require__.r(__webpack_exports__);
31
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32
+ /* harmony export */ Animation: () => (/* binding */ Animation)
33
+ /* harmony export */ });
34
+ /**
35
+ * Represents an animation that can be played on an Artboard.
36
+ * Wraps animations and instances from the runtime and keeps track of playback state.
37
+ *
38
+ * The `Animation` class manages the state and behavior of a single animation instance,
39
+ * including its current time, loop count, and ability to scrub to a specific time.
40
+ *
41
+ * The class provides methods to advance the animation, apply its interpolated keyframe
42
+ * values to the Artboard, and clean up the underlying animation instance when the
43
+ * animation is no longer needed.
44
+ */
45
+ var Animation = /** @class */ (function () {
46
+ /**
47
+ * Constructs a new animation
48
+ * @constructor
49
+ * @param {any} animation: runtime animation object
50
+ * @param {any} instance: runtime animation instance object
51
+ */
52
+ function Animation(animation, artboard, runtime, playing) {
53
+ this.animation = animation;
54
+ this.artboard = artboard;
55
+ this.playing = playing;
56
+ this.loopCount = 0;
57
+ /**
58
+ * The time to which the animation should move to on the next render.
59
+ * If not null, the animation will scrub to this time instead of advancing by the given time.
60
+ */
61
+ this.scrubTo = null;
62
+ this.instance = new runtime.LinearAnimationInstance(animation, artboard);
63
+ }
64
+ Object.defineProperty(Animation.prototype, "name", {
65
+ /**
66
+ * Returns the animation's name
67
+ */
68
+ get: function () {
69
+ return this.animation.name;
70
+ },
71
+ enumerable: false,
72
+ configurable: true
73
+ });
74
+ Object.defineProperty(Animation.prototype, "time", {
75
+ /**
76
+ * Returns the animation's name
77
+ */
78
+ get: function () {
79
+ return this.instance.time;
80
+ },
81
+ /**
82
+ * Sets the animation's current time
83
+ */
84
+ set: function (value) {
85
+ this.instance.time = value;
86
+ },
87
+ enumerable: false,
88
+ configurable: true
89
+ });
90
+ Object.defineProperty(Animation.prototype, "loopValue", {
91
+ /**
92
+ * Returns the animation's loop type
93
+ */
94
+ get: function () {
95
+ return this.animation.loopValue;
96
+ },
97
+ enumerable: false,
98
+ configurable: true
99
+ });
100
+ Object.defineProperty(Animation.prototype, "needsScrub", {
101
+ /**
102
+ * Indicates whether the animation needs to be scrubbed.
103
+ * @returns `true` if the animation needs to be scrubbed, `false` otherwise.
104
+ */
105
+ get: function () {
106
+ return this.scrubTo !== null;
107
+ },
108
+ enumerable: false,
109
+ configurable: true
110
+ });
111
+ /**
112
+ * Advances the animation by the give time. If the animation needs scrubbing,
113
+ * time is ignored and the stored scrub value is used.
114
+ * @param time the time to advance the animation by if no scrubbing required
115
+ */
116
+ Animation.prototype.advance = function (time) {
117
+ if (this.scrubTo === null) {
118
+ this.instance.advance(time);
119
+ }
120
+ else {
121
+ this.instance.time = 0;
122
+ this.instance.advance(this.scrubTo);
123
+ this.scrubTo = null;
124
+ }
125
+ };
126
+ /**
127
+ * Apply interpolated keyframe values to the artboard. This should be called after calling
128
+ * .advance() on an animation instance so that new values are applied to properties.
129
+ *
130
+ * Note: This does not advance the artboard, which updates all objects on the artboard
131
+ * @param mix - Mix value for the animation from 0 to 1
132
+ */
133
+ Animation.prototype.apply = function (mix) {
134
+ this.instance.apply(mix);
135
+ };
136
+ /**
137
+ * Deletes the backing Wasm animation instance; once this is called, this
138
+ * animation is no more.
139
+ */
140
+ Animation.prototype.cleanup = function () {
141
+ this.instance.delete();
142
+ };
143
+ return Animation;
144
+ }());
145
+
146
+
147
+
148
+ /***/ }),
149
+ /* 3 */
150
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
151
+
152
+ __webpack_require__.r(__webpack_exports__);
153
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
154
+ /* harmony export */ RuntimeLoader: () => (/* binding */ RuntimeLoader)
155
+ /* harmony export */ });
156
+ /* harmony import */ var _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
157
+ /* harmony import */ var package_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
158
+
159
+
160
+ // Runtime singleton; use getInstance to provide a callback that returns the
161
+ // Rive runtime
162
+ var RuntimeLoader = /** @class */ (function () {
163
+ // Class is never instantiated
164
+ function RuntimeLoader() {
165
+ }
166
+ // Loads the runtime
167
+ RuntimeLoader.loadRuntime = function () {
168
+ if (RuntimeLoader.enablePerfMarks)
169
+ performance.mark('rive:wasm-init:start');
170
+ _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
171
+ // Loads Wasm bundle
172
+ locateFile: function () { return RuntimeLoader.wasmURL; },
173
+ })
174
+ .then(function (rive) {
175
+ var _a;
176
+ if (RuntimeLoader.enablePerfMarks) {
177
+ performance.mark('rive:wasm-init:end');
178
+ performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');
179
+ }
180
+ RuntimeLoader.runtime = rive;
181
+ // Fire all the callbacks
182
+ while (RuntimeLoader.callBackQueue.length > 0) {
183
+ (_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
184
+ }
185
+ })
186
+ .catch(function (error) {
187
+ // Capture specific error details
188
+ var errorDetails = {
189
+ message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error",
190
+ type: (error === null || error === void 0 ? void 0 : error.name) || "Error",
191
+ // Some browsers may provide additional WebAssembly-specific details
192
+ wasmError: error instanceof WebAssembly.CompileError ||
193
+ error instanceof WebAssembly.RuntimeError,
194
+ originalError: error,
195
+ };
196
+ // Log detailed error for debugging
197
+ console.debug("Rive WASM load error details:", errorDetails);
198
+ // In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
199
+ // This `rive_fallback.wasm` is compiled to support older architecture.
200
+ // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
201
+ var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
202
+ if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
203
+ console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
204
+ RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
205
+ RuntimeLoader.loadRuntime();
206
+ }
207
+ else {
208
+ var errorMessage = [
209
+ "Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
210
+ "Possible reasons:",
211
+ "- Network connection is down",
212
+ "- WebAssembly is not supported in this environment",
213
+ "- The WASM file is corrupted or incompatible",
214
+ "\nError details:",
215
+ "- Type: ".concat(errorDetails.type),
216
+ "- Message: ".concat(errorDetails.message),
217
+ "- WebAssembly-specific error: ".concat(errorDetails.wasmError),
218
+ "\nTo resolve, you may need to:",
219
+ "1. Check your network connection",
220
+ "2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
221
+ "3. Call RuntimeLoader.loadRuntime() again",
222
+ ].join("\n");
223
+ console.error(errorMessage);
224
+ }
225
+ });
226
+ };
227
+ // Provides a runtime instance via a callback
228
+ RuntimeLoader.getInstance = function (callback) {
229
+ // If it's not loading, start loading runtime
230
+ if (!RuntimeLoader.isLoading) {
231
+ RuntimeLoader.isLoading = true;
232
+ RuntimeLoader.loadRuntime();
233
+ }
234
+ if (!RuntimeLoader.runtime) {
235
+ RuntimeLoader.callBackQueue.push(callback);
236
+ }
237
+ else {
238
+ callback(RuntimeLoader.runtime);
239
+ }
240
+ };
241
+ // Provides a runtime instance via a promise
242
+ RuntimeLoader.awaitInstance = function () {
243
+ return new Promise(function (resolve) {
244
+ return RuntimeLoader.getInstance(function (rive) { return resolve(rive); });
245
+ });
246
+ };
247
+ // Manually sets the wasm url
248
+ RuntimeLoader.setWasmUrl = function (url) {
249
+ RuntimeLoader.wasmURL = url;
250
+ };
251
+ // Gets the current wasm url
252
+ RuntimeLoader.getWasmUrl = function () {
253
+ return RuntimeLoader.wasmURL;
254
+ };
255
+ // Flag to indicate that loading has started/completed
256
+ RuntimeLoader.isLoading = false;
257
+ // List of callbacks for the runtime that come in while loading
258
+ RuntimeLoader.callBackQueue = [];
259
+ // Path to the Wasm file; default path works for testing only;
260
+ // if embedded wasm is used then this is never used.
261
+ RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
262
+ /**
263
+ * When true, performance.mark / performance.measure entries are emitted for
264
+ * WASM initialization.
265
+ */
266
+ RuntimeLoader.enablePerfMarks = false;
267
+ return RuntimeLoader;
268
+ }());
269
+
270
+
271
+
272
+ /***/ }),
273
+ /* 4 */
16
274
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17
275
 
18
276
  __webpack_require__.r(__webpack_exports__);
@@ -27,11 +285,11 @@ var Rive = (() => {
27
285
  function(moduleArg = {}) {
28
286
  var moduleRtn;
29
287
 
30
- var m = moduleArg, ba, ca, da = new Promise((a, b) => {
31
- ba = a;
32
- ca = b;
33
- }), ea = "object" == typeof window, fa = "function" == typeof importScripts;
34
- function ia() {
288
+ var m = moduleArg, ca, da, ea = new Promise((a, b) => {
289
+ ca = a;
290
+ da = b;
291
+ }), fa = "object" == typeof window, ia = "function" == typeof importScripts;
292
+ function ja() {
35
293
  function a(g) {
36
294
  const k = d;
37
295
  c = b = 0;
@@ -77,7 +335,7 @@ function ia() {
77
335
  this.ob = function() {
78
336
  };
79
337
  }
80
- function ja(a) {
338
+ function ka(a) {
81
339
  console.assert(!0);
82
340
  const b = new Map();
83
341
  let c = -Infinity;
@@ -92,71 +350,77 @@ function ja(a) {
92
350
  return c << a;
93
351
  };
94
352
  }
95
- const ka = m.onRuntimeInitialized;
353
+ const la = m.onRuntimeInitialized;
96
354
  m.onRuntimeInitialized = function() {
97
- ka && ka();
355
+ la && la();
98
356
  let a = m.decodeAudio;
99
- m.decodeAudio = function(e, f) {
100
- e = a(e);
101
- f(e);
357
+ m.decodeAudio = function(f, g) {
358
+ f = a(f);
359
+ g(f);
102
360
  };
103
361
  let b = m.decodeFont;
104
- m.decodeFont = function(e, f) {
105
- e = b(e);
106
- f(e);
362
+ m.decodeFont = function(f, g) {
363
+ f = b(f);
364
+ g(f);
365
+ };
366
+ let c = m.setFallbackFontCb;
367
+ m.setFallbackFontCallback = "function" === typeof c ? function(f) {
368
+ c(f);
369
+ } : function() {
370
+ console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.");
107
371
  };
108
- const c = m.FileAssetLoader;
109
- m.ptrToAsset = e => {
110
- let f = m.ptrToFileAsset(e);
111
- return f.isImage ? m.ptrToImageAsset(e) : f.isFont ? m.ptrToFontAsset(e) : f.isAudio ? m.ptrToAudioAsset(e) : f;
372
+ const d = m.FileAssetLoader;
373
+ m.ptrToAsset = f => {
374
+ let g = m.ptrToFileAsset(f);
375
+ return g.isImage ? m.ptrToImageAsset(f) : g.isFont ? m.ptrToFontAsset(f) : g.isAudio ? m.ptrToAudioAsset(f) : g;
112
376
  };
113
- m.CustomFileAssetLoader = c.extend("CustomFileAssetLoader", {__construct:function({loadContents:e}) {
377
+ m.CustomFileAssetLoader = d.extend("CustomFileAssetLoader", {__construct:function({loadContents:f}) {
114
378
  this.__parent.__construct.call(this);
115
- this.Eb = e;
116
- }, loadContents:function(e, f) {
117
- e = m.ptrToAsset(e);
118
- return this.Eb(e, f);
379
+ this.Eb = f;
380
+ }, loadContents:function(f, g) {
381
+ f = m.ptrToAsset(f);
382
+ return this.Eb(f, g);
119
383
  },});
120
- m.CDNFileAssetLoader = c.extend("CDNFileAssetLoader", {__construct:function() {
384
+ m.CDNFileAssetLoader = d.extend("CDNFileAssetLoader", {__construct:function() {
121
385
  this.__parent.__construct.call(this);
122
- }, loadContents:function(e) {
123
- let f = m.ptrToAsset(e);
124
- e = f.cdnUuid;
125
- if ("" === e) {
386
+ }, loadContents:function(f) {
387
+ let g = m.ptrToAsset(f);
388
+ f = g.cdnUuid;
389
+ if ("" === f) {
126
390
  return !1;
127
391
  }
128
- (function(g, k) {
129
- var p = new XMLHttpRequest();
130
- p.responseType = "arraybuffer";
131
- p.onreadystatechange = function() {
132
- 4 == p.readyState && 200 == p.status && k(p);
392
+ (function(k, p) {
393
+ var n = new XMLHttpRequest();
394
+ n.responseType = "arraybuffer";
395
+ n.onreadystatechange = function() {
396
+ 4 == n.readyState && 200 == n.status && p(n);
133
397
  };
134
- p.open("GET", g, !0);
135
- p.send(null);
136
- })(f.cdnBaseUrl + "/" + e, g => {
137
- f.decode(new Uint8Array(g.response));
398
+ n.open("GET", k, !0);
399
+ n.send(null);
400
+ })(g.cdnBaseUrl + "/" + f, k => {
401
+ g.decode(new Uint8Array(k.response));
138
402
  });
139
403
  return !0;
140
404
  },});
141
- m.FallbackFileAssetLoader = c.extend("FallbackFileAssetLoader", {__construct:function() {
405
+ m.FallbackFileAssetLoader = d.extend("FallbackFileAssetLoader", {__construct:function() {
142
406
  this.__parent.__construct.call(this);
143
407
  this.kb = [];
144
- }, addLoader:function(e) {
145
- this.kb.push(e);
146
- }, loadContents:function(e, f) {
147
- for (let g of this.kb) {
148
- if (g.loadContents(e, f)) {
408
+ }, addLoader:function(f) {
409
+ this.kb.push(f);
410
+ }, loadContents:function(f, g) {
411
+ for (let k of this.kb) {
412
+ if (k.loadContents(f, g)) {
149
413
  return !0;
150
414
  }
151
415
  }
152
416
  return !1;
153
417
  },});
154
- let d = m.computeAlignment;
155
- m.computeAlignment = function(e, f, g, k, p = 1.0) {
156
- return d.call(this, e, f, g, k, p);
418
+ let e = m.computeAlignment;
419
+ m.computeAlignment = function(f, g, k, p, n = 1.0) {
420
+ return e.call(this, f, g, k, p, n);
157
421
  };
158
422
  };
159
- const la = "createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "), ma = new function() {
423
+ const ma = "createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "), na = new function() {
160
424
  function a() {
161
425
  if (!b) {
162
426
  var l = document.createElement("canvas"), u = {alpha:1, depth:0, stencil:0, antialias:0, premultipliedAlpha:1, preserveDrawingBuffer:0, powerPreference:"high-performance", failIfMajorPerformanceCaveat:0, enableExtensionsByDefault:1, explicitSwapControl:1, renderViaOffscreenBackBuffer:1,};
@@ -253,7 +517,7 @@ const la = "createConicGradient createImageData createLinearGradient createPatte
253
517
  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);
254
518
  return u;
255
519
  };
256
- const n = new ja(8), t = new ja(8), x = new ja(10), y = new ja(10);
520
+ const n = new ka(8), t = new ka(8), x = new ka(10), y = new ka(10);
257
521
  this.Nb = function(l, u, r, D, I) {
258
522
  if (a()) {
259
523
  var w = n.push(l), L = t.push(u);
@@ -266,7 +530,7 @@ const la = "createConicGradient createImageData createLinearGradient createPatte
266
530
  b.clearColor(0, 0, 0, 0);
267
531
  b.clear(b.COLOR_BUFFER_BIT);
268
532
  b.enable(b.SCISSOR_TEST);
269
- r.sort((K, Z) => Z.vb - K.vb);
533
+ r.sort((K, aa) => aa.vb - K.vb);
270
534
  w = x.push(D);
271
535
  g != w && (b.bufferData(b.ARRAY_BUFFER, 8 * w, b.DYNAMIC_DRAW), g = w);
272
536
  w = 0;
@@ -292,9 +556,9 @@ const la = "createConicGradient createImageData createLinearGradient createPatte
292
556
  K.image.Ja != qa && (b.bindTexture(b.TEXTURE_2D, K.image.Ia || null), qa = K.image.Ja);
293
557
  K.hc ? (b.scissor(K.Za, L - K.$a - K.jb, K.uc, K.jb), V = !0) : V && (b.scissor(0, L - u, l, u), V = !1);
294
558
  r = 2 / l;
295
- const Z = -2 / u;
296
- b.uniform4f(e, K.ha[0] * r * K.Aa, K.ha[1] * Z * K.Ba, K.ha[2] * r * K.Aa, K.ha[3] * Z * K.Ba);
297
- b.uniform2f(f, K.ha[4] * r * K.Aa + r * (K.Za - K.cc * K.Aa) - 1, K.ha[5] * Z * K.Ba + Z * (K.$a - K.dc * K.Ba) + 1);
559
+ const aa = -2 / u;
560
+ b.uniform4f(e, K.ha[0] * r * K.Aa, K.ha[1] * aa * K.Ba, K.ha[2] * r * K.Aa, K.ha[3] * aa * K.Ba);
561
+ b.uniform2f(f, K.ha[4] * r * K.Aa + r * (K.Za - K.cc * K.Aa) - 1, K.ha[5] * aa * K.Ba + aa * (K.$a - K.dc * K.Ba) + 1);
298
562
  b.vertexAttribPointer(0, 2, b.FLOAT, !1, 0, w);
299
563
  b.vertexAttribPointer(1, 2, b.FLOAT, !1, 0, w + 4 * D);
300
564
  b.drawElements(b.TRIANGLES, K.indices.length, b.UNSIGNED_SHORT, R);
@@ -309,7 +573,7 @@ const la = "createConicGradient createImageData createLinearGradient createPatte
309
573
  this.canvas = function() {
310
574
  return a() && b.canvas;
311
575
  };
312
- }(), na = m.onRuntimeInitialized;
576
+ }(), oa = m.onRuntimeInitialized;
313
577
  m.onRuntimeInitialized = function() {
314
578
  function a(q) {
315
579
  switch(q) {
@@ -351,7 +615,7 @@ m.onRuntimeInitialized = function() {
351
615
  return "rgba(" + ((16711680 & q) >>> 16) + "," + ((65280 & q) >>> 8) + "," + ((255 & q) >>> 0) + "," + ((4278190080 & q) >>> 24) / 255 + ")";
352
616
  }
353
617
  function c() {
354
- 0 < L.length && (ma.Nb(w.drawWidth(), w.drawHeight(), L, R, V), L = [], V = R = 0, w.reset(512, 512));
618
+ 0 < L.length && (na.Nb(w.drawWidth(), w.drawHeight(), L, R, V), L = [], V = R = 0, w.reset(512, 512));
355
619
  for (const q of I) {
356
620
  for (const v of q.I) {
357
621
  v();
@@ -360,7 +624,7 @@ m.onRuntimeInitialized = function() {
360
624
  }
361
625
  I.clear();
362
626
  }
363
- na && na();
627
+ oa && oa();
364
628
  var d = m.RenderPaintStyle;
365
629
  const e = m.RenderPath, f = m.RenderPaint, g = m.Renderer, k = m.StrokeCap, p = m.StrokeJoin, n = m.BlendMode, t = d.fill, x = d.stroke, y = m.FillRule.evenOdd;
366
630
  let l = 1;
@@ -371,7 +635,7 @@ m.onRuntimeInitialized = function() {
371
635
  this.la = q;
372
636
  this.wa = v;
373
637
  }, __destruct:function() {
374
- this.Ia && (ma.Kb(this.Ia), URL.revokeObjectURL(this.Wa));
638
+ this.Ia && (na.Kb(this.Ia), URL.revokeObjectURL(this.Wa));
375
639
  this.__parent.__destruct.call(this);
376
640
  }, decode:function(q) {
377
641
  var v = this;
@@ -380,7 +644,7 @@ m.onRuntimeInitialized = function() {
380
644
  v.Wa = URL.createObjectURL(new Blob([q], {type:"image/png",}));
381
645
  J.onload = function() {
382
646
  v.Db = J;
383
- v.Ia = ma.Jb(J);
647
+ v.Ia = na.Jb(J);
384
648
  v.size(J.width, J.height);
385
649
  v.la && v.la(v);
386
650
  };
@@ -462,7 +726,7 @@ m.onRuntimeInitialized = function() {
462
726
  var T = E.eb;
463
727
  G = E.Qa;
464
728
  E.ac ? (E = ha - H, T -= X, H = q.createRadialGradient(H, X, 0, H, X, Math.sqrt(E * E + T * T))) : H = q.createLinearGradient(H, X, ha, T);
465
- for (let Y = 0, aa = G.length; Y < aa; Y++) {
729
+ for (let Y = 0, ba = G.length; Y < ba; Y++) {
466
730
  E = G[Y], H.addColorStop(E.stop, b(E.color));
467
731
  }
468
732
  this.Xa = H;
@@ -531,37 +795,37 @@ m.onRuntimeInitialized = function() {
531
795
  for (let G = 0; 6 > G; ++G) {
532
796
  q[G] = v[J + G];
533
797
  }
534
- }, _drawImageMesh:function(q, v, J, G, A, H, E, M, ya, T, X, ha, Y, aa) {
798
+ }, _drawImageMesh:function(q, v, J, G, A, H, E, M, ya, T, X, ha, Y, ba) {
535
799
  let ac, bc, cc;
536
800
  try {
537
801
  ac = m.HEAPF32.slice(A >> 2, (A >> 2) + H), bc = m.HEAPF32.slice(E >> 2, (E >> 2) + M), cc = m.HEAPU16.slice(ya >> 1, (ya >> 1) + T);
538
- } catch (sb) {
802
+ } catch (tb) {
539
803
  console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");
540
804
  return;
541
805
  }
542
806
  v = this.B.canvas.width;
543
807
  A = this.B.canvas.height;
544
808
  E = Y - X;
545
- M = aa - ha;
809
+ M = ba - ha;
546
810
  X = Math.max(X, 0);
547
811
  ha = Math.max(ha, 0);
548
812
  Y = Math.min(Y, v);
549
- aa = Math.min(aa, A);
550
- const Ga = Y - X, Ha = aa - ha;
813
+ ba = Math.min(ba, A);
814
+ const Ga = Y - X, Ha = ba - ha;
551
815
  console.assert(Ga <= Math.min(E, v));
552
816
  console.assert(Ha <= Math.min(M, A));
553
817
  if (!(0 >= Ga || 0 >= Ha)) {
554
818
  Y = Ga < E || Ha < M;
555
- v = aa = 1;
556
- var ra = Math.ceil(Ga * aa), sa = Math.ceil(Ha * v);
557
- A = ma.bc();
558
- ra > A && (aa *= A / ra, ra = A);
819
+ v = ba = 1;
820
+ var ra = Math.ceil(Ga * ba), sa = Math.ceil(Ha * v);
821
+ A = na.bc();
822
+ ra > A && (ba *= A / ra, ra = A);
559
823
  sa > A && (v *= A / sa, sa = A);
560
824
  w || (w = new m.DynamicRectanizer(A), w.reset(512, 512));
561
825
  A = w.addRect(ra, sa);
562
826
  0 > A && (c(), I.add(this), A = w.addRect(ra, sa), console.assert(0 <= A));
563
827
  var dc = A & 65535, ec = A >> 16;
564
- L.push({ha:this.T.slice(this.T.length - 6), image:q, Za:dc, $a:ec, cc:X, dc:ha, uc:ra, jb:sa, Aa:aa, Ba:v, Ta:ac, Bb:bc, indices:cc, hc:Y, vb:q.Ja << 1 | (Y ? 1 : 0),});
828
+ L.push({ha:this.T.slice(this.T.length - 6), image:q, Za:dc, $a:ec, cc:X, dc:ha, uc:ra, jb:sa, Aa:ba, Ba:v, Ta:ac, Bb:bc, indices:cc, hc:Y, vb:q.Ja << 1 | (Y ? 1 : 0),});
565
829
  R += H;
566
830
  V += T;
567
831
  var za = this.B, rd = a(J), sd = Math.max(0, G * this.G[this.G.length - 1]);
@@ -570,8 +834,8 @@ m.onRuntimeInitialized = function() {
570
834
  za.resetTransform();
571
835
  za.globalCompositeOperation = rd;
572
836
  za.globalAlpha = sd;
573
- const sb = ma.canvas();
574
- sb && za.drawImage(sb, dc, ec, ra, sa, X, ha, Ga, Ha);
837
+ const tb = na.canvas();
838
+ tb && za.drawImage(tb, dc, ec, ra, sa, X, ha, Ga, Ha);
575
839
  za.restore();
576
840
  });
577
841
  }
@@ -593,7 +857,7 @@ m.onRuntimeInitialized = function() {
593
857
  };
594
858
  }
595
859
  if ("function" === typeof J[A]) {
596
- if (-1 < la.indexOf(A)) {
860
+ if (-1 < ma.indexOf(A)) {
597
861
  throw Error("RiveException: Method call to '" + A + "()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");
598
862
  }
599
863
  return function(...H) {
@@ -617,7 +881,7 @@ m.onRuntimeInitialized = function() {
617
881
  }, makeRenderPath:function() {
618
882
  return new r();
619
883
  }, makeRenderImage:function() {
620
- let q = Z;
884
+ let q = aa;
621
885
  return new u({wa:() => {
622
886
  q.total++;
623
887
  }, la:() => {
@@ -628,25 +892,25 @@ m.onRuntimeInitialized = function() {
628
892
  }
629
893
  },});
630
894
  },};
631
- let K = m.load, Z = null;
895
+ let K = m.load, aa = null;
632
896
  m.load = function(q, v, J = !0) {
633
897
  const G = new m.FallbackFileAssetLoader();
634
898
  void 0 !== v && G.addLoader(v);
635
899
  J && (v = new m.CDNFileAssetLoader(), G.addLoader(v));
636
900
  return new Promise(function(A) {
637
901
  let H = null;
638
- Z = {total:0, loaded:0, ready:function() {
902
+ aa = {total:0, loaded:0, ready:function() {
639
903
  A(H);
640
904
  },};
641
905
  H = K(q, G);
642
- 0 == Z.total && A(H);
906
+ 0 == aa.total && A(H);
643
907
  });
644
908
  };
645
909
  let td = m.RendererWrapper.prototype.align;
646
910
  m.RendererWrapper.prototype.align = function(q, v, J, G, A = 1.0) {
647
911
  td.call(this, q, v, J, G, A);
648
912
  };
649
- d = new ia();
913
+ d = new ja();
650
914
  m.requestAnimationFrame = d.requestAnimationFrame.bind(d);
651
915
  m.cancelAnimationFrame = d.cancelAnimationFrame.bind(d);
652
916
  m.enableFPSCounter = d.Ob.bind(d);
@@ -657,16 +921,16 @@ m.onRuntimeInitialized = function() {
657
921
  w && w.delete();
658
922
  };
659
923
  };
660
- var oa = Object.assign({}, m), pa = "./this.program", ta = "", ua, va;
661
- if (ea || fa) {
662
- fa ? 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), fa && (va = a => {
924
+ var pa = Object.assign({}, m), ta = "./this.program", ua = "", va, wa;
925
+ if (fa || ia) {
926
+ ia ? ua = self.location.href : "undefined" != typeof document && document.currentScript && (ua = document.currentScript.src), _scriptName && (ua = _scriptName), ua.startsWith("blob:") ? ua = "" : ua = ua.substr(0, ua.replace(/[?#].*/, "").lastIndexOf("/") + 1), ia && (wa = a => {
663
927
  var b = new XMLHttpRequest();
664
928
  b.open("GET", a, !1);
665
929
  b.responseType = "arraybuffer";
666
930
  b.send(null);
667
931
  return new Uint8Array(b.response);
668
- }), ua = (a, b, c) => {
669
- if (wa(a)) {
932
+ }), va = (a, b, c) => {
933
+ if (xa(a)) {
670
934
  var d = new XMLHttpRequest();
671
935
  d.open("GET", a, !0);
672
936
  d.responseType = "arraybuffer";
@@ -680,75 +944,75 @@ if (ea || fa) {
680
944
  }
681
945
  };
682
946
  }
683
- var xa = m.print || console.log.bind(console), Aa = m.printErr || console.error.bind(console);
684
- Object.assign(m, oa);
685
- oa = null;
686
- m.thisProgram && (pa = m.thisProgram);
687
- var Ba;
688
- m.wasmBinary && (Ba = m.wasmBinary);
689
- var Ca, Da = !1, z, B, Ea, Fa, C, F, Ia, Ja;
690
- function Ka() {
691
- var a = Ca.buffer;
947
+ var Aa = m.print || console.log.bind(console), Ba = m.printErr || console.error.bind(console);
948
+ Object.assign(m, pa);
949
+ pa = null;
950
+ m.thisProgram && (ta = m.thisProgram);
951
+ var Ca;
952
+ m.wasmBinary && (Ca = m.wasmBinary);
953
+ var Da, Ea = !1, z, B, Fa, Ia, C, F, Ja, Ka;
954
+ function La() {
955
+ var a = Da.buffer;
692
956
  m.HEAP8 = z = new Int8Array(a);
693
- m.HEAP16 = Ea = new Int16Array(a);
957
+ m.HEAP16 = Fa = new Int16Array(a);
694
958
  m.HEAPU8 = B = new Uint8Array(a);
695
- m.HEAPU16 = Fa = new Uint16Array(a);
959
+ m.HEAPU16 = Ia = new Uint16Array(a);
696
960
  m.HEAP32 = C = new Int32Array(a);
697
961
  m.HEAPU32 = F = new Uint32Array(a);
698
- m.HEAPF32 = Ia = new Float32Array(a);
699
- m.HEAPF64 = Ja = new Float64Array(a);
962
+ m.HEAPF32 = Ja = new Float32Array(a);
963
+ m.HEAPF64 = Ka = new Float64Array(a);
700
964
  }
701
- var La = [], Ma = [], Na = [];
702
- function Oa() {
965
+ var Ma = [], Na = [], Oa = [];
966
+ function Pa() {
703
967
  var a = m.preRun.shift();
704
- La.unshift(a);
968
+ Ma.unshift(a);
705
969
  }
706
- var Pa = 0, Qa = null, Ra = null;
707
- function Sa(a) {
970
+ var Qa = 0, Ra = null, Sa = null;
971
+ function Ta(a) {
708
972
  m.onAbort?.(a);
709
973
  a = "Aborted(" + a + ")";
710
- Aa(a);
711
- Da = !0;
974
+ Ba(a);
975
+ Ea = !0;
712
976
  a = new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info.");
713
- ca(a);
977
+ da(a);
714
978
  throw a;
715
979
  }
716
- var Ta = a => a.startsWith("data:application/octet-stream;base64,"), wa = a => a.startsWith("file://"), Ua;
717
- function Va(a) {
718
- if (a == Ua && Ba) {
719
- return new Uint8Array(Ba);
980
+ var Ua = a => a.startsWith("data:application/octet-stream;base64,"), xa = a => a.startsWith("file://"), Va;
981
+ function Wa(a) {
982
+ if (a == Va && Ca) {
983
+ return new Uint8Array(Ca);
720
984
  }
721
- if (va) {
722
- return va(a);
985
+ if (wa) {
986
+ return wa(a);
723
987
  }
724
988
  throw "both async and sync fetching of the wasm failed";
725
989
  }
726
- function Wa(a) {
727
- return Ba ? Promise.resolve().then(() => Va(a)) : new Promise((b, c) => {
728
- ua(a, d => b(new Uint8Array(d)), () => {
990
+ function Xa(a) {
991
+ return Ca ? Promise.resolve().then(() => Wa(a)) : new Promise((b, c) => {
992
+ va(a, d => b(new Uint8Array(d)), () => {
729
993
  try {
730
- b(Va(a));
994
+ b(Wa(a));
731
995
  } catch (d) {
732
996
  c(d);
733
997
  }
734
998
  });
735
999
  });
736
1000
  }
737
- function Xa(a, b, c) {
738
- return Wa(a).then(d => WebAssembly.instantiate(d, b)).then(c, d => {
739
- Aa(`failed to asynchronously prepare wasm: ${d}`);
740
- Sa(d);
1001
+ function Ya(a, b, c) {
1002
+ return Xa(a).then(d => WebAssembly.instantiate(d, b)).then(c, d => {
1003
+ Ba(`failed to asynchronously prepare wasm: ${d}`);
1004
+ Ta(d);
741
1005
  });
742
1006
  }
743
- function Ya(a, b) {
744
- var c = Ua;
745
- 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) {
746
- Aa(`wasm streaming compile failed: ${e}`);
747
- Aa("falling back to ArrayBuffer instantiation");
748
- return Xa(c, a, b);
1007
+ function Za(a, b) {
1008
+ var c = Va;
1009
+ return Ca || "function" != typeof WebAssembly.instantiateStreaming || Ua(c) || xa(c) || "function" != typeof fetch ? Ya(c, a, b) : fetch(c, {credentials:"same-origin"}).then(d => WebAssembly.instantiateStreaming(d, a).then(b, function(e) {
1010
+ Ba(`wasm streaming compile failed: ${e}`);
1011
+ Ba("falling back to ArrayBuffer instantiation");
1012
+ return Ya(c, a, b);
749
1013
  }));
750
1014
  }
751
- var Za, $a, db = {478498:(a, b, c, d, e) => {
1015
+ var $a, ab, eb = {479682:(a, b, c, d, e) => {
752
1016
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
753
1017
  return 0;
754
1018
  }
@@ -796,7 +1060,7 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
796
1060
  for (var g = 0; g < f.D.length; ++g) {
797
1061
  var k = f.D[g];
798
1062
  null != k && null != k.L && k.state === f.ga.wb && k.L.resume().then(() => {
799
- ab(k.pb);
1063
+ bb(k.pb);
800
1064
  }, p => {
801
1065
  console.error("Failed to resume audiocontext", p);
802
1066
  });
@@ -811,11 +1075,11 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
811
1075
  }
812
1076
  window.h.za += 1;
813
1077
  return 1;
814
- }, 480676:() => {
1078
+ }, 481860:() => {
815
1079
  "undefined" !== typeof window.h && (window.h.Sa.map(function(a) {
816
1080
  document.removeEventListener(a, window.h.unlock, !0);
817
1081
  }), --window.h.za, 0 === window.h.za && delete window.h);
818
- }, 480980:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 481084:() => {
1082
+ }, 482164:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 482268:() => {
819
1083
  try {
820
1084
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
821
1085
  a.close();
@@ -823,7 +1087,7 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
823
1087
  } catch (c) {
824
1088
  return 0;
825
1089
  }
826
- }, 481255:(a, b, c, d, e, f) => {
1090
+ }, 482439:(a, b, c, d, e, f) => {
827
1091
  if ("undefined" === typeof window.h) {
828
1092
  return -1;
829
1093
  }
@@ -837,7 +1101,7 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
837
1101
  g.Z = g.L.createScriptProcessor(d, c, b);
838
1102
  g.Z.onaudioprocess = function(p) {
839
1103
  if (null == g.ra || 0 == g.ra.length) {
840
- g.ra = new Float32Array(Ia.buffer, e, d * b);
1104
+ g.ra = new Float32Array(Ja.buffer, e, d * b);
841
1105
  }
842
1106
  if (a == window.h.J.capture || a == window.h.J.Ka) {
843
1107
  for (var n = 0; n < b; n += 1) {
@@ -845,10 +1109,10 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
845
1109
  x[y * b + n] = t[y];
846
1110
  }
847
1111
  }
848
- bb(f, d, e);
1112
+ cb(f, d, e);
849
1113
  }
850
1114
  if (a == window.h.J.xa || a == window.h.J.Ka) {
851
- for (cb(f, d, e), n = 0; n < p.outputBuffer.numberOfChannels; ++n) {
1115
+ for (db(f, d, e), n = 0; n < p.outputBuffer.numberOfChannels; ++n) {
852
1116
  for (t = p.outputBuffer.getChannelData(n), x = g.ra, y = 0; y < d; y += 1) {
853
1117
  t[y] = x[y * b + n];
854
1118
  }
@@ -869,7 +1133,7 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
869
1133
  a == window.h.J.xa && g.Z.connect(g.L.destination);
870
1134
  g.pb = f;
871
1135
  return window.h.sc(g);
872
- }, 484132:a => window.h.qa(a).L.sampleRate, 484205:a => {
1136
+ }, 485316:a => window.h.qa(a).L.sampleRate, 485389:a => {
873
1137
  a = window.h.qa(a);
874
1138
  void 0 !== a.Z && (a.Z.onaudioprocess = function() {
875
1139
  }, a.Z.disconnect(), a.Z = void 0);
@@ -877,27 +1141,27 @@ var Za, $a, db = {478498:(a, b, c, d, e) => {
877
1141
  a.L.close();
878
1142
  a.L = void 0;
879
1143
  a.pb = void 0;
880
- }, 484605:a => {
1144
+ }, 485789:a => {
881
1145
  window.h.Ab(a);
882
- }, 484655:a => {
1146
+ }, 485839:a => {
883
1147
  a = window.h.qa(a);
884
1148
  a.L.resume();
885
1149
  a.state = window.h.ga.wb;
886
- }, 484794:a => {
1150
+ }, 485978:a => {
887
1151
  a = window.h.qa(a);
888
1152
  a.L.suspend();
889
1153
  a.state = window.h.ga.stopped;
890
- }}, eb = a => {
1154
+ }}, fb = a => {
891
1155
  for (; 0 < a.length;) {
892
1156
  a.shift()(m);
893
1157
  }
894
1158
  };
895
- function fb() {
896
- var a = C[+gb >> 2];
897
- gb += 4;
1159
+ function gb() {
1160
+ var a = C[+hb >> 2];
1161
+ hb += 4;
898
1162
  return a;
899
1163
  }
900
- var hb = (a, b) => {
1164
+ var ib = (a, b) => {
901
1165
  for (var c = 0, d = a.length - 1; 0 <= d; d--) {
902
1166
  var e = a[d];
903
1167
  "." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--);
@@ -908,12 +1172,12 @@ var hb = (a, b) => {
908
1172
  }
909
1173
  }
910
1174
  return a;
911
- }, ib = a => {
1175
+ }, jb = a => {
912
1176
  var b = "/" === a.charAt(0), c = "/" === a.substr(-1);
913
- (a = hb(a.split("/").filter(d => !!d), !b).join("/")) || b || (a = ".");
1177
+ (a = ib(a.split("/").filter(d => !!d), !b).join("/")) || b || (a = ".");
914
1178
  a && c && (a += "/");
915
1179
  return (b ? "/" : "") + a;
916
- }, jb = a => {
1180
+ }, kb = a => {
917
1181
  var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
918
1182
  a = b[0];
919
1183
  b = b[1];
@@ -922,20 +1186,20 @@ var hb = (a, b) => {
922
1186
  }
923
1187
  b &&= b.substr(0, b.length - 1);
924
1188
  return a + b;
925
- }, kb = a => {
1189
+ }, lb = a => {
926
1190
  if ("/" === a) {
927
1191
  return "/";
928
1192
  }
929
- a = ib(a);
1193
+ a = jb(a);
930
1194
  a = a.replace(/\/$/, "");
931
1195
  var b = a.lastIndexOf("/");
932
1196
  return -1 === b ? a : a.substr(b + 1);
933
- }, lb = () => {
1197
+ }, mb = () => {
934
1198
  if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) {
935
1199
  return a => crypto.getRandomValues(a);
936
1200
  }
937
- Sa("initRandomDevice");
938
- }, mb = a => (mb = lb())(a), nb = (...a) => {
1201
+ Ta("initRandomDevice");
1202
+ }, nb = a => (nb = mb())(a), ob = (...a) => {
939
1203
  for (var b = "", c = !1, d = a.length - 1; -1 <= d && !c; d--) {
940
1204
  c = 0 <= d ? a[d] : "/";
941
1205
  if ("string" != typeof c) {
@@ -947,15 +1211,15 @@ var hb = (a, b) => {
947
1211
  b = c + "/" + b;
948
1212
  c = "/" === c.charAt(0);
949
1213
  }
950
- b = hb(b.split("/").filter(e => !!e), !c).join("/");
1214
+ b = ib(b.split("/").filter(e => !!e), !c).join("/");
951
1215
  return (c ? "/" : "") + b || ".";
952
- }, ob = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, pb = (a, b, c) => {
1216
+ }, pb = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, qb = (a, b, c) => {
953
1217
  var d = b + c;
954
1218
  for (c = b; a[c] && !(c >= d);) {
955
1219
  ++c;
956
1220
  }
957
- if (16 < c - b && a.buffer && ob) {
958
- return ob.decode(a.subarray(b, c));
1221
+ if (16 < c - b && a.buffer && pb) {
1222
+ return pb.decode(a.subarray(b, c));
959
1223
  }
960
1224
  for (d = ""; b < c;) {
961
1225
  var e = a[b++];
@@ -973,13 +1237,13 @@ var hb = (a, b) => {
973
1237
  }
974
1238
  }
975
1239
  return d;
976
- }, qb = [], rb = a => {
1240
+ }, rb = [], sb = a => {
977
1241
  for (var b = 0, c = 0; c < a.length; ++c) {
978
1242
  var d = a.charCodeAt(c);
979
1243
  127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3;
980
1244
  }
981
1245
  return b;
982
- }, tb = (a, b, c, d) => {
1246
+ }, ub = (a, b, c, d) => {
983
1247
  if (!(0 < d)) {
984
1248
  return 0;
985
1249
  }
@@ -1023,19 +1287,19 @@ var hb = (a, b) => {
1023
1287
  b[c] = 0;
1024
1288
  return c - e;
1025
1289
  };
1026
- function ub(a, b) {
1027
- var c = Array(rb(a) + 1);
1028
- a = tb(a, c, 0, c.length);
1290
+ function vb(a, b) {
1291
+ var c = Array(sb(a) + 1);
1292
+ a = ub(a, c, 0, c.length);
1029
1293
  b && (c.length = a);
1030
1294
  return c;
1031
1295
  }
1032
- var vb = [];
1033
- function wb(a, b) {
1034
- vb[a] = {input:[], H:[], W:b};
1035
- xb(a, yb);
1296
+ var wb = [];
1297
+ function xb(a, b) {
1298
+ wb[a] = {input:[], H:[], W:b};
1299
+ yb(a, zb);
1036
1300
  }
1037
- var yb = {open(a) {
1038
- var b = vb[a.node.ya];
1301
+ var zb = {open(a) {
1302
+ var b = wb[a.node.ya];
1039
1303
  if (!b) {
1040
1304
  throw new N(43);
1041
1305
  }
@@ -1079,36 +1343,36 @@ var yb = {open(a) {
1079
1343
  }
1080
1344
  d && (a.node.timestamp = Date.now());
1081
1345
  return e;
1082
- },}, zb = {ib() {
1346
+ },}, Ab = {ib() {
1083
1347
  a: {
1084
- if (!qb.length) {
1348
+ if (!rb.length) {
1085
1349
  var a = null;
1086
1350
  "undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n"));
1087
1351
  if (!a) {
1088
1352
  a = null;
1089
1353
  break a;
1090
1354
  }
1091
- qb = ub(a, !0);
1355
+ rb = vb(a, !0);
1092
1356
  }
1093
- a = qb.shift();
1357
+ a = rb.shift();
1094
1358
  }
1095
1359
  return a;
1096
1360
  }, Na(a, b) {
1097
- null === b || 10 === b ? (xa(pb(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1361
+ null === b || 10 === b ? (Aa(qb(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1098
1362
  }, pa(a) {
1099
- a.H && 0 < a.H.length && (xa(pb(a.H, 0)), a.H = []);
1363
+ a.H && 0 < a.H.length && (Aa(qb(a.H, 0)), a.H = []);
1100
1364
  }, Yb() {
1101
1365
  return {Ac:25856, Cc:5, zc:191, Bc:35387, yc:[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,]};
1102
1366
  }, Zb() {
1103
1367
  return 0;
1104
1368
  }, $b() {
1105
1369
  return [24, 80];
1106
- },}, Ab = {Na(a, b) {
1107
- null === b || 10 === b ? (Aa(pb(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1370
+ },}, Bb = {Na(a, b) {
1371
+ null === b || 10 === b ? (Ba(qb(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1108
1372
  }, pa(a) {
1109
- a.H && 0 < a.H.length && (Aa(pb(a.H, 0)), a.H = []);
1373
+ a.H && 0 < a.H.length && (Ba(qb(a.H, 0)), a.H = []);
1110
1374
  },};
1111
- function Bb(a, b) {
1375
+ function Cb(a, b) {
1112
1376
  var c = a.l ? a.l.length : 0;
1113
1377
  c >= b || (b = Math.max(b, c * (1048576 > c ? 2.0 : 1.125) >>> 0), 0 != c && (b = Math.max(b, 256)), c = a.l, a.l = new Uint8Array(b), 0 < a.v && a.l.set(c.subarray(0, a.v), 0));
1114
1378
  }
@@ -1118,8 +1382,8 @@ var O = {O:null, V() {
1118
1382
  if (24576 === (c & 61440) || 4096 === (c & 61440)) {
1119
1383
  throw new N(63);
1120
1384
  }
1121
- O.O || (O.O = {dir:{node:{Y:O.j.Y, R:O.j.R, ka:O.j.ka, ua:O.j.ua, tb:O.j.tb, zb:O.j.zb, ub:O.j.ub, sb:O.j.sb, Da:O.j.Da}, stream:{ba:O.m.ba}}, file:{node:{Y:O.j.Y, R:O.j.R}, stream:{ba:O.m.ba, read:O.m.read, write:O.m.write, Ya:O.m.Ya, lb:O.m.lb, nb:O.m.nb}}, link:{node:{Y:O.j.Y, R:O.j.R, ma:O.j.ma}, stream:{}}, ab:{node:{Y:O.j.Y, R:O.j.R}, stream:Cb}});
1122
- c = Db(a, b, c, d);
1385
+ O.O || (O.O = {dir:{node:{Y:O.j.Y, R:O.j.R, ka:O.j.ka, ua:O.j.ua, tb:O.j.tb, zb:O.j.zb, ub:O.j.ub, sb:O.j.sb, Da:O.j.Da}, stream:{ba:O.m.ba}}, file:{node:{Y:O.j.Y, R:O.j.R}, stream:{ba:O.m.ba, read:O.m.read, write:O.m.write, Ya:O.m.Ya, lb:O.m.lb, nb:O.m.nb}}, link:{node:{Y:O.j.Y, R:O.j.R, ma:O.j.ma}, stream:{}}, ab:{node:{Y:O.j.Y, R:O.j.R}, stream:Db}});
1386
+ c = Eb(a, b, c, d);
1123
1387
  16384 === (c.mode & 61440) ? (c.j = O.O.dir.node, c.m = O.O.dir.stream, c.l = {}) : 32768 === (c.mode & 61440) ? (c.j = O.O.file.node, c.m = O.O.file.stream, c.v = 0, c.l = null) : 40960 === (c.mode & 61440) ? (c.j = O.O.link.node, c.m = O.O.link.stream) : 8192 === (c.mode & 61440) && (c.j = O.O.ab.node, c.m = O.O.ab.stream);
1124
1388
  c.timestamp = Date.now();
1125
1389
  a && (a.l[b] = c, a.timestamp = c.timestamp);
@@ -1156,13 +1420,13 @@ var O = {O:null, V() {
1156
1420
  }
1157
1421
  }
1158
1422
  }, ka() {
1159
- throw Eb[44];
1423
+ throw Fb[44];
1160
1424
  }, ua(a, b, c, d) {
1161
1425
  return O.createNode(a, b, c, d);
1162
1426
  }, tb(a, b, c) {
1163
1427
  if (16384 === (a.mode & 61440)) {
1164
1428
  try {
1165
- var d = Fb(b, c);
1429
+ var d = Gb(b, c);
1166
1430
  } catch (f) {
1167
1431
  }
1168
1432
  if (d) {
@@ -1180,7 +1444,7 @@ var O = {O:null, V() {
1180
1444
  delete a.l[b];
1181
1445
  a.timestamp = Date.now();
1182
1446
  }, ub(a, b) {
1183
- var c = Fb(a, b), d;
1447
+ var c = Gb(a, b), d;
1184
1448
  for (d in c.l) {
1185
1449
  throw new N(55);
1186
1450
  }
@@ -1233,7 +1497,7 @@ var O = {O:null, V() {
1233
1497
  return a.l.set(b.subarray(c, c + d), e), d;
1234
1498
  }
1235
1499
  }
1236
- Bb(a, e + d);
1500
+ Cb(a, e + d);
1237
1501
  if (a.l.subarray && b.subarray) {
1238
1502
  a.l.set(b.subarray(c, c + d), e);
1239
1503
  } else {
@@ -1250,7 +1514,7 @@ var O = {O:null, V() {
1250
1514
  }
1251
1515
  return b;
1252
1516
  }, Ya(a, b, c) {
1253
- Bb(a.node, b + c);
1517
+ Cb(a.node, b + c);
1254
1518
  a.node.v = Math.max(a.node.v, b + c);
1255
1519
  }, lb(a, b, c, d, e) {
1256
1520
  if (32768 !== (a.node.mode & 61440)) {
@@ -1262,7 +1526,7 @@ var O = {O:null, V() {
1262
1526
  a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b);
1263
1527
  }
1264
1528
  c = !0;
1265
- Sa();
1529
+ Ta();
1266
1530
  b = void 0;
1267
1531
  if (!b) {
1268
1532
  throw new N(48);
@@ -1275,17 +1539,17 @@ var O = {O:null, V() {
1275
1539
  }, nb(a, b, c, d) {
1276
1540
  O.m.write(a, b, 0, d, c, !1);
1277
1541
  return 0;
1278
- },},}, Gb = (a, b) => {
1542
+ },},}, Hb = (a, b) => {
1279
1543
  var c = 0;
1280
1544
  a && (c |= 365);
1281
1545
  b && (c |= 146);
1282
1546
  return c;
1283
- }, Hb = null, Ib = {}, Jb = [], Kb = 1, Lb = null, Mb = !0, N = class {
1547
+ }, Ib = null, Jb = {}, Kb = [], Lb = 1, Mb = null, Nb = !0, N = class {
1284
1548
  constructor(a) {
1285
1549
  this.name = "ErrnoError";
1286
1550
  this.aa = a;
1287
1551
  }
1288
- }, Eb = {}, Nb = class {
1552
+ }, Fb = {}, Ob = class {
1289
1553
  constructor() {
1290
1554
  this.h = {};
1291
1555
  this.node = null;
@@ -1302,13 +1566,13 @@ var O = {O:null, V() {
1302
1566
  set position(a) {
1303
1567
  this.h.position = a;
1304
1568
  }
1305
- }, Ob = class {
1569
+ }, Pb = class {
1306
1570
  constructor(a, b, c, d) {
1307
1571
  a ||= this;
1308
1572
  this.parent = a;
1309
1573
  this.V = a.V;
1310
1574
  this.va = null;
1311
- this.id = Kb++;
1575
+ this.id = Lb++;
1312
1576
  this.name = b;
1313
1577
  this.mode = c;
1314
1578
  this.j = {};
@@ -1328,8 +1592,8 @@ var O = {O:null, V() {
1328
1592
  a ? this.mode |= 146 : this.mode &= -147;
1329
1593
  }
1330
1594
  };
1331
- function Pb(a, b = {}) {
1332
- a = nb(a);
1595
+ function Qb(a, b = {}) {
1596
+ a = ob(a);
1333
1597
  if (!a) {
1334
1598
  return {path:"", node:null};
1335
1599
  }
@@ -1338,17 +1602,17 @@ function Pb(a, b = {}) {
1338
1602
  throw new N(32);
1339
1603
  }
1340
1604
  a = a.split("/").filter(g => !!g);
1341
- for (var c = Hb, d = "/", e = 0; e < a.length; e++) {
1605
+ for (var c = Ib, d = "/", e = 0; e < a.length; e++) {
1342
1606
  var f = e === a.length - 1;
1343
1607
  if (f && b.parent) {
1344
1608
  break;
1345
1609
  }
1346
- c = Fb(c, a[e]);
1347
- d = ib(d + "/" + a[e]);
1610
+ c = Gb(c, a[e]);
1611
+ d = jb(d + "/" + a[e]);
1348
1612
  c.va && (!f || f && b.hb) && (c = c.va.root);
1349
1613
  if (!f || b.gb) {
1350
1614
  for (f = 0; 40960 === (c.mode & 61440);) {
1351
- if (c = Qb(d), d = nb(jb(d), c), c = Pb(d, {Pa:b.Pa + 1}).node, 40 < f++) {
1615
+ if (c = Rb(d), d = ob(kb(d), c), c = Qb(d, {Pa:b.Pa + 1}).node, 40 < f++) {
1352
1616
  throw new N(32);
1353
1617
  }
1354
1618
  }
@@ -1356,7 +1620,7 @@ function Pb(a, b = {}) {
1356
1620
  }
1357
1621
  return {path:d, node:c};
1358
1622
  }
1359
- function Rb(a) {
1623
+ function Sb(a) {
1360
1624
  for (var b;;) {
1361
1625
  if (a === a.parent) {
1362
1626
  return a = a.V.mb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
@@ -1365,18 +1629,18 @@ function Rb(a) {
1365
1629
  a = a.parent;
1366
1630
  }
1367
1631
  }
1368
- function Sb(a, b) {
1632
+ function Tb(a, b) {
1369
1633
  for (var c = 0, d = 0; d < b.length; d++) {
1370
1634
  c = (c << 5) - c + b.charCodeAt(d) | 0;
1371
1635
  }
1372
- return (a + c >>> 0) % Lb.length;
1636
+ return (a + c >>> 0) % Mb.length;
1373
1637
  }
1374
- function Fb(a, b) {
1375
- var c = 16384 === (a.mode & 61440) ? (c = Tb(a, "x")) ? c : a.j.ka ? 0 : 2 : 54;
1638
+ function Gb(a, b) {
1639
+ var c = 16384 === (a.mode & 61440) ? (c = Ub(a, "x")) ? c : a.j.ka ? 0 : 2 : 54;
1376
1640
  if (c) {
1377
1641
  throw new N(c);
1378
1642
  }
1379
- for (c = Lb[Sb(a.id, b)]; c; c = c.fc) {
1643
+ for (c = Mb[Tb(a.id, b)]; c; c = c.fc) {
1380
1644
  var d = c.name;
1381
1645
  if (c.parent.id === a.id && d === b) {
1382
1646
  return c;
@@ -1384,19 +1648,19 @@ function Fb(a, b) {
1384
1648
  }
1385
1649
  return a.j.ka(a, b);
1386
1650
  }
1387
- function Db(a, b, c, d) {
1388
- a = new Ob(a, b, c, d);
1389
- b = Sb(a.parent.id, a.name);
1390
- a.fc = Lb[b];
1391
- return Lb[b] = a;
1651
+ function Eb(a, b, c, d) {
1652
+ a = new Pb(a, b, c, d);
1653
+ b = Tb(a.parent.id, a.name);
1654
+ a.fc = Mb[b];
1655
+ return Mb[b] = a;
1392
1656
  }
1393
- function Ub(a) {
1657
+ function Vb(a) {
1394
1658
  var b = ["r", "w", "rw"][a & 3];
1395
1659
  a & 512 && (b += "w");
1396
1660
  return b;
1397
1661
  }
1398
- function Tb(a, b) {
1399
- if (Mb) {
1662
+ function Ub(a, b) {
1663
+ if (Nb) {
1400
1664
  return 0;
1401
1665
  }
1402
1666
  if (!b.includes("r") || a.mode & 292) {
@@ -1408,26 +1672,26 @@ function Tb(a, b) {
1408
1672
  }
1409
1673
  return 0;
1410
1674
  }
1411
- function Vb(a, b) {
1675
+ function Wb(a, b) {
1412
1676
  try {
1413
- return Fb(a, b), 20;
1677
+ return Gb(a, b), 20;
1414
1678
  } catch (c) {
1415
1679
  }
1416
- return Tb(a, "wx");
1680
+ return Ub(a, "wx");
1417
1681
  }
1418
- function Wb(a) {
1419
- a = Jb[a];
1682
+ function Xb(a) {
1683
+ a = Kb[a];
1420
1684
  if (!a) {
1421
1685
  throw new N(8);
1422
1686
  }
1423
1687
  return a;
1424
1688
  }
1425
- function Xb(a, b = -1) {
1426
- a = Object.assign(new Nb(), a);
1689
+ function Yb(a, b = -1) {
1690
+ a = Object.assign(new Ob(), a);
1427
1691
  if (-1 == b) {
1428
1692
  a: {
1429
1693
  for (b = 0; 4096 >= b; b++) {
1430
- if (!Jb[b]) {
1694
+ if (!Kb[b]) {
1431
1695
  break a;
1432
1696
  }
1433
1697
  }
@@ -1435,29 +1699,29 @@ function Xb(a, b = -1) {
1435
1699
  }
1436
1700
  }
1437
1701
  a.X = b;
1438
- return Jb[b] = a;
1702
+ return Kb[b] = a;
1439
1703
  }
1440
- function Yb(a, b = -1) {
1441
- a = Xb(a, b);
1704
+ function Zb(a, b = -1) {
1705
+ a = Yb(a, b);
1442
1706
  a.m?.Fc?.(a);
1443
1707
  return a;
1444
1708
  }
1445
- var Cb = {open(a) {
1446
- a.m = Ib[a.node.ya].m;
1709
+ var Db = {open(a) {
1710
+ a.m = Jb[a.node.ya].m;
1447
1711
  a.m.open?.(a);
1448
1712
  }, ba() {
1449
1713
  throw new N(70);
1450
1714
  },};
1451
- function xb(a, b) {
1452
- Ib[a] = {m:b};
1715
+ function yb(a, b) {
1716
+ Jb[a] = {m:b};
1453
1717
  }
1454
- function Zb(a, b) {
1718
+ function $b(a, b) {
1455
1719
  var c = "/" === b;
1456
- if (c && Hb) {
1720
+ if (c && Ib) {
1457
1721
  throw new N(10);
1458
1722
  }
1459
1723
  if (!c && b) {
1460
- var d = Pb(b, {hb:!1});
1724
+ var d = Qb(b, {hb:!1});
1461
1725
  b = d.path;
1462
1726
  d = d.node;
1463
1727
  if (d.va) {
@@ -1471,15 +1735,15 @@ function Zb(a, b) {
1471
1735
  a = a.V(b);
1472
1736
  a.V = b;
1473
1737
  b.root = a;
1474
- c ? Hb = a : d && (d.va = b, d.V && d.V.ec.push(b));
1738
+ c ? Ib = a : d && (d.va = b, d.V && d.V.ec.push(b));
1475
1739
  }
1476
- function $b(a, b, c) {
1477
- var d = Pb(a, {parent:!0}).node;
1478
- a = kb(a);
1740
+ function fc(a, b, c) {
1741
+ var d = Qb(a, {parent:!0}).node;
1742
+ a = lb(a);
1479
1743
  if (!a || "." === a || ".." === a) {
1480
1744
  throw new N(28);
1481
1745
  }
1482
- var e = Vb(d, a);
1746
+ var e = Wb(d, a);
1483
1747
  if (e) {
1484
1748
  throw new N(e);
1485
1749
  }
@@ -1488,23 +1752,23 @@ function $b(a, b, c) {
1488
1752
  }
1489
1753
  return d.j.ua(d, a, b, c);
1490
1754
  }
1491
- function fc(a) {
1492
- return $b(a, 16895, 0);
1755
+ function gc(a) {
1756
+ return fc(a, 16895, 0);
1493
1757
  }
1494
- function gc(a, b, c) {
1758
+ function hc(a, b, c) {
1495
1759
  "undefined" == typeof c && (c = b, b = 438);
1496
- $b(a, b | 8192, c);
1760
+ fc(a, b | 8192, c);
1497
1761
  }
1498
- function hc(a, b) {
1499
- if (!nb(a)) {
1762
+ function ic(a, b) {
1763
+ if (!ob(a)) {
1500
1764
  throw new N(44);
1501
1765
  }
1502
- var c = Pb(b, {parent:!0}).node;
1766
+ var c = Qb(b, {parent:!0}).node;
1503
1767
  if (!c) {
1504
1768
  throw new N(44);
1505
1769
  }
1506
- b = kb(b);
1507
- var d = Vb(c, b);
1770
+ b = lb(b);
1771
+ var d = Wb(c, b);
1508
1772
  if (d) {
1509
1773
  throw new N(d);
1510
1774
  }
@@ -1513,17 +1777,17 @@ function hc(a, b) {
1513
1777
  }
1514
1778
  c.j.Da(c, b, a);
1515
1779
  }
1516
- function Qb(a) {
1517
- a = Pb(a).node;
1780
+ function Rb(a) {
1781
+ a = Qb(a).node;
1518
1782
  if (!a) {
1519
1783
  throw new N(44);
1520
1784
  }
1521
1785
  if (!a.j.ma) {
1522
1786
  throw new N(28);
1523
1787
  }
1524
- return nb(Rb(a.parent), a.j.ma(a));
1788
+ return ob(Sb(a.parent), a.j.ma(a));
1525
1789
  }
1526
- function ic(a, b, c) {
1790
+ function jc(a, b, c) {
1527
1791
  if ("" === a) {
1528
1792
  throw new N(44);
1529
1793
  }
@@ -1538,9 +1802,9 @@ function ic(a, b, c) {
1538
1802
  if ("object" == typeof a) {
1539
1803
  var e = a;
1540
1804
  } else {
1541
- a = ib(a);
1805
+ a = jb(a);
1542
1806
  try {
1543
- e = Pb(a, {gb:!(b & 131072)}).node;
1807
+ e = Qb(a, {gb:!(b & 131072)}).node;
1544
1808
  } catch (f) {
1545
1809
  }
1546
1810
  }
@@ -1551,7 +1815,7 @@ function ic(a, b, c) {
1551
1815
  throw new N(20);
1552
1816
  }
1553
1817
  } else {
1554
- e = $b(a, c, 0), d = !0;
1818
+ e = fc(a, c, 0), d = !0;
1555
1819
  }
1556
1820
  }
1557
1821
  if (!e) {
@@ -1561,12 +1825,12 @@ function ic(a, b, c) {
1561
1825
  if (b & 65536 && 16384 !== (e.mode & 61440)) {
1562
1826
  throw new N(54);
1563
1827
  }
1564
- if (!d && (c = e ? 40960 === (e.mode & 61440) ? 32 : 16384 === (e.mode & 61440) && ("r" !== Ub(b) || b & 512) ? 31 : Tb(e, Ub(b)) : 44)) {
1828
+ if (!d && (c = e ? 40960 === (e.mode & 61440) ? 32 : 16384 === (e.mode & 61440) && ("r" !== Vb(b) || b & 512) ? 31 : Ub(e, Vb(b)) : 44)) {
1565
1829
  throw new N(c);
1566
1830
  }
1567
1831
  if (b & 512 && !d) {
1568
1832
  c = e;
1569
- c = "string" == typeof c ? Pb(c, {gb:!0}).node : c;
1833
+ c = "string" == typeof c ? Qb(c, {gb:!0}).node : c;
1570
1834
  if (!c.j.R) {
1571
1835
  throw new N(63);
1572
1836
  }
@@ -1576,18 +1840,18 @@ function ic(a, b, c) {
1576
1840
  if (32768 !== (c.mode & 61440)) {
1577
1841
  throw new N(28);
1578
1842
  }
1579
- if (d = Tb(c, "w")) {
1843
+ if (d = Ub(c, "w")) {
1580
1844
  throw new N(d);
1581
1845
  }
1582
1846
  c.j.R(c, {size:0, timestamp:Date.now()});
1583
1847
  }
1584
1848
  b &= -131713;
1585
- e = Xb({node:e, path:Rb(e), flags:b, seekable:!0, position:0, m:e.m, tc:[], error:!1});
1849
+ e = Yb({node:e, path:Sb(e), flags:b, seekable:!0, position:0, m:e.m, tc:[], error:!1});
1586
1850
  e.m.open && e.m.open(e);
1587
- !m.logReadFiles || b & 1 || (jc ||= {}, a in jc || (jc[a] = 1));
1851
+ !m.logReadFiles || b & 1 || (kc ||= {}, a in kc || (kc[a] = 1));
1588
1852
  return e;
1589
1853
  }
1590
- function kc(a, b, c) {
1854
+ function lc(a, b, c) {
1591
1855
  if (null === a.X) {
1592
1856
  throw new N(8);
1593
1857
  }
@@ -1600,13 +1864,13 @@ function kc(a, b, c) {
1600
1864
  a.position = a.m.ba(a, b, c);
1601
1865
  a.tc = [];
1602
1866
  }
1603
- var lc;
1604
- function mc(a, b, c) {
1605
- a = ib("/dev/" + a);
1606
- var d = Gb(!!b, !!c);
1607
- nc ||= 64;
1608
- var e = nc++ << 8 | 0;
1609
- xb(e, {open(f) {
1867
+ var mc;
1868
+ function nc(a, b, c) {
1869
+ a = jb("/dev/" + a);
1870
+ var d = Hb(!!b, !!c);
1871
+ oc ||= 64;
1872
+ var e = oc++ << 8 | 0;
1873
+ yb(e, {open(f) {
1610
1874
  f.seekable = !1;
1611
1875
  }, close() {
1612
1876
  c?.buffer?.length && c(10);
@@ -1639,13 +1903,13 @@ function mc(a, b, c) {
1639
1903
  p && (f.node.timestamp = Date.now());
1640
1904
  return n;
1641
1905
  }});
1642
- gc(a, d, e);
1906
+ hc(a, d, e);
1643
1907
  }
1644
- var nc, oc = {}, jc, gb = void 0, pc = (a, b) => Object.defineProperty(b, "name", {value:a}), qc = [], rc = [], P, sc = a => {
1908
+ var oc, pc = {}, kc, hb = void 0, qc = (a, b) => Object.defineProperty(b, "name", {value:a}), rc = [], sc = [], P, Q = a => {
1645
1909
  if (!a) {
1646
1910
  throw new P("Cannot use deleted val. handle = " + a);
1647
1911
  }
1648
- return rc[a];
1912
+ return sc[a];
1649
1913
  }, tc = a => {
1650
1914
  switch(a) {
1651
1915
  case void 0:
@@ -1657,13 +1921,13 @@ var nc, oc = {}, jc, gb = void 0, pc = (a, b) => Object.defineProperty(b, "name"
1657
1921
  case !1:
1658
1922
  return 8;
1659
1923
  default:
1660
- const b = qc.pop() || rc.length;
1661
- rc[b] = a;
1662
- rc[b + 1] = 1;
1924
+ const b = rc.pop() || sc.length;
1925
+ sc[b] = a;
1926
+ sc[b + 1] = 1;
1663
1927
  return b;
1664
1928
  }
1665
1929
  }, uc = a => {
1666
- var b = Error, c = pc(a, function(d) {
1930
+ var b = Error, c = qc(a, function(d) {
1667
1931
  this.name = a;
1668
1932
  this.message = d;
1669
1933
  d = Error(d).stack;
@@ -1675,7 +1939,7 @@ var nc, oc = {}, jc, gb = void 0, pc = (a, b) => Object.defineProperty(b, "name"
1675
1939
  return void 0 === this.message ? this.name : `${this.name}: ${this.message}`;
1676
1940
  };
1677
1941
  return c;
1678
- }, vc, wc, Q = a => {
1942
+ }, vc, wc, S = a => {
1679
1943
  for (var b = ""; B[a];) {
1680
1944
  b += wc[B[a++]];
1681
1945
  }
@@ -1696,7 +1960,7 @@ var nc, oc = {}, jc, gb = void 0, pc = (a, b) => Object.defineProperty(b, "name"
1696
1960
  return b;
1697
1961
  }, Cc = {}, Fc = a => {
1698
1962
  a = Dc(a);
1699
- var b = Q(a);
1963
+ var b = S(a);
1700
1964
  Ec(a);
1701
1965
  return b;
1702
1966
  }, Gc = (a, b) => {
@@ -1754,7 +2018,7 @@ var nc, oc = {}, jc, gb = void 0, pc = (a, b) => Object.defineProperty(b, "name"
1754
2018
  function Rc(a) {
1755
2019
  return this.fromWireType(F[a >> 2]);
1756
2020
  }
1757
- var Sc = {}, Tc = {}, S = (a, b, c) => {
2021
+ var Sc = {}, Tc = {}, U = (a, b, c) => {
1758
2022
  function d(k) {
1759
2023
  k = c(k);
1760
2024
  if (k.length !== a.length) {
@@ -1968,8 +2232,8 @@ var hd = (a, b, c) => {
1968
2232
  }, md = (a, b, c = []) => {
1969
2233
  a.includes("j") ? (a = a.replace(/p/g, "i"), b = (0,m["dynCall_" + a])(b, ...c)) : b = ld(b)(...c);
1970
2234
  return b;
1971
- }, nd = (a, b) => (...c) => md(a, b, c), U = (a, b) => {
1972
- a = Q(a);
2235
+ }, nd = (a, b) => (...c) => md(a, b, c), W = (a, b) => {
2236
+ a = S(a);
1973
2237
  var c = a.includes("j") ? nd(a, b) : ld(b);
1974
2238
  if ("function" != typeof c) {
1975
2239
  throw new P(`unknown function pointer with signature ${a}: ${b}`);
@@ -1997,7 +2261,7 @@ function ud(a, b, c, d, e) {
1997
2261
  throw new P("argTypes array size mismatch! Must at least get return value and 'this' types!");
1998
2262
  }
1999
2263
  var g = null !== b[1] && null !== c, k = qd(b), p = "void" !== b[0].name, n = f - 2, t = Array(n), x = [], y = [];
2000
- return pc(a, function(...l) {
2264
+ return qc(a, function(...l) {
2001
2265
  if (l.length !== n) {
2002
2266
  throw new P(`function ${a} called with ${l.length} arguments, expected ${n}`);
2003
2267
  }
@@ -2045,9 +2309,9 @@ var vd = (a, b) => {
2045
2309
  }
2046
2310
  return bd(a.g.o, a.g.u.i, b.i);
2047
2311
  }, yd = a => {
2048
- 9 < a && 0 === --rc[a + 1] && (rc[a] = void 0, qc.push(a));
2312
+ 9 < a && 0 === --sc[a + 1] && (sc[a] = void 0, rc.push(a));
2049
2313
  }, zd = {name:"emscripten::val", fromWireType:a => {
2050
- var b = sc(a);
2314
+ var b = Q(a);
2051
2315
  yd(a);
2052
2316
  return b;
2053
2317
  }, toWireType:(a, b) => tc(b), argPackAdvance:8, readValueFromPointer:Rc, M:null,}, Ad = (a, b, c) => {
@@ -2060,9 +2324,9 @@ var vd = (a, b) => {
2060
2324
  };
2061
2325
  case 2:
2062
2326
  return c ? function(d) {
2063
- return this.fromWireType(Ea[d >> 1]);
2064
- } : function(d) {
2065
2327
  return this.fromWireType(Fa[d >> 1]);
2328
+ } : function(d) {
2329
+ return this.fromWireType(Ia[d >> 1]);
2066
2330
  };
2067
2331
  case 4:
2068
2332
  return c ? function(d) {
@@ -2083,11 +2347,11 @@ var vd = (a, b) => {
2083
2347
  switch(b) {
2084
2348
  case 4:
2085
2349
  return function(c) {
2086
- return this.fromWireType(Ia[c >> 2]);
2350
+ return this.fromWireType(Ja[c >> 2]);
2087
2351
  };
2088
2352
  case 8:
2089
2353
  return function(c) {
2090
- return this.fromWireType(Ja[c >> 3]);
2354
+ return this.fromWireType(Ka[c >> 3]);
2091
2355
  };
2092
2356
  default:
2093
2357
  throw new TypeError(`invalid float width (${b}): ${a}`);
@@ -2097,7 +2361,7 @@ var vd = (a, b) => {
2097
2361
  case 1:
2098
2362
  return c ? d => z[d] : d => B[d];
2099
2363
  case 2:
2100
- return c ? d => Ea[d >> 1] : d => Fa[d >> 1];
2364
+ return c ? d => Fa[d >> 1] : d => Ia[d >> 1];
2101
2365
  case 4:
2102
2366
  return c ? d => C[d >> 2] : d => F[d >> 2];
2103
2367
  default:
@@ -2105,7 +2369,7 @@ var vd = (a, b) => {
2105
2369
  }
2106
2370
  }, Dd = "undefined" != typeof TextDecoder ? new TextDecoder("utf-16le") : void 0, Ed = (a, b) => {
2107
2371
  var c = a >> 1;
2108
- for (var d = c + b / 2; !(c >= d) && Fa[c];) {
2372
+ for (var d = c + b / 2; !(c >= d) && Ia[c];) {
2109
2373
  ++c;
2110
2374
  }
2111
2375
  c <<= 1;
@@ -2114,7 +2378,7 @@ var vd = (a, b) => {
2114
2378
  }
2115
2379
  c = "";
2116
2380
  for (d = 0; !(d >= b / 2); ++d) {
2117
- var e = Ea[a + 2 * d >> 1];
2381
+ var e = Fa[a + 2 * d >> 1];
2118
2382
  if (0 == e) {
2119
2383
  break;
2120
2384
  }
@@ -2130,9 +2394,9 @@ var vd = (a, b) => {
2130
2394
  var d = b;
2131
2395
  c = c < 2 * a.length ? c / 2 : a.length;
2132
2396
  for (var e = 0; e < c; ++e) {
2133
- Ea[b >> 1] = a.charCodeAt(e), b += 2;
2397
+ Fa[b >> 1] = a.charCodeAt(e), b += 2;
2134
2398
  }
2135
- Ea[b >> 1] = 0;
2399
+ Fa[b >> 1] = 0;
2136
2400
  return b - d;
2137
2401
  }, Gd = a => 2 * a.length, Hd = (a, b) => {
2138
2402
  for (var c = 0, d = ""; !(c >= b / 4);) {
@@ -2177,12 +2441,12 @@ var vd = (a, b) => {
2177
2441
  a = a.toWireType(d, c);
2178
2442
  d.length && (F[b >> 2] = tc(d));
2179
2443
  return a;
2180
- }, Ld = {}, Md = a => {
2181
- var b = Ld[a];
2182
- return void 0 === b ? Q(a) : b;
2183
- }, Nd = [], Od = a => {
2184
- var b = Nd.length;
2185
- Nd.push(a);
2444
+ }, Ld = [], Md = {}, Nd = a => {
2445
+ var b = Md[a];
2446
+ return void 0 === b ? S(a) : b;
2447
+ }, Od = a => {
2448
+ var b = Ld.length;
2449
+ Ld.push(a);
2186
2450
  return b;
2187
2451
  }, Pd = (a, b) => {
2188
2452
  for (var c = Array(a), d = 0; d < a; ++d) {
@@ -2191,7 +2455,7 @@ var vd = (a, b) => {
2191
2455
  return c;
2192
2456
  }, Qd = Reflect.construct, Rd = a => 0 === a % 4 && (0 !== a % 100 || 0 === a % 400), Sd = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], Td = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Ud = [], Vd = {}, Xd = () => {
2193
2457
  if (!Wd) {
2194
- 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", _:pa || "./this.program"}, b;
2458
+ 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", _:ta || "./this.program"}, b;
2195
2459
  for (b in Vd) {
2196
2460
  void 0 === Vd[b] ? delete a[b] : a[b] = Vd[b];
2197
2461
  }
@@ -2255,8 +2519,8 @@ var vd = (a, b) => {
2255
2519
  return 0 >= g(u, l) ? 0 >= g(r, l) ? l.getFullYear() + 1 : l.getFullYear() : l.getFullYear() - 1;
2256
2520
  }
2257
2521
  var n = F[d + 40 >> 2];
2258
- d = {qc:C[d >> 2], pc:C[d + 4 >> 2], Ea:C[d + 8 >> 2], Ra:C[d + 12 >> 2], Fa:C[d + 16 >> 2], da:C[d + 20 >> 2], S:C[d + 24 >> 2], ca:C[d + 28 >> 2], Oc:C[d + 32 >> 2], oc:C[d + 36 >> 2], rc:n ? n ? pb(B, n) : "" : ""};
2259
- c = c ? pb(B, c) : "";
2522
+ d = {qc:C[d >> 2], pc:C[d + 4 >> 2], Ea:C[d + 8 >> 2], Ra:C[d + 12 >> 2], Fa:C[d + 16 >> 2], da:C[d + 20 >> 2], S:C[d + 24 >> 2], ca:C[d + 28 >> 2], Oc:C[d + 32 >> 2], oc:C[d + 36 >> 2], rc:n ? n ? qb(B, n) : "" : ""};
2523
+ c = c ? qb(B, c) : "";
2260
2524
  n = {"%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",};
2261
2525
  for (var t in n) {
2262
2526
  c = c.replace(new RegExp(t, "g"), n[t]);
@@ -2292,7 +2556,7 @@ var vd = (a, b) => {
2292
2556
  c.includes(t) && (c = c.replace(new RegExp(t, "g"), n[t](d)));
2293
2557
  }
2294
2558
  c = c.replace(/\0\0/g, "%");
2295
- t = ub(c, !1);
2559
+ t = vb(c, !1);
2296
2560
  if (t.length > b) {
2297
2561
  return 0;
2298
2562
  }
@@ -2300,39 +2564,39 @@ var vd = (a, b) => {
2300
2564
  return t.length - 1;
2301
2565
  };
2302
2566
  [44].forEach(a => {
2303
- Eb[a] = new N(a);
2304
- Eb[a].stack = "<generic error, no stack>";
2567
+ Fb[a] = new N(a);
2568
+ Fb[a].stack = "<generic error, no stack>";
2305
2569
  });
2306
- Lb = Array(4096);
2307
- Zb(O, "/");
2308
- fc("/tmp");
2309
- fc("/home");
2310
- fc("/home/web_user");
2570
+ Mb = Array(4096);
2571
+ $b(O, "/");
2572
+ gc("/tmp");
2573
+ gc("/home");
2574
+ gc("/home/web_user");
2311
2575
  (function() {
2312
- fc("/dev");
2313
- xb(259, {read:() => 0, write:(d, e, f, g) => g,});
2314
- gc("/dev/null", 259);
2315
- wb(1280, zb);
2316
- wb(1536, Ab);
2317
- gc("/dev/tty", 1280);
2318
- gc("/dev/tty1", 1536);
2576
+ gc("/dev");
2577
+ yb(259, {read:() => 0, write:(d, e, f, g) => g,});
2578
+ hc("/dev/null", 259);
2579
+ xb(1280, Ab);
2580
+ xb(1536, Bb);
2581
+ hc("/dev/tty", 1280);
2582
+ hc("/dev/tty1", 1536);
2319
2583
  var a = new Uint8Array(1024), b = 0, c = () => {
2320
- 0 === b && (b = mb(a).byteLength);
2584
+ 0 === b && (b = nb(a).byteLength);
2321
2585
  return a[--b];
2322
2586
  };
2323
- mc("random", c);
2324
- mc("urandom", c);
2325
- fc("/dev/shm");
2326
- fc("/dev/shm/tmp");
2587
+ nc("random", c);
2588
+ nc("urandom", c);
2589
+ gc("/dev/shm");
2590
+ gc("/dev/shm/tmp");
2327
2591
  })();
2328
2592
  (function() {
2329
- fc("/proc");
2330
- var a = fc("/proc/self");
2331
- fc("/proc/self/fd");
2332
- Zb({V() {
2333
- var b = Db(a, "fd", 16895, 73);
2593
+ gc("/proc");
2594
+ var a = gc("/proc/self");
2595
+ gc("/proc/self/fd");
2596
+ $b({V() {
2597
+ var b = Eb(a, "fd", 16895, 73);
2334
2598
  b.j = {ka(c, d) {
2335
- var e = Wb(+d);
2599
+ var e = Xb(+d);
2336
2600
  c = {parent:null, V:{mb:"fake"}, j:{ma:() => e.path},};
2337
2601
  return c.parent = c;
2338
2602
  }};
@@ -2345,8 +2609,8 @@ P = m.BindingError = class extends Error {
2345
2609
  this.name = "BindingError";
2346
2610
  }
2347
2611
  };
2348
- rc.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1,);
2349
- m.count_emval_handles = () => rc.length / 2 - 5 - qc.length;
2612
+ sc.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1,);
2613
+ m.count_emval_handles = () => sc.length / 2 - 5 - rc.length;
2350
2614
  vc = m.PureVirtualError = uc("PureVirtualError");
2351
2615
  for (var ae = Array(256), be = 0; 256 > be; ++be) {
2352
2616
  ae[be] = String.fromCharCode(be);
@@ -2450,43 +2714,43 @@ Object.assign(gd.prototype, {Sb(a) {
2450
2714
  },});
2451
2715
  od = m.UnboundTypeError = uc("UnboundTypeError");
2452
2716
  var ee = {__syscall_fcntl64:function(a, b, c) {
2453
- gb = c;
2717
+ hb = c;
2454
2718
  try {
2455
- var d = Wb(a);
2719
+ var d = Xb(a);
2456
2720
  switch(b) {
2457
2721
  case 0:
2458
- var e = fb();
2722
+ var e = gb();
2459
2723
  if (0 > e) {
2460
2724
  break;
2461
2725
  }
2462
- for (; Jb[e];) {
2726
+ for (; Kb[e];) {
2463
2727
  e++;
2464
2728
  }
2465
- return Yb(d, e).X;
2729
+ return Zb(d, e).X;
2466
2730
  case 1:
2467
2731
  case 2:
2468
2732
  return 0;
2469
2733
  case 3:
2470
2734
  return d.flags;
2471
2735
  case 4:
2472
- return e = fb(), d.flags |= e, 0;
2736
+ return e = gb(), d.flags |= e, 0;
2473
2737
  case 12:
2474
- return e = fb(), Ea[e + 0 >> 1] = 2, 0;
2738
+ return e = gb(), Fa[e + 0 >> 1] = 2, 0;
2475
2739
  case 13:
2476
2740
  case 14:
2477
2741
  return 0;
2478
2742
  }
2479
2743
  return -28;
2480
2744
  } catch (f) {
2481
- if ("undefined" == typeof oc || "ErrnoError" !== f.name) {
2745
+ if ("undefined" == typeof pc || "ErrnoError" !== f.name) {
2482
2746
  throw f;
2483
2747
  }
2484
2748
  return -f.aa;
2485
2749
  }
2486
2750
  }, __syscall_ioctl:function(a, b, c) {
2487
- gb = c;
2751
+ hb = c;
2488
2752
  try {
2489
- var d = Wb(a);
2753
+ var d = Xb(a);
2490
2754
  switch(b) {
2491
2755
  case 21509:
2492
2756
  return d.s ? 0 : -59;
@@ -2496,7 +2760,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2496
2760
  }
2497
2761
  if (d.s.W.Yb) {
2498
2762
  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,];
2499
- var e = fb();
2763
+ var e = gb();
2500
2764
  C[e >> 2] = 25856;
2501
2765
  C[e + 4 >> 2] = 5;
2502
2766
  C[e + 8 >> 2] = 191;
@@ -2517,7 +2781,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2517
2781
  return -59;
2518
2782
  }
2519
2783
  if (d.s.W.Zb) {
2520
- for (e = fb(), a = [], f = 0; 32 > f; f++) {
2784
+ for (e = gb(), a = [], f = 0; 32 > f; f++) {
2521
2785
  a.push(z[e + f + 17]);
2522
2786
  }
2523
2787
  }
@@ -2526,12 +2790,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2526
2790
  if (!d.s) {
2527
2791
  return -59;
2528
2792
  }
2529
- e = fb();
2793
+ e = gb();
2530
2794
  return C[e >> 2] = 0;
2531
2795
  case 21520:
2532
2796
  return d.s ? -28 : -59;
2533
2797
  case 21531:
2534
- e = fb();
2798
+ e = gb();
2535
2799
  if (!d.m.Xb) {
2536
2800
  throw new N(59);
2537
2801
  }
@@ -2540,7 +2804,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2540
2804
  if (!d.s) {
2541
2805
  return -59;
2542
2806
  }
2543
- d.s.W.$b && (f = [24, 80], e = fb(), Ea[e >> 1] = f[0], Ea[e + 2 >> 1] = f[1]);
2807
+ d.s.W.$b && (f = [24, 80], e = gb(), Fa[e >> 1] = f[0], Fa[e + 2 >> 1] = f[1]);
2544
2808
  return 0;
2545
2809
  case 21524:
2546
2810
  return d.s ? 0 : -59;
@@ -2550,41 +2814,41 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2550
2814
  return -28;
2551
2815
  }
2552
2816
  } catch (g) {
2553
- if ("undefined" == typeof oc || "ErrnoError" !== g.name) {
2817
+ if ("undefined" == typeof pc || "ErrnoError" !== g.name) {
2554
2818
  throw g;
2555
2819
  }
2556
2820
  return -g.aa;
2557
2821
  }
2558
2822
  }, __syscall_openat:function(a, b, c, d) {
2559
- gb = d;
2823
+ hb = d;
2560
2824
  try {
2561
- b = b ? pb(B, b) : "";
2825
+ b = b ? qb(B, b) : "";
2562
2826
  var e = b;
2563
2827
  if ("/" === e.charAt(0)) {
2564
2828
  b = e;
2565
2829
  } else {
2566
- var f = -100 === a ? "/" : Wb(a).path;
2830
+ var f = -100 === a ? "/" : Xb(a).path;
2567
2831
  if (0 == e.length) {
2568
2832
  throw new N(44);
2569
2833
  }
2570
- b = ib(f + "/" + e);
2834
+ b = jb(f + "/" + e);
2571
2835
  }
2572
- var g = d ? fb() : 0;
2573
- return ic(b, c, g).X;
2836
+ var g = d ? gb() : 0;
2837
+ return jc(b, c, g).X;
2574
2838
  } catch (k) {
2575
- if ("undefined" == typeof oc || "ErrnoError" !== k.name) {
2839
+ if ("undefined" == typeof pc || "ErrnoError" !== k.name) {
2576
2840
  throw k;
2577
2841
  }
2578
2842
  return -k.aa;
2579
2843
  }
2580
2844
  }, _abort_js:() => {
2581
- Sa("");
2845
+ Ta("");
2582
2846
  }, _embind_create_inheriting_constructor:(a, b, c) => {
2583
- a = Q(a);
2847
+ a = S(a);
2584
2848
  b = Gc(b, "wrapper");
2585
- c = sc(c);
2849
+ c = Q(c);
2586
2850
  var d = b.i, e = d.N, f = d.C.N, g = d.C.constructor;
2587
- a = pc(a, function(...k) {
2851
+ a = qc(a, function(...k) {
2588
2852
  d.C.qb.forEach(function(p) {
2589
2853
  if (this[p] === f[p]) {
2590
2854
  throw new vc(`Pure virtual function ${p} must be implemented in JavaScript`);
@@ -2631,7 +2895,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2631
2895
  var b = Pc[a];
2632
2896
  delete Pc[a];
2633
2897
  var c = b.Oa, d = b.P, e = b.fb, f = e.map(g => g.Vb).concat(e.map(g => g.lc));
2634
- S([a], f, g => {
2898
+ U([a], f, g => {
2635
2899
  var k = {};
2636
2900
  e.forEach((p, n) => {
2637
2901
  var t = g[n], x = p.Tb, y = p.Ub, l = g[n + e.length], u = p.kc, r = p.mc;
@@ -2664,7 +2928,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2664
2928
  });
2665
2929
  }, _embind_register_bigint:() => {
2666
2930
  }, _embind_register_bool:(a, b, c, d) => {
2667
- b = Q(b);
2931
+ b = S(b);
2668
2932
  Uc(a, {name:b, fromWireType:function(e) {
2669
2933
  return !!e;
2670
2934
  }, toWireType:function(e, f) {
@@ -2673,16 +2937,16 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2673
2937
  return this.fromWireType(B[e]);
2674
2938
  }, M:null,});
2675
2939
  }, _embind_register_class:(a, b, c, d, e, f, g, k, p, n, t, x, y) => {
2676
- t = Q(t);
2677
- f = U(e, f);
2678
- k &&= U(g, k);
2679
- n &&= U(p, n);
2680
- y = U(x, y);
2940
+ t = S(t);
2941
+ f = W(e, f);
2942
+ k &&= W(g, k);
2943
+ n &&= W(p, n);
2944
+ y = W(x, y);
2681
2945
  var l = $c(t);
2682
2946
  Zc(l, function() {
2683
2947
  pd(`Cannot construct ${t} due to unbound types`, [d]);
2684
2948
  });
2685
- S([a, b, c], d ? [d] : [], u => {
2949
+ U([a, b, c], d ? [d] : [], u => {
2686
2950
  u = u[0];
2687
2951
  if (d) {
2688
2952
  var r = u.i;
@@ -2690,7 +2954,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2690
2954
  } else {
2691
2955
  D = Xc.prototype;
2692
2956
  }
2693
- u = pc(t, function(...R) {
2957
+ u = qc(t, function(...R) {
2694
2958
  if (Object.getPrototypeOf(this) !== I) {
2695
2959
  throw new P("Use 'new' to construct " + t);
2696
2960
  }
@@ -2720,10 +2984,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2720
2984
  });
2721
2985
  }, _embind_register_class_class_function:(a, b, c, d, e, f, g) => {
2722
2986
  var k = vd(c, d);
2723
- b = Q(b);
2987
+ b = S(b);
2724
2988
  b = wd(b);
2725
- f = U(e, f);
2726
- S([], [a], p => {
2989
+ f = W(e, f);
2990
+ U([], [a], p => {
2727
2991
  function n() {
2728
2992
  pd(`Cannot call ${t} due to unbound types`, k);
2729
2993
  }
@@ -2732,7 +2996,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2732
2996
  b.startsWith("@@") && (b = Symbol[b.substring(2)]);
2733
2997
  var x = p.i.constructor;
2734
2998
  void 0 === x[b] ? (n.ea = c - 1, x[b] = n) : (Yc(x, b, t), x[b].A[c - 1] = n);
2735
- S([], k, y => {
2999
+ U([], k, y => {
2736
3000
  y = ud(t, [y[0], null].concat(y.slice(1)), null, f, g);
2737
3001
  void 0 === x[b].A ? (y.ea = c - 1, x[b] = y) : x[b].A[c - 1] = y;
2738
3002
  if (p.i.oa) {
@@ -2745,9 +3009,9 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2745
3009
  return [];
2746
3010
  });
2747
3011
  }, _embind_register_class_class_property:(a, b, c, d, e, f, g, k) => {
2748
- b = Q(b);
2749
- f = U(e, f);
2750
- S([], [a], p => {
3012
+ b = S(b);
3013
+ f = W(e, f);
3014
+ U([], [a], p => {
2751
3015
  p = p[0];
2752
3016
  var n = `${p.name}.${b}`, t = {get() {
2753
3017
  pd(`Cannot access ${n} due to unbound types`, [c]);
@@ -2758,12 +3022,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2758
3022
  throw new P(`${n} is a read-only property`);
2759
3023
  };
2760
3024
  Object.defineProperty(p.i.constructor, b, t);
2761
- S([], [c], x => {
3025
+ U([], [c], x => {
2762
3026
  x = x[0];
2763
3027
  var y = {get() {
2764
3028
  return x.fromWireType(f(d));
2765
3029
  }, enumerable:!0};
2766
- k && (k = U(g, k), y.set = l => {
3030
+ k && (k = W(g, k), y.set = l => {
2767
3031
  var u = [];
2768
3032
  k(d, x.toWireType(u, l));
2769
3033
  Qc(u);
@@ -2775,8 +3039,8 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2775
3039
  });
2776
3040
  }, _embind_register_class_constructor:(a, b, c, d, e, f) => {
2777
3041
  var g = vd(b, c);
2778
- e = U(d, e);
2779
- S([], [a], k => {
3042
+ e = W(d, e);
3043
+ U([], [a], k => {
2780
3044
  k = k[0];
2781
3045
  var p = `constructor ${k.name}`;
2782
3046
  void 0 === k.i.$ && (k.i.$ = []);
@@ -2786,7 +3050,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2786
3050
  k.i.$[b - 1] = () => {
2787
3051
  pd(`Cannot construct ${k.name} due to unbound types`, g);
2788
3052
  };
2789
- S([], g, n => {
3053
+ U([], g, n => {
2790
3054
  n.splice(1, 0, null);
2791
3055
  k.i.$[b - 1] = ud(p, n, null, e, f);
2792
3056
  return [];
@@ -2795,10 +3059,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2795
3059
  });
2796
3060
  }, _embind_register_class_function:(a, b, c, d, e, f, g, k) => {
2797
3061
  var p = vd(c, d);
2798
- b = Q(b);
3062
+ b = S(b);
2799
3063
  b = wd(b);
2800
- f = U(e, f);
2801
- S([], [a], n => {
3064
+ f = W(e, f);
3065
+ U([], [a], n => {
2802
3066
  function t() {
2803
3067
  pd(`Cannot call ${x} due to unbound types`, p);
2804
3068
  }
@@ -2808,7 +3072,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2808
3072
  k && n.i.qb.push(b);
2809
3073
  var y = n.i.N, l = y[b];
2810
3074
  void 0 === l || void 0 === l.A && l.className !== n.name && l.ea === c - 2 ? (t.ea = c - 2, t.className = n.name, y[b] = t) : (Yc(y, b, x), y[b].A[c - 2] = t);
2811
- S([], p, u => {
3075
+ U([], p, u => {
2812
3076
  u = ud(x, u, n, f, g);
2813
3077
  void 0 === y[b].A ? (u.ea = c - 2, y[b] = u) : y[b].A[c - 2] = u;
2814
3078
  return [];
@@ -2816,9 +3080,9 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2816
3080
  return [];
2817
3081
  });
2818
3082
  }, _embind_register_class_property:(a, b, c, d, e, f, g, k, p, n) => {
2819
- b = Q(b);
2820
- e = U(d, e);
2821
- S([], [a], t => {
3083
+ b = S(b);
3084
+ e = W(d, e);
3085
+ U([], [a], t => {
2822
3086
  t = t[0];
2823
3087
  var x = `${t.name}.${b}`, y = {get() {
2824
3088
  pd(`Cannot access ${x} due to unbound types`, [c, g]);
@@ -2827,13 +3091,13 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2827
3091
  throw new P(x + " is a read-only property");
2828
3092
  };
2829
3093
  Object.defineProperty(t.i.N, b, y);
2830
- S([], p ? [c, g] : [c], l => {
3094
+ U([], p ? [c, g] : [c], l => {
2831
3095
  var u = l[0], r = {get() {
2832
3096
  var I = xd(this, t, x + " getter");
2833
3097
  return u.fromWireType(e(f, I));
2834
3098
  }, enumerable:!0};
2835
3099
  if (p) {
2836
- p = U(k, p);
3100
+ p = W(k, p);
2837
3101
  var D = l[1];
2838
3102
  r.set = function(I) {
2839
3103
  var w = xd(this, t, x + " setter"), L = [];
@@ -2849,7 +3113,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2849
3113
  }, _embind_register_emval:a => Uc(a, zd), _embind_register_enum:(a, b, c, d) => {
2850
3114
  function e() {
2851
3115
  }
2852
- b = Q(b);
3116
+ b = S(b);
2853
3117
  e.values = {};
2854
3118
  Uc(a, {name:b, constructor:e, fromWireType:function(f) {
2855
3119
  return this.constructor.values[f];
@@ -2857,29 +3121,29 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2857
3121
  Zc(b, e);
2858
3122
  }, _embind_register_enum_value:(a, b, c) => {
2859
3123
  var d = Gc(a, "enum");
2860
- b = Q(b);
3124
+ b = S(b);
2861
3125
  a = d.constructor;
2862
- d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:pc(`${d.name}_${b}`, function() {
3126
+ d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:qc(`${d.name}_${b}`, function() {
2863
3127
  })},});
2864
3128
  a.values[c] = d;
2865
3129
  a[b] = d;
2866
3130
  }, _embind_register_float:(a, b, c) => {
2867
- b = Q(b);
3131
+ b = S(b);
2868
3132
  Uc(a, {name:b, fromWireType:d => d, toWireType:(d, e) => e, argPackAdvance:8, readValueFromPointer:Bd(b, c), M:null,});
2869
3133
  }, _embind_register_function:(a, b, c, d, e, f) => {
2870
3134
  var g = vd(b, c);
2871
- a = Q(a);
3135
+ a = S(a);
2872
3136
  a = wd(a);
2873
- e = U(d, e);
3137
+ e = W(d, e);
2874
3138
  Zc(a, function() {
2875
3139
  pd(`Cannot call ${a} due to unbound types`, g);
2876
3140
  }, b - 1);
2877
- S([], g, k => {
3141
+ U([], g, k => {
2878
3142
  hd(a, ud(a, [k[0], null].concat(k.slice(1)), null, e, f), b - 1);
2879
3143
  return [];
2880
3144
  });
2881
3145
  }, _embind_register_integer:(a, b, c, d, e) => {
2882
- b = Q(b);
3146
+ b = S(b);
2883
3147
  -1 === e && (e = 4294967295);
2884
3148
  e = k => k;
2885
3149
  if (0 === d) {
@@ -2897,10 +3161,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2897
3161
  return new e(z.buffer, F[f + 4 >> 2], F[f >> 2]);
2898
3162
  }
2899
3163
  var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][b];
2900
- c = Q(c);
3164
+ c = S(c);
2901
3165
  Uc(a, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Wb:!0,});
2902
3166
  }, _embind_register_std_string:(a, b) => {
2903
- b = Q(b);
3167
+ b = S(b);
2904
3168
  var c = "std::string" === b;
2905
3169
  Uc(a, {name:b, fromWireType:function(d) {
2906
3170
  var e = F[d >> 2], f = d + 4;
@@ -2908,7 +3172,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2908
3172
  for (var g = f, k = 0; k <= e; ++k) {
2909
3173
  var p = f + k;
2910
3174
  if (k == e || 0 == B[p]) {
2911
- g = g ? pb(B, g, p - g) : "";
3175
+ g = g ? qb(B, g, p - g) : "";
2912
3176
  if (void 0 === n) {
2913
3177
  var n = g;
2914
3178
  } else {
@@ -2932,11 +3196,11 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2932
3196
  if (!(f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array)) {
2933
3197
  throw new P("Cannot pass non-string to std::string");
2934
3198
  }
2935
- var g = c && f ? rb(e) : e.length;
3199
+ var g = c && f ? sb(e) : e.length;
2936
3200
  var k = ce(4 + g + 1), p = k + 4;
2937
3201
  F[k >> 2] = g;
2938
3202
  if (c && f) {
2939
- tb(e, B, p, g + 1);
3203
+ ub(e, B, p, g + 1);
2940
3204
  } else {
2941
3205
  if (f) {
2942
3206
  for (f = 0; f < g; ++f) {
@@ -2958,12 +3222,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2958
3222
  Ec(d);
2959
3223
  },});
2960
3224
  }, _embind_register_std_wstring:(a, b, c) => {
2961
- c = Q(c);
3225
+ c = S(c);
2962
3226
  if (2 === b) {
2963
3227
  var d = Ed;
2964
3228
  var e = Fd;
2965
3229
  var f = Gd;
2966
- var g = k => Fa[k >> 1];
3230
+ var g = k => Ia[k >> 1];
2967
3231
  } else {
2968
3232
  4 === b && (d = Hd, e = Id, f = Jd, g = k => F[k >> 2]);
2969
3233
  }
@@ -2989,31 +3253,35 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2989
3253
  Ec(k);
2990
3254
  }});
2991
3255
  }, _embind_register_value_object:(a, b, c, d, e, f) => {
2992
- Pc[a] = {name:Q(b), Oa:U(c, d), P:U(e, f), fb:[],};
3256
+ Pc[a] = {name:S(b), Oa:W(c, d), P:W(e, f), fb:[],};
2993
3257
  }, _embind_register_value_object_field:(a, b, c, d, e, f, g, k, p, n) => {
2994
- Pc[a].fb.push({Pb:Q(b), Vb:c, Tb:U(d, e), Ub:f, lc:g, kc:U(k, p), mc:n,});
3258
+ Pc[a].fb.push({Pb:S(b), Vb:c, Tb:W(d, e), Ub:f, lc:g, kc:W(k, p), mc:n,});
2995
3259
  }, _embind_register_void:(a, b) => {
2996
- b = Q(b);
3260
+ b = S(b);
2997
3261
  Uc(a, {Jc:!0, name:b, argPackAdvance:0, fromWireType:() => {
2998
3262
  }, toWireType:() => {
2999
3263
  },});
3000
3264
  }, _emscripten_get_now_is_monotonic:() => 1, _emscripten_memcpy_js:(a, b, c) => B.copyWithin(a, b, b + c), _emscripten_throw_longjmp:() => {
3001
3265
  throw Infinity;
3002
3266
  }, _emval_as:(a, b, c) => {
3003
- a = sc(a);
3267
+ a = Q(a);
3004
3268
  b = Gc(b, "emval::as");
3005
3269
  return Kd(b, c, a);
3270
+ }, _emval_call:(a, b, c, d) => {
3271
+ a = Ld[a];
3272
+ b = Q(b);
3273
+ return a(null, b, c, d);
3006
3274
  }, _emval_call_method:(a, b, c, d, e) => {
3007
- a = Nd[a];
3008
- b = sc(b);
3009
- c = Md(c);
3275
+ a = Ld[a];
3276
+ b = Q(b);
3277
+ c = Nd(c);
3010
3278
  return a(b, b[c], d, e);
3011
3279
  }, _emval_decref:yd, _emval_get_method_caller:(a, b, c) => {
3012
3280
  var d = Pd(a, b), e = d.shift();
3013
3281
  a--;
3014
3282
  var f = Array(a);
3015
3283
  b = `methodCaller<(${d.map(g => g.name).join(", ")}) => ${e.name}>`;
3016
- return Od(pc(b, (g, k, p, n) => {
3284
+ return Od(qc(b, (g, k, p, n) => {
3017
3285
  for (var t = 0, x = 0; x < a; ++x) {
3018
3286
  f[x] = d[x].readValueFromPointer(n + t), t += d[x].argPackAdvance;
3019
3287
  }
@@ -3021,22 +3289,22 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3021
3289
  return Kd(e, p, g);
3022
3290
  }));
3023
3291
  }, _emval_get_module_property:a => {
3024
- a = Md(a);
3292
+ a = Nd(a);
3025
3293
  return tc(m[a]);
3026
3294
  }, _emval_get_property:(a, b) => {
3027
- a = sc(a);
3028
- b = sc(b);
3295
+ a = Q(a);
3296
+ b = Q(b);
3029
3297
  return tc(a[b]);
3030
3298
  }, _emval_incref:a => {
3031
- 9 < a && (rc[a + 1] += 1);
3032
- }, _emval_new_array:() => tc([]), _emval_new_cstring:a => tc(Md(a)), _emval_new_object:() => tc({}), _emval_run_destructors:a => {
3033
- var b = sc(a);
3299
+ 9 < a && (sc[a + 1] += 1);
3300
+ }, _emval_new_array:() => tc([]), _emval_new_cstring:a => tc(Nd(a)), _emval_new_object:() => tc({}), _emval_run_destructors:a => {
3301
+ var b = Q(a);
3034
3302
  Qc(b);
3035
3303
  yd(a);
3036
3304
  }, _emval_set_property:(a, b, c) => {
3037
- a = sc(a);
3038
- b = sc(b);
3039
- c = sc(c);
3305
+ a = Q(a);
3306
+ b = Q(b);
3307
+ c = Q(c);
3040
3308
  a[b] = c;
3041
3309
  }, _emval_take_value:(a, b) => {
3042
3310
  a = Gc(a, "_emval_take_value");
@@ -3075,17 +3343,17 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3075
3343
  a = p => p.toLocaleTimeString(void 0, {hour12:!1, timeZoneName:"short"}).split(" ")[1];
3076
3344
  f = a(f);
3077
3345
  g = a(g);
3078
- k < e ? (tb(f, B, c, 17), tb(g, B, d, 17)) : (tb(f, B, d, 17), tb(g, B, c, 17));
3346
+ k < e ? (ub(f, B, c, 17), ub(g, B, d, 17)) : (ub(f, B, d, 17), ub(g, B, c, 17));
3079
3347
  }, emscripten_asm_const_int:(a, b, c) => {
3080
3348
  Ud.length = 0;
3081
3349
  for (var d; d = B[b++];) {
3082
3350
  var e = 105 != d;
3083
3351
  e &= 112 != d;
3084
3352
  c += e && c % 8 ? 4 : 0;
3085
- Ud.push(112 == d ? F[c >> 2] : 105 == d ? C[c >> 2] : Ja[c >> 3]);
3353
+ Ud.push(112 == d ? F[c >> 2] : 105 == d ? C[c >> 2] : Ka[c >> 3]);
3086
3354
  c += e ? 8 : 4;
3087
3355
  }
3088
- return db[a](...Ud);
3356
+ return eb[a](...Ud);
3089
3357
  }, emscripten_date_now:() => Date.now(), emscripten_get_now:() => performance.now(), emscripten_resize_heap:a => {
3090
3358
  var b = B.length;
3091
3359
  a >>>= 0;
@@ -3098,10 +3366,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3098
3366
  var e = Math;
3099
3367
  d = Math.max(a, d);
3100
3368
  a: {
3101
- e = (e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) - Ca.buffer.byteLength + 65535) / 65536;
3369
+ e = (e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) - Da.buffer.byteLength + 65535) / 65536;
3102
3370
  try {
3103
- Ca.grow(e);
3104
- Ka();
3371
+ Da.grow(e);
3372
+ La();
3105
3373
  var f = 1;
3106
3374
  break a;
3107
3375
  } catch (g) {
@@ -3134,7 +3402,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3134
3402
  return 0;
3135
3403
  }, fd_close:function(a) {
3136
3404
  try {
3137
- var b = Wb(a);
3405
+ var b = Xb(a);
3138
3406
  if (null === b.X) {
3139
3407
  throw new N(8);
3140
3408
  }
@@ -3144,12 +3412,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3144
3412
  } catch (c) {
3145
3413
  throw c;
3146
3414
  } finally {
3147
- Jb[b.X] = null;
3415
+ Kb[b.X] = null;
3148
3416
  }
3149
3417
  b.X = null;
3150
3418
  return 0;
3151
3419
  } catch (c) {
3152
- if ("undefined" == typeof oc || "ErrnoError" !== c.name) {
3420
+ if ("undefined" == typeof pc || "ErrnoError" !== c.name) {
3153
3421
  throw c;
3154
3422
  }
3155
3423
  return c.aa;
@@ -3157,7 +3425,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3157
3425
  }, fd_read:function(a, b, c, d) {
3158
3426
  try {
3159
3427
  a: {
3160
- var e = Wb(a);
3428
+ var e = Xb(a);
3161
3429
  a = b;
3162
3430
  for (var f, g = b = 0; g < c; g++) {
3163
3431
  var k = F[a >> 2], p = F[a + 4 >> 2];
@@ -3202,7 +3470,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3202
3470
  F[d >> 2] = r;
3203
3471
  return 0;
3204
3472
  } catch (D) {
3205
- if ("undefined" == typeof oc || "ErrnoError" !== D.name) {
3473
+ if ("undefined" == typeof pc || "ErrnoError" !== D.name) {
3206
3474
  throw D;
3207
3475
  }
3208
3476
  return D.aa;
@@ -3213,15 +3481,15 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3213
3481
  if (isNaN(b)) {
3214
3482
  return 61;
3215
3483
  }
3216
- var f = Wb(a);
3217
- kc(f, b, d);
3218
- $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)];
3219
- C[e >> 2] = $a[0];
3220
- C[e + 4 >> 2] = $a[1];
3484
+ var f = Xb(a);
3485
+ lc(f, b, d);
3486
+ ab = [f.position >>> 0, ($a = f.position, 1.0 <= +Math.abs($a) ? 0.0 < $a ? +Math.floor($a / 4294967296.0) >>> 0 : ~~+Math.ceil(($a - +(~~$a >>> 0)) / 4294967296.0) >>> 0 : 0)];
3487
+ C[e >> 2] = ab[0];
3488
+ C[e + 4 >> 2] = ab[1];
3221
3489
  f.La && 0 === b && 0 === d && (f.La = null);
3222
3490
  return 0;
3223
3491
  } catch (g) {
3224
- if ("undefined" == typeof oc || "ErrnoError" !== g.name) {
3492
+ if ("undefined" == typeof pc || "ErrnoError" !== g.name) {
3225
3493
  throw g;
3226
3494
  }
3227
3495
  return g.aa;
@@ -3229,7 +3497,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3229
3497
  }, fd_write:function(a, b, c, d) {
3230
3498
  try {
3231
3499
  a: {
3232
- var e = Wb(a);
3500
+ var e = Xb(a);
3233
3501
  a = b;
3234
3502
  for (var f, g = b = 0; g < c; g++) {
3235
3503
  var k = F[a >> 2], p = F[a + 4 >> 2];
@@ -3250,7 +3518,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3250
3518
  if (!n.m.write) {
3251
3519
  throw new N(28);
3252
3520
  }
3253
- n.seekable && n.flags & 1024 && kc(n, 0, 2);
3521
+ n.seekable && n.flags & 1024 && lc(n, 0, 2);
3254
3522
  var u = "undefined" != typeof y;
3255
3523
  if (!u) {
3256
3524
  y = n.position;
@@ -3270,265 +3538,131 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3270
3538
  I = b;
3271
3539
  }
3272
3540
  F[d >> 2] = I;
3273
- return 0;
3274
- } catch (w) {
3275
- if ("undefined" == typeof oc || "ErrnoError" !== w.name) {
3276
- throw w;
3277
- }
3278
- return w.aa;
3279
- }
3280
- }, invoke_vii:de, isWindowsBrowser:function() {
3281
- return -1 < navigator.platform.indexOf("Win");
3282
- }, strftime:$d, strftime_l:(a, b, c, d) => $d(a, b, c, d)}, W = function() {
3283
- function a(c) {
3284
- W = c.exports;
3285
- Ca = W.memory;
3286
- Ka();
3287
- kd = W.__indirect_function_table;
3288
- Ma.unshift(W.__wasm_call_ctors);
3289
- Pa--;
3290
- m.monitorRunDependencies?.(Pa);
3291
- 0 == Pa && (null !== Qa && (clearInterval(Qa), Qa = null), Ra && (c = Ra, Ra = null, c()));
3292
- return W;
3293
- }
3294
- var b = {env:ee, wasi_snapshot_preview1:ee,};
3295
- Pa++;
3296
- m.monitorRunDependencies?.(Pa);
3297
- if (m.instantiateWasm) {
3298
- try {
3299
- return m.instantiateWasm(b, a);
3300
- } catch (c) {
3301
- Aa(`Module.instantiateWasm callback failed with error: ${c}`), ca(c);
3302
- }
3303
- }
3304
- Ua ||= Ta("canvas_advanced.wasm") ? "canvas_advanced.wasm" : m.locateFile ? m.locateFile("canvas_advanced.wasm", ta) : ta + "canvas_advanced.wasm";
3305
- Ya(b, function(c) {
3306
- a(c.instance);
3307
- }).catch(ca);
3308
- return {};
3309
- }(), Ec = a => (Ec = W.free)(a), ce = a => (ce = W.malloc)(a), Dc = a => (Dc = W.__getTypeName)(a), ab = m._ma_device__on_notification_unlocked = a => (ab = m._ma_device__on_notification_unlocked = W.ma_device__on_notification_unlocked)(a);
3310
- m._ma_malloc_emscripten = (a, b) => (m._ma_malloc_emscripten = W.ma_malloc_emscripten)(a, b);
3311
- m._ma_free_emscripten = (a, b) => (m._ma_free_emscripten = W.ma_free_emscripten)(a, b);
3312
- var bb = m._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (bb = m._ma_device_process_pcm_frames_capture__webaudio = W.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), cb = m._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (cb = m._ma_device_process_pcm_frames_playback__webaudio = W.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), fe = (a, b) => (fe = W.setThrew)(a, b), ge = a => (ge = W._emscripten_stack_restore)(a), he = () => (he = W.emscripten_stack_get_current)();
3313
- m.dynCall_iiji = (a, b, c, d, e) => (m.dynCall_iiji = W.dynCall_iiji)(a, b, c, d, e);
3314
- m.dynCall_jiji = (a, b, c, d, e) => (m.dynCall_jiji = W.dynCall_jiji)(a, b, c, d, e);
3315
- m.dynCall_iiiji = (a, b, c, d, e, f) => (m.dynCall_iiiji = W.dynCall_iiiji)(a, b, c, d, e, f);
3316
- m.dynCall_iij = (a, b, c, d) => (m.dynCall_iij = W.dynCall_iij)(a, b, c, d);
3317
- m.dynCall_jii = (a, b, c) => (m.dynCall_jii = W.dynCall_jii)(a, b, c);
3318
- m.dynCall_viijii = (a, b, c, d, e, f, g) => (m.dynCall_viijii = W.dynCall_viijii)(a, b, c, d, e, f, g);
3319
- m.dynCall_iiiiij = (a, b, c, d, e, f, g) => (m.dynCall_iiiiij = W.dynCall_iiiiij)(a, b, c, d, e, f, g);
3320
- m.dynCall_iiiiijj = (a, b, c, d, e, f, g, k, p) => (m.dynCall_iiiiijj = W.dynCall_iiiiijj)(a, b, c, d, e, f, g, k, p);
3321
- m.dynCall_iiiiiijj = (a, b, c, d, e, f, g, k, p, n) => (m.dynCall_iiiiiijj = W.dynCall_iiiiiijj)(a, b, c, d, e, f, g, k, p, n);
3322
- function de(a, b, c) {
3323
- var d = he();
3324
- try {
3325
- ld(a)(b, c);
3326
- } catch (e) {
3327
- ge(d);
3328
- if (e !== e + 0) {
3329
- throw e;
3330
- }
3331
- fe(1, 0);
3332
- }
3333
- }
3334
- var ie;
3335
- Ra = function je() {
3336
- ie || ke();
3337
- ie || (Ra = je);
3338
- };
3339
- function ke() {
3340
- function a() {
3341
- if (!ie && (ie = !0, m.calledRun = !0, !Da)) {
3342
- m.noFSInit || lc || (lc = !0, m.stdin = m.stdin, m.stdout = m.stdout, m.stderr = m.stderr, m.stdin ? mc("stdin", m.stdin) : hc("/dev/tty", "/dev/stdin"), m.stdout ? mc("stdout", null, m.stdout) : hc("/dev/tty", "/dev/stdout"), m.stderr ? mc("stderr", null, m.stderr) : hc("/dev/tty1", "/dev/stderr"), ic("/dev/stdin", 0), ic("/dev/stdout", 1), ic("/dev/stderr", 1));
3343
- Mb = !1;
3344
- eb(Ma);
3345
- ba(m);
3346
- if (m.onRuntimeInitialized) {
3347
- m.onRuntimeInitialized();
3348
- }
3349
- if (m.postRun) {
3350
- for ("function" == typeof m.postRun && (m.postRun = [m.postRun]); m.postRun.length;) {
3351
- var b = m.postRun.shift();
3352
- Na.unshift(b);
3353
- }
3354
- }
3355
- eb(Na);
3356
- }
3357
- }
3358
- if (!(0 < Pa)) {
3359
- if (m.preRun) {
3360
- for ("function" == typeof m.preRun && (m.preRun = [m.preRun]); m.preRun.length;) {
3361
- Oa();
3362
- }
3363
- }
3364
- eb(La);
3365
- 0 < Pa || (m.setStatus ? (m.setStatus("Running..."), setTimeout(function() {
3366
- setTimeout(function() {
3367
- m.setStatus("");
3368
- }, 1);
3369
- a();
3370
- }, 1)) : a());
3371
- }
3372
- }
3373
- if (m.preInit) {
3374
- for ("function" == typeof m.preInit && (m.preInit = [m.preInit]); 0 < m.preInit.length;) {
3375
- m.preInit.pop()();
3376
- }
3377
- }
3378
- ke();
3379
- moduleRtn = da;
3380
-
3381
-
3382
-
3383
- return moduleRtn;
3384
- }
3385
- );
3386
- })();
3387
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
3388
-
3389
-
3390
- /***/ }),
3391
- /* 2 */
3392
- /***/ ((module) => {
3393
-
3394
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.35.4","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"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3395
-
3396
- /***/ }),
3397
- /* 3 */
3398
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3399
-
3400
- __webpack_require__.r(__webpack_exports__);
3401
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3402
- /* harmony export */ Animation: () => (/* reexport safe */ _Animation__WEBPACK_IMPORTED_MODULE_0__.Animation)
3403
- /* harmony export */ });
3404
- /* harmony import */ var _Animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
3405
-
3406
-
3407
-
3408
- /***/ }),
3409
- /* 4 */
3410
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3411
-
3412
- __webpack_require__.r(__webpack_exports__);
3413
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3414
- /* harmony export */ Animation: () => (/* binding */ Animation)
3415
- /* harmony export */ });
3416
- /**
3417
- * Represents an animation that can be played on an Artboard.
3418
- * Wraps animations and instances from the runtime and keeps track of playback state.
3419
- *
3420
- * The `Animation` class manages the state and behavior of a single animation instance,
3421
- * including its current time, loop count, and ability to scrub to a specific time.
3422
- *
3423
- * The class provides methods to advance the animation, apply its interpolated keyframe
3424
- * values to the Artboard, and clean up the underlying animation instance when the
3425
- * animation is no longer needed.
3426
- */
3427
- var Animation = /** @class */ (function () {
3428
- /**
3429
- * Constructs a new animation
3430
- * @constructor
3431
- * @param {any} animation: runtime animation object
3432
- * @param {any} instance: runtime animation instance object
3433
- */
3434
- function Animation(animation, artboard, runtime, playing) {
3435
- this.animation = animation;
3436
- this.artboard = artboard;
3437
- this.playing = playing;
3438
- this.loopCount = 0;
3439
- /**
3440
- * The time to which the animation should move to on the next render.
3441
- * If not null, the animation will scrub to this time instead of advancing by the given time.
3442
- */
3443
- this.scrubTo = null;
3444
- this.instance = new runtime.LinearAnimationInstance(animation, artboard);
3445
- }
3446
- Object.defineProperty(Animation.prototype, "name", {
3447
- /**
3448
- * Returns the animation's name
3449
- */
3450
- get: function () {
3451
- return this.animation.name;
3452
- },
3453
- enumerable: false,
3454
- configurable: true
3455
- });
3456
- Object.defineProperty(Animation.prototype, "time", {
3457
- /**
3458
- * Returns the animation's name
3459
- */
3460
- get: function () {
3461
- return this.instance.time;
3462
- },
3463
- /**
3464
- * Sets the animation's current time
3465
- */
3466
- set: function (value) {
3467
- this.instance.time = value;
3468
- },
3469
- enumerable: false,
3470
- configurable: true
3471
- });
3472
- Object.defineProperty(Animation.prototype, "loopValue", {
3473
- /**
3474
- * Returns the animation's loop type
3475
- */
3476
- get: function () {
3477
- return this.animation.loopValue;
3478
- },
3479
- enumerable: false,
3480
- configurable: true
3481
- });
3482
- Object.defineProperty(Animation.prototype, "needsScrub", {
3483
- /**
3484
- * Indicates whether the animation needs to be scrubbed.
3485
- * @returns `true` if the animation needs to be scrubbed, `false` otherwise.
3486
- */
3487
- get: function () {
3488
- return this.scrubTo !== null;
3489
- },
3490
- enumerable: false,
3491
- configurable: true
3492
- });
3493
- /**
3494
- * Advances the animation by the give time. If the animation needs scrubbing,
3495
- * time is ignored and the stored scrub value is used.
3496
- * @param time the time to advance the animation by if no scrubbing required
3497
- */
3498
- Animation.prototype.advance = function (time) {
3499
- if (this.scrubTo === null) {
3500
- this.instance.advance(time);
3501
- }
3502
- else {
3503
- this.instance.time = 0;
3504
- this.instance.advance(this.scrubTo);
3505
- this.scrubTo = null;
3541
+ return 0;
3542
+ } catch (w) {
3543
+ if ("undefined" == typeof pc || "ErrnoError" !== w.name) {
3544
+ throw w;
3545
+ }
3546
+ return w.aa;
3547
+ }
3548
+ }, invoke_vii:de, isWindowsBrowser:function() {
3549
+ return -1 < navigator.platform.indexOf("Win");
3550
+ }, strftime:$d, strftime_l:(a, b, c, d) => $d(a, b, c, d)}, Z = function() {
3551
+ function a(c) {
3552
+ Z = c.exports;
3553
+ Da = Z.memory;
3554
+ La();
3555
+ kd = Z.__indirect_function_table;
3556
+ Na.unshift(Z.__wasm_call_ctors);
3557
+ Qa--;
3558
+ m.monitorRunDependencies?.(Qa);
3559
+ 0 == Qa && (null !== Ra && (clearInterval(Ra), Ra = null), Sa && (c = Sa, Sa = null, c()));
3560
+ return Z;
3561
+ }
3562
+ var b = {env:ee, wasi_snapshot_preview1:ee,};
3563
+ Qa++;
3564
+ m.monitorRunDependencies?.(Qa);
3565
+ if (m.instantiateWasm) {
3566
+ try {
3567
+ return m.instantiateWasm(b, a);
3568
+ } catch (c) {
3569
+ Ba(`Module.instantiateWasm callback failed with error: ${c}`), da(c);
3570
+ }
3571
+ }
3572
+ Va ||= Ua("canvas_advanced.wasm") ? "canvas_advanced.wasm" : m.locateFile ? m.locateFile("canvas_advanced.wasm", ua) : ua + "canvas_advanced.wasm";
3573
+ Za(b, function(c) {
3574
+ a(c.instance);
3575
+ }).catch(da);
3576
+ return {};
3577
+ }(), Ec = a => (Ec = Z.free)(a), ce = a => (ce = Z.malloc)(a), Dc = a => (Dc = Z.__getTypeName)(a), bb = m._ma_device__on_notification_unlocked = a => (bb = m._ma_device__on_notification_unlocked = Z.ma_device__on_notification_unlocked)(a);
3578
+ m._ma_malloc_emscripten = (a, b) => (m._ma_malloc_emscripten = Z.ma_malloc_emscripten)(a, b);
3579
+ m._ma_free_emscripten = (a, b) => (m._ma_free_emscripten = Z.ma_free_emscripten)(a, b);
3580
+ var cb = m._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (cb = m._ma_device_process_pcm_frames_capture__webaudio = Z.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), db = m._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (db = m._ma_device_process_pcm_frames_playback__webaudio = Z.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), fe = (a, b) => (fe = Z.setThrew)(a, b), ge = a => (ge = Z._emscripten_stack_restore)(a), he = () => (he = Z.emscripten_stack_get_current)();
3581
+ m.dynCall_iiji = (a, b, c, d, e) => (m.dynCall_iiji = Z.dynCall_iiji)(a, b, c, d, e);
3582
+ m.dynCall_jiji = (a, b, c, d, e) => (m.dynCall_jiji = Z.dynCall_jiji)(a, b, c, d, e);
3583
+ m.dynCall_iiiji = (a, b, c, d, e, f) => (m.dynCall_iiiji = Z.dynCall_iiiji)(a, b, c, d, e, f);
3584
+ m.dynCall_iij = (a, b, c, d) => (m.dynCall_iij = Z.dynCall_iij)(a, b, c, d);
3585
+ m.dynCall_jii = (a, b, c) => (m.dynCall_jii = Z.dynCall_jii)(a, b, c);
3586
+ m.dynCall_viijii = (a, b, c, d, e, f, g) => (m.dynCall_viijii = Z.dynCall_viijii)(a, b, c, d, e, f, g);
3587
+ m.dynCall_iiiiij = (a, b, c, d, e, f, g) => (m.dynCall_iiiiij = Z.dynCall_iiiiij)(a, b, c, d, e, f, g);
3588
+ m.dynCall_iiiiijj = (a, b, c, d, e, f, g, k, p) => (m.dynCall_iiiiijj = Z.dynCall_iiiiijj)(a, b, c, d, e, f, g, k, p);
3589
+ m.dynCall_iiiiiijj = (a, b, c, d, e, f, g, k, p, n) => (m.dynCall_iiiiiijj = Z.dynCall_iiiiiijj)(a, b, c, d, e, f, g, k, p, n);
3590
+ function de(a, b, c) {
3591
+ var d = he();
3592
+ try {
3593
+ ld(a)(b, c);
3594
+ } catch (e) {
3595
+ ge(d);
3596
+ if (e !== e + 0) {
3597
+ throw e;
3598
+ }
3599
+ fe(1, 0);
3600
+ }
3601
+ }
3602
+ var ie;
3603
+ Sa = function je() {
3604
+ ie || ke();
3605
+ ie || (Sa = je);
3606
+ };
3607
+ function ke() {
3608
+ function a() {
3609
+ if (!ie && (ie = !0, m.calledRun = !0, !Ea)) {
3610
+ m.noFSInit || mc || (mc = !0, m.stdin = m.stdin, m.stdout = m.stdout, m.stderr = m.stderr, m.stdin ? nc("stdin", m.stdin) : ic("/dev/tty", "/dev/stdin"), m.stdout ? nc("stdout", null, m.stdout) : ic("/dev/tty", "/dev/stdout"), m.stderr ? nc("stderr", null, m.stderr) : ic("/dev/tty1", "/dev/stderr"), jc("/dev/stdin", 0), jc("/dev/stdout", 1), jc("/dev/stderr", 1));
3611
+ Nb = !1;
3612
+ fb(Na);
3613
+ ca(m);
3614
+ if (m.onRuntimeInitialized) {
3615
+ m.onRuntimeInitialized();
3616
+ }
3617
+ if (m.postRun) {
3618
+ for ("function" == typeof m.postRun && (m.postRun = [m.postRun]); m.postRun.length;) {
3619
+ var b = m.postRun.shift();
3620
+ Oa.unshift(b);
3506
3621
  }
3507
- };
3508
- /**
3509
- * Apply interpolated keyframe values to the artboard. This should be called after calling
3510
- * .advance() on an animation instance so that new values are applied to properties.
3511
- *
3512
- * Note: This does not advance the artboard, which updates all objects on the artboard
3513
- * @param mix - Mix value for the animation from 0 to 1
3514
- */
3515
- Animation.prototype.apply = function (mix) {
3516
- this.instance.apply(mix);
3517
- };
3518
- /**
3519
- * Deletes the backing Wasm animation instance; once this is called, this
3520
- * animation is no more.
3521
- */
3522
- Animation.prototype.cleanup = function () {
3523
- this.instance.delete();
3524
- };
3525
- return Animation;
3526
- }());
3622
+ }
3623
+ fb(Oa);
3624
+ }
3625
+ }
3626
+ if (!(0 < Qa)) {
3627
+ if (m.preRun) {
3628
+ for ("function" == typeof m.preRun && (m.preRun = [m.preRun]); m.preRun.length;) {
3629
+ Pa();
3630
+ }
3631
+ }
3632
+ fb(Ma);
3633
+ 0 < Qa || (m.setStatus ? (m.setStatus("Running..."), setTimeout(function() {
3634
+ setTimeout(function() {
3635
+ m.setStatus("");
3636
+ }, 1);
3637
+ a();
3638
+ }, 1)) : a());
3639
+ }
3640
+ }
3641
+ if (m.preInit) {
3642
+ for ("function" == typeof m.preInit && (m.preInit = [m.preInit]); 0 < m.preInit.length;) {
3643
+ m.preInit.pop()();
3644
+ }
3645
+ }
3646
+ ke();
3647
+ moduleRtn = ea;
3648
+
3649
+
3527
3650
 
3651
+ return moduleRtn;
3652
+ }
3653
+ );
3654
+ })();
3655
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
3528
3656
 
3529
3657
 
3530
3658
  /***/ }),
3531
3659
  /* 5 */
3660
+ /***/ ((module) => {
3661
+
3662
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.37.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"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3663
+
3664
+ /***/ }),
3665
+ /* 6 */
3532
3666
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3533
3667
 
3534
3668
  __webpack_require__.r(__webpack_exports__);
@@ -3543,21 +3677,24 @@ __webpack_require__.r(__webpack_exports__);
3543
3677
  /* harmony export */ FontWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FontWrapper),
3544
3678
  /* harmony export */ ImageAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageAssetWrapper),
3545
3679
  /* harmony export */ ImageWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageWrapper),
3680
+ /* harmony export */ RiveFont: () => (/* reexport safe */ _riveFont__WEBPACK_IMPORTED_MODULE_3__.RiveFont),
3546
3681
  /* harmony export */ createFinalization: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.createFinalization),
3547
3682
  /* harmony export */ finalizationRegistry: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry),
3548
3683
  /* harmony export */ registerTouchInteractions: () => (/* reexport safe */ _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__.registerTouchInteractions),
3549
3684
  /* harmony export */ sanitizeUrl: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__.sanitizeUrl)
3550
3685
  /* harmony export */ });
3551
- /* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
3552
- /* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
3553
- /* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
3686
+ /* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
3687
+ /* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
3688
+ /* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
3689
+ /* harmony import */ var _riveFont__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
3690
+
3554
3691
 
3555
3692
 
3556
3693
 
3557
3694
 
3558
3695
 
3559
3696
  /***/ }),
3560
- /* 6 */
3697
+ /* 7 */
3561
3698
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3562
3699
 
3563
3700
  __webpack_require__.r(__webpack_exports__);
@@ -3811,7 +3948,7 @@ var registerTouchInteractions = function (_a) {
3811
3948
 
3812
3949
 
3813
3950
  /***/ }),
3814
- /* 7 */
3951
+ /* 8 */
3815
3952
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3816
3953
 
3817
3954
  __webpack_require__.r(__webpack_exports__);
@@ -3864,7 +4001,7 @@ function sanitizeUrl(url) {
3864
4001
 
3865
4002
 
3866
4003
  /***/ }),
3867
- /* 8 */
4004
+ /* 9 */
3868
4005
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3869
4006
 
3870
4007
  __webpack_require__.r(__webpack_exports__);
@@ -4142,6 +4279,79 @@ var createFinalization = function (target, finalizable) {
4142
4279
 
4143
4280
 
4144
4281
 
4282
+ /***/ }),
4283
+ /* 10 */
4284
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4285
+
4286
+ __webpack_require__.r(__webpack_exports__);
4287
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4288
+ /* harmony export */ RiveFont: () => (/* binding */ RiveFont)
4289
+ /* harmony export */ });
4290
+ /* harmony import */ var _runtimeLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
4291
+
4292
+ // Class to manage fallback fonts for Rive.
4293
+ var RiveFont = /** @class */ (function () {
4294
+ // Class is never instantiated
4295
+ function RiveFont() {
4296
+ }
4297
+ /**
4298
+ * Set a callback to dynamically set a list of fallback fonts based on the missing glyph and/or style of the default font.
4299
+ * Set null to clear the callback.
4300
+ * @param fontCallback Callback to set a list of fallback fonts.
4301
+ */
4302
+ RiveFont.setFallbackFontCallback = function (fontCallback) {
4303
+ RiveFont._fallbackFontCallback = fontCallback !== null && fontCallback !== void 0 ? fontCallback : null;
4304
+ RiveFont._wireFallbackProc();
4305
+ };
4306
+ // Get the pointer value to the Embind Font object from FontWrapper
4307
+ RiveFont._fontToPtr = function (fontWrapper) {
4308
+ var _a;
4309
+ if (fontWrapper == null)
4310
+ return null;
4311
+ var embindFont = fontWrapper.nativeFont;
4312
+ var ptr = (_a = embindFont === null || embindFont === void 0 ? void 0 : embindFont.ptr) === null || _a === void 0 ? void 0 : _a.call(embindFont);
4313
+ return ptr !== null && ptr !== void 0 ? ptr : null;
4314
+ };
4315
+ RiveFont._getFallbackPtr = function (fonts, index) {
4316
+ if (index < 0 || index >= fonts.length)
4317
+ return null;
4318
+ return RiveFont._fontToPtr(fonts[index]);
4319
+ };
4320
+ // Create the callback Rive expects to use for fallback fonts (regardless if set via a user-supplied static list, or callback)
4321
+ // 1. Ensure WASM is ready
4322
+ // 2. Bias for checking user callback over static list of fonts and pass it down to Rive to store as reference
4323
+ // - When calling the user callback, check if we have any fonts left to check, and if not, return null to indicate there are no more fallbacks to try.
4324
+ // - If the user callback returns an array of fonts, pass the pointer value to Rive of the font to try
4325
+ // 3. If no callback is provided, or the callback returns null, try the static list of fonts if they set any
4326
+ // 4. If no fallback method is set, return null.
4327
+ RiveFont._wireFallbackProc = function () {
4328
+ _runtimeLoader__WEBPACK_IMPORTED_MODULE_0__.RuntimeLoader.getInstance(function (rive) {
4329
+ var cb = RiveFont._fallbackFontCallback;
4330
+ if (cb) {
4331
+ rive.setFallbackFontCallback((function (missingGlyph, fallbackFontIndex, weight) {
4332
+ var fontsReturned = cb(missingGlyph, weight);
4333
+ if (fontsReturned) {
4334
+ if (Array.isArray(fontsReturned)) {
4335
+ return RiveFont._getFallbackPtr(fontsReturned, fallbackFontIndex);
4336
+ }
4337
+ // If the user callback only returns a single font, provide it to Rive the first time, otherwise if Rive
4338
+ // calls back a second time, return null to indicate there are no more fallbacks to try.
4339
+ return fallbackFontIndex === 0 ? RiveFont._fontToPtr(fontsReturned) : null;
4340
+ }
4341
+ return null;
4342
+ }));
4343
+ }
4344
+ else {
4345
+ rive.setFallbackFontCallback(null);
4346
+ }
4347
+ });
4348
+ };
4349
+ RiveFont._fallbackFontCallback = null;
4350
+ return RiveFont;
4351
+ }());
4352
+
4353
+
4354
+
4145
4355
  /***/ })
4146
4356
  /******/ ]);
4147
4357
  /************************************************************************/
@@ -4215,7 +4425,8 @@ __webpack_require__.r(__webpack_exports__);
4215
4425
  /* harmony export */ Rive: () => (/* binding */ Rive),
4216
4426
  /* harmony export */ RiveEventType: () => (/* binding */ RiveEventType),
4217
4427
  /* harmony export */ RiveFile: () => (/* binding */ RiveFile),
4218
- /* harmony export */ RuntimeLoader: () => (/* binding */ RuntimeLoader),
4428
+ /* harmony export */ RiveFont: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.RiveFont),
4429
+ /* harmony export */ RuntimeLoader: () => (/* reexport safe */ _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader),
4219
4430
  /* harmony export */ StateMachineInput: () => (/* binding */ StateMachineInput),
4220
4431
  /* harmony export */ StateMachineInputType: () => (/* binding */ StateMachineInputType),
4221
4432
  /* harmony export */ Testing: () => (/* binding */ Testing),
@@ -4235,10 +4446,9 @@ __webpack_require__.r(__webpack_exports__);
4235
4446
  /* harmony export */ decodeFont: () => (/* binding */ decodeFont),
4236
4447
  /* harmony export */ decodeImage: () => (/* binding */ decodeImage)
4237
4448
  /* harmony export */ });
4238
- /* harmony import */ var _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
4239
- /* harmony import */ var package_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
4240
- /* harmony import */ var _animation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
4241
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
4449
+ /* harmony import */ var _animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
4450
+ /* harmony import */ var _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
4451
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
4242
4452
  var __extends = (undefined && undefined.__extends) || (function () {
4243
4453
  var extendStatics = function (d, b) {
4244
4454
  extendStatics = Object.setPrototypeOf ||
@@ -4313,7 +4523,6 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
4313
4523
 
4314
4524
 
4315
4525
 
4316
-
4317
4526
  var RiveError = /** @class */ (function (_super) {
4318
4527
  __extends(RiveError, _super);
4319
4528
  function RiveError() {
@@ -4323,6 +4532,7 @@ var RiveError = /** @class */ (function (_super) {
4323
4532
  }
4324
4533
  return RiveError;
4325
4534
  }(Error));
4535
+
4326
4536
  // #regions helpers
4327
4537
  var resolveErrorMessage = function (error) {
4328
4538
  return error && error.isHandledError
@@ -4447,104 +4657,8 @@ var Layout = /** @class */ (function () {
4447
4657
  return Layout;
4448
4658
  }());
4449
4659
 
4450
- // Runtime singleton; use getInstance to provide a callback that returns the
4451
- // Rive runtime
4452
- var RuntimeLoader = /** @class */ (function () {
4453
- // Class is never instantiated
4454
- function RuntimeLoader() {
4455
- }
4456
- // Loads the runtime
4457
- RuntimeLoader.loadRuntime = function () {
4458
- _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
4459
- // Loads Wasm bundle
4460
- locateFile: function () { return RuntimeLoader.wasmURL; },
4461
- })
4462
- .then(function (rive) {
4463
- var _a;
4464
- RuntimeLoader.runtime = rive;
4465
- // Fire all the callbacks
4466
- while (RuntimeLoader.callBackQueue.length > 0) {
4467
- (_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
4468
- }
4469
- })
4470
- .catch(function (error) {
4471
- // Capture specific error details
4472
- var errorDetails = {
4473
- message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error",
4474
- type: (error === null || error === void 0 ? void 0 : error.name) || "Error",
4475
- // Some browsers may provide additional WebAssembly-specific details
4476
- wasmError: error instanceof WebAssembly.CompileError ||
4477
- error instanceof WebAssembly.RuntimeError,
4478
- originalError: error,
4479
- };
4480
- // Log detailed error for debugging
4481
- console.debug("Rive WASM load error details:", errorDetails);
4482
- // In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
4483
- // This `rive_fallback.wasm` is compiled to support older architecture.
4484
- // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
4485
- var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
4486
- if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
4487
- console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
4488
- RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
4489
- RuntimeLoader.loadRuntime();
4490
- }
4491
- else {
4492
- var errorMessage = [
4493
- "Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
4494
- "Possible reasons:",
4495
- "- Network connection is down",
4496
- "- WebAssembly is not supported in this environment",
4497
- "- The WASM file is corrupted or incompatible",
4498
- "\nError details:",
4499
- "- Type: ".concat(errorDetails.type),
4500
- "- Message: ".concat(errorDetails.message),
4501
- "- WebAssembly-specific error: ".concat(errorDetails.wasmError),
4502
- "\nTo resolve, you may need to:",
4503
- "1. Check your network connection",
4504
- "2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
4505
- "3. Call RuntimeLoader.loadRuntime() again",
4506
- ].join("\n");
4507
- console.error(errorMessage);
4508
- }
4509
- });
4510
- };
4511
- // Provides a runtime instance via a callback
4512
- RuntimeLoader.getInstance = function (callback) {
4513
- // If it's not loading, start loading runtime
4514
- if (!RuntimeLoader.isLoading) {
4515
- RuntimeLoader.isLoading = true;
4516
- RuntimeLoader.loadRuntime();
4517
- }
4518
- if (!RuntimeLoader.runtime) {
4519
- RuntimeLoader.callBackQueue.push(callback);
4520
- }
4521
- else {
4522
- callback(RuntimeLoader.runtime);
4523
- }
4524
- };
4525
- // Provides a runtime instance via a promise
4526
- RuntimeLoader.awaitInstance = function () {
4527
- return new Promise(function (resolve) {
4528
- return RuntimeLoader.getInstance(function (rive) { return resolve(rive); });
4529
- });
4530
- };
4531
- // Manually sets the wasm url
4532
- RuntimeLoader.setWasmUrl = function (url) {
4533
- RuntimeLoader.wasmURL = url;
4534
- };
4535
- // Gets the current wasm url
4536
- RuntimeLoader.getWasmUrl = function () {
4537
- return RuntimeLoader.wasmURL;
4538
- };
4539
- // Flag to indicate that loading has started/completed
4540
- RuntimeLoader.isLoading = false;
4541
- // List of callbacks for the runtime that come in while loading
4542
- RuntimeLoader.callBackQueue = [];
4543
- // Path to the Wasm file; default path works for testing only;
4544
- // if embedded wasm is used then this is never used.
4545
- RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
4546
- return RuntimeLoader;
4547
- }());
4660
+ // #endregion
4661
+ // #region runtime
4548
4662
 
4549
4663
  // #endregion
4550
4664
  // #region state machines
@@ -4823,7 +4937,7 @@ var Animator = /** @class */ (function () {
4823
4937
  // Try to create a new animation instance
4824
4938
  var anim = this.artboard.animationByName(animatables[i]);
4825
4939
  if (anim) {
4826
- var newAnimation = new _animation__WEBPACK_IMPORTED_MODULE_2__.Animation(anim, this.artboard, this.runtime, playing);
4940
+ var newAnimation = new _animation__WEBPACK_IMPORTED_MODULE_0__.Animation(anim, this.artboard, this.runtime, playing);
4827
4941
  // Display the first frame of the specified animation
4828
4942
  newAnimation.advance(0);
4829
4943
  newAnimation.apply(1.0);
@@ -4877,7 +4991,7 @@ var Animator = /** @class */ (function () {
4877
4991
  // Try to create a new animation instance
4878
4992
  var anim = this.artboard.animationByName(animatables[i]);
4879
4993
  if (anim) {
4880
- var newAnimation = new _animation__WEBPACK_IMPORTED_MODULE_2__.Animation(anim, this.artboard, this.runtime, playing);
4994
+ var newAnimation = new _animation__WEBPACK_IMPORTED_MODULE_0__.Animation(anim, this.artboard, this.runtime, playing);
4881
4995
  // Display the first frame of the specified animation
4882
4996
  newAnimation.advance(0);
4883
4997
  newAnimation.apply(1.0);
@@ -5480,6 +5594,8 @@ var RiveFile = /** @class */ (function () {
5480
5594
  function RiveFile(params) {
5481
5595
  // Allow the runtime to automatically load assets hosted in Rive's runtime.
5482
5596
  this.enableRiveAssetCDN = true;
5597
+ // When true, emits performance.mark/measure entries during RiveFile load.
5598
+ this.enablePerfMarks = false;
5483
5599
  this.referenceCount = 0;
5484
5600
  this.destroyed = false;
5485
5601
  this.selfUnref = false;
@@ -5492,6 +5608,9 @@ var RiveFile = /** @class */ (function () {
5492
5608
  typeof params.enableRiveAssetCDN == "boolean"
5493
5609
  ? params.enableRiveAssetCDN
5494
5610
  : true;
5611
+ this.enablePerfMarks = !!params.enablePerfMarks;
5612
+ if (this.enablePerfMarks)
5613
+ _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.enablePerfMarks = true;
5495
5614
  // New event management system
5496
5615
  this.eventManager = new EventManager();
5497
5616
  if (params.onLoad)
@@ -5517,7 +5636,7 @@ var RiveFile = /** @class */ (function () {
5517
5636
  return __generator(this, function (_c) {
5518
5637
  switch (_c.label) {
5519
5638
  case 0:
5520
- if (!this.src) return [3 /*break*/, 2];
5639
+ if (!(this.src && !this.buffer)) return [3 /*break*/, 2];
5521
5640
  _a = this;
5522
5641
  return [4 /*yield*/, loadRiveFile(this.src)];
5523
5642
  case 1:
@@ -5528,17 +5647,22 @@ var RiveFile = /** @class */ (function () {
5528
5647
  return [2 /*return*/];
5529
5648
  }
5530
5649
  if (this.assetLoader) {
5531
- loaderWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.CustomFileAssetLoaderWrapper(this.runtime, this.assetLoader);
5650
+ loaderWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.CustomFileAssetLoaderWrapper(this.runtime, this.assetLoader);
5532
5651
  loader = loaderWrapper.assetLoader;
5533
5652
  }
5534
5653
  // Load the Rive file
5654
+ if (this.enablePerfMarks)
5655
+ performance.mark('rive:file-load:start');
5535
5656
  _b = this;
5536
5657
  return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN)];
5537
5658
  case 3:
5538
- // Load the Rive file
5539
5659
  _b.file = _c.sent();
5540
- fileFinalizer = new _utils__WEBPACK_IMPORTED_MODULE_3__.FileFinalizer(this.file);
5541
- _utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(this, fileFinalizer);
5660
+ if (this.enablePerfMarks) {
5661
+ performance.mark('rive:file-load:end');
5662
+ performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');
5663
+ }
5664
+ fileFinalizer = new _utils__WEBPACK_IMPORTED_MODULE_2__.FileFinalizer(this.file);
5665
+ _utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(this, fileFinalizer);
5542
5666
  if (this.destroyed) {
5543
5667
  this.releaseFile();
5544
5668
  return [2 /*return*/];
@@ -5557,9 +5681,45 @@ var RiveFile = /** @class */ (function () {
5557
5681
  });
5558
5682
  });
5559
5683
  };
5684
+ RiveFile.prototype.loadRiveFileBytes = function () {
5685
+ return __awaiter(this, void 0, void 0, function () {
5686
+ var bufferPromise;
5687
+ return __generator(this, function (_a) {
5688
+ if (this.enablePerfMarks)
5689
+ performance.mark('rive:fetch-riv:start');
5690
+ bufferPromise = this.src
5691
+ ? loadRiveFile(this.src)
5692
+ : Promise.resolve(this.buffer);
5693
+ if (this.enablePerfMarks && this.src) {
5694
+ bufferPromise.then(function () {
5695
+ performance.mark('rive:fetch-riv:end');
5696
+ performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');
5697
+ });
5698
+ }
5699
+ return [2 /*return*/, bufferPromise];
5700
+ });
5701
+ });
5702
+ };
5703
+ RiveFile.prototype.loadRuntime = function () {
5704
+ return __awaiter(this, void 0, void 0, function () {
5705
+ var runtimePromise;
5706
+ return __generator(this, function (_a) {
5707
+ if (this.enablePerfMarks)
5708
+ performance.mark('rive:await-wasm:start');
5709
+ runtimePromise = _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.awaitInstance();
5710
+ if (this.enablePerfMarks) {
5711
+ runtimePromise.then(function () {
5712
+ performance.mark('rive:await-wasm:end');
5713
+ performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');
5714
+ });
5715
+ }
5716
+ return [2 /*return*/, runtimePromise];
5717
+ });
5718
+ });
5719
+ };
5560
5720
  RiveFile.prototype.init = function () {
5561
5721
  return __awaiter(this, void 0, void 0, function () {
5562
- var _a, error_1;
5722
+ var _a, bufferResolved, runtimeResolved, error_1;
5563
5723
  return __generator(this, function (_b) {
5564
5724
  switch (_b.label) {
5565
5725
  case 0:
@@ -5571,16 +5731,24 @@ var RiveFile = /** @class */ (function () {
5571
5731
  _b.label = 1;
5572
5732
  case 1:
5573
5733
  _b.trys.push([1, 4, , 5]);
5574
- _a = this;
5575
- return [4 /*yield*/, RuntimeLoader.awaitInstance()];
5734
+ return [4 /*yield*/, Promise.all([this.loadRiveFileBytes(), this.loadRuntime()])];
5576
5735
  case 2:
5577
- _a.runtime = _b.sent();
5736
+ _a = _b.sent(), bufferResolved = _a[0], runtimeResolved = _a[1];
5578
5737
  if (this.destroyed) {
5579
5738
  return [2 /*return*/];
5580
5739
  }
5740
+ // .riv file buffer and WASM runtime instance
5741
+ this.buffer = bufferResolved;
5742
+ this.runtime = runtimeResolved;
5743
+ if (this.enablePerfMarks)
5744
+ performance.mark('rive:init-data:start');
5581
5745
  return [4 /*yield*/, this.initData()];
5582
5746
  case 3:
5583
5747
  _b.sent();
5748
+ if (this.enablePerfMarks) {
5749
+ performance.mark('rive:init-data:end');
5750
+ performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');
5751
+ }
5584
5752
  return [3 /*break*/, 5];
5585
5753
  case 4:
5586
5754
  error_1 = _b.sent();
@@ -5652,7 +5820,7 @@ var RiveFile = /** @class */ (function () {
5652
5820
  RiveFile.prototype.createBindableArtboard = function (nativeBindableArtboard) {
5653
5821
  if (nativeBindableArtboard != null) {
5654
5822
  var bindableArtboard = new BindableArtboard(nativeBindableArtboard);
5655
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(bindableArtboard, bindableArtboard.nativeArtboard);
5823
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(bindableArtboard, bindableArtboard.nativeArtboard);
5656
5824
  this.bindableArtboards.push(bindableArtboard);
5657
5825
  return bindableArtboard;
5658
5826
  }
@@ -5748,6 +5916,8 @@ var Rive = /** @class */ (function () {
5748
5916
  this._viewModelInstance = null;
5749
5917
  this._dataEnums = null;
5750
5918
  this.drawOptimization = DrawOptimizationOptions.DrawOnChanged;
5919
+ // When true, emits performance.mark/measure entries for load and render.
5920
+ this.enablePerfMarks = false;
5751
5921
  // Durations to generate a frame for the last second. Used for performance profiling.
5752
5922
  this.durations = [];
5753
5923
  this.frameTimes = [];
@@ -5794,6 +5964,9 @@ var Rive = /** @class */ (function () {
5794
5964
  params.enableRiveAssetCDN === undefined
5795
5965
  ? true
5796
5966
  : params.enableRiveAssetCDN;
5967
+ this.enablePerfMarks = !!params.enablePerfMarks;
5968
+ if (this.enablePerfMarks)
5969
+ _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.enablePerfMarks = true;
5797
5970
  // New event management system
5798
5971
  this.eventManager = new EventManager();
5799
5972
  if (params.onLoad)
@@ -5886,7 +6059,7 @@ var Rive = /** @class */ (function () {
5886
6059
  this.loaded = false;
5887
6060
  this.readyForPlaying = false;
5888
6061
  // Ensure the runtime is loaded
5889
- RuntimeLoader.awaitInstance()
6062
+ _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.awaitInstance()
5890
6063
  .then(function (runtime) {
5891
6064
  if (_this.destroyed) {
5892
6065
  return;
@@ -5895,7 +6068,13 @@ var Rive = /** @class */ (function () {
5895
6068
  _this.removeRiveListeners();
5896
6069
  _this.deleteRiveRenderer();
5897
6070
  // Get the canvas where you want to render the animation and create a renderer
6071
+ if (_this.enablePerfMarks)
6072
+ performance.mark('rive:make-renderer:start');
5898
6073
  _this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
6074
+ if (_this.enablePerfMarks) {
6075
+ performance.mark('rive:make-renderer:end');
6076
+ performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');
6077
+ }
5899
6078
  // Initial size adjustment based on devicePixelRatio if no width/height are
5900
6079
  // specified explicitly
5901
6080
  if (!(_this.canvas.width || _this.canvas.height)) {
@@ -5938,7 +6117,7 @@ var Rive = /** @class */ (function () {
5938
6117
  "isTouchScrollEnabled" in riveListenerOptions) {
5939
6118
  touchScrollEnabledOption = riveListenerOptions.isTouchScrollEnabled;
5940
6119
  }
5941
- this.eventCleanup = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.registerTouchInteractions)({
6120
+ this.eventCleanup = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.registerTouchInteractions)({
5942
6121
  canvas: this.canvas,
5943
6122
  artboard: this.artboard,
5944
6123
  stateMachines: activeStateMachines,
@@ -6007,6 +6186,7 @@ var Rive = /** @class */ (function () {
6007
6186
  buffer: this.buffer,
6008
6187
  enableRiveAssetCDN: this.enableRiveAssetCDN,
6009
6188
  assetLoader: this.assetLoader,
6189
+ enablePerfMarks: this.enablePerfMarks,
6010
6190
  });
6011
6191
  this.riveFile = riveFile;
6012
6192
  return [4 /*yield*/, riveFile.init()];
@@ -6099,7 +6279,7 @@ var Rive = /** @class */ (function () {
6099
6279
  var runtimeInstance = viewModel.defaultInstance();
6100
6280
  if (runtimeInstance !== null) {
6101
6281
  var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
6102
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, viewModelInstance.runtimeInstance);
6282
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, viewModelInstance.runtimeInstance);
6103
6283
  this.bindViewModelInstance(viewModelInstance);
6104
6284
  }
6105
6285
  }
@@ -6173,6 +6353,9 @@ var Rive = /** @class */ (function () {
6173
6353
  // - Advance non-paused state machines by the elapsed number of seconds
6174
6354
  // - Advance to the first frame even when autoplay is false
6175
6355
  var activeStateMachines = this.animator.stateMachines.filter(function (a) { return a.playing; });
6356
+ // Instrument the first 3 frames so the Performance timeline shows precise
6357
+ // per-call latency for advance, draw, and flush without polluting the trace.
6358
+ var _perfFrame = this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;
6176
6359
  for (var _b = 0, activeStateMachines_1 = activeStateMachines; _b < activeStateMachines_1.length; _b++) {
6177
6360
  var stateMachine = activeStateMachines_1[_b];
6178
6361
  // Check for events before the current frame's state machine advance
@@ -6190,10 +6373,10 @@ var Rive = /** @class */ (function () {
6190
6373
  if (this.automaticallyHandleEvents) {
6191
6374
  var newAnchorTag = document.createElement("a");
6192
6375
  var _c = event_1, url = _c.url, target = _c.target;
6193
- var sanitizedUrl = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.sanitizeUrl)(url);
6376
+ var sanitizedUrl = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.sanitizeUrl)(url);
6194
6377
  url && newAnchorTag.setAttribute("href", sanitizedUrl);
6195
6378
  target && newAnchorTag.setAttribute("target", target);
6196
- if (sanitizedUrl && sanitizedUrl !== _utils__WEBPACK_IMPORTED_MODULE_3__.BLANK_URL) {
6379
+ if (sanitizedUrl && sanitizedUrl !== _utils__WEBPACK_IMPORTED_MODULE_2__.BLANK_URL) {
6197
6380
  newAnchorTag.click();
6198
6381
  }
6199
6382
  }
@@ -6207,7 +6390,13 @@ var Rive = /** @class */ (function () {
6207
6390
  }
6208
6391
  }
6209
6392
  }
6393
+ if (_perfFrame >= 0)
6394
+ performance.mark("rive:sm-advance:start:f".concat(_perfFrame));
6210
6395
  stateMachine.advanceAndApply(elapsedTime);
6396
+ if (_perfFrame >= 0) {
6397
+ performance.mark("rive:sm-advance:end:f".concat(_perfFrame));
6398
+ performance.measure("rive:sm-advance:f".concat(_perfFrame), "rive:sm-advance:start:f".concat(_perfFrame), "rive:sm-advance:end:f".concat(_perfFrame));
6399
+ }
6211
6400
  // stateMachine.instance.apply(this.artboard);
6212
6401
  }
6213
6402
  // Once the animations have been applied to the artboard, advance it
@@ -6227,10 +6416,28 @@ var Rive = /** @class */ (function () {
6227
6416
  renderer.clear();
6228
6417
  renderer.save();
6229
6418
  // Update the renderer alignment if necessary
6419
+ if (_perfFrame >= 0)
6420
+ performance.mark("rive:align-renderer:start:f".concat(_perfFrame));
6230
6421
  this.alignRenderer();
6422
+ if (_perfFrame >= 0) {
6423
+ performance.mark("rive:align-renderer:end:f".concat(_perfFrame));
6424
+ performance.measure("rive:align-renderer:f".concat(_perfFrame), "rive:align-renderer:start:f".concat(_perfFrame), "rive:align-renderer:end:f".concat(_perfFrame));
6425
+ }
6426
+ if (_perfFrame >= 0)
6427
+ performance.mark("rive:artboard-draw:start:f".concat(_perfFrame));
6231
6428
  this.artboard.draw(renderer);
6429
+ if (_perfFrame >= 0) {
6430
+ performance.mark("rive:artboard-draw:end:f".concat(_perfFrame));
6431
+ performance.measure("rive:artboard-draw:f".concat(_perfFrame), "rive:artboard-draw:start:f".concat(_perfFrame), "rive:artboard-draw:end:f".concat(_perfFrame));
6432
+ }
6232
6433
  renderer.restore();
6434
+ if (_perfFrame >= 0)
6435
+ performance.mark("rive:renderer-flush:start:f".concat(_perfFrame));
6233
6436
  renderer.flush();
6437
+ if (_perfFrame >= 0) {
6438
+ performance.mark("rive:renderer-flush:end:f".concat(_perfFrame));
6439
+ performance.measure("rive:renderer-flush:f".concat(_perfFrame), "rive:renderer-flush:start:f".concat(_perfFrame), "rive:renderer-flush:end:f".concat(_perfFrame));
6440
+ }
6234
6441
  this._needsRedraw = false;
6235
6442
  }
6236
6443
  }
@@ -7240,7 +7447,7 @@ var ViewModel = /** @class */ (function () {
7240
7447
  var instance = this._viewModel.instanceByIndex(index);
7241
7448
  if (instance !== null) {
7242
7449
  var viewModelInstance = new ViewModelInstance(instance, null);
7243
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, instance);
7450
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, instance);
7244
7451
  return viewModelInstance;
7245
7452
  }
7246
7453
  return null;
@@ -7249,7 +7456,7 @@ var ViewModel = /** @class */ (function () {
7249
7456
  var instance = this._viewModel.instanceByName(name);
7250
7457
  if (instance !== null) {
7251
7458
  var viewModelInstance = new ViewModelInstance(instance, null);
7252
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, instance);
7459
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, instance);
7253
7460
  return viewModelInstance;
7254
7461
  }
7255
7462
  return null;
@@ -7258,7 +7465,7 @@ var ViewModel = /** @class */ (function () {
7258
7465
  var runtimeInstance = this._viewModel.defaultInstance();
7259
7466
  if (runtimeInstance !== null) {
7260
7467
  var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
7261
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, runtimeInstance);
7468
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, runtimeInstance);
7262
7469
  return viewModelInstance;
7263
7470
  }
7264
7471
  return null;
@@ -7267,7 +7474,7 @@ var ViewModel = /** @class */ (function () {
7267
7474
  var runtimeInstance = this._viewModel.instance();
7268
7475
  if (runtimeInstance !== null) {
7269
7476
  var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
7270
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, runtimeInstance);
7477
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, runtimeInstance);
7271
7478
  return viewModelInstance;
7272
7479
  }
7273
7480
  return null;
@@ -7532,7 +7739,7 @@ var ViewModelInstance = /** @class */ (function () {
7532
7739
  var viewModelRuntimeInstance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.viewModel(name);
7533
7740
  if (viewModelRuntimeInstance !== null) {
7534
7741
  var viewModelInstance = new ViewModelInstance(viewModelRuntimeInstance, this);
7535
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, viewModelRuntimeInstance);
7742
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, viewModelRuntimeInstance);
7536
7743
  viewModelInstance.internalIncrementReferenceCount();
7537
7744
  this._viewModelInstances.set(name, viewModelInstance);
7538
7745
  return viewModelInstance;
@@ -7696,6 +7903,17 @@ var ViewModelInstance = /** @class */ (function () {
7696
7903
  enumerable: false,
7697
7904
  configurable: true
7698
7905
  });
7906
+ Object.defineProperty(ViewModelInstance.prototype, "viewModelName", {
7907
+ /**
7908
+ * Get the name of the ViewModel definition this instance was created from.
7909
+ */
7910
+ get: function () {
7911
+ var _a, _b;
7912
+ return (_b = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.getViewModelName()) !== null && _b !== void 0 ? _b : "";
7913
+ },
7914
+ enumerable: false,
7915
+ configurable: true
7916
+ });
7699
7917
  ViewModelInstance.prototype.internalIncrementReferenceCount = function () {
7700
7918
  this._referenceCount++;
7701
7919
  };
@@ -7938,7 +8156,7 @@ var ViewModelInstanceList = /** @class */ (function (_super) {
7938
8156
  var runtimeInstance = this._viewModelInstanceValue.instanceAt(index);
7939
8157
  if (runtimeInstance != null) {
7940
8158
  var viewModelInstance = new ViewModelInstance(runtimeInstance, this._parentViewModel);
7941
- (0,_utils__WEBPACK_IMPORTED_MODULE_3__.createFinalization)(viewModelInstance, runtimeInstance);
8159
+ (0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, runtimeInstance);
7942
8160
  return viewModelInstance;
7943
8161
  }
7944
8162
  return null;
@@ -8091,15 +8309,15 @@ var decodeAudio = function (bytes) { return __awaiter(void 0, void 0, void 0, fu
8091
8309
  switch (_a.label) {
8092
8310
  case 0:
8093
8311
  decodedPromise = new Promise(function (resolve) {
8094
- return RuntimeLoader.getInstance(function (rive) {
8312
+ return _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.getInstance(function (rive) {
8095
8313
  rive.decodeAudio(bytes, resolve);
8096
8314
  });
8097
8315
  });
8098
8316
  return [4 /*yield*/, decodedPromise];
8099
8317
  case 1:
8100
8318
  audio = _a.sent();
8101
- audioWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.AudioWrapper(audio);
8102
- _utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(audioWrapper, audio);
8319
+ audioWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.AudioWrapper(audio);
8320
+ _utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(audioWrapper, audio);
8103
8321
  return [2 /*return*/, audioWrapper];
8104
8322
  }
8105
8323
  });
@@ -8116,15 +8334,15 @@ var decodeImage = function (bytes) { return __awaiter(void 0, void 0, void 0, fu
8116
8334
  switch (_a.label) {
8117
8335
  case 0:
8118
8336
  decodedPromise = new Promise(function (resolve) {
8119
- return RuntimeLoader.getInstance(function (rive) {
8337
+ return _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.getInstance(function (rive) {
8120
8338
  rive.decodeImage(bytes, resolve);
8121
8339
  });
8122
8340
  });
8123
8341
  return [4 /*yield*/, decodedPromise];
8124
8342
  case 1:
8125
8343
  image = _a.sent();
8126
- imageWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.ImageWrapper(image);
8127
- _utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(imageWrapper, image);
8344
+ imageWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.ImageWrapper(image);
8345
+ _utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(imageWrapper, image);
8128
8346
  return [2 /*return*/, imageWrapper];
8129
8347
  }
8130
8348
  });
@@ -8141,15 +8359,15 @@ var decodeFont = function (bytes) { return __awaiter(void 0, void 0, void 0, fun
8141
8359
  switch (_a.label) {
8142
8360
  case 0:
8143
8361
  decodedPromise = new Promise(function (resolve) {
8144
- return RuntimeLoader.getInstance(function (rive) {
8362
+ return _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.getInstance(function (rive) {
8145
8363
  rive.decodeFont(bytes, resolve);
8146
8364
  });
8147
8365
  });
8148
8366
  return [4 /*yield*/, decodedPromise];
8149
8367
  case 1:
8150
8368
  font = _a.sent();
8151
- fontWrapper = new _utils__WEBPACK_IMPORTED_MODULE_3__.FontWrapper(font);
8152
- _utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(fontWrapper, font);
8369
+ fontWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.FontWrapper(font);
8370
+ _utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(fontWrapper, font);
8153
8371
  return [2 /*return*/, fontWrapper];
8154
8372
  }
8155
8373
  });