UNPKG

mqtt-react-hook

Version:
1,552 lines (1,549 loc) 707 kB
// mqtt-react-hook v2.0.2 Copyright (c) 2024 Sina Sadjadi <sinasadjadi@proton.me> (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["mqtt-react-hook"] = {}, global.jsxRuntime, global.React)); })(this, (function (exports, jsxRuntime, React) { 'use strict'; function _OverloadYield(e, d) { this.v = e, this.k = d; } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _asyncGeneratorDelegate(t) { var e = {}, n = !1; function pump(e, r) { return n = !0, r = new Promise(function (n) { n(t[e](r)); }), { done: !1, value: new _OverloadYield(r, 1) }; } return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { return this; }, e.next = function (t) { return n ? (n = !1, t) : pump("next", t); }, "function" == typeof t.throw && (e.throw = function (t) { if (n) throw n = !1, t; return pump("throw", t); }), "function" == typeof t.return && (e.return = function (t) { return n ? (n = !1, t) : pump("return", t); }), e; } function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); } function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function (r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function () { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function (r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function (r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); } 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); } 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); }); }; } function _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _classPrivateFieldGet2(s, a) { return s.get(_assertClassBrand(s, a)); } function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); } function _classPrivateFieldSet2(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; } function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); } function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; } 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); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var n = 0, F = function () {}; return { s: F, n: function () { return n >= r.length ? { done: !0 } : { done: !1, value: r[n++] }; }, e: function (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 () { t = t.call(r); }, n: function () { var r = t.next(); return a = r.done, r; }, e: function (r) { u = !0, o = r; }, f: function () { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _regeneratorRuntime() { _regeneratorRuntime = function () { 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 (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 (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 (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 () { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function (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 (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 (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 (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 (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 (e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } 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); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return (String )(t); } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } 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); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; } function AsyncGenerator(e) { var r, t; function resume(r, t) { try { var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (t) { if (u) { var i = "return" === r ? "return" : "next"; if (!o.k || t.done) return resume(i, t); t = e[i](t).value; } settle(n.done ? "return" : "normal", t); }, function (e) { resume("throw", e); }); } catch (e) { settle("throw", e); } } function settle(e, n) { switch (e) { case "return": r.resolve({ value: n, done: !0 }); break; case "throw": r.reject(n); break; default: r.resolve({ value: n, done: !1 }); } (r = r.next) ? resume(r.key, r.arg) : t = null; } this._invoke = function (e, n) { return new Promise(function (o, u) { var i = { key: e, arg: n, resolve: o, reject: u, next: null }; t ? t = t.next = i : (r = t = i, resume(e, n)); }); }, "function" != typeof e.return && (this.return = void 0); } AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke("next", e); }, AsyncGenerator.prototype.throw = function (e) { return this._invoke("throw", e); }, AsyncGenerator.prototype.return = function (e) { return this._invoke("return", e); }; function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function (t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); } var ys = Object.defineProperty; var Kg = Object.getOwnPropertyDescriptor; var Gg = Object.getOwnPropertyNames; var Qg = Object.prototype.hasOwnProperty; var _e = function _e(t, e) { return function () { return t && (e = t(t = 0)), e; }; }; var M = function M(t, e) { return function () { return e || t((e = { exports: {} }).exports, e), e.exports; }; }, Jt = function Jt(t, e) { for (var r in e) ys(t, r, { get: e[r], enumerable: !0 }); }, Yg = function Yg(t, e, r, i) { if (e && _typeof(e) == "object" || typeof e == "function") { var _iterator13 = _createForOfIteratorHelper(Gg(e)), _step13; try { var _loop = function _loop() { var n = _step13.value; !Qg.call(t, n) && n !== r && ys(t, n, { get: function get() { return e[n]; }, enumerable: !(i = Kg(e, n)) || i.enumerable }); }; for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) { _loop(); } } catch (err) { _iterator13.e(err); } finally { _iterator13.f(); } } return t; }; var X = function X(t) { return Yg(ys({}, "__esModule", { value: !0 }), t); }; var _ = _e(function () {}); var B = {}; Jt(B, { _debugEnd: function _debugEnd() { return yu; }, _debugProcess: function _debugProcess() { return gu; }, _events: function _events() { return Ou; }, _eventsCount: function _eventsCount() { return xu; }, _exiting: function _exiting() { return Yl; }, _fatalExceptions: function _fatalExceptions() { return cu; }, _getActiveHandles: function _getActiveHandles() { return eu; }, _getActiveRequests: function _getActiveRequests() { return Zl; }, _kill: function _kill() { return ru; }, _linkedBinding: function _linkedBinding() { return Gl; }, _maxListeners: function _maxListeners() { return ku; }, _preload_modules: function _preload_modules() { return Cu; }, _rawDebug: function _rawDebug() { return zl; }, _startProfilerIdleNotifier: function _startProfilerIdleNotifier() { return bu; }, _stopProfilerIdleNotifier: function _stopProfilerIdleNotifier() { return wu; }, _tickCallback: function _tickCallback() { return pu; }, abort: function abort() { return Eu; }, addListener: function addListener() { return Mu; }, allowedNodeEnvironmentFlags: function allowedNodeEnvironmentFlags() { return lu; }, arch: function arch() { return xl; }, argv: function argv() { return Ul; }, argv0: function argv0() { return Ru; }, assert: function assert() { return uu; }, binding: function binding() { return Fl; }, chdir: function chdir() { return Hl; }, config: function config() { return Jl; }, cpuUsage: function cpuUsage() { return $i; }, cwd: function cwd() { return $l; }, debugPort: function debugPort() { return Tu; }, "default": function _default() { return $u; }, dlopen: function dlopen() { return Xl; }, domain: function domain() { return Ql; }, emit: function emit() { return Du; }, emitWarning: function emitWarning() { return jl; }, env: function env() { return Ll; }, execArgv: function execArgv() { return Nl; }, execPath: function execPath() { return Iu; }, exit: function exit() { return ou; }, features: function features() { return fu; }, hasUncaughtExceptionCaptureCallback: function hasUncaughtExceptionCaptureCallback() { return du; }, hrtime: function hrtime() { return Wi; }, kill: function kill() { return su; }, listeners: function listeners() { return Wu; }, memoryUsage: function memoryUsage() { return nu; }, moduleLoadList: function moduleLoadList() { return Kl; }, nextTick: function nextTick() { return Pl; }, off: function off() { return Uu; }, on: function on() { return wt; }, once: function once() { return Lu; }, openStdin: function openStdin() { return au; }, pid: function pid() { return Su; }, platform: function platform() { return Ml; }, ppid: function ppid() { return Au; }, prependListener: function prependListener() { return ju; }, prependOnceListener: function prependOnceListener() { return Fu; }, reallyExit: function reallyExit() { return tu; }, release: function release() { return Vl; }, removeAllListeners: function removeAllListeners() { return qu; }, removeListener: function removeListener() { return Nu; }, resourceUsage: function resourceUsage() { return iu; }, setSourceMapsEnabled: function setSourceMapsEnabled() { return Bu; }, setUncaughtExceptionCaptureCallback: function setUncaughtExceptionCaptureCallback() { return hu; }, stderr: function stderr() { return mu; }, stdin: function stdin() { return vu; }, stdout: function stdout() { return _u; }, title: function title() { return Ol; }, umask: function umask() { return Wl; }, uptime: function uptime() { return Pu; }, version: function version() { return ql; }, versions: function versions() { return Dl; } }); function _s(t) { throw new Error("Node.js process " + t + " is not supported by JSPM core outside of Node.js"); } function Jg() { !Lr || !Xt || (Lr = !1, Xt.length ? bt = Xt.concat(bt) : Fi = -1, bt.length && Bl()); } function Bl() { if (!Lr) { var t = setTimeout(Jg, 0); Lr = !0; for (var e = bt.length; e;) { for (Xt = bt, bt = []; ++Fi < e;) Xt && Xt[Fi].run(); Fi = -1, e = bt.length; } Xt = null, Lr = !1, clearTimeout(t); } } function Pl(t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; bt.push(new kl(t, e)), bt.length === 1 && !Lr && setTimeout(Bl, 0); } function kl(t, e) { this.fun = t, this.array = e; } function Ee() {} function Gl(t) { _s("_linkedBinding"); } function Xl(t) { _s("dlopen"); } function Zl() { return []; } function eu() { return []; } function uu(t, e) { if (!t) throw new Error(e || "assertion error"); } function du() { return !1; } function Pu() { return Lt.now() / 1e3; } function Wi(t) { var e = Math.floor((Date.now() - Lt.now()) * .001), r = Lt.now() * .001, i = Math.floor(r) + e, n = Math.floor(r % 1 * 1e9); return t && (i = i - t[0], n = n - t[1], n < 0 && (i--, n += ws)), [i, n]; } function wt() { return $u; } function Wu(t) { return []; } var bt, Lr, Xt, Fi, Ol, xl, Ml, Ll, Ul, Nl, ql, Dl, jl, Fl, Wl, $l, Hl, Vl, zl, Kl, Ql, Yl, Jl, tu, ru, $i, iu, nu, su, ou, au, lu, fu, cu, hu, pu, gu, yu, bu, wu, _u, mu, vu, Eu, Su, Au, Iu, Tu, Ru, Cu, Bu, Lt, bs, ws, ku, Ou, xu, Mu, Lu, Uu, Nu, qu, Du, ju, Fu, $u, Hu = _e(function () { _(); v(); m(); bt = [], Lr = !1, Fi = -1; kl.prototype.run = function () { this.fun.apply(null, this.array); }; Ol = "browser", xl = "x64", Ml = "browser", Ll = { PATH: "/usr/bin", LANG: navigator.language + ".UTF-8", PWD: "/", HOME: "/home", TMP: "/tmp" }, Ul = ["/usr/bin/node"], Nl = [], ql = "v16.8.0", Dl = {}, jl = function jl(t, e) { console.warn((e ? e + ": " : "") + t); }, Fl = function Fl(t) { _s("binding"); }, Wl = function Wl(t) { return 0; }, $l = function $l() { return "/"; }, Hl = function Hl(t) {}, Vl = { name: "node", sourceUrl: "", headersUrl: "", libUrl: "" }; zl = Ee, Kl = []; Ql = {}, Yl = !1, Jl = {}; tu = Ee, ru = Ee, $i = function $i() { return {}; }, iu = $i, nu = $i, su = Ee, ou = Ee, au = Ee, lu = {}; fu = { inspector: !1, debug: !1, uv: !1, ipv6: !1, tls_alpn: !1, tls_sni: !1, tls_ocsp: !1, tls: !1, cached_builtins: !0 }, cu = Ee, hu = Ee; pu = Ee, gu = Ee, yu = Ee, bu = Ee, wu = Ee, _u = void 0, mu = void 0, vu = void 0, Eu = Ee, Su = 2, Au = 1, Iu = "/bin/usr/node", Tu = 9229, Ru = "node", Cu = [], Bu = Ee, Lt = { now: (typeof performance === "undefined" ? "undefined" : _typeof(performance)) < "u" ? performance.now.bind(performance) : void 0, timing: (typeof performance === "undefined" ? "undefined" : _typeof(performance)) < "u" ? performance.timing : void 0 }; Lt.now === void 0 && (bs = Date.now(), Lt.timing && Lt.timing.navigationStart && (bs = Lt.timing.navigationStart), Lt.now = function () { return Date.now() - bs; }); ws = 1e9; Wi.bigint = function (t) { var e = Wi(t); return (typeof BigInt === "undefined" ? "undefined" : _typeof(BigInt)) > "u" ? e[0] * ws + e[1] : BigInt(e[0] * ws) + BigInt(e[1]); }; ku = 10, Ou = {}, xu = 0; Mu = wt, Lu = wt, Uu = wt, Nu = wt, qu = wt, Du = Ee, ju = wt, Fu = wt; $u = { version: ql, versions: Dl, arch: xl, platform: Ml, release: Vl, _rawDebug: zl, moduleLoadList: Kl, binding: Fl, _linkedBinding: Gl, _events: Ou, _eventsCount: xu, _maxListeners: ku, on: wt, addListener: Mu, once: Lu, off: Uu, removeListener: Nu, removeAllListeners: qu, emit: Du, prependListener: ju, prependOnceListener: Fu, listeners: Wu, domain: Ql, _exiting: Yl, config: Jl, dlopen: Xl, uptime: Pu, _getActiveRequests: Zl, _getActiveHandles: eu, reallyExit: tu, _kill: ru, cpuUsage: $i, resourceUsage: iu, memoryUsage: nu, kill: su, exit: ou, openStdin: au, allowedNodeEnvironmentFlags: lu, assert: uu, features: fu, _fatalExceptions: cu, setUncaughtExceptionCaptureCallback: hu, hasUncaughtExceptionCaptureCallback: du, emitWarning: jl, nextTick: Pl, _tickCallback: pu, _debugProcess: gu, _debugEnd: yu, _startProfilerIdleNotifier: bu, _stopProfilerIdleNotifier: wu, stdout: _u, stdin: vu, stderr: mu, abort: Eu, umask: Wl, chdir: Hl, cwd: $l, env: Ll, title: Ol, argv: Ul, execArgv: Nl, pid: Su, ppid: Au, execPath: Iu, debugPort: Tu, hrtime: Wi, argv0: Ru, _preload_modules: Cu, setSourceMapsEnabled: Bu }; }); var m = _e(function () { Hu(); }); var me = {}; Jt(me, { Buffer: function Buffer() { return x; }, INSPECT_MAX_BYTES: function INSPECT_MAX_BYTES() { return ty; }, "default": function _default() { return Ut; }, kMaxLength: function kMaxLength() { return ry; } }); function Xg() { if (Vu) return ci; Vu = !0, ci.byteLength = a, ci.toByteArray = c, ci.fromByteArray = g; for (var t = [], e = [], r = (typeof Uint8Array === "undefined" ? "undefined" : _typeof(Uint8Array)) < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", n = 0, o = i.length; n < o; ++n) t[n] = i[n], e[i.charCodeAt(n)] = n; e["-".charCodeAt(0)] = 62, e["_".charCodeAt(0)] = 63; function s(y) { var w = y.length; if (w % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); var S = y.indexOf("="); S === -1 && (S = w); var E = S === w ? 0 : 4 - S % 4; return [S, E]; } function a(y) { var w = s(y), S = w[0], E = w[1]; return (S + E) * 3 / 4 - E; } function l(y, w, S) { return (w + S) * 3 / 4 - S; } function c(y) { var w, S = s(y), E = S[0], I = S[1], C = new r(l(y, E, I)), R = 0, U = I > 0 ? E - 4 : E, N; for (N = 0; N < U; N += 4) w = e[y.charCodeAt(N)] << 18 | e[y.charCodeAt(N + 1)] << 12 | e[y.charCodeAt(N + 2)] << 6 | e[y.charCodeAt(N + 3)], C[R++] = w >> 16 & 255, C[R++] = w >> 8 & 255, C[R++] = w & 255; return I === 2 && (w = e[y.charCodeAt(N)] << 2 | e[y.charCodeAt(N + 1)] >> 4, C[R++] = w & 255), I === 1 && (w = e[y.charCodeAt(N)] << 10 | e[y.charCodeAt(N + 1)] << 4 | e[y.charCodeAt(N + 2)] >> 2, C[R++] = w >> 8 & 255, C[R++] = w & 255), C; } function h(y) { return t[y >> 18 & 63] + t[y >> 12 & 63] + t[y >> 6 & 63] + t[y & 63]; } function d(y, w, S) { for (var E, I = [], C = w; C < S; C += 3) E = (y[C] << 16 & 16711680) + (y[C + 1] << 8 & 65280) + (y[C + 2] & 255), I.push(h(E)); return I.join(""); } function g(y) { for (var w, S = y.length, E = S % 3, I = [], C = 16383, R = 0, U = S - E; R < U; R += C) I.push(d(y, R, R + C > U ? U : R + C)); return E === 1 ? (w = y[S - 1], I.push(t[w >> 2] + t[w << 4 & 63] + "==")) : E === 2 && (w = (y[S - 2] << 8) + y[S - 1], I.push(t[w >> 10] + t[w >> 4 & 63] + t[w << 2 & 63] + "=")), I.join(""); } return ci; } function Zg() { if (zu) return Hi; zu = !0; return Hi.read = function (t, e, r, i, n) { var o, s, a = n * 8 - i - 1, l = (1 << a) - 1, c = l >> 1, h = -7, d = r ? n - 1 : 0, g = r ? -1 : 1, y = t[e + d]; for (d += g, o = y & (1 << -h) - 1, y >>= -h, h += a; h > 0; o = o * 256 + t[e + d], d += g, h -= 8); for (s = o & (1 << -h) - 1, o >>= -h, h += i; h > 0; s = s * 256 + t[e + d], d += g, h -= 8); if (o === 0) o = 1 - c;else { if (o === l) return s ? NaN : (y ? -1 : 1) * (1 / 0); s = s + Math.pow(2, i), o = o - c; } return (y ? -1 : 1) * s * Math.pow(2, o - i); }, Hi.write = function (t, e, r, i, n, o) { var s, a, l, c = o * 8 - n - 1, h = (1 << c) - 1, d = h >> 1, g = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = i ? 0 : o - 1, w = i ? 1 : -1, S = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0; for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -s)) < 1 && (s--, l *= 2), s + d >= 1 ? e += g / l : e += g * Math.pow(2, 1 - d), e * l >= 2 && (s++, l /= 2), s + d >= h ? (a = 0, s = h) : s + d >= 1 ? (a = (e * l - 1) * Math.pow(2, n), s = s + d) : (a = e * Math.pow(2, d - 1) * Math.pow(2, n), s = 0)); n >= 8; t[r + y] = a & 255, y += w, a /= 256, n -= 8); for (s = s << n | a, c += n; c > 0; t[r + y] = s & 255, y += w, s /= 256, c -= 8); t[r + y - w] |= S * 128; }, Hi; } function ey() { if (Ku) return Zt; Ku = !0; var t = Xg(), e = Zg(), r = typeof Symbol == "function" && typeof Symbol["for"] == "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; Zt.Buffer = s, Zt.SlowBuffer = I, Zt.INSPECT_MAX_BYTES = 50; var i = 2147483647; Zt.kMaxLength = i, s.TYPED_ARRAY_SUPPORT = n(), !s.TYPED_ARRAY_SUPPORT && (typeof console === "undefined" ? "undefined" : _typeof(console)) < "u" && typeof console.error == "function" && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); function n() { try { var p = new Uint8Array(1), u = { foo: function foo() { return 42; } }; return Object.setPrototypeOf(u, Uint8Array.prototype), Object.setPrototypeOf(p, u), p.foo() === 42; } catch (_unused) { return !1; } } Object.defineProperty(s.prototype, "parent", { enumerable: !0, get: function get() { if (s.isBuffer(this)) return this.buffer; } }), Object.defineProperty(s.prototype, "offset", { enumerable: !0, get: function get() { if (s.isBuffer(this)) return this.byteOffset; } }); function o(p) { if (p > i) throw new RangeError('The value "' + p + '" is invalid for option "size"'); var u = new Uint8Array(p); return Object.setPrototypeOf(u, s.prototype), u; } function s(p, u, f) { if (typeof p == "number") { if (typeof u == "string") throw new TypeError('The "string" argument must be of type string. Received type number'); return h(p); } return a(p, u, f); } s.poolSize = 8192; function a(p, u, f) { if (typeof p == "string") return d(p, u); if (ArrayBuffer.isView(p)) return y(p); if (p == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + _typeof(p)); if (Ye(p, ArrayBuffer) || p && Ye(p.buffer, ArrayBuffer) || (typeof SharedArrayBuffer === "undefined" ? "undefined" : _typeof(SharedArrayBuffer)) < "u" && (Ye(p, SharedArrayBuffer) || p && Ye(p.buffer, SharedArrayBuffer))) return w(p, u, f); if (typeof p == "number") throw new TypeError('The "value" argument must not be of type number. Received type number'); var b = p.valueOf && p.valueOf(); if (b != null && b !== p) return s.from(b, u, f); var A = S(p); if (A) return A; if ((typeof Symbol === "undefined" ? "undefined" : _typeof(Symbol)) < "u" && Symbol.toPrimitive != null && typeof p[Symbol.toPrimitive] == "function") return s.from(p[Symbol.toPrimitive]("string"), u, f); throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + _typeof(p)); } s.from = function (p, u, f) { return a(p, u, f); }, Object.setPrototypeOf(s.prototype, Uint8Array.prototype), Object.setPrototypeOf(s, Uint8Array); function l(p) { if (typeof p != "number") throw new TypeError('"size" argument must be of type number'); if (p < 0) throw new RangeError('The value "' + p + '" is invalid for option "size"'); } function c(p, u, f) { return l(p), p <= 0 ? o(p) : u !== void 0 ? typeof f == "string" ? o(p).fill(u, f) : o(p).fill(u) : o(p); } s.alloc = function (p, u, f) { return c(p, u, f); }; function h(p) { return l(p), o(p < 0 ? 0 : E(p) | 0); } s.allocUnsafe = function (p) { return h(p); }, s.allocUnsafeSlow = function (p) { return h(p); }; function d(p, u) { if ((typeof u != "string" || u === "") && (u = "utf8"), !s.isEncoding(u)) throw new TypeError("Unknown encoding: " + u); var f = C(p, u) | 0, b = o(f), A = b.write(p, u); return A !== f && (b = b.slice(0, A)), b; } function g(p) { var u = p.length < 0 ? 0 : E(p.length) | 0, f = o(u); for (var b = 0; b < u; b += 1) f[b] = p[b] & 255; return f; } function y(p) { if (Ye(p, Uint8Array)) { var u = new Uint8Array(p); return w(u.buffer, u.byteOffset, u.byteLength); } return g(p); } function w(p, u, f) { if (u < 0 || p.byteLength < u) throw new RangeError('"offset" is outside of buffer bounds'); if (p.byteLength < u + (f || 0)) throw new RangeError('"length" is outside of buffer bounds'); var b; return u === void 0 && f === void 0 ? b = new Uint8Array(p) : f === void 0 ? b = new Uint8Array(p, u) : b = new Uint8Array(p, u, f), Object.setPrototypeOf(b, s.prototype), b; } function S(p) { if (s.isBuffer(p)) { var u = E(p.length) | 0, f = o(u); return f.length === 0 || p.copy(f, 0, 0, u), f; } if (p.length !== void 0) return typeof p.length != "number" || gs(p.length) ? o(0) : g(p); if (p.type === "Buffer" && Array.isArray(p.data)) return g(p.data); } function E(p) { if (p >= i) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes"); return p | 0; } function I(p) { return +p != p && (p = 0), s.alloc(+p); } s.isBuffer = function (u) { return u != null && u._isBuffer === !0 && u !== s.prototype; }, s.compare = function (u, f) { if (Ye(u, Uint8Array) && (u = s.from(u, u.offset, u.byteLength)), Ye(f, Uint8Array) && (f = s.from(f, f.offset, f.byteLength)), !s.isBuffer(u) || !s.isBuffer(f)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); if (u === f) return 0; var b = u.length, A = f.length; for (var T = 0, P = Math.min(b, A); T < P; ++T) if (u[T] !== f[T]) { b = u[T], A = f[T]; break; } return b < A ? -1 : A < b ? 1 : 0; }, s.isEncoding = function (u) { switch (String(u).toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "latin1": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return !0; default: return !1; } }, s.concat = function (u, f) { if (!Array.isArray(u)) throw new TypeError('"list" argument must be an Array of Buffers'); if (u.length === 0) return s.alloc(0); var b; if (f === void 0) for (f = 0, b = 0; b < u.length; ++b) f += u[b].length; var A = s.allocUnsafe(f), T = 0; for (b = 0; b < u.length; ++b) { var P = u[b]; if (Ye(P, Uint8Array)) T + P.length > A.length ? (s.isBuffer(P) || (P = s.from(P)), P.copy(A, T)) : Uint8Array.prototype.set.call(A, P, T);else if (s.isBuffer(P)) P.copy(A, T);else throw new TypeError('"list" argument must be an Array of Buffers'); T += P.length; } return A; }; function C(p, u) { if (s.isBuffer(p)) return p.length; if (ArrayBuffer.isView(p) || Ye(p, ArrayBuffer)) return p.byteLength; if (typeof p != "string") throw new TypeError('The "string