logic-mesh 0.1.10 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -31
- package/dist/TypedBlock.d.ts +49 -0
- package/dist/TypedBlock.js +124 -0
- package/dist/index.d.ts +210 -0
- package/dist/index.js +2 -0
- package/dist/logic_mesh.d.ts +183 -0
- package/{logic_mesh.js → dist/logic_mesh.js} +5 -2
- package/dist/logic_mesh_bg.js +1009 -0
- package/dist/logic_mesh_bg.wasm +0 -0
- package/dist/logic_mesh_bg.wasm.d.ts +37 -0
- package/package.json +57 -33
- package/index.d.ts +0 -239
- package/index.js +0 -1
- package/logic_mesh.d.ts +0 -211
- package/logic_mesh_bg.js +0 -1125
- package/logic_mesh_bg.wasm +0 -0
|
@@ -0,0 +1,1009 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controls the execution or the blocks.
|
|
3
|
+
* Loads programs and enables inspection and debugging
|
|
4
|
+
* of the blocks and their inputs and outputs.
|
|
5
|
+
*/
|
|
6
|
+
export class BlocksEngine {
|
|
7
|
+
static __wrap(ptr) {
|
|
8
|
+
const obj = Object.create(BlocksEngine.prototype);
|
|
9
|
+
obj.__wbg_ptr = ptr;
|
|
10
|
+
BlocksEngineFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
__destroy_into_raw() {
|
|
14
|
+
const ptr = this.__wbg_ptr;
|
|
15
|
+
this.__wbg_ptr = 0;
|
|
16
|
+
BlocksEngineFinalization.unregister(this);
|
|
17
|
+
return ptr;
|
|
18
|
+
}
|
|
19
|
+
free() {
|
|
20
|
+
const ptr = this.__destroy_into_raw();
|
|
21
|
+
wasm.__wbg_blocksengine_free(ptr, 0);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @returns {EngineCommand}
|
|
25
|
+
*/
|
|
26
|
+
engineCommand() {
|
|
27
|
+
const ret = wasm.blocksengine_engineCommand(this.__wbg_ptr);
|
|
28
|
+
return EngineCommand.__wrap(ret);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Lists all available blocks
|
|
32
|
+
* @returns {Array<any>}
|
|
33
|
+
*/
|
|
34
|
+
listBlocks() {
|
|
35
|
+
const ret = wasm.blocksengine_listBlocks(this.__wbg_ptr);
|
|
36
|
+
return takeObject(ret);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a new instance of an engine
|
|
40
|
+
* @param {bigint | null} [sleep_duration]
|
|
41
|
+
*/
|
|
42
|
+
constructor(sleep_duration) {
|
|
43
|
+
const ret = wasm.blocksengine_new(!isLikeNone(sleep_duration), isLikeNone(sleep_duration) ? BigInt(0) : sleep_duration);
|
|
44
|
+
this.__wbg_ptr = ret;
|
|
45
|
+
BlocksEngineFinalization.register(this, this.__wbg_ptr, this);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Register a new JS block in the registry
|
|
50
|
+
* The block is described by a JsBlockDesc object
|
|
51
|
+
*
|
|
52
|
+
* # Arguments
|
|
53
|
+
* * `desc` - The description of the block
|
|
54
|
+
* * `func` - Optional function that implements the block
|
|
55
|
+
* logic. If not provided, the block would do nothing.
|
|
56
|
+
*
|
|
57
|
+
* # Returns
|
|
58
|
+
* The name of the block
|
|
59
|
+
* @param {any} desc
|
|
60
|
+
* @param {Function | null} [func]
|
|
61
|
+
* @returns {string}
|
|
62
|
+
*/
|
|
63
|
+
registerBlock(desc, func) {
|
|
64
|
+
let deferred2_0;
|
|
65
|
+
let deferred2_1;
|
|
66
|
+
try {
|
|
67
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
68
|
+
wasm.blocksengine_registerBlock(retptr, this.__wbg_ptr, addHeapObject(desc), isLikeNone(func) ? 0 : addHeapObject(func));
|
|
69
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
70
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
71
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
72
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
73
|
+
var ptr1 = r0;
|
|
74
|
+
var len1 = r1;
|
|
75
|
+
if (r3) {
|
|
76
|
+
ptr1 = 0; len1 = 0;
|
|
77
|
+
throw takeObject(r2);
|
|
78
|
+
}
|
|
79
|
+
deferred2_0 = ptr1;
|
|
80
|
+
deferred2_1 = len1;
|
|
81
|
+
return getStringFromWasm0(ptr1, len1);
|
|
82
|
+
} finally {
|
|
83
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
84
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Runs the engine asynchronously
|
|
89
|
+
* After this is called, the engine instance can't be used directly
|
|
90
|
+
* Instead use the command object to communicate with the engine.
|
|
91
|
+
* @returns {Promise<void>}
|
|
92
|
+
*/
|
|
93
|
+
run() {
|
|
94
|
+
const ret = wasm.blocksengine_run(this.__wbg_ptr);
|
|
95
|
+
return takeObject(ret);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (Symbol.dispose) BlocksEngine.prototype[Symbol.dispose] = BlocksEngine.prototype.free;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Commands a running instance of a Block Engine.
|
|
102
|
+
*/
|
|
103
|
+
export class EngineCommand {
|
|
104
|
+
static __wrap(ptr) {
|
|
105
|
+
const obj = Object.create(EngineCommand.prototype);
|
|
106
|
+
obj.__wbg_ptr = ptr;
|
|
107
|
+
EngineCommandFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
108
|
+
return obj;
|
|
109
|
+
}
|
|
110
|
+
__destroy_into_raw() {
|
|
111
|
+
const ptr = this.__wbg_ptr;
|
|
112
|
+
this.__wbg_ptr = 0;
|
|
113
|
+
EngineCommandFinalization.unregister(this);
|
|
114
|
+
return ptr;
|
|
115
|
+
}
|
|
116
|
+
free() {
|
|
117
|
+
const ptr = this.__destroy_into_raw();
|
|
118
|
+
wasm.__wbg_enginecommand_free(ptr, 0);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Adds a block instance to the engine
|
|
122
|
+
* to be immediately scheduled for execution
|
|
123
|
+
* @param {string} block_name
|
|
124
|
+
* @param {string | null} [block_uuid]
|
|
125
|
+
* @param {string | null} [lib]
|
|
126
|
+
* @returns {Promise<string>}
|
|
127
|
+
*/
|
|
128
|
+
addBlock(block_name, block_uuid, lib) {
|
|
129
|
+
const ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
130
|
+
const len0 = WASM_VECTOR_LEN;
|
|
131
|
+
var ptr1 = isLikeNone(block_uuid) ? 0 : passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
132
|
+
var len1 = WASM_VECTOR_LEN;
|
|
133
|
+
var ptr2 = isLikeNone(lib) ? 0 : passStringToWasm0(lib, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
134
|
+
var len2 = WASM_VECTOR_LEN;
|
|
135
|
+
const ret = wasm.enginecommand_addBlock(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
136
|
+
return takeObject(ret);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Creates a link between two blocks
|
|
140
|
+
*
|
|
141
|
+
* # Arguments
|
|
142
|
+
* * `source_block_uuid` - The UUID of the source block
|
|
143
|
+
* * `target_block_uuid` - The UUID of the target block
|
|
144
|
+
* * `source_block_pin_name` - The name of the output pin of the source block
|
|
145
|
+
* * `target_block_input_name` - The name of the input pin of the target block
|
|
146
|
+
*
|
|
147
|
+
* # Returns
|
|
148
|
+
* A `LinkData` object with the following properties:
|
|
149
|
+
* * `source_block_uuid` - The UUID of the source block
|
|
150
|
+
* * `target_block_uuid` - The UUID of the target block
|
|
151
|
+
* * `source_block_pin_name` - The name of the output pin of the source block
|
|
152
|
+
* * `target_block_input_name` - The name of the input pin of the target block
|
|
153
|
+
* @param {string} source_block_uuid
|
|
154
|
+
* @param {string} target_block_uuid
|
|
155
|
+
* @param {string} source_block_pin_name
|
|
156
|
+
* @param {string} target_block_pin_name
|
|
157
|
+
* @returns {Promise<any>}
|
|
158
|
+
*/
|
|
159
|
+
createLink(source_block_uuid, target_block_uuid, source_block_pin_name, target_block_pin_name) {
|
|
160
|
+
const ptr0 = passStringToWasm0(source_block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
161
|
+
const len0 = WASM_VECTOR_LEN;
|
|
162
|
+
const ptr1 = passStringToWasm0(target_block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
163
|
+
const len1 = WASM_VECTOR_LEN;
|
|
164
|
+
const ptr2 = passStringToWasm0(source_block_pin_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
165
|
+
const len2 = WASM_VECTOR_LEN;
|
|
166
|
+
const ptr3 = passStringToWasm0(target_block_pin_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
167
|
+
const len3 = WASM_VECTOR_LEN;
|
|
168
|
+
const ret = wasm.enginecommand_createLink(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
169
|
+
return takeObject(ret);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Creates a watch on block changes.
|
|
173
|
+
*
|
|
174
|
+
* The engine→UI watch channel is **unbounded**. The producer rate is
|
|
175
|
+
* capped by per-block execution cadence and the payload is tiny
|
|
176
|
+
* (one `WatchMessage` per changed block per cycle); a bounded channel
|
|
177
|
+
* (we had 32) was undersized for bursty loads — e.g., dozens of
|
|
178
|
+
* blocks faulting simultaneously during program load — and silently
|
|
179
|
+
* dropped fault notifications, which the UI is now load-bearing on
|
|
180
|
+
* (red ring/edge rendering).
|
|
181
|
+
* @param {Function} callback
|
|
182
|
+
* @returns {Promise<void>}
|
|
183
|
+
*/
|
|
184
|
+
createWatch(callback) {
|
|
185
|
+
const ret = wasm.enginecommand_createWatch(this.__wbg_ptr, addHeapObject(callback));
|
|
186
|
+
return takeObject(ret);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Evaluates a block by name
|
|
190
|
+
* This will create a block instance and execute it.
|
|
191
|
+
*
|
|
192
|
+
* # Arguments
|
|
193
|
+
* * `block_name` - The name of the block to evaluate
|
|
194
|
+
* * `inputs` - The input values to the block
|
|
195
|
+
* * `lib` - Optional, the library to load the block from, defaults to "core"
|
|
196
|
+
*
|
|
197
|
+
* # Returns
|
|
198
|
+
* A list of values representing the outputs of the block
|
|
199
|
+
* @param {string} block_name
|
|
200
|
+
* @param {any[]} inputs
|
|
201
|
+
* @param {string | null} [lib]
|
|
202
|
+
* @returns {Promise<any>}
|
|
203
|
+
*/
|
|
204
|
+
evalBlock(block_name, inputs, lib) {
|
|
205
|
+
const ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
206
|
+
const len0 = WASM_VECTOR_LEN;
|
|
207
|
+
const ptr1 = passArrayJsValueToWasm0(inputs, wasm.__wbindgen_export);
|
|
208
|
+
const len1 = WASM_VECTOR_LEN;
|
|
209
|
+
var ptr2 = isLikeNone(lib) ? 0 : passStringToWasm0(lib, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
210
|
+
var len2 = WASM_VECTOR_LEN;
|
|
211
|
+
const ret = wasm.enginecommand_evalBlock(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
212
|
+
return takeObject(ret);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Get the current running engine program in the canonical save
|
|
216
|
+
* format (Program struct serialized as JSON). Round-trips through
|
|
217
|
+
* `loadProgram` without re-assembly.
|
|
218
|
+
* @returns {Promise<any>}
|
|
219
|
+
*/
|
|
220
|
+
getProgram() {
|
|
221
|
+
const ret = wasm.enginecommand_getProgram(this.__wbg_ptr);
|
|
222
|
+
return takeObject(ret);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Inspects the current state of a block
|
|
226
|
+
* @param {string} block_uuid
|
|
227
|
+
* @returns {Promise<any>}
|
|
228
|
+
*/
|
|
229
|
+
inspectBlock(block_uuid) {
|
|
230
|
+
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
232
|
+
const ret = wasm.enginecommand_inspectBlock(this.__wbg_ptr, ptr0, len0);
|
|
233
|
+
return takeObject(ret);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Atomically load a full program (blocks + links + pin values +
|
|
237
|
+
* UI metadata) into the engine. Replaces the previous JS-side
|
|
238
|
+
* `addBlock` + `createLink` + `writeBlockInput` chain. The engine
|
|
239
|
+
* is expected to be empty (call `resetEngine` first if reloading).
|
|
240
|
+
* @param {any} program
|
|
241
|
+
* @returns {Promise<void>}
|
|
242
|
+
*/
|
|
243
|
+
loadProgram(program) {
|
|
244
|
+
const ret = wasm.enginecommand_loadProgram(this.__wbg_ptr, addHeapObject(program));
|
|
245
|
+
return takeObject(ret);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Pauses the execution of the engine
|
|
249
|
+
* If the engine is already paused, this does nothing
|
|
250
|
+
* @returns {Promise<void>}
|
|
251
|
+
*/
|
|
252
|
+
pauseExecution() {
|
|
253
|
+
const ret = wasm.enginecommand_pauseExecution(this.__wbg_ptr);
|
|
254
|
+
return takeObject(ret);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Removes a block instance from the engine
|
|
258
|
+
* to be immediately unscheduled for execution
|
|
259
|
+
* and removed from the engine together with all its links.
|
|
260
|
+
*
|
|
261
|
+
* # Arguments
|
|
262
|
+
* * `block_uuid` - The UUID of the block to be removed
|
|
263
|
+
*
|
|
264
|
+
* # Returns
|
|
265
|
+
* The UUID of the removed block
|
|
266
|
+
* @param {string} block_uuid
|
|
267
|
+
* @returns {Promise<string>}
|
|
268
|
+
*/
|
|
269
|
+
removeBlock(block_uuid) {
|
|
270
|
+
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ret = wasm.enginecommand_removeBlock(this.__wbg_ptr, ptr0, len0);
|
|
273
|
+
return takeObject(ret);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Removes a link between two blocks
|
|
277
|
+
*
|
|
278
|
+
* # Arguments
|
|
279
|
+
* * `link_uuid` - The UUID of the link to be removed
|
|
280
|
+
*
|
|
281
|
+
* # Returns
|
|
282
|
+
* True if the link was removed, false otherwise
|
|
283
|
+
* @param {string} link_uuid
|
|
284
|
+
* @returns {Promise<boolean>}
|
|
285
|
+
*/
|
|
286
|
+
removeLink(link_uuid) {
|
|
287
|
+
const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ret = wasm.enginecommand_removeLink(this.__wbg_ptr, ptr0, len0);
|
|
290
|
+
return takeObject(ret);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Resets the engine state, clears all blocks and links
|
|
294
|
+
* @returns {Promise<void>}
|
|
295
|
+
*/
|
|
296
|
+
resetEngine() {
|
|
297
|
+
const ret = wasm.enginecommand_resetEngine(this.__wbg_ptr);
|
|
298
|
+
return takeObject(ret);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Resumes the execution of the engine
|
|
302
|
+
* If the engine is not paused, this does nothing
|
|
303
|
+
* @returns {Promise<void>}
|
|
304
|
+
*/
|
|
305
|
+
resumeExecution() {
|
|
306
|
+
const ret = wasm.enginecommand_resumeExecution(this.__wbg_ptr);
|
|
307
|
+
return takeObject(ret);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Stop the engine's execution
|
|
311
|
+
* @returns {Promise<void>}
|
|
312
|
+
*/
|
|
313
|
+
stopEngine() {
|
|
314
|
+
const ret = wasm.enginecommand_stopEngine(this.__wbg_ptr);
|
|
315
|
+
return takeObject(ret);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Writes the given block input with a value
|
|
319
|
+
*
|
|
320
|
+
* # Arguments
|
|
321
|
+
* * `block_uuid` - The UUID of the block to write to
|
|
322
|
+
* * `input_name` - The name of the input to write to
|
|
323
|
+
* * `value` - The value to write
|
|
324
|
+
*
|
|
325
|
+
* # Returns
|
|
326
|
+
* The previous value of the input
|
|
327
|
+
* @param {string} block_uuid
|
|
328
|
+
* @param {string} input_name
|
|
329
|
+
* @param {any} value
|
|
330
|
+
* @returns {Promise<any>}
|
|
331
|
+
*/
|
|
332
|
+
writeBlockInput(block_uuid, input_name, value) {
|
|
333
|
+
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
334
|
+
const len0 = WASM_VECTOR_LEN;
|
|
335
|
+
const ptr1 = passStringToWasm0(input_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
336
|
+
const len1 = WASM_VECTOR_LEN;
|
|
337
|
+
const ret = wasm.enginecommand_writeBlockInput(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(value));
|
|
338
|
+
return takeObject(ret);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Writes the given block out with a value
|
|
342
|
+
*
|
|
343
|
+
* # Arguments
|
|
344
|
+
* * `block_uuid` - The UUID of the block to write to
|
|
345
|
+
* * `output_name` - The name of the output to write to
|
|
346
|
+
* * `value` - The value to write
|
|
347
|
+
*
|
|
348
|
+
* # Returns
|
|
349
|
+
* The block data
|
|
350
|
+
* @param {string} block_uuid
|
|
351
|
+
* @param {string} output_name
|
|
352
|
+
* @param {any} value
|
|
353
|
+
* @returns {Promise<any>}
|
|
354
|
+
*/
|
|
355
|
+
writeBlockOutput(block_uuid, output_name, value) {
|
|
356
|
+
const ptr0 = passStringToWasm0(block_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
357
|
+
const len0 = WASM_VECTOR_LEN;
|
|
358
|
+
const ptr1 = passStringToWasm0(output_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
359
|
+
const len1 = WASM_VECTOR_LEN;
|
|
360
|
+
const ret = wasm.enginecommand_writeBlockOutput(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(value));
|
|
361
|
+
return takeObject(ret);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (Symbol.dispose) EngineCommand.prototype[Symbol.dispose] = EngineCommand.prototype.free;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @param {number | null} [sleep_duration]
|
|
368
|
+
* @returns {BlocksEngine}
|
|
369
|
+
*/
|
|
370
|
+
export function initEngine(sleep_duration) {
|
|
371
|
+
const ret = wasm.initEngine(isLikeNone(sleep_duration) ? Number.MAX_SAFE_INTEGER : (sleep_duration) >>> 0);
|
|
372
|
+
return BlocksEngine.__wrap(ret);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export function init_panic_hook() {
|
|
376
|
+
wasm.init_panic_hook();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export function start() {
|
|
380
|
+
wasm.start();
|
|
381
|
+
}
|
|
382
|
+
export function __wbg_Error_bce6d499ff0a4aff(arg0, arg1) {
|
|
383
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
384
|
+
return addHeapObject(ret);
|
|
385
|
+
}
|
|
386
|
+
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
387
|
+
const ret = String(getObject(arg1));
|
|
388
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
389
|
+
const len1 = WASM_VECTOR_LEN;
|
|
390
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
391
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
392
|
+
}
|
|
393
|
+
export function __wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83(arg0, arg1) {
|
|
394
|
+
const v = getObject(arg1);
|
|
395
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
396
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
397
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
398
|
+
}
|
|
399
|
+
export function __wbg___wbindgen_boolean_get_2304fb8c853028c8(arg0) {
|
|
400
|
+
const v = getObject(arg0);
|
|
401
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
402
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
403
|
+
}
|
|
404
|
+
export function __wbg___wbindgen_debug_string_edece8177ad01481(arg0, arg1) {
|
|
405
|
+
const ret = debugString(getObject(arg1));
|
|
406
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
407
|
+
const len1 = WASM_VECTOR_LEN;
|
|
408
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
409
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
410
|
+
}
|
|
411
|
+
export function __wbg___wbindgen_in_07056af4f902c445(arg0, arg1) {
|
|
412
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
413
|
+
return ret;
|
|
414
|
+
}
|
|
415
|
+
export function __wbg___wbindgen_is_bigint_aeae3893f30ed54e(arg0) {
|
|
416
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
417
|
+
return ret;
|
|
418
|
+
}
|
|
419
|
+
export function __wbg___wbindgen_is_function_5cd60d5cf78b4eef(arg0) {
|
|
420
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
421
|
+
return ret;
|
|
422
|
+
}
|
|
423
|
+
export function __wbg___wbindgen_is_object_b4593df85baada48(arg0) {
|
|
424
|
+
const val = getObject(arg0);
|
|
425
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
426
|
+
return ret;
|
|
427
|
+
}
|
|
428
|
+
export function __wbg___wbindgen_is_string_dde0fd9020db4434(arg0) {
|
|
429
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
430
|
+
return ret;
|
|
431
|
+
}
|
|
432
|
+
export function __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5(arg0) {
|
|
433
|
+
const ret = getObject(arg0) === undefined;
|
|
434
|
+
return ret;
|
|
435
|
+
}
|
|
436
|
+
export function __wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9(arg0, arg1) {
|
|
437
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
438
|
+
return ret;
|
|
439
|
+
}
|
|
440
|
+
export function __wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c(arg0, arg1) {
|
|
441
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
442
|
+
return ret;
|
|
443
|
+
}
|
|
444
|
+
export function __wbg___wbindgen_number_get_f73a1244370fcc2c(arg0, arg1) {
|
|
445
|
+
const obj = getObject(arg1);
|
|
446
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
447
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
448
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
449
|
+
}
|
|
450
|
+
export function __wbg___wbindgen_string_get_d109740c0d18f4d7(arg0, arg1) {
|
|
451
|
+
const obj = getObject(arg1);
|
|
452
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
453
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
454
|
+
var len1 = WASM_VECTOR_LEN;
|
|
455
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
456
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
457
|
+
}
|
|
458
|
+
export function __wbg___wbindgen_throw_9c31b086c2b26051(arg0, arg1) {
|
|
459
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
460
|
+
}
|
|
461
|
+
export function __wbg__wbg_cb_unref_3fa391f3fcdb55f8(arg0) {
|
|
462
|
+
getObject(arg0)._wbg_cb_unref();
|
|
463
|
+
}
|
|
464
|
+
export function __wbg_call_13665d9f14390edc() { return handleError(function (arg0, arg1) {
|
|
465
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
466
|
+
return addHeapObject(ret);
|
|
467
|
+
}, arguments); }
|
|
468
|
+
export function __wbg_call_dfde26266607c996() { return handleError(function (arg0, arg1, arg2) {
|
|
469
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
470
|
+
return addHeapObject(ret);
|
|
471
|
+
}, arguments); }
|
|
472
|
+
export function __wbg_done_54b8da57023b7ed2(arg0) {
|
|
473
|
+
const ret = getObject(arg0).done;
|
|
474
|
+
return ret;
|
|
475
|
+
}
|
|
476
|
+
export function __wbg_entries_564a7e8b1e54ede5(arg0) {
|
|
477
|
+
const ret = Object.entries(getObject(arg0));
|
|
478
|
+
return addHeapObject(ret);
|
|
479
|
+
}
|
|
480
|
+
export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
481
|
+
let deferred0_0;
|
|
482
|
+
let deferred0_1;
|
|
483
|
+
try {
|
|
484
|
+
deferred0_0 = arg0;
|
|
485
|
+
deferred0_1 = arg1;
|
|
486
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
487
|
+
} finally {
|
|
488
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
export function __wbg_error_c2462bf0786c2044(arg0, arg1) {
|
|
492
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
493
|
+
}
|
|
494
|
+
export function __wbg_getRandomValues_3f44b700395062e5() { return handleError(function (arg0, arg1) {
|
|
495
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
496
|
+
}, arguments); }
|
|
497
|
+
export function __wbg_getRandomValues_ef12552bf5acd2fe() { return handleError(function (arg0, arg1) {
|
|
498
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
499
|
+
}, arguments); }
|
|
500
|
+
export function __wbg_get_3e9a707ab7d352eb() { return handleError(function (arg0, arg1) {
|
|
501
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
502
|
+
return addHeapObject(ret);
|
|
503
|
+
}, arguments); }
|
|
504
|
+
export function __wbg_get_98fdf51d029a75eb(arg0, arg1) {
|
|
505
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
506
|
+
return addHeapObject(ret);
|
|
507
|
+
}
|
|
508
|
+
export function __wbg_get_unchecked_1dfe6d05ad91d9b7(arg0, arg1) {
|
|
509
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
510
|
+
return addHeapObject(ret);
|
|
511
|
+
}
|
|
512
|
+
export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
|
|
513
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
514
|
+
return addHeapObject(ret);
|
|
515
|
+
}
|
|
516
|
+
export function __wbg_instanceof_ArrayBuffer_53db37b06f6b9afe(arg0) {
|
|
517
|
+
let result;
|
|
518
|
+
try {
|
|
519
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
520
|
+
} catch (_) {
|
|
521
|
+
result = false;
|
|
522
|
+
}
|
|
523
|
+
const ret = result;
|
|
524
|
+
return ret;
|
|
525
|
+
}
|
|
526
|
+
export function __wbg_instanceof_Map_16f217b9a2a08d8c(arg0) {
|
|
527
|
+
let result;
|
|
528
|
+
try {
|
|
529
|
+
result = getObject(arg0) instanceof Map;
|
|
530
|
+
} catch (_) {
|
|
531
|
+
result = false;
|
|
532
|
+
}
|
|
533
|
+
const ret = result;
|
|
534
|
+
return ret;
|
|
535
|
+
}
|
|
536
|
+
export function __wbg_instanceof_Uint8Array_abd07d4bd221d50b(arg0) {
|
|
537
|
+
let result;
|
|
538
|
+
try {
|
|
539
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
540
|
+
} catch (_) {
|
|
541
|
+
result = false;
|
|
542
|
+
}
|
|
543
|
+
const ret = result;
|
|
544
|
+
return ret;
|
|
545
|
+
}
|
|
546
|
+
export function __wbg_isArray_74b636a53056fecb(arg0) {
|
|
547
|
+
const ret = Array.isArray(getObject(arg0));
|
|
548
|
+
return ret;
|
|
549
|
+
}
|
|
550
|
+
export function __wbg_isArray_94898ed3aad6947b(arg0) {
|
|
551
|
+
const ret = Array.isArray(getObject(arg0));
|
|
552
|
+
return ret;
|
|
553
|
+
}
|
|
554
|
+
export function __wbg_isSafeInteger_01e964d144ad3a55(arg0) {
|
|
555
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
556
|
+
return ret;
|
|
557
|
+
}
|
|
558
|
+
export function __wbg_iterator_1441b47f341dc34f() {
|
|
559
|
+
const ret = Symbol.iterator;
|
|
560
|
+
return addHeapObject(ret);
|
|
561
|
+
}
|
|
562
|
+
export function __wbg_length_2591a0f4f659a55c(arg0) {
|
|
563
|
+
const ret = getObject(arg0).length;
|
|
564
|
+
return ret;
|
|
565
|
+
}
|
|
566
|
+
export function __wbg_length_56fcd3e2b7e0299d(arg0) {
|
|
567
|
+
const ret = getObject(arg0).length;
|
|
568
|
+
return ret;
|
|
569
|
+
}
|
|
570
|
+
export function __wbg_log_0d9f05d35f8cac21(arg0, arg1) {
|
|
571
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
572
|
+
}
|
|
573
|
+
export function __wbg_new_02d162bc6cf02f60() {
|
|
574
|
+
const ret = new Object();
|
|
575
|
+
return addHeapObject(ret);
|
|
576
|
+
}
|
|
577
|
+
export function __wbg_new_070df68d66325372() {
|
|
578
|
+
const ret = new Map();
|
|
579
|
+
return addHeapObject(ret);
|
|
580
|
+
}
|
|
581
|
+
export function __wbg_new_227d7c05414eb861() {
|
|
582
|
+
const ret = new Error();
|
|
583
|
+
return addHeapObject(ret);
|
|
584
|
+
}
|
|
585
|
+
export function __wbg_new_310879b66b6e95e1() {
|
|
586
|
+
const ret = new Array();
|
|
587
|
+
return addHeapObject(ret);
|
|
588
|
+
}
|
|
589
|
+
export function __wbg_new_7ddec6de44ff8f5d(arg0) {
|
|
590
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
591
|
+
return addHeapObject(ret);
|
|
592
|
+
}
|
|
593
|
+
export function __wbg_new_d8dfd33fa007511d(arg0, arg1) {
|
|
594
|
+
try {
|
|
595
|
+
var state0 = {a: arg0, b: arg1};
|
|
596
|
+
var cb0 = (arg0, arg1) => {
|
|
597
|
+
const a = state0.a;
|
|
598
|
+
state0.a = 0;
|
|
599
|
+
try {
|
|
600
|
+
return __wasm_bindgen_func_elem_10966(a, state0.b, arg0, arg1);
|
|
601
|
+
} finally {
|
|
602
|
+
state0.a = a;
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
const ret = new Promise(cb0);
|
|
606
|
+
return addHeapObject(ret);
|
|
607
|
+
} finally {
|
|
608
|
+
state0.a = 0;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
export function __wbg_new_typed_c072c4ce9a2a0cdf(arg0, arg1) {
|
|
612
|
+
try {
|
|
613
|
+
var state0 = {a: arg0, b: arg1};
|
|
614
|
+
var cb0 = (arg0, arg1) => {
|
|
615
|
+
const a = state0.a;
|
|
616
|
+
state0.a = 0;
|
|
617
|
+
try {
|
|
618
|
+
return __wasm_bindgen_func_elem_10966(a, state0.b, arg0, arg1);
|
|
619
|
+
} finally {
|
|
620
|
+
state0.a = a;
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
const ret = new Promise(cb0);
|
|
624
|
+
return addHeapObject(ret);
|
|
625
|
+
} finally {
|
|
626
|
+
state0.a = 0;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
export function __wbg_next_2a4e19f4f5083b0f(arg0) {
|
|
630
|
+
const ret = getObject(arg0).next;
|
|
631
|
+
return addHeapObject(ret);
|
|
632
|
+
}
|
|
633
|
+
export function __wbg_next_6429a146bf756f93() { return handleError(function (arg0) {
|
|
634
|
+
const ret = getObject(arg0).next();
|
|
635
|
+
return addHeapObject(ret);
|
|
636
|
+
}, arguments); }
|
|
637
|
+
export function __wbg_now_81363d44c96dd239() {
|
|
638
|
+
const ret = Date.now();
|
|
639
|
+
return ret;
|
|
640
|
+
}
|
|
641
|
+
export function __wbg_prototypesetcall_5f9bdc8d75e07276(arg0, arg1, arg2) {
|
|
642
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
643
|
+
}
|
|
644
|
+
export function __wbg_push_b77c476b01548d0a(arg0, arg1) {
|
|
645
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
646
|
+
return ret;
|
|
647
|
+
}
|
|
648
|
+
export function __wbg_queueMicrotask_78d584b53af520f5(arg0) {
|
|
649
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
650
|
+
return addHeapObject(ret);
|
|
651
|
+
}
|
|
652
|
+
export function __wbg_queueMicrotask_b39ea83c7f01971a(arg0) {
|
|
653
|
+
queueMicrotask(getObject(arg0));
|
|
654
|
+
}
|
|
655
|
+
export function __wbg_resolve_d17db9352f5a220e(arg0) {
|
|
656
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
657
|
+
return addHeapObject(ret);
|
|
658
|
+
}
|
|
659
|
+
export function __wbg_setTimeout_8c38500cf1446a8c(arg0, arg1) {
|
|
660
|
+
setTimeout(getObject(arg0), arg1);
|
|
661
|
+
}
|
|
662
|
+
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
663
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
664
|
+
}
|
|
665
|
+
export function __wbg_set_78ea6a19f4818587(arg0, arg1, arg2) {
|
|
666
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
667
|
+
}
|
|
668
|
+
export function __wbg_set_facb7a5914e0fa39(arg0, arg1, arg2) {
|
|
669
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
670
|
+
return addHeapObject(ret);
|
|
671
|
+
}
|
|
672
|
+
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
673
|
+
const ret = getObject(arg1).stack;
|
|
674
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
675
|
+
const len1 = WASM_VECTOR_LEN;
|
|
676
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
677
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
678
|
+
}
|
|
679
|
+
export function __wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9() {
|
|
680
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
681
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
682
|
+
}
|
|
683
|
+
export function __wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54() {
|
|
684
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
685
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
686
|
+
}
|
|
687
|
+
export function __wbg_static_accessor_SELF_9b2406c23aeb2023() {
|
|
688
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
689
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
690
|
+
}
|
|
691
|
+
export function __wbg_static_accessor_WINDOW_b34d2126934e16ba() {
|
|
692
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
693
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
694
|
+
}
|
|
695
|
+
export function __wbg_then_837494e384b37459(arg0, arg1) {
|
|
696
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
697
|
+
return addHeapObject(ret);
|
|
698
|
+
}
|
|
699
|
+
export function __wbg_then_bd927500e8905df2(arg0, arg1, arg2) {
|
|
700
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
701
|
+
return addHeapObject(ret);
|
|
702
|
+
}
|
|
703
|
+
export function __wbg_value_9cc0518af87a489c(arg0) {
|
|
704
|
+
const ret = getObject(arg0).value;
|
|
705
|
+
return addHeapObject(ret);
|
|
706
|
+
}
|
|
707
|
+
export function __wbg_warn_0a0181da0201bf15(arg0, arg1) {
|
|
708
|
+
console.warn(getStringFromWasm0(arg0, arg1));
|
|
709
|
+
}
|
|
710
|
+
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
711
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2025, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
712
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_10972);
|
|
713
|
+
return addHeapObject(ret);
|
|
714
|
+
}
|
|
715
|
+
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
716
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
717
|
+
const ret = arg0;
|
|
718
|
+
return addHeapObject(ret);
|
|
719
|
+
}
|
|
720
|
+
export function __wbindgen_cast_0000000000000003(arg0) {
|
|
721
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
722
|
+
const ret = arg0;
|
|
723
|
+
return addHeapObject(ret);
|
|
724
|
+
}
|
|
725
|
+
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
726
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
727
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
728
|
+
return addHeapObject(ret);
|
|
729
|
+
}
|
|
730
|
+
export function __wbindgen_cast_0000000000000005(arg0) {
|
|
731
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
732
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
733
|
+
return addHeapObject(ret);
|
|
734
|
+
}
|
|
735
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
736
|
+
const ret = getObject(arg0);
|
|
737
|
+
return addHeapObject(ret);
|
|
738
|
+
}
|
|
739
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
740
|
+
takeObject(arg0);
|
|
741
|
+
}
|
|
742
|
+
function __wasm_bindgen_func_elem_10972(arg0, arg1, arg2) {
|
|
743
|
+
try {
|
|
744
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
745
|
+
wasm.__wasm_bindgen_func_elem_10972(retptr, arg0, arg1, addHeapObject(arg2));
|
|
746
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
747
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
748
|
+
if (r1) {
|
|
749
|
+
throw takeObject(r0);
|
|
750
|
+
}
|
|
751
|
+
} finally {
|
|
752
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
function __wasm_bindgen_func_elem_10966(arg0, arg1, arg2, arg3) {
|
|
757
|
+
wasm.__wasm_bindgen_func_elem_10966(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
const BlocksEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
761
|
+
? { register: () => {}, unregister: () => {} }
|
|
762
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_blocksengine_free(ptr, 1));
|
|
763
|
+
const EngineCommandFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
764
|
+
? { register: () => {}, unregister: () => {} }
|
|
765
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_enginecommand_free(ptr, 1));
|
|
766
|
+
|
|
767
|
+
function addHeapObject(obj) {
|
|
768
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
769
|
+
const idx = heap_next;
|
|
770
|
+
heap_next = heap[idx];
|
|
771
|
+
|
|
772
|
+
heap[idx] = obj;
|
|
773
|
+
return idx;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
777
|
+
? { register: () => {}, unregister: () => {} }
|
|
778
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
|
|
779
|
+
|
|
780
|
+
function debugString(val) {
|
|
781
|
+
// primitive types
|
|
782
|
+
const type = typeof val;
|
|
783
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
784
|
+
return `${val}`;
|
|
785
|
+
}
|
|
786
|
+
if (type == 'string') {
|
|
787
|
+
return `"${val}"`;
|
|
788
|
+
}
|
|
789
|
+
if (type == 'symbol') {
|
|
790
|
+
const description = val.description;
|
|
791
|
+
if (description == null) {
|
|
792
|
+
return 'Symbol';
|
|
793
|
+
} else {
|
|
794
|
+
return `Symbol(${description})`;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if (type == 'function') {
|
|
798
|
+
const name = val.name;
|
|
799
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
800
|
+
return `Function(${name})`;
|
|
801
|
+
} else {
|
|
802
|
+
return 'Function';
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
// objects
|
|
806
|
+
if (Array.isArray(val)) {
|
|
807
|
+
const length = val.length;
|
|
808
|
+
let debug = '[';
|
|
809
|
+
if (length > 0) {
|
|
810
|
+
debug += debugString(val[0]);
|
|
811
|
+
}
|
|
812
|
+
for(let i = 1; i < length; i++) {
|
|
813
|
+
debug += ', ' + debugString(val[i]);
|
|
814
|
+
}
|
|
815
|
+
debug += ']';
|
|
816
|
+
return debug;
|
|
817
|
+
}
|
|
818
|
+
// Test for built-in
|
|
819
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
820
|
+
let className;
|
|
821
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
822
|
+
className = builtInMatches[1];
|
|
823
|
+
} else {
|
|
824
|
+
// Failed to match the standard '[object ClassName]'
|
|
825
|
+
return toString.call(val);
|
|
826
|
+
}
|
|
827
|
+
if (className == 'Object') {
|
|
828
|
+
// we're a user defined class or Object
|
|
829
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
830
|
+
// easier than looping through ownProperties of `val`.
|
|
831
|
+
try {
|
|
832
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
833
|
+
} catch (_) {
|
|
834
|
+
return 'Object';
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
// errors
|
|
838
|
+
if (val instanceof Error) {
|
|
839
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
840
|
+
}
|
|
841
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
842
|
+
return className;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
function dropObject(idx) {
|
|
846
|
+
if (idx < 1028) return;
|
|
847
|
+
heap[idx] = heap_next;
|
|
848
|
+
heap_next = idx;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
852
|
+
ptr = ptr >>> 0;
|
|
853
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
let cachedDataViewMemory0 = null;
|
|
857
|
+
function getDataViewMemory0() {
|
|
858
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
859
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
860
|
+
}
|
|
861
|
+
return cachedDataViewMemory0;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
function getStringFromWasm0(ptr, len) {
|
|
865
|
+
return decodeText(ptr >>> 0, len);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
let cachedUint8ArrayMemory0 = null;
|
|
869
|
+
function getUint8ArrayMemory0() {
|
|
870
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
871
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
872
|
+
}
|
|
873
|
+
return cachedUint8ArrayMemory0;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
function getObject(idx) { return heap[idx]; }
|
|
877
|
+
|
|
878
|
+
function handleError(f, args) {
|
|
879
|
+
try {
|
|
880
|
+
return f.apply(this, args);
|
|
881
|
+
} catch (e) {
|
|
882
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
let heap = new Array(1024).fill(undefined);
|
|
887
|
+
heap.push(undefined, null, true, false);
|
|
888
|
+
|
|
889
|
+
let heap_next = heap.length;
|
|
890
|
+
|
|
891
|
+
function isLikeNone(x) {
|
|
892
|
+
return x === undefined || x === null;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
896
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
897
|
+
const real = (...args) => {
|
|
898
|
+
|
|
899
|
+
// First up with a closure we increment the internal reference
|
|
900
|
+
// count. This ensures that the Rust closure environment won't
|
|
901
|
+
// be deallocated while we're invoking it.
|
|
902
|
+
state.cnt++;
|
|
903
|
+
const a = state.a;
|
|
904
|
+
state.a = 0;
|
|
905
|
+
try {
|
|
906
|
+
return f(a, state.b, ...args);
|
|
907
|
+
} finally {
|
|
908
|
+
state.a = a;
|
|
909
|
+
real._wbg_cb_unref();
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
real._wbg_cb_unref = () => {
|
|
913
|
+
if (--state.cnt === 0) {
|
|
914
|
+
wasm.__wbindgen_export5(state.a, state.b);
|
|
915
|
+
state.a = 0;
|
|
916
|
+
CLOSURE_DTORS.unregister(state);
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
920
|
+
return real;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
924
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
925
|
+
const mem = getDataViewMemory0();
|
|
926
|
+
for (let i = 0; i < array.length; i++) {
|
|
927
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
928
|
+
}
|
|
929
|
+
WASM_VECTOR_LEN = array.length;
|
|
930
|
+
return ptr;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
934
|
+
if (realloc === undefined) {
|
|
935
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
936
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
937
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
938
|
+
WASM_VECTOR_LEN = buf.length;
|
|
939
|
+
return ptr;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
let len = arg.length;
|
|
943
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
944
|
+
|
|
945
|
+
const mem = getUint8ArrayMemory0();
|
|
946
|
+
|
|
947
|
+
let offset = 0;
|
|
948
|
+
|
|
949
|
+
for (; offset < len; offset++) {
|
|
950
|
+
const code = arg.charCodeAt(offset);
|
|
951
|
+
if (code > 0x7F) break;
|
|
952
|
+
mem[ptr + offset] = code;
|
|
953
|
+
}
|
|
954
|
+
if (offset !== len) {
|
|
955
|
+
if (offset !== 0) {
|
|
956
|
+
arg = arg.slice(offset);
|
|
957
|
+
}
|
|
958
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
959
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
960
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
961
|
+
|
|
962
|
+
offset += ret.written;
|
|
963
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
WASM_VECTOR_LEN = offset;
|
|
967
|
+
return ptr;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
function takeObject(idx) {
|
|
971
|
+
const ret = getObject(idx);
|
|
972
|
+
dropObject(idx);
|
|
973
|
+
return ret;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
977
|
+
cachedTextDecoder.decode();
|
|
978
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
979
|
+
let numBytesDecoded = 0;
|
|
980
|
+
function decodeText(ptr, len) {
|
|
981
|
+
numBytesDecoded += len;
|
|
982
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
983
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
984
|
+
cachedTextDecoder.decode();
|
|
985
|
+
numBytesDecoded = len;
|
|
986
|
+
}
|
|
987
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
const cachedTextEncoder = new TextEncoder();
|
|
991
|
+
|
|
992
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
993
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
994
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
995
|
+
view.set(buf);
|
|
996
|
+
return {
|
|
997
|
+
read: arg.length,
|
|
998
|
+
written: buf.length
|
|
999
|
+
};
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
let WASM_VECTOR_LEN = 0;
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
let wasm;
|
|
1007
|
+
export function __wbg_set_wasm(val) {
|
|
1008
|
+
wasm = val;
|
|
1009
|
+
}
|