@rive-app/canvas-lite 2.35.4 → 2.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rive.d.ts +27 -17
- package/rive.js +813 -599
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +5 -0
- package/rive_fallback.wasm +0 -0
package/rive.js
CHANGED
|
@@ -13,6 +13,264 @@ return /******/ (() => { // webpackBootstrap
|
|
|
13
13
|
/******/ var __webpack_modules__ = ([
|
|
14
14
|
/* 0 */,
|
|
15
15
|
/* 1 */
|
|
16
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
17
|
+
|
|
18
|
+
__webpack_require__.r(__webpack_exports__);
|
|
19
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20
|
+
/* harmony export */ Animation: () => (/* reexport safe */ _Animation__WEBPACK_IMPORTED_MODULE_0__.Animation)
|
|
21
|
+
/* harmony export */ });
|
|
22
|
+
/* harmony import */ var _Animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/***/ }),
|
|
27
|
+
/* 2 */
|
|
28
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
29
|
+
|
|
30
|
+
__webpack_require__.r(__webpack_exports__);
|
|
31
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32
|
+
/* harmony export */ Animation: () => (/* binding */ Animation)
|
|
33
|
+
/* harmony export */ });
|
|
34
|
+
/**
|
|
35
|
+
* Represents an animation that can be played on an Artboard.
|
|
36
|
+
* Wraps animations and instances from the runtime and keeps track of playback state.
|
|
37
|
+
*
|
|
38
|
+
* The `Animation` class manages the state and behavior of a single animation instance,
|
|
39
|
+
* including its current time, loop count, and ability to scrub to a specific time.
|
|
40
|
+
*
|
|
41
|
+
* The class provides methods to advance the animation, apply its interpolated keyframe
|
|
42
|
+
* values to the Artboard, and clean up the underlying animation instance when the
|
|
43
|
+
* animation is no longer needed.
|
|
44
|
+
*/
|
|
45
|
+
var Animation = /** @class */ (function () {
|
|
46
|
+
/**
|
|
47
|
+
* Constructs a new animation
|
|
48
|
+
* @constructor
|
|
49
|
+
* @param {any} animation: runtime animation object
|
|
50
|
+
* @param {any} instance: runtime animation instance object
|
|
51
|
+
*/
|
|
52
|
+
function Animation(animation, artboard, runtime, playing) {
|
|
53
|
+
this.animation = animation;
|
|
54
|
+
this.artboard = artboard;
|
|
55
|
+
this.playing = playing;
|
|
56
|
+
this.loopCount = 0;
|
|
57
|
+
/**
|
|
58
|
+
* The time to which the animation should move to on the next render.
|
|
59
|
+
* If not null, the animation will scrub to this time instead of advancing by the given time.
|
|
60
|
+
*/
|
|
61
|
+
this.scrubTo = null;
|
|
62
|
+
this.instance = new runtime.LinearAnimationInstance(animation, artboard);
|
|
63
|
+
}
|
|
64
|
+
Object.defineProperty(Animation.prototype, "name", {
|
|
65
|
+
/**
|
|
66
|
+
* Returns the animation's name
|
|
67
|
+
*/
|
|
68
|
+
get: function () {
|
|
69
|
+
return this.animation.name;
|
|
70
|
+
},
|
|
71
|
+
enumerable: false,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(Animation.prototype, "time", {
|
|
75
|
+
/**
|
|
76
|
+
* Returns the animation's name
|
|
77
|
+
*/
|
|
78
|
+
get: function () {
|
|
79
|
+
return this.instance.time;
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Sets the animation's current time
|
|
83
|
+
*/
|
|
84
|
+
set: function (value) {
|
|
85
|
+
this.instance.time = value;
|
|
86
|
+
},
|
|
87
|
+
enumerable: false,
|
|
88
|
+
configurable: true
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(Animation.prototype, "loopValue", {
|
|
91
|
+
/**
|
|
92
|
+
* Returns the animation's loop type
|
|
93
|
+
*/
|
|
94
|
+
get: function () {
|
|
95
|
+
return this.animation.loopValue;
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(Animation.prototype, "needsScrub", {
|
|
101
|
+
/**
|
|
102
|
+
* Indicates whether the animation needs to be scrubbed.
|
|
103
|
+
* @returns `true` if the animation needs to be scrubbed, `false` otherwise.
|
|
104
|
+
*/
|
|
105
|
+
get: function () {
|
|
106
|
+
return this.scrubTo !== null;
|
|
107
|
+
},
|
|
108
|
+
enumerable: false,
|
|
109
|
+
configurable: true
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Advances the animation by the give time. If the animation needs scrubbing,
|
|
113
|
+
* time is ignored and the stored scrub value is used.
|
|
114
|
+
* @param time the time to advance the animation by if no scrubbing required
|
|
115
|
+
*/
|
|
116
|
+
Animation.prototype.advance = function (time) {
|
|
117
|
+
if (this.scrubTo === null) {
|
|
118
|
+
this.instance.advance(time);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.instance.time = 0;
|
|
122
|
+
this.instance.advance(this.scrubTo);
|
|
123
|
+
this.scrubTo = null;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Apply interpolated keyframe values to the artboard. This should be called after calling
|
|
128
|
+
* .advance() on an animation instance so that new values are applied to properties.
|
|
129
|
+
*
|
|
130
|
+
* Note: This does not advance the artboard, which updates all objects on the artboard
|
|
131
|
+
* @param mix - Mix value for the animation from 0 to 1
|
|
132
|
+
*/
|
|
133
|
+
Animation.prototype.apply = function (mix) {
|
|
134
|
+
this.instance.apply(mix);
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Deletes the backing Wasm animation instance; once this is called, this
|
|
138
|
+
* animation is no more.
|
|
139
|
+
*/
|
|
140
|
+
Animation.prototype.cleanup = function () {
|
|
141
|
+
this.instance.delete();
|
|
142
|
+
};
|
|
143
|
+
return Animation;
|
|
144
|
+
}());
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
/***/ }),
|
|
149
|
+
/* 3 */
|
|
150
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
151
|
+
|
|
152
|
+
__webpack_require__.r(__webpack_exports__);
|
|
153
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
154
|
+
/* harmony export */ RuntimeLoader: () => (/* binding */ RuntimeLoader)
|
|
155
|
+
/* harmony export */ });
|
|
156
|
+
/* harmony import */ var _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
157
|
+
/* harmony import */ var package_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
// Runtime singleton; use getInstance to provide a callback that returns the
|
|
161
|
+
// Rive runtime
|
|
162
|
+
var RuntimeLoader = /** @class */ (function () {
|
|
163
|
+
// Class is never instantiated
|
|
164
|
+
function RuntimeLoader() {
|
|
165
|
+
}
|
|
166
|
+
// Loads the runtime
|
|
167
|
+
RuntimeLoader.loadRuntime = function () {
|
|
168
|
+
if (RuntimeLoader.enablePerfMarks)
|
|
169
|
+
performance.mark('rive:wasm-init:start');
|
|
170
|
+
_rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
|
|
171
|
+
// Loads Wasm bundle
|
|
172
|
+
locateFile: function () { return RuntimeLoader.wasmURL; },
|
|
173
|
+
})
|
|
174
|
+
.then(function (rive) {
|
|
175
|
+
var _a;
|
|
176
|
+
if (RuntimeLoader.enablePerfMarks) {
|
|
177
|
+
performance.mark('rive:wasm-init:end');
|
|
178
|
+
performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');
|
|
179
|
+
}
|
|
180
|
+
RuntimeLoader.runtime = rive;
|
|
181
|
+
// Fire all the callbacks
|
|
182
|
+
while (RuntimeLoader.callBackQueue.length > 0) {
|
|
183
|
+
(_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
.catch(function (error) {
|
|
187
|
+
// Capture specific error details
|
|
188
|
+
var errorDetails = {
|
|
189
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error",
|
|
190
|
+
type: (error === null || error === void 0 ? void 0 : error.name) || "Error",
|
|
191
|
+
// Some browsers may provide additional WebAssembly-specific details
|
|
192
|
+
wasmError: error instanceof WebAssembly.CompileError ||
|
|
193
|
+
error instanceof WebAssembly.RuntimeError,
|
|
194
|
+
originalError: error,
|
|
195
|
+
};
|
|
196
|
+
// Log detailed error for debugging
|
|
197
|
+
console.debug("Rive WASM load error details:", errorDetails);
|
|
198
|
+
// In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
|
|
199
|
+
// This `rive_fallback.wasm` is compiled to support older architecture.
|
|
200
|
+
// TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
|
|
201
|
+
var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
|
|
202
|
+
if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
|
|
203
|
+
console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
|
|
204
|
+
RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
|
|
205
|
+
RuntimeLoader.loadRuntime();
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
var errorMessage = [
|
|
209
|
+
"Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
|
|
210
|
+
"Possible reasons:",
|
|
211
|
+
"- Network connection is down",
|
|
212
|
+
"- WebAssembly is not supported in this environment",
|
|
213
|
+
"- The WASM file is corrupted or incompatible",
|
|
214
|
+
"\nError details:",
|
|
215
|
+
"- Type: ".concat(errorDetails.type),
|
|
216
|
+
"- Message: ".concat(errorDetails.message),
|
|
217
|
+
"- WebAssembly-specific error: ".concat(errorDetails.wasmError),
|
|
218
|
+
"\nTo resolve, you may need to:",
|
|
219
|
+
"1. Check your network connection",
|
|
220
|
+
"2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
|
|
221
|
+
"3. Call RuntimeLoader.loadRuntime() again",
|
|
222
|
+
].join("\n");
|
|
223
|
+
console.error(errorMessage);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
// Provides a runtime instance via a callback
|
|
228
|
+
RuntimeLoader.getInstance = function (callback) {
|
|
229
|
+
// If it's not loading, start loading runtime
|
|
230
|
+
if (!RuntimeLoader.isLoading) {
|
|
231
|
+
RuntimeLoader.isLoading = true;
|
|
232
|
+
RuntimeLoader.loadRuntime();
|
|
233
|
+
}
|
|
234
|
+
if (!RuntimeLoader.runtime) {
|
|
235
|
+
RuntimeLoader.callBackQueue.push(callback);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
callback(RuntimeLoader.runtime);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
// Provides a runtime instance via a promise
|
|
242
|
+
RuntimeLoader.awaitInstance = function () {
|
|
243
|
+
return new Promise(function (resolve) {
|
|
244
|
+
return RuntimeLoader.getInstance(function (rive) { return resolve(rive); });
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
// Manually sets the wasm url
|
|
248
|
+
RuntimeLoader.setWasmUrl = function (url) {
|
|
249
|
+
RuntimeLoader.wasmURL = url;
|
|
250
|
+
};
|
|
251
|
+
// Gets the current wasm url
|
|
252
|
+
RuntimeLoader.getWasmUrl = function () {
|
|
253
|
+
return RuntimeLoader.wasmURL;
|
|
254
|
+
};
|
|
255
|
+
// Flag to indicate that loading has started/completed
|
|
256
|
+
RuntimeLoader.isLoading = false;
|
|
257
|
+
// List of callbacks for the runtime that come in while loading
|
|
258
|
+
RuntimeLoader.callBackQueue = [];
|
|
259
|
+
// Path to the Wasm file; default path works for testing only;
|
|
260
|
+
// if embedded wasm is used then this is never used.
|
|
261
|
+
RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
|
|
262
|
+
/**
|
|
263
|
+
* When true, performance.mark / performance.measure entries are emitted for
|
|
264
|
+
* WASM initialization.
|
|
265
|
+
*/
|
|
266
|
+
RuntimeLoader.enablePerfMarks = false;
|
|
267
|
+
return RuntimeLoader;
|
|
268
|
+
}());
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
/***/ }),
|
|
273
|
+
/* 4 */
|
|
16
274
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
17
275
|
|
|
18
276
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -32,41 +290,41 @@ var k = moduleArg, aa, ba, da = new Promise((b, a) => {
|
|
|
32
290
|
ba = a;
|
|
33
291
|
}), ea = "object" == typeof window, fa = "function" == typeof importScripts;
|
|
34
292
|
function ka() {
|
|
35
|
-
function b(
|
|
293
|
+
function b(l) {
|
|
36
294
|
const h = d;
|
|
37
295
|
c = a = 0;
|
|
38
296
|
d = new Map();
|
|
39
|
-
h.forEach(
|
|
297
|
+
h.forEach(n => {
|
|
40
298
|
try {
|
|
41
|
-
l
|
|
42
|
-
} catch (
|
|
43
|
-
console.error(
|
|
299
|
+
n(l);
|
|
300
|
+
} catch (m) {
|
|
301
|
+
console.error(m);
|
|
44
302
|
}
|
|
45
303
|
});
|
|
46
304
|
this.va();
|
|
47
305
|
e && e.Pa();
|
|
48
306
|
}
|
|
49
307
|
let a = 0, c = 0, d = new Map(), e = null, f = null;
|
|
50
|
-
this.requestAnimationFrame = function(
|
|
308
|
+
this.requestAnimationFrame = function(l) {
|
|
51
309
|
a ||= requestAnimationFrame(b.bind(this));
|
|
52
310
|
const h = ++c;
|
|
53
|
-
d.set(h,
|
|
311
|
+
d.set(h, l);
|
|
54
312
|
return h;
|
|
55
313
|
};
|
|
56
|
-
this.cancelAnimationFrame = function(
|
|
57
|
-
d.delete(
|
|
314
|
+
this.cancelAnimationFrame = function(l) {
|
|
315
|
+
d.delete(l);
|
|
58
316
|
a && 0 == d.size && (cancelAnimationFrame(a), a = 0);
|
|
59
317
|
};
|
|
60
|
-
this.Na = function(
|
|
318
|
+
this.Na = function(l) {
|
|
61
319
|
f && (document.body.remove(f), f = null);
|
|
62
|
-
|
|
320
|
+
l || (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", l = function(h) {
|
|
63
321
|
f.innerHTML = "RIVE FPS " + h.toFixed(1);
|
|
64
322
|
}, document.body.appendChild(f));
|
|
65
323
|
e = new function() {
|
|
66
|
-
let h = 0,
|
|
324
|
+
let h = 0, n = 0;
|
|
67
325
|
this.Pa = function() {
|
|
68
|
-
var
|
|
69
|
-
|
|
326
|
+
var m = performance.now();
|
|
327
|
+
n ? (++h, m -= n, 1000 < m && (l(1000 * h / m), h = n = 0)) : (n = m, h = 0);
|
|
70
328
|
};
|
|
71
329
|
}();
|
|
72
330
|
};
|
|
@@ -96,64 +354,70 @@ const ma = k.onRuntimeInitialized;
|
|
|
96
354
|
k.onRuntimeInitialized = function() {
|
|
97
355
|
ma && ma();
|
|
98
356
|
let b = k.decodeAudio;
|
|
99
|
-
k.decodeAudio = function(
|
|
100
|
-
|
|
101
|
-
f
|
|
357
|
+
k.decodeAudio = function(f, l) {
|
|
358
|
+
f = b(f);
|
|
359
|
+
l(f);
|
|
102
360
|
};
|
|
103
361
|
let a = k.decodeFont;
|
|
104
|
-
k.decodeFont = function(
|
|
105
|
-
|
|
106
|
-
f
|
|
362
|
+
k.decodeFont = function(f, l) {
|
|
363
|
+
f = a(f);
|
|
364
|
+
l(f);
|
|
365
|
+
};
|
|
366
|
+
let c = k.setFallbackFontCb;
|
|
367
|
+
k.setFallbackFontCallback = "function" === typeof c ? function(f) {
|
|
368
|
+
c(f);
|
|
369
|
+
} : function() {
|
|
370
|
+
console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.");
|
|
107
371
|
};
|
|
108
|
-
const
|
|
109
|
-
k.ptrToAsset =
|
|
110
|
-
let
|
|
111
|
-
return
|
|
372
|
+
const d = k.FileAssetLoader;
|
|
373
|
+
k.ptrToAsset = f => {
|
|
374
|
+
let l = k.ptrToFileAsset(f);
|
|
375
|
+
return l.isImage ? k.ptrToImageAsset(f) : l.isFont ? k.ptrToFontAsset(f) : l.isAudio ? k.ptrToAudioAsset(f) : l;
|
|
112
376
|
};
|
|
113
|
-
k.CustomFileAssetLoader =
|
|
377
|
+
k.CustomFileAssetLoader = d.extend("CustomFileAssetLoader", {__construct:function({loadContents:f}) {
|
|
114
378
|
this.__parent.__construct.call(this);
|
|
115
|
-
this.Ea =
|
|
116
|
-
}, loadContents:function(
|
|
117
|
-
|
|
118
|
-
return this.Ea(
|
|
379
|
+
this.Ea = f;
|
|
380
|
+
}, loadContents:function(f, l) {
|
|
381
|
+
f = k.ptrToAsset(f);
|
|
382
|
+
return this.Ea(f, l);
|
|
119
383
|
},});
|
|
120
|
-
k.CDNFileAssetLoader =
|
|
384
|
+
k.CDNFileAssetLoader = d.extend("CDNFileAssetLoader", {__construct:function() {
|
|
121
385
|
this.__parent.__construct.call(this);
|
|
122
|
-
}, loadContents:function(
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
if ("" ===
|
|
386
|
+
}, loadContents:function(f) {
|
|
387
|
+
let l = k.ptrToAsset(f);
|
|
388
|
+
f = l.cdnUuid;
|
|
389
|
+
if ("" === f) {
|
|
126
390
|
return !1;
|
|
127
391
|
}
|
|
128
|
-
(function(
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
4 ==
|
|
392
|
+
(function(h, n) {
|
|
393
|
+
var m = new XMLHttpRequest();
|
|
394
|
+
m.responseType = "arraybuffer";
|
|
395
|
+
m.onreadystatechange = function() {
|
|
396
|
+
4 == m.readyState && 200 == m.status && n(m);
|
|
133
397
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})(
|
|
137
|
-
|
|
398
|
+
m.open("GET", h, !0);
|
|
399
|
+
m.send(null);
|
|
400
|
+
})(l.cdnBaseUrl + "/" + f, h => {
|
|
401
|
+
l.decode(new Uint8Array(h.response));
|
|
138
402
|
});
|
|
139
403
|
return !0;
|
|
140
404
|
},});
|
|
141
|
-
k.FallbackFileAssetLoader =
|
|
405
|
+
k.FallbackFileAssetLoader = d.extend("FallbackFileAssetLoader", {__construct:function() {
|
|
142
406
|
this.__parent.__construct.call(this);
|
|
143
407
|
this.ua = [];
|
|
144
|
-
}, addLoader:function(
|
|
145
|
-
this.ua.push(
|
|
146
|
-
}, loadContents:function(
|
|
147
|
-
for (let
|
|
148
|
-
if (
|
|
408
|
+
}, addLoader:function(f) {
|
|
409
|
+
this.ua.push(f);
|
|
410
|
+
}, loadContents:function(f, l) {
|
|
411
|
+
for (let h of this.ua) {
|
|
412
|
+
if (h.loadContents(f, l)) {
|
|
149
413
|
return !0;
|
|
150
414
|
}
|
|
151
415
|
}
|
|
152
416
|
return !1;
|
|
153
417
|
},});
|
|
154
|
-
let
|
|
155
|
-
k.computeAlignment = function(
|
|
156
|
-
return
|
|
418
|
+
let e = k.computeAlignment;
|
|
419
|
+
k.computeAlignment = function(f, l, h, n, m = 1.0) {
|
|
420
|
+
return e.call(this, f, l, h, n, m);
|
|
157
421
|
};
|
|
158
422
|
};
|
|
159
423
|
const pa = "createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "), qa = new function() {
|
|
@@ -178,7 +442,7 @@ const pa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
178
442
|
}
|
|
179
443
|
q = new Proxy(q, {get(F, v) {
|
|
180
444
|
if (F.isContextLost()) {
|
|
181
|
-
if (
|
|
445
|
+
if (n || (console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ", v), n = !0), "function" === typeof F[v]) {
|
|
182
446
|
return function() {
|
|
183
447
|
};
|
|
184
448
|
}
|
|
@@ -189,7 +453,7 @@ const pa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
189
453
|
}
|
|
190
454
|
}, set(F, v, H) {
|
|
191
455
|
if (F.isContextLost()) {
|
|
192
|
-
|
|
456
|
+
n || (console.error("Cannot render the mesh because the GL Context was lost. Tried to set property " + v), n = !0);
|
|
193
457
|
} else {
|
|
194
458
|
return F[v] = H, !0;
|
|
195
459
|
}
|
|
@@ -228,7 +492,7 @@ const pa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
228
492
|
}
|
|
229
493
|
return !0;
|
|
230
494
|
}
|
|
231
|
-
let a = null, c = 0, d = 0, e = null, f = null,
|
|
495
|
+
let a = null, c = 0, d = 0, e = null, f = null, l = 0, h = 0, n = !1;
|
|
232
496
|
b();
|
|
233
497
|
this.Xa = function() {
|
|
234
498
|
b();
|
|
@@ -253,10 +517,10 @@ const pa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
253
517
|
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);
|
|
254
518
|
return t;
|
|
255
519
|
};
|
|
256
|
-
const
|
|
520
|
+
const m = new la(8), r = new la(8), w = new la(10), z = new la(10);
|
|
257
521
|
this.Ma = function(g, t, q, G, F) {
|
|
258
522
|
if (b()) {
|
|
259
|
-
var v =
|
|
523
|
+
var v = m.push(g), H = r.push(t);
|
|
260
524
|
if (a.canvas) {
|
|
261
525
|
if (a.canvas.width != v || a.canvas.height != H) {
|
|
262
526
|
a.canvas.width = v, a.canvas.height = H;
|
|
@@ -268,7 +532,7 @@ const pa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
268
532
|
a.enable(a.SCISSOR_TEST);
|
|
269
533
|
q.sort((E, V) => V.ya - E.ya);
|
|
270
534
|
v = w.push(G);
|
|
271
|
-
|
|
535
|
+
l != v && (a.bufferData(a.ARRAY_BUFFER, 8 * v, a.DYNAMIC_DRAW), l = v);
|
|
272
536
|
v = 0;
|
|
273
537
|
for (var L of q) {
|
|
274
538
|
a.bufferSubData(a.ARRAY_BUFFER, v, L.ia), v += 4 * L.ia.length;
|
|
@@ -313,37 +577,37 @@ const pa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
313
577
|
k.onRuntimeInitialized = function() {
|
|
314
578
|
function b(p) {
|
|
315
579
|
switch(p) {
|
|
316
|
-
case
|
|
580
|
+
case m.srcOver:
|
|
317
581
|
return "source-over";
|
|
318
|
-
case
|
|
582
|
+
case m.screen:
|
|
319
583
|
return "screen";
|
|
320
|
-
case
|
|
584
|
+
case m.overlay:
|
|
321
585
|
return "overlay";
|
|
322
|
-
case
|
|
586
|
+
case m.darken:
|
|
323
587
|
return "darken";
|
|
324
|
-
case
|
|
588
|
+
case m.lighten:
|
|
325
589
|
return "lighten";
|
|
326
|
-
case
|
|
590
|
+
case m.colorDodge:
|
|
327
591
|
return "color-dodge";
|
|
328
|
-
case
|
|
592
|
+
case m.colorBurn:
|
|
329
593
|
return "color-burn";
|
|
330
|
-
case
|
|
594
|
+
case m.hardLight:
|
|
331
595
|
return "hard-light";
|
|
332
|
-
case
|
|
596
|
+
case m.softLight:
|
|
333
597
|
return "soft-light";
|
|
334
|
-
case
|
|
598
|
+
case m.difference:
|
|
335
599
|
return "difference";
|
|
336
|
-
case
|
|
600
|
+
case m.exclusion:
|
|
337
601
|
return "exclusion";
|
|
338
|
-
case
|
|
602
|
+
case m.multiply:
|
|
339
603
|
return "multiply";
|
|
340
|
-
case
|
|
604
|
+
case m.hue:
|
|
341
605
|
return "hue";
|
|
342
|
-
case
|
|
606
|
+
case m.saturation:
|
|
343
607
|
return "saturation";
|
|
344
|
-
case
|
|
608
|
+
case m.color:
|
|
345
609
|
return "color";
|
|
346
|
-
case
|
|
610
|
+
case m.luminosity:
|
|
347
611
|
return "luminosity";
|
|
348
612
|
}
|
|
349
613
|
}
|
|
@@ -362,7 +626,7 @@ k.onRuntimeInitialized = function() {
|
|
|
362
626
|
}
|
|
363
627
|
ra && ra();
|
|
364
628
|
var d = k.RenderPaintStyle;
|
|
365
|
-
const e = k.RenderPath, f = k.RenderPaint,
|
|
629
|
+
const e = k.RenderPath, f = k.RenderPaint, l = k.Renderer, h = k.StrokeCap, n = k.StrokeJoin, m = k.BlendMode, r = d.fill, w = d.stroke, z = k.FillRule.evenOdd;
|
|
366
630
|
let g = 1;
|
|
367
631
|
var t = k.RenderImage.extend("CanvasRenderImage", {__construct:function({R:p, W:u} = {}) {
|
|
368
632
|
this.__parent.__construct.call(this);
|
|
@@ -417,13 +681,13 @@ k.onRuntimeInitialized = function() {
|
|
|
417
681
|
this.Ga = p;
|
|
418
682
|
}, join:function(p) {
|
|
419
683
|
switch(p) {
|
|
420
|
-
case
|
|
684
|
+
case n.miter:
|
|
421
685
|
this.ba = "miter";
|
|
422
686
|
break;
|
|
423
|
-
case
|
|
687
|
+
case n.round:
|
|
424
688
|
this.ba = "round";
|
|
425
689
|
break;
|
|
426
|
-
case
|
|
690
|
+
case n.bevel:
|
|
427
691
|
this.ba = "bevel";
|
|
428
692
|
}
|
|
429
693
|
}, cap:function(p) {
|
|
@@ -484,7 +748,7 @@ k.onRuntimeInitialized = function() {
|
|
|
484
748
|
},});
|
|
485
749
|
const F = new Set();
|
|
486
750
|
let v = null, H = [], L = 0, Q = 0;
|
|
487
|
-
var ha = k.CanvasRenderer =
|
|
751
|
+
var ha = k.CanvasRenderer = l.extend("Renderer", {__construct:function(p) {
|
|
488
752
|
this.__parent.__construct.call(this);
|
|
489
753
|
this.G = [1, 0, 0, 1, 0, 0];
|
|
490
754
|
this.u = [1.0];
|
|
@@ -871,19 +1135,19 @@ var Fb = {}, Gb = {}, X = (b, a, c) => {
|
|
|
871
1135
|
if (h.length !== b.length) {
|
|
872
1136
|
throw new zb("Mismatched type converter count");
|
|
873
1137
|
}
|
|
874
|
-
for (var
|
|
875
|
-
Hb(b[
|
|
1138
|
+
for (var n = 0; n < b.length; ++n) {
|
|
1139
|
+
Hb(b[n], h[n]);
|
|
876
1140
|
}
|
|
877
1141
|
}
|
|
878
1142
|
b.forEach(function(h) {
|
|
879
1143
|
Gb[h] = a;
|
|
880
1144
|
});
|
|
881
|
-
var e = Array(a.length), f = [],
|
|
882
|
-
a.forEach((h,
|
|
883
|
-
kb.hasOwnProperty(h) ? e[
|
|
884
|
-
e[
|
|
885
|
-
++
|
|
886
|
-
|
|
1145
|
+
var e = Array(a.length), f = [], l = 0;
|
|
1146
|
+
a.forEach((h, n) => {
|
|
1147
|
+
kb.hasOwnProperty(h) ? e[n] = kb[h] : (f.push(h), Fb.hasOwnProperty(h) || (Fb[h] = []), Fb[h].push(() => {
|
|
1148
|
+
e[n] = kb[h];
|
|
1149
|
+
++l;
|
|
1150
|
+
l === f.length && d(e);
|
|
887
1151
|
}));
|
|
888
1152
|
});
|
|
889
1153
|
0 === f.length && d(e);
|
|
@@ -947,14 +1211,14 @@ var Lb = (b, a, c) => {
|
|
|
947
1211
|
var a = b.charCodeAt(0);
|
|
948
1212
|
return 48 <= a && 57 >= a ? `_${b}` : b;
|
|
949
1213
|
};
|
|
950
|
-
function Ob(b, a, c, d, e, f,
|
|
1214
|
+
function Ob(b, a, c, d, e, f, l, h) {
|
|
951
1215
|
this.name = b;
|
|
952
1216
|
this.constructor = a;
|
|
953
1217
|
this.C = c;
|
|
954
1218
|
this.D = d;
|
|
955
1219
|
this.o = e;
|
|
956
1220
|
this.Qa = f;
|
|
957
|
-
this.S =
|
|
1221
|
+
this.S = l;
|
|
958
1222
|
this.La = h;
|
|
959
1223
|
this.wa = [];
|
|
960
1224
|
}
|
|
@@ -1053,17 +1317,17 @@ function Tb(b, a) {
|
|
|
1053
1317
|
}
|
|
1054
1318
|
return Pb(a.g.i, a.g.j.h, this.h);
|
|
1055
1319
|
}
|
|
1056
|
-
function Ub(b, a, c, d, e, f,
|
|
1320
|
+
function Ub(b, a, c, d, e, f, l, h, n, m, r) {
|
|
1057
1321
|
this.name = b;
|
|
1058
1322
|
this.h = a;
|
|
1059
1323
|
this.ea = c;
|
|
1060
1324
|
this.U = d;
|
|
1061
1325
|
this.V = e;
|
|
1062
1326
|
this.ab = f;
|
|
1063
|
-
this.gb =
|
|
1327
|
+
this.gb = l;
|
|
1064
1328
|
this.xa = h;
|
|
1065
|
-
this.fa =
|
|
1066
|
-
this.bb =
|
|
1329
|
+
this.fa = n;
|
|
1330
|
+
this.bb = m;
|
|
1067
1331
|
this.D = r;
|
|
1068
1332
|
e || void 0 !== a.o ? this.toWireType = Sb : (this.toWireType = d ? Qb : Tb, this.B = null);
|
|
1069
1333
|
}
|
|
@@ -1107,31 +1371,31 @@ function dc(b, a, c, d, e) {
|
|
|
1107
1371
|
if (2 > f) {
|
|
1108
1372
|
throw new O("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
1109
1373
|
}
|
|
1110
|
-
var
|
|
1374
|
+
var l = null !== a[1] && null !== c, h = cc(a), n = "void" !== a[0].name, m = f - 2, r = Array(m), w = [], z = [];
|
|
1111
1375
|
return $a(b, function(...g) {
|
|
1112
|
-
if (g.length !==
|
|
1113
|
-
throw new O(`function ${b} called with ${g.length} arguments, expected ${
|
|
1376
|
+
if (g.length !== m) {
|
|
1377
|
+
throw new O(`function ${b} called with ${g.length} arguments, expected ${m}`);
|
|
1114
1378
|
}
|
|
1115
1379
|
z.length = 0;
|
|
1116
|
-
w.length =
|
|
1380
|
+
w.length = l ? 2 : 1;
|
|
1117
1381
|
w[0] = e;
|
|
1118
|
-
if (
|
|
1382
|
+
if (l) {
|
|
1119
1383
|
var t = a[1].toWireType(z, this);
|
|
1120
1384
|
w[1] = t;
|
|
1121
1385
|
}
|
|
1122
|
-
for (var q = 0; q <
|
|
1386
|
+
for (var q = 0; q < m; ++q) {
|
|
1123
1387
|
r[q] = a[q + 2].toWireType(z, g[q]), w.push(r[q]);
|
|
1124
1388
|
}
|
|
1125
1389
|
g = d(...w);
|
|
1126
1390
|
if (h) {
|
|
1127
1391
|
Db(z);
|
|
1128
1392
|
} else {
|
|
1129
|
-
for (q =
|
|
1393
|
+
for (q = l ? 1 : 2; q < a.length; q++) {
|
|
1130
1394
|
var G = 1 === q ? t : r[q - 2];
|
|
1131
1395
|
null !== a[q].B && a[q].B(G);
|
|
1132
1396
|
}
|
|
1133
1397
|
}
|
|
1134
|
-
t =
|
|
1398
|
+
t = n ? a[0].fromWireType(g) : void 0;
|
|
1135
1399
|
return t;
|
|
1136
1400
|
});
|
|
1137
1401
|
}
|
|
@@ -1220,8 +1484,8 @@ var ec = (b, a) => {
|
|
|
1220
1484
|
for (var e = 0; e < b.length; ++e) {
|
|
1221
1485
|
var f = b.charCodeAt(e);
|
|
1222
1486
|
if (55296 <= f && 57343 >= f) {
|
|
1223
|
-
var
|
|
1224
|
-
f = 65536 + ((f & 1023) << 10) |
|
|
1487
|
+
var l = b.charCodeAt(++e);
|
|
1488
|
+
f = 65536 + ((f & 1023) << 10) | l & 1023;
|
|
1225
1489
|
}
|
|
1226
1490
|
if (127 >= f) {
|
|
1227
1491
|
if (c >= d) {
|
|
@@ -1275,8 +1539,8 @@ var ec = (b, a) => {
|
|
|
1275
1539
|
if (192 == (e & 224)) {
|
|
1276
1540
|
d += String.fromCharCode((e & 31) << 6 | f);
|
|
1277
1541
|
} else {
|
|
1278
|
-
var
|
|
1279
|
-
e = 224 == (e & 240) ? (e & 15) << 12 | f << 6 |
|
|
1542
|
+
var l = b[a++] & 63;
|
|
1543
|
+
e = 224 == (e & 240) ? (e & 15) << 12 | f << 6 | l : (e & 7) << 18 | f << 12 | l << 6 | b[a++] & 63;
|
|
1280
1544
|
65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));
|
|
1281
1545
|
}
|
|
1282
1546
|
} else {
|
|
@@ -1335,8 +1599,8 @@ var ec = (b, a) => {
|
|
|
1335
1599
|
for (var e = 0; e < b.length; ++e) {
|
|
1336
1600
|
var f = b.charCodeAt(e);
|
|
1337
1601
|
if (55296 <= f && 57343 >= f) {
|
|
1338
|
-
var
|
|
1339
|
-
f = 65536 + ((f & 1023) << 10) |
|
|
1602
|
+
var l = b.charCodeAt(++e);
|
|
1603
|
+
f = 65536 + ((f & 1023) << 10) | l & 1023;
|
|
1340
1604
|
}
|
|
1341
1605
|
K[a >> 2] = f;
|
|
1342
1606
|
a += 4;
|
|
@@ -1399,7 +1663,7 @@ var Pc = (b, a, c, d) => {
|
|
|
1399
1663
|
function f(g, t) {
|
|
1400
1664
|
return e(g, t, "0");
|
|
1401
1665
|
}
|
|
1402
|
-
function
|
|
1666
|
+
function l(g, t) {
|
|
1403
1667
|
function q(F) {
|
|
1404
1668
|
return 0 > F ? -1 : 0 < F ? 1 : 0;
|
|
1405
1669
|
}
|
|
@@ -1425,7 +1689,7 @@ var Pc = (b, a, c, d) => {
|
|
|
1425
1689
|
return new Date(g.getFullYear() - 1, 11, 30);
|
|
1426
1690
|
}
|
|
1427
1691
|
}
|
|
1428
|
-
function
|
|
1692
|
+
function n(g) {
|
|
1429
1693
|
var t = g.J;
|
|
1430
1694
|
for (g = new Date((new Date(g.K + 1900, 0, 1)).getTime()); 0 < t;) {
|
|
1431
1695
|
var q = g.getMonth(), G = (Lc(g.getFullYear()) ? Mc : Nc)[q];
|
|
@@ -1439,17 +1703,17 @@ var Pc = (b, a, c, d) => {
|
|
|
1439
1703
|
q = new Date(g.getFullYear() + 1, 0, 4);
|
|
1440
1704
|
t = h(new Date(g.getFullYear(), 0, 4));
|
|
1441
1705
|
q = h(q);
|
|
1442
|
-
return 0 >=
|
|
1706
|
+
return 0 >= l(t, g) ? 0 >= l(q, g) ? g.getFullYear() + 1 : g.getFullYear() : g.getFullYear() - 1;
|
|
1443
1707
|
}
|
|
1444
|
-
var
|
|
1445
|
-
d = {jb:K[d >> 2], ib:K[d + 4 >> 2], Z:K[d + 8 >> 2], ha:K[d + 12 >> 2], $:K[d + 16 >> 2], K:K[d + 20 >> 2], F:K[d + 24 >> 2], J:K[d + 28 >> 2], ob:K[d + 32 >> 2], hb:K[d + 36 >> 2], kb:
|
|
1708
|
+
var m = M[d + 40 >> 2];
|
|
1709
|
+
d = {jb:K[d >> 2], ib:K[d + 4 >> 2], Z:K[d + 8 >> 2], ha:K[d + 12 >> 2], $:K[d + 16 >> 2], K:K[d + 20 >> 2], F:K[d + 24 >> 2], J:K[d + 28 >> 2], ob:K[d + 32 >> 2], hb:K[d + 36 >> 2], kb:m ? m ? sc(J, m) : "" : ""};
|
|
1446
1710
|
c = c ? sc(J, c) : "";
|
|
1447
|
-
|
|
1448
|
-
for (var r in
|
|
1449
|
-
c = c.replace(new RegExp(r, "g"),
|
|
1711
|
+
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",};
|
|
1712
|
+
for (var r in m) {
|
|
1713
|
+
c = c.replace(new RegExp(r, "g"), m[r]);
|
|
1450
1714
|
}
|
|
1451
1715
|
var w = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), z = "January February March April May June July August September October November December".split(" ");
|
|
1452
|
-
|
|
1716
|
+
m = {"%a":g => w[g.F].substring(0, 3), "%A":g => w[g.F], "%b":g => z[g.$].substring(0, 3), "%B":g => z[g.$], "%C":g => f((g.K + 1900) / 100 | 0, 2), "%d":g => f(g.ha, 2), "%e":g => e(g.ha, 2, " "), "%g":g => n(g).toString().substring(2), "%G":n, "%H":g => f(g.Z, 2), "%I":g => {
|
|
1453
1717
|
g = g.Z;
|
|
1454
1718
|
0 == g ? g = 12 : 12 < g && (g -= 12);
|
|
1455
1719
|
return f(g, 2);
|
|
@@ -1475,8 +1739,8 @@ var Pc = (b, a, c, d) => {
|
|
|
1475
1739
|
return (t ? "+" : "-") + String("0000" + (g / 60 * 100 + g % 60)).slice(-4);
|
|
1476
1740
|
}, "%Z":g => g.kb, "%%":() => "%"};
|
|
1477
1741
|
c = c.replace(/%%/g, "\x00\x00");
|
|
1478
|
-
for (r in
|
|
1479
|
-
c.includes(r) && (c = c.replace(new RegExp(r, "g"),
|
|
1742
|
+
for (r in m) {
|
|
1743
|
+
c.includes(r) && (c = c.replace(new RegExp(r, "g"), m[r](d)));
|
|
1480
1744
|
}
|
|
1481
1745
|
c = c.replace(/\0\0/g, "%");
|
|
1482
1746
|
r = Oc(c);
|
|
@@ -1602,11 +1866,11 @@ var Tc = {_abort_js:() => {
|
|
|
1602
1866
|
b = S(b);
|
|
1603
1867
|
a = ob(a, "wrapper");
|
|
1604
1868
|
c = R(c);
|
|
1605
|
-
var d = a.h, e = d.C, f = d.o.C,
|
|
1869
|
+
var d = a.h, e = d.C, f = d.o.C, l = d.o.constructor;
|
|
1606
1870
|
b = $a(b, function(...h) {
|
|
1607
|
-
d.o.wa.forEach(function(
|
|
1608
|
-
if (this[
|
|
1609
|
-
throw new db(`Pure virtual function ${
|
|
1871
|
+
d.o.wa.forEach(function(n) {
|
|
1872
|
+
if (this[n] === f[n]) {
|
|
1873
|
+
throw new db(`Pure virtual function ${n} must be implemented in JavaScript`);
|
|
1610
1874
|
}
|
|
1611
1875
|
}.bind(this));
|
|
1612
1876
|
Object.defineProperty(this, "__parent", {value:e});
|
|
@@ -1616,14 +1880,14 @@ var Tc = {_abort_js:() => {
|
|
|
1616
1880
|
if (this === e) {
|
|
1617
1881
|
throw new O("Pass correct 'this' to __construct");
|
|
1618
1882
|
}
|
|
1619
|
-
h =
|
|
1883
|
+
h = l.implement(this, ...h);
|
|
1620
1884
|
pb(h);
|
|
1621
|
-
var
|
|
1885
|
+
var n = h.g;
|
|
1622
1886
|
h.notifyOnDestruction();
|
|
1623
|
-
|
|
1624
|
-
Object.defineProperties(this, {g:{value:
|
|
1887
|
+
n.O = !0;
|
|
1888
|
+
Object.defineProperties(this, {g:{value:n}});
|
|
1625
1889
|
Ab(this);
|
|
1626
|
-
h =
|
|
1890
|
+
h = n.i;
|
|
1627
1891
|
h = jb(d, h);
|
|
1628
1892
|
if (ib.hasOwnProperty(h)) {
|
|
1629
1893
|
throw new O(`Tried to register registered instance: ${h}`);
|
|
@@ -1649,35 +1913,35 @@ var Tc = {_abort_js:() => {
|
|
|
1649
1913
|
}, _embind_finalize_value_object:b => {
|
|
1650
1914
|
var a = Cb[b];
|
|
1651
1915
|
delete Cb[b];
|
|
1652
|
-
var c = a.fa, d = a.D, e = a.sa, f = e.map(
|
|
1653
|
-
X([b], f,
|
|
1916
|
+
var c = a.fa, d = a.D, e = a.sa, f = e.map(l => l.Ua).concat(e.map(l => l.eb));
|
|
1917
|
+
X([b], f, l => {
|
|
1654
1918
|
var h = {};
|
|
1655
|
-
e.forEach((
|
|
1656
|
-
var r = m
|
|
1657
|
-
h[
|
|
1919
|
+
e.forEach((n, m) => {
|
|
1920
|
+
var r = l[m], w = n.Sa, z = n.Ta, g = l[m + e.length], t = n.cb, q = n.fb;
|
|
1921
|
+
h[n.Oa] = {read:G => r.fromWireType(w(z, G)), write:(G, F) => {
|
|
1658
1922
|
var v = [];
|
|
1659
1923
|
t(q, G, g.toWireType(v, F));
|
|
1660
1924
|
Db(v);
|
|
1661
1925
|
}};
|
|
1662
1926
|
});
|
|
1663
|
-
return [{name:a.name, fromWireType:
|
|
1664
|
-
var
|
|
1927
|
+
return [{name:a.name, fromWireType:n => {
|
|
1928
|
+
var m = {}, r;
|
|
1665
1929
|
for (r in h) {
|
|
1666
|
-
|
|
1930
|
+
m[r] = h[r].read(n);
|
|
1667
1931
|
}
|
|
1668
|
-
d(
|
|
1669
|
-
return
|
|
1670
|
-
}, toWireType:(
|
|
1932
|
+
d(n);
|
|
1933
|
+
return m;
|
|
1934
|
+
}, toWireType:(n, m) => {
|
|
1671
1935
|
for (var r in h) {
|
|
1672
|
-
if (!(r in
|
|
1936
|
+
if (!(r in m)) {
|
|
1673
1937
|
throw new TypeError(`Missing field: "${r}"`);
|
|
1674
1938
|
}
|
|
1675
1939
|
}
|
|
1676
1940
|
var w = c();
|
|
1677
1941
|
for (r in h) {
|
|
1678
|
-
h[r].write(w,
|
|
1942
|
+
h[r].write(w, m[r]);
|
|
1679
1943
|
}
|
|
1680
|
-
null !==
|
|
1944
|
+
null !== n && n.push(d, w);
|
|
1681
1945
|
return w;
|
|
1682
1946
|
}, argPackAdvance:8, readValueFromPointer:Eb, B:d,}];
|
|
1683
1947
|
});
|
|
@@ -1691,11 +1955,11 @@ var Tc = {_abort_js:() => {
|
|
|
1691
1955
|
}, argPackAdvance:8, readValueFromPointer:function(e) {
|
|
1692
1956
|
return this.fromWireType(J[e]);
|
|
1693
1957
|
}, B:null,});
|
|
1694
|
-
}, _embind_register_class:(b, a, c, d, e, f,
|
|
1958
|
+
}, _embind_register_class:(b, a, c, d, e, f, l, h, n, m, r, w, z) => {
|
|
1695
1959
|
r = S(r);
|
|
1696
1960
|
f = Y(e, f);
|
|
1697
|
-
h &&= Y(
|
|
1698
|
-
|
|
1961
|
+
h &&= Y(l, h);
|
|
1962
|
+
m &&= Y(n, m);
|
|
1699
1963
|
z = Y(w, z);
|
|
1700
1964
|
var g = Nb(r);
|
|
1701
1965
|
Mb(g, function() {
|
|
@@ -1724,7 +1988,7 @@ var Tc = {_abort_js:() => {
|
|
|
1724
1988
|
});
|
|
1725
1989
|
var F = Object.create(G, {constructor:{value:t},});
|
|
1726
1990
|
t.prototype = F;
|
|
1727
|
-
var v = new Ob(r, t, F, z, q, f, h,
|
|
1991
|
+
var v = new Ob(r, t, F, z, q, f, h, m);
|
|
1728
1992
|
if (v.o) {
|
|
1729
1993
|
var H;
|
|
1730
1994
|
(H = v.o).T ?? (H.T = []);
|
|
@@ -1737,25 +2001,25 @@ var Tc = {_abort_js:() => {
|
|
|
1737
2001
|
Vb(g, t);
|
|
1738
2002
|
return [q, H, G];
|
|
1739
2003
|
});
|
|
1740
|
-
}, _embind_register_class_class_function:(b, a, c, d, e, f,
|
|
2004
|
+
}, _embind_register_class_class_function:(b, a, c, d, e, f, l) => {
|
|
1741
2005
|
var h = ec(c, d);
|
|
1742
2006
|
a = S(a);
|
|
1743
2007
|
a = fc(a);
|
|
1744
2008
|
f = Y(e, f);
|
|
1745
|
-
X([], [b],
|
|
1746
|
-
function
|
|
2009
|
+
X([], [b], n => {
|
|
2010
|
+
function m() {
|
|
1747
2011
|
bc(`Cannot call ${r} due to unbound types`, h);
|
|
1748
2012
|
}
|
|
1749
|
-
|
|
1750
|
-
var r = `${
|
|
2013
|
+
n = n[0];
|
|
2014
|
+
var r = `${n.name}.${a}`;
|
|
1751
2015
|
a.startsWith("@@") && (a = Symbol[a.substring(2)]);
|
|
1752
|
-
var w =
|
|
1753
|
-
void 0 === w[a] ? (
|
|
2016
|
+
var w = n.h.constructor;
|
|
2017
|
+
void 0 === w[a] ? (m.L = c - 1, w[a] = m) : (Lb(w, a, r), w[a].l[c - 1] = m);
|
|
1754
2018
|
X([], h, z => {
|
|
1755
|
-
z = dc(r, [z[0], null].concat(z.slice(1)), null, f,
|
|
2019
|
+
z = dc(r, [z[0], null].concat(z.slice(1)), null, f, l);
|
|
1756
2020
|
void 0 === w[a].l ? (z.L = c - 1, w[a] = z) : w[a].l[c - 1] = z;
|
|
1757
|
-
if (
|
|
1758
|
-
for (const g of
|
|
2021
|
+
if (n.h.T) {
|
|
2022
|
+
for (const g of n.h.T) {
|
|
1759
2023
|
g.constructor.hasOwnProperty(a) || (g.constructor[a] = z);
|
|
1760
2024
|
}
|
|
1761
2025
|
}
|
|
@@ -1763,100 +2027,100 @@ var Tc = {_abort_js:() => {
|
|
|
1763
2027
|
});
|
|
1764
2028
|
return [];
|
|
1765
2029
|
});
|
|
1766
|
-
}, _embind_register_class_class_property:(b, a, c, d, e, f,
|
|
2030
|
+
}, _embind_register_class_class_property:(b, a, c, d, e, f, l, h) => {
|
|
1767
2031
|
a = S(a);
|
|
1768
2032
|
f = Y(e, f);
|
|
1769
|
-
X([], [b],
|
|
1770
|
-
|
|
1771
|
-
var
|
|
1772
|
-
bc(`Cannot access ${
|
|
2033
|
+
X([], [b], n => {
|
|
2034
|
+
n = n[0];
|
|
2035
|
+
var m = `${n.name}.${a}`, r = {get() {
|
|
2036
|
+
bc(`Cannot access ${m} due to unbound types`, [c]);
|
|
1773
2037
|
}, enumerable:!0, configurable:!0};
|
|
1774
2038
|
r.set = h ? () => {
|
|
1775
|
-
bc(`Cannot access ${
|
|
2039
|
+
bc(`Cannot access ${m} due to unbound types`, [c]);
|
|
1776
2040
|
} : () => {
|
|
1777
|
-
throw new O(`${
|
|
2041
|
+
throw new O(`${m} is a read-only property`);
|
|
1778
2042
|
};
|
|
1779
|
-
Object.defineProperty(
|
|
2043
|
+
Object.defineProperty(n.h.constructor, a, r);
|
|
1780
2044
|
X([], [c], w => {
|
|
1781
2045
|
w = w[0];
|
|
1782
2046
|
var z = {get() {
|
|
1783
2047
|
return w.fromWireType(f(d));
|
|
1784
2048
|
}, enumerable:!0};
|
|
1785
|
-
h && (h = Y(
|
|
2049
|
+
h && (h = Y(l, h), z.set = g => {
|
|
1786
2050
|
var t = [];
|
|
1787
2051
|
h(d, w.toWireType(t, g));
|
|
1788
2052
|
Db(t);
|
|
1789
2053
|
});
|
|
1790
|
-
Object.defineProperty(
|
|
2054
|
+
Object.defineProperty(n.h.constructor, a, z);
|
|
1791
2055
|
return [];
|
|
1792
2056
|
});
|
|
1793
2057
|
return [];
|
|
1794
2058
|
});
|
|
1795
2059
|
}, _embind_register_class_constructor:(b, a, c, d, e, f) => {
|
|
1796
|
-
var
|
|
2060
|
+
var l = ec(a, c);
|
|
1797
2061
|
e = Y(d, e);
|
|
1798
2062
|
X([], [b], h => {
|
|
1799
2063
|
h = h[0];
|
|
1800
|
-
var
|
|
2064
|
+
var n = `constructor ${h.name}`;
|
|
1801
2065
|
void 0 === h.h.I && (h.h.I = []);
|
|
1802
2066
|
if (void 0 !== h.h.I[a - 1]) {
|
|
1803
2067
|
throw new O(`Cannot register multiple constructors with identical number of parameters (${a - 1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
1804
2068
|
}
|
|
1805
2069
|
h.h.I[a - 1] = () => {
|
|
1806
|
-
bc(`Cannot construct ${h.name} due to unbound types`,
|
|
2070
|
+
bc(`Cannot construct ${h.name} due to unbound types`, l);
|
|
1807
2071
|
};
|
|
1808
|
-
X([],
|
|
1809
|
-
|
|
1810
|
-
h.h.I[a - 1] = dc(
|
|
2072
|
+
X([], l, m => {
|
|
2073
|
+
m.splice(1, 0, null);
|
|
2074
|
+
h.h.I[a - 1] = dc(n, m, null, e, f);
|
|
1811
2075
|
return [];
|
|
1812
2076
|
});
|
|
1813
2077
|
return [];
|
|
1814
2078
|
});
|
|
1815
|
-
}, _embind_register_class_function:(b, a, c, d, e, f,
|
|
1816
|
-
var
|
|
2079
|
+
}, _embind_register_class_function:(b, a, c, d, e, f, l, h) => {
|
|
2080
|
+
var n = ec(c, d);
|
|
1817
2081
|
a = S(a);
|
|
1818
2082
|
a = fc(a);
|
|
1819
2083
|
f = Y(e, f);
|
|
1820
|
-
X([], [b],
|
|
2084
|
+
X([], [b], m => {
|
|
1821
2085
|
function r() {
|
|
1822
|
-
bc(`Cannot call ${w} due to unbound types`,
|
|
2086
|
+
bc(`Cannot call ${w} due to unbound types`, n);
|
|
1823
2087
|
}
|
|
1824
|
-
|
|
1825
|
-
var w = `${
|
|
2088
|
+
m = m[0];
|
|
2089
|
+
var w = `${m.name}.${a}`;
|
|
1826
2090
|
a.startsWith("@@") && (a = Symbol[a.substring(2)]);
|
|
1827
|
-
h &&
|
|
1828
|
-
var z =
|
|
1829
|
-
void 0 === g || void 0 === g.l && g.className !==
|
|
1830
|
-
X([],
|
|
1831
|
-
t = dc(w, t,
|
|
2091
|
+
h && m.h.wa.push(a);
|
|
2092
|
+
var z = m.h.C, g = z[a];
|
|
2093
|
+
void 0 === g || void 0 === g.l && g.className !== m.name && g.L === c - 2 ? (r.L = c - 2, r.className = m.name, z[a] = r) : (Lb(z, a, w), z[a].l[c - 2] = r);
|
|
2094
|
+
X([], n, t => {
|
|
2095
|
+
t = dc(w, t, m, f, l);
|
|
1832
2096
|
void 0 === z[a].l ? (t.L = c - 2, z[a] = t) : z[a].l[c - 2] = t;
|
|
1833
2097
|
return [];
|
|
1834
2098
|
});
|
|
1835
2099
|
return [];
|
|
1836
2100
|
});
|
|
1837
|
-
}, _embind_register_class_property:(b, a, c, d, e, f,
|
|
2101
|
+
}, _embind_register_class_property:(b, a, c, d, e, f, l, h, n, m) => {
|
|
1838
2102
|
a = S(a);
|
|
1839
2103
|
e = Y(d, e);
|
|
1840
2104
|
X([], [b], r => {
|
|
1841
2105
|
r = r[0];
|
|
1842
2106
|
var w = `${r.name}.${a}`, z = {get() {
|
|
1843
|
-
bc(`Cannot access ${w} due to unbound types`, [c,
|
|
2107
|
+
bc(`Cannot access ${w} due to unbound types`, [c, l]);
|
|
1844
2108
|
}, enumerable:!0, configurable:!0};
|
|
1845
|
-
z.set =
|
|
2109
|
+
z.set = n ? () => bc(`Cannot access ${w} due to unbound types`, [c, l]) : () => {
|
|
1846
2110
|
throw new O(w + " is a read-only property");
|
|
1847
2111
|
};
|
|
1848
2112
|
Object.defineProperty(r.h.C, a, z);
|
|
1849
|
-
X([],
|
|
2113
|
+
X([], n ? [c, l] : [c], g => {
|
|
1850
2114
|
var t = g[0], q = {get() {
|
|
1851
2115
|
var F = gc(this, r, w + " getter");
|
|
1852
2116
|
return t.fromWireType(e(f, F));
|
|
1853
2117
|
}, enumerable:!0};
|
|
1854
|
-
if (
|
|
1855
|
-
|
|
2118
|
+
if (n) {
|
|
2119
|
+
n = Y(h, n);
|
|
1856
2120
|
var G = g[1];
|
|
1857
2121
|
q.set = function(F) {
|
|
1858
2122
|
var v = gc(this, r, w + " setter"), H = [];
|
|
1859
|
-
|
|
2123
|
+
n(m, v, G.toWireType(H, F));
|
|
1860
2124
|
Db(H);
|
|
1861
2125
|
};
|
|
1862
2126
|
}
|
|
@@ -1872,7 +2136,7 @@ var Tc = {_abort_js:() => {
|
|
|
1872
2136
|
e.values = {};
|
|
1873
2137
|
Hb(b, {name:a, constructor:e, fromWireType:function(f) {
|
|
1874
2138
|
return this.constructor.values[f];
|
|
1875
|
-
}, toWireType:(f,
|
|
2139
|
+
}, toWireType:(f, l) => l.value, argPackAdvance:8, readValueFromPointer:jc(a, c, d), B:null,});
|
|
1876
2140
|
Mb(a, e);
|
|
1877
2141
|
}, _embind_register_enum_value:(b, a, c) => {
|
|
1878
2142
|
var d = ob(b, "enum");
|
|
@@ -1886,14 +2150,14 @@ var Tc = {_abort_js:() => {
|
|
|
1886
2150
|
a = S(a);
|
|
1887
2151
|
Hb(b, {name:a, fromWireType:d => d, toWireType:(d, e) => e, argPackAdvance:8, readValueFromPointer:kc(a, c), B:null,});
|
|
1888
2152
|
}, _embind_register_function:(b, a, c, d, e, f) => {
|
|
1889
|
-
var
|
|
2153
|
+
var l = ec(a, c);
|
|
1890
2154
|
b = S(b);
|
|
1891
2155
|
b = fc(b);
|
|
1892
2156
|
e = Y(d, e);
|
|
1893
2157
|
Mb(b, function() {
|
|
1894
|
-
bc(`Cannot call ${b} due to unbound types`,
|
|
2158
|
+
bc(`Cannot call ${b} due to unbound types`, l);
|
|
1895
2159
|
}, a - 1);
|
|
1896
|
-
X([],
|
|
2160
|
+
X([], l, h => {
|
|
1897
2161
|
Vb(b, dc(b, [h[0], null].concat(h.slice(1)), null, e, f), a - 1);
|
|
1898
2162
|
return [];
|
|
1899
2163
|
});
|
|
@@ -1905,12 +2169,12 @@ var Tc = {_abort_js:() => {
|
|
|
1905
2169
|
var f = 32 - 8 * c;
|
|
1906
2170
|
e = h => h << f >>> f;
|
|
1907
2171
|
}
|
|
1908
|
-
var
|
|
1909
|
-
return
|
|
1910
|
-
} : function(h,
|
|
1911
|
-
return
|
|
2172
|
+
var l = a.includes("unsigned") ? function(h, n) {
|
|
2173
|
+
return n >>> 0;
|
|
2174
|
+
} : function(h, n) {
|
|
2175
|
+
return n;
|
|
1912
2176
|
};
|
|
1913
|
-
Hb(b, {name:a, fromWireType:e, toWireType:
|
|
2177
|
+
Hb(b, {name:a, fromWireType:e, toWireType:l, argPackAdvance:8, readValueFromPointer:lc(a, c, 0 !== d), B:null,});
|
|
1914
2178
|
}, _embind_register_memory_view:(b, a, c) => {
|
|
1915
2179
|
function d(f) {
|
|
1916
2180
|
return new e(Ea.buffer, M[f + 4 >> 2], M[f >> 2]);
|
|
@@ -1924,50 +2188,50 @@ var Tc = {_abort_js:() => {
|
|
|
1924
2188
|
Hb(b, {name:a, fromWireType:function(d) {
|
|
1925
2189
|
var e = M[d >> 2], f = d + 4;
|
|
1926
2190
|
if (c) {
|
|
1927
|
-
for (var
|
|
1928
|
-
var
|
|
1929
|
-
if (h == e || 0 == J[
|
|
1930
|
-
|
|
1931
|
-
if (void 0 ===
|
|
1932
|
-
var
|
|
2191
|
+
for (var l = f, h = 0; h <= e; ++h) {
|
|
2192
|
+
var n = f + h;
|
|
2193
|
+
if (h == e || 0 == J[n]) {
|
|
2194
|
+
l = l ? sc(J, l, n - l) : "";
|
|
2195
|
+
if (void 0 === m) {
|
|
2196
|
+
var m = l;
|
|
1933
2197
|
} else {
|
|
1934
|
-
|
|
2198
|
+
m += String.fromCharCode(0), m += l;
|
|
1935
2199
|
}
|
|
1936
|
-
|
|
2200
|
+
l = n + 1;
|
|
1937
2201
|
}
|
|
1938
2202
|
}
|
|
1939
2203
|
} else {
|
|
1940
|
-
|
|
2204
|
+
m = Array(e);
|
|
1941
2205
|
for (h = 0; h < e; ++h) {
|
|
1942
|
-
|
|
2206
|
+
m[h] = String.fromCharCode(J[f + h]);
|
|
1943
2207
|
}
|
|
1944
|
-
|
|
2208
|
+
m = m.join("");
|
|
1945
2209
|
}
|
|
1946
2210
|
mb(d);
|
|
1947
|
-
return
|
|
2211
|
+
return m;
|
|
1948
2212
|
}, toWireType:function(d, e) {
|
|
1949
2213
|
e instanceof ArrayBuffer && (e = new Uint8Array(e));
|
|
1950
2214
|
var f = "string" == typeof e;
|
|
1951
2215
|
if (!(f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array)) {
|
|
1952
2216
|
throw new O("Cannot pass non-string to std::string");
|
|
1953
2217
|
}
|
|
1954
|
-
var
|
|
1955
|
-
var h = Sc(4 +
|
|
1956
|
-
M[h >> 2] =
|
|
2218
|
+
var l = c && f ? nc(e) : e.length;
|
|
2219
|
+
var h = Sc(4 + l + 1), n = h + 4;
|
|
2220
|
+
M[h >> 2] = l;
|
|
1957
2221
|
if (c && f) {
|
|
1958
|
-
mc(e, J,
|
|
2222
|
+
mc(e, J, n, l + 1);
|
|
1959
2223
|
} else {
|
|
1960
2224
|
if (f) {
|
|
1961
|
-
for (f = 0; f <
|
|
1962
|
-
var
|
|
1963
|
-
if (255 <
|
|
1964
|
-
throw mb(
|
|
2225
|
+
for (f = 0; f < l; ++f) {
|
|
2226
|
+
var m = e.charCodeAt(f);
|
|
2227
|
+
if (255 < m) {
|
|
2228
|
+
throw mb(n), new O("String has UTF-16 code units that do not fit in 8 bits");
|
|
1965
2229
|
}
|
|
1966
|
-
J[
|
|
2230
|
+
J[n + f] = m;
|
|
1967
2231
|
}
|
|
1968
2232
|
} else {
|
|
1969
|
-
for (f = 0; f <
|
|
1970
|
-
J[
|
|
2233
|
+
for (f = 0; f < l; ++f) {
|
|
2234
|
+
J[n + f] = e[f];
|
|
1971
2235
|
}
|
|
1972
2236
|
}
|
|
1973
2237
|
}
|
|
@@ -1982,26 +2246,26 @@ var Tc = {_abort_js:() => {
|
|
|
1982
2246
|
var d = uc;
|
|
1983
2247
|
var e = vc;
|
|
1984
2248
|
var f = wc;
|
|
1985
|
-
var
|
|
2249
|
+
var l = h => Ga[h >> 1];
|
|
1986
2250
|
} else {
|
|
1987
|
-
4 === a && (d = xc, e = yc, f = zc,
|
|
2251
|
+
4 === a && (d = xc, e = yc, f = zc, l = h => M[h >> 2]);
|
|
1988
2252
|
}
|
|
1989
2253
|
Hb(b, {name:c, fromWireType:h => {
|
|
1990
|
-
for (var
|
|
2254
|
+
for (var n = M[h >> 2], m, r = h + 4, w = 0; w <= n; ++w) {
|
|
1991
2255
|
var z = h + 4 + w * a;
|
|
1992
|
-
if (w ==
|
|
1993
|
-
r = d(r, z - r), void 0 ===
|
|
2256
|
+
if (w == n || 0 == l(z)) {
|
|
2257
|
+
r = d(r, z - r), void 0 === m ? m = r : (m += String.fromCharCode(0), m += r), r = z + a;
|
|
1994
2258
|
}
|
|
1995
2259
|
}
|
|
1996
2260
|
mb(h);
|
|
1997
|
-
return
|
|
1998
|
-
}, toWireType:(h,
|
|
1999
|
-
if ("string" != typeof
|
|
2261
|
+
return m;
|
|
2262
|
+
}, toWireType:(h, n) => {
|
|
2263
|
+
if ("string" != typeof n) {
|
|
2000
2264
|
throw new O(`Cannot pass non-string to C++ string type ${c}`);
|
|
2001
2265
|
}
|
|
2002
|
-
var
|
|
2003
|
-
M[r >> 2] =
|
|
2004
|
-
e(
|
|
2266
|
+
var m = f(n), r = Sc(4 + m + a);
|
|
2267
|
+
M[r >> 2] = m / a;
|
|
2268
|
+
e(n, r + 4, m + a);
|
|
2005
2269
|
null !== h && h.push(mb, r);
|
|
2006
2270
|
return r;
|
|
2007
2271
|
}, argPackAdvance:8, readValueFromPointer:Eb, B(h) {
|
|
@@ -2009,8 +2273,8 @@ var Tc = {_abort_js:() => {
|
|
|
2009
2273
|
}});
|
|
2010
2274
|
}, _embind_register_value_object:(b, a, c, d, e, f) => {
|
|
2011
2275
|
Cb[b] = {name:S(a), fa:Y(c, d), D:Y(e, f), sa:[],};
|
|
2012
|
-
}, _embind_register_value_object_field:(b, a, c, d, e, f,
|
|
2013
|
-
Cb[b].sa.push({Oa:S(a), Ua:c, Sa:Y(d, e), Ta:f, eb:
|
|
2276
|
+
}, _embind_register_value_object_field:(b, a, c, d, e, f, l, h, n, m) => {
|
|
2277
|
+
Cb[b].sa.push({Oa:S(a), Ua:c, Sa:Y(d, e), Ta:f, eb:l, cb:Y(h, n), fb:m,});
|
|
2014
2278
|
}, _embind_register_void:(b, a) => {
|
|
2015
2279
|
a = S(a);
|
|
2016
2280
|
Hb(b, {mb:!0, name:a, argPackAdvance:0, fromWireType:() => {
|
|
@@ -2029,13 +2293,13 @@ var Tc = {_abort_js:() => {
|
|
|
2029
2293
|
var d = Fc(b, a), e = d.shift();
|
|
2030
2294
|
b--;
|
|
2031
2295
|
var f = Array(b);
|
|
2032
|
-
a = `methodCaller<(${d.map(
|
|
2033
|
-
return Ec($a(a, (
|
|
2296
|
+
a = `methodCaller<(${d.map(l => l.name).join(", ")}) => ${e.name}>`;
|
|
2297
|
+
return Ec($a(a, (l, h, n, m) => {
|
|
2034
2298
|
for (var r = 0, w = 0; w < b; ++w) {
|
|
2035
|
-
f[w] = d[w].readValueFromPointer(
|
|
2299
|
+
f[w] = d[w].readValueFromPointer(m + r), r += d[w].argPackAdvance;
|
|
2036
2300
|
}
|
|
2037
|
-
|
|
2038
|
-
return Ac(e,
|
|
2301
|
+
l = 1 === c ? Gc(h, f) : h.apply(l, f);
|
|
2302
|
+
return Ac(e, n, l);
|
|
2039
2303
|
}));
|
|
2040
2304
|
}, _emval_get_module_property:b => {
|
|
2041
2305
|
b = Cc(b);
|
|
@@ -2077,7 +2341,7 @@ var Tc = {_abort_js:() => {
|
|
|
2077
2341
|
Ja();
|
|
2078
2342
|
var f = 1;
|
|
2079
2343
|
break a;
|
|
2080
|
-
} catch (
|
|
2344
|
+
} catch (l) {
|
|
2081
2345
|
}
|
|
2082
2346
|
f = void 0;
|
|
2083
2347
|
}
|
|
@@ -2109,11 +2373,11 @@ var Tc = {_abort_js:() => {
|
|
|
2109
2373
|
return 70;
|
|
2110
2374
|
}, fd_write:(b, a, c, d) => {
|
|
2111
2375
|
for (var e = 0, f = 0; f < c; f++) {
|
|
2112
|
-
var
|
|
2376
|
+
var l = M[a >> 2], h = M[a + 4 >> 2];
|
|
2113
2377
|
a += 8;
|
|
2114
|
-
for (var
|
|
2115
|
-
var
|
|
2116
|
-
0 ===
|
|
2378
|
+
for (var n = 0; n < h; n++) {
|
|
2379
|
+
var m = J[l + n], r = Kc[b];
|
|
2380
|
+
0 === m || 10 === m ? ((1 === b ? za : Aa)(sc(r, 0)), r.length = 0) : r.push(m);
|
|
2117
2381
|
}
|
|
2118
2382
|
e += h;
|
|
2119
2383
|
}
|
|
@@ -2129,225 +2393,91 @@ var Tc = {_abort_js:() => {
|
|
|
2129
2393
|
Oa--;
|
|
2130
2394
|
k.monitorRunDependencies?.(Oa);
|
|
2131
2395
|
0 == Oa && (null !== Pa && (clearInterval(Pa), Pa = null), Qa && (c = Qa, Qa = null, c()));
|
|
2132
|
-
return Z;
|
|
2133
|
-
}
|
|
2134
|
-
var a = {env:Tc, wasi_snapshot_preview1:Tc,};
|
|
2135
|
-
Oa++;
|
|
2136
|
-
k.monitorRunDependencies?.(Oa);
|
|
2137
|
-
if (k.instantiateWasm) {
|
|
2138
|
-
try {
|
|
2139
|
-
return k.instantiateWasm(a, b);
|
|
2140
|
-
} catch (c) {
|
|
2141
|
-
Aa(`Module.instantiateWasm callback failed with error: ${c}`), ba(c);
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
Ta ||= Sa("canvas_advanced.wasm") ? "canvas_advanced.wasm" : k.locateFile ? k.locateFile("canvas_advanced.wasm", y) : y + "canvas_advanced.wasm";
|
|
2145
|
-
Xa(a, function(c) {
|
|
2146
|
-
b(c.instance);
|
|
2147
|
-
}).catch(ba);
|
|
2148
|
-
return {};
|
|
2149
|
-
}(), mb = b => (mb = Z.free)(b), Sc = b => (Sc = Z.malloc)(b), lb = b => (lb = Z.__getTypeName)(b);
|
|
2150
|
-
k.dynCall_jiji = (b, a, c, d, e) => (k.dynCall_jiji = Z.dynCall_jiji)(b, a, c, d, e);
|
|
2151
|
-
k.dynCall_viijii = (b, a, c, d, e, f,
|
|
2152
|
-
k.dynCall_iiiiij = (b, a, c, d, e, f,
|
|
2153
|
-
k.dynCall_iiiiijj = (b, a, c, d, e, f,
|
|
2154
|
-
k.dynCall_iiiiiijj = (b, a, c, d, e, f,
|
|
2155
|
-
var Uc;
|
|
2156
|
-
Qa = function Vc() {
|
|
2157
|
-
Uc || Wc();
|
|
2158
|
-
Uc || (Qa = Vc);
|
|
2159
|
-
};
|
|
2160
|
-
function Wc() {
|
|
2161
|
-
function b() {
|
|
2162
|
-
if (!Uc && (Uc = !0, k.calledRun = !0, !Da)) {
|
|
2163
|
-
Za(La);
|
|
2164
|
-
aa(k);
|
|
2165
|
-
if (k.onRuntimeInitialized) {
|
|
2166
|
-
k.onRuntimeInitialized();
|
|
2167
|
-
}
|
|
2168
|
-
if (k.postRun) {
|
|
2169
|
-
for ("function" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length;) {
|
|
2170
|
-
var a = k.postRun.shift();
|
|
2171
|
-
Ma.unshift(a);
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
Za(Ma);
|
|
2175
|
-
}
|
|
2176
|
-
}
|
|
2177
|
-
if (!(0 < Oa)) {
|
|
2178
|
-
if (k.preRun) {
|
|
2179
|
-
for ("function" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length;) {
|
|
2180
|
-
Na();
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
Za(Ka);
|
|
2184
|
-
0 < Oa || (k.setStatus ? (k.setStatus("Running..."), setTimeout(function() {
|
|
2185
|
-
setTimeout(function() {
|
|
2186
|
-
k.setStatus("");
|
|
2187
|
-
}, 1);
|
|
2188
|
-
b();
|
|
2189
|
-
}, 1)) : b());
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
if (k.preInit) {
|
|
2193
|
-
for ("function" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length;) {
|
|
2194
|
-
k.preInit.pop()();
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
Wc();
|
|
2198
|
-
moduleRtn = da;
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
return moduleRtn;
|
|
2203
|
-
}
|
|
2204
|
-
);
|
|
2205
|
-
})();
|
|
2206
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
/***/ }),
|
|
2210
|
-
/* 2 */
|
|
2211
|
-
/***/ ((module) => {
|
|
2212
|
-
|
|
2213
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.35.4","description":"A lite version of Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
2214
|
-
|
|
2215
|
-
/***/ }),
|
|
2216
|
-
/* 3 */
|
|
2217
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2218
|
-
|
|
2219
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2220
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2221
|
-
/* harmony export */ Animation: () => (/* reexport safe */ _Animation__WEBPACK_IMPORTED_MODULE_0__.Animation)
|
|
2222
|
-
/* harmony export */ });
|
|
2223
|
-
/* harmony import */ var _Animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
/***/ }),
|
|
2228
|
-
/* 4 */
|
|
2229
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2230
|
-
|
|
2231
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2232
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2233
|
-
/* harmony export */ Animation: () => (/* binding */ Animation)
|
|
2234
|
-
/* harmony export */ });
|
|
2235
|
-
/**
|
|
2236
|
-
* Represents an animation that can be played on an Artboard.
|
|
2237
|
-
* Wraps animations and instances from the runtime and keeps track of playback state.
|
|
2238
|
-
*
|
|
2239
|
-
* The `Animation` class manages the state and behavior of a single animation instance,
|
|
2240
|
-
* including its current time, loop count, and ability to scrub to a specific time.
|
|
2241
|
-
*
|
|
2242
|
-
* The class provides methods to advance the animation, apply its interpolated keyframe
|
|
2243
|
-
* values to the Artboard, and clean up the underlying animation instance when the
|
|
2244
|
-
* animation is no longer needed.
|
|
2245
|
-
*/
|
|
2246
|
-
var Animation = /** @class */ (function () {
|
|
2247
|
-
/**
|
|
2248
|
-
* Constructs a new animation
|
|
2249
|
-
* @constructor
|
|
2250
|
-
* @param {any} animation: runtime animation object
|
|
2251
|
-
* @param {any} instance: runtime animation instance object
|
|
2252
|
-
*/
|
|
2253
|
-
function Animation(animation, artboard, runtime, playing) {
|
|
2254
|
-
this.animation = animation;
|
|
2255
|
-
this.artboard = artboard;
|
|
2256
|
-
this.playing = playing;
|
|
2257
|
-
this.loopCount = 0;
|
|
2258
|
-
/**
|
|
2259
|
-
* The time to which the animation should move to on the next render.
|
|
2260
|
-
* If not null, the animation will scrub to this time instead of advancing by the given time.
|
|
2261
|
-
*/
|
|
2262
|
-
this.scrubTo = null;
|
|
2263
|
-
this.instance = new runtime.LinearAnimationInstance(animation, artboard);
|
|
2264
|
-
}
|
|
2265
|
-
Object.defineProperty(Animation.prototype, "name", {
|
|
2266
|
-
/**
|
|
2267
|
-
* Returns the animation's name
|
|
2268
|
-
*/
|
|
2269
|
-
get: function () {
|
|
2270
|
-
return this.animation.name;
|
|
2271
|
-
},
|
|
2272
|
-
enumerable: false,
|
|
2273
|
-
configurable: true
|
|
2274
|
-
});
|
|
2275
|
-
Object.defineProperty(Animation.prototype, "time", {
|
|
2276
|
-
/**
|
|
2277
|
-
* Returns the animation's name
|
|
2278
|
-
*/
|
|
2279
|
-
get: function () {
|
|
2280
|
-
return this.instance.time;
|
|
2281
|
-
},
|
|
2282
|
-
/**
|
|
2283
|
-
* Sets the animation's current time
|
|
2284
|
-
*/
|
|
2285
|
-
set: function (value) {
|
|
2286
|
-
this.instance.time = value;
|
|
2287
|
-
},
|
|
2288
|
-
enumerable: false,
|
|
2289
|
-
configurable: true
|
|
2290
|
-
});
|
|
2291
|
-
Object.defineProperty(Animation.prototype, "loopValue", {
|
|
2292
|
-
/**
|
|
2293
|
-
* Returns the animation's loop type
|
|
2294
|
-
*/
|
|
2295
|
-
get: function () {
|
|
2296
|
-
return this.animation.loopValue;
|
|
2297
|
-
},
|
|
2298
|
-
enumerable: false,
|
|
2299
|
-
configurable: true
|
|
2300
|
-
});
|
|
2301
|
-
Object.defineProperty(Animation.prototype, "needsScrub", {
|
|
2302
|
-
/**
|
|
2303
|
-
* Indicates whether the animation needs to be scrubbed.
|
|
2304
|
-
* @returns `true` if the animation needs to be scrubbed, `false` otherwise.
|
|
2305
|
-
*/
|
|
2306
|
-
get: function () {
|
|
2307
|
-
return this.scrubTo !== null;
|
|
2308
|
-
},
|
|
2309
|
-
enumerable: false,
|
|
2310
|
-
configurable: true
|
|
2311
|
-
});
|
|
2312
|
-
/**
|
|
2313
|
-
* Advances the animation by the give time. If the animation needs scrubbing,
|
|
2314
|
-
* time is ignored and the stored scrub value is used.
|
|
2315
|
-
* @param time the time to advance the animation by if no scrubbing required
|
|
2316
|
-
*/
|
|
2317
|
-
Animation.prototype.advance = function (time) {
|
|
2318
|
-
if (this.scrubTo === null) {
|
|
2319
|
-
this.instance.advance(time);
|
|
2320
|
-
}
|
|
2321
|
-
else {
|
|
2322
|
-
this.instance.time = 0;
|
|
2323
|
-
this.instance.advance(this.scrubTo);
|
|
2324
|
-
this.scrubTo = null;
|
|
2396
|
+
return Z;
|
|
2397
|
+
}
|
|
2398
|
+
var a = {env:Tc, wasi_snapshot_preview1:Tc,};
|
|
2399
|
+
Oa++;
|
|
2400
|
+
k.monitorRunDependencies?.(Oa);
|
|
2401
|
+
if (k.instantiateWasm) {
|
|
2402
|
+
try {
|
|
2403
|
+
return k.instantiateWasm(a, b);
|
|
2404
|
+
} catch (c) {
|
|
2405
|
+
Aa(`Module.instantiateWasm callback failed with error: ${c}`), ba(c);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
Ta ||= Sa("canvas_advanced.wasm") ? "canvas_advanced.wasm" : k.locateFile ? k.locateFile("canvas_advanced.wasm", y) : y + "canvas_advanced.wasm";
|
|
2409
|
+
Xa(a, function(c) {
|
|
2410
|
+
b(c.instance);
|
|
2411
|
+
}).catch(ba);
|
|
2412
|
+
return {};
|
|
2413
|
+
}(), mb = b => (mb = Z.free)(b), Sc = b => (Sc = Z.malloc)(b), lb = b => (lb = Z.__getTypeName)(b);
|
|
2414
|
+
k.dynCall_jiji = (b, a, c, d, e) => (k.dynCall_jiji = Z.dynCall_jiji)(b, a, c, d, e);
|
|
2415
|
+
k.dynCall_viijii = (b, a, c, d, e, f, l) => (k.dynCall_viijii = Z.dynCall_viijii)(b, a, c, d, e, f, l);
|
|
2416
|
+
k.dynCall_iiiiij = (b, a, c, d, e, f, l) => (k.dynCall_iiiiij = Z.dynCall_iiiiij)(b, a, c, d, e, f, l);
|
|
2417
|
+
k.dynCall_iiiiijj = (b, a, c, d, e, f, l, h, n) => (k.dynCall_iiiiijj = Z.dynCall_iiiiijj)(b, a, c, d, e, f, l, h, n);
|
|
2418
|
+
k.dynCall_iiiiiijj = (b, a, c, d, e, f, l, h, n, m) => (k.dynCall_iiiiiijj = Z.dynCall_iiiiiijj)(b, a, c, d, e, f, l, h, n, m);
|
|
2419
|
+
var Uc;
|
|
2420
|
+
Qa = function Vc() {
|
|
2421
|
+
Uc || Wc();
|
|
2422
|
+
Uc || (Qa = Vc);
|
|
2423
|
+
};
|
|
2424
|
+
function Wc() {
|
|
2425
|
+
function b() {
|
|
2426
|
+
if (!Uc && (Uc = !0, k.calledRun = !0, !Da)) {
|
|
2427
|
+
Za(La);
|
|
2428
|
+
aa(k);
|
|
2429
|
+
if (k.onRuntimeInitialized) {
|
|
2430
|
+
k.onRuntimeInitialized();
|
|
2431
|
+
}
|
|
2432
|
+
if (k.postRun) {
|
|
2433
|
+
for ("function" == typeof k.postRun && (k.postRun = [k.postRun]); k.postRun.length;) {
|
|
2434
|
+
var a = k.postRun.shift();
|
|
2435
|
+
Ma.unshift(a);
|
|
2325
2436
|
}
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2437
|
+
}
|
|
2438
|
+
Za(Ma);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
if (!(0 < Oa)) {
|
|
2442
|
+
if (k.preRun) {
|
|
2443
|
+
for ("function" == typeof k.preRun && (k.preRun = [k.preRun]); k.preRun.length;) {
|
|
2444
|
+
Na();
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
Za(Ka);
|
|
2448
|
+
0 < Oa || (k.setStatus ? (k.setStatus("Running..."), setTimeout(function() {
|
|
2449
|
+
setTimeout(function() {
|
|
2450
|
+
k.setStatus("");
|
|
2451
|
+
}, 1);
|
|
2452
|
+
b();
|
|
2453
|
+
}, 1)) : b());
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
if (k.preInit) {
|
|
2457
|
+
for ("function" == typeof k.preInit && (k.preInit = [k.preInit]); 0 < k.preInit.length;) {
|
|
2458
|
+
k.preInit.pop()();
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
Wc();
|
|
2462
|
+
moduleRtn = da;
|
|
2463
|
+
|
|
2464
|
+
|
|
2346
2465
|
|
|
2466
|
+
return moduleRtn;
|
|
2467
|
+
}
|
|
2468
|
+
);
|
|
2469
|
+
})();
|
|
2470
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
|
|
2347
2471
|
|
|
2348
2472
|
|
|
2349
2473
|
/***/ }),
|
|
2350
2474
|
/* 5 */
|
|
2475
|
+
/***/ ((module) => {
|
|
2476
|
+
|
|
2477
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.37.0","description":"A lite version of Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
2478
|
+
|
|
2479
|
+
/***/ }),
|
|
2480
|
+
/* 6 */
|
|
2351
2481
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2352
2482
|
|
|
2353
2483
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -2362,21 +2492,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2362
2492
|
/* harmony export */ FontWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.FontWrapper),
|
|
2363
2493
|
/* harmony export */ ImageAssetWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageAssetWrapper),
|
|
2364
2494
|
/* harmony export */ ImageWrapper: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.ImageWrapper),
|
|
2495
|
+
/* harmony export */ RiveFont: () => (/* reexport safe */ _riveFont__WEBPACK_IMPORTED_MODULE_3__.RiveFont),
|
|
2365
2496
|
/* harmony export */ createFinalization: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.createFinalization),
|
|
2366
2497
|
/* harmony export */ finalizationRegistry: () => (/* reexport safe */ _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry),
|
|
2367
2498
|
/* harmony export */ registerTouchInteractions: () => (/* reexport safe */ _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__.registerTouchInteractions),
|
|
2368
2499
|
/* harmony export */ sanitizeUrl: () => (/* reexport safe */ _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__.sanitizeUrl)
|
|
2369
2500
|
/* harmony export */ });
|
|
2370
|
-
/* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2371
|
-
/* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2372
|
-
/* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
2501
|
+
/* harmony import */ var _registerTouchInteractions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
|
2502
|
+
/* harmony import */ var _sanitizeUrl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
|
|
2503
|
+
/* harmony import */ var _finalizationRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
|
|
2504
|
+
/* harmony import */ var _riveFont__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
|
|
2505
|
+
|
|
2373
2506
|
|
|
2374
2507
|
|
|
2375
2508
|
|
|
2376
2509
|
|
|
2377
2510
|
|
|
2378
2511
|
/***/ }),
|
|
2379
|
-
/*
|
|
2512
|
+
/* 7 */
|
|
2380
2513
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2381
2514
|
|
|
2382
2515
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -2630,7 +2763,7 @@ var registerTouchInteractions = function (_a) {
|
|
|
2630
2763
|
|
|
2631
2764
|
|
|
2632
2765
|
/***/ }),
|
|
2633
|
-
/*
|
|
2766
|
+
/* 8 */
|
|
2634
2767
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2635
2768
|
|
|
2636
2769
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -2683,7 +2816,7 @@ function sanitizeUrl(url) {
|
|
|
2683
2816
|
|
|
2684
2817
|
|
|
2685
2818
|
/***/ }),
|
|
2686
|
-
/*
|
|
2819
|
+
/* 9 */
|
|
2687
2820
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2688
2821
|
|
|
2689
2822
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -2961,6 +3094,79 @@ var createFinalization = function (target, finalizable) {
|
|
|
2961
3094
|
|
|
2962
3095
|
|
|
2963
3096
|
|
|
3097
|
+
/***/ }),
|
|
3098
|
+
/* 10 */
|
|
3099
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3100
|
+
|
|
3101
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3102
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3103
|
+
/* harmony export */ RiveFont: () => (/* binding */ RiveFont)
|
|
3104
|
+
/* harmony export */ });
|
|
3105
|
+
/* harmony import */ var _runtimeLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
3106
|
+
|
|
3107
|
+
// Class to manage fallback fonts for Rive.
|
|
3108
|
+
var RiveFont = /** @class */ (function () {
|
|
3109
|
+
// Class is never instantiated
|
|
3110
|
+
function RiveFont() {
|
|
3111
|
+
}
|
|
3112
|
+
/**
|
|
3113
|
+
* Set a callback to dynamically set a list of fallback fonts based on the missing glyph and/or style of the default font.
|
|
3114
|
+
* Set null to clear the callback.
|
|
3115
|
+
* @param fontCallback Callback to set a list of fallback fonts.
|
|
3116
|
+
*/
|
|
3117
|
+
RiveFont.setFallbackFontCallback = function (fontCallback) {
|
|
3118
|
+
RiveFont._fallbackFontCallback = fontCallback !== null && fontCallback !== void 0 ? fontCallback : null;
|
|
3119
|
+
RiveFont._wireFallbackProc();
|
|
3120
|
+
};
|
|
3121
|
+
// Get the pointer value to the Embind Font object from FontWrapper
|
|
3122
|
+
RiveFont._fontToPtr = function (fontWrapper) {
|
|
3123
|
+
var _a;
|
|
3124
|
+
if (fontWrapper == null)
|
|
3125
|
+
return null;
|
|
3126
|
+
var embindFont = fontWrapper.nativeFont;
|
|
3127
|
+
var ptr = (_a = embindFont === null || embindFont === void 0 ? void 0 : embindFont.ptr) === null || _a === void 0 ? void 0 : _a.call(embindFont);
|
|
3128
|
+
return ptr !== null && ptr !== void 0 ? ptr : null;
|
|
3129
|
+
};
|
|
3130
|
+
RiveFont._getFallbackPtr = function (fonts, index) {
|
|
3131
|
+
if (index < 0 || index >= fonts.length)
|
|
3132
|
+
return null;
|
|
3133
|
+
return RiveFont._fontToPtr(fonts[index]);
|
|
3134
|
+
};
|
|
3135
|
+
// Create the callback Rive expects to use for fallback fonts (regardless if set via a user-supplied static list, or callback)
|
|
3136
|
+
// 1. Ensure WASM is ready
|
|
3137
|
+
// 2. Bias for checking user callback over static list of fonts and pass it down to Rive to store as reference
|
|
3138
|
+
// - When calling the user callback, check if we have any fonts left to check, and if not, return null to indicate there are no more fallbacks to try.
|
|
3139
|
+
// - If the user callback returns an array of fonts, pass the pointer value to Rive of the font to try
|
|
3140
|
+
// 3. If no callback is provided, or the callback returns null, try the static list of fonts if they set any
|
|
3141
|
+
// 4. If no fallback method is set, return null.
|
|
3142
|
+
RiveFont._wireFallbackProc = function () {
|
|
3143
|
+
_runtimeLoader__WEBPACK_IMPORTED_MODULE_0__.RuntimeLoader.getInstance(function (rive) {
|
|
3144
|
+
var cb = RiveFont._fallbackFontCallback;
|
|
3145
|
+
if (cb) {
|
|
3146
|
+
rive.setFallbackFontCallback((function (missingGlyph, fallbackFontIndex, weight) {
|
|
3147
|
+
var fontsReturned = cb(missingGlyph, weight);
|
|
3148
|
+
if (fontsReturned) {
|
|
3149
|
+
if (Array.isArray(fontsReturned)) {
|
|
3150
|
+
return RiveFont._getFallbackPtr(fontsReturned, fallbackFontIndex);
|
|
3151
|
+
}
|
|
3152
|
+
// If the user callback only returns a single font, provide it to Rive the first time, otherwise if Rive
|
|
3153
|
+
// calls back a second time, return null to indicate there are no more fallbacks to try.
|
|
3154
|
+
return fallbackFontIndex === 0 ? RiveFont._fontToPtr(fontsReturned) : null;
|
|
3155
|
+
}
|
|
3156
|
+
return null;
|
|
3157
|
+
}));
|
|
3158
|
+
}
|
|
3159
|
+
else {
|
|
3160
|
+
rive.setFallbackFontCallback(null);
|
|
3161
|
+
}
|
|
3162
|
+
});
|
|
3163
|
+
};
|
|
3164
|
+
RiveFont._fallbackFontCallback = null;
|
|
3165
|
+
return RiveFont;
|
|
3166
|
+
}());
|
|
3167
|
+
|
|
3168
|
+
|
|
3169
|
+
|
|
2964
3170
|
/***/ })
|
|
2965
3171
|
/******/ ]);
|
|
2966
3172
|
/************************************************************************/
|
|
@@ -3034,7 +3240,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3034
3240
|
/* harmony export */ Rive: () => (/* binding */ Rive),
|
|
3035
3241
|
/* harmony export */ RiveEventType: () => (/* binding */ RiveEventType),
|
|
3036
3242
|
/* harmony export */ RiveFile: () => (/* binding */ RiveFile),
|
|
3037
|
-
/* harmony export */
|
|
3243
|
+
/* harmony export */ RiveFont: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.RiveFont),
|
|
3244
|
+
/* harmony export */ RuntimeLoader: () => (/* reexport safe */ _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader),
|
|
3038
3245
|
/* harmony export */ StateMachineInput: () => (/* binding */ StateMachineInput),
|
|
3039
3246
|
/* harmony export */ StateMachineInputType: () => (/* binding */ StateMachineInputType),
|
|
3040
3247
|
/* harmony export */ Testing: () => (/* binding */ Testing),
|
|
@@ -3054,10 +3261,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3054
3261
|
/* harmony export */ decodeFont: () => (/* binding */ decodeFont),
|
|
3055
3262
|
/* harmony export */ decodeImage: () => (/* binding */ decodeImage)
|
|
3056
3263
|
/* harmony export */ });
|
|
3057
|
-
/* harmony import */ var
|
|
3058
|
-
/* harmony import */ var
|
|
3059
|
-
/* harmony import */ var
|
|
3060
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
|
|
3264
|
+
/* harmony import */ var _animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
3265
|
+
/* harmony import */ var _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
|
3266
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
|
|
3061
3267
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3062
3268
|
var extendStatics = function (d, b) {
|
|
3063
3269
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -3132,7 +3338,6 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
|
3132
3338
|
|
|
3133
3339
|
|
|
3134
3340
|
|
|
3135
|
-
|
|
3136
3341
|
var RiveError = /** @class */ (function (_super) {
|
|
3137
3342
|
__extends(RiveError, _super);
|
|
3138
3343
|
function RiveError() {
|
|
@@ -3142,6 +3347,7 @@ var RiveError = /** @class */ (function (_super) {
|
|
|
3142
3347
|
}
|
|
3143
3348
|
return RiveError;
|
|
3144
3349
|
}(Error));
|
|
3350
|
+
|
|
3145
3351
|
// #regions helpers
|
|
3146
3352
|
var resolveErrorMessage = function (error) {
|
|
3147
3353
|
return error && error.isHandledError
|
|
@@ -3266,104 +3472,8 @@ var Layout = /** @class */ (function () {
|
|
|
3266
3472
|
return Layout;
|
|
3267
3473
|
}());
|
|
3268
3474
|
|
|
3269
|
-
//
|
|
3270
|
-
//
|
|
3271
|
-
var RuntimeLoader = /** @class */ (function () {
|
|
3272
|
-
// Class is never instantiated
|
|
3273
|
-
function RuntimeLoader() {
|
|
3274
|
-
}
|
|
3275
|
-
// Loads the runtime
|
|
3276
|
-
RuntimeLoader.loadRuntime = function () {
|
|
3277
|
-
_rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
|
|
3278
|
-
// Loads Wasm bundle
|
|
3279
|
-
locateFile: function () { return RuntimeLoader.wasmURL; },
|
|
3280
|
-
})
|
|
3281
|
-
.then(function (rive) {
|
|
3282
|
-
var _a;
|
|
3283
|
-
RuntimeLoader.runtime = rive;
|
|
3284
|
-
// Fire all the callbacks
|
|
3285
|
-
while (RuntimeLoader.callBackQueue.length > 0) {
|
|
3286
|
-
(_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
|
|
3287
|
-
}
|
|
3288
|
-
})
|
|
3289
|
-
.catch(function (error) {
|
|
3290
|
-
// Capture specific error details
|
|
3291
|
-
var errorDetails = {
|
|
3292
|
-
message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error",
|
|
3293
|
-
type: (error === null || error === void 0 ? void 0 : error.name) || "Error",
|
|
3294
|
-
// Some browsers may provide additional WebAssembly-specific details
|
|
3295
|
-
wasmError: error instanceof WebAssembly.CompileError ||
|
|
3296
|
-
error instanceof WebAssembly.RuntimeError,
|
|
3297
|
-
originalError: error,
|
|
3298
|
-
};
|
|
3299
|
-
// Log detailed error for debugging
|
|
3300
|
-
console.debug("Rive WASM load error details:", errorDetails);
|
|
3301
|
-
// In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
|
|
3302
|
-
// This `rive_fallback.wasm` is compiled to support older architecture.
|
|
3303
|
-
// TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
|
|
3304
|
-
var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
|
|
3305
|
-
if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
|
|
3306
|
-
console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
|
|
3307
|
-
RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
|
|
3308
|
-
RuntimeLoader.loadRuntime();
|
|
3309
|
-
}
|
|
3310
|
-
else {
|
|
3311
|
-
var errorMessage = [
|
|
3312
|
-
"Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
|
|
3313
|
-
"Possible reasons:",
|
|
3314
|
-
"- Network connection is down",
|
|
3315
|
-
"- WebAssembly is not supported in this environment",
|
|
3316
|
-
"- The WASM file is corrupted or incompatible",
|
|
3317
|
-
"\nError details:",
|
|
3318
|
-
"- Type: ".concat(errorDetails.type),
|
|
3319
|
-
"- Message: ".concat(errorDetails.message),
|
|
3320
|
-
"- WebAssembly-specific error: ".concat(errorDetails.wasmError),
|
|
3321
|
-
"\nTo resolve, you may need to:",
|
|
3322
|
-
"1. Check your network connection",
|
|
3323
|
-
"2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
|
|
3324
|
-
"3. Call RuntimeLoader.loadRuntime() again",
|
|
3325
|
-
].join("\n");
|
|
3326
|
-
console.error(errorMessage);
|
|
3327
|
-
}
|
|
3328
|
-
});
|
|
3329
|
-
};
|
|
3330
|
-
// Provides a runtime instance via a callback
|
|
3331
|
-
RuntimeLoader.getInstance = function (callback) {
|
|
3332
|
-
// If it's not loading, start loading runtime
|
|
3333
|
-
if (!RuntimeLoader.isLoading) {
|
|
3334
|
-
RuntimeLoader.isLoading = true;
|
|
3335
|
-
RuntimeLoader.loadRuntime();
|
|
3336
|
-
}
|
|
3337
|
-
if (!RuntimeLoader.runtime) {
|
|
3338
|
-
RuntimeLoader.callBackQueue.push(callback);
|
|
3339
|
-
}
|
|
3340
|
-
else {
|
|
3341
|
-
callback(RuntimeLoader.runtime);
|
|
3342
|
-
}
|
|
3343
|
-
};
|
|
3344
|
-
// Provides a runtime instance via a promise
|
|
3345
|
-
RuntimeLoader.awaitInstance = function () {
|
|
3346
|
-
return new Promise(function (resolve) {
|
|
3347
|
-
return RuntimeLoader.getInstance(function (rive) { return resolve(rive); });
|
|
3348
|
-
});
|
|
3349
|
-
};
|
|
3350
|
-
// Manually sets the wasm url
|
|
3351
|
-
RuntimeLoader.setWasmUrl = function (url) {
|
|
3352
|
-
RuntimeLoader.wasmURL = url;
|
|
3353
|
-
};
|
|
3354
|
-
// Gets the current wasm url
|
|
3355
|
-
RuntimeLoader.getWasmUrl = function () {
|
|
3356
|
-
return RuntimeLoader.wasmURL;
|
|
3357
|
-
};
|
|
3358
|
-
// Flag to indicate that loading has started/completed
|
|
3359
|
-
RuntimeLoader.isLoading = false;
|
|
3360
|
-
// List of callbacks for the runtime that come in while loading
|
|
3361
|
-
RuntimeLoader.callBackQueue = [];
|
|
3362
|
-
// Path to the Wasm file; default path works for testing only;
|
|
3363
|
-
// if embedded wasm is used then this is never used.
|
|
3364
|
-
RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
|
|
3365
|
-
return RuntimeLoader;
|
|
3366
|
-
}());
|
|
3475
|
+
// #endregion
|
|
3476
|
+
// #region runtime
|
|
3367
3477
|
|
|
3368
3478
|
// #endregion
|
|
3369
3479
|
// #region state machines
|
|
@@ -3642,7 +3752,7 @@ var Animator = /** @class */ (function () {
|
|
|
3642
3752
|
// Try to create a new animation instance
|
|
3643
3753
|
var anim = this.artboard.animationByName(animatables[i]);
|
|
3644
3754
|
if (anim) {
|
|
3645
|
-
var newAnimation = new
|
|
3755
|
+
var newAnimation = new _animation__WEBPACK_IMPORTED_MODULE_0__.Animation(anim, this.artboard, this.runtime, playing);
|
|
3646
3756
|
// Display the first frame of the specified animation
|
|
3647
3757
|
newAnimation.advance(0);
|
|
3648
3758
|
newAnimation.apply(1.0);
|
|
@@ -3696,7 +3806,7 @@ var Animator = /** @class */ (function () {
|
|
|
3696
3806
|
// Try to create a new animation instance
|
|
3697
3807
|
var anim = this.artboard.animationByName(animatables[i]);
|
|
3698
3808
|
if (anim) {
|
|
3699
|
-
var newAnimation = new
|
|
3809
|
+
var newAnimation = new _animation__WEBPACK_IMPORTED_MODULE_0__.Animation(anim, this.artboard, this.runtime, playing);
|
|
3700
3810
|
// Display the first frame of the specified animation
|
|
3701
3811
|
newAnimation.advance(0);
|
|
3702
3812
|
newAnimation.apply(1.0);
|
|
@@ -4299,6 +4409,8 @@ var RiveFile = /** @class */ (function () {
|
|
|
4299
4409
|
function RiveFile(params) {
|
|
4300
4410
|
// Allow the runtime to automatically load assets hosted in Rive's runtime.
|
|
4301
4411
|
this.enableRiveAssetCDN = true;
|
|
4412
|
+
// When true, emits performance.mark/measure entries during RiveFile load.
|
|
4413
|
+
this.enablePerfMarks = false;
|
|
4302
4414
|
this.referenceCount = 0;
|
|
4303
4415
|
this.destroyed = false;
|
|
4304
4416
|
this.selfUnref = false;
|
|
@@ -4311,6 +4423,9 @@ var RiveFile = /** @class */ (function () {
|
|
|
4311
4423
|
typeof params.enableRiveAssetCDN == "boolean"
|
|
4312
4424
|
? params.enableRiveAssetCDN
|
|
4313
4425
|
: true;
|
|
4426
|
+
this.enablePerfMarks = !!params.enablePerfMarks;
|
|
4427
|
+
if (this.enablePerfMarks)
|
|
4428
|
+
_runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.enablePerfMarks = true;
|
|
4314
4429
|
// New event management system
|
|
4315
4430
|
this.eventManager = new EventManager();
|
|
4316
4431
|
if (params.onLoad)
|
|
@@ -4336,7 +4451,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
4336
4451
|
return __generator(this, function (_c) {
|
|
4337
4452
|
switch (_c.label) {
|
|
4338
4453
|
case 0:
|
|
4339
|
-
if (!this.src) return [3 /*break*/, 2];
|
|
4454
|
+
if (!(this.src && !this.buffer)) return [3 /*break*/, 2];
|
|
4340
4455
|
_a = this;
|
|
4341
4456
|
return [4 /*yield*/, loadRiveFile(this.src)];
|
|
4342
4457
|
case 1:
|
|
@@ -4347,17 +4462,22 @@ var RiveFile = /** @class */ (function () {
|
|
|
4347
4462
|
return [2 /*return*/];
|
|
4348
4463
|
}
|
|
4349
4464
|
if (this.assetLoader) {
|
|
4350
|
-
loaderWrapper = new
|
|
4465
|
+
loaderWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.CustomFileAssetLoaderWrapper(this.runtime, this.assetLoader);
|
|
4351
4466
|
loader = loaderWrapper.assetLoader;
|
|
4352
4467
|
}
|
|
4353
4468
|
// Load the Rive file
|
|
4469
|
+
if (this.enablePerfMarks)
|
|
4470
|
+
performance.mark('rive:file-load:start');
|
|
4354
4471
|
_b = this;
|
|
4355
4472
|
return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN)];
|
|
4356
4473
|
case 3:
|
|
4357
|
-
// Load the Rive file
|
|
4358
4474
|
_b.file = _c.sent();
|
|
4359
|
-
|
|
4360
|
-
|
|
4475
|
+
if (this.enablePerfMarks) {
|
|
4476
|
+
performance.mark('rive:file-load:end');
|
|
4477
|
+
performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');
|
|
4478
|
+
}
|
|
4479
|
+
fileFinalizer = new _utils__WEBPACK_IMPORTED_MODULE_2__.FileFinalizer(this.file);
|
|
4480
|
+
_utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(this, fileFinalizer);
|
|
4361
4481
|
if (this.destroyed) {
|
|
4362
4482
|
this.releaseFile();
|
|
4363
4483
|
return [2 /*return*/];
|
|
@@ -4376,9 +4496,45 @@ var RiveFile = /** @class */ (function () {
|
|
|
4376
4496
|
});
|
|
4377
4497
|
});
|
|
4378
4498
|
};
|
|
4499
|
+
RiveFile.prototype.loadRiveFileBytes = function () {
|
|
4500
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4501
|
+
var bufferPromise;
|
|
4502
|
+
return __generator(this, function (_a) {
|
|
4503
|
+
if (this.enablePerfMarks)
|
|
4504
|
+
performance.mark('rive:fetch-riv:start');
|
|
4505
|
+
bufferPromise = this.src
|
|
4506
|
+
? loadRiveFile(this.src)
|
|
4507
|
+
: Promise.resolve(this.buffer);
|
|
4508
|
+
if (this.enablePerfMarks && this.src) {
|
|
4509
|
+
bufferPromise.then(function () {
|
|
4510
|
+
performance.mark('rive:fetch-riv:end');
|
|
4511
|
+
performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');
|
|
4512
|
+
});
|
|
4513
|
+
}
|
|
4514
|
+
return [2 /*return*/, bufferPromise];
|
|
4515
|
+
});
|
|
4516
|
+
});
|
|
4517
|
+
};
|
|
4518
|
+
RiveFile.prototype.loadRuntime = function () {
|
|
4519
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4520
|
+
var runtimePromise;
|
|
4521
|
+
return __generator(this, function (_a) {
|
|
4522
|
+
if (this.enablePerfMarks)
|
|
4523
|
+
performance.mark('rive:await-wasm:start');
|
|
4524
|
+
runtimePromise = _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.awaitInstance();
|
|
4525
|
+
if (this.enablePerfMarks) {
|
|
4526
|
+
runtimePromise.then(function () {
|
|
4527
|
+
performance.mark('rive:await-wasm:end');
|
|
4528
|
+
performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');
|
|
4529
|
+
});
|
|
4530
|
+
}
|
|
4531
|
+
return [2 /*return*/, runtimePromise];
|
|
4532
|
+
});
|
|
4533
|
+
});
|
|
4534
|
+
};
|
|
4379
4535
|
RiveFile.prototype.init = function () {
|
|
4380
4536
|
return __awaiter(this, void 0, void 0, function () {
|
|
4381
|
-
var _a, error_1;
|
|
4537
|
+
var _a, bufferResolved, runtimeResolved, error_1;
|
|
4382
4538
|
return __generator(this, function (_b) {
|
|
4383
4539
|
switch (_b.label) {
|
|
4384
4540
|
case 0:
|
|
@@ -4390,16 +4546,24 @@ var RiveFile = /** @class */ (function () {
|
|
|
4390
4546
|
_b.label = 1;
|
|
4391
4547
|
case 1:
|
|
4392
4548
|
_b.trys.push([1, 4, , 5]);
|
|
4393
|
-
|
|
4394
|
-
return [4 /*yield*/, RuntimeLoader.awaitInstance()];
|
|
4549
|
+
return [4 /*yield*/, Promise.all([this.loadRiveFileBytes(), this.loadRuntime()])];
|
|
4395
4550
|
case 2:
|
|
4396
|
-
_a
|
|
4551
|
+
_a = _b.sent(), bufferResolved = _a[0], runtimeResolved = _a[1];
|
|
4397
4552
|
if (this.destroyed) {
|
|
4398
4553
|
return [2 /*return*/];
|
|
4399
4554
|
}
|
|
4555
|
+
// .riv file buffer and WASM runtime instance
|
|
4556
|
+
this.buffer = bufferResolved;
|
|
4557
|
+
this.runtime = runtimeResolved;
|
|
4558
|
+
if (this.enablePerfMarks)
|
|
4559
|
+
performance.mark('rive:init-data:start');
|
|
4400
4560
|
return [4 /*yield*/, this.initData()];
|
|
4401
4561
|
case 3:
|
|
4402
4562
|
_b.sent();
|
|
4563
|
+
if (this.enablePerfMarks) {
|
|
4564
|
+
performance.mark('rive:init-data:end');
|
|
4565
|
+
performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');
|
|
4566
|
+
}
|
|
4403
4567
|
return [3 /*break*/, 5];
|
|
4404
4568
|
case 4:
|
|
4405
4569
|
error_1 = _b.sent();
|
|
@@ -4471,7 +4635,7 @@ var RiveFile = /** @class */ (function () {
|
|
|
4471
4635
|
RiveFile.prototype.createBindableArtboard = function (nativeBindableArtboard) {
|
|
4472
4636
|
if (nativeBindableArtboard != null) {
|
|
4473
4637
|
var bindableArtboard = new BindableArtboard(nativeBindableArtboard);
|
|
4474
|
-
(0,
|
|
4638
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(bindableArtboard, bindableArtboard.nativeArtboard);
|
|
4475
4639
|
this.bindableArtboards.push(bindableArtboard);
|
|
4476
4640
|
return bindableArtboard;
|
|
4477
4641
|
}
|
|
@@ -4567,6 +4731,8 @@ var Rive = /** @class */ (function () {
|
|
|
4567
4731
|
this._viewModelInstance = null;
|
|
4568
4732
|
this._dataEnums = null;
|
|
4569
4733
|
this.drawOptimization = DrawOptimizationOptions.DrawOnChanged;
|
|
4734
|
+
// When true, emits performance.mark/measure entries for load and render.
|
|
4735
|
+
this.enablePerfMarks = false;
|
|
4570
4736
|
// Durations to generate a frame for the last second. Used for performance profiling.
|
|
4571
4737
|
this.durations = [];
|
|
4572
4738
|
this.frameTimes = [];
|
|
@@ -4613,6 +4779,9 @@ var Rive = /** @class */ (function () {
|
|
|
4613
4779
|
params.enableRiveAssetCDN === undefined
|
|
4614
4780
|
? true
|
|
4615
4781
|
: params.enableRiveAssetCDN;
|
|
4782
|
+
this.enablePerfMarks = !!params.enablePerfMarks;
|
|
4783
|
+
if (this.enablePerfMarks)
|
|
4784
|
+
_runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.enablePerfMarks = true;
|
|
4616
4785
|
// New event management system
|
|
4617
4786
|
this.eventManager = new EventManager();
|
|
4618
4787
|
if (params.onLoad)
|
|
@@ -4705,7 +4874,7 @@ var Rive = /** @class */ (function () {
|
|
|
4705
4874
|
this.loaded = false;
|
|
4706
4875
|
this.readyForPlaying = false;
|
|
4707
4876
|
// Ensure the runtime is loaded
|
|
4708
|
-
RuntimeLoader.awaitInstance()
|
|
4877
|
+
_runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.awaitInstance()
|
|
4709
4878
|
.then(function (runtime) {
|
|
4710
4879
|
if (_this.destroyed) {
|
|
4711
4880
|
return;
|
|
@@ -4714,7 +4883,13 @@ var Rive = /** @class */ (function () {
|
|
|
4714
4883
|
_this.removeRiveListeners();
|
|
4715
4884
|
_this.deleteRiveRenderer();
|
|
4716
4885
|
// Get the canvas where you want to render the animation and create a renderer
|
|
4886
|
+
if (_this.enablePerfMarks)
|
|
4887
|
+
performance.mark('rive:make-renderer:start');
|
|
4717
4888
|
_this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
|
|
4889
|
+
if (_this.enablePerfMarks) {
|
|
4890
|
+
performance.mark('rive:make-renderer:end');
|
|
4891
|
+
performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');
|
|
4892
|
+
}
|
|
4718
4893
|
// Initial size adjustment based on devicePixelRatio if no width/height are
|
|
4719
4894
|
// specified explicitly
|
|
4720
4895
|
if (!(_this.canvas.width || _this.canvas.height)) {
|
|
@@ -4757,7 +4932,7 @@ var Rive = /** @class */ (function () {
|
|
|
4757
4932
|
"isTouchScrollEnabled" in riveListenerOptions) {
|
|
4758
4933
|
touchScrollEnabledOption = riveListenerOptions.isTouchScrollEnabled;
|
|
4759
4934
|
}
|
|
4760
|
-
this.eventCleanup = (0,
|
|
4935
|
+
this.eventCleanup = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.registerTouchInteractions)({
|
|
4761
4936
|
canvas: this.canvas,
|
|
4762
4937
|
artboard: this.artboard,
|
|
4763
4938
|
stateMachines: activeStateMachines,
|
|
@@ -4826,6 +5001,7 @@ var Rive = /** @class */ (function () {
|
|
|
4826
5001
|
buffer: this.buffer,
|
|
4827
5002
|
enableRiveAssetCDN: this.enableRiveAssetCDN,
|
|
4828
5003
|
assetLoader: this.assetLoader,
|
|
5004
|
+
enablePerfMarks: this.enablePerfMarks,
|
|
4829
5005
|
});
|
|
4830
5006
|
this.riveFile = riveFile;
|
|
4831
5007
|
return [4 /*yield*/, riveFile.init()];
|
|
@@ -4918,7 +5094,7 @@ var Rive = /** @class */ (function () {
|
|
|
4918
5094
|
var runtimeInstance = viewModel.defaultInstance();
|
|
4919
5095
|
if (runtimeInstance !== null) {
|
|
4920
5096
|
var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
|
|
4921
|
-
(0,
|
|
5097
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, viewModelInstance.runtimeInstance);
|
|
4922
5098
|
this.bindViewModelInstance(viewModelInstance);
|
|
4923
5099
|
}
|
|
4924
5100
|
}
|
|
@@ -4992,6 +5168,9 @@ var Rive = /** @class */ (function () {
|
|
|
4992
5168
|
// - Advance non-paused state machines by the elapsed number of seconds
|
|
4993
5169
|
// - Advance to the first frame even when autoplay is false
|
|
4994
5170
|
var activeStateMachines = this.animator.stateMachines.filter(function (a) { return a.playing; });
|
|
5171
|
+
// Instrument the first 3 frames so the Performance timeline shows precise
|
|
5172
|
+
// per-call latency for advance, draw, and flush without polluting the trace.
|
|
5173
|
+
var _perfFrame = this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;
|
|
4995
5174
|
for (var _b = 0, activeStateMachines_1 = activeStateMachines; _b < activeStateMachines_1.length; _b++) {
|
|
4996
5175
|
var stateMachine = activeStateMachines_1[_b];
|
|
4997
5176
|
// Check for events before the current frame's state machine advance
|
|
@@ -5009,10 +5188,10 @@ var Rive = /** @class */ (function () {
|
|
|
5009
5188
|
if (this.automaticallyHandleEvents) {
|
|
5010
5189
|
var newAnchorTag = document.createElement("a");
|
|
5011
5190
|
var _c = event_1, url = _c.url, target = _c.target;
|
|
5012
|
-
var sanitizedUrl = (0,
|
|
5191
|
+
var sanitizedUrl = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.sanitizeUrl)(url);
|
|
5013
5192
|
url && newAnchorTag.setAttribute("href", sanitizedUrl);
|
|
5014
5193
|
target && newAnchorTag.setAttribute("target", target);
|
|
5015
|
-
if (sanitizedUrl && sanitizedUrl !==
|
|
5194
|
+
if (sanitizedUrl && sanitizedUrl !== _utils__WEBPACK_IMPORTED_MODULE_2__.BLANK_URL) {
|
|
5016
5195
|
newAnchorTag.click();
|
|
5017
5196
|
}
|
|
5018
5197
|
}
|
|
@@ -5026,7 +5205,13 @@ var Rive = /** @class */ (function () {
|
|
|
5026
5205
|
}
|
|
5027
5206
|
}
|
|
5028
5207
|
}
|
|
5208
|
+
if (_perfFrame >= 0)
|
|
5209
|
+
performance.mark("rive:sm-advance:start:f".concat(_perfFrame));
|
|
5029
5210
|
stateMachine.advanceAndApply(elapsedTime);
|
|
5211
|
+
if (_perfFrame >= 0) {
|
|
5212
|
+
performance.mark("rive:sm-advance:end:f".concat(_perfFrame));
|
|
5213
|
+
performance.measure("rive:sm-advance:f".concat(_perfFrame), "rive:sm-advance:start:f".concat(_perfFrame), "rive:sm-advance:end:f".concat(_perfFrame));
|
|
5214
|
+
}
|
|
5030
5215
|
// stateMachine.instance.apply(this.artboard);
|
|
5031
5216
|
}
|
|
5032
5217
|
// Once the animations have been applied to the artboard, advance it
|
|
@@ -5046,10 +5231,28 @@ var Rive = /** @class */ (function () {
|
|
|
5046
5231
|
renderer.clear();
|
|
5047
5232
|
renderer.save();
|
|
5048
5233
|
// Update the renderer alignment if necessary
|
|
5234
|
+
if (_perfFrame >= 0)
|
|
5235
|
+
performance.mark("rive:align-renderer:start:f".concat(_perfFrame));
|
|
5049
5236
|
this.alignRenderer();
|
|
5237
|
+
if (_perfFrame >= 0) {
|
|
5238
|
+
performance.mark("rive:align-renderer:end:f".concat(_perfFrame));
|
|
5239
|
+
performance.measure("rive:align-renderer:f".concat(_perfFrame), "rive:align-renderer:start:f".concat(_perfFrame), "rive:align-renderer:end:f".concat(_perfFrame));
|
|
5240
|
+
}
|
|
5241
|
+
if (_perfFrame >= 0)
|
|
5242
|
+
performance.mark("rive:artboard-draw:start:f".concat(_perfFrame));
|
|
5050
5243
|
this.artboard.draw(renderer);
|
|
5244
|
+
if (_perfFrame >= 0) {
|
|
5245
|
+
performance.mark("rive:artboard-draw:end:f".concat(_perfFrame));
|
|
5246
|
+
performance.measure("rive:artboard-draw:f".concat(_perfFrame), "rive:artboard-draw:start:f".concat(_perfFrame), "rive:artboard-draw:end:f".concat(_perfFrame));
|
|
5247
|
+
}
|
|
5051
5248
|
renderer.restore();
|
|
5249
|
+
if (_perfFrame >= 0)
|
|
5250
|
+
performance.mark("rive:renderer-flush:start:f".concat(_perfFrame));
|
|
5052
5251
|
renderer.flush();
|
|
5252
|
+
if (_perfFrame >= 0) {
|
|
5253
|
+
performance.mark("rive:renderer-flush:end:f".concat(_perfFrame));
|
|
5254
|
+
performance.measure("rive:renderer-flush:f".concat(_perfFrame), "rive:renderer-flush:start:f".concat(_perfFrame), "rive:renderer-flush:end:f".concat(_perfFrame));
|
|
5255
|
+
}
|
|
5053
5256
|
this._needsRedraw = false;
|
|
5054
5257
|
}
|
|
5055
5258
|
}
|
|
@@ -6059,7 +6262,7 @@ var ViewModel = /** @class */ (function () {
|
|
|
6059
6262
|
var instance = this._viewModel.instanceByIndex(index);
|
|
6060
6263
|
if (instance !== null) {
|
|
6061
6264
|
var viewModelInstance = new ViewModelInstance(instance, null);
|
|
6062
|
-
(0,
|
|
6265
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, instance);
|
|
6063
6266
|
return viewModelInstance;
|
|
6064
6267
|
}
|
|
6065
6268
|
return null;
|
|
@@ -6068,7 +6271,7 @@ var ViewModel = /** @class */ (function () {
|
|
|
6068
6271
|
var instance = this._viewModel.instanceByName(name);
|
|
6069
6272
|
if (instance !== null) {
|
|
6070
6273
|
var viewModelInstance = new ViewModelInstance(instance, null);
|
|
6071
|
-
(0,
|
|
6274
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, instance);
|
|
6072
6275
|
return viewModelInstance;
|
|
6073
6276
|
}
|
|
6074
6277
|
return null;
|
|
@@ -6077,7 +6280,7 @@ var ViewModel = /** @class */ (function () {
|
|
|
6077
6280
|
var runtimeInstance = this._viewModel.defaultInstance();
|
|
6078
6281
|
if (runtimeInstance !== null) {
|
|
6079
6282
|
var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
|
|
6080
|
-
(0,
|
|
6283
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, runtimeInstance);
|
|
6081
6284
|
return viewModelInstance;
|
|
6082
6285
|
}
|
|
6083
6286
|
return null;
|
|
@@ -6086,7 +6289,7 @@ var ViewModel = /** @class */ (function () {
|
|
|
6086
6289
|
var runtimeInstance = this._viewModel.instance();
|
|
6087
6290
|
if (runtimeInstance !== null) {
|
|
6088
6291
|
var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
|
|
6089
|
-
(0,
|
|
6292
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, runtimeInstance);
|
|
6090
6293
|
return viewModelInstance;
|
|
6091
6294
|
}
|
|
6092
6295
|
return null;
|
|
@@ -6351,7 +6554,7 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6351
6554
|
var viewModelRuntimeInstance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.viewModel(name);
|
|
6352
6555
|
if (viewModelRuntimeInstance !== null) {
|
|
6353
6556
|
var viewModelInstance = new ViewModelInstance(viewModelRuntimeInstance, this);
|
|
6354
|
-
(0,
|
|
6557
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, viewModelRuntimeInstance);
|
|
6355
6558
|
viewModelInstance.internalIncrementReferenceCount();
|
|
6356
6559
|
this._viewModelInstances.set(name, viewModelInstance);
|
|
6357
6560
|
return viewModelInstance;
|
|
@@ -6515,6 +6718,17 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6515
6718
|
enumerable: false,
|
|
6516
6719
|
configurable: true
|
|
6517
6720
|
});
|
|
6721
|
+
Object.defineProperty(ViewModelInstance.prototype, "viewModelName", {
|
|
6722
|
+
/**
|
|
6723
|
+
* Get the name of the ViewModel definition this instance was created from.
|
|
6724
|
+
*/
|
|
6725
|
+
get: function () {
|
|
6726
|
+
var _a, _b;
|
|
6727
|
+
return (_b = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.getViewModelName()) !== null && _b !== void 0 ? _b : "";
|
|
6728
|
+
},
|
|
6729
|
+
enumerable: false,
|
|
6730
|
+
configurable: true
|
|
6731
|
+
});
|
|
6518
6732
|
ViewModelInstance.prototype.internalIncrementReferenceCount = function () {
|
|
6519
6733
|
this._referenceCount++;
|
|
6520
6734
|
};
|
|
@@ -6757,7 +6971,7 @@ var ViewModelInstanceList = /** @class */ (function (_super) {
|
|
|
6757
6971
|
var runtimeInstance = this._viewModelInstanceValue.instanceAt(index);
|
|
6758
6972
|
if (runtimeInstance != null) {
|
|
6759
6973
|
var viewModelInstance = new ViewModelInstance(runtimeInstance, this._parentViewModel);
|
|
6760
|
-
(0,
|
|
6974
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.createFinalization)(viewModelInstance, runtimeInstance);
|
|
6761
6975
|
return viewModelInstance;
|
|
6762
6976
|
}
|
|
6763
6977
|
return null;
|
|
@@ -6910,15 +7124,15 @@ var decodeAudio = function (bytes) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
6910
7124
|
switch (_a.label) {
|
|
6911
7125
|
case 0:
|
|
6912
7126
|
decodedPromise = new Promise(function (resolve) {
|
|
6913
|
-
return RuntimeLoader.getInstance(function (rive) {
|
|
7127
|
+
return _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.getInstance(function (rive) {
|
|
6914
7128
|
rive.decodeAudio(bytes, resolve);
|
|
6915
7129
|
});
|
|
6916
7130
|
});
|
|
6917
7131
|
return [4 /*yield*/, decodedPromise];
|
|
6918
7132
|
case 1:
|
|
6919
7133
|
audio = _a.sent();
|
|
6920
|
-
audioWrapper = new
|
|
6921
|
-
|
|
7134
|
+
audioWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.AudioWrapper(audio);
|
|
7135
|
+
_utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(audioWrapper, audio);
|
|
6922
7136
|
return [2 /*return*/, audioWrapper];
|
|
6923
7137
|
}
|
|
6924
7138
|
});
|
|
@@ -6935,15 +7149,15 @@ var decodeImage = function (bytes) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
6935
7149
|
switch (_a.label) {
|
|
6936
7150
|
case 0:
|
|
6937
7151
|
decodedPromise = new Promise(function (resolve) {
|
|
6938
|
-
return RuntimeLoader.getInstance(function (rive) {
|
|
7152
|
+
return _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.getInstance(function (rive) {
|
|
6939
7153
|
rive.decodeImage(bytes, resolve);
|
|
6940
7154
|
});
|
|
6941
7155
|
});
|
|
6942
7156
|
return [4 /*yield*/, decodedPromise];
|
|
6943
7157
|
case 1:
|
|
6944
7158
|
image = _a.sent();
|
|
6945
|
-
imageWrapper = new
|
|
6946
|
-
|
|
7159
|
+
imageWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.ImageWrapper(image);
|
|
7160
|
+
_utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(imageWrapper, image);
|
|
6947
7161
|
return [2 /*return*/, imageWrapper];
|
|
6948
7162
|
}
|
|
6949
7163
|
});
|
|
@@ -6960,15 +7174,15 @@ var decodeFont = function (bytes) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
6960
7174
|
switch (_a.label) {
|
|
6961
7175
|
case 0:
|
|
6962
7176
|
decodedPromise = new Promise(function (resolve) {
|
|
6963
|
-
return RuntimeLoader.getInstance(function (rive) {
|
|
7177
|
+
return _runtimeLoader__WEBPACK_IMPORTED_MODULE_1__.RuntimeLoader.getInstance(function (rive) {
|
|
6964
7178
|
rive.decodeFont(bytes, resolve);
|
|
6965
7179
|
});
|
|
6966
7180
|
});
|
|
6967
7181
|
return [4 /*yield*/, decodedPromise];
|
|
6968
7182
|
case 1:
|
|
6969
7183
|
font = _a.sent();
|
|
6970
|
-
fontWrapper = new
|
|
6971
|
-
|
|
7184
|
+
fontWrapper = new _utils__WEBPACK_IMPORTED_MODULE_2__.FontWrapper(font);
|
|
7185
|
+
_utils__WEBPACK_IMPORTED_MODULE_2__.finalizationRegistry.register(fontWrapper, font);
|
|
6972
7186
|
return [2 /*return*/, fontWrapper];
|
|
6973
7187
|
}
|
|
6974
7188
|
});
|