@scalable-vector-audio/sva-wasm 0.7.18 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@scalable-vector-audio/sva-wasm",
3
3
  "type": "module",
4
4
  "description": "JS bindings: a composition a page fills node by node, rendered in the browser",
5
- "version": "0.7.18",
5
+ "version": "0.8.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/sva_wasm.d.ts CHANGED
@@ -13,7 +13,7 @@ export class Composition {
13
13
  /**
14
14
  * Memory over the store in `dir`, an origin-private file system directory; alone where
15
15
  * none opens. `options.store_max_bytes`: the store's budget, evicting the least recently
16
- * used past it at each persist.
16
+ * used past it at each persist. `options.threads`: the most threads a render computes on.
17
17
  */
18
18
  static open(name: string | null | undefined, dir: FileSystemDirectoryHandle | null | undefined, options: any): Promise<Composition>;
19
19
  /**
@@ -23,12 +23,14 @@ export class Composition {
23
23
  /**
24
24
  * `target` as `sva-cli render` takes it, `@piano([0, 2b], f0=C4)`; `representations`
25
25
  * what `representations()` answers, each a call as `--representation` writes it.
26
- * `options`: `rate`, `bits`, `flop_budget`, `until`, `volatile`, `out: null` (no samples),
27
- * and `signal`: aborted, it throws an `AbortError` before its next block.
26
+ * `options`: `rate`, `bits`, `until`, `volatile`, `out: null` (no samples), `threads`
27
+ * (as `open` takes it), and `signal`: aborted, it throws an `AbortError` before its next
28
+ * block.
28
29
  */
29
30
  render(target: string, representations: string[] | null | undefined, options: any): Promise<Rendering>;
30
31
  /**
31
- * `target` block by block. `options`: `rate`, `bits`, `until`, `live`, `channels`.
32
+ * `target` block by block. `options`: `rate`, `bits`, `until`, `live`, `channels`,
33
+ * `threads` (as `open` takes it).
32
34
  */
33
35
  stream(target: string, block: number, options: any): Promise<Stream>;
34
36
  readonly cache_bytes: number;
@@ -105,12 +107,13 @@ export class Stream {
105
107
  */
106
108
  replace(handle: number, term: string, options?: any | null): Promise<boolean>;
107
109
  /**
108
- * Each list the latest; its `pagination.count` counts all. `pruned`: the level a term under
109
- * which for good leaves the sum, and each node cut, at the sample it is zero from.
110
+ * Each list the latest; its `pagination.count` counts all. `pruned`: the silence threshold
111
+ * below which a term leaves the sum for good, and each node cut, at the sample it is
112
+ * treated as silent from.
110
113
  */
111
114
  stats(): any;
112
115
  /**
113
- * `{ samples, priced_flops, waves }` since it opened.
116
+ * `{ samples, computed_samples }` since it opened.
114
117
  */
115
118
  work(): any;
116
119
  readonly block: number;
@@ -121,13 +124,32 @@ export class Stream {
121
124
  readonly sample_rate: number;
122
125
  }
123
126
 
127
+ export function initThreadPool(num_threads: number): Promise<any>;
128
+
129
+ /**
130
+ * Once, from a worker of a cross-origin isolated page.
131
+ */
132
+ export function startThreads(threads: number): Promise<void>;
133
+
134
+ export class wbg_rayon_PoolBuilder {
135
+ private constructor();
136
+ free(): void;
137
+ [Symbol.dispose](): void;
138
+ build(): void;
139
+ mainJS(): string;
140
+ numThreads(): number;
141
+ receiver(): number;
142
+ }
143
+
144
+ export function wbg_rayon_start_worker(receiver: number): void;
145
+
124
146
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
125
147
 
126
148
  export interface InitOutput {
127
- readonly memory: WebAssembly.Memory;
128
149
  readonly __wbg_composition_free: (a: number, b: number) => void;
129
150
  readonly __wbg_rendering_free: (a: number, b: number) => void;
130
151
  readonly __wbg_stream_free: (a: number, b: number) => void;
152
+ readonly __wbg_wbg_rayon_poolbuilder_free: (a: number, b: number) => void;
131
153
  readonly composition_cache_bytes: (a: number) => number;
132
154
  readonly composition_cache_entries: (a: number) => number;
133
155
  readonly composition_cache_evictions: (a: number) => number;
@@ -142,6 +164,7 @@ export interface InitOutput {
142
164
  readonly composition_store_bytes: (a: number) => [number, number];
143
165
  readonly composition_store_max_bytes: (a: number) => [number, number];
144
166
  readonly composition_stream: (a: number, b: number, c: number, d: number, e: any) => any;
167
+ readonly initThreadPool: (a: number) => any;
145
168
  readonly rendering_channels: (a: number) => number;
146
169
  readonly rendering_duration_secs: (a: number) => number;
147
170
  readonly rendering_representations: (a: number) => [number, number, number];
@@ -149,6 +172,7 @@ export interface InitOutput {
149
172
  readonly rendering_samples: (a: number, b: number) => [number, number, number, number];
150
173
  readonly rendering_stats: (a: number) => [number, number, number];
151
174
  readonly rendering_work: (a: number) => [number, number, number];
175
+ readonly startThreads: (a: number) => any;
152
176
  readonly stream_add: (a: number, b: number, c: number, d: number) => any;
153
177
  readonly stream_block: (a: number) => number;
154
178
  readonly stream_channels: (a: number) => number;
@@ -165,10 +189,18 @@ export interface InitOutput {
165
189
  readonly stream_sample_rate: (a: number) => number;
166
190
  readonly stream_stats: (a: number) => [number, number, number];
167
191
  readonly stream_work: (a: number) => [number, number, number];
168
- readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
169
- readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
170
- readonly wasm_bindgen__convert__closures_____invoke__h54d79f6d11af2311: (a: number, b: number) => any;
171
- readonly wasm_bindgen__convert__closures_____invoke__hebd8072cc64c80ed: (a: number, b: number) => void;
192
+ readonly wbg_rayon_poolbuilder_build: (a: number) => void;
193
+ readonly wbg_rayon_poolbuilder_mainJS: (a: number) => any;
194
+ readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
195
+ readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
196
+ readonly wbg_rayon_start_worker: (a: number) => void;
197
+ readonly wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
198
+ readonly wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue__core_40942630fbe58d9f___result__Result_____wasm_bindgen_c71329924e24104e___JsError___true_: (a: number, b: number, c: any) => [number, number];
199
+ readonly wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___futures__task__wait_async_polyfill__MessageEvent______true_: (a: number, b: number, c: any) => void;
200
+ readonly wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue______true_: (a: number, b: number, c: any) => void;
201
+ readonly wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Promise__true_: (a: number, b: number) => any;
202
+ readonly wasm_bindgen_c71329924e24104e___convert__closures_____invoke_______true_: (a: number, b: number) => void;
203
+ readonly memory: WebAssembly.Memory;
172
204
  readonly __wbindgen_malloc: (a: number, b: number) => number;
173
205
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
174
206
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -177,7 +209,8 @@ export interface InitOutput {
177
209
  readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
178
210
  readonly __externref_table_dealloc: (a: number) => void;
179
211
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
180
- readonly __wbindgen_start: () => void;
212
+ readonly __wbindgen_thread_destroy: (a?: number, b?: number, c?: number) => void;
213
+ readonly __wbindgen_start: (a: number) => void;
181
214
  }
182
215
 
183
216
  export type SyncInitInput = BufferSource | WebAssembly.Module;
@@ -186,18 +219,20 @@ export type SyncInitInput = BufferSource | WebAssembly.Module;
186
219
  * Instantiates the given `module`, which can either be bytes or
187
220
  * a precompiled `WebAssembly.Module`.
188
221
  *
189
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
222
+ * @param {{ module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number }} module - Passing `SyncInitInput` directly is deprecated.
223
+ * @param {WebAssembly.Memory} memory - Deprecated.
190
224
  *
191
225
  * @returns {InitOutput}
192
226
  */
193
- export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
227
+ export function initSync(module: { module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number } | SyncInitInput, memory?: WebAssembly.Memory): InitOutput;
194
228
 
195
229
  /**
196
230
  * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
197
231
  * for everything else, calls `WebAssembly.instantiate` directly.
198
232
  *
199
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
233
+ * @param {{ module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number }} module_or_path - Passing `InitInput` directly is deprecated.
234
+ * @param {WebAssembly.Memory} memory - Deprecated.
200
235
  *
201
236
  * @returns {Promise<InitOutput>}
202
237
  */
203
- export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
238
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number } | InitInput | Promise<InitInput>, memory?: WebAssembly.Memory): Promise<InitOutput>;
package/sva_wasm.js CHANGED
@@ -1,4 +1,6 @@
1
1
  /* @ts-self-types="./sva_wasm.d.ts" */
2
+ import { startWorkers } from './snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js';
3
+
2
4
 
3
5
  export class Composition {
4
6
  static __wrap(ptr) {
@@ -81,7 +83,7 @@ export class Composition {
81
83
  /**
82
84
  * Memory over the store in `dir`, an origin-private file system directory; alone where
83
85
  * none opens. `options.store_max_bytes`: the store's budget, evicting the least recently
84
- * used past it at each persist.
86
+ * used past it at each persist. `options.threads`: the most threads a render computes on.
85
87
  * @param {string | null | undefined} name
86
88
  * @param {FileSystemDirectoryHandle | null | undefined} dir
87
89
  * @param {any} options
@@ -104,8 +106,9 @@ export class Composition {
104
106
  /**
105
107
  * `target` as `sva-cli render` takes it, `@piano([0, 2b], f0=C4)`; `representations`
106
108
  * what `representations()` answers, each a call as `--representation` writes it.
107
- * `options`: `rate`, `bits`, `flop_budget`, `until`, `volatile`, `out: null` (no samples),
108
- * and `signal`: aborted, it throws an `AbortError` before its next block.
109
+ * `options`: `rate`, `bits`, `until`, `volatile`, `out: null` (no samples), `threads`
110
+ * (as `open` takes it), and `signal`: aborted, it throws an `AbortError` before its next
111
+ * block.
109
112
  * @param {string} target
110
113
  * @param {string[] | null | undefined} representations
111
114
  * @param {any} options
@@ -141,7 +144,8 @@ export class Composition {
141
144
  return ret[0] === 0 ? undefined : ret[1];
142
145
  }
143
146
  /**
144
- * `target` block by block. `options`: `rate`, `bits`, `until`, `live`, `channels`.
147
+ * `target` block by block. `options`: `rate`, `bits`, `until`, `live`, `channels`,
148
+ * `threads` (as `open` takes it).
145
149
  * @param {string} target
146
150
  * @param {number} block
147
151
  * @param {any} options
@@ -399,8 +403,9 @@ export class Stream {
399
403
  return ret >>> 0;
400
404
  }
401
405
  /**
402
- * Each list the latest; its `pagination.count` counts all. `pruned`: the level a term under
403
- * which for good leaves the sum, and each node cut, at the sample it is zero from.
406
+ * Each list the latest; its `pagination.count` counts all. `pruned`: the silence threshold
407
+ * below which a term leaves the sum for good, and each node cut, at the sample it is
408
+ * treated as silent from.
404
409
  * @returns {any}
405
410
  */
406
411
  stats() {
@@ -411,7 +416,7 @@ export class Stream {
411
416
  return takeFromExternrefTable0(ret[0]);
412
417
  }
413
418
  /**
414
- * `{ samples, priced_flops, waves }` since it opened.
419
+ * `{ samples, computed_samples }` since it opened.
415
420
  * @returns {any}
416
421
  */
417
422
  work() {
@@ -423,7 +428,77 @@ export class Stream {
423
428
  }
424
429
  }
425
430
  if (Symbol.dispose) Stream.prototype[Symbol.dispose] = Stream.prototype.free;
426
- function __wbg_get_imports() {
431
+
432
+ /**
433
+ * @param {number} num_threads
434
+ * @returns {Promise<any>}
435
+ */
436
+ export function initThreadPool(num_threads) {
437
+ const ret = wasm.initThreadPool(num_threads);
438
+ return ret;
439
+ }
440
+
441
+ /**
442
+ * Once, from a worker of a cross-origin isolated page.
443
+ * @param {number} threads
444
+ * @returns {Promise<void>}
445
+ */
446
+ export function startThreads(threads) {
447
+ const ret = wasm.startThreads(threads);
448
+ return ret;
449
+ }
450
+
451
+ export class wbg_rayon_PoolBuilder {
452
+ static __wrap(ptr) {
453
+ const obj = Object.create(wbg_rayon_PoolBuilder.prototype);
454
+ obj.__wbg_ptr = ptr;
455
+ wbg_rayon_PoolBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
456
+ return obj;
457
+ }
458
+ __destroy_into_raw() {
459
+ const ptr = this.__wbg_ptr;
460
+ this.__wbg_ptr = 0;
461
+ wbg_rayon_PoolBuilderFinalization.unregister(this);
462
+ return ptr;
463
+ }
464
+ free() {
465
+ const ptr = this.__destroy_into_raw();
466
+ wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 0);
467
+ }
468
+ build() {
469
+ wasm.wbg_rayon_poolbuilder_build(this.__wbg_ptr);
470
+ }
471
+ /**
472
+ * @returns {string}
473
+ */
474
+ mainJS() {
475
+ const ret = wasm.wbg_rayon_poolbuilder_mainJS(this.__wbg_ptr);
476
+ return ret;
477
+ }
478
+ /**
479
+ * @returns {number}
480
+ */
481
+ numThreads() {
482
+ const ret = wasm.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr);
483
+ return ret >>> 0;
484
+ }
485
+ /**
486
+ * @returns {number}
487
+ */
488
+ receiver() {
489
+ const ret = wasm.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr);
490
+ return ret >>> 0;
491
+ }
492
+ }
493
+ if (Symbol.dispose) wbg_rayon_PoolBuilder.prototype[Symbol.dispose] = wbg_rayon_PoolBuilder.prototype.free;
494
+
495
+ /**
496
+ * @param {number} receiver
497
+ */
498
+ export function wbg_rayon_start_worker(receiver) {
499
+ wasm.wbg_rayon_start_worker(receiver);
500
+ }
501
+ function __wbg_get_imports(memory) {
427
502
  const import0 = {
428
503
  __proto__: null,
429
504
  __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
@@ -454,12 +529,23 @@ function __wbg_get_imports() {
454
529
  const ret = arg0 === undefined;
455
530
  return ret;
456
531
  },
532
+ __wbg___wbindgen_memory_3f8442e22540244f: function() {
533
+ const ret = wasm.memory;
534
+ return ret;
535
+ },
536
+ __wbg___wbindgen_module_c2aeeb3b14bad631: function() {
537
+ const ret = wasmModule;
538
+ return ret;
539
+ },
457
540
  __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
458
541
  const obj = arg1;
459
542
  const ret = typeof(obj) === 'number' ? obj : undefined;
460
543
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
461
544
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
462
545
  },
546
+ __wbg___wbindgen_rethrow_dba7bb2caa14ba21: function(arg0) {
547
+ throw arg0;
548
+ },
463
549
  __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
464
550
  const obj = arg1;
465
551
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -474,10 +560,18 @@ function __wbg_get_imports() {
474
560
  __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
475
561
  arg0._wbg_cb_unref();
476
562
  },
477
- __wbg_arrayBuffer_9159b5cfbd119cb1: function(arg0) {
563
+ __wbg_arrayBuffer_8faea0dbff7bb078: function(arg0) {
478
564
  const ret = arg0.arrayBuffer();
479
565
  return ret;
480
566
  },
567
+ __wbg_async_50fcc3f740d37ed6: function(arg0) {
568
+ const ret = arg0.async;
569
+ return ret;
570
+ },
571
+ __wbg_buffer_60eec204070b2802: function(arg0) {
572
+ const ret = arg0.buffer;
573
+ return ret;
574
+ },
481
575
  __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
482
576
  const ret = arg0.call(arg1);
483
577
  return ret;
@@ -486,10 +580,10 @@ function __wbg_get_imports() {
486
580
  const ret = arg0.call(arg1, arg2);
487
581
  return ret;
488
582
  }, arguments); },
489
- __wbg_close_513ff14225dbbcc1: function(arg0) {
583
+ __wbg_close_8e10f2694206c474: function(arg0) {
490
584
  arg0.close();
491
585
  },
492
- __wbg_close_e5bfe4d6a87b6dd0: function(arg0) {
586
+ __wbg_close_b4b133c61df00de8: function(arg0) {
493
587
  const ret = arg0.close();
494
588
  return ret;
495
589
  },
@@ -497,10 +591,14 @@ function __wbg_get_imports() {
497
591
  const ret = Composition.__wrap(arg0);
498
592
  return ret;
499
593
  },
500
- __wbg_createWritable_e2b6a5a20af70320: function(arg0) {
594
+ __wbg_createWritable_06a4ac8a6ad39d55: function(arg0) {
501
595
  const ret = arg0.createWritable();
502
596
  return ret;
503
597
  },
598
+ __wbg_data_d607e3ca86acb68c: function(arg0) {
599
+ const ret = arg0.data;
600
+ return ret;
601
+ },
504
602
  __wbg_entries_972a87586902cf87: function(arg0) {
505
603
  const ret = Object.entries(arg0);
506
604
  return ret;
@@ -509,15 +607,15 @@ function __wbg_get_imports() {
509
607
  const ret = Array.from(arg0);
510
608
  return ret;
511
609
  },
512
- __wbg_getDirectoryHandle_61b8e273cbee237e: function(arg0, arg1, arg2, arg3) {
610
+ __wbg_getDirectoryHandle_f316eb4e78c1ba4e: function(arg0, arg1, arg2, arg3) {
513
611
  const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
514
612
  return ret;
515
613
  },
516
- __wbg_getFileHandle_0302fa73add13434: function(arg0, arg1, arg2, arg3) {
614
+ __wbg_getFileHandle_d3e853faba50cba0: function(arg0, arg1, arg2, arg3) {
517
615
  const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
518
616
  return ret;
519
617
  },
520
- __wbg_getFile_b8649555a1bc684a: function(arg0) {
618
+ __wbg_getFile_52182ea6c5e88f87: function(arg0) {
521
619
  const ret = arg0.getFile();
522
620
  return ret;
523
621
  },
@@ -547,11 +645,21 @@ function __wbg_get_imports() {
547
645
  const ret = result;
548
646
  return ret;
549
647
  },
648
+ __wbg_instanceof_Window_a3b8566f0a9c5d1a: function(arg0) {
649
+ let result;
650
+ try {
651
+ result = arg0 instanceof Window;
652
+ } catch (_) {
653
+ result = false;
654
+ }
655
+ const ret = result;
656
+ return ret;
657
+ },
550
658
  __wbg_isArray_5674713bb7b79043: function(arg0) {
551
659
  const ret = Array.isArray(arg0);
552
660
  return ret;
553
661
  },
554
- __wbg_keys_c29cfc0a79d08e3b: function(arg0) {
662
+ __wbg_keys_23502eb604e5f53f: function(arg0) {
555
663
  const ret = arg0.keys();
556
664
  return ret;
557
665
  },
@@ -567,17 +675,21 @@ function __wbg_get_imports() {
567
675
  const ret = arg0.length;
568
676
  return ret;
569
677
  },
570
- __wbg_move_85394dbb60cb5e25: function(arg0, arg1, arg2, arg3) {
678
+ __wbg_move_e8608e3c89e69c32: function(arg0, arg1, arg2, arg3) {
571
679
  const ret = arg0.move(arg1, getStringFromWasm0(arg2, arg3));
572
680
  return ret;
573
681
  },
574
- __wbg_name_db881f36dd258fcf: function(arg0, arg1) {
682
+ __wbg_name_a2e8a8b265d5f9da: function(arg0, arg1) {
575
683
  const ret = arg1.name;
576
684
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
577
685
  const len1 = WASM_VECTOR_LEN;
578
686
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
579
687
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
580
688
  },
689
+ __wbg_new_0700aaf827082758: function(arg0) {
690
+ const ret = new Int32Array(arg0);
691
+ return ret;
692
+ },
581
693
  __wbg_new_1da3429bc3c4541c: function(arg0) {
582
694
  const ret = new Uint8Array(arg0);
583
695
  return ret;
@@ -589,7 +701,7 @@ function __wbg_get_imports() {
589
701
  const a = state0.a;
590
702
  state0.a = 0;
591
703
  try {
592
- return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
704
+ return wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined_______true_(a, state0.b, arg0, arg1);
593
705
  } finally {
594
706
  state0.a = a;
595
707
  }
@@ -600,18 +712,18 @@ function __wbg_get_imports() {
600
712
  state0.a = 0;
601
713
  }
602
714
  },
715
+ __wbg_new_9f469be988f2ab2f: function() {
716
+ const ret = new MessageChannel();
717
+ return ret;
718
+ },
603
719
  __wbg_new_bebc3f4757acf305: function() {
604
720
  const ret = new Object();
605
721
  return ret;
606
722
  },
607
- __wbg_new_c44fbf6b4a1f2c4e: function(arg0, arg1) {
723
+ __wbg_new_ca25d2793a1a90e7: function(arg0, arg1) {
608
724
  const ret = new Error(getStringFromWasm0(arg0, arg1));
609
725
  return ret;
610
726
  },
611
- __wbg_new_f84fbc90be27fea9: function() {
612
- const ret = new MessageChannel();
613
- return ret;
614
- },
615
727
  __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
616
728
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
617
729
  return ret;
@@ -623,7 +735,7 @@ function __wbg_get_imports() {
623
735
  const a = state0.a;
624
736
  state0.a = 0;
625
737
  try {
626
- return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
738
+ return wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined_______true_(a, state0.b, arg0, arg1);
627
739
  } finally {
628
740
  state0.a = a;
629
741
  }
@@ -634,29 +746,40 @@ function __wbg_get_imports() {
634
746
  state0.a = 0;
635
747
  }
636
748
  },
637
- __wbg_next_9236a1e2488549f4: function(arg0) {
749
+ __wbg_new_worker_81c08e70aadb3771: function(arg0, arg1) {
750
+ const ret = new Worker(getStringFromWasm0(arg0, arg1));
751
+ return ret;
752
+ },
753
+ __wbg_next_d4e18c69b9e1a65a: function(arg0) {
638
754
  const ret = arg0.next();
639
755
  return ret;
640
756
  },
641
- __wbg_parse_1c7f06f8eaab3a14: function() { return handleError(function (arg0, arg1) {
757
+ __wbg_of_d9a05aa72bb023a2: function(arg0, arg1, arg2) {
758
+ const ret = Array.of(arg0, arg1, arg2);
759
+ return ret;
760
+ },
761
+ __wbg_parse_5da5b32f60321c75: function() { return handleError(function (arg0, arg1) {
642
762
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
643
763
  return ret;
644
764
  }, arguments); },
645
- __wbg_port1_54271c4345f51409: function(arg0) {
765
+ __wbg_port1_d94f4557c07e4483: function(arg0) {
646
766
  const ret = arg0.port1;
647
767
  return ret;
648
768
  },
649
- __wbg_port2_fbd6f51c46f5da14: function(arg0) {
769
+ __wbg_port2_56b630ec151ccaa1: function(arg0) {
650
770
  const ret = arg0.port2;
651
771
  return ret;
652
772
  },
653
- __wbg_postMessage_687cfe884c5a6c24: function(arg0, arg1) {
773
+ __wbg_postMessage_32603db9cc3eea6c: function(arg0, arg1) {
654
774
  arg0.postMessage(arg1);
655
775
  },
776
+ __wbg_postMessage_8105a302ed002474: function() { return handleError(function (arg0, arg1) {
777
+ arg0.postMessage(arg1);
778
+ }, arguments); },
656
779
  __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
657
780
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
658
781
  },
659
- __wbg_query_7d03acca215c7259: function(arg0) {
782
+ __wbg_query_2dc51b9bb1dd4e0d: function(arg0) {
660
783
  const ret = arg0.query();
661
784
  return ret;
662
785
  },
@@ -671,19 +794,19 @@ function __wbg_get_imports() {
671
794
  const ret = Math.random();
672
795
  return ret;
673
796
  },
674
- __wbg_removeEntry_557507b786a1a088: function(arg0, arg1, arg2, arg3) {
675
- const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2), arg3);
797
+ __wbg_removeEntry_9fe63a7d9f052123: function(arg0, arg1, arg2) {
798
+ const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
676
799
  return ret;
677
800
  },
678
- __wbg_removeEntry_86ca3824e69763f3: function(arg0, arg1, arg2) {
679
- const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
801
+ __wbg_removeEntry_d3907d9c1838ed18: function(arg0, arg1, arg2, arg3) {
802
+ const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2), arg3);
680
803
  return ret;
681
804
  },
682
805
  __wbg_rendering_new: function(arg0) {
683
806
  const ret = Rendering.__wrap(arg0);
684
807
  return ret;
685
808
  },
686
- __wbg_request_4f7ba662dfea46cd: function(arg0, arg1, arg2, arg3) {
809
+ __wbg_request_f0117cc7ee6fd3ff: function(arg0, arg1, arg2, arg3) {
687
810
  const ret = arg0.request(getStringFromWasm0(arg1, arg2), arg3);
688
811
  return ret;
689
812
  },
@@ -698,23 +821,30 @@ function __wbg_get_imports() {
698
821
  __wbg_set_c41f8dbc07a2190f: function(arg0, arg1, arg2) {
699
822
  arg0.set(getArrayF32FromWasm0(arg1, arg2));
700
823
  },
701
- __wbg_set_name_6af6676ad69d47be: function(arg0, arg1, arg2) {
824
+ __wbg_set_name_2f395b00415c310d: function(arg0, arg1, arg2) {
702
825
  arg0.name = getStringFromWasm0(arg1, arg2);
703
826
  },
704
- __wbg_set_onmessage_dc5d701819b140c9: function(arg0, arg1) {
827
+ __wbg_set_onmessage_2244c2525c4e0c38: function(arg0, arg1) {
705
828
  arg0.onmessage = arg1;
706
829
  },
707
- __wbg_set_refusal_adc06750a46fdb14: function(arg0, arg1) {
830
+ __wbg_set_onmessage_633c12d200c93f64: function(arg0, arg1) {
831
+ arg0.onmessage = arg1;
832
+ },
833
+ __wbg_set_refusal_5ef41dad296ff42f: function(arg0, arg1) {
708
834
  arg0.refusal = arg1;
709
835
  },
710
- __wbg_size_92e6c078a6013508: function(arg0) {
836
+ __wbg_size_c3f9e88615db1ce0: function(arg0) {
711
837
  const ret = arg0.size;
712
838
  return ret;
713
839
  },
714
- __wbg_slice_aeb2401e283e0cf2: function(arg0, arg1, arg2) {
840
+ __wbg_slice_a38db62418bdd422: function(arg0, arg1, arg2) {
715
841
  const ret = arg0.slice(arg1, arg2);
716
842
  return ret;
717
843
  },
844
+ __wbg_startWorkers_622cedd0d351664e: function(arg0, arg1, arg2) {
845
+ const ret = startWorkers(arg0, arg1, wbg_rayon_PoolBuilder.__wrap(arg2));
846
+ return ret;
847
+ },
718
848
  __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
719
849
  const ret = typeof global === 'undefined' ? null : global;
720
850
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
@@ -727,6 +857,10 @@ function __wbg_get_imports() {
727
857
  const ret = typeof self === 'undefined' ? null : self;
728
858
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
729
859
  },
860
+ __wbg_static_accessor_URL_fac851ed3060f4eb: function() {
861
+ const ret = import.meta.url;
862
+ return ret;
863
+ },
730
864
  __wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
731
865
  const ret = typeof window === 'undefined' ? null : window;
732
866
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
@@ -743,38 +877,64 @@ function __wbg_get_imports() {
743
877
  const ret = arg0.then(arg1, arg2);
744
878
  return ret;
745
879
  },
880
+ __wbg_then_8ebf7f4d2b402f98: function(arg0, arg1) {
881
+ const ret = arg0.then(arg1);
882
+ return ret;
883
+ },
746
884
  __wbg_then_b830475380919203: function(arg0, arg1) {
747
885
  const ret = arg0.then(arg1);
748
886
  return ret;
749
887
  },
750
- __wbg_warn_c020562a4c3c7703: function(arg0, arg1) {
888
+ __wbg_value_a06131499b246ab0: function(arg0) {
889
+ const ret = arg0.value;
890
+ return ret;
891
+ },
892
+ __wbg_waitAsync_80b2e954334c3fdf: function(arg0, arg1, arg2) {
893
+ const ret = Atomics.waitAsync(arg0, arg1 >>> 0, arg2);
894
+ return ret;
895
+ },
896
+ __wbg_waitAsync_ac27a6bec1171c41: function() {
897
+ const ret = Atomics.waitAsync;
898
+ return ret;
899
+ },
900
+ __wbg_warn_c87a3e30736afa6f: function(arg0, arg1) {
751
901
  console.warn(getStringFromWasm0(arg0, arg1));
752
902
  },
753
- __wbg_write_00795fbddc23319f: function(arg0, arg1) {
903
+ __wbg_write_ce9895aed50f18b0: function(arg0, arg1) {
754
904
  const ret = arg0.write(arg1);
755
905
  return ret;
756
906
  },
757
907
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
758
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 745, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
759
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150);
908
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 780, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
909
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue__core_40942630fbe58d9f___result__Result_____wasm_bindgen_c71329924e24104e___JsError___true_);
760
910
  return ret;
761
911
  },
762
912
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
763
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 95, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
764
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h54d79f6d11af2311);
913
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 806, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
914
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___futures__task__wait_async_polyfill__MessageEvent______true_);
765
915
  return ret;
766
916
  },
767
917
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
768
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 97, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
769
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hebd8072cc64c80ed);
918
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 86, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
919
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue______true_);
770
920
  return ret;
771
921
  },
772
- __wbindgen_generic_0000000000000004: function(arg0) {
922
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
923
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 88, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
924
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Promise__true_);
925
+ return ret;
926
+ },
927
+ __wbindgen_generic_0000000000000005: function(arg0, arg1) {
928
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 90, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
929
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_c71329924e24104e___convert__closures_____invoke_______true_);
930
+ return ret;
931
+ },
932
+ __wbindgen_generic_0000000000000006: function(arg0) {
773
933
  // Cast intrinsic for `F64 -> Externref`.
774
934
  const ret = arg0;
775
935
  return ret;
776
936
  },
777
- __wbindgen_generic_0000000000000005: function(arg0, arg1) {
937
+ __wbindgen_generic_0000000000000007: function(arg0, arg1) {
778
938
  // Cast intrinsic for `Ref(String) -> Externref`.
779
939
  const ret = getStringFromWasm0(arg0, arg1);
780
940
  return ret;
@@ -788,6 +948,21 @@ function __wbg_get_imports() {
788
948
  table.set(offset + 2, true);
789
949
  table.set(offset + 3, false);
790
950
  },
951
+ __wbindgen_link_e7dbf70342428633: function(arg0) {
952
+ const val = `onmessage = function (ev) {
953
+ let [ia, index, value] = ev.data;
954
+ ia = new Int32Array(ia.buffer);
955
+ let result = Atomics.wait(ia, index, value);
956
+ postMessage(result);
957
+ };
958
+ `;
959
+ const ret = typeof URL.createObjectURL === 'undefined' ? "data:application/javascript," + encodeURIComponent(val) : URL.createObjectURL(new Blob([val], { type: "text/javascript" }));
960
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
961
+ const len1 = WASM_VECTOR_LEN;
962
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
963
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
964
+ },
965
+ memory: memory || new WebAssembly.Memory({initial:516,maximum:65536,shared:true}),
791
966
  };
792
967
  return {
793
968
  __proto__: null,
@@ -795,24 +970,32 @@ function __wbg_get_imports() {
795
970
  };
796
971
  }
797
972
 
798
- function wasm_bindgen__convert__closures_____invoke__hebd8072cc64c80ed(arg0, arg1) {
799
- wasm.wasm_bindgen__convert__closures_____invoke__hebd8072cc64c80ed(arg0, arg1);
973
+ function wasm_bindgen_c71329924e24104e___convert__closures_____invoke_______true_(arg0, arg1) {
974
+ wasm.wasm_bindgen_c71329924e24104e___convert__closures_____invoke_______true_(arg0, arg1);
800
975
  }
801
976
 
802
- function wasm_bindgen__convert__closures_____invoke__h54d79f6d11af2311(arg0, arg1) {
803
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h54d79f6d11af2311(arg0, arg1);
977
+ function wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Promise__true_(arg0, arg1) {
978
+ const ret = wasm.wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Promise__true_(arg0, arg1);
804
979
  return ret;
805
980
  }
806
981
 
807
- function wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2) {
808
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2);
982
+ function wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___futures__task__wait_async_polyfill__MessageEvent______true_(arg0, arg1, arg2) {
983
+ wasm.wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___futures__task__wait_async_polyfill__MessageEvent______true_(arg0, arg1, arg2);
984
+ }
985
+
986
+ function wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue______true_(arg0, arg1, arg2) {
987
+ wasm.wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue______true_(arg0, arg1, arg2);
988
+ }
989
+
990
+ function wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue__core_40942630fbe58d9f___result__Result_____wasm_bindgen_c71329924e24104e___JsError___true_(arg0, arg1, arg2) {
991
+ const ret = wasm.wasm_bindgen_c71329924e24104e___convert__closures_____invoke___wasm_bindgen_c71329924e24104e___JsValue__core_40942630fbe58d9f___result__Result_____wasm_bindgen_c71329924e24104e___JsError___true_(arg0, arg1, arg2);
809
992
  if (ret[1]) {
810
993
  throw takeFromExternrefTable0(ret[0]);
811
994
  }
812
995
  }
813
996
 
814
- function wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3) {
815
- wasm.wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3);
997
+ function wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
998
+ wasm.wasm_bindgen_c71329924e24104e___convert__closures_____invoke___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined___js_sys_34ad8f88ff72db9___Function_fn_wasm_bindgen_c71329924e24104e___JsValue_____wasm_bindgen_c71329924e24104e___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
816
999
  }
817
1000
 
818
1001
  const CompositionFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -824,6 +1007,9 @@ const RenderingFinalization = (typeof FinalizationRegistry === 'undefined')
824
1007
  const StreamFinalization = (typeof FinalizationRegistry === 'undefined')
825
1008
  ? { register: () => {}, unregister: () => {} }
826
1009
  : new FinalizationRegistry(ptr => wasm.__wbg_stream_free(ptr, 1));
1010
+ const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
1011
+ ? { register: () => {}, unregister: () => {} }
1012
+ : new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 1));
827
1013
 
828
1014
  function addToExternrefTable0(obj) {
829
1015
  const idx = wasm.__externref_table_alloc();
@@ -912,7 +1098,7 @@ function getArrayU8FromWasm0(ptr, len) {
912
1098
 
913
1099
  let cachedDataViewMemory0 = null;
914
1100
  function getDataViewMemory0() {
915
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1101
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
916
1102
  cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
917
1103
  }
918
1104
  return cachedDataViewMemory0;
@@ -920,7 +1106,7 @@ function getDataViewMemory0() {
920
1106
 
921
1107
  let cachedFloat32ArrayMemory0 = null;
922
1108
  function getFloat32ArrayMemory0() {
923
- if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
1109
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.buffer !== wasm.memory.buffer) {
924
1110
  cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
925
1111
  }
926
1112
  return cachedFloat32ArrayMemory0;
@@ -932,7 +1118,7 @@ function getStringFromWasm0(ptr, len) {
932
1118
 
933
1119
  let cachedUint8ArrayMemory0 = null;
934
1120
  function getUint8ArrayMemory0() {
935
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1121
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
936
1122
  cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
937
1123
  }
938
1124
  return cachedUint8ArrayMemory0;
@@ -1032,8 +1218,9 @@ function takeFromExternrefTable0(idx) {
1032
1218
  return value;
1033
1219
  }
1034
1220
 
1035
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1036
- cachedTextDecoder.decode();
1221
+ let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
1222
+ if (cachedTextDecoder) cachedTextDecoder.decode();
1223
+
1037
1224
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
1038
1225
  let numBytesDecoded = 0;
1039
1226
  function decodeText(ptr, len) {
@@ -1043,12 +1230,12 @@ function decodeText(ptr, len) {
1043
1230
  cachedTextDecoder.decode();
1044
1231
  numBytesDecoded = len;
1045
1232
  }
1046
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1233
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
1047
1234
  }
1048
1235
 
1049
- const cachedTextEncoder = new TextEncoder();
1236
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
1050
1237
 
1051
- if (!('encodeInto' in cachedTextEncoder)) {
1238
+ if (cachedTextEncoder) {
1052
1239
  cachedTextEncoder.encodeInto = function (arg, view) {
1053
1240
  const buf = cachedTextEncoder.encode(arg);
1054
1241
  view.set(buf);
@@ -1062,14 +1249,18 @@ if (!('encodeInto' in cachedTextEncoder)) {
1062
1249
  let WASM_VECTOR_LEN = 0;
1063
1250
 
1064
1251
  let wasmModule, wasmInstance, wasm;
1065
- function __wbg_finalize_init(instance, module) {
1252
+ function __wbg_finalize_init(instance, module, thread_stack_size) {
1066
1253
  wasmInstance = instance;
1067
1254
  wasm = instance.exports;
1068
1255
  wasmModule = module;
1069
1256
  cachedDataViewMemory0 = null;
1070
1257
  cachedFloat32ArrayMemory0 = null;
1071
1258
  cachedUint8ArrayMemory0 = null;
1072
- wasm.__wbindgen_start();
1259
+ if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % 65536 !== 0)) {
1260
+ throw new Error('invalid stack size');
1261
+ }
1262
+
1263
+ wasm.__wbindgen_start(thread_stack_size);
1073
1264
  return wasm;
1074
1265
  }
1075
1266
 
@@ -1112,33 +1303,33 @@ async function __wbg_load(module, imports) {
1112
1303
  }
1113
1304
  }
1114
1305
 
1115
- function initSync(module) {
1306
+ function initSync(module, memory) {
1116
1307
  if (wasm !== undefined) return wasm;
1117
1308
 
1118
-
1309
+ let thread_stack_size
1119
1310
  if (module !== undefined) {
1120
1311
  if (Object.getPrototypeOf(module) === Object.prototype) {
1121
- ({module} = module)
1312
+ ({module, memory, thread_stack_size} = module)
1122
1313
  } else {
1123
1314
  console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1124
1315
  }
1125
1316
  }
1126
1317
 
1127
- const imports = __wbg_get_imports();
1318
+ const imports = __wbg_get_imports(memory);
1128
1319
  if (!(module instanceof WebAssembly.Module)) {
1129
1320
  module = new WebAssembly.Module(module);
1130
1321
  }
1131
1322
  const instance = new WebAssembly.Instance(module, imports);
1132
- return __wbg_finalize_init(instance, module);
1323
+ return __wbg_finalize_init(instance, module, thread_stack_size);
1133
1324
  }
1134
1325
 
1135
- async function __wbg_init(module_or_path) {
1326
+ async function __wbg_init(module_or_path, memory) {
1136
1327
  if (wasm !== undefined) return wasm;
1137
1328
 
1138
-
1329
+ let thread_stack_size
1139
1330
  if (module_or_path !== undefined) {
1140
1331
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1141
- ({module_or_path} = module_or_path)
1332
+ ({module_or_path, memory, thread_stack_size} = module_or_path)
1142
1333
  } else {
1143
1334
  console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1144
1335
  }
@@ -1147,7 +1338,7 @@ async function __wbg_init(module_or_path) {
1147
1338
  if (module_or_path === undefined) {
1148
1339
  module_or_path = new URL('sva_wasm_bg.wasm', import.meta.url);
1149
1340
  }
1150
- const imports = __wbg_get_imports();
1341
+ const imports = __wbg_get_imports(memory);
1151
1342
 
1152
1343
  if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1153
1344
  module_or_path = fetch(module_or_path);
@@ -1155,7 +1346,7 @@ async function __wbg_init(module_or_path) {
1155
1346
 
1156
1347
  const { instance, module } = await __wbg_load(await module_or_path, imports);
1157
1348
 
1158
- return __wbg_finalize_init(instance, module);
1349
+ return __wbg_finalize_init(instance, module, thread_stack_size);
1159
1350
  }
1160
1351
 
1161
1352
  export { initSync, __wbg_init as default };
package/sva_wasm_bg.wasm CHANGED
Binary file