@automataframework/art 0.0.0-stage → 0.0.1-preview.12.sha-e1e5dd9

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 (36) hide show
  1. package/LICENSE +674 -0
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bin.js +38 -0
  4. package/dist/features/clean/clean.d.ts +12 -0
  5. package/dist/features/clean/clean.js +75 -0
  6. package/dist/features/make/fal.d.ts +10 -0
  7. package/dist/features/make/fal.js +19 -0
  8. package/dist/features/make/ledger.d.ts +17 -0
  9. package/dist/features/make/ledger.js +29 -0
  10. package/dist/features/make/make.d.ts +20 -0
  11. package/dist/features/make/make.js +97 -0
  12. package/dist/features/make/models.d.ts +11 -0
  13. package/dist/features/make/models.js +7 -0
  14. package/dist/features/palette/duel.d.ts +2 -0
  15. package/dist/features/palette/duel.js +22 -0
  16. package/dist/features/palette/palette.d.ts +8 -0
  17. package/dist/features/palette/palette.js +35 -0
  18. package/dist/features/sidecar/sidecar.d.ts +15 -0
  19. package/dist/features/sidecar/sidecar.js +35 -0
  20. package/dist/index.d.ts +7 -0
  21. package/dist/index.js +9 -0
  22. package/dist/lib/png.d.ts +4 -0
  23. package/dist/lib/png.js +49 -0
  24. package/package.json +38 -3
  25. package/vendor/unfake/LICENSE +21 -0
  26. package/vendor/unfake/SOURCE.md +24 -0
  27. package/vendor/unfake/lib/core-client.js +159 -0
  28. package/vendor/unfake/lib/core-codec.js +35 -0
  29. package/vendor/unfake/lib/cvfree.js +193 -0
  30. package/vendor/unfake/lib/edge-detect.js +127 -0
  31. package/vendor/unfake/lib/pixel.js +541 -0
  32. package/vendor/unfake/lib/utils.js +520 -0
  33. package/vendor/unfake/vendor/unfake-core/unfake_wasm.js +524 -0
  34. package/vendor/unfake/vendor/unfake-core/unfake_wasm_bg.wasm +0 -0
  35. package/vendor/unfake/workers/unfake-core-worker.js +259 -0
  36. package/README.md +0 -3
@@ -0,0 +1,524 @@
1
+ /**
2
+ * Content-adaptive (perceptual) downscale to target dims. Packed image out.
3
+ * @param {Uint8Array} rgba
4
+ * @param {number} width
5
+ * @param {number} height
6
+ * @param {number} target_w
7
+ * @param {number} target_h
8
+ * @returns {Uint8Array}
9
+ */
10
+ export function content_adaptive_packed(rgba, width, height, target_w, target_h) {
11
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
12
+ const len0 = WASM_VECTOR_LEN;
13
+ const ret = wasm.content_adaptive_packed(ptr0, len0, width, height, target_w, target_h);
14
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
15
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
16
+ return v2;
17
+ }
18
+
19
+ /**
20
+ * @param {Uint8Array} rgba
21
+ * @param {number} width
22
+ * @param {number} height
23
+ * @param {number} scale
24
+ * @returns {Uint32Array}
25
+ */
26
+ export function crop_offset(rgba, width, height, scale) {
27
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
28
+ const len0 = WASM_VECTOR_LEN;
29
+ const ret = wasm.crop_offset(ptr0, len0, width, height, scale);
30
+ var v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
31
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
32
+ return v2;
33
+ }
34
+
35
+ /**
36
+ * @param {Uint8Array} rgba
37
+ * @param {number} width
38
+ * @param {number} height
39
+ * @returns {number}
40
+ */
41
+ export function detect_auto(rgba, width, height) {
42
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
43
+ const len0 = WASM_VECTOR_LEN;
44
+ const ret = wasm.detect_auto(ptr0, len0, width, height);
45
+ return ret >>> 0;
46
+ }
47
+
48
+ /**
49
+ * Auto color-count heuristic (returns clamped count).
50
+ * @param {Uint8Array} rgba
51
+ * @param {number} width
52
+ * @param {number} height
53
+ * @param {number} downsample_to
54
+ * @param {number} quantize
55
+ * @param {number} dominance
56
+ * @param {number} max_colors
57
+ * @returns {number}
58
+ */
59
+ export function detect_color_count(rgba, width, height, downsample_to, quantize, dominance, max_colors) {
60
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
61
+ const len0 = WASM_VECTOR_LEN;
62
+ const ret = wasm.detect_color_count(ptr0, len0, width, height, downsample_to, quantize, dominance, max_colors);
63
+ return ret >>> 0;
64
+ }
65
+
66
+ /**
67
+ * Fractional (non-integer) cell grid, or empty when the integer detectors
68
+ * apply. Out: [period_x, period_y, offset_x, offset_y, cells_x, cells_y].
69
+ * @param {Uint8Array} rgba
70
+ * @param {number} width
71
+ * @param {number} height
72
+ * @returns {Float64Array}
73
+ */
74
+ export function detect_grid(rgba, width, height) {
75
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
76
+ const len0 = WASM_VECTOR_LEN;
77
+ const ret = wasm.detect_grid(ptr0, len0, width, height);
78
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
79
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
80
+ return v2;
81
+ }
82
+
83
+ /**
84
+ * @param {Uint8Array} rgba
85
+ * @param {number} width
86
+ * @param {number} height
87
+ * @returns {number}
88
+ */
89
+ export function detect_legacy(rgba, width, height) {
90
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
91
+ const len0 = WASM_VECTOR_LEN;
92
+ const ret = wasm.detect_legacy(ptr0, len0, width, height);
93
+ return ret >>> 0;
94
+ }
95
+
96
+ /**
97
+ * @param {Uint8Array} rgba
98
+ * @param {number} width
99
+ * @param {number} height
100
+ * @returns {number}
101
+ */
102
+ export function detect_runs(rgba, width, height) {
103
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
104
+ const len0 = WASM_VECTOR_LEN;
105
+ const ret = wasm.detect_runs(ptr0, len0, width, height);
106
+ return ret >>> 0;
107
+ }
108
+
109
+ /**
110
+ * @param {Uint8Array} rgba
111
+ * @param {number} width
112
+ * @param {number} height
113
+ * @returns {number}
114
+ */
115
+ export function detect_tiled(rgba, width, height) {
116
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
117
+ const len0 = WASM_VECTOR_LEN;
118
+ const ret = wasm.detect_tiled(ptr0, len0, width, height);
119
+ return ret >>> 0;
120
+ }
121
+
122
+ /**
123
+ * Downscale on explicit cell boundaries (from `elastic_bounds_vec`).
124
+ * method ids as `downscale_rgba_packed`. Packed image out.
125
+ * @param {Uint8Array} rgba
126
+ * @param {number} width
127
+ * @param {number} height
128
+ * @param {Float64Array} bounds_x
129
+ * @param {Float64Array} bounds_y
130
+ * @param {number} method
131
+ * @param {number} dom_threshold
132
+ * @returns {Uint8Array}
133
+ */
134
+ export function downscale_bounds_packed(rgba, width, height, bounds_x, bounds_y, method, dom_threshold) {
135
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
136
+ const len0 = WASM_VECTOR_LEN;
137
+ const ptr1 = passArrayF64ToWasm0(bounds_x, wasm.__wbindgen_malloc);
138
+ const len1 = WASM_VECTOR_LEN;
139
+ const ptr2 = passArrayF64ToWasm0(bounds_y, wasm.__wbindgen_malloc);
140
+ const len2 = WASM_VECTOR_LEN;
141
+ const ret = wasm.downscale_bounds_packed(ptr0, len0, width, height, ptr1, len1, ptr2, len2, method, dom_threshold);
142
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
143
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
144
+ return v4;
145
+ }
146
+
147
+ /**
148
+ * Downscale on a fractional grid (from `detect_grid` / `grid_for_scale_vec`).
149
+ * method ids as `downscale_rgba_packed`. Packed image out.
150
+ * @param {Uint8Array} rgba
151
+ * @param {number} width
152
+ * @param {number} height
153
+ * @param {number} period_x
154
+ * @param {number} period_y
155
+ * @param {number} offset_x
156
+ * @param {number} offset_y
157
+ * @param {number} method
158
+ * @param {number} dom_threshold
159
+ * @returns {Uint8Array}
160
+ */
161
+ export function downscale_grid_packed(rgba, width, height, period_x, period_y, offset_x, offset_y, method, dom_threshold) {
162
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
163
+ const len0 = WASM_VECTOR_LEN;
164
+ const ret = wasm.downscale_grid_packed(ptr0, len0, width, height, period_x, period_y, offset_x, offset_y, method, dom_threshold);
165
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
166
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
167
+ return v2;
168
+ }
169
+
170
+ /**
171
+ * method: 0=nearest 1=median 2=mode 3=dominant 4=qvote 5=mean
172
+ * align_grid: 1 = crop to grid before downscale (CLI); 0 = image already snapped (browser pipeline)
173
+ * @param {Uint8Array} rgba
174
+ * @param {number} width
175
+ * @param {number} height
176
+ * @param {number} scale
177
+ * @param {number} method
178
+ * @param {number} dom_threshold
179
+ * @param {number} align_grid
180
+ * @returns {Uint8Array}
181
+ */
182
+ export function downscale_rgba_packed(rgba, width, height, scale, method, dom_threshold, align_grid) {
183
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
184
+ const len0 = WASM_VECTOR_LEN;
185
+ const ret = wasm.downscale_rgba_packed(ptr0, len0, width, height, scale, method, dom_threshold, align_grid);
186
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
187
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
188
+ return v2;
189
+ }
190
+
191
+ /**
192
+ * Boundaries fitted to hand-drawn cells around a grid (from `detect_grid`, or
193
+ * an integer scale with its crop offset), or empty when the grid already fits.
194
+ * Out: [adapted_x, adapted_y, len_x, x bounds…, y bounds…].
195
+ * @param {Uint8Array} rgba
196
+ * @param {number} width
197
+ * @param {number} height
198
+ * @param {number} period_x
199
+ * @param {number} period_y
200
+ * @param {number} offset_x
201
+ * @param {number} offset_y
202
+ * @returns {Float64Array}
203
+ */
204
+ export function elastic_bounds_vec(rgba, width, height, period_x, period_y, offset_x, offset_y) {
205
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
206
+ const len0 = WASM_VECTOR_LEN;
207
+ const ret = wasm.elastic_bounds_vec(ptr0, len0, width, height, period_x, period_y, offset_x, offset_y);
208
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
209
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
210
+ return v2;
211
+ }
212
+
213
+ /**
214
+ * Encode RGBA8 to PNG bytes.
215
+ * @param {Uint8Array} rgba
216
+ * @param {number} width
217
+ * @param {number} height
218
+ * @returns {Uint8Array}
219
+ */
220
+ export function encode_png_bytes(rgba, width, height) {
221
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
222
+ const len0 = WASM_VECTOR_LEN;
223
+ const ret = wasm.encode_png_bytes(ptr0, len0, width, height);
224
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
225
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
226
+ return v2;
227
+ }
228
+
229
+ /**
230
+ * Grid for a manual (possibly fractional) cell size; layout as `detect_grid`.
231
+ * @param {Uint8Array} rgba
232
+ * @param {number} width
233
+ * @param {number} height
234
+ * @param {number} scale
235
+ * @returns {Float64Array}
236
+ */
237
+ export function grid_for_scale_vec(rgba, width, height, scale) {
238
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
239
+ const len0 = WASM_VECTOR_LEN;
240
+ const ret = wasm.grid_for_scale_vec(ptr0, len0, width, height, scale);
241
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
242
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
243
+ return v2;
244
+ }
245
+
246
+ /**
247
+ * Morphological open+close cleanup. Packed image out.
248
+ * @param {Uint8Array} rgba
249
+ * @param {number} width
250
+ * @param {number} height
251
+ * @returns {Uint8Array}
252
+ */
253
+ export function morph_cleanup_packed(rgba, width, height) {
254
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
255
+ const len0 = WASM_VECTOR_LEN;
256
+ const ret = wasm.morph_cleanup_packed(ptr0, len0, width, height);
257
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
258
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
259
+ return v2;
260
+ }
261
+
262
+ /**
263
+ * Quantize to <=max_colors (imagequant) or remap to a fixed palette.
264
+ * Packed out: u32 w, u32 h, u32 palette_len, palette RGBA bytes, image RGBA bytes.
265
+ * @param {Uint8Array} rgba
266
+ * @param {number} width
267
+ * @param {number} height
268
+ * @param {number} max_colors
269
+ * @param {Uint8Array} fixed
270
+ * @returns {Uint8Array}
271
+ */
272
+ export function quantize_packed(rgba, width, height, max_colors, fixed) {
273
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
274
+ const len0 = WASM_VECTOR_LEN;
275
+ const ptr1 = passArray8ToWasm0(fixed, wasm.__wbindgen_malloc);
276
+ const len1 = WASM_VECTOR_LEN;
277
+ const ret = wasm.quantize_packed(ptr0, len0, width, height, max_colors, ptr1, len1);
278
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
279
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
280
+ return v3;
281
+ }
282
+
283
+ /**
284
+ * Packed: u32 LE width, u32 LE height, RGBA bytes.
285
+ * @param {Uint8Array} rgba
286
+ * @param {number} width
287
+ * @param {number} height
288
+ * @param {number} scale
289
+ * @returns {Uint8Array}
290
+ */
291
+ export function snap_rgba_packed(rgba, width, height, scale) {
292
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
293
+ const len0 = WASM_VECTOR_LEN;
294
+ const ret = wasm.snap_rgba_packed(ptr0, len0, width, height, scale);
295
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
296
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
297
+ return v2;
298
+ }
299
+
300
+ /**
301
+ * Composite over solid background where alpha != 0. Packed image out.
302
+ * @param {Uint8Array} rgba
303
+ * @param {number} width
304
+ * @param {number} height
305
+ * @param {number} r
306
+ * @param {number} g
307
+ * @param {number} b
308
+ * @param {number} a
309
+ * @returns {Uint8Array}
310
+ */
311
+ export function vector_fill_bg_packed(rgba, width, height, r, g, b, a) {
312
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
313
+ const len0 = WASM_VECTOR_LEN;
314
+ const ret = wasm.vector_fill_bg_packed(ptr0, len0, width, height, r, g, b, a);
315
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
316
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
317
+ return v2;
318
+ }
319
+
320
+ /**
321
+ * Vector post-process. filter: 0=none 2=median 3=gaussian. Packed image out.
322
+ * @param {Uint8Array} rgba
323
+ * @param {number} width
324
+ * @param {number} height
325
+ * @param {number} filter
326
+ * @param {number} value
327
+ * @returns {Uint8Array}
328
+ */
329
+ export function vector_postprocess_packed(rgba, width, height, filter, value) {
330
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
331
+ const len0 = WASM_VECTOR_LEN;
332
+ const ret = wasm.vector_postprocess_packed(ptr0, len0, width, height, filter, value);
333
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
334
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
335
+ return v2;
336
+ }
337
+
338
+ /**
339
+ * Vector pre-process. filter: 0=none 1=bilateral 2=median. Packed image out.
340
+ * @param {Uint8Array} rgba
341
+ * @param {number} width
342
+ * @param {number} height
343
+ * @param {number} filter
344
+ * @param {number} value
345
+ * @param {number} morphology
346
+ * @param {number} morph_kernel
347
+ * @returns {Uint8Array}
348
+ */
349
+ export function vector_preprocess_packed(rgba, width, height, filter, value, morphology, morph_kernel) {
350
+ const ptr0 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc);
351
+ const len0 = WASM_VECTOR_LEN;
352
+ const ret = wasm.vector_preprocess_packed(ptr0, len0, width, height, filter, value, morphology, morph_kernel);
353
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
354
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
355
+ return v2;
356
+ }
357
+ function __wbg_get_imports() {
358
+ const import0 = {
359
+ __proto__: null,
360
+ __wbindgen_init_externref_table: function() {
361
+ const table = wasm.__wbindgen_externrefs;
362
+ const offset = table.grow(4);
363
+ table.set(0, undefined);
364
+ table.set(offset + 0, undefined);
365
+ table.set(offset + 1, null);
366
+ table.set(offset + 2, true);
367
+ table.set(offset + 3, false);
368
+ },
369
+ };
370
+ return {
371
+ __proto__: null,
372
+ "./unfake_wasm_bg.js": import0,
373
+ };
374
+ }
375
+
376
+ function getArrayF64FromWasm0(ptr, len) {
377
+ ptr = ptr >>> 0;
378
+ return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
379
+ }
380
+
381
+ function getArrayU32FromWasm0(ptr, len) {
382
+ ptr = ptr >>> 0;
383
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
384
+ }
385
+
386
+ function getArrayU8FromWasm0(ptr, len) {
387
+ ptr = ptr >>> 0;
388
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
389
+ }
390
+
391
+ let cachedFloat64ArrayMemory0 = null;
392
+ function getFloat64ArrayMemory0() {
393
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
394
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
395
+ }
396
+ return cachedFloat64ArrayMemory0;
397
+ }
398
+
399
+ let cachedUint32ArrayMemory0 = null;
400
+ function getUint32ArrayMemory0() {
401
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
402
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
403
+ }
404
+ return cachedUint32ArrayMemory0;
405
+ }
406
+
407
+ let cachedUint8ArrayMemory0 = null;
408
+ function getUint8ArrayMemory0() {
409
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
410
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
411
+ }
412
+ return cachedUint8ArrayMemory0;
413
+ }
414
+
415
+ function passArray8ToWasm0(arg, malloc) {
416
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
417
+ getUint8ArrayMemory0().set(arg, ptr / 1);
418
+ WASM_VECTOR_LEN = arg.length;
419
+ return ptr;
420
+ }
421
+
422
+ function passArrayF64ToWasm0(arg, malloc) {
423
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
424
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
425
+ WASM_VECTOR_LEN = arg.length;
426
+ return ptr;
427
+ }
428
+
429
+ let WASM_VECTOR_LEN = 0;
430
+
431
+ let wasmModule, wasmInstance, wasm;
432
+ function __wbg_finalize_init(instance, module) {
433
+ wasmInstance = instance;
434
+ wasm = instance.exports;
435
+ wasmModule = module;
436
+ cachedFloat64ArrayMemory0 = null;
437
+ cachedUint32ArrayMemory0 = null;
438
+ cachedUint8ArrayMemory0 = null;
439
+ wasm.__wbindgen_start();
440
+ return wasm;
441
+ }
442
+
443
+ async function __wbg_load(module, imports) {
444
+ if (typeof Response === 'function' && module instanceof Response) {
445
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
446
+ try {
447
+ return await WebAssembly.instantiateStreaming(module, imports);
448
+ } catch (e) {
449
+ const validResponse = module.ok && expectedResponseType(module.type);
450
+
451
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
452
+ 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);
453
+
454
+ } else { throw e; }
455
+ }
456
+ }
457
+
458
+ const bytes = await module.arrayBuffer();
459
+ return await WebAssembly.instantiate(bytes, imports);
460
+ } else {
461
+ const instance = await WebAssembly.instantiate(module, imports);
462
+
463
+ if (instance instanceof WebAssembly.Instance) {
464
+ return { instance, module };
465
+ } else {
466
+ return instance;
467
+ }
468
+ }
469
+
470
+ function expectedResponseType(type) {
471
+ switch (type) {
472
+ case 'basic': case 'cors': case 'default': return true;
473
+ }
474
+ return false;
475
+ }
476
+ }
477
+
478
+ function initSync(module) {
479
+ if (wasm !== undefined) return wasm;
480
+
481
+
482
+ if (module !== undefined) {
483
+ if (Object.getPrototypeOf(module) === Object.prototype) {
484
+ ({module} = module)
485
+ } else {
486
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
487
+ }
488
+ }
489
+
490
+ const imports = __wbg_get_imports();
491
+ if (!(module instanceof WebAssembly.Module)) {
492
+ module = new WebAssembly.Module(module);
493
+ }
494
+ const instance = new WebAssembly.Instance(module, imports);
495
+ return __wbg_finalize_init(instance, module);
496
+ }
497
+
498
+ async function __wbg_init(module_or_path) {
499
+ if (wasm !== undefined) return wasm;
500
+
501
+
502
+ if (module_or_path !== undefined) {
503
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
504
+ ({module_or_path} = module_or_path)
505
+ } else {
506
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
507
+ }
508
+ }
509
+
510
+ if (module_or_path === undefined) {
511
+ module_or_path = new URL('unfake_wasm_bg.wasm', import.meta.url);
512
+ }
513
+ const imports = __wbg_get_imports();
514
+
515
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
516
+ module_or_path = fetch(module_or_path);
517
+ }
518
+
519
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
520
+
521
+ return __wbg_finalize_init(instance, module);
522
+ }
523
+
524
+ export { initSync, __wbg_init as default };