@5ive-tech/sdk 1.1.19 → 1.1.21

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,3750 @@
1
+ /**
2
+ * Bytecode analyzer for WASM
3
+ */
4
+ export class BytecodeAnalyzer {
5
+ __destroy_into_raw() {
6
+ const ptr = this.__wbg_ptr;
7
+ this.__wbg_ptr = 0;
8
+ BytecodeAnalyzerFinalization.unregister(this);
9
+ return ptr;
10
+ }
11
+ free() {
12
+ const ptr = this.__destroy_into_raw();
13
+ wasm.__wbg_bytecodeanalyzer_free(ptr, 0);
14
+ }
15
+ /**
16
+ * Analyze bytecode and return instruction breakdown (legacy method for compatibility)
17
+ * @param {Uint8Array} bytecode
18
+ * @returns {any}
19
+ */
20
+ static analyze(bytecode) {
21
+ try {
22
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
23
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
24
+ const len0 = WASM_VECTOR_LEN;
25
+ wasm.bytecodeanalyzer_analyze(retptr, ptr0, len0);
26
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
27
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
28
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
29
+ if (r2) {
30
+ throw takeObject(r1);
31
+ }
32
+ return takeObject(r0);
33
+ } finally {
34
+ wasm.__wbindgen_add_to_stack_pointer(16);
35
+ }
36
+ }
37
+ /**
38
+ * Get detailed opcode flow analysis - shows execution paths through the bytecode
39
+ * @param {Uint8Array} bytecode
40
+ * @returns {any}
41
+ */
42
+ static analyze_execution_flow(bytecode) {
43
+ try {
44
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
45
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
46
+ const len0 = WASM_VECTOR_LEN;
47
+ wasm.bytecodeanalyzer_analyze_execution_flow(retptr, ptr0, len0);
48
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
49
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
50
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
51
+ if (r2) {
52
+ throw takeObject(r1);
53
+ }
54
+ return takeObject(r0);
55
+ } finally {
56
+ wasm.__wbindgen_add_to_stack_pointer(16);
57
+ }
58
+ }
59
+ /**
60
+ * Get detailed information about a specific instruction at an offset
61
+ * @param {Uint8Array} bytecode
62
+ * @param {number} offset
63
+ * @returns {any}
64
+ */
65
+ static analyze_instruction_at(bytecode, offset) {
66
+ try {
67
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
68
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
69
+ const len0 = WASM_VECTOR_LEN;
70
+ wasm.bytecodeanalyzer_analyze_instruction_at(retptr, ptr0, len0, offset);
71
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
72
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
73
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
74
+ if (r2) {
75
+ throw takeObject(r1);
76
+ }
77
+ return takeObject(r0);
78
+ } finally {
79
+ wasm.__wbindgen_add_to_stack_pointer(16);
80
+ }
81
+ }
82
+ /**
83
+ * Advanced semantic analysis with full opcode understanding and instruction flow
84
+ * Performs semantic analysis of bytecode to understand opcode behavior
85
+ * and instruction flow.
86
+ * @param {Uint8Array} bytecode
87
+ * @returns {any}
88
+ */
89
+ static analyze_semantic(bytecode) {
90
+ try {
91
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
92
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
93
+ const len0 = WASM_VECTOR_LEN;
94
+ wasm.bytecodeanalyzer_analyze_semantic(retptr, ptr0, len0);
95
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
96
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
97
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
98
+ if (r2) {
99
+ throw takeObject(r1);
100
+ }
101
+ return takeObject(r0);
102
+ } finally {
103
+ wasm.__wbindgen_add_to_stack_pointer(16);
104
+ }
105
+ }
106
+ /**
107
+ * Get summary statistics about the bytecode
108
+ * @param {Uint8Array} bytecode
109
+ * @returns {any}
110
+ */
111
+ static get_bytecode_summary(bytecode) {
112
+ try {
113
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
114
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
115
+ const len0 = WASM_VECTOR_LEN;
116
+ wasm.bytecodeanalyzer_get_bytecode_summary(retptr, ptr0, len0);
117
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
118
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
119
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
120
+ if (r2) {
121
+ throw takeObject(r1);
122
+ }
123
+ return takeObject(r0);
124
+ } finally {
125
+ wasm.__wbindgen_add_to_stack_pointer(16);
126
+ }
127
+ }
128
+ }
129
+ if (Symbol.dispose) BytecodeAnalyzer.prototype[Symbol.dispose] = BytecodeAnalyzer.prototype.free;
130
+
131
+ /**
132
+ * Bytecode Encoding utilities for JavaScript (Fixed Size)
133
+ */
134
+ export class BytecodeEncoder {
135
+ __destroy_into_raw() {
136
+ const ptr = this.__wbg_ptr;
137
+ this.__wbg_ptr = 0;
138
+ BytecodeEncoderFinalization.unregister(this);
139
+ return ptr;
140
+ }
141
+ free() {
142
+ const ptr = this.__destroy_into_raw();
143
+ wasm.__wbg_bytecodeencoder_free(ptr, 0);
144
+ }
145
+ /**
146
+ * Decode a u16 value
147
+ * Returns [value, bytes_consumed] or null if invalid
148
+ * @param {Uint8Array} bytes
149
+ * @returns {Array<any> | undefined}
150
+ */
151
+ static decode_u16(bytes) {
152
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ret = wasm.bytecodeencoder_decode_u16(ptr0, len0);
155
+ return takeObject(ret);
156
+ }
157
+ /**
158
+ * Decode a u32 value
159
+ * Returns [value, bytes_consumed] or null if invalid
160
+ * @param {Uint8Array} bytes
161
+ * @returns {Array<any> | undefined}
162
+ */
163
+ static decode_u32(bytes) {
164
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
165
+ const len0 = WASM_VECTOR_LEN;
166
+ const ret = wasm.bytecodeencoder_decode_u32(ptr0, len0);
167
+ return takeObject(ret);
168
+ }
169
+ /**
170
+ * Encode a u16 value
171
+ * Returns [size, byte1, byte2]
172
+ * @param {number} value
173
+ * @returns {Array<any>}
174
+ */
175
+ static encode_u16(value) {
176
+ const ret = wasm.bytecodeencoder_encode_u16(value);
177
+ return takeObject(ret);
178
+ }
179
+ /**
180
+ * Encode a u32 value
181
+ * Returns [size, byte1, byte2, byte3, byte4]
182
+ * @param {number} value
183
+ * @returns {Array<any>}
184
+ */
185
+ static encode_u32(value) {
186
+ const ret = wasm.bytecodeencoder_encode_u32(value);
187
+ return takeObject(ret);
188
+ }
189
+ /**
190
+ * Calculate encoded size (Always 2 for u16)
191
+ * @param {number} _value
192
+ * @returns {number}
193
+ */
194
+ static encoded_size_u16(_value) {
195
+ const ret = wasm.bytecodeencoder_encoded_size_u16(_value);
196
+ return ret >>> 0;
197
+ }
198
+ /**
199
+ * Calculate encoded size (Always 4 for u32)
200
+ * @param {number} _value
201
+ * @returns {number}
202
+ */
203
+ static encoded_size_u32(_value) {
204
+ const ret = wasm.bytecodeencoder_encoded_size_u32(_value);
205
+ return ret >>> 0;
206
+ }
207
+ }
208
+ if (Symbol.dispose) BytecodeEncoder.prototype[Symbol.dispose] = BytecodeEncoder.prototype.free;
209
+
210
+ /**
211
+ * Execution result.
212
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
213
+ */
214
+ export const ExecutionStatus = Object.freeze({
215
+ /**
216
+ * All operations completed successfully.
217
+ */
218
+ Completed: 0, "0": "Completed",
219
+ /**
220
+ * Execution stopped because it hit a system program call that cannot be executed in WASM.
221
+ */
222
+ StoppedAtSystemCall: 1, "1": "StoppedAtSystemCall",
223
+ /**
224
+ * Execution stopped because it hit an INIT_PDA operation that requires real Solana context.
225
+ */
226
+ StoppedAtInitPDA: 2, "2": "StoppedAtInitPDA",
227
+ /**
228
+ * Execution stopped because it hit an INVOKE operation that requires real RPC.
229
+ */
230
+ StoppedAtInvoke: 3, "3": "StoppedAtInvoke",
231
+ /**
232
+ * Execution stopped because it hit an INVOKE_SIGNED operation that requires real RPC.
233
+ */
234
+ StoppedAtInvokeSigned: 4, "4": "StoppedAtInvokeSigned",
235
+ /**
236
+ * Execution stopped because compute limit was reached.
237
+ */
238
+ ComputeLimitExceeded: 5, "5": "ComputeLimitExceeded",
239
+ /**
240
+ * Execution failed due to an error.
241
+ */
242
+ Failed: 6, "6": "Failed",
243
+ });
244
+
245
+ /**
246
+ * JavaScript-compatible VM state representation.
247
+ */
248
+ export class FiveVMState {
249
+ __destroy_into_raw() {
250
+ const ptr = this.__wbg_ptr;
251
+ this.__wbg_ptr = 0;
252
+ FiveVMStateFinalization.unregister(this);
253
+ return ptr;
254
+ }
255
+ free() {
256
+ const ptr = this.__destroy_into_raw();
257
+ wasm.__wbg_fivevmstate_free(ptr, 0);
258
+ }
259
+ /**
260
+ * @returns {bigint}
261
+ */
262
+ get compute_units() {
263
+ const ret = wasm.fivevmstate_compute_units(this.__wbg_ptr);
264
+ return BigInt.asUintN(64, ret);
265
+ }
266
+ /**
267
+ * @returns {number}
268
+ */
269
+ get instruction_pointer() {
270
+ const ret = wasm.fivevmstate_instruction_pointer(this.__wbg_ptr);
271
+ return ret >>> 0;
272
+ }
273
+ /**
274
+ * @returns {Array<any>}
275
+ */
276
+ get stack() {
277
+ const ret = wasm.fivevmstate_stack(this.__wbg_ptr);
278
+ return takeObject(ret);
279
+ }
280
+ }
281
+ if (Symbol.dispose) FiveVMState.prototype[Symbol.dispose] = FiveVMState.prototype.free;
282
+
283
+ /**
284
+ * Main WASM VM wrapper.
285
+ */
286
+ export class FiveVMWasm {
287
+ __destroy_into_raw() {
288
+ const ptr = this.__wbg_ptr;
289
+ this.__wbg_ptr = 0;
290
+ FiveVMWasmFinalization.unregister(this);
291
+ return ptr;
292
+ }
293
+ free() {
294
+ const ptr = this.__destroy_into_raw();
295
+ wasm.__wbg_fivevmwasm_free(ptr, 0);
296
+ }
297
+ /**
298
+ * Execute VM with input data and accounts (legacy method).
299
+ * @param {Uint8Array} input_data
300
+ * @param {Array<any>} accounts
301
+ * @returns {any}
302
+ */
303
+ execute(input_data, accounts) {
304
+ try {
305
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
306
+ const ptr0 = passArray8ToWasm0(input_data, wasm.__wbindgen_export);
307
+ const len0 = WASM_VECTOR_LEN;
308
+ wasm.fivevmwasm_execute(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(accounts));
309
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
310
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
311
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
312
+ if (r2) {
313
+ throw takeObject(r1);
314
+ }
315
+ return takeObject(r0);
316
+ } finally {
317
+ wasm.__wbindgen_add_to_stack_pointer(16);
318
+ }
319
+ }
320
+ /**
321
+ * Execute VM with partial execution support - stops at system calls.
322
+ * @param {Uint8Array} input_data
323
+ * @param {Array<any>} accounts
324
+ * @returns {TestResult}
325
+ */
326
+ execute_partial(input_data, accounts) {
327
+ try {
328
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
329
+ const ptr0 = passArray8ToWasm0(input_data, wasm.__wbindgen_export);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ wasm.fivevmwasm_execute_partial(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(accounts));
332
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
333
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
334
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
335
+ if (r2) {
336
+ throw takeObject(r1);
337
+ }
338
+ return TestResult.__wrap(r0);
339
+ } finally {
340
+ wasm.__wbindgen_add_to_stack_pointer(16);
341
+ }
342
+ }
343
+ /**
344
+ * Get VM constants for JavaScript
345
+ * @returns {any}
346
+ */
347
+ static get_constants() {
348
+ const ret = wasm.fivevmwasm_get_constants();
349
+ return takeObject(ret);
350
+ }
351
+ /**
352
+ * Get current VM state
353
+ * @returns {any}
354
+ */
355
+ get_state() {
356
+ try {
357
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
358
+ wasm.fivevmwasm_get_state(retptr, this.__wbg_ptr);
359
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
360
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
361
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
362
+ if (r2) {
363
+ throw takeObject(r1);
364
+ }
365
+ return takeObject(r0);
366
+ } finally {
367
+ wasm.__wbindgen_add_to_stack_pointer(16);
368
+ }
369
+ }
370
+ /**
371
+ * Create new VM instance with bytecode.
372
+ * @param {Uint8Array} _bytecode
373
+ */
374
+ constructor(_bytecode) {
375
+ try {
376
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
377
+ const ptr0 = passArray8ToWasm0(_bytecode, wasm.__wbindgen_export);
378
+ const len0 = WASM_VECTOR_LEN;
379
+ wasm.fivevmwasm_new(retptr, ptr0, len0);
380
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
381
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
382
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
383
+ if (r2) {
384
+ throw takeObject(r1);
385
+ }
386
+ this.__wbg_ptr = r0 >>> 0;
387
+ FiveVMWasmFinalization.register(this, this.__wbg_ptr, this);
388
+ return this;
389
+ } finally {
390
+ wasm.__wbindgen_add_to_stack_pointer(16);
391
+ }
392
+ }
393
+ /**
394
+ * Validate bytecode without execution
395
+ * @param {Uint8Array} bytecode
396
+ * @returns {boolean}
397
+ */
398
+ static validate_bytecode(bytecode) {
399
+ try {
400
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
401
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
402
+ const len0 = WASM_VECTOR_LEN;
403
+ wasm.fivevmwasm_validate_bytecode(retptr, ptr0, len0);
404
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
405
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
406
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
407
+ if (r2) {
408
+ throw takeObject(r1);
409
+ }
410
+ return r0 !== 0;
411
+ } finally {
412
+ wasm.__wbindgen_add_to_stack_pointer(16);
413
+ }
414
+ }
415
+ }
416
+ if (Symbol.dispose) FiveVMWasm.prototype[Symbol.dispose] = FiveVMWasm.prototype.free;
417
+
418
+ /**
419
+ * Parameter encoding utilities using fixed-size encoding and protocol types
420
+ */
421
+ export class ParameterEncoder {
422
+ __destroy_into_raw() {
423
+ const ptr = this.__wbg_ptr;
424
+ this.__wbg_ptr = 0;
425
+ ParameterEncoderFinalization.unregister(this);
426
+ return ptr;
427
+ }
428
+ free() {
429
+ const ptr = this.__destroy_into_raw();
430
+ wasm.__wbg_parameterencoder_free(ptr, 0);
431
+ }
432
+ /**
433
+ * Encode function parameters using fixed size encoding
434
+ * Returns ONLY parameter data - SDK handles discriminator AND function index
435
+ * @param {number} _function_index
436
+ * @param {Array<any>} params
437
+ * @returns {Uint8Array}
438
+ */
439
+ static encode_execute(_function_index, params) {
440
+ try {
441
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
442
+ wasm.parameterencoder_encode_execute(retptr, _function_index, addHeapObject(params));
443
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
444
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
445
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
446
+ if (r2) {
447
+ throw takeObject(r1);
448
+ }
449
+ return takeObject(r0);
450
+ } finally {
451
+ wasm.__wbindgen_add_to_stack_pointer(16);
452
+ }
453
+ }
454
+ }
455
+ if (Symbol.dispose) ParameterEncoder.prototype[Symbol.dispose] = ParameterEncoder.prototype.free;
456
+
457
+ /**
458
+ * Detailed execution result.
459
+ */
460
+ export class TestResult {
461
+ static __wrap(ptr) {
462
+ ptr = ptr >>> 0;
463
+ const obj = Object.create(TestResult.prototype);
464
+ obj.__wbg_ptr = ptr;
465
+ TestResultFinalization.register(obj, obj.__wbg_ptr, obj);
466
+ return obj;
467
+ }
468
+ __destroy_into_raw() {
469
+ const ptr = this.__wbg_ptr;
470
+ this.__wbg_ptr = 0;
471
+ TestResultFinalization.unregister(this);
472
+ return ptr;
473
+ }
474
+ free() {
475
+ const ptr = this.__destroy_into_raw();
476
+ wasm.__wbg_testresult_free(ptr, 0);
477
+ }
478
+ /**
479
+ * Compute units consumed.
480
+ * @returns {bigint}
481
+ */
482
+ get compute_units_used() {
483
+ const ret = wasm.__wbg_get_testresult_compute_units_used(this.__wbg_ptr);
484
+ return BigInt.asUintN(64, ret);
485
+ }
486
+ /**
487
+ * Final instruction pointer.
488
+ * @returns {number}
489
+ */
490
+ get instruction_pointer() {
491
+ const ret = wasm.__wbg_get_testresult_instruction_pointer(this.__wbg_ptr);
492
+ return ret >>> 0;
493
+ }
494
+ /**
495
+ * Which opcode caused the stop (if stopped at system call).
496
+ * @returns {number | undefined}
497
+ */
498
+ get stopped_at_opcode() {
499
+ const ret = wasm.__wbg_get_testresult_stopped_at_opcode(this.__wbg_ptr);
500
+ return ret === 0xFFFFFF ? undefined : ret;
501
+ }
502
+ /**
503
+ * Compute units consumed.
504
+ * @param {bigint} arg0
505
+ */
506
+ set compute_units_used(arg0) {
507
+ wasm.__wbg_set_testresult_compute_units_used(this.__wbg_ptr, arg0);
508
+ }
509
+ /**
510
+ * Final instruction pointer.
511
+ * @param {number} arg0
512
+ */
513
+ set instruction_pointer(arg0) {
514
+ wasm.__wbg_set_testresult_instruction_pointer(this.__wbg_ptr, arg0);
515
+ }
516
+ /**
517
+ * Which opcode caused the stop (if stopped at system call).
518
+ * @param {number | null} [arg0]
519
+ */
520
+ set stopped_at_opcode(arg0) {
521
+ wasm.__wbg_set_testresult_stopped_at_opcode(this.__wbg_ptr, isLikeNone(arg0) ? 0xFFFFFF : arg0);
522
+ }
523
+ /**
524
+ * @returns {string | undefined}
525
+ */
526
+ get error_message() {
527
+ try {
528
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
529
+ wasm.testresult_error_message(retptr, this.__wbg_ptr);
530
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
531
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
532
+ let v1;
533
+ if (r0 !== 0) {
534
+ v1 = getStringFromWasm0(r0, r1).slice();
535
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
536
+ }
537
+ return v1;
538
+ } finally {
539
+ wasm.__wbindgen_add_to_stack_pointer(16);
540
+ }
541
+ }
542
+ /**
543
+ * @returns {string | undefined}
544
+ */
545
+ get execution_context() {
546
+ try {
547
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
548
+ wasm.testresult_execution_context(retptr, this.__wbg_ptr);
549
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
550
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
551
+ let v1;
552
+ if (r0 !== 0) {
553
+ v1 = getStringFromWasm0(r0, r1).slice();
554
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
555
+ }
556
+ return v1;
557
+ } finally {
558
+ wasm.__wbindgen_add_to_stack_pointer(16);
559
+ }
560
+ }
561
+ /**
562
+ * @returns {Array<any>}
563
+ */
564
+ get final_accounts() {
565
+ const ret = wasm.testresult_final_accounts(this.__wbg_ptr);
566
+ return takeObject(ret);
567
+ }
568
+ /**
569
+ * @returns {Uint8Array}
570
+ */
571
+ get final_memory() {
572
+ const ret = wasm.testresult_final_memory(this.__wbg_ptr);
573
+ return takeObject(ret);
574
+ }
575
+ /**
576
+ * @returns {Array<any>}
577
+ */
578
+ get final_stack() {
579
+ const ret = wasm.testresult_final_stack(this.__wbg_ptr);
580
+ return takeObject(ret);
581
+ }
582
+ /**
583
+ * @returns {any}
584
+ */
585
+ get get_result_value() {
586
+ const ret = wasm.testresult_get_result_value(this.__wbg_ptr);
587
+ return takeObject(ret);
588
+ }
589
+ /**
590
+ * @returns {boolean}
591
+ */
592
+ get has_result_value() {
593
+ const ret = wasm.testresult_has_result_value(this.__wbg_ptr);
594
+ return ret !== 0;
595
+ }
596
+ /**
597
+ * @returns {string}
598
+ */
599
+ get status() {
600
+ let deferred1_0;
601
+ let deferred1_1;
602
+ try {
603
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
604
+ wasm.testresult_status(retptr, this.__wbg_ptr);
605
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
606
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
607
+ deferred1_0 = r0;
608
+ deferred1_1 = r1;
609
+ return getStringFromWasm0(r0, r1);
610
+ } finally {
611
+ wasm.__wbindgen_add_to_stack_pointer(16);
612
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
613
+ }
614
+ }
615
+ /**
616
+ * @returns {string | undefined}
617
+ */
618
+ get stopped_at_opcode_name() {
619
+ try {
620
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
621
+ wasm.testresult_stopped_at_opcode_name(retptr, this.__wbg_ptr);
622
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
623
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
624
+ let v1;
625
+ if (r0 !== 0) {
626
+ v1 = getStringFromWasm0(r0, r1).slice();
627
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
628
+ }
629
+ return v1;
630
+ } finally {
631
+ wasm.__wbindgen_add_to_stack_pointer(16);
632
+ }
633
+ }
634
+ }
635
+ if (Symbol.dispose) TestResult.prototype[Symbol.dispose] = TestResult.prototype.free;
636
+
637
+ /**
638
+ * JavaScript-compatible account representation.
639
+ */
640
+ export class WasmAccount {
641
+ __destroy_into_raw() {
642
+ const ptr = this.__wbg_ptr;
643
+ this.__wbg_ptr = 0;
644
+ WasmAccountFinalization.unregister(this);
645
+ return ptr;
646
+ }
647
+ free() {
648
+ const ptr = this.__destroy_into_raw();
649
+ wasm.__wbg_wasmaccount_free(ptr, 0);
650
+ }
651
+ /**
652
+ * @returns {boolean}
653
+ */
654
+ get is_signer() {
655
+ const ret = wasm.__wbg_get_wasmaccount_is_signer(this.__wbg_ptr);
656
+ return ret !== 0;
657
+ }
658
+ /**
659
+ * @returns {boolean}
660
+ */
661
+ get is_writable() {
662
+ const ret = wasm.__wbg_get_wasmaccount_is_writable(this.__wbg_ptr);
663
+ return ret !== 0;
664
+ }
665
+ /**
666
+ * @returns {bigint}
667
+ */
668
+ get lamports() {
669
+ const ret = wasm.__wbg_get_wasmaccount_lamports(this.__wbg_ptr);
670
+ return BigInt.asUintN(64, ret);
671
+ }
672
+ /**
673
+ * @param {boolean} arg0
674
+ */
675
+ set is_signer(arg0) {
676
+ wasm.__wbg_set_wasmaccount_is_signer(this.__wbg_ptr, arg0);
677
+ }
678
+ /**
679
+ * @param {boolean} arg0
680
+ */
681
+ set is_writable(arg0) {
682
+ wasm.__wbg_set_wasmaccount_is_writable(this.__wbg_ptr, arg0);
683
+ }
684
+ /**
685
+ * @param {bigint} arg0
686
+ */
687
+ set lamports(arg0) {
688
+ wasm.__wbg_set_wasmaccount_lamports(this.__wbg_ptr, arg0);
689
+ }
690
+ /**
691
+ * @returns {Uint8Array}
692
+ */
693
+ get data() {
694
+ const ret = wasm.wasmaccount_data(this.__wbg_ptr);
695
+ return takeObject(ret);
696
+ }
697
+ /**
698
+ * @returns {Uint8Array}
699
+ */
700
+ get key() {
701
+ const ret = wasm.wasmaccount_key(this.__wbg_ptr);
702
+ return takeObject(ret);
703
+ }
704
+ /**
705
+ * @param {Uint8Array} key
706
+ * @param {Uint8Array} data
707
+ * @param {bigint} lamports
708
+ * @param {boolean} is_writable
709
+ * @param {boolean} is_signer
710
+ * @param {Uint8Array} owner
711
+ */
712
+ constructor(key, data, lamports, is_writable, is_signer, owner) {
713
+ try {
714
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
715
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_export);
716
+ const len0 = WASM_VECTOR_LEN;
717
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
718
+ const len1 = WASM_VECTOR_LEN;
719
+ const ptr2 = passArray8ToWasm0(owner, wasm.__wbindgen_export);
720
+ const len2 = WASM_VECTOR_LEN;
721
+ wasm.wasmaccount_new(retptr, ptr0, len0, ptr1, len1, lamports, is_writable, is_signer, ptr2, len2);
722
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
723
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
724
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
725
+ if (r2) {
726
+ throw takeObject(r1);
727
+ }
728
+ this.__wbg_ptr = r0 >>> 0;
729
+ WasmAccountFinalization.register(this, this.__wbg_ptr, this);
730
+ return this;
731
+ } finally {
732
+ wasm.__wbindgen_add_to_stack_pointer(16);
733
+ }
734
+ }
735
+ /**
736
+ * @returns {Uint8Array}
737
+ */
738
+ get owner() {
739
+ const ret = wasm.wasmaccount_owner(this.__wbg_ptr);
740
+ return takeObject(ret);
741
+ }
742
+ /**
743
+ * @param {Uint8Array} data
744
+ */
745
+ set data(data) {
746
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
747
+ const len0 = WASM_VECTOR_LEN;
748
+ wasm.wasmaccount_set_data(this.__wbg_ptr, ptr0, len0);
749
+ }
750
+ }
751
+ if (Symbol.dispose) WasmAccount.prototype[Symbol.dispose] = WasmAccount.prototype.free;
752
+
753
+ /**
754
+ * WASM source analysis result
755
+ */
756
+ export class WasmAnalysisResult {
757
+ static __wrap(ptr) {
758
+ ptr = ptr >>> 0;
759
+ const obj = Object.create(WasmAnalysisResult.prototype);
760
+ obj.__wbg_ptr = ptr;
761
+ WasmAnalysisResultFinalization.register(obj, obj.__wbg_ptr, obj);
762
+ return obj;
763
+ }
764
+ __destroy_into_raw() {
765
+ const ptr = this.__wbg_ptr;
766
+ this.__wbg_ptr = 0;
767
+ WasmAnalysisResultFinalization.unregister(this);
768
+ return ptr;
769
+ }
770
+ free() {
771
+ const ptr = this.__destroy_into_raw();
772
+ wasm.__wbg_wasmanalysisresult_free(ptr, 0);
773
+ }
774
+ /**
775
+ * Analysis time in milliseconds
776
+ * @returns {number}
777
+ */
778
+ get analysis_time() {
779
+ const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
780
+ return ret;
781
+ }
782
+ /**
783
+ * Whether analysis succeeded
784
+ * @returns {boolean}
785
+ */
786
+ get success() {
787
+ const ret = wasm.__wbg_get_wasmanalysisresult_success(this.__wbg_ptr);
788
+ return ret !== 0;
789
+ }
790
+ /**
791
+ * Analysis time in milliseconds
792
+ * @param {number} arg0
793
+ */
794
+ set analysis_time(arg0) {
795
+ wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
796
+ }
797
+ /**
798
+ * Whether analysis succeeded
799
+ * @param {boolean} arg0
800
+ */
801
+ set success(arg0) {
802
+ wasm.__wbg_set_wasmanalysisresult_success(this.__wbg_ptr, arg0);
803
+ }
804
+ /**
805
+ * @returns {Array<any>}
806
+ */
807
+ get errors() {
808
+ const ret = wasm.wasmanalysisresult_errors(this.__wbg_ptr);
809
+ return takeObject(ret);
810
+ }
811
+ /**
812
+ * Get parsed metrics as JavaScript object
813
+ * @returns {any}
814
+ */
815
+ get_metrics_object() {
816
+ try {
817
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
818
+ wasm.wasmanalysisresult_get_metrics_object(retptr, this.__wbg_ptr);
819
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
820
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
821
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
822
+ if (r2) {
823
+ throw takeObject(r1);
824
+ }
825
+ return takeObject(r0);
826
+ } finally {
827
+ wasm.__wbindgen_add_to_stack_pointer(16);
828
+ }
829
+ }
830
+ /**
831
+ * @returns {string}
832
+ */
833
+ get metrics() {
834
+ let deferred1_0;
835
+ let deferred1_1;
836
+ try {
837
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
838
+ wasm.wasmanalysisresult_metrics(retptr, this.__wbg_ptr);
839
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
840
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
841
+ deferred1_0 = r0;
842
+ deferred1_1 = r1;
843
+ return getStringFromWasm0(r0, r1);
844
+ } finally {
845
+ wasm.__wbindgen_add_to_stack_pointer(16);
846
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
847
+ }
848
+ }
849
+ /**
850
+ * @returns {string}
851
+ */
852
+ get summary() {
853
+ let deferred1_0;
854
+ let deferred1_1;
855
+ try {
856
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
857
+ wasm.wasmanalysisresult_summary(retptr, this.__wbg_ptr);
858
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
859
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
860
+ deferred1_0 = r0;
861
+ deferred1_1 = r1;
862
+ return getStringFromWasm0(r0, r1);
863
+ } finally {
864
+ wasm.__wbindgen_add_to_stack_pointer(16);
865
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
866
+ }
867
+ }
868
+ }
869
+ if (Symbol.dispose) WasmAnalysisResult.prototype[Symbol.dispose] = WasmAnalysisResult.prototype.free;
870
+
871
+ /**
872
+ * Compilation options for enhanced error reporting and formatting
873
+ */
874
+ export class WasmCompilationOptions {
875
+ static __wrap(ptr) {
876
+ ptr = ptr >>> 0;
877
+ const obj = Object.create(WasmCompilationOptions.prototype);
878
+ obj.__wbg_ptr = ptr;
879
+ WasmCompilationOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
880
+ return obj;
881
+ }
882
+ __destroy_into_raw() {
883
+ const ptr = this.__wbg_ptr;
884
+ this.__wbg_ptr = 0;
885
+ WasmCompilationOptionsFinalization.unregister(this);
886
+ return ptr;
887
+ }
888
+ free() {
889
+ const ptr = this.__destroy_into_raw();
890
+ wasm.__wbg_wasmcompilationoptions_free(ptr, 0);
891
+ }
892
+ /**
893
+ * Include complexity analysis
894
+ * @returns {boolean}
895
+ */
896
+ get complexity_analysis() {
897
+ const ret = wasm.__wbg_get_wasmcompilationoptions_complexity_analysis(this.__wbg_ptr);
898
+ return ret !== 0;
899
+ }
900
+ /**
901
+ * Include comprehensive metrics collection
902
+ * @returns {boolean}
903
+ */
904
+ get comprehensive_metrics() {
905
+ const ret = wasm.__wbg_get_wasmcompilationoptions_comprehensive_metrics(this.__wbg_ptr);
906
+ return ret !== 0;
907
+ }
908
+ /**
909
+ * Enable bytecode compression
910
+ * @returns {boolean}
911
+ */
912
+ get compress_output() {
913
+ const ret = wasm.__wbg_get_wasmcompilationoptions_compress_output(this.__wbg_ptr);
914
+ return ret !== 0;
915
+ }
916
+ /**
917
+ * Disable REQUIRE_BATCH lowering in compiler pipeline.
918
+ * @returns {boolean}
919
+ */
920
+ get disable_require_batch() {
921
+ const ret = wasm.__wbg_get_wasmcompilationoptions_disable_require_batch(this.__wbg_ptr);
922
+ return ret !== 0;
923
+ }
924
+ /**
925
+ * Enable constraint caching optimization
926
+ * @returns {boolean}
927
+ */
928
+ get enable_constraint_cache() {
929
+ const ret = wasm.__wbg_get_wasmcompilationoptions_enable_constraint_cache(this.__wbg_ptr);
930
+ return ret !== 0;
931
+ }
932
+ /**
933
+ * Enable module namespace qualification (module::function)
934
+ * @returns {boolean}
935
+ */
936
+ get enable_module_namespaces() {
937
+ const ret = wasm.__wbg_get_wasmcompilationoptions_enable_module_namespaces(this.__wbg_ptr);
938
+ return ret !== 0;
939
+ }
940
+ /**
941
+ * Enable enhanced error reporting with suggestions
942
+ * @returns {boolean}
943
+ */
944
+ get enhanced_errors() {
945
+ const ret = wasm.__wbg_get_wasmcompilationoptions_enhanced_errors(this.__wbg_ptr);
946
+ return ret !== 0;
947
+ }
948
+ /**
949
+ * Include debug information
950
+ * @returns {boolean}
951
+ */
952
+ get include_debug_info() {
953
+ const ret = wasm.__wbg_get_wasmcompilationoptions_include_debug_info(this.__wbg_ptr);
954
+ return ret !== 0;
955
+ }
956
+ /**
957
+ * Include basic metrics
958
+ * @returns {boolean}
959
+ */
960
+ get include_metrics() {
961
+ const ret = wasm.__wbg_get_wasmcompilationoptions_include_metrics(this.__wbg_ptr);
962
+ return ret !== 0;
963
+ }
964
+ /**
965
+ * Include performance analysis
966
+ * @returns {boolean}
967
+ */
968
+ get performance_analysis() {
969
+ const ret = wasm.__wbg_get_wasmcompilationoptions_performance_analysis(this.__wbg_ptr);
970
+ return ret !== 0;
971
+ }
972
+ /**
973
+ * Suppress non-essential output
974
+ * @returns {boolean}
975
+ */
976
+ get quiet() {
977
+ const ret = wasm.__wbg_get_wasmcompilationoptions_quiet(this.__wbg_ptr);
978
+ return ret !== 0;
979
+ }
980
+ /**
981
+ * Show compilation summary
982
+ * @returns {boolean}
983
+ */
984
+ get summary() {
985
+ const ret = wasm.__wbg_get_wasmcompilationoptions_summary(this.__wbg_ptr);
986
+ return ret !== 0;
987
+ }
988
+ /**
989
+ * Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
990
+ * @returns {boolean}
991
+ */
992
+ get v2_preview() {
993
+ const ret = wasm.__wbg_get_wasmcompilationoptions_v2_preview(this.__wbg_ptr);
994
+ return ret !== 0;
995
+ }
996
+ /**
997
+ * Verbose output
998
+ * @returns {boolean}
999
+ */
1000
+ get verbose() {
1001
+ const ret = wasm.__wbg_get_wasmcompilationoptions_verbose(this.__wbg_ptr);
1002
+ return ret !== 0;
1003
+ }
1004
+ /**
1005
+ * Include complexity analysis
1006
+ * @param {boolean} arg0
1007
+ */
1008
+ set complexity_analysis(arg0) {
1009
+ wasm.__wbg_set_wasmcompilationoptions_complexity_analysis(this.__wbg_ptr, arg0);
1010
+ }
1011
+ /**
1012
+ * Include comprehensive metrics collection
1013
+ * @param {boolean} arg0
1014
+ */
1015
+ set comprehensive_metrics(arg0) {
1016
+ wasm.__wbg_set_wasmcompilationoptions_comprehensive_metrics(this.__wbg_ptr, arg0);
1017
+ }
1018
+ /**
1019
+ * Enable bytecode compression
1020
+ * @param {boolean} arg0
1021
+ */
1022
+ set compress_output(arg0) {
1023
+ wasm.__wbg_set_wasmcompilationoptions_compress_output(this.__wbg_ptr, arg0);
1024
+ }
1025
+ /**
1026
+ * Disable REQUIRE_BATCH lowering in compiler pipeline.
1027
+ * @param {boolean} arg0
1028
+ */
1029
+ set disable_require_batch(arg0) {
1030
+ wasm.__wbg_set_wasmcompilationoptions_disable_require_batch(this.__wbg_ptr, arg0);
1031
+ }
1032
+ /**
1033
+ * Enable constraint caching optimization
1034
+ * @param {boolean} arg0
1035
+ */
1036
+ set enable_constraint_cache(arg0) {
1037
+ wasm.__wbg_set_wasmcompilationoptions_enable_constraint_cache(this.__wbg_ptr, arg0);
1038
+ }
1039
+ /**
1040
+ * Enable module namespace qualification (module::function)
1041
+ * @param {boolean} arg0
1042
+ */
1043
+ set enable_module_namespaces(arg0) {
1044
+ wasm.__wbg_set_wasmcompilationoptions_enable_module_namespaces(this.__wbg_ptr, arg0);
1045
+ }
1046
+ /**
1047
+ * Enable enhanced error reporting with suggestions
1048
+ * @param {boolean} arg0
1049
+ */
1050
+ set enhanced_errors(arg0) {
1051
+ wasm.__wbg_set_wasmcompilationoptions_enhanced_errors(this.__wbg_ptr, arg0);
1052
+ }
1053
+ /**
1054
+ * Include debug information
1055
+ * @param {boolean} arg0
1056
+ */
1057
+ set include_debug_info(arg0) {
1058
+ wasm.__wbg_set_wasmcompilationoptions_include_debug_info(this.__wbg_ptr, arg0);
1059
+ }
1060
+ /**
1061
+ * Include basic metrics
1062
+ * @param {boolean} arg0
1063
+ */
1064
+ set include_metrics(arg0) {
1065
+ wasm.__wbg_set_wasmcompilationoptions_include_metrics(this.__wbg_ptr, arg0);
1066
+ }
1067
+ /**
1068
+ * Include performance analysis
1069
+ * @param {boolean} arg0
1070
+ */
1071
+ set performance_analysis(arg0) {
1072
+ wasm.__wbg_set_wasmcompilationoptions_performance_analysis(this.__wbg_ptr, arg0);
1073
+ }
1074
+ /**
1075
+ * Suppress non-essential output
1076
+ * @param {boolean} arg0
1077
+ */
1078
+ set quiet(arg0) {
1079
+ wasm.__wbg_set_wasmcompilationoptions_quiet(this.__wbg_ptr, arg0);
1080
+ }
1081
+ /**
1082
+ * Show compilation summary
1083
+ * @param {boolean} arg0
1084
+ */
1085
+ set summary(arg0) {
1086
+ wasm.__wbg_set_wasmcompilationoptions_summary(this.__wbg_ptr, arg0);
1087
+ }
1088
+ /**
1089
+ * Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
1090
+ * @param {boolean} arg0
1091
+ */
1092
+ set v2_preview(arg0) {
1093
+ wasm.__wbg_set_wasmcompilationoptions_v2_preview(this.__wbg_ptr, arg0);
1094
+ }
1095
+ /**
1096
+ * Verbose output
1097
+ * @param {boolean} arg0
1098
+ */
1099
+ set verbose(arg0) {
1100
+ wasm.__wbg_set_wasmcompilationoptions_verbose(this.__wbg_ptr, arg0);
1101
+ }
1102
+ /**
1103
+ * @returns {string}
1104
+ */
1105
+ get analysis_depth() {
1106
+ let deferred1_0;
1107
+ let deferred1_1;
1108
+ try {
1109
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1110
+ wasm.wasmcompilationoptions_analysis_depth(retptr, this.__wbg_ptr);
1111
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1112
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1113
+ deferred1_0 = r0;
1114
+ deferred1_1 = r1;
1115
+ return getStringFromWasm0(r0, r1);
1116
+ } finally {
1117
+ wasm.__wbindgen_add_to_stack_pointer(16);
1118
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1119
+ }
1120
+ }
1121
+ /**
1122
+ * Create development-debug configuration
1123
+ * @returns {WasmCompilationOptions}
1124
+ */
1125
+ static development_debug() {
1126
+ const ret = wasm.wasmcompilationoptions_development_debug();
1127
+ return WasmCompilationOptions.__wrap(ret);
1128
+ }
1129
+ /**
1130
+ * @returns {string}
1131
+ */
1132
+ get error_format() {
1133
+ let deferred1_0;
1134
+ let deferred1_1;
1135
+ try {
1136
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1137
+ wasm.wasmcompilationoptions_error_format(retptr, this.__wbg_ptr);
1138
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1139
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1140
+ deferred1_0 = r0;
1141
+ deferred1_1 = r1;
1142
+ return getStringFromWasm0(r0, r1);
1143
+ } finally {
1144
+ wasm.__wbindgen_add_to_stack_pointer(16);
1145
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1146
+ }
1147
+ }
1148
+ /**
1149
+ * @returns {string}
1150
+ */
1151
+ get export_format() {
1152
+ let deferred1_0;
1153
+ let deferred1_1;
1154
+ try {
1155
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1156
+ wasm.wasmcompilationoptions_export_format(retptr, this.__wbg_ptr);
1157
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1158
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1159
+ deferred1_0 = r0;
1160
+ deferred1_1 = r1;
1161
+ return getStringFromWasm0(r0, r1);
1162
+ } finally {
1163
+ wasm.__wbindgen_add_to_stack_pointer(16);
1164
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1165
+ }
1166
+ }
1167
+ /**
1168
+ * Create fast iteration configuration
1169
+ * @returns {WasmCompilationOptions}
1170
+ */
1171
+ static fast_iteration() {
1172
+ const ret = wasm.wasmcompilationoptions_fast_iteration();
1173
+ return WasmCompilationOptions.__wrap(ret);
1174
+ }
1175
+ /**
1176
+ * @returns {string}
1177
+ */
1178
+ get metrics_format() {
1179
+ let deferred1_0;
1180
+ let deferred1_1;
1181
+ try {
1182
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1183
+ wasm.wasmcompilationoptions_metrics_format(retptr, this.__wbg_ptr);
1184
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1185
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1186
+ deferred1_0 = r0;
1187
+ deferred1_1 = r1;
1188
+ return getStringFromWasm0(r0, r1);
1189
+ } finally {
1190
+ wasm.__wbindgen_add_to_stack_pointer(16);
1191
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1192
+ }
1193
+ }
1194
+ /**
1195
+ * @returns {string}
1196
+ */
1197
+ get mode() {
1198
+ let deferred1_0;
1199
+ let deferred1_1;
1200
+ try {
1201
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1202
+ wasm.wasmcompilationoptions_mode(retptr, this.__wbg_ptr);
1203
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1204
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1205
+ deferred1_0 = r0;
1206
+ deferred1_1 = r1;
1207
+ return getStringFromWasm0(r0, r1);
1208
+ } finally {
1209
+ wasm.__wbindgen_add_to_stack_pointer(16);
1210
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1211
+ }
1212
+ }
1213
+ /**
1214
+ * Create default compilation options
1215
+ */
1216
+ constructor() {
1217
+ const ret = wasm.wasmcompilationoptions_new();
1218
+ this.__wbg_ptr = ret >>> 0;
1219
+ WasmCompilationOptionsFinalization.register(this, this.__wbg_ptr, this);
1220
+ return this;
1221
+ }
1222
+ /**
1223
+ * @returns {string}
1224
+ */
1225
+ get optimization_level() {
1226
+ let deferred1_0;
1227
+ let deferred1_1;
1228
+ try {
1229
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1230
+ wasm.wasmcompilationoptions_optimization_level(retptr, this.__wbg_ptr);
1231
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1232
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1233
+ deferred1_0 = r0;
1234
+ deferred1_1 = r1;
1235
+ return getStringFromWasm0(r0, r1);
1236
+ } finally {
1237
+ wasm.__wbindgen_add_to_stack_pointer(16);
1238
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1239
+ }
1240
+ }
1241
+ /**
1242
+ * Create production-optimized configuration
1243
+ * @returns {WasmCompilationOptions}
1244
+ */
1245
+ static production_optimized() {
1246
+ const ret = wasm.wasmcompilationoptions_production_optimized();
1247
+ return WasmCompilationOptions.__wrap(ret);
1248
+ }
1249
+ /**
1250
+ * @returns {string | undefined}
1251
+ */
1252
+ get source_file() {
1253
+ try {
1254
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1255
+ wasm.wasmcompilationoptions_source_file(retptr, this.__wbg_ptr);
1256
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1257
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1258
+ let v1;
1259
+ if (r0 !== 0) {
1260
+ v1 = getStringFromWasm0(r0, r1).slice();
1261
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1262
+ }
1263
+ return v1;
1264
+ } finally {
1265
+ wasm.__wbindgen_add_to_stack_pointer(16);
1266
+ }
1267
+ }
1268
+ /**
1269
+ * Set analysis depth level
1270
+ * @param {string} depth
1271
+ * @returns {WasmCompilationOptions}
1272
+ */
1273
+ with_analysis_depth(depth) {
1274
+ const ptr = this.__destroy_into_raw();
1275
+ const ptr0 = passStringToWasm0(depth, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1276
+ const len0 = WASM_VECTOR_LEN;
1277
+ const ret = wasm.wasmcompilationoptions_with_analysis_depth(ptr, ptr0, len0);
1278
+ return WasmCompilationOptions.__wrap(ret);
1279
+ }
1280
+ /**
1281
+ * Enable or disable complexity analysis
1282
+ * @param {boolean} enabled
1283
+ * @returns {WasmCompilationOptions}
1284
+ */
1285
+ with_complexity_analysis(enabled) {
1286
+ const ptr = this.__destroy_into_raw();
1287
+ const ret = wasm.wasmcompilationoptions_with_complexity_analysis(ptr, enabled);
1288
+ return WasmCompilationOptions.__wrap(ret);
1289
+ }
1290
+ /**
1291
+ * Enable or disable comprehensive metrics collection
1292
+ * @param {boolean} enabled
1293
+ * @returns {WasmCompilationOptions}
1294
+ */
1295
+ with_comprehensive_metrics(enabled) {
1296
+ const ptr = this.__destroy_into_raw();
1297
+ const ret = wasm.wasmcompilationoptions_with_comprehensive_metrics(ptr, enabled);
1298
+ return WasmCompilationOptions.__wrap(ret);
1299
+ }
1300
+ /**
1301
+ * Enable or disable bytecode compression
1302
+ * @param {boolean} enabled
1303
+ * @returns {WasmCompilationOptions}
1304
+ */
1305
+ with_compression(enabled) {
1306
+ const ptr = this.__destroy_into_raw();
1307
+ const ret = wasm.wasmcompilationoptions_with_compression(ptr, enabled);
1308
+ return WasmCompilationOptions.__wrap(ret);
1309
+ }
1310
+ /**
1311
+ * Enable or disable constraint caching optimization
1312
+ * @param {boolean} enabled
1313
+ * @returns {WasmCompilationOptions}
1314
+ */
1315
+ with_constraint_cache(enabled) {
1316
+ const ptr = this.__destroy_into_raw();
1317
+ const ret = wasm.wasmcompilationoptions_with_constraint_cache(ptr, enabled);
1318
+ return WasmCompilationOptions.__wrap(ret);
1319
+ }
1320
+ /**
1321
+ * Enable or disable debug information
1322
+ * @param {boolean} enabled
1323
+ * @returns {WasmCompilationOptions}
1324
+ */
1325
+ with_debug_info(enabled) {
1326
+ const ptr = this.__destroy_into_raw();
1327
+ const ret = wasm.wasmcompilationoptions_with_debug_info(ptr, enabled);
1328
+ return WasmCompilationOptions.__wrap(ret);
1329
+ }
1330
+ /**
1331
+ * Enable or disable REQUIRE_BATCH lowering.
1332
+ * @param {boolean} enabled
1333
+ * @returns {WasmCompilationOptions}
1334
+ */
1335
+ with_disable_require_batch(enabled) {
1336
+ const ptr = this.__destroy_into_raw();
1337
+ const ret = wasm.wasmcompilationoptions_with_disable_require_batch(ptr, enabled);
1338
+ return WasmCompilationOptions.__wrap(ret);
1339
+ }
1340
+ /**
1341
+ * Enable or disable enhanced error reporting
1342
+ * @param {boolean} enabled
1343
+ * @returns {WasmCompilationOptions}
1344
+ */
1345
+ with_enhanced_errors(enabled) {
1346
+ const ptr = this.__destroy_into_raw();
1347
+ const ret = wasm.wasmcompilationoptions_with_enhanced_errors(ptr, enabled);
1348
+ return WasmCompilationOptions.__wrap(ret);
1349
+ }
1350
+ /**
1351
+ * Set error output format
1352
+ * @param {string} format
1353
+ * @returns {WasmCompilationOptions}
1354
+ */
1355
+ with_error_format(format) {
1356
+ const ptr = this.__destroy_into_raw();
1357
+ const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1358
+ const len0 = WASM_VECTOR_LEN;
1359
+ const ret = wasm.wasmcompilationoptions_with_error_format(ptr, ptr0, len0);
1360
+ return WasmCompilationOptions.__wrap(ret);
1361
+ }
1362
+ /**
1363
+ * Set export format
1364
+ * @param {string} format
1365
+ * @returns {WasmCompilationOptions}
1366
+ */
1367
+ with_export_format(format) {
1368
+ const ptr = this.__destroy_into_raw();
1369
+ const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1370
+ const len0 = WASM_VECTOR_LEN;
1371
+ const ret = wasm.wasmcompilationoptions_with_export_format(ptr, ptr0, len0);
1372
+ return WasmCompilationOptions.__wrap(ret);
1373
+ }
1374
+ /**
1375
+ * Enable or disable basic metrics collection
1376
+ * @param {boolean} enabled
1377
+ * @returns {WasmCompilationOptions}
1378
+ */
1379
+ with_metrics(enabled) {
1380
+ const ptr = this.__destroy_into_raw();
1381
+ const ret = wasm.wasmcompilationoptions_with_metrics(ptr, enabled);
1382
+ return WasmCompilationOptions.__wrap(ret);
1383
+ }
1384
+ /**
1385
+ * Set metrics export format
1386
+ * @param {string} format
1387
+ * @returns {WasmCompilationOptions}
1388
+ */
1389
+ with_metrics_format(format) {
1390
+ const ptr = this.__destroy_into_raw();
1391
+ const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1392
+ const len0 = WASM_VECTOR_LEN;
1393
+ const ret = wasm.wasmcompilationoptions_with_metrics_format(ptr, ptr0, len0);
1394
+ return WasmCompilationOptions.__wrap(ret);
1395
+ }
1396
+ /**
1397
+ * Set compilation mode
1398
+ * @param {string} mode
1399
+ * @returns {WasmCompilationOptions}
1400
+ */
1401
+ with_mode(mode) {
1402
+ const ptr = this.__destroy_into_raw();
1403
+ const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1404
+ const len0 = WASM_VECTOR_LEN;
1405
+ const ret = wasm.wasmcompilationoptions_with_mode(ptr, ptr0, len0);
1406
+ return WasmCompilationOptions.__wrap(ret);
1407
+ }
1408
+ /**
1409
+ * Enable or disable module namespace qualification
1410
+ * @param {boolean} enabled
1411
+ * @returns {WasmCompilationOptions}
1412
+ */
1413
+ with_module_namespaces(enabled) {
1414
+ const ptr = this.__destroy_into_raw();
1415
+ const ret = wasm.wasmcompilationoptions_with_module_namespaces(ptr, enabled);
1416
+ return WasmCompilationOptions.__wrap(ret);
1417
+ }
1418
+ /**
1419
+ * Set optimization level (production)
1420
+ * @param {string} level
1421
+ * @returns {WasmCompilationOptions}
1422
+ */
1423
+ with_optimization_level(level) {
1424
+ const ptr = this.__destroy_into_raw();
1425
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1426
+ const len0 = WASM_VECTOR_LEN;
1427
+ const ret = wasm.wasmcompilationoptions_with_optimization_level(ptr, ptr0, len0);
1428
+ return WasmCompilationOptions.__wrap(ret);
1429
+ }
1430
+ /**
1431
+ * Enable or disable performance analysis
1432
+ * @param {boolean} enabled
1433
+ * @returns {WasmCompilationOptions}
1434
+ */
1435
+ with_performance_analysis(enabled) {
1436
+ const ptr = this.__destroy_into_raw();
1437
+ const ret = wasm.wasmcompilationoptions_with_performance_analysis(ptr, enabled);
1438
+ return WasmCompilationOptions.__wrap(ret);
1439
+ }
1440
+ /**
1441
+ * Enable or disable quiet mode
1442
+ * @param {boolean} enabled
1443
+ * @returns {WasmCompilationOptions}
1444
+ */
1445
+ with_quiet(enabled) {
1446
+ const ptr = this.__destroy_into_raw();
1447
+ const ret = wasm.wasmcompilationoptions_with_quiet(ptr, enabled);
1448
+ return WasmCompilationOptions.__wrap(ret);
1449
+ }
1450
+ /**
1451
+ * Set source file name for better error reporting
1452
+ * @param {string} filename
1453
+ * @returns {WasmCompilationOptions}
1454
+ */
1455
+ with_source_file(filename) {
1456
+ const ptr = this.__destroy_into_raw();
1457
+ const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1458
+ const len0 = WASM_VECTOR_LEN;
1459
+ const ret = wasm.wasmcompilationoptions_with_source_file(ptr, ptr0, len0);
1460
+ return WasmCompilationOptions.__wrap(ret);
1461
+ }
1462
+ /**
1463
+ * Enable or disable compilation summary
1464
+ * @param {boolean} enabled
1465
+ * @returns {WasmCompilationOptions}
1466
+ */
1467
+ with_summary(enabled) {
1468
+ const ptr = this.__destroy_into_raw();
1469
+ const ret = wasm.wasmcompilationoptions_with_summary(ptr, enabled);
1470
+ return WasmCompilationOptions.__wrap(ret);
1471
+ }
1472
+ /**
1473
+ * Enable or disable v2-preview features
1474
+ * @param {boolean} enabled
1475
+ * @returns {WasmCompilationOptions}
1476
+ */
1477
+ with_v2_preview(enabled) {
1478
+ const ptr = this.__destroy_into_raw();
1479
+ const ret = wasm.wasmcompilationoptions_with_v2_preview(ptr, enabled);
1480
+ return WasmCompilationOptions.__wrap(ret);
1481
+ }
1482
+ /**
1483
+ * Enable or disable verbose output
1484
+ * @param {boolean} enabled
1485
+ * @returns {WasmCompilationOptions}
1486
+ */
1487
+ with_verbose(enabled) {
1488
+ const ptr = this.__destroy_into_raw();
1489
+ const ret = wasm.wasmcompilationoptions_with_verbose(ptr, enabled);
1490
+ return WasmCompilationOptions.__wrap(ret);
1491
+ }
1492
+ }
1493
+ if (Symbol.dispose) WasmCompilationOptions.prototype[Symbol.dispose] = WasmCompilationOptions.prototype.free;
1494
+
1495
+ /**
1496
+ * WASM compilation result - unified with enhanced error support
1497
+ */
1498
+ export class WasmCompilationResult {
1499
+ static __wrap(ptr) {
1500
+ ptr = ptr >>> 0;
1501
+ const obj = Object.create(WasmCompilationResult.prototype);
1502
+ obj.__wbg_ptr = ptr;
1503
+ WasmCompilationResultFinalization.register(obj, obj.__wbg_ptr, obj);
1504
+ return obj;
1505
+ }
1506
+ __destroy_into_raw() {
1507
+ const ptr = this.__wbg_ptr;
1508
+ this.__wbg_ptr = 0;
1509
+ WasmCompilationResultFinalization.unregister(this);
1510
+ return ptr;
1511
+ }
1512
+ free() {
1513
+ const ptr = this.__destroy_into_raw();
1514
+ wasm.__wbg_wasmcompilationresult_free(ptr, 0);
1515
+ }
1516
+ /**
1517
+ * Size of generated bytecode
1518
+ * @returns {number}
1519
+ */
1520
+ get bytecode_size() {
1521
+ const ret = wasm.__wbg_get_wasmcompilationresult_bytecode_size(this.__wbg_ptr);
1522
+ return ret >>> 0;
1523
+ }
1524
+ /**
1525
+ * Compilation time in milliseconds
1526
+ * @returns {number}
1527
+ */
1528
+ get compilation_time() {
1529
+ const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
1530
+ return ret;
1531
+ }
1532
+ /**
1533
+ * Total error count
1534
+ * @returns {number}
1535
+ */
1536
+ get error_count() {
1537
+ const ret = wasm.__wbg_get_wasmcompilationresult_error_count(this.__wbg_ptr);
1538
+ return ret >>> 0;
1539
+ }
1540
+ /**
1541
+ * Whether compilation succeeded
1542
+ * @returns {boolean}
1543
+ */
1544
+ get success() {
1545
+ const ret = wasm.__wbg_get_wasmcompilationresult_success(this.__wbg_ptr);
1546
+ return ret !== 0;
1547
+ }
1548
+ /**
1549
+ * Total warning count
1550
+ * @returns {number}
1551
+ */
1552
+ get warning_count() {
1553
+ const ret = wasm.__wbg_get_wasmcompilationresult_warning_count(this.__wbg_ptr);
1554
+ return ret >>> 0;
1555
+ }
1556
+ /**
1557
+ * Size of generated bytecode
1558
+ * @param {number} arg0
1559
+ */
1560
+ set bytecode_size(arg0) {
1561
+ wasm.__wbg_set_wasmcompilationresult_bytecode_size(this.__wbg_ptr, arg0);
1562
+ }
1563
+ /**
1564
+ * Compilation time in milliseconds
1565
+ * @param {number} arg0
1566
+ */
1567
+ set compilation_time(arg0) {
1568
+ wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
1569
+ }
1570
+ /**
1571
+ * Total error count
1572
+ * @param {number} arg0
1573
+ */
1574
+ set error_count(arg0) {
1575
+ wasm.__wbg_set_wasmcompilationresult_error_count(this.__wbg_ptr, arg0);
1576
+ }
1577
+ /**
1578
+ * Whether compilation succeeded
1579
+ * @param {boolean} arg0
1580
+ */
1581
+ set success(arg0) {
1582
+ wasm.__wbg_set_wasmcompilationresult_success(this.__wbg_ptr, arg0);
1583
+ }
1584
+ /**
1585
+ * Total warning count
1586
+ * @param {number} arg0
1587
+ */
1588
+ set warning_count(arg0) {
1589
+ wasm.__wbg_set_wasmcompilationresult_warning_count(this.__wbg_ptr, arg0);
1590
+ }
1591
+ /**
1592
+ * @returns {any}
1593
+ */
1594
+ get abi() {
1595
+ const ret = wasm.wasmcompilationresult_abi(this.__wbg_ptr);
1596
+ return takeObject(ret);
1597
+ }
1598
+ /**
1599
+ * @returns {Uint8Array | undefined}
1600
+ */
1601
+ get bytecode() {
1602
+ const ret = wasm.wasmcompilationresult_bytecode(this.__wbg_ptr);
1603
+ return takeObject(ret);
1604
+ }
1605
+ /**
1606
+ * @returns {WasmCompilerError[]}
1607
+ */
1608
+ get compiler_errors() {
1609
+ try {
1610
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1611
+ wasm.wasmcompilationresult_compiler_errors(retptr, this.__wbg_ptr);
1612
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1613
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1614
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1615
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1616
+ return v1;
1617
+ } finally {
1618
+ wasm.__wbindgen_add_to_stack_pointer(16);
1619
+ }
1620
+ }
1621
+ /**
1622
+ * @returns {Array<any>}
1623
+ */
1624
+ get disassembly() {
1625
+ const ret = wasm.wasmcompilationresult_disassembly(this.__wbg_ptr);
1626
+ return takeObject(ret);
1627
+ }
1628
+ /**
1629
+ * @returns {Array<any>}
1630
+ */
1631
+ get errors() {
1632
+ const ret = wasm.wasmcompilationresult_errors(this.__wbg_ptr);
1633
+ return takeObject(ret);
1634
+ }
1635
+ /**
1636
+ * Get all errors as JSON array
1637
+ * @returns {string}
1638
+ */
1639
+ format_all_json() {
1640
+ let deferred1_0;
1641
+ let deferred1_1;
1642
+ try {
1643
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1644
+ wasm.wasmcompilationresult_format_all_json(retptr, this.__wbg_ptr);
1645
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1646
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1647
+ deferred1_0 = r0;
1648
+ deferred1_1 = r1;
1649
+ return getStringFromWasm0(r0, r1);
1650
+ } finally {
1651
+ wasm.__wbindgen_add_to_stack_pointer(16);
1652
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1653
+ }
1654
+ }
1655
+ /**
1656
+ * Get all errors formatted as terminal output
1657
+ * @returns {string}
1658
+ */
1659
+ format_all_terminal() {
1660
+ let deferred1_0;
1661
+ let deferred1_1;
1662
+ try {
1663
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1664
+ wasm.wasmcompilationresult_format_all_terminal(retptr, this.__wbg_ptr);
1665
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1666
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1667
+ deferred1_0 = r0;
1668
+ deferred1_1 = r1;
1669
+ return getStringFromWasm0(r0, r1);
1670
+ } finally {
1671
+ wasm.__wbindgen_add_to_stack_pointer(16);
1672
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1673
+ }
1674
+ }
1675
+ /**
1676
+ * @returns {string}
1677
+ */
1678
+ get_formatted_errors_json() {
1679
+ let deferred1_0;
1680
+ let deferred1_1;
1681
+ try {
1682
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1683
+ wasm.wasmcompilationresult_get_formatted_errors_json(retptr, this.__wbg_ptr);
1684
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1685
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1686
+ deferred1_0 = r0;
1687
+ deferred1_1 = r1;
1688
+ return getStringFromWasm0(r0, r1);
1689
+ } finally {
1690
+ wasm.__wbindgen_add_to_stack_pointer(16);
1691
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1692
+ }
1693
+ }
1694
+ /**
1695
+ * @returns {string}
1696
+ */
1697
+ get_formatted_errors_terminal() {
1698
+ let deferred1_0;
1699
+ let deferred1_1;
1700
+ try {
1701
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1702
+ wasm.wasmcompilationresult_get_formatted_errors_terminal(retptr, this.__wbg_ptr);
1703
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1704
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1705
+ deferred1_0 = r0;
1706
+ deferred1_1 = r1;
1707
+ return getStringFromWasm0(r0, r1);
1708
+ } finally {
1709
+ wasm.__wbindgen_add_to_stack_pointer(16);
1710
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1711
+ }
1712
+ }
1713
+ /**
1714
+ * Get fully detailed metrics regardless of export format
1715
+ * @returns {any}
1716
+ */
1717
+ get_metrics_detailed() {
1718
+ try {
1719
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1720
+ wasm.wasmcompilationresult_get_metrics_detailed(retptr, this.__wbg_ptr);
1721
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1722
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1723
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1724
+ if (r2) {
1725
+ throw takeObject(r1);
1726
+ }
1727
+ return takeObject(r0);
1728
+ } finally {
1729
+ wasm.__wbindgen_add_to_stack_pointer(16);
1730
+ }
1731
+ }
1732
+ /**
1733
+ * Get parsed metrics as JavaScript object
1734
+ * @returns {any}
1735
+ */
1736
+ get_metrics_object() {
1737
+ const ret = wasm.wasmcompilationresult_get_metrics_object(this.__wbg_ptr);
1738
+ return takeObject(ret);
1739
+ }
1740
+ /**
1741
+ * @returns {string}
1742
+ */
1743
+ get metrics() {
1744
+ let deferred1_0;
1745
+ let deferred1_1;
1746
+ try {
1747
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1748
+ wasm.wasmcompilationresult_metrics(retptr, this.__wbg_ptr);
1749
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1750
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1751
+ deferred1_0 = r0;
1752
+ deferred1_1 = r1;
1753
+ return getStringFromWasm0(r0, r1);
1754
+ } finally {
1755
+ wasm.__wbindgen_add_to_stack_pointer(16);
1756
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1757
+ }
1758
+ }
1759
+ /**
1760
+ * @returns {string}
1761
+ */
1762
+ get metrics_format() {
1763
+ let deferred1_0;
1764
+ let deferred1_1;
1765
+ try {
1766
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1767
+ wasm.wasmcompilationresult_metrics_format(retptr, this.__wbg_ptr);
1768
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1769
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1770
+ deferred1_0 = r0;
1771
+ deferred1_1 = r1;
1772
+ return getStringFromWasm0(r0, r1);
1773
+ } finally {
1774
+ wasm.__wbindgen_add_to_stack_pointer(16);
1775
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1776
+ }
1777
+ }
1778
+ /**
1779
+ * @returns {Array<any>}
1780
+ */
1781
+ get warnings() {
1782
+ const ret = wasm.wasmcompilationresult_warnings(this.__wbg_ptr);
1783
+ return takeObject(ret);
1784
+ }
1785
+ }
1786
+ if (Symbol.dispose) WasmCompilationResult.prototype[Symbol.dispose] = WasmCompilationResult.prototype.free;
1787
+
1788
+ /**
1789
+ * WASM compilation result with comprehensive metrics
1790
+ */
1791
+ export class WasmCompilationWithMetrics {
1792
+ __destroy_into_raw() {
1793
+ const ptr = this.__wbg_ptr;
1794
+ this.__wbg_ptr = 0;
1795
+ WasmCompilationWithMetricsFinalization.unregister(this);
1796
+ return ptr;
1797
+ }
1798
+ free() {
1799
+ const ptr = this.__destroy_into_raw();
1800
+ wasm.__wbg_wasmcompilationwithmetrics_free(ptr, 0);
1801
+ }
1802
+ /**
1803
+ * Size of generated bytecode
1804
+ * @returns {number}
1805
+ */
1806
+ get bytecode_size() {
1807
+ const ret = wasm.__wbg_get_wasmcompilationwithmetrics_bytecode_size(this.__wbg_ptr);
1808
+ return ret >>> 0;
1809
+ }
1810
+ /**
1811
+ * Compilation time in milliseconds
1812
+ * @returns {number}
1813
+ */
1814
+ get compilation_time() {
1815
+ const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
1816
+ return ret;
1817
+ }
1818
+ /**
1819
+ * Whether compilation succeeded
1820
+ * @returns {boolean}
1821
+ */
1822
+ get success() {
1823
+ const ret = wasm.__wbg_get_wasmcompilationwithmetrics_success(this.__wbg_ptr);
1824
+ return ret !== 0;
1825
+ }
1826
+ /**
1827
+ * Size of generated bytecode
1828
+ * @param {number} arg0
1829
+ */
1830
+ set bytecode_size(arg0) {
1831
+ wasm.__wbg_set_wasmcompilationwithmetrics_bytecode_size(this.__wbg_ptr, arg0);
1832
+ }
1833
+ /**
1834
+ * Compilation time in milliseconds
1835
+ * @param {number} arg0
1836
+ */
1837
+ set compilation_time(arg0) {
1838
+ wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
1839
+ }
1840
+ /**
1841
+ * Whether compilation succeeded
1842
+ * @param {boolean} arg0
1843
+ */
1844
+ set success(arg0) {
1845
+ wasm.__wbg_set_wasmcompilationwithmetrics_success(this.__wbg_ptr, arg0);
1846
+ }
1847
+ /**
1848
+ * @returns {Uint8Array | undefined}
1849
+ */
1850
+ get bytecode() {
1851
+ const ret = wasm.wasmcompilationwithmetrics_bytecode(this.__wbg_ptr);
1852
+ return takeObject(ret);
1853
+ }
1854
+ /**
1855
+ * @returns {Array<any>}
1856
+ */
1857
+ get errors() {
1858
+ const ret = wasm.wasmcompilationwithmetrics_errors(this.__wbg_ptr);
1859
+ return takeObject(ret);
1860
+ }
1861
+ /**
1862
+ * Get parsed metrics as JavaScript object
1863
+ * @returns {any}
1864
+ */
1865
+ get_metrics_object() {
1866
+ try {
1867
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1868
+ wasm.wasmcompilationwithmetrics_get_metrics_object(retptr, this.__wbg_ptr);
1869
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1870
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1871
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1872
+ if (r2) {
1873
+ throw takeObject(r1);
1874
+ }
1875
+ return takeObject(r0);
1876
+ } finally {
1877
+ wasm.__wbindgen_add_to_stack_pointer(16);
1878
+ }
1879
+ }
1880
+ /**
1881
+ * @returns {string}
1882
+ */
1883
+ get metrics() {
1884
+ let deferred1_0;
1885
+ let deferred1_1;
1886
+ try {
1887
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1888
+ wasm.wasmcompilationwithmetrics_metrics(retptr, this.__wbg_ptr);
1889
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1890
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1891
+ deferred1_0 = r0;
1892
+ deferred1_1 = r1;
1893
+ return getStringFromWasm0(r0, r1);
1894
+ } finally {
1895
+ wasm.__wbindgen_add_to_stack_pointer(16);
1896
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1897
+ }
1898
+ }
1899
+ /**
1900
+ * @returns {Array<any>}
1901
+ */
1902
+ get warnings() {
1903
+ const ret = wasm.wasmcompilationwithmetrics_warnings(this.__wbg_ptr);
1904
+ return takeObject(ret);
1905
+ }
1906
+ }
1907
+ if (Symbol.dispose) WasmCompilationWithMetrics.prototype[Symbol.dispose] = WasmCompilationWithMetrics.prototype.free;
1908
+
1909
+ /**
1910
+ * Enhanced compiler error for WASM
1911
+ */
1912
+ export class WasmCompilerError {
1913
+ static __wrap(ptr) {
1914
+ ptr = ptr >>> 0;
1915
+ const obj = Object.create(WasmCompilerError.prototype);
1916
+ obj.__wbg_ptr = ptr;
1917
+ WasmCompilerErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1918
+ return obj;
1919
+ }
1920
+ __destroy_into_raw() {
1921
+ const ptr = this.__wbg_ptr;
1922
+ this.__wbg_ptr = 0;
1923
+ WasmCompilerErrorFinalization.unregister(this);
1924
+ return ptr;
1925
+ }
1926
+ free() {
1927
+ const ptr = this.__destroy_into_raw();
1928
+ wasm.__wbg_wasmcompilererror_free(ptr, 0);
1929
+ }
1930
+ /**
1931
+ * @returns {string}
1932
+ */
1933
+ get category() {
1934
+ let deferred1_0;
1935
+ let deferred1_1;
1936
+ try {
1937
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1938
+ wasm.wasmcompilererror_category(retptr, this.__wbg_ptr);
1939
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1940
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1941
+ deferred1_0 = r0;
1942
+ deferred1_1 = r1;
1943
+ return getStringFromWasm0(r0, r1);
1944
+ } finally {
1945
+ wasm.__wbindgen_add_to_stack_pointer(16);
1946
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1947
+ }
1948
+ }
1949
+ /**
1950
+ * @returns {string}
1951
+ */
1952
+ get code() {
1953
+ let deferred1_0;
1954
+ let deferred1_1;
1955
+ try {
1956
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1957
+ wasm.wasmcompilererror_code(retptr, this.__wbg_ptr);
1958
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1959
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1960
+ deferred1_0 = r0;
1961
+ deferred1_1 = r1;
1962
+ return getStringFromWasm0(r0, r1);
1963
+ } finally {
1964
+ wasm.__wbindgen_add_to_stack_pointer(16);
1965
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1966
+ }
1967
+ }
1968
+ /**
1969
+ * @returns {any}
1970
+ */
1971
+ get column() {
1972
+ const ret = wasm.wasmcompilererror_column(this.__wbg_ptr);
1973
+ return takeObject(ret);
1974
+ }
1975
+ /**
1976
+ * @returns {string | undefined}
1977
+ */
1978
+ get description() {
1979
+ try {
1980
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1981
+ wasm.wasmcompilererror_description(retptr, this.__wbg_ptr);
1982
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1983
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1984
+ let v1;
1985
+ if (r0 !== 0) {
1986
+ v1 = getStringFromWasm0(r0, r1).slice();
1987
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1988
+ }
1989
+ return v1;
1990
+ } finally {
1991
+ wasm.__wbindgen_add_to_stack_pointer(16);
1992
+ }
1993
+ }
1994
+ /**
1995
+ * Get error as JSON string
1996
+ * @returns {string}
1997
+ */
1998
+ format_json() {
1999
+ let deferred1_0;
2000
+ let deferred1_1;
2001
+ try {
2002
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2003
+ wasm.wasmcompilererror_format_json(retptr, this.__wbg_ptr);
2004
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2005
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2006
+ deferred1_0 = r0;
2007
+ deferred1_1 = r1;
2008
+ return getStringFromWasm0(r0, r1);
2009
+ } finally {
2010
+ wasm.__wbindgen_add_to_stack_pointer(16);
2011
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2012
+ }
2013
+ }
2014
+ /**
2015
+ * Get formatted error message (terminal style)
2016
+ * Get formatted error message (terminal style)
2017
+ * @returns {string}
2018
+ */
2019
+ format_terminal() {
2020
+ let deferred1_0;
2021
+ let deferred1_1;
2022
+ try {
2023
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2024
+ wasm.wasmcompilererror_format_terminal(retptr, this.__wbg_ptr);
2025
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2026
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2027
+ deferred1_0 = r0;
2028
+ deferred1_1 = r1;
2029
+ return getStringFromWasm0(r0, r1);
2030
+ } finally {
2031
+ wasm.__wbindgen_add_to_stack_pointer(16);
2032
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2033
+ }
2034
+ }
2035
+ /**
2036
+ * @returns {any}
2037
+ */
2038
+ get line() {
2039
+ const ret = wasm.wasmcompilererror_line(this.__wbg_ptr);
2040
+ return takeObject(ret);
2041
+ }
2042
+ /**
2043
+ * @returns {WasmSourceLocation | undefined}
2044
+ */
2045
+ get location() {
2046
+ const ret = wasm.wasmcompilererror_location(this.__wbg_ptr);
2047
+ return ret === 0 ? undefined : WasmSourceLocation.__wrap(ret);
2048
+ }
2049
+ /**
2050
+ * @returns {string}
2051
+ */
2052
+ get message() {
2053
+ let deferred1_0;
2054
+ let deferred1_1;
2055
+ try {
2056
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2057
+ wasm.wasmcompilererror_message(retptr, this.__wbg_ptr);
2058
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2059
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2060
+ deferred1_0 = r0;
2061
+ deferred1_1 = r1;
2062
+ return getStringFromWasm0(r0, r1);
2063
+ } finally {
2064
+ wasm.__wbindgen_add_to_stack_pointer(16);
2065
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2066
+ }
2067
+ }
2068
+ /**
2069
+ * @returns {string}
2070
+ */
2071
+ get severity() {
2072
+ let deferred1_0;
2073
+ let deferred1_1;
2074
+ try {
2075
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2076
+ wasm.wasmcompilererror_severity(retptr, this.__wbg_ptr);
2077
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2078
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2079
+ deferred1_0 = r0;
2080
+ deferred1_1 = r1;
2081
+ return getStringFromWasm0(r0, r1);
2082
+ } finally {
2083
+ wasm.__wbindgen_add_to_stack_pointer(16);
2084
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2085
+ }
2086
+ }
2087
+ /**
2088
+ * @returns {string | undefined}
2089
+ */
2090
+ get source_line() {
2091
+ try {
2092
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2093
+ wasm.wasmcompilererror_source_line(retptr, this.__wbg_ptr);
2094
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2095
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2096
+ let v1;
2097
+ if (r0 !== 0) {
2098
+ v1 = getStringFromWasm0(r0, r1).slice();
2099
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2100
+ }
2101
+ return v1;
2102
+ } finally {
2103
+ wasm.__wbindgen_add_to_stack_pointer(16);
2104
+ }
2105
+ }
2106
+ /**
2107
+ * @returns {WasmSuggestion[]}
2108
+ */
2109
+ get suggestions() {
2110
+ try {
2111
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2112
+ wasm.wasmcompilererror_suggestions(retptr, this.__wbg_ptr);
2113
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2114
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2115
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2116
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2117
+ return v1;
2118
+ } finally {
2119
+ wasm.__wbindgen_add_to_stack_pointer(16);
2120
+ }
2121
+ }
2122
+ }
2123
+ if (Symbol.dispose) WasmCompilerError.prototype[Symbol.dispose] = WasmCompilerError.prototype.free;
2124
+
2125
+ /**
2126
+ * Enhanced compilation result with rich error information
2127
+ */
2128
+ export class WasmEnhancedCompilationResult {
2129
+ __destroy_into_raw() {
2130
+ const ptr = this.__wbg_ptr;
2131
+ this.__wbg_ptr = 0;
2132
+ WasmEnhancedCompilationResultFinalization.unregister(this);
2133
+ return ptr;
2134
+ }
2135
+ free() {
2136
+ const ptr = this.__destroy_into_raw();
2137
+ wasm.__wbg_wasmenhancedcompilationresult_free(ptr, 0);
2138
+ }
2139
+ /**
2140
+ * Size of generated bytecode
2141
+ * @returns {number}
2142
+ */
2143
+ get bytecode_size() {
2144
+ const ret = wasm.__wbg_get_wasmenhancedcompilationresult_bytecode_size(this.__wbg_ptr);
2145
+ return ret >>> 0;
2146
+ }
2147
+ /**
2148
+ * Compilation time in milliseconds
2149
+ * @returns {number}
2150
+ */
2151
+ get compilation_time() {
2152
+ const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
2153
+ return ret;
2154
+ }
2155
+ /**
2156
+ * Total error count
2157
+ * @returns {number}
2158
+ */
2159
+ get error_count() {
2160
+ const ret = wasm.__wbg_get_wasmenhancedcompilationresult_error_count(this.__wbg_ptr);
2161
+ return ret >>> 0;
2162
+ }
2163
+ /**
2164
+ * Whether compilation succeeded
2165
+ * @returns {boolean}
2166
+ */
2167
+ get success() {
2168
+ const ret = wasm.__wbg_get_wasmanalysisresult_success(this.__wbg_ptr);
2169
+ return ret !== 0;
2170
+ }
2171
+ /**
2172
+ * Total warning count
2173
+ * @returns {number}
2174
+ */
2175
+ get warning_count() {
2176
+ const ret = wasm.__wbg_get_wasmenhancedcompilationresult_warning_count(this.__wbg_ptr);
2177
+ return ret >>> 0;
2178
+ }
2179
+ /**
2180
+ * Size of generated bytecode
2181
+ * @param {number} arg0
2182
+ */
2183
+ set bytecode_size(arg0) {
2184
+ wasm.__wbg_set_wasmenhancedcompilationresult_bytecode_size(this.__wbg_ptr, arg0);
2185
+ }
2186
+ /**
2187
+ * Compilation time in milliseconds
2188
+ * @param {number} arg0
2189
+ */
2190
+ set compilation_time(arg0) {
2191
+ wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
2192
+ }
2193
+ /**
2194
+ * Total error count
2195
+ * @param {number} arg0
2196
+ */
2197
+ set error_count(arg0) {
2198
+ wasm.__wbg_set_wasmenhancedcompilationresult_error_count(this.__wbg_ptr, arg0);
2199
+ }
2200
+ /**
2201
+ * Whether compilation succeeded
2202
+ * @param {boolean} arg0
2203
+ */
2204
+ set success(arg0) {
2205
+ wasm.__wbg_set_wasmanalysisresult_success(this.__wbg_ptr, arg0);
2206
+ }
2207
+ /**
2208
+ * Total warning count
2209
+ * @param {number} arg0
2210
+ */
2211
+ set warning_count(arg0) {
2212
+ wasm.__wbg_set_wasmenhancedcompilationresult_warning_count(this.__wbg_ptr, arg0);
2213
+ }
2214
+ /**
2215
+ * @returns {WasmCompilerError[]}
2216
+ */
2217
+ get compiler_errors() {
2218
+ try {
2219
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2220
+ wasm.wasmenhancedcompilationresult_compiler_errors(retptr, this.__wbg_ptr);
2221
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2222
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2223
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2224
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
2225
+ return v1;
2226
+ } finally {
2227
+ wasm.__wbindgen_add_to_stack_pointer(16);
2228
+ }
2229
+ }
2230
+ /**
2231
+ * Get all errors as JSON array
2232
+ * @returns {string}
2233
+ */
2234
+ format_all_json() {
2235
+ let deferred1_0;
2236
+ let deferred1_1;
2237
+ try {
2238
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2239
+ wasm.wasmenhancedcompilationresult_format_all_json(retptr, this.__wbg_ptr);
2240
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2241
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2242
+ deferred1_0 = r0;
2243
+ deferred1_1 = r1;
2244
+ return getStringFromWasm0(r0, r1);
2245
+ } finally {
2246
+ wasm.__wbindgen_add_to_stack_pointer(16);
2247
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2248
+ }
2249
+ }
2250
+ /**
2251
+ * Get all errors formatted as terminal output
2252
+ * @returns {string}
2253
+ */
2254
+ format_all_terminal() {
2255
+ let deferred1_0;
2256
+ let deferred1_1;
2257
+ try {
2258
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2259
+ wasm.wasmenhancedcompilationresult_format_all_terminal(retptr, this.__wbg_ptr);
2260
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2261
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2262
+ deferred1_0 = r0;
2263
+ deferred1_1 = r1;
2264
+ return getStringFromWasm0(r0, r1);
2265
+ } finally {
2266
+ wasm.__wbindgen_add_to_stack_pointer(16);
2267
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2268
+ }
2269
+ }
2270
+ }
2271
+ if (Symbol.dispose) WasmEnhancedCompilationResult.prototype[Symbol.dispose] = WasmEnhancedCompilationResult.prototype.free;
2272
+
2273
+ /**
2274
+ * WASM DSL Compiler for client-side compilation
2275
+ */
2276
+ export class WasmFiveCompiler {
2277
+ __destroy_into_raw() {
2278
+ const ptr = this.__wbg_ptr;
2279
+ this.__wbg_ptr = 0;
2280
+ WasmFiveCompilerFinalization.unregister(this);
2281
+ return ptr;
2282
+ }
2283
+ free() {
2284
+ const ptr = this.__destroy_into_raw();
2285
+ wasm.__wbg_wasmfivecompiler_free(ptr, 0);
2286
+ }
2287
+ /**
2288
+ * Get detailed analysis of source code
2289
+ * @param {string} source
2290
+ * @returns {WasmAnalysisResult}
2291
+ */
2292
+ analyze_source(source) {
2293
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2294
+ const len0 = WASM_VECTOR_LEN;
2295
+ const ret = wasm.wasmfivecompiler_analyze_source(this.__wbg_ptr, ptr0, len0);
2296
+ return WasmAnalysisResult.__wrap(ret);
2297
+ }
2298
+ /**
2299
+ * Get detailed analysis of source code with compilation mode selection
2300
+ * @param {string} source
2301
+ * @param {string} mode
2302
+ * @returns {WasmAnalysisResult}
2303
+ */
2304
+ analyze_source_mode(source, mode) {
2305
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2306
+ const len0 = WASM_VECTOR_LEN;
2307
+ const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2308
+ const len1 = WASM_VECTOR_LEN;
2309
+ const ret = wasm.wasmfivecompiler_analyze_source_mode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
2310
+ return WasmAnalysisResult.__wrap(ret);
2311
+ }
2312
+ /**
2313
+ * Unified compilation method with enhanced error reporting and metrics
2314
+ * @param {string} source
2315
+ * @param {WasmCompilationOptions} options
2316
+ * @returns {WasmCompilationResult}
2317
+ */
2318
+ compile(source, options) {
2319
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2320
+ const len0 = WASM_VECTOR_LEN;
2321
+ _assertClass(options, WasmCompilationOptions);
2322
+ const ret = wasm.wasmfivecompiler_compile(this.__wbg_ptr, ptr0, len0, options.__wbg_ptr);
2323
+ return WasmCompilationResult.__wrap(ret);
2324
+ }
2325
+ /**
2326
+ * Compile multi-file project with explicit module list
2327
+ * @param {any} module_files
2328
+ * @param {string} entry_point
2329
+ * @param {WasmCompilationOptions} options
2330
+ * @returns {WasmCompilationResult}
2331
+ */
2332
+ compileModules(module_files, entry_point, options) {
2333
+ try {
2334
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2335
+ const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2336
+ const len0 = WASM_VECTOR_LEN;
2337
+ _assertClass(options, WasmCompilationOptions);
2338
+ wasm.wasmfivecompiler_compileModules(retptr, this.__wbg_ptr, addHeapObject(module_files), ptr0, len0, options.__wbg_ptr);
2339
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2340
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2341
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2342
+ if (r2) {
2343
+ throw takeObject(r1);
2344
+ }
2345
+ return WasmCompilationResult.__wrap(r0);
2346
+ } finally {
2347
+ wasm.__wbindgen_add_to_stack_pointer(16);
2348
+ }
2349
+ }
2350
+ /**
2351
+ * Compile multi-file project with automatic discovery
2352
+ * @param {string} entry_point
2353
+ * @param {WasmCompilationOptions} options
2354
+ * @returns {WasmCompilationResult}
2355
+ */
2356
+ compileMultiWithDiscovery(entry_point, options) {
2357
+ try {
2358
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2359
+ const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2360
+ const len0 = WASM_VECTOR_LEN;
2361
+ _assertClass(options, WasmCompilationOptions);
2362
+ wasm.wasmfivecompiler_compileMultiWithDiscovery(retptr, this.__wbg_ptr, ptr0, len0, options.__wbg_ptr);
2363
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2364
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2365
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2366
+ if (r2) {
2367
+ throw takeObject(r1);
2368
+ }
2369
+ return WasmCompilationResult.__wrap(r0);
2370
+ } finally {
2371
+ wasm.__wbindgen_add_to_stack_pointer(16);
2372
+ }
2373
+ }
2374
+ /**
2375
+ * Multi-file compilation using module merger (main source + modules)
2376
+ * @param {string} main_source
2377
+ * @param {any} modules
2378
+ * @param {WasmCompilationOptions} options
2379
+ * @returns {WasmCompilationResult}
2380
+ */
2381
+ compile_multi(main_source, modules, options) {
2382
+ try {
2383
+ const ptr0 = passStringToWasm0(main_source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2384
+ const len0 = WASM_VECTOR_LEN;
2385
+ _assertClass(options, WasmCompilationOptions);
2386
+ const ret = wasm.wasmfivecompiler_compile_multi(this.__wbg_ptr, ptr0, len0, addBorrowedObject(modules), options.__wbg_ptr);
2387
+ return WasmCompilationResult.__wrap(ret);
2388
+ } finally {
2389
+ heap[stack_pointer++] = undefined;
2390
+ }
2391
+ }
2392
+ /**
2393
+ * Compile DSL and generate both bytecode and ABI
2394
+ * @param {string} source
2395
+ * @returns {any}
2396
+ */
2397
+ compile_with_abi(source) {
2398
+ try {
2399
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2400
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2401
+ const len0 = WASM_VECTOR_LEN;
2402
+ wasm.wasmfivecompiler_compile_with_abi(retptr, this.__wbg_ptr, ptr0, len0);
2403
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2404
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2405
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2406
+ if (r2) {
2407
+ throw takeObject(r1);
2408
+ }
2409
+ return takeObject(r0);
2410
+ } finally {
2411
+ wasm.__wbindgen_add_to_stack_pointer(16);
2412
+ }
2413
+ }
2414
+ /**
2415
+ * Discover modules starting from an entry point
2416
+ * @param {string} entry_point
2417
+ * @returns {any}
2418
+ */
2419
+ discoverModules(entry_point) {
2420
+ try {
2421
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2422
+ const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2423
+ const len0 = WASM_VECTOR_LEN;
2424
+ wasm.wasmfivecompiler_discoverModules(retptr, this.__wbg_ptr, ptr0, len0);
2425
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2426
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2427
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2428
+ if (r2) {
2429
+ throw takeObject(r1);
2430
+ }
2431
+ return takeObject(r0);
2432
+ } finally {
2433
+ wasm.__wbindgen_add_to_stack_pointer(16);
2434
+ }
2435
+ }
2436
+ /**
2437
+ * Extract function name metadata from compiled bytecode
2438
+ * Returns a list of discovered functions in the bytecode
2439
+ * @param {Uint8Array} bytecode
2440
+ * @returns {any}
2441
+ */
2442
+ extractFunctionMetadata(bytecode) {
2443
+ try {
2444
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2445
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
2446
+ const len0 = WASM_VECTOR_LEN;
2447
+ wasm.wasmfivecompiler_extractFunctionMetadata(retptr, this.__wbg_ptr, ptr0, len0);
2448
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2449
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2450
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2451
+ if (r2) {
2452
+ throw takeObject(r1);
2453
+ }
2454
+ return takeObject(r0);
2455
+ } finally {
2456
+ wasm.__wbindgen_add_to_stack_pointer(16);
2457
+ }
2458
+ }
2459
+ /**
2460
+ * Extract account definitions from DSL source code
2461
+ * @param {string} source
2462
+ * @returns {any}
2463
+ */
2464
+ extract_account_definitions(source) {
2465
+ try {
2466
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2467
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2468
+ const len0 = WASM_VECTOR_LEN;
2469
+ wasm.wasmfivecompiler_extract_account_definitions(retptr, this.__wbg_ptr, ptr0, len0);
2470
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2471
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2472
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2473
+ if (r2) {
2474
+ throw takeObject(r1);
2475
+ }
2476
+ return takeObject(r0);
2477
+ } finally {
2478
+ wasm.__wbindgen_add_to_stack_pointer(16);
2479
+ }
2480
+ }
2481
+ /**
2482
+ * Extract function signatures with account parameters
2483
+ * @param {string} source
2484
+ * @returns {any}
2485
+ */
2486
+ extract_function_signatures(source) {
2487
+ try {
2488
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2489
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2490
+ const len0 = WASM_VECTOR_LEN;
2491
+ wasm.wasmfivecompiler_extract_function_signatures(retptr, this.__wbg_ptr, ptr0, len0);
2492
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2493
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2494
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2495
+ if (r2) {
2496
+ throw takeObject(r1);
2497
+ }
2498
+ return takeObject(r0);
2499
+ } finally {
2500
+ wasm.__wbindgen_add_to_stack_pointer(16);
2501
+ }
2502
+ }
2503
+ /**
2504
+ * Format an error message using the native terminal formatter
2505
+ * This provides rich Rust-style error output with source context and colors
2506
+ * @param {string} message
2507
+ * @param {string} code
2508
+ * @param {string} severity
2509
+ * @param {number} line
2510
+ * @param {number} column
2511
+ * @param {string} _source
2512
+ * @returns {string}
2513
+ */
2514
+ format_error_terminal(message, code, severity, line, column, _source) {
2515
+ let deferred5_0;
2516
+ let deferred5_1;
2517
+ try {
2518
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2519
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2520
+ const len0 = WASM_VECTOR_LEN;
2521
+ const ptr1 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2522
+ const len1 = WASM_VECTOR_LEN;
2523
+ const ptr2 = passStringToWasm0(severity, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2524
+ const len2 = WASM_VECTOR_LEN;
2525
+ const ptr3 = passStringToWasm0(_source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2526
+ const len3 = WASM_VECTOR_LEN;
2527
+ wasm.wasmfivecompiler_format_error_terminal(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, line, column, ptr3, len3);
2528
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2529
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2530
+ deferred5_0 = r0;
2531
+ deferred5_1 = r1;
2532
+ return getStringFromWasm0(r0, r1);
2533
+ } finally {
2534
+ wasm.__wbindgen_add_to_stack_pointer(16);
2535
+ wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
2536
+ }
2537
+ }
2538
+ /**
2539
+ * Generate ABI from DSL source code for function calls
2540
+ * @param {string} source
2541
+ * @returns {any}
2542
+ */
2543
+ generate_abi(source) {
2544
+ try {
2545
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2546
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2547
+ const len0 = WASM_VECTOR_LEN;
2548
+ wasm.wasmfivecompiler_generate_abi(retptr, this.__wbg_ptr, ptr0, len0);
2549
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2550
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2551
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2552
+ if (r2) {
2553
+ throw takeObject(r1);
2554
+ }
2555
+ return takeObject(r0);
2556
+ } finally {
2557
+ wasm.__wbindgen_add_to_stack_pointer(16);
2558
+ }
2559
+ }
2560
+ /**
2561
+ * Get compiler statistics
2562
+ * @returns {any}
2563
+ */
2564
+ get_compiler_stats() {
2565
+ const ret = wasm.wasmfivecompiler_get_compiler_stats(this.__wbg_ptr);
2566
+ return takeObject(ret);
2567
+ }
2568
+ /**
2569
+ * Get comprehensive compiler statistics including which opcodes are used vs unused
2570
+ * @param {string} source
2571
+ * @returns {any}
2572
+ */
2573
+ get_opcode_analysis(source) {
2574
+ try {
2575
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2576
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2577
+ const len0 = WASM_VECTOR_LEN;
2578
+ wasm.wasmfivecompiler_get_opcode_analysis(retptr, this.__wbg_ptr, ptr0, len0);
2579
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2580
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2581
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2582
+ if (r2) {
2583
+ throw takeObject(r1);
2584
+ }
2585
+ return takeObject(r0);
2586
+ } finally {
2587
+ wasm.__wbindgen_add_to_stack_pointer(16);
2588
+ }
2589
+ }
2590
+ /**
2591
+ * Get opcode usage statistics from compilation
2592
+ * @param {string} source
2593
+ * @returns {any}
2594
+ */
2595
+ get_opcode_usage(source) {
2596
+ try {
2597
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2598
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2599
+ const len0 = WASM_VECTOR_LEN;
2600
+ wasm.wasmfivecompiler_get_opcode_usage(retptr, this.__wbg_ptr, ptr0, len0);
2601
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2602
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2603
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2604
+ if (r2) {
2605
+ throw takeObject(r1);
2606
+ }
2607
+ return takeObject(r0);
2608
+ } finally {
2609
+ wasm.__wbindgen_add_to_stack_pointer(16);
2610
+ }
2611
+ }
2612
+ /**
2613
+ * Create a new WASM compiler instance
2614
+ */
2615
+ constructor() {
2616
+ const ret = wasm.wasmfivecompiler_new();
2617
+ this.__wbg_ptr = ret >>> 0;
2618
+ WasmFiveCompilerFinalization.register(this, this.__wbg_ptr, this);
2619
+ return this;
2620
+ }
2621
+ /**
2622
+ * Optimize bytecode
2623
+ * @param {Uint8Array} bytecode
2624
+ * @returns {Uint8Array}
2625
+ */
2626
+ optimize_bytecode(bytecode) {
2627
+ try {
2628
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2629
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
2630
+ const len0 = WASM_VECTOR_LEN;
2631
+ wasm.wasmfivecompiler_optimize_bytecode(retptr, this.__wbg_ptr, ptr0, len0);
2632
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2633
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2634
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2635
+ if (r2) {
2636
+ throw takeObject(r1);
2637
+ }
2638
+ return takeObject(r0);
2639
+ } finally {
2640
+ wasm.__wbindgen_add_to_stack_pointer(16);
2641
+ }
2642
+ }
2643
+ /**
2644
+ * Parse DSL source code and return AST information
2645
+ * @param {string} source
2646
+ * @returns {any}
2647
+ */
2648
+ parse_dsl(source) {
2649
+ try {
2650
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2651
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2652
+ const len0 = WASM_VECTOR_LEN;
2653
+ wasm.wasmfivecompiler_parse_dsl(retptr, this.__wbg_ptr, ptr0, len0);
2654
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2655
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2656
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2657
+ if (r2) {
2658
+ throw takeObject(r1);
2659
+ }
2660
+ return takeObject(r0);
2661
+ } finally {
2662
+ wasm.__wbindgen_add_to_stack_pointer(16);
2663
+ }
2664
+ }
2665
+ /**
2666
+ * Type-check parsed AST
2667
+ * @param {string} _ast_json
2668
+ * @returns {any}
2669
+ */
2670
+ type_check(_ast_json) {
2671
+ try {
2672
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2673
+ const ptr0 = passStringToWasm0(_ast_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2674
+ const len0 = WASM_VECTOR_LEN;
2675
+ wasm.wasmfivecompiler_type_check(retptr, this.__wbg_ptr, ptr0, len0);
2676
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2677
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2678
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2679
+ if (r2) {
2680
+ throw takeObject(r1);
2681
+ }
2682
+ return takeObject(r0);
2683
+ } finally {
2684
+ wasm.__wbindgen_add_to_stack_pointer(16);
2685
+ }
2686
+ }
2687
+ /**
2688
+ * Validate account constraints against function parameters
2689
+ * @param {string} source
2690
+ * @param {string} function_name
2691
+ * @param {string} accounts_json
2692
+ * @returns {any}
2693
+ */
2694
+ validate_account_constraints(source, function_name, accounts_json) {
2695
+ try {
2696
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2697
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2698
+ const len0 = WASM_VECTOR_LEN;
2699
+ const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2700
+ const len1 = WASM_VECTOR_LEN;
2701
+ const ptr2 = passStringToWasm0(accounts_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2702
+ const len2 = WASM_VECTOR_LEN;
2703
+ wasm.wasmfivecompiler_validate_account_constraints(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
2704
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2705
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2706
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2707
+ if (r2) {
2708
+ throw takeObject(r1);
2709
+ }
2710
+ return takeObject(r0);
2711
+ } finally {
2712
+ wasm.__wbindgen_add_to_stack_pointer(16);
2713
+ }
2714
+ }
2715
+ /**
2716
+ * Validate DSL syntax without full compilation
2717
+ * @param {string} source
2718
+ * @returns {any}
2719
+ */
2720
+ validate_syntax(source) {
2721
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2722
+ const len0 = WASM_VECTOR_LEN;
2723
+ const ret = wasm.wasmfivecompiler_validate_syntax(this.__wbg_ptr, ptr0, len0);
2724
+ return takeObject(ret);
2725
+ }
2726
+ }
2727
+ if (Symbol.dispose) WasmFiveCompiler.prototype[Symbol.dispose] = WasmFiveCompiler.prototype.free;
2728
+
2729
+ /**
2730
+ * WASM-exposed metrics collector wrapper
2731
+ */
2732
+ export class WasmMetricsCollector {
2733
+ __destroy_into_raw() {
2734
+ const ptr = this.__wbg_ptr;
2735
+ this.__wbg_ptr = 0;
2736
+ WasmMetricsCollectorFinalization.unregister(this);
2737
+ return ptr;
2738
+ }
2739
+ free() {
2740
+ const ptr = this.__destroy_into_raw();
2741
+ wasm.__wbg_wasmmetricscollector_free(ptr, 0);
2742
+ }
2743
+ /**
2744
+ * End the current compilation phase
2745
+ */
2746
+ end_phase() {
2747
+ wasm.wasmmetricscollector_end_phase(this.__wbg_ptr);
2748
+ }
2749
+ /**
2750
+ * Export metrics in the requested format
2751
+ * @param {string} format
2752
+ * @returns {string}
2753
+ */
2754
+ export(format) {
2755
+ let deferred3_0;
2756
+ let deferred3_1;
2757
+ try {
2758
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2759
+ const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2760
+ const len0 = WASM_VECTOR_LEN;
2761
+ wasm.wasmmetricscollector_export(retptr, this.__wbg_ptr, ptr0, len0);
2762
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2763
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2764
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2765
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2766
+ var ptr2 = r0;
2767
+ var len2 = r1;
2768
+ if (r3) {
2769
+ ptr2 = 0; len2 = 0;
2770
+ throw takeObject(r2);
2771
+ }
2772
+ deferred3_0 = ptr2;
2773
+ deferred3_1 = len2;
2774
+ return getStringFromWasm0(ptr2, len2);
2775
+ } finally {
2776
+ wasm.__wbindgen_add_to_stack_pointer(16);
2777
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
2778
+ }
2779
+ }
2780
+ /**
2781
+ * Finalize metrics collection
2782
+ */
2783
+ finalize() {
2784
+ wasm.wasmmetricscollector_finalize(this.__wbg_ptr);
2785
+ }
2786
+ /**
2787
+ * Get metrics as a JS object for programmatic use
2788
+ * @returns {any}
2789
+ */
2790
+ get_metrics_object() {
2791
+ try {
2792
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2793
+ wasm.wasmmetricscollector_get_metrics_object(retptr, this.__wbg_ptr);
2794
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2795
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2796
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2797
+ if (r2) {
2798
+ throw takeObject(r1);
2799
+ }
2800
+ return takeObject(r0);
2801
+ } finally {
2802
+ wasm.__wbindgen_add_to_stack_pointer(16);
2803
+ }
2804
+ }
2805
+ constructor() {
2806
+ const ret = wasm.wasmmetricscollector_new();
2807
+ this.__wbg_ptr = ret >>> 0;
2808
+ WasmMetricsCollectorFinalization.register(this, this.__wbg_ptr, this);
2809
+ return this;
2810
+ }
2811
+ /**
2812
+ * Reset the collector for a new compilation
2813
+ */
2814
+ reset() {
2815
+ wasm.wasmmetricscollector_reset(this.__wbg_ptr);
2816
+ }
2817
+ /**
2818
+ * Start timing a compilation phase
2819
+ * @param {string} phase_name
2820
+ */
2821
+ start_phase(phase_name) {
2822
+ const ptr0 = passStringToWasm0(phase_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2823
+ const len0 = WASM_VECTOR_LEN;
2824
+ wasm.wasmmetricscollector_start_phase(this.__wbg_ptr, ptr0, len0);
2825
+ }
2826
+ }
2827
+ if (Symbol.dispose) WasmMetricsCollector.prototype[Symbol.dispose] = WasmMetricsCollector.prototype.free;
2828
+
2829
+ /**
2830
+ * Enhanced source location for WASM
2831
+ */
2832
+ export class WasmSourceLocation {
2833
+ static __wrap(ptr) {
2834
+ ptr = ptr >>> 0;
2835
+ const obj = Object.create(WasmSourceLocation.prototype);
2836
+ obj.__wbg_ptr = ptr;
2837
+ WasmSourceLocationFinalization.register(obj, obj.__wbg_ptr, obj);
2838
+ return obj;
2839
+ }
2840
+ __destroy_into_raw() {
2841
+ const ptr = this.__wbg_ptr;
2842
+ this.__wbg_ptr = 0;
2843
+ WasmSourceLocationFinalization.unregister(this);
2844
+ return ptr;
2845
+ }
2846
+ free() {
2847
+ const ptr = this.__destroy_into_raw();
2848
+ wasm.__wbg_wasmsourcelocation_free(ptr, 0);
2849
+ }
2850
+ /**
2851
+ * Column number (1-based)
2852
+ * @returns {number}
2853
+ */
2854
+ get column() {
2855
+ const ret = wasm.__wbg_get_wasmsourcelocation_column(this.__wbg_ptr);
2856
+ return ret >>> 0;
2857
+ }
2858
+ /**
2859
+ * Length of the relevant text
2860
+ * @returns {number}
2861
+ */
2862
+ get length() {
2863
+ const ret = wasm.__wbg_get_wasmsourcelocation_length(this.__wbg_ptr);
2864
+ return ret >>> 0;
2865
+ }
2866
+ /**
2867
+ * Line number (1-based)
2868
+ * @returns {number}
2869
+ */
2870
+ get line() {
2871
+ const ret = wasm.__wbg_get_wasmsourcelocation_line(this.__wbg_ptr);
2872
+ return ret >>> 0;
2873
+ }
2874
+ /**
2875
+ * Byte offset in source
2876
+ * @returns {number}
2877
+ */
2878
+ get offset() {
2879
+ const ret = wasm.__wbg_get_wasmsourcelocation_offset(this.__wbg_ptr);
2880
+ return ret >>> 0;
2881
+ }
2882
+ /**
2883
+ * Column number (1-based)
2884
+ * @param {number} arg0
2885
+ */
2886
+ set column(arg0) {
2887
+ wasm.__wbg_set_wasmsourcelocation_column(this.__wbg_ptr, arg0);
2888
+ }
2889
+ /**
2890
+ * Length of the relevant text
2891
+ * @param {number} arg0
2892
+ */
2893
+ set length(arg0) {
2894
+ wasm.__wbg_set_wasmsourcelocation_length(this.__wbg_ptr, arg0);
2895
+ }
2896
+ /**
2897
+ * Line number (1-based)
2898
+ * @param {number} arg0
2899
+ */
2900
+ set line(arg0) {
2901
+ wasm.__wbg_set_wasmsourcelocation_line(this.__wbg_ptr, arg0);
2902
+ }
2903
+ /**
2904
+ * Byte offset in source
2905
+ * @param {number} arg0
2906
+ */
2907
+ set offset(arg0) {
2908
+ wasm.__wbg_set_wasmsourcelocation_offset(this.__wbg_ptr, arg0);
2909
+ }
2910
+ /**
2911
+ * @returns {string | undefined}
2912
+ */
2913
+ get file() {
2914
+ try {
2915
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2916
+ wasm.wasmsourcelocation_file(retptr, this.__wbg_ptr);
2917
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2918
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2919
+ let v1;
2920
+ if (r0 !== 0) {
2921
+ v1 = getStringFromWasm0(r0, r1).slice();
2922
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2923
+ }
2924
+ return v1;
2925
+ } finally {
2926
+ wasm.__wbindgen_add_to_stack_pointer(16);
2927
+ }
2928
+ }
2929
+ }
2930
+ if (Symbol.dispose) WasmSourceLocation.prototype[Symbol.dispose] = WasmSourceLocation.prototype.free;
2931
+
2932
+ /**
2933
+ * Enhanced error suggestion for WASM
2934
+ */
2935
+ export class WasmSuggestion {
2936
+ static __wrap(ptr) {
2937
+ ptr = ptr >>> 0;
2938
+ const obj = Object.create(WasmSuggestion.prototype);
2939
+ obj.__wbg_ptr = ptr;
2940
+ WasmSuggestionFinalization.register(obj, obj.__wbg_ptr, obj);
2941
+ return obj;
2942
+ }
2943
+ __destroy_into_raw() {
2944
+ const ptr = this.__wbg_ptr;
2945
+ this.__wbg_ptr = 0;
2946
+ WasmSuggestionFinalization.unregister(this);
2947
+ return ptr;
2948
+ }
2949
+ free() {
2950
+ const ptr = this.__destroy_into_raw();
2951
+ wasm.__wbg_wasmsuggestion_free(ptr, 0);
2952
+ }
2953
+ /**
2954
+ * Confidence score (0.0 to 1.0)
2955
+ * @returns {number}
2956
+ */
2957
+ get confidence() {
2958
+ const ret = wasm.__wbg_get_wasmanalysisresult_analysis_time(this.__wbg_ptr);
2959
+ return ret;
2960
+ }
2961
+ /**
2962
+ * Confidence score (0.0 to 1.0)
2963
+ * @param {number} arg0
2964
+ */
2965
+ set confidence(arg0) {
2966
+ wasm.__wbg_set_wasmanalysisresult_analysis_time(this.__wbg_ptr, arg0);
2967
+ }
2968
+ /**
2969
+ * @returns {string | undefined}
2970
+ */
2971
+ get code_suggestion() {
2972
+ try {
2973
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2974
+ wasm.wasmsuggestion_code_suggestion(retptr, this.__wbg_ptr);
2975
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2976
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2977
+ let v1;
2978
+ if (r0 !== 0) {
2979
+ v1 = getStringFromWasm0(r0, r1).slice();
2980
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2981
+ }
2982
+ return v1;
2983
+ } finally {
2984
+ wasm.__wbindgen_add_to_stack_pointer(16);
2985
+ }
2986
+ }
2987
+ /**
2988
+ * @returns {string | undefined}
2989
+ */
2990
+ get explanation() {
2991
+ try {
2992
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2993
+ wasm.wasmsuggestion_explanation(retptr, this.__wbg_ptr);
2994
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2995
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2996
+ let v1;
2997
+ if (r0 !== 0) {
2998
+ v1 = getStringFromWasm0(r0, r1).slice();
2999
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
3000
+ }
3001
+ return v1;
3002
+ } finally {
3003
+ wasm.__wbindgen_add_to_stack_pointer(16);
3004
+ }
3005
+ }
3006
+ /**
3007
+ * @returns {string}
3008
+ */
3009
+ get message() {
3010
+ let deferred1_0;
3011
+ let deferred1_1;
3012
+ try {
3013
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3014
+ wasm.wasmsuggestion_message(retptr, this.__wbg_ptr);
3015
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3016
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3017
+ deferred1_0 = r0;
3018
+ deferred1_1 = r1;
3019
+ return getStringFromWasm0(r0, r1);
3020
+ } finally {
3021
+ wasm.__wbindgen_add_to_stack_pointer(16);
3022
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
3023
+ }
3024
+ }
3025
+ }
3026
+ if (Symbol.dispose) WasmSuggestion.prototype[Symbol.dispose] = WasmSuggestion.prototype.free;
3027
+
3028
+ /**
3029
+ * Get function names from bytecode as a JS value (array of objects)
3030
+ *
3031
+ * This function avoids constructing `FunctionNameInfo` JS instances and instead
3032
+ * marshals the parsed metadata directly into a serde-friendly structure and
3033
+ * returns a `JsValue` via `JsValue::from_serde`.
3034
+ * @param {Uint8Array} bytecode
3035
+ * @returns {any}
3036
+ */
3037
+ export function get_function_names(bytecode) {
3038
+ try {
3039
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3040
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
3041
+ const len0 = WASM_VECTOR_LEN;
3042
+ wasm.get_function_names(retptr, ptr0, len0);
3043
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3044
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3045
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3046
+ if (r2) {
3047
+ throw takeObject(r1);
3048
+ }
3049
+ return takeObject(r0);
3050
+ } finally {
3051
+ wasm.__wbindgen_add_to_stack_pointer(16);
3052
+ }
3053
+ }
3054
+
3055
+ /**
3056
+ * Get the count of public functions from bytecode header
3057
+ * @param {Uint8Array} bytecode
3058
+ * @returns {number}
3059
+ */
3060
+ export function get_public_function_count(bytecode) {
3061
+ try {
3062
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3063
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
3064
+ const len0 = WASM_VECTOR_LEN;
3065
+ wasm.get_public_function_count(retptr, ptr0, len0);
3066
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3067
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3068
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3069
+ if (r2) {
3070
+ throw takeObject(r1);
3071
+ }
3072
+ return r0;
3073
+ } finally {
3074
+ wasm.__wbindgen_add_to_stack_pointer(16);
3075
+ }
3076
+ }
3077
+
3078
+ /**
3079
+ * Get information about the WASM compiler capabilities
3080
+ * @returns {any}
3081
+ */
3082
+ export function get_wasm_compiler_info() {
3083
+ const ret = wasm.get_wasm_compiler_info();
3084
+ return takeObject(ret);
3085
+ }
3086
+
3087
+ /**
3088
+ * Helper function to convert JS value to VM Value
3089
+ * @param {any} js_val
3090
+ * @param {number} value_type
3091
+ * @returns {any}
3092
+ */
3093
+ export function js_value_to_vm_value(js_val, value_type) {
3094
+ try {
3095
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3096
+ wasm.js_value_to_vm_value(retptr, addBorrowedObject(js_val), value_type);
3097
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3098
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3099
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3100
+ if (r2) {
3101
+ throw takeObject(r1);
3102
+ }
3103
+ return takeObject(r0);
3104
+ } finally {
3105
+ wasm.__wbindgen_add_to_stack_pointer(16);
3106
+ heap[stack_pointer++] = undefined;
3107
+ }
3108
+ }
3109
+
3110
+ /**
3111
+ * @param {string} message
3112
+ */
3113
+ export function log_to_console(message) {
3114
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3115
+ const len0 = WASM_VECTOR_LEN;
3116
+ wasm.log_to_console(ptr0, len0);
3117
+ }
3118
+
3119
+ /**
3120
+ * Parse function names from bytecode metadata
3121
+ *
3122
+ * Returns a JS value which is a JSON string encoding an array of objects:
3123
+ * [ { "name": "...", "function_index": N }, ... ]
3124
+ * We serialize via serde_json and return the JSON string as a `JsValue` to
3125
+ * avoid complex JS object construction in Rust/WASM glue.
3126
+ * @param {Uint8Array} bytecode
3127
+ * @returns {any}
3128
+ */
3129
+ export function parse_function_names(bytecode) {
3130
+ try {
3131
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3132
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
3133
+ const len0 = WASM_VECTOR_LEN;
3134
+ wasm.parse_function_names(retptr, ptr0, len0);
3135
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3136
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3137
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3138
+ if (r2) {
3139
+ throw takeObject(r1);
3140
+ }
3141
+ return takeObject(r0);
3142
+ } finally {
3143
+ wasm.__wbindgen_add_to_stack_pointer(16);
3144
+ }
3145
+ }
3146
+
3147
+ /**
3148
+ * Utility: Validate optimized headers and mirror bytecode back to JS callers
3149
+ * @param {Uint8Array} bytecode
3150
+ * @returns {Uint8Array}
3151
+ */
3152
+ export function wrap_with_script_header(bytecode) {
3153
+ try {
3154
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3155
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_export);
3156
+ const len0 = WASM_VECTOR_LEN;
3157
+ wasm.wrap_with_script_header(retptr, ptr0, len0);
3158
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3159
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3160
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3161
+ if (r2) {
3162
+ throw takeObject(r1);
3163
+ }
3164
+ return takeObject(r0);
3165
+ } finally {
3166
+ wasm.__wbindgen_add_to_stack_pointer(16);
3167
+ }
3168
+ }
3169
+ export function __wbg_Error_8c4e43fe74559d73(arg0, arg1) {
3170
+ const ret = Error(getStringFromWasm0(arg0, arg1));
3171
+ return addHeapObject(ret);
3172
+ }
3173
+ export function __wbg_String_fed4d24b68977888(arg0, arg1) {
3174
+ const ret = String(getObject(arg1));
3175
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3176
+ const len1 = WASM_VECTOR_LEN;
3177
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3178
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3179
+ }
3180
+ export function __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2(arg0, arg1) {
3181
+ const v = getObject(arg1);
3182
+ const ret = typeof(v) === 'bigint' ? v : undefined;
3183
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3184
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3185
+ }
3186
+ export function __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25(arg0) {
3187
+ const v = getObject(arg0);
3188
+ const ret = typeof(v) === 'boolean' ? v : undefined;
3189
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
3190
+ }
3191
+ export function __wbg___wbindgen_debug_string_0bc8482c6e3508ae(arg0, arg1) {
3192
+ const ret = debugString(getObject(arg1));
3193
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3194
+ const len1 = WASM_VECTOR_LEN;
3195
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3196
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3197
+ }
3198
+ export function __wbg___wbindgen_in_47fa6863be6f2f25(arg0, arg1) {
3199
+ const ret = getObject(arg0) in getObject(arg1);
3200
+ return ret;
3201
+ }
3202
+ export function __wbg___wbindgen_is_bigint_31b12575b56f32fc(arg0) {
3203
+ const ret = typeof(getObject(arg0)) === 'bigint';
3204
+ return ret;
3205
+ }
3206
+ export function __wbg___wbindgen_is_function_0095a73b8b156f76(arg0) {
3207
+ const ret = typeof(getObject(arg0)) === 'function';
3208
+ return ret;
3209
+ }
3210
+ export function __wbg___wbindgen_is_object_5ae8e5880f2c1fbd(arg0) {
3211
+ const val = getObject(arg0);
3212
+ const ret = typeof(val) === 'object' && val !== null;
3213
+ return ret;
3214
+ }
3215
+ export function __wbg___wbindgen_is_string_cd444516edc5b180(arg0) {
3216
+ const ret = typeof(getObject(arg0)) === 'string';
3217
+ return ret;
3218
+ }
3219
+ export function __wbg___wbindgen_is_undefined_9e4d92534c42d778(arg0) {
3220
+ const ret = getObject(arg0) === undefined;
3221
+ return ret;
3222
+ }
3223
+ export function __wbg___wbindgen_jsval_eq_11888390b0186270(arg0, arg1) {
3224
+ const ret = getObject(arg0) === getObject(arg1);
3225
+ return ret;
3226
+ }
3227
+ export function __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811(arg0, arg1) {
3228
+ const ret = getObject(arg0) == getObject(arg1);
3229
+ return ret;
3230
+ }
3231
+ export function __wbg___wbindgen_number_get_8ff4255516ccad3e(arg0, arg1) {
3232
+ const obj = getObject(arg1);
3233
+ const ret = typeof(obj) === 'number' ? obj : undefined;
3234
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3235
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3236
+ }
3237
+ export function __wbg___wbindgen_string_get_72fb696202c56729(arg0, arg1) {
3238
+ const obj = getObject(arg1);
3239
+ const ret = typeof(obj) === 'string' ? obj : undefined;
3240
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3241
+ var len1 = WASM_VECTOR_LEN;
3242
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3243
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3244
+ }
3245
+ export function __wbg___wbindgen_throw_be289d5034ed271b(arg0, arg1) {
3246
+ throw new Error(getStringFromWasm0(arg0, arg1));
3247
+ }
3248
+ export function __wbg_call_389efe28435a9388() { return handleError(function (arg0, arg1) {
3249
+ const ret = getObject(arg0).call(getObject(arg1));
3250
+ return addHeapObject(ret);
3251
+ }, arguments); }
3252
+ export function __wbg_done_57b39ecd9addfe81(arg0) {
3253
+ const ret = getObject(arg0).done;
3254
+ return ret;
3255
+ }
3256
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
3257
+ let deferred0_0;
3258
+ let deferred0_1;
3259
+ try {
3260
+ deferred0_0 = arg0;
3261
+ deferred0_1 = arg1;
3262
+ console.error(getStringFromWasm0(arg0, arg1));
3263
+ } finally {
3264
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
3265
+ }
3266
+ }
3267
+ export function __wbg_error_9a7fe3f932034cde(arg0) {
3268
+ console.error(getObject(arg0));
3269
+ }
3270
+ export function __wbg_getRandomValues_9c5c1b115e142bb8() { return handleError(function (arg0, arg1) {
3271
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
3272
+ }, arguments); }
3273
+ export function __wbg_get_9b94d73e6221f75c(arg0, arg1) {
3274
+ const ret = getObject(arg0)[arg1 >>> 0];
3275
+ return addHeapObject(ret);
3276
+ }
3277
+ export function __wbg_get_b3ed3ad4be2bc8ac() { return handleError(function (arg0, arg1) {
3278
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
3279
+ return addHeapObject(ret);
3280
+ }, arguments); }
3281
+ export function __wbg_get_with_ref_key_bb8f74a92cb2e784(arg0, arg1) {
3282
+ const ret = getObject(arg0)[getObject(arg1)];
3283
+ return addHeapObject(ret);
3284
+ }
3285
+ export function __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04(arg0) {
3286
+ let result;
3287
+ try {
3288
+ result = getObject(arg0) instanceof ArrayBuffer;
3289
+ } catch (_) {
3290
+ result = false;
3291
+ }
3292
+ const ret = result;
3293
+ return ret;
3294
+ }
3295
+ export function __wbg_instanceof_Uint8Array_9b9075935c74707c(arg0) {
3296
+ let result;
3297
+ try {
3298
+ result = getObject(arg0) instanceof Uint8Array;
3299
+ } catch (_) {
3300
+ result = false;
3301
+ }
3302
+ const ret = result;
3303
+ return ret;
3304
+ }
3305
+ export function __wbg_isArray_d314bb98fcf08331(arg0) {
3306
+ const ret = Array.isArray(getObject(arg0));
3307
+ return ret;
3308
+ }
3309
+ export function __wbg_isSafeInteger_bfbc7332a9768d2a(arg0) {
3310
+ const ret = Number.isSafeInteger(getObject(arg0));
3311
+ return ret;
3312
+ }
3313
+ export function __wbg_iterator_6ff6560ca1568e55() {
3314
+ const ret = Symbol.iterator;
3315
+ return addHeapObject(ret);
3316
+ }
3317
+ export function __wbg_length_32ed9a279acd054c(arg0) {
3318
+ const ret = getObject(arg0).length;
3319
+ return ret;
3320
+ }
3321
+ export function __wbg_length_35a7bace40f36eac(arg0) {
3322
+ const ret = getObject(arg0).length;
3323
+ return ret;
3324
+ }
3325
+ export function __wbg_log_6b5ca2e6124b2808(arg0) {
3326
+ console.log(getObject(arg0));
3327
+ }
3328
+ export function __wbg_new_361308b2356cecd0() {
3329
+ const ret = new Object();
3330
+ return addHeapObject(ret);
3331
+ }
3332
+ export function __wbg_new_3eb36ae241fe6f44() {
3333
+ const ret = new Array();
3334
+ return addHeapObject(ret);
3335
+ }
3336
+ export function __wbg_new_8a6f238a6ece86ea() {
3337
+ const ret = new Error();
3338
+ return addHeapObject(ret);
3339
+ }
3340
+ export function __wbg_new_dca287b076112a51() {
3341
+ const ret = new Map();
3342
+ return addHeapObject(ret);
3343
+ }
3344
+ export function __wbg_new_dd2b680c8bf6ae29(arg0) {
3345
+ const ret = new Uint8Array(getObject(arg0));
3346
+ return addHeapObject(ret);
3347
+ }
3348
+ export function __wbg_new_from_slice_a3d2629dc1826784(arg0, arg1) {
3349
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
3350
+ return addHeapObject(ret);
3351
+ }
3352
+ export function __wbg_new_no_args_1c7c842f08d00ebb(arg0, arg1) {
3353
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
3354
+ return addHeapObject(ret);
3355
+ }
3356
+ export function __wbg_next_3482f54c49e8af19() { return handleError(function (arg0) {
3357
+ const ret = getObject(arg0).next();
3358
+ return addHeapObject(ret);
3359
+ }, arguments); }
3360
+ export function __wbg_next_418f80d8f5303233(arg0) {
3361
+ const ret = getObject(arg0).next;
3362
+ return addHeapObject(ret);
3363
+ }
3364
+ export function __wbg_now_2c95c9de01293173(arg0) {
3365
+ const ret = getObject(arg0).now();
3366
+ return ret;
3367
+ }
3368
+ export function __wbg_now_a3af9a2f4bbaa4d1() {
3369
+ const ret = Date.now();
3370
+ return ret;
3371
+ }
3372
+ export function __wbg_parse_708461a1feddfb38() { return handleError(function (arg0, arg1) {
3373
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3374
+ return addHeapObject(ret);
3375
+ }, arguments); }
3376
+ export function __wbg_performance_7a3ffd0b17f663ad(arg0) {
3377
+ const ret = getObject(arg0).performance;
3378
+ return addHeapObject(ret);
3379
+ }
3380
+ export function __wbg_prototypesetcall_bdcdcc5842e4d77d(arg0, arg1, arg2) {
3381
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
3382
+ }
3383
+ export function __wbg_push_8ffdcb2063340ba5(arg0, arg1) {
3384
+ const ret = getObject(arg0).push(getObject(arg1));
3385
+ return ret;
3386
+ }
3387
+ export function __wbg_set_1eb0999cf5d27fc8(arg0, arg1, arg2) {
3388
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
3389
+ return addHeapObject(ret);
3390
+ }
3391
+ export function __wbg_set_3fda3bac07393de4(arg0, arg1, arg2) {
3392
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3393
+ }
3394
+ export function __wbg_set_6cb8631f80447a67() { return handleError(function (arg0, arg1, arg2) {
3395
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
3396
+ return ret;
3397
+ }, arguments); }
3398
+ export function __wbg_set_f43e577aea94465b(arg0, arg1, arg2) {
3399
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
3400
+ }
3401
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
3402
+ const ret = getObject(arg1).stack;
3403
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3404
+ const len1 = WASM_VECTOR_LEN;
3405
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3406
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3407
+ }
3408
+ export function __wbg_static_accessor_GLOBAL_12837167ad935116() {
3409
+ const ret = typeof global === 'undefined' ? null : global;
3410
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3411
+ }
3412
+ export function __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f() {
3413
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
3414
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3415
+ }
3416
+ export function __wbg_static_accessor_SELF_a621d3dfbb60d0ce() {
3417
+ const ret = typeof self === 'undefined' ? null : self;
3418
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3419
+ }
3420
+ export function __wbg_static_accessor_WINDOW_f8727f0cf888e0bd() {
3421
+ const ret = typeof window === 'undefined' ? null : window;
3422
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3423
+ }
3424
+ export function __wbg_value_0546255b415e96c1(arg0) {
3425
+ const ret = getObject(arg0).value;
3426
+ return addHeapObject(ret);
3427
+ }
3428
+ export function __wbg_warn_f7ae1b2e66ccb930(arg0) {
3429
+ console.warn(getObject(arg0));
3430
+ }
3431
+ export function __wbg_wasmcompilererror_new(arg0) {
3432
+ const ret = WasmCompilerError.__wrap(arg0);
3433
+ return addHeapObject(ret);
3434
+ }
3435
+ export function __wbg_wasmsuggestion_new(arg0) {
3436
+ const ret = WasmSuggestion.__wrap(arg0);
3437
+ return addHeapObject(ret);
3438
+ }
3439
+ export function __wbindgen_cast_0000000000000001(arg0) {
3440
+ // Cast intrinsic for `F64 -> Externref`.
3441
+ const ret = arg0;
3442
+ return addHeapObject(ret);
3443
+ }
3444
+ export function __wbindgen_cast_0000000000000002(arg0) {
3445
+ // Cast intrinsic for `I64 -> Externref`.
3446
+ const ret = arg0;
3447
+ return addHeapObject(ret);
3448
+ }
3449
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
3450
+ // Cast intrinsic for `Ref(String) -> Externref`.
3451
+ const ret = getStringFromWasm0(arg0, arg1);
3452
+ return addHeapObject(ret);
3453
+ }
3454
+ export function __wbindgen_cast_0000000000000004(arg0) {
3455
+ // Cast intrinsic for `U64 -> Externref`.
3456
+ const ret = BigInt.asUintN(64, arg0);
3457
+ return addHeapObject(ret);
3458
+ }
3459
+ export function __wbindgen_object_clone_ref(arg0) {
3460
+ const ret = getObject(arg0);
3461
+ return addHeapObject(ret);
3462
+ }
3463
+ export function __wbindgen_object_drop_ref(arg0) {
3464
+ takeObject(arg0);
3465
+ }
3466
+ const BytecodeAnalyzerFinalization = (typeof FinalizationRegistry === 'undefined')
3467
+ ? { register: () => {}, unregister: () => {} }
3468
+ : new FinalizationRegistry(ptr => wasm.__wbg_bytecodeanalyzer_free(ptr >>> 0, 1));
3469
+ const BytecodeEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
3470
+ ? { register: () => {}, unregister: () => {} }
3471
+ : new FinalizationRegistry(ptr => wasm.__wbg_bytecodeencoder_free(ptr >>> 0, 1));
3472
+ const FiveVMStateFinalization = (typeof FinalizationRegistry === 'undefined')
3473
+ ? { register: () => {}, unregister: () => {} }
3474
+ : new FinalizationRegistry(ptr => wasm.__wbg_fivevmstate_free(ptr >>> 0, 1));
3475
+ const FiveVMWasmFinalization = (typeof FinalizationRegistry === 'undefined')
3476
+ ? { register: () => {}, unregister: () => {} }
3477
+ : new FinalizationRegistry(ptr => wasm.__wbg_fivevmwasm_free(ptr >>> 0, 1));
3478
+ const ParameterEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
3479
+ ? { register: () => {}, unregister: () => {} }
3480
+ : new FinalizationRegistry(ptr => wasm.__wbg_parameterencoder_free(ptr >>> 0, 1));
3481
+ const TestResultFinalization = (typeof FinalizationRegistry === 'undefined')
3482
+ ? { register: () => {}, unregister: () => {} }
3483
+ : new FinalizationRegistry(ptr => wasm.__wbg_testresult_free(ptr >>> 0, 1));
3484
+ const WasmAccountFinalization = (typeof FinalizationRegistry === 'undefined')
3485
+ ? { register: () => {}, unregister: () => {} }
3486
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmaccount_free(ptr >>> 0, 1));
3487
+ const WasmAnalysisResultFinalization = (typeof FinalizationRegistry === 'undefined')
3488
+ ? { register: () => {}, unregister: () => {} }
3489
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmanalysisresult_free(ptr >>> 0, 1));
3490
+ const WasmCompilationOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
3491
+ ? { register: () => {}, unregister: () => {} }
3492
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationoptions_free(ptr >>> 0, 1));
3493
+ const WasmCompilationResultFinalization = (typeof FinalizationRegistry === 'undefined')
3494
+ ? { register: () => {}, unregister: () => {} }
3495
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationresult_free(ptr >>> 0, 1));
3496
+ const WasmCompilationWithMetricsFinalization = (typeof FinalizationRegistry === 'undefined')
3497
+ ? { register: () => {}, unregister: () => {} }
3498
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilationwithmetrics_free(ptr >>> 0, 1));
3499
+ const WasmCompilerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
3500
+ ? { register: () => {}, unregister: () => {} }
3501
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcompilererror_free(ptr >>> 0, 1));
3502
+ const WasmEnhancedCompilationResultFinalization = (typeof FinalizationRegistry === 'undefined')
3503
+ ? { register: () => {}, unregister: () => {} }
3504
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmenhancedcompilationresult_free(ptr >>> 0, 1));
3505
+ const WasmFiveCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
3506
+ ? { register: () => {}, unregister: () => {} }
3507
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmfivecompiler_free(ptr >>> 0, 1));
3508
+ const WasmMetricsCollectorFinalization = (typeof FinalizationRegistry === 'undefined')
3509
+ ? { register: () => {}, unregister: () => {} }
3510
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmetricscollector_free(ptr >>> 0, 1));
3511
+ const WasmSourceLocationFinalization = (typeof FinalizationRegistry === 'undefined')
3512
+ ? { register: () => {}, unregister: () => {} }
3513
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmsourcelocation_free(ptr >>> 0, 1));
3514
+ const WasmSuggestionFinalization = (typeof FinalizationRegistry === 'undefined')
3515
+ ? { register: () => {}, unregister: () => {} }
3516
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmsuggestion_free(ptr >>> 0, 1));
3517
+
3518
+ function addHeapObject(obj) {
3519
+ if (heap_next === heap.length) heap.push(heap.length + 1);
3520
+ const idx = heap_next;
3521
+ heap_next = heap[idx];
3522
+
3523
+ heap[idx] = obj;
3524
+ return idx;
3525
+ }
3526
+
3527
+ function _assertClass(instance, klass) {
3528
+ if (!(instance instanceof klass)) {
3529
+ throw new Error(`expected instance of ${klass.name}`);
3530
+ }
3531
+ }
3532
+
3533
+ function addBorrowedObject(obj) {
3534
+ if (stack_pointer == 1) throw new Error('out of js stack');
3535
+ heap[--stack_pointer] = obj;
3536
+ return stack_pointer;
3537
+ }
3538
+
3539
+ function debugString(val) {
3540
+ // primitive types
3541
+ const type = typeof val;
3542
+ if (type == 'number' || type == 'boolean' || val == null) {
3543
+ return `${val}`;
3544
+ }
3545
+ if (type == 'string') {
3546
+ return `"${val}"`;
3547
+ }
3548
+ if (type == 'symbol') {
3549
+ const description = val.description;
3550
+ if (description == null) {
3551
+ return 'Symbol';
3552
+ } else {
3553
+ return `Symbol(${description})`;
3554
+ }
3555
+ }
3556
+ if (type == 'function') {
3557
+ const name = val.name;
3558
+ if (typeof name == 'string' && name.length > 0) {
3559
+ return `Function(${name})`;
3560
+ } else {
3561
+ return 'Function';
3562
+ }
3563
+ }
3564
+ // objects
3565
+ if (Array.isArray(val)) {
3566
+ const length = val.length;
3567
+ let debug = '[';
3568
+ if (length > 0) {
3569
+ debug += debugString(val[0]);
3570
+ }
3571
+ for(let i = 1; i < length; i++) {
3572
+ debug += ', ' + debugString(val[i]);
3573
+ }
3574
+ debug += ']';
3575
+ return debug;
3576
+ }
3577
+ // Test for built-in
3578
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
3579
+ let className;
3580
+ if (builtInMatches && builtInMatches.length > 1) {
3581
+ className = builtInMatches[1];
3582
+ } else {
3583
+ // Failed to match the standard '[object ClassName]'
3584
+ return toString.call(val);
3585
+ }
3586
+ if (className == 'Object') {
3587
+ // we're a user defined class or Object
3588
+ // JSON.stringify avoids problems with cycles, and is generally much
3589
+ // easier than looping through ownProperties of `val`.
3590
+ try {
3591
+ return 'Object(' + JSON.stringify(val) + ')';
3592
+ } catch (_) {
3593
+ return 'Object';
3594
+ }
3595
+ }
3596
+ // errors
3597
+ if (val instanceof Error) {
3598
+ return `${val.name}: ${val.message}\n${val.stack}`;
3599
+ }
3600
+ // TODO we could test for more things here, like `Set`s and `Map`s.
3601
+ return className;
3602
+ }
3603
+
3604
+ function dropObject(idx) {
3605
+ if (idx < 132) return;
3606
+ heap[idx] = heap_next;
3607
+ heap_next = idx;
3608
+ }
3609
+
3610
+ function getArrayJsValueFromWasm0(ptr, len) {
3611
+ ptr = ptr >>> 0;
3612
+ const mem = getDataViewMemory0();
3613
+ const result = [];
3614
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
3615
+ result.push(takeObject(mem.getUint32(i, true)));
3616
+ }
3617
+ return result;
3618
+ }
3619
+
3620
+ function getArrayU8FromWasm0(ptr, len) {
3621
+ ptr = ptr >>> 0;
3622
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
3623
+ }
3624
+
3625
+ let cachedDataViewMemory0 = null;
3626
+ function getDataViewMemory0() {
3627
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
3628
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
3629
+ }
3630
+ return cachedDataViewMemory0;
3631
+ }
3632
+
3633
+ function getStringFromWasm0(ptr, len) {
3634
+ ptr = ptr >>> 0;
3635
+ return decodeText(ptr, len);
3636
+ }
3637
+
3638
+ let cachedUint8ArrayMemory0 = null;
3639
+ function getUint8ArrayMemory0() {
3640
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
3641
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
3642
+ }
3643
+ return cachedUint8ArrayMemory0;
3644
+ }
3645
+
3646
+ function getObject(idx) { return heap[idx]; }
3647
+
3648
+ function handleError(f, args) {
3649
+ try {
3650
+ return f.apply(this, args);
3651
+ } catch (e) {
3652
+ wasm.__wbindgen_export3(addHeapObject(e));
3653
+ }
3654
+ }
3655
+
3656
+ let heap = new Array(128).fill(undefined);
3657
+ heap.push(undefined, null, true, false);
3658
+
3659
+ let heap_next = heap.length;
3660
+
3661
+ function isLikeNone(x) {
3662
+ return x === undefined || x === null;
3663
+ }
3664
+
3665
+ function passArray8ToWasm0(arg, malloc) {
3666
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
3667
+ getUint8ArrayMemory0().set(arg, ptr / 1);
3668
+ WASM_VECTOR_LEN = arg.length;
3669
+ return ptr;
3670
+ }
3671
+
3672
+ function passStringToWasm0(arg, malloc, realloc) {
3673
+ if (realloc === undefined) {
3674
+ const buf = cachedTextEncoder.encode(arg);
3675
+ const ptr = malloc(buf.length, 1) >>> 0;
3676
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
3677
+ WASM_VECTOR_LEN = buf.length;
3678
+ return ptr;
3679
+ }
3680
+
3681
+ let len = arg.length;
3682
+ let ptr = malloc(len, 1) >>> 0;
3683
+
3684
+ const mem = getUint8ArrayMemory0();
3685
+
3686
+ let offset = 0;
3687
+
3688
+ for (; offset < len; offset++) {
3689
+ const code = arg.charCodeAt(offset);
3690
+ if (code > 0x7F) break;
3691
+ mem[ptr + offset] = code;
3692
+ }
3693
+ if (offset !== len) {
3694
+ if (offset !== 0) {
3695
+ arg = arg.slice(offset);
3696
+ }
3697
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
3698
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
3699
+ const ret = cachedTextEncoder.encodeInto(arg, view);
3700
+
3701
+ offset += ret.written;
3702
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
3703
+ }
3704
+
3705
+ WASM_VECTOR_LEN = offset;
3706
+ return ptr;
3707
+ }
3708
+
3709
+ let stack_pointer = 128;
3710
+
3711
+ function takeObject(idx) {
3712
+ const ret = getObject(idx);
3713
+ dropObject(idx);
3714
+ return ret;
3715
+ }
3716
+
3717
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
3718
+ cachedTextDecoder.decode();
3719
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
3720
+ let numBytesDecoded = 0;
3721
+ function decodeText(ptr, len) {
3722
+ numBytesDecoded += len;
3723
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
3724
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
3725
+ cachedTextDecoder.decode();
3726
+ numBytesDecoded = len;
3727
+ }
3728
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
3729
+ }
3730
+
3731
+ const cachedTextEncoder = new TextEncoder();
3732
+
3733
+ if (!('encodeInto' in cachedTextEncoder)) {
3734
+ cachedTextEncoder.encodeInto = function (arg, view) {
3735
+ const buf = cachedTextEncoder.encode(arg);
3736
+ view.set(buf);
3737
+ return {
3738
+ read: arg.length,
3739
+ written: buf.length
3740
+ };
3741
+ };
3742
+ }
3743
+
3744
+ let WASM_VECTOR_LEN = 0;
3745
+
3746
+
3747
+ let wasm;
3748
+ export function __wbg_set_wasm(val) {
3749
+ wasm = val;
3750
+ }