@wireapp/core-crypto 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -243,7 +243,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
243
243
  function __wbg_adapter_40(arg0, arg1, arg2) {
244
244
  try {
245
245
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
246
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbae3a5a03bcd9ebb(retptr, arg0, arg1, addHeapObject(arg2));
246
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4ef8a84fbdc05598(retptr, arg0, arg1, addHeapObject(arg2));
247
247
  var r0 = getInt32Memory0()[retptr / 4 + 0];
248
248
  var r1 = getInt32Memory0()[retptr / 4 + 1];
249
249
  if (r1) {
@@ -255,7 +255,7 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
255
255
  }
256
256
 
257
257
  function __wbg_adapter_43(arg0, arg1, arg2) {
258
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04f9c855c75e5606(arg0, arg1, addHeapObject(arg2));
258
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb3da4d47c0d5214a(arg0, arg1, addHeapObject(arg2));
259
259
  }
260
260
 
261
261
  /**
@@ -318,8 +318,8 @@ function handleError(f, args) {
318
318
  function getArrayU8FromWasm0(ptr, len) {
319
319
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
320
320
  }
321
- function __wbg_adapter_176(arg0, arg1, arg2, arg3) {
322
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h4791cbe418449d5d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
321
+ function __wbg_adapter_175(arg0, arg1, arg2, arg3) {
322
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__hdd7aeb05a0912a93(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
323
323
  }
324
324
 
325
325
  /**
@@ -956,10 +956,10 @@ class CoreCryptoWasmCallbacks {
956
956
  }
957
957
  /**
958
958
  * @param {Function} authorize
959
- * @param {Function} is_user_in_group
959
+ * @param {Function} client_id_belongs_to_one_of
960
960
  */
961
- constructor(authorize, is_user_in_group) {
962
- const ret = wasm$1.corecryptowasmcallbacks_new(addHeapObject(authorize), addHeapObject(is_user_in_group));
961
+ constructor(authorize, client_id_belongs_to_one_of) {
962
+ const ret = wasm$1.corecryptowasmcallbacks_new(addHeapObject(authorize), addHeapObject(client_id_belongs_to_one_of));
963
963
  return CoreCryptoWasmCallbacks.__wrap(ret);
964
964
  }
965
965
  }
@@ -968,13 +968,6 @@ class CoreCryptoWasmCallbacks {
968
968
  */
969
969
  class DecryptedMessage {
970
970
 
971
- static __wrap(ptr) {
972
- const obj = Object.create(DecryptedMessage.prototype);
973
- obj.ptr = ptr;
974
-
975
- return obj;
976
- }
977
-
978
971
  __destroy_into_raw() {
979
972
  const ptr = this.ptr;
980
973
  this.ptr = 0;
@@ -1021,6 +1014,13 @@ class DecryptedMessage {
1021
1014
  wasm$1.__wbindgen_add_to_stack_pointer(16);
1022
1015
  }
1023
1016
  }
1017
+ /**
1018
+ * @returns {Uint8Array | undefined}
1019
+ */
1020
+ get sender_client_id() {
1021
+ const ret = wasm$1.decryptedmessage_sender_client_id(this.ptr);
1022
+ return takeObject(ret);
1023
+ }
1024
1024
  }
1025
1025
  /**
1026
1026
  * see [core_crypto::prelude::ConversationMember]
@@ -1236,55 +1236,50 @@ function getImports() {
1236
1236
  const ret = typeof(val) === 'object' && val !== null;
1237
1237
  return ret;
1238
1238
  };
1239
- imports.wbg.__wbg_new_e6a9fecc2bf26696 = function() {
1240
- const ret = new Object();
1241
- return addHeapObject(ret);
1242
- };
1243
- imports.wbg.__wbg_set_e93b31d47b90bff6 = function(arg0, arg1, arg2) {
1244
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1245
- };
1246
1239
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1247
1240
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1248
1241
  return addHeapObject(ret);
1249
1242
  };
1250
- imports.wbg.__wbg_new0_adda2d4bcb124f0a = function() {
1243
+ imports.wbg.__wbg_new0_a57059d72c5b7aee = function() {
1251
1244
  const ret = new Date();
1252
1245
  return addHeapObject(ret);
1253
1246
  };
1254
- imports.wbg.__wbg_getTime_58b0bdbebd4ef11d = function(arg0) {
1247
+ imports.wbg.__wbg_getTime_cb82adb2556ed13e = function(arg0) {
1255
1248
  const ret = getObject(arg0).getTime();
1256
1249
  return ret;
1257
1250
  };
1258
- imports.wbg.__wbg_new_cda198d9dbc6d7ea = function(arg0) {
1251
+ imports.wbg.__wbg_set_c943d600fa71e4dd = function(arg0, arg1, arg2) {
1252
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1253
+ };
1254
+ imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
1259
1255
  const ret = new Uint8Array(getObject(arg0));
1260
1256
  return addHeapObject(ret);
1261
1257
  };
1262
- imports.wbg.__wbg_corecrypto_new = function(arg0) {
1263
- const ret = CoreCrypto$1.__wrap(arg0);
1258
+ imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
1259
+ const ret = new Array();
1264
1260
  return addHeapObject(ret);
1265
1261
  };
1266
- imports.wbg.__wbindgen_number_new = function(arg0) {
1267
- const ret = arg0;
1268
- return addHeapObject(ret);
1262
+ imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
1263
+ const ret = getObject(arg0).push(getObject(arg1));
1264
+ return ret;
1269
1265
  };
1270
- imports.wbg.__wbindgen_bigint_new = function(arg0, arg1) {
1271
- const ret = BigInt(getStringFromWasm0(arg0, arg1));
1266
+ imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
1267
+ const ret = new Object();
1272
1268
  return addHeapObject(ret);
1273
1269
  };
1274
- imports.wbg.__wbg_decryptedmessage_new = function(arg0) {
1275
- const ret = DecryptedMessage.__wrap(arg0);
1276
- return addHeapObject(ret);
1270
+ imports.wbg.__wbg_set_a68214f35c417fa9 = function(arg0, arg1, arg2) {
1271
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1277
1272
  };
1278
- imports.wbg.__wbg_new_ee1a3da85465d621 = function() {
1279
- const ret = new Array();
1273
+ imports.wbg.__wbindgen_number_new = function(arg0) {
1274
+ const ret = arg0;
1280
1275
  return addHeapObject(ret);
1281
1276
  };
1282
- imports.wbg.__wbg_push_0bc7fce4a139a883 = function(arg0, arg1) {
1283
- const ret = getObject(arg0).push(getObject(arg1));
1284
- return ret;
1277
+ imports.wbg.__wbg_corecrypto_new = function(arg0) {
1278
+ const ret = CoreCrypto$1.__wrap(arg0);
1279
+ return addHeapObject(ret);
1285
1280
  };
1286
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1287
- const ret = getStringFromWasm0(arg0, arg1);
1281
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1282
+ const ret = BigInt.asUintN(64, arg0);
1288
1283
  return addHeapObject(ret);
1289
1284
  };
1290
1285
  imports.wbg.__wbindgen_boolean_get = function(arg0) {
@@ -1292,14 +1287,14 @@ function getImports() {
1292
1287
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1293
1288
  return ret;
1294
1289
  };
1295
- imports.wbg.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
1290
+ imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
1296
1291
  try {
1297
1292
  var state0 = {a: arg0, b: arg1};
1298
1293
  var cb0 = (arg0, arg1) => {
1299
1294
  const a = state0.a;
1300
1295
  state0.a = 0;
1301
1296
  try {
1302
- return __wbg_adapter_176(a, state0.b, arg0, arg1);
1297
+ return __wbg_adapter_175(a, state0.b, arg0, arg1);
1303
1298
  } finally {
1304
1299
  state0.a = a;
1305
1300
  }
@@ -1314,23 +1309,23 @@ function getImports() {
1314
1309
  const ret = ProposalBundle.__wrap(arg0);
1315
1310
  return addHeapObject(ret);
1316
1311
  };
1317
- imports.wbg.__wbg_get_093fe3cdafaf8976 = function(arg0, arg1) {
1312
+ imports.wbg.__wbg_get_2268d91a19a98b92 = function(arg0, arg1) {
1318
1313
  const ret = getObject(arg0)[takeObject(arg1)];
1319
1314
  return addHeapObject(ret);
1320
1315
  };
1321
- imports.wbg.__wbg_isArray_a1a8c3a8ac24bdf1 = function(arg0) {
1316
+ imports.wbg.__wbg_isArray_27c46c67f498e15d = function(arg0) {
1322
1317
  const ret = Array.isArray(getObject(arg0));
1323
1318
  return ret;
1324
1319
  };
1325
- imports.wbg.__wbg_length_a73bfd4c96dd97ef = function(arg0) {
1320
+ imports.wbg.__wbg_length_6e3bbe7c8bd4dbd8 = function(arg0) {
1326
1321
  const ret = getObject(arg0).length;
1327
1322
  return ret;
1328
1323
  };
1329
- imports.wbg.__wbg_iterator_22ed2b976832ff0c = function() {
1324
+ imports.wbg.__wbg_iterator_6f9d4f28845f426c = function() {
1330
1325
  const ret = Symbol.iterator;
1331
1326
  return addHeapObject(ret);
1332
1327
  };
1333
- imports.wbg.__wbg_get_72332cd2bc57924c = function() { return handleError(function (arg0, arg1) {
1328
+ imports.wbg.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
1334
1329
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1335
1330
  return addHeapObject(ret);
1336
1331
  }, arguments) };
@@ -1338,23 +1333,23 @@ function getImports() {
1338
1333
  const ret = typeof(getObject(arg0)) === 'function';
1339
1334
  return ret;
1340
1335
  };
1341
- imports.wbg.__wbg_call_33d7bcddbbfa394a = function() { return handleError(function (arg0, arg1) {
1336
+ imports.wbg.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
1342
1337
  const ret = getObject(arg0).call(getObject(arg1));
1343
1338
  return addHeapObject(ret);
1344
1339
  }, arguments) };
1345
- imports.wbg.__wbg_next_726d1c2255989269 = function(arg0) {
1340
+ imports.wbg.__wbg_next_579e583d33566a86 = function(arg0) {
1346
1341
  const ret = getObject(arg0).next;
1347
1342
  return addHeapObject(ret);
1348
1343
  };
1349
- imports.wbg.__wbg_next_3d0c4cc33e7418c9 = function() { return handleError(function (arg0) {
1344
+ imports.wbg.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
1350
1345
  const ret = getObject(arg0).next();
1351
1346
  return addHeapObject(ret);
1352
1347
  }, arguments) };
1353
- imports.wbg.__wbg_done_e5655b169bb04f60 = function(arg0) {
1348
+ imports.wbg.__wbg_done_1b73b0672e15f234 = function(arg0) {
1354
1349
  const ret = getObject(arg0).done;
1355
1350
  return ret;
1356
1351
  };
1357
- imports.wbg.__wbg_value_8f901bca1014f843 = function(arg0) {
1352
+ imports.wbg.__wbg_value_1ccc36bc03462d71 = function(arg0) {
1358
1353
  const ret = getObject(arg0).value;
1359
1354
  return addHeapObject(ret);
1360
1355
  };
@@ -1364,11 +1359,11 @@ function getImports() {
1364
1359
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1365
1360
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1366
1361
  };
1367
- imports.wbg.__wbg_isSafeInteger_f6dd91807e9c4d35 = function(arg0) {
1362
+ imports.wbg.__wbg_isSafeInteger_dfa0593e8d7ac35a = function(arg0) {
1368
1363
  const ret = Number.isSafeInteger(getObject(arg0));
1369
1364
  return ret;
1370
1365
  };
1371
- imports.wbg.__wbg_get_ad41fee29b7e0f53 = function(arg0, arg1) {
1366
+ imports.wbg.__wbg_get_57245cc7d7c7619d = function(arg0, arg1) {
1372
1367
  const ret = getObject(arg0)[arg1 >>> 0];
1373
1368
  return addHeapObject(ret);
1374
1369
  };
@@ -1388,20 +1383,21 @@ function getImports() {
1388
1383
  const ret = getObject(arg0) === undefined;
1389
1384
  return ret;
1390
1385
  };
1391
- imports.wbg.__wbg_name_f232931b09239ddb = function(arg0, arg1) {
1386
+ imports.wbg.__wbg_name_ebb75bfad2bf6938 = function(arg0, arg1) {
1392
1387
  const ret = getObject(arg1).name;
1393
1388
  const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1394
1389
  const len0 = WASM_VECTOR_LEN;
1395
1390
  getInt32Memory0()[arg0 / 4 + 1] = len0;
1396
1391
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
1397
1392
  };
1398
- imports.wbg.__wbg_transaction_0dcffc72158c7b6f = function() { return handleError(function (arg0, arg1, arg2) {
1393
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1394
+ const ret = getStringFromWasm0(arg0, arg1);
1395
+ return addHeapObject(ret);
1396
+ };
1397
+ imports.wbg.__wbg_transaction_83b53b72aa710599 = function() { return handleError(function (arg0, arg1, arg2) {
1399
1398
  const ret = getObject(arg0).transaction(getObject(arg1), takeObject(arg2));
1400
1399
  return addHeapObject(ret);
1401
1400
  }, arguments) };
1402
- imports.wbg.__wbg_set_64cc39858b2ec3f1 = function(arg0, arg1, arg2) {
1403
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1404
- };
1405
1401
  imports.wbg.__wbindgen_cb_drop = function(arg0) {
1406
1402
  const obj = takeObject(arg0).original;
1407
1403
  if (obj.cnt-- == 1) {
@@ -1411,106 +1407,106 @@ function getImports() {
1411
1407
  const ret = false;
1412
1408
  return ret;
1413
1409
  };
1414
- imports.wbg.__wbg_setonsuccess_bb91afe1f8110021 = function(arg0, arg1) {
1410
+ imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
1411
+ const ret = getObject(arg0).get(getObject(arg1));
1412
+ return addHeapObject(ret);
1413
+ }, arguments) };
1414
+ imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
1415
1415
  getObject(arg0).onsuccess = getObject(arg1);
1416
1416
  };
1417
- imports.wbg.__wbg_setonerror_db491b84dd45e918 = function(arg0, arg1) {
1417
+ imports.wbg.__wbg_setonerror_d5771cc5bf9ea74c = function(arg0, arg1) {
1418
1418
  getObject(arg0).onerror = getObject(arg1);
1419
1419
  };
1420
- imports.wbg.__wbg_commit_6211fe2744b83edc = function() { return handleError(function (arg0) {
1420
+ imports.wbg.__wbg_commit_73ecc83e291e455b = function() { return handleError(function (arg0) {
1421
1421
  getObject(arg0).commit();
1422
1422
  }, arguments) };
1423
- imports.wbg.__wbg_setoncomplete_8bfbade4ed628fd0 = function(arg0, arg1) {
1423
+ imports.wbg.__wbg_setoncomplete_3e57a8cec8327f66 = function(arg0, arg1) {
1424
1424
  getObject(arg0).oncomplete = getObject(arg1);
1425
1425
  };
1426
- imports.wbg.__wbg_setonerror_9d842115702fd223 = function(arg0, arg1) {
1426
+ imports.wbg.__wbg_setonerror_00051c0213f27b2c = function(arg0, arg1) {
1427
1427
  getObject(arg0).onerror = getObject(arg1);
1428
1428
  };
1429
- imports.wbg.__wbg_put_e193e5c9c96e937f = function() { return handleError(function (arg0, arg1, arg2) {
1430
- const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
1429
+ imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
1430
+ const ret = getObject(arg0).delete(getObject(arg1));
1431
1431
  return addHeapObject(ret);
1432
1432
  }, arguments) };
1433
- imports.wbg.__wbg_put_a727d1fdb5788ec1 = function() { return handleError(function (arg0, arg1) {
1434
- const ret = getObject(arg0).put(getObject(arg1));
1433
+ imports.wbg.__wbg_get_3c3e41997e95952c = function() { return handleError(function (arg0, arg1) {
1434
+ const ret = getObject(arg0).get(getObject(arg1));
1435
1435
  return addHeapObject(ret);
1436
1436
  }, arguments) };
1437
- imports.wbg.__wbg_delete_1ca98818fdc40291 = function() { return handleError(function (arg0, arg1) {
1438
- const ret = getObject(arg0).delete(getObject(arg1));
1437
+ imports.wbg.__wbg_openCursor_2262d905dc81d11b = function() { return handleError(function (arg0) {
1438
+ const ret = getObject(arg0).openCursor();
1439
1439
  return addHeapObject(ret);
1440
1440
  }, arguments) };
1441
- imports.wbg.__wbg_deleteDatabase_7b98d08298856363 = function() { return handleError(function (arg0, arg1, arg2) {
1442
- const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1441
+ imports.wbg.__wbg_openCursor_e1660ef8b1f4662f = function() { return handleError(function (arg0, arg1) {
1442
+ const ret = getObject(arg0).openCursor(getObject(arg1));
1443
1443
  return addHeapObject(ret);
1444
1444
  }, arguments) };
1445
- imports.wbg.__wbg_close_87495affacd7f79d = function(arg0) {
1446
- getObject(arg0).close();
1447
- };
1448
- imports.wbg.__wbg_openCursor_4292a52d0e6d4246 = function() { return handleError(function (arg0, arg1) {
1449
- const ret = getObject(arg0).openCursor(getObject(arg1));
1445
+ imports.wbg.__wbg_put_84e7fc93eee27b28 = function() { return handleError(function (arg0, arg1, arg2) {
1446
+ const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
1450
1447
  return addHeapObject(ret);
1451
1448
  }, arguments) };
1452
- imports.wbg.__wbg_openCursor_10a7a7a41fce054c = function() { return handleError(function (arg0) {
1453
- const ret = getObject(arg0).openCursor();
1449
+ imports.wbg.__wbg_put_f2763b05a07f3233 = function() { return handleError(function (arg0, arg1) {
1450
+ const ret = getObject(arg0).put(getObject(arg1));
1454
1451
  return addHeapObject(ret);
1455
1452
  }, arguments) };
1456
- imports.wbg.__wbg_count_6f4c35312ff0234d = function() { return handleError(function (arg0) {
1453
+ imports.wbg.__wbg_count_b0e88953a0ea909c = function() { return handleError(function (arg0) {
1457
1454
  const ret = getObject(arg0).count();
1458
1455
  return addHeapObject(ret);
1459
1456
  }, arguments) };
1460
- imports.wbg.__wbg_count_ea5300005a5f227d = function() { return handleError(function (arg0, arg1) {
1457
+ imports.wbg.__wbg_count_46eda68a16dbe30e = function() { return handleError(function (arg0, arg1) {
1461
1458
  const ret = getObject(arg0).count(getObject(arg1));
1462
1459
  return addHeapObject(ret);
1463
1460
  }, arguments) };
1464
- imports.wbg.__wbg_get_28f9ffc7eb5802f3 = function() { return handleError(function (arg0, arg1) {
1465
- const ret = getObject(arg0).get(getObject(arg1));
1466
- return addHeapObject(ret);
1467
- }, arguments) };
1468
- imports.wbg.__wbg_get_a06b4198f86b037d = function() { return handleError(function (arg0, arg1) {
1469
- const ret = getObject(arg0).get(getObject(arg1));
1461
+ imports.wbg.__wbg_openCursor_e036069f0e326708 = function() { return handleError(function (arg0, arg1) {
1462
+ const ret = getObject(arg0).openCursor(getObject(arg1));
1470
1463
  return addHeapObject(ret);
1471
1464
  }, arguments) };
1472
- imports.wbg.__wbg_openCursor_a9656bd0901e39c0 = function() { return handleError(function (arg0) {
1465
+ imports.wbg.__wbg_openCursor_f055654a98eeab7f = function() { return handleError(function (arg0) {
1473
1466
  const ret = getObject(arg0).openCursor();
1474
1467
  return addHeapObject(ret);
1475
1468
  }, arguments) };
1476
- imports.wbg.__wbg_openCursor_2cfe2e04de0b6b91 = function() { return handleError(function (arg0, arg1) {
1477
- const ret = getObject(arg0).openCursor(getObject(arg1));
1478
- return addHeapObject(ret);
1479
- }, arguments) };
1480
- imports.wbg.__wbg_open_2a1e9120d3d8897d = function() { return handleError(function (arg0, arg1, arg2) {
1469
+ imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
1481
1470
  const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
1482
1471
  return addHeapObject(ret);
1483
1472
  }, arguments) };
1484
- imports.wbg.__wbg_open_3384efa97bde264f = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1473
+ imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1485
1474
  const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
1486
1475
  return addHeapObject(ret);
1487
1476
  }, arguments) };
1488
- imports.wbg.__wbg_setonupgradeneeded_8956d6214819f478 = function(arg0, arg1) {
1477
+ imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
1489
1478
  getObject(arg0).onupgradeneeded = getObject(arg1);
1490
1479
  };
1491
- imports.wbg.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
1480
+ imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
1481
+ const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1482
+ return addHeapObject(ret);
1483
+ }, arguments) };
1484
+ imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
1485
+ getObject(arg0).close();
1486
+ };
1487
+ imports.wbg.__wbg_randomFillSync_065afffde01daa66 = function() { return handleError(function (arg0, arg1, arg2) {
1492
1488
  getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
1493
1489
  }, arguments) };
1494
- imports.wbg.__wbg_subarray_270ff8dd5582c1ac = function(arg0, arg1, arg2) {
1490
+ imports.wbg.__wbg_subarray_58ad4efbb5bcb886 = function(arg0, arg1, arg2) {
1495
1491
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1496
1492
  return addHeapObject(ret);
1497
1493
  };
1498
- imports.wbg.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
1494
+ imports.wbg.__wbg_getRandomValues_b99eec4244a475bb = function() { return handleError(function (arg0, arg1) {
1499
1495
  getObject(arg0).getRandomValues(getObject(arg1));
1500
1496
  }, arguments) };
1501
- imports.wbg.__wbg_length_51f19f73d6d9eff3 = function(arg0) {
1497
+ imports.wbg.__wbg_length_9e1ae1900cb0fbd5 = function(arg0) {
1502
1498
  const ret = getObject(arg0).length;
1503
1499
  return ret;
1504
1500
  };
1505
- imports.wbg.__wbg_process_e56fd54cf6319b6c = function(arg0) {
1501
+ imports.wbg.__wbg_process_0cc2ada8524d6f83 = function(arg0) {
1506
1502
  const ret = getObject(arg0).process;
1507
1503
  return addHeapObject(ret);
1508
1504
  };
1509
- imports.wbg.__wbg_versions_77e21455908dad33 = function(arg0) {
1505
+ imports.wbg.__wbg_versions_c11acceab27a6c87 = function(arg0) {
1510
1506
  const ret = getObject(arg0).versions;
1511
1507
  return addHeapObject(ret);
1512
1508
  };
1513
- imports.wbg.__wbg_node_0dd25d832e4785d5 = function(arg0) {
1509
+ imports.wbg.__wbg_node_7ff1ce49caf23815 = function(arg0) {
1514
1510
  const ret = getObject(arg0).node;
1515
1511
  return addHeapObject(ret);
1516
1512
  };
@@ -1518,55 +1514,55 @@ function getImports() {
1518
1514
  const ret = typeof(getObject(arg0)) === 'string';
1519
1515
  return ret;
1520
1516
  };
1521
- imports.wbg.__wbg_static_accessor_NODE_MODULE_26b231378c1be7dd = function() {
1517
+ imports.wbg.__wbg_static_accessor_NODE_MODULE_cf6401cc1091279e = function() {
1522
1518
  const ret = module;
1523
1519
  return addHeapObject(ret);
1524
1520
  };
1525
- imports.wbg.__wbg_require_0db1598d9ccecb30 = function() { return handleError(function (arg0, arg1, arg2) {
1521
+ imports.wbg.__wbg_require_a746e79b322b9336 = function() { return handleError(function (arg0, arg1, arg2) {
1526
1522
  const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
1527
1523
  return addHeapObject(ret);
1528
1524
  }, arguments) };
1529
- imports.wbg.__wbg_crypto_b95d7173266618a9 = function(arg0) {
1525
+ imports.wbg.__wbg_crypto_2036bed7c44c25e7 = function(arg0) {
1530
1526
  const ret = getObject(arg0).crypto;
1531
1527
  return addHeapObject(ret);
1532
1528
  };
1533
- imports.wbg.__wbg_msCrypto_5a86d77a66230f81 = function(arg0) {
1529
+ imports.wbg.__wbg_msCrypto_a21fc88caf1ecdc8 = function(arg0) {
1534
1530
  const ret = getObject(arg0).msCrypto;
1535
1531
  return addHeapObject(ret);
1536
1532
  };
1537
- imports.wbg.__wbg_newwithlength_66e5530e7079ea1b = function(arg0) {
1533
+ imports.wbg.__wbg_newwithlength_f5933855e4f48a19 = function(arg0) {
1538
1534
  const ret = new Uint8Array(arg0 >>> 0);
1539
1535
  return addHeapObject(ret);
1540
1536
  };
1541
- imports.wbg.__wbg_self_fd00a1ef86d1b2ed = function() { return handleError(function () {
1537
+ imports.wbg.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
1542
1538
  const ret = self.self;
1543
1539
  return addHeapObject(ret);
1544
1540
  }, arguments) };
1545
- imports.wbg.__wbg_window_6f6e346d8bbd61d7 = function() { return handleError(function () {
1541
+ imports.wbg.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
1546
1542
  const ret = window.window;
1547
1543
  return addHeapObject(ret);
1548
1544
  }, arguments) };
1549
- imports.wbg.__wbg_globalThis_3348936ac49df00a = function() { return handleError(function () {
1545
+ imports.wbg.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
1550
1546
  const ret = globalThis.globalThis;
1551
1547
  return addHeapObject(ret);
1552
1548
  }, arguments) };
1553
- imports.wbg.__wbg_global_67175caf56f55ca9 = function() { return handleError(function () {
1549
+ imports.wbg.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
1554
1550
  const ret = global.global;
1555
1551
  return addHeapObject(ret);
1556
1552
  }, arguments) };
1557
- imports.wbg.__wbg_newnoargs_971e9a5abe185139 = function(arg0, arg1) {
1553
+ imports.wbg.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
1558
1554
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1559
1555
  return addHeapObject(ret);
1560
1556
  };
1561
- imports.wbg.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
1557
+ imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
1562
1558
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1563
1559
  return addHeapObject(ret);
1564
1560
  }, arguments) };
1565
- imports.wbg.__wbg_call_187e4e7f6f4285fb = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1561
+ imports.wbg.__wbg_call_3999bee59e9f7719 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1566
1562
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1567
1563
  return addHeapObject(ret);
1568
1564
  }, arguments) };
1569
- imports.wbg.__wbg_set_2762e698c2f5b7e0 = function() { return handleError(function (arg0, arg1, arg2) {
1565
+ imports.wbg.__wbg_set_bf3f89b92d5a34bf = function() { return handleError(function (arg0, arg1, arg2) {
1570
1566
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1571
1567
  return ret;
1572
1568
  }, arguments) };
@@ -1574,60 +1570,60 @@ function getImports() {
1574
1570
  const ret = wasm$1.memory;
1575
1571
  return addHeapObject(ret);
1576
1572
  };
1577
- imports.wbg.__wbg_buffer_34f5ec9f8a838ba0 = function(arg0) {
1573
+ imports.wbg.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
1578
1574
  const ret = getObject(arg0).buffer;
1579
1575
  return addHeapObject(ret);
1580
1576
  };
1581
- imports.wbg.__wbg_newwithbyteoffsetandlength_88fdad741db1b182 = function(arg0, arg1, arg2) {
1577
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d9aa266703cb98be = function(arg0, arg1, arg2) {
1582
1578
  const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1583
1579
  return addHeapObject(ret);
1584
1580
  };
1585
- imports.wbg.__wbg_set_1a930cfcda1a8067 = function(arg0, arg1, arg2) {
1581
+ imports.wbg.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
1586
1582
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1587
1583
  };
1588
- imports.wbg.__wbg_now_1b6e18d94ce2c037 = function() {
1584
+ imports.wbg.__wbg_now_58886682b7e790d7 = function() {
1589
1585
  const ret = Date.now();
1590
1586
  return ret;
1591
1587
  };
1592
- imports.wbg.__wbg_target_68a5c10e2732a79e = function(arg0) {
1588
+ imports.wbg.__wbg_target_bf704b7db7ad1387 = function(arg0) {
1593
1589
  const ret = getObject(arg0).target;
1594
1590
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1595
1591
  };
1596
- imports.wbg.__wbg_objectStoreNames_d11a3d06e3226638 = function(arg0) {
1592
+ imports.wbg.__wbg_objectStoreNames_8c06c40d2b05141c = function(arg0) {
1597
1593
  const ret = getObject(arg0).objectStoreNames;
1598
1594
  return addHeapObject(ret);
1599
1595
  };
1600
- imports.wbg.__wbg_contains_bcaf1388e1ca982c = function(arg0, arg1, arg2) {
1596
+ imports.wbg.__wbg_contains_6cf516181cd86571 = function(arg0, arg1, arg2) {
1601
1597
  const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
1602
1598
  return ret;
1603
1599
  };
1604
- imports.wbg.__wbg_createObjectStore_454d7cf701faa545 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1600
+ imports.wbg.__wbg_createObjectStore_f4c2f030bc994158 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1605
1601
  const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2), getObject(arg3));
1606
1602
  return addHeapObject(ret);
1607
1603
  }, arguments) };
1608
- imports.wbg.__wbg_transaction_0ba302b35542323f = function(arg0) {
1604
+ imports.wbg.__wbg_transaction_2a414baad674f8d4 = function(arg0) {
1609
1605
  const ret = getObject(arg0).transaction;
1610
1606
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1611
1607
  };
1612
- imports.wbg.__wbg_indexNames_8f97f1f79bc278bf = function(arg0) {
1608
+ imports.wbg.__wbg_indexNames_e6ea7f4d67313c8c = function(arg0) {
1613
1609
  const ret = getObject(arg0).indexNames;
1614
1610
  return addHeapObject(ret);
1615
1611
  };
1616
- imports.wbg.__wbg_createIndex_20c39366f6b22548 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1612
+ imports.wbg.__wbg_createIndex_2e6761d6cd83a0d6 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1617
1613
  const ret = getObject(arg0).createIndex(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
1618
1614
  return addHeapObject(ret);
1619
1615
  }, arguments) };
1620
- imports.wbg.__wbg_length_580a8f6d9757b9da = function(arg0) {
1616
+ imports.wbg.__wbg_length_b59f358f797fd9f4 = function(arg0) {
1621
1617
  const ret = getObject(arg0).length;
1622
1618
  return ret;
1623
1619
  };
1624
- imports.wbg.__wbg_deleteIndex_9d33d4fd04e9038c = function() { return handleError(function (arg0, arg1, arg2) {
1620
+ imports.wbg.__wbg_deleteIndex_2f8e18b00c1554e1 = function() { return handleError(function (arg0, arg1, arg2) {
1625
1621
  getObject(arg0).deleteIndex(getStringFromWasm0(arg1, arg2));
1626
1622
  }, arguments) };
1627
- imports.wbg.__wbg_deleteObjectStore_ec34033b22e0c4e1 = function() { return handleError(function (arg0, arg1, arg2) {
1623
+ imports.wbg.__wbg_deleteObjectStore_1b698c5fd1bc077d = function() { return handleError(function (arg0, arg1, arg2) {
1628
1624
  getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
1629
1625
  }, arguments) };
1630
- imports.wbg.__wbg_error_c872d3f7251736f1 = function() { return handleError(function (arg0) {
1626
+ imports.wbg.__wbg_error_aacf5ac191e54ed0 = function() { return handleError(function (arg0) {
1631
1627
  const ret = getObject(arg0).error;
1632
1628
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1633
1629
  }, arguments) };
@@ -1635,38 +1631,56 @@ function getImports() {
1635
1631
  const ret = !getObject(arg0);
1636
1632
  return ret;
1637
1633
  };
1638
- imports.wbg.__wbg_key_3ce14c27a234543a = function() { return handleError(function (arg0) {
1634
+ imports.wbg.__wbg_key_1a7ac8cd4fa1c7a1 = function() { return handleError(function (arg0) {
1639
1635
  const ret = getObject(arg0).key;
1640
1636
  return addHeapObject(ret);
1641
1637
  }, arguments) };
1642
- imports.wbg.__wbg_advance_5da26ebf2f15b82e = function() { return handleError(function (arg0, arg1) {
1638
+ imports.wbg.__wbg_advance_ca3cc2aceae7ca47 = function() { return handleError(function (arg0, arg1) {
1643
1639
  getObject(arg0).advance(arg1 >>> 0);
1644
1640
  }, arguments) };
1645
- imports.wbg.__wbg_instanceof_IdbFactory_acaddaa9df3f73bc = function(arg0) {
1646
- const ret = getObject(arg0) instanceof IDBFactory;
1641
+ imports.wbg.__wbg_instanceof_IdbFactory_52a891270c686e1c = function(arg0) {
1642
+ let result;
1643
+ try {
1644
+ result = getObject(arg0) instanceof IDBFactory;
1645
+ } catch {
1646
+ result = false;
1647
+ }
1648
+ const ret = result;
1647
1649
  return ret;
1648
1650
  };
1649
- imports.wbg.__wbg_index_49e22b15910e16d4 = function() { return handleError(function (arg0, arg1, arg2) {
1651
+ imports.wbg.__wbg_index_86861edf1478f49c = function() { return handleError(function (arg0, arg1, arg2) {
1650
1652
  const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
1651
1653
  return addHeapObject(ret);
1652
1654
  }, arguments) };
1653
- imports.wbg.__wbg_toString_dc4768002eeae1b0 = function(arg0) {
1655
+ imports.wbg.__wbg_toString_73c9b562dccf34bd = function(arg0) {
1654
1656
  const ret = getObject(arg0).toString();
1655
1657
  return addHeapObject(ret);
1656
1658
  };
1657
- imports.wbg.__wbg_new_3ee7ebe9952c1fbd = function(arg0, arg1) {
1659
+ imports.wbg.__wbg_new_8d2af00bc1e329ee = function(arg0, arg1) {
1658
1660
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1659
1661
  return addHeapObject(ret);
1660
1662
  };
1661
- imports.wbg.__wbg_instanceof_Uint8Array_36c37b9ca15e3e0a = function(arg0) {
1662
- const ret = getObject(arg0) instanceof Uint8Array;
1663
+ imports.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003 = function(arg0) {
1664
+ let result;
1665
+ try {
1666
+ result = getObject(arg0) instanceof Uint8Array;
1667
+ } catch {
1668
+ result = false;
1669
+ }
1670
+ const ret = result;
1663
1671
  return ret;
1664
1672
  };
1665
- imports.wbg.__wbg_instanceof_ArrayBuffer_02bbeeb60438c785 = function(arg0) {
1666
- const ret = getObject(arg0) instanceof ArrayBuffer;
1673
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b = function(arg0) {
1674
+ let result;
1675
+ try {
1676
+ result = getObject(arg0) instanceof ArrayBuffer;
1677
+ } catch {
1678
+ result = false;
1679
+ }
1680
+ const ret = result;
1667
1681
  return ret;
1668
1682
  };
1669
- imports.wbg.__wbg_String_7462bcc0fcdbaf7d = function(arg0, arg1) {
1683
+ imports.wbg.__wbg_String_c9c0f9be374874ba = function(arg0, arg1) {
1670
1684
  const ret = String(getObject(arg1));
1671
1685
  const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1672
1686
  const len0 = WASM_VECTOR_LEN;
@@ -1683,50 +1697,50 @@ function getImports() {
1683
1697
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1684
1698
  throw new Error(getStringFromWasm0(arg0, arg1));
1685
1699
  };
1686
- imports.wbg.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
1700
+ imports.wbg.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
1687
1701
  const ret = getObject(arg0).then(getObject(arg1));
1688
1702
  return addHeapObject(ret);
1689
1703
  };
1690
- imports.wbg.__wbg_resolve_0107b3a501450ba0 = function(arg0) {
1704
+ imports.wbg.__wbg_resolve_99fe17964f31ffc0 = function(arg0) {
1691
1705
  const ret = Promise.resolve(getObject(arg0));
1692
1706
  return addHeapObject(ret);
1693
1707
  };
1694
- imports.wbg.__wbg_get_50220f3428ca7e51 = function(arg0, arg1, arg2) {
1708
+ imports.wbg.__wbg_get_0ab855454881e5cf = function(arg0, arg1, arg2) {
1695
1709
  const ret = getObject(arg1)[arg2 >>> 0];
1696
1710
  var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1697
1711
  var len0 = WASM_VECTOR_LEN;
1698
1712
  getInt32Memory0()[arg0 / 4 + 1] = len0;
1699
1713
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
1700
1714
  };
1701
- imports.wbg.__wbg_continue_43562ff8da972056 = function() { return handleError(function (arg0) {
1715
+ imports.wbg.__wbg_continue_3ff6a82c48409f45 = function() { return handleError(function (arg0) {
1702
1716
  getObject(arg0).continue();
1703
1717
  }, arguments) };
1704
- imports.wbg.__wbg_value_a3a782e66c6935d3 = function() { return handleError(function (arg0) {
1718
+ imports.wbg.__wbg_value_b663fab9801b9d19 = function() { return handleError(function (arg0) {
1705
1719
  const ret = getObject(arg0).value;
1706
1720
  return addHeapObject(ret);
1707
1721
  }, arguments) };
1708
- imports.wbg.__wbg_openCursor_48949b0ae4868b31 = function() { return handleError(function (arg0, arg1, arg2) {
1722
+ imports.wbg.__wbg_openCursor_3b7256b00a9b7d9f = function() { return handleError(function (arg0, arg1, arg2) {
1709
1723
  const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
1710
1724
  return addHeapObject(ret);
1711
1725
  }, arguments) };
1712
- imports.wbg.__wbg_openCursor_abefd2bc54b71e0f = function() { return handleError(function (arg0, arg1, arg2) {
1726
+ imports.wbg.__wbg_openCursor_4fee2b2ca0f3ed32 = function() { return handleError(function (arg0, arg1, arg2) {
1713
1727
  const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
1714
1728
  return addHeapObject(ret);
1715
1729
  }, arguments) };
1716
- imports.wbg.__wbg_result_4b44b0d900b4ab6f = function() { return handleError(function (arg0) {
1730
+ imports.wbg.__wbg_result_9e399c14676970d9 = function() { return handleError(function (arg0) {
1717
1731
  const ret = getObject(arg0).result;
1718
1732
  return addHeapObject(ret);
1719
1733
  }, arguments) };
1720
- imports.wbg.__wbg_objectStore_76c268be095ec9a5 = function() { return handleError(function (arg0, arg1, arg2) {
1734
+ imports.wbg.__wbg_objectStore_f17976b0e6377830 = function() { return handleError(function (arg0, arg1, arg2) {
1721
1735
  const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
1722
1736
  return addHeapObject(ret);
1723
1737
  }, arguments) };
1724
- imports.wbg.__wbindgen_closure_wrapper2517 = function(arg0, arg1, arg2) {
1725
- const ret = makeMutClosure(arg0, arg1, 105, __wbg_adapter_40);
1738
+ imports.wbg.__wbindgen_closure_wrapper2465 = function(arg0, arg1, arg2) {
1739
+ const ret = makeMutClosure(arg0, arg1, 106, __wbg_adapter_40);
1726
1740
  return addHeapObject(ret);
1727
1741
  };
1728
- imports.wbg.__wbindgen_closure_wrapper4457 = function(arg0, arg1, arg2) {
1729
- const ret = makeMutClosure(arg0, arg1, 113, __wbg_adapter_43);
1742
+ imports.wbg.__wbindgen_closure_wrapper4407 = function(arg0, arg1, arg2) {
1743
+ const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_43);
1730
1744
  return addHeapObject(ret);
1731
1745
  };
1732
1746
 
@@ -1745,10 +1759,13 @@ function finalizeInit(instance, module) {
1745
1759
  return wasm$1;
1746
1760
  }
1747
1761
 
1748
- function initSync(bytes) {
1762
+ function initSync(module) {
1749
1763
  const imports = getImports();
1750
1764
 
1751
- const module = new WebAssembly.Module(bytes);
1765
+ if (!(module instanceof WebAssembly.Module)) {
1766
+ module = new WebAssembly.Module(module);
1767
+ }
1768
+
1752
1769
  const instance = new WebAssembly.Instance(module, imports);
1753
1770
 
1754
1771
  return finalizeInit(instance, module);
@@ -1787,25 +1804,57 @@ var exports = /*#__PURE__*/Object.freeze({
1787
1804
  });
1788
1805
 
1789
1806
  var wasm = async (opt = {}) => {
1790
- let {importHook, serverPath} = opt;
1807
+ let {importHook, serverPath} = opt;
1791
1808
 
1792
- let path = "assets/core_crypto_ffi-0df6a73f.wasm";
1809
+ let path = "assets/core_crypto_ffi-ec1f65ea.wasm";
1793
1810
 
1794
- if (serverPath != null) {
1795
- path = serverPath + /[^\/\\]*$/.exec(path)[0];
1796
- }
1811
+ if (serverPath != null) {
1812
+ path = serverPath + /[^\/\\]*$/.exec(path)[0];
1813
+ }
1797
1814
 
1798
- if (importHook != null) {
1799
- path = importHook(path);
1800
- }
1815
+ if (importHook != null) {
1816
+ path = importHook(path);
1817
+ }
1801
1818
 
1802
- await init(path);
1803
- return exports;
1804
- };
1819
+ await init(path);
1820
+ return exports;
1821
+ };
1805
1822
 
1806
1823
  // Wire
1807
1824
  // Copyright (C) 2022 Wire Swiss GmbH
1808
1825
  var _a, _CoreCrypto_module, _CoreCrypto_cc;
1826
+ /**
1827
+ * MLS Proposal type
1828
+ */
1829
+ var ProposalType;
1830
+ (function (ProposalType) {
1831
+ /**
1832
+ * This allows to propose the addition of other clients to the MLS group/conversation
1833
+ */
1834
+ ProposalType[ProposalType["Add"] = 0] = "Add";
1835
+ /**
1836
+ * This allows to propose the removal of clients from the MLS group/conversation
1837
+ */
1838
+ ProposalType[ProposalType["Remove"] = 1] = "Remove";
1839
+ /**
1840
+ * This allows to propose to update the client keying material (i.e. keypackage rotation) and the group root key
1841
+ */
1842
+ ProposalType[ProposalType["Update"] = 2] = "Update";
1843
+ })(ProposalType || (ProposalType = {}));
1844
+ /**
1845
+ * MLS External Proposal type
1846
+ */
1847
+ var ExternalProposalType;
1848
+ (function (ExternalProposalType) {
1849
+ /**
1850
+ * This allows to propose the addition of other clients to the MLS group/conversation
1851
+ */
1852
+ ExternalProposalType[ExternalProposalType["Add"] = 0] = "Add";
1853
+ /**
1854
+ * This allows to propose the removal of clients from the MLS group/conversation
1855
+ */
1856
+ ExternalProposalType[ExternalProposalType["Remove"] = 1] = "Remove";
1857
+ })(ExternalProposalType || (ExternalProposalType = {}));
1809
1858
  /**
1810
1859
  * Wrapper for the WASM-compiled version of CoreCrypto
1811
1860
  */
@@ -1874,6 +1923,15 @@ class CoreCrypto {
1874
1923
  async close() {
1875
1924
  await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").close();
1876
1925
  }
1926
+ /**
1927
+ * Registers the callbacks for CoreCrypto to use in order to gain additional information
1928
+ *
1929
+ * @param callbacks - Any interface following the {@link CoreCryptoCallbacks} interface
1930
+ */
1931
+ registerCallbacks(callbacks) {
1932
+ const wasmCallbacks = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).CoreCryptoWasmCallbacks)(callbacks.authorize, callbacks.clientIdBelongsToOneOf);
1933
+ __classPrivateFieldGet(this, _CoreCrypto_cc, "f").set_callbacks(wasmCallbacks);
1934
+ }
1877
1935
  /**
1878
1936
  * Checks if the Client is member of a given conversation and if the MLS Group is loaded up
1879
1937
  *
@@ -1927,7 +1985,7 @@ class CoreCrypto {
1927
1985
  * @param configuration.externalSenders - Array of Client IDs that are qualified as external senders within the group
1928
1986
  */
1929
1987
  async createConversation(conversationId, configuration = {}) {
1930
- const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration !== null && configuration !== void 0 ? configuration : {};
1988
+ const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration || {};
1931
1989
  const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(admins, ciphersuite, keyRotationSpan, externalSenders);
1932
1990
  const ret = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").create_conversation(conversationId, config);
1933
1991
  return ret;
@@ -1938,7 +1996,7 @@ class CoreCrypto {
1938
1996
  * @param conversationId - The ID of the conversation
1939
1997
  * @param payload - The encrypted message buffer
1940
1998
  *
1941
- * @returns Either a {@link DecryptedMessage} payload or `undefined` - This happens when the encrypted payload contains a system message such a proposal or commit
1999
+ * @returns a {@link DecryptedMessage}. Note that {@link DecryptedMessage#message} is `undefined` when the encrypted payload contains a system message such a proposal or commit
1942
2000
  */
1943
2001
  async decryptMessage(conversationId, payload) {
1944
2002
  const ffiDecryptedMessage = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").decrypt_message(conversationId, payload);
@@ -1949,6 +2007,7 @@ class CoreCrypto {
1949
2007
  message: ffiDecryptedMessage.message,
1950
2008
  proposals: ffiDecryptedMessage.proposals,
1951
2009
  isActive: ffiDecryptedMessage.is_active,
2010
+ senderClientId: ffiDecryptedMessage.sender_client_id,
1952
2011
  commitDelay,
1953
2012
  };
1954
2013
  return ret;
@@ -2028,7 +2087,7 @@ class CoreCrypto {
2028
2087
  * @param conversationId - The ID of the conversation
2029
2088
  * @param clientIds - Array of Client IDs to remove.
2030
2089
  *
2031
- * @returns A {@link CommitBundle}, or `undefined` if for any reason, the operation would result in an empty commit
2090
+ * @returns A {@link CommitBundle}
2032
2091
  */
2033
2092
  async removeClientsFromConversation(conversationId, clientIds) {
2034
2093
  const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").remove_clients_from_conversation(conversationId, clientIds);
@@ -2068,16 +2127,15 @@ class CoreCrypto {
2068
2127
  *
2069
2128
  * @param conversationId - The ID of the conversation
2070
2129
  *
2071
- * @returns A {@link CommitBundle}
2130
+ * @returns A {@link CommitBundle} or `undefined` when there was no pending proposal to commit
2072
2131
  */
2073
2132
  async commitPendingProposals(conversationId) {
2074
2133
  const ffiCommitBundle = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_pending_proposals(conversationId);
2075
- const ret = {
2134
+ return ffiCommitBundle ? {
2076
2135
  welcome: ffiCommitBundle.welcome,
2077
2136
  commit: ffiCommitBundle.commit,
2078
2137
  publicGroupState: ffiCommitBundle.public_group_state,
2079
- };
2080
- return ret;
2138
+ } : undefined;
2081
2139
  }
2082
2140
  /**
2083
2141
  * Adds new clients to a conversation, assuming the current client has the right to add new clients to the conversation.
@@ -2151,7 +2209,7 @@ class CoreCrypto {
2151
2209
  *
2152
2210
  * @param conversationId - The ID of the conversation
2153
2211
  *
2154
- * @returns A {@link CommitBundle} byte array to fan out to the Delivery Service
2212
+ * @returns A {@link CommitBundle} byte array to fan out to the Delivery Service or `undefined` when there was no pending proposal to commit
2155
2213
  */
2156
2214
  async finalCommitPendingProposals(conversationId) {
2157
2215
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_pending_proposals(conversationId);
@@ -2166,19 +2224,19 @@ class CoreCrypto {
2166
2224
  */
2167
2225
  async newProposal(proposalType, args) {
2168
2226
  switch (proposalType) {
2169
- case 0 /* ProposalType.Add */: {
2227
+ case ProposalType.Add: {
2170
2228
  if (!args.kp) {
2171
2229
  throw new Error("kp is not contained in the proposal arguments");
2172
2230
  }
2173
2231
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_add_proposal(args.conversationId, args.kp);
2174
2232
  }
2175
- case 1 /* ProposalType.Remove */: {
2233
+ case ProposalType.Remove: {
2176
2234
  if (!args.clientId) {
2177
2235
  throw new Error("clientId is not contained in the proposal arguments");
2178
2236
  }
2179
2237
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_remove_proposal(args.conversationId, args.clientId);
2180
2238
  }
2181
- case 2 /* ProposalType.Update */: {
2239
+ case ProposalType.Update: {
2182
2240
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_update_proposal(args.conversationId);
2183
2241
  }
2184
2242
  default:
@@ -2187,10 +2245,10 @@ class CoreCrypto {
2187
2245
  }
2188
2246
  async newExternalProposal(externalProposalType, args) {
2189
2247
  switch (externalProposalType) {
2190
- case 0 /* ExternalProposalType.Add */: {
2248
+ case ExternalProposalType.Add: {
2191
2249
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_add_proposal(args.conversationId, args.epoch);
2192
2250
  }
2193
- case 1 /* ExternalProposalType.Remove */: {
2251
+ case ExternalProposalType.Remove: {
2194
2252
  if (!args.keyPackageRef) {
2195
2253
  throw new Error("keyPackageRef is not contained in the external proposal arguments");
2196
2254
  }
@@ -2234,7 +2292,7 @@ class CoreCrypto {
2234
2292
  * @param configuration - Configuration of the group, see {@link ConversationConfiguration}
2235
2293
  */
2236
2294
  async mergePendingGroupFromExternalCommit(conversationId, configuration) {
2237
- const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration !== null && configuration !== void 0 ? configuration : {};
2295
+ const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration || {};
2238
2296
  const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(admins, ciphersuite, keyRotationSpan, externalSenders);
2239
2297
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").merge_pending_group_from_external_commit(conversationId, config);
2240
2298
  }
@@ -2247,28 +2305,6 @@ class CoreCrypto {
2247
2305
  async commitAccepted(conversationId) {
2248
2306
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_accepted(conversationId);
2249
2307
  }
2250
- /**
2251
- * Allows {@link CoreCrypto} to act as a CSPRNG provider
2252
- * @note The underlying CSPRNG algorithm is ChaCha20 and takes in account the external seed provider either at init time or provided with {@link CoreCrypto.reseedRng}
2253
- *
2254
- * @param length - The number of bytes to be returned in the `Uint8Array`
2255
- *
2256
- * @returns A `Uint8Array` buffer that contains `length` cryptographically-secure random bytes
2257
- */
2258
- async randomBytes(length) {
2259
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").random_bytes(length);
2260
- }
2261
- /**
2262
- * Allows to reseed {@link CoreCrypto}'s internal CSPRNG with a new seed.
2263
- *
2264
- * @param seed - **exactly 32** bytes buffer seed
2265
- */
2266
- async reseedRng(seed) {
2267
- if (seed.length !== 32) {
2268
- throw new Error(`The seed length needs to be exactly 32 bytes. ${seed.length} bytes provided.`);
2269
- }
2270
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed);
2271
- }
2272
2308
  /**
2273
2309
  * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions
2274
2310
  * have changed meanwhile.
@@ -2279,7 +2315,7 @@ class CoreCrypto {
2279
2315
  * @param conversationId - The group's ID
2280
2316
  * @param proposalRef - A reference to the proposal to delete. You get one when using {@link CoreCrypto.newProposal}
2281
2317
  */
2282
- async clear_pending_proposal(conversationId, proposalRef) {
2318
+ async clearPendingProposal(conversationId, proposalRef) {
2283
2319
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_proposal(conversationId, proposalRef);
2284
2320
  }
2285
2321
  /**
@@ -2293,9 +2329,31 @@ class CoreCrypto {
2293
2329
  *
2294
2330
  * @param conversationId - The group's ID
2295
2331
  */
2296
- async clear_pending_commit(conversationId) {
2332
+ async clearPendingCommit(conversationId) {
2297
2333
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_commit(conversationId);
2298
2334
  }
2335
+ /**
2336
+ * Allows {@link CoreCrypto} to act as a CSPRNG provider
2337
+ * @note The underlying CSPRNG algorithm is ChaCha20 and takes in account the external seed provider either at init time or provided with {@link CoreCrypto.reseedRng}
2338
+ *
2339
+ * @param length - The number of bytes to be returned in the `Uint8Array`
2340
+ *
2341
+ * @returns A `Uint8Array` buffer that contains `length` cryptographically-secure random bytes
2342
+ */
2343
+ async randomBytes(length) {
2344
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").random_bytes(length);
2345
+ }
2346
+ /**
2347
+ * Allows to reseed {@link CoreCrypto}'s internal CSPRNG with a new seed.
2348
+ *
2349
+ * @param seed - **exactly 32** bytes buffer seed
2350
+ */
2351
+ async reseedRng(seed) {
2352
+ if (seed.length !== 32) {
2353
+ throw new Error(`The seed length needs to be exactly 32 bytes. ${seed.length} bytes provided.`);
2354
+ }
2355
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed);
2356
+ }
2299
2357
  /**
2300
2358
  * Returns the current version of {@link CoreCrypto}
2301
2359
  *
@@ -2312,4 +2370,4 @@ _a = CoreCrypto, _CoreCrypto_cc = new WeakMap();
2312
2370
  /** @hidden */
2313
2371
  _CoreCrypto_module = { value: void 0 };
2314
2372
 
2315
- export { CoreCrypto };
2373
+ export { CoreCrypto, ExternalProposalType, ProposalType };