import { dE as Re, $ as je, ac as Pe, a1 as Ie } from "./index-CjwA7HmM.mjs";
var He = {}, Bt = {}, x = {}, ge = {};
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 });
  function r(u, o) {
    var s = u >>> 16 & 65535, _ = u & 65535, w = o >>> 16 & 65535, E = o & 65535;
    return _ * E + (s * E + _ * w << 16 >>> 0) | 0;
  }
  t.mul = Math.imul || r;
  function n(u, o) {
    return u + o | 0;
  }
  t.add = n;
  function i(u, o) {
    return u - o | 0;
  }
  t.sub = i;
  function h(u, o) {
    return u << o | u >>> 32 - o;
  }
  t.rotl = h;
  function f(u, o) {
    return u << 32 - o | u >>> o;
  }
  t.rotr = f;
  function d(u) {
    return typeof u == "number" && isFinite(u) && Math.floor(u) === u;
  }
  t.isInteger = Number.isInteger || d, t.MAX_SAFE_INTEGER = 9007199254740991, t.isSafeInteger = function(u) {
    return t.isInteger(u) && u >= -t.MAX_SAFE_INTEGER && u <= t.MAX_SAFE_INTEGER;
  };
})(ge);
Object.defineProperty(x, "__esModule", { value: !0 });
var ye = ge;
function Ke(t, r) {
  return r === void 0 && (r = 0), (t[r + 0] << 8 | t[r + 1]) << 16 >> 16;
}
x.readInt16BE = Ke;
function ze(t, r) {
  return r === void 0 && (r = 0), (t[r + 0] << 8 | t[r + 1]) >>> 0;
}
x.readUint16BE = ze;
function Ye(t, r) {
  return r === void 0 && (r = 0), (t[r + 1] << 8 | t[r]) << 16 >> 16;
}
x.readInt16LE = Ye;
function We(t, r) {
  return r === void 0 && (r = 0), (t[r + 1] << 8 | t[r]) >>> 0;
}
x.readUint16LE = We;
function pe(t, r, n) {
  return r === void 0 && (r = new Uint8Array(2)), n === void 0 && (n = 0), r[n + 0] = t >>> 8, r[n + 1] = t >>> 0, r;
}
x.writeUint16BE = pe;
x.writeInt16BE = pe;
function Se(t, r, n) {
  return r === void 0 && (r = new Uint8Array(2)), n === void 0 && (n = 0), r[n + 0] = t >>> 0, r[n + 1] = t >>> 8, r;
}
x.writeUint16LE = Se;
x.writeInt16LE = Se;
function Gt(t, r) {
  return r === void 0 && (r = 0), t[r] << 24 | t[r + 1] << 16 | t[r + 2] << 8 | t[r + 3];
}
x.readInt32BE = Gt;
function $t(t, r) {
  return r === void 0 && (r = 0), (t[r] << 24 | t[r + 1] << 16 | t[r + 2] << 8 | t[r + 3]) >>> 0;
}
x.readUint32BE = $t;
function Vt(t, r) {
  return r === void 0 && (r = 0), t[r + 3] << 24 | t[r + 2] << 16 | t[r + 1] << 8 | t[r];
}
x.readInt32LE = Vt;
function Xt(t, r) {
  return r === void 0 && (r = 0), (t[r + 3] << 24 | t[r + 2] << 16 | t[r + 1] << 8 | t[r]) >>> 0;
}
x.readUint32LE = Xt;
function Lt(t, r, n) {
  return r === void 0 && (r = new Uint8Array(4)), n === void 0 && (n = 0), r[n + 0] = t >>> 24, r[n + 1] = t >>> 16, r[n + 2] = t >>> 8, r[n + 3] = t >>> 0, r;
}
x.writeUint32BE = Lt;
x.writeInt32BE = Lt;
function xt(t, r, n) {
  return r === void 0 && (r = new Uint8Array(4)), n === void 0 && (n = 0), r[n + 0] = t >>> 0, r[n + 1] = t >>> 8, r[n + 2] = t >>> 16, r[n + 3] = t >>> 24, r;
}
x.writeUint32LE = xt;
x.writeInt32LE = xt;
function qe(t, r) {
  r === void 0 && (r = 0);
  var n = Gt(t, r), i = Gt(t, r + 4);
  return n * 4294967296 + i - (i >> 31) * 4294967296;
}
x.readInt64BE = qe;
function Ge(t, r) {
  r === void 0 && (r = 0);
  var n = $t(t, r), i = $t(t, r + 4);
  return n * 4294967296 + i;
}
x.readUint64BE = Ge;
function $e(t, r) {
  r === void 0 && (r = 0);
  var n = Vt(t, r), i = Vt(t, r + 4);
  return i * 4294967296 + n - (n >> 31) * 4294967296;
}
x.readInt64LE = $e;
function Ve(t, r) {
  r === void 0 && (r = 0);
  var n = Xt(t, r), i = Xt(t, r + 4);
  return i * 4294967296 + n;
}
x.readUint64LE = Ve;
function me(t, r, n) {
  return r === void 0 && (r = new Uint8Array(8)), n === void 0 && (n = 0), Lt(t / 4294967296 >>> 0, r, n), Lt(t >>> 0, r, n + 4), r;
}
x.writeUint64BE = me;
x.writeInt64BE = me;
function Ce(t, r, n) {
  return r === void 0 && (r = new Uint8Array(8)), n === void 0 && (n = 0), xt(t >>> 0, r, n), xt(t / 4294967296 >>> 0, r, n + 4), r;
}
x.writeUint64LE = Ce;
x.writeInt64LE = Ce;
function Xe(t, r, n) {
  if (n === void 0 && (n = 0), t % 8 !== 0)
    throw new Error("readUintBE supports only bitLengths divisible by 8");
  if (t / 8 > r.length - n)
    throw new Error("readUintBE: array is too short for the given bitLength");
  for (var i = 0, h = 1, f = t / 8 + n - 1; f >= n; f--)
    i += r[f] * h, h *= 256;
  return i;
}
x.readUintBE = Xe;
function Je(t, r, n) {
  if (n === void 0 && (n = 0), t % 8 !== 0)
    throw new Error("readUintLE supports only bitLengths divisible by 8");
  if (t / 8 > r.length - n)
    throw new Error("readUintLE: array is too short for the given bitLength");
  for (var i = 0, h = 1, f = n; f < n + t / 8; f++)
    i += r[f] * h, h *= 256;
  return i;
}
x.readUintLE = Je;
function Ze(t, r, n, i) {
  if (n === void 0 && (n = new Uint8Array(t / 8)), i === void 0 && (i = 0), t % 8 !== 0)
    throw new Error("writeUintBE supports only bitLengths divisible by 8");
  if (!ye.isSafeInteger(r))
    throw new Error("writeUintBE value must be an integer");
  for (var h = 1, f = t / 8 + i - 1; f >= i; f--)
    n[f] = r / h & 255, h *= 256;
  return n;
}
x.writeUintBE = Ze;
function Qe(t, r, n, i) {
  if (n === void 0 && (n = new Uint8Array(t / 8)), i === void 0 && (i = 0), t % 8 !== 0)
    throw new Error("writeUintLE supports only bitLengths divisible by 8");
  if (!ye.isSafeInteger(r))
    throw new Error("writeUintLE value must be an integer");
  for (var h = 1, f = i; f < i + t / 8; f++)
    n[f] = r / h & 255, h *= 256;
  return n;
}
x.writeUintLE = Qe;
function ke(t, r) {
  r === void 0 && (r = 0);
  var n = new DataView(t.buffer, t.byteOffset, t.byteLength);
  return n.getFloat32(r);
}
x.readFloat32BE = ke;
function tr(t, r) {
  r === void 0 && (r = 0);
  var n = new DataView(t.buffer, t.byteOffset, t.byteLength);
  return n.getFloat32(r, !0);
}
x.readFloat32LE = tr;
function er(t, r) {
  r === void 0 && (r = 0);
  var n = new DataView(t.buffer, t.byteOffset, t.byteLength);
  return n.getFloat64(r);
}
x.readFloat64BE = er;
function rr(t, r) {
  r === void 0 && (r = 0);
  var n = new DataView(t.buffer, t.byteOffset, t.byteLength);
  return n.getFloat64(r, !0);
}
x.readFloat64LE = rr;
function nr(t, r, n) {
  r === void 0 && (r = new Uint8Array(4)), n === void 0 && (n = 0);
  var i = new DataView(r.buffer, r.byteOffset, r.byteLength);
  return i.setFloat32(n, t), r;
}
x.writeFloat32BE = nr;
function ir(t, r, n) {
  r === void 0 && (r = new Uint8Array(4)), n === void 0 && (n = 0);
  var i = new DataView(r.buffer, r.byteOffset, r.byteLength);
  return i.setFloat32(n, t, !0), r;
}
x.writeFloat32LE = ir;
function ar(t, r, n) {
  r === void 0 && (r = new Uint8Array(8)), n === void 0 && (n = 0);
  var i = new DataView(r.buffer, r.byteOffset, r.byteLength);
  return i.setFloat64(n, t), r;
}
x.writeFloat64BE = ar;
function ur(t, r, n) {
  r === void 0 && (r = new Uint8Array(8)), n === void 0 && (n = 0);
  var i = new DataView(r.buffer, r.byteOffset, r.byteLength);
  return i.setFloat64(n, t, !0), r;
}
x.writeFloat64LE = ur;
var dt = {};
Object.defineProperty(dt, "__esModule", { value: !0 });
function or(t) {
  for (var r = 0; r < t.length; r++)
    t[r] = 0;
  return t;
}
dt.wipe = or;
Object.defineProperty(Bt, "__esModule", { value: !0 });
var Et = x, Jt = dt, fr = 20;
function hr(t, r, n) {
  for (var i = 1634760805, h = 857760878, f = 2036477234, d = 1797285236, u = n[3] << 24 | n[2] << 16 | n[1] << 8 | n[0], o = n[7] << 24 | n[6] << 16 | n[5] << 8 | n[4], s = n[11] << 24 | n[10] << 16 | n[9] << 8 | n[8], _ = n[15] << 24 | n[14] << 16 | n[13] << 8 | n[12], w = n[19] << 24 | n[18] << 16 | n[17] << 8 | n[16], E = n[23] << 24 | n[22] << 16 | n[21] << 8 | n[20], l = n[27] << 24 | n[26] << 16 | n[25] << 8 | n[24], b = n[31] << 24 | n[30] << 16 | n[29] << 8 | n[28], S = r[3] << 24 | r[2] << 16 | r[1] << 8 | r[0], g = r[7] << 24 | r[6] << 16 | r[5] << 8 | r[4], O = r[11] << 24 | r[10] << 16 | r[9] << 8 | r[8], j = r[15] << 24 | r[14] << 16 | r[13] << 8 | r[12], A = i, c = h, v = f, D = d, e = u, a = o, y = s, m = _, U = w, M = E, B = l, L = b, F = S, N = g, p = O, T = j, $ = 0; $ < fr; $ += 2)
    A = A + e | 0, F ^= A, F = F >>> 16 | F << 16, U = U + F | 0, e ^= U, e = e >>> 20 | e << 12, c = c + a | 0, N ^= c, N = N >>> 16 | N << 16, M = M + N | 0, a ^= M, a = a >>> 20 | a << 12, v = v + y | 0, p ^= v, p = p >>> 16 | p << 16, B = B + p | 0, y ^= B, y = y >>> 20 | y << 12, D = D + m | 0, T ^= D, T = T >>> 16 | T << 16, L = L + T | 0, m ^= L, m = m >>> 20 | m << 12, v = v + y | 0, p ^= v, p = p >>> 24 | p << 8, B = B + p | 0, y ^= B, y = y >>> 25 | y << 7, D = D + m | 0, T ^= D, T = T >>> 24 | T << 8, L = L + T | 0, m ^= L, m = m >>> 25 | m << 7, c = c + a | 0, N ^= c, N = N >>> 24 | N << 8, M = M + N | 0, a ^= M, a = a >>> 25 | a << 7, A = A + e | 0, F ^= A, F = F >>> 24 | F << 8, U = U + F | 0, e ^= U, e = e >>> 25 | e << 7, A = A + a | 0, T ^= A, T = T >>> 16 | T << 16, B = B + T | 0, a ^= B, a = a >>> 20 | a << 12, c = c + y | 0, F ^= c, F = F >>> 16 | F << 16, L = L + F | 0, y ^= L, y = y >>> 20 | y << 12, v = v + m | 0, N ^= v, N = N >>> 16 | N << 16, U = U + N | 0, m ^= U, m = m >>> 20 | m << 12, D = D + e | 0, p ^= D, p = p >>> 16 | p << 16, M = M + p | 0, e ^= M, e = e >>> 20 | e << 12, v = v + m | 0, N ^= v, N = N >>> 24 | N << 8, U = U + N | 0, m ^= U, m = m >>> 25 | m << 7, D = D + e | 0, p ^= D, p = p >>> 24 | p << 8, M = M + p | 0, e ^= M, e = e >>> 25 | e << 7, c = c + y | 0, F ^= c, F = F >>> 24 | F << 8, L = L + F | 0, y ^= L, y = y >>> 25 | y << 7, A = A + a | 0, T ^= A, T = T >>> 24 | T << 8, B = B + T | 0, a ^= B, a = a >>> 25 | a << 7;
  Et.writeUint32LE(A + i | 0, t, 0), Et.writeUint32LE(c + h | 0, t, 4), Et.writeUint32LE(v + f | 0, t, 8), Et.writeUint32LE(D + d | 0, t, 12), Et.writeUint32LE(e + u | 0, t, 16), Et.writeUint32LE(a + o | 0, t, 20), Et.writeUint32LE(y + s | 0, t, 24), Et.writeUint32LE(m + _ | 0, t, 28), Et.writeUint32LE(U + w | 0, t, 32), Et.writeUint32LE(M + E | 0, t, 36), Et.writeUint32LE(B + l | 0, t, 40), Et.writeUint32LE(L + b | 0, t, 44), Et.writeUint32LE(F + S | 0, t, 48), Et.writeUint32LE(N + g | 0, t, 52), Et.writeUint32LE(p + O | 0, t, 56), Et.writeUint32LE(T + j | 0, t, 60);
}
function Oe(t, r, n, i, h) {
  if (h === void 0 && (h = 0), t.length !== 32)
    throw new Error("ChaCha: key size must be 32 bytes");
  if (i.length < n.length)
    throw new Error("ChaCha: destination is shorter than source");
  var f, d;
  if (h === 0) {
    if (r.length !== 8 && r.length !== 12)
      throw new Error("ChaCha nonce must be 8 or 12 bytes");
    f = new Uint8Array(16), d = f.length - r.length, f.set(r, d);
  } else {
    if (r.length !== 16)
      throw new Error("ChaCha nonce with counter must be 16 bytes");
    f = r, d = h;
  }
  for (var u = new Uint8Array(64), o = 0; o < n.length; o += 64) {
    hr(u, f, t);
    for (var s = o; s < o + 64 && s < n.length; s++)
      i[s] = n[s] ^ u[s - o];
    cr(f, 0, d);
  }
  return Jt.wipe(u), h === 0 && Jt.wipe(f), i;
}
Bt.streamXOR = Oe;
function sr(t, r, n, i) {
  return i === void 0 && (i = 0), Jt.wipe(n), Oe(t, r, n, n, i);
}
Bt.stream = sr;
function cr(t, r, n) {
  for (var i = 1; n--; )
    i = i + (t[r] & 255) | 0, t[r] = i & 255, i >>>= 8, r++;
  if (i > 0)
    throw new Error("ChaCha: counter overflow");
}
var Ae = {}, bt = {};
Object.defineProperty(bt, "__esModule", { value: !0 });
function lr(t, r, n) {
  return ~(t - 1) & r | t - 1 & n;
}
bt.select = lr;
function Dr(t, r) {
  return (t | 0) - (r | 0) - 1 >>> 31 & 1;
}
bt.lessOrEqual = Dr;
function Ue(t, r) {
  if (t.length !== r.length)
    return 0;
  for (var n = 0, i = 0; i < t.length; i++)
    n |= t[i] ^ r[i];
  return 1 & n - 1 >>> 8;
}
bt.compare = Ue;
function _r(t, r) {
  return t.length === 0 || r.length === 0 ? !1 : Ue(t, r) !== 0;
}
bt.equal = _r;
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 });
  var r = bt, n = dt;
  t.DIGEST_LENGTH = 16;
  var i = (
    /** @class */
    function() {
      function d(u) {
        this.digestLength = t.DIGEST_LENGTH, this._buffer = new Uint8Array(16), this._r = new Uint16Array(10), this._h = new Uint16Array(10), this._pad = new Uint16Array(8), this._leftover = 0, this._fin = 0, this._finished = !1;
        var o = u[0] | u[1] << 8;
        this._r[0] = o & 8191;
        var s = u[2] | u[3] << 8;
        this._r[1] = (o >>> 13 | s << 3) & 8191;
        var _ = u[4] | u[5] << 8;
        this._r[2] = (s >>> 10 | _ << 6) & 7939;
        var w = u[6] | u[7] << 8;
        this._r[3] = (_ >>> 7 | w << 9) & 8191;
        var E = u[8] | u[9] << 8;
        this._r[4] = (w >>> 4 | E << 12) & 255, this._r[5] = E >>> 1 & 8190;
        var l = u[10] | u[11] << 8;
        this._r[6] = (E >>> 14 | l << 2) & 8191;
        var b = u[12] | u[13] << 8;
        this._r[7] = (l >>> 11 | b << 5) & 8065;
        var S = u[14] | u[15] << 8;
        this._r[8] = (b >>> 8 | S << 8) & 8191, this._r[9] = S >>> 5 & 127, this._pad[0] = u[16] | u[17] << 8, this._pad[1] = u[18] | u[19] << 8, this._pad[2] = u[20] | u[21] << 8, this._pad[3] = u[22] | u[23] << 8, this._pad[4] = u[24] | u[25] << 8, this._pad[5] = u[26] | u[27] << 8, this._pad[6] = u[28] | u[29] << 8, this._pad[7] = u[30] | u[31] << 8;
      }
      return d.prototype._blocks = function(u, o, s) {
        for (var _ = this._fin ? 0 : 2048, w = this._h[0], E = this._h[1], l = this._h[2], b = this._h[3], S = this._h[4], g = this._h[5], O = this._h[6], j = this._h[7], A = this._h[8], c = this._h[9], v = this._r[0], D = this._r[1], e = this._r[2], a = this._r[3], y = this._r[4], m = this._r[5], U = this._r[6], M = this._r[7], B = this._r[8], L = this._r[9]; s >= 16; ) {
          var F = u[o + 0] | u[o + 1] << 8;
          w += F & 8191;
          var N = u[o + 2] | u[o + 3] << 8;
          E += (F >>> 13 | N << 3) & 8191;
          var p = u[o + 4] | u[o + 5] << 8;
          l += (N >>> 10 | p << 6) & 8191;
          var T = u[o + 6] | u[o + 7] << 8;
          b += (p >>> 7 | T << 9) & 8191;
          var $ = u[o + 8] | u[o + 9] << 8;
          S += (T >>> 4 | $ << 12) & 8191, g += $ >>> 1 & 8191;
          var Z = u[o + 10] | u[o + 11] << 8;
          O += ($ >>> 14 | Z << 2) & 8191;
          var J = u[o + 12] | u[o + 13] << 8;
          j += (Z >>> 11 | J << 5) & 8191;
          var X = u[o + 14] | u[o + 15] << 8;
          A += (J >>> 8 | X << 8) & 8191, c += X >>> 5 | _;
          var C = 0, R = C;
          R += w * v, R += E * (5 * L), R += l * (5 * B), R += b * (5 * M), R += S * (5 * U), C = R >>> 13, R &= 8191, R += g * (5 * m), R += O * (5 * y), R += j * (5 * a), R += A * (5 * e), R += c * (5 * D), C += R >>> 13, R &= 8191;
          var P = C;
          P += w * D, P += E * v, P += l * (5 * L), P += b * (5 * B), P += S * (5 * M), C = P >>> 13, P &= 8191, P += g * (5 * U), P += O * (5 * m), P += j * (5 * y), P += A * (5 * a), P += c * (5 * e), C += P >>> 13, P &= 8191;
          var I = C;
          I += w * e, I += E * D, I += l * v, I += b * (5 * L), I += S * (5 * B), C = I >>> 13, I &= 8191, I += g * (5 * M), I += O * (5 * U), I += j * (5 * m), I += A * (5 * y), I += c * (5 * a), C += I >>> 13, I &= 8191;
          var H = C;
          H += w * a, H += E * e, H += l * D, H += b * v, H += S * (5 * L), C = H >>> 13, H &= 8191, H += g * (5 * B), H += O * (5 * M), H += j * (5 * U), H += A * (5 * m), H += c * (5 * y), C += H >>> 13, H &= 8191;
          var K = C;
          K += w * y, K += E * a, K += l * e, K += b * D, K += S * v, C = K >>> 13, K &= 8191, K += g * (5 * L), K += O * (5 * B), K += j * (5 * M), K += A * (5 * U), K += c * (5 * m), C += K >>> 13, K &= 8191;
          var z = C;
          z += w * m, z += E * y, z += l * a, z += b * e, z += S * D, C = z >>> 13, z &= 8191, z += g * v, z += O * (5 * L), z += j * (5 * B), z += A * (5 * M), z += c * (5 * U), C += z >>> 13, z &= 8191;
          var Y = C;
          Y += w * U, Y += E * m, Y += l * y, Y += b * a, Y += S * e, C = Y >>> 13, Y &= 8191, Y += g * D, Y += O * v, Y += j * (5 * L), Y += A * (5 * B), Y += c * (5 * M), C += Y >>> 13, Y &= 8191;
          var W = C;
          W += w * M, W += E * U, W += l * m, W += b * y, W += S * a, C = W >>> 13, W &= 8191, W += g * e, W += O * D, W += j * v, W += A * (5 * L), W += c * (5 * B), C += W >>> 13, W &= 8191;
          var G = C;
          G += w * B, G += E * M, G += l * U, G += b * m, G += S * y, C = G >>> 13, G &= 8191, G += g * a, G += O * e, G += j * D, G += A * v, G += c * (5 * L), C += G >>> 13, G &= 8191;
          var V = C;
          V += w * L, V += E * B, V += l * M, V += b * U, V += S * m, C = V >>> 13, V &= 8191, V += g * y, V += O * a, V += j * e, V += A * D, V += c * v, C += V >>> 13, V &= 8191, C = (C << 2) + C | 0, C = C + R | 0, R = C & 8191, C = C >>> 13, P += C, w = R, E = P, l = I, b = H, S = K, g = z, O = Y, j = W, A = G, c = V, o += 16, s -= 16;
        }
        this._h[0] = w, this._h[1] = E, this._h[2] = l, this._h[3] = b, this._h[4] = S, this._h[5] = g, this._h[6] = O, this._h[7] = j, this._h[8] = A, this._h[9] = c;
      }, d.prototype.finish = function(u, o) {
        o === void 0 && (o = 0);
        var s = new Uint16Array(10), _, w, E, l;
        if (this._leftover) {
          for (l = this._leftover, this._buffer[l++] = 1; l < 16; l++)
            this._buffer[l] = 0;
          this._fin = 1, this._blocks(this._buffer, 0, 16);
        }
        for (_ = this._h[1] >>> 13, this._h[1] &= 8191, l = 2; l < 10; l++)
          this._h[l] += _, _ = this._h[l] >>> 13, this._h[l] &= 8191;
        for (this._h[0] += _ * 5, _ = this._h[0] >>> 13, this._h[0] &= 8191, this._h[1] += _, _ = this._h[1] >>> 13, this._h[1] &= 8191, this._h[2] += _, s[0] = this._h[0] + 5, _ = s[0] >>> 13, s[0] &= 8191, l = 1; l < 10; l++)
          s[l] = this._h[l] + _, _ = s[l] >>> 13, s[l] &= 8191;
        for (s[9] -= 8192, w = (_ ^ 1) - 1, l = 0; l < 10; l++)
          s[l] &= w;
        for (w = ~w, l = 0; l < 10; l++)
          this._h[l] = this._h[l] & w | s[l];
        for (this._h[0] = (this._h[0] | this._h[1] << 13) & 65535, this._h[1] = (this._h[1] >>> 3 | this._h[2] << 10) & 65535, this._h[2] = (this._h[2] >>> 6 | this._h[3] << 7) & 65535, this._h[3] = (this._h[3] >>> 9 | this._h[4] << 4) & 65535, this._h[4] = (this._h[4] >>> 12 | this._h[5] << 1 | this._h[6] << 14) & 65535, this._h[5] = (this._h[6] >>> 2 | this._h[7] << 11) & 65535, this._h[6] = (this._h[7] >>> 5 | this._h[8] << 8) & 65535, this._h[7] = (this._h[8] >>> 8 | this._h[9] << 5) & 65535, E = this._h[0] + this._pad[0], this._h[0] = E & 65535, l = 1; l < 8; l++)
          E = (this._h[l] + this._pad[l] | 0) + (E >>> 16) | 0, this._h[l] = E & 65535;
        return u[o + 0] = this._h[0] >>> 0, u[o + 1] = this._h[0] >>> 8, u[o + 2] = this._h[1] >>> 0, u[o + 3] = this._h[1] >>> 8, u[o + 4] = this._h[2] >>> 0, u[o + 5] = this._h[2] >>> 8, u[o + 6] = this._h[3] >>> 0, u[o + 7] = this._h[3] >>> 8, u[o + 8] = this._h[4] >>> 0, u[o + 9] = this._h[4] >>> 8, u[o + 10] = this._h[5] >>> 0, u[o + 11] = this._h[5] >>> 8, u[o + 12] = this._h[6] >>> 0, u[o + 13] = this._h[6] >>> 8, u[o + 14] = this._h[7] >>> 0, u[o + 15] = this._h[7] >>> 8, this._finished = !0, this;
      }, d.prototype.update = function(u) {
        var o = 0, s = u.length, _;
        if (this._leftover) {
          _ = 16 - this._leftover, _ > s && (_ = s);
          for (var w = 0; w < _; w++)
            this._buffer[this._leftover + w] = u[o + w];
          if (s -= _, o += _, this._leftover += _, this._leftover < 16)
            return this;
          this._blocks(this._buffer, 0, 16), this._leftover = 0;
        }
        if (s >= 16 && (_ = s - s % 16, this._blocks(u, o, _), o += _, s -= _), s) {
          for (var w = 0; w < s; w++)
            this._buffer[this._leftover + w] = u[o + w];
          this._leftover += s;
        }
        return this;
      }, d.prototype.digest = function() {
        if (this._finished)
          throw new Error("Poly1305 was finished");
        var u = new Uint8Array(16);
        return this.finish(u), u;
      }, d.prototype.clean = function() {
        return n.wipe(this._buffer), n.wipe(this._r), n.wipe(this._h), n.wipe(this._pad), this._leftover = 0, this._fin = 0, this._finished = !0, this;
      }, d;
    }()
  );
  t.Poly1305 = i;
  function h(d, u) {
    var o = new i(d);
    o.update(u);
    var s = o.digest();
    return o.clean(), s;
  }
  t.oneTimeAuth = h;
  function f(d, u) {
    return d.length !== t.DIGEST_LENGTH || u.length !== t.DIGEST_LENGTH ? !1 : r.equal(d, u);
  }
  t.equal = f;
})(Ae);
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 });
  var r = Bt, n = Ae, i = dt, h = x, f = bt;
  t.KEY_LENGTH = 32, t.NONCE_LENGTH = 12, t.TAG_LENGTH = 16;
  var d = new Uint8Array(16), u = (
    /** @class */
    function() {
      function o(s) {
        if (this.nonceLength = t.NONCE_LENGTH, this.tagLength = t.TAG_LENGTH, s.length !== t.KEY_LENGTH)
          throw new Error("ChaCha20Poly1305 needs 32-byte key");
        this._key = new Uint8Array(s);
      }
      return o.prototype.seal = function(s, _, w, E) {
        if (s.length > 16)
          throw new Error("ChaCha20Poly1305: incorrect nonce length");
        var l = new Uint8Array(16);
        l.set(s, l.length - s.length);
        var b = new Uint8Array(32);
        r.stream(this._key, l, b, 4);
        var S = _.length + this.tagLength, g;
        if (E) {
          if (E.length !== S)
            throw new Error("ChaCha20Poly1305: incorrect destination length");
          g = E;
        } else
          g = new Uint8Array(S);
        return r.streamXOR(this._key, l, _, g, 4), this._authenticate(g.subarray(g.length - this.tagLength, g.length), b, g.subarray(0, g.length - this.tagLength), w), i.wipe(l), g;
      }, o.prototype.open = function(s, _, w, E) {
        if (s.length > 16)
          throw new Error("ChaCha20Poly1305: incorrect nonce length");
        if (_.length < this.tagLength)
          return null;
        var l = new Uint8Array(16);
        l.set(s, l.length - s.length);
        var b = new Uint8Array(32);
        r.stream(this._key, l, b, 4);
        var S = new Uint8Array(this.tagLength);
        if (this._authenticate(S, b, _.subarray(0, _.length - this.tagLength), w), !f.equal(S, _.subarray(_.length - this.tagLength, _.length)))
          return null;
        var g = _.length - this.tagLength, O;
        if (E) {
          if (E.length !== g)
            throw new Error("ChaCha20Poly1305: incorrect destination length");
          O = E;
        } else
          O = new Uint8Array(g);
        return r.streamXOR(this._key, l, _.subarray(0, _.length - this.tagLength), O, 4), i.wipe(l), O;
      }, o.prototype.clean = function() {
        return i.wipe(this._key), this;
      }, o.prototype._authenticate = function(s, _, w, E) {
        var l = new n.Poly1305(_);
        E && (l.update(E), E.length % 16 > 0 && l.update(d.subarray(E.length % 16))), l.update(w), w.length % 16 > 0 && l.update(d.subarray(w.length % 16));
        var b = new Uint8Array(8);
        E && h.writeUint64LE(E.length, b), l.update(b), h.writeUint64LE(w.length, b), l.update(b);
        for (var S = l.digest(), g = 0; g < S.length; g++)
          s[g] = S[g];
        l.clean(), i.wipe(S), i.wipe(b);
      }, o;
    }()
  );
  t.ChaCha20Poly1305 = u;
})(He);
var Te = {}, Ft = {}, ee = {};
Object.defineProperty(ee, "__esModule", { value: !0 });
function Er(t) {
  return typeof t.saveState < "u" && typeof t.restoreState < "u" && typeof t.cleanSavedState < "u";
}
ee.isSerializableHash = Er;
Object.defineProperty(Ft, "__esModule", { value: !0 });
var vt = ee, dr = bt, vr = dt, Fe = (
  /** @class */
  function() {
    function t(r, n) {
      this._finished = !1, this._inner = new r(), this._outer = new r(), this.blockSize = this._outer.blockSize, this.digestLength = this._outer.digestLength;
      var i = new Uint8Array(this.blockSize);
      n.length > this.blockSize ? this._inner.update(n).finish(i).clean() : i.set(n);
      for (var h = 0; h < i.length; h++)
        i[h] ^= 54;
      this._inner.update(i);
      for (var h = 0; h < i.length; h++)
        i[h] ^= 106;
      this._outer.update(i), vt.isSerializableHash(this._inner) && vt.isSerializableHash(this._outer) && (this._innerKeyedState = this._inner.saveState(), this._outerKeyedState = this._outer.saveState()), vr.wipe(i);
    }
    return t.prototype.reset = function() {
      if (!vt.isSerializableHash(this._inner) || !vt.isSerializableHash(this._outer))
        throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");
      return this._inner.restoreState(this._innerKeyedState), this._outer.restoreState(this._outerKeyedState), this._finished = !1, this;
    }, t.prototype.clean = function() {
      vt.isSerializableHash(this._inner) && this._inner.cleanSavedState(this._innerKeyedState), vt.isSerializableHash(this._outer) && this._outer.cleanSavedState(this._outerKeyedState), this._inner.clean(), this._outer.clean();
    }, t.prototype.update = function(r) {
      return this._inner.update(r), this;
    }, t.prototype.finish = function(r) {
      return this._finished ? (this._outer.finish(r), this) : (this._inner.finish(r), this._outer.update(r.subarray(0, this.digestLength)).finish(r), this._finished = !0, this);
    }, t.prototype.digest = function() {
      var r = new Uint8Array(this.digestLength);
      return this.finish(r), r;
    }, t.prototype.saveState = function() {
      if (!vt.isSerializableHash(this._inner))
        throw new Error("hmac: can't saveState() because hash doesn't implement it");
      return this._inner.saveState();
    }, t.prototype.restoreState = function(r) {
      if (!vt.isSerializableHash(this._inner) || !vt.isSerializableHash(this._outer))
        throw new Error("hmac: can't restoreState() because hash doesn't implement it");
      return this._inner.restoreState(r), this._outer.restoreState(this._outerKeyedState), this._finished = !1, this;
    }, t.prototype.cleanSavedState = function(r) {
      if (!vt.isSerializableHash(this._inner))
        throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");
      this._inner.cleanSavedState(r);
    }, t;
  }()
);
Ft.HMAC = Fe;
function br(t, r, n) {
  var i = new Fe(t, r);
  i.update(n);
  var h = i.digest();
  return i.clean(), h;
}
Ft.hmac = br;
Ft.equal = dr.equal;
Object.defineProperty(Te, "__esModule", { value: !0 });
var ae = Ft, ue = dt, wr = (
  /** @class */
  function() {
    function t(r, n, i, h) {
      i === void 0 && (i = new Uint8Array(0)), this._counter = new Uint8Array(1), this._hash = r, this._info = h;
      var f = ae.hmac(this._hash, i, n);
      this._hmac = new ae.HMAC(r, f), this._buffer = new Uint8Array(this._hmac.digestLength), this._bufpos = this._buffer.length;
    }
    return t.prototype._fillBuffer = function() {
      this._counter[0]++;
      var r = this._counter[0];
      if (r === 0)
        throw new Error("hkdf: cannot expand more");
      this._hmac.reset(), r > 1 && this._hmac.update(this._buffer), this._info && this._hmac.update(this._info), this._hmac.update(this._counter), this._hmac.finish(this._buffer), this._bufpos = 0;
    }, t.prototype.expand = function(r) {
      for (var n = new Uint8Array(r), i = 0; i < n.length; i++)
        this._bufpos === this._buffer.length && this._fillBuffer(), n[i] = this._buffer[this._bufpos++];
      return n;
    }, t.prototype.clean = function() {
      this._hmac.clean(), ue.wipe(this._buffer), ue.wipe(this._counter), this._bufpos = 0;
    }, t;
  }()
), fi = Te.HKDF = wr, re = {}, Rt = {}, jt = {};
Object.defineProperty(jt, "__esModule", { value: !0 });
jt.BrowserRandomSource = void 0;
const oe = 65536;
class gr {
  constructor() {
    this.isAvailable = !1, this.isInstantiated = !1;
    const r = typeof self < "u" ? self.crypto || self.msCrypto : null;
    r && r.getRandomValues !== void 0 && (this._crypto = r, this.isAvailable = !0, this.isInstantiated = !0);
  }
  randomBytes(r) {
    if (!this.isAvailable || !this._crypto)
      throw new Error("Browser random byte generator is not available.");
    const n = new Uint8Array(r);
    for (let i = 0; i < n.length; i += oe)
      this._crypto.getRandomValues(n.subarray(i, i + Math.min(n.length - i, oe)));
    return n;
  }
}
jt.BrowserRandomSource = gr;
var Pt = {};
Object.defineProperty(Pt, "__esModule", { value: !0 });
Pt.NodeRandomSource = void 0;
const yr = dt;
class pr {
  constructor() {
    if (this.isAvailable = !1, this.isInstantiated = !1, typeof Re < "u") {
      const r = je();
      r && r.randomBytes && (this._crypto = r, this.isAvailable = !0, this.isInstantiated = !0);
    }
  }
  randomBytes(r) {
    if (!this.isAvailable || !this._crypto)
      throw new Error("Node.js random byte generator is not available.");
    let n = this._crypto.randomBytes(r);
    if (n.length !== r)
      throw new Error("NodeRandomSource: got fewer bytes than requested");
    const i = new Uint8Array(r);
    for (let h = 0; h < i.length; h++)
      i[h] = n[h];
    return (0, yr.wipe)(n), i;
  }
}
Pt.NodeRandomSource = pr;
Object.defineProperty(Rt, "__esModule", { value: !0 });
Rt.SystemRandomSource = void 0;
const Sr = jt, mr = Pt;
class Cr {
  constructor() {
    if (this.isAvailable = !1, this.name = "", this._source = new Sr.BrowserRandomSource(), this._source.isAvailable) {
      this.isAvailable = !0, this.name = "Browser";
      return;
    }
    if (this._source = new mr.NodeRandomSource(), this._source.isAvailable) {
      this.isAvailable = !0, this.name = "Node";
      return;
    }
  }
  randomBytes(r) {
    if (!this.isAvailable)
      throw new Error("System random byte generator is not available.");
    return this._source.randomBytes(r);
  }
}
Rt.SystemRandomSource = Cr;
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 }), t.randomStringForEntropy = t.randomString = t.randomUint32 = t.randomBytes = t.defaultRandomSource = void 0;
  const r = Rt, n = x, i = dt;
  t.defaultRandomSource = new r.SystemRandomSource();
  function h(s, _ = t.defaultRandomSource) {
    return _.randomBytes(s);
  }
  t.randomBytes = h;
  function f(s = t.defaultRandomSource) {
    const _ = h(4, s), w = (0, n.readUint32LE)(_);
    return (0, i.wipe)(_), w;
  }
  t.randomUint32 = f;
  const d = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  function u(s, _ = d, w = t.defaultRandomSource) {
    if (_.length < 2)
      throw new Error("randomString charset is too short");
    if (_.length > 256)
      throw new Error("randomString charset is too long");
    let E = "";
    const l = _.length, b = 256 - 256 % l;
    for (; s > 0; ) {
      const S = h(Math.ceil(s * 256 / b), w);
      for (let g = 0; g < S.length && s > 0; g++) {
        const O = S[g];
        O < b && (E += _.charAt(O % l), s--);
      }
      (0, i.wipe)(S);
    }
    return E;
  }
  t.randomString = u;
  function o(s, _ = d, w = t.defaultRandomSource) {
    const E = Math.ceil(s / (Math.log(_.length) / Math.LN2));
    return u(E, _, w);
  }
  t.randomStringForEntropy = o;
})(re);
const hi = /* @__PURE__ */ Pe(re);
var Or = {};
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 });
  var r = x, n = dt;
  t.DIGEST_LENGTH = 32, t.BLOCK_SIZE = 64;
  var i = (
    /** @class */
    function() {
      function u() {
        this.digestLength = t.DIGEST_LENGTH, this.blockSize = t.BLOCK_SIZE, this._state = new Int32Array(8), this._temp = new Int32Array(64), this._buffer = new Uint8Array(128), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this.reset();
      }
      return u.prototype._initState = function() {
        this._state[0] = 1779033703, this._state[1] = 3144134277, this._state[2] = 1013904242, this._state[3] = 2773480762, this._state[4] = 1359893119, this._state[5] = 2600822924, this._state[6] = 528734635, this._state[7] = 1541459225;
      }, u.prototype.reset = function() {
        return this._initState(), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this;
      }, u.prototype.clean = function() {
        n.wipe(this._buffer), n.wipe(this._temp), this.reset();
      }, u.prototype.update = function(o, s) {
        if (s === void 0 && (s = o.length), this._finished)
          throw new Error("SHA256: can't update because hash was finished.");
        var _ = 0;
        if (this._bytesHashed += s, this._bufferLength > 0) {
          for (; this._bufferLength < this.blockSize && s > 0; )
            this._buffer[this._bufferLength++] = o[_++], s--;
          this._bufferLength === this.blockSize && (f(this._temp, this._state, this._buffer, 0, this.blockSize), this._bufferLength = 0);
        }
        for (s >= this.blockSize && (_ = f(this._temp, this._state, o, _, s), s %= this.blockSize); s > 0; )
          this._buffer[this._bufferLength++] = o[_++], s--;
        return this;
      }, u.prototype.finish = function(o) {
        if (!this._finished) {
          var s = this._bytesHashed, _ = this._bufferLength, w = s / 536870912 | 0, E = s << 3, l = s % 64 < 56 ? 64 : 128;
          this._buffer[_] = 128;
          for (var b = _ + 1; b < l - 8; b++)
            this._buffer[b] = 0;
          r.writeUint32BE(w, this._buffer, l - 8), r.writeUint32BE(E, this._buffer, l - 4), f(this._temp, this._state, this._buffer, 0, l), this._finished = !0;
        }
        for (var b = 0; b < this.digestLength / 4; b++)
          r.writeUint32BE(this._state[b], o, b * 4);
        return this;
      }, u.prototype.digest = function() {
        var o = new Uint8Array(this.digestLength);
        return this.finish(o), o;
      }, u.prototype.saveState = function() {
        if (this._finished)
          throw new Error("SHA256: cannot save finished state");
        return {
          state: new Int32Array(this._state),
          buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : void 0,
          bufferLength: this._bufferLength,
          bytesHashed: this._bytesHashed
        };
      }, u.prototype.restoreState = function(o) {
        return this._state.set(o.state), this._bufferLength = o.bufferLength, o.buffer && this._buffer.set(o.buffer), this._bytesHashed = o.bytesHashed, this._finished = !1, this;
      }, u.prototype.cleanSavedState = function(o) {
        n.wipe(o.state), o.buffer && n.wipe(o.buffer), o.bufferLength = 0, o.bytesHashed = 0;
      }, u;
    }()
  );
  t.SHA256 = i;
  var h = new Int32Array([
    1116352408,
    1899447441,
    3049323471,
    3921009573,
    961987163,
    1508970993,
    2453635748,
    2870763221,
    3624381080,
    310598401,
    607225278,
    1426881987,
    1925078388,
    2162078206,
    2614888103,
    3248222580,
    3835390401,
    4022224774,
    264347078,
    604807628,
    770255983,
    1249150122,
    1555081692,
    1996064986,
    2554220882,
    2821834349,
    2952996808,
    3210313671,
    3336571891,
    3584528711,
    113926993,
    338241895,
    666307205,
    773529912,
    1294757372,
    1396182291,
    1695183700,
    1986661051,
    2177026350,
    2456956037,
    2730485921,
    2820302411,
    3259730800,
    3345764771,
    3516065817,
    3600352804,
    4094571909,
    275423344,
    430227734,
    506948616,
    659060556,
    883997877,
    958139571,
    1322822218,
    1537002063,
    1747873779,
    1955562222,
    2024104815,
    2227730452,
    2361852424,
    2428436474,
    2756734187,
    3204031479,
    3329325298
  ]);
  function f(u, o, s, _, w) {
    for (; w >= 64; ) {
      for (var E = o[0], l = o[1], b = o[2], S = o[3], g = o[4], O = o[5], j = o[6], A = o[7], c = 0; c < 16; c++) {
        var v = _ + c * 4;
        u[c] = r.readUint32BE(s, v);
      }
      for (var c = 16; c < 64; c++) {
        var D = u[c - 2], e = (D >>> 17 | D << 15) ^ (D >>> 19 | D << 13) ^ D >>> 10;
        D = u[c - 15];
        var a = (D >>> 7 | D << 25) ^ (D >>> 18 | D << 14) ^ D >>> 3;
        u[c] = (e + u[c - 7] | 0) + (a + u[c - 16] | 0);
      }
      for (var c = 0; c < 64; c++) {
        var e = (((g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7)) + (g & O ^ ~g & j) | 0) + (A + (h[c] + u[c] | 0) | 0) | 0, a = ((E >>> 2 | E << 30) ^ (E >>> 13 | E << 19) ^ (E >>> 22 | E << 10)) + (E & l ^ E & b ^ l & b) | 0;
        A = j, j = O, O = g, g = S + e | 0, S = b, b = l, l = E, E = e + a | 0;
      }
      o[0] += E, o[1] += l, o[2] += b, o[3] += S, o[4] += g, o[5] += O, o[6] += j, o[7] += A, _ += 64, w -= 64;
    }
    return _;
  }
  function d(u) {
    var o = new i();
    o.update(u);
    var s = o.digest();
    return o.clean(), s;
  }
  t.hash = d;
})(Or);
var Ar = {};
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 }), t.sharedKey = t.generateKeyPair = t.generateKeyPairFromSeed = t.scalarMultBase = t.scalarMult = t.SHARED_KEY_LENGTH = t.SECRET_KEY_LENGTH = t.PUBLIC_KEY_LENGTH = void 0;
  const r = re, n = dt;
  t.PUBLIC_KEY_LENGTH = 32, t.SECRET_KEY_LENGTH = 32, t.SHARED_KEY_LENGTH = 32;
  function i(c) {
    const v = new Float64Array(16);
    if (c)
      for (let D = 0; D < c.length; D++)
        v[D] = c[D];
    return v;
  }
  const h = new Uint8Array(32);
  h[0] = 9;
  const f = i([56129, 1]);
  function d(c) {
    let v = 1;
    for (let D = 0; D < 16; D++) {
      let e = c[D] + v + 65535;
      v = Math.floor(e / 65536), c[D] = e - v * 65536;
    }
    c[0] += v - 1 + 37 * (v - 1);
  }
  function u(c, v, D) {
    const e = ~(D - 1);
    for (let a = 0; a < 16; a++) {
      const y = e & (c[a] ^ v[a]);
      c[a] ^= y, v[a] ^= y;
    }
  }
  function o(c, v) {
    const D = i(), e = i();
    for (let a = 0; a < 16; a++)
      e[a] = v[a];
    d(e), d(e), d(e);
    for (let a = 0; a < 2; a++) {
      D[0] = e[0] - 65517;
      for (let m = 1; m < 15; m++)
        D[m] = e[m] - 65535 - (D[m - 1] >> 16 & 1), D[m - 1] &= 65535;
      D[15] = e[15] - 32767 - (D[14] >> 16 & 1);
      const y = D[15] >> 16 & 1;
      D[14] &= 65535, u(e, D, 1 - y);
    }
    for (let a = 0; a < 16; a++)
      c[2 * a] = e[a] & 255, c[2 * a + 1] = e[a] >> 8;
  }
  function s(c, v) {
    for (let D = 0; D < 16; D++)
      c[D] = v[2 * D] + (v[2 * D + 1] << 8);
    c[15] &= 32767;
  }
  function _(c, v, D) {
    for (let e = 0; e < 16; e++)
      c[e] = v[e] + D[e];
  }
  function w(c, v, D) {
    for (let e = 0; e < 16; e++)
      c[e] = v[e] - D[e];
  }
  function E(c, v, D) {
    let e, a, y = 0, m = 0, U = 0, M = 0, B = 0, L = 0, F = 0, N = 0, p = 0, T = 0, $ = 0, Z = 0, J = 0, X = 0, C = 0, R = 0, P = 0, I = 0, H = 0, K = 0, z = 0, Y = 0, W = 0, G = 0, V = 0, wt = 0, St = 0, Ot = 0, Mt = 0, Kt = 0, ie = 0, k = D[0], tt = D[1], et = D[2], rt = D[3], nt = D[4], it = D[5], at = D[6], ut = D[7], ot = D[8], ft = D[9], ht = D[10], st = D[11], ct = D[12], lt = D[13], Dt = D[14], _t = D[15];
    e = v[0], y += e * k, m += e * tt, U += e * et, M += e * rt, B += e * nt, L += e * it, F += e * at, N += e * ut, p += e * ot, T += e * ft, $ += e * ht, Z += e * st, J += e * ct, X += e * lt, C += e * Dt, R += e * _t, e = v[1], m += e * k, U += e * tt, M += e * et, B += e * rt, L += e * nt, F += e * it, N += e * at, p += e * ut, T += e * ot, $ += e * ft, Z += e * ht, J += e * st, X += e * ct, C += e * lt, R += e * Dt, P += e * _t, e = v[2], U += e * k, M += e * tt, B += e * et, L += e * rt, F += e * nt, N += e * it, p += e * at, T += e * ut, $ += e * ot, Z += e * ft, J += e * ht, X += e * st, C += e * ct, R += e * lt, P += e * Dt, I += e * _t, e = v[3], M += e * k, B += e * tt, L += e * et, F += e * rt, N += e * nt, p += e * it, T += e * at, $ += e * ut, Z += e * ot, J += e * ft, X += e * ht, C += e * st, R += e * ct, P += e * lt, I += e * Dt, H += e * _t, e = v[4], B += e * k, L += e * tt, F += e * et, N += e * rt, p += e * nt, T += e * it, $ += e * at, Z += e * ut, J += e * ot, X += e * ft, C += e * ht, R += e * st, P += e * ct, I += e * lt, H += e * Dt, K += e * _t, e = v[5], L += e * k, F += e * tt, N += e * et, p += e * rt, T += e * nt, $ += e * it, Z += e * at, J += e * ut, X += e * ot, C += e * ft, R += e * ht, P += e * st, I += e * ct, H += e * lt, K += e * Dt, z += e * _t, e = v[6], F += e * k, N += e * tt, p += e * et, T += e * rt, $ += e * nt, Z += e * it, J += e * at, X += e * ut, C += e * ot, R += e * ft, P += e * ht, I += e * st, H += e * ct, K += e * lt, z += e * Dt, Y += e * _t, e = v[7], N += e * k, p += e * tt, T += e * et, $ += e * rt, Z += e * nt, J += e * it, X += e * at, C += e * ut, R += e * ot, P += e * ft, I += e * ht, H += e * st, K += e * ct, z += e * lt, Y += e * Dt, W += e * _t, e = v[8], p += e * k, T += e * tt, $ += e * et, Z += e * rt, J += e * nt, X += e * it, C += e * at, R += e * ut, P += e * ot, I += e * ft, H += e * ht, K += e * st, z += e * ct, Y += e * lt, W += e * Dt, G += e * _t, e = v[9], T += e * k, $ += e * tt, Z += e * et, J += e * rt, X += e * nt, C += e * it, R += e * at, P += e * ut, I += e * ot, H += e * ft, K += e * ht, z += e * st, Y += e * ct, W += e * lt, G += e * Dt, V += e * _t, e = v[10], $ += e * k, Z += e * tt, J += e * et, X += e * rt, C += e * nt, R += e * it, P += e * at, I += e * ut, H += e * ot, K += e * ft, z += e * ht, Y += e * st, W += e * ct, G += e * lt, V += e * Dt, wt += e * _t, e = v[11], Z += e * k, J += e * tt, X += e * et, C += e * rt, R += e * nt, P += e * it, I += e * at, H += e * ut, K += e * ot, z += e * ft, Y += e * ht, W += e * st, G += e * ct, V += e * lt, wt += e * Dt, St += e * _t, e = v[12], J += e * k, X += e * tt, C += e * et, R += e * rt, P += e * nt, I += e * it, H += e * at, K += e * ut, z += e * ot, Y += e * ft, W += e * ht, G += e * st, V += e * ct, wt += e * lt, St += e * Dt, Ot += e * _t, e = v[13], X += e * k, C += e * tt, R += e * et, P += e * rt, I += e * nt, H += e * it, K += e * at, z += e * ut, Y += e * ot, W += e * ft, G += e * ht, V += e * st, wt += e * ct, St += e * lt, Ot += e * Dt, Mt += e * _t, e = v[14], C += e * k, R += e * tt, P += e * et, I += e * rt, H += e * nt, K += e * it, z += e * at, Y += e * ut, W += e * ot, G += e * ft, V += e * ht, wt += e * st, St += e * ct, Ot += e * lt, Mt += e * Dt, Kt += e * _t, e = v[15], R += e * k, P += e * tt, I += e * et, H += e * rt, K += e * nt, z += e * it, Y += e * at, W += e * ut, G += e * ot, V += e * ft, wt += e * ht, St += e * st, Ot += e * ct, Mt += e * lt, Kt += e * Dt, ie += e * _t, y += 38 * P, m += 38 * I, U += 38 * H, M += 38 * K, B += 38 * z, L += 38 * Y, F += 38 * W, N += 38 * G, p += 38 * V, T += 38 * wt, $ += 38 * St, Z += 38 * Ot, J += 38 * Mt, X += 38 * Kt, C += 38 * ie, a = 1, e = y + a + 65535, a = Math.floor(e / 65536), y = e - a * 65536, e = m + a + 65535, a = Math.floor(e / 65536), m = e - a * 65536, e = U + a + 65535, a = Math.floor(e / 65536), U = e - a * 65536, e = M + a + 65535, a = Math.floor(e / 65536), M = e - a * 65536, e = B + a + 65535, a = Math.floor(e / 65536), B = e - a * 65536, e = L + a + 65535, a = Math.floor(e / 65536), L = e - a * 65536, e = F + a + 65535, a = Math.floor(e / 65536), F = e - a * 65536, e = N + a + 65535, a = Math.floor(e / 65536), N = e - a * 65536, e = p + a + 65535, a = Math.floor(e / 65536), p = e - a * 65536, e = T + a + 65535, a = Math.floor(e / 65536), T = e - a * 65536, e = $ + a + 65535, a = Math.floor(e / 65536), $ = e - a * 65536, e = Z + a + 65535, a = Math.floor(e / 65536), Z = e - a * 65536, e = J + a + 65535, a = Math.floor(e / 65536), J = e - a * 65536, e = X + a + 65535, a = Math.floor(e / 65536), X = e - a * 65536, e = C + a + 65535, a = Math.floor(e / 65536), C = e - a * 65536, e = R + a + 65535, a = Math.floor(e / 65536), R = e - a * 65536, y += a - 1 + 37 * (a - 1), a = 1, e = y + a + 65535, a = Math.floor(e / 65536), y = e - a * 65536, e = m + a + 65535, a = Math.floor(e / 65536), m = e - a * 65536, e = U + a + 65535, a = Math.floor(e / 65536), U = e - a * 65536, e = M + a + 65535, a = Math.floor(e / 65536), M = e - a * 65536, e = B + a + 65535, a = Math.floor(e / 65536), B = e - a * 65536, e = L + a + 65535, a = Math.floor(e / 65536), L = e - a * 65536, e = F + a + 65535, a = Math.floor(e / 65536), F = e - a * 65536, e = N + a + 65535, a = Math.floor(e / 65536), N = e - a * 65536, e = p + a + 65535, a = Math.floor(e / 65536), p = e - a * 65536, e = T + a + 65535, a = Math.floor(e / 65536), T = e - a * 65536, e = $ + a + 65535, a = Math.floor(e / 65536), $ = e - a * 65536, e = Z + a + 65535, a = Math.floor(e / 65536), Z = e - a * 65536, e = J + a + 65535, a = Math.floor(e / 65536), J = e - a * 65536, e = X + a + 65535, a = Math.floor(e / 65536), X = e - a * 65536, e = C + a + 65535, a = Math.floor(e / 65536), C = e - a * 65536, e = R + a + 65535, a = Math.floor(e / 65536), R = e - a * 65536, y += a - 1 + 37 * (a - 1), c[0] = y, c[1] = m, c[2] = U, c[3] = M, c[4] = B, c[5] = L, c[6] = F, c[7] = N, c[8] = p, c[9] = T, c[10] = $, c[11] = Z, c[12] = J, c[13] = X, c[14] = C, c[15] = R;
  }
  function l(c, v) {
    E(c, v, v);
  }
  function b(c, v) {
    const D = i();
    for (let e = 0; e < 16; e++)
      D[e] = v[e];
    for (let e = 253; e >= 0; e--)
      l(D, D), e !== 2 && e !== 4 && E(D, D, v);
    for (let e = 0; e < 16; e++)
      c[e] = D[e];
  }
  function S(c, v) {
    const D = new Uint8Array(32), e = new Float64Array(80), a = i(), y = i(), m = i(), U = i(), M = i(), B = i();
    for (let p = 0; p < 31; p++)
      D[p] = c[p];
    D[31] = c[31] & 127 | 64, D[0] &= 248, s(e, v);
    for (let p = 0; p < 16; p++)
      y[p] = e[p];
    a[0] = U[0] = 1;
    for (let p = 254; p >= 0; --p) {
      const T = D[p >>> 3] >>> (p & 7) & 1;
      u(a, y, T), u(m, U, T), _(M, a, m), w(a, a, m), _(m, y, U), w(y, y, U), l(U, M), l(B, a), E(a, m, a), E(m, y, M), _(M, a, m), w(a, a, m), l(y, a), w(m, U, B), E(a, m, f), _(a, a, U), E(m, m, a), E(a, U, B), E(U, y, e), l(y, M), u(a, y, T), u(m, U, T);
    }
    for (let p = 0; p < 16; p++)
      e[p + 16] = a[p], e[p + 32] = m[p], e[p + 48] = y[p], e[p + 64] = U[p];
    const L = e.subarray(32), F = e.subarray(16);
    b(L, L), E(F, F, L);
    const N = new Uint8Array(32);
    return o(N, F), N;
  }
  t.scalarMult = S;
  function g(c) {
    return S(c, h);
  }
  t.scalarMultBase = g;
  function O(c) {
    if (c.length !== t.SECRET_KEY_LENGTH)
      throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);
    const v = new Uint8Array(c);
    return {
      publicKey: g(v),
      secretKey: v
    };
  }
  t.generateKeyPairFromSeed = O;
  function j(c) {
    const v = (0, r.randomBytes)(32, c), D = O(v);
    return (0, n.wipe)(v), D;
  }
  t.generateKeyPair = j;
  function A(c, v, D = !1) {
    if (c.length !== t.PUBLIC_KEY_LENGTH)
      throw new Error("X25519: incorrect secret key length");
    if (v.length !== t.PUBLIC_KEY_LENGTH)
      throw new Error("X25519: incorrect public key length");
    const e = S(c, v);
    if (D) {
      let a = 0;
      for (let y = 0; y < e.length; y++)
        a |= e[y];
      if (a === 0)
        throw new Error("X25519: invalid shared key");
    }
    return e;
  }
  t.sharedKey = A;
})(Ar);
function Ur(t, r) {
  if (t.length >= 255)
    throw new TypeError("Alphabet too long");
  for (var n = new Uint8Array(256), i = 0; i < n.length; i++)
    n[i] = 255;
  for (var h = 0; h < t.length; h++) {
    var f = t.charAt(h), d = f.charCodeAt(0);
    if (n[d] !== 255)
      throw new TypeError(f + " is ambiguous");
    n[d] = h;
  }
  var u = t.length, o = t.charAt(0), s = Math.log(u) / Math.log(256), _ = Math.log(256) / Math.log(u);
  function w(b) {
    if (b instanceof Uint8Array || (ArrayBuffer.isView(b) ? b = new Uint8Array(b.buffer, b.byteOffset, b.byteLength) : Array.isArray(b) && (b = Uint8Array.from(b))), !(b instanceof Uint8Array))
      throw new TypeError("Expected Uint8Array");
    if (b.length === 0)
      return "";
    for (var S = 0, g = 0, O = 0, j = b.length; O !== j && b[O] === 0; )
      O++, S++;
    for (var A = (j - O) * _ + 1 >>> 0, c = new Uint8Array(A); O !== j; ) {
      for (var v = b[O], D = 0, e = A - 1; (v !== 0 || D < g) && e !== -1; e--, D++)
        v += 256 * c[e] >>> 0, c[e] = v % u >>> 0, v = v / u >>> 0;
      if (v !== 0)
        throw new Error("Non-zero carry");
      g = D, O++;
    }
    for (var a = A - g; a !== A && c[a] === 0; )
      a++;
    for (var y = o.repeat(S); a < A; ++a)
      y += t.charAt(c[a]);
    return y;
  }
  function E(b) {
    if (typeof b != "string")
      throw new TypeError("Expected String");
    if (b.length === 0)
      return new Uint8Array();
    var S = 0;
    if (b[S] !== " ") {
      for (var g = 0, O = 0; b[S] === o; )
        g++, S++;
      for (var j = (b.length - S) * s + 1 >>> 0, A = new Uint8Array(j); b[S]; ) {
        var c = n[b.charCodeAt(S)];
        if (c === 255)
          return;
        for (var v = 0, D = j - 1; (c !== 0 || v < O) && D !== -1; D--, v++)
          c += u * A[D] >>> 0, A[D] = c % 256 >>> 0, c = c / 256 >>> 0;
        if (c !== 0)
          throw new Error("Non-zero carry");
        O = v, S++;
      }
      if (b[S] !== " ") {
        for (var e = j - O; e !== j && A[e] === 0; )
          e++;
        for (var a = new Uint8Array(g + (j - e)), y = g; e !== j; )
          a[y++] = A[e++];
        return a;
      }
    }
  }
  function l(b) {
    var S = E(b);
    if (S)
      return S;
    throw new Error(`Non-${r} character`);
  }
  return {
    encode: w,
    decodeUnsafe: E,
    decode: l
  };
}
var Tr = Ur, Fr = Tr;
const Nr = (t) => {
  if (t instanceof Uint8Array && t.constructor.name === "Uint8Array")
    return t;
  if (t instanceof ArrayBuffer)
    return new Uint8Array(t);
  if (ArrayBuffer.isView(t))
    return new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
  throw new Error("Unknown type, must be binary type");
}, Mr = (t) => new TextEncoder().encode(t), Lr = (t) => new TextDecoder().decode(t);
class xr {
  constructor(r, n, i) {
    this.name = r, this.prefix = n, this.baseEncode = i;
  }
  encode(r) {
    if (r instanceof Uint8Array)
      return `${this.prefix}${this.baseEncode(r)}`;
    throw Error("Unknown type, must be binary type");
  }
}
class Br {
  constructor(r, n, i) {
    if (this.name = r, this.prefix = n, n.codePointAt(0) === void 0)
      throw new Error("Invalid prefix character");
    this.prefixCodePoint = n.codePointAt(0), this.baseDecode = i;
  }
  decode(r) {
    if (typeof r == "string") {
      if (r.codePointAt(0) !== this.prefixCodePoint)
        throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
      return this.baseDecode(r.slice(this.prefix.length));
    } else
      throw Error("Can only multibase decode strings");
  }
  or(r) {
    return Ne(this, r);
  }
}
class Rr {
  constructor(r) {
    this.decoders = r;
  }
  or(r) {
    return Ne(this, r);
  }
  decode(r) {
    const n = r[0], i = this.decoders[n];
    if (i)
      return i.decode(r);
    throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`);
  }
}
const Ne = (t, r) => new Rr({
  ...t.decoders || { [t.prefix]: t },
  ...r.decoders || { [r.prefix]: r }
});
class jr {
  constructor(r, n, i, h) {
    this.name = r, this.prefix = n, this.baseEncode = i, this.baseDecode = h, this.encoder = new xr(r, n, i), this.decoder = new Br(r, n, h);
  }
  encode(r) {
    return this.encoder.encode(r);
  }
  decode(r) {
    return this.decoder.decode(r);
  }
}
const It = ({ name: t, prefix: r, encode: n, decode: i }) => new jr(t, r, n, i), Nt = ({ prefix: t, name: r, alphabet: n }) => {
  const { encode: i, decode: h } = Fr(n, r);
  return It({
    prefix: t,
    name: r,
    encode: i,
    decode: (f) => Nr(h(f))
  });
}, Pr = (t, r, n, i) => {
  const h = {};
  for (let _ = 0; _ < r.length; ++_)
    h[r[_]] = _;
  let f = t.length;
  for (; t[f - 1] === "="; )
    --f;
  const d = new Uint8Array(f * n / 8 | 0);
  let u = 0, o = 0, s = 0;
  for (let _ = 0; _ < f; ++_) {
    const w = h[t[_]];
    if (w === void 0)
      throw new SyntaxError(`Non-${i} character`);
    o = o << n | w, u += n, u >= 8 && (u -= 8, d[s++] = 255 & o >> u);
  }
  if (u >= n || 255 & o << 8 - u)
    throw new SyntaxError("Unexpected end of data");
  return d;
}, Ir = (t, r, n) => {
  const i = r[r.length - 1] === "=", h = (1 << n) - 1;
  let f = "", d = 0, u = 0;
  for (let o = 0; o < t.length; ++o)
    for (u = u << 8 | t[o], d += 8; d > n; )
      d -= n, f += r[h & u >> d];
  if (d && (f += r[h & u << n - d]), i)
    for (; f.length * n & 7; )
      f += "=";
  return f;
}, Q = ({ name: t, prefix: r, bitsPerChar: n, alphabet: i }) => It({
  prefix: r,
  name: t,
  encode(h) {
    return Ir(h, i, n);
  },
  decode(h) {
    return Pr(h, i, n, t);
  }
}), Hr = It({
  prefix: "\0",
  name: "identity",
  encode: (t) => Lr(t),
  decode: (t) => Mr(t)
}), si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  identity: Hr
}, Symbol.toStringTag, { value: "Module" })), Kr = Q({
  prefix: "0",
  name: "base2",
  alphabet: "01",
  bitsPerChar: 1
}), ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base2: Kr
}, Symbol.toStringTag, { value: "Module" })), zr = Q({
  prefix: "7",
  name: "base8",
  alphabet: "01234567",
  bitsPerChar: 3
}), li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base8: zr
}, Symbol.toStringTag, { value: "Module" })), Yr = Nt({
  prefix: "9",
  name: "base10",
  alphabet: "0123456789"
}), Di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base10: Yr
}, Symbol.toStringTag, { value: "Module" })), Wr = Q({
  prefix: "f",
  name: "base16",
  alphabet: "0123456789abcdef",
  bitsPerChar: 4
}), qr = Q({
  prefix: "F",
  name: "base16upper",
  alphabet: "0123456789ABCDEF",
  bitsPerChar: 4
}), _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base16: Wr,
  base16upper: qr
}, Symbol.toStringTag, { value: "Module" })), Gr = Q({
  prefix: "b",
  name: "base32",
  alphabet: "abcdefghijklmnopqrstuvwxyz234567",
  bitsPerChar: 5
}), $r = Q({
  prefix: "B",
  name: "base32upper",
  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
  bitsPerChar: 5
}), Vr = Q({
  prefix: "c",
  name: "base32pad",
  alphabet: "abcdefghijklmnopqrstuvwxyz234567=",
  bitsPerChar: 5
}), Xr = Q({
  prefix: "C",
  name: "base32padupper",
  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
  bitsPerChar: 5
}), Jr = Q({
  prefix: "v",
  name: "base32hex",
  alphabet: "0123456789abcdefghijklmnopqrstuv",
  bitsPerChar: 5
}), Zr = Q({
  prefix: "V",
  name: "base32hexupper",
  alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV",
  bitsPerChar: 5
}), Qr = Q({
  prefix: "t",
  name: "base32hexpad",
  alphabet: "0123456789abcdefghijklmnopqrstuv=",
  bitsPerChar: 5
}), kr = Q({
  prefix: "T",
  name: "base32hexpadupper",
  alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=",
  bitsPerChar: 5
}), tn = Q({
  prefix: "h",
  name: "base32z",
  alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769",
  bitsPerChar: 5
}), Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base32: Gr,
  base32hex: Jr,
  base32hexpad: Qr,
  base32hexpadupper: kr,
  base32hexupper: Zr,
  base32pad: Vr,
  base32padupper: Xr,
  base32upper: $r,
  base32z: tn
}, Symbol.toStringTag, { value: "Module" })), en = Nt({
  prefix: "k",
  name: "base36",
  alphabet: "0123456789abcdefghijklmnopqrstuvwxyz"
}), rn = Nt({
  prefix: "K",
  name: "base36upper",
  alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}), di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base36: en,
  base36upper: rn
}, Symbol.toStringTag, { value: "Module" })), nn = Nt({
  name: "base58btc",
  prefix: "z",
  alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
}), an = Nt({
  name: "base58flickr",
  prefix: "Z",
  alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
}), vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base58btc: nn,
  base58flickr: an
}, Symbol.toStringTag, { value: "Module" })), un = Q({
  prefix: "m",
  name: "base64",
  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  bitsPerChar: 6
}), on = Q({
  prefix: "M",
  name: "base64pad",
  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  bitsPerChar: 6
}), fn = Q({
  prefix: "u",
  name: "base64url",
  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
  bitsPerChar: 6
}), hn = Q({
  prefix: "U",
  name: "base64urlpad",
  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
  bitsPerChar: 6
}), bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base64: un,
  base64pad: on,
  base64url: fn,
  base64urlpad: hn
}, Symbol.toStringTag, { value: "Module" })), Me = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"), sn = Me.reduce((t, r, n) => (t[n] = r, t), []), cn = Me.reduce((t, r, n) => (t[r.codePointAt(0)] = n, t), []);
function ln(t) {
  return t.reduce((r, n) => (r += sn[n], r), "");
}
function Dn(t) {
  const r = [];
  for (const n of t) {
    const i = cn[n.codePointAt(0)];
    if (i === void 0)
      throw new Error(`Non-base256emoji character: ${n}`);
    r.push(i);
  }
  return new Uint8Array(r);
}
const _n = It({
  prefix: "🚀",
  name: "base256emoji",
  encode: ln,
  decode: Dn
}), wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  base256emoji: _n
}, Symbol.toStringTag, { value: "Module" }));
new TextEncoder();
new TextDecoder();
var En = {};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Zt = function(t, r) {
  return Zt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
    n.__proto__ = i;
  } || function(n, i) {
    for (var h in i) i.hasOwnProperty(h) && (n[h] = i[h]);
  }, Zt(t, r);
};
function dn(t, r) {
  Zt(t, r);
  function n() {
    this.constructor = t;
  }
  t.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
}
var Qt = function() {
  return Qt = Object.assign || function(r) {
    for (var n, i = 1, h = arguments.length; i < h; i++) {
      n = arguments[i];
      for (var f in n) Object.prototype.hasOwnProperty.call(n, f) && (r[f] = n[f]);
    }
    return r;
  }, Qt.apply(this, arguments);
};
function vn(t, r) {
  var n = {};
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && r.indexOf(i) < 0 && (n[i] = t[i]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
    for (var h = 0, i = Object.getOwnPropertySymbols(t); h < i.length; h++)
      r.indexOf(i[h]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[h]) && (n[i[h]] = t[i[h]]);
  return n;
}
function bn(t, r, n, i) {
  var h = arguments.length, f = h < 3 ? r : i === null ? i = Object.getOwnPropertyDescriptor(r, n) : i, d;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") f = Reflect.decorate(t, r, n, i);
  else for (var u = t.length - 1; u >= 0; u--) (d = t[u]) && (f = (h < 3 ? d(f) : h > 3 ? d(r, n, f) : d(r, n)) || f);
  return h > 3 && f && Object.defineProperty(r, n, f), f;
}
function wn(t, r) {
  return function(n, i) {
    r(n, i, t);
  };
}
function gn(t, r) {
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(t, r);
}
function yn(t, r, n, i) {
  function h(f) {
    return f instanceof n ? f : new n(function(d) {
      d(f);
    });
  }
  return new (n || (n = Promise))(function(f, d) {
    function u(_) {
      try {
        s(i.next(_));
      } catch (w) {
        d(w);
      }
    }
    function o(_) {
      try {
        s(i.throw(_));
      } catch (w) {
        d(w);
      }
    }
    function s(_) {
      _.done ? f(_.value) : h(_.value).then(u, o);
    }
    s((i = i.apply(t, r || [])).next());
  });
}
function pn(t, r) {
  var n = { label: 0, sent: function() {
    if (f[0] & 1) throw f[1];
    return f[1];
  }, trys: [], ops: [] }, i, h, f, d;
  return d = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (d[Symbol.iterator] = function() {
    return this;
  }), d;
  function u(s) {
    return function(_) {
      return o([s, _]);
    };
  }
  function o(s) {
    if (i) throw new TypeError("Generator is already executing.");
    for (; n; ) try {
      if (i = 1, h && (f = s[0] & 2 ? h.return : s[0] ? h.throw || ((f = h.return) && f.call(h), 0) : h.next) && !(f = f.call(h, s[1])).done) return f;
      switch (h = 0, f && (s = [s[0] & 2, f.value]), s[0]) {
        case 0:
        case 1:
          f = s;
          break;
        case 4:
          return n.label++, { value: s[1], done: !1 };
        case 5:
          n.label++, h = s[1], s = [0];
          continue;
        case 7:
          s = n.ops.pop(), n.trys.pop();
          continue;
        default:
          if (f = n.trys, !(f = f.length > 0 && f[f.length - 1]) && (s[0] === 6 || s[0] === 2)) {
            n = 0;
            continue;
          }
          if (s[0] === 3 && (!f || s[1] > f[0] && s[1] < f[3])) {
            n.label = s[1];
            break;
          }
          if (s[0] === 6 && n.label < f[1]) {
            n.label = f[1], f = s;
            break;
          }
          if (f && n.label < f[2]) {
            n.label = f[2], n.ops.push(s);
            break;
          }
          f[2] && n.ops.pop(), n.trys.pop();
          continue;
      }
      s = r.call(t, n);
    } catch (_) {
      s = [6, _], h = 0;
    } finally {
      i = f = 0;
    }
    if (s[0] & 5) throw s[1];
    return { value: s[0] ? s[1] : void 0, done: !0 };
  }
}
function Sn(t, r, n, i) {
  i === void 0 && (i = n), t[i] = r[n];
}
function mn(t, r) {
  for (var n in t) n !== "default" && !r.hasOwnProperty(n) && (r[n] = t[n]);
}
function kt(t) {
  var r = typeof Symbol == "function" && Symbol.iterator, n = r && t[r], i = 0;
  if (n) return n.call(t);
  if (t && typeof t.length == "number") return {
    next: function() {
      return t && i >= t.length && (t = void 0), { value: t && t[i++], done: !t };
    }
  };
  throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function Le(t, r) {
  var n = typeof Symbol == "function" && t[Symbol.iterator];
  if (!n) return t;
  var i = n.call(t), h, f = [], d;
  try {
    for (; (r === void 0 || r-- > 0) && !(h = i.next()).done; ) f.push(h.value);
  } catch (u) {
    d = { error: u };
  } finally {
    try {
      h && !h.done && (n = i.return) && n.call(i);
    } finally {
      if (d) throw d.error;
    }
  }
  return f;
}
function Cn() {
  for (var t = [], r = 0; r < arguments.length; r++)
    t = t.concat(Le(arguments[r]));
  return t;
}
function On() {
  for (var t = 0, r = 0, n = arguments.length; r < n; r++) t += arguments[r].length;
  for (var i = Array(t), h = 0, r = 0; r < n; r++)
    for (var f = arguments[r], d = 0, u = f.length; d < u; d++, h++)
      i[h] = f[d];
  return i;
}
function Tt(t) {
  return this instanceof Tt ? (this.v = t, this) : new Tt(t);
}
function An(t, r, n) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var i = n.apply(t, r || []), h, f = [];
  return h = {}, d("next"), d("throw"), d("return"), h[Symbol.asyncIterator] = function() {
    return this;
  }, h;
  function d(E) {
    i[E] && (h[E] = function(l) {
      return new Promise(function(b, S) {
        f.push([E, l, b, S]) > 1 || u(E, l);
      });
    });
  }
  function u(E, l) {
    try {
      o(i[E](l));
    } catch (b) {
      w(f[0][3], b);
    }
  }
  function o(E) {
    E.value instanceof Tt ? Promise.resolve(E.value.v).then(s, _) : w(f[0][2], E);
  }
  function s(E) {
    u("next", E);
  }
  function _(E) {
    u("throw", E);
  }
  function w(E, l) {
    E(l), f.shift(), f.length && u(f[0][0], f[0][1]);
  }
}
function Un(t) {
  var r, n;
  return r = {}, i("next"), i("throw", function(h) {
    throw h;
  }), i("return"), r[Symbol.iterator] = function() {
    return this;
  }, r;
  function i(h, f) {
    r[h] = t[h] ? function(d) {
      return (n = !n) ? { value: Tt(t[h](d)), done: h === "return" } : f ? f(d) : d;
    } : f;
  }
}
function Tn(t) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var r = t[Symbol.asyncIterator], n;
  return r ? r.call(t) : (t = typeof kt == "function" ? kt(t) : t[Symbol.iterator](), n = {}, i("next"), i("throw"), i("return"), n[Symbol.asyncIterator] = function() {
    return this;
  }, n);
  function i(f) {
    n[f] = t[f] && function(d) {
      return new Promise(function(u, o) {
        d = t[f](d), h(u, o, d.done, d.value);
      });
    };
  }
  function h(f, d, u, o) {
    Promise.resolve(o).then(function(s) {
      f({ value: s, done: u });
    }, d);
  }
}
function Fn(t, r) {
  return Object.defineProperty ? Object.defineProperty(t, "raw", { value: r }) : t.raw = r, t;
}
function Nn(t) {
  if (t && t.__esModule) return t;
  var r = {};
  if (t != null) for (var n in t) Object.hasOwnProperty.call(t, n) && (r[n] = t[n]);
  return r.default = t, r;
}
function Mn(t) {
  return t && t.__esModule ? t : { default: t };
}
function Ln(t, r) {
  if (!r.has(t))
    throw new TypeError("attempted to get private field on non-instance");
  return r.get(t);
}
function xn(t, r, n) {
  if (!r.has(t))
    throw new TypeError("attempted to set private field on non-instance");
  return r.set(t, n), n;
}
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  get __assign() {
    return Qt;
  },
  __asyncDelegator: Un,
  __asyncGenerator: An,
  __asyncValues: Tn,
  __await: Tt,
  __awaiter: yn,
  __classPrivateFieldGet: Ln,
  __classPrivateFieldSet: xn,
  __createBinding: Sn,
  __decorate: bn,
  __exportStar: mn,
  __extends: dn,
  __generator: pn,
  __importDefault: Mn,
  __importStar: Nn,
  __makeTemplateObject: Fn,
  __metadata: gn,
  __param: wn,
  __read: Le,
  __rest: vn,
  __spread: Cn,
  __spreadArrays: On,
  __values: kt
}, Symbol.toStringTag, { value: "Module" })), Ht = /* @__PURE__ */ Ie(Bn);
var zt = {}, At = {}, fe;
function Rn() {
  if (fe) return At;
  fe = 1, Object.defineProperty(At, "__esModule", { value: !0 }), At.delay = void 0;
  function t(r) {
    return new Promise((n) => {
      setTimeout(() => {
        n(!0);
      }, r);
    });
  }
  return At.delay = t, At;
}
var gt = {}, Yt = {}, yt = {}, he;
function jn() {
  return he || (he = 1, Object.defineProperty(yt, "__esModule", { value: !0 }), yt.ONE_THOUSAND = yt.ONE_HUNDRED = void 0, yt.ONE_HUNDRED = 100, yt.ONE_THOUSAND = 1e3), yt;
}
var Wt = {}, se;
function Pn() {
  return se || (se = 1, function(t) {
    Object.defineProperty(t, "__esModule", { value: !0 }), t.ONE_YEAR = t.FOUR_WEEKS = t.THREE_WEEKS = t.TWO_WEEKS = t.ONE_WEEK = t.THIRTY_DAYS = t.SEVEN_DAYS = t.FIVE_DAYS = t.THREE_DAYS = t.ONE_DAY = t.TWENTY_FOUR_HOURS = t.TWELVE_HOURS = t.SIX_HOURS = t.THREE_HOURS = t.ONE_HOUR = t.SIXTY_MINUTES = t.THIRTY_MINUTES = t.TEN_MINUTES = t.FIVE_MINUTES = t.ONE_MINUTE = t.SIXTY_SECONDS = t.THIRTY_SECONDS = t.TEN_SECONDS = t.FIVE_SECONDS = t.ONE_SECOND = void 0, t.ONE_SECOND = 1, t.FIVE_SECONDS = 5, t.TEN_SECONDS = 10, t.THIRTY_SECONDS = 30, t.SIXTY_SECONDS = 60, t.ONE_MINUTE = t.SIXTY_SECONDS, t.FIVE_MINUTES = t.ONE_MINUTE * 5, t.TEN_MINUTES = t.ONE_MINUTE * 10, t.THIRTY_MINUTES = t.ONE_MINUTE * 30, t.SIXTY_MINUTES = t.ONE_MINUTE * 60, t.ONE_HOUR = t.SIXTY_MINUTES, t.THREE_HOURS = t.ONE_HOUR * 3, t.SIX_HOURS = t.ONE_HOUR * 6, t.TWELVE_HOURS = t.ONE_HOUR * 12, t.TWENTY_FOUR_HOURS = t.ONE_HOUR * 24, t.ONE_DAY = t.TWENTY_FOUR_HOURS, t.THREE_DAYS = t.ONE_DAY * 3, t.FIVE_DAYS = t.ONE_DAY * 5, t.SEVEN_DAYS = t.ONE_DAY * 7, t.THIRTY_DAYS = t.ONE_DAY * 30, t.ONE_WEEK = t.SEVEN_DAYS, t.TWO_WEEKS = t.ONE_WEEK * 2, t.THREE_WEEKS = t.ONE_WEEK * 3, t.FOUR_WEEKS = t.ONE_WEEK * 4, t.ONE_YEAR = t.ONE_DAY * 365;
  }(Wt)), Wt;
}
var ce;
function xe() {
  return ce || (ce = 1, function(t) {
    Object.defineProperty(t, "__esModule", { value: !0 });
    const r = Ht;
    r.__exportStar(jn(), t), r.__exportStar(Pn(), t);
  }(Yt)), Yt;
}
var le;
function In() {
  if (le) return gt;
  le = 1, Object.defineProperty(gt, "__esModule", { value: !0 }), gt.fromMiliseconds = gt.toMiliseconds = void 0;
  const t = xe();
  function r(i) {
    return i * t.ONE_THOUSAND;
  }
  gt.toMiliseconds = r;
  function n(i) {
    return Math.floor(i / t.ONE_THOUSAND);
  }
  return gt.fromMiliseconds = n, gt;
}
var De;
function Hn() {
  return De || (De = 1, function(t) {
    Object.defineProperty(t, "__esModule", { value: !0 });
    const r = Ht;
    r.__exportStar(Rn(), t), r.__exportStar(In(), t);
  }(zt)), zt;
}
var mt = {}, _e;
function Kn() {
  if (_e) return mt;
  _e = 1, Object.defineProperty(mt, "__esModule", { value: !0 }), mt.Watch = void 0;
  class t {
    constructor() {
      this.timestamps = /* @__PURE__ */ new Map();
    }
    start(n) {
      if (this.timestamps.has(n))
        throw new Error(`Watch already started for label: ${n}`);
      this.timestamps.set(n, { started: Date.now() });
    }
    stop(n) {
      const i = this.get(n);
      if (typeof i.elapsed < "u")
        throw new Error(`Watch already stopped for label: ${n}`);
      const h = Date.now() - i.started;
      this.timestamps.set(n, { started: i.started, elapsed: h });
    }
    get(n) {
      const i = this.timestamps.get(n);
      if (typeof i > "u")
        throw new Error(`No timestamp found for label: ${n}`);
      return i;
    }
    elapsed(n) {
      const i = this.get(n);
      return i.elapsed || Date.now() - i.started;
    }
  }
  return mt.Watch = t, mt.default = t, mt;
}
var qt = {}, Ut = {}, Ee;
function zn() {
  if (Ee) return Ut;
  Ee = 1, Object.defineProperty(Ut, "__esModule", { value: !0 }), Ut.IWatch = void 0;
  class t {
  }
  return Ut.IWatch = t, Ut;
}
var de;
function Yn() {
  return de || (de = 1, function(t) {
    Object.defineProperty(t, "__esModule", { value: !0 }), Ht.__exportStar(zn(), t);
  }(qt)), qt;
}
(function(t) {
  Object.defineProperty(t, "__esModule", { value: !0 });
  const r = Ht;
  r.__exportStar(Hn(), t), r.__exportStar(Kn(), t), r.__exportStar(Yn(), t), r.__exportStar(xe(), t);
})(En);
var q = {};
Object.defineProperty(q, "__esModule", { value: !0 });
q.getLocalStorage = q.getLocalStorageOrThrow = q.getCrypto = q.getCryptoOrThrow = Qn = q.getLocation = q.getLocationOrThrow = Xn = q.getNavigator = q.getNavigatorOrThrow = Gn = q.getDocument = q.getDocumentOrThrow = q.getFromWindowOrThrow = q.getFromWindow = void 0;
function pt(t) {
  let r;
  return typeof window < "u" && typeof window[t] < "u" && (r = window[t]), r;
}
q.getFromWindow = pt;
function Ct(t) {
  const r = pt(t);
  if (!r)
    throw new Error(`${t} is not defined in Window`);
  return r;
}
q.getFromWindowOrThrow = Ct;
function Wn() {
  return Ct("document");
}
q.getDocumentOrThrow = Wn;
function qn() {
  return pt("document");
}
var Gn = q.getDocument = qn;
function $n() {
  return Ct("navigator");
}
q.getNavigatorOrThrow = $n;
function Vn() {
  return pt("navigator");
}
var Xn = q.getNavigator = Vn;
function Jn() {
  return Ct("location");
}
q.getLocationOrThrow = Jn;
function Zn() {
  return pt("location");
}
var Qn = q.getLocation = Zn;
function kn() {
  return Ct("crypto");
}
q.getCryptoOrThrow = kn;
function ti() {
  return pt("crypto");
}
q.getCrypto = ti;
function ei() {
  return Ct("localStorage");
}
q.getLocalStorageOrThrow = ei;
function ri() {
  return pt("localStorage");
}
q.getLocalStorage = ri;
var ne = {};
Object.defineProperty(ne, "__esModule", { value: !0 });
var ni = ne.getWindowMetadata = void 0;
const ve = q;
function ii() {
  let t, r;
  try {
    t = ve.getDocumentOrThrow(), r = ve.getLocationOrThrow();
  } catch {
    return null;
  }
  function n() {
    const w = t.getElementsByTagName("link"), E = [];
    for (let l = 0; l < w.length; l++) {
      const b = w[l], S = b.getAttribute("rel");
      if (S && S.toLowerCase().indexOf("icon") > -1) {
        const g = b.getAttribute("href");
        if (g)
          if (g.toLowerCase().indexOf("https:") === -1 && g.toLowerCase().indexOf("http:") === -1 && g.indexOf("//") !== 0) {
            let O = r.protocol + "//" + r.host;
            if (g.indexOf("/") === 0)
              O += g;
            else {
              const j = r.pathname.split("/");
              j.pop();
              const A = j.join("/");
              O += A + "/" + g;
            }
            E.push(O);
          } else if (g.indexOf("//") === 0) {
            const O = r.protocol + g;
            E.push(O);
          } else
            E.push(g);
      }
    }
    return E;
  }
  function i(...w) {
    const E = t.getElementsByTagName("meta");
    for (let l = 0; l < E.length; l++) {
      const b = E[l], S = ["itemprop", "property", "name"].map((g) => b.getAttribute(g)).filter((g) => g ? w.includes(g) : !1);
      if (S.length && S) {
        const g = b.getAttribute("content");
        if (g)
          return g;
      }
    }
    return "";
  }
  function h() {
    let w = i("name", "og:site_name", "og:title", "twitter:title");
    return w || (w = t.title), w;
  }
  function f() {
    return i("description", "og:description", "twitter:description", "keywords");
  }
  const d = h(), u = f(), o = r.origin, s = n();
  return {
    description: u,
    url: o,
    icons: s,
    name: d
  };
}
ni = ne.getWindowMetadata = ii;
var gi = (t) => encodeURIComponent(t).replace(/[!'()*]/g, (r) => `%${r.charCodeAt(0).toString(16).toUpperCase()}`), Be = "%[a-f0-9]{2}", be = new RegExp("(" + Be + ")|([^%]+?)", "gi"), we = new RegExp("(" + Be + ")+", "gi");
function te(t, r) {
  try {
    return [decodeURIComponent(t.join(""))];
  } catch {
  }
  if (t.length === 1)
    return t;
  r = r || 1;
  var n = t.slice(0, r), i = t.slice(r);
  return Array.prototype.concat.call([], te(n), te(i));
}
function ai(t) {
  try {
    return decodeURIComponent(t);
  } catch {
    for (var r = t.match(be) || [], n = 1; n < r.length; n++)
      t = te(r, n).join(""), r = t.match(be) || [];
    return t;
  }
}
function ui(t) {
  for (var r = {
    "%FE%FF": "��",
    "%FF%FE": "��"
  }, n = we.exec(t); n; ) {
    try {
      r[n[0]] = decodeURIComponent(n[0]);
    } catch {
      var i = ai(n[0]);
      i !== n[0] && (r[n[0]] = i);
    }
    n = we.exec(t);
  }
  r["%C2"] = "�";
  for (var h = Object.keys(r), f = 0; f < h.length; f++) {
    var d = h[f];
    t = t.replace(new RegExp(d, "g"), r[d]);
  }
  return t;
}
var yi = function(t) {
  if (typeof t != "string")
    throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof t + "`");
  try {
    return t = t.replace(/\+/g, " "), decodeURIComponent(t);
  } catch {
    return ui(t);
  }
}, pi = (t, r) => {
  if (!(typeof t == "string" && typeof r == "string"))
    throw new TypeError("Expected the arguments to be of type `string`");
  if (r === "")
    return [t];
  const n = t.indexOf(r);
  return n === -1 ? [t] : [
    t.slice(0, n),
    t.slice(n + r.length)
  ];
}, Si = function(t, r) {
  for (var n = {}, i = Object.keys(t), h = Array.isArray(r), f = 0; f < i.length; f++) {
    var d = i[f], u = t[d];
    (h ? r.indexOf(d) !== -1 : r(d, u, t)) && (n[d] = u);
  }
  return n;
};
export {
  hi as B,
  fi as H,
  gi as a,
  Or as b,
  En as c,
  yi as d,
  Xn as e,
  Si as f,
  ni as g,
  Gn as h,
  He as i,
  Qn as j,
  si as k,
  ci as l,
  li as m,
  Di as n,
  _i as o,
  Ei as p,
  di as q,
  re as r,
  pi as s,
  vi as t,
  bi as u,
  wi as v,
  x as w,
  Ar as x,
  dt as y
};
