;
! function() {
    try {
        var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {},
            n = (new e.Error).stack;
        n && ((e._debugIds || (e._debugIds = {}))[n] = "8391b442-27b7-6778-ee8f-1596bae4ca21")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 368089, 388326, e => {
    "use strict";
    let t, r;
    var n, i, o = e.i(727830),
        f = e.i(354955),
        l = f;
    class a extends l.Hash {
        constructor(e, t) {
            super(), this.finished = !1, this.destroyed = !1, (0, l.ahash)(e);
            const r = (0, l.toBytes)(t);
            if (this.iHash = e.create(), "function" != typeof this.iHash.update) throw Error("Expected instance of class which extends utils.Hash");
            this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
            const n = this.blockLen,
                i = new Uint8Array(n);
            i.set(r.length > n ? e.create().update(r).digest() : r);
            for (let e = 0; e < i.length; e++) i[e] ^= 54;
            this.iHash.update(i), this.oHash = e.create();
            for (let e = 0; e < i.length; e++) i[e] ^= 106;
            this.oHash.update(i), (0, l.clean)(i)
        }
        update(e) {
            return (0, l.aexists)(this), this.iHash.update(e), this
        }
        digestInto(e) {
            (0, l.aexists)(this), (0, l.abytes)(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy()
        }
        digest() {
            let e = new Uint8Array(this.oHash.outputLen);
            return this.digestInto(e), e
        }
        _cloneInto(e) {
            e || (e = Object.create(Object.getPrototypeOf(this), {}));
            let {
                oHash: t,
                iHash: r,
                finished: n,
                destroyed: i,
                blockLen: o,
                outputLen: f
            } = this;
            return e.finished = n, e.destroyed = i, e.blockLen = o, e.outputLen = f, e.oHash = t._cloneInto(e.oHash), e.iHash = r._cloneInto(e.iHash), e
        }
        clone() {
            return this._cloneInto()
        }
        destroy() {
            this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy()
        }
    }
    let s = (e, t, r) => new a(e, t).update(r).digest();
    s.create = (e, t) => new a(e, t), e.s(["hmac", 0, s], 388326);
    let u = BigInt(0),
        d = BigInt(1);

    function c(e) {
        return e instanceof Uint8Array || ArrayBuffer.isView(e) && "Uint8Array" === e.constructor.name
    }

    function h(e) {
        if (!c(e)) throw Error("Uint8Array expected")
    }

    function g(e, t) {
        if ("boolean" != typeof t) throw Error(e + " boolean expected, got " + t)
    }

    function p(e) {
        let t = e.toString(16);
        return 1 & t.length ? "0" + t : t
    }

    function m(e) {
        if ("string" != typeof e) throw Error("hex string expected, got " + typeof e);
        return "" === e ? u : BigInt("0x" + e)
    }
    let y = "function" == typeof Uint8Array.from([]).toHex && "function" == typeof Uint8Array.fromHex,
        w = Array.from({
            length: 256
        }, (e, t) => t.toString(16).padStart(2, "0"));

    function b(e) {
        if (h(e), y) return e.toHex();
        let t = "";
        for (let r = 0; r < e.length; r++) t += w[e[r]];
        return t
    }

    function E(e) {
        return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : void 0
    }

    function v(e) {
        if ("string" != typeof e) throw Error("hex string expected, got " + typeof e);
        if (y) return Uint8Array.fromHex(e);
        let t = e.length,
            r = t / 2;
        if (t % 2) throw Error("hex string expected, got unpadded hex of length " + t);
        let n = new Uint8Array(r);
        for (let t = 0, i = 0; t < r; t++, i += 2) {
            let r = E(e.charCodeAt(i)),
                o = E(e.charCodeAt(i + 1));
            if (void 0 === r || void 0 === o) throw Error('hex string expected, got non-hex character "' + (e[i] + e[i + 1]) + '" at index ' + i);
            n[t] = 16 * r + o
        }
        return n
    }

    function B(e) {
        return m(b(e))
    }

    function x(e) {
        return h(e), m(b(Uint8Array.from(e).reverse()))
    }

    function A(e, t) {
        return v(e.toString(16).padStart(2 * t, "0"))
    }

    function O(e, t) {
        return A(e, t).reverse()
    }

    function S(e, t, r) {
        let n;
        if ("string" == typeof t) try {
                n = v(t)
            } catch (t) {
                throw Error(e + " must be hex string or Uint8Array, cause: " + t)
            } else if (c(t)) n = Uint8Array.from(t);
            else throw Error(e + " must be hex string or Uint8Array");
        let i = n.length;
        if ("number" == typeof r && i !== r) throw Error(e + " of length " + r + " expected, got " + i);
        return n
    }

    function I(...e) {
        let t = 0;
        for (let r = 0; r < e.length; r++) {
            let n = e[r];
            h(n), t += n.length
        }
        let r = new Uint8Array(t);
        for (let t = 0, n = 0; t < e.length; t++) {
            let i = e[t];
            r.set(i, n), n += i.length
        }
        return r
    }
    let R = e => "bigint" == typeof e && u <= e;

    function q(e, t, r) {
        return R(e) && R(t) && R(r) && t <= e && e < r
    }

    function N(e, t, r, n) {
        if (!q(t, r, n)) throw Error("expected valid " + e + ": " + r + " <= n < " + n + ", got " + t)
    }
    let H = e => (d << BigInt(e)) - d,
        P = e => new Uint8Array(e),
        U = {
            bigint: e => "bigint" == typeof e,
            function: e => "function" == typeof e,
            boolean: e => "boolean" == typeof e,
            string: e => "string" == typeof e,
            stringOrUint8Array: e => "string" == typeof e || c(e),
            isSafeInteger: e => Number.isSafeInteger(e),
            array: e => Array.isArray(e),
            field: (e, t) => t.Fp.isValid(e),
            hash: e => "function" == typeof e && Number.isSafeInteger(e.outputLen)
        };

    function Z(e, t, r = {}) {
        let n = (t, r, n) => {
            let i = U[r];
            if ("function" != typeof i) throw Error("invalid validator function");
            let o = e[t];
            if ((!n || void 0 !== o) && !i(o, e)) throw Error("param " + String(t) + " is invalid. Expected " + r + ", got " + o)
        };
        for (let [e, r] of Object.entries(t)) n(e, r, !1);
        for (let [e, t] of Object.entries(r)) n(e, t, !0);
        return e
    }

    function z(e) {
        let t = new WeakMap;
        return (r, ...n) => {
            let i = t.get(r);
            if (void 0 !== i) return i;
            let o = e(r, ...n);
            return t.set(r, o), o
        }
    }
    let F = BigInt(0),
        C = BigInt(1),
        L = BigInt(2),
        T = BigInt(3),
        V = BigInt(4),
        j = BigInt(5),
        D = BigInt(8);

    function k(e, t) {
        let r = e % t;
        return r >= F ? r : t + r
    }

    function K(e, t, r) {
        let n = e;
        for (; t-- > F;) n *= n, n %= r;
        return n
    }

    function _(e, t) {
        if (e === F) throw Error("invert: expected non-zero number");
        if (t <= F) throw Error("invert: expected positive modulus, got " + t);
        let r = k(e, t),
            n = t,
            i = F,
            o = C,
            f = C,
            l = F;
        for (; r !== F;) {
            let e = n / r,
                t = n % r,
                a = i - f * e,
                s = o - l * e;
            n = r, r = t, i = f, o = l, f = a, l = s
        }
        if (n !== C) throw Error("invert: does not exist");
        return k(i, t)
    }

    function Y(e, t) {
        let r = (e.ORDER + C) / V,
            n = e.pow(t, r);
        if (!e.eql(e.sqr(n), t)) throw Error("Cannot find square root");
        return n
    }

    function W(e, t) {
        let r = (e.ORDER - j) / D,
            n = e.mul(t, L),
            i = e.pow(n, r),
            o = e.mul(t, i),
            f = e.mul(e.mul(o, L), i),
            l = e.mul(o, e.sub(f, e.ONE));
        if (!e.eql(e.sqr(l), t)) throw Error("Cannot find square root");
        return l
    }
    let M = ["create", "isValid", "is0", "neg", "inv", "sqrt", "sqr", "eql", "add", "sub", "mul", "pow", "div", "addN", "subN", "mulN", "sqrN"];

    function G(e) {
        return Z(e, M.reduce((e, t) => (e[t] = "function", e), {
            ORDER: "bigint",
            MASK: "bigint",
            BYTES: "isSafeInteger",
            BITS: "isSafeInteger"
        }))
    }

    function J(e, t, r = !1) {
        let n = Array(t.length).fill(r ? e.ZERO : void 0),
            i = t.reduce((t, r, i) => e.is0(r) ? t : (n[i] = t, e.mul(t, r)), e.ONE),
            o = e.inv(i);
        return t.reduceRight((t, r, i) => e.is0(r) ? t : (n[i] = e.mul(t, n[i]), e.mul(t, r)), o), n
    }

    function Q(e, t) {
        let r = (e.ORDER - C) / L,
            n = e.pow(t, r),
            i = e.eql(n, e.ONE),
            o = e.eql(n, e.ZERO),
            f = e.eql(n, e.neg(e.ONE));
        if (!i && !o && !f) throw Error("invalid Legendre symbol result");
        return i ? 1 : o ? 0 : -1
    }

    function X(e, t) {
        void 0 !== t && (0, f.anumber)(t);
        let r = void 0 !== t ? t : e.toString(2).length,
            n = Math.ceil(r / 8);
        return {
            nBitLength: r,
            nByteLength: n
        }
    }

    function $(e, t, r = !1, n = {}) {
        let i;
        if (e <= F) throw Error("invalid field: expected ORDER > 0, got " + e);
        let {
            nBitLength: o,
            nByteLength: f
        } = X(e, t);
        if (f > 2048) throw Error("invalid field: expected ORDER of <= 2048 bytes");
        let l = Object.freeze({
            ORDER: e,
            isLE: r,
            BITS: o,
            BYTES: f,
            MASK: H(o),
            ZERO: F,
            ONE: C,
            create: t => k(t, e),
            isValid: t => {
                if ("bigint" != typeof t) throw Error("invalid field element: expected bigint, got " + typeof t);
                return F <= t && t < e
            },
            is0: e => e === F,
            isOdd: e => (e & C) === C,
            neg: t => k(-t, e),
            eql: (e, t) => e === t,
            sqr: t => k(t * t, e),
            add: (t, r) => k(t + r, e),
            sub: (t, r) => k(t - r, e),
            mul: (t, r) => k(t * r, e),
            pow: (e, t) => (function(e, t, r) {
                if (r < F) throw Error("invalid exponent, negatives unsupported");
                if (r === F) return e.ONE;
                if (r === C) return t;
                let n = e.ONE,
                    i = t;
                for (; r > F;) r & C && (n = e.mul(n, i)), i = e.sqr(i), r >>= C;
                return n
            })(l, e, t),
            div: (t, r) => k(t * _(r, e), e),
            sqrN: e => e * e,
            addN: (e, t) => e + t,
            subN: (e, t) => e - t,
            mulN: (e, t) => e * t,
            inv: t => _(t, e),
            sqrt: n.sqrt || (t => (i || (i = e % V === T ? Y : e % D === j ? W : function(e) {
                if (e < BigInt(3)) throw Error("sqrt is not defined for small field");
                let t = e - C,
                    r = 0;
                for (; t % L === F;) t /= L, r++;
                let n = L,
                    i = $(e);
                for (; 1 === Q(i, n);)
                    if (n++ > 1e3) throw Error("Cannot find square root: probably non-prime P");
                if (1 === r) return Y;
                let o = i.pow(n, t),
                    f = (t + C) / L;
                return function(e, n) {
                    if (e.is0(n)) return n;
                    if (1 !== Q(e, n)) throw Error("Cannot find square root");
                    let i = r,
                        l = e.mul(e.ONE, o),
                        a = e.pow(n, t),
                        s = e.pow(n, f);
                    for (; !e.eql(a, e.ONE);) {
                        if (e.is0(a)) return e.ZERO;
                        let t = 1,
                            r = e.sqr(a);
                        for (; !e.eql(r, e.ONE);)
                            if (t++, r = e.sqr(r), t === i) throw Error("Cannot find square root");
                        let n = C << BigInt(i - t - 1),
                            o = e.pow(l, n);
                        i = t, l = e.sqr(o), a = e.mul(a, l), s = e.mul(s, o)
                    }
                    return s
                }
            }(e)), i(l, t))),
            toBytes: e => r ? O(e, f) : A(e, f),
            fromBytes: e => {
                if (e.length !== f) throw Error("Field.fromBytes: expected " + f + " bytes, got " + e.length);
                return r ? x(e) : B(e)
            },
            invertBatch: e => J(l, e),
            cmov: (e, t, r) => r ? t : e
        });
        return Object.freeze(l)
    }

    function ee(e) {
        if ("bigint" != typeof e) throw Error("field order must be bigint");
        return Math.ceil(e.toString(2).length / 8)
    }

    function et(e) {
        let t = ee(e);
        return t + Math.ceil(t / 2)
    }
    let er = BigInt(0),
        en = BigInt(1);

    function ei(e, t) {
        let r = t.negate();
        return e ? r : t
    }

    function eo(e, t) {
        if (!Number.isSafeInteger(e) || e <= 0 || e > t) throw Error("invalid window size, expected [1.." + t + "], got W=" + e)
    }

    function ef(e, t) {
        eo(e, t);
        let r = Math.ceil(t / e) + 1,
            n = 2 ** (e - 1),
            i = 2 ** e;
        return {
            windows: r,
            windowSize: n,
            mask: H(e),
            maxNumber: i,
            shiftBy: BigInt(e)
        }
    }

    function el(e, t, r) {
        let {
            windowSize: n,
            mask: i,
            maxNumber: o,
            shiftBy: f
        } = r, l = Number(e & i), a = e >> f;
        l > n && (l -= o, a += en);
        let s = t * n,
            u = s + Math.abs(l) - 1,
            d = 0 === l;
        return {
            nextN: a,
            offset: u,
            isZero: d,
            isNeg: l < 0,
            isNegF: t % 2 != 0,
            offsetF: s
        }
    }
    let ea = new WeakMap,
        es = new WeakMap;

    function eu(e) {
        return es.get(e) || 1
    }

    function ed(e) {
        return G(e.Fp), Z(e, {
            n: "bigint",
            h: "bigint",
            Gx: "field",
            Gy: "field"
        }, {
            nBitLength: "isSafeInteger",
            nByteLength: "isSafeInteger"
        }), Object.freeze({ ...X(e.n, e.nBitLength),
            ...e,
            ...{
                p: e.Fp.ORDER
            }
        })
    }

    function ec(e) {
        void 0 !== e.lowS && g("lowS", e.lowS), void 0 !== e.prehash && g("prehash", e.prehash)
    }
    let eh = {
            Err: class extends Error {
                constructor(e = "") {
                    super(e)
                }
            },
            _tlv: {
                encode: (e, t) => {
                    let {
                        Err: r
                    } = eh;
                    if (e < 0 || e > 256) throw new r("tlv.encode: wrong tag");
                    if (1 & t.length) throw new r("tlv.encode: unpadded data");
                    let n = t.length / 2,
                        i = p(n);
                    if (i.length / 2 & 128) throw new r("tlv.encode: long form length too big");
                    let o = n > 127 ? p(i.length / 2 | 128) : "";
                    return p(e) + o + i + t
                },
                decode(e, t) {
                    let {
                        Err: r
                    } = eh, n = 0;
                    if (e < 0 || e > 256) throw new r("tlv.encode: wrong tag");
                    if (t.length < 2 || t[n++] !== e) throw new r("tlv.decode: wrong tlv");
                    let i = t[n++],
                        o = 0;
                    if (128 & i) {
                        let e = 127 & i;
                        if (!e) throw new r("tlv.decode(long): indefinite length not supported");
                        if (e > 4) throw new r("tlv.decode(long): byte length is too big");
                        let f = t.subarray(n, n + e);
                        if (f.length !== e) throw new r("tlv.decode: length bytes not complete");
                        if (0 === f[0]) throw new r("tlv.decode(long): zero leftmost byte");
                        for (let e of f) o = o << 8 | e;
                        if (n += e, o < 128) throw new r("tlv.decode(long): not minimal encoding")
                    } else o = i;
                    let f = t.subarray(n, n + o);
                    if (f.length !== o) throw new r("tlv.decode: wrong value length");
                    return {
                        v: f,
                        l: t.subarray(n + o)
                    }
                }
            },
            _int: {
                encode(e) {
                    let {
                        Err: t
                    } = eh;
                    if (e < eg) throw new t("integer: negative integers are not allowed");
                    let r = p(e);
                    if (8 & Number.parseInt(r[0], 16) && (r = "00" + r), 1 & r.length) throw new t("unexpected DER parsing assertion: unpadded hex");
                    return r
                },
                decode(e) {
                    let {
                        Err: t
                    } = eh;
                    if (128 & e[0]) throw new t("invalid signature integer: negative");
                    if (0 === e[0] && !(128 & e[1])) throw new t("invalid signature integer: unnecessary leading zero");
                    return B(e)
                }
            },
            toSig(e) {
                let {
                    Err: t,
                    _int: r,
                    _tlv: n
                } = eh, i = S("signature", e), {
                    v: o,
                    l: f
                } = n.decode(48, i);
                if (f.length) throw new t("invalid signature: left bytes after parsing");
                let {
                    v: l,
                    l: a
                } = n.decode(2, o), {
                    v: s,
                    l: u
                } = n.decode(2, a);
                if (u.length) throw new t("invalid signature: left bytes after parsing");
                return {
                    r: r.decode(l),
                    s: r.decode(s)
                }
            },
            hexFromSig(e) {
                let {
                    _tlv: t,
                    _int: r
                } = eh, n = t.encode(2, r.encode(e.r)), i = t.encode(2, r.encode(e.s));
                return t.encode(48, n + i)
            }
        },
        eg = BigInt(0),
        ep = BigInt(1),
        em = BigInt(2),
        ey = BigInt(3),
        ew = BigInt(4),
        eb = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
        eE = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
        ev = BigInt(0),
        eB = BigInt(1),
        ex = BigInt(2),
        eA = (e, t) => (e + t / ex) / t,
        eO = $(eb, void 0, void 0, {
            sqrt: function(e) {
                let t = BigInt(3),
                    r = BigInt(6),
                    n = BigInt(11),
                    i = BigInt(22),
                    o = BigInt(23),
                    f = BigInt(44),
                    l = BigInt(88),
                    a = e * e * e % eb,
                    s = a * a * e % eb,
                    u = K(s, t, eb) * s % eb,
                    d = K(u, t, eb) * s % eb,
                    c = K(d, ex, eb) * a % eb,
                    h = K(c, n, eb) * c % eb,
                    g = K(h, i, eb) * h % eb,
                    p = K(g, f, eb) * g % eb,
                    m = K(p, l, eb) * p % eb,
                    y = K(m, f, eb) * g % eb,
                    w = K(y, t, eb) * s % eb,
                    b = K(w, o, eb) * h % eb,
                    E = K(b, r, eb) * a % eb,
                    v = K(E, ex, eb);
                if (!eO.eql(eO.sqr(v), e)) throw Error("Cannot find square root");
                return v
            }
        }),
        eS = (n = {
            a: ev,
            b: BigInt(7),
            Fp: eO,
            n: eE,
            Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
            Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
            h: BigInt(1),
            lowS: !0,
            endo: {
                beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
                splitScalar: e => {
                    let t = BigInt("0x3086d221a7d46bcde86c90e49284eb15"),
                        r = -eB * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),
                        n = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),
                        i = BigInt("0x100000000000000000000000000000000"),
                        o = eA(t * e, eE),
                        f = eA(-r * e, eE),
                        l = k(e - o * t - f * n, eE),
                        a = k(-o * r - f * t, eE),
                        s = l > i,
                        u = a > i;
                    if (s && (l = eE - l), u && (a = eE - a), l > i || a > i) throw Error("splitScalar: Endomorphism failed, k=" + e);
                    return {
                        k1neg: s,
                        k1: l,
                        k2neg: u,
                        k2: a
                    }
                }
            }
        }, i = o.sha256, { ...(t = e => (function(e) {
                let t, r = (Z(t = ed(e), {
                        hash: "hash",
                        hmac: "function",
                        randomBytes: "function"
                    }, {
                        bits2int: "function",
                        bits2int_modN: "function",
                        lowS: "boolean"
                    }), Object.freeze({
                        lowS: !0,
                        ...t
                    })),
                    {
                        Fp: n,
                        n: i,
                        nByteLength: o,
                        nBitLength: f
                    } = r,
                    l = n.BYTES + 1,
                    a = 2 * n.BYTES + 1;

                function s(e) {
                    return k(e, i)
                }
                let {
                    ProjectivePoint: h,
                    normPrivateKeyToScalar: p,
                    weierstrassEquation: m,
                    isWithinCurveOrder: y
                } = function(e) {
                    var t;
                    let r = function(e) {
                            let t = ed(e);
                            Z(t, {
                                a: "field",
                                b: "field"
                            }, {
                                allowInfinityPoint: "boolean",
                                allowedPrivateKeyLengths: "array",
                                clearCofactor: "function",
                                fromBytes: "function",
                                isTorsionFree: "function",
                                toBytes: "function",
                                wrapPrivateKey: "boolean"
                            });
                            let {
                                endo: r,
                                Fp: n,
                                a: i
                            } = t;
                            if (r) {
                                if (!n.eql(i, n.ZERO)) throw Error("invalid endo: CURVE.a must be 0");
                                if ("object" != typeof r || "bigint" != typeof r.beta || "function" != typeof r.splitScalar) throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')
                            }
                            return Object.freeze({ ...t
                            })
                        }(e),
                        {
                            Fp: n
                        } = r,
                        i = $(r.n, r.nBitLength),
                        o = r.toBytes || ((e, t, r) => {
                            let i = t.toAffine();
                            return I(Uint8Array.from([4]), n.toBytes(i.x), n.toBytes(i.y))
                        }),
                        f = r.fromBytes || (e => {
                            let t = e.subarray(1);
                            return {
                                x: n.fromBytes(t.subarray(0, n.BYTES)),
                                y: n.fromBytes(t.subarray(n.BYTES, 2 * n.BYTES))
                            }
                        });

                    function l(e) {
                        let {
                            a: t,
                            b: i
                        } = r, o = n.sqr(e), f = n.mul(o, e);
                        return n.add(n.add(f, n.mul(e, t)), i)
                    }

                    function a(e, t) {
                        let r = n.sqr(t),
                            i = l(e);
                        return n.eql(r, i)
                    }
                    if (!a(r.Gx, r.Gy)) throw Error("bad curve params: generator point");
                    let s = n.mul(n.pow(r.a, ey), ew),
                        h = n.mul(n.sqr(r.b), BigInt(27));
                    if (n.is0(n.add(s, h))) throw Error("bad curve params: a or b");

                    function p(e) {
                        let t, {
                            allowedPrivateKeyLengths: n,
                            nByteLength: i,
                            wrapPrivateKey: o,
                            n: f
                        } = r;
                        if (n && "bigint" != typeof e) {
                            if (c(e) && (e = b(e)), "string" != typeof e || !n.includes(e.length)) throw Error("invalid private key");
                            e = e.padStart(2 * i, "0")
                        }
                        try {
                            t = "bigint" == typeof e ? e : B(S("private key", e, i))
                        } catch (t) {
                            throw Error("invalid private key, expected hex or " + i + " bytes, got " + typeof e)
                        }
                        return o && (t = k(t, f)), N("private key", t, ep, f), t
                    }

                    function m(e) {
                        if (!(e instanceof E)) throw Error("ProjectivePoint expected")
                    }
                    let y = z((e, t) => {
                            let {
                                px: r,
                                py: i,
                                pz: o
                            } = e;
                            if (n.eql(o, n.ONE)) return {
                                x: r,
                                y: i
                            };
                            let f = e.is0();
                            null == t && (t = f ? n.ONE : n.inv(o));
                            let l = n.mul(r, t),
                                a = n.mul(i, t),
                                s = n.mul(o, t);
                            if (f) return {
                                x: n.ZERO,
                                y: n.ZERO
                            };
                            if (!n.eql(s, n.ONE)) throw Error("invZ was invalid");
                            return {
                                x: l,
                                y: a
                            }
                        }),
                        w = z(e => {
                            if (e.is0()) {
                                if (r.allowInfinityPoint && !n.is0(e.py)) return;
                                throw Error("bad point: ZERO")
                            }
                            let {
                                x: t,
                                y: i
                            } = e.toAffine();
                            if (!n.isValid(t) || !n.isValid(i)) throw Error("bad point: x or y not FE");
                            if (!a(t, i)) throw Error("bad point: equation left != right");
                            if (!e.isTorsionFree()) throw Error("bad point: not in prime-order subgroup");
                            return !0
                        });
                    class E {
                        constructor(e, t, r) {
                            if (null == e || !n.isValid(e)) throw Error("x required");
                            if (null == t || !n.isValid(t) || n.is0(t)) throw Error("y required");
                            if (null == r || !n.isValid(r)) throw Error("z required");
                            this.px = e, this.py = t, this.pz = r, Object.freeze(this)
                        }
                        static fromAffine(e) {
                            let {
                                x: t,
                                y: r
                            } = e || {};
                            if (!e || !n.isValid(t) || !n.isValid(r)) throw Error("invalid affine point");
                            if (e instanceof E) throw Error("projective point not allowed");
                            let i = e => n.eql(e, n.ZERO);
                            return i(t) && i(r) ? E.ZERO : new E(t, r, n.ONE)
                        }
                        get x() {
                            return this.toAffine().x
                        }
                        get y() {
                            return this.toAffine().y
                        }
                        static normalizeZ(e) {
                            let t = J(n, e.map(e => e.pz));
                            return e.map((e, r) => e.toAffine(t[r])).map(E.fromAffine)
                        }
                        static fromHex(e) {
                            let t = E.fromAffine(f(S("pointHex", e)));
                            return t.assertValidity(), t
                        }
                        static fromPrivateKey(e) {
                            return E.BASE.multiply(p(e))
                        }
                        static msm(e, t) {
                            return function(e, t, r, n) {
                                if (!Array.isArray(r)) throw Error("array expected");
                                r.forEach((t, r) => {
                                    if (!(t instanceof e)) throw Error("invalid point at index " + r)
                                });
                                if (!Array.isArray(n)) throw Error("array of scalars expected");
                                n.forEach((e, r) => {
                                    if (!t.isValid(e)) throw Error("invalid scalar at index " + r)
                                });
                                let i = r.length,
                                    o = n.length;
                                if (i !== o) throw Error("arrays of points and scalars must have equal length");
                                let f = e.ZERO,
                                    l = function(e) {
                                        let t;
                                        for (t = 0; e > u; e >>= d, t += 1);
                                        return t
                                    }(BigInt(i)),
                                    a = 1;
                                l > 12 ? a = l - 3 : l > 4 ? a = l - 2 : l > 0 && (a = 2);
                                let s = H(a),
                                    c = Array(Number(s) + 1).fill(f),
                                    h = Math.floor((t.BITS - 1) / a) * a,
                                    g = f;
                                for (let e = h; e >= 0; e -= a) {
                                    c.fill(f);
                                    for (let t = 0; t < o; t++) {
                                        let i = Number(n[t] >> BigInt(e) & s);
                                        c[i] = c[i].add(r[t])
                                    }
                                    let t = f;
                                    for (let e = c.length - 1, r = f; e > 0; e--) r = r.add(c[e]), t = t.add(r);
                                    if (g = g.add(t), 0 !== e)
                                        for (let e = 0; e < a; e++) g = g.double()
                                }
                                return g
                            }(E, i, e, t)
                        }
                        _setWindowSize(e) {
                            A.setWindowSize(this, e)
                        }
                        assertValidity() {
                            w(this)
                        }
                        hasEvenY() {
                            let {
                                y: e
                            } = this.toAffine();
                            if (n.isOdd) return !n.isOdd(e);
                            throw Error("Field doesn't support isOdd")
                        }
                        equals(e) {
                            m(e);
                            let {
                                px: t,
                                py: r,
                                pz: i
                            } = this, {
                                px: o,
                                py: f,
                                pz: l
                            } = e, a = n.eql(n.mul(t, l), n.mul(o, i)), s = n.eql(n.mul(r, l), n.mul(f, i));
                            return a && s
                        }
                        negate() {
                            return new E(this.px, n.neg(this.py), this.pz)
                        }
                        double() {
                            let {
                                a: e,
                                b: t
                            } = r, i = n.mul(t, ey), {
                                px: o,
                                py: f,
                                pz: l
                            } = this, a = n.ZERO, s = n.ZERO, u = n.ZERO, d = n.mul(o, o), c = n.mul(f, f), h = n.mul(l, l), g = n.mul(o, f);
                            return g = n.add(g, g), u = n.mul(o, l), u = n.add(u, u), a = n.mul(e, u), s = n.mul(i, h), s = n.add(a, s), a = n.sub(c, s), s = n.add(c, s), s = n.mul(a, s), a = n.mul(g, a), u = n.mul(i, u), h = n.mul(e, h), g = n.sub(d, h), g = n.mul(e, g), g = n.add(g, u), u = n.add(d, d), d = n.add(u, d), d = n.add(d, h), d = n.mul(d, g), s = n.add(s, d), h = n.mul(f, l), h = n.add(h, h), d = n.mul(h, g), a = n.sub(a, d), u = n.mul(h, c), u = n.add(u, u), new E(a, s, u = n.add(u, u))
                        }
                        add(e) {
                            m(e);
                            let {
                                px: t,
                                py: i,
                                pz: o
                            } = this, {
                                px: f,
                                py: l,
                                pz: a
                            } = e, s = n.ZERO, u = n.ZERO, d = n.ZERO, c = r.a, h = n.mul(r.b, ey), g = n.mul(t, f), p = n.mul(i, l), y = n.mul(o, a), w = n.add(t, i), b = n.add(f, l);
                            w = n.mul(w, b), b = n.add(g, p), w = n.sub(w, b), b = n.add(t, o);
                            let v = n.add(f, a);
                            return b = n.mul(b, v), v = n.add(g, y), b = n.sub(b, v), v = n.add(i, o), s = n.add(l, a), v = n.mul(v, s), s = n.add(p, y), v = n.sub(v, s), d = n.mul(c, b), s = n.mul(h, y), d = n.add(s, d), s = n.sub(p, d), d = n.add(p, d), u = n.mul(s, d), p = n.add(g, g), p = n.add(p, g), y = n.mul(c, y), b = n.mul(h, b), p = n.add(p, y), y = n.sub(g, y), y = n.mul(c, y), b = n.add(b, y), g = n.mul(p, b), u = n.add(u, g), g = n.mul(v, b), s = n.mul(w, s), s = n.sub(s, g), g = n.mul(w, p), d = n.mul(v, d), new E(s, u, d = n.add(d, g))
                        }
                        subtract(e) {
                            return this.add(e.negate())
                        }
                        is0() {
                            return this.equals(E.ZERO)
                        }
                        wNAF(e) {
                            return A.wNAFCached(this, e, E.normalizeZ)
                        }
                        multiplyUnsafe(e) {
                            let {
                                endo: t,
                                n: i
                            } = r;
                            N("scalar", e, eg, i);
                            let o = E.ZERO;
                            if (e === eg) return o;
                            if (this.is0() || e === ep) return this;
                            if (!t || A.hasPrecomputes(this)) return A.wNAFCachedUnsafe(this, e, E.normalizeZ);
                            let {
                                k1neg: f,
                                k1: l,
                                k2neg: a,
                                k2: s
                            } = t.splitScalar(e), u = o, d = o, c = this;
                            for (; l > eg || s > eg;) l & ep && (u = u.add(c)), s & ep && (d = d.add(c)), c = c.double(), l >>= ep, s >>= ep;
                            return f && (u = u.negate()), a && (d = d.negate()), d = new E(n.mul(d.px, t.beta), d.py, d.pz), u.add(d)
                        }
                        multiply(e) {
                            let t, i, {
                                endo: o,
                                n: f
                            } = r;
                            if (N("scalar", e, ep, f), o) {
                                let {
                                    k1neg: r,
                                    k1: f,
                                    k2neg: l,
                                    k2: a
                                } = o.splitScalar(e), {
                                    p: s,
                                    f: u
                                } = this.wNAF(f), {
                                    p: d,
                                    f: c
                                } = this.wNAF(a);
                                s = A.constTimeNegate(r, s), d = A.constTimeNegate(l, d), d = new E(n.mul(d.px, o.beta), d.py, d.pz), t = s.add(d), i = u.add(c)
                            } else {
                                let {
                                    p: r,
                                    f: n
                                } = this.wNAF(e);
                                t = r, i = n
                            }
                            return E.normalizeZ([t, i])[0]
                        }
                        multiplyAndAddUnsafe(e, t, r) {
                            let n = E.BASE,
                                i = (e, t) => t !== eg && t !== ep && e.equals(n) ? e.multiply(t) : e.multiplyUnsafe(t),
                                o = i(this, t).add(i(e, r));
                            return o.is0() ? void 0 : o
                        }
                        toAffine(e) {
                            return y(this, e)
                        }
                        isTorsionFree() {
                            let {
                                h: e,
                                isTorsionFree: t
                            } = r;
                            if (e === ep) return !0;
                            if (t) return t(E, this);
                            throw Error("isTorsionFree() has not been declared for the elliptic curve")
                        }
                        clearCofactor() {
                            let {
                                h: e,
                                clearCofactor: t
                            } = r;
                            return e === ep ? this : t ? t(E, this) : this.multiplyUnsafe(r.h)
                        }
                        toRawBytes(e = !0) {
                            return g("isCompressed", e), this.assertValidity(), o(E, this, e)
                        }
                        toHex(e = !0) {
                            return g("isCompressed", e), b(this.toRawBytes(e))
                        }
                    }
                    E.BASE = new E(r.Gx, r.Gy, n.ONE), E.ZERO = new E(n.ZERO, n.ONE, n.ZERO);
                    let {
                        endo: v,
                        nBitLength: x
                    } = r, A = (t = v ? Math.ceil(x / 2) : x, {
                        constTimeNegate: ei,
                        hasPrecomputes: e => 1 !== eu(e),
                        unsafeLadder(e, t, r = E.ZERO) {
                            let n = e;
                            for (; t > er;) t & en && (r = r.add(n)), n = n.double(), t >>= en;
                            return r
                        },
                        precomputeWindow(e, r) {
                            let {
                                windows: n,
                                windowSize: i
                            } = ef(r, t), o = [], f = e, l = f;
                            for (let e = 0; e < n; e++) {
                                l = f, o.push(l);
                                for (let e = 1; e < i; e++) l = l.add(f), o.push(l);
                                f = l.double()
                            }
                            return o
                        },
                        wNAF(e, r, n) {
                            let i = E.ZERO,
                                o = E.BASE,
                                f = ef(e, t);
                            for (let e = 0; e < f.windows; e++) {
                                let {
                                    nextN: t,
                                    offset: l,
                                    isZero: a,
                                    isNeg: s,
                                    isNegF: u,
                                    offsetF: d
                                } = el(n, e, f);
                                n = t, a ? o = o.add(ei(u, r[d])) : i = i.add(ei(s, r[l]))
                            }
                            return {
                                p: i,
                                f: o
                            }
                        },
                        wNAFUnsafe(e, r, n, i = E.ZERO) {
                            let o = ef(e, t);
                            for (let e = 0; e < o.windows && n !== er; e++) {
                                let {
                                    nextN: t,
                                    offset: f,
                                    isZero: l,
                                    isNeg: a
                                } = el(n, e, o);
                                if (n = t, !l) {
                                    let e = r[f];
                                    i = i.add(a ? e.negate() : e)
                                }
                            }
                            return i
                        },
                        getPrecomputes(e, t, r) {
                            let n = ea.get(t);
                            return n || (n = this.precomputeWindow(t, e), 1 !== e && ea.set(t, r(n))), n
                        },
                        wNAFCached(e, t, r) {
                            let n = eu(e);
                            return this.wNAF(n, this.getPrecomputes(n, e, r), t)
                        },
                        wNAFCachedUnsafe(e, t, r, n) {
                            let i = eu(e);
                            return 1 === i ? this.unsafeLadder(e, t, n) : this.wNAFUnsafe(i, this.getPrecomputes(i, e, r), t, n)
                        },
                        setWindowSize(e, r) {
                            eo(r, t), es.set(e, r), ea.delete(e)
                        }
                    });
                    return {
                        CURVE: r,
                        ProjectivePoint: E,
                        normPrivateKeyToScalar: p,
                        weierstrassEquation: l,
                        isWithinCurveOrder: function(e) {
                            return q(e, ep, r.n)
                        }
                    }
                }({ ...r,
                    toBytes(e, t, r) {
                        let i = t.toAffine(),
                            o = n.toBytes(i.x);
                        return (g("isCompressed", r), r) ? I(Uint8Array.from([t.hasEvenY() ? 2 : 3]), o) : I(Uint8Array.from([4]), o, n.toBytes(i.y))
                    },
                    fromBytes(e) {
                        let t = e.length,
                            r = e[0],
                            i = e.subarray(1);
                        if (t === l && (2 === r || 3 === r)) {
                            let e, t = B(i);
                            if (!q(t, ep, n.ORDER)) throw Error("Point is not on curve");
                            let o = m(t);
                            try {
                                e = n.sqrt(o)
                            } catch (e) {
                                throw Error("Point is not on curve" + (e instanceof Error ? ": " + e.message : ""))
                            }
                            return (1 & r) == 1 != ((e & ep) === ep) && (e = n.neg(e)), {
                                x: t,
                                y: e
                            }
                        }
                        if (t === a && 4 === r) return {
                            x: n.fromBytes(i.subarray(0, n.BYTES)),
                            y: n.fromBytes(i.subarray(n.BYTES, 2 * n.BYTES))
                        };
                        throw Error("invalid Point, expected length of " + l + ", or uncompressed " + a + ", got " + t)
                    }
                }), w = (e, t, r) => B(e.slice(t, r));
                class E {
                    constructor(e, t, r) {
                        N("r", e, ep, i), N("s", t, ep, i), this.r = e, this.s = t, null != r && (this.recovery = r), Object.freeze(this)
                    }
                    static fromCompact(e) {
                        return new E(w(e = S("compactSignature", e, 2 * o), 0, o), w(e, o, 2 * o))
                    }
                    static fromDER(e) {
                        let {
                            r: t,
                            s: r
                        } = eh.toSig(S("DER", e));
                        return new E(t, r)
                    }
                    assertValidity() {}
                    addRecoveryBit(e) {
                        return new E(this.r, this.s, e)
                    }
                    recoverPublicKey(e) {
                        let {
                            r: t,
                            s: o,
                            recovery: f
                        } = this, l = F(S("msgHash", e));
                        if (null == f || ![0, 1, 2, 3].includes(f)) throw Error("recovery id invalid");
                        let a = 2 === f || 3 === f ? t + r.n : t;
                        if (a >= n.ORDER) throw Error("recovery id 2 or 3 invalid");
                        let u = (1 & f) == 0 ? "02" : "03",
                            d = h.fromHex(u + b(A(a, n.BYTES))),
                            c = _(a, i),
                            g = s(-l * c),
                            p = s(o * c),
                            m = h.BASE.multiplyAndAddUnsafe(d, g, p);
                        if (!m) throw Error("point at infinify");
                        return m.assertValidity(), m
                    }
                    hasHighS() {
                        return this.s > i >> ep
                    }
                    normalizeS() {
                        return this.hasHighS() ? new E(this.r, s(-this.s), this.recovery) : this
                    }
                    toDERRawBytes() {
                        return v(this.toDERHex())
                    }
                    toDERHex() {
                        return eh.hexFromSig(this)
                    }
                    toCompactRawBytes() {
                        return v(this.toCompactHex())
                    }
                    toCompactHex() {
                        return b(A(this.r, o)) + b(A(this.s, o))
                    }
                }

                function R(e) {
                    if ("bigint" == typeof e) return !1;
                    if (e instanceof h) return !0;
                    let t = S("key", e).length,
                        i = n.BYTES,
                        f = i + 1;
                    if (!r.allowedPrivateKeyLengths && o !== f) return t === f || t === 2 * i + 1
                }
                let U = r.bits2int || function(e) {
                        if (e.length > 8192) throw Error("input is too large");
                        let t = B(e),
                            r = 8 * e.length - f;
                        return r > 0 ? t >> BigInt(r) : t
                    },
                    F = r.bits2int_modN || function(e) {
                        return s(U(e))
                    },
                    L = H(f);

                function T(e) {
                    return N("num < 2^" + f, e, eg, L), A(e, o)
                }
                let V = {
                        lowS: r.lowS,
                        prehash: !1
                    },
                    j = {
                        lowS: r.lowS,
                        prehash: !1
                    };
                return h.BASE._setWindowSize(8), {
                    CURVE: r,
                    getPublicKey: function(e, t = !0) {
                        return h.fromPrivateKey(e).toRawBytes(t)
                    },
                    getSharedSecret: function(e, t, r = !0) {
                        if (!0 === R(e)) throw Error("first arg must be private key");
                        if (!1 === R(t)) throw Error("second arg must be public key");
                        return h.fromHex(t).multiply(p(e)).toRawBytes(r)
                    },
                    sign: function(e, t, o = V) {
                        let {
                            seed: f,
                            k2sig: l
                        } = function(e, t, o = V) {
                            if (["recovered", "canonical"].some(e => e in o)) throw Error("sign() legacy options not supported");
                            let {
                                hash: f,
                                randomBytes: l
                            } = r, {
                                lowS: a,
                                prehash: u,
                                extraEntropy: d
                            } = o;
                            null == a && (a = !0), e = S("msgHash", e), ec(o), u && (e = S("prehashed msgHash", f(e)));
                            let c = F(e),
                                g = p(t),
                                m = [T(g), T(c)];
                            if (null != d && !1 !== d) {
                                let e = !0 === d ? l(n.BYTES) : d;
                                m.push(S("extraEntropy", e))
                            }
                            return {
                                seed: I(...m),
                                k2sig: function(e) {
                                    var t;
                                    let r = U(e);
                                    if (!y(r)) return;
                                    let n = _(r, i),
                                        o = h.BASE.multiply(r).toAffine(),
                                        f = s(o.x);
                                    if (f === eg) return;
                                    let l = s(n * s(c + f * g));
                                    if (l === eg) return;
                                    let u = 2 * (o.x !== f) | Number(o.y & ep),
                                        d = l;
                                    return a && l > i >> ep && (d = (t = l) > i >> ep ? s(-t) : t, u ^= 1), new E(f, d, u)
                                }
                            }
                        }(e, t, o);
                        return (function(e, t, r) {
                            if ("number" != typeof e || e < 2) throw Error("hashLen must be a number");
                            if ("number" != typeof t || t < 2) throw Error("qByteLen must be a number");
                            if ("function" != typeof r) throw Error("hmacFn must be a function");
                            let n = P(e),
                                i = P(e),
                                o = 0,
                                f = () => {
                                    n.fill(1), i.fill(0), o = 0
                                },
                                l = (...e) => r(i, n, ...e),
                                a = (e = P(0)) => {
                                    let t;
                                    if (i = l((t = [0], Uint8Array.from(t)), e), n = l(), 0 !== e.length) {
                                        let t;
                                        i = l((t = [1], Uint8Array.from(t)), e), n = l()
                                    }
                                },
                                s = () => {
                                    if (o++ >= 1e3) throw Error("drbg: tried 1000 values");
                                    let e = 0,
                                        r = [];
                                    for (; e < t;) {
                                        let t = (n = l()).slice();
                                        r.push(t), e += n.length
                                    }
                                    return I(...r)
                                };
                            return (e, t) => {
                                let r;
                                for (f(), a(e); !(r = t(s()));) a();
                                return f(), r
                            }
                        })(r.hash.outputLen, r.nByteLength, r.hmac)(f, l)
                    },
                    verify: function(e, t, n, o = j) {
                        let f, l;
                        t = S("msgHash", t), n = S("publicKey", n);
                        let {
                            lowS: a,
                            prehash: u,
                            format: d
                        } = o;
                        if (ec(o), "strict" in o) throw Error("options.strict was renamed to lowS");
                        if (void 0 !== d && "compact" !== d && "der" !== d) throw Error("format must be compact or der");
                        let g = "string" == typeof e || c(e),
                            p = !g && !d && "object" == typeof e && null !== e && "bigint" == typeof e.r && "bigint" == typeof e.s;
                        if (!g && !p) throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");
                        try {
                            if (p && (l = new E(e.r, e.s)), g) {
                                try {
                                    "compact" !== d && (l = E.fromDER(e))
                                } catch (e) {
                                    if (!(e instanceof eh.Err)) throw e
                                }
                                l || "der" === d || (l = E.fromCompact(e))
                            }
                            f = h.fromHex(n)
                        } catch (e) {
                            return !1
                        }
                        if (!l || a && l.hasHighS()) return !1;
                        u && (t = r.hash(t));
                        let {
                            r: m,
                            s: y
                        } = l, w = F(t), b = _(y, i), v = s(w * b), B = s(m * b), x = h.BASE.multiplyAndAddUnsafe(f, v, B) ? .toAffine();
                        return !!x && s(x.x) === m
                    },
                    ProjectivePoint: h,
                    Signature: E,
                    utils: {
                        isValidPrivateKey(e) {
                            try {
                                return p(e), !0
                            } catch (e) {
                                return !1
                            }
                        },
                        normPrivateKeyToScalar: p,
                        randomPrivateKey: () => {
                            let e = et(r.n);
                            return function(e, t, r = !1) {
                                let n = e.length,
                                    i = ee(t),
                                    o = et(t);
                                if (n < 16 || n < o || n > 1024) throw Error("expected " + o + "-1024 bytes of input, got " + n);
                                let f = k(r ? x(e) : B(e), t - C) + C;
                                return r ? O(f, i) : A(f, i)
                            }(r.randomBytes(e), r.n)
                        },
                        precompute: (e = 8, t = h.BASE) => (t._setWindowSize(e), t.multiply(BigInt(3)), t)
                    }
                }
            })({ ...n,
                ...{
                    hash: e,
                    hmac: (t, ...r) => s(e, t, (0, f.concatBytes)(...r)),
                    randomBytes: f.randomBytes
                }
            }))(i),
            create: t
        });
    eS.ProjectivePoint;
    let eI = (r = [
            ["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7", "0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581", "0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262", "0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],
            ["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b", "0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14", "0x0000000000000000000000000000000000000000000000000000000000000001"],
            ["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c", "0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3", "0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931", "0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],
            ["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b", "0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573", "0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f", "0x0000000000000000000000000000000000000000000000000000000000000001"]
        ].map(e => e.map(e => BigInt(e))).map(e => Array.from(e).reverse()), (e, t) => {
            let [n, i, o, f] = r.map(t => t.reduce((t, r) => eO.add(eO.mul(t, e), r))), [l, a] = J(eO, [i, f], !0);
            return e = eO.mul(n, l), t = eO.mul(t, eO.mul(o, a)), {
                x: e,
                y: t
            }
        }),
        eR = function(e, t) {
            if (G(e), !e.isValid(t.A) || !e.isValid(t.B) || !e.isValid(t.Z)) throw Error("mapToCurveSimpleSWU: invalid opts");
            let r = function(e, t) {
                let r = e.ORDER,
                    n = eg;
                for (let e = r - ep; e % em === eg; e /= em) n += ep;
                let i = n,
                    o = em << i - ep - ep,
                    f = o * em,
                    l = (r - ep) / f,
                    a = (l - ep) / em,
                    s = f - ep,
                    u = e.pow(t, l),
                    d = e.pow(t, (l + ep) / em),
                    c = (t, r) => {
                        let n = u,
                            f = e.pow(r, s),
                            l = e.sqr(f);
                        l = e.mul(l, r);
                        let c = e.mul(t, l);
                        c = e.pow(c, a), c = e.mul(c, f), f = e.mul(c, r), l = e.mul(c, t);
                        let h = e.mul(l, f);
                        c = e.pow(h, o);
                        let g = e.eql(c, e.ONE);
                        f = e.mul(l, d), c = e.mul(h, n), l = e.cmov(f, l, g), h = e.cmov(c, h, g);
                        for (let t = i; t > ep; t--) {
                            let r = t - em;
                            r = em << r - ep;
                            let i = e.pow(h, r),
                                o = e.eql(i, e.ONE);
                            f = e.mul(l, n), n = e.mul(n, n), i = e.mul(h, n), l = e.cmov(f, l, o), h = e.cmov(i, h, o)
                        }
                        return {
                            isValid: g,
                            value: l
                        }
                    };
                if (e.ORDER % ew === ey) {
                    let r = (e.ORDER - ey) / ew,
                        n = e.sqrt(e.neg(t));
                    c = (t, i) => {
                        let o = e.sqr(i),
                            f = e.mul(t, i);
                        o = e.mul(o, f);
                        let l = e.pow(o, r);
                        l = e.mul(l, f);
                        let a = e.mul(l, n),
                            s = e.mul(e.sqr(l), i),
                            u = e.eql(s, t),
                            d = e.cmov(a, l, u);
                        return {
                            isValid: u,
                            value: d
                        }
                    }
                }
                return c
            }(e, t.Z);
            if (!e.isOdd) throw Error("Fp.isOdd is not implemented!");
            return n => {
                let i, o, f, l, a, s, u, d;
                i = e.sqr(n), i = e.mul(i, t.Z), o = e.sqr(i), o = e.add(o, i), f = e.add(o, e.ONE), f = e.mul(f, t.B), l = e.cmov(t.Z, e.neg(o), !e.eql(o, e.ZERO)), l = e.mul(l, t.A), o = e.sqr(f), s = e.sqr(l), a = e.mul(s, t.A), o = e.add(o, a), o = e.mul(o, f), s = e.mul(s, l), a = e.mul(s, t.B), o = e.add(o, a), u = e.mul(i, f);
                let {
                    isValid: c,
                    value: h
                } = r(o, s);
                d = e.mul(i, n), d = e.mul(d, h), u = e.cmov(u, f, c), d = e.cmov(d, h, c);
                let g = e.isOdd(n) === e.isOdd(d);
                d = e.cmov(e.neg(d), d, g);
                let p = J(e, [l], !0)[0];
                return {
                    x: u = e.mul(u, p),
                    y: d
                }
            }
        }(eO, {
            A: BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),
            B: BigInt("1771"),
            Z: eO.create(BigInt("-11"))
        });
    (function(e, t, r) {
        if ("function" != typeof t) throw Error("mapToCurve() must be defined")
    })(eS.ProjectivePoint, e => {
        let {
            x: t,
            y: r
        } = eR(eO.create(e[0]));
        return eI(t, r)
    }, (eO.ORDER, o.sha256)), e.s(["secp256k1", 0, eS], 368089)
}]);

//# debugId=8391b442-27b7-6778-ee8f-1596bae4ca21