ping-openmls-sdk 0.1.1 → 0.1.2
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/package.json +1 -1
- package/wasm/package.json +17 -0
- package/wasm/ping_wasm.d.ts +191 -0
- package/wasm/ping_wasm.js +1382 -0
- package/wasm/ping_wasm_bg.wasm +0 -0
- package/wasm/ping_wasm_bg.wasm.d.ts +46 -0
|
@@ -0,0 +1,1382 @@
|
|
|
1
|
+
/* @ts-self-types="./ping_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class PingClient {
|
|
4
|
+
static __wrap(ptr) {
|
|
5
|
+
const obj = Object.create(PingClient.prototype);
|
|
6
|
+
obj.__wbg_ptr = ptr;
|
|
7
|
+
PingClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
8
|
+
return obj;
|
|
9
|
+
}
|
|
10
|
+
__destroy_into_raw() {
|
|
11
|
+
const ptr = this.__wbg_ptr;
|
|
12
|
+
this.__wbg_ptr = 0;
|
|
13
|
+
PingClientFinalization.unregister(this);
|
|
14
|
+
return ptr;
|
|
15
|
+
}
|
|
16
|
+
free() {
|
|
17
|
+
const ptr = this.__destroy_into_raw();
|
|
18
|
+
wasm.__wbg_pingclient_free(ptr, 0);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @param {Uint8Array} conv_id
|
|
22
|
+
* @param {Uint8Array[]} key_packages
|
|
23
|
+
* @param {number} now_ms
|
|
24
|
+
* @returns {Promise<void>}
|
|
25
|
+
*/
|
|
26
|
+
addMembers(conv_id, key_packages, now_ms) {
|
|
27
|
+
const ptr0 = passArray8ToWasm0(conv_id, wasm.__wbindgen_export);
|
|
28
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29
|
+
const ptr1 = passArrayJsValueToWasm0(key_packages, wasm.__wbindgen_export);
|
|
30
|
+
const len1 = WASM_VECTOR_LEN;
|
|
31
|
+
const ret = wasm.pingclient_addMembers(this.__wbg_ptr, ptr0, len0, ptr1, len1, now_ms);
|
|
32
|
+
return takeObject(ret);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @param {Uint8Array} new_device_id
|
|
36
|
+
* @param {Uint8Array} new_device_kp
|
|
37
|
+
* @param {number} now_ms
|
|
38
|
+
* @returns {Promise<any>}
|
|
39
|
+
*/
|
|
40
|
+
buildLinkingTicket(new_device_id, new_device_kp, now_ms) {
|
|
41
|
+
const ptr0 = passArray8ToWasm0(new_device_id, wasm.__wbindgen_export);
|
|
42
|
+
const len0 = WASM_VECTOR_LEN;
|
|
43
|
+
const ptr1 = passArray8ToWasm0(new_device_kp, wasm.__wbindgen_export);
|
|
44
|
+
const len1 = WASM_VECTOR_LEN;
|
|
45
|
+
const ret = wasm.pingclient_buildLinkingTicket(this.__wbg_ptr, ptr0, len0, ptr1, len1, now_ms);
|
|
46
|
+
return takeObject(ret);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @param {any} ticket
|
|
50
|
+
* @param {number} now_ms
|
|
51
|
+
* @returns {Promise<void>}
|
|
52
|
+
*/
|
|
53
|
+
consumeLinkingTicket(ticket, now_ms) {
|
|
54
|
+
const ret = wasm.pingclient_consumeLinkingTicket(this.__wbg_ptr, addHeapObject(ticket), now_ms);
|
|
55
|
+
return takeObject(ret);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @param {string | null | undefined} name
|
|
59
|
+
* @param {number} now_ms
|
|
60
|
+
* @returns {Promise<Uint8Array>}
|
|
61
|
+
*/
|
|
62
|
+
createConversation(name, now_ms) {
|
|
63
|
+
var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
64
|
+
var len0 = WASM_VECTOR_LEN;
|
|
65
|
+
const ret = wasm.pingclient_createConversation(this.__wbg_ptr, ptr0, len0, now_ms);
|
|
66
|
+
return takeObject(ret);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @returns {Uint8Array}
|
|
70
|
+
*/
|
|
71
|
+
deviceId() {
|
|
72
|
+
try {
|
|
73
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
74
|
+
wasm.pingclient_deviceId(retptr, this.__wbg_ptr);
|
|
75
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
76
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
77
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
78
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
79
|
+
return v1;
|
|
80
|
+
} finally {
|
|
81
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @returns {Uint8Array}
|
|
86
|
+
*/
|
|
87
|
+
freshKeyPackage() {
|
|
88
|
+
try {
|
|
89
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
90
|
+
wasm.pingclient_freshKeyPackage(retptr, this.__wbg_ptr);
|
|
91
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
92
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
93
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
94
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
95
|
+
if (r3) {
|
|
96
|
+
throw takeObject(r2);
|
|
97
|
+
}
|
|
98
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
99
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
100
|
+
return v1;
|
|
101
|
+
} finally {
|
|
102
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Generate a fresh identity. Returns the export bytes — store them under the user's account.
|
|
107
|
+
* @returns {Uint8Array}
|
|
108
|
+
*/
|
|
109
|
+
static generateIdentity() {
|
|
110
|
+
try {
|
|
111
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
112
|
+
wasm.pingclient_generateIdentity(retptr);
|
|
113
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
114
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
115
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
116
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
117
|
+
return v1;
|
|
118
|
+
} finally {
|
|
119
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Initialise the client. Pass an exported identity (use `generateIdentity()` for a fresh one).
|
|
124
|
+
* @param {Uint8Array} identity_export
|
|
125
|
+
* @param {string} device_label
|
|
126
|
+
* @param {JsStorage} storage
|
|
127
|
+
* @param {JsTransport} transport
|
|
128
|
+
* @param {number} now_ms
|
|
129
|
+
* @returns {Promise<PingClient>}
|
|
130
|
+
*/
|
|
131
|
+
static init(identity_export, device_label, storage, transport, now_ms) {
|
|
132
|
+
const ptr0 = passArray8ToWasm0(identity_export, wasm.__wbindgen_export);
|
|
133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
134
|
+
const ptr1 = passStringToWasm0(device_label, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
135
|
+
const len1 = WASM_VECTOR_LEN;
|
|
136
|
+
const ret = wasm.pingclient_init(ptr0, len0, ptr1, len1, addHeapObject(storage), addHeapObject(transport), now_ms);
|
|
137
|
+
return takeObject(ret);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @param {any} welcome
|
|
141
|
+
* @param {number} now_ms
|
|
142
|
+
* @returns {Promise<Uint8Array>}
|
|
143
|
+
*/
|
|
144
|
+
joinConversation(welcome, now_ms) {
|
|
145
|
+
const ret = wasm.pingclient_joinConversation(this.__wbg_ptr, addHeapObject(welcome), now_ms);
|
|
146
|
+
return takeObject(ret);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @returns {any}
|
|
150
|
+
*/
|
|
151
|
+
listConversations() {
|
|
152
|
+
try {
|
|
153
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
154
|
+
wasm.pingclient_listConversations(retptr, this.__wbg_ptr);
|
|
155
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
156
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
157
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
158
|
+
if (r2) {
|
|
159
|
+
throw takeObject(r1);
|
|
160
|
+
}
|
|
161
|
+
return takeObject(r0);
|
|
162
|
+
} finally {
|
|
163
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @param {Function} cb
|
|
168
|
+
*/
|
|
169
|
+
onMessage(cb) {
|
|
170
|
+
wasm.pingclient_onMessage(this.__wbg_ptr, addHeapObject(cb));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* @param {any} env
|
|
174
|
+
* @param {number} now_ms
|
|
175
|
+
* @returns {Promise<any>}
|
|
176
|
+
*/
|
|
177
|
+
processEnvelope(env, now_ms) {
|
|
178
|
+
const ret = wasm.pingclient_processEnvelope(this.__wbg_ptr, addHeapObject(env), now_ms);
|
|
179
|
+
return takeObject(ret);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @param {Uint8Array} conv_id
|
|
183
|
+
* @param {Uint32Array} leaves
|
|
184
|
+
* @param {number} now_ms
|
|
185
|
+
* @returns {Promise<void>}
|
|
186
|
+
*/
|
|
187
|
+
removeMembers(conv_id, leaves, now_ms) {
|
|
188
|
+
const ptr0 = passArray8ToWasm0(conv_id, wasm.__wbindgen_export);
|
|
189
|
+
const len0 = WASM_VECTOR_LEN;
|
|
190
|
+
const ptr1 = passArray32ToWasm0(leaves, wasm.__wbindgen_export);
|
|
191
|
+
const len1 = WASM_VECTOR_LEN;
|
|
192
|
+
const ret = wasm.pingclient_removeMembers(this.__wbg_ptr, ptr0, len0, ptr1, len1, now_ms);
|
|
193
|
+
return takeObject(ret);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* @param {Uint8Array} conv_id
|
|
197
|
+
* @param {Uint8Array} plaintext
|
|
198
|
+
* @param {number} now_ms
|
|
199
|
+
* @returns {Promise<any>}
|
|
200
|
+
*/
|
|
201
|
+
send(conv_id, plaintext, now_ms) {
|
|
202
|
+
const ptr0 = passArray8ToWasm0(conv_id, wasm.__wbindgen_export);
|
|
203
|
+
const len0 = WASM_VECTOR_LEN;
|
|
204
|
+
const ptr1 = passArray8ToWasm0(plaintext, wasm.__wbindgen_export);
|
|
205
|
+
const len1 = WASM_VECTOR_LEN;
|
|
206
|
+
const ret = wasm.pingclient_send(this.__wbg_ptr, ptr0, len0, ptr1, len1, now_ms);
|
|
207
|
+
return takeObject(ret);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @param {number} now_ms
|
|
211
|
+
* @returns {Promise<any>}
|
|
212
|
+
*/
|
|
213
|
+
syncConversations(now_ms) {
|
|
214
|
+
const ret = wasm.pingclient_syncConversations(this.__wbg_ptr, now_ms);
|
|
215
|
+
return takeObject(ret);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @returns {Uint8Array}
|
|
219
|
+
*/
|
|
220
|
+
userId() {
|
|
221
|
+
try {
|
|
222
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
223
|
+
wasm.pingclient_userId(retptr, this.__wbg_ptr);
|
|
224
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
225
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
226
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
227
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
228
|
+
return v1;
|
|
229
|
+
} finally {
|
|
230
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (Symbol.dispose) PingClient.prototype[Symbol.dispose] = PingClient.prototype.free;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Runtime test harness support instantiated in JS.
|
|
238
|
+
*
|
|
239
|
+
* The node.js entry script instantiates a `Context` here which is used to
|
|
240
|
+
* drive test execution.
|
|
241
|
+
*/
|
|
242
|
+
export class WasmBindgenTestContext {
|
|
243
|
+
__destroy_into_raw() {
|
|
244
|
+
const ptr = this.__wbg_ptr;
|
|
245
|
+
this.__wbg_ptr = 0;
|
|
246
|
+
WasmBindgenTestContextFinalization.unregister(this);
|
|
247
|
+
return ptr;
|
|
248
|
+
}
|
|
249
|
+
free() {
|
|
250
|
+
const ptr = this.__destroy_into_raw();
|
|
251
|
+
wasm.__wbg_wasmbindgentestcontext_free(ptr, 0);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Handle filter argument.
|
|
255
|
+
* @param {number} filtered
|
|
256
|
+
*/
|
|
257
|
+
filtered_count(filtered) {
|
|
258
|
+
wasm.wasmbindgentestcontext_filtered_count(this.__wbg_ptr, filtered);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Handle `--include-ignored` flag.
|
|
262
|
+
* @param {boolean} include_ignored
|
|
263
|
+
*/
|
|
264
|
+
include_ignored(include_ignored) {
|
|
265
|
+
wasm.wasmbindgentestcontext_include_ignored(this.__wbg_ptr, include_ignored);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Creates a new context ready to run tests.
|
|
269
|
+
*
|
|
270
|
+
* A `Context` is the main structure through which test execution is
|
|
271
|
+
* coordinated, and this will collect output and results for all executed
|
|
272
|
+
* tests.
|
|
273
|
+
* @param {boolean} is_bench
|
|
274
|
+
*/
|
|
275
|
+
constructor(is_bench) {
|
|
276
|
+
const ret = wasm.wasmbindgentestcontext_new(is_bench);
|
|
277
|
+
this.__wbg_ptr = ret;
|
|
278
|
+
WasmBindgenTestContextFinalization.register(this, this.__wbg_ptr, this);
|
|
279
|
+
return this;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Executes a list of tests, returning a promise representing their
|
|
283
|
+
* eventual completion.
|
|
284
|
+
*
|
|
285
|
+
* This is the main entry point for executing tests. All the tests passed
|
|
286
|
+
* in are the JS `Function` object that was plucked off the
|
|
287
|
+
* `WebAssembly.Instance` exports list.
|
|
288
|
+
*
|
|
289
|
+
* The promise returned resolves to either `true` if all tests passed or
|
|
290
|
+
* `false` if at least one test failed.
|
|
291
|
+
* @param {any[]} tests
|
|
292
|
+
* @returns {Promise<any>}
|
|
293
|
+
*/
|
|
294
|
+
run(tests) {
|
|
295
|
+
const ptr0 = passArrayJsValueToWasm0(tests, wasm.__wbindgen_export);
|
|
296
|
+
const len0 = WASM_VECTOR_LEN;
|
|
297
|
+
const ret = wasm.wasmbindgentestcontext_run(this.__wbg_ptr, ptr0, len0);
|
|
298
|
+
return takeObject(ret);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
if (Symbol.dispose) WasmBindgenTestContext.prototype[Symbol.dispose] = WasmBindgenTestContext.prototype.free;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Used to read benchmark data, and then the runner stores it on the local disk.
|
|
305
|
+
* @returns {Uint8Array | undefined}
|
|
306
|
+
*/
|
|
307
|
+
export function __wbgbench_dump() {
|
|
308
|
+
try {
|
|
309
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
310
|
+
wasm.__wbgbench_dump(retptr);
|
|
311
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
312
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
313
|
+
let v1;
|
|
314
|
+
if (r0 !== 0) {
|
|
315
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
316
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
317
|
+
}
|
|
318
|
+
return v1;
|
|
319
|
+
} finally {
|
|
320
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Used to write previous benchmark data before the benchmark, for later comparison.
|
|
326
|
+
* @param {Uint8Array} baseline
|
|
327
|
+
*/
|
|
328
|
+
export function __wbgbench_import(baseline) {
|
|
329
|
+
const ptr0 = passArray8ToWasm0(baseline, wasm.__wbindgen_export);
|
|
330
|
+
const len0 = WASM_VECTOR_LEN;
|
|
331
|
+
wasm.__wbgbench_import(ptr0, len0);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Handler for `console.debug` invocations. See above.
|
|
336
|
+
* @param {Array<any>} args
|
|
337
|
+
*/
|
|
338
|
+
export function __wbgtest_console_debug(args) {
|
|
339
|
+
try {
|
|
340
|
+
wasm.__wbgtest_console_debug(addBorrowedObject(args));
|
|
341
|
+
} finally {
|
|
342
|
+
heap[stack_pointer++] = undefined;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Handler for `console.error` invocations. See above.
|
|
348
|
+
* @param {Array<any>} args
|
|
349
|
+
*/
|
|
350
|
+
export function __wbgtest_console_error(args) {
|
|
351
|
+
try {
|
|
352
|
+
wasm.__wbgtest_console_error(addBorrowedObject(args));
|
|
353
|
+
} finally {
|
|
354
|
+
heap[stack_pointer++] = undefined;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Handler for `console.info` invocations. See above.
|
|
360
|
+
* @param {Array<any>} args
|
|
361
|
+
*/
|
|
362
|
+
export function __wbgtest_console_info(args) {
|
|
363
|
+
try {
|
|
364
|
+
wasm.__wbgtest_console_info(addBorrowedObject(args));
|
|
365
|
+
} finally {
|
|
366
|
+
heap[stack_pointer++] = undefined;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Handler for `console.log` invocations.
|
|
372
|
+
*
|
|
373
|
+
* If a test is currently running it takes the `args` array and stringifies
|
|
374
|
+
* it and appends it to the current output of the test. Otherwise it passes
|
|
375
|
+
* the arguments to the original `console.log` function, psased as
|
|
376
|
+
* `original`.
|
|
377
|
+
* @param {Array<any>} args
|
|
378
|
+
*/
|
|
379
|
+
export function __wbgtest_console_log(args) {
|
|
380
|
+
try {
|
|
381
|
+
wasm.__wbgtest_console_log(addBorrowedObject(args));
|
|
382
|
+
} finally {
|
|
383
|
+
heap[stack_pointer++] = undefined;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Handler for `console.warn` invocations. See above.
|
|
389
|
+
* @param {Array<any>} args
|
|
390
|
+
*/
|
|
391
|
+
export function __wbgtest_console_warn(args) {
|
|
392
|
+
try {
|
|
393
|
+
wasm.__wbgtest_console_warn(addBorrowedObject(args));
|
|
394
|
+
} finally {
|
|
395
|
+
heap[stack_pointer++] = undefined;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @returns {Uint8Array | undefined}
|
|
401
|
+
*/
|
|
402
|
+
export function __wbgtest_cov_dump() {
|
|
403
|
+
try {
|
|
404
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
405
|
+
wasm.__wbgtest_cov_dump(retptr);
|
|
406
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
407
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
408
|
+
let v1;
|
|
409
|
+
if (r0 !== 0) {
|
|
410
|
+
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
411
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
412
|
+
}
|
|
413
|
+
return v1;
|
|
414
|
+
} finally {
|
|
415
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Path to use for coverage data.
|
|
421
|
+
* @param {string | null | undefined} env
|
|
422
|
+
* @param {number} pid
|
|
423
|
+
* @param {string} temp_dir
|
|
424
|
+
* @param {bigint} module_signature
|
|
425
|
+
* @returns {string}
|
|
426
|
+
*/
|
|
427
|
+
export function __wbgtest_coverage_path(env, pid, temp_dir, module_signature) {
|
|
428
|
+
let deferred3_0;
|
|
429
|
+
let deferred3_1;
|
|
430
|
+
try {
|
|
431
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
432
|
+
var ptr0 = isLikeNone(env) ? 0 : passStringToWasm0(env, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
433
|
+
var len0 = WASM_VECTOR_LEN;
|
|
434
|
+
const ptr1 = passStringToWasm0(temp_dir, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
435
|
+
const len1 = WASM_VECTOR_LEN;
|
|
436
|
+
wasm.__wbgtest_coverage_path(retptr, ptr0, len0, pid, ptr1, len1, module_signature);
|
|
437
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
438
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
439
|
+
deferred3_0 = r0;
|
|
440
|
+
deferred3_1 = r1;
|
|
441
|
+
return getStringFromWasm0(r0, r1);
|
|
442
|
+
} finally {
|
|
443
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
444
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* @returns {bigint | undefined}
|
|
450
|
+
*/
|
|
451
|
+
export function __wbgtest_module_signature() {
|
|
452
|
+
try {
|
|
453
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
454
|
+
wasm.__wbgtest_module_signature(retptr);
|
|
455
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
456
|
+
var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
|
|
457
|
+
return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
|
|
458
|
+
} finally {
|
|
459
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export function _start() {
|
|
464
|
+
wasm._start();
|
|
465
|
+
}
|
|
466
|
+
function __wbg_get_imports() {
|
|
467
|
+
const import0 = {
|
|
468
|
+
__proto__: null,
|
|
469
|
+
__wbg_Deno_5568da40b5320910: function(arg0) {
|
|
470
|
+
const ret = getObject(arg0).Deno;
|
|
471
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
472
|
+
},
|
|
473
|
+
__wbg_Error_3639a60ed15f87e7: function(arg0, arg1) {
|
|
474
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
475
|
+
return addHeapObject(ret);
|
|
476
|
+
},
|
|
477
|
+
__wbg_Number_a3d737fd183f7dca: function(arg0) {
|
|
478
|
+
const ret = Number(getObject(arg0));
|
|
479
|
+
return ret;
|
|
480
|
+
},
|
|
481
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
482
|
+
const ret = String(getObject(arg1));
|
|
483
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
484
|
+
const len1 = WASM_VECTOR_LEN;
|
|
485
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
486
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
487
|
+
},
|
|
488
|
+
__wbg_String_9f1bc0c1cfdb8d71: function(arg0, arg1) {
|
|
489
|
+
const ret = String(getObject(arg1));
|
|
490
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
491
|
+
const len1 = WASM_VECTOR_LEN;
|
|
492
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
493
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
494
|
+
},
|
|
495
|
+
__wbg___wbg_test_output_writeln_ce1c14f3235de893: function(arg0) {
|
|
496
|
+
__wbg_test_output_writeln(takeObject(arg0));
|
|
497
|
+
},
|
|
498
|
+
__wbg___wbgtest_og_console_log_b41ebf420153741b: function(arg0, arg1) {
|
|
499
|
+
__wbgtest_og_console_log(getStringFromWasm0(arg0, arg1));
|
|
500
|
+
},
|
|
501
|
+
__wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b: function(arg0, arg1) {
|
|
502
|
+
const v = getObject(arg1);
|
|
503
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
504
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
505
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
506
|
+
},
|
|
507
|
+
__wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b: function(arg0) {
|
|
508
|
+
const v = getObject(arg0);
|
|
509
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
510
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
511
|
+
},
|
|
512
|
+
__wbg___wbindgen_debug_string_07cb72cfcc952e2b: function(arg0, arg1) {
|
|
513
|
+
const ret = debugString(getObject(arg1));
|
|
514
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
515
|
+
const len1 = WASM_VECTOR_LEN;
|
|
516
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
517
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
518
|
+
},
|
|
519
|
+
__wbg___wbindgen_in_2617fa76397620d3: function(arg0, arg1) {
|
|
520
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
521
|
+
return ret;
|
|
522
|
+
},
|
|
523
|
+
__wbg___wbindgen_is_bigint_d6a8167cac401b95: function(arg0) {
|
|
524
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
525
|
+
return ret;
|
|
526
|
+
},
|
|
527
|
+
__wbg___wbindgen_is_function_2f0fd7ceb86e64c5: function(arg0) {
|
|
528
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
529
|
+
return ret;
|
|
530
|
+
},
|
|
531
|
+
__wbg___wbindgen_is_null_066086be3abe9bb3: function(arg0) {
|
|
532
|
+
const ret = getObject(arg0) === null;
|
|
533
|
+
return ret;
|
|
534
|
+
},
|
|
535
|
+
__wbg___wbindgen_is_object_5b22ff2418063a9c: function(arg0) {
|
|
536
|
+
const val = getObject(arg0);
|
|
537
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
538
|
+
return ret;
|
|
539
|
+
},
|
|
540
|
+
__wbg___wbindgen_is_string_eddc07a3efad52e6: function(arg0) {
|
|
541
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
542
|
+
return ret;
|
|
543
|
+
},
|
|
544
|
+
__wbg___wbindgen_is_undefined_244a92c34d3b6ec0: function(arg0) {
|
|
545
|
+
const ret = getObject(arg0) === undefined;
|
|
546
|
+
return ret;
|
|
547
|
+
},
|
|
548
|
+
__wbg___wbindgen_jsval_eq_403eaa3610500a25: function(arg0, arg1) {
|
|
549
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
550
|
+
return ret;
|
|
551
|
+
},
|
|
552
|
+
__wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62: function(arg0, arg1) {
|
|
553
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
554
|
+
return ret;
|
|
555
|
+
},
|
|
556
|
+
__wbg___wbindgen_number_get_dd6d69a6079f26f1: function(arg0, arg1) {
|
|
557
|
+
const obj = getObject(arg1);
|
|
558
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
559
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
560
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
561
|
+
},
|
|
562
|
+
__wbg___wbindgen_string_get_965592073e5d848c: function(arg0, arg1) {
|
|
563
|
+
const obj = getObject(arg1);
|
|
564
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
565
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
566
|
+
var len1 = WASM_VECTOR_LEN;
|
|
567
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
568
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
569
|
+
},
|
|
570
|
+
__wbg___wbindgen_throw_9c75d47bf9e7731e: function(arg0, arg1) {
|
|
571
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
572
|
+
},
|
|
573
|
+
__wbg__wbg_cb_unref_158e43e869788cdc: function(arg0) {
|
|
574
|
+
getObject(arg0)._wbg_cb_unref();
|
|
575
|
+
},
|
|
576
|
+
__wbg_call_a41d6421b30a32c5: function() { return handleError(function (arg0, arg1, arg2) {
|
|
577
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
578
|
+
return addHeapObject(ret);
|
|
579
|
+
}, arguments); },
|
|
580
|
+
__wbg_call_add9e5a76382e668: function() { return handleError(function (arg0, arg1) {
|
|
581
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
582
|
+
return addHeapObject(ret);
|
|
583
|
+
}, arguments); },
|
|
584
|
+
__wbg_constructor_d15f058d68158e7a: function(arg0) {
|
|
585
|
+
const ret = getObject(arg0).constructor;
|
|
586
|
+
return addHeapObject(ret);
|
|
587
|
+
},
|
|
588
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
589
|
+
const ret = getObject(arg0).crypto;
|
|
590
|
+
return addHeapObject(ret);
|
|
591
|
+
},
|
|
592
|
+
__wbg_del_bd0f0fc39ecf93f3: function(arg0, arg1, arg2, arg3, arg4) {
|
|
593
|
+
const ret = getObject(arg0).del(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
594
|
+
return addHeapObject(ret);
|
|
595
|
+
},
|
|
596
|
+
__wbg_discoverDevices_20f6d69fc3f0c6dc: function(arg0, arg1) {
|
|
597
|
+
const ret = getObject(arg0).discoverDevices(takeObject(arg1));
|
|
598
|
+
return addHeapObject(ret);
|
|
599
|
+
},
|
|
600
|
+
__wbg_done_b1afd6201ac045e0: function(arg0) {
|
|
601
|
+
const ret = getObject(arg0).done;
|
|
602
|
+
return ret;
|
|
603
|
+
},
|
|
604
|
+
__wbg_entries_bb9843ba73dc70d6: function(arg0) {
|
|
605
|
+
const ret = Object.entries(getObject(arg0));
|
|
606
|
+
return addHeapObject(ret);
|
|
607
|
+
},
|
|
608
|
+
__wbg_error_537f92d5f29e50f7: function(arg0, arg1) {
|
|
609
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
610
|
+
},
|
|
611
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
612
|
+
let deferred0_0;
|
|
613
|
+
let deferred0_1;
|
|
614
|
+
try {
|
|
615
|
+
deferred0_0 = arg0;
|
|
616
|
+
deferred0_1 = arg1;
|
|
617
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
618
|
+
} finally {
|
|
619
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
__wbg_fetchSince_c99e6b5e03e34c45: function(arg0, arg1, arg2, arg3) {
|
|
623
|
+
const ret = getObject(arg0).fetchSince(takeObject(arg1), takeObject(arg2), arg3 >>> 0);
|
|
624
|
+
return addHeapObject(ret);
|
|
625
|
+
},
|
|
626
|
+
__wbg_forEach_544291b320823e55: function(arg0, arg1, arg2) {
|
|
627
|
+
try {
|
|
628
|
+
var state0 = {a: arg1, b: arg2};
|
|
629
|
+
var cb0 = (arg0, arg1, arg2) => {
|
|
630
|
+
const a = state0.a;
|
|
631
|
+
state0.a = 0;
|
|
632
|
+
try {
|
|
633
|
+
return __wasm_bindgen_func_elem_2213(a, state0.b, arg0, arg1, arg2);
|
|
634
|
+
} finally {
|
|
635
|
+
state0.a = a;
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
getObject(arg0).forEach(cb0);
|
|
639
|
+
} finally {
|
|
640
|
+
state0.a = 0;
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
__wbg_from_ff141b1e4c69b979: function(arg0) {
|
|
644
|
+
const ret = Array.from(getObject(arg0));
|
|
645
|
+
return addHeapObject(ret);
|
|
646
|
+
},
|
|
647
|
+
__wbg_getElementById_ef2cf6fa058f410a: function(arg0, arg1, arg2) {
|
|
648
|
+
const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
|
|
649
|
+
return addHeapObject(ret);
|
|
650
|
+
},
|
|
651
|
+
__wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
|
|
652
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
653
|
+
}, arguments); },
|
|
654
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
655
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
656
|
+
}, arguments); },
|
|
657
|
+
__wbg_get_3b0e701762d26c7f: function(arg0, arg1, arg2, arg3, arg4) {
|
|
658
|
+
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
659
|
+
return addHeapObject(ret);
|
|
660
|
+
},
|
|
661
|
+
__wbg_get_652f640b3b0b6e3e: function(arg0, arg1) {
|
|
662
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
663
|
+
return addHeapObject(ret);
|
|
664
|
+
},
|
|
665
|
+
__wbg_get_9cfea9b7bbf12a15: function() { return handleError(function (arg0, arg1) {
|
|
666
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
667
|
+
return addHeapObject(ret);
|
|
668
|
+
}, arguments); },
|
|
669
|
+
__wbg_get_unchecked_be562b1421656321: function(arg0, arg1) {
|
|
670
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
671
|
+
return addHeapObject(ret);
|
|
672
|
+
},
|
|
673
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
674
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
675
|
+
return addHeapObject(ret);
|
|
676
|
+
},
|
|
677
|
+
__wbg_instanceof_ArrayBuffer_eab9f28fbec23477: function(arg0) {
|
|
678
|
+
let result;
|
|
679
|
+
try {
|
|
680
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
681
|
+
} catch (_) {
|
|
682
|
+
result = false;
|
|
683
|
+
}
|
|
684
|
+
const ret = result;
|
|
685
|
+
return ret;
|
|
686
|
+
},
|
|
687
|
+
__wbg_instanceof_Uint8Array_57d77acd50e4c44d: function(arg0) {
|
|
688
|
+
let result;
|
|
689
|
+
try {
|
|
690
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
691
|
+
} catch (_) {
|
|
692
|
+
result = false;
|
|
693
|
+
}
|
|
694
|
+
const ret = result;
|
|
695
|
+
return ret;
|
|
696
|
+
},
|
|
697
|
+
__wbg_isArray_c6c6ef8308995bcf: function(arg0) {
|
|
698
|
+
const ret = Array.isArray(getObject(arg0));
|
|
699
|
+
return ret;
|
|
700
|
+
},
|
|
701
|
+
__wbg_isSafeInteger_3c56c421a5b4cce4: function(arg0) {
|
|
702
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
703
|
+
return ret;
|
|
704
|
+
},
|
|
705
|
+
__wbg_iterator_9d68985a1d096fc2: function() {
|
|
706
|
+
const ret = Symbol.iterator;
|
|
707
|
+
return addHeapObject(ret);
|
|
708
|
+
},
|
|
709
|
+
__wbg_length_0a6ce016dc1460b0: function(arg0) {
|
|
710
|
+
const ret = getObject(arg0).length;
|
|
711
|
+
return ret;
|
|
712
|
+
},
|
|
713
|
+
__wbg_length_ba3c032602efe310: function(arg0) {
|
|
714
|
+
const ret = getObject(arg0).length;
|
|
715
|
+
return ret;
|
|
716
|
+
},
|
|
717
|
+
__wbg_listKeys_9c8036153fb97187: function(arg0, arg1, arg2, arg3, arg4) {
|
|
718
|
+
const ret = getObject(arg0).listKeys(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
719
|
+
return addHeapObject(ret);
|
|
720
|
+
},
|
|
721
|
+
__wbg_log_8d00d059d90f8f62: function(arg0, arg1) {
|
|
722
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
723
|
+
},
|
|
724
|
+
__wbg_message_d5628ca19de920d3: function(arg0) {
|
|
725
|
+
const ret = getObject(arg0).message;
|
|
726
|
+
return addHeapObject(ret);
|
|
727
|
+
},
|
|
728
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
729
|
+
const ret = getObject(arg0).msCrypto;
|
|
730
|
+
return addHeapObject(ret);
|
|
731
|
+
},
|
|
732
|
+
__wbg_name_bf92195f4668ab6e: function(arg0) {
|
|
733
|
+
const ret = getObject(arg0).name;
|
|
734
|
+
return addHeapObject(ret);
|
|
735
|
+
},
|
|
736
|
+
__wbg_name_e75d30c26e8dc6aa: function(arg0, arg1) {
|
|
737
|
+
const ret = getObject(arg1).name;
|
|
738
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
739
|
+
const len1 = WASM_VECTOR_LEN;
|
|
740
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
741
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
742
|
+
},
|
|
743
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
744
|
+
const ret = new Error();
|
|
745
|
+
return addHeapObject(ret);
|
|
746
|
+
},
|
|
747
|
+
__wbg_new_2fad8ca02fd00684: function() {
|
|
748
|
+
const ret = new Object();
|
|
749
|
+
return addHeapObject(ret);
|
|
750
|
+
},
|
|
751
|
+
__wbg_new_3baa8d9866155c79: function() {
|
|
752
|
+
const ret = new Array();
|
|
753
|
+
return addHeapObject(ret);
|
|
754
|
+
},
|
|
755
|
+
__wbg_new_5aafc1bf3ffe858c: function() {
|
|
756
|
+
const ret = new Error();
|
|
757
|
+
return addHeapObject(ret);
|
|
758
|
+
},
|
|
759
|
+
__wbg_new_8454eee672b2ba6e: function(arg0) {
|
|
760
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
761
|
+
return addHeapObject(ret);
|
|
762
|
+
},
|
|
763
|
+
__wbg_new_from_slice_5a173c243af2e823: function(arg0, arg1) {
|
|
764
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
765
|
+
return addHeapObject(ret);
|
|
766
|
+
},
|
|
767
|
+
__wbg_new_typed_1137602701dc87d4: function(arg0, arg1) {
|
|
768
|
+
try {
|
|
769
|
+
var state0 = {a: arg0, b: arg1};
|
|
770
|
+
var cb0 = (arg0, arg1) => {
|
|
771
|
+
const a = state0.a;
|
|
772
|
+
state0.a = 0;
|
|
773
|
+
try {
|
|
774
|
+
return __wasm_bindgen_func_elem_2212(a, state0.b, arg0, arg1);
|
|
775
|
+
} finally {
|
|
776
|
+
state0.a = a;
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
const ret = new Promise(cb0);
|
|
780
|
+
return addHeapObject(ret);
|
|
781
|
+
} finally {
|
|
782
|
+
state0.a = 0;
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
__wbg_new_with_length_9011f5da794bf5d9: function(arg0) {
|
|
786
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
787
|
+
return addHeapObject(ret);
|
|
788
|
+
},
|
|
789
|
+
__wbg_next_261c3c48c6e309a5: function(arg0) {
|
|
790
|
+
const ret = getObject(arg0).next;
|
|
791
|
+
return addHeapObject(ret);
|
|
792
|
+
},
|
|
793
|
+
__wbg_next_aacee310bcfe6461: function() { return handleError(function (arg0) {
|
|
794
|
+
const ret = getObject(arg0).next();
|
|
795
|
+
return addHeapObject(ret);
|
|
796
|
+
}, arguments); },
|
|
797
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
798
|
+
const ret = getObject(arg0).node;
|
|
799
|
+
return addHeapObject(ret);
|
|
800
|
+
},
|
|
801
|
+
__wbg_now_4f457f10f864aec5: function() {
|
|
802
|
+
const ret = Date.now();
|
|
803
|
+
return ret;
|
|
804
|
+
},
|
|
805
|
+
__wbg_now_e627993f858511c9: function(arg0) {
|
|
806
|
+
const ret = getObject(arg0).now();
|
|
807
|
+
return ret;
|
|
808
|
+
},
|
|
809
|
+
__wbg_performance_3550bf29533f0eae: function(arg0) {
|
|
810
|
+
const ret = getObject(arg0).performance;
|
|
811
|
+
return addHeapObject(ret);
|
|
812
|
+
},
|
|
813
|
+
__wbg_pingclient_new: function(arg0) {
|
|
814
|
+
const ret = PingClient.__wrap(arg0);
|
|
815
|
+
return addHeapObject(ret);
|
|
816
|
+
},
|
|
817
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
818
|
+
const ret = getObject(arg0).process;
|
|
819
|
+
return addHeapObject(ret);
|
|
820
|
+
},
|
|
821
|
+
__wbg_prototypesetcall_fd4050e806e1d519: function(arg0, arg1, arg2) {
|
|
822
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
823
|
+
},
|
|
824
|
+
__wbg_put_2b82187fb4a6bca4: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
825
|
+
const ret = getObject(arg0).put(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), takeObject(arg5));
|
|
826
|
+
return addHeapObject(ret);
|
|
827
|
+
},
|
|
828
|
+
__wbg_queueMicrotask_40ac6ffc2848ba77: function(arg0) {
|
|
829
|
+
queueMicrotask(getObject(arg0));
|
|
830
|
+
},
|
|
831
|
+
__wbg_queueMicrotask_74d092439f6494c1: function(arg0) {
|
|
832
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
833
|
+
return addHeapObject(ret);
|
|
834
|
+
},
|
|
835
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
836
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
837
|
+
}, arguments); },
|
|
838
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
839
|
+
const ret = module.require;
|
|
840
|
+
return addHeapObject(ret);
|
|
841
|
+
}, arguments); },
|
|
842
|
+
__wbg_resolve_9feb5d906ca62419: function(arg0) {
|
|
843
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
844
|
+
return addHeapObject(ret);
|
|
845
|
+
},
|
|
846
|
+
__wbg_self_fbd35b4e1b417b7c: function(arg0) {
|
|
847
|
+
const ret = getObject(arg0).self;
|
|
848
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
849
|
+
},
|
|
850
|
+
__wbg_send_774e8bbf824b9359: function(arg0, arg1) {
|
|
851
|
+
const ret = getObject(arg0).send(takeObject(arg1));
|
|
852
|
+
return addHeapObject(ret);
|
|
853
|
+
},
|
|
854
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
855
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
856
|
+
},
|
|
857
|
+
__wbg_set_f614f6a0608d1d1d: function(arg0, arg1, arg2) {
|
|
858
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
859
|
+
},
|
|
860
|
+
__wbg_set_text_content_63c250954481807a: function(arg0, arg1, arg2) {
|
|
861
|
+
getObject(arg0).textContent = getStringFromWasm0(arg1, arg2);
|
|
862
|
+
},
|
|
863
|
+
__wbg_stack_18dcc55b1429bfed: function(arg0, arg1) {
|
|
864
|
+
const ret = getObject(arg1).stack;
|
|
865
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
866
|
+
var len1 = WASM_VECTOR_LEN;
|
|
867
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
868
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
869
|
+
},
|
|
870
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
871
|
+
const ret = getObject(arg1).stack;
|
|
872
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
873
|
+
const len1 = WASM_VECTOR_LEN;
|
|
874
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
875
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
876
|
+
},
|
|
877
|
+
__wbg_stack_5b90bbbb003d7e5c: function(arg0, arg1) {
|
|
878
|
+
const ret = getObject(arg1).stack;
|
|
879
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
880
|
+
const len1 = WASM_VECTOR_LEN;
|
|
881
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
882
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
883
|
+
},
|
|
884
|
+
__wbg_stack_5f3026c9cb27e9a3: function(arg0) {
|
|
885
|
+
const ret = getObject(arg0).stack;
|
|
886
|
+
return addHeapObject(ret);
|
|
887
|
+
},
|
|
888
|
+
__wbg_stack_e914725ec1a4a021: function(arg0) {
|
|
889
|
+
const ret = getObject(arg0).stack;
|
|
890
|
+
return addHeapObject(ret);
|
|
891
|
+
},
|
|
892
|
+
__wbg_static_accessor_DOCUMENT_fa300f5b84193774: function() {
|
|
893
|
+
const ret = document;
|
|
894
|
+
return addHeapObject(ret);
|
|
895
|
+
},
|
|
896
|
+
__wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb: function() {
|
|
897
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
898
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
899
|
+
},
|
|
900
|
+
__wbg_static_accessor_GLOBAL_e039bc914f83e74e: function() {
|
|
901
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
902
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
903
|
+
},
|
|
904
|
+
__wbg_static_accessor_SELF_8bf8c48c28420ad5: function() {
|
|
905
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
906
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
907
|
+
},
|
|
908
|
+
__wbg_static_accessor_WINDOW_6aeee9b51652ee0f: function() {
|
|
909
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
910
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
911
|
+
},
|
|
912
|
+
__wbg_subarray_fbe3cef290e1fa43: function(arg0, arg1, arg2) {
|
|
913
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
914
|
+
return addHeapObject(ret);
|
|
915
|
+
},
|
|
916
|
+
__wbg_text_content_39133fe2ceeea2bf: function(arg0, arg1) {
|
|
917
|
+
const ret = getObject(arg1).textContent;
|
|
918
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
919
|
+
const len1 = WASM_VECTOR_LEN;
|
|
920
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
921
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
922
|
+
},
|
|
923
|
+
__wbg_then_20a157d939b514f5: function(arg0, arg1) {
|
|
924
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
925
|
+
return addHeapObject(ret);
|
|
926
|
+
},
|
|
927
|
+
__wbg_then_5ef9b762bc91555c: function(arg0, arg1, arg2) {
|
|
928
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
929
|
+
return addHeapObject(ret);
|
|
930
|
+
},
|
|
931
|
+
__wbg_toString_90f2e8a87f5b736e: function() { return handleError(function (arg0, arg1) {
|
|
932
|
+
const ret = getObject(arg1).toString();
|
|
933
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
934
|
+
const len1 = WASM_VECTOR_LEN;
|
|
935
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
936
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
937
|
+
}, arguments); },
|
|
938
|
+
__wbg_value_f852716acdeb3e82: function(arg0) {
|
|
939
|
+
const ret = getObject(arg0).value;
|
|
940
|
+
return addHeapObject(ret);
|
|
941
|
+
},
|
|
942
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
943
|
+
const ret = getObject(arg0).versions;
|
|
944
|
+
return addHeapObject(ret);
|
|
945
|
+
},
|
|
946
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
947
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 614, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
948
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2203);
|
|
949
|
+
return addHeapObject(ret);
|
|
950
|
+
},
|
|
951
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
952
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
953
|
+
const ret = arg0;
|
|
954
|
+
return addHeapObject(ret);
|
|
955
|
+
},
|
|
956
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
957
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
958
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
959
|
+
return addHeapObject(ret);
|
|
960
|
+
},
|
|
961
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
962
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
963
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
964
|
+
return addHeapObject(ret);
|
|
965
|
+
},
|
|
966
|
+
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
967
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
968
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
969
|
+
return addHeapObject(ret);
|
|
970
|
+
},
|
|
971
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
972
|
+
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
973
|
+
wasm.__wbindgen_export4(arg0, arg1 * 1, 1);
|
|
974
|
+
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
975
|
+
const ret = v0;
|
|
976
|
+
return addHeapObject(ret);
|
|
977
|
+
},
|
|
978
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
979
|
+
const ret = getObject(arg0);
|
|
980
|
+
return addHeapObject(ret);
|
|
981
|
+
},
|
|
982
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
983
|
+
takeObject(arg0);
|
|
984
|
+
},
|
|
985
|
+
};
|
|
986
|
+
return {
|
|
987
|
+
__proto__: null,
|
|
988
|
+
"./ping_wasm_bg.js": import0,
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function __wasm_bindgen_func_elem_2203(arg0, arg1, arg2) {
|
|
993
|
+
try {
|
|
994
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
995
|
+
wasm.__wasm_bindgen_func_elem_2203(retptr, arg0, arg1, addHeapObject(arg2));
|
|
996
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
997
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
998
|
+
if (r1) {
|
|
999
|
+
throw takeObject(r0);
|
|
1000
|
+
}
|
|
1001
|
+
} finally {
|
|
1002
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
function __wasm_bindgen_func_elem_2212(arg0, arg1, arg2, arg3) {
|
|
1007
|
+
wasm.__wasm_bindgen_func_elem_2212(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
function __wasm_bindgen_func_elem_2213(arg0, arg1, arg2, arg3, arg4) {
|
|
1011
|
+
wasm.__wasm_bindgen_func_elem_2213(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
const WasmBindgenTestContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1015
|
+
? { register: () => {}, unregister: () => {} }
|
|
1016
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmbindgentestcontext_free(ptr, 1));
|
|
1017
|
+
const PingClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1018
|
+
? { register: () => {}, unregister: () => {} }
|
|
1019
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pingclient_free(ptr, 1));
|
|
1020
|
+
|
|
1021
|
+
function addHeapObject(obj) {
|
|
1022
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
1023
|
+
const idx = heap_next;
|
|
1024
|
+
heap_next = heap[idx];
|
|
1025
|
+
|
|
1026
|
+
heap[idx] = obj;
|
|
1027
|
+
return idx;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function addBorrowedObject(obj) {
|
|
1031
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
1032
|
+
heap[--stack_pointer] = obj;
|
|
1033
|
+
return stack_pointer;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1037
|
+
? { register: () => {}, unregister: () => {} }
|
|
1038
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
|
|
1039
|
+
|
|
1040
|
+
function debugString(val) {
|
|
1041
|
+
// primitive types
|
|
1042
|
+
const type = typeof val;
|
|
1043
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1044
|
+
return `${val}`;
|
|
1045
|
+
}
|
|
1046
|
+
if (type == 'string') {
|
|
1047
|
+
return `"${val}"`;
|
|
1048
|
+
}
|
|
1049
|
+
if (type == 'symbol') {
|
|
1050
|
+
const description = val.description;
|
|
1051
|
+
if (description == null) {
|
|
1052
|
+
return 'Symbol';
|
|
1053
|
+
} else {
|
|
1054
|
+
return `Symbol(${description})`;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
if (type == 'function') {
|
|
1058
|
+
const name = val.name;
|
|
1059
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1060
|
+
return `Function(${name})`;
|
|
1061
|
+
} else {
|
|
1062
|
+
return 'Function';
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
// objects
|
|
1066
|
+
if (Array.isArray(val)) {
|
|
1067
|
+
const length = val.length;
|
|
1068
|
+
let debug = '[';
|
|
1069
|
+
if (length > 0) {
|
|
1070
|
+
debug += debugString(val[0]);
|
|
1071
|
+
}
|
|
1072
|
+
for(let i = 1; i < length; i++) {
|
|
1073
|
+
debug += ', ' + debugString(val[i]);
|
|
1074
|
+
}
|
|
1075
|
+
debug += ']';
|
|
1076
|
+
return debug;
|
|
1077
|
+
}
|
|
1078
|
+
// Test for built-in
|
|
1079
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1080
|
+
let className;
|
|
1081
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1082
|
+
className = builtInMatches[1];
|
|
1083
|
+
} else {
|
|
1084
|
+
// Failed to match the standard '[object ClassName]'
|
|
1085
|
+
return toString.call(val);
|
|
1086
|
+
}
|
|
1087
|
+
if (className == 'Object') {
|
|
1088
|
+
// we're a user defined class or Object
|
|
1089
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1090
|
+
// easier than looping through ownProperties of `val`.
|
|
1091
|
+
try {
|
|
1092
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1093
|
+
} catch (_) {
|
|
1094
|
+
return 'Object';
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
// errors
|
|
1098
|
+
if (val instanceof Error) {
|
|
1099
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1100
|
+
}
|
|
1101
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1102
|
+
return className;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function dropObject(idx) {
|
|
1106
|
+
if (idx < 1028) return;
|
|
1107
|
+
heap[idx] = heap_next;
|
|
1108
|
+
heap_next = idx;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1112
|
+
ptr = ptr >>> 0;
|
|
1113
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
let cachedDataViewMemory0 = null;
|
|
1117
|
+
function getDataViewMemory0() {
|
|
1118
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1119
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1120
|
+
}
|
|
1121
|
+
return cachedDataViewMemory0;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function getStringFromWasm0(ptr, len) {
|
|
1125
|
+
return decodeText(ptr >>> 0, len);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
let cachedUint32ArrayMemory0 = null;
|
|
1129
|
+
function getUint32ArrayMemory0() {
|
|
1130
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
1131
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
1132
|
+
}
|
|
1133
|
+
return cachedUint32ArrayMemory0;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1137
|
+
function getUint8ArrayMemory0() {
|
|
1138
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1139
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1140
|
+
}
|
|
1141
|
+
return cachedUint8ArrayMemory0;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
function getObject(idx) { return heap[idx]; }
|
|
1145
|
+
|
|
1146
|
+
function handleError(f, args) {
|
|
1147
|
+
try {
|
|
1148
|
+
return f.apply(this, args);
|
|
1149
|
+
} catch (e) {
|
|
1150
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
let heap = new Array(1024).fill(undefined);
|
|
1155
|
+
heap.push(undefined, null, true, false);
|
|
1156
|
+
|
|
1157
|
+
let heap_next = heap.length;
|
|
1158
|
+
|
|
1159
|
+
function isLikeNone(x) {
|
|
1160
|
+
return x === undefined || x === null;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1164
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1165
|
+
const real = (...args) => {
|
|
1166
|
+
|
|
1167
|
+
// First up with a closure we increment the internal reference
|
|
1168
|
+
// count. This ensures that the Rust closure environment won't
|
|
1169
|
+
// be deallocated while we're invoking it.
|
|
1170
|
+
state.cnt++;
|
|
1171
|
+
const a = state.a;
|
|
1172
|
+
state.a = 0;
|
|
1173
|
+
try {
|
|
1174
|
+
return f(a, state.b, ...args);
|
|
1175
|
+
} finally {
|
|
1176
|
+
state.a = a;
|
|
1177
|
+
real._wbg_cb_unref();
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
real._wbg_cb_unref = () => {
|
|
1181
|
+
if (--state.cnt === 0) {
|
|
1182
|
+
wasm.__wbindgen_export5(state.a, state.b);
|
|
1183
|
+
state.a = 0;
|
|
1184
|
+
CLOSURE_DTORS.unregister(state);
|
|
1185
|
+
}
|
|
1186
|
+
};
|
|
1187
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1188
|
+
return real;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
1192
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
1193
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
1194
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1195
|
+
return ptr;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1199
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1200
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1201
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1202
|
+
return ptr;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
1206
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
1207
|
+
const mem = getDataViewMemory0();
|
|
1208
|
+
for (let i = 0; i < array.length; i++) {
|
|
1209
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
1210
|
+
}
|
|
1211
|
+
WASM_VECTOR_LEN = array.length;
|
|
1212
|
+
return ptr;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1216
|
+
if (realloc === undefined) {
|
|
1217
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1218
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1219
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1220
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1221
|
+
return ptr;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
let len = arg.length;
|
|
1225
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1226
|
+
|
|
1227
|
+
const mem = getUint8ArrayMemory0();
|
|
1228
|
+
|
|
1229
|
+
let offset = 0;
|
|
1230
|
+
|
|
1231
|
+
for (; offset < len; offset++) {
|
|
1232
|
+
const code = arg.charCodeAt(offset);
|
|
1233
|
+
if (code > 0x7F) break;
|
|
1234
|
+
mem[ptr + offset] = code;
|
|
1235
|
+
}
|
|
1236
|
+
if (offset !== len) {
|
|
1237
|
+
if (offset !== 0) {
|
|
1238
|
+
arg = arg.slice(offset);
|
|
1239
|
+
}
|
|
1240
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1241
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1242
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1243
|
+
|
|
1244
|
+
offset += ret.written;
|
|
1245
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
WASM_VECTOR_LEN = offset;
|
|
1249
|
+
return ptr;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
let stack_pointer = 1024;
|
|
1253
|
+
|
|
1254
|
+
function takeObject(idx) {
|
|
1255
|
+
const ret = getObject(idx);
|
|
1256
|
+
dropObject(idx);
|
|
1257
|
+
return ret;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1261
|
+
cachedTextDecoder.decode();
|
|
1262
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1263
|
+
let numBytesDecoded = 0;
|
|
1264
|
+
function decodeText(ptr, len) {
|
|
1265
|
+
numBytesDecoded += len;
|
|
1266
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1267
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1268
|
+
cachedTextDecoder.decode();
|
|
1269
|
+
numBytesDecoded = len;
|
|
1270
|
+
}
|
|
1271
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1275
|
+
|
|
1276
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1277
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1278
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1279
|
+
view.set(buf);
|
|
1280
|
+
return {
|
|
1281
|
+
read: arg.length,
|
|
1282
|
+
written: buf.length
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
let WASM_VECTOR_LEN = 0;
|
|
1288
|
+
|
|
1289
|
+
let wasmModule, wasmInstance, wasm;
|
|
1290
|
+
function __wbg_finalize_init(instance, module) {
|
|
1291
|
+
wasmInstance = instance;
|
|
1292
|
+
wasm = instance.exports;
|
|
1293
|
+
wasmModule = module;
|
|
1294
|
+
cachedDataViewMemory0 = null;
|
|
1295
|
+
cachedUint32ArrayMemory0 = null;
|
|
1296
|
+
cachedUint8ArrayMemory0 = null;
|
|
1297
|
+
wasm.__wbindgen_start();
|
|
1298
|
+
return wasm;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
async function __wbg_load(module, imports) {
|
|
1302
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1303
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1304
|
+
try {
|
|
1305
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1306
|
+
} catch (e) {
|
|
1307
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1308
|
+
|
|
1309
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1310
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1311
|
+
|
|
1312
|
+
} else { throw e; }
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
const bytes = await module.arrayBuffer();
|
|
1317
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1318
|
+
} else {
|
|
1319
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1320
|
+
|
|
1321
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1322
|
+
return { instance, module };
|
|
1323
|
+
} else {
|
|
1324
|
+
return instance;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
function expectedResponseType(type) {
|
|
1329
|
+
switch (type) {
|
|
1330
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1331
|
+
}
|
|
1332
|
+
return false;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
function initSync(module) {
|
|
1337
|
+
if (wasm !== undefined) return wasm;
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
if (module !== undefined) {
|
|
1341
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1342
|
+
({module} = module)
|
|
1343
|
+
} else {
|
|
1344
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
const imports = __wbg_get_imports();
|
|
1349
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1350
|
+
module = new WebAssembly.Module(module);
|
|
1351
|
+
}
|
|
1352
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1353
|
+
return __wbg_finalize_init(instance, module);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
async function __wbg_init(module_or_path) {
|
|
1357
|
+
if (wasm !== undefined) return wasm;
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
if (module_or_path !== undefined) {
|
|
1361
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1362
|
+
({module_or_path} = module_or_path)
|
|
1363
|
+
} else {
|
|
1364
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
if (module_or_path === undefined) {
|
|
1369
|
+
module_or_path = new URL('ping_wasm_bg.wasm', import.meta.url);
|
|
1370
|
+
}
|
|
1371
|
+
const imports = __wbg_get_imports();
|
|
1372
|
+
|
|
1373
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1374
|
+
module_or_path = fetch(module_or_path);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1378
|
+
|
|
1379
|
+
return __wbg_finalize_init(instance, module);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
export { initSync, __wbg_init as default };
|