wao 0.9.2 → 0.10.2

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.
package/cjs/armem-base.js CHANGED
@@ -6,8 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _arweave = _interopRequireDefault(require("arweave"));
9
+ var _arbundles = require("arbundles");
10
+ var _compress = require("./compress.js");
9
11
  var _ramda = require("ramda");
10
12
  var _utils = require("./utils.js");
13
+ var _base64url = _interopRequireDefault(require("base64url"));
11
14
  var _Arweave$default;
12
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
16
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
@@ -31,9 +34,15 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
31
34
  SU_URL = _ref.SU_URL,
32
35
  GATEWAY_URL = _ref.GATEWAY_URL,
33
36
  scheduler = _ref.scheduler,
34
- cache = _ref.cache;
37
+ cache = _ref.cache,
38
+ init = _ref.init,
39
+ Compressor = _ref.Compressor,
40
+ Decompressor = _ref.Decompressor;
35
41
  _classCallCheck(this, ArMemBase);
36
42
  this.__type__ = "mem";
43
+ this._init = init;
44
+ this.Compressor = Compressor;
45
+ this.Decompressor = Decompressor;
37
46
  this.isInit = false;
38
47
  this.keyInit = false;
39
48
  this.keys = {};
@@ -48,6 +57,32 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
48
57
  this.SU_URL = SU_URL;
49
58
  }
50
59
  return _createClass(ArMemBase, [{
60
+ key: "owner",
61
+ value: function () {
62
+ var _owner = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(di) {
63
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
64
+ while (1) switch (_context.prev = _context.next) {
65
+ case 0:
66
+ _context.t0 = _base64url["default"];
67
+ _context.t1 = Buffer;
68
+ _context.next = 4;
69
+ return crypto.subtle.digest("SHA-256", di.rawOwner);
70
+ case 4:
71
+ _context.t2 = _context.sent;
72
+ _context.t3 = _context.t1.from.call(_context.t1, _context.t2);
73
+ return _context.abrupt("return", _context.t0.encode.call(_context.t0, _context.t3));
74
+ case 7:
75
+ case "end":
76
+ return _context.stop();
77
+ }
78
+ }, _callee);
79
+ }));
80
+ function owner(_x) {
81
+ return _owner.apply(this, arguments);
82
+ }
83
+ return owner;
84
+ }()
85
+ }, {
51
86
  key: "getAnchor",
52
87
  value: function getAnchor() {
53
88
  return this.blocks.length === 0 ? "Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM" : (0, _ramda.last)(this.blockmap[(0, _ramda.last)(this.blocks)].txs);
@@ -55,28 +90,28 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
55
90
  }, {
56
91
  key: "get",
57
92
  value: function () {
58
- var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, field) {
93
+ var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, field) {
59
94
  var _this$key;
60
- return _regeneratorRuntime().wrap(function _callee$(_context) {
61
- while (1) switch (_context.prev = _context.next) {
95
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
96
+ while (1) switch (_context2.prev = _context2.next) {
62
97
  case 0:
63
- _context.next = 2;
98
+ _context2.next = 2;
64
99
  return this.init();
65
100
  case 2:
66
101
  if (field) {
67
- _context.next = 4;
102
+ _context2.next = 4;
68
103
  break;
69
104
  }
70
- return _context.abrupt("return", this[key]);
105
+ return _context2.abrupt("return", this[key]);
71
106
  case 4:
72
- return _context.abrupt("return", (_this$key = this[key]) === null || _this$key === void 0 ? void 0 : _this$key[field]);
107
+ return _context2.abrupt("return", (_this$key = this[key]) === null || _this$key === void 0 ? void 0 : _this$key[field]);
73
108
  case 5:
74
109
  case "end":
75
- return _context.stop();
110
+ return _context2.stop();
76
111
  }
77
- }, _callee, this);
112
+ }, _callee2, this);
78
113
  }));
79
- function get(_x, _x2) {
114
+ function get(_x2, _x3) {
80
115
  return _get.apply(this, arguments);
81
116
  }
82
117
  return get;
@@ -84,44 +119,60 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
84
119
  }, {
85
120
  key: "set",
86
121
  value: function () {
87
- var _set = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(val, key, field) {
88
- var _this$key2;
89
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
90
- while (1) switch (_context2.prev = _context2.next) {
122
+ var _set = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(val, key, field) {
123
+ var _this$key2, memory;
124
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
125
+ while (1) switch (_context3.prev = _context3.next) {
91
126
  case 0:
92
- _context2.next = 2;
127
+ _context3.next = 2;
93
128
  return this.init();
94
129
  case 2:
95
130
  if (field) {
96
- _context2.next = 9;
131
+ _context3.next = 9;
97
132
  break;
98
133
  }
99
134
  this[key] = val;
100
135
  if (!this.db) {
101
- _context2.next = 7;
136
+ _context3.next = 7;
102
137
  break;
103
138
  }
104
- _context2.next = 7;
139
+ _context3.next = 7;
105
140
  return this.db.put("".concat(key), this[key]);
106
141
  case 7:
107
- _context2.next = 14;
142
+ _context3.next = 21;
108
143
  break;
109
144
  case 9:
110
145
  (_this$key2 = this[key]) !== null && _this$key2 !== void 0 ? _this$key2 : this[key] = {};
111
146
  this[key][field] = val;
112
147
  if (!this.db) {
113
- _context2.next = 14;
148
+ _context3.next = 21;
114
149
  break;
115
150
  }
116
- _context2.next = 14;
151
+ if (!(key === "env")) {
152
+ _context3.next = 19;
153
+ break;
154
+ }
155
+ memory = val.memory;
156
+ try {
157
+ memory = Array.from(this.compressor.compress(val.memory));
158
+ } catch (e) {
159
+ memory = (0, _compress.compress)(val.memory);
160
+ }
161
+ _context3.next = 17;
162
+ return this.db.put("".concat(key, ".").concat(field), (0, _ramda.assoc)("memory", memory, this[key][field]));
163
+ case 17:
164
+ _context3.next = 21;
165
+ break;
166
+ case 19:
167
+ _context3.next = 21;
117
168
  return this.db.put("".concat(key, ".").concat(field), this[key][field]);
118
- case 14:
169
+ case 21:
119
170
  case "end":
120
- return _context2.stop();
171
+ return _context3.stop();
121
172
  }
122
- }, _callee2, this);
173
+ }, _callee3, this);
123
174
  }));
124
- function set(_x3, _x4, _x5) {
175
+ function set(_x4, _x5, _x6) {
125
176
  return _set.apply(this, arguments);
126
177
  }
127
178
  return set;
@@ -129,9 +180,9 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
129
180
  }, {
130
181
  key: "initSync",
131
182
  value: function initSync() {
183
+ this.items = {};
132
184
  this.addrmap = {};
133
185
  this.txs = {};
134
- this.jwks = {};
135
186
  this.blocks = [];
136
187
  this.blockmap = {};
137
188
  this.env = {};
@@ -208,30 +259,30 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
208
259
  }, {
209
260
  key: "putAll",
210
261
  value: function () {
211
- var _putAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key) {
262
+ var _putAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key) {
212
263
  var k;
213
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
214
- while (1) switch (_context3.prev = _context3.next) {
264
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
265
+ while (1) switch (_context4.prev = _context4.next) {
215
266
  case 0:
216
- _context3.t0 = _regeneratorRuntime().keys(this[key]);
267
+ _context4.t0 = _regeneratorRuntime().keys(this[key]);
217
268
  case 1:
218
- if ((_context3.t1 = _context3.t0()).done) {
219
- _context3.next = 7;
269
+ if ((_context4.t1 = _context4.t0()).done) {
270
+ _context4.next = 7;
220
271
  break;
221
272
  }
222
- k = _context3.t1.value;
223
- _context3.next = 5;
273
+ k = _context4.t1.value;
274
+ _context4.next = 5;
224
275
  return this.set(this[key][k], key, k);
225
276
  case 5:
226
- _context3.next = 1;
277
+ _context4.next = 1;
227
278
  break;
228
279
  case 7:
229
280
  case "end":
230
- return _context3.stop();
281
+ return _context4.stop();
231
282
  }
232
- }, _callee3, this);
283
+ }, _callee4, this);
233
284
  }));
234
- function putAll(_x6) {
285
+ function putAll(_x7) {
235
286
  return _putAll.apply(this, arguments);
236
287
  }
237
288
  return putAll;
@@ -239,197 +290,330 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
239
290
  }, {
240
291
  key: "init",
241
292
  value: function () {
242
- var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
243
- var _i, _arr, v, _i2, _arr2, _this$_v, _v, items, _iterator, _step, v2, key, field, _i3, _arr3, _v2, _i4, _arr4, _v3;
244
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
245
- while (1) switch (_context4.prev = _context4.next) {
293
+ var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
294
+ var _i, _arr, v, _i2, _arr2, _this$_v, _v, items, _iterator, _step, v2, key, field, v3, _i3, _arr3, _v2, _i4, _arr4, _v3;
295
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
296
+ while (1) switch (_context5.prev = _context5.next) {
246
297
  case 0:
247
298
  if (!this.isInit) {
248
- _context4.next = 2;
299
+ _context5.next = 2;
249
300
  break;
250
301
  }
251
- return _context4.abrupt("return");
302
+ return _context5.abrupt("return");
252
303
  case 2:
253
304
  this.isInit = true;
305
+ if (!(typeof this._init === "function")) {
306
+ _context5.next = 6;
307
+ break;
308
+ }
309
+ _context5.next = 6;
310
+ return this._init();
311
+ case 6:
312
+ this.compressor = new this.Compressor();
313
+ this.decompressor = new this.Decompressor();
254
314
  if (!this.db) {
255
- _context4.next = 46;
315
+ _context5.next = 59;
256
316
  break;
257
317
  }
258
318
  _i = 0, _arr = ["height", "blocks"];
259
- case 5:
319
+ case 10:
260
320
  if (!(_i < _arr.length)) {
261
- _context4.next = 13;
321
+ _context5.next = 18;
262
322
  break;
263
323
  }
264
324
  v = _arr[_i];
265
- _context4.next = 9;
325
+ _context5.next = 14;
266
326
  return this.get(v);
267
- case 9:
268
- this[v] = _context4.sent;
269
- case 10:
327
+ case 14:
328
+ this[v] = _context5.sent;
329
+ case 15:
270
330
  _i++;
271
- _context4.next = 5;
331
+ _context5.next = 10;
272
332
  break;
273
- case 13:
274
- _i2 = 0, _arr2 = ["txs", "jwks", "env", "modules", "wasms", "addrmap", "blockmap", "modmap", "msgs"];
275
- case 14:
333
+ case 18:
334
+ _i2 = 0, _arr2 = ["items", "txs", "env", "modules", "wasms", "addrmap", "blockmap", "modmap", "msgs"];
335
+ case 19:
276
336
  if (!(_i2 < _arr2.length)) {
277
- _context4.next = 44;
337
+ _context5.next = 57;
278
338
  break;
279
339
  }
280
340
  _v = _arr2[_i2];
281
341
  (_this$_v = this[_v]) !== null && _this$_v !== void 0 ? _this$_v : this[_v] = {};
282
- _context4.next = 19;
342
+ _context5.next = 24;
283
343
  return this.db.getKeys({
284
344
  start: _v,
285
345
  end: _v + "a"
286
346
  });
287
- case 19:
288
- items = _context4.sent;
347
+ case 24:
348
+ items = _context5.sent;
289
349
  _iterator = _createForOfIteratorHelper(items || []);
290
- _context4.prev = 21;
350
+ _context5.prev = 26;
291
351
  _iterator.s();
292
- case 23:
352
+ case 28:
293
353
  if ((_step = _iterator.n()).done) {
294
- _context4.next = 33;
354
+ _context5.next = 46;
295
355
  break;
296
356
  }
297
357
  v2 = _step.value;
298
358
  key = v2.split(".")[0];
299
359
  field = v2.split(".")[1];
300
360
  if (!(key === _v)) {
301
- _context4.next = 31;
361
+ _context5.next = 44;
302
362
  break;
303
363
  }
304
- _context4.next = 30;
364
+ if (!key.match(/^env/)) {
365
+ _context5.next = 41;
366
+ break;
367
+ }
368
+ _context5.next = 36;
305
369
  return this.db.get(v2);
306
- case 30:
307
- this[_v][field] = _context4.sent;
308
- case 31:
309
- _context4.next = 23;
370
+ case 36:
371
+ v3 = _context5.sent;
372
+ if ((0, _ramda.is)(Array, v3.memory)) {
373
+ try {
374
+ v3.memory = this.decompressor.decompress(v3.memory);
375
+ } catch (e) {
376
+ v3.memory = (0, _compress.decompress)(v3.memory);
377
+ }
378
+ }
379
+ this[_v][field] = v3;
380
+ _context5.next = 44;
310
381
  break;
311
- case 33:
312
- _context4.next = 38;
382
+ case 41:
383
+ _context5.next = 43;
384
+ return this.db.get(v2);
385
+ case 43:
386
+ this[_v][field] = _context5.sent;
387
+ case 44:
388
+ _context5.next = 28;
313
389
  break;
314
- case 35:
315
- _context4.prev = 35;
316
- _context4.t0 = _context4["catch"](21);
317
- _iterator.e(_context4.t0);
318
- case 38:
319
- _context4.prev = 38;
390
+ case 46:
391
+ _context5.next = 51;
392
+ break;
393
+ case 48:
394
+ _context5.prev = 48;
395
+ _context5.t0 = _context5["catch"](26);
396
+ _iterator.e(_context5.t0);
397
+ case 51:
398
+ _context5.prev = 51;
320
399
  _iterator.f();
321
- return _context4.finish(38);
322
- case 41:
400
+ return _context5.finish(51);
401
+ case 54:
323
402
  _i2++;
324
- _context4.next = 14;
403
+ _context5.next = 19;
325
404
  break;
326
- case 44:
327
- _context4.next = 62;
405
+ case 57:
406
+ _context5.next = 75;
328
407
  break;
329
- case 46:
408
+ case 59:
330
409
  _i3 = 0, _arr3 = ["height", "blocks"];
331
- case 47:
410
+ case 60:
332
411
  if (!(_i3 < _arr3.length)) {
333
- _context4.next = 54;
412
+ _context5.next = 67;
334
413
  break;
335
414
  }
336
415
  _v2 = _arr3[_i3];
337
- _context4.next = 51;
416
+ _context5.next = 64;
338
417
  return this.set(this[_v2], _v2);
339
- case 51:
418
+ case 64:
340
419
  _i3++;
341
- _context4.next = 47;
420
+ _context5.next = 60;
342
421
  break;
343
- case 54:
422
+ case 67:
344
423
  _i4 = 0, _arr4 = ["modules", "wasms", "addrmap", "blockmap"];
345
- case 55:
424
+ case 68:
346
425
  if (!(_i4 < _arr4.length)) {
347
- _context4.next = 62;
426
+ _context5.next = 75;
348
427
  break;
349
428
  }
350
429
  _v3 = _arr4[_i4];
351
- _context4.next = 59;
430
+ _context5.next = 72;
352
431
  return this.putAll(_v3);
353
- case 59:
432
+ case 72:
354
433
  _i4++;
355
- _context4.next = 55;
434
+ _context5.next = 68;
356
435
  break;
357
- case 62:
436
+ case 75:
358
437
  case "end":
359
- return _context4.stop();
438
+ return _context5.stop();
360
439
  }
361
- }, _callee4, this, [[21, 35, 38, 41]]);
440
+ }, _callee5, this, [[26, 48, 51, 54]]);
362
441
  }));
363
442
  function init() {
364
443
  return _init.apply(this, arguments);
365
444
  }
366
445
  return init;
367
446
  }()
447
+ }, {
448
+ key: "getTx",
449
+ value: function () {
450
+ var _getTx = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {
451
+ var tx, bundle, _iterator2, _step2, di, data, data_size, data_type, _iterator3, _step3, t, owner;
452
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
453
+ while (1) switch (_context6.prev = _context6.next) {
454
+ case 0:
455
+ tx = this.txs[id];
456
+ if (!tx.bundle) {
457
+ _context6.next = 44;
458
+ break;
459
+ }
460
+ _context6.prev = 2;
461
+ bundle = new _arbundles.Bundle(this.txs[tx.bundle].data);
462
+ _iterator2 = _createForOfIteratorHelper(bundle.items);
463
+ _context6.prev = 5;
464
+ _iterator2.s();
465
+ case 7:
466
+ if ((_step2 = _iterator2.n()).done) {
467
+ _context6.next = 32;
468
+ break;
469
+ }
470
+ di = _step2.value;
471
+ if (!(id === di.id)) {
472
+ _context6.next = 30;
473
+ break;
474
+ }
475
+ data = di.data;
476
+ data_size = Buffer.byteLength(di.rawData).toString();
477
+ data_type = "";
478
+ _iterator3 = _createForOfIteratorHelper(di.tags);
479
+ try {
480
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
481
+ t = _step3.value;
482
+ if (t.name === "Content-Type") data_type = t.value;
483
+ }
484
+ } catch (err) {
485
+ _iterator3.e(err);
486
+ } finally {
487
+ _iterator3.f();
488
+ }
489
+ _context6.next = 17;
490
+ return this.owner(di);
491
+ case 17:
492
+ owner = _context6.sent;
493
+ _context6.t0 = {
494
+ size: data_size,
495
+ type: data_type
496
+ };
497
+ _context6.t1 = di.anchor;
498
+ _context6.t2 = di.signature;
499
+ _context6.t3 = di.target;
500
+ _context6.next = 24;
501
+ return di.id;
502
+ case 24:
503
+ _context6.t4 = _context6.sent;
504
+ _context6.t5 = di;
505
+ _context6.t6 = owner;
506
+ _context6.t7 = di.tags;
507
+ _context6.t8 = data;
508
+ tx = {
509
+ _data: _context6.t0,
510
+ anchor: _context6.t1,
511
+ signature: _context6.t2,
512
+ recipient: _context6.t3,
513
+ id: _context6.t4,
514
+ item: _context6.t5,
515
+ owner: _context6.t6,
516
+ tags: _context6.t7,
517
+ data: _context6.t8
518
+ };
519
+ case 30:
520
+ _context6.next = 7;
521
+ break;
522
+ case 32:
523
+ _context6.next = 37;
524
+ break;
525
+ case 34:
526
+ _context6.prev = 34;
527
+ _context6.t9 = _context6["catch"](5);
528
+ _iterator2.e(_context6.t9);
529
+ case 37:
530
+ _context6.prev = 37;
531
+ _iterator2.f();
532
+ return _context6.finish(37);
533
+ case 40:
534
+ _context6.next = 44;
535
+ break;
536
+ case 42:
537
+ _context6.prev = 42;
538
+ _context6.t10 = _context6["catch"](2);
539
+ case 44:
540
+ return _context6.abrupt("return", tx);
541
+ case 45:
542
+ case "end":
543
+ return _context6.stop();
544
+ }
545
+ }, _callee6, this, [[2, 42], [5, 34, 37, 40]]);
546
+ }));
547
+ function getTx(_x8) {
548
+ return _getTx.apply(this, arguments);
549
+ }
550
+ return getTx;
551
+ }()
368
552
  }, {
369
553
  key: "getWasm",
370
554
  value: function () {
371
- var _getWasm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(module) {
555
+ var _getWasm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(module) {
372
556
  var _format;
373
557
  var mod, format, _wasm, wasm, tx;
374
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
375
- while (1) switch (_context5.prev = _context5.next) {
558
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
559
+ while (1) switch (_context7.prev = _context7.next) {
376
560
  case 0:
377
561
  mod = module !== null && module !== void 0 ? module : this.modules.aos2_0_1;
378
562
  if (mod) {
379
- _context5.next = 3;
563
+ _context7.next = 3;
380
564
  break;
381
565
  }
382
566
  throw Error("module not found");
383
567
  case 3:
384
568
  format = null;
385
- _context5.next = 6;
569
+ _context7.next = 6;
386
570
  return this.wasms[mod];
387
571
  case 6:
388
- _wasm = _context5.sent;
572
+ _wasm = _context7.sent;
389
573
  wasm = _wasm === null || _wasm === void 0 ? void 0 : _wasm.data;
390
574
  if (wasm) {
391
- _context5.next = 22;
575
+ _context7.next = 22;
392
576
  break;
393
577
  }
394
578
  if (!(_wasm !== null && _wasm !== void 0 && _wasm.file)) {
395
- _context5.next = 16;
579
+ _context7.next = 16;
396
580
  break;
397
581
  }
398
- _context5.next = 12;
582
+ _context7.next = 12;
399
583
  return this._getWasm(this.wasms[mod].file);
400
584
  case 12:
401
- wasm = _context5.sent;
585
+ wasm = _context7.sent;
402
586
  format = _wasm.format;
403
- _context5.next = 20;
587
+ _context7.next = 20;
404
588
  break;
405
589
  case 16:
406
- _context5.next = 18;
407
- return this.get("txs", mod);
590
+ _context7.next = 18;
591
+ return this.getTx(mod);
408
592
  case 18:
409
- tx = _context5.sent;
593
+ tx = _context7.sent;
410
594
  if (tx) {
411
595
  wasm = Buffer.from(tx.data, "base64");
412
596
  format = (0, _utils.tags)(tx.tags)["Module-Format"];
413
597
  }
414
598
  case 20:
415
- _context5.next = 23;
599
+ _context7.next = 23;
416
600
  break;
417
601
  case 22:
418
602
  format = _wasm.format;
419
603
  case 23:
420
604
  (_format = format) !== null && _format !== void 0 ? _format : format = "wasm64-unknown-emscripten-draft_2024_02_15";
421
- return _context5.abrupt("return", {
605
+ return _context7.abrupt("return", {
422
606
  format: format,
423
607
  mod: mod,
424
608
  wasm: wasm
425
609
  });
426
610
  case 25:
427
611
  case "end":
428
- return _context5.stop();
612
+ return _context7.stop();
429
613
  }
430
- }, _callee5, this);
614
+ }, _callee7, this);
431
615
  }));
432
- function getWasm(_x7) {
616
+ function getWasm(_x9) {
433
617
  return _getWasm.apply(this, arguments);
434
618
  }
435
619
  return getWasm;