@kreuzberg/wasm 4.0.0-rc.6 → 4.0.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 (56) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +321 -800
  3. package/dist/adapters/wasm-adapter.d.ts +7 -10
  4. package/dist/adapters/wasm-adapter.d.ts.map +1 -0
  5. package/dist/adapters/wasm-adapter.js +53 -54
  6. package/dist/adapters/wasm-adapter.js.map +1 -1
  7. package/dist/index.d.ts +23 -67
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +1102 -104
  10. package/dist/index.js.map +1 -1
  11. package/dist/ocr/registry.d.ts +7 -10
  12. package/dist/ocr/registry.d.ts.map +1 -0
  13. package/dist/ocr/registry.js +9 -28
  14. package/dist/ocr/registry.js.map +1 -1
  15. package/dist/ocr/tesseract-wasm-backend.d.ts +3 -6
  16. package/dist/ocr/tesseract-wasm-backend.d.ts.map +1 -0
  17. package/dist/ocr/tesseract-wasm-backend.js +8 -83
  18. package/dist/ocr/tesseract-wasm-backend.js.map +1 -1
  19. package/dist/pdfium.js +77 -0
  20. package/dist/pkg/LICENSE +7 -0
  21. package/dist/pkg/README.md +503 -0
  22. package/dist/{kreuzberg_wasm.d.ts → pkg/kreuzberg_wasm.d.ts} +24 -12
  23. package/dist/{kreuzberg_wasm.js → pkg/kreuzberg_wasm.js} +224 -233
  24. package/dist/pkg/kreuzberg_wasm_bg.js +1871 -0
  25. package/dist/{kreuzberg_wasm_bg.wasm → pkg/kreuzberg_wasm_bg.wasm} +0 -0
  26. package/dist/{kreuzberg_wasm_bg.wasm.d.ts → pkg/kreuzberg_wasm_bg.wasm.d.ts} +10 -13
  27. package/dist/pkg/package.json +27 -0
  28. package/dist/plugin-registry.d.ts +246 -0
  29. package/dist/plugin-registry.d.ts.map +1 -0
  30. package/dist/runtime.d.ts +21 -22
  31. package/dist/runtime.d.ts.map +1 -0
  32. package/dist/runtime.js +21 -41
  33. package/dist/runtime.js.map +1 -1
  34. package/dist/types.d.ts +363 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/package.json +34 -51
  37. package/dist/adapters/wasm-adapter.d.mts +0 -121
  38. package/dist/adapters/wasm-adapter.mjs +0 -221
  39. package/dist/adapters/wasm-adapter.mjs.map +0 -1
  40. package/dist/index.d.mts +0 -466
  41. package/dist/index.mjs +0 -384
  42. package/dist/index.mjs.map +0 -1
  43. package/dist/kreuzberg_wasm.d.mts +0 -758
  44. package/dist/kreuzberg_wasm.mjs +0 -48
  45. package/dist/ocr/registry.d.mts +0 -102
  46. package/dist/ocr/registry.mjs +0 -70
  47. package/dist/ocr/registry.mjs.map +0 -1
  48. package/dist/ocr/tesseract-wasm-backend.d.mts +0 -257
  49. package/dist/ocr/tesseract-wasm-backend.mjs +0 -424
  50. package/dist/ocr/tesseract-wasm-backend.mjs.map +0 -1
  51. package/dist/runtime.d.mts +0 -256
  52. package/dist/runtime.mjs +0 -152
  53. package/dist/runtime.mjs.map +0 -1
  54. package/dist/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js +0 -107
  55. package/dist/types-GJVIvbPy.d.mts +0 -221
  56. package/dist/types-GJVIvbPy.d.ts +0 -221
@@ -2,8 +2,6 @@
2
2
  let imports = {};
3
3
  imports['__wbindgen_placeholder__'] = module.exports;
4
4
 
5
- const { startWorkers } = require(String.raw`./snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js`);
6
-
7
5
  function addToExternrefTable0(obj) {
8
6
  const idx = wasm.__externref_table_alloc();
9
7
  wasm.__wbindgen_externrefs.set(idx, obj);
@@ -84,14 +82,24 @@ function getArrayU8FromWasm0(ptr, len) {
84
82
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
85
83
  }
86
84
 
85
+ function getCachedStringFromWasm0(ptr, len) {
86
+ if (ptr === 0) {
87
+ return getFromExternrefTable0(len);
88
+ } else {
89
+ return getStringFromWasm0(ptr, len);
90
+ }
91
+ }
92
+
87
93
  let cachedDataViewMemory0 = null;
88
94
  function getDataViewMemory0() {
89
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
95
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
90
96
  cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
91
97
  }
92
98
  return cachedDataViewMemory0;
93
99
  }
94
100
 
101
+ function getFromExternrefTable0(idx) { return wasm.__wbindgen_externrefs.get(idx); }
102
+
95
103
  function getStringFromWasm0(ptr, len) {
96
104
  ptr = ptr >>> 0;
97
105
  return decodeText(ptr, len);
@@ -99,7 +107,7 @@ function getStringFromWasm0(ptr, len) {
99
107
 
100
108
  let cachedUint8ArrayMemory0 = null;
101
109
  function getUint8ArrayMemory0() {
102
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
110
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
103
111
  cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
104
112
  }
105
113
  return cachedUint8ArrayMemory0;
@@ -199,16 +207,15 @@ function takeFromExternrefTable0(idx) {
199
207
  return value;
200
208
  }
201
209
 
202
- let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
203
- if (cachedTextDecoder) cachedTextDecoder.decode();
204
-
210
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
211
+ cachedTextDecoder.decode();
205
212
  function decodeText(ptr, len) {
206
- return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
213
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
207
214
  }
208
215
 
209
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
216
+ const cachedTextEncoder = new TextEncoder();
210
217
 
211
- if (cachedTextEncoder) {
218
+ if (!('encodeInto' in cachedTextEncoder)) {
212
219
  cachedTextEncoder.encodeInto = function (arg, view) {
213
220
  const buf = cachedTextEncoder.encode(arg);
214
221
  view.set(buf);
@@ -221,22 +228,18 @@ if (cachedTextEncoder) {
221
228
 
222
229
  let WASM_VECTOR_LEN = 0;
223
230
 
224
- function wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____(arg0, arg1, arg2) {
225
- wasm.wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____(arg0, arg1, arg2);
231
+ function wasm_bindgen_4fcc1eb3154b8c24___convert__closures_____invoke___wasm_bindgen_4fcc1eb3154b8c24___JsValue_____(arg0, arg1, arg2) {
232
+ wasm.wasm_bindgen_4fcc1eb3154b8c24___convert__closures_____invoke___wasm_bindgen_4fcc1eb3154b8c24___JsValue_____(arg0, arg1, arg2);
226
233
  }
227
234
 
228
- function wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue__wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____(arg0, arg1, arg2, arg3) {
229
- wasm.wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue__wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____(arg0, arg1, arg2, arg3);
235
+ function wasm_bindgen_4fcc1eb3154b8c24___convert__closures_____invoke___wasm_bindgen_4fcc1eb3154b8c24___JsValue__wasm_bindgen_4fcc1eb3154b8c24___JsValue_____(arg0, arg1, arg2, arg3) {
236
+ wasm.wasm_bindgen_4fcc1eb3154b8c24___convert__closures_____invoke___wasm_bindgen_4fcc1eb3154b8c24___JsValue__wasm_bindgen_4fcc1eb3154b8c24___JsValue_____(arg0, arg1, arg2, arg3);
230
237
  }
231
238
 
232
239
  const ModuleInfoFinalization = (typeof FinalizationRegistry === 'undefined')
233
240
  ? { register: () => {}, unregister: () => {} }
234
241
  : new FinalizationRegistry(ptr => wasm.__wbg_moduleinfo_free(ptr >>> 0, 1));
235
242
 
236
- const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
237
- ? { register: () => {}, unregister: () => {} }
238
- : new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr >>> 0, 1));
239
-
240
243
  /**
241
244
  * Get information about the WASM module
242
245
  */
@@ -263,32 +266,20 @@ class ModuleInfo {
263
266
  * @returns {string}
264
267
  */
265
268
  name() {
266
- let deferred1_0;
267
- let deferred1_1;
268
- try {
269
- const ret = wasm.moduleinfo_name(this.__wbg_ptr);
270
- deferred1_0 = ret[0];
271
- deferred1_1 = ret[1];
272
- return getStringFromWasm0(ret[0], ret[1]);
273
- } finally {
274
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
275
- }
269
+ const ret = wasm.moduleinfo_name(this.__wbg_ptr);
270
+ var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
271
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
272
+ return v1;
276
273
  }
277
274
  /**
278
275
  * Get the module version
279
276
  * @returns {string}
280
277
  */
281
278
  version() {
282
- let deferred1_0;
283
- let deferred1_1;
284
- try {
285
- const ret = wasm.moduleinfo_version(this.__wbg_ptr);
286
- deferred1_0 = ret[0];
287
- deferred1_1 = ret[1];
288
- return getStringFromWasm0(ret[0], ret[1]);
289
- } finally {
290
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
291
- }
279
+ const ret = wasm.moduleinfo_version(this.__wbg_ptr);
280
+ var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
281
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
282
+ return v1;
292
283
  }
293
284
  }
294
285
  if (Symbol.dispose) ModuleInfo.prototype[Symbol.dispose] = ModuleInfo.prototype.free;
@@ -555,22 +546,13 @@ exports.clear_validators = clear_validators;
555
546
  * @returns {string}
556
547
  */
557
548
  function detectMimeFromBytes(data) {
558
- let deferred2_0;
559
- let deferred2_1;
560
- try {
561
- const ret = wasm.detectMimeFromBytes(data);
562
- var ptr1 = ret[0];
563
- var len1 = ret[1];
564
- if (ret[3]) {
565
- ptr1 = 0; len1 = 0;
566
- throw takeFromExternrefTable0(ret[2]);
567
- }
568
- deferred2_0 = ptr1;
569
- deferred2_1 = len1;
570
- return getStringFromWasm0(ptr1, len1);
571
- } finally {
572
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
549
+ const ret = wasm.detectMimeFromBytes(data);
550
+ if (ret[3]) {
551
+ throw takeFromExternrefTable0(ret[2]);
573
552
  }
553
+ var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
554
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
555
+ return v1;
574
556
  }
575
557
  exports.detectMimeFromBytes = detectMimeFromBytes;
576
558
 
@@ -850,17 +832,14 @@ exports.getExtensionsForMime = getExtensionsForMime;
850
832
  * console.log(unknownMime); // null
851
833
  * ```
852
834
  * @param {string} extension
853
- * @returns {string | undefined}
835
+ * @returns {string}
854
836
  */
855
837
  function getMimeFromExtension(extension) {
856
838
  const ptr0 = passStringToWasm0(extension, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
857
839
  const len0 = WASM_VECTOR_LEN;
858
840
  const ret = wasm.getMimeFromExtension(ptr0, len0);
859
- let v2;
860
- if (ret[0] !== 0) {
861
- v2 = getStringFromWasm0(ret[0], ret[1]).slice();
862
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
863
- }
841
+ var v2 = getCachedStringFromWasm0(ret[0], ret[1]);
842
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
864
843
  return v2;
865
844
  }
866
845
  exports.getMimeFromExtension = getMimeFromExtension;
@@ -885,11 +864,11 @@ function init() {
885
864
  exports.init = init;
886
865
 
887
866
  /**
888
- * @param {number} num_threads
867
+ * @param {number} _num_threads
889
868
  * @returns {Promise<any>}
890
869
  */
891
- function initThreadPool(num_threads) {
892
- const ret = wasm.initThreadPool(num_threads);
870
+ function initThreadPool(_num_threads) {
871
+ const ret = wasm.initThreadPool(_num_threads);
893
872
  return ret;
894
873
  }
895
874
  exports.initThreadPool = initThreadPool;
@@ -911,6 +890,23 @@ function init_thread_pool_safe(num_threads) {
911
890
  }
912
891
  exports.init_thread_pool_safe = init_thread_pool_safe;
913
892
 
893
+ /**
894
+ * Establishes a binding between an external Pdfium WASM module and `pdfium-render`'s WASM module.
895
+ * This function should be called from Javascript once the external Pdfium WASM module has been loaded
896
+ * into the browser. It is essential that this function is called _before_ initializing
897
+ * `pdfium-render` from within Rust code. For an example, see:
898
+ * <https://github.com/ajrcarey/pdfium-render/blob/master/examples/index.html>
899
+ * @param {any} pdfium_wasm_module
900
+ * @param {any} local_wasm_module
901
+ * @param {boolean} debug
902
+ * @returns {boolean}
903
+ */
904
+ function initialize_pdfium_render(pdfium_wasm_module, local_wasm_module, debug) {
905
+ const ret = wasm.initialize_pdfium_render(pdfium_wasm_module, local_wasm_module, debug);
906
+ return ret !== 0;
907
+ }
908
+ exports.initialize_pdfium_render = initialize_pdfium_render;
909
+
914
910
  /**
915
911
  * List all registered OCR backend names.
916
912
  *
@@ -1081,21 +1077,31 @@ exports.loadConfigFromString = loadConfigFromString;
1081
1077
  * @returns {string}
1082
1078
  */
1083
1079
  function normalizeMimeType(mime_type) {
1084
- let deferred2_0;
1085
- let deferred2_1;
1086
- try {
1087
- const ptr0 = passStringToWasm0(mime_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1088
- const len0 = WASM_VECTOR_LEN;
1089
- const ret = wasm.normalizeMimeType(ptr0, len0);
1090
- deferred2_0 = ret[0];
1091
- deferred2_1 = ret[1];
1092
- return getStringFromWasm0(ret[0], ret[1]);
1093
- } finally {
1094
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1095
- }
1080
+ const ptr0 = passStringToWasm0(mime_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1081
+ const len0 = WASM_VECTOR_LEN;
1082
+ const ret = wasm.normalizeMimeType(ptr0, len0);
1083
+ var v2 = getCachedStringFromWasm0(ret[0], ret[1]);
1084
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
1085
+ return v2;
1096
1086
  }
1097
1087
  exports.normalizeMimeType = normalizeMimeType;
1098
1088
 
1089
+ /**
1090
+ * A callback function that can be invoked by Pdfium's `FPDF_LoadCustomDocument()` function,
1091
+ * wrapping around `crate::utils::files::read_block_from_callback()` to shuffle data buffers
1092
+ * from our WASM memory heap to Pdfium's WASM memory heap as they are loaded.
1093
+ * @param {number} param
1094
+ * @param {number} position
1095
+ * @param {number} pBuf
1096
+ * @param {number} size
1097
+ * @returns {number}
1098
+ */
1099
+ function read_block_from_callback_wasm(param, position, pBuf, size) {
1100
+ const ret = wasm.read_block_from_callback_wasm(param, position, pBuf, size);
1101
+ return ret;
1102
+ }
1103
+ exports.read_block_from_callback_wasm = read_block_from_callback_wasm;
1104
+
1099
1105
  /**
1100
1106
  * Register a custom OCR backend.
1101
1107
  *
@@ -1304,68 +1310,31 @@ exports.unregister_validator = unregister_validator;
1304
1310
  * @returns {string}
1305
1311
  */
1306
1312
  function version() {
1307
- let deferred1_0;
1308
- let deferred1_1;
1309
- try {
1310
- const ret = wasm.version();
1311
- deferred1_0 = ret[0];
1312
- deferred1_1 = ret[1];
1313
- return getStringFromWasm0(ret[0], ret[1]);
1314
- } finally {
1315
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1316
- }
1313
+ const ret = wasm.version();
1314
+ var v1 = getCachedStringFromWasm0(ret[0], ret[1]);
1315
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
1316
+ return v1;
1317
1317
  }
1318
1318
  exports.version = version;
1319
1319
 
1320
- class wbg_rayon_PoolBuilder {
1321
- static __wrap(ptr) {
1322
- ptr = ptr >>> 0;
1323
- const obj = Object.create(wbg_rayon_PoolBuilder.prototype);
1324
- obj.__wbg_ptr = ptr;
1325
- wbg_rayon_PoolBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
1326
- return obj;
1327
- }
1328
- __destroy_into_raw() {
1329
- const ptr = this.__wbg_ptr;
1330
- this.__wbg_ptr = 0;
1331
- wbg_rayon_PoolBuilderFinalization.unregister(this);
1332
- return ptr;
1333
- }
1334
- free() {
1335
- const ptr = this.__destroy_into_raw();
1336
- wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 0);
1337
- }
1338
- /**
1339
- * @returns {number}
1340
- */
1341
- numThreads() {
1342
- const ret = wasm.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr);
1343
- return ret >>> 0;
1344
- }
1345
- build() {
1346
- wasm.wbg_rayon_poolbuilder_build(this.__wbg_ptr);
1347
- }
1348
- /**
1349
- * @returns {number}
1350
- */
1351
- receiver() {
1352
- const ret = wasm.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr);
1353
- return ret >>> 0;
1354
- }
1355
- }
1356
- if (Symbol.dispose) wbg_rayon_PoolBuilder.prototype[Symbol.dispose] = wbg_rayon_PoolBuilder.prototype.free;
1357
- exports.wbg_rayon_PoolBuilder = wbg_rayon_PoolBuilder;
1358
-
1359
1320
  /**
1360
- * @param {number} receiver
1321
+ * A callback function that can be invoked by Pdfium's `FPDF_SaveAsCopy()` and `FPDF_SaveWithVersion()`
1322
+ * functions, wrapping around `crate::utils::files::write_block_from_callback()` to shuffle data buffers
1323
+ * from Pdfium's WASM memory heap to our WASM memory heap as they are written.
1324
+ * @param {number} param
1325
+ * @param {number} buf
1326
+ * @param {number} size
1327
+ * @returns {number}
1361
1328
  */
1362
- function wbg_rayon_start_worker(receiver) {
1363
- wasm.wbg_rayon_start_worker(receiver);
1329
+ function write_block_from_callback_wasm(param, buf, size) {
1330
+ const ret = wasm.write_block_from_callback_wasm(param, buf, size);
1331
+ return ret;
1364
1332
  }
1365
- exports.wbg_rayon_start_worker = wbg_rayon_start_worker;
1333
+ exports.write_block_from_callback_wasm = write_block_from_callback_wasm;
1366
1334
 
1367
1335
  exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
1368
- const ret = Error(getStringFromWasm0(arg0, arg1));
1336
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1337
+ const ret = Error(v0);
1369
1338
  return ret;
1370
1339
  };
1371
1340
 
@@ -1444,16 +1413,6 @@ exports.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1)
1444
1413
  return ret;
1445
1414
  };
1446
1415
 
1447
- exports.__wbg___wbindgen_memory_a342e963fbcabd68 = function() {
1448
- const ret = wasm.memory;
1449
- return ret;
1450
- };
1451
-
1452
- exports.__wbg___wbindgen_module_967adef62ea6cbf8 = function() {
1453
- const ret = wasmModule;
1454
- return ret;
1455
- };
1456
-
1457
1416
  exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
1458
1417
  const obj = arg1;
1459
1418
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -1461,10 +1420,6 @@ exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
1461
1420
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1462
1421
  };
1463
1422
 
1464
- exports.__wbg___wbindgen_rethrow_78714972834ecdf1 = function(arg0) {
1465
- throw arg0;
1466
- };
1467
-
1468
1423
  exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
1469
1424
  const obj = arg1;
1470
1425
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -1475,7 +1430,8 @@ exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
1475
1430
  };
1476
1431
 
1477
1432
  exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
1478
- throw new Error(getStringFromWasm0(arg0, arg1));
1433
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1434
+ throw new Error(v0);
1479
1435
  };
1480
1436
 
1481
1437
  exports.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
@@ -1483,18 +1439,14 @@ exports.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
1483
1439
  };
1484
1440
 
1485
1441
  exports.__wbg_addEventListener_6a82629b3d430a48 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1486
- arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
1442
+ var v0 = getCachedStringFromWasm0(arg1, arg2);
1443
+ arg0.addEventListener(v0, arg3);
1487
1444
  }, arguments) };
1488
1445
 
1489
- exports.__wbg_async_bba5a2ac54b734df = function(arg0) {
1490
- const ret = arg0.async;
1446
+ exports.__wbg_apply_52e9ae668d017009 = function() { return handleError(function (arg0, arg1, arg2) {
1447
+ const ret = arg0.apply(arg1, arg2);
1491
1448
  return ret;
1492
- };
1493
-
1494
- exports.__wbg_buffer_063cd102cc769a1c = function(arg0) {
1495
- const ret = arg0.buffer;
1496
- return ret;
1497
- };
1449
+ }, arguments) };
1498
1450
 
1499
1451
  exports.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
1500
1452
  const ret = arg0.call(arg1, arg2);
@@ -1516,11 +1468,18 @@ exports.__wbg_construct_8d61a09a064d7a0e = function() { return handleError(funct
1516
1468
  return ret;
1517
1469
  }, arguments) };
1518
1470
 
1519
- exports.__wbg_data_8bf4ae669a78a688 = function(arg0) {
1520
- const ret = arg0.data;
1521
- return ret;
1471
+ exports.__wbg_debug_9d0c87ddda3dc485 = function(arg0) {
1472
+ console.debug(arg0);
1522
1473
  };
1523
1474
 
1475
+ exports.__wbg_decode_47d91d32f8c229af = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1476
+ const ret = arg1.decode(getArrayU8FromWasm0(arg2, arg3));
1477
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1478
+ const len1 = WASM_VECTOR_LEN;
1479
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1480
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1481
+ }, arguments) };
1482
+
1524
1483
  exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
1525
1484
  const ret = arg0.done;
1526
1485
  return ret;
@@ -1531,13 +1490,33 @@ exports.__wbg_entries_83c79938054e065f = function(arg0) {
1531
1490
  return ret;
1532
1491
  };
1533
1492
 
1493
+ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1494
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1495
+ if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1, 1); }
1496
+ console.error(v0);
1497
+ };
1498
+
1499
+ exports.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
1500
+ console.error(arg0);
1501
+ };
1502
+
1534
1503
  exports.__wbg_from_29a8414a7a7cd19d = function(arg0) {
1535
1504
  const ret = Array.from(arg0);
1536
1505
  return ret;
1537
1506
  };
1538
1507
 
1539
- exports.__wbg_getRandomValues_ea728b1d79dae146 = function() { return handleError(function (arg0) {
1540
- globalThis.crypto.getRandomValues(arg0);
1508
+ exports.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
1509
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1510
+ }, arguments) };
1511
+
1512
+ exports.__wbg_getTime_ad1e9878a735af08 = function(arg0) {
1513
+ const ret = arg0.getTime();
1514
+ return ret;
1515
+ };
1516
+
1517
+ exports.__wbg_get_16458e8ef25ea5fa = function() { return handleError(function (arg0, arg1) {
1518
+ const ret = arg0.get(arg1 >>> 0);
1519
+ return ret;
1541
1520
  }, arguments) };
1542
1521
 
1543
1522
  exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
@@ -1550,11 +1529,20 @@ exports.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (a
1550
1529
  return ret;
1551
1530
  }, arguments) };
1552
1531
 
1532
+ exports.__wbg_get_index_4e7b3f629a0ab9cd = function(arg0, arg1) {
1533
+ const ret = arg0[arg1 >>> 0];
1534
+ return ret;
1535
+ };
1536
+
1553
1537
  exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
1554
1538
  const ret = arg0[arg1];
1555
1539
  return ret;
1556
1540
  };
1557
1541
 
1542
+ exports.__wbg_info_ce6bcc489c22f6f0 = function(arg0) {
1543
+ console.info(arg0);
1544
+ };
1545
+
1558
1546
  exports.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1559
1547
  let result;
1560
1548
  try {
@@ -1588,17 +1576,6 @@ exports.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1588
1576
  return ret;
1589
1577
  };
1590
1578
 
1591
- exports.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) {
1592
- let result;
1593
- try {
1594
- result = arg0 instanceof Window;
1595
- } catch (_) {
1596
- result = false;
1597
- }
1598
- const ret = result;
1599
- return ret;
1600
- };
1601
-
1602
1579
  exports.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1603
1580
  const ret = Array.isArray(arg0);
1604
1581
  return ret;
@@ -1619,6 +1596,16 @@ exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1619
1596
  return ret;
1620
1597
  };
1621
1598
 
1599
+ exports.__wbg_length_3a9ca660d3d3391b = function(arg0) {
1600
+ const ret = arg0.length;
1601
+ return ret;
1602
+ };
1603
+
1604
+ exports.__wbg_length_bd124cfd1a9444fe = function(arg0) {
1605
+ const ret = arg0.length;
1606
+ return ret;
1607
+ };
1608
+
1622
1609
  exports.__wbg_length_d45040a40c570362 = function(arg0) {
1623
1610
  const ret = arg0.length;
1624
1611
  return ret;
@@ -1628,6 +1615,11 @@ exports.__wbg_log_1d990106d99dacb7 = function(arg0) {
1628
1615
  console.log(arg0);
1629
1616
  };
1630
1617
 
1618
+ exports.__wbg_new_0_23cedd11d9b40c9d = function() {
1619
+ const ret = new Date();
1620
+ return ret;
1621
+ };
1622
+
1631
1623
  exports.__wbg_new_111dde64cffa8ba1 = function() { return handleError(function () {
1632
1624
  const ret = new FileReader();
1633
1625
  return ret;
@@ -1643,23 +1635,18 @@ exports.__wbg_new_25f239778d6112b9 = function() {
1643
1635
  return ret;
1644
1636
  };
1645
1637
 
1646
- exports.__wbg_new_53cb1e86c1ef5d2a = function() { return handleError(function (arg0, arg1) {
1647
- const ret = new Worker(getStringFromWasm0(arg0, arg1));
1648
- return ret;
1649
- }, arguments) };
1650
-
1651
1638
  exports.__wbg_new_6421f6084cc5bc5a = function(arg0) {
1652
1639
  const ret = new Uint8Array(arg0);
1653
1640
  return ret;
1654
1641
  };
1655
1642
 
1656
- exports.__wbg_new_b546ae120718850e = function() {
1657
- const ret = new Map();
1643
+ exports.__wbg_new_8a6f238a6ece86ea = function() {
1644
+ const ret = new Error();
1658
1645
  return ret;
1659
1646
  };
1660
1647
 
1661
- exports.__wbg_new_de1e660b88fc921f = function(arg0) {
1662
- const ret = new Int32Array(arg0);
1648
+ exports.__wbg_new_b546ae120718850e = function() {
1649
+ const ret = new Map();
1663
1650
  return ret;
1664
1651
  };
1665
1652
 
@@ -1670,7 +1657,7 @@ exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1670
1657
  const a = state0.a;
1671
1658
  state0.a = 0;
1672
1659
  try {
1673
- return wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue__wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____(a, state0.b, arg0, arg1);
1660
+ return wasm_bindgen_4fcc1eb3154b8c24___convert__closures_____invoke___wasm_bindgen_4fcc1eb3154b8c24___JsValue__wasm_bindgen_4fcc1eb3154b8c24___JsValue_____(a, state0.b, arg0, arg1);
1674
1661
  } finally {
1675
1662
  state0.a = a;
1676
1663
  }
@@ -1683,12 +1670,19 @@ exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1683
1670
  };
1684
1671
 
1685
1672
  exports.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
1686
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1673
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1674
+ const ret = new Function(v0);
1687
1675
  return ret;
1688
1676
  };
1689
1677
 
1690
- exports.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
1691
- const ret = new Uint8Array(arg0 >>> 0);
1678
+ exports.__wbg_new_with_label_a21974f868c72f0c = function() { return handleError(function (arg0, arg1) {
1679
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1680
+ const ret = new TextDecoder(v0);
1681
+ return ret;
1682
+ }, arguments) };
1683
+
1684
+ exports.__wbg_new_with_length_12c6de4fac33117a = function(arg0) {
1685
+ const ret = new Array(arg0 >>> 0);
1692
1686
  return ret;
1693
1687
  };
1694
1688
 
@@ -1702,6 +1696,11 @@ exports.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (
1702
1696
  return ret;
1703
1697
  }, arguments) };
1704
1698
 
1699
+ exports.__wbg_of_122077a9318f8376 = function(arg0, arg1, arg2, arg3, arg4) {
1700
+ const ret = Array.of(arg0, arg1, arg2, arg3, arg4);
1701
+ return ret;
1702
+ };
1703
+
1705
1704
  exports.__wbg_of_6505a0eb509da02e = function(arg0) {
1706
1705
  const ret = Array.of(arg0);
1707
1706
  return ret;
@@ -1712,9 +1711,15 @@ exports.__wbg_of_7779827fa663eec8 = function(arg0, arg1, arg2) {
1712
1711
  return ret;
1713
1712
  };
1714
1713
 
1715
- exports.__wbg_postMessage_07504dbe15265d5c = function() { return handleError(function (arg0, arg1) {
1716
- arg0.postMessage(arg1);
1717
- }, arguments) };
1714
+ exports.__wbg_of_b8cd42ebb79fb759 = function(arg0, arg1) {
1715
+ const ret = Array.of(arg0, arg1);
1716
+ return ret;
1717
+ };
1718
+
1719
+ exports.__wbg_of_fdf875aa87d9498c = function(arg0, arg1, arg2, arg3) {
1720
+ const ret = Array.of(arg0, arg1, arg2, arg3);
1721
+ return ret;
1722
+ };
1718
1723
 
1719
1724
  exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1720
1725
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
@@ -1738,6 +1743,11 @@ exports.__wbg_readAsArrayBuffer_0aca937439be3197 = function() { return handleErr
1738
1743
  arg0.readAsArrayBuffer(arg1);
1739
1744
  }, arguments) };
1740
1745
 
1746
+ exports.__wbg_reject_e9f21cdd3c968ce3 = function(arg0) {
1747
+ const ret = Promise.reject(arg0);
1748
+ return ret;
1749
+ };
1750
+
1741
1751
  exports.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
1742
1752
  const ret = Promise.resolve(arg0);
1743
1753
  return ret;
@@ -1756,18 +1766,30 @@ exports.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
1756
1766
  arg0[arg1 >>> 0] = arg2;
1757
1767
  };
1758
1768
 
1769
+ exports.__wbg_set_bc3a432bdcd60886 = function(arg0, arg1, arg2) {
1770
+ arg0.set(arg1, arg2 >>> 0);
1771
+ };
1772
+
1773
+ exports.__wbg_set_c50d03a32da17043 = function() { return handleError(function (arg0, arg1, arg2) {
1774
+ arg0.set(arg1 >>> 0, arg2);
1775
+ }, arguments) };
1776
+
1759
1777
  exports.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
1760
1778
  const ret = arg0.set(arg1, arg2);
1761
1779
  return ret;
1762
1780
  };
1763
1781
 
1764
- exports.__wbg_set_onmessage_deb94985de696ac7 = function(arg0, arg1) {
1765
- arg0.onmessage = arg1;
1782
+ exports.__wbg_slice_27b3dfe21d8ce752 = function(arg0, arg1, arg2) {
1783
+ const ret = arg0.slice(arg1 >>> 0, arg2 >>> 0);
1784
+ return ret;
1766
1785
  };
1767
1786
 
1768
- exports.__wbg_startWorkers_2ca11761e08ff5d5 = function(arg0, arg1, arg2) {
1769
- const ret = startWorkers(arg0, arg1, wbg_rayon_PoolBuilder.__wrap(arg2));
1770
- return ret;
1787
+ exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1788
+ const ret = arg1.stack;
1789
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1790
+ const len1 = WASM_VECTOR_LEN;
1791
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1792
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1771
1793
  };
1772
1794
 
1773
1795
  exports.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
@@ -1813,45 +1835,31 @@ exports.__wbg_type_cb833fc71b5282fb = function(arg0, arg1) {
1813
1835
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1814
1836
  };
1815
1837
 
1816
- exports.__wbg_value_4cd497eeadba94bd = function(arg0) {
1817
- const ret = arg0.value;
1818
- return ret;
1819
- };
1820
-
1821
1838
  exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
1822
1839
  const ret = arg0.value;
1823
1840
  return ret;
1824
1841
  };
1825
1842
 
1826
- exports.__wbg_waitAsync_8afec80ffd213eca = function(arg0, arg1, arg2) {
1827
- const ret = Atomics.waitAsync(arg0, arg1 >>> 0, arg2);
1828
- return ret;
1829
- };
1830
-
1831
- exports.__wbg_waitAsync_c186cb97ffacd552 = function() {
1832
- const ret = Atomics.waitAsync;
1833
- return ret;
1834
- };
1835
-
1836
1843
  exports.__wbg_warn_6e567d0d926ff881 = function(arg0) {
1837
1844
  console.warn(arg0);
1838
1845
  };
1839
1846
 
1840
- exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1841
- // Cast intrinsic for `Ref(String) -> Externref`.
1842
- const ret = getStringFromWasm0(arg0, arg1);
1843
- return ret;
1844
- };
1845
-
1846
1847
  exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1847
1848
  // Cast intrinsic for `U64 -> Externref`.
1848
1849
  const ret = BigInt.asUintN(64, arg0);
1849
1850
  return ret;
1850
1851
  };
1851
1852
 
1852
- exports.__wbindgen_cast_89b0435615caf0ab = function(arg0, arg1) {
1853
- // Cast intrinsic for `Closure(Closure { dtor_idx: 211, function: Function { arguments: [Externref], shim_idx: 212, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1854
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_3a2dd18e2c0b33f8___closure__destroy___dyn_core_f96ffdd67f65b3d8___ops__function__FnMut__wasm_bindgen_3a2dd18e2c0b33f8___JsValue____Output_______, wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____);
1853
+ exports.__wbindgen_cast_7e9c58eeb11b0a6f = function(arg0, arg1) {
1854
+ var v0 = getCachedStringFromWasm0(arg0, arg1);
1855
+ // Cast intrinsic for `Ref(CachedString) -> Externref`.
1856
+ const ret = v0;
1857
+ return ret;
1858
+ };
1859
+
1860
+ exports.__wbindgen_cast_965f3ca5bc091f01 = function(arg0, arg1) {
1861
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1976, function: Function { arguments: [Externref], shim_idx: 1977, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1862
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_4fcc1eb3154b8c24___closure__destroy___dyn_core_67558b4ca73dc0a8___ops__function__FnMut__wasm_bindgen_4fcc1eb3154b8c24___JsValue____Output_______, wasm_bindgen_4fcc1eb3154b8c24___convert__closures_____invoke___wasm_bindgen_4fcc1eb3154b8c24___JsValue_____);
1855
1863
  return ret;
1856
1864
  };
1857
1865
 
@@ -1861,9 +1869,9 @@ exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1861
1869
  return ret;
1862
1870
  };
1863
1871
 
1864
- exports.__wbindgen_cast_af6f9b0439e0a862 = function(arg0, arg1) {
1865
- // Cast intrinsic for `Closure(Closure { dtor_idx: 211, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 212, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1866
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_3a2dd18e2c0b33f8___closure__destroy___dyn_core_f96ffdd67f65b3d8___ops__function__FnMut__wasm_bindgen_3a2dd18e2c0b33f8___JsValue____Output_______, wasm_bindgen_3a2dd18e2c0b33f8___convert__closures_____invoke___wasm_bindgen_3a2dd18e2c0b33f8___JsValue_____);
1872
+ exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1873
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1874
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1867
1875
  return ret;
1868
1876
  };
1869
1877
 
@@ -1883,28 +1891,11 @@ exports.__wbindgen_init_externref_table = function() {
1883
1891
  table.set(offset + 3, false);
1884
1892
  };
1885
1893
 
1886
- exports.__wbindgen_link_203404ece0e9bab9 = function(arg0) {
1887
- const val = `onmessage = function (ev) {
1888
- let [ia, index, value] = ev.data;
1889
- ia = new Int32Array(ia.buffer);
1890
- let result = Atomics.wait(ia, index, value);
1891
- postMessage(result);
1892
- };
1893
- `;
1894
- const ret = typeof URL.createObjectURL === 'undefined' ? "data:application/javascript," + encodeURIComponent(val) : URL.createObjectURL(new Blob([val], { type: "text/javascript" }));
1895
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1896
- const len1 = WASM_VECTOR_LEN;
1897
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1898
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1899
- };
1900
-
1901
1894
  exports.__wbindgen_object_is_undefined = function(arg0) {
1902
1895
  const ret = arg0 === undefined;
1903
1896
  return ret;
1904
1897
  };
1905
1898
 
1906
- exports.memory = new WebAssembly.Memory({initial:98,maximum:32768,shared:true});
1907
-
1908
1899
  const wasmPath = `${__dirname}/kreuzberg_wasm_bg.wasm`;
1909
1900
  const wasmBytes = require('fs').readFileSync(wasmPath);
1910
1901
  const wasmModule = new WebAssembly.Module(wasmBytes);