@rive-app/canvas-lite 2.49.4 → 2.51.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/package.json +1 -1
- package/rive.d.ts +26 -2
- package/rive.js +409 -108
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +33 -5
- package/rive_fallback.wasm +0 -0
- package/runtimeLoader.d.ts +64 -0
- package/utils/riveFont.d.ts +10 -1
- package/utils/wheelMomentum.d.ts +15 -0
package/rive.js
CHANGED
|
@@ -170,6 +170,15 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
170
170
|
};
|
|
171
171
|
return __assign.apply(this, arguments);
|
|
172
172
|
};
|
|
173
|
+
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
174
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
175
|
+
if (ar || !(i in from)) {
|
|
176
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
177
|
+
ar[i] = from[i];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
181
|
+
};
|
|
173
182
|
|
|
174
183
|
|
|
175
184
|
|
|
@@ -198,6 +207,52 @@ function threadsRefusal() {
|
|
|
198
207
|
}
|
|
199
208
|
return null;
|
|
200
209
|
}
|
|
210
|
+
// The runtime's ceiling for maxResponseBytes.
|
|
211
|
+
var maxScriptFetchResponseBytes = 64 * 1024 * 1024;
|
|
212
|
+
// A non-negative integer that fits in a uint32, else the fallback.
|
|
213
|
+
var uint32Option = function (value, fallback) {
|
|
214
|
+
return typeof value === "number" &&
|
|
215
|
+
Number.isInteger(value) &&
|
|
216
|
+
value >= 0 &&
|
|
217
|
+
value <= 0xffffffff
|
|
218
|
+
? value
|
|
219
|
+
: fallback;
|
|
220
|
+
};
|
|
221
|
+
var hostPattern = /^(\*\.)?[a-z0-9-]+(\.[a-z0-9-]+)*$/;
|
|
222
|
+
// Warns about allowedHosts entries that never match, or match a whole
|
|
223
|
+
// top-level domain.
|
|
224
|
+
var checkAllowedHosts = function (hosts) {
|
|
225
|
+
for (var _i = 0, hosts_1 = hosts; _i < hosts_1.length; _i++) {
|
|
226
|
+
var entry = hosts_1[_i];
|
|
227
|
+
var host = String(entry).trim().toLowerCase();
|
|
228
|
+
if (host === "*") {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (!hostPattern.test(host)) {
|
|
232
|
+
console.warn("[Rive] allowedHosts entry \"".concat(entry, "\" never matches. Use a host name ") +
|
|
233
|
+
"(\"api.example.com\"), \"*.example.com\" or \"*\".");
|
|
234
|
+
}
|
|
235
|
+
else if (host.startsWith("*.") && !host.includes(".", 2)) {
|
|
236
|
+
console.warn("[Rive] allowedHosts entry \"".concat(entry, "\" allows every host under a ") +
|
|
237
|
+
"top-level domain.");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
// Warns about a proxy on this page's own origin, where the iframe's sandbox
|
|
242
|
+
// keeps nothing apart from the page.
|
|
243
|
+
var checkProxyUrl = function (proxyUrl) {
|
|
244
|
+
var origin;
|
|
245
|
+
try {
|
|
246
|
+
origin = new URL(proxyUrl, document.baseURI).origin;
|
|
247
|
+
}
|
|
248
|
+
catch (_a) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (origin === location.origin) {
|
|
252
|
+
console.warn("[Rive] proxyUrl \"".concat(proxyUrl, "\" is on this page's origin, so the proxy ") +
|
|
253
|
+
"is not isolated from it. Host it on a separate domain.");
|
|
254
|
+
}
|
|
255
|
+
};
|
|
201
256
|
// Runtime singleton; use getInstance to provide a callback that returns the
|
|
202
257
|
// Rive runtime
|
|
203
258
|
var RuntimeLoader = /** @class */ (function () {
|
|
@@ -214,6 +269,22 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
214
269
|
}
|
|
215
270
|
RuntimeLoader.callBackQueue = [];
|
|
216
271
|
};
|
|
272
|
+
RuntimeLoader.setSystemLanguages = function (languages) {
|
|
273
|
+
RuntimeLoader.systemLanguages = languages;
|
|
274
|
+
RuntimeLoader.applySystemLanguages();
|
|
275
|
+
};
|
|
276
|
+
RuntimeLoader.applySystemLanguages = function () {
|
|
277
|
+
var _a, _b;
|
|
278
|
+
var rive = RuntimeLoader.runtime;
|
|
279
|
+
if (!rive) {
|
|
280
|
+
// Applied once it loads.
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
var languages = (_a = RuntimeLoader.systemLanguages) !== null && _a !== void 0 ? _a : (typeof navigator !== "undefined" && navigator.languages
|
|
284
|
+
? navigator.languages
|
|
285
|
+
: []);
|
|
286
|
+
(_b = rive.setSystemLanguages) === null || _b === void 0 ? void 0 : _b.call(rive, __spreadArray([], languages, true));
|
|
287
|
+
};
|
|
217
288
|
RuntimeLoader.loaded = function (rive) {
|
|
218
289
|
var _a, _b;
|
|
219
290
|
if (RuntimeLoader.enablePerfMarks) {
|
|
@@ -222,11 +293,23 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
222
293
|
}
|
|
223
294
|
RuntimeLoader.runtime = rive;
|
|
224
295
|
RuntimeLoader.applyParallelParts();
|
|
296
|
+
RuntimeLoader.applySystemLanguages();
|
|
297
|
+
if (!RuntimeLoader.listeningForLanguageChange &&
|
|
298
|
+
typeof window !== "undefined" &&
|
|
299
|
+
typeof window.addEventListener === "function") {
|
|
300
|
+
RuntimeLoader.listeningForLanguageChange = true;
|
|
301
|
+
window.addEventListener("languagechange", function () {
|
|
302
|
+
if (RuntimeLoader.systemLanguages === null) {
|
|
303
|
+
RuntimeLoader.applySystemLanguages();
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
225
307
|
RuntimeLoader.errorCallbackQueue = [];
|
|
226
308
|
// Before any callback can import a file, so its images reach the worker.
|
|
227
309
|
if (RuntimeLoader.replayWorker) {
|
|
228
310
|
(_a = rive.enableReplayWorker) === null || _a === void 0 ? void 0 : _a.call(rive);
|
|
229
311
|
}
|
|
312
|
+
RuntimeLoader.applyScriptFetch();
|
|
230
313
|
// Fire all the callbacks
|
|
231
314
|
while (RuntimeLoader.callBackQueue.length > 0) {
|
|
232
315
|
(_b = RuntimeLoader.callBackQueue.shift()) === null || _b === void 0 ? void 0 : _b(RuntimeLoader.runtime);
|
|
@@ -450,6 +533,89 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
450
533
|
RuntimeLoader.getReplayWorker = function () {
|
|
451
534
|
return RuntimeLoader.replayWorker;
|
|
452
535
|
};
|
|
536
|
+
/**
|
|
537
|
+
* @experimental Lets scripts in Rive files call `fetch()`. Pass `true` or
|
|
538
|
+
* options to enable it for every file on the page, `false` to disable it.
|
|
539
|
+
* Only `@rive-app/webgl2-threads` running its threaded build has it;
|
|
540
|
+
* elsewhere this warns once and does nothing.
|
|
541
|
+
*
|
|
542
|
+
* Enabling it lets any script in any file this page loads send what it
|
|
543
|
+
* can read to the hosts it may reach. Limit them with `allowedHosts`.
|
|
544
|
+
* Scripts can't fetch this page's own host unless `allowedHosts` names it.
|
|
545
|
+
*
|
|
546
|
+
* Each call replaces the previous options, and any option left out goes
|
|
547
|
+
* back to its default (an omitted `allowedHosts` allows every host). To
|
|
548
|
+
* change one option, spread the current ones:
|
|
549
|
+
*
|
|
550
|
+
* ```ts
|
|
551
|
+
* RuntimeLoader.setScriptFetch({
|
|
552
|
+
* ...RuntimeLoader.getScriptFetch(),
|
|
553
|
+
* maxResponseBytes: 32 * 1024 * 1024,
|
|
554
|
+
* });
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* Disabled by default.
|
|
558
|
+
*/
|
|
559
|
+
RuntimeLoader.setScriptFetch = function (options) {
|
|
560
|
+
var _a;
|
|
561
|
+
if (options === true) {
|
|
562
|
+
RuntimeLoader.scriptFetch = {};
|
|
563
|
+
}
|
|
564
|
+
else if (options && typeof options === "object") {
|
|
565
|
+
var hosts = options.allowedHosts;
|
|
566
|
+
// Anything else, such as a single host as a string, allows no host
|
|
567
|
+
// rather than falling back to every host.
|
|
568
|
+
if (hosts != null && !Array.isArray(hosts)) {
|
|
569
|
+
console.warn("[Rive] allowedHosts must be an array of host names. Scripts may " +
|
|
570
|
+
"fetch from no host.");
|
|
571
|
+
hosts = [];
|
|
572
|
+
}
|
|
573
|
+
if (hosts) {
|
|
574
|
+
checkAllowedHosts(hosts);
|
|
575
|
+
}
|
|
576
|
+
if (options.proxyUrl) {
|
|
577
|
+
checkProxyUrl(options.proxyUrl);
|
|
578
|
+
}
|
|
579
|
+
if (((_a = options.maxResponseBytes) !== null && _a !== void 0 ? _a : 0) > maxScriptFetchResponseBytes) {
|
|
580
|
+
console.warn("[Rive] maxResponseBytes is capped at 64 MiB " +
|
|
581
|
+
"(".concat(maxScriptFetchResponseBytes, " bytes)."));
|
|
582
|
+
}
|
|
583
|
+
RuntimeLoader.scriptFetch = __assign(__assign({}, options), { allowedHosts: hosts === null || hosts === void 0 ? void 0 : hosts.slice() });
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
RuntimeLoader.scriptFetch = null;
|
|
587
|
+
}
|
|
588
|
+
RuntimeLoader.applyScriptFetch();
|
|
589
|
+
};
|
|
590
|
+
// Gets the script fetch options (null means disabled)
|
|
591
|
+
RuntimeLoader.getScriptFetch = function () {
|
|
592
|
+
var _a;
|
|
593
|
+
var options = RuntimeLoader.scriptFetch;
|
|
594
|
+
return options
|
|
595
|
+
? __assign(__assign({}, options), { allowedHosts: (_a = options.allowedHosts) === null || _a === void 0 ? void 0 : _a.slice() }) : null;
|
|
596
|
+
};
|
|
597
|
+
RuntimeLoader.applyScriptFetch = function () {
|
|
598
|
+
var _a;
|
|
599
|
+
var runtime = RuntimeLoader.runtime;
|
|
600
|
+
if (!runtime) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
var options = RuntimeLoader.scriptFetch;
|
|
604
|
+
if (!runtime.configureScriptFetch) {
|
|
605
|
+
if (options && !RuntimeLoader.warnedNoScriptFetch) {
|
|
606
|
+
RuntimeLoader.warnedNoScriptFetch = true;
|
|
607
|
+
console.warn("[Rive] Script fetch is only available in @rive-app/webgl2-threads " +
|
|
608
|
+
"on a cross origin isolated page. Scripts' fetch() stays disabled.");
|
|
609
|
+
}
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
runtime.configureScriptFetch(options && {
|
|
613
|
+
proxyUrl: options.proxyUrl || null,
|
|
614
|
+
allowedHosts: (_a = options.allowedHosts) !== null && _a !== void 0 ? _a : null,
|
|
615
|
+
// 0 keeps the runtime's default.
|
|
616
|
+
maxResponseBytes: uint32Option(options.maxResponseBytes, 0),
|
|
617
|
+
});
|
|
618
|
+
};
|
|
453
619
|
// Manually sets the wasm binary or clears it with null
|
|
454
620
|
RuntimeLoader.setWasmBinary = function (value) {
|
|
455
621
|
if ((value instanceof ArrayBuffer) || value === null) {
|
|
@@ -486,6 +652,9 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
486
652
|
RuntimeLoader.replayWorker = true;
|
|
487
653
|
RuntimeLoader.replayCapsArrived = false;
|
|
488
654
|
RuntimeLoader.replayCapsTimeoutMs = 2000;
|
|
655
|
+
// Script fetch options, or null while disabled.
|
|
656
|
+
RuntimeLoader.scriptFetch = null;
|
|
657
|
+
RuntimeLoader.warnedNoScriptFetch = false;
|
|
489
658
|
// Error callbacks enqueued from .getInstance()
|
|
490
659
|
RuntimeLoader.errorCallbackQueue = [];
|
|
491
660
|
/**
|
|
@@ -493,6 +662,11 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
493
662
|
* WASM initialization.
|
|
494
663
|
*/
|
|
495
664
|
RuntimeLoader.enablePerfMarks = false;
|
|
665
|
+
// The languages text without one of its own shapes and falls back with,
|
|
666
|
+
// most preferred first. Null follows navigator.languages, including when
|
|
667
|
+
// the browser's change. See RiveFont.setSystemLanguages.
|
|
668
|
+
RuntimeLoader.systemLanguages = null;
|
|
669
|
+
RuntimeLoader.listeningForLanguageChange = false;
|
|
496
670
|
return RuntimeLoader;
|
|
497
671
|
}());
|
|
498
672
|
|
|
@@ -507,110 +681,111 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
507
681
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
508
682
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
509
683
|
/* harmony export */ });
|
|
510
|
-
var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var
|
|
511
|
-
function da(){
|
|
512
|
-
"fixed",
|
|
513
|
-
function ea(b){console.assert(!0);const a=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<b)-1)>>b;a.has(d)&&clearTimeout(a.get(d));a.set(d,setTimeout(function(){a.delete(d);0==a.length?c=-Infinity:d==c&&(c=Math.max(...a.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<b}}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
function
|
|
520
|
-
r(),
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
p.
|
|
526
|
-
0
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
case
|
|
533
|
-
|
|
534
|
-
|
|
684
|
+
var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var m=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
|
|
685
|
+
function da(){let b=null,a=null;const c=(l,h,g)=>{const n=l?-1:1;let r=0,A=0,q=new Map;const v=p=>{const y=q;A=r=0;q=new Map;y.forEach(C=>{try{C(p)}catch(G){console.error(G)}});this.ab();b&&b.Db(l)};return{add:p=>{r||=h(v);const y=++A;q.set(y,p);return n*y},remove:p=>{q.delete(n*p);r&&0==q.size&&(g(r),r=0)}}},d=c(!1,l=>requestAnimationFrame(l),l=>cancelAnimationFrame(l)),f=c(!0,l=>null.request(l),l=>null.cancel(l));this.requestAnimationFrame=function(l){return d.add(l)};this.cancelAnimationFrame=
|
|
686
|
+
function(l){(0>l?f:d).remove(l)};this.Bb=function(l){a&&(document.body.remove(a),a=null);l||(a=document.createElement("div"),a.style.backgroundColor="black",a.style.position="fixed",a.style.right=0,a.style.top=0,a.style.color="white",a.style.padding="4px",a.innerHTML="RIVE FPS",l=function(h){a.innerHTML="RIVE FPS "+h.toFixed(1)},document.body.appendChild(a));b=new function(){let h=[0,0],g=0;this.Db=function(n){const r=performance.now();g?(++h[n?1:0],n=r-g,1E3<n&&(l(1E3*Math.max(h[0],h[1])/n),g=0)):
|
|
687
|
+
(g=r,h=[0,0])}}};this.yb=function(){a&&(document.body.remove(a),a=null);b=null};this.ab=function(){}}function ea(b){console.assert(!0);const a=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<b)-1)>>b;a.has(d)&&clearTimeout(a.get(d));a.set(d,setTimeout(function(){a.delete(d);0==a.length?c=-Infinity:d==c&&(c=Math.max(...a.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<b}}
|
|
688
|
+
function ha(b){return function(){b();const a=m.riveScripting;if(a)for(const c of a.frameBoundary())console.warn(c)}}const ia=m.onRuntimeInitialized;
|
|
689
|
+
m.onRuntimeInitialized=function(){ia&&ia();m.startFileScripts=function(h){const g=m.riveScripting;return h&&g&&h.startScripts?g.prepare().then(function(){h.startScripts();return h}):Promise.resolve(h)};let b=m.decodeAudio;m.decodeAudio=function(h,g,n=null){h=b(h,n??null);g(h)};let a=m.decodeFont;m.decodeFont=function(h,g,n=null){h=a(h,n??null);g(h)};const c=m.FileAsset.prototype.decode;m.FileAsset.prototype.decode=function(h,g){return c.call(this,h,g??null)};let d=m.setFallbackFontCb;m.setFallbackFontCallback=
|
|
690
|
+
"function"===typeof d?function(h){d(h)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};"function"!==typeof m.setSystemLanguages&&(m.setSystemLanguages=function(){});const f=m.FileAssetLoader;m.ptrToAsset=h=>{let g=m.ptrToFileAsset(h);return g.isImage?m.ptrToImageAsset(h):g.isFont?m.ptrToFontAsset(h):g.isAudio?m.ptrToAudioAsset(h):g};m.CustomFileAssetLoader=f.extend("CustomFileAssetLoader",{__construct:function({loadContents:h}){this.__parent.__construct.call(this);
|
|
691
|
+
this.nb=h},loadContents:function(h,g){h=m.ptrToAsset(h);return this.nb(h,g)}});m.CDNFileAssetLoader=f.extend("CDNFileAssetLoader",{__construct:function(h){this.__parent.__construct.call(this);this.ob=h??null},loadContents:function(h){let g=m.ptrToAsset(h);h=g.cdnUuid;if(""===h)return!1;const n=this.ob??null;(function(r,A){var q=new XMLHttpRequest;q.responseType="arraybuffer";q.onreadystatechange=function(){4==q.readyState&&200==q.status&&A(q)};q.open("GET",r,!0);q.send(null)})(g.cdnBaseUrl+"/"+h,
|
|
692
|
+
r=>{g.decode(new Uint8Array(r.response),n)});return!0}});m.FallbackFileAssetLoader=f.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);this.Za=[]},addLoader:function(h){this.Za.push(h)},loadContents:function(h,g){for(let n of this.Za)if(n.loadContents(h,g))return!0;return!1}});let l=m.computeAlignment;m.computeAlignment=function(h,g,n,r,A=1){return l.call(this,h,g,n,r,A)}};function la(){}const F=new Int32Array(5);
|
|
693
|
+
function ma(b,a,c,d,f){b(a,c,F);b=Math.max(F[0],0);const l=Math.max(F[1],0);a=Math.min(F[2],Math.ceil(d*a));c=Math.min(F[3],Math.ceil(f*c));F[4]=b!==F[0]||l!==F[1]||a!==F[2]||c!==F[3]?1:0;F[0]=b;F[1]=l;F[2]=a;F[3]=c;return a>b&&c>l}function na(){const b=oa.Mb();return 0===b?0:b}
|
|
694
|
+
function pa(b,a,c,d,f,l,h,g,n,r,A){var q=na(),v=q-1,p=v-6;if(!(0<p))return r(),la;let y=1,C=1;if(!ma(g,y,C,c,d))return r(),la;const G=F[2]-F[0],E=F[3]-F[1];if(G>v||E>v)if(y*=Math.min(1,p/G),C*=Math.min(1,p/E),!ma(g,y,C,c,d))return r(),la;c=F[0];d=F[1];v=F[2];p=F[3];g=0!==F[4];if(1>y||1>C)--c,--d,v+=1,p+=1;const H=v-c,L=p-d;b.i||(b.i=new m.DynamicRectanizer(q),b.i.reset(512,512));q=b.i.addRect(H+1,L+1);if(0>q&&(A(),q=b.i.addRect(H+1,L+1),0>q))return console.assert(!1,"draw does not fit in an empty atlas"),
|
|
695
|
+
r(),la;const R=q&65535,I=q>>16;b.m.push({pb:[y*f[0],C*f[1],y*f[2],C*f[3],y*f[4]-c+R,C*f[5]-d+I],qb:R,rb:I,Vb:H,Ya:L,$a:g,N:n,Pb:()=>{r()}});const S=c/y,Y=d/C,ca=H/y,ra=L/C,sa=b.M;return function(){const Ea=sa.canvas();Ea&&(a.save(),a.resetTransform(),a.globalCompositeOperation=l,a.globalAlpha=h,a.drawImage(Ea,R,I,H,L,S,Y,ca,ra),a.restore())}}class qa{constructor(){this.M=new ua;this.i=null;this.m=[];this.na=new ea(8);this.$=new ea(8)}}
|
|
696
|
+
const oa=new function(){function b(){if(!a){var q=document.createElement("canvas"),v={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=q.getContext("webgl",v),c=1,!p)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(p=q.getContext("webgl2",
|
|
697
|
+
v))c=2;else if(p=q.getContext("webgl",v))c=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;p=new Proxy(p,{get(C,G){if(C.isContextLost()){if(n||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",G),n=!0),"function"===typeof C[G])return function(){}}else return"function"===typeof C[G]?function(...E){return C[G].apply(C,E)}:C[G]},set(C,G,E){if(C.isContextLost())n||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+
|
|
698
|
+
G),n=!0);else return C[G]=E,!0}});d=Math.min(p.getParameter(p.MAX_RENDERBUFFER_SIZE),p.getParameter(p.MAX_TEXTURE_SIZE));function y(C,G,E){G=p.createShader(G);p.shaderSource(G,E);p.compileShader(G);E=p.getShaderInfoLog(G);if(0<(E||"").length)throw E;p.attachShader(C,G)}q=p.createProgram();y(q,p.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }");
|
|
699
|
+
y(q,p.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }");p.bindAttribLocation(q,0,"vertex");p.bindAttribLocation(q,1,"uv");p.linkProgram(q);v=p.getProgramInfoLog(q);if(0<(v||"").trim().length)throw v;f=p.getUniformLocation(q,"mat");l=p.getUniformLocation(q,"translate");p.useProgram(q);p.bindBuffer(p.ARRAY_BUFFER,p.createBuffer());
|
|
700
|
+
p.enableVertexAttribArray(0);p.enableVertexAttribArray(1);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,p.createBuffer());p.uniform1i(p.getUniformLocation(q,"image"),0);p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);a=p}return!0}let a=null,c=0,d=0,f=null,l=null,h=0,g=0,n=!1;b();this.Mb=function(){b();return d};this.xb=function(q){a&&a.deleteTexture&&a.deleteTexture(q)};this.vb=function(q){if(!b())return null;const v=a.createTexture();if(!v)return null;a.bindTexture(a.TEXTURE_2D,v);a.texImage2D(a.TEXTURE_2D,
|
|
701
|
+
0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,q);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);2==c?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_LINEAR),a.generateMipmap(a.TEXTURE_2D)):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);return v};const r=new ea(10),A=new ea(10);this.Ab=function(q,v,p){if(b()&&a.canvas){if(a.canvas.width!=q||a.canvas.height!=
|
|
702
|
+
v)a.canvas.width=q,a.canvas.height=v;a.viewport(0,0,q,v);a.disable(a.SCISSOR_TEST);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);var y=I=>I.N.image.Ca<<1|(I.$a?1:0);p.sort((I,S)=>y(S)-y(I));var C=0,G=0;for(var E of p)C+=E.N.pa.length,G+=E.N.indices.length;E=r.push(C);h!=E&&(a.bufferData(a.ARRAY_BUFFER,8*E,a.DYNAMIC_DRAW),h=E);E=0;for(var H of p)a.bufferSubData(a.ARRAY_BUFFER,E,H.N.pa),E+=4*H.N.pa.length;console.assert(E==4*C);for(var L of p)a.bufferSubData(a.ARRAY_BUFFER,E,L.N.hb),E+=4*L.N.hb.length;
|
|
703
|
+
console.assert(E==8*C);E=A.push(G);g!=E&&(a.bufferData(a.ELEMENT_ARRAY_BUFFER,2*E,a.DYNAMIC_DRAW),g=E);H=0;for(var R of p)a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,H,R.N.indices),H+=2*R.N.indices.length;console.assert(H==2*G);R=0;L=!1;E=H=0;for(const I of p){p=I.N;p.image.Ca!=R&&(a.bindTexture(a.TEXTURE_2D,p.image.V||null),R=p.image.Ca);I.$a?(a.scissor(I.qb,v-I.rb-I.Ya,I.Vb,I.Ya),L||(a.enable(a.SCISSOR_TEST),L=!0)):L&&(a.disable(a.SCISSOR_TEST),L=!1);const S=I.pb,Y=2/q,ca=-2/v;a.uniform4f(f,S[0]*Y,S[1]*
|
|
704
|
+
ca,S[2]*Y,S[3]*ca);a.uniform2f(l,S[4]*Y-1,S[5]*ca+1);a.vertexAttribPointer(0,2,a.FLOAT,!1,0,E);a.vertexAttribPointer(1,2,a.FLOAT,!1,0,E+4*C);a.drawElements(a.TRIANGLES,p.indices.length,a.UNSIGNED_SHORT,H);E+=4*p.pa.length;H+=2*p.indices.length}console.assert(E==4*C);console.assert(H==2*G)}};this.canvas=function(){return b()&&a.canvas}};class ua{constructor(){this.La=!1}canvas(){return oa.canvas()||null}}const va=new qa;
|
|
705
|
+
function wa(b,a,c,d,f,l){const h=new DOMMatrix;h.a=b;h.b=a;h.c=c;h.d=d;h.e=f;h.f=l;return h}const xa="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),ya=m.onRuntimeInitialized;
|
|
706
|
+
m.onRuntimeInitialized=function(){function b(e){switch(e){case y.srcOver:return"source-over";case y.additive:return"lighter";case y.screen:return"screen";case y.overlay:return"overlay";case y.darken:return"darken";case y.lighten:return"lighten";case y.colorDodge:return"color-dodge";case y.colorBurn:return"color-burn";case y.hardLight:return"hard-light";case y.softLight:return"soft-light";case y.difference:return"difference";case y.exclusion:return"exclusion";case y.multiply:return"multiply";case y.hue:return"hue";
|
|
707
|
+
case y.saturation:return"saturation";case y.color:return"color";case y.luminosity:return"luminosity"}}function a(e){return"rgba("+((16711680&e)>>>16)+","+((65280&e)>>>8)+","+((255&e)>>>0)+","+((4278190080&e)>>>24)/255+")"}function c(e,k,t,u,w){return{fb:e,gb:k,Ta:t,Ua:u,type:w,Ka:[],T:null}}function d(e,k,t,u){if(k.Y===H&&!(0<k.Z))return null;t=1===t;return{Ha:e.Ma(t?k.xa:null),gradientTransform:t?k.ca:null,Ub:t?k.Z*k.Ba:k.Z,fillRule:e.ha===L?"evenodd":"nonzero",opacity:u,style:k.Y,color:k.sa,Xa:k.I,
|
|
708
|
+
tb:k.ra,join:k.ya,sb:k.qa}}function f(e,k){return k.Y!==H||0<k.Z?{path:e.kb(e.ha),Ga:k.lb()}:null}function l(){if(0!==I.m.length){var e=na();if(0!==e){var k=Math.min(I.na.push(I.i.drawWidth()),e);e=Math.min(I.$.push(I.i.drawHeight()),e);oa.Ab(k,e,I.m)}}for(const t of ta){for(const u of t.G)u();t.G=[]}ta.clear();for(const t of I.m)t.Pb();I.m=[];I.i&&I.i.reset(512,512)}ya&&ya();var h=m.RenderPaintStyle,g=m.FillRule;const n=m.RenderPath,r=m.RenderPaint,A=m.Renderer,q=m.StrokeCap,v=m.StrokeJoin,p=m.StrokePosition,
|
|
709
|
+
y=m.BlendMode,C=m.ImageFilter,G=m.ImageWrap,E=h.fill,H=h.stroke,L=g.evenOdd,R=g.nonZero,I=va,S=I.M;let Y=1;var ca=m.RenderImage.extend("CanvasRenderImage",{__construct:function({ea:e,oa:k}={}){this.__parent.__construct.call(this);this.Ca=Y;Y=Y+1&2147483647||1;this.ea=e;this.oa=k;this.V=this.Qa=this.ia=this.wa=null},__destruct:function(){this.V&&(oa.xb(this.V),this.V=null);this.ia&&URL.revokeObjectURL(this.ia);this.__parent.__destruct.call(this)},decode:function(e){var k=this;k.oa&&k.oa(k);var t=new Image;
|
|
535
710
|
k.ia=URL.createObjectURL(new Blob([e],{type:"image/png"}));t.onload=function(){k.wa=t;k.V=oa.vb(t);k.size(t.width,t.height);k.ea&&k.ea(k)};t.src=k.ia}});class ra{constructor(e){this.i=e;this.path=new Path2D;this.m=null;this.ua=!1}M(){null!==this.m&&(this.path.lineTo(this.m.x,this.m.y),this.m=null)}moveTo(e,k){this.M();let t=e,u=k;null!==this.i&&(e=this.i.transformPoint({x:e,y:k}),t=e.x,u=e.y);this.path.moveTo(t,u);this.m={x:t,y:u}}lineTo(e,k){this.m=null;null!==this.i?(e=this.i.transformPoint({x:e,
|
|
536
|
-
y:k}),this.path.lineTo(e.x,e.y)):this.path.lineTo(e,k)}wb(e,k,t,u,
|
|
537
|
-
this.m||this.ua||(this.M(),this.ua=!0)}dispose(){}}class sa{constructor(e){this.Lb=e;this.$=this.M=0;this.m=null;this.i=e(null)}clear(){this.na(null)}Da(e,k){for(((null===k?null!==this.m:null===this.m||this.m.a!==k.a||this.m.b!==k.b||this.m.c!==k.c||this.m.d!==k.d||this.m.e!==k.e||this.m.f!==k.f)||this.$<e.length&&(0<this.M||this.i.ua))&&this.na(k);this.$<e.length;)e[this.$++](this.i);this.i.
|
|
711
|
+
y:k}),this.path.lineTo(e.x,e.y)):this.path.lineTo(e,k)}wb(e,k,t,u,w,B){this.m=null;null!==this.i?(e=this.i.transformPoint({x:e,y:k}),t=this.i.transformPoint({x:t,y:u}),w=this.i.transformPoint({x:w,y:B}),this.path.bezierCurveTo(e.x,e.y,t.x,t.y,w.x,w.y)):this.path.bezierCurveTo(e,k,t,u,w,B)}close(){this.m=null;this.path.closePath()}addPath(e,k,t,u,w,B,D){this.M();const z=new ra(null);for(const x of e)x(z);z.Wa();e=wa(k,t,u,w,B,D);null!==this.i&&(e=this.i.multiply(e));this.path.addPath(z.path,e)}Wa(){null===
|
|
712
|
+
this.m||this.ua||(this.M(),this.ua=!0)}dispose(){}}class sa{constructor(e){this.Lb=e;this.$=this.M=0;this.m=null;this.i=e(null)}clear(){this.na(null)}Da(e,k){for(((null===k?null!==this.m:null===this.m||this.m.a!==k.a||this.m.b!==k.b||this.m.c!==k.c||this.m.d!==k.d||this.m.e!==k.e||this.m.f!==k.f)||this.$<e.length&&(0<this.M||this.i.ua))&&this.na(k);this.$<e.length;)e[this.$++](this.i);this.i.Wa();this.M++;return this.i.path}Ja(e){null!==this.i&&e===this.i.path&&this.M--}dispose(){this.i.dispose();
|
|
538
713
|
this.i=null}na(e){this.i.dispose();this.$=this.M=0;this.m=e;this.i=this.Lb(e)}}var Ea=n.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this);this.W=[];this.ja=new sa(e=>new ra(e));this.ka=new sa(e=>new ra(e));this.X=new Map;this.ha=R;this.va=!1},__destruct:function(){this.ja.dispose();this.ka.dispose();for(const e of this.X.values())e.dispose();this.X.clear();this.__parent.__destruct.call(this)},rewind:function(){this.W.length=0;this.ja.clear();this.ka.clear();for(const e of this.X.values())e.clear();
|
|
539
|
-
this.va=!1},addPath:function(e,k,t,u,
|
|
540
|
-
e);e.ref&&e.ref();return e},kb:function(e){var k=this.X.get(e);void 0===k&&(k=new sa(()=>S.Yb(e)),this.X.set(e,k));k=k.Da(this.W,null);k.ref&&k.ref();return k},za:function(e){this.ja.Ja(e);this.ka.Ja(e);for(const k of this.X.values())k.Ja(e);e.unref&&e.unref()}});const bc=c(0,0,0,0,0);var dc=r.extend("CanvasRenderPaint",{__construct:function(){this.__parent.__construct.call(this);this.Y=E;this.sa=4278190080;this.Z=1;this.ya=
|
|
541
|
-
this.A=this.ca=this.I=null;this.Ba=1;this.B=0;this.S=null;this.
|
|
542
|
-
b(e);this.B++},clearGradient:function(){this.I=null;this.B++},linearGradient:function(e,k,t,u){this.I=c(e,k,t,u,0);this.B++},radialGradient:function(e,k,t,u){this.I=c(e,k,t,u,1);this.B++},angularGradient:function(){this.I=c(0,0,0,0,2);this.B++},addStop:function(e,k){this.I.Ka.push({color:e,stop:k});this.I.T=null;this.B++},modulatedImage:function(e,k,t,u,
|
|
543
|
-
k,t,u,
|
|
544
|
-
P=0,T=0;null!==this.A&&(e=this.A.jb,
|
|
545
|
-
return this.S}});const ta=new Set,ub=Object.prototype.hasOwnProperty;var ec=
|
|
546
|
-
this.F.pop();this.G.push(this.s.restore.bind(this.s))},transform:function(e,k,t,u,
|
|
547
|
-
1]),u=k.A||k.Aa!==p.center?2:0!==k.ta?S.
|
|
548
|
-
T,Math.sqrt(K*K+P*P))):x.T=B.createConicGradient(0,0,0);J=x.Ka;for(let Z=0,ka=J.length;Z<ka;Z++)x.T.addColorStop(J[Z].stop,a(J[Z].color))}x=x.T}else x=a(
|
|
549
|
-
break a}x=void 0}B.lineCap=x;a:{switch(
|
|
550
|
-
u.Ga,B*
|
|
551
|
-
e.
|
|
552
|
-
this.s.canvas.width,this.s.canvas.height,this.L.slice(this.L.length-6),b(e),Math.max(0,k*this.F[this.F.length-1]),(x,J,K)=>{K[0]=Math.floor(t*x);K[1]=Math.floor(u*J);K[2]=Math.ceil(
|
|
553
|
-
flush:function(){},translate:function(e,k){this.transform(1,0,0,1,e,k)}});
|
|
554
|
-
restore:function(){
|
|
555
|
-
flush:function(){
|
|
556
|
-
...J))}}return
|
|
557
|
-
t&&(k=new
|
|
558
|
-
h.requestAnimationFrame.bind(h);
|
|
714
|
+
this.va=!1},addPath:function(e,k,t,u,w,B,D){const z=e.W.slice();this.ba(x=>x.addPath(z,k,t,u,w,B,D))},fillRule:function(e){this.ha=e},moveTo:function(e,k){this.va=!0;this.ba(t=>t.moveTo(e,k))},lineTo:function(e,k){this.Pa();this.ba(t=>t.lineTo(e,k))},cubicTo:function(e,k,t,u,w,B){this.Pa();this.ba(D=>D.wb(e,k,t,u,w,B))},close:function(){this.ba(e=>e.close())},Pa:function(){this.va||this.moveTo(0,0)},ba:function(e){this.W.push(e)},Ma:function(e){e=null===e?this.ja.Da(this.W,null):this.ka.Da(this.W,
|
|
715
|
+
e);e.ref&&e.ref();return e},kb:function(e){var k=this.X.get(e);void 0===k&&(k=new sa(()=>S.Yb(e)),this.X.set(e,k));k=k.Da(this.W,null);k.ref&&k.ref();return k},za:function(e){this.ja.Ja(e);this.ka.Ja(e);for(const k of this.X.values())k.Ja(e);e.unref&&e.unref()}});const bc=c(0,0,0,0,0);var dc=r.extend("CanvasRenderPaint",{__construct:function(){this.__parent.__construct.call(this);this.Y=E;this.sa=4278190080;this.Z=1;this.ya=v.miter;this.ra=q.butt;this.Aa=p.center;this.ta=0;this.qa=b(y.srcOver);this.xa=
|
|
716
|
+
this.A=this.ca=this.I=null;this.Ba=1;this.B=0;this.S=null;this.Ra=-1},__destruct:function(){null!==this.S&&(m.unrefWebGL2Paint(this.S),this.S=null);this.__parent.__destruct.call(this)},color:function(e){this.sa=e;this.I=null;this.B++},thickness:function(e){this.Z=Math.abs(e);this.B++},join:function(e){this.ya=e;this.B++},cap:function(e){this.ra=e;this.B++},strokePosition:function(e){this.Aa=e;this.B++},feather:function(e){this.ta=Math.abs(e);this.B++},style:function(e){this.Y=e;this.B++},blendMode:function(e){this.qa=
|
|
717
|
+
b(e);this.B++},clearGradient:function(){this.I=null;this.B++},linearGradient:function(e,k,t,u){this.I=c(e,k,t,u,0);this.B++},radialGradient:function(e,k,t,u){this.I=c(e,k,t,u,1);this.B++},angularGradient:function(){this.I=c(0,0,0,0,2);this.B++},addStop:function(e,k){this.I.Ka.push({color:e,stop:k});this.I.T=null;this.B++},modulatedImage:function(e,k,t,u,w,B,D,z,x,J){const K=e.wa;K?this.A={image:K,jb:e.Qa,filter:k,Wb:t,Xb:u,transform:wa(w,B,D,z,x,J)}:this.A=null},completeGradient:function(){},_setGradientTransform:function(e,
|
|
718
|
+
k,t,u,w,B,D,z,x,J,K,P,T){1===e&&0===k&&0===t&&1===u&&0===w&&0===B?this.xa=this.ca=null:(this.ca=wa(e,k,t,u,w,B),this.xa=wa(D,z,x,J,K,P));this.Ba=T;this.B++},lb:function(){if(this.Ra!==this.B){null!==this.S&&m.unrefWebGL2Paint(this.S);const k=null!==this.I?this.I:bc;let t=null,u=null;if(null!==this.I){var e=k.Ka;t=new Uint32Array(e.length);u=new Float32Array(e.length);for(let ja=0,cc=e.length;ja<cc;ja++)t[ja]=e[ja].color,u[ja]=e[ja].stop}e=null;let w=C.bilinear,B=G.clamp,D=G.clamp,z=1,x=0,J=0,K=1,
|
|
719
|
+
P=0,T=0;null!==this.A&&(e=this.A.jb,w=this.A.filter,B=this.A.Wb,D=this.A.Xb,z=this.A.transform.a,x=this.A.transform.b,J=this.A.transform.c,K=this.A.transform.d,P=this.A.transform.e,T=this.A.transform.f);let Z=1,ka=0,Ga=0,Va=1,sb=0,tb=0;const fa=this.ca;null!==fa&&(Z=fa.a,ka=fa.b,Ga=fa.c,Va=fa.d,sb=fa.e,tb=fa.f);this.S=m.makeWebGL2Paint(this.Y,this.sa,this.Z,this.ya,this.ra,this.Aa,this.ta,t,u,k.type,k.fb,k.gb,k.Ta,k.Ua,Z,ka,Ga,Va,sb,tb,e,w,B,D,z,x,J,K,P,T);this.Ra=this.B}m.refWebGL2Paint(this.S);
|
|
720
|
+
return this.S}});const ta=new Set,ub=Object.prototype.hasOwnProperty;var ec=m.CanvasRenderer=A.extend("Renderer",{__construct:function(e){this.__parent.__construct.call(this);this.L=[1,0,0,1,0,0];this.F=[1];this.s=e.getContext("2d");this.Oa=e;this.G=[]},save:function(){this.L.push(...this.L.slice(this.L.length-6));this.F.push(this.F[this.F.length-1]);this.G.push(this.s.save.bind(this.s))},restore:function(){const e=this.L.length-6;if(6>e)throw"restore() called without matching save().";this.L.splice(e);
|
|
721
|
+
this.F.pop();this.G.push(this.s.restore.bind(this.s))},transform:function(e,k,t,u,w,B){const D=this.L,z=D.length-6;D.splice(z,6,D[z]*e+D[z+2]*k,D[z+1]*e+D[z+3]*k,D[z]*t+D[z+2]*u,D[z+1]*t+D[z+3]*u,D[z]*w+D[z+2]*B+D[z+4],D[z+1]*w+D[z+3]*B+D[z+5]);this.G.push(this.s.transform.bind(this.s,e,k,t,u,w,B))},rotate:function(e){const k=Math.sin(e);e=Math.cos(e);this.transform(e,k,-k,e,0,0)},modulateOpacity:function(e){this.F[this.F.length-1]*=e},_drawPath:function(e,k){const t=Math.max(0,this.F[this.F.length-
|
|
722
|
+
1]),u=k.A||k.Aa!==p.center&&S.La?2:0!==k.ta?S.La?2:0:null===k.I||null===k.ca?0:k.Y!==H||0<k.Ba?1:S.La?2:0;if(2===u)(null===k.A||k.A.jb)&&this.mb(e,k,t);else{var w=d(e,k,u,t);null!==w&&this.G.push(()=>{var B=this.s;const D=B.globalCompositeOperation,z=B.globalAlpha;B.globalCompositeOperation=w.sb;B.globalAlpha=w.opacity;if(null!==w.Xa){var x=w.Xa;if(null===x.T){var J=x.fb;const T=x.gb;var K=x.Ta,P=x.Ua;0==x.type?x.T=B.createLinearGradient(J,T,K,P):1==x.type?(K-=J,P-=T,x.T=B.createRadialGradient(J,
|
|
723
|
+
T,0,J,T,Math.sqrt(K*K+P*P))):x.T=B.createConicGradient(0,0,0);J=x.Ka;for(let Z=0,ka=J.length;Z<ka;Z++)x.T.addColorStop(J[Z].stop,a(J[Z].color))}x=x.T}else x=a(w.color);null!==w.gradientTransform&&(B.save(),B.transform(w.gradientTransform.a,w.gradientTransform.b,w.gradientTransform.c,w.gradientTransform.d,w.gradientTransform.e,w.gradientTransform.f));switch(w.style){case H:B.strokeStyle=x;B.lineWidth=w.Ub;a:{switch(w.tb){case q.butt:x="butt";break a;case q.round:x="round";break a;case q.square:x="square";
|
|
724
|
+
break a}x=void 0}B.lineCap=x;a:{switch(w.join){case v.miter:x="miter";break a;case v.round:x="round";break a;case v.bevel:x="bevel";break a}x=void 0}B.lineJoin=x;B.miterLimit=4;B.stroke(w.Ha);break;case E:B.fillStyle=x,B.fill(w.Ha,w.fillRule)}null!==w.gradientTransform&&B.restore();B.globalCompositeOperation=D;B.globalAlpha=z;e.za(w.Ha)})}},mb:function(e,k,t){const u=f(e,k);if(null!==u){var w=this.L.slice(this.L.length-6);k=pa(I,this.s,this.s.canvas.width,this.s.canvas.height,w,k.qa,t,(B,D,z)=>m.webGL2PathPixelBounds(u.path,
|
|
725
|
+
u.Ga,B*w[0],D*w[1],B*w[2],D*w[3],B*w[4],D*w[5],z),B=>B.drawPath(u.path,u.Ga),()=>{e.za(u.path);m.unrefWebGL2Paint(u.Ga)},l);ta.add(this);this.G.push(k)}},_drawRiveImage:function(e,k,t){var u=e.wa;if(u){var w=this.s,B=b(k),D=Math.max(0,t*this.F[this.F.length-1]);this.G.push(function(){w.globalCompositeOperation=B;w.globalAlpha=D;w.drawImage(u,0,0);w.globalAlpha=1})}},_getMatrix:function(e){const k=this.L,t=k.length-6;for(let u=0;6>u;++u)e[u]=k[t+u]},_drawImageMesh:function(e,k,t,u,w,B,D,z){const x=
|
|
726
|
+
e.Qa;x?this.Na(t,u,w,B,D,z,J=>m.drawWebGL2PendingMesh(J,k,x),()=>k.unref()):k.unref()},_drawImageMeshFromHeap:function(e,k,t,u,w,B,D,z,x,J,K,P,T){if(e.V){try{var Z=m.HEAPF32.slice(u>>2,(u>>2)+w);var ka=m.HEAPF32.slice(B>>2,(B>>2)+D);var Ga=m.HEAPU16.slice(z>>1,(z>>1)+x)}catch(Va){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}this.Na(k,t,J,K,P,T,{image:e,pa:Z,hb:ka,indices:Ga},()=>{})}},Na:function(e,k,t,u,w,B,D,z){e=pa(I,this.s,
|
|
727
|
+
this.s.canvas.width,this.s.canvas.height,this.L.slice(this.L.length-6),b(e),Math.max(0,k*this.F[this.F.length-1]),(x,J,K)=>{K[0]=Math.floor(t*x);K[1]=Math.floor(u*J);K[2]=Math.ceil(w*x);K[3]=Math.ceil(B*J)},D,z,l);ta.add(this);this.G.push(e)},_clipPath:function(e){const k=e.ha===L?"evenodd":"nonzero",t=e.Ma(null);this.G.push(()=>{this.s.clip(t,k);e.za(t)})},beginFrame:function(e=!0){ta.add(this);e&&this.G.push(this.s.clearRect.bind(this.s,0,0,this.Oa.width,this.Oa.height))},clear:function(){this.beginFrame(!0)},
|
|
728
|
+
flush:function(){},translate:function(e,k){this.transform(1,0,0,1,e,k)}});m.makeRenderer=function(e){const k=new ec(e),t=k.s;let u=null,w=null;const B={attachSession:function(z){if(z&&u===z)return!0;if(!z||u||"function"!==typeof m.c2dDeferredClaim||"function"!==typeof m.c2dDeferredRenderer||!m.c2dDeferredClaim(z))return!1;const x=m.c2dDeferredRenderer(z);if(!x)return!1;u=z;w=x;return!0},detachSession:function(){u&&m.c2dDeferredDetach(u);w=u=null},deferredActive:function(){return null!==w}},D={save:function(){m.c2dDeferredSave(u)},
|
|
729
|
+
restore:function(){m.c2dDeferredRestore(u)},transform:function(z,x,J,K,P,T){m.c2dDeferredTransform(u,z,x,J,K,P,T)},translate:function(z,x){m.c2dDeferredTransform(u,1,0,0,1,z,x)},rotate:function(z){const x=Math.sin(z);z=Math.cos(z);m.c2dDeferredTransform(u,z,x,-x,z,0,0)},align:function(z,x,J,K,P){m.c2dDeferredAlign(u,z,x,J.minX,J.minY,J.maxX,J.maxY,K.minX,K.minY,K.maxX,K.maxY,void 0===P?1:P)},beginFrame:function(z=!0){k.beginFrame(z);m.c2dDeferredBeginFrame(u)},clear:function(){k.beginFrame(!0);m.c2dDeferredBeginFrame(u)},
|
|
730
|
+
flush:function(){m.c2dDeferredReplay(u,k)}};return new Proxy(k,{get(z,x){if(ub.call(B,x))return B[x];if("_deferredRecorder"===x)return w;if(null!==w&&ub.call(D,x))return D[x];if("function"===typeof z[x])return function(...J){return z[x].apply(z,J)};if("function"===typeof t[x]){if(-1<xa.indexOf(x))throw Error("RiveException: Method call to '"+x+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...J){k.G.push(t[x].bind(t,
|
|
731
|
+
...J))}}return z[x]},set(z,x,J){if(x in t)return k.G.push(()=>{t[x]=J}),!0}})};m.decodeImage=function(e,k){(new ca({ea:k})).decode(e)};m.renderFactory={makeRenderPaint:function(){return new dc},makeRenderPath:function(){return new Ea},makeRenderImage:function(){let e=Wa;return new ca({oa:()=>{e.total++},ea:()=>{e.loaded++;if(e.loaded===e.total){const k=e.ready;k&&(k(),e.ready=null)}}})}};let fc=m.load,Wa=null;m.load=function(e,k,t=!0,u=null,w=!1){const B=new m.FallbackFileAssetLoader;void 0!==k&&
|
|
732
|
+
B.addLoader(k);t&&(k=new m.CDNFileAssetLoader(u),B.addLoader(k));return(new Promise(function(D){let z=null;Wa={total:0,loaded:0,ready:function(){D(z)}};z=fc(e,B,u??null,!!w);const x=m.riveScripting;x&&x.prepare();0==Wa.total&&D(z)})).then(m.startFileScripts)};const gc=m.Artboard.prototype.draw;m.Artboard.prototype.draw=function(e){gc.call(this,e._deferredRecorder||e)};let hc=m.RendererWrapper.prototype.align;m.RendererWrapper.prototype.align=function(e,k,t,u,w=1){hc.call(this,e,k,t,u,w)};h=new da;
|
|
733
|
+
m.requestAnimationFrame=h.requestAnimationFrame.bind(h);m.cancelAnimationFrame=h.cancelAnimationFrame.bind(h);m.enableFPSCounter=h.Bb.bind(h);m.disableFPSCounter=h.yb;g=ha(l);h.ab=g;m.resolveAnimationFrame=g;m.cleanup=function(){I.i&&(I.i["delete"](),I.i=null)}};ba&&(_scriptName=self.location.href);var za="",Aa,Ba;
|
|
559
734
|
if(aa||ba){try{za=(new URL(".",_scriptName)).href}catch{}ba&&(Ba=b=>{var a=new XMLHttpRequest;a.open("GET",b,!1);a.responseType="arraybuffer";a.send(null);return new Uint8Array(a.response)});Aa=async b=>{if(Ca(b))return new Promise((c,d)=>{var f=new XMLHttpRequest;f.open("GET",b,!0);f.responseType="arraybuffer";f.onload=()=>{200==f.status||0==f.status&&f.response?c(f.response):d(f.status)};f.onerror=d;f.send(null)});var a=await fetch(b,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+
|
|
560
|
-
" : "+a.url);}}var Da=console.log.bind(console),Fa=console.error.bind(console),Ha,Ia=!1,Ca=b=>b.startsWith("file://"),Ja,Ka,La,M,Ma,Na,Oa,N,Pa,Qa,Ra=!1;function Sa(){var b=Ta.buffer;
|
|
561
|
-
function Ua(b){
|
|
735
|
+
" : "+a.url);}}var Da=console.log.bind(console),Fa=console.error.bind(console),Ha,Ia=!1,Ca=b=>b.startsWith("file://"),Ja,Ka,La,M,Ma,Na,Oa,N,Pa,Qa,Ra=!1;function Sa(){var b=Ta.buffer;m.HEAP8=La=new Int8Array(b);Ma=new Int16Array(b);m.HEAPU8=M=new Uint8Array(b);m.HEAPU16=Na=new Uint16Array(b);m.HEAP32=Oa=new Int32Array(b);m.HEAPU32=N=new Uint32Array(b);m.HEAPF32=Pa=new Float32Array(b);Qa=new Float64Array(b)}
|
|
736
|
+
function Ua(b){m.onAbort?.(b);b="Aborted("+b+")";Fa(b);Ia=!0;b=new WebAssembly.RuntimeError(b+". Build with -sASSERTIONS for more info.");Ka?.(b);throw b;}var Xa;async function Ya(b){if(!Ha)try{var a=await Aa(b);return new Uint8Array(a)}catch{}if(b==Xa&&Ha)b=new Uint8Array(Ha);else if(Ba)b=Ba(b);else throw"both async and sync fetching of the wasm failed";return b}
|
|
562
737
|
async function Za(b,a){try{var c=await Ya(b);return await WebAssembly.instantiate(c,a)}catch(d){Fa(`failed to asynchronously prepare wasm: ${d}`),Ua(d)}}async function $a(b){var a=Xa;if(!Ha&&!Ca(a))try{var c=fetch(a,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,b)}catch(d){Fa(`wasm streaming compile failed: ${d}`),Fa("falling back to ArrayBuffer instantiation")}return Za(a,b)}
|
|
563
|
-
var ab,bb,cb=b=>{for(;0<b.length;)b.shift()(
|
|
738
|
+
var ab,bb,cb=b=>{for(;0<b.length;)b.shift()(m)},db=[],eb=[],fb=()=>{var b=m.preRun.shift();eb.push(b)},gb=(b,a)=>Object.defineProperty(a,"name",{value:b}),hb=[],ib=[0,1,,1,null,1,!0,1,!1,1],O=class extends Error{constructor(b){super(b);this.name="BindingError"}},Q=b=>{if(!b)throw new O(`Cannot use deleted val. handle = ${b}`);return ib[b]},jb=b=>{switch(b){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const a=hb.pop()||ib.length;ib[a]=b;ib[a+1]=1;return a}};
|
|
564
739
|
class kb extends Error{}
|
|
565
740
|
var U=b=>{for(var a="";;){var c=M[b++];if(!c)return a;a+=String.fromCharCode(c)}},lb={},mb=(b,a)=>{if(void 0===a)throw new O("ptr should not be undefined");for(;b.C;)a=b.fa(a),b=b.C;return a},nb={},qb=b=>{b=ob(b);var a=U(b);pb(b);return a},rb=(b,a)=>{var c=nb[b];if(void 0===c)throw b=`${a} has unknown type ${qb(b)}`,new O(b);return c},vb=()=>{},wb=!1,xb=b=>{if(!globalThis.FinalizationRegistry)return xb=a=>a,b;wb=new FinalizationRegistry(a=>{a=a.g;--a.count.value;0===a.count.value&&(a.D?a.K.P(a.D):
|
|
566
741
|
a.o.h.P(a.l))});xb=a=>{var c=a.g;c.D&&wb.register(a,{g:c},a);return a};vb=a=>{wb.unregister(a)};return xb(b)},yb={},zb=b=>{for(;b.length;){var a=b.pop();b.pop()(a)}};function Ab(b){return this.j(N[b>>2])}
|
|
567
|
-
var Bb={},Cb={},Db=class extends Error{constructor(b){super(b);this.name="InternalError"}},W=(b,a,c)=>{function d(g){g=c(g);if(g.length!==b.length)throw new Db("Mismatched type converter count");for(var n=0;n<b.length;++n)V(b[n],g[n])}b.forEach(g=>Cb[g]=a);var f=Array(a.length),
|
|
742
|
+
var Bb={},Cb={},Db=class extends Error{constructor(b){super(b);this.name="InternalError"}},W=(b,a,c)=>{function d(g){g=c(g);if(g.length!==b.length)throw new Db("Mismatched type converter count");for(var n=0;n<b.length;++n)V(b[n],g[n])}b.forEach(g=>Cb[g]=a);var f=Array(a.length),l=[],h=0;for(let [g,n]of a.entries())nb.hasOwnProperty(n)?f[g]=nb[n]:(l.push(n),Bb.hasOwnProperty(n)||(Bb[n]=[]),Bb[n].push(()=>{f[g]=nb[n];++h;h===l.length&&d(f)}));0===l.length&&d(f)};
|
|
568
743
|
function Eb(b,a,c={}){var d=a.name;if(!b)throw new O(`type "${d}" must have a positive integer typeid pointer`);if(nb.hasOwnProperty(b)){if(c.Jb)return;throw new O(`Cannot register type '${d}' twice`);}nb[b]=a;delete Cb[b];Bb.hasOwnProperty(b)&&(a=Bb[b],delete Bb[b],a.forEach(f=>f()))}function V(b,a,c={}){return Eb(b,a,c)}var Fb=b=>{throw new O(b.g.o.h.name+" instance already deleted");},Gb=[];function Hb(){}
|
|
569
|
-
var Ib={},Jb=(b,a,c)=>{if(void 0===b[a].u){var d=b[a];b[a]=function(...f){if(!b[a].u.hasOwnProperty(f.length))throw new O(`Function '${c}' called with an invalid number of arguments (${f.length}) - expects one of (${b[a].u})!`);return b[a].u[f.length].apply(this,f)};b[a].u=[];b[a].u[d.R]=d}},Kb=(b,a,c)=>{if(
|
|
570
|
-
|
|
744
|
+
var Ib={},Jb=(b,a,c)=>{if(void 0===b[a].u){var d=b[a];b[a]=function(...f){if(!b[a].u.hasOwnProperty(f.length))throw new O(`Function '${c}' called with an invalid number of arguments (${f.length}) - expects one of (${b[a].u})!`);return b[a].u[f.length].apply(this,f)};b[a].u=[];b[a].u[d.R]=d}},Kb=(b,a,c)=>{if(m.hasOwnProperty(b)){if(void 0===c||void 0!==m[b].u&&void 0!==m[b].u[c])throw new O(`Cannot register public name '${b}' twice`);Jb(m,b,b);if(m[b].u.hasOwnProperty(c))throw new O(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
|
|
745
|
+
m[b].u[c]=a}else m[b]=a,m[b].R=c},Lb=b=>{b=b.replace(/[^a-zA-Z0-9_]/g,"$");var a=b.charCodeAt(0);return 48<=a&&57>=a?`_${b}`:b};function Mb(b,a,c,d,f,l,h,g){this.name=b;this.constructor=a;this.O=c;this.P=d;this.C=f;this.Eb=l;this.fa=h;this.zb=g;this.bb=[]}
|
|
571
746
|
var Nb=(b,a,c)=>{for(;a!==c;){if(!a.fa)throw new O(`Expected null or instance of ${c.name}, got an instance of ${a.name}`);b=a.fa(b);a=a.C}return b},Ob=b=>{if(null===b)return"null";var a=typeof b;return"object"===a||"array"===a||"function"===a?b.toString():""+b};
|
|
572
747
|
function Pb(b,a){if(null===a){if(this.Ea)throw new O(`null is not a valid ${this.name}`);return 0}if(!a.g)throw new O(`Cannot pass "${Ob(a)}" as a ${this.name}`);if(!a.g.l)throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);return Nb(a.g.l,a.g.o.h,this.h)}
|
|
573
748
|
function Qb(b,a){if(null===a){if(this.Ea)throw new O(`null is not a valid ${this.name}`);if(this.ma){var c=this.Ia();null!==b&&b.push(this.P,c);return c}return 0}if(!a||!a.g)throw new O(`Cannot pass "${Ob(a)}" as a ${this.name}`);if(!a.g.l)throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.la&&a.g.o.la)throw new O(`Cannot convert argument of type ${a.g.K?a.g.K.name:a.g.o.name} to parameter type ${this.name}`);c=Nb(a.g.l,a.g.o.h,this.h);if(this.ma){if(void 0===a.g.D)throw new O("Passing raw pointer to smart pointer is illegal");
|
|
574
749
|
switch(this.Tb){case 0:if(a.g.K===this)c=a.g.D;else throw new O(`Cannot convert argument of type ${a.g.K?a.g.K.name:a.g.o.name} to parameter type ${this.name}`);break;case 1:c=a.g.D;break;case 2:if(a.g.K===this)c=a.g.D;else{var d=a.clone();c=this.Ob(c,jb(()=>d["delete"]()));null!==b&&b.push(this.P,c)}break;default:throw new O("Unsupported sharing policy");}}return c}
|
|
575
750
|
function Rb(b,a){if(null===a){if(this.Ea)throw new O(`null is not a valid ${this.name}`);return 0}if(!a.g)throw new O(`Cannot pass "${Ob(a)}" as a ${this.name}`);if(!a.g.l)throw new O(`Cannot pass deleted object as a pointer of type ${this.name}`);if(a.g.o.la)throw new O(`Cannot convert argument of type ${a.g.o.name} to parameter type ${this.name}`);return Nb(a.g.l,a.g.o.h,this.h)}
|
|
576
751
|
var Sb=(b,a,c)=>{if(a===c)return b;if(void 0===c.C)return null;b=Sb(b,a,c.C);return null===b?null:c.zb(b)},Tb=(b,a)=>{a=mb(b,a);return lb[a]},Ub=(b,a)=>{if(!a.o||!a.l)throw new Db("makeClassHandle requires ptr and ptrType");if(!!a.K!==!!a.D)throw new Db("Both smartPtrType and smartPtr must be specified");a.count={value:1};return xb(Object.create(b,{g:{value:a,writable:!0}}))};
|
|
577
|
-
function Vb(b,a,c,d,f,
|
|
578
|
-
var Wb=(b,a,c)=>{if(!
|
|
579
|
-
var ic=(b,a)=>{function c(
|
|
580
|
-
function kc(b,a,c,d,f){var
|
|
752
|
+
function Vb(b,a,c,d,f,l,h,g,n,r,A){this.name=b;this.h=a;this.Ea=c;this.la=d;this.ma=f;this.Nb=l;this.Tb=h;this.cb=g;this.Ia=n;this.Ob=r;this.P=A;f||void 0!==a.C?this.v=Qb:(this.v=d?Pb:Rb,this.H=null)}
|
|
753
|
+
var Wb=(b,a,c)=>{if(!m.hasOwnProperty(b))throw new Db("Replacing nonexistent public symbol");void 0!==m[b].u&&void 0!==c?m[b].u[c]=a:(m[b]=a,m[b].R=c)},Xb={},Zb=(b,a,c=[])=>{b.includes("j")?(b=b.replace(/p/g,"i"),a=(0,Xb[b])(a,...c)):a=Yb.get(a)(...c);return a},$b=(b,a)=>(...c)=>Zb(b,a,c),X=(b,a)=>{b=U(b);var c=b.includes("j")?$b(b,a):Yb.get(a);if("function"!=typeof c)throw new O(`unknown function pointer with signature ${b}: ${a}`);return c};class ac extends Error{}
|
|
754
|
+
var ic=(b,a)=>{function c(l){f[l]||nb[l]||(Cb[l]?Cb[l].forEach(c):(d.push(l),f[l]=!0))}var d=[],f={};a.forEach(c);throw new ac(`${b}: `+d.map(qb).join([", "]));};function jc(b){for(var a=1;a<b.length;++a)if(null!==b[a]&&void 0===b[a].H)return!0;return!1}
|
|
755
|
+
function kc(b,a,c,d,f){var l=a.length;if(2>l)throw new O("argTypes array size mismatch! Must at least get return value and 'this' types!");var h=null!==a[1]&&null!==c,g=jc(a),n=!a[0].Kb,r=l-2,A=Array(r),q=[],v=[];return gb(b,function(...p){v.length=0;q.length=h?2:1;q[0]=f;if(h){var y=a[1].v(v,this);q[1]=y}for(var C=0;C<r;++C)A[C]=a[C+2].v(v,p[C]),q.push(A[C]);p=d(...q);if(g)zb(v);else for(C=h?1:2;C<a.length;C++){var G=1===C?y:A[C-2];null!==a[C].H&&a[C].H(G)}y=n?a[0].j(p):void 0;return y})}
|
|
581
756
|
var lc=(b,a)=>{for(var c=[],d=0;d<b;d++)c.push(N[a+4*d>>2]);return c},mc=b=>{b=b.trim();const a=b.indexOf("(");return-1===a?b:b.slice(0,a)},nc=(b,a,c)=>{if(!(b instanceof Object))throw new O(`${c} with invalid "this": ${b}`);if(!(b instanceof a.h.constructor))throw new O(`${c} incompatible with "this" of type ${b.constructor.name}`);if(!b.g.l)throw new O(`cannot call emscripten binding method ${c} on deleted object`);return Nb(b.g.l,b.g.o.h,a.h)},oc=b=>{9<b&&0===--ib[b+1]&&(ib[b]=void 0,hb.push(b))},
|
|
582
757
|
pc={name:"emscripten::val",j:b=>{var a=Q(b);oc(b);return a},v:(b,a)=>jb(a),J:Ab,H:null},qc=(b,a,c)=>{switch(a){case 1:return c?function(d){return this.j(La[d])}:function(d){return this.j(M[d])};case 2:return c?function(d){return this.j(Ma[d>>1])}:function(d){return this.j(Na[d>>1])};case 4:return c?function(d){return this.j(Oa[d>>2])}:function(d){return this.j(N[d>>2])};default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},rc=(b,a)=>{switch(a){case 4:return function(c){return this.j(Pa[c>>
|
|
583
758
|
2])};case 8:return function(c){return this.j(Qa[c>>3])};default:throw new TypeError(`invalid float width (${a}): ${b}`);}},sc=(b,a,c)=>{switch(a){case 1:return c?d=>La[d]:d=>M[d];case 2:return c?d=>Ma[d>>1]:d=>Na[d>>1];case 4:return c?d=>Oa[d>>2]:d=>N[d>>2];default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},tc=globalThis.TextDecoder&&new TextDecoder,uc=(b,a,c,d)=>{c=a+c;if(d)return c;for(;b[a]&&!(a>=c);)++a;return a},vc=(b,a=0,c,d)=>{c=uc(b,a,c,d);if(16<c-a&&b.buffer&&tc)return tc.decode(b.subarray(a,
|
|
584
|
-
c));for(d="";a<c;){var f=b[a++];if(f&128){var
|
|
585
|
-
return c},yc=(b,a,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=a;c=c<2*b.length?c/2:b.length;for(var f=0;f<c;++f)Ma[a>>1]=b.charCodeAt(f),a+=2;Ma[a>>1]=0;return a-d},zc=b=>2*b.length,Ac=(b,a,c)=>{var d="";b>>=2;for(var f=0;!(f>=a/4);f++){var
|
|
759
|
+
c));for(d="";a<c;){var f=b[a++];if(f&128){var l=b[a++]&63;if(192==(f&224))d+=String.fromCharCode((f&31)<<6|l);else{var h=b[a++]&63;f=224==(f&240)?(f&15)<<12|l<<6|h:(f&7)<<18|l<<12|h<<6|b[a++]&63;65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else d+=String.fromCharCode(f)}return d},wc=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,xc=(b,a,c)=>{b>>=1;a=uc(Na,b,a/2,c);if(16<a-b&&wc)return wc.decode(Na.subarray(b,a));for(c="";b<a;++b)c+=String.fromCharCode(Na[b]);
|
|
760
|
+
return c},yc=(b,a,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=a;c=c<2*b.length?c/2:b.length;for(var f=0;f<c;++f)Ma[a>>1]=b.charCodeAt(f),a+=2;Ma[a>>1]=0;return a-d},zc=b=>2*b.length,Ac=(b,a,c)=>{var d="";b>>=2;for(var f=0;!(f>=a/4);f++){var l=N[b+f];if(!l&&!c)break;d+=String.fromCodePoint(l)}return d},Bc=(b,a,c)=>{c??=2147483647;if(4>c)return 0;var d=a;c=d+c-4;for(var f=0;f<b.length;++f){var l=b.codePointAt(f);65535<l&&f++;Oa[a>>2]=l;a+=4;if(a+4>c)break}Oa[a>>2]=0;return a-d},Cc=b=>{for(var a=
|
|
586
761
|
0,c=0;c<b.length;++c)65535<b.codePointAt(c)&&c++,a+=4;return a},Dc=[],Ec=b=>{var a=Dc.length;Dc.push(b);return a},Fc=(b,a)=>{for(var c=Array(b),d=0;d<b;++d)c[d]=rb(N[a+4*d>>2],`parameter ${d}`);return c},Gc={},Hc=b=>{var a=Gc[b];return void 0===a?U(b):a},Ic=[null,[],[]];
|
|
587
|
-
(()=>{let b=Hb.prototype;Object.assign(b,{isAliasOf:function(c){if(!(this instanceof Hb&&c instanceof Hb))return!1;var d=this.g.o.h,f=this.g.l;c.g=c.g;var
|
|
762
|
+
(()=>{let b=Hb.prototype;Object.assign(b,{isAliasOf:function(c){if(!(this instanceof Hb&&c instanceof Hb))return!1;var d=this.g.o.h,f=this.g.l;c.g=c.g;var l=c.g.o.h;for(c=c.g.l;d.C;)f=d.fa(f),d=d.C;for(;l.C;)c=l.fa(c),l=l.C;return d===l&&f===c},clone:function(){this.g.l||Fb(this);if(this.g.aa)return this.g.count.value+=1,this;var c=xb,d=Object,f=d.create,l=Object.getPrototypeOf(this),h=this.g;c=c(f.call(d,l,{g:{value:{count:h.count,da:h.da,aa:h.aa,l:h.l,o:h.o,D:h.D,K:h.K}}}));c.g.count.value+=1;c.g.da=
|
|
588
763
|
!1;return c},["delete"](){this.g.l||Fb(this);if(this.g.da&&!this.g.aa)throw new O("Object already scheduled for deletion");vb(this);var c=this.g;--c.count.value;0===c.count.value&&(c.D?c.K.P(c.D):c.o.h.P(c.l));this.g.aa||(this.g.D=void 0,this.g.l=void 0)},isDeleted:function(){return!this.g.l},deleteLater:function(){this.g.l||Fb(this);if(this.g.da&&!this.g.aa)throw new O("Object already scheduled for deletion");Gb.push(this);this.g.da=!0;return this}});const a=Symbol.dispose;a&&(b[a]=b["delete"])})();
|
|
589
|
-
Object.assign(Vb.prototype,{Fb(b){this.
|
|
590
|
-
Ub(d.h.O,{o:d,l:f,K:this,D:b}):Ub(d.h.O,{o:d,l:f})}});
|
|
591
|
-
var pb,Jc,ob,Ta,Yb,Kc={_abort_js:()=>Ua(""),_embind_create_inheriting_constructor:(b,a,c)=>{b=U(b);a=rb(a,"wrapper");c=Q(c);var d=a.h,f=d.O,
|
|
764
|
+
Object.assign(Vb.prototype,{Fb(b){this.cb&&(b=this.cb(b));return b},Sa(b){this.P?.(b)},J:Ab,j:function(b){function a(){return this.ma?Ub(this.h.O,{o:this.Nb,l:c,K:this,D:b}):Ub(this.h.O,{o:this,l:b})}var c=this.Fb(b);if(!c)return this.Sa(b),null;var d=Tb(this.h,c);if(void 0!==d){if(0===d.g.count.value)return d.g.l=c,d.g.D=b,d.clone();d=d.clone();this.Sa(b);return d}d=this.h.Eb(c);d=Ib[d];if(!d)return a.call(this);d=this.la?d.ub:d.pointerType;var f=Sb(c,this.h,d.h);return null===f?a.call(this):this.ma?
|
|
765
|
+
Ub(d.h.O,{o:d,l:f,K:this,D:b}):Ub(d.h.O,{o:d,l:f})}});m.print&&(Da=m.print);m.printErr&&(Fa=m.printErr);m.wasmBinary&&(Ha=m.wasmBinary);if(m.preInit)for("function"==typeof m.preInit&&(m.preInit=[m.preInit]);0<m.preInit.length;)m.preInit.shift()();
|
|
766
|
+
var pb,Jc,ob,Ta,Yb,Kc={_abort_js:()=>Ua(""),_embind_create_inheriting_constructor:(b,a,c)=>{b=U(b);a=rb(a,"wrapper");c=Q(c);var d=a.h,f=d.O,l=d.C.O,h=d.C.constructor;b=gb(b,function(...g){for(var n of d.C.bb)if(this[n]===l[n])throw new kb(`Pure virtual function ${n} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:f});this.__construct(...g)});f.__construct=function(...g){if(this===f)throw new O("Pass correct 'this' to __construct");g=h.implement(this,...g);vb(g);var n=
|
|
592
767
|
g.g;g.notifyOnDestruction();n.aa=!0;Object.defineProperties(this,{g:{value:n}});xb(this);g=n.l;g=mb(d,g);if(lb.hasOwnProperty(g))throw new O(`Tried to register registered instance: ${g}`);lb[g]=this};f.__destruct=function(){if(this===f)throw new O("Pass correct 'this' to __destruct");vb(this);var g=this.g.l;g=mb(d,g);if(lb.hasOwnProperty(g))delete lb[g];else throw new O(`Tried to unregister unregistered instance: ${g}`);};b.prototype=Object.create(f);Object.assign(b.prototype,c);return jb(b)},_embind_finalize_value_object:b=>
|
|
593
|
-
{var a=yb[b];delete yb[b];var c=a.Ia,d=a.P,f=a.
|
|
594
|
-
q[
|
|
595
|
-
function(...R){if(Object.getPrototypeOf(this)!==E)throw new O(`Use 'new' to construct ${A}`);if(void 0===H.U)throw new O(`${A} has no accessible constructor`);var I=H.U[R.length];if(void 0===I)throw new O(`Tried to invoke ctor of ${A} with invalid number of parameters (${R.length}) - expected (${Object.keys(H.U).toString()}) parameters instead!`);return I.apply(this,R)});var E=Object.create(G,{constructor:{value:
|
|
596
|
-
H.C.ga.push(H)}C=new Vb(A,H,!0,!1,!1);L=new Vb(A+"*",H,!1,!1,!1);G=new Vb(A+" const*",H,!1,!0,!1);Ib[b]={pointerType:L,ub:G};Wb(p,
|
|
597
|
-
null,
|
|
598
|
-
a,A);W([],[c],q=>{q=q[0];var
|
|
599
|
-
g.h.U[a-1]=()=>{ic(`Cannot construct ${g.name} due to unbound types`,h)};W([],h,r=>{r.splice(1,0,null);g.h.U[a-1]=kc(n,r,null,f,
|
|
600
|
-
r.name,
|
|
601
|
-
h]:[c],p=>{var
|
|
602
|
-
v:(g,n)=>n.value,J:qc(a,c,d),H:null});Kb(a,h);break;case "number":var
|
|
603
|
-
constructor:{value:gb(`${d.name}_${a}`,function(){})}});b.values[c]=d;b[a]=d;break;case "number":d.Fa[a]=c;break;case "string":d.ib[a]=c,d.
|
|
604
|
-
a,c,d,f)=>{a=U(a);let
|
|
605
|
-
(d=new Uint8Array(d));var f,
|
|
606
|
-
r&63}else if(65535>=r){if(
|
|
607
|
-
var n=
|
|
608
|
-
a=`methodCaller<(${f.map(n=>n.name)}) => ${d.name}>`;return Ec(gb(a,(n,r,A,q)=>{for(var
|
|
768
|
+
{var a=yb[b];delete yb[b];var c=a.Ia,d=a.P,f=a.Va,l=f.map(h=>h.Ib).concat(f.map(h=>h.Rb));W([b],l,h=>{var g={},n,r;for([n,r]of f.entries()){const A=h[n],q=r.Gb,v=r.Hb,p=h[n+f.length],y=r.Qb,C=r.Sb;g[r.Cb]={read:G=>A.j(q(v,G)),write:(G,E)=>{var H=[];y(C,G,p.v(H,E));zb(H)},optional:A.optional}}return[{name:a.name,j:A=>{var q={},v;for(v in g)q[v]=g[v].read(A);d(A);return q},v:(A,q)=>{for(var v in g)if(!(v in q||g[v].optional))throw new TypeError(`Missing field: "${v}"`);var p=c();for(v in g)g[v].write(p,
|
|
769
|
+
q[v]);null!==A&&A.push(d,p);return p},J:Ab,H:d}]})},_embind_register_bigint:()=>{},_embind_register_bool:(b,a,c,d)=>{a=U(a);V(b,{name:a,j:function(f){return!!f},v:function(f,l){return l?c:d},J:function(f){return this.j(M[f])},H:null})},_embind_register_class:(b,a,c,d,f,l,h,g,n,r,A,q,v)=>{A=U(A);l=X(f,l);g&&=X(h,g);r&&=X(n,r);v=X(q,v);var p=Lb(A);Kb(p,function(){ic(`Cannot construct ${A} due to unbound types`,[d])});W([b,a,c],d?[d]:[],y=>{y=y[0];if(d){var C=y.h;var G=C.O}else G=Hb.prototype;y=gb(A,
|
|
770
|
+
function(...R){if(Object.getPrototypeOf(this)!==E)throw new O(`Use 'new' to construct ${A}`);if(void 0===H.U)throw new O(`${A} has no accessible constructor`);var I=H.U[R.length];if(void 0===I)throw new O(`Tried to invoke ctor of ${A} with invalid number of parameters (${R.length}) - expected (${Object.keys(H.U).toString()}) parameters instead!`);return I.apply(this,R)});var E=Object.create(G,{constructor:{value:y}});y.prototype=E;var H=new Mb(A,y,E,v,C,l,g,r);if(H.C){var L;(L=H.C).ga??(L.ga=[]);
|
|
771
|
+
H.C.ga.push(H)}C=new Vb(A,H,!0,!1,!1);L=new Vb(A+"*",H,!1,!1,!1);G=new Vb(A+" const*",H,!1,!0,!1);Ib[b]={pointerType:L,ub:G};Wb(p,y);return[C,L,G]})},_embind_register_class_class_function:(b,a,c,d,f,l,h)=>{var g=lc(c,d);a=U(a);a=mc(a);l=X(f,l);W([],[b],n=>{function r(){ic(`Cannot call ${A} due to unbound types`,g)}n=n[0];var A=`${n.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);var q=n.h.constructor;void 0===q[a]?(r.R=c-1,q[a]=r):(Jb(q,a,A),q[a].u[c-1]=r);W([],g,v=>{v=kc(A,[v[0],null].concat(v.slice(1)),
|
|
772
|
+
null,l,h);void 0===q[a].u?(v.R=c-1,q[a]=v):q[a].u[c-1]=v;if(n.h.ga)for(const p of n.h.ga)p.constructor.hasOwnProperty(a)||(p.constructor[a]=v);return[]});return[]})},_embind_register_class_class_property:(b,a,c,d,f,l,h,g)=>{a=U(a);l=X(f,l);W([],[b],n=>{n=n[0];var r=`${n.name}.${a}`,A={get(){ic(`Cannot access ${r} due to unbound types`,[c])},enumerable:!0,configurable:!0};A.set=g?()=>{ic(`Cannot access ${r} due to unbound types`,[c])}:()=>{throw new O(`${r} is a read-only property`);};Object.defineProperty(n.h.constructor,
|
|
773
|
+
a,A);W([],[c],q=>{q=q[0];var v={get(){return q.j(l(d))},enumerable:!0};g&&(g=X(h,g),v.set=p=>{var y=[];g(d,q.v(y,p));zb(y)});Object.defineProperty(n.h.constructor,a,v);return[]});return[]})},_embind_register_class_constructor:(b,a,c,d,f,l)=>{var h=lc(a,c);f=X(d,f);W([],[b],g=>{g=g[0];var n=`constructor ${g.name}`;void 0===g.h.U&&(g.h.U=[]);if(void 0!==g.h.U[a-1])throw new O(`Cannot register multiple constructors with identical number of parameters (${a-1}) for class '${g.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
774
|
+
g.h.U[a-1]=()=>{ic(`Cannot construct ${g.name} due to unbound types`,h)};W([],h,r=>{r.splice(1,0,null);g.h.U[a-1]=kc(n,r,null,f,l);return[]});return[]})},_embind_register_class_function:(b,a,c,d,f,l,h,g)=>{var n=lc(c,d);a=U(a);a=mc(a);l=X(f,l);W([],[b],r=>{function A(){ic(`Cannot call ${q} due to unbound types`,n)}r=r[0];var q=`${r.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);g&&r.h.bb.push(a);var v=r.h.O,p=v[a];void 0===p||void 0===p.u&&p.className!==r.name&&p.R===c-2?(A.R=c-2,A.className=
|
|
775
|
+
r.name,v[a]=A):(Jb(v,a,q),v[a].u[c-2]=A);W([],n,y=>{y=kc(q,y,r,l,h);void 0===v[a].u?(y.R=c-2,v[a]=y):v[a].u[c-2]=y;return[]});return[]})},_embind_register_class_property:(b,a,c,d,f,l,h,g,n,r)=>{a=U(a);f=X(d,f);W([],[b],A=>{A=A[0];var q=`${A.name}.${a}`,v={get(){ic(`Cannot access ${q} due to unbound types`,[c,h])},enumerable:!0,configurable:!0};v.set=n?()=>ic(`Cannot access ${q} due to unbound types`,[c,h]):()=>{throw new O(q+" is a read-only property");};Object.defineProperty(A.h.O,a,v);W([],n?[c,
|
|
776
|
+
h]:[c],p=>{var y=p[0],C={get(){var E=nc(this,A,q+" getter");return y.j(f(l,E))},enumerable:!0};if(n){n=X(g,n);var G=p[1];C.set=function(E){var H=nc(this,A,q+" setter"),L=[];n(r,H,G.v(L,E));zb(L)}}Object.defineProperty(A.h.O,a,C);return[]});return[]})},_embind_register_emval:b=>V(b,pc),_embind_register_enum:(b,a,c,d,f)=>{a=U(a);f=0===f?"object":1===f?"number":"string";switch(f){case "object":function h(){}h.values={};V(b,{name:a,constructor:h,valueType:f,j:function(g){return this.constructor.values[g]},
|
|
777
|
+
v:(g,n)=>n.value,J:qc(a,c,d),H:null});Kb(a,h);break;case "number":var l={};V(b,{name:a,Fa:l,valueType:f,j:g=>g,v:(g,n)=>n,J:qc(a,c,d),H:null});Kb(a,l);delete m[a].R;break;case "string":l={},V(b,{name:a,ib:{},eb:{},Fa:l,valueType:f,j:function(g){return this.eb[g]},v:function(g,n){return this.ib[n]},J:qc(a,c,d),H:null}),Kb(a,l),delete m[a].R}},_embind_register_enum_value:(b,a,c)=>{var d=rb(b,"enum");a=U(a);switch(d.valueType){case "object":b=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},
|
|
778
|
+
constructor:{value:gb(`${d.name}_${a}`,function(){})}});b.values[c]=d;b[a]=d;break;case "number":d.Fa[a]=c;break;case "string":d.ib[a]=c,d.eb[c]=a,d.Fa[a]=a}},_embind_register_float:(b,a,c)=>{a=U(a);V(b,{name:a,j:d=>d,v:(d,f)=>f,J:rc(a,c),H:null})},_embind_register_function:(b,a,c,d,f,l)=>{var h=lc(a,c);b=U(b);b=mc(b);f=X(d,f);Kb(b,function(){ic(`Cannot call ${b} due to unbound types`,h)},a-1);W([],h,g=>{Wb(b,kc(b,[g[0],null].concat(g.slice(1)),null,f,l),a-1);return[]})},_embind_register_integer:(b,
|
|
779
|
+
a,c,d,f)=>{a=U(a);let l=g=>g;if(0===d){var h=32-8*c;l=g=>g<<h>>>h;f=l(f)}V(b,{name:a,j:l,v:(g,n)=>n,J:sc(a,c,0!==d),H:null})},_embind_register_memory_view:(b,a,c)=>{function d(l){return new f(La.buffer,N[l+4>>2],N[l>>2])}var f=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][a];c=U(c);V(b,{name:c,j:d,J:d},{Jb:!0})},_embind_register_std_string:(b,a)=>{a=U(a);V(b,{name:a,j(c){var d=(d=c+4)?vc(M,d,N[c>>2],!0):"";pb(c);return d},v(c,d){d instanceof ArrayBuffer&&
|
|
780
|
+
(d=new Uint8Array(d));var f,l="string"==typeof d;if(!(l||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new O("Cannot pass non-string to std::string");var h;if(l)for(f=h=0;f<d.length;++f){var g=d.charCodeAt(f);127>=g?h++:2047>=g?h+=2:55296<=g&&57343>=g?(h+=4,++f):h+=3}else h=d.length;f=h;h=Jc(4+f+1);g=h+4;N[h>>2]=f;if(l){if(l=g,g=f+1,f=M,0<g){g=l+g-1;for(var n=0;n<d.length;++n){var r=d.codePointAt(n);if(127>=r){if(l>=g)break;f[l++]=r}else if(2047>=r){if(l+1>=g)break;f[l++]=192|r>>6;f[l++]=128|
|
|
781
|
+
r&63}else if(65535>=r){if(l+2>=g)break;f[l++]=224|r>>12;f[l++]=128|r>>6&63;f[l++]=128|r&63}else{if(l+3>=g)break;f[l++]=240|r>>18;f[l++]=128|r>>12&63;f[l++]=128|r>>6&63;f[l++]=128|r&63;n++}}f[l]=0}}else M.set(d,g);null!==c&&c.push(pb,h);return h},J:Ab,H(c){pb(c)}})},_embind_register_std_wstring:(b,a,c)=>{c=U(c);if(2===a){var d=xc;var f=yc;var l=zc}else d=Ac,f=Bc,l=Cc;V(b,{name:c,j:h=>{var g=d(h+4,N[h>>2]*a,!0);pb(h);return g},v:(h,g)=>{if("string"!=typeof g)throw new O(`Cannot pass non-string to C++ string type ${c}`);
|
|
782
|
+
var n=l(g),r=Jc(4+n+a);N[r>>2]=n/a;f(g,r+4,n+a);null!==h&&h.push(pb,r);return r},J:Ab,H(h){pb(h)}})},_embind_register_value_object:(b,a,c,d,f,l)=>{yb[b]={name:U(a),Ia:X(c,d),P:X(f,l),Va:[]}},_embind_register_value_object_field:(b,a,c,d,f,l,h,g,n,r)=>{yb[b].Va.push({Cb:U(a),Ib:c,Gb:X(d,f),Hb:l,Rb:h,Qb:X(g,n),Sb:r})},_embind_register_void:(b,a)=>{a=U(a);V(b,{Kb:!0,name:a,j:()=>{},v:()=>{}})},_emval_create_invoker:(b,a,c)=>{var [d,...f]=Fc(b,a),l=d.v.bind(d),h=f.map(n=>n.J.bind(n));b--;var g=Array(b);
|
|
783
|
+
a=`methodCaller<(${f.map(n=>n.name)}) => ${d.name}>`;return Ec(gb(a,(n,r,A,q)=>{for(var v=0,p=0;p<b;++p)g[p]=h[p](q+v),v+=8;switch(c){case 0:var y=Q(n).apply(null,g);break;case 2:y=Reflect.construct(Q(n),g);break;case 3:y=g[0];break;case 1:y=Q(n)[Hc(r)](...g)}n=[];y=l(n,y);n.length&&(N[A>>2]=jb(n));return y}))},_emval_decref:oc,_emval_get_module_property:b=>{b=Hc(b);return jb(m[b])},_emval_get_property:(b,a)=>{b=Q(b);a=Q(a);return jb(b[a])},_emval_incref:b=>{9<b&&(ib[b+1]+=1)},_emval_invoke:(b,a,
|
|
609
784
|
c,d,f)=>Dc[b](a,c,d,f),_emval_new_array:()=>jb([]),_emval_new_cstring:b=>jb(Hc(b)),_emval_new_object:()=>jb({}),_emval_run_destructors:b=>{var a=Q(b);zb(a);oc(b)},_emval_set_property:(b,a,c)=>{b=Q(b);a=Q(a);c=Q(c);b[a]=c},clock_time_get:function(b,a,c,d){if(!(0<=b&&3>=b))return 28;b=Math.round(1E6*(0===b?Date.now():performance.now()));bb=[b>>>0,(ab=b,1<=+Math.abs(ab)?0<ab?+Math.floor(ab/4294967296)>>>0:~~+Math.ceil((ab-+(~~ab>>>0))/4294967296)>>>0:0)];Oa[d>>2]=bb[0];Oa[d+4>>2]=bb[1];return 0},emscripten_resize_heap:b=>
|
|
610
|
-
{var a=M.length;b>>>=0;if(2147483648<b)return!1;for(var c=1;4>=c;c*=2){var d=a*(1+.2/c);d=Math.min(d,b+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(b,d)/65536))-Ta.buffer.byteLength+65535)/65536|0;try{Ta.grow(d);Sa();var f=1;break a}catch(
|
|
785
|
+
{var a=M.length;b>>>=0;if(2147483648<b)return!1;for(var c=1;4>=c;c*=2){var d=a*(1+.2/c);d=Math.min(d,b+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(b,d)/65536))-Ta.buffer.byteLength+65535)/65536|0;try{Ta.grow(d);Sa();var f=1;break a}catch(l){}f=void 0}if(f)return!0}return!1},fd_close:()=>52,fd_seek:function(){return 70},fd_write:(b,a,c,d)=>{for(var f=0,l=0;l<c;l++){var h=N[a>>2],g=N[a+4>>2];a+=8;for(var n=0;n<g;n++){var r=b,A=M[h+n],q=Ic[r];0===A||10===A?((1===r?Da:Fa)(vc(q)),q.length=
|
|
611
786
|
0):q.push(A)}f+=g}N[d>>2]=f;return 0}},Lc;
|
|
612
|
-
Lc=await (async function(){function b(c){c=Lc=c.exports;pb=c.free;Jc=c.malloc;ob=c.__getTypeName;Xb.vij=c.dynCall_vij;Xb.iij=c.dynCall_iij;Xb.ji=c.dynCall_ji;Xb.jiji=c.dynCall_jiji;Ta=c.memory;Yb=c.__indirect_function_table;Sa();return Lc}var a={env:Kc,wasi_snapshot_preview1:Kc};if(
|
|
613
|
-
(function(){function b(){
|
|
787
|
+
Lc=await (async function(){function b(c){c=Lc=c.exports;pb=c.free;Jc=c.malloc;ob=c.__getTypeName;Xb.vij=c.dynCall_vij;Xb.iij=c.dynCall_iij;Xb.ji=c.dynCall_ji;Xb.jiji=c.dynCall_jiji;Ta=c.memory;Yb=c.__indirect_function_table;Sa();return Lc}var a={env:Kc,wasi_snapshot_preview1:Kc};if(m.instantiateWasm)return new Promise(c=>{m.instantiateWasm(a,(d,f)=>{c(b(d,f))})});Xa??=m.locateFile?m.locateFile("canvas_advanced_c2d_only.wasm",za):za+"canvas_advanced_c2d_only.wasm";return b((await $a(a)).instance)}());
|
|
788
|
+
(function(){function b(){m.calledRun=!0;if(!Ia){Ra=!0;Lc.__wasm_call_ctors();Ja?.(m);m.onRuntimeInitialized?.();if(m.postRun)for("function"==typeof m.postRun&&(m.postRun=[m.postRun]);m.postRun.length;){var a=m.postRun.shift();db.push(a)}cb(db)}}if(m.preRun)for("function"==typeof m.preRun&&(m.preRun=[m.preRun]);m.preRun.length;)fb();cb(eb);m.setStatus?(m.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>m.setStatus(""),1);b()},1)):b()})();Ra?moduleRtn=m:moduleRtn=new Promise((b,a)=>{Ja=b;Ka=a});
|
|
614
789
|
;return moduleRtn}})();
|
|
615
790
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
|
|
616
791
|
|
|
@@ -626,7 +801,7 @@ Lc=await (async function(){function b(c){c=Lc=c.exports;pb=c.free;Jc=c.malloc;ob
|
|
|
626
801
|
/***/ ((module) => {
|
|
627
802
|
|
|
628
803
|
"use strict";
|
|
629
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.
|
|
804
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.51.0","description":"Rive web runtime, lite version, canvas renderer. Rive is an agent-native 2D and 3D engine for games, apps, and interactive UI.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation","interactive","ui","game-engine","graphics"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
630
805
|
|
|
631
806
|
/***/ }),
|
|
632
807
|
/* 7 */
|
|
@@ -2786,12 +2961,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2786
2961
|
/* harmony export */ sanitizeUrl: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_3__.sanitizeUrl)
|
|
2787
2962
|
/* harmony export */ });
|
|
2788
2963
|
/* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
|
|
2789
|
-
/* harmony import */ var _registerKeyboardInteractions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2790
|
-
/* harmony import */ var _gamepadInteractions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
2791
|
-
/* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
2792
|
-
/* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
2793
|
-
/* harmony import */ var _riveFont__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
2794
|
-
/* harmony import */ var _replayPacer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
2964
|
+
/* harmony import */ var _registerKeyboardInteractions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
|
2965
|
+
/* harmony import */ var _gamepadInteractions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19);
|
|
2966
|
+
/* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21);
|
|
2967
|
+
/* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22);
|
|
2968
|
+
/* harmony import */ var _riveFont__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23);
|
|
2969
|
+
/* harmony import */ var _replayPacer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24);
|
|
2795
2970
|
|
|
2796
2971
|
|
|
2797
2972
|
|
|
@@ -2810,12 +2985,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2810
2985
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2811
2986
|
/* harmony export */ registerTouchInteractions: () => (/* binding */ registerTouchInteractions)
|
|
2812
2987
|
/* harmony export */ });
|
|
2988
|
+
/* harmony import */ var _wheelMomentum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
|
|
2813
2989
|
var _this = undefined;
|
|
2990
|
+
|
|
2814
2991
|
// A detented wheel reports lines; the runtime wants pixels.
|
|
2815
2992
|
var PIXELS_PER_LINE = 16;
|
|
2816
|
-
// ScrollPhase.update. The DOM reports no gesture
|
|
2817
|
-
//
|
|
2993
|
+
// ScrollPhase.update and ScrollPhase.momentum. The DOM reports no gesture
|
|
2994
|
+
// phase, so the runtime closes the gesture once it goes quiet.
|
|
2818
2995
|
var SCROLL_PHASE_UPDATE = 1;
|
|
2996
|
+
var SCROLL_PHASE_MOMENTUM = 3;
|
|
2819
2997
|
/**
|
|
2820
2998
|
* Touch state per canvas. It outlives a single registration, because Rive
|
|
2821
2999
|
* re-registers the listeners (on play and pause) while a finger can still be
|
|
@@ -3230,11 +3408,13 @@ var registerTouchInteractions = function (_a) {
|
|
|
3230
3408
|
* the wheel unless a scroll view actually moves, so it still scrolls when
|
|
3231
3409
|
* Rive has nothing to scroll or a view sits at its edge.
|
|
3232
3410
|
*/
|
|
3411
|
+
var wheelMomentum = new _wheelMomentum__WEBPACK_IMPORTED_MODULE_0__.WheelMomentumDetector();
|
|
3233
3412
|
var wheelCallback = function (event) {
|
|
3234
3413
|
// Pinch zoom arrives as a ctrl+wheel and belongs to the page. A wheel that
|
|
3235
3414
|
// can't be cancelled is part of a sequence the page is already scrolling;
|
|
3236
3415
|
// taking it too would move both.
|
|
3237
3416
|
if (event.ctrlKey || !event.cancelable) {
|
|
3417
|
+
wheelMomentum.reset();
|
|
3238
3418
|
return;
|
|
3239
3419
|
}
|
|
3240
3420
|
// Read before the deltas: Firefox reports pixels once a delta has been
|
|
@@ -3277,11 +3457,19 @@ var registerTouchInteractions = function (_a) {
|
|
|
3277
3457
|
// counts as precise either way, as it does in the browser's own scrolling.
|
|
3278
3458
|
var precise = deltaMode === WheelEvent.DOM_DELTA_PIXEL;
|
|
3279
3459
|
var timeStamp = event.timeStamp / 1000;
|
|
3460
|
+
// Momentum bounces at the end of a scroll view; the fingers stretch it.
|
|
3461
|
+
var phase = SCROLL_PHASE_UPDATE;
|
|
3462
|
+
if (!precise) {
|
|
3463
|
+
wheelMomentum.reset();
|
|
3464
|
+
}
|
|
3465
|
+
else if (wheelMomentum.isMomentum(event, deltaX, deltaY)) {
|
|
3466
|
+
phase = SCROLL_PHASE_MOMENTUM;
|
|
3467
|
+
}
|
|
3280
3468
|
// A latched state machine owns the rest of its gesture, even past its edge.
|
|
3281
3469
|
var latched = stateMachines.filter(function (sm) { return sm.hasScrollLatch(); });
|
|
3282
3470
|
var ordered = latched.concat(stateMachines.filter(function (sm) { return latched.indexOf(sm) === -1; }));
|
|
3283
3471
|
var consumed = ordered.some(function (stateMachine) {
|
|
3284
|
-
return stateMachine.pointerScroll(position.x, position.y, moved.x - position.x, moved.y - position.y,
|
|
3472
|
+
return stateMachine.pointerScroll(position.x, position.y, moved.x - position.x, moved.y - position.y, phase, precise, timeStamp, 0) !== 0;
|
|
3285
3473
|
});
|
|
3286
3474
|
if (!consumed) {
|
|
3287
3475
|
return;
|
|
@@ -3325,15 +3513,106 @@ var registerTouchInteractions = function (_a) {
|
|
|
3325
3513
|
/* 15 */
|
|
3326
3514
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3327
3515
|
|
|
3516
|
+
"use strict";
|
|
3517
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3518
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3519
|
+
/* harmony export */ WheelMomentumDetector: () => (/* binding */ WheelMomentumDetector)
|
|
3520
|
+
/* harmony export */ });
|
|
3521
|
+
// The runtime closes a scroll gesture after this long without events.
|
|
3522
|
+
var GESTURE_GAP_MS = 100;
|
|
3523
|
+
// Falls, and how far below the peak, before a stream counts as momentum.
|
|
3524
|
+
var FALLING_EVENTS = 3;
|
|
3525
|
+
var FALL_FROM_PEAK = 0.15;
|
|
3526
|
+
// Rises in a row that mean fingers. One alone is two merged events.
|
|
3527
|
+
var RISING_EVENTS = 2;
|
|
3528
|
+
// Pixel deltas arrive rounded.
|
|
3529
|
+
var JITTER = 1;
|
|
3530
|
+
// Assumed slowest share momentum loses a second; a delta held longer is fingers.
|
|
3531
|
+
var SLOWEST_DECAY = 0.6;
|
|
3532
|
+
var HOLD_MARGIN = 1.5;
|
|
3533
|
+
var SHORTEST_HOLD_MS = 50;
|
|
3534
|
+
/** Tells the platform's momentum from the fingers in pixel wheel events. */
|
|
3535
|
+
var WheelMomentumDetector = /** @class */ (function () {
|
|
3536
|
+
function WheelMomentumDetector() {
|
|
3537
|
+
this.lastTime = -Infinity;
|
|
3538
|
+
this.lastX = 0;
|
|
3539
|
+
this.lastY = 0;
|
|
3540
|
+
// The lowest delta since the last rise, and the peak it fell from.
|
|
3541
|
+
this.base = 0;
|
|
3542
|
+
this.peak = 0;
|
|
3543
|
+
this.falls = 0;
|
|
3544
|
+
this.rises = 0;
|
|
3545
|
+
this.heldSince = 0;
|
|
3546
|
+
this.momentum = false;
|
|
3547
|
+
}
|
|
3548
|
+
WheelMomentumDetector.prototype.reset = function () {
|
|
3549
|
+
this.lastTime = -Infinity;
|
|
3550
|
+
this.momentum = false;
|
|
3551
|
+
};
|
|
3552
|
+
WheelMomentumDetector.prototype.isMomentum = function (event, deltaX, deltaY) {
|
|
3553
|
+
// Browsers with WheelEvent.momentum know; the rest leave it to the deltas.
|
|
3554
|
+
if ("momentum" in event) {
|
|
3555
|
+
return event.momentum === true;
|
|
3556
|
+
}
|
|
3557
|
+
// Each axis rounds on its own, so the larger one is the size.
|
|
3558
|
+
var size = Math.max(Math.abs(deltaX), Math.abs(deltaY));
|
|
3559
|
+
var time = event.timeStamp;
|
|
3560
|
+
var newGesture = time - this.lastTime > GESTURE_GAP_MS ||
|
|
3561
|
+
deltaX * this.lastX + deltaY * this.lastY < 0;
|
|
3562
|
+
this.lastTime = time;
|
|
3563
|
+
this.lastX = deltaX;
|
|
3564
|
+
this.lastY = deltaY;
|
|
3565
|
+
if (newGesture) {
|
|
3566
|
+
this.restart(size, time);
|
|
3567
|
+
return false;
|
|
3568
|
+
}
|
|
3569
|
+
if (size > this.base + JITTER) {
|
|
3570
|
+
if (++this.rises >= RISING_EVENTS) {
|
|
3571
|
+
this.restart(size, time);
|
|
3572
|
+
}
|
|
3573
|
+
return this.momentum;
|
|
3574
|
+
}
|
|
3575
|
+
this.rises = 0;
|
|
3576
|
+
var longestHold = (HOLD_MARGIN * 1000) / (SLOWEST_DECAY * size);
|
|
3577
|
+
if (size < this.base) {
|
|
3578
|
+
this.falls++;
|
|
3579
|
+
this.base = size;
|
|
3580
|
+
this.heldSince = time;
|
|
3581
|
+
}
|
|
3582
|
+
else if (time - this.heldSince >
|
|
3583
|
+
Math.max(SHORTEST_HOLD_MS, longestHold)) {
|
|
3584
|
+
this.restart(size, time);
|
|
3585
|
+
}
|
|
3586
|
+
if (this.falls >= FALLING_EVENTS &&
|
|
3587
|
+
size <= this.peak - Math.max(2 * JITTER, FALL_FROM_PEAK * this.peak)) {
|
|
3588
|
+
this.momentum = true;
|
|
3589
|
+
}
|
|
3590
|
+
return this.momentum;
|
|
3591
|
+
};
|
|
3592
|
+
WheelMomentumDetector.prototype.restart = function (size, time) {
|
|
3593
|
+
this.base = this.peak = size;
|
|
3594
|
+
this.falls = this.rises = 0;
|
|
3595
|
+
this.heldSince = time;
|
|
3596
|
+
this.momentum = false;
|
|
3597
|
+
};
|
|
3598
|
+
return WheelMomentumDetector;
|
|
3599
|
+
}());
|
|
3600
|
+
|
|
3601
|
+
|
|
3602
|
+
|
|
3603
|
+
/***/ }),
|
|
3604
|
+
/* 16 */
|
|
3605
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3606
|
+
|
|
3328
3607
|
"use strict";
|
|
3329
3608
|
__webpack_require__.r(__webpack_exports__);
|
|
3330
3609
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3331
3610
|
/* harmony export */ FocusSessionState: () => (/* binding */ FocusSessionState),
|
|
3332
3611
|
/* harmony export */ KeyboardInteractions: () => (/* binding */ KeyboardInteractions)
|
|
3333
3612
|
/* harmony export */ });
|
|
3334
|
-
/* harmony import */ var _keyMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
3613
|
+
/* harmony import */ var _keyMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
|
|
3335
3614
|
/* harmony import */ var _semantics_claimedKeyEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11);
|
|
3336
|
-
/* harmony import */ var _textInputProxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
3615
|
+
/* harmony import */ var _textInputProxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
|
|
3337
3616
|
|
|
3338
3617
|
|
|
3339
3618
|
|
|
@@ -3823,7 +4102,7 @@ var KeyboardInteractions = /** @class */ (function () {
|
|
|
3823
4102
|
|
|
3824
4103
|
|
|
3825
4104
|
/***/ }),
|
|
3826
|
-
/*
|
|
4105
|
+
/* 17 */
|
|
3827
4106
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3828
4107
|
|
|
3829
4108
|
"use strict";
|
|
@@ -4187,7 +4466,7 @@ function modifiersFromEvent(event) {
|
|
|
4187
4466
|
|
|
4188
4467
|
|
|
4189
4468
|
/***/ }),
|
|
4190
|
-
/*
|
|
4469
|
+
/* 18 */
|
|
4191
4470
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4192
4471
|
|
|
4193
4472
|
"use strict";
|
|
@@ -4410,7 +4689,7 @@ function clamp(v, min, max) {
|
|
|
4410
4689
|
|
|
4411
4690
|
|
|
4412
4691
|
/***/ }),
|
|
4413
|
-
/*
|
|
4692
|
+
/* 19 */
|
|
4414
4693
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4415
4694
|
|
|
4416
4695
|
"use strict";
|
|
@@ -4418,7 +4697,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4418
4697
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4419
4698
|
/* harmony export */ GamepadInteractions: () => (/* binding */ GamepadInteractions)
|
|
4420
4699
|
/* harmony export */ });
|
|
4421
|
-
/* harmony import */ var _gamepadBatchEncoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
4700
|
+
/* harmony import */ var _gamepadBatchEncoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
|
|
4422
4701
|
|
|
4423
4702
|
// Standard mapping: 17 buttons, 4 stick axes, plus triggers mirrored onto axes 4/5.
|
|
4424
4703
|
var STANDARD_BUTTON_COUNT = 17;
|
|
@@ -4645,7 +4924,7 @@ var GamepadInteractions = /** @class */ (function () {
|
|
|
4645
4924
|
|
|
4646
4925
|
|
|
4647
4926
|
/***/ }),
|
|
4648
|
-
/*
|
|
4927
|
+
/* 20 */
|
|
4649
4928
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4650
4929
|
|
|
4651
4930
|
"use strict";
|
|
@@ -4799,7 +5078,7 @@ var GamepadBatchEncoder = /** @class */ (function () {
|
|
|
4799
5078
|
|
|
4800
5079
|
|
|
4801
5080
|
/***/ }),
|
|
4802
|
-
/*
|
|
5081
|
+
/* 21 */
|
|
4803
5082
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4804
5083
|
|
|
4805
5084
|
"use strict";
|
|
@@ -4853,7 +5132,7 @@ function sanitizeUrl(url) {
|
|
|
4853
5132
|
|
|
4854
5133
|
|
|
4855
5134
|
/***/ }),
|
|
4856
|
-
/*
|
|
5135
|
+
/* 22 */
|
|
4857
5136
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4858
5137
|
|
|
4859
5138
|
"use strict";
|
|
@@ -5154,7 +5433,7 @@ var createFinalization = function (target, finalizable) {
|
|
|
5154
5433
|
|
|
5155
5434
|
|
|
5156
5435
|
/***/ }),
|
|
5157
|
-
/*
|
|
5436
|
+
/* 23 */
|
|
5158
5437
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5159
5438
|
|
|
5160
5439
|
"use strict";
|
|
@@ -5178,6 +5457,17 @@ var RiveFont = /** @class */ (function () {
|
|
|
5178
5457
|
RiveFont._fallbackFontCallback = fontCallback !== null && fontCallback !== void 0 ? fontCallback : null;
|
|
5179
5458
|
RiveFont._wireFallbackProc();
|
|
5180
5459
|
};
|
|
5460
|
+
/**
|
|
5461
|
+
* Set the preferred languages (BCP 47 tags, most preferred first) that text
|
|
5462
|
+
* without a `language` of its own shapes and falls back with, like
|
|
5463
|
+
* `navigator.languages` is for a page. Pass nothing to follow
|
|
5464
|
+
* `navigator.languages`, which is also what happens until this is called,
|
|
5465
|
+
* including when the browser's languages change.
|
|
5466
|
+
* @param languages The languages to use, or nothing for the browser's.
|
|
5467
|
+
*/
|
|
5468
|
+
RiveFont.setSystemLanguages = function (languages) {
|
|
5469
|
+
_runtimeLoader__WEBPACK_IMPORTED_MODULE_0__.RuntimeLoader.setSystemLanguages(languages !== null && languages !== void 0 ? languages : null);
|
|
5470
|
+
};
|
|
5181
5471
|
// Get the pointer value to the Embind Font object from FontWrapper
|
|
5182
5472
|
RiveFont._fontToPtr = function (fontWrapper) {
|
|
5183
5473
|
var _a;
|
|
@@ -5203,8 +5493,8 @@ var RiveFont = /** @class */ (function () {
|
|
|
5203
5493
|
_runtimeLoader__WEBPACK_IMPORTED_MODULE_0__.RuntimeLoader.getInstance(function (rive) {
|
|
5204
5494
|
var cb = RiveFont._fallbackFontCallback;
|
|
5205
5495
|
if (cb) {
|
|
5206
|
-
rive.setFallbackFontCallback((function (missingGlyph, fallbackFontIndex, weight) {
|
|
5207
|
-
var fontsReturned = cb(missingGlyph, weight);
|
|
5496
|
+
rive.setFallbackFontCallback((function (missingGlyph, fallbackFontIndex, weight, languages) {
|
|
5497
|
+
var fontsReturned = cb(missingGlyph, weight, languages !== null && languages !== void 0 ? languages : []);
|
|
5208
5498
|
if (fontsReturned) {
|
|
5209
5499
|
if (Array.isArray(fontsReturned)) {
|
|
5210
5500
|
return RiveFont._getFallbackPtr(fontsReturned, fallbackFontIndex);
|
|
@@ -5228,7 +5518,7 @@ var RiveFont = /** @class */ (function () {
|
|
|
5228
5518
|
|
|
5229
5519
|
|
|
5230
5520
|
/***/ }),
|
|
5231
|
-
/*
|
|
5521
|
+
/* 24 */
|
|
5232
5522
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5233
5523
|
|
|
5234
5524
|
"use strict";
|
|
@@ -5324,7 +5614,9 @@ var ReplayPacer = /** @class */ (function () {
|
|
|
5324
5614
|
this.probeAfter = this.probing
|
|
5325
5615
|
? Math.min(this.probeAfter * 2, kMaxProbeAfterMs)
|
|
5326
5616
|
: kProbeAfterMs;
|
|
5327
|
-
|
|
5617
|
+
// At most doubling, since settling at the cadence one bad replay time
|
|
5618
|
+
// asks for can hold recording back for seconds.
|
|
5619
|
+
this.setDivisor(time, Math.min(Math.max(divisor + 1, Math.ceil(ratio)), divisor * 2));
|
|
5328
5620
|
}
|
|
5329
5621
|
else if (ratio < (divisor - 1) * 0.9) {
|
|
5330
5622
|
// Paced frames no longer overlap, so their replay time is a ceiling
|
|
@@ -6857,6 +7149,8 @@ var RiveFile = /** @class */ (function () {
|
|
|
6857
7149
|
function RiveFile(params) {
|
|
6858
7150
|
// Allow the runtime to automatically load assets hosted in Rive's runtime.
|
|
6859
7151
|
this.enableRiveAssetCDN = true;
|
|
7152
|
+
// Decode parts of the file on first use instead of at import.
|
|
7153
|
+
this.deferDecoding = false;
|
|
6860
7154
|
// When true, emits performance.mark/measure entries during RiveFile load.
|
|
6861
7155
|
this.enablePerfMarks = false;
|
|
6862
7156
|
this.referenceCount = 0;
|
|
@@ -6886,6 +7180,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
6886
7180
|
typeof params.enableRiveAssetCDN == "boolean"
|
|
6887
7181
|
? params.enableRiveAssetCDN
|
|
6888
7182
|
: true;
|
|
7183
|
+
this.deferDecoding = !!params.deferDecoding;
|
|
6889
7184
|
this.enablePerfMarks = !!params.enablePerfMarks;
|
|
6890
7185
|
if (this.enablePerfMarks)
|
|
6891
7186
|
_runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.enablePerfMarks = true;
|
|
@@ -6959,7 +7254,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
6959
7254
|
case 5:
|
|
6960
7255
|
_c.trys.push([5, 7, , 8]);
|
|
6961
7256
|
_b = this;
|
|
6962
|
-
return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN, this.session)];
|
|
7257
|
+
return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN, this.session, this.deferDecoding)];
|
|
6963
7258
|
case 6:
|
|
6964
7259
|
_b.file = _c.sent();
|
|
6965
7260
|
return [3 /*break*/, 8];
|
|
@@ -7194,6 +7489,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
7194
7489
|
buffer: this.buffer,
|
|
7195
7490
|
assetLoader: this.assetLoader,
|
|
7196
7491
|
enableRiveAssetCDN: this.enableRiveAssetCDN,
|
|
7492
|
+
deferDecoding: this.deferDecoding,
|
|
7197
7493
|
enablePerfMarks: this.enablePerfMarks,
|
|
7198
7494
|
enableGPUCanvas: deferred,
|
|
7199
7495
|
});
|
|
@@ -7329,6 +7625,8 @@ var Rive = /** @class */ (function () {
|
|
|
7329
7625
|
this.enableMultiTouch = false;
|
|
7330
7626
|
// Allow the runtime to automatically load assets hosted in Rive's runtime.
|
|
7331
7627
|
this.enableRiveAssetCDN = true;
|
|
7628
|
+
// Forwarded to the file this instance imports itself.
|
|
7629
|
+
this.deferDecoding = false;
|
|
7332
7630
|
this.semanticsMode = _semantics__WEBPACK_IMPORTED_MODULE_2__.SemanticMode.Disabled;
|
|
7333
7631
|
this.semanticsOptions = {
|
|
7334
7632
|
riveCanvasLabel: "Rive animation",
|
|
@@ -7478,6 +7776,7 @@ var Rive = /** @class */ (function () {
|
|
|
7478
7776
|
params.enableRiveAssetCDN === undefined
|
|
7479
7777
|
? true
|
|
7480
7778
|
: params.enableRiveAssetCDN;
|
|
7779
|
+
this.deferDecoding = !!params.deferDecoding;
|
|
7481
7780
|
this.enablePerfMarks = !!params.enablePerfMarks;
|
|
7482
7781
|
if (this.enablePerfMarks)
|
|
7483
7782
|
_runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.enablePerfMarks = true;
|
|
@@ -7937,6 +8236,7 @@ var Rive = /** @class */ (function () {
|
|
|
7937
8236
|
src: this.src,
|
|
7938
8237
|
buffer: this.buffer,
|
|
7939
8238
|
enableRiveAssetCDN: this.enableRiveAssetCDN,
|
|
8239
|
+
deferDecoding: this.deferDecoding,
|
|
7940
8240
|
assetLoader: this.assetLoader,
|
|
7941
8241
|
enablePerfMarks: this.enablePerfMarks,
|
|
7942
8242
|
// The instance owns this file, so its flag is the file's flag.
|
|
@@ -9544,9 +9844,10 @@ var Rive = /** @class */ (function () {
|
|
|
9544
9844
|
this.drawFrame();
|
|
9545
9845
|
};
|
|
9546
9846
|
Rive.prototype.scheduleRendering = function () {
|
|
9847
|
+
var _a, _b;
|
|
9547
9848
|
if (this.loaded && this.artboard && !this.frameRequestId) {
|
|
9548
9849
|
if (this.runtime.requestAnimationFrame) {
|
|
9549
|
-
this.frameRequestId = this.runtime.requestAnimationFrame(this._boundDraw);
|
|
9850
|
+
this.frameRequestId = this.runtime.requestAnimationFrame(this._boundDraw, ((_b = (_a = this.renderer) === null || _a === void 0 ? void 0 : _a.replaysOnWorker) === null || _b === void 0 ? void 0 : _b.call(_a)) === true);
|
|
9550
9851
|
}
|
|
9551
9852
|
else {
|
|
9552
9853
|
this.frameRequestId = requestAnimationFrame(this._boundDraw);
|