import { r as tt, a as G, b as st } from "./sha256-BQ4o8glW.js";
var p = {}, K;
function rt() {
  if (K) return p;
  K = 1, Object.defineProperty(p, "__esModule", { value: !0 }), p.shake256 = p.shake128 = p.keccak_512 = p.keccak_384 = p.keccak_256 = p.keccak_224 = p.sha3_512 = p.sha3_384 = p.sha3_256 = p.sha3_224 = p.Keccak = void 0, p.keccakP = C;
  const x = /* @__PURE__ */ tt(), c = /* @__PURE__ */ G(), w = BigInt(0), b = BigInt(1), E = BigInt(2), T = BigInt(7), q = BigInt(256), D = BigInt(113), M = [], H = [], S = [];
  for (let a = 0, e = b, n = 1, u = 0; a < 24; a++) {
    [n, u] = [u, (2 * n + 3 * u) % 5], M.push(2 * (5 * u + n)), H.push((a + 1) * (a + 2) / 2 % 64);
    let h = w;
    for (let i = 0; i < 7; i++)
      e = (e << b ^ (e >> T) * D) % q, e & E && (h ^= b << (b << /* @__PURE__ */ BigInt(i)) - b);
    S.push(h);
  }
  const L = (0, x.split)(S, !0), X = L[0], P = L[1], R = (a, e, n) => n > 32 ? (0, x.rotlBH)(a, e, n) : (0, x.rotlSH)(a, e, n), U = (a, e, n) => n > 32 ? (0, x.rotlBL)(a, e, n) : (0, x.rotlSL)(a, e, n);
  function C(a, e = 24) {
    const n = new Uint32Array(10);
    for (let u = 24 - e; u < 24; u++) {
      for (let t = 0; t < 10; t++)
        n[t] = a[t] ^ a[t + 10] ^ a[t + 20] ^ a[t + 30] ^ a[t + 40];
      for (let t = 0; t < 10; t += 2) {
        const s = (t + 8) % 10, r = (t + 2) % 10, o = n[r], f = n[r + 1], d = R(o, f, 1) ^ n[s], l = U(o, f, 1) ^ n[s + 1];
        for (let _ = 0; _ < 50; _ += 10)
          a[t + _] ^= d, a[t + _ + 1] ^= l;
      }
      let h = a[2], i = a[3];
      for (let t = 0; t < 24; t++) {
        const s = H[t], r = R(h, i, s), o = U(h, i, s), f = M[t];
        h = a[f], i = a[f + 1], a[f] = r, a[f + 1] = o;
      }
      for (let t = 0; t < 50; t += 10) {
        for (let s = 0; s < 10; s++)
          n[s] = a[t + s];
        for (let s = 0; s < 10; s++)
          a[t + s] ^= ~n[(s + 2) % 10] & n[(s + 4) % 10];
      }
      a[0] ^= X[u], a[1] ^= P[u];
    }
    (0, c.clean)(n);
  }
  class B extends c.Hash {
    // NOTE: we accept arguments in bytes instead of bits here.
    constructor(e, n, u, h = !1, i = 24) {
      if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = n, this.outputLen = u, this.enableXOF = h, this.rounds = i, (0, c.anumber)(u), !(0 < e && e < 200))
        throw new Error("only keccak-f1600 function is supported");
      this.state = new Uint8Array(200), this.state32 = (0, c.u32)(this.state);
    }
    clone() {
      return this._cloneInto();
    }
    keccak() {
      (0, c.swap32IfBE)(this.state32), C(this.state32, this.rounds), (0, c.swap32IfBE)(this.state32), this.posOut = 0, this.pos = 0;
    }
    update(e) {
      (0, c.aexists)(this), e = (0, c.toBytes)(e), (0, c.abytes)(e);
      const { blockLen: n, state: u } = this, h = e.length;
      for (let i = 0; i < h; ) {
        const t = Math.min(n - this.pos, h - i);
        for (let s = 0; s < t; s++)
          u[this.pos++] ^= e[i++];
        this.pos === n && this.keccak();
      }
      return this;
    }
    finish() {
      if (this.finished)
        return;
      this.finished = !0;
      const { state: e, suffix: n, pos: u, blockLen: h } = this;
      e[u] ^= n, (n & 128) !== 0 && u === h - 1 && this.keccak(), e[h - 1] ^= 128, this.keccak();
    }
    writeInto(e) {
      (0, c.aexists)(this, !1), (0, c.abytes)(e), this.finish();
      const n = this.state, { blockLen: u } = this;
      for (let h = 0, i = e.length; h < i; ) {
        this.posOut >= u && this.keccak();
        const t = Math.min(u - this.posOut, i - h);
        e.set(n.subarray(this.posOut, this.posOut + t), h), this.posOut += t, h += t;
      }
      return e;
    }
    xofInto(e) {
      if (!this.enableXOF)
        throw new Error("XOF is not possible for this instance");
      return this.writeInto(e);
    }
    xof(e) {
      return (0, c.anumber)(e), this.xofInto(new Uint8Array(e));
    }
    digestInto(e) {
      if ((0, c.aoutput)(e, this), this.finished)
        throw new Error("digest() was already called");
      return this.writeInto(e), this.destroy(), e;
    }
    digest() {
      return this.digestInto(new Uint8Array(this.outputLen));
    }
    destroy() {
      this.destroyed = !0, (0, c.clean)(this.state);
    }
    _cloneInto(e) {
      const { blockLen: n, suffix: u, outputLen: h, rounds: i, enableXOF: t } = this;
      return e || (e = new B(n, u, h, t, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = u, e.outputLen = h, e.enableXOF = t, e.destroyed = this.destroyed, e;
    }
  }
  p.Keccak = B;
  const m = (a, e, n) => (0, c.createHasher)(() => new B(e, a, n));
  p.sha3_224 = m(6, 144, 224 / 8), p.sha3_256 = m(6, 136, 256 / 8), p.sha3_384 = m(6, 104, 384 / 8), p.sha3_512 = m(6, 72, 512 / 8), p.keccak_224 = m(1, 144, 224 / 8), p.keccak_256 = m(1, 136, 256 / 8), p.keccak_384 = m(1, 104, 384 / 8), p.keccak_512 = m(1, 72, 512 / 8);
  const v = (a, e, n) => (0, c.createXOFer)((u = {}) => new B(e, a, u.dkLen === void 0 ? n : u.dkLen, !0));
  return p.shake128 = v(31, 168, 128 / 8), p.shake256 = v(31, 136, 256 / 8), p;
}
var O = {}, A = {}, V;
function et() {
  if (V) return A;
  V = 1, Object.defineProperty(A, "__esModule", { value: !0 }), A.ripemd160 = A.RIPEMD160 = A.md5 = A.MD5 = A.sha1 = A.SHA1 = void 0;
  const x = /* @__PURE__ */ st(), c = /* @__PURE__ */ G(), w = /* @__PURE__ */ Uint32Array.from([
    1732584193,
    4023233417,
    2562383102,
    271733878,
    3285377520
  ]), b = /* @__PURE__ */ new Uint32Array(80);
  class E extends x.HashMD {
    constructor() {
      super(64, 20, 8, !1), this.A = w[0] | 0, this.B = w[1] | 0, this.C = w[2] | 0, this.D = w[3] | 0, this.E = w[4] | 0;
    }
    get() {
      const { A: i, B: t, C: s, D: r, E: o } = this;
      return [i, t, s, r, o];
    }
    set(i, t, s, r, o) {
      this.A = i | 0, this.B = t | 0, this.C = s | 0, this.D = r | 0, this.E = o | 0;
    }
    process(i, t) {
      for (let l = 0; l < 16; l++, t += 4)
        b[l] = i.getUint32(t, !1);
      for (let l = 16; l < 80; l++)
        b[l] = (0, c.rotl)(b[l - 3] ^ b[l - 8] ^ b[l - 14] ^ b[l - 16], 1);
      let { A: s, B: r, C: o, D: f, E: d } = this;
      for (let l = 0; l < 80; l++) {
        let _, k;
        l < 20 ? (_ = (0, x.Chi)(r, o, f), k = 1518500249) : l < 40 ? (_ = r ^ o ^ f, k = 1859775393) : l < 60 ? (_ = (0, x.Maj)(r, o, f), k = 2400959708) : (_ = r ^ o ^ f, k = 3395469782);
        const g = (0, c.rotl)(s, 5) + _ + d + k + b[l] | 0;
        d = f, f = o, o = (0, c.rotl)(r, 30), r = s, s = g;
      }
      s = s + this.A | 0, r = r + this.B | 0, o = o + this.C | 0, f = f + this.D | 0, d = d + this.E | 0, this.set(s, r, o, f, d);
    }
    roundClean() {
      (0, c.clean)(b);
    }
    destroy() {
      this.set(0, 0, 0, 0, 0), (0, c.clean)(this.buffer);
    }
  }
  A.SHA1 = E, A.sha1 = (0, c.createHasher)(() => new E());
  const T = /* @__PURE__ */ Math.pow(2, 32), q = /* @__PURE__ */ Array.from({ length: 64 }, (h, i) => Math.floor(T * Math.abs(Math.sin(i + 1)))), D = /* @__PURE__ */ w.slice(0, 4), M = /* @__PURE__ */ new Uint32Array(16);
  class H extends x.HashMD {
    constructor() {
      super(64, 16, 8, !0), this.A = D[0] | 0, this.B = D[1] | 0, this.C = D[2] | 0, this.D = D[3] | 0;
    }
    get() {
      const { A: i, B: t, C: s, D: r } = this;
      return [i, t, s, r];
    }
    set(i, t, s, r) {
      this.A = i | 0, this.B = t | 0, this.C = s | 0, this.D = r | 0;
    }
    process(i, t) {
      for (let d = 0; d < 16; d++, t += 4)
        M[d] = i.getUint32(t, !0);
      let { A: s, B: r, C: o, D: f } = this;
      for (let d = 0; d < 64; d++) {
        let l, _, k;
        d < 16 ? (l = (0, x.Chi)(r, o, f), _ = d, k = [7, 12, 17, 22]) : d < 32 ? (l = (0, x.Chi)(f, r, o), _ = (5 * d + 1) % 16, k = [5, 9, 14, 20]) : d < 48 ? (l = r ^ o ^ f, _ = (3 * d + 5) % 16, k = [4, 11, 16, 23]) : (l = o ^ (r | ~f), _ = 7 * d % 16, k = [6, 10, 15, 21]), l = l + s + q[d] + M[_], s = f, f = o, o = r, r = r + (0, c.rotl)(l, k[d % 4]);
      }
      s = s + this.A | 0, r = r + this.B | 0, o = o + this.C | 0, f = f + this.D | 0, this.set(s, r, o, f);
    }
    roundClean() {
      (0, c.clean)(M);
    }
    destroy() {
      this.set(0, 0, 0, 0), (0, c.clean)(this.buffer);
    }
  }
  A.MD5 = H, A.md5 = (0, c.createHasher)(() => new H());
  const S = /* @__PURE__ */ Uint8Array.from([
    7,
    4,
    13,
    1,
    10,
    6,
    15,
    3,
    12,
    0,
    9,
    5,
    2,
    14,
    11,
    8
  ]), L = Uint8Array.from(new Array(16).fill(0).map((h, i) => i)), X = L.map((h) => (9 * h + 5) % 16), P = /* @__PURE__ */ (() => {
    const t = [[L], [X]];
    for (let s = 0; s < 4; s++)
      for (let r of t)
        r.push(r[s].map((o) => S[o]));
    return t;
  })(), R = P[0], U = P[1], C = /* @__PURE__ */ [
    [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
    [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
    [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
    [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
    [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
  ].map((h) => Uint8Array.from(h)), B = /* @__PURE__ */ R.map((h, i) => h.map((t) => C[i][t])), m = /* @__PURE__ */ U.map((h, i) => h.map((t) => C[i][t])), v = /* @__PURE__ */ Uint32Array.from([
    0,
    1518500249,
    1859775393,
    2400959708,
    2840853838
  ]), a = /* @__PURE__ */ Uint32Array.from([
    1352829926,
    1548603684,
    1836072691,
    2053994217,
    0
  ]);
  function e(h, i, t, s) {
    return h === 0 ? i ^ t ^ s : h === 1 ? i & t | ~i & s : h === 2 ? (i | ~t) ^ s : h === 3 ? i & s | t & ~s : i ^ (t | ~s);
  }
  const n = /* @__PURE__ */ new Uint32Array(16);
  class u extends x.HashMD {
    constructor() {
      super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
    }
    get() {
      const { h0: i, h1: t, h2: s, h3: r, h4: o } = this;
      return [i, t, s, r, o];
    }
    set(i, t, s, r, o) {
      this.h0 = i | 0, this.h1 = t | 0, this.h2 = s | 0, this.h3 = r | 0, this.h4 = o | 0;
    }
    process(i, t) {
      for (let y = 0; y < 16; y++, t += 4)
        n[y] = i.getUint32(t, !0);
      let s = this.h0 | 0, r = s, o = this.h1 | 0, f = o, d = this.h2 | 0, l = d, _ = this.h3 | 0, k = _, g = this.h4 | 0, F = g;
      for (let y = 0; y < 5; y++) {
        const J = 4 - y, N = v[y], Q = a[y], Y = R[y], Z = U[y], $ = B[y], z = m[y];
        for (let I = 0; I < 16; I++) {
          const j = (0, c.rotl)(s + e(y, o, d, _) + n[Y[I]] + N, $[I]) + g | 0;
          s = g, g = _, _ = (0, c.rotl)(d, 10) | 0, d = o, o = j;
        }
        for (let I = 0; I < 16; I++) {
          const j = (0, c.rotl)(r + e(J, f, l, k) + n[Z[I]] + Q, z[I]) + F | 0;
          r = F, F = k, k = (0, c.rotl)(l, 10) | 0, l = f, f = j;
        }
      }
      this.set(this.h1 + d + k | 0, this.h2 + _ + F | 0, this.h3 + g + r | 0, this.h4 + s + f | 0, this.h0 + o + l | 0);
    }
    roundClean() {
      (0, c.clean)(n);
    }
    destroy() {
      this.destroyed = !0, (0, c.clean)(this.buffer), this.set(0, 0, 0, 0, 0);
    }
  }
  return A.RIPEMD160 = u, A.ripemd160 = (0, c.createHasher)(() => new u()), A;
}
var W;
function nt() {
  if (W) return O;
  W = 1, Object.defineProperty(O, "__esModule", { value: !0 }), O.ripemd160 = O.RIPEMD160 = void 0;
  const x = /* @__PURE__ */ et();
  return O.RIPEMD160 = x.RIPEMD160, O.ripemd160 = x.ripemd160, O;
}
export {
  nt as a,
  rt as r
};
