jazz-wasm 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1844 @@
1
+ /* @ts-self-types="./jazz_wasm.d.ts" */
2
+
3
+ /**
4
+ * WASM-exposed QueryBuilder with camelCase methods.
5
+ */
6
+ export class WasmQueryBuilder {
7
+ static __wrap(ptr) {
8
+ ptr = ptr >>> 0;
9
+ const obj = Object.create(WasmQueryBuilder.prototype);
10
+ obj.__wbg_ptr = ptr;
11
+ WasmQueryBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
12
+ return obj;
13
+ }
14
+ __destroy_into_raw() {
15
+ const ptr = this.__wbg_ptr;
16
+ this.__wbg_ptr = 0;
17
+ WasmQueryBuilderFinalization.unregister(this);
18
+ return ptr;
19
+ }
20
+ free() {
21
+ const ptr = this.__destroy_into_raw();
22
+ wasm.__wbg_wasmquerybuilder_free(ptr, 0);
23
+ }
24
+ /**
25
+ * Set a table alias.
26
+ * @param {string} alias
27
+ * @returns {WasmQueryBuilder}
28
+ */
29
+ alias(alias) {
30
+ const ptr = this.__destroy_into_raw();
31
+ const ptr0 = passStringToWasm0(alias, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
32
+ const len0 = WASM_VECTOR_LEN;
33
+ const ret = wasm.wasmquerybuilder_alias(ptr, ptr0, len0);
34
+ return WasmQueryBuilder.__wrap(ret);
35
+ }
36
+ /**
37
+ * Set the branch to query.
38
+ * @param {string} branch
39
+ * @returns {WasmQueryBuilder}
40
+ */
41
+ branch(branch) {
42
+ const ptr = this.__destroy_into_raw();
43
+ const ptr0 = passStringToWasm0(branch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
44
+ const len0 = WASM_VECTOR_LEN;
45
+ const ret = wasm.wasmquerybuilder_branch(ptr, ptr0, len0);
46
+ return WasmQueryBuilder.__wrap(ret);
47
+ }
48
+ /**
49
+ * Set multiple branches to query.
50
+ * @param {string[]} branches
51
+ * @returns {WasmQueryBuilder}
52
+ */
53
+ branches(branches) {
54
+ const ptr = this.__destroy_into_raw();
55
+ const ptr0 = passArrayJsValueToWasm0(branches, wasm.__wbindgen_malloc);
56
+ const len0 = WASM_VECTOR_LEN;
57
+ const ret = wasm.wasmquerybuilder_branches(ptr, ptr0, len0);
58
+ return WasmQueryBuilder.__wrap(ret);
59
+ }
60
+ /**
61
+ * Build the query and return as JSON string.
62
+ * @returns {string}
63
+ */
64
+ build() {
65
+ let deferred2_0;
66
+ let deferred2_1;
67
+ try {
68
+ const ptr = this.__destroy_into_raw();
69
+ const ret = wasm.wasmquerybuilder_build(ptr);
70
+ var ptr1 = ret[0];
71
+ var len1 = ret[1];
72
+ if (ret[3]) {
73
+ ptr1 = 0; len1 = 0;
74
+ throw takeFromExternrefTable0(ret[2]);
75
+ }
76
+ deferred2_0 = ptr1;
77
+ deferred2_1 = len1;
78
+ return getStringFromWasm0(ptr1, len1);
79
+ } finally {
80
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
81
+ }
82
+ }
83
+ /**
84
+ * Build and return as JsValue.
85
+ * @returns {any}
86
+ */
87
+ buildJs() {
88
+ const ptr = this.__destroy_into_raw();
89
+ const ret = wasm.wasmquerybuilder_buildJs(ptr);
90
+ if (ret[2]) {
91
+ throw takeFromExternrefTable0(ret[1]);
92
+ }
93
+ return takeFromExternrefTable0(ret[0]);
94
+ }
95
+ /**
96
+ * Add an equals filter.
97
+ * @param {string} column
98
+ * @param {any} value
99
+ * @returns {WasmQueryBuilder}
100
+ */
101
+ filterEq(column, value) {
102
+ const ptr = this.__destroy_into_raw();
103
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
104
+ const len0 = WASM_VECTOR_LEN;
105
+ const ret = wasm.wasmquerybuilder_filterEq(ptr, ptr0, len0, value);
106
+ if (ret[2]) {
107
+ throw takeFromExternrefTable0(ret[1]);
108
+ }
109
+ return WasmQueryBuilder.__wrap(ret[0]);
110
+ }
111
+ /**
112
+ * Add a greater-than-or-equal filter.
113
+ * @param {string} column
114
+ * @param {any} value
115
+ * @returns {WasmQueryBuilder}
116
+ */
117
+ filterGe(column, value) {
118
+ const ptr = this.__destroy_into_raw();
119
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
120
+ const len0 = WASM_VECTOR_LEN;
121
+ const ret = wasm.wasmquerybuilder_filterGe(ptr, ptr0, len0, value);
122
+ if (ret[2]) {
123
+ throw takeFromExternrefTable0(ret[1]);
124
+ }
125
+ return WasmQueryBuilder.__wrap(ret[0]);
126
+ }
127
+ /**
128
+ * Add a greater-than filter.
129
+ * @param {string} column
130
+ * @param {any} value
131
+ * @returns {WasmQueryBuilder}
132
+ */
133
+ filterGt(column, value) {
134
+ const ptr = this.__destroy_into_raw();
135
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
136
+ const len0 = WASM_VECTOR_LEN;
137
+ const ret = wasm.wasmquerybuilder_filterGt(ptr, ptr0, len0, value);
138
+ if (ret[2]) {
139
+ throw takeFromExternrefTable0(ret[1]);
140
+ }
141
+ return WasmQueryBuilder.__wrap(ret[0]);
142
+ }
143
+ /**
144
+ * Add a less-than-or-equal filter.
145
+ * @param {string} column
146
+ * @param {any} value
147
+ * @returns {WasmQueryBuilder}
148
+ */
149
+ filterLe(column, value) {
150
+ const ptr = this.__destroy_into_raw();
151
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
152
+ const len0 = WASM_VECTOR_LEN;
153
+ const ret = wasm.wasmquerybuilder_filterLe(ptr, ptr0, len0, value);
154
+ if (ret[2]) {
155
+ throw takeFromExternrefTable0(ret[1]);
156
+ }
157
+ return WasmQueryBuilder.__wrap(ret[0]);
158
+ }
159
+ /**
160
+ * Add a less-than filter.
161
+ * @param {string} column
162
+ * @param {any} value
163
+ * @returns {WasmQueryBuilder}
164
+ */
165
+ filterLt(column, value) {
166
+ const ptr = this.__destroy_into_raw();
167
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
168
+ const len0 = WASM_VECTOR_LEN;
169
+ const ret = wasm.wasmquerybuilder_filterLt(ptr, ptr0, len0, value);
170
+ if (ret[2]) {
171
+ throw takeFromExternrefTable0(ret[1]);
172
+ }
173
+ return WasmQueryBuilder.__wrap(ret[0]);
174
+ }
175
+ /**
176
+ * Add a not-equals filter.
177
+ * @param {string} column
178
+ * @param {any} value
179
+ * @returns {WasmQueryBuilder}
180
+ */
181
+ filterNe(column, value) {
182
+ const ptr = this.__destroy_into_raw();
183
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
184
+ const len0 = WASM_VECTOR_LEN;
185
+ const ret = wasm.wasmquerybuilder_filterNe(ptr, ptr0, len0, value);
186
+ if (ret[2]) {
187
+ throw takeFromExternrefTable0(ret[1]);
188
+ }
189
+ return WasmQueryBuilder.__wrap(ret[0]);
190
+ }
191
+ /**
192
+ * Include soft-deleted rows.
193
+ * @returns {WasmQueryBuilder}
194
+ */
195
+ includeDeleted() {
196
+ const ptr = this.__destroy_into_raw();
197
+ const ret = wasm.wasmquerybuilder_includeDeleted(ptr);
198
+ return WasmQueryBuilder.__wrap(ret);
199
+ }
200
+ /**
201
+ * Join another table.
202
+ * @param {string} table
203
+ * @returns {WasmQueryBuilder}
204
+ */
205
+ join(table) {
206
+ const ptr = this.__destroy_into_raw();
207
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
208
+ const len0 = WASM_VECTOR_LEN;
209
+ const ret = wasm.wasmquerybuilder_join(ptr, ptr0, len0);
210
+ return WasmQueryBuilder.__wrap(ret);
211
+ }
212
+ /**
213
+ * Set a limit.
214
+ * @param {number} n
215
+ * @returns {WasmQueryBuilder}
216
+ */
217
+ limit(n) {
218
+ const ptr = this.__destroy_into_raw();
219
+ const ret = wasm.wasmquerybuilder_limit(ptr, n);
220
+ return WasmQueryBuilder.__wrap(ret);
221
+ }
222
+ /**
223
+ * Create a new QueryBuilder for a table.
224
+ * @param {string} table
225
+ */
226
+ constructor(table) {
227
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
228
+ const len0 = WASM_VECTOR_LEN;
229
+ const ret = wasm.wasmquerybuilder_new(ptr0, len0);
230
+ this.__wbg_ptr = ret >>> 0;
231
+ WasmQueryBuilderFinalization.register(this, this.__wbg_ptr, this);
232
+ return this;
233
+ }
234
+ /**
235
+ * Set an offset.
236
+ * @param {number} n
237
+ * @returns {WasmQueryBuilder}
238
+ */
239
+ offset(n) {
240
+ const ptr = this.__destroy_into_raw();
241
+ const ret = wasm.wasmquerybuilder_offset(ptr, n);
242
+ return WasmQueryBuilder.__wrap(ret);
243
+ }
244
+ /**
245
+ * Specify join condition.
246
+ * @param {string} left_col
247
+ * @param {string} right_col
248
+ * @returns {WasmQueryBuilder}
249
+ */
250
+ on(left_col, right_col) {
251
+ const ptr = this.__destroy_into_raw();
252
+ const ptr0 = passStringToWasm0(left_col, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
253
+ const len0 = WASM_VECTOR_LEN;
254
+ const ptr1 = passStringToWasm0(right_col, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
255
+ const len1 = WASM_VECTOR_LEN;
256
+ const ret = wasm.wasmquerybuilder_on(ptr, ptr0, len0, ptr1, len1);
257
+ return WasmQueryBuilder.__wrap(ret);
258
+ }
259
+ /**
260
+ * Start a new OR branch.
261
+ * @returns {WasmQueryBuilder}
262
+ */
263
+ or() {
264
+ const ptr = this.__destroy_into_raw();
265
+ const ret = wasm.wasmquerybuilder_or(ptr);
266
+ return WasmQueryBuilder.__wrap(ret);
267
+ }
268
+ /**
269
+ * Add ascending order by.
270
+ * @param {string} column
271
+ * @returns {WasmQueryBuilder}
272
+ */
273
+ orderBy(column) {
274
+ const ptr = this.__destroy_into_raw();
275
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
276
+ const len0 = WASM_VECTOR_LEN;
277
+ const ret = wasm.wasmquerybuilder_orderBy(ptr, ptr0, len0);
278
+ return WasmQueryBuilder.__wrap(ret);
279
+ }
280
+ /**
281
+ * Add descending order by.
282
+ * @param {string} column
283
+ * @returns {WasmQueryBuilder}
284
+ */
285
+ orderByDesc(column) {
286
+ const ptr = this.__destroy_into_raw();
287
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
288
+ const len0 = WASM_VECTOR_LEN;
289
+ const ret = wasm.wasmquerybuilder_orderByDesc(ptr, ptr0, len0);
290
+ return WasmQueryBuilder.__wrap(ret);
291
+ }
292
+ /**
293
+ * Select specific columns.
294
+ * @param {string[]} columns
295
+ * @returns {WasmQueryBuilder}
296
+ */
297
+ select(columns) {
298
+ const ptr = this.__destroy_into_raw();
299
+ const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
300
+ const len0 = WASM_VECTOR_LEN;
301
+ const ret = wasm.wasmquerybuilder_select(ptr, ptr0, len0);
302
+ return WasmQueryBuilder.__wrap(ret);
303
+ }
304
+ }
305
+ if (Symbol.dispose) WasmQueryBuilder.prototype[Symbol.dispose] = WasmQueryBuilder.prototype.free;
306
+
307
+ /**
308
+ * Main runtime for JavaScript applications.
309
+ *
310
+ * Wraps `Rc<RefCell<WasmCoreType>>`.
311
+ * All methods borrow the core, call RuntimeCore, and return.
312
+ * Async scheduling happens via WasmScheduler.schedule_batched_tick().
313
+ */
314
+ export class WasmRuntime {
315
+ static __wrap(ptr) {
316
+ ptr = ptr >>> 0;
317
+ const obj = Object.create(WasmRuntime.prototype);
318
+ obj.__wbg_ptr = ptr;
319
+ WasmRuntimeFinalization.register(obj, obj.__wbg_ptr, obj);
320
+ return obj;
321
+ }
322
+ __destroy_into_raw() {
323
+ const ptr = this.__wbg_ptr;
324
+ this.__wbg_ptr = 0;
325
+ WasmRuntimeFinalization.unregister(this);
326
+ return ptr;
327
+ }
328
+ free() {
329
+ const ptr = this.__destroy_into_raw();
330
+ wasm.__wbg_wasmruntime_free(ptr, 0);
331
+ }
332
+ /**
333
+ * Add a client connection (for server-side use in tests).
334
+ * @returns {string}
335
+ */
336
+ addClient() {
337
+ let deferred1_0;
338
+ let deferred1_1;
339
+ try {
340
+ const ret = wasm.wasmruntime_addClient(this.__wbg_ptr);
341
+ deferred1_0 = ret[0];
342
+ deferred1_1 = ret[1];
343
+ return getStringFromWasm0(ret[0], ret[1]);
344
+ } finally {
345
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
346
+ }
347
+ }
348
+ /**
349
+ * Add a server connection.
350
+ *
351
+ * After adding the server, immediately flushes the outbox so that
352
+ * catalogue sync messages (from queue_full_sync_to_server) are sent
353
+ * before the call returns, rather than being deferred to a microtask.
354
+ */
355
+ addServer() {
356
+ wasm.wasmruntime_addServer(this.__wbg_ptr);
357
+ }
358
+ /**
359
+ * Delete a row by ObjectId.
360
+ * @param {string} object_id
361
+ */
362
+ delete(object_id) {
363
+ const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
364
+ const len0 = WASM_VECTOR_LEN;
365
+ const ret = wasm.wasmruntime_delete(this.__wbg_ptr, ptr0, len0);
366
+ if (ret[1]) {
367
+ throw takeFromExternrefTable0(ret[0]);
368
+ }
369
+ }
370
+ /**
371
+ * Delete a row and return a Promise that resolves when the tier acks.
372
+ * @param {string} object_id
373
+ * @param {string} tier
374
+ * @returns {Promise<any>}
375
+ */
376
+ deleteWithAck(object_id, tier) {
377
+ const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
378
+ const len0 = WASM_VECTOR_LEN;
379
+ const ptr1 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
380
+ const len1 = WASM_VECTOR_LEN;
381
+ const ret = wasm.wasmruntime_deleteWithAck(this.__wbg_ptr, ptr0, len0, ptr1, len1);
382
+ if (ret[2]) {
383
+ throw takeFromExternrefTable0(ret[1]);
384
+ }
385
+ return takeFromExternrefTable0(ret[0]);
386
+ }
387
+ /**
388
+ * Flush all data to persistent storage (snapshot).
389
+ */
390
+ flush() {
391
+ wasm.wasmruntime_flush(this.__wbg_ptr);
392
+ }
393
+ /**
394
+ * Flush only the WAL buffer to OPFS (not the snapshot).
395
+ */
396
+ flushWal() {
397
+ wasm.wasmruntime_flushWal(this.__wbg_ptr);
398
+ }
399
+ /**
400
+ * Get the current schema as JSON.
401
+ * @returns {any}
402
+ */
403
+ getSchema() {
404
+ const ret = wasm.wasmruntime_getSchema(this.__wbg_ptr);
405
+ if (ret[2]) {
406
+ throw takeFromExternrefTable0(ret[1]);
407
+ }
408
+ return takeFromExternrefTable0(ret[0]);
409
+ }
410
+ /**
411
+ * Get the canonical schema hash (64-char hex).
412
+ * @returns {string}
413
+ */
414
+ getSchemaHash() {
415
+ let deferred1_0;
416
+ let deferred1_1;
417
+ try {
418
+ const ret = wasm.wasmruntime_getSchemaHash(this.__wbg_ptr);
419
+ deferred1_0 = ret[0];
420
+ deferred1_1 = ret[1];
421
+ return getStringFromWasm0(ret[0], ret[1]);
422
+ } finally {
423
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
424
+ }
425
+ }
426
+ /**
427
+ * Insert a row into a table.
428
+ *
429
+ * # Returns
430
+ * The new row's ObjectId as a UUID string.
431
+ * @param {string} table
432
+ * @param {any} values
433
+ * @returns {string}
434
+ */
435
+ insert(table, values) {
436
+ let deferred3_0;
437
+ let deferred3_1;
438
+ try {
439
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
440
+ const len0 = WASM_VECTOR_LEN;
441
+ const ret = wasm.wasmruntime_insert(this.__wbg_ptr, ptr0, len0, values);
442
+ var ptr2 = ret[0];
443
+ var len2 = ret[1];
444
+ if (ret[3]) {
445
+ ptr2 = 0; len2 = 0;
446
+ throw takeFromExternrefTable0(ret[2]);
447
+ }
448
+ deferred3_0 = ptr2;
449
+ deferred3_1 = len2;
450
+ return getStringFromWasm0(ptr2, len2);
451
+ } finally {
452
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
453
+ }
454
+ }
455
+ /**
456
+ * Insert a row and return a Promise that resolves when the tier acks.
457
+ *
458
+ * `tier` must be one of: "worker", "edge", "core".
459
+ * @param {string} table
460
+ * @param {any} values
461
+ * @param {string} tier
462
+ * @returns {Promise<any>}
463
+ */
464
+ insertWithAck(table, values, tier) {
465
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
466
+ const len0 = WASM_VECTOR_LEN;
467
+ const ptr1 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
468
+ const len1 = WASM_VECTOR_LEN;
469
+ const ret = wasm.wasmruntime_insertWithAck(this.__wbg_ptr, ptr0, len0, values, ptr1, len1);
470
+ if (ret[2]) {
471
+ throw takeFromExternrefTable0(ret[1]);
472
+ }
473
+ return takeFromExternrefTable0(ret[0]);
474
+ }
475
+ /**
476
+ * Create a new WasmRuntime.
477
+ *
478
+ * Storage is synchronous (in-memory via MemoryStorage).
479
+ *
480
+ * # Arguments
481
+ * * `schema_json` - JSON-encoded schema definition
482
+ * * `app_id` - Application identifier
483
+ * * `env` - Environment (e.g., "dev", "prod")
484
+ * * `user_branch` - User's branch name (e.g., "main")
485
+ * * `tier` - Optional persistence tier ("worker", "edge", "core").
486
+ * Set for server nodes to enable ack emission.
487
+ * @param {string} schema_json
488
+ * @param {string} app_id
489
+ * @param {string} env
490
+ * @param {string} user_branch
491
+ * @param {string | null} [tier]
492
+ */
493
+ constructor(schema_json, app_id, env, user_branch, tier) {
494
+ const ptr0 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
495
+ const len0 = WASM_VECTOR_LEN;
496
+ const ptr1 = passStringToWasm0(app_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
497
+ const len1 = WASM_VECTOR_LEN;
498
+ const ptr2 = passStringToWasm0(env, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
499
+ const len2 = WASM_VECTOR_LEN;
500
+ const ptr3 = passStringToWasm0(user_branch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
501
+ const len3 = WASM_VECTOR_LEN;
502
+ var ptr4 = isLikeNone(tier) ? 0 : passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
503
+ var len4 = WASM_VECTOR_LEN;
504
+ const ret = wasm.wasmruntime_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
505
+ if (ret[2]) {
506
+ throw takeFromExternrefTable0(ret[1]);
507
+ }
508
+ this.__wbg_ptr = ret[0] >>> 0;
509
+ WasmRuntimeFinalization.register(this, this.__wbg_ptr, this);
510
+ return this;
511
+ }
512
+ /**
513
+ * Called by JS when a sync message arrives from the server.
514
+ *
515
+ * # Arguments
516
+ * * `message_json` - JSON-encoded SyncPayload
517
+ * @param {string} message_json
518
+ */
519
+ onSyncMessageReceived(message_json) {
520
+ const ptr0 = passStringToWasm0(message_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
521
+ const len0 = WASM_VECTOR_LEN;
522
+ const ret = wasm.wasmruntime_onSyncMessageReceived(this.__wbg_ptr, ptr0, len0);
523
+ if (ret[1]) {
524
+ throw takeFromExternrefTable0(ret[0]);
525
+ }
526
+ }
527
+ /**
528
+ * Called by JS when a sync message arrives from a client (not a server).
529
+ *
530
+ * # Arguments
531
+ * * `client_id` - UUID string of the sending client
532
+ * * `message_json` - JSON-encoded SyncPayload
533
+ * @param {string} client_id
534
+ * @param {string} message_json
535
+ */
536
+ onSyncMessageReceivedFromClient(client_id, message_json) {
537
+ const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
538
+ const len0 = WASM_VECTOR_LEN;
539
+ const ptr1 = passStringToWasm0(message_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
540
+ const len1 = WASM_VECTOR_LEN;
541
+ const ret = wasm.wasmruntime_onSyncMessageReceivedFromClient(this.__wbg_ptr, ptr0, len0, ptr1, len1);
542
+ if (ret[1]) {
543
+ throw takeFromExternrefTable0(ret[0]);
544
+ }
545
+ }
546
+ /**
547
+ * Register a callback for outgoing sync messages.
548
+ * @param {Function} callback
549
+ */
550
+ onSyncMessageToSend(callback) {
551
+ wasm.wasmruntime_onSyncMessageToSend(this.__wbg_ptr, callback);
552
+ }
553
+ /**
554
+ * Create a persistent WasmRuntime backed by OPFS.
555
+ *
556
+ * Opens a single OPFS file namespace and restores state from the latest
557
+ * durable checkpoint.
558
+ * @param {string} schema_json
559
+ * @param {string} app_id
560
+ * @param {string} env
561
+ * @param {string} user_branch
562
+ * @param {string} db_name
563
+ * @param {string | null} [tier]
564
+ * @returns {Promise<WasmRuntime>}
565
+ */
566
+ static openPersistent(schema_json, app_id, env, user_branch, db_name, tier) {
567
+ const ptr0 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
568
+ const len0 = WASM_VECTOR_LEN;
569
+ const ptr1 = passStringToWasm0(app_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
570
+ const len1 = WASM_VECTOR_LEN;
571
+ const ptr2 = passStringToWasm0(env, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
572
+ const len2 = WASM_VECTOR_LEN;
573
+ const ptr3 = passStringToWasm0(user_branch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
574
+ const len3 = WASM_VECTOR_LEN;
575
+ const ptr4 = passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
576
+ const len4 = WASM_VECTOR_LEN;
577
+ var ptr5 = isLikeNone(tier) ? 0 : passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
578
+ var len5 = WASM_VECTOR_LEN;
579
+ const ret = wasm.wasmruntime_openPersistent(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
580
+ return ret;
581
+ }
582
+ /**
583
+ * Execute a query and return results as a Promise.
584
+ *
585
+ * Optional `settled_tier` holds delivery until the tier confirms.
586
+ * @param {string} query_json
587
+ * @param {string | null} [session_json]
588
+ * @param {string | null} [settled_tier]
589
+ * @returns {Promise<any>}
590
+ */
591
+ query(query_json, session_json, settled_tier) {
592
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
593
+ const len0 = WASM_VECTOR_LEN;
594
+ var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
595
+ var len1 = WASM_VECTOR_LEN;
596
+ var ptr2 = isLikeNone(settled_tier) ? 0 : passStringToWasm0(settled_tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
597
+ var len2 = WASM_VECTOR_LEN;
598
+ const ret = wasm.wasmruntime_query(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
599
+ if (ret[2]) {
600
+ throw takeFromExternrefTable0(ret[1]);
601
+ }
602
+ return takeFromExternrefTable0(ret[0]);
603
+ }
604
+ /**
605
+ * Remove the current upstream server connection.
606
+ */
607
+ removeServer() {
608
+ wasm.wasmruntime_removeServer(this.__wbg_ptr);
609
+ }
610
+ /**
611
+ * Set a client's role.
612
+ *
613
+ * # Arguments
614
+ * * `client_id` - UUID string of the client
615
+ * * `role` - One of "user", "admin", "peer"
616
+ * @param {string} client_id
617
+ * @param {string} role
618
+ */
619
+ setClientRole(client_id, role) {
620
+ const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
621
+ const len0 = WASM_VECTOR_LEN;
622
+ const ptr1 = passStringToWasm0(role, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
623
+ const len1 = WASM_VECTOR_LEN;
624
+ const ret = wasm.wasmruntime_setClientRole(this.__wbg_ptr, ptr0, len0, ptr1, len1);
625
+ if (ret[1]) {
626
+ throw takeFromExternrefTable0(ret[0]);
627
+ }
628
+ }
629
+ /**
630
+ * Subscribe to a query with a callback.
631
+ *
632
+ * Default behavior matches RuntimeCore:
633
+ * - with upstream server: first callback waits for protocol QuerySettled convergence
634
+ * - without upstream server: first callback is local-immediate
635
+ *
636
+ * Pass `settled_tier` to override this default.
637
+ *
638
+ * # Returns
639
+ * Subscription handle (f64) for later unsubscription.
640
+ * @param {string} query_json
641
+ * @param {Function} on_update
642
+ * @param {string | null} [session_json]
643
+ * @param {string | null} [settled_tier]
644
+ * @returns {number}
645
+ */
646
+ subscribe(query_json, on_update, session_json, settled_tier) {
647
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
648
+ const len0 = WASM_VECTOR_LEN;
649
+ var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
650
+ var len1 = WASM_VECTOR_LEN;
651
+ var ptr2 = isLikeNone(settled_tier) ? 0 : passStringToWasm0(settled_tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
652
+ var len2 = WASM_VECTOR_LEN;
653
+ const ret = wasm.wasmruntime_subscribe(this.__wbg_ptr, ptr0, len0, on_update, ptr1, len1, ptr2, len2);
654
+ if (ret[2]) {
655
+ throw takeFromExternrefTable0(ret[1]);
656
+ }
657
+ return ret[0];
658
+ }
659
+ /**
660
+ * Unsubscribe from a query.
661
+ * @param {number} handle
662
+ */
663
+ unsubscribe(handle) {
664
+ wasm.wasmruntime_unsubscribe(this.__wbg_ptr, handle);
665
+ }
666
+ /**
667
+ * Update a row by ObjectId.
668
+ * @param {string} object_id
669
+ * @param {any} values
670
+ */
671
+ update(object_id, values) {
672
+ const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
673
+ const len0 = WASM_VECTOR_LEN;
674
+ const ret = wasm.wasmruntime_update(this.__wbg_ptr, ptr0, len0, values);
675
+ if (ret[1]) {
676
+ throw takeFromExternrefTable0(ret[0]);
677
+ }
678
+ }
679
+ /**
680
+ * Update a row and return a Promise that resolves when the tier acks.
681
+ * @param {string} object_id
682
+ * @param {any} values
683
+ * @param {string} tier
684
+ * @returns {Promise<any>}
685
+ */
686
+ updateWithAck(object_id, values, tier) {
687
+ const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
688
+ const len0 = WASM_VECTOR_LEN;
689
+ const ptr1 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
690
+ const len1 = WASM_VECTOR_LEN;
691
+ const ret = wasm.wasmruntime_updateWithAck(this.__wbg_ptr, ptr0, len0, values, ptr1, len1);
692
+ if (ret[2]) {
693
+ throw takeFromExternrefTable0(ret[1]);
694
+ }
695
+ return takeFromExternrefTable0(ret[0]);
696
+ }
697
+ }
698
+ if (Symbol.dispose) WasmRuntime.prototype[Symbol.dispose] = WasmRuntime.prototype.free;
699
+
700
+ /**
701
+ * @returns {number}
702
+ */
703
+ export function bench_get_cache_bytes() {
704
+ const ret = wasm.bench_get_cache_bytes();
705
+ return ret >>> 0;
706
+ }
707
+
708
+ /**
709
+ * @returns {number}
710
+ */
711
+ export function bench_get_overflow_threshold_bytes() {
712
+ const ret = wasm.bench_get_overflow_threshold_bytes();
713
+ return ret >>> 0;
714
+ }
715
+
716
+ /**
717
+ * @returns {boolean}
718
+ */
719
+ export function bench_get_pin_internal_pages() {
720
+ const ret = wasm.bench_get_pin_internal_pages();
721
+ return ret !== 0;
722
+ }
723
+
724
+ /**
725
+ * @returns {number}
726
+ */
727
+ export function bench_get_read_coalesce_pages() {
728
+ const ret = wasm.bench_get_read_coalesce_pages();
729
+ return ret >>> 0;
730
+ }
731
+
732
+ /**
733
+ * @param {number} count
734
+ * @param {number} value_size
735
+ * @returns {Promise<any>}
736
+ */
737
+ export function bench_opfs_cold_random_read(count, value_size) {
738
+ const ret = wasm.bench_opfs_cold_random_read(count, value_size);
739
+ return ret;
740
+ }
741
+
742
+ /**
743
+ * @param {number} count
744
+ * @param {number} value_size
745
+ * @returns {Promise<any>}
746
+ */
747
+ export function bench_opfs_cold_sequential_read(count, value_size) {
748
+ const ret = wasm.bench_opfs_cold_sequential_read(count, value_size);
749
+ return ret;
750
+ }
751
+
752
+ /**
753
+ * @param {number} count
754
+ * @returns {Promise<any>}
755
+ */
756
+ export function bench_opfs_matrix(count) {
757
+ const ret = wasm.bench_opfs_matrix(count);
758
+ return ret;
759
+ }
760
+
761
+ /**
762
+ * @param {number} count
763
+ * @returns {Promise<any>}
764
+ */
765
+ export function bench_opfs_mixed_matrix(count) {
766
+ const ret = wasm.bench_opfs_mixed_matrix(count);
767
+ return ret;
768
+ }
769
+
770
+ /**
771
+ * @param {string} scenario_name
772
+ * @param {number} count
773
+ * @param {number} value_size
774
+ * @param {bigint | null} [base_seed]
775
+ * @returns {Promise<any>}
776
+ */
777
+ export function bench_opfs_mixed_scenario(scenario_name, count, value_size, base_seed) {
778
+ const ptr0 = passStringToWasm0(scenario_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
779
+ const len0 = WASM_VECTOR_LEN;
780
+ const ret = wasm.bench_opfs_mixed_scenario(ptr0, len0, count, value_size, !isLikeNone(base_seed), isLikeNone(base_seed) ? BigInt(0) : base_seed);
781
+ return ret;
782
+ }
783
+
784
+ /**
785
+ * @param {number} count
786
+ * @param {number} value_size
787
+ * @returns {Promise<any>}
788
+ */
789
+ export function bench_opfs_random_read(count, value_size) {
790
+ const ret = wasm.bench_opfs_random_read(count, value_size);
791
+ return ret;
792
+ }
793
+
794
+ /**
795
+ * @param {number} count
796
+ * @param {number} value_size
797
+ * @returns {Promise<any>}
798
+ */
799
+ export function bench_opfs_random_write(count, value_size) {
800
+ const ret = wasm.bench_opfs_random_write(count, value_size);
801
+ return ret;
802
+ }
803
+
804
+ /**
805
+ * @param {number} count
806
+ * @param {number} value_size
807
+ * @returns {Promise<any>}
808
+ */
809
+ export function bench_opfs_range_random_window(count, value_size) {
810
+ const ret = wasm.bench_opfs_range_random_window(count, value_size);
811
+ return ret;
812
+ }
813
+
814
+ /**
815
+ * @param {number} count
816
+ * @param {number} value_size
817
+ * @returns {Promise<any>}
818
+ */
819
+ export function bench_opfs_range_seq_window(count, value_size) {
820
+ const ret = wasm.bench_opfs_range_seq_window(count, value_size);
821
+ return ret;
822
+ }
823
+
824
+ /**
825
+ * @param {number} count
826
+ * @param {number} value_size
827
+ * @returns {Promise<any>}
828
+ */
829
+ export function bench_opfs_sequential_read(count, value_size) {
830
+ const ret = wasm.bench_opfs_sequential_read(count, value_size);
831
+ return ret;
832
+ }
833
+
834
+ /**
835
+ * @param {number} count
836
+ * @param {number} value_size
837
+ * @returns {Promise<any>}
838
+ */
839
+ export function bench_opfs_sequential_write(count, value_size) {
840
+ const ret = wasm.bench_opfs_sequential_write(count, value_size);
841
+ return ret;
842
+ }
843
+
844
+ export function bench_reset_cache_bytes() {
845
+ wasm.bench_reset_cache_bytes();
846
+ }
847
+
848
+ export function bench_reset_overflow_threshold_bytes() {
849
+ wasm.bench_reset_overflow_threshold_bytes();
850
+ }
851
+
852
+ export function bench_reset_pin_internal_pages() {
853
+ wasm.bench_reset_pin_internal_pages();
854
+ }
855
+
856
+ export function bench_reset_read_coalesce_pages() {
857
+ wasm.bench_reset_read_coalesce_pages();
858
+ }
859
+
860
+ /**
861
+ * @param {number} cache_bytes
862
+ */
863
+ export function bench_set_cache_bytes(cache_bytes) {
864
+ const ret = wasm.bench_set_cache_bytes(cache_bytes);
865
+ if (ret[1]) {
866
+ throw takeFromExternrefTable0(ret[0]);
867
+ }
868
+ }
869
+
870
+ /**
871
+ * @param {number} overflow_threshold_bytes
872
+ */
873
+ export function bench_set_overflow_threshold_bytes(overflow_threshold_bytes) {
874
+ const ret = wasm.bench_set_overflow_threshold_bytes(overflow_threshold_bytes);
875
+ if (ret[1]) {
876
+ throw takeFromExternrefTable0(ret[0]);
877
+ }
878
+ }
879
+
880
+ /**
881
+ * @param {boolean} pin_internal_pages
882
+ */
883
+ export function bench_set_pin_internal_pages(pin_internal_pages) {
884
+ wasm.bench_set_pin_internal_pages(pin_internal_pages);
885
+ }
886
+
887
+ /**
888
+ * @param {number} read_coalesce_pages
889
+ */
890
+ export function bench_set_read_coalesce_pages(read_coalesce_pages) {
891
+ const ret = wasm.bench_set_read_coalesce_pages(read_coalesce_pages);
892
+ if (ret[1]) {
893
+ throw takeFromExternrefTable0(ret[0]);
894
+ }
895
+ }
896
+
897
+ /**
898
+ * Get the current timestamp in microseconds since Unix epoch.
899
+ * @returns {bigint}
900
+ */
901
+ export function currentTimestamp() {
902
+ const ret = wasm.currentTimestamp();
903
+ return BigInt.asUintN(64, ret);
904
+ }
905
+
906
+ /**
907
+ * Generate a new UUID v7 (time-ordered).
908
+ *
909
+ * Useful for generating row IDs on the client side.
910
+ * @returns {string}
911
+ */
912
+ export function generateId() {
913
+ let deferred1_0;
914
+ let deferred1_1;
915
+ try {
916
+ const ret = wasm.generateId();
917
+ deferred1_0 = ret[0];
918
+ deferred1_1 = ret[1];
919
+ return getStringFromWasm0(ret[0], ret[1]);
920
+ } finally {
921
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
922
+ }
923
+ }
924
+
925
+ /**
926
+ * Initialize the WASM module.
927
+ *
928
+ * Sets up panic hook for better error messages in the browser console.
929
+ */
930
+ export function init() {
931
+ wasm.init();
932
+ }
933
+
934
+ /**
935
+ * Parse a schema from JSON string.
936
+ *
937
+ * Returns the schema as a JsValue for inspection.
938
+ * @param {string} json
939
+ * @returns {any}
940
+ */
941
+ export function parseSchema(json) {
942
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
943
+ const len0 = WASM_VECTOR_LEN;
944
+ const ret = wasm.parseSchema(ptr0, len0);
945
+ if (ret[2]) {
946
+ throw takeFromExternrefTable0(ret[1]);
947
+ }
948
+ return takeFromExternrefTable0(ret[0]);
949
+ }
950
+
951
+ function __wbg_get_imports() {
952
+ const import0 = {
953
+ __proto__: null,
954
+ __wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
955
+ const ret = Error(getStringFromWasm0(arg0, arg1));
956
+ return ret;
957
+ },
958
+ __wbg_Number_04624de7d0e8332d: function(arg0) {
959
+ const ret = Number(arg0);
960
+ return ret;
961
+ },
962
+ __wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
963
+ const ret = String(arg1);
964
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
965
+ const len1 = WASM_VECTOR_LEN;
966
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
967
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
968
+ },
969
+ __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(arg0, arg1) {
970
+ const v = arg1;
971
+ const ret = typeof(v) === 'bigint' ? v : undefined;
972
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
973
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
974
+ },
975
+ __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
976
+ const v = arg0;
977
+ const ret = typeof(v) === 'boolean' ? v : undefined;
978
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
979
+ },
980
+ __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
981
+ const ret = debugString(arg1);
982
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
983
+ const len1 = WASM_VECTOR_LEN;
984
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
985
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
986
+ },
987
+ __wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
988
+ const ret = arg0 in arg1;
989
+ return ret;
990
+ },
991
+ __wbg___wbindgen_is_bigint_31b12575b56f32fc: function(arg0) {
992
+ const ret = typeof(arg0) === 'bigint';
993
+ return ret;
994
+ },
995
+ __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
996
+ const ret = typeof(arg0) === 'function';
997
+ return ret;
998
+ },
999
+ __wbg___wbindgen_is_null_ac34f5003991759a: function(arg0) {
1000
+ const ret = arg0 === null;
1001
+ return ret;
1002
+ },
1003
+ __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
1004
+ const val = arg0;
1005
+ const ret = typeof(val) === 'object' && val !== null;
1006
+ return ret;
1007
+ },
1008
+ __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
1009
+ const ret = typeof(arg0) === 'string';
1010
+ return ret;
1011
+ },
1012
+ __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
1013
+ const ret = arg0 === undefined;
1014
+ return ret;
1015
+ },
1016
+ __wbg___wbindgen_jsval_eq_11888390b0186270: function(arg0, arg1) {
1017
+ const ret = arg0 === arg1;
1018
+ return ret;
1019
+ },
1020
+ __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
1021
+ const ret = arg0 == arg1;
1022
+ return ret;
1023
+ },
1024
+ __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
1025
+ const obj = arg1;
1026
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1027
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1028
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1029
+ },
1030
+ __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
1031
+ const obj = arg1;
1032
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1033
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1034
+ var len1 = WASM_VECTOR_LEN;
1035
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1036
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1037
+ },
1038
+ __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
1039
+ throw new Error(getStringFromWasm0(arg0, arg1));
1040
+ },
1041
+ __wbg__wbg_cb_unref_d9b87ff7982e3b21: function(arg0) {
1042
+ arg0._wbg_cb_unref();
1043
+ },
1044
+ __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
1045
+ const ret = arg0.call(arg1);
1046
+ return ret;
1047
+ }, arguments); },
1048
+ __wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
1049
+ const ret = arg0.call(arg1, arg2);
1050
+ return ret;
1051
+ }, arguments); },
1052
+ __wbg_call_812d25f1510c13c8: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1053
+ const ret = arg0.call(arg1, arg2, arg3);
1054
+ return ret;
1055
+ }, arguments); },
1056
+ __wbg_close_4ba312253c424342: function(arg0) {
1057
+ arg0.close();
1058
+ },
1059
+ __wbg_createSyncAccessHandle_6457c2b3542fa571: function(arg0) {
1060
+ const ret = arg0.createSyncAccessHandle();
1061
+ return ret;
1062
+ },
1063
+ __wbg_debug_d5a77cad462ceb8a: function(arg0, arg1) {
1064
+ let deferred0_0;
1065
+ let deferred0_1;
1066
+ try {
1067
+ deferred0_0 = arg0;
1068
+ deferred0_1 = arg1;
1069
+ console.debug(getStringFromWasm0(arg0, arg1));
1070
+ } finally {
1071
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1072
+ }
1073
+ },
1074
+ __wbg_debug_df21a20378296d1a: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1075
+ let deferred0_0;
1076
+ let deferred0_1;
1077
+ try {
1078
+ deferred0_0 = arg0;
1079
+ deferred0_1 = arg1;
1080
+ console.debug(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
1081
+ } finally {
1082
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1083
+ }
1084
+ },
1085
+ __wbg_done_57b39ecd9addfe81: function(arg0) {
1086
+ const ret = arg0.done;
1087
+ return ret;
1088
+ },
1089
+ __wbg_entries_58c7934c745daac7: function(arg0) {
1090
+ const ret = Object.entries(arg0);
1091
+ return ret;
1092
+ },
1093
+ __wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
1094
+ let deferred0_0;
1095
+ let deferred0_1;
1096
+ try {
1097
+ deferred0_0 = arg0;
1098
+ deferred0_1 = arg1;
1099
+ console.error(getStringFromWasm0(arg0, arg1));
1100
+ } finally {
1101
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1102
+ }
1103
+ },
1104
+ __wbg_error_77eee9098ea6ead0: function(arg0, arg1) {
1105
+ let deferred0_0;
1106
+ let deferred0_1;
1107
+ try {
1108
+ deferred0_0 = arg0;
1109
+ deferred0_1 = arg1;
1110
+ console.error(getStringFromWasm0(arg0, arg1));
1111
+ } finally {
1112
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1113
+ }
1114
+ },
1115
+ __wbg_error_b4f11b354b4525f5: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1116
+ let deferred0_0;
1117
+ let deferred0_1;
1118
+ try {
1119
+ deferred0_0 = arg0;
1120
+ deferred0_1 = arg1;
1121
+ console.error(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
1122
+ } finally {
1123
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1124
+ }
1125
+ },
1126
+ __wbg_flush_22b785060592ca5f: function() { return handleError(function (arg0) {
1127
+ arg0.flush();
1128
+ }, arguments); },
1129
+ __wbg_getDirectory_b66ae3e79f902982: function(arg0) {
1130
+ const ret = arg0.getDirectory();
1131
+ return ret;
1132
+ },
1133
+ __wbg_getFileHandle_ff4ab917b45affb3: function(arg0, arg1, arg2, arg3) {
1134
+ const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
1135
+ return ret;
1136
+ },
1137
+ __wbg_getRandomValues_1c61fac11405ffdc: function() { return handleError(function (arg0, arg1) {
1138
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1139
+ }, arguments); },
1140
+ __wbg_getRandomValues_71d446877d8b0ad4: function() { return handleError(function (arg0, arg1) {
1141
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1142
+ }, arguments); },
1143
+ __wbg_getSize_0a848f6914efc400: function() { return handleError(function (arg0) {
1144
+ const ret = arg0.getSize();
1145
+ return ret;
1146
+ }, arguments); },
1147
+ __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
1148
+ const ret = arg0[arg1 >>> 0];
1149
+ return ret;
1150
+ },
1151
+ __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
1152
+ const ret = Reflect.get(arg0, arg1);
1153
+ return ret;
1154
+ }, arguments); },
1155
+ __wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
1156
+ const ret = arg0[arg1];
1157
+ return ret;
1158
+ },
1159
+ __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
1160
+ let result;
1161
+ try {
1162
+ result = arg0 instanceof ArrayBuffer;
1163
+ } catch (_) {
1164
+ result = false;
1165
+ }
1166
+ const ret = result;
1167
+ return ret;
1168
+ },
1169
+ __wbg_instanceof_FileSystemDirectoryHandle_56a167039d614548: function(arg0) {
1170
+ let result;
1171
+ try {
1172
+ result = arg0 instanceof FileSystemDirectoryHandle;
1173
+ } catch (_) {
1174
+ result = false;
1175
+ }
1176
+ const ret = result;
1177
+ return ret;
1178
+ },
1179
+ __wbg_instanceof_FileSystemFileHandle_fd8948f4bac4e78a: function(arg0) {
1180
+ let result;
1181
+ try {
1182
+ result = arg0 instanceof FileSystemFileHandle;
1183
+ } catch (_) {
1184
+ result = false;
1185
+ }
1186
+ const ret = result;
1187
+ return ret;
1188
+ },
1189
+ __wbg_instanceof_FileSystemSyncAccessHandle_cfea0c4c370d20b0: function(arg0) {
1190
+ let result;
1191
+ try {
1192
+ result = arg0 instanceof FileSystemSyncAccessHandle;
1193
+ } catch (_) {
1194
+ result = false;
1195
+ }
1196
+ const ret = result;
1197
+ return ret;
1198
+ },
1199
+ __wbg_instanceof_Map_53af74335dec57f4: function(arg0) {
1200
+ let result;
1201
+ try {
1202
+ result = arg0 instanceof Map;
1203
+ } catch (_) {
1204
+ result = false;
1205
+ }
1206
+ const ret = result;
1207
+ return ret;
1208
+ },
1209
+ __wbg_instanceof_Promise_0094681e3519d6ec: function(arg0) {
1210
+ let result;
1211
+ try {
1212
+ result = arg0 instanceof Promise;
1213
+ } catch (_) {
1214
+ result = false;
1215
+ }
1216
+ const ret = result;
1217
+ return ret;
1218
+ },
1219
+ __wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
1220
+ let result;
1221
+ try {
1222
+ result = arg0 instanceof Uint8Array;
1223
+ } catch (_) {
1224
+ result = false;
1225
+ }
1226
+ const ret = result;
1227
+ return ret;
1228
+ },
1229
+ __wbg_instanceof_WorkerGlobalScope_07b9d5514ff0156e: function(arg0) {
1230
+ let result;
1231
+ try {
1232
+ result = arg0 instanceof WorkerGlobalScope;
1233
+ } catch (_) {
1234
+ result = false;
1235
+ }
1236
+ const ret = result;
1237
+ return ret;
1238
+ },
1239
+ __wbg_isArray_d314bb98fcf08331: function(arg0) {
1240
+ const ret = Array.isArray(arg0);
1241
+ return ret;
1242
+ },
1243
+ __wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
1244
+ const ret = Number.isSafeInteger(arg0);
1245
+ return ret;
1246
+ },
1247
+ __wbg_iterator_6ff6560ca1568e55: function() {
1248
+ const ret = Symbol.iterator;
1249
+ return ret;
1250
+ },
1251
+ __wbg_length_32ed9a279acd054c: function(arg0) {
1252
+ const ret = arg0.length;
1253
+ return ret;
1254
+ },
1255
+ __wbg_length_35a7bace40f36eac: function(arg0) {
1256
+ const ret = arg0.length;
1257
+ return ret;
1258
+ },
1259
+ __wbg_log_25b58d7b77bdb480: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1260
+ let deferred0_0;
1261
+ let deferred0_1;
1262
+ try {
1263
+ deferred0_0 = arg0;
1264
+ deferred0_1 = arg1;
1265
+ console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
1266
+ } finally {
1267
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1268
+ }
1269
+ },
1270
+ __wbg_log_9cc9df8414528572: function(arg0, arg1) {
1271
+ let deferred0_0;
1272
+ let deferred0_1;
1273
+ try {
1274
+ deferred0_0 = arg0;
1275
+ deferred0_1 = arg1;
1276
+ console.log(getStringFromWasm0(arg0, arg1));
1277
+ } finally {
1278
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1279
+ }
1280
+ },
1281
+ __wbg_mark_1fdbbbadaf3af4ed: function(arg0, arg1) {
1282
+ performance.mark(getStringFromWasm0(arg0, arg1));
1283
+ },
1284
+ __wbg_measure_301cdbedae89bbb8: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1285
+ let deferred0_0;
1286
+ let deferred0_1;
1287
+ let deferred1_0;
1288
+ let deferred1_1;
1289
+ try {
1290
+ deferred0_0 = arg0;
1291
+ deferred0_1 = arg1;
1292
+ deferred1_0 = arg2;
1293
+ deferred1_1 = arg3;
1294
+ performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1295
+ } finally {
1296
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1297
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1298
+ }
1299
+ }, arguments); },
1300
+ __wbg_navigator_4478931f32ebca57: function(arg0) {
1301
+ const ret = arg0.navigator;
1302
+ return ret;
1303
+ },
1304
+ __wbg_new_361308b2356cecd0: function() {
1305
+ const ret = new Object();
1306
+ return ret;
1307
+ },
1308
+ __wbg_new_3eb36ae241fe6f44: function() {
1309
+ const ret = new Array();
1310
+ return ret;
1311
+ },
1312
+ __wbg_new_8a6f238a6ece86ea: function() {
1313
+ const ret = new Error();
1314
+ return ret;
1315
+ },
1316
+ __wbg_new_b5d9e2fb389fef91: function(arg0, arg1) {
1317
+ try {
1318
+ var state0 = {a: arg0, b: arg1};
1319
+ var cb0 = (arg0, arg1) => {
1320
+ const a = state0.a;
1321
+ state0.a = 0;
1322
+ try {
1323
+ return wasm_bindgen__convert__closures_____invoke__h87add1091edf4849(a, state0.b, arg0, arg1);
1324
+ } finally {
1325
+ state0.a = a;
1326
+ }
1327
+ };
1328
+ const ret = new Promise(cb0);
1329
+ return ret;
1330
+ } finally {
1331
+ state0.a = state0.b = 0;
1332
+ }
1333
+ },
1334
+ __wbg_new_dca287b076112a51: function() {
1335
+ const ret = new Map();
1336
+ return ret;
1337
+ },
1338
+ __wbg_new_dd2b680c8bf6ae29: function(arg0) {
1339
+ const ret = new Uint8Array(arg0);
1340
+ return ret;
1341
+ },
1342
+ __wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
1343
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1344
+ return ret;
1345
+ },
1346
+ __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
1347
+ const ret = arg0.next();
1348
+ return ret;
1349
+ }, arguments); },
1350
+ __wbg_next_418f80d8f5303233: function(arg0) {
1351
+ const ret = arg0.next;
1352
+ return ret;
1353
+ },
1354
+ __wbg_now_20ea2aaee436b621: function() { return handleError(function () {
1355
+ const ret = Date.now();
1356
+ return ret;
1357
+ }, arguments); },
1358
+ __wbg_now_a3af9a2f4bbaa4d1: function() {
1359
+ const ret = Date.now();
1360
+ return ret;
1361
+ },
1362
+ __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
1363
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1364
+ },
1365
+ __wbg_queueMicrotask_0aa0a927f78f5d98: function(arg0) {
1366
+ const ret = arg0.queueMicrotask;
1367
+ return ret;
1368
+ },
1369
+ __wbg_queueMicrotask_5bb536982f78a56f: function(arg0) {
1370
+ queueMicrotask(arg0);
1371
+ },
1372
+ __wbg_random_912284dbf636f269: function() {
1373
+ const ret = Math.random();
1374
+ return ret;
1375
+ },
1376
+ __wbg_read_f161889777645afd: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1377
+ const ret = arg0.read(getArrayU8FromWasm0(arg1, arg2), arg3);
1378
+ return ret;
1379
+ }, arguments); },
1380
+ __wbg_resolve_002c4b7d9d8f6b64: function(arg0) {
1381
+ const ret = Promise.resolve(arg0);
1382
+ return ret;
1383
+ },
1384
+ __wbg_set_1eb0999cf5d27fc8: function(arg0, arg1, arg2) {
1385
+ const ret = arg0.set(arg1, arg2);
1386
+ return ret;
1387
+ },
1388
+ __wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
1389
+ arg0[arg1] = arg2;
1390
+ },
1391
+ __wbg_set_6cb8631f80447a67: function() { return handleError(function (arg0, arg1, arg2) {
1392
+ const ret = Reflect.set(arg0, arg1, arg2);
1393
+ return ret;
1394
+ }, arguments); },
1395
+ __wbg_set_at_e453cf3f4be9e2d9: function(arg0, arg1) {
1396
+ arg0.at = arg1;
1397
+ },
1398
+ __wbg_set_create_1f902c5936adde7d: function(arg0, arg1) {
1399
+ arg0.create = arg1 !== 0;
1400
+ },
1401
+ __wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
1402
+ arg0[arg1 >>> 0] = arg2;
1403
+ },
1404
+ __wbg_stack_0ed75d68575b0f3c: function(arg0, arg1) {
1405
+ const ret = arg1.stack;
1406
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1407
+ const len1 = WASM_VECTOR_LEN;
1408
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1409
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1410
+ },
1411
+ __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
1412
+ const ret = typeof global === 'undefined' ? null : global;
1413
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1414
+ },
1415
+ __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
1416
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1417
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1418
+ },
1419
+ __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
1420
+ const ret = typeof self === 'undefined' ? null : self;
1421
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1422
+ },
1423
+ __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
1424
+ const ret = typeof window === 'undefined' ? null : window;
1425
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1426
+ },
1427
+ __wbg_storage_c002b53bc4883299: function(arg0) {
1428
+ const ret = arg0.storage;
1429
+ return ret;
1430
+ },
1431
+ __wbg_then_0d9fe2c7b1857d32: function(arg0, arg1, arg2) {
1432
+ const ret = arg0.then(arg1, arg2);
1433
+ return ret;
1434
+ },
1435
+ __wbg_then_b9e7b3b5f1a9e1b5: function(arg0, arg1) {
1436
+ const ret = arg0.then(arg1);
1437
+ return ret;
1438
+ },
1439
+ __wbg_value_0546255b415e96c1: function(arg0) {
1440
+ const ret = arg0.value;
1441
+ return ret;
1442
+ },
1443
+ __wbg_warn_294971faa9078d04: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1444
+ let deferred0_0;
1445
+ let deferred0_1;
1446
+ try {
1447
+ deferred0_0 = arg0;
1448
+ deferred0_1 = arg1;
1449
+ console.warn(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
1450
+ } finally {
1451
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1452
+ }
1453
+ },
1454
+ __wbg_warn_8409551e284ac1ef: function(arg0, arg1) {
1455
+ let deferred0_0;
1456
+ let deferred0_1;
1457
+ try {
1458
+ deferred0_0 = arg0;
1459
+ deferred0_1 = arg1;
1460
+ console.warn(getStringFromWasm0(arg0, arg1));
1461
+ } finally {
1462
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1463
+ }
1464
+ },
1465
+ __wbg_wasmruntime_new: function(arg0) {
1466
+ const ret = WasmRuntime.__wrap(arg0);
1467
+ return ret;
1468
+ },
1469
+ __wbg_write_2d59337cc496919d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1470
+ const ret = arg0.write(getArrayU8FromWasm0(arg1, arg2), arg3);
1471
+ return ret;
1472
+ }, arguments); },
1473
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1474
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 633, function: Function { arguments: [Externref], shim_idx: 634, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1475
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h36582af6159eae23, wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf);
1476
+ return ret;
1477
+ },
1478
+ __wbindgen_cast_0000000000000002: function(arg0) {
1479
+ // Cast intrinsic for `F64 -> Externref`.
1480
+ const ret = arg0;
1481
+ return ret;
1482
+ },
1483
+ __wbindgen_cast_0000000000000003: function(arg0) {
1484
+ // Cast intrinsic for `I64 -> Externref`.
1485
+ const ret = arg0;
1486
+ return ret;
1487
+ },
1488
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1489
+ // Cast intrinsic for `Ref(String) -> Externref`.
1490
+ const ret = getStringFromWasm0(arg0, arg1);
1491
+ return ret;
1492
+ },
1493
+ __wbindgen_cast_0000000000000005: function(arg0) {
1494
+ // Cast intrinsic for `U64 -> Externref`.
1495
+ const ret = BigInt.asUintN(64, arg0);
1496
+ return ret;
1497
+ },
1498
+ __wbindgen_init_externref_table: function() {
1499
+ const table = wasm.__wbindgen_externrefs;
1500
+ const offset = table.grow(4);
1501
+ table.set(0, undefined);
1502
+ table.set(offset + 0, undefined);
1503
+ table.set(offset + 1, null);
1504
+ table.set(offset + 2, true);
1505
+ table.set(offset + 3, false);
1506
+ },
1507
+ };
1508
+ return {
1509
+ __proto__: null,
1510
+ "./jazz_wasm_bg.js": import0,
1511
+ };
1512
+ }
1513
+
1514
+ function wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf(arg0, arg1, arg2) {
1515
+ wasm.wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf(arg0, arg1, arg2);
1516
+ }
1517
+
1518
+ function wasm_bindgen__convert__closures_____invoke__h87add1091edf4849(arg0, arg1, arg2, arg3) {
1519
+ wasm.wasm_bindgen__convert__closures_____invoke__h87add1091edf4849(arg0, arg1, arg2, arg3);
1520
+ }
1521
+
1522
+ const WasmQueryBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
1523
+ ? { register: () => {}, unregister: () => {} }
1524
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmquerybuilder_free(ptr >>> 0, 1));
1525
+ const WasmRuntimeFinalization = (typeof FinalizationRegistry === 'undefined')
1526
+ ? { register: () => {}, unregister: () => {} }
1527
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmruntime_free(ptr >>> 0, 1));
1528
+
1529
+ function addToExternrefTable0(obj) {
1530
+ const idx = wasm.__externref_table_alloc();
1531
+ wasm.__wbindgen_externrefs.set(idx, obj);
1532
+ return idx;
1533
+ }
1534
+
1535
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1536
+ ? { register: () => {}, unregister: () => {} }
1537
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
1538
+
1539
+ function debugString(val) {
1540
+ // primitive types
1541
+ const type = typeof val;
1542
+ if (type == 'number' || type == 'boolean' || val == null) {
1543
+ return `${val}`;
1544
+ }
1545
+ if (type == 'string') {
1546
+ return `"${val}"`;
1547
+ }
1548
+ if (type == 'symbol') {
1549
+ const description = val.description;
1550
+ if (description == null) {
1551
+ return 'Symbol';
1552
+ } else {
1553
+ return `Symbol(${description})`;
1554
+ }
1555
+ }
1556
+ if (type == 'function') {
1557
+ const name = val.name;
1558
+ if (typeof name == 'string' && name.length > 0) {
1559
+ return `Function(${name})`;
1560
+ } else {
1561
+ return 'Function';
1562
+ }
1563
+ }
1564
+ // objects
1565
+ if (Array.isArray(val)) {
1566
+ const length = val.length;
1567
+ let debug = '[';
1568
+ if (length > 0) {
1569
+ debug += debugString(val[0]);
1570
+ }
1571
+ for(let i = 1; i < length; i++) {
1572
+ debug += ', ' + debugString(val[i]);
1573
+ }
1574
+ debug += ']';
1575
+ return debug;
1576
+ }
1577
+ // Test for built-in
1578
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1579
+ let className;
1580
+ if (builtInMatches && builtInMatches.length > 1) {
1581
+ className = builtInMatches[1];
1582
+ } else {
1583
+ // Failed to match the standard '[object ClassName]'
1584
+ return toString.call(val);
1585
+ }
1586
+ if (className == 'Object') {
1587
+ // we're a user defined class or Object
1588
+ // JSON.stringify avoids problems with cycles, and is generally much
1589
+ // easier than looping through ownProperties of `val`.
1590
+ try {
1591
+ return 'Object(' + JSON.stringify(val) + ')';
1592
+ } catch (_) {
1593
+ return 'Object';
1594
+ }
1595
+ }
1596
+ // errors
1597
+ if (val instanceof Error) {
1598
+ return `${val.name}: ${val.message}\n${val.stack}`;
1599
+ }
1600
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1601
+ return className;
1602
+ }
1603
+
1604
+ function getArrayU8FromWasm0(ptr, len) {
1605
+ ptr = ptr >>> 0;
1606
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1607
+ }
1608
+
1609
+ let cachedDataViewMemory0 = null;
1610
+ function getDataViewMemory0() {
1611
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1612
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1613
+ }
1614
+ return cachedDataViewMemory0;
1615
+ }
1616
+
1617
+ function getStringFromWasm0(ptr, len) {
1618
+ ptr = ptr >>> 0;
1619
+ return decodeText(ptr, len);
1620
+ }
1621
+
1622
+ let cachedUint8ArrayMemory0 = null;
1623
+ function getUint8ArrayMemory0() {
1624
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1625
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1626
+ }
1627
+ return cachedUint8ArrayMemory0;
1628
+ }
1629
+
1630
+ function handleError(f, args) {
1631
+ try {
1632
+ return f.apply(this, args);
1633
+ } catch (e) {
1634
+ const idx = addToExternrefTable0(e);
1635
+ wasm.__wbindgen_exn_store(idx);
1636
+ }
1637
+ }
1638
+
1639
+ function isLikeNone(x) {
1640
+ return x === undefined || x === null;
1641
+ }
1642
+
1643
+ function makeMutClosure(arg0, arg1, dtor, f) {
1644
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1645
+ const real = (...args) => {
1646
+
1647
+ // First up with a closure we increment the internal reference
1648
+ // count. This ensures that the Rust closure environment won't
1649
+ // be deallocated while we're invoking it.
1650
+ state.cnt++;
1651
+ const a = state.a;
1652
+ state.a = 0;
1653
+ try {
1654
+ return f(a, state.b, ...args);
1655
+ } finally {
1656
+ state.a = a;
1657
+ real._wbg_cb_unref();
1658
+ }
1659
+ };
1660
+ real._wbg_cb_unref = () => {
1661
+ if (--state.cnt === 0) {
1662
+ state.dtor(state.a, state.b);
1663
+ state.a = 0;
1664
+ CLOSURE_DTORS.unregister(state);
1665
+ }
1666
+ };
1667
+ CLOSURE_DTORS.register(real, state, state);
1668
+ return real;
1669
+ }
1670
+
1671
+ function passArrayJsValueToWasm0(array, malloc) {
1672
+ const ptr = malloc(array.length * 4, 4) >>> 0;
1673
+ for (let i = 0; i < array.length; i++) {
1674
+ const add = addToExternrefTable0(array[i]);
1675
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
1676
+ }
1677
+ WASM_VECTOR_LEN = array.length;
1678
+ return ptr;
1679
+ }
1680
+
1681
+ function passStringToWasm0(arg, malloc, realloc) {
1682
+ if (realloc === undefined) {
1683
+ const buf = cachedTextEncoder.encode(arg);
1684
+ const ptr = malloc(buf.length, 1) >>> 0;
1685
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1686
+ WASM_VECTOR_LEN = buf.length;
1687
+ return ptr;
1688
+ }
1689
+
1690
+ let len = arg.length;
1691
+ let ptr = malloc(len, 1) >>> 0;
1692
+
1693
+ const mem = getUint8ArrayMemory0();
1694
+
1695
+ let offset = 0;
1696
+
1697
+ for (; offset < len; offset++) {
1698
+ const code = arg.charCodeAt(offset);
1699
+ if (code > 0x7F) break;
1700
+ mem[ptr + offset] = code;
1701
+ }
1702
+ if (offset !== len) {
1703
+ if (offset !== 0) {
1704
+ arg = arg.slice(offset);
1705
+ }
1706
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1707
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1708
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1709
+
1710
+ offset += ret.written;
1711
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1712
+ }
1713
+
1714
+ WASM_VECTOR_LEN = offset;
1715
+ return ptr;
1716
+ }
1717
+
1718
+ function takeFromExternrefTable0(idx) {
1719
+ const value = wasm.__wbindgen_externrefs.get(idx);
1720
+ wasm.__externref_table_dealloc(idx);
1721
+ return value;
1722
+ }
1723
+
1724
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1725
+ cachedTextDecoder.decode();
1726
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1727
+ let numBytesDecoded = 0;
1728
+ function decodeText(ptr, len) {
1729
+ numBytesDecoded += len;
1730
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1731
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1732
+ cachedTextDecoder.decode();
1733
+ numBytesDecoded = len;
1734
+ }
1735
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1736
+ }
1737
+
1738
+ const cachedTextEncoder = new TextEncoder();
1739
+
1740
+ if (!('encodeInto' in cachedTextEncoder)) {
1741
+ cachedTextEncoder.encodeInto = function (arg, view) {
1742
+ const buf = cachedTextEncoder.encode(arg);
1743
+ view.set(buf);
1744
+ return {
1745
+ read: arg.length,
1746
+ written: buf.length
1747
+ };
1748
+ };
1749
+ }
1750
+
1751
+ let WASM_VECTOR_LEN = 0;
1752
+
1753
+ let wasmModule, wasm;
1754
+ function __wbg_finalize_init(instance, module) {
1755
+ wasm = instance.exports;
1756
+ wasmModule = module;
1757
+ cachedDataViewMemory0 = null;
1758
+ cachedUint8ArrayMemory0 = null;
1759
+ wasm.__wbindgen_start();
1760
+ return wasm;
1761
+ }
1762
+
1763
+ async function __wbg_load(module, imports) {
1764
+ if (typeof Response === 'function' && module instanceof Response) {
1765
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1766
+ try {
1767
+ return await WebAssembly.instantiateStreaming(module, imports);
1768
+ } catch (e) {
1769
+ const validResponse = module.ok && expectedResponseType(module.type);
1770
+
1771
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1772
+ 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);
1773
+
1774
+ } else { throw e; }
1775
+ }
1776
+ }
1777
+
1778
+ const bytes = await module.arrayBuffer();
1779
+ return await WebAssembly.instantiate(bytes, imports);
1780
+ } else {
1781
+ const instance = await WebAssembly.instantiate(module, imports);
1782
+
1783
+ if (instance instanceof WebAssembly.Instance) {
1784
+ return { instance, module };
1785
+ } else {
1786
+ return instance;
1787
+ }
1788
+ }
1789
+
1790
+ function expectedResponseType(type) {
1791
+ switch (type) {
1792
+ case 'basic': case 'cors': case 'default': return true;
1793
+ }
1794
+ return false;
1795
+ }
1796
+ }
1797
+
1798
+ function initSync(module) {
1799
+ if (wasm !== undefined) return wasm;
1800
+
1801
+
1802
+ if (module !== undefined) {
1803
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1804
+ ({module} = module)
1805
+ } else {
1806
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1807
+ }
1808
+ }
1809
+
1810
+ const imports = __wbg_get_imports();
1811
+ if (!(module instanceof WebAssembly.Module)) {
1812
+ module = new WebAssembly.Module(module);
1813
+ }
1814
+ const instance = new WebAssembly.Instance(module, imports);
1815
+ return __wbg_finalize_init(instance, module);
1816
+ }
1817
+
1818
+ async function __wbg_init(module_or_path) {
1819
+ if (wasm !== undefined) return wasm;
1820
+
1821
+
1822
+ if (module_or_path !== undefined) {
1823
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1824
+ ({module_or_path} = module_or_path)
1825
+ } else {
1826
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1827
+ }
1828
+ }
1829
+
1830
+ if (module_or_path === undefined) {
1831
+ module_or_path = new URL('jazz_wasm_bg.wasm', import.meta.url);
1832
+ }
1833
+ const imports = __wbg_get_imports();
1834
+
1835
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1836
+ module_or_path = fetch(module_or_path);
1837
+ }
1838
+
1839
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1840
+
1841
+ return __wbg_finalize_init(instance, module);
1842
+ }
1843
+
1844
+ export { initSync, __wbg_init as default };