import { y as Bt, z as It, r as zt, E as qt, A as Vt } from "./http-BRrcyI2V.mjs";
function Re(e, t = {}) {
  const { key: s = "fallback", name: r = "Fallback", rank: i = !1, shouldThrow: n = Wt, retryCount: c, retryDelay: a } = t;
  return (({ chain: h, pollingInterval: o = 4e3, timeout: f, ...l }) => {
    let d = e, _ = () => {
    };
    const E = Bt({
      key: s,
      name: r,
      async request({ method: u, params: $ }) {
        let m;
        const P = async (w = 0) => {
          const b = d[w]({
            ...l,
            chain: h,
            retryCount: 0,
            timeout: f
          });
          try {
            const S = await b.request({
              method: u,
              params: $
            });
            return _({
              method: u,
              params: $,
              response: S,
              transport: b,
              status: "success"
            }), S;
          } catch (S) {
            if (_({
              error: S,
              method: u,
              params: $,
              transport: b,
              status: "error"
            }), n(S) || w === d.length - 1 || (m ??= d.slice(w + 1).some((x) => {
              const { include: O, exclude: tt } = x({ chain: h }).config.methods || {};
              return O ? O.includes(u) : tt ? !tt.includes(u) : !0;
            }), !m))
              throw S;
            return P(w + 1);
          }
        };
        return P();
      },
      retryCount: c,
      retryDelay: a,
      type: "fallback"
    }, {
      onResponse: (u) => _ = u,
      transports: d.map((u) => u({ chain: h, retryCount: 0 }))
    });
    if (i) {
      const u = typeof i == "object" ? i : {};
      Ft({
        chain: h,
        interval: u.interval ?? o,
        onTransports: ($) => d = $,
        ping: u.ping,
        sampleCount: u.sampleCount,
        timeout: u.timeout,
        transports: d,
        weights: u.weights
      });
    }
    return E;
  });
}
function Wt(e) {
  return !!("code" in e && typeof e.code == "number" && (e.code === It.code || e.code === zt.code || qt.nodeMessage.test(e.message) || e.code === 5e3));
}
function Ft({ chain: e, interval: t = 4e3, onTransports: s, ping: r, sampleCount: i = 10, timeout: n = 1e3, transports: c, weights: a = {} }) {
  const { stability: h = 0.7, latency: o = 0.3 } = a, f = [], l = async () => {
    const d = await Promise.all(c.map(async (u) => {
      const $ = u({ chain: e, retryCount: 0, timeout: n }), m = Date.now();
      let P, w;
      try {
        await (r ? r({ transport: $ }) : $.request({ method: "net_listening" })), w = 1;
      } catch {
        w = 0;
      } finally {
        P = Date.now();
      }
      return { latency: P - m, success: w };
    }));
    f.push(d), f.length > i && f.shift();
    const _ = Math.max(...f.map((u) => Math.max(...u.map(({ latency: $ }) => $)))), E = c.map((u, $) => {
      const m = f.map((x) => x[$].latency), w = 1 - m.reduce((x, O) => x + O, 0) / m.length / _, b = f.map((x) => x[$].success), S = b.reduce((x, O) => x + O, 0) / b.length;
      return S === 0 ? [0, $] : [
        o * w + h * S,
        $
      ];
    }).sort((u, $) => $[0] - u[0]);
    s(E.map(([, u]) => c[u])), await Vt(t), l();
  };
  l();
}
var Jt = 20, Kt = 1, j = 1e6, mt = 1e6, Zt = -7, Xt = 21, Yt = !1, G = "[big.js] ", H = G + "Invalid ", ot = H + "decimal places", Gt = H + "rounding mode", Ct = G + "Division by zero", v = {}, R = void 0, Qt = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
function Nt() {
  function e(t) {
    var s = this;
    if (!(s instanceof e)) return t === R ? Nt() : new e(t);
    if (t instanceof e)
      s.s = t.s, s.e = t.e, s.c = t.c.slice();
    else {
      if (typeof t != "string") {
        if (e.strict === !0 && typeof t != "bigint")
          throw TypeError(H + "value");
        t = t === 0 && 1 / t < 0 ? "-0" : String(t);
      }
      te(s, t);
    }
    s.constructor = e;
  }
  return e.prototype = v, e.DP = Jt, e.RM = Kt, e.NE = Zt, e.PE = Xt, e.strict = Yt, e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
}
function te(e, t) {
  var s, r, i;
  if (!Qt.test(t))
    throw Error(H + "number");
  for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (s = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (s < 0 && (s = r), s += +t.slice(r + 1), t = t.substring(0, r)) : s < 0 && (s = t.length), i = t.length, r = 0; r < i && t.charAt(r) == "0"; ) ++r;
  if (r == i)
    e.c = [e.e = 0];
  else {
    for (; i > 0 && t.charAt(--i) == "0"; ) ;
    for (e.e = s - r - 1, e.c = [], s = 0; r <= i; ) e.c[s++] = +t.charAt(r++);
  }
  return e;
}
function L(e, t, s, r) {
  var i = e.c;
  if (s === R && (s = e.constructor.RM), s !== 0 && s !== 1 && s !== 2 && s !== 3)
    throw Error(Gt);
  if (t < 1)
    r = s === 3 && (r || !!i[0]) || t === 0 && (s === 1 && i[0] >= 5 || s === 2 && (i[0] > 5 || i[0] === 5 && (r || i[1] !== R))), i.length = 1, r ? (e.e = e.e - t + 1, i[0] = 1) : i[0] = e.e = 0;
  else if (t < i.length) {
    if (r = s === 1 && i[t] >= 5 || s === 2 && (i[t] > 5 || i[t] === 5 && (r || i[t + 1] !== R || i[t - 1] & 1)) || s === 3 && (r || !!i[0]), i.length = t, r) {
      for (; ++i[--t] > 9; )
        if (i[t] = 0, t === 0) {
          ++e.e, i.unshift(1);
          break;
        }
    }
    for (t = i.length; !i[--t]; ) i.pop();
  }
  return e;
}
function B(e, t, s) {
  var r = e.e, i = e.c.join(""), n = i.length;
  if (t)
    i = i.charAt(0) + (n > 1 ? "." + i.slice(1) : "") + (r < 0 ? "e" : "e+") + r;
  else if (r < 0) {
    for (; ++r; ) i = "0" + i;
    i = "0." + i;
  } else if (r > 0)
    if (++r > n)
      for (r -= n; r--; ) i += "0";
    else r < n && (i = i.slice(0, r) + "." + i.slice(r));
  else n > 1 && (i = i.charAt(0) + "." + i.slice(1));
  return e.s < 0 && s ? "-" + i : i;
}
v.abs = function() {
  var e = new this.constructor(this);
  return e.s = 1, e;
};
v.cmp = function(e) {
  var t, s = this, r = s.c, i = (e = new s.constructor(e)).c, n = s.s, c = e.s, a = s.e, h = e.e;
  if (!r[0] || !i[0]) return r[0] ? n : i[0] ? -c : 0;
  if (n != c) return n;
  if (t = n < 0, a != h) return a > h ^ t ? 1 : -1;
  for (c = (a = r.length) < (h = i.length) ? a : h, n = -1; ++n < c; )
    if (r[n] != i[n]) return r[n] > i[n] ^ t ? 1 : -1;
  return a == h ? 0 : a > h ^ t ? 1 : -1;
};
v.div = function(e) {
  var t = this, s = t.constructor, r = t.c, i = (e = new s(e)).c, n = t.s == e.s ? 1 : -1, c = s.DP;
  if (c !== ~~c || c < 0 || c > j)
    throw Error(ot);
  if (!i[0])
    throw Error(Ct);
  if (!r[0])
    return e.s = n, e.c = [e.e = 0], e;
  var a, h, o, f, l, d = i.slice(), _ = a = i.length, E = r.length, u = r.slice(0, a), $ = u.length, m = e, P = m.c = [], w = 0, b = c + (m.e = t.e - e.e) + 1;
  for (m.s = n, n = b < 0 ? 0 : b, d.unshift(0); $++ < a; ) u.push(0);
  do {
    for (o = 0; o < 10; o++) {
      if (a != ($ = u.length))
        f = a > $ ? 1 : -1;
      else
        for (l = -1, f = 0; ++l < a; )
          if (i[l] != u[l]) {
            f = i[l] > u[l] ? 1 : -1;
            break;
          }
      if (f < 0) {
        for (h = $ == a ? i : d; $; ) {
          if (u[--$] < h[$]) {
            for (l = $; l && !u[--l]; ) u[l] = 9;
            --u[l], u[$] += 10;
          }
          u[$] -= h[$];
        }
        for (; !u[0]; ) u.shift();
      } else
        break;
    }
    P[w++] = f ? o : ++o, u[0] && f ? u[$] = r[_] || 0 : u = [r[_]];
  } while ((_++ < E || u[0] !== R) && n--);
  return !P[0] && w != 1 && (P.shift(), m.e--, b--), w > b && L(m, b, s.RM, u[0] !== R), m;
};
v.eq = function(e) {
  return this.cmp(e) === 0;
};
v.gt = function(e) {
  return this.cmp(e) > 0;
};
v.gte = function(e) {
  return this.cmp(e) > -1;
};
v.lt = function(e) {
  return this.cmp(e) < 0;
};
v.lte = function(e) {
  return this.cmp(e) < 1;
};
v.minus = v.sub = function(e) {
  var t, s, r, i, n = this, c = n.constructor, a = n.s, h = (e = new c(e)).s;
  if (a != h)
    return e.s = -h, n.plus(e);
  var o = n.c.slice(), f = n.e, l = e.c, d = e.e;
  if (!o[0] || !l[0])
    return l[0] ? e.s = -h : o[0] ? e = new c(n) : e.s = 1, e;
  if (a = f - d) {
    for ((i = a < 0) ? (a = -a, r = o) : (d = f, r = l), r.reverse(), h = a; h--; ) r.push(0);
    r.reverse();
  } else
    for (s = ((i = o.length < l.length) ? o : l).length, a = h = 0; h < s; h++)
      if (o[h] != l[h]) {
        i = o[h] < l[h];
        break;
      }
  if (i && (r = o, o = l, l = r, e.s = -e.s), (h = (s = l.length) - (t = o.length)) > 0) for (; h--; ) o[t++] = 0;
  for (h = t; s > a; ) {
    if (o[--s] < l[s]) {
      for (t = s; t && !o[--t]; ) o[t] = 9;
      --o[t], o[s] += 10;
    }
    o[s] -= l[s];
  }
  for (; o[--h] === 0; ) o.pop();
  for (; o[0] === 0; )
    o.shift(), --d;
  return o[0] || (e.s = 1, o = [d = 0]), e.c = o, e.e = d, e;
};
v.mod = function(e) {
  var t, s = this, r = s.constructor, i = s.s, n = (e = new r(e)).s;
  if (!e.c[0])
    throw Error(Ct);
  return s.s = e.s = 1, t = e.cmp(s) == 1, s.s = i, e.s = n, t ? new r(s) : (i = r.DP, n = r.RM, r.DP = r.RM = 0, s = s.div(e), r.DP = i, r.RM = n, this.minus(s.times(e)));
};
v.neg = function() {
  var e = new this.constructor(this);
  return e.s = -e.s, e;
};
v.plus = v.add = function(e) {
  var t, s, r, i = this, n = i.constructor;
  if (e = new n(e), i.s != e.s)
    return e.s = -e.s, i.minus(e);
  var c = i.e, a = i.c, h = e.e, o = e.c;
  if (!a[0] || !o[0])
    return o[0] || (a[0] ? e = new n(i) : e.s = i.s), e;
  if (a = a.slice(), t = c - h) {
    for (t > 0 ? (h = c, r = o) : (t = -t, r = a), r.reverse(); t--; ) r.push(0);
    r.reverse();
  }
  for (a.length - o.length < 0 && (r = o, o = a, a = r), t = o.length, s = 0; t; a[t] %= 10) s = (a[--t] = a[t] + o[t] + s) / 10 | 0;
  for (s && (a.unshift(s), ++h), t = a.length; a[--t] === 0; ) a.pop();
  return e.c = a, e.e = h, e;
};
v.pow = function(e) {
  var t = this, s = new t.constructor("1"), r = s, i = e < 0;
  if (e !== ~~e || e < -mt || e > mt)
    throw Error(H + "exponent");
  for (i && (e = -e); e & 1 && (r = r.times(t)), e >>= 1, !!e; )
    t = t.times(t);
  return i ? s.div(r) : r;
};
v.prec = function(e, t) {
  if (e !== ~~e || e < 1 || e > j)
    throw Error(H + "precision");
  return L(new this.constructor(this), e, t);
};
v.round = function(e, t) {
  if (e === R) e = 0;
  else if (e !== ~~e || e < -j || e > j)
    throw Error(ot);
  return L(new this.constructor(this), e + this.e + 1, t);
};
v.sqrt = function() {
  var e, t, s, r = this, i = r.constructor, n = r.s, c = r.e, a = new i("0.5");
  if (!r.c[0]) return new i(r);
  if (n < 0)
    throw Error(G + "No square root");
  n = Math.sqrt(+B(r, !0, !0)), n === 0 || n === 1 / 0 ? (t = r.c.join(""), t.length + c & 1 || (t += "0"), n = Math.sqrt(t), c = ((c + 1) / 2 | 0) - (c < 0 || c & 1), e = new i((n == 1 / 0 ? "5e" : (n = n.toExponential()).slice(0, n.indexOf("e") + 1)) + c)) : e = new i(n + ""), c = e.e + (i.DP += 4);
  do
    s = e, e = a.times(s.plus(r.div(s)));
  while (s.c.slice(0, c).join("") !== e.c.slice(0, c).join(""));
  return L(e, (i.DP -= 4) + e.e + 1, i.RM);
};
v.times = v.mul = function(e) {
  var t, s = this, r = s.constructor, i = s.c, n = (e = new r(e)).c, c = i.length, a = n.length, h = s.e, o = e.e;
  if (e.s = s.s == e.s ? 1 : -1, !i[0] || !n[0])
    return e.c = [e.e = 0], e;
  for (e.e = h + o, c < a && (t = i, i = n, n = t, o = c, c = a, a = o), t = new Array(o = c + a); o--; ) t[o] = 0;
  for (h = a; h--; ) {
    for (a = 0, o = c + h; o > h; )
      a = t[o] + n[h] * i[o - h - 1] + a, t[o--] = a % 10, a = a / 10 | 0;
    t[o] = a;
  }
  for (a ? ++e.e : t.shift(), h = t.length; !t[--h]; ) t.pop();
  return e.c = t, e;
};
v.toExponential = function(e, t) {
  var s = this, r = s.c[0];
  if (e !== R) {
    if (e !== ~~e || e < 0 || e > j)
      throw Error(ot);
    for (s = L(new s.constructor(s), ++e, t); s.c.length < e; ) s.c.push(0);
  }
  return B(s, !0, !!r);
};
v.toFixed = function(e, t) {
  var s = this, r = s.c[0];
  if (e !== R) {
    if (e !== ~~e || e < 0 || e > j)
      throw Error(ot);
    for (s = L(new s.constructor(s), e + s.e + 1, t), e = e + s.e + 1; s.c.length < e; ) s.c.push(0);
  }
  return B(s, !1, !!r);
};
v[Symbol.for("nodejs.util.inspect.custom")] = v.toJSON = v.toString = function() {
  var e = this, t = e.constructor;
  return B(e, e.e <= t.NE || e.e >= t.PE, !!e.c[0]);
};
v.toNumber = function() {
  var e = +B(this, !0, !0);
  if (this.constructor.strict === !0 && !this.eq(e.toString()))
    throw Error(G + "Imprecise conversion");
  return e;
};
v.toPrecision = function(e, t) {
  var s = this, r = s.constructor, i = s.c[0];
  if (e !== R) {
    if (e !== ~~e || e < 1 || e > j)
      throw Error(H + "precision");
    for (s = L(new r(s), e, t); s.c.length < e; ) s.c.push(0);
  }
  return B(s, e <= s.e || s.e <= r.NE || s.e >= r.PE, !!i);
};
v.valueOf = function() {
  var e = this, t = e.constructor;
  if (t.strict === !0)
    throw Error(G + "valueOf disallowed");
  return B(e, e.e <= t.NE || e.e >= t.PE, !0);
};
var Ce = Nt();
const ee = Symbol(), At = Object.getPrototypeOf, ut = /* @__PURE__ */ new WeakMap(), se = (e) => e && (ut.has(e) ? ut.get(e) : At(e) === Object.prototype || At(e) === Array.prototype), re = (e) => se(e) && e[ee] || null, vt = (e, t = !0) => {
  ut.set(e, t);
}, it = {}, ht = (e) => typeof e == "object" && e !== null, N = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakSet(), ie = (e = Object.is, t = (o, f) => new Proxy(o, f), s = (o) => ht(o) && !J.has(o) && (Array.isArray(o) || !(Symbol.iterator in o)) && !(o instanceof WeakMap) && !(o instanceof WeakSet) && !(o instanceof Error) && !(o instanceof Number) && !(o instanceof Date) && !(o instanceof String) && !(o instanceof RegExp) && !(o instanceof ArrayBuffer), r = (o) => {
  switch (o.status) {
    case "fulfilled":
      return o.value;
    case "rejected":
      throw o.reason;
    default:
      throw o;
  }
}, i = /* @__PURE__ */ new WeakMap(), n = (o, f, l = r) => {
  const d = i.get(o);
  if (d?.[0] === f)
    return d[1];
  const _ = Array.isArray(o) ? [] : Object.create(Object.getPrototypeOf(o));
  return vt(_, !0), i.set(o, [f, _]), Reflect.ownKeys(o).forEach((E) => {
    if (Object.getOwnPropertyDescriptor(_, E))
      return;
    const u = Reflect.get(o, E), { enumerable: $ } = Reflect.getOwnPropertyDescriptor(
      o,
      E
    ), m = {
      value: u,
      enumerable: $,
      // This is intentional to avoid copying with proxy-compare.
      // It's still non-writable, so it avoids assigning a value.
      configurable: !0
    };
    if (J.has(u))
      vt(u, !1);
    else if (u instanceof Promise)
      delete m.value, m.get = () => l(u);
    else if (N.has(u)) {
      const [P, w] = N.get(
        u
      );
      m.value = n(
        P,
        w(),
        l
      );
    }
    Object.defineProperty(_, E, m);
  }), Object.preventExtensions(_);
}, c = /* @__PURE__ */ new WeakMap(), a = [1, 1], h = (o) => {
  if (!ht(o))
    throw new Error("object required");
  const f = c.get(o);
  if (f)
    return f;
  let l = a[0];
  const d = /* @__PURE__ */ new Set(), _ = (A, g = ++a[0]) => {
    l !== g && (l = g, d.forEach((p) => p(A, g)));
  };
  let E = a[1];
  const u = (A = ++a[1]) => (E !== A && !d.size && (E = A, m.forEach(([g]) => {
    const p = g[1](A);
    p > l && (l = p);
  })), l), $ = (A) => (g, p) => {
    const M = [...g];
    M[1] = [A, ...M[1]], _(M, p);
  }, m = /* @__PURE__ */ new Map(), P = (A, g) => {
    if ((it ? "production" : void 0) !== "production" && m.has(A))
      throw new Error("prop listener already exists");
    if (d.size) {
      const p = g[3]($(A));
      m.set(A, [g, p]);
    } else
      m.set(A, [g]);
  }, w = (A) => {
    var g;
    const p = m.get(A);
    p && (m.delete(A), (g = p[1]) == null || g.call(p));
  }, b = (A) => (d.add(A), d.size === 1 && m.forEach(([p, M], I) => {
    if ((it ? "production" : void 0) !== "production" && M)
      throw new Error("remove already exists");
    const W = p[3]($(I));
    m.set(I, [p, W]);
  }), () => {
    d.delete(A), d.size === 0 && m.forEach(([p, M], I) => {
      M && (M(), m.set(I, [p]));
    });
  }), S = Array.isArray(o) ? [] : Object.create(Object.getPrototypeOf(o)), O = t(S, {
    deleteProperty(A, g) {
      const p = Reflect.get(A, g);
      w(g);
      const M = Reflect.deleteProperty(A, g);
      return M && _(["delete", [g], p]), M;
    },
    set(A, g, p, M) {
      const I = Reflect.has(A, g), W = Reflect.get(A, g, M);
      if (I && (e(W, p) || c.has(p) && e(W, c.get(p))))
        return !0;
      w(g), ht(p) && (p = re(p) || p);
      let et = p;
      if (p instanceof Promise)
        p.then((C) => {
          p.status = "fulfilled", p.value = C, _(["resolve", [g], C]);
        }).catch((C) => {
          p.status = "rejected", p.reason = C, _(["reject", [g], C]);
        });
      else {
        !N.has(p) && s(p) && (et = h(p));
        const C = !J.has(et) && N.get(et);
        C && P(g, C);
      }
      return Reflect.set(A, g, et, M), _(["set", [g], p, W]), !0;
    }
  });
  c.set(o, O);
  const tt = [
    S,
    u,
    n,
    b
  ];
  return N.set(O, tt), Reflect.ownKeys(o).forEach((A) => {
    const g = Object.getOwnPropertyDescriptor(
      o,
      A
    );
    "value" in g && (O[A] = o[A], delete g.value, delete g.writable), Object.defineProperty(S, A, g);
  }), O;
}) => [
  // public functions
  h,
  // shared state
  N,
  J,
  // internal things
  e,
  t,
  s,
  r,
  i,
  n,
  c,
  a
], [ne] = ie();
function oe(e = {}) {
  return ne(e);
}
function ce(e, t, s) {
  const r = N.get(e);
  (it ? "production" : void 0) !== "production" && !r && console.warn("Please use proxy object");
  let i;
  const n = [], c = r[3];
  let a = !1;
  const o = c((f) => {
    n.push(f), i || (i = Promise.resolve().then(() => {
      i = void 0, a && t(n.splice(0));
    }));
  });
  return a = !0, () => {
    a = !1, o();
  };
}
function Ne(e, t) {
  const s = N.get(e);
  (it ? "production" : void 0) !== "production" && !s && console.warn("Please use proxy object");
  const [r, i, n] = s;
  return n(r, i(), t);
}
function Ue(e) {
  return J.add(e), e;
}
function Te(e, t, s, r) {
  let i = e[t];
  return ce(
    e,
    () => {
      const n = e[t];
      Object.is(i, n) || s(i = n);
    }
  );
}
function De(e) {
  const t = oe({
    data: Array.from([]),
    has(s) {
      return this.data.some((r) => r[0] === s);
    },
    set(s, r) {
      const i = this.data.find((n) => n[0] === s);
      return i ? i[1] = r : this.data.push([s, r]), this;
    },
    get(s) {
      var r;
      return (r = this.data.find((i) => i[0] === s)) == null ? void 0 : r[1];
    },
    delete(s) {
      const r = this.data.findIndex((i) => i[0] === s);
      return r === -1 ? !1 : (this.data.splice(r, 1), !0);
    },
    clear() {
      this.data.splice(0);
    },
    get size() {
      return this.data.length;
    },
    toJSON() {
      return new Map(this.data);
    },
    forEach(s) {
      this.data.forEach((r) => {
        s(r[1], r[0], this);
      });
    },
    keys() {
      return this.data.map((s) => s[0]).values();
    },
    values() {
      return this.data.map((s) => s[1]).values();
    },
    entries() {
      return new Map(this.data).entries();
    },
    get [Symbol.toStringTag]() {
      return "Map";
    },
    [Symbol.iterator]() {
      return this.entries();
    }
  });
  return Object.defineProperties(t, {
    data: {
      enumerable: !1
    },
    size: {
      enumerable: !1
    },
    toJSON: {
      enumerable: !1
    }
  }), Object.seal(t), t;
}
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const st = globalThis, dt = st.ShadowRoot && (st.ShadyCSS === void 0 || st.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = Symbol(), wt = /* @__PURE__ */ new WeakMap();
let Ut = class {
  constructor(t, s, r) {
    if (this._$cssResult$ = !0, r !== pt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
    this.cssText = t, this.t = s;
  }
  get styleSheet() {
    let t = this.o;
    const s = this.t;
    if (dt && t === void 0) {
      const r = s !== void 0 && s.length === 1;
      r && (t = wt.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && wt.set(s, t));
    }
    return t;
  }
  toString() {
    return this.cssText;
  }
};
const ae = (e) => new Ut(typeof e == "string" ? e : e + "", void 0, pt), ke = (e, ...t) => {
  const s = e.length === 1 ? e[0] : t.reduce(((r, i, n) => r + ((c) => {
    if (c._$cssResult$ === !0) return c.cssText;
    if (typeof c == "number") return c;
    throw Error("Value passed to 'css' function must be a 'css' function result: " + c + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
  })(i) + e[n + 1]), e[0]);
  return new Ut(s, e, pt);
}, he = (e, t) => {
  if (dt) e.adoptedStyleSheets = t.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
  else for (const s of t) {
    const r = document.createElement("style"), i = st.litNonce;
    i !== void 0 && r.setAttribute("nonce", i), r.textContent = s.cssText, e.appendChild(r);
  }
}, Et = dt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
  let s = "";
  for (const r of t.cssRules) s += r.cssText;
  return ae(s);
})(e) : e;
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const { is: le, defineProperty: ue, getOwnPropertyDescriptor: fe, getOwnPropertyNames: de, getOwnPropertySymbols: pe, getPrototypeOf: $e } = Object, ct = globalThis, yt = ct.trustedTypes, ge = yt ? yt.emptyScript : "", _e = ct.reactiveElementPolyfillSupport, K = (e, t) => e, ft = { toAttribute(e, t) {
  switch (t) {
    case Boolean:
      e = e ? ge : null;
      break;
    case Object:
    case Array:
      e = e == null ? e : JSON.stringify(e);
  }
  return e;
}, fromAttribute(e, t) {
  let s = e;
  switch (t) {
    case Boolean:
      s = e !== null;
      break;
    case Number:
      s = e === null ? null : Number(e);
      break;
    case Object:
    case Array:
      try {
        s = JSON.parse(e);
      } catch {
        s = null;
      }
  }
  return s;
} }, Tt = (e, t) => !le(e, t), bt = { attribute: !0, type: String, converter: ft, reflect: !1, useDefault: !1, hasChanged: Tt };
Symbol.metadata ??= Symbol("metadata"), ct.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
let z = class extends HTMLElement {
  static addInitializer(t) {
    this._$Ei(), (this.l ??= []).push(t);
  }
  static get observedAttributes() {
    return this.finalize(), this._$Eh && [...this._$Eh.keys()];
  }
  static createProperty(t, s = bt) {
    if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
      const r = Symbol(), i = this.getPropertyDescriptor(t, r, s);
      i !== void 0 && ue(this.prototype, t, i);
    }
  }
  static getPropertyDescriptor(t, s, r) {
    const { get: i, set: n } = fe(this.prototype, t) ?? { get() {
      return this[s];
    }, set(c) {
      this[s] = c;
    } };
    return { get: i, set(c) {
      const a = i?.call(this);
      n?.call(this, c), this.requestUpdate(t, a, r);
    }, configurable: !0, enumerable: !0 };
  }
  static getPropertyOptions(t) {
    return this.elementProperties.get(t) ?? bt;
  }
  static _$Ei() {
    if (this.hasOwnProperty(K("elementProperties"))) return;
    const t = $e(this);
    t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
  }
  static finalize() {
    if (this.hasOwnProperty(K("finalized"))) return;
    if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(K("properties"))) {
      const s = this.properties, r = [...de(s), ...pe(s)];
      for (const i of r) this.createProperty(i, s[i]);
    }
    const t = this[Symbol.metadata];
    if (t !== null) {
      const s = litPropertyMetadata.get(t);
      if (s !== void 0) for (const [r, i] of s) this.elementProperties.set(r, i);
    }
    this._$Eh = /* @__PURE__ */ new Map();
    for (const [s, r] of this.elementProperties) {
      const i = this._$Eu(s, r);
      i !== void 0 && this._$Eh.set(i, s);
    }
    this.elementStyles = this.finalizeStyles(this.styles);
  }
  static finalizeStyles(t) {
    const s = [];
    if (Array.isArray(t)) {
      const r = new Set(t.flat(1 / 0).reverse());
      for (const i of r) s.unshift(Et(i));
    } else t !== void 0 && s.push(Et(t));
    return s;
  }
  static _$Eu(t, s) {
    const r = s.attribute;
    return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
  }
  constructor() {
    super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
  }
  _$Ev() {
    this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
  }
  addController(t) {
    (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
  }
  removeController(t) {
    this._$EO?.delete(t);
  }
  _$E_() {
    const t = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
    for (const r of s.keys()) this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
    t.size > 0 && (this._$Ep = t);
  }
  createRenderRoot() {
    const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
    return he(t, this.constructor.elementStyles), t;
  }
  connectedCallback() {
    this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
  }
  enableUpdating(t) {
  }
  disconnectedCallback() {
    this._$EO?.forEach(((t) => t.hostDisconnected?.()));
  }
  attributeChangedCallback(t, s, r) {
    this._$AK(t, r);
  }
  _$ET(t, s) {
    const r = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, r);
    if (i !== void 0 && r.reflect === !0) {
      const n = (r.converter?.toAttribute !== void 0 ? r.converter : ft).toAttribute(s, r.type);
      this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
    }
  }
  _$AK(t, s) {
    const r = this.constructor, i = r._$Eh.get(t);
    if (i !== void 0 && this._$Em !== i) {
      const n = r.getPropertyOptions(i), c = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : ft;
      this._$Em = i;
      const a = c.fromAttribute(s, n.type);
      this[i] = a ?? this._$Ej?.get(i) ?? a, this._$Em = null;
    }
  }
  requestUpdate(t, s, r) {
    if (t !== void 0) {
      const i = this.constructor, n = this[t];
      if (r ??= i.getPropertyOptions(t), !((r.hasChanged ?? Tt)(n, s) || r.useDefault && r.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, r)))) return;
      this.C(t, s, r);
    }
    this.isUpdatePending === !1 && (this._$ES = this._$EP());
  }
  C(t, s, { useDefault: r, reflect: i, wrapped: n }, c) {
    r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, c ?? s ?? this[t]), n !== !0 || c !== void 0) || (this._$AL.has(t) || (this.hasUpdated || r || (s = void 0), this._$AL.set(t, s)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
  }
  async _$EP() {
    this.isUpdatePending = !0;
    try {
      await this._$ES;
    } catch (s) {
      Promise.reject(s);
    }
    const t = this.scheduleUpdate();
    return t != null && await t, !this.isUpdatePending;
  }
  scheduleUpdate() {
    return this.performUpdate();
  }
  performUpdate() {
    if (!this.isUpdatePending) return;
    if (!this.hasUpdated) {
      if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
        for (const [i, n] of this._$Ep) this[i] = n;
        this._$Ep = void 0;
      }
      const r = this.constructor.elementProperties;
      if (r.size > 0) for (const [i, n] of r) {
        const { wrapped: c } = n, a = this[i];
        c !== !0 || this._$AL.has(i) || a === void 0 || this.C(i, void 0, n, a);
      }
    }
    let t = !1;
    const s = this._$AL;
    try {
      t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(((r) => r.hostUpdate?.())), this.update(s)) : this._$EM();
    } catch (r) {
      throw t = !1, this._$EM(), r;
    }
    t && this._$AE(s);
  }
  willUpdate(t) {
  }
  _$AE(t) {
    this._$EO?.forEach(((s) => s.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
  }
  _$EM() {
    this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
  }
  get updateComplete() {
    return this.getUpdateComplete();
  }
  getUpdateComplete() {
    return this._$ES;
  }
  shouldUpdate(t) {
    return !0;
  }
  update(t) {
    this._$Eq &&= this._$Eq.forEach(((s) => this._$ET(s, this[s]))), this._$EM();
  }
  updated(t) {
  }
  firstUpdated(t) {
  }
};
z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[K("elementProperties")] = /* @__PURE__ */ new Map(), z[K("finalized")] = /* @__PURE__ */ new Map(), _e?.({ ReactiveElement: z }), (ct.reactiveElementVersions ??= []).push("2.1.1");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const $t = globalThis, nt = $t.trustedTypes, St = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Dt = "$lit$", U = `lit$${Math.random().toFixed(9).slice(2)}$`, jt = "?" + U, me = `<${jt}>`, k = document, Z = () => k.createComment(""), X = (e) => e === null || typeof e != "object" && typeof e != "function", gt = Array.isArray, Ae = (e) => gt(e) || typeof e?.[Symbol.iterator] == "function", lt = `[ 	
\f\r]`, F = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Pt = /-->/g, Mt = />/g, T = RegExp(`>|${lt}(?:([^\\s"'>=/]+)(${lt}*=${lt}*(?:[^ 	
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ot = /'/g, xt = /"/g, kt = /^(?:script|style|textarea|title)$/i, Ht = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), Le = Ht(1), Be = Ht(2), q = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), Rt = /* @__PURE__ */ new WeakMap(), D = k.createTreeWalker(k, 129);
function Lt(e, t) {
  if (!gt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
  return St !== void 0 ? St.createHTML(t) : t;
}
const ve = (e, t) => {
  const s = e.length - 1, r = [];
  let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", c = F;
  for (let a = 0; a < s; a++) {
    const h = e[a];
    let o, f, l = -1, d = 0;
    for (; d < h.length && (c.lastIndex = d, f = c.exec(h), f !== null); ) d = c.lastIndex, c === F ? f[1] === "!--" ? c = Pt : f[1] !== void 0 ? c = Mt : f[2] !== void 0 ? (kt.test(f[2]) && (i = RegExp("</" + f[2], "g")), c = T) : f[3] !== void 0 && (c = T) : c === T ? f[0] === ">" ? (c = i ?? F, l = -1) : f[1] === void 0 ? l = -2 : (l = c.lastIndex - f[2].length, o = f[1], c = f[3] === void 0 ? T : f[3] === '"' ? xt : Ot) : c === xt || c === Ot ? c = T : c === Pt || c === Mt ? c = F : (c = T, i = void 0);
    const _ = c === T && e[a + 1].startsWith("/>") ? " " : "";
    n += c === F ? h + me : l >= 0 ? (r.push(o), h.slice(0, l) + Dt + h.slice(l) + U + _) : h + U + (l === -2 ? a : _);
  }
  return [Lt(e, n + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
};
class Y {
  constructor({ strings: t, _$litType$: s }, r) {
    let i;
    this.parts = [];
    let n = 0, c = 0;
    const a = t.length - 1, h = this.parts, [o, f] = ve(t, s);
    if (this.el = Y.createElement(o, r), D.currentNode = this.el.content, s === 2 || s === 3) {
      const l = this.el.content.firstChild;
      l.replaceWith(...l.childNodes);
    }
    for (; (i = D.nextNode()) !== null && h.length < a; ) {
      if (i.nodeType === 1) {
        if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(Dt)) {
          const d = f[c++], _ = i.getAttribute(l).split(U), E = /([.?@])?(.*)/.exec(d);
          h.push({ type: 1, index: n, name: E[2], strings: _, ctor: E[1] === "." ? Ee : E[1] === "?" ? ye : E[1] === "@" ? be : at }), i.removeAttribute(l);
        } else l.startsWith(U) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
        if (kt.test(i.tagName)) {
          const l = i.textContent.split(U), d = l.length - 1;
          if (d > 0) {
            i.textContent = nt ? nt.emptyScript : "";
            for (let _ = 0; _ < d; _++) i.append(l[_], Z()), D.nextNode(), h.push({ type: 2, index: ++n });
            i.append(l[d], Z());
          }
        }
      } else if (i.nodeType === 8) if (i.data === jt) h.push({ type: 2, index: n });
      else {
        let l = -1;
        for (; (l = i.data.indexOf(U, l + 1)) !== -1; ) h.push({ type: 7, index: n }), l += U.length - 1;
      }
      n++;
    }
  }
  static createElement(t, s) {
    const r = k.createElement("template");
    return r.innerHTML = t, r;
  }
}
function V(e, t, s = e, r) {
  if (t === q) return t;
  let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
  const n = X(t) ? void 0 : t._$litDirective$;
  return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(e), i._$AT(e, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (t = V(e, i._$AS(e, t.values), i, r)), t;
}
class we {
  constructor(t, s) {
    this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = s;
  }
  get parentNode() {
    return this._$AM.parentNode;
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  u(t) {
    const { el: { content: s }, parts: r } = this._$AD, i = (t?.creationScope ?? k).importNode(s, !0);
    D.currentNode = i;
    let n = D.nextNode(), c = 0, a = 0, h = r[0];
    for (; h !== void 0; ) {
      if (c === h.index) {
        let o;
        h.type === 2 ? o = new Q(n, n.nextSibling, this, t) : h.type === 1 ? o = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (o = new Se(n, this, t)), this._$AV.push(o), h = r[++a];
      }
      c !== h?.index && (n = D.nextNode(), c++);
    }
    return D.currentNode = k, i;
  }
  p(t) {
    let s = 0;
    for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, s), s += r.strings.length - 2) : r._$AI(t[s])), s++;
  }
}
class Q {
  get _$AU() {
    return this._$AM?._$AU ?? this._$Cv;
  }
  constructor(t, s, r, i) {
    this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
  }
  get parentNode() {
    let t = this._$AA.parentNode;
    const s = this._$AM;
    return s !== void 0 && t?.nodeType === 11 && (t = s.parentNode), t;
  }
  get startNode() {
    return this._$AA;
  }
  get endNode() {
    return this._$AB;
  }
  _$AI(t, s = this) {
    t = V(this, t, s), X(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== q && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ae(t) ? this.k(t) : this._(t);
  }
  O(t) {
    return this._$AA.parentNode.insertBefore(t, this._$AB);
  }
  T(t) {
    this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
  }
  _(t) {
    this._$AH !== y && X(this._$AH) ? this._$AA.nextSibling.data = t : this.T(k.createTextNode(t)), this._$AH = t;
  }
  $(t) {
    const { values: s, _$litType$: r } = t, i = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Y.createElement(Lt(r.h, r.h[0]), this.options)), r);
    if (this._$AH?._$AD === i) this._$AH.p(s);
    else {
      const n = new we(i, this), c = n.u(this.options);
      n.p(s), this.T(c), this._$AH = n;
    }
  }
  _$AC(t) {
    let s = Rt.get(t.strings);
    return s === void 0 && Rt.set(t.strings, s = new Y(t)), s;
  }
  k(t) {
    gt(this._$AH) || (this._$AH = [], this._$AR());
    const s = this._$AH;
    let r, i = 0;
    for (const n of t) i === s.length ? s.push(r = new Q(this.O(Z()), this.O(Z()), this, this.options)) : r = s[i], r._$AI(n), i++;
    i < s.length && (this._$AR(r && r._$AB.nextSibling, i), s.length = i);
  }
  _$AR(t = this._$AA.nextSibling, s) {
    for (this._$AP?.(!1, !0, s); t !== this._$AB; ) {
      const r = t.nextSibling;
      t.remove(), t = r;
    }
  }
  setConnected(t) {
    this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
  }
}
class at {
  get tagName() {
    return this.element.tagName;
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  constructor(t, s, r, i, n) {
    this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = s, this._$AM = i, this.options = n, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = y;
  }
  _$AI(t, s = this, r, i) {
    const n = this.strings;
    let c = !1;
    if (n === void 0) t = V(this, t, s, 0), c = !X(t) || t !== this._$AH && t !== q, c && (this._$AH = t);
    else {
      const a = t;
      let h, o;
      for (t = n[0], h = 0; h < n.length - 1; h++) o = V(this, a[r + h], s, h), o === q && (o = this._$AH[h]), c ||= !X(o) || o !== this._$AH[h], o === y ? t = y : t !== y && (t += (o ?? "") + n[h + 1]), this._$AH[h] = o;
    }
    c && !i && this.j(t);
  }
  j(t) {
    t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
  }
}
class Ee extends at {
  constructor() {
    super(...arguments), this.type = 3;
  }
  j(t) {
    this.element[this.name] = t === y ? void 0 : t;
  }
}
class ye extends at {
  constructor() {
    super(...arguments), this.type = 4;
  }
  j(t) {
    this.element.toggleAttribute(this.name, !!t && t !== y);
  }
}
class be extends at {
  constructor(t, s, r, i, n) {
    super(t, s, r, i, n), this.type = 5;
  }
  _$AI(t, s = this) {
    if ((t = V(this, t, s, 0) ?? y) === q) return;
    const r = this._$AH, i = t === y && r !== y || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== y && (r === y || i);
    i && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
  }
  handleEvent(t) {
    typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
  }
}
class Se {
  constructor(t, s, r) {
    this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = r;
  }
  get _$AU() {
    return this._$AM._$AU;
  }
  _$AI(t) {
    V(this, t);
  }
}
const Pe = $t.litHtmlPolyfillSupport;
Pe?.(Y, Q), ($t.litHtmlVersions ??= []).push("3.3.1");
const Me = (e, t, s) => {
  const r = s?.renderBefore ?? t;
  let i = r._$litPart$;
  if (i === void 0) {
    const n = s?.renderBefore ?? null;
    r._$litPart$ = i = new Q(t.insertBefore(Z(), n), n, void 0, s ?? {});
  }
  return i._$AI(e), i;
};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const _t = globalThis;
class rt extends z {
  constructor() {
    super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
  }
  createRenderRoot() {
    const t = super.createRenderRoot();
    return this.renderOptions.renderBefore ??= t.firstChild, t;
  }
  update(t) {
    const s = this.render();
    this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Me(s, this.renderRoot, this.renderOptions);
  }
  connectedCallback() {
    super.connectedCallback(), this._$Do?.setConnected(!0);
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this._$Do?.setConnected(!1);
  }
  render() {
    return q;
  }
}
rt._$litElement$ = !0, rt.finalized = !0, _t.litElementHydrateSupport?.({ LitElement: rt });
const Oe = _t.litElementPolyfillSupport;
Oe?.({ LitElement: rt });
(_t.litElementVersions ??= []).push("4.2.1");
export {
  Ce as B,
  y as E,
  q as T,
  Te as a,
  Ne as b,
  De as c,
  ae as d,
  rt as e,
  Re as f,
  Be as g,
  Tt as h,
  ke as i,
  oe as p,
  Ue as r,
  ce as s,
  ft as u,
  Le as x
};
