@bitwarden/sdk-internal 0.2.0-main.11 → 0.2.0-main.111

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.
@@ -3,12 +3,7 @@ export function __wbg_set_wasm(val) {
3
3
  wasm = val;
4
4
  }
5
5
 
6
- const lTextDecoder =
7
- typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
8
-
9
- let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
10
-
11
- cachedTextDecoder.decode();
6
+ let WASM_VECTOR_LEN = 0;
12
7
 
13
8
  let cachedUint8ArrayMemory0 = null;
14
9
 
@@ -19,44 +14,6 @@ function getUint8ArrayMemory0() {
19
14
  return cachedUint8ArrayMemory0;
20
15
  }
21
16
 
22
- function getStringFromWasm0(ptr, len) {
23
- ptr = ptr >>> 0;
24
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
25
- }
26
-
27
- const heap = new Array(128).fill(undefined);
28
-
29
- heap.push(undefined, null, true, false);
30
-
31
- let heap_next = heap.length;
32
-
33
- function addHeapObject(obj) {
34
- if (heap_next === heap.length) heap.push(heap.length + 1);
35
- const idx = heap_next;
36
- heap_next = heap[idx];
37
-
38
- heap[idx] = obj;
39
- return idx;
40
- }
41
-
42
- function getObject(idx) {
43
- return heap[idx];
44
- }
45
-
46
- function dropObject(idx) {
47
- if (idx < 132) return;
48
- heap[idx] = heap_next;
49
- heap_next = idx;
50
- }
51
-
52
- function takeObject(idx) {
53
- const ret = getObject(idx);
54
- dropObject(idx);
55
- return ret;
56
- }
57
-
58
- let WASM_VECTOR_LEN = 0;
59
-
60
17
  const lTextEncoder =
61
18
  typeof TextEncoder === "undefined" ? (0, module.require)("util").TextEncoder : TextEncoder;
62
19
 
@@ -116,10 +73,6 @@ function passStringToWasm0(arg, malloc, realloc) {
116
73
  return ptr;
117
74
  }
118
75
 
119
- function isLikeNone(x) {
120
- return x === undefined || x === null;
121
- }
122
-
123
76
  let cachedDataViewMemory0 = null;
124
77
 
125
78
  function getDataViewMemory0() {
@@ -134,6 +87,69 @@ function getDataViewMemory0() {
134
87
  return cachedDataViewMemory0;
135
88
  }
136
89
 
90
+ const lTextDecoder =
91
+ typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
92
+
93
+ let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
94
+
95
+ cachedTextDecoder.decode();
96
+
97
+ function getStringFromWasm0(ptr, len) {
98
+ ptr = ptr >>> 0;
99
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
100
+ }
101
+
102
+ function addToExternrefTable0(obj) {
103
+ const idx = wasm.__externref_table_alloc();
104
+ wasm.__wbindgen_export_4.set(idx, obj);
105
+ return idx;
106
+ }
107
+
108
+ function handleError(f, args) {
109
+ try {
110
+ return f.apply(this, args);
111
+ } catch (e) {
112
+ const idx = addToExternrefTable0(e);
113
+ wasm.__wbindgen_exn_store(idx);
114
+ }
115
+ }
116
+
117
+ function isLikeNone(x) {
118
+ return x === undefined || x === null;
119
+ }
120
+
121
+ const CLOSURE_DTORS =
122
+ typeof FinalizationRegistry === "undefined"
123
+ ? { register: () => {}, unregister: () => {} }
124
+ : new FinalizationRegistry((state) => {
125
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
126
+ });
127
+
128
+ function makeMutClosure(arg0, arg1, dtor, f) {
129
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
130
+ const real = (...args) => {
131
+ // First up with a closure we increment the internal reference
132
+ // count. This ensures that the Rust closure environment won't
133
+ // be deallocated while we're invoking it.
134
+ state.cnt++;
135
+ const a = state.a;
136
+ state.a = 0;
137
+ try {
138
+ return f(a, state.b, ...args);
139
+ } finally {
140
+ if (--state.cnt === 0) {
141
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
142
+ CLOSURE_DTORS.unregister(state);
143
+ } else {
144
+ state.a = a;
145
+ }
146
+ }
147
+ };
148
+ real.original = state;
149
+ CLOSURE_DTORS.register(real, state, state);
150
+ return real;
151
+ }
152
+
137
153
  function debugString(val) {
138
154
  // primitive types
139
155
  const type = typeof val;
@@ -175,7 +191,7 @@ function debugString(val) {
175
191
  // Test for built-in
176
192
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
177
193
  let className;
178
- if (builtInMatches.length > 1) {
194
+ if (builtInMatches && builtInMatches.length > 1) {
179
195
  className = builtInMatches[1];
180
196
  } else {
181
197
  // Failed to match the standard '[object ClassName]'
@@ -198,141 +214,198 @@ function debugString(val) {
198
214
  // TODO we could test for more things here, like `Set`s and `Map`s.
199
215
  return className;
200
216
  }
217
+ /**
218
+ * @param {any} error
219
+ * @returns {boolean}
220
+ */
221
+ export function isEncryptionSettingsError(error) {
222
+ const ret = wasm.isEncryptionSettingsError(error);
223
+ return ret !== 0;
224
+ }
201
225
 
202
- const CLOSURE_DTORS =
203
- typeof FinalizationRegistry === "undefined"
204
- ? { register: () => {}, unregister: () => {} }
205
- : new FinalizationRegistry((state) => {
206
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
207
- });
226
+ /**
227
+ * @param {any} error
228
+ * @returns {boolean}
229
+ */
230
+ export function isCryptoError(error) {
231
+ const ret = wasm.isCryptoError(error);
232
+ return ret !== 0;
233
+ }
208
234
 
209
- function makeMutClosure(arg0, arg1, dtor, f) {
210
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
211
- const real = (...args) => {
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_2.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;
235
+ /**
236
+ * @param {any} error
237
+ * @returns {boolean}
238
+ */
239
+ export function isSshKeyExportError(error) {
240
+ const ret = wasm.isSshKeyExportError(error);
241
+ return ret !== 0;
232
242
  }
233
- function __wbg_adapter_38(arg0, arg1, arg2) {
234
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hcab43b83560065d8(
235
- arg0,
236
- arg1,
237
- addHeapObject(arg2),
238
- );
243
+
244
+ /**
245
+ * @param {any} error
246
+ * @returns {boolean}
247
+ */
248
+ export function isSshKeyImportError(error) {
249
+ const ret = wasm.isSshKeyImportError(error);
250
+ return ret !== 0;
239
251
  }
240
252
 
241
- let stack_pointer = 128;
253
+ /**
254
+ * @param {any} error
255
+ * @returns {boolean}
256
+ */
257
+ export function isKeyGenerationError(error) {
258
+ const ret = wasm.isKeyGenerationError(error);
259
+ return ret !== 0;
260
+ }
242
261
 
243
- function addBorrowedObject(obj) {
244
- if (stack_pointer == 1) throw new Error("out of js stack");
245
- heap[--stack_pointer] = obj;
246
- return stack_pointer;
262
+ /**
263
+ * @param {any} error
264
+ * @returns {boolean}
265
+ */
266
+ export function isDecryptFileError(error) {
267
+ const ret = wasm.isDecryptFileError(error);
268
+ return ret !== 0;
247
269
  }
270
+
248
271
  /**
249
272
  * @param {any} error
250
273
  * @returns {boolean}
251
274
  */
252
- export function isCoreError(error) {
253
- try {
254
- const ret = wasm.isCoreError(addBorrowedObject(error));
255
- return ret !== 0;
256
- } finally {
257
- heap[stack_pointer++] = undefined;
258
- }
275
+ export function isEncryptFileError(error) {
276
+ const ret = wasm.isEncryptFileError(error);
277
+ return ret !== 0;
259
278
  }
260
279
 
261
280
  /**
262
281
  * @param {any} error
263
282
  * @returns {boolean}
264
283
  */
265
- export function isEncryptionSettingsError(error) {
266
- try {
267
- const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
268
- return ret !== 0;
269
- } finally {
270
- heap[stack_pointer++] = undefined;
271
- }
284
+ export function isDecryptError(error) {
285
+ const ret = wasm.isDecryptError(error);
286
+ return ret !== 0;
272
287
  }
273
288
 
274
289
  /**
275
290
  * @param {any} error
276
291
  * @returns {boolean}
277
292
  */
278
- export function isKeyGenerationError(error) {
279
- try {
280
- const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
281
- return ret !== 0;
282
- } finally {
283
- heap[stack_pointer++] = undefined;
284
- }
293
+ export function isEncryptError(error) {
294
+ const ret = wasm.isEncryptError(error);
295
+ return ret !== 0;
285
296
  }
286
297
 
287
298
  /**
288
299
  * @param {any} error
289
300
  * @returns {boolean}
290
301
  */
291
- export function isTestError(error) {
292
- try {
293
- const ret = wasm.isTestError(addBorrowedObject(error));
294
- return ret !== 0;
295
- } finally {
296
- heap[stack_pointer++] = undefined;
297
- }
302
+ export function isTotpError(error) {
303
+ const ret = wasm.isTotpError(error);
304
+ return ret !== 0;
305
+ }
306
+
307
+ function takeFromExternrefTable0(idx) {
308
+ const value = wasm.__wbindgen_export_4.get(idx);
309
+ wasm.__externref_table_dealloc(idx);
310
+ return value;
311
+ }
312
+ /**
313
+ * @param {LogLevel} level
314
+ */
315
+ export function set_log_level(level) {
316
+ wasm.set_log_level(level);
317
+ }
318
+
319
+ /**
320
+ * @param {LogLevel | null} [log_level]
321
+ */
322
+ export function init_sdk(log_level) {
323
+ wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
324
+ }
325
+
326
+ function getArrayU8FromWasm0(ptr, len) {
327
+ ptr = ptr >>> 0;
328
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
298
329
  }
299
330
 
331
+ function passArray8ToWasm0(arg, malloc) {
332
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
333
+ getUint8ArrayMemory0().set(arg, ptr / 1);
334
+ WASM_VECTOR_LEN = arg.length;
335
+ return ptr;
336
+ }
300
337
  /**
338
+ * Generate a new SSH key pair
339
+ *
340
+ * # Arguments
341
+ * - `key_algorithm` - The algorithm to use for the key pair
342
+ *
343
+ * # Returns
344
+ * - `Ok(SshKey)` if the key was successfully generated
345
+ * - `Err(KeyGenerationError)` if the key could not be generated
301
346
  * @param {KeyAlgorithm} key_algorithm
302
- * @returns {GenerateSshKeyResult}
347
+ * @returns {SshKeyView}
303
348
  */
304
349
  export function generate_ssh_key(key_algorithm) {
305
- try {
306
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
307
- wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
308
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
309
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
310
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
311
- if (r2) {
312
- throw takeObject(r1);
313
- }
314
- return takeObject(r0);
315
- } finally {
316
- wasm.__wbindgen_add_to_stack_pointer(16);
350
+ const ret = wasm.generate_ssh_key(key_algorithm);
351
+ if (ret[2]) {
352
+ throw takeFromExternrefTable0(ret[1]);
317
353
  }
354
+ return takeFromExternrefTable0(ret[0]);
318
355
  }
319
356
 
320
- function handleError(f, args) {
321
- try {
322
- return f.apply(this, args);
323
- } catch (e) {
324
- wasm.__wbindgen_exn_store(addHeapObject(e));
357
+ /**
358
+ * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
359
+ * to an OpenSSH private key with public key and fingerprint
360
+ *
361
+ * # Arguments
362
+ * - `imported_key` - The private key to convert
363
+ * - `password` - The password to use for decrypting the key
364
+ *
365
+ * # Returns
366
+ * - `Ok(SshKey)` if the key was successfully coneverted
367
+ * - `Err(PasswordRequired)` if the key is encrypted and no password was provided
368
+ * - `Err(WrongPassword)` if the password provided is incorrect
369
+ * - `Err(ParsingError)` if the key could not be parsed
370
+ * - `Err(UnsupportedKeyType)` if the key type is not supported
371
+ * @param {string} imported_key
372
+ * @param {string | null} [password]
373
+ * @returns {SshKeyView}
374
+ */
375
+ export function import_ssh_key(imported_key, password) {
376
+ const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
377
+ const len0 = WASM_VECTOR_LEN;
378
+ var ptr1 = isLikeNone(password)
379
+ ? 0
380
+ : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
381
+ var len1 = WASM_VECTOR_LEN;
382
+ const ret = wasm.import_ssh_key(ptr0, len0, ptr1, len1);
383
+ if (ret[2]) {
384
+ throw takeFromExternrefTable0(ret[1]);
325
385
  }
386
+ return takeFromExternrefTable0(ret[0]);
387
+ }
388
+
389
+ /**
390
+ * @param {any} error
391
+ * @returns {boolean}
392
+ */
393
+ export function isTestError(error) {
394
+ const ret = wasm.isTestError(error);
395
+ return ret !== 0;
396
+ }
397
+
398
+ function __wbg_adapter_42(arg0, arg1, arg2) {
399
+ wasm.closure545_externref_shim(arg0, arg1, arg2);
326
400
  }
327
- function __wbg_adapter_125(arg0, arg1, arg2, arg3) {
328
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h7363c1bfa226a55d(
329
- arg0,
330
- arg1,
331
- addHeapObject(arg2),
332
- addHeapObject(arg3),
333
- );
401
+
402
+ function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
403
+ wasm.closure403_externref_shim(arg0, arg1, arg2, arg3);
334
404
  }
335
405
 
406
+ /**
407
+ * @enum {0 | 1 | 2 | 3 | 4}
408
+ */
336
409
  export const LogLevel = Object.freeze({
337
410
  Trace: 0,
338
411
  0: "Trace",
@@ -368,14 +441,10 @@ export class BitwardenClient {
368
441
  wasm.__wbg_bitwardenclient_free(ptr, 0);
369
442
  }
370
443
  /**
371
- * @param {ClientSettings | undefined} [settings]
372
- * @param {LogLevel | undefined} [log_level]
444
+ * @param {ClientSettings | null} [settings]
373
445
  */
374
- constructor(settings, log_level) {
375
- const ret = wasm.bitwardenclient_new(
376
- isLikeNone(settings) ? 0 : addHeapObject(settings),
377
- isLikeNone(log_level) ? 5 : log_level,
378
- );
446
+ constructor(settings) {
447
+ const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addToExternrefTable0(settings));
379
448
  this.__wbg_ptr = ret >>> 0;
380
449
  BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
381
450
  return this;
@@ -389,17 +458,13 @@ export class BitwardenClient {
389
458
  let deferred2_0;
390
459
  let deferred2_1;
391
460
  try {
392
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
393
461
  const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
462
  const len0 = WASM_VECTOR_LEN;
395
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
396
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
397
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
398
- deferred2_0 = r0;
399
- deferred2_1 = r1;
400
- return getStringFromWasm0(r0, r1);
463
+ const ret = wasm.bitwardenclient_echo(this.__wbg_ptr, ptr0, len0);
464
+ deferred2_0 = ret[0];
465
+ deferred2_1 = ret[1];
466
+ return getStringFromWasm0(ret[0], ret[1]);
401
467
  } finally {
402
- wasm.__wbindgen_add_to_stack_pointer(16);
403
468
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
404
469
  }
405
470
  }
@@ -410,27 +475,24 @@ export class BitwardenClient {
410
475
  let deferred1_0;
411
476
  let deferred1_1;
412
477
  try {
413
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
414
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
415
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
416
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
417
- deferred1_0 = r0;
418
- deferred1_1 = r1;
419
- return getStringFromWasm0(r0, r1);
478
+ const ret = wasm.bitwardenclient_version(this.__wbg_ptr);
479
+ deferred1_0 = ret[0];
480
+ deferred1_1 = ret[1];
481
+ return getStringFromWasm0(ret[0], ret[1]);
420
482
  } finally {
421
- wasm.__wbindgen_add_to_stack_pointer(16);
422
483
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
423
484
  }
424
485
  }
425
486
  /**
426
487
  * @param {string} msg
427
- * @returns {Promise<void>}
428
488
  */
429
489
  throw(msg) {
430
490
  const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
431
491
  const len0 = WASM_VECTOR_LEN;
432
492
  const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
433
- return takeObject(ret);
493
+ if (ret[1]) {
494
+ throw takeFromExternrefTable0(ret[0]);
495
+ }
434
496
  }
435
497
  /**
436
498
  * Test method, calls http endpoint
@@ -441,335 +503,521 @@ export class BitwardenClient {
441
503
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
504
  const len0 = WASM_VECTOR_LEN;
443
505
  const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
444
- return takeObject(ret);
506
+ return ret;
445
507
  }
446
508
  /**
447
- * @returns {ClientCrypto}
509
+ * @returns {CryptoClient}
448
510
  */
449
511
  crypto() {
450
512
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
451
- return ClientCrypto.__wrap(ret);
513
+ return CryptoClient.__wrap(ret);
452
514
  }
453
515
  /**
454
- * @returns {ClientVault}
516
+ * @returns {VaultClient}
455
517
  */
456
518
  vault() {
457
519
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
458
- return ClientVault.__wrap(ret);
520
+ return VaultClient.__wrap(ret);
459
521
  }
460
522
  }
461
523
 
462
- const ClientCryptoFinalization =
524
+ const ClientFoldersFinalization =
463
525
  typeof FinalizationRegistry === "undefined"
464
526
  ? { register: () => {}, unregister: () => {} }
465
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
527
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
466
528
 
467
- export class ClientCrypto {
529
+ export class ClientFolders {
468
530
  static __wrap(ptr) {
469
531
  ptr = ptr >>> 0;
470
- const obj = Object.create(ClientCrypto.prototype);
532
+ const obj = Object.create(ClientFolders.prototype);
471
533
  obj.__wbg_ptr = ptr;
472
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
534
+ ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
473
535
  return obj;
474
536
  }
475
537
 
476
538
  __destroy_into_raw() {
477
539
  const ptr = this.__wbg_ptr;
478
540
  this.__wbg_ptr = 0;
479
- ClientCryptoFinalization.unregister(this);
541
+ ClientFoldersFinalization.unregister(this);
480
542
  return ptr;
481
543
  }
482
544
 
483
545
  free() {
484
546
  const ptr = this.__destroy_into_raw();
485
- wasm.__wbg_clientcrypto_free(ptr, 0);
486
- }
487
- /**
488
- * Initialization method for the user crypto. Needs to be called before any other crypto
489
- * operations.
490
- * @param {InitUserCryptoRequest} req
491
- * @returns {Promise<void>}
492
- */
493
- initialize_user_crypto(req) {
494
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
495
- return takeObject(ret);
547
+ wasm.__wbg_clientfolders_free(ptr, 0);
496
548
  }
497
549
  /**
498
- * Initialization method for the organization crypto. Needs to be called after
499
- * `initialize_user_crypto` but before any other crypto operations.
500
- * @param {InitOrgCryptoRequest} req
501
- * @returns {Promise<void>}
550
+ * Decrypt folder
551
+ * @param {Folder} folder
552
+ * @returns {FolderView}
502
553
  */
503
- initialize_org_crypto(req) {
504
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
505
- return takeObject(ret);
554
+ decrypt(folder) {
555
+ const ret = wasm.clientfolders_decrypt(this.__wbg_ptr, folder);
556
+ if (ret[2]) {
557
+ throw takeFromExternrefTable0(ret[1]);
558
+ }
559
+ return takeFromExternrefTable0(ret[0]);
506
560
  }
507
561
  }
508
562
 
509
- const ClientFoldersFinalization =
563
+ const ClientTotpFinalization =
510
564
  typeof FinalizationRegistry === "undefined"
511
565
  ? { register: () => {}, unregister: () => {} }
512
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
566
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clienttotp_free(ptr >>> 0, 1));
513
567
 
514
- export class ClientFolders {
568
+ export class ClientTotp {
515
569
  static __wrap(ptr) {
516
570
  ptr = ptr >>> 0;
517
- const obj = Object.create(ClientFolders.prototype);
571
+ const obj = Object.create(ClientTotp.prototype);
518
572
  obj.__wbg_ptr = ptr;
519
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
573
+ ClientTotpFinalization.register(obj, obj.__wbg_ptr, obj);
520
574
  return obj;
521
575
  }
522
576
 
523
577
  __destroy_into_raw() {
524
578
  const ptr = this.__wbg_ptr;
525
579
  this.__wbg_ptr = 0;
526
- ClientFoldersFinalization.unregister(this);
580
+ ClientTotpFinalization.unregister(this);
527
581
  return ptr;
528
582
  }
529
583
 
530
584
  free() {
531
585
  const ptr = this.__destroy_into_raw();
532
- wasm.__wbg_clientfolders_free(ptr, 0);
586
+ wasm.__wbg_clienttotp_free(ptr, 0);
533
587
  }
534
588
  /**
535
- * Decrypt folder
536
- * @param {Folder} folder
537
- * @returns {FolderView}
589
+ * Generates a TOTP code from a provided key
590
+ *
591
+ * # Arguments
592
+ * - `key` - Can be:
593
+ * - A base32 encoded string
594
+ * - OTP Auth URI
595
+ * - Steam URI
596
+ * - `time_ms` - Optional timestamp in milliseconds
597
+ *
598
+ * # Returns
599
+ * - `Ok(TotpResponse)` containing the generated code and period
600
+ * - `Err(TotpError)` if code generation fails
601
+ * @param {string} key
602
+ * @param {number | null} [time_ms]
603
+ * @returns {TotpResponse}
538
604
  */
539
- decrypt(folder) {
540
- try {
541
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
542
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
543
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
544
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
545
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
546
- if (r2) {
547
- throw takeObject(r1);
548
- }
549
- return takeObject(r0);
550
- } finally {
551
- wasm.__wbindgen_add_to_stack_pointer(16);
605
+ generate_totp(key, time_ms) {
606
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
607
+ const len0 = WASM_VECTOR_LEN;
608
+ const ret = wasm.clienttotp_generate_totp(
609
+ this.__wbg_ptr,
610
+ ptr0,
611
+ len0,
612
+ !isLikeNone(time_ms),
613
+ isLikeNone(time_ms) ? 0 : time_ms,
614
+ );
615
+ if (ret[2]) {
616
+ throw takeFromExternrefTable0(ret[1]);
552
617
  }
618
+ return takeFromExternrefTable0(ret[0]);
553
619
  }
554
620
  }
555
621
 
556
- const ClientVaultFinalization =
622
+ const CryptoClientFinalization =
557
623
  typeof FinalizationRegistry === "undefined"
558
624
  ? { register: () => {}, unregister: () => {} }
559
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
625
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
560
626
 
561
- export class ClientVault {
627
+ export class CryptoClient {
562
628
  static __wrap(ptr) {
563
629
  ptr = ptr >>> 0;
564
- const obj = Object.create(ClientVault.prototype);
630
+ const obj = Object.create(CryptoClient.prototype);
565
631
  obj.__wbg_ptr = ptr;
566
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
632
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
567
633
  return obj;
568
634
  }
569
635
 
570
636
  __destroy_into_raw() {
571
637
  const ptr = this.__wbg_ptr;
572
638
  this.__wbg_ptr = 0;
573
- ClientVaultFinalization.unregister(this);
639
+ CryptoClientFinalization.unregister(this);
574
640
  return ptr;
575
641
  }
576
642
 
577
643
  free() {
578
644
  const ptr = this.__destroy_into_raw();
579
- wasm.__wbg_clientvault_free(ptr, 0);
645
+ wasm.__wbg_cryptoclient_free(ptr, 0);
580
646
  }
581
647
  /**
582
- * @returns {ClientFolders}
648
+ * Initialization method for the user crypto. Needs to be called before any other crypto
649
+ * operations.
650
+ * @param {InitUserCryptoRequest} req
651
+ * @returns {Promise<void>}
583
652
  */
584
- folders() {
585
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
586
- return ClientFolders.__wrap(ret);
653
+ initialize_user_crypto(req) {
654
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, req);
655
+ return ret;
587
656
  }
588
- }
589
-
590
- export function __wbg_new_fe19e4f3db5c3999(arg0, arg1) {
591
- let deferred0_0;
592
- let deferred0_1;
593
- try {
594
- deferred0_0 = arg0;
595
- deferred0_1 = arg1;
596
- const ret = new Error(getStringFromWasm0(arg0, arg1));
597
- return addHeapObject(ret);
598
- } finally {
599
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
657
+ /**
658
+ * Initialization method for the organization crypto. Needs to be called after
659
+ * `initialize_user_crypto` but before any other crypto operations.
660
+ * @param {InitOrgCryptoRequest} req
661
+ * @returns {Promise<void>}
662
+ */
663
+ initialize_org_crypto(req) {
664
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, req);
665
+ return ret;
666
+ }
667
+ /**
668
+ * Generates a new key pair and encrypts the private key with the provided user key.
669
+ * Crypto initialization not required.
670
+ * @param {string} user_key
671
+ * @returns {MakeKeyPairResponse}
672
+ */
673
+ make_key_pair(user_key) {
674
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
675
+ const len0 = WASM_VECTOR_LEN;
676
+ const ret = wasm.cryptoclient_make_key_pair(this.__wbg_ptr, ptr0, len0);
677
+ if (ret[2]) {
678
+ throw takeFromExternrefTable0(ret[1]);
679
+ }
680
+ return takeFromExternrefTable0(ret[0]);
681
+ }
682
+ /**
683
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
684
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
685
+ * Crypto initialization not required.
686
+ * @param {VerifyAsymmetricKeysRequest} request
687
+ * @returns {VerifyAsymmetricKeysResponse}
688
+ */
689
+ verify_asymmetric_keys(request) {
690
+ const ret = wasm.cryptoclient_verify_asymmetric_keys(this.__wbg_ptr, request);
691
+ if (ret[2]) {
692
+ throw takeFromExternrefTable0(ret[1]);
693
+ }
694
+ return takeFromExternrefTable0(ret[0]);
600
695
  }
601
696
  }
602
697
 
603
- export function __wbg_setname_46d623c31ae39910(arg0, arg1, arg2) {
604
- let deferred0_0;
605
- let deferred0_1;
606
- try {
607
- deferred0_0 = arg1;
608
- deferred0_1 = arg2;
609
- getObject(arg0).name = getStringFromWasm0(arg1, arg2);
610
- } finally {
611
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
698
+ const PureCryptoFinalization =
699
+ typeof FinalizationRegistry === "undefined"
700
+ ? { register: () => {}, unregister: () => {} }
701
+ : new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
702
+ /**
703
+ * This module represents a stopgap solution to provide access to primitive crypto functions for JS
704
+ * clients. It is not intended to be used outside of the JS clients and this pattern should not be
705
+ * proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
706
+ * responsible for state and keys.
707
+ */
708
+ export class PureCrypto {
709
+ __destroy_into_raw() {
710
+ const ptr = this.__wbg_ptr;
711
+ this.__wbg_ptr = 0;
712
+ PureCryptoFinalization.unregister(this);
713
+ return ptr;
612
714
  }
613
- }
614
715
 
615
- export function __wbg_setvariant_262a12673324f71b(arg0, arg1, arg2) {
616
- let deferred0_0;
617
- let deferred0_1;
618
- try {
619
- deferred0_0 = arg1;
620
- deferred0_1 = arg2;
621
- getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
622
- } finally {
623
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
716
+ free() {
717
+ const ptr = this.__destroy_into_raw();
718
+ wasm.__wbg_purecrypto_free(ptr, 0);
719
+ }
720
+ /**
721
+ * @param {string} enc_string
722
+ * @param {string} key_b64
723
+ * @returns {string}
724
+ */
725
+ static symmetric_decrypt(enc_string, key_b64) {
726
+ let deferred4_0;
727
+ let deferred4_1;
728
+ try {
729
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
730
+ const len0 = WASM_VECTOR_LEN;
731
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
732
+ const len1 = WASM_VECTOR_LEN;
733
+ const ret = wasm.purecrypto_symmetric_decrypt(ptr0, len0, ptr1, len1);
734
+ var ptr3 = ret[0];
735
+ var len3 = ret[1];
736
+ if (ret[3]) {
737
+ ptr3 = 0;
738
+ len3 = 0;
739
+ throw takeFromExternrefTable0(ret[2]);
740
+ }
741
+ deferred4_0 = ptr3;
742
+ deferred4_1 = len3;
743
+ return getStringFromWasm0(ptr3, len3);
744
+ } finally {
745
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
746
+ }
747
+ }
748
+ /**
749
+ * @param {string} enc_string
750
+ * @param {string} key_b64
751
+ * @returns {Uint8Array}
752
+ */
753
+ static symmetric_decrypt_to_bytes(enc_string, key_b64) {
754
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
755
+ const len0 = WASM_VECTOR_LEN;
756
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
757
+ const len1 = WASM_VECTOR_LEN;
758
+ const ret = wasm.purecrypto_symmetric_decrypt_to_bytes(ptr0, len0, ptr1, len1);
759
+ if (ret[3]) {
760
+ throw takeFromExternrefTable0(ret[2]);
761
+ }
762
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
763
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
764
+ return v3;
765
+ }
766
+ /**
767
+ * @param {Uint8Array} enc_bytes
768
+ * @param {string} key_b64
769
+ * @returns {Uint8Array}
770
+ */
771
+ static symmetric_decrypt_array_buffer(enc_bytes, key_b64) {
772
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
773
+ const len0 = WASM_VECTOR_LEN;
774
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
775
+ const len1 = WASM_VECTOR_LEN;
776
+ const ret = wasm.purecrypto_symmetric_decrypt_array_buffer(ptr0, len0, ptr1, len1);
777
+ if (ret[3]) {
778
+ throw takeFromExternrefTable0(ret[2]);
779
+ }
780
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
781
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
782
+ return v3;
783
+ }
784
+ /**
785
+ * @param {string} plain
786
+ * @param {string} key_b64
787
+ * @returns {string}
788
+ */
789
+ static symmetric_encrypt(plain, key_b64) {
790
+ let deferred4_0;
791
+ let deferred4_1;
792
+ try {
793
+ const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
794
+ const len0 = WASM_VECTOR_LEN;
795
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
796
+ const len1 = WASM_VECTOR_LEN;
797
+ const ret = wasm.purecrypto_symmetric_encrypt(ptr0, len0, ptr1, len1);
798
+ var ptr3 = ret[0];
799
+ var len3 = ret[1];
800
+ if (ret[3]) {
801
+ ptr3 = 0;
802
+ len3 = 0;
803
+ throw takeFromExternrefTable0(ret[2]);
804
+ }
805
+ deferred4_0 = ptr3;
806
+ deferred4_1 = len3;
807
+ return getStringFromWasm0(ptr3, len3);
808
+ } finally {
809
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
810
+ }
811
+ }
812
+ /**
813
+ * @param {Uint8Array} plain
814
+ * @param {string} key_b64
815
+ * @returns {Uint8Array}
816
+ */
817
+ static symmetric_encrypt_to_array_buffer(plain, key_b64) {
818
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
819
+ const len0 = WASM_VECTOR_LEN;
820
+ const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
821
+ const len1 = WASM_VECTOR_LEN;
822
+ const ret = wasm.purecrypto_symmetric_encrypt_to_array_buffer(ptr0, len0, ptr1, len1);
823
+ if (ret[3]) {
824
+ throw takeFromExternrefTable0(ret[2]);
825
+ }
826
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
827
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
828
+ return v3;
624
829
  }
625
830
  }
626
831
 
627
- export function __wbindgen_string_new(arg0, arg1) {
628
- const ret = getStringFromWasm0(arg0, arg1);
629
- return addHeapObject(ret);
630
- }
832
+ const VaultClientFinalization =
833
+ typeof FinalizationRegistry === "undefined"
834
+ ? { register: () => {}, unregister: () => {} }
835
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
631
836
 
632
- export function __wbg_get_ef828680c64da212() {
633
- return handleError(function (arg0, arg1) {
634
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
635
- return addHeapObject(ret);
636
- }, arguments);
637
- }
837
+ export class VaultClient {
838
+ static __wrap(ptr) {
839
+ ptr = ptr >>> 0;
840
+ const obj = Object.create(VaultClient.prototype);
841
+ obj.__wbg_ptr = ptr;
842
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
843
+ return obj;
844
+ }
638
845
 
639
- export function __wbindgen_object_drop_ref(arg0) {
640
- takeObject(arg0);
846
+ __destroy_into_raw() {
847
+ const ptr = this.__wbg_ptr;
848
+ this.__wbg_ptr = 0;
849
+ VaultClientFinalization.unregister(this);
850
+ return ptr;
851
+ }
852
+
853
+ free() {
854
+ const ptr = this.__destroy_into_raw();
855
+ wasm.__wbg_vaultclient_free(ptr, 0);
856
+ }
857
+ /**
858
+ * @returns {ClientFolders}
859
+ */
860
+ folders() {
861
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
862
+ return ClientFolders.__wrap(ret);
863
+ }
864
+ /**
865
+ * @returns {ClientTotp}
866
+ */
867
+ totp() {
868
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
869
+ return ClientTotp.__wrap(ret);
870
+ }
641
871
  }
642
872
 
643
- export function __wbindgen_string_get(arg0, arg1) {
644
- const obj = getObject(arg1);
645
- const ret = typeof obj === "string" ? obj : undefined;
646
- var ptr1 = isLikeNone(ret)
647
- ? 0
648
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
649
- var len1 = WASM_VECTOR_LEN;
873
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
874
+ const ret = String(arg1);
875
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
876
+ const len1 = WASM_VECTOR_LEN;
650
877
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
651
878
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
652
879
  }
653
880
 
654
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
655
- const ret = getObject(arg0) == getObject(arg1);
656
- return ret;
881
+ export function __wbg_abort_775ef1d17fc65868(arg0) {
882
+ arg0.abort();
657
883
  }
658
884
 
659
- export function __wbindgen_is_object(arg0) {
660
- const val = getObject(arg0);
661
- const ret = typeof val === "object" && val !== null;
662
- return ret;
885
+ export function __wbg_append_299d5d48292c0495() {
886
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
887
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
888
+ }, arguments);
663
889
  }
664
890
 
665
- export function __wbg_getwithrefkey_edc2c8960f0f1191(arg0, arg1) {
666
- const ret = getObject(arg0)[getObject(arg1)];
667
- return addHeapObject(ret);
891
+ export function __wbg_append_8c7dd8d641a5f01b() {
892
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
893
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
894
+ }, arguments);
668
895
  }
669
896
 
670
- export function __wbindgen_is_undefined(arg0) {
671
- const ret = getObject(arg0) === undefined;
672
- return ret;
897
+ export function __wbg_append_b2d1fc16de2a0e81() {
898
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
899
+ arg0.append(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5));
900
+ }, arguments);
673
901
  }
674
902
 
675
- export function __wbindgen_in(arg0, arg1) {
676
- const ret = getObject(arg0) in getObject(arg1);
677
- return ret;
903
+ export function __wbg_append_b44785ebeb668479() {
904
+ return handleError(function (arg0, arg1, arg2, arg3) {
905
+ arg0.append(getStringFromWasm0(arg1, arg2), arg3);
906
+ }, arguments);
678
907
  }
679
908
 
680
- export function __wbg_isSafeInteger_b9dff570f01a9100(arg0) {
681
- const ret = Number.isSafeInteger(getObject(arg0));
909
+ export function __wbg_buffer_609cc3eee51ed158(arg0) {
910
+ const ret = arg0.buffer;
682
911
  return ret;
683
912
  }
684
913
 
685
- export function __wbindgen_as_number(arg0) {
686
- const ret = +getObject(arg0);
687
- return ret;
914
+ export function __wbg_call_672a4d21634d4a24() {
915
+ return handleError(function (arg0, arg1) {
916
+ const ret = arg0.call(arg1);
917
+ return ret;
918
+ }, arguments);
688
919
  }
689
920
 
690
- export function __wbindgen_is_string(arg0) {
691
- const ret = typeof getObject(arg0) === "string";
921
+ export function __wbg_call_7cccdd69e0791ae2() {
922
+ return handleError(function (arg0, arg1, arg2) {
923
+ const ret = arg0.call(arg1, arg2);
924
+ return ret;
925
+ }, arguments);
926
+ }
927
+
928
+ export function __wbg_crypto_ed58b8e10a292839(arg0) {
929
+ const ret = arg0.crypto;
692
930
  return ret;
693
931
  }
694
932
 
695
- export function __wbg_entries_c02034de337d3ee2(arg0) {
696
- const ret = Object.entries(getObject(arg0));
697
- return addHeapObject(ret);
933
+ export function __wbg_debug_e17b51583ca6a632(arg0, arg1, arg2, arg3) {
934
+ console.debug(arg0, arg1, arg2, arg3);
698
935
  }
699
936
 
700
- export function __wbg_length_f217bbbf7e8e4df4(arg0) {
701
- const ret = getObject(arg0).length;
937
+ export function __wbg_done_769e5ede4b31c67b(arg0) {
938
+ const ret = arg0.done;
702
939
  return ret;
703
940
  }
704
941
 
705
- export function __wbg_get_5419cf6b954aa11d(arg0, arg1) {
706
- const ret = getObject(arg0)[arg1 >>> 0];
707
- return addHeapObject(ret);
942
+ export function __wbg_entries_3265d4158b33e5dc(arg0) {
943
+ const ret = Object.entries(arg0);
944
+ return ret;
708
945
  }
709
946
 
710
- export function __wbg_call_3bfa248576352471() {
711
- return handleError(function (arg0, arg1, arg2) {
712
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
713
- return addHeapObject(ret);
714
- }, arguments);
947
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
948
+ let deferred0_0;
949
+ let deferred0_1;
950
+ try {
951
+ deferred0_0 = arg0;
952
+ deferred0_1 = arg1;
953
+ console.error(getStringFromWasm0(arg0, arg1));
954
+ } finally {
955
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
956
+ }
715
957
  }
716
958
 
717
- export function __wbindgen_object_clone_ref(arg0) {
718
- const ret = getObject(arg0);
719
- return addHeapObject(ret);
959
+ export function __wbg_error_80de38b3f7cc3c3c(arg0, arg1, arg2, arg3) {
960
+ console.error(arg0, arg1, arg2, arg3);
720
961
  }
721
962
 
722
- export function __wbg_new_e69b5f66fda8f13c() {
723
- const ret = new Object();
724
- return addHeapObject(ret);
963
+ export function __wbg_fetch_4465c2b10f21a927(arg0) {
964
+ const ret = fetch(arg0);
965
+ return ret;
725
966
  }
726
967
 
727
- export function __wbg_setmethod_ce2da76000b02f6a(arg0, arg1, arg2) {
728
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
968
+ export function __wbg_fetch_509096533071c657(arg0, arg1) {
969
+ const ret = arg0.fetch(arg1);
970
+ return ret;
729
971
  }
730
972
 
731
- export function __wbg_new_a9ae04a5200606a5() {
732
- return handleError(function () {
733
- const ret = new Headers();
734
- return addHeapObject(ret);
973
+ export function __wbg_getRandomValues_bcb4912f16000dc4() {
974
+ return handleError(function (arg0, arg1) {
975
+ arg0.getRandomValues(arg1);
735
976
  }, arguments);
736
977
  }
737
978
 
738
- export function __wbg_setheaders_f5205d36e423a544(arg0, arg1) {
739
- getObject(arg0).headers = getObject(arg1);
979
+ export function __wbg_getTime_46267b1c24877e30(arg0) {
980
+ const ret = arg0.getTime();
981
+ return ret;
740
982
  }
741
983
 
742
- export function __wbg_setmode_4919fd636102c586(arg0, arg1) {
743
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
984
+ export function __wbg_get_67b2ba62fc30de12() {
985
+ return handleError(function (arg0, arg1) {
986
+ const ret = Reflect.get(arg0, arg1);
987
+ return ret;
988
+ }, arguments);
744
989
  }
745
990
 
746
- export function __wbg_setcredentials_a4e661320cdb9738(arg0, arg1) {
747
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
991
+ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
992
+ const ret = arg0[arg1 >>> 0];
993
+ return ret;
748
994
  }
749
995
 
750
- export function __wbg_setbody_aa8b691bec428bf4(arg0, arg1) {
751
- getObject(arg0).body = getObject(arg1);
996
+ export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
997
+ const ret = arg0[arg1];
998
+ return ret;
752
999
  }
753
1000
 
754
- export function __wbg_signal_9acfcec9e7dffc22(arg0) {
755
- const ret = getObject(arg0).signal;
756
- return addHeapObject(ret);
1001
+ export function __wbg_has_a5ea9117f258a0ec() {
1002
+ return handleError(function (arg0, arg1) {
1003
+ const ret = Reflect.has(arg0, arg1);
1004
+ return ret;
1005
+ }, arguments);
757
1006
  }
758
1007
 
759
- export function __wbg_setsignal_812ccb8269a7fd90(arg0, arg1) {
760
- getObject(arg0).signal = getObject(arg1);
1008
+ export function __wbg_headers_9cb51cfd2ac780a4(arg0) {
1009
+ const ret = arg0.headers;
1010
+ return ret;
761
1011
  }
762
1012
 
763
- export function __wbg_append_8b3e7f74a47ea7d5() {
764
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
765
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
766
- }, arguments);
1013
+ export function __wbg_info_033d8b8a0838f1d3(arg0, arg1, arg2, arg3) {
1014
+ console.info(arg0, arg1, arg2, arg3);
767
1015
  }
768
1016
 
769
- export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
1017
+ export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
770
1018
  let result;
771
1019
  try {
772
- result = getObject(arg0) instanceof Response;
1020
+ result = arg0 instanceof ArrayBuffer;
773
1021
  } catch (_) {
774
1022
  result = false;
775
1023
  }
@@ -777,446 +1025,485 @@ export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
777
1025
  return ret;
778
1026
  }
779
1027
 
780
- export function __wbg_status_5f4e900d22140a18(arg0) {
781
- const ret = getObject(arg0).status;
1028
+ export function __wbg_instanceof_Response_f2cc20d9f7dfd644(arg0) {
1029
+ let result;
1030
+ try {
1031
+ result = arg0 instanceof Response;
1032
+ } catch (_) {
1033
+ result = false;
1034
+ }
1035
+ const ret = result;
782
1036
  return ret;
783
1037
  }
784
1038
 
785
- export function __wbg_url_58af972663531d16(arg0, arg1) {
786
- const ret = getObject(arg1).url;
787
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
788
- const len1 = WASM_VECTOR_LEN;
789
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
790
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
791
- }
792
-
793
- export function __wbg_headers_1b9bf90c73fae600(arg0) {
794
- const ret = getObject(arg0).headers;
795
- return addHeapObject(ret);
1039
+ export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
1040
+ let result;
1041
+ try {
1042
+ result = arg0 instanceof Uint8Array;
1043
+ } catch (_) {
1044
+ result = false;
1045
+ }
1046
+ const ret = result;
1047
+ return ret;
796
1048
  }
797
1049
 
798
- export function __wbg_next_b06e115d1b01e10b() {
799
- return handleError(function (arg0) {
800
- const ret = getObject(arg0).next();
801
- return addHeapObject(ret);
802
- }, arguments);
1050
+ export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
1051
+ const ret = Number.isSafeInteger(arg0);
1052
+ return ret;
803
1053
  }
804
1054
 
805
- export function __wbg_done_983b5ffcaec8c583(arg0) {
806
- const ret = getObject(arg0).done;
1055
+ export function __wbg_iterator_9a24c88df860dc65() {
1056
+ const ret = Symbol.iterator;
807
1057
  return ret;
808
1058
  }
809
1059
 
810
- export function __wbg_value_2ab8a198c834c26a(arg0) {
811
- const ret = getObject(arg0).value;
812
- return addHeapObject(ret);
1060
+ export function __wbg_length_a446193dc22c12f8(arg0) {
1061
+ const ret = arg0.length;
1062
+ return ret;
813
1063
  }
814
1064
 
815
- export function __wbg_stringify_eead5648c09faaf8() {
816
- return handleError(function (arg0) {
817
- const ret = JSON.stringify(getObject(arg0));
818
- return addHeapObject(ret);
819
- }, arguments);
1065
+ export function __wbg_length_e2d2a49132c1b256(arg0) {
1066
+ const ret = arg0.length;
1067
+ return ret;
820
1068
  }
821
1069
 
822
- export function __wbg_abort_c57daab47a6c1215(arg0) {
823
- getObject(arg0).abort();
1070
+ export function __wbg_log_cad59bb680daec67(arg0, arg1, arg2, arg3) {
1071
+ console.log(arg0, arg1, arg2, arg3);
824
1072
  }
825
1073
 
826
- export function __wbg_text_ebeee8b31af4c919() {
827
- return handleError(function (arg0) {
828
- const ret = getObject(arg0).text();
829
- return addHeapObject(ret);
830
- }, arguments);
1074
+ export function __wbg_msCrypto_0a36e2ec3a343d26(arg0) {
1075
+ const ret = arg0.msCrypto;
1076
+ return ret;
831
1077
  }
832
1078
 
833
- export function __wbindgen_cb_drop(arg0) {
834
- const obj = takeObject(arg0).original;
835
- if (obj.cnt-- == 1) {
836
- obj.a = 0;
837
- return true;
838
- }
839
- const ret = false;
1079
+ export function __wbg_new0_f788a2397c7ca929() {
1080
+ const ret = new Date();
840
1081
  return ret;
841
1082
  }
842
1083
 
843
- export function __wbindgen_error_new(arg0, arg1) {
844
- const ret = new Error(getStringFromWasm0(arg0, arg1));
845
- return addHeapObject(ret);
1084
+ export function __wbg_new_018dcc2d6c8c2f6a() {
1085
+ return handleError(function () {
1086
+ const ret = new Headers();
1087
+ return ret;
1088
+ }, arguments);
846
1089
  }
847
1090
 
848
- export function __wbg_new_1073970097e5a420(arg0, arg1) {
1091
+ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
849
1092
  try {
850
1093
  var state0 = { a: arg0, b: arg1 };
851
1094
  var cb0 = (arg0, arg1) => {
852
1095
  const a = state0.a;
853
1096
  state0.a = 0;
854
1097
  try {
855
- return __wbg_adapter_125(a, state0.b, arg0, arg1);
1098
+ return __wbg_adapter_152(a, state0.b, arg0, arg1);
856
1099
  } finally {
857
1100
  state0.a = a;
858
1101
  }
859
1102
  };
860
1103
  const ret = new Promise(cb0);
861
- return addHeapObject(ret);
1104
+ return ret;
862
1105
  } finally {
863
1106
  state0.a = state0.b = 0;
864
1107
  }
865
1108
  }
866
1109
 
867
- export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
868
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1110
+ export function __wbg_new_405e22f390576ce2() {
1111
+ const ret = new Object();
1112
+ return ret;
1113
+ }
1114
+
1115
+ export function __wbg_new_78feb108b6472713() {
1116
+ const ret = new Array();
1117
+ return ret;
869
1118
  }
870
1119
 
871
- export function __wbg_new_abda76e883ba8a5f() {
1120
+ export function __wbg_new_8a6f238a6ece86ea() {
872
1121
  const ret = new Error();
873
- return addHeapObject(ret);
1122
+ return ret;
874
1123
  }
875
1124
 
876
- export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
877
- const ret = getObject(arg1).stack;
878
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
879
- const len1 = WASM_VECTOR_LEN;
880
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
881
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1125
+ export function __wbg_new_9fd39a253424609a() {
1126
+ return handleError(function () {
1127
+ const ret = new FormData();
1128
+ return ret;
1129
+ }, arguments);
1130
+ }
1131
+
1132
+ export function __wbg_new_a12002a7f91c75be(arg0) {
1133
+ const ret = new Uint8Array(arg0);
1134
+ return ret;
1135
+ }
1136
+
1137
+ export function __wbg_new_c68d7209be747379(arg0, arg1) {
1138
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1139
+ return ret;
1140
+ }
1141
+
1142
+ export function __wbg_new_e25e5aab09ff45db() {
1143
+ return handleError(function () {
1144
+ const ret = new AbortController();
1145
+ return ret;
1146
+ }, arguments);
882
1147
  }
883
1148
 
884
- export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
1149
+ export function __wbg_new_f24b6d53abe5bc82(arg0, arg1) {
885
1150
  let deferred0_0;
886
1151
  let deferred0_1;
887
1152
  try {
888
1153
  deferred0_0 = arg0;
889
1154
  deferred0_1 = arg1;
890
- console.error(getStringFromWasm0(arg0, arg1));
1155
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1156
+ return ret;
891
1157
  } finally {
892
1158
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
893
1159
  }
894
1160
  }
895
1161
 
896
- export function __wbg_crypto_1d1f22824a6a080c(arg0) {
897
- const ret = getObject(arg0).crypto;
898
- return addHeapObject(ret);
1162
+ export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
1163
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1164
+ return ret;
899
1165
  }
900
1166
 
901
- export function __wbg_process_4a72847cc503995b(arg0) {
902
- const ret = getObject(arg0).process;
903
- return addHeapObject(ret);
1167
+ export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
1168
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1169
+ return ret;
904
1170
  }
905
1171
 
906
- export function __wbg_versions_f686565e586dd935(arg0) {
907
- const ret = getObject(arg0).versions;
908
- return addHeapObject(ret);
1172
+ export function __wbg_newwithlength_a381634e90c276d4(arg0) {
1173
+ const ret = new Uint8Array(arg0 >>> 0);
1174
+ return ret;
909
1175
  }
910
1176
 
911
- export function __wbg_node_104a2ff8d6ea03a2(arg0) {
912
- const ret = getObject(arg0).node;
913
- return addHeapObject(ret);
1177
+ export function __wbg_newwithstrandinit_06c535e0a867c635() {
1178
+ return handleError(function (arg0, arg1, arg2) {
1179
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1180
+ return ret;
1181
+ }, arguments);
914
1182
  }
915
1183
 
916
- export function __wbg_require_cca90b1a94a0255b() {
917
- return handleError(function () {
918
- const ret = module.require;
919
- return addHeapObject(ret);
1184
+ export function __wbg_newwithu8arraysequenceandoptions_068570c487f69127() {
1185
+ return handleError(function (arg0, arg1) {
1186
+ const ret = new Blob(arg0, arg1);
1187
+ return ret;
920
1188
  }, arguments);
921
1189
  }
922
1190
 
923
- export function __wbindgen_is_function(arg0) {
924
- const ret = typeof getObject(arg0) === "function";
1191
+ export function __wbg_next_25feadfc0913fea9(arg0) {
1192
+ const ret = arg0.next;
925
1193
  return ret;
926
1194
  }
927
1195
 
928
- export function __wbg_msCrypto_eb05e62b530a1508(arg0) {
929
- const ret = getObject(arg0).msCrypto;
930
- return addHeapObject(ret);
931
- }
932
-
933
- export function __wbg_newwithlength_76462a666eca145f(arg0) {
934
- const ret = new Uint8Array(arg0 >>> 0);
935
- return addHeapObject(ret);
1196
+ export function __wbg_next_6574e1a8a62d1055() {
1197
+ return handleError(function (arg0) {
1198
+ const ret = arg0.next();
1199
+ return ret;
1200
+ }, arguments);
936
1201
  }
937
1202
 
938
- export function __wbindgen_memory() {
939
- const ret = wasm.memory;
940
- return addHeapObject(ret);
1203
+ export function __wbg_node_02999533c4ea02e3(arg0) {
1204
+ const ret = arg0.node;
1205
+ return ret;
941
1206
  }
942
1207
 
943
- export function __wbg_buffer_ccaed51a635d8a2d(arg0) {
944
- const ret = getObject(arg0).buffer;
945
- return addHeapObject(ret);
1208
+ export function __wbg_process_5c1d670bc53614b8(arg0) {
1209
+ const ret = arg0.process;
1210
+ return ret;
946
1211
  }
947
1212
 
948
- export function __wbg_newwithbyteoffsetandlength_7e3eb787208af730(arg0, arg1, arg2) {
949
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
950
- return addHeapObject(ret);
1213
+ export function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
1214
+ const ret = arg0.push(arg1);
1215
+ return ret;
951
1216
  }
952
1217
 
953
- export function __wbg_randomFillSync_5c9c955aa56b6049() {
954
- return handleError(function (arg0, arg1) {
955
- getObject(arg0).randomFillSync(takeObject(arg1));
956
- }, arguments);
1218
+ export function __wbg_queueMicrotask_97d92b4fcc8a61c5(arg0) {
1219
+ queueMicrotask(arg0);
957
1220
  }
958
1221
 
959
- export function __wbg_subarray_975a06f9dbd16995(arg0, arg1, arg2) {
960
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
961
- return addHeapObject(ret);
1222
+ export function __wbg_queueMicrotask_d3219def82552485(arg0) {
1223
+ const ret = arg0.queueMicrotask;
1224
+ return ret;
962
1225
  }
963
1226
 
964
- export function __wbg_getRandomValues_3aa56aa6edec874c() {
1227
+ export function __wbg_randomFillSync_ab2cfe79ebbf2740() {
965
1228
  return handleError(function (arg0, arg1) {
966
- getObject(arg0).getRandomValues(getObject(arg1));
1229
+ arg0.randomFillSync(arg1);
967
1230
  }, arguments);
968
1231
  }
969
1232
 
970
- export function __wbg_new_fec2611eb9180f95(arg0) {
971
- const ret = new Uint8Array(getObject(arg0));
972
- return addHeapObject(ret);
1233
+ export function __wbg_require_79b1e9274cde3c87() {
1234
+ return handleError(function () {
1235
+ const ret = module.require;
1236
+ return ret;
1237
+ }, arguments);
973
1238
  }
974
1239
 
975
- export function __wbg_set_ec2fcf81bc573fd9(arg0, arg1, arg2) {
976
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1240
+ export function __wbg_resolve_4851785c9c5f573d(arg0) {
1241
+ const ret = Promise.resolve(arg0);
1242
+ return ret;
977
1243
  }
978
1244
 
979
- export function __wbg_self_bf91bf94d9e04084() {
980
- return handleError(function () {
981
- const ret = self.self;
982
- return addHeapObject(ret);
983
- }, arguments);
1245
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
1246
+ arg0[arg1] = arg2;
984
1247
  }
985
1248
 
986
- export function __wbg_window_52dd9f07d03fd5f8() {
987
- return handleError(function () {
988
- const ret = window.window;
989
- return addHeapObject(ret);
990
- }, arguments);
1249
+ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
1250
+ arg0.set(arg1, arg2 >>> 0);
991
1251
  }
992
1252
 
993
- export function __wbg_globalThis_05c129bf37fcf1be() {
994
- return handleError(function () {
995
- const ret = globalThis.globalThis;
996
- return addHeapObject(ret);
997
- }, arguments);
1253
+ export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
1254
+ arg0.body = arg1;
998
1255
  }
999
1256
 
1000
- export function __wbg_global_3eca19bb09e9c484() {
1001
- return handleError(function () {
1002
- const ret = global.global;
1003
- return addHeapObject(ret);
1004
- }, arguments);
1257
+ export function __wbg_setcredentials_c3a22f1cd105a2c6(arg0, arg1) {
1258
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1005
1259
  }
1006
1260
 
1007
- export function __wbg_newnoargs_1ede4bf2ebbaaf43(arg0, arg1) {
1008
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1009
- return addHeapObject(ret);
1261
+ export function __wbg_setheaders_834c0bdb6a8949ad(arg0, arg1) {
1262
+ arg0.headers = arg1;
1010
1263
  }
1011
1264
 
1012
- export function __wbg_call_a9ef466721e824f2() {
1013
- return handleError(function (arg0, arg1) {
1014
- const ret = getObject(arg0).call(getObject(arg1));
1015
- return addHeapObject(ret);
1016
- }, arguments);
1265
+ export function __wbg_setmethod_3c5280fe5d890842(arg0, arg1, arg2) {
1266
+ arg0.method = getStringFromWasm0(arg1, arg2);
1017
1267
  }
1018
1268
 
1019
- export function __wbg_iterator_695d699a44d6234c() {
1020
- const ret = Symbol.iterator;
1021
- return addHeapObject(ret);
1269
+ export function __wbg_setmode_5dc300b865044b65(arg0, arg1) {
1270
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1022
1271
  }
1023
1272
 
1024
- export function __wbg_next_13b477da1eaa3897(arg0) {
1025
- const ret = getObject(arg0).next;
1026
- return addHeapObject(ret);
1273
+ export function __wbg_setname_c0e2d6f348c746f4(arg0, arg1, arg2) {
1274
+ let deferred0_0;
1275
+ let deferred0_1;
1276
+ try {
1277
+ deferred0_0 = arg1;
1278
+ deferred0_1 = arg2;
1279
+ arg0.name = getStringFromWasm0(arg1, arg2);
1280
+ } finally {
1281
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1282
+ }
1027
1283
  }
1028
1284
 
1029
- export function __wbg_new_034f913e7636e987() {
1030
- const ret = new Array();
1031
- return addHeapObject(ret);
1285
+ export function __wbg_setsignal_75b21ef3a81de905(arg0, arg1) {
1286
+ arg0.signal = arg1;
1032
1287
  }
1033
1288
 
1034
- export function __wbg_push_36cf4d81d7da33d1(arg0, arg1) {
1035
- const ret = getObject(arg0).push(getObject(arg1));
1036
- return ret;
1289
+ export function __wbg_settype_39ed370d3edd403c(arg0, arg1, arg2) {
1290
+ arg0.type = getStringFromWasm0(arg1, arg2);
1037
1291
  }
1038
1292
 
1039
- export function __wbg_instanceof_ArrayBuffer_74945570b4a62ec7(arg0) {
1040
- let result;
1293
+ export function __wbg_setvariant_d1d41b778dfe9c17(arg0, arg1, arg2) {
1294
+ let deferred0_0;
1295
+ let deferred0_1;
1041
1296
  try {
1042
- result = getObject(arg0) instanceof ArrayBuffer;
1043
- } catch (_) {
1044
- result = false;
1297
+ deferred0_0 = arg1;
1298
+ deferred0_1 = arg2;
1299
+ arg0.variant = getStringFromWasm0(arg1, arg2);
1300
+ } finally {
1301
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1045
1302
  }
1046
- const ret = result;
1047
- return ret;
1048
1303
  }
1049
1304
 
1050
- export function __wbg_new_70a2f23d1565c04c(arg0, arg1) {
1051
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1052
- return addHeapObject(ret);
1305
+ export function __wbg_signal_aaf9ad74119f20a4(arg0) {
1306
+ const ret = arg0.signal;
1307
+ return ret;
1053
1308
  }
1054
1309
 
1055
- export function __wbg_has_bd717f25f195f23d() {
1056
- return handleError(function (arg0, arg1) {
1057
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
1058
- return ret;
1059
- }, arguments);
1310
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
1311
+ const ret = arg1.stack;
1312
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1313
+ const len1 = WASM_VECTOR_LEN;
1314
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1315
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1060
1316
  }
1061
1317
 
1062
- export function __wbg_resolve_0aad7c1484731c99(arg0) {
1063
- const ret = Promise.resolve(getObject(arg0));
1064
- return addHeapObject(ret);
1318
+ export function __wbg_static_accessor_GLOBAL_88a902d13a557d07() {
1319
+ const ret = typeof global === "undefined" ? null : global;
1320
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1065
1321
  }
1066
1322
 
1067
- export function __wbg_then_748f75edfb032440(arg0, arg1) {
1068
- const ret = getObject(arg0).then(getObject(arg1));
1069
- return addHeapObject(ret);
1323
+ export function __wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0() {
1324
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
1325
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1070
1326
  }
1071
1327
 
1072
- export function __wbg_then_4866a7d9f55d8f3e(arg0, arg1, arg2) {
1073
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1074
- return addHeapObject(ret);
1328
+ export function __wbg_static_accessor_SELF_37c5d418e4bf5819() {
1329
+ const ret = typeof self === "undefined" ? null : self;
1330
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1075
1331
  }
1076
1332
 
1077
- export function __wbg_length_9254c4bd3b9f23c4(arg0) {
1078
- const ret = getObject(arg0).length;
1079
- return ret;
1333
+ export function __wbg_static_accessor_WINDOW_5de37043a91a9c40() {
1334
+ const ret = typeof window === "undefined" ? null : window;
1335
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1080
1336
  }
1081
1337
 
1082
- export function __wbg_instanceof_Uint8Array_df0761410414ef36(arg0) {
1083
- let result;
1084
- try {
1085
- result = getObject(arg0) instanceof Uint8Array;
1086
- } catch (_) {
1087
- result = false;
1088
- }
1089
- const ret = result;
1338
+ export function __wbg_status_f6360336ca686bf0(arg0) {
1339
+ const ret = arg0.status;
1090
1340
  return ret;
1091
1341
  }
1092
1342
 
1093
- export function __wbg_new_4e7308fbedde3997() {
1094
- return handleError(function () {
1095
- const ret = new FormData();
1096
- return addHeapObject(ret);
1343
+ export function __wbg_stringify_f7ed6987935b4a24() {
1344
+ return handleError(function (arg0) {
1345
+ const ret = JSON.stringify(arg0);
1346
+ return ret;
1097
1347
  }, arguments);
1098
1348
  }
1099
1349
 
1100
- export function __wbg_append_43a4b1c9d5df4168() {
1101
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1102
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1350
+ export function __wbg_subarray_aa9065fa9dc5df96(arg0, arg1, arg2) {
1351
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1352
+ return ret;
1353
+ }
1354
+
1355
+ export function __wbg_text_7805bea50de2af49() {
1356
+ return handleError(function (arg0) {
1357
+ const ret = arg0.text();
1358
+ return ret;
1103
1359
  }, arguments);
1104
1360
  }
1105
1361
 
1106
- export function __wbg_settype_623d2ee701e6310a(arg0, arg1, arg2) {
1107
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
1362
+ export function __wbg_then_44b73946d2fb3e7d(arg0, arg1) {
1363
+ const ret = arg0.then(arg1);
1364
+ return ret;
1108
1365
  }
1109
1366
 
1110
- export function __wbg_newwithu8arraysequenceandoptions_d41c0fdf78490206() {
1111
- return handleError(function (arg0, arg1) {
1112
- const ret = new Blob(getObject(arg0), getObject(arg1));
1113
- return addHeapObject(ret);
1114
- }, arguments);
1367
+ export function __wbg_then_48b406749878a531(arg0, arg1, arg2) {
1368
+ const ret = arg0.then(arg1, arg2);
1369
+ return ret;
1115
1370
  }
1116
1371
 
1117
- export function __wbg_append_7ee78799a92a9731() {
1118
- return handleError(function (arg0, arg1, arg2, arg3) {
1119
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
1120
- }, arguments);
1372
+ export function __wbg_url_ae10c34ca209681d(arg0, arg1) {
1373
+ const ret = arg1.url;
1374
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1375
+ const len1 = WASM_VECTOR_LEN;
1376
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1377
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1121
1378
  }
1122
1379
 
1123
- export function __wbg_append_8135c71037096394() {
1124
- return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1125
- getObject(arg0).append(
1126
- getStringFromWasm0(arg1, arg2),
1127
- getObject(arg3),
1128
- getStringFromWasm0(arg4, arg5),
1129
- );
1130
- }, arguments);
1380
+ export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
1381
+ const ret = arg0.value;
1382
+ return ret;
1131
1383
  }
1132
1384
 
1133
- export function __wbg_fetch_f8d735ba6fe1b719(arg0) {
1134
- const ret = fetch(getObject(arg0));
1135
- return addHeapObject(ret);
1385
+ export function __wbg_versions_c71aa1626a93e0a1(arg0) {
1386
+ const ret = arg0.versions;
1387
+ return ret;
1136
1388
  }
1137
1389
 
1138
- export function __wbg_fetch_1fdc4448ed9eec00(arg0, arg1) {
1139
- const ret = getObject(arg0).fetch(getObject(arg1));
1140
- return addHeapObject(ret);
1390
+ export function __wbg_warn_aaf1f4664a035bd6(arg0, arg1, arg2, arg3) {
1391
+ console.warn(arg0, arg1, arg2, arg3);
1141
1392
  }
1142
1393
 
1143
- export function __wbg_new_75169ae5a9683c55() {
1144
- return handleError(function () {
1145
- const ret = new AbortController();
1146
- return addHeapObject(ret);
1147
- }, arguments);
1394
+ export function __wbindgen_as_number(arg0) {
1395
+ const ret = +arg0;
1396
+ return ret;
1148
1397
  }
1149
1398
 
1150
1399
  export function __wbindgen_boolean_get(arg0) {
1151
- const v = getObject(arg0);
1400
+ const v = arg0;
1152
1401
  const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
1153
1402
  return ret;
1154
1403
  }
1155
1404
 
1156
- export function __wbindgen_number_get(arg0, arg1) {
1157
- const obj = getObject(arg1);
1158
- const ret = typeof obj === "number" ? obj : undefined;
1159
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1160
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1405
+ export function __wbindgen_cb_drop(arg0) {
1406
+ const obj = arg0.original;
1407
+ if (obj.cnt-- == 1) {
1408
+ obj.a = 0;
1409
+ return true;
1410
+ }
1411
+ const ret = false;
1412
+ return ret;
1161
1413
  }
1162
1414
 
1163
- export function __wbg_String_b9412f8799faab3e(arg0, arg1) {
1164
- const ret = String(getObject(arg1));
1165
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1166
- const len1 = WASM_VECTOR_LEN;
1167
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1168
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1415
+ export function __wbindgen_closure_wrapper2146(arg0, arg1, arg2) {
1416
+ const ret = makeMutClosure(arg0, arg1, 546, __wbg_adapter_42);
1417
+ return ret;
1169
1418
  }
1170
1419
 
1171
1420
  export function __wbindgen_debug_string(arg0, arg1) {
1172
- const ret = debugString(getObject(arg1));
1421
+ const ret = debugString(arg1);
1173
1422
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1174
1423
  const len1 = WASM_VECTOR_LEN;
1175
1424
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1176
1425
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1177
1426
  }
1178
1427
 
1179
- export function __wbindgen_throw(arg0, arg1) {
1180
- throw new Error(getStringFromWasm0(arg0, arg1));
1428
+ export function __wbindgen_error_new(arg0, arg1) {
1429
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1430
+ return ret;
1181
1431
  }
1182
1432
 
1183
- export function __wbg_queueMicrotask_848aa4969108a57e(arg0) {
1184
- const ret = getObject(arg0).queueMicrotask;
1185
- return addHeapObject(ret);
1433
+ export function __wbindgen_in(arg0, arg1) {
1434
+ const ret = arg0 in arg1;
1435
+ return ret;
1186
1436
  }
1187
1437
 
1188
- export function __wbg_queueMicrotask_c5419c06eab41e73(arg0) {
1189
- queueMicrotask(getObject(arg0));
1438
+ export function __wbindgen_init_externref_table() {
1439
+ const table = wasm.__wbindgen_export_4;
1440
+ const offset = table.grow(4);
1441
+ table.set(0, undefined);
1442
+ table.set(offset + 0, undefined);
1443
+ table.set(offset + 1, null);
1444
+ table.set(offset + 2, true);
1445
+ table.set(offset + 3, false);
1190
1446
  }
1191
1447
 
1192
- export function __wbg_newwithstrandinit_4b92c89af0a8e383() {
1193
- return handleError(function (arg0, arg1, arg2) {
1194
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1195
- return addHeapObject(ret);
1196
- }, arguments);
1448
+ export function __wbindgen_is_function(arg0) {
1449
+ const ret = typeof arg0 === "function";
1450
+ return ret;
1197
1451
  }
1198
1452
 
1199
- export function __wbg_debug_a0b6c2c5ac9a4bfd(arg0, arg1, arg2, arg3) {
1200
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1453
+ export function __wbindgen_is_object(arg0) {
1454
+ const val = arg0;
1455
+ const ret = typeof val === "object" && val !== null;
1456
+ return ret;
1201
1457
  }
1202
1458
 
1203
- export function __wbg_error_4d17c5bb1ca90c94(arg0, arg1, arg2, arg3) {
1204
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1459
+ export function __wbindgen_is_string(arg0) {
1460
+ const ret = typeof arg0 === "string";
1461
+ return ret;
1205
1462
  }
1206
1463
 
1207
- export function __wbg_info_1c7fba7da21072d1(arg0, arg1, arg2, arg3) {
1208
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1464
+ export function __wbindgen_is_undefined(arg0) {
1465
+ const ret = arg0 === undefined;
1466
+ return ret;
1209
1467
  }
1210
1468
 
1211
- export function __wbg_log_4de37a0274d94769(arg0, arg1, arg2, arg3) {
1212
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1469
+ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
1470
+ const ret = arg0 == arg1;
1471
+ return ret;
1213
1472
  }
1214
1473
 
1215
- export function __wbg_warn_2e2787d40aad9a81(arg0, arg1, arg2, arg3) {
1216
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1474
+ export function __wbindgen_memory() {
1475
+ const ret = wasm.memory;
1476
+ return ret;
1217
1477
  }
1218
1478
 
1219
- export function __wbindgen_closure_wrapper1799(arg0, arg1, arg2) {
1220
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_38);
1221
- return addHeapObject(ret);
1479
+ export function __wbindgen_number_get(arg0, arg1) {
1480
+ const obj = arg1;
1481
+ const ret = typeof obj === "number" ? obj : undefined;
1482
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1483
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1484
+ }
1485
+
1486
+ export function __wbindgen_number_new(arg0) {
1487
+ const ret = arg0;
1488
+ return ret;
1489
+ }
1490
+
1491
+ export function __wbindgen_string_get(arg0, arg1) {
1492
+ const obj = arg1;
1493
+ const ret = typeof obj === "string" ? obj : undefined;
1494
+ var ptr1 = isLikeNone(ret)
1495
+ ? 0
1496
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1497
+ var len1 = WASM_VECTOR_LEN;
1498
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1499
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1500
+ }
1501
+
1502
+ export function __wbindgen_string_new(arg0, arg1) {
1503
+ const ret = getStringFromWasm0(arg0, arg1);
1504
+ return ret;
1505
+ }
1506
+
1507
+ export function __wbindgen_throw(arg0, arg1) {
1508
+ throw new Error(getStringFromWasm0(arg0, arg1));
1222
1509
  }