@m2c2kit/core 0.3.5 → 0.3.7
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/assets/canvaskit.wasm +0 -0
- package/dist/index.d.ts +594 -537
- package/dist/index.js +679 -606
- package/package.json +12 -13
- package/post-install.mjs +0 -98
package/dist/index.js
CHANGED
|
@@ -867,7 +867,7 @@ class Entity {
|
|
|
867
867
|
return findParentScene(this).game;
|
|
868
868
|
}
|
|
869
869
|
/**
|
|
870
|
-
* Adds a child to this parent entity.
|
|
870
|
+
* Adds a child to this parent entity. Throws exception if the child's name
|
|
871
871
|
* is not unique with respect to other children of this parent.
|
|
872
872
|
*
|
|
873
873
|
* @param child - The child entity to add
|
|
@@ -1225,7 +1225,7 @@ class Entity {
|
|
|
1225
1225
|
if (constraints[constraintType] !== void 0) {
|
|
1226
1226
|
let entity;
|
|
1227
1227
|
let additionalExceptionMessage = "";
|
|
1228
|
-
if (constraints[constraintType]
|
|
1228
|
+
if (typeof constraints[constraintType] === "object") {
|
|
1229
1229
|
entity = constraints[constraintType];
|
|
1230
1230
|
} else {
|
|
1231
1231
|
const entityName = constraints[constraintType];
|
|
@@ -1379,7 +1379,7 @@ class Entity {
|
|
|
1379
1379
|
if (constraints[constraint] !== void 0) {
|
|
1380
1380
|
let siblingConstraint;
|
|
1381
1381
|
let additionalExceptionMessage = "";
|
|
1382
|
-
if (constraints[constraint]
|
|
1382
|
+
if (typeof constraints[constraint] === "object") {
|
|
1383
1383
|
siblingConstraint = constraints[constraint];
|
|
1384
1384
|
} else {
|
|
1385
1385
|
const entityName = constraints[constraint];
|
|
@@ -1396,7 +1396,7 @@ class Entity {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
if (siblingConstraint === void 0) {
|
|
1398
1398
|
throw new Error(
|
|
1399
|
-
"error getting uuid of sibling
|
|
1399
|
+
"error getting uuid of sibling constraint" + additionalExceptionMessage
|
|
1400
1400
|
);
|
|
1401
1401
|
}
|
|
1402
1402
|
if (siblingConstraint !== parent) {
|
|
@@ -1852,6 +1852,7 @@ function name(data) {
|
|
|
1852
1852
|
var info = {};
|
|
1853
1853
|
for (var j = 0; j < numberNameRecords; j++) {
|
|
1854
1854
|
var o = ntOffset + 6 + j * 12;
|
|
1855
|
+
u16(data, o);
|
|
1855
1856
|
var nameId = u16(data, o + 6);
|
|
1856
1857
|
var stringLength = u16(data, o + 8);
|
|
1857
1858
|
var stringOffset = u16(data, o + 10);
|
|
@@ -2041,24 +2042,26 @@ function property(e) {
|
|
|
2041
2042
|
class GameTypefaces {
|
|
2042
2043
|
}
|
|
2043
2044
|
class FontManager {
|
|
2044
|
-
constructor() {
|
|
2045
|
+
constructor(session) {
|
|
2045
2046
|
this.gameTypefaces = new GameTypefaces();
|
|
2047
|
+
this.fontData = new Array();
|
|
2048
|
+
this.session = session;
|
|
2046
2049
|
}
|
|
2047
2050
|
/**
|
|
2048
2051
|
* Gets a typeface that was previously loaded for the specified game.
|
|
2049
2052
|
*
|
|
2050
2053
|
* @param gameUuid
|
|
2051
|
-
* @param
|
|
2054
|
+
* @param fontName
|
|
2052
2055
|
* @returns the requested Typeface
|
|
2053
2056
|
*/
|
|
2054
|
-
getTypeface(gameUuid,
|
|
2055
|
-
return this.gameTypefaces[gameUuid][
|
|
2057
|
+
getTypeface(gameUuid, fontName) {
|
|
2058
|
+
return this.gameTypefaces[gameUuid][fontName].typeface;
|
|
2056
2059
|
}
|
|
2057
2060
|
/**
|
|
2058
2061
|
* Gets names of fonts loaded for the specified game.
|
|
2059
2062
|
*
|
|
2060
2063
|
* @param gameUuid
|
|
2061
|
-
* @returns array of font
|
|
2064
|
+
* @returns array of font names
|
|
2062
2065
|
*/
|
|
2063
2066
|
getFontNames(gameUuid) {
|
|
2064
2067
|
if (!this.gameTypefaces[gameUuid]) {
|
|
@@ -2067,99 +2070,102 @@ class FontManager {
|
|
|
2067
2070
|
return Object.keys(this.gameTypefaces[gameUuid]);
|
|
2068
2071
|
}
|
|
2069
2072
|
/**
|
|
2070
|
-
* Fetches all fonts
|
|
2073
|
+
* Fetches all fonts games.
|
|
2071
2074
|
*
|
|
2072
|
-
* @param
|
|
2075
|
+
* @param games - array of games
|
|
2073
2076
|
* @returns
|
|
2074
2077
|
*/
|
|
2075
|
-
fetchFonts(
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2078
|
+
fetchFonts(games) {
|
|
2079
|
+
this.games = games;
|
|
2080
|
+
const fontsToFetch = games.flatMap(
|
|
2081
|
+
(game) => {
|
|
2082
|
+
var _a;
|
|
2083
|
+
return (
|
|
2084
|
+
// no fonts in game if game.options.fonts is undefined
|
|
2085
|
+
(_a = game.options.fonts) == null ? void 0 : _a.map((font, i) => {
|
|
2086
|
+
return {
|
|
2087
|
+
gameUuid: game.uuid,
|
|
2088
|
+
fontUrl: font.url,
|
|
2089
|
+
fontName: font.fontName,
|
|
2090
|
+
isDefault: i === 0
|
|
2091
|
+
};
|
|
2092
|
+
})
|
|
2093
|
+
);
|
|
2094
|
+
}
|
|
2095
|
+
).filter((f) => f !== void 0);
|
|
2096
|
+
if (fontsToFetch.length === 0) {
|
|
2097
|
+
return Promise.all([Promise.resolve()]);
|
|
2098
|
+
}
|
|
2099
|
+
const fetchFontsPromises = fontsToFetch.map((font) => {
|
|
2100
|
+
const game = games.filter((g) => g.uuid === font.gameUuid).find(Boolean);
|
|
2101
|
+
const fontUrl = game.prependAssetsGameIdUrl(font.fontUrl);
|
|
2102
|
+
return fetch(fontUrl).then((response) => response.arrayBuffer()).then((arrayBuffer) => {
|
|
2103
|
+
this.fontData.push({
|
|
2104
|
+
gameUuid: font.gameUuid,
|
|
2105
|
+
fontFamilyName: "",
|
|
2106
|
+
fontName: font.fontName,
|
|
2107
|
+
fontUrl: font.fontUrl,
|
|
2108
|
+
fontArrayBuffer: arrayBuffer,
|
|
2109
|
+
isDefault: font.isDefault
|
|
2110
|
+
});
|
|
2111
|
+
});
|
|
2086
2112
|
});
|
|
2113
|
+
return Promise.all(fetchFontsPromises);
|
|
2087
2114
|
}
|
|
2088
2115
|
/**
|
|
2089
2116
|
* Takes the fonts, which have been previously fetched and converted into
|
|
2090
2117
|
* Array Buffers using FontManager.fetchFonts(), and makes them available
|
|
2091
|
-
* to our engine
|
|
2118
|
+
* to our engine by creating canvaskit Typefaces.
|
|
2092
2119
|
*/
|
|
2093
2120
|
loadAllGamesFontData() {
|
|
2094
|
-
if (!this.allGamesFontData) {
|
|
2095
|
-
throw new Error("allGamesFontData is undefined");
|
|
2096
|
-
}
|
|
2097
|
-
const gameUuids = Array.from(
|
|
2098
|
-
new Set(this.allGamesFontData.map((fd) => fd.gameUuid))
|
|
2099
|
-
);
|
|
2100
|
-
gameUuids.forEach((gameUuid) => {
|
|
2101
|
-
if (!this.allGamesFontData) {
|
|
2102
|
-
throw new Error("allGamesFontData is undefined");
|
|
2103
|
-
}
|
|
2104
|
-
const gameFontData = this.allGamesFontData.filter((fd) => fd.gameUuid === gameUuid).map((fd) => fd.fontArrayBuffer);
|
|
2105
|
-
this.loadGameFonts(gameUuid, gameFontData);
|
|
2106
|
-
});
|
|
2107
|
-
}
|
|
2108
|
-
/**
|
|
2109
|
-
* For the specified game, fetches all fonts in the array of urls and
|
|
2110
|
-
* stores fonts as array buffers.
|
|
2111
|
-
*
|
|
2112
|
-
* @param gameUuid
|
|
2113
|
-
* @param fontUrls - array of font urls
|
|
2114
|
-
* @returns
|
|
2115
|
-
*/
|
|
2116
|
-
fetchGameFontsAsArrayBuffers(gameUuid, fontUrls) {
|
|
2117
|
-
const fetchFontsPromises = fontUrls.map(
|
|
2118
|
-
(fontUrl) => fetch(fontUrl).then((response) => response.arrayBuffer()).then((arrayBuffer) => ({
|
|
2119
|
-
gameUuid,
|
|
2120
|
-
fontUrl,
|
|
2121
|
-
fontArrayBuffer: arrayBuffer
|
|
2122
|
-
}))
|
|
2123
|
-
);
|
|
2124
|
-
return Promise.all(fetchFontsPromises);
|
|
2125
|
-
}
|
|
2126
|
-
/**
|
|
2127
|
-
* For the specified game, loads all fonts from array buffers and makes
|
|
2128
|
-
* fonts available within canvaskit as a Typeface
|
|
2129
|
-
*
|
|
2130
|
-
* @param gameUuid
|
|
2131
|
-
* @param fonts - array of fonts in array buffer form
|
|
2132
|
-
*/
|
|
2133
|
-
loadGameFonts(gameUuid, fonts) {
|
|
2134
2121
|
var _a;
|
|
2122
|
+
if (this.fontData.length === 0) {
|
|
2123
|
+
return;
|
|
2124
|
+
}
|
|
2135
2125
|
if (!this.canvasKit) {
|
|
2136
2126
|
throw new Error("canvasKit undefined");
|
|
2137
2127
|
}
|
|
2138
|
-
this.fontMgr = (_a = this.canvasKit.FontMgr.FromData(
|
|
2128
|
+
this.fontMgr = (_a = this.canvasKit.FontMgr.FromData(
|
|
2129
|
+
...this.fontData.map((f) => f.fontArrayBuffer)
|
|
2130
|
+
)) != null ? _a : void 0;
|
|
2139
2131
|
if (!this.fontMgr) {
|
|
2140
2132
|
throw new Error("error creating FontMgr while loading fonts");
|
|
2141
2133
|
}
|
|
2142
|
-
|
|
2143
|
-
var _a2;
|
|
2144
|
-
const result = ttfInfo(new DataView(font));
|
|
2145
|
-
const
|
|
2146
|
-
if (
|
|
2134
|
+
this.fontData.forEach((font) => {
|
|
2135
|
+
var _a2, _b, _c;
|
|
2136
|
+
const result = ttfInfo(new DataView(font.fontArrayBuffer));
|
|
2137
|
+
const fontFamilyUtf16Be = (_a2 = result.meta.property.filter((p) => p.name === "font-family").find(Boolean)) == null ? void 0 : _a2.text;
|
|
2138
|
+
if (fontFamilyUtf16Be === void 0) {
|
|
2147
2139
|
throw new Error(
|
|
2148
|
-
|
|
2140
|
+
`error loading fonts. could not get font-family name from font at ${font.fontUrl}`
|
|
2149
2141
|
);
|
|
2150
2142
|
}
|
|
2151
|
-
|
|
2143
|
+
const arr = new Uint8Array(fontFamilyUtf16Be.length);
|
|
2144
|
+
for (let i = 0; i < arr.length; i++) {
|
|
2145
|
+
arr[i] = fontFamilyUtf16Be.charCodeAt(i);
|
|
2146
|
+
}
|
|
2147
|
+
const fontFamily = new TextDecoder("utf-16be").decode(arr);
|
|
2152
2148
|
if (!this.canvasKit) {
|
|
2153
2149
|
throw new Error("canvasKit undefined");
|
|
2154
2150
|
}
|
|
2155
|
-
const typeface = this.canvasKit.Typeface.MakeFreeTypeFaceFromData(
|
|
2151
|
+
const typeface = this.canvasKit.Typeface.MakeFreeTypeFaceFromData(
|
|
2152
|
+
font.fontArrayBuffer
|
|
2153
|
+
);
|
|
2156
2154
|
if (!typeface) {
|
|
2157
2155
|
throw new Error("cannot make typeface from font array buffer");
|
|
2158
2156
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2157
|
+
const gameId = (_c = (_b = this.games) == null ? void 0 : _b.find((g) => g.uuid === font.gameUuid)) == null ? void 0 : _c.id;
|
|
2158
|
+
console.log(
|
|
2159
|
+
`\u26AA typeface ${font.fontName} ${font.isDefault ? "(default) " : ""}created from font-family ${fontFamily} for game ${gameId}`
|
|
2160
|
+
);
|
|
2161
|
+
if (!this.gameTypefaces[font.gameUuid]) {
|
|
2162
|
+
this.gameTypefaces[font.gameUuid] = {};
|
|
2161
2163
|
}
|
|
2162
|
-
this.gameTypefaces[gameUuid][
|
|
2164
|
+
this.gameTypefaces[font.gameUuid][font.fontName] = {
|
|
2165
|
+
fontFamily,
|
|
2166
|
+
typeface,
|
|
2167
|
+
isDefault: font.isDefault
|
|
2168
|
+
};
|
|
2163
2169
|
});
|
|
2164
2170
|
}
|
|
2165
2171
|
}
|
|
@@ -2543,7 +2549,7 @@ const _Timer = class {
|
|
|
2543
2549
|
this.stopped = true;
|
|
2544
2550
|
/**
|
|
2545
2551
|
* cumulativeElapsed is a cumulative total of elapsed time while the timer
|
|
2546
|
-
* was in previous started (running) states, NOT INCLUDING the
|
|
2552
|
+
* was in previous started (running) states, NOT INCLUDING the possibly
|
|
2547
2553
|
* active run's duration
|
|
2548
2554
|
*/
|
|
2549
2555
|
this.cumulativeElapsed = NaN;
|
|
@@ -2867,7 +2873,7 @@ class I18n {
|
|
|
2867
2873
|
fallback_locale: {
|
|
2868
2874
|
type: ["string", "null"],
|
|
2869
2875
|
default: null,
|
|
2870
|
-
description: `Locale to use if requested locale translation is not
|
|
2876
|
+
description: `Locale to use if requested locale translation is not available, or if "auto" locale was requested and environment cannot provide a locale.`
|
|
2871
2877
|
},
|
|
2872
2878
|
missing_translation_font_color: {
|
|
2873
2879
|
type: ["array", "null"],
|
|
@@ -3077,26 +3083,6 @@ var __objRest = (source, exclude) => {
|
|
|
3077
3083
|
}
|
|
3078
3084
|
return target;
|
|
3079
3085
|
};
|
|
3080
|
-
var __async$1 = (__this, __arguments, generator) => {
|
|
3081
|
-
return new Promise((resolve, reject) => {
|
|
3082
|
-
var fulfilled = (value) => {
|
|
3083
|
-
try {
|
|
3084
|
-
step(generator.next(value));
|
|
3085
|
-
} catch (e) {
|
|
3086
|
-
reject(e);
|
|
3087
|
-
}
|
|
3088
|
-
};
|
|
3089
|
-
var rejected = (value) => {
|
|
3090
|
-
try {
|
|
3091
|
-
step(generator.throw(value));
|
|
3092
|
-
} catch (e) {
|
|
3093
|
-
reject(e);
|
|
3094
|
-
}
|
|
3095
|
-
};
|
|
3096
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
3097
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
3098
|
-
});
|
|
3099
|
-
};
|
|
3100
3086
|
class Game {
|
|
3101
3087
|
/**
|
|
3102
3088
|
* The base class for all games. New games should extend this class.
|
|
@@ -3113,6 +3099,7 @@ class Game {
|
|
|
3113
3099
|
this.steppingNow = 0;
|
|
3114
3100
|
this.warmupFunctionQueue = new Array();
|
|
3115
3101
|
this.loaderElementsRemoved = false;
|
|
3102
|
+
this.staticTrialSchema = {};
|
|
3116
3103
|
this.data = {
|
|
3117
3104
|
trials: new Array()
|
|
3118
3105
|
};
|
|
@@ -3162,10 +3149,21 @@ class Game {
|
|
|
3162
3149
|
activity_version: {
|
|
3163
3150
|
type: "string",
|
|
3164
3151
|
description: "Version of the activity."
|
|
3152
|
+
},
|
|
3153
|
+
device_timezone: {
|
|
3154
|
+
type: "string",
|
|
3155
|
+
description: "Timezone of the device. Calculated from Intl.DateTimeFormat().resolvedOptions().timeZone."
|
|
3156
|
+
},
|
|
3157
|
+
device_timezone_offset_minutes: {
|
|
3158
|
+
type: "integer",
|
|
3159
|
+
description: "Difference in minutes between UTC and device timezone. Calculated from Date.getTimezoneOffset()."
|
|
3165
3160
|
}
|
|
3166
3161
|
};
|
|
3167
3162
|
this.snapshots = new Array();
|
|
3168
3163
|
var _a, _b;
|
|
3164
|
+
if (!options.id || options.id.trim() === "") {
|
|
3165
|
+
throw new Error("id is required in GameOptions");
|
|
3166
|
+
}
|
|
3169
3167
|
this.options = options;
|
|
3170
3168
|
this.name = options.name;
|
|
3171
3169
|
this.id = options.id;
|
|
@@ -3178,13 +3176,11 @@ class Game {
|
|
|
3178
3176
|
addLocalizationParametersToGameParameters() {
|
|
3179
3177
|
this.options.parameters = __spreadValues$3(__spreadValues$3({}, this.options.parameters), I18n.makeLocalizationParameters());
|
|
3180
3178
|
}
|
|
3181
|
-
init() {
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
}
|
|
3187
|
-
});
|
|
3179
|
+
async init() {
|
|
3180
|
+
if (this.isLocalizationRequested()) {
|
|
3181
|
+
const options = this.getLocalizationOptionsFromGameParameters();
|
|
3182
|
+
this.i18n = new I18n(options);
|
|
3183
|
+
}
|
|
3188
3184
|
}
|
|
3189
3185
|
/**
|
|
3190
3186
|
* Saves an item to the activity's key-value store.
|
|
@@ -3375,7 +3371,7 @@ class Game {
|
|
|
3375
3371
|
*
|
|
3376
3372
|
* @remarks Once added to the game, a free entity will always be drawn,
|
|
3377
3373
|
* and it will not be part of any scene transitions. This is useful if
|
|
3378
|
-
* an entity must
|
|
3374
|
+
* an entity must persistently be drawn and not move with scene
|
|
3379
3375
|
* transitions. The appearance of the free entity must be managed
|
|
3380
3376
|
* by the programmer. Note: internally, the free entities are part of a
|
|
3381
3377
|
* special scene (named "__freeEntitiesScene"), but this scene is handled
|
|
@@ -3459,7 +3455,7 @@ class Game {
|
|
|
3459
3455
|
* @param scene - the scene to remove or its name as a string
|
|
3460
3456
|
*/
|
|
3461
3457
|
removeScene(scene) {
|
|
3462
|
-
if (scene
|
|
3458
|
+
if (typeof scene === "object") {
|
|
3463
3459
|
if (this.scenes.includes(scene)) {
|
|
3464
3460
|
this.scenes = this.scenes.filter((s) => s !== scene);
|
|
3465
3461
|
} else {
|
|
@@ -3564,79 +3560,73 @@ class Game {
|
|
|
3564
3560
|
*
|
|
3565
3561
|
* @param entryScene - The scene (Scene object or its string name) to display when the game starts
|
|
3566
3562
|
*/
|
|
3567
|
-
start(entryScene) {
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
if (entryScene
|
|
3586
|
-
|
|
3587
|
-
startingScene = entryScene;
|
|
3588
|
-
if (!this.scenes.includes(startingScene)) {
|
|
3589
|
-
throw new Error(
|
|
3590
|
-
`cannot start game. scene named "${entryScene}" has not been added to the game object`
|
|
3591
|
-
);
|
|
3592
|
-
}
|
|
3593
|
-
} else {
|
|
3594
|
-
startingScene = this.scenes.filter((scene) => scene.name === entryScene).find(Boolean);
|
|
3595
|
-
if (startingScene === void 0) {
|
|
3596
|
-
throw new Error(
|
|
3597
|
-
`cannot start game. scene named "${entryScene}" has not been added to the game object`
|
|
3598
|
-
);
|
|
3599
|
-
}
|
|
3600
|
-
}
|
|
3563
|
+
async start(entryScene) {
|
|
3564
|
+
var _a, _b, _c;
|
|
3565
|
+
const gameInitOptions = this.options;
|
|
3566
|
+
this.unitTesting = (_a = gameInitOptions._unitTesting) != null ? _a : false;
|
|
3567
|
+
this.setupHtmlCanvases(
|
|
3568
|
+
gameInitOptions.canvasId,
|
|
3569
|
+
gameInitOptions.width,
|
|
3570
|
+
gameInitOptions.height,
|
|
3571
|
+
gameInitOptions.stretch
|
|
3572
|
+
);
|
|
3573
|
+
this.showFps = (_b = gameInitOptions.showFps) != null ? _b : false;
|
|
3574
|
+
this.bodyBackgroundColor = gameInitOptions.bodyBackgroundColor;
|
|
3575
|
+
this.initData();
|
|
3576
|
+
this.setupCanvasKitSurface();
|
|
3577
|
+
this.setupFpsFont();
|
|
3578
|
+
this.setupCanvasDomEventHandlers();
|
|
3579
|
+
let startingScene;
|
|
3580
|
+
if (entryScene !== void 0) {
|
|
3581
|
+
if (typeof entryScene === "object") {
|
|
3582
|
+
startingScene = entryScene;
|
|
3601
3583
|
} else {
|
|
3602
|
-
startingScene = this.scenes.find(Boolean);
|
|
3603
|
-
if (startingScene === void 0) {
|
|
3604
|
-
throw new Error(
|
|
3605
|
-
`cannot start game. no scenes have been added to the game object`
|
|
3606
|
-
);
|
|
3607
|
-
}
|
|
3584
|
+
startingScene = this.scenes.filter((scene) => scene.name === entryScene).find(Boolean);
|
|
3608
3585
|
}
|
|
3609
|
-
|
|
3610
|
-
if (this.
|
|
3611
|
-
|
|
3612
|
-
}
|
|
3613
|
-
this.beginTimestamp = Timer.now();
|
|
3614
|
-
this.beginIso8601Timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
3615
|
-
if (this.options.timeStepping) {
|
|
3616
|
-
this.addTimeSteppingControlsToDom();
|
|
3617
|
-
this.updateTimeSteppingOutput();
|
|
3586
|
+
} else if (this.entryScene !== void 0) {
|
|
3587
|
+
if (typeof this.entryScene === "object") {
|
|
3588
|
+
startingScene = this.entryScene;
|
|
3618
3589
|
} else {
|
|
3619
|
-
this.
|
|
3620
|
-
}
|
|
3621
|
-
DomHelpers.setCanvasOverlayVisibility(true);
|
|
3622
|
-
this.warmupFunctionQueue.push({
|
|
3623
|
-
warmupFunction: this.warmupShadersWithPrimitives
|
|
3624
|
-
});
|
|
3625
|
-
this.warmupFunctionQueue.push({
|
|
3626
|
-
warmupFunction: this.warmupShadersWithPrimitives,
|
|
3627
|
-
positionOffset: 0.10012117
|
|
3628
|
-
});
|
|
3629
|
-
this.warmupFunctionQueue.push({
|
|
3630
|
-
warmupFunction: this.warmupShadersWithScenes
|
|
3631
|
-
});
|
|
3632
|
-
this.surface.requestAnimationFrame(this.loop.bind(this));
|
|
3633
|
-
if ((_c = this.session.options.activityCallbacks) == null ? void 0 : _c.onActivityLifecycle) {
|
|
3634
|
-
this.session.options.activityCallbacks.onActivityLifecycle({
|
|
3635
|
-
type: EventType.ActivityStart,
|
|
3636
|
-
target: this
|
|
3637
|
-
});
|
|
3590
|
+
startingScene = this.scenes.filter((scene) => scene.name === this.entryScene).find(Boolean);
|
|
3638
3591
|
}
|
|
3592
|
+
} else {
|
|
3593
|
+
startingScene = this.scenes.find(Boolean);
|
|
3594
|
+
}
|
|
3595
|
+
if (startingScene === void 0) {
|
|
3596
|
+
throw new Error(
|
|
3597
|
+
"cannot start game. entry scene has not been added to the game object."
|
|
3598
|
+
);
|
|
3599
|
+
}
|
|
3600
|
+
this.presentScene(startingScene);
|
|
3601
|
+
if (this.surface === void 0) {
|
|
3602
|
+
throw new Error("CanvasKit surface is undefined");
|
|
3603
|
+
}
|
|
3604
|
+
this.beginTimestamp = Timer.now();
|
|
3605
|
+
this.beginIso8601Timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
3606
|
+
if (this.options.timeStepping) {
|
|
3607
|
+
this.addTimeSteppingControlsToDom();
|
|
3608
|
+
this.updateTimeSteppingOutput();
|
|
3609
|
+
} else {
|
|
3610
|
+
this.removeTimeSteppingControlsFromDom();
|
|
3611
|
+
}
|
|
3612
|
+
DomHelpers.setCanvasOverlayVisibility(true);
|
|
3613
|
+
this.warmupFunctionQueue.push({
|
|
3614
|
+
warmupFunction: this.warmupShadersWithPrimitives
|
|
3615
|
+
});
|
|
3616
|
+
this.warmupFunctionQueue.push({
|
|
3617
|
+
warmupFunction: this.warmupShadersWithPrimitives,
|
|
3618
|
+
positionOffset: 0.10012117
|
|
3619
|
+
});
|
|
3620
|
+
this.warmupFunctionQueue.push({
|
|
3621
|
+
warmupFunction: this.warmupShadersWithScenes
|
|
3639
3622
|
});
|
|
3623
|
+
this.surface.requestAnimationFrame(this.loop.bind(this));
|
|
3624
|
+
if ((_c = this.session.options.activityCallbacks) == null ? void 0 : _c.onActivityLifecycle) {
|
|
3625
|
+
this.session.options.activityCallbacks.onActivityLifecycle({
|
|
3626
|
+
type: EventType.ActivityStart,
|
|
3627
|
+
target: this
|
|
3628
|
+
});
|
|
3629
|
+
}
|
|
3640
3630
|
}
|
|
3641
3631
|
addTimeSteppingControlsToDom() {
|
|
3642
3632
|
const existingDiv = document.getElementById("m2c2kit-time-stepping-div");
|
|
@@ -3826,14 +3816,14 @@ class Game {
|
|
|
3826
3816
|
[...this.scenes, this.freeEntitiesScene].forEach((scene) => {
|
|
3827
3817
|
scene.warmup(canvas);
|
|
3828
3818
|
});
|
|
3829
|
-
const
|
|
3819
|
+
const warmedUpImageNames = this.entities.filter((entity) => entity.type === EntityType.Sprite).map((entity) => entity.imageName);
|
|
3830
3820
|
const loadedImages = this.session.imageManager.loadedImages[this.uuid];
|
|
3831
3821
|
if (loadedImages) {
|
|
3832
3822
|
const imageNames = Object.keys(loadedImages).filter(
|
|
3833
3823
|
(name) => name !== "__outgoingSceneSnapshot"
|
|
3834
3824
|
);
|
|
3835
3825
|
imageNames.forEach((imageName) => {
|
|
3836
|
-
if (!
|
|
3826
|
+
if (!warmedUpImageNames.includes(imageName)) {
|
|
3837
3827
|
const image = loadedImages[imageName].image;
|
|
3838
3828
|
canvas.drawImage(image, 0, 0);
|
|
3839
3829
|
}
|
|
@@ -3953,8 +3943,8 @@ class Game {
|
|
|
3953
3943
|
* @param variableName - variable to be set
|
|
3954
3944
|
* @param value - value of the variable to set
|
|
3955
3945
|
*/
|
|
3956
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3957
3946
|
addTrialData(variableName, value) {
|
|
3947
|
+
var _a, _b, _c;
|
|
3958
3948
|
if (!this.options.trialSchema) {
|
|
3959
3949
|
throw new Error(
|
|
3960
3950
|
"no trial schema were provided in GameOptions. cannot add trial data"
|
|
@@ -3971,7 +3961,9 @@ class Game {
|
|
|
3971
3961
|
session_uuid: this.session.uuid,
|
|
3972
3962
|
activity_uuid: this.uuid,
|
|
3973
3963
|
activity_id: this.options.id,
|
|
3974
|
-
activity_version: this.options.version
|
|
3964
|
+
activity_version: this.options.version,
|
|
3965
|
+
device_timezone: (_c = (_b = (_a = Intl == null ? void 0 : Intl.DateTimeFormat()) == null ? void 0 : _a.resolvedOptions()) == null ? void 0 : _b.timeZone) != null ? _c : "",
|
|
3966
|
+
device_timezone_offset_minutes: (/* @__PURE__ */ new Date()).getTimezoneOffset()
|
|
3975
3967
|
}, emptyTrial), {
|
|
3976
3968
|
device_metadata: this.getDeviceMetadata()
|
|
3977
3969
|
}));
|
|
@@ -4003,6 +3995,53 @@ class Game {
|
|
|
4003
3995
|
}
|
|
4004
3996
|
this.data.trials[this.trialIndex][variableName] = value;
|
|
4005
3997
|
}
|
|
3998
|
+
/**
|
|
3999
|
+
* Adds custom trial schema to the game's trialSchema object.
|
|
4000
|
+
*
|
|
4001
|
+
* @param schema - Trial schema to add
|
|
4002
|
+
*
|
|
4003
|
+
* @remarks This is useful if you want to add custom trial variables.
|
|
4004
|
+
* This must be done before Session.start() is called, because
|
|
4005
|
+
* Session.start() will call Game.start(), which will initialize
|
|
4006
|
+
* the trial schema.
|
|
4007
|
+
*/
|
|
4008
|
+
addTrialSchema(schema) {
|
|
4009
|
+
const keys = Object.keys(schema);
|
|
4010
|
+
keys.forEach((key) => {
|
|
4011
|
+
this.options.trialSchema[key] = schema[key];
|
|
4012
|
+
});
|
|
4013
|
+
}
|
|
4014
|
+
/**
|
|
4015
|
+
* Sets the value of a variable that will be the same for all trials.
|
|
4016
|
+
*
|
|
4017
|
+
* @remarks This sets the value of a variable that is the same across
|
|
4018
|
+
* all trials ("static"). This is useful for variables that are not
|
|
4019
|
+
* part of the trial schema, but that you want to save for each trial in
|
|
4020
|
+
* your use case. For example, you might want to save the subject's
|
|
4021
|
+
* participant ID for each trial, but this is not part of the trial schema.
|
|
4022
|
+
* Rather than modify the source code for the game, you can do the following
|
|
4023
|
+
* to ensure that the participant ID is saved for each trial:
|
|
4024
|
+
*
|
|
4025
|
+
* game.addTrialSchema({
|
|
4026
|
+
* participant_id: {
|
|
4027
|
+
* type: "string",
|
|
4028
|
+
* description: "ID of the participant",
|
|
4029
|
+
* }
|
|
4030
|
+
* });
|
|
4031
|
+
* game.addStaticTrialData("participant_id", "12345");
|
|
4032
|
+
*
|
|
4033
|
+
* When Game.trialComplete() is called, the participant_id variable will
|
|
4034
|
+
* be saved for the trial with the value "12345".
|
|
4035
|
+
*
|
|
4036
|
+
* @param variableName - variable to be set
|
|
4037
|
+
* @param value - value of the variable to set
|
|
4038
|
+
*/
|
|
4039
|
+
addStaticTrialData(variableName, value) {
|
|
4040
|
+
if (this.options.trialSchema[variableName] === void 0) {
|
|
4041
|
+
throw new Error(`trial variable ${variableName} not defined in schema`);
|
|
4042
|
+
}
|
|
4043
|
+
this.staticTrialSchema[variableName] = value;
|
|
4044
|
+
}
|
|
4006
4045
|
/**
|
|
4007
4046
|
* Should be called when the current trial has completed. It will
|
|
4008
4047
|
* also increment the trial index.
|
|
@@ -4015,6 +4054,9 @@ class Game {
|
|
|
4015
4054
|
*/
|
|
4016
4055
|
trialComplete() {
|
|
4017
4056
|
var _a, _b, _c;
|
|
4057
|
+
if (Object.keys(this.staticTrialSchema).length > 0) {
|
|
4058
|
+
this.data.trials[this.trialIndex] = __spreadValues$3(__spreadValues$3({}, this.data.trials[this.trialIndex]), this.staticTrialSchema);
|
|
4059
|
+
}
|
|
4018
4060
|
this.trialIndex++;
|
|
4019
4061
|
if ((_a = this.session.options.activityCallbacks) == null ? void 0 : _a.onActivityResults) {
|
|
4020
4062
|
this.session.options.activityCallbacks.onActivityResults({
|
|
@@ -4424,7 +4466,7 @@ class Game {
|
|
|
4424
4466
|
}
|
|
4425
4467
|
this.currentSceneSnapshot = this.snapshots.shift();
|
|
4426
4468
|
if (!this.currentSceneSnapshot) {
|
|
4427
|
-
throw new Error("No
|
|
4469
|
+
throw new Error("No snapshot available for outgoing scene");
|
|
4428
4470
|
}
|
|
4429
4471
|
const outgoingScene = this.createOutgoingScene(this.currentSceneSnapshot);
|
|
4430
4472
|
outgoingScene._active = true;
|
|
@@ -4540,7 +4582,7 @@ class Game {
|
|
|
4540
4582
|
* @param sx - Upper left coordinate of screenshot
|
|
4541
4583
|
* @param sy - Upper right coordinate of screenshot
|
|
4542
4584
|
* @param sw - width of area to screenshot
|
|
4543
|
-
* @param sh -
|
|
4585
|
+
* @param sh - height of area to screenshot
|
|
4544
4586
|
* @returns Promise of Uint8Array of image data
|
|
4545
4587
|
*/
|
|
4546
4588
|
takeScreenshot(sx, sy, sw, sh) {
|
|
@@ -4786,7 +4828,7 @@ class Game {
|
|
|
4786
4828
|
*
|
|
4787
4829
|
* @remarks Typically, event listeners will be created using a method specific to the event, such as onTapDown(). This alternative allows creation with entity name.
|
|
4788
4830
|
*
|
|
4789
|
-
* @param type - the type of event to listen for, e.g., "
|
|
4831
|
+
* @param type - the type of event to listen for, e.g., "tapDown"
|
|
4790
4832
|
* @param entityName - the entity name for which an event will be listened
|
|
4791
4833
|
* @param callback
|
|
4792
4834
|
* @param replaceExistingCallback
|
|
@@ -5257,6 +5299,18 @@ class Game {
|
|
|
5257
5299
|
const yMax = entity.absolutePosition.y + height * (1 - anchorPoint.y) * scale;
|
|
5258
5300
|
return { xMin, xMax, yMin, yMax };
|
|
5259
5301
|
}
|
|
5302
|
+
prependAssetsGameIdUrl(url) {
|
|
5303
|
+
function hasUrlScheme(str) {
|
|
5304
|
+
return /^[a-z]+:\/\//i.test(str);
|
|
5305
|
+
}
|
|
5306
|
+
if (hasUrlScheme(url)) {
|
|
5307
|
+
return url;
|
|
5308
|
+
}
|
|
5309
|
+
if (!this.options.assetsUrl) {
|
|
5310
|
+
return `assets/${this.id}/${url}`;
|
|
5311
|
+
}
|
|
5312
|
+
return this.options.assetsUrl.replace(/\/$/, "") + "/" + url.replace(/^\//, "");
|
|
5313
|
+
}
|
|
5260
5314
|
}
|
|
5261
5315
|
|
|
5262
5316
|
class RenderedDataUrlImage {
|
|
@@ -5273,9 +5327,10 @@ class RenderedImages {
|
|
|
5273
5327
|
class LoadedImages {
|
|
5274
5328
|
}
|
|
5275
5329
|
class ImageManager {
|
|
5276
|
-
constructor() {
|
|
5330
|
+
constructor(session) {
|
|
5277
5331
|
this.renderedImages = new RenderedImages();
|
|
5278
5332
|
this.loadedImages = new LoadedImages();
|
|
5333
|
+
this.session = session;
|
|
5279
5334
|
}
|
|
5280
5335
|
/**
|
|
5281
5336
|
* Returns a CanvasKit Image that was previously rendered by the ImageManager.
|
|
@@ -5479,7 +5534,11 @@ class ImageManager {
|
|
|
5479
5534
|
).documentElement;
|
|
5480
5535
|
reloadImageUsingViewBoxWidthHeight(svgElement);
|
|
5481
5536
|
} else if (browserImage.url) {
|
|
5482
|
-
|
|
5537
|
+
const game = this.session.options.activities.filter((a) => a.type === ActivityType.Game).filter((g) => g.uuid === gameUuid).map((g) => g).find(Boolean);
|
|
5538
|
+
const browserImageUrl = game.prependAssetsGameIdUrl(
|
|
5539
|
+
browserImage.url
|
|
5540
|
+
);
|
|
5541
|
+
fetch(browserImageUrl).then((res) => res.text()).then((body) => {
|
|
5483
5542
|
const svgElement = new DOMParser().parseFromString(
|
|
5484
5543
|
body,
|
|
5485
5544
|
"text/xml"
|
|
@@ -5515,10 +5574,10 @@ class ImageManager {
|
|
|
5515
5574
|
if (browserImage.svgString) {
|
|
5516
5575
|
image.src = "data:image/svg+xml," + encodeURIComponent(browserImage.svgString);
|
|
5517
5576
|
} else if (browserImage.url) {
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
);
|
|
5577
|
+
const game = this.session.options.activities.filter((a) => a.type === ActivityType.Game).filter((g) => g.uuid === gameUuid).map((g) => g).find(Boolean);
|
|
5578
|
+
const browserImageUrl = game.prependAssetsGameIdUrl(browserImage.url);
|
|
5579
|
+
fetch(browserImageUrl).then((response) => response.arrayBuffer()).then((data) => {
|
|
5580
|
+
const base64String = this.arrayBufferToBase64String(data);
|
|
5522
5581
|
const subtype = this.inferImageSubtypeFromUrl(browserImage.url);
|
|
5523
5582
|
image.src = "data:image/" + subtype + ";base64," + base64String;
|
|
5524
5583
|
});
|
|
@@ -5529,6 +5588,14 @@ class ImageManager {
|
|
|
5529
5588
|
}
|
|
5530
5589
|
});
|
|
5531
5590
|
}
|
|
5591
|
+
arrayBufferToBase64String(buffer) {
|
|
5592
|
+
let binary = "";
|
|
5593
|
+
const bytes = new Uint8Array(buffer);
|
|
5594
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
5595
|
+
binary += String.fromCharCode(bytes[i]);
|
|
5596
|
+
}
|
|
5597
|
+
return window.btoa(binary);
|
|
5598
|
+
}
|
|
5532
5599
|
inferImageSubtypeFromUrl(url) {
|
|
5533
5600
|
var _a, _b;
|
|
5534
5601
|
let subtype = "jpeg";
|
|
@@ -5672,6 +5739,9 @@ class Label extends Entity {
|
|
|
5672
5739
|
if (options.backgroundColor) {
|
|
5673
5740
|
this.backgroundColor = options.backgroundColor;
|
|
5674
5741
|
}
|
|
5742
|
+
if (options.fontNames) {
|
|
5743
|
+
this.fontNames = options.fontNames;
|
|
5744
|
+
}
|
|
5675
5745
|
}
|
|
5676
5746
|
initialize() {
|
|
5677
5747
|
var _a, _b, _c;
|
|
@@ -5727,6 +5797,39 @@ class Label extends Entity {
|
|
|
5727
5797
|
textForParagraph = this.text;
|
|
5728
5798
|
this._translatedText = "";
|
|
5729
5799
|
}
|
|
5800
|
+
const session = this.parentSceneAsEntity.game.session;
|
|
5801
|
+
if (!session) {
|
|
5802
|
+
throw new Error("session is undefined");
|
|
5803
|
+
}
|
|
5804
|
+
const fontManager = session.fontManager;
|
|
5805
|
+
if (fontManager.fontMgr === void 0) {
|
|
5806
|
+
throw new Error("no fonts loaded");
|
|
5807
|
+
}
|
|
5808
|
+
if (this.fontName && this.fontNames) {
|
|
5809
|
+
throw new Error("cannot specify both fontName and fontNames");
|
|
5810
|
+
}
|
|
5811
|
+
const fontFamilies = new Array();
|
|
5812
|
+
if (this.fontNames) {
|
|
5813
|
+
this.fontNames.forEach((fn) => {
|
|
5814
|
+
if (fontManager.gameTypefaces[this.game.uuid][fn] === void 0) {
|
|
5815
|
+
throw new Error(`font ${fn} not found.`);
|
|
5816
|
+
}
|
|
5817
|
+
fontFamilies.push(
|
|
5818
|
+
fontManager.gameTypefaces[this.game.uuid][fn].fontFamily
|
|
5819
|
+
);
|
|
5820
|
+
});
|
|
5821
|
+
} else if (this.fontName) {
|
|
5822
|
+
if (fontManager.gameTypefaces[this.game.uuid][this.fontName] === void 0) {
|
|
5823
|
+
throw new Error(`font ${this.fontName} not found.`);
|
|
5824
|
+
}
|
|
5825
|
+
fontFamilies.push(
|
|
5826
|
+
fontManager.gameTypefaces[this.game.uuid][this.fontName].fontFamily
|
|
5827
|
+
);
|
|
5828
|
+
} else {
|
|
5829
|
+
fontFamilies.push(
|
|
5830
|
+
Object.values(fontManager.gameTypefaces[this.game.uuid]).filter((f) => f.isDefault).find(Boolean).fontFamily
|
|
5831
|
+
);
|
|
5832
|
+
}
|
|
5730
5833
|
this.paraStyle = new this.canvasKit.ParagraphStyle({
|
|
5731
5834
|
textStyle: {
|
|
5732
5835
|
color: textColor,
|
|
@@ -5736,19 +5839,11 @@ class Label extends Entity {
|
|
|
5736
5839
|
this.backgroundColor[2],
|
|
5737
5840
|
this.backgroundColor[3]
|
|
5738
5841
|
) : void 0,
|
|
5739
|
-
fontFamilies
|
|
5842
|
+
fontFamilies,
|
|
5740
5843
|
fontSize: this.fontSize * Globals.canvasScale
|
|
5741
5844
|
},
|
|
5742
5845
|
textAlign: ckTextAlign
|
|
5743
5846
|
});
|
|
5744
|
-
const session = this.parentSceneAsEntity.game.session;
|
|
5745
|
-
if (!session) {
|
|
5746
|
-
throw new Error("session is undefined");
|
|
5747
|
-
}
|
|
5748
|
-
const fontManager = session.fontManager;
|
|
5749
|
-
if (fontManager.fontMgr === void 0) {
|
|
5750
|
-
throw new Error("no fonts loaded");
|
|
5751
|
-
}
|
|
5752
5847
|
this.builder = this.canvasKit.ParagraphBuilder.Make(
|
|
5753
5848
|
this.paraStyle,
|
|
5754
5849
|
fontManager.fontMgr
|
|
@@ -5800,6 +5895,13 @@ class Label extends Entity {
|
|
|
5800
5895
|
this._fontName = fontName;
|
|
5801
5896
|
this.needsInitialization = true;
|
|
5802
5897
|
}
|
|
5898
|
+
get fontNames() {
|
|
5899
|
+
return this._fontNames;
|
|
5900
|
+
}
|
|
5901
|
+
set fontNames(fontNames) {
|
|
5902
|
+
this._fontNames = fontNames;
|
|
5903
|
+
this.needsInitialization = true;
|
|
5904
|
+
}
|
|
5803
5905
|
get fontColor() {
|
|
5804
5906
|
return this._fontColor;
|
|
5805
5907
|
}
|
|
@@ -6052,7 +6154,7 @@ function getAugmentedNamespace(n) {
|
|
|
6052
6154
|
return a;
|
|
6053
6155
|
}
|
|
6054
6156
|
|
|
6055
|
-
var canvaskit
|
|
6157
|
+
var canvaskit = {exports: {}};
|
|
6056
6158
|
|
|
6057
6159
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
6058
6160
|
//
|
|
@@ -6320,272 +6422,274 @@ var require$$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_fs$1);
|
|
|
6320
6422
|
return (
|
|
6321
6423
|
function(CanvasKitInit) {
|
|
6322
6424
|
CanvasKitInit = CanvasKitInit || {};
|
|
6323
|
-
var w;w||(w=typeof CanvasKitInit !== 'undefined' ? CanvasKitInit : {});var
|
|
6324
|
-
(function(a){a.
|
|
6325
|
-
m,4*b))f.
|
|
6326
|
-
function(){this.
|
|
6327
|
-
(function(a){a.
|
|
6425
|
+
var w;w||(w=typeof CanvasKitInit !== 'undefined' ? CanvasKitInit : {});var da,ea;w.ready=new Promise(function(a,b){da=a;ea=b;});
|
|
6426
|
+
(function(a){a.Vd=a.Vd||[];a.Vd.push(function(){a.MakeSWCanvasSurface=function(b){var d=b;if("CANVAS"!==d.tagName&&(d=document.getElementById(b),!d))throw "Canvas with id "+b+" was not found";if(b=a.MakeSurface(d.width,d.height))b.Nd=d;return b};a.MakeCanvasSurface||(a.MakeCanvasSurface=a.MakeSWCanvasSurface);a.MakeSurface=function(b,d){var f={width:b,height:d,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB},h=b*d*4,m=a._malloc(h);if(f=a.Surface._makeRasterDirect(f,
|
|
6427
|
+
m,4*b))f.Nd=null,f.Ef=b,f.Af=d,f.Cf=h,f.af=m,f.getCanvas().clear(a.TRANSPARENT);return f};a.MakeRasterDirectSurface=function(b,d,f){return a.Surface._makeRasterDirect(b,d.byteOffset,f)};a.Surface.prototype.flush=function(b){a.Od(this.Md);this._flush();if(this.Nd){var d=new Uint8ClampedArray(a.HEAPU8.buffer,this.af,this.Cf);d=new ImageData(d,this.Ef,this.Af);b?this.Nd.getContext("2d").putImageData(d,0,0,b[0],b[1],b[2]-b[0],b[3]-b[1]):this.Nd.getContext("2d").putImageData(d,0,0);}};a.Surface.prototype.dispose=
|
|
6428
|
+
function(){this.af&&a._free(this.af);this.delete();};a.Od=a.Od||function(){};a.Se=a.Se||function(){return null};});})(w);
|
|
6429
|
+
(function(a){a.Vd=a.Vd||[];a.Vd.push(function(){function b(n,q,v){return n&&n.hasOwnProperty(q)?n[q]:v}function d(n){var q=ha(ka);ka[q]=n;return q}function f(n){return n.naturalHeight||n.videoHeight||n.displayHeight||n.height}function h(n){return n.naturalWidth||n.videoWidth||n.displayWidth||n.width}function m(n,q,v,E){n.bindTexture(n.TEXTURE_2D,q);E||v.alphaType!==a.AlphaType.Premul||n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);return q}function u(n,q,v){v||q.alphaType!==a.AlphaType.Premul||
|
|
6328
6430
|
n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);n.bindTexture(n.TEXTURE_2D,null);}a.GetWebGLContext=function(n,q){if(!n)throw "null canvas passed into makeWebGLContext";var v={alpha:b(q,"alpha",1),depth:b(q,"depth",1),stencil:b(q,"stencil",8),antialias:b(q,"antialias",0),premultipliedAlpha:b(q,"premultipliedAlpha",1),preserveDrawingBuffer:b(q,"preserveDrawingBuffer",0),preferLowPowerToHighPerformance:b(q,"preferLowPowerToHighPerformance",0),failIfMajorPerformanceCaveat:b(q,"failIfMajorPerformanceCaveat",
|
|
6329
|
-
0),enableExtensionsByDefault:b(q,"enableExtensionsByDefault",1),explicitSwapControl:b(q,"explicitSwapControl",0),renderViaOffscreenBackBuffer:b(q,"renderViaOffscreenBackBuffer",0)};v.majorVersion=q&&q.majorVersion?q.majorVersion:"undefined"!==typeof WebGL2RenderingContext?2:1;if(v.explicitSwapControl)throw "explicitSwapControl is not supported";n=la(n,v);if(!n)return 0;ma(n);x.
|
|
6330
|
-
JSEvents.
|
|
6331
|
-
this._getResourceCacheLimitBytes();};a.GrDirectContext.prototype.getResourceCacheUsageBytes=function(){a.
|
|
6332
|
-
this._MakeOnScreenGLSurface(n,q,v,
|
|
6333
|
-
typeof OffscreenCanvas&&
|
|
6334
|
-
a.MakeWebGLCanvasSurface;a.Surface.prototype.makeImageFromTexture=function(n,q){a.
|
|
6335
|
-
0,
|
|
6336
|
-
n.getColorSpace();q=this._makeImageFromTexture(this.
|
|
6337
|
-
q.width,q.height,0,L.RGBA,L.UNSIGNED_BYTE,n):L.texImage2D(L.TEXTURE_2D,0,L.RGBA,L.RGBA,L.UNSIGNED_BYTE,n);u(L,q,v);return d(z)},freeSrc:function(){}};"VideoFrame"===n.constructor.name&&(
|
|
6338
|
-
(function(a){function b(e,c,g,l,
|
|
6339
|
-
Uint32Array)return e;if(e instanceof Array&&e[0]instanceof Float32Array)return e.map(h)}function u(e){if(void 0===e)return 1;var c=parseFloat(e);return e&&-1!==e.indexOf("%")?c/100:c}function n(e){return Math.round(Math.max(0,Math.min(e||0,255)))}function q(e,c){c&&c._ck||a._free(e);}function v(e,c,g){if(!e||!e.length)return V;if(e&&e._ck)return e.byteOffset;var l=a[c].BYTES_PER_ELEMENT;g||(g=a._malloc(e.length*l));a[c].set(e,g/l);return g}function
|
|
6340
|
-
if(e instanceof Float32Array)c.
|
|
6431
|
+
0),enableExtensionsByDefault:b(q,"enableExtensionsByDefault",1),explicitSwapControl:b(q,"explicitSwapControl",0),renderViaOffscreenBackBuffer:b(q,"renderViaOffscreenBackBuffer",0)};v.majorVersion=q&&q.majorVersion?q.majorVersion:"undefined"!==typeof WebGL2RenderingContext?2:1;if(v.explicitSwapControl)throw "explicitSwapControl is not supported";n=la(n,v);if(!n)return 0;ma(n);x.ge.getExtension("WEBGL_debug_renderer_info");return n};a.deleteContext=function(n){x===na[n]&&(x=null);"object"==typeof JSEvents&&
|
|
6432
|
+
JSEvents.ug(na[n].ge.canvas);na[n]&&na[n].ge.canvas&&(na[n].ge.canvas.yf=void 0);na[n]=null;};a._setTextureCleanup({deleteTexture:function(n,q){var v=ka[q];v&&na[n].ge.deleteTexture(v);ka[q]=null;}});a.MakeWebGLContext=function(n){if(!this.Od(n))return null;var q=this._MakeGrContext();if(!q)return null;q.Md=n;var v=q.delete.bind(q);q["delete"]=function(){a.Od(this.Md);v();}.bind(q);return x.ef=q};a.MakeGrContext=a.MakeWebGLContext;a.GrDirectContext.prototype.getResourceCacheLimitBytes=function(){a.Od(this.Md);
|
|
6433
|
+
this._getResourceCacheLimitBytes();};a.GrDirectContext.prototype.getResourceCacheUsageBytes=function(){a.Od(this.Md);this._getResourceCacheUsageBytes();};a.GrDirectContext.prototype.releaseResourcesAndAbandonContext=function(){a.Od(this.Md);this._releaseResourcesAndAbandonContext();};a.GrDirectContext.prototype.setResourceCacheLimitBytes=function(n){a.Od(this.Md);this._setResourceCacheLimitBytes(n);};a.MakeOnScreenGLSurface=function(n,q,v,E,G,L){if(!this.Od(n.Md))return null;q=void 0===G||void 0===L?
|
|
6434
|
+
this._MakeOnScreenGLSurface(n,q,v,E):this._MakeOnScreenGLSurface(n,q,v,E,G,L);if(!q)return null;q.Md=n.Md;return q};a.MakeRenderTarget=function(){var n=arguments[0];if(!this.Od(n.Md))return null;if(3===arguments.length){var q=this._MakeRenderTargetWH(n,arguments[1],arguments[2]);if(!q)return null}else if(2===arguments.length){if(q=this._MakeRenderTargetII(n,arguments[1]),!q)return null}else return null;q.Md=n.Md;return q};a.MakeWebGLCanvasSurface=function(n,q,v){q=q||null;var E=n,G="undefined"!==
|
|
6435
|
+
typeof OffscreenCanvas&&E instanceof OffscreenCanvas;if(!("undefined"!==typeof HTMLCanvasElement&&E instanceof HTMLCanvasElement||G||(E=document.getElementById(n),E)))throw "Canvas with id "+n+" was not found";n=this.GetWebGLContext(E,v);if(!n||0>n)throw "failed to create webgl context: err "+n;n=this.MakeWebGLContext(n);q=this.MakeOnScreenGLSurface(n,E.width,E.height,q);return q?q:(q=E.cloneNode(!0),E.parentNode.replaceChild(q,E),q.classList.add("ck-replaced"),a.MakeSWCanvasSurface(q))};a.MakeCanvasSurface=
|
|
6436
|
+
a.MakeWebGLCanvasSurface;a.Surface.prototype.makeImageFromTexture=function(n,q){a.Od(this.Md);n=d(n);if(q=this._makeImageFromTexture(this.Md,n,q))q.Le=n;return q};a.Surface.prototype.makeImageFromTextureSource=function(n,q,v){q||(q={height:f(n),width:h(n),colorType:a.ColorType.RGBA_8888,alphaType:v?a.AlphaType.Premul:a.AlphaType.Unpremul});q.colorSpace||(q.colorSpace=a.ColorSpace.SRGB);a.Od(this.Md);var E=x.ge;v=m(E,E.createTexture(),q,v);2===x.version?E.texImage2D(E.TEXTURE_2D,0,E.RGBA,q.width,q.height,
|
|
6437
|
+
0,E.RGBA,E.UNSIGNED_BYTE,n):E.texImage2D(E.TEXTURE_2D,0,E.RGBA,E.RGBA,E.UNSIGNED_BYTE,n);u(E,q);this._resetContext();return this.makeImageFromTexture(v,q)};a.Surface.prototype.updateTextureFromSource=function(n,q,v){if(n.Le){a.Od(this.Md);var E=n.getImageInfo(),G=x.ge,L=m(G,ka[n.Le],E,v);2===x.version?G.texImage2D(G.TEXTURE_2D,0,G.RGBA,h(q),f(q),0,G.RGBA,G.UNSIGNED_BYTE,q):G.texImage2D(G.TEXTURE_2D,0,G.RGBA,G.RGBA,G.UNSIGNED_BYTE,q);u(G,E,v);this._resetContext();ka[n.Le]=null;n.Le=d(L);E.colorSpace=
|
|
6438
|
+
n.getColorSpace();q=this._makeImageFromTexture(this.Md,n.Le,E);v=n.Ld.Td;G=n.Ld.$d;n.Ld.Td=q.Ld.Td;n.Ld.$d=q.Ld.$d;q.Ld.Td=v;q.Ld.$d=G;q.delete();E.colorSpace.delete();}};a.MakeLazyImageFromTextureSource=function(n,q,v){q||(q={height:f(n),width:h(n),colorType:a.ColorType.RGBA_8888,alphaType:v?a.AlphaType.Premul:a.AlphaType.Unpremul});q.colorSpace||(q.colorSpace=a.ColorSpace.SRGB);var E={makeTexture:function(){var G=x,L=G.ge,z=m(L,L.createTexture(),q,v);2===G.version?L.texImage2D(L.TEXTURE_2D,0,L.RGBA,
|
|
6439
|
+
q.width,q.height,0,L.RGBA,L.UNSIGNED_BYTE,n):L.texImage2D(L.TEXTURE_2D,0,L.RGBA,L.RGBA,L.UNSIGNED_BYTE,n);u(L,q,v);return d(z)},freeSrc:function(){}};"VideoFrame"===n.constructor.name&&(E.freeSrc=function(){n.close();});return a.Image._makeFromGenerator(q,E)};a.Od=function(n){return n?ma(n):!1};a.Se=function(){return x&&x.ef&&!x.ef.isDeleted()?x.ef:null};});})(w);
|
|
6440
|
+
(function(a){function b(e,c,g,l,t){for(var y=0;y<e.length;y++)c[y*g+(y*t+l+g)%g]=e[y];return c}function d(e){for(var c=e*e,g=Array(c);c--;)g[c]=0===c%(e+1)?1:0;return g}function f(e){return e?e.constructor===Float32Array&&4===e.length:!1}function h(e){return (n(255*e[3])<<24|n(255*e[0])<<16|n(255*e[1])<<8|n(255*e[2])<<0)>>>0}function m(e){if(e&&e._ck)return e;if(e instanceof Float32Array){for(var c=Math.floor(e.length/4),g=new Uint32Array(c),l=0;l<c;l++)g[l]=h(e.slice(4*l,4*(l+1)));return g}if(e instanceof
|
|
6441
|
+
Uint32Array)return e;if(e instanceof Array&&e[0]instanceof Float32Array)return e.map(h)}function u(e){if(void 0===e)return 1;var c=parseFloat(e);return e&&-1!==e.indexOf("%")?c/100:c}function n(e){return Math.round(Math.max(0,Math.min(e||0,255)))}function q(e,c){c&&c._ck||a._free(e);}function v(e,c,g){if(!e||!e.length)return V;if(e&&e._ck)return e.byteOffset;var l=a[c].BYTES_PER_ELEMENT;g||(g=a._malloc(e.length*l));a[c].set(e,g/l);return g}function E(e){var c={ce:V,count:e.length,colorType:a.ColorType.RGBA_F32};
|
|
6442
|
+
if(e instanceof Float32Array)c.ce=v(e,"HEAPF32"),c.count=e.length/4;else if(e instanceof Uint32Array)c.ce=v(e,"HEAPU32"),c.colorType=a.ColorType.RGBA_8888;else if(e instanceof Array){if(e&&e.length){for(var g=a._malloc(16*e.length),l=0,t=g/4,y=0;y<e.length;y++)for(var C=0;4>C;C++)a.HEAPF32[t+l]=e[y][C],l++;e=g;}else e=V;c.ce=e;}else throw "Invalid argument to copyFlexibleColorArray, Not a color array "+typeof e;return c}function G(e){if(!e)return V;var c=Ub.toTypedArray();if(e.length){if(6===e.length||
|
|
6341
6443
|
9===e.length)return v(e,"HEAPF32",Oa),6===e.length&&a.HEAPF32.set(yd,6+Oa/4),Oa;if(16===e.length)return c[0]=e[0],c[1]=e[1],c[2]=e[3],c[3]=e[4],c[4]=e[5],c[5]=e[7],c[6]=e[12],c[7]=e[13],c[8]=e[15],Oa;throw "invalid matrix size";}if(void 0===e.m11)throw "invalid matrix argument";c[0]=e.m11;c[1]=e.m21;c[2]=e.m41;c[3]=e.m12;c[4]=e.m22;c[5]=e.m42;c[6]=e.m14;c[7]=e.m24;c[8]=e.m44;return Oa}function L(e){if(!e)return V;var c=Vb.toTypedArray();if(e.length){if(16!==e.length&&6!==e.length&&9!==e.length)throw "invalid matrix size";
|
|
6342
6444
|
if(16===e.length)return v(e,"HEAPF32",ab);c.fill(0);c[0]=e[0];c[1]=e[1];c[3]=e[2];c[4]=e[3];c[5]=e[4];c[7]=e[5];c[10]=1;c[12]=e[6];c[13]=e[7];c[15]=e[8];6===e.length&&(c[12]=0,c[13]=0,c[15]=1);return ab}if(void 0===e.m11)throw "invalid matrix argument";c[0]=e.m11;c[1]=e.m21;c[2]=e.m31;c[3]=e.m41;c[4]=e.m12;c[5]=e.m22;c[6]=e.m32;c[7]=e.m42;c[8]=e.m13;c[9]=e.m23;c[10]=e.m33;c[11]=e.m43;c[12]=e.m14;c[13]=e.m24;c[14]=e.m34;c[15]=e.m44;return ab}function z(e,c){return v(e,"HEAPF32",c||Ua)}function N(e,
|
|
6343
|
-
c,g,l){var
|
|
6445
|
+
c,g,l){var t=Wb.toTypedArray();t[0]=e;t[1]=c;t[2]=g;t[3]=l;return Ua}function T(e){for(var c=new Float32Array(4),g=0;4>g;g++)c[g]=a.HEAPF32[e/4+g];return c}function U(e,c){return v(e,"HEAPF32",c||ja)}function pa(e,c){return v(e,"HEAPF32",c||Xb)}function ta(){for(var e=0,c=0;c<arguments.length-1;c+=2)e+=arguments[c]*arguments[c+1];return e}function gb(e,c,g){for(var l=Array(e.length),t=0;t<g;t++)for(var y=0;y<g;y++){for(var C=0,J=0;J<g;J++)C+=e[g*t+J]*c[g*J+y];l[t*g+y]=C;}return l}function hb(e,c){for(var g=
|
|
6344
6446
|
gb(c[0],c[1],e),l=2;l<c.length;)g=gb(g,c[l],e),l++;return g}a.Color=function(e,c,g,l){void 0===l&&(l=1);return a.Color4f(n(e)/255,n(c)/255,n(g)/255,l)};a.ColorAsInt=function(e,c,g,l){void 0===l&&(l=255);return (n(l)<<24|n(e)<<16|n(c)<<8|n(g)<<0&268435455)>>>0};a.Color4f=function(e,c,g,l){void 0===l&&(l=1);return Float32Array.of(e,c,g,l)};Object.defineProperty(a,"TRANSPARENT",{get:function(){return a.Color4f(0,0,0,0)}});Object.defineProperty(a,"BLACK",{get:function(){return a.Color4f(0,0,0,1)}});Object.defineProperty(a,
|
|
6345
6447
|
"WHITE",{get:function(){return a.Color4f(1,1,1,1)}});Object.defineProperty(a,"RED",{get:function(){return a.Color4f(1,0,0,1)}});Object.defineProperty(a,"GREEN",{get:function(){return a.Color4f(0,1,0,1)}});Object.defineProperty(a,"BLUE",{get:function(){return a.Color4f(0,0,1,1)}});Object.defineProperty(a,"YELLOW",{get:function(){return a.Color4f(1,1,0,1)}});Object.defineProperty(a,"CYAN",{get:function(){return a.Color4f(0,1,1,1)}});Object.defineProperty(a,"MAGENTA",{get:function(){return a.Color4f(1,
|
|
6346
|
-
0,1,1)}});a.getColorComponents=function(e){return [Math.floor(255*e[0]),Math.floor(255*e[1]),Math.floor(255*e[2]),e[3]]};a.parseColorString=function(e,c){e=e.toLowerCase();if(e.startsWith("#")){c=255;switch(e.length){case 9:c=parseInt(e.slice(7,9),16);case 7:var g=parseInt(e.slice(1,3),16);var l=parseInt(e.slice(3,5),16);var
|
|
6347
|
-
l,
|
|
6348
|
-
|
|
6349
|
-
(C*=4));var
|
|
6448
|
+
0,1,1)}});a.getColorComponents=function(e){return [Math.floor(255*e[0]),Math.floor(255*e[1]),Math.floor(255*e[2]),e[3]]};a.parseColorString=function(e,c){e=e.toLowerCase();if(e.startsWith("#")){c=255;switch(e.length){case 9:c=parseInt(e.slice(7,9),16);case 7:var g=parseInt(e.slice(1,3),16);var l=parseInt(e.slice(3,5),16);var t=parseInt(e.slice(5,7),16);break;case 5:c=17*parseInt(e.slice(4,5),16);case 4:g=17*parseInt(e.slice(1,2),16),l=17*parseInt(e.slice(2,3),16),t=17*parseInt(e.slice(3,4),16);}return a.Color(g,
|
|
6449
|
+
l,t,c/255)}return e.startsWith("rgba")?(e=e.slice(5,-1),e=e.split(","),a.Color(+e[0],+e[1],+e[2],u(e[3]))):e.startsWith("rgb")?(e=e.slice(4,-1),e=e.split(","),a.Color(+e[0],+e[1],+e[2],u(e[3]))):e.startsWith("gray(")||e.startsWith("hsl")||!c||(e=c[e],void 0===e)?a.BLACK:e};a.multiplyByAlpha=function(e,c){e=e.slice();e[3]=Math.max(0,Math.min(e[3]*c,1));return e};a.Malloc=function(e,c){var g=a._malloc(c*e.BYTES_PER_ELEMENT);return {_ck:!0,length:c,byteOffset:g,re:null,subarray:function(l,t){l=this.toTypedArray().subarray(l,
|
|
6450
|
+
t);l._ck=!0;return l},toTypedArray:function(){if(this.re&&this.re.length)return this.re;this.re=new e(a.HEAPU8.buffer,g,c);this.re._ck=!0;return this.re}}};a.Free=function(e){a._free(e.byteOffset);e.byteOffset=V;e.toTypedArray=null;e.re=null;};var Oa=V,Ub,ab=V,Vb,Ua=V,Wb,Ha,ja=V,Cc,Pa=V,Dc,Yb=V,Ec,Zb=V,$b,xb=V,Fc,Xb=V,Gc,Hc=V,yd=Float32Array.of(0,0,1),V=0;a.onRuntimeInitialized=function(){function e(c,g,l,t,y,C,J){C||(C=4*t.width,t.colorType===a.ColorType.RGBA_F16?C*=2:t.colorType===a.ColorType.RGBA_F32&&
|
|
6451
|
+
(C*=4));var P=C*t.height;var O=y?y.byteOffset:a._malloc(P);if(J?!c._readPixels(t,O,C,g,l,J):!c._readPixels(t,O,C,g,l))return y||a._free(O),null;if(y)return y.toTypedArray();switch(t.colorType){case a.ColorType.RGBA_8888:case a.ColorType.RGBA_F16:c=(new Uint8Array(a.HEAPU8.buffer,O,P)).slice();break;case a.ColorType.RGBA_F32:c=(new Float32Array(a.HEAPU8.buffer,O,P)).slice();break;default:return null}a._free(O);return c}Wb=a.Malloc(Float32Array,4);Ua=Wb.byteOffset;Vb=a.Malloc(Float32Array,16);ab=Vb.byteOffset;
|
|
6350
6452
|
Ub=a.Malloc(Float32Array,9);Oa=Ub.byteOffset;Fc=a.Malloc(Float32Array,12);Xb=Fc.byteOffset;Gc=a.Malloc(Float32Array,12);Hc=Gc.byteOffset;Ha=a.Malloc(Float32Array,4);ja=Ha.byteOffset;Cc=a.Malloc(Float32Array,4);Pa=Cc.byteOffset;Dc=a.Malloc(Float32Array,3);Yb=Dc.byteOffset;Ec=a.Malloc(Float32Array,3);Zb=Ec.byteOffset;$b=a.Malloc(Int32Array,4);xb=$b.byteOffset;a.ColorSpace.SRGB=a.ColorSpace._MakeSRGB();a.ColorSpace.DISPLAY_P3=a.ColorSpace._MakeDisplayP3();a.ColorSpace.ADOBE_RGB=a.ColorSpace._MakeAdobeRGB();
|
|
6351
|
-
a.GlyphRunFlags={IsWhiteSpace:a._GlyphRunFlags_isWhiteSpace};a.Path.MakeFromCmds=function(c){var g=v(c,"HEAPF32"),l=a.Path._MakeFromCmds(g,c.length);q(g,c);return l};a.Path.MakeFromVerbsPointsWeights=function(c,g,l){var
|
|
6352
|
-
g,l,!!
|
|
6353
|
-
0,c[8]||0,c[9]||1,l);else return null;return this};a.Path.prototype.addPoly=function(c,g){var l=v(c,"HEAPF32");this._addPoly(l,c.length/2,g);q(l,c);return this};a.Path.prototype.addRect=function(c,g){c=U(c);this._addRect(c,!!g);return this};a.Path.prototype.addRRect=function(c,g){c=
|
|
6354
|
-
q(
|
|
6355
|
-
function(){this._close();return this};a.Path.prototype.conicTo=function(c,g,l,
|
|
6356
|
-
(c.set(g),c):g.slice()};a.Path.prototype.lineTo=function(c,g){this._lineTo(c,g);return this};a.Path.prototype.moveTo=function(c,g){this._moveTo(c,g);return this};a.Path.prototype.offset=function(c,g){this._transform(1,0,c,0,1,g,0,0,1);return this};a.Path.prototype.quadTo=function(c,g,l,
|
|
6357
|
-
function(c,g,l,
|
|
6358
|
-
a.Path.prototype.transform=function(){if(1===arguments.length){var c=arguments[0];this._transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6]||0,c[7]||0,c[8]||1);}else if(6===arguments.length||9===arguments.length)c=arguments,this._transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6]||0,c[7]||0,c[8]||1);else throw "transform expected to take 1 or 9 arguments. Got "+arguments.length;return this};a.Path.prototype.trim=function(c,g,l){return this._trim(c,g,!!l)?this:null};a.Image.prototype.
|
|
6359
|
-
l,
|
|
6360
|
-
a.Canvas.prototype.concat=function(c){a.
|
|
6361
|
-
"
|
|
6362
|
-
this.
|
|
6363
|
-
g,l,
|
|
6364
|
-
function(c,g,l,
|
|
6365
|
-
const C=v(c,"HEAPF32"),J=g?v(m(g),"HEAPU32"):V,
|
|
6366
|
-
g);};a.Canvas.prototype.drawRect=function(c,g){a.
|
|
6367
|
-
g,l,
|
|
6368
|
-
l;l++)g[l]=a.HEAPF32[c/4+l];return g};a.Canvas.prototype.getTotalMatrix=function(){this._getTotalMatrix(Oa);for(var c=Array(9),g=0;9>g;g++)c[g]=a.HEAPF32[Oa/4+g];return c};a.Canvas.prototype.makeSurface=function(c){c=this._makeSurface(c);c.
|
|
6369
|
-
y,C,J,
|
|
6370
|
-
c.length)throw "invalid color matrix";var g=v(c,"HEAPF32"),l=a.ColorFilter._makeMatrix(g);q(g,c);return l};a.ContourMeasure.prototype.getPosTan=function(c,g){this._getPosTan(c,ja);c=Ha.toTypedArray();return g?(g.set(c),g):c.slice()};a.ImageFilter.MakeDropShadow=function(c,g,l,
|
|
6371
|
-
l,
|
|
6372
|
-
function(){this._getColor(Ua);return T(Ua)};a.Paint.prototype.setColor=function(c,g){g=g||null;c=z(c);this._setColor(c,g);};a.Paint.prototype.setColorComponents=function(c,g,l,
|
|
6373
|
-
U(c);return this._beginRecording(c)};a.Surface.prototype.getCanvas=function(){var c=this._getCanvas();c.
|
|
6374
|
-
a.Surface.prototype.requestAnimationFrame||(a.Surface.prototype.requestAnimationFrame=a.Surface.prototype.
|
|
6375
|
-
g=a.PathEffect._MakeDash(l,c.length,g);q(l,c);return g};a.PathEffect.MakeLine2D=function(c,g){g=G(g);return a.PathEffect._MakeLine2D(c,g)};a.PathEffect.MakePath2D=function(c,g){c=G(c);return a.PathEffect._MakePath2D(c,g)};a.Shader.MakeColor=function(c,g){g=g||null;c=z(c);return a.Shader._MakeColor(c,g)};a.Shader.Blend=a.Shader.MakeBlend;a.Shader.Color=a.Shader.MakeColor;a.Shader.MakeLinearGradient=function(c,g,l,
|
|
6376
|
-
|
|
6377
|
-
|
|
6453
|
+
a.GlyphRunFlags={IsWhiteSpace:a._GlyphRunFlags_isWhiteSpace};a.Path.MakeFromCmds=function(c){var g=v(c,"HEAPF32"),l=a.Path._MakeFromCmds(g,c.length);q(g,c);return l};a.Path.MakeFromVerbsPointsWeights=function(c,g,l){var t=v(c,"HEAPU8"),y=v(g,"HEAPF32"),C=v(l,"HEAPF32"),J=a.Path._MakeFromVerbsPointsWeights(t,c.length,y,g.length,C,l&&l.length||0);q(t,c);q(y,g);q(C,l);return J};a.Path.prototype.addArc=function(c,g,l){c=U(c);this._addArc(c,g,l);return this};a.Path.prototype.addCircle=function(c,g,l,t){this._addCircle(c,
|
|
6454
|
+
g,l,!!t);return this};a.Path.prototype.addOval=function(c,g,l){void 0===l&&(l=1);c=U(c);this._addOval(c,!!g,l);return this};a.Path.prototype.addPath=function(){var c=Array.prototype.slice.call(arguments),g=c[0],l=!1;"boolean"===typeof c[c.length-1]&&(l=c.pop());if(1===c.length)this._addPath(g,1,0,0,0,1,0,0,0,1,l);else if(2===c.length)c=c[1],this._addPath(g,c[0],c[1],c[2],c[3],c[4],c[5],c[6]||0,c[7]||0,c[8]||1,l);else if(7===c.length||10===c.length)this._addPath(g,c[1],c[2],c[3],c[4],c[5],c[6],c[7]||
|
|
6455
|
+
0,c[8]||0,c[9]||1,l);else return null;return this};a.Path.prototype.addPoly=function(c,g){var l=v(c,"HEAPF32");this._addPoly(l,c.length/2,g);q(l,c);return this};a.Path.prototype.addRect=function(c,g){c=U(c);this._addRect(c,!!g);return this};a.Path.prototype.addRRect=function(c,g){c=pa(c);this._addRRect(c,!!g);return this};a.Path.prototype.addVerbsPointsWeights=function(c,g,l){var t=v(c,"HEAPU8"),y=v(g,"HEAPF32"),C=v(l,"HEAPF32");this._addVerbsPointsWeights(t,c.length,y,g.length,C,l&&l.length||0);
|
|
6456
|
+
q(t,c);q(y,g);q(C,l);};a.Path.prototype.arc=function(c,g,l,t,y,C){c=a.LTRBRect(c-l,g-l,c+l,g+l);y=(y-t)/Math.PI*180-360*!!C;C=new a.Path;C.addArc(c,t/Math.PI*180,y);this.addPath(C,!0);C.delete();return this};a.Path.prototype.arcToOval=function(c,g,l,t){c=U(c);this._arcToOval(c,g,l,t);return this};a.Path.prototype.arcToRotated=function(c,g,l,t,y,C,J){this._arcToRotated(c,g,l,!!t,!!y,C,J);return this};a.Path.prototype.arcToTangent=function(c,g,l,t,y){this._arcToTangent(c,g,l,t,y);return this};a.Path.prototype.close=
|
|
6457
|
+
function(){this._close();return this};a.Path.prototype.conicTo=function(c,g,l,t,y){this._conicTo(c,g,l,t,y);return this};a.Path.prototype.computeTightBounds=function(c){this._computeTightBounds(ja);var g=Ha.toTypedArray();return c?(c.set(g),c):g.slice()};a.Path.prototype.cubicTo=function(c,g,l,t,y,C){this._cubicTo(c,g,l,t,y,C);return this};a.Path.prototype.dash=function(c,g,l){return this._dash(c,g,l)?this:null};a.Path.prototype.getBounds=function(c){this._getBounds(ja);var g=Ha.toTypedArray();return c?
|
|
6458
|
+
(c.set(g),c):g.slice()};a.Path.prototype.lineTo=function(c,g){this._lineTo(c,g);return this};a.Path.prototype.moveTo=function(c,g){this._moveTo(c,g);return this};a.Path.prototype.offset=function(c,g){this._transform(1,0,c,0,1,g,0,0,1);return this};a.Path.prototype.quadTo=function(c,g,l,t){this._quadTo(c,g,l,t);return this};a.Path.prototype.rArcTo=function(c,g,l,t,y,C,J){this._rArcTo(c,g,l,t,y,C,J);return this};a.Path.prototype.rConicTo=function(c,g,l,t,y){this._rConicTo(c,g,l,t,y);return this};a.Path.prototype.rCubicTo=
|
|
6459
|
+
function(c,g,l,t,y,C){this._rCubicTo(c,g,l,t,y,C);return this};a.Path.prototype.rLineTo=function(c,g){this._rLineTo(c,g);return this};a.Path.prototype.rMoveTo=function(c,g){this._rMoveTo(c,g);return this};a.Path.prototype.rQuadTo=function(c,g,l,t){this._rQuadTo(c,g,l,t);return this};a.Path.prototype.stroke=function(c){c=c||{};c.width=c.width||1;c.miter_limit=c.miter_limit||4;c.cap=c.cap||a.StrokeCap.Butt;c.join=c.join||a.StrokeJoin.Miter;c.precision=c.precision||1;return this._stroke(c)?this:null};
|
|
6460
|
+
a.Path.prototype.transform=function(){if(1===arguments.length){var c=arguments[0];this._transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6]||0,c[7]||0,c[8]||1);}else if(6===arguments.length||9===arguments.length)c=arguments,this._transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6]||0,c[7]||0,c[8]||1);else throw "transform expected to take 1 or 9 arguments. Got "+arguments.length;return this};a.Path.prototype.trim=function(c,g,l){return this._trim(c,g,!!l)?this:null};a.Image.prototype.encodeToBytes=function(c,g){var l=
|
|
6461
|
+
a.Se();c=c||a.ImageFormat.PNG;g=g||100;return l?this._encodeToBytes(c,g,l):this._encodeToBytes(c,g)};a.Image.prototype.makeShaderCubic=function(c,g,l,t,y){y=G(y);return this._makeShaderCubic(c,g,l,t,y)};a.Image.prototype.makeShaderOptions=function(c,g,l,t,y){y=G(y);return this._makeShaderOptions(c,g,l,t,y)};a.Image.prototype.readPixels=function(c,g,l,t,y){var C=a.Se();return e(this,c,g,l,t,y,C)};a.Canvas.prototype.clear=function(c){a.Od(this.Md);c=z(c);this._clear(c);};a.Canvas.prototype.clipRRect=
|
|
6462
|
+
function(c,g,l){a.Od(this.Md);c=pa(c);this._clipRRect(c,g,l);};a.Canvas.prototype.clipRect=function(c,g,l){a.Od(this.Md);c=U(c);this._clipRect(c,g,l);};a.Canvas.prototype.concat=function(c){a.Od(this.Md);c=L(c);this._concat(c);};a.Canvas.prototype.drawArc=function(c,g,l,t,y){a.Od(this.Md);c=U(c);this._drawArc(c,g,l,t,y);};a.Canvas.prototype.drawAtlas=function(c,g,l,t,y,C,J){if(c&&t&&g&&l&&g.length===l.length){a.Od(this.Md);y||(y=a.BlendMode.SrcOver);var P=v(g,"HEAPF32"),O=v(l,"HEAPF32"),W=l.length/4,
|
|
6463
|
+
r=v(m(C),"HEAPU32");if(J&&"B"in J&&"C"in J)this._drawAtlasCubic(c,O,P,r,W,y,J.B,J.C,t);else {let D=a.FilterMode.Linear,R=a.MipmapMode.None;J&&(D=J.filter,"mipmap"in J&&(R=J.mipmap));this._drawAtlasOptions(c,O,P,r,W,y,D,R,t);}q(P,g);q(O,l);q(r,C);}};a.Canvas.prototype.drawCircle=function(c,g,l,t){a.Od(this.Md);this._drawCircle(c,g,l,t);};a.Canvas.prototype.drawColor=function(c,g){a.Od(this.Md);c=z(c);void 0!==g?this._drawColor(c,g):this._drawColor(c);};a.Canvas.prototype.drawColorInt=function(c,g){a.Od(this.Md);
|
|
6464
|
+
this._drawColorInt(c,g||a.BlendMode.SrcOver);};a.Canvas.prototype.drawColorComponents=function(c,g,l,t,y){a.Od(this.Md);c=N(c,g,l,t);void 0!==y?this._drawColor(c,y):this._drawColor(c);};a.Canvas.prototype.drawDRRect=function(c,g,l){a.Od(this.Md);c=pa(c,Xb);g=pa(g,Hc);this._drawDRRect(c,g,l);};a.Canvas.prototype.drawImage=function(c,g,l,t){a.Od(this.Md);this._drawImage(c,g,l,t||null);};a.Canvas.prototype.drawImageCubic=function(c,g,l,t,y,C){a.Od(this.Md);this._drawImageCubic(c,g,l,t,y,C||null);};a.Canvas.prototype.drawImageOptions=
|
|
6465
|
+
function(c,g,l,t,y,C){a.Od(this.Md);this._drawImageOptions(c,g,l,t,y,C||null);};a.Canvas.prototype.drawImageNine=function(c,g,l,t,y){a.Od(this.Md);g=v(g,"HEAP32",xb);l=U(l);this._drawImageNine(c,g,l,t,y||null);};a.Canvas.prototype.drawImageRect=function(c,g,l,t,y){a.Od(this.Md);U(g,ja);U(l,Pa);this._drawImageRect(c,ja,Pa,t,!!y);};a.Canvas.prototype.drawImageRectCubic=function(c,g,l,t,y,C){a.Od(this.Md);U(g,ja);U(l,Pa);this._drawImageRectCubic(c,ja,Pa,t,y,C||null);};a.Canvas.prototype.drawImageRectOptions=
|
|
6466
|
+
function(c,g,l,t,y,C){a.Od(this.Md);U(g,ja);U(l,Pa);this._drawImageRectOptions(c,ja,Pa,t,y,C||null);};a.Canvas.prototype.drawLine=function(c,g,l,t,y){a.Od(this.Md);this._drawLine(c,g,l,t,y);};a.Canvas.prototype.drawOval=function(c,g){a.Od(this.Md);c=U(c);this._drawOval(c,g);};a.Canvas.prototype.drawPaint=function(c){a.Od(this.Md);this._drawPaint(c);};a.Canvas.prototype.drawParagraph=function(c,g,l){a.Od(this.Md);this._drawParagraph(c,g,l);};a.Canvas.prototype.drawPatch=function(c,g,l,t,y){if(24>c.length)throw "Need 12 cubic points";
|
|
6467
|
+
if(g&&4>g.length)throw "Need 4 colors";if(l&&8>l.length)throw "Need 4 shader coordinates";a.Od(this.Md);const C=v(c,"HEAPF32"),J=g?v(m(g),"HEAPU32"):V,P=l?v(l,"HEAPF32"):V;t||(t=a.BlendMode.Modulate);this._drawPatch(C,J,P,t,y);q(P,l);q(J,g);q(C,c);};a.Canvas.prototype.drawPath=function(c,g){a.Od(this.Md);this._drawPath(c,g);};a.Canvas.prototype.drawPicture=function(c){a.Od(this.Md);this._drawPicture(c);};a.Canvas.prototype.drawPoints=function(c,g,l){a.Od(this.Md);var t=v(g,"HEAPF32");this._drawPoints(c,
|
|
6468
|
+
t,g.length/2,l);q(t,g);};a.Canvas.prototype.drawRRect=function(c,g){a.Od(this.Md);c=pa(c);this._drawRRect(c,g);};a.Canvas.prototype.drawRect=function(c,g){a.Od(this.Md);c=U(c);this._drawRect(c,g);};a.Canvas.prototype.drawRect4f=function(c,g,l,t,y){a.Od(this.Md);this._drawRect4f(c,g,l,t,y);};a.Canvas.prototype.drawShadow=function(c,g,l,t,y,C,J){a.Od(this.Md);var P=v(y,"HEAPF32"),O=v(C,"HEAPF32");g=v(g,"HEAPF32",Yb);l=v(l,"HEAPF32",Zb);this._drawShadow(c,g,l,t,P,O,J);q(P,y);q(O,C);};a.getShadowLocalBounds=
|
|
6469
|
+
function(c,g,l,t,y,C,J){c=G(c);l=v(l,"HEAPF32",Yb);t=v(t,"HEAPF32",Zb);if(!this._getShadowLocalBounds(c,g,l,t,y,C,ja))return null;g=Ha.toTypedArray();return J?(J.set(g),J):g.slice()};a.Canvas.prototype.drawTextBlob=function(c,g,l,t){a.Od(this.Md);this._drawTextBlob(c,g,l,t);};a.Canvas.prototype.drawVertices=function(c,g,l){a.Od(this.Md);this._drawVertices(c,g,l);};a.Canvas.prototype.getDeviceClipBounds=function(c){this._getDeviceClipBounds(xb);var g=$b.toTypedArray();c?c.set(g):c=g.slice();return c};
|
|
6470
|
+
a.Canvas.prototype.getLocalToDevice=function(){this._getLocalToDevice(ab);for(var c=ab,g=Array(16),l=0;16>l;l++)g[l]=a.HEAPF32[c/4+l];return g};a.Canvas.prototype.getTotalMatrix=function(){this._getTotalMatrix(Oa);for(var c=Array(9),g=0;9>g;g++)c[g]=a.HEAPF32[Oa/4+g];return c};a.Canvas.prototype.makeSurface=function(c){c=this._makeSurface(c);c.Md=this.Md;return c};a.Canvas.prototype.readPixels=function(c,g,l,t,y){a.Od(this.Md);return e(this,c,g,l,t,y)};a.Canvas.prototype.saveLayer=function(c,g,l,
|
|
6471
|
+
t){g=U(g);return this._saveLayer(c||null,g,l||null,t||0)};a.Canvas.prototype.writePixels=function(c,g,l,t,y,C,J,P){if(c.byteLength%(g*l))throw "pixels length must be a multiple of the srcWidth * srcHeight";a.Od(this.Md);var O=c.byteLength/(g*l);C=C||a.AlphaType.Unpremul;J=J||a.ColorType.RGBA_8888;P=P||a.ColorSpace.SRGB;var W=O*g;O=v(c,"HEAPU8");g=this._writePixels({width:g,height:l,colorType:J,alphaType:C,colorSpace:P},O,W,t,y);q(O,c);return g};a.ColorFilter.MakeBlend=function(c,g,l){c=z(c);l=l||a.ColorSpace.SRGB;
|
|
6472
|
+
return a.ColorFilter._MakeBlend(c,g,l)};a.ColorFilter.MakeMatrix=function(c){if(!c||20!==c.length)throw "invalid color matrix";var g=v(c,"HEAPF32"),l=a.ColorFilter._makeMatrix(g);q(g,c);return l};a.ContourMeasure.prototype.getPosTan=function(c,g){this._getPosTan(c,ja);c=Ha.toTypedArray();return g?(g.set(c),g):c.slice()};a.ImageFilter.MakeDropShadow=function(c,g,l,t,y,C){y=z(y,Ua);return a.ImageFilter._MakeDropShadow(c,g,l,t,y,C)};a.ImageFilter.MakeDropShadowOnly=function(c,g,l,t,y,C){y=z(y,Ua);return a.ImageFilter._MakeDropShadowOnly(c,
|
|
6473
|
+
g,l,t,y,C)};a.ImageFilter.MakeImage=function(c,g,l,t){l=U(l,ja);t=U(t,Pa);if("B"in g&&"C"in g)return a.ImageFilter._MakeImageCubic(c,g.B,g.C,l,t);const y=g.filter;let C=a.MipmapMode.None;"mipmap"in g&&(C=g.mipmap);return a.ImageFilter._MakeImageOptions(c,y,C,l,t)};a.ImageFilter.MakeMatrixTransform=function(c,g,l){c=G(c);if("B"in g&&"C"in g)return a.ImageFilter._MakeMatrixTransformCubic(c,g.B,g.C,l);const t=g.filter;let y=a.MipmapMode.None;"mipmap"in g&&(y=g.mipmap);return a.ImageFilter._MakeMatrixTransformOptions(c,
|
|
6474
|
+
t,y,l)};a.Paint.prototype.getColor=function(){this._getColor(Ua);return T(Ua)};a.Paint.prototype.setColor=function(c,g){g=g||null;c=z(c);this._setColor(c,g);};a.Paint.prototype.setColorComponents=function(c,g,l,t,y){y=y||null;c=N(c,g,l,t);this._setColor(c,y);};a.Path.prototype.getPoint=function(c,g){this._getPoint(c,ja);c=Ha.toTypedArray();return g?(g[0]=c[0],g[1]=c[1],g):c.slice(0,2)};a.Picture.prototype.makeShader=function(c,g,l,t,y){t=G(t);y=U(y);return this._makeShader(c,g,l,t,y)};a.PictureRecorder.prototype.beginRecording=
|
|
6475
|
+
function(c){c=U(c);return this._beginRecording(c)};a.Surface.prototype.getCanvas=function(){var c=this._getCanvas();c.Md=this.Md;return c};a.Surface.prototype.makeImageSnapshot=function(c){a.Od(this.Md);c=v(c,"HEAP32",xb);return this._makeImageSnapshot(c)};a.Surface.prototype.makeSurface=function(c){a.Od(this.Md);c=this._makeSurface(c);c.Md=this.Md;return c};a.Surface.prototype.Df=function(c,g){this.He||(this.He=this.getCanvas());return requestAnimationFrame(function(){a.Od(this.Md);c(this.He);this.flush(g);}.bind(this))};
|
|
6476
|
+
a.Surface.prototype.requestAnimationFrame||(a.Surface.prototype.requestAnimationFrame=a.Surface.prototype.Df);a.Surface.prototype.zf=function(c,g){this.He||(this.He=this.getCanvas());requestAnimationFrame(function(){a.Od(this.Md);c(this.He);this.flush(g);this.dispose();}.bind(this));};a.Surface.prototype.drawOnce||(a.Surface.prototype.drawOnce=a.Surface.prototype.zf);a.PathEffect.MakeDash=function(c,g){g||(g=0);if(!c.length||1===c.length%2)throw "Intervals array must have even length";var l=v(c,"HEAPF32");
|
|
6477
|
+
g=a.PathEffect._MakeDash(l,c.length,g);q(l,c);return g};a.PathEffect.MakeLine2D=function(c,g){g=G(g);return a.PathEffect._MakeLine2D(c,g)};a.PathEffect.MakePath2D=function(c,g){c=G(c);return a.PathEffect._MakePath2D(c,g)};a.Shader.MakeColor=function(c,g){g=g||null;c=z(c);return a.Shader._MakeColor(c,g)};a.Shader.Blend=a.Shader.MakeBlend;a.Shader.Color=a.Shader.MakeColor;a.Shader.MakeLinearGradient=function(c,g,l,t,y,C,J,P){P=P||null;var O=E(l),W=v(t,"HEAPF32");J=J||0;C=G(C);var r=Ha.toTypedArray();
|
|
6478
|
+
r.set(c);r.set(g,2);c=a.Shader._MakeLinearGradient(ja,O.ce,O.colorType,W,O.count,y,J,C,P);q(O.ce,l);t&&q(W,t);return c};a.Shader.MakeRadialGradient=function(c,g,l,t,y,C,J,P){P=P||null;var O=E(l),W=v(t,"HEAPF32");J=J||0;C=G(C);c=a.Shader._MakeRadialGradient(c[0],c[1],g,O.ce,O.colorType,W,O.count,y,J,C,P);q(O.ce,l);t&&q(W,t);return c};a.Shader.MakeSweepGradient=function(c,g,l,t,y,C,J,P,O,W){W=W||null;var r=E(l),D=v(t,"HEAPF32");J=J||0;P=P||0;O=O||360;C=G(C);c=a.Shader._MakeSweepGradient(c,g,r.ce,r.colorType,
|
|
6479
|
+
D,r.count,y,P,O,J,C,W);q(r.ce,l);t&&q(D,t);return c};a.Shader.MakeTwoPointConicalGradient=function(c,g,l,t,y,C,J,P,O,W){W=W||null;var r=E(y),D=v(C,"HEAPF32");O=O||0;P=G(P);var R=Ha.toTypedArray();R.set(c);R.set(l,2);c=a.Shader._MakeTwoPointConicalGradient(ja,g,t,r.ce,r.colorType,D,r.count,J,O,P,W);q(r.ce,y);C&&q(D,C);return c};a.Vertices.prototype.bounds=function(c){this._bounds(ja);var g=Ha.toTypedArray();return c?(c.set(g),c):g.slice()};a.Vd&&a.Vd.forEach(function(c){c();});};a.computeTonalColors=
|
|
6378
6480
|
function(e){var c=v(e.ambient,"HEAPF32"),g=v(e.spot,"HEAPF32");this._computeTonalColors(c,g);var l={ambient:T(c),spot:T(g)};q(c,e.ambient);q(g,e.spot);return l};a.LTRBRect=function(e,c,g,l){return Float32Array.of(e,c,g,l)};a.XYWHRect=function(e,c,g,l){return Float32Array.of(e,c,e+g,c+l)};a.LTRBiRect=function(e,c,g,l){return Int32Array.of(e,c,g,l)};a.XYWHiRect=function(e,c,g,l){return Int32Array.of(e,c,e+g,c+l)};a.RRectXY=function(e,c,g){return Float32Array.of(e[0],e[1],e[2],e[3],c,g,c,g,c,g,c,g)};
|
|
6379
|
-
a.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var c=a._malloc(e.byteLength);a.HEAPU8.set(e,c);return (e=a._decodeAnimatedImage(c,e.byteLength))?e:null};a.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var c=a._malloc(e.byteLength);a.HEAPU8.set(e,c);return (e=a._decodeImage(c,e.byteLength))?e:null};var ib=null;a.MakeImageFromCanvasImageSource=function(e){var c=e.width,g=e.height;ib||(ib=document.createElement("canvas"));ib.width=c;ib.height=g;var l=ib.getContext("2d",{
|
|
6380
|
-
l.drawImage(e,0,0);e=l.getImageData(0,0,c,g);return a.MakeImage({width:c,height:g,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},e.data,4*c)};a.MakeImage=function(e,c,g){var l=a._malloc(c.length);a.HEAPU8.set(c,l);return a._MakeImage(e,l,c.length,g)};a.MakeVertices=function(e,c,g,l,
|
|
6381
|
-
v(g,"HEAPF32",e.texCoords());e.colors()&&v(m(l),"HEAPU32",e.colors());e.indices()&&v(
|
|
6382
|
-
e[7])/c,(e[0]*e[4]-e[1]*e[3])/c]:null};a.Matrix.mapPoints=function(e,c){for(var g=0;g<c.length;g+=2){var l=c[g],
|
|
6383
|
-
a.Matrix.skewed=function(e,c,g,l){g=g||0;l=l||0;var
|
|
6481
|
+
a.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var c=a._malloc(e.byteLength);a.HEAPU8.set(e,c);return (e=a._decodeAnimatedImage(c,e.byteLength))?e:null};a.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var c=a._malloc(e.byteLength);a.HEAPU8.set(e,c);return (e=a._decodeImage(c,e.byteLength))?e:null};var ib=null;a.MakeImageFromCanvasImageSource=function(e){var c=e.width,g=e.height;ib||(ib=document.createElement("canvas"));ib.width=c;ib.height=g;var l=ib.getContext("2d",{wg:!0});
|
|
6482
|
+
l.drawImage(e,0,0);e=l.getImageData(0,0,c,g);return a.MakeImage({width:c,height:g,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},e.data,4*c)};a.MakeImage=function(e,c,g){var l=a._malloc(c.length);a.HEAPU8.set(c,l);return a._MakeImage(e,l,c.length,g)};a.MakeVertices=function(e,c,g,l,t,y){var C=t&&t.length||0,J=0;g&&g.length&&(J|=1);l&&l.length&&(J|=2);void 0===y||y||(J|=4);e=new a._VerticesBuilder(e,c.length/2,C,J);v(c,"HEAPF32",e.positions());e.texCoords()&&
|
|
6483
|
+
v(g,"HEAPF32",e.texCoords());e.colors()&&v(m(l),"HEAPU32",e.colors());e.indices()&&v(t,"HEAPU16",e.indices());return e.detach()};a.Matrix={};a.Matrix.identity=function(){return d(3)};a.Matrix.invert=function(e){var c=e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7];return c?[(e[4]*e[8]-e[5]*e[7])/c,(e[2]*e[7]-e[1]*e[8])/c,(e[1]*e[5]-e[2]*e[4])/c,(e[5]*e[6]-e[3]*e[8])/c,(e[0]*e[8]-e[2]*e[6])/c,(e[2]*e[3]-e[0]*e[5])/c,(e[3]*e[7]-e[4]*e[6])/c,(e[1]*e[6]-e[0]*
|
|
6484
|
+
e[7])/c,(e[0]*e[4]-e[1]*e[3])/c]:null};a.Matrix.mapPoints=function(e,c){for(var g=0;g<c.length;g+=2){var l=c[g],t=c[g+1],y=e[6]*l+e[7]*t+e[8],C=e[3]*l+e[4]*t+e[5];c[g]=(e[0]*l+e[1]*t+e[2])/y;c[g+1]=C/y;}return c};a.Matrix.multiply=function(){return hb(3,arguments)};a.Matrix.rotated=function(e,c,g){c=c||0;g=g||0;var l=Math.sin(e);e=Math.cos(e);return [e,-l,ta(l,g,1-e,c),l,e,ta(-l,c,1-e,g),0,0,1]};a.Matrix.scaled=function(e,c,g,l){g=g||0;l=l||0;var t=b([e,c],d(3),3,0,1);return b([g-e*g,l-c*l],t,3,2,0)};
|
|
6485
|
+
a.Matrix.skewed=function(e,c,g,l){g=g||0;l=l||0;var t=b([e,c],d(3),3,1,-1);return b([-e*g,-c*l],t,3,2,0)};a.Matrix.translated=function(e,c){return b(arguments,d(3),3,2,0)};a.Vector={};a.Vector.dot=function(e,c){return e.map(function(g,l){return g*c[l]}).reduce(function(g,l){return g+l})};a.Vector.lengthSquared=function(e){return a.Vector.dot(e,e)};a.Vector.length=function(e){return Math.sqrt(a.Vector.lengthSquared(e))};a.Vector.mulScalar=function(e,c){return e.map(function(g){return g*c})};a.Vector.add=
|
|
6384
6486
|
function(e,c){return e.map(function(g,l){return g+c[l]})};a.Vector.sub=function(e,c){return e.map(function(g,l){return g-c[l]})};a.Vector.dist=function(e,c){return a.Vector.length(a.Vector.sub(e,c))};a.Vector.normalize=function(e){return a.Vector.mulScalar(e,1/a.Vector.length(e))};a.Vector.cross=function(e,c){return [e[1]*c[2]-e[2]*c[1],e[2]*c[0]-e[0]*c[2],e[0]*c[1]-e[1]*c[0]]};a.M44={};a.M44.identity=function(){return d(4)};a.M44.translated=function(e){return b(e,d(4),4,3,0)};a.M44.scaled=function(e){return b(e,
|
|
6385
|
-
d(4),4,0,1)};a.M44.rotated=function(e,c){return a.M44.rotatedUnitSinCos(a.Vector.normalize(e),Math.sin(c),Math.cos(c))};a.M44.rotatedUnitSinCos=function(e,c,g){var l=e[0],
|
|
6386
|
-
0);b(a.Vector.mulScalar(c,-1),l,4,2,0);b(e,l,4,3,0);e=a.M44.invert(l);return null===e?a.M44.identity():e};a.M44.perspective=function(e,c,g){var l=1/(c-e);g/=2;g=Math.cos(g)/Math.sin(g);return [g,0,0,0,0,g,0,0,0,0,(c+e)*l,2*c*e*l,0,0,-1,1]};a.M44.rc=function(e,c,g){return e[4*c+g]};a.M44.multiply=function(){return hb(4,arguments)};a.M44.invert=function(e){var c=e[0],g=e[4],l=e[8],
|
|
6387
|
-
l*y,
|
|
6487
|
+
d(4),4,0,1)};a.M44.rotated=function(e,c){return a.M44.rotatedUnitSinCos(a.Vector.normalize(e),Math.sin(c),Math.cos(c))};a.M44.rotatedUnitSinCos=function(e,c,g){var l=e[0],t=e[1];e=e[2];var y=1-g;return [y*l*l+g,y*l*t-c*e,y*l*e+c*t,0,y*l*t+c*e,y*t*t+g,y*t*e-c*l,0,y*l*e-c*t,y*t*e+c*l,y*e*e+g,0,0,0,0,1]};a.M44.lookat=function(e,c,g){c=a.Vector.normalize(a.Vector.sub(c,e));g=a.Vector.normalize(g);g=a.Vector.normalize(a.Vector.cross(c,g));var l=a.M44.identity();b(g,l,4,0,0);b(a.Vector.cross(g,c),l,4,1,
|
|
6488
|
+
0);b(a.Vector.mulScalar(c,-1),l,4,2,0);b(e,l,4,3,0);e=a.M44.invert(l);return null===e?a.M44.identity():e};a.M44.perspective=function(e,c,g){var l=1/(c-e);g/=2;g=Math.cos(g)/Math.sin(g);return [g,0,0,0,0,g,0,0,0,0,(c+e)*l,2*c*e*l,0,0,-1,1]};a.M44.rc=function(e,c,g){return e[4*c+g]};a.M44.multiply=function(){return hb(4,arguments)};a.M44.invert=function(e){var c=e[0],g=e[4],l=e[8],t=e[12],y=e[1],C=e[5],J=e[9],P=e[13],O=e[2],W=e[6],r=e[10],D=e[14],R=e[3],aa=e[7],ia=e[11];e=e[15];var qa=c*C-g*y,ua=c*J-
|
|
6489
|
+
l*y,Aa=c*P-t*y,fa=g*J-l*C,I=g*P-t*C,k=l*P-t*J,p=O*aa-W*R,A=O*ia-r*R,B=O*e-D*R,F=W*ia-r*aa,H=W*e-D*aa,M=r*e-D*ia,ba=qa*M-ua*H+Aa*F+fa*B-I*A+k*p,ca=1/ba;if(0===ba||Infinity===ca)return null;qa*=ca;ua*=ca;Aa*=ca;fa*=ca;I*=ca;k*=ca;p*=ca;A*=ca;B*=ca;F*=ca;H*=ca;M*=ca;c=[C*M-J*H+P*F,J*B-y*M-P*A,y*H-C*B+P*p,C*A-y*F-J*p,l*H-g*M-t*F,c*M-l*B+t*A,g*B-c*H-t*p,c*F-g*A+l*p,aa*k-ia*I+e*fa,ia*Aa-R*k-e*ua,R*I-aa*Aa+e*qa,aa*ua-R*fa-ia*qa,r*I-W*k-D*fa,O*k-r*Aa+D*ua,W*Aa-O*I-D*qa,O*fa-W*ua+r*qa];return c.every(function(Ia){return !isNaN(Ia)&&
|
|
6388
6490
|
Infinity!==Ia&&-Infinity!==Ia})?c:null};a.M44.transpose=function(e){return [e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]]};a.M44.mustInvert=function(e){e=a.M44.invert(e);if(null===e)throw "Matrix not invertible";return e};a.M44.setupCamera=function(e,c,g){var l=a.M44.lookat(g.eye,g.coa,g.up);g=a.M44.perspective(g.near,g.far,g.angle);c=[(e[2]-e[0])/2,(e[3]-e[1])/2,c];e=a.M44.multiply(a.M44.translated([(e[0]+e[2])/2,(e[1]+e[3])/2,0]),a.M44.scaled(c));return a.M44.multiply(e,
|
|
6389
|
-
g,l,a.M44.mustInvert(e))};a.ColorMatrix={};a.ColorMatrix.identity=function(){var e=new Float32Array(20);e[0]=1;e[6]=1;e[12]=1;e[18]=1;return e};a.ColorMatrix.scaled=function(e,c,g,l){var
|
|
6390
|
-
|
|
6391
|
-
return
|
|
6392
|
-
z(
|
|
6393
|
-
e.BLACK}),
|
|
6394
|
-
|
|
6395
|
-
V,
|
|
6396
|
-
if(!
|
|
6397
|
-
l(
|
|
6398
|
-
e.TextStyle(
|
|
6399
|
-
{},
|
|
6400
|
-
e.ParagraphBuilder.
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
v(e,"HEAPU16"),
|
|
6405
|
-
g
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
c
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
(
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
a.BlendMode.
|
|
6419
|
-
break;case "
|
|
6420
|
-
|
|
6421
|
-
break;case "
|
|
6422
|
-
|
|
6423
|
-
get:function(){return this.
|
|
6424
|
-
{enumerable:!0,get:function(){return
|
|
6425
|
-
this.
|
|
6426
|
-
k
|
|
6427
|
-
function(k){k
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
this.
|
|
6431
|
-
|
|
6432
|
-
this.
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
if(
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
this.
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
[
|
|
6453
|
-
.
|
|
6454
|
-
|
|
6455
|
-
.
|
|
6456
|
-
|
|
6457
|
-
.
|
|
6458
|
-
1),
|
|
6459
|
-
|
|
6460
|
-
.
|
|
6461
|
-
.
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
if(
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
function
|
|
6474
|
-
function
|
|
6475
|
-
function
|
|
6476
|
-
function
|
|
6477
|
-
function
|
|
6478
|
-
function
|
|
6479
|
-
function
|
|
6480
|
-
function
|
|
6481
|
-
function
|
|
6482
|
-
function
|
|
6483
|
-
function Qb(a,b,d
|
|
6484
|
-
function
|
|
6485
|
-
function
|
|
6486
|
-
function
|
|
6487
|
-
function
|
|
6488
|
-
function
|
|
6489
|
-
function
|
|
6490
|
-
|
|
6491
|
-
function
|
|
6492
|
-
|
|
6493
|
-
function
|
|
6494
|
-
function
|
|
6495
|
-
function
|
|
6496
|
-
|
|
6497
|
-
var
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
function
|
|
6501
|
-
function
|
|
6502
|
-
|
|
6503
|
-
function
|
|
6504
|
-
function
|
|
6505
|
-
|
|
6506
|
-
function
|
|
6507
|
-
function
|
|
6508
|
-
|
|
6509
|
-
function
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
function
|
|
6491
|
+
g,l,a.M44.mustInvert(e))};a.ColorMatrix={};a.ColorMatrix.identity=function(){var e=new Float32Array(20);e[0]=1;e[6]=1;e[12]=1;e[18]=1;return e};a.ColorMatrix.scaled=function(e,c,g,l){var t=new Float32Array(20);t[0]=e;t[6]=c;t[12]=g;t[18]=l;return t};var zd=[[6,7,11,12],[0,10,2,12],[0,1,5,6]];a.ColorMatrix.rotated=function(e,c,g){var l=a.ColorMatrix.identity();e=zd[e];l[e[0]]=g;l[e[1]]=c;l[e[2]]=-c;l[e[3]]=g;return l};a.ColorMatrix.postTranslate=function(e,c,g,l,t){e[4]+=c;e[9]+=g;e[14]+=l;e[19]+=
|
|
6492
|
+
t;return e};a.ColorMatrix.concat=function(e,c){for(var g=new Float32Array(20),l=0,t=0;20>t;t+=5){for(var y=0;4>y;y++)g[l++]=e[t]*c[y]+e[t+1]*c[y+5]+e[t+2]*c[y+10]+e[t+3]*c[y+15];g[l++]=e[t]*c[4]+e[t+1]*c[9]+e[t+2]*c[14]+e[t+3]*c[19]+e[t+4];}return g};(function(e){e.Vd=e.Vd||[];e.Vd.push(function(){function c(r){if(!r||!r.length)return [];for(var D=[],R=0;R<r.length;R+=5){var aa=e.LTRBRect(r[R],r[R+1],r[R+2],r[R+3]),ia=e.TextDirection.LTR;0===r[R+4]&&(ia=e.TextDirection.RTL);D.push({rect:aa,dir:ia});}e._free(r.byteOffset);
|
|
6493
|
+
return D}function g(r){r=r||{};void 0===r.weight&&(r.weight=e.FontWeight.Normal);r.width=r.width||e.FontWidth.Normal;r.slant=r.slant||e.FontSlant.Upright;return r}function l(r){if(!r||!r.length)return V;for(var D=[],R=0;R<r.length;R++){var aa=t(r[R]);D.push(aa);}return v(D,"HEAPU32")}function t(r){if(J[r])return J[r];var D=oa(r)+1,R=e._malloc(D);ra(r,K,R,D);return J[r]=R}function y(r){r._colorPtr=z(r.color);r._foregroundColorPtr=V;r._backgroundColorPtr=V;r._decorationColorPtr=V;r.foregroundColor&&
|
|
6494
|
+
(r._foregroundColorPtr=z(r.foregroundColor,P));r.backgroundColor&&(r._backgroundColorPtr=z(r.backgroundColor,O));r.decorationColor&&(r._decorationColorPtr=z(r.decorationColor,W));Array.isArray(r.fontFamilies)&&r.fontFamilies.length?(r._fontFamiliesPtr=l(r.fontFamilies),r._fontFamiliesLen=r.fontFamilies.length):(r._fontFamiliesPtr=V,r._fontFamiliesLen=0);if(r.locale){var D=r.locale;r._localePtr=t(D);r._localeLen=oa(D)+1;}else r._localePtr=V,r._localeLen=0;if(Array.isArray(r.shadows)&&r.shadows.length){D=
|
|
6495
|
+
r.shadows;var R=D.map(function(fa){return fa.color||e.BLACK}),aa=D.map(function(fa){return fa.blurRadius||0});r._shadowLen=D.length;for(var ia=e._malloc(8*D.length),qa=ia/4,ua=0;ua<D.length;ua++){var Aa=D[ua].offset||[0,0];e.HEAPF32[qa]=Aa[0];e.HEAPF32[qa+1]=Aa[1];qa+=2;}r._shadowColorsPtr=E(R).ce;r._shadowOffsetsPtr=ia;r._shadowBlurRadiiPtr=v(aa,"HEAPF32");}else r._shadowLen=0,r._shadowColorsPtr=V,r._shadowOffsetsPtr=V,r._shadowBlurRadiiPtr=V;Array.isArray(r.fontFeatures)&&r.fontFeatures.length?(D=
|
|
6496
|
+
r.fontFeatures,R=D.map(function(fa){return fa.name}),aa=D.map(function(fa){return fa.value}),r._fontFeatureLen=D.length,r._fontFeatureNamesPtr=l(R),r._fontFeatureValuesPtr=v(aa,"HEAPU32")):(r._fontFeatureLen=0,r._fontFeatureNamesPtr=V,r._fontFeatureValuesPtr=V);Array.isArray(r.fontVariations)&&r.fontVariations.length?(D=r.fontVariations,R=D.map(function(fa){return fa.axis}),aa=D.map(function(fa){return fa.value}),r._fontVariationLen=D.length,r._fontVariationAxesPtr=l(R),r._fontVariationValuesPtr=
|
|
6497
|
+
v(aa,"HEAPF32")):(r._fontVariationLen=0,r._fontVariationAxesPtr=V,r._fontVariationValuesPtr=V);}function C(r){e._free(r._fontFamiliesPtr);e._free(r._shadowColorsPtr);e._free(r._shadowOffsetsPtr);e._free(r._shadowBlurRadiiPtr);e._free(r._fontFeatureNamesPtr);e._free(r._fontFeatureValuesPtr);e._free(r._fontVariationAxesPtr);e._free(r._fontVariationValuesPtr);}e.Paragraph.prototype.getRectsForRange=function(r,D,R,aa){r=this._getRectsForRange(r,D,R,aa);return c(r)};e.Paragraph.prototype.getRectsForPlaceholders=
|
|
6498
|
+
function(){var r=this._getRectsForPlaceholders();return c(r)};e.TypefaceFontProvider.prototype.registerFont=function(r,D){r=e.Typeface.MakeFreeTypeFaceFromData(r);if(!r)return null;D=t(D);this._registerFont(r,D);};e.ParagraphStyle=function(r){r.disableHinting=r.disableHinting||!1;if(r.ellipsis){var D=r.ellipsis;r._ellipsisPtr=t(D);r._ellipsisLen=oa(D)+1;}else r._ellipsisPtr=V,r._ellipsisLen=0;null==r.heightMultiplier&&(r.heightMultiplier=-1);r.maxLines=r.maxLines||0;r.replaceTabCharacters=r.replaceTabCharacters||
|
|
6499
|
+
!1;D=(D=r.strutStyle)||{};D.strutEnabled=D.strutEnabled||!1;D.strutEnabled&&Array.isArray(D.fontFamilies)&&D.fontFamilies.length?(D._fontFamiliesPtr=l(D.fontFamilies),D._fontFamiliesLen=D.fontFamilies.length):(D._fontFamiliesPtr=V,D._fontFamiliesLen=0);D.fontStyle=g(D.fontStyle);null==D.fontSize&&(D.fontSize=-1);null==D.heightMultiplier&&(D.heightMultiplier=-1);D.halfLeading=D.halfLeading||!1;D.leading=D.leading||0;D.forceStrutHeight=D.forceStrutHeight||!1;r.strutStyle=D;r.textAlign=r.textAlign||
|
|
6500
|
+
e.TextAlign.Start;r.textDirection=r.textDirection||e.TextDirection.LTR;r.textHeightBehavior=r.textHeightBehavior||e.TextHeightBehavior.All;r.textStyle=e.TextStyle(r.textStyle);return r};e.TextStyle=function(r){r.color||(r.color=e.BLACK);r.decoration=r.decoration||0;r.decorationThickness=r.decorationThickness||0;r.decorationStyle=r.decorationStyle||e.DecorationStyle.Solid;r.textBaseline=r.textBaseline||e.TextBaseline.Alphabetic;null==r.fontSize&&(r.fontSize=-1);r.letterSpacing=r.letterSpacing||0;r.wordSpacing=
|
|
6501
|
+
r.wordSpacing||0;null==r.heightMultiplier&&(r.heightMultiplier=-1);r.halfLeading=r.halfLeading||!1;r.fontStyle=g(r.fontStyle);return r};var J={},P=e._malloc(16),O=e._malloc(16),W=e._malloc(16);e.ParagraphBuilder.Make=function(r,D){y(r.textStyle);D=e.ParagraphBuilder._Make(r,D);C(r.textStyle);return D};e.ParagraphBuilder.MakeFromFontProvider=function(r,D){y(r.textStyle);D=e.ParagraphBuilder._MakeFromFontProvider(r,D);C(r.textStyle);return D};e.ParagraphBuilder.MakeFromFontCollection=function(r,D){y(r.textStyle);
|
|
6502
|
+
D=e.ParagraphBuilder._MakeFromFontCollection(r,D);C(r.textStyle);return D};e.ParagraphBuilder.ShapeText=function(r,D,R){let aa=0;for(const ia of D)aa+=ia.length;if(aa!==r.length)throw "Accumulated block lengths must equal text.length";return e.ParagraphBuilder._ShapeText(r,D,R)};e.ParagraphBuilder.prototype.pushStyle=function(r){y(r);this._pushStyle(r);C(r);};e.ParagraphBuilder.prototype.pushPaintStyle=function(r,D,R){y(r);this._pushPaintStyle(r,D,R);C(r);};e.ParagraphBuilder.prototype.addPlaceholder=
|
|
6503
|
+
function(r,D,R,aa,ia){R=R||e.PlaceholderAlignment.Baseline;aa=aa||e.TextBaseline.Alphabetic;this._addPlaceholder(r||0,D||0,R,aa,ia||0);};e.ParagraphBuilder.prototype.setWordsUtf8=function(r){var D=v(r,"HEAPU32");this._setWordsUtf8(D,r&&r.length||0);q(D,r);};e.ParagraphBuilder.prototype.setWordsUtf16=function(r){var D=v(r,"HEAPU32");this._setWordsUtf16(D,r&&r.length||0);q(D,r);};e.ParagraphBuilder.prototype.setGraphemeBreaksUtf8=function(r){var D=v(r,"HEAPU32");this._setGraphemeBreaksUtf8(D,r&&r.length||
|
|
6504
|
+
0);q(D,r);};e.ParagraphBuilder.prototype.setGraphemeBreaksUtf16=function(r){var D=v(r,"HEAPU32");this._setGraphemeBreaksUtf16(D,r&&r.length||0);q(D,r);};e.ParagraphBuilder.prototype.setLineBreaksUtf8=function(r){var D=v(r,"HEAPU32");this._setLineBreaksUtf8(D,r&&r.length||0);q(D,r);};e.ParagraphBuilder.prototype.setLineBreaksUtf16=function(r){var D=v(r,"HEAPU32");this._setLineBreaksUtf16(D,r&&r.length||0);q(D,r);};});})(w);a.Vd=a.Vd||[];a.Vd.push(function(){a.Path.prototype.op=function(e,c){return this._op(e,
|
|
6505
|
+
c)?this:null};a.Path.prototype.simplify=function(){return this._simplify()?this:null};});a.Vd=a.Vd||[];a.Vd.push(function(){a.Canvas.prototype.drawText=function(e,c,g,l,t){var y=oa(e),C=a._malloc(y+1);ra(e,K,C,y+1);this._drawSimpleText(C,y,c,g,t,l);a._free(C);};a.Canvas.prototype.drawGlyphs=function(e,c,g,l,t,y){if(!(2*e.length<=c.length))throw "Not enough positions for the array of gyphs";a.Od(this.Md);const C=v(e,"HEAPU16"),J=v(c,"HEAPF32");this._drawGlyphs(e.length,C,J,g,l,t,y);q(J,c);q(C,e);};a.Font.prototype.getGlyphBounds=
|
|
6506
|
+
function(e,c,g){var l=v(e,"HEAPU16"),t=a._malloc(16*e.length);this._getGlyphWidthBounds(l,e.length,V,t,c||null);c=new Float32Array(a.HEAPU8.buffer,t,4*e.length);q(l,e);if(g)return g.set(c),a._free(t),g;e=Float32Array.from(c);a._free(t);return e};a.Font.prototype.getGlyphIDs=function(e,c,g){c||(c=e.length);var l=oa(e)+1,t=a._malloc(l);ra(e,K,t,l);e=a._malloc(2*c);c=this._getGlyphIDs(t,l-1,c,e);a._free(t);if(0>c)return a._free(e),null;t=new Uint16Array(a.HEAPU8.buffer,e,c);if(g)return g.set(t),a._free(e),
|
|
6507
|
+
g;g=Uint16Array.from(t);a._free(e);return g};a.Font.prototype.getGlyphIntercepts=function(e,c,g,l){var t=v(e,"HEAPU16"),y=v(c,"HEAPF32");return this._getGlyphIntercepts(t,e.length,!(e&&e._ck),y,c.length,!(c&&c._ck),g,l)};a.Font.prototype.getGlyphWidths=function(e,c,g){var l=v(e,"HEAPU16"),t=a._malloc(4*e.length);this._getGlyphWidthBounds(l,e.length,t,V,c||null);c=new Float32Array(a.HEAPU8.buffer,t,e.length);q(l,e);if(g)return g.set(c),a._free(t),g;e=Float32Array.from(c);a._free(t);return e};a.FontMgr.FromData=
|
|
6508
|
+
function(){if(!arguments.length)return null;var e=arguments;1===e.length&&Array.isArray(e[0])&&(e=arguments[0]);if(!e.length)return null;for(var c=[],g=[],l=0;l<e.length;l++){var t=new Uint8Array(e[l]),y=v(t,"HEAPU8");c.push(y);g.push(t.byteLength);}c=v(c,"HEAPU32");g=v(g,"HEAPU32");e=a.FontMgr._fromData(c,g,e.length);a._free(c);a._free(g);return e};a.Typeface.MakeFreeTypeFaceFromData=function(e){e=new Uint8Array(e);var c=v(e,"HEAPU8");return (e=a.Typeface._MakeFreeTypeFaceFromData(c,e.byteLength))?
|
|
6509
|
+
e:null};a.Typeface.prototype.getGlyphIDs=function(e,c,g){c||(c=e.length);var l=oa(e)+1,t=a._malloc(l);ra(e,K,t,l);e=a._malloc(2*c);c=this._getGlyphIDs(t,l-1,c,e);a._free(t);if(0>c)return a._free(e),null;t=new Uint16Array(a.HEAPU8.buffer,e,c);if(g)return g.set(t),a._free(e),g;g=Uint16Array.from(t);a._free(e);return g};a.TextBlob.MakeOnPath=function(e,c,g,l){if(e&&e.length&&c&&c.countPoints()){if(1===c.countPoints())return this.MakeFromText(e,g);l||(l=0);var t=g.getGlyphIDs(e);t=g.getGlyphWidths(t);
|
|
6510
|
+
var y=[];c=new a.ContourMeasureIter(c,!1,1);for(var C=c.next(),J=new Float32Array(4),P=0;P<e.length&&C;P++){var O=t[P];l+=O/2;if(l>C.length()){C.delete();C=c.next();if(!C){e=e.substring(0,P);break}l=O/2;}C.getPosTan(l,J);var W=J[2],r=J[3];y.push(W,r,J[0]-O/2*W,J[1]-O/2*r);l+=O/2;}e=this.MakeFromRSXform(e,y,g);C&&C.delete();c.delete();return e}};a.TextBlob.MakeFromRSXform=function(e,c,g){var l=oa(e)+1,t=a._malloc(l);ra(e,K,t,l);e=v(c,"HEAPF32");g=a.TextBlob._MakeFromRSXform(t,l-1,e,g);a._free(t);return g?
|
|
6511
|
+
g:null};a.TextBlob.MakeFromRSXformGlyphs=function(e,c,g){var l=v(e,"HEAPU16");c=v(c,"HEAPF32");g=a.TextBlob._MakeFromRSXformGlyphs(l,2*e.length,c,g);q(l,e);return g?g:null};a.TextBlob.MakeFromGlyphs=function(e,c){var g=v(e,"HEAPU16");c=a.TextBlob._MakeFromGlyphs(g,2*e.length,c);q(g,e);return c?c:null};a.TextBlob.MakeFromText=function(e,c){var g=oa(e)+1,l=a._malloc(g);ra(e,K,l,g);e=a.TextBlob._MakeFromText(l,g-1,c);a._free(l);return e?e:null};a.MallocGlyphIDs=function(e){return a.Malloc(Uint16Array,
|
|
6512
|
+
e)};});a.Vd=a.Vd||[];a.Vd.push(function(){a.MakePicture=function(e){e=new Uint8Array(e);var c=a._malloc(e.byteLength);a.HEAPU8.set(e,c);return (e=a._MakePicture(c,e.byteLength))?e:null};});a.Vd=a.Vd||[];a.Vd.push(function(){a.RuntimeEffect.Make=function(e,c){return a.RuntimeEffect._Make(e,{onError:c||function(g){console.log("RuntimeEffect error",g);}})};a.RuntimeEffect.prototype.makeShader=function(e,c){var g=!e._ck,l=v(e,"HEAPF32");c=G(c);return this._makeShader(l,4*e.length,g,c)};a.RuntimeEffect.prototype.makeShaderWithChildren=
|
|
6513
|
+
function(e,c,g){var l=!e._ck,t=v(e,"HEAPF32");g=G(g);for(var y=[],C=0;C<c.length;C++)y.push(c[C].Ld.Td);c=v(y,"HEAPU32");return this._makeShaderWithChildren(t,4*e.length,l,c,y.length,g)};});(function(){function e(I){for(var k=0;k<I.length;k++)if(void 0!==I[k]&&!Number.isFinite(I[k]))return !1;return !0}function c(I){var k=a.getColorComponents(I);I=k[0];var p=k[1],A=k[2];k=k[3];if(1===k)return I=I.toString(16).toLowerCase(),p=p.toString(16).toLowerCase(),A=A.toString(16).toLowerCase(),I=1===I.length?
|
|
6514
|
+
"0"+I:I,p=1===p.length?"0"+p:p,A=1===A.length?"0"+A:A,"#"+I+p+A;k=0===k||1===k?k:k.toFixed(8);return "rgba("+I+", "+p+", "+A+", "+k+")"}function g(I){return a.parseColorString(I,ua)}function l(I){I=Aa.exec(I);if(!I)return null;var k=parseFloat(I[4]),p=16;switch(I[5]){case "em":case "rem":p=16*k;break;case "pt":p=4*k/3;break;case "px":p=k;break;case "pc":p=16*k;break;case "in":p=96*k;break;case "cm":p=96*k/2.54;break;case "mm":p=96/25.4*k;break;case "q":p=96/25.4/4*k;break;case "%":p=16/75*k;}return {style:I[1],
|
|
6515
|
+
variant:I[2],weight:I[3],sizePx:p,family:I[6].trim()}}function t(I){this.Nd=I;this.Qd=new a.Paint;this.Qd.setAntiAlias(!0);this.Qd.setStrokeMiter(10);this.Qd.setStrokeCap(a.StrokeCap.Butt);this.Qd.setStrokeJoin(a.StrokeJoin.Miter);this.Qe="10px monospace";this.ne=new a.Font(null,10);this.ne.setSubpixel(!0);this.be=this.he=a.BLACK;this.we=0;this.Je=a.TRANSPARENT;this.ye=this.xe=0;this.Ke=this.ke=1;this.Ie=0;this.ve=[];this.Pd=a.BlendMode.SrcOver;this.Qd.setStrokeWidth(this.Ke);this.Qd.setBlendMode(this.Pd);
|
|
6516
|
+
this.Sd=new a.Path;this.Ud=a.Matrix.identity();this.mf=[];this.Ce=[];this.me=function(){this.Sd.delete();this.Qd.delete();this.ne.delete();this.Ce.forEach(function(k){k.me();});};Object.defineProperty(this,"currentTransform",{enumerable:!0,get:function(){return {a:this.Ud[0],c:this.Ud[1],e:this.Ud[2],b:this.Ud[3],d:this.Ud[4],f:this.Ud[5]}},set:function(k){k.a&&this.setTransform(k.a,k.b,k.c,k.d,k.e,k.f);}});Object.defineProperty(this,"fillStyle",{enumerable:!0,get:function(){return f(this.be)?c(this.be):
|
|
6517
|
+
this.be},set:function(k){"string"===typeof k?this.be=g(k):k.ue&&(this.be=k);}});Object.defineProperty(this,"font",{enumerable:!0,get:function(){return this.Qe},set:function(k){var p=l(k),A=p.family;p.typeface=fa[A]?fa[A][(p.style||"normal")+"|"+(p.variant||"normal")+"|"+(p.weight||"normal")]||fa[A]["*"]:null;p&&(this.ne.setSize(p.sizePx),this.ne.setTypeface(p.typeface),this.Qe=k);}});Object.defineProperty(this,"globalAlpha",{enumerable:!0,get:function(){return this.ke},set:function(k){!isFinite(k)||
|
|
6518
|
+
0>k||1<k||(this.ke=k);}});Object.defineProperty(this,"globalCompositeOperation",{enumerable:!0,get:function(){switch(this.Pd){case a.BlendMode.SrcOver:return "source-over";case a.BlendMode.DstOver:return "destination-over";case a.BlendMode.Src:return "copy";case a.BlendMode.Dst:return "destination";case a.BlendMode.Clear:return "clear";case a.BlendMode.SrcIn:return "source-in";case a.BlendMode.DstIn:return "destination-in";case a.BlendMode.SrcOut:return "source-out";case a.BlendMode.DstOut:return "destination-out";
|
|
6519
|
+
case a.BlendMode.SrcATop:return "source-atop";case a.BlendMode.DstATop:return "destination-atop";case a.BlendMode.Xor:return "xor";case a.BlendMode.Plus:return "lighter";case a.BlendMode.Multiply:return "multiply";case a.BlendMode.Screen:return "screen";case a.BlendMode.Overlay:return "overlay";case a.BlendMode.Darken:return "darken";case a.BlendMode.Lighten:return "lighten";case a.BlendMode.ColorDodge:return "color-dodge";case a.BlendMode.ColorBurn:return "color-burn";case a.BlendMode.HardLight:return "hard-light";
|
|
6520
|
+
case a.BlendMode.SoftLight:return "soft-light";case a.BlendMode.Difference:return "difference";case a.BlendMode.Exclusion:return "exclusion";case a.BlendMode.Hue:return "hue";case a.BlendMode.Saturation:return "saturation";case a.BlendMode.Color:return "color";case a.BlendMode.Luminosity:return "luminosity"}},set:function(k){switch(k){case "source-over":this.Pd=a.BlendMode.SrcOver;break;case "destination-over":this.Pd=a.BlendMode.DstOver;break;case "copy":this.Pd=a.BlendMode.Src;break;case "destination":this.Pd=
|
|
6521
|
+
a.BlendMode.Dst;break;case "clear":this.Pd=a.BlendMode.Clear;break;case "source-in":this.Pd=a.BlendMode.SrcIn;break;case "destination-in":this.Pd=a.BlendMode.DstIn;break;case "source-out":this.Pd=a.BlendMode.SrcOut;break;case "destination-out":this.Pd=a.BlendMode.DstOut;break;case "source-atop":this.Pd=a.BlendMode.SrcATop;break;case "destination-atop":this.Pd=a.BlendMode.DstATop;break;case "xor":this.Pd=a.BlendMode.Xor;break;case "lighter":this.Pd=a.BlendMode.Plus;break;case "plus-lighter":this.Pd=
|
|
6522
|
+
a.BlendMode.Plus;break;case "plus-darker":throw "plus-darker is not supported";case "multiply":this.Pd=a.BlendMode.Multiply;break;case "screen":this.Pd=a.BlendMode.Screen;break;case "overlay":this.Pd=a.BlendMode.Overlay;break;case "darken":this.Pd=a.BlendMode.Darken;break;case "lighten":this.Pd=a.BlendMode.Lighten;break;case "color-dodge":this.Pd=a.BlendMode.ColorDodge;break;case "color-burn":this.Pd=a.BlendMode.ColorBurn;break;case "hard-light":this.Pd=a.BlendMode.HardLight;break;case "soft-light":this.Pd=
|
|
6523
|
+
a.BlendMode.SoftLight;break;case "difference":this.Pd=a.BlendMode.Difference;break;case "exclusion":this.Pd=a.BlendMode.Exclusion;break;case "hue":this.Pd=a.BlendMode.Hue;break;case "saturation":this.Pd=a.BlendMode.Saturation;break;case "color":this.Pd=a.BlendMode.Color;break;case "luminosity":this.Pd=a.BlendMode.Luminosity;break;default:return}this.Qd.setBlendMode(this.Pd);}});Object.defineProperty(this,"imageSmoothingEnabled",{enumerable:!0,get:function(){return !0},set:function(){}});Object.defineProperty(this,
|
|
6524
|
+
"imageSmoothingQuality",{enumerable:!0,get:function(){return "high"},set:function(){}});Object.defineProperty(this,"lineCap",{enumerable:!0,get:function(){switch(this.Qd.getStrokeCap()){case a.StrokeCap.Butt:return "butt";case a.StrokeCap.Round:return "round";case a.StrokeCap.Square:return "square"}},set:function(k){switch(k){case "butt":this.Qd.setStrokeCap(a.StrokeCap.Butt);break;case "round":this.Qd.setStrokeCap(a.StrokeCap.Round);break;case "square":this.Qd.setStrokeCap(a.StrokeCap.Square);}}});Object.defineProperty(this,
|
|
6525
|
+
"lineDashOffset",{enumerable:!0,get:function(){return this.Ie},set:function(k){isFinite(k)&&(this.Ie=k);}});Object.defineProperty(this,"lineJoin",{enumerable:!0,get:function(){switch(this.Qd.getStrokeJoin()){case a.StrokeJoin.Miter:return "miter";case a.StrokeJoin.Round:return "round";case a.StrokeJoin.Bevel:return "bevel"}},set:function(k){switch(k){case "miter":this.Qd.setStrokeJoin(a.StrokeJoin.Miter);break;case "round":this.Qd.setStrokeJoin(a.StrokeJoin.Round);break;case "bevel":this.Qd.setStrokeJoin(a.StrokeJoin.Bevel);}}});
|
|
6526
|
+
Object.defineProperty(this,"lineWidth",{enumerable:!0,get:function(){return this.Qd.getStrokeWidth()},set:function(k){0>=k||!k||(this.Ke=k,this.Qd.setStrokeWidth(k));}});Object.defineProperty(this,"miterLimit",{enumerable:!0,get:function(){return this.Qd.getStrokeMiter()},set:function(k){0>=k||!k||this.Qd.setStrokeMiter(k);}});Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.we},set:function(k){0>k||!isFinite(k)||(this.we=k);}});Object.defineProperty(this,"shadowColor",
|
|
6527
|
+
{enumerable:!0,get:function(){return c(this.Je)},set:function(k){this.Je=g(k);}});Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.xe},set:function(k){isFinite(k)&&(this.xe=k);}});Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,get:function(){return this.ye},set:function(k){isFinite(k)&&(this.ye=k);}});Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return c(this.he)},set:function(k){"string"===typeof k?this.he=g(k):k.ue&&(this.he=
|
|
6528
|
+
k);}});this.arc=function(k,p,A,B,F,H){D(this.Sd,k,p,A,A,0,B,F,H);};this.arcTo=function(k,p,A,B,F){O(this.Sd,k,p,A,B,F);};this.beginPath=function(){this.Sd.delete();this.Sd=new a.Path;};this.bezierCurveTo=function(k,p,A,B,F,H){var M=this.Sd;e([k,p,A,B,F,H])&&(M.isEmpty()&&M.moveTo(k,p),M.cubicTo(k,p,A,B,F,H));};this.clearRect=function(k,p,A,B){this.Qd.setStyle(a.PaintStyle.Fill);this.Qd.setBlendMode(a.BlendMode.Clear);this.Nd.drawRect(a.XYWHRect(k,p,A,B),this.Qd);this.Qd.setBlendMode(this.Pd);};this.clip=
|
|
6529
|
+
function(k,p){"string"===typeof k?(p=k,k=this.Sd):k&&k.$e&&(k=k.Wd);k||(k=this.Sd);k=k.copy();p&&"evenodd"===p.toLowerCase()?k.setFillType(a.FillType.EvenOdd):k.setFillType(a.FillType.Winding);this.Nd.clipPath(k,a.ClipOp.Intersect,!0);k.delete();};this.closePath=function(){W(this.Sd);};this.createImageData=function(){if(1===arguments.length){var k=arguments[0];return new J(new Uint8ClampedArray(4*k.width*k.height),k.width,k.height)}if(2===arguments.length){k=arguments[0];var p=arguments[1];return new J(new Uint8ClampedArray(4*
|
|
6530
|
+
k*p),k,p)}throw "createImageData expects 1 or 2 arguments, got "+arguments.length;};this.createLinearGradient=function(k,p,A,B){if(e(arguments)){var F=new P(k,p,A,B);this.Ce.push(F);return F}};this.createPattern=function(k,p){k=new ia(k,p);this.Ce.push(k);return k};this.createRadialGradient=function(k,p,A,B,F,H){if(e(arguments)){var M=new qa(k,p,A,B,F,H);this.Ce.push(M);return M}};this.drawImage=function(k){k instanceof C&&(k=k.tf());var p=this.Pe();if(3===arguments.length||5===arguments.length)var A=
|
|
6531
|
+
a.XYWHRect(arguments[1],arguments[2],arguments[3]||k.width(),arguments[4]||k.height()),B=a.XYWHRect(0,0,k.width(),k.height());else if(9===arguments.length)A=a.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]),B=a.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4]);else throw "invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;this.Nd.drawImageRect(k,B,A,p,!1);p.dispose();};this.ellipse=function(k,p,A,B,F,H,M,ba){D(this.Sd,k,p,A,B,F,H,M,ba);};this.Pe=function(){var k=
|
|
6532
|
+
this.Qd.copy();k.setStyle(a.PaintStyle.Fill);if(f(this.be)){var p=a.multiplyByAlpha(this.be,this.ke);k.setColor(p);}else p=this.be.ue(this.Ud),k.setColor(a.Color(0,0,0,this.ke)),k.setShader(p);k.dispose=function(){this.delete();};return k};this.fill=function(k,p){"string"===typeof k?(p=k,k=this.Sd):k&&k.$e&&(k=k.Wd);if("evenodd"===p)this.Sd.setFillType(a.FillType.EvenOdd);else {if("nonzero"!==p&&p)throw "invalid fill rule";this.Sd.setFillType(a.FillType.Winding);}k||(k=this.Sd);p=this.Pe();var A=this.ze(p);
|
|
6533
|
+
A&&(this.Nd.save(),this.se(),this.Nd.drawPath(k,A),this.Nd.restore(),A.dispose());this.Nd.drawPath(k,p);p.dispose();};this.fillRect=function(k,p,A,B){var F=this.Pe(),H=this.ze(F);H&&(this.Nd.save(),this.se(),this.Nd.drawRect(a.XYWHRect(k,p,A,B),H),this.Nd.restore(),H.dispose());this.Nd.drawRect(a.XYWHRect(k,p,A,B),F);F.dispose();};this.fillText=function(k,p,A){var B=this.Pe();k=a.TextBlob.MakeFromText(k,this.ne);var F=this.ze(B);F&&(this.Nd.save(),this.se(),this.Nd.drawTextBlob(k,p,A,F),this.Nd.restore(),
|
|
6534
|
+
F.dispose());this.Nd.drawTextBlob(k,p,A,B);k.delete();B.dispose();};this.getImageData=function(k,p,A,B){return (k=this.Nd.readPixels(k,p,{width:A,height:B,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB}))?new J(new Uint8ClampedArray(k.buffer),A,B):null};this.getLineDash=function(){return this.ve.slice()};this.nf=function(k){var p=a.Matrix.invert(this.Ud);a.Matrix.mapPoints(p,k);return k};this.isPointInPath=function(k,p,A){var B=arguments;if(3===B.length)var F=
|
|
6535
|
+
this.Sd;else if(4===B.length)F=B[0],k=B[1],p=B[2],A=B[3];else throw "invalid arg count, need 3 or 4, got "+B.length;if(!isFinite(k)||!isFinite(p))return !1;A=A||"nonzero";if("nonzero"!==A&&"evenodd"!==A)return !1;B=this.nf([k,p]);k=B[0];p=B[1];F.setFillType("nonzero"===A?a.FillType.Winding:a.FillType.EvenOdd);return F.contains(k,p)};this.isPointInStroke=function(k,p){var A=arguments;if(2===A.length)var B=this.Sd;else if(3===A.length)B=A[0],k=A[1],p=A[2];else throw "invalid arg count, need 2 or 3, got "+
|
|
6536
|
+
A.length;if(!isFinite(k)||!isFinite(p))return !1;A=this.nf([k,p]);k=A[0];p=A[1];B=B.copy();B.setFillType(a.FillType.Winding);B.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.Qd.getStrokeCap(),join:this.Qd.getStrokeJoin(),precision:.3});A=B.contains(k,p);B.delete();return A};this.lineTo=function(k,p){R(this.Sd,k,p);};this.measureText=function(k){k=this.ne.getGlyphIDs(k);k=this.ne.getGlyphWidths(k);let p=0;for(const A of k)p+=A;return {width:p}};this.moveTo=function(k,p){var A=this.Sd;
|
|
6537
|
+
e([k,p])&&A.moveTo(k,p);};this.putImageData=function(k,p,A,B,F,H,M){if(e([p,A,B,F,H,M]))if(void 0===B)this.Nd.writePixels(k.data,k.width,k.height,p,A);else if(B=B||0,F=F||0,H=H||k.width,M=M||k.height,0>H&&(B+=H,H=Math.abs(H)),0>M&&(F+=M,M=Math.abs(M)),0>B&&(H+=B,B=0),0>F&&(M+=F,F=0),!(0>=H||0>=M)){k=a.MakeImage({width:k.width,height:k.height,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},k.data,4*k.width);var ba=a.XYWHRect(B,F,H,M);p=a.XYWHRect(p+B,A+F,
|
|
6538
|
+
H,M);A=a.Matrix.invert(this.Ud);this.Nd.save();this.Nd.concat(A);this.Nd.drawImageRect(k,ba,p,null,!1);this.Nd.restore();k.delete();}};this.quadraticCurveTo=function(k,p,A,B){var F=this.Sd;e([k,p,A,B])&&(F.isEmpty()&&F.moveTo(k,p),F.quadTo(k,p,A,B));};this.rect=function(k,p,A,B){var F=this.Sd;k=a.XYWHRect(k,p,A,B);e(k)&&F.addRect(k);};this.resetTransform=function(){this.Sd.transform(this.Ud);var k=a.Matrix.invert(this.Ud);this.Nd.concat(k);this.Ud=this.Nd.getTotalMatrix();};this.restore=function(){var k=
|
|
6539
|
+
this.mf.pop();if(k){var p=a.Matrix.multiply(this.Ud,a.Matrix.invert(k.Gf));this.Sd.transform(p);this.Qd.delete();this.Qd=k.$f;this.ve=k.Yf;this.Ke=k.mg;this.he=k.lg;this.be=k.fs;this.xe=k.jg;this.ye=k.kg;this.we=k.dg;this.Je=k.ig;this.ke=k.Nf;this.Pd=k.Of;this.Ie=k.Zf;this.Qe=k.Mf;this.Nd.restore();this.Ud=this.Nd.getTotalMatrix();}};this.rotate=function(k){if(isFinite(k)){var p=a.Matrix.rotated(-k);this.Sd.transform(p);this.Nd.rotate(k/Math.PI*180,0,0);this.Ud=this.Nd.getTotalMatrix();}};this.save=
|
|
6540
|
+
function(){if(this.be.te){var k=this.be.te();this.Ce.push(k);}else k=this.be;if(this.he.te){var p=this.he.te();this.Ce.push(p);}else p=this.he;this.mf.push({Gf:this.Ud.slice(),Yf:this.ve.slice(),mg:this.Ke,lg:p,fs:k,jg:this.xe,kg:this.ye,dg:this.we,ig:this.Je,Nf:this.ke,Zf:this.Ie,Of:this.Pd,$f:this.Qd.copy(),Mf:this.Qe});this.Nd.save();};this.scale=function(k,p){if(e(arguments)){var A=a.Matrix.scaled(1/k,1/p);this.Sd.transform(A);this.Nd.scale(k,p);this.Ud=this.Nd.getTotalMatrix();}};this.setLineDash=
|
|
6541
|
+
function(k){for(var p=0;p<k.length;p++)if(!isFinite(k[p])||0>k[p])return;1===k.length%2&&Array.prototype.push.apply(k,k);this.ve=k;};this.setTransform=function(k,p,A,B,F,H){e(arguments)&&(this.resetTransform(),this.transform(k,p,A,B,F,H));};this.se=function(){var k=a.Matrix.invert(this.Ud);this.Nd.concat(k);this.Nd.concat(a.Matrix.translated(this.xe,this.ye));this.Nd.concat(this.Ud);};this.ze=function(k){var p=a.multiplyByAlpha(this.Je,this.ke);if(!a.getColorComponents(p)[3]||!(this.we||this.ye||this.xe))return null;
|
|
6542
|
+
k=k.copy();k.setColor(p);var A=a.MaskFilter.MakeBlur(a.BlurStyle.Normal,this.we/2,!1);k.setMaskFilter(A);k.dispose=function(){A.delete();this.delete();};return k};this.bf=function(){var k=this.Qd.copy();k.setStyle(a.PaintStyle.Stroke);if(f(this.he)){var p=a.multiplyByAlpha(this.he,this.ke);k.setColor(p);}else p=this.he.ue(this.Ud),k.setColor(a.Color(0,0,0,this.ke)),k.setShader(p);k.setStrokeWidth(this.Ke);if(this.ve.length){var A=a.PathEffect.MakeDash(this.ve,this.Ie);k.setPathEffect(A);}k.dispose=function(){A&&
|
|
6543
|
+
A.delete();this.delete();};return k};this.stroke=function(k){k=k?k.Wd:this.Sd;var p=this.bf(),A=this.ze(p);A&&(this.Nd.save(),this.se(),this.Nd.drawPath(k,A),this.Nd.restore(),A.dispose());this.Nd.drawPath(k,p);p.dispose();};this.strokeRect=function(k,p,A,B){var F=this.bf(),H=this.ze(F);H&&(this.Nd.save(),this.se(),this.Nd.drawRect(a.XYWHRect(k,p,A,B),H),this.Nd.restore(),H.dispose());this.Nd.drawRect(a.XYWHRect(k,p,A,B),F);F.dispose();};this.strokeText=function(k,p,A){var B=this.bf();k=a.TextBlob.MakeFromText(k,
|
|
6544
|
+
this.ne);var F=this.ze(B);F&&(this.Nd.save(),this.se(),this.Nd.drawTextBlob(k,p,A,F),this.Nd.restore(),F.dispose());this.Nd.drawTextBlob(k,p,A,B);k.delete();B.dispose();};this.translate=function(k,p){if(e(arguments)){var A=a.Matrix.translated(-k,-p);this.Sd.transform(A);this.Nd.translate(k,p);this.Ud=this.Nd.getTotalMatrix();}};this.transform=function(k,p,A,B,F,H){k=[k,A,F,p,B,H,0,0,1];p=a.Matrix.invert(k);this.Sd.transform(p);this.Nd.concat(k);this.Ud=this.Nd.getTotalMatrix();};this.addHitRegion=function(){};
|
|
6545
|
+
this.clearHitRegions=function(){};this.drawFocusIfNeeded=function(){};this.removeHitRegion=function(){};this.scrollPathIntoView=function(){};Object.defineProperty(this,"canvas",{value:null,writable:!1});}function y(I){this.cf=I;this.Md=new t(I.getCanvas());this.Re=[];this.decodeImage=function(k){k=a.MakeImageFromEncoded(k);if(!k)throw "Invalid input";this.Re.push(k);return new C(k)};this.loadFont=function(k,p){k=a.Typeface.MakeFreeTypeFaceFromData(k);if(!k)return null;this.Re.push(k);var A=(p.style||
|
|
6546
|
+
"normal")+"|"+(p.variant||"normal")+"|"+(p.weight||"normal");p=p.family;fa[p]||(fa[p]={"*":k});fa[p][A]=k;};this.makePath2D=function(k){k=new aa(k);this.Re.push(k.Wd);return k};this.getContext=function(k){return "2d"===k?this.Md:null};this.toDataURL=function(k,p){this.cf.flush();var A=this.cf.makeImageSnapshot();if(A){k=k||"image/png";var B=a.ImageFormat.PNG;"image/jpeg"===k&&(B=a.ImageFormat.JPEG);if(p=A.encodeToBytes(B,p||.92)){A.delete();k="data:"+k+";base64,";if("undefined"!==typeof Buffer)p=Buffer.from(p).toString("base64");
|
|
6547
|
+
else {A=0;B=p.length;for(var F="",H;A<B;)H=p.slice(A,Math.min(A+32768,B)),F+=String.fromCharCode.apply(null,H),A+=32768;p=btoa(F);}return k+p}}};this.dispose=function(){this.Md.me();this.Re.forEach(function(k){k.delete();});this.cf.dispose();};}function C(I){this.width=I.width();this.height=I.height();this.naturalWidth=this.width;this.naturalHeight=this.height;this.tf=function(){return I};}function J(I,k,p){if(!k||0===p)throw "invalid dimensions, width and height must be non-zero";if(I.length%4)throw "arr must be a multiple of 4";
|
|
6548
|
+
p=p||I.length/(4*k);Object.defineProperty(this,"data",{value:I,writable:!1});Object.defineProperty(this,"height",{value:p,writable:!1});Object.defineProperty(this,"width",{value:k,writable:!1});}function P(I,k,p,A){this.Yd=null;this.de=[];this.ae=[];this.addColorStop=function(B,F){if(0>B||1<B||!isFinite(B))throw "offset must be between 0 and 1 inclusively";F=g(F);var H=this.ae.indexOf(B);if(-1!==H)this.de[H]=F;else {for(H=0;H<this.ae.length&&!(this.ae[H]>B);H++);this.ae.splice(H,0,B);this.de.splice(H,
|
|
6549
|
+
0,F);}};this.te=function(){var B=new P(I,k,p,A);B.de=this.de.slice();B.ae=this.ae.slice();return B};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null);};this.ue=function(B){var F=[I,k,p,A];a.Matrix.mapPoints(B,F);B=F[0];var H=F[1],M=F[2];F=F[3];this.me();return this.Yd=a.Shader.MakeLinearGradient([B,H],[M,F],this.de,this.ae,a.TileMode.Clamp)};}function O(I,k,p,A,B,F){if(e([k,p,A,B,F])){if(0>F)throw "radii cannot be negative";I.isEmpty()&&I.moveTo(k,p);I.arcToTangent(k,p,A,B,F);}}function W(I){if(!I.isEmpty()){var k=
|
|
6550
|
+
I.getBounds();(k[3]-k[1]||k[2]-k[0])&&I.close();}}function r(I,k,p,A,B,F,H){H=(H-F)/Math.PI*180;F=F/Math.PI*180;k=a.LTRBRect(k-A,p-B,k+A,p+B);1E-5>Math.abs(Math.abs(H)-360)?(p=H/2,I.arcToOval(k,F,p,!1),I.arcToOval(k,F+p,p,!1)):I.arcToOval(k,F,H,!1);}function D(I,k,p,A,B,F,H,M,ba){if(e([k,p,A,B,F,H,M])){if(0>A||0>B)throw "radii cannot be negative";var ca=2*Math.PI,Ia=H%ca;0>Ia&&(Ia+=ca);var bb=Ia-H;H=Ia;M+=bb;!ba&&M-H>=ca?M=H+ca:ba&&H-M>=ca?M=H-ca:!ba&&H>M?M=H+(ca-(H-M)%ca):ba&&H<M&&(M=H-(ca-(M-H)%ca));
|
|
6551
|
+
F?(ba=a.Matrix.rotated(F,k,p),F=a.Matrix.rotated(-F,k,p),I.transform(F),r(I,k,p,A,B,H,M),I.transform(ba)):r(I,k,p,A,B,H,M);}}function R(I,k,p){e([k,p])&&(I.isEmpty()&&I.moveTo(k,p),I.lineTo(k,p));}function aa(I){this.Wd=null;this.Wd="string"===typeof I?a.Path.MakeFromSVGString(I):I&&I.$e?I.Wd.copy():new a.Path;this.$e=function(){return this.Wd};this.addPath=function(k,p){p||(p={a:1,c:0,e:0,b:0,d:1,f:0});this.Wd.addPath(k.Wd,[p.a,p.c,p.e,p.b,p.d,p.f]);};this.arc=function(k,p,A,B,F,H){D(this.Wd,k,p,A,
|
|
6552
|
+
A,0,B,F,H);};this.arcTo=function(k,p,A,B,F){O(this.Wd,k,p,A,B,F);};this.bezierCurveTo=function(k,p,A,B,F,H){var M=this.Wd;e([k,p,A,B,F,H])&&(M.isEmpty()&&M.moveTo(k,p),M.cubicTo(k,p,A,B,F,H));};this.closePath=function(){W(this.Wd);};this.ellipse=function(k,p,A,B,F,H,M,ba){D(this.Wd,k,p,A,B,F,H,M,ba);};this.lineTo=function(k,p){R(this.Wd,k,p);};this.moveTo=function(k,p){var A=this.Wd;e([k,p])&&A.moveTo(k,p);};this.quadraticCurveTo=function(k,p,A,B){var F=this.Wd;e([k,p,A,B])&&(F.isEmpty()&&F.moveTo(k,p),
|
|
6553
|
+
F.quadTo(k,p,A,B));};this.rect=function(k,p,A,B){var F=this.Wd;k=a.XYWHRect(k,p,A,B);e(k)&&F.addRect(k);};}function ia(I,k){this.Yd=null;I instanceof C&&(I=I.tf());this.Bf=I;this._transform=a.Matrix.identity();""===k&&(k="repeat");switch(k){case "repeat-x":this.Ae=a.TileMode.Repeat;this.Be=a.TileMode.Decal;break;case "repeat-y":this.Ae=a.TileMode.Decal;this.Be=a.TileMode.Repeat;break;case "repeat":this.Be=this.Ae=a.TileMode.Repeat;break;case "no-repeat":this.Be=this.Ae=a.TileMode.Decal;break;default:throw "invalid repetition mode "+
|
|
6554
|
+
k;}this.setTransform=function(p){p=[p.a,p.c,p.e,p.b,p.d,p.f,0,0,1];e(p)&&(this._transform=p);};this.te=function(){var p=new ia;p.Ae=this.Ae;p.Be=this.Be;return p};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null);};this.ue=function(){this.me();return this.Yd=this.Bf.makeShaderCubic(this.Ae,this.Be,1/3,1/3,this._transform)};}function qa(I,k,p,A,B,F){this.Yd=null;this.de=[];this.ae=[];this.addColorStop=function(H,M){if(0>H||1<H||!isFinite(H))throw "offset must be between 0 and 1 inclusively";
|
|
6555
|
+
M=g(M);var ba=this.ae.indexOf(H);if(-1!==ba)this.de[ba]=M;else {for(ba=0;ba<this.ae.length&&!(this.ae[ba]>H);ba++);this.ae.splice(ba,0,H);this.de.splice(ba,0,M);}};this.te=function(){var H=new qa(I,k,p,A,B,F);H.de=this.de.slice();H.ae=this.ae.slice();return H};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null);};this.ue=function(H){var M=[I,k,A,B];a.Matrix.mapPoints(H,M);var ba=M[0],ca=M[1],Ia=M[2];M=M[3];var bb=(Math.abs(H[0])+Math.abs(H[4]))/2;H=p*bb;bb*=F;this.me();return this.Yd=a.Shader.MakeTwoPointConicalGradient([ba,
|
|
6556
|
+
ca],H,[Ia,M],bb,this.de,this.ae,a.TileMode.Clamp)};}a._testing={};var ua={aliceblue:Float32Array.of(.941,.973,1,1),antiquewhite:Float32Array.of(.98,.922,.843,1),aqua:Float32Array.of(0,1,1,1),aquamarine:Float32Array.of(.498,1,.831,1),azure:Float32Array.of(.941,1,1,1),beige:Float32Array.of(.961,.961,.863,1),bisque:Float32Array.of(1,.894,.769,1),black:Float32Array.of(0,0,0,1),blanchedalmond:Float32Array.of(1,.922,.804,1),blue:Float32Array.of(0,0,1,1),blueviolet:Float32Array.of(.541,.169,.886,1),brown:Float32Array.of(.647,
|
|
6557
|
+
.165,.165,1),burlywood:Float32Array.of(.871,.722,.529,1),cadetblue:Float32Array.of(.373,.62,.627,1),chartreuse:Float32Array.of(.498,1,0,1),chocolate:Float32Array.of(.824,.412,.118,1),coral:Float32Array.of(1,.498,.314,1),cornflowerblue:Float32Array.of(.392,.584,.929,1),cornsilk:Float32Array.of(1,.973,.863,1),crimson:Float32Array.of(.863,.078,.235,1),cyan:Float32Array.of(0,1,1,1),darkblue:Float32Array.of(0,0,.545,1),darkcyan:Float32Array.of(0,.545,.545,1),darkgoldenrod:Float32Array.of(.722,.525,.043,
|
|
6558
|
+
1),darkgray:Float32Array.of(.663,.663,.663,1),darkgreen:Float32Array.of(0,.392,0,1),darkgrey:Float32Array.of(.663,.663,.663,1),darkkhaki:Float32Array.of(.741,.718,.42,1),darkmagenta:Float32Array.of(.545,0,.545,1),darkolivegreen:Float32Array.of(.333,.42,.184,1),darkorange:Float32Array.of(1,.549,0,1),darkorchid:Float32Array.of(.6,.196,.8,1),darkred:Float32Array.of(.545,0,0,1),darksalmon:Float32Array.of(.914,.588,.478,1),darkseagreen:Float32Array.of(.561,.737,.561,1),darkslateblue:Float32Array.of(.282,
|
|
6559
|
+
.239,.545,1),darkslategray:Float32Array.of(.184,.31,.31,1),darkslategrey:Float32Array.of(.184,.31,.31,1),darkturquoise:Float32Array.of(0,.808,.82,1),darkviolet:Float32Array.of(.58,0,.827,1),deeppink:Float32Array.of(1,.078,.576,1),deepskyblue:Float32Array.of(0,.749,1,1),dimgray:Float32Array.of(.412,.412,.412,1),dimgrey:Float32Array.of(.412,.412,.412,1),dodgerblue:Float32Array.of(.118,.565,1,1),firebrick:Float32Array.of(.698,.133,.133,1),floralwhite:Float32Array.of(1,.98,.941,1),forestgreen:Float32Array.of(.133,
|
|
6560
|
+
.545,.133,1),fuchsia:Float32Array.of(1,0,1,1),gainsboro:Float32Array.of(.863,.863,.863,1),ghostwhite:Float32Array.of(.973,.973,1,1),gold:Float32Array.of(1,.843,0,1),goldenrod:Float32Array.of(.855,.647,.125,1),gray:Float32Array.of(.502,.502,.502,1),green:Float32Array.of(0,.502,0,1),greenyellow:Float32Array.of(.678,1,.184,1),grey:Float32Array.of(.502,.502,.502,1),honeydew:Float32Array.of(.941,1,.941,1),hotpink:Float32Array.of(1,.412,.706,1),indianred:Float32Array.of(.804,.361,.361,1),indigo:Float32Array.of(.294,
|
|
6561
|
+
0,.51,1),ivory:Float32Array.of(1,1,.941,1),khaki:Float32Array.of(.941,.902,.549,1),lavender:Float32Array.of(.902,.902,.98,1),lavenderblush:Float32Array.of(1,.941,.961,1),lawngreen:Float32Array.of(.486,.988,0,1),lemonchiffon:Float32Array.of(1,.98,.804,1),lightblue:Float32Array.of(.678,.847,.902,1),lightcoral:Float32Array.of(.941,.502,.502,1),lightcyan:Float32Array.of(.878,1,1,1),lightgoldenrodyellow:Float32Array.of(.98,.98,.824,1),lightgray:Float32Array.of(.827,.827,.827,1),lightgreen:Float32Array.of(.565,
|
|
6562
|
+
.933,.565,1),lightgrey:Float32Array.of(.827,.827,.827,1),lightpink:Float32Array.of(1,.714,.757,1),lightsalmon:Float32Array.of(1,.627,.478,1),lightseagreen:Float32Array.of(.125,.698,.667,1),lightskyblue:Float32Array.of(.529,.808,.98,1),lightslategray:Float32Array.of(.467,.533,.6,1),lightslategrey:Float32Array.of(.467,.533,.6,1),lightsteelblue:Float32Array.of(.69,.769,.871,1),lightyellow:Float32Array.of(1,1,.878,1),lime:Float32Array.of(0,1,0,1),limegreen:Float32Array.of(.196,.804,.196,1),linen:Float32Array.of(.98,
|
|
6563
|
+
.941,.902,1),magenta:Float32Array.of(1,0,1,1),maroon:Float32Array.of(.502,0,0,1),mediumaquamarine:Float32Array.of(.4,.804,.667,1),mediumblue:Float32Array.of(0,0,.804,1),mediumorchid:Float32Array.of(.729,.333,.827,1),mediumpurple:Float32Array.of(.576,.439,.859,1),mediumseagreen:Float32Array.of(.235,.702,.443,1),mediumslateblue:Float32Array.of(.482,.408,.933,1),mediumspringgreen:Float32Array.of(0,.98,.604,1),mediumturquoise:Float32Array.of(.282,.82,.8,1),mediumvioletred:Float32Array.of(.78,.082,.522,
|
|
6564
|
+
1),midnightblue:Float32Array.of(.098,.098,.439,1),mintcream:Float32Array.of(.961,1,.98,1),mistyrose:Float32Array.of(1,.894,.882,1),moccasin:Float32Array.of(1,.894,.71,1),navajowhite:Float32Array.of(1,.871,.678,1),navy:Float32Array.of(0,0,.502,1),oldlace:Float32Array.of(.992,.961,.902,1),olive:Float32Array.of(.502,.502,0,1),olivedrab:Float32Array.of(.42,.557,.137,1),orange:Float32Array.of(1,.647,0,1),orangered:Float32Array.of(1,.271,0,1),orchid:Float32Array.of(.855,.439,.839,1),palegoldenrod:Float32Array.of(.933,
|
|
6565
|
+
.91,.667,1),palegreen:Float32Array.of(.596,.984,.596,1),paleturquoise:Float32Array.of(.686,.933,.933,1),palevioletred:Float32Array.of(.859,.439,.576,1),papayawhip:Float32Array.of(1,.937,.835,1),peachpuff:Float32Array.of(1,.855,.725,1),peru:Float32Array.of(.804,.522,.247,1),pink:Float32Array.of(1,.753,.796,1),plum:Float32Array.of(.867,.627,.867,1),powderblue:Float32Array.of(.69,.878,.902,1),purple:Float32Array.of(.502,0,.502,1),rebeccapurple:Float32Array.of(.4,.2,.6,1),red:Float32Array.of(1,0,0,1),
|
|
6566
|
+
rosybrown:Float32Array.of(.737,.561,.561,1),royalblue:Float32Array.of(.255,.412,.882,1),saddlebrown:Float32Array.of(.545,.271,.075,1),salmon:Float32Array.of(.98,.502,.447,1),sandybrown:Float32Array.of(.957,.643,.376,1),seagreen:Float32Array.of(.18,.545,.341,1),seashell:Float32Array.of(1,.961,.933,1),sienna:Float32Array.of(.627,.322,.176,1),silver:Float32Array.of(.753,.753,.753,1),skyblue:Float32Array.of(.529,.808,.922,1),slateblue:Float32Array.of(.416,.353,.804,1),slategray:Float32Array.of(.439,.502,
|
|
6567
|
+
.565,1),slategrey:Float32Array.of(.439,.502,.565,1),snow:Float32Array.of(1,.98,.98,1),springgreen:Float32Array.of(0,1,.498,1),steelblue:Float32Array.of(.275,.51,.706,1),tan:Float32Array.of(.824,.706,.549,1),teal:Float32Array.of(0,.502,.502,1),thistle:Float32Array.of(.847,.749,.847,1),tomato:Float32Array.of(1,.388,.278,1),transparent:Float32Array.of(0,0,0,0),turquoise:Float32Array.of(.251,.878,.816,1),violet:Float32Array.of(.933,.51,.933,1),wheat:Float32Array.of(.961,.871,.702,1),white:Float32Array.of(1,
|
|
6568
|
+
1,1,1),whitesmoke:Float32Array.of(.961,.961,.961,1),yellow:Float32Array.of(1,1,0,1),yellowgreen:Float32Array.of(.604,.804,.196,1)};a._testing.parseColor=g;a._testing.colorToString=c;var Aa=RegExp("(italic|oblique|normal|)\\s*(small-caps|normal|)\\s*(bold|bolder|lighter|[1-9]00|normal|)\\s*([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q)(.+)"),fa={"Noto Mono":{"*":null},monospace:{"*":null}};a._testing.parseFontString=l;a.MakeCanvas=function(I,k){return (I=a.MakeSurface(I,k))?new y(I):null};a.ImageData=
|
|
6569
|
+
function(){if(2===arguments.length){var I=arguments[0],k=arguments[1];return new J(new Uint8ClampedArray(4*I*k),I,k)}if(3===arguments.length){var p=arguments[0];if(p.prototype.constructor!==Uint8ClampedArray)throw "bytes must be given as a Uint8ClampedArray";I=arguments[1];k=arguments[2];if(p%4)throw "bytes must be given in a multiple of 4";if(p%I)throw "bytes must divide evenly by width";if(k&&k!==p/(4*I))throw "invalid height given";return new J(p,I,p/(4*I))}throw "invalid number of arguments - takes 2 or 3, saw "+
|
|
6570
|
+
arguments.length;};})();})(w);var sa=Object.assign({},w),va="./this.program",wa=(a,b)=>{throw b;},xa="object"==typeof window,ya="function"==typeof importScripts,za="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,Ba="",Ca,Da,Ea,fs,Fa,Ga;
|
|
6571
|
+
if(za)Ba=ya?require$$0.dirname(Ba)+"/":__dirname+"/",Ga=()=>{Fa||(fs=require$$1,Fa=require$$0);},Ca=function(a,b){Ga();a=Fa.normalize(a);return fs.readFileSync(a,b?void 0:"utf8")},Ea=a=>{a=Ca(a,!0);a.buffer||(a=new Uint8Array(a));return a},Da=(a,b,d)=>{Ga();a=Fa.normalize(a);fs.readFile(a,function(f,h){f?d(f):b(h.buffer);});},1<process.argv.length&&(va=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("unhandledRejection",function(a){throw a;}),wa=(a,b)=>{if(noExitRuntime)throw process.exitCode=
|
|
6572
|
+
a,b;b instanceof Ja||Ka("exiting due to exception: "+b);process.exit(a);},w.inspect=function(){return "[Emscripten Module object]"};else if(xa||ya)ya?Ba=self.location.href:"undefined"!=typeof document&&document.currentScript&&(Ba=document.currentScript.src),_scriptDir&&(Ba=_scriptDir),0!==Ba.indexOf("blob:")?Ba=Ba.substr(0,Ba.replace(/[?#].*/,"").lastIndexOf("/")+1):Ba="",Ca=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},ya&&(Ea=a=>{var b=new XMLHttpRequest;b.open("GET",
|
|
6573
|
+
a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),Da=(a,b,d)=>{var f=new XMLHttpRequest;f.open("GET",a,!0);f.responseType="arraybuffer";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):d();};f.onerror=d;f.send(null);};var La=w.print||console.log.bind(console),Ka=w.printErr||console.warn.bind(console);Object.assign(w,sa);sa=null;w.thisProgram&&(va=w.thisProgram);w.quit&&(wa=w.quit);var Ma=0,Na;w.wasmBinary&&(Na=w.wasmBinary);
|
|
6574
|
+
var noExitRuntime=w.noExitRuntime||!0;"object"!=typeof WebAssembly&&Qa("no native wasm support detected");var Ra,Sa=!1,Ta="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
|
6575
|
+
function Va(a,b,d){var f=b+d;for(d=b;a[d]&&!(d>=f);)++d;if(16<d-b&&a.buffer&&Ta)return Ta.decode(a.subarray(b,d));for(f="";b<d;){var h=a[b++];if(h&128){var m=a[b++]&63;if(192==(h&224))f+=String.fromCharCode((h&31)<<6|m);else {var u=a[b++]&63;h=224==(h&240)?(h&15)<<12|m<<6|u:(h&7)<<18|m<<12|u<<6|a[b++]&63;65536>h?f+=String.fromCharCode(h):(h-=65536,f+=String.fromCharCode(55296|h>>10,56320|h&1023));}}else f+=String.fromCharCode(h);}return f}function Wa(a,b){return a?Va(K,a,b):""}
|
|
6576
|
+
function ra(a,b,d,f){if(!(0<f))return 0;var h=d;f=d+f-1;for(var m=0;m<a.length;++m){var u=a.charCodeAt(m);if(55296<=u&&57343>=u){var n=a.charCodeAt(++m);u=65536+((u&1023)<<10)|n&1023;}if(127>=u){if(d>=f)break;b[d++]=u;}else {if(2047>=u){if(d+1>=f)break;b[d++]=192|u>>6;}else {if(65535>=u){if(d+2>=f)break;b[d++]=224|u>>12;}else {if(d+3>=f)break;b[d++]=240|u>>18;b[d++]=128|u>>12&63;}b[d++]=128|u>>6&63;}b[d++]=128|u&63;}}b[d]=0;return d-h}
|
|
6577
|
+
function oa(a){for(var b=0,d=0;d<a.length;++d){var f=a.charCodeAt(d);55296<=f&&57343>=f&&(f=65536+((f&1023)<<10)|a.charCodeAt(++d)&1023);127>=f?++b:b=2047>=f?b+2:65535>=f?b+3:b+4;}return b}var Xa="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Ya(a,b){var d=a>>1;for(var f=d+b/2;!(d>=f)&&Za[d];)++d;d<<=1;if(32<d-a&&Xa)return Xa.decode(K.subarray(a,d));d="";for(f=0;!(f>=b/2);++f){var h=$a[a+2*f>>1];if(0==h)break;d+=String.fromCharCode(h);}return d}
|
|
6578
|
+
function cb(a,b,d){void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var f=b;d=d<2*a.length?d/2:a.length;for(var h=0;h<d;++h)$a[b>>1]=a.charCodeAt(h),b+=2;$a[b>>1]=0;return b-f}function db(a){return 2*a.length}function eb(a,b){for(var d=0,f="";!(d>=b/4);){var h=Q[a+4*d>>2];if(0==h)break;++d;65536<=h?(h-=65536,f+=String.fromCharCode(55296|h>>10,56320|h&1023)):f+=String.fromCharCode(h);}return f}
|
|
6579
|
+
function fb(a,b,d){void 0===d&&(d=2147483647);if(4>d)return 0;var f=b;d=f+d-4;for(var h=0;h<a.length;++h){var m=a.charCodeAt(h);if(55296<=m&&57343>=m){var u=a.charCodeAt(++h);m=65536+((m&1023)<<10)|u&1023;}Q[b>>2]=m;b+=4;if(b+4>d)break}Q[b>>2]=0;return b-f}function jb(a){for(var b=0,d=0;d<a.length;++d){var f=a.charCodeAt(d);55296<=f&&57343>=f&&++d;b+=4;}return b}var kb,lb,K,$a,Za,Q,mb,S,nb;
|
|
6580
|
+
function ob(){var a=Ra.buffer;kb=a;w.HEAP8=lb=new Int8Array(a);w.HEAP16=$a=new Int16Array(a);w.HEAP32=Q=new Int32Array(a);w.HEAPU8=K=new Uint8Array(a);w.HEAPU16=Za=new Uint16Array(a);w.HEAPU32=mb=new Uint32Array(a);w.HEAPF32=S=new Float32Array(a);w.HEAPF64=nb=new Float64Array(a);}var pb,qb=[],rb=[],sb=[];function tb(){var a=w.preRun.shift();qb.unshift(a);}var ub=0,wb=null;
|
|
6581
|
+
function Qa(a){if(w.onAbort)w.onAbort(a);a="Aborted("+a+")";Ka(a);Sa=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ea(a);throw a;}function yb(){return zb.startsWith("data:application/octet-stream;base64,")}var zb;zb="canvaskit.wasm";if(!yb()){var Ab=zb;zb=w.locateFile?w.locateFile(Ab,Ba):Ba+Ab;}function Bb(){var a=zb;try{if(a==zb&&Na)return new Uint8Array(Na);if(Ea)return Ea(a);throw "both async and sync fetching of the wasm failed";}catch(b){Qa(b);}}
|
|
6582
|
+
function Cb(){if(!Na&&(xa||ya)){if("function"==typeof fetch&&!zb.startsWith("file://"))return fetch(zb,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw "failed to load wasm binary file at '"+zb+"'";return a.arrayBuffer()}).catch(function(){return Bb()});if(Da)return new Promise(function(a,b){Da(zb,function(d){a(new Uint8Array(d));},b);})}return Promise.resolve().then(function(){return Bb()})}function Db(a){for(;0<a.length;)a.shift()(w);}function Eb(a){return pb.get(a)}var Fb={};
|
|
6583
|
+
function Gb(a){for(;a.length;){var b=a.pop();a.pop()(b);}}function Hb(a){return this.fromWireType(Q[a>>2])}var Ib={},Jb={},Kb={};function Lb(a){if(void 0===a)return "_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Mb(a,b){a=Lb(a);return function(){return b.apply(this,arguments)}}
|
|
6584
|
+
function Nb(a){var b=Error,d=Mb(a,function(f){this.name=a;this.message=f;f=Error(f).stack;void 0!==f&&(this.stack=this.toString()+"\n"+f.replace(/^Error(:[^\n]*)?\n/,""));});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var Ob=void 0;function Pb(a){throw new Ob(a);}
|
|
6585
|
+
function Qb(a,b,d){function f(n){n=d(n);n.length!==a.length&&Pb("Mismatched type converter count");for(var q=0;q<a.length;++q)Rb(a[q],n[q]);}a.forEach(function(n){Kb[n]=b;});var h=Array(b.length),m=[],u=0;b.forEach((n,q)=>{Jb.hasOwnProperty(n)?h[q]=Jb[n]:(m.push(n),Ib.hasOwnProperty(n)||(Ib[n]=[]),Ib[n].push(()=>{h[q]=Jb[n];++u;u===m.length&&f(h);}));});0===m.length&&f(h);}
|
|
6586
|
+
function Sb(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var Tb=void 0;function ac(a){for(var b="";K[a];)b+=Tb[K[a++]];return b}var bc=void 0;function X(a){throw new bc(a);}
|
|
6587
|
+
function Rb(a,b,d={}){if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var f=b.name;a||X('type "'+f+'" must have a positive integer typeid pointer');if(Jb.hasOwnProperty(a)){if(d.Vf)return;X("Cannot register type '"+f+"' twice");}Jb[a]=b;delete Kb[a];Ib.hasOwnProperty(a)&&(b=Ib[a],delete Ib[a],b.forEach(h=>h()));}function cc(a){X(a.Ld.Xd.Rd.name+" instance already deleted");}var dc=!1;function ec(){}
|
|
6588
|
+
function fc(a){--a.count.value;0===a.count.value&&(a.$d?a.fe.le(a.$d):a.Xd.Rd.le(a.Td));}function gc(a,b,d){if(b===d)return a;if(void 0===d.ie)return null;a=gc(a,b,d.ie);return null===a?null:d.Jf(a)}var hc={},ic=[];function jc(){for(;ic.length;){var a=ic.pop();a.Ld.Fe=!1;a["delete"]();}}var kc=void 0,lc={};function mc(a,b){for(void 0===b&&X("ptr should not be undefined");a.ie;)b=a.Oe(b),a=a.ie;return lc[b]}
|
|
6589
|
+
function nc(a,b){b.Xd&&b.Td||Pb("makeClassHandle requires ptr and ptrType");!!b.fe!==!!b.$d&&Pb("Both smartPtrType and smartPtr must be specified");b.count={value:1};return oc(Object.create(a,{Ld:{value:b}}))}function oc(a){if("undefined"===typeof FinalizationRegistry)return oc=b=>b,a;dc=new FinalizationRegistry(b=>{fc(b.Ld);});oc=b=>{var d=b.Ld;d.$d&&dc.register(b,{Ld:d},b);return b};ec=b=>{dc.unregister(b);};return oc(a)}function pc(){}
|
|
6590
|
+
function qc(a,b,d){if(void 0===a[b].Zd){var f=a[b];a[b]=function(){a[b].Zd.hasOwnProperty(arguments.length)||X("Function '"+d+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].Zd+")!");return a[b].Zd[arguments.length].apply(this,arguments)};a[b].Zd=[];a[b].Zd[f.De]=f;}}
|
|
6591
|
+
function rc(a,b,d){w.hasOwnProperty(a)?((void 0===d||void 0!==w[a].Zd&&void 0!==w[a].Zd[d])&&X("Cannot register public name '"+a+"' twice"),qc(w,a,a),w.hasOwnProperty(d)&&X("Cannot register multiple overloads of a function with the same number of arguments ("+d+")!"),w[a].Zd[d]=b):(w[a]=b,void 0!==d&&(w[a].tg=d));}function sc(a,b,d,f,h,m,u,n){this.name=a;this.constructor=b;this.Ge=d;this.le=f;this.ie=h;this.Pf=m;this.Oe=u;this.Jf=n;this.bg=[];}
|
|
6592
|
+
function tc(a,b,d){for(;b!==d;)b.Oe||X("Expected null or instance of "+d.name+", got an instance of "+b.name),a=b.Oe(a),b=b.ie;return a}function uc(a,b){if(null===b)return this.ff&&X("null is not a valid "+this.name),0;b.Ld||X('Cannot pass "'+vc(b)+'" as a '+this.name);b.Ld.Td||X("Cannot pass deleted object as a pointer of type "+this.name);return tc(b.Ld.Td,b.Ld.Xd.Rd,this.Rd)}
|
|
6593
|
+
function wc(a,b){if(null===b){this.ff&&X("null is not a valid "+this.name);if(this.Ue){var d=this.gf();null!==a&&a.push(this.le,d);return d}return 0}b.Ld||X('Cannot pass "'+vc(b)+'" as a '+this.name);b.Ld.Td||X("Cannot pass deleted object as a pointer of type "+this.name);!this.Te&&b.Ld.Xd.Te&&X("Cannot convert argument of type "+(b.Ld.fe?b.Ld.fe.name:b.Ld.Xd.name)+" to parameter type "+this.name);d=tc(b.Ld.Td,b.Ld.Xd.Rd,this.Rd);if(this.Ue)switch(void 0===b.Ld.$d&&X("Passing raw pointer to smart pointer is illegal"),
|
|
6594
|
+
this.hg){case 0:b.Ld.fe===this?d=b.Ld.$d:X("Cannot convert argument of type "+(b.Ld.fe?b.Ld.fe.name:b.Ld.Xd.name)+" to parameter type "+this.name);break;case 1:d=b.Ld.$d;break;case 2:if(b.Ld.fe===this)d=b.Ld.$d;else {var f=b.clone();d=this.cg(d,xc(function(){f["delete"]();}));null!==a&&a.push(this.le,d);}break;default:X("Unsupporting sharing policy");}return d}
|
|
6595
|
+
function yc(a,b){if(null===b)return this.ff&&X("null is not a valid "+this.name),0;b.Ld||X('Cannot pass "'+vc(b)+'" as a '+this.name);b.Ld.Td||X("Cannot pass deleted object as a pointer of type "+this.name);b.Ld.Xd.Te&&X("Cannot convert argument of type "+b.Ld.Xd.name+" to parameter type "+this.name);return tc(b.Ld.Td,b.Ld.Xd.Rd,this.Rd)}
|
|
6596
|
+
function zc(a,b,d,f,h,m,u,n,q,v,E){this.name=a;this.Rd=b;this.ff=d;this.Te=f;this.Ue=h;this.ag=m;this.hg=u;this.vf=n;this.gf=q;this.cg=v;this.le=E;h||void 0!==b.ie?this.toWireType=wc:(this.toWireType=f?uc:yc,this.ee=null);}function Ac(a,b,d){w.hasOwnProperty(a)||Pb("Replacing nonexistant public symbol");void 0!==w[a].Zd&&void 0!==d?w[a].Zd[d]=b:(w[a]=b,w[a].De=d);}
|
|
6597
|
+
function Bc(a,b){var d=[];return function(){d.length=0;Object.assign(d,arguments);if(a.includes("j")){var f=w["dynCall_"+a];f=d&&d.length?f.apply(null,[b].concat(d)):f.call(null,b);}else f=Eb(b).apply(null,d);return f}}function Ic(a,b){a=ac(a);var d=a.includes("j")?Bc(a,b):Eb(b);"function"!=typeof d&&X("unknown function pointer with signature "+a+": "+b);return d}var Jc=void 0;function Kc(a){a=Lc(a);var b=ac(a);Mc(a);return b}
|
|
6598
|
+
function Nc(a,b){function d(m){h[m]||Jb[m]||(Kb[m]?Kb[m].forEach(d):(f.push(m),h[m]=!0));}var f=[],h={};b.forEach(d);throw new Jc(a+": "+f.map(Kc).join([", "]));}
|
|
6599
|
+
function Oc(a,b,d,f,h){var m=b.length;2>m&&X("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=null!==b[1]&&null!==d,n=!1;for(d=1;d<b.length;++d)if(null!==b[d]&&void 0===b[d].ee){n=!0;break}var q="void"!==b[0].name,v=m-2,E=Array(v),G=[],L=[];return function(){arguments.length!==v&&X("function "+a+" called with "+arguments.length+" arguments, expected "+v+" args!");L.length=0;G.length=u?2:1;G[0]=h;if(u){var z=b[1].toWireType(L,this);G[1]=z;}for(var N=0;N<v;++N)E[N]=
|
|
6600
|
+
b[N+2].toWireType(L,arguments[N]),G.push(E[N]);N=f.apply(null,G);if(n)Gb(L);else for(var T=u?1:2;T<b.length;T++){var U=1===T?z:E[T-2];null!==b[T].ee&&b[T].ee(U);}z=q?b[0].fromWireType(N):void 0;return z}}function Pc(a,b){for(var d=[],f=0;f<a;f++)d.push(mb[b+4*f>>2]);return d}var Qc=[],Rc=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Sc(a){4<a&&0===--Rc[a].hf&&(Rc[a]=void 0,Qc.push(a));}
|
|
6601
|
+
var Tc=a=>{a||X("Cannot use deleted val. handle = "+a);return Rc[a].value},xc=a=>{switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Qc.length?Qc.pop():Rc.length;Rc[b]={hf:1,value:a};return b}};
|
|
6602
|
+
function Uc(a,b,d){switch(b){case 0:return function(f){return this.fromWireType((d?lb:K)[f])};case 1:return function(f){return this.fromWireType((d?$a:Za)[f>>1])};case 2:return function(f){return this.fromWireType((d?Q:mb)[f>>2])};default:throw new TypeError("Unknown integer type: "+a);}}function Vc(a,b){var d=Jb[a];void 0===d&&X(b+" has unknown type "+Kc(a));return d}function vc(a){if(null===a)return "null";var b=typeof a;return "object"===b||"array"===b||"function"===b?a.toString():""+a}
|
|
6603
|
+
function Wc(a,b){switch(b){case 2:return function(d){return this.fromWireType(S[d>>2])};case 3:return function(d){return this.fromWireType(nb[d>>3])};default:throw new TypeError("Unknown float type: "+a);}}
|
|
6604
|
+
function Xc(a,b,d){switch(b){case 0:return d?function(f){return lb[f]}:function(f){return K[f]};case 1:return d?function(f){return $a[f>>1]}:function(f){return Za[f>>1]};case 2:return d?function(f){return Q[f>>2]}:function(f){return mb[f>>2]};default:throw new TypeError("Unknown integer type: "+a);}}var Yc={};function Zc(a){var b=Yc[a];return void 0===b?ac(a):b}var $c=[];
|
|
6605
|
+
function ad(){function a(b){b.$$$embind_global$$$=b;var d="object"==typeof $$$embind_global$$$&&b.$$$embind_global$$$==b;d||delete b.$$$embind_global$$$;return d}if("object"==typeof globalThis)return globalThis;if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;"object"==typeof commonjsGlobal&&a(commonjsGlobal)?$$$embind_global$$$=commonjsGlobal:"object"==typeof self&&a(self)&&($$$embind_global$$$=self);if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.");
|
|
6606
|
+
}function bd(a){var b=$c.length;$c.push(a);return b}function cd(a,b){for(var d=Array(a),f=0;f<a;++f)d[f]=Vc(mb[b+4*f>>2],"parameter "+f);return d}var dd=[];function ed(a){var b=Array(a+1);return function(d,f,h){b[0]=d;for(var m=0;m<a;++m){var u=Vc(mb[f+4*m>>2],"parameter "+m);b[m+1]=u.readValueFromPointer(h);h+=u.argPackAdvance;}d=new (d.bind.apply(d,b));return xc(d)}}var fd={},gd;gd=za?()=>{var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:()=>performance.now();
|
|
6607
|
+
function hd(a){var b=a.getExtension("ANGLE_instanced_arrays");b&&(a.vertexAttribDivisor=function(d,f){b.vertexAttribDivisorANGLE(d,f);},a.drawArraysInstanced=function(d,f,h,m){b.drawArraysInstancedANGLE(d,f,h,m);},a.drawElementsInstanced=function(d,f,h,m,u){b.drawElementsInstancedANGLE(d,f,h,m,u);});}
|
|
6608
|
+
function jd(a){var b=a.getExtension("OES_vertex_array_object");b&&(a.createVertexArray=function(){return b.createVertexArrayOES()},a.deleteVertexArray=function(d){b.deleteVertexArrayOES(d);},a.bindVertexArray=function(d){b.bindVertexArrayOES(d);},a.isVertexArray=function(d){return b.isVertexArrayOES(d)});}function kd(a){var b=a.getExtension("WEBGL_draw_buffers");b&&(a.drawBuffers=function(d,f){b.drawBuffersWEBGL(d,f);});}
|
|
6609
|
+
var ld=1,md=[],nd=[],od=[],pd=[],ka=[],qd=[],rd=[],na=[],sd=[],td=[],ud={},vd={},wd=4;function xd(a){Ad||(Ad=a);}function ha(a){for(var b=ld++,d=a.length;d<b;d++)a[d]=null;return b}function la(a,b){a.lf||(a.lf=a.getContext,a.getContext=function(f,h){h=a.lf(f,h);return "webgl"==f==h instanceof WebGLRenderingContext?h:null});var d=1<b.majorVersion?a.getContext("webgl2",b):a.getContext("webgl",b);return d?Bd(d,b):0}
|
|
6610
|
+
function Bd(a,b){var d=ha(na),f={Uf:d,attributes:b,version:b.majorVersion,ge:a};a.canvas&&(a.canvas.yf=f);na[d]=f;("undefined"==typeof b.Kf||b.Kf)&&Cd(f);return d}function ma(a){x=na[a];w.rg=Y=x&&x.ge;return !(a&&!Y)}
|
|
6611
|
+
function Cd(a){a||(a=x);if(!a.Wf){a.Wf=!0;var b=a.ge;hd(b);jd(b);kd(b);b.qf=b.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");b.uf=b.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");2<=a.version&&(b.rf=b.getExtension("EXT_disjoint_timer_query_webgl2"));if(2>a.version||!b.rf)b.rf=b.getExtension("EXT_disjoint_timer_query");b.sg=b.getExtension("WEBGL_multi_draw");(b.getSupportedExtensions()||[]).forEach(function(d){d.includes("lose_context")||d.includes("debug")||b.getExtension(d);});}}
|
|
6612
|
+
var x,Ad,Dd=[];function Ed(a,b,d,f){for(var h=0;h<a;h++){var m=Y[d](),u=m&&ha(f);m?(m.name=u,f[u]=m):xd(1282);Q[b+4*h>>2]=u;}}
|
|
6613
|
+
function Fd(a,b,d){if(b){var f=void 0;switch(a){case 36346:f=1;break;case 36344:0!=d&&1!=d&&xd(1280);return;case 34814:case 36345:f=0;break;case 34466:var h=Y.getParameter(34467);f=h?h.length:0;break;case 33309:if(2>x.version){xd(1282);return}f=2*(Y.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>x.version){xd(1280);return}f=33307==a?3:0;}if(void 0===f)switch(h=Y.getParameter(a),typeof h){case "number":f=h;break;case "boolean":f=h?1:0;break;case "string":xd(1280);return;case "object":if(null===
|
|
6614
|
+
h)switch(a){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:f=0;break;default:xd(1280);return}else {if(h instanceof Float32Array||h instanceof Uint32Array||h instanceof Int32Array||h instanceof Array){for(a=0;a<h.length;++a)switch(d){case 0:Q[b+4*a>>2]=h[a];break;case 2:S[b+4*a>>2]=h[a];break;case 4:lb[b+a>>0]=h[a]?1:0;}return}try{f=h.name|
|
|
6615
|
+
0;}catch(m){xd(1280);Ka("GL_INVALID_ENUM in glGet"+d+"v: Unknown object returned from WebGL getParameter("+a+")! (error: "+m+")");return}}break;default:xd(1280);Ka("GL_INVALID_ENUM in glGet"+d+"v: Native code calling glGet"+d+"v("+a+") and it returns "+h+" of type "+typeof h+"!");return}switch(d){case 1:d=f;mb[b>>2]=d;mb[b+4>>2]=(d-mb[b>>2])/4294967296;break;case 0:Q[b>>2]=f;break;case 2:S[b>>2]=f;break;case 4:lb[b>>0]=f?1:0;}}else xd(1281);}
|
|
6616
|
+
function Gd(a){var b=oa(a)+1,d=Hd(b);ra(a,K,d,b);return d}function Id(a){return "]"==a.slice(-1)&&a.lastIndexOf("[")}function Jd(a){a-=5120;return 0==a?lb:1==a?K:2==a?$a:4==a?Q:6==a?S:5==a||28922==a||28520==a||30779==a||30782==a?mb:Za}function Kd(a,b,d,f,h){a=Jd(a);var m=31-Math.clz32(a.BYTES_PER_ELEMENT),u=wd;return a.subarray(h>>m,h+f*(d*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*(1<<m)+u-1&-u)>>m)}
|
|
6617
|
+
function Z(a){var b=Y.Hf;if(b){var d=b.Ne[a];"number"==typeof d&&(b.Ne[a]=d=Y.getUniformLocation(b,b.wf[a]+(0<d?"["+d+"]":"")));return d}xd(1282);}var Ld=[],Md=[],Nd={};
|
|
6618
|
+
function Od(){if(!Pd){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:va||"./this.program"},b;for(b in Nd)void 0===Nd[b]?delete a[b]:a[b]=Nd[b];var d=[];for(b in a)d.push(b+"="+a[b]);Pd=d;}return Pd}var Pd,Qd=[null,[],[]];function Rd(a){return 0===a%4&&(0!==a%100||0===a%400)}
|
|
6515
6619
|
var Sd=[31,29,31,30,31,30,31,31,30,31,30,31],Td=[31,28,31,30,31,30,31,31,30,31,30,31];
|
|
6516
|
-
function Ud(a,b,d,f){function h(z,N,T){for(z="number"==typeof z?z.toString():z||"";z.length<N;)z=T[0]+z;return z}function m(z,N){return h(z,N,"0")}function u(z,N){function T(
|
|
6517
|
-
0,2);case 4:return new Date(z.getFullYear(),0,1);case 5:return new Date(z.getFullYear()-1,11,31);case 6:return new Date(z.getFullYear()-1,11,30)}}function q(z){var N=z.
|
|
6518
|
-
0,4));T=n(T);return 0>=u(N,z)?0>=u(T,z)?z.getFullYear()+1:z.getFullYear():z.getFullYear()-1}var v=
|
|
6519
|
-
"%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"};for(var
|
|
6520
|
-
"%B":function(z){return L[z.
|
|
6521
|
-
"%n":function(){return "\n"},"%p":function(z){return 0<=z.
|
|
6522
|
-
7-(z.
|
|
6523
|
-
for(var Wd=Array(256),Xd=0;256>Xd;++Xd)Wd[Xd]=String.fromCharCode(Xd);
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
{
|
|
6529
|
-
function Vd(a){var b=Array(
|
|
6530
|
-
var
|
|
6531
|
-
n[
|
|
6532
|
-
|
|
6533
|
-
" has no accessible constructor");var hb=
|
|
6534
|
-
N);return [T,U,gb]});},h:function(a,b,d,f,h,m,u){var n=
|
|
6535
|
-
|
|
6536
|
-
return []});},b:function(a,b,d,f,h,m,u,n){var q=
|
|
6537
|
-
b,d){a=
|
|
6538
|
-
|
|
6539
|
-
u,function(n){n=[n[0],null].concat(n.slice(1));
|
|
6540
|
-
Int32Array,Uint32Array,Float32Array,Float64Array][b];d=
|
|
6541
|
-
else v+=String.fromCharCode(0),v+=u;u=q+1;}}else {v=Array(h);for(n=0;n<h;++n)v[n]=String.fromCharCode(K[m+n]);v=v.join("");}
|
|
6542
|
-
|
|
6543
|
-
L),L=N+b;}
|
|
6544
|
-
fromWireType:function(){},toWireType:function(){}});},Fb:function(){return !0},sb:function(){throw Infinity;},I:function(a,b,d){a=
|
|
6545
|
-
"$";var h=
|
|
6546
|
-
mb:function(a){a=
|
|
6547
|
-
b){
|
|
6548
|
-
b,f):
|
|
6549
|
-
x.version?
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
f=0;f<a;f++)d[f]=
|
|
6554
|
-
b,d,f){
|
|
6555
|
-
Ia:function(a,b,d){d?
|
|
6556
|
-
b)a=
|
|
6557
|
-
2]=a.
|
|
6558
|
-
|
|
6559
|
-
null!==d&&(3==d[1].length&&(d[1]+="0"),b="OpenGL ES GLSL ES "+d[1]+" ("+b+")");b=
|
|
6560
|
-
h=d.
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
d);},
|
|
6564
|
-
b,d,f){
|
|
6565
|
-
b,d,f,h){
|
|
6566
|
-
|
|
6567
|
-
2
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
(function(){function a(h){w.asm=h.exports;
|
|
6577
|
-
if(w.instantiateWasm)try{return w.instantiateWasm(f,a)}catch(h){return
|
|
6578
|
-
return {}})();w.___wasm_call_ctors=function(){return (w.___wasm_call_ctors=w.asm.
|
|
6579
|
-
var
|
|
6580
|
-
w.dynCall_jiiiijiiiii=function(){return (w.dynCall_jiiiijiiiii=w.asm.
|
|
6581
|
-
w.dynCall_viij=function(){return (w.dynCall_viij=w.asm.
|
|
6582
|
-
w.dynCall_iiiji=function(){return (w.dynCall_iiiji=w.asm.
|
|
6583
|
-
w.dynCall_iiiiij=function(){return (w.dynCall_iiiiij=w.asm.
|
|
6584
|
-
function
|
|
6585
|
-
function
|
|
6586
|
-
function
|
|
6587
|
-
function
|
|
6588
|
-
w.run=
|
|
6620
|
+
function Ud(a,b,d,f){function h(z,N,T){for(z="number"==typeof z?z.toString():z||"";z.length<N;)z=T[0]+z;return z}function m(z,N){return h(z,N,"0")}function u(z,N){function T(pa){return 0>pa?-1:0<pa?1:0}var U;0===(U=T(z.getFullYear()-N.getFullYear()))&&0===(U=T(z.getMonth()-N.getMonth()))&&(U=T(z.getDate()-N.getDate()));return U}function n(z){switch(z.getDay()){case 0:return new Date(z.getFullYear()-1,11,29);case 1:return z;case 2:return new Date(z.getFullYear(),0,3);case 3:return new Date(z.getFullYear(),
|
|
6621
|
+
0,2);case 4:return new Date(z.getFullYear(),0,1);case 5:return new Date(z.getFullYear()-1,11,31);case 6:return new Date(z.getFullYear()-1,11,30)}}function q(z){var N=z.pe;for(z=new Date((new Date(z.qe+1900,0,1)).getTime());0<N;){var T=z.getMonth(),U=(Rd(z.getFullYear())?Sd:Td)[T];if(N>U-z.getDate())N-=U-z.getDate()+1,z.setDate(1),11>T?z.setMonth(T+1):(z.setMonth(0),z.setFullYear(z.getFullYear()+1));else {z.setDate(z.getDate()+N);break}}T=new Date(z.getFullYear()+1,0,4);N=n(new Date(z.getFullYear(),
|
|
6622
|
+
0,4));T=n(T);return 0>=u(N,z)?0>=u(T,z)?z.getFullYear()+1:z.getFullYear():z.getFullYear()-1}var v=Q[f+40>>2];f={pg:Q[f>>2],og:Q[f+4>>2],Ye:Q[f+8>>2],jf:Q[f+12>>2],Ze:Q[f+16>>2],qe:Q[f+20>>2],je:Q[f+24>>2],pe:Q[f+28>>2],vg:Q[f+32>>2],ng:Q[f+36>>2],qg:v?Wa(v):""};d=Wa(d);v={"%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",
|
|
6623
|
+
"%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"};for(var E in v)d=d.replace(new RegExp(E,"g"),v[E]);var G="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),L="January February March April May June July August September October November December".split(" ");v={"%a":function(z){return G[z.je].substring(0,3)},"%A":function(z){return G[z.je]},"%b":function(z){return L[z.Ze].substring(0,3)},
|
|
6624
|
+
"%B":function(z){return L[z.Ze]},"%C":function(z){return m((z.qe+1900)/100|0,2)},"%d":function(z){return m(z.jf,2)},"%e":function(z){return h(z.jf,2," ")},"%g":function(z){return q(z).toString().substring(2)},"%G":function(z){return q(z)},"%H":function(z){return m(z.Ye,2)},"%I":function(z){z=z.Ye;0==z?z=12:12<z&&(z-=12);return m(z,2)},"%j":function(z){for(var N=0,T=0;T<=z.Ze-1;N+=(Rd(z.qe+1900)?Sd:Td)[T++]);return m(z.jf+N,3)},"%m":function(z){return m(z.Ze+1,2)},"%M":function(z){return m(z.og,2)},
|
|
6625
|
+
"%n":function(){return "\n"},"%p":function(z){return 0<=z.Ye&&12>z.Ye?"AM":"PM"},"%S":function(z){return m(z.pg,2)},"%t":function(){return "\t"},"%u":function(z){return z.je||7},"%U":function(z){return m(Math.floor((z.pe+7-z.je)/7),2)},"%V":function(z){var N=Math.floor((z.pe+7-(z.je+6)%7)/7);2>=(z.je+371-z.pe-2)%7&&N++;if(N)53==N&&(T=(z.je+371-z.pe)%7,4==T||3==T&&Rd(z.qe)||(N=1));else {N=52;var T=(z.je+7-z.pe-1)%7;(4==T||5==T&&Rd(z.qe%400-1))&&N++;}return m(N,2)},"%w":function(z){return z.je},"%W":function(z){return m(Math.floor((z.pe+
|
|
6626
|
+
7-(z.je+6)%7)/7),2)},"%y":function(z){return (z.qe+1900).toString().substring(2)},"%Y":function(z){return z.qe+1900},"%z":function(z){z=z.ng;var N=0<=z;z=Math.abs(z)/60;return (N?"+":"-")+String("0000"+(z/60*100+z%60)).slice(-4)},"%Z":function(z){return z.qg},"%%":function(){return "%"}};d=d.replace(/%%/g,"\x00\x00");for(E in v)d.includes(E)&&(d=d.replace(new RegExp(E,"g"),v[E](f)));d=d.replace(/\0\0/g,"%");E=Vd(d);if(E.length>b)return 0;lb.set(E,a);return E.length-1}Ob=w.InternalError=Nb("InternalError");
|
|
6627
|
+
for(var Wd=Array(256),Xd=0;256>Xd;++Xd)Wd[Xd]=String.fromCharCode(Xd);Tb=Wd;bc=w.BindingError=Nb("BindingError");pc.prototype.isAliasOf=function(a){if(!(this instanceof pc&&a instanceof pc))return !1;var b=this.Ld.Xd.Rd,d=this.Ld.Td,f=a.Ld.Xd.Rd;for(a=a.Ld.Td;b.ie;)d=b.Oe(d),b=b.ie;for(;f.ie;)a=f.Oe(a),f=f.ie;return b===f&&d===a};
|
|
6628
|
+
pc.prototype.clone=function(){this.Ld.Td||cc(this);if(this.Ld.Me)return this.Ld.count.value+=1,this;var a=oc,b=Object,d=b.create,f=Object.getPrototypeOf(this),h=this.Ld;a=a(d.call(b,f,{Ld:{value:{count:h.count,Fe:h.Fe,Me:h.Me,Td:h.Td,Xd:h.Xd,$d:h.$d,fe:h.fe}}}));a.Ld.count.value+=1;a.Ld.Fe=!1;return a};pc.prototype["delete"]=function(){this.Ld.Td||cc(this);this.Ld.Fe&&!this.Ld.Me&&X("Object already scheduled for deletion");ec(this);fc(this.Ld);this.Ld.Me||(this.Ld.$d=void 0,this.Ld.Td=void 0);};
|
|
6629
|
+
pc.prototype.isDeleted=function(){return !this.Ld.Td};pc.prototype.deleteLater=function(){this.Ld.Td||cc(this);this.Ld.Fe&&!this.Ld.Me&&X("Object already scheduled for deletion");ic.push(this);1===ic.length&&kc&&kc(jc);this.Ld.Fe=!0;return this};w.getInheritedInstanceCount=function(){return Object.keys(lc).length};w.getLiveInheritedInstances=function(){var a=[],b;for(b in lc)lc.hasOwnProperty(b)&&a.push(lc[b]);return a};w.flushPendingDeletes=jc;w.setDelayFunction=function(a){kc=a;ic.length&&kc&&kc(jc);};
|
|
6630
|
+
zc.prototype.Qf=function(a){this.vf&&(a=this.vf(a));return a};zc.prototype.pf=function(a){this.le&&this.le(a);};zc.prototype.argPackAdvance=8;zc.prototype.readValueFromPointer=Hb;zc.prototype.deleteObject=function(a){if(null!==a)a["delete"]();};
|
|
6631
|
+
zc.prototype.fromWireType=function(a){function b(){return this.Ue?nc(this.Rd.Ge,{Xd:this.ag,Td:d,fe:this,$d:a}):nc(this.Rd.Ge,{Xd:this,Td:a})}var d=this.Qf(a);if(!d)return this.pf(a),null;var f=mc(this.Rd,d);if(void 0!==f){if(0===f.Ld.count.value)return f.Ld.Td=d,f.Ld.$d=a,f.clone();f=f.clone();this.pf(a);return f}f=this.Rd.Pf(d);f=hc[f];if(!f)return b.call(this);f=this.Te?f.Ff:f.pointerType;var h=gc(d,this.Rd,f.Rd);return null===h?b.call(this):this.Ue?nc(f.Rd.Ge,{Xd:f,Td:h,fe:this,$d:a}):nc(f.Rd.Ge,
|
|
6632
|
+
{Xd:f,Td:h})};Jc=w.UnboundTypeError=Nb("UnboundTypeError");w.count_emval_handles=function(){for(var a=0,b=5;b<Rc.length;++b)void 0!==Rc[b]&&++a;return a};w.get_first_emval=function(){for(var a=5;a<Rc.length;++a)if(void 0!==Rc[a])return Rc[a];return null};for(var Y,Yd=0;32>Yd;++Yd)Dd.push(Array(Yd));var Zd=new Float32Array(288);for(Yd=0;288>Yd;++Yd)Ld[Yd]=Zd.subarray(0,Yd+1);var $d=new Int32Array(288);for(Yd=0;288>Yd;++Yd)Md[Yd]=$d.subarray(0,Yd+1);
|
|
6633
|
+
function Vd(a){var b=Array(oa(a)+1);ra(a,b,0,b.length);return b}
|
|
6634
|
+
var pe={U:function(){return 0},Bb:function(){},Db:function(){return 0},yb:function(){},zb:function(){},V:function(){},Ab:function(){},C:function(a){var b=Fb[a];delete Fb[a];var d=b.gf,f=b.le,h=b.sf,m=h.map(u=>u.Tf).concat(h.map(u=>u.fg));Qb([a],m,u=>{var n={};h.forEach((q,v)=>{var E=u[v],G=q.Rf,L=q.Sf,z=u[v+h.length],N=q.eg,T=q.gg;n[q.Lf]={read:U=>E.fromWireType(G(L,U)),write:(U,pa)=>{var ta=[];N(T,U,z.toWireType(ta,pa));Gb(ta);}};});return [{name:b.name,fromWireType:function(q){var v={},E;for(E in n)v[E]=
|
|
6635
|
+
n[E].read(q);f(q);return v},toWireType:function(q,v){for(var E in n)if(!(E in v))throw new TypeError('Missing field: "'+E+'"');var G=d();for(E in n)n[E].write(G,v[E]);null!==q&&q.push(f,G);return G},argPackAdvance:8,readValueFromPointer:Hb,ee:f}]});},qb:function(){},Hb:function(a,b,d,f,h){var m=Sb(d);b=ac(b);Rb(a,{name:b,fromWireType:function(u){return !!u},toWireType:function(u,n){return n?f:h},argPackAdvance:8,readValueFromPointer:function(u){if(1===d)var n=lb;else if(2===d)n=$a;else if(4===d)n=
|
|
6636
|
+
Q;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(n[u>>m])},ee:null});},p:function(a,b,d,f,h,m,u,n,q,v,E,G,L){E=ac(E);m=Ic(h,m);n&&(n=Ic(u,n));v&&(v=Ic(q,v));L=Ic(G,L);var z=Lb(E);rc(z,function(){Nc("Cannot construct "+E+" due to unbound types",[f]);});Qb([a,b,d],f?[f]:[],function(N){N=N[0];if(f){var T=N.Rd;var U=T.Ge;}else U=pc.prototype;N=Mb(z,function(){if(Object.getPrototypeOf(this)!==pa)throw new bc("Use 'new' to construct "+E);if(void 0===ta.oe)throw new bc(E+
|
|
6637
|
+
" has no accessible constructor");var hb=ta.oe[arguments.length];if(void 0===hb)throw new bc("Tried to invoke ctor of "+E+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(ta.oe).toString()+") parameters instead!");return hb.apply(this,arguments)});var pa=Object.create(U,{constructor:{value:N}});N.prototype=pa;var ta=new sc(E,N,pa,L,T,m,n,v);T=new zc(E,ta,!0,!1,!1);U=new zc(E+"*",ta,!1,!1,!1);var gb=new zc(E+" const*",ta,!1,!0,!1);hc[a]={pointerType:U,Ff:gb};Ac(z,
|
|
6638
|
+
N);return [T,U,gb]});},h:function(a,b,d,f,h,m,u){var n=Pc(d,f);b=ac(b);m=Ic(h,m);Qb([],[a],function(q){function v(){Nc("Cannot call "+E+" due to unbound types",n);}q=q[0];var E=q.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var G=q.Rd.constructor;void 0===G[b]?(v.De=d-1,G[b]=v):(qc(G,b,E),G[b].Zd[d-1]=v);Qb([],n,function(L){L=[L[0],null].concat(L.slice(1));L=Oc(E,L,null,m,u);void 0===G[b].Zd?(L.De=d-1,G[b]=L):G[b].Zd[d-1]=L;return []});return []});},A:function(a,b,d,f,h,m){0<b||Qa();var u=
|
|
6639
|
+
Pc(b,d);h=Ic(f,h);Qb([],[a],function(n){n=n[0];var q="constructor "+n.name;void 0===n.Rd.oe&&(n.Rd.oe=[]);if(void 0!==n.Rd.oe[b-1])throw new bc("Cannot register multiple constructors with identical number of parameters ("+(b-1)+") for class '"+n.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");n.Rd.oe[b-1]=()=>{Nc("Cannot construct "+n.name+" due to unbound types",u);};Qb([],u,function(v){v.splice(1,0,null);n.Rd.oe[b-1]=Oc(q,v,null,h,m);return []});
|
|
6640
|
+
return []});},b:function(a,b,d,f,h,m,u,n){var q=Pc(d,f);b=ac(b);m=Ic(h,m);Qb([],[a],function(v){function E(){Nc("Cannot call "+G+" due to unbound types",q);}v=v[0];var G=v.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);n&&v.Rd.bg.push(b);var L=v.Rd.Ge,z=L[b];void 0===z||void 0===z.Zd&&z.className!==v.name&&z.De===d-2?(E.De=d-2,E.className=v.name,L[b]=E):(qc(L,b,G),L[b].Zd[d-2]=E);Qb([],q,function(N){N=Oc(G,N,v,m,u);void 0===L[b].Zd?(N.De=d-2,L[b]=N):L[b].Zd[d-2]=N;return []});return []});},u:function(a,
|
|
6641
|
+
b,d){a=ac(a);Qb([],[b],function(f){f=f[0];w[a]=f.fromWireType(d);return []});},Gb:function(a,b){b=ac(b);Rb(a,{name:b,fromWireType:function(d){var f=Tc(d);Sc(d);return f},toWireType:function(d,f){return xc(f)},argPackAdvance:8,readValueFromPointer:Hb,ee:null});},n:function(a,b,d,f){function h(){}d=Sb(d);b=ac(b);h.values={};Rb(a,{name:b,constructor:h,fromWireType:function(m){return this.constructor.values[m]},toWireType:function(m,u){return u.value},argPackAdvance:8,readValueFromPointer:Uc(b,d,f),ee:null});
|
|
6642
|
+
rc(b,h);},e:function(a,b,d){var f=Vc(a,"enum");b=ac(b);a=f.constructor;f=Object.create(f.constructor.prototype,{value:{value:d},constructor:{value:Mb(f.name+"_"+b,function(){})}});a.values[d]=f;a[b]=f;},Y:function(a,b,d){d=Sb(d);b=ac(b);Rb(a,{name:b,fromWireType:function(f){return f},toWireType:function(f,h){return h},argPackAdvance:8,readValueFromPointer:Wc(b,d),ee:null});},y:function(a,b,d,f,h,m){var u=Pc(b,d);a=ac(a);h=Ic(f,h);rc(a,function(){Nc("Cannot call "+a+" due to unbound types",u);},b-1);Qb([],
|
|
6643
|
+
u,function(n){n=[n[0],null].concat(n.slice(1));Ac(a,Oc(a,n,null,h,m),b-1);return []});},E:function(a,b,d,f,h){b=ac(b);-1===h&&(h=4294967295);h=Sb(d);var m=n=>n;if(0===f){var u=32-8*d;m=n=>n<<u>>>u;}d=b.includes("unsigned")?function(n,q){return q>>>0}:function(n,q){return q};Rb(a,{name:b,fromWireType:m,toWireType:d,argPackAdvance:8,readValueFromPointer:Xc(b,h,0!==f),ee:null});},v:function(a,b,d){function f(m){m>>=2;var u=mb;return new h(kb,u[m+1],u[m])}var h=[Int8Array,Uint8Array,Int16Array,Uint16Array,
|
|
6644
|
+
Int32Array,Uint32Array,Float32Array,Float64Array][b];d=ac(d);Rb(a,{name:d,fromWireType:f,argPackAdvance:8,readValueFromPointer:f},{Vf:!0});},s:function(a,b,d,f,h,m,u,n,q,v,E,G){d=ac(d);m=Ic(h,m);n=Ic(u,n);v=Ic(q,v);G=Ic(E,G);Qb([a],[b],function(L){L=L[0];return [new zc(d,L.Rd,!1,!1,!0,L,f,m,n,v,G)]});},X:function(a,b){b=ac(b);var d="std::string"===b;Rb(a,{name:b,fromWireType:function(f){var h=mb[f>>2],m=f+4;if(d)for(var u=m,n=0;n<=h;++n){var q=m+n;if(n==h||0==K[q]){u=Wa(u,q-u);if(void 0===v)var v=u;
|
|
6645
|
+
else v+=String.fromCharCode(0),v+=u;u=q+1;}}else {v=Array(h);for(n=0;n<h;++n)v[n]=String.fromCharCode(K[m+n]);v=v.join("");}Mc(f);return v},toWireType:function(f,h){h instanceof ArrayBuffer&&(h=new Uint8Array(h));var m="string"==typeof h;m||h instanceof Uint8Array||h instanceof Uint8ClampedArray||h instanceof Int8Array||X("Cannot pass non-string to std::string");var u=d&&m?oa(h):h.length;var n=Hd(4+u+1),q=n+4;mb[n>>2]=u;if(d&&m)ra(h,K,q,u+1);else if(m)for(m=0;m<u;++m){var v=h.charCodeAt(m);255<v&&(Mc(q),
|
|
6646
|
+
X("String has UTF-16 code units that do not fit in 8 bits"));K[q+m]=v;}else for(m=0;m<u;++m)K[q+m]=h[m];null!==f&&f.push(Mc,n);return n},argPackAdvance:8,readValueFromPointer:Hb,ee:function(f){Mc(f);}});},P:function(a,b,d){d=ac(d);if(2===b){var f=Ya;var h=cb;var m=db;var u=()=>Za;var n=1;}else 4===b&&(f=eb,h=fb,m=jb,u=()=>mb,n=2);Rb(a,{name:d,fromWireType:function(q){for(var v=mb[q>>2],E=u(),G,L=q+4,z=0;z<=v;++z){var N=q+4+z*b;if(z==v||0==E[N>>n])L=f(L,N-L),void 0===G?G=L:(G+=String.fromCharCode(0),G+=
|
|
6647
|
+
L),L=N+b;}Mc(q);return G},toWireType:function(q,v){"string"!=typeof v&&X("Cannot pass non-string to C++ string type "+d);var E=m(v),G=Hd(4+E+b);mb[G>>2]=E>>n;h(v,G+4,E+b);null!==q&&q.push(Mc,G);return G},argPackAdvance:8,readValueFromPointer:Hb,ee:function(q){Mc(q);}});},D:function(a,b,d,f,h,m){Fb[a]={name:ac(b),gf:Ic(d,f),le:Ic(h,m),sf:[]};},g:function(a,b,d,f,h,m,u,n,q,v){Fb[a].sf.push({Lf:ac(b),Tf:d,Rf:Ic(f,h),Sf:m,fg:u,eg:Ic(n,q),gg:v});},Ib:function(a,b){b=ac(b);Rb(a,{Xf:!0,name:b,argPackAdvance:0,
|
|
6648
|
+
fromWireType:function(){},toWireType:function(){}});},Fb:function(){return !0},sb:function(){throw Infinity;},I:function(a,b,d){a=Tc(a);b=Vc(b,"emval::as");var f=[],h=xc(f);mb[d>>2]=h;return b.toWireType(f,a)},$:function(a,b,d,f,h){a=$c[a];b=Tc(b);d=Zc(d);var m=[];mb[f>>2]=xc(m);return a(b,d,m,h)},B:function(a,b,d,f){a=$c[a];b=Tc(b);d=Zc(d);a(b,d,null,f);},f:Sc,L:function(a){if(0===a)return xc(ad());a=Zc(a);return xc(ad()[a])},z:function(a,b){var d=cd(a,b),f=d[0];b=f.name+"_$"+d.slice(1).map(function(u){return u.name}).join("_")+
|
|
6649
|
+
"$";var h=dd[b];if(void 0!==h)return h;var m=Array(a-1);h=bd((u,n,q,v)=>{for(var E=0,G=0;G<a-1;++G)m[G]=d[G+1].readValueFromPointer(v+E),E+=d[G+1].argPackAdvance;u=u[n].apply(u,m);for(G=0;G<a-1;++G)d[G+1].If&&d[G+1].If(m[G]);if(!f.Xf)return f.toWireType(q,u)});return dd[b]=h},H:function(a,b){a=Tc(a);b=Tc(b);return xc(a[b])},r:function(a){4<a&&(Rc[a].hf+=1);},K:function(a,b,d,f){a=Tc(a);var h=fd[b];h||(h=ed(b),fd[b]=h);return h(a,d,f)},N:function(){return xc([])},i:function(a){return xc(Zc(a))},G:function(){return xc({})},
|
|
6650
|
+
mb:function(a){a=Tc(a);return !a},F:function(a){var b=Tc(a);Gb(b);Sc(a);},m:function(a,b,d){a=Tc(a);b=Tc(b);d=Tc(d);a[b]=d;},j:function(a,b){a=Vc(a,"_emval_take_value");a=a.readValueFromPointer(b);return xc(a)},ub:function(){return -52},vb:function(){},a:function(){Qa("");},Eb:gd,bd:function(a){Y.activeTexture(a);},cd:function(a,b){Y.attachShader(nd[a],qd[b]);},ca:function(a,b,d){Y.bindAttribLocation(nd[a],b,Wa(d));},da:function(a,b){35051==a?Y.df=b:35052==a&&(Y.Ee=b);Y.bindBuffer(a,md[b]);},ba:function(a,
|
|
6651
|
+
b){Y.bindFramebuffer(a,od[b]);},fc:function(a,b){Y.bindRenderbuffer(a,pd[b]);},Rb:function(a,b){Y.bindSampler(a,sd[b]);},ea:function(a,b){Y.bindTexture(a,ka[b]);},Cc:function(a){Y.bindVertexArray(rd[a]);},xc:function(a){Y.bindVertexArray(rd[a]);},fa:function(a,b,d,f){Y.blendColor(a,b,d,f);},ga:function(a){Y.blendEquation(a);},ha:function(a,b){Y.blendFunc(a,b);},$b:function(a,b,d,f,h,m,u,n,q,v){Y.blitFramebuffer(a,b,d,f,h,m,u,n,q,v);},ia:function(a,b,d,f){2<=x.version?d&&b?Y.bufferData(a,K,f,d,b):Y.bufferData(a,
|
|
6652
|
+
b,f):Y.bufferData(a,d?K.subarray(d,d+b):b,f);},ja:function(a,b,d,f){2<=x.version?d&&Y.bufferSubData(a,b,K,f,d):Y.bufferSubData(a,b,K.subarray(f,f+d));},gc:function(a){return Y.checkFramebufferStatus(a)},S:function(a){Y.clear(a);},aa:function(a,b,d,f){Y.clearColor(a,b,d,f);},W:function(a){Y.clearStencil(a);},kb:function(a,b,d,f){return Y.clientWaitSync(td[a],b,(d>>>0)+4294967296*f)},ka:function(a,b,d,f){Y.colorMask(!!a,!!b,!!d,!!f);},la:function(a){Y.compileShader(qd[a]);},ma:function(a,b,d,f,h,m,u,n){2<=
|
|
6653
|
+
x.version?Y.Ee||!u?Y.compressedTexImage2D(a,b,d,f,h,m,u,n):Y.compressedTexImage2D(a,b,d,f,h,m,K,n,u):Y.compressedTexImage2D(a,b,d,f,h,m,n?K.subarray(n,n+u):null);},na:function(a,b,d,f,h,m,u,n,q){2<=x.version?Y.Ee||!n?Y.compressedTexSubImage2D(a,b,d,f,h,m,u,n,q):Y.compressedTexSubImage2D(a,b,d,f,h,m,u,K,q,n):Y.compressedTexSubImage2D(a,b,d,f,h,m,u,q?K.subarray(q,q+n):null);},Zb:function(a,b,d,f,h){Y.copyBufferSubData(a,b,d,f,h);},oa:function(a,b,d,f,h,m,u,n){Y.copyTexSubImage2D(a,b,d,f,h,m,u,n);},pa:function(){var a=
|
|
6654
|
+
ha(nd),b=Y.createProgram();b.name=a;b.Xe=b.Ve=b.We=0;b.kf=1;nd[a]=b;return a},qa:function(a){var b=ha(qd);qd[b]=Y.createShader(a);return b},ra:function(a){Y.cullFace(a);},sa:function(a,b){for(var d=0;d<a;d++){var f=Q[b+4*d>>2],h=md[f];h&&(Y.deleteBuffer(h),h.name=0,md[f]=null,f==Y.df&&(Y.df=0),f==Y.Ee&&(Y.Ee=0));}},hc:function(a,b){for(var d=0;d<a;++d){var f=Q[b+4*d>>2],h=od[f];h&&(Y.deleteFramebuffer(h),h.name=0,od[f]=null);}},ta:function(a){if(a){var b=nd[a];b?(Y.deleteProgram(b),b.name=0,nd[a]=null):
|
|
6655
|
+
xd(1281);}},ic:function(a,b){for(var d=0;d<a;d++){var f=Q[b+4*d>>2],h=pd[f];h&&(Y.deleteRenderbuffer(h),h.name=0,pd[f]=null);}},Sb:function(a,b){for(var d=0;d<a;d++){var f=Q[b+4*d>>2],h=sd[f];h&&(Y.deleteSampler(h),h.name=0,sd[f]=null);}},ua:function(a){if(a){var b=qd[a];b?(Y.deleteShader(b),qd[a]=null):xd(1281);}},_b:function(a){if(a){var b=td[a];b?(Y.deleteSync(b),b.name=0,td[a]=null):xd(1281);}},va:function(a,b){for(var d=0;d<a;d++){var f=Q[b+4*d>>2],h=ka[f];h&&(Y.deleteTexture(h),h.name=0,ka[f]=null);}},
|
|
6656
|
+
Dc:function(a,b){for(var d=0;d<a;d++){var f=Q[b+4*d>>2];Y.deleteVertexArray(rd[f]);rd[f]=null;}},yc:function(a,b){for(var d=0;d<a;d++){var f=Q[b+4*d>>2];Y.deleteVertexArray(rd[f]);rd[f]=null;}},wa:function(a){Y.depthMask(!!a);},xa:function(a){Y.disable(a);},ya:function(a){Y.disableVertexAttribArray(a);},za:function(a,b,d){Y.drawArrays(a,b,d);},Ac:function(a,b,d,f){Y.drawArraysInstanced(a,b,d,f);},vc:function(a,b,d,f,h){Y.qf.drawArraysInstancedBaseInstanceWEBGL(a,b,d,f,h);},tc:function(a,b){for(var d=Dd[a],
|
|
6657
|
+
f=0;f<a;f++)d[f]=Q[b+4*f>>2];Y.drawBuffers(d);},Aa:function(a,b,d,f){Y.drawElements(a,b,d,f);},Bc:function(a,b,d,f,h){Y.drawElementsInstanced(a,b,d,f,h);},wc:function(a,b,d,f,h,m,u){Y.qf.drawElementsInstancedBaseVertexBaseInstanceWEBGL(a,b,d,f,h,m,u);},nc:function(a,b,d,f,h,m){Y.drawElements(a,f,h,m);},Ba:function(a){Y.enable(a);},Ca:function(a){Y.enableVertexAttribArray(a);},Xb:function(a,b){return (a=Y.fenceSync(a,b))?(b=ha(td),a.name=b,td[b]=a,b):0},Da:function(){Y.finish();},Ea:function(){Y.flush();},jc:function(a,
|
|
6658
|
+
b,d,f){Y.framebufferRenderbuffer(a,b,d,pd[f]);},kc:function(a,b,d,f,h){Y.framebufferTexture2D(a,b,d,ka[f],h);},Fa:function(a){Y.frontFace(a);},Ga:function(a,b){Ed(a,b,"createBuffer",md);},lc:function(a,b){Ed(a,b,"createFramebuffer",od);},mc:function(a,b){Ed(a,b,"createRenderbuffer",pd);},Tb:function(a,b){Ed(a,b,"createSampler",sd);},Ha:function(a,b){Ed(a,b,"createTexture",ka);},Ec:function(a,b){Ed(a,b,"createVertexArray",rd);},zc:function(a,b){Ed(a,b,"createVertexArray",rd);},bc:function(a){Y.generateMipmap(a);},
|
|
6659
|
+
Ia:function(a,b,d){d?Q[d>>2]=Y.getBufferParameter(a,b):xd(1281);},Ja:function(){var a=Y.getError()||Ad;Ad=0;return a},Ka:function(a,b){Fd(a,b,2);},cc:function(a,b,d,f){a=Y.getFramebufferAttachmentParameter(a,b,d);if(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)a=a.name|0;Q[f>>2]=a;},M:function(a,b){Fd(a,b,0);},La:function(a,b,d,f){a=Y.getProgramInfoLog(nd[a]);null===a&&(a="(unknown error)");b=0<b&&f?ra(a,K,f,b):0;d&&(Q[d>>2]=b);},Ma:function(a,b,d){if(d)if(a>=ld)xd(1281);else if(a=nd[a],35716==
|
|
6660
|
+
b)a=Y.getProgramInfoLog(a),null===a&&(a="(unknown error)"),Q[d>>2]=a.length+1;else if(35719==b){if(!a.Xe)for(b=0;b<Y.getProgramParameter(a,35718);++b)a.Xe=Math.max(a.Xe,Y.getActiveUniform(a,b).name.length+1);Q[d>>2]=a.Xe;}else if(35722==b){if(!a.Ve)for(b=0;b<Y.getProgramParameter(a,35721);++b)a.Ve=Math.max(a.Ve,Y.getActiveAttrib(a,b).name.length+1);Q[d>>2]=a.Ve;}else if(35381==b){if(!a.We)for(b=0;b<Y.getProgramParameter(a,35382);++b)a.We=Math.max(a.We,Y.getActiveUniformBlockName(a,b).length+1);Q[d>>
|
|
6661
|
+
2]=a.We;}else Q[d>>2]=Y.getProgramParameter(a,b);else xd(1281);},dc:function(a,b,d){d?Q[d>>2]=Y.getRenderbufferParameter(a,b):xd(1281);},Na:function(a,b,d,f){a=Y.getShaderInfoLog(qd[a]);null===a&&(a="(unknown error)");b=0<b&&f?ra(a,K,f,b):0;d&&(Q[d>>2]=b);},Ob:function(a,b,d,f){a=Y.getShaderPrecisionFormat(a,b);Q[d>>2]=a.rangeMin;Q[d+4>>2]=a.rangeMax;Q[f>>2]=a.precision;},Oa:function(a,b,d){d?35716==b?(a=Y.getShaderInfoLog(qd[a]),null===a&&(a="(unknown error)"),Q[d>>2]=a?a.length+1:0):35720==b?(a=Y.getShaderSource(qd[a]),
|
|
6662
|
+
Q[d>>2]=a?a.length+1:0):Q[d>>2]=Y.getShaderParameter(qd[a],b):xd(1281);},R:function(a){var b=ud[a];if(!b){switch(a){case 7939:b=Y.getSupportedExtensions()||[];b=b.concat(b.map(function(f){return "GL_"+f}));b=Gd(b.join(" "));break;case 7936:case 7937:case 37445:case 37446:(b=Y.getParameter(a))||xd(1280);b=b&&Gd(b);break;case 7938:b=Y.getParameter(7938);b=2<=x.version?"OpenGL ES 3.0 ("+b+")":"OpenGL ES 2.0 ("+b+")";b=Gd(b);break;case 35724:b=Y.getParameter(35724);var d=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);
|
|
6663
|
+
null!==d&&(3==d[1].length&&(d[1]+="0"),b="OpenGL ES GLSL ES "+d[1]+" ("+b+")");b=Gd(b);break;default:xd(1280);}ud[a]=b;}return b},jb:function(a,b){if(2>x.version)return xd(1282),0;var d=vd[a];if(d)return 0>b||b>=d.length?(xd(1281),0):d[b];switch(a){case 7939:return d=Y.getSupportedExtensions()||[],d=d.concat(d.map(function(f){return "GL_"+f})),d=d.map(function(f){return Gd(f)}),d=vd[a]=d,0>b||b>=d.length?(xd(1281),0):d[b];default:return xd(1280),0}},Pa:function(a,b){b=Wa(b);if(a=nd[a]){var d=a,f=d.Ne,
|
|
6664
|
+
h=d.xf,m;if(!f)for(d.Ne=f={},d.wf={},m=0;m<Y.getProgramParameter(d,35718);++m){var u=Y.getActiveUniform(d,m);var n=u.name;u=u.size;var q=Id(n);q=0<q?n.slice(0,q):n;var v=d.kf;d.kf+=u;h[q]=[u,v];for(n=0;n<u;++n)f[v]=n,d.wf[v++]=q;}d=a.Ne;f=0;h=b;m=Id(b);0<m&&(f=parseInt(b.slice(m+1))>>>0,h=b.slice(0,m));if((h=a.xf[h])&&f<h[0]&&(f+=h[1],d[f]=d[f]||Y.getUniformLocation(a,b)))return f}else xd(1281);return -1},Pb:function(a,b,d){for(var f=Dd[b],h=0;h<b;h++)f[h]=Q[d+4*h>>2];Y.invalidateFramebuffer(a,f);},
|
|
6665
|
+
Qb:function(a,b,d,f,h,m,u){for(var n=Dd[b],q=0;q<b;q++)n[q]=Q[d+4*q>>2];Y.invalidateSubFramebuffer(a,n,f,h,m,u);},Yb:function(a){return Y.isSync(td[a])},Qa:function(a){return (a=ka[a])?Y.isTexture(a):0},Ra:function(a){Y.lineWidth(a);},Sa:function(a){a=nd[a];Y.linkProgram(a);a.Ne=0;a.xf={};},rc:function(a,b,d,f,h,m){Y.uf.multiDrawArraysInstancedBaseInstanceWEBGL(a,Q,b>>2,Q,d>>2,Q,f>>2,mb,h>>2,m);},sc:function(a,b,d,f,h,m,u,n){Y.uf.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(a,Q,b>>2,d,Q,f>>2,
|
|
6666
|
+
Q,h>>2,Q,m>>2,mb,u>>2,n);},Ta:function(a,b){3317==a&&(wd=b);Y.pixelStorei(a,b);},uc:function(a){Y.readBuffer(a);},Ua:function(a,b,d,f,h,m,u){if(2<=x.version)if(Y.df)Y.readPixels(a,b,d,f,h,m,u);else {var n=Jd(m);Y.readPixels(a,b,d,f,h,m,n,u>>31-Math.clz32(n.BYTES_PER_ELEMENT));}else (u=Kd(m,h,d,f,u))?Y.readPixels(a,b,d,f,h,m,u):xd(1280);},ec:function(a,b,d,f){Y.renderbufferStorage(a,b,d,f);},ac:function(a,b,d,f,h){Y.renderbufferStorageMultisample(a,b,d,f,h);},Ub:function(a,b,d){Y.samplerParameterf(sd[a],b,
|
|
6667
|
+
d);},Vb:function(a,b,d){Y.samplerParameteri(sd[a],b,d);},Wb:function(a,b,d){Y.samplerParameteri(sd[a],b,Q[d>>2]);},Va:function(a,b,d,f){Y.scissor(a,b,d,f);},Wa:function(a,b,d,f){for(var h="",m=0;m<b;++m){var u=f?Q[f+4*m>>2]:-1;h+=Wa(Q[d+4*m>>2],0>u?void 0:u);}Y.shaderSource(qd[a],h);},Xa:function(a,b,d){Y.stencilFunc(a,b,d);},Ya:function(a,b,d,f){Y.stencilFuncSeparate(a,b,d,f);},Za:function(a){Y.stencilMask(a);},_a:function(a,b){Y.stencilMaskSeparate(a,b);},$a:function(a,b,d){Y.stencilOp(a,b,d);},ab:function(a,
|
|
6668
|
+
b,d,f){Y.stencilOpSeparate(a,b,d,f);},bb:function(a,b,d,f,h,m,u,n,q){if(2<=x.version)if(Y.Ee)Y.texImage2D(a,b,d,f,h,m,u,n,q);else if(q){var v=Jd(n);Y.texImage2D(a,b,d,f,h,m,u,n,v,q>>31-Math.clz32(v.BYTES_PER_ELEMENT));}else Y.texImage2D(a,b,d,f,h,m,u,n,null);else Y.texImage2D(a,b,d,f,h,m,u,n,q?Kd(n,u,f,h,q):null);},cb:function(a,b,d){Y.texParameterf(a,b,d);},db:function(a,b,d){Y.texParameterf(a,b,S[d>>2]);},eb:function(a,b,d){Y.texParameteri(a,b,d);},fb:function(a,b,d){Y.texParameteri(a,b,Q[d>>2]);},oc:function(a,
|
|
6669
|
+
b,d,f,h){Y.texStorage2D(a,b,d,f,h);},gb:function(a,b,d,f,h,m,u,n,q){if(2<=x.version)if(Y.Ee)Y.texSubImage2D(a,b,d,f,h,m,u,n,q);else if(q){var v=Jd(n);Y.texSubImage2D(a,b,d,f,h,m,u,n,v,q>>31-Math.clz32(v.BYTES_PER_ELEMENT));}else Y.texSubImage2D(a,b,d,f,h,m,u,n,null);else v=null,q&&(v=Kd(n,u,h,m,q)),Y.texSubImage2D(a,b,d,f,h,m,u,n,v);},hb:function(a,b){Y.uniform1f(Z(a),b);},ib:function(a,b,d){if(2<=x.version)b&&Y.uniform1fv(Z(a),S,d>>2,b);else {if(288>=b)for(var f=Ld[b-1],h=0;h<b;++h)f[h]=S[d+4*h>>2];else f=
|
|
6670
|
+
S.subarray(d>>2,d+4*b>>2);Y.uniform1fv(Z(a),f);}},Zc:function(a,b){Y.uniform1i(Z(a),b);},_c:function(a,b,d){if(2<=x.version)b&&Y.uniform1iv(Z(a),Q,d>>2,b);else {if(288>=b)for(var f=Md[b-1],h=0;h<b;++h)f[h]=Q[d+4*h>>2];else f=Q.subarray(d>>2,d+4*b>>2);Y.uniform1iv(Z(a),f);}},$c:function(a,b,d){Y.uniform2f(Z(a),b,d);},ad:function(a,b,d){if(2<=x.version)b&&Y.uniform2fv(Z(a),S,d>>2,2*b);else {if(144>=b)for(var f=Ld[2*b-1],h=0;h<2*b;h+=2)f[h]=S[d+4*h>>2],f[h+1]=S[d+(4*h+4)>>2];else f=S.subarray(d>>2,d+8*b>>
|
|
6671
|
+
2);Y.uniform2fv(Z(a),f);}},Yc:function(a,b,d){Y.uniform2i(Z(a),b,d);},Xc:function(a,b,d){if(2<=x.version)b&&Y.uniform2iv(Z(a),Q,d>>2,2*b);else {if(144>=b)for(var f=Md[2*b-1],h=0;h<2*b;h+=2)f[h]=Q[d+4*h>>2],f[h+1]=Q[d+(4*h+4)>>2];else f=Q.subarray(d>>2,d+8*b>>2);Y.uniform2iv(Z(a),f);}},Wc:function(a,b,d,f){Y.uniform3f(Z(a),b,d,f);},Vc:function(a,b,d){if(2<=x.version)b&&Y.uniform3fv(Z(a),S,d>>2,3*b);else {if(96>=b)for(var f=Ld[3*b-1],h=0;h<3*b;h+=3)f[h]=S[d+4*h>>2],f[h+1]=S[d+(4*h+4)>>2],f[h+2]=S[d+(4*h+
|
|
6672
|
+
8)>>2];else f=S.subarray(d>>2,d+12*b>>2);Y.uniform3fv(Z(a),f);}},Uc:function(a,b,d,f){Y.uniform3i(Z(a),b,d,f);},Tc:function(a,b,d){if(2<=x.version)b&&Y.uniform3iv(Z(a),Q,d>>2,3*b);else {if(96>=b)for(var f=Md[3*b-1],h=0;h<3*b;h+=3)f[h]=Q[d+4*h>>2],f[h+1]=Q[d+(4*h+4)>>2],f[h+2]=Q[d+(4*h+8)>>2];else f=Q.subarray(d>>2,d+12*b>>2);Y.uniform3iv(Z(a),f);}},Sc:function(a,b,d,f,h){Y.uniform4f(Z(a),b,d,f,h);},Rc:function(a,b,d){if(2<=x.version)b&&Y.uniform4fv(Z(a),S,d>>2,4*b);else {if(72>=b){var f=Ld[4*b-1],h=S;d>>=
|
|
6673
|
+
2;for(var m=0;m<4*b;m+=4){var u=d+m;f[m]=h[u];f[m+1]=h[u+1];f[m+2]=h[u+2];f[m+3]=h[u+3];}}else f=S.subarray(d>>2,d+16*b>>2);Y.uniform4fv(Z(a),f);}},Fc:function(a,b,d,f,h){Y.uniform4i(Z(a),b,d,f,h);},Gc:function(a,b,d){if(2<=x.version)b&&Y.uniform4iv(Z(a),Q,d>>2,4*b);else {if(72>=b)for(var f=Md[4*b-1],h=0;h<4*b;h+=4)f[h]=Q[d+4*h>>2],f[h+1]=Q[d+(4*h+4)>>2],f[h+2]=Q[d+(4*h+8)>>2],f[h+3]=Q[d+(4*h+12)>>2];else f=Q.subarray(d>>2,d+16*b>>2);Y.uniform4iv(Z(a),f);}},Hc:function(a,b,d,f){if(2<=x.version)b&&Y.uniformMatrix2fv(Z(a),
|
|
6674
|
+
!!d,S,f>>2,4*b);else {if(72>=b)for(var h=Ld[4*b-1],m=0;m<4*b;m+=4)h[m]=S[f+4*m>>2],h[m+1]=S[f+(4*m+4)>>2],h[m+2]=S[f+(4*m+8)>>2],h[m+3]=S[f+(4*m+12)>>2];else h=S.subarray(f>>2,f+16*b>>2);Y.uniformMatrix2fv(Z(a),!!d,h);}},Ic:function(a,b,d,f){if(2<=x.version)b&&Y.uniformMatrix3fv(Z(a),!!d,S,f>>2,9*b);else {if(32>=b)for(var h=Ld[9*b-1],m=0;m<9*b;m+=9)h[m]=S[f+4*m>>2],h[m+1]=S[f+(4*m+4)>>2],h[m+2]=S[f+(4*m+8)>>2],h[m+3]=S[f+(4*m+12)>>2],h[m+4]=S[f+(4*m+16)>>2],h[m+5]=S[f+(4*m+20)>>2],h[m+6]=S[f+(4*m+24)>>
|
|
6675
|
+
2],h[m+7]=S[f+(4*m+28)>>2],h[m+8]=S[f+(4*m+32)>>2];else h=S.subarray(f>>2,f+36*b>>2);Y.uniformMatrix3fv(Z(a),!!d,h);}},Jc:function(a,b,d,f){if(2<=x.version)b&&Y.uniformMatrix4fv(Z(a),!!d,S,f>>2,16*b);else {if(18>=b){var h=Ld[16*b-1],m=S;f>>=2;for(var u=0;u<16*b;u+=16){var n=f+u;h[u]=m[n];h[u+1]=m[n+1];h[u+2]=m[n+2];h[u+3]=m[n+3];h[u+4]=m[n+4];h[u+5]=m[n+5];h[u+6]=m[n+6];h[u+7]=m[n+7];h[u+8]=m[n+8];h[u+9]=m[n+9];h[u+10]=m[n+10];h[u+11]=m[n+11];h[u+12]=m[n+12];h[u+13]=m[n+13];h[u+14]=m[n+14];h[u+15]=
|
|
6676
|
+
m[n+15];}}else h=S.subarray(f>>2,f+64*b>>2);Y.uniformMatrix4fv(Z(a),!!d,h);}},Kc:function(a){a=nd[a];Y.useProgram(a);Y.Hf=a;},Lc:function(a,b){Y.vertexAttrib1f(a,b);},Mc:function(a,b){Y.vertexAttrib2f(a,S[b>>2],S[b+4>>2]);},Nc:function(a,b){Y.vertexAttrib3f(a,S[b>>2],S[b+4>>2],S[b+8>>2]);},Oc:function(a,b){Y.vertexAttrib4f(a,S[b>>2],S[b+4>>2],S[b+8>>2],S[b+12>>2]);},pc:function(a,b){Y.vertexAttribDivisor(a,b);},qc:function(a,b,d,f,h){Y.vertexAttribIPointer(a,b,d,f,h);},Pc:function(a,b,d,f,h,m){Y.vertexAttribPointer(a,
|
|
6677
|
+
b,d,!!f,h,m);},Qc:function(a,b,d,f){Y.viewport(a,b,d,f);},lb:function(a,b,d,f){Y.waitSync(td[a],b,(d>>>0)+4294967296*f);},tb:function(a){var b=K.length;a>>>=0;if(2147483648<a)return !1;for(var d=1;4>=d;d*=2){var f=b*(1+.2/d);f=Math.min(f,a+100663296);var h=Math;f=Math.max(a,f);h=h.min.call(h,2147483648,f+(65536-f%65536)%65536);a:{try{Ra.grow(h-kb.byteLength+65535>>>16);ob();var m=1;break a}catch(u){}m=void 0;}if(m)return !0}return !1},nb:function(){return x?x.Uf:0},wb:function(a,b){var d=0;Od().forEach(function(f,
|
|
6678
|
+
h){var m=b+d;h=mb[a+4*h>>2]=m;for(m=0;m<f.length;++m)lb[h++>>0]=f.charCodeAt(m);lb[h>>0]=0;d+=f.length+1;});return 0},xb:function(a,b){var d=Od();mb[a>>2]=d.length;var f=0;d.forEach(function(h){f+=h.length+1;});mb[b>>2]=f;return 0},Jb:function(a){if(!noExitRuntime){if(w.onExit)w.onExit(a);Sa=!0;}wa(a,new Ja(a));},O:function(){return 52},ob:function(){return 52},Cb:function(){return 52},pb:function(){return 70},T:function(a,b,d,f){for(var h=0,m=0;m<d;m++){var u=mb[b>>2],n=mb[b+4>>2];b+=8;for(var q=0;q<
|
|
6679
|
+
n;q++){var v=K[u+q],E=Qd[a];0===v||10===v?((1===a?La:Ka)(Va(E,0)),E.length=0):E.push(v);}h+=n;}mb[f>>2]=h;return 0},c:function(){return Ma},k:ae,q:be,l:ce,J:de,Lb:ee,_:fe,Z:ge,Q:he,o:ie,x:je,t:ke,w:le,Kb:me,Mb:ne,Nb:oe,d:function(a){Ma=a;},rb:function(a,b,d,f){return Ud(a,b,d,f)}};
|
|
6680
|
+
(function(){function a(h){w.asm=h.exports;Ra=w.asm.dd;ob();pb=w.asm.fd;rb.unshift(w.asm.ed);ub--;w.monitorRunDependencies&&w.monitorRunDependencies(ub);0==ub&&(wb&&(h=wb,wb=null,h()));}function b(h){a(h.instance);}function d(h){return Cb().then(function(m){return WebAssembly.instantiate(m,f)}).then(function(m){return m}).then(h,function(m){Ka("failed to asynchronously prepare wasm: "+m);Qa(m);})}var f={a:pe};ub++;w.monitorRunDependencies&&w.monitorRunDependencies(ub);
|
|
6681
|
+
if(w.instantiateWasm)try{return w.instantiateWasm(f,a)}catch(h){return Ka("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return Na||"function"!=typeof WebAssembly.instantiateStreaming||yb()||zb.startsWith("file://")||za||"function"!=typeof fetch?d(b):fetch(zb,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,f).then(b,function(m){Ka("wasm streaming compile failed: "+m);Ka("falling back to ArrayBuffer instantiation");return d(b)})})})().catch(ea);
|
|
6682
|
+
return {}})();w.___wasm_call_ctors=function(){return (w.___wasm_call_ctors=w.asm.ed).apply(null,arguments)};var Mc=w._free=function(){return (Mc=w._free=w.asm.gd).apply(null,arguments)},Hd=w._malloc=function(){return (Hd=w._malloc=w.asm.hd).apply(null,arguments)},Lc=w.___getTypeName=function(){return (Lc=w.___getTypeName=w.asm.id).apply(null,arguments)};w.___embind_register_native_and_builtin_types=function(){return (w.___embind_register_native_and_builtin_types=w.asm.jd).apply(null,arguments)};
|
|
6683
|
+
var qe=w._setThrew=function(){return (qe=w._setThrew=w.asm.kd).apply(null,arguments)},re=w.stackSave=function(){return (re=w.stackSave=w.asm.ld).apply(null,arguments)},se=w.stackRestore=function(){return (se=w.stackRestore=w.asm.md).apply(null,arguments)};w.dynCall_viji=function(){return (w.dynCall_viji=w.asm.nd).apply(null,arguments)};w.dynCall_vijiii=function(){return (w.dynCall_vijiii=w.asm.od).apply(null,arguments)};w.dynCall_viiiiij=function(){return (w.dynCall_viiiiij=w.asm.pd).apply(null,arguments)};
|
|
6684
|
+
w.dynCall_jiiiijiiiii=function(){return (w.dynCall_jiiiijiiiii=w.asm.qd).apply(null,arguments)};w.dynCall_viiij=function(){return (w.dynCall_viiij=w.asm.rd).apply(null,arguments)};w.dynCall_jii=function(){return (w.dynCall_jii=w.asm.sd).apply(null,arguments)};w.dynCall_vij=function(){return (w.dynCall_vij=w.asm.td).apply(null,arguments)};w.dynCall_iiij=function(){return (w.dynCall_iiij=w.asm.ud).apply(null,arguments)};w.dynCall_iiiij=function(){return (w.dynCall_iiiij=w.asm.vd).apply(null,arguments)};
|
|
6685
|
+
w.dynCall_viij=function(){return (w.dynCall_viij=w.asm.wd).apply(null,arguments)};w.dynCall_ji=function(){return (w.dynCall_ji=w.asm.xd).apply(null,arguments)};w.dynCall_iij=function(){return (w.dynCall_iij=w.asm.yd).apply(null,arguments)};w.dynCall_jiiiiii=function(){return (w.dynCall_jiiiiii=w.asm.zd).apply(null,arguments)};w.dynCall_jiiiiji=function(){return (w.dynCall_jiiiiji=w.asm.Ad).apply(null,arguments)};w.dynCall_iijj=function(){return (w.dynCall_iijj=w.asm.Bd).apply(null,arguments)};
|
|
6686
|
+
w.dynCall_iiiji=function(){return (w.dynCall_iiiji=w.asm.Cd).apply(null,arguments)};w.dynCall_iiji=function(){return (w.dynCall_iiji=w.asm.Dd).apply(null,arguments)};w.dynCall_iijjiii=function(){return (w.dynCall_iijjiii=w.asm.Ed).apply(null,arguments)};w.dynCall_vijjjii=function(){return (w.dynCall_vijjjii=w.asm.Fd).apply(null,arguments)};w.dynCall_jiji=function(){return (w.dynCall_jiji=w.asm.Gd).apply(null,arguments)};w.dynCall_viijii=function(){return (w.dynCall_viijii=w.asm.Hd).apply(null,arguments)};
|
|
6687
|
+
w.dynCall_iiiiij=function(){return (w.dynCall_iiiiij=w.asm.Id).apply(null,arguments)};w.dynCall_iiiiijj=function(){return (w.dynCall_iiiiijj=w.asm.Jd).apply(null,arguments)};w.dynCall_iiiiiijj=function(){return (w.dynCall_iiiiiijj=w.asm.Kd).apply(null,arguments)};function ce(a,b,d,f){var h=re();try{return Eb(a)(b,d,f)}catch(m){se(h);if(m!==m+0)throw m;qe(1,0);}}function ae(a,b){var d=re();try{return Eb(a)(b)}catch(f){se(d);if(f!==f+0)throw f;qe(1,0);}}
|
|
6688
|
+
function oe(a,b,d,f,h,m,u,n,q,v){var E=re();try{Eb(a)(b,d,f,h,m,u,n,q,v);}catch(G){se(E);if(G!==G+0)throw G;qe(1,0);}}function ke(a,b,d,f){var h=re();try{Eb(a)(b,d,f);}catch(m){se(h);if(m!==m+0)throw m;qe(1,0);}}function je(a,b,d){var f=re();try{Eb(a)(b,d);}catch(h){se(f);if(h!==h+0)throw h;qe(1,0);}}function he(a){var b=re();try{Eb(a)();}catch(d){se(b);if(d!==d+0)throw d;qe(1,0);}}function le(a,b,d,f,h){var m=re();try{Eb(a)(b,d,f,h);}catch(u){se(m);if(u!==u+0)throw u;qe(1,0);}}
|
|
6689
|
+
function ie(a,b){var d=re();try{Eb(a)(b);}catch(f){se(d);if(f!==f+0)throw f;qe(1,0);}}function be(a,b,d){var f=re();try{return Eb(a)(b,d)}catch(h){se(f);if(h!==h+0)throw h;qe(1,0);}}function ne(a,b,d,f,h,m,u){var n=re();try{Eb(a)(b,d,f,h,m,u);}catch(q){se(n);if(q!==q+0)throw q;qe(1,0);}}function de(a,b,d,f,h){var m=re();try{return Eb(a)(b,d,f,h)}catch(u){se(m);if(u!==u+0)throw u;qe(1,0);}}function ee(a,b,d,f,h,m){var u=re();try{return Eb(a)(b,d,f,h,m)}catch(n){se(u);if(n!==n+0)throw n;qe(1,0);}}
|
|
6690
|
+
function fe(a,b,d,f,h,m,u){var n=re();try{return Eb(a)(b,d,f,h,m,u)}catch(q){se(n);if(q!==q+0)throw q;qe(1,0);}}function me(a,b,d,f,h,m){var u=re();try{Eb(a)(b,d,f,h,m);}catch(n){se(u);if(n!==n+0)throw n;qe(1,0);}}function ge(a,b,d,f,h,m,u,n,q,v){var E=re();try{return Eb(a)(b,d,f,h,m,u,n,q,v)}catch(G){se(E);if(G!==G+0)throw G;qe(1,0);}}var te;function Ja(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a;}wb=function ue(){te||ve();te||(wb=ue);};
|
|
6691
|
+
function ve(){function a(){if(!te&&(te=!0,w.calledRun=!0,!Sa)){Db(rb);da(w);if(w.onRuntimeInitialized)w.onRuntimeInitialized();if(w.postRun)for("function"==typeof w.postRun&&(w.postRun=[w.postRun]);w.postRun.length;){var b=w.postRun.shift();sb.unshift(b);}Db(sb);}}if(!(0<ub)){if(w.preRun)for("function"==typeof w.preRun&&(w.preRun=[w.preRun]);w.preRun.length;)tb();Db(qb);0<ub||(w.setStatus?(w.setStatus("Running..."),setTimeout(function(){setTimeout(function(){w.setStatus("");},1);a();},1)):a());}}
|
|
6692
|
+
w.run=ve;if(w.preInit)for("function"==typeof w.preInit&&(w.preInit=[w.preInit]);0<w.preInit.length;)w.preInit.pop()();ve();
|
|
6589
6693
|
|
|
6590
6694
|
|
|
6591
6695
|
return CanvasKitInit.ready
|
|
@@ -6593,36 +6697,11 @@ var w;w||(w=typeof CanvasKitInit !== 'undefined' ? CanvasKitInit : {});var aa,ea
|
|
|
6593
6697
|
);
|
|
6594
6698
|
})();
|
|
6595
6699
|
module.exports = CanvasKitInit;
|
|
6596
|
-
} (canvaskit
|
|
6597
|
-
|
|
6598
|
-
var canvaskitExports = canvaskit$1.exports;
|
|
6599
|
-
var canvaskit = /*@__PURE__*/getDefaultExportFromCjs(canvaskitExports);
|
|
6700
|
+
} (canvaskit));
|
|
6600
6701
|
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
return initialize({ locateFile: () => canvasKitWasmUrl });
|
|
6604
|
-
}
|
|
6702
|
+
var canvaskitExports = canvaskit.exports;
|
|
6703
|
+
var CanvasKitInit = /*@__PURE__*/getDefaultExportFromCjs(canvaskitExports);
|
|
6605
6704
|
|
|
6606
|
-
var __async = (__this, __arguments, generator) => {
|
|
6607
|
-
return new Promise((resolve, reject) => {
|
|
6608
|
-
var fulfilled = (value) => {
|
|
6609
|
-
try {
|
|
6610
|
-
step(generator.next(value));
|
|
6611
|
-
} catch (e) {
|
|
6612
|
-
reject(e);
|
|
6613
|
-
}
|
|
6614
|
-
};
|
|
6615
|
-
var rejected = (value) => {
|
|
6616
|
-
try {
|
|
6617
|
-
step(generator.throw(value));
|
|
6618
|
-
} catch (e) {
|
|
6619
|
-
reject(e);
|
|
6620
|
-
}
|
|
6621
|
-
};
|
|
6622
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
6623
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
6624
|
-
});
|
|
6625
|
-
};
|
|
6626
6705
|
class Session {
|
|
6627
6706
|
/**
|
|
6628
6707
|
* A Session contains one or more activities. The session manages the start
|
|
@@ -6632,7 +6711,7 @@ class Session {
|
|
|
6632
6711
|
*/
|
|
6633
6712
|
constructor(options) {
|
|
6634
6713
|
this.sessionDictionary = /* @__PURE__ */ new Map();
|
|
6635
|
-
this.version = "0.3.
|
|
6714
|
+
this.version = "0.3.7 (402d543e)";
|
|
6636
6715
|
this.options = options;
|
|
6637
6716
|
for (const activity of this.options.activities) {
|
|
6638
6717
|
if (this.options.activities.filter((a) => a === activity).length > 1) {
|
|
@@ -6641,8 +6720,8 @@ class Session {
|
|
|
6641
6720
|
);
|
|
6642
6721
|
}
|
|
6643
6722
|
}
|
|
6644
|
-
this.fontManager = new FontManager();
|
|
6645
|
-
this.imageManager = new ImageManager();
|
|
6723
|
+
this.fontManager = new FontManager(this);
|
|
6724
|
+
this.imageManager = new ImageManager(this);
|
|
6646
6725
|
this.options.activities.forEach((activity) => activity.session = this);
|
|
6647
6726
|
if (this.options.sessionUuid) {
|
|
6648
6727
|
this.uuid = this.options.sessionUuid;
|
|
@@ -6653,47 +6732,43 @@ class Session {
|
|
|
6653
6732
|
/**
|
|
6654
6733
|
* Asynchronously initializes the m2c2kit engine and loads assets
|
|
6655
6734
|
*/
|
|
6656
|
-
init() {
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
}
|
|
6684
|
-
});
|
|
6735
|
+
async init() {
|
|
6736
|
+
var _a;
|
|
6737
|
+
console.log(`\u26AA @m2c2kit/core version ${this.version}`);
|
|
6738
|
+
Timer.start("sessionInit");
|
|
6739
|
+
DomHelpers.addLoadingElements();
|
|
6740
|
+
DomHelpers.setSpinnerVisibility(true);
|
|
6741
|
+
DomHelpers.setCanvasOverlayVisibility(true);
|
|
6742
|
+
await Promise.all(
|
|
6743
|
+
this.options.activities.map((activity) => {
|
|
6744
|
+
activity.dataStore = this.dataStore;
|
|
6745
|
+
return activity.init();
|
|
6746
|
+
})
|
|
6747
|
+
);
|
|
6748
|
+
const [canvasKit] = await this.getAsynchronousAssets();
|
|
6749
|
+
this.loadAssets(canvasKit);
|
|
6750
|
+
this.imageManager.removeScratchCanvas();
|
|
6751
|
+
console.log(
|
|
6752
|
+
`\u26AA Session.init() took ${Timer.elapsed("sessionInit").toFixed(0)} ms`
|
|
6753
|
+
);
|
|
6754
|
+
Timer.remove("sessionInit");
|
|
6755
|
+
const sessionLifecycleChangeCallback = (_a = this.options.sessionCallbacks) == null ? void 0 : _a.onSessionLifecycle;
|
|
6756
|
+
if (sessionLifecycleChangeCallback) {
|
|
6757
|
+
sessionLifecycleChangeCallback({
|
|
6758
|
+
target: this,
|
|
6759
|
+
type: EventType.SessionInitialize
|
|
6760
|
+
});
|
|
6761
|
+
}
|
|
6685
6762
|
}
|
|
6686
6763
|
/**
|
|
6687
6764
|
* Starts the session and starts the first activity.
|
|
6688
6765
|
*/
|
|
6689
|
-
start() {
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
}
|
|
6696
|
-
});
|
|
6766
|
+
async start() {
|
|
6767
|
+
this.currentActivity = this.options.activities.find(Boolean);
|
|
6768
|
+
if (this.currentActivity) {
|
|
6769
|
+
DomHelpers.configureDomForActivity(this.currentActivity);
|
|
6770
|
+
await this.currentActivity.start();
|
|
6771
|
+
}
|
|
6697
6772
|
}
|
|
6698
6773
|
/**
|
|
6699
6774
|
* Declares the session ended and sends callback.
|
|
@@ -6727,69 +6802,65 @@ class Session {
|
|
|
6727
6802
|
*
|
|
6728
6803
|
* @param options
|
|
6729
6804
|
*/
|
|
6730
|
-
goToActivity(options) {
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
`Error in goToActivity(): Session does not contain an activity with id ${options.id}.`
|
|
6736
|
-
);
|
|
6737
|
-
}
|
|
6738
|
-
if (this.currentActivity) {
|
|
6739
|
-
this.currentActivity.stop();
|
|
6740
|
-
}
|
|
6741
|
-
const currentActivityOldObject = nextActivity;
|
|
6742
|
-
const activityFactoryFunction = currentActivityOldObject.constructor.bind.apply(
|
|
6743
|
-
currentActivityOldObject.constructor,
|
|
6744
|
-
[null]
|
|
6805
|
+
async goToActivity(options) {
|
|
6806
|
+
const nextActivity = this.options.activities.filter((activity) => activity.id === options.id).find(Boolean);
|
|
6807
|
+
if (!nextActivity) {
|
|
6808
|
+
throw new Error(
|
|
6809
|
+
`Error in goToActivity(): Session does not contain an activity with id ${options.id}.`
|
|
6745
6810
|
);
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6811
|
+
}
|
|
6812
|
+
if (this.currentActivity) {
|
|
6813
|
+
this.currentActivity.stop();
|
|
6814
|
+
}
|
|
6815
|
+
const currentActivityOldObject = nextActivity;
|
|
6816
|
+
const activityFactoryFunction = currentActivityOldObject.constructor.bind.apply(
|
|
6817
|
+
currentActivityOldObject.constructor,
|
|
6818
|
+
[null]
|
|
6819
|
+
);
|
|
6820
|
+
this.currentActivity = new activityFactoryFunction();
|
|
6821
|
+
const indexOfCurrentActivity = this.options.activities.indexOf(
|
|
6822
|
+
currentActivityOldObject
|
|
6823
|
+
);
|
|
6824
|
+
this.options.activities[indexOfCurrentActivity] = this.currentActivity;
|
|
6825
|
+
DomHelpers.configureDomForActivity(this.currentActivity);
|
|
6826
|
+
this.currentActivity.session = this;
|
|
6827
|
+
this.currentActivity.dataStore = this.dataStore;
|
|
6828
|
+
if (this.currentActivity.type === ActivityType.Game && this.canvasKit) {
|
|
6829
|
+
this.currentActivity.canvasKit = this.canvasKit;
|
|
6830
|
+
}
|
|
6831
|
+
if (currentActivityOldObject.additionalParameters) {
|
|
6832
|
+
this.currentActivity.setParameters(
|
|
6833
|
+
currentActivityOldObject.additionalParameters
|
|
6749
6834
|
);
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
this.currentActivity.
|
|
6753
|
-
this.
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
}
|
|
6762
|
-
if (this.imageManager.loadedImages[currentActivityOldObject.uuid]) {
|
|
6763
|
-
this.imageManager.loadedImages[this.currentActivity.uuid] = this.imageManager.loadedImages[currentActivityOldObject.uuid];
|
|
6764
|
-
delete this.imageManager.loadedImages[currentActivityOldObject.uuid];
|
|
6765
|
-
}
|
|
6766
|
-
if (this.fontManager.gameTypefaces[currentActivityOldObject.uuid]) {
|
|
6767
|
-
this.fontManager.gameTypefaces[this.currentActivity.uuid] = this.fontManager.gameTypefaces[currentActivityOldObject.uuid];
|
|
6768
|
-
delete this.fontManager.gameTypefaces[currentActivityOldObject.uuid];
|
|
6769
|
-
}
|
|
6770
|
-
yield this.currentActivity.init();
|
|
6771
|
-
yield this.currentActivity.start();
|
|
6772
|
-
});
|
|
6835
|
+
}
|
|
6836
|
+
if (this.imageManager.loadedImages[currentActivityOldObject.uuid]) {
|
|
6837
|
+
this.imageManager.loadedImages[this.currentActivity.uuid] = this.imageManager.loadedImages[currentActivityOldObject.uuid];
|
|
6838
|
+
delete this.imageManager.loadedImages[currentActivityOldObject.uuid];
|
|
6839
|
+
}
|
|
6840
|
+
if (this.fontManager.gameTypefaces[currentActivityOldObject.uuid]) {
|
|
6841
|
+
this.fontManager.gameTypefaces[this.currentActivity.uuid] = this.fontManager.gameTypefaces[currentActivityOldObject.uuid];
|
|
6842
|
+
delete this.fontManager.gameTypefaces[currentActivityOldObject.uuid];
|
|
6843
|
+
}
|
|
6844
|
+
await this.currentActivity.init();
|
|
6845
|
+
await this.currentActivity.start();
|
|
6773
6846
|
}
|
|
6774
6847
|
/**
|
|
6775
6848
|
* Stops the current activity and advances to next activity in the session.
|
|
6776
6849
|
* If there is no activity after the current activity, throws error.
|
|
6777
6850
|
*/
|
|
6778
|
-
goToNextActivity() {
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
}
|
|
6792
|
-
});
|
|
6851
|
+
async goToNextActivity() {
|
|
6852
|
+
if (!this.currentActivity) {
|
|
6853
|
+
throw new Error("error in advanceToNextActivity(): no current activity");
|
|
6854
|
+
}
|
|
6855
|
+
if (!this.nextActivity) {
|
|
6856
|
+
throw new Error("error in advanceToNextActivity(): no next activity");
|
|
6857
|
+
}
|
|
6858
|
+
this.currentActivity.stop();
|
|
6859
|
+
this.currentActivity = this.nextActivity;
|
|
6860
|
+
if (this.currentActivity) {
|
|
6861
|
+
DomHelpers.configureDomForActivity(this.currentActivity);
|
|
6862
|
+
await this.currentActivity.start();
|
|
6863
|
+
}
|
|
6793
6864
|
}
|
|
6794
6865
|
/**
|
|
6795
6866
|
* Stops the current activity and advances to next activity in the session.
|
|
@@ -6797,10 +6868,8 @@ class Session {
|
|
|
6797
6868
|
*
|
|
6798
6869
|
* @deprecated Use goToNextActivity() instead.
|
|
6799
6870
|
*/
|
|
6800
|
-
advanceToNextActivity() {
|
|
6801
|
-
|
|
6802
|
-
yield this.goToNextActivity();
|
|
6803
|
-
});
|
|
6871
|
+
async advanceToNextActivity() {
|
|
6872
|
+
await this.goToNextActivity();
|
|
6804
6873
|
}
|
|
6805
6874
|
/**
|
|
6806
6875
|
* Gets the next activity after the current one, or undefined if
|
|
@@ -6877,26 +6946,25 @@ class Session {
|
|
|
6877
6946
|
* of images
|
|
6878
6947
|
* @returns
|
|
6879
6948
|
*/
|
|
6880
|
-
getAsynchronousAssets() {
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
]);
|
|
6894
|
-
});
|
|
6949
|
+
async getAsynchronousAssets() {
|
|
6950
|
+
const canvasKitPromise = this.loadCanvasKit(this.options.canvasKitWasmUrl);
|
|
6951
|
+
const fetchFontsPromise = this.fontManager.fetchFonts(
|
|
6952
|
+
this.options.activities.filter((activity) => activity.type === ActivityType.Game).map((activity) => activity)
|
|
6953
|
+
);
|
|
6954
|
+
const renderImagesPromise = this.imageManager.renderImages(
|
|
6955
|
+
this.getImagesConfigurationFromGames()
|
|
6956
|
+
);
|
|
6957
|
+
return await Promise.all([
|
|
6958
|
+
canvasKitPromise,
|
|
6959
|
+
fetchFontsPromise,
|
|
6960
|
+
renderImagesPromise
|
|
6961
|
+
]);
|
|
6895
6962
|
}
|
|
6896
6963
|
// call CanvasKitInit through loadCanvasKit so we can mock
|
|
6897
6964
|
// loadCanvasKit using jest
|
|
6898
6965
|
loadCanvasKit(canvasKitWasmUrl) {
|
|
6899
|
-
|
|
6966
|
+
const fullUrl = this.prependAssetsUrl(canvasKitWasmUrl);
|
|
6967
|
+
return CanvasKitInit({ locateFile: (_file) => fullUrl });
|
|
6900
6968
|
}
|
|
6901
6969
|
loadAssets(canvasKit) {
|
|
6902
6970
|
this.assignCanvasKit(canvasKit);
|
|
@@ -6912,13 +6980,6 @@ class Session {
|
|
|
6912
6980
|
game.canvasKit = canvasKit;
|
|
6913
6981
|
});
|
|
6914
6982
|
}
|
|
6915
|
-
getFontsConfigurationFromGames() {
|
|
6916
|
-
return this.options.activities.filter((activity) => activity.type == ActivityType.Game).map((activity) => {
|
|
6917
|
-
var _a;
|
|
6918
|
-
const game = activity;
|
|
6919
|
-
return { uuid: game.uuid, fontUrls: (_a = game.options.fontUrls) != null ? _a : [] };
|
|
6920
|
-
});
|
|
6921
|
-
}
|
|
6922
6983
|
getImagesConfigurationFromGames() {
|
|
6923
6984
|
return this.options.activities.filter((activity) => activity.type == ActivityType.Game).map((activity) => {
|
|
6924
6985
|
var _a;
|
|
@@ -6926,6 +6987,18 @@ class Session {
|
|
|
6926
6987
|
return { uuid: game.uuid, images: (_a = game.options.images) != null ? _a : [] };
|
|
6927
6988
|
});
|
|
6928
6989
|
}
|
|
6990
|
+
prependAssetsUrl(url) {
|
|
6991
|
+
function hasUrlScheme(str) {
|
|
6992
|
+
return /^[a-z]+:\/\//i.test(str);
|
|
6993
|
+
}
|
|
6994
|
+
if (hasUrlScheme(url)) {
|
|
6995
|
+
return url;
|
|
6996
|
+
}
|
|
6997
|
+
if (!this.options.assetsUrl) {
|
|
6998
|
+
return `assets/${url}`;
|
|
6999
|
+
}
|
|
7000
|
+
return this.options.assetsUrl.replace(/\/$/, "") + "/" + url.replace(/^\//, "");
|
|
7001
|
+
}
|
|
6929
7002
|
}
|
|
6930
7003
|
|
|
6931
7004
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -7623,14 +7696,14 @@ class TextLine extends Entity {
|
|
|
7623
7696
|
textForDraw = this._translatedText;
|
|
7624
7697
|
if (this._translatedText === "") {
|
|
7625
7698
|
console.warn(
|
|
7626
|
-
`warning: empty translated text in
|
|
7699
|
+
`warning: empty translated text in TextLine "${this.name}"`
|
|
7627
7700
|
);
|
|
7628
7701
|
}
|
|
7629
7702
|
} else {
|
|
7630
7703
|
textForDraw = this.text;
|
|
7631
7704
|
this._translatedText = "";
|
|
7632
7705
|
if (this.text === "") {
|
|
7633
|
-
console.warn(`warning: empty text in
|
|
7706
|
+
console.warn(`warning: empty text in TextLine "${this.name}"`);
|
|
7634
7707
|
}
|
|
7635
7708
|
}
|
|
7636
7709
|
if (paintForDraw === void 0 || this.font === void 0) {
|