@keyhive/keyhive 0.0.0-alpha.9 → 0.1.0-alpha.3

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