rocx-docx 0.0.0-stage → 0.5.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/pkg/rocx.js ADDED
@@ -0,0 +1,945 @@
1
+ /**
2
+ * JS wrappers own this Wasm token; the lookup index never owns the engine data.
3
+ */
4
+ export class EngineHandle {
5
+ static __wrap(ptr) {
6
+ const obj = Object.create(EngineHandle.prototype);
7
+ obj.__wbg_ptr = ptr;
8
+ EngineHandleFinalization.register(obj, obj.__wbg_ptr, obj);
9
+ return obj;
10
+ }
11
+ __destroy_into_raw() {
12
+ const ptr = this.__wbg_ptr;
13
+ this.__wbg_ptr = 0;
14
+ EngineHandleFinalization.unregister(this);
15
+ return ptr;
16
+ }
17
+ free() {
18
+ const ptr = this.__destroy_into_raw();
19
+ wasm.__wbg_enginehandle_free(ptr, 0);
20
+ }
21
+ /**
22
+ * @returns {number}
23
+ */
24
+ get id() {
25
+ const ret = wasm.enginehandle_id(this.__wbg_ptr);
26
+ return ret >>> 0;
27
+ }
28
+ }
29
+ if (Symbol.dispose) EngineHandle.prototype[Symbol.dispose] = EngineHandle.prototype.free;
30
+
31
+ export class Operation {
32
+ __destroy_into_raw() {
33
+ const ptr = this.__wbg_ptr;
34
+ this.__wbg_ptr = 0;
35
+ OperationFinalization.unregister(this);
36
+ return ptr;
37
+ }
38
+ free() {
39
+ const ptr = this.__destroy_into_raw();
40
+ wasm.__wbg_operation_free(ptr, 0);
41
+ }
42
+ /**
43
+ * @param {any} cause
44
+ */
45
+ abort(cause) {
46
+ wasm.operation_abort(this.__wbg_ptr, cause);
47
+ }
48
+ constructor() {
49
+ const ret = wasm.operation_new();
50
+ this.__wbg_ptr = ret;
51
+ OperationFinalization.register(this, this.__wbg_ptr, this);
52
+ return this;
53
+ }
54
+ }
55
+ if (Symbol.dispose) Operation.prototype[Symbol.dispose] = Operation.prototype.free;
56
+
57
+ export class SharedValue {
58
+ static __wrap(ptr) {
59
+ const obj = Object.create(SharedValue.prototype);
60
+ obj.__wbg_ptr = ptr;
61
+ SharedValueFinalization.register(obj, obj.__wbg_ptr, obj);
62
+ return obj;
63
+ }
64
+ __destroy_into_raw() {
65
+ const ptr = this.__wbg_ptr;
66
+ this.__wbg_ptr = 0;
67
+ SharedValueFinalization.unregister(this);
68
+ return ptr;
69
+ }
70
+ free() {
71
+ const ptr = this.__destroy_into_raw();
72
+ wasm.__wbg_sharedvalue_free(ptr, 0);
73
+ }
74
+ /**
75
+ * @returns {number}
76
+ */
77
+ get id() {
78
+ const ret = wasm.sharedvalue_id(this.__wbg_ptr);
79
+ return ret >>> 0;
80
+ }
81
+ }
82
+ if (Symbol.dispose) SharedValue.prototype[Symbol.dispose] = SharedValue.prototype.free;
83
+
84
+ /**
85
+ * @param {any} host
86
+ */
87
+ export function configure_host(host) {
88
+ wasm.configure_host(host);
89
+ }
90
+
91
+ /**
92
+ * @param {string} operation
93
+ * @param {any} input
94
+ * @returns {any}
95
+ */
96
+ export function dispatch(operation, input) {
97
+ const ptr0 = passStringToWasm0(operation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
98
+ const len0 = WASM_VECTOR_LEN;
99
+ const ret = wasm.dispatch(ptr0, len0, input);
100
+ if (ret[2]) {
101
+ throw takeFromExternrefTable0(ret[1]);
102
+ }
103
+ return takeFromExternrefTable0(ret[0]);
104
+ }
105
+
106
+ /**
107
+ * @param {any} source
108
+ * @param {string | null | undefined} name
109
+ * @param {any} guard
110
+ * @returns {SharedValue}
111
+ */
112
+ export function make_shared(source, name, guard) {
113
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
114
+ var len0 = WASM_VECTOR_LEN;
115
+ const ret = wasm.make_shared(source, ptr0, len0, guard);
116
+ if (ret[2]) {
117
+ throw takeFromExternrefTable0(ret[1]);
118
+ }
119
+ return SharedValue.__wrap(ret[0]);
120
+ }
121
+
122
+ /**
123
+ * @param {any} document
124
+ * @param {any} options
125
+ * @returns {Uint8Array}
126
+ */
127
+ export function render_document(document, options) {
128
+ const ret = wasm.render_document(document, options);
129
+ if (ret[3]) {
130
+ throw takeFromExternrefTable0(ret[2]);
131
+ }
132
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
133
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
134
+ return v1;
135
+ }
136
+
137
+ /**
138
+ * @param {any} declaration
139
+ * @param {string} timestamp
140
+ * @returns {Promise<Uint8Array>}
141
+ */
142
+ export function render_docx(declaration, timestamp) {
143
+ const ptr0 = passStringToWasm0(timestamp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
144
+ const len0 = WASM_VECTOR_LEN;
145
+ const ret = wasm.render_docx(declaration, ptr0, len0);
146
+ return ret;
147
+ }
148
+
149
+ /**
150
+ * @param {number} call
151
+ * @param {any} target
152
+ * @param {Function} callback
153
+ * @returns {boolean}
154
+ */
155
+ export function request_dependency(call, target, callback) {
156
+ const ret = wasm.request_dependency(call, target, callback);
157
+ return ret !== 0;
158
+ }
159
+
160
+ /**
161
+ * @param {any} input
162
+ * @param {string | null | undefined} scope
163
+ * @param {Operation} operation
164
+ * @returns {Promise<any>}
165
+ */
166
+ export function resolve_component(input, scope, operation) {
167
+ _assertClass(operation, Operation);
168
+ var ptr0 = isLikeNone(scope) ? 0 : passStringToWasm0(scope, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
+ var len0 = WASM_VECTOR_LEN;
170
+ const ret = wasm.resolve_component(input, ptr0, len0, operation.__wbg_ptr);
171
+ return ret;
172
+ }
173
+
174
+ /**
175
+ * @param {any} input
176
+ * @param {Operation} operation
177
+ * @returns {Promise<any>}
178
+ */
179
+ export function resolve_input(input, operation) {
180
+ _assertClass(operation, Operation);
181
+ const ret = wasm.resolve_input(input, operation.__wbg_ptr);
182
+ return ret;
183
+ }
184
+
185
+ /**
186
+ * @param {any} input
187
+ * @param {string} clock
188
+ * @param {Operation} operation
189
+ * @returns {Promise<any>}
190
+ */
191
+ export function resolve_program(input, clock, operation) {
192
+ _assertClass(operation, Operation);
193
+ const ptr0 = passStringToWasm0(clock, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
194
+ const len0 = WASM_VECTOR_LEN;
195
+ const ret = wasm.resolve_program(input, ptr0, len0, operation.__wbg_ptr);
196
+ return ret;
197
+ }
198
+
199
+ /**
200
+ * @param {number} call
201
+ * @param {boolean} success
202
+ * @param {any} value
203
+ * @param {number} dependency
204
+ */
205
+ export function settle_producer(call, success, value, dependency) {
206
+ wasm.settle_producer(call, success, value, dependency);
207
+ }
208
+ function __wbg_get_imports() {
209
+ const import0 = {
210
+ __proto__: null,
211
+ __wbg_Error_208446807d0d1e30: function(arg0, arg1) {
212
+ const ret = Error(getStringFromWasm0(arg0, arg1));
213
+ return ret;
214
+ },
215
+ __wbg_Number_ff192a72a0dcdf6d: function(arg0) {
216
+ const ret = Number(arg0);
217
+ return ret;
218
+ },
219
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
220
+ const ret = String(arg1);
221
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
222
+ const len1 = WASM_VECTOR_LEN;
223
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
224
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
225
+ },
226
+ __wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef: function(arg0, arg1) {
227
+ const v = arg1;
228
+ const ret = typeof(v) === 'bigint' ? v : undefined;
229
+ getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
230
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
231
+ },
232
+ __wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
233
+ const v = arg0;
234
+ const ret = typeof(v) === 'boolean' ? v : undefined;
235
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
236
+ },
237
+ __wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
238
+ const ret = debugString(arg1);
239
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ const len1 = WASM_VECTOR_LEN;
241
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
242
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
243
+ },
244
+ __wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
245
+ const ret = arg0 in arg1;
246
+ return ret;
247
+ },
248
+ __wbg___wbindgen_is_bigint_5fa10641e039d3ef: function(arg0) {
249
+ const ret = typeof(arg0) === 'bigint';
250
+ return ret;
251
+ },
252
+ __wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
253
+ const ret = typeof(arg0) === 'function';
254
+ return ret;
255
+ },
256
+ __wbg___wbindgen_is_null_c22311b1cc228e3a: function(arg0) {
257
+ const ret = arg0 === null;
258
+ return ret;
259
+ },
260
+ __wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
261
+ const val = arg0;
262
+ const ret = typeof(val) === 'object' && val !== null;
263
+ return ret;
264
+ },
265
+ __wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
266
+ const ret = typeof(arg0) === 'string';
267
+ return ret;
268
+ },
269
+ __wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
270
+ const ret = arg0 === undefined;
271
+ return ret;
272
+ },
273
+ __wbg___wbindgen_jsval_eq_38d7bfbe4cc84039: function(arg0, arg1) {
274
+ const ret = arg0 === arg1;
275
+ return ret;
276
+ },
277
+ __wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
278
+ const ret = arg0 == arg1;
279
+ return ret;
280
+ },
281
+ __wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
282
+ const obj = arg1;
283
+ const ret = typeof(obj) === 'number' ? obj : undefined;
284
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
285
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
286
+ },
287
+ __wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
288
+ const obj = arg1;
289
+ const ret = typeof(obj) === 'string' ? obj : undefined;
290
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
291
+ var len1 = WASM_VECTOR_LEN;
292
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
293
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
294
+ },
295
+ __wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
296
+ throw new Error(getStringFromWasm0(arg0, arg1));
297
+ },
298
+ __wbg__wbg_cb_unref_09736879a3f67559: function(arg0) {
299
+ arg0._wbg_cb_unref();
300
+ },
301
+ __wbg_apply_bfe2b07b146427e2: function() { return handleError(function (arg0, arg1, arg2) {
302
+ const ret = arg0.apply(arg1, arg2);
303
+ return ret;
304
+ }, arguments); },
305
+ __wbg_call_275b78b3b6520b92: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
306
+ const ret = arg0.call(arg1, arg2, arg3, arg4);
307
+ return ret;
308
+ }, arguments); },
309
+ __wbg_call_40b008ba32f73991: function() { return handleError(function (arg0, arg1) {
310
+ const ret = arg0.call(arg1);
311
+ return ret;
312
+ }, arguments); },
313
+ __wbg_call_a410eb4b59ed5965: function() { return handleError(function (arg0, arg1, arg2) {
314
+ const ret = arg0.call(arg1, arg2);
315
+ return ret;
316
+ }, arguments); },
317
+ __wbg_construct_8670bb4c2b062969: function() { return handleError(function (arg0, arg1) {
318
+ const ret = Reflect.construct(arg0, arg1);
319
+ return ret;
320
+ }, arguments); },
321
+ __wbg_constructor_76ad3e2c50d259de: function(arg0) {
322
+ const ret = arg0.constructor;
323
+ return ret;
324
+ },
325
+ __wbg_defineProperty_a5a9526e5e4e6fd7: function(arg0, arg1, arg2) {
326
+ const ret = Object.defineProperty(arg0, arg1, arg2);
327
+ return ret;
328
+ },
329
+ __wbg_done_57e08d0be6e30c02: function(arg0) {
330
+ const ret = arg0.done;
331
+ return ret;
332
+ },
333
+ __wbg_enginehandle_new: function(arg0) {
334
+ const ret = EngineHandle.__wrap(arg0);
335
+ return ret;
336
+ },
337
+ __wbg_entries_7bb1459bd9b5c2b9: function(arg0) {
338
+ const ret = Object.entries(arg0);
339
+ return ret;
340
+ },
341
+ __wbg_getOwnPropertyDescriptor_49e8ef1c598506db: function() { return handleError(function (arg0, arg1) {
342
+ const ret = Object.getOwnPropertyDescriptor(arg0, arg1);
343
+ return ret;
344
+ }, arguments); },
345
+ __wbg_getOwnPropertyDescriptor_bde8c48ab22edbff: function() { return handleError(function (arg0, arg1) {
346
+ const ret = Reflect.getOwnPropertyDescriptor(arg0, arg1);
347
+ return ret;
348
+ }, arguments); },
349
+ __wbg_getPrototypeOf_684ea783c7170e41: function(arg0) {
350
+ const ret = Object.getPrototypeOf(arg0);
351
+ return ret;
352
+ },
353
+ __wbg_get_2080c49015e35254: function() { return handleError(function (arg0, arg1) {
354
+ const ret = Reflect.get(arg0, arg1);
355
+ return ret;
356
+ }, arguments); },
357
+ __wbg_get_635eea311fa1a291: function() { return handleError(function (arg0, arg1) {
358
+ const ret = Reflect.get(arg0, arg1);
359
+ return ret;
360
+ }, arguments); },
361
+ __wbg_get_d7176cfb76d71114: function(arg0, arg1) {
362
+ const ret = arg0[arg1 >>> 0];
363
+ return ret;
364
+ },
365
+ __wbg_get_get_0fe5cf9a2051f5f7: function(arg0) {
366
+ const ret = arg0.get;
367
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
368
+ },
369
+ __wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
370
+ const ret = arg0[arg1 >>> 0];
371
+ return ret;
372
+ },
373
+ __wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
374
+ const ret = arg0[arg1];
375
+ return ret;
376
+ },
377
+ __wbg_has_2c4d5cf25ec8c1cf: function() { return handleError(function (arg0, arg1) {
378
+ const ret = Reflect.has(arg0, arg1);
379
+ return ret;
380
+ }, arguments); },
381
+ __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
382
+ let result;
383
+ try {
384
+ result = arg0 instanceof ArrayBuffer;
385
+ } catch (_) {
386
+ result = false;
387
+ }
388
+ const ret = result;
389
+ return ret;
390
+ },
391
+ __wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
392
+ let result;
393
+ try {
394
+ result = arg0 instanceof Uint8Array;
395
+ } catch (_) {
396
+ result = false;
397
+ }
398
+ const ret = result;
399
+ return ret;
400
+ },
401
+ __wbg_isArray_bcf1376d0d732d08: function(arg0) {
402
+ const ret = Array.isArray(arg0);
403
+ return ret;
404
+ },
405
+ __wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
406
+ const ret = Number.isSafeInteger(arg0);
407
+ return ret;
408
+ },
409
+ __wbg_isView_7c4f5a7c257b3a84: function(arg0) {
410
+ const ret = ArrayBuffer.isView(arg0);
411
+ return ret;
412
+ },
413
+ __wbg_isWellFormed_9e12b0337ba4dfeb: function(arg0) {
414
+ const ret = arg0.isWellFormed();
415
+ return ret;
416
+ },
417
+ __wbg_iterator_e4c5e8f68ada7b58: function() {
418
+ const ret = Symbol.iterator;
419
+ return ret;
420
+ },
421
+ __wbg_keys_105f5c0857898f84: function(arg0) {
422
+ const ret = Object.keys(arg0);
423
+ return ret;
424
+ },
425
+ __wbg_length_186163212ffe79c3: function(arg0) {
426
+ const ret = arg0.length;
427
+ return ret;
428
+ },
429
+ __wbg_length_b03a0fabb109b1e9: function(arg0) {
430
+ const ret = arg0.length;
431
+ return ret;
432
+ },
433
+ __wbg_message_43d8c8f1d543a349: function(arg0) {
434
+ const ret = arg0.message;
435
+ return ret;
436
+ },
437
+ __wbg_new_13de428334042d26: function(arg0) {
438
+ const ret = new Uint8Array(arg0);
439
+ return ret;
440
+ },
441
+ __wbg_new_37eb45aaf5eeb820: function() {
442
+ const ret = new Array();
443
+ return ret;
444
+ },
445
+ __wbg_new_787b9fb330d55d78: function(arg0, arg1) {
446
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
447
+ return ret;
448
+ },
449
+ __wbg_new_cd4348290afae586: function() {
450
+ const ret = new Object();
451
+ return ret;
452
+ },
453
+ __wbg_new_from_slice_b8daf545a41c6aa0: function(arg0, arg1) {
454
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
455
+ return ret;
456
+ },
457
+ __wbg_new_typed_e09da9dae6ee5935: function(arg0, arg1) {
458
+ try {
459
+ var state0 = {a: arg0, b: arg1};
460
+ var cb0 = (arg0, arg1) => {
461
+ const a = state0.a;
462
+ state0.a = 0;
463
+ try {
464
+ return wasm_bindgen_84df2d7dc6f28eed___convert__closures_____invoke___js_sys_fa423694c064de4b___Function_fn_wasm_bindgen_84df2d7dc6f28eed___JsValue_____wasm_bindgen_84df2d7dc6f28eed___sys__Undefined___js_sys_fa423694c064de4b___Function_fn_wasm_bindgen_84df2d7dc6f28eed___JsValue_____wasm_bindgen_84df2d7dc6f28eed___sys__Undefined_______true_(a, state0.b, arg0, arg1);
465
+ } finally {
466
+ state0.a = a;
467
+ }
468
+ };
469
+ const ret = new Promise(cb0);
470
+ return ret;
471
+ } finally {
472
+ state0.a = 0;
473
+ }
474
+ },
475
+ __wbg_new_with_length_01b143a7e5dd5a3e: function(arg0) {
476
+ const ret = new Uint8Array(arg0 >>> 0);
477
+ return ret;
478
+ },
479
+ __wbg_next_178c1651c11432b3: function(arg0) {
480
+ const ret = arg0.next;
481
+ return ret;
482
+ },
483
+ __wbg_next_af5ac6a08bb0a717: function() { return handleError(function (arg0) {
484
+ const ret = arg0.next();
485
+ return ret;
486
+ }, arguments); },
487
+ __wbg_of_027eb15371aac932: function(arg0) {
488
+ const ret = Array.of(arg0);
489
+ return ret;
490
+ },
491
+ __wbg_of_41bbc931cc6fa107: function(arg0, arg1, arg2, arg3) {
492
+ const ret = Array.of(arg0, arg1, arg2, arg3);
493
+ return ret;
494
+ },
495
+ __wbg_of_4cc373bef1f715a4: function(arg0, arg1, arg2) {
496
+ const ret = Array.of(arg0, arg1, arg2);
497
+ return ret;
498
+ },
499
+ __wbg_of_e7ea0fcd535c1444: function(arg0, arg1) {
500
+ const ret = Array.of(arg0, arg1);
501
+ return ret;
502
+ },
503
+ __wbg_ownKeys_c9890d5405932253: function() { return handleError(function (arg0) {
504
+ const ret = Reflect.ownKeys(arg0);
505
+ return ret;
506
+ }, arguments); },
507
+ __wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
508
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
509
+ },
510
+ __wbg_push_c9f4893fc209f768: function(arg0, arg1) {
511
+ const ret = arg0.push(arg1);
512
+ return ret;
513
+ },
514
+ __wbg_queueMicrotask_1e8503a8a690f0a3: function(arg0) {
515
+ const ret = arg0.queueMicrotask;
516
+ return ret;
517
+ },
518
+ __wbg_queueMicrotask_4a1a4d8dd332373b: function(arg0) {
519
+ queueMicrotask(arg0);
520
+ },
521
+ __wbg_resolve_dbf78ab4942478b0: function(arg0) {
522
+ const ret = Promise.resolve(arg0);
523
+ return ret;
524
+ },
525
+ __wbg_set_2793479888329cb6: function() { return handleError(function (arg0, arg1, arg2) {
526
+ const ret = Reflect.set(arg0, arg1, arg2);
527
+ return ret;
528
+ }, arguments); },
529
+ __wbg_set_name_822e3903f3184979: function(arg0, arg1, arg2) {
530
+ arg0.name = getStringFromWasm0(arg1, arg2);
531
+ },
532
+ __wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
533
+ const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
534
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
535
+ },
536
+ __wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
537
+ const ret = typeof global === 'undefined' ? undefined : global;
538
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
539
+ },
540
+ __wbg_static_accessor_SELF_53bb20457401453d: function() {
541
+ const ret = typeof self === 'undefined' ? undefined : self;
542
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
543
+ },
544
+ __wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
545
+ const ret = typeof window === 'undefined' ? undefined : window;
546
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
547
+ },
548
+ __wbg_then_e3f7f2d365708be8: function(arg0, arg1) {
549
+ const ret = arg0.then(arg1);
550
+ return ret;
551
+ },
552
+ __wbg_toStringTag_1bdd39ac5d866229: function() {
553
+ const ret = Symbol.toStringTag;
554
+ return ret;
555
+ },
556
+ __wbg_value_e0f328965e184931: function(arg0) {
557
+ const ret = arg0.value;
558
+ return ret;
559
+ },
560
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
561
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 939, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
562
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_84df2d7dc6f28eed___convert__closures_____invoke___wasm_bindgen_84df2d7dc6f28eed___JsValue__core_d941ad8722425d2e___result__Result_____wasm_bindgen_84df2d7dc6f28eed___JsError___true_);
563
+ return ret;
564
+ },
565
+ __wbindgen_generic_0000000000000002: function(arg0) {
566
+ // Cast intrinsic for `F64 -> Externref`.
567
+ const ret = arg0;
568
+ return ret;
569
+ },
570
+ __wbindgen_generic_0000000000000003: function(arg0) {
571
+ // Cast intrinsic for `I64 -> Externref`.
572
+ const ret = arg0;
573
+ return ret;
574
+ },
575
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
576
+ // Cast intrinsic for `Ref(String) -> Externref`.
577
+ const ret = getStringFromWasm0(arg0, arg1);
578
+ return ret;
579
+ },
580
+ __wbindgen_generic_0000000000000005: function(arg0) {
581
+ // Cast intrinsic for `U64 -> Externref`.
582
+ const ret = BigInt.asUintN(64, arg0);
583
+ return ret;
584
+ },
585
+ __wbindgen_generic_0000000000000006: function(arg0, arg1) {
586
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
587
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
588
+ // Cast intrinsic for `Vector(U8) -> Externref`.
589
+ const ret = v0;
590
+ return ret;
591
+ },
592
+ __wbindgen_init_externref_table: function() {
593
+ const table = wasm.__wbindgen_externrefs;
594
+ table.set(0, undefined);
595
+ table.set(1024, undefined);
596
+ table.set(1025, null);
597
+ table.set(1026, true);
598
+ table.set(1027, false);
599
+ },
600
+ };
601
+ return {
602
+ __proto__: null,
603
+ "./rocx_bg.js": import0,
604
+ };
605
+ }
606
+
607
+ function wasm_bindgen_84df2d7dc6f28eed___convert__closures_____invoke___wasm_bindgen_84df2d7dc6f28eed___JsValue__core_d941ad8722425d2e___result__Result_____wasm_bindgen_84df2d7dc6f28eed___JsError___true_(arg0, arg1, arg2) {
608
+ const ret = wasm.wasm_bindgen_84df2d7dc6f28eed___convert__closures_____invoke___wasm_bindgen_84df2d7dc6f28eed___JsValue__core_d941ad8722425d2e___result__Result_____wasm_bindgen_84df2d7dc6f28eed___JsError___true_(arg0, arg1, arg2);
609
+ if (ret[1]) {
610
+ throw takeFromExternrefTable0(ret[0]);
611
+ }
612
+ }
613
+
614
+ function wasm_bindgen_84df2d7dc6f28eed___convert__closures_____invoke___js_sys_fa423694c064de4b___Function_fn_wasm_bindgen_84df2d7dc6f28eed___JsValue_____wasm_bindgen_84df2d7dc6f28eed___sys__Undefined___js_sys_fa423694c064de4b___Function_fn_wasm_bindgen_84df2d7dc6f28eed___JsValue_____wasm_bindgen_84df2d7dc6f28eed___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
615
+ wasm.wasm_bindgen_84df2d7dc6f28eed___convert__closures_____invoke___js_sys_fa423694c064de4b___Function_fn_wasm_bindgen_84df2d7dc6f28eed___JsValue_____wasm_bindgen_84df2d7dc6f28eed___sys__Undefined___js_sys_fa423694c064de4b___Function_fn_wasm_bindgen_84df2d7dc6f28eed___JsValue_____wasm_bindgen_84df2d7dc6f28eed___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
616
+ }
617
+
618
+ const EngineHandleFinalization = (typeof FinalizationRegistry === 'undefined')
619
+ ? { register: () => {}, unregister: () => {} }
620
+ : new FinalizationRegistry(ptr => wasm.__wbg_enginehandle_free(ptr, 1));
621
+ const OperationFinalization = (typeof FinalizationRegistry === 'undefined')
622
+ ? { register: () => {}, unregister: () => {} }
623
+ : new FinalizationRegistry(ptr => wasm.__wbg_operation_free(ptr, 1));
624
+ const SharedValueFinalization = (typeof FinalizationRegistry === 'undefined')
625
+ ? { register: () => {}, unregister: () => {} }
626
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharedvalue_free(ptr, 1));
627
+
628
+ function addToExternrefTable0(obj) {
629
+ const idx = wasm.__externref_table_alloc();
630
+ wasm.__wbindgen_externrefs.set(idx, obj);
631
+ return idx;
632
+ }
633
+
634
+ function _assertClass(instance, klass) {
635
+ if (!(instance instanceof klass)) {
636
+ throw new Error(`expected instance of ${klass.name}`);
637
+ }
638
+ }
639
+
640
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
641
+ ? { register: () => {}, unregister: () => {} }
642
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
643
+
644
+ function debugString(val) {
645
+ switch (typeof val) {
646
+ // primitive types
647
+ case 'number':
648
+ case 'boolean':
649
+ case 'undefined':
650
+ return `${val}`;
651
+ case 'string':
652
+ return JSON.stringify(val);
653
+ case 'bigint':
654
+ return `${val}n`;
655
+ case 'symbol':
656
+ return val.description !== undefined
657
+ ? `Symbol(${val.description})`
658
+ : 'Symbol';
659
+ case 'function':
660
+ return typeof val.name === 'string' && val.name !== ''
661
+ ? `Function(${val.name})`
662
+ : 'Function';
663
+ case 'object': {
664
+ if (val === null) {
665
+ return 'null';
666
+ }
667
+ // objects
668
+ if (Array.isArray(val)) {
669
+ return '[' + Array.from(val, debugString).join(', ') + ']';
670
+ }
671
+ // errors
672
+ if (val instanceof Error) {
673
+ return `${val.name}: ${val.message}\n${val.stack}`;
674
+ }
675
+
676
+ const toStringOutput = toString.call(val);
677
+ // Test for built-in
678
+ const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
679
+
680
+ // Failed to match the standard '[object ClassName]'
681
+ if (className === undefined) {
682
+ return toStringOutput;
683
+ }
684
+ if (className === 'Object') {
685
+ // we're a user defined class or Object
686
+ // JSON.stringify avoids problems with cycles, and is generally much
687
+ // easier than looping through ownProperties of `val`.
688
+ try {
689
+ return 'Object(' + JSON.stringify(val) + ')';
690
+ } catch (_) {
691
+ return 'Object';
692
+ }
693
+ }
694
+ // TODO we could test for more things here, like `Set`s and `Map`s.
695
+ return className;
696
+ }
697
+ // Per MDN: 'This list of values is exhaustive.'
698
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
699
+ }
700
+ }
701
+
702
+ function getArrayU8FromWasm0(ptr, len) {
703
+ ptr = ptr >>> 0;
704
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
705
+ }
706
+
707
+ let cachedDataViewMemory0 = null;
708
+ function getDataViewMemory0() {
709
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
710
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
711
+ }
712
+ return cachedDataViewMemory0;
713
+ }
714
+
715
+ function getStringFromWasm0(ptr, len) {
716
+ ptr = ptr >>> 0;
717
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
718
+ }
719
+
720
+ let cachedUint8ArrayMemory0 = null;
721
+ function getUint8ArrayMemory0() {
722
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
723
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
724
+ }
725
+ return cachedUint8ArrayMemory0;
726
+ }
727
+
728
+ function handleError(f, args) {
729
+ try {
730
+ return f.apply(this, args);
731
+ } catch (e) {
732
+ const idx = addToExternrefTable0(e);
733
+ wasm.__wbindgen_exn_store(idx);
734
+ }
735
+ }
736
+
737
+ function isLikeNone(x) {
738
+ return x === undefined || x === null;
739
+ }
740
+
741
+ function makeMutClosure(arg0, arg1, f) {
742
+ const state = { a: arg0, b: arg1, cnt: 1 };
743
+ const real = (...args) => {
744
+
745
+ // First up with a closure we increment the internal reference
746
+ // count. This ensures that the Rust closure environment won't
747
+ // be deallocated while we're invoking it.
748
+ state.cnt++;
749
+ const a = state.a;
750
+ state.a = 0;
751
+ try {
752
+ return f(a, state.b, ...args);
753
+ } finally {
754
+ state.a = a;
755
+ real._wbg_cb_unref();
756
+ }
757
+ };
758
+ real._wbg_cb_unref = () => {
759
+ if (--state.cnt === 0) {
760
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
761
+ state.a = 0;
762
+ CLOSURE_DTORS.unregister(state);
763
+ }
764
+ };
765
+ CLOSURE_DTORS.register(real, state, state);
766
+ return real;
767
+ }
768
+
769
+ function passStringToWasm0(arg, malloc, realloc) {
770
+ if (realloc === undefined) {
771
+ const buf = cachedTextEncoder.encode(arg);
772
+ const ptr = malloc(buf.length, 1) >>> 0;
773
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
774
+ WASM_VECTOR_LEN = buf.length;
775
+ return ptr;
776
+ }
777
+
778
+ let len = arg.length;
779
+ let ptr = malloc(len, 1) >>> 0;
780
+
781
+ const mem = getUint8ArrayMemory0();
782
+
783
+ let offset = 0;
784
+
785
+ for (; offset < len; offset++) {
786
+ const code = arg.charCodeAt(offset);
787
+ if (code > 0x7F) break;
788
+ mem[ptr + offset] = code;
789
+ }
790
+ if (offset !== len) {
791
+ if (offset !== 0) {
792
+ arg = arg.slice(offset);
793
+ }
794
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
795
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
796
+ const ret = cachedTextEncoder.encodeInto(arg, view);
797
+
798
+ offset += ret.written;
799
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
800
+ }
801
+
802
+ WASM_VECTOR_LEN = offset;
803
+ return ptr;
804
+ }
805
+
806
+ function takeFromExternrefTable0(idx) {
807
+ const value = wasm.__wbindgen_externrefs.get(idx);
808
+ wasm.__externref_table_dealloc(idx);
809
+ return value;
810
+ }
811
+
812
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
813
+ cachedTextDecoder.decode();
814
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
815
+ let numBytesDecoded = 0;
816
+ function decodeText(bytes) {
817
+ numBytesDecoded += bytes.length;
818
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
819
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
820
+ cachedTextDecoder.decode();
821
+ numBytesDecoded = bytes.length;
822
+ }
823
+ return cachedTextDecoder.decode(bytes);
824
+ }
825
+
826
+ const cachedTextEncoder = new TextEncoder();
827
+
828
+ if (!('encodeInto' in cachedTextEncoder)) {
829
+ cachedTextEncoder.encodeInto = function (arg, view) {
830
+ const buf = cachedTextEncoder.encode(arg);
831
+ view.set(buf);
832
+ return {
833
+ read: arg.length,
834
+ written: buf.length
835
+ };
836
+ };
837
+ }
838
+
839
+ let WASM_VECTOR_LEN = 0;
840
+
841
+ let wasmModule, wasmInstance, wasm;
842
+ function __wbg_finalize_init(instance, module) {
843
+ wasmInstance = instance;
844
+ wasm = instance.exports;
845
+ wasmModule = module;
846
+ cachedDataViewMemory0 = null;
847
+ cachedUint8ArrayMemory0 = null;
848
+ wasm.__wbindgen_start();
849
+ return wasm;
850
+ }
851
+
852
+ async function __wbg_load(module, imports) {
853
+ if (typeof Response === 'function' && module instanceof Response) {
854
+ if (!module.ok) {
855
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
856
+ }
857
+
858
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
859
+ try {
860
+ return await WebAssembly.instantiateStreaming(module, imports);
861
+ } catch (e) {
862
+ const validResponse = expectedResponseType(module.type);
863
+
864
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
865
+ 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);
866
+
867
+ } else { throw e; }
868
+ }
869
+ }
870
+
871
+ const bytes = await module.arrayBuffer();
872
+ return await WebAssembly.instantiate(bytes, imports);
873
+ } else {
874
+ const instance = await WebAssembly.instantiate(module, imports);
875
+
876
+ if (instance instanceof WebAssembly.Instance) {
877
+ return { instance, module };
878
+ } else {
879
+ return instance;
880
+ }
881
+ }
882
+
883
+ function expectedResponseType(type) {
884
+ switch (type) {
885
+ case 'basic': case 'cors': case 'default': return true;
886
+ }
887
+ return false;
888
+ }
889
+ }
890
+
891
+ function initSync(module) {
892
+ if (wasm !== undefined) return wasm;
893
+
894
+
895
+ if (module !== undefined) {
896
+ if (Object.getPrototypeOf(module) === Object.prototype) {
897
+ ({module} = module)
898
+ } else {
899
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
900
+ }
901
+ }
902
+
903
+ const imports = __wbg_get_imports();
904
+ if (!(module instanceof WebAssembly.Module)) {
905
+ module = new WebAssembly.Module(module);
906
+ }
907
+ const instance = new WebAssembly.Instance(module, imports);
908
+ return __wbg_finalize_init(instance, module);
909
+ }
910
+
911
+ let __wbg_init_promise;
912
+ async function __wbg_init(module_or_path) {
913
+ if (wasm !== undefined) return wasm;
914
+ if (__wbg_init_promise === undefined) {
915
+ __wbg_init_promise = __wbg_init_once(module_or_path);
916
+ __wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
917
+ }
918
+ return __wbg_init_promise;
919
+ }
920
+
921
+ async function __wbg_init_once(module_or_path) {
922
+
923
+ if (module_or_path !== undefined) {
924
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
925
+ ({module_or_path} = module_or_path)
926
+ } else {
927
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
928
+ }
929
+ }
930
+
931
+ if (module_or_path === undefined) {
932
+ module_or_path = new URL('rocx_bg.wasm', import.meta.url);
933
+ }
934
+ const imports = __wbg_get_imports();
935
+
936
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
937
+ module_or_path = fetch(module_or_path);
938
+ }
939
+
940
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
941
+
942
+ return __wbg_finalize_init(instance, module);
943
+ }
944
+
945
+ export { initSync, __wbg_init as default };