@bitwarden/sdk-internal 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1045 @@
1
+ let imports = {};
2
+ imports["__wbindgen_placeholder__"] = module.exports;
3
+ let wasm;
4
+ const { WasmError } = require(
5
+ String.raw`./snippets/bitwarden-wasm-internal-4c2122daf2564d19/src/error.js`,
6
+ );
7
+ const { TextEncoder, TextDecoder } = require(`util`);
8
+
9
+ const heap = new Array(128).fill(undefined);
10
+
11
+ heap.push(undefined, null, true, false);
12
+
13
+ function getObject(idx) {
14
+ return heap[idx];
15
+ }
16
+
17
+ let WASM_VECTOR_LEN = 0;
18
+
19
+ let cachedUint8ArrayMemory0 = null;
20
+
21
+ function getUint8ArrayMemory0() {
22
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
23
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
24
+ }
25
+ return cachedUint8ArrayMemory0;
26
+ }
27
+
28
+ let cachedTextEncoder = new TextEncoder("utf-8");
29
+
30
+ const encodeString =
31
+ typeof cachedTextEncoder.encodeInto === "function"
32
+ ? function (arg, view) {
33
+ return cachedTextEncoder.encodeInto(arg, view);
34
+ }
35
+ : function (arg, view) {
36
+ const buf = cachedTextEncoder.encode(arg);
37
+ view.set(buf);
38
+ return {
39
+ read: arg.length,
40
+ written: buf.length,
41
+ };
42
+ };
43
+
44
+ function passStringToWasm0(arg, malloc, realloc) {
45
+ if (realloc === undefined) {
46
+ const buf = cachedTextEncoder.encode(arg);
47
+ const ptr = malloc(buf.length, 1) >>> 0;
48
+ getUint8ArrayMemory0()
49
+ .subarray(ptr, ptr + buf.length)
50
+ .set(buf);
51
+ WASM_VECTOR_LEN = buf.length;
52
+ return ptr;
53
+ }
54
+
55
+ let len = arg.length;
56
+ let ptr = malloc(len, 1) >>> 0;
57
+
58
+ const mem = getUint8ArrayMemory0();
59
+
60
+ let offset = 0;
61
+
62
+ for (; offset < len; offset++) {
63
+ const code = arg.charCodeAt(offset);
64
+ if (code > 0x7f) break;
65
+ mem[ptr + offset] = code;
66
+ }
67
+
68
+ if (offset !== len) {
69
+ if (offset !== 0) {
70
+ arg = arg.slice(offset);
71
+ }
72
+ ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
73
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
74
+ const ret = encodeString(arg, view);
75
+
76
+ offset += ret.written;
77
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
78
+ }
79
+
80
+ WASM_VECTOR_LEN = offset;
81
+ return ptr;
82
+ }
83
+
84
+ function isLikeNone(x) {
85
+ return x === undefined || x === null;
86
+ }
87
+
88
+ let cachedDataViewMemory0 = null;
89
+
90
+ function getDataViewMemory0() {
91
+ if (
92
+ cachedDataViewMemory0 === null ||
93
+ cachedDataViewMemory0.buffer.detached === true ||
94
+ (cachedDataViewMemory0.buffer.detached === undefined &&
95
+ cachedDataViewMemory0.buffer !== wasm.memory.buffer)
96
+ ) {
97
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
98
+ }
99
+ return cachedDataViewMemory0;
100
+ }
101
+
102
+ let heap_next = heap.length;
103
+
104
+ function dropObject(idx) {
105
+ if (idx < 132) return;
106
+ heap[idx] = heap_next;
107
+ heap_next = idx;
108
+ }
109
+
110
+ function takeObject(idx) {
111
+ const ret = getObject(idx);
112
+ dropObject(idx);
113
+ return ret;
114
+ }
115
+
116
+ function addHeapObject(obj) {
117
+ if (heap_next === heap.length) heap.push(heap.length + 1);
118
+ const idx = heap_next;
119
+ heap_next = heap[idx];
120
+
121
+ heap[idx] = obj;
122
+ return idx;
123
+ }
124
+
125
+ let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
126
+
127
+ cachedTextDecoder.decode();
128
+
129
+ function getStringFromWasm0(ptr, len) {
130
+ ptr = ptr >>> 0;
131
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
132
+ }
133
+
134
+ function debugString(val) {
135
+ // primitive types
136
+ const type = typeof val;
137
+ if (type == "number" || type == "boolean" || val == null) {
138
+ return `${val}`;
139
+ }
140
+ if (type == "string") {
141
+ return `"${val}"`;
142
+ }
143
+ if (type == "symbol") {
144
+ const description = val.description;
145
+ if (description == null) {
146
+ return "Symbol";
147
+ } else {
148
+ return `Symbol(${description})`;
149
+ }
150
+ }
151
+ if (type == "function") {
152
+ const name = val.name;
153
+ if (typeof name == "string" && name.length > 0) {
154
+ return `Function(${name})`;
155
+ } else {
156
+ return "Function";
157
+ }
158
+ }
159
+ // objects
160
+ if (Array.isArray(val)) {
161
+ const length = val.length;
162
+ let debug = "[";
163
+ if (length > 0) {
164
+ debug += debugString(val[0]);
165
+ }
166
+ for (let i = 1; i < length; i++) {
167
+ debug += ", " + debugString(val[i]);
168
+ }
169
+ debug += "]";
170
+ return debug;
171
+ }
172
+ // Test for built-in
173
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
174
+ let className;
175
+ if (builtInMatches.length > 1) {
176
+ className = builtInMatches[1];
177
+ } else {
178
+ // Failed to match the standard '[object ClassName]'
179
+ return toString.call(val);
180
+ }
181
+ if (className == "Object") {
182
+ // we're a user defined class or Object
183
+ // JSON.stringify avoids problems with cycles, and is generally much
184
+ // easier than looping through ownProperties of `val`.
185
+ try {
186
+ return "Object(" + JSON.stringify(val) + ")";
187
+ } catch (_) {
188
+ return "Object";
189
+ }
190
+ }
191
+ // errors
192
+ if (val instanceof Error) {
193
+ return `${val.name}: ${val.message}\n${val.stack}`;
194
+ }
195
+ // TODO we could test for more things here, like `Set`s and `Map`s.
196
+ return className;
197
+ }
198
+
199
+ const CLOSURE_DTORS =
200
+ typeof FinalizationRegistry === "undefined"
201
+ ? { register: () => {}, unregister: () => {} }
202
+ : new FinalizationRegistry((state) => {
203
+ wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
204
+ });
205
+
206
+ function makeMutClosure(arg0, arg1, dtor, f) {
207
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
208
+ const real = (...args) => {
209
+ // First up with a closure we increment the internal reference
210
+ // count. This ensures that the Rust closure environment won't
211
+ // be deallocated while we're invoking it.
212
+ state.cnt++;
213
+ const a = state.a;
214
+ state.a = 0;
215
+ try {
216
+ return f(a, state.b, ...args);
217
+ } finally {
218
+ if (--state.cnt === 0) {
219
+ wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
220
+ CLOSURE_DTORS.unregister(state);
221
+ } else {
222
+ state.a = a;
223
+ }
224
+ }
225
+ };
226
+ real.original = state;
227
+ CLOSURE_DTORS.register(real, state, state);
228
+ return real;
229
+ }
230
+ function __wbg_adapter_38(arg0, arg1, arg2) {
231
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb01d34a575ef8bb3(
232
+ arg0,
233
+ arg1,
234
+ addHeapObject(arg2),
235
+ );
236
+ }
237
+
238
+ function handleError(f, args) {
239
+ try {
240
+ return f.apply(this, args);
241
+ } catch (e) {
242
+ wasm.__wbindgen_exn_store(addHeapObject(e));
243
+ }
244
+ }
245
+ function __wbg_adapter_98(arg0, arg1, arg2, arg3) {
246
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h6a4d43ef1f8d92b4(
247
+ arg0,
248
+ arg1,
249
+ addHeapObject(arg2),
250
+ addHeapObject(arg3),
251
+ );
252
+ }
253
+
254
+ module.exports.LogLevel = Object.freeze({
255
+ Trace: 0,
256
+ 0: "Trace",
257
+ Debug: 1,
258
+ 1: "Debug",
259
+ Info: 2,
260
+ 2: "Info",
261
+ Warn: 3,
262
+ 3: "Warn",
263
+ Error: 4,
264
+ 4: "Error",
265
+ });
266
+
267
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
268
+
269
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
270
+
271
+ const BitwardenClientFinalization =
272
+ typeof FinalizationRegistry === "undefined"
273
+ ? { register: () => {}, unregister: () => {} }
274
+ : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
275
+
276
+ class BitwardenClient {
277
+ __destroy_into_raw() {
278
+ const ptr = this.__wbg_ptr;
279
+ this.__wbg_ptr = 0;
280
+ BitwardenClientFinalization.unregister(this);
281
+ return ptr;
282
+ }
283
+
284
+ free() {
285
+ const ptr = this.__destroy_into_raw();
286
+ wasm.__wbg_bitwardenclient_free(ptr, 0);
287
+ }
288
+ /**
289
+ * @param {ClientSettings | undefined} [settings]
290
+ * @param {LogLevel | undefined} [log_level]
291
+ */
292
+ constructor(settings, log_level) {
293
+ const ret = wasm.bitwardenclient_new(
294
+ isLikeNone(settings) ? 0 : addHeapObject(settings),
295
+ isLikeNone(log_level) ? 5 : log_level,
296
+ );
297
+ this.__wbg_ptr = ret >>> 0;
298
+ BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
299
+ return this;
300
+ }
301
+ /**
302
+ * Test method, echoes back the input
303
+ * @param {string} msg
304
+ * @returns {string}
305
+ */
306
+ echo(msg) {
307
+ let deferred2_0;
308
+ let deferred2_1;
309
+ try {
310
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
311
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
312
+ const len0 = WASM_VECTOR_LEN;
313
+ wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
314
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
315
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
316
+ deferred2_0 = r0;
317
+ deferred2_1 = r1;
318
+ return getStringFromWasm0(r0, r1);
319
+ } finally {
320
+ wasm.__wbindgen_add_to_stack_pointer(16);
321
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
322
+ }
323
+ }
324
+ /**
325
+ * Test method, calls http endpoint
326
+ * @param {string} url
327
+ * @returns {Promise<string>}
328
+ */
329
+ http_get(url) {
330
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
331
+ const len0 = WASM_VECTOR_LEN;
332
+ const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
333
+ return takeObject(ret);
334
+ }
335
+ /**
336
+ * @returns {ClientCrypto}
337
+ */
338
+ crypto() {
339
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
340
+ return ClientCrypto.__wrap(ret);
341
+ }
342
+ /**
343
+ * @returns {ClientVault}
344
+ */
345
+ vault() {
346
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
347
+ return ClientVault.__wrap(ret);
348
+ }
349
+ }
350
+ module.exports.BitwardenClient = BitwardenClient;
351
+
352
+ const ClientCryptoFinalization =
353
+ typeof FinalizationRegistry === "undefined"
354
+ ? { register: () => {}, unregister: () => {} }
355
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
356
+
357
+ class ClientCrypto {
358
+ static __wrap(ptr) {
359
+ ptr = ptr >>> 0;
360
+ const obj = Object.create(ClientCrypto.prototype);
361
+ obj.__wbg_ptr = ptr;
362
+ ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
363
+ return obj;
364
+ }
365
+
366
+ __destroy_into_raw() {
367
+ const ptr = this.__wbg_ptr;
368
+ this.__wbg_ptr = 0;
369
+ ClientCryptoFinalization.unregister(this);
370
+ return ptr;
371
+ }
372
+
373
+ free() {
374
+ const ptr = this.__destroy_into_raw();
375
+ wasm.__wbg_clientcrypto_free(ptr, 0);
376
+ }
377
+ /**
378
+ * Initialization method for the user crypto. Needs to be called before any other crypto
379
+ * operations.
380
+ * @param {InitUserCryptoRequest} req
381
+ * @returns {Promise<void>}
382
+ */
383
+ initialize_user_crypto(req) {
384
+ const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
385
+ return takeObject(ret);
386
+ }
387
+ /**
388
+ * Initialization method for the organization crypto. Needs to be called after
389
+ * `initialize_user_crypto` but before any other crypto operations.
390
+ * @param {InitOrgCryptoRequest} req
391
+ * @returns {Promise<void>}
392
+ */
393
+ initialize_org_crypto(req) {
394
+ const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
395
+ return takeObject(ret);
396
+ }
397
+ }
398
+ module.exports.ClientCrypto = ClientCrypto;
399
+
400
+ const ClientFoldersFinalization =
401
+ typeof FinalizationRegistry === "undefined"
402
+ ? { register: () => {}, unregister: () => {} }
403
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
404
+
405
+ class ClientFolders {
406
+ static __wrap(ptr) {
407
+ ptr = ptr >>> 0;
408
+ const obj = Object.create(ClientFolders.prototype);
409
+ obj.__wbg_ptr = ptr;
410
+ ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
411
+ return obj;
412
+ }
413
+
414
+ __destroy_into_raw() {
415
+ const ptr = this.__wbg_ptr;
416
+ this.__wbg_ptr = 0;
417
+ ClientFoldersFinalization.unregister(this);
418
+ return ptr;
419
+ }
420
+
421
+ free() {
422
+ const ptr = this.__destroy_into_raw();
423
+ wasm.__wbg_clientfolders_free(ptr, 0);
424
+ }
425
+ /**
426
+ * Decrypt folder
427
+ * @param {Folder} folder
428
+ * @returns {FolderView}
429
+ */
430
+ decrypt(folder) {
431
+ try {
432
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
433
+ wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
434
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
435
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
436
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
437
+ if (r2) {
438
+ throw takeObject(r1);
439
+ }
440
+ return takeObject(r0);
441
+ } finally {
442
+ wasm.__wbindgen_add_to_stack_pointer(16);
443
+ }
444
+ }
445
+ }
446
+ module.exports.ClientFolders = ClientFolders;
447
+
448
+ const ClientVaultFinalization =
449
+ typeof FinalizationRegistry === "undefined"
450
+ ? { register: () => {}, unregister: () => {} }
451
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
452
+
453
+ class ClientVault {
454
+ static __wrap(ptr) {
455
+ ptr = ptr >>> 0;
456
+ const obj = Object.create(ClientVault.prototype);
457
+ obj.__wbg_ptr = ptr;
458
+ ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
459
+ return obj;
460
+ }
461
+
462
+ __destroy_into_raw() {
463
+ const ptr = this.__wbg_ptr;
464
+ this.__wbg_ptr = 0;
465
+ ClientVaultFinalization.unregister(this);
466
+ return ptr;
467
+ }
468
+
469
+ free() {
470
+ const ptr = this.__destroy_into_raw();
471
+ wasm.__wbg_clientvault_free(ptr, 0);
472
+ }
473
+ /**
474
+ * @returns {ClientFolders}
475
+ */
476
+ folders() {
477
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
478
+ return ClientFolders.__wrap(ret);
479
+ }
480
+ }
481
+ module.exports.ClientVault = ClientVault;
482
+
483
+ module.exports.__wbindgen_string_get = function (arg0, arg1) {
484
+ const obj = getObject(arg1);
485
+ const ret = typeof obj === "string" ? obj : undefined;
486
+ var ptr1 = isLikeNone(ret)
487
+ ? 0
488
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
489
+ var len1 = WASM_VECTOR_LEN;
490
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
491
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
492
+ };
493
+
494
+ module.exports.__wbindgen_object_drop_ref = function (arg0) {
495
+ takeObject(arg0);
496
+ };
497
+
498
+ module.exports.__wbindgen_is_object = function (arg0) {
499
+ const val = getObject(arg0);
500
+ const ret = typeof val === "object" && val !== null;
501
+ return ret;
502
+ };
503
+
504
+ module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
505
+ const ret = getObject(arg0)[getObject(arg1)];
506
+ return addHeapObject(ret);
507
+ };
508
+
509
+ module.exports.__wbindgen_is_undefined = function (arg0) {
510
+ const ret = getObject(arg0) === undefined;
511
+ return ret;
512
+ };
513
+
514
+ module.exports.__wbindgen_in = function (arg0, arg1) {
515
+ const ret = getObject(arg0) in getObject(arg1);
516
+ return ret;
517
+ };
518
+
519
+ module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function (arg0) {
520
+ const ret = Number.isSafeInteger(getObject(arg0));
521
+ return ret;
522
+ };
523
+
524
+ module.exports.__wbindgen_as_number = function (arg0) {
525
+ const ret = +getObject(arg0);
526
+ return ret;
527
+ };
528
+
529
+ module.exports.__wbindgen_is_string = function (arg0) {
530
+ const ret = typeof getObject(arg0) === "string";
531
+ return ret;
532
+ };
533
+
534
+ module.exports.__wbg_entries_c02034de337d3ee2 = function (arg0) {
535
+ const ret = Object.entries(getObject(arg0));
536
+ return addHeapObject(ret);
537
+ };
538
+
539
+ module.exports.__wbg_length_f217bbbf7e8e4df4 = function (arg0) {
540
+ const ret = getObject(arg0).length;
541
+ return ret;
542
+ };
543
+
544
+ module.exports.__wbg_get_5419cf6b954aa11d = function (arg0, arg1) {
545
+ const ret = getObject(arg0)[arg1 >>> 0];
546
+ return addHeapObject(ret);
547
+ };
548
+
549
+ module.exports.__wbindgen_object_clone_ref = function (arg0) {
550
+ const ret = getObject(arg0);
551
+ return addHeapObject(ret);
552
+ };
553
+
554
+ module.exports.__wbg_new_4f56b64fd4b2f633 = function (arg0, arg1) {
555
+ let deferred0_0;
556
+ let deferred0_1;
557
+ try {
558
+ deferred0_0 = arg0;
559
+ deferred0_1 = arg1;
560
+ const ret = new WasmError(getStringFromWasm0(arg0, arg1));
561
+ return addHeapObject(ret);
562
+ } finally {
563
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
564
+ }
565
+ };
566
+
567
+ module.exports.__wbg_call_3bfa248576352471 = function () {
568
+ return handleError(function (arg0, arg1, arg2) {
569
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
570
+ return addHeapObject(ret);
571
+ }, arguments);
572
+ };
573
+
574
+ module.exports.__wbg_new_e69b5f66fda8f13c = function () {
575
+ const ret = new Object();
576
+ return addHeapObject(ret);
577
+ };
578
+
579
+ module.exports.__wbg_setmethod_ce2da76000b02f6a = function (arg0, arg1, arg2) {
580
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
581
+ };
582
+
583
+ module.exports.__wbg_new_a9ae04a5200606a5 = function () {
584
+ return handleError(function () {
585
+ const ret = new Headers();
586
+ return addHeapObject(ret);
587
+ }, arguments);
588
+ };
589
+
590
+ module.exports.__wbg_setheaders_f5205d36e423a544 = function (arg0, arg1) {
591
+ getObject(arg0).headers = getObject(arg1);
592
+ };
593
+
594
+ module.exports.__wbg_setmode_4919fd636102c586 = function (arg0, arg1) {
595
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
596
+ };
597
+
598
+ module.exports.__wbg_setcredentials_a4e661320cdb9738 = function (arg0, arg1) {
599
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
600
+ };
601
+
602
+ module.exports.__wbg_setbody_aa8b691bec428bf4 = function (arg0, arg1) {
603
+ getObject(arg0).body = getObject(arg1);
604
+ };
605
+
606
+ module.exports.__wbg_signal_9acfcec9e7dffc22 = function (arg0) {
607
+ const ret = getObject(arg0).signal;
608
+ return addHeapObject(ret);
609
+ };
610
+
611
+ module.exports.__wbg_setsignal_812ccb8269a7fd90 = function (arg0, arg1) {
612
+ getObject(arg0).signal = getObject(arg1);
613
+ };
614
+
615
+ module.exports.__wbg_append_8b3e7f74a47ea7d5 = function () {
616
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
617
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
618
+ }, arguments);
619
+ };
620
+
621
+ module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
622
+ let result;
623
+ try {
624
+ result = getObject(arg0) instanceof Response;
625
+ } catch (_) {
626
+ result = false;
627
+ }
628
+ const ret = result;
629
+ return ret;
630
+ };
631
+
632
+ module.exports.__wbg_status_5f4e900d22140a18 = function (arg0) {
633
+ const ret = getObject(arg0).status;
634
+ return ret;
635
+ };
636
+
637
+ module.exports.__wbg_url_58af972663531d16 = function (arg0, arg1) {
638
+ const ret = getObject(arg1).url;
639
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
640
+ const len1 = WASM_VECTOR_LEN;
641
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
642
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
643
+ };
644
+
645
+ module.exports.__wbg_headers_1b9bf90c73fae600 = function (arg0) {
646
+ const ret = getObject(arg0).headers;
647
+ return addHeapObject(ret);
648
+ };
649
+
650
+ module.exports.__wbg_next_b06e115d1b01e10b = function () {
651
+ return handleError(function (arg0) {
652
+ const ret = getObject(arg0).next();
653
+ return addHeapObject(ret);
654
+ }, arguments);
655
+ };
656
+
657
+ module.exports.__wbg_done_983b5ffcaec8c583 = function (arg0) {
658
+ const ret = getObject(arg0).done;
659
+ return ret;
660
+ };
661
+
662
+ module.exports.__wbg_value_2ab8a198c834c26a = function (arg0) {
663
+ const ret = getObject(arg0).value;
664
+ return addHeapObject(ret);
665
+ };
666
+
667
+ module.exports.__wbg_stringify_eead5648c09faaf8 = function () {
668
+ return handleError(function (arg0) {
669
+ const ret = JSON.stringify(getObject(arg0));
670
+ return addHeapObject(ret);
671
+ }, arguments);
672
+ };
673
+
674
+ module.exports.__wbg_abort_c57daab47a6c1215 = function (arg0) {
675
+ getObject(arg0).abort();
676
+ };
677
+
678
+ module.exports.__wbg_text_ebeee8b31af4c919 = function () {
679
+ return handleError(function (arg0) {
680
+ const ret = getObject(arg0).text();
681
+ return addHeapObject(ret);
682
+ }, arguments);
683
+ };
684
+
685
+ module.exports.__wbindgen_string_new = function (arg0, arg1) {
686
+ const ret = getStringFromWasm0(arg0, arg1);
687
+ return addHeapObject(ret);
688
+ };
689
+
690
+ module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
691
+ const ret = getObject(arg0) == getObject(arg1);
692
+ return ret;
693
+ };
694
+
695
+ module.exports.__wbindgen_cb_drop = function (arg0) {
696
+ const obj = takeObject(arg0).original;
697
+ if (obj.cnt-- == 1) {
698
+ obj.a = 0;
699
+ return true;
700
+ }
701
+ const ret = false;
702
+ return ret;
703
+ };
704
+
705
+ module.exports.__wbindgen_error_new = function (arg0, arg1) {
706
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
707
+ return addHeapObject(ret);
708
+ };
709
+
710
+ module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
711
+ try {
712
+ var state0 = { a: arg0, b: arg1 };
713
+ var cb0 = (arg0, arg1) => {
714
+ const a = state0.a;
715
+ state0.a = 0;
716
+ try {
717
+ return __wbg_adapter_98(a, state0.b, arg0, arg1);
718
+ } finally {
719
+ state0.a = a;
720
+ }
721
+ };
722
+ const ret = new Promise(cb0);
723
+ return addHeapObject(ret);
724
+ } finally {
725
+ state0.a = state0.b = 0;
726
+ }
727
+ };
728
+
729
+ module.exports.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
730
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
731
+ };
732
+
733
+ module.exports.__wbg_new_abda76e883ba8a5f = function () {
734
+ const ret = new Error();
735
+ return addHeapObject(ret);
736
+ };
737
+
738
+ module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
739
+ const ret = getObject(arg1).stack;
740
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
741
+ const len1 = WASM_VECTOR_LEN;
742
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
743
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
744
+ };
745
+
746
+ module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
747
+ let deferred0_0;
748
+ let deferred0_1;
749
+ try {
750
+ deferred0_0 = arg0;
751
+ deferred0_1 = arg1;
752
+ console.error(getStringFromWasm0(arg0, arg1));
753
+ } finally {
754
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
755
+ }
756
+ };
757
+
758
+ module.exports.__wbg_self_bf91bf94d9e04084 = function () {
759
+ return handleError(function () {
760
+ const ret = self.self;
761
+ return addHeapObject(ret);
762
+ }, arguments);
763
+ };
764
+
765
+ module.exports.__wbg_window_52dd9f07d03fd5f8 = function () {
766
+ return handleError(function () {
767
+ const ret = window.window;
768
+ return addHeapObject(ret);
769
+ }, arguments);
770
+ };
771
+
772
+ module.exports.__wbg_globalThis_05c129bf37fcf1be = function () {
773
+ return handleError(function () {
774
+ const ret = globalThis.globalThis;
775
+ return addHeapObject(ret);
776
+ }, arguments);
777
+ };
778
+
779
+ module.exports.__wbg_global_3eca19bb09e9c484 = function () {
780
+ return handleError(function () {
781
+ const ret = global.global;
782
+ return addHeapObject(ret);
783
+ }, arguments);
784
+ };
785
+
786
+ module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function (arg0, arg1) {
787
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
788
+ return addHeapObject(ret);
789
+ };
790
+
791
+ module.exports.__wbg_call_a9ef466721e824f2 = function () {
792
+ return handleError(function (arg0, arg1) {
793
+ const ret = getObject(arg0).call(getObject(arg1));
794
+ return addHeapObject(ret);
795
+ }, arguments);
796
+ };
797
+
798
+ module.exports.__wbg_iterator_695d699a44d6234c = function () {
799
+ const ret = Symbol.iterator;
800
+ return addHeapObject(ret);
801
+ };
802
+
803
+ module.exports.__wbg_get_ef828680c64da212 = function () {
804
+ return handleError(function (arg0, arg1) {
805
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
806
+ return addHeapObject(ret);
807
+ }, arguments);
808
+ };
809
+
810
+ module.exports.__wbindgen_is_function = function (arg0) {
811
+ const ret = typeof getObject(arg0) === "function";
812
+ return ret;
813
+ };
814
+
815
+ module.exports.__wbg_next_13b477da1eaa3897 = function (arg0) {
816
+ const ret = getObject(arg0).next;
817
+ return addHeapObject(ret);
818
+ };
819
+
820
+ module.exports.__wbg_new_034f913e7636e987 = function () {
821
+ const ret = new Array();
822
+ return addHeapObject(ret);
823
+ };
824
+
825
+ module.exports.__wbg_push_36cf4d81d7da33d1 = function (arg0, arg1) {
826
+ const ret = getObject(arg0).push(getObject(arg1));
827
+ return ret;
828
+ };
829
+
830
+ module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function (arg0) {
831
+ let result;
832
+ try {
833
+ result = getObject(arg0) instanceof ArrayBuffer;
834
+ } catch (_) {
835
+ result = false;
836
+ }
837
+ const ret = result;
838
+ return ret;
839
+ };
840
+
841
+ module.exports.__wbg_new_70a2f23d1565c04c = function (arg0, arg1) {
842
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
843
+ return addHeapObject(ret);
844
+ };
845
+
846
+ module.exports.__wbg_has_bd717f25f195f23d = function () {
847
+ return handleError(function (arg0, arg1) {
848
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
849
+ return ret;
850
+ }, arguments);
851
+ };
852
+
853
+ module.exports.__wbg_resolve_0aad7c1484731c99 = function (arg0) {
854
+ const ret = Promise.resolve(getObject(arg0));
855
+ return addHeapObject(ret);
856
+ };
857
+
858
+ module.exports.__wbg_then_748f75edfb032440 = function (arg0, arg1) {
859
+ const ret = getObject(arg0).then(getObject(arg1));
860
+ return addHeapObject(ret);
861
+ };
862
+
863
+ module.exports.__wbg_then_4866a7d9f55d8f3e = function (arg0, arg1, arg2) {
864
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
865
+ return addHeapObject(ret);
866
+ };
867
+
868
+ module.exports.__wbindgen_memory = function () {
869
+ const ret = wasm.memory;
870
+ return addHeapObject(ret);
871
+ };
872
+
873
+ module.exports.__wbg_buffer_ccaed51a635d8a2d = function (arg0) {
874
+ const ret = getObject(arg0).buffer;
875
+ return addHeapObject(ret);
876
+ };
877
+
878
+ module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function (arg0, arg1, arg2) {
879
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
880
+ return addHeapObject(ret);
881
+ };
882
+
883
+ module.exports.__wbg_length_9254c4bd3b9f23c4 = function (arg0) {
884
+ const ret = getObject(arg0).length;
885
+ return ret;
886
+ };
887
+
888
+ module.exports.__wbg_new_fec2611eb9180f95 = function (arg0) {
889
+ const ret = new Uint8Array(getObject(arg0));
890
+ return addHeapObject(ret);
891
+ };
892
+
893
+ module.exports.__wbg_set_ec2fcf81bc573fd9 = function (arg0, arg1, arg2) {
894
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
895
+ };
896
+
897
+ module.exports.__wbg_instanceof_Uint8Array_df0761410414ef36 = function (arg0) {
898
+ let result;
899
+ try {
900
+ result = getObject(arg0) instanceof Uint8Array;
901
+ } catch (_) {
902
+ result = false;
903
+ }
904
+ const ret = result;
905
+ return ret;
906
+ };
907
+
908
+ module.exports.__wbg_new_4e7308fbedde3997 = function () {
909
+ return handleError(function () {
910
+ const ret = new FormData();
911
+ return addHeapObject(ret);
912
+ }, arguments);
913
+ };
914
+
915
+ module.exports.__wbg_append_43a4b1c9d5df4168 = function () {
916
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
917
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
918
+ }, arguments);
919
+ };
920
+
921
+ module.exports.__wbg_settype_623d2ee701e6310a = function (arg0, arg1, arg2) {
922
+ getObject(arg0).type = getStringFromWasm0(arg1, arg2);
923
+ };
924
+
925
+ module.exports.__wbg_newwithu8arraysequenceandoptions_d41c0fdf78490206 = function () {
926
+ return handleError(function (arg0, arg1) {
927
+ const ret = new Blob(getObject(arg0), getObject(arg1));
928
+ return addHeapObject(ret);
929
+ }, arguments);
930
+ };
931
+
932
+ module.exports.__wbg_append_7ee78799a92a9731 = function () {
933
+ return handleError(function (arg0, arg1, arg2, arg3) {
934
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
935
+ }, arguments);
936
+ };
937
+
938
+ module.exports.__wbg_append_8135c71037096394 = function () {
939
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
940
+ getObject(arg0).append(
941
+ getStringFromWasm0(arg1, arg2),
942
+ getObject(arg3),
943
+ getStringFromWasm0(arg4, arg5),
944
+ );
945
+ }, arguments);
946
+ };
947
+
948
+ module.exports.__wbg_fetch_f8d735ba6fe1b719 = function (arg0) {
949
+ const ret = fetch(getObject(arg0));
950
+ return addHeapObject(ret);
951
+ };
952
+
953
+ module.exports.__wbg_fetch_1fdc4448ed9eec00 = function (arg0, arg1) {
954
+ const ret = getObject(arg0).fetch(getObject(arg1));
955
+ return addHeapObject(ret);
956
+ };
957
+
958
+ module.exports.__wbg_new_75169ae5a9683c55 = function () {
959
+ return handleError(function () {
960
+ const ret = new AbortController();
961
+ return addHeapObject(ret);
962
+ }, arguments);
963
+ };
964
+
965
+ module.exports.__wbindgen_boolean_get = function (arg0) {
966
+ const v = getObject(arg0);
967
+ const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
968
+ return ret;
969
+ };
970
+
971
+ module.exports.__wbindgen_number_get = function (arg0, arg1) {
972
+ const obj = getObject(arg1);
973
+ const ret = typeof obj === "number" ? obj : undefined;
974
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
975
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
976
+ };
977
+
978
+ module.exports.__wbg_String_b9412f8799faab3e = function (arg0, arg1) {
979
+ const ret = String(getObject(arg1));
980
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
981
+ const len1 = WASM_VECTOR_LEN;
982
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
983
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
984
+ };
985
+
986
+ module.exports.__wbindgen_debug_string = function (arg0, arg1) {
987
+ const ret = debugString(getObject(arg1));
988
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
989
+ const len1 = WASM_VECTOR_LEN;
990
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
991
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
992
+ };
993
+
994
+ module.exports.__wbindgen_throw = function (arg0, arg1) {
995
+ throw new Error(getStringFromWasm0(arg0, arg1));
996
+ };
997
+
998
+ module.exports.__wbg_queueMicrotask_848aa4969108a57e = function (arg0) {
999
+ const ret = getObject(arg0).queueMicrotask;
1000
+ return addHeapObject(ret);
1001
+ };
1002
+
1003
+ module.exports.__wbg_queueMicrotask_c5419c06eab41e73 = function (arg0) {
1004
+ queueMicrotask(getObject(arg0));
1005
+ };
1006
+
1007
+ module.exports.__wbg_newwithstrandinit_4b92c89af0a8e383 = function () {
1008
+ return handleError(function (arg0, arg1, arg2) {
1009
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1010
+ return addHeapObject(ret);
1011
+ }, arguments);
1012
+ };
1013
+
1014
+ module.exports.__wbg_debug_a0b6c2c5ac9a4bfd = function (arg0, arg1, arg2, arg3) {
1015
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1016
+ };
1017
+
1018
+ module.exports.__wbg_error_4d17c5bb1ca90c94 = function (arg0, arg1, arg2, arg3) {
1019
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1020
+ };
1021
+
1022
+ module.exports.__wbg_info_1c7fba7da21072d1 = function (arg0, arg1, arg2, arg3) {
1023
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1024
+ };
1025
+
1026
+ module.exports.__wbg_log_4de37a0274d94769 = function (arg0, arg1, arg2, arg3) {
1027
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1028
+ };
1029
+
1030
+ module.exports.__wbg_warn_2e2787d40aad9a81 = function (arg0, arg1, arg2, arg3) {
1031
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1032
+ };
1033
+
1034
+ module.exports.__wbindgen_closure_wrapper1606 = function (arg0, arg1, arg2) {
1035
+ const ret = makeMutClosure(arg0, arg1, 425, __wbg_adapter_38);
1036
+ return addHeapObject(ret);
1037
+ };
1038
+
1039
+ const path = require("path").join(__dirname, "bitwarden_wasm_internal_bg.wasm");
1040
+ const bytes = require("fs").readFileSync(path);
1041
+
1042
+ const wasmModule = new WebAssembly.Module(bytes);
1043
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
1044
+ wasm = wasmInstance.exports;
1045
+ module.exports.__wasm = wasm;