@pencil-lang/figure 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +127 -2
- package/astro/Figure.astro +108 -0
- package/astro/build.js +264 -0
- package/astro/client.js +9 -0
- package/astro/index.js +153 -0
- package/fonts/LibertinusMath-Regular.otf +0 -0
- package/fonts/LibertinusSans-Regular.otf +0 -0
- package/fonts/LibertinusSerif-Italic.otf +0 -0
- package/fonts/OFL.txt +94 -0
- package/fonts/README.md +18 -0
- package/package.json +54 -3
- package/pkg/pencil-figure.min.js +32 -0
- package/pkg/pencil_web.js +3094 -0
- package/pkg/pencil_web_bg.wasm +0 -0
- package/src/element.js +992 -0
- package/src/fit.js +14 -0
- package/src/host.js +109 -0
- package/src/labels.js +266 -0
- package/src/pack.js +67 -0
- package/src/scheme.js +62 -0
package/astro/index.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// The Astro side of Pencil: an integration and, beside it, `Figure.astro`.
|
|
2
|
+
//
|
|
3
|
+
// // astro.config.mjs
|
|
4
|
+
// import pencil from '@pencil-lang/figure/astro';
|
|
5
|
+
// export default defineConfig({ integrations: [pencil({ root: './figures' })] });
|
|
6
|
+
//
|
|
7
|
+
// // a page
|
|
8
|
+
// import Figure from '@pencil-lang/figure/Figure.astro';
|
|
9
|
+
// <Figure src="tube.pen" sheets="theme.style tube.style" dark="dark.style" alt="…" />
|
|
10
|
+
//
|
|
11
|
+
// A build runs `pencil build` for each figure and each set of sheets a reader can get, and the page
|
|
12
|
+
// ships the compiled figures and their posters and no sources. `astro dev` hands the element the
|
|
13
|
+
// sources, served from where they are, and tells it when one changes, so a figure follows its
|
|
14
|
+
// files as they're edited without the page reloading.
|
|
15
|
+
//
|
|
16
|
+
// Options:
|
|
17
|
+
// - `root`: where `src` and `sheets` paths start, from the Astro project. The project, by default.
|
|
18
|
+
// - `playground`: the address of a Pencil playground, as `https://pencil-lang.dev/playground/`.
|
|
19
|
+
// With one, `build()` gives each figure a link that opens its sources there. A built page ships
|
|
20
|
+
// no sources, so the link carries them, after its `#`, which no server is sent.
|
|
21
|
+
// - `bin`: the `pencil` command. By default PENCIL_BIN, then `target/release/pencil` in the repo
|
|
22
|
+
// around `root` or around this package, then `pencil` on the PATH.
|
|
23
|
+
// - `kept`: a folder in the project to keep built figures in, for a site whose build runs where
|
|
24
|
+
// there's no `pencil` or no GPU. Figures are built where there are, and the folder is committed
|
|
25
|
+
// with the site. A build uses what's kept for a figure while its sources hold what they did
|
|
26
|
+
// when it was built and the package's WASM is the build that compiled it. Otherwise it builds
|
|
27
|
+
// the figure again, or stops and says which one, if `pencil` isn't there.
|
|
28
|
+
import { cp, readdir, readFile, rm, stat } from 'node:fs/promises';
|
|
29
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
30
|
+
import { fileURLToPath } from 'node:url';
|
|
31
|
+
import path from 'node:path';
|
|
32
|
+
import { PUBLIC } from './build.js';
|
|
33
|
+
|
|
34
|
+
export { alternates, build, PUBLIC } from './build.js';
|
|
35
|
+
|
|
36
|
+
const PACKAGE = fileURLToPath(new URL('..', import.meta.url));
|
|
37
|
+
|
|
38
|
+
// What a document or a sheet can `use`, and so what `astro dev` serves from `root`.
|
|
39
|
+
const SOURCES = new Set(['.pen', '.style']);
|
|
40
|
+
const TYPES = {
|
|
41
|
+
'.pen': 'text/plain; charset=utf-8',
|
|
42
|
+
'.style': 'text/plain; charset=utf-8',
|
|
43
|
+
'.pfig': 'application/octet-stream',
|
|
44
|
+
'.png': 'image/png',
|
|
45
|
+
'.webp': 'image/webp',
|
|
46
|
+
'.json': 'application/json',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
function findBin(bin, root) {
|
|
50
|
+
if (bin) return bin;
|
|
51
|
+
if (process.env.PENCIL_BIN) return process.env.PENCIL_BIN;
|
|
52
|
+
// A checkout of Pencil has it under `target/`, wherever in the checkout these are.
|
|
53
|
+
for (const from of [root, PACKAGE]) {
|
|
54
|
+
for (let dir = from; ; dir = path.dirname(dir)) {
|
|
55
|
+
const built = path.join(dir, 'target/release/pencil');
|
|
56
|
+
if (existsSync(built)) return built;
|
|
57
|
+
if (dir === path.dirname(dir)) break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return 'pencil';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Which build of the core the package's WASM is, which a compiled figure has to match. */
|
|
64
|
+
async function wasmBuild() {
|
|
65
|
+
const file = path.join(PACKAGE, 'pkg/pencil_web_bg.wasm');
|
|
66
|
+
if (!existsSync(file)) {
|
|
67
|
+
throw new Error(`@pencil-lang/figure: ${path.dirname(file)} has no WASM. Run scripts/build-web.sh in the Pencil repo.`);
|
|
68
|
+
}
|
|
69
|
+
const wasm = await import('../pkg/pencil_web.js');
|
|
70
|
+
wasm.initSync({ module: readFileSync(file) });
|
|
71
|
+
return wasm.fingerprint();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default function pencil({ root, bin, playground, kept } = {}) {
|
|
75
|
+
let cfg;
|
|
76
|
+
return {
|
|
77
|
+
name: '@pencil-lang/figure',
|
|
78
|
+
hooks: {
|
|
79
|
+
'astro:config:setup': async ({ config, command, updateConfig }) => {
|
|
80
|
+
const figures = path.resolve(fileURLToPath(config.root), root ?? '.');
|
|
81
|
+
cfg = {
|
|
82
|
+
root: figures,
|
|
83
|
+
bin: findBin(bin && path.resolve(fileURLToPath(config.root), bin), figures),
|
|
84
|
+
cache: path.join(fileURLToPath(config.cacheDir), 'pencil'),
|
|
85
|
+
kept: kept ? path.resolve(fileURLToPath(config.root), kept) : null,
|
|
86
|
+
wasm: await wasmBuild(),
|
|
87
|
+
dev: command === 'dev',
|
|
88
|
+
base: config.base,
|
|
89
|
+
playground: playground ?? null,
|
|
90
|
+
};
|
|
91
|
+
process.env.PENCIL_FIGURE = JSON.stringify(cfg);
|
|
92
|
+
updateConfig({
|
|
93
|
+
vite: {
|
|
94
|
+
// The WASM is found beside the script that loads it, which bundling ahead would move.
|
|
95
|
+
optimizeDeps: { exclude: ['@pencil-lang/figure'] },
|
|
96
|
+
server: { fs: { allow: [PACKAGE] } },
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
'astro:server:setup': ({ server }) => {
|
|
102
|
+
const prefix = `${cfg.base.replace(/\/$/, '')}/${PUBLIC}/`;
|
|
103
|
+
const watched = new Set();
|
|
104
|
+
server.watcher.on('change', (file) => {
|
|
105
|
+
if (watched.has(file)) (server.hot ?? server.ws).send({ type: 'custom', event: 'pencil:change', data: {} });
|
|
106
|
+
});
|
|
107
|
+
server.middlewares.use(async (req, res, next) => {
|
|
108
|
+
const url = decodeURIComponent((req.url ?? '').split('?')[0]);
|
|
109
|
+
if (!url.startsWith(prefix)) return next();
|
|
110
|
+
const rel = url.slice(prefix.length);
|
|
111
|
+
// Sources come from where they are, and what a build made from the cache.
|
|
112
|
+
const source = rel.startsWith('src/');
|
|
113
|
+
const top = source ? cfg.root : path.join(cfg.cache, 'out');
|
|
114
|
+
const file = path.resolve(top, source ? rel.slice(4) : rel);
|
|
115
|
+
const type = TYPES[path.extname(file)];
|
|
116
|
+
if (!file.startsWith(top + path.sep) || !type || (source && !SOURCES.has(path.extname(file)))) return next();
|
|
117
|
+
try {
|
|
118
|
+
if (!(await stat(file)).isFile()) return next();
|
|
119
|
+
if (source && !watched.has(file)) {
|
|
120
|
+
watched.add(file);
|
|
121
|
+
server.watcher.add(file);
|
|
122
|
+
}
|
|
123
|
+
res.setHeader('Content-Type', type);
|
|
124
|
+
res.setHeader('Cache-Control', 'no-store');
|
|
125
|
+
res.end(await readFile(file));
|
|
126
|
+
} catch {
|
|
127
|
+
next();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
// What goes out is what this build's pages asked for, and nothing an earlier one left.
|
|
133
|
+
'astro:build:start': async () => {
|
|
134
|
+
await rm(path.join(cfg.cache, 'out'), { recursive: true, force: true });
|
|
135
|
+
await rm(path.join(cfg.cache, 'used'), { recursive: true, force: true });
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
'astro:build:done': async ({ dir, logger }) => {
|
|
139
|
+
const out = path.join(cfg.cache, 'out');
|
|
140
|
+
if (!existsSync(out)) return;
|
|
141
|
+
await cp(out, path.join(fileURLToPath(dir), PUBLIC), { recursive: true });
|
|
142
|
+
logger.info(`wrote the figures to ${PUBLIC}/`);
|
|
143
|
+
// A figure whose params or sheets changed is kept under another name, and the old folder
|
|
144
|
+
// stays. Nothing here removes one: a build that leaves drafts out asks for fewer.
|
|
145
|
+
if (cfg.kept && existsSync(cfg.kept)) {
|
|
146
|
+
const used = new Set(await readdir(path.join(cfg.cache, 'used')).catch(() => []));
|
|
147
|
+
const spare = (await readdir(cfg.kept)).filter((name) => !name.startsWith('.') && !used.has(name));
|
|
148
|
+
if (spare.length) logger.info(`kept but not asked for by this build: ${spare.join(', ')}`);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/fonts/OFL.txt
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Copyright © 2012-2024 The Libertinus Project Authors,
|
|
2
|
+
with Reserved Font Name "Linux Libertine", "Biolinum", "STIX Fonts".
|
|
3
|
+
|
|
4
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
5
|
+
This license is copied below, and is also available with a FAQ at:
|
|
6
|
+
http://scripts.sil.org/OFL
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
11
|
+
-----------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
PREAMBLE
|
|
14
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
15
|
+
development of collaborative font projects, to support the font creation
|
|
16
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
17
|
+
open framework in which fonts may be shared and improved in partnership
|
|
18
|
+
with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
22
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply
|
|
27
|
+
to any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
DEFINITIONS
|
|
30
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
31
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
32
|
+
include source files, build scripts and documentation.
|
|
33
|
+
|
|
34
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
35
|
+
copyright statement(s).
|
|
36
|
+
|
|
37
|
+
"Original Version" refers to the collection of Font Software components as
|
|
38
|
+
distributed by the Copyright Holder(s).
|
|
39
|
+
|
|
40
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
41
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
42
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
43
|
+
new environment.
|
|
44
|
+
|
|
45
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
46
|
+
writer or other person who contributed to the Font Software.
|
|
47
|
+
|
|
48
|
+
PERMISSION & CONDITIONS
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
50
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
51
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
52
|
+
Software, subject to the following conditions:
|
|
53
|
+
|
|
54
|
+
1) Neither the Font Software nor any of its individual components,
|
|
55
|
+
in Original or Modified Versions, may be sold by itself.
|
|
56
|
+
|
|
57
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
58
|
+
redistributed and/or sold with any software, provided that each copy
|
|
59
|
+
contains the above copyright notice and this license. These can be
|
|
60
|
+
included either as stand-alone text files, human-readable headers or
|
|
61
|
+
in the appropriate machine-readable metadata fields within text or
|
|
62
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
63
|
+
|
|
64
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
65
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
66
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
67
|
+
presented to the users.
|
|
68
|
+
|
|
69
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
70
|
+
Software shall not be used to promote, endorse or advertise any
|
|
71
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
72
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
73
|
+
permission.
|
|
74
|
+
|
|
75
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
76
|
+
must be distributed entirely under this license, and must not be
|
|
77
|
+
distributed under any other license. The requirement for fonts to
|
|
78
|
+
remain under this license does not apply to any document created
|
|
79
|
+
using the Font Software.
|
|
80
|
+
|
|
81
|
+
TERMINATION
|
|
82
|
+
This license becomes null and void if any of the above conditions are
|
|
83
|
+
not met.
|
|
84
|
+
|
|
85
|
+
DISCLAIMER
|
|
86
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
87
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
88
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
89
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
90
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
91
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
92
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
93
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
94
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
package/fonts/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# The fonts labels are set in
|
|
2
|
+
|
|
3
|
+
Libertinus 7.051, unmodified, from the [Libertinus Fonts project](https://github.com/alerque/libertinus), under the
|
|
4
|
+
SIL Open Font License 1.1 (`OFL.txt`):
|
|
5
|
+
|
|
6
|
+
| File | What it sets |
|
|
7
|
+
|---|---|
|
|
8
|
+
| `LibertinusSans-Regular.otf` | Labels with `font: sans`, the default. |
|
|
9
|
+
| `LibertinusSerif-Italic.otf` | Labels with `font: math`: names and notes in italics. |
|
|
10
|
+
| `LibertinusMath-Regular.otf` | A label's mathematics, `$…$`, and any character the other two lack, such as `ℝ`, `∇` and `↦`. |
|
|
11
|
+
|
|
12
|
+
They are the only copies. `<pencil-figure>` loads them from here (`src/labels.js`), the `pencil` command has them built
|
|
13
|
+
in (`crates/pencil-cli/src/text.rs`), and the core's build reads the math font's metrics for laying mathematics out
|
|
14
|
+
(`crates/pencil-core/build.rs`). So a poster, a video and the live figure set the same glyphs at the same places.
|
|
15
|
+
|
|
16
|
+
Replacing one means all three change together, and the core's layout follows the new math font's own constants. The
|
|
17
|
+
license asks that a modified font not keep the names it reserves ("Linux Libertine", "Biolinum", "STIX Fonts"), so a
|
|
18
|
+
subset would need another name. These are the files as released.
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pencil-lang/figure",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Pencil figures on a page: the <pencil-figure> element, the WASM host it runs on, and an Astro component that builds a figure and its poster.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/krisselden/pencil-lang.git",
|
|
9
|
+
"directory": "packages/figure"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://pencil-lang.dev",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"pencil",
|
|
14
|
+
"mathematics",
|
|
15
|
+
"figure",
|
|
16
|
+
"custom-element",
|
|
17
|
+
"astro-component",
|
|
18
|
+
"withastro"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": "./src/element.js",
|
|
23
|
+
"./host": "./src/host.js",
|
|
24
|
+
"./pack": "./src/pack.js",
|
|
25
|
+
"./astro": "./astro/index.js",
|
|
26
|
+
"./Figure.astro": "./astro/Figure.astro",
|
|
27
|
+
"./pencil_web_bg.wasm": "./pkg/pencil_web_bg.wasm"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"src",
|
|
31
|
+
"pkg",
|
|
32
|
+
"fonts",
|
|
33
|
+
"astro"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": [
|
|
39
|
+
"./src/element.js",
|
|
40
|
+
"./astro/client.js"
|
|
41
|
+
],
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"astro": ">=5"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"astro": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@playwright/test": "^1.56.0",
|
|
52
|
+
"esbuild": "^0.28.2"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"test": "playwright test"
|
|
56
|
+
}
|
|
6
57
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var I=class a{static __wrap(e){let t=Object.create(a.prototype);return t.__wbg_ptr=e,ye.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ye.unregister(this),e}free(){let e=this.__destroy_into_raw();s.__wbg_player_free(e,0)}get backend(){let e,t;try{let n=s.player_backend(this.__wbg_ptr);return e=n[0],t=n[1],d(n[0],n[1])}finally{s.__wbindgen_free(e,t,1)}}static create(e,t){return s.player_create(e,t)}destroy(){let e=this.__destroy_into_raw();s.player_destroy(e)}drag(e,t,n){let r=s.player_drag(this.__wbg_ptr,e,t,n);if(r[3])throw v(r[2]);let _;return r[0]!==0&&(_=d(r[0],r[1]),s.__wbindgen_free(r[0],r[1]*1,1)),_}draw(e,t){let n,r;try{let o=s.player_draw(this.__wbg_ptr,e,t);var _=o[0],i=o[1];if(o[3])throw _=0,i=0,v(o[2]);return n=_,r=i,d(_,i)}finally{s.__wbindgen_free(n,r,1)}}grab(e,t,n,r){let _=s.player_grab(this.__wbg_ptr,e,t,n,r);if(_[2])throw v(_[1]);return _[0]!==0}grabbed(){return s.player_grabbed(this.__wbg_ptr)}handle_places(e){let t=s.player_handle_places(this.__wbg_ptr,e);if(t[3])throw v(t[2]);var n=ve(t[0],t[1]).slice();return s.__wbindgen_free(t[0],t[1]*8,8),n}info(){let e,t;try{let n=s.player_info(this.__wbg_ptr);return e=n[0],t=n[1],d(n[0],n[1])}finally{s.__wbindgen_free(e,t,1)}}load(e,t,n,r){let _,i,o,c,f,u;try{_=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),i=h,o=E(t,s.__wbindgen_malloc),c=h,f=E(n,s.__wbindgen_malloc),u=h}catch(w){throw f&&(s.__externref_drop_slice(f,u),s.__wbindgen_free(f,u*4,4)),o&&(s.__externref_drop_slice(o,c),s.__wbindgen_free(o,c*4,4)),_&&s.__wbindgen_free(_,i*1,1),w}let l=s.player_load(this.__wbg_ptr,_,i,o,c,f,u,r);if(l[1])throw v(l[0])}load_compiled(e){let t=Ae(e,s.__wbindgen_malloc),n=h,r=s.player_load_compiled(this.__wbg_ptr,t,n);if(r[1])throw v(r[0])}nudge(e,t,n,r){let _=s.player_nudge(this.__wbg_ptr,e,t,n,r);if(_[3])throw v(_[2]);let i;return _[0]!==0&&(i=d(_[0],_[1]),s.__wbindgen_free(_[0],_[1]*1,1)),i}prepare_only(e,t){let n=s.player_prepare_only(this.__wbg_ptr,e,t);if(n[2])throw v(n[1]);return n[0]>>>0}range(e,t){let n=+t,r=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h,i=s.player_range(this.__wbg_ptr,r,_,n);if(i[3])throw v(i[2]);var o=ve(i[0],i[1]).slice();return s.__wbindgen_free(i[0],i[1]*8,8),o}release(){s.player_release(this.__wbg_ptr)}release_param(e){let t=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),n=h;s.player_release_param(this.__wbg_ptr,t,n)}resize(e,t){s.player_resize(this.__wbg_ptr,e,t)}set_em(e){s.player_set_em(this.__wbg_ptr,e)}set_measure(e){s.player_set_measure(this.__wbg_ptr,e)}set_param(e,t){let n=+t,r=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h;s.player_set_param(this.__wbg_ptr,r,_,n)}time_for(e,t){let n=+t,r=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h,i=s.player_time_for(this.__wbg_ptr,r,_,n);if(i[2])throw v(i[1]);return i[0]}value(e,t){let n=+t,r=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h,i=s.player_value(this.__wbg_ptr,r,_,n);if(i[2])throw v(i[1]);return i[0]}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);function ae(a,e,t,n){let r,_;try{let c,f,u,l,w,A;try{c=y(a,s.__wbindgen_malloc,s.__wbindgen_realloc),f=h,u=E(e,s.__wbindgen_malloc),l=h,w=E(t,s.__wbindgen_malloc),A=h}catch(U){throw w&&(s.__externref_drop_slice(w,A),s.__wbindgen_free(w,A*4,4)),u&&(s.__externref_drop_slice(u,l),s.__wbindgen_free(u,l*4,4)),c&&s.__wbindgen_free(c,f*1,1),U}let D=s.figure_size(c,f,u,l,w,A,n);var i=D[0],o=D[1];if(D[3])throw i=0,o=0,v(D[2]);return r=i,_=o,d(i,o)}finally{s.__wbindgen_free(r,_,1)}}function oe(a){let e,t;try{let _=Ae(a,s.__wbindgen_malloc),i=h,o=s.figure_size_compiled(_,i);var n=o[0],r=o[1];if(o[3])throw n=0,r=0,v(o[2]);return e=n,t=r,d(n,r)}finally{s.__wbindgen_free(e,t,1)}}function Le(){let a,e;try{let t=s.fingerprint();return a=t[0],e=t[1],d(t[0],t[1])}finally{s.__wbindgen_free(a,e,1)}}function Fe(a,e){let t,n;try{let i,o,c,f;try{i=y(a,s.__wbindgen_malloc,s.__wbindgen_realloc),o=h,c=E(e,s.__wbindgen_malloc),f=h}catch(l){throw c&&(s.__externref_drop_slice(c,f),s.__wbindgen_free(c,f*4,4)),i&&s.__wbindgen_free(i,o*1,1),l}let u=s.from_latex(i,o,c,f);var r=u[0],_=u[1];if(u[3])throw r=0,_=0,v(u[2]);return t=r,n=_,d(r,_)}finally{s.__wbindgen_free(t,n,1)}}function Be(){let a,e;try{let t=s.functions();return a=t[0],e=t[1],d(t[0],t[1])}finally{s.__wbindgen_free(a,e,1)}}function Ce(a){let e,t;try{let n=y(a,s.__wbindgen_malloc,s.__wbindgen_realloc),r=h,_=s.inspect(n,r);return e=_[0],t=_[1],d(_[0],_[1])}finally{s.__wbindgen_free(e,t,1)}}function Re(a){let e=y(a,s.__wbindgen_malloc,s.__wbindgen_realloc),t=h;return s.is_latex(e,t)!==0}function Oe(a,e,t){let n,r;try{let o,c,f,u;try{o=E(a,s.__wbindgen_malloc),c=h,f=E(e,s.__wbindgen_malloc),u=h}catch(w){throw f&&(s.__externref_drop_slice(f,u),s.__wbindgen_free(f,u*4,4)),o&&(s.__externref_drop_slice(o,c),s.__wbindgen_free(o,c*4,4)),w}let l=s.named_colors(o,c,f,u,t);var _=l[0],i=l[1];if(l[3])throw _=0,i=0,v(l[2]);return n=_,r=i,d(_,i)}finally{s.__wbindgen_free(n,r,1)}}function We(){let a,e;try{let t=s.symbols();return a=t[0],e=t[1],d(t[0],t[1])}finally{s.__wbindgen_free(a,e,1)}}function se(a,e){let t,n,r,_;try{t=y(a,s.__wbindgen_malloc,s.__wbindgen_realloc),n=h,r=y(e,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h}catch(c){throw r&&s.__wbindgen_free(r,_*1,1),t&&s.__wbindgen_free(t,n*1,1),c}let i=s.uses(t,n,r,_);var o=ct(i[0],i[1]);return s.__wbindgen_free(i[0],i[1]*4,4),o}function ze(){return{__proto__:null,"./pencil_web_bg.js":{__proto__:null,__wbg_Error_208446807d0d1e30:function(e,t){return Error(d(e,t))},__wbg_Window_2805651c516cb7aa:function(e){return e.Window},__wbg_WorkerGlobalScope_174390815d0a4893:function(e){return e.WorkerGlobalScope},__wbg___wbindgen_boolean_get_4f1baf9a00be3c74:function(e){let t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(e,t){let n=Se(t),r=y(n,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h;p().setInt32((e>>>0)+4,_,!0),p().setInt32((e>>>0)+0,r,!0)},__wbg___wbindgen_is_function_741ff2bb612836f5:function(e){return typeof e=="function"},__wbg___wbindgen_is_null_c22311b1cc228e3a:function(e){return e===null},__wbg___wbindgen_is_string_fc456fee5d3317de:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_be5b34249ff1fc15:function(e){return e===void 0},__wbg___wbindgen_number_get_934b640d0889af78:function(e,t){let n=t,r=typeof n=="number"?n:void 0;p().setFloat64((e>>>0)+8,g(r)?0:r,!0),p().setInt32((e>>>0)+0,!g(r),!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(e,t){let n=t,r=typeof n=="string"?n:void 0;var _=g(r)?0:y(r,s.__wbindgen_malloc,s.__wbindgen_realloc),i=h;p().setInt32((e>>>0)+4,i,!0),p().setInt32((e>>>0)+0,_,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(e,t){throw new Error(d(e,t))},__wbg__wbg_cb_unref_09736879a3f67559:function(e){e._wbg_cb_unref()},__wbg_activeTexture_45b425a49df733ce:function(e,t){e.activeTexture(t>>>0)},__wbg_activeTexture_89cef8c297ad0698:function(e,t){e.activeTexture(t>>>0)},__wbg_attachShader_3ed301cc92db59f6:function(e,t,n){e.attachShader(t,n)},__wbg_attachShader_817dcec9e79fd18f:function(e,t,n){e.attachShader(t,n)},__wbg_beginQuery_f800947e639433e8:function(e,t,n){e.beginQuery(t>>>0,n)},__wbg_beginRenderPass_597e3973321fd369:function(){return b(function(e,t){return e.beginRenderPass(t)},arguments)},__wbg_bindAttribLocation_40c41e6185822b52:function(e,t,n,r,_){e.bindAttribLocation(t,n>>>0,d(r,_))},__wbg_bindAttribLocation_b51bf2d65ded8f70:function(e,t,n,r,_){e.bindAttribLocation(t,n>>>0,d(r,_))},__wbg_bindBufferRange_da5accbcd5d223ad:function(e,t,n,r,_,i){e.bindBufferRange(t>>>0,n>>>0,r,_,i)},__wbg_bindBuffer_b3bb001fdbee089a:function(e,t,n){e.bindBuffer(t>>>0,n)},__wbg_bindBuffer_cbc9075f76fffa51:function(e,t,n){e.bindBuffer(t>>>0,n)},__wbg_bindFramebuffer_79534f24b57b7b95:function(e,t,n){e.bindFramebuffer(t>>>0,n)},__wbg_bindFramebuffer_b245cd93a150dd96:function(e,t,n){e.bindFramebuffer(t>>>0,n)},__wbg_bindRenderbuffer_3458a69a6dc55057:function(e,t,n){e.bindRenderbuffer(t>>>0,n)},__wbg_bindRenderbuffer_612f27d9b3b97b9f:function(e,t,n){e.bindRenderbuffer(t>>>0,n)},__wbg_bindSampler_0fb033a6ffd5d7b3:function(e,t,n){e.bindSampler(t>>>0,n)},__wbg_bindTexture_6f822943b2790466:function(e,t,n){e.bindTexture(t>>>0,n)},__wbg_bindTexture_a23350e1b573ddfd:function(e,t,n){e.bindTexture(t>>>0,n)},__wbg_bindVertexArrayOES_5161c1f5b1fea3f9:function(e,t){e.bindVertexArrayOES(t)},__wbg_bindVertexArray_cc64c48bf67ab8d4:function(e,t){e.bindVertexArray(t)},__wbg_blendColor_8631cab46394c93b:function(e,t,n,r,_){e.blendColor(t,n,r,_)},__wbg_blendColor_957c8ddad53063a2:function(e,t,n,r,_){e.blendColor(t,n,r,_)},__wbg_blendEquationSeparate_0dceb23863585a87:function(e,t,n){e.blendEquationSeparate(t>>>0,n>>>0)},__wbg_blendEquationSeparate_156fe040a9aebfd6:function(e,t,n){e.blendEquationSeparate(t>>>0,n>>>0)},__wbg_blendEquation_847eb360af3b2786:function(e,t){e.blendEquation(t>>>0)},__wbg_blendEquation_cd72c0ac181cd88d:function(e,t){e.blendEquation(t>>>0)},__wbg_blendFuncSeparate_6db2212299fd7f1e:function(e,t,n,r,_){e.blendFuncSeparate(t>>>0,n>>>0,r>>>0,_>>>0)},__wbg_blendFuncSeparate_eb9098d760f4a25c:function(e,t,n,r,_){e.blendFuncSeparate(t>>>0,n>>>0,r>>>0,_>>>0)},__wbg_blendFunc_378a3be8ab6cb7d0:function(e,t,n){e.blendFunc(t>>>0,n>>>0)},__wbg_blendFunc_68b4cfb9bd98a13f:function(e,t,n){e.blendFunc(t>>>0,n>>>0)},__wbg_blitFramebuffer_d17b7bddf5e86dbc:function(e,t,n,r,_,i,o,c,f,u,l){e.blitFramebuffer(t,n,r,_,i,o,c,f,u>>>0,l>>>0)},__wbg_bufferData_2fb8740d60478bf0:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_41b591a9f2d502ad:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_9305dba3ba9cba4e:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_9eb9c4c5053ac480:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferSubData_8acfdcd4b9f7edeb:function(e,t,n,r){e.bufferSubData(t>>>0,n,r)},__wbg_bufferSubData_9bec93d67e98757e:function(e,t,n,r){e.bufferSubData(t>>>0,n,r)},__wbg_call_275b78b3b6520b92:function(){return b(function(e,t,n,r,_){return e.call(t,n,r,_)},arguments)},__wbg_call_a410eb4b59ed5965:function(){return b(function(e,t,n){return e.call(t,n)},arguments)},__wbg_clearBufferfv_474b28c18db287a8:function(e,t,n,r,_){e.clearBufferfv(t>>>0,n,x(r,_))},__wbg_clearBufferiv_a89cfdf7da6f2819:function(e,t,n,r,_){e.clearBufferiv(t>>>0,n,P(r,_))},__wbg_clearBufferuiv_e723936f302725de:function(e,t,n,r,_){e.clearBufferuiv(t>>>0,n,T(r,_))},__wbg_clearDepth_3417be30229e823a:function(e,t){e.clearDepth(t)},__wbg_clearDepth_3dc1f52f96f29526:function(e,t){e.clearDepth(t)},__wbg_clearStencil_29f687031586f5e6:function(e,t){e.clearStencil(t)},__wbg_clearStencil_59a8a925116b24ec:function(e,t){e.clearStencil(t)},__wbg_clear_3ffa1ed794f92a04:function(e,t){e.clear(t>>>0)},__wbg_clear_ccb3d618da90fea3:function(e,t){e.clear(t>>>0)},__wbg_clientWaitSync_fee803cb72073198:function(e,t,n,r){return e.clientWaitSync(t,n>>>0,r>>>0)},__wbg_colorMask_24c1b6c3ec53f8c8:function(e,t,n,r,_){e.colorMask(t!==0,n!==0,r!==0,_!==0)},__wbg_colorMask_cfc2d619716d01ed:function(e,t,n,r,_){e.colorMask(t!==0,n!==0,r!==0,_!==0)},__wbg_compileShader_11eb6754e9b15970:function(e,t){e.compileShader(t)},__wbg_compileShader_54c3771819e6caba:function(e,t){e.compileShader(t)},__wbg_compressedTexSubImage2D_8706ea3fb9e0180c:function(e,t,n,r,_,i,o,c,f){e.compressedTexSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f)},__wbg_compressedTexSubImage2D_b6a8807f715c2782:function(e,t,n,r,_,i,o,c,f,u){e.compressedTexSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f,u)},__wbg_compressedTexSubImage2D_d66b16b23793038b:function(e,t,n,r,_,i,o,c,f){e.compressedTexSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f)},__wbg_compressedTexSubImage3D_74b7bfbc9a7fc90f:function(e,t,n,r,_,i,o,c,f,u,l,w){e.compressedTexSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l,w)},__wbg_compressedTexSubImage3D_e1d361485803b713:function(e,t,n,r,_,i,o,c,f,u,l){e.compressedTexSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l)},__wbg_configure_8e04ab1a867d31e1:function(){return b(function(e,t){e.configure(t)},arguments)},__wbg_copyBufferSubData_b10635982222cbc4:function(e,t,n,r,_,i){e.copyBufferSubData(t>>>0,n>>>0,r,_,i)},__wbg_copyTexSubImage2D_0cc80bc35bca1d8e:function(e,t,n,r,_,i,o,c,f){e.copyTexSubImage2D(t>>>0,n,r,_,i,o,c,f)},__wbg_copyTexSubImage2D_be50078e0f0575f1:function(e,t,n,r,_,i,o,c,f){e.copyTexSubImage2D(t>>>0,n,r,_,i,o,c,f)},__wbg_copyTexSubImage3D_e35f615c7c8244ba:function(e,t,n,r,_,i,o,c,f,u){e.copyTexSubImage3D(t>>>0,n,r,_,i,o,c,f,u)},__wbg_createBindGroupLayout_5699617270d84042:function(){return b(function(e,t){return e.createBindGroupLayout(t)},arguments)},__wbg_createBindGroup_f539b26ca341308f:function(e,t){return e.createBindGroup(t)},__wbg_createBuffer_2c27ad5f899d418d:function(e){let t=e.createBuffer();return g(t)?0:m(t)},__wbg_createBuffer_b8c5b520d2c822b8:function(){return b(function(e,t){return e.createBuffer(t)},arguments)},__wbg_createBuffer_ca6ca40e9fb13678:function(e){let t=e.createBuffer();return g(t)?0:m(t)},__wbg_createCommandEncoder_3352d1ffc36c6fc0:function(e,t){return e.createCommandEncoder(t)},__wbg_createFramebuffer_cdf686778c61014d:function(e){let t=e.createFramebuffer();return g(t)?0:m(t)},__wbg_createFramebuffer_f52399034cb1a200:function(e){let t=e.createFramebuffer();return g(t)?0:m(t)},__wbg_createPipelineLayout_6eab52c327118937:function(e,t){return e.createPipelineLayout(t)},__wbg_createProgram_de0881c688a8e43b:function(e){let t=e.createProgram();return g(t)?0:m(t)},__wbg_createProgram_ea784724f6f0074f:function(e){let t=e.createProgram();return g(t)?0:m(t)},__wbg_createQuery_8f0481bdf42276b8:function(e){let t=e.createQuery();return g(t)?0:m(t)},__wbg_createRenderPipeline_58390ba302107691:function(){return b(function(e,t){return e.createRenderPipeline(t)},arguments)},__wbg_createRenderbuffer_19c2eec619a37a15:function(e){let t=e.createRenderbuffer();return g(t)?0:m(t)},__wbg_createRenderbuffer_e45c14c918a72668:function(e){let t=e.createRenderbuffer();return g(t)?0:m(t)},__wbg_createSampler_5bc030b64ed02c52:function(e){let t=e.createSampler();return g(t)?0:m(t)},__wbg_createShaderModule_cefa51336cb288ae:function(e,t){return e.createShaderModule(t)},__wbg_createShader_9754a1e4ef374e84:function(e,t){let n=e.createShader(t>>>0);return g(n)?0:m(n)},__wbg_createShader_d2d90020273cef2b:function(e,t){let n=e.createShader(t>>>0);return g(n)?0:m(n)},__wbg_createTexture_2c95e64f50008aea:function(){return b(function(e,t){return e.createTexture(t)},arguments)},__wbg_createTexture_3287f26407473071:function(e){let t=e.createTexture();return g(t)?0:m(t)},__wbg_createTexture_eec9a1994aabeca7:function(e){let t=e.createTexture();return g(t)?0:m(t)},__wbg_createVertexArrayOES_3eaf087ef22da1cb:function(e){let t=e.createVertexArrayOES();return g(t)?0:m(t)},__wbg_createVertexArray_1293d2ffa8346be2:function(e){let t=e.createVertexArray();return g(t)?0:m(t)},__wbg_createView_96e5e405cc3c01e8:function(){return b(function(e,t){return e.createView(t)},arguments)},__wbg_cullFace_208151a46885a1fa:function(e,t){e.cullFace(t>>>0)},__wbg_cullFace_9eaca57652d7ed37:function(e,t){e.cullFace(t>>>0)},__wbg_deleteBuffer_673584ba5a55669d:function(e,t){e.deleteBuffer(t)},__wbg_deleteBuffer_ffa760fd3b0b5ef1:function(e,t){e.deleteBuffer(t)},__wbg_deleteFramebuffer_0ec884f89db72a3e:function(e,t){e.deleteFramebuffer(t)},__wbg_deleteFramebuffer_ffdb1bee4c92ae4c:function(e,t){e.deleteFramebuffer(t)},__wbg_deleteProgram_8c38fff0f4a88dea:function(e,t){e.deleteProgram(t)},__wbg_deleteProgram_c07d952a1b0c1cb6:function(e,t){e.deleteProgram(t)},__wbg_deleteQuery_dfd665f6d8652e22:function(e,t){e.deleteQuery(t)},__wbg_deleteRenderbuffer_3a6e1676ab926e0f:function(e,t){e.deleteRenderbuffer(t)},__wbg_deleteRenderbuffer_895ff607251243a9:function(e,t){e.deleteRenderbuffer(t)},__wbg_deleteSampler_2b73428131e403e1:function(e,t){e.deleteSampler(t)},__wbg_deleteShader_320530dd636bc187:function(e,t){e.deleteShader(t)},__wbg_deleteShader_ac74568b64a1c3c7:function(e,t){e.deleteShader(t)},__wbg_deleteSync_eede535e5826f144:function(e,t){e.deleteSync(t)},__wbg_deleteTexture_1653a9994a44215e:function(e,t){e.deleteTexture(t)},__wbg_deleteTexture_89bd1d49ae4fb309:function(e,t){e.deleteTexture(t)},__wbg_deleteVertexArrayOES_2214ecdf65be031d:function(e,t){e.deleteVertexArrayOES(t)},__wbg_deleteVertexArray_2589b74b67ba20c8:function(e,t){e.deleteVertexArray(t)},__wbg_depthFunc_04abd9f6ff980ba9:function(e,t){e.depthFunc(t>>>0)},__wbg_depthFunc_584bfa0174e7628a:function(e,t){e.depthFunc(t>>>0)},__wbg_depthMask_276856a569045897:function(e,t){e.depthMask(t!==0)},__wbg_depthMask_2ba7e83178c3cec3:function(e,t){e.depthMask(t!==0)},__wbg_depthRange_8b4b69a7c91ff92b:function(e,t,n){e.depthRange(t,n)},__wbg_depthRange_942825e3232596de:function(e,t,n){e.depthRange(t,n)},__wbg_description_7a568e202a00293f:function(e,t){let n=t.description,r=y(n,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h;p().setInt32((e>>>0)+4,_,!0),p().setInt32((e>>>0)+0,r,!0)},__wbg_destroy_275564a0a8b8d071:function(e){e.destroy()},__wbg_destroy_637537007d9eaa44:function(e){e.destroy()},__wbg_disableVertexAttribArray_011898581287ef1e:function(e,t){e.disableVertexAttribArray(t>>>0)},__wbg_disableVertexAttribArray_5c66375eba552ee7:function(e,t){e.disableVertexAttribArray(t>>>0)},__wbg_disable_2ead6c11cefd0322:function(e,t){e.disable(t>>>0)},__wbg_disable_8a9e81e6d64d046b:function(e,t){e.disable(t>>>0)},__wbg_document_3b5c3071b43e97ee:function(e){let t=e.document;return g(t)?0:m(t)},__wbg_drawArraysInstancedANGLE_635e10224985b842:function(e,t,n,r,_){e.drawArraysInstancedANGLE(t>>>0,n,r,_)},__wbg_drawArraysInstanced_762b36f2147c7a85:function(e,t,n,r,_){e.drawArraysInstanced(t>>>0,n,r,_)},__wbg_drawArrays_a9c18db2e94f4a82:function(e,t,n,r){e.drawArrays(t>>>0,n,r)},__wbg_drawArrays_fe5a51410bfabb5b:function(e,t,n,r){e.drawArrays(t>>>0,n,r)},__wbg_drawBuffersWEBGL_49c672d0ddcdfe71:function(e,t){e.drawBuffersWEBGL(t)},__wbg_drawBuffers_e296659ce384e721:function(e,t){e.drawBuffers(t)},__wbg_drawElementsInstancedANGLE_470ce8b489eeafa5:function(e,t,n,r,_,i){e.drawElementsInstancedANGLE(t>>>0,n,r>>>0,_,i)},__wbg_drawElementsInstanced_3240c0c168d6af87:function(e,t,n,r,_,i){e.drawElementsInstanced(t>>>0,n,r>>>0,_,i)},__wbg_draw_086a9578fc9898c2:function(e,t,n,r,_){e.draw(t>>>0,n>>>0,r>>>0,_>>>0)},__wbg_enableVertexAttribArray_d485706ade6bebf8:function(e,t){e.enableVertexAttribArray(t>>>0)},__wbg_enableVertexAttribArray_eeecc6185af24227:function(e,t){e.enableVertexAttribArray(t>>>0)},__wbg_enable_c3c00565c89d3175:function(e,t){e.enable(t>>>0)},__wbg_enable_e955d456ef6b93f7:function(e,t){e.enable(t>>>0)},__wbg_endQuery_f052a8f0f3589d3b:function(e,t){e.endQuery(t>>>0)},__wbg_end_b57473834b877409:function(e){e.end()},__wbg_error_757e9472f8410341:function(e,t){let n,r;try{n=e,r=t,console.error(d(e,t))}finally{s.__wbindgen_free(n,r,1)}},__wbg_fenceSync_53f6f24f4bb43d24:function(e,t,n){let r=e.fenceSync(t>>>0,n>>>0);return g(r)?0:m(r)},__wbg_finish_09ec094c10f41e7b:function(e){return e.finish()},__wbg_finish_783de9bff3b56540:function(e){e.finish()},__wbg_finish_abf9726b03095270:function(e){e.finish()},__wbg_finish_ec1c191f66a895b1:function(e,t){return e.finish(t)},__wbg_flush_4911c503a18d091d:function(e){e.flush()},__wbg_flush_a9981e0bd1a44897:function(e){e.flush()},__wbg_framebufferRenderbuffer_1c89563506a7d0ac:function(e,t,n,r,_){e.framebufferRenderbuffer(t>>>0,n>>>0,r>>>0,_)},__wbg_framebufferRenderbuffer_ffaba93222aea77c:function(e,t,n,r,_){e.framebufferRenderbuffer(t>>>0,n>>>0,r>>>0,_)},__wbg_framebufferTexture2D_2c69ac0ce67faf7d:function(e,t,n,r,_,i){e.framebufferTexture2D(t>>>0,n>>>0,r>>>0,_,i)},__wbg_framebufferTexture2D_b6250a0c37eb48c2:function(e,t,n,r,_,i){e.framebufferTexture2D(t>>>0,n>>>0,r>>>0,_,i)},__wbg_framebufferTextureLayer_2f6e24e2dbf9b214:function(e,t,n,r,_,i){e.framebufferTextureLayer(t>>>0,n>>>0,r,_,i)},__wbg_framebufferTextureMultiviewOVR_63308e847d8b8f6c:function(e,t,n,r,_,i,o){e.framebufferTextureMultiviewOVR(t>>>0,n>>>0,r,_,i,o)},__wbg_frontFace_124bb11a73cc0dd1:function(e,t){e.frontFace(t>>>0)},__wbg_frontFace_8bbd77ca3b8f90a6:function(e,t){e.frontFace(t>>>0)},__wbg_getBufferSubData_4a9f8244f0e59e63:function(e,t,n,r){e.getBufferSubData(t>>>0,n,r)},__wbg_getContext_1938edb9a972f63d:function(){return b(function(e,t,n){let r=e.getContext(d(t,n));return g(r)?0:m(r)},arguments)},__wbg_getContext_9d32151c28a36ed6:function(){return b(function(e,t,n,r){let _=e.getContext(d(t,n),r);return g(_)?0:m(_)},arguments)},__wbg_getContext_d93f904b714852ae:function(){return b(function(e,t,n){let r=e.getContext(d(t,n));return g(r)?0:m(r)},arguments)},__wbg_getContext_f2ea37484e3f8ff4:function(){return b(function(e,t,n,r){let _=e.getContext(d(t,n),r);return g(_)?0:m(_)},arguments)},__wbg_getCurrentTexture_c3b1727224d7f6e6:function(){return b(function(e){return e.getCurrentTexture()},arguments)},__wbg_getExtension_30c10f49f67eb05d:function(){return b(function(e,t,n){let r=e.getExtension(d(t,n));return g(r)?0:m(r)},arguments)},__wbg_getIndexedParameter_5d1c39ef8e171053:function(){return b(function(e,t,n){return e.getIndexedParameter(t>>>0,n>>>0)},arguments)},__wbg_getMappedRange_28e816a763520e01:function(){return b(function(e,t,n){return e.getMappedRange(t,n)},arguments)},__wbg_getParameter_4c67158a3cef7a34:function(){return b(function(e,t){return e.getParameter(t>>>0)},arguments)},__wbg_getParameter_7fbe79a0114e119f:function(){return b(function(e,t){return e.getParameter(t>>>0)},arguments)},__wbg_getPreferredCanvasFormat_0ef5034c8902201b:function(e){let t=e.getPreferredCanvasFormat();return(k.indexOf(t)+1||102)-1},__wbg_getProgramInfoLog_01799fd7b07b7f3c:function(e,t,n){let r=t.getProgramInfoLog(n);var _=g(r)?0:y(r,s.__wbindgen_malloc,s.__wbindgen_realloc),i=h;p().setInt32((e>>>0)+4,i,!0),p().setInt32((e>>>0)+0,_,!0)},__wbg_getProgramInfoLog_92d61551e1ab39ea:function(e,t,n){let r=t.getProgramInfoLog(n);var _=g(r)?0:y(r,s.__wbindgen_malloc,s.__wbindgen_realloc),i=h;p().setInt32((e>>>0)+4,i,!0),p().setInt32((e>>>0)+0,_,!0)},__wbg_getProgramParameter_1e7562e7d66170c3:function(e,t,n){return e.getProgramParameter(t,n>>>0)},__wbg_getProgramParameter_3edd526f9e5f6c10:function(e,t,n){return e.getProgramParameter(t,n>>>0)},__wbg_getQueryParameter_0beb5dc153d8ca4f:function(e,t,n){return e.getQueryParameter(t,n>>>0)},__wbg_getShaderInfoLog_3cfe5b3e097d0f2d:function(e,t,n){let r=t.getShaderInfoLog(n);var _=g(r)?0:y(r,s.__wbindgen_malloc,s.__wbindgen_realloc),i=h;p().setInt32((e>>>0)+4,i,!0),p().setInt32((e>>>0)+0,_,!0)},__wbg_getShaderInfoLog_8758e8aea7960121:function(e,t,n){let r=t.getShaderInfoLog(n);var _=g(r)?0:y(r,s.__wbindgen_malloc,s.__wbindgen_realloc),i=h;p().setInt32((e>>>0)+4,i,!0),p().setInt32((e>>>0)+0,_,!0)},__wbg_getShaderParameter_a346f74d5ba41c4b:function(e,t,n){return e.getShaderParameter(t,n>>>0)},__wbg_getShaderParameter_fc64069fbc010d19:function(e,t,n){return e.getShaderParameter(t,n>>>0)},__wbg_getSupportedExtensions_f48b337512e8f8ce:function(e){let t=e.getSupportedExtensions();return g(t)?0:m(t)},__wbg_getSupportedProfiles_b5cc35261935c0c9:function(e){let t=e.getSupportedProfiles();return g(t)?0:m(t)},__wbg_getSyncParameter_8b7b36e9efd95806:function(e,t,n){return e.getSyncParameter(t,n>>>0)},__wbg_getUniformBlockIndex_0742ae35f926850a:function(e,t,n,r){return e.getUniformBlockIndex(t,d(n,r))},__wbg_getUniformLocation_6352e0669c8f5393:function(e,t,n,r){let _=e.getUniformLocation(t,d(n,r));return g(_)?0:m(_)},__wbg_getUniformLocation_e0d11c86376cdd26:function(e,t,n,r){let _=e.getUniformLocation(t,d(n,r));return g(_)?0:m(_)},__wbg_get_0c55869fe53c7d14:function(e,t){let n=e[t>>>0];return g(n)?0:m(n)},__wbg_get_2080c49015e35254:function(){return b(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_e6325ad374eff861:function(e,t){return e[t>>>0]},__wbg_gpu_514705c6dd1f0dab:function(e){return e.gpu},__wbg_height_ac6f1c3f49c13fe2:function(e){return e.height},__wbg_includes_40dae55ee37516e5:function(e,t,n){return e.includes(t,n)},__wbg_info_8554cb7af37427b6:function(e){return e.info},__wbg_instanceof_HtmlCanvasElement_89f280683e987b9e:function(e){let t;try{t=e instanceof HTMLCanvasElement}catch{t=!1}return t},__wbg_instanceof_WebGl2RenderingContext_de6feb460369d6c6:function(e){let t;try{t=e instanceof WebGL2RenderingContext}catch{t=!1}return t},__wbg_instanceof_Window_5cf453f5639aa1a2:function(e){let t;try{t=e instanceof Window}catch{t=!1}return t},__wbg_invalidateFramebuffer_33206c632642a1bd:function(){return b(function(e,t,n){e.invalidateFramebuffer(t>>>0,n)},arguments)},__wbg_isFallbackAdapter_6a4fa7356d18310b:function(e){return e.isFallbackAdapter},__wbg_is_2248ff2b575d60c7:function(e,t){return Object.is(e,t)},__wbg_label_fceb40a43a358e62:function(e,t){let n=t.label,r=y(n,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h;p().setInt32((e>>>0)+4,_,!0),p().setInt32((e>>>0)+0,r,!0)},__wbg_length_186163212ffe79c3:function(e){return e.length},__wbg_length_b03a0fabb109b1e9:function(e){return e.length},__wbg_limits_4e444eb8c2e61c45:function(e){return e.limits},__wbg_limits_98515cc885d709ef:function(e){return e.limits},__wbg_linkProgram_99848b73f1ebab5f:function(e,t){e.linkProgram(t)},__wbg_linkProgram_dee7cda98bacb12f:function(e,t){e.linkProgram(t)},__wbg_mapAsync_b0597127f5037286:function(e,t,n,r){return e.mapAsync(t>>>0,n,r)},__wbg_matchMedia_b53687d22ec43649:function(){return b(function(e,t,n){let r=e.matchMedia(d(t,n));return g(r)?0:m(r)},arguments)},__wbg_matches_a47c420646498c64:function(e){return e.matches},__wbg_maxBindGroupsPlusVertexBuffers_1face4afb5363937:function(e){return e.maxBindGroupsPlusVertexBuffers},__wbg_maxBindGroups_a0b7e55762f095b9:function(e){return e.maxBindGroups},__wbg_maxBindingsPerBindGroup_ec9067be38d6ec72:function(e){return e.maxBindingsPerBindGroup},__wbg_maxBufferSize_a9ce15e541c64cd2:function(e){return e.maxBufferSize},__wbg_maxColorAttachmentBytesPerSample_44089e129e1a2a1d:function(e){return e.maxColorAttachmentBytesPerSample},__wbg_maxColorAttachments_6bd8156394ba618c:function(e){return e.maxColorAttachments},__wbg_maxComputeInvocationsPerWorkgroup_7b086f15ef868934:function(e){return e.maxComputeInvocationsPerWorkgroup},__wbg_maxComputeWorkgroupSizeX_8bbe505e0ac8dc18:function(e){return e.maxComputeWorkgroupSizeX},__wbg_maxComputeWorkgroupSizeY_7228ed3935eecc31:function(e){return e.maxComputeWorkgroupSizeY},__wbg_maxComputeWorkgroupSizeZ_6092b56a967f6f8d:function(e){return e.maxComputeWorkgroupSizeZ},__wbg_maxComputeWorkgroupStorageSize_4773e3bd3936df36:function(e){return e.maxComputeWorkgroupStorageSize},__wbg_maxComputeWorkgroupsPerDimension_79222bf8e8a90fbd:function(e){return e.maxComputeWorkgroupsPerDimension},__wbg_maxDynamicStorageBuffersPerPipelineLayout_3ab5762b1b2c7fc2:function(e){return e.maxDynamicStorageBuffersPerPipelineLayout},__wbg_maxDynamicUniformBuffersPerPipelineLayout_722da31d0de1c256:function(e){return e.maxDynamicUniformBuffersPerPipelineLayout},__wbg_maxInterStageShaderVariables_821096d4b3020715:function(e){return e.maxInterStageShaderVariables},__wbg_maxSampledTexturesPerShaderStage_c6aea9e05c0a02ca:function(e){return e.maxSampledTexturesPerShaderStage},__wbg_maxSamplersPerShaderStage_3aa30f6c002d3a99:function(e){return e.maxSamplersPerShaderStage},__wbg_maxStorageBufferBindingSize_84a2c2433627fca2:function(e){return e.maxStorageBufferBindingSize},__wbg_maxStorageBuffersPerShaderStage_25b96748df28dc20:function(e){return e.maxStorageBuffersPerShaderStage},__wbg_maxStorageTexturesPerShaderStage_53ed734f26e6c1ad:function(e){return e.maxStorageTexturesPerShaderStage},__wbg_maxTextureArrayLayers_9ec487f1ce102992:function(e){return e.maxTextureArrayLayers},__wbg_maxTextureDimension1D_faef91b2e9fa6740:function(e){return e.maxTextureDimension1D},__wbg_maxTextureDimension2D_3a923eb2df4d9124:function(e){return e.maxTextureDimension2D},__wbg_maxTextureDimension3D_943321fe5945464e:function(e){return e.maxTextureDimension3D},__wbg_maxUniformBufferBindingSize_21e89ff761d576db:function(e){return e.maxUniformBufferBindingSize},__wbg_maxUniformBuffersPerShaderStage_19a0bfb0189f7254:function(e){return e.maxUniformBuffersPerShaderStage},__wbg_maxVertexAttributes_49aef6c51d07a280:function(e){return e.maxVertexAttributes},__wbg_maxVertexBufferArrayStride_f68c4029e6f047ec:function(e){return e.maxVertexBufferArrayStride},__wbg_maxVertexBuffers_ce9f15a623f9aac7:function(e){return e.maxVertexBuffers},__wbg_minStorageBufferOffsetAlignment_529f1f52e61188fc:function(e){return e.minStorageBufferOffsetAlignment},__wbg_minUniformBufferOffsetAlignment_519e26287e1996a3:function(e){return e.minUniformBufferOffsetAlignment},__wbg_navigator_9641ab32fa612dd1:function(e){return e.navigator},__wbg_navigator_c17f443a6fe5d38d:function(e){return e.navigator},__wbg_new_2bfd0f45e60518b1:function(){return b(function(e,t){return new OffscreenCanvas(e>>>0,t>>>0)},arguments)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_787b9fb330d55d78:function(e,t){return new Error(d(e,t))},__wbg_new_bb74001155cb8ca8:function(){return new Error},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_typed_6b60b99917da27d6:function(){return new Object},__wbg_new_typed_e09da9dae6ee5935:function(e,t){try{var n={a:e,b:t},r=(i,o)=>{let c=n.a;n.a=0;try{return Ue(c,n.b,i,o)}finally{n.a=c}};return new Promise(r)}finally{n.a=0}},__wbg_new_with_byte_offset_and_length_3cd32055a417f095:function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},__wbg_of_027eb15371aac932:function(e){return Array.of(e)},__wbg_onSubmittedWorkDone_1190213cee1ecf7e:function(e){return e.onSubmittedWorkDone()},__wbg_pixelStorei_43dc7945a0d4d49c:function(e,t,n){e.pixelStorei(t>>>0,n)},__wbg_pixelStorei_6dd56b4da047c480:function(e,t,n){e.pixelStorei(t>>>0,n)},__wbg_player_new:function(e){return I.__wrap(e)},__wbg_polygonOffset_41bc1f487e5f53fe:function(e,t,n){e.polygonOffset(t,n)},__wbg_polygonOffset_acf166e60739dbfa:function(e,t,n){e.polygonOffset(t,n)},__wbg_prototypesetcall_13162965d1fe7aa3:function(e,t,n){Uint8Array.prototype.set.call(q(e,t),n)},__wbg_push_c9f4893fc209f768:function(e,t){return e.push(t)},__wbg_queryCounterEXT_d43bae4582de7efd:function(e,t,n){e.queryCounterEXT(t,n>>>0)},__wbg_querySelectorAll_6c1bd81d448fb480:function(){return b(function(e,t,n){return e.querySelectorAll(d(t,n))},arguments)},__wbg_querySelector_72201b7c62dc196b:function(){return b(function(e,t,n){let r=e.querySelector(d(t,n));return g(r)?0:m(r)},arguments)},__wbg_queueMicrotask_1e8503a8a690f0a3:function(e){return e.queueMicrotask},__wbg_queueMicrotask_4a1a4d8dd332373b:function(e){queueMicrotask(e)},__wbg_queue_e250e2ebc49b39e0:function(e){return e.queue},__wbg_readBuffer_49d4b278b9838d40:function(e,t){e.readBuffer(t>>>0)},__wbg_readPixels_22316d250d820aff:function(){return b(function(e,t,n,r,_,i,o,c){e.readPixels(t,n,r,_,i>>>0,o>>>0,c)},arguments)},__wbg_readPixels_56a96c4d106afcbc:function(){return b(function(e,t,n,r,_,i,o,c){e.readPixels(t,n,r,_,i>>>0,o>>>0,c)},arguments)},__wbg_readPixels_7c7b54a733248182:function(){return b(function(e,t,n,r,_,i,o,c){e.readPixels(t,n,r,_,i>>>0,o>>>0,c)},arguments)},__wbg_renderbufferStorageMultisample_d5b01825cc08514b:function(e,t,n,r,_,i){e.renderbufferStorageMultisample(t>>>0,n,r>>>0,_,i)},__wbg_renderbufferStorage_0d080ee86520d3bd:function(e,t,n,r,_){e.renderbufferStorage(t>>>0,n>>>0,r,_)},__wbg_renderbufferStorage_ebe429f577dae949:function(e,t,n,r,_){e.renderbufferStorage(t>>>0,n>>>0,r,_)},__wbg_requestAdapter_a539af006419f2e9:function(e,t){return e.requestAdapter(t)},__wbg_requestAdapter_b35b01d9a8802935:function(e){return e.requestAdapter()},__wbg_requestDevice_5cb8a582e55d08cb:function(e,t){return e.requestDevice(t)},__wbg_resolve_dbf78ab4942478b0:function(e){return Promise.resolve(e)},__wbg_samplerParameterf_1fb6c6796e22f10f:function(e,t,n,r){e.samplerParameterf(t,n>>>0,r)},__wbg_samplerParameteri_defcb3b230e696e7:function(e,t,n,r){e.samplerParameteri(t,n>>>0,r)},__wbg_scissor_17956d9d23dfe025:function(e,t,n,r,_){e.scissor(t,n,r,_)},__wbg_scissor_bb7201f050f220ac:function(e,t,n,r,_){e.scissor(t,n,r,_)},__wbg_setBindGroup_418c3e0eb6943ce0:function(e,t,n){e.setBindGroup(t>>>0,n)},__wbg_setBindGroup_82d014e8f799f053:function(){return b(function(e,t,n,r,_,i,o){e.setBindGroup(t>>>0,n,T(r,_),i,o>>>0)},arguments)},__wbg_setPipeline_b6f981027e02cd16:function(e,t){e.setPipeline(t)},__wbg_setScissorRect_889235eeb784732b:function(e,t,n,r,_){e.setScissorRect(t>>>0,n>>>0,r>>>0,_>>>0)},__wbg_setVertexBuffer_6db3b60e99280744:function(e,t,n,r){e.setVertexBuffer(t>>>0,n,r)},__wbg_setVertexBuffer_cbf4ca1627c02f4c:function(e,t,n,r,_){e.setVertexBuffer(t>>>0,n,r,_)},__wbg_setViewport_c0be08dcc8965ccf:function(e,t,n,r,_,i,o){e.setViewport(t,n,r,_,i,o)},__wbg_set_118fefd528ab0a79:function(e,t,n){e.set(t,n>>>0)},__wbg_set_2793479888329cb6:function(){return b(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbg_set_a_1c94f1413a06c773:function(e,t){e.a=t},__wbg_set_access_b0a6fbebfbe53242:function(e,t){e.access=nt[t]},__wbg_set_alpha_84214d12347c6647:function(e,t){e.alpha=t},__wbg_set_alpha_mode_278c6649365aff36:function(e,t){e.alphaMode=Je[t]},__wbg_set_alpha_to_coverage_enabled_1e879520cab4bb05:function(e,t){e.alphaToCoverageEnabled=t!==0},__wbg_set_array_layer_count_bd7a074559a0abaa:function(e,t){e.arrayLayerCount=t>>>0},__wbg_set_array_stride_f64_b132c6a79afeae43:function(e,t){e.arrayStride=t},__wbg_set_aspect_3b0dceed92671cc1:function(e,t){e.aspect=pe[t]},__wbg_set_aspect_8c866a3891032753:function(e,t){e.aspect=pe[t]},__wbg_set_attributes_67bbc44b08e038d6:function(e,t,n){e.attributes=S(t,n)},__wbg_set_b_a93bcfdd1c29a0bd:function(e,t){e.b=t},__wbg_set_base_array_layer_e745f84c2e5437e2:function(e,t){e.baseArrayLayer=t>>>0},__wbg_set_base_mip_level_fe08854fab09de85:function(e,t){e.baseMipLevel=t>>>0},__wbg_set_beginning_of_pass_write_index_a13b608f19d6a2f0:function(e,t){e.beginningOfPassWriteIndex=t>>>0},__wbg_set_bind_group_layouts_383f681565a30d8a:function(e,t,n){e.bindGroupLayouts=S(t,n)},__wbg_set_binding_bd7d6b01bb08823a:function(e,t){e.binding=t>>>0},__wbg_set_binding_dbed4a234264971a:function(e,t){e.binding=t>>>0},__wbg_set_blend_1f3e5b36f9c246cb:function(e,t){e.blend=t},__wbg_set_buffer_76841cdbff393f1d:function(e,t){e.buffer=t},__wbg_set_buffer_91f4e8e05066c37a:function(e,t){e.buffer=t},__wbg_set_buffers_47665c552e27672c:function(e,t,n){e.buffers=S(t,n)},__wbg_set_bytes_per_row_75441352f606ebc8:function(e,t){e.bytesPerRow=t>>>0},__wbg_set_clear_value_gpu_color_dict_303e0009591e5d26:function(e,t){e.clearValue=t},__wbg_set_code_130aebc49c4cadd3:function(e,t,n){e.code=d(t,n)},__wbg_set_color_6d2de56a2224ec57:function(e,t){e.color=t},__wbg_set_color_attachments_e83f79badceda8b4:function(e,t,n){e.colorAttachments=S(t,n)},__wbg_set_compare_159af15eb77dbcd2:function(e,t){e.compare=we[t]},__wbg_set_count_4d1e9559a7f1b993:function(e,t){e.count=t>>>0},__wbg_set_cull_mode_31293d13bc064271:function(e,t){e.cullMode=Xe[t]},__wbg_set_depth_bias_b30728f3ab3f643e:function(e,t){e.depthBias=t},__wbg_set_depth_bias_clamp_5b58fd4819283038:function(e,t){e.depthBiasClamp=t},__wbg_set_depth_bias_slope_scale_8b8b20db6b43c43b:function(e,t){e.depthBiasSlopeScale=t},__wbg_set_depth_clear_value_1165941523836019:function(e,t){e.depthClearValue=t},__wbg_set_depth_compare_81dd71de7e433cc2:function(e,t){e.depthCompare=we[t]},__wbg_set_depth_fail_op_ddf822c573cdf0c1:function(e,t){e.depthFailOp=ne[t]},__wbg_set_depth_load_op_ca270acab0c1ca69:function(e,t){e.depthLoadOp=te[t]},__wbg_set_depth_or_array_layers_e59f3988a095ccac:function(e,t){e.depthOrArrayLayers=t>>>0},__wbg_set_depth_read_only_49ca399f98b97955:function(e,t){e.depthReadOnly=t!==0},__wbg_set_depth_stencil_41e94739225cb2c3:function(e,t){e.depthStencil=t},__wbg_set_depth_stencil_attachment_36ce3695dfcb6b85:function(e,t){e.depthStencilAttachment=t},__wbg_set_depth_store_op_6cd6bdde49f9050d:function(e,t){e.depthStoreOp=re[t]},__wbg_set_depth_write_enabled_4b5da11c77fbdab7:function(e,t){e.depthWriteEnabled=t!==0},__wbg_set_device_1940fd5f9e2a7fee:function(e,t){e.device=t},__wbg_set_dimension_88d0c9f16bb079fb:function(e,t){e.dimension=rt[t]},__wbg_set_dimension_bab9530fa3e311d8:function(e,t){e.dimension=_e[t]},__wbg_set_dst_factor_80c13f29a3e117cb:function(e,t){e.dstFactor=he[t]},__wbg_set_end_of_pass_write_index_793fcfe3141dc357:function(e,t){e.endOfPassWriteIndex=t>>>0},__wbg_set_entries_552f52b2aa3b346d:function(e,t,n){e.entries=S(t,n)},__wbg_set_entries_d9929dbfa2aaa9a7:function(e,t,n){e.entries=S(t,n)},__wbg_set_entry_point_0eacf7b26b3637b0:function(e,t,n){e.entryPoint=d(t,n)},__wbg_set_entry_point_bb3692db4a6065d0:function(e,t,n){e.entryPoint=d(t,n)},__wbg_set_external_texture_1bef5ba626275d0a:function(e,t){e.externalTexture=t},__wbg_set_fail_op_739cc3815d38c95f:function(e,t){e.failOp=ne[t]},__wbg_set_format_1119b9930bd324e1:function(e,t){e.format=k[t]},__wbg_set_format_443ea19e2d25a1e2:function(e,t){e.format=k[t]},__wbg_set_format_459792306baadae5:function(e,t){e.format=k[t]},__wbg_set_format_46b1c6b3acc10b24:function(e,t){e.format=k[t]},__wbg_set_format_5a62f31a4690f935:function(e,t){e.format=it[t]},__wbg_set_format_efec4f7d9471ddbb:function(e,t){e.format=k[t]},__wbg_set_format_fd579d96fa4e468c:function(e,t){e.format=k[t]},__wbg_set_fragment_bea523f8973c326e:function(e,t){e.fragment=t},__wbg_set_front_face_30951d0404e9e6d4:function(e,t){e.frontFace=Ke[t]},__wbg_set_g_90eacc6608e549f8:function(e,t){e.g=t},__wbg_set_has_dynamic_offset_6e5f3385eb579529:function(e,t){e.hasDynamicOffset=t!==0},__wbg_set_height_3f64e19acf29f5fb:function(e,t){e.height=t>>>0},__wbg_set_height_ae0610d318c3428c:function(e,t){e.height=t>>>0},__wbg_set_height_ae24c2f7d580ae0a:function(e,t){e.height=t>>>0},__wbg_set_label_08745022b1ec7b66:function(e,t,n){e.label=d(t,n)},__wbg_set_label_11c9eb57693a8459:function(e,t,n){e.label=d(t,n)},__wbg_set_label_20c42b4ebeb250d5:function(e,t,n){e.label=d(t,n)},__wbg_set_label_22e3966c8d513ba6:function(e,t,n){e.label=d(t,n)},__wbg_set_label_5347fc976d15e94c:function(e,t,n){e.label=d(t,n)},__wbg_set_label_644bc1b32c7917b0:function(e,t,n){e.label=d(t,n)},__wbg_set_label_73c99dab6708c962:function(e,t,n){e.label=d(t,n)},__wbg_set_label_85a21b5fdd57fd91:function(e,t,n){e.label=d(t,n)},__wbg_set_label_89d2ffaf598df6a4:function(e,t,n){e.label=d(t,n)},__wbg_set_label_9e68078b9533426b:function(e,t,n){e.label=d(t,n)},__wbg_set_label_cba03ffef7ae90a3:function(e,t,n){e.label=d(t,n)},__wbg_set_label_f654bcb731d4d9ca:function(e,t,n){e.label=d(t,n)},__wbg_set_layout_200fc3b143da0a9e:function(e,t){e.layout=t},__wbg_set_layout_3f0cb99635c33123:function(e,t){e.layout=t},__wbg_set_layout_gpu_auto_layout_mode_2e8a53f8643b4f69:function(e,t){e.layout=qe[t]},__wbg_set_load_op_e8c33d4bdd2772aa:function(e,t){e.loadOp=te[t]},__wbg_set_mapped_at_creation_8af5b87ccb898bbe:function(e,t){e.mappedAtCreation=t!==0},__wbg_set_mask_0de0e782abec3c25:function(e,t){e.mask=t>>>0},__wbg_set_min_binding_size_f64_c6d68d773b7051d3:function(e,t){e.minBindingSize=t},__wbg_set_mip_level_count_c0ac46de264d83ec:function(e,t){e.mipLevelCount=t>>>0},__wbg_set_mip_level_count_cd650972803ed9eb:function(e,t){e.mipLevelCount=t>>>0},__wbg_set_mip_level_f0c5ed95eedda453:function(e,t){e.mipLevel=t>>>0},__wbg_set_mode_51d2c5a5ac0f7ac9:function(e,t){e.mode=Qe[t]},__wbg_set_module_3dec1a50bca7870a:function(e,t){e.module=t},__wbg_set_module_b42baf3925e2a94a:function(e,t){e.module=t},__wbg_set_multisample_6af76792fae6efb1:function(e,t){e.multisample=t},__wbg_set_multisampled_ae3f9f01a324f57c:function(e,t){e.multisampled=t!==0},__wbg_set_offset_f64_15176b737de7dde0:function(e,t){e.offset=t},__wbg_set_offset_f64_52f728fc5c98a52c:function(e,t){e.offset=t},__wbg_set_offset_f64_9374d9e912985773:function(e,t){e.offset=t},__wbg_set_operation_e103287df7ac9cf6:function(e,t){e.operation=je[t]},__wbg_set_origin_gpu_origin_3d_dict_26016670147a706c:function(e,t){e.origin=t},__wbg_set_pass_op_4d08c3105f64a17a:function(e,t){e.passOp=ne[t]},__wbg_set_power_preference_6bc1d2697a0e7374:function(e,t){e.powerPreference=Ze[t]},__wbg_set_primitive_ef867d733c4efb1c:function(e,t){e.primitive=t},__wbg_set_query_set_765c4c9ab99342cb:function(e,t){e.querySet=t},__wbg_set_r_1116d6a5f656263d:function(e,t){e.r=t},__wbg_set_required_features_5bda1420e19461b2:function(e,t,n){e.requiredFeatures=S(t,n)},__wbg_set_required_limits_e78b923d73f9b596:function(e,t){e.requiredLimits=t},__wbg_set_resolve_target_gpu_texture_view_a7a97a7c04d84698:function(e,t){e.resolveTarget=t},__wbg_set_resource_0f960a4279e7e400:function(e,t){e.resource=t},__wbg_set_resource_gpu_buffer_binding_53a2189a77dd38be:function(e,t){e.resource=t},__wbg_set_resource_gpu_texture_view_9153a2356b958667:function(e,t){e.resource=t},__wbg_set_rows_per_image_11e9552fb5c5c5ab:function(e,t){e.rowsPerImage=t>>>0},__wbg_set_sample_count_8262aacc91878e4d:function(e,t){e.sampleCount=t>>>0},__wbg_set_sample_type_563589178fc892fe:function(e,t){e.sampleType=_t[t]},__wbg_set_sampler_ccdca76ef8e642ca:function(e,t){e.sampler=t},__wbg_set_shader_location_31dc427c303a32aa:function(e,t){e.shaderLocation=t>>>0},__wbg_set_size_f64_3ff72c0d736c42a1:function(e,t){e.size=t},__wbg_set_size_f64_9b65e4916b2eb111:function(e,t){e.size=t},__wbg_set_size_gpu_extent_3d_dict_bba6669c79c26190:function(e,t){e.size=t},__wbg_set_src_factor_7e90d4b7d8227fc5:function(e,t){e.srcFactor=he[t]},__wbg_set_stencil_back_6b5aeefbb90ae3ae:function(e,t){e.stencilBack=t},__wbg_set_stencil_clear_value_56fa848198a9b430:function(e,t){e.stencilClearValue=t>>>0},__wbg_set_stencil_front_4ffeca9473bca095:function(e,t){e.stencilFront=t},__wbg_set_stencil_load_op_b7a9fe3ad789b6c6:function(e,t){e.stencilLoadOp=te[t]},__wbg_set_stencil_read_mask_7cfe0945679de134:function(e,t){e.stencilReadMask=t>>>0},__wbg_set_stencil_read_only_0dde0c073192b5fa:function(e,t){e.stencilReadOnly=t!==0},__wbg_set_stencil_store_op_d320bcbb72456a4c:function(e,t){e.stencilStoreOp=re[t]},__wbg_set_stencil_write_mask_765017d5830ee98a:function(e,t){e.stencilWriteMask=t>>>0},__wbg_set_step_mode_2b1318f00e2ddc02:function(e,t){e.stepMode=at[t]},__wbg_set_storage_texture_b9e95e260c9d49a3:function(e,t){e.storageTexture=t},__wbg_set_store_op_e2b740eddfd2713f:function(e,t){e.storeOp=re[t]},__wbg_set_strip_index_format_22ddab1b8f352c1d:function(e,t){e.stripIndexFormat=Ye[t]},__wbg_set_targets_07e15f3cca640faf:function(e,t,n){e.targets=S(t,n)},__wbg_set_texture_7b9ace323bfe7938:function(e,t){e.texture=t},__wbg_set_texture_84a5f84f0f451291:function(e,t){e.texture=t},__wbg_set_timestamp_writes_1d304b9eb09ff227:function(e,t){e.timestampWrites=t},__wbg_set_tone_mapping_23fcd4f846a61048:function(e,t){e.toneMapping=t},__wbg_set_topology_b29804e5549370f5:function(e,t){e.topology=et[t]},__wbg_set_type_ac87cc570da17000:function(e,t){e.type=He[t]},__wbg_set_type_f3d1ad35dc7889f9:function(e,t){e.type=tt[t]},__wbg_set_unclipped_depth_59155eb615f193fe:function(e,t){e.unclippedDepth=t!==0},__wbg_set_usage_5ba672bf81ba9859:function(e,t){e.usage=t>>>0},__wbg_set_usage_b0070c2ce47149a6:function(e,t){e.usage=t>>>0},__wbg_set_usage_bac3cabe90090275:function(e,t){e.usage=t>>>0},__wbg_set_usage_f3e1a48118ff483a:function(e,t){e.usage=t>>>0},__wbg_set_vertex_00b1e17dc3fe7fb3:function(e,t){e.vertex=t},__wbg_set_view_dimension_e9e9cd07d7ad686d:function(e,t){e.viewDimension=_e[t]},__wbg_set_view_dimension_eb197c35c45e572c:function(e,t){e.viewDimension=_e[t]},__wbg_set_view_formats_2540cdb8dde31055:function(e,t,n){e.viewFormats=S(t,n)},__wbg_set_view_formats_845b425c1d19e1af:function(e,t,n){e.viewFormats=S(t,n)},__wbg_set_view_gpu_texture_view_9a3c34ba4d1969b8:function(e,t){e.view=t},__wbg_set_view_gpu_texture_view_efa644c1ce3c4deb:function(e,t){e.view=t},__wbg_set_visibility_65413465e7b24eb6:function(e,t){e.visibility=t>>>0},__wbg_set_width_5f89a551b5472887:function(e,t){e.width=t>>>0},__wbg_set_width_a2410cafbdefeb5a:function(e,t){e.width=t>>>0},__wbg_set_width_eb3001e1dcabb909:function(e,t){e.width=t>>>0},__wbg_set_write_mask_39ce121635fd4296:function(e,t){e.writeMask=t>>>0},__wbg_set_x_b078c58009aa57bd:function(e,t){e.x=t>>>0},__wbg_set_y_3df92c4bcff23616:function(e,t){e.y=t>>>0},__wbg_set_z_3633c53887a9ff5e:function(e,t){e.z=t>>>0},__wbg_shaderSource_519d0f56b613b2f9:function(e,t,n,r){e.shaderSource(t,d(n,r))},__wbg_shaderSource_c4c06a3cbc2e7bf3:function(e,t,n,r){e.shaderSource(t,d(n,r))},__wbg_stack_575c4e0918581b9c:function(e,t){let n=t.stack,r=y(n,s.__wbindgen_malloc,s.__wbindgen_realloc),_=h;p().setInt32((e>>>0)+4,_,!0),p().setInt32((e>>>0)+0,r,!0)},__wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc:function(){let e=typeof globalThis>"u"?void 0:globalThis;return g(e)?0:m(e)},__wbg_static_accessor_GLOBAL_e4293fb22cbe77da:function(){let e=typeof global>"u"?void 0:global;return g(e)?0:m(e)},__wbg_static_accessor_SELF_53bb20457401453d:function(){let e=typeof self>"u"?void 0:self;return g(e)?0:m(e)},__wbg_static_accessor_WINDOW_b5e0810bfecb7feb:function(){let e=typeof window>"u"?void 0:window;return g(e)?0:m(e)},__wbg_stencilFuncSeparate_bd578fbb298ad0e6:function(e,t,n,r,_){e.stencilFuncSeparate(t>>>0,n>>>0,r,_>>>0)},__wbg_stencilFuncSeparate_c4e19ab2f6a233b9:function(e,t,n,r,_){e.stencilFuncSeparate(t>>>0,n>>>0,r,_>>>0)},__wbg_stencilMaskSeparate_41c3f5591b508051:function(e,t,n){e.stencilMaskSeparate(t>>>0,n>>>0)},__wbg_stencilMaskSeparate_b009d9ab29dc5926:function(e,t,n){e.stencilMaskSeparate(t>>>0,n>>>0)},__wbg_stencilMask_1fe24adb96500c11:function(e,t){e.stencilMask(t>>>0)},__wbg_stencilMask_6d5dbf91337de94e:function(e,t){e.stencilMask(t>>>0)},__wbg_stencilOpSeparate_9a2068a0767d6507:function(e,t,n,r,_){e.stencilOpSeparate(t>>>0,n>>>0,r>>>0,_>>>0)},__wbg_stencilOpSeparate_f4319497016868f8:function(e,t,n,r,_){e.stencilOpSeparate(t>>>0,n>>>0,r>>>0,_>>>0)},__wbg_subgroupMaxSize_3586e822dc3603f6:function(e){return e.subgroupMaxSize},__wbg_subgroupMinSize_17f758985cdd1dab:function(e){return e.subgroupMinSize},__wbg_submit_077c85cc28e36892:function(e,t,n){e.submit(S(t,n))},__wbg_texImage2D_20b5002326193fe6:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texImage2D_5048d2cd8540da16:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texImage2D_84bdef619a1ea935:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texImage3D_5b7fe3781e1db22a:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l){e.texImage3D(t>>>0,n,r,_,i,o,c,f>>>0,u>>>0,l)},arguments)},__wbg_texImage3D_abf2fdb0f8c4c1b6:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l){e.texImage3D(t>>>0,n,r,_,i,o,c,f>>>0,u>>>0,l)},arguments)},__wbg_texParameteri_0afc5d515132fed2:function(e,t,n,r){e.texParameteri(t>>>0,n>>>0,r)},__wbg_texParameteri_e24e4fdc17153838:function(e,t,n,r){e.texParameteri(t>>>0,n>>>0,r)},__wbg_texStorage2D_e0ebb5940fa1fc5e:function(e,t,n,r,_,i){e.texStorage2D(t>>>0,n,r>>>0,_,i)},__wbg_texStorage3D_a82e5be79cb278dc:function(e,t,n,r,_,i,o){e.texStorage3D(t>>>0,n,r>>>0,_,i,o)},__wbg_texSubImage2D_0fed1a7412bc7a63:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_1434c994889108aa:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_4343af4633b8b8f8:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_4aef07460a86c81e:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_9c7e2d1250b1f95f:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_a26a8700e734449a:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_a271f112c3b60b18:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage2D_baff05c8a8de2e17:function(){return b(function(e,t,n,r,_,i,o,c,f,u){e.texSubImage2D(t>>>0,n,r,_,i,o,c>>>0,f>>>0,u)},arguments)},__wbg_texSubImage3D_00e908f23d33228d:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_texSubImage3D_286489de7bf7239a:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_texSubImage3D_32223c3dd7dcdd78:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_texSubImage3D_5e8b27dc040faf8d:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_texSubImage3D_b1b631c3011a209e:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_texSubImage3D_e8f20815b70bc7cb:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_texSubImage3D_ed8982daddcccd1e:function(){return b(function(e,t,n,r,_,i,o,c,f,u,l,w){e.texSubImage3D(t>>>0,n,r,_,i,o,c,f,u>>>0,l>>>0,w)},arguments)},__wbg_then_656f253a5dd7d8ea:function(e,t,n){return e.then(t,n)},__wbg_then_e3f7f2d365708be8:function(e,t){return e.then(t)},__wbg_unconfigure_835307f58dc68d80:function(e){e.unconfigure()},__wbg_uniform1f_0b36dc15cb2b4991:function(e,t,n){e.uniform1f(t,n)},__wbg_uniform1f_fe417acc7c7a1dc5:function(e,t,n){e.uniform1f(t,n)},__wbg_uniform1i_385ebc488d4d763f:function(e,t,n){e.uniform1i(t,n)},__wbg_uniform1i_778a02a48ecdceed:function(e,t,n){e.uniform1i(t,n)},__wbg_uniform1ui_79071fccd0396b88:function(e,t,n){e.uniform1ui(t,n>>>0)},__wbg_uniform2fv_486658e6bcddfbaf:function(e,t,n,r){e.uniform2fv(t,x(n,r))},__wbg_uniform2fv_71fe605c72879b61:function(e,t,n,r){e.uniform2fv(t,x(n,r))},__wbg_uniform2iv_80c1acefe7258756:function(e,t,n,r){e.uniform2iv(t,P(n,r))},__wbg_uniform2iv_d6efe574c69f5aed:function(e,t,n,r){e.uniform2iv(t,P(n,r))},__wbg_uniform2uiv_f9619772d6706c37:function(e,t,n,r){e.uniform2uiv(t,T(n,r))},__wbg_uniform3fv_431207a9407b7d29:function(e,t,n,r){e.uniform3fv(t,x(n,r))},__wbg_uniform3fv_58fa948c65cb5f6c:function(e,t,n,r){e.uniform3fv(t,x(n,r))},__wbg_uniform3iv_11889262cf74698c:function(e,t,n,r){e.uniform3iv(t,P(n,r))},__wbg_uniform3iv_e9d02a45a4149457:function(e,t,n,r){e.uniform3iv(t,P(n,r))},__wbg_uniform3uiv_b71a1165273e4af4:function(e,t,n,r){e.uniform3uiv(t,T(n,r))},__wbg_uniform4f_14a3638afe93aa8f:function(e,t,n,r,_,i){e.uniform4f(t,n,r,_,i)},__wbg_uniform4f_5c31fb6dab645ad8:function(e,t,n,r,_,i){e.uniform4f(t,n,r,_,i)},__wbg_uniform4fv_a1415c11925ac651:function(e,t,n,r){e.uniform4fv(t,x(n,r))},__wbg_uniform4fv_d3afea28181f5342:function(e,t,n,r){e.uniform4fv(t,x(n,r))},__wbg_uniform4iv_c9e8520342091b0a:function(e,t,n,r){e.uniform4iv(t,P(n,r))},__wbg_uniform4iv_fa18eabf499f4df7:function(e,t,n,r){e.uniform4iv(t,P(n,r))},__wbg_uniform4uiv_7a5b848aa1084b38:function(e,t,n,r){e.uniform4uiv(t,T(n,r))},__wbg_uniformBlockBinding_61c5a97721e0f36b:function(e,t,n,r){e.uniformBlockBinding(t,n>>>0,r>>>0)},__wbg_uniformMatrix2fv_0a42d3c91d7cb169:function(e,t,n,r,_){e.uniformMatrix2fv(t,n!==0,x(r,_))},__wbg_uniformMatrix2fv_8b3774cc1f2dd2af:function(e,t,n,r,_){e.uniformMatrix2fv(t,n!==0,x(r,_))},__wbg_uniformMatrix2x3fv_f9e50997fac55ae7:function(e,t,n,r,_){e.uniformMatrix2x3fv(t,n!==0,x(r,_))},__wbg_uniformMatrix2x4fv_080d208b4f9c72be:function(e,t,n,r,_){e.uniformMatrix2x4fv(t,n!==0,x(r,_))},__wbg_uniformMatrix3fv_15b2b1f5505b8506:function(e,t,n,r,_){e.uniformMatrix3fv(t,n!==0,x(r,_))},__wbg_uniformMatrix3fv_df1958f8b617c8d6:function(e,t,n,r,_){e.uniformMatrix3fv(t,n!==0,x(r,_))},__wbg_uniformMatrix3x2fv_6730abc8ef13d7d3:function(e,t,n,r,_){e.uniformMatrix3x2fv(t,n!==0,x(r,_))},__wbg_uniformMatrix3x4fv_3eb72e0d85856655:function(e,t,n,r,_){e.uniformMatrix3x4fv(t,n!==0,x(r,_))},__wbg_uniformMatrix4fv_cd0ba72d1d780759:function(e,t,n,r,_){e.uniformMatrix4fv(t,n!==0,x(r,_))},__wbg_uniformMatrix4fv_edd2b51dbb1caffd:function(e,t,n,r,_){e.uniformMatrix4fv(t,n!==0,x(r,_))},__wbg_uniformMatrix4x2fv_b0c23910facd8e86:function(e,t,n,r,_){e.uniformMatrix4x2fv(t,n!==0,x(r,_))},__wbg_uniformMatrix4x3fv_b6f9b241f392f245:function(e,t,n,r,_){e.uniformMatrix4x3fv(t,n!==0,x(r,_))},__wbg_unmap_6a96b14c9ef5f7f5:function(e){e.unmap()},__wbg_useProgram_d9c24a7d8632c4c1:function(e,t){e.useProgram(t)},__wbg_useProgram_f6341ea2eeea1e5a:function(e,t){e.useProgram(t)},__wbg_vertexAttribDivisorANGLE_5bec9a774ccd1cf8:function(e,t,n){e.vertexAttribDivisorANGLE(t>>>0,n>>>0)},__wbg_vertexAttribDivisor_5b64fc697c0496e1:function(e,t,n){e.vertexAttribDivisor(t>>>0,n>>>0)},__wbg_vertexAttribIPointer_a6240b64263fb63b:function(e,t,n,r,_,i){e.vertexAttribIPointer(t>>>0,n,r>>>0,_,i)},__wbg_vertexAttribPointer_39b706eb26c50057:function(e,t,n,r,_,i,o){e.vertexAttribPointer(t>>>0,n,r>>>0,_!==0,i,o)},__wbg_vertexAttribPointer_9e0e4517b8d274bd:function(e,t,n,r,_,i,o){e.vertexAttribPointer(t>>>0,n,r>>>0,_!==0,i,o)},__wbg_viewport_aaac6dd8cff1831a:function(e,t,n,r,_){e.viewport(t,n,r,_)},__wbg_viewport_cdae9e8b2f33343d:function(e,t,n,r,_){e.viewport(t,n,r,_)},__wbg_width_babc5dc7654771b1:function(e){return e.width},__wbg_writeBuffer_d7640e64ceb69371:function(){return b(function(e,t,n,r,_,i,o){e.writeBuffer(t,n,q(r,_),i,o)},arguments)},__wbg_writeTexture_dba1e801af087dfd:function(){return b(function(e,t,n,r,_,i){e.writeTexture(t,q(n,r),_,i)},arguments)},__wbindgen_generic_0000000000000001:function(e,t){return j(e,t,Ge)},__wbindgen_generic_0000000000000002:function(e,t){return j(e,t,Ve)},__wbindgen_generic_0000000000000003:function(e,t){return j(e,t,Ne)},__wbindgen_generic_0000000000000004:function(e,t){return j(e,t,$e)},__wbindgen_generic_0000000000000005:function(e){return e},__wbindgen_generic_0000000000000006:function(e,t){return x(e,t)},__wbindgen_generic_0000000000000007:function(e,t){return ot(e,t)},__wbindgen_generic_0000000000000008:function(e,t){return P(e,t)},__wbindgen_generic_0000000000000009:function(e,t){return st(e,t)},__wbindgen_generic_000000000000000a:function(e,t){return ft(e,t)},__wbindgen_generic_000000000000000b:function(e,t){return T(e,t)},__wbindgen_generic_000000000000000c:function(e,t){return q(e,t)},__wbindgen_generic_000000000000000d:function(e,t){return d(e,t)},__wbindgen_init_externref_table:function(){let e=s.__wbindgen_externrefs;e.set(0,void 0),e.set(1024,void 0),e.set(1025,null),e.set(1026,!0),e.set(1027,!1)}}}}function Ge(a,e,t){let n=s.wasm_bindgen__convert__closures_____invoke__hd4acdde59c21f30c(a,e,t);if(n[1])throw v(n[0])}function Ve(a,e,t){let n=s.wasm_bindgen__convert__closures_____invoke__h0ac39b197b40bdab(a,e,t);if(n[1])throw v(n[0])}function Ne(a,e,t){let n=s.wasm_bindgen__convert__closures_____invoke__h0ac39b197b40bdab_35(a,e,t);if(n[1])throw v(n[0])}function $e(a,e,t){let n=s.wasm_bindgen__convert__closures_____invoke__h0ac39b197b40bdab_36(a,e,t);if(n[1])throw v(n[0])}function Ue(a,e,t,n){s.wasm_bindgen__convert__closures_____invoke__h3f9e6c9cb5711c53(a,e,t,n)}var qe=["auto"],he=["zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant","src1","one-minus-src1","src1-alpha","one-minus-src1-alpha"],je=["add","subtract","reverse-subtract","min","max"],He=["uniform","storage","read-only-storage"],Je=["opaque","premultiplied"],Qe=["standard","extended"],we=["never","less","equal","less-equal","greater","not-equal","greater-equal","always"],Xe=["none","front","back"],Ke=["ccw","cw"],Ye=["uint16","uint32"],te=["load","clear"],Ze=["low-power","high-performance"],et=["point-list","line-list","line-strip","triangle-list","triangle-strip"],tt=["filtering","non-filtering","comparison"],ne=["keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],nt=["write-only","read-only","read-write"],re=["store","discard"],pe=["all","stencil-only","depth-only"],rt=["1d","2d","3d"],k=["r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16unorm","rgba16snorm","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],_t=["float","unfilterable-float","depth","sint","uint"],_e=["1d","2d","2d-array","cube","cube-array","3d"],it=["uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],at=["vertex","instance"],ye=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(a=>s.__wbg_player_free(a,1));function m(a){let e=s.__externref_table_alloc();return s.__wbindgen_externrefs.set(e,a),e}var xe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(a=>s.__wbindgen_destroy_closure(a.a,a.b));function Se(a){switch(typeof a){case"number":case"boolean":case"undefined":return`${a}`;case"string":return JSON.stringify(a);case"bigint":return`${a}n`;case"symbol":return a.description!==void 0?`Symbol(${a.description})`:"Symbol";case"function":return typeof a.name=="string"&&a.name!==""?`Function(${a.name})`:"Function";case"object":{if(a===null)return"null";if(Array.isArray(a))return"["+Array.from(a,Se).join(", ")+"]";if(a instanceof Error)return`${a.name}: ${a.message}
|
|
2
|
+
${a.stack}`;let e=toString.call(a),t=/\[object ([^\]]+)\]/.exec(e)?.[1];if(t===void 0)return e;if(t==="Object")try{return"Object("+JSON.stringify(a)+")"}catch{return"Object"}return t}}}function x(a,e){return a=a>>>0,ut().subarray(a/4,a/4+e)}function ve(a,e){return a=a>>>0,bt().subarray(a/8,a/8+e)}function ot(a,e){return a=a>>>0,dt().subarray(a/2,a/2+e)}function P(a,e){return a=a>>>0,lt().subarray(a/4,a/4+e)}function st(a,e){return a=a>>>0,gt().subarray(a/1,a/1+e)}function ct(a,e){a=a>>>0;let t=p(),n=[];for(let r=a;r<a+4*e;r+=4)n.push(s.__wbindgen_externrefs.get(t.getUint32(r,!0)));return s.__externref_drop_slice(a,e),n}function S(a,e){a=a>>>0;let t=p(),n=[];for(let r=a;r<a+4*e;r+=4)n.push(s.__wbindgen_externrefs.get(t.getUint32(r,!0)));return n}function ft(a,e){return a=a>>>0,mt().subarray(a/2,a/2+e)}function T(a,e){return a=a>>>0,ht().subarray(a/4,a/4+e)}function q(a,e){return a=a>>>0,L().subarray(a/1,a/1+e)}var M=null;function p(){return(M===null||M.buffer.detached===!0||M.buffer.detached===void 0&&M.buffer!==s.memory.buffer)&&(M=new DataView(s.memory.buffer)),M}var B=null;function ut(){return(B===null||B.byteLength===0)&&(B=new Float32Array(s.memory.buffer)),B}var C=null;function bt(){return(C===null||C.byteLength===0)&&(C=new Float64Array(s.memory.buffer)),C}var R=null;function dt(){return(R===null||R.byteLength===0)&&(R=new Int16Array(s.memory.buffer)),R}var O=null;function lt(){return(O===null||O.byteLength===0)&&(O=new Int32Array(s.memory.buffer)),O}var W=null;function gt(){return(W===null||W.byteLength===0)&&(W=new Int8Array(s.memory.buffer)),W}function d(a,e){return a=a>>>0,pt(L().subarray(a,a+e))}var z=null;function mt(){return(z===null||z.byteLength===0)&&(z=new Uint16Array(s.memory.buffer)),z}var G=null;function ht(){return(G===null||G.byteLength===0)&&(G=new Uint32Array(s.memory.buffer)),G}var V=null;function L(){return(V===null||V.byteLength===0)&&(V=new Uint8Array(s.memory.buffer)),V}function b(a,e){try{return a.apply(this,e)}catch(t){let n=m(t);s.__wbindgen_exn_store(n)}}function g(a){return a==null}function j(a,e,t){let n={a,b:e,cnt:1},r=(..._)=>{n.cnt++;let i=n.a;n.a=0;try{return t(i,n.b,..._)}finally{n.a=i,r._wbg_cb_unref()}};return r._wbg_cb_unref=()=>{--n.cnt===0&&(s.__wbindgen_destroy_closure(n.a,n.b),n.a=0,xe.unregister(n))},xe.register(r,n,n),r}function Ae(a,e){let t=e(a.length*1,1)>>>0;return L().set(a,t/1),h=a.length,t}function E(a,e){let t=e(a.length*4,4)>>>0;for(let n=0;n<a.length;n++){let r=m(a[n]);p().setUint32(t+4*n,r,!0)}return h=a.length,t}function y(a,e,t){if(t===void 0){let o=N.encode(a),c=e(o.length,1)>>>0;return L().subarray(c,c+o.length).set(o),h=o.length,c}let n=a.length,r=e(n,1)>>>0,_=L(),i=0;for(;i<n;i++){let o=a.charCodeAt(i);if(o>127)break;_[r+i]=o}if(i!==n){i!==0&&(a=a.slice(i)),r=t(r,n,n=i+a.length*3,1)>>>0;let o=L().subarray(r+i,r+n),c=N.encodeInto(a,o);i+=c.written,r=t(r,n,i,1)>>>0}return h=i,r}function v(a){let e=s.__wbindgen_externrefs.get(a);return s.__externref_table_dealloc(a),e}var H=new TextDecoder("utf-8",{ignoreBOM:!0});H.decode();var wt=2146435072,ie=0;function pt(a){return ie+=a.length,ie>=wt&&(H=new TextDecoder("utf-8",{ignoreBOM:!0}),H.decode(),ie=a.length),H.decode(a)}var N=new TextEncoder;"encodeInto"in N||(N.encodeInto=function(a,e){let t=N.encode(a);return e.set(t),{read:a.length,written:t.length}});var h=0,yt,xt,s;function vt(a,e){return xt=a,s=a.exports,yt=e,M=null,B=null,C=null,R=null,O=null,W=null,z=null,G=null,V=null,s.__wbindgen_start(),s}async function St(a,e){if(typeof Response=="function"&&a instanceof Response){if(!a.ok)throw new Error(`failed to fetch Wasm: ${a.status} ${a.statusText} fetching '${a.url}'`);if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(a,e)}catch(r){if(t(a.type)&&a.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await a.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(a,e);return n instanceof WebAssembly.Instance?{instance:n,module:a}:n}function t(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}}var F;async function ce(a){return s!==void 0?s:(F===void 0&&(F=At(a),F.catch(()=>{F=void 0})),F)}async function At(a){a!==void 0&&(Object.getPrototypeOf(a)===Object.prototype?{module_or_path:a}=a:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),a===void 0&&(a=new URL("pencil_web_bg.wasm",import.meta.url));let e=ze();(typeof a=="string"||typeof Request=="function"&&a instanceof Request||typeof URL=="function"&&a instanceof URL)&&(a=fetch(a));let{instance:t,module:n}=await St(await a,e);return vt(t,n)}var Pt=null,fe=!1;async function ue(a){let e=globalThis.__pencilAhead,t=e?.[a];if(!t)return null;delete e[a];try{let n=await t;return n?.ok?n:null}catch{return null}}async function It(){let a=await ue("wasm");if(a)try{let t=await ce({module_or_path:a});return fe=!0,t}catch{}let e=await ce();return fe=!0,e}var $=()=>Pt??=It(),be=()=>fe,kt=async a=>{let e=await fetch(new URL(a,document.baseURI));if(!e.ok)throw new Error(`${a}: ${e.status}`);return e.text()};async function Pe(a,e,t=kt,n={}){await $();let r={},_=(i,o)=>Promise.all(se(i,o).map(async c=>{if(!(c in r)){r[c]=null;try{r[c]=n[c]??await t(c)}catch{return}await _(c,r[c])}}));await Promise.all(e.map((i,o)=>_(a[o]??"",i)));for(let[i,o]of Object.entries(r))o===null&&delete r[i];return{names:a,files:r}}var Ie="http://www.w3.org/2000/svg";var J={sans:new URL("../fonts/LibertinusSans-Regular.otf",import.meta.url),italic:new URL("../fonts/LibertinusSerif-Italic.otf",import.meta.url),math:new URL("../fonts/LibertinusMath-Regular.otf",import.meta.url)},Mt=.324,Q={math:"'Pencil Serif', 'Pencil Math', Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif",sans:"'Pencil Sans', 'Pencil Math', system-ui, -apple-system, sans-serif"},ke=`
|
|
3
|
+
.label { position: absolute; left: 0; top: 0; white-space: nowrap; font-family: ${Q.sans}; line-height: 1; will-change: transform; font-kerning: none; font-variant-ligatures: none; font-feature-settings: "calt" 0; }
|
|
4
|
+
.label.math { font-family: ${Q.math}; font-style: italic; }
|
|
5
|
+
/* A label with mathematics in it is a point, with each run and rule the core laid out placed from
|
|
6
|
+
it. A run is set from the top of its line, and a stretched one grows about its baseline. */
|
|
7
|
+
.label.laid { width: 0; height: 0; }
|
|
8
|
+
.label .run { position: absolute; white-space: pre; line-height: 1; transform-origin: 0 ${(.5+Mt)*100}%; }
|
|
9
|
+
.label .run.formula { font-family: 'Pencil Math', ${Q.math}; font-style: normal; }
|
|
10
|
+
.label .rule { position: absolute; background: var(--rule); outline: var(--grow, 0px) solid var(--rule); }
|
|
11
|
+
`;function Et(){if(typeof document>"u"||typeof FontFace>"u")return Promise.resolve();let a=(t,n,r)=>{let _=new FontFace(t,`url("${n.href}")`,{style:r});return document.fonts.add(_),_},e=[a("Pencil Sans",J.sans,"normal"),a("Pencil Serif",J.italic,"italic")];return a("Pencil Math",J.math,"normal"),a("Pencil Math",J.math,"italic"),Promise.allSettled(e.map(t=>t.load())).then(()=>{})}var Me=Et(),X=class{constructor(e,t){this.stage=e,this.dpr=t,this.leaders=document.createElementNS(Ie,"svg"),this.leaders.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible",this.stage.append(this.leaders),this.halos=this.makeLayer(),this.glyphs=this.makeLayer(),this.ruler=document.createElement("canvas").getContext("2d"),this.items=new Map,this.advances=new Map,this.last=0,this.still=matchMedia("(prefers-reduced-motion: reduce)").matches}makeLayer(){let e=document.createElement("div");return e.style.cssText="position:absolute;inset:0;pointer-events:none",this.stage.append(e),e}measure=(e,t,n)=>{let r=n?"math":"sans",_=0;for(let i of e){let o=r+i,c=this.advances.get(o);c===void 0&&(this.ruler.font=`${n?"italic ":""}100px ${Q[r]}`,c=this.ruler.measureText(i).width/100,this.advances.set(o,c)),_+=c}return _*t};remeasure(){this.advances.clear()}update(e){let t=new Set;for(let n of e){t.add(n.id);let r=this.items.get(n.id),_=[n.x-n.anchorX,n.y-n.anchorY];if(!r){let f=document.createElement("span");f.className="label";let u=f.cloneNode();f.dataset.label=n.id,this.halos.append(u),this.glyphs.append(f);let l=document.createElementNS(Ie,"line");this.leaders.append(l),r={span:f,halo:u,line:l,offset:_.slice(),velocity:[0,0],shown:!1},this.items.set(n.id,r)}let{span:i,halo:o}=r;r.shown||(r.offset=_.slice(),r.velocity=[0,0],r.shown=!0),r.target=_,r.anchor=[n.anchorX,n.anchorY],r.settles=n.settles,r.leader=n.leader,r.text=n.text,r.size=n.size,r.math=n.math,r.line.style.stroke=n.color,r.line.style.opacity=n.opacity;let c=n.laid?JSON.stringify(n.laid):"";r.half=n.laid?[n.laid.halfWidth,n.laid.halfHeight]:null;for(let f of[i,o])n.laid?f.laid!==c&&this.lay(f,n.laid):(f.laid||f.textContent!==n.text)&&(f.textContent=n.text),f.laid=c,f.classList.toggle("laid",!!n.laid),f.hidden=!1,f.classList.toggle("math",n.math),f.style.fontSize=`${n.size/this.dpr}px`,f.style.opacity=n.opacity;i.style.color=n.color,i.style.setProperty("--rule",n.color),o.style.color="transparent",o.style.webkitTextStrokeColor=n.haloColor,o.style.webkitTextStrokeWidth=`${n.halo/this.dpr}px`,o.style.setProperty("--rule",n.halo>0?n.haloColor:"transparent"),o.style.setProperty("--grow",`${n.halo/2/this.dpr}px`)}for(let[n,r]of this.items)t.has(n)||(r.span.hidden=!0,r.halo.hidden=!0,r.line.style.display="none",r.shown=!1);this.place()}lay(e,t){let n=r=>`${r/this.dpr}px`;e.textContent="";for(let r of t.runs){let _=document.createElement("span");_.className=r.math?"run formula":"run",_.textContent=r.text,_.style.cssText=`left:${n(r.x)};top:${n(r.top)};font-size:${n(r.size)}`,r.stretch!==1&&(_.style.transform=`scaleY(${r.stretch})`),e.append(_)}for(let r of t.rules){let _=document.createElement("span");_.className="rule",_.style.cssText=`left:${n(r.x)};top:${n(r.y)};width:${n(r.width)};height:${n(r.height)}`,e.append(_)}}place(){for(let e of this.items.values()){if(!e.shown)continue;let[t,n]=[e.anchor[0]+e.offset[0],e.anchor[1]+e.offset[1]],r=`translate(${t/this.dpr}px, ${n/this.dpr}px) translate(-50%, -50%)`;e.span.style.transform=r,e.halo.style.transform=r,this.placeLeader(e,t,n)}}placeLeader(e,t,n){let{line:r,leader:_,anchor:i}=e,[o,c]=[t-i[0],n-i[1]],f=Math.hypot(o,c),u=-1/0;if(_&&f>0){let[l,w]=[o/f,c/f],A=e.half??[this.measure(e.text,e.size,e.math)/2,e.size*.35],D=Math.min(A[0]/Math.max(Math.abs(l),1e-9),A[1]/Math.max(Math.abs(w),1e-9));if(u=f-D-.25*e.size,u>_.gap){let U=me=>[(i[0]+l*me)/this.dpr,(i[1]+w*me)/this.dpr],[le,ge]=[U(_.gap),U(u)];r.setAttribute("x1",le[0]),r.setAttribute("y1",le[1]),r.setAttribute("x2",ge[0]),r.setAttribute("y2",ge[1]),r.style.strokeWidth=`${_.width/this.dpr}px`}}r.style.display=_&&u>(_?.gap??0)?"":"none"}tick(e){let t=Math.min((e-this.last)/1e3,.1);this.last=e;let n=!1;for(let r of this.items.values()){if(!r.shown)continue;if(!r.settles||this.still){r.offset=r.target.slice(),r.velocity=[0,0];continue}let _=Math.exp(-12*t);for(let i=0;i<2;i++){let o=r.offset[i]-r.target[i],c=(r.velocity[i]+12*o)*t;r.offset[i]=r.target[i]+(o+c)*_,r.velocity[i]=(r.velocity[i]-12*c)*_,(Math.abs(r.offset[i]-r.target[i])>.01||Math.abs(r.velocity[i])>.01)&&(n=!0)}}return this.place(),n}};function K(a){let e=window.devicePixelRatio||1,t=Math.max(1,Math.round(a.clientWidth*e)),n=Math.max(1,Math.round(a.clientHeight*e));return a.width!==t&&(a.width=t),a.height!==n&&(a.height=n),[t,n]}function Z(a){let e=getComputedStyle(a).colorScheme.split(/\s+/),t=e.includes("dark"),n=t===e.includes("light")?null:t?"dark":"light";for(let r of a.querySelectorAll("source[media], source[data-media]")){let _=r.dataset.media??r.getAttribute("media"),i=n?_.replace(/\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)/g,(o,c)=>c===n?"(min-width: 0px)":"(not (min-width: 0px))"):_;i===_?delete r.dataset.media:r.dataset.media=_,r.getAttribute("media")!==i&&r.setAttribute("media",i)}return n}var ee=new Set,Y=null;function Ee(a){Z(a),ee.add(a),Y??=new MutationObserver(()=>{for(let e of ee)Z(e)}),Y.observe(document.documentElement,{attributes:!0}),document.body&&Y.observe(document.body,{attributes:!0})}function De(a){ee.delete(a),ee.size||Y?.disconnect()}var Dt=10,Te=24,Tt="200px",Lt=async a=>{let e=await fetch(new URL(a,document.baseURI));if(!e.ok)throw new Error(`${a}: ${e.status}`);return e.text()},Ft=`
|
|
12
|
+
:host { display: block; }
|
|
13
|
+
:host([hidden]) { display: none; }
|
|
14
|
+
.stage { position: relative; overflow: hidden; width: 100%; }
|
|
15
|
+
canvas { display: block; width: 100%; aspect-ratio: var(--pencil-aspect, 16 / 9); outline: none; }
|
|
16
|
+
/* The poster: the element's children, until the first frame. It has the figure's shape, and the
|
|
17
|
+
canvas waits under it at the same size, so nothing moves when they swap. */
|
|
18
|
+
slot { display: none; }
|
|
19
|
+
.stage.waiting slot { display: block; }
|
|
20
|
+
.stage.waiting canvas { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; opacity: 0; }
|
|
21
|
+
::slotted(source) { display: none; }
|
|
22
|
+
::slotted(img), ::slotted(picture) { display: block; width: 100%; height: auto; }
|
|
23
|
+
.em { position: absolute; left: 0; top: 0; width: 1em; height: 0; visibility: hidden; pointer-events: none; }
|
|
24
|
+
/* Something to focus over each handle. The pointer goes through it to the canvas, which is where
|
|
25
|
+
a drag is taken, and a reader on a keyboard tabs to it and moves it with the arrow keys. Its
|
|
26
|
+
ring is two tones, so it shows on any paper. */
|
|
27
|
+
.handles { position: absolute; inset: 0; pointer-events: none; }
|
|
28
|
+
.handle { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; outline: none; will-change: transform; }
|
|
29
|
+
.handle:focus-visible { outline: 2px solid var(--pencil-focus, currentColor); outline-offset: 1px; box-shadow: 0 0 0 2px var(--pencil-focus-halo, Canvas); }
|
|
30
|
+
.handle[hidden] { display: none; }
|
|
31
|
+
.said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
32
|
+
${ke}`,Bt=a=>(a??"").split(";").map(e=>e.split(":").map(t=>t.trim())).filter(([e,t])=>e&&t!==void 0&&t!==""&&Number.isFinite(Number(t))).map(([e,t])=>[e,Number(t)]),de=class extends HTMLElement{static observedAttributes=["src","sheets","compiled","params"];static get ready(){return $()}#a;#t;#d;#L=0;#o;#b;#l=[];#g;#F=null;#B=!1;#m=null;#e=null;#h=!1;#w=0;#s=null;#S=!1;#C=null;#R=[];#c=null;#O=!1;#_=null;#p=new Set;#i=new Map;#r=null;#W=1;#n=0;#f=null;#y=!1;#x=0;#A=!0;#P=!1;#I=!1;#z=null;#k=null;constructor(){super();let e=this.attachShadow({mode:"open"}),t=document.createElement("style");t.textContent=Ft,this.#a=document.createElement("div"),this.#a.className="stage",this.#a.setAttribute("part","stage"),e.append(t,this.#a),this.#t=this.#Y(),this.#d=document.createElement("span"),this.#d.className="em",this.#d.setAttribute("aria-hidden","true"),this.#a.append(document.createElement("slot"),this.#t,this.#d),this.#o=new X(this.#a,window.devicePixelRatio||1),this.#b=document.createElement("div"),this.#b.className="handles",this.#g=document.createElement("div"),this.#g.className="said",this.#g.setAttribute("aria-live","polite"),this.#a.append(this.#b,this.#g),this.addEventListener("keydown",this.#he);try{this.#F=this.attachInternals()}catch{}}#X(){return[...this.children].some(e=>e.localName!=="source"&&e.localName!=="script")}#M(){this.#a.classList.toggle("waiting",!this.#S&&this.#X())}#ae(){for(let e of this.querySelectorAll(":scope > source")){let t=e.getAttribute("media");if(!t||matchMedia(t).matches)return e}return this}#G(){for(let[e,t]of this.#R)e.removeEventListener("change",t);if(this.#R=[],!!this.isConnected)for(let e of this.querySelectorAll(":scope > source[media]")){let t=matchMedia(e.getAttribute("media")),n=()=>this.#E();t.addEventListener("change",n),this.#R.push([t,n])}}#E(){(this.#y||!this.#X())&&this.#V()}connectedCallback(){this.#f??=this.hasAttribute("paused")||matchMedia("(prefers-reduced-motion: reduce)").matches,this.#r||(this.#r=this.animate([],{id:this.#U(),duration:this.duration*1e3,iterations:1/0}),this.#r.pause(),this.#r.currentTime=this.#n*1e3,this.#r.playbackRate=this.#W),this.#z=new IntersectionObserver(e=>{this.#y=e[e.length-1].isIntersecting,this.#y&&(this.#V(),this.#oe()),this.#v()},{rootMargin:Tt}),this.#z.observe(this),this.#k=new ResizeObserver(()=>this.#ie()),this.#k.observe(this.#t),this.#k.observe(this.#d),this.#C=new MutationObserver(()=>{Z(this),this.#M(),this.#G(),this.#E()}),this.#C.observe(this,{childList:!0,attributes:!0,subtree:!0,attributeFilter:["media","src","sheets","compiled"]}),document.fonts?.addEventListener("loadingdone",this.#K),Ee(this),this.#M(),this.#G(),this.#E()}#K=()=>{this.#o.remeasure(),this.#e?.set_measure(this.#o.measure),this.#u()};disconnectedCallback(){document.fonts?.removeEventListener("loadingdone",this.#K),this.#z?.disconnect(),this.#k?.disconnect(),this.#C?.disconnect(),De(this),this.#G(),this.#y=!1,this.#v(),queueMicrotask(()=>{this.isConnected||this.#se()})}attributeChangedCallback(e){if(e==="params")for(let[t,n]of Bt(this.getAttribute("params")))this.hold(t,n);else this.#E()}#Y(){let e=document.createElement("canvas");return e.setAttribute("part","canvas"),this.#m&&e.style.setProperty("--pencil-aspect",`${this.#m[0]} / ${this.#m[1]}`),e.addEventListener("pointerdown",this.#ue),e.addEventListener("pointermove",this.#be),e.addEventListener("pointerup",this.#ee),e.addEventListener("pointercancel",this.#ee),e.addEventListener("mousedown",t=>{this.#e?.grabbed()>=0&&t.preventDefault()}),e}async#oe(){if(this.#e||this.#h)return;this.#h=!0;let e=this.#w;try{if(await Promise.all([$(),Me]),e!==this.#w)return;K(this.#t);let t=await I.create(this.#t,this.hasAttribute("gl"));if(e!==this.#w){t.destroy();return}if(this.#e=t,t.set_measure(this.#o.measure),this.#_e(),this.#s)try{this.#N(this.#s)}catch(n){this.#D(n)}}catch(t){this.#D(t)}finally{e===this.#w&&(this.#h=!1)}}#se(){this.#n=this.time,this.#r?.cancel(),this.#r=null,cancelAnimationFrame(this.#x),this.#x=0,this.#A=!0;let e=this.#e||this.#h;if(this.#w+=1,this.#h=!1,this.#e){let t=this.#e.backend==="Gl";this.#e.destroy(),this.#e=null,t?this.#t.getContext("webgl2")?.getExtension("WEBGL_lose_context")?.loseContext():this.#t.getContext("webgpu")?.unconfigure()}if(e){let t=this.#Y();this.#t.replaceWith(t),this.#t=t,this.#S=!1,this.#M()}}#V(){this.#O||(this.#O=!0,queueMicrotask(()=>{this.#O=!1,this.isConnected&&this.#ce()}))}reload(){this.#c=null,this.#V()}async#ce(){let e=this.#ae(),t=e.getAttribute("compiled");if(t){let i=JSON.stringify(["compiled",t]);if(i===this.#c)return;this.#c=i,this.#r&&(this.#r.id=this.#U());try{let o=new URL(t,document.baseURI),c=null,f=await ue(o.href);if(f)try{c=new Uint8Array(await f.arrayBuffer())}catch{}if(!c){let u=await fetch(o);if(!u.ok)throw new Error(`${t}: ${u.status}`);c=new Uint8Array(await u.arrayBuffer())}if(await $(),i!==this.#c)return;this.loadCompiled(c)}catch(o){this.#D(o)}return}let n=e.getAttribute("src")??this.getAttribute("src");if(!n)return;let r=(e.getAttribute("sheets")??this.getAttribute("sheets")??"").split(/\s+/).filter(Boolean),_=JSON.stringify([n,r]);if(_!==this.#c){this.#c=_,this.#r&&(this.#r.id=this.#U());try{let i=[n,...r],o=await Promise.all(i.map(Lt)),c=await Pe(i,o);if(_!==this.#c)return;let[f,...u]=o;this.load(f,u,c)}catch(i){this.#D(i)}}}load(e,t=[],n={}){let r={doc:e,sheets:t,names:n.names??[],files:n.files??{}};this.#e?this.#N(r):be()?(this.#$(JSON.parse(ae(e,t,r.names,r.files))),this.#s=r):this.#s=r}loadCompiled(e){let t={compiled:e};this.#e?this.#N(t):be()?(this.#$(JSON.parse(oe(e))),this.#s=t):this.#s=t}#N(e){e.compiled?this.#e.load_compiled(e.compiled):this.#e.load(e.doc,e.sheets,e.names,e.files),this.#s=e;let t=JSON.parse(this.#e.info());this.#_=t,this.#p=new Set(t.timeDriven),this.#$(t.size);for(let[n,r]of this.#i)t.params.some(_=>_.id===n)?this.#e.set_param(n,r):this.#i.delete(n);this.#fe(),this.#de(),this.#I=!0,this.#u(),this.#v(),this.dispatchEvent(new Event("load"))}#$(e){this.#m=e,this.#t.style.setProperty("--pencil-aspect",`${e[0]} / ${e[1]}`),this.#ie()}#U(){let e=this.getAttribute("src")??this.getAttribute("compiled");return`pencil ${this.id||(e?e.split("/").pop():"figure")}`}#D(e){this.dispatchEvent(new CustomEvent("error",{detail:{error:e,time:this.#n,fresh:this.#I}}))}get duration(){return this.#_?.duration??Dt}get time(){return this.#n}set time(e){this.#j(e),this.#p.has("beat")&&this.#H("beat"),this.#u()}get paused(){return this.#f??!0}play(){let e=[...this.#i.keys()].filter(n=>this.#p.has(n)).pop();if(e&&this.#e)try{this.#j(this.#e.time_for(e,this.#i.get(e)))}catch{}for(let n of[...this.#i.keys()])this.#p.has(n)&&this.#H(n);let t=this.#f;this.#f=!1,this.#v(),this.#u(),t!==!1&&this.dispatchEvent(new Event("play"))}pause(){let e=this.#f;this.#f=!0,this.#v(),e!==!0&&this.dispatchEvent(new Event("pause"))}get playbackRate(){return this.#W}set playbackRate(e){this.#W=e,this.#r&&(this.#r.playbackRate=e)}get clock(){return this.#r}#q(){return(this.#r?.effect.getComputedTiming().progress??0)*this.duration}#j(e){this.#n=Math.min(Math.max(0,e),this.duration),this.#r&&(this.#r.currentTime=this.#n*1e3)}#fe(){if(!this.#r)return;let e=this.#r.playState==="running"?this.#q():this.#n;this.#r.effect.updateTiming({duration:this.duration*1e3}),this.#j(e>this.duration?e%this.duration:e)}#v(){let e=this.#r;if(!e)return;let t=this.#f===!1&&this.#y&&!!this.#e&&!!this.#_?.usesTime,n=e.playState==="running";t&&!n?(e.currentTime=this.#n*1e3,e.play(),this.#Q()):!t&&n&&(this.#n=this.#q(),e.pause())}get beat(){return this.value("beat")}set beat(e){let t=this.#_?.params.find(_=>_.id==="beat");if(!t)return;if(e=Math.min(Math.max(t.min,e),t.max),!this.#p.has("beat")){this.hold("beat",e);return}let[n,r]=[0,this.duration];for(let _=0;_<40;_++){let i=(n+r)/2;this.#T("beat",i)>=e-1e-9?r=i:n=i}this.time=r}step(e){let t=this.beat;Number.isFinite(t)&&(this.pause(),this.beat=e>0?Math.floor(t+1e-6)+e:Math.ceil(t-1e-6)+e)}value(e,t=this.#n){return this.#T(e,t)}#T(e,t){if(!this.#e||!this.#_)return NaN;try{return this.#e.value(e,t)}catch{return NaN}}range(e,t=this.#n){let n=this.#_?.params.find(r=>r.id===e);if(!n)return[NaN,NaN];if(!n.follows?.length||!this.#e)return[n.min,n.max];try{return Array.from(this.#e.range(e,t))}catch{return[n.min,n.max]}}hold(e,t){this.#i.delete(e),this.#i.set(e,t),this.#e?.set_param(e,t),this.#u()}release(e){for(let t of e===void 0?[...this.#i.keys()]:[e])this.#H(t);this.#u()}#H(e){this.#i.delete(e),this.#e?.release_param(e)}get held(){return new Map(this.#i)}get params(){return Object.fromEntries((this.#_?.params??[]).map(e=>[e.id,this.value(e.id)]))}set params(e){for(let[t,n]of Object.entries(e))this.hold(t,n)}get designSize(){return this.#m}get info(){return this.#_}get colors(){return this.#_?.colors??{}}get player(){return this.#e}get backend(){return this.#e?.backend??null}#Z(e){let t=this.#t.getBoundingClientRect();return[(e.clientX-t.left)*(this.#t.width/t.width),(e.clientY-t.top)*(this.#t.height/t.height)]}#ue=e=>{if(!this.#e)return;let[t,n]=this.#Z(e);try{if(!this.#e.grab(this.#n,t,n,Te*(window.devicePixelRatio||1)))return;this.pause(),this.#t.setPointerCapture(e.pointerId),this.#t.style.cursor="grabbing",this.#l[this.#e.grabbed()]?.focus({preventScroll:!0}),this.#te(t,n)}catch{}};#be=e=>{if(!this.#e)return;let[t,n]=this.#Z(e);try{if(!this.#t.hasPointerCapture(e.pointerId)){this.#t.style.cursor=this.#e.grab(this.#n,t,n,Te*(window.devicePixelRatio||1))?"grab":"",this.#e.release();return}this.#te(t,n)}catch{}};#ee=e=>{this.#t.hasPointerCapture(e.pointerId)&&this.#t.releasePointerCapture(e.pointerId),this.#e?.release(),this.#t.style.cursor=""};#te(e,t){this.#J(this.#e.drag(this.#n,e,t))}#J(e){if(!e)return;let t=this.#e.value(e,this.#n);this.#i.delete(e),this.#i.set(e,t),this.#u(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{name:e,value:t}}))}#ne(){let e=this.#_;return!!e&&e.beats.length>0&&e.params.some(t=>t.id==="beat")}#de(){let e=this.#_.handles??[],t=JSON.stringify(e);this.#b.dataset.for!==t&&(this.#b.dataset.for=t,this.#l=e.map((_,i)=>{let o=document.createElement("div");return o.className="handle",o.setAttribute("part","handle"),o.setAttribute("role","slider"),o.setAttribute("aria-label",_.mark),o.tabIndex=0,o.hidden=!0,o.addEventListener("keydown",c=>this.#me(c,i)),o}),this.#b.replaceChildren(...this.#l));let n=this.#ne();n&&!this.hasAttribute("tabindex")?(this.tabIndex=0,this.#B=!0):!n&&this.#B&&(this.removeAttribute("tabindex"),this.#B=!1);let r=this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby");this.#F&&(this.#F.role=n||e.length?"group":r?"img":null)}#le(){if(!this.#l.length)return;let e;try{e=this.#e.handle_places(this.#n)}catch{return}let t=this.#t.clientWidth/this.#t.width;this.#l.forEach((n,r)=>{let[_,i]=[e[2*r]*t,e[2*r+1]*t],o=Number.isFinite(_)&&Number.isFinite(i);if(n.hidden===o&&(n.hidden=!o),!o)return;let c=`translate(${_.toFixed(2)}px, ${i.toFixed(2)}px)`;n.style.transform!==c&&(n.style.transform=c);let f=this.#_.handles[r].param,u=this.#T(f,this.#n),[l,w]=this.range(f),A=[l,w,u].join(" ");n.dataset.said!==A&&(n.dataset.said=A,n.setAttribute("aria-valuemin",String(l)),n.setAttribute("aria-valuemax",String(w)),n.setAttribute("aria-valuenow",String(u)),n.setAttribute("aria-valuetext",`${f} = ${this.#ge(f,u)}`))})}#ge(e,t){let n=this.#_?.params.find(r=>r.id===e)?.step;return n!=null?t.toFixed((String(n).split(".")[1]??"").length):String(Number(t.toFixed(3)))}#me(e,t){if(!this.#e||e.altKey||e.ctrlKey||e.metaKey)return;let n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key],r=this.#_.handles[t].param;try{if(n){let{width:_,height:i}=this.#t,o=Math.max(Math.min(_,i)/100,2*(window.devicePixelRatio||1))*(e.shiftKey?10:1);this.pause(),this.#J(this.#e.nudge(this.#n,t,n[0]*o,n[1]*o))}else if(["Home","End","PageUp","PageDown"].includes(e.key)){let[_,i]=this.range(r),o=this.#T(r,this.#n),c={Home:_,End:i,PageUp:o+(i-_)/10,PageDown:o-(i-_)/10}[e.key];this.pause(),this.#e.set_param(r,c),this.#J(r)}else return}catch{return}e.preventDefault(),e.stopPropagation()}#he=e=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||!this.#e||!this.#ne())return;let t=this.#_.params.find(c=>c.id==="beat");if(e.key==="ArrowRight")this.step(1);else if(e.key==="ArrowLeft")this.step(-1);else if(e.key==="Home"||e.key==="End")this.pause(),this.beat=e.key==="Home"?t.min:t.max;else return;e.preventDefault();let n=this.#_.beats,r=this.beat,_=(this.#_.beatLengths?.length??0)>0,i=Math.round(_?r:r+1),o=n[i-1]??"";this.#g.textContent=i<1?"Start":`Step ${i} of ${n.length}${o?`: ${o}`:""}`};#u(){this.#P=!0,this.#Q()}#Q(){this.#x||!this.#e||!this.isConnected||(this.#x=requestAnimationFrame(this.#we))}#we=e=>{this.#x=0,this.#A&&(this.#o.last=e-1e3/60);let t=this.#r?.playState==="running";t&&(this.#n=this.#q(),this.#P=!0),this.#P&&this.#re();let n=this.#o.tick(e);this.#A=!t&&!n,this.#A||this.#Q()};#re(){if(this.#P=!1,!this.#e||!this.#_)return;let e=this.#I;this.#I=!1;let t=window.devicePixelRatio||1;this.#o.dpr=t;try{this.#o.update(JSON.parse(this.#e.draw(this.#n,t)))}catch(n){this.pause(),this.dispatchEvent(new CustomEvent("error",{detail:{error:n,time:this.#n,fresh:e}}));return}this.#S||(this.#S=!0,this.#M()),this.#le(),this.dispatchEvent(new CustomEvent("draw",{detail:{time:this.#n,fresh:e}}))}#_e(){let e=parseFloat(getComputedStyle(this.#t).fontSize),t=e!==this.#L;return this.#L=e,this.#e?.set_em(e),t}#ie(){if(!this.#e){K(this.#t);return}let[e,t]=[this.#t.width,this.#t.height];this.#e.resize(...K(this.#t)),(this.#_e()||this.#t.width!==e||this.#t.height!==t)&&(this.#re(),this.dispatchEvent(new CustomEvent("resize",{detail:{em:this.#L}})))}};customElements.define("pencil-figure",de);export{de as PencilFigure,I as Player,ue as ahead,ae as figure_size,oe as figure_size_compiled,Le as fingerprint,Fe as from_latex,Be as functions,Pe as gather,Ce as inspect,be as isReady,Re as is_latex,Oe as named_colors,$ as ready,We as symbols,se as uses};
|