import D from "./typeof.mjs";
function H() {
  H = function() {
    return h;
  };
  var l, h = {}, S = Object.prototype, y = S.hasOwnProperty, w = Object.defineProperty || function(r, t, e) {
    r[t] = e.value;
  }, O = typeof Symbol == "function" ? Symbol : {}, x = O.iterator || "@@iterator", W = O.asyncIterator || "@@asyncIterator", j = O.toStringTag || "@@toStringTag";
  function f(r, t, e) {
    return Object.defineProperty(r, t, {
      value: e,
      enumerable: !0,
      configurable: !0,
      writable: !0
    }), r[t];
  }
  try {
    f({}, "");
  } catch {
    f = function(e, n, a) {
      return e[n] = a;
    };
  }
  function A(r, t, e, n) {
    var a = t && t.prototype instanceof G ? t : G, o = Object.create(a.prototype), i = new T(n || []);
    return w(o, "_invoke", {
      value: z(r, e, i)
    }), o;
  }
  function k(r, t, e) {
    try {
      return {
        type: "normal",
        arg: r.call(t, e)
      };
    } catch (n) {
      return {
        type: "throw",
        arg: n
      };
    }
  }
  h.wrap = A;
  var M = "suspendedStart", q = "suspendedYield", Y = "executing", b = "completed", s = {};
  function G() {
  }
  function L() {
  }
  function v() {
  }
  var I = {};
  f(I, x, function() {
    return this;
  });
  var N = Object.getPrototypeOf, E = N && N(N(F([])));
  E && E !== S && y.call(E, x) && (I = E);
  var m = v.prototype = G.prototype = Object.create(I);
  function C(r) {
    ["next", "throw", "return"].forEach(function(t) {
      f(r, t, function(e) {
        return this._invoke(t, e);
      });
    });
  }
  function _(r, t) {
    function e(a, o, i, c) {
      var u = k(r[a], r, o);
      if (u.type !== "throw") {
        var d = u.arg, p = d.value;
        return p && D(p) == "object" && y.call(p, "__await") ? t.resolve(p.__await).then(function(g) {
          e("next", g, i, c);
        }, function(g) {
          e("throw", g, i, c);
        }) : t.resolve(p).then(function(g) {
          d.value = g, i(d);
        }, function(g) {
          return e("throw", g, i, c);
        });
      }
      c(u.arg);
    }
    var n;
    w(this, "_invoke", {
      value: function(o, i) {
        function c() {
          return new t(function(u, d) {
            e(o, i, u, d);
          });
        }
        return n = n ? n.then(c, c) : c();
      }
    });
  }
  function z(r, t, e) {
    var n = M;
    return function(a, o) {
      if (n === Y)
        throw new Error("Generator is already running");
      if (n === b) {
        if (a === "throw")
          throw o;
        return {
          value: l,
          done: !0
        };
      }
      for (e.method = a, e.arg = o; ; ) {
        var i = e.delegate;
        if (i) {
          var c = R(i, e);
          if (c) {
            if (c === s)
              continue;
            return c;
          }
        }
        if (e.method === "next")
          e.sent = e._sent = e.arg;
        else if (e.method === "throw") {
          if (n === M)
            throw n = b, e.arg;
          e.dispatchException(e.arg);
        } else
          e.method === "return" && e.abrupt("return", e.arg);
        n = Y;
        var u = k(r, t, e);
        if (u.type === "normal") {
          if (n = e.done ? b : q, u.arg === s)
            continue;
          return {
            value: u.arg,
            done: e.done
          };
        }
        u.type === "throw" && (n = b, e.method = "throw", e.arg = u.arg);
      }
    };
  }
  function R(r, t) {
    var e = t.method, n = r.iterator[e];
    if (n === l)
      return t.delegate = null, e === "throw" && r.iterator.return && (t.method = "return", t.arg = l, R(r, t), t.method === "throw") || e !== "return" && (t.method = "throw", t.arg = new TypeError("The iterator does not provide a '" + e + "' method")), s;
    var a = k(n, r.iterator, t.arg);
    if (a.type === "throw")
      return t.method = "throw", t.arg = a.arg, t.delegate = null, s;
    var o = a.arg;
    return o ? o.done ? (t[r.resultName] = o.value, t.next = r.nextLoc, t.method !== "return" && (t.method = "next", t.arg = l), t.delegate = null, s) : o : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, s);
  }
  function B(r) {
    var t = {
      tryLoc: r[0]
    };
    1 in r && (t.catchLoc = r[1]), 2 in r && (t.finallyLoc = r[2], t.afterLoc = r[3]), this.tryEntries.push(t);
  }
  function P(r) {
    var t = r.completion || {};
    t.type = "normal", delete t.arg, r.completion = t;
  }
  function T(r) {
    this.tryEntries = [{
      tryLoc: "root"
    }], r.forEach(B, this), this.reset(!0);
  }
  function F(r) {
    if (r || r === "") {
      var t = r[x];
      if (t)
        return t.call(r);
      if (typeof r.next == "function")
        return r;
      if (!isNaN(r.length)) {
        var e = -1, n = function a() {
          for (; ++e < r.length; )
            if (y.call(r, e))
              return a.value = r[e], a.done = !1, a;
          return a.value = l, a.done = !0, a;
        };
        return n.next = n;
      }
    }
    throw new TypeError(D(r) + " is not iterable");
  }
  return L.prototype = v, w(m, "constructor", {
    value: v,
    configurable: !0
  }), w(v, "constructor", {
    value: L,
    configurable: !0
  }), L.displayName = f(v, j, "GeneratorFunction"), h.isGeneratorFunction = function(r) {
    var t = typeof r == "function" && r.constructor;
    return !!t && (t === L || (t.displayName || t.name) === "GeneratorFunction");
  }, h.mark = function(r) {
    return Object.setPrototypeOf ? Object.setPrototypeOf(r, v) : (r.__proto__ = v, f(r, j, "GeneratorFunction")), r.prototype = Object.create(m), r;
  }, h.awrap = function(r) {
    return {
      __await: r
    };
  }, C(_.prototype), f(_.prototype, W, function() {
    return this;
  }), h.AsyncIterator = _, h.async = function(r, t, e, n, a) {
    a === void 0 && (a = Promise);
    var o = new _(A(r, t, e, n), a);
    return h.isGeneratorFunction(t) ? o : o.next().then(function(i) {
      return i.done ? i.value : o.next();
    });
  }, C(m), f(m, j, "Generator"), f(m, x, function() {
    return this;
  }), f(m, "toString", function() {
    return "[object Generator]";
  }), h.keys = function(r) {
    var t = Object(r), e = [];
    for (var n in t)
      e.push(n);
    return e.reverse(), function a() {
      for (; e.length; ) {
        var o = e.pop();
        if (o in t)
          return a.value = o, a.done = !1, a;
      }
      return a.done = !0, a;
    };
  }, h.values = F, T.prototype = {
    constructor: T,
    reset: function(t) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = l, this.done = !1, this.delegate = null, this.method = "next", this.arg = l, this.tryEntries.forEach(P), !t)
        for (var e in this)
          e.charAt(0) === "t" && y.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = l);
    },
    stop: function() {
      this.done = !0;
      var t = this.tryEntries[0].completion;
      if (t.type === "throw")
        throw t.arg;
      return this.rval;
    },
    dispatchException: function(t) {
      if (this.done)
        throw t;
      var e = this;
      function n(d, p) {
        return i.type = "throw", i.arg = t, e.next = d, p && (e.method = "next", e.arg = l), !!p;
      }
      for (var a = this.tryEntries.length - 1; a >= 0; --a) {
        var o = this.tryEntries[a], i = o.completion;
        if (o.tryLoc === "root")
          return n("end");
        if (o.tryLoc <= this.prev) {
          var c = y.call(o, "catchLoc"), u = y.call(o, "finallyLoc");
          if (c && u) {
            if (this.prev < o.catchLoc)
              return n(o.catchLoc, !0);
            if (this.prev < o.finallyLoc)
              return n(o.finallyLoc);
          } else if (c) {
            if (this.prev < o.catchLoc)
              return n(o.catchLoc, !0);
          } else {
            if (!u)
              throw new Error("try statement without catch or finally");
            if (this.prev < o.finallyLoc)
              return n(o.finallyLoc);
          }
        }
      }
    },
    abrupt: function(t, e) {
      for (var n = this.tryEntries.length - 1; n >= 0; --n) {
        var a = this.tryEntries[n];
        if (a.tryLoc <= this.prev && y.call(a, "finallyLoc") && this.prev < a.finallyLoc) {
          var o = a;
          break;
        }
      }
      o && (t === "break" || t === "continue") && o.tryLoc <= e && e <= o.finallyLoc && (o = null);
      var i = o ? o.completion : {};
      return i.type = t, i.arg = e, o ? (this.method = "next", this.next = o.finallyLoc, s) : this.complete(i);
    },
    complete: function(t, e) {
      if (t.type === "throw")
        throw t.arg;
      return t.type === "break" || t.type === "continue" ? this.next = t.arg : t.type === "return" ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : t.type === "normal" && e && (this.next = e), s;
    },
    finish: function(t) {
      for (var e = this.tryEntries.length - 1; e >= 0; --e) {
        var n = this.tryEntries[e];
        if (n.finallyLoc === t)
          return this.complete(n.completion, n.afterLoc), P(n), s;
      }
    },
    catch: function(t) {
      for (var e = this.tryEntries.length - 1; e >= 0; --e) {
        var n = this.tryEntries[e];
        if (n.tryLoc === t) {
          var a = n.completion;
          if (a.type === "throw") {
            var o = a.arg;
            P(n);
          }
          return o;
        }
      }
      throw new Error("illegal catch attempt");
    },
    delegateYield: function(t, e, n) {
      return this.delegate = {
        iterator: F(t),
        resultName: e,
        nextLoc: n
      }, this.method === "next" && (this.arg = l), s;
    }
  }, h;
}
export {
  H as default
};
