@rive-app/webgl2 2.37.5 → 2.37.6

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
@@ -174,6 +174,16 @@ var RuntimeLoader = /** @class */ (function () {
174
174
  // Class is never instantiated
175
175
  function RuntimeLoader() {
176
176
  }
177
+ // Rejects all pending awaitInstance() promises and resets loading state so
178
+ // the next call to getInstance() / awaitInstance() can retry with a new URL.
179
+ RuntimeLoader.notifyError = function (error) {
180
+ var _a;
181
+ RuntimeLoader.isLoading = false;
182
+ while (RuntimeLoader.errorCallbackQueue.length > 0) {
183
+ (_a = RuntimeLoader.errorCallbackQueue.shift()) === null || _a === void 0 ? void 0 : _a(error);
184
+ }
185
+ RuntimeLoader.callBackQueue = [];
186
+ };
177
187
  // Loads the runtime
178
188
  RuntimeLoader.loadRuntime = function () {
179
189
  // Capture the URL at call time so the catch closure always refers to the
@@ -192,6 +202,7 @@ var RuntimeLoader = /** @class */ (function () {
192
202
  performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');
193
203
  }
194
204
  RuntimeLoader.runtime = rive;
205
+ RuntimeLoader.errorCallbackQueue = [];
195
206
  // Fire all the callbacks
196
207
  while (RuntimeLoader.callBackQueue.length > 0) {
197
208
  (_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
@@ -244,14 +255,15 @@ var RuntimeLoader = /** @class */ (function () {
244
255
  "\nTo resolve, you may need to:",
245
256
  "1. Check your network connection",
246
257
  "2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
247
- "3. Call RuntimeLoader.loadRuntime() again",
258
+ "3. Call RuntimeLoader.awaitInstance() again",
248
259
  ].join("\n");
249
260
  console.error(errorMessage);
261
+ RuntimeLoader.notifyError(new Error(errorMessage));
250
262
  }
251
263
  });
252
264
  };
253
265
  // Provides a runtime instance via a callback
254
- RuntimeLoader.getInstance = function (callback) {
266
+ RuntimeLoader.getInstance = function (callback, onError) {
255
267
  // If it's not loading, start loading runtime
256
268
  if (!RuntimeLoader.isLoading) {
257
269
  RuntimeLoader.isLoading = true;
@@ -259,15 +271,18 @@ var RuntimeLoader = /** @class */ (function () {
259
271
  }
260
272
  if (!RuntimeLoader.runtime) {
261
273
  RuntimeLoader.callBackQueue.push(callback);
274
+ if (onError) {
275
+ RuntimeLoader.errorCallbackQueue.push(onError);
276
+ }
262
277
  }
263
278
  else {
264
279
  callback(RuntimeLoader.runtime);
265
280
  }
266
281
  };
267
- // Provides a runtime instance via a promise
282
+ // Provides a runtime instance via a promise; rejects if WASM fails to load.
268
283
  RuntimeLoader.awaitInstance = function () {
269
- return new Promise(function (resolve) {
270
- return RuntimeLoader.getInstance(function (rive) { return resolve(rive); });
284
+ return new Promise(function (resolve, reject) {
285
+ return RuntimeLoader.getInstance(resolve, reject);
271
286
  });
272
287
  };
273
288
  // Manually sets the wasm url
@@ -314,6 +329,8 @@ var RuntimeLoader = /** @class */ (function () {
314
329
  // the fallback entirely. Defaults to pulling from the jsdelivr CDN.
315
330
  RuntimeLoader.wasmFallbackURL = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
316
331
  RuntimeLoader.wasmBinary = null;
332
+ // Error callbacks enqueued from .getInstance()
333
+ RuntimeLoader.errorCallbackQueue = [];
317
334
  /**
318
335
  * When true, performance.mark / performance.measure entries are emitted for
319
336
  * WASM initialization.
@@ -357,7 +374,7 @@ function fa() {
357
374
  }
358
375
  });
359
376
  this.mb();
360
- e && e.Mb();
377
+ e && e.Nb();
361
378
  }
362
379
  let b = 0, c = 0, d = new Map(), e = null, f = null;
363
380
  this.requestAnimationFrame = function(g) {
@@ -370,14 +387,14 @@ function fa() {
370
387
  d.delete(g);
371
388
  b && 0 == d.size && (cancelAnimationFrame(b), b = 0);
372
389
  };
373
- this.Kb = function(g) {
390
+ this.Lb = function(g) {
374
391
  f && (document.body.remove(f), f = null);
375
392
  g || (f = document.createElement("div"), f.style.backgroundColor = "black", f.style.position = "fixed", f.style.right = 0, f.style.top = 0, f.style.color = "white", f.style.padding = "4px", f.innerHTML = "RIVE FPS", g = function(k) {
376
393
  f.innerHTML = "RIVE FPS " + k.toFixed(1);
377
394
  }, document.body.appendChild(f));
378
395
  e = new function() {
379
396
  let k = 0, p = 0;
380
- this.Mb = function() {
397
+ this.Nb = function() {
381
398
  var m = performance.now();
382
399
  p ? (++k, m -= p, 1000 < m && (g(1000 * k / m), k = p = 0)) : (p = m, k = 0);
383
400
  };
@@ -476,7 +493,7 @@ l.onRuntimeInitialized = function() {
476
493
  function a(r) {
477
494
  this.G = r;
478
495
  this.Ab = r.getContext("2d");
479
- this.Db = d;
496
+ this.Eb = d;
480
497
  this.S = [];
481
498
  this.ja = 0;
482
499
  this.clear = function() {
@@ -494,8 +511,8 @@ l.onRuntimeInitialized = function() {
494
511
  this.transform = function(u) {
495
512
  this.S.push(d.transform.bind(d, u));
496
513
  };
497
- this.align = function(u, z, A, C, G = 1.0) {
498
- this.S.push(d.align.bind(d, u, z, A, C, G));
514
+ this.align = function(u, z, A, C, H = 1.0) {
515
+ this.S.push(d.align.bind(d, u, z, A, C, H));
499
516
  };
500
517
  this.flush = function() {
501
518
  console.assert(0 == this.ja);
@@ -522,19 +539,19 @@ l.onRuntimeInitialized = function() {
522
539
  var C = A.delete;
523
540
  A.delete = function() {
524
541
  C.call(this);
525
- var G = this.La;
526
- q === w[G] && (q = null);
527
- "object" == typeof JSEvents && JSEvents.Kc(w[G].F.canvas);
528
- w[G] && w[G].F.canvas && (w[G].F.canvas.zb = void 0);
529
- this.La = this.G = this.Ma = this.T = w[G] = null;
542
+ var H = this.La;
543
+ q === w[H] && (q = null);
544
+ "object" == typeof JSEvents && JSEvents.Qc(w[H].F.canvas);
545
+ w[H] && w[H].F.canvas && (w[H].F.canvas.zb = void 0);
546
+ this.La = this.G = this.Ma = this.T = w[H] = null;
530
547
  };
531
548
  return A;
532
549
  }
533
550
  function c() {
534
551
  if (d) {
535
- var r = d.Cb, u = 0, z = 0, A = 0, C = Array(e.size), G = 0;
552
+ var r = d.Db, u = 0, z = 0, A = 0, C = Array(e.size), H = 0;
536
553
  for (var J of e) {
537
- J.ea = Math.min(J.G.width, r), J.da = Math.min(J.G.height, r), J.Ja = J.da * J.ea, u = Math.max(u, J.ea), z = Math.max(z, J.da), A += J.Ja, C[G++] = J;
554
+ J.ea = Math.min(J.G.width, r), J.da = Math.min(J.G.height, r), J.Ja = J.da * J.ea, u = Math.max(u, J.ea), z = Math.max(z, J.da), A += J.Ja, C[H++] = J;
538
555
  }
539
556
  e.clear();
540
557
  if (!(0 >= A)) {
@@ -548,10 +565,10 @@ l.onRuntimeInitialized = function() {
548
565
  A = new l.DynamicRectanizer(r);
549
566
  for (J = 0; J < C.length;) {
550
567
  A.reset(u, z);
551
- for (G = J; G < C.length; ++G) {
552
- var K = C[G], I = A.addRect(K.ea, K.da);
568
+ for (H = J; H < C.length; ++H) {
569
+ var K = C[H], I = A.addRect(K.ea, K.da);
553
570
  if (0 > I) {
554
- console.assert(G > J);
571
+ console.assert(H > J);
555
572
  break;
556
573
  }
557
574
  K.pa = I & 65535;
@@ -566,7 +583,7 @@ l.onRuntimeInitialized = function() {
566
583
  d.G.width != K && (d.G.width = K);
567
584
  d.G.height != I && (d.G.height = I);
568
585
  d.clear();
569
- for (K = J; K < G; ++K) {
586
+ for (K = J; K < H; ++K) {
570
587
  I = C[K];
571
588
  d.saveClipRect(I.pa, I.qa, I.pa + I.ea, I.qa + I.da);
572
589
  let Z = new l.Mat2D();
@@ -582,10 +599,10 @@ l.onRuntimeInitialized = function() {
582
599
  d.restoreClipRect();
583
600
  I.S = [];
584
601
  }
585
- for (d.flush(); J < G; ++J) {
602
+ for (d.flush(); J < H; ++J) {
586
603
  K = C[J], I = K.Ab, I.globalCompositeOperation = "copy", I.drawImage(d.G, K.pa, K.qa, K.ea, K.da, 0, 0, K.G.width, K.G.height);
587
604
  }
588
- J = G;
605
+ J = H;
589
606
  }
590
607
  }
591
608
  }
@@ -601,7 +618,7 @@ l.onRuntimeInitialized = function() {
601
618
  C.height = 1;
602
619
  d = b(C, A);
603
620
  d.Ya = !!d.T.getExtension("WEBGL_shader_pixel_local_storage");
604
- d.Cb = Math.min(d.T.getParameter(d.T.MAX_RENDERBUFFER_SIZE), d.T.getParameter(d.T.MAX_TEXTURE_SIZE));
621
+ d.Db = Math.min(d.T.getParameter(d.T.MAX_RENDERBUFFER_SIZE), d.T.getParameter(d.T.MAX_TEXTURE_SIZE));
605
622
  d.Ka = !d.Ya;
606
623
  if (A = d.T.getExtension("WEBGL_debug_renderer_info")) {
607
624
  C = d.T.getParameter(A.UNMASKED_RENDERER_WEBGL), d.T.getParameter(A.UNMASKED_VENDOR_WEBGL).includes("Google") && C.includes("ANGLE Metal Renderer") && (d.Ka = !1);
@@ -615,19 +632,19 @@ l.onRuntimeInitialized = function() {
615
632
  };
616
633
  const g = l.Artboard.prototype["delete"];
617
634
  l.Artboard.prototype["delete"] = function() {
618
- this.Eb = !0;
635
+ this.Fb = !0;
619
636
  g.call(this);
620
637
  };
621
638
  const k = l.Artboard.prototype.draw;
622
639
  l.Artboard.prototype.draw = function(r) {
623
640
  r.S ? r.S.push(() => {
624
- this.Eb || k.call(this, r.Db);
641
+ this.Fb || k.call(this, r.Eb);
625
642
  }) : k.call(this, r);
626
643
  };
627
644
  const p = new ha(), m = new ha(), t = new fa();
628
645
  l.requestAnimationFrame = t.requestAnimationFrame.bind(t);
629
646
  l.cancelAnimationFrame = t.cancelAnimationFrame.bind(t);
630
- l.enableFPSCounter = t.Kb.bind(t);
647
+ l.enableFPSCounter = t.Lb.bind(t);
631
648
  t.mb = c;
632
649
  l.resolveAnimationFrame = c;
633
650
  let v = l.load;
@@ -684,7 +701,7 @@ ma = null;
684
701
  l.thisProgram && (na = l.thisProgram);
685
702
  var ta;
686
703
  l.wasmBinary && (ta = l.wasmBinary);
687
- var ua, va = !1, B, D, E, wa, F, H, xa, ya;
704
+ var ua, va = !1, B, D, E, wa, F, G, xa, ya;
688
705
  function za() {
689
706
  var a = ua.buffer;
690
707
  l.HEAP8 = B = new Int8Array(a);
@@ -692,7 +709,7 @@ function za() {
692
709
  l.HEAPU8 = D = new Uint8Array(a);
693
710
  l.HEAPU16 = wa = new Uint16Array(a);
694
711
  l.HEAP32 = F = new Int32Array(a);
695
- l.HEAPU32 = H = new Uint32Array(a);
712
+ l.HEAPU32 = G = new Uint32Array(a);
696
713
  l.HEAPF32 = xa = new Float32Array(a);
697
714
  l.HEAPF64 = ya = new Float64Array(a);
698
715
  }
@@ -746,7 +763,7 @@ function Na(a, b) {
746
763
  return Ma(c, a, b);
747
764
  }));
748
765
  }
749
- var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
766
+ var Oa, Pa, Ta = {569592:(a, b, c, d, e) => {
750
767
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
751
768
  return 0;
752
769
  }
@@ -761,7 +778,7 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
761
778
  window.h.ha.ub = e;
762
779
  let f = window.h;
763
780
  f.C = [];
764
- f.lc = function(g) {
781
+ f.mc = function(g) {
765
782
  for (var k = 0; k < f.C.length; ++k) {
766
783
  if (null == f.C[k]) {
767
784
  return f.C[k] = g, k;
@@ -779,7 +796,7 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
779
796
  }
780
797
  }
781
798
  };
782
- f.Mc = function(g) {
799
+ f.Tc = function(g) {
783
800
  for (var k = 0; k < f.C.length; ++k) {
784
801
  if (f.C[k] == g) {
785
802
  return f.yb(k);
@@ -809,11 +826,11 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
809
826
  }
810
827
  window.h.Ea += 1;
811
828
  return 1;
812
- }, 567647:() => {
829
+ }, 571770:() => {
813
830
  "undefined" !== typeof window.h && (window.h.Xa.map(function(a) {
814
831
  document.removeEventListener(a, window.h.unlock, !0);
815
832
  }), --window.h.Ea, 0 === window.h.Ea && delete window.h);
816
- }, 567951:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 568055:() => {
833
+ }, 572074:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 572178:() => {
817
834
  try {
818
835
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
819
836
  a.close();
@@ -821,7 +838,7 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
821
838
  } catch (c) {
822
839
  return 0;
823
840
  }
824
- }, 568226:(a, b, c, d, e, f) => {
841
+ }, 572349:(a, b, c, d, e, f) => {
825
842
  if ("undefined" === typeof window.h) {
826
843
  return -1;
827
844
  }
@@ -866,8 +883,8 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
866
883
  });
867
884
  a == window.h.I.Ba && g.Y.connect(g.K.destination);
868
885
  g.nb = f;
869
- return window.h.lc(g);
870
- }, 571103:a => window.h.sa(a).K.sampleRate, 571176:a => {
886
+ return window.h.mc(g);
887
+ }, 575226:a => window.h.sa(a).K.sampleRate, 575299:a => {
871
888
  a = window.h.sa(a);
872
889
  void 0 !== a.Y && (a.Y.onaudioprocess = function() {
873
890
  }, a.Y.disconnect(), a.Y = void 0);
@@ -875,13 +892,13 @@ var Oa, Pa, Ta = {565469:(a, b, c, d, e) => {
875
892
  a.K.close();
876
893
  a.K = void 0;
877
894
  a.nb = void 0;
878
- }, 571576:a => {
895
+ }, 575699:a => {
879
896
  window.h.yb(a);
880
- }, 571626:a => {
897
+ }, 575749:a => {
881
898
  a = window.h.sa(a);
882
899
  a.K.resume();
883
900
  a.state = window.h.ha.ub;
884
- }, 571765:a => {
901
+ }, 575888:a => {
885
902
  a = window.h.sa(a);
886
903
  a.K.suspend();
887
904
  a.state = window.h.ha.stopped;
@@ -1095,11 +1112,11 @@ var lb = {open(a) {
1095
1112
  null === b || 10 === b ? (ra(L(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1096
1113
  }, ra(a) {
1097
1114
  a.H && 0 < a.H.length && (ra(L(a.H, 0)), a.H = []);
1098
- }, Vb() {
1099
- return {sc:25856, uc:5, rc:191, tc:35387, qc:[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,]};
1100
1115
  }, Wb() {
1101
- return 0;
1116
+ return {xc:25856, zc:5, wc:191, yc:35387, vc:[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
1117
  }, Xb() {
1118
+ return 0;
1119
+ }, Yb() {
1103
1120
  return [24, 80];
1104
1121
  },}, nb = {Sa(a, b) {
1105
1122
  null === b || 10 === b ? (sa(L(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
@@ -1122,23 +1139,23 @@ var N = {N:null, U() {
1122
1139
  c.timestamp = Date.now();
1123
1140
  a && (a.l[b] = c, a.timestamp = c.timestamp);
1124
1141
  return c;
1125
- }, Ac(a) {
1142
+ }, Fc(a) {
1126
1143
  return a.l ? a.l.subarray ? a.l.subarray(0, a.v) : new Uint8Array(a.l) : new Uint8Array(0);
1127
1144
  }, j:{X(a) {
1128
1145
  var b = {};
1129
- b.xc = 8192 === (a.mode & 61440) ? a.id : 1;
1130
- b.Cc = a.id;
1146
+ b.Cc = 8192 === (a.mode & 61440) ? a.id : 1;
1147
+ b.Hc = a.id;
1131
1148
  b.mode = a.mode;
1132
- b.Hc = 1;
1149
+ b.Nc = 1;
1133
1150
  b.uid = 0;
1134
- b.Bc = 0;
1151
+ b.Gc = 0;
1135
1152
  b.Da = a.Da;
1136
1153
  16384 === (a.mode & 61440) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.v : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
1137
- b.oc = new Date(a.timestamp);
1138
- b.Gc = new Date(a.timestamp);
1139
- b.vc = new Date(a.timestamp);
1140
- b.Fb = 4096;
1141
- b.pc = Math.ceil(b.size / b.Fb);
1154
+ b.tc = new Date(a.timestamp);
1155
+ b.Mc = new Date(a.timestamp);
1156
+ b.Ac = new Date(a.timestamp);
1157
+ b.Gb = 4096;
1158
+ b.uc = Math.ceil(b.size / b.Gb);
1142
1159
  return b;
1143
1160
  }, P(a, b) {
1144
1161
  void 0 !== b.mode && (a.mode = b.mode);
@@ -1269,7 +1286,7 @@ var N = {N:null, U() {
1269
1286
  } else {
1270
1287
  c = !1, b = a.byteOffset;
1271
1288
  }
1272
- return {o:b, nc:c};
1289
+ return {o:b, sc:c};
1273
1290
  }, lb(a, b, c, d) {
1274
1291
  N.m.write(a, b, 0, d, c, !1);
1275
1292
  return 0;
@@ -1374,7 +1391,7 @@ function tb(a, b) {
1374
1391
  if (c) {
1375
1392
  throw new M(c);
1376
1393
  }
1377
- for (c = zb[Gb(a.id, b)]; c; c = c.$b) {
1394
+ for (c = zb[Gb(a.id, b)]; c; c = c.ac) {
1378
1395
  var d = c.name;
1379
1396
  if (c.parent.id === a.id && d === b) {
1380
1397
  return c;
@@ -1385,7 +1402,7 @@ function tb(a, b) {
1385
1402
  function rb(a, b, c, d) {
1386
1403
  a = new Cb(a, b, c, d);
1387
1404
  b = Gb(a.parent.id, a.name);
1388
- a.$b = zb[b];
1405
+ a.ac = zb[b];
1389
1406
  return zb[b] = a;
1390
1407
  }
1391
1408
  function Ib(a) {
@@ -1437,7 +1454,7 @@ function Lb(a, b = -1) {
1437
1454
  }
1438
1455
  function Mb(a, b = -1) {
1439
1456
  a = Lb(a, b);
1440
- a.m?.zc?.(a);
1457
+ a.m?.Ec?.(a);
1441
1458
  return a;
1442
1459
  }
1443
1460
  var qb = {open(a) {
@@ -1465,11 +1482,11 @@ function Nb(a, b) {
1465
1482
  throw new M(54);
1466
1483
  }
1467
1484
  }
1468
- b = {type:a, Jc:{}, kb:b, Yb:[]};
1485
+ b = {type:a, Pc:{}, kb:b, Zb:[]};
1469
1486
  a = a.U(b);
1470
1487
  a.U = b;
1471
1488
  b.root = a;
1472
- c ? vb = a : d && (d.Aa = b, d.U && d.U.Yb.push(b));
1489
+ c ? vb = a : d && (d.Aa = b, d.U && d.U.Zb.push(b));
1473
1490
  }
1474
1491
  function Ob(a, b, c) {
1475
1492
  var d = Db(a, {parent:!0}).node;
@@ -1580,7 +1597,7 @@ function Sb(a, b, c) {
1580
1597
  c.j.P(c, {size:0, timestamp:Date.now()});
1581
1598
  }
1582
1599
  b &= -131713;
1583
- e = Lb({node:e, path:Fb(e), flags:b, seekable:!0, position:0, m:e.m, mc:[], error:!1});
1600
+ e = Lb({node:e, path:Fb(e), flags:b, seekable:!0, position:0, m:e.m, nc:[], error:!1});
1584
1601
  e.m.open && e.m.open(e);
1585
1602
  !l.logReadFiles || b & 1 || (Tb ||= {}, a in Tb || (Tb[a] = 1));
1586
1603
  return e;
@@ -1596,7 +1613,7 @@ function Ub(a, b, c) {
1596
1613
  throw new M(28);
1597
1614
  }
1598
1615
  a.position = a.m.aa(a, b, c);
1599
- a.mc = [];
1616
+ a.nc = [];
1600
1617
  }
1601
1618
  var Vb;
1602
1619
  function Wb(a, b, c) {
@@ -1712,7 +1729,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
1712
1729
  return null;
1713
1730
  }
1714
1731
  a = qc(a, b, c.B);
1715
- return null === a ? null : c.Ib(a);
1732
+ return null === a ? null : c.Jb(a);
1716
1733
  }, rc = {}, sc = (a, b) => {
1717
1734
  b = ic(a, b);
1718
1735
  return hc[b];
@@ -1750,7 +1767,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
1750
1767
  }
1751
1768
  };
1752
1769
  function yc(a) {
1753
- return this.fromWireType(H[a >> 2]);
1770
+ return this.fromWireType(G[a >> 2]);
1754
1771
  }
1755
1772
  var zc = {}, Ac = {}, T = (a, b, c) => {
1756
1773
  function d(k) {
@@ -1781,7 +1798,7 @@ function Bc(a, b, c = {}) {
1781
1798
  throw new P(`type "${d}" must have a positive integer typeid pointer`);
1782
1799
  }
1783
1800
  if (jc.hasOwnProperty(a)) {
1784
- if (c.Sb) {
1801
+ if (c.Tb) {
1785
1802
  return;
1786
1803
  }
1787
1804
  throw new P(`Cannot register type '${d}' twice`);
@@ -1824,7 +1841,7 @@ var Ec = (a, b, c) => {
1824
1841
  }
1825
1842
  l[a].A[c] = b;
1826
1843
  } else {
1827
- l[a] = b, void 0 !== c && (l[a].Ic = c);
1844
+ l[a] = b, void 0 !== c && (l[a].Oc = c);
1828
1845
  }
1829
1846
  }, Gc = a => {
1830
1847
  if (void 0 === a) {
@@ -1840,9 +1857,9 @@ function Hc(a, b, c, d, e, f, g, k) {
1840
1857
  this.M = c;
1841
1858
  this.O = d;
1842
1859
  this.B = e;
1843
- this.Nb = f;
1860
+ this.Ob = f;
1844
1861
  this.na = g;
1845
- this.Ib = k;
1862
+ this.Jb = k;
1846
1863
  this.ob = [];
1847
1864
  }
1848
1865
  var Ic = (a, b, c) => {
@@ -1896,7 +1913,7 @@ function Lc(a, b) {
1896
1913
  if (void 0 === b.g.D) {
1897
1914
  throw new P("Passing raw pointer to smart pointer is illegal");
1898
1915
  }
1899
- switch(this.fc) {
1916
+ switch(this.hc) {
1900
1917
  case 0:
1901
1918
  if (b.g.J === this) {
1902
1919
  c = b.g.D;
@@ -1912,7 +1929,7 @@ function Lc(a, b) {
1912
1929
  c = b.g.D;
1913
1930
  } else {
1914
1931
  var d = b.clone();
1915
- c = this.bc(c, ac(() => d["delete"]()));
1932
+ c = this.cc(c, ac(() => d["delete"]()));
1916
1933
  null !== a && a.push(this.O, c);
1917
1934
  }
1918
1935
  break;
@@ -1946,11 +1963,11 @@ function Nc(a, b, c, d, e, f, g, k, p, m, t) {
1946
1963
  this.Ra = c;
1947
1964
  this.ua = d;
1948
1965
  this.va = e;
1949
- this.ac = f;
1950
- this.fc = g;
1966
+ this.bc = f;
1967
+ this.hc = g;
1951
1968
  this.qb = k;
1952
1969
  this.Ta = p;
1953
- this.bc = m;
1970
+ this.cc = m;
1954
1971
  this.O = t;
1955
1972
  e || void 0 !== b.B ? this.toWireType = Lc : (this.toWireType = d ? Jc : Mc, this.L = null);
1956
1973
  }
@@ -2024,7 +2041,7 @@ function Xc(a, b, c, d, e) {
2024
2041
  }
2025
2042
  var Yc = (a, b) => {
2026
2043
  for (var c = [], d = 0; d < a; d++) {
2027
- c.push(H[b + 4 * d >> 2]);
2044
+ c.push(G[b + 4 * d >> 2]);
2028
2045
  }
2029
2046
  return c;
2030
2047
  }, Zc = a => {
@@ -2066,7 +2083,7 @@ var Yc = (a, b) => {
2066
2083
  return c ? function(d) {
2067
2084
  return this.fromWireType(F[d >> 2]);
2068
2085
  } : function(d) {
2069
- return this.fromWireType(H[d >> 2]);
2086
+ return this.fromWireType(G[d >> 2]);
2070
2087
  };
2071
2088
  default:
2072
2089
  throw new TypeError(`invalid integer width (${b}): ${a}`);
@@ -2097,7 +2114,7 @@ var Yc = (a, b) => {
2097
2114
  case 2:
2098
2115
  return c ? d => E[d >> 1] : d => wa[d >> 1];
2099
2116
  case 4:
2100
- return c ? d => F[d >> 2] : d => H[d >> 2];
2117
+ return c ? d => F[d >> 2] : d => G[d >> 2];
2101
2118
  default:
2102
2119
  throw new TypeError(`invalid integer width (${b}): ${a}`);
2103
2120
  }
@@ -2173,7 +2190,7 @@ var Yc = (a, b) => {
2173
2190
  }, nd = (a, b, c) => {
2174
2191
  var d = [];
2175
2192
  a = a.toWireType(d, c);
2176
- d.length && (H[b >> 2] = ac(d));
2193
+ d.length && (G[b >> 2] = ac(d));
2177
2194
  return a;
2178
2195
  }, od = [], pd = {}, qd = a => {
2179
2196
  var b = pd[a];
@@ -2184,13 +2201,13 @@ var Yc = (a, b) => {
2184
2201
  return b;
2185
2202
  }, sd = (a, b) => {
2186
2203
  for (var c = Array(a), d = 0; d < a; ++d) {
2187
- c[d] = nc(H[b + 4 * d >> 2], "parameter " + d);
2204
+ c[d] = nc(G[b + 4 * d >> 2], "parameter " + d);
2188
2205
  }
2189
2206
  return c;
2190
2207
  }, td = Reflect.construct, ud = a => 0 === a % 4 && (0 !== a % 100 || 0 === a % 400), vd = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], wd = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], xd = [], yd = a => {
2191
- a.yc = a.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");
2208
+ a.Dc = a.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");
2192
2209
  }, zd = a => {
2193
- a.Fc = a.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");
2210
+ a.Lc = a.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");
2194
2211
  }, Ad = a => {
2195
2212
  var b = "EXT_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw".split(" ");
2196
2213
  return (a.getSupportedExtensions() || []).filter(c => b.includes(c));
@@ -2206,19 +2223,19 @@ var Yc = (a, b) => {
2206
2223
  F[b + 4 * e >> 2] = g;
2207
2224
  }
2208
2225
  }, ka = (a, b) => {
2209
- var c = Ld(w), d = {handle:c, attributes:b, version:b.Ec, F:a};
2226
+ var c = Ld(w), d = {handle:c, attributes:b, version:b.Kc, F:a};
2210
2227
  a.canvas && (a.canvas.zb = d);
2211
2228
  w[c] = d;
2212
- ("undefined" == typeof b.Jb || b.Jb) && Nd(d);
2229
+ ("undefined" == typeof b.Kb || b.Kb) && Nd(d);
2213
2230
  return c;
2214
2231
  }, la = a => {
2215
2232
  q = w[a];
2216
- l.wc = W = q?.F;
2233
+ l.Bc = W = q?.F;
2217
2234
  return !(a && !W);
2218
2235
  }, Nd = a => {
2219
2236
  a ||= q;
2220
- if (!a.Tb) {
2221
- a.Tb = !0;
2237
+ if (!a.Ub) {
2238
+ a.Ub = !0;
2222
2239
  var b = a.F;
2223
2240
  yd(b);
2224
2241
  zd(b);
@@ -2226,7 +2243,7 @@ var Yc = (a, b) => {
2226
2243
  if (2 > a.version || !b.cb) {
2227
2244
  b.cb = b.getExtension("EXT_disjoint_timer_query");
2228
2245
  }
2229
- b.Zb = b.getExtension("WEBGL_multi_draw");
2246
+ b.$b = b.getExtension("WEBGL_multi_draw");
2230
2247
  Ad(b).forEach(c => {
2231
2248
  c.includes("lose_context") || c.includes("debug") || b.getExtension(c);
2232
2249
  });
@@ -2352,7 +2369,7 @@ var Td = (a, b) => {
2352
2369
  return c;
2353
2370
  }, Wd = a => "]" == a.slice(-1) && a.lastIndexOf("["), Xd = a => {
2354
2371
  a -= 5120;
2355
- return 0 == a ? B : 1 == a ? D : 2 == a ? E : 4 == a ? F : 6 == a ? xa : 5 == a || 28922 == a || 28520 == a || 30779 == a || 30782 == a ? H : wa;
2372
+ return 0 == a ? B : 1 == a ? D : 2 == a ? E : 4 == a ? F : 6 == a ? xa : 5 == a || 28922 == a || 28520 == a || 30779 == a || 30782 == a ? G : wa;
2356
2373
  }, Yd = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Zd = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], $d = (a, b, c, d) => {
2357
2374
  function e(n, r, u) {
2358
2375
  for (n = "number" == typeof n ? n.toString() : n || ""; n.length < r;) {
@@ -2405,8 +2422,8 @@ var Td = (a, b) => {
2405
2422
  u = k(u);
2406
2423
  return 0 >= g(r, n) ? 0 >= g(u, n) ? n.getFullYear() + 1 : n.getFullYear() : n.getFullYear() - 1;
2407
2424
  }
2408
- var m = H[d + 40 >> 2];
2409
- d = {jc:F[d >> 2], ic:F[d + 4 >> 2], Ha:F[d + 8 >> 2], Va:F[d + 12 >> 2], Ia:F[d + 16 >> 2], ca:F[d + 20 >> 2], R:F[d + 24 >> 2], ba:F[d + 28 >> 2], Lc:F[d + 32 >> 2], hc:F[d + 36 >> 2], kc:m ? m ? L(D, m) : "" : ""};
2425
+ var m = G[d + 40 >> 2];
2426
+ d = {kc:F[d >> 2], jc:F[d + 4 >> 2], Ha:F[d + 8 >> 2], Va:F[d + 12 >> 2], Ia:F[d + 16 >> 2], ca:F[d + 20 >> 2], R:F[d + 24 >> 2], ba:F[d + 28 >> 2], Sc:F[d + 32 >> 2], ic:F[d + 36 >> 2], lc:m ? m ? L(D, m) : "" : ""};
2410
2427
  c = c ? L(D, c) : "";
2411
2428
  m = {"%c":"%a %b %d %H:%M:%S %Y", "%D":"%m/%d/%y", "%F":"%Y-%m-%d", "%h":"%b", "%r":"%I:%M:%S %p", "%R":"%H:%M", "%T":"%H:%M:%S", "%x":"%m/%d/%y", "%X":"%H:%M:%S", "%Ec":"%c", "%EC":"%C", "%Ex":"%m/%d/%y", "%EX":"%H:%M:%S", "%Ey":"%y", "%EY":"%Y", "%Od":"%d", "%Oe":"%e", "%OH":"%H", "%OI":"%I", "%Om":"%m", "%OM":"%M", "%OS":"%S", "%Ou":"%u", "%OU":"%U", "%OV":"%V", "%Ow":"%w", "%OW":"%W", "%Oy":"%y",};
2412
2429
  for (var t in m) {
@@ -2421,7 +2438,7 @@ var Td = (a, b) => {
2421
2438
  for (var r = 0, u = 0; u <= n.Ia - 1; r += (ud(n.ca + 1900) ? Yd : Zd)[u++]) {
2422
2439
  }
2423
2440
  return f(n.Va + r, 3);
2424
- }, "%m":n => f(n.Ia + 1, 2), "%M":n => f(n.ic, 2), "%n":() => "\n", "%p":n => 0 <= n.Ha && 12 > n.Ha ? "AM" : "PM", "%S":n => f(n.jc, 2), "%t":() => "\t", "%u":n => n.R || 7, "%U":n => f(Math.floor((n.ba + 7 - n.R) / 7), 2), "%V":n => {
2441
+ }, "%m":n => f(n.Ia + 1, 2), "%M":n => f(n.jc, 2), "%n":() => "\n", "%p":n => 0 <= n.Ha && 12 > n.Ha ? "AM" : "PM", "%S":n => f(n.kc, 2), "%t":() => "\t", "%u":n => n.R || 7, "%U":n => f(Math.floor((n.ba + 7 - n.R) / 7), 2), "%V":n => {
2425
2442
  var r = Math.floor((n.ba + 7 - (n.R + 6) % 7) / 7);
2426
2443
  2 >= (n.R + 371 - n.ba - 2) % 7 && r++;
2427
2444
  if (r) {
@@ -2433,11 +2450,11 @@ var Td = (a, b) => {
2433
2450
  }
2434
2451
  return f(r, 2);
2435
2452
  }, "%w":n => n.R, "%W":n => f(Math.floor((n.ba + 7 - (n.R + 6) % 7) / 7), 2), "%y":n => (n.ca + 1900).toString().substring(2), "%Y":n => n.ca + 1900, "%z":n => {
2436
- n = n.hc;
2453
+ n = n.ic;
2437
2454
  var r = 0 <= n;
2438
2455
  n = Math.abs(n) / 60;
2439
2456
  return (r ? "+" : "-") + String("0000" + (n / 60 * 100 + n % 60)).slice(-4);
2440
- }, "%Z":n => n.kc, "%%":() => "%"};
2457
+ }, "%Z":n => n.lc, "%%":() => "%"};
2441
2458
  c = c.replace(/%%/g, "\x00\x00");
2442
2459
  for (t in m) {
2443
2460
  c.includes(t) && (c = c.replace(new RegExp(t, "g"), m[t](d)));
@@ -2568,16 +2585,16 @@ Object.assign(Dc.prototype, {isAliasOf:function(a) {
2568
2585
  this.g.ga = !0;
2569
2586
  return this;
2570
2587
  },});
2571
- Object.assign(Nc.prototype, {Ob(a) {
2588
+ Object.assign(Nc.prototype, {Pb(a) {
2572
2589
  this.qb && (a = this.qb(a));
2573
2590
  return a;
2574
2591
  }, bb(a) {
2575
2592
  this.O?.(a);
2576
2593
  }, argPackAdvance:8, readValueFromPointer:yc, fromWireType:function(a) {
2577
2594
  function b() {
2578
- return this.va ? vc(this.i.M, {u:this.ac, o:c, J:this, D:a,}) : vc(this.i.M, {u:this, o:a,});
2595
+ return this.va ? vc(this.i.M, {u:this.bc, o:c, J:this, D:a,}) : vc(this.i.M, {u:this, o:a,});
2579
2596
  }
2580
- var c = this.Ob(a);
2597
+ var c = this.Pb(a);
2581
2598
  if (!c) {
2582
2599
  return this.bb(a), null;
2583
2600
  }
@@ -2590,12 +2607,12 @@ Object.assign(Nc.prototype, {Ob(a) {
2590
2607
  this.bb(a);
2591
2608
  return d;
2592
2609
  }
2593
- d = this.i.Nb(c);
2610
+ d = this.i.Ob(c);
2594
2611
  d = rc[d];
2595
2612
  if (!d) {
2596
2613
  return b.call(this);
2597
2614
  }
2598
- d = this.ua ? d.Gb : d.pointerType;
2615
+ d = this.ua ? d.Hb : d.pointerType;
2599
2616
  var e = qc(c, this.i, d.i);
2600
2617
  return null === e ? b.call(this) : this.va ? vc(d.i.M, {u:d, o:e, J:this, D:a,}) : vc(d.i.M, {u:d, o:e,});
2601
2618
  },});
@@ -2648,7 +2665,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2648
2665
  if (!d.s) {
2649
2666
  return -59;
2650
2667
  }
2651
- if (d.s.V.Vb) {
2668
+ if (d.s.V.Wb) {
2652
2669
  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,];
2653
2670
  var e = Va();
2654
2671
  F[e >> 2] = 25856;
@@ -2670,7 +2687,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2670
2687
  if (!d.s) {
2671
2688
  return -59;
2672
2689
  }
2673
- if (d.s.V.Wb) {
2690
+ if (d.s.V.Xb) {
2674
2691
  for (e = Va(), a = [], f = 0; 32 > f; f++) {
2675
2692
  a.push(B[e + f + 17]);
2676
2693
  }
@@ -2686,15 +2703,15 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2686
2703
  return d.s ? -28 : -59;
2687
2704
  case 21531:
2688
2705
  e = Va();
2689
- if (!d.m.Ub) {
2706
+ if (!d.m.Vb) {
2690
2707
  throw new M(59);
2691
2708
  }
2692
- return d.m.Ub(d, b, e);
2709
+ return d.m.Vb(d, b, e);
2693
2710
  case 21523:
2694
2711
  if (!d.s) {
2695
2712
  return -59;
2696
2713
  }
2697
- d.s.V.Xb && (f = [24, 80], e = Va(), E[e >> 1] = f[0], E[e + 2 >> 1] = f[1]);
2714
+ d.s.V.Yb && (f = [24, 80], e = Va(), E[e >> 1] = f[0], E[e + 2 >> 1] = f[1]);
2698
2715
  return 0;
2699
2716
  case 21524:
2700
2717
  return d.s ? 0 : -59;
@@ -2784,12 +2801,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2784
2801
  }, _embind_finalize_value_object:a => {
2785
2802
  var b = wc[a];
2786
2803
  delete wc[a];
2787
- var c = b.Ta, d = b.O, e = b.eb, f = e.map(g => g.Rb).concat(e.map(g => g.dc));
2804
+ var c = b.Ta, d = b.O, e = b.eb, f = e.map(g => g.Sb).concat(e.map(g => g.ec));
2788
2805
  T([a], f, g => {
2789
2806
  var k = {};
2790
2807
  e.forEach((p, m) => {
2791
- var t = g[m], v = p.Pb, x = p.Qb, n = g[m + e.length], r = p.cc, u = p.ec;
2792
- k[p.Lb] = {read:z => t.fromWireType(v(x, z)), write:(z, A) => {
2808
+ var t = g[m], v = p.Qb, x = p.Rb, n = g[m + e.length], r = p.dc, u = p.fc;
2809
+ k[p.Mb] = {read:z => t.fromWireType(v(x, z)), write:(z, A) => {
2793
2810
  var C = [];
2794
2811
  r(u, z, n.toWireType(C, A));
2795
2812
  xc(C);
@@ -2861,16 +2878,16 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2861
2878
  r.prototype = A;
2862
2879
  var C = new Hc(t, r, A, x, u, f, k, m);
2863
2880
  if (C.B) {
2864
- var G;
2865
- (G = C.B).oa ?? (G.oa = []);
2881
+ var H;
2882
+ (H = C.B).oa ?? (H.oa = []);
2866
2883
  C.B.oa.push(C);
2867
2884
  }
2868
2885
  u = new Nc(t, C, !0, !1, !1);
2869
- G = new Nc(t + "*", C, !1, !1, !1);
2886
+ H = new Nc(t + "*", C, !1, !1, !1);
2870
2887
  z = new Nc(t + " const*", C, !1, !0, !1);
2871
- rc[a] = {pointerType:G, Gb:z};
2888
+ rc[a] = {pointerType:H, Hb:z};
2872
2889
  Oc(n, r);
2873
- return [u, G, z];
2890
+ return [u, H, z];
2874
2891
  });
2875
2892
  }, _embind_register_class_class_function:(a, b, c, d, e, f, g) => {
2876
2893
  var k = Yc(c, d);
@@ -2990,9 +3007,9 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2990
3007
  p = U(k, p);
2991
3008
  var z = n[1];
2992
3009
  u.set = function(A) {
2993
- var C = $c(this, t, v + " setter"), G = [];
2994
- p(m, C, z.toWireType(G, A));
2995
- xc(G);
3010
+ var C = $c(this, t, v + " setter"), H = [];
3011
+ p(m, C, z.toWireType(H, A));
3012
+ xc(H);
2996
3013
  };
2997
3014
  }
2998
3015
  Object.defineProperty(t.i.M, b, u);
@@ -3048,16 +3065,16 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3048
3065
  S(a, {name:b, fromWireType:e, toWireType:g, argPackAdvance:8, readValueFromPointer:ed(b, c, 0 !== d), L:null,});
3049
3066
  }, _embind_register_memory_view:(a, b, c) => {
3050
3067
  function d(f) {
3051
- return new e(B.buffer, H[f + 4 >> 2], H[f >> 2]);
3068
+ return new e(B.buffer, G[f + 4 >> 2], G[f >> 2]);
3052
3069
  }
3053
3070
  var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][b];
3054
3071
  c = R(c);
3055
- S(a, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Sb:!0,});
3072
+ S(a, {name:c, fromWireType:d, argPackAdvance:8, readValueFromPointer:d,}, {Tb:!0,});
3056
3073
  }, _embind_register_std_string:(a, b) => {
3057
3074
  b = R(b);
3058
3075
  var c = "std::string" === b;
3059
3076
  S(a, {name:b, fromWireType:function(d) {
3060
- var e = H[d >> 2], f = d + 4;
3077
+ var e = G[d >> 2], f = d + 4;
3061
3078
  if (c) {
3062
3079
  for (var g = f, k = 0; k <= e; ++k) {
3063
3080
  var p = f + k;
@@ -3088,7 +3105,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3088
3105
  }
3089
3106
  var g = c && f ? fb(e) : e.length;
3090
3107
  var k = Ud(4 + g + 1), p = k + 4;
3091
- H[k >> 2] = g;
3108
+ G[k >> 2] = g;
3092
3109
  if (c && f) {
3093
3110
  gb(e, D, p, g + 1);
3094
3111
  } else {
@@ -3119,10 +3136,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3119
3136
  var f = jd;
3120
3137
  var g = k => wa[k >> 1];
3121
3138
  } else {
3122
- 4 === b && (d = kd, e = ld, f = md, g = k => H[k >> 2]);
3139
+ 4 === b && (d = kd, e = ld, f = md, g = k => G[k >> 2]);
3123
3140
  }
3124
3141
  S(a, {name:c, fromWireType:k => {
3125
- for (var p = H[k >> 2], m, t = k + 4, v = 0; v <= p; ++v) {
3142
+ for (var p = G[k >> 2], m, t = k + 4, v = 0; v <= p; ++v) {
3126
3143
  var x = k + 4 + v * b;
3127
3144
  if (v == p || 0 == g(x)) {
3128
3145
  t = d(t, x - t), void 0 === m ? m = t : (m += String.fromCharCode(0), m += t), t = x + b;
@@ -3135,7 +3152,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3135
3152
  throw new P(`Cannot pass non-string to C++ string type ${c}`);
3136
3153
  }
3137
3154
  var m = f(p), t = Ud(4 + m + b);
3138
- H[t >> 2] = m / b;
3155
+ G[t >> 2] = m / b;
3139
3156
  e(p, t + 4, m + b);
3140
3157
  null !== k && k.push(lc, t);
3141
3158
  return t;
@@ -3145,10 +3162,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3145
3162
  }, _embind_register_value_object:(a, b, c, d, e, f) => {
3146
3163
  wc[a] = {name:R(b), Ta:U(c, d), O:U(e, f), eb:[],};
3147
3164
  }, _embind_register_value_object_field:(a, b, c, d, e, f, g, k, p, m) => {
3148
- wc[a].eb.push({Lb:R(b), Rb:c, Pb:U(d, e), Qb:f, dc:g, cc:U(k, p), ec:m,});
3165
+ wc[a].eb.push({Mb:R(b), Sb:c, Qb:U(d, e), Rb:f, ec:g, dc:U(k, p), fc:m,});
3149
3166
  }, _embind_register_void:(a, b) => {
3150
3167
  b = R(b);
3151
- S(a, {Dc:!0, name:b, argPackAdvance:0, fromWireType:() => {
3168
+ S(a, {Ic:!0, name:b, argPackAdvance:0, fromWireType:() => {
3152
3169
  }, toWireType:() => {
3153
3170
  },});
3154
3171
  }, _emscripten_get_now_is_monotonic:() => 1, _emscripten_memcpy_js:(a, b, c) => D.copyWithin(a, b, b + c), _emscripten_throw_longjmp:() => {
@@ -3225,7 +3242,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3225
3242
  var e = (new Date()).getFullYear(), f = new Date(e, 0, 1), g = new Date(e, 6, 1);
3226
3243
  e = f.getTimezoneOffset();
3227
3244
  var k = g.getTimezoneOffset();
3228
- H[a >> 2] = 60 * Math.max(e, k);
3245
+ G[a >> 2] = 60 * Math.max(e, k);
3229
3246
  F[b >> 2] = Number(e != k);
3230
3247
  a = p => p.toLocaleTimeString(void 0, {hour12:!1, timeZoneName:"short"}).split(" ")[1];
3231
3248
  f = a(f);
@@ -3254,7 +3271,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3254
3271
  var e = 105 != d;
3255
3272
  e &= 112 != d;
3256
3273
  c += e && c % 8 ? 4 : 0;
3257
- xd.push(112 == d ? H[c >> 2] : 105 == d ? F[c >> 2] : ya[c >> 3]);
3274
+ xd.push(112 == d ? G[c >> 2] : 105 == d ? F[c >> 2] : ya[c >> 3]);
3258
3275
  c += e ? 8 : 4;
3259
3276
  }
3260
3277
  return Ta[a](...xd);
@@ -3291,7 +3308,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3291
3308
  b.startsWith("GL_") && (b = b.substr(3));
3292
3309
  "WEBGL_draw_instanced_base_vertex_base_instance" == b && yd(W);
3293
3310
  "WEBGL_multi_draw_instanced_base_vertex_base_instance" == b && zd(W);
3294
- "WEBGL_multi_draw" == b && (W.Zb = W.getExtension("WEBGL_multi_draw"));
3311
+ "WEBGL_multi_draw" == b && (W.$b = W.getExtension("WEBGL_multi_draw"));
3295
3312
  return !!a.F.getExtension(b);
3296
3313
  }, emscripten_webgl_get_current_context:() => q ? q.handle : 0, emscripten_webgl_make_context_current:a => la(a) ? 0 : -5, enable_WEBGL_provoking_vertex:function(a) {
3297
3314
  a = w[a].F;
@@ -3307,7 +3324,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3307
3324
  var c = 0;
3308
3325
  Qd().forEach((d, e) => {
3309
3326
  var f = b + c;
3310
- e = H[a + 4 * e >> 2] = f;
3327
+ e = G[a + 4 * e >> 2] = f;
3311
3328
  for (f = 0; f < d.length; ++f) {
3312
3329
  B[e++] = d.charCodeAt(f);
3313
3330
  }
@@ -3317,10 +3334,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3317
3334
  return 0;
3318
3335
  }, environ_sizes_get:(a, b) => {
3319
3336
  var c = Qd();
3320
- H[a >> 2] = c.length;
3337
+ G[a >> 2] = c.length;
3321
3338
  var d = 0;
3322
3339
  c.forEach(e => d += e.length + 1);
3323
- H[b >> 2] = d;
3340
+ G[b >> 2] = d;
3324
3341
  return 0;
3325
3342
  }, fd_close:function(a) {
3326
3343
  try {
@@ -3350,7 +3367,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3350
3367
  var e = Kb(a);
3351
3368
  a = b;
3352
3369
  for (var f, g = b = 0; g < c; g++) {
3353
- var k = H[a >> 2], p = H[a + 4 >> 2];
3370
+ var k = G[a >> 2], p = G[a + 4 >> 2];
3354
3371
  a += 8;
3355
3372
  var m = e, t = f, v = B;
3356
3373
  if (0 > p || 0 > t) {
@@ -3389,7 +3406,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3389
3406
  }
3390
3407
  u = b;
3391
3408
  }
3392
- H[d >> 2] = u;
3409
+ G[d >> 2] = u;
3393
3410
  return 0;
3394
3411
  } catch (z) {
3395
3412
  if ("undefined" == typeof Yb || "ErrnoError" !== z.name) {
@@ -3422,7 +3439,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3422
3439
  var e = Kb(a);
3423
3440
  a = b;
3424
3441
  for (var f, g = b = 0; g < c; g++) {
3425
- var k = H[a >> 2], p = H[a + 4 >> 2];
3442
+ var k = G[a >> 2], p = G[a + 4 >> 2];
3426
3443
  a += 8;
3427
3444
  var m = e, t = k, v = p, x = f, n = B;
3428
3445
  if (0 > v || 0 > x) {
@@ -3459,7 +3476,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3459
3476
  }
3460
3477
  A = b;
3461
3478
  }
3462
- H[d >> 2] = A;
3479
+ G[d >> 2] = A;
3463
3480
  return 0;
3464
3481
  } catch (C) {
3465
3482
  if ("undefined" == typeof Yb || "ErrnoError" !== C.name) {
@@ -3493,7 +3510,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3493
3510
  }, glClear:a => W.clear(a), glClearBufferfv:(a, b, c) => {
3494
3511
  W.clearBufferfv(a, b, xa, c >> 2);
3495
3512
  }, glClearBufferuiv:(a, b, c) => {
3496
- W.clearBufferuiv(a, b, H, c >> 2);
3513
+ W.clearBufferuiv(a, b, G, c >> 2);
3497
3514
  }, glClearColor:(a, b, c, d) => W.clearColor(a, b, c, d), glClearDepthf:a => W.clearDepth(a), glClearStencil:a => W.clearStencil(a), glColorMask:(a, b, c, d) => {
3498
3515
  W.colorMask(!!a, !!b, !!c, !!d);
3499
3516
  }, glCompileShader:a => {
@@ -3694,7 +3711,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3694
3711
  }
3695
3712
  }, glRenderbufferStorageMultisample:(a, b, c, d, e) => W.renderbufferStorageMultisample(a, b, c, d, e), glScissor:(a, b, c, d) => W.scissor(a, b, c, d), glShaderSource:(a, b, c, d) => {
3696
3713
  for (var e = "", f = 0; f < b; ++f) {
3697
- var g = (g = H[c + 4 * f >> 2]) ? L(D, g, d ? H[d + 4 * f >> 2] : void 0) : "";
3714
+ var g = (g = G[c + 4 * f >> 2]) ? L(D, g, d ? G[d + 4 * f >> 2] : void 0) : "";
3698
3715
  e += g;
3699
3716
  }
3700
3717
  W.shaderSource(Gd[a], e);
@@ -3719,7 +3736,7 @@ f, g, k, p) => {
3719
3736
  }
3720
3737
  }, glUniform1i:(a, b) => {
3721
3738
  var c = W, d = c.uniform1i;
3722
- var e = W.Hb;
3739
+ var e = W.Ib;
3723
3740
  if (e) {
3724
3741
  var f = e.ma[a];
3725
3742
  "number" == typeof f && (e.ma[a] = f = W.getUniformLocation(e, e.vb[a] + (0 < f ? `[${f}]` : "")));
@@ -3734,7 +3751,7 @@ f, g, k, p) => {
3734
3751
  }, glUseProgram:a => {
3735
3752
  a = V[a];
3736
3753
  W.useProgram(a);
3737
- W.Hb = a;
3754
+ W.Ib = a;
3738
3755
  }, glVertexAttribDivisor:(a, b) => {
3739
3756
  W.vertexAttribDivisor(a, b);
3740
3757
  }, glVertexAttribIPointer:(a, b, c, d, e) => {
@@ -3748,6 +3765,24 @@ f, g, k, p) => {
3748
3765
  }, strftime:$d, strftime_l:(a, b, c, d) => $d(a, b, c, d), upload_image:function(a, b) {
3749
3766
  var c = l.images;
3750
3767
  c && (b = c.get(b)) && (a = w[a].F, a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, b), a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1));
3768
+ }, wasm_start_image_decode:function(a, b, c) {
3769
+ b = l.HEAP8.subarray(b, b + c);
3770
+ c = new Uint8Array(c);
3771
+ c.set(b);
3772
+ createImageBitmap(new Blob([c])).then(function(d) {
3773
+ var e = (new OffscreenCanvas(d.width, d.height)).getContext("2d");
3774
+ e.drawImage(d, 0, 0);
3775
+ e = e.getImageData(0, 0, d.width, d.height);
3776
+ var f = e.data.length, g = l.Cb(f);
3777
+ l.oc.set(e.data, g);
3778
+ l.qc(a, d.width, d.height, g, f);
3779
+ }).catch(function(d) {
3780
+ d = d.message || "decode failed";
3781
+ var e = l.Jc(d) + 1, f = l.Cb(e);
3782
+ l.Rc(d, f, e);
3783
+ l.rc(a, f);
3784
+ l.pc(f);
3785
+ });
3751
3786
  }}, Y = function() {
3752
3787
  function a(c) {
3753
3788
  Y = c.exports;
@@ -3777,7 +3812,10 @@ f, g, k, p) => {
3777
3812
  return {};
3778
3813
  }(), lc = a => (lc = Y.free)(a), Ud = a => (Ud = Y.malloc)(a);
3779
3814
  l._setWebImage = (a, b, c) => (l._setWebImage = Y.setWebImage)(a, b, c);
3780
- var kc = a => (kc = Y.__getTypeName)(a), Qa = l._ma_device__on_notification_unlocked = a => (Qa = l._ma_device__on_notification_unlocked = Y.ma_device__on_notification_unlocked)(a);
3815
+ var kc = a => (kc = Y.__getTypeName)(a);
3816
+ l._wasm_image_decode_complete = (a, b, c, d, e) => (l._wasm_image_decode_complete = Y.wasm_image_decode_complete)(a, b, c, d, e);
3817
+ l._wasm_image_decode_error = (a, b) => (l._wasm_image_decode_error = Y.wasm_image_decode_error)(a, b);
3818
+ var Qa = l._ma_device__on_notification_unlocked = a => (Qa = l._ma_device__on_notification_unlocked = Y.ma_device__on_notification_unlocked)(a);
3781
3819
  l._ma_malloc_emscripten = (a, b) => (l._ma_malloc_emscripten = Y.ma_malloc_emscripten)(a, b);
3782
3820
  l._ma_free_emscripten = (a, b) => (l._ma_free_emscripten = Y.ma_free_emscripten)(a, b);
3783
3821
  var Ra = l._ma_device_process_pcm_frames_capture__webaudio = (a, b, c) => (Ra = l._ma_device_process_pcm_frames_capture__webaudio = Y.ma_device_process_pcm_frames_capture__webaudio)(a, b, c), Sa = l._ma_device_process_pcm_frames_playback__webaudio = (a, b, c) => (Sa = l._ma_device_process_pcm_frames_playback__webaudio = Y.ma_device_process_pcm_frames_playback__webaudio)(a, b, c), fe = (a, b) => (fe = Y.setThrew)(a, b), ge = a => (ge = Y._emscripten_stack_restore)(a), he = () => (he = Y.emscripten_stack_get_current)();
@@ -3863,7 +3901,7 @@ moduleRtn = ca;
3863
3901
  /* 5 */
3864
3902
  /***/ ((module) => {
3865
3903
 
3866
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.37.5","description":"Rive\'s webgl2 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)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3904
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.37.6","description":"Rive\'s webgl2 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)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3867
3905
 
3868
3906
  /***/ }),
3869
3907
  /* 6 */
@@ -5217,7 +5255,8 @@ var Animator = /** @class */ (function () {
5217
5255
  * @param animatables the name(s) of animations to add
5218
5256
  * @param playing whether animations should play on instantiation
5219
5257
  */
5220
- Animator.prototype.initLinearAnimations = function (animatables, playing) {
5258
+ Animator.prototype.initLinearAnimations = function (animatables, playing, isFallingBackFromStateMachines) {
5259
+ if (isFallingBackFromStateMachines === void 0) { isFallingBackFromStateMachines = false; }
5221
5260
  // Play/pause already instanced items, or create new instances
5222
5261
  // This validation is kept to maintain compatibility with current behavior.
5223
5262
  // But given that it this is called during artboard initialization
@@ -5238,6 +5277,10 @@ var Animator = /** @class */ (function () {
5238
5277
  newAnimation.apply(1.0);
5239
5278
  this.animations.push(newAnimation);
5240
5279
  }
5280
+ else if (isFallingBackFromStateMachines) { // Throw LoadError if we cannot load the state machine name at all
5281
+ var smInitializationMessage = "State Machine with name ".concat(animatables[i], " not found");
5282
+ throw new RiveError(smInitializationMessage);
5283
+ }
5241
5284
  else {
5242
5285
  console.error("Animation with name ".concat(animatables[i], " not found."));
5243
5286
  }
@@ -5268,10 +5311,11 @@ var Animator = /** @class */ (function () {
5268
5311
  this.stateMachines.push(newStateMachine);
5269
5312
  }
5270
5313
  else {
5271
- console.warn("State Machine with name ".concat(animatables[i], " not found."));
5314
+ console.warn("State Machine with name ".concat(animatables[i], " not found. Falling back to find an animation with the same name."));
5315
+ // TODO: Remove this fallback in next major release as it complicates initialization.
5272
5316
  // In order to maintain compatibility with current behavior, if a state machine is not found
5273
5317
  // we look for an animation with the same name
5274
- this.initLinearAnimations([animatables[i]], playing);
5318
+ this.initLinearAnimations([animatables[i]], playing, true);
5275
5319
  }
5276
5320
  }
5277
5321
  }
@@ -5873,17 +5917,26 @@ var RiveFile = /** @class */ (function () {
5873
5917
  };
5874
5918
  RiveFile.prototype.initData = function () {
5875
5919
  return __awaiter(this, void 0, void 0, function () {
5876
- var _a, loader, loaderWrapper, _b, fileFinalizer;
5920
+ var _a, error_1, loader, loaderWrapper, _b, fileFinalizer;
5877
5921
  return __generator(this, function (_c) {
5878
5922
  switch (_c.label) {
5879
5923
  case 0:
5880
- if (!(this.src && !this.buffer)) return [3 /*break*/, 2];
5924
+ if (!(this.src && !this.buffer)) return [3 /*break*/, 4];
5925
+ _c.label = 1;
5926
+ case 1:
5927
+ _c.trys.push([1, 3, , 4]);
5881
5928
  _a = this;
5882
5929
  return [4 /*yield*/, loadRiveFile(this.src)];
5883
- case 1:
5884
- _a.buffer = _c.sent();
5885
- _c.label = 2;
5886
5930
  case 2:
5931
+ _a.buffer = _c.sent();
5932
+ return [3 /*break*/, 4];
5933
+ case 3:
5934
+ error_1 = _c.sent();
5935
+ if (error_1 instanceof Error) {
5936
+ throw error_1;
5937
+ }
5938
+ throw new RiveError(RiveFile.fileLoadErrorMessage);
5939
+ case 4:
5887
5940
  if (this.destroyed) {
5888
5941
  return [2 /*return*/];
5889
5942
  }
@@ -5896,7 +5949,7 @@ var RiveFile = /** @class */ (function () {
5896
5949
  performance.mark('rive:file-load:start');
5897
5950
  _b = this;
5898
5951
  return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN)];
5899
- case 3:
5952
+ case 5:
5900
5953
  _b.file = _c.sent();
5901
5954
  if (this.enablePerfMarks) {
5902
5955
  performance.mark('rive:file-load:end');
@@ -5960,7 +6013,7 @@ var RiveFile = /** @class */ (function () {
5960
6013
  };
5961
6014
  RiveFile.prototype.init = function () {
5962
6015
  return __awaiter(this, void 0, void 0, function () {
5963
- var _a, bufferResolved, runtimeResolved, error_1;
6016
+ var _a, bufferResolved, runtimeResolved, error_2;
5964
6017
  return __generator(this, function (_b) {
5965
6018
  switch (_b.label) {
5966
6019
  case 0:
@@ -5992,8 +6045,8 @@ var RiveFile = /** @class */ (function () {
5992
6045
  }
5993
6046
  return [3 /*break*/, 5];
5994
6047
  case 4:
5995
- error_1 = _b.sent();
5996
- this.fireLoadError(error_1 instanceof Error ? error_1.message : RiveFile.fileLoadErrorMessage);
6048
+ error_2 = _b.sent();
6049
+ this.fireLoadError(error_2 instanceof Error ? error_2.message : RiveFile.fileLoadErrorMessage);
5997
6050
  return [3 /*break*/, 5];
5998
6051
  case 5: return [2 /*return*/];
5999
6052
  }
@@ -6005,7 +6058,7 @@ var RiveFile = /** @class */ (function () {
6005
6058
  type: EventType.LoadError,
6006
6059
  data: message,
6007
6060
  });
6008
- throw new Error(message);
6061
+ throw new RiveError(message);
6009
6062
  };
6010
6063
  /**
6011
6064
  * Subscribe to Rive-generated events
@@ -6329,11 +6382,13 @@ var Rive = /** @class */ (function () {
6329
6382
  }
6330
6383
  })
6331
6384
  .catch(function (e) {
6385
+ // initData already catches RiveErrors for load issues like artboard/state machine initialization
6386
+ // failures, so just console error and catch here so we don't double-fire the LoadError event
6332
6387
  console.error(e);
6333
6388
  });
6334
6389
  })
6335
6390
  .catch(function (e) {
6336
- console.error(e);
6391
+ _this.eventManager.fire({ type: EventType.LoadError, data: e.message });
6337
6392
  });
6338
6393
  };
6339
6394
  /**
@@ -6415,7 +6470,7 @@ var Rive = /** @class */ (function () {
6415
6470
  // Returns true for successful initialization.
6416
6471
  Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
6417
6472
  return __awaiter(this, void 0, void 0, function () {
6418
- var riveFile, error_2, msg;
6473
+ var riveFile, error_3, msg;
6419
6474
  var _a;
6420
6475
  return __generator(this, function (_b) {
6421
6476
  switch (_b.label) {
@@ -6449,11 +6504,19 @@ var Rive = /** @class */ (function () {
6449
6504
  // Check for audio
6450
6505
  this.initializeAudio();
6451
6506
  // Everything's set up, emit a load event
6452
- this.loaded = true;
6453
- this.eventManager.fire({
6454
- type: EventType.Load,
6455
- data: (_a = this.src) !== null && _a !== void 0 ? _a : "buffer",
6456
- });
6507
+ try {
6508
+ this.loaded = true;
6509
+ this.eventManager.fire({
6510
+ type: EventType.Load,
6511
+ data: (_a = this.src) !== null && _a !== void 0 ? _a : "buffer",
6512
+ });
6513
+ }
6514
+ catch (e) {
6515
+ // If any synchronous errors surface from the user-supplied onLoad callback,
6516
+ // this will console.error the error but will not invoke LoadError (onLoadError).
6517
+ // Notably, this will not interfere with Rive rendering
6518
+ console.error(e);
6519
+ }
6457
6520
  // Only initialize paused state machines after the load event has been fired
6458
6521
  // to allow users to initialize inputs and view models before the first advance
6459
6522
  this.animator.advanceIfPaused();
@@ -6464,9 +6527,8 @@ var Rive = /** @class */ (function () {
6464
6527
  this.drawFrame();
6465
6528
  return [2 /*return*/, true];
6466
6529
  case 3:
6467
- error_2 = _b.sent();
6468
- msg = resolveErrorMessage(error_2);
6469
- console.warn(msg);
6530
+ error_3 = _b.sent();
6531
+ msg = resolveErrorMessage(error_3);
6470
6532
  this.eventManager.fire({ type: EventType.LoadError, data: msg });
6471
6533
  return [2 /*return*/, Promise.reject(msg)];
6472
6534
  case 4: return [2 /*return*/];
@@ -6485,10 +6547,7 @@ var Rive = /** @class */ (function () {
6485
6547
  : this.file.defaultArtboard();
6486
6548
  // Check we have a working artboard
6487
6549
  if (!rootArtboard) {
6488
- var msg = "Invalid artboard name or no default artboard";
6489
- console.warn(msg);
6490
- this.eventManager.fire({ type: EventType.LoadError, data: msg });
6491
- return;
6550
+ throw new RiveError("Invalid artboard name or no default artboard");
6492
6551
  }
6493
6552
  this.artboard = rootArtboard;
6494
6553
  rootArtboard.volume = this._volume * audioManager.systemVolume;
@@ -8507,6 +8566,9 @@ var loadRiveFile = function (src) { return __awaiter(void 0, void 0, void 0, fun
8507
8566
  return [4 /*yield*/, fetch(req)];
8508
8567
  case 1:
8509
8568
  res = _a.sent();
8569
+ if (!res.ok) {
8570
+ throw new Error("Failed to fetch the Rive file: HTTP ".concat(res.status));
8571
+ }
8510
8572
  return [4 /*yield*/, res.arrayBuffer()];
8511
8573
  case 2:
8512
8574
  buffer = _a.sent();