import { _ as q } from "./index.es324.js";
import { e as Q } from "./index.es578.js";
import { g as W } from "./index.es367.js";
import { f as z } from "./index.es372.js";
import { d as K } from "./index.es560.js";
import { s as X } from "./index.es440.js";
import { s as Y } from "./index.es579.js";
import { a as Z } from "./index.es373.js";
import { i as rr } from "./index.es381.js";
import { i as er } from "./index.es520.js";
import { a as or } from "./index.es580.js";
import { s as ir } from "./index.es505.js";
import { t as ar } from "./index.es581.js";
import { m as tr } from "./index.es582.js";
import { h as nr } from "./index.es583.js";
import { p as sr } from "./index.es326.js";
import { q as vr } from "./index.es584.js";
import { i as fr } from "./index.es500.js";
import { p as cr } from "./index.es459.js";
import { p as lr } from "./index.es461.js";
import "./index.es325.js";
import { __exports as mr } from "./index.es327.js";
var pr = q, d = Q, t = W, l = z, ur = K, dr = X, Er = Y, hr = Z, N = rr, Cr = er, Nr = or, Pr = ir, g = ar.set, S = tr, Ir = nr, Tr = sr, yr = vr, U = fr, P = cr, D = lr, L = mr, E = "Promise", A = D.CONSTRUCTOR, Sr = D.REJECTION_EVENT;
D.SUBCLASSING;
var h = U.getterFor(E), Dr = U.set, Rr = P && P.prototype, v = P, C = Rr, H = t.TypeError, I = t.document, R = t.process, T = L.f, br = T, jr = !!(I && I.createEvent && t.dispatchEvent), k = "unhandledrejection", Or = "rejectionhandled", _ = 0, x = 1, _r = 2, b = 1, J = 2, u, $, $r, M = function(r) {
  var e;
  return Cr(r) && N(e = r.then) ? e : !1;
}, V = function(r, e) {
  var o = e.value, i = e.state === x, a = i ? r.ok : r.fail, m = r.resolve, p = r.reject, n = r.domain, s, j, O;
  try {
    a ? (i || (e.rejection === J && gr(e), e.rejection = b), a === !0 ? s = o : (n && n.enter(), s = a(o), n && (n.exit(), O = !0)), s === r.promise ? p(new H("Promise-chain cycle")) : (j = M(s)) ? l(j, s, m, p) : m(s)) : p(o);
  } catch (G) {
    n && !O && n.exit(), p(G);
  }
}, B = function(r, e) {
  r.notified || (r.notified = !0, S(function() {
    for (var o = r.reactions, i; i = o.get(); )
      V(i, r);
    r.notified = !1, e && !r.rejection && wr(r);
  }));
}, F = function(r, e, o) {
  var i, a;
  jr ? (i = I.createEvent("Event"), i.promise = e, i.reason = o, i.initEvent(r, !1, !0), t.dispatchEvent(i)) : i = { promise: e, reason: o }, !Sr && (a = t["on" + r]) ? a(i) : r === k && Ir("Unhandled promise rejection", o);
}, wr = function(r) {
  l(g, t, function() {
    var e = r.facade, o = r.value, i = w(r), a;
    if (i && (a = Tr(function() {
      d ? R.emit("unhandledRejection", o, e) : F(k, e, o);
    }), r.rejection = d || w(r) ? J : b, a.error))
      throw a.value;
  });
}, w = function(r) {
  return r.rejection !== b && !r.parent;
}, gr = function(r) {
  l(g, t, function() {
    var e = r.facade;
    d ? R.emit("rejectionHandled", e) : F(Or, e, r.value);
  });
}, f = function(r, e, o) {
  return function(i) {
    r(e, i, o);
  };
}, c = function(r, e, o) {
  r.done || (r.done = !0, o && (r = o), r.value = e, r.state = _r, B(r, !0));
}, y = function(r, e, o) {
  if (!r.done) {
    r.done = !0, o && (r = o);
    try {
      if (r.facade === e)
        throw new H("Promise can't be resolved itself");
      var i = M(e);
      i ? S(function() {
        var a = { done: !1 };
        try {
          l(
            i,
            e,
            f(y, a, r),
            f(c, a, r)
          );
        } catch (m) {
          c(a, m, r);
        }
      }) : (r.value = e, r.state = x, B(r, !1));
    } catch (a) {
      c({ done: !1 }, a, r);
    }
  }
};
A && (v = function(e) {
  Nr(this, C), hr(e), l(u, this);
  var o = h(this);
  try {
    e(f(y, o), f(c, o));
  } catch (i) {
    c(o, i);
  }
}, C = v.prototype, u = function(e) {
  Dr(this, {
    type: E,
    done: !1,
    notified: !1,
    parent: !1,
    reactions: new yr(),
    rejection: !1,
    state: _,
    value: void 0
  });
}, u.prototype = ur(C, "then", function(e, o) {
  var i = h(this), a = T(Pr(this, v));
  return i.parent = !0, a.ok = N(e) ? e : !0, a.fail = N(o) && o, a.domain = d ? R.domain : void 0, i.state === _ ? i.reactions.add(a) : S(function() {
    V(a, i);
  }), a.promise;
}), $ = function() {
  var r = new u(), e = h(r);
  this.promise = r, this.resolve = f(y, e), this.reject = f(c, e);
}, L.f = T = function(r) {
  return r === v || r === $r ? new $(r) : br(r);
});
pr({ global: !0, constructor: !0, wrap: !0, forced: A }, {
  Promise: v
});
dr(v, E, !1, !0);
Er(E);
//# sourceMappingURL=index.es431.js.map
