@estoc/didcomm 0.4.1-estoc.1
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/LICENSE +176 -0
- package/README.md +282 -0
- package/index.d.ts +950 -0
- package/index.js +9 -0
- package/index_bg.js +735 -0
- package/index_bg.wasm +0 -0
- package/package.json +27 -0
package/index_bg.js
ADDED
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allows building of `from_prior` message header according
|
|
3
|
+
* to DIDComm DID Rotation procedure
|
|
4
|
+
* https://identity.foundation/didcomm-messaging/spec/#did-rotation.
|
|
5
|
+
*/
|
|
6
|
+
export class FromPrior {
|
|
7
|
+
static __wrap(ptr) {
|
|
8
|
+
const obj = Object.create(FromPrior.prototype);
|
|
9
|
+
obj.__wbg_ptr = ptr;
|
|
10
|
+
FromPriorFinalization.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
|
+
FromPriorFinalization.unregister(this);
|
|
17
|
+
return ptr;
|
|
18
|
+
}
|
|
19
|
+
free() {
|
|
20
|
+
const ptr = this.__destroy_into_raw();
|
|
21
|
+
wasm.__wbg_fromprior_free(ptr, 0);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
as_value() {
|
|
27
|
+
const ret = wasm.fromprior_as_value(this.__wbg_ptr);
|
|
28
|
+
if (ret[2]) {
|
|
29
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
30
|
+
}
|
|
31
|
+
return takeFromExternrefTable0(ret[0]);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Instantiates FromPrior from plain object
|
|
35
|
+
* @param {IFromPrior} value
|
|
36
|
+
*/
|
|
37
|
+
constructor(value) {
|
|
38
|
+
const ret = wasm.fromprior_new(value);
|
|
39
|
+
if (ret[2]) {
|
|
40
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
41
|
+
}
|
|
42
|
+
this.__wbg_ptr = ret[0];
|
|
43
|
+
FromPriorFinalization.register(this, this.__wbg_ptr, this);
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @param {string | null | undefined} issuer_kid
|
|
48
|
+
* @param {any} did_resolver
|
|
49
|
+
* @param {any} secrets_resolver
|
|
50
|
+
* @returns {Promise<any>}
|
|
51
|
+
*/
|
|
52
|
+
pack(issuer_kid, did_resolver, secrets_resolver) {
|
|
53
|
+
var ptr0 = isLikeNone(issuer_kid) ? 0 : passStringToWasm0(issuer_kid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
54
|
+
var len0 = WASM_VECTOR_LEN;
|
|
55
|
+
const ret = wasm.fromprior_pack(this.__wbg_ptr, ptr0, len0, did_resolver, secrets_resolver);
|
|
56
|
+
return ret;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @param {string} from_prior
|
|
60
|
+
* @param {any} did_resolver
|
|
61
|
+
* @returns {Promise<any>}
|
|
62
|
+
*/
|
|
63
|
+
static unpack(from_prior, did_resolver) {
|
|
64
|
+
const ptr0 = passStringToWasm0(from_prior, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
65
|
+
const len0 = WASM_VECTOR_LEN;
|
|
66
|
+
const ret = wasm.fromprior_unpack(ptr0, len0, did_resolver);
|
|
67
|
+
return ret;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (Symbol.dispose) FromPrior.prototype[Symbol.dispose] = FromPrior.prototype.free;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Wrapper for plain message. Provides helpers for message building and packing/unpacking.
|
|
74
|
+
*/
|
|
75
|
+
export class Message {
|
|
76
|
+
static __wrap(ptr) {
|
|
77
|
+
const obj = Object.create(Message.prototype);
|
|
78
|
+
obj.__wbg_ptr = ptr;
|
|
79
|
+
MessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
__destroy_into_raw() {
|
|
83
|
+
const ptr = this.__wbg_ptr;
|
|
84
|
+
this.__wbg_ptr = 0;
|
|
85
|
+
MessageFinalization.unregister(this);
|
|
86
|
+
return ptr;
|
|
87
|
+
}
|
|
88
|
+
free() {
|
|
89
|
+
const ptr = this.__destroy_into_raw();
|
|
90
|
+
wasm.__wbg_message_free(ptr, 0);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @returns {any}
|
|
94
|
+
*/
|
|
95
|
+
as_value() {
|
|
96
|
+
const ret = wasm.message_as_value(this.__wbg_ptr);
|
|
97
|
+
if (ret[2]) {
|
|
98
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
99
|
+
}
|
|
100
|
+
return takeFromExternrefTable0(ret[0]);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Instantiates message from plain object
|
|
104
|
+
* @param {IMessage} value
|
|
105
|
+
*/
|
|
106
|
+
constructor(value) {
|
|
107
|
+
const ret = wasm.message_new(value);
|
|
108
|
+
if (ret[2]) {
|
|
109
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
110
|
+
}
|
|
111
|
+
this.__wbg_ptr = ret[0];
|
|
112
|
+
MessageFinalization.register(this, this.__wbg_ptr, this);
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @param {string} to
|
|
117
|
+
* @param {string | null | undefined} from
|
|
118
|
+
* @param {string | null | undefined} sign_by
|
|
119
|
+
* @param {any} did_resolver
|
|
120
|
+
* @param {any} secrets_resolver
|
|
121
|
+
* @param {any} options
|
|
122
|
+
* @returns {Promise<any>}
|
|
123
|
+
*/
|
|
124
|
+
pack_encrypted(to, from, sign_by, did_resolver, secrets_resolver, options) {
|
|
125
|
+
const ptr0 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
126
|
+
const len0 = WASM_VECTOR_LEN;
|
|
127
|
+
var ptr1 = isLikeNone(from) ? 0 : passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
128
|
+
var len1 = WASM_VECTOR_LEN;
|
|
129
|
+
var ptr2 = isLikeNone(sign_by) ? 0 : passStringToWasm0(sign_by, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
130
|
+
var len2 = WASM_VECTOR_LEN;
|
|
131
|
+
const ret = wasm.message_pack_encrypted(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, did_resolver, secrets_resolver, options);
|
|
132
|
+
return ret;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @param {any} did_resolver
|
|
136
|
+
* @returns {Promise<any>}
|
|
137
|
+
*/
|
|
138
|
+
pack_plaintext(did_resolver) {
|
|
139
|
+
const ret = wasm.message_pack_plaintext(this.__wbg_ptr, did_resolver);
|
|
140
|
+
return ret;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @param {string} sign_by
|
|
144
|
+
* @param {any} did_resolver
|
|
145
|
+
* @param {any} secrets_resolver
|
|
146
|
+
* @returns {Promise<any>}
|
|
147
|
+
*/
|
|
148
|
+
pack_signed(sign_by, did_resolver, secrets_resolver) {
|
|
149
|
+
const ptr0 = passStringToWasm0(sign_by, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
150
|
+
const len0 = WASM_VECTOR_LEN;
|
|
151
|
+
const ret = wasm.message_pack_signed(this.__wbg_ptr, ptr0, len0, did_resolver, secrets_resolver);
|
|
152
|
+
return ret;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @returns {any}
|
|
156
|
+
*/
|
|
157
|
+
try_parse_forward() {
|
|
158
|
+
const ret = wasm.message_try_parse_forward(this.__wbg_ptr);
|
|
159
|
+
if (ret[2]) {
|
|
160
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
161
|
+
}
|
|
162
|
+
return takeFromExternrefTable0(ret[0]);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* @param {string} msg
|
|
166
|
+
* @param {any} did_resolver
|
|
167
|
+
* @param {any} secrets_resolver
|
|
168
|
+
* @param {any} options
|
|
169
|
+
* @returns {Promise<any>}
|
|
170
|
+
*/
|
|
171
|
+
static unpack(msg, did_resolver, secrets_resolver, options) {
|
|
172
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
173
|
+
const len0 = WASM_VECTOR_LEN;
|
|
174
|
+
const ret = wasm.message_unpack(ptr0, len0, did_resolver, secrets_resolver, options);
|
|
175
|
+
return ret;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @param {string} msg
|
|
179
|
+
* @param {any} headers
|
|
180
|
+
* @param {string} to
|
|
181
|
+
* @param {any} routing_keys
|
|
182
|
+
* @param {any} enc_alg_anon
|
|
183
|
+
* @param {any} did_resolver
|
|
184
|
+
* @returns {Promise<any>}
|
|
185
|
+
*/
|
|
186
|
+
static wrap_in_forward(msg, headers, to, routing_keys, enc_alg_anon, did_resolver) {
|
|
187
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
|
+
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
190
|
+
const len1 = WASM_VECTOR_LEN;
|
|
191
|
+
const ret = wasm.message_wrap_in_forward(ptr0, len0, headers, ptr1, len1, routing_keys, enc_alg_anon, did_resolver);
|
|
192
|
+
return ret;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (Symbol.dispose) Message.prototype[Symbol.dispose] = Message.prototype.free;
|
|
196
|
+
|
|
197
|
+
export class ParsedForward {
|
|
198
|
+
__destroy_into_raw() {
|
|
199
|
+
const ptr = this.__wbg_ptr;
|
|
200
|
+
this.__wbg_ptr = 0;
|
|
201
|
+
ParsedForwardFinalization.unregister(this);
|
|
202
|
+
return ptr;
|
|
203
|
+
}
|
|
204
|
+
free() {
|
|
205
|
+
const ptr = this.__destroy_into_raw();
|
|
206
|
+
wasm.__wbg_parsedforward_free(ptr, 0);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* @returns {any}
|
|
210
|
+
*/
|
|
211
|
+
as_value() {
|
|
212
|
+
const ret = wasm.parsedforward_as_value(this.__wbg_ptr);
|
|
213
|
+
if (ret[2]) {
|
|
214
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
215
|
+
}
|
|
216
|
+
return takeFromExternrefTable0(ret[0]);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (Symbol.dispose) ParsedForward.prototype[Symbol.dispose] = ParsedForward.prototype.free;
|
|
220
|
+
export function __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0(arg0, arg1) {
|
|
221
|
+
const ret = debugString(arg1);
|
|
222
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
223
|
+
const len1 = WASM_VECTOR_LEN;
|
|
224
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
225
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
226
|
+
}
|
|
227
|
+
export function __wbg___wbindgen_is_function_fcda5e3902d732fe(arg0) {
|
|
228
|
+
const ret = typeof(arg0) === 'function';
|
|
229
|
+
return ret;
|
|
230
|
+
}
|
|
231
|
+
export function __wbg___wbindgen_is_object_edb6b15aa3afe12e(arg0) {
|
|
232
|
+
const val = arg0;
|
|
233
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
234
|
+
return ret;
|
|
235
|
+
}
|
|
236
|
+
export function __wbg___wbindgen_is_string_c4f7cb494a2a21f1(arg0) {
|
|
237
|
+
const ret = typeof(arg0) === 'string';
|
|
238
|
+
return ret;
|
|
239
|
+
}
|
|
240
|
+
export function __wbg___wbindgen_is_undefined_8c687d0b90d5b524(arg0) {
|
|
241
|
+
const ret = arg0 === undefined;
|
|
242
|
+
return ret;
|
|
243
|
+
}
|
|
244
|
+
export function __wbg___wbindgen_string_get_92ab86bb19cbc12f(arg0, arg1) {
|
|
245
|
+
const obj = arg1;
|
|
246
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
247
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
248
|
+
var len1 = WASM_VECTOR_LEN;
|
|
249
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
250
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
251
|
+
}
|
|
252
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
253
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
254
|
+
}
|
|
255
|
+
export function __wbg__wbg_cb_unref_997e73d32238e655(arg0) {
|
|
256
|
+
arg0._wbg_cb_unref();
|
|
257
|
+
}
|
|
258
|
+
export function __wbg_call_6bcf8d3e20937e46() { return handleError(function (arg0, arg1, arg2) {
|
|
259
|
+
const ret = arg0.call(arg1, arg2);
|
|
260
|
+
return ret;
|
|
261
|
+
}, arguments); }
|
|
262
|
+
export function __wbg_crypto_38df2bab126b63dc(arg0) {
|
|
263
|
+
const ret = arg0.crypto;
|
|
264
|
+
return ret;
|
|
265
|
+
}
|
|
266
|
+
export function __wbg_error_757e9472f8410341(arg0, arg1) {
|
|
267
|
+
let deferred0_0;
|
|
268
|
+
let deferred0_1;
|
|
269
|
+
try {
|
|
270
|
+
deferred0_0 = arg0;
|
|
271
|
+
deferred0_1 = arg1;
|
|
272
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
273
|
+
} finally {
|
|
274
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
export function __wbg_find_secrets_ac7fdc1159604883() { return handleError(function (arg0, arg1) {
|
|
278
|
+
const ret = arg0.find_secrets(arg1);
|
|
279
|
+
return ret;
|
|
280
|
+
}, arguments); }
|
|
281
|
+
export function __wbg_fromprior_new(arg0) {
|
|
282
|
+
const ret = FromPrior.__wrap(arg0);
|
|
283
|
+
return ret;
|
|
284
|
+
}
|
|
285
|
+
export function __wbg_getRandomValues_c44a50d8cfdaebeb() { return handleError(function (arg0, arg1) {
|
|
286
|
+
arg0.getRandomValues(arg1);
|
|
287
|
+
}, arguments); }
|
|
288
|
+
export function __wbg_get_secret_4feafe5a1d1ffa81() { return handleError(function (arg0, arg1, arg2) {
|
|
289
|
+
const ret = arg0.get_secret(getStringFromWasm0(arg1, arg2));
|
|
290
|
+
return ret;
|
|
291
|
+
}, arguments); }
|
|
292
|
+
export function __wbg_get_unchecked_363572bdd397d473(arg0, arg1) {
|
|
293
|
+
const ret = arg0[arg1 >>> 0];
|
|
294
|
+
return ret;
|
|
295
|
+
}
|
|
296
|
+
export function __wbg_instanceof_Error_fe6fa771c78ee4cf(arg0) {
|
|
297
|
+
let result;
|
|
298
|
+
try {
|
|
299
|
+
result = arg0 instanceof Error;
|
|
300
|
+
} catch (_) {
|
|
301
|
+
result = false;
|
|
302
|
+
}
|
|
303
|
+
const ret = result;
|
|
304
|
+
return ret;
|
|
305
|
+
}
|
|
306
|
+
export function __wbg_isArray_5674713bb7b79043(arg0) {
|
|
307
|
+
const ret = Array.isArray(arg0);
|
|
308
|
+
return ret;
|
|
309
|
+
}
|
|
310
|
+
export function __wbg_length_31bdaf014f5fbde2(arg0) {
|
|
311
|
+
const ret = arg0.length;
|
|
312
|
+
return ret;
|
|
313
|
+
}
|
|
314
|
+
export function __wbg_length_4e1adc0d42e23620(arg0) {
|
|
315
|
+
const ret = arg0.length;
|
|
316
|
+
return ret;
|
|
317
|
+
}
|
|
318
|
+
export function __wbg_message_1cbc5bc03dcf1dee(arg0) {
|
|
319
|
+
const ret = arg0.message;
|
|
320
|
+
return ret;
|
|
321
|
+
}
|
|
322
|
+
export function __wbg_message_new(arg0) {
|
|
323
|
+
const ret = Message.__wrap(arg0);
|
|
324
|
+
return ret;
|
|
325
|
+
}
|
|
326
|
+
export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
|
|
327
|
+
const ret = arg0.msCrypto;
|
|
328
|
+
return ret;
|
|
329
|
+
}
|
|
330
|
+
export function __wbg_name_b9d8f2ea16b22045(arg0) {
|
|
331
|
+
const ret = arg0.name;
|
|
332
|
+
return ret;
|
|
333
|
+
}
|
|
334
|
+
export function __wbg_new_227d7c05414eb861() {
|
|
335
|
+
const ret = new Error();
|
|
336
|
+
return ret;
|
|
337
|
+
}
|
|
338
|
+
export function __wbg_new_a32a1ab6c6655abe(arg0, arg1) {
|
|
339
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
340
|
+
return ret;
|
|
341
|
+
}
|
|
342
|
+
export function __wbg_new_ffa92086ea89f79c() {
|
|
343
|
+
const ret = new Array();
|
|
344
|
+
return ret;
|
|
345
|
+
}
|
|
346
|
+
export function __wbg_new_typed_6f8b0d724fe26c07(arg0, arg1) {
|
|
347
|
+
try {
|
|
348
|
+
var state0 = {a: arg0, b: arg1};
|
|
349
|
+
var cb0 = (arg0, arg1) => {
|
|
350
|
+
const a = state0.a;
|
|
351
|
+
state0.a = 0;
|
|
352
|
+
try {
|
|
353
|
+
return wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
354
|
+
} finally {
|
|
355
|
+
state0.a = a;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
const ret = new Promise(cb0);
|
|
359
|
+
return ret;
|
|
360
|
+
} finally {
|
|
361
|
+
state0.a = 0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
export function __wbg_new_with_length_5ffeddb9d9fbb96f(arg0) {
|
|
365
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
366
|
+
return ret;
|
|
367
|
+
}
|
|
368
|
+
export function __wbg_new_with_length_6a9fc3631737ef8c(arg0) {
|
|
369
|
+
const ret = new Array(arg0 >>> 0);
|
|
370
|
+
return ret;
|
|
371
|
+
}
|
|
372
|
+
export function __wbg_node_84ea875411254db1(arg0) {
|
|
373
|
+
const ret = arg0.node;
|
|
374
|
+
return ret;
|
|
375
|
+
}
|
|
376
|
+
export function __wbg_parse_23539455d6f8d64a(arg0, arg1) {
|
|
377
|
+
let deferred0_0;
|
|
378
|
+
let deferred0_1;
|
|
379
|
+
try {
|
|
380
|
+
deferred0_0 = arg0;
|
|
381
|
+
deferred0_1 = arg1;
|
|
382
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
383
|
+
return ret;
|
|
384
|
+
} finally {
|
|
385
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
export function __wbg_process_44c7a14e11e9f69e(arg0) {
|
|
389
|
+
const ret = arg0.process;
|
|
390
|
+
return ret;
|
|
391
|
+
}
|
|
392
|
+
export function __wbg_prototypesetcall_ae9f5e7459250748(arg0, arg1, arg2) {
|
|
393
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
394
|
+
}
|
|
395
|
+
export function __wbg_push_bfdf956ba476f65b(arg0, arg1) {
|
|
396
|
+
const ret = arg0.push(arg1);
|
|
397
|
+
return ret;
|
|
398
|
+
}
|
|
399
|
+
export function __wbg_queueMicrotask_85c90f6987555d65(arg0) {
|
|
400
|
+
const ret = arg0.queueMicrotask;
|
|
401
|
+
return ret;
|
|
402
|
+
}
|
|
403
|
+
export function __wbg_queueMicrotask_f6a1fa10b81d1fc0(arg0) {
|
|
404
|
+
queueMicrotask(arg0);
|
|
405
|
+
}
|
|
406
|
+
export function __wbg_randomFillSync_6c25eac9869eb53c() { return handleError(function (arg0, arg1) {
|
|
407
|
+
arg0.randomFillSync(arg1);
|
|
408
|
+
}, arguments); }
|
|
409
|
+
export function __wbg_require_b4edbdcf3e2a1ef0() { return handleError(function () {
|
|
410
|
+
const ret = module.require;
|
|
411
|
+
return ret;
|
|
412
|
+
}, arguments); }
|
|
413
|
+
export function __wbg_resolve_35ec7e0c6af4c82c(arg0) {
|
|
414
|
+
const ret = Promise.resolve(arg0);
|
|
415
|
+
return ret;
|
|
416
|
+
}
|
|
417
|
+
export function __wbg_resolve_e22be98c10d787e4() { return handleError(function (arg0, arg1, arg2) {
|
|
418
|
+
const ret = arg0.resolve(getStringFromWasm0(arg1, arg2));
|
|
419
|
+
return ret;
|
|
420
|
+
}, arguments); }
|
|
421
|
+
export function __wbg_set_13d25b81ab403f5e(arg0, arg1, arg2) {
|
|
422
|
+
arg0[arg1 >>> 0] = arg2;
|
|
423
|
+
}
|
|
424
|
+
export function __wbg_set_name_6e2a5da46a9ae1e7(arg0, arg1, arg2) {
|
|
425
|
+
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
426
|
+
}
|
|
427
|
+
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
428
|
+
const ret = arg1.stack;
|
|
429
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
430
|
+
const len1 = WASM_VECTOR_LEN;
|
|
431
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
432
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
433
|
+
}
|
|
434
|
+
export function __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0() {
|
|
435
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
436
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
437
|
+
}
|
|
438
|
+
export function __wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db() {
|
|
439
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
440
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
441
|
+
}
|
|
442
|
+
export function __wbg_static_accessor_SELF_d8b50611246a6d92() {
|
|
443
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
444
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
445
|
+
}
|
|
446
|
+
export function __wbg_static_accessor_WINDOW_fd0bc376bf0f8b42() {
|
|
447
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
448
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
449
|
+
}
|
|
450
|
+
export function __wbg_stringify_708233af042413e0(arg0, arg1) {
|
|
451
|
+
const ret = JSON.stringify(arg1);
|
|
452
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
453
|
+
var len1 = WASM_VECTOR_LEN;
|
|
454
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
455
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
456
|
+
}
|
|
457
|
+
export function __wbg_subarray_1daff70dde20c145(arg0, arg1, arg2) {
|
|
458
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
459
|
+
return ret;
|
|
460
|
+
}
|
|
461
|
+
export function __wbg_then_7a850dae4493f353(arg0, arg1, arg2) {
|
|
462
|
+
const ret = arg0.then(arg1, arg2);
|
|
463
|
+
return ret;
|
|
464
|
+
}
|
|
465
|
+
export function __wbg_then_b830475380919203(arg0, arg1) {
|
|
466
|
+
const ret = arg0.then(arg1);
|
|
467
|
+
return ret;
|
|
468
|
+
}
|
|
469
|
+
export function __wbg_versions_276b2795b1c6a219(arg0) {
|
|
470
|
+
const ret = arg0.versions;
|
|
471
|
+
return ret;
|
|
472
|
+
}
|
|
473
|
+
export function __wbindgen_generic_0000000000000001(arg0, arg1) {
|
|
474
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 435, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
475
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___wasm_bindgen_648b4352b10fe6c___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_648b4352b10fe6c___JsError___true_);
|
|
476
|
+
return ret;
|
|
477
|
+
}
|
|
478
|
+
export function __wbindgen_generic_0000000000000002(arg0, arg1) {
|
|
479
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
480
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
481
|
+
return ret;
|
|
482
|
+
}
|
|
483
|
+
export function __wbindgen_generic_0000000000000003(arg0, arg1) {
|
|
484
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
485
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
486
|
+
return ret;
|
|
487
|
+
}
|
|
488
|
+
export function __wbindgen_init_externref_table() {
|
|
489
|
+
const table = wasm.__wbindgen_externrefs;
|
|
490
|
+
const offset = table.grow(4);
|
|
491
|
+
table.set(0, undefined);
|
|
492
|
+
table.set(offset + 0, undefined);
|
|
493
|
+
table.set(offset + 1, null);
|
|
494
|
+
table.set(offset + 2, true);
|
|
495
|
+
table.set(offset + 3, false);
|
|
496
|
+
}
|
|
497
|
+
function wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___wasm_bindgen_648b4352b10fe6c___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_648b4352b10fe6c___JsError___true_(arg0, arg1, arg2) {
|
|
498
|
+
const ret = wasm.wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___wasm_bindgen_648b4352b10fe6c___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_648b4352b10fe6c___JsError___true_(arg0, arg1, arg2);
|
|
499
|
+
if (ret[1]) {
|
|
500
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
505
|
+
wasm.wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const FromPriorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
509
|
+
? { register: () => {}, unregister: () => {} }
|
|
510
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fromprior_free(ptr, 1));
|
|
511
|
+
const MessageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
512
|
+
? { register: () => {}, unregister: () => {} }
|
|
513
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_message_free(ptr, 1));
|
|
514
|
+
const ParsedForwardFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
515
|
+
? { register: () => {}, unregister: () => {} }
|
|
516
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parsedforward_free(ptr, 1));
|
|
517
|
+
|
|
518
|
+
function addToExternrefTable0(obj) {
|
|
519
|
+
const idx = wasm.__externref_table_alloc();
|
|
520
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
521
|
+
return idx;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
525
|
+
? { register: () => {}, unregister: () => {} }
|
|
526
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
527
|
+
|
|
528
|
+
function debugString(val) {
|
|
529
|
+
// primitive types
|
|
530
|
+
const type = typeof val;
|
|
531
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
532
|
+
return `${val}`;
|
|
533
|
+
}
|
|
534
|
+
if (type == 'string') {
|
|
535
|
+
return `"${val}"`;
|
|
536
|
+
}
|
|
537
|
+
if (type == 'symbol') {
|
|
538
|
+
const description = val.description;
|
|
539
|
+
if (description == null) {
|
|
540
|
+
return 'Symbol';
|
|
541
|
+
} else {
|
|
542
|
+
return `Symbol(${description})`;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (type == 'function') {
|
|
546
|
+
const name = val.name;
|
|
547
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
548
|
+
return `Function(${name})`;
|
|
549
|
+
} else {
|
|
550
|
+
return 'Function';
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
// objects
|
|
554
|
+
if (Array.isArray(val)) {
|
|
555
|
+
const length = val.length;
|
|
556
|
+
let debug = '[';
|
|
557
|
+
if (length > 0) {
|
|
558
|
+
debug += debugString(val[0]);
|
|
559
|
+
}
|
|
560
|
+
for(let i = 1; i < length; i++) {
|
|
561
|
+
debug += ', ' + debugString(val[i]);
|
|
562
|
+
}
|
|
563
|
+
debug += ']';
|
|
564
|
+
return debug;
|
|
565
|
+
}
|
|
566
|
+
// Test for built-in
|
|
567
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
568
|
+
let className;
|
|
569
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
570
|
+
className = builtInMatches[1];
|
|
571
|
+
} else {
|
|
572
|
+
// Failed to match the standard '[object ClassName]'
|
|
573
|
+
return toString.call(val);
|
|
574
|
+
}
|
|
575
|
+
if (className == 'Object') {
|
|
576
|
+
// we're a user defined class or Object
|
|
577
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
578
|
+
// easier than looping through ownProperties of `val`.
|
|
579
|
+
try {
|
|
580
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
581
|
+
} catch (_) {
|
|
582
|
+
return 'Object';
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
// errors
|
|
586
|
+
if (val instanceof Error) {
|
|
587
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
588
|
+
}
|
|
589
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
590
|
+
return className;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
594
|
+
ptr = ptr >>> 0;
|
|
595
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
let cachedDataViewMemory0 = null;
|
|
599
|
+
function getDataViewMemory0() {
|
|
600
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
601
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
602
|
+
}
|
|
603
|
+
return cachedDataViewMemory0;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
function getStringFromWasm0(ptr, len) {
|
|
607
|
+
return decodeText(ptr >>> 0, len);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
let cachedUint8ArrayMemory0 = null;
|
|
611
|
+
function getUint8ArrayMemory0() {
|
|
612
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
613
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
614
|
+
}
|
|
615
|
+
return cachedUint8ArrayMemory0;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function handleError(f, args) {
|
|
619
|
+
try {
|
|
620
|
+
return f.apply(this, args);
|
|
621
|
+
} catch (e) {
|
|
622
|
+
const idx = addToExternrefTable0(e);
|
|
623
|
+
wasm.__wbindgen_exn_store(idx);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function isLikeNone(x) {
|
|
628
|
+
return x === undefined || x === null;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
632
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
633
|
+
const real = (...args) => {
|
|
634
|
+
|
|
635
|
+
// First up with a closure we increment the internal reference
|
|
636
|
+
// count. This ensures that the Rust closure environment won't
|
|
637
|
+
// be deallocated while we're invoking it.
|
|
638
|
+
state.cnt++;
|
|
639
|
+
const a = state.a;
|
|
640
|
+
state.a = 0;
|
|
641
|
+
try {
|
|
642
|
+
return f(a, state.b, ...args);
|
|
643
|
+
} finally {
|
|
644
|
+
state.a = a;
|
|
645
|
+
real._wbg_cb_unref();
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
real._wbg_cb_unref = () => {
|
|
649
|
+
if (--state.cnt === 0) {
|
|
650
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
651
|
+
state.a = 0;
|
|
652
|
+
CLOSURE_DTORS.unregister(state);
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
656
|
+
return real;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
660
|
+
if (realloc === undefined) {
|
|
661
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
662
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
663
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
664
|
+
WASM_VECTOR_LEN = buf.length;
|
|
665
|
+
return ptr;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
let len = arg.length;
|
|
669
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
670
|
+
|
|
671
|
+
const mem = getUint8ArrayMemory0();
|
|
672
|
+
|
|
673
|
+
let offset = 0;
|
|
674
|
+
|
|
675
|
+
for (; offset < len; offset++) {
|
|
676
|
+
const code = arg.charCodeAt(offset);
|
|
677
|
+
if (code > 0x7F) break;
|
|
678
|
+
mem[ptr + offset] = code;
|
|
679
|
+
}
|
|
680
|
+
if (offset !== len) {
|
|
681
|
+
if (offset !== 0) {
|
|
682
|
+
arg = arg.slice(offset);
|
|
683
|
+
}
|
|
684
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
685
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
686
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
687
|
+
|
|
688
|
+
offset += ret.written;
|
|
689
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
WASM_VECTOR_LEN = offset;
|
|
693
|
+
return ptr;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
function takeFromExternrefTable0(idx) {
|
|
697
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
698
|
+
wasm.__externref_table_dealloc(idx);
|
|
699
|
+
return value;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
703
|
+
cachedTextDecoder.decode();
|
|
704
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
705
|
+
let numBytesDecoded = 0;
|
|
706
|
+
function decodeText(ptr, len) {
|
|
707
|
+
numBytesDecoded += len;
|
|
708
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
709
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
710
|
+
cachedTextDecoder.decode();
|
|
711
|
+
numBytesDecoded = len;
|
|
712
|
+
}
|
|
713
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const cachedTextEncoder = new TextEncoder();
|
|
717
|
+
|
|
718
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
719
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
720
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
721
|
+
view.set(buf);
|
|
722
|
+
return {
|
|
723
|
+
read: arg.length,
|
|
724
|
+
written: buf.length
|
|
725
|
+
};
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
let WASM_VECTOR_LEN = 0;
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
let wasm;
|
|
733
|
+
export function __wbg_set_wasm(val) {
|
|
734
|
+
wasm = val;
|
|
735
|
+
}
|