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/tgql.js CHANGED
@@ -213,7 +213,7 @@ var GQL = exports["default"] = /*#__PURE__*/function () {
213
213
  _iterator3.s();
214
214
  case 22:
215
215
  if ((_step3 = _iterator3.n()).done) {
216
- _context2.next = 111;
216
+ _context2.next = 113;
217
217
  break;
218
218
  }
219
219
  v = _step3.value;
@@ -222,13 +222,13 @@ var GQL = exports["default"] = /*#__PURE__*/function () {
222
222
  _context2.next = 27;
223
223
  break;
224
224
  }
225
- return _context2.abrupt("continue", 109);
225
+ return _context2.abrupt("continue", 111);
226
226
  case 27:
227
227
  if (!(!(0, _ramda.isNil)(_block.max) && block.height > _block.max)) {
228
228
  _context2.next = 29;
229
229
  break;
230
230
  }
231
- return _context2.abrupt("continue", 109);
231
+ return _context2.abrupt("continue", 111);
232
232
  case 29:
233
233
  _txs2 = block.txs;
234
234
  if (opt.asc !== true) _txs2 = (0, _ramda.reverse)(_txs2);
@@ -237,7 +237,7 @@ var GQL = exports["default"] = /*#__PURE__*/function () {
237
237
  _iterator4.s();
238
238
  case 34:
239
239
  if ((_step4 = _iterator4.n()).done) {
240
- _context2.next = 99;
240
+ _context2.next = 101;
241
241
  break;
242
242
  }
243
243
  v2 = _step4.value;
@@ -246,113 +246,116 @@ var GQL = exports["default"] = /*#__PURE__*/function () {
246
246
  break;
247
247
  }
248
248
  after = true;
249
- return _context2.abrupt("break", 99);
249
+ return _context2.abrupt("break", 101);
250
250
  case 39:
251
251
  if (!(!(0, _ramda.isNil)(opt.after) && count === 0 && !after)) {
252
252
  _context2.next = 41;
253
253
  break;
254
254
  }
255
- return _context2.abrupt("continue", 97);
255
+ return _context2.abrupt("continue", 99);
256
256
  case 41:
257
- tx = this.mem.txs[v2];
257
+ _context2.next = 43;
258
+ return this.mem.getTx(v2);
259
+ case 43:
260
+ tx = _context2.sent;
258
261
  if (!(!(0, _ramda.isNil)(ids) && ids.length > 0)) {
259
- _context2.next = 45;
262
+ _context2.next = 47;
260
263
  break;
261
264
  }
262
265
  if ((0, _ramda.includes)(tx.id, ids)) {
263
- _context2.next = 45;
266
+ _context2.next = 47;
264
267
  break;
265
268
  }
266
- return _context2.abrupt("continue", 97);
267
- case 45:
269
+ return _context2.abrupt("continue", 99);
270
+ case 47:
268
271
  if (!(!(0, _ramda.isNil)(owners) && owners.length > 0)) {
269
- _context2.next = 48;
272
+ _context2.next = 50;
270
273
  break;
271
274
  }
272
275
  if ((0, _ramda.includes)(tx.owner, owners)) {
273
- _context2.next = 48;
276
+ _context2.next = 50;
274
277
  break;
275
278
  }
276
- return _context2.abrupt("continue", 97);
277
- case 48:
279
+ return _context2.abrupt("continue", 99);
280
+ case 50:
278
281
  if (!(!(0, _ramda.isNil)(recipients) && recipients.length > 0)) {
279
- _context2.next = 51;
282
+ _context2.next = 53;
280
283
  break;
281
284
  }
282
285
  if ((0, _ramda.includes)(tx.recipient, recipients)) {
283
- _context2.next = 51;
286
+ _context2.next = 53;
284
287
  break;
285
288
  }
286
- return _context2.abrupt("continue", 97);
287
- case 51:
289
+ return _context2.abrupt("continue", 99);
290
+ case 53:
288
291
  tag_unmatch = false;
289
292
  _iterator5 = _createForOfIteratorHelper(tags);
290
- _context2.prev = 53;
293
+ _context2.prev = 55;
291
294
  _iterator5.s();
292
- case 55:
295
+ case 57:
293
296
  if ((_step5 = _iterator5.n()).done) {
294
- _context2.next = 81;
297
+ _context2.next = 83;
295
298
  break;
296
299
  }
297
300
  _v2 = _step5.value;
298
301
  ex = false;
299
302
  _iterator8 = _createForOfIteratorHelper(tx.tags);
300
- _context2.prev = 59;
303
+ _context2.prev = 61;
301
304
  _iterator8.s();
302
- case 61:
305
+ case 63:
303
306
  if ((_step8 = _iterator8.n()).done) {
304
- _context2.next = 68;
307
+ _context2.next = 70;
305
308
  break;
306
309
  }
307
310
  _v3 = _step8.value;
308
311
  if (!(_v3.name === _v2.name && (0, _ramda.includes)(_v3.value, _v2.values))) {
309
- _context2.next = 66;
312
+ _context2.next = 68;
310
313
  break;
311
314
  }
312
315
  ex = true;
313
- return _context2.abrupt("break", 68);
314
- case 66:
315
- _context2.next = 61;
316
- break;
316
+ return _context2.abrupt("break", 70);
317
317
  case 68:
318
- _context2.next = 73;
318
+ _context2.next = 63;
319
319
  break;
320
320
  case 70:
321
- _context2.prev = 70;
322
- _context2.t0 = _context2["catch"](59);
321
+ _context2.next = 75;
322
+ break;
323
+ case 72:
324
+ _context2.prev = 72;
325
+ _context2.t0 = _context2["catch"](61);
323
326
  _iterator8.e(_context2.t0);
324
- case 73:
325
- _context2.prev = 73;
327
+ case 75:
328
+ _context2.prev = 75;
326
329
  _iterator8.f();
327
- return _context2.finish(73);
328
- case 76:
330
+ return _context2.finish(75);
331
+ case 78:
329
332
  if (ex) {
330
- _context2.next = 79;
333
+ _context2.next = 81;
331
334
  break;
332
335
  }
333
336
  tag_unmatch = true;
334
- return _context2.abrupt("break", 81);
335
- case 79:
336
- _context2.next = 55;
337
- break;
337
+ return _context2.abrupt("break", 83);
338
338
  case 81:
339
- _context2.next = 86;
339
+ _context2.next = 57;
340
340
  break;
341
341
  case 83:
342
- _context2.prev = 83;
343
- _context2.t1 = _context2["catch"](53);
342
+ _context2.next = 88;
343
+ break;
344
+ case 85:
345
+ _context2.prev = 85;
346
+ _context2.t1 = _context2["catch"](55);
344
347
  _iterator5.e(_context2.t1);
345
- case 86:
346
- _context2.prev = 86;
348
+ case 88:
349
+ _context2.prev = 88;
347
350
  _iterator5.f();
348
- return _context2.finish(86);
349
- case 89:
351
+ return _context2.finish(88);
352
+ case 91:
350
353
  if (!tag_unmatch) {
351
- _context2.next = 91;
354
+ _context2.next = 93;
352
355
  break;
353
356
  }
354
- return _context2.abrupt("continue", 97);
355
- case 91:
357
+ return _context2.abrupt("continue", 99);
358
+ case 93:
356
359
  _tx = _defineProperty({
357
360
  cursor: tx.id,
358
361
  id: tx.id,
@@ -444,47 +447,47 @@ var GQL = exports["default"] = /*#__PURE__*/function () {
444
447
  data.push(_tx);
445
448
  count += 1;
446
449
  if (!(count >= first)) {
447
- _context2.next = 97;
450
+ _context2.next = 99;
448
451
  break;
449
452
  }
450
- return _context2.abrupt("break", 99);
451
- case 97:
452
- _context2.next = 34;
453
- break;
453
+ return _context2.abrupt("break", 101);
454
454
  case 99:
455
- _context2.next = 104;
455
+ _context2.next = 34;
456
456
  break;
457
457
  case 101:
458
- _context2.prev = 101;
458
+ _context2.next = 106;
459
+ break;
460
+ case 103:
461
+ _context2.prev = 103;
459
462
  _context2.t2 = _context2["catch"](32);
460
463
  _iterator4.e(_context2.t2);
461
- case 104:
462
- _context2.prev = 104;
464
+ case 106:
465
+ _context2.prev = 106;
463
466
  _iterator4.f();
464
- return _context2.finish(104);
465
- case 107:
467
+ return _context2.finish(106);
468
+ case 109:
466
469
  if (!(count >= first)) {
467
- _context2.next = 109;
470
+ _context2.next = 111;
468
471
  break;
469
472
  }
470
- return _context2.abrupt("break", 111);
471
- case 109:
472
- _context2.next = 22;
473
- break;
473
+ return _context2.abrupt("break", 113);
474
474
  case 111:
475
- _context2.next = 116;
475
+ _context2.next = 22;
476
476
  break;
477
477
  case 113:
478
- _context2.prev = 113;
478
+ _context2.next = 118;
479
+ break;
480
+ case 115:
481
+ _context2.prev = 115;
479
482
  _context2.t3 = _context2["catch"](20);
480
483
  _iterator3.e(_context2.t3);
481
- case 116:
482
- _context2.prev = 116;
484
+ case 118:
485
+ _context2.prev = 118;
483
486
  _iterator3.f();
484
- return _context2.finish(116);
485
- case 119:
487
+ return _context2.finish(118);
488
+ case 121:
486
489
  if (!(opt.next === true)) {
487
- _context2.next = 126;
490
+ _context2.next = 128;
488
491
  break;
489
492
  }
490
493
  cursor = null;
@@ -510,13 +513,13 @@ var GQL = exports["default"] = /*#__PURE__*/function () {
510
513
  data: data,
511
514
  next: next
512
515
  });
513
- case 126:
516
+ case 128:
514
517
  return _context2.abrupt("return", data);
515
- case 127:
518
+ case 129:
516
519
  case "end":
517
520
  return _context2.stop();
518
521
  }
519
- }, _callee2, this, [[20, 113, 116, 119], [32, 101, 104, 107], [53, 83, 86, 89], [59, 70, 73, 76]]);
522
+ }, _callee2, this, [[20, 115, 118, 121], [32, 103, 106, 109], [55, 85, 88, 91], [61, 72, 75, 78]]);
520
523
  }));
521
524
  function txs() {
522
525
  return _txs.apply(this, arguments);
@@ -0,0 +1,332 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.Decompressor = exports.Compressor = void 0;
7
+ exports.initSync = initSync;
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
11
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
12
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
+ var wasm;
18
+ var heap = new Array(128).fill(undefined);
19
+ heap.push(undefined, null, true, false);
20
+ function getObject(idx) {
21
+ return heap[idx];
22
+ }
23
+ var heap_next = heap.length;
24
+ function addHeapObject(obj) {
25
+ if (heap_next === heap.length) heap.push(heap.length + 1);
26
+ var idx = heap_next;
27
+ heap_next = heap[idx];
28
+ heap[idx] = obj;
29
+ return idx;
30
+ }
31
+ function dropObject(idx) {
32
+ if (idx < 132) return;
33
+ heap[idx] = heap_next;
34
+ heap_next = idx;
35
+ }
36
+ function takeObject(idx) {
37
+ var ret = getObject(idx);
38
+ dropObject(idx);
39
+ return ret;
40
+ }
41
+ var cachedTextDecoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', {
42
+ ignoreBOM: true,
43
+ fatal: true
44
+ }) : {
45
+ decode: function decode() {
46
+ throw Error('TextDecoder not available');
47
+ }
48
+ };
49
+ if (typeof TextDecoder !== 'undefined') {
50
+ cachedTextDecoder.decode();
51
+ }
52
+ ;
53
+ var cachedUint8ArrayMemory0 = null;
54
+ function getUint8ArrayMemory0() {
55
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
56
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
57
+ }
58
+ return cachedUint8ArrayMemory0;
59
+ }
60
+ function getStringFromWasm0(ptr, len) {
61
+ ptr = ptr >>> 0;
62
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
63
+ }
64
+ var WASM_VECTOR_LEN = 0;
65
+ function passArray8ToWasm0(arg, malloc) {
66
+ var ptr = malloc(arg.length * 1, 1) >>> 0;
67
+ getUint8ArrayMemory0().set(arg, ptr / 1);
68
+ WASM_VECTOR_LEN = arg.length;
69
+ return ptr;
70
+ }
71
+ var CompressorFinalization = typeof FinalizationRegistry === 'undefined' ? {
72
+ register: function register() {},
73
+ unregister: function unregister() {}
74
+ } : new FinalizationRegistry(function (ptr) {
75
+ return wasm.__wbg_compressor_free(ptr >>> 0, 1);
76
+ });
77
+ var Compressor = exports.Compressor = /*#__PURE__*/function () {
78
+ function Compressor() {
79
+ _classCallCheck(this, Compressor);
80
+ var ret = wasm.compressor_new();
81
+ this.__wbg_ptr = ret >>> 0;
82
+ CompressorFinalization.register(this, this.__wbg_ptr, this);
83
+ return this;
84
+ }
85
+ /**
86
+ * @param {Uint8Array} data
87
+ * @returns {Uint8Array}
88
+ */
89
+ return _createClass(Compressor, [{
90
+ key: "__destroy_into_raw",
91
+ value: function __destroy_into_raw() {
92
+ var ptr = this.__wbg_ptr;
93
+ this.__wbg_ptr = 0;
94
+ CompressorFinalization.unregister(this);
95
+ return ptr;
96
+ }
97
+ }, {
98
+ key: "free",
99
+ value: function free() {
100
+ var ptr = this.__destroy_into_raw();
101
+ wasm.__wbg_compressor_free(ptr, 0);
102
+ }
103
+ }, {
104
+ key: "compress",
105
+ value: function compress(data) {
106
+ var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
107
+ var len0 = WASM_VECTOR_LEN;
108
+ var ret = wasm.compressor_compress(this.__wbg_ptr, ptr0, len0);
109
+ return takeObject(ret);
110
+ }
111
+ }]);
112
+ }();
113
+ var DecompressorFinalization = typeof FinalizationRegistry === 'undefined' ? {
114
+ register: function register() {},
115
+ unregister: function unregister() {}
116
+ } : new FinalizationRegistry(function (ptr) {
117
+ return wasm.__wbg_decompressor_free(ptr >>> 0, 1);
118
+ });
119
+ var Decompressor = exports.Decompressor = /*#__PURE__*/function () {
120
+ function Decompressor() {
121
+ _classCallCheck(this, Decompressor);
122
+ var ret = wasm.compressor_new();
123
+ this.__wbg_ptr = ret >>> 0;
124
+ DecompressorFinalization.register(this, this.__wbg_ptr, this);
125
+ return this;
126
+ }
127
+ /**
128
+ * @param {Uint8Array} data
129
+ * @returns {Uint8Array}
130
+ */
131
+ return _createClass(Decompressor, [{
132
+ key: "__destroy_into_raw",
133
+ value: function __destroy_into_raw() {
134
+ var ptr = this.__wbg_ptr;
135
+ this.__wbg_ptr = 0;
136
+ DecompressorFinalization.unregister(this);
137
+ return ptr;
138
+ }
139
+ }, {
140
+ key: "free",
141
+ value: function free() {
142
+ var ptr = this.__destroy_into_raw();
143
+ wasm.__wbg_decompressor_free(ptr, 0);
144
+ }
145
+ }, {
146
+ key: "decompress",
147
+ value: function decompress(data) {
148
+ var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
149
+ var len0 = WASM_VECTOR_LEN;
150
+ var ret = wasm.decompressor_decompress(this.__wbg_ptr, ptr0, len0);
151
+ return takeObject(ret);
152
+ }
153
+ }]);
154
+ }();
155
+ function __wbg_load(_x, _x2) {
156
+ return _wbg_load.apply(this, arguments);
157
+ }
158
+ function _wbg_load() {
159
+ _wbg_load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(module, imports) {
160
+ var bytes, instance;
161
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
162
+ while (1) switch (_context.prev = _context.next) {
163
+ case 0:
164
+ if (!(typeof Response === 'function' && module instanceof Response)) {
165
+ _context.next = 23;
166
+ break;
167
+ }
168
+ if (!(typeof WebAssembly.instantiateStreaming === 'function')) {
169
+ _context.next = 15;
170
+ break;
171
+ }
172
+ _context.prev = 2;
173
+ _context.next = 5;
174
+ return WebAssembly.instantiateStreaming(module, imports);
175
+ case 5:
176
+ return _context.abrupt("return", _context.sent);
177
+ case 8:
178
+ _context.prev = 8;
179
+ _context.t0 = _context["catch"](2);
180
+ if (!(module.headers.get('Content-Type') != 'application/wasm')) {
181
+ _context.next = 14;
182
+ break;
183
+ }
184
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", _context.t0);
185
+ _context.next = 15;
186
+ break;
187
+ case 14:
188
+ throw _context.t0;
189
+ case 15:
190
+ _context.next = 17;
191
+ return module.arrayBuffer();
192
+ case 17:
193
+ bytes = _context.sent;
194
+ _context.next = 20;
195
+ return WebAssembly.instantiate(bytes, imports);
196
+ case 20:
197
+ return _context.abrupt("return", _context.sent);
198
+ case 23:
199
+ _context.next = 25;
200
+ return WebAssembly.instantiate(module, imports);
201
+ case 25:
202
+ instance = _context.sent;
203
+ if (!(instance instanceof WebAssembly.Instance)) {
204
+ _context.next = 30;
205
+ break;
206
+ }
207
+ return _context.abrupt("return", {
208
+ instance: instance,
209
+ module: module
210
+ });
211
+ case 30:
212
+ return _context.abrupt("return", instance);
213
+ case 31:
214
+ case "end":
215
+ return _context.stop();
216
+ }
217
+ }, _callee, null, [[2, 8]]);
218
+ }));
219
+ return _wbg_load.apply(this, arguments);
220
+ }
221
+ function __wbg_get_imports() {
222
+ var imports = {};
223
+ imports.wbg = {};
224
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
225
+ var ret = getObject(arg0).buffer;
226
+ return addHeapObject(ret);
227
+ };
228
+ imports.wbg.__wbg_length_a446193dc22c12f8 = function (arg0) {
229
+ var ret = getObject(arg0).length;
230
+ return ret;
231
+ };
232
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (arg0, arg1, arg2) {
233
+ var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
234
+ return addHeapObject(ret);
235
+ };
236
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function (arg0) {
237
+ var ret = new Uint8Array(arg0 >>> 0);
238
+ return addHeapObject(ret);
239
+ };
240
+ imports.wbg.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
241
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
242
+ };
243
+ imports.wbg.__wbindgen_memory = function () {
244
+ var ret = wasm.memory;
245
+ return addHeapObject(ret);
246
+ };
247
+ imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
248
+ takeObject(arg0);
249
+ };
250
+ imports.wbg.__wbindgen_throw = function (arg0, arg1) {
251
+ throw new Error(getStringFromWasm0(arg0, arg1));
252
+ };
253
+ return imports;
254
+ }
255
+ function __wbg_init_memory(imports, memory) {}
256
+ function __wbg_finalize_init(instance, module) {
257
+ wasm = instance.exports;
258
+ __wbg_init.__wbindgen_wasm_module = module;
259
+ cachedUint8ArrayMemory0 = null;
260
+ return wasm;
261
+ }
262
+ function initSync(module) {
263
+ if (wasm !== undefined) return wasm;
264
+ if (typeof module !== 'undefined') {
265
+ if (Object.getPrototypeOf(module) === Object.prototype) {
266
+ var _module = module;
267
+ module = _module.module;
268
+ } else {
269
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead');
270
+ }
271
+ }
272
+ var imports = __wbg_get_imports();
273
+ __wbg_init_memory(imports);
274
+ if (!(module instanceof WebAssembly.Module)) {
275
+ module = new WebAssembly.Module(module);
276
+ }
277
+ var instance = new WebAssembly.Instance(module, imports);
278
+ return __wbg_finalize_init(instance, module);
279
+ }
280
+ function __wbg_init(_x3) {
281
+ return _wbg_init.apply(this, arguments);
282
+ }
283
+ function _wbg_init() {
284
+ _wbg_init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(module_or_path) {
285
+ var _module_or_path, imports, _yield$__wbg_load, instance, module;
286
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
287
+ while (1) switch (_context2.prev = _context2.next) {
288
+ case 0:
289
+ if (!(wasm !== undefined)) {
290
+ _context2.next = 2;
291
+ break;
292
+ }
293
+ return _context2.abrupt("return", wasm);
294
+ case 2:
295
+ if (typeof module_or_path !== 'undefined') {
296
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
297
+ _module_or_path = module_or_path;
298
+ module_or_path = _module_or_path.module_or_path;
299
+ } else {
300
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead');
301
+ }
302
+ }
303
+ if (typeof module_or_path === 'undefined') {
304
+ module_or_path = new URL('waosm_bg.wasm', import.meta.url);
305
+ }
306
+ imports = __wbg_get_imports();
307
+ if (typeof module_or_path === 'string' || typeof Request === 'function' && module_or_path instanceof Request || typeof URL === 'function' && module_or_path instanceof URL) {
308
+ module_or_path = fetch(module_or_path);
309
+ }
310
+ __wbg_init_memory(imports);
311
+ _context2.t0 = __wbg_load;
312
+ _context2.next = 10;
313
+ return module_or_path;
314
+ case 10:
315
+ _context2.t1 = _context2.sent;
316
+ _context2.t2 = imports;
317
+ _context2.next = 14;
318
+ return (0, _context2.t0)(_context2.t1, _context2.t2);
319
+ case 14:
320
+ _yield$__wbg_load = _context2.sent;
321
+ instance = _yield$__wbg_load.instance;
322
+ module = _yield$__wbg_load.module;
323
+ return _context2.abrupt("return", __wbg_finalize_init(instance, module));
324
+ case 18:
325
+ case "end":
326
+ return _context2.stop();
327
+ }
328
+ }, _callee2);
329
+ }));
330
+ return _wbg_init.apply(this, arguments);
331
+ }
332
+ var _default = exports["default"] = __wbg_init;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ var wasm = _interopRequireWildcard(require("./waosm_bg.wasm"));
8
+ var _waosm_bg2 = require("./waosm_bg.js");
9
+ Object.keys(_waosm_bg2).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _waosm_bg2[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _waosm_bg2[key];
16
+ }
17
+ });
18
+ });
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
21
+ (0, _waosm_bg2.__wbg_set_wasm)(wasm);