tabulark 0.0.1 → 0.1.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +215 -110
  3. package/THIRD_PARTY_NOTICES.md +37 -0
  4. package/dist/adapters.d.ts +62 -0
  5. package/dist/arrow.d.ts +3 -0
  6. package/dist/arrow.js +2 -0
  7. package/dist/arrow.js.map +7 -0
  8. package/dist/client.d.ts +76 -0
  9. package/dist/errors.d.ts +19 -0
  10. package/dist/excel.d.ts +3 -0
  11. package/dist/excel.js +2 -0
  12. package/dist/excel.js.map +7 -0
  13. package/dist/experimental.d.ts +13 -0
  14. package/dist/experimental.js +2 -0
  15. package/dist/experimental.js.map +7 -0
  16. package/dist/index.d.ts +10 -0
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +7 -0
  19. package/dist/model.d.ts +389 -0
  20. package/dist/official-adapter-manifest.d.ts +31 -0
  21. package/dist/parquet.d.ts +3 -0
  22. package/dist/parquet.js +2 -0
  23. package/dist/parquet.js.map +7 -0
  24. package/dist/protocol.d.ts +54 -0
  25. package/dist/range-cache.d.ts +28 -0
  26. package/dist/rpc-client.d.ts +18 -0
  27. package/dist/view/accessible-grid.d.ts +36 -0
  28. package/dist/view/canvas-painter.d.ts +91 -0
  29. package/dist/view/canvas-table-view-public.d.ts +58 -0
  30. package/dist/view/canvas-table-view.d.ts +32 -0
  31. package/dist/view/controller.d.ts +34 -0
  32. package/dist/view/layout.d.ts +34 -0
  33. package/dist/view/selection.d.ts +7 -0
  34. package/dist/view/types.d.ts +184 -0
  35. package/dist/wasm/arrow/tabulark_arrow.d.ts +126 -0
  36. package/dist/wasm/arrow/tabulark_arrow.js +771 -0
  37. package/dist/wasm/arrow/tabulark_arrow_bg.wasm +0 -0
  38. package/dist/wasm/arrow/tabulark_arrow_bg.wasm.d.ts +25 -0
  39. package/dist/wasm/delimited/tabulark_delimited.d.ts +131 -0
  40. package/dist/wasm/delimited/tabulark_delimited.js +845 -0
  41. package/dist/wasm/delimited/tabulark_delimited_bg.wasm +0 -0
  42. package/dist/wasm/delimited/tabulark_delimited_bg.wasm.d.ts +26 -0
  43. package/dist/wasm/excel/tabulark_excel.d.ts +121 -0
  44. package/dist/wasm/excel/tabulark_excel.js +766 -0
  45. package/dist/wasm/excel/tabulark_excel_bg.wasm +0 -0
  46. package/dist/wasm/excel/tabulark_excel_bg.wasm.d.ts +25 -0
  47. package/dist/wasm/parquet/tabulark_parquet.d.ts +121 -0
  48. package/dist/wasm/parquet/tabulark_parquet.js +754 -0
  49. package/dist/wasm/parquet/tabulark_parquet_bg.wasm +0 -0
  50. package/dist/wasm/parquet/tabulark_parquet_bg.wasm.d.ts +25 -0
  51. package/dist/worker/wasm-adapter.d.ts +57 -0
  52. package/dist/worker/worker-errors.d.ts +9 -0
  53. package/dist/worker.d.ts +1 -0
  54. package/dist/worker.js +2 -0
  55. package/dist/worker.js.map +7 -0
  56. package/package.json +55 -12
  57. package/js/index.d.ts +0 -18
  58. package/js/index.js +0 -26
@@ -0,0 +1,845 @@
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
+ function dropObject(idx) {
103
+ if (idx < 132) return;
104
+ heap[idx] = heap_next;
105
+ heap_next = idx;
106
+ }
107
+
108
+ function takeObject(idx) {
109
+ const ret = getObject(idx);
110
+ dropObject(idx);
111
+ return ret;
112
+ }
113
+
114
+ function isLikeNone(x) {
115
+ return x === undefined || x === null;
116
+ }
117
+
118
+ function debugString(val) {
119
+ // primitive types
120
+ const type = typeof val;
121
+ if (type == 'number' || type == 'boolean' || val == null) {
122
+ return `${val}`;
123
+ }
124
+ if (type == 'string') {
125
+ return `"${val}"`;
126
+ }
127
+ if (type == 'symbol') {
128
+ const description = val.description;
129
+ if (description == null) {
130
+ return 'Symbol';
131
+ } else {
132
+ return `Symbol(${description})`;
133
+ }
134
+ }
135
+ if (type == 'function') {
136
+ const name = val.name;
137
+ if (typeof name == 'string' && name.length > 0) {
138
+ return `Function(${name})`;
139
+ } else {
140
+ return 'Function';
141
+ }
142
+ }
143
+ // objects
144
+ if (Array.isArray(val)) {
145
+ const length = val.length;
146
+ let debug = '[';
147
+ if (length > 0) {
148
+ debug += debugString(val[0]);
149
+ }
150
+ for(let i = 1; i < length; i++) {
151
+ debug += ', ' + debugString(val[i]);
152
+ }
153
+ debug += ']';
154
+ return debug;
155
+ }
156
+ // Test for built-in
157
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
158
+ let className;
159
+ if (builtInMatches && builtInMatches.length > 1) {
160
+ className = builtInMatches[1];
161
+ } else {
162
+ // Failed to match the standard '[object ClassName]'
163
+ return toString.call(val);
164
+ }
165
+ if (className == 'Object') {
166
+ // we're a user defined class or Object
167
+ // JSON.stringify avoids problems with cycles, and is generally much
168
+ // easier than looping through ownProperties of `val`.
169
+ try {
170
+ return 'Object(' + JSON.stringify(val) + ')';
171
+ } catch (_) {
172
+ return 'Object';
173
+ }
174
+ }
175
+ // errors
176
+ if (val instanceof Error) {
177
+ return `${val.name}: ${val.message}\n${val.stack}`;
178
+ }
179
+ // TODO we could test for more things here, like `Set`s and `Map`s.
180
+ return className;
181
+ }
182
+
183
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
184
+
185
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
186
+
187
+ function getStringFromWasm0(ptr, len) {
188
+ ptr = ptr >>> 0;
189
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
190
+ }
191
+ /**
192
+ * Creates the core delimited runtime from the dedicated artifact.
193
+ *
194
+ * Referencing the exported core type from this small factory keeps the
195
+ * existing `WasmRuntime` ABI intact without compiling a second forwarding
196
+ * class into the wrapper.
197
+ * @param {any} config
198
+ * @returns {WasmRuntime}
199
+ */
200
+ export function createRuntime(config) {
201
+ try {
202
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
203
+ wasm.createRuntime(retptr, addHeapObject(config));
204
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
205
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
206
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
207
+ if (r2) {
208
+ throw takeObject(r1);
209
+ }
210
+ return WasmRuntime.__wrap(r0);
211
+ } finally {
212
+ wasm.__wbindgen_add_to_stack_pointer(16);
213
+ }
214
+ }
215
+
216
+ const WasmRuntimeFinalization = (typeof FinalizationRegistry === 'undefined')
217
+ ? { register: () => {}, unregister: () => {} }
218
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmruntime_free(ptr >>> 0, 1));
219
+ /**
220
+ * Delimited adapter runtime implementing the same ABI as the Arrow artifact.
221
+ */
222
+ export class WasmRuntime {
223
+
224
+ static __wrap(ptr) {
225
+ ptr = ptr >>> 0;
226
+ const obj = Object.create(WasmRuntime.prototype);
227
+ obj.__wbg_ptr = ptr;
228
+ WasmRuntimeFinalization.register(obj, obj.__wbg_ptr, obj);
229
+ return obj;
230
+ }
231
+
232
+ __destroy_into_raw() {
233
+ const ptr = this.__wbg_ptr;
234
+ this.__wbg_ptr = 0;
235
+ WasmRuntimeFinalization.unregister(this);
236
+ return ptr;
237
+ }
238
+
239
+ free() {
240
+ const ptr = this.__destroy_into_raw();
241
+ wasm.__wbg_wasmruntime_free(ptr, 0);
242
+ }
243
+ /**
244
+ * Returns the frozen official adapter ID.
245
+ * @returns {string}
246
+ */
247
+ adapterId() {
248
+ let deferred1_0;
249
+ let deferred1_1;
250
+ try {
251
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
252
+ wasm.wasmruntime_adapterId(retptr, this.__wbg_ptr);
253
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
254
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
255
+ deferred1_0 = r0;
256
+ deferred1_1 = r1;
257
+ return getStringFromWasm0(r0, r1);
258
+ } finally {
259
+ wasm.__wbindgen_add_to_stack_pointer(16);
260
+ wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
261
+ }
262
+ }
263
+ /**
264
+ * Starts a progressive scan using bounded sequential byte actions.
265
+ * @param {any} options
266
+ * @param {number} source_length
267
+ * @returns {any}
268
+ */
269
+ beginOpen(options, source_length) {
270
+ try {
271
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
272
+ wasm.wasmruntime_beginOpen(retptr, this.__wbg_ptr, addHeapObject(options), source_length);
273
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
274
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
275
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
276
+ if (r2) {
277
+ throw takeObject(r1);
278
+ }
279
+ return takeObject(r0);
280
+ } finally {
281
+ wasm.__wbindgen_add_to_stack_pointer(16);
282
+ }
283
+ }
284
+ /**
285
+ * Starts a checkpoint-backed range read using the common operation ABI.
286
+ * @param {number} table_handle
287
+ * @param {any} request
288
+ * @returns {any}
289
+ */
290
+ beginRead(table_handle, request) {
291
+ try {
292
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
293
+ wasm.wasmruntime_beginRead(retptr, this.__wbg_ptr, table_handle, addHeapObject(request));
294
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
295
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
296
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
297
+ if (r2) {
298
+ throw takeObject(r1);
299
+ }
300
+ return takeObject(r0);
301
+ } finally {
302
+ wasm.__wbindgen_add_to_stack_pointer(16);
303
+ }
304
+ }
305
+ /**
306
+ * Opens the source's single logical table.
307
+ * @param {number} source_handle
308
+ * @param {string} table_id
309
+ * @returns {any}
310
+ */
311
+ openTable(source_handle, table_id) {
312
+ try {
313
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
314
+ const ptr0 = passStringToWasm0(table_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
315
+ const len0 = WASM_VECTOR_LEN;
316
+ wasm.wasmruntime_openTable(retptr, this.__wbg_ptr, source_handle, ptr0, len0);
317
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
318
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
319
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
320
+ if (r2) {
321
+ throw takeObject(r1);
322
+ }
323
+ return takeObject(r0);
324
+ } finally {
325
+ wasm.__wbindgen_add_to_stack_pointer(16);
326
+ }
327
+ }
328
+ /**
329
+ * Idempotently closes one table and its in-flight reads.
330
+ * @param {number} table_handle
331
+ * @returns {boolean}
332
+ */
333
+ closeTable(table_handle) {
334
+ const ret = wasm.wasmruntime_closeTable(this.__wbg_ptr, table_handle);
335
+ return ret !== 0;
336
+ }
337
+ /**
338
+ * Idempotently closes one source, all child tables, and all operations.
339
+ * @param {number} source_handle
340
+ * @returns {boolean}
341
+ */
342
+ closeSource(source_handle) {
343
+ const ret = wasm.wasmruntime_closeSource(this.__wbg_ptr, source_handle);
344
+ return ret !== 0;
345
+ }
346
+ /**
347
+ * Returns no static presentation for delimited text tables.
348
+ * @param {number} table_handle
349
+ * @returns {any}
350
+ */
351
+ presentation(table_handle) {
352
+ try {
353
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
354
+ wasm.wasmruntime_presentation(retptr, this.__wbg_ptr, table_handle);
355
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
356
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
357
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
358
+ if (r2) {
359
+ throw takeObject(r1);
360
+ }
361
+ return takeObject(r0);
362
+ } finally {
363
+ wasm.__wbindgen_add_to_stack_pointer(16);
364
+ }
365
+ }
366
+ /**
367
+ * Cancels and releases a pending open or read operation.
368
+ * @param {number} operation_handle
369
+ * @returns {boolean}
370
+ */
371
+ cancelOperation(operation_handle) {
372
+ const ret = wasm.wasmruntime_cancelOperation(this.__wbg_ptr, operation_handle);
373
+ return ret !== 0;
374
+ }
375
+ /**
376
+ * Returns the Worker protocol version implemented by this build.
377
+ * @returns {number}
378
+ */
379
+ protocolVersion() {
380
+ const ret = wasm.wasmruntime_protocolVersion(this.__wbg_ptr);
381
+ return ret >>> 0;
382
+ }
383
+ /**
384
+ * Supplies exactly one requested source chunk and advances an open or
385
+ * range-read operation.
386
+ * @param {number} operation_handle
387
+ * @param {number} absolute_offset
388
+ * @param {Uint8Array} bytes
389
+ * @param {boolean} eof
390
+ * @returns {any}
391
+ */
392
+ continueOperation(operation_handle, absolute_offset, bytes, eof) {
393
+ try {
394
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
395
+ wasm.wasmruntime_continueOperation(retptr, this.__wbg_ptr, operation_handle, absolute_offset, addHeapObject(bytes), eof);
396
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
397
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
398
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
399
+ if (r2) {
400
+ throw takeObject(r1);
401
+ }
402
+ return takeObject(r0);
403
+ } finally {
404
+ wasm.__wbindgen_add_to_stack_pointer(16);
405
+ }
406
+ }
407
+ /**
408
+ * Returns official adapter ABI version two.
409
+ * @returns {number}
410
+ */
411
+ adapterApiVersion() {
412
+ const ret = wasm.wasmruntime_adapterApiVersion(this.__wbg_ptr);
413
+ return ret >>> 0;
414
+ }
415
+ /**
416
+ * Returns common typed-buffer layout version one.
417
+ * @returns {number}
418
+ */
419
+ batchLayoutVersion() {
420
+ const ret = wasm.wasmruntime_batchLayoutVersion(this.__wbg_ptr);
421
+ return ret >>> 0;
422
+ }
423
+ /**
424
+ * Returns no range presentation for delimited text tables.
425
+ * @param {number} table_handle
426
+ * @param {any} request
427
+ * @returns {any}
428
+ */
429
+ readPresentationRange(table_handle, request) {
430
+ try {
431
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
432
+ wasm.wasmruntime_readPresentationRange(retptr, this.__wbg_ptr, table_handle, addHeapObject(request));
433
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
434
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
435
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
436
+ if (r2) {
437
+ throw takeObject(r1);
438
+ }
439
+ return takeObject(r0);
440
+ } finally {
441
+ wasm.__wbindgen_add_to_stack_pointer(16);
442
+ }
443
+ }
444
+ /**
445
+ * Creates a runtime from a camel-case [`RuntimeConfig`] object.
446
+ * @param {any} config
447
+ */
448
+ constructor(config) {
449
+ try {
450
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
451
+ wasm.wasmruntime_new(retptr, addHeapObject(config));
452
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
453
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
454
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
455
+ if (r2) {
456
+ throw takeObject(r1);
457
+ }
458
+ this.__wbg_ptr = r0 >>> 0;
459
+ WasmRuntimeFinalization.register(this, this.__wbg_ptr, this);
460
+ return this;
461
+ } finally {
462
+ wasm.__wbindgen_add_to_stack_pointer(16);
463
+ }
464
+ }
465
+ /**
466
+ * Returns exact metadata for an opened table.
467
+ * @param {number} table_handle
468
+ * @returns {any}
469
+ */
470
+ metadata(table_handle) {
471
+ try {
472
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
473
+ wasm.wasmruntime_metadata(retptr, this.__wbg_ptr, table_handle);
474
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
475
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
476
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
477
+ if (r2) {
478
+ throw takeObject(r1);
479
+ }
480
+ return takeObject(r0);
481
+ } finally {
482
+ wasm.__wbindgen_add_to_stack_pointer(16);
483
+ }
484
+ }
485
+ /**
486
+ * Releases every operation, table, and source handle.
487
+ */
488
+ shutdown() {
489
+ wasm.wasmruntime_shutdown(this.__wbg_ptr);
490
+ }
491
+ }
492
+
493
+ async function __wbg_load(module, imports) {
494
+ if (typeof Response === 'function' && module instanceof Response) {
495
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
496
+ try {
497
+ return await WebAssembly.instantiateStreaming(module, imports);
498
+
499
+ } catch (e) {
500
+ if (module.headers.get('Content-Type') != 'application/wasm') {
501
+ 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);
502
+
503
+ } else {
504
+ throw e;
505
+ }
506
+ }
507
+ }
508
+
509
+ const bytes = await module.arrayBuffer();
510
+ return await WebAssembly.instantiate(bytes, imports);
511
+
512
+ } else {
513
+ const instance = await WebAssembly.instantiate(module, imports);
514
+
515
+ if (instance instanceof WebAssembly.Instance) {
516
+ return { instance, module };
517
+
518
+ } else {
519
+ return instance;
520
+ }
521
+ }
522
+ }
523
+
524
+ function __wbg_get_imports() {
525
+ const imports = {};
526
+ imports.wbg = {};
527
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
528
+ const ret = String(getObject(arg1));
529
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
530
+ const len1 = WASM_VECTOR_LEN;
531
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
532
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
533
+ };
534
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
535
+ const ret = getObject(arg0).buffer;
536
+ return addHeapObject(ret);
537
+ };
538
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
539
+ const ret = getObject(arg0).call(getObject(arg1));
540
+ return addHeapObject(ret);
541
+ }, arguments) };
542
+ imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
543
+ const ret = getObject(arg0).done;
544
+ return ret;
545
+ };
546
+ imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
547
+ const ret = Object.entries(getObject(arg0));
548
+ return addHeapObject(ret);
549
+ };
550
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
551
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
552
+ return addHeapObject(ret);
553
+ }, arguments) };
554
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
555
+ const ret = getObject(arg0)[arg1 >>> 0];
556
+ return addHeapObject(ret);
557
+ };
558
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
559
+ const ret = getObject(arg0)[getObject(arg1)];
560
+ return addHeapObject(ret);
561
+ };
562
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
563
+ let result;
564
+ try {
565
+ result = getObject(arg0) instanceof ArrayBuffer;
566
+ } catch (_) {
567
+ result = false;
568
+ }
569
+ const ret = result;
570
+ return ret;
571
+ };
572
+ imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
573
+ let result;
574
+ try {
575
+ result = getObject(arg0) instanceof Map;
576
+ } catch (_) {
577
+ result = false;
578
+ }
579
+ const ret = result;
580
+ return ret;
581
+ };
582
+ imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
583
+ let result;
584
+ try {
585
+ result = getObject(arg0) instanceof Uint8Array;
586
+ } catch (_) {
587
+ result = false;
588
+ }
589
+ const ret = result;
590
+ return ret;
591
+ };
592
+ imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
593
+ const ret = Array.isArray(getObject(arg0));
594
+ return ret;
595
+ };
596
+ imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
597
+ const ret = Number.isSafeInteger(getObject(arg0));
598
+ return ret;
599
+ };
600
+ imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
601
+ const ret = Symbol.iterator;
602
+ return addHeapObject(ret);
603
+ };
604
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
605
+ const ret = getObject(arg0).length;
606
+ return ret;
607
+ };
608
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
609
+ const ret = getObject(arg0).length;
610
+ return ret;
611
+ };
612
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
613
+ const ret = new Object();
614
+ return addHeapObject(ret);
615
+ };
616
+ imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
617
+ const ret = new Map();
618
+ return addHeapObject(ret);
619
+ };
620
+ imports.wbg.__wbg_new_78feb108b6472713 = function() {
621
+ const ret = new Array();
622
+ return addHeapObject(ret);
623
+ };
624
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
625
+ const ret = new Uint8Array(getObject(arg0));
626
+ return addHeapObject(ret);
627
+ };
628
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
629
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
630
+ return addHeapObject(ret);
631
+ };
632
+ imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
633
+ const ret = getObject(arg0).next;
634
+ return addHeapObject(ret);
635
+ };
636
+ imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
637
+ const ret = getObject(arg0).next();
638
+ return addHeapObject(ret);
639
+ }, arguments) };
640
+ imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
641
+ const ret = getObject(arg0).push(getObject(arg1));
642
+ return ret;
643
+ };
644
+ imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
645
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
646
+ };
647
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
648
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
649
+ };
650
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
651
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
652
+ };
653
+ imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
654
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
655
+ return addHeapObject(ret);
656
+ };
657
+ imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
658
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
659
+ return ret;
660
+ }, arguments) };
661
+ imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
662
+ const ret = getObject(arg0).value;
663
+ return addHeapObject(ret);
664
+ };
665
+ imports.wbg.__wbindgen_as_number = function(arg0) {
666
+ const ret = +getObject(arg0);
667
+ return ret;
668
+ };
669
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
670
+ const ret = arg0;
671
+ return addHeapObject(ret);
672
+ };
673
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
674
+ const ret = BigInt.asUintN(64, arg0);
675
+ return addHeapObject(ret);
676
+ };
677
+ imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
678
+ const v = getObject(arg1);
679
+ const ret = typeof(v) === 'bigint' ? v : undefined;
680
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
681
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
682
+ };
683
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
684
+ const v = getObject(arg0);
685
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
686
+ return ret;
687
+ };
688
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
689
+ const ret = debugString(getObject(arg1));
690
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
691
+ const len1 = WASM_VECTOR_LEN;
692
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
693
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
694
+ };
695
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
696
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
697
+ return addHeapObject(ret);
698
+ };
699
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
700
+ const ret = getObject(arg0) in getObject(arg1);
701
+ return ret;
702
+ };
703
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
704
+ const ret = typeof(getObject(arg0)) === 'bigint';
705
+ return ret;
706
+ };
707
+ imports.wbg.__wbindgen_is_function = function(arg0) {
708
+ const ret = typeof(getObject(arg0)) === 'function';
709
+ return ret;
710
+ };
711
+ imports.wbg.__wbindgen_is_null = function(arg0) {
712
+ const ret = getObject(arg0) === null;
713
+ return ret;
714
+ };
715
+ imports.wbg.__wbindgen_is_object = function(arg0) {
716
+ const val = getObject(arg0);
717
+ const ret = typeof(val) === 'object' && val !== null;
718
+ return ret;
719
+ };
720
+ imports.wbg.__wbindgen_is_string = function(arg0) {
721
+ const ret = typeof(getObject(arg0)) === 'string';
722
+ return ret;
723
+ };
724
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
725
+ const ret = getObject(arg0) === undefined;
726
+ return ret;
727
+ };
728
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
729
+ const ret = getObject(arg0) === getObject(arg1);
730
+ return ret;
731
+ };
732
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
733
+ const ret = getObject(arg0) == getObject(arg1);
734
+ return ret;
735
+ };
736
+ imports.wbg.__wbindgen_memory = function() {
737
+ const ret = wasm.memory;
738
+ return addHeapObject(ret);
739
+ };
740
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
741
+ const obj = getObject(arg1);
742
+ const ret = typeof(obj) === 'number' ? obj : undefined;
743
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
744
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
745
+ };
746
+ imports.wbg.__wbindgen_number_new = function(arg0) {
747
+ const ret = arg0;
748
+ return addHeapObject(ret);
749
+ };
750
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
751
+ const ret = getObject(arg0);
752
+ return addHeapObject(ret);
753
+ };
754
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
755
+ takeObject(arg0);
756
+ };
757
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
758
+ const obj = getObject(arg1);
759
+ const ret = typeof(obj) === 'string' ? obj : undefined;
760
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
761
+ var len1 = WASM_VECTOR_LEN;
762
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
763
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
764
+ };
765
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
766
+ const ret = getStringFromWasm0(arg0, arg1);
767
+ return addHeapObject(ret);
768
+ };
769
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
770
+ throw new Error(getStringFromWasm0(arg0, arg1));
771
+ };
772
+
773
+ return imports;
774
+ }
775
+
776
+ function __wbg_init_memory(imports, memory) {
777
+
778
+ }
779
+
780
+ function __wbg_finalize_init(instance, module) {
781
+ wasm = instance.exports;
782
+ __wbg_init.__wbindgen_wasm_module = module;
783
+ cachedDataViewMemory0 = null;
784
+ cachedUint8ArrayMemory0 = null;
785
+
786
+
787
+
788
+ return wasm;
789
+ }
790
+
791
+ function initSync(module) {
792
+ if (wasm !== undefined) return wasm;
793
+
794
+
795
+ if (typeof module !== 'undefined') {
796
+ if (Object.getPrototypeOf(module) === Object.prototype) {
797
+ ({module} = module)
798
+ } else {
799
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
800
+ }
801
+ }
802
+
803
+ const imports = __wbg_get_imports();
804
+
805
+ __wbg_init_memory(imports);
806
+
807
+ if (!(module instanceof WebAssembly.Module)) {
808
+ module = new WebAssembly.Module(module);
809
+ }
810
+
811
+ const instance = new WebAssembly.Instance(module, imports);
812
+
813
+ return __wbg_finalize_init(instance, module);
814
+ }
815
+
816
+ async function __wbg_init(module_or_path) {
817
+ if (wasm !== undefined) return wasm;
818
+
819
+
820
+ if (typeof module_or_path !== 'undefined') {
821
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
822
+ ({module_or_path} = module_or_path)
823
+ } else {
824
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
825
+ }
826
+ }
827
+
828
+ if (typeof module_or_path === 'undefined') {
829
+ module_or_path = new URL('tabulark_delimited_bg.wasm', import.meta.url);
830
+ }
831
+ const imports = __wbg_get_imports();
832
+
833
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
834
+ module_or_path = fetch(module_or_path);
835
+ }
836
+
837
+ __wbg_init_memory(imports);
838
+
839
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
840
+
841
+ return __wbg_finalize_init(instance, module);
842
+ }
843
+
844
+ export { initSync };
845
+ export default __wbg_init;