@keyhive/keyhive 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3493 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+ let wasm;
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
+
7
+ let cachedUint8ArrayMemory0 = null;
8
+
9
+ function getUint8ArrayMemory0() {
10
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
+ }
13
+ return cachedUint8ArrayMemory0;
14
+ }
15
+
16
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
+
18
+ cachedTextDecoder.decode();
19
+
20
+ function decodeText(ptr, len) {
21
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
22
+ }
23
+
24
+ function getStringFromWasm0(ptr, len) {
25
+ ptr = ptr >>> 0;
26
+ return decodeText(ptr, len);
27
+ }
28
+
29
+ function addToExternrefTable0(obj) {
30
+ const idx = wasm.__externref_table_alloc();
31
+ wasm.__wbindgen_export_2.set(idx, obj);
32
+ return idx;
33
+ }
34
+
35
+ function handleError(f, args) {
36
+ try {
37
+ return f.apply(this, args);
38
+ } catch (e) {
39
+ const idx = addToExternrefTable0(e);
40
+ wasm.__wbindgen_exn_store(idx);
41
+ }
42
+ }
43
+
44
+ function getArrayU8FromWasm0(ptr, len) {
45
+ ptr = ptr >>> 0;
46
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
47
+ }
48
+
49
+ let WASM_VECTOR_LEN = 0;
50
+
51
+ const cachedTextEncoder = new TextEncoder('utf-8');
52
+
53
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
54
+ ? function (arg, view) {
55
+ return cachedTextEncoder.encodeInto(arg, view);
56
+ }
57
+ : function (arg, view) {
58
+ const buf = cachedTextEncoder.encode(arg);
59
+ view.set(buf);
60
+ return {
61
+ read: arg.length,
62
+ written: buf.length
63
+ };
64
+ });
65
+
66
+ function passStringToWasm0(arg, malloc, realloc) {
67
+
68
+ if (realloc === undefined) {
69
+ const buf = cachedTextEncoder.encode(arg);
70
+ const ptr = malloc(buf.length, 1) >>> 0;
71
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
72
+ WASM_VECTOR_LEN = buf.length;
73
+ return ptr;
74
+ }
75
+
76
+ let len = arg.length;
77
+ let ptr = malloc(len, 1) >>> 0;
78
+
79
+ const mem = getUint8ArrayMemory0();
80
+
81
+ let offset = 0;
82
+
83
+ for (; offset < len; offset++) {
84
+ const code = arg.charCodeAt(offset);
85
+ if (code > 0x7F) break;
86
+ mem[ptr + offset] = code;
87
+ }
88
+
89
+ if (offset !== len) {
90
+ if (offset !== 0) {
91
+ arg = arg.slice(offset);
92
+ }
93
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
94
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
95
+ const ret = encodeString(arg, view);
96
+
97
+ offset += ret.written;
98
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
99
+ }
100
+
101
+ WASM_VECTOR_LEN = offset;
102
+ return ptr;
103
+ }
104
+
105
+ let cachedDataViewMemory0 = null;
106
+
107
+ function getDataViewMemory0() {
108
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
109
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
110
+ }
111
+ return cachedDataViewMemory0;
112
+ }
113
+
114
+ function isLikeNone(x) {
115
+ return x === undefined || x === null;
116
+ }
117
+
118
+ function debugString(val) {
119
+ // primitive types
120
+ const type = typeof val;
121
+ if (type == 'number' || type == 'boolean' || val == null) {
122
+ return `${val}`;
123
+ }
124
+ if (type == 'string') {
125
+ return `"${val}"`;
126
+ }
127
+ if (type == 'symbol') {
128
+ const description = val.description;
129
+ if (description == null) {
130
+ return 'Symbol';
131
+ } else {
132
+ return `Symbol(${description})`;
133
+ }
134
+ }
135
+ if (type == 'function') {
136
+ const name = val.name;
137
+ if (typeof name == 'string' && name.length > 0) {
138
+ return `Function(${name})`;
139
+ } else {
140
+ return 'Function';
141
+ }
142
+ }
143
+ // objects
144
+ if (Array.isArray(val)) {
145
+ const length = val.length;
146
+ let debug = '[';
147
+ if (length > 0) {
148
+ debug += debugString(val[0]);
149
+ }
150
+ for(let i = 1; i < length; i++) {
151
+ debug += ', ' + debugString(val[i]);
152
+ }
153
+ debug += ']';
154
+ return debug;
155
+ }
156
+ // Test for built-in
157
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
158
+ let className;
159
+ if (builtInMatches && builtInMatches.length > 1) {
160
+ className = builtInMatches[1];
161
+ } else {
162
+ // Failed to match the standard '[object ClassName]'
163
+ return toString.call(val);
164
+ }
165
+ if (className == 'Object') {
166
+ // we're a user defined class or Object
167
+ // JSON.stringify avoids problems with cycles, and is generally much
168
+ // easier than looping through ownProperties of `val`.
169
+ try {
170
+ return 'Object(' + JSON.stringify(val) + ')';
171
+ } catch (_) {
172
+ return 'Object';
173
+ }
174
+ }
175
+ // errors
176
+ if (val instanceof Error) {
177
+ return `${val.name}: ${val.message}\n${val.stack}`;
178
+ }
179
+ // TODO we could test for more things here, like `Set`s and `Map`s.
180
+ return className;
181
+ }
182
+
183
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
184
+ ? { register: () => {}, unregister: () => {} }
185
+ : new FinalizationRegistry(
186
+ state => {
187
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
188
+ }
189
+ );
190
+
191
+ function makeMutClosure(arg0, arg1, dtor, f) {
192
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
193
+ const real = (...args) => {
194
+
195
+ // First up with a closure we increment the internal reference
196
+ // count. This ensures that the Rust closure environment won't
197
+ // be deallocated while we're invoking it.
198
+ state.cnt++;
199
+ const a = state.a;
200
+ state.a = 0;
201
+ try {
202
+ return f(a, state.b, ...args);
203
+ } finally {
204
+ if (--state.cnt === 0) {
205
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
206
+ CLOSURE_DTORS.unregister(state);
207
+ } else {
208
+ state.a = a;
209
+ }
210
+ }
211
+ };
212
+ real.original = state;
213
+ CLOSURE_DTORS.register(real, state, state);
214
+ return real;
215
+ }
216
+
217
+ function getArrayJsValueFromWasm0(ptr, len) {
218
+ ptr = ptr >>> 0;
219
+ const mem = getDataViewMemory0();
220
+ const result = [];
221
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
222
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
223
+ }
224
+ wasm.__externref_drop_slice(ptr, len);
225
+ return result;
226
+ }
227
+
228
+ function passArray8ToWasm0(arg, malloc) {
229
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
230
+ getUint8ArrayMemory0().set(arg, ptr / 1);
231
+ WASM_VECTOR_LEN = arg.length;
232
+ return ptr;
233
+ }
234
+
235
+ function takeFromExternrefTable0(idx) {
236
+ const value = wasm.__wbindgen_export_2.get(idx);
237
+ wasm.__externref_table_dealloc(idx);
238
+ return value;
239
+ }
240
+
241
+ function _assertClass(instance, klass) {
242
+ if (!(instance instanceof klass)) {
243
+ throw new Error(`expected instance of ${klass.name}`);
244
+ }
245
+ }
246
+
247
+ function passArrayJsValueToWasm0(array, malloc) {
248
+ const ptr = malloc(array.length * 4, 4) >>> 0;
249
+ for (let i = 0; i < array.length; i++) {
250
+ const add = addToExternrefTable0(array[i]);
251
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
252
+ }
253
+ WASM_VECTOR_LEN = array.length;
254
+ return ptr;
255
+ }
256
+ /**
257
+ * Panic hook lets us get better error messages if our Rust code ever panics.
258
+ *
259
+ * This function needs to be called at least once during initialisation.
260
+ * https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/src-utils-rs.html#2-what-is-console_error_panic_hook
261
+ */
262
+ module.exports.setPanicHook = function() {
263
+ wasm.setPanicHook();
264
+ };
265
+
266
+ function __wbg_adapter_12(arg0, arg1, arg2) {
267
+ wasm.closure388_externref_shim(arg0, arg1, arg2);
268
+ }
269
+
270
+ function __wbg_adapter_269(arg0, arg1, arg2, arg3) {
271
+ wasm.closure525_externref_shim(arg0, arg1, arg2, arg3);
272
+ }
273
+
274
+ const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
275
+ ? { register: () => {}, unregister: () => {} }
276
+ : new FinalizationRegistry(ptr => wasm.__wbg_access_free(ptr >>> 0, 1));
277
+
278
+ class Access {
279
+
280
+ static __wrap(ptr) {
281
+ ptr = ptr >>> 0;
282
+ const obj = Object.create(Access.prototype);
283
+ obj.__wbg_ptr = ptr;
284
+ AccessFinalization.register(obj, obj.__wbg_ptr, obj);
285
+ return obj;
286
+ }
287
+
288
+ __destroy_into_raw() {
289
+ const ptr = this.__wbg_ptr;
290
+ this.__wbg_ptr = 0;
291
+ AccessFinalization.unregister(this);
292
+ return ptr;
293
+ }
294
+
295
+ free() {
296
+ const ptr = this.__destroy_into_raw();
297
+ wasm.__wbg_access_free(ptr, 0);
298
+ }
299
+ /**
300
+ * @param {string} s
301
+ * @returns {Access | undefined}
302
+ */
303
+ static tryFromString(s) {
304
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
305
+ const len0 = WASM_VECTOR_LEN;
306
+ const ret = wasm.access_tryFromString(ptr0, len0);
307
+ return ret === 0 ? undefined : Access.__wrap(ret);
308
+ }
309
+ /**
310
+ * @returns {string}
311
+ */
312
+ toString() {
313
+ let deferred1_0;
314
+ let deferred1_1;
315
+ try {
316
+ const ret = wasm.access_toString(this.__wbg_ptr);
317
+ deferred1_0 = ret[0];
318
+ deferred1_1 = ret[1];
319
+ return getStringFromWasm0(ret[0], ret[1]);
320
+ } finally {
321
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
322
+ }
323
+ }
324
+ }
325
+ module.exports.Access = Access;
326
+
327
+ const AddMemberErrorFinalization = (typeof FinalizationRegistry === 'undefined')
328
+ ? { register: () => {}, unregister: () => {} }
329
+ : new FinalizationRegistry(ptr => wasm.__wbg_addmembererror_free(ptr >>> 0, 1));
330
+
331
+ class AddMemberError {
332
+
333
+ static __wrap(ptr) {
334
+ ptr = ptr >>> 0;
335
+ const obj = Object.create(AddMemberError.prototype);
336
+ obj.__wbg_ptr = ptr;
337
+ AddMemberErrorFinalization.register(obj, obj.__wbg_ptr, obj);
338
+ return obj;
339
+ }
340
+
341
+ __destroy_into_raw() {
342
+ const ptr = this.__wbg_ptr;
343
+ this.__wbg_ptr = 0;
344
+ AddMemberErrorFinalization.unregister(this);
345
+ return ptr;
346
+ }
347
+
348
+ free() {
349
+ const ptr = this.__destroy_into_raw();
350
+ wasm.__wbg_addmembererror_free(ptr, 0);
351
+ }
352
+ /**
353
+ * @returns {string}
354
+ */
355
+ message() {
356
+ let deferred1_0;
357
+ let deferred1_1;
358
+ try {
359
+ const ret = wasm.addmembererror_message(this.__wbg_ptr);
360
+ deferred1_0 = ret[0];
361
+ deferred1_1 = ret[1];
362
+ return getStringFromWasm0(ret[0], ret[1]);
363
+ } finally {
364
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
365
+ }
366
+ }
367
+ }
368
+ module.exports.AddMemberError = AddMemberError;
369
+
370
+ const AgentFinalization = (typeof FinalizationRegistry === 'undefined')
371
+ ? { register: () => {}, unregister: () => {} }
372
+ : new FinalizationRegistry(ptr => wasm.__wbg_agent_free(ptr >>> 0, 1));
373
+
374
+ class Agent {
375
+
376
+ static __wrap(ptr) {
377
+ ptr = ptr >>> 0;
378
+ const obj = Object.create(Agent.prototype);
379
+ obj.__wbg_ptr = ptr;
380
+ AgentFinalization.register(obj, obj.__wbg_ptr, obj);
381
+ return obj;
382
+ }
383
+
384
+ __destroy_into_raw() {
385
+ const ptr = this.__wbg_ptr;
386
+ this.__wbg_ptr = 0;
387
+ AgentFinalization.unregister(this);
388
+ return ptr;
389
+ }
390
+
391
+ free() {
392
+ const ptr = this.__destroy_into_raw();
393
+ wasm.__wbg_agent_free(ptr, 0);
394
+ }
395
+ /**
396
+ * @returns {string}
397
+ */
398
+ toString() {
399
+ let deferred1_0;
400
+ let deferred1_1;
401
+ try {
402
+ const ret = wasm.agent_toString(this.__wbg_ptr);
403
+ deferred1_0 = ret[0];
404
+ deferred1_1 = ret[1];
405
+ return getStringFromWasm0(ret[0], ret[1]);
406
+ } finally {
407
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
408
+ }
409
+ }
410
+ /**
411
+ * @returns {boolean}
412
+ */
413
+ isIndividual() {
414
+ const ret = wasm.agent_isIndividual(this.__wbg_ptr);
415
+ return ret !== 0;
416
+ }
417
+ /**
418
+ * @returns {boolean}
419
+ */
420
+ isGroup() {
421
+ const ret = wasm.agent_isGroup(this.__wbg_ptr);
422
+ return ret !== 0;
423
+ }
424
+ /**
425
+ * @returns {boolean}
426
+ */
427
+ isDocument() {
428
+ const ret = wasm.agent_isDocument(this.__wbg_ptr);
429
+ return ret !== 0;
430
+ }
431
+ /**
432
+ * @returns {Identifier}
433
+ */
434
+ get id() {
435
+ const ret = wasm.agent_id(this.__wbg_ptr);
436
+ return Identifier.__wrap(ret);
437
+ }
438
+ }
439
+ module.exports.Agent = Agent;
440
+
441
+ const ArchiveFinalization = (typeof FinalizationRegistry === 'undefined')
442
+ ? { register: () => {}, unregister: () => {} }
443
+ : new FinalizationRegistry(ptr => wasm.__wbg_archive_free(ptr >>> 0, 1));
444
+
445
+ class Archive {
446
+
447
+ static __wrap(ptr) {
448
+ ptr = ptr >>> 0;
449
+ const obj = Object.create(Archive.prototype);
450
+ obj.__wbg_ptr = ptr;
451
+ ArchiveFinalization.register(obj, obj.__wbg_ptr, obj);
452
+ return obj;
453
+ }
454
+
455
+ __destroy_into_raw() {
456
+ const ptr = this.__wbg_ptr;
457
+ this.__wbg_ptr = 0;
458
+ ArchiveFinalization.unregister(this);
459
+ return ptr;
460
+ }
461
+
462
+ free() {
463
+ const ptr = this.__destroy_into_raw();
464
+ wasm.__wbg_archive_free(ptr, 0);
465
+ }
466
+ /**
467
+ * @param {Uint8Array} bytes
468
+ */
469
+ constructor(bytes) {
470
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
471
+ const len0 = WASM_VECTOR_LEN;
472
+ const ret = wasm.archive_try_from_bytes(ptr0, len0);
473
+ if (ret[2]) {
474
+ throw takeFromExternrefTable0(ret[1]);
475
+ }
476
+ this.__wbg_ptr = ret[0] >>> 0;
477
+ ArchiveFinalization.register(this, this.__wbg_ptr, this);
478
+ return this;
479
+ }
480
+ /**
481
+ * @returns {Uint8Array}
482
+ */
483
+ toBytes() {
484
+ const ret = wasm.archive_toBytes(this.__wbg_ptr);
485
+ if (ret[3]) {
486
+ throw takeFromExternrefTable0(ret[2]);
487
+ }
488
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
489
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
490
+ return v1;
491
+ }
492
+ /**
493
+ * @param {CiphertextStore} ciphertext_store
494
+ * @param {Signer} signer
495
+ * @param {Function} event_handler
496
+ * @returns {Keyhive}
497
+ */
498
+ tryToKeyhive(ciphertext_store, signer, event_handler) {
499
+ _assertClass(ciphertext_store, CiphertextStore);
500
+ var ptr0 = ciphertext_store.__destroy_into_raw();
501
+ _assertClass(signer, Signer);
502
+ const ret = wasm.archive_tryToKeyhive(this.__wbg_ptr, ptr0, signer.__wbg_ptr, event_handler);
503
+ if (ret[2]) {
504
+ throw takeFromExternrefTable0(ret[1]);
505
+ }
506
+ return Keyhive.__wrap(ret[0]);
507
+ }
508
+ }
509
+ module.exports.Archive = Archive;
510
+
511
+ const CannotParseEd25519SigningKeyFinalization = (typeof FinalizationRegistry === 'undefined')
512
+ ? { register: () => {}, unregister: () => {} }
513
+ : new FinalizationRegistry(ptr => wasm.__wbg_cannotparseed25519signingkey_free(ptr >>> 0, 1));
514
+
515
+ class CannotParseEd25519SigningKey {
516
+
517
+ static __wrap(ptr) {
518
+ ptr = ptr >>> 0;
519
+ const obj = Object.create(CannotParseEd25519SigningKey.prototype);
520
+ obj.__wbg_ptr = ptr;
521
+ CannotParseEd25519SigningKeyFinalization.register(obj, obj.__wbg_ptr, obj);
522
+ return obj;
523
+ }
524
+
525
+ __destroy_into_raw() {
526
+ const ptr = this.__wbg_ptr;
527
+ this.__wbg_ptr = 0;
528
+ CannotParseEd25519SigningKeyFinalization.unregister(this);
529
+ return ptr;
530
+ }
531
+
532
+ free() {
533
+ const ptr = this.__destroy_into_raw();
534
+ wasm.__wbg_cannotparseed25519signingkey_free(ptr, 0);
535
+ }
536
+ }
537
+ module.exports.CannotParseEd25519SigningKey = CannotParseEd25519SigningKey;
538
+
539
+ const CannotParseIdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
540
+ ? { register: () => {}, unregister: () => {} }
541
+ : new FinalizationRegistry(ptr => wasm.__wbg_cannotparseidentifier_free(ptr >>> 0, 1));
542
+
543
+ class CannotParseIdentifier {
544
+
545
+ static __wrap(ptr) {
546
+ ptr = ptr >>> 0;
547
+ const obj = Object.create(CannotParseIdentifier.prototype);
548
+ obj.__wbg_ptr = ptr;
549
+ CannotParseIdentifierFinalization.register(obj, obj.__wbg_ptr, obj);
550
+ return obj;
551
+ }
552
+
553
+ __destroy_into_raw() {
554
+ const ptr = this.__wbg_ptr;
555
+ this.__wbg_ptr = 0;
556
+ CannotParseIdentifierFinalization.unregister(this);
557
+ return ptr;
558
+ }
559
+
560
+ free() {
561
+ const ptr = this.__destroy_into_raw();
562
+ wasm.__wbg_cannotparseidentifier_free(ptr, 0);
563
+ }
564
+ }
565
+ module.exports.CannotParseIdentifier = CannotParseIdentifier;
566
+
567
+ const CapabilityFinalization = (typeof FinalizationRegistry === 'undefined')
568
+ ? { register: () => {}, unregister: () => {} }
569
+ : new FinalizationRegistry(ptr => wasm.__wbg_capability_free(ptr >>> 0, 1));
570
+
571
+ class Capability {
572
+
573
+ static __wrap(ptr) {
574
+ ptr = ptr >>> 0;
575
+ const obj = Object.create(Capability.prototype);
576
+ obj.__wbg_ptr = ptr;
577
+ CapabilityFinalization.register(obj, obj.__wbg_ptr, obj);
578
+ return obj;
579
+ }
580
+
581
+ __destroy_into_raw() {
582
+ const ptr = this.__wbg_ptr;
583
+ this.__wbg_ptr = 0;
584
+ CapabilityFinalization.unregister(this);
585
+ return ptr;
586
+ }
587
+
588
+ free() {
589
+ const ptr = this.__destroy_into_raw();
590
+ wasm.__wbg_capability_free(ptr, 0);
591
+ }
592
+ /**
593
+ * @returns {Agent}
594
+ */
595
+ get who() {
596
+ const ret = wasm.capability_who(this.__wbg_ptr);
597
+ return Agent.__wrap(ret);
598
+ }
599
+ /**
600
+ * @returns {Access}
601
+ */
602
+ get can() {
603
+ const ret = wasm.capability_can(this.__wbg_ptr);
604
+ return Access.__wrap(ret);
605
+ }
606
+ /**
607
+ * @returns {SignedDelegation}
608
+ */
609
+ get proof() {
610
+ const ret = wasm.capability_proof(this.__wbg_ptr);
611
+ return SignedDelegation.__wrap(ret);
612
+ }
613
+ }
614
+ module.exports.Capability = Capability;
615
+
616
+ const CgkaOperationFinalization = (typeof FinalizationRegistry === 'undefined')
617
+ ? { register: () => {}, unregister: () => {} }
618
+ : new FinalizationRegistry(ptr => wasm.__wbg_cgkaoperation_free(ptr >>> 0, 1));
619
+
620
+ class CgkaOperation {
621
+
622
+ static __wrap(ptr) {
623
+ ptr = ptr >>> 0;
624
+ const obj = Object.create(CgkaOperation.prototype);
625
+ obj.__wbg_ptr = ptr;
626
+ CgkaOperationFinalization.register(obj, obj.__wbg_ptr, obj);
627
+ return obj;
628
+ }
629
+
630
+ __destroy_into_raw() {
631
+ const ptr = this.__wbg_ptr;
632
+ this.__wbg_ptr = 0;
633
+ CgkaOperationFinalization.unregister(this);
634
+ return ptr;
635
+ }
636
+
637
+ free() {
638
+ const ptr = this.__destroy_into_raw();
639
+ wasm.__wbg_cgkaoperation_free(ptr, 0);
640
+ }
641
+ /**
642
+ * @returns {string}
643
+ */
644
+ get variant() {
645
+ let deferred1_0;
646
+ let deferred1_1;
647
+ try {
648
+ const ret = wasm.cgkaoperation_variant(this.__wbg_ptr);
649
+ deferred1_0 = ret[0];
650
+ deferred1_1 = ret[1];
651
+ return getStringFromWasm0(ret[0], ret[1]);
652
+ } finally {
653
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
654
+ }
655
+ }
656
+ }
657
+ module.exports.CgkaOperation = CgkaOperation;
658
+
659
+ const ChangeRefFinalization = (typeof FinalizationRegistry === 'undefined')
660
+ ? { register: () => {}, unregister: () => {} }
661
+ : new FinalizationRegistry(ptr => wasm.__wbg_changeref_free(ptr >>> 0, 1));
662
+
663
+ class ChangeRef {
664
+
665
+ static __wrap(ptr) {
666
+ ptr = ptr >>> 0;
667
+ const obj = Object.create(ChangeRef.prototype);
668
+ obj.__wbg_ptr = ptr;
669
+ ChangeRefFinalization.register(obj, obj.__wbg_ptr, obj);
670
+ return obj;
671
+ }
672
+
673
+ static __unwrap(jsValue) {
674
+ if (!(jsValue instanceof ChangeRef)) {
675
+ return 0;
676
+ }
677
+ return jsValue.__destroy_into_raw();
678
+ }
679
+
680
+ __destroy_into_raw() {
681
+ const ptr = this.__wbg_ptr;
682
+ this.__wbg_ptr = 0;
683
+ ChangeRefFinalization.unregister(this);
684
+ return ptr;
685
+ }
686
+
687
+ free() {
688
+ const ptr = this.__destroy_into_raw();
689
+ wasm.__wbg_changeref_free(ptr, 0);
690
+ }
691
+ /**
692
+ * @param {Uint8Array} bytes
693
+ */
694
+ constructor(bytes) {
695
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
696
+ const len0 = WASM_VECTOR_LEN;
697
+ const ret = wasm.changeref_new(ptr0, len0);
698
+ this.__wbg_ptr = ret >>> 0;
699
+ ChangeRefFinalization.register(this, this.__wbg_ptr, this);
700
+ return this;
701
+ }
702
+ /**
703
+ * @returns {Uint8Array}
704
+ */
705
+ get bytes() {
706
+ const ret = wasm.changeref_bytes(this.__wbg_ptr);
707
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
708
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
709
+ return v1;
710
+ }
711
+ }
712
+ module.exports.ChangeRef = ChangeRef;
713
+
714
+ const CiphertextStoreFinalization = (typeof FinalizationRegistry === 'undefined')
715
+ ? { register: () => {}, unregister: () => {} }
716
+ : new FinalizationRegistry(ptr => wasm.__wbg_ciphertextstore_free(ptr >>> 0, 1));
717
+
718
+ class CiphertextStore {
719
+
720
+ static __wrap(ptr) {
721
+ ptr = ptr >>> 0;
722
+ const obj = Object.create(CiphertextStore.prototype);
723
+ obj.__wbg_ptr = ptr;
724
+ CiphertextStoreFinalization.register(obj, obj.__wbg_ptr, obj);
725
+ return obj;
726
+ }
727
+
728
+ __destroy_into_raw() {
729
+ const ptr = this.__wbg_ptr;
730
+ this.__wbg_ptr = 0;
731
+ CiphertextStoreFinalization.unregister(this);
732
+ return ptr;
733
+ }
734
+
735
+ free() {
736
+ const ptr = this.__destroy_into_raw();
737
+ wasm.__wbg_ciphertextstore_free(ptr, 0);
738
+ }
739
+ /**
740
+ * @returns {CiphertextStore}
741
+ */
742
+ static newInMemory() {
743
+ const ret = wasm.ciphertextstore_newInMemory();
744
+ return CiphertextStore.__wrap(ret);
745
+ }
746
+ /**
747
+ * @param {Storage} storage
748
+ * @returns {CiphertextStore}
749
+ */
750
+ static newFromWebStorage(storage) {
751
+ const ret = wasm.ciphertextstore_newFromWebStorage(storage);
752
+ return CiphertextStore.__wrap(ret);
753
+ }
754
+ }
755
+ module.exports.CiphertextStore = CiphertextStore;
756
+
757
+ const ContactCardFinalization = (typeof FinalizationRegistry === 'undefined')
758
+ ? { register: () => {}, unregister: () => {} }
759
+ : new FinalizationRegistry(ptr => wasm.__wbg_contactcard_free(ptr >>> 0, 1));
760
+
761
+ class ContactCard {
762
+
763
+ static __wrap(ptr) {
764
+ ptr = ptr >>> 0;
765
+ const obj = Object.create(ContactCard.prototype);
766
+ obj.__wbg_ptr = ptr;
767
+ ContactCardFinalization.register(obj, obj.__wbg_ptr, obj);
768
+ return obj;
769
+ }
770
+
771
+ __destroy_into_raw() {
772
+ const ptr = this.__wbg_ptr;
773
+ this.__wbg_ptr = 0;
774
+ ContactCardFinalization.unregister(this);
775
+ return ptr;
776
+ }
777
+
778
+ free() {
779
+ const ptr = this.__destroy_into_raw();
780
+ wasm.__wbg_contactcard_free(ptr, 0);
781
+ }
782
+ /**
783
+ * @returns {IndividualId}
784
+ */
785
+ get id() {
786
+ const ret = wasm.contactcard_id(this.__wbg_ptr);
787
+ return IndividualId.__wrap(ret);
788
+ }
789
+ /**
790
+ * @returns {ShareKey}
791
+ */
792
+ get shareKey() {
793
+ const ret = wasm.contactcard_shareKey(this.__wbg_ptr);
794
+ return ShareKey.__wrap(ret);
795
+ }
796
+ /**
797
+ * @returns {Uint8Array}
798
+ */
799
+ signature() {
800
+ const ret = wasm.contactcard_signature(this.__wbg_ptr);
801
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
802
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
803
+ return v1;
804
+ }
805
+ /**
806
+ * @param {string} json
807
+ * @returns {ContactCard}
808
+ */
809
+ static fromJson(json) {
810
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
811
+ const len0 = WASM_VECTOR_LEN;
812
+ const ret = wasm.contactcard_fromJson(ptr0, len0);
813
+ if (ret[2]) {
814
+ throw takeFromExternrefTable0(ret[1]);
815
+ }
816
+ return ContactCard.__wrap(ret[0]);
817
+ }
818
+ /**
819
+ * @returns {string}
820
+ */
821
+ toJson() {
822
+ let deferred2_0;
823
+ let deferred2_1;
824
+ try {
825
+ const ret = wasm.contactcard_toJson(this.__wbg_ptr);
826
+ var ptr1 = ret[0];
827
+ var len1 = ret[1];
828
+ if (ret[3]) {
829
+ ptr1 = 0; len1 = 0;
830
+ throw takeFromExternrefTable0(ret[2]);
831
+ }
832
+ deferred2_0 = ptr1;
833
+ deferred2_1 = len1;
834
+ return getStringFromWasm0(ptr1, len1);
835
+ } finally {
836
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
837
+ }
838
+ }
839
+ }
840
+ module.exports.ContactCard = ContactCard;
841
+
842
+ const DelegationFinalization = (typeof FinalizationRegistry === 'undefined')
843
+ ? { register: () => {}, unregister: () => {} }
844
+ : new FinalizationRegistry(ptr => wasm.__wbg_delegation_free(ptr >>> 0, 1));
845
+
846
+ class Delegation {
847
+
848
+ static __wrap(ptr) {
849
+ ptr = ptr >>> 0;
850
+ const obj = Object.create(Delegation.prototype);
851
+ obj.__wbg_ptr = ptr;
852
+ DelegationFinalization.register(obj, obj.__wbg_ptr, obj);
853
+ return obj;
854
+ }
855
+
856
+ __destroy_into_raw() {
857
+ const ptr = this.__wbg_ptr;
858
+ this.__wbg_ptr = 0;
859
+ DelegationFinalization.unregister(this);
860
+ return ptr;
861
+ }
862
+
863
+ free() {
864
+ const ptr = this.__destroy_into_raw();
865
+ wasm.__wbg_delegation_free(ptr, 0);
866
+ }
867
+ /**
868
+ * @returns {Agent}
869
+ */
870
+ get delegate() {
871
+ const ret = wasm.delegation_delegate(this.__wbg_ptr);
872
+ return Agent.__wrap(ret);
873
+ }
874
+ /**
875
+ * @returns {Access}
876
+ */
877
+ get can() {
878
+ const ret = wasm.delegation_can(this.__wbg_ptr);
879
+ return Access.__wrap(ret);
880
+ }
881
+ /**
882
+ * @returns {SignedDelegation | undefined}
883
+ */
884
+ get proof() {
885
+ const ret = wasm.delegation_proof(this.__wbg_ptr);
886
+ return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
887
+ }
888
+ /**
889
+ * @returns {History}
890
+ */
891
+ get after() {
892
+ const ret = wasm.delegation_after(this.__wbg_ptr);
893
+ return History.__wrap(ret);
894
+ }
895
+ }
896
+ module.exports.Delegation = Delegation;
897
+
898
+ const DelegationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
899
+ ? { register: () => {}, unregister: () => {} }
900
+ : new FinalizationRegistry(ptr => wasm.__wbg_delegationerror_free(ptr >>> 0, 1));
901
+
902
+ class DelegationError {
903
+
904
+ __destroy_into_raw() {
905
+ const ptr = this.__wbg_ptr;
906
+ this.__wbg_ptr = 0;
907
+ DelegationErrorFinalization.unregister(this);
908
+ return ptr;
909
+ }
910
+
911
+ free() {
912
+ const ptr = this.__destroy_into_raw();
913
+ wasm.__wbg_delegationerror_free(ptr, 0);
914
+ }
915
+ }
916
+ module.exports.DelegationError = DelegationError;
917
+
918
+ const DocContentRefsFinalization = (typeof FinalizationRegistry === 'undefined')
919
+ ? { register: () => {}, unregister: () => {} }
920
+ : new FinalizationRegistry(ptr => wasm.__wbg_doccontentrefs_free(ptr >>> 0, 1));
921
+
922
+ class DocContentRefs {
923
+
924
+ static __wrap(ptr) {
925
+ ptr = ptr >>> 0;
926
+ const obj = Object.create(DocContentRefs.prototype);
927
+ obj.__wbg_ptr = ptr;
928
+ DocContentRefsFinalization.register(obj, obj.__wbg_ptr, obj);
929
+ return obj;
930
+ }
931
+
932
+ __destroy_into_raw() {
933
+ const ptr = this.__wbg_ptr;
934
+ this.__wbg_ptr = 0;
935
+ DocContentRefsFinalization.unregister(this);
936
+ return ptr;
937
+ }
938
+
939
+ free() {
940
+ const ptr = this.__destroy_into_raw();
941
+ wasm.__wbg_doccontentrefs_free(ptr, 0);
942
+ }
943
+ /**
944
+ * @param {DocumentId} doc_id
945
+ * @param {ChangeRef[]} change_hashes
946
+ */
947
+ constructor(doc_id, change_hashes) {
948
+ _assertClass(doc_id, DocumentId);
949
+ var ptr0 = doc_id.__destroy_into_raw();
950
+ const ptr1 = passArrayJsValueToWasm0(change_hashes, wasm.__wbindgen_malloc);
951
+ const len1 = WASM_VECTOR_LEN;
952
+ const ret = wasm.doccontentrefs_new(ptr0, ptr1, len1);
953
+ if (ret[2]) {
954
+ throw takeFromExternrefTable0(ret[1]);
955
+ }
956
+ this.__wbg_ptr = ret[0] >>> 0;
957
+ DocContentRefsFinalization.register(this, this.__wbg_ptr, this);
958
+ return this;
959
+ }
960
+ /**
961
+ * @param {ChangeRef} hash
962
+ */
963
+ addChangeRef(hash) {
964
+ _assertClass(hash, ChangeRef);
965
+ var ptr0 = hash.__destroy_into_raw();
966
+ wasm.doccontentrefs_addChangeRef(this.__wbg_ptr, ptr0);
967
+ }
968
+ /**
969
+ * @returns {DocumentId}
970
+ */
971
+ get docId() {
972
+ const ret = wasm.doccontentrefs_docId(this.__wbg_ptr);
973
+ return DocumentId.__wrap(ret);
974
+ }
975
+ /**
976
+ * @returns {ChangeRef[]}
977
+ */
978
+ get change_hashes() {
979
+ const ret = wasm.doccontentrefs_change_hashes(this.__wbg_ptr);
980
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
981
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
982
+ return v1;
983
+ }
984
+ }
985
+ module.exports.DocContentRefs = DocContentRefs;
986
+
987
+ const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
988
+ ? { register: () => {}, unregister: () => {} }
989
+ : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr >>> 0, 1));
990
+
991
+ class Document {
992
+
993
+ static __wrap(ptr) {
994
+ ptr = ptr >>> 0;
995
+ const obj = Object.create(Document.prototype);
996
+ obj.__wbg_ptr = ptr;
997
+ DocumentFinalization.register(obj, obj.__wbg_ptr, obj);
998
+ return obj;
999
+ }
1000
+
1001
+ static __unwrap(jsValue) {
1002
+ if (!(jsValue instanceof Document)) {
1003
+ return 0;
1004
+ }
1005
+ return jsValue.__destroy_into_raw();
1006
+ }
1007
+
1008
+ __destroy_into_raw() {
1009
+ const ptr = this.__wbg_ptr;
1010
+ this.__wbg_ptr = 0;
1011
+ DocumentFinalization.unregister(this);
1012
+ return ptr;
1013
+ }
1014
+
1015
+ free() {
1016
+ const ptr = this.__destroy_into_raw();
1017
+ wasm.__wbg_document_free(ptr, 0);
1018
+ }
1019
+ /**
1020
+ * @returns {Identifier}
1021
+ */
1022
+ get id() {
1023
+ const ret = wasm.document_id(this.__wbg_ptr);
1024
+ return Identifier.__wrap(ret);
1025
+ }
1026
+ /**
1027
+ * @returns {DocumentId}
1028
+ */
1029
+ get doc_id() {
1030
+ const ret = wasm.document_doc_id(this.__wbg_ptr);
1031
+ return DocumentId.__wrap(ret);
1032
+ }
1033
+ /**
1034
+ * @returns {Peer}
1035
+ */
1036
+ toPeer() {
1037
+ const ret = wasm.document_toPeer(this.__wbg_ptr);
1038
+ return Peer.__wrap(ret);
1039
+ }
1040
+ /**
1041
+ * @returns {Agent}
1042
+ */
1043
+ toAgent() {
1044
+ const ret = wasm.document_toAgent(this.__wbg_ptr);
1045
+ return Agent.__wrap(ret);
1046
+ }
1047
+ }
1048
+ module.exports.Document = Document;
1049
+
1050
+ const DocumentIdFinalization = (typeof FinalizationRegistry === 'undefined')
1051
+ ? { register: () => {}, unregister: () => {} }
1052
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentid_free(ptr >>> 0, 1));
1053
+
1054
+ class DocumentId {
1055
+
1056
+ static __wrap(ptr) {
1057
+ ptr = ptr >>> 0;
1058
+ const obj = Object.create(DocumentId.prototype);
1059
+ obj.__wbg_ptr = ptr;
1060
+ DocumentIdFinalization.register(obj, obj.__wbg_ptr, obj);
1061
+ return obj;
1062
+ }
1063
+
1064
+ __destroy_into_raw() {
1065
+ const ptr = this.__wbg_ptr;
1066
+ this.__wbg_ptr = 0;
1067
+ DocumentIdFinalization.unregister(this);
1068
+ return ptr;
1069
+ }
1070
+
1071
+ free() {
1072
+ const ptr = this.__destroy_into_raw();
1073
+ wasm.__wbg_documentid_free(ptr, 0);
1074
+ }
1075
+ /**
1076
+ * @param {Uint8Array} bytes
1077
+ */
1078
+ constructor(bytes) {
1079
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1080
+ const len0 = WASM_VECTOR_LEN;
1081
+ const ret = wasm.documentid_new(ptr0, len0);
1082
+ if (ret[2]) {
1083
+ throw takeFromExternrefTable0(ret[1]);
1084
+ }
1085
+ this.__wbg_ptr = ret[0] >>> 0;
1086
+ DocumentIdFinalization.register(this, this.__wbg_ptr, this);
1087
+ return this;
1088
+ }
1089
+ /**
1090
+ * @returns {string}
1091
+ */
1092
+ fromString() {
1093
+ let deferred1_0;
1094
+ let deferred1_1;
1095
+ try {
1096
+ const ret = wasm.documentid_fromString(this.__wbg_ptr);
1097
+ deferred1_0 = ret[0];
1098
+ deferred1_1 = ret[1];
1099
+ return getStringFromWasm0(ret[0], ret[1]);
1100
+ } finally {
1101
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1102
+ }
1103
+ }
1104
+ /**
1105
+ * @returns {any}
1106
+ */
1107
+ toJsValue() {
1108
+ const ret = wasm.documentid_toJsValue(this.__wbg_ptr);
1109
+ return ret;
1110
+ }
1111
+ /**
1112
+ * @returns {Uint8Array}
1113
+ */
1114
+ toBytes() {
1115
+ const ret = wasm.documentid_toBytes(this.__wbg_ptr);
1116
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1117
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1118
+ return v1;
1119
+ }
1120
+ }
1121
+ module.exports.DocumentId = DocumentId;
1122
+
1123
+ const EncryptedFinalization = (typeof FinalizationRegistry === 'undefined')
1124
+ ? { register: () => {}, unregister: () => {} }
1125
+ : new FinalizationRegistry(ptr => wasm.__wbg_encrypted_free(ptr >>> 0, 1));
1126
+
1127
+ class Encrypted {
1128
+
1129
+ static __wrap(ptr) {
1130
+ ptr = ptr >>> 0;
1131
+ const obj = Object.create(Encrypted.prototype);
1132
+ obj.__wbg_ptr = ptr;
1133
+ EncryptedFinalization.register(obj, obj.__wbg_ptr, obj);
1134
+ return obj;
1135
+ }
1136
+
1137
+ __destroy_into_raw() {
1138
+ const ptr = this.__wbg_ptr;
1139
+ this.__wbg_ptr = 0;
1140
+ EncryptedFinalization.unregister(this);
1141
+ return ptr;
1142
+ }
1143
+
1144
+ free() {
1145
+ const ptr = this.__destroy_into_raw();
1146
+ wasm.__wbg_encrypted_free(ptr, 0);
1147
+ }
1148
+ /**
1149
+ * @returns {Uint8Array}
1150
+ */
1151
+ toBytes() {
1152
+ const ret = wasm.encrypted_toBytes(this.__wbg_ptr);
1153
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1154
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1155
+ return v1;
1156
+ }
1157
+ /**
1158
+ * @returns {Uint8Array}
1159
+ */
1160
+ get ciphertext() {
1161
+ const ret = wasm.encrypted_ciphertext(this.__wbg_ptr);
1162
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1163
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1164
+ return v1;
1165
+ }
1166
+ /**
1167
+ * @returns {Uint8Array}
1168
+ */
1169
+ get nonce() {
1170
+ const ret = wasm.encrypted_nonce(this.__wbg_ptr);
1171
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1172
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1173
+ return v1;
1174
+ }
1175
+ /**
1176
+ * @returns {Uint8Array}
1177
+ */
1178
+ get pcs_key_hash() {
1179
+ const ret = wasm.encrypted_pcs_key_hash(this.__wbg_ptr);
1180
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1181
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1182
+ return v1;
1183
+ }
1184
+ /**
1185
+ * @returns {Uint8Array}
1186
+ */
1187
+ get content_ref() {
1188
+ const ret = wasm.encrypted_content_ref(this.__wbg_ptr);
1189
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1190
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1191
+ return v1;
1192
+ }
1193
+ /**
1194
+ * @returns {Uint8Array}
1195
+ */
1196
+ get pred_refs() {
1197
+ const ret = wasm.encrypted_pred_refs(this.__wbg_ptr);
1198
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1199
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1200
+ return v1;
1201
+ }
1202
+ }
1203
+ module.exports.Encrypted = Encrypted;
1204
+
1205
+ const EncryptedContentWithUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
1206
+ ? { register: () => {}, unregister: () => {} }
1207
+ : new FinalizationRegistry(ptr => wasm.__wbg_encryptedcontentwithupdate_free(ptr >>> 0, 1));
1208
+
1209
+ class EncryptedContentWithUpdate {
1210
+
1211
+ static __wrap(ptr) {
1212
+ ptr = ptr >>> 0;
1213
+ const obj = Object.create(EncryptedContentWithUpdate.prototype);
1214
+ obj.__wbg_ptr = ptr;
1215
+ EncryptedContentWithUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
1216
+ return obj;
1217
+ }
1218
+
1219
+ __destroy_into_raw() {
1220
+ const ptr = this.__wbg_ptr;
1221
+ this.__wbg_ptr = 0;
1222
+ EncryptedContentWithUpdateFinalization.unregister(this);
1223
+ return ptr;
1224
+ }
1225
+
1226
+ free() {
1227
+ const ptr = this.__destroy_into_raw();
1228
+ wasm.__wbg_encryptedcontentwithupdate_free(ptr, 0);
1229
+ }
1230
+ /**
1231
+ * @returns {Encrypted}
1232
+ */
1233
+ encrypted_content() {
1234
+ const ret = wasm.encryptedcontentwithupdate_encrypted_content(this.__wbg_ptr);
1235
+ return Encrypted.__wrap(ret);
1236
+ }
1237
+ /**
1238
+ * @returns {SignedCgkaOperation | undefined}
1239
+ */
1240
+ update_op() {
1241
+ const ret = wasm.encryptedcontentwithupdate_update_op(this.__wbg_ptr);
1242
+ return ret === 0 ? undefined : SignedCgkaOperation.__wrap(ret);
1243
+ }
1244
+ }
1245
+ module.exports.EncryptedContentWithUpdate = EncryptedContentWithUpdate;
1246
+
1247
+ const EventFinalization = (typeof FinalizationRegistry === 'undefined')
1248
+ ? { register: () => {}, unregister: () => {} }
1249
+ : new FinalizationRegistry(ptr => wasm.__wbg_event_free(ptr >>> 0, 1));
1250
+
1251
+ class Event {
1252
+
1253
+ static __wrap(ptr) {
1254
+ ptr = ptr >>> 0;
1255
+ const obj = Object.create(Event.prototype);
1256
+ obj.__wbg_ptr = ptr;
1257
+ EventFinalization.register(obj, obj.__wbg_ptr, obj);
1258
+ return obj;
1259
+ }
1260
+
1261
+ __destroy_into_raw() {
1262
+ const ptr = this.__wbg_ptr;
1263
+ this.__wbg_ptr = 0;
1264
+ EventFinalization.unregister(this);
1265
+ return ptr;
1266
+ }
1267
+
1268
+ free() {
1269
+ const ptr = this.__destroy_into_raw();
1270
+ wasm.__wbg_event_free(ptr, 0);
1271
+ }
1272
+ /**
1273
+ * @returns {string}
1274
+ */
1275
+ get variant() {
1276
+ let deferred1_0;
1277
+ let deferred1_1;
1278
+ try {
1279
+ const ret = wasm.event_variant(this.__wbg_ptr);
1280
+ deferred1_0 = ret[0];
1281
+ deferred1_1 = ret[1];
1282
+ return getStringFromWasm0(ret[0], ret[1]);
1283
+ } finally {
1284
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1285
+ }
1286
+ }
1287
+ /**
1288
+ * @returns {boolean}
1289
+ */
1290
+ get isDelegated() {
1291
+ const ret = wasm.event_isDelegated(this.__wbg_ptr);
1292
+ return ret !== 0;
1293
+ }
1294
+ /**
1295
+ * @returns {boolean}
1296
+ */
1297
+ get isRevoked() {
1298
+ const ret = wasm.event_isRevoked(this.__wbg_ptr);
1299
+ return ret !== 0;
1300
+ }
1301
+ /**
1302
+ * @returns {SignedDelegation | undefined}
1303
+ */
1304
+ tryIntoSignedDelegation() {
1305
+ const ret = wasm.event_tryIntoSignedDelegation(this.__wbg_ptr);
1306
+ return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
1307
+ }
1308
+ /**
1309
+ * @returns {SignedRevocation | undefined}
1310
+ */
1311
+ tryIntoSignedRevocation() {
1312
+ const ret = wasm.event_tryIntoSignedRevocation(this.__wbg_ptr);
1313
+ return ret === 0 ? undefined : SignedRevocation.__wrap(ret);
1314
+ }
1315
+ }
1316
+ module.exports.Event = Event;
1317
+
1318
+ const GenerateDocErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1319
+ ? { register: () => {}, unregister: () => {} }
1320
+ : new FinalizationRegistry(ptr => wasm.__wbg_generatedocerror_free(ptr >>> 0, 1));
1321
+
1322
+ class GenerateDocError {
1323
+
1324
+ static __wrap(ptr) {
1325
+ ptr = ptr >>> 0;
1326
+ const obj = Object.create(GenerateDocError.prototype);
1327
+ obj.__wbg_ptr = ptr;
1328
+ GenerateDocErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1329
+ return obj;
1330
+ }
1331
+
1332
+ __destroy_into_raw() {
1333
+ const ptr = this.__wbg_ptr;
1334
+ this.__wbg_ptr = 0;
1335
+ GenerateDocErrorFinalization.unregister(this);
1336
+ return ptr;
1337
+ }
1338
+
1339
+ free() {
1340
+ const ptr = this.__destroy_into_raw();
1341
+ wasm.__wbg_generatedocerror_free(ptr, 0);
1342
+ }
1343
+ /**
1344
+ * @returns {string}
1345
+ */
1346
+ message() {
1347
+ let deferred1_0;
1348
+ let deferred1_1;
1349
+ try {
1350
+ const ret = wasm.generatedocerror_message(this.__wbg_ptr);
1351
+ deferred1_0 = ret[0];
1352
+ deferred1_1 = ret[1];
1353
+ return getStringFromWasm0(ret[0], ret[1]);
1354
+ } finally {
1355
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1356
+ }
1357
+ }
1358
+ }
1359
+ module.exports.GenerateDocError = GenerateDocError;
1360
+
1361
+ const GenerateWebCryptoErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1362
+ ? { register: () => {}, unregister: () => {} }
1363
+ : new FinalizationRegistry(ptr => wasm.__wbg_generatewebcryptoerror_free(ptr >>> 0, 1));
1364
+
1365
+ class GenerateWebCryptoError {
1366
+
1367
+ static __wrap(ptr) {
1368
+ ptr = ptr >>> 0;
1369
+ const obj = Object.create(GenerateWebCryptoError.prototype);
1370
+ obj.__wbg_ptr = ptr;
1371
+ GenerateWebCryptoErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1372
+ return obj;
1373
+ }
1374
+
1375
+ __destroy_into_raw() {
1376
+ const ptr = this.__wbg_ptr;
1377
+ this.__wbg_ptr = 0;
1378
+ GenerateWebCryptoErrorFinalization.unregister(this);
1379
+ return ptr;
1380
+ }
1381
+
1382
+ free() {
1383
+ const ptr = this.__destroy_into_raw();
1384
+ wasm.__wbg_generatewebcryptoerror_free(ptr, 0);
1385
+ }
1386
+ /**
1387
+ * @returns {string}
1388
+ */
1389
+ message() {
1390
+ let deferred1_0;
1391
+ let deferred1_1;
1392
+ try {
1393
+ const ret = wasm.generatewebcryptoerror_message(this.__wbg_ptr);
1394
+ deferred1_0 = ret[0];
1395
+ deferred1_1 = ret[1];
1396
+ return getStringFromWasm0(ret[0], ret[1]);
1397
+ } finally {
1398
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1399
+ }
1400
+ }
1401
+ }
1402
+ module.exports.GenerateWebCryptoError = GenerateWebCryptoError;
1403
+
1404
+ const GetCiphertextErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1405
+ ? { register: () => {}, unregister: () => {} }
1406
+ : new FinalizationRegistry(ptr => wasm.__wbg_getciphertexterror_free(ptr >>> 0, 1));
1407
+
1408
+ class GetCiphertextError {
1409
+
1410
+ __destroy_into_raw() {
1411
+ const ptr = this.__wbg_ptr;
1412
+ this.__wbg_ptr = 0;
1413
+ GetCiphertextErrorFinalization.unregister(this);
1414
+ return ptr;
1415
+ }
1416
+
1417
+ free() {
1418
+ const ptr = this.__destroy_into_raw();
1419
+ wasm.__wbg_getciphertexterror_free(ptr, 0);
1420
+ }
1421
+ /**
1422
+ * @returns {string}
1423
+ */
1424
+ get message() {
1425
+ let deferred1_0;
1426
+ let deferred1_1;
1427
+ try {
1428
+ const ret = wasm.getciphertexterror_message(this.__wbg_ptr);
1429
+ deferred1_0 = ret[0];
1430
+ deferred1_1 = ret[1];
1431
+ return getStringFromWasm0(ret[0], ret[1]);
1432
+ } finally {
1433
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1434
+ }
1435
+ }
1436
+ }
1437
+ module.exports.GetCiphertextError = GetCiphertextError;
1438
+
1439
+ const GroupFinalization = (typeof FinalizationRegistry === 'undefined')
1440
+ ? { register: () => {}, unregister: () => {} }
1441
+ : new FinalizationRegistry(ptr => wasm.__wbg_group_free(ptr >>> 0, 1));
1442
+
1443
+ class Group {
1444
+
1445
+ static __wrap(ptr) {
1446
+ ptr = ptr >>> 0;
1447
+ const obj = Object.create(Group.prototype);
1448
+ obj.__wbg_ptr = ptr;
1449
+ GroupFinalization.register(obj, obj.__wbg_ptr, obj);
1450
+ return obj;
1451
+ }
1452
+
1453
+ __destroy_into_raw() {
1454
+ const ptr = this.__wbg_ptr;
1455
+ this.__wbg_ptr = 0;
1456
+ GroupFinalization.unregister(this);
1457
+ return ptr;
1458
+ }
1459
+
1460
+ free() {
1461
+ const ptr = this.__destroy_into_raw();
1462
+ wasm.__wbg_group_free(ptr, 0);
1463
+ }
1464
+ /**
1465
+ * @returns {Identifier}
1466
+ */
1467
+ get id() {
1468
+ const ret = wasm.group_id(this.__wbg_ptr);
1469
+ return Identifier.__wrap(ret);
1470
+ }
1471
+ /**
1472
+ * @returns {GroupId}
1473
+ */
1474
+ get groupId() {
1475
+ const ret = wasm.group_groupId(this.__wbg_ptr);
1476
+ return GroupId.__wrap(ret);
1477
+ }
1478
+ /**
1479
+ * @returns {Capability[]}
1480
+ */
1481
+ get members() {
1482
+ const ret = wasm.group_members(this.__wbg_ptr);
1483
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1484
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1485
+ return v1;
1486
+ }
1487
+ /**
1488
+ * @returns {Peer}
1489
+ */
1490
+ toPeer() {
1491
+ const ret = wasm.group_toPeer(this.__wbg_ptr);
1492
+ return Peer.__wrap(ret);
1493
+ }
1494
+ /**
1495
+ * @returns {Agent}
1496
+ */
1497
+ toAgent() {
1498
+ const ret = wasm.group_toAgent(this.__wbg_ptr);
1499
+ return Agent.__wrap(ret);
1500
+ }
1501
+ /**
1502
+ * @returns {Membered}
1503
+ */
1504
+ toMembered() {
1505
+ const ret = wasm.group_toMembered(this.__wbg_ptr);
1506
+ return Membered.__wrap(ret);
1507
+ }
1508
+ }
1509
+ module.exports.Group = Group;
1510
+
1511
+ const GroupIdFinalization = (typeof FinalizationRegistry === 'undefined')
1512
+ ? { register: () => {}, unregister: () => {} }
1513
+ : new FinalizationRegistry(ptr => wasm.__wbg_groupid_free(ptr >>> 0, 1));
1514
+
1515
+ class GroupId {
1516
+
1517
+ static __wrap(ptr) {
1518
+ ptr = ptr >>> 0;
1519
+ const obj = Object.create(GroupId.prototype);
1520
+ obj.__wbg_ptr = ptr;
1521
+ GroupIdFinalization.register(obj, obj.__wbg_ptr, obj);
1522
+ return obj;
1523
+ }
1524
+
1525
+ __destroy_into_raw() {
1526
+ const ptr = this.__wbg_ptr;
1527
+ this.__wbg_ptr = 0;
1528
+ GroupIdFinalization.unregister(this);
1529
+ return ptr;
1530
+ }
1531
+
1532
+ free() {
1533
+ const ptr = this.__destroy_into_raw();
1534
+ wasm.__wbg_groupid_free(ptr, 0);
1535
+ }
1536
+ /**
1537
+ * @returns {string}
1538
+ */
1539
+ toString() {
1540
+ let deferred1_0;
1541
+ let deferred1_1;
1542
+ try {
1543
+ const ret = wasm.groupid_toString(this.__wbg_ptr);
1544
+ deferred1_0 = ret[0];
1545
+ deferred1_1 = ret[1];
1546
+ return getStringFromWasm0(ret[0], ret[1]);
1547
+ } finally {
1548
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1549
+ }
1550
+ }
1551
+ }
1552
+ module.exports.GroupId = GroupId;
1553
+
1554
+ const HistoryFinalization = (typeof FinalizationRegistry === 'undefined')
1555
+ ? { register: () => {}, unregister: () => {} }
1556
+ : new FinalizationRegistry(ptr => wasm.__wbg_history_free(ptr >>> 0, 1));
1557
+
1558
+ class History {
1559
+
1560
+ static __wrap(ptr) {
1561
+ ptr = ptr >>> 0;
1562
+ const obj = Object.create(History.prototype);
1563
+ obj.__wbg_ptr = ptr;
1564
+ HistoryFinalization.register(obj, obj.__wbg_ptr, obj);
1565
+ return obj;
1566
+ }
1567
+
1568
+ __destroy_into_raw() {
1569
+ const ptr = this.__wbg_ptr;
1570
+ this.__wbg_ptr = 0;
1571
+ HistoryFinalization.unregister(this);
1572
+ return ptr;
1573
+ }
1574
+
1575
+ free() {
1576
+ const ptr = this.__destroy_into_raw();
1577
+ wasm.__wbg_history_free(ptr, 0);
1578
+ }
1579
+ /**
1580
+ * @returns {SignedDelegation[]}
1581
+ */
1582
+ delegations() {
1583
+ const ret = wasm.history_delegations(this.__wbg_ptr);
1584
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1585
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1586
+ return v1;
1587
+ }
1588
+ /**
1589
+ * @returns {SignedRevocation[]}
1590
+ */
1591
+ revocations() {
1592
+ const ret = wasm.history_revocations(this.__wbg_ptr);
1593
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1594
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1595
+ return v1;
1596
+ }
1597
+ /**
1598
+ * @returns {DocContentRefs[]}
1599
+ */
1600
+ contentRefs() {
1601
+ const ret = wasm.history_contentRefs(this.__wbg_ptr);
1602
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1603
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1604
+ return v1;
1605
+ }
1606
+ }
1607
+ module.exports.History = History;
1608
+
1609
+ const IdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
1610
+ ? { register: () => {}, unregister: () => {} }
1611
+ : new FinalizationRegistry(ptr => wasm.__wbg_identifier_free(ptr >>> 0, 1));
1612
+
1613
+ class Identifier {
1614
+
1615
+ static __wrap(ptr) {
1616
+ ptr = ptr >>> 0;
1617
+ const obj = Object.create(Identifier.prototype);
1618
+ obj.__wbg_ptr = ptr;
1619
+ IdentifierFinalization.register(obj, obj.__wbg_ptr, obj);
1620
+ return obj;
1621
+ }
1622
+
1623
+ __destroy_into_raw() {
1624
+ const ptr = this.__wbg_ptr;
1625
+ this.__wbg_ptr = 0;
1626
+ IdentifierFinalization.unregister(this);
1627
+ return ptr;
1628
+ }
1629
+
1630
+ free() {
1631
+ const ptr = this.__destroy_into_raw();
1632
+ wasm.__wbg_identifier_free(ptr, 0);
1633
+ }
1634
+ /**
1635
+ * @param {Uint8Array} bytes
1636
+ */
1637
+ constructor(bytes) {
1638
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1639
+ const len0 = WASM_VECTOR_LEN;
1640
+ const ret = wasm.identifier_new(ptr0, len0);
1641
+ if (ret[2]) {
1642
+ throw takeFromExternrefTable0(ret[1]);
1643
+ }
1644
+ this.__wbg_ptr = ret[0] >>> 0;
1645
+ IdentifierFinalization.register(this, this.__wbg_ptr, this);
1646
+ return this;
1647
+ }
1648
+ /**
1649
+ * @returns {Uint8Array}
1650
+ */
1651
+ toBytes() {
1652
+ const ret = wasm.identifier_toBytes(this.__wbg_ptr);
1653
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1654
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1655
+ return v1;
1656
+ }
1657
+ }
1658
+ module.exports.Identifier = Identifier;
1659
+
1660
+ const IndividualFinalization = (typeof FinalizationRegistry === 'undefined')
1661
+ ? { register: () => {}, unregister: () => {} }
1662
+ : new FinalizationRegistry(ptr => wasm.__wbg_individual_free(ptr >>> 0, 1));
1663
+
1664
+ class Individual {
1665
+
1666
+ static __wrap(ptr) {
1667
+ ptr = ptr >>> 0;
1668
+ const obj = Object.create(Individual.prototype);
1669
+ obj.__wbg_ptr = ptr;
1670
+ IndividualFinalization.register(obj, obj.__wbg_ptr, obj);
1671
+ return obj;
1672
+ }
1673
+
1674
+ __destroy_into_raw() {
1675
+ const ptr = this.__wbg_ptr;
1676
+ this.__wbg_ptr = 0;
1677
+ IndividualFinalization.unregister(this);
1678
+ return ptr;
1679
+ }
1680
+
1681
+ free() {
1682
+ const ptr = this.__destroy_into_raw();
1683
+ wasm.__wbg_individual_free(ptr, 0);
1684
+ }
1685
+ /**
1686
+ * @returns {Peer}
1687
+ */
1688
+ toPeer() {
1689
+ const ret = wasm.individual_toPeer(this.__wbg_ptr);
1690
+ return Peer.__wrap(ret);
1691
+ }
1692
+ /**
1693
+ * @returns {Agent}
1694
+ */
1695
+ toAgent() {
1696
+ const ret = wasm.individual_toAgent(this.__wbg_ptr);
1697
+ return Agent.__wrap(ret);
1698
+ }
1699
+ /**
1700
+ * @returns {Identifier}
1701
+ */
1702
+ get id() {
1703
+ const ret = wasm.individual_id(this.__wbg_ptr);
1704
+ return Identifier.__wrap(ret);
1705
+ }
1706
+ /**
1707
+ * @returns {IndividualId}
1708
+ */
1709
+ get individualId() {
1710
+ const ret = wasm.individual_individualId(this.__wbg_ptr);
1711
+ return IndividualId.__wrap(ret);
1712
+ }
1713
+ /**
1714
+ * @param {DocumentId} doc_id
1715
+ * @returns {ShareKey}
1716
+ */
1717
+ pickPrekey(doc_id) {
1718
+ _assertClass(doc_id, DocumentId);
1719
+ var ptr0 = doc_id.__destroy_into_raw();
1720
+ const ret = wasm.individual_pickPrekey(this.__wbg_ptr, ptr0);
1721
+ return ShareKey.__wrap(ret);
1722
+ }
1723
+ }
1724
+ module.exports.Individual = Individual;
1725
+
1726
+ const IndividualIdFinalization = (typeof FinalizationRegistry === 'undefined')
1727
+ ? { register: () => {}, unregister: () => {} }
1728
+ : new FinalizationRegistry(ptr => wasm.__wbg_individualid_free(ptr >>> 0, 1));
1729
+
1730
+ class IndividualId {
1731
+
1732
+ static __wrap(ptr) {
1733
+ ptr = ptr >>> 0;
1734
+ const obj = Object.create(IndividualId.prototype);
1735
+ obj.__wbg_ptr = ptr;
1736
+ IndividualIdFinalization.register(obj, obj.__wbg_ptr, obj);
1737
+ return obj;
1738
+ }
1739
+
1740
+ __destroy_into_raw() {
1741
+ const ptr = this.__wbg_ptr;
1742
+ this.__wbg_ptr = 0;
1743
+ IndividualIdFinalization.unregister(this);
1744
+ return ptr;
1745
+ }
1746
+
1747
+ free() {
1748
+ const ptr = this.__destroy_into_raw();
1749
+ wasm.__wbg_individualid_free(ptr, 0);
1750
+ }
1751
+ /**
1752
+ * @returns {Uint8Array}
1753
+ */
1754
+ get bytes() {
1755
+ const ret = wasm.individualid_bytes(this.__wbg_ptr);
1756
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1757
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1758
+ return v1;
1759
+ }
1760
+ }
1761
+ module.exports.IndividualId = IndividualId;
1762
+
1763
+ const InvocationFinalization = (typeof FinalizationRegistry === 'undefined')
1764
+ ? { register: () => {}, unregister: () => {} }
1765
+ : new FinalizationRegistry(ptr => wasm.__wbg_invocation_free(ptr >>> 0, 1));
1766
+
1767
+ class Invocation {
1768
+
1769
+ __destroy_into_raw() {
1770
+ const ptr = this.__wbg_ptr;
1771
+ this.__wbg_ptr = 0;
1772
+ InvocationFinalization.unregister(this);
1773
+ return ptr;
1774
+ }
1775
+
1776
+ free() {
1777
+ const ptr = this.__destroy_into_raw();
1778
+ wasm.__wbg_invocation_free(ptr, 0);
1779
+ }
1780
+ }
1781
+ module.exports.Invocation = Invocation;
1782
+
1783
+ const JsDecryptErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1784
+ ? { register: () => {}, unregister: () => {} }
1785
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsdecrypterror_free(ptr >>> 0, 1));
1786
+
1787
+ class JsDecryptError {
1788
+
1789
+ static __wrap(ptr) {
1790
+ ptr = ptr >>> 0;
1791
+ const obj = Object.create(JsDecryptError.prototype);
1792
+ obj.__wbg_ptr = ptr;
1793
+ JsDecryptErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1794
+ return obj;
1795
+ }
1796
+
1797
+ __destroy_into_raw() {
1798
+ const ptr = this.__wbg_ptr;
1799
+ this.__wbg_ptr = 0;
1800
+ JsDecryptErrorFinalization.unregister(this);
1801
+ return ptr;
1802
+ }
1803
+
1804
+ free() {
1805
+ const ptr = this.__destroy_into_raw();
1806
+ wasm.__wbg_jsdecrypterror_free(ptr, 0);
1807
+ }
1808
+ }
1809
+ module.exports.JsDecryptError = JsDecryptError;
1810
+
1811
+ const JsEncryptErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1812
+ ? { register: () => {}, unregister: () => {} }
1813
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsencrypterror_free(ptr >>> 0, 1));
1814
+
1815
+ class JsEncryptError {
1816
+
1817
+ static __wrap(ptr) {
1818
+ ptr = ptr >>> 0;
1819
+ const obj = Object.create(JsEncryptError.prototype);
1820
+ obj.__wbg_ptr = ptr;
1821
+ JsEncryptErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1822
+ return obj;
1823
+ }
1824
+
1825
+ __destroy_into_raw() {
1826
+ const ptr = this.__wbg_ptr;
1827
+ this.__wbg_ptr = 0;
1828
+ JsEncryptErrorFinalization.unregister(this);
1829
+ return ptr;
1830
+ }
1831
+
1832
+ free() {
1833
+ const ptr = this.__destroy_into_raw();
1834
+ wasm.__wbg_jsencrypterror_free(ptr, 0);
1835
+ }
1836
+ }
1837
+ module.exports.JsEncryptError = JsEncryptError;
1838
+
1839
+ const JsReceivePreKeyOpErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1840
+ ? { register: () => {}, unregister: () => {} }
1841
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsreceiveprekeyoperror_free(ptr >>> 0, 1));
1842
+
1843
+ class JsReceivePreKeyOpError {
1844
+
1845
+ static __wrap(ptr) {
1846
+ ptr = ptr >>> 0;
1847
+ const obj = Object.create(JsReceivePreKeyOpError.prototype);
1848
+ obj.__wbg_ptr = ptr;
1849
+ JsReceivePreKeyOpErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1850
+ return obj;
1851
+ }
1852
+
1853
+ __destroy_into_raw() {
1854
+ const ptr = this.__wbg_ptr;
1855
+ this.__wbg_ptr = 0;
1856
+ JsReceivePreKeyOpErrorFinalization.unregister(this);
1857
+ return ptr;
1858
+ }
1859
+
1860
+ free() {
1861
+ const ptr = this.__destroy_into_raw();
1862
+ wasm.__wbg_jsreceiveprekeyoperror_free(ptr, 0);
1863
+ }
1864
+ }
1865
+ module.exports.JsReceivePreKeyOpError = JsReceivePreKeyOpError;
1866
+
1867
+ const JsReceiveStaticEventErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1868
+ ? { register: () => {}, unregister: () => {} }
1869
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsreceivestaticeventerror_free(ptr >>> 0, 1));
1870
+
1871
+ class JsReceiveStaticEventError {
1872
+
1873
+ __destroy_into_raw() {
1874
+ const ptr = this.__wbg_ptr;
1875
+ this.__wbg_ptr = 0;
1876
+ JsReceiveStaticEventErrorFinalization.unregister(this);
1877
+ return ptr;
1878
+ }
1879
+
1880
+ free() {
1881
+ const ptr = this.__destroy_into_raw();
1882
+ wasm.__wbg_jsreceivestaticeventerror_free(ptr, 0);
1883
+ }
1884
+ }
1885
+ module.exports.JsReceiveStaticEventError = JsReceiveStaticEventError;
1886
+
1887
+ const KeyhiveFinalization = (typeof FinalizationRegistry === 'undefined')
1888
+ ? { register: () => {}, unregister: () => {} }
1889
+ : new FinalizationRegistry(ptr => wasm.__wbg_keyhive_free(ptr >>> 0, 1));
1890
+
1891
+ class Keyhive {
1892
+
1893
+ static __wrap(ptr) {
1894
+ ptr = ptr >>> 0;
1895
+ const obj = Object.create(Keyhive.prototype);
1896
+ obj.__wbg_ptr = ptr;
1897
+ KeyhiveFinalization.register(obj, obj.__wbg_ptr, obj);
1898
+ return obj;
1899
+ }
1900
+
1901
+ __destroy_into_raw() {
1902
+ const ptr = this.__wbg_ptr;
1903
+ this.__wbg_ptr = 0;
1904
+ KeyhiveFinalization.unregister(this);
1905
+ return ptr;
1906
+ }
1907
+
1908
+ free() {
1909
+ const ptr = this.__destroy_into_raw();
1910
+ wasm.__wbg_keyhive_free(ptr, 0);
1911
+ }
1912
+ /**
1913
+ * @param {Signer} signer
1914
+ * @param {CiphertextStore} ciphertext_store
1915
+ * @param {Function} event_handler
1916
+ * @returns {Promise<Keyhive>}
1917
+ */
1918
+ static init(signer, ciphertext_store, event_handler) {
1919
+ _assertClass(signer, Signer);
1920
+ _assertClass(ciphertext_store, CiphertextStore);
1921
+ var ptr0 = ciphertext_store.__destroy_into_raw();
1922
+ const ret = wasm.keyhive_init(signer.__wbg_ptr, ptr0, event_handler);
1923
+ return ret;
1924
+ }
1925
+ /**
1926
+ * @returns {IndividualId}
1927
+ */
1928
+ get id() {
1929
+ const ret = wasm.keyhive_id(this.__wbg_ptr);
1930
+ return IndividualId.__wrap(ret);
1931
+ }
1932
+ /**
1933
+ * @returns {IndividualId}
1934
+ */
1935
+ get whoami() {
1936
+ const ret = wasm.keyhive_id(this.__wbg_ptr);
1937
+ return IndividualId.__wrap(ret);
1938
+ }
1939
+ /**
1940
+ * @returns {string}
1941
+ */
1942
+ get idString() {
1943
+ let deferred1_0;
1944
+ let deferred1_1;
1945
+ try {
1946
+ const ret = wasm.keyhive_idString(this.__wbg_ptr);
1947
+ deferred1_0 = ret[0];
1948
+ deferred1_1 = ret[1];
1949
+ return getStringFromWasm0(ret[0], ret[1]);
1950
+ } finally {
1951
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1952
+ }
1953
+ }
1954
+ /**
1955
+ * @param {Peer[]} coparents
1956
+ * @returns {Promise<Group>}
1957
+ */
1958
+ generateGroup(coparents) {
1959
+ const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
1960
+ const len0 = WASM_VECTOR_LEN;
1961
+ const ret = wasm.keyhive_generateGroup(this.__wbg_ptr, ptr0, len0);
1962
+ return ret;
1963
+ }
1964
+ /**
1965
+ * @param {Peer[]} coparents
1966
+ * @param {ChangeRef} initial_content_ref_head
1967
+ * @param {ChangeRef[]} more_initial_content_refs
1968
+ * @returns {Promise<Document>}
1969
+ */
1970
+ generateDocument(coparents, initial_content_ref_head, more_initial_content_refs) {
1971
+ const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
1972
+ const len0 = WASM_VECTOR_LEN;
1973
+ _assertClass(initial_content_ref_head, ChangeRef);
1974
+ var ptr1 = initial_content_ref_head.__destroy_into_raw();
1975
+ const ptr2 = passArrayJsValueToWasm0(more_initial_content_refs, wasm.__wbindgen_malloc);
1976
+ const len2 = WASM_VECTOR_LEN;
1977
+ const ret = wasm.keyhive_generateDocument(this.__wbg_ptr, ptr0, len0, ptr1, ptr2, len2);
1978
+ return ret;
1979
+ }
1980
+ /**
1981
+ * @param {Uint8Array} data
1982
+ * @returns {Promise<Signed>}
1983
+ */
1984
+ trySign(data) {
1985
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1986
+ const len0 = WASM_VECTOR_LEN;
1987
+ const ret = wasm.keyhive_trySign(this.__wbg_ptr, ptr0, len0);
1988
+ return ret;
1989
+ }
1990
+ /**
1991
+ * @param {Document} doc
1992
+ * @param {ChangeRef} content_ref
1993
+ * @param {ChangeRef[]} pred_refs
1994
+ * @param {Uint8Array} content
1995
+ * @returns {Promise<EncryptedContentWithUpdate>}
1996
+ */
1997
+ tryEncrypt(doc, content_ref, pred_refs, content) {
1998
+ _assertClass(doc, Document);
1999
+ var ptr0 = doc.__destroy_into_raw();
2000
+ _assertClass(content_ref, ChangeRef);
2001
+ var ptr1 = content_ref.__destroy_into_raw();
2002
+ const ptr2 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
2003
+ const len2 = WASM_VECTOR_LEN;
2004
+ const ptr3 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
2005
+ const len3 = WASM_VECTOR_LEN;
2006
+ const ret = wasm.keyhive_tryEncrypt(this.__wbg_ptr, ptr0, ptr1, ptr2, len2, ptr3, len3);
2007
+ return ret;
2008
+ }
2009
+ /**
2010
+ * @param {Document} doc
2011
+ * @param {ChangeRef} content_ref
2012
+ * @param {ChangeRef[]} pred_refs
2013
+ * @param {Uint8Array} content
2014
+ * @returns {Promise<EncryptedContentWithUpdate>}
2015
+ */
2016
+ tryEncryptArchive(doc, content_ref, pred_refs, content) {
2017
+ _assertClass(doc, Document);
2018
+ var ptr0 = doc.__destroy_into_raw();
2019
+ _assertClass(content_ref, ChangeRef);
2020
+ var ptr1 = content_ref.__destroy_into_raw();
2021
+ const ptr2 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
2022
+ const len2 = WASM_VECTOR_LEN;
2023
+ const ptr3 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
2024
+ const len3 = WASM_VECTOR_LEN;
2025
+ const ret = wasm.keyhive_tryEncryptArchive(this.__wbg_ptr, ptr0, ptr1, ptr2, len2, ptr3, len3);
2026
+ return ret;
2027
+ }
2028
+ /**
2029
+ * @param {Document} doc
2030
+ * @param {Encrypted} encrypted
2031
+ * @returns {Uint8Array}
2032
+ */
2033
+ tryDecrypt(doc, encrypted) {
2034
+ _assertClass(doc, Document);
2035
+ var ptr0 = doc.__destroy_into_raw();
2036
+ _assertClass(encrypted, Encrypted);
2037
+ var ptr1 = encrypted.__destroy_into_raw();
2038
+ const ret = wasm.keyhive_tryDecrypt(this.__wbg_ptr, ptr0, ptr1);
2039
+ if (ret[3]) {
2040
+ throw takeFromExternrefTable0(ret[2]);
2041
+ }
2042
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2043
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2044
+ return v3;
2045
+ }
2046
+ /**
2047
+ * @param {Agent} to_add
2048
+ * @param {Membered} membered
2049
+ * @param {Access} access
2050
+ * @param {Document[]} other_relevant_docs
2051
+ * @returns {Promise<SignedDelegation>}
2052
+ */
2053
+ addMember(to_add, membered, access, other_relevant_docs) {
2054
+ _assertClass(to_add, Agent);
2055
+ _assertClass(membered, Membered);
2056
+ _assertClass(access, Access);
2057
+ var ptr0 = access.__destroy_into_raw();
2058
+ const ptr1 = passArrayJsValueToWasm0(other_relevant_docs, wasm.__wbindgen_malloc);
2059
+ const len1 = WASM_VECTOR_LEN;
2060
+ const ret = wasm.keyhive_addMember(this.__wbg_ptr, to_add.__wbg_ptr, membered.__wbg_ptr, ptr0, ptr1, len1);
2061
+ return ret;
2062
+ }
2063
+ /**
2064
+ * @param {Agent} to_revoke
2065
+ * @param {boolean} retain_all_other_members
2066
+ * @param {Membered} membered
2067
+ * @returns {Promise<SignedRevocation[]>}
2068
+ */
2069
+ revokeMember(to_revoke, retain_all_other_members, membered) {
2070
+ _assertClass(to_revoke, Agent);
2071
+ _assertClass(membered, Membered);
2072
+ const ret = wasm.keyhive_revokeMember(this.__wbg_ptr, to_revoke.__wbg_ptr, retain_all_other_members, membered.__wbg_ptr);
2073
+ return ret;
2074
+ }
2075
+ /**
2076
+ * @returns {Summary[]}
2077
+ */
2078
+ reachableDocs() {
2079
+ const ret = wasm.keyhive_reachableDocs(this.__wbg_ptr);
2080
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2081
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2082
+ return v1;
2083
+ }
2084
+ /**
2085
+ * @param {Document} doc
2086
+ * @returns {Promise<void>}
2087
+ */
2088
+ forcePcsUpdate(doc) {
2089
+ _assertClass(doc, Document);
2090
+ const ret = wasm.keyhive_forcePcsUpdate(this.__wbg_ptr, doc.__wbg_ptr);
2091
+ return ret;
2092
+ }
2093
+ /**
2094
+ * @param {ShareKey} prekey
2095
+ * @returns {Promise<ShareKey>}
2096
+ */
2097
+ rotatePrekey(prekey) {
2098
+ _assertClass(prekey, ShareKey);
2099
+ var ptr0 = prekey.__destroy_into_raw();
2100
+ const ret = wasm.keyhive_rotatePrekey(this.__wbg_ptr, ptr0);
2101
+ return ret;
2102
+ }
2103
+ /**
2104
+ * @returns {Promise<ShareKey>}
2105
+ */
2106
+ expandPrekeys() {
2107
+ const ret = wasm.keyhive_expandPrekeys(this.__wbg_ptr);
2108
+ return ret;
2109
+ }
2110
+ /**
2111
+ * @returns {Promise<ContactCard>}
2112
+ */
2113
+ contactCard() {
2114
+ const ret = wasm.keyhive_contactCard(this.__wbg_ptr);
2115
+ return ret;
2116
+ }
2117
+ /**
2118
+ * @param {ContactCard} contact_card
2119
+ * @returns {Individual}
2120
+ */
2121
+ receiveContactCard(contact_card) {
2122
+ _assertClass(contact_card, ContactCard);
2123
+ var ptr0 = contact_card.__destroy_into_raw();
2124
+ const ret = wasm.keyhive_receiveContactCard(this.__wbg_ptr, ptr0);
2125
+ if (ret[2]) {
2126
+ throw takeFromExternrefTable0(ret[1]);
2127
+ }
2128
+ return Individual.__wrap(ret[0]);
2129
+ }
2130
+ /**
2131
+ * @param {Identifier} id
2132
+ * @returns {Agent | undefined}
2133
+ */
2134
+ getAgent(id) {
2135
+ _assertClass(id, Identifier);
2136
+ const ret = wasm.keyhive_getAgent(this.__wbg_ptr, id.__wbg_ptr);
2137
+ return ret === 0 ? undefined : Agent.__wrap(ret);
2138
+ }
2139
+ /**
2140
+ * @param {Identifier} id
2141
+ * @returns {Group | undefined}
2142
+ */
2143
+ getGroup(id) {
2144
+ _assertClass(id, Identifier);
2145
+ const ret = wasm.keyhive_getGroup(this.__wbg_ptr, id.__wbg_ptr);
2146
+ return ret === 0 ? undefined : Group.__wrap(ret);
2147
+ }
2148
+ /**
2149
+ * @param {DocumentId} doc_id
2150
+ * @returns {SimpleCapability[]}
2151
+ */
2152
+ docMemberCapabilities(doc_id) {
2153
+ _assertClass(doc_id, DocumentId);
2154
+ const ret = wasm.keyhive_docMemberCapabilities(this.__wbg_ptr, doc_id.__wbg_ptr);
2155
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2156
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2157
+ return v1;
2158
+ }
2159
+ /**
2160
+ * @param {Identifier} id
2161
+ * @param {DocumentId} doc_id
2162
+ * @returns {Access | undefined}
2163
+ */
2164
+ accessForDoc(id, doc_id) {
2165
+ _assertClass(id, Identifier);
2166
+ _assertClass(doc_id, DocumentId);
2167
+ const ret = wasm.keyhive_accessForDoc(this.__wbg_ptr, id.__wbg_ptr, doc_id.__wbg_ptr);
2168
+ return ret === 0 ? undefined : Access.__wrap(ret);
2169
+ }
2170
+ /**
2171
+ * @returns {Archive}
2172
+ */
2173
+ intoArchive() {
2174
+ const ptr = this.__destroy_into_raw();
2175
+ const ret = wasm.keyhive_intoArchive(ptr);
2176
+ return Archive.__wrap(ret);
2177
+ }
2178
+ /**
2179
+ * @returns {Archive}
2180
+ */
2181
+ toArchive() {
2182
+ const ret = wasm.keyhive_toArchive(this.__wbg_ptr);
2183
+ return Archive.__wrap(ret);
2184
+ }
2185
+ }
2186
+ module.exports.Keyhive = Keyhive;
2187
+
2188
+ const MemberedFinalization = (typeof FinalizationRegistry === 'undefined')
2189
+ ? { register: () => {}, unregister: () => {} }
2190
+ : new FinalizationRegistry(ptr => wasm.__wbg_membered_free(ptr >>> 0, 1));
2191
+
2192
+ class Membered {
2193
+
2194
+ static __wrap(ptr) {
2195
+ ptr = ptr >>> 0;
2196
+ const obj = Object.create(Membered.prototype);
2197
+ obj.__wbg_ptr = ptr;
2198
+ MemberedFinalization.register(obj, obj.__wbg_ptr, obj);
2199
+ return obj;
2200
+ }
2201
+
2202
+ __destroy_into_raw() {
2203
+ const ptr = this.__wbg_ptr;
2204
+ this.__wbg_ptr = 0;
2205
+ MemberedFinalization.unregister(this);
2206
+ return ptr;
2207
+ }
2208
+
2209
+ free() {
2210
+ const ptr = this.__destroy_into_raw();
2211
+ wasm.__wbg_membered_free(ptr, 0);
2212
+ }
2213
+ }
2214
+ module.exports.Membered = Membered;
2215
+
2216
+ const PeerFinalization = (typeof FinalizationRegistry === 'undefined')
2217
+ ? { register: () => {}, unregister: () => {} }
2218
+ : new FinalizationRegistry(ptr => wasm.__wbg_peer_free(ptr >>> 0, 1));
2219
+
2220
+ class Peer {
2221
+
2222
+ static __wrap(ptr) {
2223
+ ptr = ptr >>> 0;
2224
+ const obj = Object.create(Peer.prototype);
2225
+ obj.__wbg_ptr = ptr;
2226
+ PeerFinalization.register(obj, obj.__wbg_ptr, obj);
2227
+ return obj;
2228
+ }
2229
+
2230
+ static __unwrap(jsValue) {
2231
+ if (!(jsValue instanceof Peer)) {
2232
+ return 0;
2233
+ }
2234
+ return jsValue.__destroy_into_raw();
2235
+ }
2236
+
2237
+ __destroy_into_raw() {
2238
+ const ptr = this.__wbg_ptr;
2239
+ this.__wbg_ptr = 0;
2240
+ PeerFinalization.unregister(this);
2241
+ return ptr;
2242
+ }
2243
+
2244
+ free() {
2245
+ const ptr = this.__destroy_into_raw();
2246
+ wasm.__wbg_peer_free(ptr, 0);
2247
+ }
2248
+ /**
2249
+ * @returns {string}
2250
+ */
2251
+ toString() {
2252
+ let deferred1_0;
2253
+ let deferred1_1;
2254
+ try {
2255
+ const ret = wasm.peer_toString(this.__wbg_ptr);
2256
+ deferred1_0 = ret[0];
2257
+ deferred1_1 = ret[1];
2258
+ return getStringFromWasm0(ret[0], ret[1]);
2259
+ } finally {
2260
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2261
+ }
2262
+ }
2263
+ /**
2264
+ * @returns {boolean}
2265
+ */
2266
+ isIndividual() {
2267
+ const ret = wasm.peer_isIndividual(this.__wbg_ptr);
2268
+ return ret !== 0;
2269
+ }
2270
+ /**
2271
+ * @returns {boolean}
2272
+ */
2273
+ isGroup() {
2274
+ const ret = wasm.peer_isGroup(this.__wbg_ptr);
2275
+ return ret !== 0;
2276
+ }
2277
+ /**
2278
+ * @returns {boolean}
2279
+ */
2280
+ isDocument() {
2281
+ const ret = wasm.peer_isDocument(this.__wbg_ptr);
2282
+ return ret !== 0;
2283
+ }
2284
+ }
2285
+ module.exports.Peer = Peer;
2286
+
2287
+ const RemoveCiphertextErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2288
+ ? { register: () => {}, unregister: () => {} }
2289
+ : new FinalizationRegistry(ptr => wasm.__wbg_removeciphertexterror_free(ptr >>> 0, 1));
2290
+
2291
+ class RemoveCiphertextError {
2292
+
2293
+ __destroy_into_raw() {
2294
+ const ptr = this.__wbg_ptr;
2295
+ this.__wbg_ptr = 0;
2296
+ RemoveCiphertextErrorFinalization.unregister(this);
2297
+ return ptr;
2298
+ }
2299
+
2300
+ free() {
2301
+ const ptr = this.__destroy_into_raw();
2302
+ wasm.__wbg_removeciphertexterror_free(ptr, 0);
2303
+ }
2304
+ }
2305
+ module.exports.RemoveCiphertextError = RemoveCiphertextError;
2306
+
2307
+ const RevocationFinalization = (typeof FinalizationRegistry === 'undefined')
2308
+ ? { register: () => {}, unregister: () => {} }
2309
+ : new FinalizationRegistry(ptr => wasm.__wbg_revocation_free(ptr >>> 0, 1));
2310
+
2311
+ class Revocation {
2312
+
2313
+ static __wrap(ptr) {
2314
+ ptr = ptr >>> 0;
2315
+ const obj = Object.create(Revocation.prototype);
2316
+ obj.__wbg_ptr = ptr;
2317
+ RevocationFinalization.register(obj, obj.__wbg_ptr, obj);
2318
+ return obj;
2319
+ }
2320
+
2321
+ __destroy_into_raw() {
2322
+ const ptr = this.__wbg_ptr;
2323
+ this.__wbg_ptr = 0;
2324
+ RevocationFinalization.unregister(this);
2325
+ return ptr;
2326
+ }
2327
+
2328
+ free() {
2329
+ const ptr = this.__destroy_into_raw();
2330
+ wasm.__wbg_revocation_free(ptr, 0);
2331
+ }
2332
+ /**
2333
+ * @returns {Identifier}
2334
+ */
2335
+ get subject_id() {
2336
+ const ret = wasm.revocation_subject_id(this.__wbg_ptr);
2337
+ return Identifier.__wrap(ret);
2338
+ }
2339
+ /**
2340
+ * @returns {SignedDelegation}
2341
+ */
2342
+ get revoked() {
2343
+ const ret = wasm.revocation_revoked(this.__wbg_ptr);
2344
+ return SignedDelegation.__wrap(ret);
2345
+ }
2346
+ /**
2347
+ * @returns {SignedDelegation | undefined}
2348
+ */
2349
+ get proof() {
2350
+ const ret = wasm.revocation_proof(this.__wbg_ptr);
2351
+ return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
2352
+ }
2353
+ /**
2354
+ * @returns {History}
2355
+ */
2356
+ get after() {
2357
+ const ret = wasm.revocation_after(this.__wbg_ptr);
2358
+ return History.__wrap(ret);
2359
+ }
2360
+ }
2361
+ module.exports.Revocation = Revocation;
2362
+
2363
+ const RevokeMemberErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2364
+ ? { register: () => {}, unregister: () => {} }
2365
+ : new FinalizationRegistry(ptr => wasm.__wbg_revokemembererror_free(ptr >>> 0, 1));
2366
+
2367
+ class RevokeMemberError {
2368
+
2369
+ static __wrap(ptr) {
2370
+ ptr = ptr >>> 0;
2371
+ const obj = Object.create(RevokeMemberError.prototype);
2372
+ obj.__wbg_ptr = ptr;
2373
+ RevokeMemberErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2374
+ return obj;
2375
+ }
2376
+
2377
+ __destroy_into_raw() {
2378
+ const ptr = this.__wbg_ptr;
2379
+ this.__wbg_ptr = 0;
2380
+ RevokeMemberErrorFinalization.unregister(this);
2381
+ return ptr;
2382
+ }
2383
+
2384
+ free() {
2385
+ const ptr = this.__destroy_into_raw();
2386
+ wasm.__wbg_revokemembererror_free(ptr, 0);
2387
+ }
2388
+ /**
2389
+ * @returns {string}
2390
+ */
2391
+ get message() {
2392
+ let deferred1_0;
2393
+ let deferred1_1;
2394
+ try {
2395
+ const ret = wasm.revokemembererror_message(this.__wbg_ptr);
2396
+ deferred1_0 = ret[0];
2397
+ deferred1_1 = ret[1];
2398
+ return getStringFromWasm0(ret[0], ret[1]);
2399
+ } finally {
2400
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2401
+ }
2402
+ }
2403
+ }
2404
+ module.exports.RevokeMemberError = RevokeMemberError;
2405
+
2406
+ const SerializationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2407
+ ? { register: () => {}, unregister: () => {} }
2408
+ : new FinalizationRegistry(ptr => wasm.__wbg_serializationerror_free(ptr >>> 0, 1));
2409
+
2410
+ class SerializationError {
2411
+
2412
+ static __wrap(ptr) {
2413
+ ptr = ptr >>> 0;
2414
+ const obj = Object.create(SerializationError.prototype);
2415
+ obj.__wbg_ptr = ptr;
2416
+ SerializationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2417
+ return obj;
2418
+ }
2419
+
2420
+ __destroy_into_raw() {
2421
+ const ptr = this.__wbg_ptr;
2422
+ this.__wbg_ptr = 0;
2423
+ SerializationErrorFinalization.unregister(this);
2424
+ return ptr;
2425
+ }
2426
+
2427
+ free() {
2428
+ const ptr = this.__destroy_into_raw();
2429
+ wasm.__wbg_serializationerror_free(ptr, 0);
2430
+ }
2431
+ /**
2432
+ * @returns {any}
2433
+ */
2434
+ toError() {
2435
+ const ptr = this.__destroy_into_raw();
2436
+ const ret = wasm.serializationerror_toError(ptr);
2437
+ return ret;
2438
+ }
2439
+ }
2440
+ module.exports.SerializationError = SerializationError;
2441
+
2442
+ const ShareKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2443
+ ? { register: () => {}, unregister: () => {} }
2444
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharekey_free(ptr >>> 0, 1));
2445
+
2446
+ class ShareKey {
2447
+
2448
+ static __wrap(ptr) {
2449
+ ptr = ptr >>> 0;
2450
+ const obj = Object.create(ShareKey.prototype);
2451
+ obj.__wbg_ptr = ptr;
2452
+ ShareKeyFinalization.register(obj, obj.__wbg_ptr, obj);
2453
+ return obj;
2454
+ }
2455
+
2456
+ __destroy_into_raw() {
2457
+ const ptr = this.__wbg_ptr;
2458
+ this.__wbg_ptr = 0;
2459
+ ShareKeyFinalization.unregister(this);
2460
+ return ptr;
2461
+ }
2462
+
2463
+ free() {
2464
+ const ptr = this.__destroy_into_raw();
2465
+ wasm.__wbg_sharekey_free(ptr, 0);
2466
+ }
2467
+ }
2468
+ module.exports.ShareKey = ShareKey;
2469
+
2470
+ const SignedFinalization = (typeof FinalizationRegistry === 'undefined')
2471
+ ? { register: () => {}, unregister: () => {} }
2472
+ : new FinalizationRegistry(ptr => wasm.__wbg_signed_free(ptr >>> 0, 1));
2473
+
2474
+ class Signed {
2475
+
2476
+ static __wrap(ptr) {
2477
+ ptr = ptr >>> 0;
2478
+ const obj = Object.create(Signed.prototype);
2479
+ obj.__wbg_ptr = ptr;
2480
+ SignedFinalization.register(obj, obj.__wbg_ptr, obj);
2481
+ return obj;
2482
+ }
2483
+
2484
+ __destroy_into_raw() {
2485
+ const ptr = this.__wbg_ptr;
2486
+ this.__wbg_ptr = 0;
2487
+ SignedFinalization.unregister(this);
2488
+ return ptr;
2489
+ }
2490
+
2491
+ free() {
2492
+ const ptr = this.__destroy_into_raw();
2493
+ wasm.__wbg_signed_free(ptr, 0);
2494
+ }
2495
+ /**
2496
+ * @param {Uint8Array} bytes
2497
+ * @returns {Signed}
2498
+ */
2499
+ static fromBytes(bytes) {
2500
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2501
+ const len0 = WASM_VECTOR_LEN;
2502
+ const ret = wasm.signed_fromBytes(ptr0, len0);
2503
+ return Signed.__wrap(ret);
2504
+ }
2505
+ /**
2506
+ * @returns {Uint8Array}
2507
+ */
2508
+ toBytes() {
2509
+ const ret = wasm.signed_toBytes(this.__wbg_ptr);
2510
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2511
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2512
+ return v1;
2513
+ }
2514
+ /**
2515
+ * @returns {boolean}
2516
+ */
2517
+ verify() {
2518
+ const ret = wasm.signed_verify(this.__wbg_ptr);
2519
+ return ret !== 0;
2520
+ }
2521
+ /**
2522
+ * @returns {Uint8Array}
2523
+ */
2524
+ get payload() {
2525
+ const ret = wasm.signed_payload(this.__wbg_ptr);
2526
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2527
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2528
+ return v1;
2529
+ }
2530
+ /**
2531
+ * @returns {Uint8Array}
2532
+ */
2533
+ get verifyingKey() {
2534
+ const ret = wasm.signed_verifyingKey(this.__wbg_ptr);
2535
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2536
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2537
+ return v1;
2538
+ }
2539
+ /**
2540
+ * @returns {Uint8Array}
2541
+ */
2542
+ get signature() {
2543
+ const ret = wasm.signed_signature(this.__wbg_ptr);
2544
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2545
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2546
+ return v1;
2547
+ }
2548
+ }
2549
+ module.exports.Signed = Signed;
2550
+
2551
+ const SignedCgkaOperationFinalization = (typeof FinalizationRegistry === 'undefined')
2552
+ ? { register: () => {}, unregister: () => {} }
2553
+ : new FinalizationRegistry(ptr => wasm.__wbg_signedcgkaoperation_free(ptr >>> 0, 1));
2554
+
2555
+ class SignedCgkaOperation {
2556
+
2557
+ static __wrap(ptr) {
2558
+ ptr = ptr >>> 0;
2559
+ const obj = Object.create(SignedCgkaOperation.prototype);
2560
+ obj.__wbg_ptr = ptr;
2561
+ SignedCgkaOperationFinalization.register(obj, obj.__wbg_ptr, obj);
2562
+ return obj;
2563
+ }
2564
+
2565
+ __destroy_into_raw() {
2566
+ const ptr = this.__wbg_ptr;
2567
+ this.__wbg_ptr = 0;
2568
+ SignedCgkaOperationFinalization.unregister(this);
2569
+ return ptr;
2570
+ }
2571
+
2572
+ free() {
2573
+ const ptr = this.__destroy_into_raw();
2574
+ wasm.__wbg_signedcgkaoperation_free(ptr, 0);
2575
+ }
2576
+ /**
2577
+ * @returns {boolean}
2578
+ */
2579
+ verify() {
2580
+ const ret = wasm.signedcgkaoperation_verify(this.__wbg_ptr);
2581
+ return ret !== 0;
2582
+ }
2583
+ /**
2584
+ * @returns {CgkaOperation}
2585
+ */
2586
+ get delegation() {
2587
+ const ret = wasm.signedcgkaoperation_delegation(this.__wbg_ptr);
2588
+ return CgkaOperation.__wrap(ret);
2589
+ }
2590
+ /**
2591
+ * @returns {Uint8Array}
2592
+ */
2593
+ get verifyingKey() {
2594
+ const ret = wasm.signedcgkaoperation_verifyingKey(this.__wbg_ptr);
2595
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2596
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2597
+ return v1;
2598
+ }
2599
+ /**
2600
+ * @returns {Uint8Array}
2601
+ */
2602
+ get signature() {
2603
+ const ret = wasm.signedcgkaoperation_signature(this.__wbg_ptr);
2604
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2605
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2606
+ return v1;
2607
+ }
2608
+ }
2609
+ module.exports.SignedCgkaOperation = SignedCgkaOperation;
2610
+
2611
+ const SignedDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
2612
+ ? { register: () => {}, unregister: () => {} }
2613
+ : new FinalizationRegistry(ptr => wasm.__wbg_signeddelegation_free(ptr >>> 0, 1));
2614
+
2615
+ class SignedDelegation {
2616
+
2617
+ static __wrap(ptr) {
2618
+ ptr = ptr >>> 0;
2619
+ const obj = Object.create(SignedDelegation.prototype);
2620
+ obj.__wbg_ptr = ptr;
2621
+ SignedDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
2622
+ return obj;
2623
+ }
2624
+
2625
+ __destroy_into_raw() {
2626
+ const ptr = this.__wbg_ptr;
2627
+ this.__wbg_ptr = 0;
2628
+ SignedDelegationFinalization.unregister(this);
2629
+ return ptr;
2630
+ }
2631
+
2632
+ free() {
2633
+ const ptr = this.__destroy_into_raw();
2634
+ wasm.__wbg_signeddelegation_free(ptr, 0);
2635
+ }
2636
+ /**
2637
+ * @returns {boolean}
2638
+ */
2639
+ verify() {
2640
+ const ret = wasm.signeddelegation_verify(this.__wbg_ptr);
2641
+ return ret !== 0;
2642
+ }
2643
+ /**
2644
+ * @returns {Delegation}
2645
+ */
2646
+ get delegation() {
2647
+ const ret = wasm.signeddelegation_delegation(this.__wbg_ptr);
2648
+ return Delegation.__wrap(ret);
2649
+ }
2650
+ /**
2651
+ * @returns {Uint8Array}
2652
+ */
2653
+ get verifyingKey() {
2654
+ const ret = wasm.signeddelegation_verifyingKey(this.__wbg_ptr);
2655
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2656
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2657
+ return v1;
2658
+ }
2659
+ /**
2660
+ * @returns {Uint8Array}
2661
+ */
2662
+ get signature() {
2663
+ const ret = wasm.signeddelegation_signature(this.__wbg_ptr);
2664
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2665
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2666
+ return v1;
2667
+ }
2668
+ }
2669
+ module.exports.SignedDelegation = SignedDelegation;
2670
+
2671
+ const SignedInvocationFinalization = (typeof FinalizationRegistry === 'undefined')
2672
+ ? { register: () => {}, unregister: () => {} }
2673
+ : new FinalizationRegistry(ptr => wasm.__wbg_signedinvocation_free(ptr >>> 0, 1));
2674
+
2675
+ class SignedInvocation {
2676
+
2677
+ __destroy_into_raw() {
2678
+ const ptr = this.__wbg_ptr;
2679
+ this.__wbg_ptr = 0;
2680
+ SignedInvocationFinalization.unregister(this);
2681
+ return ptr;
2682
+ }
2683
+
2684
+ free() {
2685
+ const ptr = this.__destroy_into_raw();
2686
+ wasm.__wbg_signedinvocation_free(ptr, 0);
2687
+ }
2688
+ }
2689
+ module.exports.SignedInvocation = SignedInvocation;
2690
+
2691
+ const SignedRevocationFinalization = (typeof FinalizationRegistry === 'undefined')
2692
+ ? { register: () => {}, unregister: () => {} }
2693
+ : new FinalizationRegistry(ptr => wasm.__wbg_signedrevocation_free(ptr >>> 0, 1));
2694
+
2695
+ class SignedRevocation {
2696
+
2697
+ static __wrap(ptr) {
2698
+ ptr = ptr >>> 0;
2699
+ const obj = Object.create(SignedRevocation.prototype);
2700
+ obj.__wbg_ptr = ptr;
2701
+ SignedRevocationFinalization.register(obj, obj.__wbg_ptr, obj);
2702
+ return obj;
2703
+ }
2704
+
2705
+ __destroy_into_raw() {
2706
+ const ptr = this.__wbg_ptr;
2707
+ this.__wbg_ptr = 0;
2708
+ SignedRevocationFinalization.unregister(this);
2709
+ return ptr;
2710
+ }
2711
+
2712
+ free() {
2713
+ const ptr = this.__destroy_into_raw();
2714
+ wasm.__wbg_signedrevocation_free(ptr, 0);
2715
+ }
2716
+ /**
2717
+ * @returns {boolean}
2718
+ */
2719
+ verify() {
2720
+ const ret = wasm.signedrevocation_verify(this.__wbg_ptr);
2721
+ return ret !== 0;
2722
+ }
2723
+ /**
2724
+ * @returns {Revocation}
2725
+ */
2726
+ get delegation() {
2727
+ const ret = wasm.signedrevocation_delegation(this.__wbg_ptr);
2728
+ return Revocation.__wrap(ret);
2729
+ }
2730
+ /**
2731
+ * @returns {Uint8Array}
2732
+ */
2733
+ get verifyingKey() {
2734
+ const ret = wasm.signedrevocation_verifyingKey(this.__wbg_ptr);
2735
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2736
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2737
+ return v1;
2738
+ }
2739
+ /**
2740
+ * @returns {Uint8Array}
2741
+ */
2742
+ get signature() {
2743
+ const ret = wasm.signedrevocation_signature(this.__wbg_ptr);
2744
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2745
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2746
+ return v1;
2747
+ }
2748
+ }
2749
+ module.exports.SignedRevocation = SignedRevocation;
2750
+
2751
+ const SignerFinalization = (typeof FinalizationRegistry === 'undefined')
2752
+ ? { register: () => {}, unregister: () => {} }
2753
+ : new FinalizationRegistry(ptr => wasm.__wbg_signer_free(ptr >>> 0, 1));
2754
+
2755
+ class Signer {
2756
+
2757
+ static __wrap(ptr) {
2758
+ ptr = ptr >>> 0;
2759
+ const obj = Object.create(Signer.prototype);
2760
+ obj.__wbg_ptr = ptr;
2761
+ SignerFinalization.register(obj, obj.__wbg_ptr, obj);
2762
+ return obj;
2763
+ }
2764
+
2765
+ __destroy_into_raw() {
2766
+ const ptr = this.__wbg_ptr;
2767
+ this.__wbg_ptr = 0;
2768
+ SignerFinalization.unregister(this);
2769
+ return ptr;
2770
+ }
2771
+
2772
+ free() {
2773
+ const ptr = this.__destroy_into_raw();
2774
+ wasm.__wbg_signer_free(ptr, 0);
2775
+ }
2776
+ /**
2777
+ * @returns {Promise<Signer>}
2778
+ */
2779
+ static generate() {
2780
+ const ret = wasm.signer_generate();
2781
+ return ret;
2782
+ }
2783
+ /**
2784
+ * @returns {Signer}
2785
+ */
2786
+ static generateMemory() {
2787
+ const ret = wasm.signer_generateMemory();
2788
+ return Signer.__wrap(ret);
2789
+ }
2790
+ /**
2791
+ * @returns {Promise<Signer>}
2792
+ */
2793
+ static generateWebCrypto() {
2794
+ const ret = wasm.signer_generateWebCrypto();
2795
+ return ret;
2796
+ }
2797
+ /**
2798
+ * @param {Uint8Array} bytes
2799
+ * @returns {Signer}
2800
+ */
2801
+ static memorySignerFromBytes(bytes) {
2802
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2803
+ const len0 = WASM_VECTOR_LEN;
2804
+ const ret = wasm.signer_memorySignerFromBytes(ptr0, len0);
2805
+ if (ret[2]) {
2806
+ throw takeFromExternrefTable0(ret[1]);
2807
+ }
2808
+ return Signer.__wrap(ret[0]);
2809
+ }
2810
+ /**
2811
+ * @param {any} keypair
2812
+ * @returns {Promise<Signer>}
2813
+ */
2814
+ static webCryptoSigner(keypair) {
2815
+ const ret = wasm.signer_webCryptoSigner(keypair);
2816
+ return ret;
2817
+ }
2818
+ /**
2819
+ * @returns {string}
2820
+ */
2821
+ get variant() {
2822
+ let deferred1_0;
2823
+ let deferred1_1;
2824
+ try {
2825
+ const ret = wasm.signer_variant(this.__wbg_ptr);
2826
+ deferred1_0 = ret[0];
2827
+ deferred1_1 = ret[1];
2828
+ return getStringFromWasm0(ret[0], ret[1]);
2829
+ } finally {
2830
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2831
+ }
2832
+ }
2833
+ /**
2834
+ * @param {Uint8Array} bytes
2835
+ * @returns {Promise<Signed>}
2836
+ */
2837
+ trySign(bytes) {
2838
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2839
+ const len0 = WASM_VECTOR_LEN;
2840
+ const ret = wasm.signer_trySign(this.__wbg_ptr, ptr0, len0);
2841
+ return ret;
2842
+ }
2843
+ /**
2844
+ * @returns {Uint8Array}
2845
+ */
2846
+ get verifyingKey() {
2847
+ const ret = wasm.signer_verifyingKey(this.__wbg_ptr);
2848
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2849
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2850
+ return v1;
2851
+ }
2852
+ /**
2853
+ * @returns {Signer}
2854
+ */
2855
+ clone() {
2856
+ const ret = wasm.signer_clone(this.__wbg_ptr);
2857
+ return Signer.__wrap(ret);
2858
+ }
2859
+ }
2860
+ module.exports.Signer = Signer;
2861
+
2862
+ const SigningErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2863
+ ? { register: () => {}, unregister: () => {} }
2864
+ : new FinalizationRegistry(ptr => wasm.__wbg_signingerror_free(ptr >>> 0, 1));
2865
+
2866
+ class SigningError {
2867
+
2868
+ static __wrap(ptr) {
2869
+ ptr = ptr >>> 0;
2870
+ const obj = Object.create(SigningError.prototype);
2871
+ obj.__wbg_ptr = ptr;
2872
+ SigningErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2873
+ return obj;
2874
+ }
2875
+
2876
+ __destroy_into_raw() {
2877
+ const ptr = this.__wbg_ptr;
2878
+ this.__wbg_ptr = 0;
2879
+ SigningErrorFinalization.unregister(this);
2880
+ return ptr;
2881
+ }
2882
+
2883
+ free() {
2884
+ const ptr = this.__destroy_into_raw();
2885
+ wasm.__wbg_signingerror_free(ptr, 0);
2886
+ }
2887
+ /**
2888
+ * @returns {string}
2889
+ */
2890
+ message() {
2891
+ let deferred1_0;
2892
+ let deferred1_1;
2893
+ try {
2894
+ const ret = wasm.signingerror_message(this.__wbg_ptr);
2895
+ deferred1_0 = ret[0];
2896
+ deferred1_1 = ret[1];
2897
+ return getStringFromWasm0(ret[0], ret[1]);
2898
+ } finally {
2899
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2900
+ }
2901
+ }
2902
+ }
2903
+ module.exports.SigningError = SigningError;
2904
+
2905
+ const SimpleCapabilityFinalization = (typeof FinalizationRegistry === 'undefined')
2906
+ ? { register: () => {}, unregister: () => {} }
2907
+ : new FinalizationRegistry(ptr => wasm.__wbg_simplecapability_free(ptr >>> 0, 1));
2908
+
2909
+ class SimpleCapability {
2910
+
2911
+ static __wrap(ptr) {
2912
+ ptr = ptr >>> 0;
2913
+ const obj = Object.create(SimpleCapability.prototype);
2914
+ obj.__wbg_ptr = ptr;
2915
+ SimpleCapabilityFinalization.register(obj, obj.__wbg_ptr, obj);
2916
+ return obj;
2917
+ }
2918
+
2919
+ __destroy_into_raw() {
2920
+ const ptr = this.__wbg_ptr;
2921
+ this.__wbg_ptr = 0;
2922
+ SimpleCapabilityFinalization.unregister(this);
2923
+ return ptr;
2924
+ }
2925
+
2926
+ free() {
2927
+ const ptr = this.__destroy_into_raw();
2928
+ wasm.__wbg_simplecapability_free(ptr, 0);
2929
+ }
2930
+ /**
2931
+ * @returns {Agent}
2932
+ */
2933
+ get who() {
2934
+ const ret = wasm.simplecapability_who(this.__wbg_ptr);
2935
+ return Agent.__wrap(ret);
2936
+ }
2937
+ /**
2938
+ * @returns {Access}
2939
+ */
2940
+ get can() {
2941
+ const ret = wasm.simplecapability_can(this.__wbg_ptr);
2942
+ return Access.__wrap(ret);
2943
+ }
2944
+ }
2945
+ module.exports.SimpleCapability = SimpleCapability;
2946
+
2947
+ const SummaryFinalization = (typeof FinalizationRegistry === 'undefined')
2948
+ ? { register: () => {}, unregister: () => {} }
2949
+ : new FinalizationRegistry(ptr => wasm.__wbg_summary_free(ptr >>> 0, 1));
2950
+
2951
+ class Summary {
2952
+
2953
+ static __wrap(ptr) {
2954
+ ptr = ptr >>> 0;
2955
+ const obj = Object.create(Summary.prototype);
2956
+ obj.__wbg_ptr = ptr;
2957
+ SummaryFinalization.register(obj, obj.__wbg_ptr, obj);
2958
+ return obj;
2959
+ }
2960
+
2961
+ __destroy_into_raw() {
2962
+ const ptr = this.__wbg_ptr;
2963
+ this.__wbg_ptr = 0;
2964
+ SummaryFinalization.unregister(this);
2965
+ return ptr;
2966
+ }
2967
+
2968
+ free() {
2969
+ const ptr = this.__destroy_into_raw();
2970
+ wasm.__wbg_summary_free(ptr, 0);
2971
+ }
2972
+ /**
2973
+ * @returns {Document}
2974
+ */
2975
+ get doc() {
2976
+ const ret = wasm.summary_doc(this.__wbg_ptr);
2977
+ return Document.__wrap(ret);
2978
+ }
2979
+ /**
2980
+ * @returns {Access}
2981
+ */
2982
+ get access() {
2983
+ const ret = wasm.summary_access(this.__wbg_ptr);
2984
+ return Access.__wrap(ret);
2985
+ }
2986
+ }
2987
+ module.exports.Summary = Summary;
2988
+
2989
+ const TryFromArchiveErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2990
+ ? { register: () => {}, unregister: () => {} }
2991
+ : new FinalizationRegistry(ptr => wasm.__wbg_tryfromarchiveerror_free(ptr >>> 0, 1));
2992
+
2993
+ class TryFromArchiveError {
2994
+
2995
+ static __wrap(ptr) {
2996
+ ptr = ptr >>> 0;
2997
+ const obj = Object.create(TryFromArchiveError.prototype);
2998
+ obj.__wbg_ptr = ptr;
2999
+ TryFromArchiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
3000
+ return obj;
3001
+ }
3002
+
3003
+ __destroy_into_raw() {
3004
+ const ptr = this.__wbg_ptr;
3005
+ this.__wbg_ptr = 0;
3006
+ TryFromArchiveErrorFinalization.unregister(this);
3007
+ return ptr;
3008
+ }
3009
+
3010
+ free() {
3011
+ const ptr = this.__destroy_into_raw();
3012
+ wasm.__wbg_tryfromarchiveerror_free(ptr, 0);
3013
+ }
3014
+ /**
3015
+ * @returns {any}
3016
+ */
3017
+ toError() {
3018
+ const ptr = this.__destroy_into_raw();
3019
+ const ret = wasm.tryfromarchiveerror_toError(ptr);
3020
+ return ret;
3021
+ }
3022
+ }
3023
+ module.exports.TryFromArchiveError = TryFromArchiveError;
3024
+
3025
+ module.exports.__wbg_Error_1f3748b298f99708 = function(arg0, arg1) {
3026
+ const ret = Error(getStringFromWasm0(arg0, arg1));
3027
+ return ret;
3028
+ };
3029
+
3030
+ module.exports.__wbg_addmembererror_new = function(arg0) {
3031
+ const ret = AddMemberError.__wrap(arg0);
3032
+ return ret;
3033
+ };
3034
+
3035
+ module.exports.__wbg_call_2f8d426a20a307fe = function() { return handleError(function (arg0, arg1) {
3036
+ const ret = arg0.call(arg1);
3037
+ return ret;
3038
+ }, arguments) };
3039
+
3040
+ module.exports.__wbg_call_f53f0647ceb9c567 = function() { return handleError(function (arg0, arg1, arg2) {
3041
+ const ret = arg0.call(arg1, arg2);
3042
+ return ret;
3043
+ }, arguments) };
3044
+
3045
+ module.exports.__wbg_cannotparseed25519signingkey_new = function(arg0) {
3046
+ const ret = CannotParseEd25519SigningKey.__wrap(arg0);
3047
+ return ret;
3048
+ };
3049
+
3050
+ module.exports.__wbg_cannotparseidentifier_new = function(arg0) {
3051
+ const ret = CannotParseIdentifier.__wrap(arg0);
3052
+ return ret;
3053
+ };
3054
+
3055
+ module.exports.__wbg_capability_new = function(arg0) {
3056
+ const ret = Capability.__wrap(arg0);
3057
+ return ret;
3058
+ };
3059
+
3060
+ module.exports.__wbg_changeref_new = function(arg0) {
3061
+ const ret = ChangeRef.__wrap(arg0);
3062
+ return ret;
3063
+ };
3064
+
3065
+ module.exports.__wbg_changeref_unwrap = function(arg0) {
3066
+ const ret = ChangeRef.__unwrap(arg0);
3067
+ return ret;
3068
+ };
3069
+
3070
+ module.exports.__wbg_contactcard_new = function(arg0) {
3071
+ const ret = ContactCard.__wrap(arg0);
3072
+ return ret;
3073
+ };
3074
+
3075
+ module.exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
3076
+ const ret = arg0.crypto;
3077
+ return ret;
3078
+ };
3079
+
3080
+ module.exports.__wbg_crypto_d27ad9f7221b1675 = function() { return handleError(function (arg0) {
3081
+ const ret = arg0.crypto;
3082
+ return ret;
3083
+ }, arguments) };
3084
+
3085
+ module.exports.__wbg_doccontentrefs_new = function(arg0) {
3086
+ const ret = DocContentRefs.__wrap(arg0);
3087
+ return ret;
3088
+ };
3089
+
3090
+ module.exports.__wbg_document_new = function(arg0) {
3091
+ const ret = Document.__wrap(arg0);
3092
+ return ret;
3093
+ };
3094
+
3095
+ module.exports.__wbg_document_unwrap = function(arg0) {
3096
+ const ret = Document.__unwrap(arg0);
3097
+ return ret;
3098
+ };
3099
+
3100
+ module.exports.__wbg_encryptedcontentwithupdate_new = function(arg0) {
3101
+ const ret = EncryptedContentWithUpdate.__wrap(arg0);
3102
+ return ret;
3103
+ };
3104
+
3105
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
3106
+ let deferred0_0;
3107
+ let deferred0_1;
3108
+ try {
3109
+ deferred0_0 = arg0;
3110
+ deferred0_1 = arg1;
3111
+ console.error(getStringFromWasm0(arg0, arg1));
3112
+ } finally {
3113
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3114
+ }
3115
+ };
3116
+
3117
+ module.exports.__wbg_event_new = function(arg0) {
3118
+ const ret = Event.__wrap(arg0);
3119
+ return ret;
3120
+ };
3121
+
3122
+ module.exports.__wbg_exportKey_bc8845fdc79b331a = function() { return handleError(function (arg0, arg1, arg2, arg3) {
3123
+ const ret = arg0.exportKey(getStringFromWasm0(arg1, arg2), arg3);
3124
+ return ret;
3125
+ }, arguments) };
3126
+
3127
+ module.exports.__wbg_generateKey_a2091927ceee8225 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3128
+ const ret = arg0.generateKey(getStringFromWasm0(arg1, arg2), arg3 !== 0, arg4);
3129
+ return ret;
3130
+ }, arguments) };
3131
+
3132
+ module.exports.__wbg_generatedocerror_new = function(arg0) {
3133
+ const ret = GenerateDocError.__wrap(arg0);
3134
+ return ret;
3135
+ };
3136
+
3137
+ module.exports.__wbg_generatewebcryptoerror_new = function(arg0) {
3138
+ const ret = GenerateWebCryptoError.__wrap(arg0);
3139
+ return ret;
3140
+ };
3141
+
3142
+ module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
3143
+ arg0.getRandomValues(arg1);
3144
+ }, arguments) };
3145
+
3146
+ module.exports.__wbg_getprivatekey_68c3f491137f7d42 = function(arg0) {
3147
+ const ret = arg0.privateKey;
3148
+ return ret;
3149
+ };
3150
+
3151
+ module.exports.__wbg_getpublickey_395decee9eaded1e = function(arg0) {
3152
+ const ret = arg0.publicKey;
3153
+ return ret;
3154
+ };
3155
+
3156
+ module.exports.__wbg_group_new = function(arg0) {
3157
+ const ret = Group.__wrap(arg0);
3158
+ return ret;
3159
+ };
3160
+
3161
+ module.exports.__wbg_instanceof_Window_7f29e5c72acbfd60 = function(arg0) {
3162
+ let result;
3163
+ try {
3164
+ result = arg0 instanceof Window;
3165
+ } catch (_) {
3166
+ result = false;
3167
+ }
3168
+ const ret = result;
3169
+ return ret;
3170
+ };
3171
+
3172
+ module.exports.__wbg_jsdecrypterror_new = function(arg0) {
3173
+ const ret = JsDecryptError.__wrap(arg0);
3174
+ return ret;
3175
+ };
3176
+
3177
+ module.exports.__wbg_jsencrypterror_new = function(arg0) {
3178
+ const ret = JsEncryptError.__wrap(arg0);
3179
+ return ret;
3180
+ };
3181
+
3182
+ module.exports.__wbg_jsreceiveprekeyoperror_new = function(arg0) {
3183
+ const ret = JsReceivePreKeyOpError.__wrap(arg0);
3184
+ return ret;
3185
+ };
3186
+
3187
+ module.exports.__wbg_keyhive_new = function(arg0) {
3188
+ const ret = Keyhive.__wrap(arg0);
3189
+ return ret;
3190
+ };
3191
+
3192
+ module.exports.__wbg_length_904c0910ed998bf3 = function(arg0) {
3193
+ const ret = arg0.length;
3194
+ return ret;
3195
+ };
3196
+
3197
+ module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
3198
+ const ret = arg0.msCrypto;
3199
+ return ret;
3200
+ };
3201
+
3202
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
3203
+ const ret = new Error();
3204
+ return ret;
3205
+ };
3206
+
3207
+ module.exports.__wbg_new_9190433fb67ed635 = function(arg0) {
3208
+ const ret = new Uint8Array(arg0);
3209
+ return ret;
3210
+ };
3211
+
3212
+ module.exports.__wbg_new_d5e3800b120e37e1 = function(arg0, arg1) {
3213
+ try {
3214
+ var state0 = {a: arg0, b: arg1};
3215
+ var cb0 = (arg0, arg1) => {
3216
+ const a = state0.a;
3217
+ state0.a = 0;
3218
+ try {
3219
+ return __wbg_adapter_269(a, state0.b, arg0, arg1);
3220
+ } finally {
3221
+ state0.a = a;
3222
+ }
3223
+ };
3224
+ const ret = new Promise(cb0);
3225
+ return ret;
3226
+ } finally {
3227
+ state0.a = state0.b = 0;
3228
+ }
3229
+ };
3230
+
3231
+ module.exports.__wbg_newnoargs_a81330f6e05d8aca = function(arg0, arg1) {
3232
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
3233
+ return ret;
3234
+ };
3235
+
3236
+ module.exports.__wbg_newwithlength_ed0ee6c1edca86fc = function(arg0) {
3237
+ const ret = new Uint8Array(arg0 >>> 0);
3238
+ return ret;
3239
+ };
3240
+
3241
+ module.exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
3242
+ const ret = arg0.node;
3243
+ return ret;
3244
+ };
3245
+
3246
+ module.exports.__wbg_peer_unwrap = function(arg0) {
3247
+ const ret = Peer.__unwrap(arg0);
3248
+ return ret;
3249
+ };
3250
+
3251
+ module.exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
3252
+ const ret = arg0.process;
3253
+ return ret;
3254
+ };
3255
+
3256
+ module.exports.__wbg_prototypesetcall_c5f74efd31aea86b = function(arg0, arg1, arg2) {
3257
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
3258
+ };
3259
+
3260
+ module.exports.__wbg_queueMicrotask_bcc6e26d899696db = function(arg0) {
3261
+ const ret = arg0.queueMicrotask;
3262
+ return ret;
3263
+ };
3264
+
3265
+ module.exports.__wbg_queueMicrotask_f24a794d09c42640 = function(arg0) {
3266
+ queueMicrotask(arg0);
3267
+ };
3268
+
3269
+ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
3270
+ arg0.randomFillSync(arg1);
3271
+ }, arguments) };
3272
+
3273
+ module.exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
3274
+ const ret = module.require;
3275
+ return ret;
3276
+ }, arguments) };
3277
+
3278
+ module.exports.__wbg_resolve_5775c0ef9222f556 = function(arg0) {
3279
+ const ret = Promise.resolve(arg0);
3280
+ return ret;
3281
+ };
3282
+
3283
+ module.exports.__wbg_revokemembererror_new = function(arg0) {
3284
+ const ret = RevokeMemberError.__wrap(arg0);
3285
+ return ret;
3286
+ };
3287
+
3288
+ module.exports.__wbg_serializationerror_new = function(arg0) {
3289
+ const ret = SerializationError.__wrap(arg0);
3290
+ return ret;
3291
+ };
3292
+
3293
+ module.exports.__wbg_sharekey_new = function(arg0) {
3294
+ const ret = ShareKey.__wrap(arg0);
3295
+ return ret;
3296
+ };
3297
+
3298
+ module.exports.__wbg_sign_57acde3c6437bdd1 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3299
+ const ret = arg0.sign(arg1, arg2, getArrayU8FromWasm0(arg3, arg4));
3300
+ return ret;
3301
+ }, arguments) };
3302
+
3303
+ module.exports.__wbg_signed_new = function(arg0) {
3304
+ const ret = Signed.__wrap(arg0);
3305
+ return ret;
3306
+ };
3307
+
3308
+ module.exports.__wbg_signeddelegation_new = function(arg0) {
3309
+ const ret = SignedDelegation.__wrap(arg0);
3310
+ return ret;
3311
+ };
3312
+
3313
+ module.exports.__wbg_signedrevocation_new = function(arg0) {
3314
+ const ret = SignedRevocation.__wrap(arg0);
3315
+ return ret;
3316
+ };
3317
+
3318
+ module.exports.__wbg_signer_new = function(arg0) {
3319
+ const ret = Signer.__wrap(arg0);
3320
+ return ret;
3321
+ };
3322
+
3323
+ module.exports.__wbg_signingerror_new = function(arg0) {
3324
+ const ret = SigningError.__wrap(arg0);
3325
+ return ret;
3326
+ };
3327
+
3328
+ module.exports.__wbg_simplecapability_new = function(arg0) {
3329
+ const ret = SimpleCapability.__wrap(arg0);
3330
+ return ret;
3331
+ };
3332
+
3333
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
3334
+ const ret = arg1.stack;
3335
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3336
+ const len1 = WASM_VECTOR_LEN;
3337
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3338
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3339
+ };
3340
+
3341
+ module.exports.__wbg_static_accessor_GLOBAL_1f13249cc3acc96d = function() {
3342
+ const ret = typeof global === 'undefined' ? null : global;
3343
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3344
+ };
3345
+
3346
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_df7ae94b1e0ed6a3 = function() {
3347
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
3348
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3349
+ };
3350
+
3351
+ module.exports.__wbg_static_accessor_SELF_6265471db3b3c228 = function() {
3352
+ const ret = typeof self === 'undefined' ? null : self;
3353
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3354
+ };
3355
+
3356
+ module.exports.__wbg_static_accessor_WINDOW_16fb482f8ec52863 = function() {
3357
+ const ret = typeof window === 'undefined' ? null : window;
3358
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3359
+ };
3360
+
3361
+ module.exports.__wbg_subarray_a219824899e59712 = function(arg0, arg1, arg2) {
3362
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
3363
+ return ret;
3364
+ };
3365
+
3366
+ module.exports.__wbg_subtle_40dd37072861a308 = function(arg0) {
3367
+ const ret = arg0.subtle;
3368
+ return ret;
3369
+ };
3370
+
3371
+ module.exports.__wbg_summary_new = function(arg0) {
3372
+ const ret = Summary.__wrap(arg0);
3373
+ return ret;
3374
+ };
3375
+
3376
+ module.exports.__wbg_then_8d2fcccde5380a03 = function(arg0, arg1, arg2) {
3377
+ const ret = arg0.then(arg1, arg2);
3378
+ return ret;
3379
+ };
3380
+
3381
+ module.exports.__wbg_then_9cc266be2bf537b6 = function(arg0, arg1) {
3382
+ const ret = arg0.then(arg1);
3383
+ return ret;
3384
+ };
3385
+
3386
+ module.exports.__wbg_tryfromarchiveerror_new = function(arg0) {
3387
+ const ret = TryFromArchiveError.__wrap(arg0);
3388
+ return ret;
3389
+ };
3390
+
3391
+ module.exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
3392
+ const ret = arg0.versions;
3393
+ return ret;
3394
+ };
3395
+
3396
+ module.exports.__wbg_wbindgencbdrop_a85ed476c6a370b9 = function(arg0) {
3397
+ const obj = arg0.original;
3398
+ if (obj.cnt-- == 1) {
3399
+ obj.a = 0;
3400
+ return true;
3401
+ }
3402
+ const ret = false;
3403
+ return ret;
3404
+ };
3405
+
3406
+ module.exports.__wbg_wbindgendebugstring_bb652b1bc2061b6d = function(arg0, arg1) {
3407
+ const ret = debugString(arg1);
3408
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3409
+ const len1 = WASM_VECTOR_LEN;
3410
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3411
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3412
+ };
3413
+
3414
+ module.exports.__wbg_wbindgenisfunction_ea72b9d66a0e1705 = function(arg0) {
3415
+ const ret = typeof(arg0) === 'function';
3416
+ return ret;
3417
+ };
3418
+
3419
+ module.exports.__wbg_wbindgenisobject_dfe064a121d87553 = function(arg0) {
3420
+ const val = arg0;
3421
+ const ret = typeof(val) === 'object' && val !== null;
3422
+ return ret;
3423
+ };
3424
+
3425
+ module.exports.__wbg_wbindgenisstring_4b74e4111ba029e6 = function(arg0) {
3426
+ const ret = typeof(arg0) === 'string';
3427
+ return ret;
3428
+ };
3429
+
3430
+ module.exports.__wbg_wbindgenisundefined_71f08a6ade4354e7 = function(arg0) {
3431
+ const ret = arg0 === undefined;
3432
+ return ret;
3433
+ };
3434
+
3435
+ module.exports.__wbg_wbindgenthrow_4c11a24fca429ccf = function(arg0, arg1) {
3436
+ throw new Error(getStringFromWasm0(arg0, arg1));
3437
+ };
3438
+
3439
+ module.exports.__wbindgen_cast_068e29f6a3bbf711 = function(arg0, arg1) {
3440
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 387, function: Function { arguments: [Externref], shim_idx: 388, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3441
+ const ret = makeMutClosure(arg0, arg1, 387, __wbg_adapter_12);
3442
+ return ret;
3443
+ };
3444
+
3445
+ module.exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
3446
+ // Cast intrinsic for `Ref(String) -> Externref`.
3447
+ const ret = getStringFromWasm0(arg0, arg1);
3448
+ return ret;
3449
+ };
3450
+
3451
+ module.exports.__wbindgen_cast_25a0a844437d0e92 = function(arg0, arg1) {
3452
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3453
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3454
+ // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3455
+ const ret = v0;
3456
+ return ret;
3457
+ };
3458
+
3459
+ module.exports.__wbindgen_cast_ae91babfc5c19b28 = function(arg0, arg1) {
3460
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3461
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3462
+ // Cast intrinsic for `Vector(NamedExternref("SignedRevocation")) -> Externref`.
3463
+ const ret = v0;
3464
+ return ret;
3465
+ };
3466
+
3467
+ module.exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
3468
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
3469
+ const ret = getArrayU8FromWasm0(arg0, arg1);
3470
+ return ret;
3471
+ };
3472
+
3473
+ module.exports.__wbindgen_init_externref_table = function() {
3474
+ const table = wasm.__wbindgen_export_2;
3475
+ const offset = table.grow(4);
3476
+ table.set(0, undefined);
3477
+ table.set(offset + 0, undefined);
3478
+ table.set(offset + 1, null);
3479
+ table.set(offset + 2, true);
3480
+ table.set(offset + 3, false);
3481
+ ;
3482
+ };
3483
+
3484
+ const path = require('path').join(__dirname, 'keyhive_wasm_bg.wasm');
3485
+ const bytes = require('fs').readFileSync(path);
3486
+
3487
+ const wasmModule = new WebAssembly.Module(bytes);
3488
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
3489
+ wasm = wasmInstance.exports;
3490
+ module.exports.__wasm = wasm;
3491
+
3492
+ wasm.__wbindgen_start();
3493
+