radames commited on
Commit
c18de0d
1 Parent(s): f9b7275

add new UI and runtime

Browse files
app-52a2b5a177502aae.js DELETED
@@ -1,903 +0,0 @@
1
- let wasm;
2
-
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let heap_next = heap.length;
10
-
11
- function dropObject(idx) {
12
- if (idx < 132) return;
13
- heap[idx] = heap_next;
14
- heap_next = idx;
15
- }
16
-
17
- function takeObject(idx) {
18
- const ret = getObject(idx);
19
- dropObject(idx);
20
- return ret;
21
- }
22
-
23
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
24
-
25
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
26
-
27
- let cachedUint8Memory0 = null;
28
-
29
- function getUint8Memory0() {
30
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
31
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
32
- }
33
- return cachedUint8Memory0;
34
- }
35
-
36
- function getStringFromWasm0(ptr, len) {
37
- ptr = ptr >>> 0;
38
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
39
- }
40
-
41
- function addHeapObject(obj) {
42
- if (heap_next === heap.length) heap.push(heap.length + 1);
43
- const idx = heap_next;
44
- heap_next = heap[idx];
45
-
46
- heap[idx] = obj;
47
- return idx;
48
- }
49
-
50
- function debugString(val) {
51
- // primitive types
52
- const type = typeof val;
53
- if (type == 'number' || type == 'boolean' || val == null) {
54
- return `${val}`;
55
- }
56
- if (type == 'string') {
57
- return `"${val}"`;
58
- }
59
- if (type == 'symbol') {
60
- const description = val.description;
61
- if (description == null) {
62
- return 'Symbol';
63
- } else {
64
- return `Symbol(${description})`;
65
- }
66
- }
67
- if (type == 'function') {
68
- const name = val.name;
69
- if (typeof name == 'string' && name.length > 0) {
70
- return `Function(${name})`;
71
- } else {
72
- return 'Function';
73
- }
74
- }
75
- // objects
76
- if (Array.isArray(val)) {
77
- const length = val.length;
78
- let debug = '[';
79
- if (length > 0) {
80
- debug += debugString(val[0]);
81
- }
82
- for(let i = 1; i < length; i++) {
83
- debug += ', ' + debugString(val[i]);
84
- }
85
- debug += ']';
86
- return debug;
87
- }
88
- // Test for built-in
89
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
90
- let className;
91
- if (builtInMatches.length > 1) {
92
- className = builtInMatches[1];
93
- } else {
94
- // Failed to match the standard '[object ClassName]'
95
- return toString.call(val);
96
- }
97
- if (className == 'Object') {
98
- // we're a user defined class or Object
99
- // JSON.stringify avoids problems with cycles, and is generally much
100
- // easier than looping through ownProperties of `val`.
101
- try {
102
- return 'Object(' + JSON.stringify(val) + ')';
103
- } catch (_) {
104
- return 'Object';
105
- }
106
- }
107
- // errors
108
- if (val instanceof Error) {
109
- return `${val.name}: ${val.message}\n${val.stack}`;
110
- }
111
- // TODO we could test for more things here, like `Set`s and `Map`s.
112
- return className;
113
- }
114
-
115
- let WASM_VECTOR_LEN = 0;
116
-
117
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
118
-
119
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
120
- ? function (arg, view) {
121
- return cachedTextEncoder.encodeInto(arg, view);
122
- }
123
- : function (arg, view) {
124
- const buf = cachedTextEncoder.encode(arg);
125
- view.set(buf);
126
- return {
127
- read: arg.length,
128
- written: buf.length
129
- };
130
- });
131
-
132
- function passStringToWasm0(arg, malloc, realloc) {
133
-
134
- if (realloc === undefined) {
135
- const buf = cachedTextEncoder.encode(arg);
136
- const ptr = malloc(buf.length, 1) >>> 0;
137
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
138
- WASM_VECTOR_LEN = buf.length;
139
- return ptr;
140
- }
141
-
142
- let len = arg.length;
143
- let ptr = malloc(len, 1) >>> 0;
144
-
145
- const mem = getUint8Memory0();
146
-
147
- let offset = 0;
148
-
149
- for (; offset < len; offset++) {
150
- const code = arg.charCodeAt(offset);
151
- if (code > 0x7F) break;
152
- mem[ptr + offset] = code;
153
- }
154
-
155
- if (offset !== len) {
156
- if (offset !== 0) {
157
- arg = arg.slice(offset);
158
- }
159
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
160
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
161
- const ret = encodeString(arg, view);
162
-
163
- offset += ret.written;
164
- }
165
-
166
- WASM_VECTOR_LEN = offset;
167
- return ptr;
168
- }
169
-
170
- let cachedInt32Memory0 = null;
171
-
172
- function getInt32Memory0() {
173
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
174
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
175
- }
176
- return cachedInt32Memory0;
177
- }
178
-
179
- function makeClosure(arg0, arg1, dtor, f) {
180
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
181
- const real = (...args) => {
182
- // First up with a closure we increment the internal reference
183
- // count. This ensures that the Rust closure environment won't
184
- // be deallocated while we're invoking it.
185
- state.cnt++;
186
- try {
187
- return f(state.a, state.b, ...args);
188
- } finally {
189
- if (--state.cnt === 0) {
190
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
191
- state.a = 0;
192
-
193
- }
194
- }
195
- };
196
- real.original = state;
197
-
198
- return real;
199
- }
200
- function __wbg_adapter_18(arg0, arg1, arg2) {
201
- wasm.wasm_bindgen__convert__closures__invoke1__h3852d9455ff9739e(arg0, arg1, addHeapObject(arg2));
202
- }
203
-
204
- function makeMutClosure(arg0, arg1, dtor, f) {
205
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
206
- const real = (...args) => {
207
- // First up with a closure we increment the internal reference
208
- // count. This ensures that the Rust closure environment won't
209
- // be deallocated while we're invoking it.
210
- state.cnt++;
211
- const a = state.a;
212
- state.a = 0;
213
- try {
214
- return f(a, state.b, ...args);
215
- } finally {
216
- if (--state.cnt === 0) {
217
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
218
-
219
- } else {
220
- state.a = a;
221
- }
222
- }
223
- };
224
- real.original = state;
225
-
226
- return real;
227
- }
228
-
229
- let stack_pointer = 128;
230
-
231
- function addBorrowedObject(obj) {
232
- if (stack_pointer == 1) throw new Error('out of js stack');
233
- heap[--stack_pointer] = obj;
234
- return stack_pointer;
235
- }
236
- function __wbg_adapter_21(arg0, arg1, arg2) {
237
- try {
238
- wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha9364e9f993015fa(arg0, arg1, addBorrowedObject(arg2));
239
- } finally {
240
- heap[stack_pointer++] = undefined;
241
- }
242
- }
243
-
244
- function __wbg_adapter_24(arg0, arg1, arg2) {
245
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h93a8c686e0ffa704(arg0, arg1, addHeapObject(arg2));
246
- }
247
-
248
- function isLikeNone(x) {
249
- return x === undefined || x === null;
250
- }
251
-
252
- let cachedUint32Memory0 = null;
253
-
254
- function getUint32Memory0() {
255
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
256
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
257
- }
258
- return cachedUint32Memory0;
259
- }
260
-
261
- function getArrayJsValueFromWasm0(ptr, len) {
262
- ptr = ptr >>> 0;
263
- const mem = getUint32Memory0();
264
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
265
- const result = [];
266
- for (let i = 0; i < slice.length; i++) {
267
- result.push(takeObject(slice[i]));
268
- }
269
- return result;
270
- }
271
-
272
- function handleError(f, args) {
273
- try {
274
- return f.apply(this, args);
275
- } catch (e) {
276
- wasm.__wbindgen_exn_store(addHeapObject(e));
277
- }
278
- }
279
-
280
- async function __wbg_load(module, imports) {
281
- if (typeof Response === 'function' && module instanceof Response) {
282
- if (typeof WebAssembly.instantiateStreaming === 'function') {
283
- try {
284
- return await WebAssembly.instantiateStreaming(module, imports);
285
-
286
- } catch (e) {
287
- if (module.headers.get('Content-Type') != 'application/wasm') {
288
- 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", e);
289
-
290
- } else {
291
- throw e;
292
- }
293
- }
294
- }
295
-
296
- const bytes = await module.arrayBuffer();
297
- return await WebAssembly.instantiate(bytes, imports);
298
-
299
- } else {
300
- const instance = await WebAssembly.instantiate(module, imports);
301
-
302
- if (instance instanceof WebAssembly.Instance) {
303
- return { instance, module };
304
-
305
- } else {
306
- return instance;
307
- }
308
- }
309
- }
310
-
311
- function __wbg_get_imports() {
312
- const imports = {};
313
- imports.wbg = {};
314
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
315
- takeObject(arg0);
316
- };
317
- imports.wbg.__wbg_log_65d20c5d9fc43b86 = function(arg0, arg1) {
318
- console.log(getStringFromWasm0(arg0, arg1));
319
- };
320
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
321
- const ret = getStringFromWasm0(arg0, arg1);
322
- return addHeapObject(ret);
323
- };
324
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
325
- const ret = getObject(arg0);
326
- return addHeapObject(ret);
327
- };
328
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
329
- const obj = takeObject(arg0).original;
330
- if (obj.cnt-- == 1) {
331
- obj.a = 0;
332
- return true;
333
- }
334
- const ret = false;
335
- return ret;
336
- };
337
- imports.wbg.__wbg_cachekey_b61393159c57fd7b = function(arg0, arg1) {
338
- const ret = getObject(arg1).__yew_subtree_cache_key;
339
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
340
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
341
- };
342
- imports.wbg.__wbg_subtreeid_e348577f7ef777e3 = function(arg0, arg1) {
343
- const ret = getObject(arg1).__yew_subtree_id;
344
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
345
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
346
- };
347
- imports.wbg.__wbg_setsubtreeid_d32e6327eef1f7fc = function(arg0, arg1) {
348
- getObject(arg0).__yew_subtree_id = arg1 >>> 0;
349
- };
350
- imports.wbg.__wbg_setcachekey_80183b7cfc421143 = function(arg0, arg1) {
351
- getObject(arg0).__yew_subtree_cache_key = arg1 >>> 0;
352
- };
353
- imports.wbg.__wbg_listenerid_12315eee21527820 = function(arg0, arg1) {
354
- const ret = getObject(arg1).__yew_listener_id;
355
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
356
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
357
- };
358
- imports.wbg.__wbg_setlistenerid_3183aae8fa5840fb = function(arg0, arg1) {
359
- getObject(arg0).__yew_listener_id = arg1 >>> 0;
360
- };
361
- imports.wbg.__wbg_error_71d6845bf00a930f = function(arg0, arg1) {
362
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
363
- wasm.__wbindgen_free(arg0, arg1 * 4);
364
- console.error(...v0);
365
- };
366
- imports.wbg.__wbg_warn_0b90a269a514ae1d = function(arg0, arg1) {
367
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
368
- wasm.__wbindgen_free(arg0, arg1 * 4);
369
- console.warn(...v0);
370
- };
371
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
372
- const ret = new Error();
373
- return addHeapObject(ret);
374
- };
375
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
376
- const ret = getObject(arg1).stack;
377
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
378
- const len1 = WASM_VECTOR_LEN;
379
- getInt32Memory0()[arg0 / 4 + 1] = len1;
380
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
381
- };
382
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
383
- let deferred0_0;
384
- let deferred0_1;
385
- try {
386
- deferred0_0 = arg0;
387
- deferred0_1 = arg1;
388
- console.error(getStringFromWasm0(arg0, arg1));
389
- } finally {
390
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
391
- }
392
- };
393
- imports.wbg.__wbg_location_7ac41949b772ef21 = function(arg0) {
394
- const ret = getObject(arg0).location;
395
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
396
- };
397
- imports.wbg.__wbg_body_674aec4c1c0910cd = function(arg0) {
398
- const ret = getObject(arg0).body;
399
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
400
- };
401
- imports.wbg.__wbg_createElement_4891554b28d3388b = function() { return handleError(function (arg0, arg1, arg2) {
402
- const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
403
- return addHeapObject(ret);
404
- }, arguments) };
405
- imports.wbg.__wbg_createElementNS_119acf9e82482041 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
406
- const ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
407
- return addHeapObject(ret);
408
- }, arguments) };
409
- imports.wbg.__wbg_createTextNode_2fd22cd7e543f938 = function(arg0, arg1, arg2) {
410
- const ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
411
- return addHeapObject(ret);
412
- };
413
- imports.wbg.__wbg_getElementById_cc0e0d931b0d9a28 = function(arg0, arg1, arg2) {
414
- const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
415
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
416
- };
417
- imports.wbg.__wbg_instanceof_Window_9029196b662bc42a = function(arg0) {
418
- let result;
419
- try {
420
- result = getObject(arg0) instanceof Window;
421
- } catch {
422
- result = false;
423
- }
424
- const ret = result;
425
- return ret;
426
- };
427
- imports.wbg.__wbg_document_f7ace2b956f30a4f = function(arg0) {
428
- const ret = getObject(arg0).document;
429
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
430
- };
431
- imports.wbg.__wbg_location_56243dba507f472d = function(arg0) {
432
- const ret = getObject(arg0).location;
433
- return addHeapObject(ret);
434
- };
435
- imports.wbg.__wbg_performance_2c295061c8b01e0b = function(arg0) {
436
- const ret = getObject(arg0).performance;
437
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
438
- };
439
- imports.wbg.__wbg_fetch_336b6f0cb426b46e = function(arg0, arg1) {
440
- const ret = getObject(arg0).fetch(getObject(arg1));
441
- return addHeapObject(ret);
442
- };
443
- imports.wbg.__wbg_newwithstrsequenceandoptions_fd88a547f6d15707 = function() { return handleError(function (arg0, arg1) {
444
- const ret = new Blob(getObject(arg0), getObject(arg1));
445
- return addHeapObject(ret);
446
- }, arguments) };
447
- imports.wbg.__wbg_arrayBuffer_27cefaea55cbf063 = function(arg0) {
448
- const ret = getObject(arg0).arrayBuffer();
449
- return addHeapObject(ret);
450
- };
451
- imports.wbg.__wbg_value_3c5f08ffc2b7d6f9 = function(arg0, arg1) {
452
- const ret = getObject(arg1).value;
453
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
454
- const len1 = WASM_VECTOR_LEN;
455
- getInt32Memory0()[arg0 / 4 + 1] = len1;
456
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
457
- };
458
- imports.wbg.__wbg_setvalue_0dc100d4b9908028 = function(arg0, arg1, arg2) {
459
- getObject(arg0).value = getStringFromWasm0(arg1, arg2);
460
- };
461
- imports.wbg.__wbg_setchecked_e5a50baea447b8a8 = function(arg0, arg1) {
462
- getObject(arg0).checked = arg1 !== 0;
463
- };
464
- imports.wbg.__wbg_value_9423da9d988ee8cf = function(arg0, arg1) {
465
- const ret = getObject(arg1).value;
466
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
- const len1 = WASM_VECTOR_LEN;
468
- getInt32Memory0()[arg0 / 4 + 1] = len1;
469
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
470
- };
471
- imports.wbg.__wbg_setvalue_1f95e61cbc382f7f = function(arg0, arg1, arg2) {
472
- getObject(arg0).value = getStringFromWasm0(arg1, arg2);
473
- };
474
- imports.wbg.__wbg_setonmessage_f0bd0280573b7084 = function(arg0, arg1) {
475
- getObject(arg0).onmessage = getObject(arg1);
476
- };
477
- imports.wbg.__wbg_new_8e7322f46d5d019c = function() { return handleError(function (arg0, arg1) {
478
- const ret = new Worker(getStringFromWasm0(arg0, arg1));
479
- return addHeapObject(ret);
480
- }, arguments) };
481
- imports.wbg.__wbg_newwithoptions_1bd20b45061ed935 = function() { return handleError(function (arg0, arg1, arg2) {
482
- const ret = new Worker(getStringFromWasm0(arg0, arg1), getObject(arg2));
483
- return addHeapObject(ret);
484
- }, arguments) };
485
- imports.wbg.__wbg_postMessage_8c609e2bde333d9c = function() { return handleError(function (arg0, arg1) {
486
- getObject(arg0).postMessage(getObject(arg1));
487
- }, arguments) };
488
- imports.wbg.__wbg_instanceof_HtmlImageElement_7654818e144eb606 = function(arg0) {
489
- let result;
490
- try {
491
- result = getObject(arg0) instanceof HTMLImageElement;
492
- } catch {
493
- result = false;
494
- }
495
- const ret = result;
496
- return ret;
497
- };
498
- imports.wbg.__wbg_width_e64ae54f1609bb76 = function(arg0) {
499
- const ret = getObject(arg0).width;
500
- return ret;
501
- };
502
- imports.wbg.__wbg_height_5ee3e7570341fe45 = function(arg0) {
503
- const ret = getObject(arg0).height;
504
- return ret;
505
- };
506
- imports.wbg.__wbg_newwithstrandinit_cad5cd6038c7ff5d = function() { return handleError(function (arg0, arg1, arg2) {
507
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
508
- return addHeapObject(ret);
509
- }, arguments) };
510
- imports.wbg.__wbg_debug_9b8701f894da9929 = function(arg0, arg1, arg2, arg3) {
511
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
512
- };
513
- imports.wbg.__wbg_error_788ae33f81d3b84b = function(arg0) {
514
- console.error(getObject(arg0));
515
- };
516
- imports.wbg.__wbg_error_d9bce418caafb712 = function(arg0, arg1, arg2, arg3) {
517
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
518
- };
519
- imports.wbg.__wbg_info_bb52f40b06f679de = function(arg0, arg1, arg2, arg3) {
520
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
521
- };
522
- imports.wbg.__wbg_log_ea7093e35e3efd07 = function(arg0, arg1, arg2, arg3) {
523
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
524
- };
525
- imports.wbg.__wbg_warn_dfc0e0cf544a13bd = function(arg0, arg1, arg2, arg3) {
526
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
527
- };
528
- imports.wbg.__wbg_instanceof_Element_4622f5da1249a3eb = function(arg0) {
529
- let result;
530
- try {
531
- result = getObject(arg0) instanceof Element;
532
- } catch {
533
- result = false;
534
- }
535
- const ret = result;
536
- return ret;
537
- };
538
- imports.wbg.__wbg_namespaceURI_31718ed49b5343a3 = function(arg0, arg1) {
539
- const ret = getObject(arg1).namespaceURI;
540
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
541
- var len1 = WASM_VECTOR_LEN;
542
- getInt32Memory0()[arg0 / 4 + 1] = len1;
543
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
544
- };
545
- imports.wbg.__wbg_setinnerHTML_b089587252408b67 = function(arg0, arg1, arg2) {
546
- getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2);
547
- };
548
- imports.wbg.__wbg_outerHTML_f7749ceff37b5832 = function(arg0, arg1) {
549
- const ret = getObject(arg1).outerHTML;
550
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
551
- const len1 = WASM_VECTOR_LEN;
552
- getInt32Memory0()[arg0 / 4 + 1] = len1;
553
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
554
- };
555
- imports.wbg.__wbg_children_27ed308801b57d3f = function(arg0) {
556
- const ret = getObject(arg0).children;
557
- return addHeapObject(ret);
558
- };
559
- imports.wbg.__wbg_removeAttribute_d8404da431968808 = function() { return handleError(function (arg0, arg1, arg2) {
560
- getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2));
561
- }, arguments) };
562
- imports.wbg.__wbg_setAttribute_e7e80b478b7b8b2f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
563
- getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
564
- }, arguments) };
565
- imports.wbg.__wbg_instanceof_CanvasRenderingContext2d_bc0a6635c96eca9b = function(arg0) {
566
- let result;
567
- try {
568
- result = getObject(arg0) instanceof CanvasRenderingContext2D;
569
- } catch {
570
- result = false;
571
- }
572
- const ret = result;
573
- return ret;
574
- };
575
- imports.wbg.__wbg_setstrokeStyle_3fe4d1c0d11ed1b6 = function(arg0, arg1) {
576
- getObject(arg0).strokeStyle = getObject(arg1);
577
- };
578
- imports.wbg.__wbg_setfillStyle_401fa583a1c8863c = function(arg0, arg1) {
579
- getObject(arg0).fillStyle = getObject(arg1);
580
- };
581
- imports.wbg.__wbg_drawImage_9758fa4c03ab8fc8 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
582
- getObject(arg0).drawImage(getObject(arg1), arg2, arg3);
583
- }, arguments) };
584
- imports.wbg.__wbg_fillRect_e285f7b46668b7fa = function(arg0, arg1, arg2, arg3, arg4) {
585
- getObject(arg0).fillRect(arg1, arg2, arg3, arg4);
586
- };
587
- imports.wbg.__wbg_strokeRect_eef5919e98439115 = function(arg0, arg1, arg2, arg3, arg4) {
588
- getObject(arg0).strokeRect(arg1, arg2, arg3, arg4);
589
- };
590
- imports.wbg.__wbg_fillText_ba4313e6835ce7ea = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
591
- getObject(arg0).fillText(getStringFromWasm0(arg1, arg2), arg3, arg4);
592
- }, arguments) };
593
- imports.wbg.__wbg_measureText_b5b4d14da44a57c5 = function() { return handleError(function (arg0, arg1, arg2) {
594
- const ret = getObject(arg0).measureText(getStringFromWasm0(arg1, arg2));
595
- return addHeapObject(ret);
596
- }, arguments) };
597
- imports.wbg.__wbg_data_ab99ae4a2e1e8bc9 = function(arg0) {
598
- const ret = getObject(arg0).data;
599
- return addHeapObject(ret);
600
- };
601
- imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
602
- const ret = getObject(arg0).now();
603
- return ret;
604
- };
605
- imports.wbg.__wbg_instanceof_HtmlCanvasElement_da5f9efa0688cf6d = function(arg0) {
606
- let result;
607
- try {
608
- result = getObject(arg0) instanceof HTMLCanvasElement;
609
- } catch {
610
- result = false;
611
- }
612
- const ret = result;
613
- return ret;
614
- };
615
- imports.wbg.__wbg_setwidth_a667a942dba6656e = function(arg0, arg1) {
616
- getObject(arg0).width = arg1 >>> 0;
617
- };
618
- imports.wbg.__wbg_setheight_a747d440760fe5aa = function(arg0, arg1) {
619
- getObject(arg0).height = arg1 >>> 0;
620
- };
621
- imports.wbg.__wbg_getContext_7c5944ea807bf5d3 = function() { return handleError(function (arg0, arg1, arg2) {
622
- const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
623
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
624
- }, arguments) };
625
- imports.wbg.__wbg_instanceof_Response_fc4327dbfcdf5ced = function(arg0) {
626
- let result;
627
- try {
628
- result = getObject(arg0) instanceof Response;
629
- } catch {
630
- result = false;
631
- }
632
- const ret = result;
633
- return ret;
634
- };
635
- imports.wbg.__wbg_blob_34990e4300d45f53 = function() { return handleError(function (arg0) {
636
- const ret = getObject(arg0).blob();
637
- return addHeapObject(ret);
638
- }, arguments) };
639
- imports.wbg.__wbg_width_5b91f61af2d11adc = function(arg0) {
640
- const ret = getObject(arg0).width;
641
- return ret;
642
- };
643
- imports.wbg.__wbg_bubbles_63572b91f3885ef1 = function(arg0) {
644
- const ret = getObject(arg0).bubbles;
645
- return ret;
646
- };
647
- imports.wbg.__wbg_cancelBubble_90d1c3aa2a76cbeb = function(arg0) {
648
- const ret = getObject(arg0).cancelBubble;
649
- return ret;
650
- };
651
- imports.wbg.__wbg_composedPath_cf1bb5b8bcff496f = function(arg0) {
652
- const ret = getObject(arg0).composedPath();
653
- return addHeapObject(ret);
654
- };
655
- imports.wbg.__wbg_parentNode_9e53f8b17eb98c9d = function(arg0) {
656
- const ret = getObject(arg0).parentNode;
657
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
658
- };
659
- imports.wbg.__wbg_parentElement_c75962bc9997ea5f = function(arg0) {
660
- const ret = getObject(arg0).parentElement;
661
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
662
- };
663
- imports.wbg.__wbg_lastChild_0cee692010bac6c2 = function(arg0) {
664
- const ret = getObject(arg0).lastChild;
665
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
666
- };
667
- imports.wbg.__wbg_nextSibling_304d9aac7c2774ae = function(arg0) {
668
- const ret = getObject(arg0).nextSibling;
669
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
670
- };
671
- imports.wbg.__wbg_setnodeValue_d1c8382910b45e04 = function(arg0, arg1, arg2) {
672
- getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
673
- };
674
- imports.wbg.__wbg_textContent_c5d9e21ee03c63d4 = function(arg0, arg1) {
675
- const ret = getObject(arg1).textContent;
676
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
677
- var len1 = WASM_VECTOR_LEN;
678
- getInt32Memory0()[arg0 / 4 + 1] = len1;
679
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
680
- };
681
- imports.wbg.__wbg_appendChild_51339d4cde00ee22 = function() { return handleError(function (arg0, arg1) {
682
- const ret = getObject(arg0).appendChild(getObject(arg1));
683
- return addHeapObject(ret);
684
- }, arguments) };
685
- imports.wbg.__wbg_insertBefore_ffa01d4b747c95fc = function() { return handleError(function (arg0, arg1, arg2) {
686
- const ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
687
- return addHeapObject(ret);
688
- }, arguments) };
689
- imports.wbg.__wbg_removeChild_973429f368206138 = function() { return handleError(function (arg0, arg1) {
690
- const ret = getObject(arg0).removeChild(getObject(arg1));
691
- return addHeapObject(ret);
692
- }, arguments) };
693
- imports.wbg.__wbg_addEventListener_a5963e26cd7b176b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
694
- getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
695
- }, arguments) };
696
- imports.wbg.__wbg_origin_50aa482fa6784a0a = function() { return handleError(function (arg0, arg1) {
697
- const ret = getObject(arg1).origin;
698
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
699
- const len1 = WASM_VECTOR_LEN;
700
- getInt32Memory0()[arg0 / 4 + 1] = len1;
701
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
702
- }, arguments) };
703
- imports.wbg.__wbg_pathname_c8fd5c498079312d = function() { return handleError(function (arg0, arg1) {
704
- const ret = getObject(arg1).pathname;
705
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
706
- const len1 = WASM_VECTOR_LEN;
707
- getInt32Memory0()[arg0 / 4 + 1] = len1;
708
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
709
- }, arguments) };
710
- imports.wbg.__wbg_instanceof_ShadowRoot_b64337370f59fe2d = function(arg0) {
711
- let result;
712
- try {
713
- result = getObject(arg0) instanceof ShadowRoot;
714
- } catch {
715
- result = false;
716
- }
717
- const ret = result;
718
- return ret;
719
- };
720
- imports.wbg.__wbg_host_e1c47c33975060d3 = function(arg0) {
721
- const ret = getObject(arg0).host;
722
- return addHeapObject(ret);
723
- };
724
- imports.wbg.__wbg_createObjectURL_d82f2880bada6a1d = function() { return handleError(function (arg0, arg1) {
725
- const ret = URL.createObjectURL(getObject(arg1));
726
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
727
- const len1 = WASM_VECTOR_LEN;
728
- getInt32Memory0()[arg0 / 4 + 1] = len1;
729
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
730
- }, arguments) };
731
- imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
732
- const ret = getObject(arg0)[arg1 >>> 0];
733
- return addHeapObject(ret);
734
- };
735
- imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) {
736
- const ret = getObject(arg0).length;
737
- return ret;
738
- };
739
- imports.wbg.__wbg_new_898a68150f225f2e = function() {
740
- const ret = new Array();
741
- return addHeapObject(ret);
742
- };
743
- imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
744
- const ret = new Function(getStringFromWasm0(arg0, arg1));
745
- return addHeapObject(ret);
746
- };
747
- imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
748
- const ret = getObject(arg0).call(getObject(arg1));
749
- return addHeapObject(ret);
750
- }, arguments) };
751
- imports.wbg.__wbg_new_b51585de1b234aff = function() {
752
- const ret = new Object();
753
- return addHeapObject(ret);
754
- };
755
- imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
756
- const ret = self.self;
757
- return addHeapObject(ret);
758
- }, arguments) };
759
- imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () {
760
- const ret = window.window;
761
- return addHeapObject(ret);
762
- }, arguments) };
763
- imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () {
764
- const ret = globalThis.globalThis;
765
- return addHeapObject(ret);
766
- }, arguments) };
767
- imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () {
768
- const ret = global.global;
769
- return addHeapObject(ret);
770
- }, arguments) };
771
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
772
- const ret = getObject(arg0) === undefined;
773
- return ret;
774
- };
775
- imports.wbg.__wbg_from_d7c216d4616bb368 = function(arg0) {
776
- const ret = Array.from(getObject(arg0));
777
- return addHeapObject(ret);
778
- };
779
- imports.wbg.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
780
- const ret = getObject(arg0).push(getObject(arg1));
781
- return ret;
782
- };
783
- imports.wbg.__wbg_is_205d914af04a8faa = function(arg0, arg1) {
784
- const ret = Object.is(getObject(arg0), getObject(arg1));
785
- return ret;
786
- };
787
- imports.wbg.__wbg_resolve_53698b95aaf7fcf8 = function(arg0) {
788
- const ret = Promise.resolve(getObject(arg0));
789
- return addHeapObject(ret);
790
- };
791
- imports.wbg.__wbg_then_f7e06ee3c11698eb = function(arg0, arg1) {
792
- const ret = getObject(arg0).then(getObject(arg1));
793
- return addHeapObject(ret);
794
- };
795
- imports.wbg.__wbg_then_b2267541e2a73865 = function(arg0, arg1, arg2) {
796
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
797
- return addHeapObject(ret);
798
- };
799
- imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
800
- const ret = getObject(arg0).buffer;
801
- return addHeapObject(ret);
802
- };
803
- imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
804
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
805
- return addHeapObject(ret);
806
- };
807
- imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
808
- const ret = new Uint8Array(getObject(arg0));
809
- return addHeapObject(ret);
810
- };
811
- imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
812
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
813
- };
814
- imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
815
- const ret = getObject(arg0).length;
816
- return ret;
817
- };
818
- imports.wbg.__wbg_set_092e06b0f9d71865 = function() { return handleError(function (arg0, arg1, arg2) {
819
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
820
- return ret;
821
- }, arguments) };
822
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
823
- const ret = debugString(getObject(arg1));
824
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
825
- const len1 = WASM_VECTOR_LEN;
826
- getInt32Memory0()[arg0 / 4 + 1] = len1;
827
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
828
- };
829
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
830
- throw new Error(getStringFromWasm0(arg0, arg1));
831
- };
832
- imports.wbg.__wbindgen_memory = function() {
833
- const ret = wasm.memory;
834
- return addHeapObject(ret);
835
- };
836
- imports.wbg.__wbindgen_closure_wrapper231 = function(arg0, arg1, arg2) {
837
- const ret = makeClosure(arg0, arg1, 75, __wbg_adapter_18);
838
- return addHeapObject(ret);
839
- };
840
- imports.wbg.__wbindgen_closure_wrapper414 = function(arg0, arg1, arg2) {
841
- const ret = makeMutClosure(arg0, arg1, 135, __wbg_adapter_21);
842
- return addHeapObject(ret);
843
- };
844
- imports.wbg.__wbindgen_closure_wrapper689 = function(arg0, arg1, arg2) {
845
- const ret = makeMutClosure(arg0, arg1, 243, __wbg_adapter_24);
846
- return addHeapObject(ret);
847
- };
848
-
849
- return imports;
850
- }
851
-
852
- function __wbg_init_memory(imports, maybe_memory) {
853
-
854
- }
855
-
856
- function __wbg_finalize_init(instance, module) {
857
- wasm = instance.exports;
858
- __wbg_init.__wbindgen_wasm_module = module;
859
- cachedInt32Memory0 = null;
860
- cachedUint32Memory0 = null;
861
- cachedUint8Memory0 = null;
862
-
863
- wasm.__wbindgen_start();
864
- return wasm;
865
- }
866
-
867
- function initSync(module) {
868
- if (wasm !== undefined) return wasm;
869
-
870
- const imports = __wbg_get_imports();
871
-
872
- __wbg_init_memory(imports);
873
-
874
- if (!(module instanceof WebAssembly.Module)) {
875
- module = new WebAssembly.Module(module);
876
- }
877
-
878
- const instance = new WebAssembly.Instance(module, imports);
879
-
880
- return __wbg_finalize_init(instance, module);
881
- }
882
-
883
- async function __wbg_init(input) {
884
- if (wasm !== undefined) return wasm;
885
-
886
- if (typeof input === 'undefined') {
887
- input = new URL('app-52a2b5a177502aae_bg.wasm', import.meta.url);
888
- }
889
- const imports = __wbg_get_imports();
890
-
891
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
892
- input = fetch(input);
893
- }
894
-
895
- __wbg_init_memory(imports);
896
-
897
- const { instance, module } = await __wbg_load(await input, imports);
898
-
899
- return __wbg_finalize_init(instance, module);
900
- }
901
-
902
- export { initSync }
903
- export default __wbg_init;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app-52a2b5a177502aae_bg.wasm DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:af63ea91a37b80cdd448287beb34bc6255eb113253a88bba65a0fee72022e759
3
- size 300675
 
 
 
 
app-8180fc49522e81a6.js DELETED
@@ -1,903 +0,0 @@
1
- let wasm;
2
-
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let heap_next = heap.length;
10
-
11
- function dropObject(idx) {
12
- if (idx < 132) return;
13
- heap[idx] = heap_next;
14
- heap_next = idx;
15
- }
16
-
17
- function takeObject(idx) {
18
- const ret = getObject(idx);
19
- dropObject(idx);
20
- return ret;
21
- }
22
-
23
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
24
-
25
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
26
-
27
- let cachedUint8Memory0 = null;
28
-
29
- function getUint8Memory0() {
30
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
31
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
32
- }
33
- return cachedUint8Memory0;
34
- }
35
-
36
- function getStringFromWasm0(ptr, len) {
37
- ptr = ptr >>> 0;
38
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
39
- }
40
-
41
- function addHeapObject(obj) {
42
- if (heap_next === heap.length) heap.push(heap.length + 1);
43
- const idx = heap_next;
44
- heap_next = heap[idx];
45
-
46
- heap[idx] = obj;
47
- return idx;
48
- }
49
-
50
- function debugString(val) {
51
- // primitive types
52
- const type = typeof val;
53
- if (type == 'number' || type == 'boolean' || val == null) {
54
- return `${val}`;
55
- }
56
- if (type == 'string') {
57
- return `"${val}"`;
58
- }
59
- if (type == 'symbol') {
60
- const description = val.description;
61
- if (description == null) {
62
- return 'Symbol';
63
- } else {
64
- return `Symbol(${description})`;
65
- }
66
- }
67
- if (type == 'function') {
68
- const name = val.name;
69
- if (typeof name == 'string' && name.length > 0) {
70
- return `Function(${name})`;
71
- } else {
72
- return 'Function';
73
- }
74
- }
75
- // objects
76
- if (Array.isArray(val)) {
77
- const length = val.length;
78
- let debug = '[';
79
- if (length > 0) {
80
- debug += debugString(val[0]);
81
- }
82
- for(let i = 1; i < length; i++) {
83
- debug += ', ' + debugString(val[i]);
84
- }
85
- debug += ']';
86
- return debug;
87
- }
88
- // Test for built-in
89
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
90
- let className;
91
- if (builtInMatches.length > 1) {
92
- className = builtInMatches[1];
93
- } else {
94
- // Failed to match the standard '[object ClassName]'
95
- return toString.call(val);
96
- }
97
- if (className == 'Object') {
98
- // we're a user defined class or Object
99
- // JSON.stringify avoids problems with cycles, and is generally much
100
- // easier than looping through ownProperties of `val`.
101
- try {
102
- return 'Object(' + JSON.stringify(val) + ')';
103
- } catch (_) {
104
- return 'Object';
105
- }
106
- }
107
- // errors
108
- if (val instanceof Error) {
109
- return `${val.name}: ${val.message}\n${val.stack}`;
110
- }
111
- // TODO we could test for more things here, like `Set`s and `Map`s.
112
- return className;
113
- }
114
-
115
- let WASM_VECTOR_LEN = 0;
116
-
117
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
118
-
119
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
120
- ? function (arg, view) {
121
- return cachedTextEncoder.encodeInto(arg, view);
122
- }
123
- : function (arg, view) {
124
- const buf = cachedTextEncoder.encode(arg);
125
- view.set(buf);
126
- return {
127
- read: arg.length,
128
- written: buf.length
129
- };
130
- });
131
-
132
- function passStringToWasm0(arg, malloc, realloc) {
133
-
134
- if (realloc === undefined) {
135
- const buf = cachedTextEncoder.encode(arg);
136
- const ptr = malloc(buf.length, 1) >>> 0;
137
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
138
- WASM_VECTOR_LEN = buf.length;
139
- return ptr;
140
- }
141
-
142
- let len = arg.length;
143
- let ptr = malloc(len, 1) >>> 0;
144
-
145
- const mem = getUint8Memory0();
146
-
147
- let offset = 0;
148
-
149
- for (; offset < len; offset++) {
150
- const code = arg.charCodeAt(offset);
151
- if (code > 0x7F) break;
152
- mem[ptr + offset] = code;
153
- }
154
-
155
- if (offset !== len) {
156
- if (offset !== 0) {
157
- arg = arg.slice(offset);
158
- }
159
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
160
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
161
- const ret = encodeString(arg, view);
162
-
163
- offset += ret.written;
164
- }
165
-
166
- WASM_VECTOR_LEN = offset;
167
- return ptr;
168
- }
169
-
170
- let cachedInt32Memory0 = null;
171
-
172
- function getInt32Memory0() {
173
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
174
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
175
- }
176
- return cachedInt32Memory0;
177
- }
178
-
179
- function makeClosure(arg0, arg1, dtor, f) {
180
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
181
- const real = (...args) => {
182
- // First up with a closure we increment the internal reference
183
- // count. This ensures that the Rust closure environment won't
184
- // be deallocated while we're invoking it.
185
- state.cnt++;
186
- try {
187
- return f(state.a, state.b, ...args);
188
- } finally {
189
- if (--state.cnt === 0) {
190
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
191
- state.a = 0;
192
-
193
- }
194
- }
195
- };
196
- real.original = state;
197
-
198
- return real;
199
- }
200
- function __wbg_adapter_18(arg0, arg1, arg2) {
201
- wasm.wasm_bindgen__convert__closures__invoke1__h3852d9455ff9739e(arg0, arg1, addHeapObject(arg2));
202
- }
203
-
204
- function makeMutClosure(arg0, arg1, dtor, f) {
205
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
206
- const real = (...args) => {
207
- // First up with a closure we increment the internal reference
208
- // count. This ensures that the Rust closure environment won't
209
- // be deallocated while we're invoking it.
210
- state.cnt++;
211
- const a = state.a;
212
- state.a = 0;
213
- try {
214
- return f(a, state.b, ...args);
215
- } finally {
216
- if (--state.cnt === 0) {
217
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
218
-
219
- } else {
220
- state.a = a;
221
- }
222
- }
223
- };
224
- real.original = state;
225
-
226
- return real;
227
- }
228
-
229
- let stack_pointer = 128;
230
-
231
- function addBorrowedObject(obj) {
232
- if (stack_pointer == 1) throw new Error('out of js stack');
233
- heap[--stack_pointer] = obj;
234
- return stack_pointer;
235
- }
236
- function __wbg_adapter_21(arg0, arg1, arg2) {
237
- try {
238
- wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha9364e9f993015fa(arg0, arg1, addBorrowedObject(arg2));
239
- } finally {
240
- heap[stack_pointer++] = undefined;
241
- }
242
- }
243
-
244
- function __wbg_adapter_24(arg0, arg1, arg2) {
245
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h93a8c686e0ffa704(arg0, arg1, addHeapObject(arg2));
246
- }
247
-
248
- function isLikeNone(x) {
249
- return x === undefined || x === null;
250
- }
251
-
252
- let cachedUint32Memory0 = null;
253
-
254
- function getUint32Memory0() {
255
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
256
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
257
- }
258
- return cachedUint32Memory0;
259
- }
260
-
261
- function getArrayJsValueFromWasm0(ptr, len) {
262
- ptr = ptr >>> 0;
263
- const mem = getUint32Memory0();
264
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
265
- const result = [];
266
- for (let i = 0; i < slice.length; i++) {
267
- result.push(takeObject(slice[i]));
268
- }
269
- return result;
270
- }
271
-
272
- function handleError(f, args) {
273
- try {
274
- return f.apply(this, args);
275
- } catch (e) {
276
- wasm.__wbindgen_exn_store(addHeapObject(e));
277
- }
278
- }
279
-
280
- async function __wbg_load(module, imports) {
281
- if (typeof Response === 'function' && module instanceof Response) {
282
- if (typeof WebAssembly.instantiateStreaming === 'function') {
283
- try {
284
- return await WebAssembly.instantiateStreaming(module, imports);
285
-
286
- } catch (e) {
287
- if (module.headers.get('Content-Type') != 'application/wasm') {
288
- 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", e);
289
-
290
- } else {
291
- throw e;
292
- }
293
- }
294
- }
295
-
296
- const bytes = await module.arrayBuffer();
297
- return await WebAssembly.instantiate(bytes, imports);
298
-
299
- } else {
300
- const instance = await WebAssembly.instantiate(module, imports);
301
-
302
- if (instance instanceof WebAssembly.Instance) {
303
- return { instance, module };
304
-
305
- } else {
306
- return instance;
307
- }
308
- }
309
- }
310
-
311
- function __wbg_get_imports() {
312
- const imports = {};
313
- imports.wbg = {};
314
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
315
- takeObject(arg0);
316
- };
317
- imports.wbg.__wbg_log_65d20c5d9fc43b86 = function(arg0, arg1) {
318
- console.log(getStringFromWasm0(arg0, arg1));
319
- };
320
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
321
- const ret = getStringFromWasm0(arg0, arg1);
322
- return addHeapObject(ret);
323
- };
324
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
325
- const ret = getObject(arg0);
326
- return addHeapObject(ret);
327
- };
328
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
329
- const obj = takeObject(arg0).original;
330
- if (obj.cnt-- == 1) {
331
- obj.a = 0;
332
- return true;
333
- }
334
- const ret = false;
335
- return ret;
336
- };
337
- imports.wbg.__wbg_cachekey_b61393159c57fd7b = function(arg0, arg1) {
338
- const ret = getObject(arg1).__yew_subtree_cache_key;
339
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
340
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
341
- };
342
- imports.wbg.__wbg_subtreeid_e348577f7ef777e3 = function(arg0, arg1) {
343
- const ret = getObject(arg1).__yew_subtree_id;
344
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
345
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
346
- };
347
- imports.wbg.__wbg_setsubtreeid_d32e6327eef1f7fc = function(arg0, arg1) {
348
- getObject(arg0).__yew_subtree_id = arg1 >>> 0;
349
- };
350
- imports.wbg.__wbg_setcachekey_80183b7cfc421143 = function(arg0, arg1) {
351
- getObject(arg0).__yew_subtree_cache_key = arg1 >>> 0;
352
- };
353
- imports.wbg.__wbg_listenerid_12315eee21527820 = function(arg0, arg1) {
354
- const ret = getObject(arg1).__yew_listener_id;
355
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
356
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
357
- };
358
- imports.wbg.__wbg_setlistenerid_3183aae8fa5840fb = function(arg0, arg1) {
359
- getObject(arg0).__yew_listener_id = arg1 >>> 0;
360
- };
361
- imports.wbg.__wbg_error_71d6845bf00a930f = function(arg0, arg1) {
362
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
363
- wasm.__wbindgen_free(arg0, arg1 * 4);
364
- console.error(...v0);
365
- };
366
- imports.wbg.__wbg_warn_0b90a269a514ae1d = function(arg0, arg1) {
367
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
368
- wasm.__wbindgen_free(arg0, arg1 * 4);
369
- console.warn(...v0);
370
- };
371
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
372
- const ret = new Error();
373
- return addHeapObject(ret);
374
- };
375
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
376
- const ret = getObject(arg1).stack;
377
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
378
- const len1 = WASM_VECTOR_LEN;
379
- getInt32Memory0()[arg0 / 4 + 1] = len1;
380
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
381
- };
382
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
383
- let deferred0_0;
384
- let deferred0_1;
385
- try {
386
- deferred0_0 = arg0;
387
- deferred0_1 = arg1;
388
- console.error(getStringFromWasm0(arg0, arg1));
389
- } finally {
390
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
391
- }
392
- };
393
- imports.wbg.__wbg_location_7ac41949b772ef21 = function(arg0) {
394
- const ret = getObject(arg0).location;
395
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
396
- };
397
- imports.wbg.__wbg_body_674aec4c1c0910cd = function(arg0) {
398
- const ret = getObject(arg0).body;
399
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
400
- };
401
- imports.wbg.__wbg_createElement_4891554b28d3388b = function() { return handleError(function (arg0, arg1, arg2) {
402
- const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
403
- return addHeapObject(ret);
404
- }, arguments) };
405
- imports.wbg.__wbg_createElementNS_119acf9e82482041 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
406
- const ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
407
- return addHeapObject(ret);
408
- }, arguments) };
409
- imports.wbg.__wbg_createTextNode_2fd22cd7e543f938 = function(arg0, arg1, arg2) {
410
- const ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
411
- return addHeapObject(ret);
412
- };
413
- imports.wbg.__wbg_getElementById_cc0e0d931b0d9a28 = function(arg0, arg1, arg2) {
414
- const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
415
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
416
- };
417
- imports.wbg.__wbg_instanceof_Window_9029196b662bc42a = function(arg0) {
418
- let result;
419
- try {
420
- result = getObject(arg0) instanceof Window;
421
- } catch {
422
- result = false;
423
- }
424
- const ret = result;
425
- return ret;
426
- };
427
- imports.wbg.__wbg_document_f7ace2b956f30a4f = function(arg0) {
428
- const ret = getObject(arg0).document;
429
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
430
- };
431
- imports.wbg.__wbg_location_56243dba507f472d = function(arg0) {
432
- const ret = getObject(arg0).location;
433
- return addHeapObject(ret);
434
- };
435
- imports.wbg.__wbg_performance_2c295061c8b01e0b = function(arg0) {
436
- const ret = getObject(arg0).performance;
437
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
438
- };
439
- imports.wbg.__wbg_fetch_336b6f0cb426b46e = function(arg0, arg1) {
440
- const ret = getObject(arg0).fetch(getObject(arg1));
441
- return addHeapObject(ret);
442
- };
443
- imports.wbg.__wbg_newwithstrsequenceandoptions_fd88a547f6d15707 = function() { return handleError(function (arg0, arg1) {
444
- const ret = new Blob(getObject(arg0), getObject(arg1));
445
- return addHeapObject(ret);
446
- }, arguments) };
447
- imports.wbg.__wbg_arrayBuffer_27cefaea55cbf063 = function(arg0) {
448
- const ret = getObject(arg0).arrayBuffer();
449
- return addHeapObject(ret);
450
- };
451
- imports.wbg.__wbg_value_3c5f08ffc2b7d6f9 = function(arg0, arg1) {
452
- const ret = getObject(arg1).value;
453
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
454
- const len1 = WASM_VECTOR_LEN;
455
- getInt32Memory0()[arg0 / 4 + 1] = len1;
456
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
457
- };
458
- imports.wbg.__wbg_setvalue_0dc100d4b9908028 = function(arg0, arg1, arg2) {
459
- getObject(arg0).value = getStringFromWasm0(arg1, arg2);
460
- };
461
- imports.wbg.__wbg_setchecked_e5a50baea447b8a8 = function(arg0, arg1) {
462
- getObject(arg0).checked = arg1 !== 0;
463
- };
464
- imports.wbg.__wbg_value_9423da9d988ee8cf = function(arg0, arg1) {
465
- const ret = getObject(arg1).value;
466
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
- const len1 = WASM_VECTOR_LEN;
468
- getInt32Memory0()[arg0 / 4 + 1] = len1;
469
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
470
- };
471
- imports.wbg.__wbg_setvalue_1f95e61cbc382f7f = function(arg0, arg1, arg2) {
472
- getObject(arg0).value = getStringFromWasm0(arg1, arg2);
473
- };
474
- imports.wbg.__wbg_setonmessage_f0bd0280573b7084 = function(arg0, arg1) {
475
- getObject(arg0).onmessage = getObject(arg1);
476
- };
477
- imports.wbg.__wbg_new_8e7322f46d5d019c = function() { return handleError(function (arg0, arg1) {
478
- const ret = new Worker(getStringFromWasm0(arg0, arg1));
479
- return addHeapObject(ret);
480
- }, arguments) };
481
- imports.wbg.__wbg_newwithoptions_1bd20b45061ed935 = function() { return handleError(function (arg0, arg1, arg2) {
482
- const ret = new Worker(getStringFromWasm0(arg0, arg1), getObject(arg2));
483
- return addHeapObject(ret);
484
- }, arguments) };
485
- imports.wbg.__wbg_postMessage_8c609e2bde333d9c = function() { return handleError(function (arg0, arg1) {
486
- getObject(arg0).postMessage(getObject(arg1));
487
- }, arguments) };
488
- imports.wbg.__wbg_instanceof_HtmlImageElement_7654818e144eb606 = function(arg0) {
489
- let result;
490
- try {
491
- result = getObject(arg0) instanceof HTMLImageElement;
492
- } catch {
493
- result = false;
494
- }
495
- const ret = result;
496
- return ret;
497
- };
498
- imports.wbg.__wbg_naturalWidth_4bff132b1f2485e3 = function(arg0) {
499
- const ret = getObject(arg0).naturalWidth;
500
- return ret;
501
- };
502
- imports.wbg.__wbg_naturalHeight_e24df358ecfe26a8 = function(arg0) {
503
- const ret = getObject(arg0).naturalHeight;
504
- return ret;
505
- };
506
- imports.wbg.__wbg_newwithstrandinit_cad5cd6038c7ff5d = function() { return handleError(function (arg0, arg1, arg2) {
507
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
508
- return addHeapObject(ret);
509
- }, arguments) };
510
- imports.wbg.__wbg_debug_9b8701f894da9929 = function(arg0, arg1, arg2, arg3) {
511
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
512
- };
513
- imports.wbg.__wbg_error_788ae33f81d3b84b = function(arg0) {
514
- console.error(getObject(arg0));
515
- };
516
- imports.wbg.__wbg_error_d9bce418caafb712 = function(arg0, arg1, arg2, arg3) {
517
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
518
- };
519
- imports.wbg.__wbg_info_bb52f40b06f679de = function(arg0, arg1, arg2, arg3) {
520
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
521
- };
522
- imports.wbg.__wbg_log_ea7093e35e3efd07 = function(arg0, arg1, arg2, arg3) {
523
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
524
- };
525
- imports.wbg.__wbg_warn_dfc0e0cf544a13bd = function(arg0, arg1, arg2, arg3) {
526
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
527
- };
528
- imports.wbg.__wbg_instanceof_Element_4622f5da1249a3eb = function(arg0) {
529
- let result;
530
- try {
531
- result = getObject(arg0) instanceof Element;
532
- } catch {
533
- result = false;
534
- }
535
- const ret = result;
536
- return ret;
537
- };
538
- imports.wbg.__wbg_namespaceURI_31718ed49b5343a3 = function(arg0, arg1) {
539
- const ret = getObject(arg1).namespaceURI;
540
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
541
- var len1 = WASM_VECTOR_LEN;
542
- getInt32Memory0()[arg0 / 4 + 1] = len1;
543
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
544
- };
545
- imports.wbg.__wbg_setinnerHTML_b089587252408b67 = function(arg0, arg1, arg2) {
546
- getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2);
547
- };
548
- imports.wbg.__wbg_outerHTML_f7749ceff37b5832 = function(arg0, arg1) {
549
- const ret = getObject(arg1).outerHTML;
550
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
551
- const len1 = WASM_VECTOR_LEN;
552
- getInt32Memory0()[arg0 / 4 + 1] = len1;
553
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
554
- };
555
- imports.wbg.__wbg_children_27ed308801b57d3f = function(arg0) {
556
- const ret = getObject(arg0).children;
557
- return addHeapObject(ret);
558
- };
559
- imports.wbg.__wbg_removeAttribute_d8404da431968808 = function() { return handleError(function (arg0, arg1, arg2) {
560
- getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2));
561
- }, arguments) };
562
- imports.wbg.__wbg_setAttribute_e7e80b478b7b8b2f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
563
- getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
564
- }, arguments) };
565
- imports.wbg.__wbg_instanceof_CanvasRenderingContext2d_bc0a6635c96eca9b = function(arg0) {
566
- let result;
567
- try {
568
- result = getObject(arg0) instanceof CanvasRenderingContext2D;
569
- } catch {
570
- result = false;
571
- }
572
- const ret = result;
573
- return ret;
574
- };
575
- imports.wbg.__wbg_setstrokeStyle_3fe4d1c0d11ed1b6 = function(arg0, arg1) {
576
- getObject(arg0).strokeStyle = getObject(arg1);
577
- };
578
- imports.wbg.__wbg_setfillStyle_401fa583a1c8863c = function(arg0, arg1) {
579
- getObject(arg0).fillStyle = getObject(arg1);
580
- };
581
- imports.wbg.__wbg_drawImage_9758fa4c03ab8fc8 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
582
- getObject(arg0).drawImage(getObject(arg1), arg2, arg3);
583
- }, arguments) };
584
- imports.wbg.__wbg_fillRect_e285f7b46668b7fa = function(arg0, arg1, arg2, arg3, arg4) {
585
- getObject(arg0).fillRect(arg1, arg2, arg3, arg4);
586
- };
587
- imports.wbg.__wbg_strokeRect_eef5919e98439115 = function(arg0, arg1, arg2, arg3, arg4) {
588
- getObject(arg0).strokeRect(arg1, arg2, arg3, arg4);
589
- };
590
- imports.wbg.__wbg_fillText_ba4313e6835ce7ea = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
591
- getObject(arg0).fillText(getStringFromWasm0(arg1, arg2), arg3, arg4);
592
- }, arguments) };
593
- imports.wbg.__wbg_measureText_b5b4d14da44a57c5 = function() { return handleError(function (arg0, arg1, arg2) {
594
- const ret = getObject(arg0).measureText(getStringFromWasm0(arg1, arg2));
595
- return addHeapObject(ret);
596
- }, arguments) };
597
- imports.wbg.__wbg_data_ab99ae4a2e1e8bc9 = function(arg0) {
598
- const ret = getObject(arg0).data;
599
- return addHeapObject(ret);
600
- };
601
- imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
602
- const ret = getObject(arg0).now();
603
- return ret;
604
- };
605
- imports.wbg.__wbg_instanceof_HtmlCanvasElement_da5f9efa0688cf6d = function(arg0) {
606
- let result;
607
- try {
608
- result = getObject(arg0) instanceof HTMLCanvasElement;
609
- } catch {
610
- result = false;
611
- }
612
- const ret = result;
613
- return ret;
614
- };
615
- imports.wbg.__wbg_setwidth_a667a942dba6656e = function(arg0, arg1) {
616
- getObject(arg0).width = arg1 >>> 0;
617
- };
618
- imports.wbg.__wbg_setheight_a747d440760fe5aa = function(arg0, arg1) {
619
- getObject(arg0).height = arg1 >>> 0;
620
- };
621
- imports.wbg.__wbg_getContext_7c5944ea807bf5d3 = function() { return handleError(function (arg0, arg1, arg2) {
622
- const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
623
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
624
- }, arguments) };
625
- imports.wbg.__wbg_instanceof_Response_fc4327dbfcdf5ced = function(arg0) {
626
- let result;
627
- try {
628
- result = getObject(arg0) instanceof Response;
629
- } catch {
630
- result = false;
631
- }
632
- const ret = result;
633
- return ret;
634
- };
635
- imports.wbg.__wbg_blob_34990e4300d45f53 = function() { return handleError(function (arg0) {
636
- const ret = getObject(arg0).blob();
637
- return addHeapObject(ret);
638
- }, arguments) };
639
- imports.wbg.__wbg_width_5b91f61af2d11adc = function(arg0) {
640
- const ret = getObject(arg0).width;
641
- return ret;
642
- };
643
- imports.wbg.__wbg_bubbles_63572b91f3885ef1 = function(arg0) {
644
- const ret = getObject(arg0).bubbles;
645
- return ret;
646
- };
647
- imports.wbg.__wbg_cancelBubble_90d1c3aa2a76cbeb = function(arg0) {
648
- const ret = getObject(arg0).cancelBubble;
649
- return ret;
650
- };
651
- imports.wbg.__wbg_composedPath_cf1bb5b8bcff496f = function(arg0) {
652
- const ret = getObject(arg0).composedPath();
653
- return addHeapObject(ret);
654
- };
655
- imports.wbg.__wbg_parentNode_9e53f8b17eb98c9d = function(arg0) {
656
- const ret = getObject(arg0).parentNode;
657
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
658
- };
659
- imports.wbg.__wbg_parentElement_c75962bc9997ea5f = function(arg0) {
660
- const ret = getObject(arg0).parentElement;
661
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
662
- };
663
- imports.wbg.__wbg_lastChild_0cee692010bac6c2 = function(arg0) {
664
- const ret = getObject(arg0).lastChild;
665
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
666
- };
667
- imports.wbg.__wbg_nextSibling_304d9aac7c2774ae = function(arg0) {
668
- const ret = getObject(arg0).nextSibling;
669
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
670
- };
671
- imports.wbg.__wbg_setnodeValue_d1c8382910b45e04 = function(arg0, arg1, arg2) {
672
- getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
673
- };
674
- imports.wbg.__wbg_textContent_c5d9e21ee03c63d4 = function(arg0, arg1) {
675
- const ret = getObject(arg1).textContent;
676
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
677
- var len1 = WASM_VECTOR_LEN;
678
- getInt32Memory0()[arg0 / 4 + 1] = len1;
679
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
680
- };
681
- imports.wbg.__wbg_appendChild_51339d4cde00ee22 = function() { return handleError(function (arg0, arg1) {
682
- const ret = getObject(arg0).appendChild(getObject(arg1));
683
- return addHeapObject(ret);
684
- }, arguments) };
685
- imports.wbg.__wbg_insertBefore_ffa01d4b747c95fc = function() { return handleError(function (arg0, arg1, arg2) {
686
- const ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
687
- return addHeapObject(ret);
688
- }, arguments) };
689
- imports.wbg.__wbg_removeChild_973429f368206138 = function() { return handleError(function (arg0, arg1) {
690
- const ret = getObject(arg0).removeChild(getObject(arg1));
691
- return addHeapObject(ret);
692
- }, arguments) };
693
- imports.wbg.__wbg_addEventListener_a5963e26cd7b176b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
694
- getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
695
- }, arguments) };
696
- imports.wbg.__wbg_origin_50aa482fa6784a0a = function() { return handleError(function (arg0, arg1) {
697
- const ret = getObject(arg1).origin;
698
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
699
- const len1 = WASM_VECTOR_LEN;
700
- getInt32Memory0()[arg0 / 4 + 1] = len1;
701
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
702
- }, arguments) };
703
- imports.wbg.__wbg_pathname_c8fd5c498079312d = function() { return handleError(function (arg0, arg1) {
704
- const ret = getObject(arg1).pathname;
705
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
706
- const len1 = WASM_VECTOR_LEN;
707
- getInt32Memory0()[arg0 / 4 + 1] = len1;
708
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
709
- }, arguments) };
710
- imports.wbg.__wbg_instanceof_ShadowRoot_b64337370f59fe2d = function(arg0) {
711
- let result;
712
- try {
713
- result = getObject(arg0) instanceof ShadowRoot;
714
- } catch {
715
- result = false;
716
- }
717
- const ret = result;
718
- return ret;
719
- };
720
- imports.wbg.__wbg_host_e1c47c33975060d3 = function(arg0) {
721
- const ret = getObject(arg0).host;
722
- return addHeapObject(ret);
723
- };
724
- imports.wbg.__wbg_createObjectURL_d82f2880bada6a1d = function() { return handleError(function (arg0, arg1) {
725
- const ret = URL.createObjectURL(getObject(arg1));
726
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
727
- const len1 = WASM_VECTOR_LEN;
728
- getInt32Memory0()[arg0 / 4 + 1] = len1;
729
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
730
- }, arguments) };
731
- imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
732
- const ret = getObject(arg0)[arg1 >>> 0];
733
- return addHeapObject(ret);
734
- };
735
- imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) {
736
- const ret = getObject(arg0).length;
737
- return ret;
738
- };
739
- imports.wbg.__wbg_new_898a68150f225f2e = function() {
740
- const ret = new Array();
741
- return addHeapObject(ret);
742
- };
743
- imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
744
- const ret = new Function(getStringFromWasm0(arg0, arg1));
745
- return addHeapObject(ret);
746
- };
747
- imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
748
- const ret = getObject(arg0).call(getObject(arg1));
749
- return addHeapObject(ret);
750
- }, arguments) };
751
- imports.wbg.__wbg_new_b51585de1b234aff = function() {
752
- const ret = new Object();
753
- return addHeapObject(ret);
754
- };
755
- imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
756
- const ret = self.self;
757
- return addHeapObject(ret);
758
- }, arguments) };
759
- imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () {
760
- const ret = window.window;
761
- return addHeapObject(ret);
762
- }, arguments) };
763
- imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () {
764
- const ret = globalThis.globalThis;
765
- return addHeapObject(ret);
766
- }, arguments) };
767
- imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () {
768
- const ret = global.global;
769
- return addHeapObject(ret);
770
- }, arguments) };
771
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
772
- const ret = getObject(arg0) === undefined;
773
- return ret;
774
- };
775
- imports.wbg.__wbg_from_d7c216d4616bb368 = function(arg0) {
776
- const ret = Array.from(getObject(arg0));
777
- return addHeapObject(ret);
778
- };
779
- imports.wbg.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
780
- const ret = getObject(arg0).push(getObject(arg1));
781
- return ret;
782
- };
783
- imports.wbg.__wbg_is_205d914af04a8faa = function(arg0, arg1) {
784
- const ret = Object.is(getObject(arg0), getObject(arg1));
785
- return ret;
786
- };
787
- imports.wbg.__wbg_resolve_53698b95aaf7fcf8 = function(arg0) {
788
- const ret = Promise.resolve(getObject(arg0));
789
- return addHeapObject(ret);
790
- };
791
- imports.wbg.__wbg_then_f7e06ee3c11698eb = function(arg0, arg1) {
792
- const ret = getObject(arg0).then(getObject(arg1));
793
- return addHeapObject(ret);
794
- };
795
- imports.wbg.__wbg_then_b2267541e2a73865 = function(arg0, arg1, arg2) {
796
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
797
- return addHeapObject(ret);
798
- };
799
- imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
800
- const ret = getObject(arg0).buffer;
801
- return addHeapObject(ret);
802
- };
803
- imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
804
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
805
- return addHeapObject(ret);
806
- };
807
- imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
808
- const ret = new Uint8Array(getObject(arg0));
809
- return addHeapObject(ret);
810
- };
811
- imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
812
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
813
- };
814
- imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
815
- const ret = getObject(arg0).length;
816
- return ret;
817
- };
818
- imports.wbg.__wbg_set_092e06b0f9d71865 = function() { return handleError(function (arg0, arg1, arg2) {
819
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
820
- return ret;
821
- }, arguments) };
822
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
823
- const ret = debugString(getObject(arg1));
824
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
825
- const len1 = WASM_VECTOR_LEN;
826
- getInt32Memory0()[arg0 / 4 + 1] = len1;
827
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
828
- };
829
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
830
- throw new Error(getStringFromWasm0(arg0, arg1));
831
- };
832
- imports.wbg.__wbindgen_memory = function() {
833
- const ret = wasm.memory;
834
- return addHeapObject(ret);
835
- };
836
- imports.wbg.__wbindgen_closure_wrapper231 = function(arg0, arg1, arg2) {
837
- const ret = makeClosure(arg0, arg1, 75, __wbg_adapter_18);
838
- return addHeapObject(ret);
839
- };
840
- imports.wbg.__wbindgen_closure_wrapper414 = function(arg0, arg1, arg2) {
841
- const ret = makeMutClosure(arg0, arg1, 135, __wbg_adapter_21);
842
- return addHeapObject(ret);
843
- };
844
- imports.wbg.__wbindgen_closure_wrapper689 = function(arg0, arg1, arg2) {
845
- const ret = makeMutClosure(arg0, arg1, 243, __wbg_adapter_24);
846
- return addHeapObject(ret);
847
- };
848
-
849
- return imports;
850
- }
851
-
852
- function __wbg_init_memory(imports, maybe_memory) {
853
-
854
- }
855
-
856
- function __wbg_finalize_init(instance, module) {
857
- wasm = instance.exports;
858
- __wbg_init.__wbindgen_wasm_module = module;
859
- cachedInt32Memory0 = null;
860
- cachedUint32Memory0 = null;
861
- cachedUint8Memory0 = null;
862
-
863
- wasm.__wbindgen_start();
864
- return wasm;
865
- }
866
-
867
- function initSync(module) {
868
- if (wasm !== undefined) return wasm;
869
-
870
- const imports = __wbg_get_imports();
871
-
872
- __wbg_init_memory(imports);
873
-
874
- if (!(module instanceof WebAssembly.Module)) {
875
- module = new WebAssembly.Module(module);
876
- }
877
-
878
- const instance = new WebAssembly.Instance(module, imports);
879
-
880
- return __wbg_finalize_init(instance, module);
881
- }
882
-
883
- async function __wbg_init(input) {
884
- if (wasm !== undefined) return wasm;
885
-
886
- if (typeof input === 'undefined') {
887
- input = new URL('app-8180fc49522e81a6_bg.wasm', import.meta.url);
888
- }
889
- const imports = __wbg_get_imports();
890
-
891
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
892
- input = fetch(input);
893
- }
894
-
895
- __wbg_init_memory(imports);
896
-
897
- const { instance, module } = await __wbg_load(await input, imports);
898
-
899
- return __wbg_finalize_init(instance, module);
900
- }
901
-
902
- export { initSync }
903
- export default __wbg_init;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app-8180fc49522e81a6_bg.wasm DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:204d9e0548261f40ec10822b97b3c9b5b9df874553b29bc8c92a905b845298c5
3
- size 300689
 
 
 
 
app-f2aa2f66427a1597.js DELETED
@@ -1,903 +0,0 @@
1
- let wasm;
2
-
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let heap_next = heap.length;
10
-
11
- function dropObject(idx) {
12
- if (idx < 132) return;
13
- heap[idx] = heap_next;
14
- heap_next = idx;
15
- }
16
-
17
- function takeObject(idx) {
18
- const ret = getObject(idx);
19
- dropObject(idx);
20
- return ret;
21
- }
22
-
23
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
24
-
25
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
26
-
27
- let cachedUint8Memory0 = null;
28
-
29
- function getUint8Memory0() {
30
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
31
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
32
- }
33
- return cachedUint8Memory0;
34
- }
35
-
36
- function getStringFromWasm0(ptr, len) {
37
- ptr = ptr >>> 0;
38
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
39
- }
40
-
41
- function addHeapObject(obj) {
42
- if (heap_next === heap.length) heap.push(heap.length + 1);
43
- const idx = heap_next;
44
- heap_next = heap[idx];
45
-
46
- heap[idx] = obj;
47
- return idx;
48
- }
49
-
50
- function debugString(val) {
51
- // primitive types
52
- const type = typeof val;
53
- if (type == 'number' || type == 'boolean' || val == null) {
54
- return `${val}`;
55
- }
56
- if (type == 'string') {
57
- return `"${val}"`;
58
- }
59
- if (type == 'symbol') {
60
- const description = val.description;
61
- if (description == null) {
62
- return 'Symbol';
63
- } else {
64
- return `Symbol(${description})`;
65
- }
66
- }
67
- if (type == 'function') {
68
- const name = val.name;
69
- if (typeof name == 'string' && name.length > 0) {
70
- return `Function(${name})`;
71
- } else {
72
- return 'Function';
73
- }
74
- }
75
- // objects
76
- if (Array.isArray(val)) {
77
- const length = val.length;
78
- let debug = '[';
79
- if (length > 0) {
80
- debug += debugString(val[0]);
81
- }
82
- for(let i = 1; i < length; i++) {
83
- debug += ', ' + debugString(val[i]);
84
- }
85
- debug += ']';
86
- return debug;
87
- }
88
- // Test for built-in
89
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
90
- let className;
91
- if (builtInMatches.length > 1) {
92
- className = builtInMatches[1];
93
- } else {
94
- // Failed to match the standard '[object ClassName]'
95
- return toString.call(val);
96
- }
97
- if (className == 'Object') {
98
- // we're a user defined class or Object
99
- // JSON.stringify avoids problems with cycles, and is generally much
100
- // easier than looping through ownProperties of `val`.
101
- try {
102
- return 'Object(' + JSON.stringify(val) + ')';
103
- } catch (_) {
104
- return 'Object';
105
- }
106
- }
107
- // errors
108
- if (val instanceof Error) {
109
- return `${val.name}: ${val.message}\n${val.stack}`;
110
- }
111
- // TODO we could test for more things here, like `Set`s and `Map`s.
112
- return className;
113
- }
114
-
115
- let WASM_VECTOR_LEN = 0;
116
-
117
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
118
-
119
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
120
- ? function (arg, view) {
121
- return cachedTextEncoder.encodeInto(arg, view);
122
- }
123
- : function (arg, view) {
124
- const buf = cachedTextEncoder.encode(arg);
125
- view.set(buf);
126
- return {
127
- read: arg.length,
128
- written: buf.length
129
- };
130
- });
131
-
132
- function passStringToWasm0(arg, malloc, realloc) {
133
-
134
- if (realloc === undefined) {
135
- const buf = cachedTextEncoder.encode(arg);
136
- const ptr = malloc(buf.length, 1) >>> 0;
137
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
138
- WASM_VECTOR_LEN = buf.length;
139
- return ptr;
140
- }
141
-
142
- let len = arg.length;
143
- let ptr = malloc(len, 1) >>> 0;
144
-
145
- const mem = getUint8Memory0();
146
-
147
- let offset = 0;
148
-
149
- for (; offset < len; offset++) {
150
- const code = arg.charCodeAt(offset);
151
- if (code > 0x7F) break;
152
- mem[ptr + offset] = code;
153
- }
154
-
155
- if (offset !== len) {
156
- if (offset !== 0) {
157
- arg = arg.slice(offset);
158
- }
159
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
160
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
161
- const ret = encodeString(arg, view);
162
-
163
- offset += ret.written;
164
- }
165
-
166
- WASM_VECTOR_LEN = offset;
167
- return ptr;
168
- }
169
-
170
- let cachedInt32Memory0 = null;
171
-
172
- function getInt32Memory0() {
173
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
174
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
175
- }
176
- return cachedInt32Memory0;
177
- }
178
-
179
- function makeClosure(arg0, arg1, dtor, f) {
180
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
181
- const real = (...args) => {
182
- // First up with a closure we increment the internal reference
183
- // count. This ensures that the Rust closure environment won't
184
- // be deallocated while we're invoking it.
185
- state.cnt++;
186
- try {
187
- return f(state.a, state.b, ...args);
188
- } finally {
189
- if (--state.cnt === 0) {
190
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
191
- state.a = 0;
192
-
193
- }
194
- }
195
- };
196
- real.original = state;
197
-
198
- return real;
199
- }
200
- function __wbg_adapter_18(arg0, arg1, arg2) {
201
- wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc207f5929a2adaf3(arg0, arg1, addHeapObject(arg2));
202
- }
203
-
204
- function makeMutClosure(arg0, arg1, dtor, f) {
205
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
206
- const real = (...args) => {
207
- // First up with a closure we increment the internal reference
208
- // count. This ensures that the Rust closure environment won't
209
- // be deallocated while we're invoking it.
210
- state.cnt++;
211
- const a = state.a;
212
- state.a = 0;
213
- try {
214
- return f(a, state.b, ...args);
215
- } finally {
216
- if (--state.cnt === 0) {
217
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
218
-
219
- } else {
220
- state.a = a;
221
- }
222
- }
223
- };
224
- real.original = state;
225
-
226
- return real;
227
- }
228
-
229
- let stack_pointer = 128;
230
-
231
- function addBorrowedObject(obj) {
232
- if (stack_pointer == 1) throw new Error('out of js stack');
233
- heap[--stack_pointer] = obj;
234
- return stack_pointer;
235
- }
236
- function __wbg_adapter_21(arg0, arg1, arg2) {
237
- try {
238
- wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha9364e9f993015fa(arg0, arg1, addBorrowedObject(arg2));
239
- } finally {
240
- heap[stack_pointer++] = undefined;
241
- }
242
- }
243
-
244
- function __wbg_adapter_24(arg0, arg1, arg2) {
245
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h93a8c686e0ffa704(arg0, arg1, addHeapObject(arg2));
246
- }
247
-
248
- function isLikeNone(x) {
249
- return x === undefined || x === null;
250
- }
251
-
252
- let cachedUint32Memory0 = null;
253
-
254
- function getUint32Memory0() {
255
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
256
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
257
- }
258
- return cachedUint32Memory0;
259
- }
260
-
261
- function getArrayJsValueFromWasm0(ptr, len) {
262
- ptr = ptr >>> 0;
263
- const mem = getUint32Memory0();
264
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
265
- const result = [];
266
- for (let i = 0; i < slice.length; i++) {
267
- result.push(takeObject(slice[i]));
268
- }
269
- return result;
270
- }
271
-
272
- function handleError(f, args) {
273
- try {
274
- return f.apply(this, args);
275
- } catch (e) {
276
- wasm.__wbindgen_exn_store(addHeapObject(e));
277
- }
278
- }
279
-
280
- async function __wbg_load(module, imports) {
281
- if (typeof Response === 'function' && module instanceof Response) {
282
- if (typeof WebAssembly.instantiateStreaming === 'function') {
283
- try {
284
- return await WebAssembly.instantiateStreaming(module, imports);
285
-
286
- } catch (e) {
287
- if (module.headers.get('Content-Type') != 'application/wasm') {
288
- 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", e);
289
-
290
- } else {
291
- throw e;
292
- }
293
- }
294
- }
295
-
296
- const bytes = await module.arrayBuffer();
297
- return await WebAssembly.instantiate(bytes, imports);
298
-
299
- } else {
300
- const instance = await WebAssembly.instantiate(module, imports);
301
-
302
- if (instance instanceof WebAssembly.Instance) {
303
- return { instance, module };
304
-
305
- } else {
306
- return instance;
307
- }
308
- }
309
- }
310
-
311
- function __wbg_get_imports() {
312
- const imports = {};
313
- imports.wbg = {};
314
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
315
- takeObject(arg0);
316
- };
317
- imports.wbg.__wbg_log_65d20c5d9fc43b86 = function(arg0, arg1) {
318
- console.log(getStringFromWasm0(arg0, arg1));
319
- };
320
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
321
- const ret = getStringFromWasm0(arg0, arg1);
322
- return addHeapObject(ret);
323
- };
324
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
325
- const ret = getObject(arg0);
326
- return addHeapObject(ret);
327
- };
328
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
329
- const obj = takeObject(arg0).original;
330
- if (obj.cnt-- == 1) {
331
- obj.a = 0;
332
- return true;
333
- }
334
- const ret = false;
335
- return ret;
336
- };
337
- imports.wbg.__wbg_cachekey_b61393159c57fd7b = function(arg0, arg1) {
338
- const ret = getObject(arg1).__yew_subtree_cache_key;
339
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
340
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
341
- };
342
- imports.wbg.__wbg_subtreeid_e348577f7ef777e3 = function(arg0, arg1) {
343
- const ret = getObject(arg1).__yew_subtree_id;
344
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
345
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
346
- };
347
- imports.wbg.__wbg_setsubtreeid_d32e6327eef1f7fc = function(arg0, arg1) {
348
- getObject(arg0).__yew_subtree_id = arg1 >>> 0;
349
- };
350
- imports.wbg.__wbg_setcachekey_80183b7cfc421143 = function(arg0, arg1) {
351
- getObject(arg0).__yew_subtree_cache_key = arg1 >>> 0;
352
- };
353
- imports.wbg.__wbg_listenerid_12315eee21527820 = function(arg0, arg1) {
354
- const ret = getObject(arg1).__yew_listener_id;
355
- getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret;
356
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
357
- };
358
- imports.wbg.__wbg_setlistenerid_3183aae8fa5840fb = function(arg0, arg1) {
359
- getObject(arg0).__yew_listener_id = arg1 >>> 0;
360
- };
361
- imports.wbg.__wbg_error_71d6845bf00a930f = function(arg0, arg1) {
362
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
363
- wasm.__wbindgen_free(arg0, arg1 * 4);
364
- console.error(...v0);
365
- };
366
- imports.wbg.__wbg_warn_0b90a269a514ae1d = function(arg0, arg1) {
367
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
368
- wasm.__wbindgen_free(arg0, arg1 * 4);
369
- console.warn(...v0);
370
- };
371
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
372
- const ret = new Error();
373
- return addHeapObject(ret);
374
- };
375
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
376
- const ret = getObject(arg1).stack;
377
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
378
- const len1 = WASM_VECTOR_LEN;
379
- getInt32Memory0()[arg0 / 4 + 1] = len1;
380
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
381
- };
382
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
383
- let deferred0_0;
384
- let deferred0_1;
385
- try {
386
- deferred0_0 = arg0;
387
- deferred0_1 = arg1;
388
- console.error(getStringFromWasm0(arg0, arg1));
389
- } finally {
390
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
391
- }
392
- };
393
- imports.wbg.__wbg_location_7ac41949b772ef21 = function(arg0) {
394
- const ret = getObject(arg0).location;
395
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
396
- };
397
- imports.wbg.__wbg_body_674aec4c1c0910cd = function(arg0) {
398
- const ret = getObject(arg0).body;
399
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
400
- };
401
- imports.wbg.__wbg_createElement_4891554b28d3388b = function() { return handleError(function (arg0, arg1, arg2) {
402
- const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2));
403
- return addHeapObject(ret);
404
- }, arguments) };
405
- imports.wbg.__wbg_createElementNS_119acf9e82482041 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
406
- const ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
407
- return addHeapObject(ret);
408
- }, arguments) };
409
- imports.wbg.__wbg_createTextNode_2fd22cd7e543f938 = function(arg0, arg1, arg2) {
410
- const ret = getObject(arg0).createTextNode(getStringFromWasm0(arg1, arg2));
411
- return addHeapObject(ret);
412
- };
413
- imports.wbg.__wbg_getElementById_cc0e0d931b0d9a28 = function(arg0, arg1, arg2) {
414
- const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
415
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
416
- };
417
- imports.wbg.__wbg_instanceof_Window_9029196b662bc42a = function(arg0) {
418
- let result;
419
- try {
420
- result = getObject(arg0) instanceof Window;
421
- } catch {
422
- result = false;
423
- }
424
- const ret = result;
425
- return ret;
426
- };
427
- imports.wbg.__wbg_document_f7ace2b956f30a4f = function(arg0) {
428
- const ret = getObject(arg0).document;
429
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
430
- };
431
- imports.wbg.__wbg_location_56243dba507f472d = function(arg0) {
432
- const ret = getObject(arg0).location;
433
- return addHeapObject(ret);
434
- };
435
- imports.wbg.__wbg_performance_2c295061c8b01e0b = function(arg0) {
436
- const ret = getObject(arg0).performance;
437
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
438
- };
439
- imports.wbg.__wbg_fetch_336b6f0cb426b46e = function(arg0, arg1) {
440
- const ret = getObject(arg0).fetch(getObject(arg1));
441
- return addHeapObject(ret);
442
- };
443
- imports.wbg.__wbg_newwithstrsequenceandoptions_fd88a547f6d15707 = function() { return handleError(function (arg0, arg1) {
444
- const ret = new Blob(getObject(arg0), getObject(arg1));
445
- return addHeapObject(ret);
446
- }, arguments) };
447
- imports.wbg.__wbg_arrayBuffer_27cefaea55cbf063 = function(arg0) {
448
- const ret = getObject(arg0).arrayBuffer();
449
- return addHeapObject(ret);
450
- };
451
- imports.wbg.__wbg_value_3c5f08ffc2b7d6f9 = function(arg0, arg1) {
452
- const ret = getObject(arg1).value;
453
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
454
- const len1 = WASM_VECTOR_LEN;
455
- getInt32Memory0()[arg0 / 4 + 1] = len1;
456
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
457
- };
458
- imports.wbg.__wbg_setvalue_0dc100d4b9908028 = function(arg0, arg1, arg2) {
459
- getObject(arg0).value = getStringFromWasm0(arg1, arg2);
460
- };
461
- imports.wbg.__wbg_setchecked_e5a50baea447b8a8 = function(arg0, arg1) {
462
- getObject(arg0).checked = arg1 !== 0;
463
- };
464
- imports.wbg.__wbg_value_9423da9d988ee8cf = function(arg0, arg1) {
465
- const ret = getObject(arg1).value;
466
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
- const len1 = WASM_VECTOR_LEN;
468
- getInt32Memory0()[arg0 / 4 + 1] = len1;
469
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
470
- };
471
- imports.wbg.__wbg_setvalue_1f95e61cbc382f7f = function(arg0, arg1, arg2) {
472
- getObject(arg0).value = getStringFromWasm0(arg1, arg2);
473
- };
474
- imports.wbg.__wbg_setonmessage_f0bd0280573b7084 = function(arg0, arg1) {
475
- getObject(arg0).onmessage = getObject(arg1);
476
- };
477
- imports.wbg.__wbg_new_8e7322f46d5d019c = function() { return handleError(function (arg0, arg1) {
478
- const ret = new Worker(getStringFromWasm0(arg0, arg1));
479
- return addHeapObject(ret);
480
- }, arguments) };
481
- imports.wbg.__wbg_newwithoptions_1bd20b45061ed935 = function() { return handleError(function (arg0, arg1, arg2) {
482
- const ret = new Worker(getStringFromWasm0(arg0, arg1), getObject(arg2));
483
- return addHeapObject(ret);
484
- }, arguments) };
485
- imports.wbg.__wbg_postMessage_8c609e2bde333d9c = function() { return handleError(function (arg0, arg1) {
486
- getObject(arg0).postMessage(getObject(arg1));
487
- }, arguments) };
488
- imports.wbg.__wbg_instanceof_HtmlImageElement_7654818e144eb606 = function(arg0) {
489
- let result;
490
- try {
491
- result = getObject(arg0) instanceof HTMLImageElement;
492
- } catch {
493
- result = false;
494
- }
495
- const ret = result;
496
- return ret;
497
- };
498
- imports.wbg.__wbg_naturalWidth_4bff132b1f2485e3 = function(arg0) {
499
- const ret = getObject(arg0).naturalWidth;
500
- return ret;
501
- };
502
- imports.wbg.__wbg_naturalHeight_e24df358ecfe26a8 = function(arg0) {
503
- const ret = getObject(arg0).naturalHeight;
504
- return ret;
505
- };
506
- imports.wbg.__wbg_newwithstrandinit_cad5cd6038c7ff5d = function() { return handleError(function (arg0, arg1, arg2) {
507
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
508
- return addHeapObject(ret);
509
- }, arguments) };
510
- imports.wbg.__wbg_debug_9b8701f894da9929 = function(arg0, arg1, arg2, arg3) {
511
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
512
- };
513
- imports.wbg.__wbg_error_788ae33f81d3b84b = function(arg0) {
514
- console.error(getObject(arg0));
515
- };
516
- imports.wbg.__wbg_error_d9bce418caafb712 = function(arg0, arg1, arg2, arg3) {
517
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
518
- };
519
- imports.wbg.__wbg_info_bb52f40b06f679de = function(arg0, arg1, arg2, arg3) {
520
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
521
- };
522
- imports.wbg.__wbg_log_ea7093e35e3efd07 = function(arg0, arg1, arg2, arg3) {
523
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
524
- };
525
- imports.wbg.__wbg_warn_dfc0e0cf544a13bd = function(arg0, arg1, arg2, arg3) {
526
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
527
- };
528
- imports.wbg.__wbg_instanceof_Element_4622f5da1249a3eb = function(arg0) {
529
- let result;
530
- try {
531
- result = getObject(arg0) instanceof Element;
532
- } catch {
533
- result = false;
534
- }
535
- const ret = result;
536
- return ret;
537
- };
538
- imports.wbg.__wbg_namespaceURI_31718ed49b5343a3 = function(arg0, arg1) {
539
- const ret = getObject(arg1).namespaceURI;
540
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
541
- var len1 = WASM_VECTOR_LEN;
542
- getInt32Memory0()[arg0 / 4 + 1] = len1;
543
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
544
- };
545
- imports.wbg.__wbg_setinnerHTML_b089587252408b67 = function(arg0, arg1, arg2) {
546
- getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2);
547
- };
548
- imports.wbg.__wbg_outerHTML_f7749ceff37b5832 = function(arg0, arg1) {
549
- const ret = getObject(arg1).outerHTML;
550
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
551
- const len1 = WASM_VECTOR_LEN;
552
- getInt32Memory0()[arg0 / 4 + 1] = len1;
553
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
554
- };
555
- imports.wbg.__wbg_children_27ed308801b57d3f = function(arg0) {
556
- const ret = getObject(arg0).children;
557
- return addHeapObject(ret);
558
- };
559
- imports.wbg.__wbg_removeAttribute_d8404da431968808 = function() { return handleError(function (arg0, arg1, arg2) {
560
- getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2));
561
- }, arguments) };
562
- imports.wbg.__wbg_setAttribute_e7e80b478b7b8b2f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
563
- getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
564
- }, arguments) };
565
- imports.wbg.__wbg_instanceof_CanvasRenderingContext2d_bc0a6635c96eca9b = function(arg0) {
566
- let result;
567
- try {
568
- result = getObject(arg0) instanceof CanvasRenderingContext2D;
569
- } catch {
570
- result = false;
571
- }
572
- const ret = result;
573
- return ret;
574
- };
575
- imports.wbg.__wbg_setstrokeStyle_3fe4d1c0d11ed1b6 = function(arg0, arg1) {
576
- getObject(arg0).strokeStyle = getObject(arg1);
577
- };
578
- imports.wbg.__wbg_setfillStyle_401fa583a1c8863c = function(arg0, arg1) {
579
- getObject(arg0).fillStyle = getObject(arg1);
580
- };
581
- imports.wbg.__wbg_drawImage_9758fa4c03ab8fc8 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
582
- getObject(arg0).drawImage(getObject(arg1), arg2, arg3);
583
- }, arguments) };
584
- imports.wbg.__wbg_fillRect_e285f7b46668b7fa = function(arg0, arg1, arg2, arg3, arg4) {
585
- getObject(arg0).fillRect(arg1, arg2, arg3, arg4);
586
- };
587
- imports.wbg.__wbg_strokeRect_eef5919e98439115 = function(arg0, arg1, arg2, arg3, arg4) {
588
- getObject(arg0).strokeRect(arg1, arg2, arg3, arg4);
589
- };
590
- imports.wbg.__wbg_fillText_ba4313e6835ce7ea = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
591
- getObject(arg0).fillText(getStringFromWasm0(arg1, arg2), arg3, arg4);
592
- }, arguments) };
593
- imports.wbg.__wbg_measureText_b5b4d14da44a57c5 = function() { return handleError(function (arg0, arg1, arg2) {
594
- const ret = getObject(arg0).measureText(getStringFromWasm0(arg1, arg2));
595
- return addHeapObject(ret);
596
- }, arguments) };
597
- imports.wbg.__wbg_data_ab99ae4a2e1e8bc9 = function(arg0) {
598
- const ret = getObject(arg0).data;
599
- return addHeapObject(ret);
600
- };
601
- imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
602
- const ret = getObject(arg0).now();
603
- return ret;
604
- };
605
- imports.wbg.__wbg_instanceof_HtmlCanvasElement_da5f9efa0688cf6d = function(arg0) {
606
- let result;
607
- try {
608
- result = getObject(arg0) instanceof HTMLCanvasElement;
609
- } catch {
610
- result = false;
611
- }
612
- const ret = result;
613
- return ret;
614
- };
615
- imports.wbg.__wbg_setwidth_a667a942dba6656e = function(arg0, arg1) {
616
- getObject(arg0).width = arg1 >>> 0;
617
- };
618
- imports.wbg.__wbg_setheight_a747d440760fe5aa = function(arg0, arg1) {
619
- getObject(arg0).height = arg1 >>> 0;
620
- };
621
- imports.wbg.__wbg_getContext_7c5944ea807bf5d3 = function() { return handleError(function (arg0, arg1, arg2) {
622
- const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
623
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
624
- }, arguments) };
625
- imports.wbg.__wbg_instanceof_Response_fc4327dbfcdf5ced = function(arg0) {
626
- let result;
627
- try {
628
- result = getObject(arg0) instanceof Response;
629
- } catch {
630
- result = false;
631
- }
632
- const ret = result;
633
- return ret;
634
- };
635
- imports.wbg.__wbg_blob_34990e4300d45f53 = function() { return handleError(function (arg0) {
636
- const ret = getObject(arg0).blob();
637
- return addHeapObject(ret);
638
- }, arguments) };
639
- imports.wbg.__wbg_width_5b91f61af2d11adc = function(arg0) {
640
- const ret = getObject(arg0).width;
641
- return ret;
642
- };
643
- imports.wbg.__wbg_bubbles_63572b91f3885ef1 = function(arg0) {
644
- const ret = getObject(arg0).bubbles;
645
- return ret;
646
- };
647
- imports.wbg.__wbg_cancelBubble_90d1c3aa2a76cbeb = function(arg0) {
648
- const ret = getObject(arg0).cancelBubble;
649
- return ret;
650
- };
651
- imports.wbg.__wbg_composedPath_cf1bb5b8bcff496f = function(arg0) {
652
- const ret = getObject(arg0).composedPath();
653
- return addHeapObject(ret);
654
- };
655
- imports.wbg.__wbg_parentNode_9e53f8b17eb98c9d = function(arg0) {
656
- const ret = getObject(arg0).parentNode;
657
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
658
- };
659
- imports.wbg.__wbg_parentElement_c75962bc9997ea5f = function(arg0) {
660
- const ret = getObject(arg0).parentElement;
661
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
662
- };
663
- imports.wbg.__wbg_lastChild_0cee692010bac6c2 = function(arg0) {
664
- const ret = getObject(arg0).lastChild;
665
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
666
- };
667
- imports.wbg.__wbg_nextSibling_304d9aac7c2774ae = function(arg0) {
668
- const ret = getObject(arg0).nextSibling;
669
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
670
- };
671
- imports.wbg.__wbg_setnodeValue_d1c8382910b45e04 = function(arg0, arg1, arg2) {
672
- getObject(arg0).nodeValue = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
673
- };
674
- imports.wbg.__wbg_textContent_c5d9e21ee03c63d4 = function(arg0, arg1) {
675
- const ret = getObject(arg1).textContent;
676
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
677
- var len1 = WASM_VECTOR_LEN;
678
- getInt32Memory0()[arg0 / 4 + 1] = len1;
679
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
680
- };
681
- imports.wbg.__wbg_appendChild_51339d4cde00ee22 = function() { return handleError(function (arg0, arg1) {
682
- const ret = getObject(arg0).appendChild(getObject(arg1));
683
- return addHeapObject(ret);
684
- }, arguments) };
685
- imports.wbg.__wbg_insertBefore_ffa01d4b747c95fc = function() { return handleError(function (arg0, arg1, arg2) {
686
- const ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
687
- return addHeapObject(ret);
688
- }, arguments) };
689
- imports.wbg.__wbg_removeChild_973429f368206138 = function() { return handleError(function (arg0, arg1) {
690
- const ret = getObject(arg0).removeChild(getObject(arg1));
691
- return addHeapObject(ret);
692
- }, arguments) };
693
- imports.wbg.__wbg_addEventListener_a5963e26cd7b176b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
694
- getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
695
- }, arguments) };
696
- imports.wbg.__wbg_origin_50aa482fa6784a0a = function() { return handleError(function (arg0, arg1) {
697
- const ret = getObject(arg1).origin;
698
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
699
- const len1 = WASM_VECTOR_LEN;
700
- getInt32Memory0()[arg0 / 4 + 1] = len1;
701
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
702
- }, arguments) };
703
- imports.wbg.__wbg_pathname_c8fd5c498079312d = function() { return handleError(function (arg0, arg1) {
704
- const ret = getObject(arg1).pathname;
705
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
706
- const len1 = WASM_VECTOR_LEN;
707
- getInt32Memory0()[arg0 / 4 + 1] = len1;
708
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
709
- }, arguments) };
710
- imports.wbg.__wbg_instanceof_ShadowRoot_b64337370f59fe2d = function(arg0) {
711
- let result;
712
- try {
713
- result = getObject(arg0) instanceof ShadowRoot;
714
- } catch {
715
- result = false;
716
- }
717
- const ret = result;
718
- return ret;
719
- };
720
- imports.wbg.__wbg_host_e1c47c33975060d3 = function(arg0) {
721
- const ret = getObject(arg0).host;
722
- return addHeapObject(ret);
723
- };
724
- imports.wbg.__wbg_createObjectURL_d82f2880bada6a1d = function() { return handleError(function (arg0, arg1) {
725
- const ret = URL.createObjectURL(getObject(arg1));
726
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
727
- const len1 = WASM_VECTOR_LEN;
728
- getInt32Memory0()[arg0 / 4 + 1] = len1;
729
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
730
- }, arguments) };
731
- imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
732
- const ret = getObject(arg0)[arg1 >>> 0];
733
- return addHeapObject(ret);
734
- };
735
- imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) {
736
- const ret = getObject(arg0).length;
737
- return ret;
738
- };
739
- imports.wbg.__wbg_new_898a68150f225f2e = function() {
740
- const ret = new Array();
741
- return addHeapObject(ret);
742
- };
743
- imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
744
- const ret = new Function(getStringFromWasm0(arg0, arg1));
745
- return addHeapObject(ret);
746
- };
747
- imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
748
- const ret = getObject(arg0).call(getObject(arg1));
749
- return addHeapObject(ret);
750
- }, arguments) };
751
- imports.wbg.__wbg_new_b51585de1b234aff = function() {
752
- const ret = new Object();
753
- return addHeapObject(ret);
754
- };
755
- imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
756
- const ret = self.self;
757
- return addHeapObject(ret);
758
- }, arguments) };
759
- imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () {
760
- const ret = window.window;
761
- return addHeapObject(ret);
762
- }, arguments) };
763
- imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () {
764
- const ret = globalThis.globalThis;
765
- return addHeapObject(ret);
766
- }, arguments) };
767
- imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () {
768
- const ret = global.global;
769
- return addHeapObject(ret);
770
- }, arguments) };
771
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
772
- const ret = getObject(arg0) === undefined;
773
- return ret;
774
- };
775
- imports.wbg.__wbg_from_d7c216d4616bb368 = function(arg0) {
776
- const ret = Array.from(getObject(arg0));
777
- return addHeapObject(ret);
778
- };
779
- imports.wbg.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
780
- const ret = getObject(arg0).push(getObject(arg1));
781
- return ret;
782
- };
783
- imports.wbg.__wbg_is_205d914af04a8faa = function(arg0, arg1) {
784
- const ret = Object.is(getObject(arg0), getObject(arg1));
785
- return ret;
786
- };
787
- imports.wbg.__wbg_resolve_53698b95aaf7fcf8 = function(arg0) {
788
- const ret = Promise.resolve(getObject(arg0));
789
- return addHeapObject(ret);
790
- };
791
- imports.wbg.__wbg_then_f7e06ee3c11698eb = function(arg0, arg1) {
792
- const ret = getObject(arg0).then(getObject(arg1));
793
- return addHeapObject(ret);
794
- };
795
- imports.wbg.__wbg_then_b2267541e2a73865 = function(arg0, arg1, arg2) {
796
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
797
- return addHeapObject(ret);
798
- };
799
- imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
800
- const ret = getObject(arg0).buffer;
801
- return addHeapObject(ret);
802
- };
803
- imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
804
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
805
- return addHeapObject(ret);
806
- };
807
- imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
808
- const ret = new Uint8Array(getObject(arg0));
809
- return addHeapObject(ret);
810
- };
811
- imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
812
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
813
- };
814
- imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
815
- const ret = getObject(arg0).length;
816
- return ret;
817
- };
818
- imports.wbg.__wbg_set_092e06b0f9d71865 = function() { return handleError(function (arg0, arg1, arg2) {
819
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
820
- return ret;
821
- }, arguments) };
822
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
823
- const ret = debugString(getObject(arg1));
824
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
825
- const len1 = WASM_VECTOR_LEN;
826
- getInt32Memory0()[arg0 / 4 + 1] = len1;
827
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
828
- };
829
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
830
- throw new Error(getStringFromWasm0(arg0, arg1));
831
- };
832
- imports.wbg.__wbindgen_memory = function() {
833
- const ret = wasm.memory;
834
- return addHeapObject(ret);
835
- };
836
- imports.wbg.__wbindgen_closure_wrapper265 = function(arg0, arg1, arg2) {
837
- const ret = makeClosure(arg0, arg1, 80, __wbg_adapter_18);
838
- return addHeapObject(ret);
839
- };
840
- imports.wbg.__wbindgen_closure_wrapper415 = function(arg0, arg1, arg2) {
841
- const ret = makeMutClosure(arg0, arg1, 136, __wbg_adapter_21);
842
- return addHeapObject(ret);
843
- };
844
- imports.wbg.__wbindgen_closure_wrapper690 = function(arg0, arg1, arg2) {
845
- const ret = makeMutClosure(arg0, arg1, 244, __wbg_adapter_24);
846
- return addHeapObject(ret);
847
- };
848
-
849
- return imports;
850
- }
851
-
852
- function __wbg_init_memory(imports, maybe_memory) {
853
-
854
- }
855
-
856
- function __wbg_finalize_init(instance, module) {
857
- wasm = instance.exports;
858
- __wbg_init.__wbindgen_wasm_module = module;
859
- cachedInt32Memory0 = null;
860
- cachedUint32Memory0 = null;
861
- cachedUint8Memory0 = null;
862
-
863
- wasm.__wbindgen_start();
864
- return wasm;
865
- }
866
-
867
- function initSync(module) {
868
- if (wasm !== undefined) return wasm;
869
-
870
- const imports = __wbg_get_imports();
871
-
872
- __wbg_init_memory(imports);
873
-
874
- if (!(module instanceof WebAssembly.Module)) {
875
- module = new WebAssembly.Module(module);
876
- }
877
-
878
- const instance = new WebAssembly.Instance(module, imports);
879
-
880
- return __wbg_finalize_init(instance, module);
881
- }
882
-
883
- async function __wbg_init(input) {
884
- if (wasm !== undefined) return wasm;
885
-
886
- if (typeof input === 'undefined') {
887
- input = new URL('app-f2aa2f66427a1597_bg.wasm', import.meta.url);
888
- }
889
- const imports = __wbg_get_imports();
890
-
891
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
892
- input = fetch(input);
893
- }
894
-
895
- __wbg_init_memory(imports);
896
-
897
- const { instance, module } = await __wbg_load(await input, imports);
898
-
899
- return __wbg_finalize_init(instance, module);
900
- }
901
-
902
- export { initSync }
903
- export default __wbg_init;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app-f2aa2f66427a1597_bg.wasm DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a1386b515aff4fa9883899853d3d29206349fdcb628b5fe4faf470cc18894892
3
- size 300806
 
 
 
 
bike.jpeg DELETED
Binary file (172 kB)
 
build/index.html DELETED
@@ -1,23 +0,0 @@
1
- <html>
2
- <head>
3
- <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
4
- </head>
5
- <body>
6
- <script type="module">
7
- import init, { Model } from './m.js';
8
-
9
- await init();
10
-
11
- const yolo_response = await fetch('../yolo.safetensors');
12
- const yolo_data = await yolo_response.arrayBuffer();
13
- const model_weights = new Uint8Array(yolo_data);
14
- let m = new Model(model_weights);
15
-
16
- const img_response = await fetch('../bike.jpeg');
17
- const img_data = await img_response.arrayBuffer();
18
- let image_data = new Uint8Array(img_data);
19
- let bboxes = m.run(image_data);
20
- console.log(bboxes);
21
- </script>
22
- </body>
23
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
build/m.d.ts CHANGED
@@ -6,13 +6,16 @@ export class Model {
6
  free(): void;
7
  /**
8
  * @param {Uint8Array} data
 
9
  */
10
- constructor(data: Uint8Array);
11
  /**
12
  * @param {Uint8Array} image
 
 
13
  * @returns {string}
14
  */
15
- run(image: Uint8Array): string;
16
  }
17
 
18
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -20,11 +23,12 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
20
  export interface InitOutput {
21
  readonly memory: WebAssembly.Memory;
22
  readonly __wbg_model_free: (a: number) => void;
23
- readonly model_new: (a: number, b: number, c: number) => void;
24
- readonly model_run: (a: number, b: number, c: number, d: number) => void;
25
  readonly main: (a: number, b: number) => number;
26
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
27
  readonly __wbindgen_malloc: (a: number, b: number) => number;
 
28
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
29
  readonly __wbindgen_exn_store: (a: number) => void;
30
  readonly __wbindgen_start: () => void;
 
6
  free(): void;
7
  /**
8
  * @param {Uint8Array} data
9
+ * @param {string} model_size
10
  */
11
+ constructor(data: Uint8Array, model_size: string);
12
  /**
13
  * @param {Uint8Array} image
14
+ * @param {number} conf_threshold
15
+ * @param {number} iou_threshold
16
  * @returns {string}
17
  */
18
+ run(image: Uint8Array, conf_threshold: number, iou_threshold: number): string;
19
  }
20
 
21
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
 
23
  export interface InitOutput {
24
  readonly memory: WebAssembly.Memory;
25
  readonly __wbg_model_free: (a: number) => void;
26
+ readonly model_new: (a: number, b: number, c: number, d: number, e: number) => void;
27
+ readonly model_run: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
28
  readonly main: (a: number, b: number) => number;
29
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
30
  readonly __wbindgen_malloc: (a: number, b: number) => number;
31
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
32
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
33
  readonly __wbindgen_exn_store: (a: number) => void;
34
  readonly __wbindgen_start: () => void;
build/m.js CHANGED
@@ -56,6 +56,59 @@ function passArray8ToWasm0(arg, malloc) {
56
  return ptr;
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  let cachedInt32Memory0 = null;
60
 
61
  function getInt32Memory0() {
@@ -97,13 +150,16 @@ export class Model {
97
  }
98
  /**
99
  * @param {Uint8Array} data
 
100
  */
101
- constructor(data) {
102
  try {
103
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
104
  const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
105
  const len0 = WASM_VECTOR_LEN;
106
- wasm.model_new(retptr, ptr0, len0);
 
 
107
  var r0 = getInt32Memory0()[retptr / 4 + 0];
108
  var r1 = getInt32Memory0()[retptr / 4 + 1];
109
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -117,16 +173,18 @@ export class Model {
117
  }
118
  /**
119
  * @param {Uint8Array} image
 
 
120
  * @returns {string}
121
  */
122
- run(image) {
123
  let deferred3_0;
124
  let deferred3_1;
125
  try {
126
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
127
  const ptr0 = passArray8ToWasm0(image, wasm.__wbindgen_malloc);
128
  const len0 = WASM_VECTOR_LEN;
129
- wasm.model_run(retptr, this.__wbg_ptr, ptr0, len0);
130
  var r0 = getInt32Memory0()[retptr / 4 + 0];
131
  var r1 = getInt32Memory0()[retptr / 4 + 1];
132
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -185,6 +243,9 @@ function __wbg_get_imports() {
185
  const ret = new Error(getStringFromWasm0(arg0, arg1));
186
  return addHeapObject(ret);
187
  };
 
 
 
188
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
189
  takeObject(arg0);
190
  };
@@ -196,9 +257,6 @@ function __wbg_get_imports() {
196
  const ret = getObject(arg0);
197
  return addHeapObject(ret);
198
  };
199
- imports.wbg.__wbg_log_65d20c5d9fc43b86 = function(arg0, arg1) {
200
- console.log(getStringFromWasm0(arg0, arg1));
201
- };
202
  imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
203
  const ret = getObject(arg0).crypto;
204
  return addHeapObject(ret);
 
56
  return ptr;
57
  }
58
 
59
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
60
+
61
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
62
+ ? function (arg, view) {
63
+ return cachedTextEncoder.encodeInto(arg, view);
64
+ }
65
+ : function (arg, view) {
66
+ const buf = cachedTextEncoder.encode(arg);
67
+ view.set(buf);
68
+ return {
69
+ read: arg.length,
70
+ written: buf.length
71
+ };
72
+ });
73
+
74
+ function passStringToWasm0(arg, malloc, realloc) {
75
+
76
+ if (realloc === undefined) {
77
+ const buf = cachedTextEncoder.encode(arg);
78
+ const ptr = malloc(buf.length, 1) >>> 0;
79
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
80
+ WASM_VECTOR_LEN = buf.length;
81
+ return ptr;
82
+ }
83
+
84
+ let len = arg.length;
85
+ let ptr = malloc(len, 1) >>> 0;
86
+
87
+ const mem = getUint8Memory0();
88
+
89
+ let offset = 0;
90
+
91
+ for (; offset < len; offset++) {
92
+ const code = arg.charCodeAt(offset);
93
+ if (code > 0x7F) break;
94
+ mem[ptr + offset] = code;
95
+ }
96
+
97
+ if (offset !== len) {
98
+ if (offset !== 0) {
99
+ arg = arg.slice(offset);
100
+ }
101
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
102
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
103
+ const ret = encodeString(arg, view);
104
+
105
+ offset += ret.written;
106
+ }
107
+
108
+ WASM_VECTOR_LEN = offset;
109
+ return ptr;
110
+ }
111
+
112
  let cachedInt32Memory0 = null;
113
 
114
  function getInt32Memory0() {
 
150
  }
151
  /**
152
  * @param {Uint8Array} data
153
+ * @param {string} model_size
154
  */
155
+ constructor(data, model_size) {
156
  try {
157
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
158
  const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
159
  const len0 = WASM_VECTOR_LEN;
160
+ const ptr1 = passStringToWasm0(model_size, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
161
+ const len1 = WASM_VECTOR_LEN;
162
+ wasm.model_new(retptr, ptr0, len0, ptr1, len1);
163
  var r0 = getInt32Memory0()[retptr / 4 + 0];
164
  var r1 = getInt32Memory0()[retptr / 4 + 1];
165
  var r2 = getInt32Memory0()[retptr / 4 + 2];
 
173
  }
174
  /**
175
  * @param {Uint8Array} image
176
+ * @param {number} conf_threshold
177
+ * @param {number} iou_threshold
178
  * @returns {string}
179
  */
180
+ run(image, conf_threshold, iou_threshold) {
181
  let deferred3_0;
182
  let deferred3_1;
183
  try {
184
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
185
  const ptr0 = passArray8ToWasm0(image, wasm.__wbindgen_malloc);
186
  const len0 = WASM_VECTOR_LEN;
187
+ wasm.model_run(retptr, this.__wbg_ptr, ptr0, len0, conf_threshold, iou_threshold);
188
  var r0 = getInt32Memory0()[retptr / 4 + 0];
189
  var r1 = getInt32Memory0()[retptr / 4 + 1];
190
  var r2 = getInt32Memory0()[retptr / 4 + 2];
 
243
  const ret = new Error(getStringFromWasm0(arg0, arg1));
244
  return addHeapObject(ret);
245
  };
246
+ imports.wbg.__wbg_log_20252ed396e16790 = function(arg0, arg1) {
247
+ console.log(getStringFromWasm0(arg0, arg1));
248
+ };
249
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
250
  takeObject(arg0);
251
  };
 
257
  const ret = getObject(arg0);
258
  return addHeapObject(ret);
259
  };
 
 
 
260
  imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
261
  const ret = getObject(arg0).crypto;
262
  return addHeapObject(ret);
build/m_bg.js DELETED
@@ -1,310 +0,0 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
8
-
9
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
10
-
11
- cachedTextDecoder.decode();
12
-
13
- let cachedUint8Memory0 = null;
14
-
15
- function getUint8Memory0() {
16
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
17
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
18
- }
19
- return cachedUint8Memory0;
20
- }
21
-
22
- function getStringFromWasm0(ptr, len) {
23
- ptr = ptr >>> 0;
24
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
25
- }
26
-
27
- const heap = new Array(128).fill(undefined);
28
-
29
- heap.push(undefined, null, true, false);
30
-
31
- let heap_next = heap.length;
32
-
33
- function addHeapObject(obj) {
34
- if (heap_next === heap.length) heap.push(heap.length + 1);
35
- const idx = heap_next;
36
- heap_next = heap[idx];
37
-
38
- heap[idx] = obj;
39
- return idx;
40
- }
41
-
42
- function getObject(idx) { return heap[idx]; }
43
-
44
- function dropObject(idx) {
45
- if (idx < 132) return;
46
- heap[idx] = heap_next;
47
- heap_next = idx;
48
- }
49
-
50
- function takeObject(idx) {
51
- const ret = getObject(idx);
52
- dropObject(idx);
53
- return ret;
54
- }
55
-
56
- let WASM_VECTOR_LEN = 0;
57
-
58
- function passArray8ToWasm0(arg, malloc) {
59
- const ptr = malloc(arg.length * 1, 1) >>> 0;
60
- getUint8Memory0().set(arg, ptr / 1);
61
- WASM_VECTOR_LEN = arg.length;
62
- return ptr;
63
- }
64
-
65
- let cachedInt32Memory0 = null;
66
-
67
- function getInt32Memory0() {
68
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
69
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
70
- }
71
- return cachedInt32Memory0;
72
- }
73
-
74
- function handleError(f, args) {
75
- try {
76
- return f.apply(this, args);
77
- } catch (e) {
78
- wasm.__wbindgen_exn_store(addHeapObject(e));
79
- }
80
- }
81
- /**
82
- */
83
- export class Model {
84
-
85
- static __wrap(ptr) {
86
- ptr = ptr >>> 0;
87
- const obj = Object.create(Model.prototype);
88
- obj.__wbg_ptr = ptr;
89
-
90
- return obj;
91
- }
92
-
93
- __destroy_into_raw() {
94
- const ptr = this.__wbg_ptr;
95
- this.__wbg_ptr = 0;
96
-
97
- return ptr;
98
- }
99
-
100
- free() {
101
- const ptr = this.__destroy_into_raw();
102
- wasm.__wbg_model_free(ptr);
103
- }
104
- /**
105
- * @param {Uint8Array} data
106
- */
107
- constructor(data) {
108
- try {
109
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
110
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
111
- const len0 = WASM_VECTOR_LEN;
112
- wasm.model_new(retptr, ptr0, len0);
113
- var r0 = getInt32Memory0()[retptr / 4 + 0];
114
- var r1 = getInt32Memory0()[retptr / 4 + 1];
115
- var r2 = getInt32Memory0()[retptr / 4 + 2];
116
- if (r2) {
117
- throw takeObject(r1);
118
- }
119
- return Model.__wrap(r0);
120
- } finally {
121
- wasm.__wbindgen_add_to_stack_pointer(16);
122
- }
123
- }
124
- /**
125
- * @param {Uint8Array} image
126
- * @returns {string}
127
- */
128
- run(image) {
129
- let deferred3_0;
130
- let deferred3_1;
131
- try {
132
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
133
- const ptr0 = passArray8ToWasm0(image, wasm.__wbindgen_malloc);
134
- const len0 = WASM_VECTOR_LEN;
135
- wasm.model_run(retptr, this.__wbg_ptr, ptr0, len0);
136
- var r0 = getInt32Memory0()[retptr / 4 + 0];
137
- var r1 = getInt32Memory0()[retptr / 4 + 1];
138
- var r2 = getInt32Memory0()[retptr / 4 + 2];
139
- var r3 = getInt32Memory0()[retptr / 4 + 3];
140
- var ptr2 = r0;
141
- var len2 = r1;
142
- if (r3) {
143
- ptr2 = 0; len2 = 0;
144
- throw takeObject(r2);
145
- }
146
- deferred3_0 = ptr2;
147
- deferred3_1 = len2;
148
- return getStringFromWasm0(ptr2, len2);
149
- } finally {
150
- wasm.__wbindgen_add_to_stack_pointer(16);
151
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
152
- }
153
- }
154
- }
155
-
156
- export function __wbindgen_error_new(arg0, arg1) {
157
- const ret = new Error(getStringFromWasm0(arg0, arg1));
158
- return addHeapObject(ret);
159
- };
160
-
161
- export function __wbindgen_object_drop_ref(arg0) {
162
- takeObject(arg0);
163
- };
164
-
165
- export function __wbindgen_string_new(arg0, arg1) {
166
- const ret = getStringFromWasm0(arg0, arg1);
167
- return addHeapObject(ret);
168
- };
169
-
170
- export function __wbindgen_object_clone_ref(arg0) {
171
- const ret = getObject(arg0);
172
- return addHeapObject(ret);
173
- };
174
-
175
- export function __wbg_log_65d20c5d9fc43b86(arg0, arg1) {
176
- console.log(getStringFromWasm0(arg0, arg1));
177
- };
178
-
179
- export function __wbg_crypto_c48a774b022d20ac(arg0) {
180
- const ret = getObject(arg0).crypto;
181
- return addHeapObject(ret);
182
- };
183
-
184
- export function __wbindgen_is_object(arg0) {
185
- const val = getObject(arg0);
186
- const ret = typeof(val) === 'object' && val !== null;
187
- return ret;
188
- };
189
-
190
- export function __wbg_process_298734cf255a885d(arg0) {
191
- const ret = getObject(arg0).process;
192
- return addHeapObject(ret);
193
- };
194
-
195
- export function __wbg_versions_e2e78e134e3e5d01(arg0) {
196
- const ret = getObject(arg0).versions;
197
- return addHeapObject(ret);
198
- };
199
-
200
- export function __wbg_node_1cd7a5d853dbea79(arg0) {
201
- const ret = getObject(arg0).node;
202
- return addHeapObject(ret);
203
- };
204
-
205
- export function __wbindgen_is_string(arg0) {
206
- const ret = typeof(getObject(arg0)) === 'string';
207
- return ret;
208
- };
209
-
210
- export function __wbg_msCrypto_bcb970640f50a1e8(arg0) {
211
- const ret = getObject(arg0).msCrypto;
212
- return addHeapObject(ret);
213
- };
214
-
215
- export function __wbg_require_8f08ceecec0f4fee() { return handleError(function () {
216
- const ret = module.require;
217
- return addHeapObject(ret);
218
- }, arguments) };
219
-
220
- export function __wbindgen_is_function(arg0) {
221
- const ret = typeof(getObject(arg0)) === 'function';
222
- return ret;
223
- };
224
-
225
- export function __wbg_getRandomValues_37fa2ca9e4e07fab() { return handleError(function (arg0, arg1) {
226
- getObject(arg0).getRandomValues(getObject(arg1));
227
- }, arguments) };
228
-
229
- export function __wbg_randomFillSync_dc1e9a60c158336d() { return handleError(function (arg0, arg1) {
230
- getObject(arg0).randomFillSync(takeObject(arg1));
231
- }, arguments) };
232
-
233
- export function __wbg_newnoargs_581967eacc0e2604(arg0, arg1) {
234
- const ret = new Function(getStringFromWasm0(arg0, arg1));
235
- return addHeapObject(ret);
236
- };
237
-
238
- export function __wbg_call_cb65541d95d71282() { return handleError(function (arg0, arg1) {
239
- const ret = getObject(arg0).call(getObject(arg1));
240
- return addHeapObject(ret);
241
- }, arguments) };
242
-
243
- export function __wbg_self_1ff1d729e9aae938() { return handleError(function () {
244
- const ret = self.self;
245
- return addHeapObject(ret);
246
- }, arguments) };
247
-
248
- export function __wbg_window_5f4faef6c12b79ec() { return handleError(function () {
249
- const ret = window.window;
250
- return addHeapObject(ret);
251
- }, arguments) };
252
-
253
- export function __wbg_globalThis_1d39714405582d3c() { return handleError(function () {
254
- const ret = globalThis.globalThis;
255
- return addHeapObject(ret);
256
- }, arguments) };
257
-
258
- export function __wbg_global_651f05c6a0944d1c() { return handleError(function () {
259
- const ret = global.global;
260
- return addHeapObject(ret);
261
- }, arguments) };
262
-
263
- export function __wbindgen_is_undefined(arg0) {
264
- const ret = getObject(arg0) === undefined;
265
- return ret;
266
- };
267
-
268
- export function __wbg_call_01734de55d61e11d() { return handleError(function (arg0, arg1, arg2) {
269
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
270
- return addHeapObject(ret);
271
- }, arguments) };
272
-
273
- export function __wbg_buffer_085ec1f694018c4f(arg0) {
274
- const ret = getObject(arg0).buffer;
275
- return addHeapObject(ret);
276
- };
277
-
278
- export function __wbg_newwithbyteoffsetandlength_6da8e527659b86aa(arg0, arg1, arg2) {
279
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
280
- return addHeapObject(ret);
281
- };
282
-
283
- export function __wbg_new_8125e318e6245eed(arg0) {
284
- const ret = new Uint8Array(getObject(arg0));
285
- return addHeapObject(ret);
286
- };
287
-
288
- export function __wbg_set_5cf90238115182c3(arg0, arg1, arg2) {
289
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
290
- };
291
-
292
- export function __wbg_newwithlength_e5d69174d6984cd7(arg0) {
293
- const ret = new Uint8Array(arg0 >>> 0);
294
- return addHeapObject(ret);
295
- };
296
-
297
- export function __wbg_subarray_13db269f57aa838d(arg0, arg1, arg2) {
298
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
299
- return addHeapObject(ret);
300
- };
301
-
302
- export function __wbindgen_throw(arg0, arg1) {
303
- throw new Error(getStringFromWasm0(arg0, arg1));
304
- };
305
-
306
- export function __wbindgen_memory() {
307
- const ret = wasm.memory;
308
- return addHeapObject(ret);
309
- };
310
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
build/m_bg.wasm CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:592230791ffdd18c8bb3ffea9921dbc51f8784be5627e29efc04204ec30912d0
3
- size 1507693
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:755ae31980152f83b923e4f4b5e7f2e501c264539d0271f0455fdb6cf38b16c0
3
+ size 1624018
build/m_bg.wasm.d.ts CHANGED
@@ -2,11 +2,12 @@
2
  /* eslint-disable */
3
  export const memory: WebAssembly.Memory;
4
  export function __wbg_model_free(a: number): void;
5
- export function model_new(a: number, b: number, c: number): void;
6
- export function model_run(a: number, b: number, c: number, d: number): void;
7
  export function main(a: number, b: number): number;
8
  export function __wbindgen_add_to_stack_pointer(a: number): number;
9
  export function __wbindgen_malloc(a: number, b: number): number;
 
10
  export function __wbindgen_free(a: number, b: number, c: number): void;
11
  export function __wbindgen_exn_store(a: number): void;
12
  export function __wbindgen_start(): void;
 
2
  /* eslint-disable */
3
  export const memory: WebAssembly.Memory;
4
  export function __wbg_model_free(a: number): void;
5
+ export function model_new(a: number, b: number, c: number, d: number, e: number): void;
6
+ export function model_run(a: number, b: number, c: number, d: number, e: number, f: number): void;
7
  export function main(a: number, b: number): number;
8
  export function __wbindgen_add_to_stack_pointer(a: number): number;
9
  export function __wbindgen_malloc(a: number, b: number): number;
10
+ export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
11
  export function __wbindgen_free(a: number, b: number, c: number): void;
12
  export function __wbindgen_exn_store(a: number): void;
13
  export function __wbindgen_start(): void;
index.html CHANGED
@@ -1,45 +1,410 @@
1
- <!DOCTYPE html><html lang="en"><head>
2
- <meta charset="utf-8">
3
- <title>Welcome to Candle!</title>
4
-
5
-
6
-
7
- <script type="module">import init from '/app-f2aa2f66427a1597.js';init('/app-f2aa2f66427a1597_bg.wasm');</script>
8
-
9
-
10
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
11
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
12
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.css">
13
-
14
- <link rel="preload" href="/app-f2aa2f66427a1597_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
15
- <link rel="modulepreload" href="/app-f2aa2f66427a1597.js"></head>
16
- <body>
17
-
18
- <script>(function () {
19
- var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
20
- var url = protocol + '//' + window.location.host + '/_trunk/ws';
21
- var poll_interval = 5000;
22
- var reload_upon_connect = () => {
23
- window.setTimeout(
24
- () => {
25
- // when we successfully reconnect, we'll force a
26
- // reload (since we presumably lost connection to
27
- // trunk due to it being killed, so it will have
28
- // rebuilt on restart)
29
- var ws = new WebSocket(url);
30
- ws.onopen = () => window.location.reload();
31
- ws.onclose = reload_upon_connect;
32
- },
33
- poll_interval);
34
- };
35
-
36
- var ws = new WebSocket(url);
37
- ws.onmessage = (ev) => {
38
- const msg = JSON.parse(ev.data);
39
- if (msg.reload) {
40
- window.location.reload();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
- };
43
- ws.onclose = reload_upon_connect;
44
- })()
45
- </script></body></html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
4
+ <title>Candle YOLOv8 Rust/WASM</title>
5
+ </head>
6
+ <body></body>
7
+ </html>
8
+
9
+ <!doctype html>
10
+ <html>
11
+ <head>
12
+ <meta charset="UTF-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
+ <style>
15
+ @import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@200;300;400&family=Source+Sans+3:wght@100;200;300;400;500;600;700;800;900&display=swap");
16
+ html,
17
+ body {
18
+ font-family: "Source Sans 3", sans-serif;
19
+ }
20
+ code,
21
+ output,
22
+ select,
23
+ pre {
24
+ font-family: "Source Code Pro", monospace;
25
+ }
26
+ </style>
27
+ <script src="https://cdn.tailwindcss.com"></script>
28
+ <script
29
+ src="https://cdn.jsdelivr.net/gh/huggingface/hub-js-utils/share-canvas.js"
30
+ type="module"
31
+ ></script>
32
+ <script type="module">
33
+ const MODEL_BASEURL =
34
+ "https://huggingface.co/lmz/candle-yolo-v8/resolve/main/";
35
+
36
+ const MODELS = {
37
+ yolov8n: {
38
+ model_size: "n",
39
+ url: "yolov8n.safetensors",
40
+ },
41
+ yolov8s: {
42
+ model_size: "s",
43
+ url: "yolov8s.safetensors",
44
+ },
45
+ yolov8m: {
46
+ model_size: "m",
47
+ url: "yolov8m.safetensors",
48
+ },
49
+ yolov8l: {
50
+ model_size: "l",
51
+ url: "yolov8l.safetensors",
52
+ },
53
+ yolov8x: {
54
+ model_size: "x",
55
+ url: "yolov8x.safetensors",
56
+ },
57
+ };
58
+
59
+ // init web worker
60
+ const yoloWorker = new Worker("./yoloWorker.js", { type: "module" });
61
+
62
+ let hasImage = false;
63
+ //add event listener to image examples
64
+ document.querySelector("#image-select").addEventListener("click", (e) => {
65
+ const target = e.target;
66
+ if (target.nodeName === "IMG") {
67
+ const href = target.src;
68
+ drawImageCanvas(href);
69
+ }
70
+ });
71
+ //add event listener to file input
72
+ document.querySelector("#file-upload").addEventListener("change", (e) => {
73
+ const target = e.target;
74
+ if (target.files.length > 0) {
75
+ const href = URL.createObjectURL(target.files[0]);
76
+ drawImageCanvas(href);
77
+ }
78
+ });
79
+ // add event listener to drop-area
80
+ const dropArea = document.querySelector("#drop-area");
81
+ dropArea.addEventListener("dragenter", (e) => {
82
+ e.preventDefault();
83
+ dropArea.classList.add("border-blue-700");
84
+ });
85
+ dropArea.addEventListener("dragleave", (e) => {
86
+ e.preventDefault();
87
+ dropArea.classList.remove("border-blue-700");
88
+ });
89
+ dropArea.addEventListener("dragover", (e) => {
90
+ e.preventDefault();
91
+ });
92
+ dropArea.addEventListener("drop", (e) => {
93
+ e.preventDefault();
94
+ dropArea.classList.remove("border-blue-700");
95
+ const url = e.dataTransfer.getData("text/uri-list");
96
+ const files = e.dataTransfer.files;
97
+
98
+ if (files.length > 0) {
99
+ const href = URL.createObjectURL(files[0]);
100
+ drawImageCanvas(href);
101
+ } else if (url) {
102
+ drawImageCanvas(url);
103
+ }
104
+ });
105
+
106
+ function drawImageCanvas(imgURL) {
107
+ const canvas = document.querySelector("#canvas");
108
+ const canvasResult = document.querySelector("#canvas-result");
109
+ canvasResult
110
+ .getContext("2d")
111
+ .clearRect(0, 0, canvas.width, canvas.height);
112
+ const ctx = canvas.getContext("2d");
113
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
114
+ document.querySelector("#share-btn").hidden = true;
115
+
116
+ const img = new Image();
117
+ img.crossOrigin = "anonymous";
118
+
119
+ img.onload = () => {
120
+ canvas.width = img.width;
121
+ canvas.height = img.height;
122
+ ctx.drawImage(img, 0, 0);
123
+
124
+ canvas.parentElement.style.height = canvas.offsetHeight + "px";
125
+ hasImage = true;
126
+ document.querySelector("#detect").disabled = false;
127
+ };
128
+ img.src = imgURL;
129
+ }
130
+
131
+ async function classifyImage(
132
+ imageURL, // URL of image to classify
133
+ modelID, // ID of model to use
134
+ modelURL, // URL to model file
135
+ modelSize, // size of model
136
+ confidence, // confidence threshold
137
+ iou_threshold, // IoU threshold
138
+ updateStatus // function receives status updates
139
+ ) {
140
+ return new Promise((resolve, reject) => {
141
+ yoloWorker.postMessage({
142
+ imageURL,
143
+ modelID,
144
+ modelURL,
145
+ modelSize,
146
+ confidence,
147
+ iou_threshold,
148
+ });
149
+ yoloWorker.addEventListener("message", (event) => {
150
+ if ("status" in event.data) {
151
+ updateStatus(event.data.status);
152
+ }
153
+ if ("error" in event.data) {
154
+ reject(new Error(event.data.error));
155
+ }
156
+ if (event.data.status === "complete") {
157
+ resolve(event.data);
158
+ }
159
+ });
160
+ });
161
+ }
162
+ // add event listener to detect button
163
+ document.querySelector("#detect").addEventListener("click", async () => {
164
+ if (!hasImage) {
165
+ return;
166
+ }
167
+ const modelID = document.querySelector("#model").value;
168
+ const modelURL = MODEL_BASEURL + MODELS[modelID].url;
169
+ const modelSize = MODELS[modelID].model_size;
170
+ const confidence = parseFloat(
171
+ document.querySelector("#confidence").value
172
+ );
173
+ const iou_threshold = parseFloat(
174
+ document.querySelector("#iou_threshold").value
175
+ );
176
+
177
+ const canvasInput = document.querySelector("#canvas");
178
+ const canvas = document.querySelector("#canvas-result");
179
+ canvas.width = canvasInput.width;
180
+ canvas.height = canvasInput.height;
181
+
182
+ const ctx = canvas.getContext("2d");
183
+ ctx.drawImage(canvasInput, 0, 0);
184
+ const imageURL = canvas.toDataURL();
185
+
186
+ const results = await await classifyImage(
187
+ imageURL,
188
+ modelID,
189
+ modelURL,
190
+ modelSize,
191
+ confidence,
192
+ iou_threshold,
193
+ updateStatus
194
+ );
195
+
196
+ const { output } = results;
197
+
198
+ ctx.lineWidth = 2;
199
+ ctx.strokeStyle = "#3c8566";
200
+ ctx.fillStyle = "#0dff9a";
201
+ for (const [label, bbox] of output) {
202
+ const [x, y, w, h] = [
203
+ bbox.xmin,
204
+ bbox.ymin,
205
+ bbox.xmax - bbox.xmin,
206
+ bbox.ymax - bbox.ymin,
207
+ ];
208
+
209
+ const confidence = bbox.confidence;
210
+
211
+ const text = `${label} ${confidence.toFixed(2)}`;
212
+ const width = ctx.measureText(text).width;
213
+ ctx.fillStyle = "#3c8566";
214
+ ctx.fillRect(x - 2, y - 12, width + 4, 14);
215
+ ctx.fillStyle = "#e3fff3";
216
+
217
+ ctx.strokeRect(x, y, w, h);
218
+ ctx.fillText(text, x, y - 2);
219
+ }
220
+ });
221
+
222
+ function updateStatus(statusMessage) {
223
+ const button = document.querySelector("#detect");
224
+ if (statusMessage === "detecting") {
225
+ button.disabled = true;
226
+ button.classList.add("bg-blue-700");
227
+ button.classList.remove("bg-blue-950");
228
+ button.textContent = "Detecting...";
229
+ } else if (statusMessage === "complete") {
230
+ button.disabled = false;
231
+ button.classList.add("bg-blue-950");
232
+ button.classList.remove("bg-blue-700");
233
+ button.textContent = "Detect Objects";
234
+ document.querySelector("#share-btn").hidden = false;
235
  }
236
+ }
237
+ document.querySelector("#share-btn").addEventListener("click", () => {
238
+ shareToCommunity(
239
+ "lmz/candle-yolo",
240
+ "Candle + YOLOv8",
241
+ "YOLOv8 with [Candle](https://github.com/huggingface/candle)",
242
+ "canvas-result",
243
+ "share-btn"
244
+ );
245
+ });
246
+ </script>
247
+ </head>
248
+ <body class="container max-w-4xl mx-auto p-4">
249
+ <main class="grid grid-cols-1 gap-8">
250
+ <div>
251
+ <h1 class="text-5xl font-bold">Candle YOLOv8</h1>
252
+ <h2 class="text-2xl font-bold">Rust/WASM Demo</h2>
253
+ <p class="max-w-lg">
254
+ Running an object detection model in the browser using rust/wasm with
255
+ an image. This demo uses the
256
+ <a
257
+ href="https://huggingface.co/lmz/candle-yolo-v8"
258
+ target="_blank"
259
+ class="underline hover:text-blue-500 hover:no-underline"
260
+ >
261
+ Candle YOLOv8
262
+ </a>
263
+ models to detect objects in images and WASM runtime built with
264
+ <a
265
+ href="https://github.com/huggingface/candle/"
266
+ target="_blank"
267
+ class="underline hover:text-blue-500 hover:no-underline"
268
+ >Candle
269
+ </a>
270
+ </p>
271
+ </div>
272
+
273
+ <div>
274
+ <label for="model" class="font-medium">Models Options: </label>
275
+ <select
276
+ id="model"
277
+ class="border-2 border-gray-500 rounded-md font-light"
278
+ >
279
+ <option value="yolov8n" selected>yolov8n (6.37 MB)</option>
280
+ <option value="yolov8s">yolov8s (22.4 MB)</option>
281
+ <option value="yolov8m">yolov8m (51.9 MB)</option>
282
+ <option value="yolov8l">yolov8l (87.5 MB)</option>
283
+ <option value="yolov8x">yolov8x (137 MB)</option>
284
+ </select>
285
+ </div>
286
+ <!-- drag and drop area -->
287
+ <div class="relative">
288
+ <div
289
+ id="drop-area"
290
+ class="flex flex-col items-center justify-center border-2 border-gray-300 border-dashed rounded-xl relative aspect-video w-full overflow-hidden"
291
+ >
292
+ <div
293
+ class="flex flex-col items-center justify-center space-y-1 text-center"
294
+ >
295
+ <svg
296
+ width="25"
297
+ height="25"
298
+ viewBox="0 0 25 25"
299
+ fill="none"
300
+ xmlns="http://www.w3.org/2000/svg"
301
+ >
302
+ <path
303
+ d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z"
304
+ fill="#000"
305
+ />
306
+ </svg>
307
+ <div class="flex text-sm text-gray-600">
308
+ <label
309
+ for="file-upload"
310
+ class="relative cursor-pointer bg-white rounded-md font-medium text-blue-950 hover:text-blue-700"
311
+ >
312
+ <span>Drag and drop your image here</span>
313
+ <span class="block text-xs">or</span>
314
+ <span class="block text-xs">Click to upload</span>
315
+ </label>
316
+ </div>
317
+ <input
318
+ id="file-upload"
319
+ name="file-upload"
320
+ type="file"
321
+ class="sr-only"
322
+ />
323
+ </div>
324
+ <canvas
325
+ id="canvas"
326
+ class="absolute pointer-events-none w-full"
327
+ ></canvas>
328
+ <canvas
329
+ id="canvas-result"
330
+ class="absolute pointer-events-none w-full"
331
+ ></canvas>
332
+ </div>
333
+ <div class="text-right py-2">
334
+ <button
335
+ id="share-btn"
336
+ hidden
337
+ class="bg-white rounded-md hover:outline outline-orange-200 disabled:opacity-50"
338
+ >
339
+ <img
340
+ src="https://huggingface.co/datasets/huggingface/badges/raw/main/share-to-community-sm.svg"
341
+ />
342
+ </button>
343
+ </div>
344
+ </div>
345
+ <div>
346
+ <div class="flex gap-3 items-center" id="image-select">
347
+ <h3 class="font-medium">Examples:</h3>
348
+
349
+ <img
350
+ src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/candle/examples/sf.jpg"
351
+ class="cursor-pointer w-24 h-24 object-cover"
352
+ />
353
+ <img
354
+ src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/candle/examples/bike.jpeg"
355
+ class="cursor-pointer w-24 h-24 object-cover"
356
+ />
357
+ </div>
358
+ </div>
359
+ <div>
360
+ <div class="grid grid-cols-3 max-w-md items-center gap-3">
361
+ <label class="text-sm font-medium" for="confidence"
362
+ >Confidence Threshold</label
363
+ >
364
+ <input
365
+ type="range"
366
+ id="confidence"
367
+ name="confidence"
368
+ min="0"
369
+ max="1"
370
+ step="0.01"
371
+ value="0.25"
372
+ oninput="this.nextElementSibling.value = Number(this.value).toFixed(2)"
373
+ />
374
+ <output
375
+ class="text-xs font-light px-1 py-1 border border-gray-700 rounded-md w-min"
376
+ >0.25</output
377
+ >
378
+
379
+ <label class="text-sm font-medium" for="iou_threshold"
380
+ >IoU Threshold</label
381
+ >
382
+
383
+ <input
384
+ type="range"
385
+ id="iou_threshold"
386
+ name="iou_threshold"
387
+ min="0"
388
+ max="1"
389
+ step="0.01"
390
+ value="0.45"
391
+ oninput="this.nextElementSibling.value = Number(this.value).toFixed(2)"
392
+ />
393
+ <output
394
+ class="font-extralight text-xs px-1 py-1 border border-gray-700 rounded-md w-min"
395
+ >0.45</output
396
+ >
397
+ </div>
398
+ </div>
399
+ <div>
400
+ <button
401
+ id="detect"
402
+ disabled
403
+ class="bg-blue-950 hover:bg-blue-700 text-white font-normal py-2 px-4 rounded disabled:opacity-75 disabled:hover:bg-blue-950"
404
+ >
405
+ Detect Objects
406
+ </button>
407
+ </div>
408
+ </main>
409
+ </body>
410
+ </html>
style.css DELETED
@@ -1,28 +0,0 @@
1
- body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
- }
5
-
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
- }
10
-
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
- }
17
-
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
- }
25
-
26
- .card p:last-child {
27
- margin-bottom: 0;
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
worker.js DELETED
@@ -1,477 +0,0 @@
1
- let wasm_bindgen;
2
- (function() {
3
- const __exports = {};
4
- let script_src;
5
- if (typeof document !== 'undefined' && document.currentScript !== null) {
6
- script_src = new URL(document.currentScript.src, location.href).toString();
7
- }
8
- let wasm = undefined;
9
-
10
- const heap = new Array(128).fill(undefined);
11
-
12
- heap.push(undefined, null, true, false);
13
-
14
- function getObject(idx) { return heap[idx]; }
15
-
16
- let heap_next = heap.length;
17
-
18
- function dropObject(idx) {
19
- if (idx < 132) return;
20
- heap[idx] = heap_next;
21
- heap_next = idx;
22
- }
23
-
24
- function takeObject(idx) {
25
- const ret = getObject(idx);
26
- dropObject(idx);
27
- return ret;
28
- }
29
-
30
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
31
-
32
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
33
-
34
- let cachedUint8Memory0 = null;
35
-
36
- function getUint8Memory0() {
37
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
38
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
39
- }
40
- return cachedUint8Memory0;
41
- }
42
-
43
- function getStringFromWasm0(ptr, len) {
44
- ptr = ptr >>> 0;
45
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
46
- }
47
-
48
- function addHeapObject(obj) {
49
- if (heap_next === heap.length) heap.push(heap.length + 1);
50
- const idx = heap_next;
51
- heap_next = heap[idx];
52
-
53
- heap[idx] = obj;
54
- return idx;
55
- }
56
-
57
- function debugString(val) {
58
- // primitive types
59
- const type = typeof val;
60
- if (type == 'number' || type == 'boolean' || val == null) {
61
- return `${val}`;
62
- }
63
- if (type == 'string') {
64
- return `"${val}"`;
65
- }
66
- if (type == 'symbol') {
67
- const description = val.description;
68
- if (description == null) {
69
- return 'Symbol';
70
- } else {
71
- return `Symbol(${description})`;
72
- }
73
- }
74
- if (type == 'function') {
75
- const name = val.name;
76
- if (typeof name == 'string' && name.length > 0) {
77
- return `Function(${name})`;
78
- } else {
79
- return 'Function';
80
- }
81
- }
82
- // objects
83
- if (Array.isArray(val)) {
84
- const length = val.length;
85
- let debug = '[';
86
- if (length > 0) {
87
- debug += debugString(val[0]);
88
- }
89
- for(let i = 1; i < length; i++) {
90
- debug += ', ' + debugString(val[i]);
91
- }
92
- debug += ']';
93
- return debug;
94
- }
95
- // Test for built-in
96
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
97
- let className;
98
- if (builtInMatches.length > 1) {
99
- className = builtInMatches[1];
100
- } else {
101
- // Failed to match the standard '[object ClassName]'
102
- return toString.call(val);
103
- }
104
- if (className == 'Object') {
105
- // we're a user defined class or Object
106
- // JSON.stringify avoids problems with cycles, and is generally much
107
- // easier than looping through ownProperties of `val`.
108
- try {
109
- return 'Object(' + JSON.stringify(val) + ')';
110
- } catch (_) {
111
- return 'Object';
112
- }
113
- }
114
- // errors
115
- if (val instanceof Error) {
116
- return `${val.name}: ${val.message}\n${val.stack}`;
117
- }
118
- // TODO we could test for more things here, like `Set`s and `Map`s.
119
- return className;
120
- }
121
-
122
- let WASM_VECTOR_LEN = 0;
123
-
124
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
125
-
126
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
127
- ? function (arg, view) {
128
- return cachedTextEncoder.encodeInto(arg, view);
129
- }
130
- : function (arg, view) {
131
- const buf = cachedTextEncoder.encode(arg);
132
- view.set(buf);
133
- return {
134
- read: arg.length,
135
- written: buf.length
136
- };
137
- });
138
-
139
- function passStringToWasm0(arg, malloc, realloc) {
140
-
141
- if (realloc === undefined) {
142
- const buf = cachedTextEncoder.encode(arg);
143
- const ptr = malloc(buf.length, 1) >>> 0;
144
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
145
- WASM_VECTOR_LEN = buf.length;
146
- return ptr;
147
- }
148
-
149
- let len = arg.length;
150
- let ptr = malloc(len, 1) >>> 0;
151
-
152
- const mem = getUint8Memory0();
153
-
154
- let offset = 0;
155
-
156
- for (; offset < len; offset++) {
157
- const code = arg.charCodeAt(offset);
158
- if (code > 0x7F) break;
159
- mem[ptr + offset] = code;
160
- }
161
-
162
- if (offset !== len) {
163
- if (offset !== 0) {
164
- arg = arg.slice(offset);
165
- }
166
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
167
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
168
- const ret = encodeString(arg, view);
169
-
170
- offset += ret.written;
171
- }
172
-
173
- WASM_VECTOR_LEN = offset;
174
- return ptr;
175
- }
176
-
177
- let cachedInt32Memory0 = null;
178
-
179
- function getInt32Memory0() {
180
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
181
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
182
- }
183
- return cachedInt32Memory0;
184
- }
185
-
186
- function makeClosure(arg0, arg1, dtor, f) {
187
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
188
- const real = (...args) => {
189
- // First up with a closure we increment the internal reference
190
- // count. This ensures that the Rust closure environment won't
191
- // be deallocated while we're invoking it.
192
- state.cnt++;
193
- try {
194
- return f(state.a, state.b, ...args);
195
- } finally {
196
- if (--state.cnt === 0) {
197
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
198
- state.a = 0;
199
-
200
- }
201
- }
202
- };
203
- real.original = state;
204
-
205
- return real;
206
- }
207
- function __wbg_adapter_22(arg0, arg1, arg2) {
208
- wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h46947c3fae55b461(arg0, arg1, addHeapObject(arg2));
209
- }
210
-
211
- function handleError(f, args) {
212
- try {
213
- return f.apply(this, args);
214
- } catch (e) {
215
- wasm.__wbindgen_exn_store(addHeapObject(e));
216
- }
217
- }
218
-
219
- async function __wbg_load(module, imports) {
220
- if (typeof Response === 'function' && module instanceof Response) {
221
- if (typeof WebAssembly.instantiateStreaming === 'function') {
222
- try {
223
- return await WebAssembly.instantiateStreaming(module, imports);
224
-
225
- } catch (e) {
226
- if (module.headers.get('Content-Type') != 'application/wasm') {
227
- 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", e);
228
-
229
- } else {
230
- throw e;
231
- }
232
- }
233
- }
234
-
235
- const bytes = await module.arrayBuffer();
236
- return await WebAssembly.instantiate(bytes, imports);
237
-
238
- } else {
239
- const instance = await WebAssembly.instantiate(module, imports);
240
-
241
- if (instance instanceof WebAssembly.Instance) {
242
- return { instance, module };
243
-
244
- } else {
245
- return instance;
246
- }
247
- }
248
- }
249
-
250
- function __wbg_get_imports() {
251
- const imports = {};
252
- imports.wbg = {};
253
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
254
- takeObject(arg0);
255
- };
256
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
257
- const ret = getStringFromWasm0(arg0, arg1);
258
- return addHeapObject(ret);
259
- };
260
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
261
- const ret = getObject(arg0);
262
- return addHeapObject(ret);
263
- };
264
- imports.wbg.__wbg_log_65d20c5d9fc43b86 = function(arg0, arg1) {
265
- console.log(getStringFromWasm0(arg0, arg1));
266
- };
267
- imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
268
- const ret = getObject(arg0).crypto;
269
- return addHeapObject(ret);
270
- };
271
- imports.wbg.__wbindgen_is_object = function(arg0) {
272
- const val = getObject(arg0);
273
- const ret = typeof(val) === 'object' && val !== null;
274
- return ret;
275
- };
276
- imports.wbg.__wbg_process_298734cf255a885d = function(arg0) {
277
- const ret = getObject(arg0).process;
278
- return addHeapObject(ret);
279
- };
280
- imports.wbg.__wbg_versions_e2e78e134e3e5d01 = function(arg0) {
281
- const ret = getObject(arg0).versions;
282
- return addHeapObject(ret);
283
- };
284
- imports.wbg.__wbg_node_1cd7a5d853dbea79 = function(arg0) {
285
- const ret = getObject(arg0).node;
286
- return addHeapObject(ret);
287
- };
288
- imports.wbg.__wbindgen_is_string = function(arg0) {
289
- const ret = typeof(getObject(arg0)) === 'string';
290
- return ret;
291
- };
292
- imports.wbg.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) {
293
- const ret = getObject(arg0).msCrypto;
294
- return addHeapObject(ret);
295
- };
296
- imports.wbg.__wbg_require_8f08ceecec0f4fee = function() { return handleError(function () {
297
- const ret = module.require;
298
- return addHeapObject(ret);
299
- }, arguments) };
300
- imports.wbg.__wbindgen_is_function = function(arg0) {
301
- const ret = typeof(getObject(arg0)) === 'function';
302
- return ret;
303
- };
304
- imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
305
- getObject(arg0).getRandomValues(getObject(arg1));
306
- }, arguments) };
307
- imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
308
- getObject(arg0).randomFillSync(takeObject(arg1));
309
- }, arguments) };
310
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
311
- const ret = new Error();
312
- return addHeapObject(ret);
313
- };
314
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
315
- const ret = getObject(arg1).stack;
316
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
317
- const len1 = WASM_VECTOR_LEN;
318
- getInt32Memory0()[arg0 / 4 + 1] = len1;
319
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
320
- };
321
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
322
- let deferred0_0;
323
- let deferred0_1;
324
- try {
325
- deferred0_0 = arg0;
326
- deferred0_1 = arg1;
327
- console.error(getStringFromWasm0(arg0, arg1));
328
- } finally {
329
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
330
- }
331
- };
332
- imports.wbg.__wbg_setonmessage_731266b6f3ab0860 = function(arg0, arg1) {
333
- getObject(arg0).onmessage = getObject(arg1);
334
- };
335
- imports.wbg.__wbg_close_889c0c4e86f1403e = function(arg0) {
336
- getObject(arg0).close();
337
- };
338
- imports.wbg.__wbg_postMessage_2f0b8369b84c3c1e = function() { return handleError(function (arg0, arg1) {
339
- getObject(arg0).postMessage(getObject(arg1));
340
- }, arguments) };
341
- imports.wbg.__wbg_data_ab99ae4a2e1e8bc9 = function(arg0) {
342
- const ret = getObject(arg0).data;
343
- return addHeapObject(ret);
344
- };
345
- imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
346
- const ret = new Function(getStringFromWasm0(arg0, arg1));
347
- return addHeapObject(ret);
348
- };
349
- imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
350
- const ret = getObject(arg0).call(getObject(arg1));
351
- return addHeapObject(ret);
352
- }, arguments) };
353
- imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
354
- const ret = self.self;
355
- return addHeapObject(ret);
356
- }, arguments) };
357
- imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () {
358
- const ret = window.window;
359
- return addHeapObject(ret);
360
- }, arguments) };
361
- imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () {
362
- const ret = globalThis.globalThis;
363
- return addHeapObject(ret);
364
- }, arguments) };
365
- imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () {
366
- const ret = global.global;
367
- return addHeapObject(ret);
368
- }, arguments) };
369
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
370
- const ret = getObject(arg0) === undefined;
371
- return ret;
372
- };
373
- imports.wbg.__wbg_call_01734de55d61e11d = function() { return handleError(function (arg0, arg1, arg2) {
374
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
375
- return addHeapObject(ret);
376
- }, arguments) };
377
- imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
378
- const ret = getObject(arg0).buffer;
379
- return addHeapObject(ret);
380
- };
381
- imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
382
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
383
- return addHeapObject(ret);
384
- };
385
- imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
386
- const ret = new Uint8Array(getObject(arg0));
387
- return addHeapObject(ret);
388
- };
389
- imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
390
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
391
- };
392
- imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
393
- const ret = getObject(arg0).length;
394
- return ret;
395
- };
396
- imports.wbg.__wbg_newwithlength_e5d69174d6984cd7 = function(arg0) {
397
- const ret = new Uint8Array(arg0 >>> 0);
398
- return addHeapObject(ret);
399
- };
400
- imports.wbg.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) {
401
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
402
- return addHeapObject(ret);
403
- };
404
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
405
- const ret = debugString(getObject(arg1));
406
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
407
- const len1 = WASM_VECTOR_LEN;
408
- getInt32Memory0()[arg0 / 4 + 1] = len1;
409
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
410
- };
411
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
412
- throw new Error(getStringFromWasm0(arg0, arg1));
413
- };
414
- imports.wbg.__wbindgen_memory = function() {
415
- const ret = wasm.memory;
416
- return addHeapObject(ret);
417
- };
418
- imports.wbg.__wbindgen_closure_wrapper72 = function(arg0, arg1, arg2) {
419
- const ret = makeClosure(arg0, arg1, 16, __wbg_adapter_22);
420
- return addHeapObject(ret);
421
- };
422
-
423
- return imports;
424
- }
425
-
426
- function __wbg_init_memory(imports, maybe_memory) {
427
-
428
- }
429
-
430
- function __wbg_finalize_init(instance, module) {
431
- wasm = instance.exports;
432
- __wbg_init.__wbindgen_wasm_module = module;
433
- cachedInt32Memory0 = null;
434
- cachedUint8Memory0 = null;
435
-
436
- wasm.__wbindgen_start();
437
- return wasm;
438
- }
439
-
440
- function initSync(module) {
441
- if (wasm !== undefined) return wasm;
442
-
443
- const imports = __wbg_get_imports();
444
-
445
- __wbg_init_memory(imports);
446
-
447
- if (!(module instanceof WebAssembly.Module)) {
448
- module = new WebAssembly.Module(module);
449
- }
450
-
451
- const instance = new WebAssembly.Instance(module, imports);
452
-
453
- return __wbg_finalize_init(instance, module);
454
- }
455
-
456
- async function __wbg_init(input) {
457
- if (wasm !== undefined) return wasm;
458
-
459
- if (typeof input === 'undefined' && script_src !== 'undefined') {
460
- input = script_src.replace(/\.js$/, '_bg.wasm');
461
- }
462
- const imports = __wbg_get_imports();
463
-
464
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
465
- input = fetch(input);
466
- }
467
-
468
- __wbg_init_memory(imports);
469
-
470
- const { instance, module } = await __wbg_load(await input, imports);
471
-
472
- return __wbg_finalize_init(instance, module);
473
- }
474
-
475
- wasm_bindgen = Object.assign(__wbg_init, { initSync }, __exports);
476
-
477
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
worker_bg.wasm DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:544c3992f2f96264a0c380e003feaa31cc44aa3b7aebd2fd35bb3601d8ef3434
3
- size 1304516
 
 
 
 
yolo.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3522419a6cb079b8fdc9566c48ba514afdf941cc8827b3fb367134467776fd0d
3
- size 22407580
 
 
 
 
yoloWorker.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //load the candle yolo wasm module
2
+ import init, { Model } from "./build/m.js";
3
+
4
+ class Yolo {
5
+ static instance = {};
6
+ // Retrieve the YOLO model. When called for the first time,
7
+ // this will load the model and save it for future use.
8
+ static async getInstance(modelID, modelURL, modelSize) {
9
+ // load individual modelID only once
10
+ if (!this.instance[modelID]) {
11
+ await init();
12
+
13
+ self.postMessage({ status: `loading model ${modelID}:${modelSize}` });
14
+ const modelRes = await fetch(modelURL);
15
+ const yoloArrayBuffer = await modelRes.arrayBuffer();
16
+ const weightsArrayU8 = new Uint8Array(yoloArrayBuffer);
17
+ this.instance[modelID] = new Model(weightsArrayU8, modelSize);
18
+ } else {
19
+ self.postMessage({ status: "model already loaded" });
20
+ }
21
+ return this.instance[modelID];
22
+ }
23
+ }
24
+
25
+ self.addEventListener("message", async (event) => {
26
+ const { imageURL, modelID, modelURL, modelSize, confidence, iou_threshold } =
27
+ event.data;
28
+ try {
29
+ self.postMessage({ status: "detecting" });
30
+
31
+ const yolo = await Yolo.getInstance(modelID, modelURL, modelSize);
32
+
33
+ self.postMessage({ status: "loading image" });
34
+ const imgRes = await fetch(imageURL);
35
+ const imgData = await imgRes.arrayBuffer();
36
+ const imageArrayU8 = new Uint8Array(imgData);
37
+
38
+ self.postMessage({ status: `running inference ${modelID}:${modelSize}` });
39
+ const bboxes = yolo.run(imageArrayU8, confidence, iou_threshold);
40
+
41
+ // Send the output back to the main thread as JSON
42
+ self.postMessage({
43
+ status: "complete",
44
+ output: JSON.parse(bboxes),
45
+ });
46
+ } catch (e) {
47
+ self.postMessage({ error: e });
48
+ }
49
+ });