@pandacss/compiler-wasm 2.0.0-beta.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.
@@ -0,0 +1,1879 @@
1
+ /* @ts-self-types="./compiler_wasm.d.ts" */
2
+
3
+ /**
4
+ * JS-facing project handle. Constructed once per session with a
5
+ * [`WasmFileSystem`] (whose contents the cross-file resolver reads),
6
+ * plus a resolved Panda config snapshot.
7
+ *
8
+ * ```js
9
+ * const fs = new WasmFileSystem()
10
+ * fs.addFile('/proj/tokens.ts', "export const brand = '#ef4444';")
11
+ * fs.addFile('/proj/main.tsx', "import { brand } from './tokens'\ncss({ color: brand })")
12
+ * const compiler = WasmCompiler.fromConfig(fs, config)
13
+ * project.parseFile('/proj/main.tsx', fs.readFile('/proj/main.tsx'))
14
+ * const atoms = project.atoms()
15
+ * ```
16
+ */
17
+ export class WasmCompiler {
18
+ static __wrap(ptr) {
19
+ const obj = Object.create(WasmCompiler.prototype);
20
+ obj.__wbg_ptr = ptr;
21
+ WasmCompilerFinalization.register(obj, obj.__wbg_ptr, obj);
22
+ return obj;
23
+ }
24
+ __destroy_into_raw() {
25
+ const ptr = this.__wbg_ptr;
26
+ this.__wbg_ptr = 0;
27
+ WasmCompilerFinalization.unregister(this);
28
+ return ptr;
29
+ }
30
+ free() {
31
+ const ptr = this.__destroy_into_raw();
32
+ wasm.__wbg_wasmcompiler_free(ptr, 0);
33
+ }
34
+ /**
35
+ * Hydrate an external build info into this project (additive), optionally
36
+ * restricted to imported modules (tree-shaking). Returns `false` on a
37
+ * schema-version mismatch.
38
+ *
39
+ * # Errors
40
+ * Returns a JS error if `build_info` isn't a valid build-info document.
41
+ * @param {string} name
42
+ * @param {any} build_info
43
+ * @param {any} only
44
+ * @returns {boolean}
45
+ */
46
+ applyBuildInfo(name, build_info, only) {
47
+ try {
48
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
49
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
50
+ const len0 = WASM_VECTOR_LEN;
51
+ wasm.wasmcompiler_applyBuildInfo(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(build_info), addHeapObject(only));
52
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
53
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
54
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
55
+ if (r2) {
56
+ throw takeObject(r1);
57
+ }
58
+ return r0 !== 0;
59
+ } finally {
60
+ wasm.__wbindgen_add_to_stack_pointer(16);
61
+ }
62
+ }
63
+ /**
64
+ * Deduplicated atoms across every currently-known file, sorted by
65
+ * `(prop, conditions, value)` for stable iteration.
66
+ *
67
+ * # Errors
68
+ * Returns a JS error if serializing the atom array fails.
69
+ * @returns {any}
70
+ */
71
+ atoms() {
72
+ try {
73
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
74
+ wasm.wasmcompiler_atoms(retptr, this.__wbg_ptr);
75
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
76
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
77
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
78
+ if (r2) {
79
+ throw takeObject(r1);
80
+ }
81
+ return takeObject(r0);
82
+ } finally {
83
+ wasm.__wbindgen_add_to_stack_pointer(16);
84
+ }
85
+ }
86
+ /**
87
+ * The build-info wire-format version this binding reads/writes.
88
+ * @returns {number}
89
+ */
90
+ buildInfoSchemaVersion() {
91
+ const ret = wasm.wasmcompiler_buildInfoSchemaVersion(this.__wbg_ptr);
92
+ return ret >>> 0;
93
+ }
94
+ /**
95
+ * Drop every path's state. Keeps the config-derived extractor,
96
+ * token dictionary, and cross-file resolver intact.
97
+ */
98
+ clear() {
99
+ wasm.wasmcompiler_clear(this.__wbg_ptr);
100
+ }
101
+ /**
102
+ * Compile to CSS. Mirrors the NAPI `Project.compile()`.
103
+ *
104
+ * # Errors
105
+ * Returns a JS error if serializing fails.
106
+ * @param {any | null} [options]
107
+ * @returns {any}
108
+ */
109
+ compile(options) {
110
+ try {
111
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
112
+ wasm.wasmcompiler_compile(retptr, this.__wbg_ptr, isLikeNone(options) ? 0 : addHeapObject(options));
113
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
114
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
115
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
116
+ if (r2) {
117
+ throw takeObject(r1);
118
+ }
119
+ return takeObject(r0);
120
+ } finally {
121
+ wasm.__wbindgen_add_to_stack_pointer(16);
122
+ }
123
+ }
124
+ /**
125
+ * Return the serialized config snapshot this project was constructed
126
+ * with.
127
+ *
128
+ * # Errors
129
+ * Returns a JS error if serializing fails.
130
+ * @returns {any}
131
+ */
132
+ config() {
133
+ try {
134
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
135
+ wasm.wasmcompiler_config(retptr, this.__wbg_ptr);
136
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
137
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
138
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
139
+ if (r2) {
140
+ throw takeObject(r1);
141
+ }
142
+ return takeObject(r0);
143
+ } finally {
144
+ wasm.__wbindgen_add_to_stack_pointer(16);
145
+ }
146
+ }
147
+ /**
148
+ * Engine-owned fingerprint of the resolved config's output-affecting fields,
149
+ * stamped into build info as `configFingerprint`.
150
+ * @returns {string}
151
+ */
152
+ configFingerprint() {
153
+ let deferred1_0;
154
+ let deferred1_1;
155
+ try {
156
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
157
+ wasm.wasmcompiler_configFingerprint(retptr, this.__wbg_ptr);
158
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
159
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
160
+ deferred1_0 = r0;
161
+ deferred1_1 = r1;
162
+ return getStringFromWasm0(r0, r1);
163
+ } finally {
164
+ wasm.__wbindgen_add_to_stack_pointer(16);
165
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
166
+ }
167
+ }
168
+ /**
169
+ * Config validation diagnostics from construction.
170
+ *
171
+ * # Errors
172
+ * Returns a JS error if serializing fails.
173
+ * @returns {any}
174
+ */
175
+ diagnostics() {
176
+ try {
177
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
178
+ wasm.wasmcompiler_diagnostics(retptr, this.__wbg_ptr);
179
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
180
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
181
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
182
+ if (r2) {
183
+ throw takeObject(r1);
184
+ }
185
+ return takeObject(r0);
186
+ } finally {
187
+ wasm.__wbindgen_add_to_stack_pointer(16);
188
+ }
189
+ }
190
+ /**
191
+ * @param {string} path
192
+ * @returns {string}
193
+ */
194
+ dirname(path) {
195
+ let deferred2_0;
196
+ let deferred2_1;
197
+ try {
198
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
199
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
200
+ const len0 = WASM_VECTOR_LEN;
201
+ wasm.wasmcompiler_dirname(retptr, this.__wbg_ptr, ptr0, len0);
202
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
203
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
204
+ deferred2_0 = r0;
205
+ deferred2_1 = r1;
206
+ return getStringFromWasm0(r0, r1);
207
+ } finally {
208
+ wasm.__wbindgen_add_to_stack_pointer(16);
209
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
210
+ }
211
+ }
212
+ /**
213
+ * Encoded config recipe styles, separate from atomic utility atoms.
214
+ *
215
+ * # Errors
216
+ * Returns a JS error if serializing fails.
217
+ * @returns {any}
218
+ */
219
+ encodedRecipes() {
220
+ try {
221
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
222
+ wasm.wasmcompiler_encodedRecipes(retptr, this.__wbg_ptr);
223
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
224
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
225
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
226
+ if (r2) {
227
+ throw takeObject(r1);
228
+ }
229
+ return takeObject(r0);
230
+ } finally {
231
+ wasm.__wbindgen_add_to_stack_pointer(16);
232
+ }
233
+ }
234
+ /**
235
+ * Stateless single-file extraction — raw `{ calls, jsx, diagnostics }`,
236
+ * using the project's configured matchers + token dictionary. Unlike
237
+ * `parseFile`, it registers nothing; it's the read-only peek companion.
238
+ *
239
+ * # Errors
240
+ * Returns a JS error string when serializing the result fails.
241
+ * @param {string} path
242
+ * @param {string} source
243
+ * @returns {any}
244
+ */
245
+ extractFileSource(path, source) {
246
+ try {
247
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
248
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
249
+ const len0 = WASM_VECTOR_LEN;
250
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
251
+ const len1 = WASM_VECTOR_LEN;
252
+ wasm.wasmcompiler_extractFileSource(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
253
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
254
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
255
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
256
+ if (r2) {
257
+ throw takeObject(r1);
258
+ }
259
+ return takeObject(r0);
260
+ } finally {
261
+ wasm.__wbindgen_add_to_stack_pointer(16);
262
+ }
263
+ }
264
+ /**
265
+ * `(path, hex source_hash)` for every known file, sorted by path.
266
+ *
267
+ * # Errors
268
+ * Returns a JS error if serializing fails.
269
+ * @returns {any}
270
+ */
271
+ fileManifest() {
272
+ try {
273
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
274
+ wasm.wasmcompiler_fileManifest(retptr, this.__wbg_ptr);
275
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
276
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
277
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
278
+ if (r2) {
279
+ throw takeObject(r1);
280
+ }
281
+ return takeObject(r0);
282
+ } finally {
283
+ wasm.__wbindgen_add_to_stack_pointer(16);
284
+ }
285
+ }
286
+ /**
287
+ * Construct a compiler from the resolved, JSON-safe Panda config snapshot.
288
+ *
289
+ * # Errors
290
+ * Returns a JS error when `config` doesn't deserialize into JSON.
291
+ * @param {WasmFileSystem} fs
292
+ * @param {any} config
293
+ * @param {any} options
294
+ * @returns {WasmCompiler}
295
+ */
296
+ static fromConfig(fs, config, options) {
297
+ try {
298
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
299
+ _assertClass(fs, WasmFileSystem);
300
+ wasm.wasmcompiler_fromConfig(retptr, fs.__wbg_ptr, addHeapObject(config), addBorrowedObject(options));
301
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
302
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
303
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
304
+ if (r2) {
305
+ throw takeObject(r1);
306
+ }
307
+ return WasmCompiler.__wrap(r0);
308
+ } finally {
309
+ wasm.__wbindgen_add_to_stack_pointer(16);
310
+ heap[stack_pointer++] = undefined;
311
+ }
312
+ }
313
+ /**
314
+ * Generate artifacts affected by the provided config dependency names.
315
+ *
316
+ * # Errors
317
+ * Returns a JS error if dependencies/options are invalid or serializing fails.
318
+ * @param {any} dependencies
319
+ * @param {any} options
320
+ * @returns {any}
321
+ */
322
+ generateAffectedArtifacts(dependencies, options) {
323
+ try {
324
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
325
+ wasm.wasmcompiler_generateAffectedArtifacts(retptr, this.__wbg_ptr, addHeapObject(dependencies), addBorrowedObject(options));
326
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
327
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
328
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
329
+ if (r2) {
330
+ throw takeObject(r1);
331
+ }
332
+ return takeObject(r0);
333
+ } finally {
334
+ wasm.__wbindgen_add_to_stack_pointer(16);
335
+ heap[stack_pointer++] = undefined;
336
+ }
337
+ }
338
+ /**
339
+ * Generate one codegen artifact by id.
340
+ *
341
+ * # Errors
342
+ * Returns a JS error if the id/options are invalid or serializing fails.
343
+ * @param {string} id
344
+ * @param {any} options
345
+ * @returns {any}
346
+ */
347
+ generateArtifact(id, options) {
348
+ try {
349
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
350
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
351
+ const len0 = WASM_VECTOR_LEN;
352
+ wasm.wasmcompiler_generateArtifact(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(options));
353
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
354
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
355
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
356
+ if (r2) {
357
+ throw takeObject(r1);
358
+ }
359
+ return takeObject(r0);
360
+ } finally {
361
+ wasm.__wbindgen_add_to_stack_pointer(16);
362
+ heap[stack_pointer++] = undefined;
363
+ }
364
+ }
365
+ /**
366
+ * Generate every codegen artifact from the resolved project state.
367
+ *
368
+ * # Errors
369
+ * Returns a JS error if options are invalid or serializing fails.
370
+ * @param {any} options
371
+ * @returns {any}
372
+ */
373
+ generateArtifacts(options) {
374
+ try {
375
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
376
+ wasm.wasmcompiler_generateArtifacts(retptr, this.__wbg_ptr, addBorrowedObject(options));
377
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
378
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
379
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
380
+ if (r2) {
381
+ throw takeObject(r1);
382
+ }
383
+ return takeObject(r0);
384
+ } finally {
385
+ wasm.__wbindgen_add_to_stack_pointer(16);
386
+ heap[stack_pointer++] = undefined;
387
+ }
388
+ }
389
+ /**
390
+ * Per-file view; returns `null` when `path` isn't known.
391
+ *
392
+ * # Errors
393
+ * Returns a JS error if serializing fails.
394
+ * @param {string} path
395
+ * @returns {any}
396
+ */
397
+ getFile(path) {
398
+ try {
399
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
400
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
401
+ const len0 = WASM_VECTOR_LEN;
402
+ wasm.wasmcompiler_getFile(retptr, this.__wbg_ptr, ptr0, len0);
403
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
404
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
405
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
406
+ if (r2) {
407
+ throw takeObject(r1);
408
+ }
409
+ return takeObject(r0);
410
+ } finally {
411
+ wasm.__wbindgen_add_to_stack_pointer(16);
412
+ }
413
+ }
414
+ /**
415
+ * Whether `css` declares Panda's cascade layers (`@layer reset, base, …;`),
416
+ * marking it as the stylesheet root to inject the compiled CSS into.
417
+ * @param {string} css
418
+ * @returns {boolean}
419
+ */
420
+ hasLayerDeclaration(css) {
421
+ const ptr0 = passStringToWasm0(css, wasm.__wbindgen_export, wasm.__wbindgen_export2);
422
+ const len0 = WASM_VECTOR_LEN;
423
+ const ret = wasm.wasmcompiler_hasLayerDeclaration(this.__wbg_ptr, ptr0, len0);
424
+ return ret !== 0;
425
+ }
426
+ /**
427
+ * Stateless source inspection for tooling (reporting, lint, IDE). Returns
428
+ * classified Panda usage sites plus file-local extraction diagnostics.
429
+ *
430
+ * # Errors
431
+ * Returns a JS error if serialization fails.
432
+ * @param {string} path
433
+ * @param {string} source
434
+ * @returns {any}
435
+ */
436
+ inspectFileSource(path, source) {
437
+ try {
438
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
439
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
440
+ const len0 = WASM_VECTOR_LEN;
441
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
442
+ const len1 = WASM_VECTOR_LEN;
443
+ wasm.wasmcompiler_inspectFileSource(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
444
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
445
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
446
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
447
+ if (r2) {
448
+ throw takeObject(r1);
449
+ }
450
+ return takeObject(r0);
451
+ } finally {
452
+ wasm.__wbindgen_add_to_stack_pointer(16);
453
+ }
454
+ }
455
+ /**
456
+ * Returns `true` when the project has no files and no accumulated output.
457
+ * @returns {boolean}
458
+ */
459
+ isEmpty() {
460
+ const ret = wasm.wasmcompiler_isEmpty(this.__wbg_ptr);
461
+ return ret !== 0;
462
+ }
463
+ /**
464
+ * Whether `path` is a source file the project extracts from — its
465
+ * `cwd`-relative form matches the configured `include`/`exclude` globs.
466
+ * @param {string} path
467
+ * @returns {boolean}
468
+ */
469
+ isSourceFile(path) {
470
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
471
+ const len0 = WASM_VECTOR_LEN;
472
+ const ret = wasm.wasmcompiler_isSourceFile(this.__wbg_ptr, ptr0, len0);
473
+ return ret !== 0;
474
+ }
475
+ /**
476
+ * @param {any} parts
477
+ * @returns {string}
478
+ */
479
+ joinPath(parts) {
480
+ let deferred2_0;
481
+ let deferred2_1;
482
+ try {
483
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
484
+ wasm.wasmcompiler_joinPath(retptr, this.__wbg_ptr, addHeapObject(parts));
485
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
486
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
487
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
488
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
489
+ var ptr1 = r0;
490
+ var len1 = r1;
491
+ if (r3) {
492
+ ptr1 = 0; len1 = 0;
493
+ throw takeObject(r2);
494
+ }
495
+ deferred2_0 = ptr1;
496
+ deferred2_1 = len1;
497
+ return getStringFromWasm0(ptr1, len1);
498
+ } finally {
499
+ wasm.__wbindgen_add_to_stack_pointer(16);
500
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
501
+ }
502
+ }
503
+ /**
504
+ * CSS for the named cascade layers, concatenated in order. Sliced in Rust
505
+ * (byte offsets stay valid); unknown layer names are skipped.
506
+ * @param {string[]} layers
507
+ * @returns {string}
508
+ */
509
+ layerCss(layers) {
510
+ let deferred2_0;
511
+ let deferred2_1;
512
+ try {
513
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
514
+ const ptr0 = passArrayJsValueToWasm0(layers, wasm.__wbindgen_export);
515
+ const len0 = WASM_VECTOR_LEN;
516
+ wasm.wasmcompiler_layerCss(retptr, this.__wbg_ptr, ptr0, len0);
517
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
518
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
519
+ deferred2_0 = r0;
520
+ deferred2_1 = r1;
521
+ return getStringFromWasm0(r0, r1);
522
+ } finally {
523
+ wasm.__wbindgen_add_to_stack_pointer(16);
524
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
525
+ }
526
+ }
527
+ /**
528
+ * The resolved cascade-layer names (config overrides merged over defaults).
529
+ *
530
+ * # Errors
531
+ * Returns a JS error if serializing fails.
532
+ * @returns {any}
533
+ */
534
+ layers() {
535
+ try {
536
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
537
+ wasm.wasmcompiler_layers(retptr, this.__wbg_ptr);
538
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
539
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
540
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
541
+ if (r2) {
542
+ throw takeObject(r1);
543
+ }
544
+ return takeObject(r0);
545
+ } finally {
546
+ wasm.__wbindgen_add_to_stack_pointer(16);
547
+ }
548
+ }
549
+ /**
550
+ * Read a source file from the in-memory filesystem and parse it.
551
+ *
552
+ * # Errors
553
+ * Returns a JS error if serializing the per-call report fails.
554
+ * @param {string} path
555
+ * @returns {any}
556
+ */
557
+ parseFile(path) {
558
+ try {
559
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
560
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
561
+ const len0 = WASM_VECTOR_LEN;
562
+ wasm.wasmcompiler_parseFile(retptr, this.__wbg_ptr, ptr0, len0);
563
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
564
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
565
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
566
+ if (r2) {
567
+ throw takeObject(r1);
568
+ }
569
+ return takeObject(r0);
570
+ } finally {
571
+ wasm.__wbindgen_add_to_stack_pointer(16);
572
+ }
573
+ }
574
+ /**
575
+ * Extract + encode provided source text. Replaces any prior contribution
576
+ * from `path`.
577
+ *
578
+ * # Errors
579
+ * Returns a JS error if serializing the per-call report fails.
580
+ * @param {string} path
581
+ * @param {string} source
582
+ * @returns {any}
583
+ */
584
+ parseFileSource(path, source) {
585
+ try {
586
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
587
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
588
+ const len0 = WASM_VECTOR_LEN;
589
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
590
+ const len1 = WASM_VECTOR_LEN;
591
+ wasm.wasmcompiler_parseFileSource(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
592
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
593
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
594
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
595
+ if (r2) {
596
+ throw takeObject(r1);
597
+ }
598
+ return takeObject(r0);
599
+ } finally {
600
+ wasm.__wbindgen_add_to_stack_pointer(16);
601
+ }
602
+ }
603
+ /**
604
+ * Read + parse source paths returned from `scan()`. Returns one report per
605
+ * successfully parsed path.
606
+ *
607
+ * # Errors
608
+ * Returns a JS error when `paths` is malformed or serializing the report fails.
609
+ * @param {any} paths
610
+ * @returns {any}
611
+ */
612
+ parseFiles(paths) {
613
+ try {
614
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
615
+ wasm.wasmcompiler_parseFiles(retptr, this.__wbg_ptr, addHeapObject(paths));
616
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
617
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
618
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
619
+ if (r2) {
620
+ throw takeObject(r1);
621
+ }
622
+ return takeObject(r0);
623
+ } finally {
624
+ wasm.__wbindgen_add_to_stack_pointer(16);
625
+ }
626
+ }
627
+ /**
628
+ * Real on-disk path (symlinks followed) from the in-memory filesystem, so two
629
+ * paths to the same file compare equal. Returns the input when unresolved.
630
+ * @param {string} path
631
+ * @returns {string}
632
+ */
633
+ realpath(path) {
634
+ let deferred2_0;
635
+ let deferred2_1;
636
+ try {
637
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
638
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
639
+ const len0 = WASM_VECTOR_LEN;
640
+ wasm.wasmcompiler_realpath(retptr, this.__wbg_ptr, ptr0, len0);
641
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
642
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
643
+ deferred2_0 = r0;
644
+ deferred2_1 = r1;
645
+ return getStringFromWasm0(r0, r1);
646
+ } finally {
647
+ wasm.__wbindgen_add_to_stack_pointer(16);
648
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
649
+ }
650
+ }
651
+ /**
652
+ * Every `cva()` recipe entry in `(file, span_start)` order.
653
+ *
654
+ * # Errors
655
+ * Returns a JS error if serializing fails.
656
+ * @returns {any}
657
+ */
658
+ recipes() {
659
+ try {
660
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
661
+ wasm.wasmcompiler_recipes(retptr, this.__wbg_ptr);
662
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
663
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
664
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
665
+ if (r2) {
666
+ throw takeObject(r1);
667
+ }
668
+ return takeObject(r0);
669
+ } finally {
670
+ wasm.__wbindgen_add_to_stack_pointer(16);
671
+ }
672
+ }
673
+ /**
674
+ * Re-read `path` from the in-memory filesystem and re-parse it only if
675
+ * already known. Returns `true` when the file was present and got
676
+ * re-parsed.
677
+ * @param {string} path
678
+ * @returns {boolean}
679
+ */
680
+ refreshFile(path) {
681
+ try {
682
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
683
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
684
+ const len0 = WASM_VECTOR_LEN;
685
+ wasm.wasmcompiler_refreshFile(retptr, this.__wbg_ptr, ptr0, len0);
686
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
687
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
688
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
689
+ if (r2) {
690
+ throw takeObject(r1);
691
+ }
692
+ return r0 !== 0;
693
+ } finally {
694
+ wasm.__wbindgen_add_to_stack_pointer(16);
695
+ }
696
+ }
697
+ /**
698
+ * Re-parse provided source text only if `path` is already known.
699
+ * @param {string} path
700
+ * @param {string} source
701
+ * @returns {boolean}
702
+ */
703
+ refreshFileSource(path, source) {
704
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
705
+ const len0 = WASM_VECTOR_LEN;
706
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
707
+ const len1 = WASM_VECTOR_LEN;
708
+ const ret = wasm.wasmcompiler_refreshFileSource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
709
+ return ret !== 0;
710
+ }
711
+ /**
712
+ * Register a JS-backed pattern transform callback. The wrapper package
713
+ * installs callbacks referenced by the serialized config snapshot.
714
+ * @param {string} id
715
+ * @param {Function} callback
716
+ */
717
+ registerPatternTransform(id, callback) {
718
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
719
+ const len0 = WASM_VECTOR_LEN;
720
+ wasm.wasmcompiler_registerPatternTransform(this.__wbg_ptr, ptr0, len0, addHeapObject(callback));
721
+ }
722
+ /**
723
+ * Register a JS-backed `parser:before` source transform with a Rust-side
724
+ * filter. The filter is evaluated before calling into JS.
725
+ * @param {string} id
726
+ * @param {any} filter
727
+ * @param {Function} callback
728
+ */
729
+ registerSourceTransform(id, filter, callback) {
730
+ try {
731
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
732
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
733
+ const len0 = WASM_VECTOR_LEN;
734
+ wasm.wasmcompiler_registerSourceTransform(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(filter), addHeapObject(callback));
735
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
736
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
737
+ if (r1) {
738
+ throw takeObject(r0);
739
+ }
740
+ } finally {
741
+ wasm.__wbindgen_add_to_stack_pointer(16);
742
+ }
743
+ }
744
+ /**
745
+ * Register a JS-backed utility transform callback. The JS package wraps
746
+ * the user callback so Rust only has to pass the raw value.
747
+ * @param {string} id
748
+ * @param {Function} callback
749
+ */
750
+ registerUtilityTransform(id, callback) {
751
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
752
+ const len0 = WASM_VECTOR_LEN;
753
+ wasm.wasmcompiler_registerUtilityTransform(this.__wbg_ptr, ptr0, len0, addHeapObject(callback));
754
+ }
755
+ /**
756
+ * Drop a file's contribution. Returns `true` if the path was known.
757
+ * @param {string} path
758
+ * @returns {boolean}
759
+ */
760
+ removeFile(path) {
761
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
762
+ const len0 = WASM_VECTOR_LEN;
763
+ const ret = wasm.wasmcompiler_removeFile(this.__wbg_ptr, ptr0, len0);
764
+ return ret !== 0;
765
+ }
766
+ /**
767
+ * @param {string} path
768
+ * @param {string | null} [cwd]
769
+ * @returns {string}
770
+ */
771
+ resolvePath(path, cwd) {
772
+ let deferred3_0;
773
+ let deferred3_1;
774
+ try {
775
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
776
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
777
+ const len0 = WASM_VECTOR_LEN;
778
+ var ptr1 = isLikeNone(cwd) ? 0 : passStringToWasm0(cwd, wasm.__wbindgen_export, wasm.__wbindgen_export2);
779
+ var len1 = WASM_VECTOR_LEN;
780
+ wasm.wasmcompiler_resolvePath(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
781
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
782
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
783
+ deferred3_0 = r0;
784
+ deferred3_1 = r1;
785
+ return getStringFromWasm0(r0, r1);
786
+ } finally {
787
+ wasm.__wbindgen_add_to_stack_pointer(16);
788
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
789
+ }
790
+ }
791
+ /**
792
+ * Source paths matching the config's `include`/`exclude` (overridable via
793
+ * `options`) from the in-memory filesystem. For discovery and the host's
794
+ * watch list.
795
+ *
796
+ * # Errors
797
+ * Returns a JS error when `options` is malformed or the scan fails.
798
+ * @param {any} options
799
+ * @returns {any}
800
+ */
801
+ scan(options) {
802
+ try {
803
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
804
+ wasm.wasmcompiler_scan(retptr, this.__wbg_ptr, addHeapObject(options));
805
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
806
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
807
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
808
+ if (r2) {
809
+ throw takeObject(r1);
810
+ }
811
+ return takeObject(r0);
812
+ } finally {
813
+ wasm.__wbindgen_add_to_stack_pointer(16);
814
+ }
815
+ }
816
+ /**
817
+ * Serialize the project's encoded atoms + recipes into a portable build info
818
+ * (the `panda buildinfo` producer). `configFingerprint` is engine-owned; the
819
+ * caller supplies only the published `panda` peer range.
820
+ *
821
+ * # Errors
822
+ * Returns a JS error if serializing the build info fails.
823
+ * @param {string} panda
824
+ * @returns {any}
825
+ */
826
+ serializeBuildInfo(panda) {
827
+ try {
828
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
829
+ const ptr0 = passStringToWasm0(panda, wasm.__wbindgen_export, wasm.__wbindgen_export2);
830
+ const len0 = WASM_VECTOR_LEN;
831
+ wasm.wasmcompiler_serializeBuildInfo(retptr, this.__wbg_ptr, ptr0, len0);
832
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
833
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
834
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
835
+ if (r2) {
836
+ throw takeObject(r1);
837
+ }
838
+ return takeObject(r0);
839
+ } finally {
840
+ wasm.__wbindgen_add_to_stack_pointer(16);
841
+ }
842
+ }
843
+ /**
844
+ * Every `sva()` slot-recipe entry.
845
+ *
846
+ * # Errors
847
+ * Returns a JS error if serializing fails.
848
+ * @returns {any}
849
+ */
850
+ slotRecipes() {
851
+ try {
852
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
853
+ wasm.wasmcompiler_slotRecipes(retptr, this.__wbg_ptr);
854
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
855
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
856
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
857
+ if (r2) {
858
+ throw takeObject(r1);
859
+ }
860
+ return takeObject(r0);
861
+ } finally {
862
+ wasm.__wbindgen_add_to_stack_pointer(16);
863
+ }
864
+ }
865
+ /**
866
+ * Source globs + their static base dirs (for the host watcher).
867
+ *
868
+ * # Errors
869
+ * Returns a JS error if serialization fails.
870
+ * @returns {any}
871
+ */
872
+ sources() {
873
+ try {
874
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
875
+ wasm.wasmcompiler_sources(retptr, this.__wbg_ptr);
876
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
877
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
878
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
879
+ if (r2) {
880
+ throw takeObject(r1);
881
+ }
882
+ return takeObject(r0);
883
+ } finally {
884
+ wasm.__wbindgen_add_to_stack_pointer(16);
885
+ }
886
+ }
887
+ /**
888
+ * Tooling introspection snapshot (read once, index on the host).
889
+ *
890
+ * # Errors
891
+ * Returns a JS error if the snapshot fails to serialize.
892
+ * @returns {any}
893
+ */
894
+ spec() {
895
+ try {
896
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
897
+ wasm.wasmcompiler_spec(retptr, this.__wbg_ptr);
898
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
899
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
900
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
901
+ if (r2) {
902
+ throw takeObject(r1);
903
+ }
904
+ return takeObject(r0);
905
+ } finally {
906
+ wasm.__wbindgen_add_to_stack_pointer(16);
907
+ }
908
+ }
909
+ /**
910
+ * Split the stylesheet into per-file outputs (one per layer + per recipe,
911
+ * plus `recipes.css` / `styles.css` index files) for `--splitting`.
912
+ *
913
+ * # Errors
914
+ * Returns a JS error if serializing fails.
915
+ * @returns {any}
916
+ */
917
+ splitCss() {
918
+ try {
919
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
920
+ wasm.wasmcompiler_splitCss(retptr, this.__wbg_ptr);
921
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
922
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
923
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
924
+ if (r2) {
925
+ throw takeObject(r1);
926
+ }
927
+ return takeObject(r0);
928
+ } finally {
929
+ wasm.__wbindgen_add_to_stack_pointer(16);
930
+ }
931
+ }
932
+ /**
933
+ * `staticCss.patterns` expansion as raw atoms, without compiling.
934
+ *
935
+ * # Errors
936
+ * Returns a JS error if serializing fails.
937
+ * @returns {any}
938
+ */
939
+ staticPatternAtoms() {
940
+ try {
941
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
942
+ wasm.wasmcompiler_staticPatternAtoms(retptr, this.__wbg_ptr);
943
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
944
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
945
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
946
+ if (r2) {
947
+ throw takeObject(r1);
948
+ }
949
+ return takeObject(r0);
950
+ } finally {
951
+ wasm.__wbindgen_add_to_stack_pointer(16);
952
+ }
953
+ }
954
+ /**
955
+ * Aggregate counts.
956
+ *
957
+ * # Errors
958
+ * Returns a JS error if serializing fails.
959
+ * @returns {any}
960
+ */
961
+ summary() {
962
+ try {
963
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
964
+ wasm.wasmcompiler_summary(retptr, this.__wbg_ptr);
965
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
966
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
967
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
968
+ if (r2) {
969
+ throw takeObject(r1);
970
+ }
971
+ return takeObject(r0);
972
+ } finally {
973
+ wasm.__wbindgen_add_to_stack_pointer(16);
974
+ }
975
+ }
976
+ /**
977
+ * Rust-built token dictionary projected into the small JS interop shape.
978
+ * @returns {any}
979
+ */
980
+ token_dictionary() {
981
+ try {
982
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
983
+ wasm.wasmcompiler_token_dictionary(retptr, this.__wbg_ptr);
984
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
985
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
986
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
987
+ if (r2) {
988
+ throw takeObject(r1);
989
+ }
990
+ return takeObject(r0);
991
+ } finally {
992
+ wasm.__wbindgen_add_to_stack_pointer(16);
993
+ }
994
+ }
995
+ /**
996
+ * Generate artifacts and write them under `outdir` via the in-memory fs.
997
+ * Returns the written paths.
998
+ *
999
+ * # Errors
1000
+ * Returns a JS error if a file fails to write or results fail to serialize.
1001
+ * @param {string} outdir
1002
+ * @param {string | null | undefined} cwd
1003
+ * @param {any} options
1004
+ * @returns {any}
1005
+ */
1006
+ writeArtifacts(outdir, cwd, options) {
1007
+ try {
1008
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1009
+ const ptr0 = passStringToWasm0(outdir, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1010
+ const len0 = WASM_VECTOR_LEN;
1011
+ var ptr1 = isLikeNone(cwd) ? 0 : passStringToWasm0(cwd, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1012
+ var len1 = WASM_VECTOR_LEN;
1013
+ wasm.wasmcompiler_writeArtifacts(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addBorrowedObject(options));
1014
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1015
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1016
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1017
+ if (r2) {
1018
+ throw takeObject(r1);
1019
+ }
1020
+ return takeObject(r0);
1021
+ } finally {
1022
+ wasm.__wbindgen_add_to_stack_pointer(16);
1023
+ heap[stack_pointer++] = undefined;
1024
+ }
1025
+ }
1026
+ /**
1027
+ * @param {string} outfile
1028
+ * @param {string | null} [cwd]
1029
+ * @param {any | null} [options]
1030
+ * @returns {any}
1031
+ */
1032
+ writeCss(outfile, cwd, options) {
1033
+ try {
1034
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1035
+ const ptr0 = passStringToWasm0(outfile, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1036
+ const len0 = WASM_VECTOR_LEN;
1037
+ var ptr1 = isLikeNone(cwd) ? 0 : passStringToWasm0(cwd, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1038
+ var len1 = WASM_VECTOR_LEN;
1039
+ wasm.wasmcompiler_writeCss(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(options) ? 0 : addHeapObject(options));
1040
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1041
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1042
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1043
+ if (r2) {
1044
+ throw takeObject(r1);
1045
+ }
1046
+ return takeObject(r0);
1047
+ } finally {
1048
+ wasm.__wbindgen_add_to_stack_pointer(16);
1049
+ }
1050
+ }
1051
+ /**
1052
+ * @param {string} outdir
1053
+ * @param {string | null} [cwd]
1054
+ * @returns {any}
1055
+ */
1056
+ writeSplitCss(outdir, cwd) {
1057
+ try {
1058
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1059
+ const ptr0 = passStringToWasm0(outdir, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1060
+ const len0 = WASM_VECTOR_LEN;
1061
+ var ptr1 = isLikeNone(cwd) ? 0 : passStringToWasm0(cwd, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1062
+ var len1 = WASM_VECTOR_LEN;
1063
+ wasm.wasmcompiler_writeSplitCss(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1064
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1065
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1066
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1067
+ if (r2) {
1068
+ throw takeObject(r1);
1069
+ }
1070
+ return takeObject(r0);
1071
+ } finally {
1072
+ wasm.__wbindgen_add_to_stack_pointer(16);
1073
+ }
1074
+ }
1075
+ }
1076
+ if (Symbol.dispose) WasmCompiler.prototype[Symbol.dispose] = WasmCompiler.prototype.free;
1077
+
1078
+ /**
1079
+ * JS-facing extractor handle. Constructed once per session with a
1080
+ * [`WasmFileSystem`] handle and a `MatchersInput`; the cross-file
1081
+ * resolver is wired up automatically against the same FS.
1082
+ *
1083
+ * ```js
1084
+ * const fs = new WasmFileSystem();
1085
+ * fs.addFile('/src/code.tsx', '...');
1086
+ * const ext = new WasmExtractor(fs, matchers);
1087
+ * const result = ext.parseFile('/src/code.tsx', source);
1088
+ * ```
1089
+ */
1090
+ export class WasmExtractor {
1091
+ __destroy_into_raw() {
1092
+ const ptr = this.__wbg_ptr;
1093
+ this.__wbg_ptr = 0;
1094
+ WasmExtractorFinalization.unregister(this);
1095
+ return ptr;
1096
+ }
1097
+ free() {
1098
+ const ptr = this.__destroy_into_raw();
1099
+ wasm.__wbg_wasmextractor_free(ptr, 0);
1100
+ }
1101
+ /**
1102
+ * Construct from a JS matchers object (see `MatchersInput`).
1103
+ *
1104
+ * # Errors
1105
+ * Returns a JS error string when `matchers` doesn't deserialize
1106
+ * into a `MatchersInput` shape.
1107
+ * @param {WasmFileSystem} fs
1108
+ * @param {any} matchers
1109
+ */
1110
+ constructor(fs, matchers) {
1111
+ try {
1112
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1113
+ _assertClass(fs, WasmFileSystem);
1114
+ wasm.wasmextractor_new(retptr, fs.__wbg_ptr, addHeapObject(matchers));
1115
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1116
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1117
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1118
+ if (r2) {
1119
+ throw takeObject(r1);
1120
+ }
1121
+ this.__wbg_ptr = r0;
1122
+ WasmExtractorFinalization.register(this, this.__wbg_ptr, this);
1123
+ return this;
1124
+ } finally {
1125
+ wasm.__wbindgen_add_to_stack_pointer(16);
1126
+ }
1127
+ }
1128
+ /**
1129
+ * Single-file extract. Returns the lean `ExtractUsage` shape as a
1130
+ * plain JS object (`{ calls, jsx, diagnostics }`).
1131
+ *
1132
+ * # Errors
1133
+ * Returns a JS error string when serializing the result to `JsValue`
1134
+ * fails (effectively never — the shape is bounded JSON).
1135
+ * @param {string} path
1136
+ * @param {string} source
1137
+ * @returns {any}
1138
+ */
1139
+ parseFile(path, source) {
1140
+ try {
1141
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1142
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1143
+ const len0 = WASM_VECTOR_LEN;
1144
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1145
+ const len1 = WASM_VECTOR_LEN;
1146
+ wasm.wasmextractor_parseFile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1147
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1148
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1149
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1150
+ if (r2) {
1151
+ throw takeObject(r1);
1152
+ }
1153
+ return takeObject(r0);
1154
+ } finally {
1155
+ wasm.__wbindgen_add_to_stack_pointer(16);
1156
+ }
1157
+ }
1158
+ }
1159
+ if (Symbol.dispose) WasmExtractor.prototype[Symbol.dispose] = WasmExtractor.prototype.free;
1160
+
1161
+ /**
1162
+ * JS-facing handle over [`MemoryFileSystem`]. Cheap to clone — shares
1163
+ * state via `Arc<RwLock>` internally — so the JS host can pass the same
1164
+ * handle into multiple `WasmExtractor` instances and edits flow through
1165
+ * to all consumers.
1166
+ */
1167
+ export class WasmFileSystem {
1168
+ __destroy_into_raw() {
1169
+ const ptr = this.__wbg_ptr;
1170
+ this.__wbg_ptr = 0;
1171
+ WasmFileSystemFinalization.unregister(this);
1172
+ return ptr;
1173
+ }
1174
+ free() {
1175
+ const ptr = this.__destroy_into_raw();
1176
+ wasm.__wbg_wasmfilesystem_free(ptr, 0);
1177
+ }
1178
+ /**
1179
+ * Write or overwrite a file. Parent dirs auto-register.
1180
+ * @param {string} path
1181
+ * @param {string} content
1182
+ */
1183
+ addFile(path, content) {
1184
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1185
+ const len0 = WASM_VECTOR_LEN;
1186
+ const ptr1 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1187
+ const len1 = WASM_VECTOR_LEN;
1188
+ wasm.wasmfilesystem_addFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1189
+ }
1190
+ /**
1191
+ * `true` when `path` exists as file or directory.
1192
+ * @param {string} path
1193
+ * @returns {boolean}
1194
+ */
1195
+ exists(path) {
1196
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1197
+ const len0 = WASM_VECTOR_LEN;
1198
+ const ret = wasm.wasmfilesystem_exists(this.__wbg_ptr, ptr0, len0);
1199
+ return ret !== 0;
1200
+ }
1201
+ /**
1202
+ * Number of files stored. Convenience for diagnostics / tests.
1203
+ * @returns {number}
1204
+ */
1205
+ fileCount() {
1206
+ const ret = wasm.wasmfilesystem_fileCount(this.__wbg_ptr);
1207
+ return ret >>> 0;
1208
+ }
1209
+ constructor() {
1210
+ const ret = wasm.wasmfilesystem_new();
1211
+ this.__wbg_ptr = ret;
1212
+ WasmFileSystemFinalization.register(this, this.__wbg_ptr, this);
1213
+ return this;
1214
+ }
1215
+ /**
1216
+ * Read a file. Returns `undefined` when missing.
1217
+ * @param {string} path
1218
+ * @returns {string | undefined}
1219
+ */
1220
+ readFile(path) {
1221
+ try {
1222
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1223
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1224
+ const len0 = WASM_VECTOR_LEN;
1225
+ wasm.wasmfilesystem_readFile(retptr, this.__wbg_ptr, ptr0, len0);
1226
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1227
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1228
+ let v2;
1229
+ if (r0 !== 0) {
1230
+ v2 = getStringFromWasm0(r0, r1).slice();
1231
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1232
+ }
1233
+ return v2;
1234
+ } finally {
1235
+ wasm.__wbindgen_add_to_stack_pointer(16);
1236
+ }
1237
+ }
1238
+ /**
1239
+ * `true` when the file existed and was removed.
1240
+ * @param {string} path
1241
+ * @returns {boolean}
1242
+ */
1243
+ removeFile(path) {
1244
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1245
+ const len0 = WASM_VECTOR_LEN;
1246
+ const ret = wasm.wasmfilesystem_removeFile(this.__wbg_ptr, ptr0, len0);
1247
+ return ret !== 0;
1248
+ }
1249
+ }
1250
+ if (Symbol.dispose) WasmFileSystem.prototype[Symbol.dispose] = WasmFileSystem.prototype.free;
1251
+
1252
+ /**
1253
+ * Install a panic hook so Rust panics surface as readable stack traces in
1254
+ * the browser console. Idempotent — safe to call multiple times.
1255
+ */
1256
+ export function installPanicHook() {
1257
+ wasm.installPanicHook();
1258
+ }
1259
+ function __wbg_get_imports() {
1260
+ const import0 = {
1261
+ __proto__: null,
1262
+ __wbg_Error_bce6d499ff0a4aff: function(arg0, arg1) {
1263
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1264
+ return addHeapObject(ret);
1265
+ },
1266
+ __wbg_Number_b7972a139bfbfdf0: function(arg0) {
1267
+ const ret = Number(getObject(arg0));
1268
+ return ret;
1269
+ },
1270
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1271
+ const ret = String(getObject(arg1));
1272
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1273
+ const len1 = WASM_VECTOR_LEN;
1274
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1275
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1276
+ },
1277
+ __wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83: function(arg0, arg1) {
1278
+ const v = getObject(arg1);
1279
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1280
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1281
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1282
+ },
1283
+ __wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
1284
+ const v = getObject(arg0);
1285
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1286
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1287
+ },
1288
+ __wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
1289
+ const ret = debugString(getObject(arg1));
1290
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1291
+ const len1 = WASM_VECTOR_LEN;
1292
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1293
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1294
+ },
1295
+ __wbg___wbindgen_in_07056af4f902c445: function(arg0, arg1) {
1296
+ const ret = getObject(arg0) in getObject(arg1);
1297
+ return ret;
1298
+ },
1299
+ __wbg___wbindgen_is_bigint_aeae3893f30ed54e: function(arg0) {
1300
+ const ret = typeof(getObject(arg0)) === 'bigint';
1301
+ return ret;
1302
+ },
1303
+ __wbg___wbindgen_is_function_5cd60d5cf78b4eef: function(arg0) {
1304
+ const ret = typeof(getObject(arg0)) === 'function';
1305
+ return ret;
1306
+ },
1307
+ __wbg___wbindgen_is_null_2042690d351e14f0: function(arg0) {
1308
+ const ret = getObject(arg0) === null;
1309
+ return ret;
1310
+ },
1311
+ __wbg___wbindgen_is_object_b4593df85baada48: function(arg0) {
1312
+ const val = getObject(arg0);
1313
+ const ret = typeof(val) === 'object' && val !== null;
1314
+ return ret;
1315
+ },
1316
+ __wbg___wbindgen_is_string_dde0fd9020db4434: function(arg0) {
1317
+ const ret = typeof(getObject(arg0)) === 'string';
1318
+ return ret;
1319
+ },
1320
+ __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
1321
+ const ret = getObject(arg0) === undefined;
1322
+ return ret;
1323
+ },
1324
+ __wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9: function(arg0, arg1) {
1325
+ const ret = getObject(arg0) === getObject(arg1);
1326
+ return ret;
1327
+ },
1328
+ __wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c: function(arg0, arg1) {
1329
+ const ret = getObject(arg0) == getObject(arg1);
1330
+ return ret;
1331
+ },
1332
+ __wbg___wbindgen_number_get_f73a1244370fcc2c: function(arg0, arg1) {
1333
+ const obj = getObject(arg1);
1334
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1335
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1336
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1337
+ },
1338
+ __wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
1339
+ const obj = getObject(arg1);
1340
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1341
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1342
+ var len1 = WASM_VECTOR_LEN;
1343
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1344
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1345
+ },
1346
+ __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
1347
+ throw new Error(getStringFromWasm0(arg0, arg1));
1348
+ },
1349
+ __wbg_call_13665d9f14390edc: function() { return handleError(function (arg0, arg1) {
1350
+ const ret = getObject(arg0).call(getObject(arg1));
1351
+ return addHeapObject(ret);
1352
+ }, arguments); },
1353
+ __wbg_call_dfde26266607c996: function() { return handleError(function (arg0, arg1, arg2) {
1354
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1355
+ return addHeapObject(ret);
1356
+ }, arguments); },
1357
+ __wbg_call_faa0a261f288f846: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1358
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1359
+ return addHeapObject(ret);
1360
+ }, arguments); },
1361
+ __wbg_done_54b8da57023b7ed2: function(arg0) {
1362
+ const ret = getObject(arg0).done;
1363
+ return ret;
1364
+ },
1365
+ __wbg_entries_564a7e8b1e54ede5: function(arg0) {
1366
+ const ret = Object.entries(getObject(arg0));
1367
+ return addHeapObject(ret);
1368
+ },
1369
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1370
+ let deferred0_0;
1371
+ let deferred0_1;
1372
+ try {
1373
+ deferred0_0 = arg0;
1374
+ deferred0_1 = arg1;
1375
+ console.error(getStringFromWasm0(arg0, arg1));
1376
+ } finally {
1377
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1378
+ }
1379
+ },
1380
+ __wbg_from_fa561fa561dc8031: function(arg0) {
1381
+ const ret = Array.from(getObject(arg0));
1382
+ return addHeapObject(ret);
1383
+ },
1384
+ __wbg_get_3e9a707ab7d352eb: function() { return handleError(function (arg0, arg1) {
1385
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1386
+ return addHeapObject(ret);
1387
+ }, arguments); },
1388
+ __wbg_get_98fdf51d029a75eb: function(arg0, arg1) {
1389
+ const ret = getObject(arg0)[arg1 >>> 0];
1390
+ return addHeapObject(ret);
1391
+ },
1392
+ __wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
1393
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1394
+ return addHeapObject(ret);
1395
+ }, arguments); },
1396
+ __wbg_get_unchecked_1dfe6d05ad91d9b7: function(arg0, arg1) {
1397
+ const ret = getObject(arg0)[arg1 >>> 0];
1398
+ return addHeapObject(ret);
1399
+ },
1400
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1401
+ const ret = getObject(arg0)[getObject(arg1)];
1402
+ return addHeapObject(ret);
1403
+ },
1404
+ __wbg_instanceof_ArrayBuffer_53db37b06f6b9afe: function(arg0) {
1405
+ let result;
1406
+ try {
1407
+ result = getObject(arg0) instanceof ArrayBuffer;
1408
+ } catch (_) {
1409
+ result = false;
1410
+ }
1411
+ const ret = result;
1412
+ return ret;
1413
+ },
1414
+ __wbg_instanceof_Error_b3f7e146d654031a: function(arg0) {
1415
+ let result;
1416
+ try {
1417
+ result = getObject(arg0) instanceof Error;
1418
+ } catch (_) {
1419
+ result = false;
1420
+ }
1421
+ const ret = result;
1422
+ return ret;
1423
+ },
1424
+ __wbg_instanceof_Map_16f217b9a2a08d8c: function(arg0) {
1425
+ let result;
1426
+ try {
1427
+ result = getObject(arg0) instanceof Map;
1428
+ } catch (_) {
1429
+ result = false;
1430
+ }
1431
+ const ret = result;
1432
+ return ret;
1433
+ },
1434
+ __wbg_instanceof_Uint8Array_abd07d4bd221d50b: function(arg0) {
1435
+ let result;
1436
+ try {
1437
+ result = getObject(arg0) instanceof Uint8Array;
1438
+ } catch (_) {
1439
+ result = false;
1440
+ }
1441
+ const ret = result;
1442
+ return ret;
1443
+ },
1444
+ __wbg_isArray_94898ed3aad6947b: function(arg0) {
1445
+ const ret = Array.isArray(getObject(arg0));
1446
+ return ret;
1447
+ },
1448
+ __wbg_isSafeInteger_01e964d144ad3a55: function(arg0) {
1449
+ const ret = Number.isSafeInteger(getObject(arg0));
1450
+ return ret;
1451
+ },
1452
+ __wbg_iterator_1441b47f341dc34f: function() {
1453
+ const ret = Symbol.iterator;
1454
+ return addHeapObject(ret);
1455
+ },
1456
+ __wbg_length_2591a0f4f659a55c: function(arg0) {
1457
+ const ret = getObject(arg0).length;
1458
+ return ret;
1459
+ },
1460
+ __wbg_length_56fcd3e2b7e0299d: function(arg0) {
1461
+ const ret = getObject(arg0).length;
1462
+ return ret;
1463
+ },
1464
+ __wbg_message_324ac511aeaf710e: function(arg0) {
1465
+ const ret = getObject(arg0).message;
1466
+ return addHeapObject(ret);
1467
+ },
1468
+ __wbg_new_02d162bc6cf02f60: function() {
1469
+ const ret = new Object();
1470
+ return addHeapObject(ret);
1471
+ },
1472
+ __wbg_new_070df68d66325372: function() {
1473
+ const ret = new Map();
1474
+ return addHeapObject(ret);
1475
+ },
1476
+ __wbg_new_227d7c05414eb861: function() {
1477
+ const ret = new Error();
1478
+ return addHeapObject(ret);
1479
+ },
1480
+ __wbg_new_310879b66b6e95e1: function() {
1481
+ const ret = new Array();
1482
+ return addHeapObject(ret);
1483
+ },
1484
+ __wbg_new_7ddec6de44ff8f5d: function(arg0) {
1485
+ const ret = new Uint8Array(getObject(arg0));
1486
+ return addHeapObject(ret);
1487
+ },
1488
+ __wbg_next_2a4e19f4f5083b0f: function(arg0) {
1489
+ const ret = getObject(arg0).next;
1490
+ return addHeapObject(ret);
1491
+ },
1492
+ __wbg_next_6429a146bf756f93: function() { return handleError(function (arg0) {
1493
+ const ret = getObject(arg0).next();
1494
+ return addHeapObject(ret);
1495
+ }, arguments); },
1496
+ __wbg_parse_2c1cad6215e84999: function() { return handleError(function (arg0, arg1) {
1497
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1498
+ return addHeapObject(ret);
1499
+ }, arguments); },
1500
+ __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
1501
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1502
+ },
1503
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1504
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1505
+ },
1506
+ __wbg_set_78ea6a19f4818587: function(arg0, arg1, arg2) {
1507
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1508
+ },
1509
+ __wbg_set_facb7a5914e0fa39: function(arg0, arg1, arg2) {
1510
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1511
+ return addHeapObject(ret);
1512
+ },
1513
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1514
+ const ret = getObject(arg1).stack;
1515
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1516
+ const len1 = WASM_VECTOR_LEN;
1517
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1518
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1519
+ },
1520
+ __wbg_value_9cc0518af87a489c: function(arg0) {
1521
+ const ret = getObject(arg0).value;
1522
+ return addHeapObject(ret);
1523
+ },
1524
+ __wbindgen_cast_0000000000000001: function(arg0) {
1525
+ // Cast intrinsic for `F64 -> Externref`.
1526
+ const ret = arg0;
1527
+ return addHeapObject(ret);
1528
+ },
1529
+ __wbindgen_cast_0000000000000002: function(arg0) {
1530
+ // Cast intrinsic for `I64 -> Externref`.
1531
+ const ret = arg0;
1532
+ return addHeapObject(ret);
1533
+ },
1534
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1535
+ // Cast intrinsic for `Ref(String) -> Externref`.
1536
+ const ret = getStringFromWasm0(arg0, arg1);
1537
+ return addHeapObject(ret);
1538
+ },
1539
+ __wbindgen_cast_0000000000000004: function(arg0) {
1540
+ // Cast intrinsic for `U64 -> Externref`.
1541
+ const ret = BigInt.asUintN(64, arg0);
1542
+ return addHeapObject(ret);
1543
+ },
1544
+ __wbindgen_object_clone_ref: function(arg0) {
1545
+ const ret = getObject(arg0);
1546
+ return addHeapObject(ret);
1547
+ },
1548
+ __wbindgen_object_drop_ref: function(arg0) {
1549
+ takeObject(arg0);
1550
+ },
1551
+ };
1552
+ return {
1553
+ __proto__: null,
1554
+ "./compiler_wasm_bg.js": import0,
1555
+ };
1556
+ }
1557
+
1558
+ const WasmCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
1559
+ ? { register: () => {}, unregister: () => {} }
1560
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcompiler_free(ptr, 1));
1561
+ const WasmExtractorFinalization = (typeof FinalizationRegistry === 'undefined')
1562
+ ? { register: () => {}, unregister: () => {} }
1563
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmextractor_free(ptr, 1));
1564
+ const WasmFileSystemFinalization = (typeof FinalizationRegistry === 'undefined')
1565
+ ? { register: () => {}, unregister: () => {} }
1566
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmfilesystem_free(ptr, 1));
1567
+
1568
+ function addHeapObject(obj) {
1569
+ if (heap_next === heap.length) heap.push(heap.length + 1);
1570
+ const idx = heap_next;
1571
+ heap_next = heap[idx];
1572
+
1573
+ heap[idx] = obj;
1574
+ return idx;
1575
+ }
1576
+
1577
+ function _assertClass(instance, klass) {
1578
+ if (!(instance instanceof klass)) {
1579
+ throw new Error(`expected instance of ${klass.name}`);
1580
+ }
1581
+ }
1582
+
1583
+ function addBorrowedObject(obj) {
1584
+ if (stack_pointer == 1) throw new Error('out of js stack');
1585
+ heap[--stack_pointer] = obj;
1586
+ return stack_pointer;
1587
+ }
1588
+
1589
+ function debugString(val) {
1590
+ // primitive types
1591
+ const type = typeof val;
1592
+ if (type == 'number' || type == 'boolean' || val == null) {
1593
+ return `${val}`;
1594
+ }
1595
+ if (type == 'string') {
1596
+ return `"${val}"`;
1597
+ }
1598
+ if (type == 'symbol') {
1599
+ const description = val.description;
1600
+ if (description == null) {
1601
+ return 'Symbol';
1602
+ } else {
1603
+ return `Symbol(${description})`;
1604
+ }
1605
+ }
1606
+ if (type == 'function') {
1607
+ const name = val.name;
1608
+ if (typeof name == 'string' && name.length > 0) {
1609
+ return `Function(${name})`;
1610
+ } else {
1611
+ return 'Function';
1612
+ }
1613
+ }
1614
+ // objects
1615
+ if (Array.isArray(val)) {
1616
+ const length = val.length;
1617
+ let debug = '[';
1618
+ if (length > 0) {
1619
+ debug += debugString(val[0]);
1620
+ }
1621
+ for(let i = 1; i < length; i++) {
1622
+ debug += ', ' + debugString(val[i]);
1623
+ }
1624
+ debug += ']';
1625
+ return debug;
1626
+ }
1627
+ // Test for built-in
1628
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1629
+ let className;
1630
+ if (builtInMatches && builtInMatches.length > 1) {
1631
+ className = builtInMatches[1];
1632
+ } else {
1633
+ // Failed to match the standard '[object ClassName]'
1634
+ return toString.call(val);
1635
+ }
1636
+ if (className == 'Object') {
1637
+ // we're a user defined class or Object
1638
+ // JSON.stringify avoids problems with cycles, and is generally much
1639
+ // easier than looping through ownProperties of `val`.
1640
+ try {
1641
+ return 'Object(' + JSON.stringify(val) + ')';
1642
+ } catch (_) {
1643
+ return 'Object';
1644
+ }
1645
+ }
1646
+ // errors
1647
+ if (val instanceof Error) {
1648
+ return `${val.name}: ${val.message}\n${val.stack}`;
1649
+ }
1650
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1651
+ return className;
1652
+ }
1653
+
1654
+ function dropObject(idx) {
1655
+ if (idx < 1028) return;
1656
+ heap[idx] = heap_next;
1657
+ heap_next = idx;
1658
+ }
1659
+
1660
+ function getArrayU8FromWasm0(ptr, len) {
1661
+ ptr = ptr >>> 0;
1662
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1663
+ }
1664
+
1665
+ let cachedDataViewMemory0 = null;
1666
+ function getDataViewMemory0() {
1667
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1668
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1669
+ }
1670
+ return cachedDataViewMemory0;
1671
+ }
1672
+
1673
+ function getStringFromWasm0(ptr, len) {
1674
+ return decodeText(ptr >>> 0, len);
1675
+ }
1676
+
1677
+ let cachedUint8ArrayMemory0 = null;
1678
+ function getUint8ArrayMemory0() {
1679
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1680
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1681
+ }
1682
+ return cachedUint8ArrayMemory0;
1683
+ }
1684
+
1685
+ function getObject(idx) { return heap[idx]; }
1686
+
1687
+ function handleError(f, args) {
1688
+ try {
1689
+ return f.apply(this, args);
1690
+ } catch (e) {
1691
+ wasm.__wbindgen_export3(addHeapObject(e));
1692
+ }
1693
+ }
1694
+
1695
+ let heap = new Array(1024).fill(undefined);
1696
+ heap.push(undefined, null, true, false);
1697
+
1698
+ let heap_next = heap.length;
1699
+
1700
+ function isLikeNone(x) {
1701
+ return x === undefined || x === null;
1702
+ }
1703
+
1704
+ function passArrayJsValueToWasm0(array, malloc) {
1705
+ const ptr = malloc(array.length * 4, 4) >>> 0;
1706
+ const mem = getDataViewMemory0();
1707
+ for (let i = 0; i < array.length; i++) {
1708
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
1709
+ }
1710
+ WASM_VECTOR_LEN = array.length;
1711
+ return ptr;
1712
+ }
1713
+
1714
+ function passStringToWasm0(arg, malloc, realloc) {
1715
+ if (realloc === undefined) {
1716
+ const buf = cachedTextEncoder.encode(arg);
1717
+ const ptr = malloc(buf.length, 1) >>> 0;
1718
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1719
+ WASM_VECTOR_LEN = buf.length;
1720
+ return ptr;
1721
+ }
1722
+
1723
+ let len = arg.length;
1724
+ let ptr = malloc(len, 1) >>> 0;
1725
+
1726
+ const mem = getUint8ArrayMemory0();
1727
+
1728
+ let offset = 0;
1729
+
1730
+ for (; offset < len; offset++) {
1731
+ const code = arg.charCodeAt(offset);
1732
+ if (code > 0x7F) break;
1733
+ mem[ptr + offset] = code;
1734
+ }
1735
+ if (offset !== len) {
1736
+ if (offset !== 0) {
1737
+ arg = arg.slice(offset);
1738
+ }
1739
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1740
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1741
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1742
+
1743
+ offset += ret.written;
1744
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1745
+ }
1746
+
1747
+ WASM_VECTOR_LEN = offset;
1748
+ return ptr;
1749
+ }
1750
+
1751
+ let stack_pointer = 1024;
1752
+
1753
+ function takeObject(idx) {
1754
+ const ret = getObject(idx);
1755
+ dropObject(idx);
1756
+ return ret;
1757
+ }
1758
+
1759
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1760
+ cachedTextDecoder.decode();
1761
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1762
+ let numBytesDecoded = 0;
1763
+ function decodeText(ptr, len) {
1764
+ numBytesDecoded += len;
1765
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1766
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1767
+ cachedTextDecoder.decode();
1768
+ numBytesDecoded = len;
1769
+ }
1770
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1771
+ }
1772
+
1773
+ const cachedTextEncoder = new TextEncoder();
1774
+
1775
+ if (!('encodeInto' in cachedTextEncoder)) {
1776
+ cachedTextEncoder.encodeInto = function (arg, view) {
1777
+ const buf = cachedTextEncoder.encode(arg);
1778
+ view.set(buf);
1779
+ return {
1780
+ read: arg.length,
1781
+ written: buf.length
1782
+ };
1783
+ };
1784
+ }
1785
+
1786
+ let WASM_VECTOR_LEN = 0;
1787
+
1788
+ let wasmModule, wasmInstance, wasm;
1789
+ function __wbg_finalize_init(instance, module) {
1790
+ wasmInstance = instance;
1791
+ wasm = instance.exports;
1792
+ wasmModule = module;
1793
+ cachedDataViewMemory0 = null;
1794
+ cachedUint8ArrayMemory0 = null;
1795
+ return wasm;
1796
+ }
1797
+
1798
+ async function __wbg_load(module, imports) {
1799
+ if (typeof Response === 'function' && module instanceof Response) {
1800
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1801
+ try {
1802
+ return await WebAssembly.instantiateStreaming(module, imports);
1803
+ } catch (e) {
1804
+ const validResponse = module.ok && expectedResponseType(module.type);
1805
+
1806
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1807
+ 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);
1808
+
1809
+ } else { throw e; }
1810
+ }
1811
+ }
1812
+
1813
+ const bytes = await module.arrayBuffer();
1814
+ return await WebAssembly.instantiate(bytes, imports);
1815
+ } else {
1816
+ const instance = await WebAssembly.instantiate(module, imports);
1817
+
1818
+ if (instance instanceof WebAssembly.Instance) {
1819
+ return { instance, module };
1820
+ } else {
1821
+ return instance;
1822
+ }
1823
+ }
1824
+
1825
+ function expectedResponseType(type) {
1826
+ switch (type) {
1827
+ case 'basic': case 'cors': case 'default': return true;
1828
+ }
1829
+ return false;
1830
+ }
1831
+ }
1832
+
1833
+ function initSync(module) {
1834
+ if (wasm !== undefined) return wasm;
1835
+
1836
+
1837
+ if (module !== undefined) {
1838
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1839
+ ({module} = module)
1840
+ } else {
1841
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1842
+ }
1843
+ }
1844
+
1845
+ const imports = __wbg_get_imports();
1846
+ if (!(module instanceof WebAssembly.Module)) {
1847
+ module = new WebAssembly.Module(module);
1848
+ }
1849
+ const instance = new WebAssembly.Instance(module, imports);
1850
+ return __wbg_finalize_init(instance, module);
1851
+ }
1852
+
1853
+ async function __wbg_init(module_or_path) {
1854
+ if (wasm !== undefined) return wasm;
1855
+
1856
+
1857
+ if (module_or_path !== undefined) {
1858
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1859
+ ({module_or_path} = module_or_path)
1860
+ } else {
1861
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1862
+ }
1863
+ }
1864
+
1865
+ if (module_or_path === undefined) {
1866
+ module_or_path = new URL('compiler_wasm_bg.wasm', import.meta.url);
1867
+ }
1868
+ const imports = __wbg_get_imports();
1869
+
1870
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1871
+ module_or_path = fetch(module_or_path);
1872
+ }
1873
+
1874
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1875
+
1876
+ return __wbg_finalize_init(instance, module);
1877
+ }
1878
+
1879
+ export { initSync, __wbg_init as default };