libchai 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/chai.js CHANGED
@@ -1,4 +1,733 @@
1
- import * as wasm from "./chai_bg.wasm";
2
- export * from "./chai_bg.js";
3
- import { __wbg_set_wasm } from "./chai_bg.js";
4
- __wbg_set_wasm(wasm);
1
+ let wasm;
2
+
3
+ const heap = new Array(128).fill(undefined);
4
+
5
+ heap.push(undefined, null, true, false);
6
+
7
+ function getObject(idx) { return heap[idx]; }
8
+
9
+ let WASM_VECTOR_LEN = 0;
10
+
11
+ let cachedUint8ArrayMemory0 = null;
12
+
13
+ function getUint8ArrayMemory0() {
14
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
16
+ }
17
+ return cachedUint8ArrayMemory0;
18
+ }
19
+
20
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
21
+
22
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
23
+ ? function (arg, view) {
24
+ return cachedTextEncoder.encodeInto(arg, view);
25
+ }
26
+ : function (arg, view) {
27
+ const buf = cachedTextEncoder.encode(arg);
28
+ view.set(buf);
29
+ return {
30
+ read: arg.length,
31
+ written: buf.length
32
+ };
33
+ });
34
+
35
+ function passStringToWasm0(arg, malloc, realloc) {
36
+
37
+ if (realloc === undefined) {
38
+ const buf = cachedTextEncoder.encode(arg);
39
+ const ptr = malloc(buf.length, 1) >>> 0;
40
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
41
+ WASM_VECTOR_LEN = buf.length;
42
+ return ptr;
43
+ }
44
+
45
+ let len = arg.length;
46
+ let ptr = malloc(len, 1) >>> 0;
47
+
48
+ const mem = getUint8ArrayMemory0();
49
+
50
+ let offset = 0;
51
+
52
+ for (; offset < len; offset++) {
53
+ const code = arg.charCodeAt(offset);
54
+ if (code > 0x7F) break;
55
+ mem[ptr + offset] = code;
56
+ }
57
+
58
+ if (offset !== len) {
59
+ if (offset !== 0) {
60
+ arg = arg.slice(offset);
61
+ }
62
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
63
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
64
+ const ret = encodeString(arg, view);
65
+
66
+ offset += ret.written;
67
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
68
+ }
69
+
70
+ WASM_VECTOR_LEN = offset;
71
+ return ptr;
72
+ }
73
+
74
+ let cachedDataViewMemory0 = null;
75
+
76
+ function getDataViewMemory0() {
77
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
78
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
79
+ }
80
+ return cachedDataViewMemory0;
81
+ }
82
+
83
+ let heap_next = heap.length;
84
+
85
+ function addHeapObject(obj) {
86
+ if (heap_next === heap.length) heap.push(heap.length + 1);
87
+ const idx = heap_next;
88
+ heap_next = heap[idx];
89
+
90
+ heap[idx] = obj;
91
+ return idx;
92
+ }
93
+
94
+ function handleError(f, args) {
95
+ try {
96
+ return f.apply(this, args);
97
+ } catch (e) {
98
+ wasm.__wbindgen_export_2(addHeapObject(e));
99
+ }
100
+ }
101
+
102
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
103
+
104
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
105
+
106
+ function getStringFromWasm0(ptr, len) {
107
+ ptr = ptr >>> 0;
108
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
109
+ }
110
+
111
+ function dropObject(idx) {
112
+ if (idx < 132) return;
113
+ heap[idx] = heap_next;
114
+ heap_next = idx;
115
+ }
116
+
117
+ function takeObject(idx) {
118
+ const ret = getObject(idx);
119
+ dropObject(idx);
120
+ return ret;
121
+ }
122
+
123
+ function isLikeNone(x) {
124
+ return x === undefined || x === null;
125
+ }
126
+
127
+ function debugString(val) {
128
+ // primitive types
129
+ const type = typeof val;
130
+ if (type == 'number' || type == 'boolean' || val == null) {
131
+ return `${val}`;
132
+ }
133
+ if (type == 'string') {
134
+ return `"${val}"`;
135
+ }
136
+ if (type == 'symbol') {
137
+ const description = val.description;
138
+ if (description == null) {
139
+ return 'Symbol';
140
+ } else {
141
+ return `Symbol(${description})`;
142
+ }
143
+ }
144
+ if (type == 'function') {
145
+ const name = val.name;
146
+ if (typeof name == 'string' && name.length > 0) {
147
+ return `Function(${name})`;
148
+ } else {
149
+ return 'Function';
150
+ }
151
+ }
152
+ // objects
153
+ if (Array.isArray(val)) {
154
+ const length = val.length;
155
+ let debug = '[';
156
+ if (length > 0) {
157
+ debug += debugString(val[0]);
158
+ }
159
+ for(let i = 1; i < length; i++) {
160
+ debug += ', ' + debugString(val[i]);
161
+ }
162
+ debug += ']';
163
+ return debug;
164
+ }
165
+ // Test for built-in
166
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
167
+ let className;
168
+ if (builtInMatches && builtInMatches.length > 1) {
169
+ className = builtInMatches[1];
170
+ } else {
171
+ // Failed to match the standard '[object ClassName]'
172
+ return toString.call(val);
173
+ }
174
+ if (className == 'Object') {
175
+ // we're a user defined class or Object
176
+ // JSON.stringify avoids problems with cycles, and is generally much
177
+ // easier than looping through ownProperties of `val`.
178
+ try {
179
+ return 'Object(' + JSON.stringify(val) + ')';
180
+ } catch (_) {
181
+ return 'Object';
182
+ }
183
+ }
184
+ // errors
185
+ if (val instanceof Error) {
186
+ return `${val.name}: ${val.message}\n${val.stack}`;
187
+ }
188
+ // TODO we could test for more things here, like `Set`s and `Map`s.
189
+ return className;
190
+ }
191
+ /**
192
+ * 用于在图形界面验证输入的配置是否正确
193
+ * @param {any} js_config
194
+ * @returns {any}
195
+ */
196
+ export function validate(js_config) {
197
+ try {
198
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
199
+ wasm.validate(retptr, addHeapObject(js_config));
200
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
201
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
202
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
203
+ if (r2) {
204
+ throw takeObject(r1);
205
+ }
206
+ return takeObject(r0);
207
+ } finally {
208
+ wasm.__wbindgen_add_to_stack_pointer(16);
209
+ }
210
+ }
211
+
212
+ const WebFinalization = (typeof FinalizationRegistry === 'undefined')
213
+ ? { register: () => {}, unregister: () => {} }
214
+ : new FinalizationRegistry(ptr => wasm.__wbg_web_free(ptr >>> 0, 1));
215
+ /**
216
+ * 通过图形界面来使用 libchai 的入口,实现了界面特征
217
+ */
218
+ export class Web {
219
+
220
+ static __wrap(ptr) {
221
+ ptr = ptr >>> 0;
222
+ const obj = Object.create(Web.prototype);
223
+ obj.__wbg_ptr = ptr;
224
+ WebFinalization.register(obj, obj.__wbg_ptr, obj);
225
+ return obj;
226
+ }
227
+
228
+ __destroy_into_raw() {
229
+ const ptr = this.__wbg_ptr;
230
+ this.__wbg_ptr = 0;
231
+ WebFinalization.unregister(this);
232
+ return ptr;
233
+ }
234
+
235
+ free() {
236
+ const ptr = this.__destroy_into_raw();
237
+ wasm.__wbg_web_free(ptr, 0);
238
+ }
239
+ /**
240
+ * @param {Function} 回调
241
+ * @returns {Web}
242
+ */
243
+ static new(回调) {
244
+ const ret = wasm.web_new(addHeapObject(回调));
245
+ return Web.__wrap(ret);
246
+ }
247
+ /**
248
+ * @param {any} 前端参数
249
+ */
250
+ sync(前端参数) {
251
+ try {
252
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
253
+ wasm.web_sync(retptr, this.__wbg_ptr, addHeapObject(前端参数));
254
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
255
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
256
+ if (r1) {
257
+ throw takeObject(r0);
258
+ }
259
+ } finally {
260
+ wasm.__wbindgen_add_to_stack_pointer(16);
261
+ }
262
+ }
263
+ /**
264
+ * @param {any} 前端目标函数配置
265
+ * @returns {any}
266
+ */
267
+ encode_evaluate(前端目标函数配置) {
268
+ try {
269
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
270
+ wasm.web_encode_evaluate(retptr, this.__wbg_ptr, addHeapObject(前端目标函数配置));
271
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
272
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
273
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
274
+ if (r2) {
275
+ throw takeObject(r1);
276
+ }
277
+ return takeObject(r0);
278
+ } finally {
279
+ wasm.__wbindgen_add_to_stack_pointer(16);
280
+ }
281
+ }
282
+ optimize() {
283
+ try {
284
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
285
+ wasm.web_optimize(retptr, this.__wbg_ptr);
286
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
287
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
288
+ if (r1) {
289
+ throw takeObject(r0);
290
+ }
291
+ } finally {
292
+ wasm.__wbindgen_add_to_stack_pointer(16);
293
+ }
294
+ }
295
+ }
296
+
297
+ async function __wbg_load(module, imports) {
298
+ if (typeof Response === 'function' && module instanceof Response) {
299
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
300
+ try {
301
+ return await WebAssembly.instantiateStreaming(module, imports);
302
+
303
+ } catch (e) {
304
+ if (module.headers.get('Content-Type') != 'application/wasm') {
305
+ 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);
306
+
307
+ } else {
308
+ throw e;
309
+ }
310
+ }
311
+ }
312
+
313
+ const bytes = await module.arrayBuffer();
314
+ return await WebAssembly.instantiate(bytes, imports);
315
+
316
+ } else {
317
+ const instance = await WebAssembly.instantiate(module, imports);
318
+
319
+ if (instance instanceof WebAssembly.Instance) {
320
+ return { instance, module };
321
+
322
+ } else {
323
+ return instance;
324
+ }
325
+ }
326
+ }
327
+
328
+ function __wbg_get_imports() {
329
+ const imports = {};
330
+ imports.wbg = {};
331
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
332
+ const ret = String(getObject(arg1));
333
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
334
+ const len1 = WASM_VECTOR_LEN;
335
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
336
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
337
+ };
338
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
339
+ const ret = getObject(arg0).buffer;
340
+ return addHeapObject(ret);
341
+ };
342
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
343
+ const ret = getObject(arg0).call(getObject(arg1));
344
+ return addHeapObject(ret);
345
+ }, arguments) };
346
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
347
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
348
+ return addHeapObject(ret);
349
+ }, arguments) };
350
+ imports.wbg.__wbg_codePointAt_78181f32881e5b59 = function(arg0, arg1) {
351
+ const ret = getObject(arg0).codePointAt(arg1 >>> 0);
352
+ return addHeapObject(ret);
353
+ };
354
+ imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
355
+ const ret = getObject(arg0).crypto;
356
+ return addHeapObject(ret);
357
+ };
358
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
359
+ const ret = getObject(arg0).done;
360
+ return ret;
361
+ };
362
+ imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
363
+ const ret = Object.entries(getObject(arg0));
364
+ return addHeapObject(ret);
365
+ };
366
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
367
+ let deferred0_0;
368
+ let deferred0_1;
369
+ try {
370
+ deferred0_0 = arg0;
371
+ deferred0_1 = arg1;
372
+ console.error(getStringFromWasm0(arg0, arg1));
373
+ } finally {
374
+ wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
375
+ }
376
+ };
377
+ imports.wbg.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
378
+ const ret = String.fromCodePoint(arg0 >>> 0);
379
+ return addHeapObject(ret);
380
+ }, arguments) };
381
+ imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
382
+ getObject(arg0).getRandomValues(getObject(arg1));
383
+ }, arguments) };
384
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
385
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
386
+ return addHeapObject(ret);
387
+ }, arguments) };
388
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
389
+ const ret = getObject(arg0)[arg1 >>> 0];
390
+ return addHeapObject(ret);
391
+ };
392
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
393
+ const ret = getObject(arg0)[getObject(arg1)];
394
+ return addHeapObject(ret);
395
+ };
396
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
397
+ let result;
398
+ try {
399
+ result = getObject(arg0) instanceof ArrayBuffer;
400
+ } catch (_) {
401
+ result = false;
402
+ }
403
+ const ret = result;
404
+ return ret;
405
+ };
406
+ imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
407
+ let result;
408
+ try {
409
+ result = getObject(arg0) instanceof Map;
410
+ } catch (_) {
411
+ result = false;
412
+ }
413
+ const ret = result;
414
+ return ret;
415
+ };
416
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
417
+ let result;
418
+ try {
419
+ result = getObject(arg0) instanceof Uint8Array;
420
+ } catch (_) {
421
+ result = false;
422
+ }
423
+ const ret = result;
424
+ return ret;
425
+ };
426
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
427
+ const ret = Array.isArray(getObject(arg0));
428
+ return ret;
429
+ };
430
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
431
+ const ret = Number.isSafeInteger(getObject(arg0));
432
+ return ret;
433
+ };
434
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
435
+ const ret = Symbol.iterator;
436
+ return addHeapObject(ret);
437
+ };
438
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
439
+ const ret = getObject(arg0).length;
440
+ return ret;
441
+ };
442
+ imports.wbg.__wbg_length_d56737991078581b = function(arg0) {
443
+ const ret = getObject(arg0).length;
444
+ return ret;
445
+ };
446
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
447
+ const ret = getObject(arg0).length;
448
+ return ret;
449
+ };
450
+ imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
451
+ const ret = getObject(arg0).msCrypto;
452
+ return addHeapObject(ret);
453
+ };
454
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
455
+ const ret = new Object();
456
+ return addHeapObject(ret);
457
+ };
458
+ imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
459
+ const ret = new Map();
460
+ return addHeapObject(ret);
461
+ };
462
+ imports.wbg.__wbg_new_78feb108b6472713 = function() {
463
+ const ret = new Array();
464
+ return addHeapObject(ret);
465
+ };
466
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
467
+ const ret = new Error();
468
+ return addHeapObject(ret);
469
+ };
470
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
471
+ const ret = new Uint8Array(getObject(arg0));
472
+ return addHeapObject(ret);
473
+ };
474
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
475
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
476
+ return addHeapObject(ret);
477
+ };
478
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
479
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
480
+ return addHeapObject(ret);
481
+ };
482
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
483
+ const ret = new Uint8Array(arg0 >>> 0);
484
+ return addHeapObject(ret);
485
+ };
486
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
487
+ const ret = getObject(arg0).next;
488
+ return addHeapObject(ret);
489
+ };
490
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
491
+ const ret = getObject(arg0).next();
492
+ return addHeapObject(ret);
493
+ }, arguments) };
494
+ imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
495
+ const ret = getObject(arg0).node;
496
+ return addHeapObject(ret);
497
+ };
498
+ imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
499
+ const ret = getObject(arg0).process;
500
+ return addHeapObject(ret);
501
+ };
502
+ imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
503
+ getObject(arg0).randomFillSync(takeObject(arg1));
504
+ }, arguments) };
505
+ imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
506
+ const ret = module.require;
507
+ return addHeapObject(ret);
508
+ }, arguments) };
509
+ imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
510
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
511
+ };
512
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
513
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
514
+ };
515
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
516
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
517
+ };
518
+ imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
519
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
520
+ return addHeapObject(ret);
521
+ };
522
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
523
+ const ret = getObject(arg1).stack;
524
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
525
+ const len1 = WASM_VECTOR_LEN;
526
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
527
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
528
+ };
529
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
530
+ const ret = typeof global === 'undefined' ? null : global;
531
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
532
+ };
533
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
534
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
535
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
536
+ };
537
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
538
+ const ret = typeof self === 'undefined' ? null : self;
539
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
540
+ };
541
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
542
+ const ret = typeof window === 'undefined' ? null : window;
543
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
544
+ };
545
+ imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
546
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
547
+ return addHeapObject(ret);
548
+ };
549
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
550
+ const ret = getObject(arg0).value;
551
+ return addHeapObject(ret);
552
+ };
553
+ imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
554
+ const ret = getObject(arg0).versions;
555
+ return addHeapObject(ret);
556
+ };
557
+ imports.wbg.__wbindgen_as_number = function(arg0) {
558
+ const ret = +getObject(arg0);
559
+ return ret;
560
+ };
561
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
562
+ const ret = arg0;
563
+ return addHeapObject(ret);
564
+ };
565
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
566
+ const ret = BigInt.asUintN(64, arg0);
567
+ return addHeapObject(ret);
568
+ };
569
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
570
+ const v = getObject(arg1);
571
+ const ret = typeof(v) === 'bigint' ? v : undefined;
572
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
573
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
574
+ };
575
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
576
+ const v = getObject(arg0);
577
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
578
+ return ret;
579
+ };
580
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
581
+ const ret = debugString(getObject(arg1));
582
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
583
+ const len1 = WASM_VECTOR_LEN;
584
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
585
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
586
+ };
587
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
588
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
589
+ return addHeapObject(ret);
590
+ };
591
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
592
+ const ret = getObject(arg0) in getObject(arg1);
593
+ return ret;
594
+ };
595
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
596
+ const ret = typeof(getObject(arg0)) === 'bigint';
597
+ return ret;
598
+ };
599
+ imports.wbg.__wbindgen_is_function = function(arg0) {
600
+ const ret = typeof(getObject(arg0)) === 'function';
601
+ return ret;
602
+ };
603
+ imports.wbg.__wbindgen_is_object = function(arg0) {
604
+ const val = getObject(arg0);
605
+ const ret = typeof(val) === 'object' && val !== null;
606
+ return ret;
607
+ };
608
+ imports.wbg.__wbindgen_is_string = function(arg0) {
609
+ const ret = typeof(getObject(arg0)) === 'string';
610
+ return ret;
611
+ };
612
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
613
+ const ret = getObject(arg0) === undefined;
614
+ return ret;
615
+ };
616
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
617
+ const ret = getObject(arg0) === getObject(arg1);
618
+ return ret;
619
+ };
620
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
621
+ const ret = getObject(arg0) == getObject(arg1);
622
+ return ret;
623
+ };
624
+ imports.wbg.__wbindgen_memory = function() {
625
+ const ret = wasm.memory;
626
+ return addHeapObject(ret);
627
+ };
628
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
629
+ const obj = getObject(arg1);
630
+ const ret = typeof(obj) === 'number' ? obj : undefined;
631
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
632
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
633
+ };
634
+ imports.wbg.__wbindgen_number_new = function(arg0) {
635
+ const ret = arg0;
636
+ return addHeapObject(ret);
637
+ };
638
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
639
+ const ret = getObject(arg0);
640
+ return addHeapObject(ret);
641
+ };
642
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
643
+ takeObject(arg0);
644
+ };
645
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
646
+ const obj = getObject(arg1);
647
+ const ret = typeof(obj) === 'string' ? obj : undefined;
648
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
649
+ var len1 = WASM_VECTOR_LEN;
650
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
651
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
652
+ };
653
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
654
+ const ret = getStringFromWasm0(arg0, arg1);
655
+ return addHeapObject(ret);
656
+ };
657
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
658
+ throw new Error(getStringFromWasm0(arg0, arg1));
659
+ };
660
+
661
+ return imports;
662
+ }
663
+
664
+ function __wbg_init_memory(imports, memory) {
665
+
666
+ }
667
+
668
+ function __wbg_finalize_init(instance, module) {
669
+ wasm = instance.exports;
670
+ __wbg_init.__wbindgen_wasm_module = module;
671
+ cachedDataViewMemory0 = null;
672
+ cachedUint8ArrayMemory0 = null;
673
+
674
+
675
+
676
+ return wasm;
677
+ }
678
+
679
+ function initSync(module) {
680
+ if (wasm !== undefined) return wasm;
681
+
682
+
683
+ if (typeof module !== 'undefined') {
684
+ if (Object.getPrototypeOf(module) === Object.prototype) {
685
+ ({module} = module)
686
+ } else {
687
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
688
+ }
689
+ }
690
+
691
+ const imports = __wbg_get_imports();
692
+
693
+ __wbg_init_memory(imports);
694
+
695
+ if (!(module instanceof WebAssembly.Module)) {
696
+ module = new WebAssembly.Module(module);
697
+ }
698
+
699
+ const instance = new WebAssembly.Instance(module, imports);
700
+
701
+ return __wbg_finalize_init(instance, module);
702
+ }
703
+
704
+ async function __wbg_init(module_or_path) {
705
+ if (wasm !== undefined) return wasm;
706
+
707
+
708
+ if (typeof module_or_path !== 'undefined') {
709
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
710
+ ({module_or_path} = module_or_path)
711
+ } else {
712
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
713
+ }
714
+ }
715
+
716
+ if (typeof module_or_path === 'undefined') {
717
+ module_or_path = new URL('chai_bg.wasm', import.meta.url);
718
+ }
719
+ const imports = __wbg_get_imports();
720
+
721
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
722
+ module_or_path = fetch(module_or_path);
723
+ }
724
+
725
+ __wbg_init_memory(imports);
726
+
727
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
728
+
729
+ return __wbg_finalize_init(instance, module);
730
+ }
731
+
732
+ export { initSync };
733
+ export default __wbg_init;