;
! 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] = "1bda5105-61bf-1997-e40a-56a34d110ede")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 857224, e => {
    "use strict";
    let t;
    var s = e.i(492005),
        i = e.i(613532),
        a = e.i(93257),
        n = e.i(764806),
        r = e.i(189608),
        o = e.i(360028);

    function c(e) {
        return null == e || "object" != typeof e && "function" != typeof e
    }

    function h(e) {
        return ArrayBuffer.isView(e) && !(e instanceof DataView)
    }

    function l(e, t, s, i = new Map, n) {
        let d = n ? .(e, t, s, i);
        if (void 0 !== d) return d;
        if (c(e)) return e;
        if (i.has(e)) return i.get(e);
        if (Array.isArray(e)) {
            let t = Array(e.length);
            i.set(e, t);
            for (let a = 0; a < e.length; a++) t[a] = l(e[a], a, s, i, n);
            return Object.hasOwn(e, "index") && (t.index = e.index), Object.hasOwn(e, "input") && (t.input = e.input), t
        }
        if (e instanceof Date) return new Date(e.getTime());
        if (e instanceof RegExp) {
            let t = new RegExp(e.source, e.flags);
            return t.lastIndex = e.lastIndex, t
        }
        if (e instanceof Map) {
            let t = new Map;
            for (let [a, r] of (i.set(e, t), e)) t.set(a, l(r, a, s, i, n));
            return t
        }
        if (e instanceof Set) {
            let t = new Set;
            for (let a of (i.set(e, t), e)) t.add(l(a, void 0, s, i, n));
            return t
        }
        if (void 0 !== a.Buffer && a.Buffer.isBuffer(e)) return e.subarray();
        if (h(e)) {
            let t = new(Object.getPrototypeOf(e)).constructor(e.length);
            i.set(e, t);
            for (let a = 0; a < e.length; a++) t[a] = l(e[a], a, s, i, n);
            return t
        }
        if (e instanceof ArrayBuffer || "u" > typeof SharedArrayBuffer && e instanceof SharedArrayBuffer) return e.slice(0);
        if (e instanceof DataView) {
            let t = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
            return i.set(e, t), p(t, e, s, i, n), t
        }
        if ("u" > typeof File && e instanceof File) {
            let t = new File([e], e.name, {
                type: e.type
            });
            return i.set(e, t), p(t, e, s, i, n), t
        }
        if ("u" > typeof Blob && e instanceof Blob) {
            let t = new Blob([e], {
                type: e.type
            });
            return i.set(e, t), p(t, e, s, i, n), t
        }
        if (e instanceof Error) {
            let t = new e.constructor;
            return i.set(e, t), t.message = e.message, t.name = e.name, t.stack = e.stack, t.cause = e.cause, p(t, e, s, i, n), t
        }
        if (e instanceof Boolean) {
            let t = new Boolean(e.valueOf());
            return i.set(e, t), p(t, e, s, i, n), t
        }
        if (e instanceof Number) {
            let t = new Number(e.valueOf());
            return i.set(e, t), p(t, e, s, i, n), t
        }
        if (e instanceof String) {
            let t = new String(e.valueOf());
            return i.set(e, t), p(t, e, s, i, n), t
        }
        if ("object" == typeof e && function(e) {
                switch ((0, r.getTag)(e)) {
                    case o.argumentsTag:
                    case o.arrayTag:
                    case o.arrayBufferTag:
                    case o.dataViewTag:
                    case o.booleanTag:
                    case o.dateTag:
                    case o.float32ArrayTag:
                    case o.float64ArrayTag:
                    case o.int8ArrayTag:
                    case o.int16ArrayTag:
                    case o.int32ArrayTag:
                    case o.mapTag:
                    case o.numberTag:
                    case o.objectTag:
                    case o.regexpTag:
                    case o.setTag:
                    case o.stringTag:
                    case o.symbolTag:
                    case o.uint8ArrayTag:
                    case o.uint8ClampedArrayTag:
                    case o.uint16ArrayTag:
                    case o.uint32ArrayTag:
                        return !0;
                    default:
                        return !1
                }
            }(e)) {
            let t = Object.create(Object.getPrototypeOf(e));
            return i.set(e, t), p(t, e, s, i, n), t
        }
        return e
    }

    function p(e, t, s = e, i, a) {
        let r = [...Object.keys(t), ...(0, n.getSymbols)(t)];
        for (let n = 0; n < r.length; n++) {
            let o = r[n],
                c = Object.getOwnPropertyDescriptor(e, o);
            (null == c || c.writable) && (e[o] = l(t[o], o, s, i, a))
        }
    }

    function d(e) {
        var t;
        return t = (t, s, i, a) => {
            let n;
            if (void 0 !== n) return n;
            if ("object" == typeof e) {
                if ((0, r.getTag)(e) === o.objectTag && "function" != typeof e.constructor) {
                    let t = {};
                    return a.set(e, t), p(t, e, i, a), t
                }
                switch (Object.prototype.toString.call(e)) {
                    case o.numberTag:
                    case o.stringTag:
                    case o.booleanTag:
                        {
                            let t = new e.constructor(e ? .valueOf());
                            return p(t, e),
                            t
                        }
                    case o.argumentsTag:
                        {
                            let t = {};
                            return p(t, e),
                            t.length = e.length,
                            t[Symbol.iterator] = e[Symbol.iterator],
                            t
                        }
                    default:
                        return
                }
            }
        }, l(e, void 0, e, new Map, t)
    }

    function u(e) {
        return null !== e && "object" == typeof e && "[object Arguments]" === (0, r.getTag)(e)
    }

    function m(e) {
        return "object" == typeof e && null !== e
    }

    function g(e) {
        if ("object" != typeof e || null == e) return !1;
        if (null === Object.getPrototypeOf(e)) return !0;
        if ("[object Object]" !== Object.prototype.toString.call(e)) {
            let t = e[Symbol.toStringTag];
            return null != t && !!Object.getOwnPropertyDescriptor(e, Symbol.toStringTag) ? .writable && e.toString() === `[object ${t}]`
        }
        let t = e;
        for (; null !== Object.getPrototypeOf(t);) t = Object.getPrototypeOf(t);
        return Object.getPrototypeOf(e) === t
    }
    var f = e.i(168977);
    e.i(578244);
    var w = e.i(309758),
        v = e.i(234939),
        y = e.i(984956),
        C = e.i(379666);
    let I = "error",
        b = "universal_provider",
        P = `wc@2:${b}:`,
        O = "https://rpc.walletconnect.org/v1/",
        E = "generic",
        S = `${O}bundler`,
        A = "call_status",
        j = "default_chain_changed";

    function _(e, t, s) {
        let a = (0, i.parseChainId)(e);
        return t.rpcMap ? .[a.reference] || `${O}?chainId=${a.namespace}:${a.reference}&projectId=${s}`
    }

    function $(e) {
        return e.map(e => `${e.split(":")[0]}:${e.split(":")[1]}`)
    }

    function T(e) {
        return Object.fromEntries(Object.entries(e).filter(([e, t]) => t ? .chains ? .length && t ? .chains ? .length > 0))
    }

    function N(e = {}, t = {}) {
        return function(e, ...t) {
            return function(e, ...t) {
                let s = t.slice(0, -1),
                    i = t[t.length - 1],
                    r = e;
                for (let e = 0; e < s.length; e++) r = function e(t, s, i, r) {
                    if (c(t) && (t = Object(t)), null == s || "object" != typeof s) return t;
                    if (r.has(s)) return function(e) {
                        if (c(e)) return e;
                        if (Array.isArray(e) || h(e) || e instanceof ArrayBuffer || "u" > typeof SharedArrayBuffer && e instanceof SharedArrayBuffer) return e.slice(0);
                        let t = Object.getPrototypeOf(e);
                        if (null == t) return Object.assign(Object.create(t), e);
                        let s = t.constructor;
                        if (e instanceof Date || e instanceof Map || e instanceof Set) return new s(e);
                        if (e instanceof RegExp) {
                            let t = new s(e);
                            return t.lastIndex = e.lastIndex, t
                        }
                        if (e instanceof DataView) return new s(e.buffer.slice(0));
                        if (e instanceof Error) {
                            let t;
                            return (t = e instanceof AggregateError ? new s(e.errors, e.message, {
                                cause: e.cause
                            }) : new s(e.message, {
                                cause: e.cause
                            })).stack = e.stack, Object.assign(t, e), t
                        }
                        return "u" > typeof File && e instanceof File ? new s([e], e.name, {
                            type: e.type,
                            lastModified: e.lastModified
                        }) : "object" == typeof e ? Object.assign(Object.create(t), e) : e
                    }(r.get(s));
                    if (r.set(s, t), Array.isArray(s)) {
                        s = s.slice();
                        for (let e = 0; e < s.length; e++) s[e] = s[e] ? ? void 0
                    }
                    let o = [...Object.keys(s), ...(0, n.getSymbols)(s)];
                    for (let n = 0; n < o.length; n++) {
                        let c = o[n];
                        if ("__proto__" === c) continue;
                        let l = s[c],
                            p = t[c];
                        if (u(l) && (l = { ...l
                            }), u(p) && (p = { ...p
                            }), void 0 !== a.Buffer && a.Buffer.isBuffer(l) && (l = d(l)), Array.isArray(l))
                            if (Array.isArray(p)) {
                                let e = [],
                                    t = Reflect.ownKeys(p);
                                for (let s = 0; s < t.length; s++) {
                                    let i = t[s];
                                    e[i] = p[i]
                                }
                                p = e
                            } else if (function(e) {
                                var t;
                                return m(e) && null != e && "function" != typeof e && Number.isSafeInteger(t = e.length) && t >= 0
                            }(p)) {
                            let e = [];
                            for (let t = 0; t < p.length; t++) e[t] = p[t];
                            p = e
                        } else p = [];
                        let f = i(p, l, c, t, s, r);
                        void 0 !== f ? t[c] = f : Array.isArray(l) || m(p) && m(l) && (g(p) || g(l) || h(p) || h(l)) ? t[c] = e(p, l, i, r) : null == p && g(l) ? t[c] = e({}, l, i, r) : null == p && h(l) ? t[c] = d(l) : (void 0 === p || void 0 !== l) && (t[c] = l)
                    }
                    return t
                }(r, s[e], i, new Map);
                return r
            }(e, ...t, f.noop)
        }(T(q(e)), T(q(t)))
    }

    function q(e) {
        let t = {};
        if (!(0, i.isValidObject)(e)) return t;
        for (let [s, a] of Object.entries(e)) {
            let e = (0, i.isCaipNamespace)(s) ? [s] : a.chains,
                n = a.methods || [],
                r = a.events || [],
                o = a.rpcMap || {},
                c = (0, i.parseNamespaceKey)(s);
            t[c] = { ...t[c],
                ...a,
                chains: (0, i.mergeArrays)(e, t[c] ? .chains),
                methods: (0, i.mergeArrays)(n, t[c] ? .methods),
                events: (0, i.mergeArrays)(r, t[c] ? .events)
            }, ((0, i.isValidObject)(o) || (0, i.isValidObject)(t[c] ? .rpcMap || {})) && (t[c].rpcMap = { ...o,
                ...t[c] ? .rpcMap
            })
        }
        return t
    }

    function x(e) {
        return e.includes(":") ? e.split(":")[2] : e
    }

    function M(e) {
        let t = {};
        for (let [s, a] of Object.entries(e)) {
            let e = a.methods || [],
                n = a.events || [],
                r = a.accounts || [],
                o = (0, i.isCaipNamespace)(s) ? [s] : a.chains ? a.chains : $(a.accounts);
            t[s] = {
                chains: o,
                methods: e,
                events: n,
                accounts: r
            }
        }
        return t
    }

    function R(e) {
        return "number" == typeof e ? e : e.includes("0x") ? parseInt(e, 16) : isNaN(Number(e = e.includes(":") ? e.split(":")[1] : e)) ? e : Number(e)
    }
    let k = {},
        D = e => k[e],
        F = (e, t) => {
            k[e] = t
        },
        W = "eip155",
        U = ["atomic", "flow-control", "paymasterService", "sessionKeys", "auxiliaryFunds"],
        B = e => e && e.startsWith("0x") ? BigInt(e).toString(10) : e,
        H = e => e && e.startsWith("0x") ? e : `0x${BigInt(e).toString(16)}`,
        z = e => Object.keys(e).filter(e => U.includes(e)).reduce((t, s) => (t[s] = V(e[s]), t), {}),
        V = e => "string" == typeof e && function(e) {
            try {
                let t = JSON.parse(e);
                return "object" == typeof t && null !== t && !Array.isArray(t)
            } catch {
                return !1
            }
        }(e) ? JSON.parse(e) : e;
    class K {
        constructor(e) {
            this.storage = e
        }
        async getItem(e) {
            return await this.storage.getItem(e)
        }
        async setItem(e, t) {
            return await this.storage.setItem(e, t)
        }
        async removeItem(e) {
            return await this.storage.removeItem(e)
        }
        static getStorage(e) {
            return t || (t = new K(e)), t
        }
    }
    async function L(e, t) {
        let s, a = (0, i.parseChainId)(e.result.capabilities.caip345.caip2),
            n = e.result.capabilities.caip345.transactionHashes,
            r = await Promise.allSettled(n.map(e => J(a.reference, e, t))),
            o = r.filter(e => "fulfilled" === e.status).map(e => e.value).filter(e => e);
        r.filter(e => "rejected" === e.status).forEach(e => console.warn("Failed to fetch transaction receipt:", e.reason));
        let c = !o.length || o.some(e => !e),
            h = o.every(e => e ? .status === "0x1"),
            l = o.every(e => e ? .status === "0x0"),
            p = o.some(e => e ? .status === "0x0");
        return c ? s = 100 : h ? s = 200 : l ? s = 500 : p && (s = 600), {
            id: e.result.id,
            version: e.request.version,
            atomic: e.request.atomicRequired,
            chainId: e.request.chainId,
            capabilities: e.result.capabilities,
            receipts: o,
            status: s
        }
    }
    async function J(e, t, s) {
        return await s(parseInt(e)).request((0, w.formatJsonRpcRequest)("eth_getTransactionReceipt", [t]))
    }
    async function Q({
        sendCalls: e,
        storage: t
    }) {
        let s = await t.getItem(A);
        await t.setItem(A, { ...s,
            [e.result.id]: {
                request: e.request,
                result: e.result,
                expiry: (0, i.calcExpiry)(86400)
            }
        })
    }
    async function G({
        resultId: e,
        storage: t
    }) {
        let s = await t.getItem(A);
        if (s) {
            for (let a in delete s[e], await t.setItem(A, s), s)(0, i.isExpired)(s[a].expiry) && delete s[a];
            await t.setItem(A, s)
        }
    }
    async function Y({
        resultId: e,
        storage: t
    }) {
        let s = (await t.getItem(A)) ? .[e];
        if (s && !(0, i.isExpired)(s.expiry)) return s;
        await G({
            resultId: e,
            storage: t
        })
    }
    class X {
        constructor(e) {
            this.name = "eip155", this.namespace = e.namespace, this.events = D("events"), this.client = D("client"), this.httpProviders = this.createHttpProviders(), this.chainId = parseInt(this.getDefaultChain()), this.storage = K.getStorage(this.client.core.storage)
        }
        async request(e) {
            switch (e.request.method) {
                case "eth_requestAccounts":
                case "eth_accounts":
                    return this.getAccounts();
                case "wallet_switchEthereumChain":
                    return await this.handleSwitchChain(e);
                case "eth_chainId":
                    return parseInt(this.getDefaultChain());
                case "wallet_getCapabilities":
                    return await this.getCapabilities(e);
                case "wallet_getCallsStatus":
                    return await this.getCallStatus(e);
                case "wallet_sendCalls":
                    return await this.sendCalls(e)
            }
            return this.namespace.methods.includes(e.request.method) ? await this.client.request(e) : this.getHttpProvider().request(e.request)
        }
        updateNamespace(e) {
            this.namespace = Object.assign(this.namespace, e)
        }
        setDefaultChain(e, t) {
            this.httpProviders[e] || this.setHttpProvider(parseInt(e), t);
            let s = this.chainId;
            this.chainId = parseInt(e), this.events.emit(j, {
                currentCaipChainId: `${this.name}:${e}`,
                previousCaipChainId: `${this.name}:${s}`
            })
        }
        requestAccounts() {
            return this.getAccounts()
        }
        getDefaultChain() {
            if (this.chainId) return this.chainId.toString();
            if (this.namespace.defaultChain) return this.namespace.defaultChain;
            let e = this.namespace.chains[0];
            if (!e) throw Error("ChainId not found");
            return e.split(":")[1]
        }
        createHttpProvider(e, t) {
            let s = t || _(`${this.name}:${e}`, this.namespace, this.client.core.projectId);
            return new v.JsonRpcProvider(new y.HttpConnection(s, D("disableProviderPing")))
        }
        setHttpProvider(e, t) {
            let s = this.createHttpProvider(e, t);
            s && (this.httpProviders[e] = s)
        }
        createHttpProviders() {
            let e = {};
            return this.namespace.chains.forEach(t => {
                let s = parseInt(t.includes(":") ? t.split(":")[1] : t);
                e[s] = this.createHttpProvider(s, this.namespace.rpcMap ? .[t])
            }), e
        }
        getAccounts() {
            let e = this.namespace.accounts;
            return e ? [...new Set(e.filter(e => e.split(":")[1] === this.chainId.toString()).map(e => e.split(":")[2]))] : []
        }
        getHttpProvider(e) {
            let t = e || this.chainId;
            return this.httpProviders[t] || (this.httpProviders = { ...this.httpProviders,
                [t]: this.createHttpProvider(t)
            }, this.httpProviders[t])
        }
        async handleSwitchChain(e) {
            let t = e.request.params ? e.request.params[0] ? .chainId : "0x0",
                s = parseInt(t = t.startsWith("0x") ? t : `0x${t}`, 16);
            if (this.isChainApproved(s)) this.setDefaultChain(`${s}`);
            else if (this.namespace.methods.includes("wallet_switchEthereumChain")) await this.client.request({
                topic: e.topic,
                request: {
                    method: e.request.method,
                    params: [{
                        chainId: t
                    }]
                },
                chainId: this.namespace.chains ? .[0]
            }), this.setDefaultChain(`${s}`);
            else throw Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);
            return null
        }
        isChainApproved(e) {
            return this.namespace.chains.includes(`${this.name}:${e}`)
        }
        async getCapabilities(e) {
            let t, s = e.request ? .params ? .[0],
                a = e.request ? .params ? .[1] || [];
            if (!s) throw Error("Missing address parameter in `wallet_getCapabilities` request");
            let n = this.client.session.get(e.topic),
                r = n ? .sessionProperties ? .capabilities || {},
                o = a.length > 0 ? a.join(",") : `0x${this.chainId.toString(16)}`,
                c = `${s}${o}`,
                h = r ? .[c];
            if (h) return h;
            try {
                t = ((e, t, s) => {
                    let {
                        sessionProperties: a = {},
                        scopedProperties: n = {}
                    } = e, r = {};
                    if (!(0, i.isValidObject)(n) && !(0, i.isValidObject)(a)) return;
                    let o = z(a);
                    for (let e of s) {
                        let s = B(e);
                        if (!s) continue;
                        r[H(s)] = o;
                        let i = n ? .[`${W}:${s}`];
                        if (i) {
                            let e = i ? .[`${W}:${s}:${t}`];
                            r[H(s)] = { ...r[H(s)],
                                ...z(e || i)
                            }
                        }
                    }
                    for (let [e, t] of Object.entries(r)) 0 === Object.keys(t).length && delete r[e];
                    return Object.keys(r).length > 0 ? r : void 0
                })(n, s, a)
            } catch (e) {
                console.warn("Failed to extract capabilities from session", e)
            }
            if (t) return t;
            let l = await this.client.request(e);
            try {
                await this.client.session.update(e.topic, {
                    sessionProperties: { ...n.sessionProperties || {},
                        capabilities: { ...r || {},
                            [c]: l
                        }
                    }
                })
            } catch (e) {
                console.warn("Failed to update session with capabilities", e)
            }
            return l
        }
        async getCallStatus(e) {
            let t = this.client.session.get(e.topic),
                s = t.sessionProperties ? .bundler_name;
            if (s) {
                let t = this.getBundlerUrl(e.chainId, s);
                try {
                    return await this.getUserOperationReceipt(t, e)
                } catch (e) {
                    console.warn("Failed to fetch call status from bundler", e, t)
                }
            }
            let i = t.sessionProperties ? .bundler_url;
            if (i) try {
                return await this.getUserOperationReceipt(i, e)
            } catch (e) {
                console.warn("Failed to fetch call status from custom bundler", e, i)
            }
            let a = await Y({
                resultId: e.request.params ? .[0],
                storage: this.storage
            });
            if (a) try {
                return await L(a, this.getHttpProvider.bind(this))
            } catch (e) {
                console.warn("Failed to fetch call status from stored send calls", e, a)
            }
            if (this.namespace.methods.includes(e.request.method)) return await this.client.request(e);
            throw Error("Fetching call status not approved by the wallet.")
        }
        async getUserOperationReceipt(e, t) {
            let s = new URL(e),
                i = await fetch(s, {
                    method: "POST",
                    headers: {
                        "Content-Type": "application/json"
                    },
                    body: JSON.stringify((0, w.formatJsonRpcRequest)("eth_getUserOperationReceipt", [t.request.params ? .[0]]))
                });
            if (!i.ok) throw Error(`Failed to fetch user operation receipt - ${i.status}`);
            return await i.json()
        }
        getBundlerUrl(e, t) {
            return `${S}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`
        }
        async sendCalls(e) {
            let t = await this.client.request(e),
                s = e.request.params ? .[0],
                i = t ? .id,
                a = t ? .capabilities || {},
                n = a ? .caip345 ? .caip2,
                r = a ? .caip345 ? .transactionHashes;
            return i && n && r ? .length && await Q({
                sendCalls: {
                    request: s,
                    result: t
                },
                storage: this.storage
            }), t
        }
    }
    class Z {
        constructor(e) {
            this.name = E, this.namespace = e.namespace, this.events = D("events"), this.client = D("client"), this.chainId = this.getDefaultChain(), this.name = this.getNamespaceName(), this.httpProviders = this.createHttpProviders()
        }
        updateNamespace(e) {
            this.namespace.chains = [...new Set((this.namespace.chains || []).concat(e.chains || []))], this.namespace.accounts = [...new Set((this.namespace.accounts || []).concat(e.accounts || []))], this.namespace.methods = [...new Set((this.namespace.methods || []).concat(e.methods || []))], this.namespace.events = [...new Set((this.namespace.events || []).concat(e.events || []))], this.httpProviders = this.createHttpProviders()
        }
        requestAccounts() {
            return this.getAccounts()
        }
        request(e) {
            return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider(e.chainId).request(e.request)
        }
        setDefaultChain(e, t) {
            this.httpProviders[e] || this.setHttpProvider(e, t);
            let s = this.chainId;
            this.chainId = e, this.events.emit(j, {
                currentCaipChainId: `${this.name}:${e}`,
                previousCaipChainId: `${this.name}:${s}`
            })
        }
        getDefaultChain() {
            if (this.chainId) return this.chainId;
            if (this.namespace.defaultChain) return this.namespace.defaultChain;
            let e = this.namespace.chains[0];
            if (!e) throw Error("ChainId not found");
            return e.split(":")[1]
        }
        getNamespaceName() {
            let e = this.namespace.chains[0];
            if (!e) throw Error("ChainId not found");
            return (0, i.parseChainId)(e).namespace
        }
        getAccounts() {
            let e = this.namespace.accounts;
            return e ? [...new Set(e.filter(e => e.split(":")[1] === this.chainId.toString()).map(e => e.split(":")[2]))] : []
        }
        createHttpProviders() {
            let e = {};
            return this.namespace ? .accounts ? .forEach(t => {
                let s = (0, i.parseChainId)(t),
                    a = this.namespace ? .rpcMap ? .[`${s.namespace}:${s.reference}`];
                e[s.reference] = this.createHttpProvider(t, a)
            }), e
        }
        getHttpProvider(e) {
            let t = (0, i.parseChainId)(e).reference,
                s = this.httpProviders[t];
            if (typeof s > "u") throw Error(`JSON-RPC provider for ${e} not found`);
            return s
        }
        setHttpProvider(e, t) {
            let s = this.createHttpProvider(e, t);
            s && (this.httpProviders[e] = s)
        }
        createHttpProvider(e, t) {
            let s = t || _(e, this.namespace, this.client.core.projectId);
            return new v.JsonRpcProvider(new y.default(s, D("disableProviderPing")))
        }
    }
    let ee = class e {
        constructor(e) {
            this.events = new C.default, this.rpcProviders = {}, this.disableProviderPing = !1, this.providerOpts = e, this.logger = (0, i.createLogger)({
                logger: e.logger ? ? I,
                name: this.providerOpts.name ? ? b
            }), this.disableProviderPing = e ? .disableProviderPing || !1
        }
        static async init(t) {
            let s = new e(t);
            return await s.initialize(), s
        }
        async request(e, t, s) {
            let [i, a] = this.validateChain(t);
            if (!this.session) throw Error("Please call connect() before request()");
            return await this.getProvider(i).request({
                request: { ...e
                },
                chainId: `${i}:${a}`,
                topic: this.session.topic,
                expiry: s
            })
        }
        sendAsync(e, t, s, i) {
            let a = new Date().getTime();
            this.request(e, s, i).then(e => t(null, (0, w.formatJsonRpcResult)(a, e))).catch(e => t(e, void 0))
        }
        async enable() {
            if (!this.client) throw Error("Sign Client not initialized");
            return this.session || await this.connect({
                namespaces: this.namespaces,
                optionalNamespaces: this.optionalNamespaces,
                sessionProperties: this.sessionProperties,
                scopedProperties: this.scopedProperties
            }), await this.requestAccounts()
        }
        async disconnect() {
            if (!this.session) throw Error("Please call connect() before enable()");
            await this.client.disconnect({
                topic: this.session ? .topic,
                reason: (0, i.getSdkError)("USER_DISCONNECTED")
            }), await this.cleanup()
        }
        async connect(e) {
            if (!this.client) throw Error("Sign Client not initialized");
            if (this.connectParams = e, this.setNamespaces(e), this.cleanupPendingPairings(), !e.skipPairing) return await this.pair(e.pairingTopic)
        }
        async authenticate(e, t) {
            if (!this.client) throw Error("Sign Client not initialized");
            this.setNamespaces(e), await this.cleanupPendingPairings();
            let {
                uri: s,
                response: i
            } = await this.client.authenticate(e, t);
            s && (this.uri = s, this.events.emit("display_uri", s));
            let a = await i();
            if (this.session = a.session, this.session) {
                let e = M(this.session.namespaces);
                this.namespaces = N(this.namespaces, e), await this.persist("namespaces", this.namespaces), this.onConnect()
            }
            return a
        }
        on(e, t) {
            this.events.on(e, t)
        }
        once(e, t) {
            this.events.once(e, t)
        }
        removeListener(e, t) {
            this.events.removeListener(e, t)
        }
        off(e, t) {
            this.events.off(e, t)
        }
        get isWalletConnect() {
            return !0
        }
        async pair(e) {
            let {
                uri: t,
                approval: s
            } = await this.client.connect({
                pairingTopic: e,
                requiredNamespaces: this.namespaces,
                optionalNamespaces: this.optionalNamespaces,
                sessionProperties: this.sessionProperties,
                scopedProperties: this.scopedProperties,
                authentication: this.connectParams ? .authentication,
                walletPay: this.connectParams ? .walletPay
            });
            t && (this.uri = t, this.events.emit("display_uri", t));
            let i = await s();
            this.session = i;
            let a = M(i.namespaces);
            return this.namespaces = N(this.namespaces, a), await this.persist("namespaces", this.namespaces), await this.persist("optionalNamespaces", this.optionalNamespaces), this.onConnect(), this.session
        }
        setDefaultChain(e, t) {
            try {
                if (!this.session) return;
                let [s, i] = this.validateChain(e), a = this.getProvider(s);
                a ? a.setDefaultChain(i, t) : this.session && this.logger.warn(`Provider for namespace '${s}' not found in setDefaultChain`)
            } catch (e) {
                if (!/Please call connect/.test(e.message)) throw e
            }
        }
        async cleanupPendingPairings(e = {}) {
            try {
                this.logger.info("Cleaning up inactive pairings...");
                let t = this.client.pairing.getAll();
                if (!(0, i.isValidArray)(t)) return;
                for (let s of t) e.deletePairings ? this.client.core.expirer.set(s.topic, 0) : await this.client.core.relayer.subscriber.unsubscribe(s.topic);
                this.logger.info(`Inactive pairings cleared: ${t.length}`)
            } catch (e) {
                this.logger.warn(e, "Failed to cleanup pending pairings")
            }
        }
        abortPairingAttempt() {
            this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")
        }
        async checkStorage() {
            this.namespaces = await this.getFromStore("namespaces") || {}, this.optionalNamespaces = await this.getFromStore("optionalNamespaces") || {}, this.session && this.createProviders()
        }
        async initialize() {
            this.logger.trace("Initialized"), await this.createClient(), await this.checkStorage(), this.registerEventListeners()
        }
        async createClient() {
            if (this.client = this.providerOpts.client || await s.SignClient.init({
                    core: this.providerOpts.core,
                    logger: this.providerOpts.logger || I,
                    relayUrl: this.providerOpts.relayUrl || "wss://relay.walletconnect.org",
                    projectId: this.providerOpts.projectId,
                    metadata: this.providerOpts.metadata,
                    storageOptions: this.providerOpts.storageOptions,
                    storage: this.providerOpts.storage,
                    name: this.providerOpts.name,
                    customStoragePrefix: this.providerOpts.customStoragePrefix,
                    telemetryEnabled: this.providerOpts.telemetryEnabled
                }), this.providerOpts.session) try {
                this.session = this.client.session.get(this.providerOpts.session.topic)
            } catch (e) {
                throw this.logger.error(e, "Failed to get session"), Error(`The provided session: ${this.providerOpts?.session?.topic} doesn't exist in the Sign client`)
            } else {
                let e = this.client.session.getAll();
                this.session = e[0]
            }
            this.logger.trace("SignClient Initialized")
        }
        createProviders() {
            if (!this.client) throw Error("Sign Client not initialized");
            if (!this.session) throw Error("Session not initialized. Please call connect() before enable()");
            let e = [...new Set(Object.keys(this.session.namespaces).map(e => (0, i.parseNamespaceKey)(e)))];
            F("client", this.client), F("events", this.events), F("disableProviderPing", this.disableProviderPing), e.forEach(e => {
                if (!this.session) return;
                let t = function(e, t) {
                    let s = Object.keys(t.namespaces).filter(t => t.includes(e));
                    if (!s.length) return [];
                    let i = [];
                    return s.forEach(e => {
                        let s = t.namespaces[e].accounts;
                        i.push(...s)
                    }), i
                }(e, this.session);
                if (t ? .length === 0) return;
                let s = $(t),
                    i = { ...N(this.namespaces, this.optionalNamespaces)[e],
                        accounts: t,
                        chains: s
                    };
                "eip155" === e ? this.rpcProviders[e] = new X({
                    namespace: i
                }) : this.rpcProviders[e] = new Z({
                    namespace: i
                })
            })
        }
        registerEventListeners() {
            if (typeof this.client > "u") throw Error("Sign Client is not initialized");
            this.client.on("session_ping", e => {
                let {
                    topic: t
                } = e;
                t === this.session ? .topic && this.events.emit("session_ping", e)
            }), this.client.on("session_event", e => {
                let {
                    params: t,
                    topic: s
                } = e;
                if (s !== this.session ? .topic) return;
                let {
                    event: a
                } = t;
                if ("accountsChanged" === a.name) {
                    let e = a.data;
                    e && (0, i.isValidArray)(e) && this.events.emit("accountsChanged", e.map(x))
                } else if ("chainChanged" === a.name) {
                    let e = t.chainId,
                        s = t.event.data,
                        a = (0, i.parseNamespaceKey)(e),
                        n = R(e) !== R(s) ? `${a}:${R(s)}` : e;
                    this.onChainChanged({
                        currentCaipChainId: n
                    })
                } else this.events.emit(a.name, a.data);
                this.events.emit("session_event", e)
            }), this.client.on("session_update", ({
                topic: e,
                params: t
            }) => {
                if (e !== this.session ? .topic) return;
                let {
                    namespaces: s
                } = t, i = this.client ? .session.get(e);
                this.session = { ...i,
                    namespaces: s
                }, this.onSessionUpdate(), this.events.emit("session_update", {
                    topic: e,
                    params: t
                })
            }), this.client.on("session_delete", async e => {
                e.topic === this.session ? .topic && (await this.cleanup(), this.events.emit("session_delete", e), this.events.emit("disconnect", { ...(0, i.getSdkError)("USER_DISCONNECTED"),
                    data: e.topic
                }))
            }), this.on(j, e => {
                this.onChainChanged({ ...e,
                    internal: !0
                })
            })
        }
        getProvider(e) {
            return this.rpcProviders[e] || this.rpcProviders[E]
        }
        onSessionUpdate() {
            Object.keys(this.rpcProviders).forEach(e => {
                this.getProvider(e).updateNamespace(this.session ? .namespaces[e])
            })
        }
        setNamespaces(e) {
            let {
                namespaces: t = {},
                optionalNamespaces: s = {},
                sessionProperties: i,
                scopedProperties: a
            } = e;
            this.optionalNamespaces = N(t, s), this.sessionProperties = i, this.scopedProperties = a
        }
        validateChain(e) {
            let [t, s] = e ? .split(":") || ["", ""];
            if (!this.namespaces || !Object.keys(this.namespaces).length) return [t, s];
            if (t && !Object.keys(this.namespaces || {}).map(e => (0, i.parseNamespaceKey)(e)).includes(t)) throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);
            if (t && s) return [t, s];
            let a = (0, i.parseNamespaceKey)(Object.keys(this.namespaces)[0]),
                n = this.rpcProviders[a].getDefaultChain();
            return [a, n]
        }
        async requestAccounts() {
            let [e] = this.validateChain();
            return await this.getProvider(e).requestAccounts()
        }
        async onChainChanged({
            currentCaipChainId: e,
            previousCaipChainId: t,
            internal: s = !1
        }) {
            if (!this.namespaces) return;
            let [i, a] = this.validateChain(e);
            if (a) {
                if (this.updateNamespaceChain(i, a), s) this.events.emit("chainChanged", a), this.emitAccountsChangedOnChainChange({
                    namespace: i,
                    currentCaipChainId: e,
                    previousCaipChainId: t
                });
                else {
                    let e = this.getProvider(i);
                    e ? e.setDefaultChain(a) : this.session && this.logger.warn(`Provider for namespace '${i}' not found during chain change`)
                }
                await this.persist("namespaces", this.namespaces)
            }
        }
        emitAccountsChangedOnChainChange({
            namespace: e,
            currentCaipChainId: t,
            previousCaipChainId: s
        }) {
            try {
                if (s === t) return;
                let a = this.session ? .namespaces[e] ? .accounts;
                if (!a) return;
                let n = a.filter(e => e.includes(`${t}:`)).map(x);
                if (!(0, i.isValidArray)(n)) return;
                this.events.emit("accountsChanged", n)
            } catch (e) {
                this.logger.warn(e, "Failed to emit accountsChanged on chain change")
            }
        }
        updateNamespaceChain(e, t) {
            if (!this.namespaces) return;
            let s = this.namespaces[e] ? e : `${e}:${t}`;
            this.namespaces[s] ? this.namespaces[s] && (this.namespaces[s].defaultChain = t) : this.namespaces[s] = {
                chains: [],
                methods: [],
                events: [],
                defaultChain: t
            }
        }
        onConnect() {
            this.createProviders(), this.events.emit("connect", {
                session: this.session
            })
        }
        async cleanup() {
            this.connectParams = void 0, this.namespaces = void 0, this.optionalNamespaces = void 0, this.sessionProperties = void 0, await this.deleteFromStore("namespaces"), await this.deleteFromStore("optionalNamespaces"), await this.deleteFromStore("sessionProperties"), this.session = void 0, this.cleanupPendingPairings({
                deletePairings: !0
            }), await this.cleanupStorage()
        }
        async persist(e, t) {
            let s = this.session ? .topic || "";
            await this.client.core.storage.setItem(`${P}/${e}${s}`, t)
        }
        async getFromStore(e) {
            let t = this.session ? .topic || "";
            return await this.client.core.storage.getItem(`${P}/${e}${t}`)
        }
        async deleteFromStore(e) {
            let t = this.session ? .topic || "";
            await this.client.core.storage.removeItem(`${P}/${e}${t}`)
        }
        async cleanupStorage() {
            try {
                if (this.client ? .session.length > 0) return;
                for (let e of (await this.client.core.storage.getKeys())) e.startsWith(P) && await this.client.core.storage.removeItem(e)
            } catch (e) {
                this.logger.warn(e, "Failed to cleanup storage")
            }
        }
    };
    e.s(["UniversalProvider", 0, ee], 857224)
}, 307861, e => {
    "use strict";
    var t = e.i(379666),
        s = e.i(613532),
        i = e.i(857224);
    let a = ["eth_sendTransaction", "personal_sign"],
        n = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_sendCalls", "wallet_getCapabilities", "wallet_getCallsStatus", "wallet_showCallsStatus"],
        r = ["chainChanged", "accountsChanged"],
        o = ["chainChanged", "accountsChanged", "message", "disconnect", "connect"],
        c = async () => {
            let {
                createAppKit: t
            } = await e.A(397959);
            return t
        };

    function h(e) {
        return Number(e[0].split(":")[1])
    }

    function l(e) {
        return `0x${e.toString(16)}`
    }
    let p = class e {
            constructor() {
                this.events = new t.EventEmitter, this.namespace = "eip155", this.accounts = [], this.chainId = 1, this.STORAGE_KEY = "wc@2:ethereum_provider:", this.on = (e, t) => (this.events.on(e, t), this), this.once = (e, t) => (this.events.once(e, t), this), this.removeListener = (e, t) => (this.events.removeListener(e, t), this), this.off = (e, t) => (this.events.off(e, t), this), this.parseAccount = e => this.isCompatibleChainId(e) ? this.parseAccountId(e).address : e, this.signer = {}, this.rpc = {}
            }
            static async init(t) {
                let s = new e;
                return await s.initialize(t), s
            }
            async request(e, t) {
                return await this.signer.request(e, this.formatChainId(this.chainId), t)
            }
            sendAsync(e, t, s) {
                this.signer.sendAsync(e, t, this.formatChainId(this.chainId), s)
            }
            get connected() {
                return !!this.signer.client && this.signer.client.core.relayer.connected
            }
            get connecting() {
                return !!this.signer.client && this.signer.client.core.relayer.connecting
            }
            async enable() {
                return this.session || await this.connect(), await this.request({
                    method: "eth_requestAccounts"
                })
            }
            async connect(e) {
                if (!this.signer.client) throw Error("Provider not initialized. Call init() first");
                this.loadConnectOpts(e);
                let {
                    required: t,
                    optional: i
                } = function(e) {
                    let {
                        chains: t,
                        optionalChains: i,
                        methods: c,
                        optionalMethods: l,
                        events: p,
                        optionalEvents: d,
                        rpcMap: u
                    } = e;
                    if (!(0, s.isValidArray)(t)) throw Error("Invalid chains");
                    let m = {
                            chains: t,
                            methods: c || a,
                            events: p || r,
                            rpcMap: { ...t.length ? {
                                    [h(t)]: u[h(t)]
                                } : {}
                            }
                        },
                        g = p ? .filter(e => !r.includes(e)),
                        f = c ? .filter(e => !a.includes(e));
                    if (!i && !d && !l && !g ? .length && !f ? .length) return {
                        required: t.length ? m : void 0
                    };
                    let w = {
                        chains: [...new Set(g ? .length && f ? .length || !i ? m.chains.concat(i || []) : i)],
                        methods: [...new Set(m.methods.concat(l ? .length ? l : n))],
                        events: [...new Set(m.events.concat(d ? .length ? d : o))],
                        rpcMap: u
                    };
                    return {
                        required: t.length ? m : void 0,
                        optional: i.length ? w : void 0
                    }
                }(this.rpc);
                try {
                    let a = await new Promise(async (s, a) => {
                        this.rpc.showQrModal && (this.modal ? .open(), this.modal ? .subscribeState(e => {
                            e.open || this.signer.session || (this.signer.abortPairingAttempt(), a(Error("Connection request reset. Please try again.")))
                        }));
                        let n = e ? .scopedProperties ? {
                            [this.namespace]: e.scopedProperties
                        } : void 0;
                        await this.signer.connect({
                            namespaces: { ...t && {
                                    [this.namespace]: t
                                }
                            },
                            ...i && {
                                optionalNamespaces: {
                                    [this.namespace]: i
                                }
                            },
                            pairingTopic: e ? .pairingTopic,
                            scopedProperties: n
                        }).then(e => {
                            s(e)
                        }).catch(e => {
                            this.modal ? .showErrorMessage("Unable to connect"), a(Error(e.message))
                        })
                    });
                    if (!a) return;
                    let n = (0, s.getAccountsFromNamespaces)(a.namespaces, [this.namespace]);
                    this.setChainIds(this.rpc.chains.length ? this.rpc.chains : n), this.setAccounts(n), this.events.emit("connect", {
                        chainId: l(this.chainId)
                    })
                } catch (e) {
                    throw this.signer.logger.error(e), e
                } finally {
                    this.modal ? .close()
                }
            }
            async authenticate(e, t) {
                if (!this.signer.client) throw Error("Provider not initialized. Call init() first");
                this.loadConnectOpts({
                    chains: e ? .chains
                });
                try {
                    let i = await new Promise(async (s, i) => {
                            this.rpc.showQrModal && (this.modal ? .open(), this.modal ? .subscribeState(e => {
                                e.open || this.signer.session || (this.signer.abortPairingAttempt(), i(Error("Connection request reset. Please try again.")))
                            })), await this.signer.authenticate({ ...e,
                                chains: this.rpc.chains
                            }, t).then(e => {
                                s(e)
                            }).catch(e => {
                                this.modal ? .showErrorMessage("Unable to connect"), i(Error(e.message))
                            })
                        }),
                        a = i.session;
                    if (a) {
                        let e = (0, s.getAccountsFromNamespaces)(a.namespaces, [this.namespace]);
                        this.setChainIds(this.rpc.chains.length ? this.rpc.chains : e), this.setAccounts(e), this.events.emit("connect", {
                            chainId: l(this.chainId)
                        })
                    }
                    return i
                } catch (e) {
                    throw this.signer.logger.error(e), e
                } finally {
                    this.modal ? .close()
                }
            }
            async disconnect() {
                this.session && await this.signer.disconnect(), this.reset()
            }
            get isWalletConnect() {
                return !0
            }
            get session() {
                return this.signer.session
            }
            registerEventListeners() {
                this.signer.on("session_event", e => {
                    let {
                        params: t
                    } = e, {
                        event: s
                    } = t;
                    "accountsChanged" === s.name ? (this.accounts = this.parseAccounts(s.data), this.events.emit("accountsChanged", this.accounts)) : "chainChanged" === s.name ? this.setChainId(this.formatChainId(s.data)) : this.events.emit(s.name, s.data), this.events.emit("session_event", e)
                }), this.signer.on("accountsChanged", e => {
                    this.accounts = this.parseAccounts(e), this.events.emit("accountsChanged", this.accounts)
                }), this.signer.on("chainChanged", e => {
                    let t = parseInt(e);
                    this.chainId = t, this.events.emit("chainChanged", l(this.chainId)), this.persist()
                }), this.signer.on("session_update", e => {
                    this.events.emit("session_update", e)
                }), this.signer.on("session_delete", e => {
                    this.reset(), this.events.emit("session_delete", e), this.events.emit("disconnect", { ...(0, s.getSdkError)("USER_DISCONNECTED"),
                        data: e.topic,
                        name: "USER_DISCONNECTED"
                    })
                }), this.signer.on("display_uri", e => {
                    this.events.emit("display_uri", e)
                })
            }
            switchEthereumChain(e) {
                this.request({
                    method: "wallet_switchEthereumChain",
                    params: [{
                        chainId: e.toString(16)
                    }]
                })
            }
            isCompatibleChainId(e) {
                return "string" == typeof e && e.startsWith(`${this.namespace}:`)
            }
            formatChainId(e) {
                return `${this.namespace}:${e}`
            }
            parseChainId(e) {
                return Number(e.split(":")[1])
            }
            setChainIds(e) {
                let t = e.filter(e => this.isCompatibleChainId(e)).map(e => this.parseChainId(e));
                t.length && (this.chainId = t[0], this.events.emit("chainChanged", l(this.chainId)), this.persist())
            }
            setChainId(e) {
                if (this.isCompatibleChainId(e)) {
                    let t = this.parseChainId(e);
                    this.chainId = t, this.switchEthereumChain(t)
                }
            }
            parseAccountId(e) {
                let [t, s, i] = e.split(":");
                return {
                    chainId: `${t}:${s}`,
                    address: i
                }
            }
            setAccounts(e) {
                this.accounts = e.filter(e => this.parseChainId(this.parseAccountId(e).chainId) === this.chainId).map(e => this.parseAccountId(e).address), this.events.emit("accountsChanged", this.accounts)
            }
            getRpcConfig(e) {
                let t = e ? .chains ? ? [],
                    s = e ? .optionalChains ? ? [],
                    i = t.concat(s);
                if (!i.length) throw Error("No chains specified in either `chains` or `optionalChains`");
                let n = t.length ? e ? .methods || a : [],
                    o = t.length ? e ? .events || r : [],
                    c = e ? .optionalMethods || [],
                    h = e ? .optionalEvents || [],
                    l = e ? .rpcMap || this.buildRpcMap(i, e.projectId),
                    p = e ? .qrModalOptions || void 0;
                return {
                    chains: t ? .map(e => this.formatChainId(e)),
                    optionalChains: s.map(e => this.formatChainId(e)),
                    methods: n,
                    events: o,
                    optionalMethods: c,
                    optionalEvents: h,
                    rpcMap: l,
                    showQrModal: !!e ? .showQrModal,
                    qrModalOptions: p,
                    projectId: e.projectId,
                    metadata: e.metadata
                }
            }
            buildRpcMap(e, t) {
                let s = {};
                return e.forEach(e => {
                    s[e] = this.getRpcUrl(e, t)
                }), s
            }
            async initialize(e) {
                if (this.rpc = this.getRpcConfig(e), this.chainId = this.rpc.chains.length ? h(this.rpc.chains) : h(this.rpc.optionalChains), this.signer = await i.UniversalProvider.init({
                        projectId: this.rpc.projectId,
                        metadata: this.rpc.metadata,
                        disableProviderPing: e.disableProviderPing,
                        relayUrl: e.relayUrl,
                        storage: e.storage,
                        storageOptions: e.storageOptions,
                        customStoragePrefix: e.customStoragePrefix,
                        telemetryEnabled: e.telemetryEnabled,
                        logger: e.logger
                    }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) {
                    let e;
                    try {
                        let t = await c(),
                            {
                                convertWCMToAppKitOptions: s
                            } = await Promise.resolve().then(function() {
                                return m
                            }),
                            i = s({ ...this.rpc.qrModalOptions,
                                chains: [...new Set([...this.rpc.chains, ...this.rpc.optionalChains])],
                                metadata: this.rpc.metadata,
                                projectId: this.rpc.projectId
                            });
                        if (!i.networks.length) throw Error("No networks found for WalletConnect");
                        e = t({ ...i,
                            universalProvider: this.signer,
                            manualWCControl: !0,
                            enableMobileFullScreen: this.rpc.qrModalOptions ? .enableMobileFullScreen === !0
                        })
                    } catch (e) {
                        throw console.warn(e), Error("To use QR modal, please install @reown/appkit package")
                    }
                    if (e) try {
                        this.modal = e
                    } catch (e) {
                        throw this.signer.logger.error(e), Error("Could not generate WalletConnectModal Instance")
                    }
                }
            }
            loadConnectOpts(e) {
                if (!e) return;
                let {
                    chains: t,
                    optionalChains: i,
                    rpcMap: a
                } = e;
                t && (0, s.isValidArray)(t) && (this.rpc.chains = t.map(e => this.formatChainId(e)), t.forEach(e => {
                    this.rpc.rpcMap[e] = a ? .[e] || this.getRpcUrl(e)
                })), i && (0, s.isValidArray)(i) && (this.rpc.optionalChains = [], this.rpc.optionalChains = i ? .map(e => this.formatChainId(e)), i.forEach(e => {
                    this.rpc.rpcMap[e] = a ? .[e] || this.getRpcUrl(e)
                }))
            }
            getRpcUrl(e, t) {
                return this.rpc.rpcMap ? .[e] || `https://rpc.walletconnect.org/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`
            }
            async loadPersistedSession() {
                if (this.session) try {
                    let e = await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),
                        t = this.session.namespaces[`${this.namespace}:${e}`] ? this.session.namespaces[`${this.namespace}:${e}`] : this.session.namespaces[this.namespace];
                    this.setChainIds(e ? [this.formatChainId(e)] : t ? .accounts), this.setAccounts(t ? .accounts)
                } catch (e) {
                    this.signer.logger.error("Failed to load persisted session, clearing state..."), this.signer.logger.error(e), await this.disconnect().catch(e => this.signer.logger.warn(e))
                }
            }
            reset() {
                this.chainId = 1, this.accounts = []
            }
            persist() {
                this.session && this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`, this.chainId)
            }
            parseAccounts(e) {
                return "string" == typeof e || e instanceof String ? [this.parseAccount(e)] : e.map(e => this.parseAccount(e))
            }
        },
        d = e => {
            let [t, s] = e.split(":");
            return u({
                id: s,
                caipNetworkId: e,
                chainNamespace: t,
                name: "",
                nativeCurrency: {
                    name: "",
                    symbol: "",
                    decimals: 8
                },
                rpcUrls: {
                    default: {
                        http: ["https://rpc.walletconnect.org/v1"]
                    }
                }
            })
        };

    function u(e) {
        return {
            formatters: void 0,
            fees: void 0,
            serializers: void 0,
            ...e
        }
    }
    var m = Object.freeze({
        __proto__: null,
        convertWCMToAppKitOptions: function(e) {
            let t = e.chains ? .map(d).filter(Boolean);
            if (0 === t.length) throw Error("At least one chain must be specified");
            let s = t.find(t => t.id === e.defaultChain ? .id),
                i = {
                    projectId: e.projectId,
                    networks: t,
                    themeMode: e.themeMode,
                    themeVariables: function(e) {
                        if (e) return {
                            "--w3m-font-family": e["--wcm-font-family"],
                            "--w3m-accent": e["--wcm-accent-color"],
                            "--w3m-color-mix": e["--wcm-background-color"],
                            "--w3m-z-index": e["--wcm-z-index"] ? Number(e["--wcm-z-index"]) : void 0,
                            "--w3m-qr-color": e["--wcm-accent-color"],
                            "--w3m-font-size-master": e["--wcm-text-medium-regular-size"],
                            "--w3m-border-radius-master": e["--wcm-container-border-radius"],
                            "--w3m-color-mix-strength": 0
                        }
                    }(e.themeVariables),
                    chainImages: e.chainImages,
                    connectorImages: e.walletImages,
                    defaultNetwork: s,
                    metadata: { ...e.metadata,
                        name: e.metadata ? .name || "WalletConnect",
                        description: e.metadata ? .description || "Connect to WalletConnect-compatible wallets",
                        url: e.metadata ? .url || "https://walletconnect.org",
                        icons: e.metadata ? .icons || ["https://walletconnect.org/walletconnect-logo.png"]
                    },
                    showWallets: !0,
                    featuredWalletIds: "NONE" === e.explorerRecommendedWalletIds ? [] : Array.isArray(e.explorerRecommendedWalletIds) ? e.explorerRecommendedWalletIds : [],
                    excludeWalletIds: "ALL" === e.explorerExcludedWalletIds ? [] : Array.isArray(e.explorerExcludedWalletIds) ? e.explorerExcludedWalletIds : [],
                    enableEIP6963: !1,
                    enableInjected: !1,
                    enableCoinbase: !0,
                    enableWalletConnect: !0,
                    features: {
                        email: !1,
                        socials: !1
                    }
                };
            if (e.mobileWallets ? .length || e.desktopWallets ? .length) {
                let t = [...(e.mobileWallets || []).map(e => ({
                        id: e.id,
                        name: e.name,
                        links: e.links
                    })), ...(e.desktopWallets || []).map(e => ({
                        id: e.id,
                        name: e.name,
                        links: {
                            native: e.links.native,
                            universal: e.links.universal
                        }
                    }))],
                    s = [...i.featuredWalletIds || [], ...i.excludeWalletIds || []],
                    a = t.filter(e => !s.includes(e.id));
                a.length && (i.customWallets = a)
            }
            return i
        },
        defineChain: u
    });
    e.s(["EthereumProvider", 0, p, "OPTIONAL_EVENTS", 0, o, "OPTIONAL_METHODS", 0, n, "REQUIRED_EVENTS", 0, r, "REQUIRED_METHODS", 0, a, "default", 0, p])
}, 397959, e => {
    e.v(t => Promise.all(["static/chunks/1615a2sv5o2cw.js", "static/chunks/0o6cfx~a79g9-.js", "static/chunks/0lpshub_5.2ww.js", "static/chunks/0f5ot3f6k8vah.js"].map(t => e.l(t))).then(() => t(191369)))
}]);

//# debugId=1bda5105-61bf-1997-e40a-56a34d110ede