@imweapp/openclaw-imwe 2026.4.12-alpha.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +172 -0
  3. package/index.ts +16 -0
  4. package/openclaw.plugin.json +58 -0
  5. package/package.json +73 -0
  6. package/proto/PbBoxPullProto.proto +43 -0
  7. package/proto/PbChatAudioContent.proto +23 -0
  8. package/proto/PbChatDeliverMsg.proto +38 -0
  9. package/proto/PbChatFileMeta.proto +34 -0
  10. package/proto/PbChatMsg.proto +93 -0
  11. package/proto/PbChatRichMediaContent.proto +31 -0
  12. package/proto/PbChatTextContent.proto +38 -0
  13. package/proto/PbMarkdownContent.proto +18 -0
  14. package/proto/PbMsgReadStampContent.proto +11 -0
  15. package/proto/PbPacket.proto +61 -0
  16. package/proto/PbSingleChatMsg.proto +60 -0
  17. package/setup-entry.ts +17 -0
  18. package/src/accounts.ts +109 -0
  19. package/src/api-client.ts +740 -0
  20. package/src/bot-info-cache.ts +49 -0
  21. package/src/channel.runtime.ts +29 -0
  22. package/src/channel.ts +456 -0
  23. package/src/config-schema.ts +26 -0
  24. package/src/e2ee/api.ts +261 -0
  25. package/src/e2ee/canonical.ts +59 -0
  26. package/src/e2ee/errors.ts +103 -0
  27. package/src/e2ee/index.ts +8 -0
  28. package/src/e2ee/proper-lockfile.d.ts +61 -0
  29. package/src/e2ee/service.ts +1273 -0
  30. package/src/e2ee/store.ts +174 -0
  31. package/src/e2ee/types.ts +113 -0
  32. package/src/e2ee/vodozemac.ts +373 -0
  33. package/src/file-transfer/api.ts +364 -0
  34. package/src/file-transfer/concurrency.ts +77 -0
  35. package/src/file-transfer/download.ts +261 -0
  36. package/src/file-transfer/file-crypto.ts +93 -0
  37. package/src/file-transfer/index.ts +18 -0
  38. package/src/file-transfer/scheduler.ts +185 -0
  39. package/src/file-transfer/types.ts +195 -0
  40. package/src/file-transfer/upload.ts +656 -0
  41. package/src/markdown-detect.ts +119 -0
  42. package/src/media-upload.ts +338 -0
  43. package/src/media-utils.ts +110 -0
  44. package/src/monitor.ts +838 -0
  45. package/src/proto/codec.ts +54 -0
  46. package/src/proto/inbound.codec.ts +624 -0
  47. package/src/proto/proto-types.ts +291 -0
  48. package/src/proto/registry.ts +226 -0
  49. package/src/proto/send.codec.ts +535 -0
  50. package/src/recent-message-cache.ts +350 -0
  51. package/src/send.ts +792 -0
  52. package/src/setup-core.ts +62 -0
  53. package/src/types.ts +153 -0
  54. package/src/vodozemackit/index.ts +297 -0
  55. package/src/vodozemackit/pkg/vodozemackit_wasm.d.ts +138 -0
  56. package/src/vodozemackit/pkg/vodozemackit_wasm.js +24 -0
  57. package/src/vodozemackit/pkg/vodozemackit_wasm_bg.js +1172 -0
  58. package/src/vodozemackit/pkg/vodozemackit_wasm_bg.wasm +0 -0
  59. package/src/vodozemackit/pkg/vodozemackit_wasm_bg.wasm.d.ts +109 -0
@@ -0,0 +1,1172 @@
1
+ export class Account {
2
+ static __wrap(ptr) {
3
+ const obj = Object.create(Account.prototype);
4
+ obj.__wbg_ptr = ptr;
5
+ AccountFinalization.register(obj, obj.__wbg_ptr, obj);
6
+ return obj;
7
+ }
8
+ __destroy_into_raw() {
9
+ const ptr = this.__wbg_ptr;
10
+ this.__wbg_ptr = 0;
11
+ AccountFinalization.unregister(this);
12
+ return ptr;
13
+ }
14
+ free() {
15
+ const ptr = this.__destroy_into_raw();
16
+ wasm.__wbg_account_free(ptr, 0);
17
+ }
18
+ /**
19
+ * @param {EncryptedMessage} message
20
+ * @returns {InboundCreationResult}
21
+ */
22
+ createInboundSession(message) {
23
+ _assertClass(message, EncryptedMessage);
24
+ const ret = wasm.account_createInboundSession(this.__wbg_ptr, message.__wbg_ptr);
25
+ if (ret[2]) {
26
+ throw takeFromExternrefTable0(ret[1]);
27
+ }
28
+ return InboundCreationResult.__wrap(ret[0]);
29
+ }
30
+ /**
31
+ * @param {string} identity_key
32
+ * @param {string} one_time_key
33
+ * @returns {Session}
34
+ */
35
+ createOutboundSession(identity_key, one_time_key) {
36
+ const ptr0 = passStringToWasm0(identity_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
37
+ const len0 = WASM_VECTOR_LEN;
38
+ const ptr1 = passStringToWasm0(one_time_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
39
+ const len1 = WASM_VECTOR_LEN;
40
+ const ret = wasm.account_createOutboundSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
41
+ if (ret[2]) {
42
+ throw takeFromExternrefTable0(ret[1]);
43
+ }
44
+ return Session.__wrap(ret[0]);
45
+ }
46
+ /**
47
+ * @returns {string}
48
+ */
49
+ curve25519Key() {
50
+ let deferred1_0;
51
+ let deferred1_1;
52
+ try {
53
+ const ret = wasm.account_curve25519Key(this.__wbg_ptr);
54
+ deferred1_0 = ret[0];
55
+ deferred1_1 = ret[1];
56
+ return getStringFromWasm0(ret[0], ret[1]);
57
+ } finally {
58
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
59
+ }
60
+ }
61
+ /**
62
+ * @returns {string}
63
+ */
64
+ ed25519Key() {
65
+ let deferred1_0;
66
+ let deferred1_1;
67
+ try {
68
+ const ret = wasm.account_ed25519Key(this.__wbg_ptr);
69
+ deferred1_0 = ret[0];
70
+ deferred1_1 = ret[1];
71
+ return getStringFromWasm0(ret[0], ret[1]);
72
+ } finally {
73
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
74
+ }
75
+ }
76
+ /**
77
+ * @returns {any}
78
+ */
79
+ fallbackKey() {
80
+ const ret = wasm.account_fallbackKey(this.__wbg_ptr);
81
+ if (ret[2]) {
82
+ throw takeFromExternrefTable0(ret[1]);
83
+ }
84
+ return takeFromExternrefTable0(ret[0]);
85
+ }
86
+ generateFallbackKey() {
87
+ wasm.account_generateFallbackKey(this.__wbg_ptr);
88
+ }
89
+ /**
90
+ * @param {number} number_of_keys
91
+ */
92
+ generateOneTimeKeys(number_of_keys) {
93
+ wasm.account_generateOneTimeKeys(this.__wbg_ptr, number_of_keys);
94
+ }
95
+ /**
96
+ * Generates one-time keys and returns metadata about the keys that were
97
+ * created along with any keys evicted to make room. Mirrors
98
+ * `Account.generate_one_time_keys_with_info` on the UniFFI side.
99
+ * @param {number} number_of_keys
100
+ * @returns {OneTimeKeyGenerationInfo}
101
+ */
102
+ generateOneTimeKeysWithInfo(number_of_keys) {
103
+ const ret = wasm.account_generateOneTimeKeysWithInfo(this.__wbg_ptr, number_of_keys);
104
+ return OneTimeKeyGenerationInfo.__wrap(ret);
105
+ }
106
+ markKeysAsPublished() {
107
+ wasm.account_markKeysAsPublished(this.__wbg_ptr);
108
+ }
109
+ /**
110
+ * @returns {number}
111
+ */
112
+ maxNumberOfOneTimeKeys() {
113
+ const ret = wasm.account_maxNumberOfOneTimeKeys(this.__wbg_ptr);
114
+ return ret >>> 0;
115
+ }
116
+ constructor() {
117
+ const ret = wasm.account_new();
118
+ this.__wbg_ptr = ret;
119
+ AccountFinalization.register(this, this.__wbg_ptr, this);
120
+ return this;
121
+ }
122
+ /**
123
+ * @returns {any}
124
+ */
125
+ oneTimeKeys() {
126
+ const ret = wasm.account_oneTimeKeys(this.__wbg_ptr);
127
+ if (ret[2]) {
128
+ throw takeFromExternrefTable0(ret[1]);
129
+ }
130
+ return takeFromExternrefTable0(ret[0]);
131
+ }
132
+ /**
133
+ * Returns the full list of currently unpublished one-time keys as
134
+ * `OneTimeKeyInfo` entries. Mirrors `Account.one_time_keys_with_info` on
135
+ * the UniFFI side.
136
+ * @returns {OneTimeKeyInfo[]}
137
+ */
138
+ oneTimeKeysWithInfo() {
139
+ const ret = wasm.account_oneTimeKeysWithInfo(this.__wbg_ptr);
140
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
141
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
142
+ return v1;
143
+ }
144
+ /**
145
+ * @param {Uint8Array} pickle_key
146
+ * @returns {string}
147
+ */
148
+ pickle(pickle_key) {
149
+ let deferred3_0;
150
+ let deferred3_1;
151
+ try {
152
+ const ptr0 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ret = wasm.account_pickle(this.__wbg_ptr, ptr0, len0);
155
+ var ptr2 = ret[0];
156
+ var len2 = ret[1];
157
+ if (ret[3]) {
158
+ ptr2 = 0;
159
+ len2 = 0;
160
+ throw takeFromExternrefTable0(ret[2]);
161
+ }
162
+ deferred3_0 = ptr2;
163
+ deferred3_1 = len2;
164
+ return getStringFromWasm0(ptr2, len2);
165
+ } finally {
166
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
167
+ }
168
+ }
169
+ /**
170
+ * @param {string} message
171
+ * @returns {string}
172
+ */
173
+ sign(message) {
174
+ let deferred2_0;
175
+ let deferred2_1;
176
+ try {
177
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const len0 = WASM_VECTOR_LEN;
179
+ const ret = wasm.account_sign(this.__wbg_ptr, ptr0, len0);
180
+ deferred2_0 = ret[0];
181
+ deferred2_1 = ret[1];
182
+ return getStringFromWasm0(ret[0], ret[1]);
183
+ } finally {
184
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
185
+ }
186
+ }
187
+ /**
188
+ * Returns the number of one-time keys that are generated but not yet
189
+ * marked as published.
190
+ * @returns {number}
191
+ */
192
+ unpublishedOneTimeKeyCount() {
193
+ const ret = wasm.account_unpublishedOneTimeKeyCount(this.__wbg_ptr);
194
+ return ret >>> 0;
195
+ }
196
+ }
197
+ if (Symbol.dispose) Account.prototype[Symbol.dispose] = Account.prototype.free;
198
+
199
+ export class DecryptedMessage {
200
+ static __wrap(ptr) {
201
+ const obj = Object.create(DecryptedMessage.prototype);
202
+ obj.__wbg_ptr = ptr;
203
+ DecryptedMessageFinalization.register(obj, obj.__wbg_ptr, obj);
204
+ return obj;
205
+ }
206
+ __destroy_into_raw() {
207
+ const ptr = this.__wbg_ptr;
208
+ this.__wbg_ptr = 0;
209
+ DecryptedMessageFinalization.unregister(this);
210
+ return ptr;
211
+ }
212
+ free() {
213
+ const ptr = this.__destroy_into_raw();
214
+ wasm.__wbg_decryptedmessage_free(ptr, 0);
215
+ }
216
+ /**
217
+ * @returns {number}
218
+ */
219
+ get messageIndex() {
220
+ const ret = wasm.decryptedmessage_messageIndex(this.__wbg_ptr);
221
+ return ret >>> 0;
222
+ }
223
+ /**
224
+ * @returns {Uint8Array}
225
+ */
226
+ get plaintext() {
227
+ const ret = wasm.decryptedmessage_plaintext(this.__wbg_ptr);
228
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
229
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
230
+ return v1;
231
+ }
232
+ }
233
+ if (Symbol.dispose) DecryptedMessage.prototype[Symbol.dispose] = DecryptedMessage.prototype.free;
234
+
235
+ export class EncryptedMessage {
236
+ static __wrap(ptr) {
237
+ const obj = Object.create(EncryptedMessage.prototype);
238
+ obj.__wbg_ptr = ptr;
239
+ EncryptedMessageFinalization.register(obj, obj.__wbg_ptr, obj);
240
+ return obj;
241
+ }
242
+ __destroy_into_raw() {
243
+ const ptr = this.__wbg_ptr;
244
+ this.__wbg_ptr = 0;
245
+ EncryptedMessageFinalization.unregister(this);
246
+ return ptr;
247
+ }
248
+ free() {
249
+ const ptr = this.__destroy_into_raw();
250
+ wasm.__wbg_encryptedmessage_free(ptr, 0);
251
+ }
252
+ /**
253
+ * @returns {Uint8Array}
254
+ */
255
+ get body() {
256
+ const ret = wasm.encryptedmessage_body(this.__wbg_ptr);
257
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
258
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
259
+ return v1;
260
+ }
261
+ /**
262
+ * @param {Uint8Array} body
263
+ */
264
+ constructor(body) {
265
+ const ptr0 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
266
+ const len0 = WASM_VECTOR_LEN;
267
+ const ret = wasm.encryptedmessage_new(ptr0, len0);
268
+ this.__wbg_ptr = ret;
269
+ EncryptedMessageFinalization.register(this, this.__wbg_ptr, this);
270
+ return this;
271
+ }
272
+ }
273
+ if (Symbol.dispose) EncryptedMessage.prototype[Symbol.dispose] = EncryptedMessage.prototype.free;
274
+
275
+ export class GroupSession {
276
+ static __wrap(ptr) {
277
+ const obj = Object.create(GroupSession.prototype);
278
+ obj.__wbg_ptr = ptr;
279
+ GroupSessionFinalization.register(obj, obj.__wbg_ptr, obj);
280
+ return obj;
281
+ }
282
+ __destroy_into_raw() {
283
+ const ptr = this.__wbg_ptr;
284
+ this.__wbg_ptr = 0;
285
+ GroupSessionFinalization.unregister(this);
286
+ return ptr;
287
+ }
288
+ free() {
289
+ const ptr = this.__destroy_into_raw();
290
+ wasm.__wbg_groupsession_free(ptr, 0);
291
+ }
292
+ /**
293
+ * @param {Uint8Array} payload
294
+ * @returns {EncryptedMessage}
295
+ */
296
+ encrypt(payload) {
297
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
298
+ const len0 = WASM_VECTOR_LEN;
299
+ const ret = wasm.groupsession_encrypt(this.__wbg_ptr, ptr0, len0);
300
+ return EncryptedMessage.__wrap(ret);
301
+ }
302
+ /**
303
+ * @returns {number}
304
+ */
305
+ messageIndex() {
306
+ const ret = wasm.groupsession_messageIndex(this.__wbg_ptr);
307
+ return ret >>> 0;
308
+ }
309
+ constructor() {
310
+ const ret = wasm.groupsession_new();
311
+ this.__wbg_ptr = ret;
312
+ GroupSessionFinalization.register(this, this.__wbg_ptr, this);
313
+ return this;
314
+ }
315
+ /**
316
+ * @param {Uint8Array} pickle_key
317
+ * @returns {string}
318
+ */
319
+ pickle(pickle_key) {
320
+ let deferred3_0;
321
+ let deferred3_1;
322
+ try {
323
+ const ptr0 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
324
+ const len0 = WASM_VECTOR_LEN;
325
+ const ret = wasm.groupsession_pickle(this.__wbg_ptr, ptr0, len0);
326
+ var ptr2 = ret[0];
327
+ var len2 = ret[1];
328
+ if (ret[3]) {
329
+ ptr2 = 0;
330
+ len2 = 0;
331
+ throw takeFromExternrefTable0(ret[2]);
332
+ }
333
+ deferred3_0 = ptr2;
334
+ deferred3_1 = len2;
335
+ return getStringFromWasm0(ptr2, len2);
336
+ } finally {
337
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
338
+ }
339
+ }
340
+ /**
341
+ * @returns {string}
342
+ */
343
+ sessionId() {
344
+ let deferred1_0;
345
+ let deferred1_1;
346
+ try {
347
+ const ret = wasm.groupsession_sessionId(this.__wbg_ptr);
348
+ deferred1_0 = ret[0];
349
+ deferred1_1 = ret[1];
350
+ return getStringFromWasm0(ret[0], ret[1]);
351
+ } finally {
352
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
353
+ }
354
+ }
355
+ /**
356
+ * @returns {string}
357
+ */
358
+ sessionKey() {
359
+ let deferred1_0;
360
+ let deferred1_1;
361
+ try {
362
+ const ret = wasm.groupsession_sessionKey(this.__wbg_ptr);
363
+ deferred1_0 = ret[0];
364
+ deferred1_1 = ret[1];
365
+ return getStringFromWasm0(ret[0], ret[1]);
366
+ } finally {
367
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
368
+ }
369
+ }
370
+ }
371
+ if (Symbol.dispose) GroupSession.prototype[Symbol.dispose] = GroupSession.prototype.free;
372
+
373
+ export class InboundCreationResult {
374
+ static __wrap(ptr) {
375
+ const obj = Object.create(InboundCreationResult.prototype);
376
+ obj.__wbg_ptr = ptr;
377
+ InboundCreationResultFinalization.register(obj, obj.__wbg_ptr, obj);
378
+ return obj;
379
+ }
380
+ __destroy_into_raw() {
381
+ const ptr = this.__wbg_ptr;
382
+ this.__wbg_ptr = 0;
383
+ InboundCreationResultFinalization.unregister(this);
384
+ return ptr;
385
+ }
386
+ free() {
387
+ const ptr = this.__destroy_into_raw();
388
+ wasm.__wbg_inboundcreationresult_free(ptr, 0);
389
+ }
390
+ /**
391
+ * The base64 encoded one-time key that was used in the pre-key message
392
+ * to establish the inbound session.
393
+ * @returns {string}
394
+ */
395
+ oneTimeKey() {
396
+ let deferred1_0;
397
+ let deferred1_1;
398
+ try {
399
+ const ret = wasm.inboundcreationresult_oneTimeKey(this.__wbg_ptr);
400
+ deferred1_0 = ret[0];
401
+ deferred1_1 = ret[1];
402
+ return getStringFromWasm0(ret[0], ret[1]);
403
+ } finally {
404
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
405
+ }
406
+ }
407
+ /**
408
+ * @returns {Uint8Array}
409
+ */
410
+ plaintext() {
411
+ const ret = wasm.inboundcreationresult_plaintext(this.__wbg_ptr);
412
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
413
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
414
+ return v1;
415
+ }
416
+ /**
417
+ * @returns {Session}
418
+ */
419
+ takeSession() {
420
+ const ret = wasm.inboundcreationresult_takeSession(this.__wbg_ptr);
421
+ if (ret[2]) {
422
+ throw takeFromExternrefTable0(ret[1]);
423
+ }
424
+ return Session.__wrap(ret[0]);
425
+ }
426
+ }
427
+ if (Symbol.dispose)
428
+ InboundCreationResult.prototype[Symbol.dispose] = InboundCreationResult.prototype.free;
429
+
430
+ export class InboundGroupSession {
431
+ static __wrap(ptr) {
432
+ const obj = Object.create(InboundGroupSession.prototype);
433
+ obj.__wbg_ptr = ptr;
434
+ InboundGroupSessionFinalization.register(obj, obj.__wbg_ptr, obj);
435
+ return obj;
436
+ }
437
+ __destroy_into_raw() {
438
+ const ptr = this.__wbg_ptr;
439
+ this.__wbg_ptr = 0;
440
+ InboundGroupSessionFinalization.unregister(this);
441
+ return ptr;
442
+ }
443
+ free() {
444
+ const ptr = this.__destroy_into_raw();
445
+ wasm.__wbg_inboundgroupsession_free(ptr, 0);
446
+ }
447
+ /**
448
+ * @param {Uint8Array} payload
449
+ * @returns {DecryptedMessage}
450
+ */
451
+ decrypt(payload) {
452
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
453
+ const len0 = WASM_VECTOR_LEN;
454
+ const ret = wasm.inboundgroupsession_decrypt(this.__wbg_ptr, ptr0, len0);
455
+ if (ret[2]) {
456
+ throw takeFromExternrefTable0(ret[1]);
457
+ }
458
+ return DecryptedMessage.__wrap(ret[0]);
459
+ }
460
+ /**
461
+ * @param {number} index
462
+ * @returns {string | undefined}
463
+ */
464
+ exportAt(index) {
465
+ const ret = wasm.inboundgroupsession_exportAt(this.__wbg_ptr, index);
466
+ let v1;
467
+ if (ret[0] !== 0) {
468
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
469
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
470
+ }
471
+ return v1;
472
+ }
473
+ /**
474
+ * @returns {number}
475
+ */
476
+ firstKnownIndex() {
477
+ const ret = wasm.inboundgroupsession_firstKnownIndex(this.__wbg_ptr);
478
+ return ret >>> 0;
479
+ }
480
+ /**
481
+ * @param {Uint8Array} pickle_key
482
+ * @returns {string}
483
+ */
484
+ pickle(pickle_key) {
485
+ let deferred3_0;
486
+ let deferred3_1;
487
+ try {
488
+ const ptr0 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
489
+ const len0 = WASM_VECTOR_LEN;
490
+ const ret = wasm.inboundgroupsession_pickle(this.__wbg_ptr, ptr0, len0);
491
+ var ptr2 = ret[0];
492
+ var len2 = ret[1];
493
+ if (ret[3]) {
494
+ ptr2 = 0;
495
+ len2 = 0;
496
+ throw takeFromExternrefTable0(ret[2]);
497
+ }
498
+ deferred3_0 = ptr2;
499
+ deferred3_1 = len2;
500
+ return getStringFromWasm0(ptr2, len2);
501
+ } finally {
502
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
503
+ }
504
+ }
505
+ /**
506
+ * @returns {string}
507
+ */
508
+ sessionId() {
509
+ let deferred1_0;
510
+ let deferred1_1;
511
+ try {
512
+ const ret = wasm.inboundgroupsession_sessionId(this.__wbg_ptr);
513
+ deferred1_0 = ret[0];
514
+ deferred1_1 = ret[1];
515
+ return getStringFromWasm0(ret[0], ret[1]);
516
+ } finally {
517
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
518
+ }
519
+ }
520
+ }
521
+ if (Symbol.dispose)
522
+ InboundGroupSession.prototype[Symbol.dispose] = InboundGroupSession.prototype.free;
523
+
524
+ /**
525
+ * Result of generating one-time keys, containing detailed info about newly
526
+ * created keys and the base64 public keys that were evicted.
527
+ */
528
+ export class OneTimeKeyGenerationInfo {
529
+ static __wrap(ptr) {
530
+ const obj = Object.create(OneTimeKeyGenerationInfo.prototype);
531
+ obj.__wbg_ptr = ptr;
532
+ OneTimeKeyGenerationInfoFinalization.register(obj, obj.__wbg_ptr, obj);
533
+ return obj;
534
+ }
535
+ __destroy_into_raw() {
536
+ const ptr = this.__wbg_ptr;
537
+ this.__wbg_ptr = 0;
538
+ OneTimeKeyGenerationInfoFinalization.unregister(this);
539
+ return ptr;
540
+ }
541
+ free() {
542
+ const ptr = this.__destroy_into_raw();
543
+ wasm.__wbg_onetimekeygenerationinfo_free(ptr, 0);
544
+ }
545
+ /**
546
+ * @returns {OneTimeKeyInfo[]}
547
+ */
548
+ get created() {
549
+ const ret = wasm.onetimekeygenerationinfo_created(this.__wbg_ptr);
550
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
551
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
552
+ return v1;
553
+ }
554
+ /**
555
+ * @returns {string[]}
556
+ */
557
+ get removed() {
558
+ const ret = wasm.onetimekeygenerationinfo_removed(this.__wbg_ptr);
559
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
560
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
561
+ return v1;
562
+ }
563
+ }
564
+ if (Symbol.dispose)
565
+ OneTimeKeyGenerationInfo.prototype[Symbol.dispose] = OneTimeKeyGenerationInfo.prototype.free;
566
+
567
+ /**
568
+ * Detailed info about a single one-time key.
569
+ */
570
+ export class OneTimeKeyInfo {
571
+ static __wrap(ptr) {
572
+ const obj = Object.create(OneTimeKeyInfo.prototype);
573
+ obj.__wbg_ptr = ptr;
574
+ OneTimeKeyInfoFinalization.register(obj, obj.__wbg_ptr, obj);
575
+ return obj;
576
+ }
577
+ __destroy_into_raw() {
578
+ const ptr = this.__wbg_ptr;
579
+ this.__wbg_ptr = 0;
580
+ OneTimeKeyInfoFinalization.unregister(this);
581
+ return ptr;
582
+ }
583
+ free() {
584
+ const ptr = this.__destroy_into_raw();
585
+ wasm.__wbg_onetimekeyinfo_free(ptr, 0);
586
+ }
587
+ /**
588
+ * @returns {string}
589
+ */
590
+ get keyId() {
591
+ let deferred1_0;
592
+ let deferred1_1;
593
+ try {
594
+ const ret = wasm.onetimekeyinfo_keyId(this.__wbg_ptr);
595
+ deferred1_0 = ret[0];
596
+ deferred1_1 = ret[1];
597
+ return getStringFromWasm0(ret[0], ret[1]);
598
+ } finally {
599
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
600
+ }
601
+ }
602
+ /**
603
+ * @returns {string}
604
+ */
605
+ get publicKey() {
606
+ let deferred1_0;
607
+ let deferred1_1;
608
+ try {
609
+ const ret = wasm.onetimekeyinfo_publicKey(this.__wbg_ptr);
610
+ deferred1_0 = ret[0];
611
+ deferred1_1 = ret[1];
612
+ return getStringFromWasm0(ret[0], ret[1]);
613
+ } finally {
614
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
615
+ }
616
+ }
617
+ }
618
+ if (Symbol.dispose) OneTimeKeyInfo.prototype[Symbol.dispose] = OneTimeKeyInfo.prototype.free;
619
+
620
+ export class Session {
621
+ static __wrap(ptr) {
622
+ const obj = Object.create(Session.prototype);
623
+ obj.__wbg_ptr = ptr;
624
+ SessionFinalization.register(obj, obj.__wbg_ptr, obj);
625
+ return obj;
626
+ }
627
+ __destroy_into_raw() {
628
+ const ptr = this.__wbg_ptr;
629
+ this.__wbg_ptr = 0;
630
+ SessionFinalization.unregister(this);
631
+ return ptr;
632
+ }
633
+ free() {
634
+ const ptr = this.__destroy_into_raw();
635
+ wasm.__wbg_session_free(ptr, 0);
636
+ }
637
+ /**
638
+ * @param {EncryptedMessage} message
639
+ * @returns {Uint8Array}
640
+ */
641
+ decrypt(message) {
642
+ _assertClass(message, EncryptedMessage);
643
+ const ret = wasm.session_decrypt(this.__wbg_ptr, message.__wbg_ptr);
644
+ if (ret[3]) {
645
+ throw takeFromExternrefTable0(ret[2]);
646
+ }
647
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
648
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
649
+ return v1;
650
+ }
651
+ /**
652
+ * @param {Uint8Array} payload
653
+ * @returns {EncryptedMessage}
654
+ */
655
+ encrypt(payload) {
656
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
657
+ const len0 = WASM_VECTOR_LEN;
658
+ const ret = wasm.session_encrypt(this.__wbg_ptr, ptr0, len0);
659
+ if (ret[2]) {
660
+ throw takeFromExternrefTable0(ret[1]);
661
+ }
662
+ return EncryptedMessage.__wrap(ret[0]);
663
+ }
664
+ /**
665
+ * @param {Uint8Array} pickle_key
666
+ * @returns {string}
667
+ */
668
+ pickle(pickle_key) {
669
+ let deferred3_0;
670
+ let deferred3_1;
671
+ try {
672
+ const ptr0 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
673
+ const len0 = WASM_VECTOR_LEN;
674
+ const ret = wasm.session_pickle(this.__wbg_ptr, ptr0, len0);
675
+ var ptr2 = ret[0];
676
+ var len2 = ret[1];
677
+ if (ret[3]) {
678
+ ptr2 = 0;
679
+ len2 = 0;
680
+ throw takeFromExternrefTable0(ret[2]);
681
+ }
682
+ deferred3_0 = ptr2;
683
+ deferred3_1 = len2;
684
+ return getStringFromWasm0(ptr2, len2);
685
+ } finally {
686
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
687
+ }
688
+ }
689
+ /**
690
+ * @returns {string}
691
+ */
692
+ sessionId() {
693
+ let deferred1_0;
694
+ let deferred1_1;
695
+ try {
696
+ const ret = wasm.session_sessionId(this.__wbg_ptr);
697
+ deferred1_0 = ret[0];
698
+ deferred1_1 = ret[1];
699
+ return getStringFromWasm0(ret[0], ret[1]);
700
+ } finally {
701
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
702
+ }
703
+ }
704
+ /**
705
+ * @param {EncryptedMessage} message
706
+ * @returns {boolean}
707
+ */
708
+ sessionMatches(message) {
709
+ _assertClass(message, EncryptedMessage);
710
+ const ret = wasm.session_sessionMatches(this.__wbg_ptr, message.__wbg_ptr);
711
+ return ret !== 0;
712
+ }
713
+ }
714
+ if (Symbol.dispose) Session.prototype[Symbol.dispose] = Session.prototype.free;
715
+
716
+ /**
717
+ * @param {string} pickle
718
+ * @param {Uint8Array} pickle_key
719
+ * @returns {Account}
720
+ */
721
+ export function accountFromPickle(pickle, pickle_key) {
722
+ const ptr0 = passStringToWasm0(pickle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
723
+ const len0 = WASM_VECTOR_LEN;
724
+ const ptr1 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
725
+ const len1 = WASM_VECTOR_LEN;
726
+ const ret = wasm.accountFromPickle(ptr0, len0, ptr1, len1);
727
+ if (ret[2]) {
728
+ throw takeFromExternrefTable0(ret[1]);
729
+ }
730
+ return Account.__wrap(ret[0]);
731
+ }
732
+
733
+ /**
734
+ * @param {string} pickle
735
+ * @param {Uint8Array} pickle_key
736
+ * @returns {GroupSession}
737
+ */
738
+ export function groupSessionFromPickle(pickle, pickle_key) {
739
+ const ptr0 = passStringToWasm0(pickle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
740
+ const len0 = WASM_VECTOR_LEN;
741
+ const ptr1 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
742
+ const len1 = WASM_VECTOR_LEN;
743
+ const ret = wasm.groupSessionFromPickle(ptr0, len0, ptr1, len1);
744
+ if (ret[2]) {
745
+ throw takeFromExternrefTable0(ret[1]);
746
+ }
747
+ return GroupSession.__wrap(ret[0]);
748
+ }
749
+
750
+ /**
751
+ * @param {string} session_key
752
+ * @returns {InboundGroupSession}
753
+ */
754
+ export function importInboundGroupSession(session_key) {
755
+ const ptr0 = passStringToWasm0(session_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
756
+ const len0 = WASM_VECTOR_LEN;
757
+ const ret = wasm.importInboundGroupSession(ptr0, len0);
758
+ if (ret[2]) {
759
+ throw takeFromExternrefTable0(ret[1]);
760
+ }
761
+ return InboundGroupSession.__wrap(ret[0]);
762
+ }
763
+
764
+ /**
765
+ * @param {string} pickle
766
+ * @param {Uint8Array} pickle_key
767
+ * @returns {InboundGroupSession}
768
+ */
769
+ export function inboundGroupSessionFromPickle(pickle, pickle_key) {
770
+ const ptr0 = passStringToWasm0(pickle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
771
+ const len0 = WASM_VECTOR_LEN;
772
+ const ptr1 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
773
+ const len1 = WASM_VECTOR_LEN;
774
+ const ret = wasm.inboundGroupSessionFromPickle(ptr0, len0, ptr1, len1);
775
+ if (ret[2]) {
776
+ throw takeFromExternrefTable0(ret[1]);
777
+ }
778
+ return InboundGroupSession.__wrap(ret[0]);
779
+ }
780
+
781
+ /**
782
+ * @param {string} session_key
783
+ * @returns {InboundGroupSession}
784
+ */
785
+ export function newInboundGroupSession(session_key) {
786
+ const ptr0 = passStringToWasm0(session_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
787
+ const len0 = WASM_VECTOR_LEN;
788
+ const ret = wasm.newInboundGroupSession(ptr0, len0);
789
+ if (ret[2]) {
790
+ throw takeFromExternrefTable0(ret[1]);
791
+ }
792
+ return InboundGroupSession.__wrap(ret[0]);
793
+ }
794
+
795
+ /**
796
+ * @param {string} pickle
797
+ * @param {Uint8Array} pickle_key
798
+ * @returns {Session}
799
+ */
800
+ export function sessionFromPickle(pickle, pickle_key) {
801
+ const ptr0 = passStringToWasm0(pickle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
802
+ const len0 = WASM_VECTOR_LEN;
803
+ const ptr1 = passArray8ToWasm0(pickle_key, wasm.__wbindgen_malloc);
804
+ const len1 = WASM_VECTOR_LEN;
805
+ const ret = wasm.sessionFromPickle(ptr0, len0, ptr1, len1);
806
+ if (ret[2]) {
807
+ throw takeFromExternrefTable0(ret[1]);
808
+ }
809
+ return Session.__wrap(ret[0]);
810
+ }
811
+
812
+ export function start() {
813
+ wasm.start();
814
+ }
815
+ export function __wbg_Error_3639a60ed15f87e7(arg0, arg1) {
816
+ const ret = Error(getStringFromWasm0(arg0, arg1));
817
+ return ret;
818
+ }
819
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
820
+ const ret = String(arg1);
821
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
822
+ const len1 = WASM_VECTOR_LEN;
823
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
824
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
825
+ }
826
+ export function __wbg___wbindgen_is_function_2f0fd7ceb86e64c5(arg0) {
827
+ const ret = typeof arg0 === 'function';
828
+ return ret;
829
+ }
830
+ export function __wbg___wbindgen_is_object_5b22ff2418063a9c(arg0) {
831
+ const val = arg0;
832
+ const ret = typeof val === 'object' && val !== null;
833
+ return ret;
834
+ }
835
+ export function __wbg___wbindgen_is_string_eddc07a3efad52e6(arg0) {
836
+ const ret = typeof arg0 === 'string';
837
+ return ret;
838
+ }
839
+ export function __wbg___wbindgen_is_undefined_244a92c34d3b6ec0(arg0) {
840
+ const ret = arg0 === undefined;
841
+ return ret;
842
+ }
843
+ export function __wbg___wbindgen_throw_9c75d47bf9e7731e(arg0, arg1) {
844
+ throw new Error(getStringFromWasm0(arg0, arg1));
845
+ }
846
+ export function __wbg_call_a41d6421b30a32c5() {
847
+ return handleError(function (arg0, arg1, arg2) {
848
+ const ret = arg0.call(arg1, arg2);
849
+ return ret;
850
+ }, arguments);
851
+ }
852
+ export function __wbg_crypto_38df2bab126b63dc(arg0) {
853
+ const ret = arg0.crypto;
854
+ return ret;
855
+ }
856
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
857
+ let deferred0_0;
858
+ let deferred0_1;
859
+ try {
860
+ deferred0_0 = arg0;
861
+ deferred0_1 = arg1;
862
+ console.error(getStringFromWasm0(arg0, arg1));
863
+ } finally {
864
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
865
+ }
866
+ }
867
+ export function __wbg_getRandomValues_c44a50d8cfdaebeb() {
868
+ return handleError(function (arg0, arg1) {
869
+ arg0.getRandomValues(arg1);
870
+ }, arguments);
871
+ }
872
+ export function __wbg_length_ba3c032602efe310(arg0) {
873
+ const ret = arg0.length;
874
+ return ret;
875
+ }
876
+ export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
877
+ const ret = arg0.msCrypto;
878
+ return ret;
879
+ }
880
+ export function __wbg_new_227d7c05414eb861() {
881
+ const ret = new Error();
882
+ return ret;
883
+ }
884
+ export function __wbg_new_2fad8ca02fd00684() {
885
+ const ret = new Object();
886
+ return ret;
887
+ }
888
+ export function __wbg_new_46ae4e4ff2a07a64() {
889
+ const ret = new Map();
890
+ return ret;
891
+ }
892
+ export function __wbg_new_c9ea13ea803a692e(arg0, arg1) {
893
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
894
+ return ret;
895
+ }
896
+ export function __wbg_new_with_length_9011f5da794bf5d9(arg0) {
897
+ const ret = new Uint8Array(arg0 >>> 0);
898
+ return ret;
899
+ }
900
+ export function __wbg_node_84ea875411254db1(arg0) {
901
+ const ret = arg0.node;
902
+ return ret;
903
+ }
904
+ export function __wbg_onetimekeyinfo_new(arg0) {
905
+ const ret = OneTimeKeyInfo.__wrap(arg0);
906
+ return ret;
907
+ }
908
+ export function __wbg_process_44c7a14e11e9f69e(arg0) {
909
+ const ret = arg0.process;
910
+ return ret;
911
+ }
912
+ export function __wbg_prototypesetcall_fd4050e806e1d519(arg0, arg1, arg2) {
913
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
914
+ }
915
+ export function __wbg_randomFillSync_6c25eac9869eb53c() {
916
+ return handleError(function (arg0, arg1) {
917
+ arg0.randomFillSync(arg1);
918
+ }, arguments);
919
+ }
920
+ export function __wbg_require_b4edbdcf3e2a1ef0() {
921
+ return handleError(function () {
922
+ const ret = module.require;
923
+ return ret;
924
+ }, arguments);
925
+ }
926
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
927
+ arg0[arg1] = arg2;
928
+ }
929
+ export function __wbg_set_82f7a370f604db70(arg0, arg1, arg2) {
930
+ const ret = arg0.set(arg1, arg2);
931
+ return ret;
932
+ }
933
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
934
+ const ret = arg1.stack;
935
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
936
+ const len1 = WASM_VECTOR_LEN;
937
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
938
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
939
+ }
940
+ export function __wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb() {
941
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
942
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
943
+ }
944
+ export function __wbg_static_accessor_GLOBAL_e039bc914f83e74e() {
945
+ const ret = typeof global === 'undefined' ? null : global;
946
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
947
+ }
948
+ export function __wbg_static_accessor_SELF_8bf8c48c28420ad5() {
949
+ // eslint-disable-next-line
950
+ const ret = typeof self === 'undefined' ? null : self;
951
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
952
+ }
953
+ export function __wbg_static_accessor_WINDOW_6aeee9b51652ee0f() {
954
+ // eslint-disable-next-line
955
+ const ret = typeof window === 'undefined' ? null : window;
956
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
957
+ }
958
+ export function __wbg_subarray_fbe3cef290e1fa43(arg0, arg1, arg2) {
959
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
960
+ return ret;
961
+ }
962
+ export function __wbg_versions_276b2795b1c6a219(arg0) {
963
+ const ret = arg0.versions;
964
+ return ret;
965
+ }
966
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
967
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
968
+ const ret = getArrayU8FromWasm0(arg0, arg1);
969
+ return ret;
970
+ }
971
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
972
+ // Cast intrinsic for `Ref(String) -> Externref`.
973
+ const ret = getStringFromWasm0(arg0, arg1);
974
+ return ret;
975
+ }
976
+ export function __wbindgen_init_externref_table() {
977
+ const table = wasm.__wbindgen_externrefs;
978
+ const offset = table.grow(4);
979
+ table.set(0, undefined);
980
+ table.set(offset + 0, undefined);
981
+ table.set(offset + 1, null);
982
+ table.set(offset + 2, true);
983
+ table.set(offset + 3, false);
984
+ }
985
+ const AccountFinalization =
986
+ typeof FinalizationRegistry === 'undefined'
987
+ ? { register: () => {}, unregister: () => {} }
988
+ : new FinalizationRegistry((ptr) => wasm.__wbg_account_free(ptr, 1));
989
+ const DecryptedMessageFinalization =
990
+ typeof FinalizationRegistry === 'undefined'
991
+ ? { register: () => {}, unregister: () => {} }
992
+ : new FinalizationRegistry((ptr) => wasm.__wbg_decryptedmessage_free(ptr, 1));
993
+ const EncryptedMessageFinalization =
994
+ typeof FinalizationRegistry === 'undefined'
995
+ ? { register: () => {}, unregister: () => {} }
996
+ : new FinalizationRegistry((ptr) => wasm.__wbg_encryptedmessage_free(ptr, 1));
997
+ const GroupSessionFinalization =
998
+ typeof FinalizationRegistry === 'undefined'
999
+ ? { register: () => {}, unregister: () => {} }
1000
+ : new FinalizationRegistry((ptr) => wasm.__wbg_groupsession_free(ptr, 1));
1001
+ const InboundCreationResultFinalization =
1002
+ typeof FinalizationRegistry === 'undefined'
1003
+ ? { register: () => {}, unregister: () => {} }
1004
+ : new FinalizationRegistry((ptr) => wasm.__wbg_inboundcreationresult_free(ptr, 1));
1005
+ const InboundGroupSessionFinalization =
1006
+ typeof FinalizationRegistry === 'undefined'
1007
+ ? { register: () => {}, unregister: () => {} }
1008
+ : new FinalizationRegistry((ptr) => wasm.__wbg_inboundgroupsession_free(ptr, 1));
1009
+ const OneTimeKeyGenerationInfoFinalization =
1010
+ typeof FinalizationRegistry === 'undefined'
1011
+ ? { register: () => {}, unregister: () => {} }
1012
+ : new FinalizationRegistry((ptr) => wasm.__wbg_onetimekeygenerationinfo_free(ptr, 1));
1013
+ const OneTimeKeyInfoFinalization =
1014
+ typeof FinalizationRegistry === 'undefined'
1015
+ ? { register: () => {}, unregister: () => {} }
1016
+ : new FinalizationRegistry((ptr) => wasm.__wbg_onetimekeyinfo_free(ptr, 1));
1017
+ const SessionFinalization =
1018
+ typeof FinalizationRegistry === 'undefined'
1019
+ ? { register: () => {}, unregister: () => {} }
1020
+ : new FinalizationRegistry((ptr) => wasm.__wbg_session_free(ptr, 1));
1021
+
1022
+ function addToExternrefTable0(obj) {
1023
+ const idx = wasm.__externref_table_alloc();
1024
+ wasm.__wbindgen_externrefs.set(idx, obj);
1025
+ return idx;
1026
+ }
1027
+
1028
+ function _assertClass(instance, klass) {
1029
+ if (!(instance instanceof klass)) {
1030
+ throw new Error(`expected instance of ${klass.name}`);
1031
+ }
1032
+ }
1033
+
1034
+ function getArrayJsValueFromWasm0(ptr, len) {
1035
+ ptr = ptr >>> 0;
1036
+ const mem = getDataViewMemory0();
1037
+ const result = [];
1038
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1039
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
1040
+ }
1041
+ wasm.__externref_drop_slice(ptr, len);
1042
+ return result;
1043
+ }
1044
+
1045
+ function getArrayU8FromWasm0(ptr, len) {
1046
+ ptr = ptr >>> 0;
1047
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1048
+ }
1049
+
1050
+ let cachedDataViewMemory0 = null;
1051
+ function getDataViewMemory0() {
1052
+ if (
1053
+ cachedDataViewMemory0 === null ||
1054
+ cachedDataViewMemory0.buffer.detached === true ||
1055
+ (cachedDataViewMemory0.buffer.detached === undefined &&
1056
+ cachedDataViewMemory0.buffer !== wasm.memory.buffer)
1057
+ ) {
1058
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1059
+ }
1060
+ return cachedDataViewMemory0;
1061
+ }
1062
+
1063
+ function getStringFromWasm0(ptr, len) {
1064
+ return decodeText(ptr >>> 0, len);
1065
+ }
1066
+
1067
+ let cachedUint8ArrayMemory0 = null;
1068
+ function getUint8ArrayMemory0() {
1069
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1070
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1071
+ }
1072
+ return cachedUint8ArrayMemory0;
1073
+ }
1074
+
1075
+ function handleError(f, args) {
1076
+ try {
1077
+ return f.apply(this, args);
1078
+ } catch (e) {
1079
+ const idx = addToExternrefTable0(e);
1080
+ wasm.__wbindgen_exn_store(idx);
1081
+ }
1082
+ }
1083
+
1084
+ function isLikeNone(x) {
1085
+ return x === undefined || x === null;
1086
+ }
1087
+
1088
+ function passArray8ToWasm0(arg, malloc) {
1089
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1090
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1091
+ WASM_VECTOR_LEN = arg.length;
1092
+ return ptr;
1093
+ }
1094
+
1095
+ function passStringToWasm0(arg, malloc, realloc) {
1096
+ if (realloc === undefined) {
1097
+ const buf = cachedTextEncoder.encode(arg);
1098
+ const ptr = malloc(buf.length, 1) >>> 0;
1099
+ getUint8ArrayMemory0()
1100
+ .subarray(ptr, ptr + buf.length)
1101
+ .set(buf);
1102
+ WASM_VECTOR_LEN = buf.length;
1103
+ return ptr;
1104
+ }
1105
+
1106
+ let len = arg.length;
1107
+ let ptr = malloc(len, 1) >>> 0;
1108
+
1109
+ const mem = getUint8ArrayMemory0();
1110
+
1111
+ let offset = 0;
1112
+
1113
+ for (; offset < len; offset++) {
1114
+ const code = arg.charCodeAt(offset);
1115
+ if (code > 0x7f) break;
1116
+ mem[ptr + offset] = code;
1117
+ }
1118
+ if (offset !== len) {
1119
+ if (offset !== 0) {
1120
+ arg = arg.slice(offset);
1121
+ }
1122
+ ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
1123
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1124
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1125
+
1126
+ offset += ret.written;
1127
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1128
+ }
1129
+
1130
+ WASM_VECTOR_LEN = offset;
1131
+ return ptr;
1132
+ }
1133
+
1134
+ function takeFromExternrefTable0(idx) {
1135
+ const value = wasm.__wbindgen_externrefs.get(idx);
1136
+ wasm.__externref_table_dealloc(idx);
1137
+ return value;
1138
+ }
1139
+
1140
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1141
+ cachedTextDecoder.decode();
1142
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1143
+ let numBytesDecoded = 0;
1144
+ function decodeText(ptr, len) {
1145
+ numBytesDecoded += len;
1146
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1147
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1148
+ cachedTextDecoder.decode();
1149
+ numBytesDecoded = len;
1150
+ }
1151
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1152
+ }
1153
+
1154
+ const cachedTextEncoder = new TextEncoder();
1155
+
1156
+ if (!('encodeInto' in cachedTextEncoder)) {
1157
+ cachedTextEncoder.encodeInto = function (arg, view) {
1158
+ const buf = cachedTextEncoder.encode(arg);
1159
+ view.set(buf);
1160
+ return {
1161
+ read: arg.length,
1162
+ written: buf.length,
1163
+ };
1164
+ };
1165
+ }
1166
+
1167
+ let WASM_VECTOR_LEN = 0;
1168
+
1169
+ let wasm;
1170
+ export function __wbg_set_wasm(val) {
1171
+ wasm = val;
1172
+ }